commit 830b3c68c1fb1e9176028d02ef86f3cf76aa2476 Author: Linus Torvalds Date: Sun Dec 11 14:15:18 2022 -0800 Linux 6.1 commit d92b86f672a42d9d74a24a63a1e59793c4116830 Merge: 4cee37b3a4e68 81c95fbaebfa5 Author: Linus Torvalds Date: Sun Dec 11 09:49:39 2022 -0800 Merge tag 'iommu-fix-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fix from Joerg Roedel: - Fix device mask to catch all affected devices in the recently added quirk for QAT devices in the Intel VT-d driver. * tag 'iommu-fix-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Fix buggy QAT device mask commit 4cee37b3a4e68c42b867c87a6218e11bc571ba66 Merge: 296a7b7eb7924 4a7ba45b1a435 Author: Linus Torvalds Date: Sat Dec 10 17:10:52 2022 -0800 Merge tag 'mm-hotfixes-stable-2022-12-10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "Nine hotfixes. Six for MM, three for other areas. Four of these patches address post-6.0 issues" * tag 'mm-hotfixes-stable-2022-12-10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: memcg: fix possible use-after-free in memcg_write_event_control() MAINTAINERS: update Muchun Song's email mm/gup: fix gup_pud_range() for dax mmap: fix do_brk_flags() modifying obviously incorrect VMAs mm/swap: fix SWP_PFN_BITS with CONFIG_PHYS_ADDR_T_64BIT on 32bit tmpfs: fix data loss from failed fallocate kselftests: cgroup: update kmem test precision tolerance mm: do not BUG_ON missing brk mapping, because userspace can unmap it mailmap: update Matti Vaittinen's email address commit 296a7b7eb79246912de31ee799cb85220931231a Merge: 3ecc37918c80f 73a0b6ee5d626 Author: Linus Torvalds Date: Sat Dec 10 10:14:52 2022 -0800 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fix from Russell King: "One further ARM fix for 6.1 from Wang Kefeng, fixing up the handling for kfence faults" * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9278/1: kfence: only handle translation faults commit 4a7ba45b1a435e7097ca0f79a847d0949d0eb088 Author: Tejun Heo Date: Wed Dec 7 16:53:15 2022 -1000 memcg: fix possible use-after-free in memcg_write_event_control() memcg_write_event_control() accesses the dentry->d_name of the specified control fd to route the write call. As a cgroup interface file can't be renamed, it's safe to access d_name as long as the specified file is a regular cgroup file. Also, as these cgroup interface files can't be removed before the directory, it's safe to access the parent too. Prior to 347c4a874710 ("memcg: remove cgroup_event->cft"), there was a call to __file_cft() which verified that the specified file is a regular cgroupfs file before further accesses. The cftype pointer returned from __file_cft() was no longer necessary and the commit inadvertently dropped the file type check with it allowing any file to slip through. With the invarients broken, the d_name and parent accesses can now race against renames and removals of arbitrary files and cause use-after-free's. Fix the bug by resurrecting the file type check in __file_cft(). Now that cgroupfs is implemented through kernfs, checking the file operations needs to go through a layer of indirection. Instead, let's check the superblock and dentry type. Link: https://lkml.kernel.org/r/Y5FRm/cfcKPGzWwl@slm.duckdns.org Fixes: 347c4a874710 ("memcg: remove cgroup_event->cft") Signed-off-by: Tejun Heo Reported-by: Jann Horn Acked-by: Roman Gushchin Acked-by: Johannes Weiner Cc: Linus Torvalds Cc: Michal Hocko Cc: Muchun Song Cc: Shakeel Butt Cc: [3.14+] Signed-off-by: Andrew Morton commit a501788ab2603d97c41e8cda59cd74b72c29951f Author: Muchun Song Date: Thu Dec 8 19:55:48 2022 +0800 MAINTAINERS: update Muchun Song's email I'm moving to the @linux.dev account. Map my old addresses and update it to my new address. Link: https://lkml.kernel.org/r/20221208115548.85244-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Signed-off-by: Andrew Morton commit fcd0ccd836ffad73d98a66f6fea7b16f735ea920 Author: John Starks Date: Tue Dec 6 22:00:53 2022 -0800 mm/gup: fix gup_pud_range() for dax For dax pud, pud_huge() returns true on x86. So the function works as long as hugetlb is configured. However, dax doesn't depend on hugetlb. Commit 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax") fixed devmap-backed huge PMDs, but missed devmap-backed huge PUDs. Fix this as well. This fixes the below kernel panic: general protection fault, probably for non-canonical address 0x69e7c000cc478: 0000 [#1] SMP < snip > Call Trace: get_user_pages_fast+0x1f/0x40 iov_iter_get_pages+0xc6/0x3b0 ? mempool_alloc+0x5d/0x170 bio_iov_iter_get_pages+0x82/0x4e0 ? bvec_alloc+0x91/0xc0 ? bio_alloc_bioset+0x19a/0x2a0 blkdev_direct_IO+0x282/0x480 ? __io_complete_rw_common+0xc0/0xc0 ? filemap_range_has_page+0x82/0xc0 generic_file_direct_write+0x9d/0x1a0 ? inode_update_time+0x24/0x30 __generic_file_write_iter+0xbd/0x1e0 blkdev_write_iter+0xb4/0x150 ? io_import_iovec+0x8d/0x340 io_write+0xf9/0x300 io_issue_sqe+0x3c3/0x1d30 ? sysvec_reschedule_ipi+0x6c/0x80 __io_queue_sqe+0x33/0x240 ? fget+0x76/0xa0 io_submit_sqes+0xe6a/0x18d0 ? __fget_light+0xd1/0x100 __x64_sys_io_uring_enter+0x199/0x880 ? __context_tracking_enter+0x1f/0x70 ? irqentry_exit_to_user_mode+0x24/0x30 ? irqentry_exit+0x1d/0x30 ? __context_tracking_exit+0xe/0x70 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fc97c11a7be < snip > ---[ end trace 48b2e0e67debcaeb ]--- RIP: 0010:internal_get_user_pages_fast+0x340/0x990 < snip > Kernel panic - not syncing: Fatal exception Kernel Offset: disabled Link: https://lkml.kernel.org/r/1670392853-28252-1-git-send-email-ssengar@linux.microsoft.com Fixes: 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax") Signed-off-by: John Starks Signed-off-by: Saurabh Sengar Cc: Jan Kara Cc: Yu Zhao Cc: Jason Gunthorpe Cc: John Hubbard Cc: David Hildenbrand Cc: Dan Williams Cc: Alistair Popple Cc: Signed-off-by: Andrew Morton commit 6c28ca6485ddd7c5da171e479e3ebfbe661efc4d Author: Liam Howlett Date: Mon Dec 5 19:23:17 2022 +0000 mmap: fix do_brk_flags() modifying obviously incorrect VMAs Add more sanity checks to the VMA that do_brk_flags() will expand. Ensure the VMA matches basic merge requirements within the function before calling can_vma_merge_after(). Drop the duplicate checks from vm_brk_flags() since they will be enforced later. The old code would expand file VMAs on brk(), which is functionally wrong and also dangerous in terms of locking because the brk() path isn't designed for file VMAs and therefore doesn't lock the file mapping. Checking can_vma_merge_after() ensures that new anonymous VMAs can't be merged into file VMAs. See https://lore.kernel.org/linux-mm/CAG48ez1tJZTOjS_FjRZhvtDA-STFmdw8PEizPDwMGFd_ui0Nrw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20221205192304.1957418-1-Liam.Howlett@oracle.com Fixes: 2e7ce7d354f2 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()") Signed-off-by: Liam R. Howlett Suggested-by: Jann Horn Cc: Jason A. Donenfeld Cc: Matthew Wilcox Cc: SeongJae Park Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton commit 630dc25e43dacfb5af94cd41532e77c47ec1caff Author: David Hildenbrand Date: Mon Dec 5 16:08:57 2022 +0100 mm/swap: fix SWP_PFN_BITS with CONFIG_PHYS_ADDR_T_64BIT on 32bit We use "unsigned long" to store a PFN in the kernel and phys_addr_t to store a physical address. On a 64bit system, both are 64bit wide. However, on a 32bit system, the latter might be 64bit wide. This is, for example, the case on x86 with PAE: phys_addr_t and PTEs are 64bit wide, while "unsigned long" only spans 32bit. The current definition of SWP_PFN_BITS without MAX_PHYSMEM_BITS misses that case, and assumes that the maximum PFN is limited by an 32bit phys_addr_t. This implies, that SWP_PFN_BITS will currently only be able to cover 4 GiB - 1 on any 32bit system with 4k page size, which is wrong. Let's rely on the number of bits in phys_addr_t instead, but make sure to not exceed the maximum swap offset, to not make the BUILD_BUG_ON() in is_pfn_swap_entry() unhappy. Note that swp_entry_t is effectively an unsigned long and the maximum swap offset shares that value with the swap type. For example, on an 8 GiB x86 PAE system with a kernel config based on Debian 11.5 (-> CONFIG_FLATMEM=y, CONFIG_X86_PAE=y), we will currently fail removing migration entries (remove_migration_ptes()), because mm/page_vma_mapped.c:check_pte() will fail to identify a PFN match as swp_offset_pfn() wrongly masks off PFN bits. For example, split_huge_page_to_list()->...->remap_page() will leave migration entries in place and continue to unlock the page. Later, when we stumble over these migration entries (e.g., via /proc/self/pagemap), pfn_swap_entry_to_page() will BUG_ON() because these migration entries shouldn't exist anymore and the page was unlocked. [ 33.067591] kernel BUG at include/linux/swapops.h:497! [ 33.067597] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 33.067602] CPU: 3 PID: 742 Comm: cow Tainted: G E 6.1.0-rc8+ #16 [ 33.067605] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 [ 33.067606] EIP: pagemap_pmd_range+0x644/0x650 [ 33.067612] Code: 00 00 00 00 66 90 89 ce b9 00 f0 ff ff e9 ff fb ff ff 89 d8 31 db e8 48 c6 52 00 e9 23 fb ff ff e8 61 83 56 00 e9 b6 fe ff ff <0f> 0b bf 00 f0 ff ff e9 38 fa ff ff 3e 8d 74 26 00 55 89 e5 57 31 [ 33.067615] EAX: ee394000 EBX: 00000002 ECX: ee394000 EDX: 00000000 [ 33.067617] ESI: c1b0ded4 EDI: 00024a00 EBP: c1b0ddb4 ESP: c1b0dd68 [ 33.067619] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010246 [ 33.067624] CR0: 80050033 CR2: b7a00000 CR3: 01bbbd20 CR4: 00350ef0 [ 33.067625] Call Trace: [ 33.067628] ? madvise_free_pte_range+0x720/0x720 [ 33.067632] ? smaps_pte_range+0x4b0/0x4b0 [ 33.067634] walk_pgd_range+0x325/0x720 [ 33.067637] ? mt_find+0x1d6/0x3a0 [ 33.067641] ? mt_find+0x1d6/0x3a0 [ 33.067643] __walk_page_range+0x164/0x170 [ 33.067646] walk_page_range+0xf9/0x170 [ 33.067648] ? __kmem_cache_alloc_node+0x2a8/0x340 [ 33.067653] pagemap_read+0x124/0x280 [ 33.067658] ? default_llseek+0x101/0x160 [ 33.067662] ? smaps_account+0x1d0/0x1d0 [ 33.067664] vfs_read+0x90/0x290 [ 33.067667] ? do_madvise.part.0+0x24b/0x390 [ 33.067669] ? debug_smp_processor_id+0x12/0x20 [ 33.067673] ksys_pread64+0x58/0x90 [ 33.067675] __ia32_sys_ia32_pread64+0x1b/0x20 [ 33.067680] __do_fast_syscall_32+0x4c/0xc0 [ 33.067683] do_fast_syscall_32+0x29/0x60 [ 33.067686] do_SYSENTER_32+0x15/0x20 [ 33.067689] entry_SYSENTER_32+0x98/0xf1 Decrease the indentation level of SWP_PFN_BITS and SWP_PFN_MASK to keep it readable and consistent. [david@redhat.com: rely on sizeof(phys_addr_t) and min_t() instead] Link: https://lkml.kernel.org/r/20221206105737.69478-1-david@redhat.com [david@redhat.com: use "int" for comparison, as we're only comparing numbers < 64] Link: https://lkml.kernel.org/r/1f157500-2676-7cef-a84e-9224ed64e540@redhat.com Link: https://lkml.kernel.org/r/20221205150857.167583-1-david@redhat.com Fixes: 0d206b5d2e0d ("mm/swap: add swp_offset_pfn() to fetch PFN from swap entry") Signed-off-by: David Hildenbrand Acked-by: Peter Xu Reviewed-by: Yang Shi Cc: Hugh Dickins Cc: Andrea Arcangeli Signed-off-by: Andrew Morton commit 44bcabd70cf1425b4243e02251c02b01638a8287 Author: Hugh Dickins Date: Sun Dec 4 16:51:50 2022 -0800 tmpfs: fix data loss from failed fallocate Fix tmpfs data loss when the fallocate system call is interrupted by a signal, or fails for some other reason. The partial folio handling in shmem_undo_range() forgot to consider this unfalloc case, and was liable to erase or truncate out data which had already been committed earlier. It turns out that none of the partial folio handling there is appropriate for the unfalloc case, which just wants to proceed to removal of whole folios: which find_get_entries() provides, even when partially covered. Original patch by Rui Wang. Link: https://lore.kernel.org/linux-mm/33b85d82.7764.1842e9ab207.Coremail.chenguoqic@163.com/ Link: https://lkml.kernel.org/r/a5dac112-cf4b-7af-a33-f386e347fd38@google.com Fixes: b9a8a4195c7d ("truncate,shmem: Handle truncates that split large folios") Signed-off-by: Hugh Dickins Reported-by: Guoqi Chen Link: https://lore.kernel.org/all/20221101032248.819360-1-kernel@hev.cc/ Cc: Rui Wang Cc: Huacai Chen Cc: Matthew Wilcox Cc: Vishal Moola (Oracle) Cc: [5.17+] Signed-off-by: Andrew Morton commit de16d6e4a9fb13d07c88d0e57754348662f53b23 Author: Michal Hocko Date: Fri Dec 2 09:50:26 2022 +0100 kselftests: cgroup: update kmem test precision tolerance 1813e51eece0 ("memcg: increase MEMCG_CHARGE_BATCH to 64") has changed the batch size while this test case has been left behind. This has led to a test failure reported by test bot: not ok 2 selftests: cgroup: test_kmem # exit=1 Update the tolerance for the pcp charges to reflect the MEMCG_CHARGE_BATCH change to fix this. [akpm@linux-foundation.org: update comments, per Roman] Link: https://lkml.kernel.org/r/Y4m8Unt6FhWKC6IH@dhcp22.suse.cz Fixes: 1813e51eece0a ("memcg: increase MEMCG_CHARGE_BATCH to 64") Signed-off-by: Michal Hocko Reported-by: kernel test robot Link: https://lore.kernel.org/oe-lkp/202212010958.c1053bd3-yujie.liu@intel.com Acked-by: Shakeel Butt Acked-by: Roman Gushchin Tested-by: Yujie Liu Cc: Eric Dumazet Cc: Feng Tang Cc: Johannes Weiner Cc: "Michal Koutný" Cc: Muchun Song Cc: Soheil Hassas Yeganeh Signed-off-by: Andrew Morton commit f5ad5083404bb56c9de777dccb68c6672ef6487e Author: Jason A. Donenfeld Date: Fri Dec 2 17:27:24 2022 +0100 mm: do not BUG_ON missing brk mapping, because userspace can unmap it The following program will trigger the BUG_ON that this patch removes, because the user can munmap() mm->brk: #include #include #include #include static void *brk_now(void) { return (void *)syscall(SYS_brk, 0); } static void brk_set(void *b) { assert(syscall(SYS_brk, b) != -1); } int main(int argc, char *argv[]) { void *b = brk_now(); brk_set(b + 4096); assert(munmap(b - 4096, 4096 * 2) == 0); brk_set(b); return 0; } Compile that with musl, since glibc actually uses brk(), and then execute it, and it'll hit this splat: kernel BUG at mm/mmap.c:229! invalid opcode: 0000 [#1] PREEMPT SMP CPU: 12 PID: 1379 Comm: a.out Tainted: G S U 6.1.0-rc7+ #419 RIP: 0010:__do_sys_brk+0x2fc/0x340 Code: 00 00 4c 89 ef e8 04 d3 fe ff eb 9a be 01 00 00 00 4c 89 ff e8 35 e0 fe ff e9 6e ff ff ff 4d 89 a7 20> RSP: 0018:ffff888140bc7eb0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000007e7000 RCX: ffff8881020fe000 RDX: ffff8881020fe001 RSI: ffff8881955c9b00 RDI: ffff8881955c9b08 RBP: 0000000000000000 R08: ffff8881955c9b00 R09: 00007ffc77844000 R10: 0000000000000000 R11: 0000000000000001 R12: 00000000007e8000 R13: 00000000007e8000 R14: 00000000007e7000 R15: ffff8881020fe000 FS: 0000000000604298(0000) GS:ffff88901f700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000603fe0 CR3: 000000015ba9a005 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: do_syscall_64+0x2b/0x50 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x400678 Code: 10 4c 8d 41 08 4c 89 44 24 10 4c 8b 01 8b 4c 24 08 83 f9 2f 77 0a 4c 8d 4c 24 20 4c 01 c9 eb 05 48 8b> RSP: 002b:00007ffc77863890 EFLAGS: 00000212 ORIG_RAX: 000000000000000c RAX: ffffffffffffffda RBX: 000000000040031b RCX: 0000000000400678 RDX: 00000000004006a1 RSI: 00000000007e6000 RDI: 00000000007e7000 RBP: 00007ffc77863900 R08: 0000000000000000 R09: 00000000007e6000 R10: 00007ffc77863930 R11: 0000000000000212 R12: 00007ffc77863978 R13: 00007ffc77863988 R14: 0000000000000000 R15: 0000000000000000 Instead, just return the old brk value if the original mapping has been removed. [akpm@linux-foundation.org: fix changelog, per Liam] Link: https://lkml.kernel.org/r/20221202162724.2009-1-Jason@zx2c4.com Fixes: 2e7ce7d354f2 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()") Signed-off-by: Jason A. Donenfeld Acked-by: Vlastimil Babka Reviewed-by: Liam R. Howlett Reviewed-by: SeongJae Park Cc: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: Matthew Wilcox Cc: Sven Schnelle Cc: Will Deacon Cc: Jann Horn Signed-off-by: Andrew Morton commit 38f1d4aefdac30600698ab07cb1e41fca5851f7a Author: Matti Vaittinen Date: Thu Dec 1 18:45:40 2022 +0200 mailmap: update Matti Vaittinen's email address The email backend used by ROHM keeps labeling patches as spam. This can result in missing the patches. Switch my mail address from a company mail to a personal one. Link: https://lkml.kernel.org/r/8f4498b66fedcbded37b3b87e0c516e659f8f583.1669912977.git.mazziesaccount@gmail.com Signed-off-by: Matti Vaittinen Suggested-by: Krzysztof Kozlowski Cc: Anup Patel Cc: Arnd Bergmann Cc: Atish Patra Cc: Baolin Wang Cc: Ben Widawsky Cc: Bjorn Andersson Cc: Christian Brauner Cc: Colin Ian King Cc: Kirill Tkhai Cc: Qais Yousef Cc: Vasily Averin Signed-off-by: Andrew Morton commit 3ecc37918c80ffdbfa8f08d3e75a0a9fca1c1979 Merge: 9857feb3f62a0 5eef2141776da Author: Linus Torvalds Date: Fri Dec 9 10:45:51 2022 -0800 Merge tag 'media/v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fix from Mauro Carvalho Chehab: "A v4l-core fix related to validating DV timings related to video blanking values" * tag 'media/v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: v4l2-dv-timings.c: fix too strict blanking sanity checks commit 9857feb3f62a04aba3909b6ac43dc062bf84c874 Merge: 0d1409e4ff08a ef19964da8a66 Author: Linus Torvalds Date: Fri Dec 9 10:32:40 2022 -0800 Merge tag 'soc-fixes-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fix from Arnd Bergmann: "One more last minute revert for a boot regression that was found on the popular colibri-imx7" * tag 'soc-fixes-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: Revert "ARM: dts: imx7: Fix NAND controller size-cells" commit 0d1409e4ff08aa4a9a254d3f723410db32aa7552 Merge: 859c73d439cd9 c4252650a8c47 Author: Linus Torvalds Date: Thu Dec 8 16:58:31 2022 -0800 Merge tag 'drm-fixes-2022-12-09' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Last set of fixes for final, scattered bunch of fixes, two amdgpu, one vmwgfx, and some misc others. amdgpu: - S0ix fix - DCN 3.2 array out of bounds fix shmem: - Fixes to shmem-helper error paths bridge: - Fix polarity bug in bridge/ti-sn65dsi86 dw-hdmi: - Prefer 8-bit RGB fallback before any YUV mode in dw-hdmi, since some panels lie about YUV support vmwgfx: - Stop using screen objects when SEV is active" * tag 'drm-fixes-2022-12-09' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: fix array index out of bound error in DCN32 DML drm/amdgpu/sdma_v4_0: turn off SDMA ring buffer in the s2idle suspend drm/vmwgfx: Don't use screen objects when SEV is active drm/shmem-helper: Avoid vm_open error paths drm/shmem-helper: Remove errant put in error path drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 drm/bridge: ti-sn65dsi86: Fix output polarity setting bug drm/vmwgfx: Fix race issue calling pin_user_pages commit c4252650a8c4770b669398fe7270ed8c94fc0eba Merge: b4b241ad3f181 6e90293618ed4 Author: Dave Airlie Date: Fri Dec 9 10:11:05 2022 +1000 Merge tag 'drm-misc-fixes-2022-12-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1 final?: - Fix polarity bug in bridge/ti-sn65dsi86. - Prefer 8-bit RGB fallback before any YUV mode in dw-hdmi, since some panels lie about YUV support. - Fixes to shmem-helper error paths. - Small vmwgfx to stop using screen objects when SEV is active. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/8110f02d-d155-926e-8674-c88b806c3a3a@linux.intel.com commit b4b241ad3f1819c48ad081a3a3d7fb3830962743 Merge: 76dcd734eca23 aeffc8fb2174f Author: Dave Airlie Date: Fri Dec 9 10:09:57 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-12-07' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-12-07: amdgpu: - S0ix fix - DCN 3.2 array out of bounds fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221207222751.9558-1-alexander.deucher@amd.com commit 859c73d439cd9113333a75e683e9433c0092990d Merge: af145500afa53 e18a9c18c38f5 Author: Linus Torvalds Date: Thu Dec 8 15:53:39 2022 -0800 Merge tag 'block-6.1-2022-12-08' of git://git.kernel.dk/linux Pull block fix from Jens Axboe: "A small fix for initializing the NVMe quirks before initializing the subsystem" * tag 'block-6.1-2022-12-08' of git://git.kernel.dk/linux: nvme initialize core quirks before calling nvme_init_subsystem commit af145500afa53fce55c9ee98e405fd0d65f018d0 Merge: 010b6761a9fc5 998b30c3948e4 Author: Linus Torvalds Date: Thu Dec 8 15:44:09 2022 -0800 Merge tag 'io_uring-6.1-2022-12-08' of git://git.kernel.dk/linux Pull io_uring fix from Jens Axboe: "A single small fix for an issue related to ordering between cancelation and current->io_uring teardown" * tag 'io_uring-6.1-2022-12-08' of git://git.kernel.dk/linux: io_uring: Fix a null-ptr-deref in io_tctx_exit_cb() commit 010b6761a9fc5006267d99abb6f9f196bf5d3d13 Merge: ce19275f01039 f8bac7f9fdb00 Author: Linus Torvalds Date: Thu Dec 8 15:32:13 2022 -0800 Merge tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, can and netfilter. Current release - new code bugs: - bonding: ipv6: correct address used in Neighbour Advertisement parsing (src vs dst typo) - fec: properly scope IRQ coalesce setup during link up to supported chips only Previous releases - regressions: - Bluetooth fixes for fake CSR clones (knockoffs): - re-add ERR_DATA_REPORTING quirk - fix crash when device is replugged - Bluetooth: - silence a user-triggerable dmesg error message - L2CAP: fix u8 overflow, oob access - correct vendor codec definition - fix support for Read Local Supported Codecs V2 - ti: am65-cpsw: fix RGMII configuration at SPEED_10 - mana: fix race on per-CQ variable NAPI work_done Previous releases - always broken: - af_unix: diag: fetch user_ns from in_skb in unix_diag_get_exact(), avoid null-deref - af_can: fix NULL pointer dereference in can_rcv_filter - can: slcan: fix UAF with a freed work - can: can327: flush TX_work on ldisc .close() - macsec: add missing attribute validation for offload - ipv6: avoid use-after-free in ip6_fragment() - nft_set_pipapo: actually validate intervals in fields after the first one - mvneta: prevent oob access in mvneta_config_rss() - ipv4: fix incorrect route flushing when table ID 0 is used, or when source address is deleted - phy: mxl-gpy: add workaround for IRQ bug on GPY215B and GPY215C" * tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (77 commits) net: dsa: sja1105: avoid out of bounds access in sja1105_init_l2_policing() s390/qeth: fix use-after-free in hsci macsec: add missing attribute validation for offload net: mvneta: Fix an out of bounds check net: thunderbolt: fix memory leak in tbnet_open() ipv6: avoid use-after-free in ip6_fragment() net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() net: phy: mxl-gpy: add MDINT workaround net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports xen/netback: don't call kfree_skb() under spin_lock_irqsave() dpaa2-switch: Fix memory leak in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove() ethernet: aeroflex: fix potential skb leak in greth_init_rings() tipc: call tipc_lxc_xmit without holding node_read_lock can: esd_usb: Allow REC and TEC to return to zero can: can327: flush TX_work on ldisc .close() can: slcan: fix freed work crash can: af_can: fix NULL pointer dereference in can_rcv_filter net: dsa: sja1105: fix memory leak in sja1105_setup_devlink_regions() ipv4: Fix incorrect route flushing when table ID 0 is used ipv4: Fix incorrect route flushing when source address is deleted ... commit ce19275f0103934828cb19712b6d8552c39476c8 Merge: f3e8416619ced a9d9e46c755a1 Author: Linus Torvalds Date: Thu Dec 8 12:37:42 2022 -0800 Merge tag 'for-linus-2022120801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: "A regression fix for handling Logitech HID++ devices and memory corruption fixes: - regression fix (revert) for catch-all handling of Logitech HID++ Bluetooth devices; there are devices that turn out not to work with this, and the root cause is yet to be properly understood. So we are dropping it for now, and it will be revisited for 6.2 or 6.3 (Benjamin Tissoires) - memory corruption fix in HID core (ZhangPeng) - memory corruption fix in hid-lg4ff (Anastasia Belova) - Kconfig fix for I2C_HID (Benjamin Tissoires) - a few device-id specific quirks that piggy-back on top of the important fixes above" * tag 'for-linus-2022120801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: Revert "HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices" Revert "HID: logitech-hidpp: Remove special-casing of Bluetooth devices" HID: usbhid: Add ALWAYS_POLL quirk for some mice HID: core: fix shift-out-of-bounds in hid_report_raw_event HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk HID: fix I2C_HID not selected when I2C_HID_OF_ELAN is HID: hid-lg4ff: Add check for empty lbuf HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10 HID: uclogic: Fix frame templates for big endian architectures commit f3e8416619ced89abd5b1254f29d0c3904297298 Merge: 7f043b7662b6a da0cbf9307a22 Author: Linus Torvalds Date: Thu Dec 8 11:22:27 2022 -0800 Merge tag 'soc-fixes-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fix from Arnd Bergmann: "One last build fix came in, addressing a link failure when building without CONFIG_OUTER_CACHE" * tag 'soc-fixes-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: at91: fix build for SAMA5D3 w/o L2 cache commit a9d9e46c755a189ccb44d91b8cf737742a975de8 Author: Benjamin Tissoires Date: Wed Dec 7 15:24:33 2022 +0100 Revert "HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices" This reverts commit 532223c8ac57605a10e46dc0ab23dcf01c9acb43. As reported in [0], hid-logitech-hidpp now binds on all bluetooth mice, but there are corner cases where hid-logitech-hidpp just gives up on the mouse. This leads the end user with a dead mouse. Given that we are at -rc8, we are definitively too late to find a proper fix. We already identified 2 issues less than 24 hours after the bug report. One in that ->match() was never designed to be used anywhere else than in hid-generic, and the other that hid-logitech-hidpp has corner cases where it gives up on devices it is not supposed to. So we have no choice but postpone this patch to the next kernel release. [0] https://lore.kernel.org/linux-input/CAJZ5v0g-_o4AqMgNwihCb0jrwrcJZfRrX=jv8aH54WNKO7QB8A@mail.gmail.com/ Reported-by: Rafael J . Wysocki Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 40f2432b53a01b6d5e3a9057f1d5c406930e1360 Author: Benjamin Tissoires Date: Wed Dec 7 15:24:32 2022 +0100 Revert "HID: logitech-hidpp: Remove special-casing of Bluetooth devices" This reverts commit 8544c812e43ab7bdf40458411b83987b8cba924d. We need to revert commit 532223c8ac57 ("HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices") because that commit might make hid-logitech-hidpp bind on mice that are not well enough supported by hid-logitech-hidpp, and the end result is that the probe of those mice is now returning -ENODEV, leaving the end user with a dead mouse. Given that commit 8544c812e43a ("HID: logitech-hidpp: Remove special-casing of Bluetooth devices") is a direct dependency of 532223c8ac57, revert it too. Note that this also adapt according to commit 908d325e1665 ("HID: logitech-hidpp: Detect hi-res scrolling support") to re-add support of the devices that were removed from that commit too. I have locally an MX Master and I tested this device with that revert, ensuring we still have high-res scrolling. Reported-by: Rafael J . Wysocki Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 7f043b7662b6a9cfa981c02199ac939ed1c11372 Merge: a4c3a07e5b9ff 1385313d8bc11 Author: Linus Torvalds Date: Thu Dec 8 11:16:15 2022 -0800 Merge tag 'loongarch-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Export smp_send_reschedule() for modules use, fix a huge page entry update issue, and add documents for booting description" * tag 'loongarch-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: docs/zh_CN: Add LoongArch booting description's translation docs/LoongArch: Add booting description LoongArch: mm: Fix huge page entry update for virtual machine LoongArch: Export symbol for function smp_send_reschedule() commit a4c3a07e5b9ffb525435fedd94b5082c928e56dd Merge: 306ba2402de56 7dfa764e0223a Author: Linus Torvalds Date: Thu Dec 8 11:11:06 2022 -0800 Merge tag 'for-linus-xsa-6.1-rc9b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fix from Juergen Gross: "A single fix for the recent security issue XSA-423" * tag 'for-linus-xsa-6.1-rc9b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/netback: fix build warning commit 306ba2402de569a401549bf343ef60748b8f43df Merge: 57fb3f66a3aa3 63ff545af73f7 Author: Linus Torvalds Date: Thu Dec 8 11:00:42 2022 -0800 Merge tag 'gpio-fixes-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix a memory leak in gpiolib core - fix reference leaks in gpio-amd8111 and gpio-rockchip * tag 'gpio-fixes-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() gpio: amd8111: Fix PCI device reference count leak gpiolib: fix memory leak in gpiochip_setup_dev() commit 57fb3f66a3aa3e92b6008124bfa641702bd69a53 Merge: fbf8321238bac d95d140e83634 Author: Linus Torvalds Date: Thu Dec 8 10:46:52 2022 -0800 Merge tag 'ata-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: - Avoid a NULL pointer dereference in the libahci platform code that can happen on initialization when a device tree does not specify names for the adapter clocks (from Anders) * tag 'ata-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libahci_platform: ahci_platform_find_clk: oops, NULL pointer commit fbf8321238bac04368f57af572e05a9c01347a0b Author: Tejun Heo Date: Wed Dec 7 16:53:15 2022 -1000 memcg: Fix possible use-after-free in memcg_write_event_control() memcg_write_event_control() accesses the dentry->d_name of the specified control fd to route the write call. As a cgroup interface file can't be renamed, it's safe to access d_name as long as the specified file is a regular cgroup file. Also, as these cgroup interface files can't be removed before the directory, it's safe to access the parent too. Prior to 347c4a874710 ("memcg: remove cgroup_event->cft"), there was a call to __file_cft() which verified that the specified file is a regular cgroupfs file before further accesses. The cftype pointer returned from __file_cft() was no longer necessary and the commit inadvertently dropped the file type check with it allowing any file to slip through. With the invarients broken, the d_name and parent accesses can now race against renames and removals of arbitrary files and cause use-after-free's. Fix the bug by resurrecting the file type check in __file_cft(). Now that cgroupfs is implemented through kernfs, checking the file operations needs to go through a layer of indirection. Instead, let's check the superblock and dentry type. Signed-off-by: Tejun Heo Fixes: 347c4a874710 ("memcg: remove cgroup_event->cft") Cc: stable@kernel.org # v3.14+ Reported-by: Jann Horn Acked-by: Johannes Weiner Acked-by: Roman Gushchin Signed-off-by: Linus Torvalds commit f8bac7f9fdb0017b32157957ffffd490f95faa07 Author: Radu Nicolae Pirea (OSS) Date: Wed Dec 7 15:23:47 2022 +0200 net: dsa: sja1105: avoid out of bounds access in sja1105_init_l2_policing() The SJA1105 family has 45 L2 policing table entries (SJA1105_MAX_L2_POLICING_COUNT) and SJA1110 has 110 (SJA1110_MAX_L2_POLICING_COUNT). Keeping the table structure but accounting for the difference in port count (5 in SJA1105 vs 10 in SJA1110) does not fully explain the difference. Rather, the SJA1110 also has L2 ingress policers for multicast traffic. If a packet is classified as multicast, it will be processed by the policer index 99 + SRCPORT. The sja1105_init_l2_policing() function initializes all L2 policers such that they don't interfere with normal packet reception by default. To have a common code between SJA1105 and SJA1110, the index of the multicast policer for the port is calculated because it's an index that is out of bounds for SJA1105 but in bounds for SJA1110, and a bounds check is performed. The code fails to do the proper thing when determining what to do with the multicast policer of port 0 on SJA1105 (ds->num_ports = 5). The "mcast" index will be equal to 45, which is also equal to table->ops->max_entry_count (SJA1105_MAX_L2_POLICING_COUNT). So it passes through the check. But at the same time, SJA1105 doesn't have multicast policers. So the code programs the SHARINDX field of an out-of-bounds element in the L2 Policing table of the static config. The comparison between index 45 and 45 entries should have determined the code to not access this policer index on SJA1105, since its memory wasn't even allocated. With enough bad luck, the out-of-bounds write could even overwrite other valid kernel data, but in this case, the issue was detected using KASAN. Kernel log: sja1105 spi5.0: Probed switch chip: SJA1105Q ================================================================== BUG: KASAN: slab-out-of-bounds in sja1105_setup+0x1cbc/0x2340 Write of size 8 at addr ffffff880bd57708 by task kworker/u8:0/8 ... Workqueue: events_unbound deferred_probe_work_func Call trace: ... sja1105_setup+0x1cbc/0x2340 dsa_register_switch+0x1284/0x18d0 sja1105_probe+0x748/0x840 ... Allocated by task 8: ... sja1105_setup+0x1bcc/0x2340 dsa_register_switch+0x1284/0x18d0 sja1105_probe+0x748/0x840 ... Fixes: 38fbe91f2287 ("net: dsa: sja1105: configure the multicast policers, if present") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Radu Nicolae Pirea (OSS) Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20221207132347.38698-1-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski commit ebaaadc332cd21e9df4dcf9ce12552d9354bbbe4 Author: Alexandra Winter Date: Wed Dec 7 11:53:04 2022 +0100 s390/qeth: fix use-after-free in hsci KASAN found that addr was dereferenced after br2dev_event_work was freed. ================================================================== BUG: KASAN: use-after-free in qeth_l2_br2dev_worker+0x5ba/0x6b0 Read of size 1 at addr 00000000fdcea440 by task kworker/u760:4/540 CPU: 17 PID: 540 Comm: kworker/u760:4 Tainted: G E 6.1.0-20221128.rc7.git1.5aa3bed4ce83.300.fc36.s390x+kasan #1 Hardware name: IBM 8561 T01 703 (LPAR) Workqueue: 0.0.8000_event qeth_l2_br2dev_worker Call Trace: [<000000016944d4ce>] dump_stack_lvl+0xc6/0xf8 [<000000016942cd9c>] print_address_description.constprop.0+0x34/0x2a0 [<000000016942d118>] print_report+0x110/0x1f8 [<0000000167a7bd04>] kasan_report+0xfc/0x128 [<000000016938d79a>] qeth_l2_br2dev_worker+0x5ba/0x6b0 [<00000001673edd1e>] process_one_work+0x76e/0x1128 [<00000001673ee85c>] worker_thread+0x184/0x1098 [<000000016740718a>] kthread+0x26a/0x310 [<00000001672c606a>] __ret_from_fork+0x8a/0xe8 [<00000001694711da>] ret_from_fork+0xa/0x40 Allocated by task 108338: kasan_save_stack+0x40/0x68 kasan_set_track+0x36/0x48 __kasan_kmalloc+0xa0/0xc0 qeth_l2_switchdev_event+0x25a/0x738 atomic_notifier_call_chain+0x9c/0xf8 br_switchdev_fdb_notify+0xf4/0x110 fdb_notify+0x122/0x180 fdb_add_entry.constprop.0.isra.0+0x312/0x558 br_fdb_add+0x59e/0x858 rtnl_fdb_add+0x58a/0x928 rtnetlink_rcv_msg+0x5f8/0x8d8 netlink_rcv_skb+0x1f2/0x408 netlink_unicast+0x570/0x790 netlink_sendmsg+0x752/0xbe0 sock_sendmsg+0xca/0x110 ____sys_sendmsg+0x510/0x6a8 ___sys_sendmsg+0x12a/0x180 __sys_sendmsg+0xe6/0x168 __do_sys_socketcall+0x3c8/0x468 do_syscall+0x22c/0x328 __do_syscall+0x94/0xf0 system_call+0x82/0xb0 Freed by task 540: kasan_save_stack+0x40/0x68 kasan_set_track+0x36/0x48 kasan_save_free_info+0x4c/0x68 ____kasan_slab_free+0x14e/0x1a8 __kasan_slab_free+0x24/0x30 __kmem_cache_free+0x168/0x338 qeth_l2_br2dev_worker+0x154/0x6b0 process_one_work+0x76e/0x1128 worker_thread+0x184/0x1098 kthread+0x26a/0x310 __ret_from_fork+0x8a/0xe8 ret_from_fork+0xa/0x40 Last potentially related work creation: kasan_save_stack+0x40/0x68 __kasan_record_aux_stack+0xbe/0xd0 insert_work+0x56/0x2e8 __queue_work+0x4ce/0xd10 queue_work_on+0xf4/0x100 qeth_l2_switchdev_event+0x520/0x738 atomic_notifier_call_chain+0x9c/0xf8 br_switchdev_fdb_notify+0xf4/0x110 fdb_notify+0x122/0x180 fdb_add_entry.constprop.0.isra.0+0x312/0x558 br_fdb_add+0x59e/0x858 rtnl_fdb_add+0x58a/0x928 rtnetlink_rcv_msg+0x5f8/0x8d8 netlink_rcv_skb+0x1f2/0x408 netlink_unicast+0x570/0x790 netlink_sendmsg+0x752/0xbe0 sock_sendmsg+0xca/0x110 ____sys_sendmsg+0x510/0x6a8 ___sys_sendmsg+0x12a/0x180 __sys_sendmsg+0xe6/0x168 __do_sys_socketcall+0x3c8/0x468 do_syscall+0x22c/0x328 __do_syscall+0x94/0xf0 system_call+0x82/0xb0 Second to last potentially related work creation: kasan_save_stack+0x40/0x68 __kasan_record_aux_stack+0xbe/0xd0 kvfree_call_rcu+0xb2/0x760 kernfs_unlink_open_file+0x348/0x430 kernfs_fop_release+0xc2/0x320 __fput+0x1ae/0x768 task_work_run+0x1bc/0x298 exit_to_user_mode_prepare+0x1a0/0x1a8 __do_syscall+0x94/0xf0 system_call+0x82/0xb0 The buggy address belongs to the object at 00000000fdcea400 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 64 bytes inside of 96-byte region [00000000fdcea400, 00000000fdcea460) The buggy address belongs to the physical page: page:000000005a9c26e8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xfdcea flags: 0x3ffff00000000200(slab|node=0|zone=1|lastcpupid=0x1ffff) raw: 3ffff00000000200 0000000000000000 0000000100000122 000000008008cc00 raw: 0000000000000000 0020004100000000 ffffffff00000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: 00000000fdcea300: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc 00000000fdcea380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >00000000fdcea400: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ 00000000fdcea480: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc 00000000fdcea500: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ================================================================== Fixes: f7936b7b2663 ("s390/qeth: Update MACs of LEARNING_SYNC device") Reported-by: Thorsten Winkler Signed-off-by: Alexandra Winter Reviewed-by: Wenjia Zhang Reviewed-by: Thorsten Winkler Link: https://lore.kernel.org/r/20221207105304.20494-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski commit 38099024e51ee37dee5f0f577ca37175c932e3f7 Author: Emeel Hakim Date: Wed Dec 7 12:16:18 2022 +0200 macsec: add missing attribute validation for offload Add missing attribute validation for IFLA_MACSEC_OFFLOAD to the netlink policy. Fixes: 791bb3fcafce ("net: macsec: add support for specifying offload upon link creation") Signed-off-by: Emeel Hakim Reviewed-by: Jiri Pirko Reviewed-by: Sabrina Dubroca Link: https://lore.kernel.org/r/20221207101618.989-1-ehakim@nvidia.com Signed-off-by: Jakub Kicinski commit cdd97383e19d4afe29adc3376025a15ae3bab3a3 Author: Dan Carpenter Date: Wed Dec 7 10:06:31 2022 +0300 net: mvneta: Fix an out of bounds check In an earlier commit, I added a bounds check to prevent an out of bounds read and a WARN(). On further discussion and consideration that check was probably too aggressive. Instead of returning -EINVAL, a better fix would be to just prevent the out of bounds read but continue the process. Background: The value of "pp->rxq_def" is a number between 0-7 by default, or even higher depending on the value of "rxq_number", which is a module parameter. If the value is more than the number of available CPUs then it will trigger the WARN() in cpu_max_bits_warn(). Fixes: e8b4fc13900b ("net: mvneta: Prevent out of bounds read in mvneta_config_rss()") Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/Y5A7d1E5ccwHTYPf@kadam Signed-off-by: Jakub Kicinski commit ed14e5903638f6eb868e3e2b4e610985e6a6c876 Author: Zhengchao Shao Date: Wed Dec 7 09:50:01 2022 +0800 net: thunderbolt: fix memory leak in tbnet_open() When tb_ring_alloc_rx() failed in tbnet_open(), ida that allocated in tb_xdomain_alloc_out_hopid() is not released. Add tb_xdomain_release_out_hopid() to the error path to release ida. Fixes: 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection") Signed-off-by: Zhengchao Shao Acked-by: Mika Westerberg Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20221207015001.1755826-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit ef19964da8a668c683f1d38274f6fb756e047945 Author: Francesco Dolcini Date: Mon Dec 5 16:23:27 2022 +0100 Revert "ARM: dts: imx7: Fix NAND controller size-cells" This reverts commit 753395ea1e45c724150070b5785900b6a44bd5fb. It introduced a boot regression on colibri-imx7, and potentially any other i.MX7 boards with MTD partition list generated into the fdt by U-Boot. While the commit we are reverting here is not obviously wrong, it fixes only a dt binding checker warning that is non-functional, while it introduces a boot regression and there is no obvious fix ready. Fixes: 753395ea1e45 ("ARM: dts: imx7: Fix NAND controller size-cells") Signed-off-by: Francesco Dolcini Reviewed-by: Miquel Raynal Acked-by: Marek Vasut Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/Y4dgBTGNWpM6SQXI@francesco-nb.int.toradex.com/ Link: https://lore.kernel.org/all/20221205144917.6514168a@xps-13/ Signed-off-by: Arnd Bergmann commit 1385313d8bc112760559f06f64708d936b3f2d7c Author: Yanteng Si Date: Thu Dec 8 14:59:15 2022 +0800 docs/zh_CN: Add LoongArch booting description's translation Translate ../loongarch/booting.rst into Chinese. Suggested-by: Xiaotian Wu Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit 38eb496d85b89d6ad8fe9701acd2ac1de804b6c1 Author: Yanteng Si Date: Thu Dec 8 14:59:15 2022 +0800 docs/LoongArch: Add booting description 1, Describe the information passed from BootLoader to kernel. 2, Describe the meaning and values of the kernel image header field. Suggested-by: Xiaotian Wu Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit b681604edab66f20dde767f4690e554f26c5bfb9 Author: Huacai Chen Date: Thu Dec 8 14:59:15 2022 +0800 LoongArch: mm: Fix huge page entry update for virtual machine In virtual machine (guest mode), the tlbwr instruction can not write the last entry of MTLB, so we need to make it non-present by invtlb and then write it by tlbfill. This also simplify the whole logic. Signed-off-by: Rui Wang Signed-off-by: Huacai Chen commit 143d64bdbdb85787953a70332f9e5f658b678550 Author: Bibo Mao Date: Thu Dec 8 14:59:15 2022 +0800 LoongArch: Export symbol for function smp_send_reschedule() Function smp_send_reschedule() is standard kernel API, which is defined in header file include/linux/smp.h. However, on LoongArch it is defined as an inline function, this is confusing and kernel modules can not use this function. Now we define smp_send_reschedule() as a general function, and add a EXPORT_SYMBOL_GPL on this function, so that kernel modules can use it. Signed-off-by: Bibo Mao Signed-off-by: Huacai Chen commit 803e84867de59a1e5d126666d25eb4860cfd2ebe Author: Eric Dumazet Date: Tue Dec 6 10:13:51 2022 +0000 ipv6: avoid use-after-free in ip6_fragment() Blamed commit claimed rcu_read_lock() was held by ip6_fragment() callers. It seems to not be always true, at least for UDP stack. syzbot reported: BUG: KASAN: use-after-free in ip6_dst_idev include/net/ip6_fib.h:245 [inline] BUG: KASAN: use-after-free in ip6_fragment+0x2724/0x2770 net/ipv6/ip6_output.c:951 Read of size 8 at addr ffff88801d403e80 by task syz-executor.3/7618 CPU: 1 PID: 7618 Comm: syz-executor.3 Not tainted 6.1.0-rc6-syzkaller-00012-g4312098baf37 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 ip6_dst_idev include/net/ip6_fib.h:245 [inline] ip6_fragment+0x2724/0x2770 net/ipv6/ip6_output.c:951 __ip6_finish_output net/ipv6/ip6_output.c:193 [inline] ip6_finish_output+0x9a3/0x1170 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1f1/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:445 [inline] ip6_local_out+0xb3/0x1a0 net/ipv6/output_core.c:161 ip6_send_skb+0xbb/0x340 net/ipv6/ip6_output.c:1966 udp_v6_send_skb+0x82a/0x18a0 net/ipv6/udp.c:1286 udp_v6_push_pending_frames+0x140/0x200 net/ipv6/udp.c:1313 udpv6_sendmsg+0x18da/0x2c80 net/ipv6/udp.c:1606 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:665 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 sock_write_iter+0x295/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2191 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xdd0 fs/read_write.c:584 ksys_write+0x1ec/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fde3588c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fde365b6168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fde359ac050 RCX: 00007fde3588c0d9 RDX: 000000000000ffdc RSI: 00000000200000c0 RDI: 000000000000000a RBP: 00007fde358e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fde35acfb1f R14: 00007fde365b6300 R15: 0000000000022000 Allocated by task 7618: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x2b4/0x3d0 mm/slub.c:3422 dst_alloc+0x14a/0x1f0 net/core/dst.c:92 ip6_dst_alloc+0x32/0xa0 net/ipv6/route.c:344 ip6_rt_pcpu_alloc net/ipv6/route.c:1369 [inline] rt6_make_pcpu_route net/ipv6/route.c:1417 [inline] ip6_pol_route+0x901/0x1190 net/ipv6/route.c:2254 pol_lookup_func include/net/ip6_fib.h:582 [inline] fib6_rule_lookup+0x52e/0x6f0 net/ipv6/fib6_rules.c:121 ip6_route_output_flags_noref+0x2e6/0x380 net/ipv6/route.c:2625 ip6_route_output_flags+0x76/0x320 net/ipv6/route.c:2638 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0x5ab/0x1620 net/ipv6/ip6_output.c:1092 ip6_dst_lookup_flow+0x90/0x1d0 net/ipv6/ip6_output.c:1222 ip6_sk_dst_lookup_flow+0x553/0x980 net/ipv6/ip6_output.c:1260 udpv6_sendmsg+0x151d/0x2c80 net/ipv6/udp.c:1554 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:665 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 __sys_sendto+0x23a/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 7599: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] kmem_cache_free+0xee/0x5c0 mm/slub.c:3683 dst_destroy+0x2ea/0x400 net/core/dst.c:127 rcu_do_batch kernel/rcu/tree.c:2250 [inline] rcu_core+0x81f/0x1980 kernel/rcu/tree.c:2510 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x9d/0x820 kernel/rcu/tree.c:2798 dst_release net/core/dst.c:177 [inline] dst_release+0x7d/0xe0 net/core/dst.c:167 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] skb_release_head_state+0x250/0x2a0 net/core/skbuff.c:838 skb_release_all net/core/skbuff.c:852 [inline] __kfree_skb net/core/skbuff.c:868 [inline] kfree_skb_reason+0x151/0x4b0 net/core/skbuff.c:891 kfree_skb_list_reason+0x4b/0x70 net/core/skbuff.c:901 kfree_skb_list include/linux/skbuff.h:1227 [inline] ip6_fragment+0x2026/0x2770 net/ipv6/ip6_output.c:949 __ip6_finish_output net/ipv6/ip6_output.c:193 [inline] ip6_finish_output+0x9a3/0x1170 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1f1/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:445 [inline] ip6_local_out+0xb3/0x1a0 net/ipv6/output_core.c:161 ip6_send_skb+0xbb/0x340 net/ipv6/ip6_output.c:1966 udp_v6_send_skb+0x82a/0x18a0 net/ipv6/udp.c:1286 udp_v6_push_pending_frames+0x140/0x200 net/ipv6/udp.c:1313 udpv6_sendmsg+0x18da/0x2c80 net/ipv6/udp.c:1606 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:665 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 sock_write_iter+0x295/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2191 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xdd0 fs/read_write.c:584 ksys_write+0x1ec/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x9d/0x820 kernel/rcu/tree.c:2798 dst_release net/core/dst.c:177 [inline] dst_release+0x7d/0xe0 net/core/dst.c:167 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0x1b9d/0x3ba0 net/core/dev.c:4211 dev_queue_xmit include/linux/netdevice.h:3008 [inline] neigh_resolve_output net/core/neighbour.c:1552 [inline] neigh_resolve_output+0x51b/0x840 net/core/neighbour.c:1532 neigh_output include/net/neighbour.h:546 [inline] ip6_finish_output2+0x56c/0x1530 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x694/0x1170 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1f1/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:445 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] mld_sendpack+0xa09/0xe70 net/ipv6/mcast.c:1820 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x720/0xdc0 net/ipv6/mcast.c:2653 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88801d403dc0 which belongs to the cache ip6_dst_cache of size 240 The buggy address is located 192 bytes inside of 240-byte region [ffff88801d403dc0, ffff88801d403eb0) The buggy address belongs to the physical page: page:ffffea00007500c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d403 memcg:ffff888022f49c81 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001ef6580 dead000000000002 ffff88814addf640 raw: 0000000000000000 00000000800c000c 00000001ffffffff ffff888022f49c81 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 3719, tgid 3719 (kworker/0:6), ts 136223432244, free_ts 136222971441 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x31a/0x3d0 mm/slub.c:3422 dst_alloc+0x14a/0x1f0 net/core/dst.c:92 ip6_dst_alloc+0x32/0xa0 net/ipv6/route.c:344 icmp6_dst_alloc+0x71/0x680 net/ipv6/route.c:3261 mld_sendpack+0x5de/0xe70 net/ipv6/mcast.c:1809 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x720/0xdc0 net/ipv6/mcast.c:2653 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] kmem_cache_alloc_node+0x304/0x410 mm/slub.c:3443 __alloc_skb+0x214/0x300 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1267 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x9a6/0xe10 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 __sys_sendto+0x23a/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 1758fd4688eb ("ipv6: remove unnecessary dst_hold() in ip6_fragment()") Reported-by: syzbot+8c0ac31aa9681abb9e2d@syzkaller.appspotmail.com Signed-off-by: Eric Dumazet Cc: Wei Wang Cc: Martin KaFai Lau Link: https://lore.kernel.org/r/20221206101351.2037285-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 7d8c19bfc8ff3f78e5337107ca9246327fcb6b45 Author: Yang Yingliang Date: Wed Dec 7 09:53:10 2022 +0800 net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq() and dev_consume_skb_irq() under spin_lock_irq(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yang Yingliang Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20221207015310.2984909-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 5f4d487d01ff5349da38f7a09ca36bf6aa2e29fb Author: Michael Walle Date: Mon Dec 5 21:04:53 2022 +0100 net: phy: mxl-gpy: add MDINT workaround At least the GPY215B and GPY215C has a bug where it is still driving the interrupt line (MDINT) even after the interrupt status register is read and its bits are cleared. This will cause an interrupt storm. Although the MDINT is multiplexed with a GPIO pin and theoretically we could switch the pinmux to GPIO input mode, this isn't possible because the access to this register will stall exactly as long as the interrupt line is asserted. We exploit this very fact and just read a random internal register in our interrupt handler. This way, it will be delayed until the external interrupt line is released and an interrupt storm is avoided. The internal register access via the mailbox was deduced by looking at the downstream PHY API because the datasheet doesn't mention any of this. Fixes: 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221205200453.3447866-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 65e349f766a6f63d9f8679697fce8cfba1cce672 Merge: 87a39882b5ab3 918ee4911f7a4 Author: Jakub Kicinski Date: Wed Dec 7 18:57:54 2022 -0800 Merge tag 'linux-can-fixes-for-6.1-20221207' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-12-07 The 1st patch is by Oliver Hartkopp and fixes a potential NULL pointer deref found by syzbot in the AF_CAN protocol. The next 2 patches are by Jiri Slaby and Max Staudt and add the missing flush_work() before freeing the underlying memory in the slcan and can327 driver. The last patch is by Frank Jungclaus and target the esd_usb driver and fixes the CAN error counters, allowing them to return to zero. * tag 'linux-can-fixes-for-6.1-20221207' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: esd_usb: Allow REC and TEC to return to zero can: can327: flush TX_work on ldisc .close() can: slcan: fix freed work crash can: af_can: fix NULL pointer dereference in can_rcv_filter ==================== Link: https://lore.kernel.org/r/20221207105243.2483884-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 479174d402bcf60789106eedc4def3957c060bad Merge: b5b52de3214a2 e4678483f9bc4 Author: Linus Torvalds Date: Wed Dec 7 12:37:35 2022 -0800 Merge tag 'platform-drivers-x86-v6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fix from Hans de Goede: "A single fix for 6.1 for suspend/resume issues on some AMD systems" * tag 'platform-drivers-x86-v6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/amd: pmc: Add a workaround for an s0i3 issue on Cezanne commit b5b52de3214a29911f949459a79f6640969b5487 Author: Dave Wysochanski Date: Wed Dec 7 13:49:15 2022 +0000 fscache: Fix oops due to race with cookie_lru and use_cookie If a cookie expires from the LRU and the LRU_DISCARD flag is set, but the state machine has not run yet, it's possible another thread can call fscache_use_cookie and begin to use it. When the cookie_worker finally runs, it will see the LRU_DISCARD flag set, transition the cookie->state to LRU_DISCARDING, which will then withdraw the cookie. Once the cookie is withdrawn the object is removed the below oops will occur because the object associated with the cookie is now NULL. Fix the oops by clearing the LRU_DISCARD bit if another thread uses the cookie before the cookie_worker runs. BUG: kernel NULL pointer dereference, address: 0000000000000008 ... CPU: 31 PID: 44773 Comm: kworker/u130:1 Tainted: G E 6.0.0-5.dneg.x86_64 #1 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: events_unbound netfs_rreq_write_to_cache_work [netfs] RIP: 0010:cachefiles_prepare_write+0x28/0x90 [cachefiles] ... Call Trace: netfs_rreq_write_to_cache_work+0x11c/0x320 [netfs] process_one_work+0x217/0x3e0 worker_thread+0x4a/0x3b0 kthread+0xd6/0x100 Fixes: 12bb21a29c19 ("fscache: Implement cookie user counting and resource pinning") Reported-by: Daire Byrne Signed-off-by: Dave Wysochanski Signed-off-by: David Howells Tested-by: Daire Byrne Link: https://lore.kernel.org/r/20221117115023.1350181-1-dwysocha@redhat.com/ # v1 Link: https://lore.kernel.org/r/20221117142915.1366990-1-dwysocha@redhat.com/ # v2 Signed-off-by: Linus Torvalds commit 098e5edc5d048a8df8691fd9fde895af100be42b Author: Hans Verkuil Date: Wed Dec 7 13:04:34 2022 +0000 media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area() While vb2_mmap took the mmap_lock mutex, vb2_get_unmapped_area didn't. Add this. Also take this opportunity to move the 'q->memory != VB2_MEMORY_MMAP' check and vb2_fileio_is_active() check into __find_plane_by_offset() so both vb2_mmap and vb2_get_unmapped_area do the same checks. Since q->memory is checked while mmap_lock is held, also take that lock in reqbufs and create_bufs when it is set, and set it back to MEMORY_UNKNOWN on error. Fixes: f035eb4e976e ("[media] videobuf2: fix lockdep warning") Signed-off-by: Hans Verkuil Acked-by: Tomasz Figa Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Linus Torvalds commit aeffc8fb2174f017a10df114bc312f899904dc68 Author: Aurabindo Pillai Date: Fri Nov 25 19:13:41 2022 -0500 drm/amd/display: fix array index out of bound error in DCN32 DML [Why&How] LinkCapacitySupport array is indexed with the number of voltage states and not the number of max DPPs. Fix the error by changing the array declaration to use the correct (larger) array size of total number of voltage states. Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit bc21fe9a5844c5bc8f7ec319b11d2671a94eb867 Author: Prike Liang Date: Thu Dec 1 11:17:31 2022 +0800 drm/amdgpu/sdma_v4_0: turn off SDMA ring buffer in the s2idle suspend In the SDMA s0ix save process requires to turn off SDMA ring buffer for avoiding the SDMA in-flight request, otherwise will suffer from SDMA page fault which causes by page request from in-flight SDMA ring accessing at SDMA restore phase. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2248 Cc: stable@vger.kernel.org # 6.0,5.15+ Fixes: f8f4e2a51834 ("drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.") Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Tested-by: Mario Limonciello Signed-off-by: Alex Deucher commit e18a9c18c38f523ae45416e2b75ed4ddf8ad107b Merge: d0f411c0b9bde 6f2d71524bcfd Author: Jens Axboe Date: Wed Dec 7 08:55:27 2022 -0700 Merge tag 'nvme-6.1-2022-12-07' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fix from Christoph: "nvme fixes for Linux 6.1 - initialize core quirks before calling nvme_init_subsystem (Pankaj Raghav)" * tag 'nvme-6.1-2022-12-07' of git://git.infradead.org/nvme: nvme initialize core quirks before calling nvme_init_subsystem commit 87a39882b5ab3127700ac4b9277608075f98eda2 Author: Vladimir Oltean Date: Mon Dec 5 21:48:45 2022 +0200 net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports The ethernet-controller dt-schema, mostly pushed forward by Linux, has the "internal" PHY mode for denoting MAC connections to an internal PHY. U-Boot may provide device tree blobs where this phy-mode is specified, so make the Linux driver accept them. It appears that the current behavior with phy-mode = "internal" was introduced when mv88e6xxx started reporting supported_interfaces to phylink. Prior to that, I don't think it would have any issues accepting this phy-mode. Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities") Link: https://lore.kernel.org/linux-arm-kernel/20221205172709.kglithpbhdbsakvd@skbuf/T/ Reported-by: Tim Harvey Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Tim Harvey # imx6q-gw904.dts Link: https://lore.kernel.org/r/20221205194845.2131161-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit 7dfa764e0223a324366a2a1fc056d4d9d4e95491 Author: Juergen Gross Date: Wed Dec 7 08:19:38 2022 +0100 xen/netback: fix build warning Commit ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear area") introduced a (valid) build warning. There have even been reports of this problem breaking networking of Xen guests. Fixes: ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear area") Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Reviewed-by: Ross Lagerwall Tested-by: Jason Andryuk Signed-off-by: Juergen Gross commit 9e624651859214fb2c4e442b059eba0aefcd0801 Author: Yang Yingliang Date: Mon Dec 5 22:13:33 2022 +0800 xen/netback: don't call kfree_skb() under spin_lock_irqsave() It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave(). Fixes: be81992f9086 ("xen/netback: don't queue unlimited number of packages") Signed-off-by: Yang Yingliang Reviewed-by: Paul Durrant Link: https://lore.kernel.org/r/20221205141333.3974565-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni commit e4678483f9bc400642bbc05c6b75a1b44bcb6c25 Author: Mario Limonciello Date: Wed Nov 16 09:43:41 2022 -0600 platform/x86/amd: pmc: Add a workaround for an s0i3 issue on Cezanne Cezanne platforms under the right circumstances have a synchronization problem where attempting to enter s2idle may fail if the x86 cores are put into HLT before hardware resume from the previous attempt has completed. To avoid this issue add a 10-20ms delay before entering s2idle another time. This workaround will only be applied on interrupts that wake the hardware but don't break the s2idle loop. Cc: stable@vger.kernel.org # 6.1 Cc: "Mahapatra, Rajib" Cc: "Raul Rangel" Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20221116154341.13382-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 73a0b6ee5d6269f92df43e1d09b3278a2886bf8a Author: Wang Kefeng Date: Sun Dec 4 04:46:20 2022 +0100 ARM: 9278/1: kfence: only handle translation faults This is a similar fixup like arm64 does, only handle translation faults in case of unexpected kfence report when alignment faults on ARM, see more from commit 0bb1fbffc631 ("arm64: mm: kfence: only handle translation faults"). Fixes: 75969686ec0d ("ARM: 9166/1: Support KFENCE for ARM") Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 998b30c3948e4d0b1097e639918c5cff332acac5 Author: Harshit Mogalapalli Date: Tue Dec 6 01:38:32 2022 -0800 io_uring: Fix a null-ptr-deref in io_tctx_exit_cb() Syzkaller reports a NULL deref bug as follows: BUG: KASAN: null-ptr-deref in io_tctx_exit_cb+0x53/0xd3 Read of size 4 at addr 0000000000000138 by task file1/1955 CPU: 1 PID: 1955 Comm: file1 Not tainted 6.1.0-rc7-00103-gef4d3ea40565 #75 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 Call Trace: dump_stack_lvl+0xcd/0x134 ? io_tctx_exit_cb+0x53/0xd3 kasan_report+0xbb/0x1f0 ? io_tctx_exit_cb+0x53/0xd3 kasan_check_range+0x140/0x190 io_tctx_exit_cb+0x53/0xd3 task_work_run+0x164/0x250 ? task_work_cancel+0x30/0x30 get_signal+0x1c3/0x2440 ? lock_downgrade+0x6e0/0x6e0 ? lock_downgrade+0x6e0/0x6e0 ? exit_signals+0x8b0/0x8b0 ? do_raw_read_unlock+0x3b/0x70 ? do_raw_spin_unlock+0x50/0x230 arch_do_signal_or_restart+0x82/0x2470 ? kmem_cache_free+0x260/0x4b0 ? putname+0xfe/0x140 ? get_sigframe_size+0x10/0x10 ? do_execveat_common.isra.0+0x226/0x710 ? lockdep_hardirqs_on+0x79/0x100 ? putname+0xfe/0x140 ? do_execveat_common.isra.0+0x238/0x710 exit_to_user_mode_prepare+0x15f/0x250 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x42/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0023:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 002b:00000000fffb7790 EFLAGS: 00000200 ORIG_RAX: 000000000000000b RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Kernel panic - not syncing: panic_on_warn set ... This happens because the adding of task_work from io_ring_exit_work() isn't synchronized with canceling all work items from eg exec. The execution of the two are ordered in that they are both run by the task itself, but if io_tctx_exit_cb() is queued while we're canceling all work items off exec AND gets executed when the task exits to userspace rather than in the main loop in io_uring_cancel_generic(), then we can find current->io_uring == NULL and hit the above crash. It's safe to add this NULL check here, because the execution of the two paths are done by the task itself. Cc: stable@vger.kernel.org Fixes: d56d938b4bef ("io_uring: do ctx initiated file note removal") Reported-by: syzkaller Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20221206093833.3812138-1-harshit.m.mogalapalli@oracle.com [axboe: add code comment and also put an explanation in the commit msg] Signed-off-by: Jens Axboe commit 92439a859000c6f4c74160a3c08c1a519e3ca125 Merge: 4fad22a1281c5 b3d72d3135d2e Author: Paolo Abeni Date: Wed Dec 7 13:50:15 2022 +0100 Merge tag 'ieee802154-for-net-2022-12-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-12-05 An update from ieee802154 for your *net* tree: Three small fixes this time around. Ziyang Xuan fixed an error code for a timeout during initialization of the cc2520 driver. Hauke Mehrtens fixed a crash in the ca8210 driver SPI communication due uninitialized SPI structures. Wei Yongjun added INIT_LIST_HEAD ieee802154_if_add() to avoid a potential null pointer dereference. ==================== Link: https://lore.kernel.org/r/20221205122515.1720539-1-stefan@datenfreihafen.org Signed-off-by: Paolo Abeni commit 4fad22a1281c500f15b172c9d261eff347ca634b Author: Yuan Can Date: Mon Dec 5 06:15:15 2022 +0000 dpaa2-switch: Fix memory leak in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove() The cmd_buff needs to be freed when error happened in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove(). Fixes: 1110318d83e8 ("dpaa2-switch: add tc flower hardware offload on ingress traffic") Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20221205061515.115012-1-yuancan@huawei.com Signed-off-by: Paolo Abeni commit 063a932b64db3317ec020c94466fe52923a15f60 Author: Zhang Changzhong Date: Sun Dec 4 14:09:08 2022 +0800 ethernet: aeroflex: fix potential skb leak in greth_init_rings() The greth_init_rings() function won't free the newly allocated skb when dma_mapping_error() returns error, so add dev_kfree_skb() to fix it. Compile tested only. Fixes: d4c41139df6e ("net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver") Signed-off-by: Zhang Changzhong Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/1670134149-29516-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Paolo Abeni commit 88956177db179e4eba7cd590971961857d1565b8 Author: Xin Long Date: Sat Dec 3 18:37:21 2022 -0500 tipc: call tipc_lxc_xmit without holding node_read_lock When sending packets between nodes in netns, it calls tipc_lxc_xmit() for peer node to receive the packets where tipc_sk_mcast_rcv()/tipc_sk_rcv() might be called, and it's pretty much like in tipc_rcv(). Currently the local 'node rw lock' is held during calling tipc_lxc_xmit() to protect the peer_net not being freed by another thread. However, when receiving these packets, tipc_node_add_conn() might be called where the peer 'node rw lock' is acquired. Then a dead lock warning is triggered by lockdep detector, although it is not a real dead lock: WARNING: possible recursive locking detected -------------------------------------------- conn_server/1086 is trying to acquire lock: ffff8880065cb020 (&n->lock#2){++--}-{2:2}, \ at: tipc_node_add_conn.cold.76+0xaa/0x211 [tipc] but task is already holding lock: ffff8880065cd020 (&n->lock#2){++--}-{2:2}, \ at: tipc_node_xmit+0x285/0xb30 [tipc] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&n->lock#2); lock(&n->lock#2); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by conn_server/1086: #0: ffff8880036d1e40 (sk_lock-AF_TIPC){+.+.}-{0:0}, \ at: tipc_accept+0x9c0/0x10b0 [tipc] #1: ffff8880036d5f80 (sk_lock-AF_TIPC/1){+.+.}-{0:0}, \ at: tipc_accept+0x363/0x10b0 [tipc] #2: ffff8880065cd020 (&n->lock#2){++--}-{2:2}, \ at: tipc_node_xmit+0x285/0xb30 [tipc] #3: ffff888012e13370 (slock-AF_TIPC){+...}-{2:2}, \ at: tipc_sk_rcv+0x2da/0x1b40 [tipc] Call Trace: dump_stack_lvl+0x44/0x5b __lock_acquire.cold.77+0x1f2/0x3d7 lock_acquire+0x1d2/0x610 _raw_write_lock_bh+0x38/0x80 tipc_node_add_conn.cold.76+0xaa/0x211 [tipc] tipc_sk_finish_conn+0x21e/0x640 [tipc] tipc_sk_filter_rcv+0x147b/0x3030 [tipc] tipc_sk_rcv+0xbb4/0x1b40 [tipc] tipc_lxc_xmit+0x225/0x26b [tipc] tipc_node_xmit.cold.82+0x4a/0x102 [tipc] __tipc_sendstream+0x879/0xff0 [tipc] tipc_accept+0x966/0x10b0 [tipc] do_accept+0x37d/0x590 This patch avoids this warning by not holding the 'node rw lock' before calling tipc_lxc_xmit(). As to protect the 'peer_net', rcu_read_lock() should be enough, as in cleanup_net() when freeing the netns, it calls synchronize_rcu() before the free is continued. Also since tipc_lxc_xmit() is like the RX path in tipc_rcv(), it makes sense to call it under rcu_read_lock(). Note that the right lock order must be: rcu_read_lock(); tipc_node_read_lock(n); tipc_node_read_unlock(n); tipc_lxc_xmit(); rcu_read_unlock(); instead of: tipc_node_read_lock(n); rcu_read_lock(); tipc_node_read_unlock(n); tipc_lxc_xmit(); rcu_read_unlock(); and we have to call tipc_node_read_lock/unlock() twice in tipc_node_xmit(). Fixes: f73b12812a3d ("tipc: improve throughput between nodes in netns") Reported-by: Shuang Li Signed-off-by: Xin Long Link: https://lore.kernel.org/r/5bdd1f8fee9db695cfff4528a48c9b9d0523fb00.1670110641.git.lucien.xin@gmail.com Signed-off-by: Paolo Abeni commit 918ee4911f7a41fb4505dff877c1d7f9f64eb43e Author: Frank Jungclaus Date: Wed Nov 30 21:22:42 2022 +0100 can: esd_usb: Allow REC and TEC to return to zero We don't get any further EVENT from an esd CAN USB device for changes on REC or TEC while those counters converge to 0 (with ecc == 0). So when handling the "Back to Error Active"-event force txerr = rxerr = 0, otherwise the berr-counters might stay on values like 95 forever. Also, to make life easier during the ongoing development a netdev_dbg() has been introduced to allow dumping error events send by an esd CAN USB device. Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/all/20221130202242.3998219-2-frank.jungclaus@esd.eu Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit f4a4d121ebecaa6f396f21745ce97de014281ccc Author: Max Staudt Date: Sat Dec 3 01:01:48 2022 +0900 can: can327: flush TX_work on ldisc .close() Additionally, remove it from .ndo_stop(). This ensures that the worker is not called after being freed, and that the UART TX queue remains active to send final commands when the netdev is stopped. Thanks to Jiri Slaby for finding this in slcan: https://lore.kernel.org/linux-can/20221201073426.17328-1-jirislaby@kernel.org/ A variant of this patch for slcan, with the flush in .ndo_stop() still present, has been tested successfully on physical hardware: https://bugzilla.suse.com/show_bug.cgi?id=1205597 Fixes: 43da2f07622f ("can: can327: CAN/ldisc driver for ELM327 based OBD-II adapters") Cc: "Jiri Slaby (SUSE)" Cc: Max Staudt Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-can@vger.kernel.org Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Max Staudt Link: https://lore.kernel.org/all/20221202160148.282564-1-max@enpas.org Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit fb855e9f3b6b42c72af3f1eb0b288998fe0d5ebb Author: Jiri Slaby (SUSE) Date: Thu Dec 1 08:34:26 2022 +0100 can: slcan: fix freed work crash The LTP test pty03 is causing a crash in slcan: BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 348 Comm: kworker/0:3 Not tainted 6.0.8-1-default #1 openSUSE Tumbleweed 9d20364b934f5aab0a9bdf84e8f45cfdfae39dab Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 Workqueue: 0x0 (events) RIP: 0010:process_one_work (/home/rich/kernel/linux/kernel/workqueue.c:706 /home/rich/kernel/linux/kernel/workqueue.c:2185) Code: 49 89 ff 41 56 41 55 41 54 55 53 48 89 f3 48 83 ec 10 48 8b 06 48 8b 6f 48 49 89 c4 45 30 e4 a8 04 b8 00 00 00 00 4c 0f 44 e0 <49> 8b 44 24 08 44 8b a8 00 01 00 00 41 83 e5 20 f6 45 10 04 75 0e RSP: 0018:ffffaf7b40f47e98 EFLAGS: 00010046 RAX: 0000000000000000 RBX: ffff9d644e1b8b48 RCX: ffff9d649e439968 RDX: 00000000ffff8455 RSI: ffff9d644e1b8b48 RDI: ffff9d64764aa6c0 RBP: ffff9d649e4335c0 R08: 0000000000000c00 R09: ffff9d64764aa734 R10: 0000000000000007 R11: 0000000000000001 R12: 0000000000000000 R13: ffff9d649e4335e8 R14: ffff9d64490da780 R15: ffff9d64764aa6c0 FS: 0000000000000000(0000) GS:ffff9d649e400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 0000000036424000 CR4: 00000000000006f0 Call Trace: worker_thread (/home/rich/kernel/linux/kernel/workqueue.c:2436) kthread (/home/rich/kernel/linux/kernel/kthread.c:376) ret_from_fork (/home/rich/kernel/linux/arch/x86/entry/entry_64.S:312) Apparently, the slcan's tx_work is freed while being scheduled. While slcan_netdev_close() (netdev side) calls flush_work(&sl->tx_work), slcan_close() (tty side) does not. So when the netdev is never set UP, but the tty is stuffed with bytes and forced to wakeup write, the work is scheduled, but never flushed. So add an additional flush_work() to slcan_close() to be sure the work is flushed under all circumstances. The Fixes commit below moved flush_work() from slcan_close() to slcan_netdev_close(). What was the rationale behind it? Maybe we can drop the one in slcan_netdev_close()? I see the same pattern in can327. So it perhaps needs the very same fix. Fixes: cfcb4465e992 ("can: slcan: remove legacy infrastructure") Link: https://bugzilla.suse.com/show_bug.cgi?id=1205597 Reported-by: Richard Palethorpe Tested-by: Petr Vorel Cc: Dario Binacchi Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-can@vger.kernel.org Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org Cc: Max Staudt Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Max Staudt Link: https://lore.kernel.org/all/20221201073426.17328-1-jirislaby@kernel.org Signed-off-by: Marc Kleine-Budde commit 0acc442309a0a1b01bcdaa135e56e6398a49439c Author: Oliver Hartkopp Date: Tue Dec 6 21:12:59 2022 +0100 can: af_can: fix NULL pointer dereference in can_rcv_filter Analogue to commit 8aa59e355949 ("can: af_can: fix NULL pointer dereference in can_rx_register()") we need to check for a missing initialization of ml_priv in the receive path of CAN frames. Since commit 4e096a18867a ("net: introduce CAN specific pointer in the struct net_device") the check for dev->type to be ARPHRD_CAN is not sufficient anymore since bonding or tun netdevices claim to be CAN devices but do not initialize ml_priv accordingly. Fixes: 4e096a18867a ("net: introduce CAN specific pointer in the struct net_device") Reported-by: syzbot+2d7f58292cb5b29eb5ad@syzkaller.appspotmail.com Reported-by: Wei Chen Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20221206201259.3028-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit 1799c1b85e292fbfad99892bbea0beee925149e8 Merge: 78a9ea43fc1a7 d64aaf3f7869f Author: Jakub Kicinski Date: Tue Dec 6 20:46:33 2022 -0800 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-12-05 (i40e) Michal clears XPS init flag on reset to allow for updated values to be written. Sylwester adds sleep to VF reset to resolve issue of VFs not getting resources. Przemyslaw rejects filters for raw IPv4 or IPv6 l4_4_bytes filters as they are not supported. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Disallow ip4 and ip6 l4_4_bytes i40e: Fix for VF MAC address 0 i40e: Fix not setting default xps_cpus after reset ==================== Link: https://lore.kernel.org/r/20221205212523.3197565-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 78a9ea43fc1a7c06a420b132d2d47cbf4344a5df Author: Zhengchao Shao Date: Mon Dec 5 09:21:32 2022 +0800 net: dsa: sja1105: fix memory leak in sja1105_setup_devlink_regions() When dsa_devlink_region_create failed in sja1105_setup_devlink_regions(), priv->regions is not released. Fixes: bf425b82059e ("net: dsa: sja1105: expose static config as devlink region") Signed-off-by: Zhengchao Shao Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221205012132.2110979-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit e40febfb9c99bc30a0dcb60e39b00beb656fdb0f Merge: 7e6303567ce3c c0d999348e01d Author: Jakub Kicinski Date: Tue Dec 6 20:34:46 2022 -0800 Merge branch 'ipv4-two-bug-fixes' Ido Schimmel says: ==================== ipv4: Two small fixes for bugs in IPv4 routing code. A variation of the second bug was reported by an FRR 5.0 (released 06/18) user as this version was setting a table ID of 0 for the default VRF, unlike iproute2 and newer FRR versions. The first bug was discovered while fixing the second. Both bugs are not regressions (never worked) and are not critical in my opinion, so the fixes can be applied to net-next, if desired. No regressions in other tests: # ./fib_tests.sh ... Tests passed: 191 Tests failed: 0 ==================== Link: https://lore.kernel.org/r/20221204075045.3780097-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit c0d999348e01df03e0a7f550351f3907fabbf611 Author: Ido Schimmel Date: Sun Dec 4 09:50:45 2022 +0200 ipv4: Fix incorrect route flushing when table ID 0 is used Cited commit added the table ID to the FIB info structure, but did not properly initialize it when table ID 0 is used. This can lead to a route in the default VRF with a preferred source address not being flushed when the address is deleted. Consider the following example: # ip address add dev dummy1 192.0.2.1/28 # ip address add dev dummy1 192.0.2.17/28 # ip route add 198.51.100.0/24 via 192.0.2.2 src 192.0.2.17 metric 100 # ip route add table 0 198.51.100.0/24 via 192.0.2.2 src 192.0.2.17 metric 200 # ip route show 198.51.100.0/24 198.51.100.0/24 via 192.0.2.2 dev dummy1 src 192.0.2.17 metric 100 198.51.100.0/24 via 192.0.2.2 dev dummy1 src 192.0.2.17 metric 200 Both routes are installed in the default VRF, but they are using two different FIB info structures. One with a metric of 100 and table ID of 254 (main) and one with a metric of 200 and table ID of 0. Therefore, when the preferred source address is deleted from the default VRF, the second route is not flushed: # ip address del dev dummy1 192.0.2.17/28 # ip route show 198.51.100.0/24 198.51.100.0/24 via 192.0.2.2 dev dummy1 src 192.0.2.17 metric 200 Fix by storing a table ID of 254 instead of 0 in the route configuration structure. Add a test case that fails before the fix: # ./fib_tests.sh -t ipv4_del_addr IPv4 delete address route tests Regular FIB info TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Identical FIB info with different table ID TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Table ID 0 TEST: Route removed in default VRF when source address deleted [FAIL] Tests passed: 8 Tests failed: 1 And passes after: # ./fib_tests.sh -t ipv4_del_addr IPv4 delete address route tests Regular FIB info TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Identical FIB info with different table ID TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Table ID 0 TEST: Route removed in default VRF when source address deleted [ OK ] Tests passed: 9 Tests failed: 0 Fixes: 5a56a0b3a45d ("net: Don't delete routes in different VRFs") Reported-by: Donald Sharp Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit f96a3d74554df537b6db5c99c27c80e7afadc8d1 Author: Ido Schimmel Date: Sun Dec 4 09:50:44 2022 +0200 ipv4: Fix incorrect route flushing when source address is deleted Cited commit added the table ID to the FIB info structure, but did not prevent structures with different table IDs from being consolidated. This can lead to routes being flushed from a VRF when an address is deleted from a different VRF. Fix by taking the table ID into account when looking for a matching FIB info. This is already done for FIB info structures backed by a nexthop object in fib_find_info_nh(). Add test cases that fail before the fix: # ./fib_tests.sh -t ipv4_del_addr IPv4 delete address route tests Regular FIB info TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Identical FIB info with different table ID TEST: Route removed from VRF when source address deleted [FAIL] TEST: Route in default VRF not removed [ OK ] RTNETLINK answers: File exists TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [FAIL] Tests passed: 6 Tests failed: 2 And pass after: # ./fib_tests.sh -t ipv4_del_addr IPv4 delete address route tests Regular FIB info TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Identical FIB info with different table ID TEST: Route removed from VRF when source address deleted [ OK ] TEST: Route in default VRF not removed [ OK ] TEST: Route removed in default VRF when source address deleted [ OK ] TEST: Route in VRF is not removed by address delete [ OK ] Tests passed: 8 Tests failed: 0 Fixes: 5a56a0b3a45d ("net: Don't delete routes in different VRFs") Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 7e6303567ce3ca506e4a2704e4baa86f1d8bde02 Author: Rasmus Villemoes Date: Mon Dec 5 21:46:04 2022 +0100 net: fec: properly guard irq coalesce setup Prior to the Fixes: commit, the initialization code went through the same fec_enet_set_coalesce() function as used by ethtool, and that function correctly checks whether the current variant has support for irq coalescing. Now that the initialization code instead calls fec_enet_itr_coal_set() directly, that call needs to be guarded by a check for the FEC_QUIRK_HAS_COALESCE bit. Fixes: df727d4547de (net: fec: don't reset irq coalesce settings to defaults on "ip link up") Reported-by: Greg Ungerer Signed-off-by: Rasmus Villemoes Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221205204604.869853-1-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit 1f154f3b56a1a172833eedf77b72745acc8d9259 Author: Hangbin Liu Date: Tue Dec 6 11:20:55 2022 +0800 bonding: get correct NA dest address In commit 4d633d1b468b ("bonding: fix ICMPv6 header handling when receiving IPv6 messages"), there is a copy/paste issue for NA daddr. I found that in my testing and fixed it in my local branch. But I forgot to re-format the patch and sent the wrong mail. Fix it by reading the correct dest address. Fixes: 4d633d1b468b ("bonding: fix ICMPv6 header handling when receiving IPv6 messages") Signed-off-by: Hangbin Liu Reviewed-by: Eric Dumazet Reviewed-by: Jiri Pirko Acked-by: Jonathan Toppins Link: https://lore.kernel.org/r/20221206032055.7517-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit d95d140e83634e7914277862dee841564d02879f Author: Anders Roxell Date: Tue Dec 6 09:34:16 2022 +0100 ata: libahci_platform: ahci_platform_find_clk: oops, NULL pointer When booting a arm 32-bit kernel with config CONFIG_AHCI_DWC enabled on a am57xx-evm board. This happens when the clock references are unnamed in DT, the strcmp() produces a NULL pointer dereference, see the following oops, NULL pointer dereference: [ 4.673950] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 4.682098] [00000000] *pgd=00000000 [ 4.685699] Internal error: Oops: 5 [#1] SMP ARM [ 4.690338] Modules linked in: [ 4.693420] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc7 #1 [ 4.699615] Hardware name: Generic DRA74X (Flattened Device Tree) [ 4.705749] PC is at strcmp+0x0/0x34 [ 4.709350] LR is at ahci_platform_find_clk+0x3c/0x5c [ 4.714416] pc : [] lr : [] psr: 20000013 [ 4.720703] sp : f000dda8 ip : 00000001 fp : c29b1840 [ 4.725952] r10: 00000020 r9 : c1b23380 r8 : c1b23368 [ 4.731201] r7 : c1ab4cc4 r6 : 00000001 r5 : c3c66040 r4 : 00000000 [ 4.737762] r3 : 00000080 r2 : 00000080 r1 : c1ab4cc4 r0 : 00000000 [...] [ 4.998870] strcmp from ahci_platform_find_clk+0x3c/0x5c [ 5.004302] ahci_platform_find_clk from ahci_dwc_probe+0x1f0/0x54c [ 5.010589] ahci_dwc_probe from platform_probe+0x64/0xc0 [ 5.016021] platform_probe from really_probe+0xe8/0x41c [ 5.021362] really_probe from __driver_probe_device+0xa4/0x204 [ 5.027313] __driver_probe_device from driver_probe_device+0x38/0xc8 [ 5.033782] driver_probe_device from __driver_attach+0xb4/0x1ec [ 5.039825] __driver_attach from bus_for_each_dev+0x78/0xb8 [ 5.045532] bus_for_each_dev from bus_add_driver+0x17c/0x220 [ 5.051300] bus_add_driver from driver_register+0x90/0x124 [ 5.056915] driver_register from do_one_initcall+0x48/0x1e8 [ 5.062591] do_one_initcall from kernel_init_freeable+0x1cc/0x234 [ 5.068817] kernel_init_freeable from kernel_init+0x20/0x13c [ 5.074584] kernel_init from ret_from_fork+0x14/0x2c [ 5.079681] Exception stack(0xf000dfb0 to 0xf000dff8) [ 5.084747] dfa0: 00000000 00000000 00000000 00000000 [ 5.092956] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 5.101165] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 5.107818] Code: e5e32001 e3520000 1afffffb e12fff1e (e4d03001) [ 5.114013] ---[ end trace 0000000000000000 ]--- Add an extra check in the if-statement if hpriv-clks[i].id. Fixes: 6ce73f3a6fc0 ("ata: libahci_platform: Add function returning a clock-handle by id") Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell Reviewed-by: Serge Semin Signed-off-by: Damien Le Moal commit 8ed710da2873c2aeb3bb805864a699affaf1d03b Merge: 5b3e0cd872b09 b7d9aae404841 Author: Linus Torvalds Date: Tue Dec 6 11:03:03 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Catalin Marinas: "Revert the dropping of the cache invalidation from the arm64 arch_dma_prep_coherent() as it caused a regression in the qcom_q6v5_mss remoteproc driver. The driver is already buggy but the original arm64 change made the problem obvious. The change will be re-introduced once the driver is fixed" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()" commit 5b3e0cd872b09c3c771e19464db9dfc20972c39f Merge: b71101d6ae7b1 34e30ebbe48cc Author: Linus Torvalds Date: Tue Dec 6 10:49:19 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "Unless anything comes from the ARM side, this should be the last pull request for this release - and it's mostly documentation: - Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns - s390: fix multi-epoch extension in nested guests - x86: fix uninitialized variable on nested triple fault" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns KVM: Move halt-polling documentation into common directory KVM: x86: fix uninitialized variable use on KVM_REQ_TRIPLE_FAULT KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field commit b71101d6ae7b1149123b0479ea21e9ad391fdd49 Merge: bce9332220bd6 74e7e1efdad45 Author: Linus Torvalds Date: Tue Dec 6 10:19:05 2022 -0800 Merge tag 'for-linus-xsa-6.1-rc9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Two zero-day fixes for the xen-netback driver (XSA-423 and XSA-424)" * tag 'for-linus-xsa-6.1-rc9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/netback: don't call kfree_skb() with interrupts disabled xen/netback: Ensure protocol headers don't fall in the non-linear area commit b7d9aae404841d9999b7476170867ae441e948d2 Author: Will Deacon Date: Tue Dec 6 10:34:03 2022 +0000 Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()" This reverts commit c44094eee32f32f175aadc0efcac449d99b1bbf7. Although the semantics of the DMA API require only a clean operation here, it turns out that the Qualcomm 'qcom_q6v5_mss' remoteproc driver (ab)uses the DMA API for transferring the modem firmware to the secure world via calls to Trustzone [1]. Once the firmware buffer has changed hands, _any_ access from the non-secure side (i.e. Linux) will be detected on the bus and result in a full system reset [2]. Although this is possible even with this revert in place (due to speculative reads via the cacheable linear alias of memory), anecdotally the problem occurs considerably more frequently when the lines have not been invalidated, assumedly due to some micro-architectural interactions with the cache hierarchy. Revert the offending change for now, along with a comment, so that the Qualcomm developers have time to fix the driver [3] to use a firmware buffer which does not have a cacheable alias in the linear map. Link: https://lore.kernel.org/r/20221114110329.68413-1-manivannan.sadhasivam@linaro.org [1] Link: https://lore.kernel.org/r/CAMi1Hd3H2k1J8hJ6e-Miy5+nVDNzv6qQ3nN-9929B0GbHJkXEg@mail.gmail.com/ [2] Link: https://lore.kernel.org/r/20221206092152.GD15486@thinkpad [2] Reported-by: Amit Pundir Reported-by: Manivannan Sadhasivam Cc: Thorsten Leemhuis Cc: Sibi Sankar Signed-off-by: Will Deacon Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20221206103403.646-1-will@kernel.org Signed-off-by: Catalin Marinas commit 74e7e1efdad45580cc3839f2a155174cf158f9b5 Author: Juergen Gross Date: Tue Dec 6 08:54:24 2022 +0100 xen/netback: don't call kfree_skb() with interrupts disabled It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So remove kfree_skb() from the spin_lock_irqsave() section and use the already existing "drop" label in xenvif_start_xmit() for dropping the SKB. At the same time replace the dev_kfree_skb() call there with a call of dev_kfree_skb_any(), as xenvif_start_xmit() can be called with disabled interrupts. This is XSA-424 / CVE-2022-42328 / CVE-2022-42329. Fixes: be81992f9086 ("xen/netback: don't queue unlimited number of packages") Reported-by: Yang Yingliang Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross commit ad7f402ae4f466647c3a669b8a6f3e5d4271c84a Author: Ross Lagerwall Date: Tue Nov 22 09:16:59 2022 +0000 xen/netback: Ensure protocol headers don't fall in the non-linear area In some cases, the frontend may send a packet where the protocol headers are spread across multiple slots. This would result in netback creating an skb where the protocol headers spill over into the non-linear area. Some drivers and NICs don't handle this properly resulting in an interface reset or worse. This issue was introduced by the removal of an unconditional skb pull in the tx path to improve performance. Fix this without reintroducing the pull by setting up grant copy ops for as many slots as needed to reach the XEN_NETBACK_TX_COPY_LEN size. Adjust the rest of the code to handle multiple copy operations per skb. This is XSA-423 / CVE-2022-3643. Fixes: 7e5d7753956b ("xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path") Signed-off-by: Ross Lagerwall Reviewed-by: Paul Durrant Signed-off-by: Juergen Gross commit 743117a997bbd4840e827295c07e59bcd7f7caa3 Author: YueHaibing Date: Sat Dec 3 17:46:35 2022 +0800 tipc: Fix potential OOB in tipc_link_proto_rcv() Fix the potential risk of OOB if skb_linearize() fails in tipc_link_proto_rcv(). Fixes: 5cbb28a4bf65 ("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20221203094635.29024-1-yuehaibing@huawei.com Signed-off-by: Paolo Abeni commit 433c07a13f59856e4585e89e86b7d4cc59348fab Author: Liu Jian Date: Sat Dec 3 17:42:40 2022 +0800 net: hisilicon: Fix potential use-after-free in hix5hd2_rx() The skb is delivered to napi_gro_receive() which may free it, after calling this, dereferencing skb may trigger use-after-free. Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver") Signed-off-by: Liu Jian Link: https://lore.kernel.org/r/20221203094240.1240211-2-liujian56@huawei.com Signed-off-by: Paolo Abeni commit cb37617687f2bfa5b675df7779f869147c9002bd Author: Zeng Heng Date: Sat Dec 3 15:34:41 2022 +0800 net: mdio: fix unbalanced fwnode reference count in mdio_device_release() There is warning report about of_node refcount leak while probing mdio device: OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /spi/soc@0/mdio@710700c0/ethernet@4 In of_mdiobus_register_device(), we increase fwnode refcount by fwnode_handle_get() before associating the of_node with mdio device, but it has never been decreased in normal path. Since that, in mdio_device_release(), it needs to call fwnode_handle_put() in addition instead of calling kfree() directly. After above, just calling mdio_device_free() in the error handle path of of_mdiobus_register_device() is enough to keep the refcount balanced. Fixes: a9049e0c513c ("mdio: Add support for mdio drivers.") Signed-off-by: Zeng Heng Reviewed-by: Yang Yingliang Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20221203073441.3885317-1-zengheng4@huawei.com Signed-off-by: Paolo Abeni commit 4640177049549de1a43e9bc49265f0cdfce08cfd Author: Liu Jian Date: Sat Dec 3 17:42:39 2022 +0800 net: hisilicon: Fix potential use-after-free in hisi_femac_rx() The skb is delivered to napi_gro_receive() which may free it, after calling this, dereferencing skb may trigger use-after-free. Fixes: 542ae60af24f ("net: hisilicon: Add Fast Ethernet MAC driver") Signed-off-by: Liu Jian Link: https://lore.kernel.org/r/20221203094240.1240211-1-liujian56@huawei.com Signed-off-by: Paolo Abeni commit 42330a32933fb42180c52022804dcf09f47a2f99 Author: Yongqiang Liu Date: Sat Dec 3 09:41:25 2022 +0000 net: thunderx: Fix missing destroy_workqueue of nicvf_rx_mode_wq The nicvf_probe() won't destroy workqueue when register_netdev() failed. Add destroy_workqueue err handle case to fix this issue. Fixes: 2ecbe4f4a027 ("net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them.") Signed-off-by: Yongqiang Liu Reviewed-by: Pavan Chebbi Link: https://lore.kernel.org/r/20221203094125.602812-1-liuyongqiang13@huawei.com Signed-off-by: Paolo Abeni commit 5a5a3e564de6a8db987410c5c2f4748d50ea82b8 Author: YueHaibing Date: Sat Dec 3 17:29:41 2022 +0800 ravb: Fix potential use-after-free in ravb_rx_gbeth() The skb is delivered to napi_gro_receive() which may free it, after calling this, dereferencing skb may trigger use-after-free. Fixes: 1c59eb678cbd ("ravb: Fillup ravb_rx_gbeth() stub") Signed-off-by: YueHaibing Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20221203092941.10880-1-yuehaibing@huawei.com Signed-off-by: Paolo Abeni commit 7b8232bdb1789a257de3129a9bb08c69b93a17db Author: Qiheng Lin Date: Sat Dec 3 15:02:59 2022 +0800 net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue The mchp_sparx5_probe() won't destroy workqueue created by create_singlethread_workqueue() in sparx5_start() when later inits failed. Add destroy_workqueue in the cleanup_ports case, also add it in mchp_sparx5_remove() Fixes: b37a1bae742f ("net: sparx5: add mactable support") Signed-off-by: Qiheng Lin Link: https://lore.kernel.org/r/20221203070259.19560-1-linqiheng@huawei.com Signed-off-by: Paolo Abeni commit ee496694b9eea651ae1aa4c4667d886cdf74aa3b Author: Hangbin Liu Date: Sat Dec 3 11:28:58 2022 +0800 ip_gre: do not report erspan version on GRE interface Although the type I ERSPAN is based on the barebones IP + GRE encapsulation and no extra ERSPAN header. Report erspan version on GRE interface looks unreasonable. Fix this by separating the erspan and gre fill info. IPv6 GRE does not have this info as IPv6 only supports erspan version 1 and 2. Reported-by: Jianlin Shi Fixes: f989d546a2d5 ("erspan: Add type I version 0 support.") Signed-off-by: Hangbin Liu Acked-by: William Tu Link: https://lore.kernel.org/r/20221203032858.3130339-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit 23353efc26e98b61b925274ecbb8f0610f69a8aa Author: Zhengchao Shao Date: Sat Dec 3 10:09:03 2022 +0800 net: wwan: iosm: fix memory leak in ipc_mux_init() When failed to alloc ipc_mux->ul_adb.pp_qlt in ipc_mux_init(), ipc_mux is not released. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: Zhengchao Shao Reviewed-by: M Chetan Kumar Link: https://lore.kernel.org/r/20221203020903.383235-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 18010ff776fa42340efc428b3ea6d19b3e7c7b21 Author: Haiyang Zhang Date: Fri Dec 2 11:43:10 2022 -0800 net: mana: Fix race on per-CQ variable napi work_done After calling napi_complete_done(), the NAPIF_STATE_SCHED bit may be cleared, and another CPU can start napi thread and access per-CQ variable, cq->work_done. If the other thread (for example, from busy_poll) sets it to a value >= budget, this thread will continue to run when it should stop, and cause memory corruption and panic. To fix this issue, save the per-CQ work_done variable in a local variable before napi_complete_done(), so it won't be corrupted by a possible concurrent thread after napi_complete_done(). Also, add a flag bit to advertise to the NIC firmware: the NAPI work_done variable race is fixed, so the driver is able to reliably support features like busy_poll. Cc: stable@vger.kernel.org Fixes: e1b5683ff62e ("net: mana: Move NAPI from EQ to CQ") Signed-off-by: Haiyang Zhang Link: https://lore.kernel.org/r/1670010190-28595-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Paolo Abeni commit 61d4f140943c47c1386ed89f7260e00418dfad9d Author: Jisheng Zhang Date: Sat Dec 3 00:17:39 2022 +0800 net: stmmac: fix "snps,axi-config" node property parsing In dt-binding snps,dwmac.yaml, some properties under "snps,axi-config" node are named without "axi_" prefix, but the driver expects the prefix. Since the dt-binding has been there for a long time, we'd better make driver match the binding for compatibility. Fixes: afea03656add ("stmmac: rework DMA bus setting and introduce new platform AXI structure") Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20221202161739.2203-1-jszhang@kernel.org Signed-off-by: Paolo Abeni commit 63ff545af73f759d1bd04198af8ed8577fb739fc Author: Wang Yufen Date: Mon Dec 5 14:19:56 2022 +0800 gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() The node returned by of_get_parent() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the end of of_pinctrl_get(). Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by: Wang Yufen Signed-off-by: Bartosz Golaszewski commit 6f2d71524bcfdeb1fcbd22a4a92a5b7b161ab224 Author: Pankaj Raghav Date: Thu Dec 1 13:52:34 2022 +0100 nvme initialize core quirks before calling nvme_init_subsystem A device might have a core quirk for NVME_QUIRK_IGNORE_DEV_SUBNQN (such as Samsung X5) but it would still give a: "missing or invalid SUBNQN field" warning as core quirks are filled after calling nvme_init_subnqn. Fill ctrl->quirks from struct core_quirks before calling nvme_init_subsystem to fix this. Tested on a Samsung X5. Fixes: ab9e00cc72fa ("nvme: track subsystems") Signed-off-by: Pankaj Raghav Signed-off-by: Christoph Hellwig commit e329e71013c9b5a4535b099208493c7826ee4a64 Author: Kees Cook Date: Fri Dec 2 13:44:14 2022 -0800 NFC: nci: Bounds check struct nfc_target arrays While running under CONFIG_FORTIFY_SOURCE=y, syzkaller reported: memcpy: detected field-spanning write (size 129) of single field "target->sensf_res" at net/nfc/nci/ntf.c:260 (size 18) This appears to be a legitimate lack of bounds checking in nci_add_new_protocol(). Add the missing checks. Reported-by: syzbot+210e196cef4711b65139@syzkaller.appspotmail.com Link: https://lore.kernel.org/lkml/0000000000001c590f05ee7b3ff4@google.com Fixes: 019c4fbaa790 ("NFC: Add NCI multiple targets support") Signed-off-by: Kees Cook Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221202214410.never.693-kees@kernel.org Signed-off-by: Jakub Kicinski commit bce9332220bd677d83b19d21502776ad555a0e73 Author: Linus Torvalds Date: Mon Dec 5 12:09:06 2022 -0800 proc: proc_skip_spaces() shouldn't think it is working on C strings proc_skip_spaces() seems to think it is working on C strings, and ends up being just a wrapper around skip_spaces() with a really odd calling convention. Instead of basing it on skip_spaces(), it should have looked more like proc_skip_char(), which really is the exact same function (except it skips a particular character, rather than whitespace). So use that as inspiration, odd coding and all. Now the calling convention actually makes sense and works for the intended purpose. Reported-and-tested-by: Kyle Zeng Acked-by: Eric Dumazet Signed-off-by: Linus Torvalds commit e6cfaf34be9fcd1a8285a294e18986bfc41a409c Author: Linus Torvalds Date: Mon Dec 5 11:33:40 2022 -0800 proc: avoid integer type confusion in get_proc_long proc_get_long() is passed a size_t, but then assigns it to an 'int' variable for the length. Let's not do that, even if our IO paths are limited to MAX_RW_COUNT (exactly because of these kinds of type errors). So do the proper test in the rigth type. Reported-by: Kyle Zeng Signed-off-by: Linus Torvalds commit 6e90293618ed476d6b11f82ce724efbb9e9a071b Author: Zack Rusin Date: Thu Dec 1 12:53:41 2022 -0500 drm/vmwgfx: Don't use screen objects when SEV is active When SEV is enabled gmr's and mob's are explicitly disabled because the encrypted system memory can not be used by the hypervisor. The driver was disabling GMR's but the presentation code, which depends on GMR's, wasn't honoring it which lead to black screen on hosts with SEV enabled. Make sure screen objects presentation is not used when guest memory regions have been disabled to fix presentation on SEV enabled hosts. Fixes: 3b0d6458c705 ("drm/vmwgfx: Refuse DMA operation when SEV encryption is active") Cc: # v5.7+ Signed-off-by: Zack Rusin Reported-by: Nicholas Hunt Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20221201175341.491884-1-zack@kde.org commit b52be557e24c47286738276121177a41f54e3b83 Author: Jann Horn Date: Mon Dec 5 17:59:27 2022 +0100 ipc/sem: Fix dangling sem_array access in semtimedop race When __do_semtimedop() goes to sleep because it has to wait for a semaphore value becoming zero or becoming bigger than some threshold, it links the on-stack sem_queue to the sem_array, then goes to sleep without holding a reference on the sem_array. When __do_semtimedop() comes back out of sleep, one of two things must happen: a) We prove that the on-stack sem_queue has been disconnected from the (possibly freed) sem_array, making it safe to return from the stack frame that the sem_queue exists in. b) We stabilize our reference to the sem_array, lock the sem_array, and detach the sem_queue from the sem_array ourselves. sem_array has RCU lifetime, so for case (b), the reference can be stabilized inside an RCU read-side critical section by locklessly checking whether the sem_queue is still connected to the sem_array. However, the current code does the lockless check on sem_queue before starting an RCU read-side critical section, so the result of the lockless check immediately becomes useless. Fix it by doing rcu_read_lock() before the lockless check. Now RCU ensures that if we observe the object being on our queue, the object can't be freed until rcu_read_unlock(). This bug is only hittable on kernel builds with full preemption support (either CONFIG_PREEMPT or PREEMPT_DYNAMIC with preempt=full). Fixes: 370b262c896e ("ipc/sem: avoid idr tree lookup for interrupted semop") Cc: stable@vger.kernel.org Signed-off-by: Jann Horn Signed-off-by: Linus Torvalds commit d64aaf3f7869f915fd120763d75f11d6b116424d Author: Przemyslaw Patynowski Date: Tue Nov 15 09:49:25 2022 +0100 i40e: Disallow ip4 and ip6 l4_4_bytes Return -EOPNOTSUPP, when user requests l4_4_bytes for raw IP4 or IP6 flow director filters. Flow director does not support filtering on l4 bytes for PCTYPEs used by IP4 and IP6 filters. Without this patch, user could create filters with l4_4_bytes fields, which did not do any filtering on L4, but only on L3 fields. Fixes: 36777d9fa24c ("i40e: check current configured input set when adding ntuple filters") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Kamil Maziarz Reviewed-by: Jacob Keller Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 08501970472077ed5de346ad89943a37d1692e9b Author: Sylwester Dziedziuch Date: Mon Oct 31 13:00:28 2022 +0100 i40e: Fix for VF MAC address 0 After spawning max VFs on a PF, some VFs were not getting resources and their MAC addresses were 0. This was caused by PF sleeping before flushing HW registers which caused VIRTCHNL_VFR_VFACTIVE to not be set in time for VF. Fix by adding a sleep after hw flush. Fixes: e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF") Signed-off-by: Sylwester Dziedziuch Signed-off-by: Jan Sokolowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 82e0572b23029b380464fa9fdc125db9c1506d0a Author: Michal Jaron Date: Mon Oct 24 10:19:42 2022 +0200 i40e: Fix not setting default xps_cpus after reset During tx rings configuration default XPS queue config is set and __I40E_TX_XPS_INIT_DONE is locked. __I40E_TX_XPS_INIT_DONE state is cleared and set again with default mapping only during queues build, it means after first setup or reset with queues rebuild. (i.e. ethtool -L combined ) After other resets (i.e. ethtool -t ) XPS_INIT_DONE is not cleared and those default maps cannot be set again. It results in cleared xps_cpus mapping until queues are not rebuild or mapping is not set by user. Add clearing __I40E_TX_XPS_INIT_DONE state during reset to let the driver set xps_cpus to defaults again after it was cleared. Fixes: 6f853d4f8e93 ("i40e: allow XPS with QoS enabled") Signed-off-by: Michal Jaron Signed-off-by: Kamil Maziarz Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 81c95fbaebfa5990c3c786c8c3e87426a33106fe Author: Jacob Pan Date: Mon Dec 5 21:14:12 2022 +0800 iommu/vt-d: Fix buggy QAT device mask Impacted QAT device IDs that need extra dtlb flush quirk is ranging from 0x4940 to 0x4943. After bitwise AND device ID with 0xfffc the result should be 0x4940 instead of 0x494c to identify these devices. Fixes: e65a6897be5e ("iommu/vt-d: Add a fix for devices need extra dtlb flush") Reported-by: Raghunathan Srinivasan Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan Link: https://lore.kernel.org/r/20221203005610.2927487-1-jacob.jun.pan@linux.intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e8b4fc13900b8e8be48debffd0dfd391772501f7 Author: Dan Carpenter Date: Fri Dec 2 12:58:26 2022 +0300 net: mvneta: Prevent out of bounds read in mvneta_config_rss() The pp->indir[0] value comes from the user. It is passed to: if (cpu_online(pp->rxq_def)) inside the mvneta_percpu_elect() function. It needs bounds checkeding to ensure that it is not beyond the end of the cpu bitmap. Fixes: cad5d847a093 ("net: mvneta: Fix the CPU choice in mvneta_percpu_elect") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit d50b7914fae04d840ce36491d22133070b18cca9 Author: Lin Liu Date: Fri Dec 2 08:52:48 2022 +0000 xen-netfront: Fix NULL sring after live migration A NAPI is setup for each network sring to poll data to kernel The sring with source host is destroyed before live migration and new sring with target host is setup after live migration. The NAPI for the old sring is not deleted until setup new sring with target host after migration. With busy_poll/busy_read enabled, the NAPI can be polled before got deleted when resume VM. BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: xennet_poll+0xae/0xd20 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI Call Trace: finish_task_switch+0x71/0x230 timerqueue_del+0x1d/0x40 hrtimer_try_to_cancel+0xb5/0x110 xennet_alloc_rx_buffers+0x2a0/0x2a0 napi_busy_loop+0xdb/0x270 sock_poll+0x87/0x90 do_sys_poll+0x26f/0x580 tracing_map_insert+0x1d4/0x2f0 event_hist_trigger+0x14a/0x260 finish_task_switch+0x71/0x230 __schedule+0x256/0x890 recalc_sigpending+0x1b/0x50 xen_sched_clock+0x15/0x20 __rb_reserve_next+0x12d/0x140 ring_buffer_lock_reserve+0x123/0x3d0 event_triggers_call+0x87/0xb0 trace_event_buffer_commit+0x1c4/0x210 xen_clocksource_get_cycles+0x15/0x20 ktime_get_ts64+0x51/0xf0 SyS_ppoll+0x160/0x1a0 SyS_ppoll+0x160/0x1a0 do_syscall_64+0x73/0x130 entry_SYSCALL_64_after_hwframe+0x41/0xa6 ... RIP: xennet_poll+0xae/0xd20 RSP: ffffb4f041933900 CR2: 0000000000000008 ---[ end trace f8601785b354351c ]--- xen frontend should remove the NAPIs for the old srings before live migration as the bond srings are destroyed There is a tiny window between the srings are set to NULL and the NAPIs are disabled, It is safe as the NAPI threads are still frozen at that time Signed-off-by: Lin Liu Fixes: 4ec2411980d0 ([NET]: Do not check netif_running() and carrier state in ->poll()) Signed-off-by: David S. Miller commit 121c6672b0191ffcebff4b88ec022c39e0a95789 Author: Casper Andersson Date: Fri Dec 2 09:35:44 2022 +0100 net: microchip: sparx5: correctly free skb in xmit consume_skb on transmitted, kfree_skb on dropped, do not free on TX_BUSY. Previously the xmit function could return -EBUSY without freeing, which supposedly is interpreted as a drop. And was using kfree on successfully transmitted packets. sparx5_fdma_xmit and sparx5_inject returns error code, where -EBUSY indicates TX_BUSY and any other error code indicates dropped. Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support") Signed-off-by: Casper Andersson Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit fbf33f5ac76f2cdb47ad9763f620026d5cfa57ce Author: Ziyang Xuan Date: Fri Dec 2 19:04:30 2022 +0800 octeontx2-pf: Fix potential memory leak in otx2_init_tc() In otx2_init_tc(), if rhashtable_init() failed, it does not free tc->tc_entries_bitmap which is allocated in otx2_tc_alloc_ent_bitmap(). Fixes: 2e2a8126ffac ("octeontx2-pf: Unify flow management variables") Signed-off-by: Ziyang Xuan Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 165df24186ecea95705505627df3dacf5e7ff6bf Author: Yang Yingliang Date: Fri Dec 2 13:18:33 2022 +0800 net: mdiobus: fix double put fwnode in the error path If phy_device_register() or fwnode_mdiobus_phy_device_register() fail, phy_device_free() is called, the device refcount is decreased to 0, then fwnode_handle_put() will be called in phy_device_release(), but in the error path, fwnode_handle_put() has already been called, so set fwnode to NULL after fwnode_handle_put() in the error path to avoid double put. Fixes: cdde1560118f ("net: mdiobus: fix unbalanced node reference count") Reported-by: Zeng Heng Tested-by: Zeng Heng Signed-off-by: Yang Yingliang Reviewed-by: Zeng Heng Tested-by: Zeng Heng Signed-off-by: David S. Miller commit 25f427ac7b8d89b0259f86c0c6407b329df742b2 Author: Valentina Goncharenko Date: Thu Dec 1 20:34:08 2022 +0300 net: encx24j600: Fix invalid logic in reading of MISTAT register A loop for reading MISTAT register continues while regmap_read() fails and (mistat & BUSY), but if regmap_read() fails a value of mistat is undefined. The patch proposes to check for BUSY flag only when regmap_read() succeed. Compile test only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d70e53262f5c ("net: Microchip encx24j600 driver") Signed-off-by: Valentina Goncharenko Reviewed-by: Pavan Chebbi Signed-off-by: David S. Miller commit 167b3f2dcc62c271f3555b33df17e361bb1fa0ee Author: Valentina Goncharenko Date: Thu Dec 1 20:34:07 2022 +0300 net: encx24j600: Add parentheses to fix precedence In functions regmap_encx24j600_phy_reg_read() and regmap_encx24j600_phy_reg_write() in the conditions of the waiting cycles for filling the variable 'ret' it is necessary to add parentheses to prevent wrong assignment due to logical operations precedence. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d70e53262f5c ("net: Microchip encx24j600 driver") Signed-off-by: Valentina Goncharenko Reviewed-by: Pavan Chebbi Signed-off-by: David S. Miller commit b3d72d3135d2ef68296c1ee174436efd65386f04 Author: Wei Yongjun Date: Wed Nov 30 09:17:05 2022 +0000 mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add() Kernel fault injection test reports null-ptr-deref as follows: BUG: kernel NULL pointer dereference, address: 0000000000000008 RIP: 0010:cfg802154_netdev_notifier_call+0x120/0x310 include/linux/list.h:114 Call Trace: raw_notifier_call_chain+0x6d/0xa0 kernel/notifier.c:87 call_netdevice_notifiers_info+0x6e/0xc0 net/core/dev.c:1944 unregister_netdevice_many_notify+0x60d/0xcb0 net/core/dev.c:1982 unregister_netdevice_queue+0x154/0x1a0 net/core/dev.c:10879 register_netdevice+0x9a8/0xb90 net/core/dev.c:10083 ieee802154_if_add+0x6ed/0x7e0 net/mac802154/iface.c:659 ieee802154_register_hw+0x29c/0x330 net/mac802154/main.c:229 mcr20a_probe+0xaaa/0xcb1 drivers/net/ieee802154/mcr20a.c:1316 ieee802154_if_add() allocates wpan_dev as netdev's private data, but not init the list in struct wpan_dev. cfg802154_netdev_notifier_call() manage the list when device register/unregister, and may lead to null-ptr-deref. Use INIT_LIST_HEAD() on it to initialize it correctly. Fixes: fcf39e6e88e9 ("ieee802154: add wpan_dev_list") Signed-off-by: Wei Yongjun Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20221130091705.1831140-1-weiyongjun@huaweicloud.com Signed-off-by: Stefan Schmidt commit 5c306de8f787ab7df51f846e57ac79cd713537d5 Author: Yinjun Zhang Date: Fri Dec 2 14:46:46 2022 +0100 nfp: correct desc type when header dma len is 4096 When there's only one buffer to dma and its length is 4096, then only one data descriptor is needed to carry it according to current descriptor definition. So the descriptor type should be `simple` instead of `gather`, the latter requires more than one descriptor, otherwise it'll be dropped by application firmware. Fixes: c10d12e3dce8 ("nfp: add support for NFDK data path") Fixes: d9d950490a0a ("nfp: nfdk: implement xdp tx path for NFDK") Signed-off-by: Yinjun Zhang Reviewed-by: Richard Donkin Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20221202134646.311108-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 76dcd734eca23168cb008912c0f69ff408905235 Author: Linus Torvalds Date: Sun Dec 4 14:48:12 2022 -0800 Linux 6.1-rc8 commit 0ba09b1733878afe838fe35c310715fda3d46428 Author: Linus Torvalds Date: Sun Dec 4 12:51:59 2022 -0800 Revert "mm: align larger anonymous mappings on THP boundaries" This reverts commit f35b5d7d676e59e401690b678cd3cfec5e785c23. It has been reported to cause huge performance regressions on some loads (will-it-scale.per_process_ops, but also building the kernel with clang). The commit did speed up gcc builds by a small amount, so it's not an unambiguous regression, but until the big regressions are understood, let's revert it. Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210181535.7144dd15-yujie.liu@intel.com Reported-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/Y1DNQaoPWxE%2BrGce@dev-arch.thelio-3990X/ Cc: Huang, Ying Cc: Rik van Riel Cc: Andrew Morton Cc: Yang Shi Signed-off-by: Linus Torvalds commit 23393c6461422df5bf8084a086ada9a7e17dc2ba Author: Jan Dabros Date: Mon Nov 28 20:56:51 2022 +0100 char: tpm: Protect tpm_pm_suspend with locks Currently tpm transactions are executed unconditionally in tpm_pm_suspend() function, which may lead to races with other tpm accessors in the system. Specifically, the hw_random tpm driver makes use of tpm_get_random(), and this function is called in a loop from a kthread, which means it's not frozen alongside userspace, and so can race with the work done during system suspend: tpm tpm0: tpm_transmit: tpm_recv: error -52 tpm tpm0: invalid TPM_STS.x 0xff, dumping stack for forensics CPU: 0 PID: 1 Comm: init Not tainted 6.1.0-rc5+ #135 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-20220807_005459-localhost 04/01/2014 Call Trace: tpm_tis_status.cold+0x19/0x20 tpm_transmit+0x13b/0x390 tpm_transmit_cmd+0x20/0x80 tpm1_pm_suspend+0xa6/0x110 tpm_pm_suspend+0x53/0x80 __pnp_bus_suspend+0x35/0xe0 __device_suspend+0x10f/0x350 Fix this by calling tpm_try_get_ops(), which itself is a wrapper around tpm_chip_start(), but takes the appropriate mutex. Signed-off-by: Jan Dabros Reported-by: Vlastimil Babka Tested-by: Jason A. Donenfeld Tested-by: Vlastimil Babka Link: https://lore.kernel.org/all/c5ba47ef-393f-1fba-30bd-1230d1b4b592@suse.cz/ Cc: stable@vger.kernel.org Fixes: e891db1a18bf ("tpm: turn on TPM on suspend for TPM 1.x") [Jason: reworked commit message, added metadata] Signed-off-by: Jason A. Donenfeld Reviewed-by: Jarkko Sakkinen Signed-off-by: Linus Torvalds commit 0c3b5bcb484a659dd14466f92a073b57b2d3c1a5 Merge: eea8bebd51739 517e6a301f346 Author: Linus Torvalds Date: Sun Dec 4 12:36:23 2022 -0800 Merge tag 'perf_urgent_for_v6.1_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Fix a use-after-free case where the perf pending task callback would see an already freed event * tag 'perf_urgent_for_v6.1_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix perf_pending_task() UaF commit eea8bebd51739cc7a3bb501032ee877b4aada553 Merge: ae6bb71711713 d9f15a9de44af Author: Linus Torvalds Date: Sun Dec 4 12:33:44 2022 -0800 Merge tag 'timers_urgent_for_v6.1_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Borislav Petkov: - Revert a fix to RISC-V timers supposed to address an uncertainty whether clock events are received during S3 or not which locks up other RISC-V platforms. The issue will be fixed differently later. * tag 'timers_urgent_for_v6.1_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend" commit ae6bb71711713e7b6b2d9ed2af7318dc8ae5cfb2 Merge: 50f36c5aa12c8 2e7ec190a0e38 Author: Linus Torvalds Date: Sun Dec 4 12:24:58 2022 -0800 Merge tag 'powerpc-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix oops in 32-bit BPF tail call tests - Add missing declaration for machine_check_early_boot() Thanks to Christophe Leroy and Naveen N. Rao. * tag 'powerpc-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s: Add missing declaration for machine_check_early_boot() powerpc/bpf/32: Fix Oops on tail call tests commit 50f36c5aa12c8d0f2adca662e0c106212ea897a8 Merge: c2bf05db6c78f 8c9a59939deb4 Author: Linus Torvalds Date: Sun Dec 4 12:18:37 2022 -0800 Merge tag 'input-for-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fix from Dmitry Torokhov: - a fix for Raydium touchscreen driver to stop leaking memory when sending commands to the chip * tag 'input-for-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() commit 09bf649a74573cb596e211418a4f8008f265c5a9 Author: Rob Clark Date: Wed Nov 30 10:57:48 2022 -0800 drm/shmem-helper: Avoid vm_open error paths vm_open() is not allowed to fail. Fortunately we are guaranteed that the pages are already pinned, thanks to the initial mmap which is now being cloned into a forked process, and only need to increment the refcnt. So just increment it directly. Previously if a signal was delivered at the wrong time to the forking process, the mutex_lock_interruptible() could fail resulting in the pages_use_count not being incremented. Fixes: 2194a63a818d ("drm: Add library for shmem backed GEM objects") Cc: stable@vger.kernel.org Signed-off-by: Rob Clark Reviewed-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20221130185748.357410-3-robdclark@gmail.com commit 24013314be6ee4ee456114a671e9fa3461323de8 Author: Rob Clark Date: Wed Nov 30 10:57:47 2022 -0800 drm/shmem-helper: Remove errant put in error path drm_gem_shmem_mmap() doesn't own this reference, resulting in the GEM object getting prematurely freed leading to a later use-after-free. Link: https://syzkaller.appspot.com/bug?extid=c8ae65286134dd1b800d Reported-by: syzbot+c8ae65286134dd1b800d@syzkaller.appspotmail.com Fixes: 2194a63a818d ("drm: Add library for shmem backed GEM objects") Cc: stable@vger.kernel.org Signed-off-by: Rob Clark Reviewed-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20221130185748.357410-2-robdclark@gmail.com commit c2bf05db6c78f53ca5cd4b48f3b9b71f78d215f1 Merge: 6085bc95797ca d36678f7905cb Author: Linus Torvalds Date: Sat Dec 3 13:51:37 2022 -0800 Merge tag 'i2c-for-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "A power state fix in the core for ACPI devices, a regression fix regarding bus recovery for the cadence driver, a DMA handling fix for the imx driver, and two error path fixes (npcm7xx and qcom-geni)" * tag 'i2c-for-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set i2c: qcom-geni: fix error return code in geni_i2c_gpi_xfer i2c: cadence: Fix regression with bus recovery i2c: Restore initial power state if probe fails i2c: npcm7xx: Fix error handling in npcm_i2c_init() commit 6085bc95797caa55a68bc0f7dd73e8c33e91037f Merge: 97ee9d1c16963 472faf72b33d8 Author: Linus Torvalds Date: Sat Dec 3 13:43:38 2022 -0800 Merge tag 'dax-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull dax fixes from Dan Williams: "A few bug fixes around the handling of "Soft Reserved" memory and memory tiering information. Linux is starting to enounter more real world systems that deploy an ACPI HMAT to describe different performance classes of memory, as well the "special purpose" (Linux "Soft Reserved") designation from EFI. These fixes result from that testing. It has all appeared in -next for a while with no known issues. - Fix duplicate overlapping device-dax instances for HMAT described "Soft Reserved" Memory - Fix missing node targets in the sysfs representation of memory tiers - Remove a confusing variable initialization" * tag 'dax-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: device-dax: Fix duplicate 'hmem' device registration ACPI: HMAT: Fix initiator registration for single-initiator systems ACPI: HMAT: remove unnecessary variable initialization commit 6a30d3e3491dc562384e9f15b201a8a25b57439f Author: Tiezhu Yang Date: Thu Dec 1 11:10:48 2022 +0800 selftests: net: Use "grep -E" instead of "egrep" The latest version of grep claims the egrep is now obsolete so the build now contains warnings that look like: egrep: warning: egrep is obsolescent; using grep -E fix this using "grep -E" instead. sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/testing/selftests/net` Here are the steps to install the latest grep: wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz tar xf grep-3.8.tar.gz cd grep-3.8 && ./configure && make sudo make install export PATH=/usr/local/bin:$PATH Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1669864248-829-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Jakub Kicinski commit 85a0506c073332a3057f5a9635fa0d4db5a8e03b Author: Zhengchao Shao Date: Thu Dec 1 16:22:46 2022 +0800 selftests: rtnetlink: correct xfrm policy rule in kci_test_ipsec_offload When testing in kci_test_ipsec_offload, srcip is configured as $dstip, it should add xfrm policy rule in instead of out. The test result of this patch is as follows: PASS: ipsec_offload Fixes: 2766a11161cc ("selftests: rtnetlink: add ipsec offload API test") Signed-off-by: Zhengchao Shao Acked-by: Hangbin Liu Link: https://lore.kernel.org/r/20221201082246.14131-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 6648eadba8d6b37c8e6cb1b906f68509b3b39385 Author: Tianjia Zhang Date: Thu Dec 1 21:18:52 2022 +0800 selftests/tls: Fix tls selftests dependency to correct algorithm Commit d2825fa9365d ("crypto: sm3,sm4 - move into crypto directory") moves SM3 and SM4 algorithm implementations from stand-alone library to crypto API. The corresponding configuration options for the API version (generic) are CONFIG_CRYPTO_SM3_GENERIC and CONFIG_CRYPTO_SM4_GENERIC, respectively. Replace option selected in selftests configuration from the library version to the API version. Fixes: d2825fa9365d ("crypto: sm3,sm4 - move into crypto directory") Reported-by: Hangbin Liu Cc: Jason A. Donenfeld Cc: stable@vger.kernel.org # v5.19+ Signed-off-by: Tianjia Zhang Link: https://lore.kernel.org/r/20221201131852.38501-1-tianjia.zhang@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 8948876335b1752176afdff8e704099a3ea0f6e6 Author: Artem Chernyshev Date: Thu Dec 1 17:00:32 2022 +0300 net: dsa: sja1105: Check return value Return NULL if we got unexpected value from skb_trim_rcsum() in sja1110_rcv_inband_control_extension() Fixes: 4913b8ebf8a9 ("net: dsa: add support for the SJA1110 native tagging protocol") Signed-off-by: Artem Chernyshev Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221201140032.26746-3-artem.chernyshev@red-soft.ru Signed-off-by: Jakub Kicinski commit d4edb50688652eb10be270bc515da63815de428f Author: Artem Chernyshev Date: Thu Dec 1 17:00:31 2022 +0300 net: dsa: hellcreek: Check return value Return NULL if we got unexpected value from skb_trim_rcsum() in hellcreek_rcv() Fixes: 01ef09caad66 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches") Signed-off-by: Artem Chernyshev Reviewed-by: Florian Fainelli Reviewed-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20221201140032.26746-2-artem.chernyshev@red-soft.ru Signed-off-by: Jakub Kicinski commit 3d8fdcbf1f42e2bb9ae8b8c0b6f202278c788a22 Author: Artem Chernyshev Date: Thu Dec 1 17:00:30 2022 +0300 net: dsa: ksz: Check return value Return NULL if we got unexpected value from skb_trim_rcsum() in ksz_common_rcv() Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: bafe9ba7d908 ("net: dsa: ksz: Factor out common tag code") Signed-off-by: Artem Chernyshev Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221201140032.26746-1-artem.chernyshev@red-soft.ru Signed-off-by: Jakub Kicinski commit a789c70c1dfed36a31bae1f2df55bc9b8429287a Merge: e931a173a685f b5ca338751ad4 Author: Jakub Kicinski Date: Fri Dec 2 20:28:04 2022 -0800 Merge tag 'for-net-2022-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix regressions with CSR controller clones - Fix support for Read Local Supported Codecs V2 - Fix overflow on L2CAP code - Fix missing hci_dev_put on ISO and L2CAP code * tag 'for-net-2022-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: Fix crash when replugging CSR fake controllers Bluetooth: Fix not cleanup led when bt_init fails Bluetooth: Fix support for Read Local Supported Codecs V2 Bluetooth: Remove codec id field in vendor codec definition Bluetooth: L2CAP: Fix u8 overflow Bluetooth: silence a dmesg error message in hci_request.c Bluetooth: hci_conn: add missing hci_dev_put() in iso_listen_bis() Bluetooth: 6LoWPAN: add missing hci_dev_put() in get_l2cap_conn() Bluetooth: btusb: Add debug message for CSR controllers Bluetooth: btusb: Fix CSR clones again by re-adding ERR_DATA_REPORTING quirk ==================== Link: https://lore.kernel.org/r/20221202213726.2801581-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 97ee9d1c16963375eefdf964c429897d27e28956 Merge: 63050a5ca130e d0f411c0b9bde Author: Linus Torvalds Date: Fri Dec 2 16:27:15 2022 -0800 Merge tag 'block-6.1-2022-12-02' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "Just a small NVMe merge for this week, fixing protection of the name space list, and a missing clear of a reserved field when unused" * tag 'block-6.1-2022-12-02' of git://git.kernel.dk/linux: nvme: fix SRCU protection of nvme_ns_head list nvme-pci: clear the prp2 field when not used commit 63050a5ca130e76af7199c9a3fba1d175f3a1102 Merge: 0e15c3c75a28b 6989ea4881c89 Author: Linus Torvalds Date: Fri Dec 2 16:22:17 2022 -0800 Merge tag 'pinctrl-v6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Three driver fixes. The Intel fix looks like the most important. - Fix a potential divide by zero in pinctrl-singe (OMAP and HiSilicon) - Disable IRQs on startup in the Mediatek driver. This is a classic, we should be looking out for this more. - Save and restore pins in 'direct IRQ' mode in the Intel driver, this works around firmware bugs" * tag 'pinctrl-v6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: intel: Save and restore pins in "direct IRQ" mode pinctrl: meditatek: Startup with the IRQs disabled pinctrl: single: Fix potential division by zero commit 0e15c3c75a28b10bac7b3ad7627fd6b458623283 Merge: 2df2adc3e69d3 39cefc5f6cd25 Author: Linus Torvalds Date: Fri Dec 2 16:04:53 2022 -0800 Merge tag 'riscv-for-linus-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - build fix for the NR_CPUS Kconfig SBI version dependency - fixes to early memory initialization, to fix page permissions in EFI and post-initmem-free - build fix for the VDSO, to avoid trying to profile the VDSO functions - fixes for kexec crash handling, to fix multi-core and interrupt related initialization inside the crash kernel - fix for a race condition when handling multiple concurrect kernel stack overflows * tag 'riscv-for-linus-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: kexec: Fixup crash_smp_send_stop without multi cores riscv: kexec: Fixup irq controller broken in kexec crash path riscv: mm: Proper page permissions after initmem free riscv: vdso: fix section overlapping under some conditions riscv: fix race when vmap stack overflow riscv: Sync efi page table's kernel mappings before switching riscv: Fix NR_CPUS range conditions commit 2df2adc3e69d32751eb534ed55c591854260c4a3 Merge: f66f62f83dba3 dd30dcfa7a74a Author: Linus Torvalds Date: Fri Dec 2 15:58:07 2022 -0800 Merge tag 'mmc-v6.1-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix ambiguous TRIM and DISCARD args - Fix removal of debugfs file for mmc_test MMC host: - mtk-sd: Add missing clk_disable_unprepare() in an error path - sdhci: Fix I/O voltage switch delay for UHS-I SD cards - sdhci-esdhc-imx: Fix CQHCI exit halt state check - sdhci-sprd: Fix voltage switch" * tag 'mmc-v6.1-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-sprd: Fix no reset data and command after voltage switch mmc: sdhci: Fix voltage switch delay mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse() mmc: mmc_test: Fix removal of debugfs file mmc: sdhci-esdhc-imx: correct CQHCI exit halt state check mmc: core: Fix ambiguous TRIM and DISCARD arg commit f66f62f83dba3ec4237c3dd7a95b776824ac91a0 Merge: 66065157420c5 4bedbbd782ebb Author: Linus Torvalds Date: Fri Dec 2 15:54:12 2022 -0800 Merge tag 'iommu-fixes-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: "Intel VT-d fixes: - IO/TLB flush fix - Various pci_dev refcount fixes" * tag 'iommu-fixes-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() iommu/vt-d: Fix PCI device refcount leak in has_external_pci() iommu/vt-d: Fix PCI device refcount leak in prq_event_thread() iommu/vt-d: Add a fix for devices need extra dtlb flush commit 66065157420c5b9b3f078f43d313c153e1ff7f83 Author: Pawan Gupta Date: Wed Nov 30 07:25:51 2022 -0800 x86/bugs: Make sure MSR_SPEC_CTRL is updated properly upon resume from S3 The "force" argument to write_spec_ctrl_current() is currently ambiguous as it does not guarantee the MSR write. This is due to the optimization that writes to the MSR happen only when the new value differs from the cached value. This is fine in most cases, but breaks for S3 resume when the cached MSR value gets out of sync with the hardware MSR value due to S3 resetting it. When x86_spec_ctrl_current is same as x86_spec_ctrl_base, the MSR write is skipped. Which results in SPEC_CTRL mitigations not getting restored. Move the MSR write from write_spec_ctrl_current() to a new function that unconditionally writes to the MSR. Update the callers accordingly and rename functions. [ bp: Rework a bit. ] Fixes: caa0ff24d5d0 ("x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value") Suggested-by: Borislav Petkov Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Cc: Link: https://lore.kernel.org/r/806d39b0bfec2fe8f50dc5446dff20f5bb24a959.1669821572.git.pawan.kumar.gupta@linux.intel.com Signed-off-by: Linus Torvalds commit 8c9a59939deb4bfafdc451100c03d1e848b4169b Author: Zhang Xiaoxu Date: Fri Dec 2 15:37:46 2022 -0800 Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() There is a kmemleak when test the raydium_i2c_ts with bpf mock device: unreferenced object 0xffff88812d3675a0 (size 8): comm "python3", pid 349, jiffies 4294741067 (age 95.695s) hex dump (first 8 bytes): 11 0e 10 c0 01 00 04 00 ........ backtrace: [<0000000068427125>] __kmalloc+0x46/0x1b0 [<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts] [<000000006e631aee>] raydium_i2c_initialize.cold+0xbc/0x3e4 [raydium_i2c_ts] [<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts] [<00000000a310de16>] i2c_device_probe+0x651/0x680 [<00000000f5a96bf3>] really_probe+0x17c/0x3f0 [<00000000096ba499>] __driver_probe_device+0xe3/0x170 [<00000000c5acb4d9>] driver_probe_device+0x49/0x120 [<00000000264fe082>] __device_attach_driver+0xf7/0x150 [<00000000f919423c>] bus_for_each_drv+0x114/0x180 [<00000000e067feca>] __device_attach+0x1e5/0x2d0 [<0000000054301fc2>] bus_probe_device+0x126/0x140 [<00000000aad93b22>] device_add+0x810/0x1130 [<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0 [<000000003c2c248c>] of_i2c_register_device+0xf1/0x110 [<00000000ffec4177>] of_i2c_notify+0x100/0x160 unreferenced object 0xffff88812d3675c8 (size 8): comm "python3", pid 349, jiffies 4294741070 (age 95.692s) hex dump (first 8 bytes): 22 00 36 2d 81 88 ff ff ".6-.... backtrace: [<0000000068427125>] __kmalloc+0x46/0x1b0 [<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts] [<000000001d5c9620>] raydium_i2c_initialize.cold+0x223/0x3e4 [raydium_i2c_ts] [<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts] [<00000000a310de16>] i2c_device_probe+0x651/0x680 [<00000000f5a96bf3>] really_probe+0x17c/0x3f0 [<00000000096ba499>] __driver_probe_device+0xe3/0x170 [<00000000c5acb4d9>] driver_probe_device+0x49/0x120 [<00000000264fe082>] __device_attach_driver+0xf7/0x150 [<00000000f919423c>] bus_for_each_drv+0x114/0x180 [<00000000e067feca>] __device_attach+0x1e5/0x2d0 [<0000000054301fc2>] bus_probe_device+0x126/0x140 [<00000000aad93b22>] device_add+0x810/0x1130 [<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0 [<000000003c2c248c>] of_i2c_register_device+0xf1/0x110 [<00000000ffec4177>] of_i2c_notify+0x100/0x160 After BANK_SWITCH command from i2c BUS, no matter success or error happened, the tx_buf should be freed. Fixes: 3b384bd6c3f2 ("Input: raydium_ts_i2c - do not split tx transactions") Signed-off-by: Zhang Xiaoxu Link: https://lore.kernel.org/r/20221202103412.2120169-1-zhangxiaoxu5@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit a1e9185d20b56af04022d2e656802254f4ea47eb Merge: c290db013742e b47068b4aa53a Author: Linus Torvalds Date: Fri Dec 2 15:40:35 2022 -0800 Merge tag 'sound-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Likely the last piece for 6.1; the only significant fixes are ASoC core ops fixes, while others are device-specific (rather minor) fixes in ASoC and FireWire drivers. All appear safe enough to take as a late stage material" * tag 'sound-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: dice: fix regression for Lexicon I-ONIX FW810S ASoC: cs42l51: Correct PGA Volume minimum value ASoC: ops: Correct bounds check for second channel on SX controls ASoC: tlv320adc3xxx: Fix build error for implicit function declaration ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx() ASoC: ops: Fix bounds check for _sx controls ASoC: fsl_micfil: explicitly clear CHnF flags ASoC: fsl_micfil: explicitly clear software reset bit commit c290db013742e98fe5b64073bc2dd8c8a2ac9e4c Merge: bdaa78c6aa861 c082fbd687ad7 Author: Linus Torvalds Date: Fri Dec 2 15:35:21 2022 -0800 Merge tag 'drm-fixes-2022-12-02' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Things do seem to have finally settled down, just four i915 and one amdgpu this week. Probably won't have much for next week if you do push rc8 out. i915: - Fix dram info readout - Remove non-existent pipes from bigjoiner pipe mask - Fix negative value passed as remaining time - Never return 0 if not all requests retired amdgpu: - VCN fix for vangogh" * tag 'drm-fixes-2022-12-02' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: enable Vangogh VCN indirect sram mode drm/i915: Never return 0 if not all requests retired drm/i915: Fix negative value passed as remaining time drm/i915: Remove non-existent pipes from bigjoiner pipe mask drm/i915/mtl: Fix dram info readout commit bdaa78c6aa861f0e8c612a0b2272423d92f0071c Merge: 6647e76ab623b 1d351f1894342 Author: Linus Torvalds Date: Fri Dec 2 13:39:38 2022 -0800 Merge tag 'mm-hotfixes-stable-2022-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc hotfixes from Andrew Morton: "15 hotfixes, 11 marked cc:stable. Only three or four of the latter address post-6.0 issues, which is hopefully a sign that things are converging" * tag 'mm-hotfixes-stable-2022-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: revert "kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible" Kconfig.debug: provide a little extra FRAME_WARN leeway when KASAN is enabled drm/amdgpu: temporarily disable broken Clang builds due to blown stack-frame mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths mm/khugepaged: fix GUP-fast interaction by sending IPI mm/khugepaged: take the right locks for page table retraction mm: migrate: fix THP's mapcount on isolation mm: introduce arch_has_hw_nonleaf_pmd_young() mm: add dummy pmd_young() for architectures not having it mm/damon/sysfs: fix wrong empty schemes assumption under online tuning in damon_sysfs_set_schemes() tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry() hugetlb: don't delete vma_lock in hugetlb MADV_DONTNEED processing madvise: use zap_page_range_single for madvise dontneed mm: replace VM_WARN_ON to pr_warn if the node is offline with __GFP_THISNODE commit 6647e76ab623b2b3fb2efe03a86e9c9046c52c33 Author: Linus Torvalds Date: Wed Nov 30 16:10:52 2022 -0800 v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails The V4L2_MEMORY_USERPTR interface is long deprecated and shouldn't be used (and is discouraged for any modern v4l drivers). And Seth Jenkins points out that the fallback to VM_PFNMAP/VM_IO is fundamentally racy and dangerous. Note that it's not even a case that should trigger, since any normal user pointer logic ends up just using the pin_user_pages_fast() call that does the proper page reference counting. That's not the problem case, only if you try to use special device mappings do you have any issues. Normally I'd just remove this during the merge window, but since Seth pointed out the problem cases, we really want to know as soon as possible if there are actually any users of this odd special case of a legacy interface. Neither Hans nor Mauro seem to think that such mis-uses of the old legacy interface should exist. As Mauro says: "See, V4L2 has actually 4 streaming APIs: - Kernel-allocated mmap (usually referred simply as just mmap); - USERPTR mmap; - read(); - dmabuf; The USERPTR is one of the oldest way to use it, coming from V4L version 1 times, and by far the least used one" And Hans chimed in on the USERPTR interface: "To be honest, I wouldn't mind if it goes away completely, but that's a bit of a pipe dream right now" but while removing this legacy interface entirely may be a pipe dream we can at least try to remove the unlikely (and actively broken) case of using special device mappings for USERPTR accesses. This replaces it with a WARN_ONCE() that we can remove once we've hopefully confirmed that no actual users exist. NOTE! Longer term, this means that a 'struct frame_vector' only ever contains proper page pointers, and all the games we have with converting them to pages can go away (grep for 'frame_vector_to_pages()' and the uses of 'vec->is_pfns'). But this is just the first step, to verify that this code really is all dead, and do so as quickly as possible. Reported-by: Seth Jenkins Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab Cc: David Hildenbrand Cc: Jan Kara Signed-off-by: Linus Torvalds commit b5ca338751ad4783ec8d37b5d99c3e37b7813e59 Author: Luiz Augusto von Dentz Date: Tue Nov 29 12:54:13 2022 -0800 Bluetooth: Fix crash when replugging CSR fake controllers It seems fake CSR 5.0 clones can cause the suspend notifier to be registered twice causing the following kernel panic: [ 71.986122] Call Trace: [ 71.986124] [ 71.986125] blocking_notifier_chain_register+0x33/0x60 [ 71.986130] hci_register_dev+0x316/0x3d0 [bluetooth 99b5497ea3d09708fa1366c1dc03288bf3cca8da] [ 71.986154] btusb_probe+0x979/0xd85 [btusb e1e0605a4f4c01984a4b9c8ac58c3666ae287477] [ 71.986159] ? __pm_runtime_set_status+0x1a9/0x300 [ 71.986162] ? ktime_get_mono_fast_ns+0x3e/0x90 [ 71.986167] usb_probe_interface+0xe3/0x2b0 [ 71.986171] really_probe+0xdb/0x380 [ 71.986174] ? pm_runtime_barrier+0x54/0x90 [ 71.986177] __driver_probe_device+0x78/0x170 [ 71.986180] driver_probe_device+0x1f/0x90 [ 71.986183] __device_attach_driver+0x89/0x110 [ 71.986186] ? driver_allows_async_probing+0x70/0x70 [ 71.986189] bus_for_each_drv+0x8c/0xe0 [ 71.986192] __device_attach+0xb2/0x1e0 [ 71.986195] bus_probe_device+0x92/0xb0 [ 71.986198] device_add+0x422/0x9a0 [ 71.986201] ? sysfs_merge_group+0xd4/0x110 [ 71.986205] usb_set_configuration+0x57a/0x820 [ 71.986208] usb_generic_driver_probe+0x4f/0x70 [ 71.986211] usb_probe_device+0x3a/0x110 [ 71.986213] really_probe+0xdb/0x380 [ 71.986216] ? pm_runtime_barrier+0x54/0x90 [ 71.986219] __driver_probe_device+0x78/0x170 [ 71.986221] driver_probe_device+0x1f/0x90 [ 71.986224] __device_attach_driver+0x89/0x110 [ 71.986227] ? driver_allows_async_probing+0x70/0x70 [ 71.986230] bus_for_each_drv+0x8c/0xe0 [ 71.986232] __device_attach+0xb2/0x1e0 [ 71.986235] bus_probe_device+0x92/0xb0 [ 71.986237] device_add+0x422/0x9a0 [ 71.986239] ? _dev_info+0x7d/0x98 [ 71.986242] ? blake2s_update+0x4c/0xc0 [ 71.986246] usb_new_device.cold+0x148/0x36d [ 71.986250] hub_event+0xa8a/0x1910 [ 71.986255] process_one_work+0x1c4/0x380 [ 71.986259] worker_thread+0x51/0x390 [ 71.986262] ? rescuer_thread+0x3b0/0x3b0 [ 71.986264] kthread+0xdb/0x110 [ 71.986266] ? kthread_complete_and_exit+0x20/0x20 [ 71.986268] ret_from_fork+0x1f/0x30 [ 71.986273] [ 71.986274] ---[ end trace 0000000000000000 ]--- [ 71.986284] btusb: probe of 2-1.6:1.0 failed with error -17 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216683 Cc: stable@vger.kernel.org Signed-off-by: Luiz Augusto von Dentz Tested-by: Leonardo Eugênio commit 2f3957c7eb4e07df944169a3e50a4d6790e1c744 Author: Chen Zhongjin Date: Tue Nov 29 17:25:56 2022 +0800 Bluetooth: Fix not cleanup led when bt_init fails bt_init() calls bt_leds_init() to register led, but if it fails later, bt_leds_cleanup() is not called to unregister it. This can cause panic if the argument "bluetooth-power" in text is freed and then another led_trigger_register() tries to access it: BUG: unable to handle page fault for address: ffffffffc06d3bc0 RIP: 0010:strcmp+0xc/0x30 Call Trace: led_trigger_register+0x10d/0x4f0 led_trigger_register_simple+0x7d/0x100 bt_init+0x39/0xf7 [bluetooth] do_one_initcall+0xd0/0x4e0 Fixes: e64c97b53bc6 ("Bluetooth: Add combined LED trigger for controller power") Signed-off-by: Chen Zhongjin Signed-off-by: Luiz Augusto von Dentz commit 828cea2b71de501827f62d3c92d149f6052ad01e Author: Chethan T N Date: Tue Nov 22 14:32:57 2022 +0530 Bluetooth: Fix support for Read Local Supported Codecs V2 Handling of Read Local Supported Codecs was broken during the HCI serialization design change patches. Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") Signed-off-by: Chethan T N Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz commit 93df7d56f15e217009323c0fbb5213ab7a14520b Author: Chethan T N Date: Tue Nov 22 14:32:56 2022 +0530 Bluetooth: Remove codec id field in vendor codec definition As per the specfication vendor codec id is defined. BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2127 Fixes: 9ae664028a9e ("Bluetooth: Add support for Read Local Supported Codecs V2") Signed-off-by: Chethan T N Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz commit bcd70260ef56e0aee8a4fc6cd214a419900b0765 Author: Sungwoo Kim Date: Fri Nov 18 15:01:47 2022 -0500 Bluetooth: L2CAP: Fix u8 overflow By keep sending L2CAP_CONF_REQ packets, chan->num_conf_rsp increases multiple times and eventually it will wrap around the maximum number (i.e., 255). This patch prevents this by adding a boundary check with L2CAP_MAX_CONF_RSP Btmon log: Bluetooth monitor ver 5.64 = Note: Linux version 6.1.0-rc2 (x86_64) 0.264594 = Note: Bluetooth subsystem version 2.22 0.264636 @ MGMT Open: btmon (privileged) version 1.22 {0x0001} 0.272191 = New Index: 00:00:00:00:00:00 (Primary,Virtual,hci0) [hci0] 13.877604 @ RAW Open: 9496 (privileged) version 2.22 {0x0002} 13.890741 = Open Index: 00:00:00:00:00:00 [hci0] 13.900426 (...) > ACL Data RX: Handle 200 flags 0x00 dlen 1033 #32 [hci0] 14.273106 invalid packet size (12 != 1033) 08 00 01 00 02 01 04 00 01 10 ff ff ............ > ACL Data RX: Handle 200 flags 0x00 dlen 1547 #33 [hci0] 14.273561 invalid packet size (14 != 1547) 0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@..... > ACL Data RX: Handle 200 flags 0x00 dlen 2061 #34 [hci0] 14.274390 invalid packet size (16 != 2061) 0c 00 01 00 04 01 08 00 40 00 00 00 00 00 00 04 ........@....... > ACL Data RX: Handle 200 flags 0x00 dlen 2061 #35 [hci0] 14.274932 invalid packet size (16 != 2061) 0c 00 01 00 04 01 08 00 40 00 00 00 07 00 03 00 ........@....... = bluetoothd: Bluetooth daemon 5.43 14.401828 > ACL Data RX: Handle 200 flags 0x00 dlen 1033 #36 [hci0] 14.275753 invalid packet size (12 != 1033) 08 00 01 00 04 01 04 00 40 00 00 00 ........@... Signed-off-by: Sungwoo Kim Signed-off-by: Luiz Augusto von Dentz commit 696bd3622138bfad0dda9ad7311886b8e6f5ea10 Author: Mateusz Jończyk Date: Wed Nov 16 21:28:56 2022 +0100 Bluetooth: silence a dmesg error message in hci_request.c On kernel 6.1-rcX, I have been getting the following dmesg error message on every boot, resume from suspend and rfkill unblock of the Bluetooth device: Bluetooth: hci0: HCI_REQ-0xfcf0 After some investigation, it turned out to be caused by commit dd50a864ffae ("Bluetooth: Delete unreferenced hci_request code") which modified hci_req_add() in net/bluetooth/hci_request.c to always print an error message when it is executed. In my case, the function was executed by msft_set_filter_enable() in net/bluetooth/msft.c, which provides support for Microsoft vendor opcodes. As explained by Brian Gix, "the error gets logged because it is using a deprecated (but still working) mechanism to issue HCI opcodes" [1]. So this is just a debugging tool to show that a deprecated function is executed. As such, it should not be included in the mainline kernel. See for example commit 771c035372a0 ("deprecate the '__deprecated' attribute warnings entirely and for good") Additionally, this error message is cryptic and the user is not able to do anything about it. [1] Link: https://lore.kernel.org/lkml/beb8dcdc3aee4c5c833aa382f35995f17e7961a1.camel@intel.com/ Fixes: dd50a864ffae ("Bluetooth: Delete unreferenced hci_request code") Signed-off-by: Mateusz Jończyk Cc: Brian Gix Cc: Luiz Augusto von Dentz Cc: Marcel Holtmann Cc: Johan Hedberg Signed-off-by: Luiz Augusto von Dentz commit 7e7df2c10c92cab7d1dde3b301e584e2e877fbda Author: Wang ShaoBo Date: Wed Nov 9 10:39:06 2022 +0800 Bluetooth: hci_conn: add missing hci_dev_put() in iso_listen_bis() hci_get_route() takes reference, we should use hci_dev_put() to release it when not need anymore. Fixes: f764a6c2c1e4 ("Bluetooth: ISO: Add broadcast support") Signed-off-by: Wang ShaoBo Signed-off-by: Luiz Augusto von Dentz commit 747da1308bdd5021409974f9180f0d8ece53d142 Author: Wang ShaoBo Date: Wed Nov 9 17:37:26 2022 +0800 Bluetooth: 6LoWPAN: add missing hci_dev_put() in get_l2cap_conn() hci_get_route() takes reference, we should use hci_dev_put() to release it when not need anymore. Fixes: 6b8d4a6a0314 ("Bluetooth: 6LoWPAN: Use connected oriented channel instead of fixed one") Signed-off-by: Wang ShaoBo Signed-off-by: Luiz Augusto von Dentz commit 955aebd445e2b49622f2184b7abb82b05c060549 Author: Ismael Ferreras Morezuelas Date: Sat Oct 29 22:24:53 2022 +0200 Bluetooth: btusb: Add debug message for CSR controllers The rationale of showing this is that it's potentially critical information to diagnose and find more CSR compatibility bugs in the future and it will save a lot of headaches. Given that clones come from a wide array of vendors (some are actually Barrot, some are something else) and these numbers are what let us find differences between actual and fake ones, it will be immensely helpful to scour the Internet looking for this pattern and building an actual database to find correlations and improve the checks. Cc: stable@vger.kernel.org Cc: Hans de Goede Signed-off-by: Ismael Ferreras Morezuelas Signed-off-by: Luiz Augusto von Dentz commit 42d7731e3e7409f9444ff44e30c025958f1b14f0 Author: Ismael Ferreras Morezuelas Date: Sat Oct 29 22:24:52 2022 +0200 Bluetooth: btusb: Fix CSR clones again by re-adding ERR_DATA_REPORTING quirk A patch series by a Qualcomm engineer essentially removed my quirk/workaround because they thought it was unnecessary. It wasn't, and it broke everything again: https://patchwork.kernel.org/project/netdevbpf/list/?series=661703&archive=both&state=* He argues that the quirk is not necessary because the code should check if the dongle says if it's supported or not. The problem is that for these Chinese CSR clones they say that it would work: = New Index: 00:00:00:00:00:00 (Primary,USB,hci0) = Open Index: 00:00:00:00:00:00 < HCI Command: Read Local Version Information (0x04|0x0001) plen 0 > HCI Event: Command Complete (0x0e) plen 12 > [hci0] 11.276039 Read Local Version Information (0x04|0x0001) ncmd 1 Status: Success (0x00) HCI version: Bluetooth 5.0 (0x09) - Revision 2064 (0x0810) LMP version: Bluetooth 5.0 (0x09) - Subversion 8978 (0x2312) Manufacturer: Cambridge Silicon Radio (10) ... < HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 68 > [hci0] 11.668030 Read Local Supported Commands (0x04|0x0002) ncmd 1 Status: Success (0x00) Commands: 163 entries ... Read Default Erroneous Data Reporting (Octet 18 - Bit 2) Write Default Erroneous Data Reporting (Octet 18 - Bit 3) ... ... < HCI Command: Read Default Erroneous Data Reporting (0x03|0x005a) plen 0 = Close Index: 00:1A:7D:DA:71:XX So bring it back wholesale. Fixes: 63b1a7dd38bf ("Bluetooth: hci_sync: Remove HCI_QUIRK_BROKEN_ERR_DATA_REPORTING") Fixes: e168f6900877 ("Bluetooth: btusb: Remove HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for fake CSR") Fixes: 766ae2422b43 ("Bluetooth: hci_sync: Check LMP feature bit instead of quirk") Cc: stable@vger.kernel.org Cc: Zijun Hu Cc: Luiz Augusto von Dentz Cc: Hans de Goede Tested-by: Ismael Ferreras Morezuelas Signed-off-by: Ismael Ferreras Morezuelas Reviewed-by: Hans de Goede Signed-off-by: Luiz Augusto von Dentz commit 34e30ebbe48cc43c14276f863f0d2995c8f13186 Author: David Matlack Date: Thu Dec 1 11:52:49 2022 -0800 KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns Clarify the existing documentation about how KVM_CAP_HALT_POLL and halt_poll_ns interact to make it clear that VMs using KVM_CAP_HALT_POLL ignore halt_poll_ns. Signed-off-by: David Matlack Message-Id: <20221201195249.3369720-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit b8b43a4c2e9f66481cc667007aac6d0372e9c4cb Author: David Matlack Date: Thu Dec 1 11:52:48 2022 -0800 KVM: Move halt-polling documentation into common directory Move halt-polling.rst into the common KVM documentation directory and out of the x86-specific directory. Halt-polling is a common feature and the existing documentation is already written as such. Signed-off-by: David Matlack Message-Id: <20221201195249.3369720-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit d0f411c0b9bdef85f647e15a2fcc790b29891f2c Merge: 7d4a93176e014 899d2a05dc147 Author: Jens Axboe Date: Fri Dec 2 08:01:06 2022 -0700 Merge tag 'nvme-6.1-2022-01-02' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - fix SRCU protection of nvme_ns_head list (Caleb Sander) - clear the prp2 field when not used (Lei Rao)" * tag 'nvme-6.1-2022-01-02' of git://git.infradead.org/nvme: nvme: fix SRCU protection of nvme_ns_head list nvme-pci: clear the prp2 field when not used commit 4bedbbd782ebbe7287231fea862c158d4f08a9e3 Author: Xiongfeng Wang Date: Thu Dec 1 12:01:27 2022 +0800 iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() for_each_pci_dev() is implemented by pci_get_device(). The comment of pci_get_device() says that it will increase the reference count for the returned pci_dev and also decrease the reference count for the input pci_dev @from if it is not NULL. If we break for_each_pci_dev() loop with pdev not NULL, we need to call pci_dev_put() to decrease the reference count. Add the missing pci_dev_put() for the error path to avoid reference count leak. Fixes: 2e4552893038 ("iommu/vt-d: Unify the way to process DMAR device scope array") Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/20221121113649.190393-3-wangxiongfeng2@huawei.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit afca9e19cc720bfafc75dc5ce429c185ca93f31d Author: Xiongfeng Wang Date: Thu Dec 1 12:01:26 2022 +0800 iommu/vt-d: Fix PCI device refcount leak in has_external_pci() for_each_pci_dev() is implemented by pci_get_device(). The comment of pci_get_device() says that it will increase the reference count for the returned pci_dev and also decrease the reference count for the input pci_dev @from if it is not NULL. If we break for_each_pci_dev() loop with pdev not NULL, we need to call pci_dev_put() to decrease the reference count. Add the missing pci_dev_put() before 'return true' to avoid reference count leak. Fixes: 89a6079df791 ("iommu/vt-d: Force IOMMU on for platform opt in hint") Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/20221121113649.190393-2-wangxiongfeng2@huawei.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 6927d352380797ddbee18631491ec428741696e2 Author: Yang Yingliang Date: Thu Dec 1 12:01:25 2022 +0800 iommu/vt-d: Fix PCI device refcount leak in prq_event_thread() As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrease the reference count by calling pci_dev_put(). So call pci_dev_put() after using the 'pdev' to avoid refcount leak. Besides, if the 'pdev' is null or intel_svm_prq_report() returns error, there is no need to trace this fault. Fixes: 06f4b8d09dba ("iommu/vt-d: Remove unnecessary SVA data accesses in page fault path") Suggested-by: Lu Baolu Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221119144028.2452731-1-yangyingliang@huawei.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e65a6897be5e4939d477c4969a05e12d90b08409 Author: Jacob Pan Date: Thu Dec 1 12:01:24 2022 +0800 iommu/vt-d: Add a fix for devices need extra dtlb flush QAT devices on Intel Sapphire Rapids and Emerald Rapids have a defect in address translation service (ATS). These devices may inadvertently issue ATS invalidation completion before posted writes initiated with translated address that utilized translations matching the invalidation address range, violating the invalidation completion ordering. This patch adds an extra device TLB invalidation for the affected devices, it is needed to ensure no more posted writes with translated address following the invalidation completion. Therefore, the ordering is preserved and data-corruption is prevented. Device TLBs are invalidated under the following six conditions: 1. Device driver does DMA API unmap IOVA 2. Device driver unbind a PASID from a process, sva_unbind_device() 3. PASID is torn down, after PASID cache is flushed. e.g. process exit_mmap() due to crash 4. Under SVA usage, called by mmu_notifier.invalidate_range() where VM has to free pages that were unmapped 5. userspace driver unmaps a DMA buffer 6. Cache invalidation in vSVA usage (upcoming) For #1 and #2, device drivers are responsible for stopping DMA traffic before unmap/unbind. For #3, iommu driver gets mmu_notifier to invalidate TLB the same way as normal user unmap which will do an extra invalidation. The dTLB invalidation after PASID cache flush does not need an extra invalidation. Therefore, we only need to deal with #4 and #5 in this patch. #1 is also covered by this patch due to common code path with #5. Tested-by: Yuzhang Luo Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Jacob Pan Link: https://lore.kernel.org/r/20221130062449.1360063-1-jacob.jun.pan@linux.intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e931a173a685fe213127ae5aa6b7f2196c1d875d Merge: 4eb0c28551fda 409e8ec8c5825 Author: David S. Miller Date: Fri Dec 2 10:30:07 2022 +0000 Merge branch 'vmxnet3-fixes' Ronak Doshi says: ==================== vmxnet3: couple of fixes This series fixes following issues: Patch 1: This patch provides a fix to correctly report encapsulated LRO'ed packet. Patch 2: This patch provides a fix to use correct intrConf reference. Changes in v2: - declare generic descriptor to be used - remove white spaces - remove single quote around commit reference in patch 2 - remove if check for encap_lro ==================== Signed-off-by: David S. Miller commit 409e8ec8c5825591895937b8499b54aa2476fae7 Author: Ronak Doshi Date: Wed Nov 30 00:21:47 2022 -0800 vmxnet3: use correct intrConf reference when using extended queues Commit 39f9895a00f4 ("vmxnet3: add support for 32 Tx/Rx queues") added support for 32Tx/Rx queues. As a part of this patch, intrConf structure was extended to incorporate increased queues. This patch fixes the issue where incorrect reference is being used. Fixes: 39f9895a00f4 ("vmxnet3: add support for 32 Tx/Rx queues") Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 40b8c2a1af03ba3e8da55a4490d646bfa845e71a Author: Ronak Doshi Date: Wed Nov 30 00:21:46 2022 -0800 vmxnet3: correctly report encapsulated LRO packet Commit dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support") added support for encapsulation offload. However, the pathc did not report correctly the encapsulated packet which is LRO'ed by the hypervisor. This patch fixes this issue by using correct callback for the LRO'ed encapsulated packet. Fixes: dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support") Signed-off-by: Ronak Doshi Acked-by: Guolin Yang Signed-off-by: David S. Miller commit 4eb0c28551fdafdb1af71d88a111c6f3b609d501 Merge: c25b7a7a565e5 28e96556baca7 Author: Jakub Kicinski Date: Thu Dec 1 20:12:41 2022 -0800 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-11-30 (e1000e, igb) This series contains updates to e1000e and igb drivers. Akihiko Odaki fixes calculation for checking whether space for next frame exists for e1000e and properly sets MSI-X vector to fix failing ethtool interrupt test for igb. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igb: Allocate MSI-X vector when testing e1000e: Fix TX dispatch condition ==================== Link: https://lore.kernel.org/r/20221130194228.3257787-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c082fbd687ad70a92e0a8be486a7555a66f03079 Merge: 65a388250e391 9a8cc8cabc1e3 Author: Dave Airlie Date: Fri Dec 2 09:12:46 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-12-01' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-12-01: amdgpu: - VCN fix for vangogh Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221201202015.5931-1-alexander.deucher@amd.com commit d36678f7905cbd1dc55a8a96e066dafd749d4600 Author: Andrew Lunn Date: Thu Nov 10 00:59:02 2022 +0100 i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set Recent changes to the DMA code has resulting in the IMX driver failing I2C transfers when the buffer has been vmalloc. Only perform DMA transfers if the message has the I2C_M_DMA_SAFE flag set, indicating the client is providing a buffer which is DMA safe. This is a minimal fix for stable. The I2C core provides helpers to allocate a bounce buffer. For a fuller fix the master should make use of these helpers. Fixes: 4544b9f25e70 ("dma-mapping: Add vmap checks to dma_map_single()") Signed-off-by: Andrew Lunn Acked-by: Oleksij Rempel Signed-off-by: Wolfram Sang commit 7d8ccf4f117d082156e842d959f634efcf203cef Author: Wang Yufen Date: Mon Nov 21 18:17:52 2022 +0800 i2c: qcom-geni: fix error return code in geni_i2c_gpi_xfer Fix to return a negative error code from the gi2c->err instead of 0. Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") Signed-off-by: Wang Yufen Reviewed-by: Tommaso Merciai Signed-off-by: Wolfram Sang commit 8bfd4ec726945cec35ee5cafebc1c55b83d5a9fb Author: Carsten Haitzler Date: Mon Nov 28 10:51:58 2022 +0000 i2c: cadence: Fix regression with bus recovery Commit "i2c: cadence: Add standard bus recovery support" breaks for i2c devices that have no pinctrl defined. There is no requirement for this to exist in the DT. This has worked perfectly well without this before in at least 1 real usage case on hardware (Mali Komeda DPU, Cadence i2c to talk to a tda99xx phy). Adding the requirement to have pinctrl set up in the device tree (or otherwise be found) is a regression where the whole i2c device is lost entirely (in this case dropping entire devices which then leads to the drm display stack unable to find the phy for display output, thus having no drm display device and so on down the chain). This converts the above commit to an enhancement if pinctrl can be found for the i2c device, providing a timeout on read with recovery, but if not, do what used to be done rather than a fatal loss of a device. This restores the mentioned display devices to their working state again. Fixes: 58b924241d0a ("i2c: cadence: Add standard bus recovery support") Signed-off-by: Carsten Haitzler Reviewed-by: Shubhrajyoti Datta Reviewed-by: Michael Grzeschik Acked-by: Michal Simek [wsa: added braces to else-branch] Signed-off-by: Wolfram Sang commit 65a388250e391b7127efd6751f64f3e4955e43a0 Merge: b7b275e60bcd5 12b8b046e4c9d Author: Dave Airlie Date: Fri Dec 2 07:34:27 2022 +1000 Merge tag 'drm-intel-fixes-2022-12-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix dram info readout (Radhakrishna Sripada) - Remove non-existent pipes from bigjoiner pipe mask (Ville Syrjälä) - Fix negative value passed as remaining time (Janusz Krzysztofik) - Never return 0 if not all requests retired (Janusz Krzysztofik) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y4hp+a3TJ13t2ZA1@tursulin-desk commit a4412fdd49dc011bcc2c0d81ac4cab7457092650 Author: Steven Rostedt (Google) Date: Mon Nov 21 10:44:03 2022 -0500 error-injection: Add prompt for function error injection The config to be able to inject error codes into any function annotated with ALLOW_ERROR_INJECTION() is enabled when FUNCTION_ERROR_INJECTION is enabled. But unfortunately, this is always enabled on x86 when KPROBES is enabled, and there's no way to turn it off. As kprobes is useful for observability of the kernel, it is useful to have it enabled in production environments. But error injection should be avoided. Add a prompt to the config to allow it to be disabled even when kprobes is enabled, and get rid of the "def_bool y". This is a kernel debug feature (it's in Kconfig.debug), and should have never been something enabled by default. Cc: stable@vger.kernel.org Fixes: 540adea3809f6 ("error-injection: Separate error-injection from kprobe") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Linus Torvalds commit 9a8cc8cabc1e351614fd7f9e774757a5143b6fe8 Author: Leo Liu Date: Tue Nov 29 18:53:18 2022 -0500 drm/amdgpu: enable Vangogh VCN indirect sram mode So that uses PSP to initialize HW. Fixes: 0c2c02b66c672e ("drm/amdgpu/vcn: add firmware support for dimgrey_cavefish") Signed-off-by: Leo Liu Reviewed-by: James Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 39cefc5f6cd25d555e0455b24810e9aff365b8d6 Merge: d556a9aeb62a6 7e1864332fbc1 Author: Palmer Dabbelt Date: Thu Dec 1 11:38:39 2022 -0800 RISC-V: Fix a race condition during kernel stack overflow This fixes a concrete bug but is also the basis for some cleanup work, so I'm merging it based on the offending commit in order to minimize future conflicts. * commit '7e1864332fbc1b993659eab7974da9fe8bf8c128': riscv: fix race when vmap stack overflow commit 355479c70a489415ef6e2624e514f8f15a40861b Merge: e214dd935bf15 7572ac3c979d4 Author: Linus Torvalds Date: Thu Dec 1 11:25:11 2022 -0800 Merge tag 'efi-fixes-for-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fix from Ard Biesheuvel: "A single revert for some code that I added during this cycle. The code is not wrong, but it should be a bit more careful about how to handle the shadow call stack pointer, so it is better to revert it for now and bring it back later in improved form. Summary: - Revert runtime service sync exception recovery on arm64" * tag 'efi-fixes-for-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: arm64: efi: Revert "Recover from synchronous exceptions ..." commit e214dd935bf154af4c2d5013b16a283d592ccea5 Merge: 063c0e773ab33 9bdc112be727c Author: Linus Torvalds Date: Thu Dec 1 11:10:25 2022 -0800 Merge tag 'hwmon-for-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix refcount leak and NULL pointer access in coretemp driver - Fix UAF in ibmpex driver - Add missing pci_disable_device() to i5500_temp driver - Fix calculation in ina3221 driver - Fix temperature scaling in ltc2947 driver - Check result of devm_kcalloc call in asus-ec-sensors driver * tag 'hwmon-for-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (asus-ec-sensors) Add checks for devm_kcalloc hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new() hwmon: (coretemp) Check for null before removing sysfs attrs hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails hwmon: (i5500_temp) fix missing pci_disable_device() hwmon: (ina3221) Fix shunt sum critical calculation hwmon: (ltc2947) fix temperature scaling commit 9bdc112be727cf1ba65be79541147f960c3349d8 Author: Yuan Can Date: Fri Nov 25 01:43:29 2022 +0000 hwmon: (asus-ec-sensors) Add checks for devm_kcalloc As the devm_kcalloc may return NULL, the return value needs to be checked to avoid NULL poineter dereference. Fixes: d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC") Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20221125014329.121560-1-yuancan@huawei.com Signed-off-by: Guenter Roeck commit 7dec14537c5906b8bf40fd6fd6d9c3850f8df11d Author: Yang Yingliang Date: Fri Nov 18 17:33:03 2022 +0800 hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new() As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrement the reference count by calling pci_dev_put(). So call it after using to avoid refcount leak. Fixes: 14513ee696a0 ("hwmon: (coretemp) Use PCI host bridge ID to identify CPU if necessary") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221118093303.214163-1-yangyingliang@huawei.com Signed-off-by: Guenter Roeck commit a89ff5f5cc64b9fe7a992cf56988fd36f56ca82a Author: Phil Auld Date: Thu Nov 17 11:23:13 2022 -0500 hwmon: (coretemp) Check for null before removing sysfs attrs If coretemp_add_core() gets an error then pdata->core_data[indx] is already NULL and has been kfreed. Don't pass that to sysfs_remove_group() as that will crash in sysfs_remove_group(). [Shortened for readability] [91854.020159] sysfs: cannot create duplicate filename '/devices/platform/coretemp.0/hwmon/hwmon2/temp20_label' [91855.126115] BUG: kernel NULL pointer dereference, address: 0000000000000188 [91855.165103] #PF: supervisor read access in kernel mode [91855.194506] #PF: error_code(0x0000) - not-present page [91855.224445] PGD 0 P4D 0 [91855.238508] Oops: 0000 [#1] PREEMPT SMP PTI ... [91855.342716] RIP: 0010:sysfs_remove_group+0xc/0x80 ... [91855.796571] Call Trace: [91855.810524] coretemp_cpu_offline+0x12b/0x1dd [coretemp] [91855.841738] ? coretemp_cpu_online+0x180/0x180 [coretemp] [91855.871107] cpuhp_invoke_callback+0x105/0x4b0 [91855.893432] cpuhp_thread_fun+0x8e/0x150 ... Fix this by checking for NULL first. Signed-off-by: Phil Auld Cc: linux-hwmon@vger.kernel.org Cc: Fenghua Yu Cc: Jean Delvare Cc: Guenter Roeck Link: https://lore.kernel.org/r/20221117162313.3164803-1-pauld@redhat.com Fixes: 199e0de7f5df3 ("hwmon: (coretemp) Merge pkgtemp with coretemp") Signed-off-by: Guenter Roeck commit 7572ac3c979d4d0fb42d73a72d2608656516ff4f Author: Ard Biesheuvel Date: Wed Nov 30 17:37:17 2022 +0100 arm64: efi: Revert "Recover from synchronous exceptions ..." This reverts commit 23715a26c8d81291, which introduced some code in assembler that manipulates both the ordinary and the shadow call stack pointer in a way that could potentially be taken advantage of. So let's revert it, and do a better job the next time around. Signed-off-by: Ard Biesheuvel commit c25b7a7a565e5eeb2459b37583eea67942057511 Author: Florian Westphal Date: Tue Nov 29 15:06:44 2022 +0100 inet: ping: use hlist_nulls rcu iterator during lookup ping_lookup() does not acquire the table spinlock, so iteration should use hlist_nulls_for_each_entry_rcu(). Spotted during code review. Fixes: dbca1596bbb0 ("ping: convert to RCU lookups, get rid of rwlock") Cc: Eric Dumazet Signed-off-by: Florian Westphal Link: https://lore.kernel.org/r/20221129140644.28525-1-fw@strlen.de Signed-off-by: Paolo Abeni commit d9f15a9de44affe733e34f93bc184945ba277e6d Author: Conor Dooley Date: Tue Nov 22 12:16:21 2022 +0000 Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend" This reverts commit 232ccac1bd9b5bfe73895f527c08623e7fa0752d. On the subject of suspend, the RISC-V SBI spec states: This does not cover whether any given events actually reach the hart or not, just what the hart will do if it receives an event. On PolarFire SoC, and potentially other SiFive based implementations, events from the RISC-V timer do reach a hart during suspend. This is not the case for the implementation on the Allwinner D1 - there timer events are not received during suspend. To fix this, the CLOCK_EVT_FEAT_C3STOP (mis)feature was enabled for the timer driver - but this has broken both RCU stall detection and timers generally on PolarFire SoC and potentially other SiFive based implementations. If an AXI read to the PCIe controller on PolarFire SoC times out, the system will stall, however, with CLOCK_EVT_FEAT_C3STOP active, the system just locks up without RCU stalling: io scheduler mq-deadline registered io scheduler kyber registered microchip-pcie 2000000000.pcie: host bridge /soc/pcie@2000000000 ranges: microchip-pcie 2000000000.pcie: MEM 0x2008000000..0x2087ffffff -> 0x0008000000 microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: axi read request error microchip-pcie 2000000000.pcie: axi read timeout microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer Freeing initrd memory: 7332K Similarly issues were reported with clock_nanosleep() - with a test app that sleeps each cpu for 6, 5, 4, 3 ms respectively, HZ=250 & the blamed commit in place, the sleep times are rounded up to the next jiffy: == CPU: 1 == == CPU: 2 == == CPU: 3 == == CPU: 4 == Mean: 7.974992 Mean: 7.976534 Mean: 7.962591 Mean: 3.952179 Std Dev: 0.154374 Std Dev: 0.156082 Std Dev: 0.171018 Std Dev: 0.076193 Hi: 9.472000 Hi: 10.495000 Hi: 8.864000 Hi: 4.736000 Lo: 6.087000 Lo: 6.380000 Lo: 4.872000 Lo: 3.403000 Samples: 521 Samples: 521 Samples: 521 Samples: 521 Fortunately, the D1 has a second timer, which is "currently used in preference to the RISC-V/SBI timer driver" so a revert here does not hurt operation of D1 in its current form. Ultimately, a DeviceTree property (or node) will be added to encode the behaviour of the timers, but until then revert the addition of CLOCK_EVT_FEAT_C3STOP. Fixes: 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped during CPU suspend") Signed-off-by: Conor Dooley Signed-off-by: Thomas Gleixner Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Acked-by: Samuel Holland Link: https://lore.kernel.org/linux-riscv/YzYTNQRxLr7Q9JR0@spud/ Link: https://github.com/riscv-non-isa/riscv-sbi-doc/issues/98/ Link: https://lore.kernel.org/linux-riscv/bf6d3b1f-f703-4a25-833e-972a44a04114@sholland.org/ Link: https://lore.kernel.org/r/20221122121620.3522431-1-conor.dooley@microchip.com commit dd30dcfa7a74a06f8dcdab260d8d5adf32f17333 Author: Wenchao Chen Date: Wed Nov 30 20:13:28 2022 +0800 mmc: sdhci-sprd: Fix no reset data and command after voltage switch After switching the voltage, no reset data and command will cause CMD2 timeout. Fixes: 29ca763fc26f ("mmc: sdhci-sprd: Add pin control support for voltage switch") Signed-off-by: Wenchao Chen Acked-by: Adrian Hunter Reviewed-by: Baolin Wang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221130121328.25553-1-wenchao.chen@unisoc.com Signed-off-by: Ulf Hansson commit 9aff0ec5cba5b4ec4f199bbc6d0b7e1fedfa149e Merge: d68d7d204afdc ac011361bd4f6 Author: Paolo Abeni Date: Thu Dec 1 10:32:23 2022 +0100 Merge branch 'af_unix-fix-a-null-deref-in-sk_diag_dump_uid' Kuniyuki Iwashima says: ==================== af_unix: Fix a NULL deref in sk_diag_dump_uid(). The first patch fixes a NULL deref when we dump a AF_UNIX socket's UID, and the second patch adds a repro/test for such a case. ==================== Link: https://lore.kernel.org/r/20221127012412.37969-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit ac011361bd4f6206b36d2a242500239881bf8d2a Author: Kuniyuki Iwashima Date: Sun Nov 27 10:24:12 2022 +0900 af_unix: Add test for sock_diag and UDIAG_SHOW_UID. The test prog dumps a single AF_UNIX socket's UID with and without unshare(CLONE_NEWUSER) and checks if it matches the result of getuid(). Without the preceding patch, the test prog is killed by a NULL deref in sk_diag_dump_uid(). # ./diag_uid TAP version 13 1..2 # Starting 2 tests from 3 test cases. # RUN diag_uid.uid.1 ... BUG: kernel NULL pointer dereference, address: 0000000000000270 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 105212067 P4D 105212067 PUD 1051fe067 PMD 0 Oops: 0000 [#1] PREEMPT SMP NOPTI Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.amzn2022.0.1 04/01/2014 RIP: 0010:sk_diag_fill (./include/net/sock.h:920 net/unix/diag.c:119 net/unix/diag.c:170) ... # 1: Test terminated unexpectedly by signal 9 # FAIL diag_uid.uid.1 not ok 1 diag_uid.uid.1 # RUN diag_uid.uid_unshare.1 ... # 1: Test terminated by timeout # FAIL diag_uid.uid_unshare.1 not ok 2 diag_uid.uid_unshare.1 # FAILED: 0 / 2 tests passed. # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:0 error:0 With the patch, the test succeeds. # ./diag_uid TAP version 13 1..2 # Starting 2 tests from 3 test cases. # RUN diag_uid.uid.1 ... # OK diag_uid.uid.1 ok 1 diag_uid.uid.1 # RUN diag_uid.uid_unshare.1 ... # OK diag_uid.uid_unshare.1 ok 2 diag_uid.uid_unshare.1 # PASSED: 2 / 2 tests passed. # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit b3abe42e94900bdd045c472f9c9be620ba5ce553 Author: Kuniyuki Iwashima Date: Sun Nov 27 10:24:11 2022 +0900 af_unix: Get user_ns from in_skb in unix_diag_get_exact(). Wei Chen reported a NULL deref in sk_user_ns() [0][1], and Paolo diagnosed the root cause: in unix_diag_get_exact(), the newly allocated skb does not have sk. [2] We must get the user_ns from the NETLINK_CB(in_skb).sk and pass it to sk_diag_fill(). [0]: BUG: kernel NULL pointer dereference, address: 0000000000000270 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 12bbce067 P4D 12bbce067 PUD 12bc40067 PMD 0 Oops: 0000 [#1] PREEMPT SMP CPU: 0 PID: 27942 Comm: syz-executor.0 Not tainted 6.1.0-rc5-next-20221118 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-48-gd9c812dda519-prebuilt.qemu.org 04/01/2014 RIP: 0010:sk_user_ns include/net/sock.h:920 [inline] RIP: 0010:sk_diag_dump_uid net/unix/diag.c:119 [inline] RIP: 0010:sk_diag_fill+0x77d/0x890 net/unix/diag.c:170 Code: 89 ef e8 66 d4 2d fd c7 44 24 40 00 00 00 00 49 8d 7c 24 18 e8 54 d7 2d fd 49 8b 5c 24 18 48 8d bb 70 02 00 00 e8 43 d7 2d fd <48> 8b 9b 70 02 00 00 48 8d 7b 10 e8 33 d7 2d fd 48 8b 5b 10 48 8d RSP: 0018:ffffc90000d67968 EFLAGS: 00010246 RAX: ffff88812badaa48 RBX: 0000000000000000 RCX: ffffffff840d481d RDX: 0000000000000465 RSI: 0000000000000000 RDI: 0000000000000270 RBP: ffffc90000d679a8 R08: 0000000000000277 R09: 0000000000000000 R10: 0001ffffffffffff R11: 0001c90000d679a8 R12: ffff88812ac03800 R13: ffff88812c87c400 R14: ffff88812ae42210 R15: ffff888103026940 FS: 00007f08b4e6f700(0000) GS:ffff88813bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000270 CR3: 000000012c58b000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: unix_diag_get_exact net/unix/diag.c:285 [inline] unix_diag_handler_dump+0x3f9/0x500 net/unix/diag.c:317 __sock_diag_cmd net/core/sock_diag.c:235 [inline] sock_diag_rcv_msg+0x237/0x250 net/core/sock_diag.c:266 netlink_rcv_skb+0x13e/0x250 net/netlink/af_netlink.c:2564 sock_diag_rcv+0x24/0x40 net/core/sock_diag.c:277 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x5e9/0x6b0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x739/0x860 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x38f/0x500 net/socket.c:2476 ___sys_sendmsg net/socket.c:2530 [inline] __sys_sendmsg+0x197/0x230 net/socket.c:2559 __do_sys_sendmsg net/socket.c:2568 [inline] __se_sys_sendmsg net/socket.c:2566 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2566 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x4697f9 Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f08b4e6ec48 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000077bf80 RCX: 00000000004697f9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 00000000004d29e9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000077bf80 R13: 0000000000000000 R14: 000000000077bf80 R15: 00007ffdb36bc6c0 Modules linked in: CR2: 0000000000000270 [1]: https://lore.kernel.org/netdev/CAO4mrfdvyjFpokhNsiwZiP-wpdSD0AStcJwfKcKQdAALQ9_2Qw@mail.gmail.com/ [2]: https://lore.kernel.org/netdev/e04315e7c90d9a75613f3993c2baf2d344eef7eb.camel@redhat.com/ Fixes: cae9910e7344 ("net: Add UNIX_DIAG_UID to Netlink UNIX socket diagnostics.") Reported-by: syzbot Reported-by: Wei Chen Diagnosed-by: Paolo Abeni Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit d3d6b1bf85aefe0ebc0624574b3bb62f0693914c Author: Guillaume BRUN Date: Wed Nov 16 15:35:23 2022 +0100 drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 Cheap monitors sometimes advertise YUV modes they don't really have (HDMI specification mandates YUV support so even monitors without actual support will often wrongfully advertise it) which results in YUV matches and user forum complaints of a red tint to light colour display areas in common desktop environments. Moving the default RGB fall-back before YUV selection results in RGB mode matching in most cases, reducing complaints. Fixes: 6c3c719936da ("drm/bridge: synopsys: dw-hdmi: add bus format negociation") Signed-off-by: Guillaume BRUN Tested-by: Christian Hewitt Reviewed-by: Robert Foss Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20221116143523.2126-1-the.cheaterman@gmail.com commit d68d7d204afdc5e8e8f3e038e2ee048b5498ded3 Merge: 6c681f899e036 1feeae071507a Author: Jakub Kicinski Date: Wed Nov 30 22:01:28 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Check for interval validity in all concatenation fields in nft_set_pipapo, from Stefano Brivio. 2) Missing preemption disabled in conntrack and flowtable stat updates, from Xin Long. 3) Fix compilation warning when CONFIG_NF_CONNTRACK_MARK=n. Except for 3) which was a bug introduced in a recent fix in 6.1-rc - anything else, broken for several releases. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: ctnetlink: fix compilation warning after data race fixes in ct mark netfilter: conntrack: fix using __this_cpu_add in preemptible netfilter: flowtable_offload: fix using __this_cpu_add in preemptible netfilter: nft_set_pipapo: Actually validate intervals in fields after the first one ==================== Link: https://lore.kernel.org/r/20221130121934.1125-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 6c681f899e0360803b924ac8c96ee21965118649 Author: Siddharth Vadapalli Date: Tue Nov 29 10:36:39 2022 +0530 net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10 The am65-cpsw driver supports configuring all RGMII variants at interface speed of 10 Mbps. However, in the process of shifting to the PHYLINK framework, the support for all variants of RGMII except the PHY_INTERFACE_MODE_RGMII variant was accidentally removed. Fix this by using phy_interface_mode_is_rgmii() to check for all variants of RGMII mode. Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK") Reported-by: Schuyler Patton Signed-off-by: Siddharth Vadapalli Link: https://lore.kernel.org/r/20221129050639.111142-1-s-vadapalli@ti.com Signed-off-by: Jakub Kicinski commit 421f8663b3a775c32f724f793264097c60028f2e Author: YueHaibing Date: Fri Nov 25 19:50:03 2022 +0800 net: broadcom: Add PTP_1588_CLOCK_OPTIONAL dependency for BCMGENET under ARCH_BCM2835 commit 8d820bc9d12b ("net: broadcom: Fix BCMGENET Kconfig") fixes the build that contain 99addbe31f55 ("net: broadcom: Select BROADCOM_PHY for BCMGENET") and enable BCMGENET=y but PTP_1588_CLOCK_OPTIONAL=m, which otherwise leads to a link failure. However this may trigger a runtime failure. Fix the original issue by propagating the PTP_1588_CLOCK_OPTIONAL dependency of BROADCOM_PHY down to BCMGENET. Fixes: 8d820bc9d12b ("net: broadcom: Fix BCMGENET Kconfig") Fixes: 99addbe31f55 ("net: broadcom: Select BROADCOM_PHY for BCMGENET") Reported-by: Naresh Kamboju Suggested-by: Arnd Bergmann Signed-off-by: YueHaibing Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20221125115003.30308-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 063c0e773ab33103407a76051821777014b756fe Merge: ef4d3ea40565a f6abcc21d9439 Author: Linus Torvalds Date: Wed Nov 30 15:46:46 2022 -0800 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "A set of clk driver fixes that resolve issues for various SoCs. Most of these are incorrect clk data, like bad parent descriptions. When the clk tree is improperly described things don't work, like USB and UFS controllers, because clk frequencies are wonky. Here are the extra details: - Fix the parent of UFS reference clks on Qualcomm SC8280XP so that UFS works properly - Fix the clk ID for USB on AT91 RM9200 so the USB driver continues to probe - Stop using of_device_get_match_data() on the wrong device for a Samsung Exynos driver so it gets the proper clk data - Fix ExynosAutov9 binding - Fix the parent of the div4 clk on Exynos7885 - Stop calling runtime PM APIs from the Qualcomm GDSC driver directly as it leads to a lockdep splat and is just plain wrong because it violates runtime PM semantics by calling runtime PM APIs when the device has been runtime PM disabled" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: qcom: gcc-sc8280xp: add cxo as parent for three ufs ref clks ARM: at91: rm9200: fix usb device clock id clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()" dt-bindings: clock: exynosautov9: fix reference to CMU_FSYS1 clk: qcom: gdsc: Remove direct runtime PM calls clk: samsung: exynos7885: Correct "div4" clock parents commit 1d351f1894342c378b96bb9ed89f8debb1e24e9f Author: Andrew Morton Date: Mon Nov 28 13:21:40 2022 -0800 revert "kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible" It causes build failures with unusual CC/HOSTCC combinations. Quoting https://lkml.kernel.org/r/A222B1E6-69B8-4085-AD1B-27BDB72CA971@goldelico.com: HOSTCC scripts/mod/modpost.o - due to target missing In file included from include/linux/string.h:5, from scripts/mod/../../include/linux/license.h:5, from scripts/mod/modpost.c:24: include/linux/compiler.h:246:10: fatal error: asm/rwonce.h: No such file or directory 246 | #include | ^~~~~~~~~~~~~~ compilation terminated. ... The problem is that HOSTCC is not necessarily the same compiler or even architecture as CC and pulling in or files indirectly isn't a good idea then. My toolchain is providing HOSTCC = gcc (MacPorts) and CC = arm-linux-gnueabihf (built from gcc source) and all running on Darwin. If I change the include to I can then "HOSTCC scripts/mod/modpost.c" but then it fails for "CC kernel/module/main.c" not finding : CC kernel/module/main.o - due to target missing In file included from kernel/module/main.c:43:0: ./include/linux/license.h:5:20: fatal error: string.h: No such file or directory #include ^ compilation terminated. Reported-by: "H. Nikolaus Schaller" Cc: Sam James Signed-off-by: Andrew Morton commit 152fe65f300e1819d59b80477d3e0999b4d5d7d2 Author: Lee Jones Date: Fri Nov 25 12:07:50 2022 +0000 Kconfig.debug: provide a little extra FRAME_WARN leeway when KASAN is enabled When enabled, KASAN enlarges function's stack-frames. Pushing quite a few over the current threshold. This can mainly be seen on 32-bit architectures where the present limit (when !GCC) is a lowly 1024-Bytes. Link: https://lkml.kernel.org/r/20221125120750.3537134-3-lee@kernel.org Signed-off-by: Lee Jones Acked-by: Arnd Bergmann Cc: Alex Deucher Cc: "Christian König" Cc: Daniel Vetter Cc: David Airlie Cc: Harry Wentland Cc: Leo Li Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: "Pan, Xinhui" Cc: Rodrigo Siqueira Cc: Thomas Zimmermann Cc: Tom Rix Cc: Signed-off-by: Andrew Morton commit 6f6cb1714365a07dbc66851879538df9f6969288 Author: Lee Jones Date: Fri Nov 25 12:07:49 2022 +0000 drm/amdgpu: temporarily disable broken Clang builds due to blown stack-frame Patch series "Fix a bunch of allmodconfig errors", v2. Since b339ec9c229aa ("kbuild: Only default to -Werror if COMPILE_TEST") WERROR now defaults to COMPILE_TEST meaning that it's enabled for allmodconfig builds. This leads to some interesting build failures when using Clang, each resolved in this set. With this set applied, I am able to obtain a successful allmodconfig Arm build. This patch (of 2): calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64) architectures built with Clang (all released versions), whereby the stack frame gets blown up to well over 5k. This would cause an immediate kernel panic on most architectures. We'll revert this when the following bug report has been resolved: https://github.com/llvm/llvm-project/issues/41896. Link: https://lkml.kernel.org/r/20221125120750.3537134-1-lee@kernel.org Link: https://lkml.kernel.org/r/20221125120750.3537134-2-lee@kernel.org Signed-off-by: Lee Jones Suggested-by: Arnd Bergmann Acked-by: Arnd Bergmann Cc: Alex Deucher Cc: "Christian König" Cc: Daniel Vetter Cc: David Airlie Cc: Harry Wentland Cc: Lee Jones Cc: Leo Li Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: "Pan, Xinhui" Cc: Rodrigo Siqueira Cc: Thomas Zimmermann Cc: Tom Rix Cc: Signed-off-by: Andrew Morton commit f268f6cf875f3220afc77bdd0bf1bb136eb54db9 Author: Jann Horn Date: Fri Nov 25 22:37:14 2022 +0100 mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths Any codepath that zaps page table entries must invoke MMU notifiers to ensure that secondary MMUs (like KVM) don't keep accessing pages which aren't mapped anymore. Secondary MMUs don't hold their own references to pages that are mirrored over, so failing to notify them can lead to page use-after-free. I'm marking this as addressing an issue introduced in commit f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages"), but most of the security impact of this only came in commit 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP"), which actually omitted flushes for the removal of present PTEs, not just for the removal of empty page tables. Link: https://lkml.kernel.org/r/20221129154730.2274278-3-jannh@google.com Link: https://lkml.kernel.org/r/20221128180252.1684965-3-jannh@google.com Link: https://lkml.kernel.org/r/20221125213714.4115729-3-jannh@google.com Fixes: f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages") Signed-off-by: Jann Horn Acked-by: David Hildenbrand Reviewed-by: Yang Shi Cc: John Hubbard Cc: Peter Xu Cc: Signed-off-by: Andrew Morton commit 2ba99c5e08812494bc57f319fb562f527d9bacd8 Author: Jann Horn Date: Fri Nov 25 22:37:13 2022 +0100 mm/khugepaged: fix GUP-fast interaction by sending IPI Since commit 70cbc3cc78a99 ("mm: gup: fix the fast GUP race against THP collapse"), the lockless_pages_from_mm() fastpath rechecks the pmd_t to ensure that the page table was not removed by khugepaged in between. However, lockless_pages_from_mm() still requires that the page table is not concurrently freed. Fix it by sending IPIs (if the architecture uses semi-RCU-style page table freeing) before freeing/reusing page tables. Link: https://lkml.kernel.org/r/20221129154730.2274278-2-jannh@google.com Link: https://lkml.kernel.org/r/20221128180252.1684965-2-jannh@google.com Link: https://lkml.kernel.org/r/20221125213714.4115729-2-jannh@google.com Fixes: ba76149f47d8 ("thp: khugepaged") Signed-off-by: Jann Horn Reviewed-by: Yang Shi Acked-by: David Hildenbrand Cc: John Hubbard Cc: Peter Xu Cc: Signed-off-by: Andrew Morton commit 8d3c106e19e8d251da31ff4cc7462e4565d65084 Author: Jann Horn Date: Fri Nov 25 22:37:12 2022 +0100 mm/khugepaged: take the right locks for page table retraction pagetable walks on address ranges mapped by VMAs can be done under the mmap lock, the lock of an anon_vma attached to the VMA, or the lock of the VMA's address_space. Only one of these needs to be held, and it does not need to be held in exclusive mode. Under those circumstances, the rules for concurrent access to page table entries are: - Terminal page table entries (entries that don't point to another page table) can be arbitrarily changed under the page table lock, with the exception that they always need to be consistent for hardware page table walks and lockless_pages_from_mm(). This includes that they can be changed into non-terminal entries. - Non-terminal page table entries (which point to another page table) can not be modified; readers are allowed to READ_ONCE() an entry, verify that it is non-terminal, and then assume that its value will stay as-is. Retracting a page table involves modifying a non-terminal entry, so page-table-level locks are insufficient to protect against concurrent page table traversal; it requires taking all the higher-level locks under which it is possible to start a page walk in the relevant range in exclusive mode. The collapse_huge_page() path for anonymous THP already follows this rule, but the shmem/file THP path was getting it wrong, making it possible for concurrent rmap-based operations to cause corruption. Link: https://lkml.kernel.org/r/20221129154730.2274278-1-jannh@google.com Link: https://lkml.kernel.org/r/20221128180252.1684965-1-jannh@google.com Link: https://lkml.kernel.org/r/20221125213714.4115729-1-jannh@google.com Fixes: 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP") Signed-off-by: Jann Horn Reviewed-by: Yang Shi Acked-by: David Hildenbrand Cc: John Hubbard Cc: Peter Xu Cc: Signed-off-by: Andrew Morton commit 829ae0f81ce093d674ff2256f66a714753e9ce32 Author: Gavin Shan Date: Thu Nov 24 17:55:23 2022 +0800 mm: migrate: fix THP's mapcount on isolation The issue is reported when removing memory through virtio_mem device. The transparent huge page, experienced copy-on-write fault, is wrongly regarded as pinned. The transparent huge page is escaped from being isolated in isolate_migratepages_block(). The transparent huge page can't be migrated and the corresponding memory block can't be put into offline state. Fix it by replacing page_mapcount() with total_mapcount(). With this, the transparent huge page can be isolated and migrated, and the memory block can be put into offline state. Besides, The page's refcount is increased a bit earlier to avoid the page is released when the check is executed. Link: https://lkml.kernel.org/r/20221124095523.31061-1-gshan@redhat.com Fixes: 1da2f328fa64 ("mm,thp,compaction,cma: allow THP migration for CMA allocations") Signed-off-by: Gavin Shan Reported-by: Zhenyu Zhang Tested-by: Zhenyu Zhang Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Cc: Alistair Popple Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Matthew Wilcox Cc: William Kucharski Cc: Zi Yan Cc: [5.7+] Signed-off-by: Andrew Morton commit 4aaf269c768dbacd6268af73fda2ffccaa3f1d88 Author: Juergen Gross Date: Wed Nov 23 07:45:10 2022 +0100 mm: introduce arch_has_hw_nonleaf_pmd_young() When running as a Xen PV guests commit eed9a328aa1a ("mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG") can cause a protection violation in pmdp_test_and_clear_young(): BUG: unable to handle page fault for address: ffff8880083374d0 #PF: supervisor write access in kernel mode #PF: error_code(0x0003) - permissions violation PGD 3026067 P4D 3026067 PUD 3027067 PMD 7fee5067 PTE 8010000008337065 Oops: 0003 [#1] PREEMPT SMP NOPTI CPU: 7 PID: 158 Comm: kswapd0 Not tainted 6.1.0-rc5-20221118-doflr+ #1 RIP: e030:pmdp_test_and_clear_young+0x25/0x40 This happens because the Xen hypervisor can't emulate direct writes to page table entries other than PTEs. This can easily be fixed by introducing arch_has_hw_nonleaf_pmd_young() similar to arch_has_hw_pte_young() and test that instead of CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG. Link: https://lkml.kernel.org/r/20221123064510.16225-1-jgross@suse.com Fixes: eed9a328aa1a ("mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG") Signed-off-by: Juergen Gross Reported-by: Sander Eikelenboom Acked-by: Yu Zhao Tested-by: Sander Eikelenboom Acked-by: David Hildenbrand [core changes] Signed-off-by: Andrew Morton commit 6617da8fb565445e0be4a4885443006374943d09 Author: Juergen Gross Date: Wed Nov 30 14:49:41 2022 -0800 mm: add dummy pmd_young() for architectures not having it In order to avoid #ifdeffery add a dummy pmd_young() implementation as a fallback. This is required for the later patch "mm: introduce arch_has_hw_nonleaf_pmd_young()". Link: https://lkml.kernel.org/r/fd3ac3cd-7349-6bbd-890a-71a9454ca0b3@suse.com Signed-off-by: Juergen Gross Acked-by: Yu Zhao Cc: Borislav Petkov Cc: Dave Hansen Cc: Geert Uytterhoeven Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Sander Eikelenboom Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 95bc35f9bee5220dad4e8567654ab3288a181639 Author: SeongJae Park Date: Tue Nov 22 19:48:31 2022 +0000 mm/damon/sysfs: fix wrong empty schemes assumption under online tuning in damon_sysfs_set_schemes() Commit da87878010e5 ("mm/damon/sysfs: support online inputs update") made 'damon_sysfs_set_schemes()' to be called for running DAMON context, which could have schemes. In the case, DAMON sysfs interface is supposed to update, remove, or add schemes to reflect the sysfs files. However, the code is assuming the DAMON context wouldn't have schemes at all, and therefore creates and adds new schemes. As a result, the code doesn't work as intended for online schemes tuning and could have more than expected memory footprint. The schemes are all in the DAMON context, so it doesn't leak the memory, though. Remove the wrong asssumption (the DAMON context wouldn't have schemes) in 'damon_sysfs_set_schemes()' to fix the bug. Link: https://lkml.kernel.org/r/20221122194831.3472-1-sj@kernel.org Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update") Signed-off-by: SeongJae Park Cc: [5.19+] Signed-off-by: Andrew Morton commit a435874bf626f55d7147026b059008c8de89fbb8 Author: Tiezhu Yang Date: Sat Nov 19 10:36:59 2022 +0800 tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" The latest version of grep claims the egrep is now obsolete so the build now contains warnings that look like: egrep: warning: egrep is obsolescent; using grep -E fix this up by moving the related file to use "grep -E" instead. sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/vm` Here are the steps to install the latest grep: wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz tar xf grep-3.8.tar.gz cd grep-3.8 && ./configure && make sudo make install export PATH=/usr/local/bin:$PATH Link: https://lkml.kernel.org/r/1668825419-30584-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Reviewed-by: Sergey Senozhatsky Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton commit f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4 Author: ZhangPeng Date: Sat Nov 19 21:05:42 2022 +0900 nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry() Syzbot reported a null-ptr-deref bug: NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 1 PID: 3603 Comm: segctord Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 RIP: 0010:nilfs_palloc_commit_free_entry+0xe5/0x6b0 fs/nilfs2/alloc.c:608 Code: 00 00 00 00 fc ff df 80 3c 02 00 0f 85 cd 05 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 73 08 49 8d 7e 10 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 26 05 00 00 49 8b 46 10 be a6 00 00 00 48 c7 c7 RSP: 0018:ffffc90003dff830 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: ffff88802594e218 RCX: 000000000000000d RDX: 0000000000000002 RSI: 0000000000002000 RDI: 0000000000000010 RBP: ffff888071880222 R08: 0000000000000005 R09: 000000000000003f R10: 000000000000000d R11: 0000000000000000 R12: ffff888071880158 R13: ffff88802594e220 R14: 0000000000000000 R15: 0000000000000004 FS: 0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb1c08316a8 CR3: 0000000018560000 CR4: 0000000000350ee0 Call Trace: nilfs_dat_commit_free fs/nilfs2/dat.c:114 [inline] nilfs_dat_commit_end+0x464/0x5f0 fs/nilfs2/dat.c:193 nilfs_dat_commit_update+0x26/0x40 fs/nilfs2/dat.c:236 nilfs_btree_commit_update_v+0x87/0x4a0 fs/nilfs2/btree.c:1940 nilfs_btree_commit_propagate_v fs/nilfs2/btree.c:2016 [inline] nilfs_btree_propagate_v fs/nilfs2/btree.c:2046 [inline] nilfs_btree_propagate+0xa00/0xd60 fs/nilfs2/btree.c:2088 nilfs_bmap_propagate+0x73/0x170 fs/nilfs2/bmap.c:337 nilfs_collect_file_data+0x45/0xd0 fs/nilfs2/segment.c:568 nilfs_segctor_apply_buffers+0x14a/0x470 fs/nilfs2/segment.c:1018 nilfs_segctor_scan_file+0x3f4/0x6f0 fs/nilfs2/segment.c:1067 nilfs_segctor_collect_blocks fs/nilfs2/segment.c:1197 [inline] nilfs_segctor_collect fs/nilfs2/segment.c:1503 [inline] nilfs_segctor_do_construct+0x12fc/0x6af0 fs/nilfs2/segment.c:2045 nilfs_segctor_construct+0x8e3/0xb30 fs/nilfs2/segment.c:2379 nilfs_segctor_thread_construct fs/nilfs2/segment.c:2487 [inline] nilfs_segctor_thread+0x3c3/0xf30 fs/nilfs2/segment.c:2570 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 ... If DAT metadata file is corrupted on disk, there is a case where req->pr_desc_bh is NULL and blocknr is 0 at nilfs_dat_commit_end() during a b-tree operation that cascadingly updates ancestor nodes of the b-tree, because nilfs_dat_commit_alloc() for a lower level block can initialize the blocknr on the same DAT entry between nilfs_dat_prepare_end() and nilfs_dat_commit_end(). If this happens, nilfs_dat_commit_end() calls nilfs_dat_commit_free() without valid buffer heads in req->pr_desc_bh and req->pr_bitmap_bh, and causes the NULL pointer dereference above in nilfs_palloc_commit_free_entry() function, which leads to a crash. Fix this by adding a NULL check on req->pr_desc_bh and req->pr_bitmap_bh before nilfs_palloc_commit_free_entry() in nilfs_dat_commit_free(). This also calls nilfs_error() in that case to notify that there is a fatal flaw in the filesystem metadata and prevent further operations. Link: https://lkml.kernel.org/r/00000000000097c20205ebaea3d6@google.com Link: https://lkml.kernel.org/r/20221114040441.1649940-1-zhangpeng362@huawei.com Link: https://lkml.kernel.org/r/20221119120542.17204-1-konishi.ryusuke@gmail.com Signed-off-by: ZhangPeng Signed-off-by: Ryusuke Konishi Reported-by: syzbot+ebe05ee8e98f755f61d0@syzkaller.appspotmail.com Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit 04ada095dcfc4ae359418053c0be94453bdf1e84 Author: Mike Kravetz Date: Mon Nov 14 15:55:06 2022 -0800 hugetlb: don't delete vma_lock in hugetlb MADV_DONTNEED processing madvise(MADV_DONTNEED) ends up calling zap_page_range() to clear page tables associated with the address range. For hugetlb vmas, zap_page_range will call __unmap_hugepage_range_final. However, __unmap_hugepage_range_final assumes the passed vma is about to be removed and deletes the vma_lock to prevent pmd sharing as the vma is on the way out. In the case of madvise(MADV_DONTNEED) the vma remains, but the missing vma_lock prevents pmd sharing and could potentially lead to issues with truncation/fault races. This issue was originally reported here [1] as a BUG triggered in page_try_dup_anon_rmap. Prior to the introduction of the hugetlb vma_lock, __unmap_hugepage_range_final cleared the VM_MAYSHARE flag to prevent pmd sharing. Subsequent faults on this vma were confused as VM_MAYSHARE indicates a sharable vma, but was not set so page_mapping was not set in new pages added to the page table. This resulted in pages that appeared anonymous in a VM_SHARED vma and triggered the BUG. Address issue by adding a new zap flag ZAP_FLAG_UNMAP to indicate an unmap call from unmap_vmas(). This is used to indicate the 'final' unmapping of a hugetlb vma. When called via MADV_DONTNEED, this flag is not set and the vm_lock is not deleted. [1] https://lore.kernel.org/lkml/CAO4mrfdLMXsao9RF4fUE8-Wfde8xmjsKrTNMNC9wjUb6JudD0g@mail.gmail.com/ Link: https://lkml.kernel.org/r/20221114235507.294320-3-mike.kravetz@oracle.com Fixes: 90e7e7f5ef3f ("mm: enable MADV_DONTNEED for hugetlb mappings") Signed-off-by: Mike Kravetz Reported-by: Wei Chen Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Mina Almasry Cc: Nadav Amit Cc: Naoya Horiguchi Cc: Peter Xu Cc: Rik van Riel Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton commit 21b85b09527c28e242db55c1b751f7f7549b830c Author: Mike Kravetz Date: Mon Nov 14 15:55:05 2022 -0800 madvise: use zap_page_range_single for madvise dontneed This series addresses the issue first reported in [1], and fully described in patch 2. Patches 1 and 2 address the user visible issue and are tagged for stable backports. While exploring solutions to this issue, related problems with mmu notification calls were discovered. This is addressed in the patch "hugetlb: remove duplicate mmu notifications:". Since there are no user visible effects, this third is not tagged for stable backports. Previous discussions suggested further cleanup by removing the routine zap_page_range. This is possible because zap_page_range_single is now exported, and all callers of zap_page_range pass ranges entirely within a single vma. This work will be done in a later patch so as not to distract from this bug fix. [1] https://lore.kernel.org/lkml/CAO4mrfdLMXsao9RF4fUE8-Wfde8xmjsKrTNMNC9wjUb6JudD0g@mail.gmail.com/ This patch (of 2): Expose the routine zap_page_range_single to zap a range within a single vma. The madvise routine madvise_dontneed_single_vma can use this routine as it explicitly operates on a single vma. Also, update the mmu notification range in zap_page_range_single to take hugetlb pmd sharing into account. This is required as MADV_DONTNEED supports hugetlb vmas. Link: https://lkml.kernel.org/r/20221114235507.294320-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20221114235507.294320-2-mike.kravetz@oracle.com Fixes: 90e7e7f5ef3f ("mm: enable MADV_DONTNEED for hugetlb mappings") Signed-off-by: Mike Kravetz Reported-by: Wei Chen Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Mina Almasry Cc: Nadav Amit Cc: Naoya Horiguchi Cc: Peter Xu Cc: Rik van Riel Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton commit dec1d352de5c6e2bcdbb03a2e7a84d85ad2e4f14 Author: Yang Shi Date: Tue Nov 8 10:43:57 2022 -0800 mm: replace VM_WARN_ON to pr_warn if the node is offline with __GFP_THISNODE Syzbot reported the below splat: WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 __alloc_pages_node include/linux/gfp.h:221 [inline] WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 hpage_collapse_alloc_page mm/khugepaged.c:807 [inline] WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 alloc_charge_hpage+0x802/0xaa0 mm/khugepaged.c:963 Modules linked in: CPU: 1 PID: 3646 Comm: syz-executor210 Not tainted 6.1.0-rc1-syzkaller-00454-ga70385240892 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 RIP: 0010:__alloc_pages_node include/linux/gfp.h:221 [inline] RIP: 0010:hpage_collapse_alloc_page mm/khugepaged.c:807 [inline] RIP: 0010:alloc_charge_hpage+0x802/0xaa0 mm/khugepaged.c:963 Code: e5 01 4c 89 ee e8 6e f9 ae ff 4d 85 ed 0f 84 28 fc ff ff e8 70 fc ae ff 48 8d 6b ff 4c 8d 63 07 e9 16 fc ff ff e8 5e fc ae ff <0f> 0b e9 96 fa ff ff 41 bc 1a 00 00 00 e9 86 fd ff ff e8 47 fc ae RSP: 0018:ffffc90003fdf7d8 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888077f457c0 RSI: ffffffff81cd8f42 RDI: 0000000000000001 RBP: ffff888079388c0c R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f6b48ccf700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6b48a819f0 CR3: 00000000171e7000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: collapse_file+0x1ca/0x5780 mm/khugepaged.c:1715 hpage_collapse_scan_file+0xd6c/0x17a0 mm/khugepaged.c:2156 madvise_collapse+0x53a/0xb40 mm/khugepaged.c:2611 madvise_vma_behavior+0xd0a/0x1cc0 mm/madvise.c:1066 madvise_walk_vmas+0x1c7/0x2b0 mm/madvise.c:1240 do_madvise.part.0+0x24a/0x340 mm/madvise.c:1419 do_madvise mm/madvise.c:1432 [inline] __do_sys_madvise mm/madvise.c:1432 [inline] __se_sys_madvise mm/madvise.c:1430 [inline] __x64_sys_madvise+0x113/0x150 mm/madvise.c:1430 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6b48a4eef9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6b48ccf318 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f6b48af0048 RCX: 00007f6b48a4eef9 RDX: 0000000000000019 RSI: 0000000000600003 RDI: 0000000020000000 RBP: 00007f6b48af0040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6b48aa53a4 R13: 00007f6b48bffcbf R14: 00007f6b48ccf400 R15: 0000000000022000 It is because khugepaged allocates pages with __GFP_THISNODE, but the preferred node is bogus. The previous patch fixed the khugepaged code to avoid allocating page from non-existing node. But it is still racy against memory hotremove. There is no synchronization with the memory hotplug so it is possible that memory gets offline during a longer taking scanning. So this warning still seems not quite helpful because: * There is no guarantee the node is online for __GFP_THISNODE context for all the callsites. * Kernel just fails the allocation regardless the warning, and it looks all callsites handle the allocation failure gracefully. Although while the warning has helped to identify a buggy code, it is not safe in general and this warning could panic the system with panic-on-warn configuration which tends to be used surprisingly often. So replace VM_WARN_ON to pr_warn(). And the warning will be triggered if __GFP_NOWARN is set since the allocator would print out warning for such case if __GFP_NOWARN is not set. [shy828301@gmail.com: rename nid to this_node and gfp to warn_gfp] Link: https://lkml.kernel.org/r/20221123193014.153983-1-shy828301@gmail.com [akpm@linux-foundation.org: fix whitespace] [akpm@linux-foundation.org: print gfp_mask instead of warn_gfp, per Michel] Link: https://lkml.kernel.org/r/20221108184357.55614-3-shy828301@gmail.com Fixes: 7d8faaf15545 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse") Signed-off-by: Yang Shi Reported-by: Suggested-by: Michal Hocko Acked-by: Michal Hocko Cc: Zach O'Keefe Signed-off-by: Andrew Morton commit 28e96556baca7056d11d9fb3cdd0aba4483e00d8 Author: Akihiko Odaki Date: Fri Nov 25 22:30:31 2022 +0900 igb: Allocate MSI-X vector when testing Without this change, the interrupt test fail with MSI-X environment: $ sudo ethtool -t enp0s2 offline [ 43.921783] igb 0000:00:02.0: offline testing starting [ 44.855824] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Down [ 44.961249] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX [ 51.272202] igb 0000:00:02.0: testing shared interrupt [ 56.996975] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX The test result is FAIL The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 4 Loopback test (offline) 0 Link test (on/offline) 0 Here, "4" means an expected interrupt was not delivered. To fix this, route IRQs correctly to the first MSI-X vector by setting IVAR_MISC. Also, set bit 0 of EIMS so that the vector will not be masked. The interrupt test now runs properly with this change: $ sudo ethtool -t enp0s2 offline [ 42.762985] igb 0000:00:02.0: offline testing starting [ 50.141967] igb 0000:00:02.0: testing shared interrupt [ 56.163957] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX The test result is PASS The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 0 Loopback test (offline) 0 Link test (on/offline) 0 Fixes: 4eefa8f01314 ("igb: add single vector msi-x testing to interrupt test") Signed-off-by: Akihiko Odaki Reviewed-by: Maciej Fijalkowski Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit eed913f6919e253f35d454b2f115f2a4db2b741a Author: Akihiko Odaki Date: Fri Oct 28 22:00:00 2022 +0900 e1000e: Fix TX dispatch condition e1000_xmit_frame is expected to stop the queue and dispatch frames to hardware if there is not sufficient space for the next frame in the buffer, but sometimes it failed to do so because the estimated maximum size of frame was wrong. As the consequence, the later invocation of e1000_xmit_frame failed with NETDEV_TX_BUSY, and the frame in the buffer remained forever, resulting in a watchdog failure. This change fixes the estimated size by making it match with the condition for NETDEV_TX_BUSY. Apparently, the old estimation failed to account for the following lines which determines the space requirement for not causing NETDEV_TX_BUSY: ``` /* reserve a descriptor for the offload context */ if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL)) count++; count++; count += DIV_ROUND_UP(len, adapter->tx_fifo_limit); ``` This issue was found when running http-stress02 test included in Linux Test Project 20220930 on QEMU with the following commandline: ``` qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8 -drive if=virtio,format=raw,file=root.img,file.locking=on -device e1000e,netdev=netdev -netdev tap,script=ifup,downscript=no,id=netdev ``` Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)") Signed-off-by: Akihiko Odaki Tested-by: Gurucharan G (A Contingent worker at Intel) Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit ef4d3ea40565a781c25847e9cb96c1bd9f462bc6 Author: Marc Dionne Date: Wed Nov 30 17:55:51 2022 +0000 afs: Fix server->active leak in afs_put_server The atomic_read was accidentally replaced with atomic_inc_return, which prevents the server from getting cleaned up and causes rmmod to hang with a warning: Can't purge s=00000001 Fixes: 2757a4dc1849 ("afs: Fix access after dec in put functions") Signed-off-by: Marc Dionne Signed-off-by: David Howells Link: https://lore.kernel.org/r/20221130174053.2665818-1-marc.dionne@auristor.com/ Signed-off-by: Linus Torvalds commit 04aa64375f48a5d430b5550d9271f8428883e550 Author: Andrzej Hajda Date: Mon Nov 14 11:38:24 2022 +0100 drm/i915: fix TLB invalidation for Gen12 video and compute engines In case of Gen12 video and compute engines, TLB_INV registers are masked - to modify one bit, corresponding bit in upper half of the register must be enabled, otherwise nothing happens. CVE: CVE-2022-4139 Suggested-by: Chris Wilson Signed-off-by: Andrzej Hajda Acked-by: Daniel Vetter Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit b47068b4aa53a57552398e3f60d0ed1918700c2b Merge: 9b84f0f74d0d7 3d1bb6cc1a654 Author: Takashi Iwai Date: Wed Nov 30 17:26:55 2022 +0100 Merge tag 'asoc-fix-v6.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.1 Some more fixes for v6.1, some of these are very old and were originally intended to get sent for v5.18 but got lost in the shuffle when there was an issue with Linus not liking my branching strategy and I rebuilt bits of my workflow. The ops changes have been validated by people looking at real hardware and are how things getting dropped got noticed. commit 45fecdb9f658d9c82960c98240bc0770ade19aca Author: Xiongfeng Wang Date: Tue Nov 22 20:35:08 2022 +0800 gpio: amd8111: Fix PCI device reference count leak for_each_pci_dev() is implemented by pci_get_device(). The comment of pci_get_device() says that it will increase the reference count for the returned pci_dev and also decrease the reference count for the input pci_dev @from if it is not NULL. If we break for_each_pci_dev() loop with pdev not NULL, we need to call pci_dev_put() to decrease the reference count. Add the missing pci_dev_put() after the 'out' label. Since pci_dev_put() can handle NULL input parameter, there is no problem for the 'Device not found' branch. For the normal path, add pci_dev_put() in amd_gpio_exit(). Fixes: f942a7de047d ("gpio: add a driver for GPIO pins found on AMD-8111 south bridge chips") Signed-off-by: Xiongfeng Wang Signed-off-by: Bartosz Golaszewski commit e542baf30b48605d4336bf54b98e76b8fb98af30 Author: Paolo Bonzini Date: Wed Nov 30 11:14:35 2022 -0500 KVM: x86: fix uninitialized variable use on KVM_REQ_TRIPLE_FAULT If a triple fault was fixed by kvm_x86_ops.nested_ops->triple_fault (by turning it into a vmexit), there is no need to leave vcpu_enter_guest(). Any vcpu->requests will be caught later before the actual vmentry, and in fact vcpu_enter_guest() was not initializing the "r" variable. Depending on the compiler's whims, this could cause the x86_64/triple_fault_event_test test to fail. Cc: Maxim Levitsky Fixes: 92e7d5c83aff ("KVM: x86: allow L1 to not intercept triple fault") Signed-off-by: Paolo Bonzini commit 9b84f0f74d0d716e3fd18dc428ac111266ef5844 Author: Takashi Sakamoto Date: Wed Nov 30 22:06:04 2022 +0900 ALSA: dice: fix regression for Lexicon I-ONIX FW810S For Lexicon I-ONIX FW810S, the call of ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS can returns -ETIMEDOUT. This is a regression due to the commit 41319eb56e19 ("ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation"). The device does not emit NOTIFY_CLOCK_ACCEPTED notification when accepting GLOBAL_CLOCK_SELECT operation with the same parameters as current ones. This commit fixes the regression. When receiving no notification, return -ETIMEDOUT as long as operating for any change. Fixes: 41319eb56e19 ("ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation") Cc: Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20221130130604.29774-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 8c115864501fc09932cdfec53d9ec1cde82b4a28 Author: Qiqi Zhang Date: Fri Nov 25 18:45:58 2022 +0800 drm/bridge: ti-sn65dsi86: Fix output polarity setting bug According to the description in ti-sn65dsi86's datasheet: CHA_HSYNC_POLARITY: 0 = Active High Pulse. Synchronization signal is high for the sync pulse width. (default) 1 = Active Low Pulse. Synchronization signal is low for the sync pulse width. CHA_VSYNC_POLARITY: 0 = Active High Pulse. Synchronization signal is high for the sync pulse width. (Default) 1 = Active Low Pulse. Synchronization signal is low for the sync pulse width. We should only set these bits when the polarity is negative. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Qiqi Zhang Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Reviewed-by: Tomi Valkeinen Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20221125104558.84616-1-eddy.zhang@rock-chips.com commit 899d2a05dc14733cfba6224083c6b0dd5a738590 Author: Caleb Sander Date: Fri Nov 18 16:27:56 2022 -0700 nvme: fix SRCU protection of nvme_ns_head list Walking the nvme_ns_head siblings list is protected by the head's srcu in nvme_ns_head_submit_bio() but not nvme_mpath_revalidate_paths(). Removing namespaces from the list also fails to synchronize the srcu. Concurrent scan work can therefore cause use-after-frees. Hold the head's srcu lock in nvme_mpath_revalidate_paths() and synchronize with the srcu, not the global RCU, in nvme_ns_remove(). Observed the following panic when making NVMe/RDMA connections with native multipath on the Rocky Linux 8.6 kernel (it seems the upstream kernel has the same race condition). Disassembly shows the faulting instruction is cmp 0x50(%rdx),%rcx; computing capacity != get_capacity(ns->disk). Address 0x50 is dereferenced because ns->disk is NULL. The NULL disk appears to be the result of concurrent scan work freeing the namespace (note the log line in the middle of the panic). [37314.206036] BUG: unable to handle kernel NULL pointer dereference at 0000000000000050 [37314.206036] nvme0n3: detected capacity change from 0 to 11811160064 [37314.299753] PGD 0 P4D 0 [37314.299756] Oops: 0000 [#1] SMP PTI [37314.299759] CPU: 29 PID: 322046 Comm: kworker/u98:3 Kdump: loaded Tainted: G W X --------- - - 4.18.0-372.32.1.el8test86.x86_64 #1 [37314.299762] Hardware name: Dell Inc. PowerEdge R720/0JP31P, BIOS 2.7.0 05/23/2018 [37314.299763] Workqueue: nvme-wq nvme_scan_work [nvme_core] [37314.299783] RIP: 0010:nvme_mpath_revalidate_paths+0x26/0xb0 [nvme_core] [37314.299790] Code: 1f 44 00 00 66 66 66 66 90 55 53 48 8b 5f 50 48 8b 83 c8 c9 00 00 48 8b 13 48 8b 48 50 48 39 d3 74 20 48 8d 42 d0 48 8b 50 20 <48> 3b 4a 50 74 05 f0 80 60 70 ef 48 8b 50 30 48 8d 42 d0 48 39 d3 [37315.058803] RSP: 0018:ffffabe28f913d10 EFLAGS: 00010202 [37315.121316] RAX: ffff927a077da800 RBX: ffff92991dd70000 RCX: 0000000001600000 [37315.206704] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff92991b719800 [37315.292106] RBP: ffff929a6b70c000 R08: 000000010234cd4a R09: c0000000ffff7fff [37315.377501] R10: 0000000000000001 R11: ffffabe28f913a30 R12: 0000000000000000 [37315.462889] R13: ffff92992716600c R14: ffff929964e6e030 R15: ffff92991dd70000 [37315.548286] FS: 0000000000000000(0000) GS:ffff92b87fb80000(0000) knlGS:0000000000000000 [37315.645111] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [37315.713871] CR2: 0000000000000050 CR3: 0000002208810006 CR4: 00000000000606e0 [37315.799267] Call Trace: [37315.828515] nvme_update_ns_info+0x1ac/0x250 [nvme_core] [37315.892075] nvme_validate_or_alloc_ns+0x2ff/0xa00 [nvme_core] [37315.961871] ? __blk_mq_free_request+0x6b/0x90 [37316.015021] nvme_scan_work+0x151/0x240 [nvme_core] [37316.073371] process_one_work+0x1a7/0x360 [37316.121318] ? create_worker+0x1a0/0x1a0 [37316.168227] worker_thread+0x30/0x390 [37316.212024] ? create_worker+0x1a0/0x1a0 [37316.258939] kthread+0x10a/0x120 [37316.297557] ? set_kthread_struct+0x50/0x50 [37316.347590] ret_from_fork+0x35/0x40 [37316.390360] Modules linked in: nvme_rdma nvme_tcp(X) nvme_fabrics nvme_core netconsole iscsi_tcp libiscsi_tcp dm_queue_length dm_service_time nf_conntrack_netlink br_netfilter bridge stp llc overlay nft_chain_nat ipt_MASQUERADE nf_nat xt_addrtype xt_CT nft_counter xt_state xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_comment xt_multiport nft_compat nf_tables libcrc32c nfnetlink dm_multipath tg3 rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_target_mod target_core_mod ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm intel_rapl_msr iTCO_wdt iTCO_vendor_support dcdbas intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel ipmi_ssif kvm irqbypass crct10dif_pclmul crc32_pclmul mlx5_ib ghash_clmulni_intel ib_uverbs rapl intel_cstate intel_uncore ib_core ipmi_si joydev mei_me pcspkr ipmi_devintf mei lpc_ich wmi ipmi_msghandler acpi_power_meter ext4 mbcache jbd2 sd_mod t10_pi sg mgag200 mlx5_core drm_kms_helper syscopyarea [37316.390419] sysfillrect ahci sysimgblt fb_sys_fops libahci drm crc32c_intel libata mlxfw pci_hyperv_intf tls i2c_algo_bit psample dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: nvme_core] [37317.645908] CR2: 0000000000000050 Fixes: e7d65803e2bb ("nvme-multipath: revalidate paths during rescan") Signed-off-by: Caleb Sander Signed-off-by: Christoph Hellwig commit a56ea6147facce4ac1fc38675455f9733d96232b Author: Lei Rao Date: Tue Nov 29 17:48:11 2022 +0800 nvme-pci: clear the prp2 field when not used If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2 field is garbage data. According to nvme spec, the prp2 is reserved if the data transfer does not cross a memory page boundary, so clear it to zero if it is not used. Signed-off-by: Lei Rao Signed-off-by: Christoph Hellwig commit 1feeae071507ad65cf9f462a1bdd543a4bf89e71 Author: Pablo Neira Ayuso Date: Mon Nov 28 10:58:53 2022 +0100 netfilter: ctnetlink: fix compilation warning after data race fixes in ct mark All warnings (new ones prefixed by >>): net/netfilter/nf_conntrack_netlink.c: In function '__ctnetlink_glue_build': >> net/netfilter/nf_conntrack_netlink.c:2674:13: warning: unused variable 'mark' [-Wunused-variable] 2674 | u32 mark; | ^~~~ Fixes: 52d1aa8b8249 ("netfilter: conntrack: Fix data-races around ct mark") Reported-by: kernel test robot Tested-by: Ivan Babrou Signed-off-by: Pablo Neira Ayuso commit 9464d0b68f11a9bc768370c3260ec02b3550447b Author: Xin Long Date: Thu Nov 24 12:21:46 2022 -0500 netfilter: conntrack: fix using __this_cpu_add in preemptible Currently in nf_conntrack_hash_check_insert(), when it fails in nf_ct_ext_valid_pre/post(), NF_CT_STAT_INC() will be called in the preemptible context, a call trace can be triggered: BUG: using __this_cpu_add() in preemptible [00000000] code: conntrack/1636 caller is nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack] Call Trace: dump_stack_lvl+0x33/0x46 check_preemption_disabled+0xc3/0xf0 nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack] ctnetlink_create_conntrack+0x3cd/0x4e0 [nf_conntrack_netlink] ctnetlink_new_conntrack+0x1c0/0x450 [nf_conntrack_netlink] nfnetlink_rcv_msg+0x277/0x2f0 [nfnetlink] netlink_rcv_skb+0x50/0x100 nfnetlink_rcv+0x65/0x144 [nfnetlink] netlink_unicast+0x1ae/0x290 netlink_sendmsg+0x257/0x4f0 sock_sendmsg+0x5f/0x70 This patch is to fix it by changing to use NF_CT_STAT_INC_ATOMIC() for nf_ct_ext_valid_pre/post() check in nf_conntrack_hash_check_insert(), as well as nf_ct_ext_valid_post() in __nf_conntrack_confirm(). Note that nf_ct_ext_valid_pre() check in __nf_conntrack_confirm() is safe to use NF_CT_STAT_INC(), as it's under local_bh_disable(). Fixes: c56716c69ce1 ("netfilter: extensions: introduce extension genid count") Signed-off-by: Xin Long Signed-off-by: Pablo Neira Ayuso commit d556a9aeb62a6cd44aa05aeadcc48245da0a1939 Merge: 6fdd5d2f8c2f5 9b932aadfc47d Author: Palmer Dabbelt Date: Tue Nov 29 21:51:05 2022 -0800 Merge patch series "riscv: kexec: Fxiup crash_save percpu and machine_kexec_mask_interrupts" guoren@kernel.org says: From: Guo Ren Current riscv kexec can't crash_save percpu states and disable interrupts properly. The patch series fix them, make kexec work correct. * b4-shazam-merge: riscv: kexec: Fixup crash_smp_send_stop without multi cores riscv: kexec: Fixup irq controller broken in kexec crash path Link: https://lore.kernel.org/r/20221020141603.2856206-1-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 9b932aadfc47de5d70b53ea04b0d1b5f6c82945b Author: Guo Ren Date: Thu Oct 20 10:16:03 2022 -0400 riscv: kexec: Fixup crash_smp_send_stop without multi cores Current crash_smp_send_stop is the same as the generic one in kernel/panic and misses crash_save_cpu in percpu. This patch is inspired by 78fd584cdec0 ("arm64: kdump: implement machine_crash_shutdown()") and adds the same mechanism for riscv. Before this patch, test result: crash> help -r CPU 0: [OFFLINE] CPU 1: epc : ffffffff80009ff0 ra : ffffffff800b789a sp : ff2000001098bb40 gp : ffffffff815fca60 tp : ff60000004680000 t0 : 6666666666663c5b t1 : 0000000000000000 t2 : 666666666666663c s0 : ff2000001098bc90 s1 : ffffffff81600798 a0 : ff2000001098bb48 a1 : 0000000000000000 a2 : 0000000000000000 a3 : 0000000000000001 a4 : 0000000000000000 a5 : ff60000004690800 a6 : 0000000000000000 a7 : 0000000000000000 s2 : ff2000001098bb48 s3 : ffffffff81093ec8 s4 : ffffffff816004ac s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80e7f720 s8 : 00fffffffffff3f0 s9 : 0000000000000007 s10: 00aaaaaaaab98700 s11: 0000000000000001 t3 : ffffffff819a8097 t4 : ffffffff819a8097 t5 : ffffffff819a8098 t6 : ff2000001098b9a8 CPU 2: [OFFLINE] CPU 3: [OFFLINE] After this patch, test result: crash> help -r CPU 0: epc : ffffffff80003f34 ra : ffffffff808caa7c sp : ffffffff81403eb0 gp : ffffffff815fcb48 tp : ffffffff81413400 t0 : 0000000000000000 t1 : 0000000000000000 t2 : 0000000000000000 s0 : ffffffff81403ec0 s1 : 0000000000000000 a0 : 0000000000000000 a1 : 0000000000000000 a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000000000 s2 : ffffffff816001c8 s3 : ffffffff81600370 s4 : ffffffff80c32e18 s5 : ffffffff819d3018 s6 : ffffffff810e2110 s7 : 0000000000000000 s8 : 0000000000000000 s9 : 0000000080039eac s10: 0000000000000000 s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 t5 : 0000000000000000 t6 : 0000000000000000 CPU 1: epc : ffffffff80003f34 ra : ffffffff808caa7c sp : ff2000000068bf30 gp : ffffffff815fcb48 tp : ff6000000240d400 t0 : 0000000000000000 t1 : 0000000000000000 t2 : 0000000000000000 s0 : ff2000000068bf40 s1 : 0000000000000001 a0 : 0000000000000000 a1 : 0000000000000000 a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000000000 s2 : ffffffff816001c8 s3 : ffffffff81600370 s4 : ffffffff80c32e18 s5 : ffffffff819d3018 s6 : ffffffff810e2110 s7 : 0000000000000000 s8 : 0000000000000000 s9 : 0000000080039ea8 s10: 0000000000000000 s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 t5 : 0000000000000000 t6 : 0000000000000000 CPU 2: epc : ffffffff80003f34 ra : ffffffff808caa7c sp : ff20000000693f30 gp : ffffffff815fcb48 tp : ff6000000240e900 t0 : 0000000000000000 t1 : 0000000000000000 t2 : 0000000000000000 s0 : ff20000000693f40 s1 : 0000000000000002 a0 : 0000000000000000 a1 : 0000000000000000 a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000000000 s2 : ffffffff816001c8 s3 : ffffffff81600370 s4 : ffffffff80c32e18 s5 : ffffffff819d3018 s6 : ffffffff810e2110 s7 : 0000000000000000 s8 : 0000000000000000 s9 : 0000000080039eb0 s10: 0000000000000000 s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 t5 : 0000000000000000 t6 : 0000000000000000 CPU 3: epc : ffffffff8000a1e4 ra : ffffffff800b7bba sp : ff200000109bbb40 gp : ffffffff815fcb48 tp : ff6000000373aa00 t0 : 6666666666663c5b t1 : 0000000000000000 t2 : 666666666666663c s0 : ff200000109bbc90 s1 : ffffffff816007a0 a0 : ff200000109bbb48 a1 : 0000000000000000 a2 : 0000000000000000 a3 : 0000000000000001 a4 : 0000000000000000 a5 : ff60000002c61c00 a6 : 0000000000000000 a7 : 0000000000000000 s2 : ff200000109bbb48 s3 : ffffffff810941a8 s4 : ffffffff816004b4 s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80e7f7a0 s8 : 00fffffffffff3f0 s9 : 0000000000000007 s10: 00aaaaaaaab98700 s11: 0000000000000001 t3 : ffffffff819a8097 t4 : ffffffff819a8097 t5 : ffffffff819a8098 t6 : ff200000109bb9a8 Fixes: ad943893d5f1 ("RISC-V: Fixup schedule out issue in machine_crash_shutdown()") Reviewed-by: Xianting Tian Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Nick Kossifidis Link: https://lore.kernel.org/r/20221020141603.2856206-3-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit b17d19a5314a37f7197afd1a0200affd21a7227d Author: Guo Ren Date: Thu Oct 20 10:16:02 2022 -0400 riscv: kexec: Fixup irq controller broken in kexec crash path If a crash happens on cpu3 and all interrupts are binding on cpu0, the bad irq routing will cause a crash kernel which can't receive any irq. Because crash kernel won't clean up all harts' PLIC enable bits in enable registers. This patch is similar to 9141a003a491 ("ARM: 7316/1: kexec: EOI active and mask all interrupts in kexec crash path") and 78fd584cdec0 ("arm64: kdump: implement machine_crash_shutdown()"), and PowerPC also has the same mechanism. Fixes: fba8a8674f68 ("RISC-V: Add kexec support") Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Xianting Tian Cc: Nick Kossifidis Cc: Palmer Dabbelt Link: https://lore.kernel.org/r/20221020141603.2856206-2-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 6fdd5d2f8c2f54b7fad4ff4df2a19542aeaf6102 Author: Björn Töpel Date: Tue Nov 15 10:06:40 2022 +0100 riscv: mm: Proper page permissions after initmem free 64-bit RISC-V kernels have the kernel image mapped separately to alias the linear map. The linear map and the kernel image map are documented as "direct mapping" and "kernel" respectively in [1]. At image load time, the linear map corresponding to the kernel image is set to PAGE_READ permission, and the kernel image map is set to PAGE_READ|PAGE_EXEC. When the initmem is freed, the pages in the linear map should be restored to PAGE_READ|PAGE_WRITE, whereas the corresponding pages in the kernel image map should be restored to PAGE_READ, by removing the PAGE_EXEC permission. This is not the case. For 64-bit kernels, only the linear map is restored to its proper page permissions at initmem free, and not the kernel image map. In practise this results in that the kernel can potentially jump to dead __init code, and start executing invalid instructions, without getting an exception. Restore the freed initmem properly, by setting both the kernel image map to the correct permissions. [1] Documentation/riscv/vm-layout.rst Fixes: e5c35fa04019 ("riscv: Map the kernel with correct permissions the first time") Signed-off-by: Björn Töpel Reviewed-by: Alexandre Ghiti Tested-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20221115090641.258476-1-bjorn@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 74f6bb55c834da6d4bac24f44868202743189b2b Author: Jisheng Zhang Date: Thu Nov 3 01:02:54 2022 +0800 riscv: vdso: fix section overlapping under some conditions lkp reported a build error, I tried the config and can reproduce build error as below: VDSOLD arch/riscv/kernel/vdso/vdso.so.dbg ld.lld: error: section .note file range overlaps with .text >>> .note range is [0x7C8, 0x803] >>> .text range is [0x800, 0x1993] ld.lld: error: section .text file range overlaps with .dynamic >>> .text range is [0x800, 0x1993] >>> .dynamic range is [0x808, 0x937] ld.lld: error: section .note virtual address range overlaps with .text >>> .note range is [0x7C8, 0x803] >>> .text range is [0x800, 0x1993] Fix it by setting DISABLE_BRANCH_PROFILING which will disable branch tracing for vdso, thus avoid useless _ftrace_annotated_branch section and _ftrace_branch section. Although we can also fix it by removing the hardcoded .text begin address, but I think that's another story and should be put into another patch. Link: https://lore.kernel.org/lkml/202210122123.Cc4FPShJ-lkp@intel.com/#r Reported-by: kernel test robot Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20221102170254.1925-1-jszhang@kernel.org Fixes: ad5d1122b82f ("riscv: use vDSO common flow to reduce the latency of the time-related functions") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 7e1864332fbc1b993659eab7974da9fe8bf8c128 Author: Jisheng Zhang Date: Sun Oct 30 20:45:17 2022 +0800 riscv: fix race when vmap stack overflow Currently, when detecting vmap stack overflow, riscv firstly switches to the so called shadow stack, then use this shadow stack to call the get_overflow_stack() to get the overflow stack. However, there's a race here if two or more harts use the same shadow stack at the same time. To solve this race, we introduce spin_shadow_stack atomic var, which will be swap between its own address and 0 in atomic way, when the var is set, it means the shadow_stack is being used; when the var is cleared, it means the shadow_stack isn't being used. Fixes: 31da94c25aea ("riscv: add VMAP_STACK overflow detection") Signed-off-by: Jisheng Zhang Suggested-by: Guo Ren Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20221030124517.2370-1-jszhang@kernel.org [Palmer: Add AQ to the swap, and also some comments.] Signed-off-by: Palmer Dabbelt commit 01f856ae6d0ca5ad0505b79bf2d22d7ca439b2a1 Merge: ca57f02295f18 d66233a312ec9 Author: Linus Torvalds Date: Tue Nov 29 09:52:10 2022 -0800 Merge tag 'net-6.1-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf, can and wifi. Current release - new code bugs: - eth: mlx5e: - use kvfree() in mlx5e_accel_fs_tcp_create() - MACsec, fix RX data path 16 RX security channel limit - MACsec, fix memory leak when MACsec device is deleted - MACsec, fix update Rx secure channel active field - MACsec, fix add Rx security association (SA) rule memory leak Previous releases - regressions: - wifi: cfg80211: don't allow multi-BSSID in S1G - stmmac: set MAC's flow control register to reflect current settings - eth: mlx5: - E-switch, fix duplicate lag creation - fix use-after-free when reverting termination table Previous releases - always broken: - ipv4: fix route deletion when nexthop info is not specified - bpf: fix a local storage BPF map bug where the value's spin lock field can get initialized incorrectly - tipc: re-fetch skb cb after tipc_msg_validate - wifi: wilc1000: fix Information Element parsing - packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE - sctp: fix memory leak in sctp_stream_outq_migrate() - can: can327: fix potential skb leak when netdev is down - can: add number of missing netdev freeing on error paths - aquantia: do not purge addresses when setting the number of rings - wwan: iosm: - fix incorrect skb length leading to truncated packet - fix crash in peek throughput test due to skb UAF" * tag 'net-6.1-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (79 commits) net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed MAINTAINERS: Update maintainer list for chelsio drivers ionic: update MAINTAINERS entry sctp: fix memory leak in sctp_stream_outq_migrate() packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE net/mlx5: Lag, Fix for loop when checking lag Revert "net/mlx5e: MACsec, remove replay window size limitation in offload path" net: marvell: prestera: Fix a NULL vs IS_ERR() check in some functions net: tun: Fix use-after-free in tun_detach() net: mdiobus: fix unbalanced node reference count net: hsr: Fix potential use-after-free tipc: re-fetch skb cb after tipc_msg_validate mptcp: fix sleep in atomic at close time mptcp: don't orphan ssk in mptcp_close() dsa: lan9303: Correct stat name ipv4: Fix route deletion when nexthop info is not specified net: wwan: iosm: fix incorrect skb length net: wwan: iosm: fix crash in peek throughput test net: wwan: iosm: fix dma_alloc_coherent incompatible pointer type net: wwan: iosm: fix kernel test robot reported error ... commit 517e6a301f34613bff24a8e35b5455884f2d83d8 Author: Peter Zijlstra Date: Thu Nov 24 12:49:12 2022 +0100 perf: Fix perf_pending_task() UaF Per syzbot it is possible for perf_pending_task() to run after the event is free()'d. There are two related but distinct cases: - the task_work was already queued before destroying the event; - destroying the event itself queues the task_work. The first cannot be solved using task_work_cancel() since perf_release() itself might be called from a task_work (____fput), which means the current->task_works list is already empty and task_work_cancel() won't be able to find the perf_pending_task() entry. The simplest alternative is extending the perf_event lifetime to cover the task_work. The second is just silly, queueing a task_work while you know the event is going away makes no sense and is easily avoided by re-arranging how the event is marked STATE_DEAD and ensuring it goes through STATE_OFF on the way down. Reported-by: syzbot+9228d6098455bb209ec8@syzkaller.appspotmail.com Signed-off-by: Peter Zijlstra (Intel) Tested-by: Marco Elver commit d66233a312ec9013af3e37e4030b479a20811ec3 Author: Yoshihiro Shimoda Date: Mon Nov 28 15:56:04 2022 +0900 net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed After system resumed on some environment board, the promiscuous mode is disabled because the SoC turned off. So, call ravb_set_rx_mode() in the ravb_resume() to fix the issue. Reported-by: Tho Vu Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Pavan Chebbi Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20221128065604.1864391-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Jakub Kicinski commit 178833f99f587e9de9c888c38d82521dcfda12f0 Author: Ayush Sawal Date: Tue Nov 29 04:43:48 2022 +0530 MAINTAINERS: Update maintainer list for chelsio drivers This updates the maintainers for chelsio inline crypto drivers and chelsio crypto drivers. Signed-off-by: Ayush Sawal Link: https://lore.kernel.org/r/20221128231348.8225-1-ayush.sawal@chelsio.com Signed-off-by: Jakub Kicinski commit 91a2bbfff3e3c64b3e1aa3ad04381d0572b3d543 Author: Shannon Nelson Date: Mon Nov 28 17:17:34 2022 -0800 ionic: update MAINTAINERS entry Now that Pensando is a part of AMD we need to update a couple of addresses. We're keeping the mailing list address for the moment, but that will likely change in the near future. Signed-off-by: Shannon Nelson Signed-off-by: Brett Creeley Link: https://lore.kernel.org/r/20221129011734.20849-1-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 9ed7bfc79542119ac0a9e1ce8a2a5285e43433e9 Author: Zhengchao Shao Date: Sat Nov 26 11:17:20 2022 +0800 sctp: fix memory leak in sctp_stream_outq_migrate() When sctp_stream_outq_migrate() is called to release stream out resources, the memory pointed to by prio_head in stream out is not released. The memory leak information is as follows: unreferenced object 0xffff88801fe79f80 (size 64): comm "sctp_repo", pid 7957, jiffies 4294951704 (age 36.480s) hex dump (first 32 bytes): 80 9f e7 1f 80 88 ff ff 80 9f e7 1f 80 88 ff ff ................ 90 9f e7 1f 80 88 ff ff 90 9f e7 1f 80 88 ff ff ................ backtrace: [] kmalloc_trace+0x26/0x60 [] sctp_sched_prio_set+0x4cc/0x770 [] sctp_stream_init_ext+0xd2/0x1b0 [] sctp_sendmsg_to_asoc+0x1614/0x1a30 [] sctp_sendmsg+0xda1/0x1ef0 [] inet_sendmsg+0x9d/0xe0 [] sock_sendmsg+0xd3/0x120 [] __sys_sendto+0x23a/0x340 [] __x64_sys_sendto+0xe1/0x1b0 [] do_syscall_64+0x39/0xb0 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd Link: https://syzkaller.appspot.com/bug?exrid=29c402e56c4760763cc0 Fixes: 637784ade221 ("sctp: introduce priority based stream scheduler") Reported-by: syzbot+29c402e56c4760763cc0@syzkaller.appspotmail.com Signed-off-by: Zhengchao Shao Reviewed-by: Xin Long Link: https://lore.kernel.org/r/20221126031720.378562-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit b85f628aa158a653c006e9c1405a117baef8c868 Author: Willem de Bruijn Date: Mon Nov 28 11:18:12 2022 -0500 packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE CHECKSUM_COMPLETE signals that skb->csum stores the sum over the entire packet. It does not imply that an embedded l4 checksum field has been validated. Fixes: 682f048bd494 ("af_packet: pass checksum validation status to the user") Signed-off-by: Willem de Bruijn Link: https://lore.kernel.org/r/20221128161812.640098-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit 0e682f04b4b59eac0b0a030251513589c4607458 Author: Chris Mi Date: Tue Nov 29 01:30:06 2022 -0800 net/mlx5: Lag, Fix for loop when checking lag The cited commit adds a for loop to check if each port supports lag or not. But dev is not initialized correctly. Fix it by initializing dev for each iteration. Fixes: e87c6a832f88 ("net/mlx5: E-switch, Fix duplicate lag creation") Signed-off-by: Chris Mi Reported-by: Jacob Keller Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221129093006.378840-2-saeed@kernel.org Signed-off-by: Jakub Kicinski commit dda3bbbb26c823cd54d5bf211df7db12147c9392 Author: Saeed Mahameed Date: Tue Nov 29 01:30:05 2022 -0800 Revert "net/mlx5e: MACsec, remove replay window size limitation in offload path" This reverts commit c0071be0e16c461680d87b763ba1ee5e46548fde. The cited commit removed the validity checks which initialized the window_sz and never removed the use of the now uninitialized variable, so now we are left with wrong value in the window size and the following clang warning: [-Wuninitialized] drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c:232:45: warning: variable 'window_sz' is uninitialized when used here MLX5_SET(macsec_aso, aso_ctx, window_size, window_sz); Revet at this time to address the clang issue due to lack of time to test the proper solution. Fixes: c0071be0e16c ("net/mlx5e: MACsec, remove replay window size limitation in offload path") Signed-off-by: Saeed Mahameed Reported-by: Jacob Keller Link: https://lore.kernel.org/r/20221129093006.378840-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit da0cbf9307a227f52a38a0a580a4642ad9d7325c Merge: b7b275e60bcd5 6a3fc8c330d1c Author: Arnd Bergmann Date: Tue Nov 29 15:45:36 2022 +0100 Merge tag 'at91-fixes-6.1-3' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 6.1 #3 It contains: - build fix for SAMA5D3 devices which don't have an L2 cache and due to this accesssing outer_cache.write_sec in sama5_secure_cache_init() could throw undefined reference to `outer_cache' if CONFIG_OUTER_CACHE is disabled from common sama5_defconfig. * tag 'at91-fixes-6.1-3' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: fix build for SAMA5D3 w/o L2 cache Link: https://lore.kernel.org/r/20221125093521.382105-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit 1e24c54da257ab93cff5826be8a793b014a5dc9c Author: Hauke Mehrtens Date: Mon Nov 21 01:22:01 2022 +0100 ca8210: Fix crash by zero initializing data The struct cas_control embeds multiple generic SPI structures and we have to make sure these structures are initialized to default values. This driver does not set all attributes. When using kmalloc before some attributes were not initialized and contained random data which caused random crashes at bootup. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Hauke Mehrtens Link: https://lore.kernel.org/r/20221121002201.1339636-1-hauke@hauke-m.de Signed-off-by: Stefan Schmidt commit 4d002d6a2a00ac1c433899bd7625c6400a74cfba Author: Ziyang Xuan Date: Sun Nov 20 15:50:46 2022 +0800 ieee802154: cc2520: Fix error return code in cc2520_hw_init() In cc2520_hw_init(), if oscillator start failed, the error code should be returned. Fixes: 0da6bc8cc341 ("ieee802154: cc2520: adds driver for TI CC2520 radio") Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/r/20221120075046.2213633-1-william.xuanziyang@huawei.com Signed-off-by: Stefan Schmidt commit c981cdfb9925f64a364f13c2b4f98f877308a408 Author: Adrian Hunter Date: Mon Nov 28 15:32:56 2022 +0200 mmc: sdhci: Fix voltage switch delay Commit 20b92a30b561 ("mmc: sdhci: update signal voltage switch code") removed voltage switch delays from sdhci because mmc core had been enhanced to support them. However that assumed that sdhci_set_ios() did a single clock change, which it did not, and so the delays in mmc core, which should have come after the first clock change, were not effective. Fix by avoiding re-configuring UHS and preset settings when the clock is turning on and the settings have not changed. That then also avoids the associated clock changes, so that then sdhci_set_ios() does a single clock change when voltage switching, and the mmc core delays become effective. To do that has meant keeping track of driver strength (host->drv_type), and cases of reinitialization (host->reinit_uhs). Note also, the 'turning_on_clk' restriction should not be necessary but is done to minimize the impact of the change on stable kernels. Fixes: 20b92a30b561 ("mmc: sdhci: update signal voltage switch code") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Link: https://lore.kernel.org/r/20221128133259.38305-2-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit c61bfb1cb63ddab52b31cf5f1924688917e61fad Author: Gaosheng Cui Date: Fri Nov 25 17:01:41 2022 +0800 mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse() The clk_disable_unprepare() should be called in the error handling of devm_clk_bulk_get_optional, fix it by replacing devm_clk_get_optional and clk_prepare_enable by devm_clk_get_optional_enabled. Fixes: f5eccd94b63f ("mmc: mediatek: Add subsys clock control for MT8192 msdc") Signed-off-by: Gaosheng Cui Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221125090141.3626747-1-cuigaosheng1@huawei.com Signed-off-by: Ulf Hansson commit e493bec343fa76e95631d0e21fd4a3538aa90c56 Author: Shang XiaoJing Date: Fri Nov 25 09:27:51 2022 +0800 net: marvell: prestera: Fix a NULL vs IS_ERR() check in some functions rhashtable_lookup_fast() returns NULL when failed instead of error pointer. Fixes: 396b80cb5cc8 ("net: marvell: prestera: Add neighbour cache accounting") Fixes: 0a23ae237171 ("net: marvell: prestera: Add router nexthops ABI") Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20221125012751.23249-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni commit 5daadc86f27ea4d691e2131c04310d0418c6cd12 Author: Shigeru Yoshida Date: Fri Nov 25 02:51:34 2022 +0900 net: tun: Fix use-after-free in tun_detach() syzbot reported use-after-free in tun_detach() [1]. This causes call trace like below: ================================================================== BUG: KASAN: use-after-free in notifier_call_chain+0x1ee/0x200 kernel/notifier.c:75 Read of size 8 at addr ffff88807324e2a8 by task syz-executor.0/3673 CPU: 0 PID: 3673 Comm: syz-executor.0 Not tainted 6.1.0-rc5-syzkaller-00044-gcc675d22e422 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x461 mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 notifier_call_chain+0x1ee/0x200 kernel/notifier.c:75 call_netdevice_notifiers_info+0x86/0x130 net/core/dev.c:1942 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] netdev_wait_allrefs_any net/core/dev.c:10237 [inline] netdev_run_todo+0xbc6/0x1100 net/core/dev.c:10351 tun_detach drivers/net/tun.c:704 [inline] tun_chr_close+0xe4/0x190 drivers/net/tun.c:3467 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xb3d/0x2a30 kernel/exit.c:820 do_group_exit+0xd4/0x2a0 kernel/exit.c:950 get_signal+0x21b1/0x2440 kernel/signal.c:2858 arch_do_signal_or_restart+0x86/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The cause of the issue is that sock_put() from __tun_detach() drops last reference count for struct net, and then notifier_call_chain() from netdev_state_change() accesses that struct net. This patch fixes the issue by calling sock_put() from tun_detach() after all necessary accesses for the struct net has done. Fixes: 83c1f36f9880 ("tun: send netlink notification when the device is modified") Reported-by: syzbot+106f9b687cd64ee70cd1@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=96eb7f1ce75ef933697f24eeab928c4a716edefe [1] Signed-off-by: Shigeru Yoshida Link: https://lore.kernel.org/r/20221124175134.1589053-1-syoshida@redhat.com Signed-off-by: Paolo Abeni commit 7e3bba93f42e9d9abe81344bdba5ddc635b7c449 Merge: b7b275e60bcd5 0dd4cdccdab3d Author: Paolo Bonzini Date: Tue Nov 29 04:15:33 2022 -0500 Merge tag 'kvm-s390-master-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD VSIE epdx shadowing fix commit 12b8b046e4c9de40fa59b6f067d6826f4e688f68 Author: Janusz Krzysztofik Date: Mon Nov 21 15:56:55 2022 +0100 drm/i915: Never return 0 if not all requests retired Users of intel_gt_retire_requests_timeout() expect 0 return value on success. However, we have no protection from passing back 0 potentially returned by a call to dma_fence_wait_timeout() when it succedes right after its timeout has expired. Replace 0 with -ETIME before potentially using the timeout value as return code, so -ETIME is returned if there are still some requests not retired after timeout, 0 otherwise. v3: Use conditional expression, more compact but also better reflecting intention standing behind the change. v2: Move the added lines down so flush_submission() is not affected. Fixes: f33a8a51602c ("drm/i915: Merge wait_for_timelines with retire_request") Signed-off-by: Janusz Krzysztofik Reviewed-by: Andrzej Hajda Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20221121145655.75141-3-janusz.krzysztofik@linux.intel.com (cherry picked from commit f301a29f143760ce8d3d6b6a8436d45d3448cde6) Signed-off-by: Tvrtko Ursulin commit a8899b8728013c7b2456f0bfa20e5fea85ee0fd1 Author: Janusz Krzysztofik Date: Mon Nov 21 15:56:54 2022 +0100 drm/i915: Fix negative value passed as remaining time Commit b97060a99b01 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC") extended the API of intel_gt_retire_requests_timeout() with an extra argument 'remaining_timeout', intended for passing back unconsumed portion of requested timeout when 0 (success) is returned. However, when request retirement happens to succeed despite an error returned by a call to dma_fence_wait_timeout(), that error code (a negative value) is passed back instead of remaining time. If we then pass that negative value forward as requested timeout to intel_uc_wait_for_idle(), an explicit BUG will be triggered. If request retirement succeeds but an error code is passed back via remaininig_timeout, we may have no clue on how much of the initial timeout might have been left for spending it on waiting for GuC to become idle. OTOH, since all pending requests have been successfully retired, that error code has been already ignored by intel_gt_retire_requests_timeout(), then we shouldn't fail. Assume no more time has been left on error and pass 0 timeout value to intel_uc_wait_for_idle() to give it a chance to return success if GuC is already idle. v3: Don't fail on any error passed back via remaining_timeout. v2: Fix the issue on the caller side, not the provider. Fixes: b97060a99b01 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC") Signed-off-by: Janusz Krzysztofik Cc: stable@vger.kernel.org # v5.15+ Reviewed-by: Andrzej Hajda Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20221121145655.75141-2-janusz.krzysztofik@linux.intel.com (cherry picked from commit f235dbd5b768e238d365fd05d92de5a32abc1c1f) Signed-off-by: Tvrtko Ursulin commit 3c1ea6a5f4f55d4e376675dda16945eb5d9bb4de Author: Ville Syrjälä Date: Fri Nov 18 20:52:01 2022 +0200 drm/i915: Remove non-existent pipes from bigjoiner pipe mask bigjoiner_pipes() doesn't consider that: - RKL only has three pipes - some pipes may be fused off This means that intel_atomic_check_bigjoiner() won't reject all configurations that would need a non-existent pipe. Instead we just keep on rolling witout actually having reserved the slave pipe we need. It's possible that we don't outright explode anywhere due to this since eg. for_each_intel_crtc_in_pipe_mask() will only walk the crtcs we've registered even though the passed in pipe_mask asks for more of them. But clearly the thing won't do what is expected of it when the required pipes are not present. Fix the problem by consulting the device info pipe_mask already in bigjoiner_pipes(). Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221118185201.10469-1-ville.syrjala@linux.intel.com Reviewed-by: Arun R Murthy (cherry picked from commit f1c87a94a1087a26f41007ee83264033007421b5) Signed-off-by: Tvrtko Ursulin commit 2f3830544a89af2e72e7fd3d6ca44dd9cffec197 Author: Radhakrishna Sripada Date: Thu Nov 17 13:30:14 2022 -0800 drm/i915/mtl: Fix dram info readout MEM_SS_INFO_GLOBAL Register info read from the hardware is cached in val. However the variable is being modified when determining the DRAM type thereby clearing out the channels and qgv info extracted later in the function xelpdp_get_dram_info. Preserve the register value and use extracted fields in the switch statement. Fixes: 825477e77912 ("drm/i915/mtl: Obtain SAGV values from MMIO instead of GT pcode mailbox") Cc: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20221117213015.584417-1-radhakrishna.sripada@intel.com (cherry picked from commit ec35c41d91052a3a15dd3767075620af448b8030) Signed-off-by: Tvrtko Ursulin commit ca57f02295f188d6c65ec02202402979880fa6d8 Author: David Howells Date: Mon Nov 28 22:02:56 2022 +0000 afs: Fix fileserver probe RTT handling The fileserver probing code attempts to work out the best fileserver to use for a volume by retrieving the RTT calculated by AF_RXRPC for the probe call sent to each server and comparing them. Sometimes, however, no RTT estimate is available and rxrpc_kernel_get_srtt() returns false, leading good fileservers to be given an RTT of UINT_MAX and thus causing the rotation algorithm to ignore them. Fix afs_select_fileserver() to ignore rxrpc_kernel_get_srtt()'s return value and just take the estimated RTT it provides - which will be capped at 1 second. Fixes: 1d4adfaf6574 ("rxrpc: Make rxrpc_kernel_get_srtt() indicate validity") Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/166965503999.3392585.13954054113218099395.stgit@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds commit cdde1560118f82498fc9e9a7c1ef7f0ef7755891 Author: Yang Yingliang Date: Thu Nov 24 23:01:30 2022 +0800 net: mdiobus: fix unbalanced node reference count I got the following report while doing device(mscc-miim) load test with CONFIG_OF_UNITTEST and CONFIG_OF_DYNAMIC enabled: OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /spi/soc@0/mdio@7107009c/ethernet-phy@0 If the 'fwnode' is not an acpi node, the refcount is get in fwnode_mdiobus_phy_device_register(), but it has never been put when the device is freed in the normal path. So call fwnode_handle_put() in phy_device_release() to avoid leak. If it's an acpi node, it has never been get, but it's put in the error path, so call fwnode_handle_get() before phy_device_register() to keep get/put operation balanced. Fixes: bc1bee3b87ee ("net: mdiobus: Introduce fwnode_mdiobus_register_phy()") Signed-off-by: Yang Yingliang Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221124150130.609420-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 7e177d32442b7ed08a9fa61b61724abc548cb248 Author: YueHaibing Date: Fri Nov 25 15:57:24 2022 +0800 net: hsr: Fix potential use-after-free The skb is delivered to netif_rx() which may free it, after calling this, dereferencing skb may trigger use-after-free. Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20221125075724.27912-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 3067bc61fcfe3081bf4807ce65560f499e895e77 Author: Xin Long Date: Fri Nov 25 12:46:43 2022 -0500 tipc: re-fetch skb cb after tipc_msg_validate As the call trace shows, the original skb was freed in tipc_msg_validate(), and dereferencing the old skb cb would cause an use-after-free crash. BUG: KASAN: use-after-free in tipc_crypto_rcv_complete+0x1835/0x2240 [tipc] Call Trace: tipc_crypto_rcv_complete+0x1835/0x2240 [tipc] tipc_crypto_rcv+0xd32/0x1ec0 [tipc] tipc_rcv+0x744/0x1150 [tipc] ... Allocated by task 47078: kmem_cache_alloc_node+0x158/0x4d0 __alloc_skb+0x1c1/0x270 tipc_buf_acquire+0x1e/0xe0 [tipc] tipc_msg_create+0x33/0x1c0 [tipc] tipc_link_build_proto_msg+0x38a/0x2100 [tipc] tipc_link_timeout+0x8b8/0xef0 [tipc] tipc_node_timeout+0x2a1/0x960 [tipc] call_timer_fn+0x2d/0x1c0 ... Freed by task 47078: tipc_msg_validate+0x7b/0x440 [tipc] tipc_crypto_rcv_complete+0x4b5/0x2240 [tipc] tipc_crypto_rcv+0xd32/0x1ec0 [tipc] tipc_rcv+0x744/0x1150 [tipc] This patch fixes it by re-fetching the skb cb from the new allocated skb after calling tipc_msg_validate(). Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Reported-by: Shuang Li Signed-off-by: Xin Long Link: https://lore.kernel.org/r/1b1cdba762915325bd8ef9a98d0276eb673df2a5.1669398403.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit ce2e1c6d909285a3e05949f1ab7943153e194842 Merge: 39f59bca275d2 b4f166651d03b Author: Jakub Kicinski Date: Mon Nov 28 18:03:11 2022 -0800 Merge branch 'mptcp-more-fixes-for-6-1' Matthieu Baerts says: ==================== mptcp: More fixes for 6.1 Patch 1 makes sure data received after a close will still be processed and acked as exepected. This is a regression for a commit introduced in v5.11. Patch 2 fixes a kernel deadlock found when working on validating TFO with a listener MPTCP socket. This is not directly linked to TFO but it is easier to reproduce the issue with it. This fixes a bug introduced by a commit from v6.0. ==================== Link: https://lore.kernel.org/r/20221128154239.1999234-1-matthieu.baerts@tessares.net Signed-off-by: Jakub Kicinski commit b4f166651d03b5484fa179817ba8ad4899a5a6ac Author: Paolo Abeni Date: Mon Nov 28 16:42:38 2022 +0100 mptcp: fix sleep in atomic at close time Matt reported a splat at msk close time: BUG: sleeping function called from invalid context at net/mptcp/protocol.c:2877 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 155, name: packetdrill preempt_count: 201, expected: 0 RCU nest depth: 0, expected: 0 4 locks held by packetdrill/155: #0: ffff888001536990 (&sb->s_type->i_mutex_key#6){+.+.}-{3:3}, at: __sock_release (net/socket.c:650) #1: ffff88800b498130 (sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close (net/mptcp/protocol.c:2973) #2: ffff88800b49a130 (sk_lock-AF_INET/1){+.+.}-{0:0}, at: __mptcp_close_ssk (net/mptcp/protocol.c:2363) #3: ffff88800b49a0b0 (slock-AF_INET){+...}-{2:2}, at: __lock_sock_fast (include/net/sock.h:1820) Preemption disabled at: 0x0 CPU: 1 PID: 155 Comm: packetdrill Not tainted 6.1.0-rc5 #365 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: dump_stack_lvl (lib/dump_stack.c:107 (discriminator 4)) __might_resched.cold (kernel/sched/core.c:9891) __mptcp_destroy_sock (include/linux/kernel.h:110) __mptcp_close (net/mptcp/protocol.c:2959) mptcp_subflow_queue_clean (include/net/sock.h:1777) __mptcp_close_ssk (net/mptcp/protocol.c:2363) mptcp_destroy_common (net/mptcp/protocol.c:3170) mptcp_destroy (include/net/sock.h:1495) __mptcp_destroy_sock (net/mptcp/protocol.c:2886) __mptcp_close (net/mptcp/protocol.c:2959) mptcp_close (net/mptcp/protocol.c:2974) inet_release (net/ipv4/af_inet.c:432) __sock_release (net/socket.c:651) sock_close (net/socket.c:1367) __fput (fs/file_table.c:320) task_work_run (kernel/task_work.c:181 (discriminator 1)) exit_to_user_mode_prepare (include/linux/resume_user_mode.h:49) syscall_exit_to_user_mode (kernel/entry/common.c:130) do_syscall_64 (arch/x86/entry/common.c:87) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) We can't call mptcp_close under the 'fast' socket lock variant, replace it with a sock_lock_nested() as the relevant code is already under the listening msk socket lock protection. Reported-by: Matthieu Baerts Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/316 Fixes: 30e51b923e43 ("mptcp: fix unreleased socket in accept queue") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit fe94800184f22d4778628f1321dce5acb7513d84 Author: Menglong Dong Date: Mon Nov 28 16:42:37 2022 +0100 mptcp: don't orphan ssk in mptcp_close() All of the subflows of a msk will be orphaned in mptcp_close(), which means the subflows are in DEAD state. After then, DATA_FIN will be sent, and the other side will response with a DATA_ACK for this DATA_FIN. However, if the other side still has pending data, the data that received on these subflows will not be passed to the msk, as they are DEAD and subflow_data_ready() will not be called in tcp_data_ready(). Therefore, these data can't be acked, and they will be retransmitted again and again, until timeout. Fix this by setting ssk->sk_socket and ssk->sk_wq to 'NULL', instead of orphaning the subflows in __mptcp_close(), as Paolo suggested. Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close") Reviewed-by: Biao Jiang Reviewed-by: Mengen Sun Signed-off-by: Menglong Dong Reviewed-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 39f59bca275d2d819a8788c0f962e9e89843efc9 Author: Jerry Ray Date: Mon Nov 28 13:35:59 2022 -0600 dsa: lan9303: Correct stat name This patch changes the reported ethtool statistics for the lan9303 family of parts covered by this driver. The TxUnderRun statistic label is renamed to RxShort to accurately reflect what stat the device is reporting. I did not reorder the statistics as that might cause problems with existing user code that are expecting the stats at a certain offset. Fixes: a1292595e006 ("net: dsa: add new DSA switch driver for the SMSC-LAN9303") Signed-off-by: Jerry Ray Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221128193559.6572-1-jerry.ray@microchip.com Signed-off-by: Jakub Kicinski commit 02f248ead36a2a559bdbf81e0003cd23acfe9219 Merge: 4f4a5de125391 3e8f7abcc3473 Author: Jakub Kicinski Date: Mon Nov 28 17:58:45 2022 -0800 Merge tag 'wireless-2022-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v6.1 Third, and hopefully final, set of fixes for v6.1. We are marking the rsi driver as orphan, have some Information Element parsing fixes to wilc1000 driver and three small fixes to the stack. * tag 'wireless-2022-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac8021: fix possible oob access in ieee80211_get_rate_duration wifi: cfg80211: don't allow multi-BSSID in S1G wifi: cfg80211: fix buffer overflow in elem comparison wifi: wilc1000: validate number of channels wifi: wilc1000: validate length of IEEE80211_P2P_ATTR_CHANNEL_LIST attribute wifi: wilc1000: validate length of IEEE80211_P2P_ATTR_OPER_CHANNEL attribute wifi: wilc1000: validate pairwise and authentication suite offsets MAINTAINERS: mark rsi wifi driver as orphan ==================== Link: https://lore.kernel.org/r/20221128113513.6F459C433C1@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 4f4a5de1253915c824820107319cfde7990a432f Merge: d5082d386eee7 8be602dadb2fe Author: Jakub Kicinski Date: Mon Nov 28 17:06:51 2022 -0800 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== bpf 2022-11-25 We've added 10 non-merge commits during the last 8 day(s) which contain a total of 7 files changed, 48 insertions(+), 30 deletions(-). The main changes are: 1) Several libbpf ringbuf fixes related to probing for its availability, size overflows when mmaping a 2G ringbuf and rejection of invalid reservationsizes, from Hou Tao. 2) Fix a buggy return pointer in libbpf for attach_raw_tp function, from Jiri Olsa. 3) Fix a local storage BPF map bug where the value's spin lock field can get initialized incorrectly, from Xu Kuohai. 4) Two follow-up fixes in kprobe_multi BPF selftests for BPF CI, from Jiri Olsa. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Make test_bench_attach serial selftests/bpf: Filter out default_idle from kprobe_multi bench bpf: Set and check spin lock value in sk_storage_map_test bpf: Do not copy spin lock field from user in bpf_selem_alloc libbpf: Check the validity of size in user_ring_buffer__reserve() libbpf: Handle size overflow for user ringbuf mmap libbpf: Handle size overflow for ringbuf mmap libbpf: Use page size as max_entries when probing ring buffer map bpf, perf: Use subprog name when reporting subprog ksymbol libbpf: Use correct return pointer in attach_raw_tp ==================== Link: https://lore.kernel.org/r/20221125001034.29473-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit d5082d386eee7e8ec46fa8581932c81a4961dcef Author: Ido Schimmel Date: Thu Nov 24 23:09:32 2022 +0200 ipv4: Fix route deletion when nexthop info is not specified When the kernel receives a route deletion request from user space it tries to delete a route that matches the route attributes specified in the request. If only prefix information is specified in the request, the kernel should delete the first matching FIB alias regardless of its associated FIB info. However, an error is currently returned when the FIB info is backed by a nexthop object: # ip nexthop add id 1 via 192.0.2.2 dev dummy10 # ip route add 198.51.100.0/24 nhid 1 # ip route del 198.51.100.0/24 RTNETLINK answers: No such process Fix by matching on such a FIB info when legacy nexthop attributes are not specified in the request. An earlier check already covers the case where a nexthop ID is specified in the request. Add tests that cover these flows. Before the fix: # ./fib_nexthops.sh -t ipv4_fcnal ... TEST: Delete route when not specifying nexthop attributes [FAIL] Tests passed: 11 Tests failed: 1 After the fix: # ./fib_nexthops.sh -t ipv4_fcnal ... TEST: Delete route when not specifying nexthop attributes [ OK ] Tests passed: 12 Tests failed: 0 No regressions in other tests: # ./fib_nexthops.sh ... Tests passed: 228 Tests failed: 0 # ./fib_tests.sh ... Tests passed: 186 Tests failed: 0 Cc: stable@vger.kernel.org Reported-by: Jonas Gorski Tested-by: Jonas Gorski Fixes: 493ced1ac47c ("ipv4: Allow routes to use nexthop objects") Fixes: 6bf92d70e690 ("net: ipv4: fix route with nexthop object delete warning") Fixes: 61b91eb33a69 ("ipv4: Handle attempt to delete multipath route when fib_info contains an nh reference") Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20221124210932.2470010-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 3f105a742725a1b78766a55169f1d827732e62b8 Author: Alexandre Ghiti Date: Mon Nov 21 14:33:03 2022 +0100 riscv: Sync efi page table's kernel mappings before switching The EFI page table is initially created as a copy of the kernel page table. With VMAP_STACK enabled, kernel stacks are allocated in the vmalloc area: if the stack is allocated in a new PGD (one that was not present at the moment of the efi page table creation or not synced in a previous vmalloc fault), the kernel will take a trap when switching to the efi page table when the vmalloc kernel stack is accessed, resulting in a kernel panic. Fix that by updating the efi kernel mappings before switching to the efi page table. Signed-off-by: Alexandre Ghiti Fixes: b91540d52a08 ("RISC-V: Add EFI runtime services") Tested-by: Emil Renner Berthing Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20221121133303.1782246-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 1d6b5ed41f8c5c7012dbebe9bc0e2292a5a232b4 Author: Samuel Holland Date: Sat Nov 26 00:15:56 2022 -0600 riscv: Fix NR_CPUS range conditions The conditions reference the symbol SBI_V01, which does not exist. The correct symbol is RISCV_SBI_V01. Fixes: e623715f3d67 ("RISC-V: Increase range and default value of NR_CPUS") Signed-off-by: Samuel Holland Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20221126061557.3541-1-samuel@sholland.org Signed-off-by: Palmer Dabbelt commit 4009166c3918ccfbf4daf0790630261153d6b646 Merge: cb525a6513fad 60d865bd5a9b1 Author: Linus Torvalds Date: Mon Nov 28 14:59:17 2022 -0800 Merge tag 'devicetree-fixes-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fix from Rob Herring: - Fix DT node reference counting for of_fwnode_get_reference_args() exit path * tag 'devicetree-fixes-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: property: decrement node refcount in of_fwnode_get_reference_args() commit cb525a6513fad6e28f063f56db0a17e264bc8811 Merge: f35badccddb77 4313e5a613049 Author: Linus Torvalds Date: Mon Nov 28 14:42:29 2022 -0800 Merge tag 'trace-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix osnoise duration type to 64bit not 32bit - Have histogram triggers be able to handle an unexpected NULL pointer for the record event, which can happen when the histogram first starts up - Clear out ring buffers when dynamic events are removed, as the type that is saved in the ring buffer is used to read the event, and a stale type that is reused by another event could cause use after free issues - Trivial comment fix - Fix memory leak in user_event_create() * tag 'trace-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Free buffers when a used dynamic event is removed tracing: Add tracing_reset_all_online_cpus_unlocked() function tracing: Fix race where histograms can be called before the event tracing/osnoise: Fix duration type tracing/user_events: Fix memory leak in user_event_create() tracing/hist: add in missing * in comment blocks commit f35badccddb7727086eb6481c25c5de9eb417db6 Merge: b7b275e60bcd5 44361e8cf9ddb Author: Linus Torvalds Date: Mon Nov 28 13:08:46 2022 -0800 Merge tag 'fuse-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fix from Miklos Szeredi: "Fix a regression introduced in -rc4" * tag 'fuse-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: lock inode unconditionally in fuse_fallocate() commit 6989ea4881c8944fbf04378418bb1af63d875ef8 Author: Andy Shevchenko Date: Fri Nov 25 00:29:26 2022 +0200 pinctrl: intel: Save and restore pins in "direct IRQ" mode The firmware on some systems may configure GPIO pins to be an interrupt source in so called "direct IRQ" mode. In such cases the GPIO controller driver has no idea if those pins are being used or not. At the same time, there is a known bug in the firmwares that don't restore the pin settings correctly after suspend, i.e. by an unknown reason the Rx value becomes inverted. Hence, let's save and restore the pins that are configured as GPIOs in the input mode with GPIROUTIOXAPIC bit set. Cc: stable@vger.kernel.org Reported-and-tested-by: Dale Smith Reported-and-tested-by: John Harris BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214749 Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20221124222926.72326-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit ed14d225cc7c842f6d4d5a3009f71a44f5852d09 Author: Dawei Li Date: Wed Nov 9 23:37:34 2022 +0800 drm/vmwgfx: Fix race issue calling pin_user_pages pin_user_pages() is unsafe without protection of mmap_lock, fix it by calling pin_user_pages_fast(). Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats") Signed-off-by: Dawei Li Reviewed-by: Martin Krastev Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/TYWP286MB23193621CB443E1E1959A00BCA3E9@TYWP286MB2319.JPNP286.PROD.OUTLOOK.COM commit a81047154e7ce4eb8769d5d21adcbc9693542a79 Author: Xin Long Date: Thu Nov 24 12:54:10 2022 -0500 netfilter: flowtable_offload: fix using __this_cpu_add in preemptible flow_offload_queue_work() can be called in workqueue without bh disabled, like the call trace showed in my act_ct testing, calling NF_FLOW_TABLE_STAT_INC() there would cause a call trace: BUG: using __this_cpu_add() in preemptible [00000000] code: kworker/u4:0/138560 caller is flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] Workqueue: act_ct_workqueue tcf_ct_flow_table_cleanup_work [act_ct] Call Trace: dump_stack_lvl+0x33/0x46 check_preemption_disabled+0xc3/0xf0 flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] nf_flow_table_iterate+0x138/0x170 [nf_flow_table] nf_flow_table_free+0x140/0x1a0 [nf_flow_table] tcf_ct_flow_table_cleanup_work+0x2f/0x2b0 [act_ct] process_one_work+0x6a3/0x1030 worker_thread+0x8a/0xdf0 This patch fixes it by using NF_FLOW_TABLE_STAT_INC_ATOMIC() instead in flow_offload_queue_work(). Note that for FLOW_CLS_REPLACE branch in flow_offload_queue_work(), it may not be called in preemptible path, but it's good to use NF_FLOW_TABLE_STAT_INC_ATOMIC() for all cases in flow_offload_queue_work(). Fixes: b038177636f8 ("netfilter: nf_flow_table: count pending offload workqueue tasks") Signed-off-by: Xin Long Signed-off-by: Pablo Neira Ayuso commit 97d4d394b58777f7056ebba8ffdb4002d0563259 Author: Stefano Brivio Date: Thu Nov 24 13:04:37 2022 +0100 netfilter: nft_set_pipapo: Actually validate intervals in fields after the first one Embarrassingly, nft_pipapo_insert() checked for interval validity in the first field only. The start_p and end_p pointers were reset to key data from the first field at every iteration of the loop which was supposed to go over the set fields. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Reported-by: Pablo Neira Ayuso Signed-off-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit f2fc2280faabafc8df83ee007699d21f7a6301fe Merge: 7642cc28fd37a c34ca4f32c24b Author: David S. Miller Date: Mon Nov 28 11:31:59 2022 +0000 Merge branch 'wwan-iosm-fixes' M Chetan Kumar says: ==================== net: wwan: iosm: fix build errors & bugs This patch series fixes iosm driver bugs & build errors. PATCH1: Fix kernel build robot reported error. PATCH2: Fix build error reported on armhf while preparing 6.1-rc5 for Debian. PATCH3: Fix UL throughput crash. PATCH4: Fix incorrect skb length. Refer to commit message for details. Changes since v1: * PATCH4: Fix sparse warning. ==================== Signed-off-by: David S. Miller commit c34ca4f32c24bf748493b49085e43cd714cf8357 Author: M Chetan Kumar Date: Thu Nov 24 16:08:32 2022 +0530 net: wwan: iosm: fix incorrect skb length skb passed to network layer contains incorrect length. In mux aggregation protocol, the datagram block received from device contains block signature, packet & datagram header. The right skb len to be calculated by subracting datagram pad len from datagram length. Whereas in mux lite protocol, the skb contains single datagram so skb len is calculated by subtracting the packet offset from datagram header. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 2290a1d46bf30f9e0bcf49ad20d5c30d0e099989 Author: M Chetan Kumar Date: Thu Nov 24 16:08:17 2022 +0530 net: wwan: iosm: fix crash in peek throughput test Peek throughput UL test is resulting in crash. If the UL transfer block free list is exhaust, the peeked skb is freed. In the next transfer freed skb is referred from UL list which results in crash. Don't free the skb if UL transfer blocks are unavailable. The pending skb will be picked for transfer on UL transfer block available. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 4a99e3c8ed888577b947cbed97d88c9706896105 Author: M Chetan Kumar Date: Thu Nov 24 16:08:03 2022 +0530 net: wwan: iosm: fix dma_alloc_coherent incompatible pointer type Fix build error reported on armhf while preparing 6.1-rc5 for Debian. iosm_ipc_protocol.c:244:36: error: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type. Change phy_ap_shm type from phys_addr_t to dma_addr_t. Fixes: faed4c6f6f48 ("net: iosm: shared memory protocol") Reported-by: Bonaccorso Salvatore Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 985a02e75881b73a43c9433a718b49d272a9dd6b Author: M Chetan Kumar Date: Thu Nov 24 16:07:46 2022 +0530 net: wwan: iosm: fix kernel test robot reported error sparse warnings - iosm_ipc_mux_codec.c:1474 using plain integer as NULL pointer. Use skb_trim() to reset skb tail & len. Fixes: 9413491e20e1 ("net: iosm: encode or decode datagram") Reported-by: kernel test robot Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 7642cc28fd37a15feacff0ccf0e5a8466630df5d Author: Russell King (Oracle) Date: Thu Nov 24 09:06:48 2022 +0000 net: phylink: fix PHY validation with rate adaption Tim Harvey reports that link modes which he does not expect to be supported are being advertised, and this is because of the workaround we have for PHYs that switch interface modes. Fix this up by checking whether rate matching will be used for the requested interface mode, and if rate matching will be used, perform validation only with the requested interface mode, rather than invoking this workaround. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 9256db4e45e8b497b0e993cc3ed4ad08eb2389b6 Author: Yuri Karpov Date: Thu Nov 24 11:43:03 2022 +0300 net: ethernet: nixge: fix NULL dereference In function nixge_hw_dma_bd_release() dereference of NULL pointer priv->rx_bd_v is possible for the case of its allocation failure in nixge_hw_dma_bd_init(). Move for() loop with priv->rx_bd_v dereference under the check for its validity. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev") Signed-off-by: Yuri Karpov Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit dcc14cfd7debe11b825cb077e75d91d2575b4cb8 Author: Wang Hai Date: Thu Nov 24 16:10:05 2022 +0800 net/9p: Fix a potential socket leak in p9_socket_open Both p9_fd_create_tcp() and p9_fd_create_unix() will call p9_socket_open(). If the creation of p9_trans_fd fails, p9_fd_create_tcp() and p9_fd_create_unix() will return an error directly instead of releasing the cscoket, which will result in a socket leak. This patch adds sock_release() to fix the leak issue. Fixes: 6b18662e239a ("9p connect fixes") Signed-off-by: Wang Hai ACKed-by: Al Viro Signed-off-by: David S. Miller commit b8f79dccd38edf7db4911c353d9cd792ab13a327 Author: Yuan Can Date: Thu Nov 24 07:09:17 2022 +0000 net: net_netdev: Fix error handling in ntb_netdev_init_module() The ntb_netdev_init_module() returns the ntb_transport_register_client() directly without checking its return value, if ntb_transport_register_client() failed, the NTB client device is not unregistered. Fix by unregister NTB client device when ntb_transport_register_client() failed. Fixes: 548c237c0a99 ("net: Add support for NTB virtual ethernet device") Signed-off-by: Yuan Can Signed-off-by: David S. Miller commit 46fb6512538d201d9a5b2bd7138b6751c37fdf0b Author: Zhang Changzhong Date: Thu Nov 24 11:03:08 2022 +0800 net: ethernet: ti: am65-cpsw: fix error handling in am65_cpsw_nuss_probe() The am65_cpsw_nuss_cleanup_ndev() function calls unregister_netdev() even if register_netdev() fails, which triggers WARN_ON(1) in unregister_netdevice_many(). To fix it, make sure that unregister_netdev() is called only on registered netdev. Compile tested only. Fixes: 84b4aa493249 ("net: ethernet: ti: am65-cpsw: add multi port support in mac-only mode") Signed-off-by: Zhang Changzhong Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit 763465e6fb5b0d5a4d4e7ec48399c6f662383271 Merge: 1f605d6d10c05 9034b29251818 Author: David S. Miller Date: Mon Nov 28 10:56:19 2022 +0000 Merge tag 'mlx5-fixes-2022-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-fixes-2022-11-24 This series provides bug fixes to mlx5 driver. Focusing on error handling and proper memory management in mlx5, in general and in the newly added macsec module. I still have few fixes left in my queue and I hope those will be the last ones for mlx5 for this cycle. Please pull and let me know if there is any problem. Happy thanksgiving. ==================== Signed-off-by: David S. Miller commit 1f605d6d10c0514cdb15d05133e038a9a143f18d Merge: 369eb2c9f1f72 45605c75c52c7 Author: David S. Miller Date: Mon Nov 28 09:23:10 2022 +0000 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-11-23 (ixgbevf, i40e, fm10k, iavf, e100) This series contains updates to various Intel drivers. Shang XiaoJing fixes init module error path stop to resource leaks for ixgbevf and i40e. Yuan Can also does the same for fm10k and iavf. Wang Hai stops freeing of skb as it was causing use after free error for e100. ==================== Signed-off-by: David S. Miller commit ec851b23084b3a0af8bf0f5e51d33a8d678bdc49 Author: Zeng Heng Date: Fri Nov 25 22:07:57 2022 +0100 gpiolib: fix memory leak in gpiochip_setup_dev() Here is a backtrace report about memory leak detected in gpiochip_setup_dev(): unreferenced object 0xffff88810b406400 (size 512): comm "python3", pid 1682, jiffies 4295346908 (age 24.090s) backtrace: kmalloc_trace device_add device_private_init at drivers/base/core.c:3361 (inlined by) device_add at drivers/base/core.c:3411 cdev_device_add gpiolib_cdev_register gpiochip_setup_dev gpiochip_add_data_with_key gcdev_register() & gcdev_unregister() would call device_add() & device_del() (no matter CONFIG_GPIO_CDEV is enabled or not) to register/unregister device. However, if device_add() succeeds, some resource (like struct device_private allocated by device_private_init()) is not released by device_del(). Therefore, after device_add() succeeds by gcdev_register(), it needs to call put_device() to release resource in the error handle path. Here we move forward the register of release function, and let it release every piece of resource by put_device() instead of kfree(). While at it, fix another subtle issue, i.e. when gc->ngpio is equal to 0, we still call kcalloc() and, in case of further error, kfree() on the ZERO_PTR pointer, which is not NULL. It's not a bug per se, but rather waste of the resources and potentially wrong expectation about contents of the gdev->descs variable. Fixes: 159f3cd92f17 ("gpiolib: Defer gpio device setup until after gpiolib initialization") Signed-off-by: Zeng Heng Co-developed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit b7b275e60bcd5f89771e865a8239325f86d9927d Author: Linus Torvalds Date: Sun Nov 27 13:31:48 2022 -0800 Linux 6.1-rc7 commit cf562a45a0d57fb0333363c9d4ff82d061898355 Merge: 9066e1518645a 10bc8e4af6594 Author: Linus Torvalds Date: Sun Nov 27 12:40:06 2022 -0800 Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs fix from Al Viro: "Amir's copy_file_range() fix" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: fix copy_file_range() averts filesystem freeze protection commit 9066e1518645a6c754709e44c3f58dc6a76a6d21 Merge: db3182484f9fb 7a21b27aafa3e Author: Linus Torvalds Date: Sun Nov 27 12:30:57 2022 -0800 Merge tag 'usb-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB fixes for 6.1-rc7 that resolve some reported problems: - cdnsp driver fixes for reported problems - dwc3 fixes for some small reported problems - uvc gadget driver fix for reported regression All of these have been in linux-next with no reported problems" * tag 'usb-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: cdnsp: fix issue with ZLP - added TD_SIZE = 1 usb: dwc3: gadget: Clear ep descriptor last usb: dwc3: exynos: Fix remove() function usb: cdnsp: Fix issue with Clear Feature Halt Endpoint usb: dwc3: gadget: Disable GUSB2PHYCFG.SUSPHY for End Transfer usb: gadget: uvc: also use try_format in set_format commit db3182484f9fb472137cc9a3c41b3d69530b40ad Merge: 715d2d960871c 8ac3b5cd3e052 Author: Linus Torvalds Date: Sun Nov 27 12:17:10 2022 -0800 Merge tag 'char-misc-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are some small driver fixes for 6.1-rc7, they include: - build warning fix for the vdso when using new versions of grep - iio driver fixes for reported issues - small nvmem driver fixes - fpga Kconfig fix - interconnect dt binding fix All of these have been in linux-next with no reported issues" * tag 'char-misc-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: lib/vdso: use "grep -E" instead of "egrep" nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear() nvmem: rmem: Fix return value check in rmem_read() fpga: m10bmc-sec: Fix kconfig dependencies dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" iio: adc: aspeed: Remove the trim valid dts property. iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails iio: accel: bma400: Fix memory leak in bma400_get_steps_reg() iio: light: rpr0521: add missing Kconfig dependencies iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw iio: health: afe4403: Fix oob read in afe4403_read_raw iio: light: apds9960: fix wrong register for gesture gain dt-bindings: interconnect: qcom,msm8998-bwmon: Correct SC7280 CPU compatible commit 715d2d960871c238e5860d121ba9735e7f6a7ff1 Merge: b465cf1773770 839a973988a94 Author: Linus Torvalds Date: Sun Nov 27 12:11:00 2022 -0800 Merge tag 'timers_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Borislav Petkov: - Return the proper timer register width (31 bits) for a 32-bit signed register in order to avoid a timer interrupt storm on ARM XGene-1 hardware running in NO_HZ mode * tag 'timers_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error commit b465cf177377033f939224d8f16b5b1dddcd9709 Merge: 08b0644126798 2d77de1581bb5 Author: Linus Torvalds Date: Sun Nov 27 12:08:17 2022 -0800 Merge tag 'objtool_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fix from Borislav Petkov: - Handle different output of readelf on different distros running ppc64le which confuses faddr2line's function offsets conversion * tag 'objtool_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: scripts/faddr2line: Fix regression in name resolution on ppc64le commit 08b06441267984d2e42cefc1dfb587e2d2d8512d Merge: 5afcab22179e4 4dbd6a3e90e03 Author: Linus Torvalds Date: Sun Nov 27 11:59:14 2022 -0800 Merge tag 'x86_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - ioremap: mask out the bits which are not part of the physical address *after* the size computation is done to prevent any hypothetical ioremap failures - Change the MSR save/restore functionality during suspend to rely on flags denoting that the related MSRs are actually supported vs reading them and assuming they are (an Atom one allows reading but not writing, thus breaking this scheme at resume time) - prevent IV reuse in the AES-GCM communication scheme between SNP guests and the AMD secure processor * tag 'x86_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ioremap: Fix page aligned size calculation in __ioremap_caller() x86/pm: Add enumeration check before spec MSRs save/restore setup x86/tsx: Add a feature bit for TSX control MSR support virt/sev-guest: Prevent IV reuse in the SNP guest driver commit 5afcab22179e4b4668e2df4759cfd71f09d2b503 Merge: bf82d38c91f85 030a976efae83 Author: Linus Torvalds Date: Sun Nov 27 11:53:41 2022 -0800 Merge tag 'perf_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: "Two more fixes to the perf sigtrap handling: - output the address in the sample only when it has been requested - handle the case where user-only events can hit in kernel and thus upset the sigtrap sanity checking" * tag 'perf_urgent_for_v6.1_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Consider OS filter fail perf: Fixup SIGTRAP and sample_flags interaction commit 369eb2c9f1f72adbe91e0ea8efb130f0a2ba11a6 Author: Yang Yingliang Date: Wed Nov 23 21:28:08 2022 +0800 net: phy: fix null-ptr-deref while probe() failed I got a null-ptr-deref report as following when doing fault injection test: BUG: kernel NULL pointer dereference, address: 0000000000000058 Oops: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 1 PID: 253 Comm: 507-spi-dm9051 Tainted: G B N 6.1.0-rc3+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:klist_put+0x2d/0xd0 Call Trace: klist_remove+0xf1/0x1c0 device_release_driver_internal+0x23e/0x2d0 bus_remove_device+0x1bd/0x240 device_del+0x357/0x770 phy_device_remove+0x11/0x30 mdiobus_unregister+0xa5/0x140 release_nodes+0x6a/0xa0 devres_release_all+0xf8/0x150 device_unbind_cleanup+0x19/0xd0 //probe path: phy_device_register() device_add() phy_connect phy_attach_direct() //set device driver probe() //it's failed, driver is not bound device_bind_driver() // probe failed, it's not called //remove path: phy_device_remove() device_del() device_release_driver_internal() __device_release_driver() //dev->drv is not NULL klist_remove() <- knode_driver is not added yet, cause null-ptr-deref In phy_attach_direct(), after setting the 'dev->driver', probe() fails, device_bind_driver() is not called, so the knode_driver->n_klist is not set, then it causes null-ptr-deref in __device_release_driver() while deleting device. Fix this by setting dev->driver to NULL in the error path in phy_attach_direct(). Fixes: e13934563db0 ("[PATCH] PHY Layer fixup") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit bf82d38c91f857083f2d1b9770fa3df55db2ca3b Merge: 30a853c1bdede fe08e36be9ecb Author: Linus Torvalds Date: Sun Nov 27 09:08:40 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - Fixes for Xen emulation. While nobody should be enabling it in the kernel (the only public users of the feature are the selftests), the bug effectively allows userspace to read arbitrary memory. - Correctness fixes for nested hypervisors that do not intercept INIT or SHUTDOWN on AMD; the subsequent CPU reset can cause a use-after-free when it disables virtualization extensions. While downgrading the panic to a WARN is quite easy, the full fix is a bit more laborious; there are also tests. This is the bulk of the pull request. - Fix race condition due to incorrect mmu_lock use around make_mmu_pages_available(). Generic: - Obey changes to the kvm.halt_poll_ns module parameter in VMs not using KVM_CAP_HALT_POLL, restoring behavior from before the introduction of the capability" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: Update gfn_to_pfn_cache khva when it moves within the same page KVM: x86/xen: Only do in-kernel acceleration of hypercalls for guest CPL0 KVM: x86/xen: Validate port number in SCHEDOP_poll KVM: x86/mmu: Fix race condition in direct_page_fault KVM: x86: remove exit_int_info warning in svm_handle_exit KVM: selftests: add svm part to triple_fault_test KVM: x86: allow L1 to not intercept triple fault kvm: selftests: add svm nested shutdown test KVM: selftests: move idt_entry to header KVM: x86: forcibly leave nested mode on vCPU reset KVM: x86: add kvm_leave_nested KVM: x86: nSVM: harden svm_free_nested against freeing vmcb02 while still in use KVM: x86: nSVM: leave nested mode on vCPU free KVM: Obey kvm.halt_poll_ns in VMs not using KVM_CAP_HALT_POLL KVM: Avoid re-reading kvm->max_halt_poll_ns during halt-polling KVM: Cap vcpu->halt_poll_ns before halting rather than after commit 30a853c1bdede177adedd2de537ea16158125181 Merge: faf68e3523c21 5024878477430 Author: Linus Torvalds Date: Sun Nov 27 08:48:26 2022 -0800 Merge tag '6.1-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Two small cifs/smb3 client fixes: - an unlock missing in an error path in copychunk_range found by xfstest 476 - a fix for a use after free in a debug code path" * tag '6.1-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix missing unlock in cifs_file_copychunk_range() cifs: Use after free in debug code commit faf68e3523c21d07c5f7fdabd0daf6301ff8db3f Merge: e5f3ec38c8496 869e4ae4cd2a2 Author: Linus Torvalds Date: Sat Nov 26 16:38:56 2022 -0800 Merge tag 'kbuild-fixes-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix CC_HAS_ASM_GOTO_TIED_OUTPUT test in Kconfig - Fix noisy "No such file or directory" message when KBUILD_BUILD_VERSION is passed - Include rust/ in source tarballs - Fix missing FORCE for ARCH=nios2 builds * tag 'kbuild-fixes-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: nios2: add FORCE for vmlinuz.gz scripts: add rust in scripts/Makefile.package kbuild: fix "cat: .version: No such file or directory" init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash commit 869e4ae4cd2a23d625aaa14ae62dbebf768cb77d Author: Randy Dunlap Date: Wed Nov 23 19:20:53 2022 -0800 nios2: add FORCE for vmlinuz.gz Add FORCE to placate a warning from make: arch/nios2/boot/Makefile:24: FORCE prerequisite is missing Fixes: 2fc8483fdcde ("nios2: Build infrastructure") Signed-off-by: Randy Dunlap Reviewed-by: Masahiro Yamada commit e5f3ec38c8496dd7f6ada8a5e8d4958ef46ddb3f Merge: 644e9524388a5 ac8db824ead0d Author: Linus Torvalds Date: Sat Nov 26 12:25:49 2022 -0800 Merge tag 'nfsd-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix rare data corruption on READ operations * tag 'nfsd-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix reads with a non-zero offset that don't end on a page boundary commit 644e9524388a5dbc6d4f58c492ee9ef7bd4ddf4d Merge: 990f320031209 767e684367e47 Author: Linus Torvalds Date: Fri Nov 25 18:02:49 2022 -0800 Merge tag 'for-v6.1-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: - rk817: Two error handling fixes - ip5xxx: fix inter overflow in current calculation - ab8500: fix thermal zone probing * tag 'for-v6.1-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: ab8500: Defer thermal zone probe power: supply: ip5xxx: Fix integer overflow in current_now calculation power: supply: rk817: Change rk817_chg_cur_to_reg to int power: supply: rk817: check correct variable commit 990f320031209ecfdb1bef33798970506d10dae8 Merge: 364eb618348c1 7d4a93176e014 Author: Linus Torvalds Date: Fri Nov 25 17:50:57 2022 -0800 Merge tag 'block-6.1-2022-11-25' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - A few fixes for s390 sads (Stefan, Colin) - Ensure that ublk doesn't reorder requests, as that can be problematic on devices that need specific ordering (Ming) - Fix a queue reference leak in disk allocation handling (Christoph) * tag 'block-6.1-2022-11-25' of git://git.kernel.dk/linux: ublk_drv: don't forward io commands in reserve order s390/dasd: fix possible buffer overflow in copy_pair_show s390/dasd: fix no record found for raw_track_access s390/dasd: increase printing of debug data payload s390/dasd: Fix spelling mistake "Ivalid" -> "Invalid" blk-mq: fix queue reference leak on blk_mq_alloc_disk_for_queue failure commit 364eb618348c1aaebe6ccc102ca15d92c2bf6033 Merge: 3e0d88f911fb6 7cfe7a09489c1 Author: Linus Torvalds Date: Fri Nov 25 17:46:04 2022 -0800 Merge tag 'io_uring-6.1-2022-11-25' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: - A few poll related fixes. One fixing a race condition between poll cancelation and trigger, and one making the overflow handling a bit more robust (Lin, Pavel) - Fix an fput() for error handling in the direct file table (Lin) - Fix for a regression introduced in this cycle, where we don't always get TIF_NOTIFY_SIGNAL cleared appropriately (me) * tag 'io_uring-6.1-2022-11-25' of git://git.kernel.dk/linux: io_uring: clear TIF_NOTIFY_SIGNAL if set and task_work not available io_uring/poll: fix poll_refs race with cancelation io_uring/filetable: fix file reference underflow io_uring: make poll refs more robust io_uring: cmpxchg for poll arm refs release commit 3e0d88f911fb6815ac8349766859c99a2f0aa421 Merge: f10b439638e24 db58653ce0c7c Author: Linus Torvalds Date: Fri Nov 25 16:34:39 2022 -0800 Merge tag 'zonefs-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fixes from Damien Le Moal: - Fix a race between zonefs module initialization of sysfs attribute directory and mounting a drive (from Xiaoxu). - Fix active zone accounting in the rare case of an IO error due to a zone transition to offline or read-only state (from me). * tag 'zonefs-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: Fix active zone accounting zonefs: Fix race between modprobe and mount commit f10b439638e2482a89a1a402941207f6d8791ff8 Merge: 3eaea0db25261 31a6297b89aab Author: Linus Torvalds Date: Fri Nov 25 13:54:48 2022 -0800 Merge tag 'regulator-fix-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "This is more changes than I'd like this late although the diffstat is still fairly small, I kept on holding off as new fixes came in to give things time to soak in -next but should probably have tagged and sent an additional pull request earlier. There's some relatively large fixes to the twl6030 driver to fix issues with the TWL6032 variant which resulted from some work on the core TWL6030 driver, a couple of fixes for error handling paths (mostly in the core), and a nice stability fix for the sgl51000 driver that's been pulled out of a BSP" * tag 'regulator-fix-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: twl6030: fix get status of twl6032 regulators regulator: twl6030: re-add TWL6032_SUBCLASS regulator: slg51000: Wait after asserting CS pin regulator: core: fix UAF in destroy_regulator() regulator: rt5759: fix OOB in validate_desc() regulator: core: fix kobject release warning and memory leak in regulator_register() commit 3eaea0db25261f62e21229f5763728dac40a1058 Merge: 88817acb8b75f ffdbb44f2f23f Author: Linus Torvalds Date: Fri Nov 25 13:24:05 2022 -0800 Merge tag 'for-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix a regression in nowait + buffered write - in zoned mode fix endianness when comparing super block generation - locking and lockdep fixes: - fix potential sleeping under spinlock when setting qgroup limit - lockdep warning fixes when btrfs_path is freed after copy_to_user - do not modify log tree while holding a leaf from fs tree locked - fix freeing of sysfs files of static features on error - use kv.alloc for zone map allocation as a fallback to avoid warnings due to high order allocation - send, avoid unaligned encoded writes when attempting to clone range * tag 'for-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs() btrfs: do not modify log tree while holding a leaf from fs tree locked btrfs: use kvcalloc in btrfs_get_dev_zone_info btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit() btrfs: send: avoid unaligned encoded writes when attempting to clone range btrfs: zoned: fix missing endianness conversion in sb_write_pointer btrfs: free btrfs_path before copying subvol info to userspace btrfs: free btrfs_path before copying fspath to userspace btrfs: free btrfs_path before copying inodes to userspace btrfs: free btrfs_path before copying root refs to userspace btrfs: fix assertion failure and blocking during nowait buffered write commit 88817acb8b75fe533fb5dfb6234a4e2104465e53 Merge: e3ebac80b6e9e 1056d314709d0 Author: Linus Torvalds Date: Fri Nov 25 12:43:33 2022 -0800 Merge tag 'pm-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These revert a recent change in the schedutil cpufreq governor that had not been expected to make any functional difference, but turned out to introduce a performance regression, fix an initialization issue in the amd-pstate driver and make it actually replace the venerable ACPI cpufreq driver on the supported systems by default. Specifics: - Revert a recent schedutil cpufreq governor change that introduced a performace regression on Pixel 6 (Sam Wu) - Fix amd-pstate driver initialization after running the kernel via kexec (Wyes Karny) - Turn amd-pstate into a built-in driver which allows it to take precedence over acpi-cpufreq by default on supported systems and amend it with a mechanism to disable this behavior (Perry Yuan) - Update amd-pstate documentation in accordance with the other changes made to it (Perry Yuan)" * tag 'pm-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Documentation: add amd-pstate kernel command line options Documentation: amd-pstate: add driver working mode introduction cpufreq: amd-pstate: add amd-pstate driver parameter for mode selection cpufreq: amd-pstate: change amd-pstate driver to be built-in type cpufreq: amd-pstate: cpufreq: amd-pstate: reset MSR_AMD_PERF_CTL register at init Revert "cpufreq: schedutil: Move max CPU capacity to sugov_policy" commit e3ebac80b6e9efe47b0ac3bf4b2d800b0b1958ff Merge: 081f359ef5334 adba1a9b81d50 Author: Linus Torvalds Date: Fri Nov 25 12:37:24 2022 -0800 Merge tag 's390-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Alexander Gordeev: - Fix size of incorrectly increased from four to eight bytes TOD field of crash dump save area. As result in case of kdump NT_S390_TODPREG ELF notes section contains correct value and "detected read beyond size of field" compiler warning goes away. - Fix memory leak in cryptographic Adjunct Processors (AP) module on initialization failure path. - Add Gerald Schaefer and Alexander Gordeev as S390 memory management maintainers. Also rename the S390 section to S390 ARCHITECTURE to be a bit more precise. * tag 's390-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: MAINTAINERS: add S390 MM section s390/crashdump: fix TOD programmable field size s390/ap: fix memory leak in ap_init_qci_info() commit 081f359ef5334b0e034979e4e930c2ce80f3001b Merge: 0b1dcc2cf55ae 25c94b051592c Author: Linus Torvalds Date: Fri Nov 25 12:32:42 2022 -0800 Merge tag 'hyperv-fixes-signed-20221125' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix IRTE allocation in Hyper-V PCI controller (Dexuan Cui) - Fix handling of SCSI srb_status and capacity change events (Michael Kelley) - Restore VP assist page after CPU offlining and onlining (Vitaly Kuznetsov) - Fix some memory leak issues in VMBus (Yang Yingliang) * tag 'hyperv-fixes-signed-20221125' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() PCI: hv: Only reuse existing IRTE allocation for Multi-MSI scsi: storvsc: Fix handling of srb_status and capacity change events x86/hyperv: Restore VP assist page after cpu offlining/onlining commit 0b1dcc2cf55ae6523c6fbd0d741b3ac28c9f4536 Merge: b308570957332 de3db3f883a82 Author: Linus Torvalds Date: Fri Nov 25 10:18:25 2022 -0800 Merge tag 'mm-hotfixes-stable-2022-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "24 MM and non-MM hotfixes. 8 marked cc:stable and 16 for post-6.0 issues. There have been a lot of hotfixes this cycle, and this is quite a large batch given how far we are into the -rc cycle. Presumably a reflection of the unusually large amount of MM material which went into 6.1-rc1" * tag 'mm-hotfixes-stable-2022-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (24 commits) test_kprobes: fix implicit declaration error of test_kprobes nilfs2: fix nilfs_sufile_mark_dirty() not set segment usage as dirty mm/cgroup/reclaim: fix dirty pages throttling on cgroup v1 mm: fix unexpected changes to {failslab|fail_page_alloc}.attr swapfile: fix soft lockup in scan_swap_map_slots hugetlb: fix __prep_compound_gigantic_page page flag setting kfence: fix stack trace pruning proc/meminfo: fix spacing in SecPageTables mm: multi-gen LRU: retry folios written back while isolated mailmap: update email address for Satya Priya mm/migrate_device: return number of migrating pages in args->cpages kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible MAINTAINERS: update Alex Hung's email address mailmap: update Alex Hung's email address mm: mmap: fix documentation for vma_mas_szero mm/damon/sysfs-schemes: skip stats update if the scheme directory is removed mm/memory: return vm_fault_t result from migrate_to_ram() callback mm: correctly charge compressed memory to its memcg ipc/shm: call underlying open/close vm_ops gcov: clang: fix the buffer overflow issue ... commit b308570957332422032e34b0abb9233790344e2b Merge: ca66e58001ad9 406c706c7b7f1 Author: Linus Torvalds Date: Fri Nov 25 10:12:43 2022 -0800 Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs fixes from Al Viro: "A couple of fixes, one of them for this cycle regression..." * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: vfs_tmpfile: ensure O_EXCL flag is enforced fs: use acquire ordering in __fget_light() commit 7cfe7a09489c1cefee7181e07b5f2bcbaebd9f41 Author: Jens Axboe Date: Fri Nov 25 09:36:29 2022 -0700 io_uring: clear TIF_NOTIFY_SIGNAL if set and task_work not available With how task_work is added and signaled, we can have TIF_NOTIFY_SIGNAL set and no task_work pending as it got run in a previous loop. Treat TIF_NOTIFY_SIGNAL like get_signal(), always clear it if set regardless of whether or not task_work is pending to run. Cc: stable@vger.kernel.org Fixes: 46a525e199e4 ("io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL") Signed-off-by: Jens Axboe commit ca66e58001ad9418e937ceb56bce8b1fe183c62e Merge: 6fe0e074e7698 ecae4c8954a1f Author: Linus Torvalds Date: Fri Nov 25 09:26:18 2022 -0800 Merge tag 'sound-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A few more last-minute fixes for 6.1 that have been gathered in the last week; nothing looks too worrisome, mostly device-specific small fixes, including the ABI fix for ASoC SOF" * tag 'sound-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: soc-pcm: Add NULL check in BE reparenting ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event ASoC: SOF: dai: move AMD_HS to end of list to restore backwards-compatibility ASoC: max98373: Add checks for devm_kcalloc ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions ASoC: soc-pcm: Don't zero TDM masks in __soc_pcm_open() ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove ASoC: hdac_hda: fix hda pcm buffer overflow issue ASoC: stm32: i2s: remove irqf_oneshot flag ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register commit 6fe0e074e76985c7be3eaa7a8fd51401a8999cae Merge: 08ad43d554bac e57702069b26b Author: Linus Torvalds Date: Fri Nov 25 09:20:42 2022 -0800 Merge tag 'drm-fixes-2022-11-25' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Weekly fixes, amdgpu has not quite settled down. Most of the changes are small, and the non-amdgpu ones are all fine. There are a bunch of DP MST DSC fixes that fix some issues introduced in a previous larger MST rework. The biggest one is mainly propagating some error values properly instead of bool returns, and I think it just looks large but doesn't really change anything too much, except propagating errors that are required to avoid deadlocks. I've gone over it and a few others and they've had some decent testing over the last few weeks. Summary: amdgpu: - amdgpu gang submit fix - DCN 3.1.4 fixes - DP MST DSC deadlock fixes - HMM userptr fixes - Fix Aldebaran CU occupancy reporting - GFX11 fixes - PSP suspend/resume fix - DCE12 KASAN fix - DCN 3.2.x fixes - Rotated cursor fix - SMU 13.x fix - DELL platform suspend/resume fixes - VCN4 SR-IOV fix - Display regression fix for polled connectors i915: - Fix GVT KVM reference count handling - Never purge busy TTM objects - Fix warn in intel_display_power_*_domain() functions dma-buf: - Use dma_fence_unwrap_for_each when importing sync files - Fix race in dma_heap_add() fbcon: - Fix use of uninitialized memory in logo" * tag 'drm-fixes-2022-11-25' of git://anongit.freedesktop.org/drm/drm: (30 commits) drm/amdgpu/vcn: re-use original vcn0 doorbell value drm/amdgpu: Partially revert "drm/amdgpu: update drm_display_info correctly when the edid is read" drm/amd/display: No display after resume from WB/CB drm/amdgpu: fix use-after-free during gpu recovery drm/amd/pm: update driver if header for smu_13_0_7 drm/amd/display: Fix rotated cursor offset calculation drm/amd/display: Use new num clk levels struct for max mclk index drm/amd/display: Avoid setting pixel rate divider to N/A drm/amd/display: Use viewport height for subvp mall allocation size drm/amd/display: Update soc bounding box for dcn32/dcn321 drm/amd/dc/dce120: Fix audio register mapping, stop triggering KASAN drm/amdgpu/psp: don't free PSP buffers on suspend fbcon: Use kzalloc() in fbcon_prepare_logo() dma-buf: fix racing conflict of dma_heap_add() drm/amd/amdgpu: reserve vm invalidation engine for firmware drm/amdgpu: Enable Aldebaran devices to report CU Occupancy drm/amdgpu: fix userptr HMM range handling v2 drm/amdgpu: always register an MMU notifier for userptr drm/amdgpu/dm/mst: Fix uninitialized var in pre_compute_mst_dsc_configs_for_state() drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state ... commit 3d1bb6cc1a654c8693a85b1d262e610196edec8b Author: Charles Keepax Date: Fri Nov 25 16:23:48 2022 +0000 ASoC: cs42l51: Correct PGA Volume minimum value The table in the datasheet actually shows the volume values in the wrong order, with the two -3dB values being reversed. This appears to have caused the lower of the two values to be used in the driver when the higher should have been, correct this mixup. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20221125162348.1288005-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f33bcc506050f89433a52a3052054d4ebd37b1c1 Author: Charles Keepax Date: Fri Nov 25 16:23:47 2022 +0000 ASoC: ops: Correct bounds check for second channel on SX controls Currently the check against the max value for the control is being applied after the value has had the minimum applied and been masked. But the max value simply indicates the number of volume levels on an SX control, and as such should just be applied on the raw value. Fixes: 97eea946b939 ("ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx()") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20221125162348.1288005-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 12ad3d2d6c5b0131a6052de91360849e3e154846 Author: Lin Ma Date: Fri Nov 25 07:15:54 2022 -0700 io_uring/poll: fix poll_refs race with cancelation There is an interesting race condition of poll_refs which could result in a NULL pointer dereference. The crash trace is like: KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 0 PID: 30781 Comm: syz-executor.2 Not tainted 6.0.0-g493ffd6605b2 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:io_poll_remove_entry io_uring/poll.c:154 [inline] RIP: 0010:io_poll_remove_entries+0x171/0x5b4 io_uring/poll.c:190 Code: ... RSP: 0018:ffff88810dfefba0 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000040000 RDX: ffffc900030c4000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: 0000000000000008 R08: ffffffff9764d3dd R09: fffffbfff3836781 R10: fffffbfff3836781 R11: 0000000000000000 R12: 1ffff11003422d60 R13: ffff88801a116b04 R14: ffff88801a116ac0 R15: dffffc0000000000 FS: 00007f9c07497700(0000) GS:ffff88811a600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffb5c00ea98 CR3: 0000000105680005 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: io_apoll_task_func+0x3f/0xa0 io_uring/poll.c:299 handle_tw_list io_uring/io_uring.c:1037 [inline] tctx_task_work+0x37e/0x4f0 io_uring/io_uring.c:1090 task_work_run+0x13a/0x1b0 kernel/task_work.c:177 get_signal+0x2402/0x25a0 kernel/signal.c:2635 arch_do_signal_or_restart+0x3b/0x660 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0xc2/0x160 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x58/0x160 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause for this is a tiny overlooking in io_poll_check_events() when cocurrently run with poll cancel routine io_poll_cancel_req(). The interleaving to trigger use-after-free: CPU0 | CPU1 | io_apoll_task_func() | io_poll_cancel_req() io_poll_check_events() | // do while first loop | v = atomic_read(...) | // v = poll_refs = 1 | ... | io_poll_mark_cancelled() | atomic_or() | // poll_refs = IO_POLL_CANCEL_FLAG | 1 | atomic_sub_return(...) | // poll_refs = IO_POLL_CANCEL_FLAG | // loop continue | | | io_poll_execute() | io_poll_get_ownership() | // poll_refs = IO_POLL_CANCEL_FLAG | 1 | // gets the ownership v = atomic_read(...) | // poll_refs not change | | if (v & IO_POLL_CANCEL_FLAG) | return -ECANCELED; | // io_poll_check_events return | // will go into | // io_req_complete_failed() free req | | | io_apoll_task_func() | // also go into io_req_complete_failed() And the interleaving to trigger the kernel WARNING: CPU0 | CPU1 | io_apoll_task_func() | io_poll_cancel_req() io_poll_check_events() | // do while first loop | v = atomic_read(...) | // v = poll_refs = 1 | ... | io_poll_mark_cancelled() | atomic_or() | // poll_refs = IO_POLL_CANCEL_FLAG | 1 | atomic_sub_return(...) | // poll_refs = IO_POLL_CANCEL_FLAG | // loop continue | | v = atomic_read(...) | // v = IO_POLL_CANCEL_FLAG | | io_poll_execute() | io_poll_get_ownership() | // poll_refs = IO_POLL_CANCEL_FLAG | 1 | // gets the ownership | WARN_ON_ONCE(!(v & IO_POLL_REF_MASK))) | // v & IO_POLL_REF_MASK = 0 WARN | | | io_apoll_task_func() | // also go into io_req_complete_failed() By looking up the source code and communicating with Pavel, the implementation of this atomic poll refs should continue the loop of io_poll_check_events() just to avoid somewhere else to grab the ownership. Therefore, this patch simply adds another AND operation to make sure the loop will stop if it finds the poll_refs is exactly equal to IO_POLL_CANCEL_FLAG. Since io_poll_cancel_req() grabs ownership and will finally make its way to io_req_complete_failed(), the req will be reclaimed as expected. Fixes: aa43477b0402 ("io_uring: poll rework") Signed-off-by: Lin Ma Reviewed-by: Pavel Begunkov [axboe: tweak description and code style] Signed-off-by: Jens Axboe commit 9d94c04c0db024922e886c9fd429659f22f48ea4 Author: Lin Ma Date: Wed Nov 23 02:40:15 2022 +0800 io_uring/filetable: fix file reference underflow There is an interesting reference bug when -ENOMEM occurs in calling of io_install_fixed_file(). KASan report like below: [ 14.057131] ================================================================== [ 14.059161] BUG: KASAN: use-after-free in unix_get_socket+0x10/0x90 [ 14.060975] Read of size 8 at addr ffff88800b09cf20 by task kworker/u8:2/45 [ 14.062684] [ 14.062768] CPU: 2 PID: 45 Comm: kworker/u8:2 Not tainted 6.1.0-rc4 #1 [ 14.063099] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 14.063666] Workqueue: events_unbound io_ring_exit_work [ 14.063936] Call Trace: [ 14.064065] [ 14.064175] dump_stack_lvl+0x34/0x48 [ 14.064360] print_report+0x172/0x475 [ 14.064547] ? _raw_spin_lock_irq+0x83/0xe0 [ 14.064758] ? __virt_addr_valid+0xef/0x170 [ 14.064975] ? unix_get_socket+0x10/0x90 [ 14.065167] kasan_report+0xad/0x130 [ 14.065353] ? unix_get_socket+0x10/0x90 [ 14.065553] unix_get_socket+0x10/0x90 [ 14.065744] __io_sqe_files_unregister+0x87/0x1e0 [ 14.065989] ? io_rsrc_refs_drop+0x1c/0xd0 [ 14.066199] io_ring_exit_work+0x388/0x6a5 [ 14.066410] ? io_uring_try_cancel_requests+0x5bf/0x5bf [ 14.066674] ? try_to_wake_up+0xdb/0x910 [ 14.066873] ? virt_to_head_page+0xbe/0xbe [ 14.067080] ? __schedule+0x574/0xd20 [ 14.067273] ? read_word_at_a_time+0xe/0x20 [ 14.067492] ? strscpy+0xb5/0x190 [ 14.067665] process_one_work+0x423/0x710 [ 14.067879] worker_thread+0x2a2/0x6f0 [ 14.068073] ? process_one_work+0x710/0x710 [ 14.068284] kthread+0x163/0x1a0 [ 14.068454] ? kthread_complete_and_exit+0x20/0x20 [ 14.068697] ret_from_fork+0x22/0x30 [ 14.068886] [ 14.069000] [ 14.069088] Allocated by task 289: [ 14.069269] kasan_save_stack+0x1e/0x40 [ 14.069463] kasan_set_track+0x21/0x30 [ 14.069652] __kasan_slab_alloc+0x58/0x70 [ 14.069899] kmem_cache_alloc+0xc5/0x200 [ 14.070100] __alloc_file+0x20/0x160 [ 14.070283] alloc_empty_file+0x3b/0xc0 [ 14.070479] path_openat+0xc3/0x1770 [ 14.070689] do_filp_open+0x150/0x270 [ 14.070888] do_sys_openat2+0x113/0x270 [ 14.071081] __x64_sys_openat+0xc8/0x140 [ 14.071283] do_syscall_64+0x3b/0x90 [ 14.071466] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 14.071791] [ 14.071874] Freed by task 0: [ 14.072027] kasan_save_stack+0x1e/0x40 [ 14.072224] kasan_set_track+0x21/0x30 [ 14.072415] kasan_save_free_info+0x2a/0x50 [ 14.072627] __kasan_slab_free+0x106/0x190 [ 14.072858] kmem_cache_free+0x98/0x340 [ 14.073075] rcu_core+0x427/0xe50 [ 14.073249] __do_softirq+0x110/0x3cd [ 14.073440] [ 14.073523] Last potentially related work creation: [ 14.073801] kasan_save_stack+0x1e/0x40 [ 14.074017] __kasan_record_aux_stack+0x97/0xb0 [ 14.074264] call_rcu+0x41/0x550 [ 14.074436] task_work_run+0xf4/0x170 [ 14.074619] exit_to_user_mode_prepare+0x113/0x120 [ 14.074858] syscall_exit_to_user_mode+0x1d/0x40 [ 14.075092] do_syscall_64+0x48/0x90 [ 14.075272] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 14.075529] [ 14.075612] Second to last potentially related work creation: [ 14.075900] kasan_save_stack+0x1e/0x40 [ 14.076098] __kasan_record_aux_stack+0x97/0xb0 [ 14.076325] task_work_add+0x72/0x1b0 [ 14.076512] fput+0x65/0xc0 [ 14.076657] filp_close+0x8e/0xa0 [ 14.076825] __x64_sys_close+0x15/0x50 [ 14.077019] do_syscall_64+0x3b/0x90 [ 14.077199] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 14.077448] [ 14.077530] The buggy address belongs to the object at ffff88800b09cf00 [ 14.077530] which belongs to the cache filp of size 232 [ 14.078105] The buggy address is located 32 bytes inside of [ 14.078105] 232-byte region [ffff88800b09cf00, ffff88800b09cfe8) [ 14.078685] [ 14.078771] The buggy address belongs to the physical page: [ 14.079046] page:000000001bd520e7 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800b09de00 pfn:0xb09c [ 14.079575] head:000000001bd520e7 order:1 compound_mapcount:0 compound_pincount:0 [ 14.079946] flags: 0x100000000010200(slab|head|node=0|zone=1) [ 14.080244] raw: 0100000000010200 0000000000000000 dead000000000001 ffff88800493cc80 [ 14.080629] raw: ffff88800b09de00 0000000080190018 00000001ffffffff 0000000000000000 [ 14.081016] page dumped because: kasan: bad access detected [ 14.081293] [ 14.081376] Memory state around the buggy address: [ 14.081618] ffff88800b09ce00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 14.081974] ffff88800b09ce80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc [ 14.082336] >ffff88800b09cf00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 14.082690] ^ [ 14.082909] ffff88800b09cf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc [ 14.083266] ffff88800b09d000: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb [ 14.083622] ================================================================== The actual tracing of this bug is shown below: commit 8c71fe750215 ("io_uring: ensure fput() called correspondingly when direct install fails") adds an additional fput() in io_fixed_fd_install() when io_file_bitmap_get() returns error values. In that case, the routine will never make it to io_install_fixed_file() due to an early return. static int io_fixed_fd_install(...) { if (alloc_slot) { ... ret = io_file_bitmap_get(ctx); if (unlikely(ret < 0)) { io_ring_submit_unlock(ctx, issue_flags); fput(file); return ret; } ... } ... ret = io_install_fixed_file(req, file, issue_flags, file_slot); ... } In the above scenario, the reference is okay as io_fixed_fd_install() ensures the fput() is called when something bad happens, either via bitmap or via inner io_install_fixed_file(). However, the commit 61c1b44a21d7 ("io_uring: fix deadlock on iowq file slot alloc") breaks the balance because it places fput() into the common path for both io_file_bitmap_get() and io_install_fixed_file(). Since io_install_fixed_file() handles the fput() itself, the reference underflow come across then. There are some extra commits make the current code into io_fixed_fd_install() -> __io_fixed_fd_install() -> io_install_fixed_file() However, the fact that there is an extra fput() is called if io_install_fixed_file() calls fput(). Traversing through the code, I find that the existing two callers to __io_fixed_fd_install(): io_fixed_fd_install() and io_msg_send_fd() have fput() when handling error return, this patch simply removes the fput() in io_install_fixed_file() to fix the bug. Fixes: 61c1b44a21d7 ("io_uring: fix deadlock on iowq file slot alloc") Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/be4ba4b.5d44.184a0a406a4.Coremail.linma@zju.edu.cn Signed-off-by: Jens Axboe commit a26a35e9019fd70bf3cf647dcfdae87abc7bacea Author: Pavel Begunkov Date: Sun Nov 20 16:57:42 2022 +0000 io_uring: make poll refs more robust poll_refs carry two functions, the first is ownership over the request. The second is notifying the io_poll_check_events() that there was an event but wake up couldn't grab the ownership, so io_poll_check_events() should retry. We want to make poll_refs more robust against overflows. Instead of always incrementing it, which covers two purposes with one atomic, check if poll_refs is elevated enough and if so set a retry flag without attempts to grab ownership. The gap between the bias check and following atomics may seem racy, but we don't need it to be strict. Moreover there might only be maximum 4 parallel updates: by the first and the second poll entries, __io_arm_poll_handler() and cancellation. From those four, only poll wake ups may be executed multiple times, but they're protected by a spin. Cc: stable@vger.kernel.org Reported-by: Lin Ma Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c762bc31f8683b3270f3587691348a7119ef9c9d.1668963050.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2f3893437a4ebf2e892ca172e9e122841319d675 Author: Pavel Begunkov Date: Sun Nov 20 16:57:41 2022 +0000 io_uring: cmpxchg for poll arm refs release Replace atomically substracting the ownership reference at the end of arming a poll with a cmpxchg. We try to release ownership by setting 0 assuming that poll_refs didn't change while we were arming. If it did change, we keep the ownership and use it to queue a tw, which is fully capable to process all events and (even tolerates spurious wake ups). It's a bit more elegant as we reduce races b/w setting the cancellation flag and getting refs with this release, and with that we don't have to worry about any kinds of underflows. It's not the fastest path for polling. The performance difference b/w cmpxchg and atomic dec is usually negligible and it's not the fastest path. Cc: stable@vger.kernel.org Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0c95251624397ea6def568ff040cad2d7926fd51.1668963050.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2e7ec190a0e38aaa8a6d87fd5f804ec07947febc Author: Michael Ellerman Date: Fri Nov 25 22:34:42 2022 +1100 powerpc/64s: Add missing declaration for machine_check_early_boot() There's no declaration for machine_check_early_boot(), which leads to a build failure with W=1. Add one. Fixes: 2f5182cffa43 ("powerpc/64s: early boot machine check handler") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221125132521.2167039-1-mpe@ellerman.id.au commit 3e8f7abcc3473bc9603323803aeaed4ffcc3a2ab Author: Lorenzo Bianconi Date: Tue Nov 8 16:19:26 2022 +0100 wifi: mac8021: fix possible oob access in ieee80211_get_rate_duration Fix possible out-of-bound access in ieee80211_get_rate_duration routine as reported by the following UBSAN report: UBSAN: array-index-out-of-bounds in net/mac80211/airtime.c:455:47 index 15 is out of range for type 'u16 [12]' CPU: 2 PID: 217 Comm: kworker/u32:10 Not tainted 6.1.0-060100rc3-generic Hardware name: Acer Aspire TC-281/Aspire TC-281, BIOS R01-A2 07/18/2017 Workqueue: mt76 mt76u_tx_status_data [mt76_usb] Call Trace: show_stack+0x4e/0x61 dump_stack_lvl+0x4a/0x6f dump_stack+0x10/0x18 ubsan_epilogue+0x9/0x43 __ubsan_handle_out_of_bounds.cold+0x42/0x47 ieee80211_get_rate_duration.constprop.0+0x22f/0x2a0 [mac80211] ? ieee80211_tx_status_ext+0x32e/0x640 [mac80211] ieee80211_calc_rx_airtime+0xda/0x120 [mac80211] ieee80211_calc_tx_airtime+0xb4/0x100 [mac80211] mt76x02_send_tx_status+0x266/0x480 [mt76x02_lib] mt76x02_tx_status_data+0x52/0x80 [mt76x02_lib] mt76u_tx_status_data+0x67/0xd0 [mt76_usb] process_one_work+0x225/0x400 worker_thread+0x50/0x3e0 ? process_one_work+0x400/0x400 kthread+0xe9/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Fixes: db3e1c40cf2f ("mac80211: Import airtime calculation code from mt76") Signed-off-by: Lorenzo Bianconi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg commit acd3c92acc7aaec50a94d0a7faf7ccd74e952493 Author: Johannes Berg Date: Fri Nov 25 12:36:58 2022 +0100 wifi: cfg80211: don't allow multi-BSSID in S1G In S1G beacon frames there shouldn't be multi-BSSID elements since that's not supported, remove that to avoid a potential integer underflow and/or misparsing the frames due to the different length of the fixed part of the frame. While at it, initialize non_tx_data so we don't send garbage values to the user (even if it doesn't seem to matter now.) Reported-and-tested-by: Sönke Huster Fixes: 9eaffe5078ca ("cfg80211: convert S1G beacon to scan results") Signed-off-by: Johannes Berg commit 9f16b5c82a025cd4c864737409234ddc44fb166a Author: Johannes Berg Date: Fri Nov 25 12:36:57 2022 +0100 wifi: cfg80211: fix buffer overflow in elem comparison For vendor elements, the code here assumes that 5 octets are present without checking. Since the element itself is already checked to fit, we only need to check the length. Reported-and-tested-by: Sönke Huster Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Johannes Berg commit f4307b4df1c28842bb1950ff0e1b97e17031b17f Author: Ye Bin Date: Wed Nov 23 17:55:06 2022 +0800 mmc: mmc_test: Fix removal of debugfs file In __mmc_test_register_dbgfs_file(), we need to assign 'file', as it's being used when removing the debugfs files when the mmc_test module is removed. Fixes: a04c50aaa916 ("mmc: core: no need to check return value of debugfs_create functions") Signed-off-by: Ye Bin Acked-by: Adrian Hunter Cc: stable@vger.kernel.org [Ulf: Re-wrote the commit msg] Link: https://lore.kernel.org/r/20221123095506.1965691-1-yebin@huaweicloud.com Signed-off-by: Ulf Hansson commit 31d929de5a112ee1b977a89c57de74710894bbbf Author: Rasmus Villemoes Date: Wed Nov 23 15:18:28 2022 +0100 net: loopback: use NET_NAME_PREDICTABLE for name_assign_type When the name_assign_type attribute was introduced (commit 685343fc3ba6, "net: add name_assign_type netdev attribute"), the loopback device was explicitly mentioned as one which would make use of NET_NAME_PREDICTABLE: The name_assign_type attribute gives hints where the interface name of a given net-device comes from. These values are currently defined: ... NET_NAME_PREDICTABLE: The ifname has been assigned by the kernel in a predictable way that is guaranteed to avoid reuse and always be the same for a given device. Examples include statically created devices like the loopback device [...] Switch to that so that reading /sys/class/net/lo/name_assign_type produces something sensible instead of returning -EINVAL. Signed-off-by: Rasmus Villemoes Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit df727d4547de568302b0ed15b0d4e8a469bdb456 Author: Rasmus Villemoes Date: Wed Nov 23 14:38:52 2022 +0100 net: fec: don't reset irq coalesce settings to defaults on "ip link up" Currently, when a FEC device is brought up, the irq coalesce settings are reset to their default values (1000us, 200 frames). That's unexpected, and breaks for example use of an appropriate .link file to make systemd-udev apply the desired settings (https://www.freedesktop.org/software/systemd/man/systemd.link.html), or any other method that would do a one-time setup during early boot. Refactor the code so that fec_restart() instead uses fec_enet_itr_coal_set(), which simply applies the settings that are stored in the private data, and initialize that private data with the default values. Signed-off-by: Rasmus Villemoes Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 32b931c86d0aef4f3263de457f58d82e9cbae2a2 Author: Suman Ghosh Date: Wed Nov 23 16:29:38 2022 +0530 octeontx2-pf: Fix pfc_alloc_status array overflow This patch addresses pfc_alloc_status array overflow occurring for send queue index value greater than PFC priority. Queue index can be greater than supported PFC priority for multiple scenarios (e.g. QoS, during non zero SMQ allocation for a PF/VF). In those scenarios the API should return default tx scheduler '0'. This is causing mbox errors as otx2_get_smq_idx returing invalid smq value. Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support") Signed-off-by: Suman Ghosh Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit cc3d2b5fc0d6f8ad8a52da5ea679e5c2ec2adbd4 Author: Goh, Wei Sheng Date: Wed Nov 23 18:51:10 2022 +0800 net: stmmac: Set MAC's flow control register to reflect current settings Currently, pause frame register GMAC_RX_FLOW_CTRL_RFE is not updated correctly when 'ethtool -A autoneg off rx off tx off' command is issued. This fix ensures the flow control change is reflected directly in the GMAC_RX_FLOW_CTRL_RFE register. Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()") Cc: # 5.10.x Signed-off-by: Goh, Wei Sheng Signed-off-by: Noor Azura Ahmad Tarmizi Signed-off-by: David S. Miller commit 2a83891130512dafb321418a8e7c9c09268d8c59 Author: Izabela Bakollari Date: Wed Nov 23 11:10:08 2022 +0100 aquantia: Do not purge addresses when setting the number of rings IPV6 addresses are purged when setting the number of rx/tx rings using ethtool -G. The function aq_set_ringparam calls dev_close, which removes the addresses. As a solution, call an internal function (aq_ndev_close). Fixes: c1af5427954b ("net: aquantia: Ethtool based ring size configuration") Signed-off-by: Izabela Bakollari Signed-off-by: David S. Miller commit 39701603519e5b43a717b6db6fef9144800fdad8 Author: Lukas Bulwahn Date: Wed Nov 23 11:33:05 2022 +0100 qed: avoid defines prefixed with CONFIG Defines prefixed with "CONFIG" should be limited to proper Kconfig options, that are introduced in a Kconfig file. Here, constants for bitmap indices of some configs are defined and these defines begin with the config's name, and are suffixed with BITMAP_IDX. To avoid defines prefixed with "CONFIG", name these constants BITMAP_IDX_FOR_CONFIG_XYZ instead of CONFIG_XYZ_BITMAP_IDX. No functional change. Signed-off-by: Lukas Bulwahn Signed-off-by: David S. Miller commit 8dbd6e4ce1b9c527921643d9e34f188a10d4e893 Author: Duoming Zhou Date: Wed Nov 23 18:06:42 2022 +0800 qlcnic: fix sleep-in-atomic-context bugs caused by msleep The watchdog timer is used to monitor whether the process of transmitting data is timeout. If we use qlcnic driver, the dev_watchdog() that is the timer handler of watchdog timer will call qlcnic_tx_timeout() to process the timeout. But the qlcnic_tx_timeout() calls msleep(), as a result, the sleep-in-atomic-context bugs will happen. The processes are shown below: (atomic context) dev_watchdog qlcnic_tx_timeout qlcnic_83xx_idc_request_reset qlcnic_83xx_lock_driver msleep --------------------------- (atomic context) dev_watchdog qlcnic_tx_timeout qlcnic_83xx_idc_request_reset qlcnic_83xx_lock_driver qlcnic_83xx_recover_driver_lock msleep Fix by changing msleep() to mdelay(), the mdelay() is busy-waiting and the bugs could be mitigated. Fixes: 629263acaea3 ("qlcnic: 83xx CNA inter driver communication mechanism") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit db58653ce0c7cf4d155727852607106f890005c0 Author: Damien Le Moal Date: Mon Nov 21 16:29:37 2022 +0900 zonefs: Fix active zone accounting If a file zone transitions to the offline or readonly state from an active state, we must clear the zone active flag and decrement the active seq file counter. Do so in zonefs_account_active() using the new zonefs inode flags ZONEFS_ZONE_OFFLINE and ZONEFS_ZONE_READONLY. These flags are set if necessary in zonefs_check_zone_condition() based on the result of report zones operation after an IO error. Fixes: 87c9ce3ffec9 ("zonefs: Add active seq file accounting") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn commit 8d1c37e6aaaca495f043bac31f0cd309aa0cfdc5 Merge: 661e5ebbafd26 1a8e3bd25f1e7 Author: David S. Miller Date: Fri Nov 25 07:51:37 2022 +0000 Merge tag 'linux-can-fixes-for-6.1-20221124' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== linux-can-fixes-for-6.1-20221124 this is a pull request of 8 patches for net/master. Ziyang Xuan contributes a patch for the can327, fixing a potential SKB leak when the netdev is down. Heiko Schocher's patch for the sja1000 driver fixes the width of the definition of the OCR_MODE_MASK. Zhang Changzhong contributes 4 patches. In the sja1000_isa, cc770, and m_can_pci drivers the error path in the probe() function and in case of the etas_es58x a function that is called by probe() are fixed. Jiasheng Jiang add a missing check for the return value of the devm_clk_get() in the m_can driver. Yasushi SHOJI's patch for the mcba_usb fixes setting of the external termination resistor. ==================== Signed-off-by: David S. Miller commit 10bc8e4af65946b727728d7479c028742321b60a Author: Amir Goldstein Date: Thu Nov 17 22:52:49 2022 +0200 vfs: fix copy_file_range() averts filesystem freeze protection Commit 868f9f2f8e00 ("vfs: fix copy_file_range() regression in cross-fs copies") removed fallback to generic_copy_file_range() for cross-fs cases inside vfs_copy_file_range(). To preserve behavior of nfsd and ksmbd server-side-copy, the fallback to generic_copy_file_range() was added in nfsd and ksmbd code, but that call is missing sb_start_write(), fsnotify hooks and more. Ideally, nfsd and ksmbd would pass a flag to vfs_copy_file_range() that will take care of the fallback, but that code would be subtle and we got vfs_copy_file_range() logic wrong too many times already. Instead, add a flag to explicitly request vfs_copy_file_range() to perform only generic_copy_file_range() and let nfsd and ksmbd use this flag only in the fallback path. This choise keeps the logic changes to minimum in the non-nfsd/ksmbd code paths to reduce the risk of further regressions. Fixes: 868f9f2f8e00 ("vfs: fix copy_file_range() regression in cross-fs copies") Tested-by: Namjae Jeon Tested-by: Luis Henriques Signed-off-by: Amir Goldstein Signed-off-by: Al Viro commit e57702069b26b8601a33fdc0c9bbe40c6bb9c72f Merge: b65a648865c4a ecb41b71ef90c Author: Dave Airlie Date: Fri Nov 25 10:55:23 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-11-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-11-23: amdgpu: - DCN 3.1.4 fixes - DP MST DSC deadlock fixes - HMM userptr fixes - Fix Aldebaran CU occupancy reporting - GFX11 fixes - PSP suspend/resume fix - DCE12 KASAN fix - DCN 3.2.x fixes - Rotated cursor fix - SMU 13.x fix - DELL platform suspend/resume fixes - VCN4 SR-IOV fix - Display regression fix for polled connectors Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221123143453.8977-1-alexander.deucher@amd.com commit b65a648865c4a1e717c4f56f5025546b9553189a Merge: 9e2c5c651a63b 14af5d385878d Author: Dave Airlie Date: Fri Nov 25 09:42:01 2022 +1000 Merge tag 'drm-intel-fixes-2022-11-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix GVT KVM reference count handling (Sean Christopherson) - Never purge busy TTM objects (Matthew Auld) - Fix warn in intel_display_power_*_domain() functions (Imre Deak) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y38u44hb1LZfZC+M@tursulin-desk commit 9e2c5c651a63baaa39005070481d39dcf5b0893a Merge: eb7081409f94a a6a00d7e8ffd7 Author: Dave Airlie Date: Fri Nov 25 09:21:10 2022 +1000 Merge tag 'drm-misc-fixes-2022-11-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc7: - Another amdgpu gang submit fix. - Use dma_fence_unwrap_for_each when importing sync files. - Fix race in dma_heap_add(). - Fix use of uninitialized memory in logo. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/a5721505-4823-98ef-7d6f-0ea478221391@linux.intel.com commit 08ad43d554bacb9769c6a69d5f771f02f5ba411c Merge: cd89db60e2282 661e5ebbafd26 Author: Linus Torvalds Date: Thu Nov 24 11:19:20 2022 -0800 Merge tag 'net-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from rxrpc, netfilter and xfrm. Current release - regressions: - dccp/tcp: fix bhash2 issues related to WARN_ON() in inet_csk_get_port() - l2tp: don't sleep and disable BH under writer-side sk_callback_lock - eth: ice: fix handling of burst tx timestamps Current release - new code bugs: - xfrm: squelch kernel warning in case XFRM encap type is not available - eth: mlx5e: fix possible race condition in macsec extended packet number update routine Previous releases - regressions: - neigh: decrement the family specific qlen - netfilter: fix ipset regression - rxrpc: fix race between conn bundle lookup and bundle removal [ZDI-CAN-15975] - eth: iavf: do not restart tx queues after reset task failure - eth: nfp: add port from netdev validation for EEPROM access - eth: mtk_eth_soc: fix potential memory leak in mtk_rx_alloc() Previous releases - always broken: - tipc: set con sock in tipc_conn_alloc - nfc: - fix potential memory leaks - fix incorrect sizing calculations in EVT_TRANSACTION - eth: octeontx2-af: fix pci device refcount leak - eth: bonding: fix ICMPv6 header handling when receiving IPv6 messages - eth: prestera: add missing unregister_netdev() in prestera_port_create() - eth: tsnep: fix rotten packets Misc: - usb: qmi_wwan: add support for LARA-L6" * tag 'net-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (95 commits) net: thunderx: Fix the ACPI memory leak octeontx2-af: Fix reference count issue in rvu_sdp_init() net: altera_tse: release phylink resources in tse_shutdown() virtio_net: Fix probe failed when modprobe virtio_net net: wwan: t7xx: Fix the ACPI memory leak octeontx2-pf: Add check for devm_kcalloc net: enetc: preserve TX ring priority across reconfiguration net: marvell: prestera: add missing unregister_netdev() in prestera_port_create() nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION nfc: st-nci: fix memory leaks in EVT_TRANSACTION nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION Documentation: networking: Update generic_netlink_howto URL net/cdc_ncm: Fix multicast RX support for CDC NCM devices with ZLP net: usb: qmi_wwan: add u-blox 0x1342 composition l2tp: Don't sleep and disable BH under writer-side sk_callback_lock net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx() arcnet: fix potential memory leak in com20020_probe() ipv4: Fix error return code in fib_table_insert() net: ethernet: mtk_eth_soc: fix memory leak in error path net: ethernet: mtk_eth_soc: fix resource leak in error path ... commit cd89db60e22824b82f9458753fa6cb770cca8bde Merge: b11266ac91f2d b10dbd6fbd7d0 Author: Linus Torvalds Date: Thu Nov 24 11:14:09 2022 -0800 Merge tag 'soc-fixes-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "There are a bunch of late fixes that just came in, in particular a longer series for Rockchips devicetree files, but most of those just address cosmetic errors that were found during the binding validation. There are a couple of code changes: - A regression fix to the IXP42x PCI bus - A fix for a memory leak on optee, and another one for mach-mxs - Two fixes for the sunxi rsb bus driver, to address problems with the shutdown logic The rest are small but important devicetree fixes for a number of individual boards, addressing issues across all platforms: - arm global timer on older rockchip SoCs is unstable and needs to be disabled in favor of a more reliable clocksource - Corrections to fix bluetooth, mmc, and networking on a few Rockchip boards - at91/sam9g20ek UDC needs a pin controller config change - an omap board runs into mmc probe errors because of regulator nodes in the wrong place - imx8mp-evk has a minor inaccuracy with its pin config, but without user visible impact - The Allwinner H6 Hantro G2 video decoder needs an IOMMU reference to prevent the driver from crashing" * tag 'soc-fixes-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (30 commits) bus: ixp4xx: Don't touch bit 7 on IXP42x ARM: dts: imx6q-prti6q: Fix ref/tcxo-clock-frequency properties arm64: dts: imx8mp-evk: correct pcie pad settings ARM: mxs: fix memory leak in mxs_machine_init() ARM: dts: at91: sam9g20ek: enable udc vbus gpio pinctrl tee: optee: fix possible memory leak in optee_register_device() arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property bus: sunxi-rsb: Support atomic transfers bus: sunxi-rsb: Remove the shutdown callback ARM: dts: rockchip: disable arm_global_timer on rk3066 and rk3188 arm64: dts: rockchip: Fix Pine64 Quartz4-B PMIC interrupt ARM: dts: am335x-pcm-953: Define fixed regulators in root node ARM: dts: rockchip: rk3188: fix lcdc1-rgb24 node name arm64: dts: rockchip: fix ir-receiver node names ARM: dts: rockchip: fix ir-receiver node names arm64: dts: rockchip: fix adc-keys sub node names ARM: dts: rockchip: fix adc-keys sub node names arm: dts: rockchip: remove clock-frequency from rtc arm: dts: rockchip: fix node name for hym8563 rtc ... commit b11266ac91f2d0afc154cdcfc7d7d58fd393fc4a Merge: 3bfd8fcab5486 340a982825f76 Author: Linus Torvalds Date: Thu Nov 24 11:10:51 2022 -0800 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: "Two fixes for 6.1: - fix stacktraces for tracepoint events in Thumb2 mode - fix for noMMU ZERO_PAGE() implementation" * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation ARM: 9251/1: perf: Fix stacktraces for tracepoint events in THUMB2 kernels commit 3bfd8fcab548659e3a77000b2302c62a47ab2824 Merge: 6fd2152fd1ff9 fa0e381290b13 Author: Linus Torvalds Date: Thu Nov 24 11:09:01 2022 -0800 Merge tag 'loongarch-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Fix two build warnings, a copy_thread() bug, two page table manipulation bugs, and some trivial cleanups" * tag 'loongarch-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: docs/zh_CN/LoongArch: Fix wrong description of FPRs Note LoongArch: Fix unsigned comparison with less than zero LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite() LoongArch: Set _PAGE_DIRTY only if _PAGE_WRITE is set in {pmd,pte}_mkdirty() LoongArch: Clear FPU/SIMD thread info flags for kernel thread LoongArch: SMP: Change prefix from loongson3 to loongson LoongArch: Combine acpi_boot_table_init() and acpi_boot_init() LoongArch: Makefile: Use "grep -E" instead of "egrep" commit 6fd2152fd1ff9a5ea488674a97af396e4047eaed Merge: c3eb11fbb8268 4e3c51f4e8052 Author: Linus Torvalds Date: Thu Nov 24 10:22:42 2022 -0800 Merge tag 'ext4_for_linus_stable2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Fix a regression in the lazytime code that was introduced in v6.1-rc1, and a use-after-free that can be triggered by a maliciously corrupted file system" * tag 'ext4_for_linus_stable2' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: fs: do not update freeing inode i_io_list ext4: fix use-after-free in ext4_ext_shift_extents commit 0cdfa9e6f0915e3d243e2393bfa8a22e12d553b0 Author: Phil Turnbull Date: Wed Nov 23 10:35:43 2022 -0500 wifi: wilc1000: validate number of channels There is no validation of 'e->no_of_channels' which can trigger an out-of-bounds write in the following 'memset' call. Validate that the number of channels does not extends beyond the size of the channel list element. Signed-off-by: Phil Turnbull Tested-by: Ajay Kathat Acked-by: Ajay Kathat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221123153543.8568-5-philipturnbull@github.com commit f9b62f9843c7b0afdaecabbcebf1dbba18599408 Author: Phil Turnbull Date: Wed Nov 23 10:35:42 2022 -0500 wifi: wilc1000: validate length of IEEE80211_P2P_ATTR_CHANNEL_LIST attribute Validate that the IEEE80211_P2P_ATTR_CHANNEL_LIST attribute contains enough space for a 'struct wilc_attr_oper_ch'. If the attribute is too small then it can trigger an out-of-bounds write later in the function. 'struct wilc_attr_oper_ch' is variable sized so also check 'attr_len' does not extend beyond the end of 'buf'. Signed-off-by: Phil Turnbull Tested-by: Ajay Kathat Acked-by: Ajay Kathat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221123153543.8568-4-philipturnbull@github.com commit 051ae669e4505abbe05165bebf6be7922de11f41 Author: Phil Turnbull Date: Wed Nov 23 10:35:41 2022 -0500 wifi: wilc1000: validate length of IEEE80211_P2P_ATTR_OPER_CHANNEL attribute Validate that the IEEE80211_P2P_ATTR_OPER_CHANNEL attribute contains enough space for a 'struct struct wilc_attr_oper_ch'. If the attribute is too small then it triggers an out-of-bounds write later in the function. Signed-off-by: Phil Turnbull Tested-by: Ajay Kathat Acked-by: Ajay Kathat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221123153543.8568-3-philipturnbull@github.com commit cd21d99e595ec1d8721e1058dcdd4f1f7de1d793 Author: Phil Turnbull Date: Wed Nov 23 10:35:40 2022 -0500 wifi: wilc1000: validate pairwise and authentication suite offsets There is no validation of 'offset' which can trigger an out-of-bounds read when extracting RSN capabilities. Signed-off-by: Phil Turnbull Tested-by: Ajay Kathat Acked-by: Ajay Kathat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221123153543.8568-2-philipturnbull@github.com commit 1a8e3bd25f1e789c8154e11ea24dc3ec5a4c1da0 Author: Yasushi SHOJI Date: Fri Nov 25 00:25:03 2022 +0900 can: mcba_usb: Fix termination command argument Microchip USB Analyzer can activate the internal termination resistors by setting the "termination" option ON, or OFF to to deactivate them. As I've observed, both with my oscilloscope and captured USB packets below, you must send "0" to turn it ON, and "1" to turn it OFF. From the schematics in the user's guide, I can confirm that you must drive the CAN_RES signal LOW "0" to activate the resistors. Reverse the argument value of usb_msg.termination to fix this. These are the two commands sequence, ON then OFF. > No. Time Source Destination Protocol Length Info > 1 0.000000 host 1.3.1 USB 46 URB_BULK out > > Frame 1: 46 bytes on wire (368 bits), 46 bytes captured (368 bits) > USB URB > Leftover Capture Data: a80000000000000000000000000000000000a8 > > No. Time Source Destination Protocol Length Info > 2 4.372547 host 1.3.1 USB 46 URB_BULK out > > Frame 2: 46 bytes on wire (368 bits), 46 bytes captured (368 bits) > USB URB > Leftover Capture Data: a80100000000000000000000000000000000a9 Signed-off-by: Yasushi SHOJI Link: https://lore.kernel.org/all/20221124152504.125994-1-yashi@spacecubics.com Signed-off-by: Marc Kleine-Budde commit 68b4f9e0bdd0f920d7303d07bfe226cd0976961d Author: Jiasheng Jiang Date: Wed Nov 23 14:36:51 2022 +0800 can: m_can: Add check for devm_clk_get Since the devm_clk_get may return error, it should be better to add check for the cdev->hclk, as same as cdev->cclk. Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/all/20221123063651.26199-1-jiasheng@iscas.ac.cn Signed-off-by: Marc Kleine-Budde commit 1eca1d4cc21b6d0fc5f9a390339804c0afce9439 Author: Zhang Changzhong Date: Fri Nov 11 20:11:23 2022 +0800 can: m_can: pci: add missing m_can_class_free_dev() in probe/remove methods In m_can_pci_remove() and error handling path of m_can_pci_probe(), m_can_class_free_dev() should be called to free resource allocated by m_can_class_allocate_dev(), otherwise there will be memleak. Fixes: cab7ffc0324f ("can: m_can: add PCI glue driver for Intel Elkhart Lake") Signed-off-by: Zhang Changzhong Reviewed-by: Jarkko Nikula Link: https://lore.kernel.org/all/1668168684-6390-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Marc Kleine-Budde commit 709cb2f9ed2006eb1dc4b36b99d601cd24889ec4 Author: Zhang Changzhong Date: Mon Nov 14 16:14:44 2022 +0800 can: etas_es58x: es58x_init_netdev(): free netdev when register_candev() In case of register_candev() fails, clear es58x_dev->netdev[channel_idx] and add free_candev(). Otherwise es58x_free_netdevs() will unregister the netdev that has never been registered. Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces") Signed-off-by: Zhang Changzhong Acked-by: Arunachalam Santhanam Acked-by: Vincent Mailhol Link: https://lore.kernel.org/all/1668413685-23354-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Marc Kleine-Budde commit 62ec89e74099a3d6995988ed9f2f996b368417ec Author: Zhang Changzhong Date: Fri Nov 11 20:09:16 2022 +0800 can: cc770: cc770_isa_probe(): add missing free_cc770dev() Add the missing free_cc770dev() before return from cc770_isa_probe() in the register_cc770dev() error handling case. In addition, remove blanks before goto labels. Fixes: 7e02e5433e00 ("can: cc770: legacy CC770 ISA bus driver") Signed-off-by: Zhang Changzhong Link: https://lore.kernel.org/all/1668168557-6024-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Marc Kleine-Budde commit 92dfd9310a71d28cefe6a2d5174d43fab240e631 Author: Zhang Changzhong Date: Fri Nov 11 20:08:41 2022 +0800 can: sja1000_isa: sja1000_isa_probe(): add missing free_sja1000dev() Add the missing free_sja1000dev() before return from sja1000_isa_probe() in the register_sja1000dev() error handling case. In addition, remove blanks before goto labels. Fixes: 2a6ba39ad6a2 ("can: sja1000: legacy SJA1000 ISA bus driver") Signed-off-by: Zhang Changzhong Link: https://lore.kernel.org/all/1668168521-5540-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Marc Kleine-Budde commit 26e8f6a75248247982458e8237b98c9fb2ffcf9d Author: Heiko Schocher Date: Wed Nov 23 08:16:36 2022 +0100 can: sja1000: fix size of OCR_MODE_MASK define bitfield mode in ocr register has only 2 bits not 3, so correct the OCR_MODE_MASK define. Signed-off-by: Heiko Schocher Link: https://lore.kernel.org/all/20221123071636.2407823-1-hs@denx.de Signed-off-by: Marc Kleine-Budde commit 8fa452cfafed521aaf5a18c71003fe24b1ee6141 Author: Ziyang Xuan Date: Thu Nov 10 14:14:37 2022 +0800 can: can327: can327_feed_frame_to_netdev(): fix potential skb leak when netdev is down In can327_feed_frame_to_netdev(), it did not free the skb when netdev is down, and all callers of can327_feed_frame_to_netdev() did not free allocated skb too. That would trigger skb leak. Fix it by adding kfree_skb() in can327_feed_frame_to_netdev() when netdev is down. Not tested, just compiled. Fixes: 43da2f07622f ("can: can327: CAN/ldisc driver for ELM327 based OBD-II adapters") Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/20221110061437.411525-1-william.xuanziyang@huawei.com Reviewed-by: Max Staudt Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit b10dbd6fbd7d097afa1ffa5f94a74b355a4e4743 Merge: 706450b5c3212 da74858a47578 Author: Arnd Bergmann Date: Thu Nov 24 15:36:13 2022 +0100 Merge tag 'v6.2-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Disabling of the unreliable arm-global-timer on earliest Rockchip SoCs, due to its frequency being bound to the changing cpu clock. * tag 'v6.2-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: disable arm_global_timer on rk3066 and rk3188 commit 0dd4cdccdab3d74bd86b868768a7dca216bcce7e Author: Thomas Huth Date: Wed Nov 23 10:08:33 2022 +0100 KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field We recently experienced some weird huge time jumps in nested guests when rebooting them in certain cases. After adding some debug code to the epoch handling in vsie.c (thanks to David Hildenbrand for the idea!), it was obvious that the "epdx" field (the multi-epoch extension) did not get set to 0xff in case the "epoch" field was negative. Seems like the code misses to copy the value from the epdx field from the guest to the shadow control block. By doing so, the weird time jumps are gone in our scenarios. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2140899 Fixes: 8fa1696ea781 ("KVM: s390: Multiple Epoch Facility support") Signed-off-by: Thomas Huth Reviewed-by: Christian Borntraeger Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank Cc: stable@vger.kernel.org # 4.19+ Link: https://lore.kernel.org/r/20221123090833.292938-1-thuth@redhat.com Message-Id: <20221123090833.292938-1-thuth@redhat.com> Signed-off-by: Janosch Frank commit 81cb291eaf56a2b4aebd2aeb4070d6f049da4343 Merge: db8f91d424fe0 19c5bda74dc45 Author: Mark Brown Date: Thu Nov 24 13:19:02 2022 +0000 ASoC: Merge dropped fixes from v5.18 These fixes were queued for v5.18 but due to me changing my scripting they never actually got merged - pulling them up now. commit adba1a9b81d5020a9bf8332fee9ff0171fe7623d Author: Heiko Carstens Date: Thu Nov 17 20:23:30 2022 +0100 MAINTAINERS: add S390 MM section Alexander Gordeev and Gerald Schaefer are covering the whole s390 specific memory management code. Reflect that by adding a new S390 MM section to MAINTAINERS. Also rename the S390 section to S390 ARCHITECTURE to be a bit more precise. Acked-by: Gerald Schaefer Acked-by: Christian Borntraeger Acked-by: Alexander Gordeev Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit f44e07a8afdd713ddc1a8832c39372fe5dd86895 Author: Heiko Carstens Date: Fri Nov 18 13:05:39 2022 +0100 s390/crashdump: fix TOD programmable field size The size of the TOD programmable field was incorrectly increased from four to eight bytes with commit 1a2c5840acf9 ("s390/dump: cleanup CPU save area handling"). This leads to an elf notes section NT_S390_TODPREG which has a size of eight instead of four bytes in case of kdump, however even worse is that the contents is incorrect: it is supposed to contain only the contents of the TOD programmable field, but in fact contains a mix of the TOD programmable field (32 bit upper bits) and parts of the CPU timer register (lower 32 bits). Fix this by simply changing the size of the todpreg field within the save area structure. This will implicitly also fix the size of the corresponding elf notes sections. This also gets rid of this compile time warning: in function ‘fortify_memcpy_chk’, inlined from ‘save_area_add_regs’ at arch/s390/kernel/crash_dump.c:99:2: ./include/linux/fortify-string.h:413:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 413 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 1a2c5840acf9 ("s390/dump: cleanup CPU save area handling") Reviewed-by: Christian Borntraeger Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 89d21e259a94f7d5582ec675aa445f5a79f347e4 Author: Christophe Leroy Date: Thu Nov 24 09:37:27 2022 +0100 powerpc/bpf/32: Fix Oops on tail call tests test_bpf tail call tests end up as: test_bpf: #0 Tail call leaf jited:1 85 PASS test_bpf: #1 Tail call 2 jited:1 111 PASS test_bpf: #2 Tail call 3 jited:1 145 PASS test_bpf: #3 Tail call 4 jited:1 170 PASS test_bpf: #4 Tail call load/store leaf jited:1 190 PASS test_bpf: #5 Tail call load/store jited:1 BUG: Unable to handle kernel data access on write at 0xf1b4e000 Faulting instruction address: 0xbe86b710 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=4K MMU=Hash PowerMac Modules linked in: test_bpf(+) CPU: 0 PID: 97 Comm: insmod Not tainted 6.1.0-rc4+ #195 Hardware name: PowerMac3,1 750CL 0x87210 PowerMac NIP: be86b710 LR: be857e88 CTR: be86b704 REGS: f1b4df20 TRAP: 0300 Not tainted (6.1.0-rc4+) MSR: 00009032 CR: 28008242 XER: 00000000 DAR: f1b4e000 DSISR: 42000000 GPR00: 00000001 f1b4dfe0 c11d2280 00000000 00000000 00000000 00000002 00000000 GPR08: f1b4e000 be86b704 f1b4e000 00000000 00000000 100d816a f2440000 fe73baa8 GPR16: f2458000 00000000 c1941ae4 f1fe2248 00000045 c0de0000 f2458030 00000000 GPR24: 000003e8 0000000f f2458000 f1b4dc90 3e584b46 00000000 f24466a0 c1941a00 NIP [be86b710] 0xbe86b710 LR [be857e88] __run_one+0xec/0x264 [test_bpf] Call Trace: [f1b4dfe0] [00000002] 0x2 (unreliable) Instruction dump: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX ---[ end trace 0000000000000000 ]--- This is a tentative to write above the stack. The problem is encoutered with tests added by commit 38608ee7b690 ("bpf, tests: Add load store test case for tail call") This happens because tail call is done to a BPF prog with a different stack_depth. At the time being, the stack is kept as is when the caller tail calls its callee. But at exit, the callee restores the stack based on its own properties. Therefore here, at each run, r1 is erroneously increased by 32 - 16 = 16 bytes. This was done that way in order to pass the tail call count from caller to callee through the stack. As powerpc32 doesn't have a red zone in the stack, it was necessary the maintain the stack as is for the tail call. But it was not anticipated that the BPF frame size could be different. Let's take a new approach. Use register r4 to carry the tail call count during the tail call, and save it into the stack at function entry if required. This means the input parameter must be in r3, which is more correct as it is a 32 bits parameter, then tail call better match with normal BPF function entry, the down side being that we move that input parameter back and forth between r3 and r4. That can be optimised later. Doing that also has the advantage of maximising the common parts between tail calls and a normal function exit. With the fix, tail call tests are now successfull: test_bpf: #0 Tail call leaf jited:1 53 PASS test_bpf: #1 Tail call 2 jited:1 115 PASS test_bpf: #2 Tail call 3 jited:1 154 PASS test_bpf: #3 Tail call 4 jited:1 165 PASS test_bpf: #4 Tail call load/store leaf jited:1 101 PASS test_bpf: #5 Tail call load/store jited:1 141 PASS test_bpf: #6 Tail call error path, max count reached jited:1 994 PASS test_bpf: #7 Tail call count preserved across function calls jited:1 140975 PASS test_bpf: #8 Tail call error path, NULL target jited:1 110 PASS test_bpf: #9 Tail call error path, index out of range jited:1 69 PASS test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed] Suggested-by: Naveen N. Rao Fixes: 51c66ad849a7 ("powerpc/bpf: Implement extended BPF on PPC32") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Tested-by: Naveen N. Rao Link: https://lore.kernel.org/r/757acccb7fbfc78efa42dcf3c974b46678198905.1669278887.git.christophe.leroy@csgroup.eu commit 6a3fc8c330d1c1fa3d8773d7d38a7c55c4900dfe Author: Peter Rosin Date: Sat Nov 12 16:40:59 2022 +0100 ARM: at91: fix build for SAMA5D3 w/o L2 cache The L2 cache is present on the newer SAMA5D2 and SAMA5D4 families, but apparently not for the older SAMA5D3. Solves a build-time regression with the following symptom: sama5.c:(.init.text+0x48): undefined reference to `outer_cache' Fixes: 3b5a7ca7d252 ("ARM: at91: setup outer cache .write_sec() callback if needed") Signed-off-by: Peter Rosin [claudiu.beznea: delete "At least not always." from commit description] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/b7f8dacc-5e1f-0eb2-188e-3ad9a9f7613d@axentia.se commit 661e5ebbafd26d9d2e3c749f5cf591e55c7364f5 Author: Yu Liao Date: Wed Nov 23 16:22:36 2022 +0800 net: thunderx: Fix the ACPI memory leak The ACPI buffer memory (string.pointer) should be freed as the buffer is not used after returning from bgx_acpi_match_id(), free it to prevent memory leak. Fixes: 46b903a01c05 ("net, thunder, bgx: Add support to get MAC address from ACPI.") Signed-off-by: Yu Liao Link: https://lore.kernel.org/r/20221123082237.1220521-1-liaoyu15@huawei.com Signed-off-by: Paolo Abeni commit 030a976efae83f7b6593afb11a8254d42f9290fe Author: Peter Zijlstra Date: Sat Nov 19 10:45:54 2022 +0800 perf: Consider OS filter fail Some PMUs (notably the traditional hardware kind) have boundary issues with the OS filter. Specifically, it is possible for perf_event_attr::exclude_kernel=1 events to trigger in-kernel due to SKID or errata. This can upset the sigtrap logic some and trigger the WARN. However, if this invalid sample is the first we must not loose the SIGTRAP, OTOH if it is the second, it must not override the pending_addr with a (possibly) invalid one. Fixes: ca6c21327c6a ("perf: Fix missing SIGTRAPs") Reported-by: Pengfei Xu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marco Elver Tested-by: Pengfei Xu Link: https://lkml.kernel.org/r/Y3hDYiXwRnJr8RYG@xpf.sh.intel.com commit af169b7759a9b9369b5106cd07a25c57ce60119e Author: Peter Zijlstra Date: Mon Nov 21 15:57:44 2022 +0100 perf: Fixup SIGTRAP and sample_flags interaction The perf_event_attr::sigtrap functionality relies on data->addr being set. However commit 7b0846301531 ("perf: Use sample_flags for addr") changed this to only initialize data->addr when not 0. Fixes: 7b0846301531 ("perf: Use sample_flags for addr") Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Y3426b4OimE%2FI5po%40hirez.programming.kicks-ass.net commit ad17c2a3f11b0f6b122e7842d8f7d9a5fcc7ac63 Author: Xiongfeng Wang Date: Wed Nov 23 14:59:19 2022 +0800 octeontx2-af: Fix reference count issue in rvu_sdp_init() pci_get_device() will decrease the reference count for the *from* parameter. So we don't need to call put_device() to decrease the reference. Let's remove the put_device() in the loop and only decrease the reference count of the returned 'pdev' for the last loop because it will not be passed to pci_get_device() as input parameter. We don't need to check if 'pdev' is NULL because it is already checked inside pci_dev_put(). Also add pci_dev_put() for the error path. Fixes: fe1939bb2340 ("octeontx2-af: Add SDP interface support") Signed-off-by: Xiongfeng Wang Reviewed-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221123065919.31499-1-wangxiongfeng2@huawei.com Signed-off-by: Paolo Abeni commit 6aae1bcb41c7aefd28bf5d90e36ebdd151c2d8ba Author: Liu Jian Date: Wed Nov 23 09:16:17 2022 +0800 net: altera_tse: release phylink resources in tse_shutdown() Call phylink_disconnect_phy() in tse_shutdown() to release the resources occupied by phylink_of_phy_connect() in the tse_open(). Fixes: fef2998203e1 ("net: altera: tse: convert to phylink") Signed-off-by: Liu Jian Link: https://lore.kernel.org/r/20221123011617.332302-1-liujian56@huawei.com Signed-off-by: Paolo Abeni commit b0686565946368892c2cdf92f102392e24823588 Author: Li Zetao Date: Tue Nov 22 23:00:46 2022 +0800 virtio_net: Fix probe failed when modprobe virtio_net When doing the following test steps, an error was found: step 1: modprobe virtio_net succeeded # modprobe virtio_net <-- OK step 2: fault injection in register_netdevice() # modprobe -r virtio_net <-- OK # ... FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 3521 Comm: modprobe Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), Call Trace: ... should_failslab+0xa/0x20 ... dev_set_name+0xc0/0x100 netdev_register_kobject+0xc2/0x340 register_netdevice+0xbb9/0x1320 virtnet_probe+0x1d72/0x2658 [virtio_net] ... virtio_net: probe of virtio0 failed with error -22 step 3: modprobe virtio_net failed # modprobe virtio_net <-- failed virtio_net: probe of virtio0 failed with error -2 The root cause of the problem is that the queues are not disable on the error handling path when register_netdevice() fails in virtnet_probe(), resulting in an error "-ENOENT" returned in the next modprobe call in setup_vq(). virtio_pci_modern_device uses virtqueues to send or receive message, and "queue_enable" records whether the queues are available. In vp_modern_find_vqs(), all queues will be selected and activated, but once queues are enabled there is no way to go back except reset. Fix it by reset virtio device on error handling path. This makes error handling follow the same order as normal device cleanup in virtnet_remove() which does: unregister, destroy failover, then reset. And that flow is better tested than error handling so we can be reasonably sure it works well. Fixes: 024655555021 ("virtio_net: fix use after free on allocation failure") Signed-off-by: Li Zetao Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20221122150046.3910638-1-lizetao1@huawei.com Signed-off-by: Paolo Abeni commit 9034b29251818ab7b4b38bf6ca860cee45d2726a Author: Emeel Hakim Date: Wed Nov 9 15:14:28 2022 +0200 net/mlx5e: MACsec, block offload requests with encrypt off Currently offloading MACsec with authentication only (encrypt property set to off) is not supported, block such requests when adding/updating a macsec device. Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit 7c5578e29963c35bb14d08b15df77a0c11f71fc5 Author: Raed Salem Date: Tue Nov 8 14:30:33 2022 +0200 net/mlx5e: MACsec, fix Tx SA active field update Currently during update Tx security association (SA) flow, the Tx SA active state is updated only if the Tx SA in question is the same SA that the MACsec interface is using for Tx,in consequence when the MACsec interface chose to work with this Tx SA later, where this SA for example should have been updated to active state and it was not, the relevant Tx SA HW context won't be installed, hence the MACSec flow won't be offloaded. Fix by update Tx SA active state as part of update flow regardless whether the SA in question is the same Tx SA used by the MACsec interface. Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit c0071be0e16c461680d87b763ba1ee5e46548fde Author: Emeel Hakim Date: Mon Oct 31 11:07:59 2022 +0200 net/mlx5e: MACsec, remove replay window size limitation in offload path Currently offload path limits replay window size to 32/64/128/256 bits, such a limitation should not exist since software allows it. Remove such limitation. Fixes: eb43846b43c3 ("net/mlx5e: Support MACsec offload replay window") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit 194cc051e29ea1641d424126b8f28f9d31d5c655 Author: Emeel Hakim Date: Tue Nov 8 16:19:29 2022 +0200 net/mlx5e: MACsec, fix add Rx security association (SA) rule memory leak Currently MACsec's add Rx SA flow steering (fs) rule routine uses a spec object which is dynamically allocated and do not free it upon leaving. The above led to a memory leak. Fix by freeing dynamically allocated objects. Fixes: 3b20949cb21b ("net/mlx5e: Add MACsec RX steering rules") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit ceb51b273ec0b1a32de8a167c28a602bb3d290a1 Author: Raed Salem Date: Mon Oct 31 09:24:06 2022 +0200 net/mlx5e: MACsec, fix mlx5e_macsec_update_rxsa bail condition and functionality Fix update Rx SA wrong bail condition, naturally update functionality needs to check that something changed otherwise bailout currently the active state check does just the opposite, furthermore unlike deactivate path which remove the macsec rules to deactivate the offload, the activation path does not include the counter part installation of the macsec rules. Fix by using correct bailout condition and when Rx SA changes state to active then add the relevant macsec rules. While at it, refine function name to reflect more precisely its role. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit eead5ea2fce4196139f399a5727602c3747e1370 Author: Raed Salem Date: Mon Oct 31 08:22:04 2022 +0200 net/mlx5e: MACsec, fix update Rx secure channel active field The main functionality for this operation is to update the active state of the Rx security channel (SC) if the new active setting is different from the current active state of this Rx SC, however the relevant active state check is done post updating the current active state to match the new active state, effectively blocks any offload state update for the Rx SC in question. Fix by delay the assignment to be post the relevant check. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit 9b9e23c4dc2b632ece44c68ce6aebc0bf841d6a2 Author: Raed Salem Date: Sun Oct 30 17:16:58 2022 +0200 net/mlx5e: MACsec, fix memory leak when MACsec device is deleted When the MACsec netdevice is deleted, all related Rx/Tx HW/SW states should be released/deallocated, however currently part of the Rx security channel association data is not cleaned properly, hence the memory leaks. Fix by make sure all related Rx Sc resources are cleaned/freed, while at it improve code by grouping release SC context in a function so it can be used in both delete MACsec device and delete Rx SC operations. Fixes: 5a39816a75e5 ("net/mlx5e: Add MACsec offload SecY support") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit 813115c4669d74cdf6fc253c5a1768d1202073c3 Author: Raed Salem Date: Thu Oct 27 15:47:17 2022 +0300 net/mlx5e: MACsec, fix RX data path 16 RX security channel limit Currently the data path metadata flow id mask wrongly limits the number of different RX security channels (SC) to 16, whereas in adding RX SC the limit is "2^16 - 1" this cause an overlap in metadata flow id once more than 16 RX SCs is added, this corrupts MACsec RX offloaded flow handling. Fix by using the correct mask, while at it improve code to use this mask when adding the Rx rule and improve visibility of such errors by adding debug massage. Fixes: b7c9400cbc48 ("net/mlx5e: Implement MACsec Rx data path using MACsec skb_metadata_dst") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit 406e6db7fcaf2a47f6ac8bef47057305c6bc8b0e Author: YueHaibing Date: Tue Nov 8 22:06:14 2022 +0800 net/mlx5e: Use kvfree() in mlx5e_accel_fs_tcp_create() 'accel_tcp' is allocated by kvzalloc(), which should freed by kvfree(). Fixes: f52f2faee581 ("net/mlx5e: Introduce flow steering API") Signed-off-by: YueHaibing Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit bc59c7d326d28a12f61cd068e459235a7a0bd009 Author: Dan Carpenter Date: Mon Oct 17 17:37:29 2022 +0300 net/mlx5e: Fix a couple error codes If kvzalloc() fails then return -ENOMEM. Don't return success. Fixes: 3b20949cb21b ("net/mlx5e: Add MACsec RX steering rules") Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed commit 52c795af04441d76f565c4634f893e5b553df2ae Author: Roi Dayan Date: Mon Nov 14 20:04:29 2022 +0200 net/mlx5e: Fix use-after-free when reverting termination table When having multiple dests with termination tables and second one or afterwards fails the driver reverts usage of term tables but doesn't reset the assignment in attr->dests[num_vport_dests].termtbl which case a use-after-free when releasing the rule. Fix by resetting the assignment of termtbl to null. Fixes: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push actions") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 3f5769a074c13d8f08455e40586600419e02a880 Author: YueHaibing Date: Mon Nov 21 19:22:04 2022 +0800 net/mlx5: Fix uninitialized variable bug in outlen_write() If sscanf() return 0, outlen is uninitialized and used in kzalloc(), this is unexpected. We should return -EINVAL if the string is invalid. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: YueHaibing Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit e87c6a832f889c093c055a30a7b8c6843e6573bf Author: Chris Mi Date: Thu Aug 4 05:09:07 2022 +0300 net/mlx5: E-switch, Fix duplicate lag creation If creating bond first and then enabling sriov in switchdev mode, will hit the following syndrome: mlx5_core 0000:08:00.0: mlx5_cmd_out_err:778:(pid 25543): CREATE_LAG(0x840) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x7d49cb), err(-22) The reason is because the offending patch removes eswitch mode none. In vf lag, the checking of eswitch mode none is replaced by checking if sriov is enabled. But when driver enables sriov, it triggers the bond workqueue task first and then setting sriov number in pci_enable_sriov(). So the check fails. Fix it by checking if sriov is enabled using eswitch internal counter that is set before triggering the bond workqueue task. Fixes: f019679ea5f2 ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 2318b8bb94a3a21363cd0d49cad5934bd1e2d60e Author: Chris Mi Date: Thu Nov 17 09:48:13 2022 +0200 net/mlx5: E-switch, Destroy legacy fdb table when needed The cited commit removes eswitch mode none. But when disabling sriov in legacy mode or changing from switchdev to legacy mode without sriov enabled, the legacy fdb table is not destroyed. It is not the right behavior. Destroy legacy fdb table in above two caes. Fixes: f019679ea5f2 ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Reviewed-by: Eli Cohen Reviewed-by: Mark Bloch Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 52f7cf70eb8fac6111786c59ae9dfc5cf2bee710 Author: YueHaibing Date: Thu Nov 10 21:47:07 2022 +0800 net/mlx5: DR, Fix uninitialized var warning Smatch warns this: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c:81 mlx5dr_table_set_miss_action() error: uninitialized symbol 'ret'. Initializing ret with -EOPNOTSUPP and fix missing action case. Fixes: 7838e1725394 ("net/mlx5: DR, Expose steering table functionality") Signed-off-by: YueHaibing Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 08e8a949f684e1fbc4b1efd2337d72ec8f3613d9 Author: Hanjun Guo Date: Tue Nov 22 20:19:40 2022 +0800 net: wwan: t7xx: Fix the ACPI memory leak The ACPI buffer memory (buffer.pointer) should be freed as the buffer is not used after acpi_evaluate_object(), free it to prevent memory leak. Fixes: 13e920d93e37 ("net: wwan: t7xx: Add core components") Signed-off-by: Hanjun Guo Link: https://lore.kernel.org/r/1669119580-28977-1-git-send-email-guohanjun@huawei.com Signed-off-by: Paolo Abeni commit cd07eadd5147ffdae11b6fd28b77a3872f2a2484 Author: Jiasheng Jiang Date: Tue Nov 22 13:54:49 2022 +0800 octeontx2-pf: Add check for devm_kcalloc As the devm_kcalloc may return NULL pointer, it should be better to add check for the return value, as same as the others. Fixes: e8e095b3b370 ("octeontx2-af: cn10k: Bandwidth profiles config support") Signed-off-by: Jiasheng Jiang Reviewed-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/20221122055449.31247-1-jiasheng@iscas.ac.cn Signed-off-by: Paolo Abeni commit 290b5fe096e7dd0aad730d1af4f7f2d9fea43e11 Author: Vladimir Oltean Date: Tue Nov 22 15:09:36 2022 +0200 net: enetc: preserve TX ring priority across reconfiguration In the blamed commit, a rudimentary reallocation procedure for RX buffer descriptors was implemented, for the situation when their format changes between normal (no PTP) and extended (PTP). enetc_hwtstamp_set() calls enetc_close() and enetc_open() in a sequence, and this sequence loses information which was previously configured in the TX BDR Mode Register, specifically via the enetc_set_bdr_prio() call. The TX ring priority is configured by tc-mqprio and tc-taprio, and affects important things for TSN such as the TX time of packets. The issue manifests itself most visibly by the fact that isochron --txtime reports premature packet transmissions when PTP is first enabled on an enetc interface. Save the TX ring priority in a new field in struct enetc_bdr (occupies a 2 byte hole on arm64) in order to make this survive a ring reconfiguration. Fixes: 434cebabd3a2 ("enetc: Add dynamic allocation of extended Rx BD rings") Signed-off-by: Vladimir Oltean Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/r/20221122130936.1704151-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 9a234a2a085ab9fd2be8d0c1eedfcd10f74b97eb Author: Zhang Changzhong Date: Tue Nov 22 19:10:31 2022 +0800 net: marvell: prestera: add missing unregister_netdev() in prestera_port_create() If prestera_port_sfp_bind() fails, unregister_netdev() should be called in error handling path. Compile tested only. Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") Signed-off-by: Zhang Changzhong Reviewed-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/1669115432-36841-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski commit a73e04c2705e75c72707e9e7dec776b4c430d66b Merge: 06ccc8ec701e4 0254f31a7df3b Author: Jakub Kicinski Date: Wed Nov 23 20:01:53 2022 -0800 Merge branch 'nfc-st-nci-restructure-validating-logic-in-evt_transaction' Martin Faltesek says: ==================== nfc: st-nci: Restructure validating logic in EVT_TRANSACTION These are the same 3 patches that were applied in st21nfca here: https://lore.kernel.org/netdev/20220607025729.1673212-1-mfaltesek@google.com with a couple minor differences. st-nci has nearly identical code to that of st21nfca for EVT_TRANSACTION, except that there are two extra validation checks that are not present in the st-nci code. The 3/3 patch as coded for st21nfca pulls those checks in, bringing both drivers into parity. ==================== Link: https://lore.kernel.org/r/20221122004246.4186422-1-mfaltesek@google.com Signed-off-by: Jakub Kicinski commit 0254f31a7df3bb3b90c2d9dd2d4052f7b95eb287 Author: Martin Faltesek Date: Mon Nov 21 18:42:46 2022 -0600 nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION The transaction buffer is allocated by using the size of the packet buf, and subtracting two which seems intended to remove the two tags which are not present in the target structure. This calculation leads to under counting memory because of differences between the packet contents and the target structure. The aid_len field is a u8 in the packet, but a u32 in the structure, resulting in at least 3 bytes always being under counted. Further, the aid data is a variable length field in the packet, but fixed in the structure, so if this field is less than the max, the difference is added to the under counting. To fix, perform validation checks progressively to safely reach the next field, to determine the size of both buffers and verify both tags. Once all validation checks pass, allocate the buffer and copy the data. This eliminates freeing memory on the error path, as validation checks are moved ahead of memory allocation. Reported-by: Denis Efremov Reviewed-by: Guenter Roeck Fixes: 5d1ceb7f5e56 ("NFC: st21nfcb: Add HCI transaction event support") Signed-off-by: Martin Faltesek Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 440f2ae9c9f06e26f5dcea697a53717fc61a318c Author: Martin Faltesek Date: Mon Nov 21 18:42:45 2022 -0600 nfc: st-nci: fix memory leaks in EVT_TRANSACTION Error path does not free previously allocated memory. Add devm_kfree() to the failure path. Reported-by: Denis Efremov Reviewed-by: Guenter Roeck Fixes: 5d1ceb7f5e56 ("NFC: st21nfcb: Add HCI transaction event support") Signed-off-by: Martin Faltesek Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit c60c152230828825c06e62a8f1ce956d4b659266 Author: Martin Faltesek Date: Mon Nov 21 18:42:44 2022 -0600 nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION The first validation check for EVT_TRANSACTION has two different checks tied together with logical AND. One is a check for minimum packet length, and the other is for a valid aid_tag. If either condition is true (fails), then an error should be triggered. The fix is to change && to ||. Reported-by: Denis Efremov Reviewed-by: Guenter Roeck Fixes: 5d1ceb7f5e56 ("NFC: st21nfcb: Add HCI transaction event support") Signed-off-by: Martin Faltesek Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 7d4a93176e0142ce16d23c849a47d5b00b856296 Author: Ming Lei Date: Mon Nov 21 23:56:45 2022 +0800 ublk_drv: don't forward io commands in reserve order Either ublk_can_use_task_work() is true or not, io commands are forwarded to ublk server in reverse order, since llist_add() is always to add one element to the head of the list. Even though block layer doesn't guarantee request dispatch order, requests should be sent to hardware in the sequence order generated from io scheduler, which usually considers the request's LBA, and order is often important for HDD. So forward io commands in the sequence made from io scheduler by aligning task work with current io_uring command's batch handling, and it has been observed that both can get similar performance data if IORING_SETUP_COOP_TASKRUN is set from ublk server. Reported-by: Andreas Hindborg Cc: Damien Le Moal Signed-off-by: Ming Lei Reviewed-by: Damien Le Moal Reviewed-by: ZiyangZhang Link: https://lore.kernel.org/r/20221121155645.396272-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 06ccc8ec701e4d685c9572e4251cd9735c6e9b49 Merge: 0830b1effdf92 40781bfb836ed Author: Jakub Kicinski Date: Wed Nov 23 19:18:58 2022 -0800 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== ipsec 2022-11-23 1) Fix "disable_policy" on ipv4 early demuxP Packets after the initial packet in a flow might be incorectly dropped on early demux if there are no matching policies. From Eyal Birger. 2) Fix a kernel warning in case XFRM encap type is not available. From Eyal Birger. 3) Fix ESN wrap around for GSO to avoid a double usage of a sequence number. From Christian Langrock. 4) Fix a send_acquire race with pfkey_register. From Herbert Xu. 5) Fix a list corruption panic in __xfrm_state_delete(). Thomas Jarosch. 6) Fix an unchecked return value in xfrm6_init(). Chen Zhongjin. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec: xfrm: Fix ignored return value in xfrm6_init() xfrm: Fix oops in __xfrm_state_delete() af_key: Fix send_acquire race with pfkey_register xfrm: replay: Fix ESN wrap around for GSO xfrm: lwtunnel: squelch kernel warning in case XFRM encap type is not available xfrm: fix "disable_policy" on ipv4 early demux ==================== Link: https://lore.kernel.org/r/20221123093117.434274-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski commit 0830b1effdf92b488c24aa03bc277090c8447527 Merge: b6e7c196ac2f9 bcd9e3c1656d0 Author: Jakub Kicinski Date: Wed Nov 23 19:12:56 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Fix regression in ipset hash:ip with IPv4 range, from Vishwanath Pai. This is fixing up a bug introduced in the 6.0 release. 2) The "netfilter: ipset: enforce documented limit to prevent allocating huge memory" patch contained a wrong condition which makes impossible to add up to 64 clashing elements to a hash:net,iface type of set while it is the documented feature of the set type. The patch fixes the condition and thus makes possible to add the elements while keeps preventing allocating huge memory, from Jozsef Kadlecsik. This has been broken for several releases. 3) Missing locking when updating the flow block list which might lead a reader to crash. This has been broken since the introduction of the flowtable hardware offload support. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: flowtable_offload: add missing locking netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface netfilter: ipset: regression in ip_set_hash_ip.c ==================== Link: https://lore.kernel.org/r/20221122212814.63177-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit b6e7c196ac2f90f08955ca4db568a52160876407 Author: Nir Levy Date: Mon Nov 21 00:06:30 2022 +0200 Documentation: networking: Update generic_netlink_howto URL The documentation refers to invalid web page under www.linuxfoundation.org The patch refers to a working URL under wiki.linuxfoundation.org Signed-off-by: Nir Levy Link: https://lore.kernel.org/all/20221120220630.7443-1-bhr166@gmail.com/ Signed-off-by: Jakub Kicinski commit df1f1ea9569eef05c006aeae1d65fbf6c2339677 Author: Paran Lee Date: Thu Nov 24 07:00:44 2022 +0900 scripts: add rust in scripts/Makefile.package Add rust argument at TAR_CONTENT in scripts/Makefile.package script with alphabetical order. Signed-off-by: Paran Lee Signed-off-by: Masahiro Yamada commit 083cad78042e9eb6d2d727ff561dc6eea36ac9a0 Author: Masahiro Yamada Date: Tue Nov 22 23:39:02 2022 +0900 kbuild: fix "cat: .version: No such file or directory" Since commit 2df8220cc511 ("kbuild: build init/built-in.a just once"), the .version file is not touched at all when KBUILD_BUILD_VERSION is given. If KBUILD_BUILD_VERSION is specified and the .version file is missing (for example right after 'make mrproper'), "No such file or director" is shown. Even if the .version exists, it is irrelevant to the version of the current build. $ make -j$(nproc) KBUILD_BUILD_VERSION=100 mrproper defconfig all [ snip ] BUILD arch/x86/boot/bzImage cat: .version: No such file or directory Kernel: arch/x86/boot/bzImage is ready (#) Show KBUILD_BUILD_VERSION if it is given. Fixes: 2df8220cc511 ("kbuild: build init/built-in.a just once") Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 4313e5a613049dfc1819a6dfb5f94cf2caff9452 Author: Steven Rostedt (Google) Date: Wed Nov 23 17:14:34 2022 -0500 tracing: Free buffers when a used dynamic event is removed After 65536 dynamic events have been added and removed, the "type" field of the event then uses the first type number that is available (not currently used by other events). A type number is the identifier of the binary blobs in the tracing ring buffer (known as events) to map them to logic that can parse the binary blob. The issue is that if a dynamic event (like a kprobe event) is traced and is in the ring buffer, and then that event is removed (because it is dynamic, which means it can be created and destroyed), if another dynamic event is created that has the same number that new event's logic on parsing the binary blob will be used. To show how this can be an issue, the following can crash the kernel: # cd /sys/kernel/tracing # for i in `seq 65536`; do echo 'p:kprobes/foo do_sys_openat2 $arg1:u32' > kprobe_events # done For every iteration of the above, the writing to the kprobe_events will remove the old event and create a new one (with the same format) and increase the type number to the next available on until the type number reaches over 65535 which is the max number for the 16 bit type. After it reaches that number, the logic to allocate a new number simply looks for the next available number. When an dynamic event is removed, that number is then available to be reused by the next dynamic event created. That is, once the above reaches the max number, the number assigned to the event in that loop will remain the same. Now that means deleting one dynamic event and created another will reuse the previous events type number. This is where bad things can happen. After the above loop finishes, the kprobes/foo event which reads the do_sys_openat2 function call's first parameter as an integer. # echo 1 > kprobes/foo/enable # cat /etc/passwd > /dev/null # cat trace cat-2211 [005] .... 2007.849603: foo: (do_sys_openat2+0x0/0x130) arg1=4294967196 cat-2211 [005] .... 2007.849620: foo: (do_sys_openat2+0x0/0x130) arg1=4294967196 cat-2211 [005] .... 2007.849838: foo: (do_sys_openat2+0x0/0x130) arg1=4294967196 cat-2211 [005] .... 2007.849880: foo: (do_sys_openat2+0x0/0x130) arg1=4294967196 # echo 0 > kprobes/foo/enable Now if we delete the kprobe and create a new one that reads a string: # echo 'p:kprobes/foo do_sys_openat2 +0($arg2):string' > kprobe_events And now we can the trace: # cat trace sendmail-1942 [002] ..... 530.136320: foo: (do_sys_openat2+0x0/0x240) arg1= cat-2046 [004] ..... 530.930817: foo: (do_sys_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������" cat-2046 [004] ..... 530.930961: foo: (do_sys_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������" cat-2046 [004] ..... 530.934278: foo: (do_sys_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������" cat-2046 [004] ..... 530.934563: foo: (do_sys_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������" bash-1515 [007] ..... 534.299093: foo: (do_sys_openat2+0x0/0x240) arg1="kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk���������@��4Z����;Y�����U And dmesg has: ================================================================== BUG: KASAN: use-after-free in string+0xd4/0x1c0 Read of size 1 at addr ffff88805fdbbfa0 by task cat/2049 CPU: 0 PID: 2049 Comm: cat Not tainted 6.1.0-rc6-test+ #641 Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016 Call Trace: dump_stack_lvl+0x5b/0x77 print_report+0x17f/0x47b kasan_report+0xad/0x130 string+0xd4/0x1c0 vsnprintf+0x500/0x840 seq_buf_vprintf+0x62/0xc0 trace_seq_printf+0x10e/0x1e0 print_type_string+0x90/0xa0 print_kprobe_event+0x16b/0x290 print_trace_line+0x451/0x8e0 s_show+0x72/0x1f0 seq_read_iter+0x58e/0x750 seq_read+0x115/0x160 vfs_read+0x11d/0x460 ksys_read+0xa9/0x130 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fc2e972ade2 Code: c0 e9 b2 fe ff ff 50 48 8d 3d b2 3f 0a 00 e8 05 f0 01 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24 RSP: 002b:00007ffc64e687c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007fc2e972ade2 RDX: 0000000000020000 RSI: 00007fc2e980d000 RDI: 0000000000000003 RBP: 00007fc2e980d000 R08: 00007fc2e980c010 R09: 0000000000000000 R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000020f00 R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 The buggy address belongs to the physical page: page:ffffea00017f6ec0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5fdbb flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc0000000 0000000000000000 ffffea00017f6ec8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805fdbbe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805fdbbf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805fdbbf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805fdbc000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805fdbc080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== This was found when Zheng Yejian sent a patch to convert the event type number assignment to use IDA, which gives the next available number, and this bug showed up in the fuzz testing by Yujie Liu and the kernel test robot. But after further analysis, I found that this behavior is the same as when the event type numbers go past the 16bit max (and the above shows that). As modules have a similar issue, but is dealt with by setting a "WAS_ENABLED" flag when a module event is enabled, and when the module is freed, if any of its events were enabled, the ring buffer that holds that event is also cleared, to prevent reading stale events. The same can be done for dynamic events. If any dynamic event that is being removed was enabled, then make sure the buffers they were enabled in are now cleared. Link: https://lkml.kernel.org/r/20221123171434.545706e3@gandalf.local.home Link: https://lore.kernel.org/all/20221110020319.1259291-1-zhengyejian1@huawei.com/ Cc: stable@vger.kernel.org Cc: Andrew Morton Depends-on: e18eb8783ec49 ("tracing: Add tracing_reset_all_online_cpus_unlocked() function") Depends-on: 5448d44c38557 ("tracing: Add unified dynamic event framework") Depends-on: 6212dd29683ee ("tracing/kprobes: Use dyn_event framework for kprobe events") Depends-on: 065e63f951432 ("tracing: Only have rmmod clear buffers that its events were active in") Depends-on: 575380da8b469 ("tracing: Only clear trace buffer on module unload if event was traced") Fixes: 77b44d1b7c283 ("tracing/kprobes: Rename Kprobe-tracer to kprobe-event") Reported-by: Zheng Yejian Reported-by: Yujie Liu Reported-by: kernel test robot Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit e18eb8783ec4949adebc7d7b0fdb65f65bfeefd9 Author: Steven Rostedt (Google) Date: Wed Nov 23 14:25:57 2022 -0500 tracing: Add tracing_reset_all_online_cpus_unlocked() function Currently the tracing_reset_all_online_cpus() requires the trace_types_lock held. But only one caller of this function actually has that lock held before calling it, and the other just takes the lock so that it can call it. More users of this function is needed where the lock is not held. Add a tracing_reset_all_online_cpus_unlocked() function for the one use case that calls it without being held, and also add a lockdep_assert to make sure it is held when called. Then have tracing_reset_all_online_cpus() take the lock internally, such that callers do not need to worry about taking it. Link: https://lkml.kernel.org/r/20221123192741.658273220@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Cc: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit ef38c79a522b660f7f71d45dad2d6244bc741841 Author: Steven Rostedt (Google) Date: Wed Nov 23 16:43:23 2022 -0500 tracing: Fix race where histograms can be called before the event commit 94eedf3dded5 ("tracing: Fix race where eprobes can be called before the event") fixed an issue where if an event is soft disabled, and the trigger is being added, there's a small window where the event sees that there's a trigger but does not see that it requires reading the event yet, and then calls the trigger with the record == NULL. This could be solved with adding memory barriers in the hot path, or to make sure that all the triggers requiring a record check for NULL. The latter was chosen. Commit 94eedf3dded5 set the eprobe trigger handle to check for NULL, but the same needs to be done with histograms. Link: https://lore.kernel.org/linux-trace-kernel/20221118211809.701d40c0f8a757b0df3c025a@kernel.org/ Link: https://lore.kernel.org/linux-trace-kernel/20221123164323.03450c3a@gandalf.local.home Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events") Reported-by: Masami Hiramatsu (Google) Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit fe08e36be9ecbf6b38714a77c97b1d25b7a6e4b0 Merge: 47b0c2e4c220f 8332f0ed4f187 Author: Paolo Bonzini Date: Wed Nov 23 18:52:29 2022 -0500 Merge branch 'kvm-dwmw2-fixes' into HEAD This brings in a few important fixes for Xen emulation. While nobody should be enabling it, the bug effectively allows userspace to read arbitrary memory. Signed-off-by: Paolo Bonzini commit 8332f0ed4f187c7b700831bd7cc83ce180a944b9 Author: David Woodhouse Date: Sat Nov 19 09:25:39 2022 +0000 KVM: Update gfn_to_pfn_cache khva when it moves within the same page In the case where a GPC is refreshed to a different location within the same page, we didn't bother to update it. Mostly we don't need to, but since the ->khva field also includes the offset within the page, that does have to be updated. Fixes: 3ba2c95ea180 ("KVM: Do not incorporate page offset into gfn=>pfn cache user address") Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant Reviewed-by: Sean Christopherson Cc: stable@kernel.org Signed-off-by: Paolo Bonzini commit c2b8cdfaf3a6721afe0c8c060a631b1c67a7f1ee Author: David Woodhouse Date: Sat Nov 12 13:52:25 2022 +0000 KVM: x86/xen: Only do in-kernel acceleration of hypercalls for guest CPL0 There are almost no hypercalls which are valid from CPL > 0, and definitely none which are handled by the kernel. Fixes: 2fd6df2f2b47 ("KVM: x86/xen: intercept EVTCHNOP_send from guests") Reported-by: Michal Luczaj Signed-off-by: David Woodhouse Reviewed-by: Sean Christopherson Cc: stable@kernel.org Signed-off-by: Paolo Bonzini commit 4ea9439fd537313f3381f0af4ebbf05e3f51a58c Author: David Woodhouse Date: Sat Nov 12 13:48:58 2022 +0000 KVM: x86/xen: Validate port number in SCHEDOP_poll We shouldn't allow guests to poll on arbitrary port numbers off the end of the event channel table. Fixes: 1a65105a5aba ("KVM: x86/xen: handle PV spinlocks slowpath") [dwmw2: my bug though; the original version did check the validity as a side-effect of an idr_find() which I ripped out in refactoring.] Reported-by: Michal Luczaj Signed-off-by: David Woodhouse Reviewed-by: Sean Christopherson Cc: stable@kernel.org Signed-off-by: Paolo Bonzini commit 47b0c2e4c220f2251fd8dcfbb44479819c715e15 Author: Kazuki Takiguchi Date: Wed Nov 23 14:36:00 2022 -0500 KVM: x86/mmu: Fix race condition in direct_page_fault make_mmu_pages_available() must be called with mmu_lock held for write. However, if the TDP MMU is used, it will be called with mmu_lock held for read. This function does nothing unless shadow pages are used, so there is no race unless nested TDP is used. Since nested TDP uses shadow pages, old shadow pages may be zapped by this function even when the TDP MMU is enabled. Since shadow pages are never allocated by kvm_tdp_mmu_map(), a race condition can be avoided by not calling make_mmu_pages_available() if the TDP MMU is currently in use. I encountered this when repeatedly starting and stopping nested VM. It can be artificially caused by allocating a large number of nested TDP SPTEs. For example, the following BUG and general protection fault are caused in the host kernel. pte_list_remove: 00000000cd54fc10 many->many ------------[ cut here ]------------ kernel BUG at arch/x86/kvm/mmu/mmu.c:963! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI RIP: 0010:pte_list_remove.cold+0x16/0x48 [kvm] Call Trace: drop_spte+0xe0/0x180 [kvm] mmu_page_zap_pte+0x4f/0x140 [kvm] __kvm_mmu_prepare_zap_page+0x62/0x3e0 [kvm] kvm_mmu_zap_oldest_mmu_pages+0x7d/0xf0 [kvm] direct_page_fault+0x3cb/0x9b0 [kvm] kvm_tdp_page_fault+0x2c/0xa0 [kvm] kvm_mmu_page_fault+0x207/0x930 [kvm] npf_interception+0x47/0xb0 [kvm_amd] svm_invoke_exit_handler+0x13c/0x1a0 [kvm_amd] svm_handle_exit+0xfc/0x2c0 [kvm_amd] kvm_arch_vcpu_ioctl_run+0xa79/0x1780 [kvm] kvm_vcpu_ioctl+0x29b/0x6f0 [kvm] __x64_sys_ioctl+0x95/0xd0 do_syscall_64+0x5c/0x90 general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI RIP: 0010:kvm_mmu_commit_zap_page.part.0+0x4b/0xe0 [kvm] Call Trace: kvm_mmu_zap_oldest_mmu_pages+0xae/0xf0 [kvm] direct_page_fault+0x3cb/0x9b0 [kvm] kvm_tdp_page_fault+0x2c/0xa0 [kvm] kvm_mmu_page_fault+0x207/0x930 [kvm] npf_interception+0x47/0xb0 [kvm_amd] CVE: CVE-2022-45869 Fixes: a2855afc7ee8 ("KVM: x86/mmu: Allow parallel page faults for the TDP MMU") Signed-off-by: Kazuki Takiguchi Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit c3eb11fbb826879be773c137f281569efce67aa8 Merge: 4312098baf37e ac9ccce8717df Author: Linus Torvalds Date: Wed Nov 23 14:45:33 2022 -0800 Merge tag 'pci-v6.1-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Update MAINTAINERS to add Manivannan Sadhasivam as Qcom PCIe RC maintainer (replacing Stanimir Varbanov) and include DT PCI bindings in the "PCI native host bridge and endpoint drivers" entry. * tag 'pci-v6.1-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: MAINTAINERS: Include PCI bindings in host bridge entry MAINTAINERS: Add Manivannan Sadhasivam as Qcom PCIe RC maintainer commit ac8db824ead0de2e9111337c401409d010fba2f0 Author: Chuck Lever Date: Wed Nov 23 14:14:32 2022 -0500 NFSD: Fix reads with a non-zero offset that don't end on a page boundary This was found when virtual machines with nfs-mounted qcow2 disks failed to boot properly. Reported-by: Anders Blomdell Suggested-by: Al Viro Link: https://bugzilla.redhat.com/show_bug.cgi?id=2142132 Fixes: bfbfb6182ad1 ("nfsd_splice_actor(): handle compound pages") Signed-off-by: Chuck Lever commit 4312098baf37ee17a8350725e6e0d0e8590252d4 Merge: fd64898dfed51 e85e9e0d8cb75 Author: Linus Torvalds Date: Wed Nov 23 11:19:06 2022 -0800 Merge tag 'spi-fix-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few fixes, all device specific. The most important ones are for the i.MX driver which had a couple of nasty data corruption inducing errors appear after the change to support PIO mode in the last merge window (one introduced by the change and one latent one which the PIO changes exposed). Thanks to Frieder, Fabio, Marc and Marek for jumping on that and resolving the issues quickly once they were found" * tag 'spi-fix-v6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-imx: spi_imx_transfer_one(): check for DMA transfer first spi: tegra210-quad: Fix duplicate resource error spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld() spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock spi: mediatek: Fix DEVAPC Violation at KO Remove commit fd64898dfed510a55b66080f8ab5c9b06982bbce Merge: 9f0933ac026f7 391c18cf776eb Author: Linus Torvalds Date: Wed Nov 23 11:06:09 2022 -0800 Merge tag '9p-for-6.1-rc7' of https://github.com/martinetd/linux Pull 9p fixes from Dominique Martinet: - 9p now uses a variable size for its recv buffer, but every place hadn't been updated properly to use it and some buffer overflows have been found and needed fixing. There's still one place where msize is incorrectly used in a safety check (p9_check_errors), but all paths leading to it should already be avoiding overflows and that patch took a bit more time to get right for zero-copy requests so I'll send it for 6.2 - yet another race condition in p9_conn_cancel introduced by a fix for a syzbot report in the same place. Maybe at some point we'll get it right without burning it all down... * tag '9p-for-6.1-rc7' of https://github.com/martinetd/linux: 9p/xen: check logical size for buffer size 9p/fd: Use P9_HDRSZ for header size 9p/fd: Fix write overflow in p9_read_work 9p/fd: fix issue of list_del corruption in p9_fd_cancel() commit 8ac3b5cd3e0521d92f9755e90d140382fc292510 Author: Greg Kroah-Hartman Date: Tue Sep 20 19:06:33 2022 +0200 lib/vdso: use "grep -E" instead of "egrep" The latest version of grep claims the egrep is now obsolete so the build now contains warnings that look like: egrep: warning: egrep is obsolescent; using grep -E fix this up by moving the vdso Makefile to use "grep -E" instead. Cc: Andy Lutomirski Cc: Thomas Gleixner Reviewed-by: Vincenzo Frascino Link: https://lore.kernel.org/r/20220920170633.3133829-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 9f0933ac026f7e54fe096797af9de20724e79097 Author: David Howells Date: Mon Nov 21 16:31:34 2022 +0000 fscache: fix OOB Read in __fscache_acquire_volume The type of a->key[0] is char in fscache_volume_same(). If the length of cache volume key is greater than 127, the value of a->key[0] is less than 0. In this case, klen becomes much larger than 255 after type conversion, because the type of klen is size_t. As a result, memcmp() is read out of bounds. This causes a slab-out-of-bounds Read in __fscache_acquire_volume(), as reported by Syzbot. Fix this by changing the type of the stored key to "u8 *" rather than "char *" (it isn't a simple string anyway). Also put in a check that the volume name doesn't exceed NAME_MAX. BUG: KASAN: slab-out-of-bounds in memcmp+0x16f/0x1c0 lib/string.c:757 Read of size 8 at addr ffff888016f3aa90 by task syz-executor344/3613 Call Trace: memcmp+0x16f/0x1c0 lib/string.c:757 memcmp include/linux/fortify-string.h:420 [inline] fscache_volume_same fs/fscache/volume.c:133 [inline] fscache_hash_volume fs/fscache/volume.c:171 [inline] __fscache_acquire_volume+0x76c/0x1080 fs/fscache/volume.c:328 fscache_acquire_volume include/linux/fscache.h:204 [inline] v9fs_cache_session_get_cookie+0x143/0x240 fs/9p/cache.c:34 v9fs_session_init+0x1166/0x1810 fs/9p/v9fs.c:473 v9fs_mount+0xba/0xc90 fs/9p/vfs_super.c:126 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 Fixes: 62ab63352350 ("fscache: Implement volume registration") Reported-by: syzbot+a76f6a6e524cf2080aa3@syzkaller.appspotmail.com Signed-off-by: David Howells Reviewed-by: Zhang Peng Reviewed-by: Jingbo Xu cc: Dominique Martinet cc: Jeff Layton cc: v9fs-developer@lists.sourceforge.net cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/Y3OH+Dmi0QIOK18n@codewreck.org/ # Zhang Peng's v1 fix Link: https://lore.kernel.org/r/20221115140447.2971680-1-zhangpeng362@huawei.com/ # Zhang Peng's v2 fix Link: https://lore.kernel.org/r/166869954095.3793579.8500020902371015443.stgit@warthog.procyon.org.uk/ # v1 Signed-off-by: Linus Torvalds commit 7e8a05b47ba7200f333eefd19979eeb4d273ceec Author: Stefan Haberland Date: Wed Nov 23 17:07:19 2022 +0100 s390/dasd: fix possible buffer overflow in copy_pair_show dasd_copy_relation->entry[] array might be accessed out of bounds if the loop does not break. Fixes: a91ff09d39f9 ("s390/dasd: add copy pair setup") Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20221123160719.3002694-5-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 590ce6d96d6a224b470a3862c33a483d5022bfdb Author: Stefan Haberland Date: Wed Nov 23 17:07:18 2022 +0100 s390/dasd: fix no record found for raw_track_access For DASD devices in raw_track_access mode only full track images are read and written. For this purpose it is not necessary to do search operation in the locate record extended function. The documentation even states that this might fail if the searched record is not found on a track. Currently the driver sets a value of 1 in the search field for the first record after record zero. This is the default for disks not in raw_track_access mode but record 1 might be missing on a completely empty track. There has not been any problem with this on IBM storage servers but it might lead to errors with DASD devices on other vendors storage servers. Fix this by setting the search field to 0. Record zero is always available even on a completely empty track. Fixes: e4dbb0f2b5dd ("[S390] dasd: Add support for raw ECKD access.") Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20221123160719.3002694-4-sth@linux.ibm.com Signed-off-by: Jens Axboe commit b49e648fcca7e420c4ad670a548e19f0e8531c30 Author: Stefan Haberland Date: Wed Nov 23 17:07:17 2022 +0100 s390/dasd: increase printing of debug data payload 32 byte are to less for important data from prefix or other commands. Print up to 128 byte data. This is enough for the largest CCW data we have. Since printk can only print up to 1024 byte at once, print the different parts of the CCW dumps separately. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20221123160719.3002694-3-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 4ba5f0c36cfdda68347269c02961cd90f8443ace Author: Colin Ian King Date: Wed Nov 23 17:07:16 2022 +0100 s390/dasd: Fix spelling mistake "Ivalid" -> "Invalid" There is a spelling mistake in a pr_warn message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220923132103.2486724-1-colin.i.king@gmail.com Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20221123160719.3002694-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 45605c75c52c7ae7bfe902214343aabcfe5ba0ff Author: Wang Hai Date: Wed Nov 16 01:24:07 2022 +0800 e100: Fix possible use after free in e100_xmit_prepare In e100_xmit_prepare(), if we can't map the skb, then return -ENOMEM, so e100_xmit_frame() will return NETDEV_TX_BUSY and the upper layer will resend the skb. But the skb is already freed, which will cause UAF bug when the upper layer resends the skb. Remove the harmful free. Fixes: 5e5d49422dfb ("e100: Release skb when DMA mapping is failed in e100_xmit_prepare") Signed-off-by: Wang Hai Reviewed-by: Alexander Duyck Signed-off-by: Tony Nguyen commit 227d8d2f7f2278b8468c5531b0cd0f2a905b4486 Author: Yuan Can Date: Mon Nov 14 08:26:40 2022 +0000 iavf: Fix error handling in iavf_init_module() The iavf_init_module() won't destroy workqueue when pci_register_driver() failed. Call destroy_workqueue() when pci_register_driver() failed to prevent the resource leak. Similar to the handling of u132_hcd_init in commit f276e002793c ("usb: u132-hcd: fix resource leak") Fixes: 2803b16c10ea ("i40e/i40evf: Use private workqueue") Signed-off-by: Yuan Can Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 771a794c0a3c3e7f0d86cc34be4f9537e8c0a20c Author: Yuan Can Date: Mon Nov 14 08:26:39 2022 +0000 fm10k: Fix error handling in fm10k_init_module() A problem about modprobe fm10k failed is triggered with the following log given: Intel(R) Ethernet Switch Host Interface Driver Copyright(c) 2013 - 2019 Intel Corporation. debugfs: Directory 'fm10k' with parent '/' already present! The reason is that fm10k_init_module() returns fm10k_register_pci_driver() directly without checking its return value, if fm10k_register_pci_driver() failed, it returns without removing debugfs and destroy workqueue, resulting the debugfs of fm10k can never be created later and leaks the workqueue. fm10k_init_module() alloc_workqueue() fm10k_dbg_init() # create debugfs fm10k_register_pci_driver() pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without remove debugfs and destroy workqueue Fix by remove debugfs and destroy workqueue when fm10k_register_pci_driver() returns error. Fixes: 7461fd913afe ("fm10k: Add support for debugfs") Fixes: b382bb1b3e2d ("fm10k: use separate workqueue for fm10k driver") Signed-off-by: Yuan Can Reviewed-by: Jacob Keller Signed-off-by: Tony Nguyen commit 479dd06149425b9e00477f52200872587af76a48 Author: Shang XiaoJing Date: Wed Nov 16 09:27:25 2022 +0800 i40e: Fix error handling in i40e_init_module() i40e_init_module() won't free the debugfs directory created by i40e_dbg_init() when pci_register_driver() failed. Add fail path to call i40e_dbg_exit() to remove the debugfs entries to prevent the bug. i40e: Intel(R) Ethernet Connection XL710 Network Driver i40e: Copyright (c) 2013 - 2019 Intel Corporation. debugfs: Directory 'i40e' with parent '/' already present! Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Shang XiaoJing Reviewed-by: Leon Romanovsky Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 8cfa238a48f34038464b99d0b4825238c2687181 Author: Shang XiaoJing Date: Mon Nov 14 10:57:58 2022 +0800 ixgbevf: Fix resource leak in ixgbevf_init_module() ixgbevf_init_module() won't destroy the workqueue created by create_singlethread_workqueue() when pci_register_driver() failed. Add destroy_workqueue() in fail path to prevent the resource leak. Similar to the handling of u132_hcd_init in commit f276e002793c ("usb: u132-hcd: fix resource leak") Fixes: 40a13e2493c9 ("ixgbevf: Use a private workqueue to avoid certain possible hangs") Signed-off-by: Shang XiaoJing Reviewed-by: Saeed Mahameed Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit ecae4c8954a1faba6fcc4fe6ec1680b3c4e393d1 Merge: 05530ef7cf7c7 db8f91d424fe0 Author: Takashi Iwai Date: Wed Nov 23 17:14:10 2022 +0100 Merge tag 'asoc-fix-v6.1-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.1 A clutch of small fixes that have come in in the past week, people seem to have been unusually active for this late in the release cycle. The most critical one here is the fix to renumber the SOF DAI types in order to restore ABI compatibility which was broken by the addition of AMD support. commit ffdbb44f2f23f963b8f5672e35c3a26088177a62 Author: Zhen Lei Date: Tue Nov 22 19:50:02 2022 +0800 btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs() Although kset_unregister() can eventually remove all attribute files, explicitly rolling back with the matching function makes the code logic look clearer. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Zhen Lei Reviewed-by: David Sterba Signed-off-by: David Sterba commit 796787c978efbbdb50e245718c784eb94f59eac4 Author: Filipe Manana Date: Mon Nov 21 10:23:22 2022 +0000 btrfs: do not modify log tree while holding a leaf from fs tree locked When logging an inode in full mode, or when logging xattrs or when logging the dir index items of a directory, we are modifying the log tree while holding a read lock on a leaf from the fs/subvolume tree. This can lead to a deadlock in rare circumstances, but it is a real possibility, and it was recently reported by syzbot with the following trace from lockdep: WARNING: possible circular locking dependency detected 6.1.0-rc5-next-20221116-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/16154 is trying to acquire lock: ffff88807e3084a0 (&delayed_node->mutex){+.+.}-{3:3}, at: __btrfs_release_delayed_node.part.0+0xa1/0xf30 fs/btrfs/delayed-inode.c:256 but task is already holding lock: ffff88807df33078 (btrfs-log-00){++++}-{3:3}, at: __btrfs_tree_lock+0x32/0x3d0 fs/btrfs/locking.c:197 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (btrfs-log-00){++++}-{3:3}: down_read_nested+0x9e/0x450 kernel/locking/rwsem.c:1634 __btrfs_tree_read_lock+0x32/0x350 fs/btrfs/locking.c:135 btrfs_tree_read_lock fs/btrfs/locking.c:141 [inline] btrfs_read_lock_root_node+0x82/0x3a0 fs/btrfs/locking.c:280 btrfs_search_slot_get_root fs/btrfs/ctree.c:1678 [inline] btrfs_search_slot+0x3ca/0x2c70 fs/btrfs/ctree.c:1998 btrfs_lookup_csum+0x116/0x3f0 fs/btrfs/file-item.c:209 btrfs_csum_file_blocks+0x40e/0x1370 fs/btrfs/file-item.c:1021 log_csums.isra.0+0x244/0x2d0 fs/btrfs/tree-log.c:4258 copy_items.isra.0+0xbfb/0xed0 fs/btrfs/tree-log.c:4403 copy_inode_items_to_log+0x13d6/0x1d90 fs/btrfs/tree-log.c:5873 btrfs_log_inode+0xb19/0x4680 fs/btrfs/tree-log.c:6495 btrfs_log_inode_parent+0x890/0x2a20 fs/btrfs/tree-log.c:6982 btrfs_log_dentry_safe+0x59/0x80 fs/btrfs/tree-log.c:7083 btrfs_sync_file+0xa41/0x13c0 fs/btrfs/file.c:1921 vfs_fsync_range+0x13e/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2856 [inline] iomap_dio_complete+0x73a/0x920 fs/iomap/direct-io.c:128 btrfs_direct_write fs/btrfs/file.c:1536 [inline] btrfs_do_write_iter+0xba2/0x1470 fs/btrfs/file.c:1668 call_write_iter include/linux/fs.h:2160 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x74/0xa0 fs/read_write.c:902 iter_file_splice_write+0x745/0xc90 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:931 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:886 do_splice_direct+0x1ab/0x280 fs/splice.c:974 do_sendfile+0xb19/0x1270 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64 fs/read_write.c:1309 [inline] __x64_sys_sendfile64+0x259/0x2c0 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (btrfs-tree-00){++++}-{3:3}: __lock_release kernel/locking/lockdep.c:5382 [inline] lock_release+0x371/0x810 kernel/locking/lockdep.c:5688 up_write+0x2a/0x520 kernel/locking/rwsem.c:1614 btrfs_tree_unlock_rw fs/btrfs/locking.h:189 [inline] btrfs_unlock_up_safe+0x1e3/0x290 fs/btrfs/locking.c:238 search_leaf fs/btrfs/ctree.c:1832 [inline] btrfs_search_slot+0x265e/0x2c70 fs/btrfs/ctree.c:2074 btrfs_insert_empty_items+0xbd/0x1c0 fs/btrfs/ctree.c:4133 btrfs_insert_delayed_item+0x826/0xfa0 fs/btrfs/delayed-inode.c:746 btrfs_insert_delayed_items fs/btrfs/delayed-inode.c:824 [inline] __btrfs_commit_inode_delayed_items fs/btrfs/delayed-inode.c:1111 [inline] __btrfs_run_delayed_items+0x280/0x590 fs/btrfs/delayed-inode.c:1153 flush_space+0x147/0xe90 fs/btrfs/space-info.c:728 btrfs_async_reclaim_metadata_space+0x541/0xc10 fs/btrfs/space-info.c:1086 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #0 (&delayed_node->mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747 __btrfs_release_delayed_node.part.0+0xa1/0xf30 fs/btrfs/delayed-inode.c:256 __btrfs_release_delayed_node fs/btrfs/delayed-inode.c:251 [inline] btrfs_release_delayed_node fs/btrfs/delayed-inode.c:281 [inline] btrfs_remove_delayed_node+0x52/0x60 fs/btrfs/delayed-inode.c:1285 btrfs_evict_inode+0x511/0xf30 fs/btrfs/inode.c:5554 evict+0x2ed/0x6b0 fs/inode.c:664 dispose_list+0x117/0x1e0 fs/inode.c:697 prune_icache_sb+0xeb/0x150 fs/inode.c:896 super_cache_scan+0x391/0x590 fs/super.c:106 do_shrink_slab+0x464/0xce0 mm/vmscan.c:843 shrink_slab_memcg mm/vmscan.c:912 [inline] shrink_slab+0x388/0x660 mm/vmscan.c:991 shrink_node_memcgs mm/vmscan.c:6088 [inline] shrink_node+0x93d/0x1f30 mm/vmscan.c:6117 shrink_zones mm/vmscan.c:6355 [inline] do_try_to_free_pages+0x3b4/0x17a0 mm/vmscan.c:6417 try_to_free_mem_cgroup_pages+0x3a4/0xa70 mm/vmscan.c:6732 reclaim_high.constprop.0+0x182/0x230 mm/memcontrol.c:2393 mem_cgroup_handle_over_high+0x190/0x520 mm/memcontrol.c:2578 try_charge_memcg+0xe0c/0x12f0 mm/memcontrol.c:2816 try_charge mm/memcontrol.c:2827 [inline] charge_memcg+0x90/0x3b0 mm/memcontrol.c:6889 __mem_cgroup_charge+0x2b/0x90 mm/memcontrol.c:6910 mem_cgroup_charge include/linux/memcontrol.h:667 [inline] __filemap_add_folio+0x615/0xf80 mm/filemap.c:852 filemap_add_folio+0xaf/0x1e0 mm/filemap.c:934 __filemap_get_folio+0x389/0xd80 mm/filemap.c:1976 pagecache_get_page+0x2e/0x280 mm/folio-compat.c:104 find_or_create_page include/linux/pagemap.h:612 [inline] alloc_extent_buffer+0x2b9/0x1580 fs/btrfs/extent_io.c:4588 btrfs_init_new_buffer fs/btrfs/extent-tree.c:4869 [inline] btrfs_alloc_tree_block+0x2e1/0x1320 fs/btrfs/extent-tree.c:4988 __btrfs_cow_block+0x3b2/0x1420 fs/btrfs/ctree.c:440 btrfs_cow_block+0x2fa/0x950 fs/btrfs/ctree.c:595 btrfs_search_slot+0x11b0/0x2c70 fs/btrfs/ctree.c:2038 btrfs_update_root+0xdb/0x630 fs/btrfs/root-tree.c:137 update_log_root fs/btrfs/tree-log.c:2841 [inline] btrfs_sync_log+0xbfb/0x2870 fs/btrfs/tree-log.c:3064 btrfs_sync_file+0xdb9/0x13c0 fs/btrfs/file.c:1947 vfs_fsync_range+0x13e/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2856 [inline] iomap_dio_complete+0x73a/0x920 fs/iomap/direct-io.c:128 btrfs_direct_write fs/btrfs/file.c:1536 [inline] btrfs_do_write_iter+0xba2/0x1470 fs/btrfs/file.c:1668 call_write_iter include/linux/fs.h:2160 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x74/0xa0 fs/read_write.c:902 iter_file_splice_write+0x745/0xc90 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:931 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:886 do_splice_direct+0x1ab/0x280 fs/splice.c:974 do_sendfile+0xb19/0x1270 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64 fs/read_write.c:1309 [inline] __x64_sys_sendfile64+0x259/0x2c0 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &delayed_node->mutex --> btrfs-tree-00 --> btrfs-log-00 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(btrfs-log-00); lock(btrfs-tree-00); lock(btrfs-log-00); lock(&delayed_node->mutex); Holding a read lock on a leaf from a fs/subvolume tree creates a nasty lock dependency when we are COWing extent buffers for the log tree and we have two tasks modifying the log tree, with each one in one of the following 2 scenarios: 1) Modifying the log tree triggers an extent buffer allocation while holding a write lock on a parent extent buffer from the log tree. Allocating the pages for an extent buffer, or the extent buffer struct, can trigger inode eviction and finally the inode eviction will trigger a release/remove of a delayed node, which requires taking the delayed node's mutex; 2) Allocating a metadata extent for a log tree can trigger the async reclaim thread and make us wait for it to release enough space and unblock our reservation ticket. The reclaim thread can start flushing delayed items, and that in turn results in the need to lock delayed node mutexes and in the need to write lock extent buffers of a subvolume tree - all this while holding a write lock on the parent extent buffer in the log tree. So one task in scenario 1) running in parallel with another task in scenario 2) could lead to a deadlock, one wanting to lock a delayed node mutex while having a read lock on a leaf from the subvolume, while the other is holding the delayed node's mutex and wants to write lock the same subvolume leaf for flushing delayed items. Fix this by cloning the leaf of the fs/subvolume tree, release/unlock the fs/subvolume leaf and use the clone leaf instead. Reported-by: syzbot+9b7c21f486f5e7f8d029@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-btrfs/000000000000ccc93c05edc4d8cf@google.com/ CC: stable@vger.kernel.org # 6.0+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 8fe97d47b52ae1ad130470b1780f0ded4ba609a4 Author: Christoph Hellwig Date: Sun Nov 20 13:43:03 2022 +0100 btrfs: use kvcalloc in btrfs_get_dev_zone_info Otherwise the kernel memory allocator seems to be unhappy about failing order 6 allocations for the zones array, that cause 100% reproducible mount failures in my qemu setup: [26.078981] mount: page allocation failure: order:6, mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null) [26.079741] CPU: 0 PID: 2965 Comm: mount Not tainted 6.1.0-rc5+ #185 [26.080181] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [26.080950] Call Trace: [26.081132] [26.081291] dump_stack_lvl+0x56/0x6f [26.081554] warn_alloc+0x117/0x140 [26.081808] ? __alloc_pages_direct_compact+0x1b5/0x300 [26.082174] __alloc_pages_slowpath.constprop.0+0xd0e/0xde0 [26.082569] __alloc_pages+0x32a/0x340 [26.082836] __kmalloc_large_node+0x4d/0xa0 [26.083133] ? trace_kmalloc+0x29/0xd0 [26.083399] kmalloc_large+0x14/0x60 [26.083654] btrfs_get_dev_zone_info+0x1b9/0xc00 [26.083980] ? _raw_spin_unlock_irqrestore+0x28/0x50 [26.084328] btrfs_get_dev_zone_info_all_devices+0x54/0x80 [26.084708] open_ctree+0xed4/0x1654 [26.084974] btrfs_mount_root.cold+0x12/0xde [26.085288] ? lock_is_held_type+0xe2/0x140 [26.085603] legacy_get_tree+0x28/0x50 [26.085876] vfs_get_tree+0x1d/0xb0 [26.086139] vfs_kern_mount.part.0+0x6c/0xb0 [26.086456] btrfs_mount+0x118/0x3a0 [26.086728] ? lock_is_held_type+0xe2/0x140 [26.087043] legacy_get_tree+0x28/0x50 [26.087323] vfs_get_tree+0x1d/0xb0 [26.087587] path_mount+0x2ba/0xbe0 [26.087850] ? _raw_spin_unlock_irqrestore+0x38/0x50 [26.088217] __x64_sys_mount+0xfe/0x140 [26.088506] do_syscall_64+0x35/0x80 [26.088776] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 5b316468983d ("btrfs: get zone information of zoned block devices") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9ac74f0666ceab0b1047e9d59be846a3345e4e98 Author: Wei Yongjun Date: Mon Nov 14 11:08:29 2022 +0000 s390/ap: fix memory leak in ap_init_qci_info() If kzalloc() for 'ap_qci_info_old' failed, 'ap_qci_info' shold be freed before return. Otherwise it is a memory leak. Link: https://lore.kernel.org/r/20221114110830.542246-1-weiyongjun@huaweicloud.com Fixes: 283915850a44 ("s390/ap: notify drivers on config changed and scan complete callbacks") Signed-off-by: Wei Yongjun Signed-off-by: Harald Freudenberger Signed-off-by: Alexander Gordeev commit ecb41b71ef90cf4741bcc3286b769dda746b67e6 Author: Jane Jian Date: Wed Nov 16 18:22:52 2022 +0800 drm/amdgpu/vcn: re-use original vcn0 doorbell value root cause that S2A need to use deduct offset flag. after setting this flag, vcn0 doorbell value works. so return it as before Signed-off-by: Jane Jian Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 602ad43c3cd8f15cbb25ce9bb494129edb2024ed Author: Alex Deucher Date: Mon Nov 21 12:34:14 2022 -0500 drm/amdgpu: Partially revert "drm/amdgpu: update drm_display_info correctly when the edid is read" This partially reverts 20543be93ca45968f344261c1a997177e51bd7e1. Calling drm_connector_update_edid_property() in amdgpu_connector_free_edid() causes a noticeable pause in the system every 10 seconds on polled outputs so revert this part of the change. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2257 Cc: Claudio Suarez Acked-by: Luben Tuikov Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit a6e1775da04ab042bc9e2e42399fa25714c253da Author: Tsung-hua Lin Date: Wed Nov 9 12:54:22 2022 +0800 drm/amd/display: No display after resume from WB/CB [why] First MST sideband message returns AUX_RET_ERROR_HPD_DISCON on certain intel platform. Aux transaction considered failure if HPD unexpected pulled low. The actual aux transaction success in such case, hence do not return error. [how] Not returning error when AUX_RET_ERROR_HPD_DISCON detected on the first sideband message. v2: squash in fix (Alex) Reviewed-by: Jerry Zuo Acked-by: Brian Chang Signed-off-by: Tsung-hua Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 3cb93f390453cde4d6afda1587aaa00e75e09617 Author: Stanley.Yang Date: Wed Nov 16 17:08:22 2022 +0800 drm/amdgpu: fix use-after-free during gpu recovery [Why] [ 754.862560] refcount_t: underflow; use-after-free. [ 754.862898] Call Trace: [ 754.862903] [ 754.862913] amdgpu_job_free_cb+0xc2/0xe1 [amdgpu] [ 754.863543] drm_sched_main.cold+0x34/0x39 [amd_sched] [How] The fw_fence may be not init, check whether dma_fence_init is performed before job free Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit f2e1aa267f12b82e03927d1e918d2844ddd3eea5 Author: lyndonli Date: Mon Nov 21 09:08:42 2022 +0800 drm/amd/pm: update driver if header for smu_13_0_7 update driver if header for smu_13_0_7 Signed-off-by: lyndonli Reviewed-by: Hawking Zhang Reviewed-by: Kenneth Feng Reviewed-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit a26a54fbe32b564ff868710d59fbe1a387a2cc7c Author: David Galiffi Date: Thu Nov 10 14:40:20 2022 -0500 drm/amd/display: Fix rotated cursor offset calculation [Why] Underflow is observed when cursor is still enabled when the cursor rectangle is outside the bounds of it's surface viewport. [How] Update parameters used to determine when cursor should be disabled. Reviewed-by: Martin Leung Acked-by: Brian Chang Signed-off-by: David Galiffi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e667ee3b0c049bf0c69426879586a2572bb28d26 Author: Dillon Varone Date: Fri Nov 11 14:06:58 2022 -0500 drm/amd/display: Use new num clk levels struct for max mclk index [WHY?] When calculating watermark and dlg values, the max mclk level index and associated speed are needed to find the correlated dummy latency value. Currently the incorrect index is given due to a clock manager refactor. [HOW?] Use num_memclk_level from num_entries_per_clk struct for getting the correct max mem speed. Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2a5dd86a69ea5435f1a837bdb7fafcda609a7c91 Author: Taimur Hassan Date: Fri Nov 11 14:11:00 2022 -0500 drm/amd/display: Avoid setting pixel rate divider to N/A [Why] Pixel rate divider values should never be set to N/A (0xF) as the K1/K2 field is only 1/2 bits wide. [How] Set valid divider values for virtual and FRL/DP2 cases. Reviewed-by: Nicholas Kazlauskas Acked-by: Brian Chang Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit dd2c028c1395d622df7ddd6837f8ab2dc94008ee Author: Dillon Varone Date: Thu Nov 10 12:13:47 2022 -0500 drm/amd/display: Use viewport height for subvp mall allocation size [WHY?] MALL allocation size depends on the viewport height, not the addressable vertical lines, which will not match when scaling. [HOW?] Base MALL allocation size calculations off viewport height. Reviewed-by: Alvin Lee Reviewed-by: Martin Leung Acked-by: Brian Chang Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5d82c82f1dbee264f7a94587adbbfee607706902 Author: Dillon Varone Date: Mon Nov 7 15:18:47 2022 -0500 drm/amd/display: Update soc bounding box for dcn32/dcn321 [Description] New values for soc bounding box and dummy pstate. Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 44035ec2fde1114254ee465f9ba3bb246b0b6283 Author: Lyude Paul Date: Mon Nov 14 17:20:45 2022 -0500 drm/amd/dc/dce120: Fix audio register mapping, stop triggering KASAN There's been a very long running bug that seems to have been neglected for a while, where amdgpu consistently triggers a KASAN error at start: BUG: KASAN: global-out-of-bounds in read_indirect_azalia_reg+0x1d4/0x2a0 [amdgpu] Read of size 4 at addr ffffffffc2274b28 by task modprobe/1889 After digging through amd's rather creative method for accessing registers, I eventually discovered the problem likely has to do with the fact that on my dce120 GPU there are supposedly 7 sets of audio registers. But we only define a register mapping for 6 sets. So, fix this and fix the KASAN warning finally. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4f2bea62cf3874c5a58e987b0b472f9fb57117a2 Author: Alex Deucher Date: Wed Nov 16 11:26:53 2022 -0500 drm/amdgpu/psp: don't free PSP buffers on suspend We can reuse the same buffers on resume. v2: squash in S4 fix from Shikai Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2213 Reviewed-by: Christian König Tested-by: Guilherme G. Piccoli Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 748064b54c99418f615aabff5755996cd9816969 Author: Santiago Ruano Rincón Date: Mon Nov 21 21:53:05 2022 +0100 net/cdc_ncm: Fix multicast RX support for CDC NCM devices with ZLP ZLP for DisplayLink ethernet devices was enabled in 6.0: 266c0190aee3 ("net/cdc_ncm: Enable ZLP for DisplayLink ethernet devices"). The related driver_info should be the "same as cdc_ncm_info, but with FLAG_SEND_ZLP". However, set_rx_mode that enables handling multicast traffic was missing in the new cdc_ncm_zlp_info. usbnet_cdc_update_filter rx mode was introduced in linux 5.9 with: e10dcb1b6ba7 ("net: cdc_ncm: hook into set_rx_mode to admit multicast traffic") Without this hook, multicast, and then IPv6 SLAAC, is broken. Fixes: 266c0190aee3 ("net/cdc_ncm: Enable ZLP for DisplayLink ethernet devices") Signed-off-by: Santiago Ruano Rincón Signed-off-by: David S. Miller commit a487069e11b6527373f7c6f435d8998051d0b5d9 Author: Davide Tronchin Date: Mon Nov 21 13:54:55 2022 +0100 net: usb: qmi_wwan: add u-blox 0x1342 composition Add RmNet support for LARA-L6. LARA-L6 module can be configured (by AT interface) in three different USB modes: * Default mode (Vendor ID: 0x1546 Product ID: 0x1341) with 4 serial interfaces * RmNet mode (Vendor ID: 0x1546 Product ID: 0x1342) with 4 serial interfaces and 1 RmNet virtual network interface * CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1343) with 4 serial interface and 1 CDC-ECM virtual network interface In RmNet mode LARA-L6 exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parset/alternative functions If 4: RMNET interface Signed-off-by: Davide Tronchin Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit af295e854a4e3813ffbdef26dbb6a4d6226c3ea1 Author: Jakub Sitnicki Date: Mon Nov 21 09:54:26 2022 +0100 l2tp: Don't sleep and disable BH under writer-side sk_callback_lock When holding a reader-writer spin lock we cannot sleep. Calling setup_udp_tunnel_sock() with write lock held violates this rule, because we end up calling percpu_down_read(), which might sleep, as syzbot reports [1]: __might_resched.cold+0x222/0x26b kernel/sched/core.c:9890 percpu_down_read include/linux/percpu-rwsem.h:49 [inline] cpus_read_lock+0x1b/0x140 kernel/cpu.c:310 static_key_slow_inc+0x12/0x20 kernel/jump_label.c:158 udp_tunnel_encap_enable include/net/udp_tunnel.h:187 [inline] setup_udp_tunnel_sock+0x43d/0x550 net/ipv4/udp_tunnel_core.c:81 l2tp_tunnel_register+0xc51/0x1210 net/l2tp/l2tp_core.c:1509 pppol2tp_connect+0xcdc/0x1a10 net/l2tp/l2tp_ppp.c:723 Trim the writer-side critical section for sk_callback_lock down to the minimum, so that it covers only operations on sk_user_data. Also, when grabbing the sk_callback_lock, we always need to disable BH, as Eric points out. Failing to do so leads to deadlocks because we acquire sk_callback_lock in softirq context, which can get stuck waiting on us if: 1) it runs on the same CPU, or CPU0 ---- lock(clock-AF_INET6); lock(clock-AF_INET6); 2) lock ordering leads to priority inversion CPU0 CPU1 ---- ---- lock(clock-AF_INET6); local_irq_disable(); lock(&tcp_hashinfo.bhash[i].lock); lock(clock-AF_INET6); lock(&tcp_hashinfo.bhash[i].lock); ... as syzbot reports [2,3]. Use the _bh variants for write_(un)lock. [1] https://lore.kernel.org/netdev/0000000000004e78ec05eda79749@google.com/ [2] https://lore.kernel.org/netdev/000000000000e38b6605eda76f98@google.com/ [3] https://lore.kernel.org/netdev/000000000000dfa31e05eda76f75@google.com/ v2: - Check and set sk_user_data while holding sk_callback_lock for both L2TP encapsulation types (IP and UDP) (Tetsuo) Cc: Tom Parkin Cc: Tetsuo Handa Fixes: b68777d54fac ("l2tp: Serialize access to sk_user_data with sk_callback_lock") Reported-by: Eric Dumazet Reported-by: syzbot+703d9e154b3b58277261@syzkaller.appspotmail.com Reported-by: syzbot+50680ced9e98a61f7698@syzkaller.appspotmail.com Reported-by: syzbot+de987172bb74a381879b@syzkaller.appspotmail.com Signed-off-by: Jakub Sitnicki Signed-off-by: David S. Miller commit bac81f40c2c1484a2bd416b3fbf983f6e76488cd Author: Yuan Can Date: Mon Nov 21 03:32:26 2022 +0000 net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx() The dm9051_loop_rx() returns without release skb when dm9051_stop_mrcmd() returns error, free the skb to avoid this leak. Fixes: 2dc95a4d30ed ("net: Add dm9051 driver") Signed-off-by: Yuan Can Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit 1c40cde6b5171d9c8dfc69be00464fd1c75e210b Author: Wang Hai Date: Sun Nov 20 14:24:38 2022 +0800 arcnet: fix potential memory leak in com20020_probe() In com20020_probe(), if com20020_config() fails, dev and info will not be freed, which will lead to a memory leak. This patch adds freeing dev and info after com20020_config() fails to fix this bug. Compile tested only. Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 5eef2141776da02772c44ec406d6871a790761ee Author: Hans Verkuil Date: Wed Nov 16 15:07:22 2022 +0000 media: v4l2-dv-timings.c: fix too strict blanking sanity checks Sanity checks were added to verify the v4l2_bt_timings blanking fields in order to avoid integer overflows when userspace passes weird values. But that assumed that userspace would correctly fill in the front porch, backporch and sync values, but sometimes all you know is the total blanking, which is then assigned to just one of these fields. And that can fail with these checks. So instead set a maximum for the total horizontal and vertical blanking and check that each field remains below that. That is still sufficient to avoid integer overflows, but it also allows for more flexibility in how userspace fills in these fields. Signed-off-by: Hans Verkuil Fixes: 4b6d66a45ed3 ("media: v4l2-dv-timings: add sanity checks for blanking values") Signed-off-by: Mauro Carvalho Chehab commit 706450b5c3212a7d372e68170a28170239ccfe6e Merge: ff5a19909b49f 562105c1b0724 Author: Arnd Bergmann Date: Wed Nov 23 12:42:39 2022 +0100 Merge tag 'v6.1-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Fixes to make the automated binding tools happier (node-names, undocumented + unneeded properties) and fixes for non-working devices on some boards. * tag 'v6.1-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Fix Pine64 Quartz4-B PMIC interrupt ARM: dts: rockchip: rk3188: fix lcdc1-rgb24 node name arm64: dts: rockchip: fix ir-receiver node names ARM: dts: rockchip: fix ir-receiver node names arm64: dts: rockchip: fix adc-keys sub node names ARM: dts: rockchip: fix adc-keys sub node names arm: dts: rockchip: remove clock-frequency from rtc arm: dts: rockchip: fix node name for hym8563 rtc arm64: dts: rockchip: remove clock-frequency from rtc arm64: dts: rockchip: fix node name for hym8563 rtc arm64: dts: rockchip: lower rk3399-puma-haikou SD controller clock frequency arm64: dts: rockchip: keep I2S1 disabled for GPIO function on ROCK Pi 4 series arm64: dts: rockchip: fix quartz64-a bluetooth configuration arm64: dts: rockchip: add enable-strobe-pulldown to emmc phy on nanopi4 arm64: dts: rockchip: remove i2c5 from rk3566-roc-pc arm64: dts: rockchip: Fix i2c3 pinctrl on rk3566-roc-pc arm64: dts: rockchip: Fix gmac failure of rgmii-id from rk3566-roc-pc arm64: dts: rockchip: Drop RK3399-Scarlet's repeated ec_ap_int_l definition Link: https://lore.kernel.org/r/6274427.GXAFRqVoOG@phil Signed-off-by: Arnd Bergmann commit 44361e8cf9ddb23f17bdcc40ca944abf32e83e79 Author: Miklos Szeredi Date: Wed Nov 23 09:10:42 2022 +0100 fuse: lock inode unconditionally in fuse_fallocate() file_modified() must be called with inode lock held. fuse_fallocate() didn't lock the inode in case of just FALLOC_KEEP_SIZE flags value, which resulted in a kernel Warning in notify_change(). Lock the inode unconditionally, like all other fallocate implementations do. Reported-by: Pengfei Xu Reported-and-tested-by: syzbot+462da39f0667b357c4b6@syzkaller.appspotmail.com Fixes: 4a6f278d4827 ("fuse: add file_modified() to fallocate") Signed-off-by: Miklos Szeredi commit 391c18cf776eb4569ecda1f7794f360fe0a45a26 Author: Dominique Martinet Date: Fri Nov 18 22:44:41 2022 +0900 9p/xen: check logical size for buffer size trans_xen did not check the data fits into the buffer before copying from the xen ring, but we probably should. Add a check that just skips the request and return an error to userspace if it did not fit Tested-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck Link: https://lkml.kernel.org/r/20221118135542.63400-1-asmadeus@codewreck.org Signed-off-by: Dominique Martinet commit 178a4ff11903cf19f35d82f3462958ab7f7c76ef Merge: 568fe84940ac0 8514e325ef016 Author: Jakub Kicinski Date: Tue Nov 22 20:20:58 2022 -0800 Merge tag 'mlx5-fixes-2022-11-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-11-21 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-11-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Fix possible race condition in macsec extended packet number update routine net/mlx5e: Fix MACsec update SecY net/mlx5e: Fix MACsec SA initialization routine net/mlx5e: Remove leftovers from old XSK queues enumeration net/mlx5e: Offload rule only when all encaps are valid net/mlx5e: Fix missing alignment in size of MTT/KLM entries net/mlx5: Fix sync reset event handler error flow net/mlx5: E-Switch, Set correctly vport destination net/mlx5: Lag, avoid lockdep warnings net/mlx5: Fix handling of entry refcount when command is not issued to FW net/mlx5: cmdif, Print info on any firmware cmd failure to tracepoint net/mlx5: SF: Fix probing active SFs during driver probe phase net/mlx5: Fix FW tracer timestamp calculation net/mlx5: Do not query pci info while pci disabled ==================== Link: https://lore.kernel.org/r/20221122022559.89459-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 568fe84940ac0e4e0b2cd7751b8b4911f7b9c215 Author: Ziyang Xuan Date: Sun Nov 20 15:28:38 2022 +0800 ipv4: Fix error return code in fib_table_insert() In fib_table_insert(), if the alias was already inserted, but node not exist, the error code should be set before return from error handling path. Fixes: a6c76c17df02 ("ipv4: Notify route after insertion to the routing table") Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/r/20221120072838.2167047-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit dddf26dfd07a5dcb59cec0a6a7a8b7e12fcc7776 Merge: 3213f808ae21b 603ea5e7ffa73 Author: Jakub Kicinski Date: Tue Nov 22 20:18:09 2022 -0800 Merge branch 'net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-path' Yan Cangang says: ==================== net: ethernet: mtk_eth_soc: fix memory leak in error path ==================== Link: https://lore.kernel.org/r/20221120055259.224555-1-nalanzeyu@gmail.com Signed-off-by: Jakub Kicinski commit 603ea5e7ffa73c7fac07d8713d97285990695213 Author: Yan Cangang Date: Sun Nov 20 13:52:59 2022 +0800 net: ethernet: mtk_eth_soc: fix memory leak in error path In mtk_ppe_init(), when dmam_alloc_coherent() or devm_kzalloc() failed, the rhashtable ppe->l2_flows isn't destroyed. Fix it. In mtk_probe(), when mtk_ppe_init() or mtk_eth_offload_init() or register_netdev() failed, have the same problem. Fix it. Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Signed-off-by: Yan Cangang Reviewed-by: Leon Romanovsky Signed-off-by: Jakub Kicinski commit 8110437e59616293228cd781c486d8495a61e36a Author: Yan Cangang Date: Sun Nov 20 13:52:58 2022 +0800 net: ethernet: mtk_eth_soc: fix resource leak in error path In mtk_probe(), when mtk_ppe_init() or mtk_eth_offload_init() failed, mtk_mdio_cleanup() isn't called. Fix it. Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE") Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") Signed-off-by: Yan Cangang Reviewed-by: Leon Romanovsky Signed-off-by: Jakub Kicinski commit 3213f808ae21be3891885de2f3a775afafcda987 Author: Ziyang Xuan Date: Sun Nov 20 11:54:05 2022 +0800 net: ethernet: mtk_eth_soc: fix potential memory leak in mtk_rx_alloc() When fail to dma_map_single() in mtk_rx_alloc(), it returns directly. But the memory allocated for local variable data is not freed, and local variabel data has not been attached to ring->data[i] yet, so the memory allocated for local variable data will not be freed outside mtk_rx_alloc() too. Thus memory leak would occur in this scenario. Add skb_free_frag(data) when dma_map_single() failed. Fixes: 23233e577ef9 ("net: ethernet: mtk_eth_soc: rely on page_pool for single page buffers") Signed-off-by: Ziyang Xuan Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/20221120035405.1464341-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit 0972457f5803e69e31041c4ceae771bf2438410a Merge: 2dc4ac91f845b e0833d1fedb02 Author: Jakub Kicinski Date: Tue Nov 22 20:15:52 2022 -0800 Merge branch 'dccp-tcp-fix-bhash2-issues-related-to-warn_on-in-inet_csk_get_port' Kuniyuki Iwashima says: ==================== dccp/tcp: Fix bhash2 issues related to WARN_ON() in inet_csk_get_port(). syzkaller was hitting a WARN_ON() in inet_csk_get_port() in the 4th patch, which was because we forgot to fix up bhash2 bucket when connect() for a socket bound to a wildcard address fails in __inet_stream_connect(). There was a similar report [0], but its repro does not fire the WARN_ON() due to inconsistent error handling. When connect() for a socket bound to a wildcard address fails, saddr may or may not be reset depending on where the failure happens. When we fail in __inet_stream_connect(), sk->sk_prot->disconnect() resets saddr. OTOH, in (dccp|tcp)_v[46]_connect(), if we fail after inet_hash6?_connect(), we forget to reset saddr. We fix this inconsistent error handling in the 1st patch, and then we'll fix the bhash2 WARN_ON() issue. Note that there is still an issue in that we reset saddr without checking if there are conflicting sockets in bhash and bhash2, but this should be another series. See [1][2] for the previous discussion. [0]: https://lore.kernel.org/netdev/0000000000003f33bc05dfaf44fe@google.com/ [1]: https://lore.kernel.org/netdev/20221029001249.86337-1-kuniyu@amazon.com/ [2]: https://lore.kernel.org/netdev/20221103172419.20977-1-kuniyu@amazon.com/ [3]: https://lore.kernel.org/netdev/20221118081906.053d5231@kernel.org/T/#m00aafedb29ff0b55d5e67aef0252ef1baaf4b6ee ==================== Link: https://lore.kernel.org/r/20221119014914.31792-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit e0833d1fedb02f038b526ae7dde178a076f56545 Author: Kuniyuki Iwashima Date: Fri Nov 18 17:49:14 2022 -0800 dccp/tcp: Fixup bhash2 bucket when connect() fails. If a socket bound to a wildcard address fails to connect(), we only reset saddr and keep the port. Then, we have to fix up the bhash2 bucket; otherwise, the bucket has an inconsistent address in the list. Also, listen() for such a socket will fire the WARN_ON() in inet_csk_get_port(). [0] Note that when a system runs out of memory, we give up fixing the bucket and unlink sk from bhash and bhash2 by inet_put_port(). [0]: WARNING: CPU: 0 PID: 207 at net/ipv4/inet_connection_sock.c:548 inet_csk_get_port (net/ipv4/inet_connection_sock.c:548 (discriminator 1)) Modules linked in: CPU: 0 PID: 207 Comm: bhash2_prev_rep Not tainted 6.1.0-rc3-00799-gc8421681c845 #63 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.amzn2022.0.1 04/01/2014 RIP: 0010:inet_csk_get_port (net/ipv4/inet_connection_sock.c:548 (discriminator 1)) Code: 74 a7 eb 93 48 8b 54 24 18 0f b7 cb 4c 89 e6 4c 89 ff e8 48 b2 ff ff 49 8b 87 18 04 00 00 e9 32 ff ff ff 0f 0b e9 34 ff ff ff <0f> 0b e9 42 ff ff ff 41 8b 7f 50 41 8b 4f 54 89 fe 81 f6 00 00 ff RSP: 0018:ffffc900003d7e50 EFLAGS: 00010202 RAX: ffff8881047fb500 RBX: 0000000000004e20 RCX: 0000000000000000 RDX: 000000000000000a RSI: 00000000fffffe00 RDI: 00000000ffffffff RBP: ffffffff8324dc00 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000001 R14: 0000000000004e20 R15: ffff8881054e1280 FS: 00007f8ac04dc740(0000) GS:ffff88842fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020001540 CR3: 00000001055fa003 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: inet_csk_listen_start (net/ipv4/inet_connection_sock.c:1205) inet_listen (net/ipv4/af_inet.c:228) __sys_listen (net/socket.c:1810) __x64_sys_listen (net/socket.c:1819 net/socket.c:1817 net/socket.c:1817) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) RIP: 0033:0x7f8ac051de5d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 93 af 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc1c177248 EFLAGS: 00000206 ORIG_RAX: 0000000000000032 RAX: ffffffffffffffda RBX: 0000000020001550 RCX: 00007f8ac051de5d RDX: ffffffffffffff80 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007ffc1c177270 R08: 0000000000000018 R09: 0000000000000007 R10: 0000000020001540 R11: 0000000000000206 R12: 00007ffc1c177388 R13: 0000000000401169 R14: 0000000000403e18 R15: 00007f8ac0723000 Fixes: 28044fc1d495 ("net: Add a bhash2 table hashed by port and address") Reported-by: syzbot Reported-by: Mat Martineau Signed-off-by: Kuniyuki Iwashima Acked-by: Joanne Koong Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 8c5dae4c1a49489499e6708c7dd284370ca36287 Author: Kuniyuki Iwashima Date: Fri Nov 18 17:49:13 2022 -0800 dccp/tcp: Update saddr under bhash's lock. When we call connect() for a socket bound to a wildcard address, we update saddr locklessly. However, it could result in a data race; another thread iterating over bhash might see a corrupted address. Let's update saddr under the bhash bucket's lock. Fixes: 3df80d9320bc ("[DCCP]: Introduce DCCPv6") Fixes: 7c657876b63c ("[DCCP]: Initial implementation") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Acked-by: Joanne Koong Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 8acdad37cd13ce777b0811b2d332314037fcefa8 Author: Kuniyuki Iwashima Date: Fri Nov 18 17:49:12 2022 -0800 dccp/tcp: Remove NULL check for prev_saddr in inet_bhash2_update_saddr(). When we call inet_bhash2_update_saddr(), prev_saddr is always non-NULL. Let's remove the unnecessary test. Signed-off-by: Kuniyuki Iwashima Acked-by: Joanne Koong Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 77934dc6db0d2b111a8f2759e9ad2fb67f5cffa5 Author: Kuniyuki Iwashima Date: Fri Nov 18 17:49:11 2022 -0800 dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). When connect() is called on a socket bound to the wildcard address, we change the socket's saddr to a local address. If the socket fails to connect() to the destination, we have to reset the saddr. However, when an error occurs after inet_hash6?_connect() in (dccp|tcp)_v[46]_conect(), we forget to reset saddr and leave the socket bound to the address. From the user's point of view, whether saddr is reset or not varies with errno. Let's fix this inconsistent behaviour. Note that after this patch, the repro [0] will trigger the WARN_ON() in inet_csk_get_port() again, but this patch is not buggy and rather fixes a bug papering over the bhash2's bug for which we need another fix. For the record, the repro causes -EADDRNOTAVAIL in inet_hash6_connect() by this sequence: s1 = socket() s1.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) s1.bind(('127.0.0.1', 10000)) s1.sendto(b'hello', MSG_FASTOPEN, (('127.0.0.1', 10000))) # or s1.connect(('127.0.0.1', 10000)) s2 = socket() s2.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) s2.bind(('0.0.0.0', 10000)) s2.connect(('127.0.0.1', 10000)) # -EADDRNOTAVAIL s2.listen(32) # WARN_ON(inet_csk(sk)->icsk_bind2_hash != tb2); [0]: https://syzkaller.appspot.com/bug?extid=015d756bbd1f8b5c8f09 Fixes: 3df80d9320bc ("[DCCP]: Introduce DCCPv6") Fixes: 7c657876b63c ("[DCCP]: Initial implementation") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Acked-by: Joanne Koong Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit de3db3f883a82c4800f4af0ae2cc3b96a408ee9b Author: Li Hua Date: Mon Nov 21 11:06:20 2022 +0800 test_kprobes: fix implicit declaration error of test_kprobes If KPROBES_SANITY_TEST and ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled, but STACKTRACE is not set. Build failed as below: lib/test_kprobes.c: In function `stacktrace_return_handler': lib/test_kprobes.c:228:8: error: implicit declaration of function `stack_trace_save'; did you mean `stacktrace_driver'? [-Werror=implicit-function-declaration] ret = stack_trace_save(stack_buf, STACK_BUF_SIZE, 0); ^~~~~~~~~~~~~~~~ stacktrace_driver cc1: all warnings being treated as errors scripts/Makefile.build:250: recipe for target 'lib/test_kprobes.o' failed make[2]: *** [lib/test_kprobes.o] Error 1 To fix this error, Select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled. Link: https://lkml.kernel.org/r/20221121030620.63181-1-hucool.lihua@huawei.com Fixes: 1f6d3a8f5e39 ("kprobes: Add a test case for stacktrace from kretprobe handler") Signed-off-by: Li Hua Acked-by: Masami Hiramatsu (Google) Cc: Steven Rostedt (VMware) Signed-off-by: Andrew Morton commit 512c5ca01a3610ab14ff6309db363de51f1c13a6 Author: Chen Zhongjin Date: Fri Nov 18 14:33:04 2022 +0800 nilfs2: fix nilfs_sufile_mark_dirty() not set segment usage as dirty When extending segments, nilfs_sufile_alloc() is called to get an unassigned segment, then mark it as dirty to avoid accidentally allocating the same segment in the future. But for some special cases such as a corrupted image it can be unreliable. If such corruption of the dirty state of the segment occurs, nilfs2 may reallocate a segment that is in use and pick the same segment for writing twice at the same time. This will cause the problem reported by syzkaller: https://syzkaller.appspot.com/bug?id=c7c4748e11ffcc367cef04f76e02e931833cbd24 This case started with segbuf1.segnum = 3, nextnum = 4 when constructed. It supposed segment 4 has already been allocated and marked as dirty. However the dirty state was corrupted and segment 4 usage was not dirty. For the first time nilfs_segctor_extend_segments() segment 4 was allocated again, which made segbuf2 and next segbuf3 had same segment 4. sb_getblk() will get same bh for segbuf2 and segbuf3, and this bh is added to both buffer lists of two segbuf. It makes the lists broken which causes NULL pointer dereference. Fix the problem by setting usage as dirty every time in nilfs_sufile_mark_dirty(), which is called during constructing current segment to be written out and before allocating next segment. [chenzhongjin@huawei.com: add lock protection per Ryusuke] Link: https://lkml.kernel.org/r/20221121091141.214703-1-chenzhongjin@huawei.com Link: https://lkml.kernel.org/r/20221118063304.140187-1-chenzhongjin@huawei.com Fixes: 9ff05123e3bf ("nilfs2: segment constructor") Signed-off-by: Chen Zhongjin Reported-by: Reported-by: Liu Shixin Acked-by: Ryusuke Konishi Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit 81a70c21d9170de67a45843bdd627f4cce9c4215 Author: Aneesh Kumar K.V Date: Fri Nov 18 12:36:03 2022 +0530 mm/cgroup/reclaim: fix dirty pages throttling on cgroup v1 balance_dirty_pages doesn't do the required dirty throttling on cgroupv1. See commit 9badce000e2c ("cgroup, writeback: don't enable cgroup writeback on traditional hierarchies"). Instead, the kernel depends on writeback throttling in shrink_folio_list to achieve the same goal. With large memory systems, the flusher may not be able to writeback quickly enough such that we will start finding pages in the shrink_folio_list already in writeback. Hence for cgroupv1 let's do a reclaim throttle after waking up the flusher. The below test which used to fail on a 256GB system completes till the the file system is full with this change. root@lp2:/sys/fs/cgroup/memory# mkdir test root@lp2:/sys/fs/cgroup/memory# cd test/ root@lp2:/sys/fs/cgroup/memory/test# echo 120M > memory.limit_in_bytes root@lp2:/sys/fs/cgroup/memory/test# echo $$ > tasks root@lp2:/sys/fs/cgroup/memory/test# dd if=/dev/zero of=/home/kvaneesh/test bs=1M Killed Link: https://lkml.kernel.org/r/20221118070603.84081-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Cc: Tejun Heo Cc: zefan li Cc: Signed-off-by: Andrew Morton commit ea4452de2ae987342fadbdd2c044034e6480daad Author: Qi Zheng Date: Fri Nov 18 18:00:11 2022 +0800 mm: fix unexpected changes to {failslab|fail_page_alloc}.attr When we specify __GFP_NOWARN, we only expect that no warnings will be issued for current caller. But in the __should_failslab() and __should_fail_alloc_page(), the local GFP flags alter the global {failslab|fail_page_alloc}.attr, which is persistent and shared by all tasks. This is not what we expected, let's fix it. [akpm@linux-foundation.org: unexport should_fail_ex()] Link: https://lkml.kernel.org/r/20221118100011.2634-1-zhengqi.arch@bytedance.com Fixes: 3f913fc5f974 ("mm: fix missing handler for __GFP_NOWARN") Signed-off-by: Qi Zheng Reported-by: Dmitry Vyukov Reviewed-by: Akinobu Mita Reviewed-by: Jason Gunthorpe Cc: Akinobu Mita Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton commit de1ccfb648243a031cfbdc2d5571dfdaf5023106 Author: Chen Wandun Date: Fri Nov 18 21:38:50 2022 +0800 swapfile: fix soft lockup in scan_swap_map_slots A softlockup occurs in scan free swap slot under huge memory pressure. The test scenario is: 64 CPU cores, 64GB memory, and 28 zram devices, the disksize of each zram device is 50MB. LATENCY_LIMIT is used to prevent softlockups in scan_swap_map_slots(), but the real loop number would more than LATENCY_LIMIT because of "goto checks and goto scan" repeatly without decreasing latency limit. In order to fix it, decrease latency_ration in advance. There is also a suspicious place that will cause softlockups in get_swap_pages(). In this function, the "goto start_over" may result in continuous scanning of the swap partition. If there is no cond_sched in scan_swap_map_slots(), it would cause a softlockup (I am not sure about this). WARN: soft lockup - CPU#11 stuck for 11s! [kswapd0:466] CPU: 11 PID: 466 Comm: kswapd@ Kdump: loaded Tainted: G dump backtrace+0x0/0x1le4 show stack+0x20/@x2c dump_stack+0xd8/0x140 watchdog print_info+0x48/0x54 watchdog_process_before_softlockup+0x98/0xa0 watchdog_timer_fn+0xlac/0x2d0 hrtimer_rum_queues+0xb0/0x130 hrtimer_interrupt+0x13c/0x3c0 arch_timer_handler_virt+0x3c/0x50 handLe_percpu_devid_irq+0x90/0x1f4 handle domain irq+0x84/0x100 gic_handle_irq+0x88/0x2b0 e11 ira+0xhB/Bx140 scan_swap_map_slots+0x678/0x890 get_swap_pages+0x29c/0x440 get_swap_page+0x120/0x2e0 add_to_swap+UX2U/0XyC shrink_page_list+0x5d0/0x152c shrink_inactive_list+0xl6c/Bx500 shrink_lruvec+0x270/0x304 WARN: soft lockup - CPU#32 stuck for 11s! [stress-ng:309915] watchdog_timer_fn+0x1ac/0x2d0 __run_hrtimer+0x98/0x2a0 __hrtimer_run_queues+0xb0/0x130 hrtimer_interrupt+0x13c/0x3c0 arch_timer_handler_virt+0x3c/0x50 handle_percpu_devid_irq+0x90/0x1f4 __handle_domain_irq+0x84/0x100 gic_handle_irq+0x88/0x2b0 el1_irq+0xb8/0x140 get_swap_pages+0x1e8/0x440 get_swap_page+0x1c8/0x2e0 add_to_swap+0x20/0x9c shrink_page_list+0x5d0/0x152c reclaim_pages+0x160/0x310 madvise_cold_or_pageout_pte_range+0x7bc/0xe3c walk_pmd_range.isra.0+0xac/0x22c walk_pud_range+0xfc/0x1c0 walk_pgd_range+0x158/0x1b0 __walk_page_range+0x64/0x100 walk_page_range+0x104/0x150 Link: https://lkml.kernel.org/r/20221118133850.3360369-1-chenwandun@huawei.com Fixes: 048c27fd7281 ("[PATCH] swap: scan_swap_map latency breaks") Signed-off-by: Chen Wandun Reviewed-by: "Huang, Ying" Cc: Hugh Dickins Cc: Kefeng Wang Cc: Nanyong Sun Cc: Signed-off-by: Andrew Morton commit 7fb0728a9b005b8fc55e835529047cca15191031 Author: Mike Kravetz Date: Fri Nov 18 11:52:49 2022 -0800 hugetlb: fix __prep_compound_gigantic_page page flag setting Commit 2b21624fc232 ("hugetlb: freeze allocated pages before creating hugetlb pages") changed the order page flags were cleared and set in the head page. It moved the __ClearPageReserved after __SetPageHead. However, there is a check to make sure __ClearPageReserved is never done on a head page. If CONFIG_DEBUG_VM_PGFLAGS is enabled, the following BUG will be hit when creating a hugetlb gigantic page: page dumped because: VM_BUG_ON_PAGE(1 && PageCompound(page)) ------------[ cut here ]------------ kernel BUG at include/linux/page-flags.h:500! Call Trace will differ depending on whether hugetlb page is created at boot time or run time. Make sure to __ClearPageReserved BEFORE __SetPageHead. Link: https://lkml.kernel.org/r/20221118195249.178319-1-mike.kravetz@oracle.com Fixes: 2b21624fc232 ("hugetlb: freeze allocated pages before creating hugetlb pages") Signed-off-by: Mike Kravetz Reported-by: Aneesh Kumar K.V Acked-by: Muchun Song Tested-by: Tarun Sahu Reviewed-by: Miaohe Lin Cc: Joao Martins Cc: Matthew Wilcox Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Peter Xu Cc: Sidhartha Kumar Signed-off-by: Andrew Morton commit 747c0f35f2d55de20093e992bd9fc7292193c0e6 Author: Marco Elver Date: Fri Nov 18 16:22:16 2022 +0100 kfence: fix stack trace pruning Commit b14051352465 ("mm/sl[au]b: generalize kmalloc subsystem") refactored large parts of the kmalloc subsystem, resulting in the stack trace pruning logic done by KFENCE to no longer work. While b14051352465 attempted to fix the situation by including '__kmem_cache_free' in the list of functions KFENCE should skip through, this only works when the compiler actually optimized the tail call from kfree() to __kmem_cache_free() into a jump (and thus kfree() _not_ appearing in the full stack trace to begin with). In some configurations, the compiler no longer optimizes the tail call into a jump, and __kmem_cache_free() appears in the stack trace. This means that the pruned stack trace shown by KFENCE would include kfree() which is not intended - for example: | BUG: KFENCE: invalid free in kfree+0x7c/0x120 | | Invalid free of 0xffff8883ed8fefe0 (in kfence-#126): | kfree+0x7c/0x120 | test_double_free+0x116/0x1a9 | kunit_try_run_case+0x90/0xd0 | [...] Fix it by moving __kmem_cache_free() to the list of functions that may be tail called by an allocator entry function, making the pruning logic work in both the optimized and unoptimized tail call cases. Link: https://lkml.kernel.org/r/20221118152216.3914899-1-elver@google.com Fixes: b14051352465 ("mm/sl[au]b: generalize kmalloc subsystem") Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Feng Tang Signed-off-by: Andrew Morton commit f850c84948ef2d4f5e11fd8e528c2ac3b3c3d9c4 Author: Yosry Ahmed Date: Thu Nov 17 04:32:47 2022 +0000 proc/meminfo: fix spacing in SecPageTables SecPageTables has a tab after it instead of a space, this can break fragile parsers that depend on spaces after the stat names. Link: https://lkml.kernel.org/r/20221117043247.133294-1-yosryahmed@google.com Fixes: ebc97a52b5d6cd5f ("mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses.") Signed-off-by: Yosry Ahmed Acked-by: Johannes Weiner Acked-by: Shakeel Butt Cc: David Hildenbrand Cc: Marc Zyngier Cc: Sean Christopherson Signed-off-by: Andrew Morton commit 359a5e1416caaf9ce28396a65ed3e386cc5de663 Author: Yu Zhao Date: Tue Nov 15 18:38:07 2022 -0700 mm: multi-gen LRU: retry folios written back while isolated The page reclaim isolates a batch of folios from the tail of one of the LRU lists and works on those folios one by one. For a suitable swap-backed folio, if the swap device is async, it queues that folio for writeback. After the page reclaim finishes an entire batch, it puts back the folios it queued for writeback to the head of the original LRU list. In the meantime, the page writeback flushes the queued folios also by batches. Its batching logic is independent from that of the page reclaim. For each of the folios it writes back, the page writeback calls folio_rotate_reclaimable() which tries to rotate a folio to the tail. folio_rotate_reclaimable() only works for a folio after the page reclaim has put it back. If an async swap device is fast enough, the page writeback can finish with that folio while the page reclaim is still working on the rest of the batch containing it. In this case, that folio will remain at the head and the page reclaim will not retry it before reaching there. This patch adds a retry to evict_folios(). After evict_folios() has finished an entire batch and before it puts back folios it cannot free immediately, it retries those that may have missed the rotation. Before this patch, ~60% of folios swapped to an Intel Optane missed folio_rotate_reclaimable(). After this patch, ~99% of missed folios were reclaimed upon retry. This problem affects relatively slow async swap devices like Samsung 980 Pro much less and does not affect sync swap devices like zram or zswap at all. Link: https://lkml.kernel.org/r/20221116013808.3995280-1-yuzhao@google.com Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation") Signed-off-by: Yu Zhao Cc: "Yin, Fengwei" Signed-off-by: Andrew Morton commit 47123d7fdffff7389f8ffa833110784ab9fc8bc6 Author: Satya Priya Date: Wed Nov 16 16:20:17 2022 +0530 mailmap: update email address for Satya Priya Add and also update email address, skakit@codeaurora.org is no longer active. Link: https://lkml.kernel.org/r/20221116105017.3018971-1-quic_c_skakit@quicinc.com Signed-off-by: Satya Priya Cc: Konrad Dybcio Signed-off-by: Andrew Morton commit 44af0b45d58d7b6f09ebb9081aa89b8bdc33a630 Author: Alistair Popple Date: Fri Nov 11 11:51:35 2022 +1100 mm/migrate_device: return number of migrating pages in args->cpages migrate_vma->cpages originally contained a count of the number of pages migrating including non-present pages which can be populated directly on the target. Commit 241f68859656 ("mm/migrate_device.c: refactor migrate_vma and migrate_device_coherent_page()") inadvertantly changed this to contain just the number of pages that were unmapped. Usage of migrate_vma->cpages isn't documented, but most drivers use it to see if all the requested addresses can be migrated so restore the original behaviour. Link: https://lkml.kernel.org/r/20221111005135.1344004-1-apopple@nvidia.com Fixes: 241f68859656 ("mm/migrate_device.c: refactor migrate_vma and migrate_deivce_coherent_page()") Signed-off-by: Alistair Popple Reported-by: Ralph Campbell Reviewed-by: Ralph Campbell Cc: John Hubbard Cc: Alex Sierra Cc: Ben Skeggs Cc: Felix Kuehling Cc: Lyude Paul Cc: Jason Gunthorpe Cc: Michael Ellerman Signed-off-by: Andrew Morton commit 50c697215a8cc22f0e58c88f06f2716c05a26e85 Author: Sam James Date: Wed Nov 16 18:26:34 2022 +0000 kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible Add missing include for strcmp. Clang 16 makes -Wimplicit-function-declaration an error by default. Unfortunately, out of tree modules may use this in configure scripts, which means failure might cause silent miscompilation or misconfiguration. For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2], or the (new) c-std-porting mailing list [3]. [0] https://lwn.net/Articles/913505/ [1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 [2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 [3] hosted at lists.linux.dev. [akpm@linux-foundation.org: remember "linux/"] Link: https://lkml.kernel.org/r/20221116182634.2823136-1-sam@gentoo.org Signed-off-by: Sam James Cc: Signed-off-by: Andrew Morton commit db8e0998c35af67bceee91cad8acf3f6f330782f Author: Alex Hung Date: Sun Nov 13 17:13:02 2022 -0700 MAINTAINERS: update Alex Hung's email address Use my personal email address. Link: https://lkml.kernel.org/r/20221114001302.671897-2-alex.hung@amd.com Signed-off-by: Alex Hung Signed-off-by: Andrew Morton commit d39e2ad63def4432ed0ec59c0e64fee988ef42f0 Author: Alex Hung Date: Sun Nov 13 17:13:01 2022 -0700 mailmap: update Alex Hung's email address I am no longer at Canonical and add entry of my personal email address. Link: https://lkml.kernel.org/r/20221114001302.671897-1-alex.hung@amd.com Signed-off-by: Alex Hung Signed-off-by: Andrew Morton commit 4a42344081ff7fbb890c0741e11d22cd7f658894 Author: Ian Cowan Date: Sun Nov 13 19:33:49 2022 -0500 mm: mmap: fix documentation for vma_mas_szero When the struct_mm input, mm, was changed to a struct ma_state, mas, the documentation for the function was never updated. This updates that documentation reference. Link: https://lkml.kernel.org/r/20221114003349.41235-1-ian@linux.cowan.aero Signed-off-by: Ian Cowan Acked-by: David Hildenbrand Cc: Liam Howlett Signed-off-by: Andrew Morton commit 8468b486612c808c9e337708d66a435498f1735c Author: SeongJae Park Date: Mon Nov 14 17:55:52 2022 +0000 mm/damon/sysfs-schemes: skip stats update if the scheme directory is removed A DAMON sysfs interface user can start DAMON with a scheme, remove the sysfs directory for the scheme, and then ask update of the scheme's stats. Because the schemes stats update logic isn't aware of the situation, it results in an invalid memory access. Fix the bug by checking if the scheme sysfs directory exists. Link: https://lkml.kernel.org/r/20221114175552.1951-1-sj@kernel.org Fixes: 0ac32b8affb5 ("mm/damon/sysfs: support DAMOS stats") Signed-off-by: SeongJae Park Cc: [v5.18] Signed-off-by: Andrew Morton commit 4a955bed882e734807024afd8f53213d4c61ff97 Author: Alistair Popple Date: Mon Nov 14 22:55:37 2022 +1100 mm/memory: return vm_fault_t result from migrate_to_ram() callback The migrate_to_ram() callback should always succeed, but in rare cases can fail usually returning VM_FAULT_SIGBUS. Commit 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") incorrectly stopped passing the return code up the stack. Fix this by setting the ret variable, restoring the previous behaviour on migrate_to_ram() failure. Link: https://lkml.kernel.org/r/20221114115537.727371-1-apopple@nvidia.com Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") Signed-off-by: Alistair Popple Acked-by: David Hildenbrand Reviewed-by: Felix Kuehling Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Sierra Cc: Ben Skeggs Cc: Lyude Paul Cc: Jason Gunthorpe Cc: Michael Ellerman Signed-off-by: Andrew Morton commit cd08d80ecdac577bad2e8d6805c7a3859fdefb8d Author: Li Liguang Date: Mon Nov 14 14:48:28 2022 -0500 mm: correctly charge compressed memory to its memcg Kswapd will reclaim memory when memory pressure is high, the annonymous memory will be compressed and stored in the zpool if zswap is enabled. The memcg_kmem_bypass() in get_obj_cgroup_from_page() will bypass the kernel thread and cause the compressed memory not be charged to its memory cgroup. Remove the memcg_kmem_bypass() call and properly charge compressed memory to its corresponding memory cgroup. Link: https://lore.kernel.org/linux-mm/CALvZod4nnn8BHYqAM4xtcR0Ddo2-Wr8uKm9h_CHWUaXw7g_DCg@mail.gmail.com/ Link: https://lkml.kernel.org/r/20221114194828.100822-1-hannes@cmpxchg.org Fixes: f4840ccfca25 ("zswap: memcg accounting") Signed-off-by: Li Liguang Signed-off-by: Johannes Weiner Acked-by: Shakeel Butt Reviewed-by: Muchun Song Cc: Michal Hocko Cc: Roman Gushchin Cc: [5.19+] Signed-off-by: Andrew Morton commit b6305049f30652f1efcf78d627fc6656151a7929 Author: Mike Kravetz Date: Mon Nov 14 13:00:18 2022 -0800 ipc/shm: call underlying open/close vm_ops Shared memory segments can be created that are backed by hugetlb pages. When this happens, the vmas associated with any mappings (shmat) are marked VM_HUGETLB, yet the vm_ops for such mappings are provided by ipc/shm (shm_vm_ops). There is a mechanism to call the underlying hugetlb vm_ops, and this is done for most operations. However, it is not done for open and close. This was not an issue until the introduction of the hugetlb vma_lock. This lock structure is pointed to by vm_private_data and the open/close vm_ops help maintain this structure. The special hugetlb routine called at fork took care of structure updates at fork time. However, vma_splitting is not properly handled for ipc shared memory mappings backed by hugetlb pages. This can result in a "kernel NULL pointer dereference" BUG or use after free as two vmas point to the same lock structure. Update the shm open and close routines to always call the underlying open and close routines. Link: https://lkml.kernel.org/r/20221114210018.49346-1-mike.kravetz@oracle.com Fixes: 8d9bfb260814 ("hugetlb: add vma based lock for pmd sharing") Signed-off-by: Mike Kravetz Reported-by: Doug Nelson Reported-by: Cc: Alexander Mikhalitsyn Cc: "Eric W . Biederman" Cc: Manfred Spraul Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Signed-off-by: Andrew Morton commit a6f810efabfd789d3bbafeacb4502958ec56c5ce Author: Mukesh Ojha Date: Thu Nov 10 00:31:37 2022 +0530 gcov: clang: fix the buffer overflow issue Currently, in clang version of gcov code when module is getting removed gcov_info_add() incorrectly adds the sfn_ptr->counter to all the dst->functions and it result in the kernel panic in below crash report. Fix this by properly handling it. [ 8.899094][ T599] Unable to handle kernel write to read-only memory at virtual address ffffff80461cc000 [ 8.899100][ T599] Mem abort info: [ 8.899102][ T599] ESR = 0x9600004f [ 8.899103][ T599] EC = 0x25: DABT (current EL), IL = 32 bits [ 8.899105][ T599] SET = 0, FnV = 0 [ 8.899107][ T599] EA = 0, S1PTW = 0 [ 8.899108][ T599] FSC = 0x0f: level 3 permission fault [ 8.899110][ T599] Data abort info: [ 8.899111][ T599] ISV = 0, ISS = 0x0000004f [ 8.899113][ T599] CM = 0, WnR = 1 [ 8.899114][ T599] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000ab8de000 [ 8.899116][ T599] [ffffff80461cc000] pgd=18000009ffcde003, p4d=18000009ffcde003, pud=18000009ffcde003, pmd=18000009ffcad003, pte=00600000c61cc787 [ 8.899124][ T599] Internal error: Oops: 9600004f [#1] PREEMPT SMP [ 8.899265][ T599] Skip md ftrace buffer dump for: 0x1609e0 .... .., [ 8.899544][ T599] CPU: 7 PID: 599 Comm: modprobe Tainted: G S OE 5.15.41-android13-8-g38e9b1af6bce #1 [ 8.899547][ T599] Hardware name: XXX (DT) [ 8.899549][ T599] pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) [ 8.899551][ T599] pc : gcov_info_add+0x9c/0xb8 [ 8.899557][ T599] lr : gcov_event+0x28c/0x6b8 [ 8.899559][ T599] sp : ffffffc00e733b00 [ 8.899560][ T599] x29: ffffffc00e733b00 x28: ffffffc00e733d30 x27: ffffffe8dc297470 [ 8.899563][ T599] x26: ffffffe8dc297000 x25: ffffffe8dc297000 x24: ffffffe8dc297000 [ 8.899566][ T599] x23: ffffffe8dc0a6200 x22: ffffff880f68bf20 x21: 0000000000000000 [ 8.899569][ T599] x20: ffffff880f68bf00 x19: ffffff8801babc00 x18: ffffffc00d7f9058 [ 8.899572][ T599] x17: 0000000000088793 x16: ffffff80461cbe00 x15: 9100052952800785 [ 8.899575][ T599] x14: 0000000000000200 x13: 0000000000000041 x12: 9100052952800785 [ 8.899577][ T599] x11: ffffffe8dc297000 x10: ffffffe8dc297000 x9 : ffffff80461cbc80 [ 8.899580][ T599] x8 : ffffff8801babe80 x7 : ffffffe8dc2ec000 x6 : ffffffe8dc2ed000 [ 8.899583][ T599] x5 : 000000008020001f x4 : fffffffe2006eae0 x3 : 000000008020001f [ 8.899586][ T599] x2 : ffffff8027c49200 x1 : ffffff8801babc20 x0 : ffffff80461cb3a0 [ 8.899589][ T599] Call trace: [ 8.899590][ T599] gcov_info_add+0x9c/0xb8 [ 8.899592][ T599] gcov_module_notifier+0xbc/0x120 [ 8.899595][ T599] blocking_notifier_call_chain+0xa0/0x11c [ 8.899598][ T599] do_init_module+0x2a8/0x33c [ 8.899600][ T599] load_module+0x23cc/0x261c [ 8.899602][ T599] __arm64_sys_finit_module+0x158/0x194 [ 8.899604][ T599] invoke_syscall+0x94/0x2bc [ 8.899607][ T599] el0_svc_common+0x1d8/0x34c [ 8.899609][ T599] do_el0_svc+0x40/0x54 [ 8.899611][ T599] el0_svc+0x94/0x2f0 [ 8.899613][ T599] el0t_64_sync_handler+0x88/0xec [ 8.899615][ T599] el0t_64_sync+0x1b4/0x1b8 [ 8.899618][ T599] Code: f905f56c f86e69ec f86e6a0f 8b0c01ec (f82e6a0c) [ 8.899620][ T599] ---[ end trace ed5218e9e5b6e2e6 ]--- Link: https://lkml.kernel.org/r/1668020497-13142-1-git-send-email-quic_mojha@quicinc.com Fixes: e178a5beb369 ("gcov: clang support") Signed-off-by: Mukesh Ojha Reviewed-by: Peter Oberparleiter Tested-by: Peter Oberparleiter Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: [5.2+] Signed-off-by: Andrew Morton commit 045634ff1e8615714546d9dca92fcdbe0fd898ef Author: Gautam Menghani Date: Wed Oct 26 10:15:24 2022 +0530 mm/khugepaged: refactor mm_khugepaged_scan_file tracepoint to remove filename from function call Refactor the mm_khugepaged_scan_file tracepoint to move filename dereference to the tracepoint definition, to maintain consistency with other tracepoints[1]. [1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/ Link: https://lkml.kernel.org/r/20221026044524.54793-1-gautammenghani201@gmail.com Fixes: d41fd2016ed07 ("mm/khugepaged: add tracepoint to hpage_collapse_scan_file()") Signed-off-by: Gautam Menghani Reviewed-by: Yang Shi Reviewed-by: Zach O'Keefe Reviewed-by: Steven Rostedt (Google) Cc: David Hildenbrand Cc: Masami Hiramatsu (Google) Signed-off-by: Andrew Morton commit ed86b74874f839f0e579bdf92ea0a5aabdfabebb Author: Charan Teja Kalla Date: Tue Nov 8 10:46:22 2022 +0530 mm/page_exit: fix kernel doc warning in page_ext_put() Fix the below compiler warnings reported with 'make W=1 mm/'. mm/page_ext.c:178: warning: Function parameter or member 'page_ext' not described in 'page_ext_put'. [quic_pkondeti@quicinc.com: better patch title] Link: https://lkml.kernel.org/r/1667884582-2465-1-git-send-email-quic_charante@quicinc.com Fixes: b1d5488a252dc9 ("mm: fix use-after free of page_ext after race with memory-offline") Signed-off-by: Charan Teja Kalla Reported-by: Vlastimil Babka Tested-by: Vlastimil Babka Cc: Pavan Kondeti Signed-off-by: Andrew Morton commit e031ff96b334a08704d40ef64cd9024d7d83af9b Author: Yang Shi Date: Tue Nov 8 10:43:56 2022 -0800 mm: khugepaged: allow page allocation fallback to eligible nodes Syzbot reported the below splat: WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 __alloc_pages_node include/linux/gfp.h:221 [inline] WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 hpage_collapse_alloc_page mm/khugepaged.c:807 [inline] WARNING: CPU: 1 PID: 3646 at include/linux/gfp.h:221 alloc_charge_hpage+0x802/0xaa0 mm/khugepaged.c:963 Modules linked in: CPU: 1 PID: 3646 Comm: syz-executor210 Not tainted 6.1.0-rc1-syzkaller-00454-ga70385240892 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 RIP: 0010:__alloc_pages_node include/linux/gfp.h:221 [inline] RIP: 0010:hpage_collapse_alloc_page mm/khugepaged.c:807 [inline] RIP: 0010:alloc_charge_hpage+0x802/0xaa0 mm/khugepaged.c:963 Code: e5 01 4c 89 ee e8 6e f9 ae ff 4d 85 ed 0f 84 28 fc ff ff e8 70 fc ae ff 48 8d 6b ff 4c 8d 63 07 e9 16 fc ff ff e8 5e fc ae ff <0f> 0b e9 96 fa ff ff 41 bc 1a 00 00 00 e9 86 fd ff ff e8 47 fc ae RSP: 0018:ffffc90003fdf7d8 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888077f457c0 RSI: ffffffff81cd8f42 RDI: 0000000000000001 RBP: ffff888079388c0c R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f6b48ccf700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6b48a819f0 CR3: 00000000171e7000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: collapse_file+0x1ca/0x5780 mm/khugepaged.c:1715 hpage_collapse_scan_file+0xd6c/0x17a0 mm/khugepaged.c:2156 madvise_collapse+0x53a/0xb40 mm/khugepaged.c:2611 madvise_vma_behavior+0xd0a/0x1cc0 mm/madvise.c:1066 madvise_walk_vmas+0x1c7/0x2b0 mm/madvise.c:1240 do_madvise.part.0+0x24a/0x340 mm/madvise.c:1419 do_madvise mm/madvise.c:1432 [inline] __do_sys_madvise mm/madvise.c:1432 [inline] __se_sys_madvise mm/madvise.c:1430 [inline] __x64_sys_madvise+0x113/0x150 mm/madvise.c:1430 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6b48a4eef9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6b48ccf318 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f6b48af0048 RCX: 00007f6b48a4eef9 RDX: 0000000000000019 RSI: 0000000000600003 RDI: 0000000020000000 RBP: 00007f6b48af0040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6b48aa53a4 R13: 00007f6b48bffcbf R14: 00007f6b48ccf400 R15: 0000000000022000 The khugepaged code would pick up the node with the most hit as the preferred node, and also tries to do some balance if several nodes have the same hit record. Basically it does conceptually: * If the target_node <= last_target_node, then iterate from last_target_node + 1 to MAX_NUMNODES (1024 on default config) * If the max_value == node_load[nid], then target_node = nid But there is a corner case, paritucularly for MADV_COLLAPSE, that the non-existing node may be returned as preferred node. Assuming the system has 2 nodes, the target_node is 0 and the last_target_node is 1, if MADV_COLLAPSE path is hit, the max_value may be 0, then it may return 2 for target_node, but it is actually not existing (offline), so the warn is triggered. The node balance was introduced by commit 9f1b868a13ac ("mm: thp: khugepaged: add policy for finding target node") to satisfy "numactl --interleave=all". But interleaving is a mere hint rather than something that has hard requirements. So use nodemask to record the nodes which have the same hit record, the hugepage allocation could fallback to those nodes. And remove __GFP_THISNODE since it does disallow fallback. And if the nodemask just has one node set, it means there is one single node has the most hit record, the nodemask approach actually behaves like __GFP_THISNODE. Link: https://lkml.kernel.org/r/20221108184357.55614-2-shy828301@gmail.com Fixes: 7d8faaf15545 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse") Signed-off-by: Yang Shi Suggested-by: Zach O'Keefe Suggested-by: Michal Hocko Reviewed-by: Zach O'Keefe Acked-by: Michal Hocko Reported-by: Signed-off-by: Andrew Morton commit f53af4285d775cd9a9a146fc438bd0a1bee1838a Author: Johannes Weiner Date: Tue Aug 2 12:28:11 2022 -0400 mm: vmscan: fix extreme overreclaim and swap floods During proactive reclaim, we sometimes observe severe overreclaim, with several thousand times more pages reclaimed than requested. This trace was obtained from shrink_lruvec() during such an instance: prio:0 anon_cost:1141521 file_cost:7767 nr_reclaimed:4387406 nr_to_reclaim:1047 (or_factor:4190) nr=[7161123 345 578 1111] While he reclaimer requested 4M, vmscan reclaimed close to 16G, most of it by swapping. These requests take over a minute, during which the write() to memory.reclaim is unkillably stuck inside the kernel. Digging into the source, this is caused by the proportional reclaim bailout logic. This code tries to resolve a fundamental conflict: to reclaim roughly what was requested, while also aging all LRUs fairly and in accordance to their size, swappiness, refault rates etc. The way it attempts fairness is that once the reclaim goal has been reached, it stops scanning the LRUs with the smaller remaining scan targets, and adjusts the remainder of the bigger LRUs according to how much of the smaller LRUs was scanned. It then finishes scanning that remainder regardless of the reclaim goal. This works fine if priority levels are low and the LRU lists are comparable in size. However, in this instance, the cgroup that is targeted by proactive reclaim has almost no files left - they've already been squeezed out by proactive reclaim earlier - and the remaining anon pages are hot. Anon rotations cause the priority level to drop to 0, which results in reclaim targeting all of anon (a lot) and all of file (almost nothing). By the time reclaim decides to bail, it has scanned most or all of the file target, and therefor must also scan most or all of the enormous anon target. This target is thousands of times larger than the reclaim goal, thus causing the overreclaim. The bailout code hasn't changed in years, why is this failing now? The most likely explanations are two other recent changes in anon reclaim: 1. Before the series starting with commit 5df741963d52 ("mm: fix LRU balancing effect of new transparent huge pages"), the VM was overall relatively reluctant to swap at all, even if swap was configured. This means the LRU balancing code didn't come into play as often as it does now, and mostly in high pressure situations where pronounced swap activity wouldn't be as surprising. 2. For historic reasons, shrink_lruvec() loops on the scan targets of all LRU lists except the active anon one, meaning it would bail if the only remaining pages to scan were active anon - even if there were a lot of them. Before the series starting with commit ccc5dc67340c ("mm/vmscan: make active/inactive ratio as 1:1 for anon lru"), most anon pages would live on the active LRU; the inactive one would contain only a handful of preselected reclaim candidates. After the series, anon gets aged similarly to file, and the inactive list is the default for new anon pages as well, making it often the much bigger list. As a result, the VM is now more likely to actually finish large anon targets than before. Change the code such that only one SWAP_CLUSTER_MAX-sized nudge toward the larger LRU lists is made before bailing out on a met reclaim goal. This fixes the extreme overreclaim problem. Fairness is more subtle and harder to evaluate. No obvious misbehavior was observed on the test workload, in any case. Conceptually, fairness should primarily be a cumulative effect from regular, lower priority scans. Once the VM is in trouble and needs to escalate scan targets to make forward progress, fairness needs to take a backseat. This is also acknowledged by the myriad exceptions in get_scan_count(). This patch makes fairness decrease gradually, as it keeps fairness work static over increasing priority levels with growing scan targets. This should make more sense - although we may have to re-visit the exact values. Link: https://lkml.kernel.org/r/20220802162811.39216-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Hugh Dickins Cc: Joonsoo Kim Cc: Signed-off-by: Andrew Morton commit fa0e381290b134da53e65fb421b65825f23221b4 Author: Tiezhu Yang Date: Tue Nov 22 21:20:57 2022 +0800 docs/zh_CN/LoongArch: Fix wrong description of FPRs Note The Chinese translation of FPRs Note is not consistent with the original English version, $v0/$v1 should be $fv0/$fv1, $a0/$a1 should be $fa0/$fa1, fix them. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit f6abcc21d94393801937aed808b8f055ffec8579 Author: Shazad Hussain Date: Tue Nov 15 20:59:56 2022 +0530 clk: qcom: gcc-sc8280xp: add cxo as parent for three ufs ref clks The three UFS reference clocks, gcc_ufs_ref_clkref_clk for external UFS devices, gcc_ufs_card_clkref_clk and gcc_ufs_1_card_clkref_clk for two PHYs are all sourced from CXO. Added parent_data for all three reference clocks described above to reflect that all three clocks are sourced from CXO to have valid frequency for the ref clock needed by UFS controller driver. Fixes: d65d005f9a6c ("clk: qcom: add sc8280xp GCC driver") Link: https://lore.kernel.org/lkml/Y2Tber39cHuOSR%2FW@hovoldconsulting.com/ Signed-off-by: Shazad Hussain Tested-by: Johan Hovold Reviewed-by: Johan Hovold Tested-by: Andrew Halaney Reviewed-by: Andrew Halaney Reviewed-by: Brian Masney Link: https://lore.kernel.org/r/20221115152956.21677-1-quic_shazhuss@quicinc.com Reviewed-by: Bjorn Andersson Signed-off-by: Stephen Boyd commit 4e85952f2678b458315e926a9b1f6d5bbf921b7c Merge: 0d51d0db9f92f 5797676242867 Author: Stephen Boyd Date: Tue Nov 22 16:43:18 2022 -0800 Merge tag 'clk-microchip-fixes-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-fixes Pull Microchip clk driver fixes from Claudiu Beznea: - fix the clock ID for USB device port on AT91 RM9200 SoCs; along with it the device tree references to this clocks were fixed in this patch to ease the backporting and to avoid USB driver probe failure. * tag 'clk-microchip-fixes-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: rm9200: fix usb device clock id commit 0d51d0db9f92fcf56bee6d500a1cde8fafb5b411 Merge: 4cc47e8add635 2bc5febd05abe Author: Stephen Boyd Date: Tue Nov 22 16:35:46 2022 -0800 Merge tag 'samsung-clk-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into clk-fixes Pull Samsung SoC clk driver fixes from Krzysztof Kozlowski: - Fix calling of_device_get_match_data() on wrong device (parent's) in Exynos clock out driver - Correct clock name in bindings of ExynosAutov9 clocks - Correct parents of div4 clock on Exynos7885 * tag 'samsung-clk-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()" dt-bindings: clock: exynosautov9: fix reference to CMU_FSYS1 clk: samsung: exynos7885: Correct "div4" clock parents commit 60d865bd5a9b15a3961eb1c08bd4155682a3c81e Author: Yang Yingliang Date: Mon Nov 21 10:32:09 2022 +0800 of: property: decrement node refcount in of_fwnode_get_reference_args() In of_fwnode_get_reference_args(), the refcount of of_args.np has been incremented in the case of successful return from of_parse_phandle_with_args() or of_parse_phandle_with_fixed_args(). Decrement the refcount if of_args is not returned to the caller of of_fwnode_get_reference_args(). Fixes: 3e3119d3088f ("device property: Introduce fwnode_property_get_reference_args") Signed-off-by: Yang Yingliang Reviewed-by: Sakari Ailus Reviewed-by: Frank Rowand Link: https://lore.kernel.org/r/20221121023209.3909759-1-yangyingliang@huawei.com Signed-off-by: Rob Herring commit 022632f6c43a86f2135642dccd5686de318e861d Author: Daniel Bristot de Oliveira Date: Thu Nov 17 14:46:17 2022 +0100 tracing/osnoise: Fix duration type The duration type is a 64 long value, not an int. This was causing some long noise to report wrong values. Change the duration to a 64 bits value. Link: https://lkml.kernel.org/r/a93d8a8378c7973e9c609de05826533c9e977939.1668692096.git.bristot@kernel.org Cc: stable@vger.kernel.org Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Jonathan Corbet Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") Signed-off-by: Daniel Bristot de Oliveira Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit ccc6e5900745a60073e4967f04b618cdd92b63d6 Author: Xiu Jianfeng Date: Tue Nov 15 09:44:45 2022 +0800 tracing/user_events: Fix memory leak in user_event_create() Before current_user_event_group(), it has allocated memory and save it in @name, this should freed before return error. Link: https://lkml.kernel.org/r/20221115014445.158419-1-xiujianfeng@huawei.com Fixes: e5d271812e7a ("tracing/user_events: Move pages/locks into groups to prepare for namespaces") Signed-off-by: Xiu Jianfeng Acked-by: Masami Hiramatsu (Google) Acked-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 22c17e279a1b03bad7987e4a4192b289b890f293 Author: Christoph Hellwig Date: Tue Nov 22 08:27:53 2022 +0100 blk-mq: fix queue reference leak on blk_mq_alloc_disk_for_queue failure Drop the request queue reference just acquired when __alloc_disk_node failed. Fixes: 6f8191fdf41d ("block: simplify disk shutdown") Reported-by: Al Viro Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20221122072753.426077-1-hch@lst.de Signed-off-by: Jens Axboe commit ff5a19909b49fe5c0b01ae197f84b741e0f698dc Author: Linus Walleij Date: Tue Nov 22 14:44:11 2022 +0100 bus: ixp4xx: Don't touch bit 7 on IXP42x We face some regressions on a few IXP42x systems when accessing flash, the following unrelated error prints appear from the PCI driver: ixp4xx-pci c0000000.pci: PCI: abort_handler addr = 0xff9ffb5f, isr = 0x0, status = 0x22a0 ixp4xx-pci c0000000.pci: imprecise abort (...) It turns out that while bit 7 is masked "reserved" it is not unused, so masking it off as zero is dangerous, and breaks flash access on some systems such as the NSLU2. Be more careful and avoid masking off any of the reserved bits 7, 8, 9 or 30. Only keep masking EXP_WORD (bit 2) on IXP43x which is necessary in some setups. Fixes: 1c953bda90ca ("bus: ixp4xx: Add a driver for IXP4xx expansion bus") Signed-off-by: Linus Walleij Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221122134411.2030372-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann commit 4e3c51f4e805291b057d12f5dda5aeb50a538dc4 Author: Svyatoslav Feldsherov Date: Tue Nov 15 20:20:01 2022 +0000 fs: do not update freeing inode i_io_list After commit cbfecb927f42 ("fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE") writeback_single_inode can push inode with I_DIRTY_TIME set to b_dirty_time list. In case of freeing inode with I_DIRTY_TIME set this can happen after deletion of inode from i_io_list at evict. Stack trace is following. evict fat_evict_inode fat_truncate_blocks fat_flush_inodes writeback_inode sync_inode_metadata(inode, sync=0) writeback_single_inode(inode, wbc) <- wbc->sync_mode == WB_SYNC_NONE This will lead to use after free in flusher thread. Similar issue can be triggered if writeback_single_inode in the stack trace update inode->i_io_list. Add explicit check to avoid it. Fixes: cbfecb927f42 ("fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE") Reported-by: syzbot+6ba92bd00d5093f7e371@syzkaller.appspotmail.com Reviewed-by: Jan Kara Signed-off-by: Svyatoslav Feldsherov Link: https://lore.kernel.org/r/20221115202001.324188-1-feldsherov@google.com Signed-off-by: Theodore Ts'o commit 0a068f4a717f2a68b34452de682accbb1a40bed0 Author: Colin Ian King Date: Thu Oct 20 14:30:19 2022 +0100 tracing/hist: add in missing * in comment blocks There are a couple of missing * in comment blocks. Fix these. Cleans up two clang warnings: kernel/trace/trace_events_hist.c:986: warning: bad line: kernel/trace/trace_events_hist.c:3229: warning: bad line: Link: https://lkml.kernel.org/r/20221020133019.1547587-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit bcd9e3c1656d0f7dd9743598c65c3ae24efb38d0 Author: Felix Fietkau Date: Mon Nov 21 19:26:15 2022 +0100 netfilter: flowtable_offload: add missing locking nf_flow_table_block_setup and the driver TC_SETUP_FT call can modify the flow block cb list while they are being traversed elsewhere, causing a crash. Add a write lock around the calls to protect readers Fixes: c29f74e0df7a ("netfilter: nf_flow_table: hardware offload support") Reported-by: Chad Monroe Signed-off-by: Felix Fietkau Signed-off-by: Pablo Neira Ayuso commit 6a66ce44a51bdfc47721f0c591137df2d4b21247 Author: Jozsef Kadlecsik Date: Tue Nov 22 20:18:58 2022 +0100 netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface The commit 510841da1fcc ("netfilter: ipset: enforce documented limit to prevent allocating huge memory") was too strict and prevented to add up to 64 clashing elements to a hash:net,iface type of set. This patch fixes the issue and now the type behaves as documented. Fixes: 510841da1fcc ("netfilter: ipset: enforce documented limit to prevent allocating huge memory") Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit 11780e37565db4dd064d3243ca68f755c13f65b4 Author: Ricardo Ribalda Date: Tue Nov 22 00:38:55 2022 +0100 pinctrl: meditatek: Startup with the IRQs disabled If the system is restarted via kexec(), the peripherals do not start with a known state. If the previous system had enabled an IRQs we will receive unexected IRQs that can lock the system. [ 28.109251] watchdog: BUG: soft lockup - CPU#0 stuck for 26s! [swapper/0:0] [ 28.109263] Modules linked in: [ 28.109273] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.79-14458-g4b9edf7b1ac6 #1 9f2e76613148af94acccd64c609a552fb4b4354b [ 28.109284] Hardware name: Google Elm (DT) [ 28.109290] pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 28.109298] pc : __do_softirq+0xa0/0x388 [ 28.109309] lr : __do_softirq+0x70/0x388 [ 28.109316] sp : ffffffc008003ee0 [ 28.109321] x29: ffffffc008003f00 x28: 000000000000000a x27: 0000000000000080 [ 28.109334] x26: 0000000000000001 x25: ffffffefa7b350c0 x24: ffffffefa7b47480 [ 28.109346] x23: ffffffefa7b3d000 x22: 0000000000000000 x21: ffffffefa7b0fa40 [ 28.109358] x20: ffffffefa7b005b0 x19: ffffffefa7b47480 x18: 0000000000065b6b [ 28.109370] x17: ffffffefa749c8b0 x16: 000000000000018c x15: 00000000000001b8 [ 28.109382] x14: 00000000000d3b6b x13: 0000000000000006 x12: 0000000000057e91 [ 28.109394] x11: 0000000000000000 x10: 0000000000000000 x9 : ffffffefa7b47480 [ 28.109406] x8 : 00000000000000e0 x7 : 000000000f424000 x6 : 0000000000000000 [ 28.109418] x5 : ffffffefa7dfaca0 x4 : ffffffefa7dfadf0 x3 : 000000000000000f [ 28.109429] x2 : 0000000000000000 x1 : 0000000000000100 x0 : 0000000001ac65c5 [ 28.109441] Call trace: [ 28.109447] __do_softirq+0xa0/0x388 [ 28.109454] irq_exit+0xc0/0xe0 [ 28.109464] handle_domain_irq+0x68/0x90 [ 28.109473] gic_handle_irq+0xac/0xf0 [ 28.109480] call_on_irq_stack+0x28/0x50 [ 28.109488] do_interrupt_handler+0x44/0x58 [ 28.109496] el1_interrupt+0x30/0x58 [ 28.109506] el1h_64_irq_handler+0x18/0x24 [ 28.109512] el1h_64_irq+0x7c/0x80 [ 28.109519] arch_local_irq_enable+0xc/0x18 [ 28.109529] default_idle_call+0x40/0x140 [ 28.109539] do_idle+0x108/0x290 [ 28.109547] cpu_startup_entry+0x2c/0x30 [ 28.109554] rest_init+0xe8/0xf8 [ 28.109562] arch_call_rest_init+0x18/0x24 [ 28.109571] start_kernel+0x338/0x42c [ 28.109578] __primary_switched+0xbc/0xc4 [ 28.109588] Kernel panic - not syncing: softlockup: hung tasks Signed-off-by: Ricardo Ribalda Link: https://lore.kernel.org/r/20221122-mtk-pinctrl-v1-1-bedf5655a3d2@chromium.org Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Signed-off-by: Linus Walleij commit 1056d314709d0607a22e589c54b1e47e0da57b9d Author: Perry Yuan Date: Thu Nov 17 15:35:41 2022 +0800 Documentation: add amd-pstate kernel command line options Add a new amd pstate driver command line option to enable driver passive working mode via MSR and shared memory interface to request desired performance within abstract scale and the power management firmware (SMU) convert the perf requests into actual hardware pstates. Also the `disable` parameter can disable the pstate driver loading by adding `amd_pstate=disable` to kernel command line. Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 8a2cbf72a43ade1ed00760f65914e322599fe662 Author: Perry Yuan Date: Thu Nov 17 15:35:40 2022 +0800 Documentation: amd-pstate: add driver working mode introduction Introduce the `amd_pstate` driver new working mode with `amd_pstate=passive` added to kernel command line. If there is no passive mode enabled by user, amd_pstate driver will be disabled by default for now. Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 202e683df37cdf4c38e06e56ac91cc170ef49058 Author: Perry Yuan Date: Thu Nov 17 15:35:39 2022 +0800 cpufreq: amd-pstate: add amd-pstate driver parameter for mode selection When the amd_pstate driver is built-in users still need a method to be able enable or disable it depending upon their circumstance. Add support for an early parameter to do this. There is some performance degradation on a number of ASICs in the passive mode. This performance issue was originally discovered in shared memory systems but it has been proven that certain workloads on MSR systems also suffer performance issues. Set the amd-pstate driver as disabled by default to temporarily mitigate the performance problem. 1) with `amd_pstate=disable`, pstate driver will be disabled to load at kernel booting. 2) with `amd_pstate=passive`, pstate driver will be enabled and loaded as non-autonomous working mode supported in the low-level power management firmware. 3) If neither parameter is specified, the driver will be disabled by default to avoid triggering performance regressions in certain ASICs Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 456ca88d8a5258fc66edc42a10053ac8473de2b1 Author: Perry Yuan Date: Thu Nov 17 15:35:38 2022 +0800 cpufreq: amd-pstate: change amd-pstate driver to be built-in type Currently when the amd-pstate and acpi_cpufreq are both built into kernel as module driver, amd-pstate will not be loaded by default in this case. Change amd-pstate driver as built-in type, it will resolve the loading sequence problem to allow user to make amd-pstate driver as the default cpufreq scaling driver. Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Perry Yuan Fixes: ec437d71db77 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors") Signed-off-by: Rafael J. Wysocki commit 919f4557696939625085435ebde09a539de2349c Author: Wyes Karny Date: Thu Nov 17 15:35:37 2022 +0800 cpufreq: amd-pstate: cpufreq: amd-pstate: reset MSR_AMD_PERF_CTL register at init MSR_AMD_PERF_CTL is guaranteed to be 0 on a cold boot. However, on a kexec boot, for instance, it may have a non-zero value (if the cpu was in a non-P0 Pstate). In such cases, the cores with non-P0 Pstates at boot will never be pushed to P0, let alone boost frequencies. Kexec is a common workflow for reboot on Linux and this creates a regression in performance. Fix it by explicitly setting the MSR_AMD_PERF_CTL to 0 during amd_pstate driver init. Cc: All applicable Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Wyes Karny Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit cdcc5ef26b39c3d02d4e69c0352b007ebe438a22 Author: Sam Wu Date: Thu Nov 10 19:57:32 2022 +0000 Revert "cpufreq: schedutil: Move max CPU capacity to sugov_policy" This reverts commit 6d5afdc97ea71958287364a1f1d07e59ef151b11. On a Pixel 6 device, it is observed that this commit increases latency by approximately 50ms, or 20%, in migrating a task that requires full CPU utilization from a LITTLE CPU to Fmax on a big CPU. Reverting this change restores the latency back to its original baseline value. Fixes: 6d5afdc97ea7 ("cpufreq: schedutil: Move max CPU capacity to sugov_policy") Signed-off-by: Sam Wu Signed-off-by: Rafael J. Wysocki commit 022b68f271de0e53024e6d5e96fee8e76d25eb95 Author: Horatiu Vultur Date: Fri Nov 18 06:38:40 2022 +0000 nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear() The blamed commit introduced the following smatch warning in the function lan9662_otp_wait_flag_clear: drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)' Fix this by changing the return type of the function lan9662_otp_wait_flag_clear() to be int instead of bool. Fixes: 9e8f208ad5229d ("nvmem: lan9662-otp: add support") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Horatiu Vultur Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20221118063840.6357-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 58e92c4a496b27156020a59a98c7f4a92c2b1533 Author: Wei Yongjun Date: Fri Nov 18 06:38:38 2022 +0000 nvmem: rmem: Fix return value check in rmem_read() In case of error, the function memremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 5a3fa75a4d9c ("nvmem: Add driver to expose reserved memory as nvmem") Cc: Srinivas Kandagatla Cc: Nicolas Saenz Julienne Signed-off-by: Wei Yongjun Acked-by: Nicolas Saenz Julienne Signed-off-by: Yang Yingliang Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20221118063840.6357-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9919d41809fb32bfdd5d7dc53345f83b89e33feb Merge: 634c5fa1e3adb 1498a5a79980f Author: Greg Kroah-Hartman Date: Tue Nov 22 18:19:25 2022 +0100 Merge tag 'icc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-linus Georgi writes: interconnect fix for v6.1-rc This contains a tiny fix to align the driver compatible string in the binding documentation with the one used in DTS. - dt-bindings: interconnect: qcom,msm8998-bwmon: Correct SC7280 CPU compatible Signed-off-by: Georgi Djakov * tag 'icc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: dt-bindings: interconnect: qcom,msm8998-bwmon: Correct SC7280 CPU compatible commit 634c5fa1e3adb381ef317452a6d0f5282380f2c6 Merge: 552d6ba290497 398e3479874f3 Author: Greg Kroah-Hartman Date: Tue Nov 22 18:18:26 2022 +0100 Merge tag 'iio-fixes-for-6.1c' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: "3rd set of IIO fixes for the 6.1 cycle. Usual mixed bunch of driver fixes. * sw-triggers - Fix failure to cleanup up list registration in an error path. * aspeed,adc - Drop the trim valid dts property as it doesn't account for unprogrammed OTP and that can be easily detected without it. * avago,apds9960: - Fix register address for gesture gain. * bosch,bma400 - Fix a memory leak in an error path. * rohm,rpr0521 - Fix missing dependency on IIO_BUFFER/IIO_TRIGGERED_BUFFER. * ti,afe4403/4404 - Fix out of band read by moving reads down to where they are used." * tag 'iio-fixes-for-6.1c' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" iio: adc: aspeed: Remove the trim valid dts property. iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails iio: accel: bma400: Fix memory leak in bma400_get_steps_reg() iio: light: rpr0521: add missing Kconfig dependencies iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw iio: health: afe4403: Fix oob read in afe4403_read_raw iio: light: apds9960: fix wrong register for gesture gain commit 552d6ba290497f6a2860b56b94dc6a25f9820440 Merge: eb7081409f94a dfd10332596ef Author: Greg Kroah-Hartman Date: Tue Nov 22 18:16:40 2022 +0100 Merge tag 'fpga-for-6.1-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into work-linus Xu writes: FPGA Manager changes for 6.1-final Intel m10 bmc secure update - Russ's change fixes Kconfig dependencies All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-6.1 branch) Signed-off-by: Xu Yilun * tag 'fpga-for-6.1-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: m10bmc-sec: Fix kconfig dependencies commit 7a21b27aafa3edead79ed97e6f22236be6b9f447 Author: Pawel Laszczak Date: Tue Nov 15 04:22:18 2022 -0500 usb: cdnsp: fix issue with ZLP - added TD_SIZE = 1 Patch modifies the TD_SIZE in TRB before ZLP TRB. The TD_SIZE in TRB before ZLP TRB must be set to 1 to force processing ZLP TRB by controller. cc: Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20221115092218.421267-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman commit f90f5afd5083a7cb4aee13bd4cc0ae600bd381ca Author: Thinh Nguyen Date: Tue Nov 15 17:19:43 2022 -0800 usb: dwc3: gadget: Clear ep descriptor last Until the endpoint is disabled, its descriptors should remain valid. When its requests are removed from ep disable, the request completion routine may attempt to access the endpoint's descriptor. Don't clear the descriptors before that. Fixes: f09ddcfcb8c5 ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/45db7c83b209259115bf652af210f8b2b3b1a383.1668561364.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit e0481e5b3cc12ea7ccf4552d41518c89d3509004 Author: Marek Szyprowski Date: Thu Nov 10 16:41:31 2022 +0100 usb: dwc3: exynos: Fix remove() function The core DWC3 device node was not properly removed by the custom dwc3_exynos_remove_child() function. Replace it with generic of_platform_depopulate() which does that job right. Fixes: adcf20dcd262 ("usb: dwc3: exynos: Use of_platform API to create dwc3 core pdev") Signed-off-by: Marek Szyprowski Acked-by: Thinh Nguyen Cc: stable@vger.kernel.org Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20221110154131.2577-1-m.szyprowski@samsung.com Signed-off-by: Greg Kroah-Hartman commit b25264f22b498dff3fa5c70c9bea840e83fff0d1 Author: Pawel Laszczak Date: Thu Nov 10 01:30:05 2022 -0500 usb: cdnsp: Fix issue with Clear Feature Halt Endpoint During handling Clear Halt Endpoint Feature request, driver invokes Reset Endpoint command. Because this command has some issue with transition endpoint from Running to Idle state the driver must stop the endpoint by using Stop Endpoint command. cc: Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Reviewed-by: Peter Chen Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20221110063005.370656-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman commit 3aa07f72894d209fcf922ad686cbb28cf005aaad Author: Thinh Nguyen Date: Wed Nov 9 17:58:50 2022 -0800 usb: dwc3: gadget: Disable GUSB2PHYCFG.SUSPHY for End Transfer If there's a disconnection while operating in eSS, there may be a delay in VBUS drop response from the connector. In that case, the internal link state may drop to operate in usb2 speed while the controller thinks the VBUS is still high. The driver must make sure to disable GUSB2PHYCFG.SUSPHY when sending endpoint command while in usb2 speed. The End Transfer command may be called, and only that command needs to go through at this point. Let's keep it simple and unconditionally disable GUSB2PHYCFG.SUSPHY whenever we issue the command. This scenario is not seen in real hardware. In a rare case, our prototype type-c controller/interface may have a slow response triggerring this issue. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/5651117207803c26e2f22ddf4e5ce9e865dcf7c7.1668045468.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 181babf7b4e5050b7a23cb47eb06277405cf132f Author: Michael Grzeschik Date: Wed Oct 26 20:22:40 2022 +0200 usb: gadget: uvc: also use try_format in set_format Since e219a712bc06 (usb: gadget: uvc: add v4l2 try_format api call) the try_format function is available. With this function includes checks for valid configurations programmed in the configfs. We use this function to ensure to return valid values on the set_format callback. Signed-off-by: Michael Grzeschik Fixes: e219a712bc06 ("usb: gadget: uvc: add v4l2 try_format api call") Link: https://lore.kernel.org/r/20221026182240.363055-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a6a00d7e8ffd78d1cdb7a43f1278f081038c638f Author: Tetsuo Handa Date: Fri Nov 18 00:27:58 2022 +0900 fbcon: Use kzalloc() in fbcon_prepare_logo() A kernel built with syzbot's config file reported that scr_memcpyw(q, save, array3_size(logo_lines, new_cols, 2)) causes uninitialized "save" to be copied. ---------- [drm] Initialized vgem 1.0.0 20120112 for vgem on minor 0 [drm] Initialized vkms 1.0.0 20180514 for vkms on minor 1 Console: switching to colour frame buffer device 128x48 ===================================================== BUG: KMSAN: uninit-value in do_update_region+0x4b8/0xba0 do_update_region+0x4b8/0xba0 update_region+0x40d/0x840 fbcon_switch+0x3364/0x35e0 redraw_screen+0xae3/0x18a0 do_bind_con_driver+0x1cb3/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...) Uninit was stored to memory at: fbcon_prepare_logo+0x143b/0x1940 fbcon_init+0x2c1b/0x31c0 visual_init+0x3e7/0x820 do_bind_con_driver+0x14a4/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...) Uninit was created at: __kmem_cache_alloc_node+0xb69/0x1020 __kmalloc+0x379/0x680 fbcon_prepare_logo+0x704/0x1940 fbcon_init+0x2c1b/0x31c0 visual_init+0x3e7/0x820 do_bind_con_driver+0x14a4/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...) CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc4-00356-g8f2975c2bb4c #924 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 ---------- Signed-off-by: Tetsuo Handa Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/cad03d25-0ea0-32c4-8173-fd1895314bce@I-love.SAKURA.ne.jp commit 2dc4ac91f845b690ddf2ad39172c3698b2769fa2 Author: Gerhard Engleder Date: Sat Nov 19 22:18:25 2022 +0100 tsnep: Fix rotten packets If PTP synchronisation is done every second, then sporadic the interval is higher than one second: ptp4l[696.582]: master offset -17 s2 freq -1891 path delay 573 ptp4l[697.582]: master offset -22 s2 freq -1901 path delay 573 ptp4l[699.368]: master offset -1 s2 freq -1887 path delay 573 ^^^^^^^ Should be 698.582! This problem is caused by rotten packets, which are received after polling but before interrupts are enabled again. This can be fixed by checking for pending work and rescheduling if necessary after interrupts has been enabled again. Fixes: 403f69bbdbad ("tsnep: Add TSN endpoint Ethernet MAC driver") Signed-off-by: Gerhard Engleder Link: https://lore.kernel.org/r/20221119211825.81805-1-gerhard@engleder-embedded.com Signed-off-by: Paolo Abeni commit 534bd70374d646f17e2cebe0e6e4cdd478ce4f0c Author: Alexandre Belloni Date: Tue Nov 15 12:01:58 2022 +0100 init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash When using dash as /bin/sh, the CC_HAS_ASM_GOTO_TIED_OUTPUT test fails with a syntax error which is not the one we are looking for: : In function ‘foo’: :1:29: warning: missing terminating " character :1:29: error: missing terminating " character :2:5: error: expected ‘:’ before ‘+’ token :2:7: warning: missing terminating " character :2:7: error: missing terminating " character :2:5: error: expected declaration or statement at end of input Removing '\n' solves this. Fixes: 1aa0e8b144b6 ("Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug") Signed-off-by: Alexandre Belloni Reviewed-by: Sean Christopherson Signed-off-by: Masahiro Yamada commit 432e25902b9651622578c6248e549297d03caf66 Author: Dawei Li Date: Sat Nov 5 00:05:36 2022 +0800 dma-buf: fix racing conflict of dma_heap_add() Racing conflict could be: task A task B list_for_each_entry strcmp(h->name)) list_for_each_entry strcmp(h->name) kzalloc kzalloc ...... ..... device_create device_create list_add list_add The root cause is that task B has no idea about the fact someone else(A) has inserted heap with same name when it calls list_add, so a potential collision occurs. Fixes: c02a81fba74f ("dma-buf: Add dma-buf heaps framework") Signed-off-by: Dawei Li Acked-by: Andrew Davis Acked-by: Christian König Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/TYCP286MB2323873BBDF88020781FB986CA3B9@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM commit bb3cfbaf7c6416f3109fdb14f6fc0eb1a50361ad Author: Zheng Bin Date: Sat Nov 19 21:36:16 2022 +0800 octeontx2-pf: Remove duplicate MACSEC setting Commit 4581dd480c9e ("net: octeontx2-pf: mcs: consider MACSEC setting") has already added "depends on MACSEC || !MACSEC", so remove it. Signed-off-by: Zheng Bin Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20221119133616.3583538-1-zhengbin13@huawei.com Signed-off-by: Paolo Abeni commit 3637a29ccbb6461b7268c5c5db525935d510afc6 Author: Yang Yingliang Date: Sat Nov 19 15:02:02 2022 +0800 bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending() As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrement the reference count by calling pci_dev_put(). Call pci_dev_put() before returning from bnx2x_vf_is_pcie_pending() to avoid refcount leak. Fixes: b56e9670ffa4 ("bnx2x: Prepare device and initialize VF database") Suggested-by: Jakub Kicinski Signed-off-by: Yang Yingliang Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20221119070202.1407648-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni commit 31a6297b89aabc81b274c093a308a7f5b55081a7 Author: Andreas Kemnade Date: Sun Nov 20 23:12:08 2022 +0100 regulator: twl6030: fix get status of twl6032 regulators Status is reported as always off in the 6032 case. Status reporting now matches the logic in the setters. Once of the differences to the 6030 is that there are no groups, therefore the state needs to be read out in the lower bits. Signed-off-by: Andreas Kemnade Link: https://lore.kernel.org/r/20221120221208.3093727-3-andreas@kemnade.info Signed-off-by: Mark Brown commit 3d6c982b26db94cc21bc9f7784f63e8286b7be62 Author: Andreas Kemnade Date: Sun Nov 20 23:12:07 2022 +0100 regulator: twl6030: re-add TWL6032_SUBCLASS In former times, info->feature was populated via the parent driver by pdata/regulator_init_data->driver_data for all regulators when USB_PRODUCT_ID_LSB indicates a TWL6032. Today, the information is not set, so re-add it at the regulator definitions. Fixes: 25d82337705e2 ("regulator: twl: make driver DT only") Signed-off-by: Andreas Kemnade Link: https://lore.kernel.org/r/20221120221208.3093727-2-andreas@kemnade.info Signed-off-by: Mark Brown commit db8f91d424fe0ea6db337aca8bc05908bbce1498 Author: Srinivasa Rao Mandadapu Date: Tue Nov 22 12:01:13 2022 +0530 ASoC: soc-pcm: Add NULL check in BE reparenting Add NULL check in dpcm_be_reparent API, to handle kernel NULL pointer dereference error. The issue occurred in fuzzing test. Signed-off-by: Srinivasa Rao Mandadapu Link: https://lore.kernel.org/r/1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 53270fb0fd77fe786d8c07a0793981d797836b93 Author: Liu Shixin Date: Fri Nov 18 16:24:19 2022 +0800 NFC: nci: fix memory leak in nci_rx_data_packet() Syzbot reported a memory leak about skb: unreferenced object 0xffff88810e144e00 (size 240): comm "syz-executor284", pid 3701, jiffies 4294952403 (age 12.620s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __alloc_skb+0x1f9/0x270 net/core/skbuff.c:497 [] alloc_skb include/linux/skbuff.h:1267 [inline] [] virtual_ncidev_write+0x24/0xe0 drivers/nfc/virtual_ncidev.c:116 [] do_loop_readv_writev fs/read_write.c:759 [inline] [] do_loop_readv_writev fs/read_write.c:743 [inline] [] do_iter_write+0x253/0x300 fs/read_write.c:863 [] vfs_writev+0xdd/0x240 fs/read_write.c:934 [] do_writev+0xa6/0x1c0 fs/read_write.c:977 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd In nci_rx_data_packet(), if we don't get a valid conn_info, we will return directly but forget to release the skb. Reported-by: syzbot+cdb9a427d1bc08815104@syzkaller.appspotmail.com Fixes: 4aeee6871e8c ("NFC: nci: Add dynamic logical connections support") Signed-off-by: Liu Shixin Link: https://lore.kernel.org/r/20221118082419.239475-1-liushixin2@huawei.com Signed-off-by: Paolo Abeni commit 4dbd6a3e90e03130973688fd79e19425f720d999 Author: Michael Kelley Date: Wed Nov 16 10:41:24 2022 -0800 x86/ioremap: Fix page aligned size calculation in __ioremap_caller() Current code re-calculates the size after aligning the starting and ending physical addresses on a page boundary. But the re-calculation also embeds the masking of high order bits that exceed the size of the physical address space (via PHYSICAL_PAGE_MASK). If the masking removes any high order bits, the size calculation results in a huge value that is likely to immediately fail. Fix this by re-calculating the page-aligned size first. Then mask any high order bits using PHYSICAL_PAGE_MASK. Fixes: ffa71f33a820 ("x86, ioremap: Fix incorrect physical address handling in PAE mode") Signed-off-by: Michael Kelley Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Cc: Link: https://lore.kernel.org/r/1668624097-14884-2-git-send-email-mikelley@microsoft.com commit 8427fd100c7b7793650e212a81e42f1cf124613d Author: Xin Long Date: Fri Nov 18 16:33:03 2022 -0500 net: sched: allow act_ct to be built without NF_NAT In commit f11fe1dae1c4 ("net/sched: Make NET_ACT_CT depends on NF_NAT"), it fixed the build failure when NF_NAT is m and NET_ACT_CT is y by adding depends on NF_NAT for NET_ACT_CT. However, it would also cause NET_ACT_CT cannot be built without NF_NAT, which is not expected. This patch fixes it by changing to use "(!NF_NAT || NF_NAT)" as the depend. Fixes: f11fe1dae1c4 ("net/sched: Make NET_ACT_CT depends on NF_NAT") Signed-off-by: Xin Long Link: https://lore.kernel.org/r/b6386f28d1ba34721795fb776a91cbdabb203447.1668807183.git.lucien.xin@gmail.com Signed-off-by: Paolo Abeni commit 4305fe232b8aa59af3761adc9fe6b6aa40913960 Author: Liu Jian Date: Thu Nov 17 20:59:18 2022 +0800 net: sparx5: fix error handling in sparx5_port_open() If phylink_of_phy_connect() fails, the port should be disabled. If sparx5_serdes_set()/phy_power_on() fails, the port should be disabled and the phylink should be stopped and disconnected. Fixes: 946e7fd5053a ("net: sparx5: add port module support") Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support") Signed-off-by: Liu Jian Tested-by: Bjarni Jonasson Reviewed-by: Steen Hegelund Link: https://lore.kernel.org/r/20221117125918.203997-1-liujian56@huawei.com Signed-off-by: Paolo Abeni commit aad98abd5cb8133507f22654f56bcb443aaa2d89 Author: Zhang Changzhong Date: Thu Nov 17 15:50:09 2022 +0800 sfc: fix potential memleak in __ef100_hard_start_xmit() The __ef100_hard_start_xmit() returns NETDEV_TX_OK without freeing skb in error handling case, add dev_kfree_skb_any() to fix it. Fixes: 51b35a454efd ("sfc: skeleton EF100 PF driver") Signed-off-by: Zhang Changzhong Acked-by: Martin Habets Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/1668671409-10909-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Paolo Abeni commit e541dd7763fc34aec2f93f652a396cc2e7b92d8d Author: Wang ShaoBo Date: Fri Nov 18 14:24:47 2022 +0800 net: wwan: iosm: use ACPI_FREE() but not kfree() in ipc_pcie_read_bios_cfg() acpi_evaluate_dsm() should be coupled with ACPI_FREE() to free the ACPI memory, because we need to track the allocation of acpi_object when ACPI_DBG_TRACK_ALLOCATIONS enabled, so use ACPI_FREE() instead of kfree(). Fixes: d38a648d2d6c ("net: wwan: iosm: fix memory leak in ipc_pcie_read_bios_cfg") Signed-off-by: Wang ShaoBo Link: https://lore.kernel.org/r/20221118062447.2324881-1-bobo.shaobowang@huawei.com Signed-off-by: Paolo Abeni commit f6d910a89a2391e5ce1f275d205023880a33d3f8 Author: Ankit Patel Date: Tue Nov 22 15:35:20 2022 +0800 HID: usbhid: Add ALWAYS_POLL quirk for some mice Some additional USB mouse devices are needing ALWAYS_POLL quirk without which they disconnect and reconnect every 60s. Add below devices to the known quirk list. CHERRY VID 0x046a, PID 0x000c MICROSOFT VID 0x045e, PID 0x0783 PRIMAX VID 0x0461, PID 0x4e2a Signed-off-by: Ankit Patel Signed-off-by: Haotien Hsu Signed-off-by: Jiri Kosina commit 2d0b08c157434eebf0b6393c570089666dacf2aa Author: Marek Vasut Date: Sun Nov 13 19:58:38 2022 +0100 MAINTAINERS: mark rsi wifi driver as orphan Neither Redpine Signals nor Silicon Labs seem to care about proper maintenance of this driver, nor is there any help, documentation or feedback on patches. The driver suffers from various problems and subtle bugs. Mark it as orphaned. Signed-off-by: Marek Vasut Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221113185838.11643-1-marex@denx.de commit 14af5d385878d22546914d37f13a314b14825a42 Merge: ebbaa4392e365 3c9fd44b9330a Author: Tvrtko Ursulin Date: Tue Nov 22 07:59:17 2022 +0000 Merge tag 'gvt-fixes-2022-11-11' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2022-11-11 - kvm reference fix from Sean Signed-off-by: Tvrtko Ursulin From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20221111090208.GQ30028@zhen-hp.sh.intel.com commit 40781bfb836eda57d19c0baa37c7e72590e05fdc Author: Chen Zhongjin Date: Thu Nov 3 17:07:13 2022 +0800 xfrm: Fix ignored return value in xfrm6_init() When IPv6 module initializing in xfrm6_init(), register_pernet_subsys() is possible to fail but its return value is ignored. If IPv6 initialization fails later and xfrm6_fini() is called, removing uninitialized list in xfrm6_net_ops will cause null-ptr-deref: KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 1 PID: 330 Comm: insmod RIP: 0010:unregister_pernet_operations+0xc9/0x450 Call Trace: unregister_pernet_subsys+0x31/0x3e xfrm6_fini+0x16/0x30 [ipv6] ip6_route_init+0xcd/0x128 [ipv6] inet6_init+0x29c/0x602 [ipv6] ... Fix it by catching the error return value of register_pernet_subsys(). Fixes: 8d068875caca ("xfrm: make gc_thresh configurable in all namespaces") Signed-off-by: Chen Zhongjin Reviewed-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit b97df039a68b2f3e848e238df5d5d06343ea497b Author: Thomas Jarosch Date: Wed Nov 2 11:18:48 2022 +0100 xfrm: Fix oops in __xfrm_state_delete() Kernel 5.14 added a new "byseq" index to speed up xfrm_state lookups by sequence number in commit fe9f1d8779cb ("xfrm: add state hashtable keyed by seq") While the patch was thorough, the function pfkey_send_new_mapping() in net/af_key.c also modifies x->km.seq and never added the current xfrm_state to the "byseq" index. This leads to the following kernel Ooops: BUG: kernel NULL pointer dereference, address: 0000000000000000 .. RIP: 0010:__xfrm_state_delete+0xc9/0x1c0 .. Call Trace: xfrm_state_delete+0x1e/0x40 xfrm_del_sa+0xb0/0x110 [xfrm_user] xfrm_user_rcv_msg+0x12d/0x270 [xfrm_user] ? remove_entity_load_avg+0x8a/0xa0 ? copy_to_user_state_extra+0x580/0x580 [xfrm_user] netlink_rcv_skb+0x51/0x100 xfrm_netlink_rcv+0x30/0x50 [xfrm_user] netlink_unicast+0x1a6/0x270 netlink_sendmsg+0x22a/0x480 __sys_sendto+0x1a6/0x1c0 ? __audit_syscall_entry+0xd8/0x130 ? __audit_syscall_exit+0x249/0x2b0 __x64_sys_sendto+0x23/0x30 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x61/0xcb Exact location of the crash in __xfrm_state_delete(): if (x->km.seq) hlist_del_rcu(&x->byseq); The hlist_node "byseq" was never populated. The bug only triggers if a new NAT traversal mapping (changed IP or port) is detected in esp_input_done2() / esp6_input_done2(), which in turn indirectly calls pfkey_send_new_mapping() *if* the kernel is compiled with CONFIG_NET_KEY and "af_key" is active. The PF_KEYv2 message SADB_X_NAT_T_NEW_MAPPING is not part of RFC 2367. Various implementations have been examined how they handle the "sadb_msg_seq" header field: - racoon (Android): does not process SADB_X_NAT_T_NEW_MAPPING - strongswan: does not care about sadb_msg_seq - openswan: does not care about sadb_msg_seq There is no standard how PF_KEYv2 sadb_msg_seq should be populated for SADB_X_NAT_T_NEW_MAPPING and it's not used in popular implementations either. Herbert Xu suggested we should just use the current km.seq value as is. This fixes the root cause of the oops since we no longer modify km.seq itself. The update of "km.seq" looks like a copy'n'paste error from pfkey_send_acquire(). SADB_ACQUIRE must indeed assign a unique km.seq number according to RFC 2367. It has been verified that code paths involving pfkey_send_acquire() don't cause the same Oops. PF_KEYv2 SADB_X_NAT_T_NEW_MAPPING support was originally added here: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git commit cbc3488685b20e7b2a98ad387a1a816aada569d8 Author: Derek Atkins AuthorDate: Wed Apr 2 13:21:02 2003 -0800 [IPSEC]: Implement UDP Encapsulation framework. In particular, implement ESPinUDP encapsulation for IPsec Nat Traversal. A note on triggering the bug: I was not able to trigger it using VMs. There is one VPN using a high latency link on our production VPN server that triggered it like once a day though. Link: https://github.com/strongswan/strongswan/issues/992 Link: https://lore.kernel.org/netdev/00959f33ee52c4b3b0084d42c430418e502db554.1652340703.git.antony.antony@secunet.com/T/ Link: https://lore.kernel.org/netdev/20221027142455.3975224-1-chenzhihao@meizu.com/T/ Fixes: fe9f1d8779cb ("xfrm: add state hashtable keyed by seq") Reported-by: Roth Mark Reported-by: Zhihao Chen Tested-by: Roth Mark Signed-off-by: Thomas Jarosch Acked-by: Antony Antony Acked-by: Herbert Xu Signed-off-by: Steffen Klassert commit 4e45886956a20942800259f326a04417292ae314 Author: Zhang Xiaoxu Date: Sun Nov 20 18:57:59 2022 +0800 zonefs: Fix race between modprobe and mount There is a race between modprobe and mount as below: modprobe zonefs | mount -t zonefs --------------------------------|------------------------- zonefs_init | register_filesystem [1] | | zonefs_fill_super [2] zonefs_sysfs_init [3] | 1. register zonefs suceess, then 2. user can mount the zonefs 3. if sysfs initialize failed, the module initialize failed. Then the mount process maybe some error happened since the module initialize failed. Let's register zonefs after all dependency resource ready. And reorder the dependency resource release in module exit. Fixes: 9277a6d4fbd4 ("zonefs: Export open zone resource information through sysfs") Signed-off-by: Zhang Xiaoxu Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni Signed-off-by: Damien Le Moal commit 30f158740984f9949765f6112456d62d2ca6deba Author: Jacob Keller Date: Fri Nov 18 14:27:29 2022 -0800 ice: fix handling of burst Tx timestamps Commit 1229b33973c7 ("ice: Add low latency Tx timestamp read") refactored PTP timestamping logic to use a threaded IRQ instead of a separate kthread. This implementation introduced ice_misc_intr_thread_fn and redefined the ice_ptp_process_ts function interface to return a value of whether or not the timestamp processing was complete. ice_misc_intr_thread_fn would take the return value from ice_ptp_process_ts and convert it into either IRQ_HANDLED if there were no more timestamps to be processed, or IRQ_WAKE_THREAD if the thread should continue processing. This is not correct, as the kernel does not re-schedule threaded IRQ functions automatically. IRQ_WAKE_THREAD can only be used by the main IRQ function. This results in the ice_ptp_process_ts function (and in turn the ice_ptp_tx_tstamp function) from only being called exactly once per interrupt. If an application sends a burst of Tx timestamps without waiting for a response, the interrupt will trigger for the first timestamp. However, later timestamps may not have arrived yet. This can result in dropped or discarded timestamps. Worse, on E822 hardware this results in the interrupt logic getting stuck such that no future interrupts will be triggered. The result is complete loss of Tx timestamp functionality. Fix this by modifying the ice_misc_intr_thread_fn to perform its own polling of the ice_ptp_process_ts function. We sleep for a few microseconds between attempts to avoid wasting significant CPU time. The value was chosen to allow time for the Tx timestamps to complete without wasting so much time that we overrun application wait budgets in the worst case. The ice_ptp_process_ts function also currently returns false in the event that the Tx tracker is not initialized. This would result in the threaded IRQ handler never exiting if it gets started while the tracker is not initialized. Fix the function to appropriately return true when the tracker is not initialized. Note that this will not reproduce with default ptp4l behavior, as the program always synchronously waits for a timestamp response before sending another timestamp request. Reported-by: Siddaraju DH Fixes: 1229b33973c7 ("ice: Add low latency Tx timestamp read") Signed-off-by: Jacob Keller Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20221118222729.1565317-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit cd0f6421162201e4b22ce757a1966729323185eb Author: YueHaibing Date: Sat Nov 19 15:28:32 2022 +0800 tipc: check skb_linearize() return value in tipc_disc_rcv() If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of handle it. Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values") Signed-off-by: YueHaibing Acked-by: Jon Maloy Link: https://lore.kernel.org/r/20221119072832.7896-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 5916380c313fe3e8603e7aae81ed358048c99ed9 Merge: 3349c272de07c a8417330f8a57 Author: Jakub Kicinski Date: Mon Nov 21 20:50:12 2022 -0800 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-11-18 (iavf) Ivan Vecera resolves issues related to reset by adding back call to netif_tx_stop_all_queues() and adding calls to dev_close() to ensure device is properly closed during reset. Stefan Assmann removes waiting for setting of MAC address as this breaks ARP. Slawomir adds setting of __IAVF_IN_REMOVE_TASK bit to prevent deadlock between remove and shutdown. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: Fix race condition between iavf_shutdown and iavf_remove iavf: remove INITIAL_MAC_SET to allow gARP to work properly iavf: Do not restart Tx queues after reset task failure iavf: Fix a crash during reset task ==================== Link: https://lore.kernel.org/r/20221118222439.1565245-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 3349c272de07c75ebe0e6362b58db2d4502e75d2 Merge: 1f0dd412e34e1 a7b42969d63f4 Author: Jakub Kicinski Date: Mon Nov 21 20:45:28 2022 -0800 Merge branch 'tipc-fix-two-race-issues-in-tipc_conn_alloc' Xin Long says: ==================== tipc: fix two race issues in tipc_conn_alloc The race exists beteen tipc_topsrv_accept() and tipc_conn_close(), one is allocating the con while the other is freeing it and there is no proper lock protecting it. Therefore, a null-pointer-defer and a use-after-free may be triggered, see details on each patch. ==================== Link: https://lore.kernel.org/r/cover.1668807842.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit a7b42969d63f47320853a802efd879fbdc4e010e Author: Xin Long Date: Fri Nov 18 16:45:01 2022 -0500 tipc: add an extra conn_get in tipc_conn_alloc One extra conn_get() is needed in tipc_conn_alloc(), as after tipc_conn_alloc() is called, tipc_conn_close() may free this con before deferencing it in tipc_topsrv_accept(): tipc_conn_alloc(); newsk = newsock->sk; <---- tipc_conn_close(); write_lock_bh(&sk->sk_callback_lock); newsk->sk_data_ready = tipc_conn_data_ready; Then an uaf issue can be triggered: BUG: KASAN: use-after-free in tipc_topsrv_accept+0x1e7/0x370 [tipc] Call Trace: dump_stack_lvl+0x33/0x46 print_report+0x178/0x4b0 kasan_report+0x8c/0x100 kasan_check_range+0x179/0x1e0 tipc_topsrv_accept+0x1e7/0x370 [tipc] process_one_work+0x6a3/0x1030 worker_thread+0x8a/0xdf0 This patch fixes it by holding it in tipc_conn_alloc(), then after all accessing in tipc_topsrv_accept() releasing it. Note when does this in tipc_topsrv_kern_subscr(), as tipc_conn_rcv_sub() returns 0 or -1 only, we don't need to check for "> 0". Fixes: c5fa7b3cf3cb ("tipc: introduce new TIPC server infrastructure") Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: Jakub Kicinski commit 0e5d56c64afcd6fd2d132ea972605b66f8a7d3c4 Author: Xin Long Date: Fri Nov 18 16:45:00 2022 -0500 tipc: set con sock in tipc_conn_alloc A crash was reported by Wei Chen: BUG: kernel NULL pointer dereference, address: 0000000000000018 RIP: 0010:tipc_conn_close+0x12/0x100 Call Trace: tipc_topsrv_exit_net+0x139/0x320 ops_exit_list.isra.9+0x49/0x80 cleanup_net+0x31a/0x540 process_one_work+0x3fa/0x9f0 worker_thread+0x42/0x5c0 It was caused by !con->sock in tipc_conn_close(). In tipc_topsrv_accept(), con is allocated in conn_idr then its sock is set: con = tipc_conn_alloc(); ... <----[1] con->sock = newsock; If tipc_conn_close() is called in anytime of [1], the null-pointer-def is triggered by con->sock->sk due to con->sock is not yet set. This patch fixes it by moving the con->sock setting to tipc_conn_alloc() under s->idr_lock. So that con->sock can never be NULL when getting the con from s->conn_idr. It will be also safer to move con->server and flag CF_CONNECTED setting under s->idr_lock, as they should all be set before tipc_conn_alloc() is called. Fixes: c5fa7b3cf3cb ("tipc: introduce new TIPC server infrastructure") Reported-by: Wei Chen Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: Jakub Kicinski commit 1f0dd412e34e177621769866bef347f0b22364df Author: Wei Yongjun Date: Fri Nov 18 10:36:35 2022 +0000 net: phy: at803x: fix error return code in at803x_probe() Fix to return a negative error code from the ccr read error handling case instead of 0, as done elsewhere in this function. Fixes: 3265f4218878 ("net: phy: at803x: add fiber support") Signed-off-by: Wei Yongjun Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221118103635.254256-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit 8514e325ef016e3fdabaa015ed1adaa6e6d8722a Author: Emeel Hakim Date: Sun Oct 30 11:19:52 2022 +0200 net/mlx5e: Fix possible race condition in macsec extended packet number update routine Currenty extended packet number (EPN) update routine is accessing macsec object without holding the general macsec lock hence facing a possible race condition when an EPN update occurs while updating or deleting the SA. Fix by holding the general macsec lock before accessing the object. Fixes: 4411a6c0abd3 ("net/mlx5e: Support MACsec offload extended packet number (EPN)") Signed-off-by: Emeel Hakim Signed-off-by: Saeed Mahameed commit 94ffd6e0c7dbcffbcded79e283aefbee3499af96 Author: Emeel Hakim Date: Sun Oct 30 11:52:42 2022 +0200 net/mlx5e: Fix MACsec update SecY Currently updating SecY destroys and re-creates RX SA objects, the re-created RX SA objects are not identical to the destroyed objects and it disagree on the encryption enabled property which holds the value false after recreation, this value is not supported with offload which leads to no traffic after an update. Fix by recreating an identical objects. Fixes: 5a39816a75e5 ("net/mlx5e: Add MACsec offload SecY support") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit d20a56b0eb006096a023a59efccb27a277b38344 Author: Emeel Hakim Date: Sun Oct 30 11:43:24 2022 +0200 net/mlx5e: Fix MACsec SA initialization routine Currently as part of MACsec SA initialization routine extended packet number (EPN) object attribute is always being set without checking if EPN is actually enabled, the above could lead to a NULL dereference. Fix by adding such a check. Fixes: 4411a6c0abd3 ("net/mlx5e: Support MACsec offload extended packet number (EPN)") Signed-off-by: Emeel Hakim Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed commit 11abca031ee34d8d50876e899cb2875d8fac01df Author: Tariq Toukan Date: Mon Nov 14 11:56:11 2022 +0200 net/mlx5e: Remove leftovers from old XSK queues enumeration Before the cited commit, for N channels, a dedicated set of N queues was created to support XSK, in indices [N, 2N-1], doubling the number of queues. In addition, changing the number of channels was prohibited, as it would shift the indices. Remove these two leftovers, as we moved XSK to a new queueing scheme, starting from index 0. Fixes: 3db4c85cde7a ("net/mlx5e: xsk: Use queue indices starting from 0 for XSK queues") Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit f377422044b2093c835e5f3717f8c8c58da1db1f Author: Chris Mi Date: Thu Nov 17 07:45:45 2022 +0200 net/mlx5e: Offload rule only when all encaps are valid The cited commit adds a for loop to support multiple encapsulations. But it only checks if the last encap is valid. Fix it by setting slow path flag when one of the encap is invalid. Fixes: f493f15534ec ("net/mlx5e: Move flow attr reformat action bit to per dest flags") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 3e874cb1e0a376b0e682f82c1612ae89ab7867d7 Author: Tariq Toukan Date: Thu Oct 27 08:29:06 2022 +0300 net/mlx5e: Fix missing alignment in size of MTT/KLM entries In the cited patch, an alignment required by the HW spec was mistakenly dropped. Bring it back to fix error completions like the below: mlx5_core 0000:00:08.0 eth2: Error cqe on cqn 0x40b, ci 0x0, qn 0x104f, opcode 0xd, syndrome 0x2, vendor syndrome 0x68 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000030: 00 00 00 00 86 00 68 02 25 00 10 4f 00 00 bb d2 WQE DUMP: WQ size 1024 WQ cur size 0, WQE index 0x0, len: 192 00000000: 00 00 00 25 00 10 4f 0c 00 00 00 00 00 18 2e 00 00000010: 90 00 00 00 00 02 00 00 00 00 00 00 20 00 00 00 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000080: 08 00 00 00 48 6a 00 02 08 00 00 00 0e 10 00 02 00000090: 08 00 00 00 0c db 00 02 08 00 00 00 0e 82 00 02 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Fixes: 9f123f740428 ("net/mlx5e: Improve MTT/KSM alignment") Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit e1ad07b9227f9cbaf4bd2b6ec00b84c303657593 Author: Moshe Shemesh Date: Sat Oct 29 09:03:48 2022 +0300 net/mlx5: Fix sync reset event handler error flow When sync reset now event handling fails on mlx5_pci_link_toggle() then no reset was done. However, since mlx5_cmd_fast_teardown_hca() was already done, the firmware function is closed and the driver is left without firmware functionality. Fix it by setting device error state and reopen the firmware resources. Reopening is done by the thread that was called for devlink reload fw_activate as it already holds the devlink lock. Fixes: 5ec697446f46 ("net/mlx5: Add support for devlink reload action fw activate") Signed-off-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 6d942e40448931be9371f1ba8cb592778807ce18 Author: Roi Dayan Date: Wed Nov 16 11:10:15 2022 +0200 net/mlx5: E-Switch, Set correctly vport destination The cited commit moved from using reformat_id integer to packet_reformat pointer which introduced the possibility to null pointer dereference. When setting packet reformat flag and pkt_reformat pointer must exists so checking MLX5_ESW_DEST_ENCAP is not enough, we need to make sure the pkt_reformat is valid and check for MLX5_ESW_DEST_ENCAP_VALID. If the dest encap valid flag does not exists then pkt_reformat can be either invalid address or null. Also, to make sure we don't try to access invalid pkt_reformat set it to null when invalidated and invalidate it before calling add flow code as its logically more correct and to be safe. Fixes: 2b688ea5efde ("net/mlx5: Add flow steering actions to fs_cmd shim layer") Signed-off-by: Roi Dayan Reviewed-by: Chris Mi Signed-off-by: Saeed Mahameed commit 0d4e8ed139d871fcb2844dd71075997753baeec8 Author: Eli Cohen Date: Mon Aug 15 11:25:26 2022 +0300 net/mlx5: Lag, avoid lockdep warnings ldev->lock is used to serialize lag change operations. Since multiport eswtich functionality was added, we now change the mode dynamically. However, acquiring ldev->lock is not allowed as it could possibly lead to a deadlock as reported by the lockdep mechanism. [ 836.154963] WARNING: possible circular locking dependency detected [ 836.155850] 5.19.0-rc5_net_56b7df2 #1 Not tainted [ 836.156549] ------------------------------------------------------ [ 836.157418] handler1/12198 is trying to acquire lock: [ 836.158178] ffff888187d52b58 (&ldev->lock){+.+.}-{3:3}, at: mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.159575] [ 836.159575] but task is already holding lock: [ 836.160474] ffff8881d4de2930 (&block->cb_lock){++++}-{3:3}, at: tc_setup_cb_add+0x5b/0x200 [ 836.161669] which lock already depends on the new lock. [ 836.162905] [ 836.162905] the existing dependency chain (in reverse order) is: [ 836.164008] -> #3 (&block->cb_lock){++++}-{3:3}: [ 836.164946] down_write+0x25/0x60 [ 836.165548] tcf_block_get_ext+0x1c6/0x5d0 [ 836.166253] ingress_init+0x74/0xa0 [sch_ingress] [ 836.167028] qdisc_create.constprop.0+0x130/0x5e0 [ 836.167805] tc_modify_qdisc+0x481/0x9f0 [ 836.168490] rtnetlink_rcv_msg+0x16e/0x5a0 [ 836.169189] netlink_rcv_skb+0x4e/0xf0 [ 836.169861] netlink_unicast+0x190/0x250 [ 836.170543] netlink_sendmsg+0x243/0x4b0 [ 836.171226] sock_sendmsg+0x33/0x40 [ 836.171860] ____sys_sendmsg+0x1d1/0x1f0 [ 836.172535] ___sys_sendmsg+0xab/0xf0 [ 836.173183] __sys_sendmsg+0x51/0x90 [ 836.173836] do_syscall_64+0x3d/0x90 [ 836.174471] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 836.175282] [ 836.175282] -> #2 (rtnl_mutex){+.+.}-{3:3}: [ 836.176190] __mutex_lock+0x6b/0xf80 [ 836.176830] register_netdevice_notifier+0x21/0x120 [ 836.177631] rtnetlink_init+0x2d/0x1e9 [ 836.178289] netlink_proto_init+0x163/0x179 [ 836.178994] do_one_initcall+0x63/0x300 [ 836.179672] kernel_init_freeable+0x2cb/0x31b [ 836.180403] kernel_init+0x17/0x140 [ 836.181035] ret_from_fork+0x1f/0x30 [ 836.181687] -> #1 (pernet_ops_rwsem){+.+.}-{3:3}: [ 836.182628] down_write+0x25/0x60 [ 836.183235] unregister_netdevice_notifier+0x1c/0xb0 [ 836.184029] mlx5_ib_roce_cleanup+0x94/0x120 [mlx5_ib] [ 836.184855] __mlx5_ib_remove+0x35/0x60 [mlx5_ib] [ 836.185637] mlx5_eswitch_unregister_vport_reps+0x22f/0x440 [mlx5_core] [ 836.186698] auxiliary_bus_remove+0x18/0x30 [ 836.187409] device_release_driver_internal+0x1f6/0x270 [ 836.188253] bus_remove_device+0xef/0x160 [ 836.188939] device_del+0x18b/0x3f0 [ 836.189562] mlx5_rescan_drivers_locked+0xd6/0x2d0 [mlx5_core] [ 836.190516] mlx5_lag_remove_devices+0x69/0xe0 [mlx5_core] [ 836.191414] mlx5_do_bond_work+0x441/0x620 [mlx5_core] [ 836.192278] process_one_work+0x25c/0x590 [ 836.192963] worker_thread+0x4f/0x3d0 [ 836.193609] kthread+0xcb/0xf0 [ 836.194189] ret_from_fork+0x1f/0x30 [ 836.194826] -> #0 (&ldev->lock){+.+.}-{3:3}: [ 836.195734] __lock_acquire+0x15b8/0x2a10 [ 836.196426] lock_acquire+0xce/0x2d0 [ 836.197057] __mutex_lock+0x6b/0xf80 [ 836.197708] mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.198575] tc_act_parse_mirred+0x25b/0x800 [mlx5_core] [ 836.199467] parse_tc_actions+0x168/0x5a0 [mlx5_core] [ 836.200340] __mlx5e_add_fdb_flow+0x263/0x480 [mlx5_core] [ 836.201241] mlx5e_configure_flower+0x8a0/0x1820 [mlx5_core] [ 836.202187] tc_setup_cb_add+0xd7/0x200 [ 836.202856] fl_hw_replace_filter+0x14c/0x1f0 [cls_flower] [ 836.203739] fl_change+0xbbe/0x1730 [cls_flower] [ 836.204501] tc_new_tfilter+0x407/0xd90 [ 836.205168] rtnetlink_rcv_msg+0x406/0x5a0 [ 836.205877] netlink_rcv_skb+0x4e/0xf0 [ 836.206535] netlink_unicast+0x190/0x250 [ 836.207217] netlink_sendmsg+0x243/0x4b0 [ 836.207915] sock_sendmsg+0x33/0x40 [ 836.208538] ____sys_sendmsg+0x1d1/0x1f0 [ 836.209219] ___sys_sendmsg+0xab/0xf0 [ 836.209878] __sys_sendmsg+0x51/0x90 [ 836.210510] do_syscall_64+0x3d/0x90 [ 836.211137] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 836.211954] other info that might help us debug this: [ 836.213174] Chain exists of: [ 836.213174] &ldev->lock --> rtnl_mutex --> &block->cb_lock 836.214650] Possible unsafe locking scenario: [ 836.214650] [ 836.215574] CPU0 CPU1 [ 836.216255] ---- ---- [ 836.216943] lock(&block->cb_lock); [ 836.217518] lock(rtnl_mutex); [ 836.218348] lock(&block->cb_lock); [ 836.219212] lock(&ldev->lock); [ 836.219758] [ 836.219758] *** DEADLOCK *** [ 836.219758] [ 836.220747] 2 locks held by handler1/12198: [ 836.221390] #0: ffff8881d4de2930 (&block->cb_lock){++++}-{3:3}, at: tc_setup_cb_add+0x5b/0x200 [ 836.222646] #1: ffff88810c9a92c0 (&esw->mode_lock){++++}-{3:3}, at: mlx5_esw_hold+0x39/0x50 [mlx5_core] [ 836.224063] stack backtrace: [ 836.224799] CPU: 6 PID: 12198 Comm: handler1 Not tainted 5.19.0-rc5_net_56b7df2 #1 [ 836.225923] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 836.227476] Call Trace: [ 836.227929] [ 836.228332] dump_stack_lvl+0x57/0x7d [ 836.228924] check_noncircular+0x104/0x120 [ 836.229562] __lock_acquire+0x15b8/0x2a10 [ 836.230201] lock_acquire+0xce/0x2d0 [ 836.230776] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.231614] ? find_held_lock+0x2b/0x80 [ 836.232221] __mutex_lock+0x6b/0xf80 [ 836.232799] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.233636] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.234451] ? xa_load+0xc3/0x190 [ 836.234995] mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.235803] tc_act_parse_mirred+0x25b/0x800 [mlx5_core] [ 836.236636] ? tc_act_can_offload_mirred+0x135/0x210 [mlx5_core] [ 836.237550] parse_tc_actions+0x168/0x5a0 [mlx5_core] [ 836.238364] __mlx5e_add_fdb_flow+0x263/0x480 [mlx5_core] [ 836.239202] mlx5e_configure_flower+0x8a0/0x1820 [mlx5_core] [ 836.240076] ? lock_acquire+0xce/0x2d0 [ 836.240668] ? tc_setup_cb_add+0x5b/0x200 [ 836.241294] tc_setup_cb_add+0xd7/0x200 [ 836.241917] fl_hw_replace_filter+0x14c/0x1f0 [cls_flower] [ 836.242709] fl_change+0xbbe/0x1730 [cls_flower] [ 836.243408] tc_new_tfilter+0x407/0xd90 [ 836.244043] ? tc_del_tfilter+0x880/0x880 [ 836.244672] rtnetlink_rcv_msg+0x406/0x5a0 [ 836.245310] ? netlink_deliver_tap+0x7a/0x4b0 [ 836.245991] ? if_nlmsg_stats_size+0x2b0/0x2b0 [ 836.246675] netlink_rcv_skb+0x4e/0xf0 [ 836.258046] netlink_unicast+0x190/0x250 [ 836.258669] netlink_sendmsg+0x243/0x4b0 [ 836.259288] sock_sendmsg+0x33/0x40 [ 836.259857] ____sys_sendmsg+0x1d1/0x1f0 [ 836.260473] ___sys_sendmsg+0xab/0xf0 [ 836.261064] ? lock_acquire+0xce/0x2d0 [ 836.261669] ? find_held_lock+0x2b/0x80 [ 836.262272] ? __fget_files+0xb9/0x190 [ 836.262871] ? __fget_files+0xd3/0x190 [ 836.263462] __sys_sendmsg+0x51/0x90 [ 836.264064] do_syscall_64+0x3d/0x90 [ 836.264652] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 836.265425] RIP: 0033:0x7fdbe5e2677d [ 836.266012] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ba ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89 c7 48 89 44 24 08 e8 ee ee ff ff 48 [ 836.268485] RSP: 002b:00007fdbe48a75a0 EFLAGS: 00000293 ORIG_RAX: 000000000000002e [ 836.269598] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fdbe5e2677d [ 836.270576] RDX: 0000000000000000 RSI: 00007fdbe48a7640 RDI: 000000000000003c [ 836.271565] RBP: 00007fdbe48a8368 R08: 0000000000000000 R09: 0000000000000000 [ 836.272546] R10: 00007fdbe48a84b0 R11: 0000000000000293 R12: 0000557bd17dc860 [ 836.273527] R13: 0000000000000000 R14: 0000557bd17dc860 R15: 00007fdbe48a7640 [ 836.274521] To avoid using mode holding ldev->lock in the configure flow, we queue a work to the lag workqueue and cease wait on a completion object. In addition, we remove the lock from mlx5_lag_do_mirred() since it is not really protecting anything. It should be noted that an actual deadlock has not been observed. Signed-off-by: Eli Cohen Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit aaf2e65cac7f2e1ae729c2fbc849091df9699f96 Author: Moshe Shemesh Date: Thu Nov 17 09:07:20 2022 +0200 net/mlx5: Fix handling of entry refcount when command is not issued to FW In case command interface is down, or the command is not allowed, driver did not increment the entry refcount, but might have decrement as part of forced completion handling. Fix that by always increment and decrement the refcount to make it symmetric for all flows. Fixes: 50b2412b7e78 ("net/mlx5: Avoid possible free of command entry while timeout comp handler") Signed-off-by: Eran Ben Elisha Signed-off-by: Moshe Shemesh Reported-by: Jack Wang Tested-by: Jack Wang Signed-off-by: Saeed Mahameed commit 870c2481174b839e7159555127bc8b5a5d0699ba Author: Moshe Shemesh Date: Tue May 31 09:14:03 2022 +0300 net/mlx5: cmdif, Print info on any firmware cmd failure to tracepoint While moving to new CMD API (quiet API), some pre-existing flows may call the new API function that in case of error, returns the error instead of printing it as previously done. For such flows we bring back the print but to tracepoint this time for sys admins to have the ability to check for errors especially for commands using the new quiet API. Tracepoint output example: devlink-1333 [001] ..... 822.746922: mlx5_cmd: ACCESS_REG(0x805) op_mod(0x0) failed, status bad resource(0x5), syndrome (0xb06e1f), err(-22) Fixes: f23519e542e5 ("net/mlx5: cmdif, Add new api for command execution") Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 4f57332d6a551185ba729617f04455e83fbe4e41 Author: Shay Drory Date: Thu Aug 4 12:38:41 2022 +0300 net/mlx5: SF: Fix probing active SFs during driver probe phase When SF devices and SF port representors are located on different functions, unloading and reloading of SF parent driver doesn't recreate the existing SF present in the device. Fix it by querying SFs and probe active SFs during driver probe phase. Fixes: 90d010b8634b ("net/mlx5: SF, Add auxiliary device support") Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 61db3d7b99a367416e489ccf764cc5f9b00d62a1 Author: Moshe Shemesh Date: Thu Oct 20 12:25:59 2022 +0300 net/mlx5: Fix FW tracer timestamp calculation Fix a bug in calculation of FW tracer timestamp. Decreasing one in the calculation should effect only bits 52_7 and not effect bits 6_0 of the timestamp, otherwise bits 6_0 are always set in this calculation. Fixes: 70dd6fdb8987 ("net/mlx5: FW tracer, parse traces and kernel tracing support") Signed-off-by: Moshe Shemesh Reviewed-by: Feras Daoud Signed-off-by: Saeed Mahameed commit 394164f9d5a3020a7fd719d228386d48d544ec67 Author: Roy Novich Date: Sun Jul 24 09:49:07 2022 +0300 net/mlx5: Do not query pci info while pci disabled The driver should not interact with PCI while PCI is disabled. Trying to do so may result in being unable to get vital signs during PCI reset, driver gets timed out and fails to recover. Fixes: fad1783a6d66 ("net/mlx5: Print more info on pci error handlers") Signed-off-by: Roy Novich Reviewed-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 472faf72b33d80aa8e7a99c9410c1a23d3bf0cd8 Author: Dan Williams Date: Sat Nov 19 17:37:49 2022 -0800 device-dax: Fix duplicate 'hmem' device registration So called "soft-reserved" memory is an EFI conventional memory range with the EFI_MEMORY_SP attribute set. That attribute indicates that the memory is not part of the platform general purpose memory pool and may want some consideration from the system administrator about whether to keep that memory set aside for dedicated access through device-dax (map a device file), or assigned to the page allocator as another general purpose memory node target. Absent an ACPI HMAT table the default device-dax registration creates coarse grained devices that are delineated by EFI Memory Map entries. With the HMAT the devices are delineated by the finer grained ranges associated with the proximity domain of the memory target. I.e. the HMAT describes the properties of performance differentiated memory and each unique performance description results in a unique target proximity domain where each memory proximity domain has an associated SRAT entry that delineates the address range. The intent was that SRAT-defined device-dax instances are registered first. Then any left-over address range with the EFI_MEMORY_SP attribute, but not covered by the SRAT, would have a coarse grained device-dax instance established. However, the scheme to detect what ranges are left to be assigned to a device was buggy and resulted in multiple overlapping device-dax instances. Fix this by using explicit tracking for which ranges have been handled. Now, this new approach may leave memory stranded in the presence of broken platform firmware that fails to fully describe all EFI_MEMORY_SP ranges in the HMAT. That requires a deeper fix if it becomes a problem in practice. Reported-by: "Tallam Mahendra Kumar" Reported-by: Mustafa Hajeer Debugged-by: Vishal Verma Tested-by: Vishal Verma Link: https://lore.kernel.org/r/166890823379.4183293.15333502171004313377.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 91abf28a636291135ea5cab9af40f017cff6afce Author: Jack Xiao Date: Wed Nov 16 16:44:21 2022 +0800 drm/amd/amdgpu: reserve vm invalidation engine for firmware If mes enabled, reserve VM invalidation engine 5 for firmware. Signed-off-by: Jack Xiao Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit b9ab82da8804ec22c7e91ffd9d56c7a3abff0c8e Author: Ramesh Errabolu Date: Wed Nov 16 10:46:08 2022 -0600 drm/amdgpu: Enable Aldebaran devices to report CU Occupancy Allow user to know number of compute units (CU) that are in use at any given moment. Enable access to the method kgd_gfx_v9_get_cu_occupancy that computes CU occupancy. Signed-off-by: Ramesh Errabolu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 4458da0bb09d4435956b4377685e8836935e9b9d Author: Christian König Date: Thu Nov 10 12:31:41 2022 +0100 drm/amdgpu: fix userptr HMM range handling v2 The basic problem here is that it's not allowed to page fault while holding the reservation lock. So it can happen that multiple processes try to validate an userptr at the same time. Work around that by putting the HMM range object into the mutex protected bo list for now. v2: make sure range is set to NULL in case of an error Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling CC: stable@vger.kernel.org Signed-off-by: Alex Deucher commit b39df63b16b64a3af42695acb9bc567aad144776 Author: Christian König Date: Wed Nov 9 12:14:44 2022 +0100 drm/amdgpu: always register an MMU notifier for userptr Since switching to HMM we always need that because we no longer grab references to the pages. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Felix Kuehling CC: stable@vger.kernel.org Signed-off-by: Alex Deucher commit 85ef1679a190a9740f6b72217cb139a0d9c58706 Author: Lyude Paul Date: Fri Nov 18 14:54:05 2022 -0500 drm/amdgpu/dm/mst: Fix uninitialized var in pre_compute_mst_dsc_configs_for_state() Coverity noticed this one, so let's fix it. Fixes: ba891436c2d2b2 ("drm/amdgpu/mst: Stop ignoring error codes and deadlocking") Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher Reviewed-by: Harry Wentland Cc: stable@vger.kernel.org # v5.6+ commit d60b82aa4d67b2e6cf0364947a008bb7255ca4da Author: Lyude Paul Date: Mon Nov 14 17:17:55 2022 -0500 drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state Now that we've fixed the issue with using the incorrect topology manager, we're actually grabbing the topology manager's lock - and consequently deadlocking. Luckily for us though, there's actually nothing in AMD's DSC state computation code that really should need this lock. The one exception is the mutex_lock() in dm_dp_mst_is_port_support_mode(), however we grab no locks beneath &mgr->lock there so that should be fine to leave be. Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Signed-off-by: Lyude Paul Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share") Cc: # v5.6+ Reviewed-by: Wayne Lin Signed-off-by: Alex Deucher commit dfbc00410c48a9896d4a65600be7137202517780 Author: Lyude Paul Date: Mon Nov 14 17:17:54 2022 -0500 drm/amdgpu/dm/mst: Use the correct topology mgr pointer in amdgpu_dm_connector This bug hurt me. Basically, it appears that we've been grabbing the entirely wrong mutex in the MST DSC computation code for amdgpu! While we've been grabbing: amdgpu_dm_connector->mst_mgr That's zero-initialized memory, because the only connectors we'll ever actually be doing DSC computations for are MST ports. Which have mst_mgr zero-initialized, and instead have the correct topology mgr pointer located at: amdgpu_dm_connector->mst_port->mgr; I'm a bit impressed that until now, this code has managed not to crash anyone's systems! It does seem to cause a warning in LOCKDEP though: [ 66.637670] DEBUG_LOCKS_WARN_ON(lock->magic != lock) This was causing the problems that appeared to have been introduced by: commit 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state") This wasn't actually where they came from though. Presumably, before the only thing we were doing with the topology mgr pointer was attempting to grab mst_mgr->lock. Since the above commit however, we grab much more information from mst_mgr including the atomic MST state and respective modesetting locks. This patch also implies that up until now, it's quite likely we could be susceptible to race conditions when going through the MST topology state for DSC computations since we technically will not have grabbed any lock when going through it. So, let's fix this by adjusting all the respective code paths to look at the right pointer and skip things that aren't actual MST connectors from a topology. Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Signed-off-by: Lyude Paul Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share") Cc: # v5.6+ Reviewed-by: Wayne Lin Signed-off-by: Alex Deucher commit 2f3a1273862cb82cca227630cc7f04ce0c94b6bb Author: Lyude Paul Date: Mon Nov 14 17:17:53 2022 -0500 drm/display/dp_mst: Fix drm_dp_mst_add_affected_dsc_crtcs() return code Looks like that we're accidentally dropping a pretty important return code here. For some reason, we just return -EINVAL if we fail to get the MST topology state. This is wrong: error codes are important and should never be squashed without being handled, which here seems to have the potential to cause a deadlock. Signed-off-by: Lyude Paul Reviewed-by: Wayne Lin Fixes: 8ec046716ca8 ("drm/dp_mst: Add helper to trigger modeset on affected DSC MST CRTCs") Cc: # v5.6+ Signed-off-by: Alex Deucher commit ba891436c2d2b2a6d6c1bc3733bab3b72f07e87f Author: Lyude Paul Date: Mon Nov 14 17:17:52 2022 -0500 drm/amdgpu/mst: Stop ignoring error codes and deadlocking It appears that amdgpu makes the mistake of completely ignoring the return values from the DP MST helpers, and instead just returns a simple true/false. In this case, it seems to have come back to bite us because as a result of simply returning false from compute_mst_dsc_configs_for_state(), amdgpu had no way of telling when a deadlock happened from these helpers. This could definitely result in some kernel splats. V2: * Address Wayne's comments (fix another bunch of spots where we weren't passing down return codes) Signed-off-by: Lyude Paul Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share") Cc: Harry Wentland Cc: # v5.6+ Reviewed-by: Wayne Lin Signed-off-by: Alex Deucher commit 3ca682389435681e2d660428be2187fbae0effbb Author: Roman Li Date: Mon Nov 14 15:50:27 2022 -0500 drm/amd/display: Align dcn314_smu logging with other DCNs [Why] Assert on non-OK response from SMU is unnecessary. It was replaced with respective log message on other asics in the past with commit: "drm/amd/display: Removing assert statements for Linux" [How] Remove assert and add dbg logging as on other DCNs. Signed-off-by: Roman Li Reviewed-by: Saaem Rizvi Signed-off-by: Alex Deucher commit ec61b41918587be530398b0d1c9a0d16619397e5 Author: ZhangPeng Date: Wed Nov 16 07:14:28 2022 +0000 HID: core: fix shift-out-of-bounds in hid_report_raw_event Syzbot reported shift-out-of-bounds in hid_report_raw_event. microsoft 0003:045E:07DA.0001: hid_field_extract() called with n (128) > 32! (swapper/0) ====================================================================== UBSAN: shift-out-of-bounds in drivers/hid/hid-core.c:1323:20 shift exponent 127 is too large for 32-bit type 'int' CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.0-rc4-syzkaller-00159-g4bbf3422df78 #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 ubsan_epilogue lib/ubsan.c:151 [inline] __ubsan_handle_shift_out_of_bounds+0x3a6/0x420 lib/ubsan.c:322 snto32 drivers/hid/hid-core.c:1323 [inline] hid_input_fetch_field drivers/hid/hid-core.c:1572 [inline] hid_process_report drivers/hid/hid-core.c:1665 [inline] hid_report_raw_event+0xd56/0x18b0 drivers/hid/hid-core.c:1998 hid_input_report+0x408/0x4f0 drivers/hid/hid-core.c:2066 hid_irq_in+0x459/0x690 drivers/hid/usbhid/hid-core.c:284 __usb_hcd_giveback_urb+0x369/0x530 drivers/usb/core/hcd.c:1671 dummy_timer+0x86b/0x3110 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x76a/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x277/0x75b kernel/softirq.c:571 __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1107 ====================================================================== If the size of the integer (unsigned n) is bigger than 32 in snto32(), shift exponent will be too large for 32-bit type 'int', resulting in a shift-out-of-bounds bug. Fix this by adding a check on the size of the integer (unsigned n) in snto32(). To add support for n greater than 32 bits, set n to 32, if n is greater than 32. Reported-by: syzbot+8b1641d2f14732407e23@syzkaller.appspotmail.com Fixes: dde5845a529f ("[PATCH] Generic HID layer - code split") Signed-off-by: ZhangPeng Signed-off-by: Jiri Kosina commit a3cab1d2132474969871b5d7f915c5c0167b48b0 Author: Sebastian Falbesoner Date: Mon Nov 21 11:57:21 2022 +0100 mmc: sdhci-esdhc-imx: correct CQHCI exit halt state check With the current logic the "failed to exit halt state" error would be shown even if any other bit than CQHCI_HALT was set in the CQHCI_CTL register, since the right hand side is always true. Fix this by using the correct operator (bit-wise instead of logical AND) to only check for the halt bit flag, which was obviously intended here. Fixes: 85236d2be844 ("mmc: sdhci-esdhc-imx: clear the HALT bit when enable CQE") Signed-off-by: Sebastian Falbesoner Acked-by: Haibo Chen Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221121105721.1903878-1-sebastian.falbesoner@gmail.com Signed-off-by: Ulf Hansson commit 8be602dadb2febb5e4cb367bff1162205bcf9905 Author: Jiri Olsa Date: Wed Nov 16 11:02:28 2022 +0100 selftests/bpf: Make test_bench_attach serial Alexei hit another rcu warnings because of this test. Making test_bench_attach serial so it does not disrupts other tests during parallel tests run. While this change is not the fix, it should be less likely to hit it with this test being executed serially. Reported-by: Alexei Starovoitov Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20221116100228.2064612-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 2b506f20af2b9dcfb3cb2d19e4c804eb20565841 Author: Jiri Olsa Date: Wed Nov 16 11:02:27 2022 +0100 selftests/bpf: Filter out default_idle from kprobe_multi bench Alexei hit following rcu warning when running prog_test -j. [ 128.049567] WARNING: suspicious RCU usage [ 128.049569] 6.1.0-rc2 #912 Tainted: G O ... [ 128.050944] kprobe_multi_link_handler+0x6c/0x1d0 [ 128.050947] ? kprobe_multi_link_handler+0x42/0x1d0 [ 128.050950] ? __cpuidle_text_start+0x8/0x8 [ 128.050952] ? __cpuidle_text_start+0x8/0x8 [ 128.050958] fprobe_handler.part.1+0xac/0x150 [ 128.050964] 0xffffffffa02130c8 [ 128.050991] ? default_idle+0x5/0x20 [ 128.050998] default_idle+0x5/0x20 It's caused by bench test attaching kprobe_multi link to default_idle function, which is not executed in rcu safe context so the kprobe handler on top of it will trigger the rcu warning. Filtering out default_idle function from the bench test. Reported-by: Alexei Starovoitov Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20221116100228.2064612-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 11a695a8c24930525213be87ea2061841ec4062b Merge: 6f04180ca64b6 d59d3b8a3ed1d Author: Alexei Starovoitov Date: Mon Nov 21 11:45:38 2022 -0800 Merge branch 'Bug fix and test case for special map value field ' Xu Kuohai says: ==================== This series is a follow-up to [0]. patch 1 updates sk_storage_map_test to ensure special map value fields are not copied between user and kernel. patch 0 fixes a bug found by the updated test. [0] https://lore.kernel.org/bpf/1ca2e4e8-ed7e-9174-01f6-c14539b8b8b2@huawei.com/ ==================== Signed-off-by: Alexei Starovoitov commit d59d3b8a3ed1d9006c602d991d52b351ed851180 Author: Xu Kuohai Date: Mon Nov 14 08:47:20 2022 -0500 bpf: Set and check spin lock value in sk_storage_map_test Update sk_storage_map_test to make sure kernel does not copy user non-zero value spin lock to kernel, and does not copy kernel spin lock value to user. If user spin lock value is copied to kernel, this test case will make kernel spin on the copied lock, resulting in rcu stall and softlockup. Signed-off-by: Xu Kuohai Link: https://lore.kernel.org/r/20221114134720.1057939-3-xukuohai@huawei.com Signed-off-by: Alexei Starovoitov commit 836e49e103dfeeff670c934b7d563cbd982fce87 Author: Xu Kuohai Date: Mon Nov 14 08:47:19 2022 -0500 bpf: Do not copy spin lock field from user in bpf_selem_alloc bpf_selem_alloc function is used by inode_storage, sk_storage and task_storage maps to set map value, for these map types, there may be a spin lock in the map value, so if we use memcpy to copy the whole map value from user, the spin lock field may be initialized incorrectly. Since the spin lock field is zeroed by kzalloc, call copy_map_value instead of memcpy to skip copying the spin lock field to fix it. Fixes: 6ac99e8f23d4 ("bpf: Introduce bpf sk local storage") Signed-off-by: Xu Kuohai Link: https://lore.kernel.org/r/20221114134720.1057939-2-xukuohai@huawei.com Signed-off-by: Alexei Starovoitov commit 3405a4beaaa852f3ed2a5eb3b5149932d5c3779b Author: José Expósito Date: Thu Nov 10 18:40:56 2022 +0100 HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk Commit f7d8e387d9ae ("HID: uclogic: Switch to Digitizer usage for styluses") changed the usage used in UCLogic from "Pen" to "Digitizer". However, the IS_INPUT_APPLICATION() macro evaluates to false for HID_DG_DIGITIZER causing issues with the XP-Pen Star G640 tablet. Add the HID_QUIRK_HIDINPUT_FORCE quirk to bypass the IS_INPUT_APPLICATION() check. Reported-by: Torge Matthies Reported-by: Alexander Zhang Tested-by: Alexander Zhang Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 502487847743018c93d75b401eac2ea4c4973123 Author: ChenXiaoSong Date: Sat Nov 19 12:51:59 2022 +0800 cifs: fix missing unlock in cifs_file_copychunk_range() xfstests generic/013 and generic/476 reported WARNING as follows: WARNING: lock held when returning to user space! 6.1.0-rc5+ #4 Not tainted ------------------------------------------------ fsstress/504233 is leaving the kernel with locks still held! 2 locks held by fsstress/504233: #0: ffff888054c38850 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: lock_two_nondirectories+0xcf/0xf0 #1: ffff8880b8fec750 (&sb->s_type->i_mutex_key#21/4){+.+.}-{3:3}, at: lock_two_nondirectories+0xb7/0xf0 This will lead to deadlock and hungtask. Fix this by releasing locks when failed to write out on a file range in cifs_file_copychunk_range(). Fixes: 3e3761f1ec7d ("smb3: use filemap_write_and_wait_range instead of filemap_write_and_wait") Cc: stable@vger.kernel.org # 6.0 Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: ChenXiaoSong Signed-off-by: Steve French commit 839a973988a94c15002cbd81536e4af6ced2bd30 Author: Joe Korty Date: Mon Nov 21 14:53:43 2022 +0000 clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error The TVAL register is 32 bit signed. Thus only the lower 31 bits are available to specify when an interrupt is to occur at some time in the near future. Attempting to specify a larger interval with TVAL results in a negative time delta which means the timer fires immediately upon being programmed, rather than firing at that expected future time. The solution is for Linux to declare that TVAL is a 31 bit register rather than give its true size of 32 bits. This prevents Linux from programming TVAL with a too-large value. Note that, prior to 5.16, this little trick was the standard way to handle TVAL in Linux, so there is nothing new happening here on that front. The softlockup detector hides the issue, because it keeps generating short timer deadlines that are within the scope of the broken timer. Disabling it, it starts using NO_HZ with much longer timer deadlines, which turns into an interrupt flood: 11: 1124855130 949168462 758009394 76417474 104782230 30210281 310890 1734323687 GICv2 29 Level arch_timer And "much longer" isn't that long: it takes less than 43s to underflow TVAL at 50MHz (the frequency of the counter on XGene-1). Some comments on the v1 version of this patch by Marc Zyngier: XGene implements CVAL (a 64bit comparator) in terms of TVAL (a countdown register) instead of the other way around. TVAL being a 32bit register, the width of the counter should equally be 32. However, TVAL is a *signed* value, and keeps counting down in the negative range once the timer fires. It means that any TVAL value with bit 31 set will fire immediately, as it cannot be distinguished from an already expired timer. Reducing the timer range back to a paltry 31 bits papers over the issue. Another problem cannot be fixed though, which is that the timer interrupt *must* be handled within the negative countdown period, or the interrupt will be lost (TVAL will rollover to a positive value, indicative of a new timer deadline). Fixes: 012f18850452 ("clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations") Signed-off-by: Joe Korty Signed-off-by: Marc Zyngier Signed-off-by: Thomas Gleixner Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20221024165422.GA51107@zipoli.concurrent-rt.com Link: https://lore.kernel.org/r/20221121145343.896018-1-maz@kernel.org [maz: revamped the commit message] commit abd6e3d6d897df4e2d18effa948ef5e8b5aa8282 Merge: cafd3d346acbb 8950f345a67d8 Author: Arnd Bergmann Date: Mon Nov 21 15:58:38 2022 +0100 Merge tag 'am335x-pcm-953-regulators' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Regulator changes for am335x-pcm-953 This is for deferred probe issue on am335x-pcm-953 sdhci-omap regulator. * tag 'am335x-pcm-953-regulators' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x-pcm-953: Define fixed regulators in root node Link: https://lore.kernel.org/r/pull-1669036672-530717@atomide.com Signed-off-by: Arnd Bergmann commit c7aa1a76d4a0a3c401025b60c401412bbb60f8c6 Author: Vishwanath Pai Date: Wed Sep 28 14:26:50 2022 -0400 netfilter: ipset: regression in ip_set_hash_ip.c This patch introduced a regression: commit 48596a8ddc46 ("netfilter: ipset: Fix adding an IPv4 range containing more than 2^31 addresses") The variable e.ip is passed to adtfn() function which finally adds the ip address to the set. The patch above refactored the for loop and moved e.ip = htonl(ip) to the end of the for loop. What this means is that if the value of "ip" changes between the first assignement of e.ip and the forloop, then e.ip is pointing to a different ip address than "ip". Test case: $ ipset create jdtest_tmp hash:ip family inet hashsize 2048 maxelem 100000 $ ipset add jdtest_tmp 10.0.1.1/31 ipset v6.21.1: Element cannot be added to the set: it's already added The value of ip gets updated inside the "else if (tb[IPSET_ATTR_CIDR])" block but e.ip is still pointing to the old value. Fixes: 48596a8ddc46 ("netfilter: ipset: Fix adding an IPv4 range containing more than 2^31 addresses") Reviewed-by: Joshua Hunt Signed-off-by: Vishwanath Pai Signed-off-by: Pablo Neira Ayuso commit f7e942b5bb35d8e3af54053d19a6bf04143a3955 Author: ChenXiaoSong Date: Wed Nov 16 22:23:54 2022 +0800 btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit() Syzkaller reported BUG as follows: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 Call Trace: dump_stack_lvl+0xcd/0x134 __might_resched.cold+0x222/0x26b kmem_cache_alloc+0x2e7/0x3c0 update_qgroup_limit_item+0xe1/0x390 btrfs_qgroup_inherit+0x147b/0x1ee0 create_subvol+0x4eb/0x1710 btrfs_mksubvol+0xfe5/0x13f0 __btrfs_ioctl_snap_create+0x2b0/0x430 btrfs_ioctl_snap_create_v2+0x25a/0x520 btrfs_ioctl+0x2a1c/0x5ce0 __x64_sys_ioctl+0x193/0x200 do_syscall_64+0x35/0x80 Fix this by calling qgroup_dirty() on @dstqgroup, and update limit item in btrfs_run_qgroups() later outside of the spinlock context. CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Qu Wenruo Signed-off-by: ChenXiaoSong Reviewed-by: David Sterba Signed-off-by: David Sterba commit 64c150339e7f6c5cbbe8c17a56ef2b3902612798 Author: Maxim Korotkov Date: Thu Nov 17 15:30:34 2022 +0300 pinctrl: single: Fix potential division by zero There is a possibility of dividing by zero due to the pcs->bits_per_pin if pcs->fmask() also has a value of zero and called fls from asm-generic/bitops/builtin-fls.h or arch/x86/include/asm/bitops.h. The function pcs_probe() has the branch that assigned to fmask 0 before pcs_allocate_pin_table() was called Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules") Signed-off-by: Maxim Korotkov Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20221117123034.27383-1-korotkov.maxim.s@gmail.com Signed-off-by: Linus Walleij commit a11452a3709e217492798cf3686ac2cc8eb3fb51 Author: Filipe Manana Date: Tue Nov 15 16:29:44 2022 +0000 btrfs: send: avoid unaligned encoded writes when attempting to clone range When trying to see if we can clone a file range, there are cases where we end up sending two write operations in case the inode from the source root has an i_size that is not sector size aligned and the length from the current offset to its i_size is less than the remaining length we are trying to clone. Issuing two write operations when we could instead issue a single write operation is not incorrect. However it is not optimal, specially if the extents are compressed and the flag BTRFS_SEND_FLAG_COMPRESSED was passed to the send ioctl. In that case we can end up sending an encoded write with an offset that is not sector size aligned, which makes the receiver fallback to decompressing the data and writing it using regular buffered IO (so re-compressing the data in case the fs is mounted with compression enabled), because encoded writes fail with -EINVAL when an offset is not sector size aligned. The following example, which triggered a bug in the receiver code for the fallback logic of decompressing + regular buffer IO and is fixed by the patchset referred in a Link at the bottom of this changelog, is an example where we have the non-optimal behaviour due to an unaligned encoded write: $ cat test.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV > /dev/null mount -o compress $DEV $MNT # File foo has a size of 33K, not aligned to the sector size. xfs_io -f -c "pwrite -S 0xab 0 33K" $MNT/foo xfs_io -f -c "pwrite -S 0xcd 0 64K" $MNT/bar # Now clone the first 32K of file bar into foo at offset 0. xfs_io -c "reflink $MNT/bar 0 0 32K" $MNT/foo # Snapshot the default subvolume and create a full send stream (v2). btrfs subvolume snapshot -r $MNT $MNT/snap btrfs send --compressed-data -f /tmp/test.send $MNT/snap echo -e "\nFile bar in the original filesystem:" od -A d -t x1 $MNT/snap/bar umount $MNT mkfs.btrfs -f $DEV > /dev/null mount $DEV $MNT echo -e "\nReceiving stream in a new filesystem..." btrfs receive -f /tmp/test.send $MNT echo -e "\nFile bar in the new filesystem:" od -A d -t x1 $MNT/snap/bar umount $MNT Before this patch, the send stream included one regular write and one encoded write for file 'bar', with the later being not sector size aligned and causing the receiver to fallback to decompression + buffered writes. The output of the btrfs receive command in verbose mode (-vvv): (...) mkfile o258-7-0 rename o258-7-0 -> bar utimes clone bar - source=foo source offset=0 offset=0 length=32768 write bar - offset=32768 length=1024 encoded_write bar - offset=33792, len=4096, unencoded_offset=33792, unencoded_file_len=31744, unencoded_len=65536, compression=1, encryption=0 encoded_write bar - falling back to decompress and write due to errno 22 ("Invalid argument") (...) This patch avoids the regular write followed by an unaligned encoded write so that we end up sending a single encoded write that is aligned. So after this patch the stream content is (output of btrfs receive -vvv): (...) mkfile o258-7-0 rename o258-7-0 -> bar utimes clone bar - source=foo source offset=0 offset=0 length=32768 encoded_write bar - offset=32768, len=4096, unencoded_offset=32768, unencoded_file_len=32768, unencoded_len=65536, compression=1, encryption=0 (...) So we get more optimal behaviour and avoid the silent data loss bug in versions of btrfs-progs affected by the bug referred by the Link tag below (btrfs-progs v5.19, v5.19.1, v6.0 and v6.0.1). Link: https://lore.kernel.org/linux-btrfs/cover.1668529099.git.fdmanana@suse.com/ Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit c51f0e6a1254b3ac2d308e1c6fd8fb936992b455 Author: Christoph Hellwig Date: Tue Nov 15 10:39:44 2022 +0100 btrfs: zoned: fix missing endianness conversion in sb_write_pointer generation is an on-disk __le64 value, so use btrfs_super_generation to convert it to host endian before comparing it. Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 50bcceb7724e471d9b591803889df45dcbb584bc Author: Pawan Gupta Date: Tue Nov 15 11:17:06 2022 -0800 x86/pm: Add enumeration check before spec MSRs save/restore setup pm_save_spec_msr() keeps a list of all the MSRs which _might_ need to be saved and restored at hibernate and resume. However, it has zero awareness of CPU support for these MSRs. It mostly works by unconditionally attempting to manipulate these MSRs and relying on rdmsrl_safe() being able to handle a #GP on CPUs where the support is unavailable. However, it's possible for reads (RDMSR) to be supported for a given MSR while writes (WRMSR) are not. In this case, msr_build_context() sees a successful read (RDMSR) and marks the MSR as valid. Then, later, a write (WRMSR) fails, producing a nasty (but harmless) error message. This causes restore_processor_state() to try and restore it, but writing this MSR is not allowed on the Intel Atom N2600 leading to: unchecked MSR access error: WRMSR to 0x122 (tried to write 0x0000000000000002) \ at rIP: 0xffffffff8b07a574 (native_write_msr+0x4/0x20) Call Trace: restore_processor_state x86_acpi_suspend_lowlevel acpi_suspend_enter suspend_devices_and_enter pm_suspend.cold state_store kernfs_fop_write_iter vfs_write ksys_write do_syscall_64 ? do_syscall_64 ? up_read ? lock_is_held_type ? asm_exc_page_fault ? lockdep_hardirqs_on entry_SYSCALL_64_after_hwframe To fix this, add the corresponding X86_FEATURE bit for each MSR. Avoid trying to manipulate the MSR when the feature bit is clear. This required adding a X86_FEATURE bit for MSRs that do not have one already, but it's a small price to pay. [ bp: Move struct msr_enumeration inside the only function that uses it. ] Fixes: 73924ec4d560 ("x86/pm: Save the MSR validity status at context setup") Reported-by: Hans de Goede Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Acked-by: Rafael J. Wysocki Cc: Link: https://lore.kernel.org/r/c24db75d69df6e66c0465e13676ad3f2837a2ed8.1668539735.git.pawan.kumar.gupta@linux.intel.com commit aaa65d17eec372c6a9756833f3964ba05b05ea14 Author: Pawan Gupta Date: Tue Nov 15 11:17:05 2022 -0800 x86/tsx: Add a feature bit for TSX control MSR support Support for the TSX control MSR is enumerated in MSR_IA32_ARCH_CAPABILITIES. This is different from how other CPU features are enumerated i.e. via CPUID. Currently, a call to tsx_ctrl_is_supported() is required for enumerating the feature. In the absence of a feature bit for TSX control, any code that relies on checking feature bits directly will not work. In preparation for adding a feature bit check in MSR save/restore during suspend/resume, set a new feature bit X86_FEATURE_TSX_CTRL when MSR_IA32_TSX_CTRL is present. Also make tsx_ctrl_is_supported() use the new feature bit to avoid any overhead of reading the MSR. [ bp: Remove tsx_ctrl_is_supported(), add room for two more feature bits in word 11 which are coming up in the next merge window. ] Suggested-by: Andrew Cooper Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov Reviewed-by: Dave Hansen Cc: Link: https://lore.kernel.org/r/de619764e1d98afbb7a5fa58424f1278ede37b45.1668539735.git.pawan.kumar.gupta@linux.intel.com commit badbda1a01860c80c6ab60f329ef46c713653a27 Author: Dan Carpenter Date: Fri Nov 18 18:07:54 2022 +0300 octeontx2-af: cn10k: mcs: Fix copy and paste bug in mcs_bbe_intr_handler() This code accidentally uses the RX macro twice instead of the RX and TX. Fixes: 6c635f78c474 ("octeontx2-af: cn10k: mcs: Handle MCS block interrupts") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 764f8485890d4988a2083f5dea90cfe0116b25f6 Author: Kees Cook Date: Thu Nov 17 20:21:52 2022 -0800 ipv4/fib: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3. Replace zero-length array with flexible-array member in struct key_vector. This results in no differences in binary output. [1] https://github.com/KSPP/linux/issues/78 Cc: Jakub Kicinski Cc: "David S. Miller" Cc: Hideaki YOSHIFUJI Cc: David Ahern Cc: Eric Dumazet Cc: Paolo Abeni Cc: "Gustavo A. R. Silva" Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: David Ahern Signed-off-by: David S. Miller commit bd5e1e42826f18147afb0ba07e6a815f52cf8bcb Author: Daniel Díaz Date: Thu Nov 17 21:44:21 2022 -0600 selftests/net: Find nettest in current directory The `nettest` binary, built from `selftests/net/nettest.c`, was expected to be found in the path during test execution of `fcnal-test.sh` and `pmtu.sh`, leading to tests getting skipped when the binary is not installed in the system, as can be seen in these logs found in the wild [1]: # TEST: vti4: PMTU exceptions [SKIP] [ 350.600250] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 350.607421] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm6udp not supported # TEST: vti6: PMTU exceptions (ESP-in-UDP) [SKIP] [ 351.605102] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 351.612243] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm4udp not supported The `unicast_extensions.sh` tests also rely on `nettest`, but it runs fine there because it looks for the binary in the current working directory [2]: The same mechanism that works for the Unicast extensions tests is here copied over to the PMTU and functional tests. [1] https://lkft.validation.linaro.org/scheduler/job/5839508#L6221 [2] https://lkft.validation.linaro.org/scheduler/job/5839508#L7958 Signed-off-by: Daniel Díaz Signed-off-by: David S. Miller commit 2158cfb076c7b3c0544380daef67dcb47e7988a2 Merge: 19d04a947db53 33c7aba0b4ffd Author: David S. Miller Date: Mon Nov 21 11:28:07 2022 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== The following patchset contains late Netfilter fixes for net: 1) Use READ_ONCE()/WRITE_ONCE() to update ct->mark, from Daniel Xu. Not reported by syzbot, but I presume KASAN would trigger post a splat on this. This is a rather old issue, predating git history. 2) Do not set up extensions for set element with end interval flag set on. This leads to bogusly skipping this elements as expired when listing the set/map to userspace as well as increasing memory consumpton when stateful expressions are used. This issue has been present since 4.18, when timeout support for rbtree set was added. ==================== Signed-off-by: David S. Miller commit cafd3d346acbb60bc65c4ad46afbb79718bf0bb7 Merge: e7135a28430df e68be7b39f21d Author: Arnd Bergmann Date: Mon Nov 21 12:26:57 2022 +0100 Merge tag 'imx-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.1, part 3: - Fix a small memory leak in mach-mxs code. - Correct PCIe pad configuration for imx8mp-evk board. - Fix ref/tcxo clock frequency property for imx6q-prti6q board. * tag 'imx-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx6q-prti6q: Fix ref/tcxo-clock-frequency properties arm64: dts: imx8mp-evk: correct pcie pad settings ARM: mxs: fix memory leak in mxs_machine_init() Link: https://lore.kernel.org/r/20221119073812.GQ16229@T480 Signed-off-by: Arnd Bergmann commit e7135a28430dfa01079a975de235fa2104896473 Merge: 37cd15e68fc2c 50edc257a1525 Author: Arnd Bergmann Date: Mon Nov 21 12:26:16 2022 +0100 Merge tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes - RSB bus communication fixes - missing IOMMU reference property to H6 Hantro G2 * tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property bus: sunxi-rsb: Support atomic transfers bus: sunxi-rsb: Remove the shutdown callback Link: https://lore.kernel.org/r/Y3ftpBFk5+fndA4B@jernej-laptop Signed-off-by: Arnd Bergmann commit 37cd15e68fc2c695016d791ec9e284024d619680 Merge: dc0e2470f4b95 40a2226e8bfac Author: Arnd Bergmann Date: Mon Nov 21 12:25:46 2022 +0100 Merge tag 'at91-fixes-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 6.1 #2 It contains: - fix UDC on at91sam9g20ek boards by adding vbus pin * tag 'at91-fixes-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sam9g20ek: enable udc vbus gpio pinctrl Link: https://lore.kernel.org/r/20221118131205.301662-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit dc0e2470f4b95d57ecfafebf9aa2375cdbdd41a3 Merge: eb7081409f94a cce616e012c21 Author: Arnd Bergmann Date: Mon Nov 21 12:25:07 2022 +0100 Merge tag 'optee-fix-for-6.1' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes Fix possible memory leak in optee_register_device() * tag 'optee-fix-for-6.1' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: fix possible memory leak in optee_register_device() Link: https://lore.kernel.org/r/Y3d2OuJ60U30OkZe@jade Signed-off-by: Arnd Bergmann commit b96e74bb439f096168c78ba3ba1599e0b85cfd73 Author: KaiLong Wang Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Fix unsigned comparison with less than zero Eliminate the following coccicheck warning: ./arch/loongarch/kernel/unwind_prologue.c:84:5-13: WARNING: Unsigned expression compared with zero: frame_ra < 0 Signed-off-by: KaiLong Wang Signed-off-by: Huacai Chen commit 54e6cd42a183b602e3627ad3aaeeed44f7443e67 Author: Huacai Chen Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite() Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite(). Otherwise, _PAGE_DIRTY silences the TLB modify exception and make us have no chance to mark a pmd/pte dirty (_PAGE_MODIFIED) for software. Reviewed-by: Guo Ren Signed-off-by: Huacai Chen commit bf2f34a506e66e2979de6b17c337c5d4b25b4d2c Author: Huacai Chen Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Set _PAGE_DIRTY only if _PAGE_WRITE is set in {pmd,pte}_mkdirty() Now {pmd,pte}_mkdirty() set _PAGE_DIRTY bit unconditionally, this causes random segmentation fault after commit 0ccf7f168e17bb7e ("mm/thp: carry over dirty bit when thp splits on pmd"). The reason is: when fork(), parent process use pmd_wrprotect() to clear huge page's _PAGE_WRITE and _PAGE_DIRTY (for COW); then pte_mkdirty() set _PAGE_DIRTY as well as _PAGE_MODIFIED while splitting dirty huge pages; once _PAGE_DIRTY is set, there will be no tlb modify exception so the COW machanism fails; and at last memory corruption occurred between parent and child processes. So, we should set _PAGE_DIRTY only when _PAGE_WRITE is set in {pmd,pte}_ mkdirty(). Cc: stable@vger.kernel.org Cc: Peter Xu Signed-off-by: Huacai Chen commit e428e9613531d1ef6bd0d91352899712b29134fb Author: Huacai Chen Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Clear FPU/SIMD thread info flags for kernel thread If a kernel thread is created by a user thread, it may carry FPU/SIMD thread info flags (TIF_USEDFPU, TIF_USEDSIMD, etc.). Then it will be considered as a fpu owner and kernel try to save its FPU/SIMD context and cause such errors: [ 41.518931] do_fpu invoked from kernel context![#1]: [ 41.523933] CPU: 1 PID: 395 Comm: iou-wrk-394 Not tainted 6.1.0-rc5+ #217 [ 41.530757] Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.pre-beta8 08/18/2022 [ 41.544064] $ 0 : 0000000000000000 90000000011e9468 9000000106c7c000 9000000106c7fcf0 [ 41.552101] $ 4 : 9000000106305d40 9000000106689800 9000000106c7fd08 0000000003995818 [ 41.560138] $ 8 : 0000000000000001 90000000009a72e4 0000000000000020 fffffffffffffffc [ 41.568174] $12 : 0000000000000000 0000000000000000 0000000000000020 00000009aab7e130 [ 41.576211] $16 : 00000000000001ff 0000000000000407 0000000000000001 0000000000000000 [ 41.584247] $20 : 0000000000000000 0000000000000001 9000000106c7fd70 90000001002f0400 [ 41.592284] $24 : 0000000000000000 900000000178f740 90000000011e9834 90000001063057c0 [ 41.600320] $28 : 0000000000000000 0000000000000001 9000000006826b40 9000000106305140 [ 41.608356] era : 9000000000228848 _save_fp+0x0/0xd8 [ 41.613542] ra : 90000000011e9468 __schedule+0x568/0x8d0 [ 41.619160] CSR crmd: 000000b0 [ 41.619163] CSR prmd: 00000000 [ 41.622359] CSR euen: 00000000 [ 41.625558] CSR ecfg: 00071c1c [ 41.628756] CSR estat: 000f0000 [ 41.635239] ExcCode : f (SubCode 0) [ 41.638783] PrId : 0014c010 (Loongson-64bit) [ 41.643191] Modules linked in: acpi_ipmi vfat fat ipmi_si ipmi_devintf cfg80211 ipmi_msghandler rfkill fuse efivarfs [ 41.653734] Process iou-wrk-394 (pid: 395, threadinfo=0000000004ebe913, task=00000000636fa1be) [ 41.662375] Stack : 00000000ffff0875 9000000006800ec0 9000000006800ec0 90000000002d57e0 [ 41.670412] 0000000000000001 0000000000000000 9000000106535880 0000000000000001 [ 41.678450] 9000000105291800 0000000000000000 9000000105291838 900000000178e000 [ 41.686487] 9000000106c7fd90 9000000106305140 0000000000000001 90000000011e9834 [ 41.694523] 00000000ffff0875 90000000011f034c 9000000105291838 9000000105291830 [ 41.702561] 0000000000000000 9000000006801440 00000000ffff0875 90000000002d48c0 [ 41.710597] 9000000128800001 9000000106305140 9000000105291838 9000000105291838 [ 41.718634] 9000000105291830 9000000107811740 9000000105291848 90000000009bf1e0 [ 41.726672] 9000000105291830 9000000107811748 2d6b72772d756f69 0000000000343933 [ 41.734708] 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 41.742745] ... [ 41.745252] Call Trace: [ 42.197868] [<9000000000228848>] _save_fp+0x0/0xd8 [ 42.205214] [<90000000011ed468>] __schedule+0x568/0x8d0 [ 42.210485] [<90000000011ed834>] schedule+0x64/0xd4 [ 42.215411] [<90000000011f434c>] schedule_timeout+0x88/0x188 [ 42.221115] [<90000000009c36d0>] io_wqe_worker+0x184/0x350 [ 42.226645] [<9000000000221cf0>] ret_from_kernel_thread+0xc/0x9c This can be easily triggered by ltp testcase syscalls/io_uring02 and it can also be easily fixed by clearing the FPU/SIMD thread info flags for kernel threads in copy_thread(). Cc: stable@vger.kernel.org Reported-by: Qi Hu Signed-off-by: Huacai Chen commit c56ab8e85d6de5c2c5ba37e7a5698b2eb0c80ef5 Author: Huacai Chen Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: SMP: Change prefix from loongson3 to loongson SMP operations can be shared by Loongson-2 series and Loongson-3 series, so we change the prefix from loongson3 to loongson for all functions and data structures. Signed-off-by: Huacai Chen commit 538eafc6deae12fbac5f277b89aa139b812bca49 Author: Huacai Chen Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Combine acpi_boot_table_init() and acpi_boot_init() Combine acpi_boot_table_init() and acpi_boot_init() since they are very simple, and we don't need to check the return value of acpi_boot_init(). Signed-off-by: Huacai Chen commit 83f638bca0ccd94942bc3c4eb9bcec24dd8a1cf9 Author: Tiezhu Yang Date: Mon Nov 21 19:02:57 2022 +0800 LoongArch: Makefile: Use "grep -E" instead of "egrep" The latest version of grep claims the egrep is now obsolete so the build now contains warnings that look like: egrep: warning: egrep is obsolescent; using grep -E Fix this up by changing the LoongArch Makefile to use "grep -E" instead. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 19d04a947db53e0d99e60aeb914d2148f61ab5f9 Author: Lu Wei Date: Thu Nov 17 23:07:22 2022 +0800 net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets() Function sparx5_tc_setup_qdisc_ets() always returns negative value because it return -EOPNOTSUPP in the end. This patch returns the rersult of sparx5_tc_ets_add() and sparx5_tc_ets_del() directly. Fixes: 211225428d65 ("net: microchip: sparx5: add support for offloading ets qdisc") Signed-off-by: Lu Wei Reviewed-by: Daniel Machon Signed-off-by: David S. Miller commit 25c94b051592c010abe92c85b0485f1faedc83f3 Author: Yang Yingliang Date: Sat Nov 19 16:11:35 2022 +0800 Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() If device_register() returns error in vmbus_device_register(), the name allocated by dev_set_name() must be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). Fixes: 09d50ff8a233 ("Staging: hv: make the Hyper-V virtual bus code build") Signed-off-by: Yang Yingliang Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221119081135.1564691-3-yangyingliang@huawei.com Signed-off-by: Wei Liu commit f92a4b50f0bd7fd52391dc4bb9a309085d278f91 Author: Yang Yingliang Date: Sat Nov 19 16:11:34 2022 +0800 Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() In the error path of vmbus_device_register(), device_unregister() is called, which calls vmbus_device_release(). The latter frees the struct hv_device that was passed in to vmbus_device_register(). So remove the kfree() in vmbus_add_channel_work() to avoid a double free. Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") Suggested-by: Michael Kelley Signed-off-by: Yang Yingliang Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221119081135.1564691-2-yangyingliang@huawei.com Signed-off-by: Wei Liu commit 47894e0fa6a56a42be6a47c767e79cce8125489d Author: Peter Gonda Date: Wed Nov 16 09:55:58 2022 -0800 virt/sev-guest: Prevent IV reuse in the SNP guest driver The AMD Secure Processor (ASP) and an SNP guest use a series of AES-GCM keys called VMPCKs to communicate securely with each other. The IV to this scheme is a sequence number that both the ASP and the guest track. Currently, this sequence number in a guest request must exactly match the sequence number tracked by the ASP. This means that if the guest sees an error from the host during a request it can only retry that exact request or disable the VMPCK to prevent an IV reuse. AES-GCM cannot tolerate IV reuse, see: "Authentication Failures in NIST version of GCM" - Antoine Joux et al. In order to address this, make handle_guest_request() delete the VMPCK on any non successful return. To allow userspace querying the cert_data length make handle_guest_request() save the number of pages required by the host, then have handle_guest_request() retry the request without requesting the extended data, then return the number of pages required back to userspace. [ bp: Massage, incorporate Tom's review comments. ] Fixes: fce96cf044308 ("virt: Add SEV-SNP guest driver") Reported-by: Peter Gonda Signed-off-by: Peter Gonda Signed-off-by: Borislav Petkov Reviewed-by: Tom Lendacky Cc: stable@kernel.org Link: https://lore.kernel.org/r/20221116175558.2373112-1-pgonda@google.com commit ebbaa4392e36521fb893973d8a0fcb32f3b6d5eb Author: Imre Deak Date: Mon Nov 14 14:22:43 2022 +0200 drm/i915: Fix warn in intel_display_power_*_domain() functions The intel_display_power_*_domain() functions should always warn if a default domain is returned as a fallback, fix this up. Spotted by Ville. Fixes: 979e1b32e0e2 ("drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform") Cc: Ville Syrjälä Cc: Jouni Högander Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221114122251.21327-2-imre.deak@intel.com (cherry picked from commit 10b85f0e1d922210ae857afed6d012ec32c4b6cb) Signed-off-by: Tvrtko Ursulin commit 00a6c36cca760d0b659f894dee728555b193c5e1 Author: Matthew Auld Date: Tue Nov 15 10:46:20 2022 +0000 drm/i915/ttm: never purge busy objects In i915_gem_madvise_ioctl() we immediately purge the object is not currently used, like when the mm.pages are NULL. With shmem the pages might still be hanging around or are perhaps swapped out. Similarly with ttm we might still have the pages hanging around on the ttm resource, like with lmem or shmem, but here we need to be extra careful since async unbinds are possible as well as in-progress kernel moves. In i915_ttm_purge() we expect the pipeline-gutting to nuke the ttm resource for us, however if it's busy the memory is only moved to a ghost object, which then leads to broken behaviour when for example clearing the i915_tt->filp, since the actual ttm_tt is still alive and populated, even though it's been moved to the ghost object. When we later destroy the ghost object we hit the following, since the filp is now NULL: [ +0.006982] #PF: supervisor read access in kernel mode [ +0.005149] #PF: error_code(0x0000) - not-present page [ +0.005147] PGD 11631d067 P4D 11631d067 PUD 115972067 PMD 0 [ +0.005676] Oops: 0000 [#1] PREEMPT SMP NOPTI [ +0.012962] Workqueue: events ttm_device_delayed_workqueue [ttm] [ +0.006022] RIP: 0010:i915_ttm_tt_unpopulate+0x3a/0x70 [i915] [ +0.005879] Code: 89 fb 48 85 f6 74 11 8b 55 4c 48 8b 7d 30 45 31 c0 31 c9 e8 18 6a e5 e0 80 7d 60 00 74 20 48 8b 45 68 8b 55 08 4c 89 e7 5b 5d <48> 8b 40 20 83 e2 01 41 5c 89 d1 48 8b 70 30 e9 42 b2 ff ff 4c 89 [ +0.018782] RSP: 0000:ffffc9000bf6fd70 EFLAGS: 00010202 [ +0.005244] RAX: 0000000000000000 RBX: ffff8883e12ae380 RCX: 0000000000000000 [ +0.007150] RDX: 000000008000000e RSI: ffffffff823559b4 RDI: ffff8883e12ae3c0 [ +0.007142] RBP: ffff888103b65d48 R08: 0000000000000001 R09: 0000000000000001 [ +0.007144] R10: 0000000000000001 R11: ffff88829c2c8040 R12: ffff8883e12ae3c0 [ +0.007148] R13: 0000000000000001 R14: ffff888115184140 R15: ffff888115184248 [ +0.007154] FS: 0000000000000000(0000) GS:ffff88844db00000(0000) knlGS:0000000000000000 [ +0.008108] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ +0.005763] CR2: 0000000000000020 CR3: 000000013fdb4004 CR4: 00000000003706e0 [ +0.007152] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ +0.007145] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ +0.007154] Call Trace: [ +0.002459] [ +0.002126] ttm_tt_unpopulate.part.0+0x17/0x70 [ttm] [ +0.005068] ttm_bo_tt_destroy+0x1c/0x50 [ttm] [ +0.004464] ttm_bo_cleanup_memtype_use+0x25/0x40 [ttm] [ +0.005244] ttm_bo_cleanup_refs+0x90/0x2c0 [ttm] [ +0.004721] ttm_bo_delayed_delete+0x235/0x250 [ttm] [ +0.004981] ttm_device_delayed_workqueue+0x13/0x40 [ttm] [ +0.005422] process_one_work+0x248/0x560 [ +0.004028] worker_thread+0x4b/0x390 [ +0.003682] ? process_one_work+0x560/0x560 [ +0.004199] kthread+0xeb/0x120 [ +0.003163] ? kthread_complete_and_exit+0x20/0x20 [ +0.004815] ret_from_fork+0x1f/0x30 v2: - Just use ttm_bo_wait() directly (Niranjana) - Add testcase reference Testcase: igt@gem_madvise@dontneed-evict-race Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Reported-by: Niranjana Vishwanathapura Signed-off-by: Matthew Auld Cc: Andrzej Hajda Cc: Nirmoy Das Cc: # v5.15+ Reviewed-by: Niranjana Vishwanathapura Acked-by: Nirmoy Das Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20221115104620.120432-1-matthew.auld@intel.com (cherry picked from commit 5524b5e52e08f675116a93296fe5bee60bc43c03) Signed-off-by: Tvrtko Ursulin commit 9ab000d9ac546f08485f11c033542e74f6202dee Merge: 7cef6b73fba96 60dcb5ff55e5c Author: David S. Miller Date: Mon Nov 21 08:31:53 2022 +0000 Merge branch 'nfc-leaks' Shang XiaoJing says: ==================== nfc: Fix potential memory leak of skb There are still somewhere maybe leak the skb, fix the memleaks by adding fail path. ==================== Signed-off-by: David S. Miller commit 60dcb5ff55e5c5da259a0dcc4c24c842de1abc9d Author: Shang XiaoJing Date: Thu Nov 17 19:37:14 2022 +0800 nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send() s3fwrn5_nci_send() won't free the skb when it failed for the check before s3fwrn5_write(). As the result, the skb will memleak. Free the skb when the check failed. Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") Signed-off-by: Shang XiaoJing Suggested-by: Pavel Machek Signed-off-by: David S. Miller commit 614761e1119c994a7f19e4c9f37b1d2d7fe7306e Author: Shang XiaoJing Date: Thu Nov 17 19:37:13 2022 +0800 nfc: nxp-nci: Fix potential memory leak in nxp_nci_send() nxp_nci_send() won't free the skb when it failed for the check before write(). As the result, the skb will memleak. Free the skb when the check failed. Fixes: dece45855a8b ("NFC: nxp-nci: Add support for NXP NCI chips") Signed-off-by: Shang XiaoJing Suggested-by: Pavel Machek Signed-off-by: David S. Miller commit e204ead35401af5e120f653a133d54ee2595627e Author: Shang XiaoJing Date: Thu Nov 17 19:37:12 2022 +0800 nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send() nfcmrvl_i2c_nci_send() will be called by nfcmrvl_nci_send(), and skb should be freed in nfcmrvl_i2c_nci_send(). However, nfcmrvl_nci_send() won't free the skb when it failed for the test_bit(). Free the skb when test_bit() failed. Fixes: b5b3e23e4cac ("NFC: nfcmrvl: add i2c driver") Signed-off-by: Shang XiaoJing Suggested-by: Pavel Machek Signed-off-by: David S. Miller commit eb7081409f94a9a8608593d0fb63a1aa3d6f95d8 Author: Linus Torvalds Date: Sun Nov 20 16:02:16 2022 -0800 Linux 6.1-rc6 commit c6c67bf9bc2714d9c2c2e7ecfbf29d912b8c4f17 Merge: 5239ddeb48723 40adaf51cb318 Author: Linus Torvalds Date: Sun Nov 20 15:31:20 2022 -0800 Merge tag 'trace-probes-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing/probes fixes from Steven Rostedt: - Fix possible NULL pointer dereference on trace_event_file in kprobe_event_gen_test_exit() - Fix NULL pointer dereference for trace_array in kprobe_event_gen_test_exit() - Fix memory leak of filter string for eprobes - Fix a possible memory leak in rethook_alloc() - Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case which can cause a possible use-after-free - Fix warning in eprobe filter creation - Fix eprobe filter creation as it picked the wrong event for the fields * tag 'trace-probes-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/eprobe: Fix eprobe filter to make a filter correctly tracing/eprobe: Fix warning in filter creation kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case rethook: fix a potential memleak in rethook_alloc() tracing/eprobe: Fix memory leak of filter string tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit() tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit() commit 5239ddeb4872390856bb79655dba85350936681e Merge: 894909f95aa14 94eedf3dded5f Author: Linus Torvalds Date: Sun Nov 20 15:25:32 2022 -0800 Merge tag 'trace-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix polling to block on watermark like the reads do, as user space applications get confused when the select says read is available, and then the read blocks - Fix accounting of ring buffer dropped pages as it is what is used to determine if the buffer is empty or not - Fix memory leak in tracing_read_pipe() - Fix struct trace_array warning about being declared in parameters - Fix accounting of ftrace pages used in output at start up. - Fix allocation of dyn_ftrace pages by subtracting one from order instead of diving it by 2 - Static analyzer found a case were a pointer being used outside of a NULL check (rb_head_page_deactivate()) - Fix possible NULL pointer dereference if kstrdup() fails in ftrace_add_mod() - Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() - Fix bad pointer dereference in register_synth_event() on error path - Remove unused __bad_type_size() method - Fix possible NULL pointer dereference of entry in list 'tr->err_log' - Fix NULL pointer deference race if eprobe is called before the event setup * tag 'trace-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix race where eprobes can be called before the event tracing: Fix potential null-pointer-access of entry in list 'tr->err_log' tracing: Remove unused __bad_type_size() method tracing: Fix wild-memory-access in register_synth_event() tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() ftrace: Fix null pointer dereference in ftrace_add_mod() ring_buffer: Do not deactivate non-existant pages ftrace: Optimize the allocation for mcount entries ftrace: Fix the possible incorrect kernel message tracing: Fix warning on variable 'struct trace_array' tracing: Fix memory leak in tracing_read_pipe() ring-buffer: Include dropped pages in counting dirty patches tracing/ring-buffer: Have polling block on watermark commit 94eedf3dded5fb472ce97bfaf3ac1c6c29c35d26 Author: Steven Rostedt (Google) Date: Thu Nov 17 21:42:49 2022 -0500 tracing: Fix race where eprobes can be called before the event The flag that tells the event to call its triggers after reading the event is set for eprobes after the eprobe is enabled. This leads to a race where the eprobe may be triggered at the beginning of the event where the record information is NULL. The eprobe then dereferences the NULL record causing a NULL kernel pointer bug. Test for a NULL record to keep this from happening. Link: https://lore.kernel.org/linux-trace-kernel/20221116192552.1066630-1-rafaelmendsr@gmail.com/ Link: https://lore.kernel.org/linux-trace-kernel/20221117214249.2addbe10@gandalf.local.home Cc: Linux Trace Kernel Cc: Tzvetomir Stoyanov Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events") Acked-by: Masami Hiramatsu (Google) Reported-by: Rafael Mendonca Signed-off-by: Steven Rostedt (Google) commit 894909f95aa1473f49f767dcd5750ba152b85e13 Merge: d4f754c3615c8 36b038791e1e2 Author: Linus Torvalds Date: Sun Nov 20 10:47:39 2022 -0800 Merge tag 'x86_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Do not hold fpregs lock when inheriting FPU permissions because the fpregs lock disables preemption on RT but fpu_inherit_perms() does spin_lock_irq(), which, on RT, uses rtmutexes and they need to be preemptible. - Check the page offset and the length of the data supplied by userspace for overflow when specifying a set of pages to add to an SGX enclave * tag 'x86_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Drop fpregs lock before inheriting FPU permissions x86/sgx: Add overflow check in sgx_validate_offset_length() commit d4f754c3615c83df277018a98486db501f92b155 Merge: eb0ef8add5a3e 91dabf33ae5df Author: Linus Torvalds Date: Sun Nov 20 10:43:52 2022 -0800 Merge tag 'sched_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Fix a small race on the task's exit path where there's a misunderstanding whether the task holds rq->lock or not - Prevent processes from getting killed when using deprecated or unknown rseq ABI flags in order to be able to fuzz the rseq() syscall with syzkaller * tag 'sched_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Fix race in task_call_func() rseq: Use pr_warn_once() when deprecated/unknown ABI flags are encountered commit eb0ef8add5a3e98332f803737d18a384da7f9a74 Merge: 6a211a753d1c8 ce0d998be9274 Author: Linus Torvalds Date: Sun Nov 20 10:41:14 2022 -0800 Merge tag 'perf_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Fix an intel PT erratum where CPUs do not support single range output for more than 4K - Fix a NULL ptr dereference which can happen after an NMI interferes with the event enabling dance in amd_pmu_enable_all() - Free the events array too when freeing uncore contexts on CPU online, thereby fixing a memory leak - Improve the pending SIGTRAP check * tag 'perf_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/pt: Fix sampling using single range output perf/x86/amd: Fix crash due to race between amd_pmu_enable_all, perf NMI and throttling perf/x86/amd/uncore: Fix memory leak for events array perf: Improve missing SIGTRAP checking commit 6a211a753d1c836856cf942afbf3b6bfdcf0a5f4 Merge: 712fb83dc3f68 23df39fc6a361 Author: Linus Torvalds Date: Sun Nov 20 10:39:45 2022 -0800 Merge tag 'locking_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Borislav Petkov: - Fix a build error with clang 11 * tag 'locking_urgent_for_v6.1_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking: Fix qspinlock/x86 inline asm error commit 712fb83dc3f688458ae91bb0a5c706b239ab4684 Merge: 77c51ba552a1c eb761a1760bf3 Author: Linus Torvalds Date: Sun Nov 20 09:47:33 2022 -0800 Merge tag 'powerpc-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: - Fix writable sections being moved into the rodata region. Thanks to Nicholas Piggin and Christophe Leroy. * tag 'powerpc-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Fix writable sections being moved into the rodata region commit e2a87785aab0dac190ac89be6a9ba955e2c634f2 Author: Gaosheng Cui Date: Thu Nov 17 11:44:23 2022 +0800 hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails Smatch report warning as follows: drivers/hwmon/ibmpex.c:509 ibmpex_register_bmc() warn: '&data->list' not removed from list If ibmpex_find_sensors() fails in ibmpex_register_bmc(), data will be freed, but data->list will not be removed from driver_data.bmc_data, then list traversal may cause UAF. Fix by removeing it from driver_data.bmc_data before free(). Fixes: 57c7c3a0fdea ("hwmon: IBM power meter driver") Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20221117034423.2935739-1-cuigaosheng1@huawei.com Signed-off-by: Guenter Roeck commit 3b7f98f237528c496ea0b689bace0e35eec3e060 Author: Yang Yingliang Date: Sat Nov 12 20:56:06 2022 +0800 hwmon: (i5500_temp) fix missing pci_disable_device() pci_disable_device() need be called while module exiting, switch to use pcim_enable(), pci_disable_device() will be called in pcim_release(). Fixes: ada072816be1 ("hwmon: (i5500_temp) New driver for the Intel 5500/5520/X58 chipsets") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221112125606.3751430-1-yangyingliang@huawei.com Signed-off-by: Guenter Roeck commit b8d27d2ce8dfc207e4b67b929a86f2be76fbc6ef Author: Ninad Malwade Date: Tue Nov 8 12:45:08 2022 +0800 hwmon: (ina3221) Fix shunt sum critical calculation The shunt sum critical limit register value should be left shifted by one bit as its LSB-0 is a reserved bit. Fixes: 2057bdfb7184 ("hwmon: (ina3221) Add summation feature support") Signed-off-by: Ninad Malwade Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20221108044508.23463-1-nmalwade@nvidia.com Signed-off-by: Guenter Roeck commit 07e06193ead86d4812f431b4d87bbd4161222e3f Author: Derek Nguyen Date: Thu Nov 10 13:21:08 2022 -0600 hwmon: (ltc2947) fix temperature scaling The LTC2947 datasheet (Rev. B) calls out in the section "Register Description: Non-Accumulated Result Registers" (pg. 30) that "To calculate temperature, multiply the TEMP register value by 0.204°C and add 5.5°C". Fix to add 5.5C and not 0.55C. Fixes: 9f90fd652bed ("hwmon: Add support for ltc2947") Signed-off-by: Derek Nguyen Signed-off-by: Brandon Maier Link: https://lore.kernel.org/r/20221110192108.20624-1-brandon.maier@collins.com Signed-off-by: Guenter Roeck commit 77c51ba552a1c4f73228766e43ae37c4101b3758 Merge: b6e7fdfd6f6a8 f014165faa7b9 Author: Linus Torvalds Date: Sat Nov 19 15:51:22 2022 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Five small fixes, all in drivers. Most of these are error leg freeing issues, with the only really user visible one being the zfcp fix" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: iscsi: Fix possible memory leak when device_register() failed scsi: zfcp: Fix double free of FSF request when qdio send fails scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper() scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() scsi: mpi3mr: Suppress command reply debug prints commit f391d6ee002ea022c62dc0b09d0578f3ccce81be Author: Dan Carpenter Date: Fri Nov 18 14:48:00 2022 +0300 cifs: Use after free in debug code This debug code dereferences "old_iface" after it was already freed by the call to release_iface(). Re-order the debugging to avoid this issue. Fixes: b54034a73baf ("cifs: during reconnect, update interface if necessary") Cc: stable@vger.kernel.org # 5.19+ Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Dan Carpenter Signed-off-by: Steve French commit b6e7fdfd6f6a8bf88fcdb4a45da52c42ba238c25 Merge: 8c67d863a9d60 7fc961cf7ffcb Author: Linus Torvalds Date: Sat Nov 19 09:08:57 2022 -0800 Merge tag 'iommu-fixes-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Preset accessed bits in Intel VT-d page-directory entries to avoid hardware error - Set supervisor bit only when Intel IOMMU has the SRS capability * tag 'iommu-fixes-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Set SRE bit only when hardware has SRS cap iommu/vt-d: Preset Access bit for IOVA in FL non-leaf paging entries commit 8c67d863a9d60f8e2d563477ba2fd664122e0aae Merge: 926028aaa3827 5db8face97f81 Author: Linus Torvalds Date: Sat Nov 19 09:03:20 2022 -0800 Merge tag 'kbuild-fixes-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Update MAINTAINERS with Nathan and Nicolas as new Kbuild reviewers - Increment the debian revision for deb-pkg builds * tag 'kbuild-fixes-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: Restore .version auto-increment behaviour for Debian packages MAINTAINERS: Add linux-kbuild's patchwork MAINTAINERS: Remove Michal Marek from Kbuild maintainers MAINTAINERS: Add Nathan and Nicolas to Kbuild reviewers commit 926028aaa3827554096d42ffb0c2973bc7f5e80f Merge: fe24a97cf2543 a51e5d293dd1c Author: Linus Torvalds Date: Sat Nov 19 08:58:58 2022 -0800 Merge tag '6.1-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: - two missing and one incorrect return value checks - fix leak on tlink mount failure * tag '6.1-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: add check for returning value of SMB2_set_info_init cifs: Fix wrong return value checking when GETFLAGS cifs: add check for returning value of SMB2_close_init cifs: Fix connections leak when tlink setup failed commit 7fc961cf7ffcb130c4e93ee9a5628134f9de700a Author: Tina Zhang Date: Wed Nov 16 13:15:44 2022 +0800 iommu/vt-d: Set SRE bit only when hardware has SRS cap SRS cap is the hardware cap telling if the hardware IOMMU can support requests seeking supervisor privilege or not. SRE bit in scalable-mode PASID table entry is treated as Reserved(0) for implementation not supporting SRS cap. Checking SRS cap before setting SRE bit can avoid the non-recoverable fault of "Non-zero reserved field set in PASID Table Entry" caused by setting SRE bit while there is no SRS cap support. The fault messages look like below: DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Read NO_PASID] Request device [00:0d.0] fault addr 0x1154e1000 [fault reason 0x5a] SM: Non-zero reserved field set in PASID Table Entry Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table interface") Cc: stable@vger.kernel.org Signed-off-by: Tina Zhang Link: https://lore.kernel.org/r/20221115070346.1112273-1-tina.zhang@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20221116051544.26540-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 242b0aaeabbe2efbef1b9d42a8e56627e800964c Author: Tina Zhang Date: Wed Nov 16 13:15:43 2022 +0800 iommu/vt-d: Preset Access bit for IOVA in FL non-leaf paging entries The A/D bits are preseted for IOVA over first level(FL) usage for both kernel DMA (i.e, domain typs is IOMMU_DOMAIN_DMA) and user space DMA usage (i.e., domain type is IOMMU_DOMAIN_UNMANAGED). Presetting A bit in FL requires to preset the bit in every related paging entries, including the non-leaf ones. Otherwise, hardware may treat this as an error. For example, in a case of ECAP_REG.SMPWC==0, DMA faults might occur with below DMAR fault messages (wrapped for line length) dumped. DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Read NO_PASID] Request device [aa:00.0] fault addr 0x10c3a6000 [fault reason 0x90] SM: A/D bit update needed in first-level entry when set up in no snoop Fixes: 289b3b005cb9 ("iommu/vt-d: Preset A/D bits for user space DMA usage") Cc: stable@vger.kernel.org Signed-off-by: Tina Zhang Link: https://lore.kernel.org/r/20221113010324.1094483-1-tina.zhang@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20221116051544.26540-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 05530ef7cf7c7d700f6753f058999b1b5099a026 Author: Kees Cook Date: Fri Nov 18 15:23:50 2022 -0800 ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG), indirect call targets are validated against the expected function pointer prototype to make sure the call target is valid to help mitigate ROP attacks. If they are not identical, there is a failure at run time, which manifests as either a kernel panic or thread getting killed. seq_copy_in_user() and seq_copy_in_kernel() did not have prototypes matching snd_seq_dump_func_t. Adjust this and remove the casts. There are not resulting binary output differences. This was found as a result of Clang's new -Wcast-function-type-strict flag, which is more sensitive than the simpler -Wcast-function-type, which only checks for type width mismatches. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202211041527.HD8TLSE1-lkp@intel.com Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: "Gustavo A. R. Silva" Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20221118232346.never.380-kees@kernel.org Signed-off-by: Takashi Iwai commit 48d4180939e12c4bd2846f984436d895bb9699ed Author: Vishal Verma Date: Wed Nov 16 16:37:37 2022 -0700 ACPI: HMAT: Fix initiator registration for single-initiator systems In a system with a single initiator node, and one or more memory-only 'target' nodes, the memory-only node(s) would fail to register their initiator node correctly. i.e. in sysfs: # ls /sys/devices/system/node/node0/access0/targets/ node0 Where as the correct behavior should be: # ls /sys/devices/system/node/node0/access0/targets/ node0 node1 This happened because hmat_register_target_initiators() uses list_sort() to sort the initiator list, but the sort comparision function (initiator_cmp()) is overloaded to also set the node mask's bits. In a system with a single initiator, the list is singular, and list_sort elides the comparision helper call. Thus the node mask never gets set, and the subsequent search for the best initiator comes up empty. Add a new helper to consume the sorted initiator list, and generate the nodemask, decoupling it from the overloaded initiator_cmp() comparision callback. This prevents the singular list corner case naturally, and makes the code easier to follow as well. Cc: Cc: Rafael J. Wysocki Cc: Liu Shixin Cc: Dan Williams Cc: Kirill A. Shutemov Reported-by: Chris Piper Signed-off-by: Vishal Verma Acked-by: Rafael J. Wysocki Acked-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/20221116-acpi_hmat_fix-v2-2-3712569be691@intel.com Signed-off-by: Dan Williams commit 14f16d47561ba9249efc6c2db9d47ed56841f070 Author: Vishal Verma Date: Wed Nov 16 16:37:36 2022 -0700 ACPI: HMAT: remove unnecessary variable initialization In hmat_register_target_initiators(), the variable 'best' gets initialized in the outer per-locality-type for loop. The initialization just before setting up 'Access 1' targets was unnecessary. Remove it. Cc: Rafael J. Wysocki Cc: Liu Shixin Cc: Dan Williams Acked-by: Kirill A. Shutemov Acked-by: Rafael J. Wysocki Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20221116-acpi_hmat_fix-v2-1-3712569be691@intel.com Signed-off-by: Dan Williams commit 406c706c7b7f1730aa787e914817b8d16b1e99f6 Author: Peter Griffin Date: Thu Nov 3 17:02:10 2022 +0000 vfs: vfs_tmpfile: ensure O_EXCL flag is enforced If O_EXCL is *not* specified, then linkat() can be used to link the temporary file into the filesystem. If O_EXCL is specified then linkat() should fail (-1). After commit 863f144f12ad ("vfs: open inside ->tmpfile()") the O_EXCL flag is no longer honored by the vfs layer for tmpfile, which means the file can be linked even if O_EXCL flag is specified, which is a change in behaviour for userspace! The open flags was previously passed as a parameter, so it was uneffected by the changes to file->f_flags caused by finish_open(). This patch fixes the issue by storing file->f_flags in a local variable so the O_EXCL test logic is restored. This regression was detected by Android CTS Bionic fcntl() tests running on android-mainline [1]. [1] https://android.googlesource.com/platform/bionic/+/ refs/heads/master/tests/fcntl_test.cpp#352 Fixes: 863f144f12ad ("vfs: open inside ->tmpfile()") Acked-by: Miklos Szeredi Tested-by: Will McVicker Signed-off-by: Peter Griffin Signed-off-by: Al Viro commit 7cef6b73fba96abef731a53501924fc3c4a0f947 Author: YueHaibing Date: Fri Nov 18 09:12:49 2022 +0800 macsec: Fix invalid error code set 'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded case, it will be invalid before return. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: YueHaibing Reviewed-by: Saeed Mahameed Reviewed-by: Antoine Tenart Link: https://lore.kernel.org/r/20221118011249.48112-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 4d633d1b468b6eb107a81b2fd10b9debddca3d47 Author: Hangbin Liu Date: Fri Nov 18 11:43:53 2022 +0800 bonding: fix ICMPv6 header handling when receiving IPv6 messages Currently, we get icmp6hdr via function icmp6_hdr(), which needs the skb transport header to be set first. But there is no rule to ask driver set transport header before netif_receive_skb() and bond_handle_frame(). So we will not able to get correct icmp6hdr on some drivers. Fix this by using skb_header_pointer to get the IPv6 and ICMPV6 headers. Reported-by: Liang Li Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets") Suggested-by: Eric Dumazet Signed-off-by: Hangbin Liu Reviewed-by: Eric Dumazet Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20221118034353.1736727-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit 6295cf7bed277ac90032940fe904b516bb65efbf Merge: 5619537284f10 0873016d46f6d Author: Jakub Kicinski Date: Fri Nov 18 19:41:24 2022 -0800 Merge branch 'nfp-fixes-for-v6-1' Simon Horman says: ==================== nfp: fixes for v6.1 - Ensure that information displayed by "devlink port show" reflects the number of lanes available to be split. - Avoid NULL dereference in ethtool test code. ==================== Link: https://lore.kernel.org/r/20221117153744.688595-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 0873016d46f6dfafd1bdf4d9b935b3331b226f7c Author: Jaco Coetzee Date: Thu Nov 17 16:37:44 2022 +0100 nfp: add port from netdev validation for EEPROM access Setting of the port flag `NFP_PORT_CHANGED`, introduced to ensure the correct reading of EEPROM data, causes a fatal kernel NULL pointer dereference in cases where the target netdev type cannot be determined. Add validation of port struct pointer before attempting to set the `NFP_PORT_CHANGED` flag. Return that operation is not supported if the netdev type cannot be determined. Fixes: 4ae97cae07e1 ("nfp: ethtool: fix the display error of `ethtool -m DEVNAME`") Signed-off-by: Jaco Coetzee Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 4abd9600b9d15d3d92a9ac25cf200422a4c415ee Author: Diana Wang Date: Thu Nov 17 16:37:43 2022 +0100 nfp: fill splittable of devlink_port_attrs correctly The error is reflected in that it shows wrong splittable status of port when executing "devlink port show". The reason which leads the error is that the assigned operation of splittable is just a simple negation operation of split and it does not consider port lanes quantity. A splittable port should have several lanes that can be split(lanes quantity > 1). If without the judgement, it will show wrong message for some firmware, such as 2x25G, 2x10G. Fixes: a0f49b548652 ("devlink: Add a new devlink port split ability attribute and pass to netlink") Signed-off-by: Diana Wang Reviewed-by: Louis Peens Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 5619537284f1017e9f6c7500b02b859b3830a06d Author: Yang Yingliang Date: Thu Nov 17 21:51:48 2022 +0800 net: pch_gbe: fix pci device refcount leak while module exiting As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrement the reference count by calling pci_dev_put(). In pch_gbe_probe(), pci_get_domain_bus_and_slot() is called, so in error path in probe() and remove() function, pci_dev_put() should be called to avoid refcount leak. Compile tested only. Fixes: 1a0bdadb4e36 ("net/pch_gbe: supports eg20t ptp clock") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221117135148.301014-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit d66608803aa2ffb9e475623343f69996305771ae Author: Yang Yingliang Date: Thu Nov 17 20:46:58 2022 +0800 octeontx2-af: debugsfs: fix pci device refcount leak As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrement the reference count by calling pci_dev_put(). So before returning from rvu_dbg_rvu_pf_cgx_map_display() or cgx_print_dmac_flt(), pci_dev_put() is called to avoid refcount leak. Fixes: dbc52debf95f ("octeontx2-af: Debugfs support for DMAC filters") Fixes: e2fb37303865 ("octeontx2-af: Display CGX, NIX and PF map in debugfs.") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221117124658.162409-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 62a7311fb96c61d281da9852dbee4712fc8c3277 Author: Zhang Changzhong Date: Thu Nov 17 16:50:38 2022 +0800 net/qla3xxx: fix potential memleak in ql3xxx_send() The ql3xxx_send() returns NETDEV_TX_OK without freeing skb in error handling case, add dev_kfree_skb_any() to fix it. Fixes: bd36b0ac5d06 ("qla3xxx: Add support for Qlogic 4032 chip.") Signed-off-by: Zhang Changzhong Link: https://lore.kernel.org/r/1668675039-21138-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski commit cbe867685386af1f0a2648f5279f6e4c74bfd17f Author: Hui Tang Date: Thu Nov 17 16:40:32 2022 +0800 net: mvpp2: fix possible invalid pointer dereference It will cause invalid pointer dereference to priv->cm3_base behind, if PTR_ERR(priv->cm3_base) in mvpp2_get_sram(). Fixes: e54ad1e01c00 ("net: mvpp2: add CM3 SRAM memory map") Signed-off-by: Hui Tang Link: https://lore.kernel.org/r/20221117084032.101144-1-tanghui20@huawei.com Signed-off-by: Jakub Kicinski commit 594c61ffc77de0a197934aa0f1df9285c68801c6 Author: Peter Kosyh Date: Thu Nov 17 18:28:06 2022 +0300 net/mlx4: Check retval of mlx4_bitmap_init If mlx4_bitmap_init fails, mlx4_bitmap_alloc_range will dereference the NULL pointer (bitmap->table). Make sure, that mlx4_bitmap_alloc_range called in no error case. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d57febe1a478 ("net/mlx4: Add A0 hybrid steering") Reviewed-by: Tariq Toukan Signed-off-by: Peter Kosyh Link: https://lore.kernel.org/r/20221117152806.278072-1-pkosyh@yandex.ru Signed-off-by: Jakub Kicinski commit f70074140524c59a0935947b06dd6cb6e1ea642d Author: Liu Jian Date: Thu Nov 17 19:13:56 2022 +0800 net: ethernet: mtk_eth_soc: fix error handling in mtk_open() If mtk_start_dma() fails, invoke phylink_disconnect_phy() to perform cleanup. phylink_disconnect_phy() contains the put_device action. If phylink_disconnect_phy is not performed, the Kref of netdev will leak. Fixes: b8fc9f30821e ("net: ethernet: mediatek: Add basic PHYLINK support") Signed-off-by: Liu Jian Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20221117111356.161547-1-liujian56@huawei.com Signed-off-by: Jakub Kicinski commit e68be7b39f21d8a9291a5a3019787cd3ca999dd7 Author: Fabio Estevam Date: Fri Nov 18 10:41:02 2022 -0300 ARM: dts: imx6q-prti6q: Fix ref/tcxo-clock-frequency properties make dtbs_check gives the following errors: ref-clock-frequency: size (9) error for type uint32 tcxo-clock-frequency: size (9) error for type uint32 Fix it by passing the frequencies inside < > as documented in Documentation/devicetree/bindings/net/wireless/ti,wlcore.yaml. Signed-off-by: Fabio Estevam Fixes: 0d446a505592 ("ARM: dts: add Protonic PRTI6Q board") Signed-off-by: Shawn Guo commit af8a6329f2417721fc4588a91427b5928946f12d Author: Peng Fan Date: Thu Nov 17 17:53:53 2022 +0800 arm64: dts: imx8mp-evk: correct pcie pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: d50650500064 ("arm64: dts: imx8mp-evk: Add PCIe support") Signed-off-by: Peng Fan Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit fe24a97cf2543e8832e7a2124802e5c32aac05aa Merge: bf5003a0dc502 81cd7e8489278 Author: Linus Torvalds Date: Fri Nov 18 17:56:29 2022 -0800 Merge tag 'input-for-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a fix for 8042 to stop leaking platform device on unload - a fix for Goodix touchscreens on devices like Nanote UMPC-01 where we need to reset controller to load config from firmware - a workaround for Acer Switch to avoid interrupt storm from home and power buttons - a workaround for more ASUS ZenBook models to detect keyboard controller - a fix for iforce driver to properly handle communication errors - touchpad on HP Laptop 15-da3001TU switched to RMI mode * tag 'input-for-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: i8042 - fix leaking of platform device on module removal Input: i8042 - apply probe defer to more ASUS ZenBook models Input: soc_button_array - add Acer Switch V 10 to dmi_use_low_level_irq[] Input: soc_button_array - add use_low_level_irq module parameter Input: iforce - invert valid length check when fetching device IDs Input: goodix - try resetting the controller when no config is set dt-bindings: input: touchscreen: Add compatible for Goodix GT7986U chip Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode commit f31e3c204d1844b8680a442a48868af5ac3d5481 Author: Zheng Yongjun Date: Thu Nov 17 06:20:11 2022 +0000 ARM: mxs: fix memory leak in mxs_machine_init() If of_property_read_string() failed, 'soc_dev_attr' should be freed before return. Otherwise there is a memory leak. Fixes: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Zheng Yongjun Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit bf5003a0dc5024987eb3193a19aa802fc6235af0 Merge: a66e4cbf7a29f 61ba9e9712e18 Author: Linus Torvalds Date: Fri Nov 18 17:17:42 2022 -0800 Merge tag 'zonefs-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fixes from Damien Le Moal: - Fix the IO error recovery path for failures happening in the last zone of device, and that zone is a "runt" zone (smaller than the other zone). The current code was failing to properly obtain a zone report in that case. - Remove the unused to_attr() function as it is unused, causing compilation warnings with clang. * tag 'zonefs-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: Remove to_attr() helper function zonefs: fix zone report size in __zonefs_io_error() commit 81cd7e8489278d28794e7b272950c3e00c344e44 Author: Chen Jun Date: Fri Nov 18 15:40:03 2022 -0800 Input: i8042 - fix leaking of platform device on module removal Avoid resetting the module-wide i8042_platform_device pointer in i8042_probe() or i8042_remove(), so that the device can be properly destroyed by i8042_exit() on module unload. Fixes: 9222ba68c3f4 ("Input: i8042 - add deferred probe support") Signed-off-by: Chen Jun Link: https://lore.kernel.org/r/20221109034148.23821-1-chenjun102@huawei.com Signed-off-by: Dmitry Torokhov commit a66e4cbf7a29fe555ebb995b130b2e059fc26d89 Merge: 23a60a03d9a99 7fdbc5f014c3f Author: Linus Torvalds Date: Fri Nov 18 14:59:53 2022 -0800 Merge tag 'io_uring-6.1-2022-11-18' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "This is mostly fixing issues around the poll rework, but also two tweaks for the multishot handling for accept and receive. All stable material" * tag 'io_uring-6.1-2022-11-18' of git://git.kernel.dk/linux: io_uring: disallow self-propelled ring polling io_uring: fix multishot recv request leaks io_uring: fix multishot accept request leaks io_uring: fix tw losing poll events io_uring: update res mask in io_poll_check_events commit 23a60a03d9a9980d1e91190491ceea0dc58fae62 Merge: f4408c3dfcbcc 5b47348fc0b18 Author: Linus Torvalds Date: Fri Nov 18 14:31:03 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Fix a build error with CONFIG_CFI_CLANG + CONFIG_FTRACE when CONFIG_FUNCTION_GRAPH_TRACER is not enabled. - Fix a BUG_ON triggered by the page table checker due to incorrect file_map_count for non-leaf pmd/pud (the arm64 pmd_user_accessible_page() not checking whether it's a leaf entry). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER commit a8417330f8a57275ed934293e832982b6d882713 Author: Slawomir Laba Date: Thu Nov 3 14:00:03 2022 +0100 iavf: Fix race condition between iavf_shutdown and iavf_remove Fix a deadlock introduced by commit 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") due to race condition between iavf_shutdown and iavf_remove, where iavf_remove stucks forever in while loop since iavf_shutdown already set __IAVF_REMOVE adapter state. Fix this by checking if the __IAVF_IN_REMOVE_TASK has already been set and return if so. Fixes: 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") Signed-off-by: Slawomir Laba Signed-off-by: Mateusz Palczewski Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen commit f4408c3dfcbcc7669caa48786973e88635f3d5e8 Merge: b5bf1d8a23a68 5c59789ce7ce9 Author: Linus Torvalds Date: Fri Nov 18 13:59:45 2022 -0800 Merge tag 'block-6.1-2022-11-18' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - Two more bogus nid quirks (Bean Huo, Tiago Dias Ferreira) - Memory leak fix in nvmet (Sagi Grimberg) - Regression fix for block cgroups pinning the wrong blkcg, causing leaks of cgroups and blkcgs (Chris) - UAF fix for drbd setup error handling (Dan) - Fix DMA alignment propagation in DM (Keith) * tag 'block-6.1-2022-11-18' of git://git.kernel.dk/linux: dm-log-writes: set dma_alignment limit in io_hints dm-integrity: set dma_alignment limit in io_hints block: make blk_set_default_limits() private dm-crypt: provide dma_alignment limit in io_hints block: make dma_alignment a stacking queue_limit nvmet: fix a memory leak in nvmet_auth_set_key nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000 drbd: use after free in drbd_create_device() nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro blk-cgroup: properly pin the parent in blkcg_css_online commit bb861c14f1b8cb9cbf03a132db7f22ec4e692b91 Author: Stefan Assmann Date: Thu Nov 10 15:14:44 2022 +0100 iavf: remove INITIAL_MAC_SET to allow gARP to work properly IAVF_FLAG_INITIAL_MAC_SET prevents waiting on iavf_is_mac_set_handled() the first time the MAC is set. This breaks gratuitous ARP because the MAC address has not been updated yet when the gARP packet is sent out. Current behaviour: $ echo 1 > /sys/class/net/ens4f0/device/sriov_numvfs iavf 0000:88:02.0: MAC address: ee:04:19:14:ec:ea $ ip addr add 192.168.1.1/24 dev ens4f0v0 $ ip link set dev ens4f0v0 up $ echo 1 > /proc/sys/net/ipv4/conf/ens4f0v0/arp_notify $ ip link set ens4f0v0 addr 00:11:22:33:44:55 07:23:41.676611 ee:04:19:14:ec:ea > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.1 tell 192.168.1.1, length 28 With IAVF_FLAG_INITIAL_MAC_SET removed: $ echo 1 > /sys/class/net/ens4f0/device/sriov_numvfs iavf 0000:88:02.0: MAC address: 3e:8a:16:a2:37:6d $ ip addr add 192.168.1.1/24 dev ens4f0v0 $ ip link set dev ens4f0v0 up $ echo 1 > /proc/sys/net/ipv4/conf/ens4f0v0/arp_notify $ ip link set ens4f0v0 addr 00:11:22:33:44:55 07:28:01.836608 00:11:22:33:44:55 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.1 tell 192.168.1.1, length 28 Fixes: 35a2443d0910 ("iavf: Add waiting for response from PF in set mac") Signed-off-by: Stefan Assmann Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 08f1c147b7265245d67321585c68a27e990e0c4b Author: Ivan Vecera Date: Tue Nov 8 11:25:02 2022 +0100 iavf: Do not restart Tx queues after reset task failure After commit aa626da947e9 ("iavf: Detach device during reset task") the device is detached during reset task and re-attached at its end. The problem occurs when reset task fails because Tx queues are restarted during device re-attach and this leads later to a crash. To resolve this issue properly close the net device in cause of failure in reset task to avoid restarting of tx queues at the end. Also replace the hacky manipulation with IFF_UP flag by device close that clears properly both IFF_UP and __LINK_STATE_START flags. In these case iavf_close() does not do anything because the adapter state is already __IAVF_DOWN. Reproducer: 1) Run some Tx traffic (e.g. iperf3) over iavf interface 2) Set VF trusted / untrusted in loop [root@host ~]# cat repro.sh PF=enp65s0f0 IF=${PF}v0 ip link set up $IF ip addr add 192.168.0.2/24 dev $IF sleep 1 iperf3 -c 192.168.0.1 -t 600 --logfile /dev/null & sleep 2 while :; do ip link set $PF vf 0 trust on ip link set $PF vf 0 trust off done [root@host ~]# ./repro.sh Result: [ 2006.650969] iavf 0000:41:01.0: Failed to init adminq: -53 [ 2006.675662] ice 0000:41:00.0: VF 0 is now trusted [ 2006.689997] iavf 0000:41:01.0: Reset task did not complete, VF disabled [ 2006.696611] iavf 0000:41:01.0: failed to allocate resources during reinit [ 2006.703209] ice 0000:41:00.0: VF 0 is now untrusted [ 2006.737011] ice 0000:41:00.0: VF 0 is now trusted [ 2006.764536] ice 0000:41:00.0: VF 0 is now untrusted [ 2006.768919] BUG: kernel NULL pointer dereference, address: 0000000000000b4a [ 2006.776358] #PF: supervisor read access in kernel mode [ 2006.781488] #PF: error_code(0x0000) - not-present page [ 2006.786620] PGD 0 P4D 0 [ 2006.789152] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 2006.792903] ice 0000:41:00.0: VF 0 is now trusted [ 2006.793501] CPU: 4 PID: 0 Comm: swapper/4 Kdump: loaded Not tainted 6.1.0-rc3+ #2 [ 2006.805668] Hardware name: Abacus electric, s.r.o. - servis@abacus.cz Super Server/H12SSW-iN, BIOS 2.4 04/13/2022 [ 2006.815915] RIP: 0010:iavf_xmit_frame_ring+0x96/0xf70 [iavf] [ 2006.821028] ice 0000:41:00.0: VF 0 is now untrusted [ 2006.821572] Code: 48 83 c1 04 48 c1 e1 04 48 01 f9 48 83 c0 10 6b 50 f8 55 c1 ea 14 45 8d 64 14 01 48 39 c8 75 eb 41 83 fc 07 0f 8f e9 08 00 00 <0f> b7 45 4a 0f b7 55 48 41 8d 74 24 05 31 c9 66 39 d0 0f 86 da 00 [ 2006.845181] RSP: 0018:ffffb253004bc9e8 EFLAGS: 00010293 [ 2006.850397] RAX: ffff9d154de45b00 RBX: ffff9d15497d52e8 RCX: ffff9d154de45b00 [ 2006.856327] ice 0000:41:00.0: VF 0 is now trusted [ 2006.857523] RDX: 0000000000000000 RSI: 00000000000005a8 RDI: ffff9d154de45ac0 [ 2006.857525] RBP: 0000000000000b00 R08: ffff9d159cb010ac R09: 0000000000000001 [ 2006.857526] R10: ffff9d154de45940 R11: 0000000000000000 R12: 0000000000000002 [ 2006.883600] R13: ffff9d1770838dc0 R14: 0000000000000000 R15: ffffffffc07b8380 [ 2006.885840] ice 0000:41:00.0: VF 0 is now untrusted [ 2006.890725] FS: 0000000000000000(0000) GS:ffff9d248e900000(0000) knlGS:0000000000000000 [ 2006.890727] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2006.909419] CR2: 0000000000000b4a CR3: 0000000c39c10002 CR4: 0000000000770ee0 [ 2006.916543] PKRU: 55555554 [ 2006.918254] ice 0000:41:00.0: VF 0 is now trusted [ 2006.919248] Call Trace: [ 2006.919250] [ 2006.919252] dev_hard_start_xmit+0x9e/0x1f0 [ 2006.932587] sch_direct_xmit+0xa0/0x370 [ 2006.936424] __dev_queue_xmit+0x7af/0xd00 [ 2006.940429] ip_finish_output2+0x26c/0x540 [ 2006.944519] ip_output+0x71/0x110 [ 2006.947831] ? __ip_finish_output+0x2b0/0x2b0 [ 2006.952180] __ip_queue_xmit+0x16d/0x400 [ 2006.952721] ice 0000:41:00.0: VF 0 is now untrusted [ 2006.956098] __tcp_transmit_skb+0xa96/0xbf0 [ 2006.965148] __tcp_retransmit_skb+0x174/0x860 [ 2006.969499] ? cubictcp_cwnd_event+0x40/0x40 [ 2006.973769] tcp_retransmit_skb+0x14/0xb0 ... Fixes: aa626da947e9 ("iavf: Detach device during reset task") Cc: Jacob Keller Cc: Patryk Piotrowski Cc: SlawomirX Laba Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Reviewed-by: Leon Romanovsky Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit c678669d6b13b77de3b99b97526aaf23c3088d0a Author: Ivan Vecera Date: Tue Nov 8 10:35:34 2022 +0100 iavf: Fix a crash during reset task Recent commit aa626da947e9 ("iavf: Detach device during reset task") removed netif_tx_stop_all_queues() with an assumption that Tx queues are already stopped by netif_device_detach() in the beginning of reset task. This assumption is incorrect because during reset task a potential link event can start Tx queues again. Revert this change to fix this issue. Reproducer: 1. Run some Tx traffic (e.g. iperf3) over iavf interface 2. Switch MTU of this interface in a loop [root@host ~]# cat repro.sh IF=enp2s0f0v0 iperf3 -c 192.168.0.1 -t 600 --logfile /dev/null & sleep 2 while :; do for i in 1280 1500 2000 900 ; do ip link set $IF mtu $i sleep 2 done done [root@host ~]# ./repro.sh Result: [ 306.199917] iavf 0000:02:02.0 enp2s0f0v0: NIC Link is Up Speed is 40 Gbps Full Duplex [ 308.205944] iavf 0000:02:02.0 enp2s0f0v0: NIC Link is Up Speed is 40 Gbps Full Duplex [ 310.103223] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 310.110179] #PF: supervisor write access in kernel mode [ 310.115396] #PF: error_code(0x0002) - not-present page [ 310.120526] PGD 0 P4D 0 [ 310.123057] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 310.127408] CPU: 24 PID: 183 Comm: kworker/u64:9 Kdump: loaded Not tainted 6.1.0-rc3+ #2 [ 310.135485] Hardware name: Abacus electric, s.r.o. - servis@abacus.cz Super Server/H12SSW-iN, BIOS 2.4 04/13/2022 [ 310.145728] Workqueue: iavf iavf_reset_task [iavf] [ 310.150520] RIP: 0010:iavf_xmit_frame_ring+0xd1/0xf70 [iavf] [ 310.156180] Code: d0 0f 86 da 00 00 00 83 e8 01 0f b7 fa 29 f8 01 c8 39 c6 0f 8f a0 08 00 00 48 8b 45 20 48 8d 14 92 bf 01 00 00 00 4c 8d 3c d0 <49> 89 5f 08 8b 43 70 66 41 89 7f 14 41 89 47 10 f6 83 82 00 00 00 [ 310.174918] RSP: 0018:ffffbb5f0082caa0 EFLAGS: 00010293 [ 310.180137] RAX: 0000000000000000 RBX: ffff92345471a6e8 RCX: 0000000000000200 [ 310.187259] RDX: 0000000000000000 RSI: 000000000000000d RDI: 0000000000000001 [ 310.194385] RBP: ffff92341d249000 R08: ffff92434987fcac R09: 0000000000000001 [ 310.201509] R10: 0000000011f683b9 R11: 0000000011f50641 R12: 0000000000000008 [ 310.208631] R13: ffff923447500000 R14: 0000000000000000 R15: 0000000000000000 [ 310.215756] FS: 0000000000000000(0000) GS:ffff92434ee00000(0000) knlGS:0000000000000000 [ 310.223835] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 310.229572] CR2: 0000000000000008 CR3: 0000000fbc210004 CR4: 0000000000770ee0 [ 310.236696] PKRU: 55555554 [ 310.239399] Call Trace: [ 310.241844] [ 310.243855] ? dst_alloc+0x5b/0xb0 [ 310.247260] dev_hard_start_xmit+0x9e/0x1f0 [ 310.251439] sch_direct_xmit+0xa0/0x370 [ 310.255276] __qdisc_run+0x13e/0x580 [ 310.258848] __dev_queue_xmit+0x431/0xd00 [ 310.262851] ? selinux_ip_postroute+0x147/0x3f0 [ 310.267377] ip_finish_output2+0x26c/0x540 Fixes: aa626da947e9 ("iavf: Detach device during reset task") Cc: Jacob Keller Cc: Patryk Piotrowski Cc: SlawomirX Laba Signed-off-by: Ivan Vecera Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit b5bf1d8a23a683d56be574a934a8296912efc758 Merge: ab290eaddc4c4 b1010b93fe907 Author: Linus Torvalds Date: Fri Nov 18 13:31:40 2022 -0800 Merge tag 'drm-fixes-2022-11-19' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "I guess the main question is are things settling down, and I'd say kinda, these are all pretty small fixes, nothing big stands out really, just seems to be quite a few of them. Mostly amdgpu and core fixes, with some i915, tegra, vc4, panel bits. core: - Fix potential memory leak in drm_dev_init() - Fix potential null-ptr-deref in drm_vblank_destroy_worker() - Revert hiding unregistered connectors from userspace, as it breaks on DP-MST - Add workaround for DP++ dual mode adaptors that don't support i2c subaddressing i915: - Fix uaf with lmem_userfault_list handling amdgpu: - gang submit fixes - Fix a possible memory leak in ganng submit error path - DP tunneling fixes - DCN 3.1 page flip fix - DCN 3.2.x fixes - DCN 3.1.4 fixes - Don't expose degamma on hardware that doesn't support it - BACO fixes for SMU 11.x - BACO fixes for SMU 13.x - Virtual display fix for devices with no display hardware amdkfd: - Memory limit regression fix tegra: - tegra20 GART fix vc4: - Fix error handling in vc4_atomic_commit_tail() lima: - Set lima's clkname corrrectly when regulator is missing panel: - Set bpc for logictechno panels" * tag 'drm-fixes-2022-11-19' of git://anongit.freedesktop.org/drm/drm: (28 commits) gpu: host1x: Avoid trying to use GART on Tegra20 drm/display: Don't assume dual mode adaptors support i2c sub-addressing drm/amd/pm: fix SMU13 runpm hang due to unintentional workaround drm/amd/pm: enable runpm support over BACO for SMU13.0.7 drm/amd/pm: enable runpm support over BACO for SMU13.0.0 drm/amdgpu: there is no vbios fb on devices with no display hw (v2) drm/amdkfd: Fix a memory limit issue drm/amdgpu: disable BACO support on more cards drm/amd/display: don't enable DRM CRTC degamma property for DCE drm/amd/display: Set max for prefetch lines on dcn32 drm/amd/display: use uclk pstate latency for fw assisted mclk validation dcn32 drm/amd/display: Fix prefetch calculations for dcn32 drm/amd/display: Fix optc2_configure warning on dcn314 drm/amd/display: Fix calculation for cursor CAB allocation Revert "drm: hide unregistered connectors from GETCONNECTOR IOCTL" drm/amd/display: Support parsing VRAM info v3.0 from VBIOS drm/amd/display: Fix invalid DPIA AUX reply causing system hang drm/amdgpu: Add psp_13_0_10_ta firmware to modinfo drm/amd/display: Add HUBP surface flip interrupt handler drm/amd/display: Fix access timeout to DPIA AUX at boot time ... commit ab290eaddc4c41b237b9a366fa6a5527be890b84 Merge: 5556a78c74434 e3c11025bcd21 Author: Linus Torvalds Date: Fri Nov 18 12:30:23 2022 -0800 Merge tag 's390-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix deadlock in discontiguous saved segments (DCSS) block device driver. When adding a disk and scanning partitions the scan would not break out early without a missed flag. - Avoid using global register variable for current_stack_pointer due to an old bug in gcc versions prior to gcc-8.4. Due to this bug a broken code is generated, which leads to stack corruptions. * tag 's390-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: avoid using global register for current_stack_pointer s390/dcssblk: fix deadlock when adding a DCSS commit 5556a78c744347216cff46f20359412445278ac2 Merge: 950a9f564aead 984bf2cc531e7 Author: Linus Torvalds Date: Fri Nov 18 12:23:35 2022 -0800 Merge tag 'for-6.1/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix misbehavior if list_versions DM ioctl races with module loading - Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed - Allow DM integrity devices to be activated in read-only mode * tag 'for-6.1/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm integrity: clear the journal on suspend dm integrity: flush the journal on suspend dm bufio: Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed dm ioctl: fix misbehavior if list_versions races with module loading commit b1010b93fe9074f965ebf86e0e382a8a7a71500d Merge: 585f2bc8fe692 c2418f911a31a Author: Dave Airlie Date: Sat Nov 19 06:15:20 2022 +1000 Merge tag 'drm/tegra/for-6.1-rc6' of https://gitlab.freedesktop.org/drm/tegra into drm-fixes drm/tegra: Fixes for v6.1-rc6 This contains a single fix that avoids using the GART on Tegra20 because it doesn't work well with the way the Tegra DRM driver tries to use it. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20221118121614.3511110-1-thierry.reding@gmail.com commit 950a9f564aeade8f7b263bb8e9646c4c13ffd424 Merge: 12fe29ee259f9 59a51183be1a6 Author: Linus Torvalds Date: Fri Nov 18 12:08:24 2022 -0800 Merge tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are a number of USB driver fixes and new device ids for 6.1-rc6. Included in here are: - new usb-serial device ids - dwc3 driver fixes for reported problems - cdns3 driver fixes - new USB device quirks - typec driver fixes - extcon USB typec driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add u-blox LARA-L6 modem USB: serial: option: add u-blox LARA-R6 00B modem USB: serial: option: remove old LARA-R6 PID USB: serial: option: add Fibocom FM160 0x0111 composition usb: add NO_LPM quirk for Realforce 87U Keyboard usb: cdns3: host: fix endless superspeed hub port reset usb: chipidea: fix deadlock in ci_otg_del_timer usb: dwc3: Do not get extcon device when usb-role-switch is used usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler usb: typec: mux: Enter safe mode only when pins need to be reconfigured extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered Revert "usb: dwc3: disable USB core PHY management" usb: dwc3: gadget: Return -ESHUTDOWN on ep disable USB: bcma: Make GPIO explicitly optional USB: serial: option: add Sierra Wireless EM9191 commit 12fe29ee259f9a14fba4c593eff55b851ef264fe Merge: 09389357e9667 937ec9f7d5f26 Author: Linus Torvalds Date: Fri Nov 18 12:02:38 2022 -0800 Merge tag 'staging-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fix from Greg KH: "Here is a single staging driver fix for 6.1-rc6. It resolves a bogus signed character test as pointed out, and fixed by, Jason in the rtl8192e driver It has been in linux-next for a few weeks now with no reported problems" * tag 'staging-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: rtl8192e: remove bogus ssid character sign test commit 5b47348fc0b18a78c96f8474cc90b7525ad1bbfe Author: Liu Shixin Date: Thu Nov 17 15:56:01 2022 +0800 arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud The page table check trigger BUG_ON() unexpectedly when collapse hugepage: ------------[ cut here ]------------ kernel BUG at mm/page_table_check.c:82! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 6 PID: 68 Comm: khugepaged Not tainted 6.1.0-rc3+ #750 Hardware name: linux,dummy-virt (DT) pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : page_table_check_clear.isra.0+0x258/0x3f0 lr : page_table_check_clear.isra.0+0x240/0x3f0 [...] Call trace: page_table_check_clear.isra.0+0x258/0x3f0 __page_table_check_pmd_clear+0xbc/0x108 pmdp_collapse_flush+0xb0/0x160 collapse_huge_page+0xa08/0x1080 hpage_collapse_scan_pmd+0xf30/0x1590 khugepaged_scan_mm_slot.constprop.0+0x52c/0xac8 khugepaged+0x338/0x518 kthread+0x278/0x2f8 ret_from_fork+0x10/0x20 [...] Since pmd_user_accessible_page() doesn't check if a pmd is leaf, it decrease file_map_count for a non-leaf pmd comes from collapse_huge_page(). and so trigger BUG_ON() unexpectedly. Fix this problem by using pmd_leaf() insteal of pmd_present() in pmd_user_accessible_page(). Moreover, use pud_leaf() for pud_user_accessible_page() too. Fixes: 42b2547137f5 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Reported-by: Denys Vlasenko Signed-off-by: Liu Shixin Reviewed-by: David Hildenbrand Acked-by: Pasha Tatashin Reviewed-by: Kefeng Wang Acked-by: Will Deacon Link: https://lore.kernel.org/r/20221117075602.2904324-2-liushixin2@huawei.com Signed-off-by: Catalin Marinas commit c19083c72ea72a1c12037bb3d708014632df80e4 Author: Jason Ekstrand Date: Tue Aug 2 16:01:58 2022 -0500 dma-buf: Use dma_fence_unwrap_for_each when importing fences Ever since 68129f431faa ("dma-buf: warn about containers in dma_resv object"), dma_resv_add_shared_fence will warn if you attempt to add a container fence. While most drivers were fine, fences can also be added to a dma_resv via the recently added DMA_BUF_IOCTL_IMPORT_SYNC_FILE. Use dma_fence_unwrap_for_each to add each fence one at a time. Fixes: 594740497e99 ("dma-buf: Add an API for importing sync files (v10)") Signed-off-by: Jason Ekstrand Reported-by: Sarah Walker Reviewed-by: Christian König CC: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220802210158.4162525-1-jason.ekstrand@collabora.com Signed-off-by: Christian König commit 09389357e9667be17699b1889134fb7524dc31ba Merge: 63c8c0d7dcb68 3ec17cb325ac7 Author: Linus Torvalds Date: Fri Nov 18 10:59:52 2022 -0800 Merge tag 'tty-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are a number of small tty and serial driver fixes for 6.1-rc6. They all resolve reported problems: - kernel doc build problems with the -rc1 serial driver documentation update - n_gsm reported problems - imx serial driver missing callback - lots of tiny 8250 driver fixes for reported issues. All of these have been in linux-next for over a week with no reported problems" * tag 'tty-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: docs/driver-api/miscellaneous: Remove kernel-doc of serial_core.c serial: 8250: Flush DMA Rx on RLSI serial: 8250_lpss: Use 16B DMA burst with Elkhart Lake serial: 8250_lpss: Configure DMA also w/o DMA filter serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send Revert "tty: n_gsm: replace kicktimer with delayed_work" Revert "tty: n_gsm: avoid call of sleeping functions from atomic context" serial: imx: Add missing .thaw_noirq hook tty: serial: fsl_lpuart: don't break the on-going transfer when global reset serial: 8250: omap: Flush PM QOS work on remove serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove() serial: 8250_omap: remove wait loop from Errata i202 workaround serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl() serial: 8250: 8250_omap: Avoid RS485 RTS glitch on ->set_termios() commit 63c8c0d7dcb687c123ec6dc7e958cd54ebf956b6 Merge: 1f63d1a106e98 1edfe4ea16ca2 Author: Linus Torvalds Date: Fri Nov 18 10:49:53 2022 -0800 Merge tag 'driver-core-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here are two small driver core fixes for 6.1-rc6: - utsname fix, this one should already be in your tree as it came from a different tree earlier. - kernfs bugfix for a much reported syzbot report that seems to keep getting triggered. Both of these have been in linux-next for a while with no reported issues" * tag 'driver-core-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: Fix spurious lockdep warning in kernfs_find_and_get_node_by_id() kernel/utsname_sysctl.c: Add missing enum uts_proc value commit 1f63d1a106e98db5cd378b21a471f7ddd710d1b5 Merge: ae558268371bb 65946690ed8d9 Author: Linus Torvalds Date: Fri Nov 18 10:29:25 2022 -0800 Merge tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are some small char/misc and other driver fixes for 6.1-rc6 to resolve some reported problems. Included in here are: - iio driver fixes - binder driver fix - nvmem driver fix - vme_vmci information leak fix - parport fix - slimbus configuration fix - coreboot firmware bugfix - speakup build fix and crash fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (22 commits) firmware: coreboot: Register bus in module init nvmem: u-boot-env: fix crc32_data_offset on redundant u-boot-env slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m docs: update mediator contact information in CoC doc slimbus: stream: correct presence rate frequencies nvmem: lan9662-otp: Fix compatible string binder: validate alloc->mm in ->mmap() handler parport_pc: Avoid FIFO port location truncation siox: fix possible memory leak in siox_device_add() misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() speakup: replace utils' u_char with unsigned char speakup: fix a segfault caused by switching consoles tools: iio: iio_generic_buffer: Fix read size iio: imu: bno055: uninitialized variable bug in bno055_trigger_handler() iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() iio: adc: mp2629: fix potential array out of bound access iio: adc: mp2629: fix wrong comparison of channel iio: pressure: ms5611: changed hardcoded SPI speed to value limited iio: pressure: ms5611: fixed value compensation bug iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID. ... commit ae558268371bb94da6d885430b910abd4d22eeda Merge: 4ab9ffda3f5a6 1abfd71ee8f3e Author: Linus Torvalds Date: Fri Nov 18 09:52:10 2022 -0800 Merge tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A fair amount of commits at this time due to ASoC PR merge, but all look small and easy, mostly device-specific fixes spanned in various drivers. Hopefully this should be the last big chunk for 6.1" * tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits) ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() ASoC: stm32: dfsdm: manage cb buffers cleanup ASoC: sof_es8336: reduce pop noise on speaker ASoC: SOF: topology: No need to assign core ID if token parsing failed ASoC: soc-utils: Remove __exit for snd_soc_util_exit() ASoC: rt5677: fix legacy dai naming ASoC: rt5514: fix legacy dai naming ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older ASoC: hda: intel-dsp-config: add ES83x6 quirk for IceLake ASoC: Intel: soc-acpi: add ES83x6 support to IceLake ASoC: tas2780: Fix set_tdm_slot in case of single slot ASoC: tas2764: Fix set_tdm_slot in case of single slot ASoC: tas2770: Fix set_tdm_slot in case of single slot ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N ASoC: core: Fix use-after-free in snd_soc_exit() MAINTAINERS: update Tzung-Bi's email address ASoC: Intel: bytcht_es8316: Add quirk for the Nanote UMPC-01 ASoC: amd: yc: Add Alienware m17 R5 AMD into DMI table ... commit 4ab9ffda3f5a6f6964507f5b1b378a475caea27a Merge: 84368d882b968 222cfa0118aa6 Author: Linus Torvalds Date: Fri Nov 18 09:43:30 2022 -0800 Merge tag 'mmc-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fixup VDD/VMMC voltage-range negotiation MMC host: - sdhci-pci: Fix memory leak by adding a missing pci_dev_put() - sdhci-pci-o2micro: Fix card detect by tuning the debounce timeout" * tag 'mmc-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout mmc: core: properly select voltage range without power cycle commit b09d6acba1d9a23963fedf96b4191502a4fec25d Author: Christian König Date: Fri Nov 18 13:32:30 2022 +0100 drm/amdgpu: handle gang submit before VMID Otherwise it can happen that not all gang members can get a VMID assigned and we deadlock. Signed-off-by: Christian König Tested-by: Timur Kristóf Acked-by: Timur Kristóf Fixes: 68ce8b242242 ("drm/amdgpu: add gang submit backend v2") Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221118153023.312582-1-christian.koenig@amd.com commit 7fdbc5f014c3f71bc44673a2d6c5bb2d12d45f25 Author: Pavel Begunkov Date: Fri Nov 18 15:41:41 2022 +0000 io_uring: disallow self-propelled ring polling When we post a CQE we wake all ring pollers as it normally should be. However, if a CQE was generated by a multishot poll request targeting its own ring, it'll wake that request up, which will make it to post a new CQE, which will wake the request and so on until it exhausts all CQ entries. Don't allow multishot polling io_uring files but downgrade them to oneshots, which was always stated as a correct behaviour that the userspace should check for. Cc: stable@vger.kernel.org Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3124038c0e7474d427538c2d915335ec28c92d21.1668785722.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 984bf2cc531e778e49298fdf6730e0396166aa21 Author: Mikulas Patocka Date: Tue Nov 15 12:51:50 2022 -0500 dm integrity: clear the journal on suspend There was a problem that a user burned a dm-integrity image on CDROM and could not activate it because it had a non-empty journal. Fix this problem by flushing the journal (done by the previous commit) and clearing the journal (done by this commit). Once the journal is cleared, dm-integrity won't attempt to replay it on the next activation. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 5e5dab5ec763d600fe0a67837dd9155bdc42f961 Author: Mikulas Patocka Date: Tue Nov 15 12:48:26 2022 -0500 dm integrity: flush the journal on suspend This commit flushes the journal on suspend. It is prerequisite for the next commit that enables activating dm integrity devices in read-only mode. Note that we deliberately didn't flush the journal on suspend, so that the journal replay code would be tested. However, the dm-integrity code is 5 years old now, so that journal replay is well-tested, and we can make this change now. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 0dfc1f4ceae86a0d09d880ab87625c86c61ed33c Author: Zhihao Cheng Date: Fri Nov 11 20:10:27 2022 +0800 dm bufio: Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed The 'no_sleep_enabled' should be decreased in error handling path in dm_bufio_client_create() when the DM_BUFIO_CLIENT_NO_SLEEP flag is set, otherwise static_branch_unlikely() will always return true even if no dm_bufio_client instances have DM_BUFIO_CLIENT_NO_SLEEP flag set. Cc: stable@vger.kernel.org Fixes: 3c1c875d0586 ("dm bufio: conditionally enable branching for DM_BUFIO_CLIENT_NO_SLEEP") Signed-off-by: Zhihao Cheng Signed-off-by: Mike Snitzer commit 4fe1ec995483737f3d2a14c3fe1d8fe634972979 Author: Mikulas Patocka Date: Tue Nov 1 16:53:35 2022 -0400 dm ioctl: fix misbehavior if list_versions races with module loading __list_versions will first estimate the required space using the "dm_target_iterate(list_version_get_needed, &needed)" call and then will fill the space using the "dm_target_iterate(list_version_get_info, &iter_info)" call. Each of these calls locks the targets using the "down_read(&_lock)" and "up_read(&_lock)" calls, however between the first and second "dm_target_iterate" there is no lock held and the target modules can be loaded at this point, so the second "dm_target_iterate" call may need more space than what was the first "dm_target_iterate" returned. The code tries to handle this overflow (see the beginning of list_version_get_info), however this handling is incorrect. The code sets "param->data_size = param->data_start + needed" and "iter_info.end = (char *)vers+len" - "needed" is the size returned by the first dm_target_iterate call; "len" is the size of the buffer allocated by userspace. "len" may be greater than "needed"; in this case, the code will write up to "len" bytes into the buffer, however param->data_size is set to "needed", so it may write data past the param->data_size value. The ioctl interface copies only up to param->data_size into userspace, thus part of the result will be truncated. Fix this bug by setting "iter_info.end = (char *)vers + needed;" - this guarantees that the second "dm_target_iterate" call will write only up to the "needed" buffer and it will exit with "DM_BUFFER_FULL_FLAG" if it overflows the "needed" space - in this case, userspace will allocate a larger buffer and retry. Note that there is also a bug in list_version_get_needed - we need to add "strlen(tt->name) + 1" to the needed size, not "strlen(tt->name)". Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 5c59789ce7ce994e1d9db1973a21f15481bd8513 Merge: 50a893359cd26 0a52566279b4e Author: Jens Axboe Date: Fri Nov 18 07:47:54 2022 -0700 Merge tag 'nvme-6.1-2022-11-18' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - two more bogus nid quirks (Bean Huo, Tiago Dias Ferreira) - memory leak fix in nvmet (Sagi Grimberg)" * tag 'nvme-6.1-2022-11-18' of git://git.infradead.org/nvme: nvmet: fix a memory leak in nvmet_auth_set_key nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000 nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro commit 33c7aba0b4ffd6d7cdab862a034eb582a5120a38 Author: Pablo Neira Ayuso Date: Mon Nov 14 11:31:54 2022 +0100 netfilter: nf_tables: do not set up extensions for end interval Elements with an end interval flag set on do not store extensions. The global set definition is currently setting on the timeout and stateful expression for end interval elements. This leads to skipping end interval elements from the set->ops->walk() path as the expired check bogusly reports true. Moreover, do not set up stateful expressions for elements with end interval flag set on since this is never used. Fixes: 65038428b2c6 ("netfilter: nf_tables: allow to specify stateful expression in set definition") Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support") Signed-off-by: Pablo Neira Ayuso commit 52d1aa8b8249ff477aaa38b6f74a8ced780d079c Author: Daniel Xu Date: Wed Nov 9 12:39:07 2022 -0700 netfilter: conntrack: Fix data-races around ct mark nf_conn:mark can be read from and written to in parallel. Use READ_ONCE()/WRITE_ONCE() for reads and writes to prevent unwanted compiler optimizations. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Daniel Xu Signed-off-by: Pablo Neira Ayuso commit 0b24dfa587c6cc7484cfb170da5c7dd73451f670 Author: Konrad Dybcio Date: Fri Nov 18 14:10:35 2022 +0100 regulator: slg51000: Wait after asserting CS pin Sony's downstream driver [1], among some other changes, adds a seemingly random 10ms usleep_range, which turned out to be necessary for the hardware to function properly on at least Sony Xperia 1 IV. Without this, I2C transactions with the SLG51000 straight up fail. Relax (10-10ms -> 10-11ms) and add the aforementioned sleep to make sure the hardware has some time to wake up. (nagara-2.0.0-mlc/vendor/semc/hardware/camera-kernel-module/) [1] https://developer.sony.com/file/download/open-source-archive-for-64-0-m-4-29/ Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20221118131035.54874-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown commit 6854fadbeee10891ed74246bdc05031906b6c8cf Author: GUO Zihua Date: Thu Nov 17 17:11:59 2022 +0800 9p/fd: Use P9_HDRSZ for header size Cleanup hardcoded header sizes to use P9_HDRSZ instead of '7' Link: https://lkml.kernel.org/r/20221117091159.31533-4-guozihua@huawei.com Signed-off-by: GUO Zihua Reviewed-by: Christian Schoenebeck [Dominique: commit message adjusted to make sense after offset size adjustment got removed] Signed-off-by: Dominique Martinet commit 578b565b240afdfe0596d183f473f333eb9d3008 Author: GUO Zihua Date: Thu Nov 17 17:11:57 2022 +0800 9p/fd: Fix write overflow in p9_read_work This error was reported while fuzzing: BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0xd35/0x1190 Write of size 4043 at addr ffff888008724eb1 by task kworker/1:1/24 CPU: 1 PID: 24 Comm: kworker/1:1 Not tainted 6.1.0-rc5-00002-g1adf73218daa-dirty #223 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Workqueue: events p9_read_work Call Trace: dump_stack_lvl+0x4c/0x64 print_report+0x178/0x4b0 kasan_report+0xae/0x130 kasan_check_range+0x179/0x1e0 memcpy+0x38/0x60 _copy_to_iter+0xd35/0x1190 copy_page_to_iter+0x1d5/0xb00 pipe_read+0x3a1/0xd90 __kernel_read+0x2a5/0x760 kernel_read+0x47/0x60 p9_read_work+0x463/0x780 process_one_work+0x91d/0x1300 worker_thread+0x8c/0x1210 kthread+0x280/0x330 ret_from_fork+0x22/0x30 Allocated by task 457: kasan_save_stack+0x1c/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0x7e/0x90 __kmalloc+0x59/0x140 p9_fcall_init.isra.11+0x5d/0x1c0 p9_tag_alloc+0x251/0x550 p9_client_prepare_req+0x162/0x350 p9_client_rpc+0x18d/0xa90 p9_client_create+0x670/0x14e0 v9fs_session_init+0x1fd/0x14f0 v9fs_mount+0xd7/0xaf0 legacy_get_tree+0xf3/0x1f0 vfs_get_tree+0x86/0x2c0 path_mount+0x885/0x1940 do_mount+0xec/0x100 __x64_sys_mount+0x1a0/0x1e0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd This BUG pops up when trying to reproduce https://syzkaller.appspot.com/bug?id=6c7cd46c7bdd0e86f95d26ec3153208ad186f9fa The callstack is different but the issue is valid and re-producable with the same re-producer in the link. The root cause of this issue is that we check the size of the message received against the msize of the client in p9_read_work. However, it turns out that capacity is no longer consistent with msize. Thus, the message size should be checked against sdata capacity. As the msize is non-consistant with the capacity of the tag and as we are now checking message size against capacity directly, there is no point checking message size against msize. So remove it. Link: https://lkml.kernel.org/r/20221117091159.31533-2-guozihua@huawei.com Link: https://lkml.kernel.org/r/20221117091159.31533-3-guozihua@huawei.com Reported-by: syzbot+0f89bd13eaceccc0e126@syzkaller.appspotmail.com Fixes: 60ece0833b6c ("net/9p: allocate appropriate reduced message buffers") Signed-off-by: GUO Zihua Reviewed-by: Christian Schoenebeck [Dominique: squash patches 1 & 2 and fix size including header part] Signed-off-by: Dominique Martinet commit 11c10956515b8ec44cf4f2a7b9d8bf8b9dc05ec4 Author: Zhengchao Shao Date: Thu Nov 10 20:26:06 2022 +0800 9p/fd: fix issue of list_del corruption in p9_fd_cancel() Syz reported the following issue: kernel BUG at lib/list_debug.c:53! invalid opcode: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:__list_del_entry_valid.cold+0x5c/0x72 Call Trace: p9_fd_cancel+0xb1/0x270 p9_client_rpc+0x8ea/0xba0 p9_client_create+0x9c0/0xed0 v9fs_session_init+0x1e0/0x1620 v9fs_mount+0xba/0xb80 legacy_get_tree+0x103/0x200 vfs_get_tree+0x89/0x2d0 path_mount+0x4c0/0x1ac0 __x64_sys_mount+0x33b/0x430 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The process is as follows: Thread A: Thread B: p9_poll_workfn() p9_client_create() ... ... p9_conn_cancel() p9_fd_cancel() list_del() ... ... list_del() //list_del corruption There is no lock protection when deleting list in p9_conn_cancel(). After deleting list in Thread A, thread B will delete the same list again. It will cause issue of list_del corruption. Setting req->status to REQ_STATUS_ERROR under lock prevents other cleanup paths from trying to manipulate req_list. The other thread can safely check req->status because it still holds a reference to req at this point. Link: https://lkml.kernel.org/r/20221110122606.383352-1-shaozhengchao@huawei.com Fixes: 52f1c45dde91 ("9p: trans_fd/p9_conn_cancel: drop client lock earlier") Reported-by: syzbot+9b69b8d10ab4a7d88056@syzkaller.appspotmail.com Signed-off-by: Zhengchao Shao [Dominique: add description of the fix in commit message] Signed-off-by: Dominique Martinet commit 2360f9b8c4e81d242d4cbf99d630a2fffa681fab Author: Wang Hai Date: Thu Nov 17 14:55:27 2022 +0800 net: pch_gbe: fix potential memleak in pch_gbe_tx_queue() In pch_gbe_xmit_frame(), NETDEV_TX_OK will be returned whether pch_gbe_tx_queue() sends data successfully or not, so pch_gbe_tx_queue() needs to free skb before returning. But pch_gbe_tx_queue() returns without freeing skb in case of dma_map_single() fails. Add dev_kfree_skb_any() to fix it. Fixes: 77555ee72282 ("net: Add Gigabit Ethernet driver of Topcliff PCH") Signed-off-by: Wang Hai Signed-off-by: David S. Miller commit 0ad6bded175e829c2ca261529c9dce39a32a042d Author: Lin Ma Date: Wed Nov 16 21:02:49 2022 +0800 nfc/nci: fix race with opening and closing Previously we leverage NCI_UNREG and the lock inside nci_close_device to prevent the race condition between opening a device and closing a device. However, it still has problem because a failed opening command will erase the NCI_UNREG flag and allow another opening command to bypass the status checking. This fix corrects that by making sure the NCI_UNREG is held. Reported-by: syzbot+43475bf3cfbd6e41f5b7@syzkaller.appspotmail.com Fixes: 48b71a9e66c2 ("NFC: add NCI_UNREG flag to eliminate the race") Signed-off-by: Lin Ma Signed-off-by: David S. Miller commit 24deec6b9e4a051635f75777844ffc184644fec9 Author: Vladimir Oltean Date: Wed Nov 16 12:06:53 2022 +0200 net: dsa: sja1105: disallow C45 transactions on the BASE-TX MDIO bus You'd think people know that the internal 100BASE-TX PHY on the SJA1110 responds only to clause 22 MDIO transactions, but they don't :) When a clause 45 transaction is attempted, sja1105_base_tx_mdio_read() and sja1105_base_tx_mdio_write() don't expect "reg" to contain bit 30 set (MII_ADDR_C45) and pack this value into the SPI transaction buffer. But the field in the SPI buffer has a width smaller than 30 bits, so we see this confusing message from the packing() API rather than a proper rejection of C45 transactions: Call trace: dump_stack+0x1c/0x38 sja1105_pack+0xbc/0xc0 [sja1105] sja1105_xfer+0x114/0x2b0 [sja1105] sja1105_xfer_u32+0x44/0xf4 [sja1105] sja1105_base_tx_mdio_read+0x44/0x7c [sja1105] mdiobus_read+0x44/0x80 get_phy_c45_ids+0x70/0x234 get_phy_device+0x68/0x15c fwnode_mdiobus_register_phy+0x74/0x240 of_mdiobus_register+0x13c/0x380 sja1105_mdiobus_register+0x368/0x490 [sja1105] sja1105_setup+0x94/0x119c [sja1105] Cannot store 401d2405 inside bits 24-4 (would truncate) Fixes: 5a8f09748ee7 ("net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3bcd6c7eaa53b56c3f584da46a1f7652e759d0e5 Author: David Howells Date: Wed Nov 16 14:02:28 2022 +0000 rxrpc: Fix race between conn bundle lookup and bundle removal [ZDI-CAN-15975] After rxrpc_unbundle_conn() has removed a connection from a bundle, it checks to see if there are any conns with available channels and, if not, removes and attempts to destroy the bundle. Whilst it does check after grabbing client_bundles_lock that there are no connections attached, this races with rxrpc_look_up_bundle() retrieving the bundle, but not attaching a connection for the connection to be attached later. There is therefore a window in which the bundle can get destroyed before we manage to attach a new connection to it. Fix this by adding an "active" counter to struct rxrpc_bundle: (1) rxrpc_connect_call() obtains an active count by prepping/looking up a bundle and ditches it before returning. (2) If, during rxrpc_connect_call(), a connection is added to the bundle, this obtains an active count, which is held until the connection is discarded. (3) rxrpc_deactivate_bundle() is created to drop an active count on a bundle and destroy it when the active count reaches 0. The active count is checked inside client_bundles_lock() to prevent a race with rxrpc_look_up_bundle(). (4) rxrpc_unbundle_conn() then calls rxrpc_deactivate_bundle(). Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager") Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-15975 Signed-off-by: David Howells Tested-by: zdi-disclosures@trendmicro.com cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 302e57f809be8b678d1ab0b2634504d5d51a166d Author: Wang Yufen Date: Thu Nov 17 10:45:03 2022 +0800 selftests/net: fix missing xdp_dummy After commit afef88e65554 ("selftests/bpf: Store BPF object files with .bpf.o extension"), we should use xdp_dummy.bpf.o instade of xdp_dummy.o. In addition, use the BPF_FILE variable to save the BPF object file name, which can be better identified and modified. Fixes: afef88e65554 ("selftests/bpf: Store BPF object files with .bpf.o extension") Signed-off-by: Wang Yufen Cc: Daniel Müller Signed-off-by: David S. Miller commit e85e9e0d8cb759013d6474011c227f92e442d746 Author: Marc Kleine-Budde Date: Wed Nov 16 17:49:30 2022 +0100 spi: spi-imx: spi_imx_transfer_one(): check for DMA transfer first The SPI framework checks for each transfer (with the struct spi_controller::can_dma callback) whether the driver wants to use DMA for the transfer. If the driver returns true, the SPI framework will map the transfer's data to the device, start the actual transfer and map the data back. In commit 07e759387788 ("spi: spi-imx: add PIO polling support") the spi-imx driver's spi_imx_transfer_one() function was extended. If the estimated duration of a transfer does not exceed a configurable duration, a polling transfer function is used. This check happens before checking if the driver decided earlier for a DMA transfer. If spi_imx_can_dma() decided to use a DMA transfer, and the user configured a big maximum polling duration, a polling transfer will be used. The DMA unmap after the transfer destroys the transferred data. To fix this problem check in spi_imx_transfer_one() if the driver decided for DMA transfer first, then check the limits for a polling transfer. Fixes: 07e759387788 ("spi: spi-imx: add PIO polling support") Link: https://lore.kernel.org/all/20221111003032.82371-1-festevam@gmail.com Reported-by: Frieder Schrempf Reported-by: Fabio Estevam Tested-by: Fabio Estevam Cc: David Jander Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Link: https://lore.kernel.org/r/20221116164930.855362-1-mkl@pengutronix.de Signed-off-by: Mark Brown commit f5f8ad3fcdc49e4d794973007525ed864f93f3fb Author: Pierre-Louis Bossart Date: Thu Nov 17 17:21:20 2022 -0600 ASoC: SOF: dai: move AMD_HS to end of list to restore backwards-compatibility The addition of AMD_HS breaks Mediatek platforms by using an index previously allocated to Mediatek. This is a backwards-compatibility issue and needs to be fixed. All firmware released by AMD needs to be re-generated and re-distributed. Fixes: ed2562c64b4f ("ASoC: SOF: Adding amd HS functionality to the sof core") Link: https://github.com/thesofproject/sof/issues/6615 Link: https://lore.kernel.org/alsa-devel/36a45c7a-820a-7675-d740-c0e83ae2c417@collabora.com/ Reported-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Baluta Reviewed-by: Basavaraj Hiregoudar Reviewed-by: V sujith kumar Reddy Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20221117232120.112639-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 40b9d1ab63f5c4f3cb69450044d07b45e5af72e1 Author: Mahesh Bandewar Date: Tue Nov 15 17:19:14 2022 -0800 ipvlan: hold lower dev to avoid possible use-after-free Recently syzkaller discovered the issue of disappearing lower device (NETDEV_UNREGISTER) while the virtual device (like macvlan) is still having it as a lower device. So it's just a matter of time similar discovery will be made for IPvlan device setup. So fixing it preemptively. Also while at it, add a refcount tracker. Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Mahesh Bandewar Signed-off-by: David S. Miller commit 8207f253a097fe15c93d85ac15ebb73c5e39e1e1 Author: Thomas Zeitlhofer Date: Tue Nov 15 23:09:41 2022 +0100 net: neigh: decrement the family specific qlen Commit 0ff4eb3d5ebb ("neighbour: make proxy_queue.qlen limit per-device") introduced the length counter qlen in struct neigh_parms. There are separate neigh_parms instances for IPv4/ARP and IPv6/ND, and while the family specific qlen is incremented in pneigh_enqueue(), the mentioned commit decrements always the IPv4/ARP specific qlen, regardless of the currently processed family, in pneigh_queue_purge() and neigh_proxy_process(). As a result, with IPv6/ND, the family specific qlen is only incremented (and never decremented) until it exceeds PROXY_QLEN, and then, according to the check in pneigh_enqueue(), neighbor solicitations are not answered anymore. As an example, this is noted when using the subnet-router anycast address to access a Linux router. After a certain amount of time (in the observed case, qlen exceeded PROXY_QLEN after two days), the Linux router stops answering neighbor solicitations for its subnet-router anycast address and effectively becomes unreachable. Another result with IPv6/ND is that the IPv4/ARP specific qlen is decremented more often than incremented. This leads to negative qlen values, as a signed integer has been used for the length counter qlen, and potentially to an integer overflow. Fix this by introducing the helper function neigh_parms_qlen_dec(), which decrements the family specific qlen. Thereby, make use of the existing helper function neigh_get_dev_parms_rcu(), whose definition therefore needs to be placed earlier in neighbour.c. Take the family member from struct neigh_table to determine the currently processed family and appropriately call neigh_parms_qlen_dec() from pneigh_queue_purge() and neigh_proxy_process(). Additionally, use an unsigned integer for the length counter qlen. Fixes: 0ff4eb3d5ebb ("neighbour: make proxy_queue.qlen limit per-device") Signed-off-by: Thomas Zeitlhofer Signed-off-by: David S. Miller commit 733d4bbf9514890eb53ebe75827bf1fb4fd25ebe Author: Leon Romanovsky Date: Tue Nov 15 19:34:39 2022 +0200 net: liquidio: simplify if expression Fix the warning reported by kbuild: cocci warnings: (new ones prefixed by >>) >> drivers/net/ethernet/cavium/liquidio/lio_main.c:1797:54-56: WARNING !A || A && B is equivalent to !A || B drivers/net/ethernet/cavium/liquidio/lio_main.c:1827:54-56: WARNING !A || A && B is equivalent to !A || B Fixes: 8979f428a4af ("net: liquidio: release resources when liquidio driver open failed") Reported-by: kernel test robot Signed-off-by: Leon Romanovsky Reviewed-by: Saeed Mahameed Signed-off-by: David S. Miller commit 489d144563f23911262a652234b80c70c89c978b Author: Christian Löhle Date: Thu Nov 17 14:42:09 2022 +0000 mmc: core: Fix ambiguous TRIM and DISCARD arg Clean up the MMC_TRIM_ARGS define that became ambiguous with DISCARD introduction. While at it, let's fix one usage where MMC_TRIM_ARGS falsely included DISCARD too. Fixes: b3bf915308ca ("mmc: core: new discard feature support at eMMC v4.5") Signed-off-by: Christian Loehle Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/11376b5714964345908f3990f17e0701@hyperstone.com Signed-off-by: Ulf Hansson commit c2418f911a31a266af4fbaca998dc73d3676475a Author: Robin Murphy Date: Thu Oct 20 15:23:40 2022 +0100 gpu: host1x: Avoid trying to use GART on Tegra20 Since commit c7e3ca515e78 ("iommu/tegra: gart: Do not register with bus") quite some time ago, the GART driver has effectively disabled itself to avoid issues with the GPU driver expecting it to work in ways that it doesn't. As of commit 57365a04c921 ("iommu: Move bus setup to IOMMU device registration") that bodge no longer works, but really the GPU driver should be responsible for its own behaviour anyway. Make the workaround explicit. Reported-by: Jon Hunter Suggested-by: Dmitry Osipenko Signed-off-by: Robin Murphy Tested-by: Jon Hunter Signed-off-by: Thierry Reding commit 11b64a466c957e9e02c073b92a58639e96104181 Merge: 847ccab8fdcf4 3de88b95c4d43 Author: Jakub Kicinski Date: Thu Nov 17 21:47:25 2022 -0800 Merge branch 'mptcp-selftests-fix-timeouts-and-test-isolation' Mat Martineau says: ==================== mptcp: selftests: Fix timeouts and test isolation Patches 1 and 3 adjust test timeouts to reduce false negatives on slow machines. Patch 2 improves test isolation by running the mptcp_sockopt test in its own net namespace. ==================== Link: https://lore.kernel.org/r/20221115221046.20370-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 3de88b95c4d436d78afc0266a0bed76c35ddeb62 Author: Matthieu Baerts Date: Tue Nov 15 14:10:46 2022 -0800 selftests: mptcp: fix mibit vs mbit mix up The estimated time was supposing the rate was expressed in mibit (bit * 1024^2) but it is in mbit (bit * 1000^2). This makes the threshold higher but in a more realistic way to avoid false positives reported by CI instances. Before this patch, the thresholds were at 7561/4005ms and now they are at 7906/4178ms. While at it, also fix a typo in the linked comment, spotted by Mat. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/310 Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests") Suggested-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 7e68d31020f18f8d695d5f143fc16cdaa96166cb Author: Matthieu Baerts Date: Tue Nov 15 14:10:45 2022 -0800 selftests: mptcp: run mptcp_sockopt from a new netns Not running it from a new netns causes issues if some MPTCP settings are modified, e.g. if MPTCP is disabled from the sysctl knob, if multiple addresses are available and added to the MPTCP path-manager, etc. In these cases, the created connection will not behave as expected, e.g. unable to create an MPTCP socket, more than one subflow is seen, etc. A new "sandbox" net namespace is now created and used to run mptcp_sockopt from this controlled environment. Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases") Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 22b29557aef3c9d673c887911b504c6d47009de4 Author: Paolo Abeni Date: Tue Nov 15 14:10:44 2022 -0800 selftests: mptcp: gives slow test-case more time On slow or busy VM, some test-cases still fail because the data transfer completes before the endpoint manipulation actually took effect. Address the issue by artificially increasing the runtime for the relevant test-cases. Fixes: ef360019db40 ("selftests: mptcp: signal addresses testcases") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/309 Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 067df9e0ad48a97382ab2179bbe773a13a846028 Author: Zheng Yejian Date: Mon Nov 14 18:46:32 2022 +0800 tracing: Fix potential null-pointer-access of entry in list 'tr->err_log' Entries in list 'tr->err_log' will be reused after entry number exceed TRACING_LOG_ERRS_MAX. The cmd string of the to be reused entry will be freed first then allocated a new one. If the allocation failed, then the entry will still be in list 'tr->err_log' but its 'cmd' field is set to be NULL, later access of 'cmd' is risky. Currently above problem can cause the loss of 'cmd' information of first entry in 'tr->err_log'. When execute `cat /sys/kernel/tracing/error_log`, reproduce logs like: [ 37.495100] trace_kprobe: error: Maxactive is not for kprobe(null) ^ [ 38.412517] trace_kprobe: error: Maxactive is not for kprobe Command: p4:myprobe2 do_sys_openat2 ^ Link: https://lore.kernel.org/linux-trace-kernel/20221114104632.3547266-1-zhengyejian1@huawei.com Fixes: 1581a884b7ca ("tracing: Remove size restriction on tracing_log_err cmd strings") Signed-off-by: Zheng Yejian Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit b8752064e30697e3982418f4274cc63cfc6f3027 Author: Qiujun Huang Date: Fri Nov 18 00:44:35 2022 +0800 tracing: Remove unused __bad_type_size() method __bad_type_size() is unused after commit 04ae87a52074("ftrace: Rework event_create_dir()"). So, remove it. Link: https://lkml.kernel.org/r/D062EC2E-7DB7-4402-A67E-33C3577F551E@gmail.com Acked-by: Masami Hiramatsu (Google) Signed-off-by: Qiujun Huang Signed-off-by: Steven Rostedt (Google) commit 40adaf51cb318131073d1ba8233d473cc105ecbf Author: Masami Hiramatsu (Google) Date: Fri Nov 18 10:15:34 2022 +0900 tracing/eprobe: Fix eprobe filter to make a filter correctly Since the eprobe filter was defined based on the eprobe's trace event itself, it doesn't work correctly. Use the original trace event of the eprobe when making the filter so that the filter works correctly. Without this fix: # echo 'e syscalls/sys_enter_openat \ flags_rename=$flags:u32 if flags < 1000' >> dynamic_events # echo 1 > events/eprobes/sys_enter_openat/enable [ 114.551550] event trace: Could not enable event sys_enter_openat -bash: echo: write error: Invalid argument With this fix: # echo 'e syscalls/sys_enter_openat \ flags_rename=$flags:u32 if flags < 1000' >> dynamic_events # echo 1 > events/eprobes/sys_enter_openat/enable # tail trace cat-241 [000] ...1. 266.498449: sys_enter_openat: (syscalls.sys_enter_openat) flags_rename=0 cat-242 [000] ...1. 266.977640: sys_enter_openat: (syscalls.sys_enter_openat) flags_rename=0 Link: https://lore.kernel.org/all/166823166395.1385292.8931770640212414483.stgit@devnote3/ Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support") Reported-by: Rafael Mendonca Tested-by: Rafael Mendonca Signed-off-by: Masami Hiramatsu (Google) commit 342a4a2f99431ee3c72ef5cfff6449ccf2abd346 Author: Rafael Mendonca Date: Fri Nov 18 10:15:34 2022 +0900 tracing/eprobe: Fix warning in filter creation The filter pointer (filterp) passed to create_filter() function must be a pointer that references a NULL pointer, otherwise, we get a warning when adding a filter option to the event probe: root@localhost:/sys/kernel/tracing# echo 'e:egroup/stat_runtime_4core sched/sched_stat_runtime \ runtime=$runtime:u32 if cpu < 4' >> dynamic_events [ 5034.340439] ------------[ cut here ]------------ [ 5034.341258] WARNING: CPU: 0 PID: 223 at kernel/trace/trace_events_filter.c:1939 create_filter+0x1db/0x250 [...] stripped [ 5034.345518] RIP: 0010:create_filter+0x1db/0x250 [...] stripped [ 5034.351604] Call Trace: [ 5034.351803] [ 5034.351959] ? process_preds+0x1b40/0x1b40 [ 5034.352241] ? rcu_read_lock_bh_held+0xd0/0xd0 [ 5034.352604] ? kasan_set_track+0x29/0x40 [ 5034.352904] ? kasan_save_alloc_info+0x1f/0x30 [ 5034.353264] create_event_filter+0x38/0x50 [ 5034.353573] __trace_eprobe_create+0x16f4/0x1d20 [ 5034.353964] ? eprobe_dyn_event_release+0x360/0x360 [ 5034.354363] ? mark_held_locks+0xa6/0xf0 [ 5034.354684] ? _raw_spin_unlock_irqrestore+0x35/0x60 [ 5034.355105] ? trace_hardirqs_on+0x41/0x120 [ 5034.355417] ? _raw_spin_unlock_irqrestore+0x35/0x60 [ 5034.355751] ? __create_object+0x5b7/0xcf0 [ 5034.356027] ? lock_is_held_type+0xaf/0x120 [ 5034.356362] ? rcu_read_lock_bh_held+0xb0/0xd0 [ 5034.356716] ? rcu_read_lock_bh_held+0xd0/0xd0 [ 5034.357084] ? kasan_set_track+0x29/0x40 [ 5034.357411] ? kasan_save_alloc_info+0x1f/0x30 [ 5034.357715] ? __kasan_kmalloc+0xb8/0xc0 [ 5034.357985] ? write_comp_data+0x2f/0x90 [ 5034.358302] ? __sanitizer_cov_trace_pc+0x25/0x60 [ 5034.358691] ? argv_split+0x381/0x460 [ 5034.358949] ? write_comp_data+0x2f/0x90 [ 5034.359240] ? eprobe_dyn_event_release+0x360/0x360 [ 5034.359620] trace_probe_create+0xf6/0x110 [ 5034.359940] ? trace_probe_match_command_args+0x240/0x240 [ 5034.360376] eprobe_dyn_event_create+0x21/0x30 [ 5034.360709] create_dyn_event+0xf3/0x1a0 [ 5034.360983] trace_parse_run_command+0x1a9/0x2e0 [ 5034.361297] ? dyn_event_release+0x500/0x500 [ 5034.361591] dyn_event_write+0x39/0x50 [ 5034.361851] vfs_write+0x311/0xe50 [ 5034.362091] ? dyn_event_seq_next+0x40/0x40 [ 5034.362376] ? kernel_write+0x5b0/0x5b0 [ 5034.362637] ? write_comp_data+0x2f/0x90 [ 5034.362937] ? __sanitizer_cov_trace_pc+0x25/0x60 [ 5034.363258] ? ftrace_syscall_enter+0x544/0x840 [ 5034.363563] ? write_comp_data+0x2f/0x90 [ 5034.363837] ? __sanitizer_cov_trace_pc+0x25/0x60 [ 5034.364156] ? write_comp_data+0x2f/0x90 [ 5034.364468] ? write_comp_data+0x2f/0x90 [ 5034.364770] ksys_write+0x158/0x2a0 [ 5034.365022] ? __ia32_sys_read+0xc0/0xc0 [ 5034.365344] __x64_sys_write+0x7c/0xc0 [ 5034.365669] ? syscall_enter_from_user_mode+0x53/0x70 [ 5034.366084] do_syscall_64+0x60/0x90 [ 5034.366356] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 5034.366767] RIP: 0033:0x7ff0b43938f3 [...] stripped [ 5034.371892] [ 5034.374720] ---[ end trace 0000000000000000 ]--- Link: https://lore.kernel.org/all/20221108202148.1020111-1-rafaelmendsr@gmail.com/ Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support") Signed-off-by: Rafael Mendonca Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 5dd7caf0bdc5d0bae7cf9776b4d739fb09bd5ebb Author: Li Huafei Date: Fri Nov 18 10:15:34 2022 +0900 kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case In __unregister_kprobe_top(), if the currently unregistered probe has post_handler but other child probes of the aggrprobe do not have post_handler, the post_handler of the aggrprobe is cleared. If this is a ftrace-based probe, there is a problem. In later calls to disarm_kprobe(), we will use kprobe_ftrace_ops because post_handler is NULL. But we're armed with kprobe_ipmodify_ops. This triggers a WARN in __disarm_kprobe_ftrace() and may even cause use-after-free: Failed to disarm kprobe-ftrace at kernel_clone+0x0/0x3c0 (error -2) WARNING: CPU: 5 PID: 137 at kernel/kprobes.c:1135 __disarm_kprobe_ftrace.isra.21+0xcf/0xe0 Modules linked in: testKprobe_007(-) CPU: 5 PID: 137 Comm: rmmod Not tainted 6.1.0-rc4-dirty #18 [...] Call Trace: __disable_kprobe+0xcd/0xe0 __unregister_kprobe_top+0x12/0x150 ? mutex_lock+0xe/0x30 unregister_kprobes.part.23+0x31/0xa0 unregister_kprobe+0x32/0x40 __x64_sys_delete_module+0x15e/0x260 ? do_user_addr_fault+0x2cd/0x6b0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] For the kprobe-on-ftrace case, we keep the post_handler setting to identify this aggrprobe armed with kprobe_ipmodify_ops. This way we can disarm it correctly. Link: https://lore.kernel.org/all/20221112070000.35299-1-lihuafei1@huawei.com/ Fixes: 0bc11ed5ab60 ("kprobes: Allow kprobes coexist with livepatch") Reported-by: Zhao Gongyi Suggested-by: Masami Hiramatsu (Google) Signed-off-by: Li Huafei Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 0a1ebe35cb3b7aa1f4b26b37e2a0b9ae68dc4ffb Author: Yi Yang Date: Fri Nov 18 10:15:34 2022 +0900 rethook: fix a potential memleak in rethook_alloc() In rethook_alloc(), the variable rh is not freed or passed out if handler is NULL, which could lead to a memleak, fix it. Link: https://lore.kernel.org/all/20221110104438.88099-1-yiyang13@huawei.com/ [Masami: Add "rethook:" tag to the title.] Fixes: 54ecbe6f1ed5 ("rethook: Add a generic return hook") Cc: stable@vger.kernel.org Signed-off-by: Yi Yang Acke-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit d1776c0202aac8251e6b4cbe096ad2950ed6c506 Author: Rafael Mendonca Date: Fri Nov 18 10:15:34 2022 +0900 tracing/eprobe: Fix memory leak of filter string The filter string doesn't get freed when a dynamic event is deleted. If a filter is set, then memory is leaked: root@localhost:/sys/kernel/tracing# echo 'e:egroup/stat_runtime_4core \ sched/sched_stat_runtime runtime=$runtime:u32 if cpu < 4' >> dynamic_events root@localhost:/sys/kernel/tracing# echo "-:egroup/stat_runtime_4core" >> dynamic_events root@localhost:/sys/kernel/tracing# echo scan > /sys/kernel/debug/kmemleak [ 224.416373] kmemleak: 1 new suspected memory leaks (see /sys/kernel/debug/kmemleak) root@localhost:/sys/kernel/tracing# cat /sys/kernel/debug/kmemleak unreferenced object 0xffff88810156f1b8 (size 8): comm "bash", pid 224, jiffies 4294935612 (age 55.800s) hex dump (first 8 bytes): 63 70 75 20 3c 20 34 00 cpu < 4. backtrace: [<000000009f880725>] __kmem_cache_alloc_node+0x18e/0x720 [<0000000042492946>] __kmalloc+0x57/0x240 [<0000000034ea7995>] __trace_eprobe_create+0x1214/0x1d30 [<00000000d70ef730>] trace_probe_create+0xf6/0x110 [<00000000915c7b16>] eprobe_dyn_event_create+0x21/0x30 [<000000000d894386>] create_dyn_event+0xf3/0x1a0 [<00000000e9af57d5>] trace_parse_run_command+0x1a9/0x2e0 [<0000000080777f18>] dyn_event_write+0x39/0x50 [<0000000089f0ec73>] vfs_write+0x311/0xe50 [<000000003da1bdda>] ksys_write+0x158/0x2a0 [<00000000bb1e616e>] __x64_sys_write+0x7c/0xc0 [<00000000e8aef1f7>] do_syscall_64+0x60/0x90 [<00000000fe7fe8ba>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Additionally, in __trace_eprobe_create() function, if an error occurs after the call to trace_eprobe_parse_filter(), which allocates the filter string, then memory is also leaked. That can be reproduced by creating the same event probe twice: root@localhost:/sys/kernel/tracing# echo 'e:egroup/stat_runtime_4core \ sched/sched_stat_runtime runtime=$runtime:u32 if cpu < 4' >> dynamic_events root@localhost:/sys/kernel/tracing# echo 'e:egroup/stat_runtime_4core \ sched/sched_stat_runtime runtime=$runtime:u32 if cpu < 4' >> dynamic_events -bash: echo: write error: File exists root@localhost:/sys/kernel/tracing# echo scan > /sys/kernel/debug/kmemleak [ 207.871584] kmemleak: 1 new suspected memory leaks (see /sys/kernel/debug/kmemleak) root@localhost:/sys/kernel/tracing# cat /sys/kernel/debug/kmemleak unreferenced object 0xffff8881020d17a8 (size 8): comm "bash", pid 223, jiffies 4294938308 (age 31.000s) hex dump (first 8 bytes): 63 70 75 20 3c 20 34 00 cpu < 4. backtrace: [<000000000e4f5f31>] __kmem_cache_alloc_node+0x18e/0x720 [<0000000024f0534b>] __kmalloc+0x57/0x240 [<000000002930a28e>] __trace_eprobe_create+0x1214/0x1d30 [<0000000028387903>] trace_probe_create+0xf6/0x110 [<00000000a80d6a9f>] eprobe_dyn_event_create+0x21/0x30 [<000000007168698c>] create_dyn_event+0xf3/0x1a0 [<00000000f036bf6a>] trace_parse_run_command+0x1a9/0x2e0 [<00000000014bde8b>] dyn_event_write+0x39/0x50 [<0000000078a097f7>] vfs_write+0x311/0xe50 [<00000000996cb208>] ksys_write+0x158/0x2a0 [<00000000a3c2acb0>] __x64_sys_write+0x7c/0xc0 [<0000000006b5d698>] do_syscall_64+0x60/0x90 [<00000000780e8ecf>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fix both issues by releasing the filter string in trace_event_probe_cleanup(). Link: https://lore.kernel.org/all/20221108235738.1021467-1-rafaelmendsr@gmail.com/ Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support") Signed-off-by: Rafael Mendonca Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 22ea4ca9631eb137e64e5ab899e9c89cb6670959 Author: Shang XiaoJing Date: Fri Nov 18 10:15:34 2022 +0900 tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit() When test_gen_kprobe_cmd() failed after kprobe_event_gen_cmd_end(), it will goto delete, which will call kprobe_event_delete() and release the corresponding resource. However, the trace_array in gen_kretprobe_test will point to the invalid resource. Set gen_kretprobe_test to NULL after called kprobe_event_delete() to prevent null-ptr-deref. BUG: kernel NULL pointer dereference, address: 0000000000000070 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 0 PID: 246 Comm: modprobe Tainted: G W 6.1.0-rc1-00174-g9522dc5c87da-dirty #248 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:__ftrace_set_clr_event_nolock+0x53/0x1b0 Code: e8 82 26 fc ff 49 8b 1e c7 44 24 0c ea ff ff ff 49 39 de 0f 84 3c 01 00 00 c7 44 24 18 00 00 00 00 e8 61 26 fc ff 48 8b 6b 10 <44> 8b 65 70 4c 8b 6d 18 41 f7 c4 00 02 00 00 75 2f RSP: 0018:ffffc9000159fe00 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88810971d268 RCX: 0000000000000000 RDX: ffff8881080be600 RSI: ffffffff811b48ff RDI: ffff88810971d058 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 R10: ffffc9000159fe58 R11: 0000000000000001 R12: ffffffffa0001064 R13: ffffffffa000106c R14: ffff88810971d238 R15: 0000000000000000 FS: 00007f89eeff6540(0000) GS:ffff88813b600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000070 CR3: 000000010599e004 CR4: 0000000000330ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __ftrace_set_clr_event+0x3e/0x60 trace_array_set_clr_event+0x35/0x50 ? 0xffffffffa0000000 kprobe_event_gen_test_exit+0xcd/0x10b [kprobe_event_gen_test] __x64_sys_delete_module+0x206/0x380 ? lockdep_hardirqs_on_prepare+0xd8/0x190 ? syscall_enter_from_user_mode+0x1c/0x50 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f89eeb061b7 Link: https://lore.kernel.org/all/20221108015130.28326-3-shangxiaojing@huawei.com/ Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module") Signed-off-by: Shang XiaoJing Cc: stable@vger.kernel.org Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit e0d75267f59d7084e0468bd68beeb1bf9c71d7c0 Author: Shang XiaoJing Date: Fri Nov 18 10:15:33 2022 +0900 tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit() When trace_get_event_file() failed, gen_kretprobe_test will be assigned as the error code. If module kprobe_event_gen_test is removed now, the null pointer dereference will happen in kprobe_event_gen_test_exit(). Check if gen_kprobe_test or gen_kretprobe_test is error code or NULL before dereference them. BUG: kernel NULL pointer dereference, address: 0000000000000012 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 3 PID: 2210 Comm: modprobe Not tainted 6.1.0-rc1-00171-g2159299a3b74-dirty #217 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:kprobe_event_gen_test_exit+0x1c/0xb5 [kprobe_event_gen_test] Code: Unable to access opcode bytes at 0xffffffff9ffffff2. RSP: 0018:ffffc900015bfeb8 EFLAGS: 00010246 RAX: ffffffffffffffea RBX: ffffffffa0002080 RCX: 0000000000000000 RDX: ffffffffa0001054 RSI: ffffffffa0001064 RDI: ffffffffdfc6349c RBP: ffffffffa0000000 R08: 0000000000000004 R09: 00000000001e95c0 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000800 R13: ffffffffa0002420 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f56b75be540(0000) GS:ffff88813bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffff9ffffff2 CR3: 000000010874a006 CR4: 0000000000330ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __x64_sys_delete_module+0x206/0x380 ? lockdep_hardirqs_on_prepare+0xd8/0x190 ? syscall_enter_from_user_mode+0x1c/0x50 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Link: https://lore.kernel.org/all/20221108015130.28326-2-shangxiaojing@huawei.com/ Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module") Signed-off-by: Shang XiaoJing Acked-by: Masami Hiramatsu (Google) Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) commit 585f2bc8fe692d31593633df99090a1039e789bb Merge: a73b603f918f1 4b14841c9a820 Author: Dave Airlie Date: Fri Nov 18 11:09:04 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-11-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-11-16: amdgpu: - Fix a possible memory leak in ganng submit error path - DP tunneling fixes - DCN 3.1 page flip fix - DCN 3.2.x fixes - DCN 3.1.4 fixes - Don't expose degamma on hardware that doesn't support it - BACO fixes for SMU 11.x - BACO fixes for SMU 13.x - Virtual display fix for devices with no display hardware amdkfd: - Memory limit regression fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221117040416.6100-1-alexander.deucher@amd.com commit a73b603f918f1425293b0b5c6f54d7168cb86221 Merge: 5fa8813878d45 4f68332b2f89a Author: Dave Airlie Date: Fri Nov 18 11:02:53 2022 +1000 Merge tag 'drm-intel-fixes-2022-11-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix uaf with lmem_userfault_list handling (Matthew Auld) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y3X2bNJ/4GR1BAiG@tursulin-desk commit 6f04180ca64b6cd5e404951bd042a1852f0598f1 Merge: 47df8a2f78bc3 05c1558bfcb63 Author: Andrii Nakryiko Date: Thu Nov 17 15:46:06 2022 -0800 Merge branch 'libbpf: Fixes for ring buffer' Hou Tao says: ==================== From: Hou Tao Hi, The patch set tries to fix the problems found when testing ringbuf by using 4KB and 2GB size. Patch 1 fixes the probe of ring buffer map on host with 64KB page (e.g., an ARM64 host). Patch 2 & 3 fix the overflow of length when mmaping 2GB kernel ringbuf or user ringbuf on libbpf. Patch 4 just reject the reservation with invalid size. Please see individual patch for details. And comments are always welcome. Change Log: v2: * patch 1: use page size instead of adjust_ringbuf_sz(4096) as main_entries (suggested by Stanislav) * patch 2 & 3: use "mmap_sz" instead of "ro_size/wr_size" as name of mmap length (From Andrii) v1: https://lore.kernel.org/bpf/20221111092642.2333724-1-houtao@huaweicloud.com ==================== Signed-off-by: Andrii Nakryiko commit 05c1558bfcb63b95a9f530767c04c7db091560f2 Author: Hou Tao Date: Wed Nov 16 15:23:51 2022 +0800 libbpf: Check the validity of size in user_ring_buffer__reserve() The top two bits of size are used as busy and discard flags, so reject the reservation that has any of these special bits in the size. With the addition of validity check, these is also no need to check whether or not total_size is overflowed. Signed-off-by: Hou Tao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221116072351.1168938-5-houtao@huaweicloud.com commit 64176bff2446cd825b163976ee451fb6e5cd851d Author: Hou Tao Date: Wed Nov 16 15:23:50 2022 +0800 libbpf: Handle size overflow for user ringbuf mmap Similar with the overflow problem on ringbuf mmap, in user_ringbuf_map() 2 * max_entries may overflow u32 when mapping writeable region. Fixing it by casting the size of writable mmap region into a __u64 and checking whether or not there will be overflow during mmap. Fixes: b66ccae01f1d ("bpf: Add libbpf logic for user-space ring buffer") Signed-off-by: Hou Tao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221116072351.1168938-4-houtao@huaweicloud.com commit 927cbb478adf917e0a142b94baa37f06279cc466 Author: Hou Tao Date: Wed Nov 16 15:23:49 2022 +0800 libbpf: Handle size overflow for ringbuf mmap The maximum size of ringbuf is 2GB on x86-64 host, so 2 * max_entries will overflow u32 when mapping producer page and data pages. Only casting max_entries to size_t is not enough, because for 32-bits application on 64-bits kernel the size of read-only mmap region also could overflow size_t. So fixing it by casting the size of read-only mmap region into a __u64 and checking whether or not there will be overflow during mmap. Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support") Signed-off-by: Hou Tao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221116072351.1168938-3-houtao@huaweicloud.com commit 689eb2f1ba46b4b02195ac2a71c55b96d619ebf8 Author: Hou Tao Date: Wed Nov 16 15:23:48 2022 +0800 libbpf: Use page size as max_entries when probing ring buffer map Using page size as max_entries when probing ring buffer map, else the probe may fail on host with 64KB page size (e.g., an ARM64 host). After the fix, the output of "bpftool feature" on above host will be correct. Before : eBPF map_type ringbuf is NOT available eBPF map_type user_ringbuf is NOT available After : eBPF map_type ringbuf is available eBPF map_type user_ringbuf is available Signed-off-by: Hou Tao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221116072351.1168938-2-houtao@huaweicloud.com commit 1b5f1c34d3f5a664a57a5a7557a50e4e3cc2505c Author: Shang XiaoJing Date: Thu Nov 17 09:23:46 2022 +0800 tracing: Fix wild-memory-access in register_synth_event() In register_synth_event(), if set_synth_event_print_fmt() failed, then both trace_remove_event_call() and unregister_trace_event() will be called, which means the trace_event_call will call __unregister_trace_event() twice. As the result, the second unregister will causes the wild-memory-access. register_synth_event set_synth_event_print_fmt failed trace_remove_event_call event_remove if call->event.funcs then __unregister_trace_event (first call) unregister_trace_event __unregister_trace_event (second call) Fix the bug by avoiding to call the second __unregister_trace_event() by checking if the first one is called. general protection fault, probably for non-canonical address 0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI KASAN: maybe wild-memory-access in range [0xdead000000000120-0xdead000000000127] CPU: 0 PID: 3807 Comm: modprobe Not tainted 6.1.0-rc1-00186-g76f33a7eedb4 #299 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:unregister_trace_event+0x6e/0x280 Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02 00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b RSP: 0018:ffff88810413f370 EFLAGS: 00010a06 RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000 RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20 RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481 R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122 R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028 FS: 00007f7823e8d540(0000) GS:ffff888119e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __create_synth_event+0x1e37/0x1eb0 create_or_delete_synth_event+0x110/0x250 synth_event_run_command+0x2f/0x110 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test] synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test] do_one_initcall+0xdb/0x480 do_init_module+0x1cf/0x680 load_module+0x6a50/0x70a0 __do_sys_finit_module+0x12f/0x1c0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com Fixes: 4b147936fa50 ("tracing: Add support for 'synthetic' events") Signed-off-by: Shang XiaoJing Cc: stable@vger.kernel.org Cc: Cc: Cc: Signed-off-by: Steven Rostedt (Google) commit a4527fef9afe5c903c718d0cd24609fe9c754250 Author: Shang XiaoJing Date: Thu Nov 17 09:23:45 2022 +0800 tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() test_gen_synth_cmd() only free buf in fail path, hence buf will leak when there is no failure. Add kfree(buf) to prevent the memleak. The same reason and solution in test_empty_synth_event(). unreferenced object 0xffff8881127de000 (size 2048): comm "modprobe", pid 247, jiffies 4294972316 (age 78.756s) hex dump (first 32 bytes): 20 67 65 6e 5f 73 79 6e 74 68 5f 74 65 73 74 20 gen_synth_test 20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 64 5f pid_t next_pid_ backtrace: [<000000004254801a>] kmalloc_trace+0x26/0x100 [<0000000039eb1cf5>] 0xffffffffa00083cd [<000000000e8c3bc8>] 0xffffffffa00086ba [<00000000c293d1ea>] do_one_initcall+0xdb/0x480 [<00000000aa189e6d>] do_init_module+0x1cf/0x680 [<00000000d513222b>] load_module+0x6a50/0x70a0 [<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0 [<00000000b36c4c0f>] do_syscall_64+0x3f/0x90 [<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd unreferenced object 0xffff8881127df000 (size 2048): comm "modprobe", pid 247, jiffies 4294972324 (age 78.728s) hex dump (first 32 bytes): 20 65 6d 70 74 79 5f 73 79 6e 74 68 5f 74 65 73 empty_synth_tes 74 20 20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 t pid_t next_pi backtrace: [<000000004254801a>] kmalloc_trace+0x26/0x100 [<00000000d4db9a3d>] 0xffffffffa0008071 [<00000000c31354a5>] 0xffffffffa00086ce [<00000000c293d1ea>] do_one_initcall+0xdb/0x480 [<00000000aa189e6d>] do_init_module+0x1cf/0x680 [<00000000d513222b>] load_module+0x6a50/0x70a0 [<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0 [<00000000b36c4c0f>] do_syscall_64+0x3f/0x90 [<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Link: https://lkml.kernel.org/r/20221117012346.22647-2-shangxiaojing@huawei.com Cc: Cc: Cc: Cc: stable@vger.kernel.org Fixes: 9fe41efaca08 ("tracing: Add synth event generation test module") Signed-off-by: Shang XiaoJing Signed-off-by: Steven Rostedt (Google) commit 19ba6c8af9382c4c05dc6a0a79af3013b9a35cd0 Author: Xiu Jianfeng Date: Wed Nov 16 09:52:07 2022 +0800 ftrace: Fix null pointer dereference in ftrace_add_mod() The @ftrace_mod is allocated by kzalloc(), so both the members {prev,next} of @ftrace_mode->list are NULL, it's not a valid state to call list_del(). If kstrdup() for @ftrace_mod->{func|module} fails, it goes to @out_free tag and calls free_ftrace_mod() to destroy @ftrace_mod, then list_del() will write prev->next and next->prev, where null pointer dereference happens. BUG: kernel NULL pointer dereference, address: 0000000000000008 Oops: 0002 [#1] PREEMPT SMP NOPTI Call Trace: ftrace_mod_callback+0x20d/0x220 ? do_filp_open+0xd9/0x140 ftrace_process_regex.isra.51+0xbf/0x130 ftrace_regex_write.isra.52.part.53+0x6e/0x90 vfs_write+0xee/0x3a0 ? __audit_filter_op+0xb1/0x100 ? auditd_test_task+0x38/0x50 ksys_write+0xa5/0xe0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Kernel panic - not syncing: Fatal exception So call INIT_LIST_HEAD() to initialize the list member to fix this issue. Link: https://lkml.kernel.org/r/20221116015207.30858-1-xiujianfeng@huawei.com Cc: stable@vger.kernel.org Fixes: 673feb9d76ab ("ftrace: Add :mod: caching infrastructure to trace_array") Signed-off-by: Xiu Jianfeng Signed-off-by: Steven Rostedt (Google) commit 56f4ca0a79a9f1af98f26c54b9b89ba1f9bcc6bd Author: Daniil Tatianin Date: Mon Nov 14 17:31:29 2022 +0300 ring_buffer: Do not deactivate non-existant pages rb_head_page_deactivate() expects cpu_buffer to contain a valid list of ->pages, so verify that the list is actually present before calling it. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Link: https://lkml.kernel.org/r/20221114143129.3534443-1-d-tatianin@yandex-team.ru Cc: stable@vger.kernel.org Fixes: 77ae365eca895 ("ring-buffer: make lockless") Signed-off-by: Daniil Tatianin Signed-off-by: Steven Rostedt (Google) commit 84368d882b9688bfac77ce48d33b1e20a4e4a787 Merge: ae75334011d3c 0d6a10dc2b971 Author: Linus Torvalds Date: Thu Nov 17 14:06:25 2022 -0800 Merge tag 'soc-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Another set of devicetree and code changes for SoC platforms, notably: - DT schema warning fixes for i.MX - Functional fixes for i.MX tqma8mqml-mba8mx USB and i.MX8M OCOTP - MAINTAINERS updates for Hisilicon and RISC-V, documenting which RISC-V SoC specific patches will now get merged through the SoC tree in the future. - A code fix for at91 suspend, to work around broken hardware - A devicetree fix for lan966x/pcb8291 LED support - Lots of DT fixes for Qualcomm SoCs, mostly fixing minor problems like incorrect register sizes and schema warnings. One fix makes the UFS controller work on sc8280xp, and six fixes address the same regulator problem in a variety of platforms" * tag 'soc-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (31 commits) MAINTAINERS: repair Microchip corei2c driver entry MAINTAINERS: add an entry for StarFive devicetrees MAINTAINERS: generify the Microchip RISC-V entry name MAINTAINERS: add entries for misc. RISC-V SoC drivers and devicetrees MAINTAINERS: git://github.com -> https://github.com for HiSilicon soc: imx8m: Enable OCOTP clock before reading the register arm64: dts: imx93-pinfunc: drop execution permission arm64: dts: imx8mn: Fix NAND controller size-cells arm64: dts: imx8mm: Fix NAND controller size-cells ARM: dts: imx7: Fix NAND controller size-cells arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR ARM: at91: pm: avoid soft resetting AC DLL ARM: dts: lan966x: Enable sgpio on pcb8291 arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state ARM: dts: at91: sama7g5: fix signal name of pin PB2 arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280 arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers ... commit ae75334011d3c9f8b859ecb5f63e17e72023051e Merge: 81ac25651a62c 5bd76b8de5b74 Author: Linus Torvalds Date: Thu Nov 17 13:28:28 2022 -0800 Merge tag 'ceph-for-6.1-rc6' of https://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "Three filesystem bug fixes, intended for stable" * tag 'ceph-for-6.1-rc6' of https://github.com/ceph/ceph-client: ceph: fix NULL pointer dereference for req->r_session ceph: avoid putting the realm twice when decoding snaps fails ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode() MAINTAINERS: git://github.com -> https://github.com for ceph commit 5fa8813878d45bf6961fd22c8deee53f6a2791df Merge: 094226ad94f47 5954acbacbd19 Author: Dave Airlie Date: Fri Nov 18 07:08:56 2022 +1000 Merge tag 'drm-misc-fixes-2022-11-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc6: - Fix error handling in vc4_atomic_commit_tail() - Set bpc for logictechno panels. - Fix potential memory leak in drm_dev_init() - Fix potential null-ptr-deref in drm_vblank_destroy_worker() - Set lima's clkname corrrectly when regulator is missing. - Small amdgpu fix to gang submission. - Revert hiding unregistered connectors from userspace, as it breaks on DP-MST. - Add workaround for DP++ dual mode adaptors that don't support i2c subaddressing. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/c7d02936-c550-199b-6cb7-cbf6cf104e4a@linux.intel.com commit 59a51183be1a6aaaf6f8483aec82e2fbf2c74ab9 Merge: 181135bb20dcb c1547f12df8b8 Author: Greg Kroah-Hartman Date: Thu Nov 17 22:06:28 2022 +0100 Merge tag 'usb-serial-6.1-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: "USB-serial fixes for 6.1-rc6 Here are some new modem device ids for 6.1. All have been in linux-next with no reported issues." * tag 'usb-serial-6.1-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add u-blox LARA-L6 modem USB: serial: option: add u-blox LARA-R6 00B modem USB: serial: option: remove old LARA-R6 PID USB: serial: option: add Fibocom FM160 0x0111 composition USB: serial: option: add Sierra Wireless EM9191 commit bcea02b096333dc74af987cb9685a4dbdd820840 Author: Wang Wensheng Date: Wed Nov 9 09:44:33 2022 +0000 ftrace: Optimize the allocation for mcount entries If we can't allocate this size, try something smaller with half of the size. Its order should be decreased by one instead of divided by two. Link: https://lkml.kernel.org/r/20221109094434.84046-3-wangwensheng4@huawei.com Cc: Cc: Cc: stable@vger.kernel.org Fixes: a79008755497d ("ftrace: Allocate the mcount record pages as groups") Signed-off-by: Wang Wensheng Signed-off-by: Steven Rostedt (Google) commit 08948caebe93482db1adfd2154eba124f66d161d Author: Wang Wensheng Date: Wed Nov 9 09:44:32 2022 +0000 ftrace: Fix the possible incorrect kernel message If the number of mcount entries is an integer multiple of ENTRIES_PER_PAGE, the page count showing on the console would be wrong. Link: https://lkml.kernel.org/r/20221109094434.84046-2-wangwensheng4@huawei.com Cc: Cc: Cc: stable@vger.kernel.org Fixes: 5821e1b74f0d0 ("function tracing: fix wrong pos computing when read buffer has been fulfilled") Signed-off-by: Wang Wensheng Signed-off-by: Steven Rostedt (Google) commit ac9ccce8717df5aa5361c0cea9d8619f6d87af3c Author: Rob Herring Date: Wed Nov 16 15:53:37 2022 -0600 MAINTAINERS: Include PCI bindings in host bridge entry Almost all PCI bindings are controller bindings, so list them under the PCI native host bridge and endpoint entry. Link: https://lore.kernel.org/r/20221116215337.1032890-1-robh@kernel.org Signed-off-by: Rob Herring Signed-off-by: Bjorn Helgaas Cc: Lorenzo Pieralisi commit 100d6b17c06ee4c2b42fdddf0fe4ab77c86eb77e Author: Pavel Begunkov Date: Thu Nov 17 18:40:17 2022 +0000 io_uring: fix multishot recv request leaks Having REQ_F_POLLED set doesn't guarantee that the request is executed as a multishot from the polling path. Fortunately for us, if the code thinks it's multishot issue when it's not, it can only ask to skip completion so leaking the request. Use issue_flags to mark multipoll issues. Cc: stable@vger.kernel.org Fixes: 1300ebb20286b ("io_uring: multishot recv") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/37762040ba9c52b81b92a2f5ebfd4ee484088951.1668710222.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 91482864768a874c4290ef93b84a78f4f1dac51b Author: Pavel Begunkov Date: Thu Nov 17 18:40:16 2022 +0000 io_uring: fix multishot accept request leaks Having REQ_F_POLLED set doesn't guarantee that the request is executed as a multishot from the polling path. Fortunately for us, if the code thinks it's multishot issue when it's not, it can only ask to skip completion so leaking the request. Use issue_flags to mark multipoll issues. Cc: stable@vger.kernel.org Fixes: 390ed29b5e425 ("io_uring: add IORING_ACCEPT_MULTISHOT for accept") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7700ac57653f2823e30b34dc74da68678c0c5f13.1668710222.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 539bcb57da2f58886d7d5c17134236b0ec9cd15d Author: Pavel Begunkov Date: Thu Nov 17 18:40:15 2022 +0000 io_uring: fix tw losing poll events We may never try to process a poll wake and its mask if there was multiple wake ups racing for queueing up a tw. Force io_poll_check_events() to update the mask by vfs_poll(). Cc: stable@vger.kernel.org Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/00344d60f8b18907171178d7cf598de71d127b0b.1668710222.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b98186aee22fa593bc8c6b2c5d839c2ee518bc8c Author: Pavel Begunkov Date: Thu Nov 17 18:40:14 2022 +0000 io_uring: update res mask in io_poll_check_events When io_poll_check_events() collides with someone attempting to queue a task work, it'll spin for one more time. However, it'll continue to use the mask from the first iteration instead of updating it. For example, if the first wake up was a EPOLLIN and the second EPOLLOUT, the userspace will not get EPOLLOUT in time. Clear the mask for all subsequent iterations to force vfs_poll(). Cc: stable@vger.kernel.org Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2dac97e8f691231049cb259c4ae57e79e40b537c.1668710222.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f014165faa7b953b81dcbf18835936e5f8d01f2a Author: Zhou Guanghui Date: Thu Nov 10 03:37:29 2022 +0000 scsi: iscsi: Fix possible memory leak when device_register() failed If device_register() returns error, the name allocated by the dev_set_name() need be freed. As described in the comment of device_register(), we should use put_device() to give up the reference in the error path. Fix this by calling put_device(), the name will be freed in the kobject_cleanup(), and this patch modified resources will be released by calling the corresponding callback function in the device_release(). Signed-off-by: Zhou Guanghui Link: https://lore.kernel.org/r/20221110033729.1555-1-zhouguanghui1@huawei.com Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 0954256e970ecf371b03a6c9af2cf91b9c4085ff Author: Benjamin Block Date: Wed Nov 16 11:50:37 2022 +0100 scsi: zfcp: Fix double free of FSF request when qdio send fails We used to use the wrong type of integer in 'zfcp_fsf_req_send()' to cache the FSF request ID when sending a new FSF request. This is used in case the sending fails and we need to remove the request from our internal hash table again (so we don't keep an invalid reference and use it when we free the request again). In 'zfcp_fsf_req_send()' we used to cache the ID as 'int' (signed and 32 bit wide), but the rest of the zfcp code (and the firmware specification) handles the ID as 'unsigned long'/'u64' (unsigned and 64 bit wide [s390x ELF ABI]). For one this has the obvious problem that when the ID grows past 32 bit (this can happen reasonably fast) it is truncated to 32 bit when storing it in the cache variable and so doesn't match the original ID anymore. The second less obvious problem is that even when the original ID has not yet grown past 32 bit, as soon as the 32nd bit is set in the original ID (0x80000000 = 2'147'483'648) we will have a mismatch when we cast it back to 'unsigned long'. As the cached variable is of a signed type, the compiler will choose a sign-extending instruction to load the 32 bit variable into a 64 bit register (e.g.: 'lgf %r11,188(%r15)'). So once we pass the cached variable into 'zfcp_reqlist_find_rm()' to remove the request again all the leading zeros will be flipped to ones to extend the sign and won't match the original ID anymore (this has been observed in practice). If we can't successfully remove the request from the hash table again after 'zfcp_qdio_send()' fails (this happens regularly when zfcp cannot notify the adapter about new work because the adapter is already gone during e.g. a ChpID toggle) we will end up with a double free. We unconditionally free the request in the calling function when 'zfcp_fsf_req_send()' fails, but because the request is still in the hash table we end up with a stale memory reference, and once the zfcp adapter is either reset during recovery or shutdown we end up freeing the same memory twice. The resulting stack traces vary depending on the kernel and have no direct correlation to the place where the bug occurs. Here are three examples that have been seen in practice: list_del corruption. next->prev should be 00000001b9d13800, but was 00000000dead4ead. (next=00000001bd131a00) ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:62! monitor event: 0040 ilc:2 [#1] PREEMPT SMP Modules linked in: ... CPU: 9 PID: 1617 Comm: zfcperp0.0.1740 Kdump: loaded Hardware name: ... Krnl PSW : 0704d00180000000 00000003cbeea1f8 (__list_del_entry_valid+0x98/0x140) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3 Krnl GPRS: 00000000916d12f1 0000000080000000 000000000000006d 00000003cb665cd6 0000000000000001 0000000000000000 0000000000000000 00000000d28d21e8 00000000d3844000 00000380099efd28 00000001bd131a00 00000001b9d13800 00000000d3290100 0000000000000000 00000003cbeea1f4 00000380099efc70 Krnl Code: 00000003cbeea1e8: c020004f68a7 larl %r2,00000003cc8d7336 00000003cbeea1ee: c0e50027fd65 brasl %r14,00000003cc3e9cb8 #00000003cbeea1f4: af000000 mc 0,0 >00000003cbeea1f8: c02000920440 larl %r2,00000003cd12aa78 00000003cbeea1fe: c0e500289c25 brasl %r14,00000003cc3fda48 00000003cbeea204: b9040043 lgr %r4,%r3 00000003cbeea208: b9040051 lgr %r5,%r1 00000003cbeea20c: b9040032 lgr %r3,%r2 Call Trace: [<00000003cbeea1f8>] __list_del_entry_valid+0x98/0x140 ([<00000003cbeea1f4>] __list_del_entry_valid+0x94/0x140) [<000003ff7ff502fe>] zfcp_fsf_req_dismiss_all+0xde/0x150 [zfcp] [<000003ff7ff49cd0>] zfcp_erp_strategy_do_action+0x160/0x280 [zfcp] [<000003ff7ff4a22e>] zfcp_erp_strategy+0x21e/0xca0 [zfcp] [<000003ff7ff4ad34>] zfcp_erp_thread+0x84/0x1a0 [zfcp] [<00000003cb5eece8>] kthread+0x138/0x150 [<00000003cb557f3c>] __ret_from_fork+0x3c/0x60 [<00000003cc4172ea>] ret_from_fork+0xa/0x40 INFO: lockdep is turned off. Last Breaking-Event-Address: [<00000003cc3e9d04>] _printk+0x4c/0x58 Kernel panic - not syncing: Fatal exception: panic_on_oops or: Unable to handle kernel pointer dereference in virtual kernel address space Failing address: 6b6b6b6b6b6b6000 TEID: 6b6b6b6b6b6b6803 Fault in home space mode while using kernel ASCE. AS:0000000063b10007 R3:0000000000000024 Oops: 0038 ilc:3 [#1] SMP Modules linked in: ... CPU: 10 PID: 0 Comm: swapper/10 Kdump: loaded Hardware name: ... Krnl PSW : 0404d00180000000 000003ff7febaf8e (zfcp_fsf_reqid_check+0x86/0x158 [zfcp]) R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3 Krnl GPRS: 5a6f1cfa89c49ac3 00000000aff2c4c8 6b6b6b6b6b6b6b6b 00000000000002a8 0000000000000000 0000000000000055 0000000000000000 00000000a8515800 0700000000000000 00000000a6e14500 00000000aff2c000 000000008003c44c 000000008093c700 0000000000000010 00000380009ebba8 00000380009ebb48 Krnl Code: 000003ff7febaf7e: a7f4003d brc 15,000003ff7febaff8 000003ff7febaf82: e32020000004 lg %r2,0(%r2) #000003ff7febaf88: ec2100388064 cgrj %r2,%r1,8,000003ff7febaff8 >000003ff7febaf8e: e3b020100020 cg %r11,16(%r2) 000003ff7febaf94: a774fff7 brc 7,000003ff7febaf82 000003ff7febaf98: ec280030007c cgij %r2,0,8,000003ff7febaff8 000003ff7febaf9e: e31020080004 lg %r1,8(%r2) 000003ff7febafa4: e33020000004 lg %r3,0(%r2) Call Trace: [<000003ff7febaf8e>] zfcp_fsf_reqid_check+0x86/0x158 [zfcp] [<000003ff7febbdbc>] zfcp_qdio_int_resp+0x6c/0x170 [zfcp] [<000003ff7febbf90>] zfcp_qdio_irq_tasklet+0xd0/0x108 [zfcp] [<0000000061d90a04>] tasklet_action_common.constprop.0+0xdc/0x128 [<000000006292f300>] __do_softirq+0x130/0x3c0 [<0000000061d906c6>] irq_exit_rcu+0xfe/0x118 [<000000006291e818>] do_io_irq+0xc8/0x168 [<000000006292d516>] io_int_handler+0xd6/0x110 [<000000006292d596>] psw_idle_exit+0x0/0xa ([<0000000061d3be50>] arch_cpu_idle+0x40/0xd0) [<000000006292ceea>] default_idle_call+0x52/0xf8 [<0000000061de4fa4>] do_idle+0xd4/0x168 [<0000000061de51fe>] cpu_startup_entry+0x36/0x40 [<0000000061d4faac>] smp_start_secondary+0x12c/0x138 [<000000006292d88e>] restart_int_handler+0x6e/0x90 Last Breaking-Event-Address: [<000003ff7febaf94>] zfcp_fsf_reqid_check+0x8c/0x158 [zfcp] Kernel panic - not syncing: Fatal exception in interrupt or: Unable to handle kernel pointer dereference in virtual kernel address space Failing address: 523b05d3ae76a000 TEID: 523b05d3ae76a803 Fault in home space mode while using kernel ASCE. AS:0000000077c40007 R3:0000000000000024 Oops: 0038 ilc:3 [#1] SMP Modules linked in: ... CPU: 3 PID: 453 Comm: kworker/3:1H Kdump: loaded Hardware name: ... Workqueue: kblockd blk_mq_run_work_fn Krnl PSW : 0404d00180000000 0000000076fc0312 (__kmalloc+0xd2/0x398) R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3 Krnl GPRS: ffffffffffffffff 523b05d3ae76abf6 0000000000000000 0000000000092a20 0000000000000002 00000007e49b5cc0 00000007eda8f000 0000000000092a20 00000007eda8f000 00000003b02856b9 00000000000000a8 523b05d3ae76abf6 00000007dd662000 00000007eda8f000 0000000076fc02b2 000003e0037637a0 Krnl Code: 0000000076fc0302: c004000000d4 brcl 0,76fc04aa 0000000076fc0308: b904001b lgr %r1,%r11 #0000000076fc030c: e3106020001a algf %r1,32(%r6) >0000000076fc0312: e31010000082 xg %r1,0(%r1) 0000000076fc0318: b9040001 lgr %r0,%r1 0000000076fc031c: e30061700082 xg %r0,368(%r6) 0000000076fc0322: ec59000100d9 aghik %r5,%r9,1 0000000076fc0328: e34003b80004 lg %r4,952 Call Trace: [<0000000076fc0312>] __kmalloc+0xd2/0x398 [<0000000076f318f2>] mempool_alloc+0x72/0x1f8 [<000003ff8027c5f8>] zfcp_fsf_req_create.isra.7+0x40/0x268 [zfcp] [<000003ff8027f1bc>] zfcp_fsf_fcp_cmnd+0xac/0x3f0 [zfcp] [<000003ff80280f1a>] zfcp_scsi_queuecommand+0x122/0x1d0 [zfcp] [<000003ff800b4218>] scsi_queue_rq+0x778/0xa10 [scsi_mod] [<00000000771782a0>] __blk_mq_try_issue_directly+0x130/0x208 [<000000007717a124>] blk_mq_request_issue_directly+0x4c/0xa8 [<000003ff801302e2>] dm_mq_queue_rq+0x2ea/0x468 [dm_mod] [<0000000077178c12>] blk_mq_dispatch_rq_list+0x33a/0x818 [<000000007717f064>] __blk_mq_do_dispatch_sched+0x284/0x2f0 [<000000007717f44c>] __blk_mq_sched_dispatch_requests+0x1c4/0x218 [<000000007717fa7a>] blk_mq_sched_dispatch_requests+0x52/0x90 [<0000000077176d74>] __blk_mq_run_hw_queue+0x9c/0xc0 [<0000000076da6d74>] process_one_work+0x274/0x4d0 [<0000000076da7018>] worker_thread+0x48/0x560 [<0000000076daef18>] kthread+0x140/0x160 [<000000007751d144>] ret_from_fork+0x28/0x30 Last Breaking-Event-Address: [<0000000076fc0474>] __kmalloc+0x234/0x398 Kernel panic - not syncing: Fatal exception: panic_on_oops To fix this, simply change the type of the cache variable to 'unsigned long', like the rest of zfcp and also the argument for 'zfcp_reqlist_find_rm()'. This prevents truncation and wrong sign extension and so can successfully remove the request from the hash table. Fixes: e60a6d69f1f8 ("[SCSI] zfcp: Remove function zfcp_reqlist_find_safe") Cc: #v2.6.34+ Signed-off-by: Benjamin Block Link: https://lore.kernel.org/r/979f6e6019d15f91ba56182f1aaf68d61bf37fc6.1668595505.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier Signed-off-by: Martin K. Petersen commit e208a1d795a08d1ac0398c79ad9c58106531bcc5 Author: Yuan Can Date: Thu Nov 17 08:44:21 2022 +0000 scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper() If device_register() fails in sdebug_add_host_helper(), it will goto clean and sdbg_host will be freed, but sdbg_host->host_list will not be removed from sdebug_host_list, then list traversal may cause UAF. Fix it. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20221117084421.58918-1-yuancan@huawei.com Acked-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit bc68e428d4963af0201e92159629ab96948f0893 Author: Yang Yingliang Date: Tue Nov 15 09:50:42 2022 +0800 scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() If device_register() fails in tcm_loop_setup_hba_bus(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). The 'tl_hba' will be freed in tcm_loop_release_adapter(), so it don't need goto error label in this case. Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221115015042.3652261-1-yangyingliang@huawei.com Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 7d21fcfb409500dc9b114567f0ef8d30b3190dee Author: Shin'ichiro Kawasaki Date: Fri Nov 11 10:44:49 2022 +0900 scsi: mpi3mr: Suppress command reply debug prints After it receives command reply, mpi3mr driver checks command result. If the result is not zero, it prints out command information. This debug information is confusing since they are printed even when the non-zero result is expected. "Power-on or device reset occurred" is printed for Test Unit Ready command at drive detection. Inquiry failure for unsupported VPD page header is also printed. They are harmless but look like failures. To avoid the confusion, print the command reply debug information only when the module parameter logging_level has value MPI3_DEBUG_SCSI_ERROR= 64, in same manner as mpt3sas driver. Signed-off-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20221111014449.1649968-1-shinichiro.kawasaki@wdc.com Reviewed-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 81ac25651a62c958bb0e074e0d4e25060ea557dd Merge: 847ccab8fdcf4 5a01c805441bd Author: Linus Torvalds Date: Thu Nov 17 09:04:50 2022 -0800 Merge tag 'nfsd-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix another tracepoint crash * tag 'nfsd-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix trace_nfsd_fh_verify_err() crasher commit 847ccab8fdcf4a0cd85a278480fab1ccdc9f6136 Merge: cc675d22e4224 58e0be1ef6118 Author: Linus Torvalds Date: Thu Nov 17 08:58:36 2022 -0800 Merge tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf. Current release - regressions: - tls: fix memory leak in tls_enc_skb() and tls_sw_fallback_init() Previous releases - regressions: - bridge: fix memory leaks when changing VLAN protocol - dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims - dsa: don't leak tagger-owned storage on switch driver unbind - eth: mlxsw: avoid warnings when not offloaded FDB entry with IPv6 is removed - eth: stmmac: ensure tx function is not running in stmmac_xdp_release() - eth: hns3: fix return value check bug of rx copybreak Previous releases - always broken: - kcm: close race conditions on sk_receive_queue - bpf: fix alignment problem in bpf_prog_test_run_skb() - bpf: fix writing offset in case of fault in strncpy_from_kernel_nofault - eth: macvlan: use built-in RCU list checking - eth: marvell: add sleep time after enabling the loopback bit - eth: octeon_ep: fix potential memory leak in octep_device_setup() Misc: - tcp: configurable source port perturb table size - bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)" * tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits) net: use struct_group to copy ip/ipv6 header addresses net: usb: smsc95xx: fix external PHY reset net: usb: qmi_wwan: add Telit 0x103a composition netdevsim: Fix memory leak of nsim_dev->fa_cookie tcp: configurable source port perturb table size l2tp: Serialize access to sk_user_data with sk_callback_lock net: thunderbolt: Fix error handling in tbnet_init() net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start() net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init() net: dsa: don't leak tagger-owned storage on switch driver unbind net/x25: Fix skb leak in x25_lapb_receive_frame() net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() bridge: switchdev: Fix memory leaks when changing VLAN protocol net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process net: hns3: fix return value check bug of rx copybreak net: hns3: fix incorrect hw rss hash type of rx packet net: phy: marvell: add sleep time after enabling the loopback bit net: ena: Fix error handling in ena_init() kcm: close race conditions on sk_receive_queue net: ionic: Fix error handling in ionic_init_module() ... commit d79b483193c276f9b6863f69735b97de12ced621 Merge: 9eb8ca049c23a 05311ce954aeb Author: Paolo Bonzini Date: Thu Nov 17 11:42:35 2022 -0500 Merge branch 'kvm-svm-harden' into HEAD This fixes three issues in nested SVM: 1) in the shutdown_interception() vmexit handler we call kvm_vcpu_reset(). However, if running nested and L1 doesn't intercept shutdown, the function resets vcpu->arch.hflags without properly leaving the nested state. This leaves the vCPU in inconsistent state and later triggers a kernel panic in SVM code. The same bug can likely be triggered by sending INIT via local apic to a vCPU which runs a nested guest. On VMX we are lucky that the issue can't happen because VMX always intercepts triple faults, thus triple fault in L2 will always be redirected to L1. Plus, handle_triple_fault() doesn't reset the vCPU. INIT IPI can't happen on VMX either because INIT events are masked while in VMX mode. Secondarily, KVM doesn't honour SHUTDOWN intercept bit of L1 on SVM. A normal hypervisor should always intercept SHUTDOWN, a unit test on the other hand might want to not do so. Finally, the guest can trigger a kernel non rate limited printk on SVM from the guest, which is fixed as well. Signed-off-by: Paolo Bonzini commit 05311ce954aebe75935d9ae7d38ac82b5b796e33 Author: Maxim Levitsky Date: Thu Nov 3 16:13:51 2022 +0200 KVM: x86: remove exit_int_info warning in svm_handle_exit It is valid to receive external interrupt and have broken IDT entry, which will lead to #GP with exit_int_into that will contain the index of the IDT entry (e.g any value). Other exceptions can happen as well, like #NP or #SS (if stack switch fails). Thus this warning can be user triggred and has very little value. Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 8357b9e19bbb5c9ce671c7b6cb93e03fc0fe4016 Author: Maxim Levitsky Date: Thu Nov 3 16:13:50 2022 +0200 KVM: selftests: add svm part to triple_fault_test Add a SVM implementation to triple_fault_test to test that emulated/injected shutdown works. Since instead of the VMX, the SVM allows the hypervisor to avoid intercepting shutdown in guest, don't intercept shutdown to test that KVM suports this correctly. Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 92e7d5c83aff124f49082585e57939ed24b59c5c Author: Maxim Levitsky Date: Thu Nov 3 16:13:49 2022 +0200 KVM: x86: allow L1 to not intercept triple fault This is SVM correctness fix - although a sane L1 would intercept SHUTDOWN event, it doesn't have to, so we have to honour this. Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 0bd2d3f48704d9d00c29fa97fb80de012af87a0a Author: Maxim Levitsky Date: Thu Nov 3 16:13:48 2022 +0200 kvm: selftests: add svm nested shutdown test Add test that tests that on SVM if L1 doesn't intercept SHUTDOWN, then L2 crashes L1 and doesn't crash L2 Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit fc6392d51d4810e4b611ef7dabd594756e5a2406 Author: Maxim Levitsky Date: Thu Nov 3 16:13:47 2022 +0200 KVM: selftests: move idt_entry to header struct idt_entry will be used for a test which will break IDT on purpose. Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit ed129ec9057f89d615ba0c81a4984a90345a1684 Author: Maxim Levitsky Date: Thu Nov 3 16:13:46 2022 +0200 KVM: x86: forcibly leave nested mode on vCPU reset While not obivous, kvm_vcpu_reset() leaves the nested mode by clearing 'vcpu->arch.hflags' but it does so without all the required housekeeping. On SVM, it is possible to have a vCPU reset while in guest mode because unlike VMX, on SVM, INIT's are not latched in SVM non root mode and in addition to that L1 doesn't have to intercept triple fault, which should also trigger L1's reset if happens in L2 while L1 didn't intercept it. If one of the above conditions happen, KVM will continue to use vmcb02 while not having in the guest mode. Later the IA32_EFER will be cleared which will lead to freeing of the nested guest state which will (correctly) free the vmcb02, but since KVM still uses it (incorrectly) this will lead to a use after free and kernel crash. This issue is assigned CVE-2022-3344 Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit f9697df251438b0798780900e8b43bdb12a56d64 Author: Maxim Levitsky Date: Thu Nov 3 16:13:45 2022 +0200 KVM: x86: add kvm_leave_nested add kvm_leave_nested which wraps a call to nested_ops->leave_nested into a function. Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 16ae56d7e0528559bf8dc9070e3bfd8ba3de80df Author: Maxim Levitsky Date: Thu Nov 3 16:13:44 2022 +0200 KVM: x86: nSVM: harden svm_free_nested against freeing vmcb02 while still in use Make sure that KVM uses vmcb01 before freeing nested state, and warn if that is not the case. This is a minimal fix for CVE-2022-3344 making the kernel print a warning instead of a kernel panic. Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 917401f26a6af5756d89b550a8e1bd50cf42b07e Author: Maxim Levitsky Date: Thu Nov 3 16:13:43 2022 +0200 KVM: x86: nSVM: leave nested mode on vCPU free If the VM was terminated while nested, we free the nested state while the vCPU still is in nested mode. Soon a warning will be added for this condition. Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 9eb8ca049c23afb0410f4a7b9a7158f1a0a3ad0e Author: David Matlack Date: Wed Nov 16 16:16:57 2022 -0800 KVM: Obey kvm.halt_poll_ns in VMs not using KVM_CAP_HALT_POLL Obey kvm.halt_poll_ns in VMs not using KVM_CAP_HALT_POLL on every halt, rather than just sampling the module parameter when the VM is first created. This restore the original behavior of kvm.halt_poll_ns for VMs that have not opted into KVM_CAP_HALT_POLL. Notably, this change restores the ability for admins to disable or change the maximum halt-polling time system wide for VMs not using KVM_CAP_HALT_POLL. Reported-by: Christian Borntraeger Fixes: acd05785e48c ("kvm: add capability for halt polling") Signed-off-by: David Matlack Message-Id: <20221117001657.1067231-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 175d5dc79dcb58d18e11192656eefa27abb3fd33 Author: David Matlack Date: Wed Nov 16 16:16:56 2022 -0800 KVM: Avoid re-reading kvm->max_halt_poll_ns during halt-polling Avoid re-reading kvm->max_halt_poll_ns multiple times during halt-polling except when it is explicitly useful, e.g. to check if the max time changed across a halt. kvm->max_halt_poll_ns can be changed at any time by userspace via KVM_CAP_HALT_POLL. This bug is unlikely to cause any serious side-effects. In the worst case one halt polls for shorter or longer than it should, and then is fixed up on the next halt. Furthmore, this is still possible since kvm->max_halt_poll_ns are not synchronized with halts. Fixes: acd05785e48c ("kvm: add capability for halt polling") Signed-off-by: David Matlack Message-Id: <20221117001657.1067231-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 97b6847ac10ba753849207e20df74a7c0ea03343 Author: David Matlack Date: Wed Nov 16 16:16:55 2022 -0800 KVM: Cap vcpu->halt_poll_ns before halting rather than after Cap vcpu->halt_poll_ns based on the max halt polling time just before halting, rather than after the last halt. This arguably provides better accuracy if an admin disables halt polling in between halts, although the improvement is nominal. A side-effect of this change is that grow_halt_poll_ns() no longer needs to access vcpu->kvm->max_halt_poll_ns, which will be useful in a future commit where the max halt polling time can come from the module parameter halt_poll_ns instead. Signed-off-by: David Matlack Message-Id: <20221117001657.1067231-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 57976762428675f259339385d3324d28ee53ec02 Author: Michael Grzeschik Date: Mon Nov 14 19:59:22 2022 +0100 ARM: at91: rm9200: fix usb device clock id Referring to the datasheet the index 2 is the MCKUDP. When enabled, it "Enables the automatic disable of the Master Clock of the USB Device Port when a suspend condition occurs". We fix the index to the real UDP id which "Enables the 48 MHz clock of the USB Device Port". Cc: nicolas.ferre@microchip.com Cc: ludovic.desroches@microchip.com Cc: alexandre.belloni@bootlin.com Cc: mturquette@baylibre.com Cc: sboyd@kernel.org Cc: claudiu.beznea@microchip.com Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@pengutronix.de Fixes: 02ff48e4d7f7 ("clk: at91: add at91rm9200 pmc driver") Fixes: 0e0e528d8260 ("ARM: dts: at91: rm9200: switch to new clock bindings") Reviewed-by: Claudiu Beznea Signed-off-by: Michael Grzeschik Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221114185923.1023249-2-m.grzeschik@pengutronix.de commit 40a2226e8bfacb79dd154dea68febeead9d847e9 Author: Michael Grzeschik Date: Mon Nov 14 19:59:23 2022 +0100 ARM: dts: at91: sam9g20ek: enable udc vbus gpio pinctrl We set the PIOC to GPIO mode. This way the pin becomes an input signal will be usable by the controller. Without this change the udc on the 9g20ek does not work. Cc: nicolas.ferre@microchip.com Cc: ludovic.desroches@microchip.com Cc: alexandre.belloni@bootlin.com Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@pengutronix.de Fixes: 5cb4e73575e3 ("ARM: at91: add at91sam9g20ek boards dt support") Signed-off-by: Michael Grzeschik Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221114185923.1023249-3-m.grzeschik@pengutronix.de commit 2197aa6b0aa236b9896a09b9d08d6924d18b84f6 Author: Krishna Yarlagadda Date: Thu Nov 17 12:33:20 2022 +0530 spi: tegra210-quad: Fix duplicate resource error controller data alloc is done with client device data causing duplicate resource error. Allocate memory using controller device when using devm Fixes: f89d2cc3967a ("spi: tegra210-quad: use devm call for cdata memory") Signed-off-by: Krishna Yarlagadda Reviewed-by: Jon Hunter Tested-by: Jon Hunter Link: https://lore.kernel.org/r/20221117070320.18720-1-kyarlagadda@nvidia.com Signed-off-by: Mark Brown commit 58e0be1ef6118c5352b56a4d06e974c5599993a5 Author: Hangbin Liu Date: Tue Nov 15 22:24:00 2022 +0800 net: use struct_group to copy ip/ipv6 header addresses kernel test robot reported warnings when build bonding module with make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/bonding/: from ../drivers/net/bonding/bond_main.c:35: In function ‘fortify_memcpy_chk’, inlined from ‘iph_to_flow_copy_v4addrs’ at ../include/net/ip.h:566:2, inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3984:3: ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 413 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘fortify_memcpy_chk’, inlined from ‘iph_to_flow_copy_v6addrs’ at ../include/net/ipv6.h:900:2, inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3994:3: ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 413 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is because we try to copy the whole ip/ip6 address to the flow_key, while we only point the to ip/ip6 saddr. Note that since these are UAPI headers, __struct_group() is used to avoid the compiler warnings. Reported-by: kernel test robot Fixes: c3f8324188fa ("net: Add full IPv6 addresses to flow_keys") Signed-off-by: Hangbin Liu Link: https://lore.kernel.org/r/20221115142400.1204786-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit 809ff97a677ff85dfb7ce2b63be261d1633dcf29 Author: Alexandru Tachici Date: Tue Nov 15 13:44:34 2022 +0200 net: usb: smsc95xx: fix external PHY reset An external PHY needs settling time after power up or reset. In the bind() function an mdio bus is registered. If at this point the external PHY is still initialising, no valid PHY ID will be read and on phy_find_first() the bind() function will fail. If an external PHY is present, wait the maximum time specified in 802.3 45.2.7.1.1. Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support") Signed-off-by: Alexandru Tachici Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221115114434.9991-2-alexandru.tachici@analog.com Signed-off-by: Paolo Abeni commit e103ba33998d0f25653cc8ebe745b68d1ee10cda Author: Enrico Sau Date: Tue Nov 15 11:58:59 2022 +0100 net: usb: qmi_wwan: add Telit 0x103a composition Add the following Telit LE910C4-WWX composition: 0x103a: rmnet Signed-off-by: Enrico Sau Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/20221115105859.14324-1-enrico.sau@gmail.com Signed-off-by: Paolo Abeni commit 5db8face97f81c9342458c052572e19ac6bd8e52 Author: Marc Zyngier Date: Tue Nov 15 22:04:53 2022 +0000 kbuild: Restore .version auto-increment behaviour for Debian packages Since 2df8220cc511 ("kbuild: build init/built-in.a just once"), generating Debian packages using 'make bindeb-pkg' results in packages that are stuck to the same .version, leading to unexpected behaviours (multiple packages with the same version). That's because the mkdebian script samples the build version before building the kernel, and forces the use of that version number for the actual build. Restore the previous behaviour by calling init/build-version instead of reading the .version file. This is likely to result in too many .version bumps, but this is what was happening before (although the bump was affecting builds made after the current one). Fixes: 2df8220cc511 ("kbuild: build init/built-in.a just once") Signed-off-by: Marc Zyngier Signed-off-by: Masahiro Yamada commit cce616e012c215d65c15e5d1afa73182dea49389 Author: Yang Yingliang Date: Wed Nov 9 22:01:24 2022 +0800 tee: optee: fix possible memory leak in optee_register_device() If device_register() returns error in optee_register_device(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(), and optee_device is freed in optee_release_device(). Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support") Signed-off-by: Yang Yingliang Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit bedf06833b1f63c2627bd5634602e05592129d7a Author: Aashish Sharma Date: Mon Nov 7 21:35:56 2022 +0530 tracing: Fix warning on variable 'struct trace_array' Move the declaration of 'struct trace_array' out of #ifdef CONFIG_TRACING block, to fix the following warning when CONFIG_TRACING is not set: >> include/linux/trace.h:63:45: warning: 'struct trace_array' declared inside parameter list will not be visible outside of this definition or declaration Link: https://lkml.kernel.org/r/20221107160556.2139463-1-shraash@google.com Fixes: 1a77dd1c2bb5 ("scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled") Cc: "Martin K. Petersen" Cc: Arun Easi Acked-by: Masami Hiramatsu (Google) Reviewed-by: Guenter Roeck Signed-off-by: Aashish Sharma Signed-off-by: Steven Rostedt (Google) commit 649e72070cbbb8600eb823833e4748f5a0815116 Author: Wang Yufen Date: Mon Nov 7 19:04:50 2022 +0800 tracing: Fix memory leak in tracing_read_pipe() kmemleak reports this issue: unreferenced object 0xffff888105a18900 (size 128): comm "test_progs", pid 18933, jiffies 4336275356 (age 22801.766s) hex dump (first 32 bytes): 25 73 00 90 81 88 ff ff 26 05 00 00 42 01 58 04 %s......&...B.X. 03 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000560143a1>] __kmalloc_node_track_caller+0x4a/0x140 [<000000006af00822>] krealloc+0x8d/0xf0 [<00000000c309be6a>] trace_iter_expand_format+0x99/0x150 [<000000005a53bdb6>] trace_check_vprintf+0x1e0/0x11d0 [<0000000065629d9d>] trace_event_printf+0xb6/0xf0 [<000000009a690dc7>] trace_raw_output_bpf_trace_printk+0x89/0xc0 [<00000000d22db172>] print_trace_line+0x73c/0x1480 [<00000000cdba76ba>] tracing_read_pipe+0x45c/0x9f0 [<0000000015b58459>] vfs_read+0x17b/0x7c0 [<000000004aeee8ed>] ksys_read+0xed/0x1c0 [<0000000063d3d898>] do_syscall_64+0x3b/0x90 [<00000000a06dda7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd iter->fmt alloced in tracing_read_pipe() -> .. ->trace_iter_expand_format(), but not freed, to fix, add free in tracing_release_pipe() Link: https://lkml.kernel.org/r/1667819090-4643-1-git-send-email-wangyufen@huawei.com Cc: stable@vger.kernel.org Fixes: efbbdaa22bb7 ("tracing: Show real address for trace event arguments") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Wang Yufen Signed-off-by: Steven Rostedt (Google) commit 31029a8b2c7e656a0289194ef16415050ae4c4ac Author: Steven Rostedt (Google) Date: Fri Oct 21 12:30:13 2022 -0400 ring-buffer: Include dropped pages in counting dirty patches The function ring_buffer_nr_dirty_pages() was created to find out how many pages are filled in the ring buffer. There's two running counters. One is incremented whenever a new page is touched (pages_touched) and the other is whenever a page is read (pages_read). The dirty count is the number touched minus the number read. This is used to determine if a blocked task should be woken up if the percentage of the ring buffer it is waiting for is hit. The problem is that it does not take into account dropped pages (when the new writes overwrite pages that were not read). And then the dirty pages will always be greater than the percentage. This makes the "buffer_percent" file inaccurate, as the number of dirty pages end up always being larger than the percentage, event when it's not and this causes user space to be woken up more than it wants to be. Add a new counter to keep track of lost pages, and include that in the accounting of dirty pages so that it is actually accurate. Link: https://lkml.kernel.org/r/20221021123013.55fb6055@gandalf.local.home Fixes: 2c2b0a78b3739 ("ring-buffer: Add percentage of ring buffer full to wake up reader") Signed-off-by: Steven Rostedt (Google) commit 50a893359cd2643ee1afc96eedc9e7084cab49fa Author: Keith Busch Date: Thu Nov 10 10:45:01 2022 -0800 dm-log-writes: set dma_alignment limit in io_hints This device mapper needs bio vectors to be sized and memory aligned to the logical block size. Set the minimum required queue limit accordingly. Signed-off-by: Keith Busch Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20221110184501.2451620-6-kbusch@meta.com Signed-off-by: Jens Axboe commit 29aa778bb66795e6a78b1c99beadc83887827868 Author: Keith Busch Date: Thu Nov 10 10:45:00 2022 -0800 dm-integrity: set dma_alignment limit in io_hints This device mapper needs bio vectors to be sized and memory aligned to the logical block size. Set the minimum required queue limit accordingly. Signed-off-by: Keith Busch Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20221110184501.2451620-5-kbusch@meta.com Signed-off-by: Jens Axboe commit b3228254bb6e91e57f920227f72a1a7d81925d81 Author: Keith Busch Date: Thu Nov 10 10:44:59 2022 -0800 block: make blk_set_default_limits() private There are no external users of this function. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221110184501.2451620-4-kbusch@meta.com Signed-off-by: Jens Axboe commit 86e4d3e8d1838ca88fb9267e669c36f6c8f7c6cd Author: Keith Busch Date: Thu Nov 10 10:44:58 2022 -0800 dm-crypt: provide dma_alignment limit in io_hints This device mapper needs bio vectors to be sized and memory aligned to the logical block size. Set the minimum required queue limit accordingly. Link: https://lore.kernel.org/linux-block/20221101001558.648ee024@xps.demsh.org/ Fixes: b1a000d3b8ec5 ("block: relax direct io memory alignment") Reportred-by: Eric Biggers Reported-by: Dmitrii Tcvetkov Signed-off-by: Keith Busch Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20221110184501.2451620-3-kbusch@meta.com Signed-off-by: Jens Axboe commit c964d62f5cab7b43dd0534f22a96eab386c6ec5d Author: Keith Busch Date: Thu Nov 10 10:44:57 2022 -0800 block: make dma_alignment a stacking queue_limit Device mappers had always been getting the default 511 dma mask, but the underlying device might have a larger alignment requirement. Since this value is used to determine alloweable direct-io alignment, this needs to be a stackable limit. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221110184501.2451620-2-kbusch@meta.com Signed-off-by: Jens Axboe commit 42fb0a1e84ff525ebe560e2baf9451ab69127e2b Author: Steven Rostedt (Google) Date: Thu Oct 20 23:14:27 2022 -0400 tracing/ring-buffer: Have polling block on watermark Currently the way polling works on the ring buffer is broken. It will return immediately if there's any data in the ring buffer whereas a read will block until the watermark (defined by the tracefs buffer_percent file) is hit. That is, a select() or poll() will return as if there's data available, but then the following read will block. This is broken for the way select()s and poll()s are supposed to work. Have the polling on the ring buffer also block the same way reads and splice does on the ring buffer. Link: https://lkml.kernel.org/r/20221020231427.41be3f26@gandalf.local.home Cc: Linux Trace Kernel Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Primiano Tucci Cc: stable@vger.kernel.org Fixes: 1e0d6714aceb7 ("ring-buffer: Do not wake up a splice waiter when page is not full") Signed-off-by: Steven Rostedt (Google) commit 0d6a10dc2b971cc3a192b47721ee8270afc2d104 Merge: f9084ecbdab73 836fb30949d9e Author: Arnd Bergmann Date: Wed Nov 16 22:08:07 2022 +0100 Merge tag 'imx-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.1, 2nd round: - Switch to usb-role-switch for fixing USB device mode on tqma8mqml-mba8mx board, so that Dual Role is fully functional. - A series from Marek Vasut to fix dt-schema warning caused by NAND controller size-cells. - Fix file permission of imx93-pinfunc header. - Enable OCOTP clock in soc-imx8m driver to fix a kexec kernel hang issue. * tag 'imx-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx8m: Enable OCOTP clock before reading the register arm64: dts: imx93-pinfunc: drop execution permission arm64: dts: imx8mn: Fix NAND controller size-cells arm64: dts: imx8mm: Fix NAND controller size-cells ARM: dts: imx7: Fix NAND controller size-cells arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR Link: https://lore.kernel.org/r/20221116090402.GA1274@T480 Signed-off-by: Arnd Bergmann commit f9084ecbdab73833d3a179d5ad5c55c44155e7d4 Merge: 6827df0911c30 fc2292bd01a25 Author: Arnd Bergmann Date: Wed Nov 16 22:07:19 2022 +0100 Merge tag 'hisi-maintainer-fix' of https://github.com/hisilicon/linux-hisi into arm/fixes MAINTAINERS file updates for HiSilicon sections - Use https instead of git for the git trees listed * tag 'hisi-maintainer-fix' of https://github.com/hisilicon/linux-hisi: MAINTAINERS: git://github.com -> https://github.com for HiSilicon Link: https://lore.kernel.org/r/63744BAB.5020307@hisilicon.com Signed-off-by: Arnd Bergmann commit 064bc7312bd09a48798418663090be0c776183db Author: Wang Yufen Date: Tue Nov 15 17:30:25 2022 +0800 netdevsim: Fix memory leak of nsim_dev->fa_cookie kmemleak reports this issue: unreferenced object 0xffff8881bac872d0 (size 8): comm "sh", pid 58603, jiffies 4481524462 (age 68.065s) hex dump (first 8 bytes): 04 00 00 00 de ad be ef ........ backtrace: [<00000000c80b8577>] __kmalloc+0x49/0x150 [<000000005292b8c6>] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim] [<0000000093d78e77>] full_proxy_write+0xf3/0x180 [<000000005a662c16>] vfs_write+0x1c5/0xaf0 [<000000007aabf84a>] ksys_write+0xed/0x1c0 [<000000005f1d2e47>] do_syscall_64+0x3b/0x90 [<000000006001c6ec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The issue occurs in the following scenarios: nsim_dev_trap_fa_cookie_write() kmalloc() fa_cookie nsim_dev->fa_cookie = fa_cookie .. nsim_drv_remove() The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To fix, add kfree(nsim_dev->fa_cookie) to nsim_drv_remove(). Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata") Signed-off-by: Wang Yufen Cc: Jiri Pirko Link: https://lore.kernel.org/r/1668504625-14698-1-git-send-email-wangyufen@huawei.com Signed-off-by: Jakub Kicinski commit cc675d22e422442f6d230654a55a5fc5682ea018 Merge: 31c9c4c54ea99 4abb77fc55313 Author: Linus Torvalds Date: Wed Nov 16 10:49:06 2022 -0800 Merge tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Two trivial cleanups, and three simple fixes" * tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/platform-pci: use define instead of literal number xen/platform-pci: add missing free_irq() in error path xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too xen/pcpu: fix possible memory leak in register_pcpu() x86/xen: Use kstrtobool() instead of strtobool() commit 31c9c4c54ea9902af4b01545d3a10acd3cf815a9 Merge: 941209ef89e3f 2e35b25dd8e66 Author: Linus Torvalds Date: Wed Nov 16 10:40:00 2022 -0800 Merge tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Aere is a hopefully final round of pin control fixes. Nothing special, driver fixes and we caught a potential NULL pointer exception. - Fix a potential NULL dereference in the core! - Fix all pin mux routes in the Rockchop PX30 driver - Fix the UFS pins in the Qualcomm SC8280XP driver - Fix bias disabling in the Mediatek driver - Fix debounce time settings in the Mediatek driver" * tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: mediatek: Export debounce time tables pinctrl: mediatek: Fix EINT pins input debounce time configuration pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE pinctrl: qcom: sc8280xp: Rectify UFS reset pins pinctrl: rockchip: list all pins in a possible mux route for PX30 commit 941209ef89e3f5e5fd75bffdafe8e74d5c2d4d92 Merge: 59d0d52c30d49 b44fd994e4511 Author: Linus Torvalds Date: Wed Nov 16 10:36:13 2022 -0800 Merge tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: - Surface Pro 9 and Surface Laptop 5 kbd, battery, etc support (this is just a few hw-id additions) - A couple of other hw-id / DMI-quirk additions - A few small bug fixes + 1 build fix * tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops platform/x86: hp-wmi: Ignore Smart Experience App event platform/surface: aggregator_registry: Add support for Surface Laptop 5 platform/surface: aggregator_registry: Add support for Surface Pro 9 platform/surface: aggregator: Do not check for repeated unsequenced packets platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017) platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type platform/x86/amd: pmc: Add new ACPI ID AMDI0009 platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks commit 50edc257a152541b8bcdc84f77de5e4efad7013d Author: Chen-Yu Tsai Date: Tue Nov 15 17:06:44 2022 +0800 arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 The Hantro G2 video decoder block sits behind the IOMMU. Without a reference for the system to properly configure the IOMMU, it will fault and cause the video decoder to fail. Add a proper reference to the IOMMU port. The master ID is taken from the IOMMU fault error message on Linux, and the number seems to match the order in the user manual's IOMMU diagram. Fixes: 0baddea60e8d ("arm64: dts: allwinner: h6: Add Hantro G2 node") Signed-off-by: Chen-Yu Tsai Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20221115090644.3602573-3-wenst@chromium.org Signed-off-by: Jernej Skrabec commit 38f0d57d0a47b2783cac4d78a6141c7abf423532 Author: Chen-Yu Tsai Date: Tue Nov 15 17:06:43 2022 +0800 media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property The Hantro G2 video decoder block sits behind an IOMMU. The device tree binding needs a property to reference it. Without a reference for the implementation to properly configure the IOMMU, it will fault and cause the video decoder to fail. Add an "iommus" property for referring to the IOMMU port. The master ID in the example is taken from the IOMMU fault error message on Linux, and the number seems to match the order in the user manual's IOMMU diagram. Fixes: fd6be12716c4 ("media: dt-bindings: allwinner: document H6 Hantro G2 binding") Signed-off-by: Chen-Yu Tsai Acked-by: Jernej Skrabec Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221115090644.3602573-2-wenst@chromium.org Signed-off-by: Jernej Skrabec commit 077686da0e2162c4ea5ae0df205849c2a7a84479 Author: Samuel Holland Date: Sun Nov 13 19:57:48 2022 -0600 bus: sunxi-rsb: Support atomic transfers When communicating with a PMIC during system poweroff (pm_power_off()), IRQs are disabled and we are in a RCU read-side critical section, so we cannot use wait_for_completion_io_timeout(). Instead, poll the status register for transfer completion. Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20221114015749.28490-3-samuel@sholland.org Signed-off-by: Jernej Skrabec commit 5f4696ddca4b8a0bbbc36bd46829f97aab5a4552 Author: Samuel Holland Date: Sun Nov 13 19:57:47 2022 -0600 bus: sunxi-rsb: Remove the shutdown callback Shutting down the RSB controller prevents communicating with a PMIC inside pm_power_off(), since that gets called after device_shutdown(), so it breaks system poweroff on some boards. Reported-by: Ivaylo Dimitrov Tested-by: Ivaylo Dimitrov Acked-by: Jernej Skrabec Fixes: 843107498f91 ("bus: sunxi-rsb: Implement suspend/resume/shutdown callbacks") Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20221114015749.28490-2-samuel@sholland.org Signed-off-by: Jernej Skrabec commit a51e5d293dd1c2e7bf6f7be788466cd9b5d280fb Author: Anastasia Belova Date: Wed Nov 16 17:10:27 2022 +0300 cifs: add check for returning value of SMB2_set_info_init If the returning value of SMB2_set_info_init is an error-value, exit the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0967e5457954 ("cifs: use a compound for setting an xattr") Signed-off-by: Anastasia Belova Signed-off-by: Steve French commit c1547f12df8b8e9ca2686accee43213ecd117efe Author: Davide Tronchin Date: Wed Nov 16 16:59:50 2022 +0100 USB: serial: option: add u-blox LARA-L6 modem Add LARA-L6 PIDs for three different USB compositions. LARA-L6 module can be configured (by AT interface) in three different USB modes: * Default mode (Vendor ID: 0x1546 Product ID: 0x1341) with 4 serial interfaces * RmNet mode (Vendor ID: 0x1546 Product ID: 0x1342) with 4 serial interfaces and 1 RmNet virtual network interface * CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1343) with 4 serial interface and 1 CDC-ECM virtual network interface In default mode LARA-L6 exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parser/alternative functions In RmNet mode LARA-L6 exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parset/alternative functions If 4: RMNET interface In CDC-ECM mode LARA-L6 exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parset/alternative functions If 4: CDC-ECM interface Signed-off-by: Davide Tronchin [ johan: drop PID defines in favour of comments ] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit d9e37a5c4d80ea25a7171ab8557a449115554e76 Author: Davide Tronchin Date: Wed Nov 16 16:59:49 2022 +0100 USB: serial: option: add u-blox LARA-R6 00B modem The official LARA-R6 (00B) modem uses 0x908b PID. LARA-R6 00B does not implement a QMI interface on port 4, the reservation (RSVD(4)) has been added to meet other companies that implement QMI on that interface. LARA-R6 00B USB composition exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parser/alternative functions Signed-off-by: Davide Tronchin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 2ec106b96afc19698ff934323b633c0729d4c7f8 Author: Davide Tronchin Date: Wed Nov 16 16:59:48 2022 +0100 USB: serial: option: remove old LARA-R6 PID Remove the UBLOX_PRODUCT_R6XX 0x90fa association since LARA-R6 00B final product uses a new USB composition with different PID. 0x90fa PID used only by LARA-R6 internal prototypes. Move 0x90fa PID directly in the option_ids array since used by other Qualcomm based modem vendors as pointed out in: https://lore.kernel.org/all/6572c4e6-d8bc-b8d3-4396-d879e4e76338@gmail.com Signed-off-by: Davide Tronchin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 222cfa0118aa68687ace74aab8fdf77ce8fbd7e6 Author: Xiongfeng Wang Date: Mon Nov 14 16:31:00 2022 +0800 mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() pci_get_device() will increase the reference count for the returned pci_dev. We need to use pci_dev_put() to decrease the reference count before amd_probe() returns. There is no problem for the 'smbus_dev == NULL' branch because pci_dev_put() can also handle the NULL input parameter case. Fixes: 659c9bc114a8 ("mmc: sdhci-pci: Build o2micro support in the same module") Signed-off-by: Xiongfeng Wang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221114083100.149200-1-wangxiongfeng2@huawei.com Signed-off-by: Ulf Hansson commit 1f386d6894d0f1b7de8ef640c41622ddd698e7ab Author: Yang Yingliang Date: Wed Nov 16 11:37:06 2022 +0800 regulator: core: fix UAF in destroy_regulator() I got a UAF report as following: ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x935/0x2060 Read of size 8 at addr ffff88810e838220 by task python3/268 Call Trace: dump_stack_lvl+0x67/0x83 print_report+0x178/0x4b0 kasan_report+0x90/0x190 __lock_acquire+0x935/0x2060 lock_acquire+0x156/0x400 _raw_spin_lock+0x2a/0x40 lockref_get+0x11/0x30 simple_recursive_removal+0x41/0x440 debugfs_remove.part.12+0x32/0x50 debugfs_remove+0x29/0x30 _regulator_put.cold.54+0x3e/0x27f regulator_put+0x1f/0x30 release_nodes+0x6a/0xa0 devres_release_all+0xf8/0x150 Allocated by task 37: kasan_save_stack+0x1c/0x40 kasan_set_track+0x21/0x30 __kasan_slab_alloc+0x5d/0x70 slab_post_alloc_hook+0x62/0x510 kmem_cache_alloc_lru+0x222/0x5a0 __d_alloc+0x31/0x440 d_alloc+0x30/0xf0 d_alloc_parallel+0xc4/0xd20 __lookup_slow+0x15e/0x2f0 lookup_one_len+0x13a/0x150 start_creating+0xea/0x190 debugfs_create_dir+0x1e/0x210 create_regulator+0x254/0x4e0 _regulator_get+0x2a1/0x467 _devm_regulator_get+0x5a/0xb0 regulator_virtual_probe+0xb9/0x1a0 Freed by task 30: kasan_save_stack+0x1c/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x50 __kasan_slab_free+0x102/0x190 kmem_cache_free+0xf6/0x600 rcu_core+0x54c/0x12b0 __do_softirq+0xf2/0x5e3 Last potentially related work creation: kasan_save_stack+0x1c/0x40 __kasan_record_aux_stack+0x98/0xb0 call_rcu+0x42/0x700 dentry_free+0x6c/0xd0 __dentry_kill+0x23b/0x2d0 dput.part.31+0x431/0x780 simple_recursive_removal+0xa9/0x440 debugfs_remove.part.12+0x32/0x50 debugfs_remove+0x29/0x30 regulator_unregister+0xe3/0x230 release_nodes+0x6a/0xa0 ================================================================== Here is how happened: processor A processor B regulator_register() rdev_init_debugfs() rdev->debugfs = debugfs_create_dir() devm_regulator_get() rdev = regulator_dev_lookup() create_regulator(rdev) // using rdev->debugfs as parent debugfs_create_dir(rdev->debugfs) mfd_remove_devices_fn() release_nodes() regulator_unregister() // free rdev->debugfs debugfs_remove_recursive(rdev->debugfs) release_nodes() destroy_regulator() debugfs_remove_recursive() <- causes UAF In devm_regulator_get(), after getting rdev, the refcount is get, so fix this by moving debugfs_remove_recursive() to regulator_dev_release(), then it can be proctected by the refcount, the 'rdev->debugfs' can not be freed until the refcount is 0. Fixes: 5de705194e98 ("regulator: Add basic per consumer debugfs") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221116033706.3595812-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 804313b64e412a81b0b3389a10e7622452004aa6 Author: Xiongfeng Wang Date: Wed Nov 16 17:32:04 2022 +0800 spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld() pci_get_device() will increase the reference count for the returned pci_dev. Since 'dma_dev' is only used to filter the channel in dw_spi_dma_chan_filer() after using it we need to call pci_dev_put() to decrease the reference count. Also add pci_dev_put() for the error case. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Signed-off-by: Xiongfeng Wang Acked-by: Serge Semin Link: https://lore.kernel.org/r/20221116093204.46700-1-wangxiongfeng2@huawei.com Signed-off-by: Mark Brown commit aeac4ec8f46d610a10adbaeff5e2edf6a88ffc62 Author: Gleb Mazovetskiy Date: Mon Nov 14 22:56:16 2022 +0000 tcp: configurable source port perturb table size On embedded systems with little memory and no relevant security concerns, it is beneficial to reduce the size of the table. Reducing the size from 2^16 to 2^8 saves 255 KiB of kernel RAM. Makes the table size configurable as an expert option. The size was previously increased from 2^8 to 2^16 in commit 4c2c8f03a5ab ("tcp: increase source port perturb table to 2^16"). Signed-off-by: Gleb Mazovetskiy Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 096cc0cddf58232bded309336961784f1d1c85f8 Author: Chevron Li Date: Fri Nov 4 02:55:12 2022 -0700 mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout The SD card is recognized failed sometimes when resume from suspend. Because CD# debounce time too long then card present report wrong. Finally, card is recognized failed. Signed-off-by: Chevron Li Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221104095512.4068-1-chevron.li@bayhubtech.com Signed-off-by: Ulf Hansson commit 39a72dbfe188291b156dd6523511e3d5761ce775 Author: Yann Gautier Date: Fri Oct 28 09:37:40 2022 +0200 mmc: core: properly select voltage range without power cycle In mmc_select_voltage(), if there is no full power cycle, the voltage range selected at the end of the function will be on a single range (e.g. 3.3V/3.4V). To keep a range around the selected voltage (3.2V/3.4V), the mask shift should be reduced by 1. This issue was triggered by using a specific SD-card (Verbatim Premium 16GB UHS-1) on an STM32MP157C-DK2 board. This board cannot do UHS modes and there is no power cycle. And the card was failing to switch to high-speed mode. When adding the range 3.2V/3.3V for this card with the proposed shift change, the card can switch to high-speed mode. Fixes: ce69d37b7d8f ("mmc: core: Prevent violation of specs while initializing cards") Signed-off-by: Yann Gautier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221028073740.7259-1-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit b68777d54fac21fc833ec26ea1a2a84f975ab035 Author: Jakub Sitnicki Date: Mon Nov 14 20:16:19 2022 +0100 l2tp: Serialize access to sk_user_data with sk_callback_lock sk->sk_user_data has multiple users, which are not compatible with each other. Writers must synchronize by grabbing the sk->sk_callback_lock. l2tp currently fails to grab the lock when modifying the underlying tunnel socket fields. Fix it by adding appropriate locking. We err on the side of safety and grab the sk_callback_lock also inside the sk_destruct callback overridden by l2tp, even though there should be no refs allowing access to the sock at the time when sk_destruct gets called. v4: - serialize write to sk_user_data in l2tp sk_destruct v3: - switch from sock lock to sk_callback_lock - document write-protection for sk_user_data v2: - update Fixes to point to origin of the bug - use real names in Reported/Tested-by tags Cc: Tom Parkin Fixes: 3557baabf280 ("[L2TP]: PPP over L2TP driver core") Reported-by: Haowei Yan Signed-off-by: Jakub Sitnicki Signed-off-by: David S. Miller commit db2d2dc9a0b58c6faefb6b002fdbed4f0362d1a4 Author: Frieder Schrempf Date: Tue Nov 15 19:10:00 2022 +0100 spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock In case the requested bus clock is higher than the input clock, the correct dividers (pre = 0, post = 0) are returned from mx51_ecspi_clkdiv(), but *fres is left uninitialized and therefore contains an arbitrary value. This causes trouble for the recently introduced PIO polling feature as the value in spi_imx->spi_bus_clk is used there to calculate for which transfers to enable PIO polling. Fix this by setting *fres even if no clock dividers are in use. This issue was observed on Kontron BL i.MX8MM with an SPI peripheral clock set to 50 MHz by default and a requested SPI bus clock of 80 MHz for the SPI NOR flash. With the fix applied the debug message from mx51_ecspi_clkdiv() now prints the following: spi_imx 30820000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 50000000, post: 0, pre: 0 Fixes: 6fd8b8503a0d ("spi: spi-imx: Fix out-of-order CS/SCLK operation at low speeds") Fixes: 07e759387788 ("spi: spi-imx: add PIO polling support") Cc: Marc Kleine-Budde Cc: David Jander Cc: Fabio Estevam Cc: Mark Brown Cc: Marek Vasut Cc: stable@vger.kernel.org Signed-off-by: Frieder Schrempf Tested-by: Fabio Estevam Acked-by: Marek Vasut Link: https://lore.kernel.org/r/20221115181002.2068270-1-frieder@fris.de Signed-off-by: Mark Brown commit 7920e0fbced429ab18ad4402e3914146a6a0921b Author: Yang Yingliang Date: Wed Nov 16 17:29:43 2022 +0800 regulator: rt5759: fix OOB in validate_desc() I got the following OOB report: BUG: KASAN: slab-out-of-bounds in validate_desc+0xba/0x109 Read of size 8 at addr ffff888107db8ff0 by task python3/253 Call Trace: dump_stack_lvl+0x67/0x83 print_report+0x178/0x4b0 kasan_report+0x90/0x190 validate_desc+0xba/0x109 gpiod_set_value_cansleep+0x40/0x5a regulator_ena_gpio_ctrl+0x93/0xfc _regulator_do_enable.cold.61+0x89/0x163 set_machine_constraints+0x140a/0x159c regulator_register.cold.73+0x762/0x10cd devm_regulator_register+0x57/0xb0 rt5759_probe+0x3a0/0x4ac [rt5759_regulator] The desc used in validate_desc() is passed from 'reg_cfg.ena_gpiod', which is not initialized. Fix this by initializing 'reg_cfg' to 0. Fixes: 7b36ddb208bd ("regulator: rt5759: Add support for Richtek RT5759 DCDC converter") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221116092943.1668326-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 5f4b204b6b8153923d5be8002c5f7082985d153f Author: Zeng Heng Date: Wed Nov 16 15:43:39 2022 +0800 regulator: core: fix kobject release warning and memory leak in regulator_register() Here is a warning report about lack of registered release() from kobject lib: Device '(null)' does not have a release() function, it is broken and must be fixed. WARNING: CPU: 0 PID: 48430 at drivers/base/core.c:2332 device_release+0x104/0x120 Call Trace: kobject_put+0xdc/0x180 put_device+0x1b/0x30 regulator_register+0x651/0x1170 devm_regulator_register+0x4f/0xb0 When regulator_register() returns fail and directly goto `clean` symbol, rdev->dev has not registered release() function yet (which is registered by regulator_class in the following), so rdev needs to be freed manually. If rdev->dev.of_node is not NULL, which means the of_node has gotten by regulator_of_get_init_data(), it needs to call of_node_put() to avoid refcount leak. Otherwise, only calling put_device() would lead memory leak of rdev in further: unreferenced object 0xffff88810d0b1000 (size 2048): comm "107-i2c-rtq6752", pid 48430, jiffies 4342258431 (age 1341.780s) backtrace: kmalloc_trace+0x22/0x110 regulator_register+0x184/0x1170 devm_regulator_register+0x4f/0xb0 When regulator_register() returns fail and goto `wash` symbol, rdev->dev has registered release() function, so directly call put_device() to cleanup everything. Fixes: d3c731564e09 ("regulator: plug of_node leak in regulator_register()'s error path") Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20221116074339.1024240-1-zengheng4@huawei.com Signed-off-by: Mark Brown commit 60591bbf6d5eb44f275eb733943b7757325c1b60 Author: Jiasheng Jiang Date: Wed Nov 16 16:25:08 2022 +0800 ASoC: max98373: Add checks for devm_kcalloc As the devm_kcalloc may return NULL pointer, it should be better to check the return value in order to avoid NULL poineter dereference. Fixes: 349dd23931d1 ("ASoC: max98373: don't access volatile registers in bias level off") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20221116082508.17418-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit c7d7d4e7bb1290cc473610b0bb96d9fa606d00e7 Author: Shuming Fan Date: Wed Nov 16 17:03:18 2022 +0800 ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions Due to the hardware behavior, it takes some time for CBJ detection/impedance sensing/de-bounce. The ClockStop_NotFinished flag will be raised until these functions are completed. In ClockStopMode0 mode case, the SdW controller might check this flag from D3 to D0 when the jack detection interrupt happened. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20221116090318.5017-1-shumingf@realtek.com Signed-off-by: Mark Brown commit e3c11025bcd2142a61abe5806b2f86a0e78118df Author: Vasily Gorbik Date: Fri Nov 4 12:06:47 2022 +0100 s390: avoid using global register for current_stack_pointer Commit 30de14b1884b ("s390: current_stack_pointer shouldn't be a function") made current_stack_pointer a global register variable like on many other architectures. Unfortunately on s390 it uncovers old gcc bug which is fixed only since gcc-9.1 [gcc commit 3ad7fed1cc87 ("S/390: Fix PR89775. Stackpointer save/restore instructions removed")] and backported to gcc-8.4 and later. Due to this bug gcc versions prior to 8.4 generate broken code which leads to stack corruptions. Current minimal gcc version required to build the kernel is declared as 5.1. It is not possible to fix all old gcc versions, so work around this problem by avoiding using global register variable for current_stack_pointer. Fixes: 30de14b1884b ("s390: current_stack_pointer shouldn't be a function") Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit a41a11b4009580edb6e2b4c76e5e2ee303f87157 Author: Gerald Schaefer Date: Thu Oct 27 16:19:38 2022 +0200 s390/dcssblk: fix deadlock when adding a DCSS After the rework from commit 1ebe2e5f9d68 ("block: remove GENHD_FL_EXT_DEVT"), when calling device_add_disk(), dcssblk will end up in disk_scan_partitions(), and not break out early w/o GENHD_FL_NO_PART. This will trigger implicit open/release via blkdev_get/put_whole() later. dcssblk_release() will then deadlock on dcssblk_devices_sem semaphore, which is already held from dcssblk_add_store() when calling device_add_disk(). dcssblk does not support partitions (DCSSBLK_MINORS_PER_DISK == 1), and never scanned partitions before. Therefore restore the previous behavior, and explicitly disallow partition scanning by setting the GENHD_FL_NO_PART flag. This will also prevent this deadlock scenario. Fixes: 1ebe2e5f9d68 ("block: remove GENHD_FL_EXT_DEVT") Cc: # 5.17+ Signed-off-by: Gerald Schaefer Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit eb761a1760bf30cf64e98ee8d914866e62ec9e8a Author: Nicholas Piggin Date: Wed Nov 16 14:39:53 2022 +1000 powerpc: Fix writable sections being moved into the rodata region .data.rel.ro* catches .data.rel.root_cpuacct, and the kernel crashes on a store in css_clear_dir. At least we know read-only data protection is working... Fixes: b6adc6d6d3272 ("powerpc/build: move .data.rel.ro, .sdata2 to read-only") Signed-off-by: Nicholas Piggin Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221116043954.3307852-1-npiggin@gmail.com commit 2d77de1581bb5b470486edaf17a7d70151131afd Author: Srikar Dronamraju Date: Tue Sep 27 13:22:11 2022 +0530 scripts/faddr2line: Fix regression in name resolution on ppc64le Commit 1d1a0e7c5100 ("scripts/faddr2line: Fix overlapping text section failures") can cause faddr2line to fail on ppc64le on some distributions, while it works fine on other distributions. The failure can be attributed to differences in the readelf output. $ ./scripts/faddr2line vmlinux find_busiest_group+0x00 no match for find_busiest_group+0x00 On ppc64le, readelf adds the localentry tag before the symbol name on some distributions, and adds the localentry tag after the symbol name on other distributions. This problem has been discussed previously: https://lore.kernel.org/bpf/20191211160133.GB4580@calabresa/ This problem can be overcome by filtering out the localentry tags in the readelf output. Similar fixes are already present in the kernel by way of the following commits: 1fd6cee127e2 ("libbpf: Fix VERSIONED_SYM_COUNT number parsing") aa915931ac3e ("libbpf: Fix readelf output parsing for Fedora") [jpoimboe: rework commit log] Fixes: 1d1a0e7c5100 ("scripts/faddr2line: Fix overlapping text section failures") Signed-off-by: Srikar Dronamraju Acked-by: Naveen N. Rao Reviewed-by: Thadeu Lima de Souza Cascardo Link: https://lore.kernel.org/r/20220927075211.897152-1-srikar@linux.vnet.ibm.com Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra commit f524b7289bbb0c8ffaa2ba3c34c146e43da54fb2 Author: Yuan Can Date: Mon Nov 14 14:22:25 2022 +0000 net: thunderbolt: Fix error handling in tbnet_init() A problem about insmod thunderbolt-net failed is triggered with following log given while lsmod does not show thunderbolt_net: insmod: ERROR: could not insert module thunderbolt-net.ko: File exists The reason is that tbnet_init() returns tb_register_service_driver() directly without checking its return value, if tb_register_service_driver() failed, it returns without removing property directory, resulting the property directory can never be created later. tbnet_init() tb_register_property_dir() # register property directory tb_register_service_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without remove property directory Fix by remove property directory when tb_register_service_driver() returns error. Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable") Signed-off-by: Yuan Can Acked-by: Mika Westerberg Signed-off-by: David S. Miller commit 23df39fc6a36183af5e6e4f47523f1ad2cdc1d30 Author: Guo Jin Date: Tue Nov 8 14:01:26 2022 +0800 locking: Fix qspinlock/x86 inline asm error When compiling linux 6.1.0-rc3 configured with CONFIG_64BIT=y and CONFIG_PARAVIRT_SPINLOCKS=y on x86_64 using LLVM 11.0, an error: " error: changed section flags for .spinlock.text, expected:: 0x6" occurred. The reason is the .spinlock.text in kernel/locking/qspinlock.o is used many times, but its flags are omitted in subsequent use. LLVM 11.0 assembler didn't permit to leave out flags in subsequent uses of the same sections. So this patch adds the corresponding flags to avoid above error. Fixes: 501f7f69bca1 ("locking: Add __lockfunc to slow path functions") Signed-off-by: Guo Jin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20221108060126.2505-1-guoj17@chinatelecom.cn commit ce0d998be9274dd3a3d971cbeaa6fe28fd2c3062 Author: Adrian Hunter Date: Sat Nov 12 17:15:08 2022 +0200 perf/x86/intel/pt: Fix sampling using single range output Deal with errata TGL052, ADL037 and RPL017 "Trace May Contain Incorrect Data When Configured With Single Range Output Larger Than 4KB" by disabling single range output whenever larger than 4KB. Fixes: 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode") Signed-off-by: Adrian Hunter Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221112151508.13768-1-adrian.hunter@intel.com commit baa014b9543c8e5e94f5d15b66abfe60750b8284 Author: Ravi Bangoria Date: Mon Nov 14 10:10:29 2022 +0530 perf/x86/amd: Fix crash due to race between amd_pmu_enable_all, perf NMI and throttling amd_pmu_enable_all() does: if (!test_bit(idx, cpuc->active_mask)) continue; amd_pmu_enable_event(cpuc->events[idx]); A perf NMI of another event can come between these two steps. Perf NMI handler internally disables and enables _all_ events, including the one which nmi-intercepted amd_pmu_enable_all() was in process of enabling. If that unintentionally enabled event has very low sampling period and causes immediate successive NMI, causing the event to be throttled, cpuc->events[idx] and cpuc->active_mask gets cleared by x86_pmu_stop(). This will result in amd_pmu_enable_event() getting called with event=NULL when amd_pmu_enable_all() resumes after handling the NMIs. This causes a kernel crash: BUG: kernel NULL pointer dereference, address: 0000000000000198 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page [...] Call Trace: amd_pmu_enable_all+0x68/0xb0 ctx_resched+0xd9/0x150 event_function+0xb8/0x130 ? hrtimer_start_range_ns+0x141/0x4a0 ? perf_duration_warn+0x30/0x30 remote_function+0x4d/0x60 __flush_smp_call_function_queue+0xc4/0x500 flush_smp_call_function_queue+0x11d/0x1b0 do_idle+0x18f/0x2d0 cpu_startup_entry+0x19/0x20 start_secondary+0x121/0x160 secondary_startup_64_no_verify+0xe5/0xeb amd_pmu_disable_all()/amd_pmu_enable_all() calls inside perf NMI handler were recently added as part of BRS enablement but I'm not sure whether we really need them. We can just disable BRS in the beginning and enable it back while returning from NMI. This will solve the issue by not enabling those events whose active_masks are set but are not yet enabled in hw pmu. Fixes: ada543459cab ("perf/x86/amd: Add AMD Fam19h Branch Sampling support") Reported-by: Linux Kernel Functional Testing Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221114044029.373-1-ravi.bangoria@amd.com commit e4aa85cf0d43e293f474e3b415ff44e49ef768ae Merge: 4e0c19fcb8b53 639f5d006e36b Author: David S. Miller Date: Wed Nov 16 09:10:29 2022 +0000 Merge branch 'microchip-fixes' Shang XiaoJing says: ==================== net: microchip: Fix potential null-ptr-deref due to create_singlethread_workqueue() There are some functions call create_singlethread_workqueue() without checking ret value, and the NULL workqueue_struct pointer may causes null-ptr-deref. Will be fixed by this patch. ==================== Signed-off-by: David S. Miller commit 639f5d006e36bb303f525d9479448c412b720c39 Author: Shang XiaoJing Date: Mon Nov 14 21:38:53 2022 +0800 net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start() sparx_stats_init() calls create_singlethread_workqueue() and not checked the ret value, which may return NULL. And a null-ptr-deref may happen: sparx_stats_init() create_singlethread_workqueue() # failed, sparx5->stats_queue is NULL queue_delayed_work() queue_delayed_work_on() __queue_delayed_work() # warning here, but continue __queue_work() # access wq->flags, null-ptr-deref Check the ret value and return -ENOMEM if it is NULL. So as sparx5_start(). Fixes: af4b11022e2d ("net: sparx5: add ethtool configuration and statistics support") Fixes: b37a1bae742f ("net: sparx5: add mactable support") Signed-off-by: Shang XiaoJing Signed-off-by: David S. Miller commit ba86af3733aece88dbcee0dfebf7e2dcfefb2be4 Author: Shang XiaoJing Date: Mon Nov 14 21:38:52 2022 +0800 net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init() lan966x_stats_init() calls create_singlethread_workqueue() and not checked the ret value, which may return NULL. And a null-ptr-deref may happen: lan966x_stats_init() create_singlethread_workqueue() # failed, lan966x->stats_queue is NULL queue_delayed_work() queue_delayed_work_on() __queue_delayed_work() # warning here, but continue __queue_work() # access wq->flags, null-ptr-deref Check the ret value and return -ENOMEM if it is NULL. Fixes: 12c2d0a5b8e2 ("net: lan966x: add ethtool configuration and statistics") Signed-off-by: Shang XiaoJing Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit b44fd994e45112b58b6c1dec4451d9a925784589 Author: Hans de Goede Date: Tue Nov 15 20:34:00 2022 +0100 platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables Add module parameters to allow setting the hw_rfkill_switch and set_fn_lock_led feature flags for testing these on laptops which are not on the DMI-id based allow lists for these 2 flags. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20221115193400.376159-1-hdegoede@redhat.com commit 81a5603a0f50fd7cf17ff21d106052215eaf2028 Author: Arnav Rawat Date: Fri Nov 11 14:32:09 2022 +0000 platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops Commit 3ae86d2d4704 ("platform/x86: ideapad-laptop: Fix Legion 5 Fn lock LED") uses the WMI event-id for the fn-lock event on some Legion 5 laptops to manually toggle the fn-lock LED because the EC does not do it itself. However, the same WMI ID is also sent on some Yoga laptops. Here, setting the fn-lock state is not valid behavior, and causes the EC to spam interrupts until the laptop is rebooted. Add a set_fn_lock_led_list[] DMI-id list and only enable the workaround to manually set the LED on models on this list. Link: https://bugzilla.kernel.org/show_bug.cgi?id=212671 Cc: Meng Dong Signed-off-by: Arnav Rawat Link: https://lore.kernel.org/r/12093851.O9o76ZdvQC@fedora [hdegoede@redhat.com: Check DMI-id list only once and store the result] Signed-off-by: Hans de Goede commit 8b9b6a044b408283b086702b1d9e3cf4ba45b426 Author: Kai-Heng Feng Date: Mon Nov 14 15:38:41 2022 +0800 platform/x86: hp-wmi: Ignore Smart Experience App event Sometimes hp-wmi driver complains on system resume: [ 483.116451] hp_wmi: Unknown event_id - 33 - 0x0 According to HP it's a feature called "HP Smart Experience App" and it's safe to be ignored. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20221114073842.205392-1-kai.heng.feng@canonical.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 4a567d164d0e0c57e7b694b988db86361f130cb7 Author: Maximilian Luz Date: Wed Nov 16 00:14:40 2022 +0100 platform/surface: aggregator_registry: Add support for Surface Laptop 5 Add device nodes to enable support for battery and charger status, the ACPI platform profile, as well as internal HID devices (including touchpad and keyboard) on the Surface Laptop 5. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20221115231440.1338142-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede commit 61ba9e9712e187e019e6451bb9fc8eb24685fc50 Author: Damien Le Moal Date: Mon Oct 31 11:30:31 2022 +0900 zonefs: Remove to_attr() helper function to_attr() in zonefs sysfs code is unused, which it causes a warning when compiling with clang and W=1. Delete it to prevent the warning. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn commit 7dd12d65ac646046a3fe0bbf9a4e86f4514207b3 Author: Damien Le Moal Date: Tue Oct 25 13:39:31 2022 +0900 zonefs: fix zone report size in __zonefs_io_error() When an IO error occurs, the function __zonefs_io_error() is used to issue a zone report to obtain the latest zone information from the device. This function gets a zone report for all zones used as storage for a file, which is always 1 zone except for files representing aggregated conventional zones. The number of zones of a zone report for a file is calculated in __zonefs_io_error() by doing a bit-shift of the inode i_zone_size field, which is equal to or larger than the device zone size. However, this calculation does not take into account that the last zone of a zoned device may be smaller than the zone size reported by bdev_zone_sectors() (which is used to set the bit shift size). As a result, if an error occurs for an IO targetting such last smaller zone, the zone report will ask for 0 zones, leading to an invalid zone report. Fix this by using the fact that all files require a 1 zone report, except if the inode i_zone_size field indicates a zone size larger than the device zone size. This exception case corresponds to a mount with aggregated conventional zones. A check for this exception is added to the file inode initialization during mount. If an invalid setup is detected, emit an error and fail the mount (check contributed by Johannes Thumshirn). Signed-off-by: Johannes Thumshirn Signed-off-by: Damien Le Moal commit 92bbd67a55fee50743b42825d1c016e7fd5c79f9 Author: Zhang Xiaoxu Date: Tue Nov 15 18:39:34 2022 +0800 cifs: Fix wrong return value checking when GETFLAGS The return value of CIFSGetExtAttr is negative, should be checked with -EOPNOTSUPP rather than EOPNOTSUPP. Fixes: 64a5cfa6db94 ("Allow setting per-file compression via SMB2/3") Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 0a52566279b4ee65ecd2503d7b7342851f84755c Author: Sagi Grimberg Date: Mon Nov 14 08:45:02 2022 +0200 nvmet: fix a memory leak in nvmet_auth_set_key When changing dhchap secrets we need to release the old secrets as well. kmemleak complaint: -- unreferenced object 0xffff8c7f44ed8180 (size 64): comm "check", pid 7304, jiffies 4295686133 (age 72034.246s) hex dump (first 32 bytes): 44 48 48 43 2d 31 3a 30 30 3a 4c 64 4c 4f 64 71 DHHC-1:00:LdLOdq 79 56 69 67 77 48 55 32 6d 5a 59 4c 7a 35 59 38 yVigwHU2mZYLz5Y8 backtrace: [<00000000b6fc5071>] kstrdup+0x2e/0x60 [<00000000f0f4633f>] 0xffffffffc0e07ee6 [<0000000053006c05>] 0xffffffffc0dff783 [<00000000419ae922>] configfs_write_iter+0xb1/0x120 [<000000008183c424>] vfs_write+0x2be/0x3c0 [<000000009005a2a5>] ksys_write+0x5f/0xe0 [<00000000cd495c89>] do_syscall_64+0x38/0x90 [<00000000f2a84ac5>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 8d6e38f636ac063e8062a21e7616f7d9bf0df5d8 Author: Tiago Dias Ferreira Date: Wed Nov 16 00:17:56 2022 -0300 nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000 Added a quirk to fix the Netac NV7000 SSD reporting duplicate NGUIDs. Cc: Signed-off-by: Tiago Dias Ferreira Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 26e01ee19b20695487ed6e19c75eb987642eeee9 Author: Nicolas Schier Date: Sat Nov 12 09:07:17 2022 +0100 MAINTAINERS: Add linux-kbuild's patchwork Add patchwork URL for Kconfig and Kbuild. Signed-off-by: Nicolas Schier Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 85c2d6d82774368d19b3febc4cfed5957a32e976 Author: Nicolas Schier Date: Sat Nov 12 09:07:16 2022 +0100 MAINTAINERS: Remove Michal Marek from Kbuild maintainers Remove Michal Marek from Kbuild maintainers as there is no response from him since October 2017. Add an entry for Michal in CREDITS. Michal, thanks for maintaining Kbuild for almost eight years! Suggested-by: Nick Desaulniers Cc: Michal Marek Signed-off-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit 869e1504e1afcb663e04e93954a771d44fa2a669 Author: Nicolas Schier Date: Sat Nov 12 09:07:15 2022 +0100 MAINTAINERS: Add Nathan and Nicolas to Kbuild reviewers As suggested by Nick, add Nathan and myself to Kbuild reviewers to share more review responsibilities. Signed-off-by: Nicolas Schier Acked-by: Nick Desaulniers Acked-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 4e0c19fcb8b5323716140fa82b79aa9f60e60407 Author: Vladimir Oltean Date: Mon Nov 14 16:35:51 2022 +0200 net: dsa: don't leak tagger-owned storage on switch driver unbind In the initial commit dc452a471dba ("net: dsa: introduce tagger-owned storage for private and shared data"), we had a call to tag_ops->disconnect(dst) issued from dsa_tree_free(), which is called at tree teardown time. There were problems with connecting to a switch tree as a whole, so this got reworked to connecting to individual switches within the tree. In this process, tag_ops->disconnect(ds) was made to be called only from switch.c (cross-chip notifiers emitted as a result of dynamic tag proto changes), but the normal driver teardown code path wasn't replaced with anything. Solve this problem by adding a function that does the opposite of dsa_switch_setup_tag_protocol(), which is called from the equivalent spot in dsa_switch_teardown(). The positioning here also ensures that we won't have any use-after-free in tagging protocol (*rcv) ops, since the teardown sequence is as follows: dsa_tree_teardown -> dsa_tree_teardown_master -> dsa_master_teardown -> unsets master->dsa_ptr, making no further packets match the ETH_P_XDSA packet type handler -> dsa_tree_teardown_ports -> dsa_port_teardown -> dsa_slave_destroy -> unregisters DSA net devices, there is even a synchronize_net() in unregister_netdevice_many() -> dsa_tree_teardown_switches -> dsa_switch_teardown -> dsa_switch_teardown_tag_protocol -> finally frees the tagger-owned storage Fixes: 7f2973149c22 ("net: dsa: make tagging protocols connect to individual switches from a tree") Signed-off-by: Vladimir Oltean Reviewed-by: Saeed Mahameed Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221114143551.1906361-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 2929cceb2fcf0ded7182562e4888afafece82cce Author: Wei Yongjun Date: Mon Nov 14 11:05:19 2022 +0000 net/x25: Fix skb leak in x25_lapb_receive_frame() x25_lapb_receive_frame() using skb_copy() to get a private copy of skb, the new skb should be freed in the undersized/fragmented skb error handling path. Otherwise there is a memory leak. Fixes: cb101ed2c3c7 ("x25: Handle undersized/fragmented skbs") Signed-off-by: Wei Yongjun Acked-by: Martin Schiller Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit c9b895c6878bdb6789dc1d7af60fd10f4a9f1937 Author: Liu Jian Date: Mon Nov 14 17:55:49 2022 +0800 net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up. And if phylink_of_phy_connect() fails, nothing needs to be done. Compile tested only. Fixes: 892e09153fa3 ("net: ag71xx: port to phylink") Signed-off-by: Liu Jian Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20221114095549.40342-1-liujian56@huawei.com Signed-off-by: Jakub Kicinski commit 59d0d52c30d4991ac4b329f049cc37118e00f5b0 Merge: 81e7cfa3a9eb4 5e51c627c5acb Author: Linus Torvalds Date: Tue Nov 15 14:56:23 2022 -0800 AMerge tag 'netfs-fixes-20221115' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull netfx fixes from David Howells: "Two fixes, affecting the functions that iterates over the pagecache unmarking or unlocking pages after an op is complete: - xas_for_each() loops must call xas_retry() first thing and immediately do a "continue" in the case that the extracted value is a special value that indicates that the walk raced with a modification. Fix the unlock and unmark loops to do this. - The maths in the unlock loop is dodgy as it could, theoretically, at some point in the future end up with a starting file pointer that is in the middle of a folio. This will cause a subtraction to go negative - but the number is unsigned. Fix the maths to use absolute file positions instead of relative page indices" * tag 'netfs-fixes-20221115' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: netfs: Fix dodgy maths netfs: Fix missing xas_retry() calls in xarray iteration commit 5954acbacbd1946b96ce8ee799d309cb0cd3cb9d Author: Simon Rettberg Date: Thu Oct 6 11:33:14 2022 +0200 drm/display: Don't assume dual mode adaptors support i2c sub-addressing Current dual mode adaptor ("DP++") detection code assumes that all adaptors support i2c sub-addressing for read operations from the DP-HDMI adaptor ID buffer. It has been observed that multiple adaptors do not in fact support this, and always return data starting at register 0. On affected adaptors, the code fails to read the proper registers that would identify the device as a type 2 adaptor, and handles those as type 1, limiting the TMDS clock to 165MHz, even if the according register would announce a higher TMDS clock. Fix this by always reading the ID buffer starting from offset 0, and discarding any bytes before the actual offset of interest. We tried finding authoritative documentation on whether or not this is allowed behaviour, but since all the official VESA docs are paywalled, the best we could come up with was the spec sheet for Texas Instruments' SNx5DP149 chip family.[1] It explicitly mentions that sub-addressing is supported for register writes, but *not* for reads (See NOTE in section 8.5.3). Unless TI openly decided to violate the VESA spec, one could take that as a hint that sub-addressing is in fact not mandated by VESA. The other two adaptors affected used the PS8409(A) and the LT8611, according to the data returned from their ID buffers. [1] https://www.ti.com/lit/ds/symlink/sn75dp149.pdf Cc: stable@vger.kernel.org Signed-off-by: Simon Rettberg Reviewed-by: Rafael Gieschke Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221006113314.41101987@computer Acked-by: Jani Nikula commit d520de6cb42e88a1d008b54f935caf9fc05951da Author: Anastasia Belova Date: Tue Nov 15 17:27:01 2022 +0300 cifs: add check for returning value of SMB2_close_init If the returning value of SMB2_close_init is an error-value, exit the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 352d96f3acc6 ("cifs: multichannel: move channel selection above transport layer") Signed-off-by: Anastasia Belova Signed-off-by: Steve French commit 81e7cfa3a9eb4ba6993a9c71772fdab21bc5d870 Merge: 2632daebafd04 37020bbb71d91 Author: Linus Torvalds Date: Tue Nov 15 10:30:34 2022 -0800 Merge tag 'erofs-for-6.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "Most patches randomly fix error paths or corner cases in fscache mode reported recently. One fixes an invalid access relating to fragments on crafted images. Summary: - Fix packed_inode invalid access when reading fragments on crafted images - Add a missing erofs_put_metabuf() in an error path in fscache mode - Fix incorrect `count' for unmapped extents in fscache mode - Fix use-after-free of fsid and domain_id string when remounting - Fix missing xas_retry() in fscache mode" * tag 'erofs-for-6.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix missing xas_retry() in fscache mode erofs: fix use-after-free of fsid and domain_id string erofs: get correct count for unmapped range in fscache mode erofs: put metabuf in error path in fscache mode erofs: fix general protection fault when reading fragment commit 4b14841c9a820e484bc8c4c3f5a6fed1bc528cbc Author: Evan Quan Date: Tue Nov 8 15:52:20 2022 +0800 drm/amd/pm: fix SMU13 runpm hang due to unintentional workaround The workaround designed for some specific ASICs is wrongly applied to SMU13 ASICs. That leads to some runpm hang. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit df7c013efc1a0da8861099802b2d6ab2aacaeb1b Author: Evan Quan Date: Tue Nov 8 16:07:39 2022 +0800 drm/amd/pm: enable runpm support over BACO for SMU13.0.7 Enable SMU13.0.7 runpm support. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 8652da45d09abe1b3174dbb80dc5176b8c3fa08e Author: Evan Quan Date: Tue Nov 8 15:44:46 2022 +0800 drm/amd/pm: enable runpm support over BACO for SMU13.0.0 Enable SMU13.0.0 runpm support. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit f8794f31abf33a3b22c72002783670a95e6efc51 Author: Alex Deucher Date: Fri Nov 11 12:50:38 2022 -0500 drm/amdgpu: there is no vbios fb on devices with no display hw (v2) If we enable virtual display functionality on parts with no display hardware we can end up trying to check for and reserve the vbios FB area on devices where it doesn't exist. Check if display hardware is actually present on the hardware before trying to reserve the memory. v2: move the check into common code Acked-by: Evan Quan Signed-off-by: Alex Deucher commit 6f9eea4392a178af19360694b1db64f985d0b459 Author: Eric Huang Date: Mon Nov 14 11:43:48 2022 -0500 drm/amdkfd: Fix a memory limit issue It is to resolve a regression, which fails to allocate VRAM due to no free memory in application, the reason is we add check of vram_pin_size for memory limit, and application is pinning the memory for Peerdirect, KFD should not count it in memory limit. So removing vram_pin_size will resolve it. Signed-off-by: Eric Huang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 192039f12233c9063d040266e7c98188c7c89dec Author: Guchun Chen Date: Fri Nov 11 16:54:18 2022 +0800 drm/amdgpu: disable BACO support on more cards Otherwise, some unexpected PCIE AER errors will be observed in runtime suspend/resume cycle. Signed-off-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0e444a4de6b38c4593a07e4cfb5bf54c40cc79b6 Author: Melissa Wen Date: Thu Nov 3 17:45:00 2022 -0100 drm/amd/display: don't enable DRM CRTC degamma property for DCE DM maps DRM CRTC degamma to DPP (pre-blending) degamma block, but DCE doesn't support programmable degamma curve anywhere. Currently, a custom degamma is accepted by DM but just ignored by DCE driver and degamma correction isn't actually applied. There is no way to map custom degamma in DCE, therefore, DRM CRTC degamma property shouldn't be enabled for DCE drivers. Reviewed-by: Rodrigo Siqueira Signed-off-by: Melissa Wen Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f8d7edb0cda6ea1cba89d6f8aac74613e9cdc075 Author: Dillon Varone Date: Thu Nov 3 18:40:01 2022 -0400 drm/amd/display: Set max for prefetch lines on dcn32 [WHY?] Max number of lines that can be used for prefetch due to type constraints is 63.75. [HOW?] Enforce maximum prefetch lines as 63.75. Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c149947b188c651b943c1d8ca1494d1a98a3e27f Author: Dillon Varone Date: Thu Nov 3 18:38:13 2022 -0400 drm/amd/display: use uclk pstate latency for fw assisted mclk validation dcn32 [WHY?] DCN32 uses fclk pstate watermarks for dummy pstate, and must always be supported. [HOW?] Validation needs to be run with fclk pstate latency set as the dummy pstate latency to get correct prefetch and bandwidth outputs. Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 246e667079e8d0fc85f842bceca8c5a3c5da5905 Author: Dillon Varone Date: Thu Nov 3 18:33:38 2022 -0400 drm/amd/display: Fix prefetch calculations for dcn32 [Description] Prefetch calculation loop was not exiting until utilizing all of vstartup if it failed once. Locals need to be reset on each iteration of the loop. Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit e7e4f77c991c9abf90924929a9d55f90b0bb78de Author: Roman Li Date: Thu Nov 3 17:33:07 2022 -0400 drm/amd/display: Fix optc2_configure warning on dcn314 [Why] dcn314 uses optc2_configure_crc() that wraps optc1_configure_crc() + set additional registers not applicable to dcn314. It's not critical but when used leads to warning like: WARNING: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c Call Trace: generic_reg_set_ex+0x6d/0xe0 [amdgpu] optc2_configure_crc+0x60/0x80 [amdgpu] dc_stream_configure_crc+0x129/0x150 [amdgpu] amdgpu_dm_crtc_configure_crc_source+0x5d/0xe0 [amdgpu] [How] Use optc1_configure_crc() directly Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 4d285241230676ba8b888701b89684b4e0360fcc Author: George Shen Date: Tue Nov 1 23:03:03 2022 -0400 drm/amd/display: Fix calculation for cursor CAB allocation [Why] The cursor size (in memory) is currently incorrectly calculated, resulting not enough CAB being allocated for static screen cursor in MALL refresh. This results in cursor image corruption. [How] Use cursor pitch instead of cursor width when calculating cursor size. Update num cache lines calculation to use the result of the cursor size calculation instead of manually recalculating again. Reviewed-by: Alvin Lee Acked-by: Tom Chung Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 0a3e0fb8cfee4f45f1b1f3d4d028a4519c89d577 Author: Simon Ser Date: Mon Oct 17 15:31:57 2022 +0000 Revert "drm: hide unregistered connectors from GETCONNECTOR IOCTL" This reverts commit 981f09295687f856d5345e19c7084aca481c1395. It turns out this causes logically active but disconnected DP MST connectors to disappear from the KMS resources list, and Mutter then assumes the connector is already disabled. Later on Mutter tries to re-use the same CRTC but fails since on the kernel side it's still tied to the disconnected DP MST connector. Signed-off-by: Simon Ser Tested-by: Jonas Ådahl Reviewed-by: Lyude Paul Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20221017153150.60675-1-contact@emersion.fr commit 7e952a18eb978a3e51fc1704b752378be66226b2 Author: George Shen Date: Wed Nov 2 15:06:48 2022 -0400 drm/amd/display: Support parsing VRAM info v3.0 from VBIOS [Why] For DCN3.2 and DCN3.21, VBIOS has switch to using v3.0 of the VRAM info struct. We should read and override the VRAM info in driver with values provided by VBIOS to support memory downbin cases. Reviewed-by: Alvin Lee Acked-by: Tom Chung Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 2632daebafd04746b4b96c2f26a6021bc38f6209 Author: Borislav Petkov Date: Mon Nov 14 12:44:01 2022 +0100 x86/cpu: Restore AMD's DE_CFG MSR after resume DE_CFG contains the LFENCE serializing bit, restore it on resume too. This is relevant to older families due to the way how they do S3. Unify and correct naming while at it. Fixes: e4d0e84e4907 ("x86/cpu/AMD: Make LFENCE a serializing instruction") Reported-by: Andrew Cooper Reported-by: Pawan Gupta Signed-off-by: Borislav Petkov Cc: Signed-off-by: Linus Torvalds commit 8d8494c3467d366eb0f7c8198dab80be8bdc47d2 Author: Stylon Wang Date: Wed Oct 26 21:00:40 2022 +0800 drm/amd/display: Fix invalid DPIA AUX reply causing system hang [Why] Some DPIA AUX replies have incorrect data length from original request. This could lead to overwriting of destination buffer if reply length is larger, which could cause invalid access to stack since many destination buffers are declared as local variables. [How] Check for invalid length from DPIA AUX replies and trigger a retry if reply length is not the same as original request. A DRM_WARN() dmesg log is also produced. Reviewed-by: Roman Li Acked-by: Tom Chung Signed-off-by: Stylon Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 2c2911e09f19eac85df83b3201b38e69b8117059 Author: Candice Li Date: Sat Nov 12 16:24:20 2022 +0800 drm/amdgpu: Add psp_13_0_10_ta firmware to modinfo TA firmware loaded on psp v13_0_10, but it is missing in modinfo. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7af87fc1ba136143314c870059b8f60180247cbd Author: Rodrigo Siqueira Date: Mon Oct 31 14:58:12 2022 -0400 drm/amd/display: Add HUBP surface flip interrupt handler On IGT, there is a test named amd_hotplug, and when the subtest basic is executed on DCN31, we get the following error: [drm] *ERROR* [CRTC:71:crtc-0] flip_done timed out [drm] *ERROR* flip_done timed out [drm] *ERROR* [CRTC:71:crtc-0] commit wait timed out [drm] *ERROR* flip_done timed out [drm] *ERROR* [CONNECTOR:88:DP-1] commit wait timed out [drm] *ERROR* flip_done timed out [drm] *ERROR* [PLANE:59:plane-3] commit wait timed out After enable the page flip log with the below command: echo -n 'format "[PFLIP]" +p' > /sys/kernel/debug/dynamic_debug/control It is possible to see that the flip was submitted, but DC never replied back, which generates time-out issues. This is an indication that the HUBP surface flip is missing. This commit fixes this issue by adding hubp1_set_flip_int to DCN31. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 0d502ef8898b3983eef9e40f50dfe100a0de5d93 Author: Stylon Wang Date: Mon Oct 24 15:36:16 2022 +0800 drm/amd/display: Fix access timeout to DPIA AUX at boot time [Why] Since introduction of patch "Query DPIA HPD status.", link detection at boot could be accessing DPIA AUX, which will not succeed until DMUB outbox messaging is enabled and results in below dmesg logs: [ 160.840227] [drm:amdgpu_dm_process_dmub_aux_transfer_sync [amdgpu]] *ERROR* wait_for_completion_timeout timeout! [How] Enable DMUB outbox messaging before link detection at boot time. Reviewed-by: Wayne Lin Acked-by: Tom Chung Signed-off-by: Stylon Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 5428672d39b7750310cf4e328e9f94a7668b5565 Author: Dong Chenchen Date: Thu Nov 10 22:33:14 2022 +0800 drm/amdgpu: Fix memory leak in amdgpu_cs_pass1 When p->gang_size equals 0, amdgpu_cs_pass1() will return directly without freeing chunk_array, which will cause a memory leak issue, this patch fixes it. Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6") Reviewed-by: Luben Tuikov Signed-off-by: Dong Chenchen Signed-off-by: Alex Deucher commit 1abfd71ee8f3ed99c5d0df5d9843a360541d6808 Author: Takashi Iwai Date: Tue Nov 15 18:02:35 2022 +0100 ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 Samsung Galaxy Book Pro 360 (13" 2021 NP930QBD-ke1US) with codec SSID 144d:c1a6 requires the same workaround for enabling the speaker amp like other Samsung models with ALC298 codec. Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1205100 Cc: Link: https://lore.kernel.org/r/20221115170235.18875-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b18a456330e1c1ca207b57b45872f10336741388 Author: Emil Flink Date: Tue Nov 15 15:45:01 2022 +0100 ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro The Samsung Galaxy Book Pro seems to have the same issue as a few other Samsung laptops, detailed in kernel bug report 207423. Sound from headphone jack works, but not the built-in speakers. alsa-info: http://alsa-project.org/db/?f=b40ba609dc6ae28dc84ad404a0d8a4bbcd8bea6d Signed-off-by: Emil Flink Cc: Link: https://lore.kernel.org/r/20221115144500.7782-1-emil.flink@gmail.com Signed-off-by: Takashi Iwai commit 5e51c627c5acbcf82bb552e17533a79d2a6a2600 Author: David Howells Date: Fri Nov 4 15:36:49 2022 +0000 netfs: Fix dodgy maths Fix the dodgy maths in netfs_rreq_unlock_folios(). start_page could be inside the folio, in which case the calculation of pgpos will be come up with a negative number (though for the moment rreq->start is rounded down earlier and folios would have to get merged whilst locked) Alter how this works to just frame the tracking in terms of absolute file positions, rather than offsets from the start of the I/O request. This simplifies the maths and makes it easier to follow. Fix the issue by using folio_pos() and folio_size() to calculate the end position of the page. Fixes: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers") Reported-by: Matthew Wilcox Signed-off-by: David Howells Reviewed-by: Jeff Layton Reviewed-by: Jingbo Xu cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/Y2SJw7w1IsIik3nb@casper.infradead.org/ Link: https://lore.kernel.org/r/166757988611.950645.7626959069846893164.stgit@warthog.procyon.org.uk/ # v2 commit 7e043a80b5dae5c2d2cf84031501de7827fd6c00 Author: David Howells Date: Thu Nov 3 16:08:14 2022 +0000 netfs: Fix missing xas_retry() calls in xarray iteration netfslib has a number of places in which it performs iteration of an xarray whilst being under the RCU read lock. It *should* call xas_retry() as the first thing inside of the loop and do "continue" if it returns true in case the xarray walker passed out a special value indicating that the walk needs to be redone from the root[*]. Fix this by adding the missing retry checks. [*] I wonder if this should be done inside xas_find(), xas_next_node() and suchlike, but I'm told that's not an simple change to effect. This can cause an oops like that below. Note the faulting address - this is an internal value (|0x2) returned from xarray. BUG: kernel NULL pointer dereference, address: 0000000000000402 ... RIP: 0010:netfs_rreq_unlock+0xef/0x380 [netfs] ... Call Trace: netfs_rreq_assess+0xa6/0x240 [netfs] netfs_readpage+0x173/0x3b0 [netfs] ? init_wait_var_entry+0x50/0x50 filemap_read_page+0x33/0xf0 filemap_get_pages+0x2f2/0x3f0 filemap_read+0xaa/0x320 ? do_filp_open+0xb2/0x150 ? rmqueue+0x3be/0xe10 ceph_read_iter+0x1fe/0x680 [ceph] ? new_sync_read+0x115/0x1a0 new_sync_read+0x115/0x1a0 vfs_read+0xf3/0x180 ksys_read+0x5f/0xe0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Changes: ======== ver #2) - Changed an unsigned int to a size_t to reduce the likelihood of an overflow as per Willy's suggestion. - Added an additional patch to fix the maths. Fixes: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers") Reported-by: George Law Signed-off-by: David Howells Reviewed-by: Jeff Layton Reviewed-by: Jingbo Xu cc: Matthew Wilcox cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/166749229733.107206.17482609105741691452.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/166757987929.950645.12595273010425381286.stgit@warthog.procyon.org.uk/ # v2 commit d076f30957b1d026e9f6340691624926db0d369d Author: Maximilian Luz Date: Sun Nov 13 19:59:51 2022 +0100 platform/surface: aggregator_registry: Add support for Surface Pro 9 Add device nodes to enable support for battery and charger status, the ACPI platform profile, as well as internal and type-cover HID devices (including sensors, touchpad, keyboard, and other miscellaneous devices) on the Surface Pro 9. This does not include support for a tablet-mode switch yet, as that is now handled via the POS subsystem (unlike the Surface Pro 8, where it is handled via the KIP subsystem) and therefore needs further changes. While we're at it, also add the missing comment for the Surface Pro 8. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20221113185951.224759-2-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d9a477f643eb3de71fbea5ae6103b800ceb8f547 Author: Maximilian Luz Date: Sun Nov 13 19:59:50 2022 +0100 platform/surface: aggregator: Do not check for repeated unsequenced packets Currently, we check any received packet whether we have already seen it previously, regardless of the packet type (sequenced / unsequenced). We do this by checking the sequence number. This assumes that sequence numbers are valid for both sequenced and unsequenced packets. However, this assumption appears to be incorrect. On some devices, the sequence number field of unsequenced packets (in particular HID input events on the Surface Pro 9) is always zero. As a result, the current retransmission check kicks in and discards all but the first unsequenced packet, breaking (among other things) keyboard and touchpad input. Note that we have, so far, only seen packets being retransmitted in sequenced communication. In particular, this happens when there is an ACK timeout, causing the EC (or us) to re-send the packet waiting for an ACK. Arguably, retransmission / duplication of unsequenced packets should not be an issue as there is no logical condition (such as an ACK timeout) to determine when a packet should be sent again. Therefore, remove the retransmission check for unsequenced packets entirely to resolve the issue. Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20221113185951.224759-1-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1e817b889c7d8c14e7005258e15fec62edafe03c Author: Hans de Goede Date: Fri Nov 11 12:16:39 2022 +0100 platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017) Like the Acer Switch 10 (SW5-012) and Acer Switch 10 (S1003) models the Acer Switch V 10 (SW5-017) supports reporting SW_TABLET_MODE through acer-wmi. Add a DMI quirk for the SW5-017 setting force_caps to ACER_CAP_KBD_DOCK (these devices have no other acer-wmi based functionality). Cc: Rudolf Polzer Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20221111111639.35730-1-hdegoede@redhat.com commit d0cdd85046b15089df71a50548617ac1025300d0 Author: Xiongfeng Wang Date: Fri Nov 11 18:07:52 2022 +0800 platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() pci_get_device() will increase the reference count for the returned pci_dev. We need to use pci_dev_put() to decrease the reference count before asus_wmi_set_xusb2pr() returns. Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/20221111100752.134311-1-wangxiongfeng2@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 013c1c5585ebcfb19c88efe79063d0463b1b6159 Author: Anand Jain Date: Thu Nov 10 11:36:31 2022 +0530 btrfs: free btrfs_path before copying subvol info to userspace btrfs_ioctl_get_subvol_info() frees the search path after the userspace copy from the temp buffer @subvol_info. This can lead to a lock splat warning. Fix this by freeing the path before we copy it to userspace. CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8cf96b409d9b3946ece58ced13f92d0f775b0442 Author: Anand Jain Date: Thu Nov 10 11:36:29 2022 +0530 btrfs: free btrfs_path before copying fspath to userspace btrfs_ioctl_ino_to_path() frees the search path after the userspace copy from the temp buffer @ipath->fspath. Which potentially can lead to a lock splat warning. Fix this by freeing the path before we copy it to userspace. CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 418ffb9e3cf6c4e2574d3a732b724916684bd133 Author: Anand Jain Date: Thu Nov 10 11:36:28 2022 +0530 btrfs: free btrfs_path before copying inodes to userspace btrfs_ioctl_logical_to_ino() frees the search path after the userspace copy from the temp buffer @inodes. Which potentially can lead to a lock splat. Fix this by freeing the path before we copy @inodes to userspace. CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2dbfb3f33350e1e868d3d7ed4c176d8777150878 Author: Roger Pau Monné Date: Thu Nov 10 17:31:44 2022 +0100 platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized The current logic in the Intel PMC driver will forcefully attach it when detecting any CPU on the intel_pmc_core_platform_ids array, even if the matching ACPI device is not present. There's no checking in pmc_core_probe() to assert that the PMC device is present, and hence on virtualized environments the PMC device probes successfully, even if the underlying registers are not present. Before commit 21ae43570940 ("platform/x86: intel_pmc_core: Substitute PCI with CPUID enumeration") the driver would check for the presence of a specific PCI device, and that prevented the driver from attaching when running virtualized. Fix by only forcefully attaching the PMC device when not running virtualized. Note that virtualized platforms can still get the device to load if the appropriate ACPI device is present on the tables provided to the VM. Make an exception for the Xen initial domain, which does have full hardware access, and hence can attach to the PMC if present. Fixes: 21ae43570940 ("platform/x86: intel_pmc_core: Substitute PCI with CPUID enumeration") Signed-off-by: Roger Pau Monné Acked-by: David E. Box Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221110163145.80374-1-roger.pau@citrix.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 53e16a6e3e69425081f8352e13e9fd23bf1abfca Author: Lennard Gäher Date: Tue Nov 8 08:20:23 2022 +0100 platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type Previously, the s2idle quirk was only active for the 21A0 machine type of the P14s Gen2a product. This also enables it for the second 21A1 type, thus reducing wake-up times from s2idle. Signed-off-by: Lennard Gäher Suggested-by: Mario Limonciello Reviewed-by: Mario Limonciello Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2181 Link: https://lore.kernel.org/r/20221108072023.17069-1-gaeher@mpi-sws.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6412518f5cb953cbd84b6746db9741bfc92be40a Author: Shyam Sundar S K Date: Wed Nov 9 14:03:46 2022 +0530 platform/x86/amd: pmc: Add new ACPI ID AMDI0009 Add new a new ACPI ID AMDI0009 used by upcoming AMD platform to the pmc supported list of devices. Cc: stable@vger.kernel.org # 6.0 Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20221109083346.361603-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6827df0911c3042a60eb0a462bf7a620f9e33879 Author: Conor Dooley Date: Wed Nov 9 21:22:20 2022 +0000 MAINTAINERS: repair Microchip corei2c driver entry The driver was renamed before application but the relevant change did not propagate to the MAINTAINERS patch that was applied. Repair it. CC: Lukas Bulwahn Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221109212219.1598355-5-conor@kernel.org Signed-off-by: Arnd Bergmann commit 71bbc3c32e5a60c9dfc14632892744679adea76c Author: Conor Dooley Date: Wed Nov 9 21:22:19 2022 +0000 MAINTAINERS: add an entry for StarFive devicetrees Emil looks after the downstream StarFive stuff, and agreed to look after the upstream ones too. CC: Emil Renner Berthing Signed-off-by: Conor Dooley Acked-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20221109212219.1598355-4-conor@kernel.org Signed-off-by: Arnd Bergmann commit 5836bf833a763e1573ce6fe5d0c310af23ebd49d Author: Conor Dooley Date: Wed Nov 9 21:22:18 2022 +0000 MAINTAINERS: generify the Microchip RISC-V entry name These drivers work on our other FPGAs, for example the non-SoC PolarFire connected to an FU-540 via chiplink. Make the entry a wee bit more generic to match. While at it, remove the / from the heading so that it matches other, neighbouring RISC-V entries. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221109212219.1598355-3-conor@kernel.org Signed-off-by: Arnd Bergmann commit be7d172b0f911e356a1cba5ea96f8e5a116bb7cb Author: Conor Dooley Date: Wed Nov 9 21:22:17 2022 +0000 MAINTAINERS: add entries for misc. RISC-V SoC drivers and devicetrees Following some discussion both on & off list, I have volunteered to take over maintaining the miscellaneous RISC-V devicetrees & soc drivers from Palmer to ease his load. So far only SiFive and Microchip have stuff in drivers/soc. For the former, a SiFive entry exists with a dead GitHub repo - so remove that to avoid confusion since the patches for drivers/soc & devicetrees will be routed via my tree & other drivers go through their subsystem trees. The Microchip directory only contains a RISC-V driver for now, but is likely to contain drivers for other archs in the future. To that end, change the PolarFire SoC entry to specifically mention the RISC-V driver & the new directory level entry does not mention an architecture. CC: Arnd Bergmann CC: Nicolas Ferre CC: Palmer Dabbelt Link: https://lore.kernel.org/linux-riscv/mhng-e4210f56-fcc3-4db8-abdb-d43b3ebe695d@palmer-ri-x1c9a/ Signed-off-by: Conor Dooley Acked-by: Nicolas Ferre Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20221109212219.1598355-2-conor@kernel.org Signed-off-by: Arnd Bergmann commit 2afac81dd16544d825f309fd992d2af6304353df Author: Benjamin Tissoires Date: Thu Nov 3 16:57:42 2022 +0100 HID: fix I2C_HID not selected when I2C_HID_OF_ELAN is When I2C_HID_OF_ELAN is set, we need to turn on I2C_HID_CORE to ensure we get all the HID requirements. Fixes: bd3cba00dcc6 ("HID: i2c-hid: elan: Add support for Elan eKTH6915 i2c-hid touchscreens") Reported-by: kernel test robot Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit a7a1598189228b5007369a9622ccdf587be0730f Author: Dan Carpenter Date: Tue Nov 15 16:16:43 2022 +0300 drbd: use after free in drbd_create_device() The drbd_destroy_connection() frees the "connection" so use the _safe() iterator to prevent a use after free. Fixes: b6f85ef9538b ("drbd: Iterate over all connections") Signed-off-by: Dan Carpenter Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/Y3Jd5iZRbNQ9w6gm@kili Signed-off-by: Jens Axboe commit 47df8a2f78bc34ff170d147d05b121f84e252b85 Author: Hou Tao Date: Mon Nov 14 17:57:33 2022 +0800 bpf, perf: Use subprog name when reporting subprog ksymbol Since commit bfea9a8574f3 ("bpf: Add name to struct bpf_ksym"), when reporting subprog ksymbol to perf, prog name instead of subprog name is used. The backtrace of bpf program with subprogs will be incorrect as shown below: ffffffffc02deace bpf_prog_e44a3057dcb151f8_overwrite+0x66 ffffffffc02de9f7 bpf_prog_e44a3057dcb151f8_overwrite+0x9f ffffffffa71d8d4e trace_call_bpf+0xce ffffffffa71c2938 perf_call_bpf_enter.isra.0+0x48 overwrite is the entry program and it invokes the overwrite_htab subprog through bpf_loop, but in above backtrace, overwrite program just jumps inside itself. Fixing it by using subprog name when reporting subprog ksymbol. After the fix, the output of perf script will be correct as shown below: ffffffffc031aad2 bpf_prog_37c0bec7d7c764a4_overwrite_htab+0x66 ffffffffc031a9e7 bpf_prog_c7eb827ef4f23e71_overwrite+0x9f ffffffffa3dd8d4e trace_call_bpf+0xce ffffffffa3dc2938 perf_call_bpf_enter.isra.0+0x48 Fixes: bfea9a8574f3 ("bpf: Add name to struct bpf_ksym") Signed-off-by: Hou Tao Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20221114095733.158588-1-houtao@huaweicloud.com commit eca13f3c67b6ddfcc61fdb9bb1c5f9a7724e2359 Author: Christian König Date: Wed Nov 9 19:54:09 2022 +0100 drm/amdgpu: use the last IB as gang leader v2 It turned out that not the last IB specified is the gang leader, but instead the last job allocated. This is a bit unfortunate and not very intuitive for the CS interface, so try to fix this. Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20221115094206.6181-1-christian.koenig@amd.com Tested-by: Timur Kristóf Acked-by: Timur Kristóf Reviewed-by: Alex Deucher Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6") commit b740d806166979488e798e41743aaec051f2443f Author: Josef Bacik Date: Mon Nov 7 11:44:51 2022 -0500 btrfs: free btrfs_path before copying root refs to userspace Syzbot reported the following lockdep splat ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Not tainted ------------------------------------------------------ syz-executor307/3029 is trying to acquire lock: ffff0000c02525d8 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x54/0xb4 mm/memory.c:5576 but task is already holding lock: ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock fs/btrfs/locking.c:134 [inline] ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: btrfs_tree_read_lock fs/btrfs/locking.c:140 [inline] ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: btrfs_read_lock_root_node+0x13c/0x1c0 fs/btrfs/locking.c:279 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (btrfs-root-00){++++}-{3:3}: down_read_nested+0x64/0x84 kernel/locking/rwsem.c:1624 __btrfs_tree_read_lock fs/btrfs/locking.c:134 [inline] btrfs_tree_read_lock fs/btrfs/locking.c:140 [inline] btrfs_read_lock_root_node+0x13c/0x1c0 fs/btrfs/locking.c:279 btrfs_search_slot_get_root+0x74/0x338 fs/btrfs/ctree.c:1637 btrfs_search_slot+0x1b0/0xfd8 fs/btrfs/ctree.c:1944 btrfs_update_root+0x6c/0x5a0 fs/btrfs/root-tree.c:132 commit_fs_roots+0x1f0/0x33c fs/btrfs/transaction.c:1459 btrfs_commit_transaction+0x89c/0x12d8 fs/btrfs/transaction.c:2343 flush_space+0x66c/0x738 fs/btrfs/space-info.c:786 btrfs_async_reclaim_metadata_space+0x43c/0x4e0 fs/btrfs/space-info.c:1059 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 -> #2 (&fs_info->reloc_mutex){+.+.}-{3:3}: __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 btrfs_record_root_in_trans fs/btrfs/transaction.c:516 [inline] start_transaction+0x248/0x944 fs/btrfs/transaction.c:752 btrfs_start_transaction+0x34/0x44 fs/btrfs/transaction.c:781 btrfs_create_common+0xf0/0x1b4 fs/btrfs/inode.c:6651 btrfs_create+0x8c/0xb0 fs/btrfs/inode.c:6697 lookup_open fs/namei.c:3413 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x804/0x11c4 fs/namei.c:3688 do_filp_open+0xdc/0x1b8 fs/namei.c:3718 do_sys_openat2+0xb8/0x22c fs/open.c:1313 do_sys_open fs/open.c:1329 [inline] __do_sys_openat fs/open.c:1345 [inline] __se_sys_openat fs/open.c:1340 [inline] __arm64_sys_openat+0xb0/0xe0 fs/open.c:1340 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #1 (sb_internal#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1826 [inline] sb_start_intwrite include/linux/fs.h:1948 [inline] start_transaction+0x360/0x944 fs/btrfs/transaction.c:683 btrfs_join_transaction+0x30/0x40 fs/btrfs/transaction.c:795 btrfs_dirty_inode+0x50/0x140 fs/btrfs/inode.c:6103 btrfs_update_time+0x1c0/0x1e8 fs/btrfs/inode.c:6145 inode_update_time fs/inode.c:1872 [inline] touch_atime+0x1f0/0x4a8 fs/inode.c:1945 file_accessed include/linux/fs.h:2516 [inline] btrfs_file_mmap+0x50/0x88 fs/btrfs/file.c:2407 call_mmap include/linux/fs.h:2192 [inline] mmap_region+0x7fc/0xc14 mm/mmap.c:1752 do_mmap+0x644/0x97c mm/mmap.c:1540 vm_mmap_pgoff+0xe8/0x1d0 mm/util.c:552 ksys_mmap_pgoff+0x1cc/0x278 mm/mmap.c:1586 __do_sys_mmap arch/arm64/kernel/sys.c:28 [inline] __se_sys_mmap arch/arm64/kernel/sys.c:21 [inline] __arm64_sys_mmap+0x58/0x6c arch/arm64/kernel/sys.c:21 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 __might_fault+0x7c/0xb4 mm/memory.c:5577 _copy_to_user include/linux/uaccess.h:134 [inline] copy_to_user include/linux/uaccess.h:160 [inline] btrfs_ioctl_get_subvol_rootref+0x3a8/0x4bc fs/btrfs/ioctl.c:3203 btrfs_ioctl+0xa08/0xa64 fs/btrfs/ioctl.c:5556 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xd0/0x140 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 other info that might help us debug this: Chain exists of: &mm->mmap_lock --> &fs_info->reloc_mutex --> btrfs-root-00 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(btrfs-root-00); lock(&fs_info->reloc_mutex); lock(btrfs-root-00); lock(&mm->mmap_lock); *** DEADLOCK *** 1 lock held by syz-executor307/3029: #0: ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock fs/btrfs/locking.c:134 [inline] #0: ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: btrfs_tree_read_lock fs/btrfs/locking.c:140 [inline] #0: ffff0000c958a608 (btrfs-root-00){++++}-{3:3}, at: btrfs_read_lock_root_node+0x13c/0x1c0 fs/btrfs/locking.c:279 stack backtrace: CPU: 0 PID: 3029 Comm: syz-executor307 Not tainted 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2053 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 __might_fault+0x7c/0xb4 mm/memory.c:5577 _copy_to_user include/linux/uaccess.h:134 [inline] copy_to_user include/linux/uaccess.h:160 [inline] btrfs_ioctl_get_subvol_rootref+0x3a8/0x4bc fs/btrfs/ioctl.c:3203 btrfs_ioctl+0xa08/0xa64 fs/btrfs/ioctl.c:5556 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xd0/0x140 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 We do generally the right thing here, copying the references into a temporary buffer, however we are still holding the path when we do copy_to_user from the temporary buffer. Fix this by freeing the path before we copy to user space. Reported-by: syzbot+4ef9e52e464c6ff47d9d@syzkaller.appspotmail.com CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit bdcdd86ca94b5e9faa18d6f4d3dda660ac5c887e Author: Filipe Manana Date: Fri Nov 11 00:54:40 2022 +0000 btrfs: fix assertion failure and blocking during nowait buffered write When doing a nowait buffered write we can trigger the following assertion: [11138.437027] assertion failed: !path->nowait, in fs/btrfs/ctree.c:4658 [11138.438251] ------------[ cut here ]------------ [11138.438254] kernel BUG at fs/btrfs/messages.c:259! [11138.438762] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI [11138.439450] CPU: 4 PID: 1091021 Comm: fsstress Not tainted 6.1.0-rc4-btrfs-next-128 #1 [11138.440611] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [11138.442553] RIP: 0010:btrfs_assertfail+0x19/0x1b [btrfs] [11138.443583] Code: 5b 41 5a 41 (...) [11138.446437] RSP: 0018:ffffbaf0cf05b840 EFLAGS: 00010246 [11138.447235] RAX: 0000000000000039 RBX: ffffbaf0cf05b938 RCX: 0000000000000000 [11138.448303] RDX: 0000000000000000 RSI: ffffffffb2ef59f6 RDI: 00000000ffffffff [11138.449370] RBP: ffff9165f581eb68 R08: 00000000ffffffff R09: 0000000000000001 [11138.450493] R10: ffff9167a88421f8 R11: 0000000000000000 R12: ffff9164981b1000 [11138.451661] R13: 000000008c8f1000 R14: ffff9164991d4000 R15: ffff9164981b1000 [11138.452225] FS: 00007f1438a66440(0000) GS:ffff9167ad600000(0000) knlGS:0000000000000000 [11138.452949] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [11138.453394] CR2: 00007f1438a64000 CR3: 0000000100c36002 CR4: 0000000000370ee0 [11138.454057] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [11138.454879] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [11138.455779] Call Trace: [11138.456211] [11138.456598] btrfs_next_old_leaf.cold+0x18/0x1d [btrfs] [11138.457827] ? kmem_cache_alloc+0x18d/0x2a0 [11138.458516] btrfs_lookup_csums_range+0x149/0x4d0 [btrfs] [11138.459407] csum_exist_in_range+0x56/0x110 [btrfs] [11138.460271] can_nocow_file_extent+0x27c/0x310 [btrfs] [11138.461155] can_nocow_extent+0x1ec/0x2e0 [btrfs] [11138.461672] btrfs_check_nocow_lock+0x114/0x1c0 [btrfs] [11138.462951] btrfs_buffered_write+0x44c/0x8e0 [btrfs] [11138.463482] btrfs_do_write_iter+0x42b/0x5f0 [btrfs] [11138.463982] ? lock_release+0x153/0x4a0 [11138.464347] io_write+0x11b/0x570 [11138.464660] ? lock_release+0x153/0x4a0 [11138.465213] ? lock_is_held_type+0xe8/0x140 [11138.466003] io_issue_sqe+0x63/0x4a0 [11138.466339] io_submit_sqes+0x238/0x770 [11138.466741] __do_sys_io_uring_enter+0x37b/0xb10 [11138.467206] ? lock_is_held_type+0xe8/0x140 [11138.467879] ? syscall_enter_from_user_mode+0x1d/0x50 [11138.468688] do_syscall_64+0x38/0x90 [11138.469265] entry_SYSCALL_64_after_hwframe+0x63/0xcd [11138.470017] RIP: 0033:0x7f1438c539e6 This is because to check if we can NOCOW, we check that if we can NOCOW into an extent (it's prealloc extent or the inode has NOCOW attribute), and then check if there are csums for the extent's range in the csum tree. The search may leave us beyond the last slot of a leaf, and then when we call btrfs_next_leaf() we end up at btrfs_next_old_leaf() with a time_seq of 0. This triggers a failure of the first assertion at btrfs_next_old_leaf(), since we have a nowait path. With assertions disabled, we simply don't respect the NOWAIT semantics, allowing the write to block on locks or blocking on IO for reading an extent buffer from disk. Fix this by: 1) Triggering the assertion only if time_seq is not 0, which means that search is being done by a tree mod log user, and in the buffered and direct IO write paths we don't use the tree mod log; 2) Implementing NOWAIT semantics at btrfs_next_old_leaf(). Any failure to lock an extent buffer should return immediately and not retry the search, as well as if we need to do IO to read an extent buffer from disk. Fixes: c922b016f353 ("btrfs: assert nowait mode is not used for some btree search functions") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit dfd10332596ef11ceafd29c4e21b4117be423fc4 Author: Russ Weight Date: Mon Nov 14 16:11:27 2022 -0800 fpga: m10bmc-sec: Fix kconfig dependencies The secure update driver depends on the firmware-upload functionality of the firmware-loader. The firmware-loader is carried in the firmware-class driver which is enabled with the tristate CONFIG_FW_LOADER option. The firmware-upload functionality is included in the firmware-class driver if the bool FW_UPLOAD config is set. The current dependency statement, "depends on FW_UPLOAD", is not adequate because it does not implicitly turn on FW_LOADER. Instead of adding a dependency, follow the convention used by drivers that require the FW_LOADER_USER_HELPER functionality of the firmware-loader by using select for both FW_LOADER and FW_UPLOAD. Fixes: bdf86d0e6ca3 ("fpga: m10bmc-sec: create max10 bmc secure update") Reported-by: kernel test robot Cc: stable@vger.kernel.org Signed-off-by: Russ Weight Acked-by: Randy Dunlap Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20221115001127.289890-1-russell.h.weight@intel.com Signed-off-by: Xu Yilun commit 9d45921ee4cb364910097e7d1b7558559c2f9fd2 Author: Ido Schimmel Date: Mon Nov 14 10:45:09 2022 +0200 bridge: switchdev: Fix memory leaks when changing VLAN protocol The bridge driver can offload VLANs to the underlying hardware either via switchdev or the 8021q driver. When the former is used, the VLAN is marked in the bridge driver with the 'BR_VLFLAG_ADDED_BY_SWITCHDEV' private flag. To avoid the memory leaks mentioned in the cited commit, the bridge driver will try to delete a VLAN via the 8021q driver if the VLAN is not marked with the previously mentioned flag. When the VLAN protocol of the bridge changes, switchdev drivers are notified via the 'SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL' attribute, but the 8021q driver is also called to add the existing VLANs with the new protocol and delete them with the old protocol. In case the VLANs were offloaded via switchdev, the above behavior is both redundant and buggy. Redundant because the VLANs are already programmed in hardware and drivers that support VLAN protocol change (currently only mlx5) change the protocol upon the switchdev attribute notification. Buggy because the 8021q driver is called despite these VLANs being marked with 'BR_VLFLAG_ADDED_BY_SWITCHDEV'. This leads to memory leaks [1] when the VLANs are deleted. Fix by not calling the 8021q driver for VLANs that were already programmed via switchdev. [1] unreferenced object 0xffff8881f6771200 (size 256): comm "ip", pid 446855, jiffies 4298238841 (age 55.240s) hex dump (first 32 bytes): 00 00 7f 0e 83 88 ff ff 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000012819ac>] vlan_vid_add+0x437/0x750 [<00000000f2281fad>] __br_vlan_set_proto+0x289/0x920 [<000000000632b56f>] br_changelink+0x3d6/0x13f0 [<0000000089d25f04>] __rtnl_newlink+0x8ae/0x14c0 [<00000000f6276baf>] rtnl_newlink+0x5f/0x90 [<00000000746dc902>] rtnetlink_rcv_msg+0x336/0xa00 [<000000001c2241c0>] netlink_rcv_skb+0x11d/0x340 [<0000000010588814>] netlink_unicast+0x438/0x710 [<00000000e1a4cd5c>] netlink_sendmsg+0x788/0xc40 [<00000000e8992d4e>] sock_sendmsg+0xb0/0xe0 [<00000000621b8f91>] ____sys_sendmsg+0x4ff/0x6d0 [<000000000ea26996>] ___sys_sendmsg+0x12e/0x1b0 [<00000000684f7e25>] __sys_sendmsg+0xab/0x130 [<000000004538b104>] do_syscall_64+0x3d/0x90 [<0000000091ed9678>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 279737939a81 ("net: bridge: Fix VLANs memory leak") Reported-by: Vlad Buslov Tested-by: Vlad Buslov Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20221114084509.860831-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit 598ab4b12eae70654b6d8af6038e6cdb45f22634 Merge: 18c532e44939c 510d7b6ae842e Author: Paolo Abeni Date: Tue Nov 15 13:29:28 2022 +0100 Merge branch 'net-hns3-this-series-bugfix-for-the-hns3-ethernet-driver' Hao Lan says: ==================== net: hns3: This series bugfix for the HNS3 ethernet driver. This series includes some bugfix for the HNS3 ethernet driver. Patch 1# fix incorrect hw rss hash type of rx packet. Fixes: 796640778c26 ("net: hns3: support RXD advanced layout") Fixes: 232fc64b6e62 ("net: hns3: Add HW RSS hash information to RX skb") Fixes: ea4858670717 ("net: hns3: handle the BD info on the last BD of the packet") Patch 2# fix return value check bug of rx copybreak. Fixes: e74a726da2c4 ("net: hns3: refactor hns3_nic_reuse_page()") Fixes: 99f6b5fb5f63 ("net: hns3: use bounce buffer when rx page can not be reused") Patch 3# net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process Fixes: f5f2b3e4dcc0 ("net: hns3: add support for imp-controlled PHYs") Fixes: c5ef83cbb1e9 ("net: hns3: fix for phy_addr error in hclge_mac_mdio_config") Fixes: 2312e050f42b ("net: hns3: Fix for deadlock problem occurring when unregistering ae_algo") ==================== Link: https://lore.kernel.org/r/20221114082048.49450-1-lanhao@huawei.com Signed-off-by: Paolo Abeni commit 510d7b6ae842e59ee00d57e5f07ac15131b6d899 Author: Guangbin Huang Date: Mon Nov 14 16:20:48 2022 +0800 net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process Currently, if driver is in phy-imp(phy controlled by imp firmware) mode, as driver did not update phy link ksettings after initialization process or not update advertising when getting phy link ksettings from firmware, it may set incorrect phy link ksettings for firmware in resetting process. So fix it. Fixes: f5f2b3e4dcc0 ("net: hns3: add support for imp-controlled PHYs") Fixes: c5ef83cbb1e9 ("net: hns3: fix for phy_addr error in hclge_mac_mdio_config") Fixes: 2312e050f42b ("net: hns3: Fix for deadlock problem occurring when unregistering ae_algo") Signed-off-by: Guangbin Huang Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit 29df7c695ed67a8fa32bb7805bad8fe2a76c1f88 Author: Jie Wang Date: Mon Nov 14 16:20:47 2022 +0800 net: hns3: fix return value check bug of rx copybreak The refactoring of rx copybreak modifies the original return logic, which will make this feature unavailable. So this patch fixes the return logic of rx copybreak. Fixes: e74a726da2c4 ("net: hns3: refactor hns3_nic_reuse_page()") Fixes: 99f6b5fb5f63 ("net: hns3: use bounce buffer when rx page can not be reused") Signed-off-by: Jie Wang Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit a56cad694767ebdb7d80f27ffc239db46fff64de Author: Jian Shen Date: Mon Nov 14 16:20:46 2022 +0800 net: hns3: fix incorrect hw rss hash type of rx packet Currently, the HNS3 driver reports the rss hash type of each packet based on the rss hash tuples set. It always reports PKT_HASH_TYPE_L4, without checking the type of current packet. It's incorrect. Fixes it by reporting it base on the packet type. Fixes: 796640778c26 ("net: hns3: support RXD advanced layout") Fixes: 232fc64b6e62 ("net: hns3: Add HW RSS hash information to RX skb") Fixes: ea4858670717 ("net: hns3: handle the BD info on the last BD of the packet") Signed-off-by: Jian Shen Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit 18c532e44939caa17f1fa380f7ac50dbc0718dbb Author: Aminuddin Jamaluddin Date: Mon Nov 14 14:53:02 2022 +0800 net: phy: marvell: add sleep time after enabling the loopback bit Sleep time is added to ensure the phy to be ready after loopback bit was set. This to prevent the phy loopback test from failing. Fixes: 020a45aff119 ("net: phy: marvell: add Marvell specific PHY loopback") Cc: # 5.15.x Signed-off-by: Muhammad Husaini Zulkifli Signed-off-by: Aminuddin Jamaluddin Link: https://lore.kernel.org/r/20221114065302.10625-1-aminuddin.jamaluddin@intel.com Signed-off-by: Paolo Abeni commit d349e9be5a2c2d7588a2c4e4bfa0bb3dc1226769 Author: Yuan Can Date: Mon Nov 14 02:56:59 2022 +0000 net: ena: Fix error handling in ena_init() The ena_init() won't destroy workqueue created by create_singlethread_workqueue() when pci_register_driver() failed. Call destroy_workqueue() when pci_register_driver() failed to prevent the resource leak. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Yuan Can Acked-by: Shay Agroskin Link: https://lore.kernel.org/r/20221114025659.124726-1-yuancan@huawei.com Signed-off-by: Paolo Abeni commit 5121197ecc5db58c07da95eb1ff82b98b121a221 Author: Cong Wang Date: Sun Nov 13 16:51:19 2022 -0800 kcm: close race conditions on sk_receive_queue sk->sk_receive_queue is protected by skb queue lock, but for KCM sockets its RX path takes mux->rx_lock to protect more than just skb queue. However, kcm_recvmsg() still only grabs the skb queue lock, so race conditions still exist. We can teach kcm_recvmsg() to grab mux->rx_lock too but this would introduce a potential performance regression as struct kcm_mux can be shared by multiple KCM sockets. So we have to enforce skb queue lock in requeue_rx_msgs() and handle skb peek case carefully in kcm_wait_data(). Fortunately, skb_recv_datagram() already handles it nicely and is widely used by other sockets, we can just switch to skb_recv_datagram() after getting rid of the unnecessary sock lock in kcm_recvmsg() and kcm_splice_read(). Side note: SOCK_DONE is not used by KCM sockets, so it is safe to get rid of this check too. I ran the original syzbot reproducer for 30 min without seeing any issue. Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot+278279efdd2730dd14bf@syzkaller.appspotmail.com Reported-by: shaozhengchao Cc: Paolo Abeni Cc: Tom Herbert Signed-off-by: Cong Wang Link: https://lore.kernel.org/r/20221114005119.597905-1-xiyou.wangcong@gmail.com Signed-off-by: Paolo Abeni commit a5b5fb0fc47ddc7d1ed6a0365197639a01bc1f3a Author: Mario Limonciello Date: Mon Nov 7 20:33:23 2022 -0600 platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks commit b37fe34c8309 ("platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks") removed most CONFIG_DEBUG_FS checks, but there were some left that were reported to cause compile test failures. Remove the remaining checks, and also the unnecessary CONFIG_SUSPEND used in the same place. Reported-by: liyupeng@zbhlos.com Fixes: b37fe34c8309 ("platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks") Signed-off-by: Mario Limonciello Link: https://bugzilla.kernel.org/show_bug.cgi?id=216679 Link: https://lore.kernel.org/r/20221108023323.19304-1-mario.limonciello@amd.com Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit da74858a475782a3f16470907814c8cc5950ad68 Author: Johan Jonker Date: Sun Oct 30 21:56:29 2022 +0100 ARM: dts: rockchip: disable arm_global_timer on rk3066 and rk3188 The clock source and the sched_clock provided by the arm_global_timer on Rockchip rk3066a/rk3188 are quite unstable because their rates depend on the CPU frequency. Recent changes to the arm_global_timer driver makes it impossible to use. On the other side, the arm_global_timer has a higher rating than the ROCKCHIP_TIMER, it will be selected by default by the time framework while we want to use the stable Rockchip clock source. Keep the arm_global_timer disabled in order to have the DW_APB_TIMER (rk3066a) or ROCKCHIP_TIMER (rk3188) selected by default. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/f275ca8d-fd0a-26e5-b978-b7f3df815e0a@gmail.com Signed-off-by: Heiko Stuebner commit 148f4b32b4504d8a32cf82049b7b9499a4b299ab Author: Reinhard Speyerer Date: Wed Nov 9 22:24:15 2022 +0100 USB: serial: option: add Fibocom FM160 0x0111 composition Add support for the following Fibocom FM160 composition: 0x0111: MBIM + MODEM + DIAG + AT T: Bus=01 Lev=02 Prnt=125 Port=01 Cnt=02 Dev#= 93 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0111 Rev= 5.04 S: Manufacturer=Fibocom S: Product=Fibocom FM160 Modem_SN:12345678 S: SerialNumber=12345678 C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Reinhard Speyerer Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit d5ceb4d1c50786d21de3d4b06c3f43109ec56dd8 Author: Bean Huo Date: Mon Nov 14 14:48:52 2022 +0100 nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro Added a quirk to fix Micron Nitro NVMe reporting duplicate NGUIDs. Cc: Signed-off-by: Bean Huo Signed-off-by: Christoph Hellwig commit 2bc5febd05abe86c3e3d4b4f18dff4bc4316c1be Author: Marek Szyprowski Date: Tue Nov 8 22:37:18 2022 +0100 clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()" of_device_get_match_data() function should not be used on the device other than the one matched to the given driver, because it always returns the match_data of the matched driver. In case of exynos-clkout driver, the code matched the OF IDs on the PARENT device, so replacing it with of_device_get_match_data() broke the driver. This reverts commit 777aaf3d1daf793461269b49c063aca1cee06a44. Signed-off-by: Marek Szyprowski Fixes: 777aaf3d1daf ("clk: samsung: exynos-clkout: Use of_device_get_match_data()") Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221108213718.32076-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit 2e35b25dd8e666b8619355fc3defb1b246a5dc02 Author: Linus Walleij Date: Tue Nov 15 09:11:07 2022 +0100 pinctrl: mediatek: Export debounce time tables The kernel test robot complains that in certain combinations when building the Mediatek drivers as modules we lack some debounce table symbols, so export them. Reported-by: kernel test robot Fixes: e1ff91f9d230 ("pinctrl: mediatek: Fix EINT pins input debounce time configuration") Cc: AngeloGioacchino Del Regno Signed-off-by: Linus Walleij commit 4abb77fc5531381484477cac95913336c97176b7 Author: Juergen Gross Date: Mon Nov 14 14:29:37 2022 +0100 xen/platform-pci: use define instead of literal number Instead of "0x01" use the HVM_PARAM_CALLBACK_TYPE_PCI_INTX define from the interface header in get_callback_via(). Signed-off-by: Juergen Gross Acked-by: Stefano Stabellini Signed-off-by: Juergen Gross commit fc2292bd01a25279bf3e29c99e60bfe52d900a91 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:40 2022 -0700 MAINTAINERS: git://github.com -> https://github.com for HiSilicon Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Wei Xu commit 280c0f7cd0aa4d190619b18243110e052a90775c Author: Yuan Can Date: Sun Nov 13 09:29:29 2022 +0000 net: ionic: Fix error handling in ionic_init_module() A problem about ionic create debugfs failed is triggered with the following log given: [ 415.799514] debugfs: Directory 'ionic' with parent '/' already present! The reason is that ionic_init_module() returns ionic_bus_register_driver() directly without checking its return value, if ionic_bus_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of ionic can never be created later. ionic_init_module() ionic_debugfs_create() # create debugfs directory ionic_bus_register_driver() pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when ionic_bus_register_driver() returns error. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Yuan Can Acked-by: Shannon Nelson Link: https://lore.kernel.org/r/20221113092929.19161-1-yuancan@huawei.com Signed-off-by: Jakub Kicinski commit 30f5312d2c722107364f266cfa98ef4f0857c1fb Author: Amit Cohen Date: Fri Nov 11 18:03:27 2022 +0100 mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed FDB entries that perform VXLAN encapsulation with an IPv6 underlay hold a reference on a resource - the KVDL entry where the IPv6 underlay destination IP is stored. For that, the driver maintains two hash tables: 1. Maps IPv6 to KVDL index 2. Maps {MAC, FID index} to IPv6 address When a FDB entry is removed, the second table is used to find the relevant IPv6 address and the first table is used to remove the reference count and free the index if is not used anymore. In order for a packet to be forwarded to a single remote VTEP, FDB entries need to be configured at both the bridge and VXLAN devices' FDB tables. Both entries are squashed into one {MAC, VLAN/VNI} -> IP entry in the hardware. Therefore, in case one entry is removed, the entry will be removed from the hardware and the remaining entry will be unmarked with 'offload' flag since it is not offloaded anymore. For example, the two FDB entries should be added to allow packets to be forwarded via vx10: $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff self static dst 2001:db8:5::1 $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff master static vlan 10 When one entry will be removed, the second one will not be offloaded anymore. When the first entry (in VXLAN FDB) will be removed / will not be offloaded anymore, the two mappings in IPv6 hash tables will be removed. In case that the second entry is removed before the first one, unexpected warnings[1][2] will be shown in user space as a result of removing the first entry. The issue is that not offloaded entry is removed, the driver tries to search the relevant entries in the hash tables, does not find them and therefore warns. Do not handle removing of not offloaded VXLAN FDB entries, as they were already removed when the offload flag was removed. [1]: WARNING: CPU: 1 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c:914 mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum] ... Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015 Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum] RIP: 0010:mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum] ... Call Trace: mlxsw_sp_port_fdb_tunnel_uc_op+0x6cf/0x7b0 [mlxsw_spectrum] mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum] ? finish_task_switch.isra.0+0x8c/0x290 process_one_work+0x1cd/0x390 worker_thread+0x48/0x3c0 ? process_one_work+0x390/0x390 kthread+0xe0/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 [2]: WARNING: CPU: 0 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3035 mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum] ... Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015 Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum] RIP: 0010:mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum] ... Call Trace: ? mlxsw_sp_port_fdb_tun_uc_op6_sfd_write+0x5c1/0x610 [mlxsw_spectrum] mlxsw_sp_port_fdb_tunnel_uc_op+0x6ec/0x7b0 [mlxsw_spectrum] mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum] ? finish_task_switch.isra.0+0x8c/0x290 process_one_work+0x1cd/0x390 worker_thread+0x48/0x3c0 ? process_one_work+0x390/0x390 kthread+0xe0/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Fixes: 0860c7641634 ("mlxsw: spectrum_nve: Keep track of IPv6 addresses used by FDB entries") Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Link: https://lore.kernel.org/r/c186de8cbd28e3eb661e06f31f7f2f2dff30020f.1668184350.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit d180b6496143cd360c5d5f58ae4b9a8229c1f344 Author: Anastasia Belova Date: Fri Nov 11 15:55:11 2022 +0300 HID: hid-lg4ff: Add check for empty lbuf If an empty buf is received, lbuf is also empty. So lbuf is accessed by index -1. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: f31a2de3fe36 ("HID: hid-lg4ff: Allow switching of Logitech gaming wheels between compatibility modes") Signed-off-by: Anastasia Belova Signed-off-by: Jiri Kosina commit 9ad6645a9dce4d0e42daca6ebf32a154401c59d3 Author: Hans de Goede Date: Tue Nov 8 16:13:50 2022 +0100 HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10 The Acer Aspire Switch V 10 (SW5-017)'s keyboard-dock uses the same ITE controller setup as other Acer Switch 2-in-1's. This needs special handling for the wifi on/off toggle hotkey as well as to properly report touchpad on/off keypresses. Add the USB-ids for the SW5-017's keyboard-dock with a quirk setting of QUIRK_TOUCHPAD_ON_OFF_REPORT to fix both issues. Cc: Rudolf Polzer Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit e01d50cbd6eece456843717a566a34e8b926cf0c Merge: 9584987fe71ea e806e223621e4 Author: Linus Torvalds Date: Mon Nov 14 12:40:51 2022 -0800 Merge tag 'vfio-v6.1-rc6' of https://github.com/awilliam/linux-vfio Pull VFIO fixes from Alex Williamson: - Fixes for potential container registration leak for drivers not implementing a close callback, duplicate container de-registrations, and a regression in support for bus reset on last device close from a device set (Anthony DeRossi) * tag 'vfio-v6.1-rc6' of https://github.com/awilliam/linux-vfio: vfio/pci: Check the device set open count on reset vfio: Export the device set open count vfio: Fix container device registration life cycle commit 398e3479874f381cca8726ca5d8a31e1bf35a3cd Author: Billy Tsai Date: Mon Nov 14 10:50:57 2022 +0800 dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" If the property is set on a device without valid trimming data in the OTP the ADC will not function correctly. Therefore, this patch drops the use of this property to avoid this scenario. Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings") Signed-off-by: Billy Tsai Acked-by: Rob Herring Link: https://lore.kernel.org/r/20221114025057.10843-2-billy_tsai@aspeedtech.com Cc: Signed-off-by: Jonathan Cameron commit fdd0d6b2eb35c83d6b1226ad20b346a4b45ddfb8 Author: Billy Tsai Date: Mon Nov 14 10:50:56 2022 +0800 iio: adc: aspeed: Remove the trim valid dts property. The dts property "aspeed,trim-data-valid" is currently used to determine whether to read trimming data from the OTP register. If this is set on a device without valid trimming data in the OTP the ADC will not function correctly. This patch drops the use of this property and instead uses the default (unprogrammed) OTP value of 0 to detect when a fallback value of 0x8 should be used rather then the value read from the OTP. Fixes: d0a4c17b4073 ("iio: adc: aspeed: Get and set trimming data.") Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20221114025057.10843-1-billy_tsai@aspeedtech.com Cc: Signed-off-by: Jonathan Cameron commit 9584987fe71ea9d6a5813f61be6aec4616978af9 Merge: 094226ad94f47 c717b9b7d6de9 Author: Linus Torvalds Date: Mon Nov 14 12:00:03 2022 -0800 Merge tag 'mtd/fixes-for-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd fixes from Miquel Raynal: - Placate "$VARIABLE is used uninitialized" warnings - omap2: Add missing dependency on GPMC - qcom: Handle ret from parse with codeword_fixup * tag 'mtd/fixes-for-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: onenand: omap2: add dependency on GPMC mtd: rawnand: placate "$VARIABLE is used uninitialized" warnings mtd: rawnand: qcom: handle ret from parse with codeword_fixup commit 79ece9b292af6b0edcfb4d67a00711d25507640b Author: Ricardo Ribalda Date: Mon Nov 14 13:20:34 2022 +0100 i2c: Restore initial power state if probe fails A driver that supports I2C_DRV_ACPI_WAIVE_D0_PROBE is not expected to power off a device that it has not powered on previously. For devices operating in "full_power" mode, the first call to `i2c_acpi_waive_d0_probe` will return 0, which means that the device will be turned on with `dev_pm_domain_attach`. If probe fails the second call to `i2c_acpi_waive_d0_probe` will return 1, which means that the device will not be turned off. This is, it will be left in a different power state. Lets fix it. Reviewed-by: Hidenori Kobayashi Reviewed-by: Sergey Senozhatsky Reviewed-by: Sakari Ailus Cc: stable@vger.kernel.org Fixes: b18c1ad685d9 ("i2c: Allow an ACPI driver to manage the device's power state during probe") Signed-off-by: Ricardo Ribalda Reviewed-by: Mika Westerberg Signed-off-by: Wolfram Sang commit 5fd2a60aecf3a42b14fa371c55b3dbb18b229230 Author: Jiri Olsa Date: Mon Nov 14 15:52:57 2022 +0100 libbpf: Use correct return pointer in attach_raw_tp We need to pass '*link' to final libbpf_get_error, because that one holds the return value, not 'link'. Fixes: 4fa5bcfe07f7 ("libbpf: Allow BPF program auto-attach handlers to bail out") Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221114145257.882322-1-jolsa@kernel.org commit d7dbd43f4a828fa1d9a8614d5b0ac40aee6375fe Author: Chris Mason Date: Mon Nov 14 10:19:30 2022 -0800 blk-cgroup: properly pin the parent in blkcg_css_online blkcg_css_online is supposed to pin the blkcg of the parent, but 397c9f46ee4d refactored things and along the way, changed it to pin the css instead. This results in extra pins, and we end up leaking blkcgs and cgroups. Fixes: 397c9f46ee4d ("blk-cgroup: move blkcg_{pin,unpin}_online out of line") Signed-off-by: Chris Mason Spotted-by: Rik van Riel Cc: # v5.19+ Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20221114181930.2093706-1-clm@fb.com Signed-off-by: Jens Axboe commit 37020bbb71d911431e16c2c940b97cf86ae4f2f6 Author: Jingbo Xu Date: Mon Nov 14 20:19:43 2022 +0800 erofs: fix missing xas_retry() in fscache mode The xarray iteration only holds the RCU read lock and thus may encounter XA_RETRY_ENTRY if there's process modifying the xarray concurrently. This will cause oops when referring to the invalid entry. Fix this by adding the missing xas_retry(), which will make the iteration wind back to the root node if XA_RETRY_ENTRY is encountered. Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead") Suggested-by: David Howells Reviewed-by: Gao Xiang Reviewed-by: Jia Zhu Signed-off-by: Jingbo Xu Link: https://lore.kernel.org/r/20221114121943.29987-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit a6f4f1662711bd03308371d9649783a5be596898 Author: José Expósito Date: Thu Nov 10 18:49:18 2022 +0100 HID: uclogic: Fix frame templates for big endian architectures When parsing a frame template with a placeholder indicating the number of buttons present on the frame its value was incorrectly set on big endian architectures due to double little endian conversion. In order to reproduce the issue and verify the fix, run the HID KUnit tests on the PowerPC architecture: $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/hid \ --arch=powerpc --cross_compile=powerpc64-linux-gnu- Fixes: 867c89254425 ("HID: uclogic: Allow to generate frame templates") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 5a01c805441bdc86e7af206d8a03735cc9394ffb Author: Chuck Lever Date: Sat Nov 12 15:06:07 2022 -0500 NFSD: Fix trace_nfsd_fh_verify_err() crasher Now that the nfsd_fh_verify_err() tracepoint is always called on error, it needs to handle cases where the filehandle is not yet fully formed. Fixes: 93c128e709ae ("nfsd: ensure we always call fh_verify_error tracepoint") Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit e1ff91f9d2303cd4e706cc908bfca21cd17b9927 Author: AngeloGioacchino Del Regno Date: Fri Nov 11 10:41:06 2022 +0100 pinctrl: mediatek: Fix EINT pins input debounce time configuration The External Interrupt Controller (EINTC) on all of the supported MediaTek SoCs does support input debouncing, but not all of them index the debounce time values (DBNC_SETTING registers) the same way. Before this change, in some cases, as an example, requesting a debounce time of 16 milliseconds would mistakenly set the relative DBNC_SETTING register to 0x2, resulting in a way shorter debounce time of 500uS. To fix the aforementioned issue, define three different debounce_time arrays, reflecting the correct register index for each value and for each register index variant, and make sure that each SoC pinctrl driver uses the right one. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221111094106.18486-1-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij commit c53717e1e3f0d0f9129b2e0dbc6dcc5e0a8132e9 Author: ruanjinjie Date: Mon Nov 14 19:21:24 2022 +0800 xen/platform-pci: add missing free_irq() in error path free_irq() is missing in case of error in platform_pci_probe(), fix that. Signed-off-by: ruanjinjie Reviewed-by: Oleksandr Tyshchenko Link: https://lore.kernel.org/r/20221114112124.1965611-1-ruanjinjie@huawei.com Signed-off-by: Juergen Gross commit 5e29500eba2aa19e1323df46f64dafcd4a327092 Author: Marek Marczykowski-Górecki Date: Mon Nov 14 11:31:08 2022 +0100 xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too When Xen domain configures MSI-X, the usual approach is to enable MSI-X together with masking all of them via the config space, then fill the table and only then clear PCI_MSIX_FLAGS_MASKALL. Allow doing this via QEMU running in a stub domain. Previously, when changing PCI_MSIX_FLAGS_MASKALL was not allowed, the whole write was aborted, preventing change to the PCI_MSIX_FLAGS_ENABLE bit too. Note the Xen hypervisor intercepts this write anyway, and may keep the PCI_MSIX_FLAGS_MASKALL bit set if it wishes to. It will store the guest-requested state and will apply it eventually. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Jan Beulich Link: https://lore.kernel.org/r/20221114103110.1519413-1-marmarek@invisiblethingslab.com Signed-off-by: Juergen Gross commit da36a2a76b01b210ffaa55cdc2c99bc8783697c5 Author: Yang Yingliang Date: Thu Nov 10 23:24:41 2022 +0800 xen/pcpu: fix possible memory leak in register_pcpu() In device_add(), dev_set_name() is called to allocate name, if it returns error, the name need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). Fixes: f65c9bb3fb72 ("xen/pcpu: Xen physical cpus online/offline sys interface") Signed-off-by: Yang Yingliang Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221110152441.401630-1-yangyingliang@huawei.com Signed-off-by: Juergen Gross commit 639b2e2ff1e850eb4e8853b4dc233875108eec4b Author: Christophe JAILLET Date: Tue Nov 1 22:14:16 2022 +0100 x86/xen: Use kstrtobool() instead of strtobool() strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include the corresponding header file () Signed-off-by: Christophe JAILLET Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/e91af3c8708af38b1c57e0a2d7eb9765dda0e963.1667336095.git.christophe.jaillet@wanadoo.fr Signed-off-by: Juergen Gross commit 2598ac6ec493566105f8a1029aa9de36ba6946ca Author: Sami Tolvanen Date: Wed Nov 9 19:28:31 2022 +0000 arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER The 0-day bot reports that arm64 builds with CONFIG_CFI_CLANG + CONFIG_FTRACE are broken when CONFIG_FUNCTION_GRAPH_TRACER is not enabled: ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph >>> referenced by entry-ftrace.S:299 (arch/arm64/kernel/entry-ftrace.S:299) >>> arch/arm64/kernel/entry-ftrace.o:(.text+0x48) in archive vmlinux.a This is caused by ftrace_stub_graph using SYM_TYPE_FUNC_START when the address of the function is not taken in any C translation unit. Fix the build by only defining ftrace_stub_graph when it's actually needed, i.e. with CONFIG_FUNCTION_GRAPH_TRACER. Link: https://lore.kernel.org/lkml/202210251659.tRMs78RH-lkp@intel.com/ Fixes: 883bbbffa5a4 ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()") Reported-by: kernel test robot Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Acked-by: Mark Rutland Reviewed-by: Masami Hiramatsu (Google) Link: https://lore.kernel.org/r/20221109192831.3057131-1-samitolvanen@google.com Signed-off-by: Catalin Marinas commit ed1fe1bebe18884b11e5536b5ac42e3a48960835 Author: Vladimir Oltean Date: Fri Nov 11 23:10:20 2022 +0200 net: dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims There are multi-generational drivers like mv88e6xxx which have code like this: int mv88e6xxx_port_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr) { if (!chip->info->ptp_support) return -EOPNOTSUPP; ... } DSA wants to deny PTP timestamping on the master if the switch supports timestamping too. However it currently relies on the presence of the port_hwtstamp_get() callback to determine PTP capability, and this clearly does not work in that case (method is present but returns -EOPNOTSUPP). We should not deny PTP on the DSA master for those switches which truly do not support hardware timestamping. Create a dsa_port_supports_hwtstamp() method which actually probes for support by calling port_hwtstamp_get() and seeing whether that returned -EOPNOTSUPP or not. Fixes: f685e609a301 ("net: dsa: Deny PTP on master if switch supports it") Link: https://patchwork.kernel.org/project/netdevbpf/patch/20221110124345.3901389-1-festevam@gmail.com/ Reported-by: Fabio Estevam Reported-by: Steffen Bätz Signed-off-by: Vladimir Oltean Tested-by: Fabio Estevam Signed-off-by: David S. Miller commit f7c125bd79f50ec6094761090be81d02726ec6f4 Author: Wei Yongjun Date: Fri Nov 11 09:20:44 2022 +0000 net: mhi: Fix memory leak in mhi_net_dellink() MHI driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network device, which causes a memory leak. This patch calls free_netdev() to fix it since netdev_priv is used after unregister. Fixes: 13adac032982 ("net: mhi_net: Register wwan_ops for link creation") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit e17a025a47c66ca8499ae88d8046c4f0d7c9c057 Author: Erico Nunes Date: Thu Oct 27 09:32:00 2022 +0200 drm/lima: Fix opp clkname setting in case of missing regulator Commit d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()") introduced a regression as it may undo the clk_names setting in case the optional regulator is missing. This resulted in test and performance regressions with lima. Restore the old behavior where clk_names is set separately so it is not undone in case of a missing optional regulator. Fixes: d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()") Acked-by: Viresh Kumar Signed-off-by: Erico Nunes Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20221027073200.3885839-1-nunes.erico@gmail.com commit 3738d48b9b23f80a90f5de3ebeb0f044f80e9296 Merge: 991aef4ee4f6e 848ffce2f0c93 Author: David S. Miller Date: Mon Nov 14 10:55:43 2022 +0000 Merge branch 'octeon_ep-fixes' Ziyang Xuan says: ==================== octeon_ep: fix several bugs in exception paths Find several obvious bugs during code review in exception paths. Provide this patchset to fix them. Not tested, just compiled. ==================== Signed-off-by: David S. Miller commit 848ffce2f0c93f3481052340a919123a21f808b6 Author: Ziyang Xuan Date: Fri Nov 11 15:09:35 2022 +0800 octeon_ep: ensure get mac address successfully before eth_hw_addr_set() octep_get_mac_addr() can fail because send mbox message failed. If this happens, octep_dev->mac_addr will be zero. It should not continue to initialize. Add exception handling for octep_get_mac_addr() to fix it. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit e4041be97b15302ebfffda8bbd45f3b2d096048f Author: Ziyang Xuan Date: Fri Nov 11 15:09:23 2022 +0800 octeon_ep: fix potential memory leak in octep_device_setup() When occur unsupported_dev and mbox init errors, it did not free oct->conf and iounmap() oct->mmio[i].hw_addr. That would trigger memory leak problem. Add kfree() for oct->conf and iounmap() for oct->mmio[i].hw_addr under unsupported_dev and mbox init errors to fix the problem. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit 9d3ff7131877fb092185c369fbb14b57ac4e7cec Author: Ziyang Xuan Date: Fri Nov 11 15:08:47 2022 +0800 octeon_ep: ensure octep_get_link_status() successfully before octep_link_up() octep_get_link_status() can fail because send mbox message failed, then octep_get_link_status() will return ret less than 0. Excute octep_link_up() as long as ret is not equal to 0 in octep_open() now. That is not correct. The value type of link.state is enum octep_ctrl_net_state. Positive value represents up. Excute octep_link_up() when ret is bigger than 0. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit 298b83e180d53a310f9b47e3bf13b7b583e75e9c Author: Ziyang Xuan Date: Fri Nov 11 15:08:27 2022 +0800 octeon_ep: delete unnecessary napi rollback under set_queues_err in octep_open() octep_napi_add() and octep_napi_enable() are all after netif_set_real_num_{tx,rx}_queues() in octep_open(), so it is unnecessary napi rollback under set_queues_err. Delete them to fix it. Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support") Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit 991aef4ee4f6eb999924f429b943441a32835c8f Author: Gaosheng Cui Date: Fri Nov 11 15:04:33 2022 +0800 bnxt_en: Remove debugfs when pci_register_driver failed When pci_register_driver failed, we need to remove debugfs, which will caused a resource leak, fix it. Resource leak logs as follows: [ 52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present! Fixes: cabfb09d87bd ("bnxt_en: add debugfs support for DIM") Signed-off-by: Gaosheng Cui Reviewed-by: Leon Romanovsky Reviewed-by: Michael Chan Signed-off-by: David S. Miller commit 8fbb53c8bfd8c56ecf1f78dc821778b58f505503 Author: Zhengchao Shao Date: Fri Nov 11 09:47:34 2022 +0800 net: caif: fix double disconnect client in chnl_net_open() When connecting to client timeout, disconnect client for twice in chnl_net_open(). Remove one. Compile tested only. Fixes: 2aa40aef9deb ("caif: Use link layer MTU instead of fixed MTU") Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 5df1341ea822292275c56744aab9c536d75c33be Author: Chuang Wang Date: Fri Nov 11 09:41:30 2022 +0800 net: macvlan: Use built-in RCU list checking hlist_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to hlist_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled. Execute as follow: ip link add link eth0 type macvlan mode source macaddr add The rtnl_lock is held when macvlan_hash_lookup_source() or macvlan_fill_info_macaddr() are called in the non-RCU read side section. So, pass lockdep_rtnl_is_held() to silence false lockdep warning. Fixes: 79cf79abce71 ("macvlan: add source mode") Signed-off-by: Chuang Wang Signed-off-by: David S. Miller commit 2d25107e111a85c56f601a5470f1780ec054e6ac Author: Wang ShaoBo Date: Thu Nov 10 19:38:23 2022 +0800 mISDN: fix misuse of put_device() in mISDN_register_device() We should not release reference by put_device() before calling device_initialize(). Fixes: e7d1d4d9ac0d ("mISDN: fix possible memory leak in mISDN_register_device()") Signed-off-by: Wang ShaoBo Signed-off-by: David S. Miller commit 8979f428a4afc215e390006e5ea19fd4e22c7ca9 Author: Zhengchao Shao Date: Thu Nov 10 18:30:37 2022 +0800 net: liquidio: release resources when liquidio driver open failed When liquidio driver open failed, it doesn't release resources. Compile tested only. Fixes: 5b07aee11227 ("liquidio: MSIX support for CN23XX") Fixes: dbc97bfd3918 ("net: liquidio: Add missing null pointer checks") Signed-off-by: Zhengchao Shao Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 4f68332b2f89ab84285e5b6cb3d30e8b9894bef1 Author: Matthew Auld Date: Mon Nov 7 16:54:13 2022 +0000 drm/i915/ttm: fix uaf with lmem_userfault_list handling In the fault handler, make sure we check if the BO maps lmem after we schedule the migration, since the current resource might change from lmem to smem, if the pages are in the non-cpu visible portion of lmem. This then leads to adding the object to the lmem_userfault_list even though the current resource is no longer lmem. If we then destroy the object, the list might still contain a link to the now free object, since we only remove it if the object is still in lmem. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7469 Fixes: ad74457a6b5a ("drm/i915/dgfx: Release mmap on rpm suspend") Signed-off-by: Matthew Auld Cc: Anshuman Gupta Cc: Rodrigo Vivi Cc: Andrzej Hajda Cc: Nirmoy Das Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20221107165414.56970-1-matthew.auld@intel.com (cherry picked from commit 625b74460ec0978979f883fbee117e1b97e6e35e) Signed-off-by: Tvrtko Ursulin commit 5bd76b8de5b74fa941a6eafee87728a0fe072267 Author: Xiubo Li Date: Thu Nov 10 21:01:59 2022 +0800 ceph: fix NULL pointer dereference for req->r_session The request's r_session maybe changed when it was forwarded or resent. Both the forwarding and resending cases the requests will be protected by the mdsc->mutex. Cc: stable@vger.kernel.org Link: https://bugzilla.redhat.com/show_bug.cgi?id=2137955 Signed-off-by: Xiubo Li Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 51884d153f7ec85e18d607b2467820a90e0f4359 Author: Xiubo Li Date: Wed Nov 9 11:00:39 2022 +0800 ceph: avoid putting the realm twice when decoding snaps fails When decoding the snaps fails it maybe leaving the 'first_realm' and 'realm' pointing to the same snaprealm memory. And then it'll put it twice and could cause random use-after-free, BUG_ON, etc issues. Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/57686 Signed-off-by: Xiubo Li Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit f86a48667b91202d502d753c707e8576a6fe265b Author: Dan Carpenter Date: Fri Oct 14 12:36:53 2022 +0300 ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode() The ceph_lookup_inode() function returns error pointers. It never returns NULL. Fixes: aa87052dd965 ("ceph: fix incorrectly showing the .snap size for stat") Signed-off-by: Dan Carpenter Reviewed-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 3a4e894f36f95c63048298aaefee6e3e1a7f6a68 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:39 2022 -0700 MAINTAINERS: git://github.com -> https://github.com for ceph Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Ilya Dryomov commit e82b5b63c6520067699c5d178e4ed09eb38f065d Merge: 67b7458807925 cef8cdc0d0e7c Author: Arnd Bergmann Date: Mon Nov 14 10:22:40 2022 +0100 Merge tag 'at91-fixes-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 6.1 It contains: - signal name fix for a pin on SAMA7G5 - memory self-refresh fix for SAMA7G5 by avoid soft resetting AC DLL which can introduce glitches in RAM controller and lead to unexpected behavior - led support fix for lan966x-pcb8291 board by enabling sgpio node * tag 'at91-fixes-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: pm: avoid soft resetting AC DLL ARM: dts: lan966x: Enable sgpio on pcb8291 ARM: dts: at91: sama7g5: fix signal name of pin PB2 Link: https://lore.kernel.org/r/20221110115411.180876-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit 67b74588079259643c485eb462cd8ac242cd7e84 Merge: 5449cabd95bbf cadaa773bcf16 Author: Arnd Bergmann Date: Mon Nov 14 10:21:51 2022 +0100 Merge tag 'qcom-arm64-fixes-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 DTS fixes for 6.1 This fixes the APCS register region on IPQ8074 to not overlap with adjacent nodes. It lists the valid LDO modes on a variety of platforms, as this is not required by the binding and implementation. The reference clocks for the two UFS instances on SC8280XP are corrected, to avoid relying on the state left by most versions of the bootloader. A number of issues are corrected with regards to the QMP PHY register ranges on SC8280XP. SC7280 gains a missing lpass reset region. Lastly cluster idle is termporarily disabled on SM8250 to avoid issues with booting the platform, until the last missing pieces lands. * tag 'qcom-arm64-fixes-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280 arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers arm64: dts: qcom: sc8280xp: fix USB0 PHY PCS_MISC registers arm64: dts: qcom: sc8280xp: correct ref clock for ufs_mem_phy arm64: dts: qcom: sc8280xp: fix ufs_card_phy ref clock arm64: dts: qcom: sm8350-hdk: Specify which LDO modes are allowed arm64: dts: qcom: sm8250-xperia-edo: Specify which LDO modes are allowed arm64: dts: qcom: sm8150-xperia-kumano: Specify which LDO modes are allowed arm64: dts: qcom: sc8280xp-crd: Specify which LDO modes are allowed arm64: dts: qcom: sa8295p-adp: Specify which LDO modes are allowed arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed Revert "arm64: dts: qcom: msm8996: add missing TCSR syscon compatible" arm64: dts: qcom: ipq8074: correct APCS register space size Link: https://lore.kernel.org/r/20221110040635.795921-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 91dabf33ae5df271da63e87ad7833e5fdb4a44b9 Author: Peter Zijlstra Date: Wed Oct 26 13:43:00 2022 +0200 sched: Fix race in task_call_func() There is a very narrow race between schedule() and task_call_func(). CPU0 CPU1 __schedule() rq_lock(); prev_state = READ_ONCE(prev->__state); if (... && prev_state) { deactivate_tasl(rq, prev, ...) prev->on_rq = 0; task_call_func() raw_spin_lock_irqsave(p->pi_lock); state = READ_ONCE(p->__state); smp_rmb(); if (... || p->on_rq) // false!!! rq = __task_rq_lock() ret = func(); next = pick_next_task(); rq = context_switch(prev, next) prepare_lock_switch() spin_release(&__rq_lockp(rq)->dep_map...) So while the task is on it's way out, it still holds rq->lock for a little while, and right then task_call_func() comes in and figures it doesn't need rq->lock anymore (because the task is already dequeued -- but still running there) and then the __set_task_frozen() thing observes it's holding rq->lock and yells murder. Avoid this by waiting for p->on_cpu to get cleared, which guarantees the task is fully finished on the old CPU. ( While arguably the fixes tag is 'wrong' -- none of the previous task_call_func() users appears to care for this case. ) Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic") Reported-by: Ville Syrjälä Signed-off-by: Peter Zijlstra (Intel) Tested-by: Ville Syrjälä Link: https://lkml.kernel.org/r/Y1kdRNNfUeAU+FNl@hirez.programming.kicks-ass.net commit 448dca8c88755b768552e19bd1618be34ef6d1ff Author: Mathieu Desnoyers Date: Wed Nov 2 09:06:35 2022 -0400 rseq: Use pr_warn_once() when deprecated/unknown ABI flags are encountered These commits use WARN_ON_ONCE() and kill the offending processes when deprecated and unknown flags are encountered: commit c17a6ff93213 ("rseq: Kill process when unknown flags are encountered in ABI structures") commit 0190e4198e47 ("rseq: Deprecate RSEQ_CS_FLAG_NO_RESTART_ON_* flags") The WARN_ON_ONCE() triggered by userspace input prevents use of Syzkaller to fuzz the rseq system call. Replace this WARN_ON_ONCE() by pr_warn_once() messages which contain actually useful information. Reported-by: Mark Rutland Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Acked-by: Paul E. McKenney Link: https://lkml.kernel.org/r/20221102130635.7379-1-mathieu.desnoyers@efficios.com commit 836fb30949d9edf91d7de696a884ceeae7e426d2 Author: Xiaolei Wang Date: Fri Oct 28 12:14:18 2022 +0800 soc: imx8m: Enable OCOTP clock before reading the register Commit 7d981405d0fd ("soc: imx8m: change to use platform driver") ever removed the dependency on bootloader for enabling OCOTP clock. It helped to fix a kexec kernel hang issue. But unfortunately it caused a regression on CAAM driver and got reverted. This is the second try to enable the OCOTP clock by directly calling clock API instead of indirectly enabling the clock via nvmem API. Fixes: ac34de14ac30 ("Revert "soc: imx8m: change to use platform driver"") Signed-off-by: Xiaolei Wang Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 094226ad94f471a9f19e8f8e7140a09c2625abaa Author: Linus Torvalds Date: Sun Nov 13 13:12:55 2022 -0800 Linux 6.1-rc5 commit af7a056891899fd3942afec79fb219f58271e319 Merge: ab57bc6f027c7 648060902aa30 Author: Linus Torvalds Date: Sun Nov 13 07:57:33 2022 -0800 Merge tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - fix jump label branch range check - check kmalloc failures in Loongson64 kexec - fix builds with clang-14 - fix char/int handling in pic32 * tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: pic32: treat port as signed integer MIPS: jump_label: Fix compat branch range check mips: alchemy: gpio: Include the right header MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed MIPS: fix duplicate definitions for exported symbols mips: boot/compressed: use __NO_FORTIFY commit ab57bc6f027c761d5411fae9492756b5fbb91108 Merge: fef7fd48922d1 9b9eaee9828fe Author: Linus Torvalds Date: Sun Nov 13 07:52:22 2022 -0800 Merge tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - Force the use of SetVirtualAddressMap() on Ampera Altra arm64 machines, which crash in SetTime() if no virtual remapping is used This is the first time we've added an SMBIOS based quirk on arm64, but fortunately, we can just call a EFI protocol to grab the type #1 SMBIOS record when running in the stub, so we don't need all the machinery we have in the kernel proper to parse SMBIOS data. - Drop a spurious warning on misaligned runtime regions when using 16k or 64k pages on arm64 * tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: arm64: efi: Fix handling of misaligned runtime regions and drop warning arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines commit 562105c1b072411c71ac2202410d83ee79297624 Author: Chen-Yu Tsai Date: Mon Nov 7 00:15:13 2022 +0800 arm64: dts: rockchip: Fix Pine64 Quartz4-B PMIC interrupt Ths PMIC's interrupt line is tied to GPIO0_A3. This is described correctly for the pinmux setting, but incorrectly for the interrupt. Correct the interrupt setting so that interrupts from the PMIC get delivered. Fixes: dcc8c66bef79 ("arm64: dts: rockchip: add Pine64 Quartz64-B device tree") Signed-off-by: Chen-Yu Tsai Reviewed-by: Peter Geis Link: https://lore.kernel.org/r/20221106161513.4140-1-wens@kernel.org Signed-off-by: Heiko Stuebner commit 145900cf91c4b32ac05dbc8675a0c7f4a278749d Author: Yuan Can Date: Wed Nov 9 11:22:50 2022 +0000 i2c: npcm7xx: Fix error handling in npcm_i2c_init() A problem about i2c-npcm7xx create debugfs failed is triggered with the following log given: [ 173.827310] debugfs: Directory 'npcm_i2c' with parent '/' already present! The reason is that npcm_i2c_init() returns platform_driver_register() directly without checking its return value, if platform_driver_register() failed, it returns without destroy the newly created debugfs, resulting the debugfs of npcm_i2c can never be created later. npcm_i2c_init() debugfs_create_dir() # create debugfs directory platform_driver_register() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when platform_driver_register() returns error. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Yuan Can Reviewed-by: Tali Perry Signed-off-by: Wolfram Sang commit 4ad09d956f8eacff61e67e5b13ba8ebec3232f76 Author: Chen Zhongjin Date: Tue Nov 8 11:28:02 2022 +0800 iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails In iio_register_sw_trigger_type(), configfs_register_default_group() is possible to fail, but the entry add to iio_trigger_types_list is not deleted. This leaves wild in iio_trigger_types_list, which can cause page fault when module is loading again. So fix this by list_del(&t->list) in error path. BUG: unable to handle page fault for address: fffffbfff81d7400 Call Trace: iio_register_sw_trigger_type do_one_initcall do_init_module load_module ... Fixes: b662f809d410 ("iio: core: Introduce IIO software triggers") Signed-off-by: Chen Zhongjin Link: https://lore.kernel.org/r/20221108032802.168623-1-chenzhongjin@huawei.com Cc: Signed-off-by: Jonathan Cameron commit 20690cd50e68c0313472c7539460168b8ea6444d Author: Dong Chenchen Date: Thu Nov 10 09:07:26 2022 +0800 iio: accel: bma400: Fix memory leak in bma400_get_steps_reg() When regmap_bulk_read() fails, it does not free steps_raw, which will cause a memory leak issue, this patch fixes it. Fixes: d221de60eee3 ("iio: accel: bma400: Add separate channel for step counter") Signed-off-by: Dong Chenchen Reviewed-by: Jagath Jog J Link: https://lore.kernel.org/r/20221110010726.235601-1-dongchenchen2@huawei.com Cc: Signed-off-by: Jonathan Cameron commit 6ac12303572ef9ace5603c2c07f5f1b00a33f580 Author: Paul Gazzillo Date: Thu Nov 10 16:47:29 2022 -0500 iio: light: rpr0521: add missing Kconfig dependencies Fix an implicit declaration of function error for rpr0521 under some configs When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER, the build results in "implicit declaration of function" errors, e.g., drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function 'iio_trigger_poll_chained' [-Werror=implicit-function-declaration] 434 | iio_trigger_poll_chained(data->drdy_trigger0); | ^~~~~~~~~~~~~~~~~~~~~~~~ This fix adds select dependencies to RPR0521's configuration declaration. Fixes: e12ffd241c00 ("iio: light: rpr0521 triggered buffer") Signed-off-by: Paul Gazzillo Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678 Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221110214729.ls5ixav5kxpeftk7@device Signed-off-by: Jonathan Cameron commit fef7fd48922d11b22620e19f9c9101647bfe943d Merge: f95077acac6d3 ecb8c2580d37d Author: Linus Torvalds Date: Sat Nov 12 09:27:15 2022 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three small fixes, all in drivers. The sas one is in an unlikely error leg, the debug one is to make it more standards conformant and the ibmvfc one is to fix a user visible bug where a failover could lose all paths to the device" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC scsi: scsi_transport_sas: Fix error handling in sas_phy_add() scsi: ibmvfc: Avoid path failures during live migration commit f95077acac6d3235735a41cc5f25a024777399dd Merge: 8f2975c2bb4c6 9d8e536d36e75 Author: Linus Torvalds Date: Sat Nov 12 09:23:32 2022 -0800 Merge tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull additional sound fix from Takashi Iwai: "A regression fix for the latest memalloc helper change" * tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: memalloc: Try dma_alloc_noncontiguous() at first commit fc92d9e3de0b2d30a3ccc08048a5fad533e4672b Author: Wei Yongjun Date: Mon Nov 7 15:20:10 2022 +0000 iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw KASAN report out-of-bounds read as follows: BUG: KASAN: global-out-of-bounds in afe4404_read_raw+0x2ce/0x380 Read of size 4 at addr ffffffffc00e4658 by task cat/278 Call Trace: afe4404_read_raw iio_read_channel_info dev_attr_show The buggy address belongs to the variable: afe4404_channel_leds+0x18/0xffffffffffffe9c0 This issue can be reproduce by singe command: $ cat /sys/bus/i2c/devices/0-0058/iio\:device0/in_intensity6_raw The array size of afe4404_channel_leds and afe4404_channel_offdacs are less than channels, so access with chan->address cause OOB read in afe4404_[read|write]_raw. Fix it by moving access before use them. Fixes: b36e8257641a ("iio: health/afe440x: Use regmap fields") Signed-off-by: Wei Yongjun Acked-by: Andrew Davis Link: https://lore.kernel.org/r/20221107152010.95937-1-weiyongjun@huaweicloud.com Signed-off-by: Jonathan Cameron commit 58143c1ed5882c138a3cd2251a336fc8755f23d9 Author: Wei Yongjun Date: Mon Nov 7 15:19:46 2022 +0000 iio: health: afe4403: Fix oob read in afe4403_read_raw KASAN report out-of-bounds read as follows: BUG: KASAN: global-out-of-bounds in afe4403_read_raw+0x42e/0x4c0 Read of size 4 at addr ffffffffc02ac638 by task cat/279 Call Trace: afe4403_read_raw iio_read_channel_info dev_attr_show The buggy address belongs to the variable: afe4403_channel_leds+0x18/0xffffffffffffe9e0 This issue can be reproduced by singe command: $ cat /sys/bus/spi/devices/spi0.0/iio\:device0/in_intensity6_raw The array size of afe4403_channel_leds is less than channels, so access with chan->address cause OOB read in afe4403_read_raw. Fix it by moving access before use it. Fixes: b36e8257641a ("iio: health/afe440x: Use regmap fields") Signed-off-by: Wei Yongjun Acked-by: Andrew Davis Link: https://lore.kernel.org/r/20221107151946.89260-1-weiyongjun@huaweicloud.com Signed-off-by: Jonathan Cameron commit ad72c3c3f6eb81d2cb189ec71e888316adada5df Author: Takashi Iwai Date: Sat Nov 12 15:12:23 2022 +0100 ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() snd_usbmidi_output_open() has a check of the NULL port with snd_BUG_ON(). snd_BUG_ON() was used as this shouldn't have happened, but in reality, the NULL port may be seen when the device gives an invalid endpoint setup at the descriptor, hence the driver skips the allocation. That is, the check itself is valid and snd_BUG_ON() should be dropped from there. Otherwise it's confusing as if it were a real bug, as recently syzbot stumbled on it. Reported-by: syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20221112141223.6144-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit c234ba8042920fa83635808dc5673f36869ca280 Author: Dexuan Cui Date: Fri Nov 4 15:29:53 2022 -0700 PCI: hv: Only reuse existing IRTE allocation for Multi-MSI Jeffrey added Multi-MSI support to the pci-hyperv driver by the 4 patches: 08e61e861a0e ("PCI: hv: Fix multi-MSI to allow more than one MSI vector") 455880dfe292 ("PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI") b4b77778ecc5 ("PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()") a2bad844a67b ("PCI: hv: Fix interrupt mapping for multi-MSI") It turns out that the third patch (b4b77778ecc5) causes a performance regression because all the interrupts now happen on 1 physical CPU (or two pCPUs, if one pCPU doesn't have enough vectors). When a guest has many PCI devices, it may suffer from soft lockups if the workload is heavy, e.g., see https://lwn.net/ml/linux-kernel/20220804025104.15673-1-decui@microsoft.com/ Commit b4b77778ecc5 itself is good. The real issue is that the hypercall in hv_irq_unmask() -> hv_arch_irq_unmask() -> hv_do_hypercall(HVCALL_RETARGET_INTERRUPT...) only changes the target virtual CPU rather than physical CPU; with b4b77778ecc5, the pCPU is determined only once in hv_compose_msi_msg() where only vCPU0 is specified; consequently the hypervisor only uses 1 target pCPU for all the interrupts. Note: before b4b77778ecc5, the pCPU is determined twice, and when the pCPU is determined the second time, the vCPU in the effective affinity mask is used (i.e., it isn't always vCPU0), so the hypervisor chooses different pCPU for each interrupt. The hypercall will be fixed in future to update the pCPU as well, but that will take quite a while, so let's restore the old behavior in hv_compose_msi_msg(), i.e., don't reuse the existing IRTE allocation for single-MSI and MSI-X; for multi-MSI, we choose the vCPU in a round-robin manner for each PCI device, so the interrupts of different devices can happen on different pCPUs, though the interrupts of each device happen on some single pCPU. The hypercall fix may not be backported to all old versions of Hyper-V, so we want to have this guest side change forever (or at least till we're sure the old affected versions of Hyper-V are no longer supported). Fixes: b4b77778ecc5 ("PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()") Co-developed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Co-developed-by: Carl Vanderlip Signed-off-by: Carl Vanderlip Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221104222953.11356-1-decui@microsoft.com Signed-off-by: Wei Liu commit 5534bbb7c658a6b21e118b0d22de36b5bbb19805 Merge: 9d8e536d36e75 7d945b046be3d Author: Takashi Iwai Date: Sat Nov 12 09:52:24 2022 +0100 Merge tag 'asoc-fix-v6.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.1 A relatively large collection of fixes and new platform quirks here, they're all fairly minor though - the widest possible impact is the fix to the use of prefixes on regulator names which would have broken any device that integrates regulators with DAPM and was used in a system where it had a name prefix assigning to it. commit 9d8e536d36e75e76614fe09ffab9a1df95b8b666 Author: Takashi Iwai Date: Sat Nov 12 09:47:18 2022 +0100 ALSA: memalloc: Try dma_alloc_noncontiguous() at first The latest fix for the non-contiguous memalloc helper changed the allocation method for a non-IOMMU system to use only the fallback allocator. This should have worked, but it caused a problem sometimes when too many non-contiguous pages are allocated that can't be treated by HD-audio controller. As a quirk workaround, go back to the original strategy: use dma_alloc_noncontiguous() at first, and apply the fallback only when it fails, but only for non-IOMMU case. We'll need a better fix in the fallback code as well, but this workaround should paper over most cases. Fixes: 9736a325137b ("ALSA: memalloc: Don't fall back for SG-buffer with IOMMU") Reported-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wgSH5ubdvt76gNwa004ooZAEJL_1Q-Fyw5M2FDdqL==dg@mail.gmail.com Link: https://lore.kernel.org/r/20221112084718.3305-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8f2975c2bb4c6fd43d778db55481fc11806c8773 Merge: d7c2b1f64e44c e20e81a24a4d5 Author: Linus Torvalds Date: Fri Nov 11 20:27:13 2022 -0800 Merge tag 'ata-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "Several libata generic code fixes for rc5: - Add missing translation of the SYNCHRONIZE CACHE 16 scsi command as this command is mandatory for host-managed ZBC drives. The lack of support for it in libata-scsi was causing issues with some passthrough applications using ZBC drives (from Shin'ichiro). - Fix the error path of libata-transport host, port, link and device attributes initialization (from Yingliang). - Prevent issuing new commands to a drive that is in the NCQ error state and undergoing recovery (From Niklas). This bug went unnoticed for a long time as commands issued to a drive in error state are aborted immediately and retried by the scsi layer, hiding the useless abort-and-retry sequence" * tag 'ata-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: do not issue non-internal commands once EH is pending ata: libata-transport: fix error handling in ata_tdev_add() ata: libata-transport: fix error handling in ata_tlink_add() ata: libata-transport: fix error handling in ata_tport_add() ata: libata-transport: fix double ata_host_put() in ata_tport_add() ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure commit 9cbd48d5fa14e4c65f8580de16686077f7cea02b Author: Jeremy Kerr Date: Thu Nov 10 13:31:35 2022 +0800 mctp i2c: don't count unused / invalid keys for flow release We're currently hitting the WARN_ON in mctp_i2c_flow_release: if (midev->release_count > midev->i2c_lock_count) { WARN_ONCE(1, "release count overflow"); This may be hit if we expire a flow before sending the first packet it contains - as we will not be pairing the increment of release_count (performed on flow release) with the i2c lock operation (only performed on actual TX). To fix this, only release a flow if we've encountered it previously (ie, dev_flow_state does not indicate NEW), as we will mark the flow as ACTIVE at the same time as accounting for the i2c lock operation. We also need to add an INVALID flow state, to indicate when we've done the release. Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver") Reported-by: Jian Zhang Tested-by: Jian Zhang Signed-off-by: Jeremy Kerr Link: https://lore.kernel.org/r/20221110053135.329071-1-jk@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit 0834ced65a6a1eaa10d0b319b685879a671b29aa Author: Yu Liao Date: Thu Nov 10 17:03:29 2022 +0800 net/tls: Fix memory leak in tls_enc_skb() and tls_sw_fallback_init() 'aead_req' and 'aead_send' is allocated but not freed in default switch case. This commit fixes the potential memory leak by freeing them under the situation. Note that the default cases here should never be reached as they'd mean we allowed offloading an unsupported algorithm. Fixes: ea7a9d88ba21 ("net/tls: Use cipher sizes structs") Signed-off-by: Yu Liao Reviewed-by: Gal Pressman Link: https://lore.kernel.org/r/20221110090329.2036382-1-liaoyu15@huawei.com Signed-off-by: Jakub Kicinski commit 77711683a50477de39757d67ab1a3638220d6860 Author: Mohd Faizal Abdul Rahim Date: Thu Nov 10 14:45:52 2022 +0800 net: stmmac: ensure tx function is not running in stmmac_xdp_release() When stmmac_xdp_release() is called, there is a possibility that tx function is still running on other queues which will lead to tx queue timed out and reset adapter. This commit ensure that tx function is not running xdp before release flow continue to run. Fixes: ac746c8520d9 ("net: stmmac: enhance XDP ZC driver level switching performance") Signed-off-by: Song Yoong Siang Signed-off-by: Mohd Faizal Abdul Rahim Signed-off-by: Noor Azura Ahmad Tarmizi Link: https://lore.kernel.org/r/20221110064552.22504-1-noor.azura.ahmad.tarmizi@linux.intel.com Signed-off-by: Jakub Kicinski commit e2a54350dc9642e7dfc07335ca355581caa9dbfe Author: Michael Sit Wei Hong Date: Thu Nov 10 13:49:38 2022 +0800 net: phy: dp83867: Fix SGMII FIFO depth for non OF devices Current driver code will read device tree node information, and set default values if there is no info provided. This is not done in non-OF devices leading to SGMII fifo depths being set to the smallest size. This patch sets the value to the default value of the PHY as stated in the PHY datasheet. Fixes: 4dc08dcc9f6f ("net: phy: dp83867: introduce critical chip default init for non-of platform") Signed-off-by: Michael Sit Wei Hong Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221110054938.925347-1-michael.wei.hong.sit@intel.com Signed-off-by: Jakub Kicinski commit 8eab9be56cc6b702a445d2b6d0256aa0992316b3 Author: Yuan Can Date: Thu Nov 10 02:16:42 2022 +0000 net: hinic: Fix error handling in hinic_module_init() A problem about hinic create debugfs failed is triggered with the following log given: [ 931.419023] debugfs: Directory 'hinic' with parent '/' already present! The reason is that hinic_module_init() returns pci_register_driver() directly without checking its return value, if pci_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of hinic can never be created later. hinic_module_init() hinic_dbg_register_debugfs() # create debugfs directory pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when pci_register_driver() returns error. Fixes: 253ac3a97921 ("hinic: add support to query sq info") Signed-off-by: Yuan Can Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20221110021642.80378-1-yuancan@huawei.com Signed-off-by: Jakub Kicinski commit 98a2ac1ca8fd6eca6867726fe238d06e75eb1acd Author: Yang Yingliang Date: Wed Nov 9 21:28:32 2022 +0800 mISDN: fix possible memory leak in mISDN_dsp_element_register() Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, use put_device() to give up the reference, so that the name can be freed in kobject_cleanup() when the refcount is 0. The 'entry' is going to be freed in mISDN_dsp_dev_release(), so the kfree() is removed. list_del() is called in mISDN_dsp_dev_release(), so it need be initialized. Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221109132832.3270119-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 6f928ab8ee9bfbcb0e631c47ea8a16c3d5116ff1 Author: Wei Yongjun Date: Wed Nov 9 15:01:36 2022 +0000 net: bgmac: Drop free_netdev() from bgmac_enet_remove() netdev is allocated in bgmac_alloc() with devm_alloc_etherdev() and will be auto released in ->remove and ->probe failure path. Using free_netdev() in bgmac_enet_remove() leads to double free. Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit c1754bf019bdd89b439b2c662d61146fdee80d02 Merge: f3a72878a3de7 1f6e04a1c7b85 Author: Jakub Kicinski Date: Fri Nov 11 18:27:39 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Andrii Nakryiko says: ==================== bpf 2022-11-11 We've added 11 non-merge commits during the last 8 day(s) which contain a total of 11 files changed, 83 insertions(+), 74 deletions(-). The main changes are: 1) Fix strncpy_from_kernel_nofault() to prevent out-of-bounds writes, from Alban Crequy. 2) Fix for bpf_prog_test_run_skb() to prevent wrong alignment, from Baisong Zhong. 3) Switch BPF_DISPATCHER to static_call() instead of ftrace infra, with a small build fix on top, from Peter Zijlstra and Nathan Chancellor. 4) Fix memory leak in BPF verifier in some error cases, from Wang Yufen. 5) 32-bit compilation error fixes for BPF selftests, from Pu Lehui and Yang Jihong. 6) Ensure even distribution of per-CPU free list elements, from Xu Kuohai. 7) Fix copy_map_value() to track special zeroed out areas properly, from Xu Kuohai. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Fix offset calculation error in __copy_map_value and zero_map_value bpf: Initialize same number of free nodes for each pcpu_freelist selftests: bpf: Add a test when bpf_probe_read_kernel_str() returns EFAULT maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault() selftests/bpf: Fix test_progs compilation failure in 32-bit arch selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms bpf: Fix memory leaks in __check_func_call bpf: Add explicit cast to 'void *' for __BPF_DISPATCHER_UPDATE() bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace) bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop") bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() ==================== Link: https://lore.kernel.org/r/20221111231624.938829-1-andrii@kernel.org Signed-off-by: Jakub Kicinski commit d7c2b1f64e44c98206752a1599b0203ae5e92f27 Merge: 5ad6e7ba98c29 436fa4a699bcd Author: Linus Torvalds Date: Fri Nov 11 17:18:42 2022 -0800 Merge tag 'mm-hotfixes-stable-2022-11-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc hotfixes from Andrew Morton: "22 hotfixes. Eight are cc:stable and the remainder address issues which were introduced post-6.0 or which aren't considered serious enough to justify a -stable backport" * tag 'mm-hotfixes-stable-2022-11-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (22 commits) docs: kmsan: fix formatting of "Example report" mm/damon/dbgfs: check if rm_contexts input is for a real context maple_tree: don't set a new maximum on the node when not reusing nodes maple_tree: fix depth tracking in maple_state arch/x86/mm/hugetlbpage.c: pud_huge() returns 0 when using 2-level paging fs: fix leaked psi pressure state nilfs2: fix use-after-free bug of ns_writer on remount x86/traps: avoid KMSAN bugs originating from handle_bug() kmsan: make sure PREEMPT_RT is off Kconfig.debug: ensure early check for KMSAN in CONFIG_KMSAN_WARN x86/uaccess: instrument copy_from_user_nmi() kmsan: core: kmsan_in_runtime() should return true in NMI context mm: hugetlb_vmemmap: include missing linux/moduleparam.h mm/shmem: use page_mapping() to detect page cache for uffd continue mm/memremap.c: map FS_DAX device memory as decrypted Partly revert "mm/thp: carry over dirty bit when thp splits on pmd" nilfs2: fix deadlock in nilfs_count_free_blocks() mm/mmap: fix memory leak in mmap_region() hugetlbfs: don't delete error page from pagecache maple_tree: reorganize testing to restore module testing ... commit 5ad6e7ba98c29d61794a3f216414d8542a3e476c Merge: b0b6e2c9d3543 acfc35cfcee5d Author: Linus Torvalds Date: Fri Nov 11 17:10:13 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Another fix for rodata=full. Since rodata= is not a simple boolean on arm64 (accepting 'full' as well), it got inadvertently broken by changes in the core code. If rodata=on is the default and rodata=off is passed on the kernel command line, rodata_full is never disabled - Fix gcc compiler warning of shifting 0xc0 into bits 31:24 without an explicit conversion to u32 (triggered by the AMPERE1 MIDR definition) - Include asm/ptrace.h in asm/syscall_wrapper.h to fix an incomplete struct pt_regs type causing the BPF verifier to refuse to load a tracing program which accesses pt_regs * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro arm64: fix rodata=full again commit b8a5376c321b4669f7ffabc708fd30c3970f3084 Author: Michael Kelley Date: Wed Nov 9 10:48:42 2022 -0800 scsi: storvsc: Fix handling of srb_status and capacity change events Current handling of the srb_status is incorrect. Commit 52e1b3b3daa9 ("scsi: storvsc: Correctly handle multiple flags in srb_status") is based on srb_status being a set of flags, when in fact only the 2 high order bits are flags and the remaining 6 bits are an integer status. Because the integer values of interest mostly look like flags, the code actually works when treated that way. But in the interest of correctness going forward, fix this by treating the low 6 bits of srb_status as an integer status code. Add handling for SRB_STATUS_INVALID_REQUEST, which was the original intent of commit 52e1b3b3daa9. Furthermore, treat the ERROR, ABORTED, and INVALID_REQUEST srb status codes as essentially equivalent for the cases we care about. There's no harm in doing so, and it isn't always clear which status code current or older versions of Hyper-V report for particular conditions. Treating the srb status codes as equivalent has the additional benefit of ensuring that capacity change events result in an immediate rescan so that the new size is known to Linux. Existing code checks SCSI sense data for capacity change events when the srb status is ABORTED. But capacity change events are also being observed when Hyper-V reports the srb status as ERROR. Without the immediate rescan, the new size isn't known until something else causes a rescan (such as running fdisk to expand a partition), and in the meantime, tools such as "lsblk" continue to report the old size. Fixes: 52e1b3b3daa9 ("scsi: storvsc: Correctly handle multiple flags in srb_status") Reported-by: Juan Tian Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1668019722-1983-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit ee6815416380bc069b7dcbdff0682d4c53617527 Author: Vitaly Kuznetsov Date: Thu Nov 3 20:06:01 2022 +0100 x86/hyperv: Restore VP assist page after cpu offlining/onlining Commit e5d9b714fe40 ("x86/hyperv: fix root partition faults when writing to VP assist page MSR") moved 'wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE)' under 'if (*hvp)' condition. This works for root partition as hv_cpu_die() does memunmap() and sets 'hv_vp_assist_page[cpu]' to NULL but breaks non-root partitions as hv_cpu_die() doesn't free 'hv_vp_assist_page[cpu]' for them. This causes VP assist page to remain unset after CPU offline/online cycle: $ rdmsr -p 24 0x40000073 10212f001 $ echo 0 > /sys/devices/system/cpu/cpu24/online $ echo 1 > /sys/devices/system/cpu/cpu24/online $ rdmsr -p 24 0x40000073 0 Fix the issue by always writing to HV_X64_MSR_VP_ASSIST_PAGE in hv_cpu_init(). Note, checking 'if (!*hvp)', for root partition is pointless as hv_cpu_die() always sets 'hv_vp_assist_page[cpu]' to NULL (and it's also NULL initially). Note: the fact that 'hv_vp_assist_page[cpu]' is reset to NULL may present a (potential) issue for KVM. While Hyper-V uses CPUHP_AP_ONLINE_DYN stage in CPU hotplug, KVM uses CPUHP_AP_KVM_STARTING which comes earlier in CPU teardown sequence. It is theoretically possible that Enlightened VMCS is still in use. It is unclear if the issue is real and if using KVM with Hyper-V root partition is even possible. While on it, drop the unneeded smp_processor_id() call from hv_cpu_init(). Fixes: e5d9b714fe40 ("x86/hyperv: fix root partition faults when writing to VP assist page MSR") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221103190601.399343-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit e20e81a24a4d58744a29715aac2f795cd1651955 Author: Niklas Cassel Date: Wed Nov 9 00:15:34 2022 +0100 ata: libata-core: do not issue non-internal commands once EH is pending While the ATA specification states that a device should return command aborted for all commands queued after the device has entered error state, since ATA only keeps the sense data for the latest command (in non-NCQ case), we really don't want to send block layer commands to the device after it has entered error state. (Only ATA EH commands should be sent, to read the sense data etc.) Currently, scsi_queue_rq() will check if scsi_host_in_recovery() (state is SHOST_RECOVERY), and if so, it will _not_ issue a command via: scsi_dispatch_cmd() -> host->hostt->queuecommand() (ata_scsi_queuecmd()) -> __ata_scsi_queuecmd() -> ata_scsi_translate() -> ata_qc_issue() Before commit e494f6a72839 ("[SCSI] improved eh timeout handler"), when receiving a TFES error IRQ, the call chain looked like this: ahci_error_intr() -> ata_port_abort() -> ata_do_link_abort() -> ata_qc_complete() -> ata_qc_schedule_eh() -> blk_abort_request() -> blk_rq_timed_out() -> q->rq_timed_out_fn() (scsi_times_out()) -> scsi_eh_scmd_add() -> scsi_host_set_state(shost, SHOST_RECOVERY) Which meant that as soon as an error IRQ was serviced, SHOST_RECOVERY would be set. However, after commit e494f6a72839 ("[SCSI] improved eh timeout handler"), scsi_times_out() will instead call scsi_abort_command() which will queue delayed work, and the worker function scmd_eh_abort_handler() will call scsi_eh_scmd_add(), which calls scsi_host_set_state(shost, SHOST_RECOVERY). So now, after the TFES error IRQ has been serviced, we need to wait for the SCSI workqueue to run its work before SHOST_RECOVERY gets set. It is worth noting that, even before commit e494f6a72839 ("[SCSI] improved eh timeout handler"), we could receive an error IRQ from the time when scsi_queue_rq() checks scsi_host_in_recovery(), to the time when ata_scsi_queuecmd() is actually called. In order to handle both the delayed setting of SHOST_RECOVERY and the window where we can receive an error IRQ, add a check against ATA_PFLAG_EH_PENDING (which gets set when servicing the error IRQ), inside ata_scsi_queuecmd() itself, while holding the ap->lock. (Since the ap->lock is held while servicing IRQs.) Fixes: e494f6a72839 ("[SCSI] improved eh timeout handler") Signed-off-by: Niklas Cassel Tested-by: John Garry Signed-off-by: Damien Le Moal commit b0b6e2c9d3543c0926a7df5ee6e36507ad491dea Merge: 4e6b2b2e4f30c df24560d058d1 Author: Linus Torvalds Date: Fri Nov 11 14:08:30 2022 -0800 Merge tag 'block-6.1-2022-11-11' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - Quiet user passthrough command errors (Keith Busch) - Fix memory leak in nvmet_subsys_attr_model_store_locked - Fix a memory leak in nvmet-auth (Sagi Grimberg) - Fix a potential NULL point deref in bfq (Yu) - Allocate command/response buffers separately for DMA for sed-opal, rather than rely on embedded alignment (Serge) * tag 'block-6.1-2022-11-11' of git://git.kernel.dk/linux: nvmet: fix a memory leak nvmet: fix memory leak in nvmet_subsys_attr_model_store_locked nvme: quiet user passthrough command errors block: sed-opal: kmalloc the cmd/resp buffers block, bfq: fix null pointer dereference in bfq_bio_bfqg() commit 4e6b2b2e4f30c29caf89ecfa9ed4d9f97d151102 Merge: f5020a08b2b37 5576035f15dfc Author: Linus Torvalds Date: Fri Nov 11 14:02:44 2022 -0800 Merge tag 'io_uring-6.1-2022-11-11' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "Nothing major, just a few minor tweaks: - Tweak for the TCP zero-copy io_uring self test (Pavel) - Rather than use our internal cached value of number of CQ events available, use what the user can see (Dylan) - Fix a typo in a comment, added in this release (me) - Don't allow wrapping while adding provided buffers (me) - Fix a double poll race, and add a lockdep assertion for it too (Pavel)" * tag 'io_uring-6.1-2022-11-11' of git://git.kernel.dk/linux: io_uring/poll: lockdep annote io_poll_req_insert_locked io_uring/poll: fix double poll req->flags races io_uring: check for rollover of buffer ID when providing buffers io_uring: calculate CQEs from the user visible value io_uring: fix typo in io_uring.h comment selftests/net: don't tests batched TCP io_uring zc commit 1f6e04a1c7b85da3b765ca9f46029e5d1826d839 Author: Xu Kuohai Date: Fri Nov 11 07:56:20 2022 -0500 bpf: Fix offset calculation error in __copy_map_value and zero_map_value Function __copy_map_value and zero_map_value miscalculated copy offset, resulting in possible copy of unwanted data to user or kernel. Fix it. Fixes: cc48755808c6 ("bpf: Add zero_map_value to zero map value with special fields") Fixes: 4d7d7f69f4b1 ("bpf: Adapt copy_map_value for multiple offset case") Signed-off-by: Xu Kuohai Signed-off-by: Andrii Nakryiko Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20221111125620.754855-1-xukuohai@huaweicloud.com commit 4b45cd81f737d79d0fbfc0d320a1e518e7f0bbf0 Author: Xu Kuohai Date: Thu Nov 10 07:21:28 2022 -0500 bpf: Initialize same number of free nodes for each pcpu_freelist pcpu_freelist_populate() initializes nr_elems / num_possible_cpus() + 1 free nodes for some CPUs, and then possibly one CPU with fewer nodes, followed by remaining cpus with 0 nodes. For example, when nr_elems == 256 and num_possible_cpus() == 32, CPU 0~27 each gets 9 free nodes, CPU 28 gets 4 free nodes, CPU 29~31 get 0 free nodes, while in fact each CPU should get 8 nodes equally. This patch initializes nr_elems / num_possible_cpus() free nodes for each CPU firstly, then allocates the remaining free nodes by one for each CPU until no free nodes left. Fixes: e19494edab82 ("bpf: introduce percpu_freelist") Signed-off-by: Xu Kuohai Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20221110122128.105214-1-xukuohai@huawei.com commit f5020a08b2b371162a4a16ef97694cac3980397e Merge: df65494ffbb35 30d17fac6aaed Author: Linus Torvalds Date: Fri Nov 11 11:49:20 2022 -0800 Merge tag 's390-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - fix memcpy warning about field-spanning write in zcrypt driver - minor updates to defconfigs - remove CONFIG_DEBUG_INFO_BTF from all defconfigs and add btf.config addon config file. It significantly decreases compile time and allows quickly enabling that option into the current kernel config - add kasan.config addon config file which allows to easily enable KASAN into the current kernel config - binutils commit 906f69cf65da ("IBM zSystems: Issue error for *DBL relocs on misaligned symbols") caused several link errors. Always build relocatable kernel to avoid this problem - raise the minimum clang version to 15.0.0 to avoid silent generation of a corrupted code * tag 's390-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390 s390: always build relocatable kernel s390/configs: add kasan.config addon config file s390/configs: move CONFIG_DEBUG_INFO_BTF into btf.config addon config s390: update defconfigs s390/zcrypt: fix warning about field-spanning write commit c20572600e16d13d5d6a081bdc84c95491101d34 Merge: 5704bc7e89911 9cd094829dae9 Author: Andrii Nakryiko Date: Fri Nov 11 11:44:46 2022 -0800 Merge branch 'Fix offset when fault occurs in strncpy_from_kernel_nofault()' Alban Crequy says: ==================== Hi, This is v2 of the fix & selftest previously sent at: https://lore.kernel.org/linux-mm/20221108195211.214025-1-flaniel@linux.microsoft.com/ Changes v1 to v2: - add 'cc:stable', 'Fixes:' and review/ack tags - update commitmsg and fix my email - rebase on bpf tree and tag for bpf tree Thanks! ==================== Signed-off-by: Andrii Nakryiko commit 9cd094829dae949a755c18533479c20e74415ab2 Author: Alban Crequy Date: Thu Nov 10 09:56:14 2022 +0100 selftests: bpf: Add a test when bpf_probe_read_kernel_str() returns EFAULT This commit tests previous fix of bpf_probe_read_kernel_str(). The BPF helper bpf_probe_read_kernel_str should return -EFAULT when given a bad source pointer and the target buffer should only be modified to make the string NULL terminated. bpf_probe_read_kernel_str() was previously inserting a NULL before the beginning of the dst buffer. This test should ensure that the implementation stays correct for now on. Without the fix, this test will fail as follows: $ cd tools/testing/selftests/bpf $ make $ sudo ./test_progs --name=varlen ... test_varlen:FAIL:check got 0 != exp 66 Signed-off-by: Alban Crequy Signed-off-by: Francis Laniel Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20221110085614.111213-3-albancrequy@linux.microsoft.com Changes v1 to v2: - add ack tag - fix my email - rebase on bpf tree and tag for bpf tree commit 8678ea06852cd1f819b870c773d43df888d15d46 Author: Alban Crequy Date: Thu Nov 10 09:56:13 2022 +0100 maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault() If a page fault occurs while copying the first byte, this function resets one byte before dst. As a consequence, an address could be modified and leaded to kernel crashes if case the modified address was accessed later. Fixes: b58294ead14c ("maccess: allow architectures to provide kernel probing directly") Signed-off-by: Alban Crequy Signed-off-by: Andrii Nakryiko Tested-by: Francis Laniel Reviewed-by: Andrew Morton Cc: [5.8] Link: https://lore.kernel.org/bpf/20221110085614.111213-2-albancrequy@linux.microsoft.com commit df65494ffbb351115e01016c376474bc424427a2 Merge: f9bbe0c99e5b7 000f8870a47bd Author: Linus Torvalds Date: Fri Nov 11 11:41:02 2022 -0800 Merge tag 'hardening-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kernel hardening fix from Kees Cook: - Fix !SMP placement of '.data..decrypted' section (Nathan Chancellor) * tag 'hardening-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: vmlinux.lds.h: Fix placement of '.data..decrypted' section commit f9bbe0c99e5b76a76a1a7fe3bbdd7eaab9f5ab57 Merge: e2559b79127a9 50256e4793a5e Author: Linus Torvalds Date: Fri Nov 11 11:28:26 2022 -0800 Merge tag 'nfsd-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Fix an export leak - Fix a potential tracepoint crash * tag 'nfsd-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: put the export reference in nfsd4_verify_deleg_dentry nfsd: fix use-after-free in nfsd_file_do_acquire tracepoint commit e2559b79127a92a36f907006fe89c137666fb3a5 Merge: eb037f16f7e84 c8af247de385c Author: Linus Torvalds Date: Fri Nov 11 11:25:27 2022 -0800 Merge tag 'fixes_for_v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull UDF fix from Jan Kara: "Fix a possible memory corruption with UDF" * tag 'fixes_for_v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Fix a slab-out-of-bounds write bug in udf_find_entry() commit 1dcdf5f5b2137185cbdd5385f29949ab3da4f00c Author: Zhang Xiaoxu Date: Fri Nov 11 15:12:12 2022 +0800 cifs: Fix connections leak when tlink setup failed If the tlink setup failed, lost to put the connections, then the module refcnt leak since the cifsd kthread not exit. Also leak the fscache info, and for next mount with fsc, it will print the follow errors: CIFS: Cache volume key already in use (cifs,127.0.0.1:445,TEST) Let's check the result of tlink setup, and do some cleanup. Fixes: 56c762eb9bee ("cifs: Refactor out cifs_mount()") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit eb037f16f7e843722db5f0275d84b3f738d5649d Merge: 991f173cd23ce 94d957ae513fc Author: Linus Torvalds Date: Fri Nov 11 09:45:30 2022 -0800 Merge tag 'perf-tools-fixes-for-v6.1-2-2022-11-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix 'perf stat' crash with --per-node --metric-only in CSV mode, due to the AGGR_NODE slot in the 'aggr_header_csv' array not being set. - Fix printing prefix in CSV output of 'perf stat' metrics in interval mode (-I), where an extra separator was being added to the start of some lines. - Fix skipping branch stack sampling 'perf test' entry, that was using both --branch-any and --branch-filter, which can't be used together. * tag 'perf-tools-fixes-for-v6.1-2-2022-11-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf tools: Add the include/perf/ directory to .gitignore perf test: Fix skipping branch stack sampling test perf stat: Fix printing os->prefix in CSV metrics output perf stat: Fix crash with --per-node --metric-only in CSV mode commit 991f173cd23cea2b4102cb78f779a7a43c29e76f Merge: 74bd160fd59f1 fcae44fd36d05 Author: Linus Torvalds Date: Fri Nov 11 09:40:19 2022 -0800 Merge tag 'riscv-for-linus-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix to add the missing PWM LEDs into the SiFive HiFive Unleashed device tree. - A fix to fully clear a task's registers on creation, as they end up in userspace and thus leak kernel memory. - A pair of VDSO-related build fixes that manifest on recent LLVM-based toolchains. - A fix to our early init to ensure the DT is adequately processed before reserved memory nodes are processed. * tag 'riscv-for-linus-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: vdso: Do not add missing symbols to version section in linker script riscv: fix reserved memory setup riscv: vdso: fix build with llvm riscv: process: fix kernel info leakage riscv: dts: sifive unleashed: Add PWM controlled LEDs commit 74bd160fd59f104ca15f4582fee97807146a3a7e Merge: 5be07b3fb53d1 6d3085e4d89ad Author: Linus Torvalds Date: Fri Nov 11 09:32:57 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm "This is a pretty large diffstat for this time of the release. The main culprit is a reorganization of the AMD assembly trampoline, allowing percpu variables to be accessed early. This is needed for the return stack depth tracking retbleed mitigation that will be in 6.2, but it also makes it possible to tighten the IBRS restore on vmexit. The latter change is a long tail of the spectrev2/retbleed patches (the corresponding Intel change was simpler and went in already last June), which is why I am including it right now instead of sharing a topic branch with tip. Being assembly and being rich in comments makes the line count balloon a bit, but I am pretty confident in the change (famous last words) because the reorganization actually makes everything simpler and more understandable than before. It has also had external review and has been tested on the aforementioned 6.2 changes, which explode quite brutally without the fix. Apart from this, things are pretty normal. s390: - PCI fix - PV clock fix x86: - Fix clash between PMU MSRs and other MSRs - Prepare SVM assembly trampoline for 6.2 retbleed mitigation and for... - ... tightening IBRS restore on vmexit, moving it before the first RET or indirect branch - Fix log level for VMSA dump - Block all page faults during kvm_zap_gfn_range() Tools: - kvm_stat: fix incorrect detection of debugfs - kvm_stat: update vmexit definitions" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86/mmu: Block all page faults during kvm_zap_gfn_range() KVM: x86/pmu: Limit the maximum number of supported AMD GP counters KVM: x86/pmu: Limit the maximum number of supported Intel GP counters KVM: x86/pmu: Do not speculatively query Intel GP PMCs that don't exist yet KVM: SVM: Only dump VMSA to klog at KERN_DEBUG level tools/kvm_stat: update exit reasons for vmx/svm/aarch64/userspace tools/kvm_stat: fix incorrect detection of debugfs x86, KVM: remove unnecessary argument to x86_virt_spec_ctrl and callers KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly KVM: SVM: restore host save area from assembly KVM: SVM: move guest vmsave/vmload back to assembly KVM: SVM: do not allocate struct svm_cpu_data dynamically KVM: SVM: remove dead field from struct svm_cpu_data KVM: SVM: remove unused field from struct vcpu_svm KVM: SVM: retrieve VMCB from assembly KVM: SVM: adjust register allocation for __svm_vcpu_run() KVM: SVM: replace regs argument of __svm_vcpu_run() with vcpu_svm KVM: x86: use a separate asm-offsets.c file KVM: s390: pci: Fix allocation size of aift kzdev elements KVM: s390: pv: don't allow userspace to set the clock under PV commit 5be07b3fb53d14581f470745d129141b97d15614 Merge: 91c77a6ec4e20 e70af8d040d2b Author: Linus Torvalds Date: Fri Nov 11 09:24:03 2022 -0800 Merge tag 'hyperv-fixes-signed-20221110' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix TSC MSR write for root partition (Anirudh Rayabharam) - Fix definition of vector in pci-hyperv driver (Dexuan Cui) - A few other misc patches * tag 'hyperv-fixes-signed-20221110' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: PCI: hv: Fix the definition of vector in hv_compose_msi_msg() MAINTAINERS: remove sthemmin x86/hyperv: fix invalid writes to MSRs during root partition kexec clocksource/drivers/hyperv: add data structure for reference TSC MSR Drivers: hv: fix repeated words in comments x86/hyperv: Remove BUG_ON() for kmap_local_page() commit 91c77a6ec4e207085b9d4c27e6710f349d43195d Merge: a83e18ccc486d c47e6403fa099 Author: Linus Torvalds Date: Fri Nov 11 09:19:05 2022 -0800 Merge tag 'dmaengine-fix-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: "Misc minor driver fixes and a big pile of at_hdmac driver fixes. More work on this driver is done and sitting in next: - Pile of at_hdmac driver rework which fixes many long standing issues for this driver. - couple of stm32 driver fixes for clearing structure and race fix - idxd fixes for RO device state and batch size - ti driver mem leak fix - apple fix for grabbing channels in xlate - resource leak fix in mv xor" * tag 'dmaengine-fix-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (24 commits) dmaengine: at_hdmac: Check return code of dma_async_device_register dmaengine: at_hdmac: Fix impossible condition dmaengine: at_hdmac: Don't allow CPU to reorder channel enable dmaengine: at_hdmac: Fix completion of unissued descriptor in case of errors dmaengine: at_hdmac: Fix descriptor handling when issuing it to hardware dmaengine: at_hdmac: Fix concurrency over the active list dmaengine: at_hdmac: Free the memset buf without holding the chan lock dmaengine: at_hdmac: Fix concurrency over descriptor dmaengine: at_hdmac: Fix concurrency problems by removing atc_complete_all() dmaengine: at_hdmac: Protect atchan->status with the channel lock dmaengine: at_hdmac: Do not call the complete callback on device_terminate_all dmaengine: at_hdmac: Fix premature completion of desc in issue_pending dmaengine: at_hdmac: Start transfer for cyclic channels in issue_pending dmaengine: at_hdmac: Don't start transactions at tx_submit level dmaengine: at_hdmac: Fix at_lli struct definition dmaengine: stm32-dma: fix potential race between pause and resume dmaengine: ti: k3-udma-glue: fix memory leak when register device fail dmaengine: mv_xor_v2: Fix a resource leak in mv_xor_v2_remove() dmaengine: apple-admac: Fix grabbing of channels in of_xlate dmaengine: idxd: fix RO device state error after been disabled/reset ... commit a83e18ccc486dc20fdb46109944ea1b450ac771e Merge: 7c42d6f5e663f bff6bef701db7 Author: Linus Torvalds Date: Fri Nov 11 09:13:52 2022 -0800 Merge tag 'spi-fix-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A relatively large batch of fixes here but all device specific, plus an update to MAINTAINERS. The summary print change to the STM32 driver is fixing an issue where the driver could easily end up spamming the logs with something that should be a debug message" * tag 'spi-fix-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: amd: Fix SPI_SPD7 value spi: stm32: fix stm32_spi_prepare_mbr() that halves spi clk for every run spi: meson-spicc: fix do_div build error on non-arm64 spi: intel: Use correct mask for flash and protected regions spi: mediatek: Fix package division error spi: tegra210-quad: Don't initialise DMA if not supported MAINTAINERS: Update HiSilicon SFC Driver maintainer spi: meson-spicc: move wait completion in driver to take bursts delay in account spi: stm32: Print summary 'callbacks suppressed' message commit 7c42d6f5e663f39bcf56d08685d84a7b1d011c77 Merge: 9c730fe10493d f002f45a00ee1 Author: Linus Torvalds Date: Fri Nov 11 09:09:04 2022 -0800 Merge tag 'mmc-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - Provide helper for resetting both SDHCI and CQHCI - Fix reset for CQHCI (am654, brcmstb, esdhc-imx, of-arasan, tegra) - Fixup support for MMC_CAP_8_BIT_DATA (esdhc-imx) * tag 'mmc-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-tegra: Fix SDHCI_RESET_ALL for CQHCI mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI commit 9c730fe10493d309f402cbd28ad539379b13a24d Merge: 64b4aef17ea65 f77810f744139 Author: Linus Torvalds Date: Fri Nov 11 09:03:19 2022 -0800 Merge tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - fix for memory leak (on error path) in Hyper-V driver (Yang Yingliang) - regression fix for handling 3rd barrel switch emulation in Wacom driver (Jason Gerecke) * tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: wacom: Fix logic used for 3rd barrel switch emulation HID: hyperv: fix possible memory leak in mousevsc_probe() HID: asus: Remove unused variable in asus_report_tool_width() commit 5576035f15dfcc6cb1cec236db40c2c0733b0ba4 Author: Pavel Begunkov Date: Fri Nov 11 16:51:30 2022 +0000 io_uring/poll: lockdep annote io_poll_req_insert_locked Add a lockdep annotation in io_poll_req_insert_locked(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8115d8e702733754d0aea119e9b5bb63d1eb8b24.1668184658.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 30a33669fa21cd3dc7d92a00ba736358059014b7 Author: Pavel Begunkov Date: Fri Nov 11 16:51:29 2022 +0000 io_uring/poll: fix double poll req->flags races io_poll_double_prepare() | io_poll_wake() | poll->head = NULL smp_load(&poll->head); /* NULL */ | flags = req->flags; | | req->flags &= ~SINGLE_POLL; req->flags = flags | DOUBLE_POLL | The idea behind io_poll_double_prepare() is to serialise with the first poll entry by taking the wq lock. However, it's not safe to assume that io_poll_wake() is not running when we can't grab the lock and so we may race modifying req->flags. Skip double poll setup if that happens. It's ok because the first poll entry will only be removed when it's definitely completing, e.g. pollfree or oneshot with a valid mask. Fixes: 49f1c68e048f1 ("io_uring: optimise submission side poll_refs") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b7fab2d502f6121a7d7b199fe4d914a43ca9cdfd.1668184658.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 64b4aef17ea65c423fbcdee323b503d8e3ffb3a2 Merge: fd979ca691715 9a5523f72bd2b Author: Linus Torvalds Date: Fri Nov 11 08:58:43 2022 -0800 Merge tag 'sound-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Things look calming down, as this contains only a few small fixes: - Fix for a corner-case bug with SG-buffer page allocation helper - A regression fix for Roland USB-audio device probe - A potential memory leak fix at the error path - Handful quirks and device-specific fixes for HD- and USB-audio" * tag 'sound-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: fix potential memleak in 'add_widget_node' ALSA: memalloc: Don't fall back for SG-buffer with IOMMU ALSA: usb-audio: add quirk to fix Hamedal C20 disconnect issue ALSA: hda/realtek: Add Positivo C6300 model quirk ALSA: usb-audio: Add DSD support for Accuphase DAC-60 ALSA: usb-audio: Add quirk entry for M-Audio Micro ALSA: hda/hdmi - enable runtime pm for more AMD display audio ALSA: usb-audio: Remove redundant workaround for Roland quirk ALSA: usb-audio: Yet more regression for for the delayed card registration ALSA: hda/ca0132: add quirk for EVGA Z390 DARK ALSA: hda: clarify comments on SCF changes ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq() ALSA: hda/realtek: Add quirk for ASUS Zenbook using CS35L41 commit fd979ca691715891a979ce12d1a485b108af74d3 Merge: 4bbf3422df780 b7ffd9d9ee13d Author: Linus Torvalds Date: Fri Nov 11 08:50:36 2022 -0800 Merge tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Weekly pull request for graphics, mostly amdgpu and i915, with a couple of fixes for vc4 and panfrost, panel quirks and a kconfig change for rcar-du. Nothing seems to be too strange at this stage. amdgpu: - Fix s/r in amdgpu_vram_mgr_new - SMU 13.0.4 update - GPUVM TLB race fix - DCN 3.1.4 fixes - DCN 3.2.x fixes - Vega10 fan fix - BACO fix for Beige Goby board - PSR fix - GPU VM PT locking fixes amdkfd: - CRIU fixes vc4: - HDMI fixes to vc4. panfrost: - Make panfrost's uapi header compile with C++. - Handle 1 gb boundary correctly in panfrost mmu code. panel: - Add rotation quirks for 2 panels. rcar-du: - DSI Kconfig fix i915: - Fix sg_table handling in map_dma_buf - Send PSR update also on invalidate - Do not set cache_dirty for DGFX - Restore userptr probe_range behaviour" * tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm: (29 commits) drm/amd/display: only fill dirty rectangles when PSR is enabled drm/amdgpu: disable BACO on special BEIGE_GOBY card drm/amdgpu: Drop eviction lock when allocating PT BO drm/amdgpu: Unlock bo_list_mutex after error handling Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"" drm/amd/display: Enforce minimum prefetch time for low memclk on DCN32 drm/amd/display: Fix gpio port mapping issue drm/amd/display: Fix reg timeout in enc314_enable_fifo drm/amd/display: Fix FCLK deviation and tool compile issues drm/amd/display: Zeromem mypipe heap struct before using it drm/amd/display: Update SR watermarks for DCN314 drm/amdgpu: workaround for TLB seq race drm/amdkfd: Fix error handling in criu_checkpoint drm/amdkfd: Fix error handling in kfd_criu_restore_events drm/amd/pm: update SMU IP v13.0.4 msg interface header drm: rcar-du: Fix Kconfig dependency between RCAR_DU and RCAR_MIPI_DSI drm/panfrost: Split io-pgtable requests properly drm/amdgpu: Fix the lpfn checking condition in drm buddy drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017) drm: panel-orientation-quirks: Add quirk for Nanote UMPC-01 ... commit 648060902aa302331b5d6e4f26d8ee0761d239ab Author: Jason A. Donenfeld Date: Fri Oct 28 15:23:44 2022 +0200 MIPS: pic32: treat port as signed integer get_port_from_cmdline() returns an int, yet is assigned to a char, which is wrong in its own right, but also, with char becoming unsigned, this poses problems, because -1 is used as an error value. Further complicating things, fw_init_early_console() is only ever called with a -1 argument. Fix this up by removing the unused argument from fw_init_early_console() and treating port as a proper signed integer. Cc: Thomas Bogendoerfer Signed-off-by: Jason A. Donenfeld Signed-off-by: Thomas Bogendoerfer commit 64ac0befe75bdfaffc396c2b4a0ed5ae6920eeee Author: Jiaxun Yang Date: Thu Nov 3 15:10:53 2022 +0000 MIPS: jump_label: Fix compat branch range check Cast upper bound of branch range to long to do signed compare, avoid negative offset trigger this warning. Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6") Signed-off-by: Jiaxun Yang Cc: stable@vger.kernel.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 2a296157859287c3b639f7228354c13f7182ed71 Author: Linus Walleij Date: Thu Nov 3 11:15:35 2022 +0100 mips: alchemy: gpio: Include the right header The local GPIO driver in the MIPS Alchemy is including the legacy header but what it wants is to implement a GPIO driver so include instead. Cc: Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Linus Walleij Signed-off-by: Thomas Bogendoerfer commit fa706927f4722a2df723b2a28d139b1904a3e7fa Author: Liao Chang Date: Thu Nov 3 09:18:15 2022 +0800 MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed Add WARN_ON on kexec related kmalloc failed, avoid to pass NULL pointer to following memcpy and loongson_kexec_prepare. Fixes: 6ce48897ce47 ("MIPS: Loongson64: Add kexec/kdump support") Signed-off-by: Liao Chang Signed-off-by: Thomas Bogendoerfer commit 612d80784fdc0c2e2ee2e2d901a55ef2f72ebf4b Author: Rongwei Zhang Date: Wed Nov 2 20:27:39 2022 +0800 MIPS: fix duplicate definitions for exported symbols Building with clang-14 fails with: AS arch/mips/kernel/relocate_kernel.o :0: error: symbol 'kexec_args' is already defined :0: error: symbol 'secondary_kexec_args' is already defined :0: error: symbol 'kexec_start_address' is already defined :0: error: symbol 'kexec_indirection_page' is already defined :0: error: symbol 'relocate_new_kernel_size' is already defined It turns out EXPORT defined in asm/asm.h expands to a symbol definition, so there is no need to define these symbols again. Remove duplicated symbol definitions. Fixes: 7aa1c8f47e7e ("MIPS: kdump: Add support") Signed-off-by: Rongwei Zhang Reviewed-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit 62776e4378ae9086115ffd6f8bd9b9c0fe6e6809 Author: John Thomson Date: Tue Nov 1 03:07:49 2022 +1000 mips: boot/compressed: use __NO_FORTIFY In the mips CONFIG_SYS_SUPPORTS_ZBOOT kernel, fix the compile error when using CONFIG_FORTIFY_SOURCE=y LD vmlinuz mipsel-openwrt-linux-musl-ld: arch/mips/boot/compressed/decompress.o: in function `decompress_kernel': ./include/linux/decompress/mm.h:(.text.decompress_kernel+0x177c): undefined reference to `warn_slowpath_fmt' kernel test robot helped identify this as related to fortify. The error appeared with commit 54d9469bc515 ("fortify: Add run-time WARN for cross-field memcpy()") Link: https://lore.kernel.org/r/202209161144.x9xSqNQZ-lkp@intel.com/ Resolve this in the same style as commit cfecea6ead5f ("lib/string: Move helper functions out of string.c") Reported-by: kernel test robot Fixes: 54d9469bc515 ("fortify: Add run-time WARN for cross-field memcpy()") Reviewed-by: Kees Cook Signed-off-by: John Thomson Signed-off-by: Thomas Bogendoerfer commit 6d3085e4d89ad7e6c7f1c6cf929d903393565861 Author: Sean Christopherson Date: Fri Nov 11 00:18:41 2022 +0000 KVM: x86/mmu: Block all page faults during kvm_zap_gfn_range() When zapping a GFN range, pass 0 => ALL_ONES for the to-be-invalidated range to effectively block all page faults while the zap is in-progress. The invalidation helpers take a host virtual address, whereas zapping a GFN obviously provides a guest physical address and with the wrong unit of measurement (frame vs. byte). Alternatively, KVM could walk all memslots to get the associated HVAs, but thanks to SMM, that would require multiple lookups. And practically speaking, kvm_zap_gfn_range() usage is quite rare and not a hot path, e.g. MTRR and CR0.CD are almost guaranteed to be done only on vCPU0 during boot, and APICv inhibits are similarly infrequent operations. Fixes: edb298c663fc ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range") Reported-by: Chao Peng Cc: stable@vger.kernel.org Cc: Maxim Levitsky Signed-off-by: Sean Christopherson Message-Id: <20221111001841.2412598-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f3a72878a3de720661b7ed0d6b7f7c506ddb8a52 Author: Jaco Coetzee Date: Wed Nov 9 15:27:57 2022 -0500 nfp: change eeprom length to max length enumerators Extend the size of QSFP EEPROM for types SSF8436 and SFF8636 from 256 to 640 bytes in order to expose all the EEPROM pages by ethtool. For SFF-8636 and SFF-8436 specifications, the driver exposes 256 bytes of EEPROM data for ethtool's get_module_eeprom() callback, resulting in "netlink error: Invalid argument" when an EEPROM read with an offset larger than 256 bytes is attempted. Changing the length enumerators to the _MAX_LEN variants exposes all 640 bytes of the EEPROM allowing upper pages 1, 2 and 3 to be read. Fixes: 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command") Signed-off-by: Jaco Coetzee Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 1ff36351309e3eadcff297480baf4785e726de9b Author: Yang Yingliang Date: Tue Nov 8 21:40:04 2022 +0800 ata: libata-transport: fix error handling in ata_tdev_add() In ata_tdev_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added. Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 13 PID: 13603 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #36 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x3a0 lr : device_del+0x44/0x3a0 Call trace: device_del+0x48/0x3a0 attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tdev_delete+0x24/0x50 [libata] ata_tlink_delete+0x40/0xa0 [libata] ata_tport_delete+0x2c/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci] Fix this by checking and handling return value of transport_add_device() in ata_tdev_add(). In the error path, device_del() is called to delete the device which was added earlier in this function, and ata_tdev_free() is called to free ata_dev. Fixes: d9027470b886 ("[libata] Add ATA transport class") Signed-off-by: Yang Yingliang Signed-off-by: Damien Le Moal commit cf0816f6322c5c37ee52655f928e91ecf32da103 Author: Yang Yingliang Date: Tue Nov 8 21:40:03 2022 +0800 ata: libata-transport: fix error handling in ata_tlink_add() In ata_tlink_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added. Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 33 PID: 13850 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #12 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x39c lr : device_del+0x44/0x39c Call trace: device_del+0x48/0x39c attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tlink_delete+0x88/0xb0 [libata] ata_tport_delete+0x2c/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci] Fix this by checking and handling return value of transport_add_device() in ata_tlink_add(). Fixes: d9027470b886 ("[libata] Add ATA transport class") Signed-off-by: Yang Yingliang Signed-off-by: Damien Le Moal commit 3613dbe3909dcc637fe6be00e4dc43b4aa0470ee Author: Yang Yingliang Date: Tue Nov 8 21:40:02 2022 +0800 ata: libata-transport: fix error handling in ata_tport_add() In ata_tport_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added. Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 12 PID: 13605 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #8 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x39c lr : device_del+0x44/0x39c Call trace: device_del+0x48/0x39c attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tport_delete+0x34/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci] Fix this by checking and handling return value of transport_add_device() in ata_tport_add(). Fixes: d9027470b886 ("[libata] Add ATA transport class") Signed-off-by: Yang Yingliang Signed-off-by: Damien Le Moal commit 8c76310740807ade5ecdab5888f70ecb6d35732e Author: Yang Yingliang Date: Tue Nov 8 21:40:01 2022 +0800 ata: libata-transport: fix double ata_host_put() in ata_tport_add() In the error path in ata_tport_add(), when calling put_device(), ata_tport_release() is called, it will put the refcount of 'ap->host'. And then ata_host_put() is called again, the refcount is decreased to 0, ata_host_release() is called, all ports are freed and set to null. When unbinding the device after failure, ata_host_stop() is called to release the resources, it leads a null-ptr-deref(), because all the ports all freed and null. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 CPU: 7 PID: 18671 Comm: modprobe Kdump: loaded Tainted: G E 6.1.0-rc3+ #8 pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ata_host_stop+0x3c/0x84 [libata] lr : release_nodes+0x64/0xd0 Call trace: ata_host_stop+0x3c/0x84 [libata] release_nodes+0x64/0xd0 devres_release_all+0xbc/0x1b0 device_unbind_cleanup+0x20/0x70 really_probe+0x158/0x320 __driver_probe_device+0x84/0x120 driver_probe_device+0x44/0x120 __driver_attach+0xb4/0x220 bus_for_each_dev+0x78/0xdc driver_attach+0x2c/0x40 bus_add_driver+0x184/0x240 driver_register+0x80/0x13c __pci_register_driver+0x4c/0x60 ahci_pci_driver_init+0x30/0x1000 [ahci] Fix this by removing redundant ata_host_put() in the error path. Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host") Signed-off-by: Yang Yingliang Signed-off-by: Damien Le Moal commit 2db1fdb25d209a88112fd82eb493976d66057d10 Author: Peng Fan Date: Fri Nov 4 13:49:42 2022 +0800 arm64: dts: imx93-pinfunc: drop execution permission Drop the header file execution permission Signed-off-by: Peng Fan Fixes: ec8b5b5058ea ("arm64: dts: freescale: Add i.MX93 dtsi support") Signed-off-by: Shawn Guo commit 5468e93b5b1083eaa729f98e59da18c85d9c4126 Author: Marek Vasut Date: Wed Nov 2 20:19:47 2022 +0100 arm64: dts: imx8mn: Fix NAND controller size-cells The NAND controller size-cells should be 0 per DT bindings. Fix the following warning produces by DT bindings check: " nand-controller@33002000: #size-cells:0:0: 0 was expected nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) " Fixes: 6c3debcbae47a ("arm64: dts: freescale: Add i.MX8MN dtsi support") Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 1610233bc2c2cae2dff9e101e6ea5ef69cceb0e9 Author: Marek Vasut Date: Wed Nov 2 20:19:46 2022 +0100 arm64: dts: imx8mm: Fix NAND controller size-cells The NAND controller size-cells should be 0 per DT bindings. Fix the following warning produces by DT bindings check: " nand-controller@33002000: #size-cells:0:0: 0 was expected nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) " Fix the missing space in node name too. Fixes: a05ea40eb384e ("arm64: dts: imx: Add i.mx8mm dtsi support") Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 753395ea1e45c724150070b5785900b6a44bd5fb Author: Marek Vasut Date: Wed Nov 2 20:19:45 2022 +0100 ARM: dts: imx7: Fix NAND controller size-cells The NAND controller size-cells should be 0 per DT bindings. Fix the following warning produces by DT bindings check: " nand-controller@33002000: #size-cells:0:0: 0 was expected nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) " Fix the missing space in node name too. Fixes: e7495a45a76de ("ARM: dts: imx7: add GPMI NAND and APBH DMA") Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 3c9fd44b9330adc5006653566f3d386784b2080e Author: Sean Christopherson Date: Fri Nov 11 00:22:25 2022 +0000 drm/i915/gvt: Unconditionally put reference to KVM when detaching vGPU Always put the KVM reference when closing a vCPU device, as intel_vgpu_open_device() succeeds if and only if the KVM pointer is valid and a reference to KVM is acquired. And if that doesn't hold true, the call to kvm_page_track_unregister_notifier() a few lines earlier is doomed. Reviewed-by: Kevin Tian Signed-off-by: Sean Christopherson Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20221111002225.2418386-3-seanjc@google.com commit 9ed1fdee9ee324f3505ff066287ee53143caaaa2 Author: Sean Christopherson Date: Fri Nov 11 00:22:24 2022 +0000 drm/i915/gvt: Get reference to KVM iff attachment to VM is successful Get a reference to KVM if and only if a vGPU is successfully attached to the VM to avoid leaking a reference if there's no available vGPU. On open_device() failure, vfio_device_open() doesn't invoke close_device(). Fixes: 421cfe6596f6 ("vfio: remove VFIO_GROUP_NOTIFY_SET_KVM") Cc: stable@vger.kernel.org Reviewed-by: Kevin Tian Signed-off-by: Sean Christopherson Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20221111002225.2418386-2-seanjc@google.com commit 63fd9437ec81899fc36bb642d558378bc89aa4f9 Author: Alexander Stein Date: Tue Nov 1 10:30:31 2022 +0100 arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR Using extcon USB host mode works properly on DR interface, e.g. enabling/disabling VBUS. But USB device mode is not working. Fix this by switching to usb-role-switch instead. Fixes: dfcd1b6f7620 ("arm64: dts: freescale: add initial device tree for TQMa8MQML with i.MX8MM") Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 4bbf3422df78029f03161640dcb1e9d1ed64d1ea Merge: 1767a722a708f abd5ac18ae661 Author: Linus Torvalds Date: Thu Nov 10 17:31:15 2022 -0800 Merge tag 'net-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, wifi, can and bpf. Current release - new code bugs: - can: af_can: can_exit(): add missing dev_remove_pack() of canxl_packet Previous releases - regressions: - bpf, sockmap: fix the sk->sk_forward_alloc warning - wifi: mac80211: fix general-protection-fault in ieee80211_subif_start_xmit() - can: af_can: fix NULL pointer dereference in can_rx_register() - can: dev: fix skb drop check, avoid o-o-b access - nfnetlink: fix potential dead lock in nfnetlink_rcv_msg() Previous releases - always broken: - bpf: fix wrong reg type conversion in release_reference() - gso: fix panic on frag_list with mixed head alloc types - wifi: brcmfmac: fix buffer overflow in brcmf_fweh_event_worker() - wifi: mac80211: set TWT Information Frame Disabled bit as 1 - eth: macsec offload related fixes, make sure to clear the keys from memory - tun: fix memory leaks in the use of napi_get_frags - tun: call napi_schedule_prep() to ensure we own a napi - tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent - ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network - tipc: fix a msg->req tlv length check - sctp: clear out_curr if all frag chunks of current msg are pruned, avoid list corruption - mctp: fix an error handling path in mctp_init(), avoid leaks" * tag 'net-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (101 commits) eth: sp7021: drop free_netdev() from spl2sw_init_netdev() MAINTAINERS: Move Vivien to CREDITS net: macvlan: fix memory leaks of macvlan_common_newlink ethernet: tundra: free irq when alloc ring failed in tsi108_open() net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open() ethernet: s2io: disable napi when start nic failed in s2io_card_up() net: atlantic: macsec: clear encryption keys from the stack net: phy: mscc: macsec: clear encryption keys when freeing a flow stmmac: dwmac-loongson: fix missing of_node_put() while module exiting stmmac: dwmac-loongson: fix missing pci_disable_device() in loongson_dwmac_probe() stmmac: dwmac-loongson: fix missing pci_disable_msi() while module exiting cxgb4vf: shut down the adapter when t4vf_update_port_info() failed in cxgb4vf_open() mctp: Fix an error handling path in mctp_init() stmmac: intel: Update PCH PTP clock rate from 200MHz to 204.8MHz net: cxgb3_main: disable napi when bind qsets failed in cxgb_up() net: cpsw: disable napi in cpsw_ndo_open() iavf: Fix VF driver counting VLAN 0 filters ice: Fix spurious interrupt during removal of trusted VF net/mlx5e: TC, Fix slab-out-of-bounds in parse_tc_actions net/mlx5e: E-Switch, Fix comparing termination table instance ... commit abd5ac18ae661681fbacd8c9d0a577943da4c89e Merge: b3bbeba09453f 7f1a6d4b9e820 Author: Jakub Kicinski Date: Thu Nov 10 16:29:56 2022 -0800 Merge tag 'mlx5-fixes-2022-11-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-11-02 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-11-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: TC, Fix slab-out-of-bounds in parse_tc_actions net/mlx5e: E-Switch, Fix comparing termination table instance net/mlx5e: TC, Fix wrong rejection of packet-per-second policing net/mlx5e: Fix tc acts array not to be dependent on enum order net/mlx5e: Fix usage of DMA sync API net/mlx5e: Add missing sanity checks for max TX WQE size net/mlx5: fw_reset: Don't try to load device in case PCI isn't working net/mlx5: E-switch, Set to legacy mode if failed to change switchdev mode net/mlx5: Allow async trigger completion execution on single CPU systems net/mlx5: Bridge, verify LAG state when adding bond to bridge ==================== Link: https://lore.kernel.org/r/20221109184050.108379-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit b3bbeba09453f87d37bd5f211887537c7bbc5a0b Merge: de91b3197d151 0e710a3ffd0ca Author: Jakub Kicinski Date: Thu Nov 10 16:17:24 2022 -0800 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-11-09 (ice, iavf) This series contains updates to ice and iavf drivers. Norbert stops disabling VF queues that are not enabled for ice driver. Michal stops accounting of VLAN 0 filter to match expectations of PF driver for iavf. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: Fix VF driver counting VLAN 0 filters ice: Fix spurious interrupt during removal of trusted VF ==================== Link: https://lore.kernel.org/r/20221110003744.201414-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit de91b3197d15172407608b2c357aab7ac1451e2b Author: Wei Yongjun Date: Wed Nov 9 15:01:16 2022 +0000 eth: sp7021: drop free_netdev() from spl2sw_init_netdev() It's not necessary to free netdev allocated with devm_alloc_etherdev() and using free_netdev() leads to double free. Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20221109150116.2988194-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit b7ffd9d9ee13de2c5ad88046a5149de4cfb2a74b Merge: 42bf3ce70f2a9 178e31ce82d03 Author: Dave Airlie Date: Fri Nov 11 10:20:11 2022 +1000 Merge tag 'drm-intel-fixes-2022-11-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix sg_table handling in map_dma_buf (Matthew Auld) - Send PSR update also on invalidate (Jouni Högander) - Do not set cache_dirty for DGFX (Niranjana Vishwanathapura) - Restore userptr probe_range behaviour (Matthew Auld) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y2zCy5q85qE9W0J8@tursulin-desk commit 4979524f5a2a8210e87fde2f642b0dc060860821 Author: Shang XiaoJing Date: Tue Nov 1 15:07:16 2022 +0800 drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() drm_vblank_init() call drmm_add_action_or_reset() with drm_vblank_init_release() as action. If __drmm_add_action() failed, will directly call drm_vblank_init_release() with the vblank whose worker is NULL. As the resule, a null-ptr-deref will happen in kthread_destroy_worker(). Add the NULL check before calling drm_vblank_destroy_worker(). BUG: null-ptr-deref KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] CPU: 5 PID: 961 Comm: modprobe Not tainted 6.0.0-11331-gd465bff130bf-dirty RIP: 0010:kthread_destroy_worker+0x25/0xb0 Call Trace: drm_vblank_init_release+0x124/0x220 [drm] ? drm_crtc_vblank_restore+0x8b0/0x8b0 [drm] __drmm_add_action_or_reset+0x41/0x50 [drm] drm_vblank_init+0x282/0x310 [drm] vkms_init+0x35f/0x1000 [vkms] ? 0xffffffffc4508000 ? lock_is_held_type+0xd7/0x130 ? __kmem_cache_alloc_node+0x1c2/0x2b0 ? lock_is_held_type+0xd7/0x130 ? 0xffffffffc4508000 do_one_initcall+0xd0/0x4f0 ... do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 5e6c2b4f9161 ("drm/vblank: Add vblank works") Signed-off-by: Shang XiaoJing Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-3-shangxiaojing@huawei.com commit ff963634f7b2e0dc011349abb3fb81a0d074f443 Author: Shang XiaoJing Date: Tue Nov 1 15:07:15 2022 +0800 drm/drv: Fix potential memory leak in drm_dev_init() drm_dev_init() will add drm_dev_init_release() as a callback. When drmm_add_action() failed, the release function won't be added. As the result, the ref cnt added by device_get() in drm_dev_init() won't be put by drm_dev_init_release(), which leads to the memleak. Use drmm_add_action_or_reset() instead of drmm_add_action() to prevent memleak. unreferenced object 0xffff88810bc0c800 (size 2048): comm "modprobe", pid 8322, jiffies 4305809845 (age 15.292s) hex dump (first 32 bytes): e8 cc c0 0b 81 88 ff ff ff ff ff ff 00 00 00 00 ................ 20 24 3c 0c 81 88 ff ff 18 c8 c0 0b 81 88 ff ff $<............. backtrace: [<000000007251f72d>] __kmalloc+0x4b/0x1c0 [<0000000045f21f26>] platform_device_alloc+0x2d/0xe0 [<000000004452a479>] platform_device_register_full+0x24/0x1c0 [<0000000089f4ea61>] 0xffffffffa0736051 [<00000000235b2441>] do_one_initcall+0x7a/0x380 [<0000000001a4a177>] do_init_module+0x5c/0x230 [<000000002bf8a8e2>] load_module+0x227d/0x2420 [<00000000637d6d0a>] __do_sys_finit_module+0xd5/0x140 [<00000000c99fc324>] do_syscall_64+0x3f/0x90 [<000000004d85aa77>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 2cbf7fc6718b ("drm: Use drmm_ for drm_dev_init cleanup") Signed-off-by: Shang XiaoJing Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-2-shangxiaojing@huawei.com commit fcae44fd36d052e956e69a64642fc03820968d78 Author: Nathan Chancellor Date: Tue Nov 8 10:13:23 2022 -0700 RISC-V: vdso: Do not add missing symbols to version section in linker script Recently, ld.lld moved from '--undefined-version' to '--no-undefined-version' as the default, which breaks the compat vDSO build: ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_gettimeofday' failed: symbol not defined ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_gettime' failed: symbol not defined ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_getres' failed: symbol not defined These symbols are not present in the compat vDSO or the regular vDSO for 32-bit but they are unconditionally included in the version section of the linker script, which is prohibited with '--no-undefined-version'. Fix this issue by only including the symbols that are actually exported in the version section of the linker script. Link: https://github.com/ClangBuiltLinux/linux/issues/1756 Signed-off-by: Nathan Chancellor Tested-by: Conor Dooley Link: https://lore.kernel.org/r/20221108171324.3377226-1-nathan@kernel.org/ Signed-off-by: Palmer Dabbelt commit 50e63dd8ed92045eb70a72d7ec725488320fb68b Author: Conor Dooley Date: Mon Nov 7 15:15:25 2022 +0000 riscv: fix reserved memory setup Currently, RISC-V sets up reserved memory using the "early" copy of the device tree. As a result, when trying to get a reserved memory region using of_reserved_mem_lookup(), the pointer to reserved memory regions is using the early, pre-virtual-memory address which causes a kernel panic when trying to use the buffer's name: Unable to handle kernel paging request at virtual address 00000000401c31ac Oops [#1] Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-rc1-00001-g0d9d6953d834 #1 Hardware name: Microchip PolarFire-SoC Icicle Kit (DT) epc : string+0x4a/0xea ra : vsnprintf+0x1e4/0x336 epc : ffffffff80335ea0 ra : ffffffff80338936 sp : ffffffff81203be0 gp : ffffffff812e0a98 tp : ffffffff8120de40 t0 : 0000000000000000 t1 : ffffffff81203e28 t2 : 7265736572203a46 s0 : ffffffff81203c20 s1 : ffffffff81203e28 a0 : ffffffff81203d22 a1 : 0000000000000000 a2 : ffffffff81203d08 a3 : 0000000081203d21 a4 : ffffffffffffffff a5 : 00000000401c31ac a6 : ffff0a00ffffff04 a7 : ffffffffffffffff s2 : ffffffff81203d08 s3 : ffffffff81203d00 s4 : 0000000000000008 s5 : ffffffff000000ff s6 : 0000000000ffffff s7 : 00000000ffffff00 s8 : ffffffff80d9821a s9 : ffffffff81203d22 s10: 0000000000000002 s11: ffffffff80d9821c t3 : ffffffff812f3617 t4 : ffffffff812f3617 t5 : ffffffff812f3618 t6 : ffffffff81203d08 status: 0000000200000100 badaddr: 00000000401c31ac cause: 000000000000000d [] vsnprintf+0x1e4/0x336 [] vprintk_store+0xf6/0x344 [] vprintk_emit+0x56/0x192 [] vprintk_default+0x16/0x1e [] vprintk+0x72/0x80 [] _printk+0x36/0x50 [] print_reserved_mem+0x1c/0x24 [] paging_init+0x528/0x5bc [] setup_arch+0xd0/0x592 [] start_kernel+0x82/0x73c early_init_fdt_scan_reserved_mem() takes no arguments as it operates on initial_boot_params, which is populated by early_init_dt_verify(). On RISC-V, early_init_dt_verify() is called twice. Once, directly, in setup_arch() if CONFIG_BUILTIN_DTB is not enabled and once indirectly, very early in the boot process, by parse_dtb() when it calls early_init_dt_scan_nodes(). This first call uses dtb_early_va to set initial_boot_params, which is not usable later in the boot process when early_init_fdt_scan_reserved_mem() is called. On arm64 for example, the corresponding call to early_init_dt_scan_nodes() uses fixmap addresses and doesn't suffer the same fate. Move early_init_fdt_scan_reserved_mem() further along the boot sequence, after the direct call to early_init_dt_verify() in setup_arch() so that the names use the correct virtual memory addresses. The above supposed that CONFIG_BUILTIN_DTB was not set, but should work equally in the case where it is - unflatted_and_copy_device_tree() also updates initial_boot_params. Reported-by: Valentina Fernandez Reported-by: Evgenii Shatokhin Link: https://lore.kernel.org/linux-riscv/f8e67f82-103d-156c-deb0-d6d6e2756f5e@microchip.com/ Fixes: 922b0375fc93 ("riscv: Fix memblock reservation for device tree blob") Signed-off-by: Conor Dooley Tested-by: Evgenii Shatokhin Link: https://lore.kernel.org/r/20221107151524.3941467-1-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 9b9eaee9828fe98b030cf43ac50065a54a2f5d52 Author: Ard Biesheuvel Date: Sun Nov 6 15:53:54 2022 +0100 arm64: efi: Fix handling of misaligned runtime regions and drop warning Currently, when mapping the EFI runtime regions in the EFI page tables, we complain about misaligned regions in a rather noisy way, using WARN(). Not only does this produce a lot of irrelevant clutter in the log, it is factually incorrect, as misaligned runtime regions are actually allowed by the EFI spec as long as they don't require conflicting memory types within the same 64k page. So let's drop the warning, and tweak the code so that we - take both the start and end of the region into account when checking for misalignment - only revert to RWX mappings for non-code regions if misaligned code regions are also known to exist. Cc: Acked-by: Linus Torvalds Signed-off-by: Ard Biesheuvel commit 550b33cfd445296868a478e8413ffb2e963eed32 Author: Ard Biesheuvel Date: Thu Nov 10 10:36:20 2022 +0100 arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines Ampere Altra machines are reported to misbehave when the SetTime() EFI runtime service is called after ExitBootServices() but before calling SetVirtualAddressMap(). Given that the latter is horrid, pointless and explicitly documented as optional by the EFI spec, we no longer invoke it at boot if the configured size of the VA space guarantees that the EFI runtime memory regions can remain mapped 1:1 like they are at boot time. On Ampere Altra machines, this results in SetTime() calls issued by the rtc-efi driver triggering synchronous exceptions during boot. We can now recover from those without bringing down the system entirely, due to commit 23715a26c8d81291 ("arm64: efi: Recover from synchronous exceptions occurring in firmware"). However, it would be better to avoid the issue entirely, given that the firmware appears to remain in a funny state after this. So attempt to identify these machines based on the 'family' field in the type #1 SMBIOS record, and call SetVirtualAddressMap() unconditionally in that case. Tested-by: Alexandru Elisei Signed-off-by: Ard Biesheuvel commit 42bf3ce70f2a969a1a92b797f8c690d43f968b1d Merge: 2e4b294576e32 a830a15678593 Author: Dave Airlie Date: Fri Nov 11 08:11:18 2022 +1000 Merge tag 'drm-fixes-20221109' of git://linuxtv.org/pinchartl/media into drm-fixes R-Car DSI Kconfig dependency fix Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/Y2u8+uM4A006XRPh@pendragon.ideasonboard.com commit 50f4dd657a0fcf90aa8da8dc2794a8100ff4c37c Author: Jisheng Zhang Date: Tue Nov 1 02:29:43 2022 +0800 riscv: vdso: fix build with llvm Even after commit 89fd4a1df829 ("riscv: jump_label: mark arguments as const to satisfy asm constraints"), building with CC_OPTIMIZE_FOR_SIZE + LLVM=1 can reproduce below build error: CC arch/riscv/kernel/vdso/vgettimeofday.o In file included from :4: In file included from lib/vdso/gettimeofday.c:5: In file included from include/vdso/datapage.h:17: In file included from include/vdso/processor.h:10: In file included from arch/riscv/include/asm/vdso/processor.h:7: In file included from include/linux/jump_label.h:112: arch/riscv/include/asm/jump_label.h:42:3: error: invalid operand for inline asm constraint 'i' " .option push \n\t" ^ 1 error generated. I think the problem is when "-Os" is passed as CFLAGS, it's removed by "CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os" which is introduced in commit e05d57dcb8c7 ("riscv: Fixup __vdso_gettimeofday broke dynamic ftrace"), thus no optimization at all for vgettimeofday.c arm64 does remove "-Os" as well, but it forces "-O2" after removing "-Os". I compared the generated vgettimeofday.o with "-O2" and "-Os", I think no big performance difference. So let's tell the kbuild not to remove "-Os" rather than follow arm64 style. vdso related performance can be improved a lot when building kernel with CC_OPTIMIZE_FOR_SIZE after this commit, ("-Os" VS no optimization) Fixes: e05d57dcb8c7 ("riscv: Fixup __vdso_gettimeofday broke dynamic ftrace") Signed-off-by: Jisheng Zhang Tested-by: Conor Dooley Link: https://lore.kernel.org/r/20221031182943.2453-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 6ce3df596be25d95c2cddc9e1b673394948e3732 Author: Florian Fainelli Date: Wed Nov 9 15:19:07 2022 -0800 MAINTAINERS: Move Vivien to CREDITS Last patch from Vivien was nearly 3 years ago and he has not reviewed or responded to DSA patches since then, move to CREDITS. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221109231907.621678-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 6510c78490c490a6636e48b61eeaa6fb65981f4b Author: Jisheng Zhang Date: Sat Oct 29 19:34:50 2022 +0800 riscv: process: fix kernel info leakage thread_struct's s[12] may contain random kernel memory content, which may be finally leaked to userspace. This is a security hole. Fix it by clearing the s[12] array in thread_struct when fork. As for kthread case, it's better to clear the s[12] array as well. Fixes: 7db91e57a0ac ("RISC-V: Task implementation") Signed-off-by: Jisheng Zhang Tested-by: Guo Ren Link: https://lore.kernel.org/r/20221029113450.4027-1-jszhang@kernel.org Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/CAJF2gTSdVyAaM12T%2B7kXAdRPGS4VyuO08X1c7paE-n4Fr8OtRA@mail.gmail.com/ Signed-off-by: Palmer Dabbelt commit 39bd801d6908900e9ab0cdc2655150f95ddd4f1a Author: Richard Fitzgerald Date: Fri Nov 4 13:22:13 2022 +0000 ASoC: soc-pcm: Don't zero TDM masks in __soc_pcm_open() The DAI tx_mask and rx_mask are set by snd_soc_dai_set_tdm_slot() and used by later code that depends on the TDM settings. So __soc_pcm_open() should not be obliterating those mask values. The code in __soc_pcm_hw_params() uses these masks to calculate the active channels so that only the AIF_IN/AIF_OUT widgets for the active TDM slots are enabled. The zeroing of the masks in __soc_pcm_open() disables this functionality so all AIF widgets were enabled even for channels that are not assigned to a TDM slot. Signed-off-by: Richard Fitzgerald Fixes: 2e5894d73789 ("ASoC: pcm: Add support for DAI multicodec") Link: https://lore.kernel.org/r/20221104132213.121847-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 2e4b294576e32fb02562ad6839d6888ab7b45102 Merge: 5bf06c4c51c59 f352262f72721 Author: Dave Airlie Date: Fri Nov 11 06:31:37 2022 +1000 Merge tag 'drm-misc-fixes-2022-11-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc5: - HDMI fixes to vc4. - Make panfrost's uapi header compile with C++. - Add rotation quirks for 2 panels. - Fix s/r in amdgpu_vram_mgr_new - Handle 1 gb boundary correctly in panfrost mmu code. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/e02de501-4b85-28a0-3f6e-751ca13f5f9d@linux.intel.com commit 0bb8e9b36b5b7f2e77892981ff6c27ee831d8026 Author: Detlev Casanova Date: Thu Nov 10 14:06:12 2022 -0500 ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove Since commit bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove"), the device power control registers are reset when the driver is removed/shutdown. This is an issue when the device is configured to use the PLL clock. The device will stop responding if it is still configured to use the PLL clock but the PLL clock is powered down. When rebooting linux, the probe function will show: sgtl5000 0-000a: Error reading chip id -11 Make sure that the CHIP_CLK_CTRL is reset to its default value before powering down the device. Fixes: bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove") Signed-off-by: Detlev Casanova Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20221110190612.1341469-1-detlev.casanova@collabora.com Signed-off-by: Mark Brown commit e806e223621e4f5105170df69d7311dc3fb4bbb4 Author: Anthony DeRossi Date: Wed Nov 9 17:40:27 2022 -0800 vfio/pci: Check the device set open count on reset vfio_pci_dev_set_needs_reset() inspects the open_count of every device in the set to determine whether a reset is allowed. The current device always has open_count == 1 within vfio_pci_core_disable(), effectively disabling the reset logic. This field is also documented as private in vfio_device, so it should not be used to determine whether other devices in the set are open. Checking for vfio_device_set_open_count() > 1 on the device set fixes both issues. After commit 2cd8b14aaa66 ("vfio/pci: Move to the device set infrastructure"), failure to create a new file for a device would cause the reset to be skipped due to open_count being decremented after calling close_device() in the error path. After commit eadd86f835c6 ("vfio: Remove calls to vfio_group_add_container_user()"), releasing a device would always skip the reset due to an ordering change in vfio_device_fops_release(). Failing to reset the device leaves it in an unknown state, potentially causing errors when it is accessed later or bound to a different driver. This issue was observed with a Radeon RX Vega 56 [1002:687f] (rev c3) assigned to a Windows guest. After shutting down the guest, unbinding the device from vfio-pci, and binding the device to amdgpu: [ 548.007102] [drm:psp_hw_start [amdgpu]] *ERROR* PSP create ring failed! [ 548.027174] [drm:psp_hw_init [amdgpu]] *ERROR* PSP firmware loading failed [ 548.027242] [drm:amdgpu_device_fw_loading [amdgpu]] *ERROR* hw_init of IP block failed -22 [ 548.027306] amdgpu 0000:0a:00.0: amdgpu: amdgpu_device_ip_init failed [ 548.027308] amdgpu 0000:0a:00.0: amdgpu: Fatal error during GPU init Fixes: 2cd8b14aaa66 ("vfio/pci: Move to the device set infrastructure") Fixes: eadd86f835c6 ("vfio: Remove calls to vfio_group_add_container_user()") Signed-off-by: Anthony DeRossi Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20221110014027.28780-4-ajderossi@gmail.com Signed-off-by: Alex Williamson commit 5cd189e410debedda416fecfc12f4716b5829845 Author: Anthony DeRossi Date: Wed Nov 9 17:40:26 2022 -0800 vfio: Export the device set open count The open count of a device set is the sum of the open counts of all devices in the set. Drivers can use this value to determine whether shared resources are in use without tracking them manually or accessing the private open_count in vfio_device. Signed-off-by: Anthony DeRossi Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Yi Liu Link: https://lore.kernel.org/r/20221110014027.28780-3-ajderossi@gmail.com Signed-off-by: Alex Williamson commit 7fdba0011157861892c470995ff586a1871e603f Author: Anthony DeRossi Date: Wed Nov 9 17:40:25 2022 -0800 vfio: Fix container device registration life cycle In vfio_device_open(), vfio_device_container_register() is always called when open_count == 1. On error, vfio_device_container_unregister() is only called when open_count == 1 and close_device is set. This leaks a registration for devices without a close_device implementation. In vfio_device_fops_release(), vfio_device_container_unregister() is called unconditionally. This can cause a device to be unregistered multiple times. Treating container device registration/unregistration uniformly (always when open_count == 1) fixes both issues. Fixes: ce4b4657ff18 ("vfio: Replace the DMA unmapping notifier with a callback") Signed-off-by: Anthony DeRossi Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Yi Liu Link: https://lore.kernel.org/r/20221110014027.28780-2-ajderossi@gmail.com Signed-off-by: Alex Williamson commit 3851d25c75ed03117268a8feb34adca5a843a126 Author: Jens Axboe Date: Thu Nov 10 10:50:55 2022 -0700 io_uring: check for rollover of buffer ID when providing buffers We already check if the chosen starting offset for the buffer IDs fit within an unsigned short, as 65535 is the maximum value for a provided buffer. But if the caller asks to add N buffers at offset M, and M + N would exceed the size of the unsigned short, we simply add buffers with wrapping around the ID. This is not necessarily a bug and could in fact be a valid use case, but it seems confusing and inconsistent with the initial check for starting offset. Let's check for wrap consistently, and error the addition if we do need to wrap. Reported-by: Olivier Langlois Link: https://github.com/axboe/liburing/issues/726 Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit 1edfe4ea16ca2c9e91ec6cecd446b13636724e4f Author: Tejun Heo Date: Mon Oct 10 13:54:16 2022 -1000 kernfs: Fix spurious lockdep warning in kernfs_find_and_get_node_by_id() c25491747b21 ("kernfs: Add KERNFS_REMOVING flags") made kernfs_find_and_get_node_by_id() test kernfs_active() instead of KERNFS_ACTIVATED. kernfs_find_and_get_by_id() is called without holding the kernfs_rwsem triggering the following lockdep warning. WARNING: CPU: 1 PID: 6191 at fs/kernfs/dir.c:36 kernfs_active+0xe8/0x120 fs/kernfs/dir.c:38 Modules linked in: CPU: 1 PID: 6191 Comm: syz-executor.1 Not tainted 6.0.0-syzkaller-09413-g4899a36f91a9 #0 Hardware name: linux,dummy-virt (DT) pstate: 10000005 (nzcV daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : kernfs_active+0xe8/0x120 fs/kernfs/dir.c:36 lr : lock_is_held include/linux/lockdep.h:283 [inline] lr : kernfs_active+0x94/0x120 fs/kernfs/dir.c:36 sp : ffff8000182c7a00 x29: ffff8000182c7a00 x28: 0000000000000002 x27: 0000000000000001 x26: ffff00000ee1f6a8 x25: 1fffe00001dc3ed5 x24: 0000000000000000 x23: ffff80000ca1fba0 x22: ffff8000089efcb0 x21: 0000000000000001 x20: ffff0000091181d0 x19: ffff0000091181d0 x18: ffff00006a9e6b88 x17: 0000000000000000 x16: 0000000000000000 x15: ffff00006a9e6bc4 x14: 1ffff00003058f0e x13: 1fffe0000258c816 x12: ffff700003058f39 x11: 1ffff00003058f38 x10: ffff700003058f38 x9 : dfff800000000000 x8 : ffff80000e482f20 x7 : ffff0000091d8058 x6 : ffff80000e482c60 x5 : ffff000009402ee8 x4 : 1ffff00001bd1f46 x3 : 1fffe0000258c6d1 x2 : 0000000000000003 x1 : 00000000000000c0 x0 : 0000000000000000 Call trace: kernfs_active+0xe8/0x120 fs/kernfs/dir.c:38 kernfs_find_and_get_node_by_id+0x6c/0x140 fs/kernfs/dir.c:708 __kernfs_fh_to_dentry fs/kernfs/mount.c:102 [inline] kernfs_fh_to_dentry+0x88/0x1fc fs/kernfs/mount.c:128 exportfs_decode_fh_raw+0x104/0x560 fs/exportfs/expfs.c:435 exportfs_decode_fh+0x10/0x5c fs/exportfs/expfs.c:575 do_handle_to_path fs/fhandle.c:152 [inline] handle_to_path fs/fhandle.c:207 [inline] do_handle_open+0x2a4/0x7b0 fs/fhandle.c:223 __do_compat_sys_open_by_handle_at fs/fhandle.c:277 [inline] __se_compat_sys_open_by_handle_at fs/fhandle.c:274 [inline] __arm64_compat_sys_open_by_handle_at+0x6c/0x9c fs/fhandle.c:274 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x6c/0x260 arch/arm64/kernel/syscall.c:52 el0_svc_common.constprop.0+0xc4/0x254 arch/arm64/kernel/syscall.c:142 do_el0_svc_compat+0x40/0x70 arch/arm64/kernel/syscall.c:212 el0_svc_compat+0x54/0x140 arch/arm64/kernel/entry-common.c:772 el0t_32_sync_handler+0x90/0x140 arch/arm64/kernel/entry-common.c:782 el0t_32_sync+0x190/0x194 arch/arm64/kernel/entry.S:586 irq event stamp: 232 hardirqs last enabled at (231): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline] hardirqs last enabled at (231): [] finish_lock_switch kernel/sched/core.c:4943 [inline] hardirqs last enabled at (231): [] finish_task_switch.isra.0+0x200/0x880 kernel/sched/core.c:5061 hardirqs last disabled at (232): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:404 softirqs last enabled at (228): [] _stext+0x938/0xf58 softirqs last disabled at (207): [] ____do_softirq+0x10/0x20 arch/arm64/kernel/irq.c:79 ---[ end trace 0000000000000000 ]--- The lockdep warning in kernfs_active() is there to ensure that the activated state stays stable for the caller. For kernfs_find_and_get_node_by_id(), all that's needed is ensuring that a node which has never been activated can't be looked up and guaranteeing lookup success when the caller knows the node to be active, both of which can be achieved by testing the active count without holding the kernfs_rwsem. Fix the spurious warning by introducing __kernfs_active() which doesn't have the lockdep annotation. Signed-off-by: Tejun Heo Reported-by: syzbot+590ce62b128e79cf0a35@syzkaller.appspotmail.com Fixes: c25491747b21 ("kernfs: Add KERNFS_REMOVING flags") Cc: Amir Goldstein Cc: Dmitry Vyukov Link: https://lore.kernel.org/r/Y0SwqBsZ9BMmZv6x@slm.duckdns.org Signed-off-by: Greg Kroah-Hartman commit 37882100cd0629d830db430a8cee0b724fe1fea3 Author: Junxiao Chang Date: Thu Nov 10 07:40:23 2022 +0800 ASoC: hdac_hda: fix hda pcm buffer overflow issue When KASAN is enabled, below log might be dumped with Intel EHL hardware: [ 48.583597] ================================================================== [ 48.585921] BUG: KASAN: slab-out-of-bounds in hdac_hda_dai_hw_params+0x20a/0x22b [snd_soc_hdac_hda] [ 48.587995] Write of size 4 at addr ffff888103489708 by task pulseaudio/759 [ 48.589237] CPU: 2 PID: 759 Comm: pulseaudio Tainted: G U E 5.15.71-intel-ese-standard-lts #9 [ 48.591272] Hardware name: Intel Corporation Elkhart Lake Embedded Platform/ElkhartLake LPDDR4x T3 CRB, BIOS EHLSFWI1.R00.4251.A01.2206130432 06/13/2022 [ 48.593010] Call Trace: [ 48.593648] [ 48.593852] dump_stack_lvl+0x34/0x48 [ 48.594404] print_address_description.constprop.0+0x1f/0x140 [ 48.595174] ? hdac_hda_dai_hw_params+0x20a/0x22b [snd_soc_hdac_hda] [ 48.595868] ? hdac_hda_dai_hw_params+0x20a/0x22b [snd_soc_hdac_hda] [ 48.596519] kasan_report.cold+0x7f/0x11b [ 48.597003] ? hdac_hda_dai_hw_params+0x20a/0x22b [snd_soc_hdac_hda] [ 48.597885] hdac_hda_dai_hw_params+0x20a/0x22b [snd_soc_hdac_hda] HDAC_LAST_DAI_ID is last index id, pcm buffer array size should be +1 to avoid out of bound access. Fixes: 608b8c36c371 ("ASoC: hdac_hda: add support for HDMI/DP as a HDA codec") Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Junxiao Chang Signed-off-by: Furong Zhou Link: https://lore.kernel.org/r/20221109234023.3111035-1-junxiao.chang@intel.com Signed-off-by: Mark Brown commit 7c0f8f1462c9edeaa202a2cbea1bde0960434b09 Author: Olivier Moysan Date: Thu Nov 10 09:44:06 2022 +0100 ASoC: stm32: i2s: remove irqf_oneshot flag The IRQF_ONESHOT flag allows to ensure that the interrupt is not unmasked after the hard interrupt context handler has been executed and the thread has been woken. The interrupt line is unmasked after the thread handler function has been executed. The STM32 I2S driver does not implement a threaded IRQ handler. So, the IRQF_ONESHOT flag is not useful in I2S driver. Remove this flag to allow the interrupt routine to be managed as a thread in RT mode. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20221110084406.287117-1-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 65946690ed8d972fdb91a74ee75ac0f0f0d68321 Author: Brian Norris Date: Wed Oct 19 18:10:53 2022 -0700 firmware: coreboot: Register bus in module init The coreboot_table driver registers a coreboot bus while probing a "coreboot_table" device representing the coreboot table memory region. Probing this device (i.e., registering the bus) is a dependency for the module_init() functions of any driver for this bus (e.g., memconsole-coreboot.c / memconsole_driver_init()). With synchronous probe, this dependency works OK, as the link order in the Makefile ensures coreboot_table_driver_init() (and thus, coreboot_table_probe()) completes before a coreboot device driver tries to add itself to the bus. With asynchronous probe, however, coreboot_table_probe() may race with memconsole_driver_init(), and so we're liable to hit one of these two: 1. coreboot_driver_register() eventually hits "[...] the bus was not initialized.", and the memconsole driver fails to register; or 2. coreboot_driver_register() gets past #1, but still races with bus_register() and hits some other undefined/crashing behavior (e.g., in driver_find() [1]) We can resolve this by registering the bus in our initcall, and only deferring "device" work (scanning the coreboot memory region and creating sub-devices) to probe(). [1] Example failure, using 'driver_async_probe=*' kernel command line: [ 0.114217] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 ... [ 0.114307] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc1 #63 [ 0.114316] Hardware name: Google Scarlet (DT) ... [ 0.114488] Call trace: [ 0.114494] _raw_spin_lock+0x34/0x60 [ 0.114502] kset_find_obj+0x28/0x84 [ 0.114511] driver_find+0x30/0x50 [ 0.114520] driver_register+0x64/0x10c [ 0.114528] coreboot_driver_register+0x30/0x3c [ 0.114540] memconsole_driver_init+0x24/0x30 [ 0.114550] do_one_initcall+0x154/0x2e0 [ 0.114560] do_initcall_level+0x134/0x160 [ 0.114571] do_initcalls+0x60/0xa0 [ 0.114579] do_basic_setup+0x28/0x34 [ 0.114588] kernel_init_freeable+0xf8/0x150 [ 0.114596] kernel_init+0x2c/0x12c [ 0.114607] ret_from_fork+0x10/0x20 [ 0.114624] Code: 5280002b 1100054a b900092a f9800011 (885ffc01) [ 0.114631] ---[ end trace 0000000000000000 ]--- Fixes: b81e3140e412 ("firmware: coreboot: Make bus registration symmetric") Cc: Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20221019180934.1.If29e167d8a4771b0bf4a39c89c6946ed764817b9@changeid Signed-off-by: Greg Kroah-Hartman commit ee424f7d3960152f5f862bbb6943e59828dc7917 Author: Christian Lamparter Date: Fri Nov 4 17:52:03 2022 +0100 nvmem: u-boot-env: fix crc32_data_offset on redundant u-boot-env The Western Digital MyBook Live (PowerPC 464/APM82181) has a set of redundant u-boot-env. Loading up the driver the following error: | u_boot_env: Invalid calculated CRC32: 0x4f8f2c86 (expected: 0x98b14514) | u_boot_env: probe of partition@1e000 failed with error -22 Looking up the userspace libubootenv utilities source [0], it looks like the "mark" or "flag" is not part of the crc32 sum... which is unfortunate :( |static int libuboot_load(struct uboot_ctx *ctx) |{ |[...] | if (ctx->redundant) { | [...] | offsetdata = offsetof(struct uboot_env_redund, data); | [...] //-----^^ | } | usable_envsize = ctx->size - offsetdata; | buf[0] = malloc(bufsize); |[...] | for (i = 0; i < copies; i++) { | data = (uint8_t *)(buf[i] + offsetdata); | uint32_t crc; | | ret = devread(ctx, i, buf[i]); | [...] | crc = *(uint32_t *)(buf[i] + offsetcrc); | dev->crc = crc32(0, (uint8_t *)data, usable_envsize); | [0] https://github.com/sbabic/libubootenv/blob/master/src/uboot_env.c#L951 Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables") Signed-off-by: Christian Lamparter Link: https://lore.kernel.org/r/70a16eae113e08db2390b76e174f4837caa135c3.1667580636.git.chunkeey@gmail.com Signed-off-by: Greg Kroah-Hartman commit e54fad8044db18cc400df8d01bfb86cada08b7cb Author: Zheng Bin Date: Thu Oct 27 17:59:04 2022 +0800 slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m If CONFIG_SLIM_QCOM_NGD_CTRL=y, CONFIG_QCOM_RPROC_COMMON=m, COMPILE_TEST=y, bulding fails: drivers/slimbus/qcom-ngd-ctrl.o: In function `qcom_slim_ngd_ctrl_probe': qcom-ngd-ctrl.c:(.text+0x330): undefined reference to `qcom_register_ssr_notifier' qcom-ngd-ctrl.c:(.text+0x5fc): undefined reference to `qcom_unregister_ssr_notifier' drivers/slimbus/qcom-ngd-ctrl.o: In function `qcom_slim_ngd_remove': qcom-ngd-ctrl.c:(.text+0x90c): undefined reference to `qcom_unregister_ssr_notifier' Make SLIM_QCOM_NGD_CTRL depends on QCOM_RPROC_COMMON || (COMPILE_TEST && !QCOM_RPROC_COMMON) to fix this. Fixes: e291691c6977 ("slimbus: qcom-ngd-ctrl: allow compile testing without QCOM_RPROC_COMMON") Cc: stable Signed-off-by: Zheng Bin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221027095904.3388959-1-zhengbin13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 5fddf8962b429b8303c4a654291ecb6e61a7d747 Author: Shuah Khan Date: Tue Oct 11 11:14:17 2022 -0600 docs: update mediator contact information in CoC doc Update mediator contact information in CoC interpretation document. Cc: Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20221011171417.34286-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit b9c1939627f8185dec8ba6d741e9573a4c7a5834 Author: Krzysztof Kozlowski Date: Thu Sep 29 18:52:02 2022 +0200 slimbus: stream: correct presence rate frequencies Correct few frequencies in presence rate table - multiplied by 10 (110250 instead of 11025 Hz). Fixes: abb9c9b8b51b ("slimbus: stream: add stream support") Cc: Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220929165202.410937-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1aeb122d214b92474c86fde00a03d6e2d69381b5 Author: Horatiu Vultur Date: Wed Sep 28 21:51:12 2022 +0200 nvmem: lan9662-otp: Fix compatible string The device tree bindings for lan9662-otp expects the compatible string to be one of following compatible strings: microchip,lan9662-otpc microchip,lan9668-otpc The problem is that the lan9662-otp driver contains the microchip,lan9662-otp compatible string instead of microchip,lan9662-otpc. Fix this by updating the compatible string in the driver. Fixes: 9e8f208ad5229d ("nvmem: lan9662-otp: add support") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220928195112.630351-1-horatiu.vultur@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1767a722a708f1fa3b9af39eb091d79101f8c086 Merge: f014699cca9a9 c62f6bec53e63 Author: Linus Torvalds Date: Thu Nov 10 08:58:29 2022 -0800 Merge tag 'for-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - revert memory optimization for scrub blocks, this misses errors in 2nd and following blocks - add exception for ENOMEM as reason for transaction abort to not print stack trace, syzbot has reported many - zoned fixes: - fix locking imbalance during scrub - initialize zones for seeding device - initialize zones for cloned device structures - when looking up device, change assertion to a real check as some of the search parameters can be passed by ioctl, reported by syzbot - fix error pointer check in self tests * tag 'for-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: zoned: fix locking imbalance on scrub btrfs: zoned: initialize device's zone info for seeding btrfs: zoned: clone zoned device info when cloning a device Revert "btrfs: scrub: use larger block size for data extent scrub" btrfs: don't print stack trace when transaction is aborted due to ENOMEM btrfs: selftests: fix wrong error check in btrfs_free_dummy_root() btrfs: fix match incorrectly in dev_args_match_device commit f014699cca9a9a28fbdc06a9225b54562154fc20 Merge: 8395ee62b1b78 49a467310dc4f Author: Linus Torvalds Date: Thu Nov 10 08:42:59 2022 -0800 Merge tag 'soundwire-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire fixes from Vinod Koul: "Two qcom driver fixes for broadcast completion reinit and check for outanding writes. And a lone Intel driver fix for clock stop timeout" * tag 'soundwire-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: qcom: check for outanding writes before doing a read soundwire: qcom: reinit broadcast completion soundwire: intel: Initialize clock stop timeout commit 8395ee62b1b78a3d2789840bf6bf1a7c43deaa32 Merge: 179228654ddef 819b885cd886c Author: Linus Torvalds Date: Thu Nov 10 08:36:42 2022 -0800 Merge tag 'phy-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull phy fixes from Vinod Koul: "A bunch of odd driver fixes and a MAINTAINER email update: - Update Kishon's email - stms32 error code fix in driver probe - tegra: fix for checking valid pointer - qcom_qmp: null deref fix - sunplus: error check fix - ralink: add missing sentinel to table" * tag 'phy-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: ralink: mt7621-pci: add sentinel to quirks table phy: sunplus: Fix an IS_ERR() vs NULL bug in sp_usb_phy_probe phy: qcom-qmp-combo: fix NULL-deref on runtime resume phy: tegra: xusb: Fix crash during pad power on/down phy: stm32: fix an error code in probe MAINTAINERS: Update Kishon's email address in GENERIC PHY FRAMEWORK commit 179228654ddefcbd99060a113ad02079dcdf22f1 Merge: f67dd6ce0723a c29f446108e10 Author: Linus Torvalds Date: Thu Nov 10 08:28:20 2022 -0800 Merge tag 'hwlock-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull hwspinlock updates from Bjorn Andersson: "I apparently had missed tagging and sending this set of changes out during the 6.1 merge window. But did get the associated dts changes depending on this merged. The result is a regression in 6.1-rc on the affected, older, Qualcomm platforms - in for form of them not booting. So while these weren't regression fixes originally, they are now. It's not introducing new beahavior, but simply extending the existing new Devicetree model, to cover remaining platforms: - extend the DeviceTree binding and implementation for the Qualcomm hardware spinlock on some older platforms to follow the style of the newer ones where the DeviceTree representation does not rely on an intermediate syscon node" * tag 'hwlock-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: dt-bindings: hwlock: qcom-hwspinlock: add syscon to MSM8974 hwspinlock: qcom: add support for MMIO on older SoCs hwspinlock: qcom: correct MMIO max register for newer SoCs dt-bindings: hwlock: qcom-hwspinlock: correct example indentation dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs commit 36b038791e1e2baea892e9276588815fd14894b4 Author: Mel Gorman Date: Thu Nov 10 12:44:00 2022 +0000 x86/fpu: Drop fpregs lock before inheriting FPU permissions Mike Galbraith reported the following against an old fork of preempt-rt but the same issue also applies to the current preempt-rt tree. BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: systemd preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: fpu_clone CPU: 6 PID: 1 Comm: systemd Tainted: G E (unreleased) Call Trace: dump_stack_lvl ? fpu_clone __might_resched rt_spin_lock fpu_clone ? copy_thread ? copy_process ? shmem_alloc_inode ? kmem_cache_alloc ? kernel_clone ? __do_sys_clone ? do_syscall_64 ? __x64_sys_rt_sigprocmask ? syscall_exit_to_user_mode ? do_syscall_64 ? syscall_exit_to_user_mode ? do_syscall_64 ? syscall_exit_to_user_mode ? do_syscall_64 ? exc_page_fault ? entry_SYSCALL_64_after_hwframe Mike says: The splat comes from fpu_inherit_perms() being called under fpregs_lock(), and us reaching the spin_lock_irq() therein due to fpu_state_size_dynamic() returning true despite static key __fpu_state_size_dynamic having never been enabled. Mike's assessment looks correct. fpregs_lock on a PREEMPT_RT kernel disables preemption so calling spin_lock_irq() in fpu_inherit_perms() is unsafe. This problem exists since commit 9e798e9aa14c ("x86/fpu: Prepare fpu_clone() for dynamically enabled features"). Even though the original bug report should not have enabled the paths at all, the bug still exists. fpregs_lock is necessary when editing the FPU registers or a task's FP state but it is not necessary for fpu_inherit_perms(). The only write of any FP state in fpu_inherit_perms() is for the new child which is not running yet and cannot context switch or be borrowed by a kernel thread yet. Hence, fpregs_lock is not protecting anything in the new child until clone() completes and can be dropped earlier. The siglock still needs to be acquired by fpu_inherit_perms() as the read of the parent's permissions has to be serialised. [ bp: Cleanup splat. ] Fixes: 9e798e9aa14c ("x86/fpu: Prepare fpu_clone() for dynamically enabled features") Reported-by: Mike Galbraith Signed-off-by: Mel Gorman Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Cc: Link: https://lore.kernel.org/r/20221110124400.zgymc2lnwqjukgfh@techsingularity.net commit 876153ab068b2507a19aa3ef481f5b00a2cc780f Author: Aishwarya Kothari Date: Wed Aug 31 16:16:22 2022 +0200 drm/panel: simple: set bpc field for logic technologies displays In case bpc is not set for a panel it then throws a WARN(). Add bpc to the panels logictechno_lt170410_2whc and logictechno_lt161010_2nh. Fixes: 5728fe7fa539 ("drm/panel: simple: add display timings for logic technologies displays") Signed-off-by: Aishwarya Kothari Signed-off-by: Francesco Dolcini Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220831141622.39605-1-francesco.dolcini@toradex.com commit 23569b5652ee8e8e55a12f7835f59af6f3cefc30 Author: Chuang Wang Date: Wed Nov 9 17:07:34 2022 +0800 net: macvlan: fix memory leaks of macvlan_common_newlink kmemleak reports memory leaks in macvlan_common_newlink, as follows: ip link add link eth0 name .. type macvlan mode source macaddr add kmemleak reports: unreferenced object 0xffff8880109bb140 (size 64): comm "ip", pid 284, jiffies 4294986150 (age 430.108s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 b8 aa 5a 12 80 88 ff ff ..........Z..... 80 1b fa 0d 80 88 ff ff 1e ff ac af c7 c1 6b 6b ..............kk backtrace: [] kmem_cache_alloc_trace+0x1c7/0x300 [] macvlan_hash_add_source+0x45/0xc0 [] macvlan_changelink_sources+0xd7/0x170 [] macvlan_common_newlink+0x38c/0x5a0 [] macvlan_newlink+0xe/0x20 [] __rtnl_newlink+0x7af/0xa50 [] rtnl_newlink+0x48/0x70 ... In the scenario where the macvlan mode is configured as 'source', macvlan_changelink_sources() will be execured to reconfigure list of remote source mac addresses, at the same time, if register_netdevice() return an error, the resource generated by macvlan_changelink_sources() is not cleaned up. Using this patch, in the case of an error, it will execute macvlan_flush_sources() to ensure that the resource is cleaned up. Fixes: aa5fd0fb7748 ("driver: macvlan: Destroy new macvlan port if macvlan_common_newlink failed.") Signed-off-by: Chuang Wang Link: https://lore.kernel.org/r/20221109090735.690500-1-nashuiliang@gmail.com Signed-off-by: Paolo Abeni commit acce40037041f97baad18142bb253064491ebde3 Author: Zhengchao Shao Date: Wed Nov 9 12:40:16 2022 +0800 ethernet: tundra: free irq when alloc ring failed in tsi108_open() When alloc tx/rx ring failed in tsi108_open(), it doesn't free irq. Fix it. Fixes: 5e123b844a1c ("[PATCH] Add tsi108/9 On Chip Ethernet device driver support") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109044016.126866-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 9a5523f72bd2b0d66eef3d58810c6eb7b5ffc143 Author: Ye Bin Date: Thu Nov 10 22:45:39 2022 +0800 ALSA: hda: fix potential memleak in 'add_widget_node' As 'kobject_add' may allocated memory for 'kobject->name' when return error. And in this function, if call 'kobject_add' failed didn't free kobject. So call 'kobject_put' to recycling resources. Signed-off-by: Ye Bin Cc: Link: https://lore.kernel.org/r/20221110144539.2989354-1-yebin@huaweicloud.com Signed-off-by: Takashi Iwai commit df24560d058d11f02b7493bdfc553131ef60b23d Merge: f829230dd5197 e65fdf530f55c Author: Jens Axboe Date: Thu Nov 10 06:55:02 2022 -0700 Merge tag 'nvme-6.1-2022-11-10' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - quiet user passthrough command errors (Keith Busch) - fix memory leak in nvmet_subsys_attr_model_store_locked - fix a memory leak in nvmet-auth (Sagi Grimberg)" * tag 'nvme-6.1-2022-11-10' of git://git.infradead.org/nvme: nvmet: fix a memory leak nvmet: fix memory leak in nvmet_subsys_attr_model_store_locked nvme: quiet user passthrough command errors commit 9736a325137b62499d2b4be3fc2d742b131f75da Author: Takashi Iwai Date: Thu Nov 10 14:22:16 2022 +0100 ALSA: memalloc: Don't fall back for SG-buffer with IOMMU When the non-contiguous page allocation for SG buffer allocation fails, the memalloc helper tries to fall back to the old page allocation methods. This would, however, result in the bogus page addresses when IOMMU is enabled. Usually in such a case, the fallback allocation should fail as well, but occasionally it succeeds and hitting a bad access. The fallback was thought for non-IOMMU case, and as the error from dma_alloc_noncontiguous() with IOMMU essentially implies a fatal memory allocation error, we should return the error straightforwardly without fallback. This avoids the corner case like the above. The patch also renames the local variable "dma_ops" with snd_ prefix for avoiding the name conflict. Fixes: a8d302a0b770 ("ALSA: memalloc: Revive x86-specific WC page allocations again") Reported-by: Kai Vehmanen Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2211041541090.3532114@eliteleevi.tm.intel.com Link: https://lore.kernel.org/r/20221110132216.30605-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit f111606b63ff2282428ffbac0447c871eb957b6c Author: Zhengchao Shao Date: Wed Nov 9 10:54:32 2022 +0800 net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open() When failed to init rxq or txq in mv643xx_eth_open() for opening device, napi isn't disabled. When open mv643xx_eth device next time, it will trigger a BUG_ON() in napi_enable(). Compile tested only. Fixes: 2257e05c1705 ("mv643xx_eth: get rid of receive-side locking") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109025432.80900-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 0348c1ab980c1d43fb37b758d4b760990c066cb5 Author: Zhengchao Shao Date: Wed Nov 9 10:37:41 2022 +0800 ethernet: s2io: disable napi when start nic failed in s2io_card_up() When failed to start nic or add interrupt service routine in s2io_card_up() for opening device, napi isn't disabled. When open s2io device next time, it will trigger a BUG_ON()in napi_enable(). Compile tested only. Fixes: 5f490c968056 ("S2io: Fixed synchronization between scheduling of napi with card reset and close") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109023741.131552-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit dba9e3467425800f9d3a14e8b6a0f85c731c1650 Author: Gaosheng Cui Date: Thu Nov 10 17:44:45 2022 +0800 drm/vc4: kms: Fix IS_ERR() vs NULL check for vc4_kms The drm_atomic_get_new_private_obj_state() function returns NULL on error path, drm_atomic_get_old_private_obj_state() function returns NULL on error path, too, they does not return error pointers. By the way, vc4_hvs_get_new/old_global_state() should return ERR_PTR(-EINVAL), otherwise there will be null-ptr-defer issue, such as follows: In function vc4_atomic_commit_tail(): |-- old_hvs_state = vc4_hvs_get_old_global_state(state); <-- return NULL |-- if (WARN_ON(IS_ERR(old_hvs_state))) <-- no return |-- unsigned long state_rate = max(old_hvs_state->core_clock_rate, new_hvs_state->core_clock_rate); <-- null-ptr-defer Fixes: 9ec03d7f1ed3 ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Gaosheng Cui Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20221110094445.2930509-6-cuigaosheng1@huawei.com commit 91d5c5060ee24fe8da88cd585bb43b843d2f0dce Author: Zeng Heng Date: Thu Nov 10 16:20:56 2022 +0800 pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map Here is the BUG report by KASAN about null pointer dereference: BUG: KASAN: null-ptr-deref in strcmp+0x2e/0x50 Read of size 1 at addr 0000000000000000 by task python3/2640 Call Trace: strcmp __of_find_property of_find_property pinctrl_dt_to_map kasprintf() would return NULL pointer when kmalloc() fail to allocate. So directly return ENOMEM, if kasprintf() return NULL pointer. Fixes: 57291ce295c0 ("pinctrl: core device tree mapping table parsing support") Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20221110082056.2014898-1-zengheng4@huawei.com Signed-off-by: Linus Walleij commit 1893bb64c0d97f53febcfa606dc34dd581008d1d Merge: 63eec6f926ad8 879785def0f5e Author: Paolo Abeni Date: Thu Nov 10 11:58:54 2022 +0100 Merge branch 'macsec-clear-encryption-keys-in-h-w-drivers' Antoine Tenart says: ==================== macsec: clear encryption keys in h/w drivers Commit aaab73f8fba4 ("macsec: clear encryption keys from the stack after setting up offload") made sure to clean encryption keys from the stack after setting up offloading but some h/w drivers did a copy of the key which need to be zeroed as well. The MSCC PHY driver can actually be converted not to copy the encryption key at all, but such patch would be quite difficult to backport. I'll send a following up patch doing this in net-next once this series lands. Tested on the MSCC PHY but not on the atlantic NIC. ==================== Link: https://lore.kernel.org/r/20221108153459.811293-1-atenart@kernel.org Signed-off-by: Paolo Abeni commit 879785def0f5e71d54399de0f8a5cb399db14171 Author: Antoine Tenart Date: Tue Nov 8 16:34:59 2022 +0100 net: atlantic: macsec: clear encryption keys from the stack Commit aaab73f8fba4 ("macsec: clear encryption keys from the stack after setting up offload") made sure to clean encryption keys from the stack after setting up offloading, but the atlantic driver made a copy and did not clear it. Fix this. [4 Fixes tags below, all part of the same series, no need to split this] Fixes: 9ff40a751a6f ("net: atlantic: MACSec ingress offload implementation") Fixes: b8f8a0b7b5cb ("net: atlantic: MACSec ingress offload HW bindings") Fixes: 27736563ce32 ("net: atlantic: MACSec egress offload implementation") Fixes: 9d106c6dd81b ("net: atlantic: MACSec egress offload HW bindings") Signed-off-by: Antoine Tenart Signed-off-by: Paolo Abeni commit 1b16b3fdf675cca15a537572bac50cc5354368fc Author: Antoine Tenart Date: Tue Nov 8 16:34:58 2022 +0100 net: phy: mscc: macsec: clear encryption keys when freeing a flow Commit aaab73f8fba4 ("macsec: clear encryption keys from the stack after setting up offload") made sure to clean encryption keys from the stack after setting up offloading, but the MSCC PHY driver made a copy, kept it in the flow data and did not clear it when freeing a flow. Fix this. Fixes: 28c5107aa904 ("net: phy: mscc: macsec support") Signed-off-by: Antoine Tenart Signed-off-by: Paolo Abeni commit 0d10e90cee9eb57882b0f7e19fd699033722e226 Author: Zhichao Liu Date: Thu Nov 10 15:28:39 2022 +0800 spi: mediatek: Fix DEVAPC Violation at KO Remove A DEVAPC violation occurs when removing the module due to accessing HW registers without base clock. To fix this bug, the correct method is: 1. Call the runtime resume function to enable the clock; 2. Operate the registers to reset the HW; 3. Turn off the clocks and disable the device RPM mechanism. Signed-off-by: Zhichao Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221110072839.30961-1-zhichao.liu@mediatek.com Signed-off-by: Mark Brown commit 63eec6f926ad8d1c8d658679349ef6581a800d4a Merge: c6092ea1e6d7b 7f94d0498f9c7 Author: Paolo Abeni Date: Thu Nov 10 11:03:05 2022 +0100 Merge branch 'stmmac-dwmac-loongson-fixes-three-leaks' Yang Yingliang says: ==================== stmmac: dwmac-loongson: fixes three leaks patch #2 fixes missing pci_disable_device() in the error path in probe() patch #1 and pach #3 fix missing pci_disable_msi() and of_node_put() in error and remove() path. ==================== Link: https://lore.kernel.org/r/20221108114647.4144952-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni commit 7f94d0498f9c763f37172c08059ae91804c3075a Author: Yang Yingliang Date: Tue Nov 8 19:46:47 2022 +0800 stmmac: dwmac-loongson: fix missing of_node_put() while module exiting The node returned by of_get_child_by_name() with refcount decremented, of_node_put() needs be called when finish using it. So add it in the error path in loongson_dwmac_probe() and in loongson_dwmac_remove(). Fixes: 2ae34111fe4e ("stmmac: dwmac-loongson: fix invalid mdio_node") Signed-off-by: Yang Yingliang Signed-off-by: Paolo Abeni commit fe5b3ce8b4377e543960220f539b989a927afd8a Author: Yang Yingliang Date: Tue Nov 8 19:46:46 2022 +0800 stmmac: dwmac-loongson: fix missing pci_disable_device() in loongson_dwmac_probe() Add missing pci_disable_device() in the error path in loongson_dwmac_probe(). Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Yang Yingliang Signed-off-by: Paolo Abeni commit f2d45fdf9a0ed2c94c01c422a0d0add8ffd42099 Author: Yang Yingliang Date: Tue Nov 8 19:46:45 2022 +0800 stmmac: dwmac-loongson: fix missing pci_disable_msi() while module exiting pci_enable_msi() has been called in loongson_dwmac_probe(), so pci_disable_msi() needs be called in remove path and error path of probe(). Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Yang Yingliang Signed-off-by: Paolo Abeni commit bf990c10231937c0f51e5da5558e08cf5adc6a78 Author: Ai Chao Date: Thu Nov 10 14:34:52 2022 +0800 ALSA: usb-audio: add quirk to fix Hamedal C20 disconnect issue For Hamedal C20, the current rate is different from the runtime rate, snd_usb_endpoint stop and close endpoint to resetting rate. if snd_usb_endpoint close the endpoint, sometimes usb will disconnect the device. Signed-off-by: Ai Chao Link: https://lore.kernel.org/r/20221110063452.295110-1-aichao@kylinos.cn Signed-off-by: Takashi Iwai commit 5bf06c4c51c5948ec69cc5610aff945d98813010 Merge: f0c4d9fc9cc94 675d84621a244 Author: Dave Airlie Date: Thu Nov 10 16:44:19 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-11-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-11-09: amdgpu: - SMU 13.0.4 update - GPUVM TLB race fix - DCN 3.1.4 fixes - DCN 3.2.x fixes - Vega10 fan fix - BACO fix for Beige Goby board - PSR fix - GPU VM PT locking fixes amdkfd: - CRIU fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221109234554.6028-1-alexander.deucher@amd.com commit 79e28f2ab3440e08f5fbf65648b008341c37b496 Author: Edson Juliano Drosdeck Date: Wed Nov 9 13:17:32 2022 -0400 ALSA: hda/realtek: Add Positivo C6300 model quirk Positivo Master C6300 (1849:a233) require quirk for anabling headset-mic Signed-off-by: Edson Juliano Drosdeck Cc: Link: https://lore.kernel.org/r/20221109171732.5417-1-edson.drosdeck@gmail.com Signed-off-by: Takashi Iwai commit c6092ea1e6d7bd12acd881f6aa2b5054cd70e096 Author: Zhengchao Shao Date: Wed Nov 9 09:21:00 2022 +0800 cxgb4vf: shut down the adapter when t4vf_update_port_info() failed in cxgb4vf_open() When t4vf_update_port_info() failed in cxgb4vf_open(), resources applied during adapter goes up are not cleared. Fix it. Only be compiled, not be tested. Fixes: 18d79f721e0a ("cxgb4vf: Update port information in cxgb4vf_open()") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109012100.99132-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit d4072058af4fd8fb4658e7452289042a406a9398 Author: Wei Yongjun Date: Tue Nov 8 09:55:17 2022 +0000 mctp: Fix an error handling path in mctp_init() If mctp_neigh_init() return error, the routes resources should be released in the error handling path. Otherwise some resources leak. Fixes: 4d8b9319282a ("mctp: Add neighbour implementation") Signed-off-by: Wei Yongjun Acked-by: Matt Johnston Link: https://lore.kernel.org/r/20221108095517.620115-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit dcea1a8107c04b9521dee1dd37971757a22db162 Author: Tan, Tee Min Date: Mon Nov 7 21:08:11 2022 -0500 stmmac: intel: Update PCH PTP clock rate from 200MHz to 204.8MHz Current Intel platform has an output of ~976ms interval when probed on 1 Pulse-per-Second(PPS) hardware pin. The correct PTP clock frequency for PCH GbE should be 204.8MHz instead of 200MHz. PSE GbE PTP clock rate remains at 200MHz. Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform") Signed-off-by: Ling Pei Lee Signed-off-by: Tan, Tee Min Signed-off-by: Voon Weifeng Signed-off-by: Gan Yi Fang Link: https://lore.kernel.org/r/20221108020811.12919-1-yi.fang.gan@intel.com Signed-off-by: Jakub Kicinski commit d75aed1428da787cbe42bc073d76f1354f364d92 Author: Zhengchao Shao Date: Wed Nov 9 10:14:51 2022 +0800 net: cxgb3_main: disable napi when bind qsets failed in cxgb_up() When failed to bind qsets in cxgb_up() for opening device, napi isn't disabled. When open cxgb3 device next time, it will trigger a BUG_ON() in napi_enable(). Compile tested only. Fixes: 48c4b6dbb7e2 ("cxgb3 - fix port up/down error path") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109021451.121490-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 6d47b53fb3f363a74538a1dbd09954af3d8d4131 Author: Zhengchao Shao Date: Wed Nov 9 09:15:37 2022 +0800 net: cpsw: disable napi in cpsw_ndo_open() When failed to create xdp rxqs or fill rx channels in cpsw_ndo_open() for opening device, napi isn't disabled. When open cpsw device next time, it will report a invalid opcode issue. Compiled tested only. Fixes: d354eb85d618 ("drivers: net: cpsw: dual_emac: simplify napi usage") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221109011537.96975-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 39bfcb8138f6dc3375f23b1e62ccfc7c0d83295d Author: Jingbo Xu Date: Fri Oct 21 10:31:53 2022 +0800 erofs: fix use-after-free of fsid and domain_id string When erofs instance is remounted with fsid or domain_id mount option specified, the original fsid and domain_id string pointer in sbi->opt is directly overridden with the fsid and domain_id string in the new fs_context, without freeing the original fsid and domain_id string. What's worse, when the new fsid and domain_id string is transferred to sbi, they are not reset to NULL in fs_context, and thus they are freed when remount finishes, while sbi is still referring to these strings. Reconfiguration for fsid and domain_id seems unusual. Thus clarify this restriction explicitly and dump a warning when users are attempting to do this. Besides, to fix the use-after-free issue, move fsid and domain_id from erofs_mount_opts to outside. Fixes: c6be2bd0a5dd ("erofs: register fscache volume") Fixes: 8b7adf1dff3d ("erofs: introduce fscache-based domain") Signed-off-by: Jingbo Xu Reviewed-by: Jia Zhu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221021023153.1330-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 675d84621a24490e1de3d59a4992a17fa9ff92b5 Author: Hamza Mahfooz Date: Wed Nov 9 12:06:27 2022 -0500 drm/amd/display: only fill dirty rectangles when PSR is enabled Currently, we are calling fill_dc_dirty_rects() even if PSR isn't supported by the relevant link in amdgpu_dm_commit_planes(), this is undesirable especially because when drm.debug is enabled we are printing messages in fill_dc_dirty_rects() that are only useful for debugging PSR (and confusing otherwise). So, we can instead limit the filling of dirty rectangles to only when PSR is enabled. Reviewed-by: Leo Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 0c85c067c9d9d7a1b2cc2e01a236d5d0d4a872b5 Author: Guchun Chen Date: Mon Nov 7 16:46:59 2022 +0800 drm/amdgpu: disable BACO on special BEIGE_GOBY card Still avoid intermittent failure. Signed-off-by: Guchun Chen Reviewed-by: Lijo Lazar Acked-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit e034a0d9aaee5c9129d5dfdfdfcab988a953412d Author: Philip Yang Date: Wed Nov 2 16:55:31 2022 -0400 drm/amdgpu: Drop eviction lock when allocating PT BO Re-take the eviction lock immediately again after the allocation is completed, to fix circular locking warning with drm_buddy allocator. Move amdgpu_vm_eviction_lock/unlock/trylock to amdgpu_vm.h as they are called from multiple files. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 64f65135c41a75f933d3bca236417ad8e9eb75de Author: Philip Yang Date: Thu Nov 3 10:24:52 2022 -0400 drm/amdgpu: Unlock bo_list_mutex after error handling Get below kernel WARNING backtrace when pressing ctrl-C to kill kfdtest application. If amdgpu_cs_parser_bos returns error after taking bo_list_mutex, as caller amdgpu_cs_ioctl will not unlock bo_list_mutex, this generates the kernel WARNING. Add unlock bo_list_mutex after amdgpu_cs_parser_bos error handling to cleanup bo_list userptr bo. WARNING: kfdtest/2930 still has locks held! 1 lock held by kfdtest/2930: (&list->bo_list_mutex){+.+.}-{3:3}, at: amdgpu_cs_ioctl+0xce5/0x1f10 [amdgpu] stack backtrace: dump_stack_lvl+0x44/0x57 get_signal+0x79f/0xd00 arch_do_signal_or_restart+0x36/0x7b0 exit_to_user_mode_prepare+0xfd/0x1b0 syscall_exit_to_user_mode+0x19/0x40 do_syscall_64+0x40/0x80 Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 30b8e7b8ee3be003e0df85c857c5cd0e0bd58b82 Author: Asher Song Date: Thu Nov 3 18:28:40 2022 +0800 Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"" This reverts commit 4545ae2ed3f2f7c3f615a53399c9c8460ee5bca7. The origin patch "drm/amdgpu: getting fan speed pwm for vega10 properly" works fine. Test failure is caused by test case self. Signed-off-by: Asher Song Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit ce902d987a8caa5c9a96080e280ecc992414a127 Author: Dillon Varone Date: Thu Oct 27 16:22:26 2022 -0400 drm/amd/display: Enforce minimum prefetch time for low memclk on DCN32 [WHY?] Data return times when using lowest memclk can be <= 60us, which can cause underflow on high bandwidth displays with a workload. [HOW?] Enforce a minimum prefetch time during validation for low memclk modes. Reviewed-by: Jun Lei Acked-by: Alan Liu Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c0b2753f5db281b07013899c79b5f06a614055f9 Author: Steve Su Date: Fri Oct 28 05:52:32 2022 +0800 drm/amd/display: Fix gpio port mapping issue [Why] 1. Port of gpio has different mapping. [How] 1. Add a dummy entry in mapping table. 2. Fix incorrect mask bit field access. Reviewed-by: Alvin Lee Acked-by: Alan Liu Signed-off-by: Steve Su Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ce62198d8b62734a985d22652e75a649be052390 Author: Nicholas Kazlauskas Date: Thu Oct 27 15:34:33 2022 -0400 drm/amd/display: Fix reg timeout in enc314_enable_fifo [Why] The link enablement sequence can end up resetting the encoder while the PHY symclk isn't yet on. This means that waiting for symclk on will timeout, along with the reset bit never asserting high. This causes unnecessary delay when enabling the link and produces a warning affecting multiple IGT tests. [How] Don't wait for the symclk to be on here because firmware already does. Don't wait for reset if we know the symclk isn't on. Split the reset into a helper function that checks the bit and decides whether or not a delay is sufficient. Reviewed-by: Roman Li Acked-by: Alan Liu Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 0d5c5c210a4d4e655feb93b379647f0b179cdafe Author: Chaitanya Dhere Date: Thu Oct 27 09:51:19 2022 -0400 drm/amd/display: Fix FCLK deviation and tool compile issues [Why] Recent backports from open source do not have header inclusion pattern that is consistent with inclusion style in the rest of the file. This breaks the internal tool builds as well. A recent commit erronously modified the original DML formula for calculating ActiveClockChangeLatencyHidingY. This resulted in a FCLK deviation from the golden values. [How] Change the way in which display_mode_vba.h is included so that it is consistent with the inclusion style in rest of the file which also fixes the tool build. Restore the DML formula to its original state to fix the FCLK deviation. Reviewed-by: Aurabindo Pillai Reviewed-by: Jun Lei Acked-by: Alan Liu Signed-off-by: Chaitanya Dhere Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ab4b35008db9b7ae747679250e5c26d7c3a90cea Author: Aurabindo Pillai Date: Thu Oct 20 17:26:24 2022 -0400 drm/amd/display: Zeromem mypipe heap struct before using it [Why&How] Bug was caused when moving variable from stack to heap because it was reusable and garbage was left over, so we need to zero mem. Reviewed-by: Martin Leung Acked-by: Alan Liu Signed-off-by: Aurabindo Pillai Signed-off-by: Martin Leung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 632d06985235d988c9d7e6eec8fa655be0761fd0 Author: Nicholas Kazlauskas Date: Tue Oct 25 11:26:04 2022 -0400 drm/amd/display: Update SR watermarks for DCN314 [Why & How] New values requested by hardware after fine-tuning. Update for all memory types. Reviewed-by: Jun Lei Acked-by: Alan Liu Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 77c092e054262b594614bad5e5f47e57c5d29639 Author: Christian König Date: Wed Nov 2 14:55:13 2022 +0100 drm/amdgpu: workaround for TLB seq race It can happen that we query the sequence value before the callback had a chance to run. Workaround that by grabbing the fence lock and releasing it again. Should be replaced by hw handling soon. Signed-off-by: Christian König CC: stable@vger.kernel.org # 5.19+ Fixes: 5255e146c99a6 ("drm/amdgpu: rework TLB flushing") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2113 Acked-by: Alex Deucher Acked-by: Philip Yang Tested-by: Stefan Springer Signed-off-by: Alex Deucher commit b91c23e099f0b65d62159da13458c5eefa76083f Author: Felix Kuehling Date: Tue Nov 1 15:02:48 2022 -0400 drm/amdkfd: Fix error handling in criu_checkpoint Checkpoint BOs last. That way we don't need to close dmabuf FDs if something else fails later. This avoids problematic access to user mode memory in the error handling code path. criu_checkpoint_bos has its own error handling and cleanup that does not depend on access to user memory. In the private data, keep BOs before the remaining objects. This is necessary to restore things in the correct order as restoring events depends on the events-page BO being restored first. Fixes: be072b06c739 ("drm/amdkfd: CRIU export BOs as prime dmabuf objects") Reported-by: Jann Horn CC: Rajneesh Bhardwaj Signed-off-by: Felix Kuehling Reviewed-and-tested-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 66f7903779fbbc620bf1040017e4833ef6a0b541 Author: Felix Kuehling Date: Thu Nov 3 17:01:46 2022 -0400 drm/amdkfd: Fix error handling in kfd_criu_restore_events mutex_unlock before the exit label because all the error code paths that jump there didn't take that lock. This fixes unbalanced locking errors in case of restore errors. Fixes: 40e8a766a761 ("drm/amdkfd: CRIU checkpoint and restore events") Signed-off-by: Felix Kuehling Reviewed-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit bc66c9ab162d2a633ee3eb864d7bc2369e79c1e4 Author: Tim Huang Date: Thu Nov 3 11:05:19 2022 +0800 drm/amd/pm: update SMU IP v13.0.4 msg interface header Some of the unused messages that were used earlier in development have been freed up as spare messages, no intended functional changes. Signed-off-by: Mario Limonciello Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 0e710a3ffd0caaf23b8791b041e8792f252f8e4f Author: Michal Jaron Date: Fri Oct 14 10:45:37 2022 +0200 iavf: Fix VF driver counting VLAN 0 filters VF driver mistakenly counts VLAN 0 filters, when no PF driver counts them. Do not count VLAN 0 filters, when VLAN_V2 is engaged. Counting those filters in, will affect filters size by -1, when sending batched VLAN addition message. Fixes: 968996c070ef ("iavf: Fix VLAN_V2 addition/rejection") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Michal Jaron Signed-off-by: Kamil Maziarz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit f23df5220d2bf8d5e639f074b76f206a736d09e1 Author: Norbert Zulinski Date: Mon Oct 10 10:22:22 2022 -0400 ice: Fix spurious interrupt during removal of trusted VF Previously, during removal of trusted VF when VF is down there was number of spurious interrupt equal to number of queues on VF. Add check if VF already has inactive queues. If VF is disabled and has inactive rx queues then do not disable rx queues. Add check in ice_vsi_stop_tx_ring if it's VF's vsi and if VF is disabled. Fixes: efe41860008e ("ice: Fix memory corruption in VF driver") Signed-off-by: Norbert Zulinski Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit f67dd6ce0723ad013395f20a3f79d8a437d3f455 Merge: f141df3713356 c18c20f162195 Author: Linus Torvalds Date: Wed Nov 9 13:07:50 2022 -0800 Merge tag 'slab-for-6.1-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab fixes from Vlastimil Babka: "Most are small fixups as described below. The !CONFIG_TRACING fix is a bit bigger and would normally be done in the next merge window as part of upcoming hardening changes. But we realized it can make the kmalloc waste tracking introduced in this window inaccurate, so decided to go with it now. Summary: - Remove !CONFIG_TRACING kmalloc() wrappers intended to save a function call, due to incompatilibity with recently introduced wasted space tracking and planned hardening changes. - A tracing parameter regression fix, by Kees Cook. - Two kernel-doc warning fixups, by Lukas Bulwahn and myself * tag 'slab-for-6.1-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm, slab: remove duplicate kernel-doc comment for ksize() mm/slab_common: Restore passing "caller" for tracing mm/slab: remove !CONFIG_TRACING variants of kmalloc_[node_]trace() mm/slab_common: repair kernel-doc for __ksize() commit 5704bc7e8991164b14efb748b5afa0715c25fac3 Author: Yang Jihong Date: Tue Nov 8 09:58:57 2022 +0800 selftests/bpf: Fix test_progs compilation failure in 32-bit arch test_progs fails to be compiled in the 32-bit arch, log is as follows: test_progs.c:1013:52: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] 1013 | sprintf(buf, "MSG_TEST_LOG (cnt: %ld, last: %d)", | ~~^ | | | long int | %d 1014 | strlen(msg->test_log.log_buf), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | size_t {aka unsigned int} Fix it. Fixes: 91b2c0afd00c ("selftests/bpf: Add parallelism to test_progs") Signed-off-by: Yang Jihong Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20221108015857.132457-1-yangjihong1@huawei.com Signed-off-by: Martin KaFai Lau commit 0811664da064c6d7ca64c02f5579f758a007e52d Author: Pu Lehui Date: Tue Nov 8 20:19:45 2022 +0800 selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms When cross-compiling test_verifier for 32-bit platforms, the casting error is shown below: test_verifier.c:1263:27: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 1263 | info.xlated_prog_insns = (__u64)*buf; | ^ cc1: all warnings being treated as errors Fix it by adding zero-extension for it. Fixes: 933ff53191eb ("selftests/bpf: specify expected instructions in test_verifier tests") Signed-off-by: Pu Lehui Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20221108121945.4104644-1-pulehui@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 3ca507bf99611c82dafced73e921c1b10ee12869 Author: Chancel Liu Date: Wed Nov 9 20:13:54 2022 +0800 ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate correct frequency of LRCLK and BCLK. Sometimes the read-only value can't be updated timely after enabling SYSCLK. This results in wrong calculation values. Delay is introduced here to wait for newest value from register. The time of the delay should be at least 500~1000us according to test. Signed-off-by: Chancel Liu Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221109121354.123958-1-chancel.liu@nxp.com Signed-off-by: Mark Brown commit 7f1a6d4b9e820b08479a07f6e14c36ccfa641751 Author: Roi Dayan Date: Wed Nov 2 23:55:47 2022 -0700 net/mlx5e: TC, Fix slab-out-of-bounds in parse_tc_actions esw_attr is only allocated if namespace is fdb. BUG: KASAN: slab-out-of-bounds in parse_tc_actions+0xdc6/0x10e0 [mlx5_core] Write of size 4 at addr ffff88815f185b04 by task tc/2135 CPU: 5 PID: 2135 Comm: tc Not tainted 6.1.0-rc2+ #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x7d print_report+0x170/0x471 ? parse_tc_actions+0xdc6/0x10e0 [mlx5_core] kasan_report+0xbc/0xf0 ? parse_tc_actions+0xdc6/0x10e0 [mlx5_core] parse_tc_actions+0xdc6/0x10e0 [mlx5_core] Fixes: 94d651739e17 ("net/mlx5e: TC, Fix cloned flow attr instance dests are not zeroed") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit f4f4096b410e8d31c3f07f39de3b17d144edd53d Author: Roi Dayan Date: Wed Nov 2 23:55:46 2022 -0700 net/mlx5e: E-Switch, Fix comparing termination table instance The pkt_reformat pointer being saved under flow_act and not dest attribute in the termination table instance. Fix the comparison pointers. Also fix returning success if one pkt_reformat pointer is null and the other is not. Fixes: 249ccc3c95bd ("net/mlx5e: Add support for offloading traffic from uplink to uplink") Signed-off-by: Roi Dayan Reviewed-by: Chris Mi Signed-off-by: Saeed Mahameed commit 9e06430841363a1d2932d546fdce1cc5edb3c2a0 Author: Jianbo Liu Date: Wed Nov 2 23:55:45 2022 -0700 net/mlx5e: TC, Fix wrong rejection of packet-per-second policing In the bellow commit, we added support for PPS policing without removing the check which block offload of such cases. Fix it by removing this check. Fixes: a8d52b024d6d ("net/mlx5e: TC, Support offloading police action") Signed-off-by: Jianbo Liu Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 08912ea799cd2a43b8999457e316967fe4e2f327 Author: Roi Dayan Date: Wed Nov 2 23:55:44 2022 -0700 net/mlx5e: Fix tc acts array not to be dependent on enum order The tc acts array should not be dependent on kernel internal flow action id enum. Fix the array initialization. Fixes: fad547906980 ("net/mlx5e: Add tc action infrastructure") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 8d4b475e9d0f100c3920d8bf7d392a6dac88583e Author: Maxim Mikityanskiy Date: Wed Nov 2 23:55:43 2022 -0700 net/mlx5e: Fix usage of DMA sync API DMA sync functions should use the same direction that was used by DMA mapping. Use DMA_BIDIRECTIONAL for XDP_TX from regular RQ, which reuses the same mapping that was used for RX, and DMA_TO_DEVICE for XDP_TX from XSK RQ and XDP_REDIRECT, which establish a new mapping in this direction. On the RX side, use the same direction that was used when setting up the mapping (DMA_BIDIRECTIONAL for XDP, DMA_FROM_DEVICE otherwise). Also don't skip sync for device when establishing a DMA_FROM_DEVICE mapping for RX, as some architectures (ARM) may require invalidating caches before the device can use the mapping. It doesn't break the bugfix made in commit 0b7cfa4082fb ("net/mlx5e: Fix page DMA map/unmap attributes"), since the bug happened on unmap. Fixes: 0b7cfa4082fb ("net/mlx5e: Fix page DMA map/unmap attributes") Fixes: b5503b994ed5 ("net/mlx5e: XDP TX forwarding support") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit f9c955b4fe5c8626d11b8a9b93ccc0ba77358fec Author: Maxim Mikityanskiy Date: Wed Nov 2 23:55:42 2022 -0700 net/mlx5e: Add missing sanity checks for max TX WQE size The commit cited below started using the firmware capability for the maximum TX WQE size. This commit adds an important check to verify that the driver doesn't attempt to exceed this capability, and also restores another check mistakenly removed in the cited commit (a WQE must not exceed the page size). Fixes: c27bd1718c06 ("net/mlx5e: Read max WQEBBs on the SQ from firmware") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 7d167b4a4c810919ba1affd02fc6b7f40e7e6eeb Author: Shay Drory Date: Wed Nov 2 23:55:40 2022 -0700 net/mlx5: fw_reset: Don't try to load device in case PCI isn't working In case PCI reads fail after unload, there is no use in trying to load the device. Fixes: 5ec697446f46 ("net/mlx5: Add support for devlink reload action fw activate") Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit e12de39c07a7872c1ac7250311bb60b74ff29f25 Author: Chris Mi Date: Wed Nov 2 23:55:39 2022 -0700 net/mlx5: E-switch, Set to legacy mode if failed to change switchdev mode No need to rollback to the other mode because probably will fail again. Just set to legacy mode and clear fdb table created flag. So that fdb table will not be cleared again. Fixes: f019679ea5f2 ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2808b37b59288ad8f1897e3546c2296df3384b65 Author: Roy Novich Date: Wed Nov 2 23:55:38 2022 -0700 net/mlx5: Allow async trigger completion execution on single CPU systems For a single CPU system, the kernel thread executing mlx5_cmd_flush() never releases the CPU but calls down_trylock(&cmd→sem) in a busy loop. On a single processor system, this leads to a deadlock as the kernel thread which executes mlx5_cmd_invoke() never gets scheduled. Fix this, by adding the cond_resched() call to the loop, allow the command completion kernel thread to execute. Fixes: 8e715cd613a1 ("net/mlx5: Set command entry semaphore up once got index free") Signed-off-by: Alexander Schmidt Signed-off-by: Roy Novich Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 15f8f168952f54d3c86d734dc764f20844e423ac Author: Vlad Buslov Date: Wed Nov 2 23:55:37 2022 -0700 net/mlx5: Bridge, verify LAG state when adding bond to bridge Mlx5 LAG is initialized asynchronously on a workqueue which means that for a brief moment after setting mlx5 UL representors as lower devices of a bond netdevice the LAG itself is not fully initialized in the driver. When adding such bond device to a bridge mlx5 bridge code will not consider it as offload-capable, skip creating necessary bookkeeping and fail any further bridge offload-related commands with it (setting VLANs, offloading FDBs, etc.). In order to make the error explicit during bridge initialization stage implement the code that detects such condition during NETDEV_PRECHANGEUPPER event and returns an error. Fixes: ff9b7521468b ("net/mlx5: Bridge, support LAG") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 7d945b046be3d2605dbb1806e73095aadd7ae129 Author: Olivier Moysan Date: Wed Nov 9 18:08:49 2022 +0100 ASoC: stm32: dfsdm: manage cb buffers cleanup Ensure that resources allocated by iio_channel_get_all_cb() are released on driver unbind. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20221109170849.273719-1-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 30d17fac6aaedb40d111bb159f4b35525637ea78 Author: Heiko Carstens Date: Mon Oct 31 13:34:56 2022 +0100 scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390 Before version 15.0.0 llvm's integrated assembler may silently generate corrupted code on s390. See e.g. commit e9953b729b78 ("s390/boot: workaround llvm IAS bug") for further details. While there have been workarounds applied for all known existing locations, there is nothing that prevents that new code with problematic patterns will be added. Therefore raise the minimum clang version to 15.0.0. Note that llvm commit e547b04d5b2c ("[SystemZ] Bugfix for symbolic displacements."), which is included in 15.0.0, fixes the broken code generation. Signed-off-by: Heiko Carstens Acked-by: Nathan Chancellor Link: https://lore.kernel.org/r/20221031123456.3872220-1-hca@linux.ibm.com Signed-off-by: Alexander Gordeev commit d72cf8ffe460824fdc97f0a9295a2c4e0231a562 Merge: 556f3c9ad7c10 b6662e3777271 Author: Paolo Bonzini Date: Wed Nov 9 12:28:15 2022 -0500 Merge tag 'kvm-s390-master-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD A PCI allocation fix and a PV clock fix. commit 556f3c9ad7c101aa16a43ef4539f3aabc1d7b32e Author: Like Xu Date: Mon Sep 19 17:10:08 2022 +0800 KVM: x86/pmu: Limit the maximum number of supported AMD GP counters The AMD PerfMonV2 specification allows for a maximum of 16 GP counters, but currently only 6 pairs of MSRs are accepted by KVM. While AMD64_NUM_COUNTERS_CORE is already equal to 6, increasing without adjusting msrs_to_save_all[] could result in out-of-bounds accesses. Therefore introduce a macro (named KVM_AMD_PMC_MAX_GENERIC) to refer to the number of counters supported by KVM. Signed-off-by: Like Xu Reviewed-by: Jim Mattson Message-Id: <20220919091008.60695-3-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 4f1fa2a1bbeb2feca436d2c86bf6f78dc4e5e4c4 Author: Like Xu Date: Mon Sep 19 17:10:07 2022 +0800 KVM: x86/pmu: Limit the maximum number of supported Intel GP counters The Intel Architectural IA32_PMCx MSRs addresses range allows for a maximum of 8 GP counters, and KVM cannot address any more. Introduce a local macro (named KVM_INTEL_PMC_MAX_GENERIC) and use it consistently to refer to the number of counters supported by KVM, thus avoiding possible out-of-bound accesses. Suggested-by: Jim Mattson Signed-off-by: Like Xu Reviewed-by: Jim Mattson Message-Id: <20220919091008.60695-2-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 8631ef59b62290c7d88e7209e35dfb47f33f4902 Author: Like Xu Date: Mon Sep 19 17:10:06 2022 +0800 KVM: x86/pmu: Do not speculatively query Intel GP PMCs that don't exist yet The SDM lists an architectural MSR IA32_CORE_CAPABILITIES (0xCF) that limits the theoretical maximum value of the Intel GP PMC MSRs allocated at 0xC1 to 14; likewise the Intel April 2022 SDM adds IA32_OVERCLOCKING_STATUS at 0x195 which limits the number of event selection MSRs to 15 (0x186-0x194). Limiting the maximum number of counters to 14 or 18 based on the currently allocated MSRs is clearly fragile, and it seems likely that Intel will even place PMCs 8-15 at a completely different range of MSR indices. So stop at the maximum number of GP PMCs supported today on Intel processors. There are some machines, like Intel P4 with non Architectural PMU, that may indeed have 18 counters, but those counters are in a completely different MSR address range and are not supported by KVM. Cc: Vitaly Kuznetsov Cc: stable@vger.kernel.org Fixes: cf05a67b68b8 ("KVM: x86: omit "impossible" pmu MSRs from MSR list") Suggested-by: Jim Mattson Signed-off-by: Like Xu Reviewed-by: Jim Mattson Message-Id: <20220919091008.60695-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 0bd8bd2f7a789fe1dcb21ad148199d2f62d79873 Author: Peter Gonda Date: Fri Nov 4 07:22:20 2022 -0700 KVM: SVM: Only dump VMSA to klog at KERN_DEBUG level Explicitly print the VMSA dump at KERN_DEBUG log level, KERN_CONT uses KERNEL_DEFAULT if the previous log line has a newline, i.e. if there's nothing to continuing, and as a result the VMSA gets dumped when it shouldn't. The KERN_CONT documentation says it defaults back to KERNL_DEFAULT if the previous log line has a newline. So switch from KERN_CONT to print_hex_dump_debug(). Jarkko pointed this out in reference to the original patch. See: https://lore.kernel.org/all/YuPMeWX4uuR1Tz3M@kernel.org/ print_hex_dump(KERN_DEBUG, ...) was pointed out there, but print_hex_dump_debug() should similar. Fixes: 6fac42f127b8 ("KVM: SVM: Dump Virtual Machine Save Area (VMSA) to klog") Signed-off-by: Peter Gonda Reviewed-by: Sean Christopherson Cc: Jarkko Sakkinen Cc: Harald Hoyer Cc: Paolo Bonzini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Message-Id: <20221104142220.469452-1-pgonda@google.com> Signed-off-by: Paolo Bonzini commit 2c1b54348a63096d4d4677743fba7a6d5fda9476 Author: Rong Tao Date: Mon Nov 7 22:52:49 2022 +0800 tools/kvm_stat: update exit reasons for vmx/svm/aarch64/userspace Update EXIT_REASONS from source, including VMX_EXIT_REASONS, SVM_EXIT_REASONS, AARCH64_EXIT_REASONS, USERSPACE_EXIT_REASONS. Signed-off-by: Rong Tao Message-Id: Signed-off-by: Paolo Bonzini commit 8e1071d0ad300fcce2e2b4e46cb15e41d0166bdc Author: Matthias Gerstner Date: Thu Nov 3 14:59:27 2022 +0100 tools/kvm_stat: fix incorrect detection of debugfs The first field in /proc/mounts can be influenced by unprivileged users through the widespread `fusermount` setuid-root program. Example: ``` user$ mkdir ~/mydebugfs user$ export _FUSE_COMMFD=0 user$ fusermount ~/mydebugfs -ononempty,fsname=debugfs user$ grep debugfs /proc/mounts debugfs /home/user/mydebugfs fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0 ``` If there is no debugfs already mounted in the system then this can be used by unprivileged users to trick kvm_stat into using a user controlled file system location for obtaining KVM statistics. Even though the root user is not allowed to access non-root FUSE mounts for security reasons, the unprivileged user can unmount the FUSE mount before kvm_stat uses the mounted path. If it wins the race, kvm_stat will read from the location where the FUSE mount resided. Note that the files in debugfs are only opened for reading, so the attacker can cause very large data to be read in by kvm_stat, or fake data to be processed, but there should be no viable way to turn this into a privilege escalation. The fix is simply to use the file system type field instead. Whitespace in the mount path is escaped in /proc/mounts thus no further safety measures in the parsing should be necessary to make this correct. Message-Id: <20221103135927.13656-1-matthias.gerstner@suse.de> Signed-off-by: Matthias Gerstner Signed-off-by: Paolo Bonzini commit bd3d394e367e66e773a6cb25a82c29b04464230b Author: Paolo Bonzini Date: Fri Sep 30 14:48:24 2022 -0400 x86, KVM: remove unnecessary argument to x86_virt_spec_ctrl and callers x86_virt_spec_ctrl only deals with the paravirtualized MSR_IA32_VIRT_SPEC_CTRL now and does not handle MSR_IA32_SPEC_CTRL anymore; remove the corresponding, unused argument. Signed-off-by: Paolo Bonzini commit 9f2febf3f04daebdaaa5a43cfa20e3844905c0f9 Author: Paolo Bonzini Date: Fri Sep 30 14:24:40 2022 -0400 KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly Restoration of the host IA32_SPEC_CTRL value is probably too late with respect to the return thunk training sequence. With respect to the user/kernel boundary, AMD says, "If software chooses to toggle STIBP (e.g., set STIBP on kernel entry, and clear it on kernel exit), software should set STIBP to 1 before executing the return thunk training sequence." I assume the same requirements apply to the guest/host boundary. The return thunk training sequence is in vmenter.S, quite close to the VM-exit. On hosts without V_SPEC_CTRL, however, the host's IA32_SPEC_CTRL value is not restored until much later. To avoid this, move the restoration of host SPEC_CTRL to assembly and, for consistency, move the restoration of the guest SPEC_CTRL as well. This is not particularly difficult, apart from some care to cover both 32- and 64-bit, and to share code between SEV-ES and normal vmentry. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Suggested-by: Jim Mattson Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e287bd005ad9d85dd6271dd795d3ecfb6bca46ad Author: Paolo Bonzini Date: Mon Nov 7 03:49:59 2022 -0500 KVM: SVM: restore host save area from assembly Allow access to the percpu area via the GS segment base, which is needed in order to access the saved host spec_ctrl value. In linux-next FILL_RETURN_BUFFER also needs to access percpu data. For simplicity, the physical address of the save area is added to struct svm_cpu_data. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reported-by: Nathan Chancellor Analyzed-by: Andrew Cooper Tested-by: Nathan Chancellor Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e61ab42de874c5af8c5d98b327c77a374d9e7da1 Author: Paolo Bonzini Date: Mon Nov 7 05:14:27 2022 -0500 KVM: SVM: move guest vmsave/vmload back to assembly It is error-prone that code after vmexit cannot access percpu data because GSBASE has not been restored yet. It forces MSR_IA32_SPEC_CTRL save/restore to happen very late, after the predictor untraining sequence, and it gets in the way of return stack depth tracking (a retbleed mitigation that is in linux-next as of 2022-11-09). As a first step towards fixing that, move the VMCB VMSAVE/VMLOAD to assembly, essentially undoing commit fb0c4a4fee5a ("KVM: SVM: move VMLOAD/VMSAVE to C code", 2021-03-15). The reason for that commit was that it made it simpler to use a different VMCB for VMLOAD/VMSAVE versus VMRUN; but that is not a big hassle anymore thanks to the kvm-asm-offsets machinery and other related cleanups. The idea on how to number the exception tables is stolen from a prototype patch by Peter Zijlstra. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Link: Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 73412dfeea724e6bd775ba64d21157ff322eac9a Author: Paolo Bonzini Date: Wed Nov 9 09:07:55 2022 -0500 KVM: SVM: do not allocate struct svm_cpu_data dynamically The svm_data percpu variable is a pointer, but it is allocated via svm_hardware_setup() when KVM is loaded. Unlike hardware_enable() this means that it is never NULL for the whole lifetime of KVM, and static allocation does not waste any memory compared to the status quo. It is also more efficient and more easily handled from assembly code, so do it and don't look back. Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 181d0fb0bb023e8996b1cf7970e3708d72442b0b Author: Paolo Bonzini Date: Wed Nov 9 08:54:20 2022 -0500 KVM: SVM: remove dead field from struct svm_cpu_data The "cpu" field of struct svm_cpu_data has been write-only since commit 4b656b120249 ("KVM: SVM: force new asid on vcpu migration", 2009-08-05). Remove it. Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 001459787158280d84fce1bc94cec49f34f48b9f Author: Paolo Bonzini Date: Wed Nov 9 04:54:40 2022 -0500 KVM: SVM: remove unused field from struct vcpu_svm The pointer to svm_cpu_data in struct vcpu_svm looks interesting from the point of view of accessing it after vmexit, when the GSBASE is still containing the guest value. However, despite existing since the very first commit of drivers/kvm/svm.c (commit 6aa8b732ca01, "[PATCH] kvm: userspace interface", 2006-12-10), it was never set to anything. Ignore the opportunity to fix a 16 year old "bug" and delete it; doing things the "harder" way makes it possible to remove more old cruft. Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit f6d58266d731fd7e63163790aad21e0dbb1d5264 Author: Paolo Bonzini Date: Mon Nov 7 04:17:29 2022 -0500 KVM: SVM: retrieve VMCB from assembly Continue moving accesses to struct vcpu_svm to vmenter.S. Reducing the number of arguments limits the chance of mistakes due to different registers used for argument passing in 32- and 64-bit ABIs; pushing the VMCB argument and almost immediately popping it into a different register looks pretty weird. 32-bit ABI is not a concern for __svm_sev_es_vcpu_run() which is 64-bit only; however, it will soon need @svm to save/restore SPEC_CTRL so stay consistent with __svm_vcpu_run() and let them share the same prototype. No functional change intended. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit f7ef280132f9bf6f82acf5aa5c3c837206eef501 Author: Paolo Bonzini Date: Fri Oct 28 17:30:07 2022 -0400 KVM: SVM: adjust register allocation for __svm_vcpu_run() 32-bit ABI uses RAX/RCX/RDX as its argument registers, so they are in the way of instructions that hardcode their operands such as RDMSR/WRMSR or VMLOAD/VMRUN/VMSAVE. In preparation for moving vmload/vmsave to __svm_vcpu_run(), keep the pointer to the struct vcpu_svm in %rdi. In particular, it is now possible to load svm->vmcb01.pa in %rax without clobbering the struct vcpu_svm pointer. No functional change intended. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 16fdc1de169ee0a4e59a8c02244414ec7acd55c3 Author: Paolo Bonzini Date: Fri Sep 30 14:14:44 2022 -0400 KVM: SVM: replace regs argument of __svm_vcpu_run() with vcpu_svm Since registers are reachable through vcpu_svm, and we will need to access more fields of that struct, pass it instead of the regs[] array. No functional change intended. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit debc5a1ec0d195ffea70d11efeffb713de9fdbc7 Author: Paolo Bonzini Date: Tue Nov 8 09:44:53 2022 +0100 KVM: x86: use a separate asm-offsets.c file This already removes an ugly #include "" from asm-offsets.c, but especially it avoids a future error when trying to define asm-offsets for KVM's svm/svm.h header. This would not work for kernel/asm-offsets.c, because svm/svm.h includes kvm_cache_regs.h which is not in the include path when compiling asm-offsets.c. The problem is not there if the .c file is in arch/x86/kvm. Suggested-by: Sean Christopherson Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 27c064ae14d1a80c790ce019759500c95a2a9551 Merge: 5d041588e9f6a 58bb78ce02269 Author: David S. Miller Date: Wed Nov 9 14:57:42 2022 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== The following patchset contains Netfilter fixes for net: 1) Fix deadlock in nfnetlink due to missing mutex release in error path, from Ziyang Xuan. 2) Clean up pending autoload module list from nf_tables_exit_net() path, from Shigeru Yoshida. 3) Fixes for the netfilter's reverse path selftest, from Phil Sutter. All of these bugs have been around for several releases. ==================== Signed-off-by: David S. Miller commit 3ce00bb7e91cf57d723905371507af57182c37ef Author: Carlos Llamas Date: Fri Nov 4 23:12:35 2022 +0000 binder: validate alloc->mm in ->mmap() handler Since commit 1da52815d5f1 ("binder: fix alloc->vma_vm_mm null-ptr dereference") binder caches a pointer to the current->mm during open(). This fixes a null-ptr dereference reported by syzkaller. Unfortunately, it also opens the door for a process to update its mm after the open(), (e.g. via execve) making the cached alloc->mm pointer invalid. Things get worse when the process continues to mmap() a vma. From this point forward, binder will attempt to find this vma using an obsolete alloc->mm reference. Such as in binder_update_page_range(), where the wrong vma is obtained via vma_lookup(), yet binder proceeds to happily insert new pages into it. To avoid this issue fail the ->mmap() callback if we detect a mismatch between the vma->vm_mm and the original alloc->mm pointer. This prevents alloc->vm_addr from getting set, so that any subsequent vma_lookup() calls fail as expected. Fixes: 1da52815d5f1 ("binder: fix alloc->vma_vm_mm null-ptr dereference") Reported-by: Jann Horn Cc: # 5.15+ Signed-off-by: Carlos Llamas Acked-by: Todd Kjos Link: https://lore.kernel.org/r/20221104231235.348958-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit ab126f51c93a15093df604f661c9480854c005a3 Author: Maciej W. Rozycki Date: Fri Sep 23 19:52:08 2022 +0100 parport_pc: Avoid FIFO port location truncation Match the data type of a temporary holding a reference to the FIFO port with the type of the original reference coming from `struct parport', avoiding data truncation with LP64 ports such as SPARC64 that refer to PCI port I/O locations via their corresponding MMIO addresses and will therefore have non-zero bits in the high 32-bit part of the reference. And in any case it is cleaner to have the data types matching here. Signed-off-by: Maciej W. Rozycki Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://lore.kernel.org/linux-pci/20220419033752.GA1101844@bhelgaas/ Acked-by: Sudip Mukherjee Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209231912550.29493@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 6e63153db50059fb78b8a8447b132664887d24e3 Author: Yang Yingliang Date: Fri Nov 4 10:13:34 2022 +0800 siox: fix possible memory leak in siox_device_add() If device_register() returns error in siox_device_add(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(), and sdevice is freed in siox_device_release(), set it to null in error path. Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX") Signed-off-by: Yang Yingliang Reviewed-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20221104021334.618189-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit e5b0d06d9b10f5f43101bd6598b076c347f9295f Author: Alexander Potapenko Date: Fri Nov 4 18:58:49 2022 +0100 misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() `struct vmci_event_qp` allocated by qp_notify_peer() contains padding, which may carry uninitialized data to the userspace, as observed by KMSAN: BUG: KMSAN: kernel-infoleak in instrument_copy_to_user ./include/linux/instrumented.h:121 instrument_copy_to_user ./include/linux/instrumented.h:121 _copy_to_user+0x5f/0xb0 lib/usercopy.c:33 copy_to_user ./include/linux/uaccess.h:169 vmci_host_do_receive_datagram drivers/misc/vmw_vmci/vmci_host.c:431 vmci_host_unlocked_ioctl+0x33d/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:925 vfs_ioctl fs/ioctl.c:51 ... Uninit was stored to memory at: kmemdup+0x74/0xb0 mm/util.c:131 dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:271 vmci_datagram_dispatch+0x4f8/0xfc0 drivers/misc/vmw_vmci/vmci_datagram.c:339 qp_notify_peer+0x19a/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1479 qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662 qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750 vmci_qp_broker_alloc+0x96/0xd0 drivers/misc/vmw_vmci/vmci_queue_pair.c:1940 vmci_host_do_alloc_queuepair drivers/misc/vmw_vmci/vmci_host.c:488 vmci_host_unlocked_ioctl+0x24fd/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:927 ... Local variable ev created at: qp_notify_peer+0x54/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1456 qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662 qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750 Bytes 28-31 of 48 are uninitialized Memory access of size 48 starts at ffff888035155e00 Data copied to user address 0000000020000100 Use memset() to prevent the infoleaks. Also speculatively fix qp_notify_peer_local(), which may suffer from the same problem. Reported-by: syzbot+39be4da489ed2493ba25@syzkaller.appspotmail.com Cc: stable Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Signed-off-by: Alexander Potapenko Reviewed-by: Vishnu Dasa Link: https://lore.kernel.org/r/20221104175849.2782567-1-glider@google.com Signed-off-by: Greg Kroah-Hartman commit a830a15678593948f3271a5a398c9b67d8beedb9 Author: Laurent Pinchart Date: Sun Oct 2 00:33:27 2022 +0300 drm: rcar-du: Fix Kconfig dependency between RCAR_DU and RCAR_MIPI_DSI When the R-Car MIPI DSI driver was added, it was a standalone encoder driver without any dependency to or from the R-Car DU driver. Commit 957fe62d7d15 ("drm: rcar-du: Fix DSI enable & disable sequence") then added a direct call from the DU driver to the MIPI DSI driver, without updating Kconfig to take the new dependency into account. Fix it the same way that the LVDS encoder is handled. Fixes: 957fe62d7d15 ("drm: rcar-du: Fix DSI enable & disable sequence") Reported-by: kernel test robot Reviewed-by: Tomi Valkeinen Signed-off-by: Laurent Pinchart commit 92ca969ff8815f3feef2645199bd39bf594e5eeb Author: Đoàn Trần Công Danh Date: Mon Oct 17 15:09:36 2022 +0700 speakup: replace utils' u_char with unsigned char drivers/accessibility/speakup/utils.h will be used to compile host tool to generate metadata. "u_char" is a non-standard type, which is defined to "unsigned char" on glibc but not defined by some libc, e.g. musl. Let's replace "u_char" with "unsigned char" Signed-off-by: Đoàn Trần Công Danh Reviewed-by: Samuel Thibault Cc: stable Link: https://lore.kernel.org/r/b75743026aaee2d81efe3d7f2e8fa47f7d0b8ea7.1665736571.git.congdanhqx@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0fc801f8018000c8e64a275a20cb1da7c54e46df Author: Mushahid Hussain Date: Mon Oct 10 21:57:20 2022 +0500 speakup: fix a segfault caused by switching consoles This patch fixes a segfault by adding a null check on synth in speakup_con_update(). The segfault can be reproduced as follows: - Login into a text console - Load speakup and speakup_soft modules - Remove speakup_soft - Switch to a graphics console This is caused by lack of a null check on `synth` in speakup_con_update(). Here's the sequence that causes the segfault: - When we remove the speakup_soft, synth_release() sets the synth to null. - After that, when we change the virtual console to graphics console, vt_notifier_call() is fired, which then calls speakup_con_update(). - Inside speakup_con_update() there's no null check on synth, so it calls synth_printf(). - Inside synth_printf(), synth_buffer_add() and synth_start(), both access synth, when it is null and causing a segfault. Therefore adding a null check on synth solves the issue. Fixes: 2610df41489f ("staging: speakup: Add pause command used on switching to graphical mode") Cc: stable Signed-off-by: Mushahid Hussain Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20221010165720.397042-1-mushi.shar@gmail.com Signed-off-by: Greg Kroah-Hartman commit f352262f727215553879705bacbcb208979f3eff Author: Robin Murphy Date: Tue Nov 8 17:06:19 2022 +0000 drm/panfrost: Split io-pgtable requests properly Although we don't use 1GB block mappings, we still need to split map/unmap requests at 1GB boundaries to match what io-pgtable expects. Fix that, and add some explanation to make sense of it all. Fixes: 3740b081795a ("drm/panfrost: Update io-pgtable API") Reported-by: Dmitry Osipenko Signed-off-by: Robin Murphy Tested-by: Dmitry Osipenko Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/49e54bb4019cd06e01549b106d7ac37c3d182cd3.1667927179.git.robin.murphy@arm.com commit 5d041588e9f6aa79e4abfc26d93c948f15d4d5eb Merge: 742c60e1285ca 980ec04a88c9f Author: David S. Miller Date: Wed Nov 9 14:00:25 2022 +0000 Merge branch 'wwan-iosm-fixes' M Chetan Kumar says: ==================== net: wwan: iosm: fixes This patch series contains iosm fixes. PATCH1: Fix memory leak in ipc_pcie_read_bios_cfg. PATCH2: Fix driver not working with INTEL_IOMMU disabled config. PATCH3: Fix invalid mux header type. PATCH4: Fix kernel build robot reported errors. Please refer to individual commit message for details. -- v2: * PATCH1: No Change * PATCH2: Kconfig change - Add dependency on PCI to resolve kernel build robot errors. * PATCH3: No Change * PATCH4: New (Fix kernel build robot errors) ==================== Signed-off-by: David S. Miller commit 980ec04a88c9f0046c1da65833fb77b2ffa34b04 Author: M Chetan Kumar Date: Mon Nov 7 13:05:24 2022 +0530 net: wwan: iosm: fix kernel test robot reported errors Include linux/vmalloc.h in iosm_ipc_coredump.c & iosm_ipc_devlink.c to resolve kernel test robot errors. Reported-by: kernel test robot Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 02d2d2ea4a3bc2391f6ac31f6854da83e8a63829 Author: M Chetan Kumar Date: Mon Nov 7 13:05:13 2022 +0530 net: wwan: iosm: fix invalid mux header type Data stall seen during peak DL throughput test & packets are dropped by mux layer due to invalid header type in datagram. During initlization Mux aggregration protocol is set to default UL/DL size and TD count of Mux lite protocol. This configuration mismatch between device and driver is resulting in data stall/packet drops. Override the UL/DL size and TD count for Mux aggregation protocol. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 035e3befc191347331dd2530c3686e05a8acfbb2 Author: M Chetan Kumar Date: Mon Nov 7 13:05:02 2022 +0530 net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled With INTEL_IOMMU disable config or by forcing intel_iommu=off from grub some of the features of IOSM driver like browsing, flashing & coredump collection is not working. When driver calls DMA API - dma_map_single() for tx transfers. It is resulting in dma mapping error. Set the device DMA addressing capabilities using dma_set_mask() and remove the INTEL_IOMMU dependency in kconfig so that driver follows the platform config either INTEL_IOMMU enable or disable. Fixes: f7af616c632e ("net: iosm: infrastructure") Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit d38a648d2d6cc7bee11c6f533ff9426a00c2a74c Author: M Chetan Kumar Date: Mon Nov 7 13:04:49 2022 +0530 net: wwan: iosm: fix memory leak in ipc_pcie_read_bios_cfg ipc_pcie_read_bios_cfg() is using the acpi_evaluate_dsm() to obtain the wwan power state configuration from BIOS but is not freeing the acpi_object. The acpi_evaluate_dsm() returned acpi_object to be freed. Free the acpi_object after use. Fixes: 7e98d785ae61 ("net: iosm: entry point") Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit 3ec17cb325ac731c2211e13f7eaa4b812694e218 Author: Akira Yokosawa Date: Wed Nov 2 20:48:01 2022 +0900 docs/driver-api/miscellaneous: Remove kernel-doc of serial_core.c Since merge of tty-6.0-rc1, "make htmldocs" with Sphinx >=3.1 emits a bunch of warnings indicating duplicate kernel-doc comments from drivers/tty/serial/serial_core.c. This is due to the kernel-doc directive for serial_core.c in serial/drivers.rst added in the merge. It conflicts with an existing kernel-doc directive in miscellaneous.rst. Remove the latter directive and resolve the duplicates. Signed-off-by: Akira Yokosawa Fixes: 607ca0f742b7 ("Merge tag 'tty-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") Cc: stable@vger.kernel.org # 6.0 Cc: Jiri Slaby Cc: Greg Kroah-Hartman Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/4e54c76a-138a-07e0-985a-dd83cb622208@gmail.com Signed-off-by: Greg Kroah-Hartman commit e65fdf530f55c5e387db14470a59a399faa29613 Author: Sagi Grimberg Date: Wed Nov 9 05:29:57 2022 +0200 nvmet: fix a memory leak We need to also free the dhchap_ctrl_secret when releasing nvmet_host. kmemleak complaint: -- unreferenced object 0xffff99b1cbca5140 (size 64): comm "check", pid 4864, jiffies 4305092436 (age 2913.583s) hex dump (first 32 bytes): 44 48 48 43 2d 31 3a 30 30 3a 65 36 2b 41 63 44 DHHC-1:00:e6+AcD 39 76 47 4d 52 57 59 78 67 54 47 44 51 59 47 78 9vGMRWYxgTGDQYGx backtrace: [<00000000c07d369d>] kstrdup+0x2e/0x60 [<000000001372171c>] 0xffffffffc0cceec6 [<0000000010dbf50b>] 0xffffffffc0cc6783 [<000000007465e93c>] configfs_write_iter+0xb1/0x120 [<0000000039c23f62>] vfs_write+0x2be/0x3c0 [<000000002da4351c>] ksys_write+0x5f/0xe0 [<00000000d5011e32>] do_syscall_64+0x38/0x90 [<00000000503870cf>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit becc4cac309dc867571f0080fde4426a6c2222e0 Author: Aleksandr Miloserdov Date: Wed Oct 26 12:31:33 2022 +0400 nvmet: fix memory leak in nvmet_subsys_attr_model_store_locked Since model_number is allocated before it needs to be freed before kmemdump_nul. Reviewed-by: Konstantin Shelekhin Reviewed-by: Dmitriy Bogdanov Signed-off-by: Aleksandr Miloserdov Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit d7ac8dca938cd60cf7bd9a89a229a173c6bcba87 Author: Keith Busch Date: Fri Oct 28 13:14:15 2022 -0700 nvme: quiet user passthrough command errors The driver is spamming the kernel logs for entirely harmless errors from user space submitting unsupported commands. Just silence the errors. The application has direct access to command status, so there's no need to log these. And since every passthrough command now uses the quiet flag, move the setting to the common initializer. Signed-off-by: Keith Busch Reviewed-by: Alan Adamson Reviewed-by: Jens Axboe Reviewed-by: Kanchan Joshi Reviewed-by: Chaitanya Kulkarni Reviewed-by: Daniel Wagner Tested-by: Alan Adamson Signed-off-by: Christoph Hellwig commit 181135bb20dcb184edd89817831b888eb8132741 Author: Nicolas Dumazet Date: Wed Nov 9 13:29:46 2022 +0100 usb: add NO_LPM quirk for Realforce 87U Keyboard Before adding this quirk, this (mechanical keyboard) device would not be recognized, logging: new full-speed USB device number 56 using xhci_hcd unable to read config index 0 descriptor/start: -32 chopping to 0 config(s) It would take dozens of plugging/unpuggling cycles for the keyboard to be recognized. Keyboard seems to simply work after applying this quirk. This issue had been reported by users in two places already ([1], [2]) but nobody tried upstreaming a patch yet. After testing I believe their suggested fix (DELAY_INIT + NO_LPM + DEVICE_QUALIFIER) was probably a little overkill. I assume this particular combination was tested because it had been previously suggested in [3], but only NO_LPM seems sufficient for this device. [1]: https://qiita.com/float168/items/fed43d540c8e2201b543 [2]: https://blog.kostic.dev/posts/making-the-realforce-87ub-work-with-usb30-on-Ubuntu/ [3]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1678477 Cc: stable@vger.kernel.org Signed-off-by: Nicolas Dumazet Link: https://lore.kernel.org/r/20221109122946.706036-1-ndumazet@google.com Signed-off-by: Greg Kroah-Hartman commit 1980860e0c8299316cddaf0992dd9e1258ec9d88 Author: Ilpo Järvinen Date: Tue Nov 8 14:19:52 2022 +0200 serial: 8250: Flush DMA Rx on RLSI Returning true from handle_rx_dma() without flushing DMA first creates a data ordering hazard. If DMA Rx has handled any character at the point when RLSI occurs, the non-DMA path handles any pending characters jumping them ahead of those characters that are pending under DMA. Fixes: 75df022b5f89 ("serial: 8250_dma: Fix RX handling") Cc: Signed-off-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221108121952.5497-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7090abd6ad0610a144523ce4ffcb8560909bf2a8 Author: Ilpo Järvinen Date: Tue Nov 8 14:19:51 2022 +0200 serial: 8250_lpss: Use 16B DMA burst with Elkhart Lake Configure DMA to use 16B burst size with Elkhart Lake. This makes the bus use more efficient and works around an issue which occurs with the previously used 1B. The fix was initially developed by Srikanth Thokala and Aman Kumar. This together with the previous config change is the cleaned up version of the original fix. Fixes: 0a9410b981e9 ("serial: 8250_lpss: Enable DMA on Intel Elkhart Lake") Cc: # serial: 8250_lpss: Configure DMA also w/o DMA filter Reported-by: Wentong Wu Signed-off-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221108121952.5497-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 1bfcbe5805d0cfc83c3544dcd01e0a282c1f6790 Author: Ilpo Järvinen Date: Tue Nov 8 14:19:50 2022 +0200 serial: 8250_lpss: Configure DMA also w/o DMA filter If the platform doesn't use DMA device filter (as is the case with Elkhart Lake), whole lpss8250_dma_setup() setup is skipped. This results in skipping also *_maxburst setup which is undesirable. Refactor lpss8250_dma_setup() to configure DMA even if filter is not setup. Cc: stable Signed-off-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221108121952.5497-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a931237cbea256aff13bb403da13a97b2d1605d9 Author: Ilpo Järvinen Date: Tue Nov 8 14:19:49 2022 +0200 serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs DW UART sometimes triggers IIR_RDI during DMA Rx when IIR_RX_TIMEOUT should have been triggered instead. Since IIR_RDI has higher priority than IIR_RX_TIMEOUT, this causes the Rx to hang into interrupt loop. The problem seems to occur at least with some combinations of small-sized transfers (I've reproduced the problem on Elkhart Lake PSE UARTs). If there's already an on-going Rx DMA and IIR_RDI triggers, fall graciously back to non-DMA Rx. That is, behave as if IIR_RX_TIMEOUT had occurred. 8250_omap already considers IIR_RDI similar to this change so its nothing unheard of. Fixes: 75df022b5f89 ("serial: 8250_dma: Fix RX handling") Cc: Co-developed-by: Srikanth Thokala Signed-off-by: Srikanth Thokala Co-developed-by: Aman Kumar Signed-off-by: Aman Kumar Signed-off-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221108121952.5497-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f002f45a00ee14214d96b18b9a555fe2c56afb20 Author: Haibo Chen Date: Tue Nov 8 15:45:03 2022 +0800 mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA MMC_CAP_8_BIT_DATA belongs to struct mmc_host, not struct sdhci_host. So correct it here. Fixes: 1ed5c3b22fc7 ("mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus") Signed-off-by: Haibo Chen Cc: stable@vger.kernel.org Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1667893503-20583-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit bdfe34597139cfcecd47a2eb97fea44d77157491 Author: Sandipan Das Date: Thu Sep 8 10:33:15 2022 +0530 perf/x86/amd/uncore: Fix memory leak for events array When a CPU comes online, the per-CPU NB and LLC uncore contexts are freed but not the events array within the context structure. This causes a memory leak as identified by the kmemleak detector. [...] unreferenced object 0xffff8c5944b8e320 (size 32): comm "swapper/0", pid 1, jiffies 4294670387 (age 151.072s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000000759fb79>] amd_uncore_cpu_up_prepare+0xaf/0x230 [<00000000ddc9e126>] cpuhp_invoke_callback+0x2cf/0x470 [<0000000093e727d4>] cpuhp_issue_call+0x14d/0x170 [<0000000045464d54>] __cpuhp_setup_state_cpuslocked+0x11e/0x330 [<0000000069f67cbd>] __cpuhp_setup_state+0x6b/0x110 [<0000000015365e0f>] amd_uncore_init+0x260/0x321 [<00000000089152d2>] do_one_initcall+0x3f/0x1f0 [<000000002d0bd18d>] kernel_init_freeable+0x1ca/0x212 [<0000000030be8dde>] kernel_init+0x11/0x120 [<0000000059709e59>] ret_from_fork+0x22/0x30 unreferenced object 0xffff8c5944b8dd40 (size 64): comm "swapper/0", pid 1, jiffies 4294670387 (age 151.072s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000306efe8b>] amd_uncore_cpu_up_prepare+0x183/0x230 [<00000000ddc9e126>] cpuhp_invoke_callback+0x2cf/0x470 [<0000000093e727d4>] cpuhp_issue_call+0x14d/0x170 [<0000000045464d54>] __cpuhp_setup_state_cpuslocked+0x11e/0x330 [<0000000069f67cbd>] __cpuhp_setup_state+0x6b/0x110 [<0000000015365e0f>] amd_uncore_init+0x260/0x321 [<00000000089152d2>] do_one_initcall+0x3f/0x1f0 [<000000002d0bd18d>] kernel_init_freeable+0x1ca/0x212 [<0000000030be8dde>] kernel_init+0x11/0x120 [<0000000059709e59>] ret_from_fork+0x22/0x30 [...] Fix the problem by freeing the events array before freeing the uncore context. Fixes: 39621c5808f5 ("perf/x86/amd/uncore: Use dynamic events array") Reported-by: Ravi Bangoria Signed-off-by: Sandipan Das Signed-off-by: Borislav Petkov Tested-by: Ravi Bangoria Cc: Link: https://lore.kernel.org/r/4fa9e5ac6d6e41fa889101e7af7e6ba372cfea52.1662613255.git.sandipan.das@amd.com commit 9d5333c931347005352d5b8beaa43528c94cfc9c Author: Li Jun Date: Wed Oct 26 15:07:49 2022 -0400 usb: cdns3: host: fix endless superspeed hub port reset When usb 3.0 hub connect with one USB 2.0 device and NO USB 3.0 device, some usb hub reports endless port reset message. [ 190.324169] usb 2-1: new SuperSpeed USB device number 88 using xhci-hcd [ 190.352834] hub 2-1:1.0: USB hub found [ 190.356995] hub 2-1:1.0: 4 ports detected [ 190.700056] usb 2-1: USB disconnect, device number 88 [ 192.472139] usb 2-1: new SuperSpeed USB device number 89 using xhci-hcd [ 192.500820] hub 2-1:1.0: USB hub found [ 192.504977] hub 2-1:1.0: 4 ports detected [ 192.852066] usb 2-1: USB disconnect, device number 89 The reason is the runtime pm state of USB2.0 port is active and USB 3.0 port is suspend, so parent device is active state. cat /sys/bus/platform/devices/5b110000.usb/5b130000.usb/xhci-hcd.1.auto/usb2/power/runtime_status suspended cat /sys/bus/platform/devices/5b110000.usb/5b130000.usb/xhci-hcd.1.auto/usb1/power/runtime_status active cat /sys/bus/platform/devices/5b110000.usb/5b130000.usb/xhci-hcd.1.auto/power/runtime_status active cat /sys/bus/platform/devices/5b110000.usb/5b130000.usb/power/runtime_status active So xhci_cdns3_suspend_quirk() have not called. U3 configure is not applied. move U3 configure into host start. Reinit again in resume function in case controller power lost during suspend. Cc: stable@vger.kernel.org 5.10 Signed-off-by: Li Jun Signed-off-by: Frank Li Reviewed-by: Peter Chen Acked-by: Alexander Stein Link: https://lore.kernel.org/r/20221026190749.2280367-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 7a58b8d6021426b796eebfae80983374d9a80a75 Author: Duoming Zhou Date: Sun Sep 18 11:33:12 2022 +0800 usb: chipidea: fix deadlock in ci_otg_del_timer There is a deadlock in ci_otg_del_timer(), the process is shown below: (thread 1) | (thread 2) ci_otg_del_timer() | ci_otg_hrtimer_func() ... | spin_lock_irqsave() //(1) | ... ... | hrtimer_cancel() | spin_lock_irqsave() //(2) (block forever) We hold ci->lock in position (1) and use hrtimer_cancel() to wait ci_otg_hrtimer_func() to stop, but ci_otg_hrtimer_func() also need ci->lock in position (2). As a result, the hrtimer_cancel() in ci_otg_del_timer() will be blocked forever. This patch extracts hrtimer_cancel() from the protection of spin_lock_irqsave() in order that the ci_otg_hrtimer_func() could obtain the ci->lock. What`s more, there will be no race happen. Because the "next_timer" is always under the protection of spin_lock_irqsave() and we only check whether "next_timer" equals to NUM_OTG_FSM_TIMERS in the following code. Fixes: 3a316ec4c91c ("usb: chipidea: use hrtimer for otg fsm timers") Cc: stable Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220918033312.94348-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit c8af247de385ce49afabc3bf1cf4fd455c94bfe8 Author: ZhangPeng Date: Wed Nov 9 01:35:42 2022 +0000 udf: Fix a slab-out-of-bounds write bug in udf_find_entry() Syzbot reported a slab-out-of-bounds Write bug: loop0: detected capacity change from 0 to 2048 ================================================================== BUG: KASAN: slab-out-of-bounds in udf_find_entry+0x8a5/0x14f0 fs/udf/namei.c:253 Write of size 105 at addr ffff8880123ff896 by task syz-executor323/3610 CPU: 0 PID: 3610 Comm: syz-executor323 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 kasan_check_range+0x2a7/0x2e0 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 udf_find_entry+0x8a5/0x14f0 fs/udf/namei.c:253 udf_lookup+0xef/0x340 fs/udf/namei.c:309 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1396 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ffab0d164d9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe1a7e6bb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ffab0d164d9 RDX: 00007ffab0d164d9 RSI: 0000000000000000 RDI: 0000000020000180 RBP: 00007ffab0cd5a10 R08: 0000000000000000 R09: 0000000000000000 R10: 00005555573552c0 R11: 0000000000000246 R12: 00007ffab0cd5aa0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3610: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:576 [inline] udf_find_entry+0x7b6/0x14f0 fs/udf/namei.c:243 udf_lookup+0xef/0x340 fs/udf/namei.c:309 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1396 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880123ff800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 150 bytes inside of 256-byte region [ffff8880123ff800, ffff8880123ff900) The buggy address belongs to the physical page: page:ffffea000048ff80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x123fe head:ffffea000048ff80 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00004b8500 dead000000000003 ffff888012041b40 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x0(), pid 1, tgid 1 (swapper/0), ts 1841222404, free_ts 0 create_dummy_stack mm/page_owner.c:67 [inline] register_early_stack+0x77/0xd0 mm/page_owner.c:83 init_page_owner+0x3a/0x731 mm/page_owner.c:93 kernel_init_freeable+0x41c/0x5d5 init/main.c:1629 kernel_init+0x19/0x2b0 init/main.c:1519 page_owner free stack trace missing Memory state around the buggy address: ffff8880123ff780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880123ff800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880123ff880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 ^ ffff8880123ff900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880123ff980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Fix this by changing the memory size allocated for copy_name from UDF_NAME_LEN(254) to UDF_NAME_LEN_CS0(255), because the total length (lfi) of subsequent memcpy can be up to 255. CC: stable@vger.kernel.org Reported-by: syzbot+69c9fdccc6dd08961d34@syzkaller.appspotmail.com Fixes: 066b9cded00b ("udf: Use separate buffer for copying split names") Signed-off-by: ZhangPeng Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20221109013542.442790-1-zhangpeng362@huawei.com commit acfc35cfcee5df419391671ef1a631f43feee4e3 Author: Kuniyuki Iwashima Date: Mon Oct 31 14:57:28 2022 -0700 arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Add the same change for ARM64 as done in the commit 9440c4294160 ("x86/syscall: Include asm/ptrace.h in syscall_wrapper header") to make sure all syscalls see 'struct pt_regs' definition and resulted BTF for '__arm64_sys_*(struct pt_regs *regs)' functions point to actual struct. Without this patch, the BPF verifier refuses to load a tracing prog which accesses pt_regs. bpf(BPF_PROG_LOAD, {prog_type=0x1a, ...}, 128) = -1 EACCES With this patch, we can see the correct error, which saves us time in debugging the prog. bpf(BPF_PROG_LOAD, {prog_type=0x1a, ...}, 128) = 4 bpf(BPF_RAW_TRACEPOINT_OPEN, {raw_tracepoint={name=NULL, prog_fd=4}}, 128) = -1 ENOTSUPP Signed-off-by: Kuniyuki Iwashima Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20221031215728.50389-1-kuniyu@amazon.com Signed-off-by: Catalin Marinas commit 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 Author: D Scott Phillips Date: Wed Nov 2 09:01:06 2022 -0700 arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is undefined behavior. Well, sort of, it actually spells the error as: arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected': arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant (((imp) << MIDR_IMPLEMENTOR_SHIFT) | \ ^ This isn't an issue for other Implementor codes, as all the other codes have zero in the top bit and so are representable as a signed int. Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the undefined behavior. Fixes: 0e5d5ae837c8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list") Reported-by: Geert Uytterhoeven Signed-off-by: D Scott Phillips Link: https://lore.kernel.org/r/20221102160106.1096948-1-scott@os.amperecomputing.com Signed-off-by: Catalin Marinas commit 58bb78ce02269c0cf5b1f2bd2e4a605500b44c6b Author: Phil Sutter Date: Wed Nov 9 10:06:04 2022 +0100 selftests: netfilter: Fix and review rpath.sh Address a few problems with the initial test script version: * On systems with ip6tables but no ip6tables-legacy, testing for ip6tables was disabled by accident. * Firewall setup phase did not respect possibly unavailable tools. * Consistently call nft via '$nft'. Fixes: 6e31ce831c63b ("selftests: netfilter: Test reverse path filtering") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit fed74d75277da865da9ba334d3f5d5e3e327971d Author: AngeloGioacchino Del Regno Date: Fri Nov 4 11:56:05 2022 +0100 pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE In pinctrl-paris we're calling the .bias_set_combo() callback when we are asked to set the pin bias to either pull up/down or pull disable. On newer platforms, this callback is mtk_pinconf_bias_set_combo(), located in pinctrl-mtk-common-v2.c: this will check the "pull type" assigned to the requested pin and in case said pin's pull type is MTK_PULL_PU_PD_RSEL_TYPE, this function will set RSEL first, PUPD last, which is fine. The issue comes when we're requesting PIN_CONFIG_BIAS_DISABLE, as this does *not* require setting RSEL but only PU_PD: in this case, the arg is MTK_DISABLE (zero), which is not a supported RSEL, due to which function mtk_pinconf_bias_set_rsel() returns a failure; because of that, mtk_pinconf_bias_set_pu_pd() is never called, hence the pin bias is never set to DISABLE. To fix this issue, add a check to mtk_pinconf_bias_set_rsel(): if we are entering that function with no pullup requested and at the same time the arg is MTK_DISABLE, this means that we're trying to disable pin bias, hence it's safe to return cleanly without ever setting any RSEL register. This makes mtk_pinconf_bias_set_combo() happy, going on with setting the PU_PD registers, which is the only action to actually take to disable bias on a pin/pingroup. Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221104105605.33720-1-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij commit 8950f345a67d8046d2472dd6ea81fa18ef5b4844 Author: Dominik Haller Date: Tue Oct 11 16:31:15 2022 +0200 ARM: dts: am335x-pcm-953: Define fixed regulators in root node Remove the regulators node and define fixed regulators in the root node. Prevents the sdhci-omap driver from waiting in probe deferral forever because of the missing vmmc-supply and keeps am335x-pcm-953 consistent with the other Phytec AM335 boards. Fixes: bb07a829ec38 ("ARM: dts: Add support for phyCORE-AM335x PCM-953 carrier board") Signed-off-by: Dominik Haller Message-Id: <20221011143115.248003-1-d.haller@phytec.de> Signed-off-by: Tony Lindgren commit 8cbd4725ffff3eface1f5f3397af02acad5b2831 Author: Jussi Laako Date: Wed Nov 9 00:12:41 2022 +0200 ALSA: usb-audio: Add DSD support for Accuphase DAC-60 Accuphase DAC-60 option card supports native DSD up to DSD256, but doesn't have support for auto-detection. Explicitly enable DSD support for the correct altsetting. Signed-off-by: Jussi Laako Cc: Link: https://lore.kernel.org/r/20221108221241.1220878-1-jussi@sonarnerd.net Signed-off-by: Takashi Iwai commit 742c60e1285ca40642e988f7e3db92232171b27d Author: Nick Child Date: Mon Nov 7 14:32:15 2022 -0600 ibmveth: Reduce default tx queues to 8 Previously, the default number of transmit queues was 16. Due to resource concerns, set to 8 queues instead. Still allow the user to set more queues (max 16) if they like. Since the driver is virtualized away from the physical NIC, the purpose of multiple queues is purely to allow for parallel calls to the hypervisor. Therefore, there is no noticeable effect on performance by reducing queue count to 8. Fixes: d926793c1de9 ("ibmveth: Implement multi queue on xmit") Reported-by: Dave Taht Signed-off-by: Nick Child Link: https://lore.kernel.org/r/20221107203215.58206-1-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit b06334919c7a068d54ba5b219c05e919d89943f7 Author: Zhengchao Shao Date: Mon Nov 7 18:14:43 2022 +0800 net: nixge: disable napi when enable interrupts failed in nixge_open() When failed to enable interrupts in nixge_open() for opening device, napi isn't disabled. When open nixge device next time, it will reports a invalid opcode issue. Fix it. Only be compiled, not be tested. Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221107101443.120205-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 07d120aa33cc9d9115753d159f64d20c94458781 Author: Eric Dumazet Date: Mon Nov 7 18:00:11 2022 +0000 net: tun: call napi_schedule_prep() to ensure we own a napi A recent patch exposed another issue in napi_get_frags() caught by syzbot [1] Before feeding packets to GRO, and calling napi_complete() we must first grab NAPI_STATE_SCHED. [1] WARNING: CPU: 0 PID: 3612 at net/core/dev.c:6076 napi_complete_done+0x45b/0x880 net/core/dev.c:6076 Modules linked in: CPU: 0 PID: 3612 Comm: syz-executor408 Not tainted 6.1.0-rc3-syzkaller-00175-g1118b2049d77 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 RIP: 0010:napi_complete_done+0x45b/0x880 net/core/dev.c:6076 Code: c1 ea 03 0f b6 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 24 04 00 00 41 89 5d 1c e9 73 fc ff ff e8 b5 53 22 fa <0f> 0b e9 82 fe ff ff e8 a9 53 22 fa 48 8b 5c 24 08 31 ff 48 89 de RSP: 0018:ffffc90003c4f920 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000000 RDX: ffff8880251c0000 RSI: ffffffff875a58db RDI: 0000000000000007 RBP: 0000000000000001 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: ffff888072d02628 R13: ffff888072d02618 R14: ffff888072d02634 R15: 0000000000000000 FS: 0000555555f13300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055c44d3892b8 CR3: 00000000172d2000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: napi_complete include/linux/netdevice.h:510 [inline] tun_get_user+0x206d/0x3a60 drivers/net/tun.c:1980 tun_chr_write_iter+0xdb/0x200 drivers/net/tun.c:2027 call_write_iter include/linux/fs.h:2191 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_writev+0x1aa/0x630 fs/read_write.c:934 do_writev+0x133/0x2f0 fs/read_write.c:977 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f37021a3c19 Fixes: 1118b2049d77 ("net: tun: Fix memory leaks of napi_get_frags") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Wang Yufen Link: https://lore.kernel.org/r/20221107180011.188437-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 519b58bbfa825f042fcf80261cc18e1e35f85ffd Author: Zhengchao Shao Date: Tue Nov 8 10:56:07 2022 +0800 net: marvell: prestera: fix memory leak in prestera_rxtx_switch_init() When prestera_sdma_switch_init() failed, the memory pointed to by sw->rxtx isn't released. Fix it. Only be compiled, not be tested. Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices") Signed-off-by: Zhengchao Shao Reviewed-by: Vadym Kochan Link: https://lore.kernel.org/r/20221108025607.338450-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 436fa4a699bcd1c368bea9199e22b0a1b9cf9e0f Author: Alexander Potapenko Date: Mon Nov 7 15:22:55 2022 +0100 docs: kmsan: fix formatting of "Example report" Add a blank line to make the sentence before the list render as a separate paragraph, not a definition. Link: https://lkml.kernel.org/r/20221107142255.4038811-1-glider@google.com Fixes: 93858ae70cf4 ("kmsan: add ReST documentation") Signed-off-by: Alexander Potapenko Suggested-by: Bagas Sanjaya Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 1de09a7281edecfdba19b3a07417f6d65243ab5f Author: SeongJae Park Date: Mon Nov 7 16:50:00 2022 +0000 mm/damon/dbgfs: check if rm_contexts input is for a real context A user could write a name of a file under 'damon/' debugfs directory, which is not a user-created context, to 'rm_contexts' file. In the case, 'dbgfs_rm_context()' just assumes it's the valid DAMON context directory only if a file of the name exist. As a result, invalid memory access could happen as below. Fix the bug by checking if the given input is for a directory. This check can filter out non-context inputs because directories under 'damon/' debugfs directory can be created via only 'mk_contexts' file. This bug has found by syzbot[1]. [1] https://lore.kernel.org/damon/000000000000ede3ac05ec4abf8e@google.com/ Link: https://lkml.kernel.org/r/20221107165001.5717-2-sj@kernel.org Fixes: 75c1c2b53c78 ("mm/damon/dbgfs: support multiple contexts") Signed-off-by: SeongJae Park Reported-by: syzbot+6087eafb76a94c4ac9eb@syzkaller.appspotmail.com Cc: [5.15.x] Signed-off-by: Andrew Morton commit 7dc5ba6254bb242a9f45e43549171a2d84d25e6a Author: Liam Howlett Date: Mon Nov 7 16:39:02 2022 +0000 maple_tree: don't set a new maximum on the node when not reusing nodes In RCU mode, the node limits were being updated to the last pivot which may not be correct and would cause the metadata to be set when it shouldn't. Fix this by not setting a new limit in this case. Link: https://lkml.kernel.org/r/20221107163857.867377-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 9bbba5633488ee3e2903647c3484c4390ff39ea7 Author: Liam Howlett Date: Mon Nov 7 16:38:35 2022 +0000 maple_tree: fix depth tracking in maple_state It is possible to confuse the depth tracking in the maple state by searching the same node for values. Fix the depth tracking by moving where the depth is incremented closer to where the node changes level. Also change the initial depth setting when using the root node. Link: https://lkml.kernel.org/r/20221107163814.866612-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 1fdbed657a4726639c4f17841fd2a0fb646c746e Author: Naoya Horiguchi Date: Mon Nov 7 11:10:10 2022 +0900 arch/x86/mm/hugetlbpage.c: pud_huge() returns 0 when using 2-level paging The following bug is reported to be triggered when starting X on x86-32 system with i915: [ 225.777375] kernel BUG at mm/memory.c:2664! [ 225.777391] invalid opcode: 0000 [#1] PREEMPT SMP [ 225.777405] CPU: 0 PID: 2402 Comm: Xorg Not tainted 6.1.0-rc3-bdg+ #86 [ 225.777415] Hardware name: /8I865G775-G, BIOS F1 08/29/2006 [ 225.777421] EIP: __apply_to_page_range+0x24d/0x31c [ 225.777437] Code: ff ff 8b 55 e8 8b 45 cc e8 0a 11 ec ff 89 d8 83 c4 28 5b 5e 5f 5d c3 81 7d e0 a0 ef 96 c1 74 ad 8b 45 d0 e8 2d 83 49 00 eb a3 <0f> 0b 25 00 f0 ff ff 81 eb 00 00 00 40 01 c3 8b 45 ec 8b 00 e8 76 [ 225.777446] EAX: 00000001 EBX: c53a3b58 ECX: b5c00000 EDX: c258aa00 [ 225.777454] ESI: b5c00000 EDI: b5900000 EBP: c4b0fdb4 ESP: c4b0fd80 [ 225.777462] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010202 [ 225.777470] CR0: 80050033 CR2: b5900000 CR3: 053a3000 CR4: 000006d0 [ 225.777479] Call Trace: [ 225.777486] ? i915_memcpy_init_early+0x63/0x63 [i915] [ 225.777684] apply_to_page_range+0x21/0x27 [ 225.777694] ? i915_memcpy_init_early+0x63/0x63 [i915] [ 225.777870] remap_io_mapping+0x49/0x75 [i915] [ 225.778046] ? i915_memcpy_init_early+0x63/0x63 [i915] [ 225.778220] ? mutex_unlock+0xb/0xd [ 225.778231] ? i915_vma_pin_fence+0x6d/0xf7 [i915] [ 225.778420] vm_fault_gtt+0x2a9/0x8f1 [i915] [ 225.778644] ? lock_is_held_type+0x56/0xe7 [ 225.778655] ? lock_is_held_type+0x7a/0xe7 [ 225.778663] ? 0xc1000000 [ 225.778670] __do_fault+0x21/0x6a [ 225.778679] handle_mm_fault+0x708/0xb21 [ 225.778686] ? mt_find+0x21e/0x5ae [ 225.778696] exc_page_fault+0x185/0x705 [ 225.778704] ? doublefault_shim+0x127/0x127 [ 225.778715] handle_exception+0x130/0x130 [ 225.778723] EIP: 0xb700468a Recently pud_huge() got aware of non-present entry by commit 3a194f3f8ad0 ("mm/hugetlb: make pud_huge() and follow_huge_pud() aware of non-present pud entry") to handle some special states of gigantic page. However, it's overlooked that pud_none() always returns false when running with 2-level paging, and as a result pud_huge() can return true pointlessly. Introduce "#if CONFIG_PGTABLE_LEVELS > 2" to pud_huge() to deal with this. Link: https://lkml.kernel.org/r/20221107021010.2449306-1-naoya.horiguchi@linux.dev Fixes: 3a194f3f8ad0 ("mm/hugetlb: make pud_huge() and follow_huge_pud() aware of non-present pud entry") Signed-off-by: Naoya Horiguchi Reported-by: Ville Syrjälä Tested-by: Ville Syrjälä Reviewed-by: Miaohe Lin Cc: David Hildenbrand Cc: Liu Shixin Cc: Mike Kravetz Cc: Muchun Song Cc: Oscar Salvador Cc: Yang Shi Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Signed-off-by: Andrew Morton commit 82e60d00b753bb5cfecce22b8e952436b14d02a3 Author: Johannes Weiner Date: Thu Nov 3 17:34:31 2022 -0400 fs: fix leaked psi pressure state When psi annotations were added to to btrfs compression reads, the psi state tracking over add_ra_bio_pages and btrfs_submit_compressed_read was faulty. A pressure state, once entered, is never left. This results in incorrectly elevated pressure, which triggers OOM kills. pflags record the *previous* memstall state when we enter a new one. The code tried to initialize pflags to 1, and then optimize the leave call when we either didn't enter a memstall, or were already inside a nested stall. However, there can be multiple PageWorkingset pages in the bio, at which point it's that path itself that enters repeatedly and overwrites pflags. This causes us to miss the exit. Enter the stall only once if needed, then unwind correctly. erofs has the same problem, fix that up too. And move the memstall exit past submit_bio() to restore submit accounting originally added by b8e24a9300b0 ("block: annotate refault stalls from IO submission"). Link: https://lkml.kernel.org/r/Y2UHRqthNUwuIQGS@cmpxchg.org Fixes: 4088a47e78f9 ("btrfs: add manual PSI accounting for compressed reads") Fixes: 99486c511f68 ("erofs: add manual PSI accounting for the compressed address space") Fixes: 118f3663fbc6 ("block: remove PSI accounting from the bio layer") Link: https://lore.kernel.org/r/d20a0a85-e415-cf78-27f9-77dd7a94bc8d@leemhuis.info/ Signed-off-by: Johannes Weiner Reported-by: Thorsten Leemhuis Tested-by: Thorsten Leemhuis Cc: Chao Yu Cc: Chris Mason Cc: Christoph Hellwig Cc: David Sterba Cc: Gao Xiang Cc: Jens Axboe Cc: Josef Bacik Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 8cccf05fe857a18ee26e20d11a8455a73ffd4efd Author: Ryusuke Konishi Date: Fri Nov 4 23:29:59 2022 +0900 nilfs2: fix use-after-free bug of ns_writer on remount If a nilfs2 filesystem is downgraded to read-only due to metadata corruption on disk and is remounted read/write, or if emergency read-only remount is performed, detaching a log writer and synchronizing the filesystem can be done at the same time. In these cases, use-after-free of the log writer (hereinafter nilfs->ns_writer) can happen as shown in the scenario below: Task1 Task2 -------------------------------- ------------------------------ nilfs_construct_segment nilfs_segctor_sync init_wait init_waitqueue_entry add_wait_queue schedule nilfs_remount (R/W remount case) nilfs_attach_log_writer nilfs_detach_log_writer nilfs_segctor_destroy kfree finish_wait _raw_spin_lock_irqsave __raw_spin_lock_irqsave do_raw_spin_lock debug_spin_lock_before <-- use-after-free While Task1 is sleeping, nilfs->ns_writer is freed by Task2. After Task1 waked up, Task1 accesses nilfs->ns_writer which is already freed. This scenario diagram is based on the Shigeru Yoshida's post [1]. This patch fixes the issue by not detaching nilfs->ns_writer on remount so that this UAF race doesn't happen. Along with this change, this patch also inserts a few necessary read-only checks with superblock instance where only the ns_writer pointer was used to check if the filesystem is read-only. Link: https://syzkaller.appspot.com/bug?id=79a4c002e960419ca173d55e863bd09e8112df8b Link: https://lkml.kernel.org/r/20221103141759.1836312-1-syoshida@redhat.com [1] Link: https://lkml.kernel.org/r/20221104142959.28296-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+f816fa82f8783f7a02bb@syzkaller.appspotmail.com Reported-by: Shigeru Yoshida Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit ba54d194f8daad8943802d6dfe06e205f882c391 Author: Alexander Potapenko Date: Wed Nov 2 12:06:11 2022 +0100 x86/traps: avoid KMSAN bugs originating from handle_bug() There is a case in exc_invalid_op handler that is executed outside the irqentry_enter()/irqentry_exit() region when an UD2 instruction is used to encode a call to __warn(). In that case the `struct pt_regs` passed to the interrupt handler is never unpoisoned by KMSAN (this is normally done in irqentry_enter()), which leads to false positives inside handle_bug(). Use kmsan_unpoison_entry_regs() to explicitly unpoison those registers before using them. Link: https://lkml.kernel.org/r/20221102110611.1085175-5-glider@google.com Signed-off-by: Alexander Potapenko Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Dmitry Vyukov Cc: Kees Cook Cc: Marco Elver Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Peter Zijlstra (Intel) Signed-off-by: Andrew Morton commit 83d0edfa04eeca46b3eff554fb42b2fefe97bdf1 Author: Alexander Potapenko Date: Wed Nov 2 12:06:10 2022 +0100 kmsan: make sure PREEMPT_RT is off As pointed out by Peter Zijlstra, __msan_poison_alloca() does not play well with IRQ code when PREEMPT_RT is on, because in that mode even GFP_ATOMIC allocations cannot be performed. Fixing this would require making stackdepot completely lockless, which is quite challenging and may be excessive for the time being. Instead, make sure KMSAN is incompatible with PREEMPT_RT, like other debug configs are. Link: https://lkml.kernel.org/r/20221102110611.1085175-4-glider@google.com Link: https://lore.kernel.org/lkml/20221025221755.3810809-1-glider@google.com/ Signed-off-by: Alexander Potapenko Acked-by: Peter Zijlstra (Intel) Cc: Dmitry Vyukov Cc: Marco Elver Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Kees Cook Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit ac66998df30a3c2888c077879786a3589ed5170b Author: Alexander Potapenko Date: Wed Nov 2 12:06:09 2022 +0100 Kconfig.debug: ensure early check for KMSAN in CONFIG_KMSAN_WARN As pointed out by Masahiro Yamada, Kconfig picks up the first default entry which has true 'if' condition. Hence, the previously added check for KMSAN was never used, because it followed the checks for 64BIT and !64BIT. Put KMSAN check before others to ensure it is always applied. Link: https://lkml.kernel.org/r/20221102110611.1085175-3-glider@google.com Link: https://github.com/google/kmsan/issues/89 Link: https://lore.kernel.org/linux-mm/20221024212144.2852069-3-glider@google.com/ Fixes: 921757bc9b61 ("Kconfig.debug: disable CONFIG_FRAME_WARN for KMSAN by default") Signed-off-by: Alexander Potapenko Cc: Kees Cook Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Borislav Petkov Cc: Dave Hansen Cc: Dmitry Vyukov Cc: Ingo Molnar Cc: Marco Elver Cc: Peter Zijlstra (Intel) Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 11385b2612004298ac2fbc9877e73f1410cfd3c0 Author: Alexander Potapenko Date: Wed Nov 2 12:06:08 2022 +0100 x86/uaccess: instrument copy_from_user_nmi() Make sure usercopy hooks from linux/instrumented.h are invoked for copy_from_user_nmi(). This fixes KMSAN false positives reported when dumping opcodes for a stack trace. Link: https://lkml.kernel.org/r/20221102110611.1085175-2-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Peter Zijlstra (Intel) Cc: Dave Hansen Cc: Kees Cook Cc: Borislav Petkov Cc: Dmitry Vyukov Cc: Ingo Molnar Cc: Marco Elver Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit cbadaf71f7cf9e67c073eec673c6c050cecd0ec8 Author: Alexander Potapenko Date: Wed Nov 2 12:06:07 2022 +0100 kmsan: core: kmsan_in_runtime() should return true in NMI context Without that, every call to __msan_poison_alloca() in NMI may end up allocating memory, which is NMI-unsafe. Link: https://lkml.kernel.org/r/20221102110611.1085175-1-glider@google.com Link: https://lore.kernel.org/lkml/20221025221755.3810809-1-glider@google.com/ Signed-off-by: Alexander Potapenko Acked-by: Peter Zijlstra (Intel) Cc: Dmitry Vyukov Cc: Marco Elver Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Kees Cook Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit db5e8d84319bcdb51e1d3cfa42b410291d6d1cfa Author: Vasily Gorbik Date: Wed Nov 2 19:09:17 2022 +0100 mm: hugetlb_vmemmap: include missing linux/moduleparam.h The kernel test robot reported build failures with a 'randconfig' on s390: >> mm/hugetlb_vmemmap.c:421:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] core_param(hugetlb_free_vmemmap, vmemmap_optimize_enabled, bool, 0); ^ Link: https://lore.kernel.org/linux-mm/202210300751.rG3UDsuc-lkp@intel.com/ Link: https://lkml.kernel.org/r/patch.git-296b83ca939b.your-ad-here.call-01667411912-ext-5073@work.hours Fixes: 30152245c63b ("mm: hugetlb_vmemmap: replace early_param() with core_param()") Signed-off-by: Vasily Gorbik Reported-by: kernel test robot Reviewed-by: Muchun Song Cc: Gerald Schaefer Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton commit 93b0d9178743a68723babe8448981f658aebc58e Author: Peter Xu Date: Wed Nov 2 14:41:52 2022 -0400 mm/shmem: use page_mapping() to detect page cache for uffd continue mfill_atomic_install_pte() checks page->mapping to detect whether one page is used in the page cache. However as pointed out by Matthew, the page can logically be a tail page rather than always the head in the case of uffd minor mode with UFFDIO_CONTINUE. It means we could wrongly install one pte with shmem thp tail page assuming it's an anonymous page. It's not that clear even for anonymous page, since normally anonymous pages also have page->mapping being setup with the anon vma. It's safe here only because the only such caller to mfill_atomic_install_pte() is always passing in a newly allocated page (mcopy_atomic_pte()), whose page->mapping is not yet setup. However that's not extremely obvious either. For either of above, use page_mapping() instead. Link: https://lkml.kernel.org/r/Y2K+y7wnhC4vbnP2@x1n Fixes: 153132571f02 ("userfaultfd/shmem: support UFFDIO_CONTINUE for shmem") Signed-off-by: Peter Xu Reported-by: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Axel Rasmussen Cc: Signed-off-by: Andrew Morton commit 867400af90f1f953ff9e10b1b87ecaf9369a7eb8 Author: Pankaj Gupta Date: Wed Nov 2 11:07:28 2022 -0500 mm/memremap.c: map FS_DAX device memory as decrypted virtio_pmem use devm_memremap_pages() to map the device memory. By default this memory is mapped as encrypted with SEV. Guest reboot changes the current encryption key and guest no longer properly decrypts the FSDAX device meta data. Mark the corresponding device memory region for FSDAX devices (mapped with memremap_pages) as decrypted to retain the persistent memory property. Link: https://lkml.kernel.org/r/20221102160728.3184016-1-pankaj.gupta@amd.com Fixes: b7b3c01b19159 ("mm/memremap_pages: support multiple ranges per invocation") Signed-off-by: Pankaj Gupta Cc: Dan Williams Cc: Tom Lendacky Cc: Signed-off-by: Andrew Morton commit 624a2c94f5b7a08120aaf26b3275a17463789273 Author: Peter Xu Date: Tue Nov 8 15:57:23 2022 -0800 Partly revert "mm/thp: carry over dirty bit when thp splits on pmd" Anatoly Pugachev reported sparc64 breakage on the patch: https://lore.kernel.org/r/20221021160603.GA23307@u164.east.ru The sparc64 impl of pte_mkdirty() is definitely slightly special in that it leverages a code patching mechanism for sun4u/sun4v on relevant pgtable entry operations. Before having a clue of why the sparc64 is special and caused the patch to SIGSEGV the processes, revert the patch for now. The swap path of dirty bit inheritage is kept because that's using the swap shared code so we assume it'll not be affected. Link: https://lkml.kernel.org/r/Y1Wbi4yyVvDtg4zN@x1n Fixes: 0ccf7f168e17 ("mm/thp: carry over dirty bit when thp splits on pmd") Signed-off-by: Peter Xu Reported-by: Anatoly Pugachev Tested-by: Anatoly Pugachev Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: David S. Miller Cc: "Huang, Ying" Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 8ac932a4921a96ca52f61935dbba64ea87bbd5dc Author: Ryusuke Konishi Date: Sat Oct 29 13:49:12 2022 +0900 nilfs2: fix deadlock in nilfs_count_free_blocks() A semaphore deadlock can occur if nilfs_get_block() detects metadata corruption while locating data blocks and a superblock writeback occurs at the same time: task 1 task 2 ------ ------ * A file operation * nilfs_truncate() nilfs_get_block() down_read(rwsem A) <-- nilfs_bmap_lookup_contig() ... generic_shutdown_super() nilfs_put_super() * Prepare to write superblock * down_write(rwsem B) <-- nilfs_cleanup_super() * Detect b-tree corruption * nilfs_set_log_cursor() nilfs_bmap_convert_error() nilfs_count_free_blocks() __nilfs_error() down_read(rwsem A) <-- nilfs_set_error() down_write(rwsem B) <-- *** DEADLOCK *** Here, nilfs_get_block() readlocks rwsem A (= NILFS_MDT(dat_inode)->mi_sem) and then calls nilfs_bmap_lookup_contig(), but if it fails due to metadata corruption, __nilfs_error() is called from nilfs_bmap_convert_error() inside the lock section. Since __nilfs_error() calls nilfs_set_error() unless the filesystem is read-only and nilfs_set_error() attempts to writelock rwsem B (= nilfs->ns_sem) to write back superblock exclusively, hierarchical lock acquisition occurs in the order rwsem A -> rwsem B. Now, if another task starts updating the superblock, it may writelock rwsem B during the lock sequence above, and can deadlock trying to readlock rwsem A in nilfs_count_free_blocks(). However, there is actually no need to take rwsem A in nilfs_count_free_blocks() because it, within the lock section, only reads a single integer data on a shared struct with nilfs_sufile_get_ncleansegs(). This has been the case after commit aa474a220180 ("nilfs2: add local variable to cache the number of clean segments"), that is, even before this bug was introduced. So, this resolves the deadlock problem by just not taking the semaphore in nilfs_count_free_blocks(). Link: https://lkml.kernel.org/r/20221029044912.9139-1-konishi.ryusuke@gmail.com Fixes: e828949e5b42 ("nilfs2: call nilfs_error inside bmap routines") Signed-off-by: Ryusuke Konishi Reported-by: syzbot+45d6ce7b7ad7ef455d03@syzkaller.appspotmail.com Tested-by: Ryusuke Konishi Cc: [2.6.38+ Signed-off-by: Andrew Morton commit cc674ab3c0188002917c8a2c28e4424131f1fd7e Author: Li Zetao Date: Fri Oct 28 15:37:17 2022 +0800 mm/mmap: fix memory leak in mmap_region() There is a memory leak reported by kmemleak: unreferenced object 0xffff88817231ce40 (size 224): comm "mount.cifs", pid 19308, jiffies 4295917571 (age 405.880s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 60 c0 b2 00 81 88 ff ff 98 83 01 42 81 88 ff ff `..........B.... backtrace: [] __alloc_file+0x21/0x250 [] alloc_empty_file+0x41/0xf0 [] alloc_file+0x59/0x710 [] alloc_file_pseudo+0x154/0x210 [] __shmem_file_setup+0xff/0x2a0 [] shmem_zero_setup+0x8d/0x160 [] mmap_region+0x1075/0x19d0 [] do_mmap+0x727/0x1110 [] vm_mmap_pgoff+0x112/0x1e0 [] do_syscall_64+0x35/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 The root cause was traced to an error handing path in mmap_region() when arch_validate_flags() or mas_preallocate() fails. In the shared anonymous mapping sence, vma will be setuped and mapped with a new shared anonymous file via shmem_zero_setup(). So in this case, the file resource needs to be released. Fix it by calling fput(vma->vm_file) and unmap_region() when arch_validate_flags() or mas_preallocate() returns an error in the shared anonymous mapping sence. Link: https://lkml.kernel.org/r/20221028073717.1179380-1-lizetao1@huawei.com Fixes: d4af56c5c7c6 ("mm: start tracking VMAs with maple tree") Fixes: c462ac288f2c ("mm: Introduce arch_validate_flags()") Signed-off-by: Li Zetao Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 8625147cafaa9ba74713d682f5185eb62cb2aedb Author: James Houghton Date: Tue Oct 18 20:01:25 2022 +0000 hugetlbfs: don't delete error page from pagecache This change is very similar to the change that was made for shmem [1], and it solves the same problem but for HugeTLBFS instead. Currently, when poison is found in a HugeTLB page, the page is removed from the page cache. That means that attempting to map or read that hugepage in the future will result in a new hugepage being allocated instead of notifying the user that the page was poisoned. As [1] states, this is effectively memory corruption. The fix is to leave the page in the page cache. If the user attempts to use a poisoned HugeTLB page with a syscall, the syscall will fail with EIO, the same error code that shmem uses. For attempts to map the page, the thread will get a BUS_MCEERR_AR SIGBUS. [1]: commit a76054266661 ("mm: shmem: don't truncate page if memory failure happens") Link: https://lkml.kernel.org/r/20221018200125.848471-1-jthoughton@google.com Signed-off-by: James Houghton Reviewed-by: Mike Kravetz Reviewed-by: Naoya Horiguchi Tested-by: Naoya Horiguchi Reviewed-by: Yang Shi Cc: Axel Rasmussen Cc: James Houghton Cc: Miaohe Lin Cc: Muchun Song Cc: Signed-off-by: Andrew Morton commit 120b116208a0877227fc82e3f0df81e7a3ed4ab1 Author: Liam Howlett Date: Fri Oct 28 18:04:30 2022 +0000 maple_tree: reorganize testing to restore module testing Along the development cycle, the testing code support for module/in-kernel compiles was removed. Restore this functionality by moving any internal API tests to the userspace side, as well as threading tests. Fix the lockdep issues and add a way to reduce memory usage so the tests can complete with KASAN + memleak detection. Make the tests work on 32 bit hosts where possible and detect 32 bit hosts in the radix test suite. [akpm@linux-foundation.org: fix module export] [akpm@linux-foundation.org: fix it some more] [liam.howlett@oracle.com: fix compile warnings on 32bit build in check_find()] Link: https://lkml.kernel.org/r/20221107203816.1260327-1-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20221028180415.3074673-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 9a887877ef981e5a185a84339603300cf2eb1900 Author: Liam Howlett Date: Wed Oct 26 15:14:31 2022 +0000 maple_tree: mas_anode_descend() clang-analyzer cleanup clang-analyzer reported some Dead Stores in mas_anode_descend(). Upon inspection, there were a few clean ups that would make the code cleaner: The count variable was set from the mt_slots array and then updated but never used again. Just use the array reference directly. Also stop updating the type since it isn't used after the update. Stop setting the gaps pointer to NULL at the start since it is always set before the loop begins. Link: https://lkml.kernel.org/r/20221026151413.4032730-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit c61b3a2b2d9bb36698f8c2f65aa41ba183815264 Author: Liam Howlett Date: Wed Oct 26 15:13:29 2022 +0000 maple_tree: remove pointer to pointer use in mas_alloc_nodes() There is a more direct and cleaner way of implementing the same functional code. Remove the confusing and unnecessary use of pointers here. Link: https://lkml.kernel.org/r/20221026151241.4031117-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit 2b0145032877fe0fa3460dfff285cc2fdcc9fc2e Merge: ce9e57feeed81 8b043dfb3dc7c Author: Jakub Kicinski Date: Tue Nov 8 15:22:33 2022 -0800 Merge tag 'linux-can-fixes-for-6.1-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== can 2022-11-07 The first patch is by Chen Zhongjin and adds a missing dev_remove_pack() to the AF_CAN protocol. Zhengchao Shao's patch fixes a potential NULL pointer deref in AF_CAN's can_rx_register(). The next patch is by Oliver Hartkopp and targets the CAN ISO-TP protocol, and fixes the state handling for echo TX processing. Oliver Hartkopp's patch for the j1939 protocol adds a missing initialization of the CAN headers inside outgoing skbs. Another patch by Oliver Hartkopp fixes an out of bounds read in the check for invalid CAN frames in the xmit callback of virtual CAN devices. This touches all non virtual device drivers as we decided to rename the function requiring that netdev_priv points to a struct can_priv. (Note: This patch will create a merge conflict with net-next where the pch_can driver has removed.) The last patch is by Geert Uytterhoeven and adds the missing ECC error checks for the channels 2-7 in the rcar_canfd driver. * tag 'linux-can-fixes-for-6.1-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: rcar_canfd: Add missing ECC error checks for channels 2-7 can: dev: fix skb drop check can: j1939: j1939_send_one(): fix missing CAN header initialization can: isotp: fix tx state handling for echo tx processing can: af_can: fix NULL pointer dereference in can_rx_register() can: af_can: can_exit(): add missing dev_remove_pack() of canxl_packet ==================== Link: https://lore.kernel.org/r/20221107133217.59861-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 03c1f1ef1584c981935fab2fa0c45d3e43e2c235 Author: Shigeru Yoshida Date: Thu Nov 3 22:08:49 2022 +0900 netfilter: Cleanup nft_net->module_list from nf_tables_exit_net() syzbot reported a warning like below [1]: WARNING: CPU: 3 PID: 9 at net/netfilter/nf_tables_api.c:10096 nf_tables_exit_net+0x71c/0x840 Modules linked in: CPU: 2 PID: 9 Comm: kworker/u8:0 Tainted: G W 6.1.0-rc3-00072-g8e5423e991e8 #47 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 Workqueue: netns cleanup_net RIP: 0010:nf_tables_exit_net+0x71c/0x840 ... Call Trace: ? __nft_release_table+0xfc0/0xfc0 ops_exit_list+0xb5/0x180 cleanup_net+0x506/0xb10 ? unregister_pernet_device+0x80/0x80 process_one_work+0xa38/0x1730 ? pwq_dec_nr_in_flight+0x2b0/0x2b0 ? rwlock_bug.part.0+0x90/0x90 ? _raw_spin_lock_irq+0x46/0x50 worker_thread+0x67e/0x10e0 ? process_one_work+0x1730/0x1730 kthread+0x2e5/0x3a0 ? kthread_complete_and_exit+0x40/0x40 ret_from_fork+0x1f/0x30 In nf_tables_exit_net(), there is a case where nft_net->commit_list is empty but nft_net->module_list is not empty. Such a case occurs with the following scenario: 1. nfnetlink_rcv_batch() is called 2. nf_tables_newset() returns -EAGAIN and NFNL_BATCH_FAILURE bit is set to status 3. nf_tables_abort() is called with NFNL_ABORT_AUTOLOAD (nft_net->commit_list is released, but nft_net->module_list is not because of NFNL_ABORT_AUTOLOAD flag) 4. Jump to replay label 5. netlink_skb_clone() fails and returns from the function (this is caused by fault injection in the reproducer of syzbot) This patch fixes this issue by calling __nf_tables_abort() when nft_net->module_list is not empty in nf_tables_exit_net(). Fixes: eb014de4fd41 ("netfilter: nf_tables: autoload modules from the abort path") Link: https://syzkaller.appspot.com/bug?id=802aba2422de4218ad0c01b46c9525cc9d4e4aa3 [1] Reported-by: syzbot+178efee9e2d7f87f5103@syzkaller.appspotmail.com Signed-off-by: Shigeru Yoshida Signed-off-by: Florian Westphal commit 03832a32bf8ff0a8305d94ddd3979835a807248f Author: Ziyang Xuan Date: Thu Nov 3 09:12:02 2022 +0800 netfilter: nfnetlink: fix potential dead lock in nfnetlink_rcv_msg() When type is NFNL_CB_MUTEX and -EAGAIN error occur in nfnetlink_rcv_msg(), it does not execute nfnl_unlock(). That would trigger potential dead lock. Fixes: 50f2db9e368f ("netfilter: nfnetlink: consolidate callback types") Signed-off-by: Ziyang Xuan Signed-off-by: Florian Westphal commit 94d957ae513fc420d0a5a9bac815eb49ffebb56f Author: Donglin Peng Date: Thu Nov 3 02:27:04 2022 -0700 perf tools: Add the include/perf/ directory to .gitignore Commit 3af1dfdd51e06697 ("perf build: Move perf_dlfilters.h in the source tree") moved perf_dlfilters.h to the include/perf/ directory while include/perf is ignored because it has 'perf' in the name. Newly created files in the include/perf/ directory will be ignored. Testing: Before: $ touch tools/perf/include/perf/junk $ git status | grep junk $ git check-ignore -v tools/perf/include/perf/junk tools/perf/.gitignore:6:perf tools/perf/include/perf/junk After: $ git status | grep junk tools/perf/include/perf/junk $ git check-ignore -v tools/perf/include/perf/junk Add !include/perf/ to perf's .gitignore file. Fixes: 3af1dfdd51e06697 ("perf build: Move perf_dlfilters.h in the source tree") Signed-off-by: Donglin Peng Acked-by: Adrian Hunter Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221103092704.173391-1-dolinux.peng@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 20ebc4a649b82e6ad892684c76ea1e8dd786d336 Author: James Clark Date: Fri Oct 28 13:19:13 2022 +0100 perf test: Fix skipping branch stack sampling test Commit f4a2aade6809c657 ("perf tests powerpc: Fix branch stack sampling test to include sanity check for branch filter") added a skip if certain branch options aren't available. But the change added both -b (--branch-any) and --branch-filter options at the same time, which will always result in a failure on any platform because the arguments can't be used together. Fix this by removing -b (--branch-any) and leaving --branch-filter which already specifies 'any'. Also add warning messages to the test and perf tool. Output on x86 before this fix: $ sudo ./perf test branch 108: Check branch stack sampling : Skip After: $ sudo ./perf test branch 108: Check branch stack sampling : Ok Fixes: f4a2aade6809c657 ("perf tests powerpc: Fix branch stack sampling test to include sanity check for branch filter") Signed-off-by: James Clark Tested-by: Athira Jajeev Cc: Alexander Shishkin Cc: Anshuman.Khandual@arm.com Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221028121913.745307-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ad353b710c7493df3d4fc2d3a51819126bed2e81 Author: Athira Rajeev Date: Tue Oct 18 14:26:04 2022 +0530 perf stat: Fix printing os->prefix in CSV metrics output 'perf stat' with CSV output option prints an extra empty string as first field in metrics output line. Sample output below: # ./perf stat -x, --per-socket -a -C 1 ls S0,1,1.78,msec,cpu-clock,1785146,100.00,0.973,CPUs utilized S0,1,26,,context-switches,1781750,100.00,0.015,M/sec S0,1,1,,cpu-migrations,1780526,100.00,0.561,K/sec S0,1,1,,page-faults,1779060,100.00,0.561,K/sec S0,1,875807,,cycles,1769826,100.00,0.491,GHz S0,1,85281,,stalled-cycles-frontend,1767512,100.00,9.74,frontend cycles idle S0,1,576839,,stalled-cycles-backend,1766260,100.00,65.86,backend cycles idle S0,1,288430,,instructions,1762246,100.00,0.33,insn per cycle ====> ,S0,1,,,,,,,2.00,stalled cycles per insn The above command line uses field separator as "," via "-x," option and per-socket option displays socket value as first field. But here the last line for "stalled cycles per insn" has "," in the beginning. Sample output using interval mode: # ./perf stat -I 1000 -x, --per-socket -a -C 1 ls 0.001813453,S0,1,1.87,msec,cpu-clock,1872052,100.00,0.002,CPUs utilized 0.001813453,S0,1,2,,context-switches,1868028,100.00,1.070,K/sec ------ 0.001813453,S0,1,85379,,instructions,1856754,100.00,0.32,insn per cycle ====> 0.001813453,,S0,1,,,,,,,1.34,stalled cycles per insn Above result also has an extra CSV separator after the timestamp. Patch addresses extra field separator in the beginning of the metric output line. The counter stats are displayed by function "perf_stat__print_shadow_stats" in code "util/stat-shadow.c". While printing the stats info for "stalled cycles per insn", function "new_line_csv" is used as new_line callback. The new_line_csv function has check for "os->prefix" and if prefix is not null, it will be printed along with cvs separator. Snippet from "new_line_csv": if (os->prefix) fprintf(os->fh, "%s%s", os->prefix, config->csv_sep); Here os->prefix gets printed followed by "," which is the cvs separator. The os->prefix is used in interval mode option ( -I ), to print time stamp on every new line. But prefix is already set to contain CSV separator when used in interval mode for CSV option. Reference: Function "static void print_interval" Snippet: sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, config->csv_sep); Also if prefix is not assigned (if not used with -I option), it gets set to empty string. Reference: function printout() in util/stat-display.c Snippet: .prefix = prefix ? prefix : "", Since prefix already set to contain cvs_sep in interval option, patch removes printing config->csv_sep in new_line_csv function to avoid printing extra field. After the patch: # ./perf stat -x, --per-socket -a -C 1 ls S0,1,2.04,msec,cpu-clock,2045202,100.00,1.013,CPUs utilized S0,1,2,,context-switches,2041444,100.00,979.289,/sec S0,1,0,,cpu-migrations,2040820,100.00,0.000,/sec S0,1,2,,page-faults,2040288,100.00,979.289,/sec S0,1,254589,,cycles,2036066,100.00,0.125,GHz S0,1,82481,,stalled-cycles-frontend,2032420,100.00,32.40,frontend cycles idle S0,1,113170,,stalled-cycles-backend,2031722,100.00,44.45,backend cycles idle S0,1,88766,,instructions,2030942,100.00,0.35,insn per cycle S0,1,,,,,,,1.27,stalled cycles per insn Fixes: 92a61f6412d3a09d ("perf stat: Implement CSV metrics output") Reported-by: Disha Goel Reviewed-By: Kajol Jain Signed-off-by: Athira Jajeev Tested-by: Disha Goel Cc: Andi Kleen Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: linuxppc-dev@lists.ozlabs.org Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221018085605.63834-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 84d1b2013272947ad9b13025df89226d8fa31cc5 Author: Namhyung Kim Date: Mon Nov 7 13:33:06 2022 -0800 perf stat: Fix crash with --per-node --metric-only in CSV mode The following command will get segfault due to missing aggr_header_csv for AGGR_NODE: $ sudo perf stat -a --per-node -x, --metric-only true Committer testing: Before this patch: # perf stat -a --per-node -x, --metric-only true Segmentation fault (core dumped) # After: # gdb perf -bash: gdb: command not found # perf stat -a --per-node -x, --metric-only true node,Ghz,frontend cycles idle,backend cycles idle,insn per cycle,branch-misses of all branches, N0,32,0.335,2.10,0.65,0.69,0.03,1.92, # Fixes: 86895b480a2f10c7 ("perf stat: Add --per-node agregation support") Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Cc: Xing Zhengjun Link: http://lore.kernel.org/lkml/20221107213314.3239159-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f141df371335645ce29a87d9683a3f79fba7fd67 Merge: f49b2d89fb10e 986d93f55bdea Author: Linus Torvalds Date: Tue Nov 8 12:30:29 2022 -0800 Merge tag 'audit-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "A small audit patch to fix an instance of undefined behavior in a shift operator caused when shifting a signed value too far, the same case as the lsm patch merged previously. While the fix is trivial and I can't imagine it causing a problem in a backport, I'm not explicitly marking it for stable on the off chance that there is some system out there which is relying on some wonky unexpected behavior which this patch could break; *if* it does break, IMO it's better that to happen in a minor or -rcX release and not in a stable backport" * tag 'audit-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: fix undefined behavior in bit shift for AUDIT_BIT commit f49b2d89fb10ef5fa5fa1993f648ec5daa884bef Merge: 59f2f4b8a7574 46653972e3ea6 Author: Linus Torvalds Date: Tue Nov 8 12:22:02 2022 -0800 Merge tag 'lsm-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull lsm fix from Paul Moore: "A small capability patch to fix an instance of undefined behavior in a shift operator caused when shifting a signed value too far. While the fix is trivial and I can't imagine it causing a problem in a backport, I'm not explicitly marking it for stable on the off chance that there is some system out there which is relying on some wonky unexpected behavior which this patch could break; *if* it does break, IMO it's better that to happen in a minor or -rcX release and not in a stable backport" * tag 'lsm-pr-20221107' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: capabilities: fix undefined behavior in bit shift for CAP_TO_MASK commit f0861f49bd946ff94fce4f82509c45e167f63690 Author: Borys Popławski Date: Wed Oct 5 00:59:03 2022 +0200 x86/sgx: Add overflow check in sgx_validate_offset_length() sgx_validate_offset_length() function verifies "offset" and "length" arguments provided by userspace, but was missing an overflow check on their addition. Add it. Fixes: c6d26d370767 ("x86/sgx: Add SGX_IOC_ENCLAVE_ADD_PAGES") Signed-off-by: Borys Popławski Signed-off-by: Borislav Petkov Reviewed-by: Jarkko Sakkinen Cc: stable@vger.kernel.org # v5.11+ Link: https://lore.kernel.org/r/0d91ac79-6d84-abed-5821-4dbe59fa1a38@invisiblethingslab.com commit d68cc25b7c7fb3034c5a5b5f350a0b858c6d5a45 Author: Janne Grunau Date: Sun Nov 6 22:48:04 2022 +0100 usb: dwc3: Do not get extcon device when usb-role-switch is used The change breaks device tree based platforms with PHY device and use usb-role-switch instead of an extcon switch. extcon_find_edev_by_node() will return EPROBE_DEFER if it can not find a device so probing without an extcon device will be deferred indefinitely. Fix this by explicitly checking for usb-role-switch. At least the out-of-tree USB3 support on Apple silicon based platforms using dwc3 with tipd USB Type-C and PD controller is affected by this issue. Fixes: d182c2e1bc92 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") Cc: stable@kernel.org Signed-off-by: Janne Grunau Acked-by: Thinh Nguyen Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20221106214804.2814-1-j@jannau.net Signed-off-by: Greg Kroah-Hartman commit 80ddf5ce1c9291cb175d52ed1227134ad48c47ee Author: Heiko Carstens Date: Sun Oct 30 19:22:02 2022 +0100 s390: always build relocatable kernel Nathan Chancellor reported several link errors on s390 with CONFIG_RELOCATABLE disabled, after binutils commit 906f69cf65da ("IBM zSystems: Issue error for *DBL relocs on misaligned symbols"). The binutils commit reveals potential miscompiles that might have happened already before with linker script defined symbols at odd addresses. A similar bug was recently fixed in the kernel with commit c9305b6c1f52 ("s390: fix nospec table alignments"). See https://github.com/ClangBuiltLinux/linux/issues/1747 for an analysis from Ulich Weigand. Therefore always build a relocatable kernel to avoid this problem. There is hardly any use-case for non-relocatable kernels, so this shouldn't be controversial. Link: https://github.com/ClangBuiltLinux/linux/issues/1747 Signed-off-by: Heiko Carstens Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20221030182202.2062705-1-hca@linux.ibm.com Signed-off-by: Alexander Gordeev commit 9afea696a04af29b114b38aec734e28b03e93dae Author: Heiko Carstens Date: Mon Oct 31 19:40:31 2022 +0100 s390/configs: add kasan.config addon config file Add kasan.config addon config file which allows to easily enable KASAN into the current kernel config. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 6191de8b175fad1a877ae8ed4be699a5022b9c03 Author: Heiko Carstens Date: Mon Oct 31 19:11:49 2022 +0100 s390/configs: move CONFIG_DEBUG_INFO_BTF into btf.config addon config CONFIG_DEBUG_INFO_BTF significantly increases compile time for the kernel. E.g. when changing a single C file compile time for a new bzImage is increased by ~50% if BTF debug info is generated. Therefore remove CONFIG_DEBUG_INFO_BTF from all defconfigs and introduce a btf.config addon config file. Quickly enabling CONFIG_DEBUG_INFO_BTF into the current kernel config can be done by simply invoking make btf.config Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 26c263bf1847d4dadba016a0457c4c5f446407bf Author: Takashi Iwai Date: Tue Nov 8 09:30:52 2022 -0800 Input: i8042 - apply probe defer to more ASUS ZenBook models There are yet a few more ASUS ZenBook models that require the deferred probe. At least, there are different ZenBook UX325x and UX425x models. Let's extend the DMI matching table entries for adapting those missing models. Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20221108142027.28480-1-tiwai@suse.de Signed-off-by: Dmitry Torokhov commit 000f8870a47bdc36730357883b6aef42bced91ee Author: Nathan Chancellor Date: Tue Nov 8 10:49:34 2022 -0700 vmlinux.lds.h: Fix placement of '.data..decrypted' section Commit d4c639990036 ("vmlinux.lds.h: Avoid orphan section with !SMP") fixed an orphan section warning by adding the '.data..decrypted' section to the linker script under the PERCPU_DECRYPTED_SECTION define but that placement introduced a panic with !SMP, as the percpu sections are not instantiated with that configuration so attempting to access variables defined with DEFINE_PER_CPU_DECRYPTED() will result in a page fault. Move the '.data..decrypted' section to the DATA_MAIN define so that the variables in it are properly instantiated at boot time with CONFIG_SMP=n. Cc: stable@vger.kernel.org Fixes: d4c639990036 ("vmlinux.lds.h: Avoid orphan section with !SMP") Link: https://lore.kernel.org/cbbd3548-880c-d2ca-1b67-5bb93b291d5f@huawei.com/ Debugged-by: Ard Biesheuvel Reported-by: Zhao Wenhui Tested-by: xiafukun Signed-off-by: Nathan Chancellor Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20221108174934.3384275-1-nathan@kernel.org commit 0fc8c2acbfc789a977a50a4a9812a8e4b37958ce Author: Dylan Yudaken Date: Tue Nov 8 07:30:16 2022 -0800 io_uring: calculate CQEs from the user visible value io_cqring_wait (and it's wake function io_has_work) used cached_cq_tail in order to calculate the number of CQEs. cached_cq_tail is set strictly before the user visible rings->cq.tail However as far as userspace is concerned, if io_uring_enter(2) is called with a minimum number of events, they will verify by checking rings->cq.tail. It is therefore possible for io_uring_enter(2) to return early with fewer events visible to the user. Instead make the wait functions read from the user visible value, so there will be no discrepency. This is triggered eventually by the following reproducer: struct io_uring_sqe *sqe; struct io_uring_cqe *cqe; unsigned int cqe_ready; struct io_uring ring; int ret, i; ret = io_uring_queue_init(N, &ring, 0); assert(!ret); while(true) { for (i = 0; i < N; i++) { sqe = io_uring_get_sqe(&ring); io_uring_prep_nop(sqe); sqe->flags |= IOSQE_ASYNC; } ret = io_uring_submit(&ring); assert(ret == N); do { ret = io_uring_wait_cqes(&ring, &cqe, N, NULL, NULL); } while(ret == -EINTR); cqe_ready = io_uring_cq_ready(&ring); assert(!ret); assert(cqe_ready == N); io_uring_cq_advance(&ring, N); } Fixes: ad3eb2c89fb2 ("io_uring: split overflow state into SQ and CQ side") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20221108153016.1854297-1-dylany@meta.com Signed-off-by: Jens Axboe commit eb86559a691cea5fa63e57a03ec3dc9c31e97955 Author: Wang Yufen Date: Tue Nov 8 13:11:31 2022 +0800 bpf: Fix memory leaks in __check_func_call kmemleak reports this issue: unreferenced object 0xffff88817139d000 (size 2048): comm "test_progs", pid 33246, jiffies 4307381979 (age 45851.820s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000045f075f0>] kmalloc_trace+0x27/0xa0 [<0000000098b7c90a>] __check_func_call+0x316/0x1230 [<00000000b4c3c403>] check_helper_call+0x172e/0x4700 [<00000000aa3875b7>] do_check+0x21d8/0x45e0 [<000000001147357b>] do_check_common+0x767/0xaf0 [<00000000b5a595b4>] bpf_check+0x43e3/0x5bc0 [<0000000011e391b1>] bpf_prog_load+0xf26/0x1940 [<0000000007f765c0>] __sys_bpf+0xd2c/0x3650 [<00000000839815d6>] __x64_sys_bpf+0x75/0xc0 [<00000000946ee250>] do_syscall_64+0x3b/0x90 [<0000000000506b7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The root case here is: In function prepare_func_exit(), the callee is not released in the abnormal scenario after "state->curframe--;". To fix, move "state->curframe--;" to the very bottom of the function, right when we free callee and reset frame[] pointer to NULL, as Andrii suggested. In addition, function __check_func_call() has a similar problem. In the abnormal scenario before "state->curframe++;", the callee also should be released by free_func_state(). Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Fixes: fd978bf7fd31 ("bpf: Add reference tracking to verifier") Signed-off-by: Wang Yufen Link: https://lore.kernel.org/r/1667884291-15666-1-git-send-email-wangyufen@huawei.com Signed-off-by: Martin KaFai Lau commit 50256e4793a5e5ab77703c82a47344ad2e774a59 Author: Jeff Layton Date: Tue Nov 8 11:23:11 2022 -0500 nfsd: put the export reference in nfsd4_verify_deleg_dentry nfsd_lookup_dentry returns an export reference in addition to the dentry ref. Ensure that we put it too. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2138866 Fixes: 876c553cb410 ("NFSD: verify the opened dentry after setting a delegation") Reported-by: Yongcheng Yang Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 2081b3bd0c11757725dcab9ba5d38e1bddb03459 Author: Ard Biesheuvel Date: Thu Nov 3 18:00:15 2022 +0100 arm64: fix rodata=full again Commit 2e8cff0a0eee87b2 ("arm64: fix rodata=full") addressed a couple of issues with the rodata= kernel command line option, which is not a simple boolean on arm64, and inadvertently got broken due to changes in the generic bool handling. Unfortunately, the resulting code never clears the rodata_full boolean variable if it defaults to true and rodata=on or rodata=off is passed, as the generic code is not aware of the existence of this variable. Given the way this code is plumbed together, clearing rodata_full when returning false from arch_parse_debug_rodata() may result in inconsistencies if the generic code decides that it cannot parse the right hand side, so the best way to deal with this is to only take rodata_full in account if rodata_enabled is also true. Fixes: 2e8cff0a0eee ("arm64: fix rodata=full") Cc: # 6.0.x Signed-off-by: Ard Biesheuvel Acked-by: Will Deacon Link: https://lore.kernel.org/r/20221103170015.4124426-1-ardb@kernel.org Signed-off-by: Catalin Marinas commit 6d8fc203b28ff8f6115fbe5eaf584de8b824f4fa Author: Sven Peter Date: Wed Nov 2 17:15:42 2022 +0100 usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler If reading TPS_REG_INT_EVENT1/2 fails in the interrupt handler event1 and event2 may be uninitialized when they are used to determine IRQ_HANDLED vs. IRQ_NONE in the error path. Fixes: c7260e29dd20 ("usb: typec: tipd: Add short-circuit for no irqs") Fixes: 45188f27b3d0 ("usb: typec: tipd: Add support for Apple CD321X") Cc: stable Signed-off-by: Sven Peter Reviewed-by: Eric Curtin Reviewed-by: Heikki Krogerus Reviewed-by: Guido Günther Link: https://lore.kernel.org/r/20221102161542.30669-1-sven@svenpeter.dev Signed-off-by: Greg Kroah-Hartman commit 40bf8f162d0f95e0716e479d7db41443d931765c Author: Rajat Khandelwal Date: Mon Oct 24 22:46:11 2022 +0530 usb: typec: mux: Enter safe mode only when pins need to be reconfigured There is no point to enter safe mode during DP/TBT configuration if the DP/TBT was already configured in mux. This is because safe mode is only applicable when there is a need to reconfigure the pins in order to avoid damage within/to port partner. In some chrome systems, IOM/mux is already configured before OS comes up. Thus, when driver is probed, it blindly enters safe mode due to PD negotiations but only after gfx driver lowers dp_phy_ownership, will the IOM complete safe mode and send an ack to PMC. Since, that never happens, we see IPC timeout. Hence, allow safe mode only when pin reconfiguration is not required, which makes sense. Fixes: 43d596e32276 ("usb: typec: intel_pmc_mux: Check the port status before connect") Cc: stable Signed-off-by: Rajat Khandelwal Signed-off-by: Lee Shawn C Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20221024171611.181468-1-rajat.khandelwal@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 341fd15e2e18c24d5c738496cfc3d7a272241201 Author: Yassine Oudjana Date: Mon Nov 7 18:33:17 2022 +0300 extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered Commit bf7571c00dca ("extcon: usbc-tusb320: Add USB TYPE-C support") added an optional Type-C interface to the driver but missed to check if it is in use when calling the IRQ handler. This causes an oops on devices currently using the old extcon interface. Check if a Type-C port is registered before calling the Type-C IRQ handler. Fixes: bf7571c00dca ("extcon: usbc-tusb320: Add USB TYPE-C support") Signed-off-by: Yassine Oudjana Reviewed-by: Marek Vasut Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20221107153317.657803-1-y.oudjana@protonmail.com Signed-off-by: Greg Kroah-Hartman commit 5c294de36e7fb3e0cba0c4e1ef9a5f57bc080d0f Author: Johan Hovold Date: Thu Nov 3 15:46:48 2022 +0100 Revert "usb: dwc3: disable USB core PHY management" This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea. The offending commit disabled the USB core PHY management as the dwc3 already manages the PHYs in question. Unfortunately some platforms have started relying on having USB core also controlling the PHY and this is specifically currently needed on some Exynos platforms for PHY calibration or connected device may fail to enumerate. The PHY calibration was previously handled in the dwc3 driver, but to work around some issues related to how the dwc3 driver interacts with xhci (e.g. using multiple drivers) this was moved to USB core by commits 34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls"). The same PHY obviously should not be controlled from two different places, which for example do no agree on the PHY mode or power state during suspend, but as the offending patch was backported to stable, let's revert it for now. Reported-by: Stefan Agner Link: https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/ Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Tested-by: Marek Szyprowski Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20221103144648.14197-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit ffb9da4a04c69567bad717707b6fdfbc4c216ef4 Author: Thinh Nguyen Date: Mon Nov 7 18:45:44 2022 -0800 usb: dwc3: gadget: Return -ESHUTDOWN on ep disable The usb_request API clearly noted that removed requests due to disabled endpoint should have -ESHUTDOWN status returned. Don't change this behavior. Fixes: b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/3421859485cb32d77e2068549679a6c07a7797bc.1667875427.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit cd136706b4f925aa5d316642543babac90d45910 Author: Linus Walleij Date: Mon Nov 7 10:07:53 2022 +0100 USB: bcma: Make GPIO explicitly optional What the code does is to not check the return value from devm_gpiod_get() and then avoid using an erroneous GPIO descriptor with IS_ERR_OR_NULL(). This will miss real errors from the GPIO core that should not be ignored, such as probe deferral. Instead request the GPIO as explicitly optional, which means that if it doesn't exist, the descriptor returned will be NULL. Then we can add error handling and also avoid just doing this on the device tree path, and simplify the site where the optional GPIO descriptor is used. There were some problems with cleaning up this GPIO descriptor use in the past, but this is the proper way to deal with it. Cc: Rafał Miłecki Cc: Chuhong Yuan Signed-off-by: Linus Walleij Cc: stable Link: https://lore.kernel.org/r/20221107090753.1404679-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit ce9e57feeed81d17d5e80ed86f516ff0d39c3867 Author: Zhengchao Shao Date: Mon Nov 7 12:30:32 2022 +0800 drivers: net: xgene: disable napi when register irq failed in xgene_enet_open() When failed to register irq in xgene_enet_open() for opening device, napi isn't disabled. When open xgene device next time, it will reports a invalid opcode issue. Fix it. Only be compiled, not be tested. Fixes: aeb20b6b3f4e ("drivers: net: xgene: fix: ifconfig up/down crash") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221107043032.357673-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit f829230dd51974c1f4478900ed30bb77ba530b40 Author: Serge Semin Date: Mon Nov 7 23:39:44 2022 +0300 block: sed-opal: kmalloc the cmd/resp buffers In accordance with [1] the DMA-able memory buffers must be cacheline-aligned otherwise the cache writing-back and invalidation performed during the mapping may cause the adjacent data being lost. It's specifically required for the DMA-noncoherent platforms [2]. Seeing the opal_dev.{cmd,resp} buffers are implicitly used for DMAs in the NVME and SCSI/SD drivers in framework of the nvme_sec_submit() and sd_sec_submit() methods respectively they must be cacheline-aligned to prevent the denoted problem. One of the option to guarantee that is to kmalloc the buffers [2]. Let's explicitly allocate them then instead of embedding into the opal_dev structure instance. Note this fix was inspired by the commit c94b7f9bab22 ("nvme-hwmon: kmalloc the NVME SMART log buffer"). [1] Documentation/core-api/dma-api.rst [2] Documentation/core-api/dma-api-howto.rst Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Signed-off-by: Serge Semin Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221107203944.31686-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Jens Axboe commit f02be9002c480cd3ec0fcf184ad27cf531bd6ece Author: Yu Kuai Date: Tue Nov 8 18:34:34 2022 +0800 block, bfq: fix null pointer dereference in bfq_bio_bfqg() Out test found a following problem in kernel 5.10, and the same problem should exist in mainline: BUG: kernel NULL pointer dereference, address: 0000000000000094 PGD 0 P4D 0 Oops: 0000 [#1] SMP CPU: 7 PID: 155 Comm: kworker/7:1 Not tainted 5.10.0-01932-g19e0ace2ca1d-dirty 4 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-b4 Workqueue: kthrotld blk_throtl_dispatch_work_fn RIP: 0010:bfq_bio_bfqg+0x52/0xc0 Code: 94 00 00 00 00 75 2e 48 8b 40 30 48 83 05 35 06 c8 0b 01 48 85 c0 74 3d 4b RSP: 0018:ffffc90001a1fba0 EFLAGS: 00010002 RAX: ffff888100d60400 RBX: ffff8881132e7000 RCX: 0000000000000000 RDX: 0000000000000017 RSI: ffff888103580a18 RDI: ffff888103580a18 RBP: ffff8881132e7000 R08: 0000000000000000 R09: ffffc90001a1fe10 R10: 0000000000000a20 R11: 0000000000034320 R12: 0000000000000000 R13: ffff888103580a18 R14: ffff888114447000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88881fdc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000094 CR3: 0000000100cdb000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bfq_bic_update_cgroup+0x3c/0x350 ? ioc_create_icq+0x42/0x270 bfq_init_rq+0xfd/0x1060 bfq_insert_requests+0x20f/0x1cc0 ? ioc_create_icq+0x122/0x270 blk_mq_sched_insert_requests+0x86/0x1d0 blk_mq_flush_plug_list+0x193/0x2a0 blk_flush_plug_list+0x127/0x170 blk_finish_plug+0x31/0x50 blk_throtl_dispatch_work_fn+0x151/0x190 process_one_work+0x27c/0x5f0 worker_thread+0x28b/0x6b0 ? rescuer_thread+0x590/0x590 kthread+0x153/0x1b0 ? kthread_flush_work+0x170/0x170 ret_from_fork+0x1f/0x30 Modules linked in: CR2: 0000000000000094 ---[ end trace e2e59ac014314547 ]--- RIP: 0010:bfq_bio_bfqg+0x52/0xc0 Code: 94 00 00 00 00 75 2e 48 8b 40 30 48 83 05 35 06 c8 0b 01 48 85 c0 74 3d 4b RSP: 0018:ffffc90001a1fba0 EFLAGS: 00010002 RAX: ffff888100d60400 RBX: ffff8881132e7000 RCX: 0000000000000000 RDX: 0000000000000017 RSI: ffff888103580a18 RDI: ffff888103580a18 RBP: ffff8881132e7000 R08: 0000000000000000 R09: ffffc90001a1fe10 R10: 0000000000000a20 R11: 0000000000034320 R12: 0000000000000000 R13: ffff888103580a18 R14: ffff888114447000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88881fdc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000094 CR3: 0000000100cdb000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Root cause is quite complex: 1) use bfq elevator for the test device. 2) create a cgroup CG 3) config blk throtl in CG blkg_conf_prep blkg_create 4) create a thread T1 and issue async io in CG: bio_init bio_associate_blkg ... submit_bio submit_bio_noacct blk_throtl_bio -> io is throttled // io submit is done 5) switch elevator: bfq_exit_queue blkcg_deactivate_policy list_for_each_entry(blkg, &q->blkg_list, q_node) blkg->pd[] = NULL // bfq policy is removed 5) thread t1 exist, then remove the cgroup CG: blkcg_unpin_online blkcg_destroy_blkgs blkg_destroy list_del_init(&blkg->q_node) // blkg is removed from queue list 6) switch elevator back to bfq bfq_init_queue bfq_create_group_hierarchy blkcg_activate_policy list_for_each_entry_reverse(blkg, &q->blkg_list) // blkg is removed from list, hence bfq policy is still NULL 7) throttled io is dispatched to bfq: bfq_insert_requests bfq_init_rq bfq_bic_update_cgroup bfq_bio_bfqg bfqg = blkg_to_bfqg(blkg) // bfqg is NULL because bfq policy is NULL The problem is only possible in bfq because only bfq can be deactivated and activated while queue is online, while others can only be deactivated while the device is removed. Fix the problem in bfq by checking if blkg is online before calling blkg_to_bfqg(). Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20221108103434.2853269-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 2f01a612d4758b45f775dbb88a49cf534ba47275 Author: Takashi Iwai Date: Tue Nov 8 15:07:21 2022 +0100 ALSA: usb-audio: Add quirk entry for M-Audio Micro M-Audio Micro (0762:201a) defines the descriptor as vendor-specific, while the content seems class-compliant. Just overriding the probe makes the device working. Reported-by: Ash Logan Cc: Link: https://lore.kernel.org/r/7ecd4417-d860-4773-c1c1-b07433342390@heyquark.com Link: https://lore.kernel.org/r/20221108140721.24248-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit f04a2862f9c3f64962b8709c75d788efba6df26b Author: Anjana Hari Date: Thu Nov 3 11:10:51 2022 -0700 pinctrl: qcom: sc8280xp: Rectify UFS reset pins UFS reset pin offsets are wrongly configured for SC8280XP, correcting the same for both UFS instances here. Signed-off-by: Anjana Hari Signed-off-by: Bjorn Andersson Reviewed-by: Andrew Halaney Tested-by: Andrew Halaney # QDrive3 Link: https://lore.kernel.org/r/20221103181051.26912-1-quic_bjorande@quicinc.com Signed-off-by: Linus Walleij commit e0b26b9482461e9528552f54fa662c2269f75b3f Author: Ma Jun Date: Wed Sep 14 20:53:31 2022 +0800 drm/amdgpu: Fix the lpfn checking condition in drm buddy Because the value of man->size is changed during suspend/resume process, use mgr->mm.size instead of man->size here for lpfn checking. Signed-off-by: Ma Jun Suggested-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220914125331.2467162-1-Jun.Ma2@amd.com Signed-off-by: Christian König commit f0dfc4c88ef39be0ba736aa0ce6119263fc19aeb Author: Ratheesh Kannoth Date: Mon Nov 7 09:05:05 2022 +0530 octeontx2-pf: Fix SQE threshold checking Current way of checking available SQE count which is based on HW updated SQB count could result in driver submitting an SQE even before CQE for the previously transmitted SQE at the same index is processed in NAPI resulting losing SKB pointers, hence a leak. Fix this by checking a consumer index which is updated once CQE is processed. Fixes: 3ca6c4c882a7 ("octeontx2-pf: Add packet transmission support") Signed-off-by: Ratheesh Kannoth Reviewed-by: Sunil Kovvuri Goutham Link: https://lore.kernel.org/r/20221107033505.2491464-1-rkannoth@marvell.com Signed-off-by: Paolo Abeni commit b0c09c7f08c2467b2089bdf4adb2fbbc2464f4a8 Author: Zhengchao Shao Date: Mon Nov 7 09:21:59 2022 +0800 net: ethernet: mtk-star-emac: disable napi when connect and start PHY failed in mtk_star_enable() When failed to connect to and start PHY in mtk_star_enable() for opening device, napi isn't disabled. When open mtk star device next time, it will reports a invalid opcode issue. Fix it. Only be compiled, not be tested. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Zhengchao Shao Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20221107012159.211387-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 3faf7e14ec0c3462c2d747fa6793b8645d1391df Author: Zhengchao Shao Date: Mon Nov 7 09:14:45 2022 +0800 net: lapbether: fix issue of invalid opcode in lapbeth_open() If lapb_register() failed when lapb device goes to up for the first time, the NAPI is not disabled. As a result, the invalid opcode issue is reported when the lapb device goes to up for the second time. The stack info is as follows: [ 1958.311422][T11356] kernel BUG at net/core/dev.c:6442! [ 1958.312206][T11356] invalid opcode: 0000 [#1] PREEMPT SMP KASAN [ 1958.315979][T11356] RIP: 0010:napi_enable+0x16a/0x1f0 [ 1958.332310][T11356] Call Trace: [ 1958.332817][T11356] [ 1958.336135][T11356] lapbeth_open+0x18/0x90 [ 1958.337446][T11356] __dev_open+0x258/0x490 [ 1958.341672][T11356] __dev_change_flags+0x4d4/0x6a0 [ 1958.345325][T11356] dev_change_flags+0x93/0x160 [ 1958.346027][T11356] devinet_ioctl+0x1276/0x1bf0 [ 1958.346738][T11356] inet_ioctl+0x1c8/0x2d0 [ 1958.349638][T11356] sock_ioctl+0x5d1/0x750 [ 1958.356059][T11356] __x64_sys_ioctl+0x3ec/0x1790 [ 1958.365594][T11356] do_syscall_64+0x35/0x80 [ 1958.366239][T11356] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 1958.377381][T11356] Fixes: 514e1150da9c ("net: x25: Queue received packets in the drivers instead of per-CPU queues") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221107011445.207372-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit bb88f9695460bec25aa30ba9072595025cf6c8af Author: Marco Elver Date: Mon Oct 31 10:35:13 2022 +0100 perf: Improve missing SIGTRAP checking To catch missing SIGTRAP we employ a WARN in __perf_event_overflow(), which fires if pending_sigtrap was already set: returning to user space without consuming pending_sigtrap, and then having the event fire again would re-enter the kernel and trigger the WARN. This, however, seemed to miss the case where some events not associated with progress in the user space task can fire and the interrupt handler runs before the IRQ work meant to consume pending_sigtrap (and generate the SIGTRAP). syzbot gifted us this stack trace: | WARNING: CPU: 0 PID: 3607 at kernel/events/core.c:9313 __perf_event_overflow | Modules linked in: | CPU: 0 PID: 3607 Comm: syz-executor100 Not tainted 6.1.0-rc2-syzkaller-00073-g88619e77b33d #0 | Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 | RIP: 0010:__perf_event_overflow+0x498/0x540 kernel/events/core.c:9313 | <...> | Call Trace: | | perf_swevent_hrtimer+0x34f/0x3c0 kernel/events/core.c:10729 | __run_hrtimer kernel/time/hrtimer.c:1685 [inline] | __hrtimer_run_queues+0x1c6/0xfb0 kernel/time/hrtimer.c:1749 | hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811 | local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1096 [inline] | __sysvec_apic_timer_interrupt+0x17c/0x640 arch/x86/kernel/apic/apic.c:1113 | sysvec_apic_timer_interrupt+0x40/0xc0 arch/x86/kernel/apic/apic.c:1107 | asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 | <...> | In this case, syzbot produced a program with event type PERF_TYPE_SOFTWARE and config PERF_COUNT_SW_CPU_CLOCK. The hrtimer manages to fire again before the IRQ work got a chance to run, all while never having returned to user space. Improve the WARN to check for real progress in user space: approximate this by storing a 32-bit hash of the current IP into pending_sigtrap, and if an event fires while pending_sigtrap still matches the previous IP, we assume no progress (false negatives are possible given we could return to user space and trigger again on the same IP). Fixes: ca6c21327c6a ("perf: Fix missing SIGTRAPs") Reported-by: syzbot+b8ded3e2e2c6adde4990@syzkaller.appspotmail.com Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221031093513.3032814-1-elver@google.com commit fdcc4c22b7ab20e90b97f8bc6225d876b72b8f16 Author: Evan Quan Date: Tue Nov 8 16:47:46 2022 +0800 ALSA: hda/hdmi - enable runtime pm for more AMD display audio We are able to power down the GPU and audio via the GPU driver so flag these asics as supporting runtime pm. Signed-off-by: Evan Quan Cc: Link: https://lore.kernel.org/r/20221108084746.583058-1-evan.quan@amd.com Signed-off-by: Takashi Iwai commit 653f2d94fcda200b02bd79cea2e0307b26c1b747 Author: Hans de Goede Date: Sun Nov 6 22:50:52 2022 +0100 drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017) Like the Acer Switch One 10 S1003, for which there already is a quirk, the Acer Switch V 10 (SW5-017) has a 800x1280 portrait screen mounted in the tablet part of a landscape oriented 2-in-1. Add a quirk for this. Cc: Rudolf Polzer Signed-off-by: Hans de Goede Acked-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20221106215052.66995-1-hdegoede@redhat.com commit 308451d9c7fece33d9551230cb8e5eb7f3914988 Author: Hans de Goede Date: Mon Sep 19 15:32:58 2022 +0200 drm: panel-orientation-quirks: Add quirk for Nanote UMPC-01 The Nanote UMPC-01 is a mini laptop with a 1200x1920 portrait screen mounted in a landscape oriented clamshell case. Add a quirk for this. Signed-off-by: Hans de Goede Acked-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20220919133258.711639-1-hdegoede@redhat.com commit ea83ec50393a6993fa09315e4200240c938c21b3 Author: Takashi Iwai Date: Tue Nov 8 07:58:24 2022 +0100 ALSA: usb-audio: Remove redundant workaround for Roland quirk The recent fix for the delayed card registration made the current workaround for QUIRK_AUTODETECT superfluous, since the card registration itself is delayed until the last interface probe. This patch drops the redundant workaround in create_autodetect_quirks() for simplification. Fixes: 39efc9c8a973 ("ALSA: usb-audio: Fix last interface check for registration") Link: https://bugzilla.suse.com/show_bug.cgi?id=1205111 Link: https://lore.kernel.org/r/20221108065824.14418-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 971cb608d1c5d95533a43b549bb8ec9637f10043 Author: Takashi Iwai Date: Tue Nov 8 07:58:23 2022 +0100 ALSA: usb-audio: Yet more regression for for the delayed card registration Although we tried to fix the regression for the recent changes with the delayed card registration, it doesn't seem covering the all cases; e.g. on Roland EDIROL M-100FX, where the generic quirk for Roland devices is applied, it misses the card registration because the detection of the last interface (apparently for MIDI) fails. This patch is an attempt to recover from those failures by calling the card register also at the error path for the secondary interfaces. The card register condition is also extended to match with the old check in the previous patch, too (i.e. the simple check of the interface number) for catching the probe with errors. Fixes: 39efc9c8a973 ("ALSA: usb-audio: Fix last interface check for registration") Cc: Link: https://bugzilla.suse.com/show_bug.cgi?id=1205111 Link: https://lore.kernel.org/r/20221108065824.14418-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit e6d9f9ba111b56154f1b1120252aff269cebd49c Author: Jingbo Xu Date: Fri Nov 4 13:40:28 2022 +0800 erofs: get correct count for unmapped range in fscache mode For unmapped range, the returned map.m_llen is zero, and thus the calculated count is unexpected zero. Prior to the refactoring introduced by commit 1ae9470c3e14 ("erofs: clean up .read_folio() and .readahead() in fscache mode"), only the readahead routine suffers from this. With the refactoring of making .read_folio() and .readahead() calling one common routine, both read_folio and readahead have this issue now. Fix this by calculating count separately in unmapped condition. Fixes: c665b394b9e8 ("erofs: implement fscache-based data readahead") Fixes: 1ae9470c3e14 ("erofs: clean up .read_folio() and .readahead() in fscache mode") Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221104054028.52208-3-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 75e43355cbe4d5948a79bd592f2ffecb9f75f75d Author: Jingbo Xu Date: Fri Nov 4 13:40:27 2022 +0800 erofs: put metabuf in error path in fscache mode For tail packing layout, put metabuf when error is encountered. Fixes: 1ae9470c3e14 ("erofs: clean up .read_folio() and .readahead() in fscache mode") Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Reviewed-by: Jia Zhu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221104054028.52208-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit e5126de138caef0eedb3d6431059c0c5581a1a5d Author: Yue Hu Date: Fri Oct 21 16:53:25 2022 +0800 erofs: fix general protection fault when reading fragment As syzbot reported [1], the fragment feature sb flag is not set, so packed_inode != NULL needs to be checked in z_erofs_read_fragment(). [1] https://lore.kernel.org/all/0000000000002e7a8905eb841ddd@google.com/ Reported-by: syzbot+3faecbfd845a895c04cb@syzkaller.appspotmail.com Fixes: b15b2e307c3a ("erofs: support on-disk compressed fragments data") Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221021085325.25788-1-zbestahu@gmail.com Signed-off-by: Gao Xiang commit ea045fd344cb15c164e9ffc8b8cffb6883df8475 Author: Shin'ichiro Kawasaki Date: Mon Nov 7 13:02:29 2022 +0900 ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure SAT SCSI/ATA Translation specification requires SCSI SYNCHRONIZE CACHE (10) and (16) commands both shall be translated to ATA flush command. Also, ZBC Zoned Block Commands specification mandates SYNCHRONIZE CACHE (16) command support. However, libata translates only SYNCHRONIZE CACHE (10). This results in SYNCHRONIZE CACHE (16) command failures on SATA drives and then libata translation does not conform to ZBC. To avoid the failure, add support for SYNCHRONIZE CACHE (16). Signed-off-by: Shin'ichiro Kawasaki Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Damien Le Moal commit c47e6403fa099f200868d6b106701cb42d181d2b Author: Tudor Ambarus Date: Tue Oct 25 12:02:49 2022 +0300 dmaengine: at_hdmac: Check return code of dma_async_device_register dma_async_device_register() can fail, check the return code and display an error. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-16-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 28cbe5a0a46a6637adbda52337d7b2777fc04027 Author: Tudor Ambarus Date: Tue Oct 25 12:02:48 2022 +0300 dmaengine: at_hdmac: Fix impossible condition The iterator can not be greater than ATC_MAX_DSCR_TRIALS, as the for loop will stop when i == ATC_MAX_DSCR_TRIALS. While here, use the common "i" name for the iterator. Fixes: 93dce3a6434f ("dmaengine: at_hdmac: fix residue computation") Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-15-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 580ee84405c27d6ed419abe4d2b3de1968abdafd Author: Tudor Ambarus Date: Tue Oct 25 12:02:47 2022 +0300 dmaengine: at_hdmac: Don't allow CPU to reorder channel enable at_hdmac uses __raw_writel for register writes. In the absence of a barrier, the CPU may reorder the register operations. Introduce a write memory barrier so that the CPU does not reorder the channel enable, thus the start of the transfer, without making sure that all the pre-required register fields are already written. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-14-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit ef2cb4f0ce479f77607b04c4b0414bf32f863ee8 Author: Tudor Ambarus Date: Tue Oct 25 12:02:46 2022 +0300 dmaengine: at_hdmac: Fix completion of unissued descriptor in case of errors In case the controller detected an error, the code took the chance to move all the queued (submitted) descriptors to the active (issued) list. This was wrong as if there were any descriptors in the submitted list they were moved to the issued list without actually issuing them to the controller, thus a completion could be raised without even fireing the descriptor. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-13-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit ba2423633ba646e1df20e30cb3cf35495c16f173 Author: Tudor Ambarus Date: Tue Oct 25 12:02:45 2022 +0300 dmaengine: at_hdmac: Fix descriptor handling when issuing it to hardware As it was before, the descriptor was issued to the hardware without adding it to the active (issued) list. This could result in a completion of other descriptor, or/and in the descriptor never being completed. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-12-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 03ed9ba357cc78116164b90b87f45eacab60b561 Author: Tudor Ambarus Date: Tue Oct 25 12:02:44 2022 +0300 dmaengine: at_hdmac: Fix concurrency over the active list The tasklet (atc_advance_work()) did not held the channel lock when retrieving the first active descriptor, causing concurrency problems if issue_pending() was called in between. If issue_pending() was called exactly after the lock was released in the tasklet (atc_advance_work()), atc_chain_complete() could complete a descriptor for which the controller has not yet raised an interrupt. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-11-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 6ba826cbb57d675f447b59323204d1473bbd5593 Author: Tudor Ambarus Date: Tue Oct 25 12:02:43 2022 +0300 dmaengine: at_hdmac: Free the memset buf without holding the chan lock There's no need to hold the channel lock when freeing the memset buf, as the operation has already completed. Free the memset buf without holding the channel lock. Fixes: 4d112426c344 ("dmaengine: hdmac: Add memset capabilities") Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-10-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 06988949df8c3007ad82036d3606d8ae72ed9000 Author: Tudor Ambarus Date: Tue Oct 25 12:02:42 2022 +0300 dmaengine: at_hdmac: Fix concurrency over descriptor The descriptor was added to the free_list before calling the callback, which could result in reissuing of the same descriptor and calling of a single callback for both. Move the decriptor to the free list after the callback is invoked. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-9-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit c6babed879fbe82796a601bf097649e07382db46 Author: Tudor Ambarus Date: Tue Oct 25 12:02:41 2022 +0300 dmaengine: at_hdmac: Fix concurrency problems by removing atc_complete_all() atc_complete_all() had concurrency bugs, thus remove it: 1/ atc_complete_all() in its entirety was buggy, as when the atchan->queue list (the one that contains descriptors that are not yet issued to the hardware) contained descriptors, it fired just the first from the atchan->queue, but moved all the desc from atchan->queue to atchan->active_list and considered them all as fired. This could result in calling the completion of a descriptor that was not yet issued to the hardware. 2/ when in tasklet at atc_advance_work() time, atchan->active_list was queried without holding the lock of the chan. This can result in atchan->active_list concurrency problems between the tasklet and issue_pending(). Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-8-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 6e5ad28d16f082efeae3d0bd2e31f24bed218019 Author: Tudor Ambarus Date: Tue Oct 25 12:02:40 2022 +0300 dmaengine: at_hdmac: Protect atchan->status with the channel lock Now that the complete callback call was removed from device_terminate_all(), we can protect the atchan->status with the channel lock. The atomic bitops on atchan->status do not substitute proper locking on the status, as one could still modify the status after the lock was dropped in atc_terminate_all() but before the atomic bitops were executed. Fixes: 078a6506141a ("dmaengine: at_hdmac: Fix deadlocks") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-7-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit f645f85ae1104f8bd882f962ac0a69a1070076dd Author: Tudor Ambarus Date: Tue Oct 25 12:02:39 2022 +0300 dmaengine: at_hdmac: Do not call the complete callback on device_terminate_all The method was wrong because it violated the dmaengine API. For aborted transfers the complete callback should not be called. Fix the behavior and do not call the complete callback on device_terminate_all. Fixes: 808347f6a317 ("dmaengine: at_hdmac: add DMA slave transfers") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-6-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit fcd37565efdaffeac179d0f0ce980ac79bfdf569 Author: Tudor Ambarus Date: Tue Oct 25 12:02:38 2022 +0300 dmaengine: at_hdmac: Fix premature completion of desc in issue_pending Multiple calls to atc_issue_pending() could result in a premature completion of a descriptor from the atchan->active list, as the method always completed the first active descriptor from the list. Instead, issue_pending() should just take the first transaction descriptor from the pending queue, move it to active_list and start the transfer. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-5-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 8a47221fc28417ff8a32a4f92d4448a56c3cf7e1 Author: Tudor Ambarus Date: Tue Oct 25 12:02:37 2022 +0300 dmaengine: at_hdmac: Start transfer for cyclic channels in issue_pending Cyclic channels must too call issue_pending in order to start a transfer. Start the transfer in issue_pending regardless of the type of channel. This wrongly worked before, because in the past the transfer was started at tx_submit level when only a desc in the transfer list. Fixes: 53830cc75974 ("dmaengine: at_hdmac: add cyclic DMA operation support") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-4-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 7176a6a8982d311e50a7c1168868d26e65bbba19 Author: Tudor Ambarus Date: Tue Oct 25 12:02:36 2022 +0300 dmaengine: at_hdmac: Don't start transactions at tx_submit level tx_submit is supposed to push the current transaction descriptor to a pending queue, waiting for issue_pending() to be called. issue_pending() must start the transfer, not tx_submit(), thus remove atc_dostart() from atc_tx_submit(). Clients of at_xdmac that assume that tx_submit() starts the transfer must be updated and call dma_async_issue_pending() if they miss to call it. The vdbg print was moved to after the lock is released. It is desirable to do the prints without the lock held if possible, and because the if statement disappears there's no reason why to do the print while holding the lock. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-3-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit f1171bbdd2ba2a50ee64bb198a78c268a5baf5f1 Author: Tudor Ambarus Date: Tue Oct 25 12:02:35 2022 +0300 dmaengine: at_hdmac: Fix at_lli struct definition Those hardware registers are all of 32 bits, while dma_addr_t ca be of type u64 or u32 depending on CONFIG_ARCH_DMA_ADDR_T_64BIT. Force u32 to comply with what the hardware expects. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-2-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 140fd5e74a1cc7413df88c735fff5ec64d33c1d3 Author: Amelie Delaunay Date: Mon Oct 24 10:36:11 2022 +0200 dmaengine: stm32-dma: fix potential race between pause and resume When disabling dma channel, a TCF flag is set and as TCIE is enabled, an interrupt is raised. On a busy system, the interrupt may have latency and the user can ask for dmaengine_resume while stm32-dma driver has not yet managed the complete pause (backup of registers to restore state in resume). To avoid such a case, instead of waiting the interrupt to backup the registers, do it just after disabling the channel and discard Transfer Complete interrupt in case the channel is paused. Fixes: 099a9a94be0e ("dmaengine: stm32-dma: add device_pause/device_resume support") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20221024083611.132588-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit ac2b9f34f02052709aea7b34bb2a165e1853eb41 Author: Yang Yingliang Date: Thu Oct 20 14:28:27 2022 +0800 dmaengine: ti: k3-udma-glue: fix memory leak when register device fail If device_register() fails, it should call put_device() to give up reference, the name allocated in dev_set_name() can be freed in callback function kobject_cleanup(). Fixes: 5b65781d06ea ("dmaengine: ti: k3-udma-glue: Add support for K3 PKTDMA") Signed-off-by: Yang Yingliang Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20221020062827.2914148-1-yangyingliang@huawei.com Signed-off-by: Vinod Koul commit 081195d17a0c4c636da2b869bd5809d42e8cbb13 Author: Christophe JAILLET Date: Mon Oct 24 21:50:09 2022 +0200 dmaengine: mv_xor_v2: Fix a resource leak in mv_xor_v2_remove() A clk_prepare_enable() call in the probe is not balanced by a corresponding clk_disable_unprepare() in the remove function. Add the missing call. Fixes: 3cd2c313f1d6 ("dmaengine: mv_xor_v2: Fix clock resource by adding a register clock") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/e9e3837a680c9bd2438e4db2b83270c6c052d005.1666640987.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 8454f880c24bca0d9d4bfb6ed4a4a5429a4d9b20 Author: Martin Povišer Date: Wed Oct 19 15:23:23 2022 +0200 dmaengine: apple-admac: Fix grabbing of channels in of_xlate The of_xlate callback is supposed to return the channel after already having 'grabbed' it for private use, so fill that in. Fixes: b127315d9a78 ("dmaengine: apple-admac: Add Apple ADMAC driver") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20221019132324.8585-1-povik+lin@cutebit.org Signed-off-by: Vinod Koul commit 0b8c97a1d8c1bb6a853b8bb1778e8fef17b86fc9 Author: Fengqian Gao Date: Fri Sep 30 11:28:35 2022 +0800 dmaengine: idxd: fix RO device state error after been disabled/reset When IDXD is not configurable, that means its WQ, engine, and group configurations cannot be changed. But it can be disabled and its state should be set as disabled regardless it's configurable or not. Fix this by setting device state IDXD_DEV_DISABLED for read-only device as well in idxd_device_clear_state(). Fixes: cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal") Signed-off-by: Fengqian Gao Reviewed-by: Xiaochen Shen Reviewed-by: Dave Jiang Reviewed-by: Fenghua Yu Link: https://lore.kernel.org/r/20220930032835.2290-1-fengqian.gao@intel.com Signed-off-by: Vinod Koul commit e8dbd6445dd6b38c4c50410a86f13158486ee99a Author: Xiaochen Shen Date: Sat Oct 1 04:15:27 2022 +0800 dmaengine: idxd: Fix max batch size for Intel IAA >From Intel IAA spec [1], Intel IAA does not support batch processing. Two batch related default values for IAA are incorrect in current code: (1) The max batch size of device is set during device initialization, that indicates batch is supported. It should be always 0 on IAA. (2) The max batch size of work queue is set to WQ_DEFAULT_MAX_BATCH (32) as the default value regardless of Intel DSA or IAA device during work queue setup and cleanup. It should be always 0 on IAA. Fix the issues by setting the max batch size of device and max batch size of work queue to 0 on IAA device, that means batch is not supported. [1]: https://cdrdv2.intel.com/v1/dl/getContent/721858 Fixes: 23084545dbb0 ("dmaengine: idxd: set max_xfer and max_batch for RO device") Fixes: 92452a72ebdf ("dmaengine: idxd: set defaults for wq configs") Fixes: bfe1d56091c1 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: Xiaochen Shen Reviewed-by: Dave Jiang Reviewed-by: Fenghua Yu Link: https://lore.kernel.org/r/20220930201528.18621-2-xiaochen.shen@intel.com Signed-off-by: Vinod Koul commit b3d726cb8497c6b12106fd617d46eef11763ea86 Author: Doug Brown Date: Mon Sep 5 17:07:09 2022 -0700 dmaengine: pxa_dma: use platform_get_irq_optional The first IRQ is required, but IRQs 1 through (nb_phy_chans - 1) are optional, because on some platforms (e.g. PXA168) there is a single IRQ shared between all channels. This change inhibits a flood of "IRQ index # not found" messages at startup. Tested on a PXA168-based device. Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()") Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220906000709.52705-1-doug@schmorgal.com Signed-off-by: Vinod Koul commit 89bbe785b4d196cc3d00056adc58da8484a824a1 Merge: 1c075b192fe41 2f201ae14ae0f Author: Jakub Kicinski Date: Mon Nov 7 19:59:05 2022 -0800 Merge branch 'sctp-fix-a-null-pointer-dereference-in-sctp_sched_dequeue_common' Xin Long says: ==================== sctp: fix a NULL pointer dereference in sctp_sched_dequeue_common This issue was triggered with SCTP_PR_SCTP_PRIO in sctp, and caused by not checking and fixing stream->out_curr after removing a chunk from this stream. Patch 1 removes an unnecessary check and makes the real fix easier to add in Patch 2. ==================== Link: https://lore.kernel.org/r/cover.1667598261.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 2f201ae14ae0f91dbf1cffea7bb1e29e81d4d108 Author: Xin Long Date: Fri Nov 4 17:45:16 2022 -0400 sctp: clear out_curr if all frag chunks of current msg are pruned A crash was reported by Zhen Chen: list_del corruption, ffffa035ddf01c18->next is NULL WARNING: CPU: 1 PID: 250682 at lib/list_debug.c:49 __list_del_entry_valid+0x59/0xe0 RIP: 0010:__list_del_entry_valid+0x59/0xe0 Call Trace: sctp_sched_dequeue_common+0x17/0x70 [sctp] sctp_sched_fcfs_dequeue+0x37/0x50 [sctp] sctp_outq_flush_data+0x85/0x360 [sctp] sctp_outq_uncork+0x77/0xa0 [sctp] sctp_cmd_interpreter.constprop.0+0x164/0x1450 [sctp] sctp_side_effects+0x37/0xe0 [sctp] sctp_do_sm+0xd0/0x230 [sctp] sctp_primitive_SEND+0x2f/0x40 [sctp] sctp_sendmsg_to_asoc+0x3fa/0x5c0 [sctp] sctp_sendmsg+0x3d5/0x440 [sctp] sock_sendmsg+0x5b/0x70 and in sctp_sched_fcfs_dequeue() it dequeued a chunk from stream out_curr outq while this outq was empty. Normally stream->out_curr must be set to NULL once all frag chunks of current msg are dequeued, as we can see in sctp_sched_dequeue_done(). However, in sctp_prsctp_prune_unsent() as it is not a proper dequeue, sctp_sched_dequeue_done() is not called to do this. This patch is to fix it by simply setting out_curr to NULL when the last frag chunk of current msg is dequeued from out_curr stream in sctp_prsctp_prune_unsent(). Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations") Reported-by: Zhen Chen Tested-by: Caowangbao Signed-off-by: Xin Long Signed-off-by: Jakub Kicinski commit 9f0b773210c27a8f5d98ddb2fc4ba60a42a3285f Author: Xin Long Date: Fri Nov 4 17:45:15 2022 -0400 sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent Since commit 5bbbbe32a431 ("sctp: introduce stream scheduler foundations"), sctp_stream_outq_migrate() has been called in sctp_stream_init/update to removes those chunks to streams higher than the new max. There is no longer need to do such check in sctp_prsctp_prune_unsent(). Signed-off-by: Xin Long Signed-off-by: Jakub Kicinski commit 1c075b192fe41030457cd4a5f7dea730412bca40 Author: Xin Long Date: Fri Nov 4 16:48:53 2022 -0400 tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header This is a follow-up for commit 974cb0e3e7c9 ("tipc: fix uninit-value in tipc_nl_compat_name_table_dump") where it should have type casted sizeof(..) to int to work when TLV_GET_DATA_LEN() returns a negative value. syzbot reported a call trace because of it: BUG: KMSAN: uninit-value in ... tipc_nl_compat_name_table_dump+0x841/0xea0 net/tipc/netlink_compat.c:934 __tipc_nl_compat_dumpit+0xab2/0x1320 net/tipc/netlink_compat.c:238 tipc_nl_compat_dumpit+0x991/0xb50 net/tipc/netlink_compat.c:321 tipc_nl_compat_recv+0xb6e/0x1640 net/tipc/netlink_compat.c:1324 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline] genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x103f/0x1260 net/netlink/genetlink.c:792 netlink_rcv_skb+0x3a5/0x6c0 net/netlink/af_netlink.c:2501 genl_rcv+0x3c/0x50 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0xf3b/0x1270 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x1288/0x1440 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] Reported-by: syzbot+e5dbaaa238680ce206ea@syzkaller.appspotmail.com Fixes: 974cb0e3e7c9 ("tipc: fix uninit-value in tipc_nl_compat_name_table_dump") Signed-off-by: Xin Long Link: https://lore.kernel.org/r/ccd6a7ea801b15aec092c3b532a883b4c5708695.1667594933.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit ecb8c2580d37dbb641451049376d80c8afaa387f Author: Bart Van Assche Date: Wed Nov 2 12:32:48 2022 -0700 scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC From ZBC-1: - RC BASIS = 0: The RETURNED LOGICAL BLOCK ADDRESS field indicates the highest LBA of a contiguous range of zones that are not sequential write required zones starting with the first zone. - RC BASIS = 1: The RETURNED LOGICAL BLOCK ADDRESS field indicates the LBA of the last logical block on the logical unit. The current scsi_debug READ CAPACITY response does not comply with the above if there are one or more sequential write required zones. SCSI initiators need a way to retrieve the largest valid LBA from SCSI devices. Reporting the largest valid LBA if there are one or more sequential zones requires to set the RC BASIS field in the READ CAPACITY response to one. Hence this patch. Cc: Douglas Gilbert Cc: Damien Le Moal Suggested-by: Damien Le Moal Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20221102193248.3177608-1-bvanassche@acm.org Reviewed-by: Damien Le Moal Acked-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 8d820bc9d12b8beebca836cceaf2bbe68216c2f8 Author: YueHaibing Date: Sat Nov 5 17:02:45 2022 +0800 net: broadcom: Fix BCMGENET Kconfig While BCMGENET select BROADCOM_PHY as y, but PTP_1588_CLOCK_OPTIONAL is m, kconfig warning and build errors: WARNING: unmet direct dependencies detected for BROADCOM_PHY Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && PTP_1588_CLOCK_OPTIONAL [=m] Selected by [y]: - BCMGENET [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_BROADCOM [=y] && HAS_IOMEM [=y] && ARCH_BCM2835 [=y] drivers/net/phy/broadcom.o: In function `bcm54xx_suspend': broadcom.c:(.text+0x6ac): undefined reference to `bcm_ptp_stop' drivers/net/phy/broadcom.o: In function `bcm54xx_phy_probe': broadcom.c:(.text+0x784): undefined reference to `bcm_ptp_probe' drivers/net/phy/broadcom.o: In function `bcm54xx_config_init': broadcom.c:(.text+0xd4c): undefined reference to `bcm_ptp_config_init' Fixes: 99addbe31f55 ("net: broadcom: Select BROADCOM_PHY for BCMGENET") Signed-off-by: YueHaibing Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20221105090245.8508-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 02f5999e652952d69c341a03d4313310703fd7f1 Author: Yang Yingliang Date: Sat Nov 5 14:34:42 2022 +0800 octeontx2-pf: fix build error when CONFIG_OCTEONTX2_PF=y If CONFIG_MACSEC=m and CONFIG_OCTEONTX2_PF=y, it leads a build error: ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_pfaf_mbox_up_handler': otx2_pf.c:(.text+0x181c): undefined reference to `cn10k_handle_mcs_event' ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_probe': otx2_pf.c:(.text+0x437e): undefined reference to `cn10k_mcs_init' ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_remove': otx2_pf.c:(.text+0x5031): undefined reference to `cn10k_mcs_free' ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_mbox_up_handler_mcs_intr_notify': otx2_pf.c:(.text+0x5f11): undefined reference to `cn10k_handle_mcs_event' Make CONFIG_OCTEONTX2_PF depends on CONFIG_MACSEC to fix it. Because it has empty stub functions of cn10k, CONFIG_OCTEONTX2_PF can be enabled if CONFIG_MACSEC is disabled Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Reported-by: kernel test robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221105063442.2013981-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit ec683f02a150b9c4428f08accd387c8c216ea0e5 Author: Miquel Raynal Date: Fri Nov 4 17:21:47 2022 +0100 dt-bindings: net: tsnep: Fix typo on generic nvmem property While working on the nvmem description I figured out this file had the "nvmem-cell-names" property name misspelled. Fix the typo, as "nvmem-cells-names" has never existed. Fixes: 603094b2cdb7 ("dt-bindings: net: Add tsnep Ethernet controller") Signed-off-by: Miquel Raynal Reviewed-by: Gerhard Engleder Acked-by: Rob Herring Link: https://lore.kernel.org/r/20221104162147.1288230-1-miquel.raynal@bootlin.com Signed-off-by: Jakub Kicinski commit 5d7bebf2dfb0dc97aac1fbace0910e557ecdb16f Author: Yang Yingliang Date: Mon Nov 7 20:48:28 2022 +0800 scsi: scsi_transport_sas: Fix error handling in sas_phy_add() If transport_add_device() fails in sas_phy_add(), the kernel will crash trying to delete the device in transport_remove_device() called from sas_remove_host(). Unable to handle kernel NULL pointer dereference at virtual address 0000000000000108 CPU: 61 PID: 42829 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc1+ #173 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x54/0x3d0 lr : device_del+0x37c/0x3d0 Call trace: device_del+0x54/0x3d0 attribute_container_class_device_del+0x28/0x38 transport_remove_classdev+0x6c/0x80 attribute_container_device_trigger+0x108/0x110 transport_remove_device+0x28/0x38 sas_phy_delete+0x30/0x60 [scsi_transport_sas] do_sas_phy_delete+0x6c/0x80 [scsi_transport_sas] device_for_each_child+0x68/0xb0 sas_remove_children+0x40/0x50 [scsi_transport_sas] sas_remove_host+0x20/0x38 [scsi_transport_sas] hisi_sas_remove+0x40/0x68 [hisi_sas_main] hisi_sas_v2_remove+0x20/0x30 [hisi_sas_v2_hw] platform_remove+0x2c/0x60 Fix this by checking and handling return value of transport_add_device() in sas_phy_add(). Fixes: c7ebbbce366c ("[SCSI] SAS transport class") Suggested-by: John Garry Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221107124828.115557-1-yangyingliang@huawei.com Reviewed-by: John Garry Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen commit ed4314f7729714d788698ade4f9905ee5378ebc0 Author: Rasmus Villemoes Date: Fri Nov 4 09:30:04 2022 +0100 net: stmmac: dwmac-meson8b: fix meson8b_devm_clk_prepare_enable() There are two problems with meson8b_devm_clk_prepare_enable(), introduced in commit a54dc4a49045 ("net: stmmac: dwmac-meson8b: Make the clock enabling code re-usable"): - It doesn't pass the clk argument, but instead always the rgmii_tx_clk of the device. - It silently ignores the return value of devm_add_action_or_reset(). The former didn't become an actual bug until another user showed up in the next commit 9308c47640d5 ("net: stmmac: dwmac-meson8b: add support for the RX delay configuration"). The latter means the callers could end up with the clock not actually prepared/enabled. Fixes: a54dc4a49045 ("net: stmmac: dwmac-meson8b: Make the clock enabling code re-usable") Signed-off-by: Rasmus Villemoes Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20221104083004.2212520-1-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit a679120edfcf3d63f066f53afd425d51b480e533 Author: Nathan Chancellor Date: Mon Nov 7 10:07:11 2022 -0700 bpf: Add explicit cast to 'void *' for __BPF_DISPATCHER_UPDATE() When building with clang: kernel/bpf/dispatcher.c:126:33: error: pointer type mismatch ('void *' and 'unsigned int (*)(const void *, const struct bpf_insn *, bpf_func_t)' (aka 'unsigned int (*)(const void *, const struct bpf_insn *, unsigned int (*)(const void *, const struct bpf_insn *))')) [-Werror,-Wpointer-type-mismatch] __BPF_DISPATCHER_UPDATE(d, new ?: &bpf_dispatcher_nop_func); ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/bpf.h:1045:54: note: expanded from macro '__BPF_DISPATCHER_UPDATE' __static_call_update((_d)->sc_key, (_d)->sc_tramp, (_new)) ^~~~ 1 error generated. The warning is pointing out that the type of new ('void *') and &bpf_dispatcher_nop_func are not compatible, which could have side effects coming out of a conditional operator due to promotion rules. Add the explicit cast to 'void *' to make it clear that this is expected, as __BPF_DISPATCHER_UPDATE() expands to a call to __static_call_update(), which expects a 'void *' as its final argument. Fixes: c86df29d11df ("bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)") Link: https://github.com/ClangBuiltLinux/linux/issues/1755 Reported-by: kernel test robot Reported-by: "kernelci.org bot" Signed-off-by: Nathan Chancellor Acked-by: Björn Töpel Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20221107170711.42409-1-nathan@kernel.org Signed-off-by: Martin KaFai Lau commit 59f2f4b8a757412fce372f6d0767bdb55da127a8 Author: Liam Howlett Date: Mon Nov 7 20:11:42 2022 +0000 fs/userfaultfd: Fix maple tree iterator in userfaultfd_unregister() When iterating the VMAs, the maple state needs to be invalidated if the tree is modified by a split or merge to ensure the maple tree node contained in the maple state is still valid. These invalidations were missed, so add them to the paths which alter the tree. Reported-by: syzbot+0d2014e4da2ccced5b41@syzkaller.appspotmail.com Fixes: 69dbe6daf104 (userfaultfd: use maple tree iterator to iterate VMAs) Signed-off-by: Liam R. Howlett Signed-off-by: Linus Torvalds commit 62fa3ce05d5d73c5eccc40b2db493f55fecfc446 Author: Brian King Date: Wed Oct 26 13:13:56 2022 -0500 scsi: ibmvfc: Avoid path failures during live migration Fix an issue reported when performing a live migration when multipath is configured with a short fast fail timeout of 5 seconds and also to have no_path_retry set to fail. In this scenario, all paths would go into the devloss state while the ibmvfc driver went through discovery to log back in. On a loaded system, the discovery might take longer than 5 seconds, which was resulting in all paths being marked failed, which then resulted in a read only filesystem. This patch changes the migration code in ibmvfc to avoid deleting rports at all in this scenario, so we avoid losing all paths. Signed-off-by: Brian King Link: https://lore.kernel.org/r/20221026181356.148517-1-brking@linux.vnet.ibm.com Signed-off-by: Martin K. Petersen commit e13757f52496444b994a7ac67b6e517a15d89bbc Author: Hans de Goede Date: Mon Nov 7 10:30:41 2022 -0800 Input: soc_button_array - add Acer Switch V 10 to dmi_use_low_level_irq[] Like on the Acer Switch 10 SW5-012, the Acer Switch V 10 SW5-017's _LID method messes with home- and power-button GPIO IRQ settings, causing an IRQ storm. Add a quirk entry for the Acer Switch V 10 to the dmi_use_low_level_irq[] DMI quirk list, to use low-level IRQs on this model, fixing the IRQ storm. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20221106215320.67109-2-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 8e9ada1d0e72b4737df400fe1bba48dc42a68df7 Author: Hans de Goede Date: Mon Nov 7 10:30:25 2022 -0800 Input: soc_button_array - add use_low_level_irq module parameter It seems that the Windows drivers for the ACPI0011 soc_button_array device use low level triggered IRQs rather then using edge triggering. Some ACPI tables depend on this, directly poking the GPIO controller's registers to clear the trigger type when closing a laptop's/2-in-1's lid and re-instating the trigger when opening the lid again. Linux sets the edge/level on which to trigger to both low+high since it is using edge type IRQs, the ACPI tables then ends up also setting the bit for level IRQs and since both low and high level have been selected by Linux we get an IRQ storm leading to soft lockups. As a workaround for this the soc_button_array already contains a DMI quirk table with device models known to have this issue. Add a module parameter for this so that users can easily test if their device is affected too and so that they can use the module parameter as a workaround. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20221106215320.67109-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit b8ebf250997c5fb253582f42bfe98673801ebebd Author: Tetsuo Handa Date: Mon Nov 7 10:21:40 2022 -0800 Input: iforce - invert valid length check when fetching device IDs syzbot is reporting uninitialized value at iforce_init_device() [1], for commit 6ac0aec6b0a6 ("Input: iforce - allow callers supply data buffer when fetching device IDs") is checking that valid length is shorter than bytes to read. Since iforce_get_id_packet() stores valid length when returning 0, the caller needs to check that valid length is longer than or equals to bytes to read. Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 6ac0aec6b0a6 ("Input: iforce - allow callers supply data buffer when fetching device IDs") Link: https://lore.kernel.org/r/531fb432-7396-ad37-ecba-3e42e7f56d5c@I-love.SAKURA.ne.jp Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit a1de832bd3243577de365222d8bc92708005ebf3 Merge: f0c4d9fc9cc94 53eb64c88f17b Author: Linus Torvalds Date: Mon Nov 7 10:19:04 2022 -0800 Merge tag 'platform-drivers-x86-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "The most important fixes here are a set of fixes for the ACPI backlight detection refactor which landed in 6.1. These fix regressions reported on some laptop models by making acpi_video_backlight_use_native() always return true for now, which in essence undoes some of the changes. I plan to take another shot at having only 1 /sys/class/backlight class device per panel with 6.2, with modified detection heuristics to avoid the (known) regressions. Highlights: - ACPI: video: Fix regressions from 6.1 backlight refactor by making acpi_video_backlight_use_native() always return true for now - Misc other bugfixes and HW id additions" * tag 'platform-drivers-x86-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: p2sb: Don't fail if unknown CPU is found platform/x86/intel/hid: Add some ACPI device IDs platform/x86/intel/pmt: Sapphire Rapids PMT errata fix platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi platform/x86: touchscreen_dmi: Add info for the RCA Cambio W101 v2 2-in-1 platform/x86: ideapad-laptop: Disable touchpad_switch ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 ACPI: video: Make acpi_video_backlight_use_native() always return true ACPI: video: Improve Chromebook checks commit f6b1a1cf1c3ee430d3f5e47847047ce789a690aa Author: Baokun Li Date: Thu Sep 22 20:04:34 2022 +0800 ext4: fix use-after-free in ext4_ext_shift_extents If the starting position of our insert range happens to be in the hole between the two ext4_extent_idx, because the lblk of the ext4_extent in the previous ext4_extent_idx is always less than the start, which leads to the "extent" variable access across the boundary, the following UAF is triggered: ================================================================== BUG: KASAN: use-after-free in ext4_ext_shift_extents+0x257/0x790 Read of size 4 at addr ffff88819807a008 by task fallocate/8010 CPU: 3 PID: 8010 Comm: fallocate Tainted: G E 5.10.0+ #492 Call Trace: dump_stack+0x7d/0xa3 print_address_description.constprop.0+0x1e/0x220 kasan_report.cold+0x67/0x7f ext4_ext_shift_extents+0x257/0x790 ext4_insert_range+0x5b6/0x700 ext4_fallocate+0x39e/0x3d0 vfs_fallocate+0x26f/0x470 ksys_fallocate+0x3a/0x70 __x64_sys_fallocate+0x4f/0x60 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ================================================================== For right shifts, we can divide them into the following situations: 1. When the first ee_block of ext4_extent_idx is greater than or equal to start, make right shifts directly from the first ee_block. 1) If it is greater than start, we need to continue searching in the previous ext4_extent_idx. 2) If it is equal to start, we can exit the loop (iterator=NULL). 2. When the first ee_block of ext4_extent_idx is less than start, then traverse from the last extent to find the first extent whose ee_block is less than start. 1) If extent is still the last extent after traversal, it means that the last ee_block of ext4_extent_idx is less than start, that is, start is located in the hole between idx and (idx+1), so we can exit the loop directly (break) without right shifts. 2) Otherwise, make right shifts at the corresponding position of the found extent, and then exit the loop (iterator=NULL). Fixes: 331573febb6a ("ext4: Add support FALLOC_FL_INSERT_RANGE for fallocate") Cc: stable@vger.kernel.org # v4.2+ Signed-off-by: Zhihao Cheng Signed-off-by: Baokun Li Link: https://lore.kernel.org/r/20220922120434.1294789-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit c18c20f16219516b12a4f2fd29c25e06be97e064 Author: Vlastimil Babka Date: Mon Nov 7 17:11:27 2022 +0100 mm, slab: remove duplicate kernel-doc comment for ksize() Akira reports: > "make htmldocs" reports duplicate C declaration of ksize() as follows: > /linux/Documentation/core-api/mm-api:43: ./mm/slab_common.c:1428: WARNING: Duplicate C declaration, also defined at core-api/mm-api:212. > Declaration is '.. c:function:: size_t ksize (const void *objp)'. > This is due to the kernel-doc comment for ksize() declaration added in > include/linux/slab.h by commit 05a940656e1e ("slab: Introduce > kmalloc_size_roundup()"). There is an older kernel-doc comment for ksize() definition in mm/slab_common.c, which is not only duplicated, but also contradicts the new one - the additional storage discovered by ksize() should not be used by callers anymore. Delete the old kernel-doc. Reported-by: Akira Yokosawa Link: https://lore.kernel.org/all/d33440f6-40cf-9747-3340-e54ffaf7afb8@gmail.com/ Fixes: 05a940656e1e ("slab: Introduce kmalloc_size_roundup()") Cc: Kees Cook Signed-off-by: Vlastimil Babka commit c717b9b7d6de9e024e47f7cd5bbff49f581d3db9 Author: Krzysztof Kozlowski Date: Mon Nov 7 10:15:20 2022 +0100 mtd: onenand: omap2: add dependency on GPMC OMAP2 OneNAND driver uses gpmc_omap_onenand_set_timings() provided by OMAP_GPMC driver, so the latter cannot be module if OneNAND driver is built-in: /usr/bin/arm-linux-gnueabi-ld: drivers/mtd/nand/onenand/onenand_omap2.o: in function `omap2_onenand_probe': onenand_omap2.c:(.text+0x520): undefined reference to `gpmc_omap_onenand_set_timings' The OMAP_GPMC is also a runtime dependency. Reported-by: kernel test robot Fixes: 854fd9209b20 ("memory: omap-gpmc: Allow building as a module") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221107091520.127053-1-krzysztof.kozlowski@linaro.org commit 83f0869e9bf3333d778d62f055b0f8e1de1cc812 Author: Adam Borowski Date: Mon Oct 24 11:20:26 2022 +0200 mtd: rawnand: placate "$VARIABLE is used uninitialized" warnings The compiler is not smart enough to notice that it's impossible for them to be actually used uninitialized. Which exact variables trip here varies depending on random surrounding code; none triggered in 6.1-rc1 but 6.1-rc2 fails on three of these five, despite variables declared in the very same line having identical flow. Signed-off-by: Adam Borowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221024092026.42123-1-kilobyte@angband.pl commit 7df140e84a75c89962feef659d686303d3ce75e5 Author: Christian Marangi Date: Fri Oct 21 18:53:04 2022 +0200 mtd: rawnand: qcom: handle ret from parse with codeword_fixup With use_codeword_fixup enabled, any return from mtd_device_parse_register gets overwritten. Aside from the clear bug, this is also problematic as a parser can EPROBE_DEFER and because this is not correctly handled, the nand is never rescanned later in the bootup process. An example of this problem is when smem requires additional time to be probed and nandc use qcomsmempart as parser. Parser will return EPROBE_DEFER but in the current code this ret gets overwritten by qcom_nand_host_parse_boot_partitions and qcom_nand_host_init_and_register return 0. Correctly handle the return code from mtd_device_parse_register so that any error from this function is not ignored. Fixes: 862bdedd7f4b ("mtd: nand: raw: qcom_nandc: add support for unprotected spare data pages") Cc: stable@vger.kernel.org # v6.0+ Signed-off-by: Christian Marangi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221021165304.19991-1-ansuelsmth@gmail.com commit c4299907c09a638c0a30f029338d07941c049d73 Author: Steven Price Date: Thu Nov 3 11:40:36 2022 +0000 drm/panfrost: Remove type name from internal struct again Commit 72655fb942c1 ("drm/panfrost: replace endian-specific types with native ones") accidentally reverted part of the parent commit 7228d9d79248 ("drm/panfrost: Remove type name from internal structs") leading to the situation that the Panfrost UAPI header still doesn't compile correctly in C++. Revert the accidental revert and pass me a brown paper bag. Reported-by: Alyssa Rosenzweig Fixes: 72655fb942c1 ("drm/panfrost: replace endian-specific types with native ones") Signed-off-by: Steven Price Reviewed-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20221103114036.1581854-1-steven.price@arm.com commit bee55f2e7a44e7a7676e264b42f026e34bd244d9 Author: Quentin Schulz Date: Tue Oct 18 14:17:23 2022 +0200 pinctrl: rockchip: list all pins in a possible mux route for PX30 The mux routes are incomplete for the PX30. This was discovered because we had a HW design using cif-clkoutm1 with the correct pinmux in the Device Tree but the clock would still not work. There are actually two muxing required: the pin muxing (performed by the usual Device Tree pinctrl nodes) and the "function" muxing (m0 vs m1; performed by the mux routing inside the driver). The pin muxing was correct but the function muxing was not. This adds the missing pins and their configuration for the mux routes that are already specified in the driver. Note that there are some "conflicts": it is possible *in Device Tree* to (attempt to) mux the pins for e.g. clkoutm1 and clkinm0 at the same time but this is actually not possible in hardware (because both share the same bit for the function muxing). Since it is an impossible hardware design, it is not deemed necessary to prevent the user from attempting to "misconfigure" the pins/functions. Fixes: 87065ca9b8e5 ("pinctrl: rockchip: Add pinctrl support for PX30") Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20221017-upstream-px30-cif-clkoutm1-v1-0-4ea1389237f7@theobroma-systems.com Signed-off-by: Linus Walleij commit 4854e8b083d800b421c02d3a8482fbfe27fb33ec Author: Inbaraj E Date: Mon Nov 7 18:13:37 2022 +0530 dt-bindings: clock: exynosautov9: fix reference to CMU_FSYS1 Fix reference to CMU_FSYS1 mmc card clock to gout clock instead of dout. "gout" is output of a gate clock. Unlike any other clocks, the fsys1 mmc top clock does not have a divider, so it should be "mout -> gout" instead of "mout -> gout -> dout". This fixes make dtbs_check warning as shown below: arch/arm64/boot/dts/exynos/exynosautov9-sadk.dtb: clock-controller@17040000: clock-names:2: 'dout_clkcmu_fsys1_mmc_card' was expected Fixes: 4b6ec8d88623 ("dt-bindings: clock: exynosautov9: add schema for cmu_fsys0/1") Reviewed-by: Chanho Park Signed-off-by: Inbaraj E Link: https://lore.kernel.org/r/20221107124337.114135-1-inbaraj.e@samsung.com Signed-off-by: Krzysztof Kozlowski commit 340a982825f76f1cff0daa605970fe47321b5ee7 Author: Giulio Benetti Date: Fri Nov 4 21:46:18 2022 +0100 ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation Actually in no-MMU SoCs(i.e. i.MXRT) ZERO_PAGE(vaddr) expands to ``` virt_to_page(0) ``` that in order expands to: ``` pfn_to_page(virt_to_pfn(0)) ``` and then virt_to_pfn(0) to: ``` ((((unsigned long)(0) - PAGE_OFFSET) >> PAGE_SHIFT) + PHYS_PFN_OFFSET) ``` where PAGE_OFFSET and PHYS_PFN_OFFSET are the DRAM offset(0x80000000) and PAGE_SHIFT is 12. This way we obtain 16MB(0x01000000) summed to the base of DRAM(0x80000000). When ZERO_PAGE(0) is then used, for example in bio_add_page(), the page gets an address that is out of DRAM bounds. So instead of using fake virtual page 0 let's allocate a dedicated zero_page during paging_init() and assign it to a global 'struct page * empty_zero_page' the same way mmu.c does and it's the same approach used in m68k with commit dc068f462179 as discussed here[0]. Then let's move ZERO_PAGE() definition to the top of pgtable.h to be in common between mmu.c and nommu.c. [0]: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#m1266ceb63 ad140743174d6b3070364d3c9a5179b Signed-off-by: Giulio Benetti Reviewed-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 612695bccfdbd52004551308a55bae410e7cd22f Author: Tomislav Novak Date: Mon Sep 26 16:09:12 2022 +0100 ARM: 9251/1: perf: Fix stacktraces for tracepoint events in THUMB2 kernels Store the frame address where arm_get_current_stackframe() looks for it (ARM_r7 instead of ARM_fp if CONFIG_THUMB2_KERNEL=y). Otherwise frame->fp gets set to 0, causing unwind_frame() to fail. # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }' Attaching 1 probe... @[ __schedule+1059 ]: 1 A typical first unwind instruction is 0x97 (SP = R7), so after executing it SP ends up being 0 and -URC_FAILURE is returned. unwind_frame(pc = ac9da7d7 lr = 00000000 sp = c69bdda0 fp = 00000000) unwind_find_idx(ac9da7d7) unwind_exec_insn: insn = 00000097 unwind_exec_insn: fp = 00000000 sp = 00000000 lr = 00000000 pc = 00000000 With this patch: # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }' Attaching 1 probe... @[ __schedule+1059 __schedule+1059 schedule+79 schedule_hrtimeout_range_clock+163 schedule_hrtimeout_range+17 ep_poll+471 SyS_epoll_wait+111 sys_epoll_pwait+231 __ret_fast_syscall+1 ]: 1 Link: https://lore.kernel.org/r/20220920230728.2617421-1-tnovak@fb.com/ Reviewed-by: Linus Walleij Signed-off-by: Tomislav Novak Signed-off-by: Russell King (Oracle) commit 89cdb224f2abe37ec4ac21ba0d9ddeb5a6a9cf68 Author: Zhu Ning Date: Fri Oct 28 10:04:56 2022 +0800 ASoC: sof_es8336: reduce pop noise on speaker The Speaker GPIO needs to be turned on slightly behind the codec turned on. It also need to be turned off slightly before the codec turned down. Current code uses delay in DAPM_EVENT to do it but the mdelay delays the DAPM itself and thus has no effect. A delayed_work is added to turn on the speaker. The Speaker is turned off in .trigger since trigger is called slightly before the DAPM events. Signed-off-by: Zhu Ning ------------ v1: cancel delayed work while disabling speaker. Link: https://lore.kernel.org/r/20221028020456.90286-1-zhuning0077@gmail.com Signed-off-by: Mark Brown commit 3d59eaef49ca2db581156a7b77c9afc0546eefc0 Author: Peter Ujfalusi Date: Mon Nov 7 11:04:33 2022 +0200 ASoC: SOF: topology: No need to assign core ID if token parsing failed Move the return value check before attempting to assign the core ID to the swidget since we are going to fail the sof_widget_ready() and free up swidget anyways. Fixes: 909dadf21aae ("ASoC: SOF: topology: Make DAI widget parsing IPC agnostic") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20221107090433.5146-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 314d34fe7f0a5836cb0472950c1f17744b4efde8 Author: Chen Zhongjin Date: Mon Oct 31 21:40:31 2022 +0800 ASoC: soc-utils: Remove __exit for snd_soc_util_exit() snd_soc_util_exit() is called in __init snd_soc_init() for cleanup. Remove the __exit annotation for it to fix the build warning: WARNING: modpost: sound/soc/snd-soc-core.o: section mismatch in reference: init_module (section: .init.text) -> snd_soc_util_exit (section: .exit.text) Fixes: 6ec27c53886c ("ASoC: core: Fix use-after-free in snd_soc_exit()") Signed-off-by: Chen Zhongjin Link: https://lore.kernel.org/r/20221031134031.256511-1-chenzhongjin@huawei.com Signed-off-by: Mark Brown commit c62f6bec53e63b11112e1ebce6bbaa39ce6f6706 Author: Johannes Thumshirn Date: Fri Nov 4 07:12:35 2022 -0700 btrfs: zoned: fix locking imbalance on scrub If we're doing device replace on a zoned filesystem and discover in scrub_enumerate_chunks() that we don't have to copy the block group it is unlocked before it gets skipped. But as the block group hasn't yet been locked before it leads to a locking imbalance. To fix this simply remove the unlock. This was uncovered by fstests' testcase btrfs/163. Fixes: 9283b9e09a6d ("btrfs: remove lock protection for BLOCK_GROUP_FLAG_TO_COPY") Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit a8d1b1647bf8244a5f270538e9e636e2657fffa3 Author: Johannes Thumshirn Date: Fri Nov 4 07:12:34 2022 -0700 btrfs: zoned: initialize device's zone info for seeding When performing seeding on a zoned filesystem it is necessary to initialize each zoned device's btrfs_zoned_device_info structure, otherwise mounting the filesystem will cause a NULL pointer dereference. This was uncovered by fstests' testcase btrfs/163. CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit 21e61ec6d0bb786818490e926aa9aeb4de95ad0d Author: Johannes Thumshirn Date: Fri Nov 4 07:12:33 2022 -0700 btrfs: zoned: clone zoned device info when cloning a device When cloning a btrfs_device, we're not cloning the associated btrfs_zoned_device_info structure of the device in case of a zoned filesystem. Later on this leads to a NULL pointer dereference when accessing the device's zone_info for instance when setting a zone as active. This was uncovered by fstests' testcase btrfs/161. CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit b75b51f886e9dd8cdfca1392ad43f4e542611c00 Author: Qu Wenruo Date: Mon Nov 7 07:23:26 2022 +0800 Revert "btrfs: scrub: use larger block size for data extent scrub" This reverts commit 786672e9e1a39a231806313e3c445c236588ceef. [BUG] Since commit 786672e9e1a3 ("btrfs: scrub: use larger block size for data extent scrub"), btrfs scrub no longer reports errors if the corruption is not in the first sector of a STRIPE_LEN. The following script can expose the problem: mkfs.btrfs -f $dev mount $dev $mnt xfs_io -f -c "pwrite -S 0xff 0 8k" $mnt/foobar umount $mnt # 13631488 is the logical bytenr of above 8K extent btrfs-map-logical -l 13631488 -b 4096 $dev mirror 1 logical 13631488 physical 13631488 device /dev/test/scratch1 # Corrupt the 2nd sector of that extent xfs_io -f -c "pwrite -S 0x00 13635584 4k" $dev mount $dev $mnt btrfs scrub start -B $mnt scrub done for 54e63f9f-0c30-4c84-a33b-5c56014629b7 Scrub started: Mon Nov 7 07:18:27 2022 Status: finished Duration: 0:00:00 Total to scrub: 536.00MiB Rate: 0.00B/s Error summary: no errors found <<< [CAUSE] That offending commit enlarges the data extent scrub size from sector size to BTRFS_STRIPE_LEN, to avoid extra scrub_block to be allocated. But unfortunately the data extent scrub is still heavily relying on the fact that there is only one scrub_sector per scrub_block. Thus it will only check the first sector, and ignoring the remaining sectors. Furthermore the error reporting is not able to handle multiple sectors either. [FIX] For now just revert the offending commit. The consequence is just extra memory usage during scrub. We will need a proper change to make the remaining data scrub path to handle multiple sectors before we enlarging the data scrub size. Reported-by: Li Zhang Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 8bb808c6ad91ec3d332f072ce8f8aa4b16e307e0 Author: David Sterba Date: Thu Nov 3 14:39:01 2022 +0100 btrfs: don't print stack trace when transaction is aborted due to ENOMEM Add ENOMEM among the error codes that don't print stack trace on transaction abort. We've got several reports from syzbot that detects stacks as errors but caused by limiting memory. As this is an artificial condition we don't need to know where exactly the error happens, the abort and error cleanup will continue like e.g. for EIO. As the transaction aborts code needs to be inline in a lot of code, the implementation cases about minimal bloat. The error codes are in a separate function and the WARN uses the condition directly. This increases the code size by 571 bytes on release build. Alternatives considered: add -ENOMEM among the errors, this increases size by 2340 bytes, various attempts to combine the WARN and helper calls, increase by 700 or more bytes. Example syzbot reports (error -12): - https://syzkaller.appspot.com/bug?extid=5244d35be7f589cf093e - https://syzkaller.appspot.com/bug?extid=9c37714c07194d816417 Signed-off-by: David Sterba commit 9b2f20344d450137d015b380ff0c2e2a6a170135 Author: Zhang Xiaoxu Date: Tue Nov 1 10:53:54 2022 +0800 btrfs: selftests: fix wrong error check in btrfs_free_dummy_root() The btrfs_alloc_dummy_root() uses ERR_PTR as the error return value rather than NULL, if error happened, there will be a NULL pointer dereference: BUG: KASAN: null-ptr-deref in btrfs_free_dummy_root+0x21/0x50 [btrfs] Read of size 8 at addr 000000000000002c by task insmod/258926 CPU: 2 PID: 258926 Comm: insmod Tainted: G W 6.1.0-rc2+ #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: dump_stack_lvl+0x34/0x44 kasan_report+0xb7/0x140 kasan_check_range+0x145/0x1a0 btrfs_free_dummy_root+0x21/0x50 [btrfs] btrfs_test_free_space_cache+0x1a8c/0x1add [btrfs] btrfs_run_sanity_tests+0x65/0x80 [btrfs] init_btrfs_fs+0xec/0x154 [btrfs] do_one_initcall+0x87/0x2a0 do_init_module+0xdf/0x320 load_module+0x3006/0x3390 __do_sys_finit_module+0x113/0x1b0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: aaedb55bc08f ("Btrfs: add tests for btrfs_get_extent") CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Anand Jain Signed-off-by: Zhang Xiaoxu Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0fca385d6ebc3cabb20f67bcf8a71f1448bdc001 Author: Liu Shixin Date: Thu Nov 3 16:33:01 2022 +0800 btrfs: fix match incorrectly in dev_args_match_device syzkaller found a failed assertion: assertion failed: (args->devid != (u64)-1) || args->missing, in fs/btrfs/volumes.c:6921 This can be triggered when we set devid to (u64)-1 by ioctl. In this case, the match of devid will be skipped and the match of device may succeed incorrectly. Patch 562d7b1512f7 introduced this function which is used to match device. This function contains two matching scenarios, we can distinguish them by checking the value of args->missing rather than check whether args->devid and args->uuid is default value. Reported-by: syzbot+031687116258450f9853@syzkaller.appspotmail.com Fixes: 562d7b1512f7 ("btrfs: handle device lookup with btrfs_dev_lookup_args") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Nikolay Borisov Signed-off-by: Liu Shixin Signed-off-by: David Sterba commit 178e31ce82d0308a9e5f2f15bfb4493160136729 Author: Matthew Auld Date: Fri Oct 28 14:06:35 2022 +0100 drm/i915/userptr: restore probe_range behaviour The conversion looks harmless, however the addr value is updated inside the loop with the previous vm_end, which then incorrectly leads to for_each_vma_range() iterating over stuff outside the range we care about. Fix this by storing the end value separately. Also fix the case where the range doesn't intersect with any vma, or if the vma itself doesn't extend the entire range, which must mean we have hole at the end. Both should result in an error, as per the previous behaviour. v2: Fix the cases where the range is empty, or if there's a hole at the end of the range Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7247 Testcase: igt@gem_userptr_blits@probe Fixes: f683b9d61319 ("i915: use the VMA iterator") Reported-by: kernel test robot Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin Cc: Matthew Wilcox (Oracle) Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Yu Zhao Reviewed-by: Liam R. Howlett Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20221028130635.465839-1-matthew.auld@intel.com (cherry picked from commit 6f7de35b50860c345babf8ed0aa0d75f9315eee4) Signed-off-by: Tvrtko Ursulin commit 19b168136395150a4a6e011f944eb30d3d85094b Author: Niranjana Vishwanathapura Date: Tue Nov 1 22:14:16 2022 -0700 drm/i915: Do not set cache_dirty for DGFX Currently on DG1, which does not have LLC, we hit the below warning while rebinding an userptr invalidated object. WARNING: CPU: 4 PID: 13008 at drivers/gpu/drm/i915/gem/i915_gem_pages.c:34 __i915_gem_object_set_pages+0x296/0x2d0 [i915] ... RIP: 0010:__i915_gem_object_set_pages+0x296/0x2d0 [i915] ... Call Trace: i915_gem_userptr_get_pages+0x175/0x1a0 [i915] ____i915_gem_object_get_pages+0x32/0xb0 [i915] i915_gem_object_userptr_submit_init+0x286/0x470 [i915] eb_lookup_vmas+0x2ff/0xcf0 [i915] ? __intel_wakeref_get_first+0x55/0xb0 [i915] i915_gem_do_execbuffer+0x785/0x21d0 [i915] i915_gem_execbuffer2_ioctl+0xe7/0x3d0 [i915] We shouldn't be setting the obj->cache_dirty for DGFX, fix it. Fixes: d70af57944a1 ("drm/i915/shmem: ensure flush during swap-in on non-LLC") Suggested-by: Matthew Auld Reported-by: Niranjana Vishwanathapura Signed-off-by: Niranjana Vishwanathapura Acked-by: Nirmoy Das Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20221102051416.27327-1-niranjana.vishwanathapura@intel.com (cherry picked from commit 0aeec60c76ca2631696b4228f3fc99fe3a80013d) Signed-off-by: Tvrtko Ursulin commit 4ff4ebac3f1378f4ba6e11fe5ad4a4ac590bb8a4 Author: Jouni Högander Date: Mon Oct 24 08:46:49 2022 +0300 drm/i915/psr: Send update also on invalidate Currently we are observing mouse cursor stuttering when using xrandr --scaling=1.2x1.2. X scaling/transformation seems to be doing fronbuffer rendering. When moving mouse cursor X seems to perform several invalidates and only one DirtyFB. I.e. it seems to be assuming updates are sent to panel while drawing is done. Earlier we were disabling PSR in frontbuffer invalidate call back (when drawing in X started). PSR was re-enabled in frontbuffer flush callback (dirtyfb ioctl). This was working fine with X scaling/transformation. Now we are just enabling continuous full frame (cff) in PSR invalidate callback. Enabling cff doesn't trigger any updates. It just configures PSR to send full frame when updates are sent. I.e. there are no updates on screen before PSR flush callback is made. X seems to be doing several updates in frontbuffer before doing dirtyfb ioctl. Fix this by sending single update on every invalidate callback. Cc: José Roberto de Souza Cc: Ville Syrjälä Cc: Mika Kahola Fixes: 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6679 Signed-off-by: Jouni Högander Reported-by: Brian J. Tarricone Tested-by: Brian J. Tarricone Reviewed-by: Mika Kahola Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20221024054649.31299-1-jouni.hogander@intel.com (cherry picked from commit d755f89220a2b49bc90b7b520bb6edeb4adb5f01) Signed-off-by: Tvrtko Ursulin commit f90daa975911961b65070ec72bd7dd8d448f9ef7 Author: Matthew Auld Date: Fri Oct 28 16:50:26 2022 +0100 drm/i915/dmabuf: fix sg_table handling in map_dma_buf We need to iterate over the original entries here for the sg_table, pulling out the struct page for each one, to be remapped. However currently this incorrectly iterates over the final dma mapped entries, which is likely just one gigantic sg entry if the iommu is enabled, leading to us only mapping the first struct page (and any physically contiguous pages following it), even if there is potentially lots more data to follow. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7306 Fixes: 1286ff739773 ("i915: add dmabuf/prime buffer sharing support.") Signed-off-by: Matthew Auld Cc: Lionel Landwerlin Cc: Tvrtko Ursulin Cc: Ville Syrjälä Cc: Michael J. Ruhl Cc: # v3.5+ Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20221028155029.494736-1-matthew.auld@intel.com (cherry picked from commit 28d52f99bbca7227008cf580c9194c9b3516968e) Signed-off-by: Tvrtko Ursulin commit 8b043dfb3dc7c32f9c2c0c93e3c2de346ee5e358 Author: Geert Uytterhoeven Date: Fri Oct 28 12:06:45 2022 +0200 can: rcar_canfd: Add missing ECC error checks for channels 2-7 When introducing support for R-Car V3U, which has 8 instead of 2 channels, the ECC error bitmask was extended to take into account the extra channels, but rcar_canfd_global_error() was not updated to act upon the extra bits. Replace the RCANFD_GERFL_EEF[01] macros by a new macro that takes the channel number, fixing R-Car V3U while simplifying the code. Fixes: 45721c406dcf50d4 ("can: rcar_canfd: Add support for r8a779a0 SoC") Signed-off-by: Geert Uytterhoeven Reviewed-by: Biju Das Link: https://lore.kernel.org/all/4edb2ea46cc64d0532a08a924179827481e14b4f.1666951503.git.geert+renesas@glider.be Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit ae64438be1923e3c1102d90fd41db7afcfaf54cc Author: Oliver Hartkopp Date: Wed Nov 2 10:54:31 2022 +0100 can: dev: fix skb drop check In commit a6d190f8c767 ("can: skb: drop tx skb if in listen only mode") the priv->ctrlmode element is read even on virtual CAN interfaces that do not create the struct can_priv at startup. This out-of-bounds read may lead to CAN frame drops for virtual CAN interfaces like vcan and vxcan. This patch mainly reverts the original commit and adds a new helper for CAN interface drivers that provide the required information in struct can_priv. Fixes: a6d190f8c767 ("can: skb: drop tx skb if in listen only mode") Reported-by: Dariusz Stojaczyk Cc: Vincent Mailhol Cc: Max Staudt Signed-off-by: Oliver Hartkopp Acked-by: Vincent Mailhol Link: https://lore.kernel.org/all/20221102095431.36831-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org # 6.0.x [mkl: patch pch_can, too] Signed-off-by: Marc Kleine-Budde commit 3eb3d283e8579a22b81dd2ac3987b77465b2a22f Author: Oliver Hartkopp Date: Fri Nov 4 08:50:00 2022 +0100 can: j1939: j1939_send_one(): fix missing CAN header initialization The read access to struct canxl_frame::len inside of a j1939 created skbuff revealed a missing initialization of reserved and later filled elements in struct can_frame. This patch initializes the 8 byte CAN header with zero. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel Link: https://lore.kernel.org/linux-can/20221104052235.GA6474@pengutronix.de Reported-by: syzbot+d168ec0caca4697e03b1@syzkaller.appspotmail.com Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20221104075000.105414-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit 866337865f3747c68a3e7bb837611e39cec1ecd6 Author: Oliver Hartkopp Date: Fri Nov 4 15:25:51 2022 +0100 can: isotp: fix tx state handling for echo tx processing In commit 4b7fe92c0690 ("can: isotp: add local echo tx processing for consecutive frames") the data flow for consecutive frames (CF) has been reworked to improve the reliability of long data transfers. This rework did not touch the transmission and the tx state changes of single frame (SF) transfers which likely led to the WARN in the isotp_tx_timer_handler() catching a wrong tx state. This patch makes use of the improved frame processing for SF frames and sets the ISOTP_SENDING state in isotp_sendmsg() within the cmpxchg() condition handling. A review of the state machine and the timer handling additionally revealed a missing echo timeout handling in the case of the burst mode in isotp_rcv_echo() and removes a potential timer configuration uncertainty in isotp_rcv_fc() when the receiver requests consecutive frames. Fixes: 4b7fe92c0690 ("can: isotp: add local echo tx processing for consecutive frames") Link: https://lore.kernel.org/linux-can/CAO4mrfe3dG7cMP1V5FLUkw7s+50c9vichigUMQwsxX4M=45QEw@mail.gmail.com/T/#u Reported-by: Wei Chen Cc: stable@vger.kernel.org # v6.0 Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20221104142551.16924-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 8aa59e355949442c408408c2d836e561794c40a1 Author: Zhengchao Shao Date: Fri Oct 28 16:56:50 2022 +0800 can: af_can: fix NULL pointer dereference in can_rx_register() It causes NULL pointer dereference when testing as following: (a) use syscall(__NR_socket, 0x10ul, 3ul, 0) to create netlink socket. (b) use syscall(__NR_sendmsg, ...) to create bond link device and vxcan link device, and bind vxcan device to bond device (can also use ifenslave command to bind vxcan device to bond device). (c) use syscall(__NR_socket, 0x1dul, 3ul, 1) to create CAN socket. (d) use syscall(__NR_bind, ...) to bind the bond device to CAN socket. The bond device invokes the can-raw protocol registration interface to receive CAN packets. However, ml_priv is not allocated to the dev, dev_rcv_lists is assigned to NULL in can_rx_register(). In this case, it will occur the NULL pointer dereference issue. The following is the stack information: BUG: kernel NULL pointer dereference, address: 0000000000000008 PGD 122a4067 P4D 122a4067 PUD 1223c067 PMD 0 Oops: 0000 [#1] PREEMPT SMP RIP: 0010:can_rx_register+0x12d/0x1e0 Call Trace: raw_enable_filters+0x8d/0x120 raw_enable_allfilters+0x3b/0x130 raw_bind+0x118/0x4f0 __sys_bind+0x163/0x1a0 __x64_sys_bind+0x1e/0x30 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 4e096a18867a ("net: introduce CAN specific pointer in the struct net_device") Signed-off-by: Zhengchao Shao Reviewed-by: Marc Kleine-Budde Link: https://lore.kernel.org/all/20221028085650.170470-1-shaozhengchao@huawei.com Signed-off-by: Marc Kleine-Budde commit a3335faebe1608f3e78e24f09501c9f7d5ebf87a Author: Chen Zhongjin Date: Mon Oct 31 11:30:53 2022 +0800 can: af_can: can_exit(): add missing dev_remove_pack() of canxl_packet In can_init(), dev_add_pack(&canxl_packet) is added but not removed in can_exit(). It breaks the packet handler list and can make kernel panic when can_init() is called for the second time. | > modprobe can && rmmod can | > rmmod xxx && modprobe can | | BUG: unable to handle page fault for address: fffffbfff807d7f4 | RIP: 0010:dev_add_pack+0x133/0x1f0 | Call Trace: | | can_init+0xaa/0x1000 [can] | do_one_initcall+0xd3/0x4e0 | ... Fixes: fb08cba12b52 ("can: canxl: update CAN infrastructure for CAN XL frames") Signed-off-by: Chen Zhongjin Acked-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20221031033053.37849-1-chenzhongjin@huawei.com [mkl: adjust subject and commit message] Signed-off-by: Marc Kleine-Budde commit 162503fd1c3a1d4e14dbe7f399c1d1bec1c8abbc Author: Brian Norris Date: Wed Oct 26 12:42:08 2022 -0700 mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Include this fix by way of the new sdhci_and_cqhci_reset() helper. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: f545702b74f9 ("mmc: sdhci_am654: Add Support for Command Queuing Engine to J721E") Signed-off-by: Brian Norris Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221026124150.v4.6.I35ca9d6220ba48304438b992a76647ca8e5b126f@changeid Signed-off-by: Ulf Hansson commit 836078449464e6af3b66ae6652dae79af176f21e Author: Brian Norris Date: Wed Oct 26 12:42:07 2022 -0700 mmc: sdhci-tegra: Fix SDHCI_RESET_ALL for CQHCI [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Include this fix by way of the new sdhci_and_cqhci_reset() helper. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: 3c4019f97978 ("mmc: tegra: HW Command Queue Support for Tegra SDMMC") Signed-off-by: Brian Norris Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221026124150.v4.5.I418c9eaaf754880fcd2698113e8c3ef821a944d7@changeid Signed-off-by: Ulf Hansson commit fb1dec44c6750bb414f47b929c8c175a1a127c31 Author: Brian Norris Date: Wed Oct 26 12:42:06 2022 -0700 mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Include this fix by way of the new sdhci_and_cqhci_reset() helper. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: bb6e358169bf ("mmc: sdhci-esdhc-imx: add CMDQ support") Signed-off-by: Brian Norris Reviewed-by: Haibo Chen Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221026124150.v4.4.I7d01f9ad11bacdc9213dee61b7918982aea39115@changeid Signed-off-by: Ulf Hansson commit 56baa208f91061ff27ec2d93fbc483f624d373b4 Author: Brian Norris Date: Wed Oct 26 12:42:05 2022 -0700 mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Include this fix by way of the new sdhci_and_cqhci_reset() helper. I only patch the bcm7216 variant even though others potentially *could* provide the 'supports-cqe' property (and thus enable CQHCI), because d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)") and some Broadcom folks confirm that only the 7216 variant actually supports it. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)") Signed-off-by: Brian Norris Reviewed-by: Florian Fainelli Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221026124150.v4.3.I6a715feab6d01f760455865e968ecf0d85036018@changeid Signed-off-by: Ulf Hansson commit 5d249ac37fc2396e8acc1adb0650cdacae5a990d Author: Brian Norris Date: Wed Oct 26 12:42:04 2022 -0700 mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but one particular case I hit commonly enough: mmc_suspend() -> mmc_power_off(). Typically we will eventually deactivate CQE (cqhci_suspend() -> cqhci_deactivate()), but that's not guaranteed -- in particular, if we perform a partial (e.g., interrupted) system suspend. The same bug was already found and fixed for two other drivers, in v5.7 and v5.9: 5cf583f1fb9c ("mmc: sdhci-msm: Deactivate CQE during SDHC reset") df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers") The latter is especially prescient, saying "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." So like these other patches, deactivate CQHCI when resetting the controller. Do this via the new sdhci_and_cqhci_reset() helper. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: 84362d79f436 ("mmc: sdhci-of-arasan: Add CQHCI support for arasan,sdhci-5.1") Cc: Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20221026124150.v4.2.I29f6a2189e84e35ad89c1833793dca9e36c64297@changeid Signed-off-by: Ulf Hansson commit ebb5fd38f41132e6924cb33b647337f4a5d5360c Author: Brian Norris Date: Wed Oct 26 12:42:03 2022 -0700 mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI Several SDHCI drivers need to deactivate command queueing in their reset hook (see sdhci_cqhci_reset() / sdhci-pci-core.c, for example), and several more are coming. Those reset implementations have some small subtleties (e.g., ordering of initialization of SDHCI vs. CQHCI might leave us resetting with a NULL ->cqe_private), and are often identical across different host drivers. We also don't want to force a dependency between SDHCI and CQHCI, or vice versa; non-SDHCI drivers use CQHCI, and SDHCI drivers might support command queueing through some other means. So, implement a small helper, to avoid repeating the same mistakes in different drivers. Simply stick it in a header, because it's so small it doesn't deserve its own module right now, and inlining to each driver is pretty reasonable. This is marked for -stable, as it is an important prerequisite patch for several SDHCI controller bugfixes that follow. Cc: Signed-off-by: Brian Norris Acked-by: Adrian Hunter Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221026124150.v4.1.Ie85faa09432bfe1b0890d8c24ff95e17f3097317@changeid Signed-off-by: Ulf Hansson commit c23fb2c82267638f9d206cb96bb93e1f93ad7828 Author: Alexander Potapenko Date: Fri Nov 4 11:32:16 2022 +0100 ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network When copying a `struct ifaddrlblmsg` to the network, __ifal_reserved remained uninitialized, resulting in a 1-byte infoleak: BUG: KMSAN: kernel-network-infoleak in __netdev_start_xmit ./include/linux/netdevice.h:4841 __netdev_start_xmit ./include/linux/netdevice.h:4841 netdev_start_xmit ./include/linux/netdevice.h:4857 xmit_one net/core/dev.c:3590 dev_hard_start_xmit+0x1dc/0x800 net/core/dev.c:3606 __dev_queue_xmit+0x17e8/0x4350 net/core/dev.c:4256 dev_queue_xmit ./include/linux/netdevice.h:3009 __netlink_deliver_tap_skb net/netlink/af_netlink.c:307 __netlink_deliver_tap+0x728/0xad0 net/netlink/af_netlink.c:325 netlink_deliver_tap net/netlink/af_netlink.c:338 __netlink_sendskb net/netlink/af_netlink.c:1263 netlink_sendskb+0x1d9/0x200 net/netlink/af_netlink.c:1272 netlink_unicast+0x56d/0xf50 net/netlink/af_netlink.c:1360 nlmsg_unicast ./include/net/netlink.h:1061 rtnl_unicast+0x5a/0x80 net/core/rtnetlink.c:758 ip6addrlbl_get+0xfad/0x10f0 net/ipv6/addrlabel.c:628 rtnetlink_rcv_msg+0xb33/0x1570 net/core/rtnetlink.c:6082 ... Uninit was created at: slab_post_alloc_hook+0x118/0xb00 mm/slab.h:742 slab_alloc_node mm/slub.c:3398 __kmem_cache_alloc_node+0x4f2/0x930 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 __kmalloc_node_track_caller+0x117/0x3d0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 __alloc_skb+0x27a/0xab0 net/core/skbuff.c:509 alloc_skb ./include/linux/skbuff.h:1267 nlmsg_new ./include/net/netlink.h:964 ip6addrlbl_get+0x490/0x10f0 net/ipv6/addrlabel.c:608 rtnetlink_rcv_msg+0xb33/0x1570 net/core/rtnetlink.c:6082 netlink_rcv_skb+0x299/0x550 net/netlink/af_netlink.c:2540 rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6109 netlink_unicast_kernel net/netlink/af_netlink.c:1319 netlink_unicast+0x9ab/0xf50 net/netlink/af_netlink.c:1345 netlink_sendmsg+0xebc/0x10f0 net/netlink/af_netlink.c:1921 ... This patch ensures that the reserved field is always initialized. Reported-by: syzbot+3553517af6020c4f2813f1003fe76ef3cbffe98d@syzkaller.appspotmail.com Fixes: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.") Signed-off-by: Alexander Potapenko Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 53eb64c88f17b14b324fbdfd417f56c5d3fa6fee Author: Andy Shevchenko Date: Fri Nov 4 17:49:16 2022 +0200 platform/x86: p2sb: Don't fail if unknown CPU is found We have accessing P2SB from a very few places for quite known hardware. When a new SoC appears in intel-family.h it's not obvious that it needs to be added to p2sb.c as well. Instead, provide default BDF and refactor p2sb_get_devfn() to always succeed. If in the future we would need to exclude something, we may add a list of unsupported IDs. Without this change the iTCO on Intel Comet Lake SoCs became unavailable: i801_smbus 0000:00:1f.4: failed to create iTCO device Fixes: 5c7b9167ddf8 ("i2c: i801: convert to use common P2SB accessor") Reported-and-tested-by: Jarkko Nikula Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221104154916.35231-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a977ece5773b6746b814aac410da4776023db239 Author: Ivan Hu Date: Wed Nov 2 10:05:48 2022 +0800 platform/x86/intel/hid: Add some ACPI device IDs Add INTC1076 (JasonLake), INTC1077 (MeteorLake) and INTC1078 (RaptorLake) devices IDs. Signed-off-by: Ivan Hu Link: https://lore.kernel.org/r/20221102020548.5225-1-ivan.hu@canonical.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bcdfa1f77ea7f67368d20384932a9d1e3047ddd2 Author: David E. Box Date: Fri Nov 4 20:42:28 2022 -0700 platform/x86/intel/pmt: Sapphire Rapids PMT errata fix On Sapphire Rapids, due to a hardware issue affecting the PUNIT telemetry region, reads that are not done in QWORD quantities and alignment may return incorrect data. Use a custom 64-bit copy for this region. Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20221105034228.1376677-1-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1598bfa8e1faa932de42e1ee7628a1c4c4263f0a Author: Jorge Lopez Date: Fri Oct 28 10:55:27 2022 -0500 platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi After upgrading BIOS to U82 01.02.01 Rev.A, the console is flooded strange char "^@" which printed out every second and makes login nearly impossible. Also the below messages were shown both in console and journal/dmesg every second: usb 1-3: Device not responding to setup address. usb 1-3: device not accepting address 4, error -71 usb 1-3: device descriptor read/all, error -71 usb usb1-port3: unable to enumerate USB device Wifi is soft blocked by checking rfkill. When unblocked manually, after few seconds it would be soft blocked again. So I was suspecting something triggered rfkill to soft block wifi. At the end it was fixed by removing hp_wmi module. The root cause is the way hp-wmi driver handles command 1B on post-2009 BIOS. In pre-2009 BIOS, command 1Bh return 0x4 to indicate that BIOS no longer controls the power for the wireless devices. Signed-off-by: Jorge Lopez Link: https://bugzilla.kernel.org/show_bug.cgi?id=216468 Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20221028155527.7724-1-jorge.lopez2@hp.com Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 0df044b34bf33e7e35c32b3bf6747fde6279c162 Author: Hans de Goede Date: Tue Oct 25 16:11:31 2022 +0200 platform/x86: touchscreen_dmi: Add info for the RCA Cambio W101 v2 2-in-1 Add touchscreen info for the RCA Cambio W101 v2 2-in-1. Link: https://github.com/onitake/gsl-firmware/discussions/193 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20221025141131.509211-1-hdegoede@redhat.com commit a231224a601c1924b9df620281ad04472900d75f Author: Manyi Li Date: Tue Oct 18 17:53:23 2022 +0800 platform/x86: ideapad-laptop: Disable touchpad_switch Ideapads for "Lenovo Yoga 3 Pro 1370" and "ZhaoYang K4e-IML" do not use EC to switch touchpad. Reading VPCCMD_R_TOUCHPAD will return zero thus touchpad may be blocked unexpectedly. Signed-off-by: Manyi Li Link: https://lore.kernel.org/r/20221018095323.14591-1-limanyi@uniontech.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f46acc1efd4b5846de9fa05f966e504f328f34a6 Author: Hans de Goede Date: Mon Oct 31 21:20:59 2022 +0100 ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 The Dell G15 5515 has the WMI interface (and WMI call returns) expected by the nvidia-wmi-ec-backlight interface. But the backlight class device registered by the nvidia-wmi-ec-backlight driver does not actually work. The amdgpu_bl0 native GPU backlight class device does actually work, add a backlight=native DMI quirk for this. Reported-by: Iris Reviewed-by: Daniel Dadap Signed-off-by: Hans de Goede --- Changes in v2: - Add a comment that this needs to be revisited when dynamic-mux support gets added (suggested by: Daniel Dadap) commit 454d61a56d5e4c8cd9905f81d475d23f86f370af Author: Hans de Goede Date: Fri Nov 4 18:06:29 2022 +0100 ACPI: video: Make acpi_video_backlight_use_native() always return true Testing has shown that there are quite a few laptop models which rely on native backlight control and which do not support ACPI video bus backlight control, causing __acpi_video_get_backlight_type() to return vendor. Known Windows laptop models affected by this are: Acer Aspire 1640 HP Compaq nc6120 IBM ThinkPad X40 System76 Starling Star1 and the following MacBook models are affected too: Apple MacBook 2.1 Apple MacBook 4.1 Apple MacBook Pro 7.1 the list of affected Windows laptop models is likely just the top of the iceberg. So for now lets undo the change to not register native backlight class devices when __acpi_video_get_backlight_type() != native. Since as part of the backlight-detect refactor the detection code now relies on the GPU drivers calling acpi_video_backlight_use_native() to learn that native backlight support is available we cannot just remove the acpi_video_backlight_use_native() calls from the GPU drivers. Instead modify acpi_video_backlight_use_native() to always return true for now. This is meant as a temporary work-around, which will be removed again when the heuristics from __acpi_video_get_backlight_type() have been improved so that they will return native on affected models. Reported-by: Matthew Garrett Reported-by: John Warriner Reported-by: Scott Ostrander Reported-by: Matthias Rampke Reported-by: Milan Hodoscek Signed-off-by: Hans de Goede commit 0c175da7b0378445f5ef53904247cfbfb87e0b78 Author: Lu Wei Date: Fri Nov 4 10:27:23 2022 +0800 tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent If setsockopt with option name of TCP_REPAIR_OPTIONS and opt_code of TCPOPT_SACK_PERM is called to enable sack after data is sent and dupacks are received , it will trigger a warning in function tcp_verify_left_out() as follows: ============================================ WARNING: CPU: 8 PID: 0 at net/ipv4/tcp_input.c:2132 tcp_timeout_mark_lost+0x154/0x160 tcp_enter_loss+0x2b/0x290 tcp_retransmit_timer+0x50b/0x640 tcp_write_timer_handler+0x1c8/0x340 tcp_write_timer+0xe5/0x140 call_timer_fn+0x3a/0x1b0 __run_timers.part.0+0x1bf/0x2d0 run_timer_softirq+0x43/0xb0 __do_softirq+0xfd/0x373 __irq_exit_rcu+0xf6/0x140 The warning is caused in the following steps: 1. a socket named socketA is created 2. socketA enters repair mode without build a connection 3. socketA calls connect() and its state is changed to TCP_ESTABLISHED directly 4. socketA leaves repair mode 5. socketA calls sendmsg() to send data, packets_out and sack_outs(dup ack receives) increase 6. socketA enters repair mode again 7. socketA calls setsockopt with TCPOPT_SACK_PERM to enable sack 8. retransmit timer expires, it calls tcp_timeout_mark_lost(), lost_out increases 9. sack_outs + lost_out > packets_out triggers since lost_out and sack_outs increase repeatly In function tcp_timeout_mark_lost(), tp->sacked_out will be cleared if Step7 not happen and the warning will not be triggered. As suggested by Denis and Eric, TCP_REPAIR_OPTIONS should be prohibited if data was already sent. socket-tcp tests in CRIU has been tested as follows: $ sudo ./test/zdtm.py run -t zdtm/static/socket-tcp* --keep-going \ --ignore-taint socket-tcp* represent all socket-tcp tests in test/zdtm/static/. Fixes: b139ba4e90dc ("tcp: Repair connection-time negotiated parameters") Signed-off-by: Lu Wei Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit cf53db768a8790fdaae2fa3a81322b080285f7e5 Author: Yuan Can Date: Thu Nov 3 01:47:05 2022 +0000 drm/vc4: Fix missing platform_unregister_drivers() call in vc4_drm_register() A problem about modprobe vc4 failed is triggered with the following log given: [ 420.327987] Error: Driver 'vc4_hvs' is already registered, aborting... [ 420.333904] failed to register platform driver vc4_hvs_driver [vc4]: -16 modprobe: ERROR: could not insert 'vc4': Device or resource busy The reason is that vc4_drm_register() returns platform_driver_register() directly without checking its return value, if platform_driver_register() fails, it returns without unregistering all the vc4 drivers, resulting the vc4 can never be installed later. A simple call graph is shown as below: vc4_drm_register() platform_register_drivers() # all vc4 drivers are registered platform_driver_register() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without unregister drivers Fixing this problem by checking the return value of platform_driver_register() and do platform_unregister_drivers() if error happened. Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Signed-off-by: Yuan Can Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20221103014705.109322-1-yuancan@huawei.com commit f9027f88f7d1dc2b0ed1afbf28f22992d72d7efe Author: Zhaoping Shu Date: Thu Nov 3 19:08:49 2022 +0800 net: wwan: iosm: Remove unnecessary if_mutex lock These WWAN network interface operations (create/delete/open/close) are already protected by RTNL lock, i.e., wwan_ops.newlink(), wwan_ops.dellink(), net_device_ops.ndo_open() and net_device.ndo_stop() are called with RTNL lock held. Therefore, this patch removes the unnecessary if_mutex. Signed-off-by: Zhaoping Shu Signed-off-by: David S. Miller commit 668205b9c9f94d5ed6ab00cce9a46a654c2b5d16 Author: HW He Date: Thu Nov 3 18:54:19 2022 +0800 net: wwan: mhi: fix memory leak in mhi_mbim_dellink MHI driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network device, which causes a memory leak. This patch sets needs_free_netdev to true when registers network device, which makes netdev subsystem call free_netdev() automatically after unregister_netdevice(). Fixes: aa730a9905b7 ("net: wwan: Add MHI MBIM network driver") Signed-off-by: HW He Signed-off-by: Zhaoping Shu Signed-off-by: David S. Miller commit f25caaca424703d5a0607310f0452f978f1f78d9 Author: HW He Date: Thu Nov 3 18:40:00 2022 +0800 net: wwan: iosm: fix memory leak in ipc_wwan_dellink IOSM driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network device, which causes a memory leak. This patch sets needs_free_netdev to true when registers network device, which makes netdev subsystem call free_netdev() automatically after unregister_netdevice(). Fixes: 2a54f2c77934 ("net: iosm: net driver") Signed-off-by: HW He Reviewed-by: Loic Poulain Signed-off-by: Zhaoping Shu Signed-off-by: David S. Miller commit 85cbaf032d3cd9f595152625eda5d4ecb1d6d78d Author: Zhengchao Shao Date: Thu Nov 3 17:09:05 2022 +0800 hamradio: fix issue of dev reference count leakage in bpq_device_event() When following tests are performed, it will cause dev reference counting leakage. a)ip link add bond2 type bond mode balance-rr b)ip link set bond2 up c)ifenslave -f bond2 rose1 d)ip link del bond2 When new bond device is created, the default type of the bond device is ether. And the bond device is up, bpq_device_event() receives the message and creates a new bpq device. In this case, the reference count value of dev is hold once. But after "ifenslave -f bond2 rose1" command is executed, the type of the bond device is changed to rose. When the bond device is unregistered, bpq_device_event() will not put the dev reference count. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 531705a765493655472c993627106e19f7e5a6d2 Author: Zhengchao Shao Date: Thu Nov 3 17:05:37 2022 +0800 net: lapbether: fix issue of dev reference count leakage in lapbeth_device_event() When following tests are performed, it will cause dev reference counting leakage. a)ip link add bond2 type bond mode balance-rr b)ip link set bond2 up c)ifenslave -f bond2 rose1 d)ip link del bond2 When new bond device is created, the default type of the bond device is ether. And the bond device is up, lapbeth_device_event() receives the message and creates a new lapbeth device. In this case, the reference count value of dev is hold once. But after "ifenslave -f bond2 rose1" command is executed, the type of the bond device is changed to rose. When the bond device is unregistered, lapbeth_device_event() will not put the dev reference count. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit b6662e37772715447aeff2538444ff291e02ea31 Author: Rafael Mendonca Date: Tue Oct 25 22:32:33 2022 -0300 KVM: s390: pci: Fix allocation size of aift kzdev elements The 'kzdev' field of struct 'zpci_aift' is an array of pointers to 'kvm_zdev' structs. Allocate the proper size accordingly. Reported by Coccinelle: WARNING: Use correct pointer type argument for sizeof Fixes: 98b1d33dac5f ("KVM: s390: pci: do initial setup for AEN interpretation") Signed-off-by: Rafael Mendonca Reviewed-by: Christian Borntraeger Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/20221026013234.960859-1-rafaelmendsr@gmail.com Message-Id: <20221026013234.960859-1-rafaelmendsr@gmail.com> Signed-off-by: Janosch Frank commit 6973091d1b50ab4042f6a2d495f59e9db3662ab8 Author: Nico Boehr Date: Tue Oct 11 18:07:12 2022 +0200 KVM: s390: pv: don't allow userspace to set the clock under PV When running under PV, the guest's TOD clock is under control of the ultravisor and the hypervisor isn't allowed to change it. Hence, don't allow userspace to change the guest's TOD clock by returning -EOPNOTSUPP. When userspace changes the guest's TOD clock, KVM updates its kvm.arch.epoch field and, in addition, the epoch field in all state descriptions of all VCPUs. But, under PV, the ultravisor will ignore the epoch field in the state description and simply overwrite it on next SIE exit with the actual guest epoch. This leads to KVM having an incorrect view of the guest's TOD clock: it has updated its internal kvm.arch.epoch field, but the ultravisor ignores the field in the state description. Whenever a guest is now waiting for a clock comparator, KVM will incorrectly calculate the time when the guest should wake up, possibly causing the guest to sleep for much longer than expected. With this change, kvm_s390_set_tod() will now take the kvm->lock to be able to call kvm_s390_pv_is_protected(). Since kvm_s390_set_tod_clock() also takes kvm->lock, use __kvm_s390_set_tod_clock() instead. The function kvm_s390_set_tod_clock is now unused, hence remove it. Update the documentation to indicate the TOD clock attr calls can now return -EOPNOTSUPP. Fixes: 0f3035047140 ("KVM: s390: protvirt: Do only reset registers that are accessible") Reported-by: Marc Hartmayer Signed-off-by: Nico Boehr Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20221011160712.928239-2-nrb@linux.ibm.com Message-Id: <20221011160712.928239-2-nrb@linux.ibm.com> Signed-off-by: Janosch Frank commit 59dc2a7e7c6a0d4a2a2c4dafea874af484fc0592 Author: Hans de Goede Date: Mon Oct 31 11:17:45 2022 +0100 ACPI: video: Improve Chromebook checks 2 improvements for the Chromebook handling in acpi_video_get_backlight_type(): 1. Also check for the "GOOG000C" ACPI HID used on some models 2. Move the Chromebook check to above the ACPI-video check normally Chromebooks don't have ACPI video backlight support, but when flashed with upstream coreboot builds they may have ACPI video backlight support, but native should still be used/preferred then. Suggested-by: Mr. Chromebox Signed-off-by: Hans de Goede commit f0c4d9fc9cc9462659728d168387191387e903cc Author: Linus Torvalds Date: Sun Nov 6 15:07:11 2022 -0800 Linux 6.1-rc4 commit 16c7a368c8ba9aba3b0e0ae5ec0a64be9fb45665 Merge: aa52994915dca 8f401ec1c8975 Author: Linus Torvalds Date: Sun Nov 6 13:09:52 2022 -0800 Merge tag 'cxl-fixes-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull cxl fixes from Dan Williams: "Several fixes for CXL region creation crashes, leaks and failures. This is mainly fallout from the original implementation of dynamic CXL region creation (instantiate new physical memory pools) that arrived in v6.0-rc1. Given the theme of "failures in the presence of pass-through decoders" this also includes new regression test infrastructure for that case. Summary: - Fix region creation crash with pass-through decoders - Fix region creation crash when no decoder allocation fails - Fix region creation crash when scanning regions to enforce the increasing physical address order constraint that CXL mandates - Fix a memory leak for cxl_pmem_region objects, track 1:N instead of 1:1 memory-device-to-region associations. - Fix a memory leak for cxl_region objects when regions with active targets are deleted - Fix assignment of NUMA nodes to CXL regions by CFMWS (CXL Window) emulated proximity domains. - Fix region creation failure for switch attached devices downstream of a single-port host-bridge - Fix false positive memory leak of cxl_region objects by recycling recently used region ids rather than freeing them - Add regression test infrastructure for a pass-through decoder configuration - Fix some mailbox payload handling corner cases" * tag 'cxl-fixes-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/region: Recycle region ids cxl/region: Fix 'distance' calculation with passthrough ports tools/testing/cxl: Add a single-port host-bridge regression config tools/testing/cxl: Fix some error exits cxl/pmem: Fix cxl_pmem_region and cxl_memdev leak cxl/region: Fix cxl_region leak, cleanup targets at region delete cxl/region: Fix region HPA ordering validation cxl/pmem: Use size_add() against integer overflow cxl/region: Fix decoder allocation crash ACPI: NUMA: Add CXL CFMWS 'nodes' to the possible nodes set cxl/pmem: Fix failure to account for 8 byte header for writes to the device LSA. cxl/region: Fix null pointer dereference due to pass through decoder commit cxl/mbox: Add a check on input payload size commit aa52994915dca444dbb8e6b91eb82b749ba7a1ec Merge: 727ea09e99b8e 1e699e177e339 Author: Linus Torvalds Date: Sun Nov 6 12:59:12 2022 -0800 Merge tag 'hwmon-for-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: "Fix two regressions: - Commit 54cc3dbfc10d ("hwmon: (pmbus) Add regulator supply into macro") resulted in regulator undercount when disabling regulators. Revert it. - The thermal subsystem rework caused the scmi driver to no longer register with the thermal subsystem because index values no longer match. To fix the problem, the scmi driver now directly registers with the thermal subsystem, no longer through the hwmon core" * tag 'hwmon-for-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: Revert "hwmon: (pmbus) Add regulator supply into macro" hwmon: (scmi) Register explicitly with Thermal Framework commit 727ea09e99b8e765388d4ca994e8a68a991f4d98 Merge: f6f5204727b9b 6f8faf4714468 Author: Linus Torvalds Date: Sun Nov 6 12:41:32 2022 -0800 Merge tag 'perf_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Add Cooper Lake's stepping to the PEBS guest/host events isolation fixed microcode revisions checking quirk - Update Icelake and Sapphire Rapids events constraints - Use the standard energy unit for Sapphire Rapids in RAPL - Fix the hw_breakpoint test to fail more graciously on !SMP configs * tag 'perf_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Add Cooper Lake stepping to isolation_ucodes[] perf/x86/intel: Fix pebs event constraints for SPR perf/x86/intel: Fix pebs event constraints for ICL perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain perf/hw_breakpoint: test: Skip the test if dependencies unmet commit f6f5204727b9b1f3c6e9c90b5b09f40c6e0102f5 Merge: 35697d81a7782 7beade0dd41d4 Author: Linus Torvalds Date: Sun Nov 6 12:36:47 2022 -0800 Merge tag 'x86_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Add new Intel CPU models - Enforce that TDX guests are successfully loaded only on TDX hardware where virtualization exception (#VE) delivery on kernel memory is disabled because handling those in all possible cases is "essentially impossible" - Add the proper include to the syscall wrappers so that BTF can see the real pt_regs definition and not only the forward declaration * tag 'x86_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Add several Intel server CPU model numbers x86/tdx: Panic on bad configs that #VE on "private" memory access x86/tdx: Prepare for using "INFO" call for a second purpose x86/syscall: Include asm/ptrace.h in syscall_wrapper header commit 35697d81a778223727c2a01a3480735cf51edd93 Merge: 089d1c31224e6 7a263a0402561 Author: Linus Torvalds Date: Sun Nov 6 12:23:10 2022 -0800 Merge tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Use POSIX-compatible grep options - Document git-related tips for reproducible builds - Fix a typo in the modpost rule - Suppress SIGPIPE error message from gcc-ar and llvm-ar - Fix segmentation fault in the menuconfig search * tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix segmentation fault in menuconfig search kbuild: fix SIGPIPE error message for AR=gcc-ar and AR=llvm-ar kbuild: fix typo in modpost Documentation: kbuild: Add description of git for reproducible builds kbuild: use POSIX-compatible grep option commit 328687151b2a29fe93db4736bfb90da134e52fbf Author: Kees Cook Date: Fri Nov 4 23:35:34 2022 -0700 mm/slab_common: Restore passing "caller" for tracing The "caller" argument was accidentally being ignored in a few places that were recently refactored. Restore these "caller" arguments, instead of _RET_IP_. Fixes: 11e9734bcb6a ("mm/slab_common: unify NUMA and UMA version of tracepoints") Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Vlastimil Babka Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: Roman Gushchin Cc: linux-mm@kvack.org Signed-off-by: Kees Cook Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 6dcabcd398946e2b0b776a8310291aeebe1ca0e6 Author: Jens Axboe Date: Sun Nov 6 13:17:27 2022 -0700 io_uring: fix typo in io_uring.h comment Just a basic s/thig/this swap, fixing up a typo introduced by a commit added in the 6.1 release. Fixes: 9cda70f622cd ("io_uring: introduce fixed buffer support for io_uring_cmd") Signed-off-by: Jens Axboe commit 089d1c31224e6b266ece3ee555a3ea2c9acbe5c2 Merge: 6e8c78d32b5c6 f4298cac2bfcc Author: Linus Torvalds Date: Sun Nov 6 10:46:59 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM: - Fix the pKVM stage-1 walker erronously using the stage-2 accessor - Correctly convert vcpu->kvm to a hyp pointer when generating an exception in a nVHE+MTE configuration - Check that KVM_CAP_DIRTY_LOG_* are valid before enabling them - Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE - Document the boot requirements for FGT when entering the kernel at EL1 x86: - Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit() - Make argument order consistent for kvcalloc() - Userspace API fixes for DEBUGCTL and LBRs" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: Fix a typo about the usage of kvcalloc() KVM: x86: Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit() KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl() KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs arm64: booting: Document our requirements for fine grained traps with SME KVM: arm64: Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them KVM: arm64: Fix bad dereference on MTE-enabled systems KVM: arm64: Use correct accessor to parse stage-1 PTEs commit 6e8c78d32b5c60737bcd71346130f0bf91d6e066 Merge: 9761070d14db0 4bff677b30156 Author: Linus Torvalds Date: Sun Nov 6 10:42:29 2022 -0800 Merge tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "One fix for silencing a smatch warning, and a small cleanup patch" * tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: simplify sysenter and syscall setup x86/xen: silence smatch warning in pmu_msr_chk_emulated() commit 9761070d14db0ac0706684eb2fa37dca3087efa1 Merge: 90153f928bee5 0d043351e5baf Author: Linus Torvalds Date: Sun Nov 6 10:30:29 2022 -0800 Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Fix a number of bugs, including some regressions, the most serious of which was one which would cause online resizes to fail with file systems with metadata checksums enabled. Also fix a warning caused by the newly added fortify string checker, plus some bugs that were found using fuzzed file systems" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix fortify warning in fs/ext4/fast_commit.c:1551 ext4: fix wrong return err in ext4_load_and_init_journal() ext4: fix warning in 'ext4_da_release_space' ext4: fix BUG_ON() when directory entry has invalid rec_len ext4: update the backup superblock's at the end of the online resize commit 90153f928bee544c794a2410afba6d936a09edce Merge: 8391aa4b4cf44 542228db2f28f Author: Linus Torvalds Date: Sun Nov 6 10:19:39 2022 -0800 Merge tag '6.1-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "One symlink handling fix and two fixes foir multichannel issues with iterating channels, including for oplock breaks when leases are disabled" * tag '6.1-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix use-after-free on the link name cifs: avoid unnecessary iteration of tcp sessions cifs: always iterate smb sessions using primary channel commit 8391aa4b4cf44c2b942f5e38e6fafc9e6aeb1c24 Merge: 2f5065a0bc9d0 66f0919c953ef Author: Linus Torvalds Date: Sun Nov 6 09:57:38 2022 -0800 Merge tag 'trace-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull `lTracing fixes for 6.1-rc3: - Fixed NULL pointer dereference in the ring buffer wait-waiters code for machines that have less CPUs than what nr_cpu_ids returns. The buffer array is of size nr_cpu_ids, but only the online CPUs get initialized. - Fixed use after free call in ftrace_shutdown. - Fix accounting of if a kprobe is enabled - Fix NULL pointer dereference on error path of fprobe rethook_alloc(). - Fix unregistering of fprobe_kprobe_handler - Fix memory leak in kprobe test module * tag 'trace-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: kprobe: Fix memory leak in test_gen_kprobe/kretprobe_cmd() tracing/fprobe: Fix to check whether fprobe is registered correctly fprobe: Check rethook_alloc() return in rethook initialization kprobe: reverse kp->flags when arm_kprobe failed ftrace: Fix use-after-free for dynamic ftrace_ops ring-buffer: Check for NULL cpu_buffer in ring_buffer_wake_waiters() commit 0aa60ff5d996d4ecdd4a62699c01f6d00f798d59 Author: Alejandro Concepción Rodríguez Date: Sun Nov 6 01:56:51 2022 +0000 iio: light: apds9960: fix wrong register for gesture gain Gesture Gain Control is in REG_GCONF_2 (0xa3), not in REG_CONFIG_2 (0x90). Fixes: aff268cd532e ("iio: light: add APDS9960 ALS + promixity driver") Signed-off-by: Alejandro Concepcion-Rodriguez Acked-by: Matt Ranostay Cc: Link: https://lore.kernel.org/r/EaT-NKC-H4DNX5z4Lg9B6IWPD5TrTrYBr5DYB784wfDKQkTmzPXkoYqyUOrOgJH-xvTsEkFLcVkeAPZRUODEFI5dGziaWXwjpfBNLeNGfNc=@acoro.eu Signed-off-by: Jonathan Cameron commit f4298cac2bfcced49ab308756dc8fef684f3da81 Merge: 1462014966047 be0ddf5293a78 Author: Paolo Bonzini Date: Sun Nov 6 03:25:59 2022 -0500 Merge tag 'kvmarm-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD * Fix the pKVM stage-1 walker erronously using the stage-2 accessor * Correctly convert vcpu->kvm to a hyp pointer when generating an exception in a nVHE+MTE configuration * Check that KVM_CAP_DIRTY_LOG_* are valid before enabling them * Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE * Document the boot requirements for FGT when entering the kernel at EL1 commit 146201496604781b77fa8d41db6117b75b2088ed Merge: 8e5423e991e8c 8670866b236ea Author: Paolo Bonzini Date: Sun Nov 6 03:22:56 2022 -0500 Merge branch 'kvm-master' into HEAD x86: * Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit() * Make argument order consistent for kvcalloc() * Userspace API fixes for DEBUGCTL and LBRs commit 0d043351e5baf3857f915367deba2a518b6a0809 Author: Theodore Ts'o Date: Sat Nov 5 23:42:36 2022 -0400 ext4: fix fortify warning in fs/ext4/fast_commit.c:1551 With the new fortify string system, rework the memcpy to avoid this warning: memcpy: detected field-spanning write (size 60) of single field "&raw_inode->i_generation" at fs/ext4/fast_commit.c:1551 (size 4) Cc: stable@kernel.org Fixes: 54d9469bc515 ("fortify: Add run-time WARN for cross-field memcpy()") Signed-off-by: Theodore Ts'o commit 9f2a1d9fb33a2129a9ba29bc61d3f14adb28ddc2 Author: Jason Yan Date: Tue Oct 25 12:02:06 2022 +0800 ext4: fix wrong return err in ext4_load_and_init_journal() The return value is wrong in ext4_load_and_init_journal(). The local variable 'err' need to be initialized before goto out. The original code in __ext4_fill_super() is fine because it has two return values 'ret' and 'err' and 'ret' is initialized as -EINVAL. After we factor out ext4_load_and_init_journal(), this code is broken. So fix it by directly returning -EINVAL in the error handler path. Cc: stable@kernel.org Fixes: 9c1dd22d7422 ("ext4: factor out ext4_load_and_init_journal()") Signed-off-by: Jason Yan Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20221025040206.3134773-1-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 1b8f787ef547230a3249bcf897221ef0cc78481b Author: Ye Bin Date: Tue Oct 18 10:27:01 2022 +0800 ext4: fix warning in 'ext4_da_release_space' Syzkaller report issue as follows: EXT4-fs (loop0): Free/Dirty block details EXT4-fs (loop0): free_blocks=0 EXT4-fs (loop0): dirty_blocks=0 EXT4-fs (loop0): Block reservation details EXT4-fs (loop0): i_reserved_data_blocks=0 EXT4-fs warning (device loop0): ext4_da_release_space:1527: ext4_da_release_space: ino 18, to_free 1 with only 0 reserved data blocks ------------[ cut here ]------------ WARNING: CPU: 0 PID: 92 at fs/ext4/inode.c:1528 ext4_da_release_space+0x25e/0x370 fs/ext4/inode.c:1524 Modules linked in: CPU: 0 PID: 92 Comm: kworker/u4:4 Not tainted 6.0.0-syzkaller-09423-g493ffd6605b2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: writeback wb_workfn (flush-7:0) RIP: 0010:ext4_da_release_space+0x25e/0x370 fs/ext4/inode.c:1528 RSP: 0018:ffffc900015f6c90 EFLAGS: 00010296 RAX: 42215896cd52ea00 RBX: 0000000000000000 RCX: 42215896cd52ea00 RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000 RBP: 1ffff1100e907d96 R08: ffffffff816aa79d R09: fffff520002bece5 R10: fffff520002bece5 R11: 1ffff920002bece4 R12: ffff888021fd2000 R13: ffff88807483ecb0 R14: 0000000000000001 R15: ffff88807483e740 FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005555569ba628 CR3: 000000000c88e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ext4_es_remove_extent+0x1ab/0x260 fs/ext4/extents_status.c:1461 mpage_release_unused_pages+0x24d/0xef0 fs/ext4/inode.c:1589 ext4_writepages+0x12eb/0x3be0 fs/ext4/inode.c:2852 do_writepages+0x3c3/0x680 mm/page-writeback.c:2469 __writeback_single_inode+0xd1/0x670 fs/fs-writeback.c:1587 writeback_sb_inodes+0xb3b/0x18f0 fs/fs-writeback.c:1870 wb_writeback+0x41f/0x7b0 fs/fs-writeback.c:2044 wb_do_writeback fs/fs-writeback.c:2187 [inline] wb_workfn+0x3cb/0xef0 fs/fs-writeback.c:2227 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Above issue may happens as follows: ext4_da_write_begin ext4_create_inline_data ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS); ext4_set_inode_flag(inode, EXT4_INODE_INLINE_DATA); __ext4_ioctl ext4_ext_migrate -> will lead to eh->eh_entries not zero, and set extent flag ext4_da_write_begin ext4_da_convert_inline_data_to_extent ext4_da_write_inline_data_begin ext4_da_map_blocks ext4_insert_delayed_block if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) if (!ext4_es_scan_clu(inode, &ext4_es_is_mapped, lblk)) ext4_clu_mapped(inode, EXT4_B2C(sbi, lblk)); -> will return 1 allocated = true; ext4_es_insert_delayed_block(inode, lblk, allocated); ext4_writepages mpage_map_and_submit_extent(handle, &mpd, &give_up_on_write); -> return -ENOSPC mpage_release_unused_pages(&mpd, give_up_on_write); -> give_up_on_write == 1 ext4_es_remove_extent ext4_da_release_space(inode, reserved); if (unlikely(to_free > ei->i_reserved_data_blocks)) -> to_free == 1 but ei->i_reserved_data_blocks == 0 -> then trigger warning as above To solve above issue, forbid inode do migrate which has inline data. Cc: stable@kernel.org Reported-by: syzbot+c740bb18df70ad00952e@syzkaller.appspotmail.com Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20221018022701.683489-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 17a0bc9bd697f75cfdf9b378d5eb2d7409c91340 Author: Luís Henriques Date: Wed Oct 12 14:13:30 2022 +0100 ext4: fix BUG_ON() when directory entry has invalid rec_len The rec_len field in the directory entry has to be a multiple of 4. A corrupted filesystem image can be used to hit a BUG() in ext4_rec_len_to_disk(), called from make_indexed_dir(). ------------[ cut here ]------------ kernel BUG at fs/ext4/ext4.h:2413! ... RIP: 0010:make_indexed_dir+0x53f/0x5f0 ... Call Trace: ? add_dirent_to_buf+0x1b2/0x200 ext4_add_entry+0x36e/0x480 ext4_add_nondir+0x2b/0xc0 ext4_create+0x163/0x200 path_openat+0x635/0xe90 do_filp_open+0xb4/0x160 ? __create_object.isra.0+0x1de/0x3b0 ? _raw_spin_unlock+0x12/0x30 do_sys_openat2+0x91/0x150 __x64_sys_open+0x6c/0xa0 do_syscall_64+0x3c/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The fix simply adds a call to ext4_check_dir_entry() to validate the directory entry, returning -EFSCORRUPTED if the entry is invalid. CC: stable@kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=216540 Signed-off-by: Luís Henriques Link: https://lore.kernel.org/r/20221012131330.32456-1-lhenriques@suse.de Signed-off-by: Theodore Ts'o commit 2f5065a0bc9d0afb45f2ae284bd525d55ce82c33 Merge: 4869f5750afdb 6faf4ce500d65 Author: Linus Torvalds Date: Sat Nov 5 12:10:25 2022 -0700 Merge tag 'acpi-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Add StorageD3Enable quirk for Dell Inspiron 16 5625 (Mario Limonciello)" * tag 'acpi-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: x86: Add another system to quirk list for forcing StorageD3Enable commit 6faf4ce500d658bcf4d1fe6fe5de2d4d50366e25 Merge: dd183e320524f 2124becad7972 Author: Rafael J. Wysocki Date: Sat Nov 5 20:01:25 2022 +0100 Merge branch 'acpi-x86' * acpi-x86: ACPI: x86: Add another system to quirk list for forcing StorageD3Enable commit 4869f5750afdb10a0e9cfa0252fce33e53ab681e Merge: b208b9fbbcba7 878eb6e48f240 Author: Linus Torvalds Date: Sat Nov 5 09:02:28 2022 -0700 Merge tag 'block-6.1-2022-11-05' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - Fixes for the ublk driver (Ming) - Fixes for error handling memory leaks (Chen Jun, Chen Zhongjin) - Explicitly clear the last request in a chain when the plug is flushed, as it may have already been issued (Al) * tag 'block-6.1-2022-11-05' of git://git.kernel.dk/linux: block: blk_add_rq_to_plug(): clear stale 'last' after flush blk-mq: Fix kmemleak in blk_mq_init_allocated_queue block: Fix possible memory leak for rq_wb on add_disk failure ublk_drv: add ublk_queue_cmd() for cleanup ublk_drv: avoid to touch io_uring cmd in blk_mq io path ublk_drv: comment on ublk_driver entry of Kconfig ublk_drv: return flag of UBLK_F_URING_CMD_COMP_IN_TASK in case of module commit bdd6b5624c62d0acd350d07564f1c82fe649235f Author: Jeff Layton Date: Sat Nov 5 09:49:26 2022 -0400 nfsd: fix use-after-free in nfsd_file_do_acquire tracepoint When we fail to insert into the hashtable with a non-retryable error, we'll free the object and then goto out_status. If the tracepoint is enabled, it'll end up accessing the freed object when it tries to grab the fields out of it. Set nf to NULL after freeing it to avoid the issue. Fixes: 243a5263014a ("nfsd: rework hashtable handling in nfsd_do_file_acquire") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 38e9f21f648ed3f9125fe09378da9b2eb08b12d9 Merge: 30a0b95b1335e 7c919b619bcc6 Author: Greg Kroah-Hartman Date: Sat Nov 5 11:29:29 2022 +0100 Merge tag 'iio-fixes-for-6.1b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: "2nd set of IIO fixes for 6.1 Another mixed bag of driver fixes. * atmel,at91-sama5d2 - Drop a 5 degree offset as not needed for production devices. - Missing iio_trigger_free() in error path. * bosch,bma400 - Turn power on before trying to read chip ID. * bosch,bno055 - Avoid uninitialized variable warning (no actual impact) * meas,ms5611 - Fix multiple instances of driver sharing single prom array. - Stop forcing SPI speed to max devices supports * mps,mp2629 - Wrong structure field used to match channel. - Missing NULL terminator. * sysfs-trigger - Fix memory leak in error path. * tools - Fix wrong read size when calling with noevents." * tag 'iio-fixes-for-6.1b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: tools: iio: iio_generic_buffer: Fix read size iio: imu: bno055: uninitialized variable bug in bno055_trigger_handler() iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() iio: adc: mp2629: fix potential array out of bound access iio: adc: mp2629: fix wrong comparison of channel iio: pressure: ms5611: changed hardcoded SPI speed to value limited iio: pressure: ms5611: fixed value compensation bug iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID. iio: adc: at91-sama5d2_adc: get rid of 5 degrees Celsius adjustment iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() commit 819b885cd886c193782891c4f51bbcab3de119a4 Author: John Thomson Date: Sat Nov 5 06:52:41 2022 +1000 phy: ralink: mt7621-pci: add sentinel to quirks table With mt7621 soc_dev_attr fixed to register the soc as a device, kernel will experience an oops in soc_device_match_attr This quirk test was introduced in the staging driver in commit 9445ccb3714c ("staging: mt7621-pci-phy: add quirks for 'E2' revision using 'soc_device_attribute'"). The staging driver was removed, and later re-added in commit d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY") for kernel 5.11 Link: https://lore.kernel.org/lkml/26ebbed1-0fe9-4af9-8466-65f841d0b382@app.fastmail.com Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY") Signed-off-by: John Thomson Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20221104205242.3440388-2-git@johnthomson.fastmail.com.au Signed-off-by: Vinod Koul commit 0c423e2ffa7edd3f8f9bcf17ce73fa9c7509b99e Author: Xian Wang Date: Fri Nov 4 13:29:13 2022 -0700 ALSA: hda/ca0132: add quirk for EVGA Z390 DARK The Z390 DARK mainboard uses a CA0132 audio controller. The quirk is needed to enable surround sound and 3.5mm headphone jack handling in the front audio connector as well as in the rear of the board when in stereo mode. Page 97 of the linked manual contains instructions to setup the controller. Signed-off-by: Xian Wang Cc: stable@vger.kernel.org Link: https://www.evga.com/support/manuals/files/131-CS-E399.pdf Link: https://lore.kernel.org/r/20221104202913.13904-1-dev@xianwang.io Signed-off-by: Takashi Iwai commit 46653972e3ea64f79e7f8ae3aa41a4d3fdb70a13 Author: Gaosheng Cui Date: Mon Oct 31 19:25:36 2022 +0800 capabilities: fix undefined behavior in bit shift for CAP_TO_MASK Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in security/commoncap.c:1252:2 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c cap_task_prctl+0x561/0x6f0 security_task_prctl+0x5a/0xb0 __x64_sys_prctl+0x61/0x8f0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: e338d263a76a ("Add 64-bit capability support to the kernel") Signed-off-by: Gaosheng Cui Acked-by: Andrew G. Morgan Reviewed-by: Serge Hallyn Signed-off-by: Paul Moore commit 542228db2f28fdf775b301f2843e1fe486e7c797 Author: ChenXiaoSong Date: Fri Nov 4 15:44:41 2022 +0800 cifs: fix use-after-free on the link name xfstests generic/011 reported use-after-free bug as follows: BUG: KASAN: use-after-free in __d_alloc+0x269/0x859 Read of size 15 at addr ffff8880078933a0 by task dirstress/952 CPU: 1 PID: 952 Comm: dirstress Not tainted 6.1.0-rc3+ #77 Call Trace: __dump_stack+0x23/0x29 dump_stack_lvl+0x51/0x73 print_address_description+0x67/0x27f print_report+0x3e/0x5c kasan_report+0x7b/0xa8 kasan_check_range+0x1b2/0x1c1 memcpy+0x22/0x5d __d_alloc+0x269/0x859 d_alloc+0x45/0x20c d_alloc_parallel+0xb2/0x8b2 lookup_open+0x3b8/0x9f9 open_last_lookups+0x63d/0xc26 path_openat+0x11a/0x261 do_filp_open+0xcc/0x168 do_sys_openat2+0x13b/0x3f7 do_sys_open+0x10f/0x146 __se_sys_creat+0x27/0x2e __x64_sys_creat+0x55/0x6a do_syscall_64+0x40/0x96 entry_SYSCALL_64_after_hwframe+0x63/0xcd Allocated by task 952: kasan_save_stack+0x1f/0x42 kasan_set_track+0x21/0x2a kasan_save_alloc_info+0x17/0x1d __kasan_kmalloc+0x7e/0x87 __kmalloc_node_track_caller+0x59/0x155 kstrndup+0x60/0xe6 parse_mf_symlink+0x215/0x30b check_mf_symlink+0x260/0x36a cifs_get_inode_info+0x14e1/0x1690 cifs_revalidate_dentry_attr+0x70d/0x964 cifs_revalidate_dentry+0x36/0x62 cifs_d_revalidate+0x162/0x446 lookup_open+0x36f/0x9f9 open_last_lookups+0x63d/0xc26 path_openat+0x11a/0x261 do_filp_open+0xcc/0x168 do_sys_openat2+0x13b/0x3f7 do_sys_open+0x10f/0x146 __se_sys_creat+0x27/0x2e __x64_sys_creat+0x55/0x6a do_syscall_64+0x40/0x96 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 950: kasan_save_stack+0x1f/0x42 kasan_set_track+0x21/0x2a kasan_save_free_info+0x1c/0x34 ____kasan_slab_free+0x1c1/0x1d5 __kasan_slab_free+0xe/0x13 __kmem_cache_free+0x29a/0x387 kfree+0xd3/0x10e cifs_fattr_to_inode+0xb6a/0xc8c cifs_get_inode_info+0x3cb/0x1690 cifs_revalidate_dentry_attr+0x70d/0x964 cifs_revalidate_dentry+0x36/0x62 cifs_d_revalidate+0x162/0x446 lookup_open+0x36f/0x9f9 open_last_lookups+0x63d/0xc26 path_openat+0x11a/0x261 do_filp_open+0xcc/0x168 do_sys_openat2+0x13b/0x3f7 do_sys_open+0x10f/0x146 __se_sys_creat+0x27/0x2e __x64_sys_creat+0x55/0x6a do_syscall_64+0x40/0x96 entry_SYSCALL_64_after_hwframe+0x63/0xcd When opened a symlink, link name is from 'inode->i_link', but it may be reset to a new value when revalidate the dentry. If some processes get the link name on the race scenario, then UAF will happen on link name. Fix this by implementing 'get_link' interface to duplicate the link name. Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+") Signed-off-by: ChenXiaoSong Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 23d9b9b757e8007204d8f71448ab55d5ef2ae8e5 Author: Shyam Prasad N Date: Fri Oct 28 10:01:45 2022 +0000 cifs: avoid unnecessary iteration of tcp sessions In a few places, we do unnecessary iterations of tcp sessions, even when the server struct is provided. The change avoids it and uses the server struct provided. Signed-off-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 8abcaeaed38109e5ccaf40218e0e9e387f07bfe6 Author: Shyam Prasad N Date: Fri Oct 28 09:52:26 2022 +0000 cifs: always iterate smb sessions using primary channel smb sessions and tcons currently hang off primary channel only. Secondary channels have the lists as empty. Whenever there's a need to iterate sessions or tcons, we should use the list in the corresponding primary channel. Signed-off-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit b208b9fbbcba743fb269d15cb46a4036b01936b1 Merge: 74f3f1d79a1d1 85f1506337f0c Author: Linus Torvalds Date: Fri Nov 4 19:52:24 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Avoid kprobe recursion when cortex_a76_erratum_1463225_debug_handler() is not inlined (change to __always_inline). - Fix the visibility of compat hwcaps, broken by recent changes to consolidate the visibility of hwcaps and the user-space view of the ID registers. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: cpufeature: Fix the visibility of compat hwcaps arm64: entry: avoid kprobe recursion commit 74f3f1d79a1d17a319e20eb31d3edd25c03bdd9f Merge: 64c3dd0b98f58 8e987f1f4da92 Author: Linus Torvalds Date: Fri Nov 4 19:42:25 2022 -0700 Merge tag 'i2c-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "A documentation fix and driver fixes for piix4, tegra, and i801" * tag 'i2c-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: Documentation: devres: add missing I2C helper i2c: i801: add lis3lv02d's I2C address for Vostro 5568 i2c: tegra: Allocate DMA memory for DMA engine i2c: piix4: Fix adapter not be removed in piix4_remove() commit b7cbc6740bd6ad5d43345a2504f7e4beff0d709f Author: Sean Anderson Date: Thu Nov 3 14:28:30 2022 -0400 net: fman: Unregister ethernet device on removal When the mac device gets removed, it leaves behind the ethernet device. This will result in a segfault next time the ethernet device accesses mac_dev. Remove the ethernet device when we get removed to prevent this. This is not completely reversible, since some resources aren't cleaned up properly, but that can be addressed later. Fixes: 3933961682a3 ("fsl/fman: Add FMan MAC driver") Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20221103182831.2248833-1-sean.anderson@seco.com Signed-off-by: Jakub Kicinski commit c3812c958cbf700939a9590af543ebb08b2fe5e4 Merge: 1118b2049d77c 02597d39145bb Author: Jakub Kicinski Date: Fri Nov 4 19:29:07 2022 -0700 Merge branch 'bnxt_en-bug-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes This bug fix series includes fixes for PCIE AER, a crash that may occur when doing ethtool -C in the middle of error recovery, and aRFS. ==================== Link: https://lore.kernel.org/r/1667518407-15761-1-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 02597d39145bb0aa81d04bf39b6a913ce9a9d465 Author: Alex Barba Date: Thu Nov 3 19:33:27 2022 -0400 bnxt_en: fix potentially incorrect return value for ndo_rx_flow_steer In the bnxt_en driver ndo_rx_flow_steer returns '0' whenever an entry that we are attempting to steer is already found. This is not the correct behavior. The return code should be the value/index that corresponds to the entry. Returning zero all the time causes the RFS records to be incorrect unless entry '0' is the correct one. As flows migrate to different cores this can create entries that are not correct. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Akshay Navgire Signed-off-by: Alex Barba Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 6d81ea3765dfa6c8a20822613c81edad1c4a16a0 Author: Michael Chan Date: Thu Nov 3 19:33:26 2022 -0400 bnxt_en: Fix possible crash in bnxt_hwrm_set_coal() During the error recovery sequence, the rtnl_lock is not held for the entire duration and some datastructures may be freed during the sequence. Check for the BNXT_STATE_OPEN flag instead of netif_running() to ensure that the device is fully operational before proceeding to reconfigure the coalescing settings. This will fix a possible crash like this: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 10 PID: 181276 Comm: ethtool Kdump: loaded Tainted: G IOE --------- - - 4.18.0-348.el8.x86_64 #1 Hardware name: Dell Inc. PowerEdge R740/0F9N89, BIOS 2.3.10 08/15/2019 RIP: 0010:bnxt_hwrm_set_coal+0x1fb/0x2a0 [bnxt_en] Code: c2 66 83 4e 22 08 66 89 46 1c e8 10 cb 00 00 41 83 c6 01 44 39 b3 68 01 00 00 0f 8e a3 00 00 00 48 8b 93 c8 00 00 00 49 63 c6 <48> 8b 2c c2 48 8b 85 b8 02 00 00 48 85 c0 74 2e 48 8b 74 24 08 f6 RSP: 0018:ffffb11c8dcaba50 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8d168a8b0ac0 RCX: 00000000000000c5 RDX: 0000000000000000 RSI: ffff8d162f72c000 RDI: ffff8d168a8b0b28 RBP: 0000000000000000 R08: b6e1f68a12e9a7eb R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000037 R12: ffff8d168a8b109c R13: ffff8d168a8b10aa R14: 0000000000000000 R15: ffffffffc01ac4e0 FS: 00007f3852e4c740(0000) GS:ffff8d24c0080000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000041b3ee003 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ethnl_set_coalesce+0x3ce/0x4c0 genl_family_rcv_msg_doit.isra.15+0x10f/0x150 genl_family_rcv_msg+0xb3/0x160 ? coalesce_fill_reply+0x480/0x480 genl_rcv_msg+0x47/0x90 ? genl_family_rcv_msg+0x160/0x160 netlink_rcv_skb+0x4c/0x120 genl_rcv+0x24/0x40 netlink_unicast+0x196/0x230 netlink_sendmsg+0x204/0x3d0 sock_sendmsg+0x4c/0x50 __sys_sendto+0xee/0x160 ? syscall_trace_enter+0x1d3/0x2c0 ? __audit_syscall_exit+0x249/0x2a0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca RIP: 0033:0x7f38524163bb Fixes: 2151fe0830fd ("bnxt_en: Handle RESET_NOTIFY async event from firmware.") Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 0cf736a18a1e804037839bd8df9e36f0efdb8745 Author: Vikas Gupta Date: Thu Nov 3 19:33:25 2022 -0400 bnxt_en: fix the handling of PCIE-AER Fix the sequence required for PCIE-AER. While slot reset occurs, firmware might not be ready and the driver needs to check for its recovery. We also need to remap the health registers for some chips and clear the resource reservations. The resources will be allocated again during bnxt_io_resume(). Fixes: fb1e6e562b37 ("bnxt_en: Fix AER recovery.") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit b4c66425771ddb910316c7b4cd7fa0614098ec45 Author: Vikas Gupta Date: Thu Nov 3 19:33:24 2022 -0400 bnxt_en: refactor bnxt_cancel_reservations() Introduce bnxt_clear_reservations() to clear the reserved attributes only. This will be used in the next patch to fix PCI AER handling. Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 1e699e177e339e462cdc8571e3d0fcf29665608e Author: Guenter Roeck Date: Fri Nov 4 16:37:30 2022 -0700 Revert "hwmon: (pmbus) Add regulator supply into macro" This reverts commit 54cc3dbfc10dc3db7cb1cf49aee4477a8398fbde. Zev Weiss reports that the reverted patch may cause a regulator undercount. Here is his report: ... having regulator-dummy set as a supply on my PMBus regulators (instead of having them as their own top-level regulators without an upstream supply) leads to enable-count underflow errors when disabling them: # echo 0 > /sys/bus/platform/devices/efuse01/state [ 906.094477] regulator-dummy: Underflow of regulator enable count [ 906.100563] Failed to disable vout: -EINVAL [ 136.992676] reg-userspace-consumer efuse01: Failed to configure state: -22 Zev reports that reverting the patch fixes the problem. So let's do that for now. Fixes: 54cc3dbfc10d ("hwmon: (pmbus) Add regulator supply into macro") Cc: Marcello Sylvester Bauer Reported-by: Zev Weiss Signed-off-by: Guenter Roeck commit c4f683731db330460d909bd0ca8d5af876fcdc97 Author: Cristian Marussi Date: Mon Oct 31 11:40:18 2022 +0000 hwmon: (scmi) Register explicitly with Thermal Framework Available sensors are enumerated and reported by the SCMI platform server using a 16bit identification number; not all such sensors are of a type supported by hwmon subsystem and, among the supported ones, only a subset could be temperature sensors that have to be registered with the Thermal Framework. Potential clashes between hwmon channels indexes and the underlying real sensors IDs do not play well with the hwmon<-->thermal bridge automatic registration routines and could need a sensible number of fake dummy sensors to be made up in order to keep indexes and IDs in sync. Avoid to use the hwmon<-->thermal bridge dropping the HWMON_C_REGISTER_TZ attribute and instead explicit register temperature sensors directly with the Thermal Framework. Cc: Daniel Lezcano Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Cristian Marussi Acked-by: Sudeep Holla Link: https://lore.kernel.org/r/20221031114018.59048-1-cristian.marussi@arm.com Signed-off-by: Guenter Roeck commit 8f401ec1c8975eabfe4c089de91cbe058deabf71 Author: Dan Williams Date: Thu Nov 3 17:31:00 2022 -0700 cxl/region: Recycle region ids At region creation time the next region-id is atomically cached so that there is predictability of region device names. If that region is destroyed and then a new one is created the region id increments. That ends up looking like a memory leak, or is otherwise surprising that identifiers roll forward even after destroying all previously created regions. Try to reuse rather than free old region ids at region release time. While this fixes a cosmetic issue, the needlessly advancing memory region-id gives the appearance of a memory leak, hence the "Fixes" tag, but no "Cc: stable" tag. Cc: Ben Widawsky Cc: Jonathan Cameron Fixes: 779dd20cfb56 ("cxl/region: Add region creation support") Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752186062.947915.13200195701224993317.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit e4f6dfa9ef756a3934a4caf618b1e86e9e8e21d0 Author: Dan Williams Date: Thu Nov 3 17:30:54 2022 -0700 cxl/region: Fix 'distance' calculation with passthrough ports When programming port decode targets, the algorithm wants to ensure that two devices are compatible to be programmed as peers beneath a given port. A compatible peer is a target that shares the same dport, and where that target's interleave position also routes it to the same dport. Compatibility is determined by the device's interleave position being >= to distance. For example, if a given dport can only map every Nth position then positions less than N away from the last target programmed are incompatible. The @distance for the host-bridge's cxl_port in a simple dual-ported host-bridge configuration with 2 direct-attached devices is 1, i.e. An x2 region divided by 2 dports to reach 2 region targets. An x4 region under an x2 host-bridge would need 2 intervening switches where the @distance at the host bridge level is 2 (x4 region divided by 2 switches to reach 4 devices). However, the distance between peers underneath a single ported host-bridge is always zero because there is no limit to the number of devices that can be mapped. In other words, there are no decoders to program in a passthrough, all descendants are mapped and distance only starts matters for the intervening descendant ports of the passthrough port. Add tracking for the number of dports mapped to a port, and use that to detect the passthrough case for calculating @distance. Cc: Reported-by: Bobo WL Reported-by: Jonathan Cameron Link: http://lore.kernel.org/r/20221010172057.00001559@huawei.com Fixes: 27b3f8d13830 ("cxl/region: Program target lists") Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752185440.947915.6617495912508299445.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit e41c8452b9b204689e68756a3836d1d37b617ad5 Author: Dan Williams Date: Thu Nov 3 17:30:48 2022 -0700 tools/testing/cxl: Add a single-port host-bridge regression config Jonathan reports that region creation fails when a single-port host-bridge connects to a multi-port switch. Mock up that configuration so a fix can be tested and regression tested going forward. Reported-by: Bobo WL Reported-by: Jonathan Cameron Link: http://lore.kernel.org/r/20221010172057.00001559@huawei.com Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752184838.947915.2167957540894293891.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 86e86c3cb63325c12ea99fbce2cc5bafba86bb40 Author: Dan Williams Date: Thu Nov 3 17:30:42 2022 -0700 tools/testing/cxl: Fix some error exits Fix a few typos where 'goto err_port' was used rather than the object specific cleanup. Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752184255.947915.16163477849330181425.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 4d07ae22e79ebc2d7528bbc69daa53b86981cb3a Author: Dan Williams Date: Thu Nov 3 17:30:36 2022 -0700 cxl/pmem: Fix cxl_pmem_region and cxl_memdev leak When a cxl_nvdimm object goes through a ->remove() event (device physically removed, nvdimm-bridge disabled, or nvdimm device disabled), then any associated regions must also be disabled. As highlighted by the cxl-create-region.sh test [1], a single device may host multiple regions, but the driver was only tracking one region at a time. This leads to a situation where only the last enabled region per nvdimm device is cleaned up properly. Other regions are leaked, and this also causes cxl_memdev reference leaks. Fix the tracking by allowing cxl_nvdimm objects to track multiple region associations. Cc: Link: https://github.com/pmem/ndctl/blob/main/test/cxl-create-region.sh [1] Reported-by: Vishal Verma Fixes: 04ad63f086d1 ("cxl/region: Introduce cxl_pmem_region objects") Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752183647.947915.2045230911503793901.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 0d9e734018d70cecf79e2e4c6082167160a0f13f Author: Dan Williams Date: Thu Nov 3 17:30:30 2022 -0700 cxl/region: Fix cxl_region leak, cleanup targets at region delete When a region is deleted any targets that have been previously assigned to that region hold references to it. Trigger those references to drop by detaching all targets at unregister_region() time. Otherwise that region object will leak as userspace has lost the ability to detach targets once region sysfs is torn down. Cc: Fixes: b9686e8c8e39 ("cxl/region: Enable the assignment of endpoint decoders to regions") Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166752183055.947915.17681995648556534844.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit a90accb358ae33ea982a35595573f7a045993f8b Author: Dan Williams Date: Thu Nov 3 17:30:24 2022 -0700 cxl/region: Fix region HPA ordering validation Some regions may not have any address space allocated. Skip them when validating HPA order otherwise a crash like the following may result: devm_cxl_add_region: cxl_acpi cxl_acpi.0: decoder3.4: created region9 BUG: kernel NULL pointer dereference, address: 0000000000000000 [..] RIP: 0010:store_targetN+0x655/0x1740 [cxl_core] [..] Call Trace: kernfs_fop_write_iter+0x144/0x200 vfs_write+0x24a/0x4d0 ksys_write+0x69/0xf0 do_syscall_64+0x3a/0x90 store_targetN+0x655/0x1740: alloc_region_ref at drivers/cxl/core/region.c:676 (inlined by) cxl_port_attach_region at drivers/cxl/core/region.c:850 (inlined by) cxl_region_attach at drivers/cxl/core/region.c:1290 (inlined by) attach_target at drivers/cxl/core/region.c:1410 (inlined by) store_targetN at drivers/cxl/core/region.c:1453 Cc: Fixes: 384e624bb211 ("cxl/region: Attach endpoint decoders") Reviewed-by: Vishal Verma Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/166752182461.947915.497032805239915067.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit c86df29d11dfba27c0a1f5039cd6fe387fbf4239 Author: Peter Zijlstra Date: Thu Nov 3 13:00:14 2022 +0100 bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace) The dispatcher function is currently abusing the ftrace __fentry__ call location for its own purposes -- this obviously gives trouble when the dispatcher and ftrace are both in use. A previous solution tried using __attribute__((patchable_function_entry())) which works, except it is GCC-8+ only, breaking the build on the earlier still supported compilers. Instead use static_call() -- which has its own annotations and does not conflict with ftrace -- to rewrite the dispatch function. By using: return static_call()(ctx, insni, bpf_func) you get a perfect forwarding tail call as function body (iow a single jmp instruction). By having the default static_call() target be bpf_dispatcher_nop_func() it retains the default behaviour (an indirect call to the argument function). Only once a dispatcher program is attached is the target rewritten to directly call the JIT'ed image. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Daniel Borkmann Tested-by: Björn Töpel Tested-by: Jiri Olsa Acked-by: Björn Töpel Acked-by: Jiri Olsa Link: https://lkml.kernel.org/r/Y1/oBlK0yFk5c/Im@hirez.programming.kicks-ass.net Link: https://lore.kernel.org/bpf/20221103120647.796772565@infradead.org commit 18acb7fac22ff7b36c7ea5a76b12996e7b7dbaba Author: Peter Zijlstra Date: Thu Nov 3 13:00:13 2022 +0100 bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop") Because __attribute__((patchable_function_entry)) is only available since GCC-8 this solution fails to build on the minimum required GCC version. Undo these changes so we might try again -- without cluttering up the patches with too many changes. This is an almost complete revert of: dbe69b299884 ("bpf: Fix dispatcher patchable function entry to 5 bytes nop") ceea991a019c ("bpf: Move bpf_dispatcher function out of ftrace locations") (notably the arch/x86/Kconfig hunk is kept). Reported-by: David Laight Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Daniel Borkmann Tested-by: Björn Töpel Tested-by: Jiri Olsa Acked-by: Björn Töpel Acked-by: Jiri Olsa Link: https://lkml.kernel.org/r/439d8dc735bb4858875377df67f1b29a@AcuMS.aculab.com Link: https://lore.kernel.org/bpf/20221103120647.728830733@infradead.org commit 64c3dd0b98f586a5b7c8f5f4759ebb41cfd03861 Merge: 5d8401be15a9e 4eb559dd15671 Author: Linus Torvalds Date: Fri Nov 4 15:05:42 2022 -0700 Merge tag 'xfs-6.1-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "Dave and I had thought that this would be a very quiet cycle, but we thought wrong. At first there were the usual trickle of minor bugfixes, but then Zorro pulled -rc1 and noticed complaints about the stronger memcpy checks w.r.t. flex arrays. Analyzing how to fix that revealed a bunch of validation gaps in validating ondisk log items during recovery, and then a customer hit an infinite loop in the refcounting code on a corrupt filesystem. So. This largeish batch of fixes addresses all those problems, I hope. Summary: - Fix a UAF bug during log recovery - Fix memory leaks when mount fails - Detect corrupt bestfree information in a directory block - Fix incorrect return value type for the dax page fault handlers - Fix fortify complaints about memcpy of xfs log item objects - Strengthen inadequate validation of recovered log items - Fix incorrectly declared flex array in EFI log item structs - Log corrupt log items for debugging purposes - Fix infinite loop problems in the refcount code if the refcount btree node block keys are corrupt - Fix infinite loop problems in the refcount code if the refcount btree records suffer MSB bitflips - Add more sanity checking to continued defer ops to prevent overflows from one AG to the next or off EOFS" * tag 'xfs-6.1-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (28 commits) xfs: rename XFS_REFC_COW_START to _COWFLAG xfs: fix uninitialized list head in struct xfs_refcount_recovery xfs: fix agblocks check in the cow leftover recovery function xfs: check record domain when accessing refcount records xfs: remove XFS_FIND_RCEXT_SHARED and _COW xfs: refactor domain and refcount checking xfs: report refcount domain in tracepoints xfs: track cow/shared record domains explicitly in xfs_refcount_irec xfs: refactor refcount record usage in xchk_refcountbt_rec xfs: dump corrupt recovered log intent items to dmesg consistently xfs: move _irec structs to xfs_types.h xfs: actually abort log recovery on corrupt intent-done log items xfs: check deferred refcount op continuation parameters xfs: refactor all the EFI/EFD log item sizeof logic xfs: create a predicate to verify per-AG extents xfs: fix memcpy fortify errors in EFI log format copying xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents xfs: fix memcpy fortify errors in RUI log format copying xfs: fix memcpy fortify errors in CUI log format copying xfs: fix memcpy fortify errors in BUI log format copying ... commit 5d8401be15a9e59af701db08fc0f973c3587f2ae Merge: bd745027438a8 091873e47ef70 Author: Linus Torvalds Date: Fri Nov 4 14:55:47 2022 -0700 Merge tag 'landlock-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull landlock fix from Mickaël Salaün: "Fix the test build for some distros" * tag 'landlock-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: selftests/landlock: Build without static libraries commit bd745027438a854e2d7c124032e9ad4aa389e153 Merge: 1caa2f182afb5 6f7630b1b5bc6 Author: Linus Torvalds Date: Fri Nov 4 14:46:45 2022 -0700 Merge tag 'hardening-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fix from Kees Cook: - Correctly report struct member size on memcpy overflow (Kees Cook) * tag 'hardening-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: fortify: Capture __bos() results in const temp vars commit 1caa2f182afb59de9d6d5ba64b340df011a0b653 Merge: 10d916c86ecaf 23715a26c8d81 Author: Linus Torvalds Date: Fri Nov 4 14:37:25 2022 -0700 Merge tag 'efi-fixes-for-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - A pair of tweaks to the EFI random seed code so that externally provided version of this config table are handled more robustly - Another fix for the v6.0 EFI variable refactor that turned out to break Apple machines which don't provide QueryVariableInfo() - Add some guard rails to the EFI runtime service call wrapper so we can recover from synchronous exceptions caused by firmware * tag 'efi-fixes-for-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: arm64: efi: Recover from synchronous exceptions occurring in firmware efi: efivars: Fix variable writes with unsupported query_variable_store() efi: random: Use 'ACPI reclaim' memory for random seed efi: random: reduce seed size to 32 bytes efi/tpm: Pass correct address to memblock_reserve commit 10d916c86ecafeccaed89175ebf9b832dddde380 Merge: fde25beb382b7 5449cabd95bbf Author: Linus Torvalds Date: Fri Nov 4 14:13:12 2022 -0700 Merge tag 'soc-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "There are not a lot of important fixes for the soc tree yet this time, but it's time to upstream what I got so far: - DT Fixes for Arm Juno and ST-Ericsson Ux500 to add missing critical temperature points - A number of fixes for the Arm SCMI firmware, addressing correctness issues in the code, in particular error handling and resource leaks. - One error handling fix for the new i.MX93 power domain driver - Several devicetree fixes for NXP i.MX6/8/9 and Layerscape chips, fixing incorrect or missing DT properties for MDIO controller nodes, CPLD, USB and regulators for various boards, as well as some fixes for DT schema checks. - MAINTAINERS file updates for HiSilicon LPC Bus and Broadcom git URLs" * tag 'soc-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (26 commits) arm64: dts: juno: Add thermal critical trip points firmware: arm_scmi: Fix deferred_tx_wq release on error paths firmware: arm_scmi: Fix devres allocation device in virtio transport firmware: arm_scmi: Make Rx chan_setup fail on memory errors firmware: arm_scmi: Make tx_prepare time out eventually firmware: arm_scmi: Suppress the driver's bind attributes firmware: arm_scmi: Cleanup the core driver removal callback MAINTAINERS: Update HiSilicon LPC BUS Driver maintainer ARM: dts: ux500: Add trips to battery thermal zones arm64: dts: ls208xa: specify clock frequencies for the MDIO controllers arm64: dts: ls1088a: specify clock frequencies for the MDIO controllers arm64: dts: lx2160a: specify clock frequencies for the MDIO controllers soc: imx: imx93-pd: Fix the error handling path of imx93_pd_probe() arm64: dts: imx93: correct gpio-ranges arm64: dts: imx93: correct s4mu interrupt names dt-bindings: power: gpcv2: add power-domains property arm64: dts: imx8: correct clock order ARM: dts: imx6dl-yapp4: Do not allow PM to switch PU regulator off on Q/QP ARM: dts: imx6qdl-gw59{10,13}: fix user pushbutton GPIO offset arm64: dts: imx8mn: Correct the usb power domain ... commit 7beade0dd41d42d797ccb7791b134a77fcebf35b Author: Tony Luck Date: Thu Nov 3 13:33:10 2022 -0700 x86/cpu: Add several Intel server CPU model numbers These servers are all on the public versions of the roadmap. The model numbers for Grand Ridge, Granite Rapids, and Sierra Forest were included in the September 2022 edition of the Instruction Set Extensions document. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Link: https://lore.kernel.org/r/20221103203310.5058-1-tony.luck@intel.com commit 6e59419fd0a244dd55e53e798797f0697dec8b1c Author: Peng Wu Date: Sun Sep 11 06:00:53 2022 +0000 phy: sunplus: Fix an IS_ERR() vs NULL bug in sp_usb_phy_probe The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Fixes: 99d9ccd973852 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Peng Wu Link: https://lore.kernel.org/r/20220911060053.123594-1-wupeng58@huawei.com Signed-off-by: Vinod Koul commit 4cc47e8add635408e063c98b52d56b7ceacf0b70 Author: Stephen Boyd Date: Thu Nov 3 11:30:30 2022 -0700 clk: qcom: gdsc: Remove direct runtime PM calls We shouldn't be calling runtime PM APIs from within the genpd enable/disable path for a couple reasons. First, this causes an AA lockdep splat[1] because genpd can call into genpd code again while holding the genpd lock. WARNING: possible recursive locking detected 5.19.0-rc2-lockdep+ #7 Not tainted -------------------------------------------- kworker/2:1/49 is trying to acquire lock: ffffffeea0370788 (&genpd->mlock){+.+.}-{3:3}, at: genpd_lock_mtx+0x24/0x30 but task is already holding lock: ffffffeea03710a8 (&genpd->mlock){+.+.}-{3:3}, at: genpd_lock_mtx+0x24/0x30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&genpd->mlock); lock(&genpd->mlock); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by kworker/2:1/49: #0: 74ffff80811a5748 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x320/0x5fc #1: ffffffc008537cf8 ((work_completion)(&genpd->power_off_work)){+.+.}-{0:0}, at: process_one_work+0x354/0x5fc #2: ffffffeea03710a8 (&genpd->mlock){+.+.}-{3:3}, at: genpd_lock_mtx+0x24/0x30 stack backtrace: CPU: 2 PID: 49 Comm: kworker/2:1 Not tainted 5.19.0-rc2-lockdep+ #7 Hardware name: Google Lazor (rev3 - 8) with KB Backlight (DT) Workqueue: pm genpd_power_off_work_fn Call trace: dump_backtrace+0x1a0/0x200 show_stack+0x24/0x30 dump_stack_lvl+0x7c/0xa0 dump_stack+0x18/0x44 __lock_acquire+0xb38/0x3634 lock_acquire+0x180/0x2d4 __mutex_lock_common+0x118/0xe30 mutex_lock_nested+0x70/0x7c genpd_lock_mtx+0x24/0x30 genpd_runtime_suspend+0x2f0/0x414 __rpm_callback+0xdc/0x1b8 rpm_callback+0x4c/0xcc rpm_suspend+0x21c/0x5f0 rpm_idle+0x17c/0x1e0 __pm_runtime_idle+0x78/0xcc gdsc_disable+0x24c/0x26c _genpd_power_off+0xd4/0x1c4 genpd_power_off+0x2d8/0x41c genpd_power_off_work_fn+0x60/0x94 process_one_work+0x398/0x5fc worker_thread+0x42c/0x6c4 kthread+0x194/0x1b4 ret_from_fork+0x10/0x20 Second, this confuses runtime PM on CoachZ for the camera devices by causing the camera clock controller's runtime PM usage_count to go negative after resuming from suspend. This is because runtime PM is being used on the clock controller while runtime PM is disabled for the device. The reason for the negative count is because a GDSC is represented as a genpd and each genpd that is attached to a device is resumed during the noirq phase of system wide suspend/resume (see the noirq suspend ops assignment in pm_genpd_init() for more details). The camera GDSCs are attached to camera devices with the 'power-domains' property in DT. Every device has runtime PM disabled in the late system suspend phase via __device_suspend_late(). Runtime PM is not usable until runtime PM is enabled in device_resume_early(). The noirq phases run after the 'late' and before the 'early' phase of suspend/resume. When the genpds are resumed in genpd_resume_noirq(), we call down into gdsc_enable() that calls pm_runtime_resume_and_get() and that returns -EACCES to indicate failure to resume because runtime PM is disabled for all devices. Upon closer inspection, calling runtime PM APIs like this in the GDSC driver doesn't make sense. It was intended to make sure the GDSC for the clock controller providing other GDSCs was enabled, specifically the MMCX GDSC for the display clk controller on SM8250 (sm8250-dispcc), so that GDSC register accesses succeeded. That will already happen because we make the 'dev->pm_domain' a parent domain of each GDSC we register in gdsc_register() via pm_genpd_add_subdomain(). When any of these GDSCs are accessed, we'll enable the parent domain (in this specific case MMCX). We also remove any getting of runtime PM during registration, because when a genpd is registered it increments the count on the parent if the genpd itself is already enabled. Cc: Dmitry Baryshkov Cc: Johan Hovold Cc: Ulf Hansson Cc: Taniya Das Cc: Satya Priya Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Cc: Matthias Kaehlcke Reported-by: Stephen Boyd Link: https://lore.kernel.org/r/CAE-0n52xbZeJ66RaKwggeRB57fUAwjvxGxfFMKOKJMKVyFTe+w@mail.gmail.com [1] Fixes: 1b771839de05 ("clk: qcom: gdsc: enable optional power domain support") Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20221103183030.3594899-1-swboyd@chromium.org Tested-by: Johan Hovold Reviewed-by: Johan Hovold Signed-off-by: Stephen Boyd commit fde25beb382b7dd6f2eab8022ab017cbdfaa3ff6 Merge: db385e0be4d7a 6295f1d8b4503 Author: Linus Torvalds Date: Fri Nov 4 11:31:41 2022 -0700 Merge tag 'drm-fixes-2022-11-04-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "This is the weekly fixes for rc4. Misc fixes across rockchip, imx, amdgpu and i915. The biggest change is for amdkfd where the trap handler needs an updated fw from a header which makes it a bit larger. I hadn't noticed this particular file before so I'm going to figure out what the magic is for, but the fix should be fine for now. amdgpu: - DCN 3.1.4 fixes - DCN 3.2.x fixes - GC 11.x fixes - Virtual display fix - Fail suspend if resources can't be evicted - SR-IOV fix - Display PSR fix amdkfd: - Fix possible NULL pointer deref - GC 11.x trap handler fix i915: - Add locking around DKL PHY register accesses - Stop abusing swiotlb_max_segment - Filter out invalid outputs more sensibly - Setup DDC fully before output init - Simplify intel_panel_add_edid_alt_fixed_modes() - Grab mode_config.mutex during LVDS init to avoid WARNs rockchip: - fix probing issues - fix framebuffer without iommu - fix vop selection - fix NULL ptr access imx: - Fix Kconfig - fix mode_valid function" * tag 'drm-fixes-2022-11-04-1' of git://anongit.freedesktop.org/drm/drm: (35 commits) drm/amdkfd: update GFX11 CWSR trap handler drm/amd/display: Investigate tool reported FCLK P-state deviations drm/amd/display: Add DSC delay factor workaround drm/amd/display: Round up DST_after_scaler to nearest int drm/amd/display: Use forced DSC bpp in DML drm/amd/display: Fix DCN32 DSC delay calculation drm/amdgpu: Disable GPU reset on SRIOV before remove pci. drm/amdgpu: disable GFXOFF during compute for GFX11 drm/amd: Fail the suspend if resources can't be evicted drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram() drm/amdgpu: correct MES debugfs versions drm/amdgpu: set fb_modifiers_not_supported in vkms drm/amd/display: cursor update command incomplete drm/amd/display: Enable timing sync on DCN32 drm/amd/display: Set memclk levels to be at least 1 for dcn32 drm/amd/display: Update latencies on DCN321 drm/amd/display: Limit dcn32 to 1950Mhz display clock drm/amd/display: Ignore Cable ID Feature drm/amd/display: Update DSC capabilitie for DCN314 drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid ... commit db385e0be4d7a737ddb793d2275a24735f4e9bd7 Merge: ee6050c8af96b ffa20aa581cf5 Author: Linus Torvalds Date: Fri Nov 4 11:22:44 2022 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "Fixes in clk drivers and some clk rate range fixes in the core as well: - Make sure the struct clk_rate_request is more sane - Remove a WARN_ON that was triggering for clks with no parents that can change frequency - Fix bad i2c bus transactions on Renesas rs9 - Actually return an error in clk_mt8195_topck_probe() on an error path - Keep the GPU memories powered while the clk isn't enabled on Qualcomm's sc7280 SoC - Fix the parent clk for HSCIF modules on Renesas' R-Car V4H SoC" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: qcom: Update the force mem core bit for GPU clocks clk: Initialize max_rate in struct clk_rate_request clk: Initialize the clk_rate_request even if clk_core is NULL clk: Remove WARN_ON NULL parent in clk_core_init_rate_req() clk: renesas: r8a779g0: Fix HSCIF parent clocks clk: renesas: r8a779g0: Add SASYNCPER clocks clk: mediatek: clk-mt8195-topckgen: Fix error return code in clk_mt8195_topck_probe() clk: sifive: select by default if SOC_SIFIVE clk: rs9: Fix I2C accessors commit d3fd203f36d46aa29600a72d57a1b61af80e4a25 Author: Baisong Zhong Date: Wed Nov 2 16:16:20 2022 +0800 bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() We got a syzkaller problem because of aarch64 alignment fault if KFENCE enabled. When the size from user bpf program is an odd number, like 399, 407, etc, it will cause the struct skb_shared_info's unaligned access. As seen below: BUG: KFENCE: use-after-free read in __skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032 Use-after-free read at 0xffff6254fffac077 (in kfence-#213): __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:26 [inline] arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline] arch_atomic_inc include/linux/atomic-arch-fallback.h:270 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] __skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032 skb_clone+0xf4/0x214 net/core/skbuff.c:1481 ____bpf_clone_redirect net/core/filter.c:2433 [inline] bpf_clone_redirect+0x78/0x1c0 net/core/filter.c:2420 bpf_prog_d3839dd9068ceb51+0x80/0x330 bpf_dispatcher_nop_func include/linux/bpf.h:728 [inline] bpf_test_run+0x3c0/0x6c0 net/bpf/test_run.c:53 bpf_prog_test_run_skb+0x638/0xa7c net/bpf/test_run.c:594 bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline] __do_sys_bpf kernel/bpf/syscall.c:4441 [inline] __se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381 kfence-#213: 0xffff6254fffac000-0xffff6254fffac196, size=407, cache=kmalloc-512 allocated by task 15074 on cpu 0 at 1342.585390s: kmalloc include/linux/slab.h:568 [inline] kzalloc include/linux/slab.h:675 [inline] bpf_test_init.isra.0+0xac/0x290 net/bpf/test_run.c:191 bpf_prog_test_run_skb+0x11c/0xa7c net/bpf/test_run.c:512 bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline] __do_sys_bpf kernel/bpf/syscall.c:4441 [inline] __se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381 __arm64_sys_bpf+0x50/0x60 kernel/bpf/syscall.c:4381 To fix the problem, we adjust @size so that (@size + @hearoom) is a multiple of SMP_CACHE_BYTES. So we make sure the struct skb_shared_info is aligned to a cache line. Fixes: 1cf1cae963c2 ("bpf: introduce BPF_PROG_TEST_RUN command") Signed-off-by: Baisong Zhong Signed-off-by: Daniel Borkmann Cc: Eric Dumazet Link: https://lore.kernel.org/bpf/20221102081620.1465154-1-zhongbaisong@huawei.com commit eb4940d4adf590590a9d0c47e38d2799c2ff9670 Author: Vlastimil Babka Date: Fri Nov 4 13:57:11 2022 +0100 mm/slab: remove !CONFIG_TRACING variants of kmalloc_[node_]trace() For !CONFIG_TRACING kernels, the kmalloc() implementation tries (in cases where the allocation size is build-time constant) to save a function call, by inlining kmalloc_trace() to a kmem_cache_alloc() call. However since commit 6edf2576a6cc ("mm/slub: enable debugging memory wasting of kmalloc") this path now fails to pass the original request size to be eventually recorded (for kmalloc caches with debugging enabled). We could adjust the code to call __kmem_cache_alloc_node() as the CONFIG_TRACING variant, but that would as a result inline a call with 5 parameters, bloating the kmalloc() call sites. The cost of extra function call (to kmalloc_trace()) seems like a lesser evil. It also appears that the !CONFIG_TRACING variant is incompatible with upcoming hardening efforts [1] so it's easier if we just remove it now. Kernels with no tracing are rare these days and the benefit is dubious anyway. [1] https://lore.kernel.org/linux-mm/20221101222520.never.109-kees@kernel.org/T/#m20ecf14390e406247bde0ea9cce368f469c539ed Link: https://lore.kernel.org/all/097d8fba-bd10-a312-24a3-a4068c4f424c@suse.cz/ Suggested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit bff6bef701db784bb159a659e99c785b4594fc96 Author: Vitaly Rodionov Date: Fri Nov 4 10:06:37 2022 +0000 spi: amd: Fix SPI_SPD7 value According to data sheet SPI_SPD7 should be set to 7. Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20221104100637.13376-1-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown commit a1dca8774faf3f77eb34fa0ac6f3e2b82290b1e4 Author: Jason Montleon Date: Thu Nov 3 10:46:12 2022 -0400 ASoC: rt5677: fix legacy dai naming Starting with 6.0-rc1 the CPU DAI is not registered and the sound card is unavailable. Adding legacy_dai_naming causes it to function properly again. Fixes: fc34ece41f71 ("ASoC: Refactor non_legacy_dai_naming flag") Signed-off-by: Jason Montleon Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221103144612.4431-2-jmontleo@redhat.com Signed-off-by: Mark Brown commit 392cc13c5ec72ccd6bbfb1bc2339502cc59dd285 Author: Jason Montleon Date: Thu Nov 3 10:46:11 2022 -0400 ASoC: rt5514: fix legacy dai naming Starting with 6.0-rc1 these messages are logged and the sound card is unavailable. Adding legacy_dai_naming to the rt5514-spi causes it to function properly again. [ 16.928454] kbl_r5514_5663_max kbl_r5514_5663_max: ASoC: CPU DAI spi-PRP0001:00 not registered [ 16.928561] platform kbl_r5514_5663_max: deferred probe pending Fixes: fc34ece41f71 ("ASoC: Refactor non_legacy_dai_naming flag") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216641 Signed-off-by: Jason Montleon Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221103144612.4431-1-jmontleo@redhat.com Signed-off-by: Mark Brown commit 1118b2049d77ca0b505775fc1a8d1909cf19a7ec Author: Wang Yufen Date: Wed Nov 2 17:41:19 2022 +0800 net: tun: Fix memory leaks of napi_get_frags kmemleak reports after running test_progs: unreferenced object 0xffff8881b1672dc0 (size 232): comm "test_progs", pid 394388, jiffies 4354712116 (age 841.975s) hex dump (first 32 bytes): e0 84 d7 a8 81 88 ff ff 80 2c 67 b1 81 88 ff ff .........,g..... 00 40 c5 9b 81 88 ff ff 00 00 00 00 00 00 00 00 .@.............. backtrace: [<00000000c8f01748>] napi_skb_cache_get+0xd4/0x150 [<0000000041c7fc09>] __napi_build_skb+0x15/0x50 [<00000000431c7079>] __napi_alloc_skb+0x26e/0x540 [<000000003ecfa30e>] napi_get_frags+0x59/0x140 [<0000000099b2199e>] tun_get_user+0x183d/0x3bb0 [tun] [<000000008a5adef0>] tun_chr_write_iter+0xc0/0x1b1 [tun] [<0000000049993ff4>] do_iter_readv_writev+0x19f/0x320 [<000000008f338ea2>] do_iter_write+0x135/0x630 [<000000008a3377a4>] vfs_writev+0x12e/0x440 [<00000000a6b5639a>] do_writev+0x104/0x280 [<00000000ccf065d8>] do_syscall_64+0x3b/0x90 [<00000000d776e329>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The issue occurs in the following scenarios: tun_get_user() napi_gro_frags() napi_frags_finish() case GRO_NORMAL: gro_normal_one() list_add_tail(&skb->list, &napi->rx_list); <-- While napi->rx_count < READ_ONCE(gro_normal_batch), <-- gro_normal_list() is not called, napi->rx_list is not empty <-- not ask to complete the gro work, will cause memory leaks in <-- following tun_napi_del() ... tun_napi_del() netif_napi_del() __netif_napi_del() <-- &napi->rx_list is not empty, which caused memory leaks To fix, add napi_complete() after napi_gro_frags(). Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Wang Yufen Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 51afe9026d0c63263abe9840e629f118d7405b36 Author: Ratheesh Kannoth Date: Wed Nov 2 08:41:13 2022 +0530 octeontx2-pf: NIX TX overwrites SQ_CTX_HW_S[SQ_INT] In scenarios where multiple errors have occurred for a SQ before SW starts handling error interrupt, SQ_CTX[OP_INT] may get overwritten leading to NIX_LF_SQ_OP_INT returning incorrect value. To workaround this read LMT, MNQ and SQ individual error status registers to determine the cause of error. Fixes: 4ff7d1488a84 ("octeontx2-pf: Error handling support") Signed-off-by: Ratheesh Kannoth Reviewed-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 1a0c016a4831ea29be09bbc8162d4a2a0690b4b8 Author: Roger Quadros Date: Wed Nov 2 12:31:44 2022 +0200 net: ethernet: ti: am65-cpsw: Fix segmentation fault at module unload Move am65_cpsw_nuss_phylink_cleanup() call to after am65_cpsw_nuss_cleanup_ndev() so phylink is still valid to prevent the below Segmentation fault on module remove when first slave link is up. [ 31.652944] Unable to handle kernel paging request at virtual address 00040008000005f4 [ 31.684627] Mem abort info: [ 31.687446] ESR = 0x0000000096000004 [ 31.704614] EC = 0x25: DABT (current EL), IL = 32 bits [ 31.720663] SET = 0, FnV = 0 [ 31.723729] EA = 0, S1PTW = 0 [ 31.740617] FSC = 0x04: level 0 translation fault [ 31.756624] Data abort info: [ 31.759508] ISV = 0, ISS = 0x00000004 [ 31.776705] CM = 0, WnR = 0 [ 31.779695] [00040008000005f4] address between user and kernel address ranges [ 31.808644] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 31.814928] Modules linked in: wlcore_sdio wl18xx wlcore mac80211 libarc4 cfg80211 rfkill crct10dif_ce phy_gmii_sel ti_am65_cpsw_nuss(-) sch_fq_codel ipv6 [ 31.828776] CPU: 0 PID: 1026 Comm: modprobe Not tainted 6.1.0-rc2-00012-gfabfcf7dafdb-dirty #160 [ 31.837547] Hardware name: Texas Instruments AM625 (DT) [ 31.842760] pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 31.849709] pc : phy_stop+0x18/0xf8 [ 31.853202] lr : phylink_stop+0x38/0xf8 [ 31.857031] sp : ffff80000a0839f0 [ 31.860335] x29: ffff80000a0839f0 x28: ffff000000de1c80 x27: 0000000000000000 [ 31.867462] x26: 0000000000000000 x25: 0000000000000000 x24: ffff80000a083b98 [ 31.874589] x23: 0000000000000800 x22: 0000000000000001 x21: ffff000001bfba90 [ 31.881715] x20: ffff0000015ee000 x19: 0004000800000200 x18: 0000000000000000 [ 31.888842] x17: ffff800076c45000 x16: ffff800008004000 x15: 000058e39660b106 [ 31.895969] x14: 0000000000000144 x13: 0000000000000144 x12: 0000000000000000 [ 31.903095] x11: 000000000000275f x10: 00000000000009e0 x9 : ffff80000a0837d0 [ 31.910222] x8 : ffff000000de26c0 x7 : ffff00007fbd6540 x6 : ffff00007fbd64c0 [ 31.917349] x5 : ffff00007fbd0b10 x4 : ffff00007fbd0b10 x3 : ffff00007fbd3920 [ 31.924476] x2 : d0a07fcff8b8d500 x1 : 0000000000000000 x0 : 0004000800000200 [ 31.931603] Call trace: [ 31.934042] phy_stop+0x18/0xf8 [ 31.937177] phylink_stop+0x38/0xf8 [ 31.940657] am65_cpsw_nuss_ndo_slave_stop+0x28/0x1e0 [ti_am65_cpsw_nuss] [ 31.947452] __dev_close_many+0xa4/0x140 [ 31.951371] dev_close_many+0x84/0x128 [ 31.955115] unregister_netdevice_many+0x130/0x6d0 [ 31.959897] unregister_netdevice_queue+0x94/0xd8 [ 31.964591] unregister_netdev+0x24/0x38 [ 31.968504] am65_cpsw_nuss_cleanup_ndev.isra.0+0x48/0x70 [ti_am65_cpsw_nuss] [ 31.975637] am65_cpsw_nuss_remove+0x58/0xf8 [ti_am65_cpsw_nuss] Cc: # v5.18+ Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK") Signed-off-by: Roger Quadros Signed-off-by: David S. Miller commit f4e405f566ff57db0c59e68a1b5ff4ff09989a91 Merge: cdb525ca92b19 aaab73f8fba4f Author: David S. Miller Date: Fri Nov 4 10:43:57 2022 +0000 Merge branch 'macsec-offload-fixes' Sabrina Dubroca says: ==================== macsec: offload-related fixes I'm working on a dummy offload for macsec on netdevsim. It just has a small SecY and RXSC table so I can trigger failures easily on the ndo_* side. It has exposed a couple of issues. The first patch is a revert of commit c850240b6c41 ("net: macsec: report real_dev features when HW offloading is enabled"). That commit tried to improve the performance of macsec offload by taking advantage of some of the NIC's features, but in doing so, broke macsec offload when the lower device supports both macsec and ipsec offload, as the ipsec offload feature flags were copied from the real device. Since the macsec device doesn't provide xdo_* ops, the XFRM core rejects the registration of the new macsec device in xfrm_api_check. I'm working on re-adding those feature flags when offload is available, but I haven't fully solved that yet. I think it would be safer to do that second part in net-next considering how complex feature interactions tend to be. v2: - better describe the issue introduced by commit c850240b6c41 (Leon Romanovsky) - patch #3: drop unnecessary !! (Leon Romanovsky) v3: - patch #3: drop extra newline (Jakub Kicinski) ==================== Signed-off-by: David S. Miller commit aaab73f8fba4fd38f4d2617440d541a1c334e819 Author: Sabrina Dubroca Date: Wed Nov 2 22:33:16 2022 +0100 macsec: clear encryption keys from the stack after setting up offload macsec_add_rxsa and macsec_add_txsa copy the key to an on-stack offloading context to pass it to the drivers, but leaves it there when it's done. Clear it with memzero_explicit as soon as it's not needed anymore. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: Sabrina Dubroca Reviewed-by: Antoine Tenart Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 80df4706357a5a06bbbc70273bf2611df1ceee04 Author: Sabrina Dubroca Date: Wed Nov 2 22:33:15 2022 +0100 macsec: fix detection of RXSCs when toggling offloading macsec_is_configured incorrectly uses secy->n_rx_sc to check if some RXSCs exist. secy->n_rx_sc only counts the number of active RXSCs, but there can also be inactive SCs as well, which may be stored in the driver (in case we're disabling offloading), or would have to be pushed to the device (in case we're trying to enable offloading). As long as RXSCs active on creation and never turned off, the issue is not visible. Fixes: dcb780fb2795 ("net: macsec: add nla support for changing the offloading selection") Signed-off-by: Sabrina Dubroca Reviewed-by: Antoine Tenart Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 73a4b31c9d11f98ae3bc5286d5382930adb0e9c7 Author: Sabrina Dubroca Date: Wed Nov 2 22:33:14 2022 +0100 macsec: fix secy->n_rx_sc accounting secy->n_rx_sc is supposed to be the number of _active_ rxsc's within a secy. This is then used by macsec_send_sci to help decide if we should add the SCI to the header or not. This logic is currently broken when we create a new RXSC and turn it off at creation, as create_rx_sc always sets ->active to true (and immediately uses that to increment n_rx_sc), and only later macsec_add_rxsc sets rx_sc->active. Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver") Signed-off-by: Sabrina Dubroca Reviewed-by: Antoine Tenart Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 93a30947821c203d08865c4e17ea181c9668ce52 Author: Sabrina Dubroca Date: Wed Nov 2 22:33:13 2022 +0100 macsec: delete new rxsc when offload fails Currently we get an inconsistent state: - netlink returns the error to userspace - the RXSC is installed but not offloaded Then the device could get confused when we try to add an RXSA, because the RXSC isn't supposed to exist. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: Sabrina Dubroca Reviewed-by: Antoine Tenart Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 8bcd560ae8784da57c610d857118c5d6576b1a8f Author: Sabrina Dubroca Date: Wed Nov 2 22:33:12 2022 +0100 Revert "net: macsec: report real_dev features when HW offloading is enabled" This reverts commit c850240b6c4132574a00f2da439277ab94265b66. That commit tried to improve the performance of macsec offload by taking advantage of some of the NIC's features, but in doing so, broke macsec offload when the lower device supports both macsec and ipsec offload, as the ipsec offload feature flags (mainly NETIF_F_HW_ESP) were copied from the real device. Since the macsec device doesn't provide xdo_* ops, the XFRM core rejects the registration of the new macsec device in xfrm_api_check. Example perf trace when running ip link add link eni1np1 type macsec port 4 offload mac ip 737 [003] 795.477676: probe:xfrm_dev_event__REGISTER name="macsec0" features=0x1c000080014869 xfrm_dev_event+0x3a notifier_call_chain+0x47 register_netdevice+0x846 macsec_newlink+0x25a ip 737 [003] 795.477687: probe:xfrm_dev_event__return ret=0x8002 (NOTIFY_BAD) notifier_call_chain+0x47 register_netdevice+0x846 macsec_newlink+0x25a dev->features includes NETIF_F_HW_ESP (0x04000000000000), so xfrm_api_check returns NOTIFY_BAD because we don't have dev->xfrmdev_ops on the macsec device. We could probably propagate GSO and a few other features from the lower device, similar to macvlan. This will be done in a future patch. Signed-off-by: Sabrina Dubroca Reviewed-by: Antoine Tenart Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit cdb525ca92b196f8916102b62431aa0d9a644ff2 Author: Adrien Thierry Date: Tue Nov 1 14:48:08 2022 -0400 selftests/net: give more time to udpgro bg processes to complete startup In some conditions, background processes in udpgro don't have enough time to set up the sockets. When foreground processes start, this results in the test failing with "./udpgso_bench_tx: sendmsg: Connection refused". For instance, this happens from time to time on a Qualcomm SA8540P SoC running CentOS Stream 9. To fix this, increase the time given to background processes to complete the startup before foreground processes start. Signed-off-by: Adrien Thierry Signed-off-by: David S. Miller commit cfdcb075048c1e886c45a9c9e681ed222f74ecb9 Author: Guangbin Huang Date: Tue Nov 1 15:48:38 2022 +0800 net: hns3: fix get wrong value of function hclge_get_dscp_prio() As the argument struct hnae3_handle *h of function hclge_get_dscp_prio() can be other client registered in hnae3 layer, we need to transform it into hnae3_handle of local nic client to get right dscp settings for other clients. Fixes: dfea275e06c2 ("net: hns3: optimize converting dscp to priority process of hns3_nic_select_queue()") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 4581dd480c9e42a1ad21dd8b9c110abe41878ce5 Author: Randy Dunlap Date: Mon Oct 31 22:08:13 2022 -0700 net: octeontx2-pf: mcs: consider MACSEC setting Fix build errors when MACSEC=m and OCTEONTX2_PF=y by having OCTEONTX2_PF depend on MACSEC if it is enabled. By adding "|| !MACSEC", this means that MACSEC is not required -- it can be disabled for this driver. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_remove': ../drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:(.text+0x2fd0): undefined reference to `cn10k_mcs_free' mips64-linux-ld: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.o: in function `otx2_mbox_up_handler_mcs_intr_notify': ../drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:(.text+0x4610): undefined reference to `cn10k_handle_mcs_event' Reported-by: kernel test robot Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Randy Dunlap Cc: Subbaraya Sundeep Cc: Sunil Goutham Cc: Geetha sowjanya Cc: hariprasad Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Signed-off-by: David S. Miller commit f77810f744139572a63e5a85ab6a8c10c2d44fb1 Author: Jason Gerecke Date: Thu Nov 3 10:33:04 2022 -0700 HID: wacom: Fix logic used for 3rd barrel switch emulation When support was added for devices using an explicit 3rd barrel switch, the logic used by devices emulating this feature was broken. The 'if' statement / block that was introduced only handles the case where the button is pressed (i.e. 'barrelswitch' and 'barrelswitch2' are both set) but not the case where it is released (i.e. one or both being cleared). This results in a BTN_STYLUS3 "down" event being sent when the button is pressed, but no "up" event ever being sent afterwards. This patch restores the previously-used logic for determining button states in the emulated case so that switches are reported correctly again. Link: https://github.com/linuxwacom/xf86-input-wacom/issues/292 Fixes: 6d09085b38e5 ("HID: wacom: Adding Support for new usages") CC: stable@vger.kernel.org #v5.19+ Signed-off-by: Jason Gerecke Tested-by: Joshua Dickens Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 91018bbcc664b6c9410ddccacd2239a4acadcfc9 Merge: 9e4b7a99a03ae f45cb6b29cd36 Author: Jakub Kicinski Date: Thu Nov 3 21:07:40 2022 -0700 Merge tag 'wireless-2022-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v6.1 Second set of fixes for v6.1. Some fixes to char type usage in drivers, memory leaks in the stack and also functionality fixes. The rt2x00 char type fix is a larger (but still simple) commit, otherwise the fixes are small in size. * tag 'wireless-2022-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update() wifi: ath11k: Fix QCN9074 firmware boot on x86 wifi: mac80211: Set TWT Information Frame Disabled bit as 1 wifi: mac80211: Fix ack frame idr leak when mesh has no route wifi: mac80211: fix general-protection-fault in ieee80211_subif_start_xmit() wifi: brcmfmac: Fix potential buffer overflow in brcmf_fweh_event_worker() wifi: airo: do not assign -1 to unsigned char wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support wifi: cfg80211: Fix bitrates overflow issue wifi: cfg80211: fix memory leak in query_regdb_file() wifi: mac80211: fix memory free error when registering wiphy fail wifi: cfg80211: silence a sparse RCU warning wifi: rt2x00: use explicitly signed or unsigned types ==================== Link: https://lore.kernel.org/r/20221103125315.04E57C433C1@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 9e4b7a99a03aefd37ba7bb1f022c8efab5019165 Author: Jiri Benc Date: Wed Nov 2 17:53:25 2022 +0100 net: gso: fix panic on frag_list with mixed head alloc types Since commit 3dcbdb134f32 ("net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list"), it is allowed to change gso_size of a GRO packet. However, that commit assumes that "checking the first list_skb member suffices; i.e if either of the list_skb members have non head_frag head, then the first one has too". It turns out this assumption does not hold. We've seen BUG_ON being hit in skb_segment when skbs on the frag_list had differing head_frag with the vmxnet3 driver. This happens because __netdev_alloc_skb and __napi_alloc_skb can return a skb that is page backed or kmalloced depending on the requested size. As the result, the last small skb in the GRO packet can be kmalloced. There are three different locations where this can be fixed: (1) We could check head_frag in GRO and not allow GROing skbs with different head_frag. However, that would lead to performance regression on normal forward paths with unmodified gso_size, where !head_frag in the last packet is not a problem. (2) Set a flag in bpf_skb_net_grow and bpf_skb_net_shrink indicating that NETIF_F_SG is undesirable. That would need to eat a bit in sk_buff. Furthermore, that flag can be unset when all skbs on the frag_list are page backed. To retain good performance, bpf_skb_net_grow/shrink would have to walk the frag_list. (3) Walk the frag_list in skb_segment when determining whether NETIF_F_SG should be cleared. This of course slows things down. This patch implements (3). To limit the performance impact in skb_segment, the list is walked only for skbs with SKB_GSO_DODGY set that have gso_size changed. Normal paths thus will not hit it. We could check only the last skb but since we need to walk the whole list anyway, let's stay on the safe side. Fixes: 3dcbdb134f32 ("net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list") Signed-off-by: Jiri Benc Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/e04426a6a91baf4d1081e1b478c82b5de25fdf21.1667407944.git.jbenc@redhat.com Signed-off-by: Jakub Kicinski commit f2c24be55bb7adf66c9bb994744352b28664cfcd Merge: 9521c9d6a53df 475244f5e06be Author: Jakub Kicinski Date: Thu Nov 3 19:51:02 2022 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== bpf 2022-11-04 We've added 8 non-merge commits during the last 3 day(s) which contain a total of 10 files changed, 113 insertions(+), 16 deletions(-). The main changes are: 1) Fix memory leak upon allocation failure in BPF verifier's stack state tracking, from Kees Cook. 2) Fix address leakage when BPF progs release reference to an object, from Youlin Li. 3) Fix BPF CI breakage from buggy in.h uapi header dependency, from Andrii Nakryiko. 4) Fix bpftool pin sub-command's argument parsing, from Pu Lehui. 5) Fix BPF sockmap lockdep warning by cancelling psock work outside of socket lock, from Cong Wang. 6) Follow-up for BPF sockmap to fix sk_forward_alloc accounting, from Wang Yufen. bpf-for-netdev * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Add verifier test for release_reference() bpf: Fix wrong reg type conversion in release_reference() bpf, sock_map: Move cancel_work_sync() out of sock lock tools/headers: Pull in stddef.h to uapi to fix BPF selftests build in CI net/ipv4: Fix linux/in.h header dependencies bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE bpf, sockmap: Fix the sk->sk_forward_alloc warning of sk_stream_kill_queues bpf, verifier: Fix memory leak in array reallocation for stack state ==================== Link: https://lore.kernel.org/r/20221104000445.30761-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 66f0919c953ef7b55e5ab94389a013da2ce80a2c Author: Shang XiaoJing Date: Wed Nov 2 15:29:54 2022 +0800 tracing: kprobe: Fix memory leak in test_gen_kprobe/kretprobe_cmd() test_gen_kprobe_cmd() only free buf in fail path, hence buf will leak when there is no failure. Move kfree(buf) from fail path to common path to prevent the memleak. The same reason and solution in test_gen_kretprobe_cmd(). unreferenced object 0xffff888143b14000 (size 2048): comm "insmod", pid 52490, jiffies 4301890980 (age 40.553s) hex dump (first 32 bytes): 70 3a 6b 70 72 6f 62 65 73 2f 67 65 6e 5f 6b 70 p:kprobes/gen_kp 72 6f 62 65 5f 74 65 73 74 20 64 6f 5f 73 79 73 robe_test do_sys backtrace: [<000000006d7b836b>] kmalloc_trace+0x27/0xa0 [<0000000009528b5b>] 0xffffffffa059006f [<000000008408b580>] do_one_initcall+0x87/0x2a0 [<00000000c4980a7e>] do_init_module+0xdf/0x320 [<00000000d775aad0>] load_module+0x3006/0x3390 [<00000000e9a74b80>] __do_sys_finit_module+0x113/0x1b0 [<000000003726480d>] do_syscall_64+0x35/0x80 [<000000003441e93b>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Link: https://lore.kernel.org/all/20221102072954.26555-1-shangxiaojing@huawei.com/ Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module") Cc: stable@vger.kernel.org Signed-off-by: Shang XiaoJing Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 61b304b73ab4b48b1cd7796efe42a570e2a0e0fc Author: Masami Hiramatsu (Google) Date: Sun Oct 23 11:11:43 2022 +0900 tracing/fprobe: Fix to check whether fprobe is registered correctly Since commit ab51e15d535e ("fprobe: Introduce FPROBE_FL_KPROBE_SHARED flag for fprobe") introduced fprobe_kprobe_handler() for fprobe::ops::func, unregister_fprobe() fails to unregister the registered if user specifies FPROBE_FL_KPROBE_SHARED flag. Moreover, __register_ftrace_function() is possible to change the ftrace_ops::func, thus we have to check fprobe::ops::saved_func instead. To check it correctly, it should confirm the fprobe::ops::saved_func is either fprobe_handler() or fprobe_kprobe_handler(). Link: https://lore.kernel.org/all/166677683946.1459107.15997653945538644683.stgit@devnote3/ Fixes: cad9931f64dc ("fprobe: Add ftrace based probe APIs") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) commit d05ea35e7eea14d32f29fd688d3daeb9089de1a5 Author: Rafael Mendonca Date: Tue Oct 25 00:12:08 2022 -0300 fprobe: Check rethook_alloc() return in rethook initialization Check if fp->rethook succeeded to be allocated. Otherwise, if rethook_alloc() fails, then we end up dereferencing a NULL pointer in rethook_add_node(). Link: https://lore.kernel.org/all/20221025031209.954836-1-rafaelmendsr@gmail.com/ Fixes: 5b0ab78998e3 ("fprobe: Add exit_handler support") Cc: stable@vger.kernel.org Signed-off-by: Rafael Mendonca Acked-by: Steven Rostedt (Google) Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 4a6f316d6855a434f56dbbeba05e14c01acde8f8 Author: Li Qiang Date: Fri Nov 4 08:49:31 2022 +0900 kprobe: reverse kp->flags when arm_kprobe failed In aggregate kprobe case, when arm_kprobe failed, we need set the kp->flags with KPROBE_FLAG_DISABLED again. If not, the 'kp' kprobe will been considered as enabled but it actually not enabled. Link: https://lore.kernel.org/all/20220902155820.34755-1-liq3ea@163.com/ Fixes: 12310e343755 ("kprobes: Propagate error from arm_kprobe_ftrace()") Cc: stable@vger.kernel.org Signed-off-by: Li Qiang Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit ee6050c8af96bba2f81e8b0793a1fc2f998fcd20 Merge: 7f7bac08d9e31 015618c3ec195 Author: Linus Torvalds Date: Thu Nov 3 16:48:27 2022 -0700 Merge tag 'ata-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "Two driver fixes: - Fix the PIO mode configuration of the pdc20230 (pata_legacy) driver. This also removes a compilation warning with clang and W=1 (Sergey) - Fix devm_platform_ioremap_resource() return value check in the palmld driver (Yang)" * tag 'ata-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: palmld: fix return value check in palmld_pata_probe() ata: pata_legacy: fix pdc20230_set_piomode() commit 6295f1d8b4503ad8a18519b781dd2d1fe5e88c52 Merge: 980a2ff2cb987 12caf46cf4fc9 Author: Dave Airlie Date: Fri Nov 4 09:30:18 2022 +1000 Merge tag 'drm-intel-fixes-2022-11-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Add locking around DKL PHY register accesses (Imre Deak) - Stop abusing swiotlb_max_segment (Robert Beckett) - Filter out invalid outputs more sensibly (Ville Syrjälä) - Setup DDC fully before output init (Ville Syrjälä) - Simplify intel_panel_add_edid_alt_fixed_modes() (Ville Syrjälä) - Grab mode_config.mutex during LVDS init to avoid WARNs (Ville Syrjälä) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y2ODlCGM4nACmzsJ@tursulin-desk commit 475244f5e06beeda7b557d9dde46a5f439bf3379 Author: Youlin Li Date: Thu Nov 3 17:34:40 2022 +0800 selftests/bpf: Add verifier test for release_reference() Add a test case to ensure that released pointer registers will not be leaked into the map. Before fix: ./test_verifier 984 984/u reference tracking: try to leak released ptr reg FAIL Unexpected success to load! verification time 67 usec stack depth 4 processed 23 insns (limit 1000000) max_states_per_insn 0 total_states 2 peak_states 2 mark_read 1 984/p reference tracking: try to leak released ptr reg OK Summary: 1 PASSED, 0 SKIPPED, 1 FAILED After fix: ./test_verifier 984 984/u reference tracking: try to leak released ptr reg OK 984/p reference tracking: try to leak released ptr reg OK Summary: 2 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Youlin Li Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20221103093440.3161-2-liulin063@gmail.com commit f1db20814af532f85e091231223e5e4818e8464b Author: Youlin Li Date: Thu Nov 3 17:34:39 2022 +0800 bpf: Fix wrong reg type conversion in release_reference() Some helper functions will allocate memory. To avoid memory leaks, the verifier requires the eBPF program to release these memories by calling the corresponding helper functions. When a resource is released, all pointer registers corresponding to the resource should be invalidated. The verifier use release_references() to do this job, by apply __mark_reg_unknown() to each relevant register. It will give these registers the type of SCALAR_VALUE. A register that will contain a pointer value at runtime, but of type SCALAR_VALUE, which may allow the unprivileged user to get a kernel pointer by storing this register into a map. Using __mark_reg_not_init() while NOT allow_ptr_leaks can mitigate this problem. Fixes: fd978bf7fd31 ("bpf: Add reference tracking to verifier") Signed-off-by: Youlin Li Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20221103093440.3161-1-liulin063@gmail.com commit 980a2ff2cb987e2177a1bd02633f4259a0d1daab Merge: c941ffc39e27a 6640f8e5adb69 Author: Dave Airlie Date: Fri Nov 4 06:51:56 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-11-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-11-02: amdgpu: - DCN 3.1.4 fixes - DCN 3.2.x fixes - GC 11.x fixes - Virtual display fix - Fail suspend if resources can't be evicted - SR-IOV fix - Display PSR fix amdkfd: - Fix possible NULL pointer deref - GC 11.x trap handler fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221103023257.10446-1-alexander.deucher@amd.com commit 7f7bac08d9e31cd6e2c0ea1685c86ec6f1e7e03c Merge: f2f32f8af2b0c 4a6f278d4827b Author: Linus Torvalds Date: Thu Nov 3 13:41:29 2022 -0700 Merge tag 'fuse-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: "Fix two rarely triggered but long-standing issues" * tag 'fuse-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: add file_modified() to fallocate fuse: fix readdir cache race commit c7e37cc6240767f794678d11704935d49cc81d59 Author: Hans de Goede Date: Thu Nov 3 11:31:43 2022 -0700 Input: goodix - try resetting the controller when no config is set On ACPI systems (irq_pin_access_method == IRQ_PIN_ACCESS_ACPI_*) the driver does not reset the controller at probe time, because sometimes the system firmware loads a config and resetting might loose this config. On the Nanote UMPC-01 device OTOH the config is in flash of the controller, the controller needs a reset to load this; and the system firmware does not reset the controller on a cold boot. To fix the Nanote UMPC-01 touchscreen not working on a cold boot, try resetting the controller and then re-reading the config when encountering a config with 0 width/height/max_touch_num value and the controller has not already been reset by goodix_ts_probe(). This should be safe to do in general because normally we should never encounter a config with 0 width/height/max_touch_num. Doing this in general not only avoids the need for a DMI quirk, but also might help other systems. Signed-off-by: Hans de Goede Reviewed-by: Bastien Nocera Link: https://lore.kernel.org/r/20221025122930.421377-2-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 4f1aa35f1fb7d51b125487c835982af792697ecb Author: Yu Zhe Date: Tue Sep 27 15:02:47 2022 +0800 cxl/pmem: Use size_add() against integer overflow "struct_size() + n" may cause a integer overflow, use size_add() to handle it. Signed-off-by: Yu Zhe Link: https://lore.kernel.org/r/20220927070247.23148-1-yuzhe@nfschina.com Signed-off-by: Dan Williams commit f2f32f8af2b0ca9d619e5183eae3eed431793baf Merge: 5fdf9c4547356 eb81b682b1316 Author: Linus Torvalds Date: Thu Nov 3 11:12:48 2022 -0700 Merge tag 'for-6.1-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A batch of error handling fixes for resource leaks, fixes for nowait mode in combination with direct and buffered IO: - direct IO + dsync + nowait could miss a sync of the file after write, add handling for this combination - buffered IO + nowait should not fail with ENOSPC, only blocking IO could determine that - error handling fixes: - fix inode reserve space leak due to nowait buffered write - check the correct variable after allocation (direct IO submit) - fix inode list leak during backref walking - fix ulist freeing in self tests" * tag 'for-6.1-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix inode reserve space leak due to nowait buffered write btrfs: fix nowait buffered write returning -ENOSPC btrfs: remove pointless and double ulist frees in error paths of qgroup tests btrfs: fix ulist leaks in error paths of qgroup self tests btrfs: fix inode list leak during backref walking at find_parent_nodes() btrfs: fix inode list leak during backref walking at resolve_indirect_refs() btrfs: fix lost file sync on direct IO write with nowait and dsync iocb btrfs: fix a memory allocation failure test in btrfs_submit_direct commit 85f1506337f0c79a4955edfeee86a18628e3735f Author: Amit Daniel Kachhap Date: Thu Nov 3 13:52:32 2022 +0530 arm64: cpufeature: Fix the visibility of compat hwcaps Commit 237405ebef58 ("arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space") forced the hwcaps to use sanitised user-space view of the id registers. However, the ID register structures used to select few compat cpufeatures (vfp, crc32, ...) are masked and hence such hwcaps do not appear in /proc/cpuinfo anymore for PER_LINUX32 personality. Add the ID register structures explicitly and set the relevant entry as visible. As these ID registers are now of type visible so make them available in 64-bit userspace by making necessary changes in register emulation logic and documentation. While at it, update the comment for structure ftr_generic_32bits[] which lists the ID register that use it. Fixes: 237405ebef58 ("arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space") Cc: Suzuki K Poulose Reviewed-by: James Morse Signed-off-by: Amit Daniel Kachhap Link: https://lore.kernel.org/r/20221103082232.19189-1-amit.kachhap@arm.com Signed-off-by: Catalin Marinas commit 5fdf9c45473569e87cc4206e80f186fc85b9eff9 Merge: 9521c9d6a53df 89c1017aac67c Author: Linus Torvalds Date: Thu Nov 3 11:03:38 2022 -0700 Merge tag 'linux-kselftest-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Fixes to the pidfd test" * tag 'linux-kselftest-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/pidfd_test: Remove the erroneous ',' selftests: pidfd: Fix compling warnings ksefltests: pidfd: Fix wait_states: Test terminated by timeout commit 9521c9d6a53df9c44a5f5ddbc229ceaf3cf79ef6 Merge: 4d74039149e00 715aee0fde73d Author: Linus Torvalds Date: Thu Nov 3 10:51:59 2022 -0700 Merge tag 'net-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bluetooth and netfilter. Current release - regressions: - net: several zerocopy flags fixes - netfilter: fix possible memory leak in nf_nat_init() - openvswitch: add missing .resv_start_op Previous releases - regressions: - neigh: fix null-ptr-deref in neigh_table_clear() - sched: fix use after free in red_enqueue() - dsa: fall back to default tagger if we can't load the one from DT - bluetooth: fix use-after-free in l2cap_conn_del() Previous releases - always broken: - netfilter: netlink notifier might race to release objects - nfc: fix potential memory leak of skb - bluetooth: fix use-after-free caused by l2cap_reassemble_sdu - bluetooth: use skb_put to set length - eth: tun: fix bugs for oversize packet when napi frags enabled - eth: lan966x: fixes for when MTU is changed - eth: dwmac-loongson: fix invalid mdio_node" * tag 'net-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (53 commits) vsock: fix possible infinite sleep in vsock_connectible_wait_data() vsock: remove the unused 'wait' in vsock_connectible_recvmsg() ipv6: fix WARNING in ip6_route_net_exit_late() bridge: Fix flushing of dynamic FDB entries net, neigh: Fix null-ptr-deref in neigh_table_clear() net/smc: Fix possible leaked pernet namespace in smc_init() stmmac: dwmac-loongson: fix invalid mdio_node ibmvnic: Free rwi on reset success net: mdio: fix undefined behavior in bit shift for __mdiobus_register Bluetooth: L2CAP: Fix attempting to access uninitialized memory Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Bluetooth: L2CAP: Fix memory leak in vhci_write Bluetooth: L2CAP: fix use-after-free in l2cap_conn_del() Bluetooth: virtio_bt: Use skb_put to set length Bluetooth: hci_conn: Fix CIS connection dst_type handling Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu netfilter: ipset: enforce documented limit to prevent allocating huge memory isdn: mISDN: netjet: fix wrong check of device registration ... commit 4d74039149e0062e4ed25738d6e3e06970a38809 Merge: 8e5423e991e8c 02a771c9a68a9 Author: Linus Torvalds Date: Thu Nov 3 10:27:28 2022 -0700 Merge tag 'powerpc-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix an endian thinko in the asm-generic compat_arg_u64() which led to syscall arguments being swapped for some compat syscalls. - Fix syscall wrapper handling of syscalls with 64-bit arguments on 32-bit kernels, which led to syscall arguments being misplaced. - A build fix for amdgpu on Book3E with AltiVec disabled. Thanks to Andreas Schwab, Christian Zigotzky, and Arnd Bergmann. * tag 'powerpc-6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/32: Select ARCH_SPLIT_ARG64 powerpc/32: fix syscall wrappers with 64-bit arguments asm-generic: compat: fix compat_arg_u64() and compat_arg_u64_dual() powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec commit a207620123f27e6f63bab13b46b20e03a3deec8d Author: Lukas Bulwahn Date: Mon Oct 31 10:29:20 2022 +0100 mm/slab_common: repair kernel-doc for __ksize() Commit 445d41d7a7c1 ("Merge branch 'slab/for-6.1/kmalloc_size_roundup' into slab/for-next") resolved a conflict of two concurrent changes to __ksize(). However, it did not adjust the kernel-doc comment of __ksize(), while the name of the argument to __ksize() was renamed. Hence, ./scripts/ kernel-doc -none mm/slab_common.c warns about it. Adjust the kernel-doc comment for __ksize() for make W=1 happiness. Signed-off-by: Lukas Bulwahn Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 23715a26c8d812912a70c6ac1ce67af649b95914 Author: Ard Biesheuvel Date: Fri Oct 28 16:39:14 2022 +0200 arm64: efi: Recover from synchronous exceptions occurring in firmware Unlike x86, which has machinery to deal with page faults that occur during the execution of EFI runtime services, arm64 has nothing like that, and a synchronous exception raised by firmware code brings down the whole system. With more EFI based systems appearing that were not built to run Linux (such as the Windows-on-ARM laptops based on Qualcomm SOCs), as well as the introduction of PRM (platform specific firmware routines that are callable just like EFI runtime services), we are more likely to run into issues of this sort, and it is much more likely that we can identify and work around such issues if they don't bring down the system entirely. Since we already use a EFI runtime services call wrapper in assembler, we can quite easily add some code that captures the execution state at the point where the call is made, allowing us to revert to this state and proceed execution if the call triggered a synchronous exception. Given that the kernel and the firmware don't share any data structures that could end up in an indeterminate state, we can happily continue running, as long as we mark the EFI runtime services as unavailable from that point on. Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas commit e70af8d040d2b7904dca93d942ba23fb722e21b1 Author: Dexuan Cui Date: Thu Oct 27 13:52:56 2022 -0700 PCI: hv: Fix the definition of vector in hv_compose_msi_msg() The local variable 'vector' must be u32 rather than u8: see the struct hv_msi_desc3. 'vector_count' should be u16 rather than u8: see struct hv_msi_desc, hv_msi_desc2 and hv_msi_desc3. Fixes: a2bad844a67b ("PCI: hv: Fix interrupt mapping for multi-MSI") Signed-off-by: Dexuan Cui Cc: Jeffrey Hugo Cc: Carl Vanderlip Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20221027205256.17678-1-decui@microsoft.com Signed-off-by: Wei Liu commit 9539c7fa38d35f869e83d56eb65a0b681644031b Author: Stephen Hemminger Date: Fri Oct 28 08:37:42 2022 -0700 MAINTAINERS: remove sthemmin Leaving Microsoft, the Hyper-V drivers have lots of other maintainers. Signed-off-by: Stephen Hemminger Link: https://lore.kernel.org/r/20221028153741.25470-1-stephen@networkplumber.org Signed-off-by: Wei Liu commit 2982635a0b3d08d6fee2ff05632206286df0e703 Author: Anirudh Rayabharam Date: Thu Oct 27 15:27:29 2022 +0530 x86/hyperv: fix invalid writes to MSRs during root partition kexec hyperv_cleanup resets the hypercall page by setting the MSR to 0. However, the root partition is not allowed to write to the GPA bits of the MSR. Instead, it uses the hypercall page provided by the MSR. Similar is the case with the reference TSC MSR. Clear only the enable bit instead of zeroing the entire MSR to make the code valid for root partition too. Signed-off-by: Anirudh Rayabharam Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221027095729.1676394-3-anrayabh@linux.microsoft.com Signed-off-by: Wei Liu commit 4ad1aa571214e8d6468a1806794d987b374b5a08 Author: Anirudh Rayabharam Date: Thu Oct 27 15:27:28 2022 +0530 clocksource/drivers/hyperv: add data structure for reference TSC MSR Add a data structure to represent the reference TSC MSR similar to other MSRs. This simplifies the code for updating the MSR. Signed-off-by: Anirudh Rayabharam Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221027095729.1676394-2-anrayabh@linux.microsoft.com Signed-off-by: Wei Liu commit 8670866b236eafbe9d502294561c3ddd298266bc Author: Liao Chang Date: Thu Nov 3 09:17:49 2022 +0800 KVM: x86: Fix a typo about the usage of kvcalloc() Swap the 1st and 2nd arguments to be consistent with the usage of kvcalloc(). Fixes: c9b8fecddb5b ("KVM: use kvcalloc for array allocations") Signed-off-by: Liao Chang Message-Id: <20221103011749.139262-1-liaochang1@huawei.com> Signed-off-by: Paolo Bonzini commit 074c008007197297aaff9dd93627fb89b27d21e5 Author: Ben Gardon Date: Wed Nov 2 20:53:59 2022 +0000 KVM: x86: Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit() kvm_zap_gfn_range() must be called in an SRCU read-critical section, but there is no SRCU annotation in __kvm_set_or_clear_apicv_inhibit(). This can lead to the following warning via kvm_arch_vcpu_ioctl_set_guest_debug() if a Shadow MMU is in use (TDP MMU disabled or nesting): [ 1416.659809] ============================= [ 1416.659810] WARNING: suspicious RCU usage [ 1416.659839] 6.1.0-dbg-DEV #1 Tainted: G S I [ 1416.659853] ----------------------------- [ 1416.659854] include/linux/kvm_host.h:954 suspicious rcu_dereference_check() usage! [ 1416.659856] ... [ 1416.659904] dump_stack_lvl+0x84/0xaa [ 1416.659910] dump_stack+0x10/0x15 [ 1416.659913] lockdep_rcu_suspicious+0x11e/0x130 [ 1416.659919] kvm_zap_gfn_range+0x226/0x5e0 [ 1416.659926] ? kvm_make_all_cpus_request_except+0x18b/0x1e0 [ 1416.659935] __kvm_set_or_clear_apicv_inhibit+0xcc/0x100 [ 1416.659940] kvm_arch_vcpu_ioctl_set_guest_debug+0x350/0x390 [ 1416.659946] kvm_vcpu_ioctl+0x2fc/0x620 [ 1416.659955] __se_sys_ioctl+0x77/0xc0 [ 1416.659962] __x64_sys_ioctl+0x1d/0x20 [ 1416.659965] do_syscall_64+0x3d/0x80 [ 1416.659969] entry_SYSCALL_64_after_hwframe+0x63/0xcd Always take the KVM SRCU read lock in __kvm_set_or_clear_apicv_inhibit() to protect the GFN to memslot translation. The SRCU read lock is not technically required when no Shadow MMUs are in use, since the TDP MMU walks the paging structures from the roots and does not need to look up GFN translations in the memslots, but make the SRCU locking unconditional for simplicty. In most cases, the SRCU locking is taken care of in the vCPU run loop, but when called through other ioctls (such as KVM_SET_GUEST_DEBUG) there is no srcu_read_lock. Tested: ran tools/testing/selftests/kvm/x86_64/debug_regs on a DBG build. This patch causes the suspicious RCU warning to disappear. Note that the warning is hit in __kvm_zap_rmaps(), so kvm_memslots_have_rmaps() must return true in order for this to repro (i.e. the TDP MMU must be off or nesting in use.) Reported-by: Greg Thelen Fixes: 36222b117e36 ("KVM: x86: don't disable APICv memslot when inhibited") Signed-off-by: Ben Gardon Message-Id: <20221102205359.1260980-1-bgardon@google.com> Signed-off-by: Paolo Bonzini commit 62aa1a344b0904549f6de7af958e8a1136fd5228 Author: Sean Nyekjaer Date: Thu Nov 3 09:00:42 2022 +0100 spi: stm32: fix stm32_spi_prepare_mbr() that halves spi clk for every run When this driver is used with a driver that uses preallocated spi_transfer structs. The speed_hz is halved by every run. This results in: spi_stm32 44004000.spi: SPI transfer setup failed ads7846 spi0.0: SPI transfer failed: -22 Example when running with DIV_ROUND_UP(): - First run; speed_hz = 1000000, spi->clk_rate 125000000 div 125 -> mbrdiv = 7, cur_speed = 976562 - Second run; speed_hz = 976562 div 128,00007 (roundup to 129) -> mbrdiv = 8, cur_speed = 488281 - Third run; speed_hz = 488281 div 256,000131072067109 (roundup to 257) and then -EINVAL is returned. Use DIV_ROUND_CLOSEST to allow to round down and allow us to keep the set speed. Signed-off-by: Sean Nyekjaer Link: https://lore.kernel.org/r/20221103080043.3033414-1-sean@geanix.com Signed-off-by: Mark Brown commit 8bbabb3fddcd0f858be69ed5abc9b470a239d6f2 Author: Cong Wang Date: Tue Nov 1 21:34:17 2022 -0700 bpf, sock_map: Move cancel_work_sync() out of sock lock Stanislav reported a lockdep warning, which is caused by the cancel_work_sync() called inside sock_map_close(), as analyzed below by Jakub: psock->work.func = sk_psock_backlog() ACQUIRE psock->work_mutex sk_psock_handle_skb() skb_send_sock() __skb_send_sock() sendpage_unlocked() kernel_sendpage() sock->ops->sendpage = inet_sendpage() sk->sk_prot->sendpage = tcp_sendpage() ACQUIRE sk->sk_lock tcp_sendpage_locked() RELEASE sk->sk_lock RELEASE psock->work_mutex sock_map_close() ACQUIRE sk->sk_lock sk_psock_stop() sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED) cancel_work_sync() __cancel_work_timer() __flush_work() // wait for psock->work to finish RELEASE sk->sk_lock We can move the cancel_work_sync() out of the sock lock protection, but still before saved_close() was called. Fixes: 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()") Reported-by: Stanislav Fomichev Signed-off-by: Cong Wang Signed-off-by: Daniel Borkmann Tested-by: Jakub Sitnicki Acked-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20221102043417.279409-1-xiyou.wangcong@gmail.com commit a778f5d46b6287ebe26e24b48f3e8079c2db8ed2 Author: Andrii Nakryiko Date: Wed Nov 2 11:25:17 2022 -0700 tools/headers: Pull in stddef.h to uapi to fix BPF selftests build in CI With recent sync of linux/in.h tools/include headers are now relying on __DECLARE_FLEX_ARRAY macro, which isn't itself defined inside tools/include headers anywhere and is instead assumed to be present in system-wide UAPI header. This breaks isolated environments that don't have kernel UAPI headers installed system-wide, like BPF CI ([0]). To fix this, bring in include/uapi/linux/stddef.h into tools/include. We can't just copy/paste it, though, it has to be processed with scripts/headers_install.sh, which has a dependency on scripts/unifdef. So the full command to (re-)generate stddef.h for inclusion into tools/include directory is: $ make scripts_unifdef && \ cp $KBUILD_OUTPUT/scripts/unifdef scripts/ && \ scripts/headers_install.sh include/uapi/linux/stddef.h tools/include/uapi/linux/stddef.h This assumes KBUILD_OUTPUT envvar is set and used for out-of-tree builds. [0] https://github.com/kernel-patches/bpf/actions/runs/3379432493/jobs/5610982609 Fixes: 036b8f5b8970 ("tools headers uapi: Update linux/in.h copy") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Cc: Jakub Kicinski Cc: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/bpf/20221102182517.2675301-2-andrii@kernel.org commit aec1dc972d27c837d1406310dab5170189eb01e5 Author: Andrii Nakryiko Date: Wed Nov 2 11:25:16 2022 -0700 net/ipv4: Fix linux/in.h header dependencies __DECLARE_FLEX_ARRAY is defined in include/uapi/linux/stddef.h but doesn't seem to be explicitly included from include/uapi/linux/in.h, which breaks BPF selftests builds (once we sync linux/stddef.h into tools/include directory in the next patch). Fix this by explicitly including linux/stddef.h. Given this affects BPF CI and bpf tree, targeting this for bpf tree. Fixes: 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Cc: Gustavo A. R. Silva Cc: Jakub Kicinski Link: https://lore.kernel.org/bpf/20221102182517.2675301-1-andrii@kernel.org commit 715aee0fde73d5ebac58e2339cef14f2da42e9e3 Merge: 768b3c745fe57 466a85336fee6 Author: Paolo Abeni Date: Thu Nov 3 10:49:31 2022 +0100 Merge branch 'vsock-remove-an-unused-variable-and-fix-infinite-sleep' Dexuan Cui says: ==================== vsock: remove an unused variable and fix infinite sleep Patch 1 removes the unused 'wait' variable. Patch 2 fixes an infinite sleep issue reported by a hv_sock user. ==================== Link: https://lore.kernel.org/r/20221101021706.26152-1-decui@microsoft.com Signed-off-by: Paolo Abeni commit 466a85336fee6e3b35eb97b8405a28302fd25809 Author: Dexuan Cui Date: Mon Oct 31 19:17:06 2022 -0700 vsock: fix possible infinite sleep in vsock_connectible_wait_data() Currently vsock_connectible_has_data() may miss a wakeup operation between vsock_connectible_has_data() == 0 and the prepare_to_wait(). Fix the race by adding the process to the wait queue before checking vsock_connectible_has_data(). Fixes: b3f7fd54881b ("af_vsock: separate wait data loop") Signed-off-by: Dexuan Cui Reviewed-by: Stefano Garzarella Reported-by: Frédéric Dalleau Tested-by: Frédéric Dalleau Signed-off-by: Paolo Abeni commit cf6ff0df0fd123493e57278a1bd4414a97511a34 Author: Dexuan Cui Date: Mon Oct 31 19:17:05 2022 -0700 vsock: remove the unused 'wait' in vsock_connectible_recvmsg() Remove the unused variable introduced by 19c1b90e1979. Fixes: 19c1b90e1979 ("af_vsock: separate receive data loop") Signed-off-by: Dexuan Cui Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit 4bff677b30156435afa2cc4c3601b542b4ddd439 Author: Juergen Gross Date: Thu Oct 20 13:25:12 2022 +0200 x86/xen: simplify sysenter and syscall setup xen_enable_sysenter() and xen_enable_syscall() can be simplified a lot. While at it, switch to use cpu_feature_enabled() instead of boot_cpu_has(). Signed-off-by: Juergen Gross commit 354d8a4b165697e6da9585b3f651d87735f30415 Author: Juergen Gross Date: Thu Oct 20 13:21:43 2022 +0200 x86/xen: silence smatch warning in pmu_msr_chk_emulated() Commit 8714f7bcd3c2 ("xen/pv: add fault recovery control to pmu msr accesses") introduced code resulting in a warning issued by the smatch static checker, claiming to use an uninitialized variable. This is a false positive, but work around the warning nevertheless. Fixes: 8714f7bcd3c2 ("xen/pv: add fault recovery control to pmu msr accesses") Reported-by: Dan Carpenter Signed-off-by: Juergen Gross commit 3bc6a37f59f21a8bfaf74d0975b2eb0b2d52a065 Author: maxime@cerno.tech Date: Fri Oct 21 15:13:39 2022 +0200 drm/vc4: hdmi: Fix HSM clock too low on Pi4 Commit ae71ab585c81 ("drm/vc4: hdmi: Enforce the minimum rate at runtime_resume") reintroduced the call to clk_set_min_rate in an attempt to fix the boot without a monitor connected on the RaspberryPi3. However, that introduced a regression breaking the display output entirely (black screen but no vblank timeout) on the Pi4. This is due to the fact that we now have in a typical modeset at boot, in vc4_hdmi_encoder_pre_crtc_configure(), we have a first call to clk_set_min_rate() asking for the minimum rate of the HSM clock for our given resolution, and then a call to pm_runtime_resume_and_get(). We will thus execute vc4_hdmi_runtime_resume() which, since the commit mentioned above, will call clk_set_min_rate() a second time with the absolute minimum rate we want to enforce on the HSM clock. We're thus effectively erasing the minimum mandated by the mode we're trying to set. The fact that only the Pi4 is affected is due to the fact that it uses a different clock driver that tries to minimize the HSM clock at all time. It will thus lower the HSM clock rate to 120MHz on the second clk_set_min_rate() call. The Pi3 doesn't use the same driver and will not change the frequency on the second clk_set_min_rate() call since it's still within the new boundaries and it doesn't have the code to minimize the clock rate as needed. So even though the boundaries are still off, the clock rate is still the right one for our given mode, so everything works. There is a lot of moving parts, so I couldn't find any obvious solution: - Reverting the original is not an option, as that would break the Pi3 again. - We can't move the clk_set_min_rate() call in _pre_crtc_configure() since because, on the Pi3, the HSM clock has the CLK_SET_RATE_GATE flag which prevents the clock rate from being changed after it's been enabled. Our calls to clk_set_min_rate() can change it, so they need to be done before clk_prepare_enable(). - We can't remove the call to clk_prepare_enable() from the runtime_resume hook to put it into _pre_crtc_configure() either, since we need that clock to be enabled to access the registers, and we can't count on the fact that the display will be active in all situations (doing any CEC operation, or listing the modes while inactive are valid for example()). - We can't drop the call to clk_set_min_rate() in _pre_crtc_configure() since we would need to still enforce the minimum rate for a given resolution, and runtime_resume doesn't have access to the current mode, if there's any. - We can't copy the TMDS character rate into vc4_hdmi and reuse it since, because it's part of the KMS atomic state, it needs to be protected by a mutex. Unfortunately, some functions (CEC operations, mostly) can be reentrant (through the CEC framework) and still need a pm_runtime_get. However, we can work around this issue by leveraging the fact that the clk_set_min_rate() calls set boundaries for its given struct clk, and that each different clk_get() call will return a different instance of struct clk. The clock framework will then aggregate the boundaries for each struct clk instances linked to a given clock, plus its hardware boundaries, and will use that. We can thus get an extra HSM clock user for runtime_pm use only, and use our different clock instances depending on the context: runtime_pm will use its own to set the absolute minimum clock setup so that we never lock the CPU waiting for a register access, and the modeset part will set its requirement for the current resolution. And we let the CCF do the coordination. It's not an ideal solution, but it's fairly unintrusive and doesn't really change any part of the logic so it looks like a rather safe fix. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2136234 Fixes: ae71ab585c81 ("drm/vc4: hdmi: Enforce the minimum rate at runtime_resume") Reported-by: Peter Robinson Reviewed-by: Javier Martinez Canillas Tested-by: Peter Robinson Link: https://lore.kernel.org/r/20221021131339.2203291-1-maxime@cerno.tech Signed-off-by: Maxime Ripard commit 76ffa2af16c67bbb806b8224a5289eb03f7a537d Author: maxime@cerno.tech Date: Mon Oct 24 11:36:34 2022 +0200 drm/vc4: hdmi: Fix outdated function name in comment A comment introduced by commit 6bed2ea3cb38 ("drm/vc4: hdmi: Reset link on hotplug") mentions a drm_atomic_helper_connector_hdmi_reset_link() function that was part of the earlier versions but got moved internally and is now named vc4_hdmi_reset_link(). Let's fix the function name. Fixes: 6bed2ea3cb38 ("drm/vc4: hdmi: Reset link on hotplug") Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20221024093634.118190-2-maxime@cerno.tech Signed-off-by: Maxime Ripard commit 682f99b8ae886c22ba9f16df454aecc8c6d803ba Author: maxime@cerno.tech Date: Mon Oct 24 11:36:33 2022 +0200 drm/vc4: hdmi: Take our lock to reset the link We access some fields protected by our internal mutex in vc4_hdmi_reset_link() (saved_adjusted_mode, output_bpc, output_format) and are calling functions that need to have that lock taken (vc4_hdmi_supports_scrambling()). However, the current code doesn't lock that mutex. Let's make sure it does. Fixes: 6bed2ea3cb38 ("drm/vc4: hdmi: Reset link on hotplug") Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20221024093634.118190-1-maxime@cerno.tech Signed-off-by: Maxime Ripard commit c941ffc39e27ae46c5fb6a33e81d89c9f78d373d Merge: 30a0b95b1335e fc007fb815ab5 Author: Dave Airlie Date: Thu Nov 3 14:11:25 2022 +1000 Merge tag 'drm-misc-fixes-2022-11-02-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc4: - Small fixes to make rockchip work better. - Fix imx Kconfig. - Small fix to imx' mode_valid. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/5476ef52-f91a-c2bc-f4b2-d338216d1e11@linux.intel.com commit 0e792b89e6800cd9cb4757a76a96f7ef3e8b6294 Author: Li Huafei Date: Thu Nov 3 11:10:10 2022 +0800 ftrace: Fix use-after-free for dynamic ftrace_ops KASAN reported a use-after-free with ftrace ops [1]. It was found from vmcore that perf had registered two ops with the same content successively, both dynamic. After unregistering the second ops, a use-after-free occurred. In ftrace_shutdown(), when the second ops is unregistered, the FTRACE_UPDATE_CALLS command is not set because there is another enabled ops with the same content. Also, both ops are dynamic and the ftrace callback function is ftrace_ops_list_func, so the FTRACE_UPDATE_TRACE_FUNC command will not be set. Eventually the value of 'command' will be 0 and ftrace_shutdown() will skip the rcu synchronization. However, ftrace may be activated. When the ops is released, another CPU may be accessing the ops. Add the missing synchronization to fix this problem. [1] BUG: KASAN: use-after-free in __ftrace_ops_list_func kernel/trace/ftrace.c:7020 [inline] BUG: KASAN: use-after-free in ftrace_ops_list_func+0x2b0/0x31c kernel/trace/ftrace.c:7049 Read of size 8 at addr ffff56551965bbc8 by task syz-executor.2/14468 CPU: 1 PID: 14468 Comm: syz-executor.2 Not tainted 5.10.0 #7 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x40c arch/arm64/kernel/stacktrace.c:132 show_stack+0x30/0x40 arch/arm64/kernel/stacktrace.c:196 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1b4/0x248 lib/dump_stack.c:118 print_address_description.constprop.0+0x28/0x48c mm/kasan/report.c:387 __kasan_report mm/kasan/report.c:547 [inline] kasan_report+0x118/0x210 mm/kasan/report.c:564 check_memory_region_inline mm/kasan/generic.c:187 [inline] __asan_load8+0x98/0xc0 mm/kasan/generic.c:253 __ftrace_ops_list_func kernel/trace/ftrace.c:7020 [inline] ftrace_ops_list_func+0x2b0/0x31c kernel/trace/ftrace.c:7049 ftrace_graph_call+0x0/0x4 __might_sleep+0x8/0x100 include/linux/perf_event.h:1170 __might_fault mm/memory.c:5183 [inline] __might_fault+0x58/0x70 mm/memory.c:5171 do_strncpy_from_user lib/strncpy_from_user.c:41 [inline] strncpy_from_user+0x1f4/0x4b0 lib/strncpy_from_user.c:139 getname_flags+0xb0/0x31c fs/namei.c:149 getname+0x2c/0x40 fs/namei.c:209 [...] Allocated by task 14445: kasan_save_stack+0x24/0x50 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc mm/kasan/common.c:479 [inline] __kasan_kmalloc.constprop.0+0x110/0x13c mm/kasan/common.c:449 kasan_kmalloc+0xc/0x14 mm/kasan/common.c:493 kmem_cache_alloc_trace+0x440/0x924 mm/slub.c:2950 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:675 [inline] perf_event_alloc.part.0+0xb4/0x1350 kernel/events/core.c:11230 perf_event_alloc kernel/events/core.c:11733 [inline] __do_sys_perf_event_open kernel/events/core.c:11831 [inline] __se_sys_perf_event_open+0x550/0x15f4 kernel/events/core.c:11723 __arm64_sys_perf_event_open+0x6c/0x80 kernel/events/core.c:11723 [...] Freed by task 14445: kasan_save_stack+0x24/0x50 mm/kasan/common.c:48 kasan_set_track+0x24/0x34 mm/kasan/common.c:56 kasan_set_free_info+0x20/0x40 mm/kasan/generic.c:358 __kasan_slab_free.part.0+0x11c/0x1b0 mm/kasan/common.c:437 __kasan_slab_free mm/kasan/common.c:445 [inline] kasan_slab_free+0x2c/0x40 mm/kasan/common.c:446 slab_free_hook mm/slub.c:1569 [inline] slab_free_freelist_hook mm/slub.c:1608 [inline] slab_free mm/slub.c:3179 [inline] kfree+0x12c/0xc10 mm/slub.c:4176 perf_event_alloc.part.0+0xa0c/0x1350 kernel/events/core.c:11434 perf_event_alloc kernel/events/core.c:11733 [inline] __do_sys_perf_event_open kernel/events/core.c:11831 [inline] __se_sys_perf_event_open+0x550/0x15f4 kernel/events/core.c:11723 [...] Link: https://lore.kernel.org/linux-trace-kernel/20221103031010.166498-1-lihuafei1@huawei.com Fixes: edb096e00724f ("ftrace: Fix memleak when unregistering dynamic ops when tracing disabled") Cc: stable@vger.kernel.org Suggested-by: Steven Rostedt Signed-off-by: Li Huafei Signed-off-by: Steven Rostedt (Google) commit 7433632c9ff68a991bd0bc38cabf354e9d2de410 Author: Steven Rostedt (Google) Date: Tue Nov 1 19:10:09 2022 -0400 ring-buffer: Check for NULL cpu_buffer in ring_buffer_wake_waiters() On some machines the number of listed CPUs may be bigger than the actual CPUs that exist. The tracing subsystem allocates a per_cpu directory with access to the per CPU ring buffer via a cpuX file. But to save space, the ring buffer will only allocate buffers for online CPUs, even though the CPU array will be as big as the nr_cpu_ids. With the addition of waking waiters on the ring buffer when closing the file, the ring_buffer_wake_waiters() now needs to make sure that the buffer is allocated (with the irq_work allocated with it) before trying to wake waiters, as it will cause a NULL pointer dereference. While debugging this, I added a NULL check for the buffer itself (which is OK to do), and also NULL pointer checks against buffer->buffers (which is not fine, and will WARN) as well as making sure the CPU number passed in is within the nr_cpu_ids (which is also not fine if it isn't). Link: https://lore.kernel.org/all/87h6zklb6n.wl-tiwai@suse.de/ Link: https://lore.kernel.org/all/CAM6Wdxc0KRJMXVAA0Y=u6Jh2V=uWB-_Fn6M4xRuNppfXzL1mUg@mail.gmail.com/ Link: https://lkml.kernel.org/linux-trace-kernel/20221101191009.1e7378c8@rorschach.local.home Cc: stable@vger.kernel.org Cc: Steven Noonan Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1204705 Reported-by: Takashi Iwai Reported-by: Roland Ruckerbauer Fixes: f3ddb74ad079 ("tracing: Wake up ring buffer waiters on closing of the file") Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 768b3c745fe5789f2430bdab02f35a9ad1148d97 Author: Zhengchao Shao Date: Wed Nov 2 10:06:10 2022 +0800 ipv6: fix WARNING in ip6_route_net_exit_late() During the initialization of ip6_route_net_init_late(), if file ipv6_route or rt6_stats fails to be created, the initialization is successful by default. Therefore, the ipv6_route or rt6_stats file doesn't be found during the remove in ip6_route_net_exit_late(). It will cause WRNING. The following is the stack information: name 'rt6_stats' WARNING: CPU: 0 PID: 9 at fs/proc/generic.c:712 remove_proc_entry+0x389/0x460 Modules linked in: Workqueue: netns cleanup_net RIP: 0010:remove_proc_entry+0x389/0x460 PKRU: 55555554 Call Trace: ops_exit_list+0xb0/0x170 cleanup_net+0x4ea/0xb00 process_one_work+0x9bf/0x1710 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Fixes: cdb1876192db ("[NETNS][IPV6] route6 - create route6 proc files for the namespace") Signed-off-by: Zhengchao Shao Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20221102020610.351330-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 628ac04a75ed5ff13647e725f40192da22ef2be8 Author: Ido Schimmel Date: Tue Nov 1 20:57:53 2022 +0200 bridge: Fix flushing of dynamic FDB entries The following commands should result in all the dynamic FDB entries being flushed, but instead all the non-local (non-permanent) entries are flushed: # bridge fdb add 00:aa:bb:cc:dd:ee dev dummy1 master static # bridge fdb add 00:11:22:33:44:55 dev dummy1 master dynamic # ip link set dev br0 type bridge fdb_flush # bridge fdb show brport dummy1 00:00:00:00:00:01 master br0 permanent 33:33:00:00:00:01 self permanent 01:00:5e:00:00:01 self permanent This is because br_fdb_flush() works with FDB flags and not the corresponding enumerator values. Fix by passing the FDB flag instead. After the fix: # bridge fdb add 00:aa:bb:cc:dd:ee dev dummy1 master static # bridge fdb add 00:11:22:33:44:55 dev dummy1 master dynamic # ip link set dev br0 type bridge fdb_flush # bridge fdb show brport dummy1 00:aa:bb:cc:dd:ee master br0 static 00:00:00:00:00:01 master br0 permanent 33:33:00:00:00:01 self permanent 01:00:5e:00:00:01 self permanent Fixes: 1f78ee14eeac ("net: bridge: fdb: add support for fine-grained flushing") Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20221101185753.2120691-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit f8017317cb0b279b8ab98b0f3901a2e0ac880dad Author: Chen Zhongjin Date: Tue Nov 1 20:15:52 2022 +0800 net, neigh: Fix null-ptr-deref in neigh_table_clear() When IPv6 module gets initialized but hits an error in the middle, kenel panic with: KASAN: null-ptr-deref in range [0x0000000000000598-0x000000000000059f] CPU: 1 PID: 361 Comm: insmod Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:__neigh_ifdown.isra.0+0x24b/0x370 RSP: 0018:ffff888012677908 EFLAGS: 00000202 ... Call Trace: neigh_table_clear+0x94/0x2d0 ndisc_cleanup+0x27/0x40 [ipv6] inet6_init+0x21c/0x2cb [ipv6] do_one_initcall+0xd3/0x4d0 do_init_module+0x1ae/0x670 ... Kernel panic - not syncing: Fatal exception When ipv6 initialization fails, it will try to cleanup and calls: neigh_table_clear() neigh_ifdown(tbl, NULL) pneigh_queue_purge(&tbl->proxy_queue, dev_net(dev == NULL)) # dev_net(NULL) triggers null-ptr-deref. Fix it by passing NULL to pneigh_queue_purge() in neigh_ifdown() if dev is NULL, to make kernel not panic immediately. Fixes: 66ba215cb513 ("neigh: fix possible DoS due to net iface start/stop loop") Signed-off-by: Chen Zhongjin Reviewed-by: Eric Dumazet Reviewed-by: Denis V. Lunev Link: https://lore.kernel.org/r/20221101121552.21890-1-chenzhongjin@huawei.com Signed-off-by: Jakub Kicinski commit 62ff373da2534534c55debe6c724c7fe14adb97f Author: Chen Zhongjin Date: Tue Nov 1 17:37:22 2022 +0800 net/smc: Fix possible leaked pernet namespace in smc_init() In smc_init(), register_pernet_subsys(&smc_net_stat_ops) is called without any error handling. If it fails, registering of &smc_net_ops won't be reverted. And if smc_nl_init() fails, &smc_net_stat_ops itself won't be reverted. This leaves wild ops in subsystem linkedlist and when another module tries to call register_pernet_operations() it triggers page fault: BUG: unable to handle page fault for address: fffffbfff81b964c RIP: 0010:register_pernet_operations+0x1b9/0x5f0 Call Trace: register_pernet_subsys+0x29/0x40 ebtables_init+0x58/0x1000 [ebtables] ... Fixes: 194730a9beb5 ("net/smc: Make SMC statistics network namespace aware") Signed-off-by: Chen Zhongjin Reviewed-by: Tony Lu Reviewed-by: Wenjia Zhang Link: https://lore.kernel.org/r/20221101093722.127223-1-chenzhongjin@huawei.com Signed-off-by: Jakub Kicinski commit 2ae34111fe4eebb69986f6490015b57c88804373 Author: Liu Peibao Date: Tue Nov 1 14:02:18 2022 +0800 stmmac: dwmac-loongson: fix invalid mdio_node In current code "plat->mdio_node" is always NULL, the mdio support is lost as there is no "mdio_bus_data". The original driver could work as the "mdio" variable is never set to false, which is described in commit ("stmmac: dwmac-loongson: fix uninitialized variable ......"). And after this commit merged, the "mdio" variable is always false, causing the mdio supoort logic lost. Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Liu Peibao Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221101060218.16453-1-liupeibao@loongson.cn Signed-off-by: Jakub Kicinski commit d6dd2fe71153f0ff748bf188bd4af076fe09a0a6 Author: Nick Child Date: Mon Oct 31 10:06:42 2022 -0500 ibmvnic: Free rwi on reset success Free the rwi structure in the event that the last rwi in the list processed successfully. The logic in commit 4f408e1fa6e1 ("ibmvnic: retry reset if there are no other resets") introduces an issue that results in a 32 byte memory leak whenever the last rwi in the list gets processed. Fixes: 4f408e1fa6e1 ("ibmvnic: retry reset if there are no other resets") Signed-off-by: Nick Child Link: https://lore.kernel.org/r/20221031150642.13356-1-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit 40e4eb324c59e11fcb927aa46742d28aba6ecb8a Author: Gaosheng Cui Date: Mon Oct 31 21:26:45 2022 +0800 net: mdio: fix undefined behavior in bit shift for __mdiobus_register Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in drivers/net/phy/mdio_bus.c:586:27 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c __mdiobus_register+0x49d/0x4e0 fixed_mdio_bus_init+0xd8/0x12d do_one_initcall+0x76/0x430 kernel_init_freeable+0x3b3/0x422 kernel_init+0x24/0x1e0 ret_from_fork+0x1f/0x30 Fixes: 4fd5f812c23c ("phylib: allow incremental scanning of an mii bus") Signed-off-by: Gaosheng Cui Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221031132645.168421-1-cuigaosheng1@huawei.com Signed-off-by: Jakub Kicinski commit 7b7dfe4833c70a11cdfa51b38705103bd31eddaa Author: Duoming Zhou Date: Sun Oct 2 12:07:09 2022 +0800 tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send The function gsm_dlci_t1() is a timer handler that runs in an atomic context, but it calls "kzalloc(..., GFP_KERNEL)" that may sleep. As a result, the sleep-in-atomic-context bug will happen. The process is shown below: gsm_dlci_t1() gsm_dlci_open() gsm_modem_update() gsm_modem_upd_via_msc() gsm_control_send() kzalloc(sizeof(.., GFP_KERNEL) //may sleep This patch changes the gfp_t parameter of kzalloc() from GFP_KERNEL to GFP_ATOMIC in order to mitigate the bug. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20221002040709.27849-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 15743ae50e04aa907131e3ae8d66e9a2964ea232 Author: Fedor Pchelkin Date: Sat Oct 8 14:02:21 2022 +0300 Revert "tty: n_gsm: replace kicktimer with delayed_work" This reverts commit c9ab053e56ce13a949977398c8edc12e6c02fc95. The above commit is reverted as it was a prerequisite for tx_mutex introduction and tx_mutex has been removed as it does not correctly work in order to protect tx data. Signed-off-by: Fedor Pchelkin Signed-off-by: Alexey Khoroshilov Reviewed-by: Daniel Starke Link: https://lore.kernel.org/r/20221008110221.13645-3-pchelkin@ispras.ru Signed-off-by: Greg Kroah-Hartman commit acdab4cb4ba7e5f94d2b422ebd7bf4bf68178fb2 Author: Fedor Pchelkin Date: Sat Oct 8 14:02:20 2022 +0300 Revert "tty: n_gsm: avoid call of sleeping functions from atomic context" This reverts commit 902e02ea9385373ce4b142576eef41c642703955. The above commit is reverted as the usage of tx_mutex seems not to solve the problem described in 902e02ea9385 ("tty: n_gsm: avoid call of sleeping functions from atomic context") and just moves the bug to another place. Signed-off-by: Fedor Pchelkin Signed-off-by: Alexey Khoroshilov Reviewed-by: Daniel Starke Link: https://lore.kernel.org/r/20221008110221.13645-2-pchelkin@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 4561d8008a467cb05ac632a215391d6b787f40aa Author: Shawn Guo Date: Wed Oct 12 20:13:53 2022 +0800 serial: imx: Add missing .thaw_noirq hook The following warning is seen with non-console UART instance when system hibernates. [ 37.371969] ------------[ cut here ]------------ [ 37.376599] uart3_root_clk already disabled [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 ... [ 37.506986] Call trace: [ 37.509432] clk_core_disable+0xa4/0xb0 [ 37.513270] clk_disable+0x34/0x50 [ 37.516672] imx_uart_thaw+0x38/0x5c [ 37.520250] platform_pm_thaw+0x30/0x6c [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4 [ 37.528972] device_resume+0x7c/0x160 [ 37.532633] dpm_resume+0xe8/0x230 [ 37.536036] hibernation_snapshot+0x288/0x430 [ 37.540397] hibernate+0x10c/0x2e0 [ 37.543798] state_store+0xc4/0xd0 [ 37.547203] kobj_attr_store+0x1c/0x30 [ 37.550953] sysfs_kf_write+0x48/0x60 [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac [ 37.559063] new_sync_write+0xe8/0x184 [ 37.562812] vfs_write+0x230/0x290 [ 37.566214] ksys_write+0x68/0xf4 [ 37.569529] __arm64_sys_write+0x20/0x2c [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0 [ 37.578156] do_el0_svc+0x11c/0x150 [ 37.581648] el0_svc+0x30/0x140 [ 37.584792] el0t_64_sync_handler+0xe8/0xf0 [ 37.588976] el0t_64_sync+0x1a0/0x1a4 [ 37.592639] ---[ end trace 56e22eec54676d75 ]--- On hibernating, pm core calls into related hooks in sequence like: .freeze .freeze_noirq .thaw_noirq .thaw With .thaw_noirq hook being absent, the clock will be disabled in a unbalanced call which results the warning above. imx_uart_freeze() clk_prepare_enable() imx_uart_suspend_noirq() clk_disable() imx_uart_thaw clk_disable_unprepare() Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have the call sequence corrected as below and thus fix the warning. imx_uart_freeze() clk_prepare_enable() imx_uart_suspend_noirq() clk_disable() imx_uart_resume_noirq() clk_enable() imx_uart_thaw clk_disable_unprepare() Fixes: 09df0b3464e5 ("serial: imx: fix endless loop during suspend") Reviewed-by: Martin Kaiser Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20221012121353.2346280-1-shawn.guo@linaro.org Signed-off-by: Greg Kroah-Hartman commit 76bad3f88750f8cc465c489e6846249e0bc3d8f5 Author: Sherry Sun Date: Mon Oct 24 16:58:44 2022 +0800 tty: serial: fsl_lpuart: don't break the on-going transfer when global reset lpuart_global_reset() shouldn't break the on-going transmit engine, need to recover the on-going data transfer after reset. This can help earlycon here, since commit 60f361722ad2 ("serial: fsl_lpuart: Reset prior to registration") moved lpuart_global_reset() before uart_add_one_port(), earlycon is writing during global reset, as global reset will disable the TX and clear the baud rate register, which caused the earlycon cannot work any more after reset, needs to restore the baud rate and re-enable the transmitter to recover the earlycon write. Also move the lpuart_global_reset() down, then we can reuse the lpuart32_tx_empty() without declaration. Fixes: bd5305dcabbc ("tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp") Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20221024085844.22786-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit dac1dc7e4dc11fb9d9c35c50beba6b77f46fda6f Merge: ef1fdc936cb00 510841da1fcc1 Author: Jakub Kicinski Date: Wed Nov 2 19:46:41 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net 1) netlink socket notifier might win race to release objects that are already pending to be released via commit release path, reported by syzbot. 2) No need to postpone flow rule release to commit release path, this triggered the syzbot report, complementary fix to previous patch. 3) Use explicit signed chars in IPVS to unbreak arm, from Jason A. Donenfeld. 4) Missing check for proc entry creation failure in IPVS, from Zhengchao Shao. 5) Incorrect error path handling when BPF NAT fails to register, from Chen Zhongjin. 6) Prevent huge memory allocation in ipset hash types, from Jozsef Kadlecsik. Except the incorrect BPF NAT error path which is broken in 6.1-rc, anything else has been broken for several releases. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: ipset: enforce documented limit to prevent allocating huge memory netfilter: nf_nat: Fix possible memory leak in nf_nat_init() ipvs: fix WARNING in ip_vs_app_net_cleanup() ipvs: fix WARNING in __ip_vs_cleanup_batch() ipvs: use explicitly signed chars netfilter: nf_tables: release flow rule object from commit path netfilter: nf_tables: netlink notifier might race to release objects ==================== Link: https://lore.kernel.org/r/20221102184659.2502-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit d0b68629bd2fb61e0171a62f2e8da3db322f5cf6 Author: Tony Lindgren Date: Fri Oct 28 14:00:44 2022 +0300 serial: 8250: omap: Flush PM QOS work on remove Rebinding 8250_omap in a loop will at some point produce a warning for kernel/power/qos.c:296 cpu_latency_qos_update_request() with error "cpu_latency_qos_update_request called for unknown object". Let's flush the possibly pending PM QOS work scheduled from omap8250_runtime_suspend() before we disable runtime PM. Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver") Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20221028110044.54719-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit e3f0c638f428fd66b5871154b62706772045f91a Author: Tony Lindgren Date: Fri Oct 28 13:58:13 2022 +0300 serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove() On remove, we get an error for "Runtime PM usage count underflow!". I guess this driver is mostly built-in, and this issue has gone unnoticed for a while. Somehow I did not catch this issue with my earlier fix done with commit 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime"). Fixes: 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime") Signed-off-by: Tony Lindgren Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") Link: https://lore.kernel.org/r/20221028105813.54290-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit e828e56684d61b17317e0cfdef83791fa61cb76b Author: Matthias Schiffer Date: Thu Oct 13 13:23:39 2022 +0200 serial: 8250_omap: remove wait loop from Errata i202 workaround We were occasionally seeing the "Errata i202: timedout" on an AM335x board when repeatedly opening and closing a UART connected to an active sender. As new input may arrive at any time, it is possible to miss the "RX FIFO empty" condition, forcing the loop to wait until it times out. Nothing in the i202 Advisory states that such a wait is even necessary; other FIFO clear functions like serial8250_clear_fifos() do not wait either. For this reason, it seems safe to remove the wait, fixing the mentioned issue. Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver") Reviewed-by: Ilpo Järvinen Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20221013112339.2540767-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit 93810191f5d23652c0b8a1a9b3a4a89d6fd5063e Author: Tony Lindgren Date: Mon Oct 24 09:36:13 2022 +0300 serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl() There are cases where omap8250_set_mctrl() may get called after the UART has already autoidled causing an asynchronous external abort. This can happen on ttyport_open(): mem_serial_in from omap8250_set_mctrl+0x38/0xa0 omap8250_set_mctrl from uart_update_mctrl+0x4c/0x58 uart_update_mctrl from uart_dtr_rts+0x60/0xa8 uart_dtr_rts from tty_port_block_til_ready+0xd0/0x2a8 tty_port_block_til_ready from uart_open+0x14/0x1c uart_open from ttyport_open+0x64/0x148 And on ttyport_close(): omap8250_set_mctrl from uart_update_mctrl+0x3c/0x48 uart_update_mctrl from uart_dtr_rts+0x54/0x9c uart_dtr_rts from tty_port_shutdown+0x78/0x9c tty_port_shutdown from tty_port_close+0x3c/0x74 tty_port_close from ttyport_close+0x40/0x58 It can also happen on disassociate_ctty() calling uart_shutdown() that ends up calling omap8250_set_mctrl(). Let's fix the issue by adding missing PM runtime calls to omap8250_set_mctrl(). To do this, we need to add __omap8250_set_mctrl() that can be called from both omap8250_set_mctrl(), and from runtime PM resume path when restoring the registers. Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver") Reported-by: Merlijn Wajer Reported-by: Romain Naour Reported-by: Ivaylo Dimitrov Tested-by: Ivaylo Dimitrov Signed-off-by: Tony Lindgren Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") Link: https://lore.kernel.org/r/20221024063613.25943-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 038ee49fef18710bedd38b531d173ccd746b2d8d Author: Lukas Wunner Date: Tue Sep 27 13:52:34 2022 +0200 serial: 8250: 8250_omap: Avoid RS485 RTS glitch on ->set_termios() RS485-enabled UART ports on TI Sitara SoCs with active-low polarity exhibit a Transmit Enable glitch on ->set_termios(): omap8250_restore_regs(), which is called from omap_8250_set_termios(), sets the TCRTLR bit in the MCR register and clears all other bits, including RTS. If RTS uses active-low polarity, it is now asserted for no reason. The TCRTLR bit is subsequently cleared by writing up->mcr to the MCR register. That variable is always zero, so the RTS bit is still cleared (incorrectly so if RTS is active-high). (up->mcr is not, as one might think, a cache of the MCR register's current value. Rather, it only caches a single bit of that register, the AFE bit. And it only does so if the UART supports the AFE bit, which OMAP does not. For details see serial8250_do_set_termios() and serial8250_do_set_mctrl().) Finally at the end of omap8250_restore_regs(), the MCR register is restored (and RTS deasserted) by a call to up->port.ops->set_mctrl() (which equals serial8250_set_mctrl()) and serial8250_em485_stop_tx(). So there's an RTS glitch between setting TCRTLR and calling serial8250_em485_stop_tx(). Avoid by using a read-modify-write when setting TCRTLR. While at it, drop a redundant initialization of up->mcr. As explained above, the variable isn't used by the driver and it is already initialized to zero because it is part of the static struct serial8250_ports[] declared in 8250_core.c. (Static structs are initialized to zero per section 6.7.8 nr. 10 of the C99 standard.) Cc: Jan Kiszka Cc: Su Bao Cheng Tested-by: Matthias Schiffer Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/6554b0241a2c7fd50f32576fdbafed96709e11e8.1664278942.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit ef1fdc936cb004f25891de545b70e97958c33187 Merge: ba9169f57090e b1a2cd50c0357 Author: Jakub Kicinski Date: Wed Nov 2 19:42:04 2022 -0700 Merge tag 'for-net-2022-10-02' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth 2022-11-02 - Fix memory leak in hci_vhci driver - Fix handling of skb on virtio_bt driver - Fix accepting connection for invalid L2CAP PSM - Fix attemting to access uninitialized memory - Fix use-after-free in l2cap_reassemble_sdu - Fix use-after-free in l2cap_conn_del - Fix handling of destination address type for CIS - Fix not restoring ISO buffer count on disconnect * tag 'for-net-2022-10-02' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: L2CAP: Fix attempting to access uninitialized memory Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect Bluetooth: L2CAP: Fix memory leak in vhci_write Bluetooth: L2CAP: fix use-after-free in l2cap_conn_del() Bluetooth: virtio_bt: Use skb_put to set length Bluetooth: hci_conn: Fix CIS connection dst_type handling Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu ==================== Link: https://lore.kernel.org/r/20221102235927.3324891-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit b1a2cd50c0357f243b7435a732b4e62ba3157a2e Author: Luiz Augusto von Dentz Date: Mon Oct 31 16:10:52 2022 -0700 Bluetooth: L2CAP: Fix attempting to access uninitialized memory On l2cap_parse_conf_req the variable efs is only initialized if remote_efs has been set. CVE: CVE-2022-42895 CC: stable@vger.kernel.org Reported-by: Tamás Koczka Signed-off-by: Luiz Augusto von Dentz Reviewed-by: Tedd Ho-Jeong An commit f937b758a188d6fd328a81367087eddbb2fce50f Author: Luiz Augusto von Dentz Date: Mon Oct 31 16:10:33 2022 -0700 Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm l2cap_global_chan_by_psm shall not return fixed channels as they are not meant to be connected by (S)PSM. Signed-off-by: Luiz Augusto von Dentz Reviewed-by: Tedd Ho-Jeong An commit 711f8c3fb3db61897080468586b970c87c61d9e4 Author: Luiz Augusto von Dentz Date: Mon Oct 31 16:10:32 2022 -0700 Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM The Bluetooth spec states that the valid range for SPSM is from 0x0001-0x00ff so it is invalid to accept values outside of this range: BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part A page 1059: Table 4.15: L2CAP_LE_CREDIT_BASED_CONNECTION_REQ SPSM ranges CVE: CVE-2022-42896 CC: stable@vger.kernel.org Reported-by: Tamás Koczka Signed-off-by: Luiz Augusto von Dentz Reviewed-by: Tedd Ho-Jeong An commit 6640f8e5adb69a0550fe1d224d3ac64c10f00eef Author: Jay Cornwall Date: Thu Oct 13 21:41:13 2022 -0500 drm/amdkfd: update GFX11 CWSR trap handler With corresponding FW change fixes issue where triggering CWSR on a workgroup with waves in s_barrier wouldn't lead to a back-off and therefore cause a hang. Signed-off-by: Jay Cornwall Tested-by: Graham Sider Acked-by: Harish Kasiviswanathan Acked-by: Felix Kuehling Reviewed-by: Graham Sider Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 7461016c5706eb8c477752bf69e5c9f5a38f502b Author: Nevenko Stupar Date: Fri May 6 16:32:38 2022 -0400 drm/amd/display: Investigate tool reported FCLK P-state deviations [Why] Fix for some of the tool reported modes for FCLK P-state deviations and UCLK P-state deviations that are coming from DSC terms and/or Scaling terms causing MinActiveFCLKChangeLatencySupported and MaxActiveDRAMClockChangeLatencySupported incorrectly calculated in DML for these configurations. Reviewed-by: Chaitanya Dhere Acked-by: Jasdeep Dhillon Acked-by: Alex Hung Signed-off-by: Nevenko Stupar Tested-by: Mark Broadworth Signed-off-by: Alex Deucher commit d5e0fb0d9dea545defb963ec1073bd9a1a8b5395 Author: George Shen Date: Fri Oct 14 17:46:03 2022 -0400 drm/amd/display: Add DSC delay factor workaround [Why] Certain 4K high refresh rate modes requiring DSC are exhibiting top of screen underflow corruption. Increasing the DSC delay by a factor of 6 percent stops the underflow for most use cases. [How] Multiply DSC delay requirement in DML by a factor. Add debug option to make this DSC delay factor configurable. Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: George Shen Tested-by: Mark Broadworth Signed-off-by: Alex Deucher commit 8dc323133d74518e3b5b07242e2b2f088799ea6e Author: George Shen Date: Fri Oct 14 17:40:08 2022 -0400 drm/amd/display: Round up DST_after_scaler to nearest int [Why] The DST_after_scaler value that DML spreadsheet outputs is generally the driver value round up to the nearest int. Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: George Shen Tested-by: Mark Broadworth Signed-off-by: Alex Deucher commit ab007e5db5d3b8b8975c7eec69992ff38fe2a46c Author: George Shen Date: Fri Oct 14 17:36:32 2022 -0400 drm/amd/display: Use forced DSC bpp in DML [Why] DSC config is calculated separately from DML calculations. DML should use these separately calculated DSC params. The issue is that the calculated bpp is not properly propagated into DML. [How] Correctly used forced_bpp value in DML. Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: George Shen Tested-by: Mark Broadworth Signed-off-by: Alex Deucher commit bad610c97c08eef3ed1fa769a8b08b94f95b451e Author: George Shen Date: Fri Oct 7 12:43:26 2022 -0400 drm/amd/display: Fix DCN32 DSC delay calculation [Why] DCN32 DSC delay calculation had an unintentional integer division, resulting in a mismatch against the DML spreadsheet. [How] Cast numerator to double before performing the division. Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: George Shen Tested-by: Mark Broadworth Signed-off-by: Alex Deucher commit 8fe8ce896c1cc29d6bfebb3c7b3cc948f72cd32c Author: Gavin Wan Date: Wed Oct 26 13:45:25 2022 -0400 drm/amdgpu: Disable GPU reset on SRIOV before remove pci. The recent change brought a bug on SRIOV envrionment. It caused unloading amdgpu failed on Guest VM. The reason is that the VF FLR was requested while unloading amdgpu driver, but the VF FLR of SRIOV sequence is wrong while removing PCI device. For SRIOV, the guest driver should not trigger the whole XGMI hive to do the reset. Host driver control how the device been reset. Fixes: f5c7e7797060 ("drm/amdgpu: Adjust removal control flow for smu v13_0_2") Acked-by: Alex Deucher Reviewed-by: Shaoyun Liu Signed-off-by: Gavin Wan Signed-off-by: Alex Deucher commit a3e5ce56f3d260f2ec8e5242c33f57e60ae9eba7 Author: Graham Sider Date: Wed Oct 26 15:08:24 2022 -0400 drm/amdgpu: disable GFXOFF during compute for GFX11 Temporary workaround to fix issues observed in some compute applications when GFXOFF is enabled on GFX11. Signed-off-by: Graham Sider Acked-by: Alex Deucher Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 5638d9ea9c01c77fc11693d48cf719bc7e88f224 Author: Luiz Augusto von Dentz Date: Mon Oct 17 15:36:23 2022 -0700 Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect When disconnecting an ISO link the controller may not generate HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in hci_conn_del otherwise the host would assume they are still in use and would not be able to use all the buffers available. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Luiz Augusto von Dentz Tested-by: Frédéric Danis commit 7c9524d929648935bac2bbb4c20437df8f9c3f42 Author: Hawkins Jiawei Date: Tue Oct 18 10:18:51 2022 +0800 Bluetooth: L2CAP: Fix memory leak in vhci_write Syzkaller reports a memory leak as follows: ==================================== BUG: memory leak unreferenced object 0xffff88810d81ac00 (size 240): [...] hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __alloc_skb+0x1f9/0x270 net/core/skbuff.c:418 [] alloc_skb include/linux/skbuff.h:1257 [inline] [] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] [] vhci_get_user drivers/bluetooth/hci_vhci.c:391 [inline] [] vhci_write+0x5f/0x230 drivers/bluetooth/hci_vhci.c:511 [] call_write_iter include/linux/fs.h:2192 [inline] [] new_sync_write fs/read_write.c:491 [inline] [] vfs_write+0x42d/0x540 fs/read_write.c:578 [] ksys_write+0x9d/0x160 fs/read_write.c:631 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd ==================================== HCI core will uses hci_rx_work() to process frame, which is queued to the hdev->rx_q tail in hci_recv_frame() by HCI driver. Yet the problem is that, HCI core may not free the skb after handling ACL data packets. To be more specific, when start fragment does not contain the L2CAP length, HCI core just copies skb into conn->rx_skb and finishes frame process in l2cap_recv_acldata(), without freeing the skb, which triggers the above memory leak. This patch solves it by releasing the relative skb, after processing the above case in l2cap_recv_acldata(). Fixes: 4d7ea8ee90e4 ("Bluetooth: L2CAP: Fix handling fragmented length") Link: https://lore.kernel.org/all/0000000000000d0b1905e6aaef64@google.com/ Reported-and-tested-by: syzbot+8f819e36e01022991cfa@syzkaller.appspotmail.com Signed-off-by: Hawkins Jiawei Signed-off-by: Luiz Augusto von Dentz commit bb8738876b24c3bbfccbd2ccbdc57c27402516ab Author: Heiko Carstens Date: Mon Oct 31 18:29:04 2022 +0100 s390: update defconfigs Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit b43088f30db1a7bff61c8486238c195c77788d6d Author: Harald Freudenberger Date: Tue Oct 25 10:05:25 2022 +0200 s390/zcrypt: fix warning about field-spanning write This patch fixes the warning memcpy: detected field-spanning write (size 60) of single field "to" at drivers/s390/crypto/zcrypt_api.h:173 (size 2) WARNING: CPU: 1 PID: 2114 at drivers/s390/crypto/zcrypt_api.h:173 prep_ep11_ap_msg+0x2c6/0x2e0 [zcrypt] The code has been rewritten to use a union in combination with a flex array to clearly state which part of the buffer the payload is to be copied in via z_copy_from_user function (which may call memcpy() in case of in-kernel calls). Signed-off-by: Harald Freudenberger Suggested-by: Jürgen Christ Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik commit 0d0e2d032811280b927650ff3c15fe5020e82533 Author: Zhengchao Shao Date: Mon Oct 17 15:58:13 2022 +0800 Bluetooth: L2CAP: fix use-after-free in l2cap_conn_del() When l2cap_recv_frame() is invoked to receive data, and the cid is L2CAP_CID_A2MP, if the channel does not exist, it will create a channel. However, after a channel is created, the hold operation of the channel is not performed. In this case, the value of channel reference counting is 1. As a result, after hci_error_reset() is triggered, l2cap_conn_del() invokes the close hook function of A2MP to release the channel. Then l2cap_chan_unlock(chan) will trigger UAF issue. The process is as follows: Receive data: l2cap_data_channel() a2mp_channel_create() --->channel ref is 2 l2cap_chan_put() --->channel ref is 1 Triger event: hci_error_reset() hci_dev_do_close() ... l2cap_disconn_cfm() l2cap_conn_del() l2cap_chan_hold() --->channel ref is 2 l2cap_chan_del() --->channel ref is 1 a2mp_chan_close_cb() --->channel ref is 0, release channel l2cap_chan_unlock() --->UAF of channel The detailed Call Trace is as follows: BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0xa6/0x5e0 Read of size 8 at addr ffff8880160664b8 by task kworker/u11:1/7593 Workqueue: hci0 hci_error_reset Call Trace: dump_stack_lvl+0xcd/0x134 print_report.cold+0x2ba/0x719 kasan_report+0xb1/0x1e0 kasan_check_range+0x140/0x190 __mutex_unlock_slowpath+0xa6/0x5e0 l2cap_conn_del+0x404/0x7b0 l2cap_disconn_cfm+0x8c/0xc0 hci_conn_hash_flush+0x11f/0x260 hci_dev_close_sync+0x5f5/0x11f0 hci_dev_do_close+0x2d/0x70 hci_error_reset+0x9e/0x140 process_one_work+0x98a/0x1620 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Allocated by task 7593: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0xa9/0xd0 l2cap_chan_create+0x40/0x930 amp_mgr_create+0x96/0x990 a2mp_channel_create+0x7d/0x150 l2cap_recv_frame+0x51b8/0x9a70 l2cap_recv_acldata+0xaa3/0xc00 hci_rx_work+0x702/0x1220 process_one_work+0x98a/0x1620 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Freed by task 7593: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x167/0x1c0 slab_free_freelist_hook+0x89/0x1c0 kfree+0xe2/0x580 l2cap_chan_put+0x22a/0x2d0 l2cap_conn_del+0x3fc/0x7b0 l2cap_disconn_cfm+0x8c/0xc0 hci_conn_hash_flush+0x11f/0x260 hci_dev_close_sync+0x5f5/0x11f0 hci_dev_do_close+0x2d/0x70 hci_error_reset+0x9e/0x140 process_one_work+0x98a/0x1620 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0xbe/0xd0 call_rcu+0x99/0x740 netlink_release+0xe6a/0x1cf0 __sock_release+0xcd/0x280 sock_close+0x18/0x20 __fput+0x27c/0xa90 task_work_run+0xdd/0x1a0 exit_to_user_mode_prepare+0x23c/0x250 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0xbe/0xd0 call_rcu+0x99/0x740 netlink_release+0xe6a/0x1cf0 __sock_release+0xcd/0x280 sock_close+0x18/0x20 __fput+0x27c/0xa90 task_work_run+0xdd/0x1a0 exit_to_user_mode_prepare+0x23c/0x250 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: d0be8347c623 ("Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put") Signed-off-by: Zhengchao Shao Signed-off-by: Luiz Augusto von Dentz commit 160fbcf3bfb93c3c086427f9f4c8bc70f217e9be Author: Soenke Huster Date: Wed Oct 12 09:45:06 2022 +0200 Bluetooth: virtio_bt: Use skb_put to set length By using skb_put we ensure that skb->tail is set correctly. Currently, skb->tail is always zero, which leads to errors, such as the following page fault in rfcomm_recv_frame: BUG: unable to handle page fault for address: ffffed1021de29ff #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page RIP: 0010:rfcomm_run+0x831/0x4040 (net/bluetooth/rfcomm/core.c:1751) Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver") Signed-off-by: Soenke Huster Signed-off-by: Luiz Augusto von Dentz commit b36a234dc438cb6b76fc929a8df9a0e59c8acf23 Author: Pauli Virtanen Date: Tue Oct 11 22:25:33 2022 +0300 Bluetooth: hci_conn: Fix CIS connection dst_type handling hci_connect_cis and iso_connect_cis call hci_bind_cis inconsistently with dst_type being either ISO socket address type or the HCI type, but these values cannot be mixed like this. Fix this by using only the HCI type. CIS connection dst_type was also not initialized in hci_bind_cis, even though it is used in hci_conn_hash_lookup_cis to find existing connections. Set the value in hci_bind_cis, so that existing CIS connections are found e.g. when doing deferred socket connections, also when dst_type is not 0 (ADDR_LE_DEV_PUBLIC). Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz commit 3aff8aaca4e36dc8b17eaa011684881a80238966 Author: Maxim Mikityanskiy Date: Wed Oct 5 00:27:18 2022 +0300 Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu Fix the race condition between the following two flows that run in parallel: 1. l2cap_reassemble_sdu -> chan->ops->recv (l2cap_sock_recv_cb) -> __sock_queue_rcv_skb. 2. bt_sock_recvmsg -> skb_recv_datagram, skb_free_datagram. An SKB can be queued by the first flow and immediately dequeued and freed by the second flow, therefore the callers of l2cap_reassemble_sdu can't use the SKB after that function returns. However, some places continue accessing struct l2cap_ctrl that resides in the SKB's CB for a short time after l2cap_reassemble_sdu returns, leading to a use-after-free condition (the stack trace is below, line numbers for kernel 5.19.8). Fix it by keeping a local copy of struct l2cap_ctrl. BUG: KASAN: use-after-free in l2cap_rx_state_recv (net/bluetooth/l2cap_core.c:6906) bluetooth Read of size 1 at addr ffff88812025f2f0 by task kworker/u17:3/43169 Workqueue: hci0 hci_rx_work [bluetooth] Call Trace: dump_stack_lvl (lib/dump_stack.c:107 (discriminator 4)) print_report.cold (mm/kasan/report.c:314 mm/kasan/report.c:429) ? l2cap_rx_state_recv (net/bluetooth/l2cap_core.c:6906) bluetooth kasan_report (mm/kasan/report.c:162 mm/kasan/report.c:493) ? l2cap_rx_state_recv (net/bluetooth/l2cap_core.c:6906) bluetooth l2cap_rx_state_recv (net/bluetooth/l2cap_core.c:6906) bluetooth l2cap_rx (net/bluetooth/l2cap_core.c:7236 net/bluetooth/l2cap_core.c:7271) bluetooth ret_from_fork (arch/x86/entry/entry_64.S:306) Allocated by task 43169: kasan_save_stack (mm/kasan/common.c:39) __kasan_slab_alloc (mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) kmem_cache_alloc_node (mm/slab.h:750 mm/slub.c:3243 mm/slub.c:3293) __alloc_skb (net/core/skbuff.c:414) l2cap_recv_frag (./include/net/bluetooth/bluetooth.h:425 net/bluetooth/l2cap_core.c:8329) bluetooth l2cap_recv_acldata (net/bluetooth/l2cap_core.c:8442) bluetooth hci_rx_work (net/bluetooth/hci_core.c:3642 net/bluetooth/hci_core.c:3832) bluetooth process_one_work (kernel/workqueue.c:2289) worker_thread (./include/linux/list.h:292 kernel/workqueue.c:2437) kthread (kernel/kthread.c:376) ret_from_fork (arch/x86/entry/entry_64.S:306) Freed by task 27920: kasan_save_stack (mm/kasan/common.c:39) kasan_set_track (mm/kasan/common.c:45) kasan_set_free_info (mm/kasan/generic.c:372) ____kasan_slab_free (mm/kasan/common.c:368 mm/kasan/common.c:328) slab_free_freelist_hook (mm/slub.c:1780) kmem_cache_free (mm/slub.c:3536 mm/slub.c:3553) skb_free_datagram (./include/net/sock.h:1578 ./include/net/sock.h:1639 net/core/datagram.c:323) bt_sock_recvmsg (net/bluetooth/af_bluetooth.c:295) bluetooth l2cap_sock_recvmsg (net/bluetooth/l2cap_sock.c:1212) bluetooth sock_read_iter (net/socket.c:1087) new_sync_read (./include/linux/fs.h:2052 fs/read_write.c:401) vfs_read (fs/read_write.c:482) ksys_read (fs/read_write.c:620) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) Link: https://lore.kernel.org/linux-bluetooth/CAKErNvoqga1WcmoR3-0875esY6TVWFQDandbVZncSiuGPBQXLA@mail.gmail.com/T/#u Fixes: d2a7ac5d5d3a ("Bluetooth: Add the ERTM receive state machine") Fixes: 4b51dae96731 ("Bluetooth: Add streaming mode receive and incoming packet classifier") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Luiz Augusto von Dentz commit 8d4de331f1b24a22d18e3c6116aa25228cf54854 Author: Mario Limonciello Date: Wed Oct 26 14:03:55 2022 -0500 drm/amd: Fail the suspend if resources can't be evicted If a system does not have swap and memory is under 100% usage, amdgpu will fail to evict resources. Currently the suspend carries on proceeding to reset the GPU: ``` [drm] evicting device resources failed [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -12 [drm] free PSP TMR buffer [TTM] Failed allocating page table [drm] evicting device resources failed amdgpu 0000:03:00.0: amdgpu: MODE1 reset amdgpu 0000:03:00.0: amdgpu: GPU mode1 reset amdgpu 0000:03:00.0: amdgpu: GPU smu mode1 reset ``` At this point if the suspend actually succeeded I think that amdgpu would have recovered because the GPU would have power cut off and restored. However the kernel fails to continue the suspend from the memory pressure and amdgpu fails to run the "resume" from the aborted suspend. ``` ACPI: PM: Preparing to enter system sleep state S3 SLUB: Unable to allocate memory on node -1, gfp=0xdc0(GFP_KERNEL|__GFP_ZERO) cache: Acpi-State, object size: 80, buffer size: 80, default order: 0, min order: 0 node 0: slabs: 22, objs: 1122, free: 0 ACPI Error: AE_NO_MEMORY, Could not update object reference count (20210730/utdelete-651) [drm:psp_hw_start [amdgpu]] *ERROR* PSP load kdb failed! [drm:psp_resume [amdgpu]] *ERROR* PSP resume failed [drm:amdgpu_device_fw_loading [amdgpu]] *ERROR* resume of IP block failed -62 amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_resume failed (-62). PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -62 amdgpu 0000:03:00.0: PM: failed to resume async: error -62 ``` To avoid this series of unfortunate events, fail amdgpu's suspend when the memory eviction fails. This will let the system gracefully recover and the user can try suspend again when the memory pressure is relieved. Reported-by: post@davidak.de Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2223 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Acked-by: Christian König Signed-off-by: Alex Deucher commit 5449cabd95bbf141e2b7471e8d3cedb6f3b92492 Merge: f76c745151e08 c4a7b9b587ca1 Author: Arnd Bergmann Date: Wed Nov 2 21:57:38 2022 +0100 Merge tag 'juno-fix-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Armv8 Juno fix for v6.1 Just a single fix to add the missing critical points in the thermal zones that has been mandatory in the binding but was enforced in the code recently. * tag 'juno-fix-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm64: dts: juno: Add thermal critical trip points Link: https://lore.kernel.org/r/20221102140156.2758137-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 5b994354af3cab770bf13386469c5725713679af Author: Yang Li Date: Wed Oct 26 10:00:54 2022 +0800 drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram() ./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:985:58-62: ERROR: p is NULL but dereferenced. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2549 Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit e542ca6e3e554bad53b2ea5741873b67f4585ea9 Author: Graham Sider Date: Tue Oct 25 14:42:13 2022 -0400 drm/amdgpu: correct MES debugfs versions Use mes.sched_version, mes.kiq_version for debugfs as mes.ucode_fw_version does not contain correct versioning information. Signed-off-by: Graham Sider Reviewed-by: Jack Xiao Signed-off-by: Alex Deucher commit 89b3554782e6b65894f0551e9e0a82ad02dac94d Author: Yifan Zhang Date: Mon Oct 24 12:47:47 2022 +0800 drm/amdgpu: set fb_modifiers_not_supported in vkms This patch to fix the gdm3 start failure with virual display: /usr/libexec/gdm-x-session[1711]: (II) AMDGPU(0): Setting screen physical size to 270 x 203 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to make import prime FD as pixmap: 22 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument /usr/libexec/gdm-x-session[1711]: (WW) AMDGPU(0): Failed to set mode on CRTC 0 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to enable any CRTC gnome-shell[1840]: Running GNOME Shell (using mutter 42.2) as a X11 window and compositing manager /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument vkms doesn't have modifiers support, set fb_modifiers_not_supported to bring the gdm back. Signed-off-by: Yifan Zhang Acked-by: Guchun Chen Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 9cb0dc6ccb7df9abe1407574ed4ad84895822d11 Author: Max Tseng Date: Thu Oct 20 11:46:52 2022 -0400 drm/amd/display: cursor update command incomplete Missing send cursor_rect width & Height into DMUB. PSR-SU would use these information. But missing these assignment in last refactor commit Reported-by: Timur Kristóf Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2227 Fixes: b73353f7f3d4 ("drm/amd/display: Use the same cursor info across features") Tested-by: Mark Broadworth Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Max Tseng Signed-off-by: Alex Deucher commit c3d3f35b725bf9c93bec6d3c056f6bb7cfd27403 Author: Alvin Lee Date: Thu Oct 20 11:46:51 2022 -0400 drm/amd/display: Enable timing sync on DCN32 Missed enabling timing sync on DCN32 because DCN32 has a different DML param. Tested-by: Mark Broadworth Reviewed-by: Martin Leung Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit f76c745151e08deaed7ab81bacc865aef793a059 Merge: a0e215088ef49 1eff6929aff59 Author: Arnd Bergmann Date: Wed Nov 2 21:50:27 2022 +0100 Merge tag 'scmi-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI fixes for v6.1 A bunch of fixes to handle: 1. A possible resource leak in scmi_remove(). The returned error value gets ignored by the driver core and can remove the device and free the devm-allocated resources. As a simple solution to be able to easily backport, the bind attributes in the driver is suppressed as there is no need to support it. Additionally the remove path is cleaned up by adding device links between the core and the protocol devices so that a proper and complete unbinding happens. 2. A possible spin-loop in the SCMI transmit path in case of misbehaving platform firmware. A timeout is added to the existing loop so that the SCMI stack can bailout aborting the transmission with warnings. 3. Optional Rx channel correctly by reporting any memory errors instead of ignoring the same with other allowed errors. 4. The use of proper device for all the device managed allocations in the virtio transport. 5. Incorrect deferred_tx_wq release on the error paths by using devres API(devm_add_action_or_reset) to manage the release in the error path. * tag 'scmi-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix deferred_tx_wq release on error paths firmware: arm_scmi: Fix devres allocation device in virtio transport firmware: arm_scmi: Make Rx chan_setup fail on memory errors firmware: arm_scmi: Make tx_prepare time out eventually firmware: arm_scmi: Suppress the driver's bind attributes firmware: arm_scmi: Cleanup the core driver removal callback Link: https://lore.kernel.org/r/20221102140142.2758107-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 6cb5cec16c380be4cf9776a8c23b72e9fe742fd1 Author: Dillon Varone Date: Thu Oct 20 11:46:48 2022 -0400 drm/amd/display: Set memclk levels to be at least 1 for dcn32 [Why] Cannot report 0 memclk levels even when SMU does not provide any. [How] When memclk levels reported by SMU is 0, set levels to 1. Tested-by: Mark Broadworth Reviewed-by: Martin Leung Acked-by: Rodrigo Siqueira Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit c580d758ba1b79de9ea7a475d95a6278736ae462 Author: Dillon Varone Date: Thu Oct 20 11:46:47 2022 -0400 drm/amd/display: Update latencies on DCN321 Update DF related latencies based on new measurements. Tested-by: Mark Broadworth Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit e59843c4cdd68a369591630088171eeacce9859f Author: Jun Lei Date: Thu Oct 20 11:46:44 2022 -0400 drm/amd/display: Limit dcn32 to 1950Mhz display clock [why] Hardware team recommends we limit dispclock to 1950Mhz for all DCN3.2.x [how] Limit to 1950 when initializing clocks. Tested-by: Mark Broadworth Reviewed-by: Alvin Lee Acked-by: Rodrigo Siqueira Signed-off-by: Jun Lei Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 14aed119942f6c2f1286022323139f7404db5d2b Author: Fangzhi Zuo Date: Thu Oct 20 11:46:41 2022 -0400 drm/amd/display: Ignore Cable ID Feature Ignore cable ID for DP2 receivers that does not support the feature. Tested-by: Mark Broadworth Reviewed-by: Roman Li Acked-by: Rodrigo Siqueira Signed-off-by: Fangzhi Zuo Signed-off-by: Alex Deucher commit 341421084d705475817f7f0d68e130370d10b20d Author: Leo Chen Date: Thu Oct 20 11:46:40 2022 -0400 drm/amd/display: Update DSC capabilitie for DCN314 dcn314 has 4 DSC - conflicted hardware document updated and confirmed. Tested-by: Mark Broadworth Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Leo Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 8e987f1f4da92d9f1dd020418bfab9fe04b1c54c Author: Yang Yingliang Date: Wed Nov 2 21:45:59 2022 +0800 Documentation: devres: add missing I2C helper Add missing devm_i2c_add_adapter() to devres.rst. It's introduced by commit 07740c92ae57 ("i2c: core: add managed function for adding i2c adapters"). Fixes: 07740c92ae57 ("i2c: core: add managed function for adding i2c adapters") Signed-off-by: Yang Yingliang Acked-by: Yicong Yang Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 8e5423e991e8cd0988d0c4a3f4ac4ca1af7d148a Merge: 31fc92fc93d54 2b6ae0962b421 Author: Linus Torvalds Date: Wed Nov 2 11:25:12 2022 -0700 Merge tag 'parisc-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "This mostly handles oddities with the serial port 8250_gsc.c driver. Although the name suggests it's just for serial ports on the GSC bus (e.g. in older PA-RISC machines), it handles serial ports on PA-RISC PCI devices (e.g. on the SuperIO chip) as well. Thus this renames the driver to 8250_parisc and fixes the config dependencies. The other change is a cleanup on how the device IDs of devices in a PA-RISC machine are shown at startup" * tag 'parisc-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Avoid printing the hardware path twice parisc: Export iosapic_serial_irq() symbol for serial port driver MAINTAINERS: adjust entry after renaming parisc serial driver parisc: Use signed char for hardware path in pdc.h parisc/serial: Rename 8250_gsc.c to 8250_parisc.c parisc: Make 8250_gsc driver dependend on CONFIG_PARISC commit 510841da1fcc16f702440ab58ef0b4d82a9056b7 Author: Jozsef Kadlecsik Date: Wed Nov 2 10:40:47 2022 +0100 netfilter: ipset: enforce documented limit to prevent allocating huge memory Daniel Xu reported that the hash:net,iface type of the ipset subsystem does not limit adding the same network with different interfaces to a set, which can lead to huge memory usage or allocation failure. The quick reproducer is $ ipset create ACL.IN.ALL_PERMIT hash:net,iface hashsize 1048576 timeout 0 $ for i in $(seq 0 100); do /sbin/ipset add ACL.IN.ALL_PERMIT 0.0.0.0/0,kaf_$i timeout 0 -exist; done The backtrace when vmalloc fails: [Tue Oct 25 00:13:08 2022] ipset: vmalloc error: size 1073741848, exceeds total pages <...> [Tue Oct 25 00:13:08 2022] Call Trace: [Tue Oct 25 00:13:08 2022] [Tue Oct 25 00:13:08 2022] dump_stack_lvl+0x48/0x60 [Tue Oct 25 00:13:08 2022] warn_alloc+0x155/0x180 [Tue Oct 25 00:13:08 2022] __vmalloc_node_range+0x72a/0x760 [Tue Oct 25 00:13:08 2022] ? hash_netiface4_add+0x7c0/0xb20 [Tue Oct 25 00:13:08 2022] ? __kmalloc_large_node+0x4a/0x90 [Tue Oct 25 00:13:08 2022] kvmalloc_node+0xa6/0xd0 [Tue Oct 25 00:13:08 2022] ? hash_netiface4_resize+0x99/0x710 <...> The fix is to enforce the limit documented in the ipset(8) manpage: > The internal restriction of the hash:net,iface set type is that the same > network prefix cannot be stored with more than 64 different interfaces > in a single set. Fixes: ccf0a4b7fc68 ("netfilter: ipset: Add bucketsize parameter to all hash types") Reported-by: Daniel Xu Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit 31fc92fc93d54d8bedf0d06c1da0510a89867978 Merge: ae13366b177b0 7e8436728e221 Author: Linus Torvalds Date: Wed Nov 2 11:18:13 2022 -0700 Merge tag 'nfs-for-6.1-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client bugfixes from Anna Schumaker: - Fix some coccicheck warnings - Avoid memcpy() run-time warning - Fix up various state reclaim / RECLAIM_COMPLETE errors - Fix a null pointer dereference in sysfs - Fix LOCK races - Fix gss_unwrap_resp_integ() crasher - Fix zero length clones - Fix memleak when allocate slot fails * tag 'nfs-for-6.1-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: nfs4: Fix kmemleak when allocate slot failed NFSv4.2: Fixup CLONE dest file size for zero-length count SUNRPC: Fix crasher in gss_unwrap_resp_integ() NFSv4: Retry LOCK on OLD_STATEID during delegation return SUNRPC: Fix null-ptr-deref when xps sysfs alloc failed NFSv4.1: We must always send RECLAIM_COMPLETE after a reboot NFSv4.1: Handle RECLAIM_COMPLETE trunking errors NFSv4: Fix a potential state reclaim deadlock NFS: Avoid memcpy() run-time warning for struct sockaddr overflows nfs: Remove redundant null checks before kfree commit ae13366b177b062b420288c8affe6a513aae56f9 Merge: 8f71a2b3f435f 7a47e077e503f Author: Linus Torvalds Date: Wed Nov 2 11:10:56 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Fix a few more of the usual sorts of bugs: - Another regression with source route validation in CMA, introduced this merge window - Crash in hfi1 due to faulty list operations - PCI ID updates for EFA - Disable LOCAL_INV in hns because it causes a HW hang - Crash in hns due to missing initialization - Memory leak in rxe - Missing error unwind during ib_core module loading - Missing error handling in qedr around work queue creation during startup" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/qedr: clean up work queue on failure in qedr_alloc_resources() RDMA/core: Fix null-ptr-deref in ib_core_cleanup() RDMA/rxe: Fix mr leak in RESPST_ERR_RNR RDMA/hns: Fix NULL pointer problem in free_mr_init() RDMA/hns: Disable local invalidate operation RDMA/efa: Add EFA 0xefa2 PCI ID IB/hfi1: Correctly move list in sc_disable() RDMA/cma: Use output interface for net_dev check commit b333b8ebb85d62469f32b52fa03fd7d1522afc03 Author: Sean Christopherson Date: Thu Oct 6 00:03:10 2022 +0000 KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL Ignore guest CPUID for host userspace writes to the DEBUGCTL MSR, KVM's ABI is that setting CPUID vs. state can be done in any order, i.e. KVM allows userspace to stuff MSRs prior to setting the guest's CPUID that makes the new MSR "legal". Keep the vmx_get_perf_capabilities() check for guest writes, even though it's technically unnecessary since the vCPU's PERF_CAPABILITIES is consulted when refreshing LBR support. A future patch will clean up vmx_get_perf_capabilities() to avoid the RDMSR on every call, at which point the paranoia will incur no meaningful overhead. Note, prior to vmx_get_perf_capabilities() checking that the host fully supports LBRs via x86_perf_get_lbr(), KVM effectively relied on intel_pmu_lbr_is_enabled() to guard against host userspace enabling LBRs on platforms without full support. Fixes: c646236344e9 ("KVM: vmx/pmu: Add PMU_CAP_LBR_FMT check when guest LBR is enabled") Signed-off-by: Sean Christopherson Message-Id: <20221006000314.73240-5-seanjc@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 18e897d213cb152c786abab14919196bd9dc3a9f Author: Sean Christopherson Date: Thu Oct 6 00:03:09 2022 +0000 KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl() Fold vmx_supported_debugctl() into vcpu_supported_debugctl(), its only caller. Setting bits only to clear them a few instructions later is rather silly, and splitting the logic makes things seem more complicated than they actually are. Opportunistically drop DEBUGCTLMSR_LBR_MASK now that there's a single reference to the pair of bits. The extra layer of indirection provides no meaningful value and makes it unnecessarily tedious to understand what KVM is doing. No functional change. Signed-off-by: Sean Christopherson Message-Id: <20221006000314.73240-4-seanjc@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 145dfad998eac74abc59219d936e905766ba2d98 Author: Sean Christopherson Date: Thu Oct 6 00:03:08 2022 +0000 KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs Advertise LBR support to userspace via MSR_IA32_PERF_CAPABILITIES if and only if perf fully supports LBRs. Perf may disable LBRs (by zeroing the number of LBRs) even on platforms the allegedly support LBRs, e.g. if probing any LBR MSRs during setup fails. Fixes: be635e34c284 ("KVM: vmx/pmu: Expose LBR_FMT in the MSR_IA32_PERF_CAPABILITIES") Reported-by: Like Xu Signed-off-by: Sean Christopherson Message-Id: <20221006000314.73240-3-seanjc@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit f45cb6b29cd36514e13f7519770873d8c0457008 Author: Wen Gong Date: Wed Nov 2 13:48:03 2022 +0200 wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update() (cherry picked from commit d99884ad9e3673a12879bc2830f6e5a66cccbd78 in ath-next as users are seeing this bug more now, also cc stable) Running this test in a loop it is easy to reproduce an rtnl deadlock: iw reg set FI ifconfig wlan0 down What happens is that thread A (workqueue) tries to update the regulatory: try to acquire the rtnl_lock of ar->regd_update_work rtnl_lock+0x17/0x20 ath11k_regd_update+0x15a/0x260 [ath11k] ath11k_regd_update_work+0x15/0x20 [ath11k] process_one_work+0x228/0x670 worker_thread+0x4d/0x440 kthread+0x16d/0x1b0 ret_from_fork+0x22/0x30 And thread B (ifconfig) tries to stop the interface: try to cancel_work_sync(&ar->regd_update_work) in ath11k_mac_op_stop(). ifconfig 3109 [003] 2414.232506: probe: ath11k_mac_op_stop: (ffffffffc14187a0) drv_stop+0x30 ([mac80211]) ieee80211_do_stop+0x5d2 ([mac80211]) ieee80211_stop+0x3e ([mac80211]) __dev_close_many+0x9e ([kernel.kallsyms]) __dev_change_flags+0xbe ([kernel.kallsyms]) dev_change_flags+0x23 ([kernel.kallsyms]) devinet_ioctl+0x5e3 ([kernel.kallsyms]) inet_ioctl+0x197 ([kernel.kallsyms]) sock_do_ioctl+0x4d ([kernel.kallsyms]) sock_ioctl+0x264 ([kernel.kallsyms]) __x64_sys_ioctl+0x92 ([kernel.kallsyms]) do_syscall_64+0x3a ([kernel.kallsyms]) entry_SYSCALL_64_after_hwframe+0x63 ([kernel.kallsyms]) __GI___ioctl+0x7 (/lib/x86_64-linux-gnu/libc-2.23.so) The sequence of deadlock is: 1. Thread B calls rtnl_lock(). 2. Thread A starts to run and calls rtnl_lock() from within ath11k_regd_update_work(), then enters wait state because the lock is owned by thread B. 3. Thread B continues to run and tries to call cancel_work_sync(&ar->regd_update_work), but thread A is in ath11k_regd_update_work() waiting for rtnl_lock(). So cancel_work_sync() forever waits for ath11k_regd_update_work() to finish and we have a deadlock. Fix this by switching from using regulatory_set_wiphy_regd_sync() to regulatory_set_wiphy_regd(). Now cfg80211 will schedule another workqueue which handles the locking on it's own. So the ath11k workqueue can simply exit without taking any locks, avoiding the deadlock. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Cc: Signed-off-by: Wen Gong [kvalo: improve commit log] Signed-off-by: Kalle Valo commit 3a89b6dec9920026eaa90fe8457f4348d3388a98 Author: Tyler J. Stachecki Date: Wed Nov 2 18:56:39 2022 +0200 wifi: ath11k: Fix QCN9074 firmware boot on x86 The 2.7.0 series of QCN9074's firmware requests 5 segments of memory instead of 3 (as in the 2.5.0 series). The first segment (11M) is too large to be kalloc'd in one go on x86 and requires piecemeal 1MB allocations, as was the case with the prior public firmware (2.5.0, 15M). Since f6f92968e1e5, ath11k will break the memory requests, but only if there were fewer than 3 segments requested by the firmware. It seems that 5 segments works fine and allows QCN9074 to boot on x86 with firmware 2.7.0, so change things accordingly. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.16 Signed-off-by: Tyler J. Stachecki Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221022042728.43015-1-stachecki.tyler@gmail.com commit eb81b682b131642405a05c627ab08cf0967b3dd8 Author: Filipe Manana Date: Wed Nov 2 12:46:36 2022 +0000 btrfs: fix inode reserve space leak due to nowait buffered write During a nowait buffered write, if we fail to balance dirty pages we exit btrfs_buffered_write() without releasing the delalloc space reserved for an extent, resulting in leaking space from the inode's block reserve. So fix that by releasing the delalloc space for the extent when balancing dirty pages fails. Reported-by: kernel test robot Link: https://lore.kernel.org/all/202210111304.d369bc32-yujie.liu@intel.com Fixes: 965f47aeb5de ("btrfs: make btrfs_buffered_write nowait compatible") Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit a348c8d4f6cf23ef04b0edaccdfe9d94c2d335db Author: Filipe Manana Date: Wed Nov 2 12:46:35 2022 +0000 btrfs: fix nowait buffered write returning -ENOSPC If we are doing a buffered write in NOWAIT context and we can't reserve metadata space due to -ENOSPC, then we should return -EAGAIN so that we retry the write in a context allowed to block and do metadata reservation with flushing, which might succeed this time due to the allowed flushing. Returning -ENOSPC while in NOWAIT context simply makes some writes fail with -ENOSPC when they would likely succeed after switching from NOWAIT context to blocking context. That is unexpected behaviour and even fio complains about it with a warning like this: fio: io_u error on file /mnt/sdi/task_0.0.0: No space left on device: write offset=1535705088, buflen=65536 fio: pid=592630, err=28/file:io_u.c:1846, func=io_u error, error=No space left on device The fio's job config is this: [global] bs=64K ioengine=io_uring iodepth=1 size=2236962133 nr_files=1 filesize=2236962133 direct=0 runtime=10 fallocate=posix io_size=2236962133 group_reporting time_based [task_0] rw=randwrite directory=/mnt/sdi numjobs=4 So fix this by returning -EAGAIN if we are in NOWAIT context and the metadata reservation failed with -ENOSPC. Fixes: 304e45acdb8f ("btrfs: plumb NOWAIT through the write path") Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 Author: Filipe Manana Date: Tue Nov 1 16:15:40 2022 +0000 btrfs: remove pointless and double ulist frees in error paths of qgroup tests Several places in the qgroup self tests follow the pattern of freeing the ulist pointer they passed to btrfs_find_all_roots() if the call to that function returned an error. That is pointless because that function always frees the ulist in case it returns an error. Also In some places like at test_multiple_refs(), after a call to btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots" pointing to ulists that were freed, because btrfs_qgroup_account_extent() has freed those ulists, and if after that the next call to btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots" ulist again, resulting in a double free. So remove those calls to reduce the code size and avoid double ulist free in case of an error. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d37de92b38932d40e4a251e876cc388f9aee5f42 Author: Filipe Manana Date: Tue Nov 1 16:15:39 2022 +0000 btrfs: fix ulist leaks in error paths of qgroup self tests In the test_no_shared_qgroup() and test_multiple_refs() qgroup self tests, if we fail to add the tree ref, remove the extent item or remove the extent ref, we are returning from the test function without freeing the "old_roots" ulist that was allocated by the previous calls to btrfs_find_all_roots(). Fix that by calling ulist_free() before returning. Fixes: 442244c96332 ("btrfs: qgroup: Switch self test to extent-oriented qgroup mechanism.") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 92876eec382a0f19f33d09d2c939e9ca49038ae5 Author: Filipe Manana Date: Tue Nov 1 16:15:38 2022 +0000 btrfs: fix inode list leak during backref walking at find_parent_nodes() During backref walking, at find_parent_nodes(), if we are dealing with a data extent and we get an error while resolving the indirect backrefs, at resolve_indirect_refs(), or in the while loop that iterates over the refs in the direct refs rbtree, we end up leaking the inode lists attached to the direct refs we have in the direct refs rbtree that were not yet added to the refs ulist passed as argument to find_parent_nodes(). Since they were not yet added to the refs ulist and prelim_release() does not free the lists, on error the caller can only free the lists attached to the refs that were added to the refs ulist, all the remaining refs get their inode lists never freed, therefore leaking their memory. Fix this by having prelim_release() always free any attached inode list to each ref found in the rbtree, and have find_parent_nodes() set the ref's inode list to NULL once it transfers ownership of the inode list to a ref added to the refs ulist passed to find_parent_nodes(). Fixes: 86d5f9944252 ("btrfs: convert prelimary reference tracking to use rbtrees") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5614dc3a47e3310fbc77ea3b67eaadd1c6417bf1 Author: Filipe Manana Date: Tue Nov 1 16:15:37 2022 +0000 btrfs: fix inode list leak during backref walking at resolve_indirect_refs() During backref walking, at resolve_indirect_refs(), if we get an error we jump to the 'out' label and call ulist_free() on the 'parents' ulist, which frees all the elements in the ulist - however that does not free any inode lists that may be attached to elements, through the 'aux' field of a ulist node, so we end up leaking lists if we have any attached to the unodes. Fix this by calling free_leaf_list() instead of ulist_free() when we exit from resolve_indirect_refs(). The static function free_leaf_list() is moved up for this to be possible and it's slightly simplified by removing unnecessary code. Fixes: 3301958b7c1d ("Btrfs: add inodes before dropping the extent lock in find_all_leafs") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 9921d5013a6e51892623bf2f1c5b49eaecda55ac Author: Pavel Begunkov Date: Thu Oct 27 00:11:53 2022 +0100 selftests/net: don't tests batched TCP io_uring zc It doesn't make sense batch submitting io_uring requests to a single TCP socket without linking or some other kind of ordering. Moreover, it causes spurious -EINTR fails due to interaction with task_work. Disable it for now and keep queue depth=1. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b547698d5938b1b1a898af1c260188d8546ded9a.1666700897.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b5bcb94b0954a026bbd671741fdb00e7141f9c91 Author: Yang Yingliang Date: Fri Oct 28 21:40:43 2022 +0800 HID: hyperv: fix possible memory leak in mousevsc_probe() If hid_add_device() returns error, it should call hid_destroy_device() to free hid_dev which is allocated in hid_allocate_device(). Fixes: 74c4fb058083 ("HID: hv_mouse: Properly add the hid device") Signed-off-by: Yang Yingliang Reviewed-by: Wei Liu Signed-off-by: Jiri Kosina commit 7f9dbf54c3dc7170df86f7753abb41b5d7e8779e Author: Colin Ian King Date: Mon Oct 24 17:11:02 2022 +0100 HID: asus: Remove unused variable in asus_report_tool_width() Variable count is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it. Signed-off-by: Colin Ian King Signed-off-by: Jiri Kosina commit ba9169f57090efdee6b13601fced57e123db8777 Merge: e97c089d7a49f bf00f54260742 Author: David S. Miller Date: Wed Nov 2 12:34:48 2022 +0000 Merge branch 'misdn-fixes' Yang Yingliang says: ==================== two fixes for mISDN This patchset fixes two issues when device_add() returns error. ==================== Signed-off-by: David S. Miller commit bf00f5426074249058a106a6edbb89e4b25a4d79 Author: Yang Yingliang Date: Mon Oct 31 20:13:41 2022 +0800 isdn: mISDN: netjet: fix wrong check of device registration The class is set in mISDN_register_device(), but if device_add() returns error, it will lead to delete a device without added, fix this by using device_is_registered() to check if the device is registered. Fixes: a900845e5661 ("mISDN: Add support for Traverse Technologies NETJet PCI cards") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit e7d1d4d9ac0dfa40be4c2c8abd0731659869b297 Author: Yang Yingliang Date: Mon Oct 31 20:13:40 2022 +0800 mISDN: fix possible memory leak in mISDN_register_device() Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, add put_device() to give up the reference, so that the name can be freed in kobject_cleanup() when the refcount is 0. Set device class before put_device() to avoid null release() function WARN message in device_release(). Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 134af9aa88453aeb9224e407092530ebba366c6c Author: Neil Armstrong Date: Wed Nov 2 09:46:01 2022 +0100 spi: meson-spicc: fix do_div build error on non-arm64 This fixes : error: passing argument 1 of '__div64_32' from incompatible pointer type By passing an uint64_t as first variable to do_div(). Reported-by: kernel test robot Fixes: 04694e50020b ("spi: meson-spicc: move wait completion in driver to take bursts delay in account") Acked-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20221027-b4-spicc-burst-delay-fix-v2-0-8cc2bab3417a@linaro.org Signed-off-by: Mark Brown commit e97c089d7a49f67027395ddf70bf327eeac2611e Author: Zhang Qilong Date: Sat Oct 29 00:10:49 2022 +0800 rose: Fix NULL pointer dereference in rose_send_frame() The syzkaller reported an issue: KASAN: null-ptr-deref in range [0x0000000000000380-0x0000000000000387] CPU: 0 PID: 4069 Comm: kworker/0:15 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: rcu_gp srcu_invoke_callbacks RIP: 0010:rose_send_frame+0x1dd/0x2f0 net/rose/rose_link.c:101 Call Trace: rose_transmit_clear_request+0x1d5/0x290 net/rose/rose_link.c:255 rose_rx_call_request+0x4c0/0x1bc0 net/rose/af_rose.c:1009 rose_loopback_timer+0x19e/0x590 net/rose/rose_loopback.c:111 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d0/0x9c8 kernel/softirq.c:571 [...] It triggers NULL pointer dereference when 'neigh->dev->dev_addr' is called in the rose_send_frame(). It's the first occurrence of the `neigh` is in rose_loopback_timer() as `rose_loopback_neigh', and the 'dev' in 'rose_loopback_neigh' is initialized sa nullptr. It had been fixed by commit 3b3fd068c56e3fbea30090859216a368398e39bf ("rose: Fix Null pointer dereference in rose_send_frame()") ever. But it's introduced by commit 3c53cd65dece47dd1f9d3a809f32e59d1d87b2b8 ("rose: check NULL rose_loopback_neigh->loopback") again. We fix it by add NULL check in rose_transmit_clear_request(). When the 'dev' in 'neigh' is NULL, we don't reply the request and just clear it. syzkaller don't provide repro, and I provide a syz repro like: r0 = syz_init_net_socket$bt_sco(0x1f, 0x5, 0x2) ioctl$sock_inet_SIOCSIFFLAGS(r0, 0x8914, &(0x7f0000000180)={'rose0\x00', 0x201}) r1 = syz_init_net_socket$rose(0xb, 0x5, 0x0) bind$rose(r1, &(0x7f00000000c0)=@full={0xb, @dev, @null, 0x0, [@null, @null, @netrom, @netrom, @default, @null]}, 0x40) connect$rose(r1, &(0x7f0000000240)=@short={0xb, @dev={0xbb, 0xbb, 0xbb, 0x1, 0x0}, @remote={0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x1}, 0x1, @netrom={0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x0, 0x0}}, 0x1c) Fixes: 3c53cd65dece ("rose: check NULL rose_loopback_neigh->loopback") Signed-off-by: Zhang Qilong Signed-off-by: David S. Miller commit 6f8faf471446844bb9c318e0340221049d5c19f4 Author: Kan Liang Date: Mon Oct 31 08:45:50 2022 -0700 perf/x86/intel: Add Cooper Lake stepping to isolation_ucodes[] The intel_pebs_isolation quirk checks both model number and stepping. Cooper Lake has a different stepping (11) than the other Skylake Xeon. It cannot benefit from the optimization in commit 9b545c04abd4f ("perf/x86/kvm: Avoid unnecessary work in guest filtering"). Add the stepping of Cooper Lake into the isolation_ucodes[] table. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221031154550.571663-1-kan.liang@linux.intel.com commit 0916886bb978e7eae1ca3955ba07f51c020da20c Author: Kan Liang Date: Mon Oct 31 08:41:19 2022 -0700 perf/x86/intel: Fix pebs event constraints for SPR According to the latest event list, update the MEM_INST_RETIRED events which support the DataLA facility for SPR. Fixes: 61b985e3e775 ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids") Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221031154119.571386-2-kan.liang@linux.intel.com commit acc5568b90c19ac6375508a93b9676cd18a92a35 Author: Kan Liang Date: Mon Oct 31 08:41:18 2022 -0700 perf/x86/intel: Fix pebs event constraints for ICL According to the latest event list, update the MEM_INST_RETIRED events which support the DataLA facility. Fixes: 6017608936c1 ("perf/x86/intel: Add Icelake support") Reported-by: Jannis Klinkenberg Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221031154119.571386-1-kan.liang@linux.intel.com commit 80275ca9e525c198c7efe045c4a6cdb68a2ea763 Author: Zhang Rui Date: Sat Sep 24 13:47:37 2022 +0800 perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR Dram energy unit quirk. Fixes: bcfd218b6679 ("perf/x86/rapl: Add support for Intel SPR platform") Signed-off-by: Zhang Rui Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Tested-by: Wang Wendy Link: https://lkml.kernel.org/r/20220924054738.12076-3-rui.zhang@intel.com commit 4b18cb3f74dcfc183c2434e17bfce09ce6302e37 Author: David Gow Date: Wed Oct 26 22:10:40 2022 +0800 perf/hw_breakpoint: test: Skip the test if dependencies unmet Running the test currently fails on non-SMP systems, despite being enabled by default. This means that running the test with: ./tools/testing/kunit/kunit.py run --arch x86_64 hw_breakpoint results in every hw_breakpoint test failing with: # test_one_cpu: failed to initialize: -22 not ok 1 - test_one_cpu Instead, use kunit_skip(), which will mark the test as skipped, and give a more comprehensible message: ok 1 - test_one_cpu # SKIP not enough cpus This makes it more obvious that the test is not suited to the test environment, and so wasn't run, rather than having run and failed. Signed-off-by: David Gow Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Latypov Acked-by: Marco Elver Link: https://lore.kernel.org/r/20221026141040.1609203-1-davidgow@google.com commit 34de8e6e0e1f66e431abf4123934a2581cb5f133 Author: Pu Lehui Date: Wed Nov 2 16:40:34 2022 +0800 bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE When using bpftool to pin {PROG, MAP, LINK} without FILE, segmentation fault will occur. The reson is that the lack of FILE will cause strlen to trigger NULL pointer dereference. The corresponding stacktrace is shown below: do_pin do_pin_any do_pin_fd mount_bpffs_for_pin strlen(name) <- NULL pointer dereference Fix it by adding validation to the common process. Fixes: 75a1e792c335 ("tools: bpftool: Allow all prog/map handles for pinning objects") Signed-off-by: Pu Lehui Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20221102084034.3342995-1-pulehui@huaweicloud.com commit cbc1dd5b659f5a2c3cba88b197b7443679bb35a0 Author: Chen Zhongjin Date: Tue Nov 1 19:52:52 2022 +0800 netfilter: nf_nat: Fix possible memory leak in nf_nat_init() In nf_nat_init(), register_nf_nat_bpf() can fail and return directly without any error handling. Then nf_nat_bysource will leak and registering of &nat_net_ops, &follow_master_nat and nf_nat_hook won't be reverted. This leaves wild ops in linkedlists and when another module tries to call register_pernet_operations() or nf_ct_helper_expectfn_register() it triggers page fault: BUG: unable to handle page fault for address: fffffbfff81b964c RIP: 0010:register_pernet_operations+0x1b9/0x5f0 Call Trace: register_pernet_subsys+0x29/0x40 ebtables_init+0x58/0x1000 [ebtables] ... Fixes: 820dc0523e05 ("net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c") Signed-off-by: Chen Zhongjin Signed-off-by: Pablo Neira Ayuso commit 89c1017aac67ca81973b7c8eac5d021315811a93 Author: Zhao Gongyi Date: Tue Nov 1 11:56:02 2022 +0800 selftests/pidfd_test: Remove the erroneous ',' Remove the erroneous ',', otherwise it might result in wrong output and report: ... Bail out! (errno %d) test: Unexpected epoll_wait result (c=4208480, events=2) ... Fixes: 740378dc7834 ("pidfd: add polling selftests") Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 30ac96f7cc973bb850c718c9bbe1fdcedfbe826b Author: Howard Hsu Date: Thu Oct 27 09:56:53 2022 +0800 wifi: mac80211: Set TWT Information Frame Disabled bit as 1 The TWT Information Frame Disabled bit of control field of TWT Setup frame shall be set to 1 since handling TWT Information frame is not supported by current mac80211 implementation. Fixes: f5a4c24e689f ("mac80211: introduce individual TWT support in AP mode") Signed-off-by: Howard Hsu Link: https://lore.kernel.org/r/20221027015653.1448-1-howard-yh.hsu@mediatek.com Signed-off-by: Johannes Berg commit 39e7b5de9853bd92ddbfa4b14165babacd7da0ba Author: Nicolas Cavallari Date: Thu Oct 27 16:01:33 2022 +0200 wifi: mac80211: Fix ack frame idr leak when mesh has no route When trying to transmit an data frame with tx_status to a destination that have no route in the mesh, then it is dropped without recrediting the ack_status_frames idr. Once it is exhausted, wpa_supplicant starts failing to do SAE with NL80211_CMD_FRAME and logs "nl80211: Frame command failed". Use ieee80211_free_txskb() instead of kfree_skb() to fix it. Signed-off-by: Nicolas Cavallari Link: https://lore.kernel.org/r/20221027140133.1504-1-nicolas.cavallari@green-communications.fr Signed-off-by: Johannes Berg commit 780854186946e0de2be192ee7fa5125666533b3a Author: Zhengchao Shao Date: Wed Oct 26 14:39:59 2022 +0800 wifi: mac80211: fix general-protection-fault in ieee80211_subif_start_xmit() When device is running and the interface status is changed, the gpf issue is triggered. The problem triggering process is as follows: Thread A: Thread B ieee80211_runtime_change_iftype() process_one_work() ... ... ieee80211_do_stop() ... ... ... sdata->bss = NULL ... ... ieee80211_subif_start_xmit() ieee80211_multicast_to_unicast //!sdata->bss->multicast_to_unicast cause gpf issue When the interface status is changed, the sending queue continues to send packets. After the bss is set to NULL, the bss is accessed. As a result, this causes a general-protection-fault issue. The following is the stack information: general protection fault, probably for non-canonical address 0xdffffc000000002f: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000178-0x000000000000017f] Workqueue: mld mld_ifc_work RIP: 0010:ieee80211_subif_start_xmit+0x25b/0x1310 Call Trace: dev_hard_start_xmit+0x1be/0x990 __dev_queue_xmit+0x2c9a/0x3b60 ip6_finish_output2+0xf92/0x1520 ip6_finish_output+0x6af/0x11e0 ip6_output+0x1ed/0x540 mld_sendpack+0xa09/0xe70 mld_ifc_work+0x71c/0xdb0 process_one_work+0x9bf/0x1710 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Fixes: f856373e2f31 ("wifi: mac80211: do not wake queues on a vif that is being stopped") Reported-by: syzbot+c6e8fca81c294fd5620a@syzkaller.appspotmail.com Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221026063959.177813-1-shaozhengchao@huawei.com Signed-off-by: Johannes Berg commit 5663ed63adb9619c98ab7479aa4606fa9b7a548c Author: Zhengchao Shao Date: Mon Oct 31 20:07:05 2022 +0800 ipvs: fix WARNING in ip_vs_app_net_cleanup() During the initialization of ip_vs_app_net_init(), if file ip_vs_app fails to be created, the initialization is successful by default. Therefore, the ip_vs_app file doesn't be found during the remove in ip_vs_app_net_cleanup(). It will cause WRNING. The following is the stack information: name 'ip_vs_app' WARNING: CPU: 1 PID: 9 at fs/proc/generic.c:712 remove_proc_entry+0x389/0x460 Modules linked in: Workqueue: netns cleanup_net RIP: 0010:remove_proc_entry+0x389/0x460 Call Trace: ops_exit_list+0x125/0x170 cleanup_net+0x4ea/0xb00 process_one_work+0x9bf/0x1710 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Fixes: 457c4cbc5a3d ("[NET]: Make /proc/net per network namespace") Signed-off-by: Zhengchao Shao Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 3d00c6a0da8ddcf75213e004765e4a42acc71d5d Author: Zhengchao Shao Date: Mon Oct 31 20:07:04 2022 +0800 ipvs: fix WARNING in __ip_vs_cleanup_batch() During the initialization of ip_vs_conn_net_init(), if file ip_vs_conn or ip_vs_conn_sync fails to be created, the initialization is successful by default. Therefore, the ip_vs_conn or ip_vs_conn_sync file doesn't be found during the remove. The following is the stack information: name 'ip_vs_conn_sync' WARNING: CPU: 3 PID: 9 at fs/proc/generic.c:712 remove_proc_entry+0x389/0x460 Modules linked in: Workqueue: netns cleanup_net RIP: 0010:remove_proc_entry+0x389/0x460 Call Trace: __ip_vs_cleanup_batch+0x7d/0x120 ops_exit_list+0x125/0x170 cleanup_net+0x4ea/0xb00 process_one_work+0x9bf/0x1710 worker_thread+0x665/0x1080 kthread+0x2e4/0x3a0 ret_from_fork+0x1f/0x30 Fixes: 61b1ab4583e2 ("IPVS: netns, add basic init per netns.") Signed-off-by: Zhengchao Shao Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 5c26159c97b324dc5174a5713eafb8c855cf8106 Author: Jason A. Donenfeld Date: Wed Oct 26 14:32:16 2022 +0200 ipvs: use explicitly signed chars The `char` type with no explicit sign is sometimes signed and sometimes unsigned. This code will break on platforms such as arm, where char is unsigned. So mark it here as explicitly signed, so that the todrop_counter decrement and subsequent comparison is correct. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jason A. Donenfeld Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 7a263a0402561035199cd9049baadb908a92b6b4 Author: Masahiro Yamada Date: Mon Oct 24 04:10:55 2022 +0900 kconfig: fix segmentation fault in menuconfig search Since commit d05377e184fc ("kconfig: Create links to main menu items in search"), menuconfig shows a jump key next to "Main menu" if the nearest visible parent is the rootmenu. If you press that jump key, menuconfig crashes with a segmentation fault. For example, do this: $ make ARCH=arm64 allnoconfig menuconfig Press '/' to search for the string "ACPI". Press '1' to choose "(1) Main menu". Then, menuconfig crashed with a segmentation fault. The following code in search_conf() conf(targets[i]->parent, targets[i]); results in NULL pointer dereference because targets[i] is the rootmenu, which does not have a parent. Commit d05377e184fc tried to fix the issue of top-level items not having a jump key, but adding the "Main menu" was not the right fix. The correct fix is to show the searched item itself. This fixes another weird behavior described in the comment block. Fixes: d05377e184fc ("kconfig: Create links to main menu items in search") Reported-by: Johannes Zink Signed-off-by: Masahiro Yamada Tested-by: Bagas Sanjaya Tested-by: Johannes Zink commit ecaf75ffd5f5db320d8b1da0198eef5a5ce64a3f Author: Florian Westphal Date: Mon Oct 31 13:34:07 2022 +0100 netlink: introduce bigendian integer types Jakub reported that the addition of the "network_byte_order" member in struct nla_policy increases size of 32bit platforms. Instead of scraping the bit from elsewhere Johannes suggested to add explicit NLA_BE types instead, so do this here. NLA_POLICY_MAX_BE() macro is removed again, there is no need for it: NLA_POLICY_MAX(NLA_BE.., ..) will do the right thing. NLA_BE64 can be added later. Fixes: 08724ef69907 ("netlink: introduce NLA_POLICY_MAX_BE") Reported-by: Jakub Kicinski Suggested-by: Johannes Berg Signed-off-by: Florian Westphal Link: https://lore.kernel.org/r/20221031123407.9158-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit fc57062f98b0b0ae52bc584d8fd5ac77c50df607 Author: Horatiu Vultur Date: Mon Oct 31 14:34:21 2022 +0100 net: lan966x: Fix unmapping of received frames using FDMA When lan966x was receiving a frame, then it was building the skb and after that it was calling dma_unmap_single with frame size as the length. This actually has 2 issues: 1. It is using a length to map and a different length to unmap. 2. When the unmap was happening, the data was sync for cpu but it could be that this will overwrite what build_skb was initializing. The fix for these two problems is to change the order of operations. First to sync the frame for cpu, then to build the skb and in the end to unmap using the correct size but without sync the frame again for cpu. Fixes: c8349639324a ("net: lan966x: Add FDMA functionality") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20221031133421.1283196-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 70644f722f0d297ca3c7664939f0bd3595eec14b Merge: 6c412da54c80a 872ad758f9b7f Author: Jakub Kicinski Date: Tue Nov 1 21:18:20 2022 -0700 Merge branch 'net-lan966x-fixes-for-when-mtu-is-changed' Horatiu Vultur says: ==================== net: lan966x: Fixes for when MTU is changed There were multiple problems in different parts of the driver when the MTU was changed. The first problem was that the HW was missing to configure the correct value, it was missing ETH_HLEN and ETH_FCS_LEN. The second problem was when vlan filtering was enabled/disabled, the MRU was not adjusted corretly. While the last issue was that the FDMA was calculated wrongly the correct maximum MTU. ==================== Link: https://lore.kernel.org/r/20221030213636.1031408-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 872ad758f9b7fb4eb42aebaf64e50c5b29b7ffe5 Author: Horatiu Vultur Date: Sun Oct 30 22:36:36 2022 +0100 net: lan966x: Fix FDMA when MTU is changed When MTU is changed, FDMA is required to calculate what is the maximum size of the frame that it can received. So it can calculate what is the page order needed to allocate for the received frames. The first problem was that, when the max MTU was calculated it was reading the value from dev and not from HW, so in this way it was missing L2 header + the FCS. The other problem was that once the skb is created using __build_skb_around, it would reserve some space for skb_shared_info. So if we received a frame which size is at the limit of the page order then the creating will failed because it would not have space to put all the data. Fixes: 2ea1cbac267e ("net: lan966x: Update FDMA to change MTU.") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit 25f28bb1b4a7717a9df3aa574d210374ebb6bb23 Author: Horatiu Vultur Date: Sun Oct 30 22:36:35 2022 +0100 net: lan966x: Adjust maximum frame size when vlan is enabled/disabled When vlan filtering is enabled/disabled, it is required to adjust the maximum received frame size that it can received. When vlan filtering is enabled, it would all to receive extra 4 bytes, that are the vlan tag. So the maximum frame size would be 1522 with a vlan tag. If vlan filtering is disabled then the maximum frame size would be 1518 regardless if there is or not a vlan tag. Fixes: 6d2c186afa5d ("net: lan966x: Add vlan support.") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit 486c292230166c2d61701d3c984bf9143588ea28 Author: Horatiu Vultur Date: Sun Oct 30 22:36:34 2022 +0100 net: lan966x: Fix the MTU calculation When the MTU was changed, the lan966x didn't take in consideration the L2 header and the FCS. So the HW was configured with a smaller value than what was desired. Therefore the correct value to configure the HW would be new_mtu + ETH_HLEN + ETH_FCS_LEN. The vlan tag is not considered here, because at the time when the blamed commit was added, there was no vlan filtering support. The vlan fix will be part of the next patch. Fixes: d28d6d2e37d1 ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit 373e715e31bf4e0f129befe87613a278fac228d3 Author: Kirill A. Shutemov Date: Fri Oct 28 17:12:20 2022 +0300 x86/tdx: Panic on bad configs that #VE on "private" memory access All normal kernel memory is "TDX private memory". This includes everything from kernel stacks to kernel text. Handling exceptions on arbitrary accesses to kernel memory is essentially impossible because they can happen in horribly nasty places like kernel entry/exit. But, TDX hardware can theoretically _deliver_ a virtualization exception (#VE) on any access to private memory. But, it's not as bad as it sounds. TDX can be configured to never deliver these exceptions on private memory with a "TD attribute" called ATTR_SEPT_VE_DISABLE. The guest has no way to *set* this attribute, but it can check it. Ensure ATTR_SEPT_VE_DISABLE is set in early boot. panic() if it is unset. There is no sane way for Linux to run with this attribute clear so a panic() is appropriate. There's small window during boot before the check where kernel has an early #VE handler. But the handler is only for port I/O and will also panic() as soon as it sees any other #VE, such as a one generated by a private memory access. [ dhansen: Rewrite changelog and rebase on new tdx_parse_tdinfo(). Add Kirill's tested-by because I made changes since he wrote this. ] Fixes: 9a22bf6debbf ("x86/traps: Add #VE support for TDX guest") Reported-by: ruogui.ygr@alibaba-inc.com Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Tested-by: Kirill A. Shutemov Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20221028141220.29217-3-kirill.shutemov%40linux.intel.com commit 71ee71d7adcba648077997a29a91158d20c40b09 Author: Vishal Verma Date: Tue Nov 1 01:41:00 2022 -0600 cxl/region: Fix decoder allocation crash When an intermediate port's decoders have been exhausted by existing regions, and creating a new region with the port in question in it's hierarchical path is attempted, cxl_port_attach_region() fails to find a port decoder (as would be expected), and drops into the failure / cleanup path. However, during cleanup of the region reference, a sanity check attempts to dereference the decoder, which in the above case didn't exist. This causes a NULL pointer dereference BUG. To fix this, refactor the decoder allocation and de-allocation into helper routines, and in this 'free' routine, check that the decoder, @cxld, is valid before attempting any operations on it. Cc: Suggested-by: Dan Williams Signed-off-by: Vishal Verma Reviewed-by: Dave Jiang Fixes: 384e624bb211 ("cxl/region: Attach endpoint decoders") Link: https://lore.kernel.org/r/20221101074100.1732003-1-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit 8f71a2b3f435f29b787537d1abedaa7d8ebe6647 Merge: 6eafb4a13dde4 2f3f53d623072 Author: Linus Torvalds Date: Tue Nov 1 15:11:42 2022 -0700 Merge tag 'docs-6.1-fixes' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "Four small fixes for the docs tree" * tag 'docs-6.1-fixes' of git://git.lwn.net/linux: docs/process/howto: Replace C89 with C11 Documentation: Fix spelling mistake in hacking.rst Documentation: process: replace outdated LTS table w/ link tracing/histogram: Update document for KEYS_MAX size commit 6eafb4a13dde4998bfef03e7e862eeb7f522d2fa Merge: 54917c90c2cfc d3aefd2b29ff5 Author: Linus Torvalds Date: Tue Nov 1 15:05:03 2022 -0700 Merge tag 'nfsd-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix a loop that occurs when using multiple net namespaces * tag 'nfsd-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: fix net-namespace logic in __nfsd_file_cache_purge commit d3aefd2b29ff5ffdeb5c06a7d3191a027a18cdb8 Author: Jeff Layton Date: Mon Oct 31 11:49:21 2022 -0400 nfsd: fix net-namespace logic in __nfsd_file_cache_purge If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another rhashtable_walk_next call, so it will loop infinitely. Fixes: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") Reported-by: Petr Vorel Link: https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/ Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 8ec95b94716a1e4d126edc3fb2bc426a717e2dba Author: Wang Yufen Date: Tue Nov 1 09:31:36 2022 +0800 bpf, sockmap: Fix the sk->sk_forward_alloc warning of sk_stream_kill_queues When running `test_sockmap` selftests, the following warning appears: WARNING: CPU: 2 PID: 197 at net/core/stream.c:205 sk_stream_kill_queues+0xd3/0xf0 Call Trace: inet_csk_destroy_sock+0x55/0x110 tcp_rcv_state_process+0xd28/0x1380 ? tcp_v4_do_rcv+0x77/0x2c0 tcp_v4_do_rcv+0x77/0x2c0 __release_sock+0x106/0x130 __tcp_close+0x1a7/0x4e0 tcp_close+0x20/0x70 inet_release+0x3c/0x80 __sock_release+0x3a/0xb0 sock_close+0x14/0x20 __fput+0xa3/0x260 task_work_run+0x59/0xb0 exit_to_user_mode_prepare+0x1b3/0x1c0 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x48/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root case is in commit 84472b436e76 ("bpf, sockmap: Fix more uncharged while msg has more_data"), where I used msg->sg.size to replace the tosend, causing breakage: if (msg->apply_bytes && msg->apply_bytes < tosend) tosend = psock->apply_bytes; Fixes: 84472b436e76 ("bpf, sockmap: Fix more uncharged while msg has more_data") Reported-by: Jakub Sitnicki Signed-off-by: Wang Yufen Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/1667266296-8794-1-git-send-email-wangyufen@huawei.com commit 54917c90c2cfc6cf3be6deb143cf3967b6dd8d3b Merge: f526d6a82242f b3f4f51ea68a4 Author: Linus Torvalds Date: Tue Nov 1 13:15:14 2022 -0700 Merge tag 'nolibc-urgent.2022.10.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull nolibc fixes from Paul McKenney: "This contains a couple of fixes for string-function bugs" * tag 'nolibc-urgent.2022.10.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/nolibc/string: Fix memcmp() implementation tools/nolibc: Fix missing strlen() definition and infinite loop with gcc-12 commit be0ddf5293a7895a8c9096e1a8560930c6a0ab3f Author: Mark Brown Date: Tue Nov 1 11:27:14 2022 +0000 arm64: booting: Document our requirements for fine grained traps with SME With SME we require that fine grained traps on access to TPIDR2_EL0 and SMPRI_EL1 are disabled but did not document that fact. Add the relevant register bits. Signed-off-by: Mark Brown Reviewed-by: Oliver Upton Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221101112716.52035-2-broonie@kernel.org commit f526d6a82242f7ee72d2a4448eb492622cb7d556 Merge: d79dcde0bc413 7353633814f6e Author: Linus Torvalds Date: Tue Nov 1 12:28:52 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - fix lock initialization race in gfn-to-pfn cache (+selftests) - fix two refcounting errors - emulator fixes - mask off reserved bits in CPUID - fix bug with disabling SGX RISC-V: - update MAINTAINERS" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86/xen: Fix eventfd error handling in kvm_xen_eventfd_assign() KVM: x86: smm: number of GPRs in the SMRAM image depends on the image format KVM: x86: emulator: update the emulation mode after CR0 write KVM: x86: emulator: update the emulation mode after rsm KVM: x86: emulator: introduce emulator_recalc_and_set_mode KVM: x86: emulator: em_sysexit should update ctxt->mode KVM: selftests: Mark "guest_saw_irq" as volatile in xen_shinfo_test KVM: selftests: Add tests in xen_shinfo_test to detect lock races KVM: Reject attempts to consume or refresh inactive gfn_to_pfn_cache KVM: Initialize gfn_to_pfn_cache locks in dedicated helper KVM: VMX: fully disable SGX if SECONDARY_EXEC_ENCLS_EXITING unavailable KVM: x86: Exempt pending triple fault from event injection sanity check MAINTAINERS: git://github -> https://github.com for kvm-riscv KVM: debugfs: Return retval of simple_attr_open() if it fails KVM: x86: Reduce refcount if single_open() fails in kvm_mmu_rmaps_stat_open() KVM: x86: Mask off reserved bits in CPUID.8000001FH KVM: x86: Mask off reserved bits in CPUID.8000001AH KVM: x86: Mask off reserved bits in CPUID.80000008H KVM: x86: Mask off reserved bits in CPUID.80000006H KVM: x86: Mask off reserved bits in CPUID.80000001H commit d79dcde0bc413efd35dd7eabe2d5eed34ec6deb0 Merge: 5aaef24b5c6d4 82ebbe65d7810 Author: Linus Torvalds Date: Tue Nov 1 12:21:53 2022 -0700 Merge tag 'linux-watchdog-6.1-rc4' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog fixes from Wim Van Sebroeck: - fix use after free in exar driver - spelling fix in comment * tag 'linux-watchdog-6.1-rc4' of git://www.linux-watchdog.org/linux-watchdog: drivers: watchdog: exar_wdt.c fix use after free watchdog: sp805_wdt: fix spelling typo in comment commit 92a66cbf6b30eda5719fbdfb24cd15fb341bba32 Author: Mika Westerberg Date: Tue Oct 25 09:28:00 2022 +0300 spi: intel: Use correct mask for flash and protected regions The flash and protected region mask is actually 0x7fff (30:16 and 14:0) and not 0x3fff so fix this accordingly. While there use GENMASK() instead. Cc: stable@vger.kernel.org Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20221025062800.22357-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown commit 003b786b678919e072c2b12ffa73901ef840963e Author: Kai Vehmanen Date: Tue Nov 1 13:49:13 2022 +0200 ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older Originally in commit b2ebcf42a48f ("ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines"), freeing of pipeline components at suspend was only done with recent FW as there were known limitations in older firmware versions. Tests show that if static pipelines are used, i.e. all pipelines are setup whenever firmware is powered up, the reverse action of freeing all components at power down, leads to firmware failures with also SOF2.0 and SOF2.1 based firmware. The problems can be specific to certain topologies with e.g. components not prepared to be freed at suspend (as this did not happen with older SOF kernels). To avoid hitting these problems when kernel is upgraded and used with an older firmware, bump the firmware requirement to SOF2.2 or newer. If an older firmware is used, and pipeline is a static one, do not free the components at suspend. This ensures the suspend flow remains backwards compatible with older firmware versions. This limitation does not apply if the product configuration is updated to dynamic pipelines. The limitation is not linked to firmware ABI, as the interface to free pipeline components has been available already before ABI3.19. The problem is in the implementation, so firmware version should be used to decide whether it is safe to use the newer flow or not. This patch adds a new SOF_FW_VER() macro to compare SOF firmware release versions. Link: https://github.com/thesofproject/sof/issues/6475 Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20221101114913.1292671-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 024f4b2e1f874934943eb2d3d288ebc52c79f55c Author: Mark Rutland Date: Mon Oct 17 10:01:57 2022 +0100 arm64: entry: avoid kprobe recursion The cortex_a76_erratum_1463225_debug_handler() function is called when handling debug exceptions (and synchronous exceptions from BRK instructions), and so is called when a probed function executes. If the compiler does not inline cortex_a76_erratum_1463225_debug_handler(), it can be probed. If cortex_a76_erratum_1463225_debug_handler() is probed, any debug exception or software breakpoint exception will result in recursive exceptions leading to a stack overflow. This can be triggered with the ftrace multiple_probes selftest, and as per the example splat below. This is a regression caused by commit: 6459b8469753e9fe ("arm64: entry: consolidate Cortex-A76 erratum 1463225 workaround") ... which removed the NOKPROBE_SYMBOL() annotation associated with the function. My intent was that cortex_a76_erratum_1463225_debug_handler() would be inlined into its caller, el1_dbg(), which is marked noinstr and cannot be probed. Mark cortex_a76_erratum_1463225_debug_handler() as __always_inline to ensure this. Example splat prior to this patch (with recursive entries elided): | # echo p cortex_a76_erratum_1463225_debug_handler > /sys/kernel/debug/tracing/kprobe_events | # echo p do_el0_svc >> /sys/kernel/debug/tracing/kprobe_events | # echo 1 > /sys/kernel/debug/tracing/events/kprobes/enable | Insufficient stack space to handle exception! | ESR: 0x0000000096000047 -- DABT (current EL) | FAR: 0xffff800009cefff0 | Task stack: [0xffff800009cf0000..0xffff800009cf4000] | IRQ stack: [0xffff800008000000..0xffff800008004000] | Overflow stack: [0xffff00007fbc00f0..0xffff00007fbc10f0] | CPU: 0 PID: 145 Comm: sh Not tainted 6.0.0 #2 | Hardware name: linux,dummy-virt (DT) | pstate: 604003c5 (nZCv DAIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : arm64_enter_el1_dbg+0x4/0x20 | lr : el1_dbg+0x24/0x5c | sp : ffff800009cf0000 | x29: ffff800009cf0000 x28: ffff000002c74740 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: 00000000604003c5 x22: ffff80000801745c x21: 0000aaaac95ac068 | x20: 00000000f2000004 x19: ffff800009cf0040 x18: 0000000000000000 | x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 | x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 | x11: 0000000000000010 x10: ffff800008c87190 x9 : ffff800008ca00d0 | x8 : 000000000000003c x7 : 0000000000000000 x6 : 0000000000000000 | x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000000043a4 | x2 : 00000000f2000004 x1 : 00000000f2000004 x0 : ffff800009cf0040 | Kernel panic - not syncing: kernel stack overflow | CPU: 0 PID: 145 Comm: sh Not tainted 6.0.0 #2 | Hardware name: linux,dummy-virt (DT) | Call trace: | dump_backtrace+0xe4/0x104 | show_stack+0x18/0x4c | dump_stack_lvl+0x64/0x7c | dump_stack+0x18/0x38 | panic+0x14c/0x338 | test_taint+0x0/0x2c | panic_bad_stack+0x104/0x118 | handle_bad_stack+0x34/0x48 | __bad_stack+0x78/0x7c | arm64_enter_el1_dbg+0x4/0x20 | el1h_64_sync_handler+0x40/0x98 | el1h_64_sync+0x64/0x68 | cortex_a76_erratum_1463225_debug_handler+0x0/0x34 ... | el1h_64_sync_handler+0x40/0x98 | el1h_64_sync+0x64/0x68 | cortex_a76_erratum_1463225_debug_handler+0x0/0x34 ... | el1h_64_sync_handler+0x40/0x98 | el1h_64_sync+0x64/0x68 | cortex_a76_erratum_1463225_debug_handler+0x0/0x34 | el1h_64_sync_handler+0x40/0x98 | el1h_64_sync+0x64/0x68 | do_el0_svc+0x0/0x28 | el0t_64_sync_handler+0x84/0xf0 | el0t_64_sync+0x18c/0x190 | Kernel Offset: disabled | CPU features: 0x0080,00005021,19001080 | Memory Limit: none | ---[ end Kernel panic - not syncing: kernel stack overflow ]--- With this patch, cortex_a76_erratum_1463225_debug_handler() is inlined into el1_dbg(), and el1_dbg() cannot be probed: | # echo p cortex_a76_erratum_1463225_debug_handler > /sys/kernel/debug/tracing/kprobe_events | sh: write error: No such file or directory | # grep -w cortex_a76_erratum_1463225_debug_handler /proc/kallsyms | wc -l | 0 | # echo p el1_dbg > /sys/kernel/debug/tracing/kprobe_events | sh: write error: Invalid argument | # grep -w el1_dbg /proc/kallsyms | wc -l | 1 Fixes: 6459b8469753 ("arm64: entry: consolidate Cortex-A76 erratum 1463225 workaround") Cc: # 5.12.x Signed-off-by: Mark Rutland Cc: Will Deacon Link: https://lore.kernel.org/r/20221017090157.2881408-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit a6dd6f39008bb3ef7c73ef0a2acc2a4209555bd8 Author: Dave Hansen Date: Fri Oct 28 17:12:19 2022 +0300 x86/tdx: Prepare for using "INFO" call for a second purpose The TDG.VP.INFO TDCALL provides the guest with various details about the TDX system that the guest needs to run. Only one field is currently used: 'gpa_width' which tells the guest which PTE bits mark pages shared or private. A second field is now needed: the guest "TD attributes" to tell if virtualization exceptions are configured in a way that can harm the guest. Make the naming and calling convention more generic and discrete from the mask-centric one. Thanks to Sathya for the inspiration here, but there's no code, comments or changelogs left from where he started. Signed-off-by: Dave Hansen Acked-by: Kirill A. Shutemov Tested-by: Kirill A. Shutemov Cc: stable@vger.kernel.org commit 4eb559dd15671cca355a61a4164e8f19e3952637 Merge: 9f187ba0d5170 8b972158afcaa Author: Darrick J. Wong Date: Tue Nov 1 09:52:13 2022 -0700 Merge tag 'refcount-cow-domain-6.1_2022-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.1-fixesA xfs: improve runtime refcountbt corruption detection Fuzz testing of the refcount btree demonstrated a weakness in validation of refcount btree records during normal runtime. The idea of using the upper bit of the rc_startblock field to separate the refcount records into one group for shared space and another for CoW staging extents was added at the last minute. The incore struct left this bit encoded in the upper bit of the startblock field, which makes it all too easy for arithmetic operations to overflow if we don't detect the cowflag properly. When I ran a norepair fuzz tester, I was able to crash the kernel on one of these accidental overflows by fuzzing a key record in a node block, which broke lookups. To fix the problem, make the domain (shared/cow) a separate field in the incore record. Unfortunately, a customer also hit this once in production. Due to bugs in the kernel running on the VM host, writes to the disk image would occasionally be lost. Given sufficient memory pressure on the VM guest, a refcountbt xfs_buf could be reclaimed and later reloaded from the stale copy on the virtual disk. The stale disk contents were a refcount btree leaf block full of records for the wrong domain, and this caused an infinite loop in the guest VM. v2: actually include the refcount adjust loop invariant checking patch; move the deferred refcount continuation checks earlier in the series; break up the megapatch into smaller pieces; fix an uninitialized list error. v3: in the continuation check patch, verify the per-ag extent before converting it to a fsblock Signed-off-by: Darrick J. Wong * tag 'refcount-cow-domain-6.1_2022-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: rename XFS_REFC_COW_START to _COWFLAG xfs: fix uninitialized list head in struct xfs_refcount_recovery xfs: fix agblocks check in the cow leftover recovery function xfs: check record domain when accessing refcount records xfs: remove XFS_FIND_RCEXT_SHARED and _COW xfs: refactor domain and refcount checking xfs: report refcount domain in tracepoints xfs: track cow/shared record domains explicitly in xfs_refcount_irec xfs: refactor refcount record usage in xchk_refcountbt_rec xfs: move _irec structs to xfs_types.h xfs: check deferred refcount op continuation parameters xfs: create a predicate to verify per-AG extents xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents commit 6c412da54c80a54b1a8b7f89677f6e82f0fabec4 Author: Christophe JAILLET Date: Sat Oct 29 22:57:11 2022 +0200 sfc: Fix an error handling path in efx_pci_probe() If an error occurs after the first kzalloc() the corresponding memory allocation is never freed. Add the missing kfree() in the error handling path, as already done in the remove() function. Fixes: 7e773594dada ("sfc: Separate efx_nic memory from net_device memory") Signed-off-by: Christophe JAILLET Acked-by: Martin Habets Link: https://lore.kernel.org/r/dc114193121c52c8fa3779e49bdd99d4b41344a9.1667077009.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 4151bb636acf32bb2e6126cec8216b023117c0e9 Author: Marc Zyngier Date: Tue Nov 1 12:19:51 2022 +0000 KVM: arm64: Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE The trapping of SMPRI_EL1 and TPIDR2_EL0 currently only really work on nVHE, as only this mode uses the fine-grained trapping that controls these two registers. Move the trapping enable/disable code into __{de,}activate_traps_common(), allowing it to be called when it actually matters on VHE, and remove the flipping of EL2 control for TPIDR2_EL0, which only affects the host access of this register. Fixes: 861262ab8627 ("KVM: arm64: Handle SME host state when running guests") Reported-by: Mark Brown Reviewed-by: Mark Brown Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/86bkpqer4z.wl-maz@kernel.org commit fc007fb815ab5395c3962c09b79a1630b0fbed9c Author: Nathan Huckleberry Date: Tue Sep 13 13:55:44 2022 -0700 drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid The mode_valid field in drm_connector_helper_funcs is expected to be of type: enum drm_mode_status (* mode_valid) (struct drm_connector *connector, struct drm_display_mode *mode); The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of imx_tve_connector_mode_valid should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Reviewed-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20220913205544.155106-1-nhuck@google.com commit ff52fe006fdeacee49745dabed26154db52a6343 Author: Liu Ying Date: Sun Oct 9 10:35:27 2022 +0800 drm/imx: Kconfig: Remove duplicated 'select DRM_KMS_HELPER' line A duplicated line 'select DRM_KMS_HELPER' was introduced in Kconfig file by commit 09717af7d13d ("drm: Remove CONFIG_DRM_KMS_CMA_HELPER option"), so remove it. Fixes: 09717af7d13d ("drm: Remove CONFIG_DRM_KMS_CMA_HELPER option") Signed-off-by: Liu Ying Reviewed-by: Philipp Zabel Signed-off-by: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20221009023527.3669647-1-victor.liu@nxp.com commit 42378a9ca55347102bbf86708776061d8fe3ece2 Author: Kees Cook Date: Fri Oct 28 19:54:30 2022 -0700 bpf, verifier: Fix memory leak in array reallocation for stack state If an error (NULL) is returned by krealloc(), callers of realloc_array() were setting their allocation pointers to NULL, but on error krealloc() does not touch the original allocation. This would result in a memory resource leak. Instead, free the old allocation on the error handling path. The memory leak information is as follows as also reported by Zhengchao: unreferenced object 0xffff888019801800 (size 256): comm "bpf_repo", pid 6490, jiffies 4294959200 (age 17.170s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000b211474b>] __kmalloc_node_track_caller+0x45/0xc0 [<0000000086712a0b>] krealloc+0x83/0xd0 [<00000000139aab02>] realloc_array+0x82/0xe2 [<00000000b1ca41d1>] grow_stack_state+0xfb/0x186 [<00000000cd6f36d2>] check_mem_access.cold+0x141/0x1341 [<0000000081780455>] do_check_common+0x5358/0xb350 [<0000000015f6b091>] bpf_check.cold+0xc3/0x29d [<000000002973c690>] bpf_prog_load+0x13db/0x2240 [<00000000028d1644>] __sys_bpf+0x1605/0x4ce0 [<00000000053f29bd>] __x64_sys_bpf+0x75/0xb0 [<0000000056fedaf5>] do_syscall_64+0x35/0x80 [<000000002bd58261>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: c69431aab67a ("bpf: verifier: Improve function state reallocation") Reported-by: Zhengchao Shao Reported-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Daniel Borkmann Reviewed-by: Bill Wendling Cc: Lorenz Bauer Link: https://lore.kernel.org/bpf/20221029025433.2533810-1-keescook@chromium.org commit d6643d7207c572c1b0305ed505101f15502c6c87 Author: Nam Cao Date: Thu Oct 6 16:54:40 2022 +0200 i2c: i801: add lis3lv02d's I2C address for Vostro 5568 Dell Vostro 5568 laptop has lis3lv02d, but its i2c address is not known to the kernel. Add this address. Output of "cat /sys/devices/platform/lis3lv02d/position" on Dell Vostro 5568 laptop: - Horizontal: (-18,0,1044) - Front elevated: (522,-18,1080) - Left elevated: (-18,-360,1080) - Upside down: (36,108,-1134) Signed-off-by: Nam Cao Reviewed-by: Jean Delvare Reviewed-by: Pali Rohár Signed-off-by: Wolfram Sang commit cdbf26251d3b35c4ccaea0c3a6de4318f727d3d2 Author: Thierry Reding Date: Thu Oct 20 16:39:33 2022 +0200 i2c: tegra: Allocate DMA memory for DMA engine When the I2C controllers are running in DMA mode, it is the DMA engine that performs the memory accesses rather than the I2C controller. Pass the DMA engine's struct device pointer to the DMA API to make sure the correct DMA operations are used. This fixes an issue where the DMA engine's SMMU stream ID needs to be misleadingly set for the I2C controllers in device tree. Suggested-by: Robin Murphy Signed-off-by: Thierry Reding Signed-off-by: Wolfram Sang commit 569bea74c94d37785682b11bab76f557520477cd Author: Chen Zhongjin Date: Thu Oct 27 20:13:53 2022 +0800 i2c: piix4: Fix adapter not be removed in piix4_remove() In piix4_probe(), the piix4 adapter will be registered in: piix4_probe() piix4_add_adapters_sb800() / piix4_add_adapter() i2c_add_adapter() Based on the probed device type, piix4_add_adapters_sb800() or single piix4_add_adapter() will be called. For the former case, piix4_adapter_count is set as the number of adapters, while for antoher case it is not set and kept default *zero*. When piix4 is removed, piix4_remove() removes the adapters added in piix4_probe(), basing on the piix4_adapter_count value. Because the count is zero for the single adapter case, the adapter won't be removed and makes the sources allocated for adapter leaked, such as the i2c client and device. These sources can still be accessed by i2c or bus and cause problems. An easily reproduced case is that if a new adapter is registered, i2c will get the leaked adapter and try to call smbus_algorithm, which was already freed: Triggered by: rmmod i2c_piix4 && modprobe max31730 BUG: unable to handle page fault for address: ffffffffc053d860 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page Oops: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3752 Comm: modprobe Tainted: G Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:i2c_default_probe (drivers/i2c/i2c-core-base.c:2259) i2c_core RSP: 0018:ffff888107477710 EFLAGS: 00000246 ... i2c_detect (drivers/i2c/i2c-core-base.c:2302) i2c_core __process_new_driver (drivers/i2c/i2c-core-base.c:1336) i2c_core bus_for_each_dev (drivers/base/bus.c:301) i2c_for_each_dev (drivers/i2c/i2c-core-base.c:1823) i2c_core i2c_register_driver (drivers/i2c/i2c-core-base.c:1861) i2c_core do_one_initcall (init/main.c:1296) do_init_module (kernel/module/main.c:2455) ... ---[ end trace 0000000000000000 ]--- Fix this problem by correctly set piix4_adapter_count as 1 for the single adapter so it can be normally removed. Fixes: 528d53a1592b ("i2c: piix4: Fix probing of reserved ports on AMD Family 16h Model 30h") Signed-off-by: Chen Zhongjin Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit c4a7b9b587ca1bb4678d48d8be7132492b23a81c Author: Cristian Marussi Date: Fri Oct 28 15:08:33 2022 +0100 arm64: dts: juno: Add thermal critical trip points When thermnal zones are defined, trip points definitions are mandatory. Define a couple of critical trip points for monitoring of existing PMIC and SOC thermal zones. This was lost between txt to yaml conversion and was re-enforced recently via the commit 8c596324232d ("dt-bindings: thermal: Fix missing required property") Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org Signed-off-by: Cristian Marussi Fixes: f7b636a8d83c ("arm64: dts: juno: add thermal zones for scpi sensors") Link: https://lore.kernel.org/r/20221028140833.280091-8-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 1eff6929aff594fba3182660f7b6213ec0ceda0c Author: Cristian Marussi Date: Fri Oct 28 15:08:31 2022 +0100 firmware: arm_scmi: Fix deferred_tx_wq release on error paths Use devres to allocate the dedicated deferred_tx_wq polling workqueue so as to automatically trigger the proper resource release on error path. Reported-by: Dan Carpenter Fixes: 5a3b7185c47c ("firmware: arm_scmi: Add atomic mode support to virtio transport") Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-6-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 5ffc1c4cb896f8d2cf10309422da3633a616d60f Author: Cristian Marussi Date: Fri Oct 28 15:08:30 2022 +0100 firmware: arm_scmi: Fix devres allocation device in virtio transport SCMI virtio transport device managed allocations must use the main platform device in devres operations instead of the channel devices. Cc: Peter Hilber Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport") Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-5-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit be9ba1f7f9e0b565b19f4294f5871da9d654bc6d Author: Cristian Marussi Date: Fri Oct 28 15:08:29 2022 +0100 firmware: arm_scmi: Make Rx chan_setup fail on memory errors SCMI Rx channels are optional and they can fail to be setup when not present but anyway channels setup routines must bail-out on memory errors. Make channels setup, and related probing, fail when memory errors are reported on Rx channels. Fixes: 5c8a47a5a91d ("firmware: arm_scmi: Make scmi core independent of the transport type") Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-4-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 59172b212ec0dbb97ceb5671d912e6e61fa802d5 Author: Cristian Marussi Date: Fri Oct 28 15:08:28 2022 +0100 firmware: arm_scmi: Make tx_prepare time out eventually SCMI transports based on shared memory, at start of transmissions, have to wait for the shared Tx channel area to be eventually freed by the SCMI platform before accessing the channel. In fact the channel is owned by the SCMI platform until marked as free by the platform itself and, as such, cannot be used by the agent until relinquished. As a consequence a badly misbehaving SCMI platform firmware could lock the channel indefinitely and make the kernel side SCMI stack loop forever waiting for such channel to be freed, possibly hanging the whole boot sequence. Add a timeout to the existent Tx waiting spin-loop so that, when the system ends up in this situation, the SCMI stack can at least bail-out, nosily warn the user, and abort the transmission. Reported-by: YaxiongTian Suggested-by: YaxiongTian Cc: Vincent Guittot Cc: Etienne Carriere Cc: Florian Fainelli Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-3-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit fd96fbc8fad35d6b1872c90df8a2f5d721f14d91 Author: Cristian Marussi Date: Fri Oct 28 15:08:27 2022 +0100 firmware: arm_scmi: Suppress the driver's bind attributes Suppress the capability to unbind the core SCMI driver since all the SCMI stack protocol drivers depend on it. Fixes: aa4f886f3893 ("firmware: arm_scmi: add basic driver infrastructure for SCMI") Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-2-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 3f4071cbd2063b917486d1047a4da47718215fee Author: Cristian Marussi Date: Fri Oct 28 15:08:26 2022 +0100 firmware: arm_scmi: Cleanup the core driver removal callback Platform drivers .remove callbacks are not supposed to fail and report errors. Such errors are indeed ignored by the core platform drivers and the driver unbind process is anyway completed. The SCMI core platform driver as it is now, instead, bails out reporting an error in case of an explicit unbind request. Fix the removal path by adding proper device links between the core SCMI device and the SCMI protocol devices so that a full SCMI stack unbind is triggered when the core driver is removed. The remove process does not bail out anymore on the anomalous conditions triggered by an explicit unbind but the user is still warned. Reported-by: Uwe Kleine-König Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20221028140833.280091-1-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit a0e215088ef4955f442af58822da5d2bcc3fbbe7 Author: Jay Fang Date: Fri Oct 28 18:54:34 2022 +0800 MAINTAINERS: Update HiSilicon LPC BUS Driver maintainer Add Jay Fang as the maintainer of the HiSilicon LPC BUS Driver, replacing John Garry. Signed-off-by: Jay Fang Link: https://lore.kernel.org/r/20221028105434.1661264-1-f.fangjian@huawei.com' Signed-off-by: Arnd Bergmann commit cd73adcdbad3d9e9923b045d3643409e9c148d17 Author: Linus Walleij Date: Sun Oct 30 22:08:54 2022 +0100 ARM: dts: ux500: Add trips to battery thermal zones Recent changes to the thermal framework has made the trip points (trips) for thermal zones compulsory, which made the Ux500 DTS files break validation and also stopped probing because of similar changes to the code. Fix this by adding an "outer bounding box": battery thermal zones should not get warmer than 70 degress, then we will shut down. Fixes: 8c596324232d ("dt-bindings: thermal: Fix missing required property") Fixes: 3fd6d6e2b4e8 ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Linus Walleij Cc: Daniel Lezcano Cc: linux-pm@vger.kernel.org Link: https://lore.kernel.org/r/20221030210854.346662-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit c872f6ce2212eeaae08134f08ae29d50a3b2dcf4 Merge: 2a5dc663e34ea d5c921a53c80d Author: Arnd Bergmann Date: Tue Nov 1 12:20:26 2022 +0100 Merge tag 'imx-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.1: - Fix imx93-pd driver to release resources when error occurs in probe. - A series from Ioana Ciornei to add missing clock frequencies for MDIO controllers on LayerScape SoCs, so that the kernel driver can work independently from bootloader. - A series from Li Jun to fix USB power domain setup in i.MX8MM/N device trees. - Fix CPLD_Dn pull configuration for MX8Menlo board to avoid interfering with CPLD power off functionality. - Fix ctrl_sleep_moci GPIO setup for verdin-imx8mp board. - Fix DT schema check warnings on uSDHC clocks for imx8-ss-conn device tree. - Fix up gpcv2 DT bindings to have an optional `power-domains` property. - A couple of i.MX93 device tree fixes on S4MU interrupt and gpio-ranges of GPIO controllers. - Keep PU regulator on for Quad and QuadPlus based imx6dl-yapp4 boards to work around a hardware design flaw in supply voltage distribution. - Fix user push-button GPIO offset on imx6qdl-gw59 boards. * tag 'imx-fixes-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: ls208xa: specify clock frequencies for the MDIO controllers arm64: dts: ls1088a: specify clock frequencies for the MDIO controllers arm64: dts: lx2160a: specify clock frequencies for the MDIO controllers soc: imx: imx93-pd: Fix the error handling path of imx93_pd_probe() arm64: dts: imx93: correct gpio-ranges arm64: dts: imx93: correct s4mu interrupt names dt-bindings: power: gpcv2: add power-domains property arm64: dts: imx8: correct clock order ARM: dts: imx6dl-yapp4: Do not allow PM to switch PU regulator off on Q/QP ARM: dts: imx6qdl-gw59{10,13}: fix user pushbutton GPIO offset arm64: dts: imx8mn: Correct the usb power domain arm64: dts: imx8mn: remove otg1 power domain dependency on hsio arm64: dts: imx8mm: correct usb power domains arm64: dts: imx8mm: remove otg1/2 power domain dependency on hsio arm64: dts: verdin-imx8mp: fix ctrl_sleep_moci arm64: dts: imx8mm: Enable CPLD_Dn pull down resistor on MX8Menlo Link: https://lore.kernel.org/r/20221101031547.GB125525@dragon Signed-off-by: Arnd Bergmann commit 26b5934ff4194e13196bedcba373cd4915071d0e Author: Pablo Neira Ayuso Date: Wed Oct 26 09:54:45 2022 +0200 netfilter: nf_tables: release flow rule object from commit path No need to postpone this to the commit release path, since no packets are walking over this object, this is accessed from control plane only. This helped uncovered UAF triggered by races with the netlink notifier. Fixes: 9dd732e0bdf5 ("netfilter: nf_tables: memleak flow rule from commit path") Reported-by: syzbot+8f747f62763bc6c32916@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit d4bc8271db21ea9f1c86a1ca4d64999f184d4aae Author: Pablo Neira Ayuso Date: Wed Oct 26 09:52:36 2022 +0200 netfilter: nf_tables: netlink notifier might race to release objects commit release path is invoked via call_rcu and it runs lockless to release the objects after rcu grace period. The netlink notifier handler might win race to remove objects that the transaction context is still referencing from the commit release path. Call rcu_barrier() to ensure pending rcu callbacks run to completion if the list of transactions to be destroyed is not empty. Fixes: 6001a930ce03 ("netfilter: nftables: introduce table ownership") Reported-by: syzbot+8f747f62763bc6c32916@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit 6788ba8aed4e28e90f72d68a9d794e34eac17295 Author: Dokyung Song Date: Fri Oct 21 15:13:59 2022 +0900 wifi: brcmfmac: Fix potential buffer overflow in brcmf_fweh_event_worker() This patch fixes an intra-object buffer overflow in brcmfmac that occurs when the device provides a 'bsscfgidx' equal to or greater than the buffer size. The patch adds a check that leads to a safe failure if that is the case. This fixes CVE-2022-3628. UBSAN: array-index-out-of-bounds in drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c index 52 is out of range for type 'brcmf_if *[16]' CPU: 0 PID: 1898 Comm: kworker/0:2 Tainted: G O 5.14.0+ #132 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Workqueue: events brcmf_fweh_event_worker Call Trace: dump_stack_lvl+0x57/0x7d ubsan_epilogue+0x5/0x40 __ubsan_handle_out_of_bounds+0x69/0x80 ? memcpy+0x39/0x60 brcmf_fweh_event_worker+0xae1/0xc00 ? brcmf_fweh_call_event_handler.isra.0+0x100/0x100 ? rcu_read_lock_sched_held+0xa1/0xd0 ? rcu_read_lock_bh_held+0xb0/0xb0 ? lockdep_hardirqs_on_prepare+0x273/0x3e0 process_one_work+0x873/0x13e0 ? lock_release+0x640/0x640 ? pwq_dec_nr_in_flight+0x320/0x320 ? rwlock_bug.part.0+0x90/0x90 worker_thread+0x8b/0xd10 ? __kthread_parkme+0xd9/0x1d0 ? process_one_work+0x13e0/0x13e0 kthread+0x379/0x450 ? _raw_spin_unlock_irq+0x24/0x30 ? set_kthread_struct+0x100/0x100 ret_from_fork+0x1f/0x30 ================================================================================ general protection fault, probably for non-canonical address 0xe5601c0020023fff: 0000 [#1] SMP KASAN KASAN: maybe wild-memory-access in range [0x2b0100010011fff8-0x2b0100010011ffff] CPU: 0 PID: 1898 Comm: kworker/0:2 Tainted: G O 5.14.0+ #132 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 Workqueue: events brcmf_fweh_event_worker RIP: 0010:brcmf_fweh_call_event_handler.isra.0+0x42/0x100 Code: 89 f5 53 48 89 fb 48 83 ec 08 e8 79 0b 38 fe 48 85 ed 74 7e e8 6f 0b 38 fe 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 8b 00 00 00 4c 8b 7d 00 44 89 e0 48 ba 00 00 00 RSP: 0018:ffffc9000259fbd8 EFLAGS: 00010207 RAX: dffffc0000000000 RBX: ffff888115d8cd50 RCX: 0000000000000000 RDX: 0560200020023fff RSI: ffffffff8304bc91 RDI: ffff888115d8cd50 RBP: 2b0100010011ffff R08: ffff888112340050 R09: ffffed1023549809 R10: ffff88811aa4c047 R11: ffffed1023549808 R12: 0000000000000045 R13: ffffc9000259fca0 R14: ffff888112340050 R15: ffff888112340000 FS: 0000000000000000(0000) GS:ffff88811aa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000004053ccc0 CR3: 0000000112740000 CR4: 0000000000750ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: brcmf_fweh_event_worker+0x117/0xc00 ? brcmf_fweh_call_event_handler.isra.0+0x100/0x100 ? rcu_read_lock_sched_held+0xa1/0xd0 ? rcu_read_lock_bh_held+0xb0/0xb0 ? lockdep_hardirqs_on_prepare+0x273/0x3e0 process_one_work+0x873/0x13e0 ? lock_release+0x640/0x640 ? pwq_dec_nr_in_flight+0x320/0x320 ? rwlock_bug.part.0+0x90/0x90 worker_thread+0x8b/0xd10 ? __kthread_parkme+0xd9/0x1d0 ? process_one_work+0x13e0/0x13e0 kthread+0x379/0x450 ? _raw_spin_unlock_irq+0x24/0x30 ? set_kthread_struct+0x100/0x100 ret_from_fork+0x1f/0x30 Modules linked in: 88XXau(O) 88x2bu(O) ---[ end trace 41d302138f3ff55a ]--- RIP: 0010:brcmf_fweh_call_event_handler.isra.0+0x42/0x100 Code: 89 f5 53 48 89 fb 48 83 ec 08 e8 79 0b 38 fe 48 85 ed 74 7e e8 6f 0b 38 fe 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 8b 00 00 00 4c 8b 7d 00 44 89 e0 48 ba 00 00 00 RSP: 0018:ffffc9000259fbd8 EFLAGS: 00010207 RAX: dffffc0000000000 RBX: ffff888115d8cd50 RCX: 0000000000000000 RDX: 0560200020023fff RSI: ffffffff8304bc91 RDI: ffff888115d8cd50 RBP: 2b0100010011ffff R08: ffff888112340050 R09: ffffed1023549809 R10: ffff88811aa4c047 R11: ffffed1023549808 R12: 0000000000000045 R13: ffffc9000259fca0 R14: ffff888112340050 R15: ffff888112340000 FS: 0000000000000000(0000) GS:ffff88811aa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000004053ccc0 CR3: 0000000112740000 CR4: 0000000000750ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Reported-by: Dokyung Song Reported-by: Jisoo Jang Reported-by: Minsuk Kang Reviewed-by: Arend van Spriel Cc: Signed-off-by: Dokyung Song Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221021061359.GA550858@laguna commit 5d73263f9e7c54ccb20814dc50809b9deb9e2bc7 Author: Pierre-Louis Bossart Date: Mon Oct 31 15:56:39 2022 -0400 ASoC: hda: intel-dsp-config: add ES83x6 quirk for IceLake Yet another hardware variant we need to handle. Link: https://github.com/thesofproject/linux/issues/3873 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20221031195639.250062-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 10e794bdba2734bad0d61864e7e526b13b75aa6b Author: Pierre-Louis Bossart Date: Mon Oct 31 15:55:05 2022 -0400 ALSA: hda: clarify comments on SCF changes The commit 1f9d3d98694b1 ("ALSA: hda - set intel audio clock to a proper value") added a number of misleading comments. There is no ability to detect if an SCF value was set or not, what the code does is prevent the use of the 6MHz audio clock represented by the value 0 in LCTL.SCF. Changing the SCF settings does require the link to be power-cycled, but in all other cases the link is powered automatically when exiting reset. In other words, the power-cycle is an exception to the rule that the HDaudio legacy driver does not need to program SPA/CPA bits. In addition, the SCF related changes are only relevant for the first link. No functionality change, only comment clarifications. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20221031195505.249929-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit cef8cdc0d0e7c701fe4dcfba4ed3fd25d28a6020 Author: Claudiu Beznea Date: Wed Oct 26 15:41:04 2022 +0300 ARM: at91: pm: avoid soft resetting AC DLL Do not soft reset AC DLL as controller is buggy and this operation my introduce glitches in the controller leading to undefined behavior. Fixes: f0bbf17958e8 ("ARM: at91: pm: add self-refresh support for sama7g5") Depends-on: a02875c4cbd6 ("ARM: at91: pm: fix self-refresh for sama7g5") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221026124114.985876-2-claudiu.beznea@microchip.com commit e6cb8769452e8236b52134e5cb4a18b8f5986932 Author: Jason A. Donenfeld Date: Mon Oct 24 18:28:43 2022 +0200 wifi: airo: do not assign -1 to unsigned char With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, we get a warning when assigning the unchecked output of hex_to_bin() to that unsigned char. Mark `key` as a `u8`, which matches the struct's type, and then check each call to hex_to_bin() before casting. Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Signed-off-by: Jason A. Donenfeld Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221024162843.535921-1-Jason@zx2c4.com commit 7c919b619bcc68158921b1bd968f0e704549bbb6 Author: Matti Vaittinen Date: Fri Oct 14 10:15:19 2022 +0300 tools: iio: iio_generic_buffer: Fix read size When noevents is true and small buffer is used the allocated memory for holding the data may be smaller than the hard-coded 64 bytes. This can cause the iio_generic_buffer to crash. Following was recorded on beagle bone black with v6.0 kernel and the digit fix patch: https://lore.kernel.org/all/Y0f+tKCz+ZAIoroQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi/ using valgrind; ==339== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info ==339== Command: /iio_generic_buffer -n kx022-accel -T0 -e -l 10 -a -w 2000000 ==339== Parent PID: 307 ==339== ==339== Syscall param read(buf) points to unaddressable byte(s) ==339== at 0x496BFA4: read (read.c:26) ==339== by 0x11699: main (iio_generic_buffer.c:724) ==339== Address 0x4ab3518 is 0 bytes after a block of size 160 alloc'd ==339== at 0x4864B70: malloc (vg_replace_malloc.c:381) ==339== by 0x115BB: main (iio_generic_buffer.c:677) Fix this by always using the same size for reading as was used for data storage allocation. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/Y0kMh0t5qUXJw3nQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi Signed-off-by: Jonathan Cameron commit dd4753f88f242f46d0d8726f5936f64e754a47f2 Author: Dan Carpenter Date: Fri Oct 14 12:39:52 2022 +0300 iio: imu: bno055: uninitialized variable bug in bno055_trigger_handler() This bug is basically harmless, although it will trigger a runtime warning if you use KMSan. On the first iteration through the loop, the "best_delta" variable is uninitialized so re-order the condition to prevent reading uninitialized memory. Fixes: 4aefe1c2bd0c ("iio: imu: add Bosch Sensortec BNO055 core driver") Signed-off-by: Dan Carpenter Acked-by: Nuno Sá Link: https://lore.kernel.org/r/Y0kuaO9PQkSQja+A@kili Signed-off-by: Jonathan Cameron commit 65f20301607d07ee279b0804d11a05a62a6c1a1c Author: Yang Yingliang Date: Mon Oct 24 16:45:11 2022 +0800 iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() If iio_trigger_register() returns error, it should call iio_trigger_free() to give up the reference that hold in iio_trigger_alloc(), so that it can call iio_trig_release() to free memory when the refcount hit to 0. Fixes: 0e589d5fb317 ("ARM: AT91: IIO: Add AT91 ADC driver.") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221024084511.815096-1-yangyingliang@huawei.com Cc: Signed-off-by: Jonathan Cameron commit ca1547ab15f48dc81624183ae17a2fd1bad06dfc Author: Saravanan Sekar Date: Sat Oct 29 11:29:55 2022 +0200 iio: adc: mp2629: fix potential array out of bound access Add sentinel at end of maps to avoid potential array out of bound access in iio core. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar Link: https://lore.kernel.org/r/20221029093000.45451-4-sravanhome@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 02a771c9a68a9f08cce4ec5e324fb1bc4dce7202 Author: Michael Ellerman Date: Tue Nov 1 14:48:52 2022 +1100 powerpc/32: Select ARCH_SPLIT_ARG64 On 32-bit kernels, 64-bit syscall arguments are split into two registers. For that to work with syscall wrappers, the prototype of the syscall must have the argument split so that the wrapper macro properly unpacks the arguments from pt_regs. The fanotify_mark() syscall is one such syscall, which already has a split prototype, guarded behind ARCH_SPLIT_ARG64. So select ARCH_SPLIT_ARG64 to get that prototype and fix fanotify_mark() on 32-bit kernels with syscall wrappers. Note also that fanotify_mark() is the only usage of ARCH_SPLIT_ARG64. Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221101034852.2340319-1-mpe@ellerman.id.au commit 363a5328f4b0517e59572118ccfb7c626d81dca9 Author: Ziyang Xuan Date: Sat Oct 29 17:41:01 2022 +0800 net: tun: fix bugs for oversize packet when napi frags enabled Recently, we got two syzkaller problems because of oversize packet when napi frags enabled. One of the problems is because the first seg size of the iov_iter from user space is very big, it is 2147479538 which is bigger than the threshold value for bail out early in __alloc_pages(). And skb->pfmemalloc is true, __kmalloc_reserve() would use pfmemalloc reserves without __GFP_NOWARN flag. Thus we got a warning as following: ======================================================== WARNING: CPU: 1 PID: 17965 at mm/page_alloc.c:5295 __alloc_pages+0x1308/0x16c4 mm/page_alloc.c:5295 ... Call trace: __alloc_pages+0x1308/0x16c4 mm/page_alloc.c:5295 __alloc_pages_node include/linux/gfp.h:550 [inline] alloc_pages_node include/linux/gfp.h:564 [inline] kmalloc_large_node+0x94/0x350 mm/slub.c:4038 __kmalloc_node_track_caller+0x620/0x8e4 mm/slub.c:4545 __kmalloc_reserve.constprop.0+0x1e4/0x2b0 net/core/skbuff.c:151 pskb_expand_head+0x130/0x8b0 net/core/skbuff.c:1654 __skb_grow include/linux/skbuff.h:2779 [inline] tun_napi_alloc_frags+0x144/0x610 drivers/net/tun.c:1477 tun_get_user+0x31c/0x2010 drivers/net/tun.c:1835 tun_chr_write_iter+0x98/0x100 drivers/net/tun.c:2036 The other problem is because odd IPv6 packets without NEXTHDR_NONE extension header and have big packet length, it is 2127925 which is bigger than ETH_MAX_MTU(65535). After ipv6_gso_pull_exthdrs() in ipv6_gro_receive(), network_header offset and transport_header offset are all bigger than U16_MAX. That would trigger skb->network_header and skb->transport_header overflow error, because they are all '__u16' type. Eventually, it would affect the value for __skb_push(skb, value), and make it be a big value. After __skb_push() in ipv6_gro_receive(), skb->data would less than skb->head, an out of bounds memory bug occurred. That would trigger the problem as following: ================================================================== BUG: KASAN: use-after-free in eth_type_trans+0x100/0x260 ... Call trace: dump_backtrace+0xd8/0x130 show_stack+0x1c/0x50 dump_stack_lvl+0x64/0x7c print_address_description.constprop.0+0xbc/0x2e8 print_report+0x100/0x1e4 kasan_report+0x80/0x120 __asan_load8+0x78/0xa0 eth_type_trans+0x100/0x260 napi_gro_frags+0x164/0x550 tun_get_user+0xda4/0x1270 tun_chr_write_iter+0x74/0x130 do_iter_readv_writev+0x130/0x1ec do_iter_write+0xbc/0x1e0 vfs_writev+0x13c/0x26c To fix the problems, restrict the packet size less than (ETH_MAX_MTU - NET_SKB_PAD - NET_IP_ALIGN) which has considered reserved skb space in napi_alloc_skb() because transport_header is an offset from skb->head. Add len check in tun_napi_alloc_frags() simply. Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Ziyang Xuan Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20221029094101.1653855-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit e230d36f7d4cf1b89614e2bb4c2f0c55a16d3259 Author: Rick Lindsley Date: Fri Oct 28 13:35:11 2022 -0700 ibmvnic: change maintainers for vnic driver Changed maintainers for vnic driver, since Dany has new responsibilities. Also added Nick Child as reviewer. Signed-off-by: Rick Lindsley Link: https://lore.kernel.org/r/20221028203509.4070154-1-ricklind@us.ibm.com Signed-off-by: Jakub Kicinski commit 878eb6e48f240d02ed1c9298020a0b6370695f24 Author: Al Viro Date: Tue Nov 1 00:54:13 2022 +0000 block: blk_add_rq_to_plug(): clear stale 'last' after flush blk_mq_flush_plug_list() empties ->mq_list and request we'd peeked there before that call is gone; in any case, we are not dealing with a mix of requests for different queues now - there's no requests left in the plug. Signed-off-by: Al Viro Signed-off-by: Jens Axboe commit 767e684367e4759d9855b184045b7a9d6b19acd2 Author: Linus Walleij Date: Sun Oct 30 21:55:54 2022 +0100 power: supply: ab8500: Defer thermal zone probe The call thermal_zone_get_zone_by_name() used to return the thermal zone right away, but recent refactorings in the thermal core has changed this so the thermal zone used by the battery is probed later, and the call returns -ENODEV. This was always quite fragile. If we get -ENODEV, then return a -EPROBE_DEFER and try again later. Cc: phone-devel@vger.kernel.org Fixes: 2b0e7ac0841b ("power: supply: ab8500: Integrate thermal zone") Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit ce883a2ba310cd7c291bb66ce5d207965fca6003 Author: Andreas Schwab Date: Mon Oct 31 15:47:35 2022 +0100 powerpc/32: fix syscall wrappers with 64-bit arguments With the introduction of syscall wrappers all wrappers for syscalls with 64-bit arguments must be handled specially, not only those that have unaligned 64-bit arguments. This left out the fallocate() and sync_file_range2() syscalls. Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper") Fixes: e23750623835 ("powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs") Signed-off-by: Andreas Schwab Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/87mt9cxd6g.fsf_-_@igel.home commit 40ff21432883216aa440b6619d559ad8f7d7a7d9 Author: Andreas Schwab Date: Mon Oct 31 14:23:13 2022 +0100 asm-generic: compat: fix compat_arg_u64() and compat_arg_u64_dual() The macros are defined backwards. This affects the following compat syscalls: - compat_sys_truncate64() - compat_sys_ftruncate64() - compat_sys_fallocate() - compat_sys_sync_file_range() - compat_sys_fadvise64_64() - compat_sys_readahead() - compat_sys_pread64() - compat_sys_pwrite64() Fixes: 43d5de2b67d7 ("asm-generic: compat: Support BE for long long args in 32-bit ABIs") Signed-off-by: Andreas Schwab [mpe: Add list of affected syscalls] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/871qqoyvni.fsf_-_@igel.home commit f9be5cb6c1f0191f8bcf4413b7e17e58e8dfaaa1 Author: Ondrej Jirman Date: Sat Oct 29 00:40:52 2022 +0200 power: supply: ip5xxx: Fix integer overflow in current_now calculation When current is larger than ~2A, the multiplication in current_now property overflows and the kernel reports invalid negative current value. Change the numerator and denominator while preserving their ratio to allow up to +-6A before the overflow. Fixes: 75853406fa27 ("power: supply: Add a driver for Injoinic power bank ICs") Signed-off-by: Ondrej Jirman Reviewed-by: Samuel Holland [use 149197/200 instead of 261095/350 as suggested by Samuel] Signed-off-by: Sebastian Reichel commit 9a1d248bb4beaf1b43d17ba12481ee0629fa29b9 Author: Pierre-Louis Bossart Date: Mon Oct 31 15:58:36 2022 -0400 ASoC: Intel: soc-acpi: add ES83x6 support to IceLake Missing entry to find a machine driver for ES83x6-based platforms. Link: https://github.com/thesofproject/linux/issues/3873 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20221031195836.250193-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7ee47dcfff1835ff75a794d1075b6b5f5462cfed Author: Jann Horn Date: Mon Oct 31 18:52:56 2022 +0100 fs: use acquire ordering in __fget_light() We must prevent the CPU from reordering the files->count read with the FD table access like this, on architectures where read-read reordering is possible: files_lookup_fd_raw() close_fd() put_files_struct() atomic_read(&files->count) I would like to mark this for stable, but the stable rules explicitly say "no theoretical races", and given that the FD table pointer and files->count are explicitly stored in the same cacheline, this sort of reordering seems quite unlikely in practice... Signed-off-by: Jann Horn Signed-off-by: Al Viro commit 5aaef24b5c6d4246b2cac1be949869fa36577737 Merge: 78a089d033bf7 76a66ba101329 Author: Linus Torvalds Date: Mon Oct 31 12:28:29 2022 -0700 Merge tag 'for-6.1-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few more fixes and regression fixes: - fix a corner case when handling tree-mod-log chagnes in reallocated notes - fix crash on raid0 filesystems created with <5.4 mkfs.btrfs that could lead to division by zero - add missing super block checksum verification after thawing filesystem - handle one more case in send when dealing with orphan files - fix parameter type mismatch for generation when reading dentry - improved error handling in raid56 code - better struct bio packing after recent cleanups" * tag 'for-6.1-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: don't use btrfs_chunk::sub_stripes from disk btrfs: fix type of parameter generation in btrfs_get_dentry btrfs: send: fix send failure of a subcase of orphan inodes btrfs: make thaw time super block check to also verify checksum btrfs: fix tree mod log mishandling of reallocated nodes btrfs: reorder btrfs_bio for better packing btrfs: raid56: avoid double freeing for rbio if full_stripe_write() failed btrfs: raid56: properly handle the error when unable to find the missing stripe commit 78a089d033bf71d68d978ac4cc73070f3e71c736 Merge: 30a0b95b1335e 8cf0a1bc12870 Author: Linus Torvalds Date: Mon Oct 31 12:09:42 2022 -0700 Merge tag 'lsm-pr-20221031' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull LSM fix from Paul Moore: "A single patch to the capabilities code to fix a potential memory leak in the xattr allocation error handling" * tag 'lsm-pr-20221031' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: capabilities: fix potential memleak on error path from vfs_getxattr_alloc() commit 7a2726ec3290c52f52ce8d5f5af73ab8c7681bc1 Author: Gavin Shan Date: Mon Oct 31 08:36:15 2022 +0800 KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them There are two capabilities related to ring-based dirty page tracking: KVM_CAP_DIRTY_LOG_RING and KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Both are supported by x86. However, arm64 supports KVM_CAP_DIRTY_LOG_RING_ACQ_REL only when the feature is supported on arm64. The userspace doesn't have to enable the advertised capability, meaning KVM_CAP_DIRTY_LOG_RING can be enabled on arm64 by userspace and it's wrong. Fix it by double checking if the capability has been advertised prior to enabling it. It's rejected to enable the capability if it hasn't been advertised. Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option") Reported-by: Sean Christopherson Suggested-by: Sean Christopherson Signed-off-by: Gavin Shan Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221031003621.164306-4-gshan@redhat.com commit 9f187ba0d5170b242561133724188142b62dc34c Merge: 47ba8cc7b4f82 950f0d50ee713 Author: Darrick J. Wong Date: Mon Oct 31 09:15:37 2022 -0700 Merge tag 'fix-log-recovery-misuse-6.1_2022-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.1-fixes xfs: fix various problems with log intent item recovery Starting with 6.1-rc1, CONFIG_FORTIFY_SOURCE checks became smart enough to detect memcpy() callers that copy beyond what seems to be the end of a struct. Unfortunately, gcc has a bug wherein it cannot reliably compute the size of a struct containing another struct containing a flex array at the end. This is the case with the xfs log item format structures, which means that -rc1 starts complaining all over the place. Fix these problems by memcpying the struct head and the flex arrays separately. Although it's tempting to use the FLEX_ARRAY macros, the structs involved are part of the ondisk log format. Some day we're going to want to make the ondisk log contents endian-safe, which means that we will have to stop using memcpy entirely. While we're at it, fix some deficiencies in the validation of recovered log intent items -- if the size of the recovery buffer is not even large enough to cover the flex array record count in the head, we should abort the recovery of that item immediately. The last patch of this series changes the EFI/EFD sizeof functions names and behaviors to be consistent with the similarly named sizeof helpers for other log intent items. v2: fix more inadequate log intent done recovery validation and dump corrupt recovered items Signed-off-by: Darrick J. Wong * tag 'fix-log-recovery-misuse-6.1_2022-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: dump corrupt recovered log intent items to dmesg consistently xfs: actually abort log recovery on corrupt intent-done log items xfs: refactor all the EFI/EFD log item sizeof logic xfs: fix memcpy fortify errors in EFI log format copying xfs: fix memcpy fortify errors in RUI log format copying xfs: fix memcpy fortify errors in CUI log format copying xfs: fix memcpy fortify errors in BUI log format copying xfs: fix validation in attr log item recovery commit 8b972158afcaa66c538c3ee1d394f096fcd238a8 Author: Darrick J. Wong Date: Mon Oct 10 11:13:20 2022 -0700 xfs: rename XFS_REFC_COW_START to _COWFLAG We've been (ab)using XFS_REFC_COW_START as both an integer quantity and a bit flag, even though it's *only* a bit flag. Rename the variable to reflect its nature and update the cast target since we're not supposed to be comparing it to xfs_agblock_t now. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit c1ccf967bf962b998f0c096e06a658ece27d10a0 Author: Darrick J. Wong Date: Wed Oct 26 14:55:04 2022 -0700 xfs: fix uninitialized list head in struct xfs_refcount_recovery We're supposed to initialize the list head of an object before adding it to another list. Fix that, and stop using the kmem_{alloc,free} calls from the Irix days. Fixes: 174edb0e46e5 ("xfs: store in-progress CoW allocations in the refcount btree") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f1fdc8207840672a46f26414f2c989ec078a153b Author: Darrick J. Wong Date: Thu Oct 27 09:48:59 2022 -0700 xfs: fix agblocks check in the cow leftover recovery function As we've seen, refcount records use the upper bit of the rc_startblock field to ensure that all the refcount records are at the right side of the refcount btree. This works because an AG is never allowed to have more than (1U << 31) blocks in it. If we ever encounter a filesystem claiming to have that many blocks, we absolutely do not want reflink touching it at all. However, this test at the start of xfs_refcount_recover_cow_leftovers is slightly incorrect -- it /should/ be checking that agblocks isn't larger than the XFS_MAX_CRC_AG_BLOCKS constant, and it should check that the constant is never large enough to conflict with that CoW flag. Note that the V5 superblock verifier has not historically rejected filesystems where agblocks >= XFS_MAX_CRC_AG_BLOCKS, which is why this ended up in the COW recovery routine. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f62ac3e0ac33d366fe81e194fee81de9be2cd886 Author: Darrick J. Wong Date: Wed Oct 26 14:16:36 2022 -0700 xfs: check record domain when accessing refcount records Now that we've separated the startblock and CoW/shared extent domain in the incore refcount record structure, check the domain whenever we retrieve a record to ensure that it's still in the domain that we want. Depending on the circumstances, a change in domain either means we're done processing or that we've found a corruption and need to fail out. The refcount check in xchk_xref_is_cow_staging is redundant since _get_rec has done that for a long time now, so we can get rid of it. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 68d0f389179a52555cfd8fa3254e4adcd7576904 Author: Darrick J. Wong Date: Wed Oct 26 14:42:48 2022 -0700 xfs: remove XFS_FIND_RCEXT_SHARED and _COW Now that we have an explicit enum for shared and CoW staging extents, we can get rid of the old FIND_RCEXT flags. Omit a couple of conversions that disappear in the next patches. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f492135df0aa0417337f9b8b1cc6d6a994d61d25 Author: Darrick J. Wong Date: Wed Oct 26 14:31:27 2022 -0700 xfs: refactor domain and refcount checking Create a helper function to ensure that CoW staging extent records have a single refcount and that shared extent records have more than 1 refcount. We'll put this to more use in the next patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 571423a162cd86acb1b010a01c6203369586daa6 Author: Darrick J. Wong Date: Wed Oct 26 14:23:58 2022 -0700 xfs: report refcount domain in tracepoints Now that we've broken out the startblock and shared/cow domain in the incore refcount extent record structure, update the tracepoints to report the domain. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 9a50ee4f8db6e4dd0d8d757b7adaf0591776860a Author: Darrick J. Wong Date: Mon Oct 10 09:06:24 2022 -0700 xfs: track cow/shared record domains explicitly in xfs_refcount_irec Just prior to committing the reflink code into upstream, the xfs maintainer at the time requested that I find a way to shard the refcount records into two domains -- one for records tracking shared extents, and a second for tracking CoW staging extents. The idea here was to minimize mount time CoW reclamation by pushing all the CoW records to the right edge of the keyspace, and it was accomplished by setting the upper bit in rc_startblock. We don't allow AGs to have more than 2^31 blocks, so the bit was free. Unfortunately, this was a very late addition to the codebase, so most of the refcount record processing code still treats rc_startblock as a u32 and pays no attention to whether or not the upper bit (the cow flag) is set. This is a weakness is theoretically exploitable, since we're not fully validating the incoming metadata records. Fuzzing demonstrates practical exploits of this weakness. If the cow flag of a node block key record is corrupted, a lookup operation can go to the wrong record block and start returning records from the wrong cow/shared domain. This causes the math to go all wrong (since cow domain is still implicit in the upper bit of rc_startblock) and we can crash the kernel by tricking xfs into jumping into a nonexistent AG and tripping over xfs_perag_get(mp, ) returning NULL. To fix this, start tracking the domain as an explicit part of struct xfs_refcount_irec, adjust all refcount functions to check the domain of a returned record, and alter the function definitions to accept them where necessary. Found by fuzzing keys[2].cowflag = add in xfs/464. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 5a8c345ca8b99a9f54b89991f2f6a20521cb05f4 Author: Darrick J. Wong Date: Tue Oct 11 11:22:54 2022 -0700 xfs: refactor refcount record usage in xchk_refcountbt_rec Consolidate the open-coded xfs_refcount_irec fields into an actual struct and use the existing _btrec_to_irec to decode the ondisk record. This will reduce code churn in the next patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 950f0d50ee7138d7e631aefea8528d485426eda6 Author: Darrick J. Wong Date: Tue Oct 25 15:07:14 2022 -0700 xfs: dump corrupt recovered log intent items to dmesg consistently If log recovery decides that an intent item is corrupt and wants to abort the mount, capture a hexdump of the corrupt log item in the kernel log for further analysis. Some of the log item code already did this, so we're fixing the rest to do it consistently. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 9e7e2436c159490fbbadbc4b5a4ee6bc30dae02e Author: Darrick J. Wong Date: Mon Oct 10 08:47:59 2022 -0700 xfs: move _irec structs to xfs_types.h Structure definitions for incore objects do not belong in the ondisk format header. Move them to the incore types header where they belong. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 921ed96b4f4e3bd19da7f775f39234226e6647e7 Author: Darrick J. Wong Date: Tue Oct 25 15:14:06 2022 -0700 xfs: actually abort log recovery on corrupt intent-done log items If log recovery picks up intent-done log items that are not of the correct size it needs to abort recovery and fail the mount. Debug assertions are not good enough. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 8edbe0cf8b4bbe2cf47513998641797b0aca8ee2 Author: Darrick J. Wong Date: Mon Oct 10 11:33:47 2022 -0700 xfs: check deferred refcount op continuation parameters If we're in the middle of a deferred refcount operation and decide to roll the transaction to avoid overflowing the transaction space, we need to check the new agbno/aglen parameters that we're about to record in the new intent. Specifically, we need to check that the new extent is completely within the filesystem, and that continuation does not put us into a different AG. If the keys of a node block are wrong, the lookup to resume an xfs_refcount_adjust_extents operation can put us into the wrong record block. If this happens, we might not find that we run out of aglen at an exact record boundary, which will cause the loop control to do the wrong thing. The previous patch should take care of that problem, but let's add this extra sanity check to stop corruption problems sooner than later. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 3c5aaaced99912c9fb3352fc5af5b104df67d4aa Author: Darrick J. Wong Date: Fri Oct 21 09:10:05 2022 -0700 xfs: refactor all the EFI/EFD log item sizeof logic Refactor all the open-coded sizeof logic for EFI/EFD log item and log format structures into common helper functions whose names reflect the struct names. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit b65e08f83b119ae9345ed23d4da357a72b3cb55c Author: Darrick J. Wong Date: Fri Oct 28 15:48:58 2022 -0700 xfs: create a predicate to verify per-AG extents Create a predicate function to verify that a given agbno/blockcount pair fit entirely within a single allocation group and don't suffer mathematical overflows. Refactor the existng open-coded logic; we're going to add more calls to this function in the next patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 03a7485cd701e1c08baadcf39d9592d83715e224 Author: Darrick J. Wong Date: Thu Oct 20 16:39:59 2022 -0700 xfs: fix memcpy fortify errors in EFI log format copying Starting in 6.1, CONFIG_FORTIFY_SOURCE checks the length parameter of memcpy. Since we're already fixing problems with BUI item copying, we should fix it everything else. An extra difficulty here is that the ef[id]_extents arrays are declared as single-element arrays. This is not the convention for flex arrays in the modern kernel, and it causes all manner of problems with static checking tools, since they often cannot tell the difference between a single element array and a flex array. So for starters, change those array[1] declarations to array[] declarations to signal that they are proper flex arrays and adjust all the "size-1" expressions to fit the new declaration style. Next, refactor the xfs_efi_copy_format function to handle the copying of the head and the flex array members separately. While we're at it, fix a minor validation deficiency in the recovery function. Signed-off-by: Darrick J. Wong Reviewed-by: Kees Cook Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit f850995f60e49818093ef5e477cdb0ff2c11a0a4 Author: Darrick J. Wong Date: Tue Oct 25 18:18:21 2022 -0700 xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents Prior to calling xfs_refcount_adjust_extents, we trimmed agbno/aglen such that the end of the range would not be in the middle of a refcount record. If this is no longer the case, something is seriously wrong with the btree. Bail out with a corruption error. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit b45ca961e94673df83ab1900802afe82776966e6 Author: Darrick J. Wong Date: Thu Oct 20 16:26:36 2022 -0700 xfs: fix memcpy fortify errors in RUI log format copying Starting in 6.1, CONFIG_FORTIFY_SOURCE checks the length parameter of memcpy. Since we're already fixing problems with BUI item copying, we should fix it everything else. Refactor the xfs_rui_copy_format function to handle the copying of the head and the flex array members separately. While we're at it, fix a minor validation deficiency in the recovery function. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit a38935c03c7914a6ab22eefb750b259868ed5a4b Author: Darrick J. Wong Date: Thu Oct 20 16:23:16 2022 -0700 xfs: fix memcpy fortify errors in CUI log format copying Starting in 6.1, CONFIG_FORTIFY_SOURCE checks the length parameter of memcpy. Since we're already fixing problems with BUI item copying, we should fix it everything else. Refactor the xfs_cui_copy_format function to handle the copying of the head and the flex array members separately. While we're at it, fix a minor validation deficiency in the recovery function. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit a38ebce1da271f480e47c3def4f810c6106b74a1 Author: Darrick J. Wong Date: Thu Oct 20 16:17:41 2022 -0700 xfs: fix memcpy fortify errors in BUI log format copying Starting in 6.1, CONFIG_FORTIFY_SOURCE checks the length parameter of memcpy. Unfortunately, it doesn't handle flex arrays correctly: ------------[ cut here ]------------ memcpy: detected field-spanning write (size 48) of single field "dst_bui_fmt" at fs/xfs/xfs_bmap_item.c:628 (size 16) Fix this by refactoring the xfs_bui_copy_format function to handle the copying of the head and the flex array members separately. While we're at it, fix a minor validation deficiency in the recovery function. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit 59da7ff49d67a1b63b1b81c7f53dcb6a84cdad2b Author: Darrick J. Wong Date: Thu Oct 20 16:08:11 2022 -0700 xfs: fix validation in attr log item recovery Before we start fixing all the complaints about memcpy'ing log items around, let's fix some inadequate validation in the xattr log item recovery code and get rid of the (now trivial) copy_format function. Signed-off-by: Darrick J. Wong Reviewed-by: Kees Cook Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner commit 8184620ae21213d51eaf2e0bd4186baacb928172 Author: Filipe Manana Date: Fri Oct 28 13:15:35 2022 +0100 btrfs: fix lost file sync on direct IO write with nowait and dsync iocb When doing a direct IO write using a iocb with nowait and dsync set, we end up not syncing the file once the write completes. This is because we tell iomap to not call generic_write_sync(), which would result in calling btrfs_sync_file(), in order to avoid a deadlock since iomap can call it while we are holding the inode's lock and btrfs_sync_file() needs to acquire the inode's lock. The deadlock happens only if the write happens synchronously, when iomap_dio_rw() calls iomap_dio_complete() before it returns. Instead we do the sync ourselves at btrfs_do_write_iter(). For a nowait write however we can end up not doing the sync ourselves at at btrfs_do_write_iter() because the write could have been queued, and therefore we get -EIOCBQUEUED returned from iomap in such case. That makes us skip the sync call at btrfs_do_write_iter(), as we don't do it for any error returned from btrfs_direct_write(). We can't simply do the call even if -EIOCBQUEUED is returned, since that would block the task waiting for IO, both for the data since there are bios still in progress as well as potentially blocking when joining a log transaction and when syncing the log (writing log trees, super blocks, etc). So let iomap do the sync call itself and in order to avoid deadlocks for the case of synchronous writes (without nowait), use __iomap_dio_rw() and have ourselves call iomap_dio_complete() after unlocking the inode. A test case will later be sent for fstests, after this is fixed in Linus' tree. Fixes: 51bd9563b678 ("btrfs: fix deadlock due to page faults during direct IO reads and writes") Reported-by: Марк Коренберг Link: https://lore.kernel.org/linux-btrfs/CAEmTpZGRKbzc16fWPvxbr6AfFsQoLmz-Lcg-7OgJOZDboJ+SGQ@mail.gmail.com/ CC: stable@vger.kernel.org # 6.0+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 47ba8cc7b4f82c927cec3ad7c7392e4c45c81c56 Author: Darrick J. Wong Date: Mon Oct 24 10:11:02 2022 -0700 xfs: fix incorrect return type for fsdax fault handlers The kernel robot complained about this: >> fs/xfs/xfs_file.c:1266:31: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted vm_fault_t @@ fs/xfs/xfs_file.c:1266:31: sparse: expected int fs/xfs/xfs_file.c:1266:31: sparse: got restricted vm_fault_t fs/xfs/xfs_file.c:1314:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted vm_fault_t [usertype] ret @@ got int @@ fs/xfs/xfs_file.c:1314:21: sparse: expected restricted vm_fault_t [usertype] ret fs/xfs/xfs_file.c:1314:21: sparse: got int Fix the incorrect return type for these two functions. While we're at it, make the !fsdax version return VM_FAULT_SIGBUS because a zero return value will cause some callers to try to lock vmf->page, which we never set here. Fixes: ea6c49b784f0 ("xfs: support CoW in fsdax mode") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 063b1f21cc9be07291a1f5e227436f353c6d1695 Author: Christophe JAILLET Date: Sun Oct 30 08:35:28 2022 +0100 btrfs: fix a memory allocation failure test in btrfs_submit_direct After allocation 'dip' is tested instead of 'dip->csums'. Fix it. Fixes: 642c5d34da53 ("btrfs: allocate the btrfs_dio_private as part of the iomap dio bio") CC: stable@vger.kernel.org # 5.19+ Reviewed-by: Nikolay Borisov Signed-off-by: Christophe JAILLET Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2b6ae0962b421103feb41a80406732944b0665b3 Author: Helge Deller Date: Fri Oct 28 18:12:49 2022 +0200 parisc: Avoid printing the hardware path twice Avoid that the hardware path is shown twice in the kernel log, and clean up the output of the version numbers to show up in the same order as they are listed in the hardware database in the hardware.c file. Additionally, optimize the memory footprint of the hardware database and mark some code as init code. Fixes: cab56b51ec0e ("parisc: Fix device names in /proc/iomem") Signed-off-by: Helge Deller Cc: # v4.9+ commit 943f45b9399ed8b2b5190cbc797995edaa97f58f Author: Chen Jun Date: Mon Oct 31 03:12:42 2022 +0000 blk-mq: Fix kmemleak in blk_mq_init_allocated_queue There is a kmemleak caused by modprobe null_blk.ko unreferenced object 0xffff8881acb1f000 (size 1024): comm "modprobe", pid 836, jiffies 4294971190 (age 27.068s) hex dump (first 32 bytes): 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... ff ff ff ff ff ff ff ff 00 53 99 9e ff ff ff ff .........S...... backtrace: [<000000004a10c249>] kmalloc_node_trace+0x22/0x60 [<00000000648f7950>] blk_mq_alloc_and_init_hctx+0x289/0x350 [<00000000af06de0e>] blk_mq_realloc_hw_ctxs+0x2fe/0x3d0 [<00000000e00c1872>] blk_mq_init_allocated_queue+0x48c/0x1440 [<00000000d16b4e68>] __blk_mq_alloc_disk+0xc8/0x1c0 [<00000000d10c98c3>] 0xffffffffc450d69d [<00000000b9299f48>] 0xffffffffc4538392 [<0000000061c39ed6>] do_one_initcall+0xd0/0x4f0 [<00000000b389383b>] do_init_module+0x1a4/0x680 [<0000000087cf3542>] load_module+0x6249/0x7110 [<00000000beba61b8>] __do_sys_finit_module+0x140/0x200 [<00000000fdcfff51>] do_syscall_64+0x35/0x80 [<000000003c0f1f71>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 That is because q->ma_ops is set to NULL before blk_release_queue is called. blk_mq_init_queue_data blk_mq_init_allocated_queue blk_mq_realloc_hw_ctxs for (i = 0; i < set->nr_hw_queues; i++) { old_hctx = xa_load(&q->hctx_table, i); if (!blk_mq_alloc_and_init_hctx(.., i, ..)) [1] if (!old_hctx) break; xa_for_each_start(&q->hctx_table, j, hctx, j) blk_mq_exit_hctx(q, set, hctx, j); [2] if (!q->nr_hw_queues) [3] goto err_hctxs; err_exit: q->mq_ops = NULL; [4] blk_put_queue blk_release_queue if (queue_is_mq(q)) [5] blk_mq_release(q); [1]: blk_mq_alloc_and_init_hctx failed at i != 0. [2]: The hctxs allocated by [1] are moved to q->unused_hctx_list and will be cleaned up in blk_mq_release. [3]: q->nr_hw_queues is 0. [4]: Set q->mq_ops to NULL. [5]: queue_is_mq returns false due to [4]. And blk_mq_release will not be called. The hctxs in q->unused_hctx_list are leaked. To fix it, call blk_release_queue in exception path. Fixes: 2f8f1336a48b ("blk-mq: always free hctx after request queue is freed") Signed-off-by: Yuan Can Signed-off-by: Chen Jun Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20221031031242.94107-1-chenjun102@huawei.com Signed-off-by: Jens Axboe commit 12caf46cf4fc92b1c3884cb363ace2e12732fd2f Author: Ville Syrjälä Date: Wed Oct 26 13:11:29 2022 +0300 drm/i915/sdvo: Grab mode_config.mutex during LVDS init to avoid WARNs drm_mode_probed_add() is unhappy about being called w/o mode_config.mutex. Grab it during LVDS fixed mode setup to silence the WARNs. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7301 Fixes: aa2b88074a56 ("drm/i915/sdvo: Fix multi function encoder stuff") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit a3cd4f447281c56377de2ee109327400eb00668d) Signed-off-by: Tvrtko Ursulin commit d372ec94a018c3a19dad71e2ee3478126394d9fc Author: Ville Syrjälä Date: Tue Sep 27 21:06:13 2022 +0300 drm/i915: Simplify intel_panel_add_edid_alt_fixed_modes() Since commit a5810f551d0a ("drm/i915: Allow more varied alternate fixed modes for panels") intel_panel_add_edid_alt_fixed_modes() no longer considers vrr vs. drrs separately. So no reason to pass them as separate parameters either. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220927180615.25476-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit eb89e83c152b122a94e79527d63cb7c79823c37e) Signed-off-by: Tvrtko Ursulin commit fa81cbafbf5764ad5053512152345fab37a1fe18 Author: Chen Zhongjin Date: Sat Oct 29 15:13:55 2022 +0800 block: Fix possible memory leak for rq_wb on add_disk failure kmemleak reported memory leaks in device_add_disk(): kmemleak: 3 new suspected memory leaks unreferenced object 0xffff88800f420800 (size 512): comm "modprobe", pid 4275, jiffies 4295639067 (age 223.512s) hex dump (first 32 bytes): 04 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 ................ 00 e1 f5 05 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d3662699>] kmalloc_trace+0x26/0x60 [<00000000edc7aadc>] wbt_init+0x50/0x6f0 [<0000000069601d16>] wbt_enable_default+0x157/0x1c0 [<0000000028fc393f>] blk_register_queue+0x2a4/0x420 [<000000007345a042>] device_add_disk+0x6fd/0xe40 [<0000000060e6aab0>] nbd_dev_add+0x828/0xbf0 [nbd] ... It is because the memory allocated in wbt_enable_default() is not released in device_add_disk() error path. Normally, these memory are freed in: del_gendisk() rq_qos_exit() rqos->ops->exit(rqos); wbt_exit() So rq_qos_exit() is called to free the rq_wb memory for wbt_init(). However in the error path of device_add_disk(), only blk_unregister_queue() is called and make rq_wb memory leaked. Add rq_qos_exit() to the error path to fix it. Fixes: 83cbce957446 ("block: add error handling for device_add_disk / add_disk") Signed-off-by: Chen Zhongjin Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221029071355.35462-1-chenzhongjin@huawei.com Signed-off-by: Jens Axboe commit fee32f312405726eec6b35b5740c48acda0315e9 Author: Ming Lei Date: Sat Oct 29 09:04:32 2022 +0800 ublk_drv: add ublk_queue_cmd() for cleanup Add helper of ublk_queue_cmd() so that both ublk_queue_rq() and ublk_handle_need_get_data() can reuse this helper. Signed-off-by: Ming Lei Reviewed-by: ZiyangZhang Link: https://lore.kernel.org/r/20221029010432.598367-5-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 3ab6e94ca539242247d4f00414a1bde584d001ed Author: Ming Lei Date: Sat Oct 29 09:04:31 2022 +0800 ublk_drv: avoid to touch io_uring cmd in blk_mq io path io_uring cmd is supposed to be used in ubq daemon context mainly, and we should try to avoid to touch it in ublk io submission context, otherwise this data could become shared between the two contexts, and performance is hurt. So link request into one per-queue list, and use same batching policy of io_uring command, just avoid to touch ucmd in blk-mq io context. Signed-off-by: Ming Lei Reviewed-by: ZiyangZhang Link: https://lore.kernel.org/r/20221029010432.598367-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit d57c2c6c1145148bb23d68db73de0b52d482d4ba Author: Ming Lei Date: Sat Oct 29 09:04:30 2022 +0800 ublk_drv: comment on ublk_driver entry of Kconfig Add help info for choosing to build ublk_drv as module or builtin. Signed-off-by: Ming Lei Reviewed-by: ZiyangZhang Link: https://lore.kernel.org/r/20221029010432.598367-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 224e858f215a3d6304f95a92357a1753475ca9cf Author: Ming Lei Date: Sat Oct 29 09:04:29 2022 +0800 ublk_drv: return flag of UBLK_F_URING_CMD_COMP_IN_TASK in case of module UBLK_F_URING_CMD_COMP_IN_TASK needs to be set and returned to userspace if ublk driver is built as module, otherwise userspace may get wrong flags shown. Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Ming Lei Reviewed-by: ZiyangZhang Link: https://lore.kernel.org/r/20221029010432.598367-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit cf82d0ecb84e8ef9958721193f901609b408655b Author: zhichao.liu Date: Fri Oct 21 17:16:53 2022 +0800 spi: mediatek: Fix package division error Commit 7e963fb2a33ce ("spi: mediatek: add ipm design support for MT7986") makes a mistake on package dividing operation (one change is missing), need to fix it. Background: Ipm design is expanding the HW capability of dma (adjust package length from 1KB to 64KB), and using "dev_comp->ipm_support" flag to indicate it. Issue description: Ipm support patch (said above) is missing to handle remainder at package dividing operation. One case, a transmission length is 65KB, is will divide to 1K (package length) * 65(package loop) in non-ipm desgin case, and will divide to 64K(package length) * 1(package loop) + 1K(remainder) in ipm design case. And the 1K remainder will be lost with the current SW flow, and the transmission will be failure. So, it should be fixed. Solution: Add "ipm_design" flag in function "mtk_spi_get_mult_delta()" to indicate HW capability, and modify the parameters corespondingly. fixes: 7e963fb2a33ce ("spi: mediatek: add ipm design support for MT7986") Signed-off-by: zhichao.liu Link: https://lore.kernel.org/r/20221021091653.18297-1-zhichao.liu@mediatek.com Signed-off-by: Mark Brown commit 6f934afa6a980bb8d3ce73836b1a9922685e50d7 Author: Martin Povišer Date: Thu Oct 27 11:58:00 2022 +0200 ASoC: tas2780: Fix set_tdm_slot in case of single slot There's a special branch in the set_tdm_slot op for the case of nslots being 1, but: (1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL). (2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1. For those reasons remove the 'nslots being 1' special case. Fixes: eae9f9ce181b ("ASoC: add tas2780 driver") Suggested-by: Jos Dehaes Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20221027095800.16094-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit faac764ea1ea6898d93e46c403271fb105c0906e Author: Martin Povišer Date: Thu Oct 27 11:57:59 2022 +0200 ASoC: tas2764: Fix set_tdm_slot in case of single slot There's a special branch in the set_tdm_slot op for the case of nslots being 1, but: (1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL). (2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1. For those reasons remove the 'nslots being 1' special case. Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Suggested-by: Jos Dehaes Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20221027095800.16094-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit e59bf547a7dd366f93bfebb7487959580ca6c0ec Author: Martin Povišer Date: Thu Oct 27 11:57:58 2022 +0200 ASoC: tas2770: Fix set_tdm_slot in case of single slot There's a special branch in the set_tdm_slot op for the case of nslots being 1, but: (1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL). (2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1. For those reasons remove the 'nslots being 1' special case. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Suggested-by: Jos Dehaes Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20221027095800.16094-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit e79762512120f11c51317570519a1553c70805d8 Author: Ville Syrjälä Date: Wed Oct 26 13:11:28 2022 +0300 drm/i915/sdvo: Setup DDC fully before output init Call intel_sdvo_select_ddc_bus() before initializing any of the outputs. And before that is functional (assuming no VBT) we have to set up the controlled_outputs thing. Otherwise DDC won't be functional during the output init but LVDS really needs it for the fixed mode setup. Note that the whole multi output support still looks very bogus, and more work will be needed to make it correct. But for now this should at least fix the LVDS EDID fixed mode setup. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7301 Fixes: aa2b88074a56 ("drm/i915/sdvo: Fix multi function encoder stuff") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit 64b7b557dc8a96d9cfed6aedbf81de2df80c025d) Signed-off-by: Tvrtko Ursulin commit 3e206b6aa6df7eed4297577e0cf8403169b800a2 Author: Ville Syrjälä Date: Wed Oct 26 13:11:27 2022 +0300 drm/i915/sdvo: Filter out invalid outputs more sensibly We try to filter out the corresponding xxx1 output if the xxx0 output is not present. But the way that is being done is pretty awkward. Make it less so. Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit cc1e66394daaa7e9f005e2487a84e34a39f9308b) Signed-off-by: Tvrtko Ursulin commit d3f6bacfca86f6cf6bf85be1e8b54083d68d8195 Author: Robert Beckett Date: Thu Oct 20 13:03:08 2022 +0200 drm/i915: stop abusing swiotlb_max_segment swiotlb_max_segment used to return either the maximum size that swiotlb could bounce, or for Xen PV PAGE_SIZE even if swiotlb could bounce buffer larger mappings. This made i915 on Xen PV work as it bypasses the coherency aspect of the DMA API and can't cope with bounce buffering and this avoided bounce buffering for the Xen/PV case. So instead of adding this hack back, check for Xen/PV directly in i915 for the Xen case and otherwise use the proper DMA API helper to query the maximum mapping size. Replace swiotlb_max_segment() calls with dma_max_mapping_size(). In i915_gem_object_get_pages_internal() no longer consider max_segment only if CONFIG_SWIOTLB is enabled. There can be other (iommu related) causes of specific max segment sizes. Fixes: a2daa27c0c61 ("swiotlb: simplify swiotlb_max_segment") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Robert Beckett Signed-off-by: Christoph Hellwig [hch: added the Xen hack, rewrote the changelog] Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20221020110308.1582518-1-hch@lst.de (cherry picked from commit 78a07fe777c42800bd1adaec12abe5dcee43919e) Signed-off-by: Tvrtko Ursulin commit d7164a5048e8a6afe2cc4aaf7f12643c14e7f241 Author: Imre Deak Date: Tue Oct 25 14:44:55 2022 +0300 drm/i915/tgl+: Add locking around DKL PHY register accesses Accessing the TypeC DKL PHY registers during modeset-commit, -verification, DP link-retraining and AUX power well toggling is racy due to these code paths being concurrent and the PHY register bank selection register (HIP_INDEX_REG) being shared between PHY instances (aka TC ports) and the bank selection being not atomic wrt. the actual PHY register access. Add the required locking around each PHY register bank selection-> register access sequence. Kudos to Ville for noticing the race conditions. v2: - Add the DKL PHY register accessors to intel_dkl_phy.[ch]. (Jani) - Make the DKL_REG_TC_PORT macro independent of PHY internals. - Move initing the DKL PHY lock to a more logical place. v3: - Fix parameter reuse in the DKL_REG_TC_PORT definition. - Document the usage of phy_lock. v4: - Fix adding TC_PORT_1 offset in the DKL_REG_TC_PORT definition. Cc: Ville Syrjälä Cc: Jani Nikula Cc: # v5.5+ Acked-by: Jani Nikula Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20221025114457.2191004-1-imre.deak@intel.com (cherry picked from commit 89cb0ba4ceee6bed1059904859c5723b3f39da68) Signed-off-by: Tvrtko Ursulin commit 8bdc2acd420c6f3dd1f1c78750ec989f02a1e2b9 Author: Dan Carpenter Date: Fri Oct 28 18:05:00 2022 +0300 net: sched: Fix use after free in red_enqueue() We can't use "skb" again after passing it to qdisc_enqueue(). This is basically identical to commit 2f09707d0c97 ("sch_sfb: Also store skb len before calling child enqueue"). Fixes: d7f4f332f082 ("sch_red: update backlog as well") Signed-off-by: Dan Carpenter Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 986d93f55bdeab1cac858d1e47b41fac10b2d7f6 Author: Gaosheng Cui Date: Mon Oct 31 10:10:21 2022 +0800 audit: fix undefined behavior in bit shift for AUDIT_BIT Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in kernel/auditfilter.c:179:23 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c audit_register_class+0x9d/0x137 audit_classes_init+0x4d/0xb8 do_one_initcall+0x76/0x430 kernel_init_freeable+0x3b3/0x422 kernel_init+0x24/0x1e0 ret_from_fork+0x1f/0x30 Signed-off-by: Gaosheng Cui [PM: remove bad 'Fixes' tag as issue predates git, added in v2.6.6-rc1] Signed-off-by: Paul Moore commit 015618c3ec19584c83ff179fa631be8cec906aaf Author: Yang Yingliang Date: Sat Oct 29 15:49:31 2022 +0800 ata: palmld: fix return value check in palmld_pata_probe() If devm_platform_ioremap_resource() fails, it never return NULL pointer, replace the check with IS_ERR(). Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio") Signed-off-by: Yang Yingliang Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 171a93182eccd6e6835d2c86b40787f9f832efaa Author: Sergey Shtylyov Date: Sat Oct 29 00:07:06 2022 +0300 ata: pata_legacy: fix pdc20230_set_piomode() Clang gives a warning when compiling pata_legacy.c with 'make W=1' about the 'rt' local variable in pdc20230_set_piomode() being set but unused. Quite obviously, there is an outb() call missing to write back the updated variable. Moreover, checking the docs by Petr Soucek revealed that bitwise AND should have been done with a negated timing mask and the master/slave timing masks were swapped while updating... Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Reported-by: Damien Le Moal Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 06a4df5863f73af193a4ff7abf7cb04058584f06 Author: Zhang Changzhong Date: Fri Oct 28 10:09:11 2022 +0800 net: fec: fix improper use of NETDEV_TX_BUSY The ndo_start_xmit() method must not free skb when returning NETDEV_TX_BUSY, since caller is going to requeue freed skb. Fix it by returning NETDEV_TX_OK in case of dma_map_single() fails. Fixes: 79f339125ea3 ("net: fec: Add software TSO support") Signed-off-by: Zhang Changzhong Signed-off-by: David S. Miller commit 6fdaed8c79887680bc46cb0a51775bd7c8645528 Author: Hector Martin Date: Thu Oct 27 22:57:11 2022 +0900 drm/format-helper: Only advertise supported formats for conversion drm_fb_build_fourcc_list() currently returns all emulated formats unconditionally as long as the native format is among them, even though not all combinations have conversion helpers. Although the list is arguably provided to userspace in precedence order, userspace can pick something out-of-order (and thus break when it shouldn't), or simply only support a format that is unsupported (and thus think it can work, which results in the appearance of a hang as FB blits fail later on, instead of the initialization error you'd expect in this case). Add checks to filter the list of emulated formats to only those supported for conversion to the native format. This presumes that there is a single native format (only the first is checked, if there are multiple). Refactoring this API to drop the native list or support it properly (by returning the appropriate emulated->native mapping table) is left for a future patch. The simpledrm driver is left as-is with a full table of emulated formats. This keeps all currently working conversions available and drops all the broken ones (i.e. this a strict bugfix patch, adding no new supported formats nor removing any actually working ones). In order to avoid proliferation of emulated formats, future drivers should advertise only XRGB8888 as the sole emulated format (since some userspace assumes its presence). This fixes a real user regression where the ?RGB2101010 support commit started advertising it unconditionally where not supported, and KWin decided to start to use it over the native format and broke, but also the fixes the spurious RGB565/RGB888 formats which have been wrongly unconditionally advertised since the dawn of simpledrm. Fixes: 6ea966fca084 ("drm/simpledrm: Add [AX]RGB2101010 formats") Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Acked-by: Pekka Paalanen Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20221027135711.24425-1-marcan@marcan.st commit 0873509ea64739a9be02e8ee7b4ff573e503ab8e Author: Horatiu Vultur Date: Wed Oct 26 19:43:03 2022 +0200 ARM: dts: lan966x: Enable sgpio on pcb8291 Enable sgpio node on pcb8291 as this is needed to be able to control the LEDs on this board. Otherwise the LEDs support on the board will not be available. On the other board pcb8309 the sgpio is already enabled because it needed to access the SFP ports. Fixes: 0b7baa1a307f ("ARM: dts: lan966x: add led configuration") Signed-off-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221026174303.702919-1-horatiu.vultur@microchip.com commit 2153fc9623e5465f503d793d4c94ad65e9ec9b5f Author: Michael Ellerman Date: Thu Oct 27 23:56:26 2022 +1100 powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec There's a build failure for Book3E without AltiVec: Error: cc1: error: AltiVec not supported in this target make[6]: *** [/linux/scripts/Makefile.build:250: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o] Error 1 This happens because the amdgpu build is only gated by PPC_LONG_DOUBLE_128, but that symbol can be enabled even though AltiVec is disabled. The only user of PPC_LONG_DOUBLE_128 is amdgpu, so just add a dependency on AltiVec to that symbol to fix the build. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221027125626.1383092-1-mpe@ellerman.id.au commit f98b4d13717a58b15c00880d2ccd24972316b430 Merge: 65722736c3baf 247f34f7b8035 Author: Michael Ellerman Date: Mon Oct 31 17:37:21 2022 +1100 Merge tag 'v6.1-rc2' into fixes Merge rc2 into our fixes branch, which was based on rc1 but wasn't merged until rc3, so that for the remainder of the release our fixes branch will be based on rc2 for the purposes of resolving conflicts with other trees (if necessary). commit 30a0b95b1335e12efef89dd78518ed3e4a71a763 Author: Linus Torvalds Date: Sun Oct 30 15:19:28 2022 -0700 Linux 6.1-rc3 commit 5715a502447b07f067ee5af36465c7c2b813ff38 Merge: a2c65a9d0568b 93d904a734a74 Author: David S. Miller Date: Sun Oct 30 21:43:26 2022 +0000 Merge branch 'nfc-skb-leaks' Shang XiaoJing says: ==================== nfc: Fix potential memory leak of skb There are 6 kinds of send functions can be called by nci_send_frame(): virtual_nci_send(), fdp_nci_send(), nxp_nci_send(), s3fwrn5_nci_send(), nfcmrvl_nci_send(), st_nci_send(); 1. virtual_nci_send() will memleak the skb, and has been fixed before. 2. fdp_nci_send() won't free the skb no matter whether write() succeed. 3-4. nxp_nci_send() and s3fwrn5_nci_send() will only free the skb when write() failed, however write() will not free the skb by itself for when succeeds. 5. nfcmrvl_nci_send() will call nfcmrvl_XXX_nci_send(), where some of them will free the skb, but nfcmrvl_i2c_nci_send() only free the skb when i2c_master_send() return >=0, and memleak will happen when i2c_master_send() failed in nfcmrvl_i2c_nci_send(). 6. st_nci_send() will queue the skb into other list and finally be freed. Fix the potential memory leak of skb. ==================== Signed-off-by: David S. Miller commit 93d904a734a74c54d945a9884b4962977f1176cd Author: Shang XiaoJing Date: Thu Oct 27 22:03:32 2022 +0800 nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send() nfcmrvl_i2c_nci_send() will be called by nfcmrvl_nci_send(), and skb should be freed in nfcmrvl_i2c_nci_send(). However, nfcmrvl_nci_send() will only free skb when i2c_master_send() return >=0, which means skb will memleak when i2c_master_send() failed. Free skb no matter whether i2c_master_send() succeeds. Fixes: b5b3e23e4cac ("NFC: nfcmrvl: add i2c driver") Signed-off-by: Shang XiaoJing Signed-off-by: David S. Miller commit 3a146b7e3099dc7cf3114f627d9b79291e2d2203 Author: Shang XiaoJing Date: Thu Oct 27 22:03:31 2022 +0800 nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send() s3fwrn5_nci_send() will call s3fwrn5_i2c_write() or s3fwrn82_uart_write(), and free the skb if write() failed. However, even if the write() run succeeds, the skb will not be freed in write(). As the result, the skb will memleak. s3fwrn5_nci_send() should also free the skb when write() succeeds. Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") Signed-off-by: Shang XiaoJing Signed-off-by: David S. Miller commit 7bf1ed6aff0f70434bd0cdd45495e83f1dffb551 Author: Shang XiaoJing Date: Thu Oct 27 22:03:30 2022 +0800 nfc: nxp-nci: Fix potential memory leak in nxp_nci_send() nxp_nci_send() will call nxp_nci_i2c_write(), and only free skb when nxp_nci_i2c_write() failed. However, even if the nxp_nci_i2c_write() run succeeds, the skb will not be freed in nxp_nci_i2c_write(). As the result, the skb will memleak. nxp_nci_send() should also free the skb when nxp_nci_i2c_write() succeeds. Fixes: dece45855a8b ("NFC: nxp-nci: Add support for NXP NCI chips") Signed-off-by: Shang XiaoJing Signed-off-by: David S. Miller commit 8e4aae6b8ca76afb1fb64dcb24be44ba814e7f8a Author: Shang XiaoJing Date: Thu Oct 27 22:03:29 2022 +0800 nfc: fdp: Fix potential memory leak in fdp_nci_send() fdp_nci_send() will call fdp_nci_i2c_write that will not free skb in the function. As a result, when fdp_nci_i2c_write() finished, the skb will memleak. fdp_nci_send() should free skb after fdp_nci_i2c_write() finished. Fixes: a06347c04c13 ("NFC: Add Intel Fields Peak NFC solution driver") Signed-off-by: Shang XiaoJing Signed-off-by: David S. Miller commit 11871e20bcb23c00966e785a124fb72bc8340af4 Author: Johan Jonker Date: Thu Oct 27 01:31:37 2022 +0200 ARM: dts: rockchip: rk3188: fix lcdc1-rgb24 node name The lcdc1-rgb24 node name is out of line with the rest of the rk3188 lcdc1 node, so fix it. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/7b9c0a6f-626b-07e8-ae74-7e0f08b8d241@gmail.com Signed-off-by: Heiko Stuebner commit de0d04b9780a23eb928aedfb6f981285f78d58e5 Author: Johan Jonker Date: Thu Oct 27 10:59:10 2022 +0200 arm64: dts: rockchip: fix ir-receiver node names Fix ir-receiver node names on Rockchip boards, so that they match with regex: '^ir(-receiver)?(@[a-f0-9]+)?$' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/e9764253-8ce8-150b-4820-41f03f845469@gmail.com Signed-off-by: Heiko Stuebner commit dd847fe34cdf1e89afed1af24986359f13082bfb Author: Johan Jonker Date: Thu Oct 27 10:58:22 2022 +0200 ARM: dts: rockchip: fix ir-receiver node names Fix ir-receiver node names on Rockchip boards, so that they match with regex: '^ir(-receiver)?(@[a-f0-9]+)?$' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/ea5af279-f44c-afea-023d-bb37f5a0d58d@gmail.com Signed-off-by: Heiko Stuebner commit f2bd2e76d6ea13e12849975adae46145375532a4 Author: Johan Jonker Date: Thu Oct 27 10:38:35 2022 +0200 arm64: dts: rockchip: fix adc-keys sub node names Fix adc-keys sub node names on Rockchip boards, so that they match with regex: '^button-' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/6a6a3603-5540-cacc-2672-c015af1ec684@gmail.com Signed-off-by: Heiko Stuebner commit 942b35de22efeb4f9ded83f1ea7747f3fe5a3bb2 Author: Johan Jonker Date: Thu Oct 27 10:37:32 2022 +0200 ARM: dts: rockchip: fix adc-keys sub node names Fix adc-keys sub node names on Rockchip boards, so that they match with regex: '^button-' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/7a0013b1-3a55-a344-e9ea-eacb4b49433c@gmail.com Signed-off-by: Heiko Stuebner commit 6122f3be70d90a1b2a1188d8910256fc218376a9 Author: Sebastian Reichel Date: Mon Oct 24 18:55:47 2022 +0200 arm: dts: rockchip: remove clock-frequency from rtc 'clock-frequency' is not part of the DT binding and not supported by the Linux driver. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20221024165549.74574-5-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 17b57beafccb4569accbfc8c11390744cf59c021 Author: Sebastian Reichel Date: Mon Oct 24 18:55:46 2022 +0200 arm: dts: rockchip: fix node name for hym8563 rtc Fix the node name for hym8563 in all arm rockchip devicetrees. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20221024165549.74574-4-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 2af5bbe32f50d196dd680478a889d12429b3e8cf Author: Sebastian Reichel Date: Mon Oct 24 18:55:45 2022 +0200 arm64: dts: rockchip: remove clock-frequency from rtc 'clock-frequency' is not part of the DT binding and not supported by the Linux driver. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20221024165549.74574-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 67a9aeef44e42b1ac2becf5e61eae0880f48d9db Author: Sebastian Reichel Date: Mon Oct 24 18:55:44 2022 +0200 arm64: dts: rockchip: fix node name for hym8563 rtc Fix the node name for hym8563 in all arm64 rockchip devicetrees. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20221024165549.74574-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit b72018ab8236c3ae427068adeb94bdd3f20454ec Merge: 9f127546bb434 3c6bf6bddc848 Author: Linus Torvalds Date: Sun Oct 30 11:31:14 2022 -0700 Merge tag 'fbdev-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes from Helge Deller: "A use-after-free bugfix in the smscufx driver and various minor error path fixes, smaller build fixes, sysfs fixes and typos in comments in the stifb, sisfb, da8xxfb, xilinxfb, sm501fb, gbefb and cyber2000fb drivers" * tag 'fbdev-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: cyber2000fb: fix missing pci_disable_device() fbdev: sisfb: use explicitly signed char fbdev: smscufx: Fix several use-after-free bugs fbdev: xilinxfb: Make xilinxfb_release() return void fbdev: sisfb: fix repeated word in comment fbdev: gbefb: Convert sysfs snprintf to sysfs_emit fbdev: sm501fb: Convert sysfs snprintf to sysfs_emit fbdev: stifb: Fall back to cfb_fillrect() on 32-bit HCRX cards fbdev: da8xx-fb: Fix error handling in .remove() fbdev: MIPS supports iomem addresses commit 9f127546bb4341df88a51df8e6cc7d8a70cbacd7 Merge: c4d25ce6e9de4 677047383296e Author: Linus Torvalds Date: Sun Oct 30 11:22:33 2022 -0700 Merge tag 'char-misc-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc fixes from Greg KH: "Some small driver fixes for 6.1-rc3. They include: - iio driver bugfixes - counter driver bugfixes - coresight bugfixes, including a revert and then a second fix to get it right. All of these have been in linux-next with no reported problems" * tag 'char-misc-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) misc: sgi-gru: use explicitly signed char coresight: cti: Fix hang in cti_disable_hw() Revert "coresight: cti: Fix hang in cti_disable_hw()" counter: 104-quad-8: Fix race getting function mode and direction counter: microchip-tcb-capture: Handle Signal1 read and Synapse coresight: cti: Fix hang in cti_disable_hw() coresight: Fix possible deadlock with lock dependency counter: ti-ecap-capture: fix IS_ERR() vs NULL check counter: Reduce DEFINE_COUNTER_ARRAY_POLARITY() to defining counter_array iio: bmc150-accel-core: Fix unsafe buffer attributes iio: adxl367: Fix unsafe buffer attributes iio: adxl372: Fix unsafe buffer attributes iio: at91-sama5d2_adc: Fix unsafe buffer attributes iio: temperature: ltc2983: allocate iio channels once tools: iio: iio_utils: fix digit calculation iio: adc: stm32-adc: fix channel sampling time init iio: adc: mcp3911: mask out device ID in debug prints iio: adc: mcp3911: use correct id bits iio: adc: mcp3911: return proper error code on failure to allocate trigger iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug ... commit c4d25ce6e9de47f6d9fb6cc1a34b47ce5f0a46ab Merge: ef3c0949b9bbf 308c316d16cba Author: Linus Torvalds Date: Sun Oct 30 10:35:07 2022 -0700 Merge tag 'usb-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "A few small USB fixes for 6.1-rc3. Include in here are: - MAINTAINERS update, including a big one for the USB gadget subsystem. Many thanks to Felipe for all of the years of hard work he has done on this codebase, it was greatly appreciated. - dwc3 driver fixes for reported problems. - xhci driver fixes for reported problems. - typec driver fixes for minor issues - uvc gadget driver change, and then revert as it wasn't relevant for 6.1-final, as it is a new feature and people are still reviewing and modifying it. All of these have been in the linux-next tree with no reported issues" * tag 'usb-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: dwc3: gadget: Don't set IMI for no_interrupt usb: dwc3: gadget: Stop processing more requests on IMI Revert "usb: gadget: uvc: limit isoc_sg to super speed gadgets" xhci: Remove device endpoints from bandwidth list when freeing the device xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices xhci: Add quirk to reset host back to default state at shutdown usb: xhci: add XHCI_SPURIOUS_SUCCESS to ASM1042 despite being a V0.96 controller usb: dwc3: st: Rely on child's compatible instead of name usb: gadget: uvc: limit isoc_sg to super speed gadgets usb: bdc: change state when port disconnected usb: typec: ucsi: acpi: Implement resume callback usb: typec: ucsi: Check the connection on resume usb: gadget: aspeed: Fix probe regression usb: gadget: uvc: fix sg handling during video encode usb: gadget: uvc: fix sg handling in error case usb: gadget: uvc: fix dropped frame after missed isoc usb: dwc3: gadget: Don't delay End Transfer on delayed_status usb: dwc3: Don't switch OTG -> peripheral if extcon is present MAINTAINERS: Update maintainers for broadcom USB MAINTAINERS: move USB gadget and phy entries under the main USB entry commit ef3c0949b9bbf54be7b04a6be5ba457cc15185f2 Merge: 434766058e168 9ed88fcfb1b08 Author: Linus Torvalds Date: Sun Oct 30 10:21:42 2022 -0700 Merge tag 'gpio-fixes-for-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - convert gpio-tegra to using an immutable irqchip - MAINTAINERS update * tag 'gpio-fixes-for-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: MAINTAINERS: Change myself to a maintainer gpio: tegra: Convert to immutable irq chip commit 434766058e16868e3c04223fb1b3eeca3d9b7ba1 Merge: c96bb958fb13f cb6c18b5a4162 Author: Linus Torvalds Date: Sun Oct 30 09:49:18 2022 -0700 Merge tag 'perf_urgent_for_v6.1_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Rename a perf memory level event define to denote it is of CXL type - Add Alder and Raptor Lakes support to RAPL - Make sure raw sample data is output with tracepoints * tag 'perf_urgent_for_v6.1_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/mem: Rename PERF_MEM_LVLNUM_EXTN_MEM to PERF_MEM_LVLNUM_CXL perf/x86/rapl: Add support for Intel Raptor Lake perf/x86/rapl: Add support for Intel AlderLake-N perf: Fix missing raw data on tracepoint events commit c96bb958fb13fe2e0d16da86f6a21d9171a6db06 Merge: 28b7bd4ad25f7 d81916910f749 Author: Linus Torvalds Date: Sun Oct 30 09:44:06 2022 -0700 Merge tag 'loongarch-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Remove unused kernel stack padding, fix some build errors/warnings and two bugs in laptop platform driver" * tag 'loongarch-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: platform/loongarch: laptop: Fix possible UAF and simplify generic_acpi_laptop_init() platform/loongarch: laptop: Adjust resume order for loongson_hotkey_resume() LoongArch: BPF: Avoid declare variables in switch-case LoongArch: Use flexible-array member instead of zero-length array LoongArch: Remove unused kernel stack padding commit 28b7bd4ad25f7dc662a84636a619e61c97ac0e06 Merge: 882ad2a2a8ffa 153695d36ead0 Author: Linus Torvalds Date: Sun Oct 30 09:40:04 2022 -0700 Merge tag '6.1-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: - use after free fix for reconnect race - two memory leak fixes * tag '6.1-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix use-after-free caused by invalid pointer `hostname` cifs: Fix pages leak when writedata alloc failed in cifs_write_from_iter() cifs: Fix pages array leak when writedata alloc failed in cifs_writedata_alloc() commit 3d982441308ebdf713771c8a85c23d9b8b66b4d4 Author: Li Zhijian Date: Thu Sep 1 03:17:34 2022 +0000 selftests: pidfd: Fix compling warnings Fix warnings and enable Wall. pidfd_wait.c: In function ‘wait_nonblock’: pidfd_wait.c:150:13: warning: unused variable ‘status’ [-Wunused-variable] 150 | int pidfd, status = 0; | ^~~~~~ ... pidfd_test.c: In function ‘child_poll_exec_test’: pidfd_test.c:438:1: warning: no return statement in function returning non-void [-Wreturn-type] 438 | } | ^ Signed-off-by: Li Zhijian v2: fix mistake assignment to pidfd Signed-off-by: Shuah Khan commit 88e1f16ba58665e9edfce437ea487da2fa759af9 Author: Li Zhijian Date: Thu Sep 1 03:10:07 2022 +0000 ksefltests: pidfd: Fix wait_states: Test terminated by timeout 0Day/LKP observed that the kselftest blocks forever since one of the pidfd_wait doesn't terminate in 1 of 30 runs. After digging into the source, we found that it blocks at: ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0); wait_states has below testing flow: CHILD PARENT ---------------+-------------- 1 STOP itself 2 WAIT for CHILD STOPPED 3 SIGNAL CHILD to CONT 4 CONT 5 STOP itself 5' WAIT for CHILD CONT 6 WAIT for CHILD STOPPED The problem is that the kernel cannot ensure the order of 5 and 5', once 5 goes first, the test will fail. we can reproduce it by: $ while true; do make run_tests -C pidfd; done Introduce a blocking read in child process to make sure the parent can check its WCONTINUED. CC: Philip Li Reported-by: kernel test robot Signed-off-by: Li Zhijian Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Shuah Khan commit 882ad2a2a8ffa1defecdf907052f04da2737dc46 Merge: 83633ed70c50d f5e4ec155d145 Author: Linus Torvalds Date: Sat Oct 29 18:33:03 2022 -0700 Merge tag 'random-6.1-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fix from Jason Donenfeld: "One fix from Jean-Philippe Brucker, addressing a regression in which early boot code on ARM64 would use the non-_early variant of the arch_get_random family of functions, resulting in the architectural random number generator appearing unavailable during that early phase of boot. The fix simply changes arch_get_random*() to arch_get_random*_early(). This distinction between these two functions is a bit of an old wart I'm not a fan of, and for 6.2 I'll see if I can make obsolete the _early variant, so that one function does the right thing in all contexts without overhead" * tag 'random-6.1-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: use arch_get_random*_early() in random_init() commit 83633ed70c50d3a8470c7e40732efa165dcc2dc7 Merge: c6e0e874a8fa0 307539eed4639 Author: Linus Torvalds Date: Sat Oct 29 18:12:45 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Varions small fixes, all in drivers. Some of these arrived during the merge window and got held over to make sure of testing on the -rc tree. The biggest change is for standards conformance in the target driver, closely followed by a set of bug fixes in megaraid_sas" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (21 commits) scsi: ufs: core: Fix typo in comment scsi: mpi3mr: Select CONFIG_SCSI_SAS_ATTRS scsi: ufs: core: Fix typo for register name in comments scsi: pm80xx: Display proc_name in sysfs scsi: ufs: core: Fix the error log in ufshcd_query_flag_retry() scsi: ufs: core: Remove unneeded casts from void * scsi: lpfc: Fix spelling mistake "unsolicted" -> "unsolicited" scsi: qla2xxx: Use transport-defined speed mask for supported_speeds scsi: target: iblock: Fold iblock_emulate_read_cap_with_block_size() into iblock_get_blocks() scsi: qla2xxx: Fix serialization of DCBX TLV data request scsi: ufs: qcom: Remove redundant dev_err() call scsi: megaraid_sas: Move megasas_dbg_lvl init to megasas_init() scsi: megaraid_sas: Remove unnecessary memset() scsi: megaraid_sas: Simplify megasas_update_device_list scsi: megaraid_sas: Correct an error message scsi: megaraid_sas: Correct value passed to scsi_device_lookup() scsi: target: core: UA on all LUNs after reset scsi: target: core: New key must be used for moved PR scsi: target: core: Abort all preempted regs if requested scsi: target: core: Fix memory leak in preempt_and_abort ... commit c6e0e874a8fa055b6b2f536c282a523b9439b209 Merge: 4d244327dd1ba e3c5a78cdb623 Author: Linus Torvalds Date: Sat Oct 29 18:06:52 2022 -0700 Merge tag 'block-6.1-2022-10-28' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - make the multipath dma alignment match the non-multipath one (Keith Busch) - fix a bogus use of sg_init_marker() (Nam Cao) - fix circulr locking in nvme-tcp (Sagi Grimberg) - Initialization fix for requests allocated via the special hw queue allocator (John) - Fix for a regression added in this release with the batched completions of end_io backed requests (Ming) - Error handling leak fix for rbd (Yang) - Error handling leak fix for add_disk() failure (Yu) * tag 'block-6.1-2022-10-28' of git://git.kernel.dk/linux: blk-mq: Properly init requests from blk_mq_alloc_request_hctx() blk-mq: don't add non-pt request with ->end_io to batch rbd: fix possible memory leak in rbd_sysfs_init() nvme-multipath: set queue dma alignment to 3 nvme-tcp: fix possible circular locking when deleting a controller under memory pressure nvme-tcp: replace sg_init_marker() with sg_init_table() block: fix memory leak for elevator on add_disk failure commit 4d244327dd1bab94a78fa2ab40a33d13ca18326b Merge: 3c339dbd139e1 b3026767e15b4 Author: Linus Torvalds Date: Sat Oct 29 18:01:16 2022 -0700 Merge tag 'io_uring-6.1-2022-10-28' of git://git.kernel.dk/linux Pull io_uring fix from Jens Axboe: "Just a fix for a locking regression introduced with the deferred task_work running from this merge window" * tag 'io_uring-6.1-2022-10-28' of git://git.kernel.dk/linux: io_uring: unlock if __io_run_local_work locked inside io_uring: use io_run_local_work_locked helper commit 3c339dbd139e14c612c521083023eabfcadfd8a5 Merge: 91562cf99364d dda1c41a07b4a Author: Linus Torvalds Date: Sat Oct 29 17:49:33 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc hotfixes from Andrew Morton: "Eight fix pre-6.0 bugs and the remainder address issues which were introduced in the 6.1-rc merge cycle, or address issues which aren't considered sufficiently serious to warrant a -stable backport" * tag 'mm-hotfixes-stable-2022-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (23 commits) mm: multi-gen LRU: move lru_gen_add_mm() out of IRQ-off region lib: maple_tree: remove unneeded initialization in mtree_range_walk() mmap: fix remap_file_pages() regression mm/shmem: ensure proper fallback if page faults mm/userfaultfd: replace kmap/kmap_atomic() with kmap_local_page() x86: fortify: kmsan: fix KMSAN fortify builds x86: asm: make sure __put_user_size() evaluates pointer once Kconfig.debug: disable CONFIG_FRAME_WARN for KMSAN by default x86/purgatory: disable KMSAN instrumentation mm: kmsan: export kmsan_copy_page_meta() mm: migrate: fix return value if all subpages of THPs are migrated successfully mm/uffd: fix vma check on userfault for wp mm: prep_compound_tail() clear page->private mm,madvise,hugetlb: fix unexpected data loss with MADV_DONTNEED on hugetlbfs mm/page_isolation: fix clang deadcode warning fs/ext4/super.c: remove unused `deprecated_msg' ipc/msg.c: fix percpu_counter use after free memory tier, sysfs: rename attribute "nodes" to "nodelist" MAINTAINERS: git://github.com -> https://github.com for nilfs2 mm/kmemleak: prevent soft lockup in kmemleak_scan()'s object iteration loops ... commit 91562cf99364dd29755988f3cc33ce9a46cd5b0a Merge: 576e61cea1e4b 65722736c3baf Author: Linus Torvalds Date: Sat Oct 29 10:35:17 2022 -0700 Merge tag 'powerpc-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix a case of rescheduling with user access unlocked, when preempt is enabled. - A follow-up fix for a recent fix, which could lead to IRQ state assertions firing incorrectly. - Two fixes for lockdep warnings seen when using kfence with the Hash MMU. - Two fixes for preempt warnings seen when using the Hash MMU. - Two fixes for the VAS coprocessor mechanism used on pseries. - Prevent building some of our older KVM backends when CONTEXT_TRACKING_USER is enabled, as it's known to cause crashes. - A couple of fixes for issues seen with PMU NMIs. Thanks to Nicholas Piggin, Guenter Roeck, Frederic Barrat Haren Myneni, Sachin Sant, and Samuel Holland. * tag 'powerpc-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s/interrupt: Fix clear of PACA_IRQS_HARD_DIS when returning to soft-masked context powerpc/64s/interrupt: Perf NMI should not take normal exit path powerpc/64/interrupt: Prevent NMI PMI causing a dangerous warning KVM: PPC: BookS PR-KVM and BookE do not support context tracking powerpc: Fix reschedule bug in KUAP-unlocked user copy powerpc/64s: Fix hash__change_memory_range preemption warning powerpc/64s: Disable preemption in hash lazy mmu mode powerpc/64s: make linear_map_hash_lock a raw spinlock powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe powerpc/64s: Add lockdep for HPTE lock powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU powerpc/pseries/vas: Add VAS IRQ primary handler commit 447fb14bf07905b880c9ed1ea92c53d6dd0649d7 Author: Michael Tretter Date: Fri Oct 28 11:52:06 2022 +0200 drm/rockchip: vop2: disable planes when disabling the crtc The vop2 driver needs to explicitly disable the planes if the crtc is disabled. Unless the planes are explicitly disabled, the address of the last framebuffer is kept in the registers of the VOP2. When re-enabling the encoder after it has been disabled by the driver, the VOP2 will start and read the framebuffer that has been freed but is still pointed to by the register. The iommu will catch these read accesses and print errors. Explicitly disable the planes when the crtc is disabled to reset the registers. Signed-off-by: Michael Tretter Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-3-m.tretter@pengutronix.de commit 471bf2406c043491b1a8288e5f04bc278f7d7ca1 Author: Michael Tretter Date: Fri Oct 28 11:52:05 2022 +0200 drm/rockchip: vop2: fix null pointer in plane_atomic_disable If the vop2_plane_atomic_disable function is called with NULL as a state, accessing the old_pstate runs into a null pointer exception. However, the drm_atomic_helper_disable_planes_on_crtc function calls the atomic_disable callback with state NULL. Allow to disable a plane without passing a plane state by checking the old_pstate only if a state is passed. Signed-off-by: Michael Tretter Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-2-m.tretter@pengutronix.de commit 553c5a429aee26c9cfaf37ae158a8915540270fe Author: Ondrej Jirman Date: Sun Oct 23 18:07:47 2022 +0200 drm/rockchip: dsi: Fix VOP selection on SoCs that support it lcdsel_grf_reg is defined as u32, so "< 0" comaprison is always false, which breaks VOP selection on eg. RK3399. Compare against 0. Fixes: f3aaa6125b6f ("drm/rockchip: dsi: add rk3568 support") Signed-off-by: Ondrej Jirman Tested-by: Chris Morgan Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221023160747.607943-1-megi@xff.cz commit ab78c74cfc5a3caa2bbb7627cb8f3bca40bb5fb0 Author: John Keeping Date: Thu Oct 20 19:12:47 2022 +0100 drm/rockchip: fix fbdev on non-IOMMU devices When switching to the generic fbdev infrastructure, it was missed that framebuffers were created with the alloc_kmap parameter to rockchip_gem_create_object() set to true. The generic infrastructure calls this via the .dumb_create() driver operation and thus creates a buffer without an associated kmap. alloc_kmap only makes a difference on devices without an IOMMU, but when it is missing rockchip_gem_prime_vmap() fails and the framebuffer cannot be used. Detect the case where a buffer is being allocated for the framebuffer and ensure a kernel mapping is created in this case. Fixes: 24af7c34b290 ("drm/rockchip: use generic fbdev setup") Reported-by: Johan Jonker Cc: Thomas Zimmermann Signed-off-by: John Keeping Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221020181248.2497065-1-john@metanate.com commit 81e592f86f7afdb76d655e7fbd7803d7b8f985d8 Author: Brian Norris Date: Wed Oct 19 17:03:49 2022 -0700 drm/rockchip: dsi: Force synchronous probe We can't safely probe a dual-DSI display asynchronously (driver_async_probe='*' or driver_async_probe='dw-mipi-dsi-rockchip' cmdline), because dw_mipi_dsi_rockchip_find_second() pokes one DSI device's drvdata from the other device without any locking. Request synchronous probe, at least until this driver learns some appropriate locking for dual-DSI initialization. Cc: Signed-off-by: Brian Norris Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221019170255.2.I6b985b0ca372b7e35c6d9ea970b24bcb262d4fc1@changeid commit 0be67e0556e469c57100ffe3c90df90abc796f3b Author: Brian Norris Date: Wed Oct 19 17:03:48 2022 -0700 drm/rockchip: dsi: Clean up 'usage_mode' when failing to attach If we fail to attach the first time (especially: EPROBE_DEFER), we fail to clean up 'usage_mode', and thus will fail to attach on any subsequent attempts, with "dsi controller already in use". Re-set to DW_DSI_USAGE_IDLE on attach failure. This is especially common to hit when enabling asynchronous probe on a duel-DSI system (such as RK3399 Gru/Scarlet), such that we're more likely to fail dw_mipi_dsi_rockchip_find_second() the first time. Fixes: 71f68fe7f121 ("drm/rockchip: dsi: add ability to work as a phy instead of full dsi") Cc: Signed-off-by: Brian Norris Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20221019170255.1.Ia68dfb27b835d31d22bfe23812baf366ee1c6eac@changeid commit bfab00b94bd8569cdb84a6511d6615e6a8104e9c Author: Aurelien Jarno Date: Mon Sep 26 22:37:52 2022 +0200 drm/rockchip: dw_hdmi: filter regulator -EPROBE_DEFER error messages When the avdd-0v9 or avdd-1v8 supply are not yet available, EPROBE_DEFER is returned by rockchip_hdmi_parse_dt(). This causes the following error message to be printed multiple times: dwhdmi-rockchip fe0a0000.hdmi: [drm:dw_hdmi_rockchip_bind [rockchipdrm]] *ERROR* Unable to parse OF data Fix that by not printing the message when rockchip_hdmi_parse_dt() returns -EPROBE_DEFER. Fixes: ca80c4eb4b01 ("drm/rockchip: dw_hdmi: add regulator support") Signed-off-by: Aurelien Jarno Reviewed-by: Dmitry Osipenko Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220926203752.5430-1-aurelien@aurel32.net commit d5c921a53c80dfa942f6dff36253db5a50775a5f Author: Ioana Ciornei Date: Tue Oct 25 17:41:17 2022 +0300 arm64: dts: ls208xa: specify clock frequencies for the MDIO controllers Up until now, the external MDIO controller frequency values relied either on the default ones out of reset or on those setup by u-boot. Let's just properly specify the MDC frequency in the DTS so that even without u-boot's intervention Linux can drive the MDIO bus. Fixes: 0420dde30a90 ("arm64: dts: ls208xa: add the external MDIO nodes") Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit d78a57426e64fc4c61e6189e450a0432d24536ca Author: Ioana Ciornei Date: Tue Oct 25 17:41:16 2022 +0300 arm64: dts: ls1088a: specify clock frequencies for the MDIO controllers Up until now, the external MDIO controller frequency values relied either on the default ones out of reset or on those setup by u-boot. Let's just properly specify the MDC frequency in the DTS so that even without u-boot's intervention Linux can drive the MDIO bus. Fixes: bbe75af7b092 ("arm64: dts: ls1088a: add external MDIO device nodes") Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit c126a0abc5dadd7df236f20aae6d8c3d103f095c Author: Ioana Ciornei Date: Tue Oct 25 17:41:15 2022 +0300 arm64: dts: lx2160a: specify clock frequencies for the MDIO controllers Up until now, the external MDIO controller frequency values relied either on the default ones out of reset or on those setup by u-boot. Let's just properly specify the MDC frequency in the DTS so that even without u-boot's intervention Linux can drive the MDIO bus. Fixes: 6e1b8fae892d ("arm64: dts: lx2160a: add emdio1 node") Fixes: 5705b9dcda57 ("arm64: dts: lx2160a: add emdio2 node") Signed-off-by: Ioana Ciornei Signed-off-by: Shawn Guo commit 1eb20332a082fa801fb89c347c5e62de916a4001 Author: Saravanan Sekar Date: Sat Oct 29 11:29:53 2022 +0200 iio: adc: mp2629: fix wrong comparison of channel Input voltage channel enum is compared against iio address instead of the channel. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221029093000.45451-2-sravanhome@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 741cec30cc52058d1c10d415f3b98319887e4f73 Author: Mitja Spes Date: Fri Oct 21 15:58:21 2022 +0200 iio: pressure: ms5611: changed hardcoded SPI speed to value limited Don't hardcode the ms5611 SPI speed, limit it instead. Signed-off-by: Mitja Spes Fixes: c0644160a8b5 ("iio: pressure: add support for MS5611 pressure and temperature sensor") Link: https://lore.kernel.org/r/20221021135827.1444793-3-mitja@lxnav.com Cc: Signed-off-by: Jonathan Cameron commit 17f442e7e47579d3881fc4d47354eaef09302e6f Author: Mitja Spes Date: Fri Oct 21 15:58:20 2022 +0200 iio: pressure: ms5611: fixed value compensation bug When using multiple instances of this driver the compensation PROM was overwritten by the last initialized sensor. Now each sensor has own PROM storage. Signed-off-by: Mitja Spes Fixes: 9690d81a02dc ("iio: pressure: ms5611: add support for MS5607 temperature and pressure sensor") Link: https://lore.kernel.org/r/20221021135827.1444793-2-mitja@lxnav.com Cc: Signed-off-by: Jonathan Cameron commit 57572cacd36e6d4be7722d7770d23f4430219827 Author: Jonathan Cameron Date: Sun Oct 2 15:41:33 2022 +0100 iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID. The regulator enables were after the check on the chip variant, which was very unlikely to return a correct value when not powered. Presumably all the device anyone is testing on have a regulator that is already powered up when this code runs for reasons beyond the scope of this driver. Move the read call down a few lines. Fixes: 3cf7ded15e40 ("iio: accel: bma400: basic regulator support") Signed-off-by: Jonathan Cameron Reviewed-by: Dan Robertson Cc: Link: https://lore.kernel.org/r/20221002144133.3771029-1-jic23@kernel.org commit 46cf1954de3f324dc7f9472c12c3bd03b268a11b Author: Yang Yingliang Date: Sat Oct 29 16:20:01 2022 +0800 ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq() platform_get_irq() returns negative error number on failure, fix the return value check in pxa2xx_ac97_hw_probe() and assign the error code to 'ret'. Fixes: 2548e6c76ebf ("ARM: pxa: pxa2xx-ac97-lib: use IRQ resource") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221029082001.3207380-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit d81916910f7498fe7a768697e0101d488f9fe665 Author: Yang Yingliang Date: Sat Oct 29 16:29:31 2022 +0800 platform/loongarch: laptop: Fix possible UAF and simplify generic_acpi_laptop_init() Currently the return value of 'sub_driver->init' is not checked. If sparse_keymap_setup() called in the init function fails, 'generic_ inputdev' is freed, then it will lead a UAF when using it in generic_ acpi_laptop_init(). Fix it by checking the return value and setting generic_inputdev to NULL after free, so as to avoid double free it. The error code in generic_subdriver_init() is always negative, so the return of generic_subdriver_init() can be simplified. Fixes: 6246ed09111f ("LoongArch: Add ACPI-based generic laptop driver") Signed-off-by: Yang Yingliang Signed-off-by: Huacai Chen commit fbe605ab157b174385b3f19ce33928d3548a9b09 Author: Huacai Chen Date: Sat Oct 29 16:29:31 2022 +0800 platform/loongarch: laptop: Adjust resume order for loongson_hotkey_resume() Some laptops don't support SW_LID, but still have backlight control, move backlight resuming before SW_LID event handling so as to avoid backlight mistake due to early return. Signed-off-by: Huacai Chen commit bbfddb904df6f82a5948687a2d57766216b9bc0f Author: Huacai Chen Date: Sat Oct 29 16:29:31 2022 +0800 LoongArch: BPF: Avoid declare variables in switch-case Not all compilers support declare variables in switch-case, so move declarations to the beginning of a function. Otherwise we may get such build errors: arch/loongarch/net/bpf_jit.c: In function ‘emit_atomic’: arch/loongarch/net/bpf_jit.c:362:3: error: a label can only be part of a statement and a declaration is not a statement u8 r0 = regmap[BPF_REG_0]; ^~ arch/loongarch/net/bpf_jit.c: In function ‘build_insn’: arch/loongarch/net/bpf_jit.c:727:3: error: a label can only be part of a statement and a declaration is not a statement u8 t7 = -1; ^~ arch/loongarch/net/bpf_jit.c:778:3: error: a label can only be part of a statement and a declaration is not a statement int ret; ^~~ arch/loongarch/net/bpf_jit.c:779:3: error: expected expression before ‘u64’ u64 func_addr; ^~~ arch/loongarch/net/bpf_jit.c:780:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] bool func_addr_fixed; ^~~~ arch/loongarch/net/bpf_jit.c:784:11: error: ‘func_addr’ undeclared (first use in this function); did you mean ‘in_addr’? &func_addr, &func_addr_fixed); ^~~~~~~~~ in_addr arch/loongarch/net/bpf_jit.c:784:11: note: each undeclared identifier is reported only once for each function it appears in arch/loongarch/net/bpf_jit.c:814:3: error: a label can only be part of a statement and a declaration is not a statement u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm; ^~~ Signed-off-by: Huacai Chen commit 4805a13d54be3f5e06436d41fdb13f24012a3c6c Author: Yushan Zhou Date: Sat Oct 29 16:29:31 2022 +0800 LoongArch: Use flexible-array member instead of zero-length array Eliminate the following coccicheck warning: ./arch/loongarch/include/asm/ptrace.h:32:15-21: WARNING use flexible-array member instead Reviewed-by: WANG Xuerui Signed-off-by: Yushan Zhou Signed-off-by: Huacai Chen commit b40fa75e1542e069a4eb9b33d62061d4ae734537 Author: Jinyang He Date: Sat Oct 29 16:29:31 2022 +0800 LoongArch: Remove unused kernel stack padding The current LoongArch kernel stack is padded as if obeying the MIPS o32 calling convention (32 bytes), signifying the port's MIPS lineage but no longer making sense. Remove the padding for clarity. Reviewed-by: WANG Xuerui Signed-off-by: Jinyang He Signed-off-by: Huacai Chen commit 0ba7b623f15d52fa056eca26573d8cf1b9c29fd1 Author: Christophe JAILLET Date: Sat Oct 22 08:08:55 2022 +0200 soc: imx: imx93-pd: Fix the error handling path of imx93_pd_probe() In imx93_pd_probe(); if an error occurs, some resources need to be released as done in the remove function. Fixes: 0a0f7cc25d4a ("soc: imx: add i.MX93 SRC power domain driver") Signed-off-by: Christophe JAILLET Signed-off-by: Shawn Guo commit d92a110130d492bd5eab81827ce3730581dc933a Author: Peng Fan Date: Thu Oct 20 18:16:57 2022 +0800 arm64: dts: imx93: correct gpio-ranges Per imx93-pinfunc.h and pinctrl-imx93.c, correct gpio-ranges. Fixes: ec8b5b5058ea ("arm64: dts: freescale: Add i.MX93 dtsi support") Reported-by: David Wolfe Reviewed-by: Haibo Chen Reviewed-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 82ce591967517b733c6e6e6882b5096d239b3afe Author: Peng Fan Date: Thu Oct 20 18:16:56 2022 +0800 arm64: dts: imx93: correct s4mu interrupt names Per binding doc, interrupt names should be tx and rx. Fixes: 0dfb380d2492 ("arm64: dts: imx93: add s4 mu node") Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit ef370d8ceec62322dee24c960af8ca67a749f34d Author: Peng Fan Date: Mon Oct 10 18:09:58 2022 +0800 dt-bindings: power: gpcv2: add power-domains property Some pgc power-domain requires a parent power domain, so add an optional power-domains property, otherwise there will be dt check warning: gpc@303a0000: pgc:power-domain@1: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: 30af8513bdb5 ("dt-bindings: power: add defines for i.MX8MM power domains") Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 06acb824d7d00a30e9400f67eee481b218371b5a Author: Peng Fan Date: Mon Oct 10 18:07:47 2022 +0800 arm64: dts: imx8: correct clock order Per bindings/mmc/fsl-imx-esdhc.yaml, the clock order is ipg, ahb, per, otherwise warning: " mmc@5b020000: clock-names:1: 'ahb' was expected mmc@5b020000: clock-names:2: 'per' was expected " Fixes: 16c4ea7501b1 ("arm64: dts: imx8: switch to new lpcg clock binding") Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 5e67d47d0b010f0704aca469d6d27637b1dcb2ce Author: Petr Benes Date: Tue Oct 4 17:39:20 2022 +0200 ARM: dts: imx6dl-yapp4: Do not allow PM to switch PU regulator off on Q/QP Fix our design flaw in supply voltage distribution on the Quad and QuadPlus based boards. The problem is that we supply the SoC cache (VDD_CACHE_CAP) from VDD_PU instead of VDD_SOC. The VDD_PU internal regulator can be disabled by PM if VPU or GPU is not used. If that happens the system freezes. To prevent that configure the reg_pu regulator to be always on. Fixes: 0de4ab81ab26 ("ARM: dts: imx6dl-yapp4: Add Y Soft IOTA Crux/Crux+ board") Cc: petrben@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Petr Benes Signed-off-by: Michal Vokáč Signed-off-by: Shawn Guo commit bb5ad73941dc3f4e3c2241348f385da6501d50ea Author: Tim Harvey Date: Thu Sep 29 12:52:22 2022 -0700 ARM: dts: imx6qdl-gw59{10,13}: fix user pushbutton GPIO offset The GW5910 and GW5913 have a user pushbutton that is tied to the Gateworks System Controller GPIO offset 2. Fix the invalid offset of 0. Fixes: 64bf0a0af18d ("ARM: dts: imx6qdl-gw: add Gateworks System Controller support") Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit ee895139a761bdb7869f9f5b9ccc19a064d0d740 Author: Li Jun Date: Mon Sep 26 19:45:35 2022 +0800 arm64: dts: imx8mn: Correct the usb power domain pgc_otg1 is actual the power domain of usb PHY, usb controller is in hsio power domain, and pgc_otg1 is required to be powered up to detect usb remote wakeup, so move the pgc_otg1 power domain to the usb phy node. Fixes: ea2b5af58ab2 ("arm64: dts: imx8mn: put USB controller into power-domains") Signed-off-by: Li Jun Signed-off-by: Shawn Guo commit 9e0bbb7a5218d856f1ccf8f1bf38c8869572b464 Author: Li Jun Date: Mon Sep 26 19:45:34 2022 +0800 arm64: dts: imx8mn: remove otg1 power domain dependency on hsio pgc_otg1 is an independent power domain of hsio, it's for usb phy, so remove hsio power domain from its node. Fixes: 8b8ebec67360 ("arm64: dts: imx8mn: add GPC node") Signed-off-by: Li Jun Signed-off-by: Shawn Guo commit 4585c79ff477f9517b7f384a4fce351417e8fa36 Author: Li Jun Date: Mon Sep 26 19:45:33 2022 +0800 arm64: dts: imx8mm: correct usb power domains pgc_otg1/2 is actual the power domain of usb PHY, usb controller is in hsio power domain, and pgc_otg1/2 is required to be powered up to detect usb remote wakeup, so move the pgc_otg1/2 power domain to the usb phy node. Fixes: 01df28d80859 ("arm64: dts: imx8mm: put USB controllers into power-domains") Signed-off-by: Li Jun Signed-off-by: Shawn Guo commit e1ec45b9a8127d9d31bb9fc1d802571a2ba8dd89 Author: Li Jun Date: Mon Sep 26 19:45:32 2022 +0800 arm64: dts: imx8mm: remove otg1/2 power domain dependency on hsio pgc_otg1/2 are independent power domain of hsio, they for usb phy, so remove hsio power domain dependency from its node. Fixes: d39d4bb15310 ("arm64: dts: imx8mm: add GPC node") Signed-off-by: Li Jun Signed-off-by: Shawn Guo commit 2f321fd6d89ad1e9525f5aa1f2be9202c2f3e724 Author: Max Krummenacher Date: Thu Sep 22 18:29:18 2022 +0200 arm64: dts: verdin-imx8mp: fix ctrl_sleep_moci The GPIO signaling ctrl_sleep_moci is currently handled as a gpio hog. But the gpio-hog node is made a child of the wrong gpio controller. Move it to the node representing gpio4 so that it actually works. Without this carrier board components jumpered to use the signal are unconditionally switched off. Fixes: a39ed23bdf6e ("arm64: dts: freescale: add initial support for verdin imx8m plus") Signed-off-by: Max Krummenacher Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit a2c65a9d0568b6737c02b54f00b80716a53fac61 Author: Vladimir Oltean Date: Thu Oct 27 17:54:39 2022 +0300 net: dsa: fall back to default tagger if we can't load the one from DT DSA tagging protocol drivers can be changed at runtime through sysfs and at probe time through the device tree (support for the latter was added later). When changing through sysfs, it is assumed that the module for the new tagging protocol was already loaded into the kernel (in fact this is only a concern for Ocelot/Felix switches, where we have tag_ocelot.ko and tag_ocelot_8021q.ko; for every other switch, the default and alternative protocols are compiled within the same .ko, so there is nothing for the user to load). The kernel cannot currently call request_module(), because it has no way of constructing the modalias name of the tagging protocol driver ("dsa_tag-%d", where the number is one of DSA_TAG_PROTO_*_VALUE). The device tree only contains the string name of the tagging protocol ("ocelot-8021q"), and the only mapping between the string and the DSA_TAG_PROTO_OCELOT_8021Q_VALUE is present in tag_ocelot_8021q.ko. So this is a chicken-and-egg situation and dsa_core.ko has nothing based on which it can automatically request the insertion of the module. As a consequence, if CONFIG_NET_DSA_TAG_OCELOT_8021Q is built as module, the switch will forever defer probing. The long-term solution is to make DSA call request_module() somehow, but that probably needs some refactoring. What we can do to keep operating with existing device tree blobs is to cancel the attempt to change the tagging protocol with the one specified there, and to remain operating with the default one. Depending on the situation, the default protocol might still allow some functionality (in the case of ocelot, it does), and it's better to have that than to fail to probe. Fixes: deff710703d8 ("net: dsa: Allow default tag protocol to be overridden from DT") Link: https://lore.kernel.org/lkml/20221027113248.420216-1-michael@walle.cc/ Reported-by: Heiko Thiery Reported-by: Michael Walle Signed-off-by: Vladimir Oltean Tested-by: Michael Walle Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221027145439.3086017-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 21ce2c121fa07b00b0906bd781590ea362e82ea2 Author: Alexandru Tachici Date: Thu Oct 27 12:56:55 2022 +0300 net: ethernet: adi: adin1110: Fix notifiers ADIN1110 was registering netdev_notifiers on each device probe. This leads to warnings/probe failures because of double registration of the same notifier when to adin1110/2111 devices are connected to the same system. Move the registration of netdev_notifiers in module init call, in this way multiple driver instances can use the same notifiers. Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20221027095655.89890-2-alexandru.tachici@analog.com Signed-off-by: Jakub Kicinski commit 9201f60a1983c049319eff89081453ad32571a39 Merge: 1208b93dd901b 71b7786ea478f Author: Jakub Kicinski Date: Fri Oct 28 20:21:29 2022 -0700 Merge branch 'a-few-corrections-for-sock_support_zc' Pavel Begunkov says: ==================== a few corrections for SOCK_SUPPORT_ZC There are several places/cases that got overlooked in regards to SOCK_SUPPORT_ZC. We're lacking the flag for IPv6 UDP sockets and accepted TCP sockets. We also should clear the flag when someone tries to hijack a socket by replacing the ->sk_prot callbacks. ==================== Link: https://lore.kernel.org/r/cover.1666825799.git.asml.silence@gmail.com Signed-off-by: Jakub Kicinski commit 71b7786ea478f3c4611deff4d2b9676b0c17c56b Author: Stefan Metzmacher Date: Thu Oct 27 00:25:59 2022 +0100 net: also flag accepted sockets supporting msghdr originated zerocopy Without this only the client initiated tcp sockets have SOCK_SUPPORT_ZC. The listening socket on the server also has it, but the accepted connections didn't, which meant IORING_OP_SEND[MSG]_ZC will always fails with -EOPNOTSUPP. Fixes: e993ffe3da4b ("net: flag sockets supporting msghdr originated zerocopy") Cc: # 6.0 CC: Jens Axboe Link: https://lore.kernel.org/io-uring/20221024141503.22b4e251@kernel.org/T/#m38aa19b0b825758fb97860a38ad13122051f9dda Signed-off-by: Stefan Metzmacher Signed-off-by: Pavel Begunkov Signed-off-by: Jakub Kicinski commit e276d62dcfdee6582486e8b8344dd869518e14be Author: Pavel Begunkov Date: Thu Oct 27 00:25:58 2022 +0100 net/ulp: remove SOCK_SUPPORT_ZC from tls sockets Remove SOCK_SUPPORT_ZC when we're setting ulp as it might not support msghdr::ubuf_info, e.g. like TLS replacing ->sk_prot with a new set of handlers. Cc: # 6.0 Reported-by: Jakub Kicinski Fixes: e993ffe3da4bc ("net: flag sockets supporting msghdr originated zerocopy") Signed-off-by: Pavel Begunkov Signed-off-by: Jakub Kicinski commit fee9ac06647e59a69fb7aec58f25267c134264b4 Author: Pavel Begunkov Date: Thu Oct 27 00:25:57 2022 +0100 net: remove SOCK_SUPPORT_ZC from sockmap sockmap replaces ->sk_prot with its own callbacks, we should remove SOCK_SUPPORT_ZC as the new proto doesn't support msghdr::ubuf_info. Cc: # 6.0 Reported-by: Jakub Kicinski Fixes: e993ffe3da4bc ("net: flag sockets supporting msghdr originated zerocopy") Signed-off-by: Pavel Begunkov Signed-off-by: Jakub Kicinski commit 8f279fb00bb29def9ac79e28c5d6d8e07d21f3fb Author: Pavel Begunkov Date: Thu Oct 27 00:25:56 2022 +0100 udp: advertise ipv6 udp support for msghdr::ubuf_info Mark udp ipv6 as supporting msghdr::ubuf_info. In the original commit SOCK_SUPPORT_ZC was supposed to be set by a udp_init_sock() call from udp6_init_sock(), but d38afeec26ed4 ("tcp/udp: Call inet6_destroy_sock() in IPv6 ...") removed it and so ipv6 udp misses the flag. Cc: # 6.0 Fixes: e993ffe3da4bc ("net: flag sockets supporting msghdr originated zerocopy") Signed-off-by: Pavel Begunkov Signed-off-by: Jakub Kicinski commit 1208b93dd901bafe2526fa9db005bbc30e7ae83a Author: Govindarajulu Varadarajan Date: Thu Oct 27 21:21:59 2022 -0700 enic: MAINTAINERS: Update enic maintainers Update enic maintainers. Signed-off-by: Govindarajulu Varadarajan Link: https://lore.kernel.org/r/20221028042159.735670-1-govind.varadar@gmail.com Signed-off-by: Jakub Kicinski commit e4ba4554209f626c52e2e57f26cba49a62663c8b Author: Jakub Kicinski Date: Thu Oct 27 20:25:01 2022 -0700 net: openvswitch: add missing .resv_start_op I missed one of the families in OvS when annotating .resv_start_op. This triggers the warning added in commit ce48ebdd5651 ("genetlink: limit the use of validation workarounds to old ops"). Reported-by: syzbot+40eb8c0447c0e47a7e9b@syzkaller.appspotmail.com Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes") Link: https://lore.kernel.org/r/20221028032501.2724270-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 7354c9024f2835f6122ed9612e21ab379df050f9 Author: Jakub Kicinski Date: Thu Oct 27 14:21:07 2022 -0700 netlink: hide validation union fields from kdoc Mark the validation fields as private, users shouldn't set them directly and they are too complicated to explain in a more succinct way (there's already a long explanation in the comment above). The strict_start_type field is set directly and has a dedicated comment so move that above the "private" section. Link: https://lore.kernel.org/r/20221027212107.2639255-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 576e61cea1e4b66f52f164dee0edbe4b1c999997 Merge: 283f13d43bb41 e38de4804421b Author: Linus Torvalds Date: Fri Oct 28 17:11:26 2022 -0700 Merge tag 's390-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Remove outdated linux390 link from MAINTAINERS - Add few missing EX_TABLE entries to inline assemblies - Fix raw data collection for pai_ext PMU - Add kernel image secure boot trailer for future firmware versions - Fix out-of-bounds access on cio_ignore free - Fix memory allocation of mdev_types array in vfio-ap * tag 's390-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/vfio-ap: Fix memory allocation for mdev_types array s390/cio: fix out-of-bounds access on cio_ignore free s390/pai: fix raw data collection for PMU pai_ext s390/boot: add secure boot trailer s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() s390/futex: add missing EX_TABLE entry to __futex_atomic_op() s390/uaccess: add missing EX_TABLE entries to __clear_user() MAINTAINERS: remove outdated linux390 link commit 283f13d43bb4187bad3479f96ce7b4582ef4ed17 Merge: 13f05fb219d52 d14e99bf95510 Author: Linus Torvalds Date: Fri Oct 28 17:03:00 2022 -0700 Merge tag 'riscv-for-linus-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix for a build warning in the jump_label code - One of the git://github -> https://github cleanups, for the SiFive drivers - A fix for the kasan initialization code, this still likely warrants some cleanups but that's a bigger problem and at least this fixes the crashes in the short term - A pair of fixes for extension support detection on mixed LLVM/GNU toolchains - A fix for a runtime warning in the /proc/cpuinfo code * tag 'riscv-for-linus-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Fix /proc/cpuinfo cpumask warning riscv: fix detection of toolchain Zihintpause support riscv: fix detection of toolchain Zicbom support riscv: mm: add missing memcpy in kasan_init MAINTAINERS: git://github.com -> https://github.com for sifive riscv: jump_label: mark arguments as const to satisfy asm constraints commit 13f05fb219d528d0352340106967b126c99209f5 Merge: 6b872a5ecece4 dd183e320524f Author: Linus Torvalds Date: Fri Oct 28 16:48:29 2022 -0700 Merge tag 'acpi-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and device properties fixes from Rafael Wysocki: "These fix device properties documentation and the ACPI PCC code, add a new IRQ override quirk for resource handling and add one more item to the list of device IDs to be ignored when returned by _DEP. Specifics: - Fix the documentation of the *_match_string() family of functions to properly cover the return value (Andy Shevchenko) - Fix a possible integer overflow during multiplication in the ACPI PCC code (Manank Patel) - Make the ACPI device resources code skip IRQ override on Asus Vivobook S5602ZA (Tamim Khan) - Add LATT2021 to the list of device IDs that are ignored when returned by _DEP, because there are no drivers for them in the kernel and no plans to add such drivers (Hans de Goede)" * tag 'acpi-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] ACPI: resource: Skip IRQ override on Asus Vivobook S5602ZA ACPI: PCC: Fix unintentional integer overflow device property: Fix documentation for *_match_string() APIs commit 6b872a5ecece462ba02c8cad1c0203583631db2b Merge: fd7e2a25863d3 6f257934ed617 Author: Linus Torvalds Date: Fri Oct 28 16:44:12 2022 -0700 Merge tag 'pm-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These make the intel_pstate driver work as expected on all hybrid platforms to date (regardless of possible platform firmware issues), fix hybrid sleep on systems using suspend-to-idle by default, make the generic power domains code handle disabled idle states properly and update pm-graph. Specifics: - Make intel_pstate use what is known about the hardware instead of relying on information from the platform firmware (ACPI CPPC in particular) to establish the relationship between the HWP CPU performance levels and frequencies on all hybrid platforms available to date (Rafael Wysocki) - Allow hybrid sleep to use suspend-to-idle as a system suspend method if it is the current suspend method of choice (Mario Limonciello) - Fix handling of unavailable/disabled idle states in the generic power domains code (Sudeep Holla) - Update the pm-graph suite of utilities to version 5.10 which is fixes-mostly and does not add any new features (Todd Brandt)" * tag 'pm-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: domains: Fix handling of unavailable/disabled idle states pm-graph v5.10 cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores cpufreq: intel_pstate: Read all MSRs on the target CPU PM: hibernate: Allow hybrid sleep to work with s2idle commit 6f7630b1b5bc672b54c1285ee6aba752b446672c Author: Kees Cook Date: Fri Oct 28 15:32:07 2022 -0700 fortify: Capture __bos() results in const temp vars In two recent run-time memcpy() bound checking bug reports (NFS[1] and JFS[2]), the _detection_ was working correctly (in the sense that the requested copy size was larger than the destination field size), but the _warning text_ was showing the destination field size as SIZE_MAX ("unknown size"). This should be impossible, since the detection function will explicitly give up if the destination field size is unknown. For example, the JFS warning was: memcpy: detected field-spanning write (size 132) of single field "ip->i_link" at fs/jfs/namei.c:950 (size 18446744073709551615) Other cases of this warning (e.g.[3]) have reported correctly, and the reproducer only happens under GCC (at least 10.2 and 12.1), so this currently appears to be a GCC bug. Explicitly capturing the __builtin_object_size() results in const temporary variables fixes the report. For example, the JFS reproducer now correctly reports the field size (128): memcpy: detected field-spanning write (size 132) of single field "ip->i_link" at fs/jfs/namei.c:950 (size 128) Examination of the .text delta (which is otherwise identical), shows the literal value used in the report changing: - mov $0xffffffffffffffff,%rcx + mov $0x80,%ecx [1] https://lore.kernel.org/lkml/Y0zEzZwhOxTDcBTB@codemonkey.org.uk/ [2] https://syzkaller.appspot.com/bug?id=23d613df5259b977dac1696bec77f61a85890e3d [3] https://lore.kernel.org/all/202210110948.26b43120-yujie.liu@intel.com/ Cc: "Dr. David Alan Gilbert" Cc: llvm@lists.linux.dev Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook commit 8bc8824d30193eb7755043d5bb65fa7f0d11a595 Author: Emil Renner Berthing Date: Wed Oct 12 13:09:28 2022 +0200 riscv: dts: sifive unleashed: Add PWM controlled LEDs This adds the 4 PWM controlled green LEDs to the HiFive Unleashed device tree. The schematic doesn't specify any special function for the LEDs, so they're added here without any default triggers and named d1, d2, d3 and d4 just like in the schematic. Signed-off-by: Emil Renner Berthing Reviewed-by: Conor Dooley Tested-by: Conor Dooley Link: https://lore.kernel.org/r/20221012110928.352910-1-emil.renner.berthing@canonical.com Signed-off-by: Palmer Dabbelt commit f5e4ec155d145002fd9840868453d785fab86d42 Author: Jean-Philippe Brucker Date: Fri Oct 28 17:00:42 2022 +0100 random: use arch_get_random*_early() in random_init() While reworking the archrandom handling, commit d349ab99eec7 ("random: handle archrandom with multiple longs") switched to the non-early archrandom helpers in random_init(), which broke initialization of the entropy pool from the arm64 random generator. Indeed at that point the arm64 CPU features, which verify that all CPUs have compatible capabilities, are not finalized so arch_get_random_seed_longs() is unsuccessful. Instead random_init() should use the _early functions, which check only the boot CPU on arm64. On other architectures the _early functions directly call the normal ones. Fixes: d349ab99eec7 ("random: handle archrandom with multiple longs") Cc: stable@vger.kernel.org Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jason A. Donenfeld commit b3f4f51ea68a495f8a5956064c33dce711a2df91 Author: Rasmus Villemoes Date: Fri Oct 21 08:01:53 2022 +0200 tools/nolibc/string: Fix memcmp() implementation The C standard says that memcmp() must treat the buffers as consisting of "unsigned chars". If char happens to be unsigned, the casts are ok, but then obviously the c1 variable can never contain a negative value. And when char is signed, the casts are wrong, and there's still a problem with using an 8-bit quantity to hold the difference, because that can range from -255 to +255. For example, assuming char is signed, comparing two 1-byte buffers, one containing 0x00 and another 0x80, the current implementation would return -128 for both memcmp(a, b, 1) and memcmp(b, a, 1), whereas one of those should of course return something positive. Signed-off-by: Rasmus Villemoes Fixes: 66b6f755ad45 ("rcutorture: Import a copy of nolibc") Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit bfc3b0f05653a28c8d41067a2aa3875d1f982e3e Author: Willy Tarreau Date: Sun Oct 9 20:29:36 2022 +0200 tools/nolibc: Fix missing strlen() definition and infinite loop with gcc-12 When built at -Os, gcc-12 recognizes an strlen() pattern in nolibc_strlen() and replaces it with a jump to strlen(), which is not defined as a symbol and breaks compilation. Worse, when the function is called strlen(), the function is simply replaced with a jump to itself, hence becomes an infinite loop. One way to avoid this is to always set -ffreestanding, but the calling code doesn't know this and there's no way (either via attributes or pragmas) to globally enable it from include files, effectively leaving a painful situation for the caller. Alexey suggested to place an empty asm() statement inside the loop to stop gcc from recognizing a well-known pattern, which happens to work pretty fine. At least it allows us to make sure our local definition is not replaced with a self jump. The function only needs to be renamed back to strlen() so that the symbol exists, which implies that nolibc_strlen() which is used on variable strings has to be declared as a macro that points back to it before the strlen() macro is redifined. It was verified to produce valid code with gcc 3.4 to 12.1 at different optimization levels, and both with constant and variable strings. In case this problem surfaces again in the future, an alternate approach consisting in adding an optimize("no-tree-loop-distribute-patterns") function attribute for gcc>=12 worked as well but is less pretty. Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210081618.754a77db-yujie.liu@intel.com Fixes: 66b6f755ad45 ("rcutorture: Import a copy of nolibc") Fixes: 96980b833a21 ("tools/nolibc/string: do not use __builtin_strlen() at -O0") Cc: "Paul E. McKenney" Cc: Alexey Dobriyan Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit cadaa773bcf161184fa428180516bae33a7bc667 Author: Ulf Hansson Date: Thu Oct 27 13:57:45 2022 +0200 arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state To support the deeper cluster idle state for sm8250 platforms, some additional synchronization is needed between the rpmh-rsc device and the CPU cluster PM domain. Until that is supported, let's disable the cluster idle state. This fixes a problem that has been reported for the Qcom RB5 platform (see below), but most likely other sm8250 platforms suffers from similar issues, so let's make the fix generic for sm8250. vreg_l11c_3p3: failed to enable: -ETIMEDOUT qcom-rpmh-regulator 18200000.rsc:pm8150l-rpmh-regulators: ldo11: devm_regulator_register() failed, ret=-110 qcom-rpmh-regulator: probe of 18200000.rsc:pm8150l-rpmh-regulators failed with error -110 Reported-by: Amit Pundir Fixes: 32bc936d7321 ("arm64: dts: qcom: sm8250: Add cpuidle states") Signed-off-by: Ulf Hansson Tested-by: Amit Pundir Reviewed-by: Sudeep Holla Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20221027115745.240516-1-ulf.hansson@linaro.org commit dda1c41a07b4a4c3f99b5b28c1e8c485205fe860 Author: Sebastian Andrzej Siewior Date: Wed Oct 26 15:48:30 2022 +0200 mm: multi-gen LRU: move lru_gen_add_mm() out of IRQ-off region lru_gen_add_mm() has been added within an IRQ-off region in the commit mentioned below. The other invocations of lru_gen_add_mm() are not within an IRQ-off region. The invocation within IRQ-off region is problematic on PREEMPT_RT because the function is using a spin_lock_t which must not be used within IRQ-disabled regions. The other invocations of lru_gen_add_mm() occur while task_struct::alloc_lock is acquired. Move lru_gen_add_mm() after interrupts are enabled and before task_unlock(). Link: https://lkml.kernel.org/r/20221026134830.711887-1-bigeasy@linutronix.de Fixes: bd74fdaea1460 ("mm: multi-gen LRU: support page table walks") Signed-off-by: Sebastian Andrzej Siewior Acked-by: Yu Zhao Cc: Al Viro Cc: "Eric W . Biederman" Cc: Kees Cook Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 1b9c918318476b4441ddd754ee6699b5367bb5ee Author: Lukas Bulwahn Date: Wed Oct 26 14:00:29 2022 +0200 lib: maple_tree: remove unneeded initialization in mtree_range_walk() Before the do-while loop in mtree_range_walk(), the variables next, min, max need to be initialized. The variables last, prev_min and prev_max are set within the loop body before they are eventually used after exiting the loop body. As it is a do-while loop, the loop body is executed at least once, so the variables last, prev_min and prev_max do not need to be initialized before the loop body. Remove unneeded initialization of last and prev_min. The needless initialization was reported by clang-analyzer as Dead Stores. As the compiler already identifies these assignments as unneeded, it optimizes the assignments away. Hence: No functional change. No change in object code. Link: https://lkml.kernel.org/r/20221026120029.12555-2-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Reviewed-by: Liam R. Howlett Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 1db43d3f3733351849ddca4b573c037c7821bfd8 Author: Liam Howlett Date: Tue Oct 25 16:12:49 2022 +0000 mmap: fix remap_file_pages() regression When using the VMA iterator, the final execution will set the variable 'next' to NULL which causes the function to fail out. Restore the break in the loop to exit the VMA iterator early without clearing NULL fixes the issue. Link: https://lore.kernel.org/lkml/29344.1666681759@jrobl/ Link: https://lkml.kernel.org/r/20221025161222.2634030-1-Liam.Howlett@oracle.com Fixes: 763ecb035029 (mm: remove the vma linked list) Signed-off-by: Liam R. Howlett Reported-by: "J. R. Okajima" Tested-by: "J. R. Okajima" Signed-off-by: Andrew Morton commit 5dc21f0c0b1c02ea2c9014cbe7cd3b28884ff306 Author: Ira Weiny Date: Tue Oct 25 15:01:08 2022 -0700 mm/shmem: ensure proper fallback if page faults The kernel test robot flagged a recursive lock as a result of a conversion from kmap_atomic() to kmap_local_folio()[Link] The cause was due to the code depending on the kmap_atomic() side effect of disabling page faults. In that case the code expects the fault to fail and take the fallback case. git archaeology implied that the recursion may not be an actual bug.[1] However, depending on the implementation of the mmap_lock and the condition of the call there may still be a deadlock.[2] So this is not purely a lockdep issue. Considering a single threaded call stack there are 3 options. 1) Different mm's are in play (no issue) 2) Readlock implementation is recursive and same mm is in play (no issue) 3) Readlock implementation is _not_ recursive (issue) The mmap_lock is recursive so with a single thread there is no issue. However, Matthew pointed out a deadlock scenario when you consider additional process' and threads thusly. "The readlock implementation is only recursive if nobody else has taken a write lock. If you have a multithreaded process, one of the other threads can call mmap() and that will prevent recursion (due to fairness). Even if it's a different process that you're trying to acquire the mmap read lock on, you can still get into a deadly embrace. eg: process A thread 1 takes read lock on own mmap_lock process A thread 2 calls mmap, blocks taking write lock process B thread 1 takes page fault, read lock on own mmap lock process B thread 2 calls mmap, blocks taking write lock process A thread 1 blocks taking read lock on process B process B thread 1 blocks taking read lock on process A Now all four threads are blocked waiting for each other." Regardless using pagefault_disable() ensures that no matter what locking implementation is used a deadlock will not occur. Add an explicit pagefault_disable() and a big comment to explain this for future souls looking at this code. [1] https://lore.kernel.org/all/Y1MymJ%2FINb45AdaY@iweiny-desk3/ [2] https://lore.kernel.org/lkml/Y1bXBtGTCym77%2FoD@casper.infradead.org/ Link: https://lkml.kernel.org/r/20221025220108.2366043-1-ira.weiny@intel.com Link: https://lore.kernel.org/r/202210211215.9dc6efb5-yujie.liu@intel.com Fixes: 7a7256d5f512 ("shmem: convert shmem_mfill_atomic_pte() to use a folio") Signed-off-by: Ira Weiny Reported-by: Matthew Wilcox (Oracle) Reported-by: kernel test robot Cc: Randy Dunlap Cc: Peter Xu Cc: Andrea Arcangeli Signed-off-by: Andrew Morton commit 5521de7dddd211e3a9403d7bde0b614fd0936ac6 Author: Ira Weiny Date: Sun Oct 23 21:34:52 2022 -0700 mm/userfaultfd: replace kmap/kmap_atomic() with kmap_local_page() kmap() and kmap_atomic() are being deprecated in favor of kmap_local_page() which is appropriate for any thread local context.[1] A recent locking bug report with userfaultfd showed that the conversion of the kmap_atomic()'s in those code flows requires care with regard to the prevention of deadlock.[2] git archaeology implied that the recursion may not be an actual bug.[3] However, depending on the implementation of the mmap_lock and the condition of the call there may still be a deadlock.[4] So this is not purely a lockdep issue. Considering a single threaded call stack there are 3 options. 1) Different mm's are in play (no issue) 2) Readlock implementation is recursive and same mm is in play (no issue) 3) Readlock implementation is _not_ recursive (issue) The mmap_lock is recursive so with a single thread there is no issue. However, Matthew pointed out a deadlock scenario when you consider additional process' and threads thusly. "The readlock implementation is only recursive if nobody else has taken a write lock. If you have a multithreaded process, one of the other threads can call mmap() and that will prevent recursion (due to fairness). Even if it's a different process that you're trying to acquire the mmap read lock on, you can still get into a deadly embrace. eg: process A thread 1 takes read lock on own mmap_lock process A thread 2 calls mmap, blocks taking write lock process B thread 1 takes page fault, read lock on own mmap lock process B thread 2 calls mmap, blocks taking write lock process A thread 1 blocks taking read lock on process B process B thread 1 blocks taking read lock on process A Now all four threads are blocked waiting for each other." Regardless using pagefault_disable() ensures that no matter what locking implementation is used a deadlock will not occur. Complete kmap conversion in userfaultfd by replacing the kmap() and kmap_atomic() calls with kmap_local_page(). When replacing the kmap_atomic() call ensure page faults continue to be disabled to support the correct fall back behavior and add a comment to inform future souls of the requirement. [1] https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/ [2] https://lore.kernel.org/all/Y1Mh2S7fUGQ%2FiKFR@iweiny-desk3/ [3] https://lore.kernel.org/all/Y1MymJ%2FINb45AdaY@iweiny-desk3/ [4] https://lore.kernel.org/lkml/Y1bXBtGTCym77%2FoD@casper.infradead.org/ [ira.weiny@intel.com: v2] Link: https://lkml.kernel.org/r/20221025220136.2366143-1-ira.weiny@intel.com Link: https://lkml.kernel.org/r/20221024043452.1491677-1-ira.weiny@intel.com Signed-off-by: Ira Weiny Cc: Matthew Wilcox Cc: Andrew Morton Cc: Andrea Arcangeli Cc: Peter Xu Cc: Axel Rasmussen Signed-off-by: Andrew Morton commit 78a498c3a227f2ac773a8234b2ce092a4403f2c3 Author: Alexander Potapenko Date: Mon Oct 24 23:21:44 2022 +0200 x86: fortify: kmsan: fix KMSAN fortify builds Ensure that KMSAN builds replace memset/memcpy/memmove calls with the respective __msan_XXX functions, and that none of the macros are redefined twice. This should allow building kernel with both CONFIG_KMSAN and CONFIG_FORTIFY_SOURCE. Link: https://lkml.kernel.org/r/20221024212144.2852069-5-glider@google.com Link: https://github.com/google/kmsan/issues/89 Signed-off-by: Alexander Potapenko Reported-by: Tamas K Lengyel Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Kees Cook Signed-off-by: Andrew Morton commit 59c8a02e24894e75639bcecc3cb1e768a2792220 Author: Alexander Potapenko Date: Mon Oct 24 23:21:43 2022 +0200 x86: asm: make sure __put_user_size() evaluates pointer once User access macros must ensure their arguments are evaluated only once if they are used more than once in the macro body. Adding instrument_put_user() to __put_user_size() resulted in double evaluation of the `ptr` argument, which led to correctness issues when performing e.g. unsafe_put_user(..., p++, ...). To fix those issues, evaluate the `ptr` argument of __put_user_size() at the beginning of the macro. Link: https://lkml.kernel.org/r/20221024212144.2852069-4-glider@google.com Fixes: 888f84a6da4d ("x86: asm: instrument usercopy in get_user() and put_user()") Signed-off-by: Alexander Potapenko Reported-by: youling257 Cc: Borislav Petkov Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 921757bc9b611efc483a548b86769934384e9c79 Author: Alexander Potapenko Date: Mon Oct 24 23:21:42 2022 +0200 Kconfig.debug: disable CONFIG_FRAME_WARN for KMSAN by default KMSAN adds a lot of instrumentation to the code, which results in increased stack usage (up to 2048 bytes and more in some cases). It's hard to predict how big the stack frames can be, so we disable the warnings for KMSAN instead. Link: https://lkml.kernel.org/r/20221024212144.2852069-3-glider@google.com Link: https://github.com/google/kmsan/issues/89 Signed-off-by: Alexander Potapenko Cc: Kees Cook Cc: Masahiro Yamada Cc: Nick Desaulniers Signed-off-by: Andrew Morton commit 42855f588e187a6f22978e54422adbc010ac7630 Author: Alexander Potapenko Date: Mon Oct 24 23:21:41 2022 +0200 x86/purgatory: disable KMSAN instrumentation The stand-alone purgatory.ro does not contain the KMSAN runtime, therefore it can't be built with KMSAN compiler instrumentation. Link: https://lkml.kernel.org/r/20221024212144.2852069-2-glider@google.com Link: https://github.com/google/kmsan/issues/89 Signed-off-by: Alexander Potapenko Cc: Andrew Morton Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Andrew Morton commit f59a3ee6912997fc56ecee78613fef53aae668d9 Author: Alexander Potapenko Date: Mon Oct 24 23:21:40 2022 +0200 mm: kmsan: export kmsan_copy_page_meta() Certain modules call copy_user_highpage(), which calls kmsan_copy_page_meta() under KMSAN, so we need to export the latter. Link: https://lkml.kernel.org/r/20221024212144.2852069-1-glider@google.com Link: https://github.com/google/kmsan/issues/89 Fixes: b073d7f8aee4 ("mm: kmsan: maintain KMSAN metadata for page operations") Signed-off-by: Alexander Potapenko Signed-off-by: Andrew Morton commit 03e5f82ea632af329e32ec03d952b2d99497eeaa Author: Baolin Wang Date: Mon Oct 24 16:34:21 2022 +0800 mm: migrate: fix return value if all subpages of THPs are migrated successfully During THP migration, if THPs are not migrated but they are split and all subpages are migrated successfully, migrate_pages() will still return the number of THP pages that were not migrated. This will confuse the callers of migrate_pages(). For example, the longterm pinning will failed though all pages are migrated successfully. Thus we should return 0 to indicate that all pages are migrated in this case Link: https://lkml.kernel.org/r/de386aa864be9158d2f3b344091419ea7c38b2f7.1666599848.git.baolin.wang@linux.alibaba.com Fixes: b5bade978e9b ("mm: migrate: fix the return value of migrate_pages()") Signed-off-by: Baolin Wang Reviewed-by: Alistair Popple Reviewed-by: Yang Shi Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Zi Yan Cc: Signed-off-by: Andrew Morton commit 67eae54bc227b30dedcce9db68b063ba1adb7838 Author: Peter Xu Date: Mon Oct 24 15:33:35 2022 -0400 mm/uffd: fix vma check on userfault for wp We used to have a report that pte-marker code can be reached even when uffd-wp is not compiled in for file memories, here: https://lore.kernel.org/all/YzeR+R6b4bwBlBHh@x1n/T/#u I just got time to revisit this and found that the root cause is we simply messed up with the vma check, so that for !PTE_MARKER_UFFD_WP system, we will allow UFFDIO_REGISTER of MINOR & WP upon shmem as the check was wrong: if (vm_flags & VM_UFFD_MINOR) return is_vm_hugetlb_page(vma) || vma_is_shmem(vma); Where we'll allow anything to pass on shmem as long as minor mode is requested. Axel did it right when introducing minor mode but I messed it up in b1f9e876862d when moving code around. Fix it. Link: https://lkml.kernel.org/r/20221024193336.1233616-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20221024193336.1233616-2-peterx@redhat.com Fixes: b1f9e876862d ("mm/uffd: enable write protection for shmem & hugetlbfs") Signed-off-by: Peter Xu Cc: Axel Rasmussen Cc: Andrea Arcangeli Cc: Nadav Amit Cc: Signed-off-by: Andrew Morton commit 5aae9265ee1a30cf716d6caf6b29fe99b9d55130 Author: Hugh Dickins Date: Sat Oct 22 00:51:06 2022 -0700 mm: prep_compound_tail() clear page->private Although page allocation always clears page->private in the first page or head page of an allocation, it has never made a point of clearing page->private in the tails (though 0 is often what is already there). But now commit 71e2d666ef85 ("mm/huge_memory: do not clobber swp_entry_t during THP split") issues a warning when page_tail->private is found to be non-0 (unless it's swapcache). Change that warning to dump page_tail (which also dumps head), instead of just the head: so far we have seen dead000000000122, dead000000000003, dead000000000001 or 0000000000000002 in the raw output for tail private. We could just delete the warning, but today's consensus appears to want page->private to be 0, unless there's a good reason for it to be set: so now clear it in prep_compound_tail() (more general than just for THP; but not for high order allocation, which makes no pass down the tails). Link: https://lkml.kernel.org/r/1c4233bb-4e4d-5969-fbd4-96604268a285@google.com Fixes: 71e2d666ef85 ("mm/huge_memory: do not clobber swp_entry_t during THP split") Signed-off-by: Hugh Dickins Acked-by: Mel Gorman Cc: Matthew Wilcox (Oracle) Cc: Signed-off-by: Andrew Morton commit 8ebe0a5eaaeb099de03d09ad20f54ed962e2261e Author: Rik van Riel Date: Fri Oct 21 19:28:05 2022 -0400 mm,madvise,hugetlb: fix unexpected data loss with MADV_DONTNEED on hugetlbfs A common use case for hugetlbfs is for the application to create memory pools backed by huge pages, which then get handed over to some malloc library (eg. jemalloc) for further management. That malloc library may be doing MADV_DONTNEED calls on memory that is no longer needed, expecting those calls to happen on PAGE_SIZE boundaries. However, currently the MADV_DONTNEED code rounds up any such requests to HPAGE_PMD_SIZE boundaries. This leads to undesired outcomes when jemalloc expects a 4kB MADV_DONTNEED, but 2MB of memory get zeroed out, instead. Use of pre-built shared libraries means that user code does not always know the page size of every memory arena in use. Avoid unexpected data loss with MADV_DONTNEED by rounding up only to PAGE_SIZE (in do_madvise), and rounding down to huge page granularity. That way programs will only get as much memory zeroed out as they requested. Link: https://lkml.kernel.org/r/20221021192805.366ad573@imladris.surriel.com Fixes: 90e7e7f5ef3f ("mm: enable MADV_DONTNEED for hugetlb mappings") Signed-off-by: Rik van Riel Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: Signed-off-by: Andrew Morton commit fba4eaf93164a6a6eb3cc12a3391b06f6187aa20 Author: Maria Yu Date: Fri Oct 21 18:15:55 2022 +0800 mm/page_isolation: fix clang deadcode warning When !CONFIG_VM_BUG_ON, there is warning of clang-analyzer-deadcode.DeadStores: Value stored to 'mt' during its initialization is never read. Link: https://lkml.kernel.org/r/20221021101555.7992-2-quic_aiquny@quicinc.com Signed-off-by: Maria Yu Cc: David Hildenbrand Cc: Doug Berger Cc: Mike Kravetz Cc: Zi Yan Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit bb2282cf01fcae7379314dc026f3b534c83c186c Author: Andrew Morton Date: Fri Oct 21 08:05:49 2022 -0700 fs/ext4/super.c: remove unused `deprecated_msg' fs/ext4/super.c:1744:19: warning: 'deprecated_msg' defined but not used [-Wunused-const-variable=] Reported-by: kernel test robot Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit 64b4c411a6c7a5f27555bfc2d6310b87bde3db67 Author: Andrew Morton Date: Thu Oct 20 21:19:22 2022 -0700 ipc/msg.c: fix percpu_counter use after free These percpu counters are referenced in free_ipcs->freeque, so destroy them later. Fixes: 72d1e611082e ("ipc/msg: mitigate the lock contention with percpu counter") Reported-by: syzbot+96e659d35b9d6b541152@syzkaller.appspotmail.com Tested-by: Mark Rutland Cc: Jiebin Sun Signed-off-by: Andrew Morton commit 27d676a1c2010450d00d514a8a6c1c780cb8d77f Author: Huang Ying Date: Thu Oct 20 09:51:22 2022 +0800 memory tier, sysfs: rename attribute "nodes" to "nodelist" In sysfs, we use attribute name "cpumap" or "cpus" for cpu mask and "cpulist" or "cpus_list" for cpu list. For example, in my system, $ cat /sys/devices/system/node/node0/cpumap f,ffffffff $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus 0,00100004 $ cat cat /sys/devices/system/node/node0/cpulist 0-35 $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus_list 2,20 It looks reasonable to use "nodemap" for node mask and "nodelist" for node list. So, rename the attribute to follow the naming convention. Link: https://lkml.kernel.org/r/20221020015122.290097-1-ying.huang@intel.com Fixes: 9832fb87834e2b ("mm/demotion: expose memory tier details via sysfs") Signed-off-by: "Huang, Ying" Acked-by: Wei Xu Reviewed-by: Aneesh Kumar K.V Reviewed-by: Yang Shi Reviewed-by: Davidlohr Bueso Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Signed-off-by: Andrew Morton commit b214fadff28d20f96456b73fe93340cb581ca891 Author: Palmer Dabbelt Date: Thu Oct 20 11:42:55 2022 +0900 MAINTAINERS: git://github.com -> https://github.com for nilfs2 Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Link: https://lkml.kernel.org/r/20221020024255.5000-1-konishi.ryusuke@gmail.com Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Link: https://lkml.kernel.org/r/20221013214638.30933-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt Signed-off-by: Ryusuke Konishi Reported-by: Conor Dooley Signed-off-by: Andrew Morton commit 984a608377cb623351b8a3670b285f32ebeb2d32 Author: Waiman Long Date: Thu Oct 20 13:56:19 2022 -0400 mm/kmemleak: prevent soft lockup in kmemleak_scan()'s object iteration loops Commit 6edda04ccc7c ("mm/kmemleak: prevent soft lockup in first object iteration loop of kmemleak_scan()") adds cond_resched() in the first object iteration loop of kmemleak_scan(). However, it turns that the 2nd objection iteration loop can still cause soft lockup to happen in some cases. So add a cond_resched() call in the 2nd and 3rd loops as well to prevent that and for completeness. Link: https://lkml.kernel.org/r/20221020175619.366317-1-longman@redhat.com Fixes: 6edda04ccc7c ("mm/kmemleak: prevent soft lockup in first object iteration loop of kmemleak_scan()") Signed-off-by: Waiman Long Cc: Catalin Marinas Cc: Muchun Song Cc: Signed-off-by: Andrew Morton commit e11c4e088be4c39d17f304fcf331670891905f42 Author: Phillip Lougher Date: Thu Oct 20 23:36:16 2022 +0100 squashfs: fix buffer release race condition in readahead code Fix a buffer release race condition, where the error value was used after release. Link: https://lkml.kernel.org/r/20221020223616.7571-4-phillip@squashfs.org.uk Fixes: b09a7a036d20 ("squashfs: support reading fragments in readahead call") Signed-off-by: Phillip Lougher Tested-by: Bagas Sanjaya Reported-by: Marc Miltenberger Cc: Dimitri John Ledkov Cc: Hsin-Yi Wang Cc: Mirsad Goran Todorovac Cc: Slade Watkins Cc: Thorsten Leemhuis Cc: Signed-off-by: Andrew Morton commit c9199de82bad03bceb94ec3c5195c879d7e11911 Author: Phillip Lougher Date: Thu Oct 20 23:36:15 2022 +0100 squashfs: fix extending readahead beyond end of file The readahead code will try to extend readahead to the entire size of the Squashfs data block. But, it didn't take into account that the last block at the end of the file may not be a whole block. In this case, the code would extend readahead to beyond the end of the file, leaving trailing pages. Fix this by only requesting the expected number of pages. Link: https://lkml.kernel.org/r/20221020223616.7571-3-phillip@squashfs.org.uk Fixes: 8fc78b6fe24c ("squashfs: implement readahead") Signed-off-by: Phillip Lougher Tested-by: Bagas Sanjaya Reported-by: Marc Miltenberger Cc: Dimitri John Ledkov Cc: Hsin-Yi Wang Cc: Mirsad Goran Todorovac Cc: Slade Watkins Cc: Thorsten Leemhuis Cc: Signed-off-by: Andrew Morton commit 9ef8eb6104527bfe9ed31f7a4ffa721390adf9a8 Author: Phillip Lougher Date: Thu Oct 20 23:36:14 2022 +0100 squashfs: fix read regression introduced in readahead code Patch series "squashfs: fix some regressions introduced in the readahead code". This patchset fixes 3 regressions introduced by the recent readahead code changes. The first regression is causing "snaps" to randomly fail after a couple of hours or days, which how the regression came to light. This patch (of 3): If a file isn't a whole multiple of the page size, the last page will have trailing bytes unfilled. There was a mistake in the readahead code which did this. In particular it incorrectly assumed that the last page in the readahead page array (page[nr_pages - 1]) will always contain the last page in the block, which if we're at file end, will be the page that needs to be zero filled. But the readahead code may not return the last page in the block, which means it is unmapped and will be skipped by the decompressors (a temporary buffer used). In this case the zero filling code will zero out the wrong page, leading to data corruption. Fix this by by extending the "page actor" to return the last page if present, or NULL if a temporary buffer was used. Link: https://lkml.kernel.org/r/20221020223616.7571-1-phillip@squashfs.org.uk Link: https://lkml.kernel.org/r/20221020223616.7571-2-phillip@squashfs.org.uk Fixes: 8fc78b6fe24c ("squashfs: implement readahead") Link: https://lore.kernel.org/lkml/b0c258c3-6dcf-aade-efc4-d62a8b3a1ce2@alu.unizg.hr/ Signed-off-by: Phillip Lougher Reported-by: Mirsad Goran Todorovac Tested-by: Mirsad Goran Todorovac Tested-by: Slade Watkins Tested-by: Bagas Sanjaya Reported-by: Marc Miltenberger Cc: Dimitri John Ledkov Cc: Hsin-Yi Wang Cc: Thorsten Leemhuis Cc: Signed-off-by: Andrew Morton commit fd7e2a25863d3a8104dc1e414b2d49e2418e250c Merge: 18937b0477740 db4e955ae3335 Author: Linus Torvalds Date: Fri Oct 28 13:24:57 2022 -0700 Merge tag 'rtc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC fixes from Alexandre Belloni: "Fix wakeup support that broke on multiple platforms" * tag 'rtc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: cmos: fix build on non-ACPI platforms rtc: cmos: Fix wake alarm breakage commit 18937b04777404f628d32206170026e84146a352 Merge: 2eb824f68d8c3 8d280b1df87e0 Author: Linus Torvalds Date: Fri Oct 28 13:00:54 2022 -0700 Merge tag 'mmc-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Cancel recovery work on cleanup to avoid NULL pointer dereference - Fix error path in the read/write error recovery path - Fix kernel panic when remove non-standard SDIO card - Fix WRITE_ZEROES handling for CQE MMC host: - sdhci_am654: Fixup Kconfig dependency for REGMAP_MMIO - sdhci-esdhc-imx: Avoid warning of misconfigured bus-width - sdhci-pci: Disable broken HS400 ES mode for ASUS BIOS on Jasper Lake" * tag 'mmc-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO mmc: core: Fix WRITE_ZEROES CQE handling mmc: core: Fix kernel panic when remove non-standard SDIO card mmc: sdhci-pci-core: Disable ES for ASUS BIOS on Jasper Lake mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus mmc: queue: Cancel recovery work on cleanup mmc: block: Remove error check of hw_reset on reset commit 2eb824f68d8c33e05f2003773f44ae2eae5892d0 Merge: f186fd2f5a83f 05e258c6ec669 Author: Linus Torvalds Date: Fri Oct 28 12:24:19 2022 -0700 Merge tag 'mtd/fixes-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd fixes from Miquel Raynal: "MTD core: - partitions: Add missing of_node_get() in dynamic partitions code Parser drivers: - bcm47xxpart: Fix halfblock reads Raw NAND controller drivers: - marvell: Use correct logic for nand-keep-config - tegra: Fix PM disable depth imbalance in probe - intel: Add missing of_node_put() in ebu_nand_probe() SPI-NOR core changes: - Ignore -ENOTSUPP in spi_nor_init()" * tag 'mtd/fixes-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: parsers: bcm47xxpart: Fix halfblock reads mtd: rawnand: marvell: Use correct logic for nand-keep-config mtd: rawnand: tegra: Fix PM disable depth imbalance in probe mtd: rawnand: intel: Add missing of_node_put() in ebu_nand_probe() mtd: core: add missing of_node_get() in dynamic partitions code mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init() commit f186fd2f5a83fbfe85b1f0048d741c0726f5119a Merge: e3493d682516e f1fae475f10a2 Author: Linus Torvalds Date: Fri Oct 28 12:20:31 2022 -0700 Merge tag 'sound-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes: - fixes for regressions by the recent ALSA control hash usages - fixes for UAF with del_timer() at removals in a few drivers - char signedness fixes - a few memory leak fixes in error paths - device-specific fixes / quirks for Intel SOF, AMD, HD-audio, USB-audio, and various ASoC codecs" * tag 'sound-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (50 commits) ALSA: aoa: Fix I2S device accounting ALSA: Use del_timer_sync() before freeing timer ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev() ALSA: rme9652: use explicitly signed char ALSA: au88x0: use explicitly signed char ALSA: hda/realtek: Add another HP ZBook G9 model quirks ALSA: usb-audio: Add quirks for M-Audio Fast Track C400/600 ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init() ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init() ALSA: ac97: Use snd_ctl_rename() to rename a control ALSA: ca0106: Use snd_ctl_rename() to rename a control ALSA: emu10k1: Use snd_ctl_rename() to rename a control ALSA: hda/realtek: Use snd_ctl_rename() to rename a control ALSA: usb-audio: Use snd_ctl_rename() to rename a control ALSA: control: add snd_ctl_rename() ALSA: ac97: fix possible memory leak in snd_ac97_dev_register() ASoC: SOF: Intel: pci-tgl: fix ADL-N descriptor ASoC: qcom: lpass-cpu: Mark HDMI TX parity register as volatile ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List ... commit e3493d682516e2b7ef69587ddf91b0371a1511d0 Merge: 05c31d25cc967 b2196401949ed Author: Linus Torvalds Date: Fri Oct 28 12:10:43 2022 -0700 Merge tag 'drm-fixes-2022-10-28' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regularly scheduled fixes for drm, live from a Red Hat office for the first time in a while. The core has two fixes, one for scheduler leak and one for aperture uninit read. Otherwise a single bridge fix, and msm, amdgpu/kfd and i915 have a set of fixes each. sched: - Stop leaking fences when killing a sched entity. aperture: - Avoid uninitialized read in aperture_remove_conflicting_pci_device() bridge: - Fix HPD on bridge/ps8640. msm: - Fix shrinker deadlock - Fix crash during suspend after unbind - Fix IRQ lifetime issues - Fix potential memory corruption with too many bridges - Fix memory corruption on GPU state capture amdgpu: - Stable pstate fix - SMU 13.x updates - SR-IOV fixes - PCI AER fix - GC 11.x fixes - Display fixes - Expose IMU firmware version for debugging - Plane modifier fix - S0i3 fix amdkfd: - Fix possible memory leak - Fix GC 10.x cache info reporting i915: - Extend Wa_1607297627 to Alderlake-P - Keep PCI autosuspend control 'on' by default on all dGPU - Reset frl trained flag before restarting FRL training" * tag 'drm-fixes-2022-10-28' of git://anongit.freedesktop.org/drm/drm: (39 commits) fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume drm/scheduler: fix fence ref counting drm/amd/display: Revert logic for plane modifiers drm/amdkfd: correct the cache info for gfx1036 drm/amdkfd: update gfx1037 Lx cache setting drm/amdgpu: skip mes self test for gc 11.0.3 in recover drm/amd: Add IMU fw version to fw version queries drm/amd/display: Don't return false if no stream drm/amd/display: Remove wrong pipe control lock drm/amd/pm: allow gfxoff on gc_11_0_3 drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr() drm/amdgpu: Remove ATC L2 access for MMHUB 2.1.x drm/i915/dp: Reset frl trained flag before restarting FRL training drm/i915/dgfx: Keep PCI autosuspend control 'on' by default on all dGPU drm/i915: Extend Wa_1607297627 to Alderlake-P drm/amdgpu: Adjust MES polling timeout for sriov drm/amd/pm: update driver-if header for smu_v13_0_10 drm/amdgpu: fix pstate setting issue drm/bridge: ps8640: Add back the 50 ms mystery delay after HPD ... commit 05c31d25cc9678cc173cf12e259d638e8a641f66 Merge: 23758867219c8 9f6035af06b52 Author: Linus Torvalds Date: Fri Oct 28 09:53:30 2022 -0700 Merge tag 'v6.1-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "Fix an alignment crash in x86/polyval" * tag 'v6.1-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned commit 39a654f39efb035b961359db91f15a347e8d7fd8 Author: Manivannan Sadhasivam Date: Fri Oct 28 21:30:29 2022 +0530 MAINTAINERS: Add Manivannan Sadhasivam as Qcom PCIe RC maintainer Stan is moving out of mm-sol and decided not to carry on the maintainership duties of the Qcom PCIe RC driver. Since I'm already maintaining the Qcom PCIe EP driver, I'm volunteering myself to maintain the RC driver also. Link: https://lore.kernel.org/r/20221028160029.44483-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Cc: Stanimir Varbanov commit ae4b3c1252f0fd0951d2f072a02ba46cac8d6c92 Author: Jon Hunter Date: Wed Oct 26 16:56:33 2022 +0100 spi: tegra210-quad: Don't initialise DMA if not supported The following error messages are observed on boot for Tegra234 ... ERR KERN tegra-qspi 3270000.spi: cannot use DMA: -19 ERR KERN tegra-qspi 3270000.spi: falling back to PIO Tegra234 does not support DMA for the QSPI and so initialising the DMA is expected to fail. The above error messages are misleading for devices that don't support DMA and so fix this by skipping the DMA initialisation for devices that don't support DMA. Signed-off-by: Jon Hunter Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20221026155633.141792-1-jonathanh@nvidia.com Signed-off-by: Mark Brown commit f11a74b45d330ad1ab986852b099747161052526 Author: Ard Biesheuvel Date: Thu Oct 27 15:52:31 2022 +0200 efi: efivars: Fix variable writes with unsupported query_variable_store() Commit 8a254d90a775 ("efi: efivars: Fix variable writes without query_variable_store()") addressed an issue that was introduced during the EFI variable store refactor, where alternative implementations of the efivars layer that lacked query_variable_store() would no longer work. Unfortunately, there is another case to consider here, which was missed: if the efivars layer is backed by the EFI runtime services as usual, but the EFI implementation predates the introduction of QueryVariableInfo(), we will return EFI_UNSUPPORTED, and this is no longer being dealt with correctly. So let's fix this, and while at it, clean up the code a bit, by merging the check_var_size() routines as well as their callers. Cc: # v6.0 Fixes: bbc6d2c6ef22 ("efi: vars: Switch to new wrapper layer") Signed-off-by: Ard Biesheuvel Tested-by: Aditya Garg commit 6a564338a23cefcfc29c4a535b98402d13efdda6 Author: Maarten Zanders Date: Fri Oct 28 16:11:28 2022 +0200 ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N When CONFIG_PM=N, pm_runtime_put_sync() returns -ENOSYS which breaks the probe function of these drivers. Other users of pm_runtime_put_sync() typically don't check the return value. In order to keep the program flow as intended, check for -ENOSYS. This commit is similar to commit 0434d3f (omap-mailbox.c). Fixes: cab04ab5900f ("ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk") Fixes: 203773e39347 ("ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk") Fixes: 2277e7e36b4b ("ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk") Signed-off-by: Maarten Zanders Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20221028141129.100702-1-maarten.zanders@mind.be Signed-off-by: Mark Brown commit 7a47e077e503feb73d56e491ce89aa73b67a3972 Author: Dan Carpenter Date: Tue Oct 25 18:32:32 2022 +0300 RDMA/qedr: clean up work queue on failure in qedr_alloc_resources() Add a check for if create_singlethread_workqueue() fails and also destroy the work queue on failure paths. Fixes: e411e0587e0d ("RDMA/qedr: Add iWARP connection management functions") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Y1gBkDucQhhWj5YM@kili Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 07c0d131cc0fe1f3981a42958fc52d573d303d89 Author: Chen Zhongjin Date: Tue Oct 25 10:41:46 2022 +0800 RDMA/core: Fix null-ptr-deref in ib_core_cleanup() KASAN reported a null-ptr-deref error: KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f] CPU: 1 PID: 379 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:destroy_workqueue+0x2f/0x740 RSP: 0018:ffff888016137df8 EFLAGS: 00000202 ... Call Trace: ib_core_cleanup+0xa/0xa1 [ib_core] __do_sys_delete_module.constprop.0+0x34f/0x5b0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fa1a0d221b7 ... It is because the fail of roce_gid_mgmt_init() is ignored: ib_core_init() roce_gid_mgmt_init() gid_cache_wq = alloc_ordered_workqueue # fail ... ib_core_cleanup() roce_gid_mgmt_cleanup() destroy_workqueue(gid_cache_wq) # destroy an unallocated wq Fix this by catching the fail of roce_gid_mgmt_init() in ib_core_init(). Fixes: 03db3a2d81e6 ("IB/core: Add RoCE GID table management") Signed-off-by: Chen Zhongjin Link: https://lore.kernel.org/r/20221025024146.109137-1-chenzhongjin@huawei.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2124becad797245d49252d2d733aee0322233d7e Author: Mario Limonciello Date: Fri Oct 14 07:11:36 2022 -0500 ACPI: x86: Add another system to quirk list for forcing StorageD3Enable commit 018d6711c26e4 ("ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable") introduced a quirk to allow a system with ambiguous use of _ADR 0 to force StorageD3Enable. Julius Brockmann reports that Inspiron 16 5625 suffers that same symptoms. Add this other system to the list as well. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440 Reported-and-tested-by: Julius Brockmann Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 9ed88fcfb1b08c41bde0381dece84d152d53774c Author: Matti Vaittinen Date: Fri Oct 28 08:15:45 2022 +0300 MAINTAINERS: Change myself to a maintainer After some off-list discussion with Marek Vasut and Geert Uytterhoeven and finally a kx022a driver related discussion with Joe Perches https://lore.kernel.org/lkml/92c3f72e60bc99bf4a21da259b4d78c1bdca447d.camel@perches.com/ it seems that my status as a reviewer has been wrong. I do look after the ROHM/Kionix drivers I've authored and currently I am also paid to do so as is reflected by the 'S: Supported'. According to Joe, the reviewer entry in MAINTAINERS do not indicate such level of support and having a reviewer supporting an IC is a contradiction. Switch undersigned from a reviewer to a maintainer for IC drivers I am taking care of. Signed-off-by: Matti Vaittinen Reviewed-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit dd183e320524f076a765ec441193deb90bd53836 Merge: fa153b7cddce7 b5f9223a105d9 8338b74a750c5 92e10465acaff Author: Rafael J. Wysocki Date: Fri Oct 28 16:37:02 2022 +0200 Merge branches 'acpi-resource', 'acpi-pcc' and 'devprop' Merge an IRQ override quirk, an ACPI PCC code fix and a device properties documentation update for 6.1-rc3: - Make the ACPI device resources code skip IRQ override on Asus Vivobook S5602ZA (Tamim Khan). - Fix a possible integer overflow during multiplication in the ACPI PCC code (Manank Patel). - Fix the documentation of the *_match_string() family of functions to properly cover the return value (Andy Shevchenko). * acpi-resource: ACPI: resource: Skip IRQ override on Asus Vivobook S5602ZA * acpi-pcc: ACPI: PCC: Fix unintentional integer overflow * devprop: device property: Fix documentation for *_match_string() APIs commit 6f257934ed6170ed0094149e0e1bac09f7997103 Merge: f5c8cf2a4992d 85850af4fc471 e0c57a5c70c13 9bfb09774ea40 Author: Rafael J. Wysocki Date: Fri Oct 28 16:31:25 2022 +0200 Merge branches 'pm-sleep', 'pm-domains' and 'pm-tools' Merge a hiberantion-related fix, a generic power domains code fix and a pm-graph update for 6.1-rc1: - Allow hybrid sleep to use suspend-to-idle as a system suspend method if it is the current suspend method of choice (Mario Limonciello). - Fix handling of unavailable/disabled idle states in the generic power domains code (Sudeep Holla). - Update the pm-graph suite of utilities to version 5.10 which is fixes-mostly and does not add any new features (Todd Brandt). * pm-sleep: PM: hibernate: Allow hybrid sleep to work with s2idle * pm-domains: PM: domains: Fix handling of unavailable/disabled idle states * pm-tools: pm-graph v5.10 commit e3c5a78cdb6237bfb9641b63cccf366325229eec Author: John Garry Date: Wed Oct 26 18:35:13 2022 +0800 blk-mq: Properly init requests from blk_mq_alloc_request_hctx() Function blk_mq_alloc_request_hctx() is missing zeroing/init of rq->bio, biotail, __sector, and __data_len members, which blk_mq_alloc_request() has, so duplicate what we do in blk_mq_alloc_request(). Fixes: 1f5bd336b9150 ("blk-mq: add blk_mq_alloc_request_hctx") Signed-off-by: John Garry Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/1666780513-121650-1-git-send-email-john.garry@huawei.com Signed-off-by: Jens Axboe commit 8d06679b25fc6813eb2438fac7fa13f4f3c2ef37 Author: Stefan Binding Date: Fri Oct 28 11:27:42 2022 +0100 ALSA: hda/realtek: Add quirk for ASUS Zenbook using CS35L41 This Asus Zenbook laptop use Realtek HDA codec combined with 2xCS35L41 Amplifiers using I2C with Internal Boost. Signed-off-by: Stefan Binding Cc: Link: https://lore.kernel.org/r/20221028102742.2588687-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 04948e757148f870a31f4887ea2239403f516c3c Author: Johan Hovold Date: Wed Oct 26 18:21:16 2022 +0200 phy: qcom-qmp-combo: fix NULL-deref on runtime resume Commit fc64623637da ("phy: qcom-qmp-combo,usb: add support for separate PCS_USB region") started treating the PCS_USB registers as potentially separate from the PCS registers but used the wrong base when no PCS_USB offset has been provided. Fix the PCS_USB base used at runtime resume to prevent dereferencing a NULL pointer on platforms that do not provide a PCS_USB offset (e.g. SC7180). Fixes: fc64623637da ("phy: qcom-qmp-combo,usb: add support for separate PCS_USB region") Cc: stable@vger.kernel.org # 5.20 Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20221026162116.26462-1-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4a6f278d4827b59ba26ceae0ff4529ee826aa258 Author: Miklos Szeredi Date: Fri Oct 28 14:25:20 2022 +0200 fuse: add file_modified() to fallocate Add missing file_modified() call to fuse_file_fallocate(). Without this fallocate on fuse failed to clear privileges. Fixes: 05ba1f082300 ("fuse: add FALLOCATE operation") Cc: Signed-off-by: Miklos Szeredi commit c1de355e04e6ae8da21cb6bfbd5bbfd8deee0fe5 Author: Jay Fang Date: Fri Oct 28 10:37:39 2022 +0800 MAINTAINERS: Update HiSilicon SFC Driver maintainer Add Jay Fang as the maintainer of the HiSilicon SFC Driver, replacing John Garry. Signed-off-by: Jay Fang Acked-by: John Garry Link: https://lore.kernel.org/r/20221028023739.4113998-1-f.fangjian@huawei.com Signed-off-by: Mark Brown commit 6ec27c53886c8963729885bcf2dd996eba2767a7 Author: Chen Zhongjin Date: Fri Oct 28 11:16:03 2022 +0800 ASoC: core: Fix use-after-free in snd_soc_exit() KASAN reports a use-after-free: BUG: KASAN: use-after-free in device_del+0xb5b/0xc60 Read of size 8 at addr ffff888008655050 by task rmmod/387 CPU: 2 PID: 387 Comm: rmmod Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: dump_stack_lvl+0x79/0x9a print_report+0x17f/0x47b kasan_report+0xbb/0xf0 device_del+0xb5b/0xc60 platform_device_del.part.0+0x24/0x200 platform_device_unregister+0x2e/0x40 snd_soc_exit+0xa/0x22 [snd_soc_core] __do_sys_delete_module.constprop.0+0x34f/0x5b0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd ... It's bacause in snd_soc_init(), snd_soc_util_init() is possble to fail, but its ret is ignored, which makes soc_dummy_dev unregistered twice. snd_soc_init() snd_soc_util_init() platform_device_register_simple(soc_dummy_dev) platform_driver_register() # fail platform_device_unregister(soc_dummy_dev) platform_driver_register() # success ... snd_soc_exit() snd_soc_util_exit() # soc_dummy_dev will be unregistered for second time To fix it, handle error and stop snd_soc_init() when util_init() fail. Also clean debugfs when util_init() or driver_register() fail. Fixes: fb257897bf20 ("ASoC: Work around allmodconfig failure") Signed-off-by: Chen Zhongjin Link: https://lore.kernel.org/r/20221028031603.59416-1-chenzhongjin@huawei.com Signed-off-by: Mark Brown commit 49a467310dc4fae591a3547860ee04d8730780f4 Author: Srinivas Kandagatla Date: Wed Oct 26 12:02:06 2022 +0100 soundwire: qcom: check for outanding writes before doing a read Reading will increase the fifo count, so check for outstanding cmd wrt. write fifo depth to avoid overflow as read will also increase write fifo cnt. Fixes: a661308c34de ("soundwire: qcom: wait for fifo space to be available before read/write") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20221026110210.6575-3-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit f936fa7a954b262cb3908bbc8f01ba19dfaf9fbf Author: Srinivas Kandagatla Date: Wed Oct 26 12:02:05 2022 +0100 soundwire: qcom: reinit broadcast completion For some reason we never reinit the broadcast completion, there is a danger that broadcast commands could be treated as completed by driver from previous complete status. Fix this by reinitializing the completion before sending a broadcast command. Fixes: ddea6cf7b619 ("soundwire: qcom: update register read/write routine") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20221026110210.6575-2-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 13c30a755847c7e804e1bf755e66e3ff7b7f9367 Author: Sjoerd Simons Date: Thu Oct 20 09:56:24 2022 +0800 soundwire: intel: Initialize clock stop timeout The bus->clk_stop_timeout member is only initialized to a non-zero value during the codec driver probe. This can lead to corner cases where this value remains pegged at zero when the bus suspends, which results in an endless loop in sdw_bus_wait_for_clk_prep_deprep(). Corner cases include configurations with no codecs described in the firmware, or delays in probing codec drivers. Initializing the default timeout to the smallest non-zero value avoid this problem and allows for the existing logic to be preserved: the bus->clk_stop_timeout is set as the maximum required by all codecs connected on the bus. Fixes: 1f2dcf3a154ac ("soundwire: intel: set dev_num_ida_min") Signed-off-by: Sjoerd Simons Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20221020015624.1703950-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7353633814f6e5b4899fb9ee1483709d6bb0e1cd Author: Eiichi Tsukata Date: Fri Oct 28 09:26:31 2022 +0000 KVM: x86/xen: Fix eventfd error handling in kvm_xen_eventfd_assign() Should not call eventfd_ctx_put() in case of error. Fixes: 2fd6df2f2b47 ("KVM: x86/xen: intercept EVTCHNOP_send from guests") Reported-by: syzbot+6f0c896c5a9449a10ded@syzkaller.appspotmail.com Signed-off-by: Eiichi Tsukata Message-Id: <20221028092631.117438-1-eiichi.tsukata@nutanix.com> [Introduce new goto target instead. - Paolo] Signed-off-by: Paolo Bonzini commit 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee Author: Gaosheng Cui Date: Tue Oct 25 21:33:57 2022 +0800 capabilities: fix potential memleak on error path from vfs_getxattr_alloc() In cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to complete the memory allocation of tmpbuf, if we have completed the memory allocation of tmpbuf, but failed to call handler->get(...), there will be a memleak in below logic: |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...) | /* ^^^ alloc for tmpbuf */ |-- value = krealloc(*xattr_value, error + 1, flags) | /* ^^^ alloc memory */ |-- error = handler->get(handler, ...) | /* error! */ |-- *xattr_value = value | /* xattr_value is &tmpbuf (memory leak!) */ So we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it. Cc: stable@vger.kernel.org Fixes: 8db6c34f1dbc ("Introduce v3 namespaced file capabilities") Signed-off-by: Gaosheng Cui Acked-by: Serge Hallyn [PM: subject line and backtrace tweaks] Signed-off-by: Paul Moore commit 8fdf3f6aba7cfa0c0e2bf66ecca7bb5783acd0d6 Author: Radhey Shyam Pandey Date: Wed Oct 26 20:45:24 2022 +0530 net: emaclite: update reset_lock member documentation Instead of generic description, mention what reset_lock actually protects i.e. lock to serialize xmit and tx_timeout execution. Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 696db303e54f7352623d9f640e6c51d8fa9d5588 Author: Maxim Levitsky Date: Tue Oct 25 15:47:32 2022 +0300 KVM: x86: smm: number of GPRs in the SMRAM image depends on the image format On 64 bit host, if the guest doesn't have X86_FEATURE_LM, KVM will access 16 gprs to 32-bit smram image, causing out-ouf-bound ram access. On 32 bit host, the rsm_load_state_64/enter_smm_save_state_64 is compiled out, thus access overflow can't happen. Fixes: b443183a25ab61 ("KVM: x86: Reduce the number of emulator GPRs to '8' for 32-bit KVM") Signed-off-by: Maxim Levitsky Reviewed-by: Sean Christopherson Message-Id: <20221025124741.228045-15-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit ad8f9e69942c7db90758d9d774157e53bce94840 Author: Maxim Levitsky Date: Tue Oct 25 15:47:31 2022 +0300 KVM: x86: emulator: update the emulation mode after CR0 write Update the emulation mode when handling writes to CR0, because toggling CR0.PE switches between Real and Protected Mode, and toggling CR0.PG when EFER.LME=1 switches between Long and Protected Mode. This is likely a benign bug because there is no writeback of state, other than the RIP increment, and when toggling CR0.PE, the CPU has to execute code from a very low memory address. Signed-off-by: Maxim Levitsky Message-Id: <20221025124741.228045-14-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 055f37f84e304e59c046d1accfd8f08462f52c4c Author: Maxim Levitsky Date: Tue Oct 25 15:47:30 2022 +0300 KVM: x86: emulator: update the emulation mode after rsm Update the emulation mode after RSM so that RIP will be correctly written back, because the RSM instruction can switch the CPU mode from 32 bit (or less) to 64 bit. This fixes a guest crash in case the #SMI is received while the guest runs a code from an address > 32 bit. Signed-off-by: Maxim Levitsky Message-Id: <20221025124741.228045-13-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit d087e0f79fa0dd336a9a6b2f79ec23120f5eff73 Author: Maxim Levitsky Date: Tue Oct 25 15:47:29 2022 +0300 KVM: x86: emulator: introduce emulator_recalc_and_set_mode Some instructions update the cpu execution mode, which needs to update the emulation mode. Extract this code, and make assign_eip_far use it. assign_eip_far now reads CS, instead of getting it via a parameter, which is ok, because callers always assign CS to the same value before calling this function. No functional change is intended. Signed-off-by: Maxim Levitsky Message-Id: <20221025124741.228045-12-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 5015bb89b58225f97df6ac44383e7e8c8662c8c9 Author: Maxim Levitsky Date: Tue Oct 25 15:47:28 2022 +0300 KVM: x86: emulator: em_sysexit should update ctxt->mode SYSEXIT is one of the instructions that can change the processor mode, thus ctxt->mode should be updated after it. Note that this is likely a benign bug, because the only problematic mode change is from 32 bit to 64 bit which can lead to truncation of RIP, and it is not possible to do with sysexit, since sysexit running in 32 bit mode will be limited to 32 bit version. Signed-off-by: Maxim Levitsky Message-Id: <20221025124741.228045-11-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 5addaf530995ac203fa46efde0d1ded4c15ff98e Author: Sean Christopherson Date: Thu Oct 13 21:12:34 2022 +0000 KVM: selftests: Mark "guest_saw_irq" as volatile in xen_shinfo_test Tag "guest_saw_irq" as "volatile" to ensure that the compiler will never optimize away lookups. Relying on the compiler thinking that the flag is global and thus might change also works, but it's subtle, less robust, and looks like a bug at first glance, e.g. risks being "fixed" and breaking the test. Make the flag "static" as well since convincing the compiler it's global is no longer necessary. Alternatively, the flag could be accessed with {READ,WRITE}_ONCE(), but literally every access would need the wrappers, and eking out performance isn't exactly top priority for selftests. Signed-off-by: Sean Christopherson Message-Id: <20221013211234.1318131-17-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a51abbbf25317c07cb00b40ae7d04a209d2a3d54 Author: Michal Luczaj Date: Thu Oct 13 21:12:33 2022 +0000 KVM: selftests: Add tests in xen_shinfo_test to detect lock races Tests for races between shinfo_cache (de)activation and hypercall+ioctl() processing. KVM has had bugs where activating the shared info cache multiple times and/or with concurrent users results in lock corruption, NULL pointer dereferences, and other fun. For the timer injection testcase (#22), re-arm the timer until the IRQ is successfully injected. If the timer expires while the shared info is deactivated (invalid), KVM will drop the event. Signed-off-by: Michal Luczaj Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Message-Id: <20221013211234.1318131-16-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 633efc8b3dc96f56f5a57f2a49764853a2fa3f50 Author: Chen Zhongjin Date: Wed Oct 26 10:03:21 2022 +0800 net: dsa: Fix possible memory leaks in dsa_loop_init() kmemleak reported memory leaks in dsa_loop_init(): kmemleak: 12 new suspected memory leaks unreferenced object 0xffff8880138ce000 (size 2048): comm "modprobe", pid 390, jiffies 4295040478 (age 238.976s) backtrace: [<000000006a94f1d5>] kmalloc_trace+0x26/0x60 [<00000000a9c44622>] phy_device_create+0x5d/0x970 [<00000000d0ee2afc>] get_phy_device+0xf3/0x2b0 [<00000000dca0c71f>] __fixed_phy_register.part.0+0x92/0x4e0 [<000000008a834798>] fixed_phy_register+0x84/0xb0 [<0000000055223fcb>] dsa_loop_init+0xa9/0x116 [dsa_loop] ... There are two reasons for memleak in dsa_loop_init(). First, fixed_phy_register() create and register phy_device: fixed_phy_register() get_phy_device() phy_device_create() # freed by phy_device_free() phy_device_register() # freed by phy_device_remove() But fixed_phy_unregister() only calls phy_device_remove(). So the memory allocated in phy_device_create() is leaked. Second, when mdio_driver_register() fail in dsa_loop_init(), it just returns and there is no cleanup for phydevs. Fix the problems by catching the error of mdio_driver_register() in dsa_loop_init(), then calling both fixed_phy_unregister() and phy_device_free() to release phydevs. Also add a function for phydevs cleanup to avoid duplacate. Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver") Signed-off-by: Chen Zhongjin Signed-off-by: David S. Miller commit fb3041d61f6867158088c627c2790f94e208d1ea Author: Masahiro Yamada Date: Fri Oct 28 01:28:39 2022 +0900 kbuild: fix SIGPIPE error message for AR=gcc-ar and AR=llvm-ar Jiri Slaby reported that building the kernel with AR=gcc-ar shows: /usr/bin/ar terminated with signal 13 [Broken pipe] Nathan Chancellor reported the latest AR=llvm-ar shows: error: write on a pipe with no reader The latter occurs since LLVM commit 51b557adc131 ("Add an error message to the default SIGPIPE handler"). The resulting vmlinux is correct, but it is better to silence it. 'head -n1' exits after reading the first line, so the pipe is closed. Use 'sed -n 1p' to eat the stream till the end. Fixes: 321648455061 ("kbuild: use obj-y instead extra-y for objects placed at the head") Link: https://github.com/ClangBuiltLinux/linux/issues/1651 Reported-by: Jiri Slaby Reported-by: Nathan Chancellor Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Tested-by: Nathan Chancellor commit 153695d36ead0ccc4d0256953c751cabf673e621 Author: Zeng Heng Date: Thu Oct 27 20:45:28 2022 +0800 cifs: fix use-after-free caused by invalid pointer `hostname` `hostname` needs to be set as null-pointer after free in `cifs_put_tcp_session` function, or when `cifsd` thread attempts to resolve hostname and reconnect the host, the thread would deref the invalid pointer. Here is one of practical backtrace examples as reference: Task 477 --------------------------- do_mount path_mount do_new_mount vfs_get_tree smb3_get_tree smb3_get_tree_common cifs_smb3_do_mount cifs_mount mount_put_conns cifs_put_tcp_session --> kfree(server->hostname) cifsd --------------------------- kthread cifs_demultiplex_thread cifs_reconnect reconn_set_ipaddr_from_hostname --> if (!server->hostname) --> if (server->hostname[0] == '\0') // !! UAF fault here CIFS: VFS: cifs_mount failed w/return code = -112 mount error(112): Host is down BUG: KASAN: use-after-free in reconn_set_ipaddr_from_hostname+0x2ba/0x310 Read of size 1 at addr ffff888108f35380 by task cifsd/480 CPU: 2 PID: 480 Comm: cifsd Not tainted 6.1.0-rc2-00106-gf705792f89dd-dirty #25 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x68/0x85 print_report+0x16c/0x4a3 kasan_report+0x95/0x190 reconn_set_ipaddr_from_hostname+0x2ba/0x310 __cifs_reconnect.part.0+0x241/0x800 cifs_reconnect+0x65f/0xb60 cifs_demultiplex_thread+0x1570/0x2570 kthread+0x2c5/0x380 ret_from_fork+0x22/0x30 Allocated by task 477: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0x7e/0x90 __kmalloc_node_track_caller+0x52/0x1b0 kstrdup+0x3b/0x70 cifs_get_tcp_session+0xbc/0x19b0 mount_get_conns+0xa9/0x10c0 cifs_mount+0xdf/0x1970 cifs_smb3_do_mount+0x295/0x1660 smb3_get_tree+0x352/0x5e0 vfs_get_tree+0x8e/0x2e0 path_mount+0xf8c/0x1990 do_mount+0xee/0x110 __x64_sys_mount+0x14b/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 477: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x50 __kasan_slab_free+0x10a/0x190 __kmem_cache_free+0xca/0x3f0 cifs_put_tcp_session+0x30c/0x450 cifs_mount+0xf95/0x1970 cifs_smb3_do_mount+0x295/0x1660 smb3_get_tree+0x352/0x5e0 vfs_get_tree+0x8e/0x2e0 path_mount+0xf8c/0x1990 do_mount+0xee/0x110 __x64_sys_mount+0x14b/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888108f35380 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of 16-byte region [ffff888108f35380, ffff888108f35390) The buggy address belongs to the physical page: page:00000000333f8e58 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888108f350e0 pfn:0x108f35 flags: 0x200000000000200(slab|node=0|zone=2) raw: 0200000000000200 0000000000000000 dead000000000122 ffff8881000423c0 raw: ffff888108f350e0 000000008080007a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888108f35280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff888108f35300: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc >ffff888108f35380: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ^ ffff888108f35400: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888108f35480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc Fixes: 7be3248f3139 ("cifs: To match file servers, make sure the server hostname matches") Signed-off-by: Zeng Heng Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 9a8c5b0d061554fedd7dbe894e63aa34d0bac7c4 Author: Theodore Ts'o Date: Thu Oct 27 16:04:36 2022 -0400 ext4: update the backup superblock's at the end of the online resize When expanding a file system using online resize, various fields in the superblock (e.g., s_blocks_count, s_inodes_count, etc.) change. To update the backup superblocks, the online resize uses the function update_backups() in fs/ext4/resize.c. This function was not updating the checksum field in the backup superblocks. This wasn't a big deal previously, because e2fsck didn't care about the checksum field in the backup superblock. (And indeed, update_backups() goes all the way back to the ext3 days, well before we had support for metadata checksums.) However, there is an alternate, more general way of updating superblock fields, ext4_update_primary_sb() in fs/ext4/ioctl.c. This function does check the checksum of the backup superblock, and if it doesn't match will mark the file system as corrupted. That was clearly not the intent, so avoid to aborting the resize when a bad superblock is found. In addition, teach update_backups() to properly update the checksum in the backup superblocks. We will eventually want to unify updapte_backups() with the infrasture in ext4_update_primary_sb(), but that's for another day. Note: The problem has been around for a while; it just didn't really matter until ext4_update_primary_sb() was added by commit bbc605cdb1e1 ("ext4: implement support for get/set fs label"). And it became trivially easy to reproduce after commit 827891a38acc ("ext4: update the s_overhead_clusters in the backup sb's when resizing") in v6.0. Cc: stable@kernel.org # 5.17+ Fixes: bbc605cdb1e1 ("ext4: implement support for get/set fs label") Signed-off-by: Theodore Ts'o commit b2196401949ed2517bec676928f837e6bbd01a65 Merge: 9520b1d09ecea e0ba1a39b8dfe Author: Dave Airlie Date: Fri Oct 28 12:58:33 2022 +1000 Merge tag 'drm-misc-fixes-2022-10-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc3: - Fix HPD on bridge/ps8640. - Stop leaking fences when killing a sched entity. - Avoid uninitialized read in aperture_remove_conflicting_pci_device() Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/ed24cbd2-2bcb-d2c2-46ed-9d8ea9615879@linux.intel.com commit 9520b1d09ecea64c5ed9b90d6f01e10fb3f3ccdd Merge: 200ec44ab7f94 63720a561b3c9 Author: Dave Airlie Date: Fri Oct 28 12:57:18 2022 +1000 Merge tag 'drm-intel-fixes-2022-10-27-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Extend Wa_1607297627 to Alderlake-P (José Roberto de Souza) - Keep PCI autosuspend control 'on' by default on all dGPU (Anshuman Gupta) - Reset frl trained flag before restarting FRL training (Ankit Nautiyal) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y1o+teE2Z11pT1MN@tursulin-desk commit ffa20aa581cf5377fc397b0d0ff9d67ea823629b Author: Taniya Das Date: Wed Oct 19 11:35:35 2022 +0530 clk: qcom: Update the force mem core bit for GPU clocks There are few GPU clocks which are powering up the memories and thus enable the FORCE_MEM_PERIPH always for these clocks to force the periph_on signal to remain active during halt state of the clock. Fixes: a3cc092196ef ("clk: qcom: Add Global Clock controller (GCC) driver for SC7280") Fixes: 3e0f01d6c7e7 ("clk: qcom: Add graphics clock controller driver for SC7280") Signed-off-by: Taniya Das Signed-off-by: Satya Priya Link: https://lore.kernel.org/r/1666159535-6447-1-git-send-email-quic_c_skakit@quicinc.com Signed-off-by: Stephen Boyd commit 774560cf28fe115f106b6176c54ec641491136ac Author: Maxime Ripard Date: Tue Oct 18 15:52:58 2022 +0200 clk: Initialize max_rate in struct clk_rate_request Since commit b46fd8dbe8ad ("clk: Zero the clk_rate_request structure"), the clk_core_init_rate_req() function clears the struct clk_rate_request passed as argument. However, the default value for max_rate isn't 0 but ULONG_MAX, and we end up creating a clk_rate_request instance where the maximum rate is 0. Let's initialize max_rate to ULONG_MAX properly. Fixes: b46fd8dbe8ad ("clk: Zero the clk_rate_request structure") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v1-3-f3ef80518140@cerno.tech Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 2079d029387adfc0cc123f01a6fcf9eb6540ee4d Author: Maxime Ripard Date: Tue Oct 18 15:52:57 2022 +0200 clk: Initialize the clk_rate_request even if clk_core is NULL Since commit c35e84b09776 ("clk: Introduce clk_hw_init_rate_request()"), users that used to initialize their clk_rate_request by initializing their local structure now rely on clk_hw_init_rate_request(). This function is backed by clk_core_init_rate_req(), which will skip the initialization if either the pointer to struct clk_core or to struct clk_rate_request are NULL. However, the core->parent pointer might be NULL because the clock is orphan, and we will thus end up with our local struct clk_rate_request left untouched. And since clk_hw_init_rate_request() doesn't return an error, we will then call a determine_rate variant with that unitialized structure. In order to avoid this, let's clear our clk_rate_request if the pointer to it is valid but the pointer to struct clk_core isn't. Fixes: c35e84b09776 ("clk: Introduce clk_hw_init_rate_request()") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v1-2-f3ef80518140@cerno.tech Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 08a32902a56e1670850fe5d518d8203e9ce354b8 Author: Maxime Ripard Date: Tue Oct 18 15:52:56 2022 +0200 clk: Remove WARN_ON NULL parent in clk_core_init_rate_req() If a clock has CLK_SET_RATE_PARENT, but core->parent is NULL (most likely because it's orphan), callers of clk_core_init_rate_req() will blindly call this function leading to a very verbose warning. Since it's a fairly common situation, let's just remove the WARN_ON but keep the check that prevents us from dereferencing the pointer. Interestingly, it fixes a regression on the Mediatek MT8195 where the GPU would stall during a clk_set_rate for its main clock. We couldn't come up with a proper explanation since the condition is essentially the same. It was then assumed that it could be timing related since printing the warning stacktrace takes a while, but we couldn't replicate the failure by using fairly large (10ms) mdelays. Fixes: 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") Reported-by: AngeloGioacchino Del Regno Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v1-1-f3ef80518140@cerno.tech Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit d14e99bf95510fa2d6affc371ad68161afc1dc8e Author: Andrew Jones Date: Fri Oct 14 17:58:44 2022 +0200 RISC-V: Fix /proc/cpuinfo cpumask warning Commit 78e5a3399421 ("cpumask: fix checking valid cpu range") has started issuing warnings[*] when cpu indices equal to nr_cpu_ids - 1 are passed to cpumask_next* functions. seq_read_iter() and cpuinfo's start and next seq operations implement a pattern like n = cpumask_next(n - 1, mask); show(n); while (1) { ++n; n = cpumask_next(n - 1, mask); if (n >= nr_cpu_ids) break; show(n); } which will issue the warning when reading /proc/cpuinfo. Ensure no warning is generated by validating the cpu index before calling cpumask_next(). [*] Warnings will only appear with DEBUG_PER_CPU_MAPS enabled. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Reviewed-by: Conor Dooley Tested-by: Conor Dooley Acked-by: Yury Norov Link: https://lore.kernel.org/r/20221014155845.1986223-2-ajones@ventanamicro.com/ Fixes: 78e5a3399421 ("cpumask: fix checking valid cpu range") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 952b64d6665c8b6fdd13ba63be7adc3be51641d7 Merge: 9f2ac64d6ca60 aae538cd03bc8 Author: Palmer Dabbelt Date: Thu Oct 27 15:09:50 2022 -0700 Merge patch series "Fix RISC-V toolchain extension support detection" Conor Dooley says: From: Conor Dooley This came up due to a report from Kevin @ kernel-ci, who had been running a mixed configuration of GNU binutils and clang. Their compiler was relatively recent & supports Zicbom but binutils @ 2.35.2 did not. Our current checks for extension support only cover the compiler, but it appears to me that we need to check both the compiler & linker support in case of "pot-luck" configurations that mix different versions of LD,AS,CC etc. Linker support does not seem possible to actually check, since the ISA string is emitted into the object files - so I put in version checks for that. The checks have gotten a bit ugly since 32 & 64 bit support need to be checked independently but ahh well. As I was going, I fell into the trap of there being duplicated checks for CC support in both the Makefile and Kconfig, so as part of renaming the Kconfig symbol to TOOLCHAIN_HAS_FOO, I dropped the extra checks in the Makefile. This has the added advantage of the TOOLCHAIN_HAS_FOO symbol for Zihintpause appearing in .config. I pushed out a version of this that specificly checked for assember support for LKP to test & it looked /okay/ - but I did some more testing today and realised that this is redudant & have since dropped the as check. I tested locally with a fair few different combinations, to try and cover each of AS, LD, CC missing support for the extension. * b4-shazam-merge: riscv: fix detection of toolchain Zihintpause support riscv: fix detection of toolchain Zicbom support Link: https://lore.kernel.org/r/20221006173520.1785507-1-conor@kernel.org Signed-off-by: Palmer Dabbelt commit aae538cd03bc8fc35979653d9180922d146da0ca Author: Conor Dooley Date: Thu Oct 6 18:35:21 2022 +0100 riscv: fix detection of toolchain Zihintpause support It is not sufficient to check if a toolchain supports a particular extension without checking if the linker supports that extension too. For example, Clang 15 supports Zihintpause but GNU bintutils 2.35.2 does not, leading build errors like so: riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zihintpause2p0: Invalid or unknown z ISA extension: 'zihintpause' Add a TOOLCHAIN_HAS_ZIHINTPAUSE which checks if each of the compiler, assembler and linker support the extension. Replace the ifdef in the vdso with one depending on this new symbol. Fixes: 8eb060e10185 ("arch/riscv: add Zihintpause support") Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20221006173520.1785507-3-conor@kernel.org Signed-off-by: Palmer Dabbelt commit b8c86872d1dc171d8f1c137917d6913cae2fa4f2 Author: Conor Dooley Date: Thu Oct 6 18:35:20 2022 +0100 riscv: fix detection of toolchain Zicbom support It is not sufficient to check if a toolchain supports a particular extension without checking if the linker supports that extension too. For example, Clang 15 supports Zicbom but GNU bintutils 2.35.2 does not, leading build errors like so: riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zicbom1p0_zihintpause2p0: Invalid or unknown z ISA extension: 'zicbom' Convert CC_HAS_ZICBOM to TOOLCHAIN_HAS_ZICBOM & check if the linker also supports Zicbom. Reported-by: Kevin Hilman Link: https://github.com/ClangBuiltLinux/linux/issues/1714 Link: https://storage.kernelci.org/next/master/next-20220920/riscv/defconfig+CONFIG_EFI=n/clang-16/logs/kernel.log Fixes: 1631ba1259d6 ("riscv: Add support for non-coherent devices using zicbom extension") Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20221006173520.1785507-2-conor@kernel.org [Palmer: Check for ld-2.38, not 2.39, as 2.38 no longer errors.] Signed-off-by: Palmer Dabbelt commit 9f2ac64d6ca60db99132e08628ac2899f956a0ec Author: Qinglin Pan Date: Sun Oct 9 16:30:50 2022 +0800 riscv: mm: add missing memcpy in kasan_init Hi Atish, It seems that the panic is due to the missing memcpy during kasan_init. Could you please check whether this patch is helpful? When doing kasan_populate, the new allocated base_pud/base_p4d should contain kasan_early_shadow_{pud, p4d}'s content. Add the missing memcpy to avoid page fault when read/write kasan shadow region. Tested on: - qemu with sv57 and CONFIG_KASAN on. - qemu with sv48 and CONFIG_KASAN on. Signed-off-by: Qinglin Pan Tested-by: Atish Patra Fixes: 8fbdccd2b173 ("riscv: mm: Support kasan for sv57") Link: https://lore.kernel.org/r/20221009083050.3814850-1-panqinglin2020@iscas.ac.cn Signed-off-by: Palmer Dabbelt commit 2a5dc663e34eac3688d1a1e512ec43ebbe7a46ec Merge: 247f34f7b8035 10f3f10f20210 Author: Arnd Bergmann Date: Thu Oct 27 22:42:52 2022 +0200 Merge tag 'arm-soc/for-6.1/maintainers-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains MAINTAINERS file updates for Broadcom sections, please pull the following: - Palmer updates the various Broadcom entries to use https instead of git for the git trees listed * tag 'arm-soc/for-6.1/maintainers-fixes' of https://github.com/Broadcom/stblinux: MAINTAINERS: git://github -> https://github.com for broadcom Link: https://lore.kernel.org/r/20221019185514.750684-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 23758867219c8d84c8363316e6dd2f9fd7ae3049 Merge: 7dd257d02eb31 84ce1ca3fe9e1 Author: Linus Torvalds Date: Thu Oct 27 13:36:59 2022 -0700 Merge tag 'net-6.1-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from 802.15.4 (Zigbee et al). Current release - regressions: - ipa: fix bugs in the register conversion for IPA v3.1 and v3.5.1 Current release - new code bugs: - mptcp: fix abba deadlock on fastopen - eth: stmmac: rk3588: allow multiple gmac controllers in one system Previous releases - regressions: - ip: rework the fix for dflt addr selection for connected nexthop - net: couple more fixes for misinterpreting bits in struct page after the signature was added Previous releases - always broken: - ipv6: ensure sane device mtu in tunnels - openvswitch: switch from WARN to pr_warn on a user-triggerable path - ethtool: eeprom: fix null-deref on genl_info in dump - ieee802154: more return code fixes for corner cases in dgram_sendmsg - mac802154: fix link-quality-indicator recording - eth: mlx5: fixes for IPsec, PTP timestamps, OvS and conntrack offload - eth: fec: limit register access on i.MX6UL - eth: bcm4908_enet: update TX stats after actual transmission - can: rcar_canfd: improve IRQ handling for RZ/G2L Misc: - genetlink: piggy back on the newly added resv_op_start to enforce more sanity checks on new commands" * tag 'net-6.1-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits) net: enetc: survive memory pressure without crashing kcm: do not sense pfmemalloc status in kcm_sendpage() net: do not sense pfmemalloc status in skb_append_pagefrags() net/mlx5e: Fix macsec sci endianness at rx sa update net/mlx5e: Fix wrong bitwise comparison usage in macsec_fs_rx_add_rule function net/mlx5e: Fix macsec rx security association (SA) update/delete net/mlx5e: Fix macsec coverity issue at rx sa update net/mlx5: Fix crash during sync firmware reset net/mlx5: Update fw fatal reporter state on PCI handlers successful recover net/mlx5e: TC, Fix cloned flow attr instance dests are not zeroed net/mlx5e: TC, Reject forwarding from internal port to internal port net/mlx5: Fix possible use-after-free in async command interface net/mlx5: ASO, Create the ASO SQ with the correct timestamp format net/mlx5e: Update restore chain id for slow path packets net/mlx5e: Extend SKB room check to include PTP-SQ net/mlx5: DR, Fix matcher disconnect error flow net/mlx5: Wait for firmware to enable CRS before pci_restore_state net/mlx5e: Do not increment ESN when updating IPsec ESN state netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed netdevsim: fix memory leak in nsim_drv_probe() when nsim_dev_resources_register() failed ... commit 7dd257d02eb31391c3cf06874412322c0943b67d Merge: 2eb72d85acf33 594d2a14f2168 Author: Linus Torvalds Date: Thu Oct 27 13:16:36 2022 -0700 Merge tag 'execve-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve fixes from Kees Cook: - Fix an ancient signal action copy race (Bernd Edlinger) - Fix a memory leak in ELF loader, when under memory pressure (Li Zetao) * tag 'execve-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: fs/binfmt_elf: Fix memory leak in load_elf_binary() exec: Copy oldsighand->action under spin-lock commit 7e8436728e22181c3f12a5dbabd35ed3a8b8c593 Author: Zhang Xiaoxu Date: Thu Oct 20 11:20:54 2022 +0800 nfs4: Fix kmemleak when allocate slot failed If one of the slot allocate failed, should cleanup all the other allocated slots, otherwise, the allocated slots will leak: unreferenced object 0xffff8881115aa100 (size 64): comm ""mount.nfs"", pid 679, jiffies 4294744957 (age 115.037s) hex dump (first 32 bytes): 00 cc 19 73 81 88 ff ff 00 a0 5a 11 81 88 ff ff ...s......Z..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000007a4c434a>] nfs4_find_or_create_slot+0x8e/0x130 [<000000005472a39c>] nfs4_realloc_slot_table+0x23f/0x270 [<00000000cd8ca0eb>] nfs40_init_client+0x4a/0x90 [<00000000128486db>] nfs4_init_client+0xce/0x270 [<000000008d2cacad>] nfs4_set_client+0x1a2/0x2b0 [<000000000e593b52>] nfs4_create_server+0x300/0x5f0 [<00000000e4425dd2>] nfs4_try_get_tree+0x65/0x110 [<00000000d3a6176f>] vfs_get_tree+0x41/0xf0 [<0000000016b5ad4c>] path_mount+0x9b3/0xdd0 [<00000000494cae71>] __x64_sys_mount+0x190/0x1d0 [<000000005d56bdec>] do_syscall_64+0x35/0x80 [<00000000687c9ae4>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: abf79bb341bf ("NFS: Add a slot table to struct nfs_client for NFSv4.0 transport blocking") Signed-off-by: Zhang Xiaoxu Signed-off-by: Anna Schumaker commit 038efb6348ce96228f6828354cb809c22a661681 Author: Benjamin Coddington Date: Thu Oct 13 11:58:01 2022 -0400 NFSv4.2: Fixup CLONE dest file size for zero-length count When holding a delegation, the NFS client optimizes away setting the attributes of a file from the GETATTR in the compound after CLONE, and for a zero-length CLONE we will end up setting the inode's size to zero in nfs42_copy_dest_done(). Handle this case by computing the resulting count from the server's reported size after CLONE's GETATTR. Suggested-by: Trond Myklebust Signed-off-by: Benjamin Coddington Fixes: 94d202d5ca39 ("NFSv42: Copy offload should update the file size when appropriate") Signed-off-by: Anna Schumaker commit 8a0fa3ff3b606b55c4edc71ad133e61529b64549 Author: Chuck Lever Date: Sat Oct 8 14:58:29 2022 -0400 SUNRPC: Fix crasher in gss_unwrap_resp_integ() If a zero length is passed to kmalloc() it returns 0x10, which is not a valid address. gss_unwrap_resp_integ() subsequently crashes when it attempts to dereference that pointer. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit f5ea16137a3fa2858620dc9084466491c128535f Author: Benjamin Coddington Date: Wed Oct 19 12:09:18 2022 -0400 NFSv4: Retry LOCK on OLD_STATEID during delegation return There's a small window where a LOCK sent during a delegation return can race with another OPEN on client, but the open stateid has not yet been updated. In this case, the client doesn't handle the OLD_STATEID error from the server and will lose this lock, emitting: "NFS: nfs4_handle_delegation_recall_error: unhandled error -10024". Fix this by sending the task through the nfs4 error handling in nfs4_lock_done() when we may have to reconcile our stateid with what the server believes it to be. For this case, the result is a retry of the LOCK operation with the updated stateid. Reported-by: Gonzalo Siero Humet Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker commit cbdeaee94a415800c65a8c3fa04d9664a8b8fb3a Author: Zhang Xiaoxu Date: Thu Oct 20 11:42:17 2022 +0800 SUNRPC: Fix null-ptr-deref when xps sysfs alloc failed There is a null-ptr-deref when xps sysfs alloc failed: BUG: KASAN: null-ptr-deref in sysfs_do_create_link_sd+0x40/0xd0 Read of size 8 at addr 0000000000000030 by task gssproxy/457 CPU: 5 PID: 457 Comm: gssproxy Not tainted 6.0.0-09040-g02357b27ee03 #9 Call Trace: dump_stack_lvl+0x34/0x44 kasan_report+0xa3/0x120 sysfs_do_create_link_sd+0x40/0xd0 rpc_sysfs_client_setup+0x161/0x1b0 rpc_new_client+0x3fc/0x6e0 rpc_create_xprt+0x71/0x220 rpc_create+0x1d4/0x350 gssp_rpc_create+0xc3/0x160 set_gssp_clnt+0xbc/0x140 write_gssp+0x116/0x1a0 proc_reg_write+0xd6/0x130 vfs_write+0x177/0x690 ksys_write+0xb9/0x150 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 When the xprt_switch sysfs alloc failed, should not add xprt and switch sysfs to it, otherwise, maybe null-ptr-deref; also initialize the 'xps_sysfs' to NULL to avoid oops when destroy it. Fixes: 2a338a543163 ("sunrpc: add a symlink from rpc-client directory to the xprt_switch") Fixes: d408ebe04ac5 ("sunrpc: add add sysfs directory per xprt under each xprt_switch") Fixes: baea99445dd4 ("sunrpc: add xprt_switch direcotry to sunrpc's sysfs") Signed-off-by: Zhang Xiaoxu Signed-off-by: Anna Schumaker commit e59679f2b7e522ecad99974e5636291ffd47c184 Author: Trond Myklebust Date: Sun Oct 16 14:44:33 2022 -0400 NFSv4.1: We must always send RECLAIM_COMPLETE after a reboot Currently, we are only guaranteed to send RECLAIM_COMPLETE if we have open state to recover. Fix the client to always send RECLAIM_COMPLETE after setting up the lease. Fixes: fce5c838e133 ("nfs41: RECLAIM_COMPLETE functionality") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 5d917cba3201e5c25059df96c29252fd99c4f6a7 Author: Trond Myklebust Date: Sun Oct 16 14:44:32 2022 -0400 NFSv4.1: Handle RECLAIM_COMPLETE trunking errors If RECLAIM_COMPLETE sets the NFS4CLNT_BIND_CONN_TO_SESSION flag, then we need to loop back in order to handle it. Fixes: 0048fdd06614 ("NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1ba04394e028ea8b45d92685cc0d6ab582cf7647 Author: Trond Myklebust Date: Sun Oct 16 14:44:31 2022 -0400 NFSv4: Fix a potential state reclaim deadlock If the server reboots while we are engaged in a delegation return, and there is a pNFS layout with return-on-close set, then the current code can end up deadlocking in pnfs_roc() when nfs_inode_set_delegation() tries to return the old delegation. Now that delegreturn actually uses its own copy of the stateid, it should be safe to just always update the delegation stateid in place. Fixes: 078000d02d57 ("pNFS: We want return-on-close to complete when evicting the inode") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit cf0d7e7f4520814f45e1313872ad5777ed504004 Author: Kees Cook Date: Sun Oct 16 21:36:50 2022 -0700 NFS: Avoid memcpy() run-time warning for struct sockaddr overflows The 'nfs_server' and 'mount_server' structures include a union of 'struct sockaddr' (with the older 16 bytes max address size) and 'struct sockaddr_storage' which is large enough to hold all the supported sa_family types (128 bytes max size). The runtime memcpy() buffer overflow checker is seeing attempts to write beyond the 16 bytes as an overflow, but the actual expected size is that of 'struct sockaddr_storage'. Plumb the use of 'struct sockaddr_storage' more completely through-out NFS, which results in adjusting the memcpy() buffers to the correct union members. Avoids this false positive run-time warning under CONFIG_FORTIFY_SOURCE: memcpy: detected field-spanning write (size 28) of single field "&ctx->nfs_server.address" at fs/nfs/namespace.c:178 (size 16) Reported-by: kernel test robot Link: https://lore.kernel.org/all/202210110948.26b43120-yujie.liu@intel.com Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Anna Schumaker commit 121affdf8a940555ceef6ab10a709030e52a4f91 Author: Yushan Zhou Date: Tue Oct 18 12:07:08 2022 +0800 nfs: Remove redundant null checks before kfree Fix the following coccicheck warning: fs/nfs/dir.c:2494:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Yushan Zhou Signed-off-by: Anna Schumaker commit 2eb72d85acf3357e6d7c88febcc0ad553805364b Merge: 7f9a7cd690c7d 72c3ebea375c3 Author: Linus Torvalds Date: Thu Oct 27 12:31:57 2022 -0700 Merge tag 'hardening-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - Fix older Clang vs recent overflow KUnit test additions (Nick Desaulniers, Kees Cook) - Fix kern-doc visibility for overflow helpers (Kees Cook) * tag 'hardening-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: overflow: Refactor test skips for Clang-specific issues overflow: disable failing tests for older clang versions overflow: Fix kern-doc markup for functions commit 7f9a7cd690c7d59cde03027aee9bebd83b4a9dc6 Merge: 200204f56f3b5 de547896aac60 Author: Linus Torvalds Date: Thu Oct 27 12:21:57 2022 -0700 Merge tag 'media/v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: "A bunch of patches addressing issues in the vivid driver and adding new checks in V4L2 to validate the input parameters from some ioctls" * tag 'media/v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: vivid.rst: loop_video is set on the capture devnode media: vivid: set num_in/outputs to 0 if not supported media: vivid: drop GFP_DMA32 media: vivid: fix control handler mutex deadlock media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced' media: v4l2-dv-timings: add sanity checks for blanking values media: vivid: dev->bitmap_cap wasn't freed in all cases media: vivid: s_fbuf: add more sanity checks commit b6bcdc9f6b8321e4471ff45413b6410e16762a8d Author: Ryan Roberts Date: Thu Oct 27 13:09:45 2022 +0100 KVM: arm64: Fix bad dereference on MTE-enabled systems enter_exception64() performs an MTE check, which involves dereferencing vcpu->kvm. While vcpu has already been fixed up to be a HYP VA pointer, kvm is still a pointer in the kernel VA space. This only affects nVHE configurations with MTE enabled, as in other cases, the pointer is either valid (VHE) or not dereferenced (!MTE). Fix this by first converting kvm to a HYP VA pointer. Fixes: ea7fc1bb1cd1 ("KVM: arm64: Introduce MTE VM feature") Signed-off-by: Ryan Roberts Reviewed-by: Steven Price [maz: commit message tidy-up] Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221027120945.29679-1-ryan.roberts@arm.com commit 200204f56f3b5a464c719ddb930a1a2557562dda Merge: b229b6ca5abbd ccd30a476f8e8 Author: Linus Torvalds Date: Thu Oct 27 11:44:18 2022 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt fix from Eric Biggers: "Fix a memory leak that was introduced by a change that went into -rc1" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: fix keyring memory leak on mount failure commit 84ce1ca3fe9e1249bf21176ff162200f1c4e5ed1 Author: Vladimir Oltean Date: Thu Oct 27 21:29:25 2022 +0300 net: enetc: survive memory pressure without crashing Under memory pressure, enetc_refill_rx_ring() may fail, and when called during the enetc_open() -> enetc_setup_rxbdr() procedure, this is not checked for. An extreme case of memory pressure will result in exactly zero buffers being allocated for the RX ring, and in such a case it is expected that hardware drops all RX packets due to lack of buffers. This does not happen, because the reset-default value of the consumer and produces index is 0, and this makes the ENETC think that all buffers have been initialized and that it owns them (when in reality none were). The hardware guide explains this best: | Configure the receive ring producer index register RBaPIR with a value | of 0. The producer index is initially configured by software but owned | by hardware after the ring has been enabled. Hardware increments the | index when a frame is received which may consume one or more BDs. | Hardware is not allowed to increment the producer index to match the | consumer index since it is used to indicate an empty condition. The ring | can hold at most RBLENR[LENGTH]-1 received BDs. | | Configure the receive ring consumer index register RBaCIR. The | consumer index is owned by software and updated during operation of the | of the BD ring by software, to indicate that any receive data occupied | in the BD has been processed and it has been prepared for new data. | - If consumer index and producer index are initialized to the same | value, it indicates that all BDs in the ring have been prepared and | hardware owns all of the entries. | - If consumer index is initialized to producer index plus N, it would | indicate N BDs have been prepared. Note that hardware cannot start if | only a single buffer is prepared due to the restrictions described in | (2). | - Software may write consumer index to match producer index anytime | while the ring is operational to indicate all received BDs prior have | been processed and new BDs prepared for hardware. Normally, the value of rx_ring->rcir (consumer index) is brought in sync with the rx_ring->next_to_use software index, but this only happens if page allocation ever succeeded. When PI==CI==0, the hardware appears to receive frames and write them to DMA address 0x0 (?!), then set the READY bit in the BD. The enetc_clean_rx_ring() function (and its XDP derivative) is naturally not prepared to handle such a condition. It will attempt to process those frames using the rx_swbd structure associated with index i of the RX ring, but that structure is not fully initialized (enetc_new_page() does all of that). So what happens next is undefined behavior. To operate using no buffer, we must initialize the CI to PI + 1, which will block the hardware from advancing the CI any further, and drop everything. The issue was seen while adding support for zero-copy AF_XDP sockets, where buffer memory comes from user space, which can even decide to supply no buffers at all (example: "xdpsock --txonly"). However, the bug is present also with the network stack code, even though it would take a very determined person to trigger a page allocation failure at the perfect time (a series of ifup/ifdown under memory pressure should eventually reproduce it given enough retries). Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20221027182925.3256653-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 3c6bf6bddc84888c0ce163b09dee0ddd23b5172a Author: Yang Yingliang Date: Mon Oct 24 22:00:28 2022 +0800 fbdev: cyber2000fb: fix missing pci_disable_device() Add missing pci_disable_device() in error path of probe() and remove() path. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yang Yingliang Signed-off-by: Helge Deller commit ee15e1f38dc201fa7d63c13aa258b728dce27f4d Author: Eric Dumazet Date: Thu Oct 27 04:06:37 2022 +0000 kcm: do not sense pfmemalloc status in kcm_sendpage() Similar to changes done in TCP in blamed commit. We should not sense pfmemalloc status in sendpage() methods. Fixes: 326140063946 ("tcp: TX zerocopy should not sense pfmemalloc status") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20221027040637.1107703-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 228ebc41dfab5b5d34cd76835ddb0ca8ee12f513 Author: Eric Dumazet Date: Thu Oct 27 04:03:46 2022 +0000 net: do not sense pfmemalloc status in skb_append_pagefrags() skb_append_pagefrags() is used by af_unix and udp sendpage() implementation so far. In commit 326140063946 ("tcp: TX zerocopy should not sense pfmemalloc status") we explained why we should not sense pfmemalloc status for pages owned by user space. We should also use skb_fill_page_desc_noacc() in skb_append_pagefrags() to avoid following KCSAN report: BUG: KCSAN: data-race in lru_add_fn / skb_append_pagefrags write to 0xffffea00058fc1c8 of 8 bytes by task 17319 on cpu 0: __list_add include/linux/list.h:73 [inline] list_add include/linux/list.h:88 [inline] lruvec_add_folio include/linux/mm_inline.h:323 [inline] lru_add_fn+0x327/0x410 mm/swap.c:228 folio_batch_move_lru+0x1e1/0x2a0 mm/swap.c:246 lru_add_drain_cpu+0x73/0x250 mm/swap.c:669 lru_add_drain+0x21/0x60 mm/swap.c:773 free_pages_and_swap_cache+0x16/0x70 mm/swap_state.c:311 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:256 [inline] tlb_flush_mmu+0x5b2/0x640 mm/mmu_gather.c:263 tlb_finish_mmu+0x86/0x100 mm/mmu_gather.c:363 exit_mmap+0x190/0x4d0 mm/mmap.c:3098 __mmput+0x27/0x1b0 kernel/fork.c:1185 mmput+0x3d/0x50 kernel/fork.c:1207 copy_process+0x19fc/0x2100 kernel/fork.c:2518 kernel_clone+0x166/0x550 kernel/fork.c:2671 __do_sys_clone kernel/fork.c:2812 [inline] __se_sys_clone kernel/fork.c:2796 [inline] __x64_sys_clone+0xc3/0xf0 kernel/fork.c:2796 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffffea00058fc1c8 of 8 bytes by task 17325 on cpu 1: page_is_pfmemalloc include/linux/mm.h:1817 [inline] __skb_fill_page_desc include/linux/skbuff.h:2432 [inline] skb_fill_page_desc include/linux/skbuff.h:2453 [inline] skb_append_pagefrags+0x210/0x600 net/core/skbuff.c:3974 unix_stream_sendpage+0x45e/0x990 net/unix/af_unix.c:2338 kernel_sendpage+0x184/0x300 net/socket.c:3561 sock_sendpage+0x5a/0x70 net/socket.c:1054 pipe_to_sendpage+0x128/0x160 fs/splice.c:361 splice_from_pipe_feed fs/splice.c:415 [inline] __splice_from_pipe+0x222/0x4d0 fs/splice.c:559 splice_from_pipe fs/splice.c:594 [inline] generic_splice_sendpage+0x89/0xc0 fs/splice.c:743 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0x80/0xa0 fs/splice.c:931 splice_direct_to_actor+0x305/0x620 fs/splice.c:886 do_splice_direct+0xfb/0x180 fs/splice.c:974 do_sendfile+0x3bf/0x910 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64 fs/read_write.c:1309 [inline] __x64_sys_sendfile64+0x10c/0x150 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x0000000000000000 -> 0xffffea00058fc188 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 17325 Comm: syz-executor.0 Not tainted 6.1.0-rc1-syzkaller-00158-g440b7895c990-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Fixes: 326140063946 ("tcp: TX zerocopy should not sense pfmemalloc status") Reported-by: syzbot Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20221027040346.1104204-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 12ba40ba3dc3a28ad579b7de2202ab6419da304a Author: Raed Salem Date: Wed Oct 26 14:51:53 2022 +0100 net/mlx5e: Fix macsec sci endianness at rx sa update The cited commit at rx sa update operation passes the sci object attribute, in the wrong endianness and not as expected by the HW effectively create malformed hw sa context in case of update rx sa consequently, HW produces unexpected MACsec packets which uses this sa. Fix by passing sci to create macsec object with the correct endianness, while at it add __force u64 to prevent sparse check error of type "sparse: error: incorrect type in assignment". Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-16-saeed@kernel.org Signed-off-by: Jakub Kicinski commit d550956458a83cf87cb8fe24862f3340065c62c1 Author: Raed Salem Date: Wed Oct 26 14:51:52 2022 +0100 net/mlx5e: Fix wrong bitwise comparison usage in macsec_fs_rx_add_rule function The cited commit produces a sparse check error of type "sparse: error: restricted __be64 degrades to integer". The offending line wrongly did a bitwise operation between two different storage types one of 64 bit when the other smaller side is 16 bit which caused the above sparse error, furthermore bitwise operation usage here is wrong in the first place as the constant MACSEC_PORT_ES is not a bitwise field. Fix by using the right mask to get the lower 16 bit if the sci number, and use comparison operator '==' instead of bitwise '&' operator. Fixes: 3b20949cb21b ("net/mlx5e: Add MACsec RX steering rules") Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-15-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 74573e38e933a6dbb11691bea535c54d683cd06e Author: Raed Salem Date: Wed Oct 26 14:51:51 2022 +0100 net/mlx5e: Fix macsec rx security association (SA) update/delete The cited commit adds the support for update/delete MACsec Rx SA, naturally, these operations need to check if the SA in question exists to update/delete the SA and return error code otherwise, however they do just the opposite i.e. return with error if the SA exists Fix by change the check to return error in case the SA in question does not exist, adjust error message and code accordingly. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-14-saeed@kernel.org Signed-off-by: Jakub Kicinski commit d3ecf037569c64490a5cae5a1ac4605f4bedc607 Author: Raed Salem Date: Wed Oct 26 14:51:50 2022 +0100 net/mlx5e: Fix macsec coverity issue at rx sa update The cited commit at update rx sa operation passes object attributes to MACsec object create function without initializing/setting all attributes fields leaving some of them with garbage values, therefore violating the implicit assumption at create object function, which assumes that all input object attributes fields are set. Fix by initializing the object attributes struct to zero, thus leaving unset fields with the legal zero value. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Lior Nahmanson Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-13-saeed@kernel.org Signed-off-by: Jakub Kicinski commit aefb62a9988749703435e941704624949a80a2a9 Author: Suresh Devarakonda Date: Wed Oct 26 14:51:49 2022 +0100 net/mlx5: Fix crash during sync firmware reset When setting Bluefield to DPU NIC mode using mlxconfig tool + sync firmware reset flow, we run into scenario where the host was not eswitch manager at the time of mlx5 driver load but becomes eswitch manager after the sync firmware reset flow. This results in null pointer access of mpfs structure during mac filter add. This change prevents null pointer access but mpfs table entries will not be added. Fixes: 5ec697446f46 ("net/mlx5: Add support for devlink reload action fw activate") Signed-off-by: Suresh Devarakonda Reviewed-by: Moshe Shemesh Reviewed-by: Bodong Wang Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-12-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 416ef713631937cf5452476a7f1041a3ae7b06c6 Author: Roy Novich Date: Wed Oct 26 14:51:48 2022 +0100 net/mlx5: Update fw fatal reporter state on PCI handlers successful recover Update devlink health fw fatal reporter state to "healthy" is needed by strictly calling devlink_health_reporter_state_update() after recovery was done by PCI error handler. This is needed when fw_fatal reporter was triggered due to PCI error. Poll health is called and set reporter state to error. Health recovery failed (since EEH didn't re-enable the PCI). PCI handlers keep on recover flow and succeed later without devlink acknowledgment. Fix this by adding devlink state update at the end of the PCI handler recovery process. Fixes: 6181e5cb752e ("devlink: add support for reporter recovery completion") Signed-off-by: Roy Novich Reviewed-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-11-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 94d651739e17b0ee9b556e60f206fe538d06dc05 Author: Roi Dayan Date: Wed Oct 26 14:51:47 2022 +0100 net/mlx5e: TC, Fix cloned flow attr instance dests are not zeroed On multi table split the driver creates a new attr instance with data being copied from prev attr instance zeroing action flags. Also need to reset dests properties to avoid incorrect dests per attr. Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-10-saeed@kernel.org Signed-off-by: Jakub Kicinski commit f382a2413dae8c855226a72600812a4b37432c48 Author: Ariel Levkovich Date: Wed Oct 26 14:51:46 2022 +0100 net/mlx5e: TC, Reject forwarding from internal port to internal port Reject TC rules that forward from internal port to internal port as it is not supported. This include rules that are explicitly have internal port as the filter device as well as rules that apply on tunnel interfaces as the route device for the tunnel interface can be an internal port. Fixes: 27484f7170ed ("net/mlx5e: Offload tc rules that redirect to ovs internal port") Signed-off-by: Ariel Levkovich Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-9-saeed@kernel.org Signed-off-by: Jakub Kicinski commit bacd22df95147ed673bec4692ab2d4d585935241 Author: Tariq Toukan Date: Wed Oct 26 14:51:45 2022 +0100 net/mlx5: Fix possible use-after-free in async command interface mlx5_cmd_cleanup_async_ctx should return only after all its callback handlers were completed. Before this patch, the below race between mlx5_cmd_cleanup_async_ctx and mlx5_cmd_exec_cb_handler was possible and lead to a use-after-free: 1. mlx5_cmd_cleanup_async_ctx is called while num_inflight is 2 (i.e. elevated by 1, a single inflight callback). 2. mlx5_cmd_cleanup_async_ctx decreases num_inflight to 1. 3. mlx5_cmd_exec_cb_handler is called, decreases num_inflight to 0 and is about to call wake_up(). 4. mlx5_cmd_cleanup_async_ctx calls wait_event, which returns immediately as the condition (num_inflight == 0) holds. 5. mlx5_cmd_cleanup_async_ctx returns. 6. The caller of mlx5_cmd_cleanup_async_ctx frees the mlx5_async_ctx object. 7. mlx5_cmd_exec_cb_handler goes on and calls wake_up() on the freed object. Fix it by syncing using a completion object. Mark it completed when num_inflight reaches 0. Trace: BUG: KASAN: use-after-free in do_raw_spin_lock+0x23d/0x270 Read of size 4 at addr ffff888139cd12f4 by task swapper/5/0 CPU: 5 PID: 0 Comm: swapper/5 Not tainted 6.0.0-rc3_for_upstream_debug_2022_08_30_13_10 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x7d print_report.cold+0x2d5/0x684 ? do_raw_spin_lock+0x23d/0x270 kasan_report+0xb1/0x1a0 ? do_raw_spin_lock+0x23d/0x270 do_raw_spin_lock+0x23d/0x270 ? rwlock_bug.part.0+0x90/0x90 ? __delete_object+0xb8/0x100 ? lock_downgrade+0x6e0/0x6e0 _raw_spin_lock_irqsave+0x43/0x60 ? __wake_up_common_lock+0xb9/0x140 __wake_up_common_lock+0xb9/0x140 ? __wake_up_common+0x650/0x650 ? destroy_tis_callback+0x53/0x70 [mlx5_core] ? kasan_set_track+0x21/0x30 ? destroy_tis_callback+0x53/0x70 [mlx5_core] ? kfree+0x1ba/0x520 ? do_raw_spin_unlock+0x54/0x220 mlx5_cmd_exec_cb_handler+0x136/0x1a0 [mlx5_core] ? mlx5_cmd_cleanup_async_ctx+0x220/0x220 [mlx5_core] ? mlx5_cmd_cleanup_async_ctx+0x220/0x220 [mlx5_core] mlx5_cmd_comp_handler+0x65a/0x12b0 [mlx5_core] ? dump_command+0xcc0/0xcc0 [mlx5_core] ? lockdep_hardirqs_on_prepare+0x400/0x400 ? cmd_comp_notifier+0x7e/0xb0 [mlx5_core] cmd_comp_notifier+0x7e/0xb0 [mlx5_core] atomic_notifier_call_chain+0xd7/0x1d0 mlx5_eq_async_int+0x3ce/0xa20 [mlx5_core] atomic_notifier_call_chain+0xd7/0x1d0 ? irq_release+0x140/0x140 [mlx5_core] irq_int_handler+0x19/0x30 [mlx5_core] __handle_irq_event_percpu+0x1f2/0x620 handle_irq_event+0xb2/0x1d0 handle_edge_irq+0x21e/0xb00 __common_interrupt+0x79/0x1a0 common_interrupt+0x78/0xa0 asm_common_interrupt+0x22/0x40 RIP: 0010:default_idle+0x42/0x60 Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 0f b6 14 11 38 d0 7c 04 84 d2 75 14 8b 05 eb 47 22 02 85 c0 7e 07 0f 00 2d e0 9f 48 00 fb f4 48 c7 c7 80 08 7f 85 e8 d1 d3 3e fe eb de 66 66 2e 0f 1f 84 00 RSP: 0018:ffff888100dbfdf0 EFLAGS: 00000242 RAX: 0000000000000001 RBX: ffffffff84ecbd48 RCX: 1ffffffff0afe110 RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff835cc9bc RBP: 0000000000000005 R08: 0000000000000001 R09: ffff88881dec4ac3 R10: ffffed1103bd8958 R11: 0000017d0ca571c9 R12: 0000000000000005 R13: ffffffff84f024e0 R14: 0000000000000000 R15: dffffc0000000000 ? default_idle_call+0xcc/0x450 default_idle_call+0xec/0x450 do_idle+0x394/0x450 ? arch_cpu_idle_exit+0x40/0x40 ? do_idle+0x17/0x450 cpu_startup_entry+0x19/0x20 start_secondary+0x221/0x2b0 ? set_cpu_sibling_map+0x2070/0x2070 secondary_startup_64_no_verify+0xcd/0xdb Allocated by task 49502: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 kvmalloc_node+0x48/0xe0 mlx5e_bulk_async_init+0x35/0x110 [mlx5_core] mlx5e_tls_priv_tx_list_cleanup+0x84/0x3e0 [mlx5_core] mlx5e_ktls_cleanup_tx+0x38f/0x760 [mlx5_core] mlx5e_cleanup_nic_tx+0xa7/0x100 [mlx5_core] mlx5e_detach_netdev+0x1ca/0x2b0 [mlx5_core] mlx5e_suspend+0xdb/0x140 [mlx5_core] mlx5e_remove+0x89/0x190 [mlx5_core] auxiliary_bus_remove+0x52/0x70 device_release_driver_internal+0x40f/0x650 driver_detach+0xc1/0x180 bus_remove_driver+0x125/0x2f0 auxiliary_driver_unregister+0x16/0x50 mlx5e_cleanup+0x26/0x30 [mlx5_core] cleanup+0xc/0x4e [mlx5_core] __x64_sys_delete_module+0x2b5/0x450 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 49502: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x11d/0x1b0 kfree+0x1ba/0x520 mlx5e_tls_priv_tx_list_cleanup+0x2e7/0x3e0 [mlx5_core] mlx5e_ktls_cleanup_tx+0x38f/0x760 [mlx5_core] mlx5e_cleanup_nic_tx+0xa7/0x100 [mlx5_core] mlx5e_detach_netdev+0x1ca/0x2b0 [mlx5_core] mlx5e_suspend+0xdb/0x140 [mlx5_core] mlx5e_remove+0x89/0x190 [mlx5_core] auxiliary_bus_remove+0x52/0x70 device_release_driver_internal+0x40f/0x650 driver_detach+0xc1/0x180 bus_remove_driver+0x125/0x2f0 auxiliary_driver_unregister+0x16/0x50 mlx5e_cleanup+0x26/0x30 [mlx5_core] cleanup+0xc/0x4e [mlx5_core] __x64_sys_delete_module+0x2b5/0x450 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: e355477ed9e4 ("net/mlx5: Make mlx5_cmd_exec_cb() a safe API") Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-8-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 0f3caaa2c6fbf9f892bd235c9dce9eb551f8d815 Author: Saeed Mahameed Date: Wed Oct 26 14:51:44 2022 +0100 net/mlx5: ASO, Create the ASO SQ with the correct timestamp format mlx5 SQs must select the timestamp format explicitly according to the active clock mode, select the current active timestamp mode so ASO SQ create will succeed. This fixes the following error prints when trying to create ipsec ASO SQ while the timestamp format is real time mode. mlx5_cmd_out_err:778:(pid 34874): CREATE_SQ(0x904) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0xd61c0b), err(-22) mlx5_aso_create_sq:285:(pid 34874): Failed to open aso wq sq, err=-22 mlx5e_ipsec_init:436:(pid 34874): IPSec initialization failed, -22 Fixes: cdd04f4d4d71 ("net/mlx5: Add support to create SQ and CQ for ASO") Signed-off-by: Saeed Mahameed Reported-by: Leon Romanovsky Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-7-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 8dc47c0527c1586e3ebe0efd323f1d8abb181c77 Author: Paul Blakey Date: Wed Oct 26 14:51:43 2022 +0100 net/mlx5e: Update restore chain id for slow path packets Currently encap slow path rules just forward to software without setting the chain id miss register, so driver doesn't restore the chain, and packets hitting this rule will restart from tc chain 0 instead of continuing to the chain the encap rule was on. Fix this by setting the chain id miss register to the chain id mapping. Fixes: 8f1e0b97cc70 ("net/mlx5: E-Switch, Mark miss packets with new chain id mapping") Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-6-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 19b43a432e3e47db656a8269a74b50aef826950c Author: Aya Levin Date: Wed Oct 26 14:51:42 2022 +0100 net/mlx5e: Extend SKB room check to include PTP-SQ When tx_port_ts is set, the driver diverts all UPD traffic over PTP port to a dedicated PTP-SQ. The SKBs are cached until the wire-CQE arrives. When the packet size is greater then MTU, the firmware might drop it and the packet won't be transmitted to the wire, hence the wire-CQE won't reach the driver. In this case the SKBs are accumulated in the SKB fifo. Add room check to consider the PTP-SQ SKB fifo, when the SKB fifo is full, driver stops the queue resulting in a TX timeout. Devlink TX-reporter can recover from it. Fixes: 1880bc4e4a96 ("net/mlx5e: Add TX port timestamp support") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-5-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 4ea9891d66410da5030dababb4b825d8e41cd7bb Author: Rongwei Liu Date: Wed Oct 26 14:51:41 2022 +0100 net/mlx5: DR, Fix matcher disconnect error flow When 2nd flow rules arrives, it will merge together with the 1st one if matcher criteria is the same. If merge fails, driver will rollback the merge contents, and reject the 2nd rule. At rollback stage, matcher can't be disconnected unconditionally, otherise the 1st rule can't be hit anymore. Add logic to check if the matcher should be disconnected or not. Fixes: cc2295cd54e4 ("net/mlx5: DR, Improve steering for empty or RX/TX-only matchers") Signed-off-by: Rongwei Liu Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-4-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 212b4d7251c169f87fa734e79bdec8dd413be5cf Author: Moshe Shemesh Date: Wed Oct 26 14:51:40 2022 +0100 net/mlx5: Wait for firmware to enable CRS before pci_restore_state After firmware reset driver should verify firmware already enabled CRS and became responsive to pci config cycles before restoring pci state. Fix that by waiting till device_id is readable through PCI again. Fixes: eabe8e5e88f5 ("net/mlx5: Handle sync reset now event") Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-3-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 888be6b279b7257b5f6e4c9527675bff0a335596 Author: Hyong Youb Kim Date: Wed Oct 26 14:51:39 2022 +0100 net/mlx5e: Do not increment ESN when updating IPsec ESN state An offloaded SA stops receiving after about 2^32 + replay_window packets. For example, when SA reaches , all subsequent packets get dropped with SA-icv-failure (integrity_failed). To reproduce the bug: - ConnectX-6 Dx with crypto enabled (FW 22.30.1004) - ipsec.conf: nic-offload = yes replay-window = 32 esn = yes salifetime=24h - Run netperf for a long time to send more than 2^32 packets netperf -H -t TCP_STREAM -l 20000 When 2^32 + replay_window packets are received, the replay window moves from the 2nd half of subspace (overlap=1) to the 1st half (overlap=0). The driver then updates the 'esn' value in NIC (i.e. seq_hi) as follows. seq_hi = xfrm_replay_seqhi(seq_bottom) new esn in NIC = seq_hi + 1 The +1 increment is wrong, as seq_hi already contains the correct seq_hi. For example, when seq_hi=1, the driver actually tells NIC to use seq_hi=2 (esn). This incorrect esn value causes all subsequent packets to fail integrity checks (SA-icv-failure). So, do not increment. Fixes: cb01008390bb ("net/mlx5: IPSec, Add support for ESN") Signed-off-by: Hyong Youb Kim Acked-by: Leon Romanovsky Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20221026135153.154807-2-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 9ddcead06de0ebec100f7c421735ac814d09a23a Merge: cf2010aa1c739 a6aa8d0ce2cfb Author: Jakub Kicinski Date: Thu Oct 27 10:47:31 2022 -0700 Merge branch 'fix-some-issues-in-netdevsim-driver' Zhengchao Shao says: ==================== fix some issues in netdevsim driver When strace tool is used to perform memory injection, memory leaks and files not removed issues are found. Fix them. ==================== Link: https://lore.kernel.org/r/20221026014642.116261-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit a6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba Author: Zhengchao Shao Date: Wed Oct 26 09:46:42 2022 +0800 netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed Remove dir in nsim_dev_debugfs_init() when creating ports dir failed. Otherwise, the netdevsim device will not be created next time. Kernel reports an error: debugfs: Directory 'netdevsim1' with parent 'netdevsim' already present! Fixes: ab1d0cc004d7 ("netdevsim: change debugfs tree topology") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 6b1da9f7126f05e857da6db24c6a04aa7974d644 Author: Zhengchao Shao Date: Wed Oct 26 09:46:41 2022 +0800 netdevsim: fix memory leak in nsim_drv_probe() when nsim_dev_resources_register() failed If some items in nsim_dev_resources_register() fail, memory leak will occur. The following is the memory leak information. unreferenced object 0xffff888074c02600 (size 128): comm "echo", pid 8159, jiffies 4294945184 (age 493.530s) hex dump (first 32 bytes): 40 47 ea 89 ff ff ff ff 01 00 00 00 00 00 00 00 @G.............. ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ backtrace: [<0000000011a31c98>] kmalloc_trace+0x22/0x60 [<0000000027384c69>] devl_resource_register+0x144/0x4e0 [<00000000a16db248>] nsim_drv_probe+0x37a/0x1260 [<000000007d1f448c>] really_probe+0x20b/0xb10 [<00000000c416848a>] __driver_probe_device+0x1b3/0x4a0 [<00000000077e0351>] driver_probe_device+0x49/0x140 [<0000000054f2465a>] __device_attach_driver+0x18c/0x2a0 [<000000008538f359>] bus_for_each_drv+0x151/0x1d0 [<0000000038e09747>] __device_attach+0x1c9/0x4e0 [<00000000dd86e533>] bus_probe_device+0x1d5/0x280 [<00000000839bea35>] device_add+0xae0/0x1cb0 [<000000009c2abf46>] new_device_store+0x3b6/0x5f0 [<00000000fb823d7f>] bus_attr_store+0x72/0xa0 [<000000007acc4295>] sysfs_kf_write+0x106/0x160 [<000000005f50cb4d>] kernfs_fop_write_iter+0x3a8/0x5a0 [<0000000075eb41bf>] vfs_write+0x8f0/0xc80 Fixes: 37923ed6b8ce ("netdevsim: Add simple FIB resource controller via devlink") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit cf2010aa1c739bab067cbc90b690d28eaa0b47da Author: Zhengchao Shao Date: Wed Oct 26 09:54:05 2022 +0800 netdevsim: fix memory leak in nsim_bus_dev_new() If device_register() failed in nsim_bus_dev_new(), the value of reference in nsim_bus_dev->dev is 1. obj->name in nsim_bus_dev->dev will not be released. unreferenced object 0xffff88810352c480 (size 16): comm "echo", pid 5691, jiffies 4294945921 (age 133.270s) hex dump (first 16 bytes): 6e 65 74 64 65 76 73 69 6d 31 00 00 00 00 00 00 netdevsim1...... backtrace: [<000000005e2e5e26>] __kmalloc_node_track_caller+0x3a/0xb0 [<0000000094ca4fc8>] kvasprintf+0xc3/0x160 [<00000000aad09bcc>] kvasprintf_const+0x55/0x180 [<000000009bac868d>] kobject_set_name_vargs+0x56/0x150 [<000000007c1a5d70>] dev_set_name+0xbb/0xf0 [<00000000ad0d126b>] device_add+0x1f8/0x1cb0 [<00000000c222ae24>] new_device_store+0x3b6/0x5e0 [<0000000043593421>] bus_attr_store+0x72/0xa0 [<00000000cbb1833a>] sysfs_kf_write+0x106/0x160 [<00000000d0dedb8a>] kernfs_fop_write_iter+0x3a8/0x5a0 [<00000000770b66e2>] vfs_write+0x8f0/0xc80 [<0000000078bb39be>] ksys_write+0x106/0x210 [<00000000005e55a4>] do_syscall_64+0x35/0x80 [<00000000eaa40bbc>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 40e4fe4ce115 ("netdevsim: move device registration and related code to bus.c") Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20221026015405.128795-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit de90869a1b8bfe4326077feaef7473add95e0446 Merge: ef3556ee16c68 c3c06c61890da Author: Jakub Kicinski Date: Thu Oct 27 10:30:41 2022 -0700 Merge tag 'linux-can-fixes-for-6.1-20221027' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-10-27 Anssi Hannula fixes the use of the completions in the kvaser_usb driver. Biju Das contributes 2 patches for the rcar_canfd driver. A IRQ storm that can be triggered by high CAN bus load and channel specific IRQ handlers are fixed. Yang Yingliang fixes the j1939 transport protocol by moving a kfree_skb() out of a spin_lock_irqsave protected section. * tag 'linux-can-fixes-for-6.1-20221027' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: j1939: transport: j1939_session_skb_drop_old(): spin_unlock_irqrestore() before kfree_skb() can: rcar_canfd: fix channel specific IRQ handling for RZ/G2L can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive can: kvaser_usb: Fix possible completions during init_completion ==================== Link: https://lore.kernel.org/r/20221027114356.1939821-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit ef3556ee16c68735ec69bd08df41d1cd83b14ad3 Author: Rafał Miłecki Date: Thu Oct 27 13:24:30 2022 +0200 net: broadcom: bcm4908_enet: update TX stats after actual transmission Queueing packets doesn't guarantee their transmission. Update TX stats after hardware confirms consuming submitted data. This also fixes a possible race and NULL dereference. bcm4908_enet_start_xmit() could try to access skb after freeing it in the bcm4908_enet_poll_tx(). Reported-by: Florian Fainelli Fixes: 4feffeadbcb2e ("net: broadcom: bcm4908enet: add BCM4908 controller driver") Signed-off-by: Rafał Miłecki Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20221027112430.8696-1-zajec5@gmail.com Signed-off-by: Jakub Kicinski commit bc520f5e251e5b3ddc3a1b728f00732d720011e2 Merge: ce48ebdd56513 bac0f937c343d Author: Jakub Kicinski Date: Thu Oct 27 10:16:56 2022 -0700 Merge branch 'ip-rework-the-fix-for-dflt-addr-selection-for-connected-nexthop' Nicolas Dichtel says: ==================== ip: rework the fix for dflt addr selection for connected nexthop" This series reworks the fix that is reverted in the second commit. As Julian explained, nhc_scope is related to nhc_gw, it's not the scope of the route. ==================== Link: https://lore.kernel.org/r/20221020100952.8748-1-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski commit bac0f937c343d651874f83b265ca8f5070ed4f06 Author: Nicolas Dichtel Date: Thu Oct 20 12:09:52 2022 +0200 nh: fix scope used to find saddr when adding non gw nh As explained by Julian, fib_nh_scope is related to fib_nh_gw4, but fib_info_update_nhc_saddr() needs the scope of the route, which is the scope "before" fib_nh_scope, ie fib_nh_scope - 1. This patch fixes the problem described in commit 747c14307214 ("ip: fix dflt addr selection for connected nexthop"). Fixes: 597cfe4fc339 ("nexthop: Add support for IPv4 nexthops") Link: https://lore.kernel.org/netdev/6c8a44ba-c2d5-cdf-c5c7-5baf97cba38@ssi.bg/ Signed-off-by: Nicolas Dichtel Reviewed-by: Julian Anastasov Signed-off-by: Jakub Kicinski commit e021c329ee198f1cd0cb3855f221137dda49256a Author: Nicolas Dichtel Date: Thu Oct 20 12:09:51 2022 +0200 Revert "ip: fix dflt addr selection for connected nexthop" This reverts commit 747c14307214b55dbd8250e1ab44cad8305756f1. As explained by Julian, nhc_scope is related to nhc_gw, not to the route. Revert the original patch. The initial problem is fixed differently in the next commit. Link: https://lore.kernel.org/netdev/6c8a44ba-c2d5-cdf-c5c7-5baf97cba38@ssi.bg/ Signed-off-by: Nicolas Dichtel Reviewed-by: Julian Anastasov Signed-off-by: Jakub Kicinski commit 745b913a59947919454658dd44cddf5ee8d8f899 Author: Nicolas Dichtel Date: Thu Oct 20 12:09:50 2022 +0200 Revert "ip: fix triggering of 'icmp redirect'" This reverts commit eb55dc09b5dd040232d5de32812cc83001a23da6. The patch that introduces this bug is reverted right after this one. Signed-off-by: Nicolas Dichtel Reviewed-by: Julian Anastasov Signed-off-by: Jakub Kicinski commit b3026767e15b488860d4bbf1649d69612bab2c25 Author: Dylan Yudaken Date: Thu Oct 27 07:44:29 2022 -0700 io_uring: unlock if __io_run_local_work locked inside It is possible for tw to lock the ring, and this was not propogated out to io_run_local_work. This can cause an unlock to be missed. Instead pass a pointer to locked into __io_run_local_work. Fixes: 8ac5d85a89b4 ("io_uring: add local task_work run helper that is entered locked") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20221027144429.3971400-3-dylany@meta.com [axboe: WARN_ON() -> WARN_ON_ONCE() and add a minor comment] Signed-off-by: Jens Axboe commit 8de11cdc96bf58b324c59a28512eb9513fd02553 Author: Dylan Yudaken Date: Thu Oct 27 07:44:28 2022 -0700 io_uring: use io_run_local_work_locked helper prefer to use io_run_local_work_locked helper for consistency Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20221027144429.3971400-2-dylany@meta.com Signed-off-by: Jens Axboe commit ce48ebdd56513fa5ad9dab683a96399e00dbf464 Author: Jakub Kicinski Date: Tue Oct 25 17:15:24 2022 -0700 genetlink: limit the use of validation workarounds to old ops During review of previous change another thing came up - we should limit the use of validation workarounds to old commands. Don't list the workarounds one by one, as we're rejecting all existing ones. We can deal with the masking in the unlikely event that new flag is added. Link: https://lore.kernel.org/all/6ba9f727e555fd376623a298d5d305ad408c3d47.camel@sipsolutions.net/ Link: https://lore.kernel.org/r/20221026001524.1892202-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 3b1e0dd2dc8a280b1e89c0df6d38cd28768575a5 Author: Will McVicker Date: Tue Oct 25 13:17:44 2022 -0700 kbuild: fix typo in modpost Commit f73edc8951b2 ("kbuild: unify two modpost invocations") introduced a typo (moudle.symvers-if-present) which results in the kernel's Module.symvers to not be included as a prerequisite for $(KBUILD_EXTMOD)/Module.symvers. Fix the typo to restore the intended functionality. Fixes: f73edc8951b2 ("kbuild: unify two modpost invocations") Signed-off-by: Will McVicker Signed-off-by: Masahiro Yamada commit 114ff6fe6cfbe81659f9e517d0b25f53db5dfc5d Author: Dan Li Date: Thu Oct 20 03:38:23 2022 -0700 Documentation: kbuild: Add description of git for reproducible builds The status of git will affect the final compilation result, add it to the documentation of reproducible builds. Signed-off-by: Dan Li Signed-off-by: Masahiro Yamada commit 5c1df62ca65936139a4b008561110d9fc285c58a Author: Stefan Hansson Date: Mon Oct 17 17:01:14 2022 +0200 kbuild: use POSIX-compatible grep option --file is a GNU extension to grep which is not available in all implementations (such as BusyBox). Use the -f option instead which is eqvuialent according to the GNU grep manpage[1] and is present in POSIX[2]. [1] https://www.gnu.org/software/grep/manual/grep.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html Signed-off-by: Stefan Hansson Signed-off-by: Masahiro Yamada commit 7f57f8165cb6d2c206e2b9ada53b9e2d6d8af42f Author: Herbert Xu Date: Tue Oct 25 14:06:48 2022 +0800 af_key: Fix send_acquire race with pfkey_register The function pfkey_send_acquire may race with pfkey_register (which could even be in a different name space). This may result in a buffer overrun. Allocating the maximum amount of memory that could be used prevents this. Reported-by: syzbot+1e9af9185d8850e2c2fa@syzkaller.appspotmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Herbert Xu Reviewed-by: Sabrina Dubroca Reviewed-by: Eric Dumazet Signed-off-by: Steffen Klassert commit df3414b0a245f43476061fddd78cee7d6cff797f Author: Benoît Monin Date: Thu Oct 13 16:26:48 2022 +0200 USB: serial: option: add Sierra Wireless EM9191 Add support for the AT and diag ports, similar to other qualcomm SDX55 modems. In QDL mode, the modem uses a different device ID and support is provided by qcserial in commit 11c52d250b34 ("USB: serial: qcserial: add EM9191 QDL support"). T: Bus=08 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=1199 ProdID=90d3 Rev=00.06 S: Manufacturer=Sierra Wireless, Incorporated S: Product=Sierra Wireless EM9191 S: SerialNumber=xxxxxxxxxxxxxxxx C: #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none) Signed-off-by: Benoît Monin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 9f172134dde7e4f5bf4b9139f23a1e741ec1c36e Author: Florian Fainelli Date: Tue Oct 25 16:42:01 2022 -0700 net: bcmsysport: Indicate MAC is in charge of PHY PM Avoid the PHY library call unnecessarily into the suspend/resume functions by setting phydev->mac_managed_pm to true. The SYSTEMPORT driver essentially does exactly what mdio_bus_phy_resume() does by calling phy_resume(). Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20221025234201.2549360-1-f.fainelli@gmail.com Signed-off-by: Paolo Abeni commit dea31328d424b5c11c65a3cf9936656abafe94ba Merge: 2d87d455ead2c fe8714b04fb13 Author: Jens Axboe Date: Thu Oct 27 07:49:21 2022 -0600 Merge tag 'nvme-6.1-2022-10-27' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - make the multipath dma alignment to match the non-multipath one (Keith Busch) - fix a bogus use of sg_init_marker() (Nam Cao) - fix circulr locking in nvme-tcp (Sagi Grimberg)" * tag 'nvme-6.1-2022-10-27' of git://git.infradead.org/nvme: nvme-multipath: set queue dma alignment to 3 nvme-tcp: fix possible circular locking when deleting a controller under memory pressure nvme-tcp: replace sg_init_marker() with sg_init_table() commit 2d87d455ead2cbdee7e60463cddc5bff3f98c912 Author: Ming Lei Date: Thu Oct 27 16:57:09 2022 +0800 blk-mq: don't add non-pt request with ->end_io to batch dm-rq implements ->end_io callback for request issued to underlying queue, and it isn't passthrough request. Commit ab3e1d3bbab9 ("block: allow end_io based requests in the completion batch handling") doesn't clear rq->bio and rq->__data_len for request with ->end_io in blk_mq_end_request_batch(), and this way is actually dangerous, but so far it is only for nvme passthrough request. dm-rq needs to clean up remained bios in case of partial completion, and req->bio is required, then use-after-free is triggered, so the underlying clone request can't be completed in blk_mq_end_request_batch. Fix panic by not adding such request into batch list, and the issue can be triggered simply by exposing nvme pci to dm-mpath simply. Fixes: ab3e1d3bbab9 ("block: allow end_io based requests in the completion batch handling") Cc: dm-devel@redhat.com Cc: Mike Snitzer Reported-by: Changhui Zhong Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20221027085709.513175-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 7f21735ffb2648a29e0fc79c4bdcb1b9ed8602cd Author: Yang Yingliang Date: Thu Oct 27 17:19:18 2022 +0800 rbd: fix possible memory leak in rbd_sysfs_init() If device_register() returns error in rbd_sysfs_init(), name of kobject which is allocated in dev_set_name() called in device_add() is leaked. As comment of device_add() says, it should call put_device() to drop the reference count that was set in device_initialize() when it fails, so the name can be freed in kobject_cleanup(). Fault injection test can trigger this problem: unreferenced object 0xffff88810173aa78 (size 8): comm "modprobe", pid 247, jiffies 4294714278 (age 31.789s) hex dump (first 8 bytes): 72 62 64 00 81 88 ff ff rbd..... backtrace: [<00000000f58fae56>] __kmalloc_node_track_caller+0x44/0x1b0 [<00000000bdd44fe7>] kstrdup+0x3a/0x70 [<00000000f7844d0b>] kstrdup_const+0x63/0x80 [<000000001b0a0eeb>] kvasprintf_const+0x10b/0x190 [<00000000a47bd894>] kobject_set_name_vargs+0x56/0x150 [<00000000d5edbf18>] dev_set_name+0xab/0xe0 [<00000000f5153e80>] device_add+0x106/0x1f20 Fixes: dfc5606dc513 ("rbd: replace the rbd sysfs interface") Signed-off-by: Yang Yingliang Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20221027091918.2294132-1-yangyingliang@huawei.com Signed-off-by: Jens Axboe commit c3c06c61890da80494bb196f75d89b791adda87f Author: Yang Yingliang Date: Thu Oct 27 17:12:37 2022 +0800 can: j1939: transport: j1939_session_skb_drop_old(): spin_unlock_irqrestore() before kfree_skb() It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. The skb is unlinked from the queue, so it can be freed after spin_unlock_irqrestore(). Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Yang Yingliang Acked-by: Oleksij Rempel Link: https://lore.kernel.org/all/20221027091237.2290111-1-yangyingliang@huawei.com Cc: stable@vger.kernel.org [mkl: adjust subject] Signed-off-by: Marc Kleine-Budde commit 99632e3dbeb25a0ff86c4af4bba2dcf638624423 Author: Jilin Yuan Date: Wed Oct 19 20:56:04 2022 +0800 Drivers: hv: fix repeated words in comments Delete the redundant word 'of'. Signed-off-by: Jilin Yuan Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20221019125604.52999-1-yuanjilin@cdjrlc.com Signed-off-by: Wei Liu commit 03b9a6e18d325ede28c6dc218cedda53969eb41b Author: Zhao Liu Date: Thu Oct 20 16:38:20 2022 +0800 x86/hyperv: Remove BUG_ON() for kmap_local_page() The commit 154fb14df7a3c ("x86/hyperv: Replace kmap() with kmap_local_page()") keeps the BUG_ON() to check if kmap_local_page() fails. But in fact, kmap_local_page() always returns a valid kernel address and won't return NULL here. It will BUG on its own if it fails. [1] So directly use memcpy_to_page() which creates local mapping to copy. [1]: https://lore.kernel.org/lkml/YztFEyUA48et0yTt@iweiny-mobl/ Suggested-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Ira Weiny Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20221020083820.2341088-1-zhao1.liu@linux.intel.com Signed-off-by: Wei Liu commit 0e7ce23a917a9cc83ca3c779fbba836bca3bcf1e Author: Yang Yingliang Date: Tue Oct 25 21:00:11 2022 +0800 net: ehea: fix possible memory leak in ehea_register_port() If of_device_register() returns error, the of node and the name allocated in dev_set_name() is leaked, call put_device() to give up the reference that was set in device_initialize(), so that of node is put in logical_port_release() and the name is freed in kobject_cleanup(). Fixes: 1acf2318dd13 ("ehea: dynamic add / remove port") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221025130011.1071357-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni commit ecbcf030b45666ad11bc98565e71dfbcb7be4393 Author: Sean Christopherson Date: Thu Oct 13 21:12:20 2022 +0000 KVM: Reject attempts to consume or refresh inactive gfn_to_pfn_cache Reject kvm_gpc_check() and kvm_gpc_refresh() if the cache is inactive. Not checking the active flag during refresh is particularly egregious, as KVM can end up with a valid, inactive cache, which can lead to a variety of use-after-free bugs, e.g. consuming a NULL kernel pointer or missing an mmu_notifier invalidation due to the cache not being on the list of gfns to invalidate. Note, "active" needs to be set if and only if the cache is on the list of caches, i.e. is reachable via mmu_notifier events. If a relevant mmu_notifier event occurs while the cache is "active" but not on the list, KVM will not acquire the cache's lock and so will not serailize the mmu_notifier event with active users and/or kvm_gpc_refresh(). A race between KVM_XEN_ATTR_TYPE_SHARED_INFO and KVM_XEN_HVM_EVTCHN_SEND can be exploited to trigger the bug. 1. Deactivate shinfo cache: kvm_xen_hvm_set_attr case KVM_XEN_ATTR_TYPE_SHARED_INFO kvm_gpc_deactivate kvm_gpc_unmap gpc->valid = false gpc->khva = NULL gpc->active = false Result: active = false, valid = false 2. Cause cache refresh: kvm_arch_vm_ioctl case KVM_XEN_HVM_EVTCHN_SEND kvm_xen_hvm_evtchn_send kvm_xen_set_evtchn kvm_xen_set_evtchn_fast kvm_gpc_check return -EWOULDBLOCK because !gpc->valid kvm_xen_set_evtchn_fast return -EWOULDBLOCK kvm_gpc_refresh hva_to_pfn_retry gpc->valid = true gpc->khva = not NULL Result: active = false, valid = true 3. Race ioctl KVM_XEN_HVM_EVTCHN_SEND against ioctl KVM_XEN_ATTR_TYPE_SHARED_INFO: kvm_arch_vm_ioctl case KVM_XEN_HVM_EVTCHN_SEND kvm_xen_hvm_evtchn_send kvm_xen_set_evtchn kvm_xen_set_evtchn_fast read_lock gpc->lock kvm_xen_hvm_set_attr case KVM_XEN_ATTR_TYPE_SHARED_INFO mutex_lock kvm->lock kvm_xen_shared_info_init kvm_gpc_activate gpc->khva = NULL kvm_gpc_check [ Check passes because gpc->valid is still true, even though gpc->khva is already NULL. ] shinfo = gpc->khva pending_bits = shinfo->evtchn_pending CRASH: test_and_set_bit(..., pending_bits) Fixes: 982ed0de4753 ("KVM: Reinstate gfn_to_pfn_cache with invalidation support") Cc: stable@vger.kernel.org Reported-by: : Michal Luczaj Signed-off-by: Sean Christopherson Message-Id: <20221013211234.1318131-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 52491a38b2c2411f3f0229dc6ad610349c704a41 Author: Michal Luczaj Date: Thu Oct 13 21:12:19 2022 +0000 KVM: Initialize gfn_to_pfn_cache locks in dedicated helper Move the gfn_to_pfn_cache lock initialization to another helper and call the new helper during VM/vCPU creation. There are race conditions possible due to kvm_gfn_to_pfn_cache_init()'s ability to re-initialize the cache's locks. For example: a race between ioctl(KVM_XEN_HVM_EVTCHN_SEND) and kvm_gfn_to_pfn_cache_init() leads to a corrupted shinfo gpc lock. (thread 1) | (thread 2) | kvm_xen_set_evtchn_fast | read_lock_irqsave(&gpc->lock, ...) | | kvm_gfn_to_pfn_cache_init | rwlock_init(&gpc->lock) read_unlock_irqrestore(&gpc->lock, ...) | Rename "cache_init" and "cache_destroy" to activate+deactivate to avoid implying that the cache really is destroyed/freed. Note, there more races in the newly named kvm_gpc_activate() that will be addressed separately. Fixes: 982ed0de4753 ("KVM: Reinstate gfn_to_pfn_cache with invalidation support") Cc: stable@vger.kernel.org Suggested-by: Sean Christopherson Signed-off-by: Michal Luczaj [sean: call out that this is a bug fix] Signed-off-by: Sean Christopherson Message-Id: <20221013211234.1318131-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 89049273122e7ac92de0f3abfebb5cdb9d874431 Merge: e2badb4bd33ab 25f16c873fb1a Author: Paolo Abeni Date: Thu Oct 27 12:31:45 2022 +0200 Merge branch 'openvswitch-syzbot-splat-fix-and-introduce-selftest' Aaron Conole says: ==================== openvswitch: syzbot splat fix and introduce selftest Syzbot recently caught a splat when dropping features from openvswitch datapaths that are in-use. The WARN() call is definitely too large a hammer for the situation, so change to pr_warn. Second patch in the series introduces a new selftest suite which can help show that an issue is fixed. This change might be more suited to net-next tree, so it has been separated out as an additional patch and can be either applied to either tree based on preference. ==================== Link: https://lore.kernel.org/r/20221025105018.466157-1-aconole@redhat.com Signed-off-by: Paolo Abeni commit 25f16c873fb1aa8ba870319c9614f7ff7502d35b Author: Aaron Conole Date: Tue Oct 25 06:50:18 2022 -0400 selftests: add openvswitch selftest suite Previous commit resolves a WARN splat that can be difficult to reproduce, but with the ovs-dpctl.py utility, it can be trivial. Introduce a test case which creates a DP, and then downgrades the feature set. This will include a utility 'ovs-dpctl.py' that can be extended to do additional tests and diagnostics. Signed-off-by: Aaron Conole Signed-off-by: Paolo Abeni commit fd954cc1919e35cb92f78671cab6e42d661945a3 Author: Aaron Conole Date: Tue Oct 25 06:50:17 2022 -0400 openvswitch: switch from WARN to pr_warn As noted by Paolo Abeni, pr_warn doesn't generate any splat and can still preserve the warning to the user that feature downgrade occurred. We likely cannot introduce other kinds of checks / enforcement here because syzbot can generate different genl versions to the datapath. Reported-by: syzbot+31cde0bef4bbf8ba2d86@syzkaller.appspotmail.com Fixes: 44da5ae5fbea ("openvswitch: Drop user features if old user space attempted to create datapath") Cc: Thomas Graf Signed-off-by: Aaron Conole Acked-by: Ilya Maximets Signed-off-by: Paolo Abeni commit 1c1a41497ab879ac9608f3047f230af833eeef3d Author: Emanuele Giuseppe Esposito Date: Tue Oct 25 08:37:49 2022 -0400 KVM: VMX: fully disable SGX if SECONDARY_EXEC_ENCLS_EXITING unavailable Clear enable_sgx if ENCLS-exiting is not supported, i.e. if SGX cannot be virtualized. When KVM is loaded, adjust_vmx_controls checks that the bit is available before enabling the feature; however, other parts of the code check enable_sgx and not clearing the variable caused two different bugs, mostly affecting nested virtualization scenarios. First, because enable_sgx remained true, SECONDARY_EXEC_ENCLS_EXITING would be marked available in the capability MSR that are accessed by a nested hypervisor. KVM would then propagate the control from vmcs12 to vmcs02 even if it isn't supported by the processor, thus causing an unexpected VM-Fail (exit code 0x7) in L1. Second, vmx_set_cpu_caps() would not clear the SGX bits when hardware support is unavailable. This is a much less problematic bug as it only happens if SGX is soft-disabled (available in the processor but hidden in CPUID) or if SGX is supported for bare metal but not in the VMCS (will never happen when running on bare metal, but can theoertically happen when running in a VM). Last but not least, this ensures that module params in sysfs reflect KVM's actual configuration. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2127128 Fixes: 72add915fbd5 ("KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC") Cc: stable@vger.kernel.org Suggested-by: Sean Christopherson Suggested-by: Bandan Das Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20221025123749.2201649-1-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit dea0d5a2fde62237ff14c41cb05dd151cebf84c0 Author: Sean Christopherson Date: Fri Sep 30 23:00:08 2022 +0000 KVM: x86: Exempt pending triple fault from event injection sanity check Exempt pending triple faults, a.k.a. KVM_REQ_TRIPLE_FAULT, when asserting that KVM didn't attempt to queue a new exception during event injection. KVM needs to emulate the injection itself when emulating Real Mode due to lack of unrestricted guest support (VMX) and will queue a triple fault if that emulation fails. Ideally the assertion would more precisely filter out the emulated Real Mode triple fault case, but rmode.vm86_active is buried in vcpu_vmx and can't be queried without a new kvm_x86_ops. And unlike "regular" exceptions, triple fault cannot put the vCPU into an infinite loop; the triple fault will force either an exit to userspace or a nested VM-Exit, and triple fault after nested VM-Exit will force an exit to userspace. I.e. there is no functional issue, so just suppress the warning for triple faults. Opportunistically convert the warning to a one-time thing, when it fires, it fires _a lot_, and is usually user triggerable, i.e. can be used to spam the kernel log. Fixes: 7055fb113116 ("KVM: x86: Treat pending TRIPLE_FAULT requests as pending exceptions") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202209301338.aca913c3-yujie.liu@intel.com Signed-off-by: Sean Christopherson Message-Id: <20220930230008.1636044-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 44fc40a015af7511408f7b447e2c0c2da056fd95 Author: Palmer Dabbelt Date: Thu Oct 13 23:46:38 2022 +0200 MAINTAINERS: git://github -> https://github.com for kvm-riscv Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Paolo Bonzini commit 180418e2eb33be5c8d0b703c843e0ebc045aef80 Author: Hou Wenlong Date: Mon Oct 17 11:06:10 2022 +0800 KVM: debugfs: Return retval of simple_attr_open() if it fails Although simple_attr_open() fails only with -ENOMEM with current code base, it would be nicer to return retval of simple_attr_open() directly in kvm_debugfs_open(). No functional change intended. Signed-off-by: Hou Wenlong Message-Id: <69d64d93accd1f33691b8a383ae555baee80f943.1665975828.git.houwenlong.hwl@antgroup.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 5aa02366773376a1fd3a5c6a815e5f6e026ab391 Author: Hou Wenlong Date: Fri Oct 14 15:55:11 2022 +0800 KVM: x86: Reduce refcount if single_open() fails in kvm_mmu_rmaps_stat_open() Refcount is increased before calling single_open() in kvm_mmu_rmaps_stat_open(), If single_open() fails, refcount should be restored, otherwise the vm couldn't be destroyed. Fixes: 3bcd0662d66fd ("KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file") Signed-off-by: Hou Wenlong Message-Id: [Preserved return value of single_open. - Paolo] Signed-off-by: Paolo Bonzini commit 86c4f0d547f6460d0426ebb3ba0614f1134b8cda Author: Jim Mattson Date: Thu Sep 29 15:52:03 2022 -0700 KVM: x86: Mask off reserved bits in CPUID.8000001FH KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.8000001FH:EBX[31:16] are reserved bits and should be masked off. Fixes: 8765d75329a3 ("KVM: X86: Extend CPUID range to include new leaf") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-6-jmattson@google.com> Cc: stable@vger.kernel.org [Clear NumVMPL too. - Paolo] Signed-off-by: Paolo Bonzini commit cb6c18b5a41622c7a439508f7421f8766a91cb87 Author: Ravi Bangoria Date: Sat Oct 1 11:37:05 2022 +0530 perf/mem: Rename PERF_MEM_LVLNUM_EXTN_MEM to PERF_MEM_LVLNUM_CXL PERF_MEM_LVLNUM_EXTN_MEM was introduced to cover CXL devices but it's bit ambiguous name and also not generic enough to cover cxl.cache and cxl.io devices. Rename it to PERF_MEM_LVLNUM_CXL to be more specific. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/f6268268-b4e9-9ed6-0453-65792644d953@amd.com commit eff98a7421b3ee73d62268115ffa5bfc0ba94544 Author: Zhang Rui Date: Sun Oct 23 20:51:20 2022 +0800 perf/x86/rapl: Add support for Intel Raptor Lake Raptor Lake RAPL support is the same as previous Sky Lake. Add Raptor Lake model for RAPL. Signed-off-by: Zhang Rui Signed-off-by: Peter Zijlstra (Intel) Tested-by: Wang Wendy Link: https://lkml.kernel.org/r/20221023125120.2727-2-rui.zhang@intel.com commit 1ab28f17eeeecf7d832e686fdd903d74569854ed Author: Zhang Rui Date: Sun Oct 23 20:51:19 2022 +0800 perf/x86/rapl: Add support for Intel AlderLake-N AlderLake-N RAPL support is the same as previous Sky Lake. Add AlderLake-N model for RAPL. Signed-off-by: Zhang Rui Signed-off-by: Peter Zijlstra (Intel) Tested-by: Wang Wendy Link: https://lkml.kernel.org/r/20221023125120.2727-1-rui.zhang@intel.com commit 4b66ff46f2e18b1d32e18c881799ef911606f3be Author: James Clark Date: Wed Oct 12 15:38:57 2022 +0100 perf: Fix missing raw data on tracepoint events Since commit 838d9bb62d13 ("perf: Use sample_flags for raw_data") raw data is not being output on tracepoints due to the PERF_SAMPLE_RAW field not being set. Fix this by setting it for tracepoint events. This fixes the following test failure: perf test "sched_switch" -vvv 35: Track with sched_switch --- start --- test child forked, pid 1828 ... Using CPUID 0x00000000410fd400 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 Missing sched_switch events 4613 events recorded test child finished with -1 ---- end ---- Track with sched_switch: FAILED! Fixes: 838d9bb62d13 ("perf: Use sample_flags for raw_data") Signed-off-by: James Clark Signed-off-by: Peter Zijlstra (Intel) Acked-by: Namhyung Kim Tested-by: SeongJae Park Tested-by: Athira Rajeev Link: https://lore.kernel.org/r/20221012143857.48198-1-james.clark@arm.com commit fd0c3b763afd44454301c4c6cbe744dac69227ca Merge: 2871edb32f462 d887087c89688 Author: Marc Kleine-Budde Date: Thu Oct 27 09:34:24 2022 +0200 Merge patch series "R-Car CAN-FD fixes" Biju Das says: This patch series fixes the below issues in R-Car CAN-FD driver. 1) Race condition in CAN driver under heavy CAN load condition with both channels enabled results in IRQ storm on global FIFO receive IRQ line. 2) Add channel specific TX interrupts handling for RZ/G2L SoC as it has separate IRQ lines for each TX. changes since v1: https://lore.kernel.org/all/20221022081503.1051257-1-biju.das.jz@bp.renesas.com * Added check for IRQ active and enabled before handling the IRQ on a particular channel. Link: https://lore.kernel.org/all/20221025155657.1426948-1-biju.das.jz@bp.renesas.com [mkl: adjust message, add link, take only patches 1 + 2, upstream 3 via can-next] Signed-off-by: Marc Kleine-Budde commit d887087c896881715c1a82f1d4f71fbfe5344ffd Author: Biju Das Date: Tue Oct 25 16:56:56 2022 +0100 can: rcar_canfd: fix channel specific IRQ handling for RZ/G2L RZ/G2L has separate channel specific IRQs for transmit and error interrupts. But the IRQ handler processes both channels, even if there no interrupt occurred on one of the channels. This patch fixes the issue by passing a channel specific context parameter instead of global one for the IRQ register and the IRQ handler, it just handles the channel which is triggered the interrupt. Fixes: 76e9353a80e9 ("can: rcar_canfd: Add support for RZ/G2L family") Signed-off-by: Biju Das Link: https://lore.kernel.org/all/20221025155657.1426948-3-biju.das.jz@bp.renesas.com Cc: stable@vger.kernel.org [mkl: adjust commit message] Signed-off-by: Marc Kleine-Budde commit 702de2c21eed04c67cefaaedc248ef16e5f6b293 Author: Biju Das Date: Tue Oct 25 16:56:55 2022 +0100 can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive We are seeing an IRQ storm on the global receive IRQ line under heavy CAN bus load conditions with both CAN channels enabled. Conditions: The global receive IRQ line is shared between can0 and can1, either of the channels can trigger interrupt while the other channel's IRQ line is disabled (RFIE). When global a receive IRQ interrupt occurs, we mask the interrupt in the IRQ handler. Clearing and unmasking of the interrupt is happening in rx_poll(). There is a race condition where rx_poll() unmasks the interrupt, but the next IRQ handler does not mask the IRQ due to NAPIF_STATE_MISSED flag (e.g.: can0 RX FIFO interrupt is disabled and can1 is triggering RX interrupt, the delay in rx_poll() processing results in setting NAPIF_STATE_MISSED flag) leading to an IRQ storm. This patch fixes the issue by checking IRQ active and enabled before handling the IRQ on a particular channel. Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver") Suggested-by: Marc Kleine-Budde Signed-off-by: Biju Das Link: https://lore.kernel.org/all/20221025155657.1426948-2-biju.das.jz@bp.renesas.com Cc: stable@vger.kernel.org [mkl: adjust commit message] Signed-off-by: Marc Kleine-Budde commit e0ba1a39b8dfe4f005bebdd85daa89e7382e26b7 Author: Michał Mirosław Date: Thu Oct 27 02:06:16 2022 +0200 fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() Return on error directly from the BAR-iterating loop instead of break+return. This is actually a cosmetic fix, since it would be highly unusual to have this called for a PCI device without any memory BARs. Fixes: 9d69ef183815 ("fbdev/core: Remove remove_conflicting_pci_framebuffers()") Signed-off-by: Michał Mirosław Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/e75323732bedc46d613d72ecb40f97e3bc75eea8.1666829073.git.mirq-linux@rere.qmqm.pl commit 200ec44ab7f9499a1f703aea0d7ba7d33e012d2f Merge: e6deb0b20bf79 d61e1d1d5225a Author: Dave Airlie Date: Thu Oct 27 17:13:03 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-10-26-1' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-10-26-1: amdgpu: - Stable pstate fix - SMU 13.x updates - SR-IOV fixes - PCI AER fix - GC 11.x fixes - Display fixes - Expose IMU firmware version for debugging - Plane modifier fix - S0i3 fix amdkfd: - Fix possible memory leak - Fix GC 10.x cache info reporting UAPI: - Expose IMU firmware version via existing INFO firmware query Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221027024101.6881-1-alexander.deucher@amd.com commit a0c9f1f2e53b8eb2ae43987a30e547ba56b4fa18 Author: Helge Deller Date: Thu Oct 27 09:12:05 2022 +0200 parisc: Export iosapic_serial_irq() symbol for serial port driver The parisc serial port driver needs this symbol when it's compiled as module. Signed-off-by: Helge Deller Reported-by: kernel test robot Cc: commit 2871edb32f4622c3a25ce4b3977bad9050b91974 Author: Anssi Hannula Date: Mon Oct 10 20:52:27 2022 +0200 can: kvaser_usb: Fix possible completions during init_completion kvaser_usb uses completions to signal when a response event is received for outgoing commands. However, it uses init_completion() to reinitialize the start_comp and stop_comp completions before sending the start/stop commands. In case the device sends the corresponding response just before the actual command is sent, complete() may be called concurrently with init_completion() which is not safe. This might be triggerable even with a properly functioning device by stopping the interface (CMD_STOP_CHIP) just after it goes bus-off (which also causes the driver to send CMD_STOP_CHIP when restart-ms is off), but that was not tested. Fix the issue by using reinit_completion() instead. Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson Signed-off-by: Anssi Hannula Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/all/20221010185237.319219-2-extja@kvaser.com Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit f1fae475f10a26b7e34da4ff2e2f19b7feb3548e Author: Takashi Iwai Date: Thu Oct 27 08:52:33 2022 +0200 ALSA: aoa: Fix I2S device accounting i2sbus_add_dev() is supposed to return the number of probed devices, i.e. either 1 or 0. However, i2sbus_add_dev() has one error handling that returns -ENODEV; this will screw up the accumulation number counted in the caller, i2sbus_probe(). Fix the return value to 0 and add the comment for better understanding for readers. Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") Link: https://lore.kernel.org/r/20221027065233.13292-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit f0a868788fcbf63cdab51f5adcf73b271ede8164 Author: Steven Rostedt (Google) Date: Wed Oct 26 23:12:36 2022 -0400 ALSA: Use del_timer_sync() before freeing timer The current code for freeing the emux timer is extremely dangerous: CPU0 CPU1 ---- ---- snd_emux_timer_callback() snd_emux_free() spin_lock(&emu->voice_lock) del_timer(&emu->tlist); <-- returns immediately spin_unlock(&emu->voice_lock); [..] kfree(emu); spin_lock(&emu->voice_lock); [BOOM!] Instead just use del_timer_sync() which will wait for the timer to finish before continuing. No need to check if the timer is active or not when doing so. This doesn't fix the race of a possible re-arming of the timer, but at least it won't use the data that has just been freed. [ Fixed unused variable warning by tiwai ] Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Steven Rostedt (Google) Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20221026231236.6834b551@gandalf.local.home Signed-off-by: Takashi Iwai commit 4a4c8482e370d697738a78dcd7bf2780832cb712 Author: Yang Yingliang Date: Thu Oct 27 09:34:38 2022 +0800 ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev() dev_set_name() in soundbus_add_one() allocates memory for name, it need be freed when of_device_register() fails, call soundbus_dev_put() to give up the reference that hold in device_initialize(), so that it can be freed in kobject_cleanup() when the refcount hit to 0. And other resources are also freed in i2sbus_release_dev(), so it can return 0 directly. Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221027013438.991920-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit f850a2b156448bd97c747f6206523886578850c7 Merge: 50895a55bcfde e9441675edc1b Author: Takashi Iwai Date: Thu Oct 27 08:26:32 2022 +0200 Merge tag 'asoc-fix-v6.1-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.1 Quite a few fixes here, a lot driver specific, plus some new quirks. There was a bit of a mess with the runtime PM handling due to some confusion in the API there which resulted in a number of commits and reverts but that should all be stable now. commit e6deb0b20bf79a3beadbfc0b78f09c46db3e6fab Merge: 247f34f7b8035 e0e86f25fd469 Author: Dave Airlie Date: Thu Oct 27 14:51:04 2022 +1000 Merge tag 'drm-msm-fixes-2022-10-24' of https://gitlab.freedesktop.org/drm/msm into drm-fixes msm-fixes for v6.1 - Fix shrinker deadlock - Fix crash during suspend after unbind - Fix IRQ lifetime issues - Fix potential memory corruption with too many bridges - Fix memory corruption on GPU state capture Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGveadezhqm=Sra7Jq4A3tFAp_eBmKKOoHLnapN03pVoLw@mail.gmail.com commit e2badb4bd33abe13ddc35975bd7f7f8693955a4b Author: Kunihiko Hayashi Date: Mon Oct 24 16:22:27 2022 +0900 net: ethernet: ave: Fix MAC to be in charge of PHY PM The phylib callback is called after MAC driver's own resume callback is called. For AVE driver, after resuming immediately, PHY state machine is in PHY_NOLINK because there is a time lag from link-down to link-up due to autoneg. The result is WARN_ON() dump in mdio_bus_phy_resume(). Since ave_resume() itself calls phy_resume(), AVE driver should manage PHY PM. To indicate that MAC driver manages PHY PM, set phydev->mac_managed_pm to true to avoid the unnecessary phylib call and add missing phy_init_hw() to ave_resume(). Suggested-by: Heiner Kallweit Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20221024072227.24769-1-hayashi.kunihiko@socionext.com Signed-off-by: Jakub Kicinski commit 0a8b43b12dd78daa77a7dc007b92770d262a2714 Author: Juergen Borleis Date: Mon Oct 24 10:05:52 2022 +0200 net: fec: limit register access on i.MX6UL Using 'ethtool -d […]' on an i.MX6UL leads to a kernel crash: Unhandled fault: external abort on non-linefetch (0x1008) at […] due to this SoC has less registers in its FEC implementation compared to other i.MX6 variants. Thus, a run-time decision is required to avoid access to non-existing registers. Fixes: a51d3ab50702 ("net: fec: use a more proper compatible string for i.MX6UL type device") Signed-off-by: Juergen Borleis Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221024080552.21004-1-jbe@pengutronix.de Signed-off-by: Jakub Kicinski commit 8b9d377afaed8ef8f4c85432e916930279ac1871 Merge: c5f0a17288740 b1a09b63684ce Author: Jakub Kicinski Date: Wed Oct 26 20:12:50 2022 -0700 Merge tag 'linux-can-fixes-for-6.1-20221025' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-10-25 The 1st patch adds a missing cleanup call in the error path of the probe function in mpc5xxx glue code for the mscan driver. The 2nd patch adds a missing cleanup call in the error path of the probe function of the mcp251x driver. * tag 'linux-can-fixes-for-6.1-20221025' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: mcp251x: mcp251x_can_probe(): add missing unregister_candev() in error path can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path ==================== Link: https://lore.kernel.org/r/20221026075520.1502520-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit b229b6ca5abbd63ff40c1396095b1b36b18139c3 Merge: a2718383ef9d9 e9229d5b6254a Author: Linus Torvalds Date: Wed Oct 26 17:44:10 2022 -0700 Merge tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tool fixes from Arnaldo Carvalho de Melo: - Fix some aspects of building with an older (than the one in the kernel sources) libbpf present in a distro, when building with LIBBPF_DYNAMIC=1. - Fix errno setting races with event_fd and the signal handler in 'perf record'. - Fix Power10 hv-24x7 metric events when some events may have a zero count based on system configuration. - Do not fail Intel-PT misc test w/o libpython, just skip it. - Fix incorrect arm64 Hisi hip08 L3 metrics (IF_BP_MISP_BR_RET, IF_BP_MISP_BR_RET, IF_BP_MISP_BR_BL) due to mistakes in the documentation used to generate the JSON files for these metrics. - Fix auxtrace (Intel PT, ARM Coresight) address filter symbol name match for modules, we need to skip the module name. - Sync copies of files with the kernel sources, including ppc syscall tables and assorted headers, some resulting in tools being able to decode new network protocols (IPPROTO_L2TP) and statx masks (STATX_DIOALIGN). - Fix PMU name pai_crypto in the vendor events file (JSON) for s390. - Fix man page build wrt perf-arm-coresight.txt as the build process assumes files starting with 'perf-' are man pages, and this file isn't one. * tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf vendor events arm64: Fix incorrect Hisi hip08 L3 metrics perf auxtrace: Fix address filter symbol name match for modules tools headers UAPI: Sync linux/perf_event.h with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers uapi: Sync linux/stat.h with the kernel sources tools include UAPI: Sync sound/asound.h copy with the kernel sources tools headers uapi: Update linux/in.h copy tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench' tools headers arm64: Sync arm64's cputype.h with the kernel sources perf test: Do not fail Intel-PT misc test w/o libpython perf list: Fix PMU name pai_crypto in perf list on s390 perf record: Fix event fd races perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available perf bpf: Fix build with libbpf 0.7.0 by adding prototype for bpf_load_program() perf vendor events power10: Fix hv-24x7 metric events perf docs: Fix man page build wrt perf-arm-coresight.txt tools headers UAPI: Sync powerpc syscall tables with the kernel sources commit a2718383ef9d9dcba90212531909aa4c8ab31c0c Merge: 98555239e4c3a f8aa6c895d482 Author: Linus Torvalds Date: Wed Oct 26 17:38:46 2022 -0700 Merge tag 'spi-fix-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A collection of mostly unremarkable fixes for SPI that have built up since the merge window, all driver specific. The change to the qup adding support for GPIO chip selects is fixing a regression due to the removal of legacy GPIO handling, the driver had previously been silently relying on the legacy GPIO support in a slightly broken way which worked well enough on some systems. Fixing it is simply a case of setting a couple of bits of information in the driver description" * tag 'spi-fix-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: aspeed: Fix window offset of CE1 spi: qup: support using GPIO as chip select line spi: intel: Fix the offset to get the 64K erase opcode spi: aspeed: Fix typo in mode_bits field for AST2600 platform spi: mpc52xx: Replace NO_IRQ by 0 spi: spi-mem: Fix typo (of -> or) spi: spi-gxp: fix typo in SPDX identifier line spi: tegra210-quad: Fix combined sequence commit 649179e512f79f8d07ef244ab8793e351d069199 Merge: 8fbf8636cd37b a9003f74f5a2f Author: Stephen Boyd Date: Wed Oct 26 17:30:33 2022 -0700 Merge tag 'renesas-clk-fixes-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-fixes Pull Renesas clk driver fixes from Geert Uytterhoeven: - Correct the parent clocks for the High Speed Serial Communication Interfaces with FIFO (HSCIF) modules on the R-Car V4H SoC. Note that HSCIF0 is used for the serial console on the White-Hawk development board. * tag 'renesas-clk-fixes-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r8a779g0: Fix HSCIF parent clocks clk: renesas: r8a779g0: Add SASYNCPER clocks commit d61e1d1d5225a9baeb995bcbdb904f66f70ed87e Author: Prike Liang Date: Fri Oct 21 10:04:40 2022 +0800 drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume In the S2idle suspend/resume phase the gfxoff is keeping functional so some IP blocks will be likely to reinitialize at gfxoff entry and that will result in failing to program GC registers.Therefore, let disallow gfxoff until AMDGPU IPs reinitialized completely. Signed-off-by: Prike Liang Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.15.x commit e07ee6fe21f47cfd72ae566395c67a80e7c66163 Author: Allison Henderson Date: Tue Oct 25 12:16:27 2022 -0700 xfs: increase rename inode reservation xfs_rename can update up to 5 inodes: src_dp, target_dp, src_ip, target_ip and wip. So we need to increase the inode reservation to match. Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 98555239e4c3aab1810d84073166eef6d54eeb3d Merge: 4dc12f37a8e98 4fd9df10cb7a9 Author: Linus Torvalds Date: Wed Oct 26 11:15:00 2022 -0700 Merge tag 'arc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fixes from Vineet Gupta: - fix for Page Table mem leak - defconfig updates - misc other fixes * tag 'arc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: mm: fix leakage of memory allocated for PTE arc: update config files arc: iounmap() arg is volatile arc: dts: Harmonize EHCI/OHCI DT nodes name ARC: bitops: Change __fls to return unsigned long ARC: Fix comment typo ARC: Fix comment typo commit 308c316d16cbad99bb834767382baa693ac42169 Author: Thinh Nguyen Date: Tue Oct 25 15:10:20 2022 -0700 usb: dwc3: gadget: Don't set IMI for no_interrupt The gadget driver may have a certain expectation of how the request completion flow should be from to its configuration. Make sure the controller driver respect that. That is, don't set IMI (Interrupt on Missed Isoc) when usb_request->no_interrupt is set. Also, the driver should only set IMI to the last TRB of a chain. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Reviewed-by: Jeff Vanhoof Tested-by: Jeff Vanhoof Link: https://lore.kernel.org/r/ced336c84434571340c07994e3667a0ee284fefe.1666735451.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit f78961f8380b940e0cfc7e549336c21a2ad44f4d Author: Thinh Nguyen Date: Tue Oct 25 15:10:14 2022 -0700 usb: dwc3: gadget: Stop processing more requests on IMI When servicing a transfer completion event, the dwc3 driver will reclaim TRBs of started requests up to the request associated with the interrupt event. Currently we don't check for interrupt due to missed isoc, and the driver may attempt to reclaim TRBs beyond the associated event. This causes invalid memory access when the hardware still owns the TRB. If there's a missed isoc TRB with IMI (interrupt on missed isoc), make sure to stop servicing further. Note that only the last TRB of chained TRBs has its status updated with missed isoc. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Cc: stable@vger.kernel.org Reported-by: Jeff Vanhoof Reported-by: Dan Vacura Signed-off-by: Thinh Nguyen Reviewed-by: Jeff Vanhoof Tested-by: Jeff Vanhoof Link: https://lore.kernel.org/r/b29acbeab531b666095dfdafd8cb5c7654fbb3e1.1666735451.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit e9229d5b6254a75291536f582652c599957344d2 Author: Shang XiaoJing Date: Fri Oct 21 18:50:33 2022 +0800 perf vendor events arm64: Fix incorrect Hisi hip08 L3 metrics Commit 0cc177cfc95d565e ("perf vendor events arm64: Add Hisi hip08 L3 metrics") add L3 metrics of hip08, but some metrics (IF_BP_MISP_BR_RET, IF_BP_MISP_BR_RET, IF_BP_MISP_BR_BL) have incorrect event number due to the mistakes in document, which caused incorrect result. Fix the incorrect metrics. Before: 65,811,214,308 armv8_pmuv3_0/event=0x1014/ # 18.87 push_branch # -40.19 other_branch 3,564,316,780 BR_MIS_PRED # 0.51 indirect_branch # 21.81 pop_branch After: 6,537,146,245 BR_MIS_PRED # 0.48 indirect_branch # 0.47 pop_branch # 0.00 push_branch # 0.05 other_branch Fixes: 0cc177cfc95d565e ("perf vendor events arm64: Add Hisi hip08 L3 metrics") Reviewed-by: John Garry Signed-off-by: Shang XiaoJing Acked-by: James Clark Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Leo Yan Cc: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Link: https://lore.kernel.org/r/20221021105035.10000-2-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit cba04f3136b658583adb191556f99d087589c1cc Author: Adrian Hunter Date: Wed Oct 26 10:27:36 2022 +0300 perf auxtrace: Fix address filter symbol name match for modules For modules, names from kallsyms__parse() contain the module name which meant that module symbols did not match exactly by name. Fix by matching the name string up to the separating tab character. Fixes: 1b36c03e356936d6 ("perf record: Add support for using symbols in address filters") Signed-off-by: Adrian Hunter Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221026072736.2982-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 831c05a7621b96944b0b4dbede57ed7cf0578f1c Author: Arnaldo Carvalho de Melo Date: Fri May 21 16:00:31 2021 -0300 tools headers UAPI: Sync linux/perf_event.h with the kernel sources To pick the changes in: cfef80bad4cf79cd ("perf/uapi: Define PERF_MEM_SNOOPX_PEER in kernel header file") ee3e88dfec23153d ("perf/mem: Introduce PERF_MEM_LVLNUM_{EXTN_MEM|IO}") b4e12b2d70fd9ecc ("perf: Kill __PERF_SAMPLE_CALLCHAIN_EARLY") There is a kernel patch pending that renames PERF_MEM_LVLNUM_EXTN_MEM to PERF_MEM_LVLNUM_CXL, tooling this time is ahead of the kernel :-) This thus partially addresses this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Link: https://lore.kernel.org/lkml/Y1k53KMdzypmU0WS@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 65722736c3baf29e02e964a09e85c9ef71c48e8d Author: Nicholas Piggin Date: Sat Oct 22 15:22:07 2022 +1000 powerpc/64s/interrupt: Fix clear of PACA_IRQS_HARD_DIS when returning to soft-masked context Commit a4cb3651a1743 ("powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context") fixed the problem of pending irqs being cleared when clearing the HARD_DIS bit, but then it didn't clear the bit at all. This change clears HARD_DIS without affecting other bits in the mask. When an interrupt hits in a soft-masked section that has MSR[EE]=1, it can hard disable and set PACA_IRQS_HARD_DIS, which must be cleared when returning to the EE=1 caller (unless it was set due to a MUST_HARD_MASK interrupt becoming pending). Failure to clear this leaves the returned-to context running with MSR[EE]=1 and PACA_IRQS_HARD_DIS, which confuses irq assertions and could be dangerous for code that might test the flag. This was observed in a hash MMU kernel where a kernel hash fault hits in a local_irqs_disabled region that has EE=1. The hash fault also runs with EE=1, then as it returns, a decrementer hits in the restart section and the irq restart code hard-masks which sets the PACA_IRQ_HARD_DIS flag, which is not clear when the original context is returned to. Reported-by: Sachin Sant Fixes: a4cb3651a1743 ("powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context") Signed-off-by: Nicholas Piggin Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221022052207.471328-1-npiggin@gmail.com commit 04694e50020b62b10bd0d46ff9e9708a6e1c7eb3 Author: Neil Armstrong Date: Wed Oct 26 09:58:28 2022 +0200 spi: meson-spicc: move wait completion in driver to take bursts delay in account Some delay occurs between each bursts, thus the default delay is wrong and a timeout will occur with big enough transfers. The solution is to handle the timeout management in the driver and add some delay for each bursts in the timeout calculation. Reported-by: Da Xue Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20221026-spicc-burst-delay-v1-0-1be5ffb7051a@linaro.org Signed-off-by: Mark Brown commit 69d1abc0214e944dff1d30e201f8fc332a1adf1a Author: Tzung-Bi Shih Date: Tue Oct 25 10:49:29 2022 +0800 MAINTAINERS: update Tzung-Bi's email address Use kernel.org account instead. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20221025024929.2652134-1-tzungbi@kernel.org Signed-off-by: Mark Brown commit 8bb0ac0e6f64ebdf15d963c26b028de391c9bcf9 Author: Hans de Goede Date: Tue Oct 25 16:09:42 2022 +0200 ASoC: Intel: bytcht_es8316: Add quirk for the Nanote UMPC-01 The Nanote UMPC-01 mini laptop has stereo speakers, while the default bytcht_es8316 settings assume a mono speaker setup. Add a quirk for this. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20221025140942.509066-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit d40b6529c6269cd5afddb1116a383cab9f126694 Author: Brent Mendelsohn Date: Mon Oct 24 18:42:27 2022 +0100 ASoC: amd: yc: Add Alienware m17 R5 AMD into DMI table This model requires an additional detection quirk to enable the internal microphone - BIOS doesn't seem to support AcpDmicConnected (nothing in acpidump output). Link: https://bugzilla.kernel.org/show_bug.cgi?id=216590 Signed-off-by: Brent Mendelsohn Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20221024174227.4160-1-mendiebm@gmail.com Signed-off-by: Mark Brown commit 1683d3282f240336a2b4b6b541d435facfe8bbb6 Author: Paul Cercueil Date: Tue Oct 25 16:01:49 2022 +0100 ASoC: dapm: Don't use prefix for regulator name When a component has a prefix, and uses a SND_SOC_DAPM_REGULATOR_SUPPLY, the name of the regulator should not use the prefix, otherwise it won't be properly matched in the DT/ACPI. Fixes: 3caac759681e ("ASoC: soc-dapm.c: fixup snd_soc_dapm_new_control_unlocked() error handling") Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20221025150149.113129-1-paul@crapouillou.net Signed-off-by: Mark Brown commit e38de4804421b064a9c73c5a9b7f3df96b863e4b Author: Jason J. Herne Date: Fri Oct 21 10:50:02 2022 -0400 s390/vfio-ap: Fix memory allocation for mdev_types array The vfio-ap crypto driver fails to allocate memory for an array of pointers used to pass supported mdev types to mdev_register_parent(). Since we only support a single mdev type, the fix is to allocate a single entry in the ap_matrix_dev->mdev_types array. Link: https://lore.kernel.org/r/20221021145905.15100-1-jjherne@linux.ibm.com Fixes: da44c340c4fe ("vfio/mdev: simplify mdev_type handling") Cc: stable@vger.kernel.org Cc: Tony Krowiak Reported-by: Christian Borntraeger Reviewed-by: Matthew Rosato Signed-off-by: Jason J. Herne Signed-off-by: Vasily Gorbik commit 1b6074112742f65ece71b0f299ca5a6a887d2db6 Author: Peter Oberparleiter Date: Fri Oct 14 12:24:58 2022 +0200 s390/cio: fix out-of-bounds access on cio_ignore free The channel-subsystem-driver scans for newly available devices whenever device-IDs are removed from the cio_ignore list using a command such as: echo free >/proc/cio_ignore Since an I/O device scan might interfer with running I/Os, commit 172da89ed0ea ("s390/cio: avoid excessive path-verification requests") introduced an optimization to exclude online devices from the scan. The newly added check for online devices incorrectly assumes that an I/O-subchannel's drvdata points to a struct io_subchannel_private. For devices that are bound to a non-default I/O subchannel driver, such as the vfio_ccw driver, this results in an out-of-bounds read access during each scan. Fix this by changing the scan logic to rely on a driver-independent online indication. For this we can use struct subchannel->config.ena, which is the driver's requested subchannel-enabled state. Since I/Os can only be started on enabled subchannels, this matches the intent of the original optimization of not scanning devices where I/O might be running. Fixes: 172da89ed0ea ("s390/cio: avoid excessive path-verification requests") Fixes: 0c3812c347bf ("s390/cio: derive cdev information only for IO-subchannels") Cc: # v5.15 Reported-by: Alexander Egorenkov Reviewed-by: Vineeth Vijayan Signed-off-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit 8b1e6a3fb3feecdce8521154bfe30f9d1ebb70e6 Author: Thomas Richter Date: Thu Oct 20 16:51:34 2022 +0200 s390/pai: fix raw data collection for PMU pai_ext Commit 838d9bb62d13 ("perf: Use sample_flags for raw_data") changed the way the raw data of an event is collected. Adjust the PMU pai_ext to the new scheme. Fixes: 838d9bb62d13 ("perf: Use sample_flags for raw_data") Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik commit aa127a069ef312aca02b730d5137e1778d0c3ba7 Author: Peter Oberparleiter Date: Fri Sep 16 15:01:36 2022 +0200 s390/boot: add secure boot trailer This patch enhances the kernel image adding a trailer as required for secure boot by future firmware versions. Cc: # 5.2+ Signed-off-by: Peter Oberparleiter Reviewed-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 6ec803025cf3173a57222e4411097166bd06fa98 Author: Heiko Carstens Date: Tue Oct 18 13:48:34 2022 +0200 s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() For some exception types the instruction address points behind the instruction that caused the exception. Take that into account and add the missing exception table entry. Cc: Fixes: f058599e22d5 ("s390/pci: Fix s390_mmio_read/write with MIO") Reviewed-by: Niklas Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit a262d3ad6a433e4080cecd0a8841104a5906355e Author: Heiko Carstens Date: Tue Oct 18 13:44:11 2022 +0200 s390/futex: add missing EX_TABLE entry to __futex_atomic_op() For some exception types the instruction address points behind the instruction that caused the exception. Take that into account and add the missing exception table entry. Cc: Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4e1b5a86a5edfbefc9396d41b0fc1a2ebd0101b6 Author: Heiko Carstens Date: Tue Oct 18 13:39:43 2022 +0200 s390/uaccess: add missing EX_TABLE entries to __clear_user() For some exception types the instruction address points behind the instruction that caused the exception. Take that into account and add the missing exception table entries. Cc: Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit d6d9875e22cb760b433cade5cf19d8f105ad4621 Author: Heiko Carstens Date: Wed Oct 12 14:14:57 2022 +0200 MAINTAINERS: remove outdated linux390 link Reported-by: Alexandra Winter Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit c5f0a17288740573f4de72965c5294a60244c5fc Author: Rolf Eike Beer Date: Fri Oct 21 15:47:03 2022 +0200 rhashtable: make test actually random The "random rhlist add/delete operations" actually wasn't very random, as all cases tested the same bit. Since the later parts of this loop depend on the first case execute this unconditionally, and then test on different bits for the remaining tests. While at it only request as much random bits as are actually used. Signed-off-by: Rolf Eike Beer Acked-by: Herbert Xu Signed-off-by: David S. Miller commit 88c8e05ed5c0f05a637e654bbe4e49a1ebe7013c Author: Greg Kroah-Hartman Date: Wed Oct 26 14:09:06 2022 +0200 Revert "usb: gadget: uvc: limit isoc_sg to super speed gadgets" This reverts commit 19905240aef0181d1e6944070eb85fce75f75bcd. It was a new feature, and it doesn't even work properly yet, so revert it from this branch as it is not needed for 6.1-final. Cc: Michael Grzeschik Cc: stable Fixes: 19905240aef0 ("usb: gadget: uvc: limit isoc_sg to super speed gadgets") Signed-off-by: Greg Kroah-Hartman commit fa153b7cddce795662d38f78a87612c166c0f692 Author: Hans de Goede Date: Tue Oct 25 14:12:23 2022 +0200 ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[] Some x86/ACPI laptops with MIPI cameras have a LATT2021 ACPI device in the _DEP dependency list of the ACPI devices for the camera-sensors (which have flags.honor_deps set). The _DDN for the LATT2021 device is "Lattice FW Update Client Driver", suggesting that this is used for firmware updates of something. There is no Linux driver for this and if Linux gets support for updates it will likely be in userspace through fwupd. For now add the LATT2021 HID to acpi_ignore_dep_ids[] so that acpi_dev_ready_for_enumeration() will return true once the other _DEP dependencies are met. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit b5f9223a105d9b56954ad1ca3eace4eaf26c99ed Author: Tamim Khan Date: Fri Oct 14 01:19:31 2022 -0400 ACPI: resource: Skip IRQ override on Asus Vivobook S5602ZA Like the Asus Vivobook K3402ZA/K3502ZA/S5402ZA Asus Vivobook S5602ZA has an ACPI DSDT table the describes IRQ 1 as ActiveLow while the kernel overrides it to Edge_High. This prevents the keyboard on this laptop from working. To fix this add this laptop to the skip_override_table so that the kernel does not override IRQ 1. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216579 Tested-by: Dzmitry Signed-off-by: Tamim Khan Signed-off-by: Rafael J. Wysocki commit 8338b74a750c534c223e8943cc0ed0e198ece261 Author: Manank Patel Date: Tue Oct 18 00:13:39 2022 +0530 ACPI: PCC: Fix unintentional integer overflow Fix an unintentional u32 overflow by changing PCC_CMD_WAIT_RETRIES_NUM to 500ULL. Fixes: 91cefefb6991 ("ACPI: PCC: replace wait_for_completion()") Signed-off-by: Manank Patel Acked-by: Sudeep Holla Acked-by: Huisong Li Signed-off-by: Rafael J. Wysocki commit e0c57a5c70c13317238cb19a7ded0eab4a5f7de5 Author: Sudeep Holla Date: Tue Oct 25 13:34:32 2022 +0100 PM: domains: Fix handling of unavailable/disabled idle states Platforms can provide the information about the availability of each idle states via status flag. Platforms may have to disable one or more idle states for various reasons like broken firmware or other unmet dependencies. Fix handling of such unavailable/disabled idle states by ignoring them while parsing the states. Fixes: a3381e3a65cb ("PM / domains: Fix up domain-idle-states OF parsing") Signed-off-by: Sudeep Holla Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit a9003f74f5a2f487e101f3aa1dd5c3d3a78c6999 Author: Geert Uytterhoeven Date: Fri Oct 7 15:10:01 2022 +0200 clk: renesas: r8a779g0: Fix HSCIF parent clocks As serial communication requires a clean clock signal, the High Speed Serial Communication Interfaces with FIFO (HSCIF) is clocked by a clock that is not affected by Spread Spectrum or Fractional Multiplication. Hence change the parent clocks for the HSCIF modules from the S0D3_PER clock to the SASYNCPERD1 clock (which has the same clock rate), cfr. R-Car V4H Hardware User's Manual rev. 0.54. Fixes: 0ab55cf1834177a2 ("clk: renesas: cpg-mssr: Add support for R-Car V4H") Signed-off-by: Geert Uytterhoeven Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/b7928abc8b9f53d5b06ec8624342f449de3d24ec.1665147497.git.geert+renesas@glider.be commit 8d280b1df87e0b3d1355aeac7e62b62214b93f1c Author: Brian Norris Date: Mon Oct 24 11:02:59 2022 -0700 mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO REGMAP_MMIO is not user-configurable, so we can only satisfy this dependency by enabling some other Kconfig symbol that properly 'select's it. Use select like everybody else. Noticed when trying to enable this driver for compile testing. Fixes: 59592cc1f593 ("mmc: sdhci_am654: Add dependency on MMC_SDHCI_AM654") Signed-off-by: Brian Norris Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221024180300.2292208-1-briannorris@chromium.org Signed-off-by: Ulf Hansson commit 389ec68c83ee142f2edde954751fb67dafb5be32 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:37 2022 -0700 MAINTAINERS: git://github.com -> https://github.com for sifive Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt commit 89fd4a1df829187d4d35f6a520cc531de622e6f0 Author: Jisheng Zhang Date: Sat Oct 8 22:54:37 2022 +0800 riscv: jump_label: mark arguments as const to satisfy asm constraints Samuel reported that the static branch usage in cpu_relax() breaks building with CONFIG_CC_OPTIMIZE_FOR_SIZE: In file included from : ./arch/riscv/include/asm/jump_label.h: In function 'cpu_relax': ././include/linux/compiler_types.h:285:33: warning: 'asm' operand 0 probably does not match constraints 285 | #define asm_volatile_goto(x...) asm goto(x) | ^~~ ./arch/riscv/include/asm/jump_label.h:41:9: note: in expansion of macro 'asm_volatile_goto' 41 | asm_volatile_goto( | ^~~~~~~~~~~~~~~~~ ././include/linux/compiler_types.h:285:33: error: impossible constraint in 'asm' 285 | #define asm_volatile_goto(x...) asm goto(x) | ^~~ ./arch/riscv/include/asm/jump_label.h:41:9: note: in expansion of macro 'asm_volatile_goto' 41 | asm_volatile_goto( | ^~~~~~~~~~~~~~~~~ make[1]: *** [scripts/Makefile.build:249: arch/riscv/kernel/vdso/vgettimeofday.o] Error 1 make: *** [arch/riscv/Makefile:128: vdso_prepare] Error 2 Maybe "-Os" prevents GCC from detecting that the key/branch arguments can be treated as constants and used as immediate operands. Inspired by x86's commit 864b435514b2("x86/jump_label: Mark arguments as const to satisfy asm constraints"), and as pointed out by Steven: "The "i" constraint needs to be a constant.", let's do similar modifications to riscv. Tested by CC_OPTIMIZE_FOR_SIZE + gcc and CC_OPTIMIZE_FOR_SIZE + clang. Link: https://lore.kernel.org/linux-riscv/20220922060958.44203-1-samuel@sholland.org/ Link: https://lore.kernel.org/all/20210212094059.5f8d05e8@gandalf.local.home/ Fixes: 8eb060e10185 ("arch/riscv: add Zihintpause support") Reported-by: Samuel Holland Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20221008145437.491-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 95a0396a0642d3c28b6cefdc76697e0b8f594825 Author: Caleb Connolly Date: Tue Oct 25 00:48:50 2022 +0100 net: ipa: don't configure IDLE_INDICATION on v3.1 IPA v3.1 doesn't support the IDLE_INDICATION_CFG register, this was causing a harmless splat in ipa_idle_indication_cfg(), add a version check to prevent trying to fetch this register on v3.1 Fixes: 6a244b75cfab ("net: ipa: introduce ipa_reg()") Signed-off-by: Caleb Connolly Reviewed-by: Alex Elder Tested-by: Jami Kettunen Link: https://lore.kernel.org/r/20221024234850.4049778-1-caleb.connolly@linaro.org Signed-off-by: Jakub Kicinski commit 05a31b94af3226ee47dcb6802229a7a576105d47 Author: Caleb Connolly Date: Mon Oct 24 22:03:32 2022 +0100 net: ipa: fix v3.1 resource limit masks The resource group limits for IPA v3.1 mistakenly used 6 bit wide mask values, when the hardware actually uses 8. Out of range values were silently ignored before, so the IPA worked as expected. However the new generalised register definitions introduce stricter checking here, they now cause some splats and result in the value 0 being written instead. Fix the limit bitmask widths so that the correct values can be written. Fixes: 1c418c4a929c ("net: ipa: define resource group/type IPA register fields") Signed-off-by: Caleb Connolly Reviewed-by: Alex Elder Tested-by: Jami Kettunen Link: https://lore.kernel.org/r/20221024210336.4014983-2-caleb.connolly@linaro.org Signed-off-by: Jakub Kicinski commit f23a566bbfc0896c97b1949216eb87fcdcb154bb Author: Caleb Connolly Date: Mon Oct 24 22:03:31 2022 +0100 net: ipa: fix v3.5.1 resource limit max values Some resource limits on IPA v3.5.1 have their max values set to 255, this causes a few splats in ipa_reg_encode and prevents the IPA from booting properly. The limits are all 6 bits wide so adjust the max values to 63. Fixes: 1c418c4a929c ("net: ipa: define resource group/type IPA register fields") Signed-off-by: Caleb Connolly Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20221024210336.4014983-1-caleb.connolly@linaro.org Signed-off-by: Jakub Kicinski commit 5da6d65590a0698199df44d095e54b0ed1708178 Author: Yang Yingliang Date: Mon Oct 24 21:13:38 2022 +0800 net: ksz884x: fix missing pci_disable_device() on error in pcidev_init() pci_disable_device() need be called while module exiting, switch to use pcim_enable(), pci_disable_device() will be called in pcim_release() while unbinding device. Fixes: 8ca86fd83eae ("net: Micrel KSZ8841/2 PCI Ethernet driver") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221024131338.2848959-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 3b32c9932853e11d71f9db012d69e92e4669ba23 Author: Slawomir Laba Date: Mon Oct 24 03:05:26 2022 -0700 i40e: Fix flow-type by setting GL_HASH_INSET registers Fix setting bits for specific flow_type for GLQF_HASH_INSET register. In previous version all of the bits were set only in hena register, while in inset only one bit was set. In order for this working correctly on all types of cards these bits needs to be set correctly for both hena and inset registers. Fixes: eb0dd6e4a3b3 ("i40e: Allow RSS Hash set with less than four parameters") Signed-off-by: Slawomir Laba Signed-off-by: Michal Jaron Signed-off-by: Mateusz Palczewski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20221024100526.1874914-3-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 52424f974bc53c26ba3f00300a00e9de9afcd972 Author: Sylwester Dziedziuch Date: Mon Oct 24 03:05:25 2022 -0700 i40e: Fix VF hang when reset is triggered on another VF When a reset was triggered on one VF with i40e_reset_vf global PF state __I40E_VF_DISABLE was set on a PF until the reset finished. If immediately after triggering reset on one VF there is a request to reset on another it will cause a hang on VF side because VF will be notified of incoming reset but the reset will never happen because of this global state, we will get such error message: [ +4.890195] iavf 0000:86:02.1: Never saw reset and VF will hang waiting for the reset to be triggered. Fix this by introducing new VF state I40E_VF_STATE_RESETTING that will be set on a VF if it is currently resetting instead of the global __I40E_VF_DISABLE PF state. Fixes: 3ba9bcb4b68f ("i40e: add locking around VF reset") Signed-off-by: Sylwester Dziedziuch Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20221024100526.1874914-2-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 54b5af5a438076082d482cab105b1bd484ab5074 Author: Slawomir Laba Date: Mon Oct 24 03:05:24 2022 -0700 i40e: Fix ethtool rx-flow-hash setting for X722 When enabling flow type for RSS hash via ethtool: ethtool -N $pf rx-flow-hash tcp4|tcp6|udp4|udp6 s|d the driver would fail to setup this setting on X722 device since it was using the mask on the register dedicated for X710 devices. Apply a different mask on the register when setting the RSS hash for the X722 device. When displaying the flow types enabled via ethtool: ethtool -n $pf rx-flow-hash tcp4|tcp6|udp4|udp6 the driver would print wrong values for X722 device. Fix this issue by testing masks for X722 device in i40e_get_rss_hash_opts function. Fixes: eb0dd6e4a3b3 ("i40e: Allow RSS Hash set with less than four parameters") Signed-off-by: Slawomir Laba Signed-off-by: Michal Jaron Signed-off-by: Mateusz Palczewski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20221024100526.1874914-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit d89d7ff01235f218dad37de84457717f699dee79 Author: Eric Dumazet Date: Sun Oct 23 19:01:24 2022 -0700 ipv6: ensure sane device mtu in tunnels Another syzbot report [1] with no reproducer hints at a bug in ip6_gre tunnel (dev:ip6gretap0) Since ipv6 mcast code makes sure to read dev->mtu once and applies a sanity check on it (see commit b9b312a7a451 "ipv6: mcast: better catch silly mtu values"), a remaining possibility is that a layer is able to set dev->mtu to an underflowed value (high order bit set). This could happen indeed in ip6gre_tnl_link_config_route(), ip6_tnl_link_config() and ipip6_tunnel_bind_dev() Make sure to sanitize mtu value in a local variable before it is written once on dev->mtu, as lockless readers could catch wrong temporary value. [1] skbuff: skb_over_panic: text:ffff80000b7a2f38 len:40 put:40 head:ffff000149dcf200 data:ffff000149dcf2b0 tail:0xd8 end:0xc0 dev:ip6gretap0 ------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:120 Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 10241 Comm: kworker/1:1 Not tainted 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Workqueue: mld mld_ifc_work pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : skb_panic+0x4c/0x50 net/core/skbuff.c:116 lr : skb_panic+0x4c/0x50 net/core/skbuff.c:116 sp : ffff800020dd3b60 x29: ffff800020dd3b70 x28: 0000000000000000 x27: ffff00010df2a800 x26: 00000000000000c0 x25: 00000000000000b0 x24: ffff000149dcf200 x23: 00000000000000c0 x22: 00000000000000d8 x21: ffff80000b7a2f38 x20: ffff00014c2f7800 x19: 0000000000000028 x18: 00000000000001a9 x17: 0000000000000000 x16: ffff80000db49158 x15: ffff000113bf1a80 x14: 0000000000000000 x13: 00000000ffffffff x12: ffff000113bf1a80 x11: ff808000081c0d5c x10: 0000000000000000 x9 : 73f125dc5c63ba00 x8 : 73f125dc5c63ba00 x7 : ffff800008161d1c x6 : 0000000000000000 x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000 x2 : ffff0001fefddcd0 x1 : 0000000100000000 x0 : 0000000000000089 Call trace: skb_panic+0x4c/0x50 net/core/skbuff.c:116 skb_over_panic net/core/skbuff.c:125 [inline] skb_put+0xd4/0xdc net/core/skbuff.c:2049 ip6_mc_hdr net/ipv6/mcast.c:1714 [inline] mld_newpack+0x14c/0x270 net/ipv6/mcast.c:1765 add_grhead net/ipv6/mcast.c:1851 [inline] add_grec+0xa20/0xae0 net/ipv6/mcast.c:1989 mld_send_cr+0x438/0x5a8 net/ipv6/mcast.c:2115 mld_ifc_work+0x38/0x290 net/ipv6/mcast.c:2653 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Code: 91011400 aa0803e1 a90027ea 94373093 (d4210000) Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Reported-by: syzbot Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20221024020124.3756833-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 594d2a14f2168c09b13b114c3d457aa939403e52 Author: Li Zetao Date: Mon Oct 24 23:44:21 2022 +0800 fs/binfmt_elf: Fix memory leak in load_elf_binary() There is a memory leak reported by kmemleak: unreferenced object 0xffff88817104ef80 (size 224): comm "xfs_admin", pid 47165, jiffies 4298708825 (age 1333.476s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 60 a8 b3 00 81 88 ff ff a8 10 5a 00 81 88 ff ff `.........Z..... backtrace: [] __alloc_file+0x21/0x250 [] alloc_empty_file+0x41/0xf0 [] path_openat+0xea/0x3d30 [] do_filp_open+0x1b9/0x290 [] do_open_execat+0xce/0x5b0 [] open_exec+0x27/0x50 [] load_elf_binary+0x510/0x3ed0 [] bprm_execve+0x599/0x1240 [] do_execveat_common.isra.0+0x4c7/0x680 [] __x64_sys_execve+0x88/0xb0 [] do_syscall_64+0x35/0x80 If "interp_elf_ex" fails to allocate memory in load_elf_binary(), the program will take the "out_free_ph" error handing path, resulting in "interpreter" file resource is not released. Fix it by adding an error handing path "out_free_file", which will release the file resource when "interp_elf_ex" failed to allocate memory. Fixes: 0693ffebcfe5 ("fs/binfmt_elf.c: allocate less for static executable") Signed-off-by: Li Zetao Reviewed-by: Alexey Dobriyan Signed-off-by: Kees Cook Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221024154421.982230-1-lizetao1@huawei.com commit 5bf2fedca8f59379025b0d52f917b9ddb9bfe17e Author: Bernd Edlinger Date: Mon Jun 7 15:54:27 2021 +0200 exec: Copy oldsighand->action under spin-lock unshare_sighand should only access oldsighand->action while holding oldsighand->siglock, to make sure that newsighand->action is in a consistent state. Signed-off-by: Bernd Edlinger Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/AM8PR10MB470871DEBD1DED081F9CC391E4389@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM commit 72c3ebea375c39413d02113758319b74ecd790bd Author: Kees Cook Date: Thu Oct 6 16:00:17 2022 -0700 overflow: Refactor test skips for Clang-specific issues Convert test exclusion into test skipping. This brings the logic for why a test is being skipped into the test itself, instead of having to spread ifdefs around the code. This will make cleanup easier as minimum tests get raised. Drop __maybe_unused so missed tests will be noticed again and clean up whitespace. For example, clang-11 on i386: [15:52:32] ================== overflow (18 subtests) ================== [15:52:32] [PASSED] u8_u8__u8_overflow_test [15:52:32] [PASSED] s8_s8__s8_overflow_test [15:52:32] [PASSED] u16_u16__u16_overflow_test [15:52:32] [PASSED] s16_s16__s16_overflow_test [15:52:32] [PASSED] u32_u32__u32_overflow_test [15:52:32] [PASSED] s32_s32__s32_overflow_test [15:52:32] [SKIPPED] u64_u64__u64_overflow_test [15:52:32] [SKIPPED] s64_s64__s64_overflow_test [15:52:32] [SKIPPED] u32_u32__int_overflow_test [15:52:32] [PASSED] u32_u32__u8_overflow_test [15:52:32] [PASSED] u8_u8__int_overflow_test [15:52:32] [PASSED] int_int__u8_overflow_test [15:52:32] [PASSED] shift_sane_test [15:52:32] [PASSED] shift_overflow_test [15:52:32] [PASSED] shift_truncate_test [15:52:32] [PASSED] shift_nonsense_test [15:52:32] [PASSED] overflow_allocation_test [15:52:32] [PASSED] overflow_size_helpers_test [15:52:32] ==================== [PASSED] overflow ===================== [15:52:32] ============================================================ [15:52:32] Testing complete. Ran 18 tests: passed: 15, skipped: 3 Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Tom Rix Cc: Daniel Latypov Cc: "Gustavo A. R. Silva" Cc: Gwan-gyeong Mun Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20221006230017.1833458-1-keescook@chromium.org commit 0e5b9f25b27a7a92880f88f5dba3edf726ec5f61 Author: Nick Desaulniers Date: Thu Oct 6 10:17:51 2022 -0700 overflow: disable failing tests for older clang versions Building the overflow kunit tests with clang-11 fails with: $ ./tools/testing/kunit/kunit.py run --arch=arm --make_options LLVM=1 \ overflow ... ld.lld: error: undefined symbol: __mulodi4 ... Clang 11 and earlier generate unwanted libcalls for signed output, unsigned input. Disable these tests for now, but should these become used in the kernel we might consider that as justification for dropping clang-11 support. Keep the clang-11 build alive a little bit longer. Avoid -Wunused-function warnings via __maybe_unused. To test W=1: $ make LLVM=1 -j128 defconfig $ ./scripts/config -e KUNIT -e KUNIT_ALL $ make LLVM=1 -j128 olddefconfig lib/overflow_kunit.o W=1 Link: https://github.com/ClangBuiltLinux/linux/issues/1711 Link: https://github.com/llvm/llvm-project/commit/3203143f1356a4e4e3ada231156fc6da6e1a9f9d Reported-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20221006171751.3444575-1-ndesaulniers@google.com commit 31970608a6d3796c3adbfbfd379fa3092de65c5d Author: Kees Cook Date: Mon Sep 26 12:45:32 2022 -0700 overflow: Fix kern-doc markup for functions Fix the kern-doc markings for several of the overflow helpers and move their location into the core kernel API documentation, where it belongs (it's not driver-specific). Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: linux-hardening@vger.kernel.org Reviewed-by: Akira Yokosawa Signed-off-by: Kees Cook commit 74455fd7e459566198c8f1b2b33ca43a0c3ee8cb Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: 257449c6a50298bd ("x86/cpufeatures: Add LbrExtV2 feature bit") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Link: https://lore.kernel.org/lkml/Y1g6vGPqPhOrXoaN@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 49c75d30b0078d304bc0ae41026e629b23f6711e Author: Arnaldo Carvalho de Melo Date: Mon Jun 8 11:32:48 2020 -0300 tools headers uapi: Sync linux/stat.h with the kernel sources To pick the changes from: 825cf206ed510c4a ("statx: add direct I/O alignment information") That add a constant that was manually added to tools/perf/trace/beauty/statx.c, at some point this should move to the shell based automated way. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/stat.h' differs from latest version at 'include/uapi/linux/stat.h' diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h Cc: Eric Biggers Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/Y1gGQL5LonnuzeYd@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 82c50d8937f32f911a41739f7a51934a9ea8b92a Author: Arnaldo Carvalho de Melo Date: Wed Feb 12 11:04:23 2020 -0300 tools include UAPI: Sync sound/asound.h copy with the kernel sources Picking the changes from: 69ab6f5b00b1804e ("ALSA: Remove some left-over license text in include/uapi/sound/") Which entails no changes in the tooling side as it doesn't introduce new SNDRV_PCM_IOCTL_ ioctls. To silence this perf tools build warning: Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h' diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h Signed-off-by: Arnaldo Carvalho de Melo commit 036b8f5b8970e387eb3224eda45348de39135177 Author: Arnaldo Carvalho de Melo Date: Thu Mar 19 11:42:56 2020 -0300 tools headers uapi: Update linux/in.h copy To get the changes in: 65b32f801bfbc54d ("uapi: move IPPROTO_L2TP to in.h") 5854a09b49574da5 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper") That ends up automatically adding the new IPPROTO_L2TP to the socket args beautifiers: $ tools/perf/trace/beauty/socket.sh > before $ cp include/uapi/linux/in.h tools/include/uapi/linux/in.h $ tools/perf/trace/beauty/socket.sh > after $ diff -u before after --- before 2022-10-25 12:17:02.577892416 -0300 +++ after 2022-10-25 12:17:10.806113033 -0300 @@ -20,6 +20,7 @@ [98] = "ENCAP", [103] = "PIM", [108] = "COMP", + [115] = "L2TP", [132] = "SCTP", [136] = "UDPLITE", [137] = "MPLS", $ Now 'perf trace' will decode that 115 into "L2TP" and it will also be possible to use it in tracepoint filter expressions. Addresses this tools/perf 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: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Abeni Cc: Wojciech Drewek Cc: David S. Miller Cc: Gustavo A. R. Silva Link: https://lore.kernel.org/lkml/Y1f%2FGe6vjQrGjYiK@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit 4402e360d0f833c8c67b2fda0d3f612f4fd8b2cc Author: Arnaldo Carvalho de Melo Date: Mon Dec 2 11:40:57 2019 -0300 tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench' We also need to add SYM_TYPED_FUNC_START() to util/include/linux/linkage.h and update tools/perf/check_headers.sh to ignore the include cfi_types.h line when checking if the kernel original files drifted from the copies we carry. This is to get the changes from: ccace936eec7b805 ("x86: Add types to indirectly called assembly functions") Addressing these tools/perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Kees Cook Cc: Sami Tolvanen Link: https://lore.kernel.org/lkml/Y1f3VRIec9EBgX6F@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit ffc1df3dc97ee2aad6d2a94e4615c2a96cf291ad Author: Arnaldo Carvalho de Melo Date: Sat Apr 9 11:48:15 2022 -0300 tools headers arm64: Sync arm64's cputype.h with the kernel sources To get the changes in: 0e5d5ae837c8ce04 ("arm64: Add AMPERE1 to the Spectre-BHB affected list") That addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h' diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h Cc: Catalin Marinas Cc: D Scott Phillips https://lore.kernel.org/lkml/Y1fy5GD7ZYvkeufv@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 246122a856faddd87df3063c0dd38a62b40ceeab Author: Namhyung Kim Date: Fri Oct 21 11:10:55 2022 -0700 perf test: Do not fail Intel-PT misc test w/o libpython The virtual LBR test uses a python script to check the max size of branch stack in the Intel-PT generated LBR. But it didn't check whether python scripting is available (as it's optional). Let's skip the test if the python support is not available. Fixes: f77811a0f62577d2 ("perf test: test_intel_pt.sh: Add 9 tests") Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Ammy Yi Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221021181055.60183-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5a6c184a72a375072cffe788d93ad6052c48f16b Author: Thomas Richter Date: Fri Oct 21 10:25:57 2022 +0200 perf list: Fix PMU name pai_crypto in perf list on s390 Commit e0b23af82d6f454c ("perf list: Add PMU pai_crypto event description for IBM z16") introduced the "Processor Activity Instrumentation" for cryptographic counters for z16. The PMU device driver exports the counters via sysfs files listed in directory /sys/devices/pai_crypto. To specify an event from that PMU, use 'perf stat -e pai_crypto/XXX/'. However the JSON file mentioned in above commit exports the counter decriptions in file pmu-events/arch/s390/cf_z16/pai.json. Rename this file to pmu-events/arch/s390/cf_z16/pai_crypto.json to make the naming consistent. Now 'perf list' shows the counter names under pai_crypto section: pai_crypto: CRYPTO_ALL [CRYPTO ALL. Unit: pai_crypto] ... Output before was pai: CRYPTO_ALL [CRYPTO ALL. Unit: pai_crypto] ... Fixes: e0b23af82d6f454c ("perf list: Add PMU pai_crypto event description for IBM z16") Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Cc: Heiko Carstens Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20221021082557.2695382-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 304f0a2f6a6d9336fb5e474d7f62b8677d5ee167 Author: Ian Rogers Date: Sun Oct 23 18:10:24 2022 -0700 perf record: Fix event fd races The write call may set errno which is problematic if occurring in a function also setting errno. Save and restore errno around the write call. done_fd may be used after close, clear it as part of the close and check its validity in the signal handler. Suggested-by: Reviewed-by: Leo Yan Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Anand K Mistry Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20221024011024.462518-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f1bdebbb67bd21d7c5dfc42f313f2f54002440b8 Author: Arnaldo Carvalho de Melo Date: Wed Oct 19 08:44:17 2022 -0400 perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available During the transition to libbpf 1.0 some functions that perf used were deprecated and finally removed from libbpf, so bpf_program__set_insns() was introduced for perf to continue to use its bpf loader. But when build with LIBBPF_DYNAMIC=1 we now need to check if that function is available so that perf can build with older libbpf versions, even if the end result is emitting a warning to the user that the use of the perf BPF loader requires a newer libbpf, since bpf_program__set_insns() touches libbpf objects internal state. This affects only 'perf trace' when using bpf C code or pre-compiled bytecode as an event. Noticed on RHEL9, that has libbpf 0.7.0, where bpf_program__set_insns() isn't available. Signed-off-by: Arnaldo Carvalho de Melo commit 409fb6bdd6eaf64c2da174b48b30ae032a9d7554 Author: Arnaldo Carvalho de Melo Date: Tue Oct 18 21:47:51 2022 -0300 perf bpf: Fix build with libbpf 0.7.0 by adding prototype for bpf_load_program() The bpf_load_program() prototype appeared in tools/lib/bpf/bpf.h as deprecated, but nowadays its completely removed, so add it back for building with the system libbpf when using 'make LIBBPF_DYNAMIC=1'. This is a stop gap hack till we do like tools/bpf does with bpftool, i.e. bootstrap the libbpf build and install it in the perf build directory when not using 'make LIBBPF_DYNAMIC=1'. That has to be done to all libraries in tools/lib/, so tha we can remove -Itools/lib/ from the tools/perf CFLAGS. Noticed when building with LIBBPF_DYNAMIC=1 and libbpf 0.7.0 on RHEL9. Signed-off-by: Arnaldo Carvalho de Melo commit b92dd11725a7c57f55e148c7d3ce58a86f480575 Author: Kajol Jain Date: Fri Oct 14 19:32:20 2022 +0530 perf vendor events power10: Fix hv-24x7 metric events Testcase stat_all_metrics.sh fails in powerpc: 90: perf all metrics test : FAILED! The testcase "stat_all_metrics.sh" verifies perf stat result for all the metric events present in perf list. It runs perf metric events with various commands and expects non-empty metric result. Incase of powerpc:hv-24x7 events, some of the event count can be 0 based on system configuration. And if that event used as denominator in divide equation, it can cause divide by 0 error. The current nest_metric.json file creating divide by 0 issue for some of the metric events, which results in failure of the "stat_all_metrics.sh" test case. Most of the metrics events have cycles or an event which expect to have a larger value as denominator, so adding 1 to the denominator of the metric expression as a fix. Result in powerpc box after this patch changes: 90: perf all metrics test : Ok Fixes: a3cbcadfdfc330c2 ("perf vendor events power10: Adds 24x7 nest metric events for power10 platform") Signed-off-by: Kajol Jain Reviewed-by: Madhavan Srinivasan Cc: Athira Jajeev Cc: Disha Goel Cc: Jiri Olsa Cc: Kajol Jain Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman Cc: Nageswara R Sastry Link: https://lore.kernel.org/r/20221014140220.122251-1-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 231e61bc2e87486270686f7bc3c43c4fb3b0e0b9 Author: Adrian Hunter Date: Mon Oct 17 12:35:49 2022 +0300 perf docs: Fix man page build wrt perf-arm-coresight.txt perf build assumes documentation files starting with "perf-" are man pages but perf-arm-coresight.txt is not a man page: asciidoc: ERROR: perf-arm-coresight.txt: line 2: malformed manpage title asciidoc: ERROR: perf-arm-coresight.txt: line 3: name section expected asciidoc: FAILED: perf-arm-coresight.txt: line 3: section title expected make[3]: *** [Makefile:266: perf-arm-coresight.xml] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [Makefile.perf:895: man] Error 2 Fix by renaming it. Fixes: dc2e0fb00bb2b24f ("perf test coresight: Add relevant documentation about ARM64 CoreSight testing") Reported-by: Christian Borntraeger Reported-by: Sven Schnelle Reviewed-by: Leo Yan Signed-off-by: Adrian Hunter Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: coresight@lists.linaro.org Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Link: https://lore.kernel.org/r/a176a3e1-6ddc-bb63-e41c-15cda8c2d5d2@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 88864611940ae7dd5a9d40667287c4c9fa455140 Author: Arnaldo Carvalho de Melo Date: Wed Sep 8 16:09:08 2021 -0300 tools headers UAPI: Sync powerpc syscall tables with the kernel sources To pick the changes in these csets: e237506238352f3b ("powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs") That doesn't cause any changes in the perf tools. As a reminder, this table is used in tools perf to allow features such as: [root@five ~]# perf trace -e set_mempolicy_home_node ^C[root@five ~]# [root@five ~]# perf trace -v -e set_mempolicy_home_node Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 253729 && common_pid != 3585) && (id == 450) mmap size 528384B ^C[root@five ~] [root@five ~]# perf trace -v -e set* --max-events 5 Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 253734 && common_pid != 3585) && (id == 38 || id == 54 || id == 105 || id == 106 || id == 109 || id == 112 || id == 113 || id == 114 || id == 116 || id == 117 || id == 119 || id == 122 || id == 123 || id == 141 || id == 160 || id == 164 || id == 170 || id == 171 || id == 188 || id == 205 || id == 218 || id == 238 || id == 273 || id == 308 || id == 450) mmap size 528384B 0.000 ( 0.008 ms): bash/253735 setpgid(pid: 253735 (bash), pgid: 253735 (bash)) = 0 6849.011 ( 0.008 ms): bash/16046 setpgid(pid: 253736 (bash), pgid: 253736 (bash)) = 0 6849.080 ( 0.005 ms): bash/253736 setpgid(pid: 253736 (bash), pgid: 253736 (bash)) = 0 7437.718 ( 0.009 ms): gnome-shell/253737 set_robust_list(head: 0x7f34b527e920, len: 24) = 0 13445.986 ( 0.010 ms): bash/16046 setpgid(pid: 253738 (bash), pgid: 253738 (bash)) = 0 [root@five ~]# That is the filter expression attached to the raw_syscalls:sys_{enter,exit} tracepoints. $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w set_mempolicy_home_node tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/s390/entry/syscalls/syscall.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node $ $ grep -w set_mempolicy_home_node /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c [450] = "set_mempolicy_home_node", $ This addresses these perf build warnings: Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h' diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl' diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl' diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl Warning: Kernel ABI header at 'tools/perf/arch/s390/entry/syscalls/syscall.tbl' differs from latest version at 'arch/s390/kernel/syscalls/syscall.tbl' diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl' diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Michael Ellerman Cc: Nicholas Piggin Link: https://lore.kernel.org/lkml/Y01HN2DGkWz8tC%2FJ@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit 4dc12f37a8e98e1dca5521c14625c869537b50b6 Merge: 1a2dcbdde82e3 e9cf4d9b9a6fd Author: Linus Torvalds Date: Tue Oct 25 12:05:08 2022 -0700 Merge tag 'platform-drivers-x86-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "The only thing which stands out is a fix for a backlight regression on Chromebooks (under drivers/acpi, with ack from Rafael). Other then that nothing special to report just various small fixes and hardware-id additions" * tag 'platform-drivers-x86-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: ACPI: video: Fix missing native backlight on Chromebooks platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver leds: simatic-ipc-leds-gpio: fix incorrect LED to GPIO mapping platform/x86/amd: pmc: Read SMU version during suspend on Cezanne systems platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models platform/x86: asus-wmi: Add support for ROG X16 tablet mode commit 92e10465acaffcf65e803f40e884ffa86fd3ff2f Author: Andy Shevchenko Date: Thu Oct 6 15:38:07 2022 +0300 device property: Fix documentation for *_match_string() APIs The returned value on success is an index of the matching string, starting from 0. Reflect this in the documentation. Fixes: 3f5c8d318785 ("device property: Add fwnode_property_match_string()") Signed-off-by: Andy Shevchenko Reviewed-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 5aed5b7c2430ce318a8e62f752f181e66f0d1053 Author: Mathias Nyman Date: Mon Oct 24 17:27:20 2022 +0300 xhci: Remove device endpoints from bandwidth list when freeing the device Endpoints are normally deleted from the bandwidth list when they are dropped, before the virt device is freed. If xHC host is dying or being removed then the endpoints aren't dropped cleanly due to functions returning early to avoid interacting with a non-accessible host controller. So check and delete endpoints that are still on the bandwidth list when freeing the virt device. Solves a list_del corruption kernel crash when unbinding xhci-pci, caused by xhci_mem_cleanup() when it later tried to delete already freed endpoints from the bandwidth list. This only affects hosts that use software bandwidth checking, which currenty is only the xHC in intel Panther Point PCH (Ivy Bridge) Cc: stable@vger.kernel.org Reported-by: Marek Marczykowski-Górecki Tested-by: Marek Marczykowski-Górecki Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20221024142720.4122053-5-mathias.nyman@intel.com Signed-off-by: Greg Kroah-Hartman commit a611bf473d1f77b70f7188b5577542cb39b4701b Author: Mario Limonciello Date: Mon Oct 24 17:27:19 2022 +0300 xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices. As both AMD and Intel have released new products with new XHCI controllers this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported. In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly: * AMD Yellow Carp * Intel Alder Lake * Intel Meteor Lake * Intel Raptor Lake [keep PCI ID for Alder Lake PCH for recently added quirk -Mathias] Cc: stable@vger.kernel.org Suggested-by: Mathias Nyman Link: https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf Signed-off-by: Mario Limonciello Reviewed-by: Mika Westerberg Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20221024142720.4122053-4-mathias.nyman@intel.com Signed-off-by: Greg Kroah-Hartman commit 34cd2db408d591bc15771cbcc90939ade0a99a21 Author: Mathias Nyman Date: Mon Oct 24 17:27:18 2022 +0300 xhci: Add quirk to reset host back to default state at shutdown Systems based on Alder Lake P see significant boot time delay if boot firmware tries to control usb ports in unexpected link states. This is seen with self-powered usb devices that survive in U3 link suspended state over S5. A more generic solution to power off ports at shutdown was attempted in commit 83810f84ecf1 ("xhci: turn off port power in shutdown") but it caused regression. Add host specific XHCI_RESET_TO_DEFAULT quirk which will reset host and ports back to default state in shutdown. Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20221024142720.4122053-3-mathias.nyman@intel.com Signed-off-by: Greg Kroah-Hartman commit 4f547472380136718b56064ea5689a61e135f904 Author: Jens Glathe Date: Mon Oct 24 17:27:17 2022 +0300 usb: xhci: add XHCI_SPURIOUS_SUCCESS to ASM1042 despite being a V0.96 controller This appears to fix the error: "xhci_hcd
; ERROR Transfer event TRB DMA ptr not part of current TD ep_index 2 comp_code 13" that appear spuriously (or pretty often) when using a r8152 USB3 ethernet adapter with integrated hub. ASM1042 reports as a 0.96 controller, but appears to behave more like 1.0 Inspired by this email thread: https://markmail.org/thread/7vzqbe7t6du6qsw3 Cc: stable@vger.kernel.org Signed-off-by: Jens Glathe Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20221024142720.4122053-2-mathias.nyman@intel.com Signed-off-by: Greg Kroah-Hartman commit 937ec9f7d5f2625d60077bb7824fee35dc447c6e Author: Jason A. Donenfeld Date: Tue Oct 25 14:21:50 2022 +0200 staging: rtl8192e: remove bogus ssid character sign test This error triggers on some architectures with unsigned `char` types: drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' But actually, the entire test is bogus, as ssids don't have any sign validity rules like that. So just remove this check look all together. Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Jason A. Donenfeld Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20221025122150.583617-1-Jason@zx2c4.com Signed-off-by: Greg Kroah-Hartman commit 677047383296ea25fdfc001be3cdcdf5cc874be2 Author: Jason A. Donenfeld Date: Tue Oct 25 04:52:23 2022 +0200 misc: sgi-gru: use explicitly signed char With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: drivers/misc/sgi-gru/grumain.c:711 gru_check_chiplet_assignment() warn: 'gts->ts_user_chiplet_id' is unsigned Cc: Dimitri Sivanich Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20221025025223.573543-1-Jason@zx2c4.com Signed-off-by: Greg Kroah-Hartman commit 1deac35b2dbc27dd53665a4db9c6d05b323deea3 Merge: 6746eae4bbadd d501d37841d3b Author: Greg Kroah-Hartman Date: Tue Oct 25 19:08:40 2022 +0200 Merge tag 'counter-fixes-for-6.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus William writes: "First set of Counter fixes for 6.1 cycle Typical driver fixes for races and bugs. This also includes a sparse warning fix for the recently introduced counter_array API: the macro DEFINE_COUNTER_ARRAY_POLARITY() is reduced to a simple structure definition rather than multiple data structure definitions. - 104-quad-8 * Fix race getting function mode and direction - microchip-tcb-capture * Handle Signal1 read and Synapse - ti-ecap-capture * fix IS_ERR() vs NULL check - counter * Reduce DEFINE_COUNTER_ARRAY_POLARITY() to defining counter_array" * tag 'counter-fixes-for-6.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: 104-quad-8: Fix race getting function mode and direction counter: microchip-tcb-capture: Handle Signal1 read and Synapse counter: ti-ecap-capture: fix IS_ERR() vs NULL check counter: Reduce DEFINE_COUNTER_ARRAY_POLARITY() to defining counter_array commit 6746eae4bbaddcc16b40efb33dab79210828b3ce Author: James Clark Date: Tue Oct 25 14:10:32 2022 +0100 coresight: cti: Fix hang in cti_disable_hw() cti_enable_hw() and cti_disable_hw() are called from an atomic context so shouldn't use runtime PM because it can result in a sleep when communicating with firmware. Since commit 3c6656337852 ("Revert "firmware: arm_scmi: Add clock management to the SCMI power domain""), this causes a hang on Juno when running the Perf Coresight tests or running this command: perf record -e cs_etm//u -- ls This was also missed until the revert commit because pm_runtime_put() was called with the wrong device until commit 692c9a499b28 ("coresight: cti: Correct the parameter for pm_runtime_put") With lock and scheduler debugging enabled the following is output: coresight cti_sys0: cti_enable_hw -- dev:cti_sys0 parent: 20020000.cti BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1151 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 330, name: perf-exec preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0xa0c/0x1948 softirqs last enabled at (0): [] copy_process+0xa0c/0x1948 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 3 PID: 330 Comm: perf-exec Not tainted 6.0.0-00053-g042116d99298 #7 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Sep 13 2022 Call trace: dump_backtrace+0x134/0x140 show_stack+0x20/0x58 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 __might_resched+0x180/0x228 __might_sleep+0x50/0x88 __pm_runtime_resume+0xac/0xb0 cti_enable+0x44/0x120 coresight_control_assoc_ectdev+0xc0/0x150 coresight_enable_path+0xb4/0x288 etm_event_start+0x138/0x170 etm_event_add+0x48/0x70 event_sched_in.isra.122+0xb4/0x280 merge_sched_in+0x1fc/0x3d0 visit_groups_merge.constprop.137+0x16c/0x4b0 ctx_sched_in+0x114/0x1f0 perf_event_sched_in+0x60/0x90 ctx_resched+0x68/0xb0 perf_event_exec+0x138/0x508 begin_new_exec+0x52c/0xd40 load_elf_binary+0x6b8/0x17d0 bprm_execve+0x360/0x7f8 do_execveat_common.isra.47+0x218/0x238 __arm64_sys_execve+0x48/0x60 invoke_syscall+0x4c/0x110 el0_svc_common.constprop.4+0xfc/0x120 do_el0_svc+0x34/0xc0 el0_svc+0x40/0x98 el0t_64_sync_handler+0x98/0xc0 el0t_64_sync+0x170/0x174 Fix the issue by removing the runtime PM calls completely. They are not needed here because it must have already been done when building the path for a trace. Fixes: 835d722ba10a ("coresight: cti: Initial CoreSight CTI Driver") Cc: stable Reported-by: Aishwarya TCV Reported-by: Cristian Marussi Suggested-by: Suzuki K Poulose Signed-off-by: James Clark Reviewed-by: Mike Leach Tested-by: Mike Leach [ Fix build warnings ] Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20221025131032.1149459-1-suzuki.poulose@arm.com Signed-off-by: Greg Kroah-Hartman commit 3f53c329b31d53b2a2e7992819242fc0d4f883e0 Author: Patrice Chotard Date: Fri Sep 30 16:20:18 2022 +0200 usb: dwc3: st: Rely on child's compatible instead of name To ensure that child node is found, don't rely on child's node name which can take different value, but on child's compatible name. Fixes: f5c5936d6b4d ("usb: dwc3: st: Fix node's child name") Cc: stable Cc: Jerome Audu Reported-by: Felipe Balbi Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220930142018.890535-1-patrice.chotard@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 19905240aef0181d1e6944070eb85fce75f75bcd Author: Michael Grzeschik Date: Tue Oct 18 00:11:41 2022 +0200 usb: gadget: uvc: limit isoc_sg to super speed gadgets The overhead of preparing sg data is high for transfers with limited payload. When transferring isoc over high-speed usb the maximum payload is rather small which is a good argument no to use sg. This patch is changing the uvc_video_encode_isoc_sg encode function only to be used for super speed gadgets. Signed-off-by: Michael Grzeschik Cc: stable Link: https://lore.kernel.org/r/20221017221141.3134818-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9bfb09774ea40937b6c6d6e07858e0f7ad1991ec Author: Todd Brandt Date: Thu Oct 20 02:23:10 2022 -0700 pm-graph v5.10 sleepgraph: - add -wifitrace argument for tracing all the way to wifi reconnect - include more data in ftrace to mark the end of kernel resume - add async_synchronize_full to the list of funcs to chart - add thermal zone info to the log data - include a check for s0ix support (s2idle is the default mem_sleep) - if s2idle does not support s0ix, remove the SYS%LPI turbostat var - fix -dev crash when kprobe caller is just an address (not a symbol) - fix the cpuexec data in -proc to display in resume sleepgraph.8: - add -wifitrace documentation README: - change links from 01.org to developer.intel.com Signed-off-by: Todd Brandt Signed-off-by: Rafael J. Wysocki commit de547896aac606a00435a219757a940ece142bf0 Author: Hans Verkuil Date: Mon Oct 17 15:15:05 2022 +0100 media: vivid.rst: loop_video is set on the capture devnode The example on how to use and test Capture Overlay specified the wrong video device node. Back in 2015 the loop_video control moved from the output device to the capture device, but this example code is still referring to the output video device. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 69d78a80da4ef12faf2a6f9cfa2097ab4ac43983 Author: Hans Verkuil Date: Mon Oct 17 15:09:06 2022 +0100 media: vivid: set num_in/outputs to 0 if not supported If node_types does not have video/vbi/meta inputs or outputs, then set num_inputs/num_outputs to 0 instead of 1. Signed-off-by: Hans Verkuil Fixes: 0c90f649d2f5 (media: vivid: add vivid_create_queue() helper) Signed-off-by: Mauro Carvalho Chehab commit 957148e22870e4021082dddd12f8619a49d9bb50 Author: Hans Verkuil Date: Wed Oct 12 15:31:51 2022 +0100 media: vivid: drop GFP_DMA32 >From what I can see, this is not needed. And since using it issues a 'deprecated' warning, just drop it. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eb1d969203eb8212741751f88dcf5cb56bb11830 Author: Hans Verkuil Date: Fri Oct 21 13:21:25 2022 +0100 media: vivid: fix control handler mutex deadlock vivid_update_format_cap() can be called from an s_ctrl callback. In that case (keep_controls == true) no control framework functions can be called that take the control handler mutex. The new call to v4l2_ctrl_modify_dimensions() did exactly that. Signed-off-by: Hans Verkuil Fixes: 6bc7643d1b9c (media: vivid: add pixel_array test control) Signed-off-by: Mauro Carvalho Chehab commit 8da7f0976b9071b528c545008de9d10cc81883b1 Author: Hans Verkuil Date: Wed Oct 12 16:46:17 2022 +0100 media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced' If it is a progressive (non-interlaced) format, then ignore the interlaced timing values. Signed-off-by: Hans Verkuil Fixes: 7f68127fa11f ([media] videodev2.h: defines to calculate blanking and frame sizes) Signed-off-by: Mauro Carvalho Chehab commit 4b6d66a45ed34a15721cb9e11492fa1a24bc83df Author: Hans Verkuil Date: Thu Oct 13 09:00:34 2022 +0100 media: v4l2-dv-timings: add sanity checks for blanking values Add sanity checks to v4l2_valid_dv_timings() to ensure that the provided blanking values are reasonable. Signed-off-by: Hans Verkuil Fixes: b18787ed1ce3 ([media] v4l2-dv-timings: add new helper module) Signed-off-by: Mauro Carvalho Chehab commit 1f65ea411cc7b6ff128d82a3493d7b5648054e6f Author: Hans Verkuil Date: Thu Oct 13 15:18:46 2022 +0100 media: vivid: dev->bitmap_cap wasn't freed in all cases Whenever the compose width/height values change, the dev->bitmap_cap vmalloc'ed array must be freed and dev->bitmap_cap set to NULL. This was done in some places, but not all. This is only an issue if overlay support is enabled and the bitmap clipping is used. Signed-off-by: Hans Verkuil Fixes: ef834f7836ec ([media] vivid: add the video capture and output parts) Signed-off-by: Mauro Carvalho Chehab commit f8bcaf714abfc94818dff8c0db84d750433984f4 Author: Hans Verkuil Date: Wed Oct 12 15:32:28 2022 +0100 media: vivid: s_fbuf: add more sanity checks VIDIOC_S_FBUF is by definition a scary ioctl, which is why only root can use it. But at least check if the framebuffer parameters match that of one of the framebuffer created by vivid, and reject anything else. Signed-off-by: Hans Verkuil Fixes: ef834f7836ec ([media] vivid: add the video capture and output parts) Signed-off-by: Mauro Carvalho Chehab commit 6853a71726b6f5930b4450889faf02e8f1cfe35c Author: Quentin Perret Date: Tue Oct 25 14:51:56 2022 +0000 KVM: arm64: Use correct accessor to parse stage-1 PTEs hyp_get_page_state() is used with pKVM to retrieve metadata about a page by parsing a hypervisor stage-1 PTE. However, it incorrectly uses a helper which parses *stage-2* mappings. Ouch. Luckily, pkvm_getstate() only looks at the software bits, which happen to be in the same place for stage-1 and stage-2 PTEs, and this all ends up working correctly by accident. But clearly, we should do better. Fix hyp_get_page_state() to use the correct helper. Fixes: e82edcc75c4e ("KVM: arm64: Implement do_share() helper for sharing memory") Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221025145156.855308-1-qperret@google.com commit fe8714b04fb137aa62e9a69424c48b5301b721b9 Author: Keith Busch Date: Mon Oct 24 11:57:45 2022 -0700 nvme-multipath: set queue dma alignment to 3 NVMe spec requires all transports support dword aligned addresses, which is already set in the namespace request_queue. Set the same limit in the multipath device's request_queue as well. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 83e1226b0ee2d7e3fb6e002fbbfc6ab36aabdc35 Author: Sagi Grimberg Date: Sun Oct 23 11:04:43 2022 +0300 nvme-tcp: fix possible circular locking when deleting a controller under memory pressure When destroying a queue, when calling sock_release, the network stack might need to allocate an skb to send a FIN/RST. When that happens during memory pressure, there is a need to reclaim memory, which in turn may ask the nvme-tcp device to write out dirty pages, however this is not possible due to a ctrl teardown that is going on. Set PF_MEMALLOC to the task that releases the socket to grant access to PF_MEMALLOC reserves. In addition, do the same for the nvme-tcp thread as this may also originate from the swap itself and should be more resilient to memory pressure situations. This fixes the following lockdep complaint: -- ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc2+ #25 Tainted: G W ------------------------------------------------------ kswapd0/92 is trying to acquire lock: ffff888114003240 (sk_lock-AF_INET-NVME){+.+.}-{0:0}, at: tcp_sendpage+0x23/0xa0 but task is already holding lock: ffffffff97e95ca0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x987/0x10d0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: fs_reclaim_acquire+0x11e/0x160 kmem_cache_alloc_node+0x44/0x530 __alloc_skb+0x158/0x230 tcp_send_active_reset+0x7e/0x730 tcp_disconnect+0x1272/0x1ae0 __tcp_close+0x707/0xd90 tcp_close+0x26/0x80 inet_release+0xfa/0x220 sock_release+0x85/0x1a0 nvme_tcp_free_queue+0x1fd/0x470 [nvme_tcp] nvme_do_delete_ctrl+0x130/0x13d [nvme_core] nvme_sysfs_delete.cold+0x8/0xd [nvme_core] kernfs_fop_write_iter+0x356/0x530 vfs_write+0x4e8/0xce0 ksys_write+0xfd/0x1d0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_INET-NVME){+.+.}-{0:0}: __lock_acquire+0x2a0c/0x5690 lock_acquire+0x18e/0x4f0 lock_sock_nested+0x37/0xc0 tcp_sendpage+0x23/0xa0 inet_sendpage+0xad/0x120 kernel_sendpage+0x156/0x440 nvme_tcp_try_send+0x48a/0x2630 [nvme_tcp] nvme_tcp_queue_rq+0xefb/0x17e0 [nvme_tcp] __blk_mq_try_issue_directly+0x452/0x660 blk_mq_plug_issue_direct.constprop.0+0x207/0x700 blk_mq_flush_plug_list+0x6f5/0xc70 __blk_flush_plug+0x264/0x410 blk_finish_plug+0x4b/0xa0 shrink_lruvec+0x1263/0x1ea0 shrink_node+0x736/0x1a80 balance_pgdat+0x740/0x10d0 kswapd+0x5f2/0xaf0 kthread+0x256/0x2f0 ret_from_fork+0x1f/0x30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(sk_lock-AF_INET-NVME); lock(fs_reclaim); lock(sk_lock-AF_INET-NVME); *** DEADLOCK *** 3 locks held by kswapd0/92: #0: ffffffff97e95ca0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x987/0x10d0 #1: ffff88811f21b0b0 (q->srcu){....}-{0:0}, at: blk_mq_flush_plug_list+0x6b3/0xc70 #2: ffff888170b11470 (&queue->send_mutex){+.+.}-{3:3}, at: nvme_tcp_queue_rq+0xeb9/0x17e0 [nvme_tcp] Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Reported-by: Daniel Wagner Signed-off-by: Sagi Grimberg Tested-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 5fa9add66b00ad0c796185ff7438eaa3e67c1187 Author: Nam Cao Date: Sat Oct 22 19:46:36 2022 +0200 nvme-tcp: replace sg_init_marker() with sg_init_table() In nvme_tcp_ddgst_update(), sg_init_marker() is called with an uninitialized scatterlist. This is probably fine, but gcc complains: CC [M] drivers/nvme/host/tcp.o In file included from ./include/linux/dma-mapping.h:10, from ./include/linux/skbuff.h:31, from ./include/net/net_namespace.h:43, from ./include/linux/netdevice.h:38, from ./include/net/sock.h:46, from drivers/nvme/host/tcp.c:12: In function ‘sg_mark_end’, inlined from ‘sg_init_marker’ at ./include/linux/scatterlist.h:356:2, inlined from ‘nvme_tcp_ddgst_update’ at drivers/nvme/host/tcp.c:390:2: ./include/linux/scatterlist.h:234:11: error: ‘sg.page_link’ is used uninitialized [-Werror=uninitialized] 234 | sg->page_link |= SG_END; | ~~^~~~~~~~~~~ drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’: drivers/nvme/host/tcp.c:388:28: note: ‘sg’ declared here 388 | struct scatterlist sg; | ^~ cc1: all warnings being treated as errors Use sg_init_table() instead, which basically memset the scatterlist to zero first before calling sg_init_marker(). Signed-off-by: Nam Cao Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 50895a55bcfde8ac6f22a37c6bc8cff506b3c7c6 Author: Jason A. Donenfeld Date: Tue Oct 25 02:03:13 2022 +0200 ALSA: rme9652: use explicitly signed char With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: sound/pci/rme9652/hdsp.c:3953 hdsp_channel_buffer_location() warn: 'hdsp->channel_map[channel]' is unsigned sound/pci/rme9652/hdsp.c:4153 snd_hdsp_channel_info() warn: impossible condition '(hdsp->channel_map[channel] < 0) => (0-255 < 0)' sound/pci/rme9652/rme9652.c:1833 rme9652_channel_buffer_location() warn: 'rme9652->channel_map[channel]' is unsigned Signed-off-by: Jason A. Donenfeld Cc: Link: https://lore.kernel.org/r/20221025000313.546261-1-Jason@zx2c4.com Signed-off-by: Takashi Iwai commit ee03c0f200eb0d9f22dd8732d9fb7956d91019c2 Author: Jason A. Donenfeld Date: Mon Oct 24 18:29:29 2022 +0200 ALSA: au88x0: use explicitly signed char With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)' sound/pci/au88x0/au88x0_core.c:2046 vortex_adb_checkinout() warn: signedness bug returning '(-12)' sound/pci/au88x0/au88x0_core.c:2125 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, (0), en, 0)' is unsigned sound/pci/au88x0/au88x0_core.c:2170 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, stream->resources, en, 4)' is unsigned As well, since one function returns errnos, return an `int` rather than a `signed char`. Signed-off-by: Jason A. Donenfeld Cc: Link: https://lore.kernel.org/r/20221024162929.536004-1-Jason@zx2c4.com Signed-off-by: Takashi Iwai commit f5c8cf2a4992dd929fa0c2f25c09ee69b8dcbce1 Author: Rafael J. Wysocki Date: Mon Oct 24 21:22:48 2022 +0200 cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores Commit 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration") attempted to use the information from CPPC (the nominal performance in particular) to obtain the scaling factor allowing the frequency to be computed if the HWP performance level of the given CPU is known or vice versa. However, it turns out that on some platforms this doesn't work, because the CPPC information on them does not align with the contents of the MSR_HWP_CAPABILITIES registers. This basically means that the only way to make intel_pstate work on all of the hybrid platforms to date is to use the observation that on all of them the scaling factor between the HWP performance levels and frequency for P-cores is 78741 (approximately 100000/1.27). For E-cores it is 100000, which is the same as for all of the non-hybrid "core" platforms and does not require any changes. Accordingly, make intel_pstate use 78741 as the scaling factor between HWP performance levels and frequency for P-cores on all hybrid platforms and drop the dependency of the HWP calibration code on CPPC. Fixes: 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration") Reported-by: Srinivas Pandruvada Acked-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Cc: 5.15+ # 5.15+ Signed-off-by: Rafael J. Wysocki commit 8dbab94d45fb1094cefac7956b7fb987a36e2b12 Author: Rafael J. Wysocki Date: Mon Oct 24 21:21:00 2022 +0200 cpufreq: intel_pstate: Read all MSRs on the target CPU Some of the MSR accesses in intel_pstate are carried out on the CPU that is running the code, but the values coming from them are used for the performance scaling of the other CPUs. This is problematic, for example, on hybrid platforms where MSR_TURBO_RATIO_LIMIT for P-cores and E-cores is different, so the values read from it on a P-core are generally not applicable to E-cores and the other way around. For this reason, make the driver access all MSRs on the target CPU on platforms using the "core" pstate_funcs callbacks which is the case for all of the hybrid platforms released to date. For this purpose, pass a CPU argument to the ->get_max(), ->get_max_physical(), ->get_min() and ->get_turbo() pstate_funcs callbacks and from there pass it to rdmsrl_on_cpu() or rdmsrl_safe_on_cpu() to access the MSR on the target CPU. Fixes: 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration") Acked-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Cc: 5.15+ # 5.15+ Signed-off-by: Rafael J. Wysocki commit 85850af4fc47132f3f2f0dd698b90f67906600b4 Author: Mario Limonciello Date: Wed Oct 12 22:50:17 2022 -0500 PM: hibernate: Allow hybrid sleep to work with s2idle Hybrid sleep is currently hardcoded to only operate with S3 even on systems that might not support it. Instead of assuming this mode is what the user wants to use, for hybrid sleep follow the setting of `mem_sleep_current` which will respect mem_sleep_default kernel command line and policy decisions made by the presence of the FADT low power idle bit. Fixes: 81d45bdf8913 ("PM / hibernate: Untangle power_down()") Reported-and-tested-by: kolAflash Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574 Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit b3af84383e7abdc5e63435817bb73a268e7c3637 Author: Christian König Date: Tue Sep 27 18:43:03 2022 +0200 drm/scheduler: fix fence ref counting We leaked dependency fences when processes were beeing killed. Additional to that grab a reference to the last scheduled fence. Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220929180151.139751-1-christian.koenig@amd.com commit 88619e77b33d5718fae3c13d29f94b2646facfcd Author: Benjamin Gaignard Date: Fri Oct 21 19:24:22 2022 +0200 net: stmmac: rk3588: Allow multiple gmac controller RK3588(s) can have multiple gmac controllers. Re-use rk3568 logic to distinguish them. Fixes: 2f2b60a0ec28 ("net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588") Signed-off-by: Benjamin Gaignard Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20221021172422.88534-1-sebastian.reichel@collabora.com Signed-off-by: Paolo Abeni commit 76a66ba101329316a5d7f4275070be22eb85fdf2 Author: Qu Wenruo Date: Fri Oct 21 08:43:45 2022 +0800 btrfs: don't use btrfs_chunk::sub_stripes from disk [BUG] There are two reports (the earliest one from LKP, a more recent one from kernel bugzilla) that we can have some chunks with 0 as sub_stripes. This will cause divide-by-zero errors at btrfs_rmap_block, which is introduced by a recent kernel patch ac0677348f3c ("btrfs: merge calculations for simple striped profiles in btrfs_rmap_block"): if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID10)) { stripe_nr = stripe_nr * map->num_stripes + i; stripe_nr = div_u64(stripe_nr, map->sub_stripes); <<< } [CAUSE] From the more recent report, it has been proven that we have some chunks with 0 as sub_stripes, mostly caused by older mkfs. It turns out that the mkfs.btrfs fix is only introduced in 6718ab4d33aa ("btrfs-progs: Initialize sub_stripes to 1 in btrfs_alloc_data_chunk") which is included in v5.4 btrfs-progs release. So there would be quite some old filesystems with such 0 sub_stripes. [FIX] Just don't trust the sub_stripes values from disk. We have a trusted btrfs_raid_array[] to fetch the correct sub_stripes numbers for each profile and that are fixed. By this, we can keep the compatibility with older filesystems while still avoid divide-by-zero bugs. Reported-by: kernel test robot Reported-by: Viktor Kuzmin Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216559 Fixes: ac0677348f3c ("btrfs: merge calculations for simple striped profiles in btrfs_rmap_block") CC: stable@vger.kernel.org # 6.0 Reviewed-by: Su Yue Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 1a2dcbdde82e3a5f1db9b2f4c48aa1aeba534fb2 Author: Sreekanth Reddy Date: Tue Sep 13 17:35:38 2022 +0530 scsi: mpt3sas: re-do lost mpt3sas DMA mask fix This is a re-do of commit e0e0747de0ea ("scsi: mpt3sas: Fix return value check of dma_get_required_mask()"), which I ended up undoing in a mis-merge in commit 62e6e5940c0c ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi"). The original commit message was scsi: mpt3sas: Fix return value check of dma_get_required_mask() Fix the incorrect return value check of dma_get_required_mask(). Due to this incorrect check, the driver was always setting the DMA mask to 63 bit. Link: https://lore.kernel.org/r/20220913120538.18759-2-sreekanth.reddy@broadcom.com Fixes: ba27c5cf286d ("scsi: mpt3sas: Don't change the DMA coherent mask after allocations") Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen and this fix was lost when I mis-merged the conflict with commit 9df650963bf6 ("scsi: mpt3sas: Don't change DMA mask while reallocating pools"). Reported-by: Juergen Gross Fixes: 62e6e5940c0c ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi") Link: https://lore.kernel.org/all/CAHk-=wjaK-TxrNaGtFDpL9qNHL1MVkWXO1TT6vObD5tXMSC4Zg@mail.gmail.com Signed-off-by: Linus Torvalds commit b1a09b63684cea56774786ca14c13b7041ffee63 Author: Dongliang Mu Date: Mon Oct 24 17:02:52 2022 +0800 can: mcp251x: mcp251x_can_probe(): add missing unregister_candev() in error path In mcp251x_can_probe(), if mcp251x_gpio_setup() fails, it forgets to unregister the CAN device. Fix this by unregistering can device in mcp251x_can_probe(). Fixes: 2d52dabbef60 ("can: mcp251x: add GPIO support") Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/all/20221024090256.717236-1-dzm91@hust.edu.cn [mkl: adjust label] Signed-off-by: Marc Kleine-Budde commit 3e5b3418827cefb5e1cc658806f02965791b8f07 Author: Dongliang Mu Date: Mon Oct 24 19:48:07 2022 +0800 can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path The commit 1149108e2fbf ("can: mscan: improve clock API use") only adds put_clock() in mpc5xxx_can_remove() function, forgetting to add put_clock() in the error handling code. Fix this bug by adding put_clock() in the error handling code. Fixes: 1149108e2fbf ("can: mscan: improve clock API use") Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/all/20221024133828.35881-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit b5f9a01fae42684648c2ee3cd9985f80c67ab9f7 Author: Li Zhijian Date: Thu Oct 13 12:03:33 2022 +0800 RDMA/rxe: Fix mr leak in RESPST_ERR_RNR rxe_recheck_mr() will increase mr's ref_cnt, so we should call rxe_put(mr) to drop mr's ref_cnt in RESPST_ERR_RNR to avoid below warning: WARNING: CPU: 0 PID: 4156 at drivers/infiniband/sw/rxe/rxe_pool.c:259 __rxe_cleanup+0x1df/0x240 [rdma_rxe] ... Call Trace: rxe_dereg_mr+0x4c/0x60 [rdma_rxe] ib_dereg_mr_user+0xa8/0x200 [ib_core] ib_mr_pool_destroy+0x77/0xb0 [ib_core] nvme_rdma_destroy_queue_ib+0x89/0x240 [nvme_rdma] nvme_rdma_free_queue+0x40/0x50 [nvme_rdma] nvme_rdma_teardown_io_queues.part.0+0xc3/0x120 [nvme_rdma] nvme_rdma_error_recovery_work+0x4d/0xf0 [nvme_rdma] process_one_work+0x582/0xa40 ? pwq_dec_nr_in_flight+0x100/0x100 ? rwlock_bug.part.0+0x60/0x60 worker_thread+0x2a9/0x700 ? process_one_work+0xa40/0xa40 kthread+0x168/0x1a0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Link: https://lore.kernel.org/r/20221024052049.20577-1-lizhijian@fujitsu.com Fixes: 8a1a0be894da ("RDMA/rxe: Replace mr by rkey in responder resources") Signed-off-by: Li Zhijian Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit baee5a14ab2c9a8f8df09d021885c8f5de458a38 Merge: fe1fd0ccd8b2c 5a5c4e06fd03b Author: Jakub Kicinski Date: Mon Oct 24 21:17:02 2022 -0700 Merge tag 'ieee802154-for-net-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-10-24 Two fixup patches for return code changes of an earlier commit. Wei Yongjun fixed a missed -EINVAL return on the recent change, while Alexander Aring adds handling for unknown address type cases as well. Miquel Raynal fixed a long standing issue with LQI value recording which got broken 8 years ago. (It got more attention with the work in progress enhancement in wpan). * tag 'ieee802154-for-net-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan: mac802154: Fix LQI recording net: ieee802154: fix error return code in dgram_bind() net: ieee802154: return -EINVAL for unknown addr type ==================== Link: https://lore.kernel.org/r/20221024102301.9433-1-stefan@datenfreihafen.org Signed-off-by: Jakub Kicinski commit fe1fd0ccd8b2c9861f79c26a926b5fc1f38cf9ba Merge: 4a4b6848d1e93 fa9e57468aa10 Author: Jakub Kicinski Date: Mon Oct 24 21:14:00 2022 -0700 Merge branch 'mptcp-fixes-for-6-1' Mat Martineau says: ==================== mptcp: Fixes for 6.1 Patch 1 fixes an issue with assigning subflow IDs in cases where an incoming MP_JOIN is processed before accept() completes on the MPTCP socket. Patches 2 and 3 fix a deadlock issue with fastopen code (new for 6.1) at connection time. ==================== Link: https://lore.kernel.org/r/20221021225856.88119-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit fa9e57468aa10e91deca6d82ccd17c73ffdd1e40 Author: Paolo Abeni Date: Fri Oct 21 15:58:56 2022 -0700 mptcp: fix abba deadlock on fastopen Our CI reported lockdep splat in the fastopen code: ====================================================== WARNING: possible circular locking dependency detected 6.0.0.mptcp_f5e8bfe9878d+ #1558 Not tainted ------------------------------------------------------ packetdrill/1071 is trying to acquire lock: ffff8881bd198140 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_wait_for_connect+0x19c/0x310 but task is already holding lock: ffff8881b8346540 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_sendmsg+0xfdf/0x1740 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (k-sk_lock-AF_INET){+.+.}-{0:0}: __lock_acquire+0xb6d/0x1860 lock_acquire+0x1d8/0x620 lock_sock_nested+0x37/0xd0 inet_stream_connect+0x3f/0xa0 mptcp_connect+0x411/0x800 __inet_stream_connect+0x3ab/0x800 mptcp_stream_connect+0xac/0x110 __sys_connect+0x101/0x130 __x64_sys_connect+0x6e/0xb0 do_syscall_64+0x59/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_INET){+.+.}-{0:0}: check_prev_add+0x15e/0x2110 validate_chain+0xace/0xdf0 __lock_acquire+0xb6d/0x1860 lock_acquire+0x1d8/0x620 lock_sock_nested+0x37/0xd0 inet_wait_for_connect+0x19c/0x310 __inet_stream_connect+0x26c/0x800 tcp_sendmsg_fastopen+0x341/0x650 mptcp_sendmsg+0x109d/0x1740 sock_sendmsg+0xe1/0x120 __sys_sendto+0x1c7/0x2a0 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x59/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(k-sk_lock-AF_INET); lock(sk_lock-AF_INET); lock(k-sk_lock-AF_INET); lock(sk_lock-AF_INET); *** DEADLOCK *** 1 lock held by packetdrill/1071: #0: ffff8881b8346540 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_sendmsg+0xfdf/0x1740 ====================================================== The problem is caused by the blocking inet_wait_for_connect() releasing and re-acquiring the msk socket lock while the subflow socket lock is still held and the MPTCP socket requires that the msk socket lock must be acquired before the subflow socket lock. Address the issue always invoking tcp_sendmsg_fastopen() in an unblocking manner, and later eventually complete the blocking __inet_stream_connect() as needed. Fixes: d98a82a6afc7 ("mptcp: handle defer connect in mptcp_sendmsg") Reviewed-by: Mat Martineau Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 54f1944ed6d2554475f39a4921dc5422fa692c4f Author: Paolo Abeni Date: Fri Oct 21 15:58:55 2022 -0700 mptcp: factor out mptcp_connect() The current MPTCP connect implementation duplicates a bit of inet code and does not use nor provide a struct proto->connect callback, which in turn will not fit the upcoming fastopen implementation. Refactor such implementation to use the common helper, moving the MPTCP-specific bits into mptcp_connect(). Additionally, avoid an indirect call to the subflow connect callback. Note that the fastopen call-path invokes mptcp_connect() while already holding the subflow socket lock. Explicitly keep track of such path via a new MPTCP-level flag and handle the locking accordingly. Additionally, track the connect flags in a new msk field to allow propagating them to the subflow inet_stream_connect call. Fixes: d98a82a6afc7 ("mptcp: handle defer connect in mptcp_sendmsg") Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit e72e4032637f4646554794ac28a3abecc6c2416d Author: Paolo Abeni Date: Fri Oct 21 15:58:54 2022 -0700 mptcp: set msk local address earlier The mptcp_pm_nl_get_local_id() code assumes that the msk local address is available at that point. For passive sockets, we initialize such address at accept() time. Depending on the running configuration and the user-space timing, a passive MPJ subflow can join the msk socket before accept() completes. In such case, the PM assigns a wrong local id to the MPJ subflow and later PM netlink operations will end-up touching the wrong/unexpected subflow. All the above causes sporadic self-tests failures, especially when the host is heavy loaded. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/308 Fixes: 01cacb00b35c ("mptcp: add netlink-based PM") Fixes: d045b9eb95a9 ("mptcp: introduce implicit endpoints") Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 4a4b6848d1e932b977e6a00cda393adf7e839ff8 Author: Horatiu Vultur Date: Fri Oct 21 11:07:11 2022 +0200 net: lan966x: Stop replacing tx dcbs and dcbs_buf when changing MTU When a frame is sent using FDMA, the skb is mapped and then the mapped address is given to an tx dcb that is different than the last used tx dcb. Once the HW finish with this frame, it would generate an interrupt and then the dcb can be reused and memory can be freed. For each dcb there is an dcb buf that contains some meta-data(is used by PTP, is it free). There is 1 to 1 relationship between dcb and dcb_buf. The following issue was observed. That sometimes after changing the MTU to allocate new tx dcbs and dcbs_buf, two frames were not transmitted. The frames were not transmitted because when reloading the tx dcbs, it was always presuming to use the first dcb but that was not always happening. Because it could be that the last tx dcb used before changing MTU was first dcb and then when it tried to get the next dcb it would take dcb 1 instead of 0. Because it is supposed to take a different dcb than the last used one. This can be fixed simply by changing tx->last_in_use to -1 when the fdma is disabled to reload the new dcb and dcbs_buff. But there could be a different issue. For example, right after the frame is sent, the MTU is changed. Now all the dcbs and dcbs_buf will be cleared. And now get the interrupt from HW that it finished with the frame. So when we try to clear the skb, it is not possible because we lost all the dcbs_buf. The solution here is to stop replacing the tx dcbs and dcbs_buf when changing MTU because the TX doesn't care what is the MTU size, it is only the RX that needs this information. Fixes: 2ea1cbac267e ("net: lan966x: Update FDMA to change MTU.") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20221021090711.3749009-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 4fa86555d1cd338afc6e6308cc1ff890a014ec8c Author: Jakub Kicinski Date: Fri Oct 21 12:35:32 2022 -0700 genetlink: piggy back on resv_op to default to a reject policy To keep backward compatibility we used to leave attribute parsing to the family if no policy is specified. This becomes tedious as we move to more strict validation. Families must define reject all policies if they don't want any attributes accepted. Piggy back on the resv_start_op field as the switchover point. AFAICT only ethtool has added new commands since the resv_start_op was defined, and it has per-op policies so this should be a no-op. Nonetheless the patch should still go into v6.1 for consistency. Link: https://lore.kernel.org/all/20221019125745.3f2e7659@kernel.org/ Link: https://lore.kernel.org/r/20221021193532.1511293-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9d9effca9d7d7cf6341182a7c5cabcbd6fa28063 Author: Xin Long Date: Fri Oct 21 10:22:47 2022 -0400 ethtool: eeprom: fix null-deref on genl_info in dump The similar fix as commit 46cdedf2a0fa ("ethtool: pse-pd: fix null-deref on genl_info in dump") is also needed for ethtool eeprom. Fixes: c781ff12a2f3 ("ethtool: Allow network drivers to dump arbitrary EEPROM data") Signed-off-by: Xin Long Link: https://lore.kernel.org/r/5575919a2efc74cd9ad64021880afc3805c54166.1666362167.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit a970174d7a1010cb29a5b0c9fa0626abdefcfcbe Author: Steven Rostedt (Google) Date: Mon Oct 24 11:45:36 2022 -0400 x86/mm: Do not verify W^X at boot up Adding on the kernel command line "ftrace=function" triggered: CPA detected W^X violation: 8000000000000063 -> 0000000000000063 range: 0xffffffffc0013000 - 0xffffffffc0013fff PFN 10031b WARNING: CPU: 0 PID: 0 at arch/x86/mm/pat/set_memory.c:609 verify_rwx+0x61/0x6d Call Trace: __change_page_attr_set_clr+0x146/0x8a6 change_page_attr_set_clr+0x135/0x268 change_page_attr_clear.constprop.0+0x16/0x1c set_memory_x+0x2c/0x32 arch_ftrace_update_trampoline+0x218/0x2db ftrace_update_trampoline+0x16/0xa1 __register_ftrace_function+0x93/0xb2 ftrace_startup+0x21/0xf0 register_ftrace_function_nolock+0x26/0x40 register_ftrace_function+0x4e/0x143 function_trace_init+0x7d/0xc3 tracer_init+0x23/0x2c tracing_set_tracer+0x1d5/0x206 register_tracer+0x1c0/0x1e4 init_function_trace+0x90/0x96 early_trace_init+0x25c/0x352 start_kernel+0x424/0x6e4 x86_64_start_reservations+0x24/0x2a x86_64_start_kernel+0x8c/0x95 secondary_startup_64_no_verify+0xe0/0xeb This is because at boot up, kernel text is writable, and there's no reason to do tricks to updated it. But the verifier does not distinguish updates at boot up and at run time, and causes a warning at time of boot. Add a check for system_state == SYSTEM_BOOTING and allow it if that is the case. [ These SYSTEM_BOOTING special cases are all pretty horrid, but the x86 text_poke() code does some odd things at bootup, forcing this for now - Linus ] Link: https://lore.kernel.org/r/20221024112730.180916b3@gandalf.local.home Fixes: 652c5bf380ad0 ("x86/mm: Refuse W^X violations") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Linus Torvalds commit 337a0a0b63f1c30195733eaacf39e4310a592a68 Merge: f6602a97a11a3 720ca52bcef22 Author: Linus Torvalds Date: Mon Oct 24 12:43:51 2022 -0700 Merge tag 'net-6.1-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf. The net-memcg fix stands out, the rest is very run-off-the-mill. Maybe I'm biased. Current release - regressions: - eth: fman: re-expose location of the MAC address to userspace, apparently some udev scripts depended on the exact value Current release - new code bugs: - bpf: - wait for busy refill_work when destroying bpf memory allocator - allow bpf_user_ringbuf_drain() callbacks to return 1 - fix dispatcher patchable function entry to 5 bytes nop Previous releases - regressions: - net-memcg: avoid stalls when under memory pressure - tcp: fix indefinite deferral of RTO with SACK reneging - tipc: fix a null-ptr-deref in tipc_topsrv_accept - eth: macb: specify PHY PM management done by MAC - tcp: fix a signed-integer-overflow bug in tcp_add_backlog() Previous releases - always broken: - eth: amd-xgbe: SFP fixes and compatibility improvements Misc: - docs: netdev: offer performance feedback to contributors" * tag 'net-6.1-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (37 commits) net-memcg: avoid stalls when under memory pressure tcp: fix indefinite deferral of RTO with SACK reneging tcp: fix a signed-integer-overflow bug in tcp_add_backlog() net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY net: fix UAF issue in nfqnl_nf_hook_drop() when ops_init() failed docs: netdev: offer performance feedback to contributors kcm: annotate data-races around kcm->rx_wait kcm: annotate data-races around kcm->rx_psock net: fman: Use physical address for userspace interfaces net/mlx5e: Cleanup MACsec uninitialization routine atlantic: fix deadlock at aq_nic_stop nfp: only clean `sp_indiff` when application firmware is unloaded amd-xgbe: add the bit rate quirk for Molex cables amd-xgbe: fix the SFP compliance codes check for DAC cables amd-xgbe: enable PLL_CTL for fixed PHY modes only amd-xgbe: use enums for mailbox cmd and sub_cmds amd-xgbe: Yellow carp devices do not need rrc bpf: Use __llist_del_all() whenever possbile during memory draining bpf: Wait for busy refill_work when destroying bpf memory allocator MAINTAINERS: add keyword match on PTP ... commit f6602a97a11a3ddc077889fec2c026113c33c670 Merge: 2a91e897c0e19 31d8aaa87fcef Author: Linus Torvalds Date: Mon Oct 24 12:33:30 2022 -0700 Merge tag 'rcu-urgent.2022.10.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU fix from Paul McKenney: "Fix a regression caused by commit bf95b2bc3e42 ("rcu: Switch polled grace-period APIs to ->gp_seq_polled"), which could incorrectly leave interrupts enabled after an early-boot call to synchronize_rcu(). Such synchronize_rcu() calls must acquire leaf rcu_node locks in order to properly interact with polled grace periods, but the code did not take into account the possibility of synchronize_rcu() being invoked from the portion of the boot sequence during which interrupts are disabled. This commit therefore switches the lock acquisition and release from irq to irqsave/irqrestore" * tag 'rcu-urgent.2022.10.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: rcu: Keep synchronize_rcu() from enabling irqs in early boot commit 2a91e897c0e199f5d4cdc1a15f948133b15ec1f3 Merge: 21c92498e9b86 618887768bb71 Author: Linus Torvalds Date: Mon Oct 24 12:19:34 2022 -0700 Merge tag 'linux-kselftest-kunit-fixes-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit fixes from Shuah Khan: "One single fix to update alloc_string_stream() callers to check for IS_ERR() instead of NULL to be in sync with alloc_string_stream() returning an ERR_PTR()" * tag 'linux-kselftest-kunit-fixes-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: update NULL vs IS_ERR() tests commit 21c92498e9b86b5b3e91818e13ce7943da8496a4 Merge: 74d5b415a5ec3 cb05c81ada76a Author: Linus Torvalds Date: Mon Oct 24 12:10:55 2022 -0700 Merge tag 'linux-kselftest-fixes-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: - futex, intel_pstate, kexec build fixes - ftrace dynamic_events dependency check fix - memory-hotplug fix to remove redundant warning from test report * tag 'linux-kselftest-fixes-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ftrace: fix dynamic_events dependency check selftests/memory-hotplug: Remove the redundant warning information selftests/kexec: fix build for ARCH=x86_64 selftests/intel_pstate: fix build for ARCH=x86_64 selftests/futex: fix build for clang commit 74d5b415a5ec37efd9f764782d3c6d952ba55844 Merge: 247f34f7b8035 e9945b2633dec Author: Linus Torvalds Date: Mon Oct 24 11:48:30 2022 -0700 Merge tag 'pinctrl-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Fix typos in UART1 and MMC in the Ingenic driver - A really well researched glitch bug fix to the Qualcomm driver that was tracked down and fixed by Dough Anderson from Chromium. Hats off for this one! - Revert two patches on the Xilinx ZynqMP driver: this needs a proper solution making use of firmware version information to adapt to different firmware releases - Fix interrupt triggers in the Ocelot driver * tag 'pinctrl-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: ocelot: Fix incorrect trigger of the interrupt. Revert "dt-bindings: pinctrl-zynqmp: Add output-enable configuration" Revert "pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high-impedance" pinctrl: qcom: Avoid glitching lines when we first mux to output pinctrl: Ingenic: JZ4755 bug fixes commit 809734c110548dca410fb0cca52e6b1540319f5e Author: Joaquín Ignacio Aramendía Date: Mon Oct 24 08:33:59 2022 -0300 drm/amd/display: Revert logic for plane modifiers This file was split in commit 5d945cbcd4b16a29d6470a80dfb19738f9a4319f ("drm/amd/display: Create a file dedicated to planes") and the logic in dm_plane_format_mod_supported() function got changed by a switch logic. That change broke drm_plane modifiers setting on series 5000 APUs (tested on OXP mini AMD 5800U and HP Dev One 5850U PRO) leading to Gamescope not working as reported on GitHub[1] To reproduce the issue, enter a TTY and run: $ gamescope -- vkcube With said commit applied it will abort. This one restores the old logic, fixing the issue that affects Gamescope. [1](https://github.com/Plagman/gamescope/issues/624) Cc: # 6.0.x Signed-off-by: Joaquín Ignacio Aramendía Reviewed-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 969758bbf5e9360b63bbb2328ac3fda46bbbc9f5 Author: Jesse Zhang Date: Tue Oct 11 05:23:10 2022 +0000 drm/amdkfd: correct the cache info for gfx1036 correct the cache information for gfx1036 Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Yifan Zhang Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9656db1b933caf6ffaaef10322093fe018359090 Author: Prike Liang Date: Thu Oct 20 14:44:26 2022 +0800 drm/amdkfd: update gfx1037 Lx cache setting Update the gfx1037 L1/L2 cache setting. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit e105b6212f1f90c56c04439279d0ef0f8dd1c308 Author: YuBiao Wang Date: Wed Oct 19 11:36:32 2022 +0800 drm/amdgpu: skip mes self test for gc 11.0.3 in recover Temporary disable mes self teset for gc 11.0.3 during gpu_recovery. Signed-off-by: YuBiao Wang Acked-by: Luben Tuikov Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 68bc147363bd9769a07d1cbf5cbe2bb4573f4e3c Author: David Francis Date: Fri Sep 16 11:15:01 2022 -0400 drm/amd: Add IMU fw version to fw version queries IMU is a new firmware for GFX11. There are four means by which firmware version can be queried from the driver: device attributes, vf2pf, debugfs, and the AMDGPU_INFO_FW_VERSION option in the amdgpu info ioctl. Add IMU as an option for those four methods. V2: Added debugfs Reviewed-by: Likun Gao Reviewed-by: Alex Deucher Signed-off-by: David Francis Signed-off-by: Alex Deucher commit abe4d9f03fae76c9650b0d942faf6990b35c377b Author: Alvin Lee Date: Thu Oct 6 17:26:49 2022 -0400 drm/amd/display: Don't return false if no stream pipe_ctx[i] exists even if the pipe is not in use. If the pipe is not in use it will always have a null stream, so don't return false in this case. Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit ca08a1725d0d78efca8d2dbdbce5ea70355da0f2 Author: Rodrigo Siqueira Date: Thu Oct 6 17:26:48 2022 -0400 drm/amd/display: Remove wrong pipe control lock When using a device based on DCN32/321, we have an issue where a second 4k@60Hz display does not light up, and the system becomes unresponsive for a few minutes. In the debug process, it was possible to see a hang in the function dcn20_post_unlock_program_front_end in this part: for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000 && hubp->funcs->hubp_is_flip_pending(hubp); j++) mdelay(1); } The hubp_is_flip_pending always returns positive for waiting pending flips which is a symptom of pipe hang. Additionally, the dmesg log shows this message after a few minutes: BUG: soft lockup - CPU#4 stuck for 26s! ... [ +0.000003] dcn20_post_unlock_program_front_end+0x112/0x340 [amdgpu] [ +0.000171] dc_commit_state_no_check+0x63d/0xbf0 [amdgpu] [ +0.000155] ? dc_validate_global_state+0x358/0x3d0 [amdgpu] [ +0.000154] dc_commit_state+0xe2/0xf0 [amdgpu] This confirmed the hypothesis that we had a pipe hanging somewhere. Next, after checking the ftrace entries, we have the below weird sequence: [..] 2) | dcn10_lock_all_pipes [amdgpu]() { 2) 0.120 us | optc1_is_tg_enabled [amdgpu](); 2) | dcn20_pipe_control_lock [amdgpu]() { 2) | dc_dmub_srv_clear_inbox0_ack [amdgpu]() { 2) 0.121 us | amdgpu_dm_dmub_reg_write [amdgpu](); 2) 0.551 us | } 2) | dc_dmub_srv_send_inbox0_cmd [amdgpu]() { 2) 0.110 us | amdgpu_dm_dmub_reg_write [amdgpu](); 2) 0.511 us | } 2) | dc_dmub_srv_wait_for_inbox0_ack [amdgpu]() { 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); 2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu](); [..] We are not expected to read from dmub register so many times and for so long. From the trace log, it was possible to identify that the function dcn20_pipe_control_lock was triggering the dmub operation when it was unnecessary and causing the hang issue. This commit drops the unnecessary dmub code and, consequently, fixes the second display not lighting up the issue. Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 08841950db932dc3ba8bbd4c0f1f7f27ccfbae42 Author: Kenneth Feng Date: Thu Oct 20 15:25:25 2022 +0800 drm/amd/pm: allow gfxoff on gc_11_0_3 allow gfxoff on gc_11_0_3 Signed-off-by: Kenneth Feng Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 90bfee142af0f0e9d3bec80e7acd5f49b230acf7 Author: Rafael Mendonca Date: Mon Oct 17 22:27:50 2022 -0300 drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr() If the number of pages from the userptr BO differs from the SG BO then the allocated memory for the SG table doesn't get freed before returning -EINVAL, which may lead to a memory leak in some error paths. Fix this by checking the number of pages before allocating memory for the SG table. Fixes: 264fb4d332f5 ("drm/amdgpu: Add multi-GPU DMA mapping helpers") Signed-off-by: Rafael Mendonca Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit d2c4c1569a7d7d5c8f75963bf2d62d7aeac30e2a Author: Lijo Lazar Date: Fri Sep 30 10:43:08 2022 +0530 drm/amdgpu: Remove ATC L2 access for MMHUB 2.1.x MMHUB 2.1.x versions don't have ATCL2. Remove accesses to ATCL2 registers. Since they are non-existing registers, read access will cause a 'Completer Abort' and gets reported when AER is enabled with the below patch. Tagging with the patch so that this is backported along with it. v2: squash in uninitialized warning fix (Nathan Chancellor) Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Signed-off-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 835bed1b83952bdbbe874f8ee41d665d52e991de Author: Jason A. Donenfeld Date: Mon Oct 24 18:29:01 2022 +0200 fbdev: sisfb: use explicitly signed char With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: drivers/video/fbdev/sis/init301.c:3549 SiS_GetCRT2Data301() warn: 'SiS_Pr->SiS_EModeIDTable[ModeIdIndex]->ROMMODEIDX661' is unsigned Cc: Thomas Winischhofer Cc: Greg Kroah-Hartman Cc: Helge Deller Cc: linux-usb@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jason A. Donenfeld Signed-off-by: Helge Deller commit 30bbe38b28fbc7415e0585f2b05e6f6f95febbaa Author: Lukas Bulwahn Date: Mon Oct 24 15:22:23 2022 +0200 MAINTAINERS: adjust entry after renaming parisc serial driver Commit 9e4e2ce1a78e ("parisc/serial: Rename 8250_gsc.c to 8250_parisc.c") renames the parisc serial driver file, but does not adjust the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in PARISC ARCHITECTURE. Signed-off-by: Lukas Bulwahn Fixes: 9e4e2ce1a78e ("parisc/serial: Rename 8250_gsc.c to 8250_parisc.c") Signed-off-by: Helge Deller commit 207777dc306a732cff76ab63bf19a7e0851410b3 Author: Claudiu Beznea Date: Thu Oct 20 13:27:05 2022 +0300 iio: adc: at91-sama5d2_adc: get rid of 5 degrees Celsius adjustment On SAMA7G5 final chip version there is no need for 5 degrees Celsius adjustment when computing junction temperature, thus, remove it. Fixes: 5ab38b81895c ("iio: adc: at91-sama5d2_adc: add support for temperature sensor") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221020102705.3639204-1-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit efa17e90e1711bdb084e3954fa44afb6647331c0 Author: Yang Yingliang Date: Sat Oct 22 15:42:12 2022 +0800 iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init() dev_set_name() allocates memory for name, it need be freed when device_add() fails, call put_device() to give up the reference that hold in device_initialize(), so that it can be freed in kobject_cleanup() when the refcount hit to 0. Fault injection test can trigger this: unreferenced object 0xffff8e8340a7b4c0 (size 32): comm "modprobe", pid 243, jiffies 4294678145 (age 48.845s) hex dump (first 32 bytes): 69 69 6f 5f 73 79 73 66 73 5f 74 72 69 67 67 65 iio_sysfs_trigge 72 00 a7 40 83 8e ff ff 00 86 13 c4 f6 ee ff ff r..@............ backtrace: [<0000000074999de8>] __kmem_cache_alloc_node+0x1e9/0x360 [<00000000497fd30b>] __kmalloc_node_track_caller+0x44/0x1a0 [<000000003636c520>] kstrdup+0x2d/0x60 [<0000000032f84da2>] kobject_set_name_vargs+0x1e/0x90 [<0000000092efe493>] dev_set_name+0x4e/0x70 Fixes: 1f785681a870 ("staging:iio:trigger sysfs userspace trigger rework.") Signed-off-by: Yang Yingliang Cc: Link: https://lore.kernel.org/r/20221022074212.1386424-1-yangyingliang@huawei.com Signed-off-by: Jonathan Cameron commit 720ca52bcef225b967a339e0fffb6d0c7e962240 Author: Jakub Kicinski Date: Fri Oct 21 09:03:04 2022 -0700 net-memcg: avoid stalls when under memory pressure As Shakeel explains the commit under Fixes had the unintended side-effect of no longer pre-loading the cached memory allowance. Even tho we previously dropped the first packet received when over memory limit - the consecutive ones would get thru by using the cache. The charging was happening in batches of 128kB, so we'd let in 128kB (truesize) worth of packets per one drop. After the change we no longer force charge, there will be no cache filling side effects. This causes significant drops and connection stalls for workloads which use a lot of page cache, since we can't reclaim page cache under GFP_NOWAIT. Some of the latency can be recovered by improving SACK reneg handling but nowhere near enough to get back to the pre-5.15 performance (the application I'm experimenting with still sees 5-10x worst latency). Apply the suggested workaround of using GFP_ATOMIC. We will now be more permissive than previously as we'll drop _no_ packets in softirq when under pressure. But I can't think of any good and simple way to address that within networking. Link: https://lore.kernel.org/all/20221012163300.795e7b86@kernel.org/ Suggested-by: Shakeel Butt Fixes: 4b1327be9fe5 ("net-memcg: pass in gfp_t mask to mem_cgroup_charge_skmem()") Acked-by: Shakeel Butt Acked-by: Roman Gushchin Link: https://lore.kernel.org/r/20221021160304.1362511-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 3d2af9cce3133b3bc596a9d065c6f9d93419ccfb Author: Neal Cardwell Date: Fri Oct 21 17:08:21 2022 +0000 tcp: fix indefinite deferral of RTO with SACK reneging This commit fixes a bug that can cause a TCP data sender to repeatedly defer RTOs when encountering SACK reneging. The bug is that when we're in fast recovery in a scenario with SACK reneging, every time we get an ACK we call tcp_check_sack_reneging() and it can note the apparent SACK reneging and rearm the RTO timer for srtt/2 into the future. In some SACK reneging scenarios that can happen repeatedly until the receive window fills up, at which point the sender can't send any more, the ACKs stop arriving, and the RTO fires at srtt/2 after the last ACK. But that can take far too long (O(10 secs)), since the connection is stuck in fast recovery with a low cwnd that cannot grow beyond ssthresh, even if more bandwidth is available. This fix changes the logic in tcp_check_sack_reneging() to only rearm the RTO timer if data is cumulatively ACKed, indicating forward progress. This avoids this kind of nearly infinite loop of RTO timer re-arming. In addition, this meets the goals of tcp_check_sack_reneging() in handling Windows TCP behavior that looks temporarily like SACK reneging but is not really. Many thanks to Jakub Kicinski and Neil Spring, who reported this issue and provided critical packet traces that enabled root-causing this issue. Also, many thanks to Jakub Kicinski for testing this fix. Fixes: 5ae344c949e7 ("tcp: reduce spurious retransmits due to transient SACK reneging") Reported-by: Jakub Kicinski Reported-by: Neil Spring Signed-off-by: Neal Cardwell Reviewed-by: Eric Dumazet Cc: Yuchung Cheng Tested-by: Jakub Kicinski Link: https://lore.kernel.org/r/20221021170821.1093930-1-ncardwell.kernel@gmail.com Signed-off-by: Jakub Kicinski commit e28c44450b14474009a7ac84eb2bd631357c9635 Merge: ec791d8149ff6 bed54aeb6ac1c Author: Jakub Kicinski Date: Mon Oct 24 10:32:00 2022 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2022-10-23 We've added 7 non-merge commits during the last 18 day(s) which contain a total of 8 files changed, 69 insertions(+), 5 deletions(-). The main changes are: 1) Wait for busy refill_work when destroying bpf memory allocator, from Hou. 2) Allow bpf_user_ringbuf_drain() callbacks to return 1, from David. 3) Fix dispatcher patchable function entry to 5 bytes nop, from Jiri. 4) Prevent decl_tag from being referenced in func_proto, from Stanislav. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Use __llist_del_all() whenever possbile during memory draining bpf: Wait for busy refill_work when destroying bpf memory allocator bpf: Fix dispatcher patchable function entry to 5 bytes nop bpf: prevent decl_tag from being referenced in func_proto selftests/bpf: Add reproducer for decl_tag in func_proto return type selftests/bpf: Make bpf_user_ringbuf_drain() selftest callback return 1 bpf: Allow bpf_user_ringbuf_drain() callbacks to return 1 ==================== Link: https://lore.kernel.org/r/20221023192244.81137-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 2f3f53d62307262f0086804ea7cea99b0e085450 Author: Akira Yokosawa Date: Sat Oct 15 18:22:01 2022 +0900 docs/process/howto: Replace C89 with C11 Commit e8c07082a810 ("Kbuild: move to -std=gnu11") updated process/programming-language.rst, but failed to update process/howto.rst. Update howto.rst and resolve the inconsistency. Fixes: e8c07082a810 ("Kbuild: move to -std=gnu11") Signed-off-by: Akira Yokosawa Cc: Arnd Bergmann Cc: Federico Vaga Cc: Alex Shi Cc: Hu Haowen Cc: Tsugikazu Shibata Link: https://lore.kernel.org/r/20221015092201.32099-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit e648174b53f1e29ee72ef33756a97ffb8241b6a5 Author: Mushahid Hussain Date: Mon Oct 17 16:20:26 2022 +0500 Documentation: Fix spelling mistake in hacking.rst Fix `botton half locks` to `bottom half locks`. Signed-off-by: Mushahid Hussain Link: https://lore.kernel.org/r/20221017112026.88324-1-mushi.shar@gmail.com Signed-off-by: Jonathan Corbet commit ea522496afa1dd4ed295466e9c813b88ebda3284 Author: Nick Desaulniers Date: Fri Oct 14 10:10:40 2022 -0700 Documentation: process: replace outdated LTS table w/ link The existing table was a bit outdated. 3.16 was EOL in 2020. 4.4 was EOL in 2022. 5.10 is new in 2020. 5.15 is new in 2021. We'll see if 6.1 becomes LTS in 2022. Rather than keep this table updated, it does duplicate information from multiple kernel.org pages. Make one less duplication site that needs to be updated and simply refer to the kernel.org page on releases. Suggested-by: Tyler Hicks Suggested-by: Bagas Sanjaya Signed-off-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/stable/20221014171040.849726-1-ndesaulniers%40google.com Reviewed-by: Tyler Hicks (Microsoft) Link: https://lore.kernel.org/r/20221014171040.849726-1-ndesaulniers@google.com Signed-off-by: Jonathan Corbet commit 028822b714bd3a159d65416c53f1549345b53d9e Author: Vincent Whitchurch Date: Thu Oct 20 15:01:23 2022 +0200 mmc: core: Fix WRITE_ZEROES CQE handling WRITE_ZEROES requests use TRIM, so mark them as needing to be issued synchronously even when a CQE is being used. Without this, mmc_blk_mq_issue_rq() triggers a WARN_ON_ONCE() and fails the request since we don't have any handling for issuing this asynchronously. Fixes: f7b6fc327327 ("mmc: core: Support zeroout using TRIM for eMMC") Reported-by: Jon Hunter Tested-by: Jon Hunter Signed-off-by: Vincent Whitchurch Reviewed-by: Avri Altman Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221020130123.4033218-1-vincent.whitchurch@axis.com Signed-off-by: Ulf Hansson commit 2b4337c8409b4e9e5aed15c597e4031dd567bdd8 Author: Mihai Sain Date: Mon Oct 17 11:31:19 2022 +0300 ARM: dts: at91: sama7g5: fix signal name of pin PB2 The signal name of pin PB2 with function F is FLEXCOM11_IO1 as it is defined in the datasheet. Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Mihai Sain Reviewed-by: Tudor Ambarus Acked-by: Nicolas Ferre Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221017083119.1643-1-mihai.sain@microchip.com commit 9440c42941606af4c379afa3cf8624f0dc43a629 Author: Jiri Olsa Date: Tue Oct 18 14:27:08 2022 +0200 x86/syscall: Include asm/ptrace.h in syscall_wrapper header With just the forward declaration of the 'struct pt_regs' in syscall_wrapper.h, the syscall stub functions: __[x64|ia32]_sys_*(struct pt_regs *regs) will have different definition of 'regs' argument in BTF data based on which object file they are defined in. If the syscall's object includes 'struct pt_regs' definition, the BTF argument data will point to a 'struct pt_regs' record, like: [226] STRUCT 'pt_regs' size=168 vlen=21 'r15' type_id=1 bits_offset=0 'r14' type_id=1 bits_offset=64 'r13' type_id=1 bits_offset=128 ... If not, it will point to a fwd declaration record: [15439] FWD 'pt_regs' fwd_kind=struct and make bpf tracing program hooking on those functions unable to access fields from 'struct pt_regs'. Include asm/ptrace.h directly in syscall_wrapper.h to make sure all syscalls see 'struct pt_regs' definition. This then results in BTF for '__*_sys_*(struct pt_regs *regs)' functions to point to the actual struct, not just the forward declaration. [ bp: No Fixes tag as this is not really a bug fix but "adjustment" so that BTF is happy. ] Reported-by: Akihiro HARAI Signed-off-by: Jiri Olsa Signed-off-by: Borislav Petkov Acked-by: Andrii Nakryiko Cc: # this is needed only for BTF so kernels >= 5.15 Link: https://lore.kernel.org/r/20221018122708.823792-1-jolsa@kernel.org commit e9cf4d9b9a6fdb1df6401a59f5ac5d24006bfeae Author: Dmitry Osipenko Date: Mon Oct 24 17:12:10 2022 +0300 ACPI: video: Fix missing native backlight on Chromebooks Chromebooks don't have backlight in ACPI table, they suppose to use native backlight in this case. Check presence of the CrOS embedded controller ACPI device and prefer the native backlight if EC found. Suggested-by: Hans de Goede Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper") Signed-off-by: Dmitry Osipenko Reviewed-by: Hans de Goede Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20221024141210.67784-1-dmitry.osipenko@collabora.com Signed-off-by: Hans de Goede commit 2398091f9c2c8e0040f4f9928666787a3e8108a7 Author: David Sterba Date: Tue Oct 18 16:05:52 2022 +0200 btrfs: fix type of parameter generation in btrfs_get_dentry The type of parameter generation has been u32 since the beginning, however all callers pass a u64 generation, so unify the types to prevent potential loss. CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Josef Bacik Signed-off-by: David Sterba commit 9b8be45f1ef29081c4b614aa559f934526e70d16 Author: BingJing Chang Date: Sun Oct 16 23:33:46 2022 +0800 btrfs: send: fix send failure of a subcase of orphan inodes Commit 9ed0a72e5b35 ("btrfs: send: fix failures when processing inodes with no links") tries to fix all incremental send cases of orphan inodes the send operation will meet. However, there's still a bug causing the corner subcase fails with a ENOENT error. Here's shortened steps of that subcase: $ btrfs subvolume create vol $ touch vol/foo $ btrfs subvolume snapshot -r vol snap1 $ btrfs subvolume snapshot -r vol snap2 # Turn the second snapshot to RW mode and delete the file while # holding an open file descriptor on it $ btrfs property set snap2 ro false $ exec 73 /dev/null At subvol snap1 ERROR: send ioctl failed with -2: No such file or directory It's subcase 3 of BTRFS_COMPARE_TREE_CHANGED in the commit 9ed0a72e5b35 ("btrfs: send: fix failures when processing inodes with no links"). And it's not a common case. We still have not met it in the real world. Theoretically, this case can happen in a batch cascading snapshot backup. In cascading backups, the receive operation in the middle may cause orphan inodes to appear because of the open file descriptors on the snapshot files during receiving. And if we don't do the batch snapshot backups in their creation order, then we can have an inode, which is an orphan in the parent snapshot but refers to a file in the send snapshot. Since an orphan inode has no paths, the send operation will fail with a ENOENT error if it tries to generate a path for it. In that patch, this subcase will be treated as an inode with a new generation. However, when the routine tries to delete the old paths in the parent snapshot, the function process_all_refs() doesn't check whether there are paths recorded or not before it calls the function process_recorded_refs(). And the function process_recorded_refs() try to get the first path in the parent snapshot in the beginning. Since it has no paths in the parent snapshot, the send operation fails. To fix this, we can easily put a link count check to avoid entering the deletion routine like what we do a link count check to avoid creating a new one. Moreover, we can assume that the function process_all_refs() can always collect references to process because we know it has a positive link count. Fixes: 9ed0a72e5b35 ("btrfs: send: fix failures when processing inodes with no links") Reviewed-by: Filipe Manana Signed-off-by: BingJing Chang Signed-off-by: David Sterba commit 3d17adea74a56a4965f7a603d8ed8c66bb9356d9 Author: Qu Wenruo Date: Tue Oct 18 09:56:38 2022 +0800 btrfs: make thaw time super block check to also verify checksum Previous commit a05d3c915314 ("btrfs: check superblock to ensure the fs was not modified at thaw time") only checks the content of the super block, but it doesn't really check if the on-disk super block has a matching checksum. This patch will add the checksum verification to thaw time superblock verification. This involves the following extra changes: - Export btrfs_check_super_csum() As we need to call it in super.c. - Change the argument list of btrfs_check_super_csum() Instead of passing a char *, directly pass struct btrfs_super_block * pointer. - Verify that our checksum type didn't change before checking the checksum value, like it's done at mount time Fixes: a05d3c915314 ("btrfs: check superblock to ensure the fs was not modified at thaw time") Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 968b71583130b6104c9f33ba60446d598e327a8b Author: Josef Bacik Date: Fri Oct 14 08:52:46 2022 -0400 btrfs: fix tree mod log mishandling of reallocated nodes We have been seeing the following panic in production kernel BUG at fs/btrfs/tree-mod-log.c:677! invalid opcode: 0000 [#1] SMP RIP: 0010:tree_mod_log_rewind+0x1b4/0x200 RSP: 0000:ffffc9002c02f890 EFLAGS: 00010293 RAX: 0000000000000003 RBX: ffff8882b448c700 RCX: 0000000000000000 RDX: 0000000000008000 RSI: 00000000000000a7 RDI: ffff88877d831c00 RBP: 0000000000000002 R08: 000000000000009f R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000100c40 R12: 0000000000000001 R13: ffff8886c26d6a00 R14: ffff88829f5424f8 R15: ffff88877d831a00 FS: 00007fee1d80c780(0000) GS:ffff8890400c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fee1963a020 CR3: 0000000434f33002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: btrfs_get_old_root+0x12b/0x420 btrfs_search_old_slot+0x64/0x2f0 ? tree_mod_log_oldest_root+0x3d/0xf0 resolve_indirect_ref+0xfd/0x660 ? ulist_alloc+0x31/0x60 ? kmem_cache_alloc_trace+0x114/0x2c0 find_parent_nodes+0x97a/0x17e0 ? ulist_alloc+0x30/0x60 btrfs_find_all_roots_safe+0x97/0x150 iterate_extent_inodes+0x154/0x370 ? btrfs_search_path_in_tree+0x240/0x240 iterate_inodes_from_logical+0x98/0xd0 ? btrfs_search_path_in_tree+0x240/0x240 btrfs_ioctl_logical_to_ino+0xd9/0x180 btrfs_ioctl+0xe2/0x2ec0 ? __mod_memcg_lruvec_state+0x3d/0x280 ? do_sys_openat2+0x6d/0x140 ? kretprobe_dispatcher+0x47/0x70 ? kretprobe_rethook_handler+0x38/0x50 ? rethook_trampoline_handler+0x82/0x140 ? arch_rethook_trampoline_callback+0x3b/0x50 ? kmem_cache_free+0xfb/0x270 ? do_sys_openat2+0xd5/0x140 __x64_sys_ioctl+0x71/0xb0 do_syscall_64+0x2d/0x40 Which is this code in tree_mod_log_rewind() switch (tm->op) { case BTRFS_MOD_LOG_KEY_REMOVE_WHILE_FREEING: BUG_ON(tm->slot < n); This occurs because we replay the nodes in order that they happened, and when we do a REPLACE we will log a REMOVE_WHILE_FREEING for every slot, starting at 0. 'n' here is the number of items in this block, which in this case was 1, but we had 2 REMOVE_WHILE_FREEING operations. The actual root cause of this was that we were replaying operations for a block that shouldn't have been replayed. Consider the following sequence of events 1. We have an already modified root, and we do a btrfs_get_tree_mod_seq(). 2. We begin removing items from this root, triggering KEY_REPLACE for it's child slots. 3. We remove one of the 2 children this root node points to, thus triggering the root node promotion of the remaining child, and freeing this node. 4. We modify a new root, and re-allocate the above node to the root node of this other root. The tree mod log looks something like this logical 0 op KEY_REPLACE (slot 1) seq 2 logical 0 op KEY_REMOVE (slot 1) seq 3 logical 0 op KEY_REMOVE_WHILE_FREEING (slot 0) seq 4 logical 4096 op LOG_ROOT_REPLACE (old logical 0) seq 5 logical 8192 op KEY_REMOVE_WHILE_FREEING (slot 1) seq 6 logical 8192 op KEY_REMOVE_WHILE_FREEING (slot 0) seq 7 logical 0 op LOG_ROOT_REPLACE (old logical 8192) seq 8 >From here the bug is triggered by the following steps 1. Call btrfs_get_old_root() on the new_root. 2. We call tree_mod_log_oldest_root(btrfs_root_node(new_root)), which is currently logical 0. 3. tree_mod_log_oldest_root() calls tree_mod_log_search_oldest(), which gives us the KEY_REPLACE seq 2, and since that's not a LOG_ROOT_REPLACE we incorrectly believe that we don't have an old root, because we expect that the most recent change should be a LOG_ROOT_REPLACE. 4. Back in tree_mod_log_oldest_root() we don't have a LOG_ROOT_REPLACE, so we don't set old_root, we simply use our existing extent buffer. 5. Since we're using our existing extent buffer (logical 0) we call tree_mod_log_search(0) in order to get the newest change to start the rewind from, which ends up being the LOG_ROOT_REPLACE at seq 8. 6. Again since we didn't find an old_root we simply clone logical 0 at it's current state. 7. We call tree_mod_log_rewind() with the cloned extent buffer. 8. Set n = btrfs_header_nritems(logical 0), which would be whatever the original nritems was when we COWed the original root, say for this example it's 2. 9. We start from the newest operation and work our way forward, so we see LOG_ROOT_REPLACE which we ignore. 10. Next we see KEY_REMOVE_WHILE_FREEING for slot 0, which triggers the BUG_ON(tm->slot < n), because it expects if we've done this we have a completely empty extent buffer to replay completely. The correct thing would be to find the first LOG_ROOT_REPLACE, and then get the old_root set to logical 8192. In fact making that change fixes this particular problem. However consider the much more complicated case. We have a child node in this tree and the above situation. In the above case we freed one of the child blocks at the seq 3 operation. If this block was also re-allocated and got new tree mod log operations we would have a different problem. btrfs_search_old_slot(orig root) would get down to the logical 0 root that still pointed at that node. However in btrfs_search_old_slot() we call tree_mod_log_rewind(buf) directly. This is not context aware enough to know which operations we should be replaying. If the block was re-allocated multiple times we may only want to replay a range of operations, and determining what that range is isn't possible to determine. We could maybe solve this by keeping track of which root the node belonged to at every tree mod log operation, and then passing this around to make sure we're only replaying operations that relate to the root we're trying to rewind. However there's a simpler way to solve this problem, simply disallow reallocations if we have currently running tree mod log users. We already do this for leaf's, so we're simply expanding this to nodes as well. This is a relatively uncommon occurrence, and the problem is complicated enough I'm worried that we will still have corner cases in the reallocation case. So fix this in the most straightforward way possible. Fixes: bd989ba359f2 ("Btrfs: add tree modification log functions") CC: stable@vger.kernel.org # 3.3+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit ae0e5df4d1a4a2694c9c203cc25334aaaf9f2dfa Author: David Sterba Date: Tue Oct 11 12:02:31 2022 +0200 btrfs: reorder btrfs_bio for better packing After changes in commit 917f32a23501 ("btrfs: give struct btrfs_bio a real end_io handler") the layout of btrfs_bio can be improved. There are two holes and the structure size is 264 bytes on release build. By reordering the iterator we can get rid of the holes and the size is 256 bytes which fits to slabs much better. Final layout: struct btrfs_bio { unsigned int mirror_num; /* 0 4 */ struct bvec_iter iter; /* 4 20 */ u64 file_offset; /* 24 8 */ struct btrfs_device * device; /* 32 8 */ u8 * csum; /* 40 8 */ u8 csum_inline[64]; /* 48 64 */ /* --- cacheline 1 boundary (64 bytes) was 48 bytes ago --- */ btrfs_bio_end_io_t end_io; /* 112 8 */ void * private; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ struct work_struct end_io_work; /* 128 32 */ struct bio bio; /* 160 96 */ /* size: 256, cachelines: 4, members: 10 */ }; Fixes: 917f32a23501 ("btrfs: give struct btrfs_bio a real end_io handler") Signed-off-by: David Sterba commit ab4c54c643a01067669df8332b64e3f31b69e071 Author: Qu Wenruo Date: Mon Oct 10 18:36:07 2022 +0800 btrfs: raid56: avoid double freeing for rbio if full_stripe_write() failed Currently if full_stripe_write() failed to allocate the pages for parity, it will call __free_raid_bio() first, then return -ENOMEM. But some caller of full_stripe_write() will also call __free_raid_bio() again, this would cause double freeing. And it's not a logically sound either, normally we should either free the memory at the same level where we allocated it, or let endio to handle everything. So this patch will solve the double freeing by make raid56_parity_write() to handle the error and free the rbio. Just like what we do in raid56_parity_recover(). Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit f15fb2cd979a07fbfc666e2f04b8b30ec9233b2a Author: Qu Wenruo Date: Mon Oct 10 18:36:06 2022 +0800 btrfs: raid56: properly handle the error when unable to find the missing stripe In raid56_alloc_missing_rbio(), if we can not determine where the missing device is inside the full stripe, we just BUG_ON(). This is not necessary especially the only caller inside scrub.c is already properly checking the return value, and will treat it as a memory allocation failure. Fix the error handling by: - Add an extra warning for the reason Although personally speaking it may be better to be an ASSERT(). - Properly free the allocated rbio Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit ec791d8149ff60c40ad2074af3b92a39c916a03f Author: Lu Wei Date: Fri Oct 21 12:06:22 2022 +0800 tcp: fix a signed-integer-overflow bug in tcp_add_backlog() The type of sk_rcvbuf and sk_sndbuf in struct sock is int, and in tcp_add_backlog(), the variable limit is caculated by adding sk_rcvbuf, sk_sndbuf and 64 * 1024, it may exceed the max value of int and overflow. This patch reduces the limit budget by halving the sndbuf to solve this issue since ACK packets are much smaller than the payload. Fixes: c9c3321257e1 ("tcp: add tcp_add_backlog()") Signed-off-by: Lu Wei Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 9c1eaa27ec599fcc25ed4970c0b73c247d147a2b Author: Zhang Changzhong Date: Fri Oct 21 09:32:24 2022 +0800 net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY The ndo_start_xmit() method must not free skb when returning NETDEV_TX_BUSY, since caller is going to requeue freed skb. Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver") Signed-off-by: Zhang Changzhong Signed-off-by: David S. Miller commit 12bcaf87d8b66d8cd812479c8a6349dcb245375c Author: Yixing Liu Date: Mon Oct 24 16:38:14 2022 +0800 RDMA/hns: Fix NULL pointer problem in free_mr_init() Lock grab occurs in a concurrent scenario, resulting in stepping on a NULL pointer. It should be init mutex_init() first before use the lock. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Call trace: __mutex_lock.constprop.0+0xd0/0x5c0 __mutex_lock_slowpath+0x1c/0x2c mutex_lock+0x44/0x50 free_mr_send_cmd_to_hw+0x7c/0x1c0 [hns_roce_hw_v2] hns_roce_v2_dereg_mr+0x30/0x40 [hns_roce_hw_v2] hns_roce_dereg_mr+0x4c/0x130 [hns_roce_hw_v2] ib_dereg_mr_user+0x54/0x124 uverbs_free_mr+0x24/0x30 destroy_hw_idr_uobject+0x38/0x74 uverbs_destroy_uobject+0x48/0x1c4 uobj_destroy+0x74/0xcc ib_uverbs_cmd_verbs+0x368/0xbb0 ib_uverbs_ioctl+0xec/0x1a4 __arm64_sys_ioctl+0xb4/0x100 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0x58/0x190 do_el0_svc+0x30/0x90 el0_svc+0x2c/0xb4 el0t_64_sync_handler+0x1a4/0x1b0 el0t_64_sync+0x19c/0x1a0 Fixes: 70f92521584f ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT") Signed-off-by: Yixing Liu Signed-off-by: Haoyue Xu Link: https://lore.kernel.org/r/20221024083814.1089722-3-xuhaoyue1@hisilicon.com Signed-off-by: Leon Romanovsky commit 9e272ed69ad6f6952fafd0599d6993575512408e Author: Yangyang Li Date: Mon Oct 24 16:38:13 2022 +0800 RDMA/hns: Disable local invalidate operation When function reset and local invalidate are mixed, HNS RoCEE may hang. Before introducing the cause of the problem, two hardware internal concepts need to be introduced: 1. Execution queue: The queue of hardware execution instructions, function reset and local invalidate are queued for execution in this queue. 2.Local queue: A queue that stores local operation instructions. The instructions in the local queue will be sent to the execution queue for execution. The instructions in the local queue will not be removed until the execution is completed. The reason for the problem is as follows: 1. There is a function reset instruction in the execution queue, which is currently being executed. A necessary condition for the successful execution of function reset is: the hardware pipeline needs to empty the instructions that were not completed before; 2. A local invalidate instruction at the head of the local queue is sent to the execution queue. Now there are two instructions in the execution queue, the first is the function reset instruction, and the second is the local invalidate instruction, which will be executed in se quence; 3. The user has issued many local invalidate operations, causing the local queue to be filled up. 4. The user still has a new local operation command and is queuing to enter the local queue. But the local queue is full and cannot receive new instructions, this instruction is temporarily stored at the hardware pipeline. 5. The function reset has been waiting for the instruction before the hardware pipeline stage is drained. The hardware pipeline stage also caches a local invalidate instruction, so the function reset cannot be completed, and the instructions after it cannot be executed. These factors together cause the execution logic deadlock of the hardware, and the consequence is that RoCEE will not have any response. Considering that the local operation command may potentially cause RoCEE to hang, this feature is no longer supported. Fixes: e93df0108579 ("RDMA/hns: Support local invalidate for hip08 in kernel space") Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Haoyue Xu Link: https://lore.kernel.org/r/20221024083814.1089722-2-xuhaoyue1@hisilicon.com Signed-off-by: Leon Romanovsky commit 195583504be28df5d608a4677dd796117aea875f Author: Marek Vasut Date: Tue Oct 18 20:35:13 2022 +0200 spi: stm32: Print summary 'callbacks suppressed' message The original fix "spi: stm32: Rate-limit the 'Communication suspended' message" still leads to "stm32h7_spi_irq_thread: 1696 callbacks suppressed" spew in the kernel log. Since this 'Communication suspended' message is a debug print, add RATELIMIT_MSG_ON_RELEASE flag to inhibit the "callbacks suspended" part during normal operation and only print summary at the end. Fixes: ea8be08cc9358 ("spi: stm32: Rate-limit the 'Communication suspended' message") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20221018183513.206706-1-marex@denx.de Signed-off-by: Mark Brown commit d266935ac43d57586e311a087510fe6a084af742 Author: Zhengchao Shao Date: Thu Oct 20 10:42:13 2022 +0800 net: fix UAF issue in nfqnl_nf_hook_drop() when ops_init() failed When the ops_init() interface is invoked to initialize the net, but ops->init() fails, data is released. However, the ptr pointer in net->gen is invalid. In this case, when nfqnl_nf_hook_drop() is invoked to release the net, invalid address access occurs. The process is as follows: setup_net() ops_init() data = kzalloc(...) ---> alloc "data" net_assign_generic() ---> assign "date" to ptr in net->gen ... ops->init() ---> failed ... kfree(data); ---> ptr in net->gen is invalid ... ops_exit_list() ... nfqnl_nf_hook_drop() *q = nfnl_queue_pernet(net) ---> q is invalid The following is the Call Trace information: BUG: KASAN: use-after-free in nfqnl_nf_hook_drop+0x264/0x280 Read of size 8 at addr ffff88810396b240 by task ip/15855 Call Trace: dump_stack_lvl+0x8e/0xd1 print_report+0x155/0x454 kasan_report+0xba/0x1f0 nfqnl_nf_hook_drop+0x264/0x280 nf_queue_nf_hook_drop+0x8b/0x1b0 __nf_unregister_net_hook+0x1ae/0x5a0 nf_unregister_net_hooks+0xde/0x130 ops_exit_list+0xb0/0x170 setup_net+0x7ac/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Allocated by task 15855: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0xa1/0xb0 __kmalloc+0x49/0xb0 ops_init+0xe7/0x410 setup_net+0x5aa/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 15855: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x40 ____kasan_slab_free+0x155/0x1b0 slab_free_freelist_hook+0x11b/0x220 __kmem_cache_free+0xa4/0x360 ops_init+0xb9/0x410 setup_net+0x5aa/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: f875bae06533 ("net: Automatically allocate per namespace data.") Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit b75927cff13e0b3b652a12da7eb9a012911799e8 Author: Michael Margolin Date: Thu Oct 20 18:19:49 2022 +0300 RDMA/efa: Add EFA 0xefa2 PCI ID Add support for 0xefa2 devices. Reviewed-by: Firas Jahjah Reviewed-by: Yossi Leybovich Signed-off-by: Michael Margolin Link: https://lore.kernel.org/r/20221020151949.1768-1-mrgolin@amazon.com Signed-off-by: Leon Romanovsky commit c5884ef477b405aadf49419a417d62dc8137e7f3 Author: Jakub Kicinski Date: Thu Oct 20 11:30:31 2022 -0700 docs: netdev: offer performance feedback to contributors Some of us gotten used to producing large quantities of peer feedback at work, every 3 or 6 months. Extending the same courtesy to community members seems like a logical step. It may be hard for some folks to get validation of how important their work is internally, especially at smaller companies which don't employ many kernel experts. The concept of "peer feedback" may be a hyperscaler / silicon valley thing so YMMV. Hopefully we can build more context as we go. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 931ae86f8bbd107d0345314c5cc0d623ba3c13b3 Merge: c99f0f7e68376 0c745b5141a45 Author: David S. Miller Date: Mon Oct 24 10:57:56 2022 +0100 Merge branch 'kcm-data-races' Eric Dumazet says: ==================== kcm: annotate data-races This series address two different syzbot reports for KCM. ==================== Signed-off-by: David S. Miller commit 0c745b5141a45a076f1cb9772a399f7ebcb0948a Author: Eric Dumazet Date: Thu Oct 20 22:45:12 2022 +0000 kcm: annotate data-races around kcm->rx_wait kcm->rx_psock can be read locklessly in kcm_rfree(). Annotate the read and writes accordingly. syzbot reported: BUG: KCSAN: data-race in kcm_rcv_strparser / kcm_rfree write to 0xffff88810784e3d0 of 1 bytes by task 1823 on cpu 1: reserve_rx_kcm net/kcm/kcmsock.c:283 [inline] kcm_rcv_strparser+0x250/0x3a0 net/kcm/kcmsock.c:363 __strp_recv+0x64c/0xd20 net/strparser/strparser.c:301 strp_recv+0x6d/0x80 net/strparser/strparser.c:335 tcp_read_sock+0x13e/0x5a0 net/ipv4/tcp.c:1703 strp_read_sock net/strparser/strparser.c:358 [inline] do_strp_work net/strparser/strparser.c:406 [inline] strp_work+0xe8/0x180 net/strparser/strparser.c:415 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289 worker_thread+0x618/0xa70 kernel/workqueue.c:2436 kthread+0x1a9/0x1e0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 read to 0xffff88810784e3d0 of 1 bytes by task 17869 on cpu 0: kcm_rfree+0x121/0x220 net/kcm/kcmsock.c:181 skb_release_head_state+0x8e/0x160 net/core/skbuff.c:841 skb_release_all net/core/skbuff.c:852 [inline] __kfree_skb net/core/skbuff.c:868 [inline] kfree_skb_reason+0x5c/0x260 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1216 [inline] kcm_recvmsg+0x226/0x2b0 net/kcm/kcmsock.c:1161 ____sys_recvmsg+0x16c/0x2e0 ___sys_recvmsg net/socket.c:2743 [inline] do_recvmmsg+0x2f1/0x710 net/socket.c:2837 __sys_recvmmsg net/socket.c:2916 [inline] __do_sys_recvmmsg net/socket.c:2939 [inline] __se_sys_recvmmsg net/socket.c:2932 [inline] __x64_sys_recvmmsg+0xde/0x160 net/socket.c:2932 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x01 -> 0x00 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 17869 Comm: syz-executor.2 Not tainted 6.1.0-rc1-syzkaller-00010-gbb1a1146467a-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 15e4dabda11b0fa31d510a915d1a580f47dfc92e Author: Eric Dumazet Date: Thu Oct 20 22:45:11 2022 +0000 kcm: annotate data-races around kcm->rx_psock kcm->rx_psock can be read locklessly in kcm_rfree(). Annotate the read and writes accordingly. We do the same for kcm->rx_wait in the following patch. syzbot reported: BUG: KCSAN: data-race in kcm_rfree / unreserve_rx_kcm write to 0xffff888123d827b8 of 8 bytes by task 2758 on cpu 1: unreserve_rx_kcm+0x72/0x1f0 net/kcm/kcmsock.c:313 kcm_rcv_strparser+0x2b5/0x3a0 net/kcm/kcmsock.c:373 __strp_recv+0x64c/0xd20 net/strparser/strparser.c:301 strp_recv+0x6d/0x80 net/strparser/strparser.c:335 tcp_read_sock+0x13e/0x5a0 net/ipv4/tcp.c:1703 strp_read_sock net/strparser/strparser.c:358 [inline] do_strp_work net/strparser/strparser.c:406 [inline] strp_work+0xe8/0x180 net/strparser/strparser.c:415 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289 worker_thread+0x618/0xa70 kernel/workqueue.c:2436 kthread+0x1a9/0x1e0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 read to 0xffff888123d827b8 of 8 bytes by task 5859 on cpu 0: kcm_rfree+0x14c/0x220 net/kcm/kcmsock.c:181 skb_release_head_state+0x8e/0x160 net/core/skbuff.c:841 skb_release_all net/core/skbuff.c:852 [inline] __kfree_skb net/core/skbuff.c:868 [inline] kfree_skb_reason+0x5c/0x260 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1216 [inline] kcm_recvmsg+0x226/0x2b0 net/kcm/kcmsock.c:1161 ____sys_recvmsg+0x16c/0x2e0 ___sys_recvmsg net/socket.c:2743 [inline] do_recvmmsg+0x2f1/0x710 net/socket.c:2837 __sys_recvmmsg net/socket.c:2916 [inline] __do_sys_recvmmsg net/socket.c:2939 [inline] __se_sys_recvmmsg net/socket.c:2932 [inline] __x64_sys_recvmmsg+0xde/0x160 net/socket.c:2932 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0xffff88812971ce00 -> 0x0000000000000000 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 5859 Comm: syz-executor.3 Not tainted 6.0.0-syzkaller-12189-g19d17ab7c68b-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c99f0f7e68376dda5df8db7950cd6b67e73c6d3c Author: Sean Anderson Date: Thu Oct 20 11:50:41 2022 -0400 net: fman: Use physical address for userspace interfaces Before 262f2b782e25 ("net: fman: Map the base address once"), the physical address of the MAC was exposed to userspace in two places: via sysfs and via SIOCGIFMAP. While this is not best practice, it is an external ABI which is in use by userspace software. The aforementioned commit inadvertently modified these addresses and made them virtual. This constitutes and ABI break. Additionally, it leaks the kernel's memory layout to userspace. Partially revert that commit, reintroducing the resource back into struct mac_device, while keeping the intended changes (the rework of the address mapping). Fixes: 262f2b782e25 ("net: fman: Map the base address once") Reported-by: Geert Uytterhoeven Signed-off-by: Sean Anderson Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 5349fad8f8a4b001557633d149850a14b2e1a3f0 Merge: cb8e30ddb7e34 247f34f7b8035 Author: Maarten Lankhorst Date: Mon Oct 24 11:40:08 2022 +0200 Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes Update to v6.1-rc2 to grab more fixes. Signed-off-by: Maarten Lankhorst commit 555a68dd681b7437a2708001d465c85f6dfa6955 Author: Gayatri Kammela Date: Mon Sep 12 16:33:07 2022 -0700 platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver Add Raptor Lake client parts (both RPL and RPL_S) support to pmc core driver. Raptor Lake client parts reuse all the Alder Lake PCH IPs. Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Acked-by: Rajneesh Bhardwaj Signed-off-by: Gayatri Kammela Link: https://lore.kernel.org/r/20220912233307.409954-2-gayatri.kammela@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ee24395f91b9cddccae5f6c11c37ee4ed78ff354 Author: Henning Schild Date: Mon Oct 24 11:20:27 2022 +0200 leds: simatic-ipc-leds-gpio: fix incorrect LED to GPIO mapping For apollolake the mapping between LEDs and GPIO pins was off because of a refactoring when we introduced a new device model. In addition to the reordering the indices in the lookup table need to be updated as well. Fixes: a97126265dfe ("leds: simatic-ipc-leds-gpio: add new model 227G") Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20221024092027.4529-1-henning.schild@siemens.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f8127476930b98fc9e9aa5de0bbf9eeaf45db219 Author: Leon Romanovsky Date: Thu Oct 20 08:28:28 2022 +0300 net/mlx5e: Cleanup MACsec uninitialization routine The mlx5e_macsec_cleanup() routine has NULL pointer dereferencing if mlx5 device doesn't support MACsec (priv->macsec will be NULL). While at it delete comment line, assignment and extra blank lines, so fix everything in one patch. Fixes: 1f53da676439 ("net/mlx5e: Create advanced steering operation (ASO) object for MACsec") Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit 0b6e6e149c136677f1cc859d4185b5a2db50ffbf Author: Mario Limonciello Date: Thu Oct 20 06:37:49 2022 -0500 platform/x86/amd: pmc: Read SMU version during suspend on Cezanne systems commit b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time") adjusted the behavior for amd-pmc to avoid reading the SMU version at startup but rather on first use to improve boot time. However the SMU version is also used to decide whether to place a timer based wakeup in the OS_HINT message. If the idlemask hasn't been read before this message was sent then the SMU version will not have been cached. Ensure the SMU version has been read before deciding whether or not to run this codepath. Cc: stable@vger.kernel.org # 6.0 Reported-by: You-Sheng Yang Tested-by: Anson Tsao Fixes: b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time") Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20221020113749.6621-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6960d133f66ecddcd3af2b1cbd0c7dcd104268b8 Author: Íñigo Huguet Date: Thu Oct 20 09:53:10 2022 +0200 atlantic: fix deadlock at aq_nic_stop NIC is stopped with rtnl_lock held, and during the stop it cancels the 'service_task' work and free irqs. However, if CONFIG_MACSEC is set, rtnl_lock is acquired both from aq_nic_service_task and aq_linkstate_threaded_isr. Then a deadlock happens if aq_nic_stop tries to cancel/disable them when they've already started their execution. As the deadlock is caused by rtnl_lock, it causes many other processes to stall, not only atlantic related stuff. Fix it by introducing a mutex that protects each NIC's macsec related data, and locking it instead of the rtnl_lock from the service task and the threaded IRQ. Before this patch, all macsec data was protected with rtnl_lock, but maybe not all of it needs to be protected. With this new mutex, further efforts can be made to limit the protected data only to that which requires it. However, probably it doesn't worth it because all macsec's data accesses are infrequent, and almost all are done from macsec_ops or ethtool callbacks, called holding rtnl_lock, so macsec_mutex won't never be much contended. The issue appeared repeteadly attaching and deattaching the NIC to a bond interface. Doing that after this patch I cannot reproduce the bug. Fixes: 62c1c2e606f6 ("net: atlantic: MACSec offload skeleton") Reported-by: Li Liang Suggested-by: Andrew Lunn Signed-off-by: Íñigo Huguet Reviewed-by: Igor Russkikh Signed-off-by: David S. Miller commit a10d50983f7befe85acf95ea7dbf6ba9187c2d70 Author: Jelle van der Waa Date: Wed Oct 19 21:47:51 2022 +0200 platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models thinkpad_acpi was reporting 2 fans on a ThinkPad T14s gen 1, even though the laptop has only 1 fan. The second, not present fan always reads 65535 (-1 in 16 bit signed), ignore fans which report 65535 to avoid reporting the non present fan. Signed-off-by: Jelle van der Waa Link: https://lore.kernel.org/r/20221019194751.5392-1-jvanderwaa@redhat.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 36abde8d24ad740371422a7678ca92b06cc8a3d5 Author: Luke D. Jones Date: Mon Oct 10 19:30:09 2022 +1300 platform/x86: asus-wmi: Add support for ROG X16 tablet mode Add quirk for ASUS ROG X16 Flow 2-in-1 to enable tablet mode with lid flip (all screen rotations). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20221010063009.32293-1-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 63720a561b3c98199adf0c73e152807f15cc3b7f Author: Ankit Nautiyal Date: Tue Oct 11 12:04:40 2022 +0530 drm/i915/dp: Reset frl trained flag before restarting FRL training For cases where DP has HDMI2.1 sink and FRL Link issues are detected, reset the flag to state FRL trained status before restarting FRL training. Fixes: 9488a030ac91 ("drm/i915: Add support for enabling link status and recovery") Cc: Swati Sharma Cc: Ankit Nautiyal Cc: Uma Shankar (v2) Cc: Jani Nikula Signed-off-by: Ankit Nautiyal Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221011063447.904649-2-ankit.k.nautiyal@intel.com (cherry picked from commit 47e1a59e60c688c5f95b67277202f05b7e84c189) Signed-off-by: Tvrtko Ursulin commit 62c52eac1ad680fc68ef6d75955127dca46e2740 Author: Anshuman Gupta Date: Fri Oct 14 17:02:58 2022 +0530 drm/i915/dgfx: Keep PCI autosuspend control 'on' by default on all dGPU DGFX platforms has lmem and cpu can access the lmem objects via mmap and i915 internal i915_gem_object_pin_map() for i915 own usages. Both of these methods has pre-requisite requirement to keep GFX PCI endpoint in D0 for a supported iomem transaction over PCI link. (Refer PCIe specs 5.3.1.4.1) Both DG1/DG2 have a known hardware bug that violates the PCIe specs and support the iomem read write transaction over PCIe bus despite endpoint is D3 state. Due to above H/W bug, we had never observed any issue with i915 runtime PM versus lmem access. But this issue becomes visible when PCIe gfx endpoint's upstream bridge enters to D3, at this point any lmem read/write access will be returned as unsupported request. But again this issue is not observed on every platform because it has been observed on few host machines DG1/DG2 endpoint's upstream bridge does not bind with pcieport driver. which really disables the PCIe power savings and leaves the bridge at D0 state. We need a unique interface to read/write from lmem with runtime PM wakeref protection something similar to intel_uncore_{read, write}, keep autosuspend control to 'on' on all discrete platforms, until we have a unique interface to read/write from lmem. This just change the default autosuspend setting of i915 on dGPU, user can still change it to 'auto'. v2: - Modified the commit message and subject with more information. - Changed the Fixes tag to LMEM support commit. [Joonas] - Changed !HAS_LMEM() Cond to !IS_DGFX(). [Rodrigo] Fixes: b908be543e44 ("drm/i915: support creating LMEM objects") Suggested-by: Rodrigo Vivi Reviewed-by: Rodrigo Vivi Signed-off-by: Anshuman Gupta Link: https://patchwork.freedesktop.org/patch/msgid/20221014113258.1284226-1-anshuman.gupta@intel.com (cherry picked from commit 66eb93e71a7a6695b7c5eb682e3ca1c980cf9d58) Signed-off-by: Tvrtko Ursulin commit 1a3abd12a394f5c66943fee75cef533069e831fb Author: José Roberto de Souza Date: Mon Oct 17 06:24:32 2022 -0700 drm/i915: Extend Wa_1607297627 to Alderlake-P Workaround 1607297627 was missed for Alderlake-P, so here extending it to it and adding the fixes tag so this WA is backported to all stable kernels. v2: - fixed subject - added Fixes tag BSpec: 54369 Cc: # v5.17+ Fixes: dfb924e33927 ("drm/i915/adlp: Remove require_force_probe protection") Reviewed-by: Lucas De Marchi Cc: Tvrtko Ursulin Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20221017132432.112850-1-jose.souza@intel.com (cherry picked from commit 847eec69f01a28ca44f5ac7e1d71d3a60263d680) Signed-off-by: Tvrtko Ursulin commit 5a5c4e06fd03b595542d5590f2bc05a6b7fc5c2b Author: Miquel Raynal Date: Thu Oct 20 16:25:35 2022 +0200 mac802154: Fix LQI recording Back in 2014, the LQI was saved in the skb control buffer (skb->cb, or mac_cb(skb)) without any actual reset of this area prior to its use. As part of a useful rework of the use of this region, 32edc40ae65c ("ieee802154: change _cb handling slightly") introduced mac_cb_init() to basically memset the cb field to 0. In particular, this new function got called at the beginning of mac802154_parse_frame_start(), right before the location where the buffer got actually filled. What went through unnoticed however, is the fact that the very first helper called by device drivers in the receive path already used this area to save the LQI value for later extraction. Resetting the cb field "so late" led to systematically zeroing the LQI. If we consider the reset of the cb field needed, we can make it as soon as we get an skb from a device driver, right before storing the LQI, as is the very first time we need to write something there. Cc: stable@vger.kernel.org Fixes: 32edc40ae65c ("ieee802154: change _cb handling slightly") Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20221020142535.1038885-1-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 7d866e38c7e9ece8a096d0d098fa9d92b9d4f97e Author: Ard Biesheuvel Date: Thu Oct 20 10:39:09 2022 +0200 efi: random: Use 'ACPI reclaim' memory for random seed EFI runtime services data is guaranteed to be preserved by the OS, making it a suitable candidate for the EFI random seed table, which may be passed to kexec kernels as well (after refreshing the seed), and so we need to ensure that the memory is preserved without support from the OS itself. However, runtime services data is intended for allocations that are relevant to the implementations of the runtime services themselves, and so they are unmapped from the kernel linear map, and mapped into the EFI page tables that are active while runtime service invocations are in progress. None of this is needed for the RNG seed. So let's switch to EFI 'ACPI reclaim' memory: in spite of the name, there is nothing exclusively ACPI about it, it is simply a type of allocation that carries firmware provided data which may or may not be relevant to the OS, and it is left up to the OS to decide whether to reclaim it after having consumed its contents. Given that in Linux, we never reclaim these allocations, it is a good choice for the EFI RNG seed, as the allocation is guaranteed to survive kexec reboots. One additional reason for changing this now is to align it with the upcoming recommendation for EFI bootloader provided RNG seeds, which must not use EFI runtime services code/data allocations. Cc: # v4.14+ Signed-off-by: Ard Biesheuvel Reviewed-by: Ilias Apalodimas commit 161a438d730dade2ba2b1bf8785f0759aba4ca5f Author: Ard Biesheuvel Date: Thu Oct 20 10:39:08 2022 +0200 efi: random: reduce seed size to 32 bytes We no longer need at least 64 bytes of random seed to permit the early crng init to complete. The RNG is now based on Blake2s, so reduce the EFI seed size to the Blake2s hash size, which is sufficient for our purposes. While at it, drop the READ_ONCE(), which was supposed to prevent size from being evaluated after seed was unmapped. However, this cannot actually happen, so READ_ONCE() is unnecessary here. Cc: # v4.14+ Signed-off-by: Ard Biesheuvel Reviewed-by: Jason A. Donenfeld Acked-by: Ilias Apalodimas commit d76308f03ee1574b0deffde45604252a51c77f6d Author: Greg Kroah-Hartman Date: Mon Oct 24 08:32:39 2022 +0200 Revert "coresight: cti: Fix hang in cti_disable_hw()" This reverts commit 665c157e0204176023860b51a46528ba0ba62c33. It causes reported build warnings: drivers/hwtracing/coresight/coresight-cti-core.c: In functio n 'cti_enable_hw': drivers/hwtracing/coresight/coresight-cti-core.c:93:24: warning: unused variable 'dev' [-Wunused-variable] 93 | struct device *dev = &drvdata->csdev->dev; | ^~~ drivers/hwtracing/coresight/coresight-cti-core.c: In function 'cti_disable_hw': drivers/hwtracing/coresight/coresight-cti-core.c:154:24: warning: unused variable 'dev' [-Wunused-variable] 154 | struct device *dev = &drvdata->csdev->dev; | ^~~ Reported-by: Stephen Rothwell Cc: Aishwarya TCV Cc: Cristian Marussi Cc: Suzuki Poulose Cc: James Clark Cc: Mike Leach Cc: Mike Leach Cc: Suzuki K Poulose Fixes: 665c157e0204 ("coresight: cti: Fix hang in cti_disable_hw()") Link: https://lore.kernel.org/r/20221024135752.2b83af97@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman commit f4cd18c5b2000df0c382f6530eeca9141ea41faf Author: Jerry Snitselaar Date: Sat Oct 22 08:23:52 2022 -0700 efi/tpm: Pass correct address to memblock_reserve memblock_reserve() expects a physical address, but the address being passed for the TPM final events log is what was returned from early_memremap(). This results in something like the following: [ 0.000000] memblock_reserve: [0xffffffffff2c0000-0xffffffffff2c00e4] efi_tpm_eventlog_init+0x324/0x370 Pass the address from efi like what is done for the TPM events log. Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") Cc: Matthew Garrett Cc: Jarkko Sakkinen Cc: Bartosz Szczepanek Cc: Ard Biesheuvel Signed-off-by: Jerry Snitselaar Acked-by: Jarkko Sakkinen Signed-off-by: Ard Biesheuvel commit d501d37841d3b7f18402d71a9ef057eb9dde127e Author: William Breathitt Gray Date: Thu Oct 20 10:11:21 2022 -0400 counter: 104-quad-8: Fix race getting function mode and direction The quad8_action_read() function checks the Count function mode and Count direction without first acquiring a lock. This is a race condition because the function mode could change by the time the direction is checked. Because the quad8_function_read() already acquires a lock internally, the quad8_function_read() is refactored to spin out the no-lock code to a new quad8_function_get() function. To resolve the race condition in quad8_action_read(), a lock is acquired before calling quad8_function_get() and quad8_direction_read() in order to get both function mode and direction atomically. Fixes: f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221020141121.15434-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit d917a62af81b133f35f627e7936e193c842a7947 Author: William Breathitt Gray Date: Tue Oct 18 08:10:14 2022 -0400 counter: microchip-tcb-capture: Handle Signal1 read and Synapse The signal_read(), action_read(), and action_write() callbacks have been assuming Signal0 is requested without checking. This results in requests for Signal1 returning data for Signal0. This patch fixes these oversights by properly checking for the Signal's id in the respective callbacks and handling accordingly based on the particular Signal requested. The trig_inverted member of the mchp_tc_data is removed as superfluous. Fixes: 106b104137fd ("counter: Add microchip TCB capture counter") Cc: stable@vger.kernel.org Reviewed-by: Kamel Bouhara Link: https://lore.kernel.org/r/20221018121014.7368-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit f950c85e782f90702468bba8243cc97a8d0d04b0 Author: Zhang Xiaoxu Date: Sat Oct 22 15:35:20 2022 +0800 cifs: Fix pages leak when writedata alloc failed in cifs_write_from_iter() There is a kmemleak when writedata alloc failed: unreferenced object 0xffff888175ae4000 (size 4096): comm "dd", pid 19419, jiffies 4296028749 (age 739.396s) hex dump (first 32 bytes): 80 02 b0 04 00 ea ff ff c0 02 b0 04 00 ea ff ff ................ 80 22 4c 04 00 ea ff ff c0 22 4c 04 00 ea ff ff ."L......"L..... backtrace: [<0000000072fdbb86>] __kmalloc_node+0x50/0x150 [<0000000039faf56f>] __iov_iter_get_pages_alloc+0x605/0xdd0 [<00000000f862a9d4>] iov_iter_get_pages_alloc2+0x3b/0x80 [<000000008f226067>] cifs_write_from_iter+0x2ae/0xe40 [<000000001f78f2f1>] __cifs_writev+0x337/0x5c0 [<00000000257fcef5>] vfs_write+0x503/0x690 [<000000008778a238>] ksys_write+0xb9/0x150 [<00000000ed82047c>] do_syscall_64+0x35/0x80 [<000000003365551d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 __iov_iter_get_pages_alloc+0x605/0xdd0 is: want_pages_array at lib/iov_iter.c:1304 (inlined by) __iov_iter_get_pages_alloc at lib/iov_iter.c:1457 If writedata allocate failed, the pages and pagevec should be cleanup. Fixes: 8c5f9c1ab7cb ("CIFS: Add support for direct I/O write") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 4153d789e299b29cbc57276d687c92f3a098e59b Author: Zhang Xiaoxu Date: Sat Oct 22 15:35:21 2022 +0800 cifs: Fix pages array leak when writedata alloc failed in cifs_writedata_alloc() There is a memory leak when writedata alloc failed: unreferenced object 0xffff888192364000 (size 8192): comm "sync", pid 22839, jiffies 4297313967 (age 60.230s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000027de0814>] __kmalloc+0x4d/0x150 [<00000000b21e81ab>] cifs_writepages+0x35f/0x14a0 [<0000000076f7d20e>] do_writepages+0x10a/0x360 [<00000000d6a36edc>] filemap_fdatawrite_wbc+0x95/0xc0 [<000000005751a323>] __filemap_fdatawrite_range+0xa7/0xe0 [<0000000088afb0ca>] file_write_and_wait_range+0x66/0xb0 [<0000000063dbc443>] cifs_strict_fsync+0x80/0x5f0 [<00000000c4624754>] __x64_sys_fsync+0x40/0x70 [<000000002c0dc744>] do_syscall_64+0x35/0x80 [<0000000052f46bee>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 cifs_writepages+0x35f/0x14a0 is: kmalloc_array at include/linux/slab.h:628 (inlined by) kcalloc at include/linux/slab.h:659 (inlined by) cifs_writedata_alloc at fs/cifs/file.c:2438 (inlined by) wdata_alloc_and_fillpages at fs/cifs/file.c:2527 (inlined by) cifs_writepages at fs/cifs/file.c:2705 If writedata alloc failed in cifs_writedata_alloc(), the pages array should be freed. Fixes: 8e7360f67e75 ("CIFS: Add support for direct pages in wdata") Signed-off-by: Zhang Xiaoxu Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 247f34f7b80357943234f93f247a1ae6b6c3a740 Author: Linus Torvalds Date: Sun Oct 23 15:27:33 2022 -0700 Linux 6.1-rc2 commit 05b4ebd2c7cbb3671c376754b37b4963dd08a3a2 Merge: ca4582c286aa4 9aec606c1609a Author: Linus Torvalds Date: Sun Oct 23 15:00:43 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "RISC-V: - Fix compilation without RISCV_ISA_ZICBOM - Fix kvm_riscv_vcpu_timer_pending() for Sstc ARM: - Fix a bug preventing restoring an ITS containing mappings for very large and very sparse device topology - Work around a relocation handling error when compiling the nVHE object with profile optimisation - Fix for stage-2 invalidation holding the VM MMU lock for too long by limiting the walk to the largest block mapping size - Enable stack protection and branch profiling for VHE - Two selftest fixes x86: - add compat implementation for KVM_X86_SET_MSR_FILTER ioctl selftests: - synchronize includes between include/uapi and tools/include/uapi" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: tools: include: sync include/api/linux/kvm.h KVM: x86: Add compat handler for KVM_X86_SET_MSR_FILTER KVM: x86: Copy filter arg outside kvm_vm_ioctl_set_msr_filter() kvm: Add support for arch compat vm ioctls RISC-V: KVM: Fix kvm_riscv_vcpu_timer_pending() for Sstc RISC-V: Fix compilation without RISCV_ISA_ZICBOM KVM: arm64: vgic: Fix exit condition in scan_its_table() KVM: arm64: nvhe: Fix build with profile optimization KVM: selftests: Fix number of pages for memory slot in memslot_modification_stress_test KVM: arm64: selftests: Fix multiple versions of GIC creation KVM: arm64: Enable stack protection and branch profiling for VHE KVM: arm64: Limit stage2_apply_range() batch size to largest block KVM: arm64: Work out supported block level at compile time commit ca4582c286aa4465f9d1a72bef34b04ee907d42e Author: Jason A. Donenfeld Date: Sat Oct 8 09:47:00 2022 -0600 Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all. Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()") Reviewed-by: Andy Shevchenko Cc: Lee Jones Signed-off-by: Jason A. Donenfeld Signed-off-by: Linus Torvalds commit 52826d3b2d1d8e1180a84bef7d72596d6a024a38 Author: Linus Torvalds Date: Sun Oct 23 12:01:01 2022 -0700 kernel/utsname_sysctl.c: Fix hostname polling Commit bfca3dd3d068 ("kernel/utsname_sysctl.c: print kernel arch") added a new entry to the uts_kern_table[] array, but didn't update the UTS_PROC_xyz enumerators of older entries, breaking anything that used them. Which is admittedly not many cases: it's really just the two uses of uts_proc_notify() in kernel/sys.c. But apparently journald-systemd actually uses this to detect hostname changes. Reported-by: Torsten Hilbrich Fixes: bfca3dd3d068 ("kernel/utsname_sysctl.c: print kernel arch") Link: https://lore.kernel.org/lkml/0c2b92a6-0f25-9538-178f-eee3b06da23f@secunet.com/ Link: https://linux-regtracking.leemhuis.info/regzbot/regression/0c2b92a6-0f25-9538-178f-eee3b06da23f@secunet.com/ Cc: Petr Vorel Signed-off-by: Linus Torvalds commit a70385240892bcbc6442b054e847c74100e72f1a Merge: c70055d8d9a0b 21da7472a0404 Author: Linus Torvalds Date: Sun Oct 23 10:14:45 2022 -0700 Merge tag 'perf_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Fix raw data handling when perf events are used in bpf - Rework how SIGTRAPs get delivered to events to address a bunch of problems with it. Add a selftest for that too * tag 'perf_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: bpf: Fix sample_flags for bpf_perf_event_output selftests/perf_events: Add a SIGTRAP stress test with disables perf: Fix missing SIGTRAPs commit c70055d8d9a0b2c500446065c1b80d9836789596 Merge: 6204a81aa3f48 8e5bad7dccec2 Author: Linus Torvalds Date: Sun Oct 23 10:10:55 2022 -0700 Merge tag 'sched_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Adjust code to not trip up CFI - Fix sched group cookie matching * tag 'sched_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Introduce struct balance_callback to avoid CFI mismatches sched/core: Fix comparison in sched_group_cookie_match() commit 6204a81aa3f489e4fb43288d95d27c069bad4e1e Merge: 295dad10bfb5b 230db82413c09 Author: Linus Torvalds Date: Sun Oct 23 10:07:01 2022 -0700 Merge tag 'objtool_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fix from Borislav Petkov: - Fix ORC stack unwinding when GCOV is enabled * tag 'objtool_urgent_for_v6.1_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/unwind/orc: Fix unreliable stack dump with gcov commit 295dad10bfb5bc35ef0d051aec61299ebeb88855 Merge: 942e01ab90151 471f0aa7fa64e Author: Linus Torvalds Date: Sun Oct 23 10:01:34 2022 -0700 Merge tag 'x86_urgent_for_v6.0_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "As usually the case, right after a major release, the tip urgent branches accumulate a couple more fixes than normal. And here is the x86, a bit bigger, urgent pile. - Use the correct CPU capability clearing function on the error path in Intel perf LBR - A CFI fix to ftrace along with a simplification - Adjust handling of zero capacity bit mask for resctrl cache allocation on AMD - A fix to the AMD microcode loader to attempt patch application on every logical thread - A couple of topology fixes to handle CPUID leaf 0x1f enumeration info properly - Drop a -mabi=ms compiler option check as both compilers support it now anyway - A couple of fixes to how the initial, statically allocated FPU buffer state is setup and its interaction with dynamic states at runtime" * tag 'x86_urgent_for_v6.0_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Fix copy_xstate_to_uabi() to copy init states correctly perf/x86/intel/lbr: Use setup_clear_cpu_cap() instead of clear_cpu_cap() ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph() x86/ftrace: Remove ftrace_epilogue() x86/resctrl: Fix min_cbm_bits for AMD x86/microcode/AMD: Apply the patch early on every logical thread x86/topology: Fix duplicated core ID within a package x86/topology: Fix multiple packages shown on a single-package system hwmon/coretemp: Handle large core ID value x86/Kconfig: Drop check for -mabi=ms for CONFIG_EFI_STUB x86/fpu: Exclude dynamic states from init_fpstate x86/fpu: Fix the init_fpstate size check with the actual size x86/fpu: Configure init_fpstate attributes orderly commit 942e01ab90151a16b79b5c0cb8e77530d1ee3dbb Merge: d47136c280154 cc767e7c6913f Author: Linus Torvalds Date: Sun Oct 23 09:55:50 2022 -0700 Merge tag 'io_uring-6.1-2022-10-22' of git://git.kernel.dk/linux Pull io_uring follow-up from Jens Axboe: "Currently the zero-copy has automatic fallback to normal transmit, and it was decided that it'd be cleaner to return an error instead if the socket type doesn't support it. Zero-copy does work with UDP and TCP, it's more of a future proofing kind of thing (eg for samba)" * tag 'io_uring-6.1-2022-10-22' of git://git.kernel.dk/linux: io_uring/net: fail zc sendmsg when unsupported by socket io_uring/net: fail zc send when unsupported by socket net: flag sockets supporting msghdr originated zerocopy commit 39114b881c94417a11114164c5cb2f463034b60e Merge: da95cf6655e45 a10a0f385ab8a Author: Greg Kroah-Hartman Date: Sun Oct 23 18:05:37 2022 +0200 Merge tag 'iio-fixes-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: "1st set of IIO fixes for the 6.1 cycle. Usual bunch of driver fixes + one set of fixes for driver bugs introduced by a core change to how buffer attributes are handled. - buffer attributes * Remove usage of IIO_CONST_ATTR() for buffer attributes in all drivers where this occurred as that broke wrapping code need to duplicate these for multiple buffer support. The minimal fix is moving to IIO_DEVICE_ATTR_RO() with separate _show() routines. A cleanup of this code, preventing similar issues in future will follow next merge window. - tools/iio * Wrong handling of number of digits in the number 0. - adi,ltc2983 * Avoid reallocating channels on each wake up from sleep by moving that step out of the ltc2983_setup() function. - microchip,mcp3911 * Wrong ID bits + masking in debug prints. * Fix ARRAY_SIZE() vs sizeof() mix up. * Handle NULL return on trigger allocation failure correctly. - st,stm32-adc: * Ensure we initialize sampling time even when optional property not provided in DT. Internal channels require a minimum value that will not otherwise be set. - taos,tsl2583 * Fix a double call of iio_device_unregister() via device managed and un-managed paths." * tag 'iio-fixes-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: bmc150-accel-core: Fix unsafe buffer attributes iio: adxl367: Fix unsafe buffer attributes iio: adxl372: Fix unsafe buffer attributes iio: at91-sama5d2_adc: Fix unsafe buffer attributes iio: temperature: ltc2983: allocate iio channels once tools: iio: iio_utils: fix digit calculation iio: adc: stm32-adc: fix channel sampling time init iio: adc: mcp3911: mask out device ID in debug prints iio: adc: mcp3911: use correct id bits iio: adc: mcp3911: return proper error code on failure to allocate trigger iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug iio: light: tsl2583: Fix module unloading commit f23f1a1e8437e38014fe34a2f12e37e861e5bcc7 Author: Marek Vasut Date: Wed Sep 21 03:10:08 2022 +0200 arm64: dts: imx8mm: Enable CPLD_Dn pull down resistor on MX8Menlo Enable CPLD_Dn pull down resistor instead of pull up to avoid intefering with CPLD power off functionality. Fixes: 510c527b4ff57 ("arm64: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board") Signed-off-by: Marek Vasut Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit d47136c2801540e80f41ec7e063d8d592568ad76 Merge: cda5d920545c0 5619c6609130b Author: Linus Torvalds Date: Sat Oct 22 16:04:34 2022 -0700 Merge tag 'hwmon-for-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - corsair-psu: Fix typo in USB id description, and add USB ID for new PSU - pwm-fan: Fix fan power handling when disabling fan control * tag 'hwmon-for-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (corsair-psu) Add USB id of the new HX1500i psu hwmon: (pwm-fan) Explicitly switch off fan power when setting pwm1_enable to 0 hwmon: (corsair-psu) fix typo in USB id description commit cda5d920545c0f81554bfd241b190d3cb5c5da14 Merge: fd79882ff2817 65d78b8d0405f Author: Linus Torvalds Date: Sat Oct 22 15:59:46 2022 -0700 Merge tag 'i2c-for-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "RPM fix for qcom-cci, platform module alias for xiic, build warning fix for mlxbf, typo fixes in comments" * tag 'i2c-for-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mlxbf: depend on ACPI; clean away ifdeffage i2c: fix spelling typos in comments i2c: qcom-cci: Fix ordering of pm_runtime_xx and i2c_add_adapter i2c: xiic: Add platform module alias commit fd79882ff281776260849b658d41fc06553e7fea Merge: 3272eb1ace326 e6aa4edd2f5b0 Author: Linus Torvalds Date: Sat Oct 22 15:52:36 2022 -0700 Merge tag 'pci-v6.1-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Revert a simplification that broke pci-tegra due to a masking error - Update MAINTAINERS for Kishon's email address change and TI DRA7XX/J721E maintainer change * tag 'pci-v6.1-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: MAINTAINERS: Update Kishon's email address in PCI endpoint subsystem MAINTAINERS: Add Vignesh Raghavendra as maintainer of TI DRA7XX/J721E PCI driver Revert "PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro" commit 3272eb1ace32627d0ba1d20373fae246f46770ca Merge: 4da34b7d175dc d67614f276c14 Author: Linus Torvalds Date: Sat Oct 22 15:30:15 2022 -0700 Merge tag 'media/v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull missed media updates from Mauro Carvalho Chehab: "It seems I screwed-up my previous pull request: it ends up that only half of the media patches that were in linux-next got merged in -rc1. The script which creates the signed tags silently failed due to 5.19->6.0 so it ended generating a tag with incomplete stuff. So here are the missing parts: - a DVB core security fix - lots of fixes and cleanups for atomisp staging driver - old drivers that are VB1 are being moved to staging to be deprecated - several driver updates - mostly for embedded systems, but there are also some things addressing issues with some PC webcams, in the UVC video driver" * tag 'media/v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (163 commits) media: sun6i-csi: Move csi buffer definition to main header file media: sun6i-csi: Introduce and use video helper functions media: sun6i-csi: Add media ops with link notify callback media: sun6i-csi: Remove controls handler from the driver media: sun6i-csi: Register the media device after creation media: sun6i-csi: Pass and store csi device directly in video code media: sun6i-csi: Tidy up video code media: sun6i-csi: Tidy up v4l2 code media: sun6i-csi: Tidy up Kconfig media: sun6i-csi: Use runtime pm for clocks and reset media: sun6i-csi: Define and use variant to get module clock rate media: sun6i-csi: Always set exclusive module clock rate media: sun6i-csi: Tidy up platform code media: sun6i-csi: Refactor main driver data structures media: sun6i-csi: Define and use driver name and (reworked) description media: cedrus: Add a Kconfig dependency on RESET_CONTROLLER media: sun8i-rotate: Add a Kconfig dependency on RESET_CONTROLLER media: sun8i-di: Add a Kconfig dependency on RESET_CONTROLLER media: sun4i-csi: Add a Kconfig dependency on RESET_CONTROLLER media: sun6i-csi: Add a Kconfig dependency on RESET_CONTROLLER ... commit 02341a08c9dec5a88527981b0bdf0fb6f7499cbf Author: Yu Kuai Date: Sat Oct 22 10:16:15 2022 +0800 block: fix memory leak for elevator on add_disk failure The default elevator is allocated in the beginning of device_add_disk(), however, it's not freed in the following error path. Fixes: 50e34d78815e ("block: disable the elevator int del_gendisk") Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Reviewed-by: Jason Yan Link: https://lore.kernel.org/r/20221022021615.2756171-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit cc767e7c6913f770741d9fad1efa4957c2623744 Author: Pavel Begunkov Date: Fri Oct 21 11:16:41 2022 +0100 io_uring/net: fail zc sendmsg when unsupported by socket The previous patch fails zerocopy send requests for protocols that don't support it, do the same for zerocopy sendmsg. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0854e7bb4c3d810a48ec8b5853e2f61af36a0467.1666346426.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit edf81438799ccead7122948446d7e44b083e788d Author: Pavel Begunkov Date: Fri Oct 21 11:16:40 2022 +0100 io_uring/net: fail zc send when unsupported by socket If a protocol doesn't support zerocopy it will silently fall back to copying. This type of behaviour has always been a source of troubles so it's better to fail such requests instead. Cc: # 6.0 Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2db3c7f16bb6efab4b04569cd16e6242b40c5cb3.1666346426.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e993ffe3da4bcddea0536b03be1031bf35cd8d85 Author: Pavel Begunkov Date: Fri Oct 21 11:16:39 2022 +0100 net: flag sockets supporting msghdr originated zerocopy We need an efficient way in io_uring to check whether a socket supports zerocopy with msghdr provided ubuf_info. Add a new flag into the struct socket flags fields. Cc: # 6.0 Signed-off-by: Pavel Begunkov Acked-by: Jakub Kicinski Link: https://lore.kernel.org/r/3dafafab822b1c66308bb58a0ac738b1e3f53f74.1666346426.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5619c6609130bce910736a61724a5ee033a0822c Author: Wilken Gottwalt Date: Sat Oct 8 11:35:34 2022 +0000 hwmon: (corsair-psu) Add USB id of the new HX1500i psu Also update the documentation accordingly. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/Y0FghqQCHG/cX5Jz@monster.localdomain Signed-off-by: Guenter Roeck commit 079f6889818dd07903fb36c252532ab47ebb6d48 Author: Jim Mattson Date: Thu Sep 29 15:52:01 2022 -0700 KVM: x86: Mask off reserved bits in CPUID.8000001AH KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. In the case of CPUID.8000001AH, only three bits are currently defined. The 125 reserved bits should be masked off. Fixes: 24c82e576b78 ("KVM: Sanitize cpuid") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-4-jmattson@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 7030d8530e533844e2f4b0e7476498afcd324634 Author: Jim Mattson Date: Thu Sep 29 15:52:00 2022 -0700 KVM: x86: Mask off reserved bits in CPUID.80000008H KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. The following ranges of CPUID.80000008H are reserved and should be masked off: ECX[31:18] ECX[11:8] In addition, the PerfTscSize field at ECX[17:16] should also be zero because KVM does not set the PERFTSC bit at CPUID.80000001H.ECX[27]. Fixes: 24c82e576b78 ("KVM: Sanitize cpuid") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-3-jmattson@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit eeb69eab57c6604ac90b3fd8e5ac43f24a5535b1 Author: Jim Mattson Date: Thu Sep 29 15:51:59 2022 -0700 KVM: x86: Mask off reserved bits in CPUID.80000006H KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.80000006H:EDX[17:16] are reserved bits and should be masked off. Fixes: 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-2-jmattson@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 0469e56a14bf8cfb80507e51b7aeec0332cdbc13 Author: Jim Mattson Date: Fri Sep 30 00:51:58 2022 +0200 KVM: x86: Mask off reserved bits in CPUID.80000001H KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.80000001:EBX[27:16] are reserved bits and should be masked off. Fixes: 0771671749b5 ("KVM: Enhance guest cpuid management") Signed-off-by: Jim Mattson Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 9aec606c1609a5da177b579475a73f6c948e034a Author: Paolo Bonzini Date: Sat Oct 22 07:43:52 2022 -0400 tools: include: sync include/api/linux/kvm.h Provide a definition of KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option") Cc: Marc Zyngier Signed-off-by: Paolo Bonzini commit fb8f60dd1b67520e0e0d7978ef17d015690acfc1 Author: Justin Chen Date: Wed Oct 5 12:13:55 2022 -0700 usb: bdc: change state when port disconnected When port is connected and then disconnected, the state stays as configured. Which is incorrect as the port is no longer configured, but in a not attached state. Signed-off-by: Justin Chen Acked-by: Florian Fainelli Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Cc: stable Link: https://lore.kernel.org/r/1664997235-18198-1-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4e3a50293c2b21961f02e1afa2f17d3a1a90c7c8 Author: Heikki Krogerus Date: Fri Oct 7 13:09:51 2022 +0300 usb: typec: ucsi: acpi: Implement resume callback The ACPI driver needs to resume the interface by calling ucsi_resume(). Otherwise we may fail to detect connections and disconnections that happen while the system is suspended. Link: https://bugzilla.kernel.org/show_bug.cgi?id=210425 Fixes: a94ecde41f7e ("usb: typec: ucsi: ccg: enable runtime pm support") Cc: Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20221007100951.43798-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 99f6d43611135bd6f211dec9e88bb41e4167e304 Author: Heikki Krogerus Date: Fri Oct 7 13:09:50 2022 +0300 usb: typec: ucsi: Check the connection on resume Checking the connection status of every port on resume. This fixes an issue where the partner device is not unregistered properly after resume if it was unplugged while the system was suspended. The function ucsi_check_connection() is also modified so that it can be used also for registering the connection on top of unregistering it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=210425 Fixes: a94ecde41f7e ("usb: typec: ucsi: ccg: enable runtime pm support") Cc: Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20221007100951.43798-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 48ed32482c4100069d0c0eebdc6b198c6ae5f71f Author: Joel Stanley Date: Mon Oct 17 16:00:06 2022 +1030 usb: gadget: aspeed: Fix probe regression Since commit fc274c1e9973 ("USB: gadget: Add a new bus for gadgets"), the gadget devices are proper driver core devices, which caused each device to request pinmux settings: aspeed_vhub 1e6a0000.usb-vhub: Initialized virtual hub in USB2 mode aspeed-g5-pinctrl 1e6e2080.pinctrl: pin A7 already requested by 1e6a0000.usb-vhub; cannot claim for gadget.0 aspeed-g5-pinctrl 1e6e2080.pinctrl: pin-232 (gadget.0) status -22 aspeed-g5-pinctrl 1e6e2080.pinctrl: could not request pin 232 (A7) from group USB2AD on device aspeed-g5-pinctrl g_mass_storage gadget.0: Error applying setting, reverse things back The vhub driver has already claimed the pins, so prevent the gadgets from requesting them too by setting the magic of_node_reused flag. This causes the driver core to skip the mux request. Reported-by: Zev Weiss Reported-by: Jae Hyun Yoo Fixes: fc274c1e9973 ("USB: gadget: Add a new bus for gadgets") Cc: stable@vger.kernel.org Signed-off-by: Joel Stanley Tested-by: Zev Weiss Tested-by: Jae Hyun Yoo Link: https://lore.kernel.org/r/20221017053006.358520-1-joel@jms.id.au Signed-off-by: Greg Kroah-Hartman commit b57b08e6f431348363adffa5b6643fe3ec9dc7fe Author: Jeff Vanhoof Date: Tue Oct 18 16:50:40 2022 -0500 usb: gadget: uvc: fix sg handling during video encode In uvc_video_encode_isoc_sg, the uvc_request's sg list is incorrectly being populated leading to corrupt video being received by the remote end. When building the sg list the usage of buf->sg's 'dma_length' field is not correct and instead its 'length' field should be used. Fixes: e81e7f9a0eb9 ("usb: gadget: uvc: add scatter gather support") Cc: Signed-off-by: Jeff Vanhoof Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20221018215044.765044-5-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 0a0a2760b04814428800d48281a447a7522470ad Author: Dan Vacura Date: Tue Oct 18 16:50:39 2022 -0500 usb: gadget: uvc: fix sg handling in error case If there is a transmission error the buffer will be returned too early, causing a memory fault as subsequent requests for that buffer are still queued up to be sent. Refactor the error handling to wait for the final request to come in before reporting back the buffer to userspace for all transfer types (bulk/isoc/isoc_sg). This ensures userspace knows if the frame was successfully sent. Fixes: e81e7f9a0eb9 ("usb: gadget: uvc: add scatter gather support") Cc: Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20221018215044.765044-4-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 8e8e923a49967b798e7d69f1ce9eff1dd2533547 Author: Dan Vacura Date: Tue Oct 18 16:50:37 2022 -0500 usb: gadget: uvc: fix dropped frame after missed isoc With the re-use of the previous completion status in 0d1c407b1a749 ("usb: dwc3: gadget: Return proper request status") it could be possible that the next frame would also get dropped if the current frame has a missed isoc error. Ensure that an interrupt is requested for the start of a new frame. Fixes: fc78941d8169 ("usb: gadget: uvc: decrease the interrupt load to a quarter") Cc: Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20221018215044.765044-2-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 4db0fbb601361767144e712beb96704b966339f5 Author: Thinh Nguyen Date: Tue Oct 18 19:39:01 2022 -0700 usb: dwc3: gadget: Don't delay End Transfer on delayed_status The gadget driver may wait on the request completion when it sets the USB_GADGET_DELAYED_STATUS. Make sure that the End Transfer command can go through if the dwc->delayed_status is set so that the request can complete. When the delayed_status is set, the Setup packet is already processed, and the next phase should be either Data or Status. It's unlikely that the host would cancel the control transfer and send a new Setup packet during End Transfer command. But if that's the case, we can try again when ep0state returns to EP0_SETUP_PHASE. Fixes: e1ee843488d5 ("usb: dwc3: gadget: Force sending delayed status during soft disconnect") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/3f9f59e5d74efcbaee444cf4b30ef639cc7b124e.1666146954.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit d182c2e1bc92084c038b44c618f29589a4de9f66 Author: Andrey Smirnov Date: Tue Oct 18 02:35:10 2022 +0300 usb: dwc3: Don't switch OTG -> peripheral if extcon is present If the extcon device exists, get the mode from the extcon device. If the controller is DRD and the driver is unable to determine the mode, only then default the dr_mode to USB_DR_MODE_PERIPHERAL. Reported-by: Steev Klimaszewski Fixes: 7a84e7353e23 ("Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"") Cc: stable Reviewed-by: Thinh Nguyen Signed-off-by: Andrey Smirnov Signed-off-by: Andy Shevchenko Tested-by: Steev Klimaszewski Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20221017233510.53336-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit da95cf6655e45fb12b101196b6a303fdf984a0c3 Merge: 9abf2313adc1c 665c157e02041 Author: Greg Kroah-Hartman Date: Sat Oct 22 12:22:11 2022 +0200 Merge tag 'coresight-fixes-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next Suzuki writes: "coresight: Fixes for v6.1 Fixes for coresight drivers for v6.1 - Fix possible deadlock CTI mutexes (LOCKDEP) - Fix hang in CTI with runtime power management" * tag 'coresight-fixes-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: coresight: cti: Fix hang in cti_disable_hw() coresight: Fix possible deadlock with lock dependency commit 1739c7017fb1d759965dcbab925ff5980a5318cb Author: Alexander Graf Date: Mon Oct 17 20:45:41 2022 +0200 KVM: x86: Add compat handler for KVM_X86_SET_MSR_FILTER The KVM_X86_SET_MSR_FILTER ioctls contains a pointer in the passed in struct which means it has a different struct size depending on whether it gets called from 32bit or 64bit code. This patch introduces compat code that converts from the 32bit struct to its 64bit counterpart which then gets used going forward internally. With this applied, 32bit QEMU can successfully set MSR bitmaps when running on 64bit kernels. Reported-by: Andrew Randrianasulu Fixes: 1a155254ff937 ("KVM: x86: Introduce MSR filtering") Signed-off-by: Alexander Graf Message-Id: <20221017184541.2658-4-graf@amazon.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 2e3272bc1790825c43d2c39690bf2836b81c6d36 Author: Alexander Graf Date: Mon Oct 17 20:45:40 2022 +0200 KVM: x86: Copy filter arg outside kvm_vm_ioctl_set_msr_filter() In the next patch we want to introduce a second caller to set_msr_filter() which constructs its own filter list on the stack. Refactor the original function so it takes it as argument instead of reading it through copy_from_user(). Signed-off-by: Alexander Graf Message-Id: <20221017184541.2658-3-graf@amazon.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit ed51862f2f57cbce6fed2d4278cfe70a490899fd Author: Alexander Graf Date: Mon Oct 17 20:45:39 2022 +0200 kvm: Add support for arch compat vm ioctls We will introduce the first architecture specific compat vm ioctl in the next patch. Add all necessary boilerplate to allow architectures to override compat vm ioctls when necessary. Signed-off-by: Alexander Graf Message-Id: <20221017184541.2658-2-graf@amazon.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 593c5ba288e118ad80b41e8339f0d0dcad65eb04 Author: Justin Chen Date: Fri Oct 7 11:32:09 2022 -0700 MAINTAINERS: Update maintainers for broadcom USB Al Cooper is no longer the internal broadcom maintainer for broadcom USB. I will be taking his place as the internal maintainer and as an additional upstream maintainer. Signed-off-by: Justin Chen Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/1665167529-9840-1-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0eafdcfea6bc82f7f8c9a9af2d4add6745beefc5 Author: Greg Kroah-Hartman Date: Fri Sep 30 13:40:41 2022 +0200 MAINTAINERS: move USB gadget and phy entries under the main USB entry Felipe has done a wonderful job over the years, but now it makes sense to just maintain all of the USB stack in one tree. Do so by removing the current USB gadget and phy entries so that all portions of the stack are now covered by the main USB maintainer entry. Acked-by: Felipe Balbi Link: https://lore.kernel.org/r/20220930114041.1306711-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 21e6075974c82808fc46ffc72384f2cc8074777f Merge: ebccb53e939d9 cea8896bd9361 Author: Paolo Bonzini Date: Sat Oct 22 03:33:58 2022 -0400 Merge tag 'kvm-riscv-fixes-6.1-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 6.1, take #1 - Fix compilation without RISCV_ISA_ZICBOM - Fix kvm_riscv_vcpu_timer_pending() for Sstc commit ebccb53e939d9ee211cd304e659498496c2e29c9 Merge: 5834816829e6b c000a2607145d Author: Paolo Bonzini Date: Sat Oct 22 03:33:26 2022 -0400 Merge tag 'kvmarm-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 6.1, take #2 - Fix a bug preventing restoring an ITS containing mappings for very large and very sparse device topology - Work around a relocation handling error when compiling the nVHE object with profile optimisation commit 5834816829e6b80871d8ee1c3d173e0259a02d1f Merge: 9abf2313adc1c 05c2224d4b049 Author: Paolo Bonzini Date: Sat Oct 22 03:32:23 2022 -0400 Merge tag 'kvmarm-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 6.1, take #1 - Fix for stage-2 invalidation holding the VM MMU lock for too long by limiting the walk to the largest block mapping size - Enable stack protection and branch profiling for VHE - Two selftest fixes commit f86bfeb689f2c4ebe12782ef0578ef778fb1a050 Author: Takashi Iwai Date: Sat Oct 22 09:21:07 2022 +0200 ALSA: hda/realtek: Add another HP ZBook G9 model quirks HP ZBook Firefly 16 G9 (103c:896d) and HP ZBook Power 15.6 G9 (103c:89c0) require the same quirk for enabling CS35L41 speaker amps. Signed-off-by: Takashi Iwai Cc: Link: https://lore.kernel.org/r/20221022072107.3401-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0bda03623e6b8b9052da5ba0145608941bcc2eb0 Author: Yinjun Zhang Date: Thu Oct 20 09:14:11 2022 +0100 nfp: only clean `sp_indiff` when application firmware is unloaded Currently `sp_indiff` is cleaned when driver is removed. This will cause problem in multi-PF/multi-host case, considering one PF is removed while another is still in use. Since `sp_indiff` is the application firmware property, it should only be cleaned when the firmware is unloaded. Now let management firmware to clean it when necessary, driver only set it. Fixes: b1e4f11e426d ("nfp: refine the ABI of getting `sp_indiff` info") Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20221020081411.80186-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 0a09f01f11e7c5493ec87a1f9c8824c3fc010751 Merge: 4d814b329a4d5 170a9e341a3b0 Author: Jakub Kicinski Date: Fri Oct 21 22:40:27 2022 -0700 Merge branch 'amd-xgbe-miscellaneous-fixes' Raju Rangoju says: ==================== amd-xgbe: Miscellaneous fixes (1) Fix the rrc for Yellow carp devices. CDR workaround path is disabled for YC devices, receiver reset cycle is not needed in such cases. (2) Add enumerations for mailbox command and sub-commands. Instead of using hard-coded values, use enums. (3) Enable PLL_CTL for fixed PHY modes only. Driver does not implement SW RRCM for Autoneg Off configuration, hence PLL is needed for fixed PHY modes only. (4) Fix the SFP compliance codes check for DAC cables. Some of the passive cables have non-zero data at offset 6 in SFP EEPROM data. So, fix the sfp compliance codes check. (5) Add a quirk for Molex passive cables to extend the rate ceiling to 0x78. ==================== Link: https://lore.kernel.org/r/20221020064215.2341278-1-Raju.Rangoju@amd.com Signed-off-by: Jakub Kicinski commit 170a9e341a3b02c0b2ea0df16ef14a33a4f41de8 Author: Raju Rangoju Date: Thu Oct 20 12:12:15 2022 +0530 amd-xgbe: add the bit rate quirk for Molex cables The offset 12 (bit-rate) of EEPROM SFP DAC (passive) cables is expected to be in the range 0x64 to 0x68. However, the 5 meter and 7 meter Molex passive cables have the rate ceiling 0x78 at offset 12. Add a quirk for Molex passive cables to extend the rate ceiling to 0x78. Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Signed-off-by: Jakub Kicinski commit 09c5f6bf11ac98874339e55f4f5f79a9dbc9b375 Author: Raju Rangoju Date: Thu Oct 20 12:12:14 2022 +0530 amd-xgbe: fix the SFP compliance codes check for DAC cables The current XGBE code assumes that offset 6 of EEPROM SFP DAC (passive) cables is NULL. However, some cables (the 5 meter and 7 meter Molex passive cables) have non-zero data at offset 6. Fix the logic by moving the passive cable check above the active checks, so as not to be improperly identified as an active cable. This will fix the issue for any passive cable that advertises 1000Base-CX in offset 6. Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Signed-off-by: Jakub Kicinski commit fc75c032aee63e60170d80f44c8567ea45fc59da Author: Raju Rangoju Date: Thu Oct 20 12:12:13 2022 +0530 amd-xgbe: enable PLL_CTL for fixed PHY modes only PLL control setting(RRC) is needed only in fixed PHY configuration to fix the peer-peer issues. Without the PLL control setting, the link up takes longer time in a fixed phy configuration. Driver implements SW RRC for Autoneg On configuration, hence PLL control setting (RRC) is not needed for AN On configuration, and can be skipped. Also, PLL re-initialization is not needed for PHY Power Off and RRC commands. Otherwise, they lead to mailbox errors. Added the changes accordingly. Fixes: daf182d360e5 ("net: amd-xgbe: Toggle PLL settings during rate change") Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Signed-off-by: Jakub Kicinski commit 1246d0862349f36b65db1043d27c466af930047d Author: Raju Rangoju Date: Thu Oct 20 12:12:12 2022 +0530 amd-xgbe: use enums for mailbox cmd and sub_cmds Instead of using hardcoded values, use enumerations for mailbox command and sub commands. Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Signed-off-by: Jakub Kicinski commit f97fc7ef414603189d5ba6f529407c5341c03c2a Author: Raju Rangoju Date: Thu Oct 20 12:12:11 2022 +0530 amd-xgbe: Yellow carp devices do not need rrc Link stability issues are noticed on Yellow carp platforms when Receiver Reset Cycle is issued. Since the CDR workaround is disabled on these platforms, the Receiver Reset Cycle is not needed. So, avoid issuing rrc on Yellow carp platforms. Fixes: dbb6c58b5a61 ("net: amd-xgbe: Add Support for Yellow Carp Ethernet device") Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Signed-off-by: Jakub Kicinski commit 307539eed46395d27e0ecc0ae4d9d6e99eb15fcd Author: Keoseong Park Date: Wed Oct 19 12:45:30 2022 +0900 scsi: ufs: core: Fix typo in comment Change "drity" to "dirty". Signed-off-by: Keoseong Park Link: https://lore.kernel.org/r/20221019034530epcms2p2b10e072bb66b3fd6cdbe0e2423c11735@epcms2p2 Signed-off-by: Martin K. Petersen commit 65244389b1b347447a7eed866d9d458963e851e8 Author: Michal Kubecek Date: Mon Oct 17 16:55:17 2022 +0200 scsi: mpi3mr: Select CONFIG_SCSI_SAS_ATTRS Starting with commit 42fc9fee116f ("scsi: mpi3mr: Add helper functions to manage device's port"), kernel configured with CONFIG_SCSI_MPI3MR=m and CONFIG_SCSI_SAS_ATTRS=n fails to build because modpost cannot find symbols used in mpi3mr_transport.c: ERROR: modpost: "sas_port_alloc_num" [drivers/scsi/mpi3mr/mpi3mr.ko] undefined! ERROR: modpost: "sas_remove_host" [drivers/scsi/mpi3mr/mpi3mr.ko] undefined! ERROR: modpost: "sas_phy_alloc" [drivers/scsi/mpi3mr/mpi3mr.ko] undefined! ERROR: modpost: "sas_phy_free" [drivers/scsi/mpi3mr/mpi3mr.ko] undefined! ... Select CONFIG_SCSI_SAS_ATTRS when CONFIG_SCSI_MPI3MR is enabled to prevent inconsistent configs. Link: https://lore.kernel.org/r/20221017145517.93BCB6043B@lion.mk-sys.cz Fixes: 42fc9fee116f ("scsi: mpi3mr: Add helper functions to manage device's port") Acked-by: Sathya Prakash Veerichetty Signed-off-by: Michal Kubecek Signed-off-by: Martin K. Petersen commit 4652b58fe3bb177a9b208bb7a8b7a3fb64184a00 Author: Keoseong Park Date: Mon Oct 17 18:58:15 2022 +0900 scsi: ufs: core: Fix typo for register name in comments Change "UTRMLCLR" to "UTMRLCLR". The meaning is "UTP Task Management Request List CLear Register" Signed-off-by: Keoseong Park Link: https://lore.kernel.org/r/20221017095815epcms2p110e3421b99bb9a937620b4d065d0ed12@epcms2p1 Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 181dfce9b63b80adbb861b219550ec9b27fe63d5 Author: Igor Pylypiv Date: Fri Oct 7 16:06:51 2022 -0700 scsi: pm80xx: Display proc_name in sysfs The proc_name entry in sysfs for pm80xx is "(null)" because it is not initialized in scsi_host_template: Before: host:~# cat /sys/class/scsi_host/host6/proc_name (null) After: host:~# cat /sys/class/scsi_host/host6/proc_name pm80xx Signed-off-by: Igor Pylypiv Link: https://lore.kernel.org/r/20221007230651.308969-1-ipylypiv@google.com Reviewed-by: Jolly Shah Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 48ee7952808183201b0601d85b89d2d8ccca95ff Author: Dukhyun Kwon Date: Tue Oct 18 16:30:03 2022 +0900 scsi: ufs: core: Fix the error log in ufshcd_query_flag_retry() In ufshcd_query_flag_retry() failed log is incorrectly output as "ufs attibute". Signed-off-by: Dukhyun Kwon Link: https://lore.kernel.org/r/1891546521.01666080182092.JavaMail.epsvc@epcpadp4 Reviewed-by: Bean Huo Signed-off-by: Martin K. Petersen commit bed54aeb6ac1ced7e0ea27a82ee52af856610ff0 Merge: dbe69b2998846 fa4447cb73b2b Author: Alexei Starovoitov Date: Fri Oct 21 19:17:38 2022 -0700 Merge branch 'Wait for busy refill_work when destroying bpf memory allocator' Hou Tao says: ==================== From: Hou Tao Hi, The patchset aims to fix one problem of bpf memory allocator destruction when there is PREEMPT_RT kernel or kernel with arch_irq_work_has_interrupt() being false (e.g. 1-cpu arm32 host or mips). The root cause is that there may be busy refill_work when the allocator is destroying and it may incur oops or other problems as shown in patch #1. Patch #1 fixes the problem by waiting for the completion of irq work during destroying and patch #2 is just a clean-up patch based on patch #1. Please see individual patches for more details. Comments are always welcome. Change Log: v2: * patch 1: fix typos and add notes about the overhead of irq_work_sync() * patch 1 & 2: add Acked-by tags from sdf@google.com v1: https://lore.kernel.org/bpf/20221019115539.983394-1-houtao@huaweicloud.com/T/#t ==================== Signed-off-by: Alexei Starovoitov commit fa4447cb73b2bfe7175f1b7ffdc70580fcfcb991 Author: Hou Tao Date: Fri Oct 21 19:49:13 2022 +0800 bpf: Use __llist_del_all() whenever possbile during memory draining Except for waiting_for_gp list, there are no concurrent operations on free_by_rcu, free_llist and free_llist_extra lists, so use __llist_del_all() instead of llist_del_all(). waiting_for_gp list can be deleted by RCU callback concurrently, so still use llist_del_all(). Acked-by: Stanislav Fomichev Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20221021114913.60508-3-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 3d05818707bb2cf133ccdcd29f2d5585b5bc1298 Author: Hou Tao Date: Fri Oct 21 19:49:12 2022 +0800 bpf: Wait for busy refill_work when destroying bpf memory allocator A busy irq work is an unfinished irq work and it can be either in the pending state or in the running state. When destroying bpf memory allocator, refill_work may be busy for PREEMPT_RT kernel in which irq work is invoked in a per-CPU RT-kthread. It is also possible for kernel with arch_irq_work_has_interrupt() being false (e.g. 1-cpu arm32 host or mips) and irq work is inovked in timer interrupt. The busy refill_work leads to various issues. The obvious one is that there will be concurrent operations on free_by_rcu and free_list between irq work and memory draining. Another one is call_rcu_in_progress will not be reliable for the checking of pending RCU callback because do_call_rcu() may have not been invoked by irq work yet. The other is there will be use-after-free if irq work is freed before the callback of irq work is invoked as shown below: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 12ab94067 P4D 12ab94067 PUD 1796b4067 PMD 0 Oops: 0010 [#1] PREEMPT_RT SMP CPU: 5 PID: 64 Comm: irq_work/5 Not tainted 6.0.0-rt11+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 0018:ffffadc080293e78 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffffcdc07fb6a388 RCX: ffffa05000a2e000 RDX: ffffa05000a2e000 RSI: ffffffff96cc9827 RDI: ffffcdc07fb6a388 ...... Call Trace: irq_work_single+0x24/0x60 irq_work_run_list+0x24/0x30 run_irq_workd+0x23/0x30 smpboot_thread_fn+0x203/0x300 kthread+0x126/0x150 ret_from_fork+0x1f/0x30 Considering the ease of concurrency handling, no overhead for irq_work_sync() under non-PREEMPT_RT kernel and has-irq-work-interrupt kernel and the short wait time used for irq_work_sync() under PREEMPT_RT (When running two test_maps on PREEMPT_RT kernel and 72-cpus host, the max wait time is about 8ms and the 99th percentile is 10us), just using irq_work_sync() to wait for busy refill_work to complete before memory draining and memory freeing. Fixes: 7c8199e24fa0 ("bpf: Introduce any context BPF specific memory allocator.") Acked-by: Stanislav Fomichev Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20221021114913.60508-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 4da34b7d175dc99b8befebd69e96546c960d526c Merge: 20df096147754 4bb7f6c2781e4 Author: Linus Torvalds Date: Fri Oct 21 18:26:00 2022 -0700 Merge tag 'thermal-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fix from Rafael Wysocki: "This fixes the control CPU selection in the intel_powerclamp thermal driver" * tag 'thermal-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: intel_powerclamp: Use first online CPU as control_cpu commit 20df09614775475fecc37a786a382755ba3d7d2b Merge: 9d6e681d33943 a6991d623de02 Author: Linus Torvalds Date: Fri Oct 21 18:19:42 2022 -0700 Merge tag 'pm-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix some issues and clean up code in ARM cpufreq drivers. Specifics: - Fix module loading in the Tegra124 cpufreq driver (Jon Hunter) - Fix memory leak and update to read-only region in the qcom cpufreq driver (Fabien Parent) - Miscellaneous minor cleanups to cpufreq drivers (Fabien Parent, Yang Yingliang)" * tag 'pm-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: sun50i: Switch to use dev_err_probe() helper cpufreq: qcom-nvmem: Switch to use dev_err_probe() helper cpufreq: imx6q: Switch to use dev_err_probe() helper cpufreq: dt: Switch to use dev_err_probe() helper cpufreq: qcom: remove unused parameter in function definition cpufreq: qcom: fix writes in read-only memory region cpufreq: qcom: fix memory leak in error path cpufreq: tegra194: Fix module loading commit 9d6e681d33943e7e5b26b945e680a71311683795 Merge: ec4cf5dbb1887 3f8deab61ea86 Author: Linus Torvalds Date: Fri Oct 21 18:08:30 2022 -0700 Merge tag 'acpi-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix issues introduced during this merge window (ACPI/PCI, device enumeration and documentation) and some other ones found recently. Specifics: - Add missing device reference counting to acpi_get_pci_dev() after changing it recently (Rafael Wysocki) - Fix resource list walk in acpi_dma_get_range() (Robin Murphy) - Add IRQ override quirk for LENOVO IdeaPad and extend the IRQ override warning message (Jiri Slaby) - Fix integer overflow in ghes_estatus_pool_init() (Ashish Kalra) - Fix multiple error records handling in one of the ACPI extlog driver code paths (Tony Luck) - Prune DSDT override documentation from index after dropping it (Bagas Sanjaya)" * tag 'acpi-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: scan: Fix DMA range assignment ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() ACPI: resource: note more about IRQ override ACPI: resource: do IRQ override on LENOVO IdeaPad ACPI: extlog: Handle multiple records ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() Documentation: ACPI: Prune DSDT override documentation from index commit ec4cf5dbb1887adadba2f7cbe8131facbd27a5d5 Merge: e97eace635a42 37926f96302d8 Author: Linus Torvalds Date: Fri Oct 21 18:02:36 2022 -0700 Merge tag 'efi-fixes-for-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - fixes for the EFI variable store refactor that landed in v6.0 - fixes for issues that were introduced during the merge window - back out some changes related to EFI zboot signing - we'll add a better solution for this during the next cycle * tag 'efi-fixes-for-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: runtime: Don't assume virtual mappings are missing if VA == PA == 0 efi: libstub: Fix incorrect payload size in zboot header efi: libstub: Give efi_main() asmlinkage qualification efi: efivars: Fix variable writes without query_variable_store() efi: ssdt: Don't free memory if ACPI table was loaded successfully efi: libstub: Remove zboot signing from build options commit e97eace635a42da4644290179aea496178e64988 Merge: 334fe5d3a99ae 620bf9f981365 Author: Linus Torvalds Date: Fri Oct 21 17:47:39 2022 -0700 Merge tag 'iommu-fixes-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: "Intel VT-d fixes: - Fix a lockdep splat issue in intel_iommu_init() - Allow NVS regions to pass RMRR check - Domain cleanup in error path" * tag 'iommu-fixes-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/vt-d: Clean up si_domain in the init_dmars() error path iommu/vt-d: Allow NVS regions in arch_rmrr_sanity_check() iommu/vt-d: Use rcu_lock in get_resv_regions iommu: Add gfp parameter to iommu_alloc_resv_region commit 334fe5d3a99aea2e92b934b4c58fffee9b056c5d Merge: bd8e963412c8e e66928af3667a Author: Linus Torvalds Date: Fri Oct 21 17:41:57 2022 -0700 Merge tag 'for-linus-2022102101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Benjamin Tissoires: - a 12 year old bug fix for the Apple Magic Trackpad v1 (José Expósito) - a fix for a potential crash on removal of the Playstation controllers (Roderick Colenbrander) - a few new device IDs and device-specific quirks, most notably support of the new Playstation DualSense Edge controller * tag 'for-linus-2022102101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: lenovo: Make array tp10ubkbd_led static const HID: saitek: add madcatz variant of MMO7 mouse device ID HID: playstation: support updated DualSense rumble mode. HID: playstation: add initial DualSense Edge controller support HID: playstation: stop DualSense output work on remove. HID: magicmouse: Do not set BTN_MOUSE on double report commit 24f0692bfd41fd207d99c993a5785c3426762046 Author: Dan Williams Date: Thu Oct 20 16:54:55 2022 -0700 ACPI: NUMA: Add CXL CFMWS 'nodes' to the possible nodes set The ACPI CEDT.CFMWS indicates a range of possible address where new CXL regions can appear. Each range is associated with a QTG id (QoS Throttling Group id). For each range + QTG pair that is not covered by a proximity domain in the SRAT, Linux creates a new NUMA node. However, the commit that added the new ranges missed updating the node_possible mask which causes memory_group_register() to fail. Add the new nodes to the nodes_possible mask. Cc: Fixes: fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") Cc: Alison Schofield Cc: Rafael J. Wysocki Reported-by: Vishal Verma Tested-by: Vishal Verma Acked-by: Rafael J. Wysocki Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/166631003537.1167078.9373680312035292395.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit bd8e963412c8e676fc73ae456f311cdcabe8642d Merge: 022c028f4cfd6 73b1b8d25e39a Author: Linus Torvalds Date: Fri Oct 21 16:01:53 2022 -0700 Merge tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: - memory leak fixes - fixes for directory leases, including an important one which fixes a problem noticed by git functional tests - fixes relating to missing free_xid calls (helpful for tracing/debugging of entry/exit into cifs.ko) - a multichannel fix - a small cleanup fix (use of list_move instead of list_del/list_add) * tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module number cifs: fix memory leaks in session setup cifs: drop the lease for cached directories on rmdir or rename smb3: interface count displayed incorrectly cifs: Fix memory leak when build ntlmssp negotiate blob failed cifs: set rc to -ENOENT if we can not get a dentry for the cached dir cifs: use LIST_HEAD() and list_move() to simplify code cifs: Fix xid leak in cifs_get_file_info_unix() cifs: Fix xid leak in cifs_ses_add_channel() cifs: Fix xid leak in cifs_flock() cifs: Fix xid leak in cifs_copy_file_range() cifs: Fix xid leak in cifs_create() commit 022c028f4cfd6af728fcb9314712257a327d47e0 Merge: ed5377958cfd4 93c128e709aec Author: Linus Torvalds Date: Fri Oct 21 15:51:30 2022 -0700 Merge tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Fixes for patches merged in v6.1" * tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: ensure we always call fh_verify_error tracepoint NFSD: unregister shrinker when nfsd_init_net() fails commit 471f0aa7fa64e23766a1473b32d9ec3f0718895a Author: Chang S. Bae Date: Fri Oct 21 11:58:44 2022 -0700 x86/fpu: Fix copy_xstate_to_uabi() to copy init states correctly When an extended state component is not present in fpstate, but in init state, the function copies from init_fpstate via copy_feature(). But, dynamic states are not present in init_fpstate because of all-zeros init states. Then retrieving them from init_fpstate will explode like this: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... RIP: 0010:memcpy_erms+0x6/0x10 ? __copy_xstate_to_uabi_buf+0x381/0x870 fpu_copy_guest_fpstate_to_uabi+0x28/0x80 kvm_arch_vcpu_ioctl+0x14c/0x1460 [kvm] ? __this_cpu_preempt_check+0x13/0x20 ? vmx_vcpu_put+0x2e/0x260 [kvm_intel] kvm_vcpu_ioctl+0xea/0x6b0 [kvm] ? kvm_vcpu_ioctl+0xea/0x6b0 [kvm] ? __fget_light+0xd4/0x130 __x64_sys_ioctl+0xe3/0x910 ? debug_smp_processor_id+0x17/0x20 ? fpregs_assert_state_consistent+0x27/0x50 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Adjust the 'mask' to zero out the userspace buffer for the features that are not available both from fpstate and from init_fpstate. The dynamic features depend on the compacted XSAVE format. Ensure it is enabled before reading XCOMP_BV in init_fpstate. Fixes: 2308ee57d93d ("x86/fpu/amx: Enable the AMX feature in 64-bit mode") Reported-by: Yuan Yao Suggested-by: Dave Hansen Signed-off-by: Chang S. Bae Signed-off-by: Dave Hansen Tested-by: Yuan Yao Link: https://lore.kernel.org/lkml/BYAPR11MB3717EDEF2351C958F2C86EED95259@BYAPR11MB3717.namprd11.prod.outlook.com/ Link: https://lkml.kernel.org/r/20221021185844.13472-1-chang.seok.bae@intel.com commit ed5377958cfd43a2291f25f5e88845b90b9aee3f Merge: d4b7332eef46e dc8e483f684a2 Author: Linus Torvalds Date: Fri Oct 21 15:19:43 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Two small changes, one in the lpfc driver and the other in the core. The core change is an additional footgun guard which prevents users from writing the wrong state to sysfs and causing a hang" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: lpfc: Fix memory leak in lpfc_create_port() scsi: core: Restrict legal sdev_state transitions via sysfs commit d4b7332eef46ed403061e27b03c71ad26b2f5353 Merge: 294e73ffb0efa 2db96217e7e51 Author: Linus Torvalds Date: Fri Oct 21 15:14:14 2022 -0700 Merge tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Christoph: - fix nvme-hwmon for DMA non-cohehrent architectures (Serge Semin) - add a nvme-hwmong maintainer (Christoph Hellwig) - fix error pointer dereference in error handling (Dan Carpenter) - fix invalid memory reference in nvmet_subsys_attr_qid_max_show (Daniel Wagner) - don't limit the DMA segment size in nvme-apple (Russell King) - fix workqueue MEM_RECLAIM flushing dependency (Sagi Grimberg) - disable write zeroes on various Kingston SSDs (Xander Li) - fix a memory leak with block device tracing (Ye) - flexible-array fix for ublk (Yushan) - document the ublk recovery feature from this merge window (ZiyangZhang) - remove dead bfq variable in struct (Yuwei) - error handling rq clearing fix (Yu) - add an IRQ safety check for the cached bio freeing (Pavel) - drbd bio cloning fix (Christoph) * tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux: blktrace: remove unnessary stop block trace in 'blk_trace_shutdown' blktrace: fix possible memleak in '__blk_trace_remove' blktrace: introduce 'blk_trace_{start,stop}' helper bio: safeguard REQ_ALLOC_CACHE bio put block, bfq: remove unused variable for bfq_queue drbd: only clone bio if we have a backing device ublk_drv: use flexible-array member instead of zero-length array nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show nvmet: fix workqueue MEM_RECLAIM flushing dependency nvme-hwmon: kmalloc the NVME SMART log buffer nvme-hwmon: consistently ignore errors from nvme_hwmon_init nvme: add Guenther as nvme-hwmon maintainer nvme-apple: don't limit DMA segement size nvme-pci: disable write zeroes on various Kingston SSD nvme: fix error pointer dereference in error handling Documentation: document ublk user recovery feature blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping() commit 294e73ffb0efac4c8bac2d9e6a896225098bd419 Merge: 1d61754caa8c6 996d3efeb091c Author: Linus Torvalds Date: Fri Oct 21 15:09:10 2022 -0700 Merge tag 'io_uring-6.1-2022-10-20' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: - Fix a potential memory leak in the error handling path of io-wq setup (Rafael) - Kill an errant debug statement that got added in this release (me) - Fix an oops with an invalid direct descriptor with IORING_OP_MSG_RING (Harshit) - Remove unneeded FFS_SCM flagging (Pavel) - Remove polling off the exit path (Pavel) - Move out direct descriptor debug check to the cleanup path (Pavel) - Use the proper helper rather than open-coding cached request get (Pavel) * tag 'io_uring-6.1-2022-10-20' of git://git.kernel.dk/linux: io-wq: Fix memory leak in worker creation io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd() io_uring/rw: remove leftover debug statement io_uring: don't iopoll from io_ring_ctx_wait_and_kill() io_uring: reuse io_alloc_req() io_uring: kill hot path fixed file bitmap debug checks io_uring: remove FFS_SCM commit 1d61754caa8c69f566504e63c8b3f3a2df0954c8 Merge: 0de0b76837c2e a383dcb1cca83 Author: Linus Torvalds Date: Fri Oct 21 14:43:09 2022 -0700 Merge tag 'for-linus-6.1-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Just two fixes for the new 'virtio with grants' feature" * tag 'for-linus-6.1-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/virtio: Convert PAGE_SIZE/PAGE_SHIFT/PFN_UP to Xen counterparts xen/virtio: Handle cases when page offset > PAGE_SIZE properly commit 0de0b76837c2e958ad0e8fa9abd9846843fbf3f8 Merge: 440b7895c990a abe3c631447dc Author: Linus Torvalds Date: Fri Oct 21 14:33:36 2022 -0700 Merge tag 'selinux-pr-20221020' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux fix from Paul Moore: "A small SELinux fix for a GFP_KERNEL allocation while a spinlock is held. The patch, while still fairly small, is a bit larger than one might expect from a simple s/GFP_KERNEL/GFP_ATOMIC/ conversion because we added support for the function to be called with different gfp flags depending on the context, preserving GFP_KERNEL for those cases that can safely sleep" * tag 'selinux-pr-20221020' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: enable use of both GFP_KERNEL and GFP_ATOMIC in convert_context() commit 226dcfad349f23f7744d02b24f8ec3bc4f6198ac Author: Yiqing Yao Date: Tue Oct 18 15:17:59 2022 +0800 drm/amdgpu: Adjust MES polling timeout for sriov [why] MES response time in sriov may be longer than default value due to reset or init in other VF. A timeout value specific to sriov is needed. [how] When in sriov, adjust the timeout value to calculated worst case scenario. Signed-off-by: Yiqing Yao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 09aef0258a327409bb2279a5ba8f82ad2ca099ca Author: Kenneth Feng Date: Wed Oct 19 11:24:05 2022 +0800 drm/amd/pm: update driver-if header for smu_v13_0_10 update driver-if header for smu_v13_0_10 and merge with smu_v13_0_0 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 79610d3041338dc1ef554d6fd8b3b3e23be527f5 Author: Chengming Gui Date: Tue Oct 18 17:31:38 2022 +0800 drm/amdgpu: fix pstate setting issue [WHY] 0, original pstate X 1, ctx_A_create -> ctx_A->stable_pstate = X 2, ctx_A_set_pstate (Y) -> current pstate is Y (PEAK or STANDARD) 3, ctx_B_create -> ctx_B->stable_pstate = Y 4, ctx_A_destroy -> restore pstate to X 5, ctx_B_destroy -> restore pstate to Y Above sequence will cause final pstate is wrong (Y), should be original X. [HOW] When ctx_B create, if ctx_A touched pstate setting (not auto, stable_pstate_ctx != NULL), set ctx_B->stable_pstate the same value as ctx_A saved, if stable_pstate_ctx == NULL, fetch current pstate to fill ctx_B->stable_pstate. Signed-off-by: Chengming Gui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 440b7895c990a63869a9d55e5c2502dd501a124e Merge: ce3d90a877760 97061d4411105 Author: Linus Torvalds Date: Fri Oct 21 12:33:03 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morron: "Seventeen hotfixes, mainly for MM. Five are cc:stable and the remainder address post-6.0 issues" * tag 'mm-hotfixes-stable-2022-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: nouveau: fix migrate_to_ram() for faulting page mm/huge_memory: do not clobber swp_entry_t during THP split hugetlb: fix memory leak associated with vma_lock structure mm/page_alloc: reduce potential fragmentation in make_alloc_exact() mm: /proc/pid/smaps_rollup: fix maple tree search mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages mm/mmap: fix MAP_FIXED address return on VMA merge mm/mmap.c: __vma_adjust(): suppress uninitialized var warning mm/mmap: undo ->mmap() when mas_preallocate() fails init: Kconfig: fix spelling mistake "satify" -> "satisfy" ocfs2: clear dinode links count in case of error ocfs2: fix BUG when iput after ocfs2_mknod fails gcov: support GCC 12.1 and newer compilers zsmalloc: zs_destroy_pool: add size_class NULL check mm/mempolicy: fix mbind_range() arguments to vma_merge() mailmap: update email for Qais Yousef mailmap: update Dan Carpenter's email address commit ce3d90a87776053ec367c0eb083d389e9979c7e9 Merge: 4f1e0c18bc832 21a1994b6492b Author: Linus Torvalds Date: Fri Oct 21 12:29:52 2022 -0700 Merge tag 'trace-tools-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing tool update from Steven Rostedt: - Make dot2c generate monitor's automata definition static * tag 'trace-tools-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: rv/dot2c: Make automaton definition static commit 4f1e0c18bc8324ae05646c34759fd8dbe87f6582 Merge: e35184f321518 e25b091bed494 Author: Linus Torvalds Date: Fri Oct 21 12:25:39 2022 -0700 Merge tag 'linux-watchdog-6.1-rc2' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - Add tracing events for the most common watchdog events * tag 'linux-watchdog-6.1-rc2' of git://www.linux-watchdog.org/linux-watchdog: watchdog: Add tracing events for the most usual watchdog events commit 3f8deab61ea86d738a1e7fdf95e9ad2bf08d14b8 Merge: eb1d39260ee64 64d23ff38ac9e 4ef96d4dc8e1c 43d2748394c3f f6ec01da40e41 83439a0f1ce6a Author: Rafael J. Wysocki Date: Fri Oct 21 20:07:41 2022 +0200 Merge branches 'acpi-scan', 'acpi-resource', 'acpi-apei', 'acpi-extlog' and 'acpi-docs' Merge assorted ACPI fixes for 6.1-rc2: - Fix resource list walk in acpi_dma_get_range() (Robin Murphy). - Add IRQ override quirk for LENOVO IdeaPad and extend the IRQ override warning message (Jiri Slaby). - Fix integer overflow in ghes_estatus_pool_init() (Ashish Kalra). - Fix multiple error records handling in one of the ACPI extlog driver code paths (Tony Luck). - Prune DSDT override documentation from index after dropping it (Bagas Sanjaya). * acpi-scan: ACPI: scan: Fix DMA range assignment * acpi-resource: ACPI: resource: note more about IRQ override ACPI: resource: do IRQ override on LENOVO IdeaPad * acpi-apei: ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() * acpi-extlog: ACPI: extlog: Handle multiple records * acpi-docs: Documentation: ACPI: Prune DSDT override documentation from index commit cb8e30ddb7e345867f6f2da8a08291d7d9e037db Author: Douglas Anderson Date: Mon Oct 17 12:18:51 2022 -0700 drm/bridge: ps8640: Add back the 50 ms mystery delay after HPD Back in commit 826cff3f7ebb ("drm/bridge: parade-ps8640: Enable runtime power management") we removed a mysterious 50 ms delay because "Parade's support [couldn't] explain what the delay [was] for". While I'm always a fan of removing mysterious delays, I suspect that we need this mysterious delay to avoid some problems. Specifically, what I found recently is that on sc7180-trogdor-homestar sometimes the AUX backlight wasn't initializing properly. Some debugging showed that the drm_dp_dpcd_read() function that the AUX backlight driver was calling was returning bogus data about 1% of the time when I booted up. This confused drm_panel_dp_aux_backlight(). From continued debugging: - If I retried the read then the read worked just fine. - If I added a loop to perform the same read that drm_panel_dp_aux_backlight() was doing 30 times at bootup I could see that some percentage of the time the first read would give bogus data but all 29 additional reads would always be fine. - If I added a large delay _after_ powering on the panel but before powering on PS8640 I could still reproduce the problem. - If I added a delay after PS8640 powered on then I couldn't reproduce the problem. - I couldn't reproduce the problem on a board with the same panel but the ti-sn65dsi86 bridge chip. To me, the above indicated that there was a problem with PS8640 and not the panel. I don't really have any insight into what's going on in the MCU, but my best guess is that when the MCU itself sees the HPD go high that it does some AUX transfers itself and this is confusing things. Let's go back and add back in the mysterious 50 ms delay. We only want to do this the first time we see HPD go high after booting the MCU, not every time we double-check HPD. With this, the backlight initializes reliably on homestar. Fixes: 826cff3f7ebb ("drm/bridge: parade-ps8640: Enable runtime power management") Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20221017121813.1.I59700c745fbc31559a5d5c8e2a960279c751dbd5@changeid commit 230db82413c091bc16acee72650f48d419cebe49 Author: Chen Zhongjin Date: Wed Jul 27 11:15:06 2022 +0800 x86/unwind/orc: Fix unreliable stack dump with gcov When a console stack dump is initiated with CONFIG_GCOV_PROFILE_ALL enabled, show_trace_log_lvl() gets out of sync with the ORC unwinder, causing the stack trace to show all text addresses as unreliable: # echo l > /proc/sysrq-trigger [ 477.521031] sysrq: Show backtrace of all active CPUs [ 477.523813] NMI backtrace for cpu 0 [ 477.524492] CPU: 0 PID: 1021 Comm: bash Not tainted 6.0.0 #65 [ 477.525295] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014 [ 477.526439] Call Trace: [ 477.526854] [ 477.527216] ? dump_stack_lvl+0xc7/0x114 [ 477.527801] ? dump_stack+0x13/0x1f [ 477.528331] ? nmi_cpu_backtrace.cold+0xb5/0x10d [ 477.528998] ? lapic_can_unplug_cpu+0xa0/0xa0 [ 477.529641] ? nmi_trigger_cpumask_backtrace+0x16a/0x1f0 [ 477.530393] ? arch_trigger_cpumask_backtrace+0x1d/0x30 [ 477.531136] ? sysrq_handle_showallcpus+0x1b/0x30 [ 477.531818] ? __handle_sysrq.cold+0x4e/0x1ae [ 477.532451] ? write_sysrq_trigger+0x63/0x80 [ 477.533080] ? proc_reg_write+0x92/0x110 [ 477.533663] ? vfs_write+0x174/0x530 [ 477.534265] ? handle_mm_fault+0x16f/0x500 [ 477.534940] ? ksys_write+0x7b/0x170 [ 477.535543] ? __x64_sys_write+0x1d/0x30 [ 477.536191] ? do_syscall_64+0x6b/0x100 [ 477.536809] ? entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 477.537609] This happens when the compiled code for show_stack() has a single word on the stack, and doesn't use a tail call to show_stack_log_lvl(). (CONFIG_GCOV_PROFILE_ALL=y is the only known case of this.) Then the __unwind_start() skip logic hits an off-by-one bug and fails to unwind all the way to the intended starting frame. Fix it by reverting the following commit: f1d9a2abff66 ("x86/unwind/orc: Don't skip the first frame for inactive tasks") The original justification for that commit no longer exists. That original issue was later fixed in a different way, with the following commit: f2ac57a4c49d ("x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels") Fixes: f1d9a2abff66 ("x86/unwind/orc: Don't skip the first frame for inactive tasks") Signed-off-by: Chen Zhongjin [jpoimboe: rewrite commit log] Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra commit 794814529384721ce8f4d34228dc599cc010353d Author: Takashi Iwai Date: Fri Oct 21 14:27:22 2022 +0200 ALSA: usb-audio: Add quirks for M-Audio Fast Track C400/600 M-Audio Fast Track C400 and C600 devices (0763:2030 and 0763:2031, respectively) seem requiring the explicit setup for the implicit feedback mode. This patch adds the quirk entries for those. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214817 Cc: Link: https://lore.kernel.org/r/20221021122722.24784-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4d814b329a4d54cd10eee4bd2ce5a8175646cc16 Author: Jakub Kicinski Date: Wed Oct 19 19:19:13 2022 -0700 MAINTAINERS: add keyword match on PTP Most of PTP drivers live under ethernet and we have to keep telling people to CC the PTP maintainers. Let's try a keyword match, we can refine as we go if it causes false positives. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 46cdedf2a0fa20a99ca8be40bccde7487e13b77a Author: Jakub Kicinski Date: Wed Oct 19 15:35:51 2022 -0700 ethtool: pse-pd: fix null-deref on genl_info in dump ethnl_default_dump_one() passes NULL as info. It's correct not to set extack during dump, as we should just silently skip interfaces which can't provide the information. Reported-by: syzbot+81c4b4bbba6eea2cfcae@syzkaller.appspotmail.com Fixes: 18ff0bcda6d1 ("ethtool: add interface to interact with Ethernet Power Equipment") Signed-off-by: Jakub Kicinski Reviewed-by: Oleksij Rempel Signed-off-by: David S. Miller commit e9441675edc1bb8dbfadacf68aafacca60d65a25 Author: Yang Yingliang Date: Thu Oct 20 19:01:57 2022 +0800 ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init() If snd_hdac_device_register() fails, 'codec' and name allocated in dev_set_name() called in snd_hdac_device_init() are leaked. Fix this by calling put_device(), so they can be freed in snd_hda_codec_dev_release() and kobject_cleanup(). Fixes: 829c67319806 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines") Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus") Signed-off-by: Yang Yingliang Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20221020110157.1450191-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit a75481fa00cc06a8763e1795b93140407948c03a Author: Leohearts Date: Fri Oct 21 14:34:32 2022 +0800 ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table Lenovo Thinkbook 14+ 2022 (ThinkBook 14 G4+ ARA) uses Ryzen 6000 processor, and has the same microphone problem as other ThinkPads with AMD Ryzen 6000 series CPUs, which has been listed in https://bugzilla.kernel.org/show_bug.cgi?id=216267. Adding 21D0 to quirks table solves this microphone problem for ThinkBook 14 G4+ ARA. Signed-off-by: Taroe Leohearts Link: https://lore.kernel.org/r/26B141B486BEF706+313d1732-e00c-ea41-3123-0d048d40ebb6@leohearts.com Signed-off-by: Mark Brown commit 0e213813df02da048ffd22a2c4fac041768ca327 Author: Yang Yingliang Date: Thu Oct 20 18:59:37 2022 +0800 ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init() If snd_hdac_device_register() fails, 'codec' and name allocated in dev_set_name() called in snd_hdac_device_init() are leaked. Fix this by calling put_device(), so they can be freed in snd_hda_codec_dev_release() and kobject_cleanup(). Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines") Signed-off-by: Yang Yingliang Suggested-by: Cezary Rojewski Link: https://lore.kernel.org/r/20221020105937.1448951-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 9f6035af06b526e678808d492fc0830aef6cfbd8 Author: Nathan Huckleberry Date: Tue Oct 18 16:04:12 2022 -0700 crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned crypto_tfm::__crt_ctx is not guaranteed to be 16-byte aligned on x86-64. This causes crashes due to movaps instructions in clmul_polyval_update. Add logic to align polyval_tfm_ctx to 16 bytes. Cc: Fixes: 34f7f6c30112 ("crypto: x86/polyval - Add PCLMULQDQ accelerated implementation of POLYVAL") Reported-by: Bruno Goncalves Signed-off-by: Nathan Huckleberry Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu commit 69188df5f6e4cecc6b76b958979ba363cd5240e8 Author: Jonas Jelonek Date: Fri Oct 14 16:54:39 2022 +0200 wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support Fixes a warning that occurs when rc table support is enabled (IEEE80211_HW_SUPPORTS_RC_TABLE) in mac80211_hwsim and the PS mode is changed via the exported debugfs attribute. When the PS mode is changed, a packet is broadcasted via hwsim_send_nullfunc by creating and transmitting a plain skb with only header initialized. The ieee80211 rate array in the control buffer is zero-initialized. When ratetbl support is enabled, ieee80211_get_tx_rates is called for the skb with sta parameter set to NULL and thus no ratetbl can be used. The final rate array then looks like [-1,0; 0,0; 0,0; 0,0] which causes the warning in ieee80211_get_tx_rate. The issue is fixed by setting the count of the first rate with idx '0' to 1 and hence ieee80211_get_tx_rates won't overwrite it with idx '-1'. Signed-off-by: Jonas Jelonek Signed-off-by: Johannes Berg commit 18429c51c7ff6e6bfd627316c54670230967a7e5 Author: Paul Zhang Date: Tue Oct 11 21:04:28 2022 +0800 wifi: cfg80211: Fix bitrates overflow issue When invoking function cfg80211_calculate_bitrate_eht about (320 MHz, EHT-MCS 13, EHT-NSS 2, EHT-GI 0), which means the parameters as flags: 0x80, bw: 7, mcs: 13, eht_gi: 0, nss: 2, this formula (result * rate->nss) will overflow and causes the returned bitrate to be 3959 when it should be 57646. Here is the explanation: u64 tmp; u32 result; … /* tmp = result = 4 * rates_996[0] * = 4 * 480388888 = 0x72889c60 */ tmp = result; /* tmp = 0x72889c60 * 6144 = 0xabccea90000 */ tmp *= SCALE; /* tmp = 0xabccea90000 / mcs_divisors[13] * = 0xabccea90000 / 5120 = 0x8970bba6 */ do_div(tmp, mcs_divisors[rate->mcs]); /* result = 0x8970bba6 */ result = tmp; /* normally (result * rate->nss) = 0x8970bba6 * 2 = 0x112e1774c, * but since result is u32, (result * rate->nss) = 0x12e1774c, * overflow happens and it loses the highest bit. * Then result = 0x12e1774c / 8 = 39595753, */ result = (result * rate->nss) / 8; Signed-off-by: Paul Zhang Signed-off-by: Johannes Berg commit 57b962e627ec0ae53d4d16d7bd1033e27e67677a Author: Arend van Spriel Date: Thu Oct 20 13:40:40 2022 +0200 wifi: cfg80211: fix memory leak in query_regdb_file() In the function query_regdb_file() the alpha2 parameter is duplicated using kmemdup() and subsequently freed in regdb_fw_cb(). However, request_firmware_nowait() can fail without calling regdb_fw_cb() and thus leak memory. Fixes: 007f6c5e6eb4 ("cfg80211: support loading regulatory database as firmware file") Signed-off-by: Arend van Spriel Signed-off-by: Johannes Berg commit 50b2e8711462409cd368c41067405aa446dfa2af Author: taozhang Date: Sat Oct 15 17:38:31 2022 +0800 wifi: mac80211: fix memory free error when registering wiphy fail ieee80211_register_hw free the allocated cipher suites when registering wiphy fail, and ieee80211_free_hw will re-free it. set wiphy_ciphers_allocated to false after freeing allocated cipher suites. Signed-off-by: taozhang Signed-off-by: Johannes Berg commit 03c0ad4b06c3566de624b4f4b78ac1a5d1e4c8e7 Author: Johannes Berg Date: Thu Oct 13 19:41:51 2022 +0200 wifi: cfg80211: silence a sparse RCU warning All we're going to do with this pointer is assign it to another __rcu pointer, but sparse can't see that, so use rcu_access_pointer() to silence the warning here. Fixes: c90b93b5b782 ("wifi: cfg80211: update hidden BSSes to avoid WARN_ON") Signed-off-by: Johannes Berg commit 37926f96302d8b6c2bc97990d33e316a3ed6d67f Author: Ard Biesheuvel Date: Thu Oct 20 15:16:09 2022 +0200 efi: runtime: Don't assume virtual mappings are missing if VA == PA == 0 The generic EFI stub can be instructed to avoid SetVirtualAddressMap(), and simply run with the firmware's 1:1 mapping. In this case, it populates the virtual address fields of the runtime regions in the memory map with the physical address of each region, so that the mapping code has to be none the wiser. Only if SetVirtualAddressMap() fails, the virtual addresses are wiped and the kernel code knows that the regions cannot be mapped. However, wiping amounts to setting it to zero, and if a runtime region happens to live at physical address 0, its valid 1:1 mapped virtual address could be mistaken for a wiped field, resulting on loss of access to the EFI services at runtime. So let's only assume that VA == 0 means 'no runtime services' if the region in question does not live at PA 0x0. Signed-off-by: Ard Biesheuvel commit 53a7ea284de9eabc0e3b7dee54c2cb670b8e087a Author: Ard Biesheuvel Date: Thu Oct 20 11:26:42 2022 +0200 efi: libstub: Fix incorrect payload size in zboot header The linker script symbol definition that captures the size of the compressed payload inside the zboot decompressor (which is exposed via the image header) refers to '.' for the end of the region, which does not give the correct result as the expression is not placed at the end of the payload. So use the symbol name explicitly. Signed-off-by: Ard Biesheuvel commit db14655ad7854b69a2efda348e30d02dbc19e8a1 Author: Ard Biesheuvel Date: Fri Oct 14 19:29:57 2022 +0200 efi: libstub: Give efi_main() asmlinkage qualification To stop the bots from sending sparse warnings to me and the list about efi_main() not having a prototype, decorate it with asmlinkage so that it is clear that it is called from assembly, and therefore needs to remain external, even if it is never declared in a header file. Signed-off-by: Ard Biesheuvel commit 8a254d90a77580244ec57e82bca7eb65656cc167 Author: Ard Biesheuvel Date: Wed Oct 19 23:29:58 2022 +0200 efi: efivars: Fix variable writes without query_variable_store() Commit bbc6d2c6ef22 ("efi: vars: Switch to new wrapper layer") refactored the efivars layer so that the 'business logic' related to which UEFI variables affect the boot flow in which way could be moved out of it, and into the efivarfs driver. This inadvertently broke setting variables on firmware implementations that lack the QueryVariableInfo() boot service, because we no longer tolerate a EFI_UNSUPPORTED result from check_var_size() when calling efivar_entry_set_get_size(), which now ends up calling check_var_size() a second time inadvertently. If QueryVariableInfo() is missing, we support writes of up to 64k - let's move that logic into check_var_size(), and drop the redundant call. Cc: # v6.0 Fixes: bbc6d2c6ef22 ("efi: vars: Switch to new wrapper layer") Signed-off-by: Ard Biesheuvel commit 4b017e59f01097f19b938f6dc4dc2c4720701610 Author: Ard Biesheuvel Date: Fri Oct 14 12:25:52 2022 +0200 efi: ssdt: Don't free memory if ACPI table was loaded successfully Amadeusz reports KASAN use-after-free errors introduced by commit 3881ee0b1edc ("efi: avoid efivars layer when loading SSDTs from variables"). The problem appears to be that the memory that holds the new ACPI table is now freed unconditionally, instead of only when the ACPI core reported a failure to load the table. So let's fix this, by omitting the kfree() on success. Cc: # v6.0 Link: https://lore.kernel.org/all/a101a10a-4fbb-5fae-2e3c-76cf96ed8fbd@linux.intel.com/ Fixes: 3881ee0b1edc ("efi: avoid efivars layer when loading SSDTs from variables") Reported-by: Amadeusz Sławiński Signed-off-by: Ard Biesheuvel commit f57fb375a203e28bf7c08ca01d5ee72028b391d9 Author: Ard Biesheuvel Date: Mon Oct 17 12:48:46 2022 +0200 efi: libstub: Remove zboot signing from build options The zboot decompressor series introduced a feature to sign the PE/COFF kernel image for secure boot as part of the kernel build. This was necessary because there are actually two images that need to be signed: the kernel with the EFI stub attached, and the decompressor application. This is a bit of a burden, because it means that the images must be signed on the the same system that performs the build, and this is not realistic for distros. During the next cycle, we will introduce changes to the zboot code so that the inner image no longer needs to be signed. This means that the outer PE/COFF image can be handled as usual, and be signed later in the release process. Let's remove the associated Kconfig options now so that they don't end up in a LTS release while already being deprecated. Signed-off-by: Ard Biesheuvel commit 620bf9f981365c18cc2766c53d92bf8131c63f32 Author: Jerry Snitselaar Date: Wed Oct 19 08:44:47 2022 +0800 iommu/vt-d: Clean up si_domain in the init_dmars() error path A splat from kmem_cache_destroy() was seen with a kernel prior to commit ee2653bbe89d ("iommu/vt-d: Remove domain and devinfo mempool") when there was a failure in init_dmars(), because the iommu_domain cache still had objects. While the mempool code is now gone, there still is a leak of the si_domain memory if init_dmars() fails. So clean up si_domain in the init_dmars() error path. Cc: Lu Baolu Cc: Joerg Roedel Cc: Will Deacon Cc: Robin Murphy Fixes: 86080ccc223a ("iommu/vt-d: Allocate si_domain in init_dmars()") Signed-off-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20221010144842.308890-1-jsnitsel@redhat.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 5566e68d829f5d87670d5984c1c2ccb4c518405f Author: Charlotte Tan Date: Wed Oct 19 08:44:46 2022 +0800 iommu/vt-d: Allow NVS regions in arch_rmrr_sanity_check() arch_rmrr_sanity_check() warns if the RMRR is not covered by an ACPI Reserved region, but it seems like it should accept an NVS region as well. The ACPI spec https://uefi.org/specs/ACPI/6.5/15_System_Address_Map_Interfaces.html uses similar wording for "Reserved" and "NVS" region types; for NVS regions it says "This range of addresses is in use or reserved by the system and must not be used by the operating system." There is an old comment on this mailing list that also suggests NVS regions should pass the arch_rmrr_sanity_check() test: The warnings come from arch_rmrr_sanity_check() since it checks whether the region is E820_TYPE_RESERVED. However, if the purpose of the check is to detect RMRR has regions that may be used by OS as free memory, isn't E820_TYPE_NVS safe, too? This patch overlaps with another proposed patch that would add the region type to the log since sometimes the bug reporter sees this log on the console but doesn't know to include the kernel log: https://lore.kernel.org/lkml/20220611204859.234975-3-atomlin@redhat.com/ Here's an example of the "Firmware Bug" apparent false positive (wrapped for line length): DMAR: [Firmware Bug]: No firmware reserved region can cover this RMRR [0x000000006f760000-0x000000006f762fff], contact BIOS vendor for fixes DMAR: [Firmware Bug]: Your BIOS is broken; bad RMRR [0x000000006f760000-0x000000006f762fff] This is the snippet from the e820 table: BIOS-e820: [mem 0x0000000068bff000-0x000000006ebfefff] reserved BIOS-e820: [mem 0x000000006ebff000-0x000000006f9fefff] ACPI NVS BIOS-e820: [mem 0x000000006f9ff000-0x000000006fffefff] ACPI data Fixes: f036c7fa0ab6 ("iommu/vt-d: Check VT-d RMRR region in BIOS is reported as reserved") Cc: Will Mortensen Link: https://lore.kernel.org/linux-iommu/64a5843d-850d-e58c-4fc2-0a0eeeb656dc@nec.com/ Link: https://bugzilla.kernel.org/show_bug.cgi?id=216443 Signed-off-by: Charlotte Tan Reviewed-by: Aaron Tomlin Link: https://lore.kernel.org/r/20220929044449.32515-1-charlotte@extrahop.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit bf638a6513dda3021e3e90bdacb71c606bd0c305 Author: Lu Baolu Date: Wed Oct 19 08:44:45 2022 +0800 iommu/vt-d: Use rcu_lock in get_resv_regions Commit 5f64ce5411b46 ("iommu/vt-d: Duplicate iommu_resv_region objects per device list") converted rcu_lock in get_resv_regions to dmar_global_lock to allow sleeping in iommu_alloc_resv_region(). This introduced possible recursive locking if get_resv_regions is called from within a section where intel_iommu_init() already holds dmar_global_lock. Especially, after commit 57365a04c921 ("iommu: Move bus setup to IOMMU device registration"), below lockdep splats could always be seen. ============================================ WARNING: possible recursive locking detected 6.0.0-rc4+ #325 Tainted: G I -------------------------------------------- swapper/0/1 is trying to acquire lock: ffffffffa8a18c90 (dmar_global_lock){++++}-{3:3}, at: intel_iommu_get_resv_regions+0x25/0x270 but task is already holding lock: ffffffffa8a18c90 (dmar_global_lock){++++}-{3:3}, at: intel_iommu_init+0x36d/0x6ea ... Call Trace: dump_stack_lvl+0x48/0x5f __lock_acquire.cold.73+0xad/0x2bb lock_acquire+0xc2/0x2e0 ? intel_iommu_get_resv_regions+0x25/0x270 ? lock_is_held_type+0x9d/0x110 down_read+0x42/0x150 ? intel_iommu_get_resv_regions+0x25/0x270 intel_iommu_get_resv_regions+0x25/0x270 iommu_create_device_direct_mappings.isra.28+0x8d/0x1c0 ? iommu_get_dma_cookie+0x6d/0x90 bus_iommu_probe+0x19f/0x2e0 iommu_device_register+0xd4/0x130 intel_iommu_init+0x3e1/0x6ea ? iommu_setup+0x289/0x289 ? rdinit_setup+0x34/0x34 pci_iommu_init+0x12/0x3a do_one_initcall+0x65/0x320 ? rdinit_setup+0x34/0x34 ? rcu_read_lock_sched_held+0x5a/0x80 kernel_init_freeable+0x28a/0x2f3 ? rest_init+0x1b0/0x1b0 kernel_init+0x1a/0x130 ret_from_fork+0x1f/0x30 This rolls back dmar_global_lock to rcu_lock in get_resv_regions to avoid the lockdep splat. Fixes: 57365a04c921 ("iommu: Move bus setup to IOMMU device registration") Signed-off-by: Lu Baolu Tested-by: Alex Williamson Link: https://lore.kernel.org/r/20220927053109.4053662-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 0251d0107cfb0bb5ab2d3f97710487b9522db020 Author: Lu Baolu Date: Wed Oct 19 08:44:44 2022 +0800 iommu: Add gfp parameter to iommu_alloc_resv_region Add gfp parameter to iommu_alloc_resv_region() for the callers to specify the memory allocation behavior. Thus iommu_alloc_resv_region() could also be available in critical contexts. Signed-off-by: Lu Baolu Tested-by: Alex Williamson Link: https://lore.kernel.org/r/20220927053109.4053662-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 50f19697dd768d8b072cf7f12c0c99c7d31b67d8 Author: Helge Deller Date: Fri Oct 21 09:15:20 2022 +0200 parisc: Use signed char for hardware path in pdc.h Clean up the struct for hardware_path and drop the struct device_path with a proper assignment of bc[] and mod members as signed chars. This patch prepares for the kbuild change from Jason A. Donenfeld to treat char as always unsigned. Signed-off-by: Helge Deller Cc: Jason A. Donenfeld commit 66063033f77e10b985258126a97573f84bb8d3b4 Author: Jason A. Donenfeld Date: Wed Oct 19 09:55:41 2022 -0600 wifi: rt2x00: use explicitly signed or unsigned types On some platforms, `char` is unsigned, but this driver, for the most part, assumed it was signed. In other places, it uses `char` to mean an unsigned number, but only in cases when the values are small. And in still other places, `char` is used as a boolean. Put an end to this confusion by declaring explicit types, depending on the context. Cc: Andrew Morton Cc: Andy Shevchenko Cc: Stanislaw Gruszka Cc: Helmut Schaa Cc: Kalle Valo Signed-off-by: Jason A. Donenfeld Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221019155541.3410813-1-Jason@zx2c4.com commit cea8896bd936135559253e9b23340cfa1cdf0caf Author: Anup Patel Date: Fri Oct 21 11:52:45 2022 +0530 RISC-V: KVM: Fix kvm_riscv_vcpu_timer_pending() for Sstc The kvm_riscv_vcpu_timer_pending() checks per-VCPU next_cycles and per-VCPU software injected VS timer interrupt. This function returns incorrect value when Sstc is available because the per-VCPU next_cycles are only updated by kvm_riscv_vcpu_timer_save() called from kvm_arch_vcpu_put(). As a result, when Sstc is available the VCPU does not block properly upon WFI traps. To fix the above issue, we introduce kvm_riscv_vcpu_timer_sync() which will update per-VCPU next_cycles upon every VM exit instead of kvm_riscv_vcpu_timer_save(). Fixes: 8f5cb44b1bae ("RISC-V: KVM: Support sstc extension") Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 5c20a3a9df19811051441214e7f5091cb3546db0 Author: Andrew Jones Date: Fri Oct 21 11:52:39 2022 +0530 RISC-V: Fix compilation without RISCV_ISA_ZICBOM riscv_cbom_block_size and riscv_init_cbom_blocksize() should always be available and riscv_init_cbom_blocksize() should always be invoked, even when compiling without RISCV_ISA_ZICBOM enabled. This is because disabling RISCV_ISA_ZICBOM means "don't use zicbom instructions in the kernel" not "pretend there isn't zicbom, even when there is". When zicbom is available, whether the kernel enables its use with RISCV_ISA_ZICBOM or not, KVM will offer it to guests. Ensure we can build KVM and that the block size is initialized even when compiling without RISCV_ISA_ZICBOM. Fixes: 8f7e001e0325 ("RISC-V: Clean up the Zicbom block size probing") Reported-by: kernel test robot Signed-off-by: Andrew Jones Signed-off-by: Anup Patel Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Signed-off-by: Anup Patel commit 52d256cc71f546f67037100c64eb4fa3ae5e4704 Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:26 2022 +0200 ALSA: ac97: Use snd_ctl_rename() to rename a control With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. While we are at it, check also that the new control name doesn't accidentally overwrite the available buffer space. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/adb68bfa0885ba4a2583794b828f8e20d23f67c7.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit 957ccc434c398a88a332ae92d70790c186a18a1c Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:25 2022 +0200 ALSA: ca0106: Use snd_ctl_rename() to rename a control With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/bffee980a420f9b0eee5681d2f48d34a70cec0ce.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit 36476b81b2b5db1de5adb8ced1f71b8972a9d4dd Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:24 2022 +0200 ALSA: emu10k1: Use snd_ctl_rename() to rename a control With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/38b19f019f95ee78a6e4e59d39afb9e2c3379413.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit b51c225376a684d02fb58b49cf0ce3d693b6f14b Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:23 2022 +0200 ALSA: hda/realtek: Use snd_ctl_rename() to rename a control With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/37496bd80f91f373268148f877fd735917d97287.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit 0b4f0debb34754002cee295441c9ca89ba8cdfcc Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:22 2022 +0200 ALSA: usb-audio: Use snd_ctl_rename() to rename a control With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/723877882e3a56bb42a2a2214cfc85f347d36e19.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit 966f015fe4329199cc49084ee2886cfb626b34d3 Author: Maciej S. Szmigiero Date: Thu Oct 20 22:46:21 2022 +0200 ALSA: control: add snd_ctl_rename() Add a snd_ctl_rename() function that takes care of updating the control hash entries for callers that already have the relevant struct snd_kcontrol at hand and hold the control write lock (or simply haven't registered the card yet). Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/r/4170b71117ea81357a4f7eb8410f7cde20836c70.1666296963.git.maciej.szmigiero@oracle.com Signed-off-by: Takashi Iwai commit 9e4e2ce1a78ed92ed91135e90c85f27d75388129 Author: Helge Deller Date: Fri Oct 21 08:02:31 2022 +0200 parisc/serial: Rename 8250_gsc.c to 8250_parisc.c The file name of this driver is misleading - it handles various serial ports on parisc machines, not just such on the GSC bus. Rename the file to make this clearer. Suggested-by: Mikulas Patocka Signed-off-by: Helge Deller commit e8a18e3f00f3ee8d07c17ab1ea3ad4df4a3b6fe0 Author: Helge Deller Date: Fri Oct 21 07:44:49 2022 +0200 parisc: Make 8250_gsc driver dependend on CONFIG_PARISC Although the name of the driver 8250_gsc.c suggests that it handles only serial ports on the GSC bus, it does handle serial ports listed in the parisc machine inventory as well, e.g. the serial ports in a C8000 PCI-only workstation. Change the dependency to CONFIG_PARISC, so that the driver gets included in the kernel even if CONFIG_GSC isn't set. Reported-by: Mikulas Patocka Cc: Signed-off-by: Helge Deller commit 65d78b8d0405fcda02b69fd3c34327e4af5cd465 Author: Adam Borowski Date: Mon Oct 10 20:33:51 2022 +0200 i2c: mlxbf: depend on ACPI; clean away ifdeffage This fixes maybe_unused warnings/errors. According to a comment during device tree removal, only ACPI is supported, thus let's actually require it. Fixes: be18c5ede25d ("i2c: mlxbf: remove device tree support") Signed-off-by: Adam Borowski Signed-off-by: Wolfram Sang commit cc67482c9e5f2c80d62f623bcc347c29f9f648e1 Author: Hyunwoo Kim Date: Thu Oct 20 18:15:44 2022 -0700 fbdev: smscufx: Fix several use-after-free bugs Several types of UAFs can occur when physically removing a USB device. Adds ufx_ops_destroy() function to .fb_destroy of fb_ops, and in this function, there is kref_put() that finally calls ufx_free(). This fix prevents multiple UAFs. Signed-off-by: Hyunwoo Kim Link: https://lore.kernel.org/linux-fbdev/20221011153436.GA4446@ubuntu/ Cc: Signed-off-by: Helge Deller commit 97061d441110528dc02972818f2f1dad485107f9 Author: Alistair Popple Date: Wed Oct 19 23:29:34 2022 +1100 nouveau: fix migrate_to_ram() for faulting page Commit 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") changed the migrate_to_ram() callback to take a reference on the device page to ensure it can't be freed while handling the fault. Unfortunately the corresponding update to Nouveau to accommodate this change was inadvertently dropped from that patch causing GPU to CPU migration to fail so add it here. Link: https://lkml.kernel.org/r/20221019122934.866205-1-apopple@nvidia.com Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") Signed-off-by: Alistair Popple Cc: John Hubbard Cc: Ralph Campbell Cc: Lyude Paul Cc: Ben Skeggs Signed-off-by: Andrew Morton commit 71e2d666ef85d51834d658830f823560c402b8b6 Author: Mel Gorman Date: Wed Oct 19 14:41:56 2022 +0100 mm/huge_memory: do not clobber swp_entry_t during THP split The following has been observed when running stressng mmap since commit b653db77350c ("mm: Clear page->private when splitting or migrating a page") watchdog: BUG: soft lockup - CPU#75 stuck for 26s! [stress-ng:9546] CPU: 75 PID: 9546 Comm: stress-ng Tainted: G E 6.0.0-revert-b653db77-fix+ #29 0357d79b60fb09775f678e4f3f64ef0579ad1374 Hardware name: SGI.COM C2112-4GP3/X10DRT-P-Series, BIOS 2.0a 05/09/2016 RIP: 0010:xas_descend+0x28/0x80 Code: cc cc 0f b6 0e 48 8b 57 08 48 d3 ea 83 e2 3f 89 d0 48 83 c0 04 48 8b 44 c6 08 48 89 77 18 48 89 c1 83 e1 03 48 83 f9 02 75 08 <48> 3d fd 00 00 00 76 08 88 57 12 c3 cc cc cc cc 48 c1 e8 02 89 c2 RSP: 0018:ffffbbf02a2236a8 EFLAGS: 00000246 RAX: ffff9cab7d6a0002 RBX: ffffe04b0af88040 RCX: 0000000000000002 RDX: 0000000000000030 RSI: ffff9cab60509b60 RDI: ffffbbf02a2236c0 RBP: 0000000000000000 R08: ffff9cab60509b60 R09: ffffbbf02a2236c0 R10: 0000000000000001 R11: ffffbbf02a223698 R12: 0000000000000000 R13: ffff9cab4e28da80 R14: 0000000000039c01 R15: ffff9cab4e28da88 FS: 00007fab89b85e40(0000) GS:ffff9cea3fcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fab84e00000 CR3: 00000040b73a4003 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: xas_load+0x3a/0x50 __filemap_get_folio+0x80/0x370 ? put_swap_page+0x163/0x360 pagecache_get_page+0x13/0x90 __try_to_reclaim_swap+0x50/0x190 scan_swap_map_slots+0x31e/0x670 get_swap_pages+0x226/0x3c0 folio_alloc_swap+0x1cc/0x240 add_to_swap+0x14/0x70 shrink_page_list+0x968/0xbc0 reclaim_page_list+0x70/0xf0 reclaim_pages+0xdd/0x120 madvise_cold_or_pageout_pte_range+0x814/0xf30 walk_pgd_range+0x637/0xa30 __walk_page_range+0x142/0x170 walk_page_range+0x146/0x170 madvise_pageout+0xb7/0x280 ? asm_common_interrupt+0x22/0x40 madvise_vma_behavior+0x3b7/0xac0 ? find_vma+0x4a/0x70 ? find_vma+0x64/0x70 ? madvise_vma_anon_name+0x40/0x40 madvise_walk_vmas+0xa6/0x130 do_madvise+0x2f4/0x360 __x64_sys_madvise+0x26/0x30 do_syscall_64+0x5b/0x80 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0x80 ? do_syscall_64+0x67/0x80 ? common_interrupt+0x8b/0xa0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The problem can be reproduced with the mmtests config config-workload-stressng-mmap. It does not always happen and when it triggers is variable but it has happened on multiple machines. The intent of commit b653db77350c patch was to avoid the case where PG_private is clear but folio->private is not-NULL. However, THP tail pages uses page->private for "swp_entry_t if folio_test_swapcache()" as stated in the documentation for struct folio. This patch only clobbers page->private for tail pages if the head page was not in swapcache and warns once if page->private had an unexpected value. Link: https://lkml.kernel.org/r/20221019134156.zjyyn5aownakvztf@techsingularity.net Fixes: b653db77350c ("mm: Clear page->private when splitting or migrating a page") Signed-off-by: Mel Gorman Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Yang Shi Cc: Brian Foster Cc: Dan Streetman Cc: Miaohe Lin Cc: Oleksandr Natalenko Cc: Seth Jennings Cc: Vitaly Wool Cc: Signed-off-by: Andrew Morton commit 612b8a317023e1396965aacac43d80053c6e77db Author: Mike Kravetz Date: Wed Oct 19 13:19:57 2022 -0700 hugetlb: fix memory leak associated with vma_lock structure The hugetlb vma_lock structure hangs off the vm_private_data pointer of sharable hugetlb vmas. The structure is vma specific and can not be shared between vmas. At fork and various other times, vmas are duplicated via vm_area_dup(). When this happens, the pointer in the newly created vma must be cleared and the structure reallocated. Two hugetlb specific routines deal with this hugetlb_dup_vma_private and hugetlb_vm_op_open. Both routines are called for newly created vmas. hugetlb_dup_vma_private would always clear the pointer and hugetlb_vm_op_open would allocate the new vms_lock structure. This did not work in the case of this calling sequence pointed out in [1]. move_vma copy_vma new_vma = vm_area_dup(vma); new_vma->vm_ops->open(new_vma); --> new_vma has its own vma lock. is_vm_hugetlb_page(vma) clear_vma_resv_huge_pages hugetlb_dup_vma_private --> vma->vm_private_data is set to NULL When clearing hugetlb_dup_vma_private we actually leak the associated vma_lock structure. The vma_lock structure contains a pointer to the associated vma. This information can be used in hugetlb_dup_vma_private and hugetlb_vm_op_open to ensure we only clear the vm_private_data of newly created (copied) vmas. In such cases, the vma->vma_lock->vma field will not point to the vma. Update hugetlb_dup_vma_private and hugetlb_vm_op_open to not clear vm_private_data if vma->vma_lock->vma == vma. Also, log a warning if hugetlb_vm_op_open ever encounters the case where vma_lock has already been correctly allocated for the vma. [1] https://lore.kernel.org/linux-mm/5154292a-4c55-28cd-0935-82441e512fc3@huawei.com/ Link: https://lkml.kernel.org/r/20221019201957.34607-1-mike.kravetz@oracle.com Fixes: 131a79b474e9 ("hugetlb: fix vma lock handling during split vma and range unmapping") Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit df48a5f7a3bbac6a700026b554922943ecee1fb0 Author: Liam R. Howlett Date: Tue May 31 09:20:51 2022 -0400 mm/page_alloc: reduce potential fragmentation in make_alloc_exact() Try to avoid using the left over split page on the next request for a page by calling __free_pages_ok() with FPI_TO_TAIL. This increases the potential of defragmenting memory when it's used for a short period of time. Link: https://lkml.kernel.org/r/20220531185626.yvlmymbxyoe5vags@revolver Signed-off-by: Liam R. Howlett Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 08ac85521cb2e26f25b885492180815ce8eaf4b7 Author: Hugh Dickins Date: Tue Oct 18 20:18:38 2022 -0700 mm: /proc/pid/smaps_rollup: fix maple tree search /proc/pid/smaps_rollup showed 0 kB for everything: now find first vma. Link: https://lkml.kernel.org/r/3011bee7-182-97a2-1083-d5f5b688e54b@google.com Fixes: c4c84f06285e ("fs/proc/task_mmu: stop using linked list and highest_vm_end") Signed-off-by: Hugh Dickins Reviewed-by: Liam R. Howlett Cc: Alexey Dobriyan Cc: Matthew Wilcox (Oracle) Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 12df140f0bdfae5dcfc81800970dd7f6f632e00c Author: Rik van Riel Date: Mon Oct 17 20:25:05 2022 -0400 mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages The h->*_huge_pages counters are protected by the hugetlb_lock, but alloc_huge_page has a corner case where it can decrement the counter outside of the lock. This could lead to a corrupted value of h->resv_huge_pages, which we have observed on our systems. Take the hugetlb_lock before decrementing h->resv_huge_pages to avoid a potential race. Link: https://lkml.kernel.org/r/20221017202505.0e6a4fcd@imladris.surriel.com Fixes: a88c76954804 ("mm: hugetlb: fix hugepage memory leak caused by wrong reserve count") Signed-off-by: Rik van Riel Reviewed-by: Mike Kravetz Cc: Naoya Horiguchi Cc: Glen McCready Cc: Mike Kravetz Cc: Muchun Song Cc: Signed-off-by: Andrew Morton commit a57b70519d1f7c53be98478623652738e5ac70d5 Author: Liam Howlett Date: Tue Oct 18 19:17:12 2022 +0000 mm/mmap: fix MAP_FIXED address return on VMA merge mmap should return the start address of newly mapped area when successful. On a successful merge of a VMA, the return address was changed and thus was violating that expectation from userspace. This is a restoration of functionality provided by 309d08d9b3a3 (mm/mmap.c: fix mmap return value when vma is merged after call_mmap()). For completeness of fixing MAP_FIXED, implement the comments from the previous discussion to never update the address and fail if the address changes. Leaving the error as a WARN_ON() to avoid crashing the kernel. Link: https://lkml.kernel.org/r/20221018191613.4133459-1-Liam.Howlett@oracle.com Link: https://lore.kernel.org/all/Y06yk66SKxlrwwfb@lakrids/ Link: https://lore.kernel.org/all/20201203085350.22624-1-liuzixian4@huawei.com/ Fixes: 4dd1b84140c1 ("mm/mmap: use advanced maple tree API for mmap_region()") Signed-off-by: Liam R. Howlett Reported-by: Mark Rutland Cc: Liu Zixian Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 1cd916d0340d0f45b151599c24ec40b5b2fd8e4a Author: Andrew Morton Date: Tue Oct 18 13:57:37 2022 -0700 mm/mmap.c: __vma_adjust(): suppress uninitialized var warning The code is OK, but it fools gcc. mm/mmap.c:802 __vma_adjust() error: uninitialized symbol 'next_next'. Fixes: 524e00b36e8c5 ("mm: remove rb tree.") Reported-by: kernel test robot Cc: Liam R. Howlett Signed-off-by: Andrew Morton commit 5789151e48acc3fd34d2109bf2021dc4df5e33e9 Author: Mike Kravetz Date: Mon Oct 17 19:49:45 2022 -0700 mm/mmap: undo ->mmap() when mas_preallocate() fails A memory leak in hugetlb_reserve_pages was reported in [1]. The root cause was traced to an error path in mmap_region when mas_preallocate() fails. In this case, the vma is freed after a successful call to filesystem specific mmap. The hugetlbfs mmap routine may allocate data structures pointed to by m_private_data. These need to be cleaned up by the hugetlb vm_ops->close() routine. The same issue was addressed by commit deb0f6562884 ("mm/mmap: undo ->mmap() when arch_validate_flags() fails") for the arch_validate_flags() test. Go to the same close_and_free_vma label if mas_preallocate() fails. [1] https://lore.kernel.org/linux-mm/CAKXUXMxf7OiCwbxib7MwfR4M1b5+b3cNTU7n5NV9Zm4967=FPQ@mail.gmail.com/ Link: https://lkml.kernel.org/r/20221018024945.415036-1-mike.kravetz@oracle.com Fixes: d4af56c5c7c6 ("mm: start tracking VMAs with maple tree") Signed-off-by: Mike Kravetz Reported-by: Lukas Bulwahn Reviewed-by: Liam R. Howlett Cc: Andrii Nakryiko Cc: Carlos Llamas Cc: Catalin Marinas Cc: Muchun Song Signed-off-by: Andrew Morton commit eacf96d23f23e5bfd175be07048246efd0be4cc6 Author: Colin Ian King Date: Fri Oct 7 21:43:39 2022 +0100 init: Kconfig: fix spelling mistake "satify" -> "satisfy" There is a spelling mistake in a Kconfig description. Fix it. Link: https://lkml.kernel.org/r/20221007204339.2757753-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton commit 28f4821b1b53e0649706912e810c6c232fc506f9 Author: Joseph Qi Date: Mon Oct 17 21:02:27 2022 +0800 ocfs2: clear dinode links count in case of error In ocfs2_mknod(), if error occurs after dinode successfully allocated, ocfs2 i_links_count will not be 0. So even though we clear inode i_nlink before iput in error handling, it still won't wipe inode since we'll refresh inode from dinode during inode lock. So just like clear inode i_nlink, we clear ocfs2 i_links_count as well. Also do the same change for ocfs2_symlink(). Link: https://lkml.kernel.org/r/20221017130227.234480-2-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Reported-by: Yan Wang Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton commit 759a7c6126eef5635506453e9b9d55a6a3ac2084 Author: Joseph Qi Date: Mon Oct 17 21:02:26 2022 +0800 ocfs2: fix BUG when iput after ocfs2_mknod fails Commit b1529a41f777 "ocfs2: should reclaim the inode if '__ocfs2_mknod_locked' returns an error" tried to reclaim the claimed inode if __ocfs2_mknod_locked() fails later. But this introduce a race, the freed bit may be reused immediately by another thread, which will update dinode, e.g. i_generation. Then iput this inode will lead to BUG: inode->i_generation != le32_to_cpu(fe->i_generation) We could make this inode as bad, but we did want to do operations like wipe in some cases. Since the claimed inode bit can only affect that an dinode is missing and will return back after fsck, it seems not a big problem. So just leave it as is by revert the reclaim logic. Link: https://lkml.kernel.org/r/20221017130227.234480-1-joseph.qi@linux.alibaba.com Fixes: b1529a41f777 ("ocfs2: should reclaim the inode if '__ocfs2_mknod_locked' returns an error") Signed-off-by: Joseph Qi Reported-by: Yan Wang Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton commit 977ef30a7d888eeb52fb6908f99080f33e5309a8 Author: Martin Liska Date: Thu Oct 13 09:40:59 2022 +0200 gcov: support GCC 12.1 and newer compilers Starting with GCC 12.1, the created .gcda format can't be read by gcov tool. There are 2 significant changes to the .gcda file format that need to be supported: a) [gcov: Use system IO buffering] (23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05) changed that all sizes in the format are in bytes and not in words (4B) b) [gcov: make profile merging smarter] (72e0c742bd01f8e7e6dcca64042b9ad7e75979de) add a new checksum to the file header. Tested with GCC 7.5, 10.4, 12.2 and the current master. Link: https://lkml.kernel.org/r/624bda92-f307-30e9-9aaa-8cc678b2dfb2@suse.cz Signed-off-by: Martin Liska Tested-by: Peter Oberparleiter Reviewed-by: Peter Oberparleiter Cc: Signed-off-by: Andrew Morton commit 4249a05ff670e7b1aeea77f1a5451080ea86c88d Author: Alexey Romanov Date: Thu Oct 13 14:28:25 2022 +0300 zsmalloc: zs_destroy_pool: add size_class NULL check Inside the zs_destroy_pool() function, there can still be NULL size_class pointers: if when the next size_class is allocated, inside zs_create_pool() function, kzalloc will return NULL and handling the error condition, zs_create_pool() will call zs_destroy_pool(). Link: https://lkml.kernel.org/r/20221013112825.61869-1-avromanov@sberdevices.ru Fixes: f24263a5a076 ("zsmalloc: remove unnecessary size_class NULL check") Signed-off-by: Alexey Romanov Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 7329e3ebe3594b425955ab591ecea335e85842c2 Author: Liam Howlett Date: Sat Oct 15 02:12:33 2022 +0000 mm/mempolicy: fix mbind_range() arguments to vma_merge() Fuzzing produced an invalid argument to vma_merge() which was caught by the newly added verification of the number of VMAs being removed on process exit. Analyzing the failure eventually resulted in finding an issue with the search of a VMA that started at address 0, which caused an underflow and thus the loss of many VMAs being tracked in the tree. Fix the underflow by changing the search of the maple tree to use the start address directly. Link: https://lkml.kernel.org/r/20221015021135.2816178-1-Liam.Howlett@oracle.com Fixes: 66850be55e8e ("mm/mempolicy: use vma iterator & maple state instead of vma linked list") Signed-off-by: Liam R. Howlett Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210052318.5ad10912-oliver.sang@intel.com Cc: Yu Zhao Signed-off-by: Andrew Morton commit cef408e70e9b0c175a874b9d9fe6acc7e12f569f Author: Qais Yousef Date: Fri Oct 14 15:10:16 2022 +0100 mailmap: update email for Qais Yousef Update my email address for old entry and add a new entry for my contribution while working with arm to continue support that work. Link: https://lkml.kernel.org/r/20221014141016.539625-1-qyousef@layalina.io Signed-off-by: Qais Yousef Acked-by: Qais Yousef Acked-by: Qais Yousef Signed-off-by: Andrew Morton commit 5ad15f1b32f4a9cb7653b5ab1eccf285b4045007 Author: Dan Carpenter Date: Wed Oct 12 16:19:39 2022 +0300 mailmap: update Dan Carpenter's email address My time at Oracle is ending at the end of the month. Update my email address accordingly. Link: https://lkml.kernel.org/r/Y0a+6+5SHMdvUnpg@kili Signed-off-by: Dan Carpenter Cc: Joe Perches Signed-off-by: Andrew Morton commit e840d8f4a1b323973052a1af5ad4edafcde8ae3d Author: Shang XiaoJing Date: Thu Oct 20 11:05:05 2022 +0800 nfc: virtual_ncidev: Fix memory leak in virtual_nci_send() skb should be free in virtual_nci_send(), otherwise kmemleak will report memleak. Steps for reproduction (simulated in qemu): cd tools/testing/selftests/nci make ./nci_dev BUG: memory leak unreferenced object 0xffff888107588000 (size 208): comm "nci_dev", pid 206, jiffies 4294945376 (age 368.248s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000008d94c8fd>] __alloc_skb+0x1da/0x290 [<00000000278bc7f8>] nci_send_cmd+0xa3/0x350 [<0000000081256a22>] nci_reset_req+0x6b/0xa0 [<000000009e721112>] __nci_request+0x90/0x250 [<000000005d556e59>] nci_dev_up+0x217/0x5b0 [<00000000e618ce62>] nfc_dev_up+0x114/0x220 [<00000000981e226b>] nfc_genl_dev_up+0x94/0xe0 [<000000009bb03517>] genl_family_rcv_msg_doit.isra.14+0x228/0x2d0 [<00000000b7f8c101>] genl_rcv_msg+0x35c/0x640 [<00000000c94075ff>] netlink_rcv_skb+0x11e/0x350 [<00000000440cfb1e>] genl_rcv+0x24/0x40 [<0000000062593b40>] netlink_unicast+0x43f/0x640 [<000000001d0b13cc>] netlink_sendmsg+0x73a/0xbf0 [<000000003272487f>] __sys_sendto+0x324/0x370 [<00000000ef9f1747>] __x64_sys_sendto+0xdd/0x1b0 [<000000001e437841>] do_syscall_64+0x3f/0x90 Fixes: e624e6c3e777 ("nfc: Add a virtual nci device driver") Signed-off-by: Shang XiaoJing Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221020030505.15572-1-shangxiaojing@huawei.com Signed-off-by: Jakub Kicinski commit 15a9dbec631cd69dfbbfc4e2cbf90c9dd8432a8f Author: Sergiu Moga Date: Wed Oct 19 15:09:32 2022 +0300 net: macb: Specify PHY PM management done by MAC The `macb_resume`/`macb_suspend` methods already call the `phylink_start`/`phylink_stop` methods during their execution so explicitly say that the PM of the PHY is done by MAC by using the `mac_managed_pm` flag of the `struct phylink_config`. This also fixes the warning message issued during resume: WARNING: CPU: 0 PID: 237 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0x144/0x148 Depends-on: 96de900ae78e ("net: phylink: add mac_managed_pm in phylink_config structure") Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") Signed-off-by: Sergiu Moga Reviewed-by: Florian Fainelli Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20221019120929.63098-1-sergiu.moga@microchip.com Signed-off-by: Jakub Kicinski commit d1cb84948c4f6ec14b24ef26c7b458fc30715f70 Merge: 4a7a83044fd97 8ec2f4c6b2e11 Author: Jakub Kicinski Date: Thu Oct 20 21:09:51 2022 -0700 Merge branch 'fix-some-issues-in-huawei-hinic-driver' Zhengchao Shao says: ==================== fix some issues in Huawei hinic driver Fix some issues in Huawei hinic driver. This patchset is compiled only, not tested. ==================== Link: https://lore.kernel.org/r/20221019095754.189119-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 8ec2f4c6b2e11a4249bba77460f0cfe6d95a82f8 Author: Zhengchao Shao Date: Wed Oct 19 17:57:54 2022 +0800 net: hinic: fix the issue of double release MBOX callback of VF In hinic_vf_func_init(), if VF fails to register information with PF through the MBOX, the MBOX callback function of VF is released once. But it is released again in hinic_init_hwdev(). Remove one. Fixes: 7dd29ee12865 ("hinic: add sriov feature support") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 363cc87767f6ddcfb9158ad2e2afa2f8d5c4b94e Author: Zhengchao Shao Date: Wed Oct 19 17:57:53 2022 +0800 net: hinic: fix the issue of CMDQ memory leaks When hinic_set_cmdq_depth() fails in hinic_init_cmdqs(), the cmdq memory is not released correctly. Fix it. Fixes: 72ef908bb3ff ("hinic: add three net_device_ops of vf") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 4c1f602df8956bc0decdafd7e4fc7eef50c550b1 Author: Zhengchao Shao Date: Wed Oct 19 17:57:52 2022 +0800 net: hinic: fix memory leak when reading function table When the input parameter idx meets the expected case option in hinic_dbg_get_func_table(), read_data is not released. Fix it. Fixes: 5215e16244ee ("hinic: add support to query function table") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit c0605cd6750f2db9890c43a91ea4d77be8fb4908 Author: Zhengchao Shao Date: Wed Oct 19 17:57:51 2022 +0800 net: hinic: fix incorrect assignment issue in hinic_set_interrupt_cfg() The value of lli_credit_cnt is incorrectly assigned, fix it. Fixes: a0337c0dee68 ("hinic: add support to set and get irq coalesce") Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 4a7a83044fd975c43dad5ac1b9e951dec211c3a1 Merge: f8c1c66b99a57 b2c0921b926ca Author: Jakub Kicinski Date: Thu Oct 20 21:09:33 2022 -0700 Merge branch 'selftests-net-fix-problems-in-some-drivers-net-tests' Benjamin Poirier says: ==================== selftests: net: Fix problems in some drivers/net tests Fix two problems mostly introduced in commit bbb774d921e2 ("net: Add tests for bonding and team address list management"). ==================== Link: https://lore.kernel.org/r/20221019091042.783786-1-bpoirier@nvidia.com Signed-off-by: Jakub Kicinski commit b2c0921b926ca69cc399eb356162f35340598112 Author: Benjamin Poirier Date: Wed Oct 19 18:10:42 2022 +0900 selftests: net: Fix netdev name mismatch in cleanup lag_lib.sh creates the interfaces dummy1 and dummy2 whereas dev_addr_lists.sh:destroy() deletes the interfaces dummy0 and dummy1. Fix the mismatch in names. Fixes: bbb774d921e2 ("net: Add tests for bonding and team address list management") Signed-off-by: Benjamin Poirier Reviewed-by: Jonathan Toppins Signed-off-by: Jakub Kicinski commit ae108c48b5d2b34bcef3c4fb5076f42c922c426a Author: Benjamin Poirier Date: Wed Oct 19 18:10:41 2022 +0900 selftests: net: Fix cross-tree inclusion of scripts When exporting and running a subset of selftests via kselftest, files from parts of the source tree which were not exported are not available. A few tests are trying to source such files. Address the problem by using symlinks. The problem can be reproduced by running: make -C tools/testing/selftests gen_tar TARGETS="drivers/net/bonding" [... extract archive ...] ./run_kselftest.sh or: make kselftest KBUILD_OUTPUT=/tmp/kselftests TARGETS="drivers/net/bonding" Fixes: bbb774d921e2 ("net: Add tests for bonding and team address list management") Fixes: eccd0a80dc7f ("selftests: net: dsa: add a stress test for unlocked FDB operations") Link: https://lore.kernel.org/netdev/40f04ded-0c86-8669-24b1-9a313ca21076@redhat.com/ Reported-by: Jonathan Toppins Signed-off-by: Benjamin Poirier Reviewed-by: Jonathan Toppins Signed-off-by: Jakub Kicinski commit f8c1c66b99a570c08b9d26e4347276f00e49bba7 Author: Horatiu Vultur Date: Wed Oct 19 10:30:56 2022 +0200 net: lan966x: Fix the rx drop counter Currently the rx drop is calculated as the sum of multiple HW drop counters. The issue is that not all the HW drop counters were added for the rx drop counter. So if for example you have a police that drops frames, they were not see in the rx drop counter. Fix this by updating how the rx drop counter is calculated. It is required to add also RX_RED_PRIO_* HW counters. Fixes: 12c2d0a5b8e2 ("net: lan966x: add ethtool configuration and statistics") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20221019083056.2744282-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 94423589689124e8cd145b38a1034be7f25835b2 Author: Yang Yingliang Date: Wed Oct 19 14:41:04 2022 +0800 net: netsec: fix error handling in netsec_register_mdio() If phy_device_register() fails, phy_device_free() need be called to put refcount, so memory of phy device and device name can be freed in callback function. If get_phy_device() fails, mdiobus_unregister() need be called, or it will cause warning in mdiobus_free() and kobject is leaked. Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221019064104.3228892-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 82cb4e4612c633a9ce320e1773114875604a3cce Author: Xin Long Date: Tue Oct 18 15:19:50 2022 -0400 tipc: fix a null-ptr-deref in tipc_topsrv_accept syzbot found a crash in tipc_topsrv_accept: KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] Workqueue: tipc_rcv tipc_topsrv_accept RIP: 0010:kernel_accept+0x22d/0x350 net/socket.c:3487 Call Trace: tipc_topsrv_accept+0x197/0x280 net/tipc/topsrv.c:460 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 It was caused by srv->listener that might be set to null by tipc_topsrv_stop() in net .exit whereas it's still used in tipc_topsrv_accept() worker. srv->listener is protected by srv->idr_lock in tipc_topsrv_stop(), so add a check for srv->listener under srv->idr_lock in tipc_topsrv_accept() to avoid the null-ptr-deref. To ensure the lsock is not released during the tipc_topsrv_accept(), move sock_release() after tipc_topsrv_work_stop() where it's waiting until the tipc_topsrv_accept worker to be done. Note that sk_callback_lock is used to protect sk->sk_user_data instead of srv->listener, and it should check srv in tipc_topsrv_listener_data_ready() instead. This also ensures that no more tipc_topsrv_accept worker will be started after tipc_conn_close() is called in tipc_topsrv_stop() where it sets sk->sk_user_data to null. Fixes: 0ef897be12b8 ("tipc: separate topology server listener socket from subcsriber sockets") Reported-by: syzbot+c5ce866a8d30f4be0651@syzkaller.appspotmail.com Signed-off-by: Xin Long Acked-by: Jon Maloy Link: https://lore.kernel.org/r/4eee264380c409c61c6451af1059b7fb271a7e7b.1666120790.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit dbe69b29988465b011f198f2797b1c2b6980b50e Author: Jiri Olsa Date: Tue Oct 18 09:59:34 2022 +0200 bpf: Fix dispatcher patchable function entry to 5 bytes nop The patchable_function_entry(5) might output 5 single nop instructions (depends on toolchain), which will clash with bpf_arch_text_poke check for 5 bytes nop instruction. Adding early init call for dispatcher that checks and change the patchable entry into expected 5 nop instruction if needed. There's no need to take text_mutex, because we are using it in early init call which is called at pre-smp time. Fixes: ceea991a019c ("bpf: Move bpf_dispatcher function out of ftrace locations") Signed-off-by: Jiri Olsa Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20221018075934.574415-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit e35184f321518acadb681928a016da21a9a20c13 Merge: 6d36c728bc2e2 cbc543c59e8e7 Author: Linus Torvalds Date: Thu Oct 20 18:28:32 2022 -0700 Merge tag 'drm-fixes-2022-10-21' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Usual fixes for the week. The amdgpu contains fixes for two regressions, one reported in response to rc1 which broke on SI GPUs, and one gfx9 APU regression. Otherwise it's mostly fixes for new IP, and some GPU reset fixes. vc4 is just HDMI fixes, and panfrost has some mnor types fixes. Core: - fix connector DDC pointer - fix buffer overflow in format_helper_test amdgpu: - Mode2 reset fixes for Sienna Cichlid - Revert broken fan speed sensor fix - SMU 13.x fixes - GC 11.x fixes - RAS fixes - SR-IOV fixes - Fix BO move breakage on SI - Misc compiler fixes - Fix gfx9 APU regression caused by PCI AER fix vc4: - HDMI fixes panfrost: - compiler fixes" * tag 'drm-fixes-2022-10-21' of git://anongit.freedesktop.org/drm/drm: (35 commits) drm/amdgpu: fix sdma doorbell init ordering on APUs drm/panfrost: replace endian-specific types with native ones drm/panfrost: Remove type name from internal structs drm/connector: Set DDC pointer in drmm_connector_init drm: tests: Fix a buffer overflow in format_helper_test drm/amdgpu: use DRM_SCHED_FENCE_DONT_PIPELINE for VM updates drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag drm/amdgpu: Fix for BO move issue drm/amdgpu: dequeue mes scheduler during fini drm/amd/pm: enable thermal alert on smu_v13_0_10 drm/amdgpu: Program GC registers through RLCG interface in gfx_v11/gmc_v11 drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback drm/amd/display: Increase frame size limit for display_mode_vba_util_32.o drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 drm/amd/pm: update SMU IP v13.0.4 driver interface version drm/amd/pm: Init pm_attr_list when dpm is disabled drm/amd/pm: disable cstate feature for gpu reset scenario drm/amd/pm: fulfill SMU13.0.7 cstate control interface drm/amd/pm: fulfill SMU13.0.0 cstate control interface drm/amdgpu: Add sriov vf ras support in amdgpu_ras_asic_supported ... commit 47eee861fa91b308800968d988975f4b9de54458 Merge: dc8e483f684a2 67d0a917fb3f9 Author: Martin K. Petersen Date: Fri Oct 21 01:10:34 2022 +0000 Merge branch '6.1/scsi-queue' into 6.1/scsi-fixes Include the patches that weren't included in the 6.1 pull request. Signed-off-by: Martin K. Petersen commit 6d36c728bc2e2d632f4b0dea00df5532e20dfdab Merge: c7b006525bb06 7f378c03aa495 Author: Linus Torvalds Date: Thu Oct 20 17:24:59 2022 -0700 Merge tag 'net-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from netfilter. Current release - regressions: - revert "net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}" - revert "net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init()" - dsa: uninitialized variable in dsa_slave_netdevice_event() - eth: sunhme: uninitialized variable in happy_meal_init() Current release - new code bugs: - eth: octeontx2: fix resource not freed after malloc Previous releases - regressions: - sched: fix return value of qdisc ingress handling on success - sched: fix race condition in qdisc_graft() - udp: update reuse->has_conns under reuseport_lock. - tls: strp: make sure the TCP skbs do not have overlapping data - hsr: avoid possible NULL deref in skb_clone() - tipc: fix an information leak in tipc_topsrv_kern_subscr - phylink: add mac_managed_pm in phylink_config structure - eth: i40e: fix DMA mappings leak - eth: hyperv: fix a RX-path warning - eth: mtk: fix memory leaks Previous releases - always broken: - sched: cake: fix null pointer access issue when cake_init() fails" * tag 'net-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (43 commits) net: phy: dp83822: disable MDI crossover status change interrupt net: sched: fix race condition in qdisc_graft() net: hns: fix possible memory leak in hnae_ae_register() wwan_hwsim: fix possible memory leak in wwan_hwsim_dev_new() sfc: include vport_id in filter spec hash and equal() genetlink: fix kdoc warnings selftests: add selftest for chaining of tc ingress handling to egress net: Fix return value of qdisc ingress handling on success net: sched: sfb: fix null pointer access issue when sfb_init() fails Revert "net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init()" net: sched: cake: fix null pointer access issue when cake_init() fails ethernet: marvell: octeontx2 Fix resource not freed after malloc netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces. ionic: catch NULL pointer issue on reconfig net: hsr: avoid possible NULL deref in skb_clone() bnxt_en: fix memory leak in bnxt_nvm_test() ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed udp: Update reuse->has_conns under reuseport_lock. net: ethernet: mediatek: ppe: Remove the unused function mtk_foe_entry_usable() ... commit c7b006525bb0673f2373f04b5b8263b022ff367b Merge: a3ccea6ed80db 2ce3a0bf2010b Author: Linus Torvalds Date: Thu Oct 20 17:07:54 2022 -0700 Merge tag 'ata-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "Several minor fixes: - Fix the module alias for the ahci_imx driver to get autoloading to work (Alexander) - Fix a potential array-index-out-of-bounds problem with the enclosure managment support in the ahci driver (Kai-Heng) - Several patches to fix compilation warnings thrown by clang in the ahci_st, sata_rcar, ahci_brcm, ahci_xgene, ahci_imx and ahci_qoriq drivers (me)" * tag 'ata-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: ahci_qoriq: Fix compilation warning ata: ahci_imx: Fix compilation warning ata: ahci_xgene: Fix compilation warning ata: ahci_brcm: Fix compilation warning ata: sata_rcar: Fix compilation warning ata: ahci_st: Fix compilation warning ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS ata: ahci-imx: Fix MODULE_ALIAS commit a3ccea6ed80db39e8aaed22d896099be477e1f85 Merge: aae703b02f92b 5434ee8d28575 Author: Linus Torvalds Date: Thu Oct 20 17:00:54 2022 -0700 Merge tag 'for-6.1/dm-changes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Fix dm-bufio to use test_bit_acquire to properly test_bit on arches with weaker memory ordering. - DM core replace DMWARN with DMERR or DMCRIT for fatal errors. - Enable WQ_HIGHPRI on DM verity target's verify_wq. - Add documentation for DM verity's try_verify_in_tasklet option. - Various typo and redundant word fixes in code and/or comments. * tag 'for-6.1/dm-changes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm clone: Fix typo in block_device format specifier dm: remove unnecessary assignment statement in alloc_dev() dm verity: Add documentation for try_verify_in_tasklet option dm cache: delete the redundant word 'each' in comment dm raid: fix typo in analyse_superblocks code comment dm verity: enable WQ_HIGHPRI on verify_wq dm raid: delete the redundant word 'that' in comment dm: change from DMWARN to DMERR or DMCRIT for fatal errors dm bufio: use the acquire memory barrier when testing for B_READING commit cbc543c59e8e7c8bc8604d6ac3e18a029e3d5118 Merge: a4294d5c77152 72655fb942c1e Author: Dave Airlie Date: Fri Oct 21 09:56:07 2022 +1000 Merge tag 'drm-misc-fixes-2022-10-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.1-rc2: - Fix a buffer overflow in format_helper_test. - Set DDC pointer in drmm_connector_init. - Compiler fixes for panfrost. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/c4d05683-8ebe-93b8-d24c-d1d2c68f12c4@linux.intel.com commit f010c75c05299ecd65adfd31a7841eea3476ce1f Author: Jonathan Cameron Date: Mon Aug 15 16:40:44 2022 +0100 cxl/pmem: Fix failure to account for 8 byte header for writes to the device LSA. Writes to the device must include an offset and size as defined in CXL 2.0 8.2.9.5.2.4 Set LSA (Opcode 4103h) Fixes tag is non obvious as this code has been through several reworks and variable names + wasn't in use until the addition of the region code. Due to a bug in QEMU CXL emulation this overrun resulted in QEMU crashing. Reported-by: Bobo WL Signed-off-by: Jonathan Cameron Fixes: 60b8f17215de ("cxl/pmem: Translate NVDIMM label commands to CXL label commands") Link: https://lore.kernel.org/r/20220815154044.24733-3-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit 2816e24b0510e0c185c0c46acff1ce7aa4c4443f Author: Jonathan Cameron Date: Thu Aug 18 17:42:10 2022 +0100 cxl/region: Fix null pointer dereference due to pass through decoder commit Not all decoders have a commit callback. The CXL specification allows a host bridge with a single root port to have no explicit HDM decoders. Currently the region driver assumes there are none. As such the CXL core creates a special pass through decoder instance without a commit callback. Prior to this patch, the ->commit() callback was called unconditionally. Thus a configuration with 1 Host Bridge, 1 Root Port, 1 switch with multiple downstream ports below which there are multiple CXL type 3 devices results in a situation where committing the region causes a null pointer dereference. Reported-by: Bobo WL Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware") Signed-off-by: Jonathan Cameron Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/20220818164210.2084-1-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit cf00b33058b196b4db928419dde68993b15a975b Author: Jonathan Cameron Date: Mon Aug 15 16:40:43 2022 +0100 cxl/mbox: Add a check on input payload size A bug in the LSA code resulted in transfers slightly larger than the mailbox size. Let us make it easier to catch similar issues in future by adding a low level check. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220815154044.24733-2-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit 31d8aaa87fcef1be5932f3813ea369e21bd3b11d Author: Paul E. McKenney Date: Thu Oct 20 10:58:14 2022 -0700 rcu: Keep synchronize_rcu() from enabling irqs in early boot Making polled RCU grace periods account for expedited grace periods required acquiring the leaf rcu_node structure's lock during early boot, but after rcu_init() was called. This lock is irq-disabled, but the code incorrectly assumes that irqs are always disabled when invoking synchronize_rcu(). The exception is early boot before the scheduler has started, which means that upon return from synchronize_rcu(), irqs will be incorrectly enabled. This commit fixes this bug by using irqsave/irqrestore locking primitives. Fixes: bf95b2bc3e42 ("rcu: Switch polled grace-period APIs to ->gp_seq_polled") Reported-by: Steven Rostedt Signed-off-by: Paul E. McKenney commit a4294d5c77152ba38bd6b3167a5fd1eb8a325c49 Merge: f046ca4a18a07 50b0e4d4da09f Author: Dave Airlie Date: Fri Oct 21 08:10:31 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-10-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-10-20: amdgpu: - Fix gfx9 APU regression caused by PCI AER fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221020135225.562807-1-alexander.deucher@amd.com commit f046ca4a18a071517baf581952c41e7c41a0038e Merge: 8865dd756f92e 8273b4048664f Author: Dave Airlie Date: Fri Oct 21 08:10:15 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-10-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.1-2022-10-19: amdgpu: - Mode2 reset fixes for Sienna Cichlid - Revert broken fan speed sensor fix - SMU 13.x fixes - GC 11.x fixes - RAS fixes - SR-IOV fixes - Fix BO move breakage on SI - Misc compiler fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221019191357.6208-1-alexander.deucher@amd.com commit 8865dd756f92e6745cac64f4dd50e4dc3b9864cc Merge: 9abf2313adc1c 4190e8bbcbc77 Author: Dave Airlie Date: Fri Oct 21 08:08:25 2022 +1000 Merge tag 'drm-misc-fixes-2022-10-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Short summary of fixes pull: * vc4: HDMI fixes Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/Y0gGdlujszCstDeP@linux-uq9g commit 665c157e0204176023860b51a46528ba0ba62c33 Author: James Clark Date: Wed Oct 5 14:14:52 2022 +0100 coresight: cti: Fix hang in cti_disable_hw() cti_enable_hw() and cti_disable_hw() are called from an atomic context so shouldn't use runtime PM because it can result in a sleep when communicating with firmware. Since commit 3c6656337852 ("Revert "firmware: arm_scmi: Add clock management to the SCMI power domain""), this causes a hang on Juno when running the Perf Coresight tests or running this command: perf record -e cs_etm//u -- ls This was also missed until the revert commit because pm_runtime_put() was called with the wrong device until commit 692c9a499b28 ("coresight: cti: Correct the parameter for pm_runtime_put") With lock and scheduler debugging enabled the following is output: coresight cti_sys0: cti_enable_hw -- dev:cti_sys0 parent: 20020000.cti BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1151 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 330, name: perf-exec preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0xa0c/0x1948 softirqs last enabled at (0): [] copy_process+0xa0c/0x1948 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 3 PID: 330 Comm: perf-exec Not tainted 6.0.0-00053-g042116d99298 #7 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Sep 13 2022 Call trace: dump_backtrace+0x134/0x140 show_stack+0x20/0x58 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 __might_resched+0x180/0x228 __might_sleep+0x50/0x88 __pm_runtime_resume+0xac/0xb0 cti_enable+0x44/0x120 coresight_control_assoc_ectdev+0xc0/0x150 coresight_enable_path+0xb4/0x288 etm_event_start+0x138/0x170 etm_event_add+0x48/0x70 event_sched_in.isra.122+0xb4/0x280 merge_sched_in+0x1fc/0x3d0 visit_groups_merge.constprop.137+0x16c/0x4b0 ctx_sched_in+0x114/0x1f0 perf_event_sched_in+0x60/0x90 ctx_resched+0x68/0xb0 perf_event_exec+0x138/0x508 begin_new_exec+0x52c/0xd40 load_elf_binary+0x6b8/0x17d0 bprm_execve+0x360/0x7f8 do_execveat_common.isra.47+0x218/0x238 __arm64_sys_execve+0x48/0x60 invoke_syscall+0x4c/0x110 el0_svc_common.constprop.4+0xfc/0x120 do_el0_svc+0x34/0xc0 el0_svc+0x40/0x98 el0t_64_sync_handler+0x98/0xc0 el0t_64_sync+0x170/0x174 Fix the issue by removing the runtime PM calls completely. They are not needed here because it must have already been done when building the path for a trace. Fixes: 835d722ba10a ("coresight: cti: Initial CoreSight CTI Driver") Reported-by: Aishwarya TCV Reported-by: Cristian Marussi Suggested-by: Suzuki Poulose Signed-off-by: James Clark Reviewed-by: Mike Leach Tested-by: Mike Leach Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20221005131452.1506328-1-james.clark@arm.com commit 23722fb46725da42b80bc55a91a9bac69e35188a Author: Sudeep Holla Date: Thu Jul 21 14:03:29 2022 +0100 coresight: Fix possible deadlock with lock dependency With lockdeps enabled, we get the following warning: ====================================================== WARNING: possible circular locking dependency detected ------------------------------------------------------ kworker/u12:1/53 is trying to acquire lock: ffff80000adce220 (coresight_mutex){+.+.}-{4:4}, at: coresight_set_assoc_ectdev_mutex+0x3c/0x5c but task is already holding lock: ffff80000add1f60 (ect_mutex){+.+.}-{4:4}, at: cti_probe+0x318/0x394 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (ect_mutex){+.+.}-{4:4}: __mutex_lock_common+0xd8/0xe60 mutex_lock_nested+0x44/0x50 cti_add_assoc_to_csdev+0x4c/0x184 coresight_register+0x2f0/0x314 tmc_probe+0x33c/0x414 -> #0 (coresight_mutex){+.+.}-{4:4}: __lock_acquire+0x1a20/0x32d0 lock_acquire+0x160/0x308 __mutex_lock_common+0xd8/0xe60 mutex_lock_nested+0x44/0x50 coresight_set_assoc_ectdev_mutex+0x3c/0x5c cti_update_conn_xrefs+0x6c/0xf8 cti_probe+0x33c/0x394 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ect_mutex); lock(coresight_mutex); lock(ect_mutex); lock(coresight_mutex); *** DEADLOCK *** 4 locks held by kworker/u12:1/53: #0: ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1fc/0x63c #1: (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x228/0x63c #2: (&dev->mutex){....}-{4:4}, at: __device_attach+0x48/0x1a8 #3: (ect_mutex){+.+.}-{4:4}, at: cti_probe+0x318/0x394 To fix the same, call cti_add_assoc_to_csdev without the holding coresight_mutex and confine the locking while setting the associated ect / cti device using coresight_set_assoc_ectdev_mutex(). Fixes: 177af8285b59 ("coresight: cti: Enable CTI associated with devices") Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Signed-off-by: Sudeep Holla Reviewed-by: Mike Leach Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220721130329.3787211-1-sudeep.holla@arm.com commit fdf23c62d98cda1d8935259dc7da3cc830a4bc6c Author: Jiangshan Yi Date: Sun Oct 9 15:19:23 2022 +0800 i2c: fix spelling typos in comments Reported-by: k2ci Signed-off-by: Jiangshan Yi Reviewed-by: Jean Delvare # for sis630 Signed-off-by: Wolfram Sang commit 21a1994b6492b12e55dbf39d15271430ef6839f0 Author: Daniel Bristot de Oliveira Date: Tue Aug 23 17:20:28 2022 +0200 rv/dot2c: Make automaton definition static Monitor's automata definition is only used locally, so make dot2c generate a static definition. Link: https://lore.kernel.org/all/202208210332.gtHXje45-lkp@intel.com Link: https://lore.kernel.org/all/202208210358.6HH3OrVs-lkp@intel.com Link: https://lkml.kernel.org/r/ffbb92010f643307766c9307fd42f416e5b85fa0.1661266564.git.bristot@kernel.org Cc: Steven Rostedt Fixes: e3c9fc78f096 ("tools/rv: Add dot2c") Reported-by: kernel test robot Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit d08af40340cad0e025d643c3982781a8f99d5032 Author: Li Zetao Date: Tue Oct 18 14:38:29 2022 -0700 xfs: Fix unreferenced object reported by kmemleak in xfs_sysfs_init() kmemleak reported a sequence of memory leaks, and one of them indicated we failed to free a pointer: comm "mount", pid 19610, jiffies 4297086464 (age 60.635s) hex dump (first 8 bytes): 73 64 61 00 81 88 ff ff sda..... backtrace: [<00000000d77f3e04>] kstrdup_const+0x46/0x70 [<00000000e51fa804>] kobject_set_name_vargs+0x2f/0xb0 [<00000000247cd595>] kobject_init_and_add+0xb0/0x120 [<00000000f9139aaf>] xfs_mountfs+0x367/0xfc0 [<00000000250d3caf>] xfs_fs_fill_super+0xa16/0xdc0 [<000000008d873d38>] get_tree_bdev+0x256/0x390 [<000000004881f3fa>] vfs_get_tree+0x41/0xf0 [<000000008291ab52>] path_mount+0x9b3/0xdd0 [<0000000022ba8f2d>] __x64_sys_mount+0x190/0x1d0 As mentioned in kobject_init_and_add() comment, if this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Apparently, xfs_sysfs_init() does not follow such a requirement. When kobject_init_and_add() returns an error, the space of kobj->kobject.name alloced by kstrdup_const() is unfree, which will cause the above stack. Fix it by adding kobject_put() when kobject_init_and_add returns an error. Fixes: a31b1d3d89e4 ("xfs: add xfs_mount sysfs kobject") Signed-off-by: Li Zetao Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit cf4f4c12dea7a977a143c8fe5af1740b7f9876f8 Author: Zeng Heng Date: Tue Oct 18 14:38:14 2022 -0700 xfs: fix memory leak in xfs_errortag_init When `xfs_sysfs_init` returns failed, `mp->m_errortag` needs to free. Otherwise kmemleak would report memory leak after mounting xfs image: unreferenced object 0xffff888101364900 (size 192): comm "mount", pid 13099, jiffies 4294915218 (age 335.207s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f08ad25c>] __kmalloc+0x41/0x1b0 [<00000000dca9aeb6>] kmem_alloc+0xfd/0x430 [<0000000040361882>] xfs_errortag_init+0x20/0x110 [<00000000b384a0f6>] xfs_mountfs+0x6ea/0x1a30 [<000000003774395d>] xfs_fs_fill_super+0xe10/0x1a80 [<000000009cf07b6c>] get_tree_bdev+0x3e7/0x700 [<00000000046b5426>] vfs_get_tree+0x8e/0x2e0 [<00000000952ec082>] path_mount+0xf8c/0x1990 [<00000000beb1f838>] do_mount+0xee/0x110 [<000000000e9c41bb>] __x64_sys_mount+0x14b/0x1f0 [<00000000f7bb938e>] do_syscall_64+0x3b/0x90 [<000000003fcd67a9>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: c68401011522 ("xfs: expose errortag knobs via sysfs") Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fc93812c725068e6a491ce574f058a4530130c00 Author: Colin Ian King Date: Tue Oct 18 14:37:39 2022 -0700 xfs: remove redundant pointer lip The assignment to pointer lip is not really required, the pointer lip is redundant and can be removed. Cleans up clang-scan warning: warning: Although the value stored to 'lip' is used in the enclosing expression, the value is never actually read from 'lip' [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 13cf24e00665c9751951a422756d975812b71173 Author: Guo Xuenan Date: Tue Oct 18 14:32:35 2022 -0700 xfs: fix exception caused by unexpected illegal bestcount in leaf dir For leaf dir, In most cases, there should be as many bestfree slots as the dir data blocks that can fit under i_size (except for [1]). Root cause is we don't examin the number bestfree slots, when the slots number less than dir data blocks, if we need to allocate new dir data block and update the bestfree array, we will use the dir block number as index to assign bestfree array, while we did not check the leaf buf boundary which may cause UAF or other memory access problem. This issue can also triggered with test cases xfs/473 from fstests. According to Dave Chinner & Darrick's suggestion, adding buffer verifier to detect this abnormal situation in time. Simplify the testcase for fstest xfs/554 [1] The error log is shown as follows: ================================================================== BUG: KASAN: use-after-free in xfs_dir2_leaf_addname+0x1995/0x1ac0 Write of size 2 at addr ffff88810168b000 by task touch/1552 CPU: 5 PID: 1552 Comm: touch Not tainted 6.0.0-rc3+ #101 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x4d/0x66 print_report.cold+0xf6/0x691 kasan_report+0xa8/0x120 xfs_dir2_leaf_addname+0x1995/0x1ac0 xfs_dir_createname+0x58c/0x7f0 xfs_create+0x7af/0x1010 xfs_generic_create+0x270/0x5e0 path_openat+0x270b/0x3450 do_filp_open+0x1cf/0x2b0 do_sys_openat2+0x46b/0x7a0 do_sys_open+0xb7/0x130 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe4d9e9312b Code: 25 00 00 41 00 3d 00 00 41 00 74 4b 64 8b 04 25 18 00 00 00 85 c0 75 67 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 48 8b 4c 24 28 64 48 33 0c 25 RSP: 002b:00007ffda4c16c20 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe4d9e9312b RDX: 0000000000000941 RSI: 00007ffda4c17f33 RDI: 00000000ffffff9c RBP: 00007ffda4c17f33 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000000941 R13: 00007fe4d9f631a4 R14: 00007ffda4c17f33 R15: 0000000000000000 The buggy address belongs to the physical page: page:ffffea000405a2c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10168b flags: 0x2fffff80000000(node=0|zone=2|lastcpupid=0x1fffff) raw: 002fffff80000000 ffffea0004057788 ffffea000402dbc8 0000000000000000 raw: 0000000000000000 0000000000170000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810168af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810168af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810168b000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88810168b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810168b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Disabling lock debugging due to kernel taint 00000000: 58 44 44 33 5b 53 35 c2 00 00 00 00 00 00 00 78 XDD3[S5........x XFS (sdb): Internal error xfs_dir2_data_use_free at line 1200 of file fs/xfs/libxfs/xfs_dir2_data.c. Caller xfs_dir2_data_use_free+0x28a/0xeb0 CPU: 5 PID: 1552 Comm: touch Tainted: G B 6.0.0-rc3+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x4d/0x66 xfs_corruption_error+0x132/0x150 xfs_dir2_data_use_free+0x198/0xeb0 xfs_dir2_leaf_addname+0xa59/0x1ac0 xfs_dir_createname+0x58c/0x7f0 xfs_create+0x7af/0x1010 xfs_generic_create+0x270/0x5e0 path_openat+0x270b/0x3450 do_filp_open+0x1cf/0x2b0 do_sys_openat2+0x46b/0x7a0 do_sys_open+0xb7/0x130 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe4d9e9312b Code: 25 00 00 41 00 3d 00 00 41 00 74 4b 64 8b 04 25 18 00 00 00 85 c0 75 67 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 48 8b 4c 24 28 64 48 33 0c 25 RSP: 002b:00007ffda4c16c20 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe4d9e9312b RDX: 0000000000000941 RSI: 00007ffda4c17f46 RDI: 00000000ffffff9c RBP: 00007ffda4c17f46 R08: 0000000000000000 R09: 0000000000000001 R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000000941 R13: 00007fe4d9f631a4 R14: 00007ffda4c17f46 R15: 0000000000000000 XFS (sdb): Corruption detected. Unmount and run xfs_repair [1] https://lore.kernel.org/all/20220928095355.2074025-1-guoxuenan@huawei.com/ Reviewed-by: Hou Tao Signed-off-by: Guo Xuenan Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 54de93cd8740d52a83728802b4270f953d1a636f Author: Petr Vorel Date: Thu Oct 20 17:06:45 2022 +0200 kernel/utsname_sysctl.c: Add missing enum uts_proc value bfca3dd3d068 added new struct ctl_table uts_kern_table[], but not new enum uts_proc value. It broke the notification mechanism between the sethostname syscall and the pollers of /proc/sys/kernel/hostname. The table uts_kern_table is addressed within uts_proc_notify by the enum value, that's why new enum value is needed. Fixes: bfca3dd3d068 ("kernel/utsname_sysctl.c: print kernel arch") Reported-by: Torsten Hilbrich Signed-off-by: Petr Vorel Link: https://lore.kernel.org/r/20221020150645.11719-1-pvorel@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9fa248c65bdbf5af0a2f74dd38575acfc8dfd2bf Author: Miklos Szeredi Date: Thu Oct 20 17:18:58 2022 +0200 fuse: fix readdir cache race There's a race in fuse's readdir cache that can result in an uninitilized page being read. The page lock is supposed to prevent this from happening but in the following case it doesn't: Two fuse_add_dirent_to_cache() start out and get the same parameters (size=0,offset=0). One of them wins the race to create and lock the page, after which it fills in data, sets rdc.size and unlocks the page. In the meantime the page gets evicted from the cache before the other instance gets to run. That one also creates the page, but finds the size to be mismatched, bails out and leaves the uninitialized page in the cache. Fix by marking a filled page uptodate and ignoring non-uptodate pages. Reported-by: Frank Sorenson Fixes: 5d7bc7e8680c ("fuse: allow using readdir cache") Cc: # v4.20 Signed-off-by: Miklos Szeredi commit b329f5ddc9ce4b622d9c7aaf5c6df4de52caf91a Author: Maxim Levitsky Date: Mon Jul 18 17:11:19 2022 +0300 perf/x86/intel/lbr: Use setup_clear_cpu_cap() instead of clear_cpu_cap() clear_cpu_cap(&boot_cpu_data) is very similar to setup_clear_cpu_cap() except that the latter also sets a bit in 'cpu_caps_cleared' which later clears the same cap in secondary cpus, which is likely what is meant here. Fixes: 47125db27e47 ("perf/x86/intel/lbr: Support Architectural LBR") Signed-off-by: Maxim Levitsky Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lkml.kernel.org/r/20220718141123.136106-2-mlevitsk@redhat.com commit 883bbbffa5a4ffd1915f8b42934dab81b7f87226 Author: Peter Zijlstra Date: Tue Oct 18 13:49:21 2022 +0200 ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph() Different function signatures means they needs to be different functions; otherwise CFI gets upset. As triggered by the ftrace boot tests: [] CFI failure at ftrace_return_to_handler+0xac/0x16c (target: ftrace_stub+0x0/0x14; expected type: 0x0a5d5347) Fixes: 3c516f89e17e ("x86: Add support for CONFIG_CFI_CLANG") Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Tested-by: Mark Rutland Link: https://lkml.kernel.org/r/Y06dg4e1xF6JTdQq@hirez.programming.kicks-ass.net commit b5f1fc3184405ab955db1b86d41d8b744d07c12d Author: Peter Zijlstra Date: Thu Sep 15 13:11:35 2022 +0200 x86/ftrace: Remove ftrace_epilogue() Remove the weird jumps to RET and simply use RET. This then promotes ftrace_stub() to a real function; which becomes important for kcfi. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220915111148.719080593@infradead.org Signed-off-by: Peter Zijlstra commit 50b0e4d4da09fa501e722af886f97e60a4f820d6 Author: Alex Deucher Date: Wed Oct 19 16:57:42 2022 -0400 drm/amdgpu: fix sdma doorbell init ordering on APUs Commit 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") uncovered a bug in amdgpu that required a reordering of the driver init sequence to avoid accessing a special register on the GPU before it was properly set up leading to an PCI AER error. This reordering uncovered a different hw programming ordering dependency in some APUs where the SDMA doorbells need to be programmed before the GFX doorbells. To fix this, move the SDMA doorbell programming back into the soc15 common code, but use the actual doorbell range values directly rather than the values stored in the ring structure since those will not be initialized at this point. This is a partial revert, but with the doorbell assignment fixed so the proper doorbell index is set before it's used. Fixes: e3163bc8ffdfdb ("drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega") Acked-by: Christian König Signed-off-by: Alex Deucher Cc: skhan@linuxfoundation.org Cc: stable@vger.kernel.org commit 2db96217e7e515071726ca4ec791742c4202a1b2 Author: Ye Bin Date: Wed Oct 19 11:36:02 2022 +0800 blktrace: remove unnessary stop block trace in 'blk_trace_shutdown' As previous commit, 'blk_trace_cleanup' will stop block trace if block trace's state is 'Blktrace_running'. So remove unnessary stop block trace in 'blk_trace_shutdown'. Signed-off-by: Ye Bin Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221019033602.752383-4-yebin@huaweicloud.com Signed-off-by: Jens Axboe commit dcd1a59c62dc49da75539213611156d6db50ab5d Author: Ye Bin Date: Wed Oct 19 11:36:01 2022 +0800 blktrace: fix possible memleak in '__blk_trace_remove' When test as follows: step1: ioctl(sda, BLKTRACESETUP, &arg) step2: ioctl(sda, BLKTRACESTART, NULL) step3: ioctl(sda, BLKTRACETEARDOWN, NULL) step4: ioctl(sda, BLKTRACESETUP, &arg) Got issue as follows: debugfs: File 'dropped' in directory 'sda' already present! debugfs: File 'msg' in directory 'sda' already present! debugfs: File 'trace0' in directory 'sda' already present! And also find syzkaller report issue like "KASAN: use-after-free Read in relay_switch_subbuf" "https://syzkaller.appspot.com/bug?id=13849f0d9b1b818b087341691be6cc3ac6a6bfb7" If remove block trace without stop(BLKTRACESTOP) block trace, '__blk_trace_remove' will just set 'q->blk_trace' with NULL. However, debugfs file isn't removed, so will report file already present when call BLKTRACESETUP. static int __blk_trace_remove(struct request_queue *q) { struct blk_trace *bt; bt = rcu_replace_pointer(q->blk_trace, NULL, lockdep_is_held(&q->debugfs_mutex)); if (!bt) return -EINVAL; if (bt->trace_state != Blktrace_running) blk_trace_cleanup(q, bt); return 0; } If do test as follows: step1: ioctl(sda, BLKTRACESETUP, &arg) step2: ioctl(sda, BLKTRACESTART, NULL) step3: ioctl(sda, BLKTRACETEARDOWN, NULL) step4: remove sda There will remove debugfs directory which will remove recursively all file under directory. >> blk_release_queue >> debugfs_remove_recursive(q->debugfs_dir) So all files which created in 'do_blk_trace_setup' are removed, and 'dentry->d_inode' is NULL. But 'q->blk_trace' is still in 'running_trace_lock', 'trace_note_tsk' will traverse 'running_trace_lock' all nodes. >>trace_note_tsk >> trace_note >> relay_reserve >> relay_switch_subbuf >> d_inode(buf->dentry)->i_size To solve above issues, reference commit '5afedf670caf', call 'blk_trace_cleanup' unconditionally in '__blk_trace_remove' and first stop block trace in 'blk_trace_cleanup'. Signed-off-by: Ye Bin Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221019033602.752383-3-yebin@huaweicloud.com Signed-off-by: Jens Axboe commit 60a9bb9048f9e95029df10a9bc346f6b066c593c Author: Ye Bin Date: Wed Oct 19 11:36:00 2022 +0800 blktrace: introduce 'blk_trace_{start,stop}' helper Introduce 'blk_trace_{start,stop}' helper. No functional changed. Signed-off-by: Ye Bin Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221019033602.752383-2-yebin@huaweicloud.com Signed-off-by: Jens Axboe commit d4347d50407daea6237872281ece64c4bdf1ec99 Author: Pavel Begunkov Date: Tue Oct 18 20:50:55 2022 +0100 bio: safeguard REQ_ALLOC_CACHE bio put bio_put() with REQ_ALLOC_CACHE assumes that it's executed not from an irq context. Let's add a warning if the invariant is not respected, especially since there is a couple of places removing REQ_POLLED by hand without also clearing REQ_ALLOC_CACHE. Signed-off-by: Pavel Begunkov Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/558d78313476c4e9c233902efa0092644c3d420a.1666122465.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 996d3efeb091c503afd3ee6b5e20eabf446fd955 Author: Rafael Mendonca Date: Wed Oct 19 22:47:09 2022 -0300 io-wq: Fix memory leak in worker creation If the CPU mask allocation for a node fails, then the memory allocated for the 'io_wqe' struct of the current node doesn't get freed on the error handling path, since it has not yet been added to the 'wqes' array. This was spotted when fuzzing v6.1-rc1 with Syzkaller: BUG: memory leak unreferenced object 0xffff8880093d5000 (size 1024): comm "syz-executor.2", pid 7701, jiffies 4295048595 (age 13.900s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000cb463369>] __kmem_cache_alloc_node+0x18e/0x720 [<00000000147a3f9c>] kmalloc_node_trace+0x2a/0x130 [<000000004e107011>] io_wq_create+0x7b9/0xdc0 [<00000000c38b2018>] io_uring_alloc_task_context+0x31e/0x59d [<00000000867399da>] __io_uring_add_tctx_node.cold+0x19/0x1ba [<000000007e0e7a79>] io_uring_setup.cold+0x1b80/0x1dce [<00000000b545e9f6>] __x64_sys_io_uring_setup+0x5d/0x80 [<000000008a8a7508>] do_syscall_64+0x5d/0x90 [<000000004ac08bec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 0e03496d1967 ("io-wq: use private CPU mask") Cc: stable@vger.kernel.org Signed-off-by: Rafael Mendonca Link: https://lore.kernel.org/r/20221020014710.902201-1-rafaelmendsr@gmail.com Signed-off-by: Jens Axboe commit 33566f92cd5f1c1d462920978f6dc102c744270d Author: Yuwei Guan Date: Tue Oct 18 11:01:39 2022 +0800 block, bfq: remove unused variable for bfq_queue it defined in d0edc2473be9d, but there's nowhere to use it, so remove it. Signed-off-by: Yuwei Guan Acked-by: Paolo Valente Link: https://lore.kernel.org/r/20221018030139.159-1-Yuwei.Guan@zeekrlife.com Signed-off-by: Jens Axboe commit 6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5 Author: Christoph Böhmwalder Date: Thu Oct 20 10:52:05 2022 +0200 drbd: only clone bio if we have a backing device Commit c347a787e34cb (drbd: set ->bi_bdev in drbd_req_new) moved a bio_set_dev call (which has since been removed) to "earlier", from drbd_request_prepare to drbd_req_new. The problem is that this accesses device->ldev->backing_bdev, which is not NULL-checked at this point. When we don't have an ldev (i.e. when the DRBD device is diskless), this leads to a null pointer deref. So, only allocate the private_bio if we actually have a disk. This is also a small optimization, since we don't clone the bio to only to immediately free it again in the diskless case. Fixes: c347a787e34cb ("drbd: set ->bi_bdev in drbd_req_new") Co-developed-by: Christoph Böhmwalder Signed-off-by: Christoph Böhmwalder Co-developed-by: Joel Colledge Signed-off-by: Joel Colledge Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221020085205.129090-1-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit 70ee4a4c97d7332519b2072ead0ef9f65ea43662 Merge: 72495b5ab456e 94f5a06884074 Author: Jens Axboe Date: Thu Oct 20 05:43:58 2022 -0700 Merge tag 'nvme-6.1-2022-10-22' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - fix nvme-hwmon for DMA non-cohehrent architectures (Serge Semin) - add a nvme-hwmong maintainer (Christoph Hellwig) - fix error pointer dereference in error handling (Dan Carpenter) - fix invalid memory reference in nvmet_subsys_attr_qid_max_show (Daniel Wagner) - don't limit the DMA segment size in nvme-apple (Russell King) - fix workqueue MEM_RECLAIM flushing dependency (Sagi Grimberg) - disable write zeroes on various Kingston SSDs (Xander Li)" * tag 'nvme-6.1-2022-10-22' of git://git.infradead.org/nvme: nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show nvmet: fix workqueue MEM_RECLAIM flushing dependency nvme-hwmon: kmalloc the NVME SMART log buffer nvme-hwmon: consistently ignore errors from nvme_hwmon_init nvme: add Guenther as nvme-hwmon maintainer nvme-apple: don't limit DMA segement size nvme-pci: disable write zeroes on various Kingston SSD nvme: fix error pointer dereference in error handling commit 4881bda5ea05c8c240fc8afeaa928e2bc43f61fa Author: Yang Yingliang Date: Wed Oct 19 17:30:25 2022 +0800 ALSA: ac97: fix possible memory leak in snd_ac97_dev_register() If device_register() fails in snd_ac97_dev_register(), it should call put_device() to give up reference, or the name allocated in dev_set_name() is leaked. Fixes: 0ca06a00e206 ("[ALSA] AC97 bus interface for ad-hoc drivers") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221019093025.1179475-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit 7d1aa08aff0621a595c1b42efb493c475eefeeb3 Author: Svyatoslav Ryhel Date: Wed Oct 19 09:12:01 2022 +0300 gpio: tegra: Convert to immutable irq chip Update the driver to use an immutable IRQ chip to fix this warning: "not an immutable chip, please consider fixing it!" Preserve per-chip labels by adding an ->irq_print_chip() callback. Tested-by: Svyatoslav Ryhel # TF201 T30 Tested-by: Robert Eckelmann # TF101 T20 Signed-off-by: Svyatoslav Ryhel Reviewed-by: Dmitry Osipenko Signed-off-by: Bartosz Golaszewski commit 72655fb942c1e3d9e71e48e87ee439abe52f3a90 Author: Steven Price Date: Mon Oct 17 11:46:02 2022 +0100 drm/panfrost: replace endian-specific types with native ones __le32 and __le64 types aren't portable and are not available on FreeBSD (which uses the same uAPI). Instead of attempting to always output little endian, just use native endianness in the dumps. Tools can detect the endianness in use by looking at the 'magic' field, but equally we don't expect big-endian to be used with Mali (there are no known implementations out there). Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7252 Fixes: 730c2bf4ad39 ("drm/panfrost: Add support for devcoredump") Reviewed-by: Alyssa Rosenzweig Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20221017104602.142992-3-steven.price@arm.com commit 7228d9d79248bd0c8af56a7667a88a875c674e0c Author: Steven Price Date: Mon Oct 17 11:46:01 2022 +0100 drm/panfrost: Remove type name from internal structs The two structs internal to struct panfrost_dump_object_header were named, but sadly that is incompatible with C++, causing an error: "an anonymous union may only have public non-static data members". However nothing refers to struct pan_reg_hdr and struct pan_bomap_hdr and there's no need to export these definitions, so lets drop them. This fixes the C++ build error with the minimum change in userspace API. Reported-by: Adrián Larumbe Fixes: 730c2bf4ad39 ("drm/panfrost: Add support for devcoredump") Reviewed-by: Alyssa Rosenzweig Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20221017104602.142992-2-steven.price@arm.com commit 91e8b74fe6381e083f8aa55217bb0562785ab398 Author: Jakob Unterwurzacher Date: Wed Oct 19 16:27:27 2022 +0200 arm64: dts: rockchip: lower rk3399-puma-haikou SD controller clock frequency CRC errors (code -84 EILSEQ) have been observed for some SanDisk Ultra A1 cards when running at 50MHz. Waveform analysis suggest that the level shifters that are used on the RK3399-Q7 module for voltage translation between 3.0 and 3.3V don't handle clock rates at or above 48MHz properly. Back off to 40MHz for some safety margin. Cc: stable@vger.kernel.org Fixes: 60fd9f72ce8a ("arm64: dts: rockchip: add Haikou baseboard with RK3399-Q7 SoM") Signed-off-by: Jakob Unterwurzacher Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20221019-upstream-puma-sd-40mhz-v1-0-754a76421518@theobroma-systems.com Signed-off-by: Heiko Stuebner commit a91e5e3e2216354e27ee6adf9cb2d5d9548cad8c Author: Maxime Ripard Date: Wed Oct 19 16:34:42 2022 +0200 drm/connector: Set DDC pointer in drmm_connector_init Commit 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") introduced the function drmm_connector_init() with a parameter for an optional ddc pointer to the i2c controller used to access the DDC bus. However, the underlying call to __drm_connector_init() was always setting it to NULL instead of passing the ddc argument around. This resulted in unexpected null pointer dereference on platforms expecting to get a DDC controller. Fixes: 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221019143442.1798964-1-maxime@cerno.tech Signed-off-by: Maxime Ripard commit 7089003304c67658caead22f841840fc4a26b198 Author: David Gow Date: Wed Oct 19 15:32:40 2022 +0800 drm: tests: Fix a buffer overflow in format_helper_test The xrgb2101010 format conversion test (unlike for other formats) does an endianness conversion on the results. However, it always converts TEST_BUF_SIZE 32-bit integers, which results in reading from (and writing to) more memory than in present in the result buffer. Instead, use the buffer size, divided by sizeof(u32). The issue could be reproduced with KASAN: ./tools/testing/kunit/kunit.py run --kunitconfig drivers/gpu/drm/tests \ --kconfig_add CONFIG_KASAN=y --kconfig_add CONFIG_KASAN_VMALLOC=y \ --kconfig_add CONFIG_KASAN_KUNIT_TEST=y \ drm_format_helper_test.*xrgb2101010 Reported-by: Linux Kernel Functional Testing Fixes: 453114319699 ("drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_xrgb2101010()") Signed-off-by: David Gow Reviewed-by: Maíra Canal Reviewed-by: Javier Martinez Canillas Reviewed-by: José Expósito Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20221019073239.3779180-1-davidgow@google.com commit 1aca5ce036e3499336d1a2ace3070f908381c055 Merge: 01f2cf53844b0 9abf2313adc1c Author: Thomas Zimmermann Date: Thu Oct 20 09:09:00 2022 +0200 Merge drm/drm-fixes into drm-misc-fixes Backmerging to get v6.1-rc1. Signed-off-by: Thomas Zimmermann commit 70281592bf3fb7a2a193dced4d4e58a9ee96aa6c Author: Uwe Kleine-König Date: Wed Oct 19 15:24:22 2022 +0200 fbdev: xilinxfb: Make xilinxfb_release() return void The function xilinxfb_release() returns zero unconditionally. Make it return void. There is no semantic change, the only effect is that it becomes obvious that the driver's .remove() callback always returns zero. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit a4f7fcd7023ba63bdfe82a054c4ceb636a55d155 Author: Jilin Yuan Date: Wed Oct 19 20:57:38 2022 +0800 fbdev: sisfb: fix repeated word in comment Signed-off-by: Jilin Yuan Signed-off-by: Helge Deller commit ccd30a476f8e864732de220bd50e6f372f5ebcab Author: Eric Biggers Date: Tue Oct 11 14:38:38 2022 -0700 fscrypt: fix keyring memory leak on mount failure Commit d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key") moved the keyring destruction from __put_super() to generic_shutdown_super() so that the filesystem's block device(s) are still available. Unfortunately, this causes a memory leak in the case where a mount is attempted with the test_dummy_encryption mount option, but the mount fails after the option has already been processed. To fix this, attempt the keyring destruction in both places. Reported-by: syzbot+104c2a89561289cec13e@syzkaller.appspotmail.com Fixes: d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key") Signed-off-by: Eric Biggers Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20221011213838.209879-1-ebiggers@kernel.org commit 7f378c03aa4952507521174fb0da7b24a9ad0be6 Author: Felix Riemann Date: Tue Oct 18 12:47:54 2022 +0200 net: phy: dp83822: disable MDI crossover status change interrupt If the cable is disconnected the PHY seems to toggle between MDI and MDI-X modes. With the MDI crossover status interrupt active this causes roughly 10 interrupts per second. As the crossover status isn't checked by the driver, the interrupt can be disabled to reduce the interrupt load. Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") Signed-off-by: Felix Riemann Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20221018104755.30025-1-svc.sw.rte.linux@sma.de Signed-off-by: Jakub Kicinski commit 72495b5ab456ec9f05d587238d1e2fa8e9ea63ec Author: Yushan Zhou Date: Tue Oct 18 18:01:32 2022 +0800 ublk_drv: use flexible-array member instead of zero-length array Eliminate the following coccicheck warning: ./drivers/block/ublk_drv.c:127:16-19: WARNING use flexible-array member instead Signed-off-by: Yushan Zhou Link: https://lore.kernel.org/r/20221018100132.355393-1-zys.zljxml@gmail.com Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit ebda44da44f6f309d302522b049f43d6f829f7aa Author: Eric Dumazet Date: Tue Oct 18 20:32:58 2022 +0000 net: sched: fix race condition in qdisc_graft() We had one syzbot report [1] in syzbot queue for a while. I was waiting for more occurrences and/or a repro but Dmitry Vyukov spotted the issue right away. qdisc_graft() drops reference to qdisc in notify_and_destroy while it's still assigned to dev->qdisc Indeed, RCU rules are clear when replacing a data structure. The visible pointer (dev->qdisc in this case) must be updated to the new object _before_ RCU grace period is started (qdisc_put(old) in this case). [1] BUG: KASAN: use-after-free in __tcf_qdisc_find.part.0+0xa3a/0xac0 net/sched/cls_api.c:1066 Read of size 4 at addr ffff88802065e038 by task syz-executor.4/21027 CPU: 0 PID: 21027 Comm: syz-executor.4 Not tainted 6.0.0-rc3-syzkaller-00363-g7726d4c3e60b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __tcf_qdisc_find.part.0+0xa3a/0xac0 net/sched/cls_api.c:1066 __tcf_qdisc_find net/sched/cls_api.c:1051 [inline] tc_new_tfilter+0x34f/0x2200 net/sched/cls_api.c:2018 rtnetlink_rcv_msg+0x955/0xca0 net/core/rtnetlink.c:6081 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5efaa89279 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5efbc31168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5efab9bf80 RCX: 00007f5efaa89279 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000005 RBP: 00007f5efaae32e9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5efb0cfb1f R14: 00007f5efbc31300 R15: 0000000000022000 Allocated by task 21027: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_node include/linux/slab.h:623 [inline] kzalloc_node include/linux/slab.h:744 [inline] qdisc_alloc+0xb0/0xc50 net/sched/sch_generic.c:938 qdisc_create_dflt+0x71/0x4a0 net/sched/sch_generic.c:997 attach_one_default_qdisc net/sched/sch_generic.c:1152 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2437 [inline] attach_default_qdiscs net/sched/sch_generic.c:1170 [inline] dev_activate+0x760/0xcd0 net/sched/sch_generic.c:1229 __dev_open+0x393/0x4d0 net/core/dev.c:1441 __dev_change_flags+0x583/0x750 net/core/dev.c:8556 rtnl_configure_link+0xee/0x240 net/core/rtnetlink.c:3189 rtnl_newlink_create net/core/rtnetlink.c:3371 [inline] __rtnl_newlink+0x10b8/0x17e0 net/core/rtnetlink.c:3580 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6090 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 21020: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kfree+0xe2/0x580 mm/slub.c:4562 rcu_do_batch kernel/rcu/tree.c:2245 [inline] rcu_core+0x7b5/0x1890 kernel/rcu/tree.c:2505 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:2793 qdisc_put+0xcd/0xe0 net/sched/sch_generic.c:1083 notify_and_destroy net/sched/sch_api.c:1012 [inline] qdisc_graft+0xeb1/0x1270 net/sched/sch_api.c:1084 tc_modify_qdisc+0xbb7/0x1a00 net/sched/sch_api.c:1671 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6090 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x940 kernel/rcu/tree.c:3322 neigh_destroy+0x431/0x630 net/core/neighbour.c:912 neigh_release include/net/neighbour.h:454 [inline] neigh_cleanup_and_release+0x1f8/0x330 net/core/neighbour.c:103 neigh_del net/core/neighbour.c:225 [inline] neigh_remove_one+0x37d/0x460 net/core/neighbour.c:246 neigh_forced_gc net/core/neighbour.c:276 [inline] neigh_alloc net/core/neighbour.c:447 [inline] ___neigh_create+0x18b5/0x29a0 net/core/neighbour.c:642 ip6_finish_output2+0xfb8/0x1520 net/ipv6/ip6_output.c:125 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x690/0x1160 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1ed/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] mld_sendpack+0xa09/0xe70 net/ipv6/mcast.c:1820 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x71c/0xdc0 net/ipv6/mcast.c:2653 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88802065e000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 56 bytes inside of 1024-byte region [ffff88802065e000, ffff88802065e400) The buggy address belongs to the physical page: page:ffffea0000819600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20658 head:ffffea0000819600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011841dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3523, tgid 3523 (sshd), ts 41495190986, free_ts 41417713212 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node_track_caller+0x2f2/0x380 mm/slub.c:4955 kmalloc_reserve net/core/skbuff.c:358 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:430 alloc_skb_fclone include/linux/skbuff.h:1307 [inline] tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:861 tcp_sendmsg_locked+0xc36/0x2f80 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1483 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_write+0x1e8/0x250 fs/read_write.c:631 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2548 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x267/0x3b0 mm/slub.c:3268 kmem_cache_zalloc include/linux/slab.h:723 [inline] alloc_buffer_head+0x20/0x140 fs/buffer.c:2974 alloc_page_buffers+0x280/0x790 fs/buffer.c:829 create_empty_buffers+0x2c/0xee0 fs/buffer.c:1558 ext4_block_write_begin+0x1004/0x1530 fs/ext4/inode.c:1074 ext4_da_write_begin+0x422/0xae0 fs/ext4/inode.c:2996 generic_perform_write+0x246/0x560 mm/filemap.c:3738 ext4_buffered_write_iter+0x15b/0x460 fs/ext4/file.c:270 ext4_file_write_iter+0x44a/0x1660 fs/ext4/file.c:679 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 Fixes: af356afa010f ("net_sched: reintroduce dev->qdisc for use by sch_api") Reported-by: syzbot Diagnosed-by: Dmitry Vyukov Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20221018203258.2793282-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit ff2f5ec5d009844ec28f171123f9e58750cef4bf Author: Yang Yingliang Date: Tue Oct 18 20:24:51 2022 +0800 net: hns: fix possible memory leak in hnae_ae_register() Inject fault while probing module, if device_register() fails, but the refcount of kobject is not decreased to 0, the name allocated in dev_set_name() is leaked. Fix this by calling put_device(), so that name can be freed in callback function kobject_cleanup(). unreferenced object 0xffff00c01aba2100 (size 128): comm "systemd-udevd", pid 1259, jiffies 4294903284 (age 294.152s) hex dump (first 32 bytes): 68 6e 61 65 30 00 00 00 18 21 ba 1a c0 00 ff ff hnae0....!...... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000034783f26>] slab_post_alloc_hook+0xa0/0x3e0 [<00000000748188f2>] __kmem_cache_alloc_node+0x164/0x2b0 [<00000000ab0743e8>] __kmalloc_node_track_caller+0x6c/0x390 [<000000006c0ffb13>] kvasprintf+0x8c/0x118 [<00000000fa27bfe1>] kvasprintf_const+0x60/0xc8 [<0000000083e10ed7>] kobject_set_name_vargs+0x3c/0xc0 [<000000000b87affc>] dev_set_name+0x7c/0xa0 [<000000003fd8fe26>] hnae_ae_register+0xcc/0x190 [hnae] [<00000000fe97edc9>] hns_dsaf_ae_init+0x9c/0x108 [hns_dsaf] [<00000000c36ff1eb>] hns_dsaf_probe+0x548/0x748 [hns_dsaf] Fixes: 6fe6611ff275 ("net: add Hisilicon Network Subsystem hnae framework support") Signed-off-by: Yang Yingliang Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20221018122451.1749171-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 258ad2fe5ede773625adfda88b173f4123e59f45 Author: Yang Yingliang Date: Tue Oct 18 21:16:07 2022 +0800 wwan_hwsim: fix possible memory leak in wwan_hwsim_dev_new() Inject fault while probing module, if device_register() fails, but the refcount of kobject is not decreased to 0, the name allocated in dev_set_name() is leaked. Fix this by calling put_device(), so that name can be freed in callback function kobject_cleanup(). unreferenced object 0xffff88810152ad20 (size 8): comm "modprobe", pid 252, jiffies 4294849206 (age 22.713s) hex dump (first 8 bytes): 68 77 73 69 6d 30 00 ff hwsim0.. backtrace: [<000000009c3504ed>] __kmalloc_node_track_caller+0x44/0x1b0 [<00000000c0228a5e>] kvasprintf+0xb5/0x140 [<00000000cff8c21f>] kvasprintf_const+0x55/0x180 [<0000000055a1e073>] kobject_set_name_vargs+0x56/0x150 [<000000000a80b139>] dev_set_name+0xab/0xe0 Fixes: f36a111a74e7 ("wwan_hwsim: WWAN device simulator") Signed-off-by: Yang Yingliang Reviewed-by: Loic Poulain Acked-by: Sergey Ryazanov Link: https://lore.kernel.org/r/20221018131607.1901641-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit c2bf23e4a5af37a4d77901d9ff14c50a269f143d Author: Pieter Jansen van Vuuren Date: Tue Oct 18 10:28:41 2022 +0100 sfc: include vport_id in filter spec hash and equal() Filters on different vports are qualified by different implicit MACs and/or VLANs, so shouldn't be considered equal even if their other match fields are identical. Fixes: 7c460d9be610 ("sfc: Extend and abstract efx_filter_spec to cover Huntington/EF10") Co-developed-by: Edward Cree Signed-off-by: Edward Cree Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Martin Habets Link: https://lore.kernel.org/r/20221018092841.32206-1-pieter.jansen-van-vuuren@amd.com Signed-off-by: Jakub Kicinski commit 883babd43dcf8b44db36d015a08cbf0066a5270d Author: Chris Morgan Date: Mon Oct 10 09:13:29 2022 -0500 power: supply: rk817: Change rk817_chg_cur_to_reg to int Change return value of rk817_chg_cur_to_reg from u8 to int. If the function fails to find a suitable value it returns a -EINVAL, but defined as a u8 it would not return correctly. Additionally, change defined variable that stores return value from u8 to int. Fixes: 11cb8da0189b ("power: supply: Add charger driver for Rockchip RK817") Signed-off-by: Chris Morgan Reported-by: Dan Carpenter Signed-off-by: Sebastian Reichel commit 172c65e673cc3998059c9dfb3faf48e72e6fc236 Author: Dan Carpenter Date: Sat Oct 15 11:26:37 2022 +0300 power: supply: rk817: check correct variable This code checks "->chg_ps" twice when it was supposed to check "->bat_ps". Fixes: 11cb8da0189b ("power: supply: Add charger driver for Rockchip RK817") Signed-off-by: Dan Carpenter Signed-off-by: Sebastian Reichel commit 73b1b8d25e39a1478b3792a7075f43e053ee62c2 Author: Steve French Date: Wed Oct 19 00:30:04 2022 -0500 cifs: update internal module number To 2.40 Signed-off-by: Steve French commit 01f2ee7e325611524078009d70392a5d5eca0945 Author: Paulo Alcantara Date: Wed Oct 19 11:25:37 2022 -0300 cifs: fix memory leaks in session setup We were only zeroing out the ntlmssp blob but forgot to free the allocated buffer in the end of SMB2_sess_auth_rawntlmssp_negotiate() and SMB2_sess_auth_rawntlmssp_authenticate() functions. This fixes below kmemleak reports: unreferenced object 0xffff88800ddcfc60 (size 96): comm "mount.cifs", pid 758, jiffies 4294696066 (age 42.967s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d0beeb29>] __kmalloc+0x39/0xa0 [<00000000e3834047>] build_ntlmssp_smb3_negotiate_blob+0x2c/0x110 [cifs] [<00000000e85f5ab2>] SMB2_sess_auth_rawntlmssp_negotiate+0xd3/0x230 [cifs] [<0000000080fdb897>] SMB2_sess_setup+0x16c/0x2a0 [cifs] [<000000009af320a8>] cifs_setup_session+0x13b/0x370 [cifs] [<00000000f15d5982>] cifs_get_smb_ses+0x643/0xb90 [cifs] [<00000000fe15eb90>] mount_get_conns+0x63/0x3e0 [cifs] [<00000000768aba03>] mount_get_dfs_conns+0x16/0xa0 [cifs] [<00000000cf1cf146>] cifs_mount+0x1c2/0x9a0 [cifs] [<000000000d66b51e>] cifs_smb3_do_mount+0x10e/0x710 [cifs] [<0000000077a996c5>] smb3_get_tree+0xf4/0x200 [cifs] [<0000000094dbd041>] vfs_get_tree+0x23/0xc0 [<000000003a8561de>] path_mount+0x2d3/0xb50 [<00000000ed5c86d6>] __x64_sys_mount+0x102/0x140 [<00000000142142f3>] do_syscall_64+0x3b/0x90 [<00000000e2b89731>] entry_SYSCALL_64_after_hwframe+0x63/0xcd unreferenced object 0xffff88801437f000 (size 512): comm "mount.cifs", pid 758, jiffies 4294696067 (age 42.970s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d0beeb29>] __kmalloc+0x39/0xa0 [<00000000004f53d2>] build_ntlmssp_auth_blob+0x4f/0x340 [cifs] [<000000005f333084>] SMB2_sess_auth_rawntlmssp_authenticate+0xd4/0x250 [cifs] [<0000000080fdb897>] SMB2_sess_setup+0x16c/0x2a0 [cifs] [<000000009af320a8>] cifs_setup_session+0x13b/0x370 [cifs] [<00000000f15d5982>] cifs_get_smb_ses+0x643/0xb90 [cifs] [<00000000fe15eb90>] mount_get_conns+0x63/0x3e0 [cifs] [<00000000768aba03>] mount_get_dfs_conns+0x16/0xa0 [cifs] [<00000000cf1cf146>] cifs_mount+0x1c2/0x9a0 [cifs] [<000000000d66b51e>] cifs_smb3_do_mount+0x10e/0x710 [cifs] [<0000000077a996c5>] smb3_get_tree+0xf4/0x200 [cifs] [<0000000094dbd041>] vfs_get_tree+0x23/0xc0 [<000000003a8561de>] path_mount+0x2d3/0xb50 [<00000000ed5c86d6>] __x64_sys_mount+0x102/0x140 [<00000000142142f3>] do_syscall_64+0x3b/0x90 [<00000000e2b89731>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: a4e430c8c8ba ("cifs: replace kfree() with kfree_sensitive() for sensitive data") Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 8e77860c62b6eac8bb5b567efe6b8cd232d5f72f Author: Ronnie Sahlberg Date: Tue Oct 18 17:39:10 2022 +1000 cifs: drop the lease for cached directories on rmdir or rename When we delete or rename a directory we must also drop any cached lease we have on the directory. Fixes: a350d6e73f5e ("cifs: enable caching of directories for which a lease is held") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit d753a0501996600e06e7df5f53959670835e91f2 Merge: a1a824f448ba9 96df8360dbb43 Author: Jakub Kicinski Date: Wed Oct 19 15:45:54 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Missing flowi uid field in nft_fib expression, from Guillaume Nault. This is broken since the creation of the fib expression. 2) Relax sanity check to fix bogus EINVAL error when deleting elements belonging set intervals. Broken since 6.0-rc. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces. ==================== Link: https://lore.kernel.org/r/20221019065225.1006344-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit e6aa4edd2f5b07fdc41de287876dd98c6e44322b Author: Kishon Vijay Abraham I Date: Wed Oct 19 12:02:33 2022 -0500 MAINTAINERS: Update Kishon's email address in PCI endpoint subsystem Update Kishon's email address in PCI endpoint subsystem maintainer entry and mark him as reviewer. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Bjorn Helgaas commit 091873e47ef700e935aa80079b63929af599a0b2 Author: Mickaël Salaün Date: Wed Oct 19 22:05:36 2022 +0200 selftests/landlock: Build without static libraries The only (forced) static test binary doesn't depend on libcap. Because using -lcap on systems that don't have such static library would fail (e.g. on Arch Linux), let's be more specific and require only dynamic libcap linking. Fixes: a52540522c95 ("selftests/landlock: Fix out-of-tree builds") Cc: Anders Roxell Cc: Guillaume Tucker Cc: Mark Brown Cc: Shuah Khan Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20221019200536.2771316-1-mic@digikod.net commit a1a824f448ba96c610b85288d844adc9f781828e Author: Jakub Kicinski Date: Tue Oct 18 16:13:10 2022 -0700 genetlink: fix kdoc warnings Address a bunch of kdoc warnings: include/net/genetlink.h:81: warning: Function parameter or member 'module' not described in 'genl_family' include/net/genetlink.h:243: warning: expecting prototype for struct genl_info. Prototype was for struct genl_dumpit_info instead include/net/genetlink.h:419: warning: Function parameter or member 'net' not described in 'genlmsg_unicast' include/net/genetlink.h:438: warning: expecting prototype for gennlmsg_data(). Prototype was for genlmsg_data() instead include/net/genetlink.h:244: warning: Function parameter or member 'op' not described in 'genl_dumpit_info' Link: https://lore.kernel.org/r/20221018231310.1040482-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 61775d54d674ff8ec3658495e0dbc537227dc5c1 Author: Bryan O'Donoghue Date: Tue Oct 18 03:19:20 2022 +0100 i2c: qcom-cci: Fix ordering of pm_runtime_xx and i2c_add_adapter When we compile-in the CCI along with the imx412 driver and run on the RB5 we see that i2c_add_adapter() causes the probe of the imx412 driver to happen. This probe tries to perform an i2c xfer() and the xfer() in i2c-qcom-cci.c fails on pm_runtime_get() because the i2c-qcom-cci.c::probe() function has not completed to pm_runtime_enable(dev). Fix this sequence by ensuring pm_runtime_xxx() calls happen prior to adding the i2c adapter. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Reported-by: Vladimir Zapolskiy Reviewed-by: Vladimir Zapolskiy Tested-by: Vladimir Zapolskiy Cc: Signed-off-by: Bryan O'Donoghue Reviewed-by: Robert Foss Signed-off-by: Wolfram Sang commit 16bbdfe5fb0e78e0acb13e45fc127e9a296913f2 Author: Harshit Mogalapalli Date: Wed Oct 19 10:12:18 2022 -0700 io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd() Syzkaller produced the below call trace: BUG: KASAN: null-ptr-deref in io_msg_ring+0x3cb/0x9f0 Write of size 8 at addr 0000000000000070 by task repro/16399 CPU: 0 PID: 16399 Comm: repro Not tainted 6.1.0-rc1 #28 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 Call Trace: dump_stack_lvl+0xcd/0x134 ? io_msg_ring+0x3cb/0x9f0 kasan_report+0xbc/0xf0 ? io_msg_ring+0x3cb/0x9f0 kasan_check_range+0x140/0x190 io_msg_ring+0x3cb/0x9f0 ? io_msg_ring_prep+0x300/0x300 io_issue_sqe+0x698/0xca0 io_submit_sqes+0x92f/0x1c30 __do_sys_io_uring_enter+0xae4/0x24b0 .... RIP: 0033:0x7f2eaf8f8289 RSP: 002b:00007fff40939718 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2eaf8f8289 RDX: 0000000000000000 RSI: 0000000000006f71 RDI: 0000000000000004 RBP: 00007fff409397a0 R08: 0000000000000000 R09: 0000000000000039 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004006d0 R13: 00007fff40939880 R14: 0000000000000000 R15: 0000000000000000 Kernel panic - not syncing: panic_on_warn set ... We don't have a NULL check on file_ptr in io_msg_send_fd() function, so when file_ptr is NUL src_file is also NULL and get_file() dereferences a NULL pointer and leads to above crash. Add a NULL check to fix this issue. Fixes: e6130eba8a84 ("io_uring: add support for passing fixed file descriptors") Reported-by: syzkaller Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20221019171218.1337614-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Jens Axboe commit b8caf0a0e04583fb71e21495bef84509182227ea Author: Martin Tůma Date: Tue Oct 18 16:03:37 2022 +0200 i2c: xiic: Add platform module alias The missing "platform" alias is required for the mgb4 v4l2 driver to load the i2c controller driver when probing the HW. Signed-off-by: Martin Tůma Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 64d23ff38ac9ea822c9810b60a616e39e2c2c82d Author: Robin Murphy Date: Tue Oct 18 14:14:04 2022 +0100 ACPI: scan: Fix DMA range assignment Assigning the device's dma_range_map from the iterator variable after the loop means it always points to the empty terminator at the end of the map, which is not what we want. Similarly, freeing the iterator on error when it points to somwhere in the middle of the allocated array won't work either. Fix this. Fixes: bf2ee8d0c385 ("ACPI: scan: Support multiple DMA windows with different offsets") Signed-off-by: Robin Murphy Reviewed-by: Jianmin Lv Tested-by: Jeremy Linton Tested-by: Yicong Yang Reviewed-by: Lorenzo Pieralisi Signed-off-by: Rafael J. Wysocki commit 82ebbe65d781064cfb0a6a8af221a9cebcaaac9e Author: Manank Patel Date: Thu Oct 13 15:22:58 2022 +0530 drivers: watchdog: exar_wdt.c fix use after free fix use after free by storing the result of PTR_ERR(n->pdev) to a local variable before returning. Signed-off-by: Manank Patel Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20221013095258.1424967-1-pmanank200502@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 097a4a1612389c31d2c4b95dfa816b91212d7f54 Author: Jiangshan Yi Date: Sun Oct 9 16:39:44 2022 +0800 watchdog: sp805_wdt: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20221009083944.2988237-1-13667453960@163.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 05de5cf6fb7d73d2bf0a0c882433f31db5c93f63 Author: Pierre-Louis Bossart Date: Wed Oct 19 10:49:26 2022 -0500 ASoC: SOF: Intel: pci-tgl: fix ADL-N descriptor ADL-N uses a different signing key, which means we can't reuse the regular ADL descriptor used for ADL-P/M/S. Fixes: cd57eb3c403cb ("ASoC: SOF: Intel: pci-tgl: add ADL-N support") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20221019154926.163539-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit aa23d45eeb3497bb89f112b407fcc6d21210010f Author: Kishon Vijay Abraham I Date: Wed Sep 28 15:01:05 2022 +0530 MAINTAINERS: Add Vignesh Raghavendra as maintainer of TI DRA7XX/J721E PCI driver Add Vignesh Raghavendra as maintainer of TI DRA7XX/J721E PCI driver. Link: https://lore.kernel.org/r/20220928093105.23073-1-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Bjorn Helgaas commit 1dd5166102e7ca91e8c5d833110333835e147ddb Author: Srinivasa Rao Mandadapu Date: Sat Oct 15 14:48:50 2022 +0530 ASoC: qcom: lpass-cpu: Mark HDMI TX parity register as volatile Update LPASS_HDMI_TX_PARITY_ADDR register as volatile, to fix dp audio failures observed with some of external monitors. Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver") Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1665825530-7593-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit a450b5c8739248069e11f72129fca61a56125577 Author: linkt Date: Tue Oct 11 10:51:36 2022 +0800 ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List Lenovo ThinkBook 14 Gen 4+ ARA and ThinkBook 16 Gen 4+ ARA need to be added to the list of quirks for the microphone to work properly. Signed-off-by: linkt Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/MEYPR01MB8397A3C27DE6206FA3EF834DB6239@MEYPR01MB8397.ausprd01.prod.outlook.com Signed-off-by: Mark Brown commit 008f05a72d32dcc14038801649ec67af765fcc3c Merge: 32def55d237e8 df496157a5afa Author: Mark Brown Date: Wed Oct 19 16:37:01 2022 +0100 ASoC: jz4752b: Capture fixes Merge series from Siarhei Volkau : The patchset fixes: - Line In path stays powered off during capturing or bypass to mixer. - incorrectly represented dB values in alsamixer, et al. - incorrect represented Capture input selector in alsamixer in Playback tab. - wrong control selected as Capture Master commit 096bbeec7bd6fb683831a9ca4850a6b6a3f04740 Author: Steve French Date: Sat Oct 15 17:02:30 2022 -0500 smb3: interface count displayed incorrectly The "Server interfaces" count in /proc/fs/cifs/DebugData increases as the interfaces are requeried, rather than being reset to the new value. This could cause a problem if the server disabled multichannel as the iface_count is checked in try_adding_channels to see if multichannel still supported. Also fixes a coverity warning: Addresses-Coverity: 1526374 ("Concurrent data access violations (MISSING_LOCK)") Cc: Reviewed-by: Bharath SM Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit abe3c631447dcd1ba7af972fe6f054bee6f136fa Author: GONG, Ruiqi Date: Wed Oct 19 10:57:10 2022 +0800 selinux: enable use of both GFP_KERNEL and GFP_ATOMIC in convert_context() The following warning was triggered on a hardware environment: SELinux: Converting 162 SID table entries... BUG: sleeping function called from invalid context at __might_sleep+0x60/0x74 0x0 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 5943, name: tar CPU: 7 PID: 5943 Comm: tar Tainted: P O 5.10.0 #1 Call trace: dump_backtrace+0x0/0x1c8 show_stack+0x18/0x28 dump_stack+0xe8/0x15c ___might_sleep+0x168/0x17c __might_sleep+0x60/0x74 __kmalloc_track_caller+0xa0/0x7dc kstrdup+0x54/0xac convert_context+0x48/0x2e4 sidtab_context_to_sid+0x1c4/0x36c security_context_to_sid_core+0x168/0x238 security_context_to_sid_default+0x14/0x24 inode_doinit_use_xattr+0x164/0x1e4 inode_doinit_with_dentry+0x1c0/0x488 selinux_d_instantiate+0x20/0x34 security_d_instantiate+0x70/0xbc d_splice_alias+0x4c/0x3c0 ext4_lookup+0x1d8/0x200 [ext4] __lookup_slow+0x12c/0x1e4 walk_component+0x100/0x200 path_lookupat+0x88/0x118 filename_lookup+0x98/0x130 user_path_at_empty+0x48/0x60 vfs_statx+0x84/0x140 vfs_fstatat+0x20/0x30 __se_sys_newfstatat+0x30/0x74 __arm64_sys_newfstatat+0x1c/0x2c el0_svc_common.constprop.0+0x100/0x184 do_el0_svc+0x1c/0x2c el0_svc+0x20/0x34 el0_sync_handler+0x80/0x17c el0_sync+0x13c/0x140 SELinux: Context system_u:object_r:pssp_rsyslog_log_t:s0:c0 is not valid (left unmapped). It was found that within a critical section of spin_lock_irqsave in sidtab_context_to_sid(), convert_context() (hooked by sidtab_convert_params.func) might cause the process to sleep via allocating memory with GFP_KERNEL, which is problematic. As Ondrej pointed out [1], convert_context()/sidtab_convert_params.func has another caller sidtab_convert_tree(), which is okay with GFP_KERNEL. Therefore, fix this problem by adding a gfp_t argument for convert_context()/sidtab_convert_params.func and pass GFP_KERNEL/_ATOMIC properly in individual callers. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20221018120111.1474581-1-gongruiqi1@huawei.com/ [1] Reported-by: Tan Ninghao Fixes: ee1a84fdfeed ("selinux: overhaul sidtab to fix bug and improve performance") Signed-off-by: GONG, Ruiqi Reviewed-by: Ondrej Mosnacek [PM: wrap long BUG() output lines, tweak subject line] Signed-off-by: Paul Moore commit f8aa6c895d482847c9b799dcdac8bbdb56cb8e04 Author: Cédric Le Goater Date: Sun Oct 16 17:57:22 2022 +0200 spi: aspeed: Fix window offset of CE1 The offset value of the mapping window in the kernel structure is calculated using the value of the previous window offset. This doesn't reflect how the HW is configured and can lead to erroneous setting of the second flash device (CE1). Cc: Chin-Ting Kuo Fixes: e3228ed92893 ("spi: spi-mem: Convert Aspeed SMC driver to spi-mem") Signed-off-by: Cédric Le Goater Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20221016155722.3520802-1-clg@kaod.org Signed-off-by: Mark Brown commit 0ec8ce07394442d722806fe61b901a5b2b17249d Author: Fenghua Yu Date: Fri Oct 14 15:25:41 2022 -0700 dmaengine: idxd: Do not enable user type Work Queue without Shared Virtual Addressing When the idxd_user_drv driver is bound to a Work Queue (WQ) device without IOMMU or with IOMMU Passthrough without Shared Virtual Addressing (SVA), the application gains direct access to physical memory via the device by programming physical address to a submitted descriptor. This allows direct userspace read and write access to arbitrary physical memory. This is inconsistent with the security goals of a good kernel API. Unlike vfio_pci driver, the IDXD char device driver does not provide any ways to pin user pages and translate the address from user VA to IOVA or PA without IOMMU SVA. Therefore the application has no way to instruct the device to perform DMA function. This makes the char device not usable for normal application usage. Since user type WQ without SVA cannot be used for normal application usage and presents the security issue, bind idxd_user_drv driver and enable user type WQ only when SVA is enabled (i.e. user PASID is enabled). Fixes: 448c3de8ac83 ("dmaengine: idxd: create user driver for wq 'device'") Cc: stable@vger.kernel.org Suggested-by: Arjan Van De Ven Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20221014222541.3912195-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 5a637f83d96fc9f27e93385924e7253a5f5187bc Author: Amelie Delaunay Date: Mon Oct 17 15:14:13 2022 +0200 dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it New bool m2m_hw has been added at the end of stm32_mdma_chan_config struct to support the STM32 DMA MDMA chaining. m2m_hw is set true in stm32_mdma_slave_config() if peripheral_size is set, but m2m_hw is never initialized false. To ensure this case, and any further new update of the structure, memset it to 0 before using it. Fixes: 696874322771 ("dmaengine: stm32-mdma: add support to be triggered by STM32 DMA") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20221017131413.202567-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 6109ecbfd10475309d3e5a1a39bf167547da878e Merge: e38cf36695c94 fd602f5cb52e3 Author: David S. Miller Date: Wed Oct 19 14:04:36 2022 +0100 Merge branch 'qdisc-ingress-success' Paul Blakey says: ==================== net: Fix return value of qdisc ingress handling on success Fix patch + self-test with the currently broken scenario. v4->v3: Removed new line in self test and rebase (Paolo). v2->v3: Added DROP return to TC_ACT_SHOT case (Cong). v1->v2: Changed blamed commit Added self-test ==================== Signed-off-by: David S. Miller commit fd602f5cb52e336d8c06f8da2d80c76ce2905030 Author: Paul Blakey Date: Tue Oct 18 10:34:39 2022 +0300 selftests: add selftest for chaining of tc ingress handling to egress This test runs a simple ingress tc setup between two veth pairs, then adds a egress->ingress rule to test the chaining of tc ingress pipeline to tc egress piepline. Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit 672e97ef689a38cb20c2cc6a1814298fea34461e Author: Paul Blakey Date: Tue Oct 18 10:34:38 2022 +0300 net: Fix return value of qdisc ingress handling on success Currently qdisc ingress handling (sch_handle_ingress()) doesn't set a return value and it is left to the old return value of the caller (__netif_receive_skb_core()) which is RX drop, so if the packet is consumed, caller will stop and return this value as if the packet was dropped. This causes a problem in the kernel tcp stack when having a egress tc rule forwarding to a ingress tc rule. The tcp stack sending packets on the device having the egress rule will see the packets as not successfully transmitted (although they actually were), will not advance it's internal state of sent data, and packets returning on such tcp stream will be dropped by the tcp stack with reason ack-of-unsent-data. See reproduction in [0] below. Fix that by setting the return value to RX success if the packet was handled successfully. [0] Reproduction steps: $ ip link add veth1 type veth peer name peer1 $ ip link add veth2 type veth peer name peer2 $ ifconfig peer1 5.5.5.6/24 up $ ip netns add ns0 $ ip link set dev peer2 netns ns0 $ ip netns exec ns0 ifconfig peer2 5.5.5.5/24 up $ ifconfig veth2 0 up $ ifconfig veth1 0 up #ingress forwarding veth1 <-> veth2 $ tc qdisc add dev veth2 ingress $ tc qdisc add dev veth1 ingress $ tc filter add dev veth2 ingress prio 1 proto all flower \ action mirred egress redirect dev veth1 $ tc filter add dev veth1 ingress prio 1 proto all flower \ action mirred egress redirect dev veth2 #steal packet from peer1 egress to veth2 ingress, bypassing the veth pipe $ tc qdisc add dev peer1 clsact $ tc filter add dev peer1 egress prio 20 proto ip flower \ action mirred ingress redirect dev veth1 #run iperf and see connection not running $ iperf3 -s& $ ip netns exec ns0 iperf3 -c 5.5.5.6 -i 1 #delete egress rule, and run again, now should work $ tc filter del dev peer1 egress $ ip netns exec ns0 iperf3 -c 5.5.5.6 -i 1 Fixes: f697c3e8b35c ("[NET]: Avoid unnecessary cloning for ingress filtering") Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit df496157a5afa1b6d1f4c46ad6549c2c346d1e59 Author: Colin Ian King Date: Wed Oct 19 08:16:39 2022 +0100 ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route" There are two spelling mistakes in codec routing description. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Philippe Mathieu-Daudé Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/20221019071639.1003730-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit e38cf36695c9473f3d0a08bb9f27e33a8dc0ff53 Merge: 7b55c2ed2ba06 2a3fc78210b9f Author: David S. Miller Date: Wed Oct 19 13:47:09 2022 +0100 Merge branch 'qdisc-null-deref' Zhengchao Shao says: ==================== net: fix null pointer access issue in qdisc These three patches fix the same type of problem. Set the default qdisc, and then construct an init failure scenario when the dev qdisc is configured on mqprio to trigger the reset process. NULL pointer access may occur during the reset process. --- v2: for fq_codel, revert the patch --- ==================== Signed-off-by: David S. Miller commit 2a3fc78210b9f0e85372a2435368962009f480fc Author: Zhengchao Shao Date: Tue Oct 18 14:32:01 2022 +0800 net: sched: sfb: fix null pointer access issue when sfb_init() fails When the default qdisc is sfb, if the qdisc of dev_queue fails to be inited during mqprio_init(), sfb_reset() is invoked to clear resources. In this case, the q->qdisc is NULL, and it will cause gpf issue. The process is as follows: qdisc_create_dflt() sfb_init() tcf_block_get() --->failed, q->qdisc is NULL ... qdisc_put() ... sfb_reset() qdisc_reset(q->qdisc) --->q->qdisc is NULL ops = qdisc->ops The following is the Call Trace information: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] RIP: 0010:qdisc_reset+0x2b/0x6f0 Call Trace: sfb_reset+0x37/0xd0 qdisc_reset+0xed/0x6f0 qdisc_destroy+0x82/0x4c0 qdisc_put+0x9e/0xb0 qdisc_create_dflt+0x2c3/0x4a0 mqprio_init+0xa71/0x1760 qdisc_create+0x3eb/0x1000 tc_modify_qdisc+0x408/0x1720 rtnetlink_rcv_msg+0x38e/0xac0 netlink_rcv_skb+0x12d/0x3a0 netlink_unicast+0x4a2/0x740 netlink_sendmsg+0x826/0xcc0 sock_sendmsg+0xc5/0x100 ____sys_sendmsg+0x583/0x690 ___sys_sendmsg+0xe8/0x160 __sys_sendmsg+0xbf/0x160 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f2164122d04 Fixes: e13e02a3c68d ("net_sched: SFB flow scheduler") Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit f5ffa3b1197395501b72c10b35518bf58ef24475 Author: Zhengchao Shao Date: Tue Oct 18 14:32:00 2022 +0800 Revert "net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init()" This reverts commit 494f5063b86cd6e972cb41a27e083c9a3664319d. When the default qdisc is fq_codel, if the qdisc of dev_queue fails to be inited during mqprio_init(), fq_codel_reset() is invoked to clear resources. In this case, the flow is NULL, and it will cause gpf issue. The process is as follows: qdisc_create_dflt() fq_codel_init() ... q->flows_cnt = 1024; ... q->flows = kvcalloc(...) --->failed, q->flows is NULL ... qdisc_put() ... fq_codel_reset() ... flow = q->flows + i --->q->flows is NULL The following is the Call Trace information: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] RIP: 0010:fq_codel_reset+0x14d/0x350 Call Trace: qdisc_reset+0xed/0x6f0 qdisc_destroy+0x82/0x4c0 qdisc_put+0x9e/0xb0 qdisc_create_dflt+0x2c3/0x4a0 mqprio_init+0xa71/0x1760 qdisc_create+0x3eb/0x1000 tc_modify_qdisc+0x408/0x1720 rtnetlink_rcv_msg+0x38e/0xac0 netlink_rcv_skb+0x12d/0x3a0 netlink_unicast+0x4a2/0x740 netlink_sendmsg+0x826/0xcc0 sock_sendmsg+0xc5/0x100 ____sys_sendmsg+0x583/0x690 ___sys_sendmsg+0xe8/0x160 __sys_sendmsg+0xbf/0x160 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fd272b22d04 Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 51f9a8921ceacd7bf0d3f47fa867a64988ba1dcb Author: Zhengchao Shao Date: Tue Oct 18 14:31:59 2022 +0800 net: sched: cake: fix null pointer access issue when cake_init() fails When the default qdisc is cake, if the qdisc of dev_queue fails to be inited during mqprio_init(), cake_reset() is invoked to clear resources. In this case, the tins is NULL, and it will cause gpf issue. The process is as follows: qdisc_create_dflt() cake_init() q->tins = kvcalloc(...) --->failed, q->tins is NULL ... qdisc_put() ... cake_reset() ... cake_dequeue_one() b = &q->tins[...] --->q->tins is NULL The following is the Call Trace information: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:cake_dequeue_one+0xc9/0x3c0 Call Trace: cake_reset+0xb1/0x140 qdisc_reset+0xed/0x6f0 qdisc_destroy+0x82/0x4c0 qdisc_put+0x9e/0xb0 qdisc_create_dflt+0x2c3/0x4a0 mqprio_init+0xa71/0x1760 qdisc_create+0x3eb/0x1000 tc_modify_qdisc+0x408/0x1720 rtnetlink_rcv_msg+0x38e/0xac0 netlink_rcv_skb+0x12d/0x3a0 netlink_unicast+0x4a2/0x740 netlink_sendmsg+0x826/0xcc0 sock_sendmsg+0xc5/0x100 ____sys_sendmsg+0x583/0x690 ___sys_sendmsg+0xe8/0x160 __sys_sendmsg+0xbf/0x160 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f89e5122d04 Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc") Signed-off-by: Zhengchao Shao Acked-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 7b55c2ed2ba061b65fc51d7a18d37e017085997f Author: Manank Patel Date: Tue Oct 18 11:03:18 2022 +0530 ethernet: marvell: octeontx2 Fix resource not freed after malloc fix rxsc and txsc not getting freed before going out of scope Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Manank Patel Signed-off-by: David S. Miller commit 32def55d237e8507d4eb8442628fc2e59a899ea0 Author: Aidan MacDonald Date: Wed Oct 19 02:23:02 2022 +0100 ASoC: simple-card: Fix up checks for HW param fixups The "convert-xxx" properties only have an effect for DPCM DAI links. A DAI link is only created as DPCM if the device tree requires it; part of this involves checking for the use of "convert-xxx" properties. When the convert-sample-format property was added, the checks got out of sync. A DAI link that specified only convert-sample-format but did not pass any of the other DPCM checks would not go into DPCM mode and the convert-sample-format property would be silently ignored. Fix this by adding a function to do the "convert-xxx" property checks, instead of open-coding it in simple-card and audio-graph-card. And add "convert-sample-format" to the check function so that DAI links using it will be initialized correctly. Fixes: 047a05366f4b ("ASoC: simple-card-utils: Fixup DAI sample format") Acked-by: Kuninori Morimoto Signed-off-by: Aidan MacDonald Acked-by: Sameer Pujar Link: https://lore.kernel.org/r/20221019012302.633830-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown commit 75d8b1662ca5c20cf8365575222abaef18ff1f50 Author: Shuming Fan Date: Wed Oct 19 17:57:15 2022 +0800 ASoC: rt1308-sdw: add the default value of some registers The driver missed the default value of register 0xc070/0xc360. This patch adds that default value to avoid invalid register access when the device doesn't be enumerated yet. BugLink: https://github.com/thesofproject/linux/issues/3924 Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20221019095715.31082-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 00aaf8bfe0ee2b807b452df806d725e080d85404 Author: Shuming Fan Date: Wed Oct 19 17:57:31 2022 +0800 ASoC: rt1308-sdw: update the preset settings This patch updates the pad control and checks the hardware version to set the different preset settings. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20221019095731.31101-1-shumingf@realtek.com Signed-off-by: Mark Brown commit eb1d39260ee6477e2971f81cec18ba5f6583259d Author: Rafael J. Wysocki Date: Tue Oct 18 19:34:03 2022 +0200 ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() Commit 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()") failed to reference count the device returned by acpi_get_pci_dev() as expected by its callers which in some cases may cause device objects to be dropped prematurely. Add the missing get_device() to acpi_get_pci_dev(). Fixes: 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()") Reported-by: Ville Syrjälä Signed-off-by: Rafael J. Wysocki commit 01f2cf53844b01e691516b465df1b6ab01b03230 Author: Christian König Date: Fri Oct 7 10:59:58 2022 +0200 drm/amdgpu: use DRM_SCHED_FENCE_DONT_PIPELINE for VM updates Make sure that we always have a CPU round trip to let the submission code correctly decide if a TLB flush is necessary or not. Signed-off-by: Christian König Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2113#note_1579296 Reviewed-by: Alex Deucher Acked-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20221014081553.114899-2-christian.koenig@amd.com commit 94f5a06884074dcd99606d7b329e133ee65ea6ad Author: Daniel Wagner Date: Fri Oct 7 09:29:34 2022 +0200 nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show The item passed into nvmet_subsys_attr_qid_max_show is not a member of struct nvmet_port, it is part of nvmet_subsys. Hence, don't try to dereference it as struct nvme_ctrl pointer. Fixes: 3e980f5995e0 ("nvmet: Expose max queues to configfs") Reported-by: Shinichiro Kawasaki Link: https://lore.kernel.org/r/20220913064203.133536-1-dwagner@suse.de Signed-off-by: Daniel Wagner Reviewed-by: Hannes Reinecke Acked-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit ddd2b8de9f85b388925e7dc46b3890fc1a0d8d24 Author: Sagi Grimberg Date: Wed Sep 28 09:39:10 2022 +0300 nvmet: fix workqueue MEM_RECLAIM flushing dependency The keep alive timer needs to stay on nvmet_wq, and not modified to reschedule on the system_wq. This fixes a warning: ------------[ cut here ]------------ workqueue: WQ_MEM_RECLAIM nvmet-wq:nvmet_rdma_release_queue_work [nvmet_rdma] is flushing !WQ_MEM_RECLAIM events:nvmet_keep_alive_timer [nvmet] WARNING: CPU: 3 PID: 1086 at kernel/workqueue.c:2628 check_flush_dependency+0x16c/0x1e0 Reported-by: Yi Zhang Fixes: 8832cf922151 ("nvmet: use a private workqueue instead of the system workqueue") Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit c94b7f9bab22ac504f9153767676e659988575ad Author: Serge Semin Date: Tue Oct 18 17:33:52 2022 +0200 nvme-hwmon: kmalloc the NVME SMART log buffer Recent commit 52fde2c07da6 ("nvme: set dma alignment to dword") has caused a regression on our platform. It turned out that the nvme_get_log() method invocation caused the nvme_hwmon_data structure instance corruption. In particular the nvme_hwmon_data.ctrl pointer was overwritten either with zeros or with garbage. After some research we discovered that the problem happened even before the actual NVME DMA execution, but during the buffer mapping. Since our platform is DMA-noncoherent, the mapping implied the cache-line invalidations or write-backs depending on the DMA-direction parameter. In case of the NVME SMART log getting the DMA was performed from-device-to-memory, thus the cache-invalidation was activated during the buffer mapping. Since the log-buffer isn't cache-line aligned, the cache-invalidation caused the neighbour data to be discarded. The neighbouring data turned to be the data surrounding the buffer in the framework of the nvme_hwmon_data structure. In order to fix that we need to make sure that the whole log-buffer is defined within the cache-line-aligned memory region so the cache-invalidation procedure wouldn't involve the adjacent data. One of the option to guarantee that is to kmalloc the DMA-buffer [1]. Seeing the rest of the NVME core driver prefer that method it has been chosen to fix this problem too. Note after a deeper researches we found out that the denoted commit wasn't a root cause of the problem. It just revealed the invalidity by activating the DMA-based NVME SMART log getting performed in the framework of the NVME hwmon driver. The problem was here since the initial commit of the driver. [1] Documentation/core-api/dma-api-howto.rst Fixes: 400b6a7b13a3 ("nvme: Add hardware monitoring support") Signed-off-by: Serge Semin Signed-off-by: Christoph Hellwig commit 6b8cf94005187952f794c0c4ed3920a1e8accfa3 Author: Christoph Hellwig Date: Tue Oct 18 16:55:55 2022 +0200 nvme-hwmon: consistently ignore errors from nvme_hwmon_init An NVMe controller works perfectly fine even when the hwmon initialization fails. Stop returning errors that do not come from a controller reset from nvme_hwmon_init to handle this case consistently. Signed-off-by: Christoph Hellwig Reviewed-by: Guenter Roeck Reviewed-by: Serge Semin commit 7b476affcccfc7e644541a0a719f53fc7bd34c53 Author: Christian König Date: Fri Oct 7 09:51:13 2022 +0200 drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag Setting this flag on a scheduler fence prevents pipelining of jobs depending on this fence. In other words we always insert a full CPU round trip before dependent jobs are pushed to the pipeline. Signed-off-by: Christian König Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2113#note_1579296 Reviewed-by: Alex Deucher Acked-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20221014081553.114899-1-christian.koenig@amd.com commit 6ff5ba97960821fb872ad981eb30374f5cee1fd9 Author: Christoph Hellwig Date: Tue Oct 18 16:59:16 2022 +0200 nvme: add Guenther as nvme-hwmon maintainer Given that non of the overall NVMe maintainers knows this code very deeply it probably makes sense to add Guenther as an additional MAINTAINER for it. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Acked-by: Guenter Roeck commit 1498a5a79980fb86458297df2b4aaa9cc56503b3 Author: Krzysztof Kozlowski Date: Tue Oct 11 10:07:44 2022 -0400 dt-bindings: interconnect: qcom,msm8998-bwmon: Correct SC7280 CPU compatible Two different compatibles for SC7280 CPU BWMON instance were used in DTS and bindings. Correct the bindings to use the same one as in DTS, because it is more specific. Fixes: b7c84ae757c2 ("dt-bindings: interconnect: qcom,msm8998-bwmon: Add support for sc7280 BWMONs") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rajendra Nayak Acked-by: Rob Herring Link: https://lore.kernel.org/r/20221011140744.29829-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit d622f8477a8018974f8df961440dca58224f9c6b Author: Russell King (Oracle) Date: Wed Oct 12 12:46:06 2022 +0100 nvme-apple: don't limit DMA segement size NVMe uses PRPs for data transfers and has no specific limit for a single DMA segement. Limiting the size will cause problems because the block layer assumes PRP-ish devices using a virt boundary mask don't have a segment limit. And while this is true, we also really need to tell the DMA mapping layer about it, otherwise dma-debug will trip over it. Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Suggested-by: Sven Peter Signed-off-by: Russell King (Oracle) [hch: rewrote the commit message based on the PCIe commit] Signed-off-by: Christoph Hellwig Reviewed-by: Eric Curtin Reviewed-by: Sven Peter commit ac9b57d4e1e3ecf0122e915bbba1bd4c90ec3031 Author: Xander Li Date: Tue Oct 11 04:06:42 2022 -0700 nvme-pci: disable write zeroes on various Kingston SSD Kingston SSDs do support NVMe Write_Zeroes cmd but take long time to process. The firmware version is locked by these SSDs, we can not expect firmware improvement, so disable Write_Zeroes cmd. Signed-off-by: Xander Li Signed-off-by: Christoph Hellwig commit 4739824e2d7878dcea88397a6758e31e3c5c124e Author: Dan Carpenter Date: Sat Oct 15 11:25:56 2022 +0300 nvme: fix error pointer dereference in error handling There is typo here so it releases the wrong variable. "ctrl->admin_q" was intended instead of "ctrl->fabrics_q". Fixes: fe60e8c53411 ("nvme: add common helpers to allocate and free tagsets") Signed-off-by: Dan Carpenter Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 1afac08b39d85437187bb2a92d89a741b1078f55 Author: Dean Luick Date: Tue Oct 18 10:27:50 2022 -0400 IB/hfi1: Correctly move list in sc_disable() Commit 13bac861952a ("IB/hfi1: Fix abba locking issue with sc_disable()") incorrectly tries to move a list from one list head to another. The result is a kernel crash. The crash is triggered when a link goes down and there are waiters for a send to complete. The following signature is seen: BUG: kernel NULL pointer dereference, address: 0000000000000030 [...] Call Trace: sc_disable+0x1ba/0x240 [hfi1] pio_freeze+0x3d/0x60 [hfi1] handle_freeze+0x27/0x1b0 [hfi1] process_one_work+0x1b0/0x380 ? process_one_work+0x380/0x380 worker_thread+0x30/0x360 ? process_one_work+0x380/0x380 kthread+0xd7/0x100 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 The fix is to use the correct call to move the list. Fixes: 13bac861952a ("IB/hfi1: Fix abba locking issue with sc_disable()") Signed-off-by: Dean Luick Signed-off-by: Dennis Dalessandro Link: https://lore.kernel.org/r/166610327042.674422.6146908799669288976.stgit@awfm-02.cornelisnetworks.com Signed-off-by: Leon Romanovsky commit eb83f502adb036cd56c27e13b9ca3b2aabfa790b Author: Håkon Bugge Date: Wed Oct 12 16:15:42 2022 +0200 RDMA/cma: Use output interface for net_dev check Commit 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation") swapped the src and dst addresses in the call to validate_net_dev(). As a consequence, the test in validate_ipv4_net_dev() to see if the net_dev is the right one, is incorrect for port 1 <-> 2 communication when the ports are on the same sub-net. This is fixed by denoting the flowi4_oif as the device instead of the incoming one. The bug has not been observed using IPv6 addresses. Fixes: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation") Signed-off-by: Håkon Bugge Link: https://lore.kernel.org/r/20221012141542.16925-1-haakon.bugge@oracle.com Reviewed-by: Leon Romanovsky Signed-off-by: Leon Romanovsky commit 4b549ccce941798703f159b227aa28c716aa78fa Author: Christian Langrock Date: Mon Oct 17 08:34:47 2022 +0200 xfrm: replay: Fix ESN wrap around for GSO When using GSO it can happen that the wrong seq_hi is used for the last packets before the wrap around. This can lead to double usage of a sequence number. To avoid this, we should serialize this last GSO packet. Fixes: d7dbefc45cf5 ("xfrm: Add xfrm_replay_overflow functions for offloading") Co-developed-by: Steffen Klassert Signed-off-by: Christian Langrock Signed-off-by: Steffen Klassert commit 96df8360dbb435cc69f7c3c8db44bf8b1c24cd7b Author: Pablo Neira Ayuso Date: Mon Oct 17 14:12:58 2022 +0200 netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements Otherwise EINVAL is bogusly reported to userspace when deleting a set element. NFTA_SET_ELEM_KEY_END does not need to be set in case of: - insertion: if not present, start key is used as end key. - deletion: only start key needs to be specified, end key is ignored. Hence, relax the sanity check. Fixes: 88cccd908d51 ("netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags") Signed-off-by: Pablo Neira Ayuso commit 1fcc064b305a1aadeff0d4bff961094d27660acd Author: Guillaume Nault Date: Thu Oct 13 16:37:47 2022 +0200 netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces. Currently netfilter's rpfilter and fib modules implicitely initialise ->flowic_uid with 0. This is normally the root UID. However, this isn't the case in user namespaces, where user ID 0 is mapped to a different kernel UID. By initialising ->flowic_uid with sock_net_uid(), we get the root UID of the user namespace, thus keeping the same behaviour whether or not we're running in a user namepspace. Note, this is similar to commit 8bcfd0925ef1 ("ipv4: add missing initialization for flowi4_uid"), which fixed the rp_filter sysctl. Fixes: 622ec2c9d524 ("net: core: add UID to flows, rules, and routes") Signed-off-by: Guillaume Nault Signed-off-by: Pablo Neira Ayuso commit aa1d7e1267c12e07d979aa34c613716a89029db2 Author: Brett Creeley Date: Mon Oct 17 16:31:23 2022 -0700 ionic: catch NULL pointer issue on reconfig It's possible that the driver will dereference a qcq that doesn't exist when calling ionic_reconfigure_queues(), which causes a page fault BUG. If a reduction in the number of queues is followed by a different reconfig such as changing the ring size, the driver can hit a NULL pointer when trying to clean up non-existent queues. Fix this by checking to make sure both the qcqs array and qcq entry exists bofore trying to use and free the entry. Fixes: 101b40a0171f ("ionic: change queue count with no reset") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson Link: https://lore.kernel.org/r/20221017233123.15869-1-snelson@pensando.io Signed-off-by: Jakub Kicinski commit d8b57135fd9ffe9a5b445350a686442a531c5339 Author: Eric Dumazet Date: Mon Oct 17 16:59:28 2022 +0000 net: hsr: avoid possible NULL deref in skb_clone() syzbot got a crash [1] in skb_clone(), caused by a bug in hsr_get_untagged_frame(). When/if create_stripped_skb_hsr() returns NULL, we must not attempt to call skb_clone(). While we are at it, replace a WARN_ONCE() by netdev_warn_once(). [1] general protection fault, probably for non-canonical address 0xdffffc000000000f: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000078-0x000000000000007f] CPU: 1 PID: 754 Comm: syz-executor.0 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 RIP: 0010:skb_clone+0x108/0x3c0 net/core/skbuff.c:1641 Code: 93 02 00 00 49 83 7c 24 28 00 0f 85 e9 00 00 00 e8 5d 4a 29 fa 4c 8d 75 7e 48 b8 00 00 00 00 00 fc ff df 4c 89 f2 48 c1 ea 03 <0f> b6 04 02 4c 89 f2 83 e2 07 38 d0 7f 08 84 c0 0f 85 9e 01 00 00 RSP: 0018:ffffc90003ccf4e0 EFLAGS: 00010207 RAX: dffffc0000000000 RBX: ffffc90003ccf5f8 RCX: ffffc9000c24b000 RDX: 000000000000000f RSI: ffffffff8751cb13 RDI: 0000000000000000 RBP: 0000000000000000 R08: 00000000000000f0 R09: 0000000000000140 R10: fffffbfff181d972 R11: 0000000000000000 R12: ffff888161fc3640 R13: 0000000000000a20 R14: 000000000000007e R15: ffffffff8dc5f620 FS: 00007feb621e4700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007feb621e3ff8 CR3: 00000001643a9000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: hsr_get_untagged_frame+0x4e/0x610 net/hsr/hsr_forward.c:164 hsr_forward_do net/hsr/hsr_forward.c:461 [inline] hsr_forward_skb+0xcca/0x1d50 net/hsr/hsr_forward.c:623 hsr_handle_frame+0x588/0x7c0 net/hsr/hsr_slave.c:69 __netif_receive_skb_core+0x9fe/0x38f0 net/core/dev.c:5379 __netif_receive_skb_one_core+0xae/0x180 net/core/dev.c:5483 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5599 netif_receive_skb_internal net/core/dev.c:5685 [inline] netif_receive_skb+0x12f/0x8d0 net/core/dev.c:5744 tun_rx_batched+0x4ab/0x7a0 drivers/net/tun.c:1544 tun_get_user+0x2686/0x3a00 drivers/net/tun.c:1995 tun_chr_write_iter+0xdb/0x200 drivers/net/tun.c:2025 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:584 ksys_write+0x127/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: f266a683a480 ("net/hsr: Better frame dispatch") Reported-by: syzbot Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20221017165928.2150130-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit ba077d683d45190afc993c1ce45bcdbfda741a40 Author: Vikas Gupta Date: Mon Oct 17 11:32:22 2022 -0400 bnxt_en: fix memory leak in bnxt_nvm_test() Free the kzalloc'ed buffer before returning in the success path. Fixes: 5b6ff128fdf6 ("bnxt_en: implement callbacks for devlink selftests") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/1666020742-25834-1-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 8273b4048664fff356fd10059033f0e2f5a422a1 Author: Arunpravin Paneer Selvam Date: Tue Oct 18 07:08:38 2022 -0700 drm/amdgpu: Fix for BO move issue A user reported a bug on CAPE VERDE system where uvd_v3_1 IP component failed to initialize as there is an issue with BO move code from one memory to other. In function amdgpu_mem_visible() called by amdgpu_bo_move(), when there are no blocks to compare or if we have a single block then break the loop. Fixes: 312b4dc11d4f ("drm/amdgpu: Fix VRAM BO swap issue") Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2abe92c7adc9c0397ba51bf74909b85bc0fff84b Author: YuBiao Wang Date: Thu Oct 13 11:31:55 2022 +0800 drm/amdgpu: dequeue mes scheduler during fini [Why] If mes is not dequeued during fini, mes will be in an uncleaned state during reload, then mes couldn't receive some commands which leads to reload failure. [How] Perform MES dequeue via MMIO after all the unmap jobs are done by mes and before kiq fini. v2: Move the dequeue operation inside kiq_hw_fini. Signed-off-by: YuBiao Wang Reviewed-by: Jack Xiao Signed-off-by: Alex Deucher commit 5ce4726a1376bd0673d7b8edd243e76fbb4476d1 Author: Kenneth Feng Date: Fri Oct 14 15:19:51 2022 +0800 drm/amd/pm: enable thermal alert on smu_v13_0_10 enable thermal alert on smu_v13_0_10 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 97a3d6090f5c2a165dc88bda05c1dcf9f08bf886 Author: Yifan Zha Date: Wed Sep 7 14:13:02 2022 +0800 drm/amdgpu: Program GC registers through RLCG interface in gfx_v11/gmc_v11 [Why] L1 blocks most of GC registers accessing by MMIO. [How] Use RLCG interface to program GC registers under SRIOV VF in full access time. Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e688ba3e276422aa88eae7a54186a95320836081 Author: Nathan Chancellor Date: Mon Oct 17 09:28:38 2022 -0700 drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback When booting a kernel compiled with CONFIG_CFI_CLANG on a machine with an RX 6700 XT, there is a CFI failure in kfd_destroy_mqd_cp(): [ 12.894543] CFI failure at kfd_destroy_mqd_cp+0x2a/0x40 [amdgpu] (target: hqd_destroy_v10_3+0x0/0x260 [amdgpu]; expected type: 0x8594d794) Clang's kernel Control Flow Integrity (kCFI) makes sure that all indirect call targets have a type that exactly matches the function pointer prototype. In this case, hqd_destroy()'s third parameter, reset_type, should have a type of 'uint32_t' but every implementation of this callback has a third parameter type of 'enum kfd_preempt_type'. Update the function pointer prototype to match reality so that there is no more CFI violation. Link: https://github.com/ClangBuiltLinux/linux/issues/1738 Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit 8a70b2d89ea3f2dc1449f0634ca6befb41472f24 Author: Guenter Roeck Date: Thu Oct 13 11:25:23 2022 -0700 drm/amd/display: Increase frame size limit for display_mode_vba_util_32.o Building 32-bit images may fail with the following error. drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_util_32.c: In function ‘dml32_UseMinimumDCFCLK’: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_util_32.c:3142:1: error: the frame size of 1096 bytes is larger than 1024 bytes This is seen when building i386:allmodconfig with any of the following compilers. gcc (Debian 12.2.0-3) 12.2.0 gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 The problem is not seen if the compiler supports GCC_PLUGIN_LATENT_ENTROPY because in that case CONFIG_FRAME_WARN is already set to 2048 even for 32-bit builds. dml32_UseMinimumDCFCLK() was introduced with commit dda4fb85e433 ("drm/amd/display: DML changes for DCN32/321"). It declares a large number of local variables. Increase the frame size for the affected file to 2048, similar to other files in the same directory, to enable 32-bit build tests with affected compilers. Fixes: dda4fb85e433 ("drm/amd/display: DML changes for DCN32/321") Cc: Aurabindo Pillai Reported-by: Łukasz Bartosik Signed-off-by: Guenter Roeck Signed-off-by: Alex Deucher commit 31c261a7ffb8d5bba8144e2d43db304f2bc7e81a Author: Tim Huang Date: Thu Sep 29 15:06:47 2022 +0800 drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 The pmfw has changed the driver interface version, so keep same with the fw. Signed-off-by: Tim Huang Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher commit 853fdb49160e9c30674fd8e4a2eabc06bf70b13a Author: Tim Huang Date: Thu Sep 29 14:39:21 2022 +0800 drm/amd/pm: update SMU IP v13.0.4 driver interface version Update the SMU driver interface version to V7. Signed-off-by: Tim Huang Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher commit 5fa993737b29bffe931cc5d0feb87ebc34cd5bb3 Author: ZhenGuo Yin Date: Wed Oct 12 16:54:38 2022 +0800 drm/amd/pm: Init pm_attr_list when dpm is disabled [Why] In SRIOV multi-vf, dpm is always disabled, and pm_attr_list won't be initialized. There will be a NULL pointer call trace after removing the dpm check condition in amdgpu_pm_sysfs_fini. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:amdgpu_device_attr_remove_groups+0x20/0x90 [amdgpu] Call Trace: amdgpu_pm_sysfs_fini+0x2f/0x40 [amdgpu] amdgpu_device_fini_hw+0xdf/0x290 [amdgpu] [How] List pm_attr_list should be initialized when dpm is disabled. Fixes: a6ad27cec585fe ("drm/amd/pm: Remove redundant check condition") Signed-off-by: ZhenGuo Yin Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3059cd8c5f797ad83d2b194ae66339f5c007ca43 Author: Evan Quan Date: Thu Sep 29 10:50:44 2022 +0800 drm/amd/pm: disable cstate feature for gpu reset scenario Suggested by PMFW team and same as what did for gfxoff feature. This can address some Mode1Reset failures observed on SMU13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher commit ba2f09960e75accf757ed12b4ef61409dcc97df8 Author: Evan Quan Date: Thu Sep 29 10:30:01 2022 +0800 drm/amd/pm: fulfill SMU13.0.7 cstate control interface Fulfill the functionality for cstate control. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher commit 528c0e66e0c01a8c078d2d94431db80f9c75d2a0 Author: Evan Quan Date: Thu Sep 29 10:24:51 2022 +0800 drm/amd/pm: fulfill SMU13.0.0 cstate control interface Fulfill the functionality for cstate control. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher commit 3bd026c3e3317e4490595848261fe74d76e74126 Author: YiPeng Chai Date: Wed Sep 28 15:52:02 2022 +0800 drm/amdgpu: Add sriov vf ras support in amdgpu_ras_asic_supported V2: Add sriov vf ras support in amdgpu_ras_asic_supported. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 001ebcf5b903646b40697d9b1dc9b24daae82b4f Author: YiPeng Chai Date: Tue Sep 27 14:06:42 2022 +0800 drm/amdgpu: Enable ras support for mp0 v13_0_0 and v13_0_10 V1: Enable ras support for CHIP_IP_DISCOVERY asic type. V2: 1. Change commit comment. 2. Enable ras support for mp0 v13_0_0 and v13_0_10. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7cd3f6c3ace44ae9a9950a8c02ebcb8069278aab Author: YiPeng Chai Date: Tue Sep 27 13:16:27 2022 +0800 drm/amdgpu: Enable gmc soft reset on gmc_v11_0_3 Enable gmc soft reset on gmc_v11_0_3. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b7a76a29140810807fd85d15470d91b7992b6acf Author: Likun Gao Date: Mon Jul 25 20:02:40 2022 +0800 drm/amdgpu: skip mes self test for gc 11.0.3 Temporary disable mes self teset for gc 11.0.3. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f700486cd1f2bf381671d1c2c7dc9000db10c50e Author: Kenneth Feng Date: Mon Sep 26 17:15:04 2022 +0800 drm/amd/pm: skip loading pptable from driver on secure board for smu_v13_0_10 skip loading pptable from driver on secure board since it's loaded from psp. Signed-off-by: Kenneth Feng Reviewed-by: Guan Yu Signed-off-by: Alex Deucher commit 657e07221ce046132dd78f6e19c04b32a78b1d25 Author: Kenneth Feng Date: Wed Sep 7 17:05:34 2022 +0800 drm/amd/amdgpu: enable gfx clock gating features on smu_v13_0_10 enable gfx clock gating features on smu_v13_0_10 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 4c7f9a3c15344ccc682c77495fddea7dcb64027c Author: Kenneth Feng Date: Wed Sep 7 15:40:34 2022 +0800 drm/amd/pm: remove the pptable id override on smu_v13_0_10 remove the pptable id override on smu_v13_0_10, and the id is fetched from vbios now. Signed-off-by: Kenneth Feng Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 4d72a4e4fb5d870be52ce38e5672e4b71ee1162f Author: Kenneth Feng Date: Sat Jul 30 10:58:37 2022 +0800 drm/amd/pm: temporarily disable thermal alert on smu_v13_0_10 temporarily disable thermal alert on smu_v13_0_10 due to kfd test fail. will enable it again after confirming the thermal hardware setting. Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4545ae2ed3f2f7c3f615a53399c9c8460ee5bca7 Author: Asher Song Date: Fri Oct 14 11:36:33 2022 +0800 drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly" This reverts commit 16fb4dca95daa9d8e037201166a58de8284f4268. Unfortunately, that commit causes fan monitors can't be read and written properly. Fixes: 16fb4dca95daa9 ("drm/amdgpu: getting fan speed pwm for vega10 properly") Signed-off-by: Asher Song Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit a31e62873f11dff12cbeb8e6f864d0c8e5be0869 Author: Victor Zhao Date: Thu Oct 13 15:53:19 2022 +0800 drm/amdgpu: Refactor mode2 reset logic for v11.0.7 - refactor mode2 on v11.0.7 to align with aldebaran - comment out using mode2 reset as default for now, will introduce another controller to replace previous reset_level_mask v2: squash in unused variable removal (Alex) Signed-off-by: Victor Zhao Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit a340847b0214aa9b8fd9839f7b2822ccc607edab Author: Victor Zhao Date: Thu Oct 13 11:06:33 2022 +0800 Revert "drm/amdgpu: let mode2 reset fallback to default when failure" This reverts commit dac6b80818ac2353631c5a33d140d8d5508e2957. This commit reverted the AMDGPU_SKIP_MODE2_RESET as it conflicts with the original design of reset handler. Will redesign it. Fixes: dac6b80818ac23 ("drm/amdgpu: let mode2 reset fallback to default when failure") Signed-off-by: Victor Zhao Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit afbaa15501125ae0b7de9dd16c6f00c85de14218 Author: Victor Zhao Date: Thu Oct 13 10:42:04 2022 +0800 Revert "drm/amdgpu: add debugfs amdgpu_reset_level" This reverts commit 5bd8d53f6fa53eab5433698d1362dae2aa53c1cc. This commit breaks the reset logic for aldebaran, revert it for now. Will move the mask inside the reset handler. Fixes: 5bd8d53f6fa53e ("drm/amdgpu: add debugfs amdgpu_reset_level") Signed-off-by: Victor Zhao Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 65f8682b9aaae20c2cdee993e6fe52374ad513c9 Author: Danijel Slivka Date: Tue Oct 4 15:39:44 2022 +0200 drm/amdgpu: set vm_update_mode=0 as default for Sienna Cichlid in SRIOV case For asic with VF MMIO access protection avoid using CPU for VM table updates. CPU pagetable updates have issues with HDP flush as VF MMIO access protection blocks write to mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL register during sriov runtime. v3: introduce virtualization capability flag AMDGPU_VF_MMIO_ACCESS_PROTECT which indicates that VF MMIO write access is not allowed in sriov runtime Signed-off-by: Danijel Slivka Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a635beeacc6d56d2b71c39e6c0103f85b53d108e Author: Zheng Yejian Date: Mon Oct 17 10:38:06 2022 +0000 tracing/histogram: Update document for KEYS_MAX size After commit 4f36c2d85ced ("tracing: Increase tracing map KEYS_MAX size"), 'keys' supports up to three fields. Signed-off-by: Zheng Yejian Cc: stable@vger.kernel.org Acked-by: Masami Hiramatsu (Google) Link: https://lore.kernel.org/r/20221017103806.2479139-1-zhengyejian1@huawei.com Signed-off-by: Jonathan Corbet commit 97cf79677ecb50a38517253ae2fd705849a7e51a Author: Darrick J. Wong Date: Sun Oct 16 17:54:40 2022 -0700 xfs: avoid a UAF when log intent item recovery fails KASAN reported a UAF bug when I was running xfs/235: BUG: KASAN: use-after-free in xlog_recover_process_intents+0xa77/0xae0 [xfs] Read of size 8 at addr ffff88804391b360 by task mount/5680 CPU: 2 PID: 5680 Comm: mount Not tainted 6.0.0-xfsx #6.0.0 77e7b52a4943a975441e5ac90a5ad7748b7867f6 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0x2cc/0x682 kasan_report+0xa3/0x120 xlog_recover_process_intents+0xa77/0xae0 [xfs fb841c7180aad3f8359438576e27867f5795667e] xlog_recover_finish+0x7d/0x970 [xfs fb841c7180aad3f8359438576e27867f5795667e] xfs_log_mount_finish+0x2d7/0x5d0 [xfs fb841c7180aad3f8359438576e27867f5795667e] xfs_mountfs+0x11d4/0x1d10 [xfs fb841c7180aad3f8359438576e27867f5795667e] xfs_fs_fill_super+0x13d5/0x1a80 [xfs fb841c7180aad3f8359438576e27867f5795667e] get_tree_bdev+0x3da/0x6e0 vfs_get_tree+0x7d/0x240 path_mount+0xdd3/0x17d0 __x64_sys_mount+0x1fa/0x270 do_syscall_64+0x2b/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7ff5bc069eae Code: 48 8b 0d 85 1f 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 52 1f 0f 00 f7 d8 64 89 01 48 RSP: 002b:00007ffe433fd448 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff5bc069eae RDX: 00005575d7213290 RSI: 00005575d72132d0 RDI: 00005575d72132b0 RBP: 00005575d7212fd0 R08: 00005575d7213230 R09: 00005575d7213fe0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00005575d7213290 R14: 00005575d72132b0 R15: 00005575d7212fd0 Allocated by task 5680: kasan_save_stack+0x1e/0x40 __kasan_slab_alloc+0x66/0x80 kmem_cache_alloc+0x152/0x320 xfs_rui_init+0x17a/0x1b0 [xfs] xlog_recover_rui_commit_pass2+0xb9/0x2e0 [xfs] xlog_recover_items_pass2+0xe9/0x220 [xfs] xlog_recover_commit_trans+0x673/0x900 [xfs] xlog_recovery_process_trans+0xbe/0x130 [xfs] xlog_recover_process_data+0x103/0x2a0 [xfs] xlog_do_recovery_pass+0x548/0xc60 [xfs] xlog_do_log_recovery+0x62/0xc0 [xfs] xlog_do_recover+0x73/0x480 [xfs] xlog_recover+0x229/0x460 [xfs] xfs_log_mount+0x284/0x640 [xfs] xfs_mountfs+0xf8b/0x1d10 [xfs] xfs_fs_fill_super+0x13d5/0x1a80 [xfs] get_tree_bdev+0x3da/0x6e0 vfs_get_tree+0x7d/0x240 path_mount+0xdd3/0x17d0 __x64_sys_mount+0x1fa/0x270 do_syscall_64+0x2b/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 5680: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x144/0x1b0 slab_free_freelist_hook+0xab/0x180 kmem_cache_free+0x1f1/0x410 xfs_rud_item_release+0x33/0x80 [xfs] xfs_trans_free_items+0xc3/0x220 [xfs] xfs_trans_cancel+0x1fa/0x590 [xfs] xfs_rui_item_recover+0x913/0xd60 [xfs] xlog_recover_process_intents+0x24e/0xae0 [xfs] xlog_recover_finish+0x7d/0x970 [xfs] xfs_log_mount_finish+0x2d7/0x5d0 [xfs] xfs_mountfs+0x11d4/0x1d10 [xfs] xfs_fs_fill_super+0x13d5/0x1a80 [xfs] get_tree_bdev+0x3da/0x6e0 vfs_get_tree+0x7d/0x240 path_mount+0xdd3/0x17d0 __x64_sys_mount+0x1fa/0x270 do_syscall_64+0x2b/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88804391b300 which belongs to the cache xfs_rui_item of size 688 The buggy address is located 96 bytes inside of 688-byte region [ffff88804391b300, ffff88804391b5b0) The buggy address belongs to the physical page: page:ffffea00010e4600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888043919320 pfn:0x43918 head:ffffea00010e4600 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4fff80000010200(slab|head|node=1|zone=1|lastcpupid=0xfff) raw: 04fff80000010200 0000000000000000 dead000000000122 ffff88807f0eadc0 raw: ffff888043919320 0000000080140010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804391b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804391b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804391b300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804391b380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804391b400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== The test fuzzes an rmap btree block and starts writer threads to induce a filesystem shutdown on the corrupt block. When the filesystem is remounted, recovery will try to replay the committed rmap intent item, but the corruption problem causes the recovery transaction to fail. Cancelling the transaction frees the RUD, which frees the RUI that we recovered. When we return to xlog_recover_process_intents, @lip is now a dangling pointer, and we cannot use it to find the iop_recover method for the tracepoint. Hence we must store the item ops before calling ->iop_recover if we want to give it to the tracepoint so that the trace data will tell us exactly which intent item failed. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 5434ee8d28575b2e784bd5b4dbfc912e5da90759 Author: Nikos Tsironis Date: Thu Sep 29 17:11:48 2022 +0300 dm clone: Fix typo in block_device format specifier Use %pg for printing the block device name, instead of %pd. Fixes: 385411ffba0c ("dm: stop using bdevname") Cc: stable@vger.kernel.org # v5.18+ Signed-off-by: Nikos Tsironis Signed-off-by: Mike Snitzer commit 99f4f5bcb975527508eb7a5e3e34bdb91d576746 Author: Genjian Zhang Date: Thu Sep 29 16:20:36 2022 +0800 dm: remove unnecessary assignment statement in alloc_dev() Fixes: 74fe6ba923949 ("dm: convert to blk_alloc_disk/blk_cleanup_disk") Signed-off-by: Genjian Zhang Signed-off-by: Mike Snitzer commit dc3efedf9f7b802d0817183020ed01cb0c120fe8 Author: Milan Broz Date: Tue Sep 27 20:42:26 2022 +0200 dm verity: Add documentation for try_verify_in_tasklet option Add documentation that was missing from commit 5721d4e5a9cd ("dm verity: Add optional "try_verify_in_tasklet" feature"). Signed-off-by: Milan Broz Signed-off-by: Mike Snitzer commit 48d1a964dca532698bc67ac71c04df7908815de1 Author: Shaomin Deng Date: Sun Sep 4 12:04:27 2022 -0400 dm cache: delete the redundant word 'each' in comment Signed-off-by: Shaomin Deng Signed-off-by: Mike Snitzer commit 96fccdce97ce647d5c7bf1db0d3159cc90774054 Author: Jiangshan Yi Date: Mon Sep 5 10:45:52 2022 +0800 dm raid: fix typo in analyse_superblocks code comment Reported-by: k2ci Signed-off-by: Jiangshan Yi Signed-off-by: Mike Snitzer commit afd41fff9c73ccc3757e94ad727d2a9ac4d7f6cb Author: Nathan Huckleberry Date: Tue Aug 30 18:44:44 2022 +0000 dm verity: enable WQ_HIGHPRI on verify_wq WQ_HIGHPRI increases throughput and decreases disk latency when using dm-verity. This is important in Android for camera startup speed. The following tests were run by doing 60 seconds of random reads using a dm-verity device backed by two ramdisks. Without WQ_HIGHPRI lat (usec): min=13, max=3947, avg=69.53, stdev=50.55 READ: bw=51.1MiB/s (53.6MB/s), 51.1MiB/s-51.1MiB/s (53.6MB/s-53.6MB/s) With WQ_HIGHPRI: lat (usec): min=13, max=7854, avg=31.15, stdev=30.42 READ: bw=116MiB/s (121MB/s), 116MiB/s-116MiB/s (121MB/s-121MB/s) Further testing was done by measuring how long it takes to open a camera on an Android device. Without WQ_HIGHPRI Total verity work queue wait times (ms): 880.960, 789.517, 898.852 With WQ_HIGHPRI: Total verity work queue wait times (ms): 528.824, 439.191, 433.300 The average time to open the camera is reduced by 350ms (or 40-50%). Signed-off-by: Nathan Huckleberry Signed-off-by: Mike Snitzer commit cea446630feab57f49d47abccf206e9725019cce Author: Jilin Yuan Date: Tue Aug 30 23:33:45 2022 +0800 dm raid: delete the redundant word 'that' in comment Signed-off-by: Jilin Yuan Signed-off-by: Mike Snitzer commit 43e6c111824c75940a586cd7d3fe6a5ff1d5104f Author: Mikulas Patocka Date: Wed Aug 24 07:25:57 2022 -0400 dm: change from DMWARN to DMERR or DMCRIT for fatal errors Change DMWARN to DMERR in cases when there is an unrecoverable error. Change DMWARN to DMCRIT when handling of a case is unimplemented. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 618887768bb71f0a475334fa5a4fba7dc98d7ab5 Author: Dan Carpenter Date: Fri Oct 14 12:37:25 2022 +0300 kunit: update NULL vs IS_ERR() tests The alloc_string_stream() functions were changed from returning NULL on error to returning error pointers so these caller needs to be updated as well. Fixes: 78b1c6584fce ("kunit: string-stream: Simplify resource use") Signed-off-by: Dan Carpenter Reviewed-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit db4e955ae333567dea02822624106c0b96a2f84f Author: Alexandre Belloni Date: Tue Oct 18 22:35:11 2022 +0200 rtc: cmos: fix build on non-ACPI platforms Now that rtc_wake_setup is called outside of cmos_wake_setup, it also need to be defined on non-ACPI platforms. Reported-by: kernel test robot Link: https://lore.kernel.org/r/20221018203512.2532407-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit cb05c81ada76a30a25a5f79b249375e33473af33 Author: Sven Schnelle Date: Mon Oct 10 09:42:07 2022 +0200 selftests/ftrace: fix dynamic_events dependency check commit 95c104c378dc ("tracing: Auto generate event name when creating a group of events") changed the syntax in the ftrace README file which is used by the selftests to check what features are support. Adjust the string to make test_duplicates.tc and trigger-synthetic-eprobe.tc work again. Fixes: 95c104c378dc ("tracing: Auto generate event name when creating a group of events") Signed-off-by: Sven Schnelle Acked-by: Steven Rostedt (Google) Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shuah Khan commit eb6789b0c3424f84e8441c4796083db2f095c391 Author: Zhao Gongyi Date: Tue Oct 11 09:39:26 2022 +0800 selftests/memory-hotplug: Remove the redundant warning information Remove the redundant warning information of online_all_offline_memory() since there is a warning in online_memory_expect_success(). Signed-off-by: Zhao Gongyi Reviewed-by: David Hildenbrand Signed-off-by: Shuah Khan commit af6514f2f3828dc39c96cd4686ef5c9d8368626f Author: Kai Vehmanen Date: Tue Oct 18 15:13:32 2022 +0300 ASoC: SOF: ipc4-mtrace: protect per-core nodes against multiple open Add protection against multiple open of the mtrace/coreN debugfs nodes. This is not supported in the implementation, and this will show up as unexpected behaviour of the interface, and potential use of already freed memory. Fixes: f4ea22f7aa75 ("ASoC: SOF: ipc4: Add support for mtrace log extraction") Signed-off-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20221018121332.20802-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b4dd2e3758709aa8a2abd1ac34c56bd09b980039 Author: Yong Zhi Date: Mon Oct 17 15:57:28 2022 -0500 ASoC: Intel: sof_rt5682: Add quirk for Rex board Add mtl_mx98357_rt5682 driver data for Chrome Rex board support. Reviewed-by: Bard Liao Reviewed-by: Curtis Malainey Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20221017205728.210813-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2a8e366b23fea29a5308f71ba49555e3c8c664f1 Author: Ricardo Cañuelo Date: Mon Oct 10 08:39:27 2022 +0200 selftests/kexec: fix build for ARCH=x86_64 Handle the scenario where the build is launched with the ARCH envvar defined as x86_64. Signed-off-by: Ricardo Cañuelo Signed-off-by: Shuah Khan commit beb7d862ed4ac6aa14625418970f22a7d55b8615 Author: Ricardo Cañuelo Date: Mon Oct 10 08:38:11 2022 +0200 selftests/intel_pstate: fix build for ARCH=x86_64 Handle the scenario where the build is launched with the ARCH envvar defined as x86_64. Signed-off-by: Ricardo Cañuelo Signed-off-by: Shuah Khan commit 03cab65a07e083b6c1010fbc8f9b817e9aca75d9 Author: Ricardo Cañuelo Date: Mon Oct 10 08:37:02 2022 +0200 selftests/futex: fix build for clang Don't use the test-specific header files as source files to force a target dependency, as clang will complain if more than one source file is used for a compile command with a single '-o' flag. Use the proper Makefile variables instead as defined in tools/testing/selftests/lib.mk. Signed-off-by: Ricardo Cañuelo Reviewed-by: André Almeida Signed-off-by: Shuah Khan commit aae703b02f92bde9264366c545e87cec451de471 Merge: 7ae460973d345 4efb365a3f04d Author: Linus Torvalds Date: Tue Oct 18 11:25:50 2022 -0700 Merge tag 'for-6.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fiemap fixes: - add missing path cache update - fix processing of delayed data and tree refs during backref walking, this could lead to reporting incorrect extent sharing - fix extent range locking under heavy contention to avoid deadlocks - make it possible to test send v3 in debugging mode - update links in MAINTAINERS * tag 'for-6.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: MAINTAINERS: update btrfs website links and files btrfs: ignore fiemap path cache if we have multiple leaves for a data extent btrfs: fix processing of delayed tree block refs during backref walking btrfs: fix processing of delayed data refs during backref walking btrfs: delete stale comments after merge conflict resolution btrfs: unlock locked extent area if we have contention btrfs: send: update command for protocol version check btrfs: send: allow protocol version 3 with CONFIG_BTRFS_DEBUG btrfs: add missing path cache update during fiemap commit 67bf6493449b09590f9f71d7df29efb392b12d25 Author: Babu Moger Date: Tue Sep 27 15:16:29 2022 -0500 x86/resctrl: Fix min_cbm_bits for AMD AMD systems support zero CBM (capacity bit mask) for cache allocation. That is reflected in rdt_init_res_defs_amd() by: r->cache.arch_has_empty_bitmaps = true; However given the unified code in cbm_validate(), checking for: val == 0 && !arch_has_empty_bitmaps is not enough because of another check in cbm_validate(): if ((zero_bit - first_bit) < r->cache.min_cbm_bits) The default value of r->cache.min_cbm_bits = 1. Leading to: $ cd /sys/fs/resctrl $ mkdir foo $ cd foo $ echo L3:0=0 > schemata -bash: echo: write error: Invalid argument $ cat /sys/fs/resctrl/info/last_cmd_status Need at least 1 bits in the mask Initialize the min_cbm_bits to 0 for AMD. Also, remove the default setting of min_cbm_bits and initialize it separately. After the fix: $ cd /sys/fs/resctrl $ mkdir foo $ cd foo $ echo L3:0=0 > schemata $ cat /sys/fs/resctrl/info/last_cmd_status ok Fixes: 316e7f901f5a ("x86/resctrl: Add struct rdt_cache::arch_has_{sparse, empty}_bitmaps") Co-developed-by: Stephane Eranian Signed-off-by: Stephane Eranian Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov Reviewed-by: Ingo Molnar Reviewed-by: James Morse Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Cc: Link: https://lore.kernel.org/lkml/20220517001234.3137157-1-eranian@google.com commit 7ae460973d3455371a1182297357eeb9fafb0227 Merge: bb1a1146467ad ce4b815686573 Author: Linus Torvalds Date: Tue Oct 18 11:18:26 2022 -0700 Merge tag 'erofs-for-6.1-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: - Fix invalid unmapped accesses when initializing compressed inodes - Fix up very rare hung on page lock after enabling compressed data deduplication - Fix up inplace decompression success rate - Take s_inode_list_lock to protect sb->s_inodes for fscache shared domain * tag 'erofs-for-6.1-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: protect s_inodes with s_inode_list_lock for fscache erofs: fix up inplace decompression success rate erofs: shouldn't churn the mapping page for duplicated copies erofs: fix illegal unmapped accesses in z_erofs_fill_inode_lazy() commit 73189c064e11137c8b78a825800a374924ebb7b7 Author: Pierre-Louis Bossart Date: Mon Oct 17 15:40:04 2022 -0500 ASoC: SOF: Intel: pci-mtl: fix firmware name Initial IPC4 tests used the same conventions as previous reference closed-source firmware, but for MeteorLake the convention is the same as previous SOF releases (sof-.ri). Only the prefix changes to avoid confusions between IPC types. This change has no impact on users since the firmware has not yet been released. Fixes: 064520e8aeaa2 ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20221017204004.207446-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 41deb2db64997d01110faaf763bd911d490dfde7 Author: Pierre-Louis Bossart Date: Mon Oct 17 15:40:54 2022 -0500 ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15 Some NUC15 LAPBC710 devices don't expose the same DMI information as the Intel reference, add additional entry in the match table. BugLink: https://github.com/thesofproject/linux/issues/3885 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20221017204054.207512-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 141b3523e9be6f15577acf4bbc3bc1f82d81d6d1 Author: Mikulas Patocka Date: Tue Oct 18 10:06:45 2022 -0400 dm bufio: use the acquire memory barrier when testing for B_READING The function test_bit doesn't provide any memory barrier. It may be possible that the read requests that follow test_bit(B_READING, &b->state) are reordered before the test, reading invalid data that existed before B_READING was cleared. Fix this bug by changing test_bit to test_bit_acquire. This is particularly important on arches with weak(er) memory ordering (e.g. arm64). Depends-On: 8238b4579866 ("wait_on_bit: add an acquire memory barrier") Depends-On: d6ffe6067a54 ("provide arch_test_bit_acquire for architectures that define test_bit") Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 30b2d7f8f13664655480d6af45f60270b3eb6736 Author: Zhang Xiaoxu Date: Tue Oct 18 11:49:16 2022 +0800 cifs: Fix memory leak when build ntlmssp negotiate blob failed There is a memory leak when mount cifs: unreferenced object 0xffff888166059600 (size 448): comm "mount.cifs", pid 51391, jiffies 4295596373 (age 330.596s) hex dump (first 32 bytes): fe 53 4d 42 40 00 00 00 00 00 00 00 01 00 82 00 .SMB@........... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000060609a61>] mempool_alloc+0xe1/0x260 [<00000000adfa6c63>] cifs_small_buf_get+0x24/0x60 [<00000000ebb404c7>] __smb2_plain_req_init+0x32/0x460 [<00000000bcf875b4>] SMB2_sess_alloc_buffer+0xa4/0x3f0 [<00000000753a2987>] SMB2_sess_auth_rawntlmssp_negotiate+0xf5/0x480 [<00000000f0c1f4f9>] SMB2_sess_setup+0x253/0x410 [<00000000a8b83303>] cifs_setup_session+0x18f/0x4c0 [<00000000854bd16d>] cifs_get_smb_ses+0xae7/0x13c0 [<000000006cbc43d9>] mount_get_conns+0x7a/0x730 [<000000005922d816>] cifs_mount+0x103/0xd10 [<00000000e33def3b>] cifs_smb3_do_mount+0x1dd/0xc90 [<0000000078034979>] smb3_get_tree+0x1d5/0x300 [<000000004371f980>] vfs_get_tree+0x41/0xf0 [<00000000b670d8a7>] path_mount+0x9b3/0xdd0 [<000000005e839a7d>] __x64_sys_mount+0x190/0x1d0 [<000000009404c3b9>] do_syscall_64+0x35/0x80 When build ntlmssp negotiate blob failed, the session setup request should be freed. Fixes: 49bd49f983b5 ("cifs: send workstation name during ntlmssp session setup") Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Shyam Prasad N Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 053569ccde2a41abcc592781451cd16eaa6e8bab Author: Ronnie Sahlberg Date: Mon Oct 17 18:48:26 2022 -0500 cifs: set rc to -ENOENT if we can not get a dentry for the cached dir We already set rc to this return code further down in the function but we can set it earlier in order to suppress a smash warning. Also fix a false positive for Coverity. The reason this is a false positive is that this happens during umount after all files and directories have been closed but mosetting on ->on_list to suppress the warning. Reported-by: Dan carpenter Reported-by: coverity-bot Addresses-Coverity-ID: 1525256 ("Concurrent data access violations") Fixes: a350d6e73f5e ("cifs: enable caching of directories for which a lease is held") Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit d32f211adb6aa179c00ee1c251315d1ef1433a38 Author: Yang Yingliang Date: Mon Oct 17 16:55:08 2022 +0800 cifs: use LIST_HEAD() and list_move() to simplify code list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Using list_move() instead of list_del() and list_add(). Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Yang Yingliang Signed-off-by: Steve French commit 10269f13257d4eb6061d09ccce61666316df9838 Author: Zhang Xiaoxu Date: Mon Oct 17 22:45:25 2022 +0800 cifs: Fix xid leak in cifs_get_file_info_unix() If stardup the symlink target failed, should free the xid, otherwise the xid will be leaked. Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit e909d054bdea75ef1ec48c18c5936affdaecbb2c Author: Zhang Xiaoxu Date: Mon Oct 17 22:45:24 2022 +0800 cifs: Fix xid leak in cifs_ses_add_channel() Before return, should free the xid, otherwise, the xid will be leaked. Fixes: d70e9fa55884 ("cifs: try opening channels after mounting") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 575e079c782b9862ec2626403922d041a42e6ed6 Author: Zhang Xiaoxu Date: Mon Oct 17 22:45:23 2022 +0800 cifs: Fix xid leak in cifs_flock() If not flock, before return -ENOLCK, should free the xid, otherwise, the xid will be leaked. Fixes: d0677992d2af ("cifs: add support for flock") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 9a97df404a402fe1174d2d1119f87ff2a0ca2fe9 Author: Zhang Xiaoxu Date: Mon Oct 17 22:45:22 2022 +0800 cifs: Fix xid leak in cifs_copy_file_range() If the file is used by swap, before return -EOPNOTSUPP, should free the xid, otherwise, the xid will be leaked. Fixes: 4e8aea30f775 ("smb3: enable swap on SMB3 mounts") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit fee0fb1f15054bb6a0ede452acb42da5bef4d587 Author: Zhang Xiaoxu Date: Mon Oct 17 22:45:21 2022 +0800 cifs: Fix xid leak in cifs_create() If the cifs already shutdown, we should free the xid before return, otherwise, the xid will be leaked. Fixes: 087f757b0129 ("cifs: add shutdown support") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Zhang Xiaoxu Signed-off-by: Steve French commit 0782b66ed2fbb035dda76111df0954515e417b24 Author: Rafael J. Wysocki Date: Tue Oct 18 18:09:31 2022 +0200 rtc: cmos: Fix wake alarm breakage Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration ordering issue") overlooked the fact that cmos_do_probe() depended on the preparations carried out by cmos_wake_setup() and the wake alarm stopped working after the ordering of them had been changed. Address this by partially reverting commit 4919d3eb2ec0 so that cmos_wake_setup() is called before cmos_do_probe() again and moving the rtc_wake_setup() invocation from cmos_wake_setup() directly to the callers of cmos_do_probe() where it will happen after a successful completion of the latter. Fixes: 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration ordering issue") Reported-by: Zhang Rui Reported-by: Todd Brandt Signed-off-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/5887691.lOV4Wx5bFT@kreacher Signed-off-by: Alexandre Belloni commit 491a4ccd8a0258392900c80c6b2b622c7115fc23 Author: Stefan Binding Date: Tue Oct 18 13:15:06 2022 +0100 ALSA: hda/realtek: Add quirk for ASUS Zenbook using CS35L41 This Asus Zenbook laptop use Realtek HDA codec combined with 2xCS35L41 Amplifiers using SPI with External Boost. Signed-off-by: Stefan Binding Cc: Link: https://lore.kernel.org/r/20221018121506.2561397-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ef80c95c29dc67c3034f32d93c41e2ede398e387 Author: David Virag Date: Thu Oct 13 17:13:40 2022 +0200 clk: samsung: exynos7885: Correct "div4" clock parents "div4" DIVs which divide PLLs by 4 are actually dividing "div2" DIVs by 2 to achieve a by 4 division, thus their parents are the respective "div2" DIVs. These DIVs were mistakenly set to have the PLLs as parents. This leads to the kernel thinking "div4"s and everything under them run at 2x the clock speed. Fix this. Fixes: 45bd8166a1d8 ("clk: samsung: Add initial Exynos7885 clock driver") Signed-off-by: David Virag Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20221013151341.151208-1-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit a6991d623de02c42c44ddfffde66ec18608069d3 Merge: 9abf2313adc1c 889a50aedcd21 Author: Rafael J. Wysocki Date: Tue Oct 18 14:50:44 2022 +0200 Merge tag 'cpufreq-arm-fixes-6.1-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull cpufreq ARM fixes / cleanups for 6.1-rc from Viresh Kumar: "- Fix module loading in Tegra124 driver (Jon Hunter). - Fix memory leak and update to read-only region in qcom driver (Fabien Parent). - Miscellaneous minor cleanups to cpufreq drivers (Fabien Parent and Yang Yingliang)." * tag 'cpufreq-arm-fixes-6.1-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: sun50i: Switch to use dev_err_probe() helper cpufreq: qcom-nvmem: Switch to use dev_err_probe() helper cpufreq: imx6q: Switch to use dev_err_probe() helper cpufreq: dt: Switch to use dev_err_probe() helper cpufreq: qcom: remove unused parameter in function definition cpufreq: qcom: fix writes in read-only memory region cpufreq: qcom: fix memory leak in error path cpufreq: tegra194: Fix module loading commit e66928af3667a9d844a674976ba7765757ab68e2 Author: Colin Ian King Date: Wed Oct 5 16:42:16 2022 +0100 HID: lenovo: Make array tp10ubkbd_led static const Don't populate the read-only array tp10ubkbd_led on the stack but instead make it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Signed-off-by: Jiri Kosina commit 79425b297f56bd481c6e97700a9a4e44c7bcfa35 Author: Samuel Bailey Date: Wed Oct 5 19:51:23 2022 +0100 HID: saitek: add madcatz variant of MMO7 mouse device ID The MadCatz variant of the MMO7 mouse has the ID 0738:1713 and the same quirks as the Saitek variant. Signed-off-by: Samuel Bailey Signed-off-by: Jiri Kosina commit e0539ae012ba5d618eb19665ff990b87b960c643 Author: ZiyangZhang Date: Tue Oct 18 12:53:46 2022 +0800 Documentation: document ublk user recovery feature Add documentation for user recovery feature of ublk subsystem. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20221018045346.99706-2-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit dc398a084d459f065658855454e09f2778f8c5cc Author: Nicholas Piggin Date: Fri Oct 7 00:04:11 2022 +1000 powerpc/64s/interrupt: Perf NMI should not take normal exit path NMI interrupts should exit with EXCEPTION_RESTORE_REGS not with interrupt_return_srr, which is what the perf NMI handler currently does. This breaks if a PMI hits after interrupt_exit_user_prepare_main() has switched the context tracking to user mode, then the CT_WARN_ON() in interrupt_exit_kernel_prepare() fires because it returns to kernel with context set to user. This could possibly be solved by soft-disabling PMIs in the exit path, but that reduces our ability to profile that code. The warning could be removed, but it's potentially useful. All other NMIs and soft-NMIs return using EXCEPTION_RESTORE_REGS, so this makes perf interrupts consistent with that and seems like the best fix. Signed-off-by: Nicholas Piggin [mpe: Squash in fixups from Nick] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221006140413.126443-3-npiggin@gmail.com commit a073672eb09670540e95a2a4aa1c46f5da74159f Author: Nicholas Piggin Date: Fri Oct 14 13:07:29 2022 +1000 powerpc/64/interrupt: Prevent NMI PMI causing a dangerous warning NMI PMIs really should not return using the normal interrupt_return function. If such a PMI hits in code returning to user with the context switched to user mode, this warning can fire. This was enough to cause crashes when reproducing on 64s, because another perf interrupt would hit while reporting bug, and that would cause another bug, and so on until smashing the stack. Work around that particular crash for now by just disabling that context warning for PMIs. This is a hack and not a complete fix, there could be other such problems lurking in corners. But it does fix the known crash. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221014030729.2077151-3-npiggin@gmail.com commit e59b3399fde5e173b026d4952b215043e77b4521 Author: Nicholas Piggin Date: Fri Oct 14 13:07:28 2022 +1000 KVM: PPC: BookS PR-KVM and BookE do not support context tracking The context tracking code in PR-KVM and BookE implementations is not complete, and can cause host crashes if context tracking is enabled. Make these implementations depend on !CONTEXT_TRACKING_USER. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221014030729.2077151-2-npiggin@gmail.com commit 00ff1eaac129a24516a3f6d75adfb9df1efb55dd Author: Nicholas Piggin Date: Fri Oct 14 01:16:47 2022 +1000 powerpc: Fix reschedule bug in KUAP-unlocked user copy schedule must not be explicitly called while KUAP is unlocked, because the AMR register will not be saved across the context switch on 64s (preemption is allowed because that is driven by interrupts which do save the AMR). exit_vmx_usercopy() runs inside an unlocked user access region, and it calls preempt_enable() which will call schedule() if need_resched() was set while non-preemptible. This can cause tasks to run unprotected when the should not, and can cause the user copy to be improperly blocked when scheduling back to it. Fix this by avoiding the explicit resched for preempt kernels by generating an interrupt to reschedule the context if need_resched() got set. Reported-by: Samuel Holland Signed-off-by: Nicholas Piggin Tested-by: Guenter Roeck Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013151647.1857994-3-npiggin@gmail.com commit 2b2095f3a6b43ec36ff890febc588df1ec32e826 Author: Nicholas Piggin Date: Fri Oct 14 01:16:46 2022 +1000 powerpc/64s: Fix hash__change_memory_range preemption warning stop_machine_cpuslocked takes a mutex so it must be called in a preemptible context, so it can't simply be fixed by disabling preemption. This is not a bug, because CPU hotplug is locked, so this processor will call in to the stop machine function. So raw_smp_processor_id() could be used. This leaves a small chance that this thread will be migrated to another CPU, so the master work would be done by a CPU from a different context. Better for test coverage to make that a common case by just having the first CPU to call in become the master. Signed-off-by: Nicholas Piggin Tested-by: Guenter Roeck Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013151647.1857994-2-npiggin@gmail.com commit b9ef323ea1682f9837bf63ba10c5e3750f71a20a Author: Nicholas Piggin Date: Fri Oct 14 01:16:45 2022 +1000 powerpc/64s: Disable preemption in hash lazy mmu mode apply_to_page_range on kernel pages does not disable preemption, which is a requirement for hash's lazy mmu mode, which keeps track of the TLBs to flush with a per-cpu array. Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin Tested-by: Guenter Roeck Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013151647.1857994-1-npiggin@gmail.com commit b12eb279ff552bd67c167b0fe701ae602aa7311e Author: Nicholas Piggin Date: Fri Oct 14 09:07:10 2022 +1000 powerpc/64s: make linear_map_hash_lock a raw spinlock This lock is taken while the raw kfence_freelist_lock is held, so it must also be a raw spinlock, as reported by lockdep when raw lock nesting checking is enabled. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013230710.1987253-3-npiggin@gmail.com commit 35159b5717fa9c6031fdd6a2193c7a3dc717ce33 Author: Nicholas Piggin Date: Fri Oct 14 09:07:09 2022 +1000 powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe With kfence enabled, there are several cases where HPTE and TLBIE locks are called from softirq context, for example: WARNING: inconsistent lock state 6.0.0-11845-g0cbbc95b12ac #1 Tainted: G N -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. swapper/0/1 [HC0[0]:SC0[0]:HE1:SE1] takes: c000000002734de8 (native_tlbie_lock){+.?.}-{2:2}, at: .native_hpte_updateboltedpp+0x1a4/0x600 {IN-SOFTIRQ-W} state was registered at: .lock_acquire+0x20c/0x520 ._raw_spin_lock+0x4c/0x70 .native_hpte_invalidate+0x62c/0x840 .hash__kernel_map_pages+0x450/0x640 .kfence_protect+0x58/0xc0 .kfence_guarded_free+0x374/0x5a0 .__slab_free+0x3d0/0x630 .put_cred_rcu+0xcc/0x120 .rcu_core+0x3c4/0x14e0 .__do_softirq+0x1dc/0x7dc .do_softirq_own_stack+0x40/0x60 Fix this by consistently disabling irqs while taking either of these locks. Don't just disable bh because several of the more common cases already disable irqs, so this just makes the locks always irq-safe. Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013230710.1987253-2-npiggin@gmail.com commit be83d5485da549d934ec65463ea831709f2827b1 Author: Nicholas Piggin Date: Fri Oct 14 09:07:08 2022 +1000 powerpc/64s: Add lockdep for HPTE lock Add lockdep annotation for the HPTE bit-spinlock. Modern systems don't take the tlbie lock, so this shows up some of the same lockdep warnings that were being reported by the ppc970. And they're not taken in exactly the same places so this is nice to have in its own right. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013230710.1987253-1-npiggin@gmail.com commit 2147783d6bf0b7ca14c72a25527dc5135bd17f65 Author: Haren Myneni Date: Thu Oct 6 22:29:59 2022 -0700 powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU The hypervisor assigns VAS (Virtual Accelerator Switchboard) windows depends on cores configured in LPAR. The kernel uses OF reconfig notifier to reconfig VAS windows for DLPAR CPU event. In the case of shared CPU mode partition, the hypervisor assigns VAS windows depends on CPU entitled capacity, not based on vcpus. When the user changes CPU entitled capacity for the partition, drmgr uses /proc/ppc64/lparcfg interface to notify the kernel. This patch adds the following changes to update VAS resources for shared mode: - Call vas reconfig windows from lparcfg_write() - Ignore reconfig changes in the VAS notifier Signed-off-by: Haren Myneni [mpe: Rework error handling, report any errors as EIO] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/efa9c16e4a78dda4567a16f13dabfd73cb4674a2.camel@linux.ibm.com commit 89ed0b769d6adf30364f60e6b1566961821a9893 Author: Haren Myneni Date: Sun Oct 9 20:41:25 2022 -0700 powerpc/pseries/vas: Add VAS IRQ primary handler irq_default_primary_handler() can be used only with IRQF_ONESHOT flag, but the flag disables IRQ before executing the thread handler and enables it after the interrupt is handled. But this IRQ disable sets the VAS IRQ OFF state in the hypervisor. In case if NX faults during this window, the hypervisor will not deliver the fault interrupt to the partition and the user space may wait continuously for the CSB update. So use VAS specific IRQ handler instead of calling the default primary handler. Increment pending_faults counter in IRQ handler and the bottom thread handler will process all faults based on this counter. In case if the another interrupt is received while the thread is running, it will be processed using this counter. The synchronization of top and bottom handlers will be done with IRQTF_RUNTHREAD flag and will re-enter to bottom half if this flag is set. Signed-off-by: Haren Myneni Reviewed-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aaad8813b4762a6753cfcd0b605a7574a5192ec7.camel@linux.ibm.com commit 9a7f2c9e7a19b16b4409f372cf2e16e4334cdca2 Author: Randy Dunlap Date: Fri Oct 14 17:12:28 2022 -0700 ASoC: qcom: SND_SOC_SC7180 optionally depends on SOUNDWIRE If SOUNDWIRE is enabled, then SND_SOC_SC7180 should depend on SOUNDWIRE to prevent SOUNDWIRE=m and SND_SOC_SC7180=y, which causes build errors: s390-linux-ld: sound/soc/qcom/common.o: in function `qcom_snd_sdw_prepare': common.c:(.text+0x140): undefined reference to `sdw_disable_stream' s390-linux-ld: common.c:(.text+0x14a): undefined reference to `sdw_deprepare_stream' s390-linux-ld: common.c:(.text+0x158): undefined reference to `sdw_prepare_stream' s390-linux-ld: common.c:(.text+0x16a): undefined reference to `sdw_enable_stream' s390-linux-ld: common.c:(.text+0x17c): undefined reference to `sdw_deprepare_stream' s390-linux-ld: sound/soc/qcom/common.o: in function `qcom_snd_sdw_hw_free': common.c:(.text+0x344): undefined reference to `sdw_disable_stream' s390-linux-ld: common.c:(.text+0x34e): undefined reference to `sdw_deprepare_stream' Fixes: 3bd975f3ae0a ("ASoC: qcom: sm8250: move some code to common") Fixes: 9e3ecb5b1681 ("ASoC: qcom: sc7180: Add machine driver for sound card registration") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Srinivas Kandagatla Cc: Banajit Goswami Cc: Mark Brown Cc: Liam Girdwood Cc: Ajit Pandey Cc: Cheng-Yi Chiang Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: stable@vger.kernel.org Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20221015001228.18990-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 4e8ff35878685291978b93543d6b9e9290be770a Author: Geert Uytterhoeven Date: Sun Oct 16 10:33:50 2022 +0200 ASoC: codecs: tlv320adc3xxx: Wrap adc3xxx_i2c_remove() in __exit_p() If CONFIG_SND_SOC_TLV320ADC3XXX=y: `.exit.text' referenced in section `.data' of sound/soc/codecs/tlv320adc3xxx.o: defined in discarded section `.exit.text' of sound/soc/codecs/tlv320adc3xxx.o Fix this by wrapping the adc3xxx_i2c_remove() pointer in __exit_p(). Fixes: e9a3b57efd28fe88 ("ASoC: codec: tlv320adc3xxx: New codec driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/3225ba4cfe558d9380155e75385954dd21d4e7eb.1665909132.git.geert@linux-m68k.org Signed-off-by: Mark Brown commit 889a50aedcd216cc5f2b98bb2412f0498d417721 Author: Yang Yingliang Date: Tue Sep 27 23:40:21 2022 +0800 cpufreq: sun50i: Switch to use dev_err_probe() helper In the probe path, convert pr_err() to dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Signed-off-by: Viresh Kumar commit d78be404f97fadacd6a0d0928e6933e89e1869f6 Author: Yang Yingliang Date: Tue Sep 27 23:40:20 2022 +0800 cpufreq: qcom-nvmem: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Signed-off-by: Viresh Kumar commit ab4fdc735daf483c70fc7e4b6c49fa8c1999f741 Author: Yang Yingliang Date: Tue Sep 27 23:40:19 2022 +0800 cpufreq: imx6q: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Signed-off-by: Viresh Kumar commit 2a808b9f701ba935a67be58a3afa2e3b230cee85 Author: Yang Yingliang Date: Tue Sep 27 23:40:18 2022 +0800 cpufreq: dt: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Signed-off-by: Viresh Kumar commit a05887f005d374ff10aeaffe9f203e49fde22d17 Author: Fabien Parent Date: Sat Oct 15 15:04:24 2022 +0200 cpufreq: qcom: remove unused parameter in function definition The speedbin_nvmem parameter is not used for get_krait_bin_format_{a,b}. Let's remove the parameter to make the code cleaner. Signed-off-by: Fabien Parent Signed-off-by: Viresh Kumar commit 01039fb8e90c9cb684430414bff70cea9eb168c5 Author: Fabien Parent Date: Sat Oct 15 15:04:23 2022 +0200 cpufreq: qcom: fix writes in read-only memory region This commit fixes a kernel oops because of a write in some read-only memory: [ 9.068287] Unable to handle kernel write to read-only memory at virtual address ffff800009240ad8 ..snip.. [ 9.138790] Internal error: Oops: 9600004f [#1] PREEMPT SMP ..snip.. [ 9.269161] Call trace: [ 9.276271] __memcpy+0x5c/0x230 [ 9.278531] snprintf+0x58/0x80 [ 9.282002] qcom_cpufreq_msm8939_name_version+0xb4/0x190 [ 9.284869] qcom_cpufreq_probe+0xc8/0x39c ..snip.. The following line defines a pointer that point to a char buffer stored in read-only memory: char *pvs_name = "speedXX-pvsXX-vXX"; This pointer is meant to hold a template "speedXX-pvsXX-vXX" where the XX values get overridden by the qcom_cpufreq_krait_name_version function. Since the template is actually stored in read-only memory, when the function executes the following call we get an oops: snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", speed, pvs, pvs_ver); To fix this issue, we instead store the template name onto the stack by using the following syntax: char pvs_name_buffer[] = "speedXX-pvsXX-vXX"; Because the `pvs_name` needs to be able to be assigned to NULL, the template buffer is stored in the pvs_name_buffer and not under the pvs_name variable. Cc: v5.7+ # v5.7+ Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Fabien Parent Signed-off-by: Viresh Kumar commit 9f42cf54403a42cb092636804d2628d8ecf71e75 Author: Fabien Parent Date: Sat Oct 15 15:04:22 2022 +0200 cpufreq: qcom: fix memory leak in error path If for some reason the speedbin length is incorrect, then there is a memory leak in the error path because we never free the speedbin buffer. This commit fixes the error path to always free the speedbin buffer. Cc: v5.7+ # v5.7+ Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Fabien Parent Signed-off-by: Viresh Kumar commit 1dcaf30725c32b26daa70d22083999972ab99c29 Author: Jon Hunter Date: Tue Oct 11 16:32:43 2022 +0100 cpufreq: tegra194: Fix module loading When the Tegra194 CPUFREQ driver is built as a module it is not automatically loaded as expected on Tegra194 devices. Populate the MODULE_DEVICE_TABLE to fix this. Cc: v5.9+ # v5.9+ Fixes: df320f89359c ("cpufreq: Add Tegra194 cpufreq driver") Signed-off-by: Jon Hunter Signed-off-by: Viresh Kumar commit 05e258c6ec669d6d18c494ea03d35962d6f5b545 Author: Linus Walleij Date: Tue Oct 18 11:11:29 2022 +0200 mtd: parsers: bcm47xxpart: Fix halfblock reads There is some code in the parser that tries to read 0x8000 bytes into a block to "read in the middle" of the block. Well that only works if the block is also 0x10000 bytes all the time, else we get these parse errors as we reach the end of the flash: spi-nor spi0.0: mx25l1606e (2048 Kbytes) mtd_read error while parsing (offset: 0x200000): -22 mtd_read error while parsing (offset: 0x201000): -22 (...) Fix the code to do what I think was intended. Cc: stable@vger.kernel.org Fixes: f0501e81fbaa ("mtd: bcm47xxpart: alternative MAGIC for board_data partition") Cc: Rafał Miłecki Cc: Florian Fainelli Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221018091129.280026-1-linus.walleij@linaro.org commit 1ca695207ed2271ecbf8ee6c641970f621c157cc Author: Zhengchao Shao Date: Mon Oct 17 16:03:31 2022 +0800 ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed If the initialization fails in calling addrconf_init_net(), devconf_all is the pointer that has been released. Then ip6mr_sk_done() is called to release the net, accessing devconf->mc_forwarding directly causes invalid pointer access. The process is as follows: setup_net() ops_init() addrconf_init_net() all = kmemdup(...) ---> alloc "all" ... net->ipv6.devconf_all = all; __addrconf_sysctl_register() ---> failed ... kfree(all); ---> ipv6.devconf_all invalid ... ops_exit_list() ... ip6mr_sk_done() devconf = net->ipv6.devconf_all; //devconf is invalid pointer if (!devconf || !atomic_read(&devconf->mc_forwarding)) The following is the Call Trace information: BUG: KASAN: use-after-free in ip6mr_sk_done+0x112/0x3a0 Read of size 4 at addr ffff888075508e88 by task ip/14554 Call Trace: dump_stack_lvl+0x8e/0xd1 print_report+0x155/0x454 kasan_report+0xba/0x1f0 kasan_check_range+0x35/0x1b0 ip6mr_sk_done+0x112/0x3a0 rawv6_close+0x48/0x70 inet_release+0x109/0x230 inet6_release+0x4c/0x70 sock_release+0x87/0x1b0 igmp6_net_exit+0x6b/0x170 ops_exit_list+0xb0/0x170 setup_net+0x7ac/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f7963322547 Allocated by task 14554: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0xa1/0xb0 __kmalloc_node_track_caller+0x4a/0xb0 kmemdup+0x28/0x60 addrconf_init_net+0x1be/0x840 ops_init+0xa5/0x410 setup_net+0x5aa/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 14554: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x40 ____kasan_slab_free+0x155/0x1b0 slab_free_freelist_hook+0x11b/0x220 __kmem_cache_free+0xa4/0x360 addrconf_init_net+0x623/0x840 ops_init+0xa5/0x410 setup_net+0x5aa/0xbd0 copy_net_ns+0x2e6/0x6b0 create_new_namespaces+0x382/0xa50 unshare_nsproxy_namespaces+0xa6/0x1c0 ksys_unshare+0x3a4/0x7e0 __x64_sys_unshare+0x2d/0x40 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 7d9b1b578d67 ("ip6mr: fix use-after-free in ip6mr_sk_done()") Signed-off-by: Zhengchao Shao Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20221017080331.16878-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit e7ad18d1169c62e6c78c01ff693fd362d9d65278 Author: Borislav Petkov Date: Wed Oct 5 12:00:08 2022 +0200 x86/microcode/AMD: Apply the patch early on every logical thread Currently, the patch application logic checks whether the revision needs to be applied on each logical CPU (SMT thread). Therefore, on SMT designs where the microcode engine is shared between the two threads, the application happens only on one of them as that is enough to update the shared microcode engine. However, there are microcode patches which do per-thread modification, see Link tag below. Therefore, drop the revision check and try applying on each thread. This is what the BIOS does too so this method is very much tested. Btw, change only the early paths. On the late loading paths, there's no point in doing per-thread modification because if is it some case like in the bugzilla below - removing a CPUID flag - the kernel cannot go and un-use features it has detected are there early. For that, one should use early loading anyway. [ bp: Fixes does not contain the oldest commit which did check for equality but that is good enough. ] Fixes: 8801b3fcb574 ("x86/microcode/AMD: Rework container parsing") Reported-by: Ștefan Talpalaru Signed-off-by: Borislav Petkov Tested-by: Ștefan Talpalaru Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=216211 commit e9945b2633deccda74a769d94060df49c53ff181 Author: Horatiu Vultur Date: Tue Oct 18 09:09:59 2022 +0200 pinctrl: ocelot: Fix incorrect trigger of the interrupt. The interrupt controller can detect only link changes. So in case an external device generated a level based interrupt, then the interrupt controller detected correctly the first edge. But the problem was that the interrupt controller was detecting also the edge when the interrupt was cleared. So it would generate another interrupt. The fix for this is to clear the second interrupt but still check the interrupt line status. Fixes: c297561bc98a ("pinctrl: ocelot: Fix interrupt controller") Signed-off-by: Horatiu Vultur Tested-by: Michael Walle Link: https://lore.kernel.org/r/20221018070959.1322606-1-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij commit ce107713b722af57c4b7f2477594d445b496420e Author: Tony O'Brien Date: Tue Sep 27 15:47:28 2022 +1300 mtd: rawnand: marvell: Use correct logic for nand-keep-config Originally the absence of the marvell,nand-keep-config property caused the setup_data_interface function to be provided. However when setup_data_interface was moved into nand_controller_ops the logic was unintentionally inverted. Update the logic so that only if the marvell,nand-keep-config property is present the bootloader NAND config kept. Cc: stable@vger.kernel.org Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops") Signed-off-by: Tony O'Brien Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220927024728.28447-1-chris.packham@alliedtelesis.co.nz commit 3ada71310d2c68eebb57772df6bb1f5f033ae802 Author: Zhang Qilong Date: Mon Sep 26 16:44:56 2022 +0800 mtd: rawnand: tegra: Fix PM disable depth imbalance in probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Cc: stable@vger.kernel.org Fixes: d7d9f8ec77fe9 ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver") Signed-off-by: Zhang Qilong Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220926084456.98160-1-zhangqilong3@huawei.com commit 0a974e6ae43b3a6aac63dfdfdf171be205fa370c Author: Xuezhi Zhang Date: Tue Oct 18 15:51:18 2022 +0800 fbdev: gbefb: Convert sysfs snprintf to sysfs_emit Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Xuezhi Zhang Signed-off-by: Helge Deller commit 1f3b494d1fc18ebb37aaa47107e9b84bf5b54ff7 Author: Yang Yingliang Date: Sat Sep 24 21:10:10 2022 +0800 mtd: rawnand: intel: Add missing of_node_put() in ebu_nand_probe() The 'chip_np' returned by of_get_next_child() with refcount decremented, of_node_put() need be called in error path to decrease the refcount. Fixes: bfc618fcc3f1 ("mtd: rawnand: intel: Read the chip-select line from the correct OF node") Signed-off-by: Yang Yingliang Reviewed-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220924131010.957117-1-yangyingliang@huawei.com commit 9750737130dc7b2e4c6f4f33e7e2381e49014299 Author: Xuezhi Zhang Date: Tue Oct 18 14:25:48 2022 +0800 fbdev: sm501fb: Convert sysfs snprintf to sysfs_emit Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Xuezhi Zhang Signed-off-by: Helge Deller commit 776d875fd4cbb3884860ea7f63c3958f02b0c80e Author: Helge Deller Date: Fri Oct 14 20:01:17 2022 +0200 fbdev: stifb: Fall back to cfb_fillrect() on 32-bit HCRX cards When the text console is scrolling text upwards it calls the fillrect() function to empty the new line. The current implementation doesn't seem to work correctly on HCRX cards in 32-bit mode and leave garbage in that line instead. Fix it by falling back to standard cfb_fillrect() in that case. Signed-off-by: Helge Deller Cc: commit 3c6174f9ffcb63ac8b54809c8043d7800b185bfb Author: Uwe Kleine-König Date: Mon Oct 17 21:52:50 2022 +0200 fbdev: da8xx-fb: Fix error handling in .remove() Even in the presence of problems (here: regulator_disable() might fail), it's important to unregister all resources acquired during .probe() and disable the device (i.e. DMA activity) because even if .remove() returns an error code, the device is removed and the .remove() callback is never called again later to catch up. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller Fixes: 611097d5daea ("fbdev: da8xx: add support for a regulator") commit 69421bf98482d089e50799f45e48b25ce4a8d154 Author: Kuniyuki Iwashima Date: Fri Oct 14 11:26:25 2022 -0700 udp: Update reuse->has_conns under reuseport_lock. When we call connect() for a UDP socket in a reuseport group, we have to update sk->sk_reuseport_cb->has_conns to 1. Otherwise, the kernel could select a unconnected socket wrongly for packets sent to the connected socket. However, the current way to set has_conns is illegal and possible to trigger that problem. reuseport_has_conns() changes has_conns under rcu_read_lock(), which upgrades the RCU reader to the updater. Then, it must do the update under the updater's lock, reuseport_lock, but it doesn't for now. For this reason, there is a race below where we fail to set has_conns resulting in the wrong socket selection. To avoid the race, let's split the reader and updater with proper locking. cpu1 cpu2 +----+ +----+ __ip[46]_datagram_connect() reuseport_grow() . . |- reuseport_has_conns(sk, true) |- more_reuse = __reuseport_alloc(more_socks_size) | . | | |- rcu_read_lock() | |- reuse = rcu_dereference(sk->sk_reuseport_cb) | | | | | /* reuse->has_conns == 0 here */ | | |- more_reuse->has_conns = reuse->has_conns | |- reuse->has_conns = 1 | /* more_reuse->has_conns SHOULD BE 1 HERE */ | | | | | |- rcu_assign_pointer(reuse->socks[i]->sk_reuseport_cb, | | | more_reuse) | `- rcu_read_unlock() `- kfree_rcu(reuse, rcu) | |- sk->sk_state = TCP_ESTABLISHED Note the likely(reuse) in reuseport_has_conns_set() is always true, but we put the test there for ease of review. [0] For the record, usually, sk_reuseport_cb is changed under lock_sock(). The only exception is reuseport_grow() & TCP reqsk migration case. 1) shutdown() TCP listener, which is moved into the latter part of reuse->socks[] to migrate reqsk. 2) New listen() overflows reuse->socks[] and call reuseport_grow(). 3) reuse->max_socks overflows u16 with the new listener. 4) reuseport_grow() pops the old shutdown()ed listener from the array and update its sk->sk_reuseport_cb as NULL without lock_sock(). shutdown()ed TCP sk->sk_reuseport_cb can be changed without lock_sock(), but, reuseport_has_conns_set() is called only for UDP under lock_sock(), so likely(reuse) never be false in reuseport_has_conns_set(). [0]: https://lore.kernel.org/netdev/CANn89iLja=eQHbsM_Ta2sQF0tOGU8vAGrh_izRuuHjuO1ouUag@mail.gmail.com/ Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets") Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20221014182625.89913-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit 12b58961de0bd88b3c7dfa5d21f6d67f4678b780 Author: Rafał Miłecki Date: Tue Oct 18 07:18:22 2022 +0200 mtd: core: add missing of_node_get() in dynamic partitions code This fixes unbalanced of_node_put(): [ 1.078910] 6 cmdlinepart partitions found on MTD device gpmi-nand [ 1.085116] Creating 6 MTD partitions on "gpmi-nand": [ 1.090181] 0x000000000000-0x000008000000 : "nandboot" [ 1.096952] 0x000008000000-0x000009000000 : "nandfit" [ 1.103547] 0x000009000000-0x00000b000000 : "nandkernel" [ 1.110317] 0x00000b000000-0x00000c000000 : "nanddtb" [ 1.115525] ------------[ cut here ]------------ [ 1.120141] refcount_t: addition on 0; use-after-free. [ 1.125328] WARNING: CPU: 0 PID: 1 at lib/refcount.c:25 refcount_warn_saturate+0xdc/0x148 [ 1.133528] Modules linked in: [ 1.136589] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.0.0-rc7-next-20220930-04543-g8cf3f7 [ 1.146342] Hardware name: Freescale i.MX8DXL DDR3L EVK (DT) [ 1.151999] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 1.158965] pc : refcount_warn_saturate+0xdc/0x148 [ 1.163760] lr : refcount_warn_saturate+0xdc/0x148 [ 1.168556] sp : ffff800009ddb080 [ 1.171866] x29: ffff800009ddb080 x28: ffff800009ddb35a x27: 0000000000000002 [ 1.179015] x26: ffff8000098b06ad x25: ffffffffffffffff x24: ffff0a00ffffff05 [ 1.186165] x23: ffff00001fdf6470 x22: ffff800009ddb367 x21: 0000000000000000 [ 1.193314] x20: ffff00001fdfebe8 x19: ffff00001fdfec50 x18: ffffffffffffffff [ 1.200464] x17: 0000000000000000 x16: 0000000000000118 x15: 0000000000000004 [ 1.207614] x14: 0000000000000fff x13: ffff800009bca248 x12: 0000000000000003 [ 1.214764] x11: 00000000ffffefff x10: c0000000ffffefff x9 : 4762cb2ccb52de00 [ 1.221914] x8 : 4762cb2ccb52de00 x7 : 205d313431303231 x6 : 312e31202020205b [ 1.229063] x5 : ffff800009d55c1f x4 : 0000000000000001 x3 : 0000000000000000 [ 1.236213] x2 : 0000000000000000 x1 : ffff800009954be6 x0 : 000000000000002a [ 1.243365] Call trace: [ 1.245806] refcount_warn_saturate+0xdc/0x148 [ 1.250253] kobject_get+0x98/0x9c [ 1.253658] of_node_get+0x20/0x34 [ 1.257072] of_fwnode_get+0x3c/0x54 [ 1.260652] fwnode_get_nth_parent+0xd8/0xf4 [ 1.264926] fwnode_full_name_string+0x3c/0xb4 [ 1.269373] device_node_string+0x498/0x5b4 [ 1.273561] pointer+0x41c/0x5d0 [ 1.276793] vsnprintf+0x4d8/0x694 [ 1.280198] vprintk_store+0x164/0x528 [ 1.283951] vprintk_emit+0x98/0x164 [ 1.287530] vprintk_default+0x44/0x6c [ 1.291284] vprintk+0xf0/0x134 [ 1.294428] _printk+0x54/0x7c [ 1.297486] of_node_release+0xe8/0x128 [ 1.301326] kobject_put+0x98/0xfc [ 1.304732] of_node_put+0x1c/0x28 [ 1.308137] add_mtd_device+0x484/0x6d4 [ 1.311977] add_mtd_partitions+0xf0/0x1d0 [ 1.316078] parse_mtd_partitions+0x45c/0x518 [ 1.320439] mtd_device_parse_register+0xb0/0x274 [ 1.325147] gpmi_nand_probe+0x51c/0x650 [ 1.329074] platform_probe+0xa8/0xd0 [ 1.332740] really_probe+0x130/0x334 [ 1.336406] __driver_probe_device+0xb4/0xe0 [ 1.340681] driver_probe_device+0x3c/0x1f8 [ 1.344869] __driver_attach+0xdc/0x1a4 [ 1.348708] bus_for_each_dev+0x80/0xcc [ 1.352548] driver_attach+0x24/0x30 [ 1.356127] bus_add_driver+0x108/0x1f4 [ 1.359967] driver_register+0x78/0x114 [ 1.363807] __platform_driver_register+0x24/0x30 [ 1.368515] gpmi_nand_driver_init+0x1c/0x28 [ 1.372798] do_one_initcall+0xbc/0x238 [ 1.376638] do_initcall_level+0x94/0xb4 [ 1.380565] do_initcalls+0x54/0x94 [ 1.384058] do_basic_setup+0x1c/0x28 [ 1.387724] kernel_init_freeable+0x110/0x188 [ 1.392084] kernel_init+0x20/0x1a0 [ 1.395578] ret_from_fork+0x10/0x20 [ 1.399157] ---[ end trace 0000000000000000 ]--- [ 1.403782] ------------[ cut here ]------------ Reported-by: Han Xu Fixes: ad9b10d1eaada169 ("mtd: core: introduce of support for dynamic partitions") Signed-off-by: Rafał Miłecki Tested-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20221018051822.28685-1-zajec5@gmail.com commit 69d04ca999499bccb6ca849fa2bfc5e6448f7233 Author: Mika Westerberg Date: Fri Sep 23 12:34:41 2022 +0300 mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init() The Intel SPI-NOR controller does not support the 4-byte address opcode so ->set_4byte_addr_mode() ends up returning -ENOTSUPP and the SPI flash chip probe fail like this: [ 12.291082] spi-nor: probe of spi0.0 failed with error -524 Whereas previously before commit 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()") it worked just fine. Fix this by ignoring -ENOTSUPP in spi_nor_init(). Fixes: 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()") Cc: stable@vger.kernel.org Reported-by: Hongyu Ning Signed-off-by: Mika Westerberg Reviewed-by: Michael Walle Acked-by: Tudor Ambarus Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220923093441.3178-1-mika.westerberg@linux.intel.com commit ff8356060e3a5e126abb5e1f6b6e9931c220dec2 Author: Sai Krishna Potthuri Date: Mon Oct 17 18:33:03 2022 +0530 Revert "dt-bindings: pinctrl-zynqmp: Add output-enable configuration" This reverts commit 133ad0d9af99bdca90705dadd8d31c20bfc9919f. On systems with older PMUFW (Xilinx ZynqMP Platform Management Firmware) using these pinctrl properties can cause system hang because there is missing feature autodetection. When this feature is implemented, support for these two properties should bring back. Cc: stable@vger.kernel.org Signed-off-by: Sai Krishna Potthuri Acked-by: Michal Simek Link: https://lore.kernel.org/r/20221017130303.21746-3-sai.krishna.potthuri@amd.com Signed-off-by: Linus Walleij commit 9989bc33c4894e0751679b91fc6eb585772487b9 Author: Sai Krishna Potthuri Date: Mon Oct 17 18:33:02 2022 +0530 Revert "pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high-impedance" This reverts commit ad2bea79ef0144043721d4893eef719c907e2e63. On systems with older PMUFW (Xilinx ZynqMP Platform Management Firmware) using these pinctrl properties can cause system hang because there is missing feature autodetection. When this feature is implemented in the PMUFW, support for these two properties should bring back. Cc: stable@vger.kernel.org Signed-off-by: Sai Krishna Potthuri Acked-by: Michal Simek Link: https://lore.kernel.org/r/20221017130303.21746-2-sai.krishna.potthuri@amd.com Signed-off-by: Linus Walleij commit ba5284ebe497044f37c9bb9c7b1564932f4b6610 Author: Geert Uytterhoeven Date: Fri Oct 7 15:10:00 2022 +0200 clk: renesas: r8a779g0: Add SASYNCPER clocks On R-Car V4H, all PLLs except PLL5 support Spread Spectrum and/or Fractional Multiplication to reduce electromagnetic interference. Add the SASYNCPER and SASYNCPERD[124] clocks, which are used as clock sources for modules that must not be affected by Spread Spectrum and/or Fractional Multiplication. Signed-off-by: Geert Uytterhoeven Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/d0f35c35e1f96c5a649ab477e7ba5d8025957cd0.1665147497.git.geert+renesas@glider.be commit dc8e483f684a24cc06e1d5fa958b54db58855093 Author: Rafael Mendonca Date: Fri Sep 16 00:59:07 2022 -0300 scsi: lpfc: Fix memory leak in lpfc_create_port() Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command") introduced allocations for the VMID resources in lpfc_create_port() after the call to scsi_host_alloc(). Upon failure on the VMID allocations, the new code would branch to the 'out' label, which returns NULL without unwinding anything, thus skipping the call to scsi_host_put(). Fix the problem by creating a separate label 'out_free_vmid' to unwind the VMID resources and make the 'out_put_shost' label call only scsi_host_put(), as was done before the introduction of allocations for VMID. Fixes: 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command") Signed-off-by: Rafael Mendonca Link: https://lore.kernel.org/r/20220916035908.712799-1-rafaelmendsr@gmail.com Reviewed-by: James Smart Signed-off-by: Martin K. Petersen commit 2331ce6126be8864b39490e705286b66e2344aac Author: Uday Shankar Date: Fri Sep 23 18:02:42 2022 -0600 scsi: core: Restrict legal sdev_state transitions via sysfs Userspace can currently write to sysfs to transition sdev_state to RUNNING or OFFLINE from any source state. This causes issues because proper transitioning out of some states involves steps besides just changing sdev_state, so allowing userspace to change sdev_state regardless of the source state can result in inconsistencies; e.g. with ISCSI we can end up with sdev_state == SDEV_RUNNING while the device queue is quiesced. Any task attempting I/O on the device will then hang, and in more recent kernels, iscsid will hang as well. More detail about this bug is provided in my first attempt: https://groups.google.com/g/open-iscsi/c/PNKca4HgPDs/m/CXaDkntOAQAJ Link: https://lore.kernel.org/r/20220924000241.2967323-1-ushankar@purestorage.com Signed-off-by: Uday Shankar Suggested-by: Mike Christie Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit bb1a1146467ad812bb65440696df0782e2bc63c8 Merge: bbb8ceb5e2421 79a818b508739 Author: Linus Torvalds Date: Mon Oct 17 18:52:43 2022 -0700 Merge tag 'cgroup-for-6.1-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fixes from Tejun Heo: - Fix a recent regression where a sleeping kernfs function is called with css_set_lock (spinlock) held - Revert the commit to enable cgroup1 support for cgroup_get_from_fd/file() Multiple users assume that the lookup only works for cgroup2 and breaks when fed a cgroup1 file. Instead, introduce a separate set of functions to lookup both v1 and v2 and use them where the user explicitly wants to support both versions. - Compat update for tools/perf/util/bpf_skel/bperf_cgroup.bpf.c. - Add Josef Bacik as a blkcg maintainer. * tag 'cgroup-for-6.1-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: blkcg: Update MAINTAINERS entry mm: cgroup: fix comments for get from fd/file helpers perf stat: Support old kernels for bperf cgroup counting bpf: cgroup_iter: support cgroup1 using cgroup fd cgroup: add cgroup_v1v2_get_from_[fd/file]() Revert "cgroup: enable cgroup_get_from_file() on cgroup1" cgroup: Reorganize css_set_lock and kernfs path processing commit 4fd9df10cb7a9289fbd22d669f9f98164d95a1ce Author: Pavel Kozlov Date: Mon Oct 17 20:11:27 2022 +0400 ARC: mm: fix leakage of memory allocated for PTE Since commit d9820ff ("ARC: mm: switch pgtable_t back to struct page *") a memory leakage problem occurs. Memory allocated for page table entries not released during process termination. This issue can be reproduced by a small program that allocates a large amount of memory. After several runs, you'll see that the amount of free memory has reduced and will continue to reduce after each run. All ARC CPUs are effected by this issue. The issue was introduced since the kernel stable release v5.15-rc1. As described in commit d9820ff after switch pgtable_t back to struct page *, a pointer to "struct page" and appropriate functions are used to allocate and free a memory page for PTEs, but the pmd_pgtable macro hasn't changed and returns the direct virtual address from the PMD (PGD) entry. Than this address used as a parameter in the __pte_free() and as a result this function couldn't release memory page allocated for PTEs. Fix this issue by changing the pmd_pgtable macro and returning pointer to struct page. Fixes: d9820ff76f95 ("ARC: mm: switch pgtable_t back to struct page *") Cc: Mike Rapoport Cc: # 5.15.x Signed-off-by: Pavel Kozlov Signed-off-by: Vineet Gupta commit 2df1f4a77bc0e94e1a0cc7485d09a26855461dd6 Author: Lukas Bulwahn Date: Thu Sep 29 12:14:21 2022 +0200 arc: update config files Clean up config files by: - removing configs that were deleted in the past - removing configs not in tree and without recently pending patches - adding new configs that are replacements for old configs in the file For some detailed information, see Link. Link: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Signed-off-by: Lukas Bulwahn Signed-off-by: Vineet Gupta commit c44f15c1c09481d50fd33478ebb5b8284f8f5edb Author: Randy Dunlap Date: Sun Oct 9 19:28:46 2022 -0700 arc: iounmap() arg is volatile Add 'volatile' to iounmap()'s argument to prevent build warnings. This make it the same as other major architectures. Placates these warnings: (12 such warnings) ../drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe': ../drivers/video/fbdev/riva/fbdev.c:2067:42: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers] 2067 | iounmap(default_par->riva.PRAMIN); Fixes: 1162b0701b14b ("ARC: I/O and DMA Mappings") Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Arnd Bergmann Signed-off-by: Vineet Gupta commit c8f878582838f57bc0984f47da2a8d275731240f Author: Serge Semin Date: Fri Jun 24 17:16:17 2022 +0300 arc: dts: Harmonize EHCI/OHCI DT nodes name In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Alexey Brodkin Acked-by: Krzysztof Kozlowski Signed-off-by: Vineet Gupta commit a1db7ad3120e787350c83712c6b1087c7894c6a4 Author: Amadeusz Sławiński Date: Fri May 27 13:53:43 2022 +0200 ARC: bitops: Change __fls to return unsigned long As per asm-generic definition and other architectures __fls should return unsigned long. No functional change is expected as return value should fit in unsigned long. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Signed-off-by: Vineet Gupta commit 6e32c89c0f67b481ec17de69e556907d6445f91e Author: Zhang Jiaming Date: Thu Jun 23 15:46:23 2022 +0800 ARC: Fix comment typo Change 'seperate' to 'separate'. Signed-off-by: Zhang Jiaming Signed-off-by: Vineet Gupta commit 63d1dfd067f07c11eafe05ebadc5896491416f86 Author: Jilin Yuan Date: Sun May 8 11:02:24 2022 +0800 ARC: Fix comment typo - Remove one of the repeated 'call' in comment line 396. - Delete the redundant word 'to', 'since' Signed-off-by: Jilin Yuan Signed-off-by: Vineet Gupta commit 2ce3a0bf2010b16c78b78cc35a97fa913f1be0ca Author: Damien Le Moal Date: Fri Oct 14 11:03:49 2022 +0900 ata: ahci_qoriq: Fix compilation warning When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_qoriq.c:283:22: error: cast to smaller integer type 'enum ahci_qoriq_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] qoriq_priv->type = (enum ahci_qoriq_type)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size of of_id->data. Signed-off-by: Damien Le Moal Acked-by: Arnd Bergmann commit 26d9f48d9981205a7e229e21e183dbf1f13de83e Author: Damien Le Moal Date: Fri Oct 14 10:48:16 2022 +0900 ata: ahci_imx: Fix compilation warning When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_imx.c:1070:18: error: cast to smaller integer type 'enum ahci_imx_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] imxpriv->type = (enum ahci_imx_type)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size of of_id->data. Signed-off-by: Damien Le Moal Acked-by: Arnd Bergmann commit e8fbdf1855f7f31a8f37df60d7be44d8aabe6288 Author: Damien Le Moal Date: Fri Oct 14 10:45:58 2022 +0900 ata: ahci_xgene: Fix compilation warning When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_xgene.c:788:14: error: cast to smaller integer type 'enum xgene_ahci_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] version = (enum xgene_ahci_version) of_devid->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size of of_devid->data. Signed-off-by: Damien Le Moal Acked-by: Arnd Bergmann commit 7d7b0c85127cbac45e6c4e0ae0647ace17cadfaf Author: Damien Le Moal Date: Fri Oct 14 10:42:57 2022 +0900 ata: ahci_brcm: Fix compilation warning When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_brcm.c:451:18: error: cast to smaller integer type 'enum brcm_ahci_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] priv->version = (enum brcm_ahci_version)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size of of_id->data. Signed-off-by: Damien Le Moal Acked-by: Arnd Bergmann Acked-by: Florian Fainelli commit 0ffac4727eec1879305c1bda07c0195197937bb2 Author: Damien Le Moal Date: Fri Oct 14 10:38:15 2022 +0900 ata: sata_rcar: Fix compilation warning When compiling with clang and W=1, the following warning is generated: drivers/ata/sata_rcar.c:878:15: error: cast to smaller integer type 'enum sata_rcar_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] priv->type = (enum sata_rcar_type)of_device_get_match_data(dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size returned by of_device_get_match_data(). Signed-off-by: Damien Le Moal Reviewed-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Reviewed-by: Sergey Shtylyov commit c29f446108e10bb791220ffbba54d82722d60d45 Author: Krzysztof Kozlowski Date: Tue Sep 20 17:04:12 2022 +0200 dt-bindings: hwlock: qcom-hwspinlock: add syscon to MSM8974 The TCSR_MUTEX region contains two set of registers: mutex and halt. Add syscon, so the TCSR mutex device (hwspinlock) can use MMIO based method and in the same time share regmap with other devices for the halt regs. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Tested-by: Luca Weiss # fairphone-fp2 Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920150414.637634-2-krzysztof.kozlowski@linaro.org commit cb1d0aaa674e99957b85af570cb2730145af01df Author: Satya Priya Date: Tue Sep 20 17:18:15 2022 +0530 arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280 Add the reset register offset for clock gating. Fixes: 9499240d15f2 ("arm64: dts: qcom: sc7280: Add lpasscore & lpassaudio clock controllers") Signed-off-by: Satya Priya Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1663674495-25748-1-git-send-email-quic_c_skakit@quicinc.com commit 8703d55bd5eac642275fe91b34ac62ad0ad312b5 Author: Johan Hovold Date: Thu Sep 15 16:16:01 2022 +0200 arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size The size of the UFS PHY serdes register region is 0x1c8 and the corresponding 'reg' property should specifically not include the adjacent regions that are defined in the child node (e.g. tx and rx). Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Tested-by: Andrew Halaney #Qdrive3/sa8540p-adp-ride Reviewed-by: Brian Masney Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220915141601.18435-1-johan+linaro@kernel.org commit 8fbf8636cd37b821ce3482748340008dbbe2dcb5 Author: Yang Yingliang Date: Sun Oct 9 10:50:56 2022 +0800 clk: mediatek: clk-mt8195-topckgen: Fix error return code in clk_mt8195_topck_probe() If devm_clk_hw_register_mux() fails in clk_mt8195_topck_probe(), it should return error code. Fixes: deeb2af77cf6 ("clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221009025056.35311-1-yangyingliang@huawei.com Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 7e3e6e1b75c9643e25e8ca7d6caf1b1faf8f022e Author: Conor Dooley Date: Wed Oct 5 18:13:44 2022 +0100 clk: sifive: select by default if SOC_SIFIVE With the aim of dropping direct selects of drivers from Kconfig.socs, default the SiFive clock drivers to the value of SOC_SIFIVE. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221005171348.167476-2-conor@kernel.org Signed-off-by: Stephen Boyd commit 2ff4ba9e37024735f5cefc5ea2a73fc66addfe0e Author: Marek Vasut Date: Thu Sep 29 21:55:21 2022 +0200 clk: rs9: Fix I2C accessors Add custom I2C accessors to this driver, since the regular I2C regmap ones do not generate the exact I2C transfers required by the chip. On I2C write, it is mandatory to send transfer length first, on read the chip returns the transfer length in first byte. Instead of always reading back 8 bytes, which is the default and also the size of the entire register file, set BCP register to 1 to read out 1 byte which is less wasteful. Fixes: 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver") Reported-by: Alexander Stein Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20220929195521.284497-1-marex@denx.de Reviewed-by: Alexander Stein Signed-off-by: Stephen Boyd commit 7cdfb7a54ac88f7cb6d830ebb78bdbcbcb44bb4c Author: Johan Hovold Date: Mon Sep 19 11:44:54 2022 +0200 arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes The DP PHY register layout of the current binding do not apply to the newer USB4/USB3/DP PHY which uses a different register layout entirely. Drop the DP PHY subnodes until the binding has been updated to prevent the driver from corrupting unrelated registers. Note that this is also needed in order to not break USB with an upcoming PHY driver change that checks for overlapping register regions. Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220919094454.1574-5-johan+linaro@kernel.org commit 8723c3f290c7b798c0cbd89998576e6b365bda3a Author: Johan Hovold Date: Mon Sep 19 11:44:53 2022 +0200 arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers With the current binding, the PCS register block (0x1400) needs to include the PCS_USB registers (0x1700). Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220919094454.1574-4-johan+linaro@kernel.org commit 81cad26c6c3984d01b0612069c70ffd820f62dfa Author: Johan Hovold Date: Mon Sep 19 11:44:52 2022 +0200 arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers The USB1 SS PHY node had the RX1 register block (0x600) replaced with RX2 (0xc00). Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220919094454.1574-3-johan+linaro@kernel.org commit 31b3b3059791be536e2ec0c6830767b596af340f Author: Johan Hovold Date: Mon Sep 19 11:44:51 2022 +0200 arm64: dts: qcom: sc8280xp: fix USB0 PHY PCS_MISC registers The USB0 SS PHY node had the PCS_MISC register block (0x1200) replaced with PCS_USB (0x1700). Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220919094454.1574-2-johan+linaro@kernel.org commit f3aa975e230e060c07dcfdf3fe92b59809422c13 Author: Brian Masney Date: Thu Oct 6 10:55:29 2022 -0400 arm64: dts: qcom: sc8280xp: correct ref clock for ufs_mem_phy The first UFS host controller fails to start on the SA8540P automotive board (QDrive3) due to the following errors: ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag_retry: query attribute, opcode 5, idn 18, failed with error 253 after 3 retries The system eventually fails to boot with the warning: gcc_ufs_phy_axi_clk status stuck at 'off' This issue can be worked around by adding clk_ignore_unused to the kernel command line since the system firmware sets up this clock for us. Let's fix this issue by updating the ref clock on ufs_mem_phy. Note that the downstream MSM 5.4 sources list this as ref_clk_parent. With this patch, the SA8540P is able to be booted without clk_ignore_unused. Signed-off-by: Brian Masney Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Tested-by: Johan Hovold Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20221006145529.755521-1-bmasney@redhat.com commit 8d6b458ce6e93286a607e54f787f7a86067f58bd Author: Johan Hovold Date: Wed Oct 5 16:33:05 2022 +0200 arm64: dts: qcom: sc8280xp: fix ufs_card_phy ref clock The GCC_UFS_REF_CLKREF_CLK must be enabled or the second UFS controller fails to enumerate on sa8295p-adp. Note that the vendor kernel enables both GCC_UFS_REF_CLKREF_CLK and GCC_UFS_1_CARD_CLKREF_CLK and it is possible that the former should be modelled as a parent of the latter. The clock driver also has a GCC_UFS_CARD_CLKREF_CLK clock which the firmware appears to enable on the ADP. The usual lack of documentation for Qualcomm SoCs makes this a highly annoying guessing game, but as the second controller works on the ADP without either card reference clock enabled, only enable GCC_UFS_REF_CLKREF_CLK for now. Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20221005143305.388-1-johan+linaro@kernel.org commit 79a818b5087393d5a4cb356d4545d02f55bf1a2f Author: Tejun Heo Date: Mon Oct 17 08:08:05 2022 -1000 blkcg: Update MAINTAINERS entry Josef wrote iolatency and iocost is missing from the files list. Let's add Josef as a maintainer and add blk-iocost.c to the files list. Signed-off-by: Tejun Heo Acked-by: Jens Axboe commit 71eac7063698b7d7b8fafb1683ac24a034541141 Author: Zhang Rui Date: Fri Oct 14 17:01:47 2022 +0800 x86/topology: Fix duplicated core ID within a package Today, core ID is assumed to be unique within each package. But an AlderLake-N platform adds a Module level between core and package, Linux excludes the unknown modules bits from the core ID, resulting in duplicate core ID's. To keep core ID unique within a package, Linux must include all APIC-ID bits for known or unknown levels above the core and below the package in the core ID. It is important to understand that core ID's have always come directly from the APIC-ID encoding, which comes from the BIOS. Thus there is no guarantee that they start at 0, or that they are contiguous. As such, naively using them for array indexes can be problematic. [ dhansen: un-known -> unknown ] Fixes: 7745f03eb395 ("x86/topology: Add CPUID.1F multi-die/package support") Suggested-by: Len Brown Signed-off-by: Zhang Rui Signed-off-by: Dave Hansen Reviewed-by: Len Brown Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221014090147.1836-5-rui.zhang@intel.com commit 2b12a7a126d62bdbd81f4923c21bf6e9a7fbd069 Author: Zhang Rui Date: Fri Oct 14 17:01:46 2022 +0800 x86/topology: Fix multiple packages shown on a single-package system CPUID.1F/B does not enumerate Package level explicitly, instead, all the APIC-ID bits above the enumerated levels are assumed to be package ID bits. Current code gets package ID by shifting out all the APIC-ID bits that Linux supports, rather than shifting out all the APIC-ID bits that CPUID.1F enumerates. This introduces problems when CPUID.1F enumerates a level that Linux does not support. For example, on a single package AlderLake-N, there are 2 Ecore Modules with 4 atom cores in each module. Linux does not support the Module level and interprets the Module ID bits as package ID and erroneously reports a multi module system as a multi-package system. Fix this by using APIC-ID bits above all the CPUID.1F enumerated levels as package ID. [ dhansen: spelling fix ] Fixes: 7745f03eb395 ("x86/topology: Add CPUID.1F multi-die/package support") Suggested-by: Len Brown Signed-off-by: Zhang Rui Signed-off-by: Dave Hansen Reviewed-by: Len Brown Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221014090147.1836-4-rui.zhang@intel.com commit 7108b80a542b9d65e44b36d64a700a83658c0b73 Author: Zhang Rui Date: Fri Oct 14 17:01:45 2022 +0800 hwmon/coretemp: Handle large core ID value The coretemp driver supports up to a hard-coded limit of 128 cores. Today, the driver can not support a core with an ID above that limit. Yet, the encoding of core ID's is arbitrary (BIOS APIC-ID) and so they may be sparse and they may be large. Update the driver to map arbitrary core ID numbers into appropriate array indexes so that 128 cores can be supported, no matter the encoding of core ID's. Signed-off-by: Zhang Rui Signed-off-by: Dave Hansen Acked-by: Len Brown Acked-by: Guenter Roeck Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221014090147.1836-3-rui.zhang@intel.com commit 1ce8aaf6abdc35cde555924418b3d4516b4ec871 Author: Douglas Anderson Date: Mon Aug 29 09:49:52 2022 -0700 arm64: dts: qcom: sm8350-hdk: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: 9208c19f2124 ("arm64: dts: qcom: Introduce SM8350 HDK") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.6.I6799be85cf36d3b494f803cba767a569080624f5@changeid commit b7870d460c05ce31e2311036d91de1e2e0b32cea Author: Douglas Anderson Date: Mon Aug 29 09:49:51 2022 -0700 arm64: dts: qcom: sm8250-xperia-edo: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: 69cdb97ef652 ("arm64: dts: qcom: sm8250: Add support for SONY Xperia 1 II / 5 II (Edo platform)") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.5.Ie446d5183d8b1e9ec4e32228ca300e604e3315eb@changeid commit aa30e786202e4ed1df980442d305658441f65859 Author: Douglas Anderson Date: Mon Aug 29 09:49:50 2022 -0700 arm64: dts: qcom: sm8150-xperia-kumano: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: d0a6ce59ea4e ("arm64: dts: qcom: sm8150: Add support for SONY Xperia 1 / 5 (Kumano platform)") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.4.I51d60414a42ba9e3008e208d60a04c9ffc425fa7@changeid commit a4543e21ae363f4f094fb3c3503d77029e0c5d90 Author: Douglas Anderson Date: Mon Aug 29 09:49:49 2022 -0700 arm64: dts: qcom: sc8280xp-crd: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: ccd3517faf18 ("arm64: dts: qcom: sc8280xp: Add reference device") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Konrad Dybcio Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.3.Ie7d2c50d2b42ef2d364f3a0c8e300e5ce1875b79@changeid commit 09a1710b3e12e7ac8d871506bc395a9e8a0f63d6 Author: Douglas Anderson Date: Mon Aug 29 09:49:48 2022 -0700 arm64: dts: qcom: sa8295p-adp: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: 519183af39b2 ("arm64: dts: qcom: add SA8540P and ADP") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Konrad Dybcio Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.2.I430a56702ab0af65244e62667bb7743107de0c96@changeid commit bd9f3dcf42d943b53190f99bcdbcfe98a56ac4cd Author: Douglas Anderson Date: Mon Aug 29 09:49:47 2022 -0700 arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes". Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality. Let's re-enable the old functionality by fixing the dts. NOTE: while here, let's also remove the nonsensical "regulator-allow-set-load" on the fixed regulator "vreg_s4a_1p8". [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Fixes: 5b85e8f2225c ("arm64: dts: qcom: sa8155p-adp: Add base dts file") Signed-off-by: Douglas Anderson Reviewed-by: Andrew Halaney Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094903.v2.1.Id59c32b560c4662d8b3697de2bd494d08d654806@changeid commit 20772f506fa4aab4d03035807f30eecee856e274 Author: Dmitry Baryshkov Date: Wed Sep 21 12:52:58 2022 +0300 Revert "arm64: dts: qcom: msm8996: add missing TCSR syscon compatible" This reverts commit 8a99e0fc8bd3 ("arm64: dts: qcom: msm8996: add missing TCSR syscon compatible"). This commit marked the saw3 (syscon@9a10000) node as compatible with qcom,tcsr-msm8996. However the mentioned device is not not a TCSR (system registers, hardware mutex). It is a CPU power controller/regulator, which is currently being handled as a syscon. Fixes: 8a99e0fc8bd3 ("arm64: dts: qcom: msm8996: add missing TCSR syscon compatible") Cc: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921095258.2332568-1-dmitry.baryshkov@linaro.org commit 40b21d466a86bd5b10d24f59746ed41283a9b3f6 Author: Robert Marko Date: Fri Aug 19 00:06:27 2022 +0200 arm64: dts: qcom: ipq8074: correct APCS register space size APCS DTS addition that was merged, was not supposed to get merged as it was part of patch series that was superseded by 2 more patch series that resolved issues with this one and greatly simplified things. Since it already got merged, start by correcting the register space size as APCS will not be providing regmap for PLL and it will conflict with the standalone A53 PLL node. Fixes: 50ed9fffec3a ("arm64: dts: qcom: ipq8074: add APCS node") Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-8-robimarko@gmail.com commit ea68376c8bed5cd156900852aada20c3a0874d17 Author: Stanislav Fomichev Date: Fri Oct 14 17:24:44 2022 -0700 bpf: prevent decl_tag from being referenced in func_proto Syzkaller was able to hit the following issue: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 3609 at kernel/bpf/btf.c:1946 btf_type_id_size+0x2d5/0x9d0 kernel/bpf/btf.c:1946 Modules linked in: CPU: 0 PID: 3609 Comm: syz-executor361 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 RIP: 0010:btf_type_id_size+0x2d5/0x9d0 kernel/bpf/btf.c:1946 Code: ef e8 7f 8e e4 ff 41 83 ff 0b 77 28 f6 44 24 10 18 75 3f e8 6d 91 e4 ff 44 89 fe bf 0e 00 00 00 e8 20 8e e4 ff e8 5b 91 e4 ff <0f> 0b 45 31 f6 e9 98 02 00 00 41 83 ff 12 74 18 e8 46 91 e4 ff 44 RSP: 0018:ffffc90003cefb40 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000 RDX: ffff8880259c0000 RSI: ffffffff81968415 RDI: 0000000000000005 RBP: ffff88801270ca00 R08: 0000000000000005 R09: 000000000000000e R10: 0000000000000011 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000011 R14: ffff888026ee6424 R15: 0000000000000011 FS: 000055555641b300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000f2e258 CR3: 000000007110e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btf_func_proto_check kernel/bpf/btf.c:4447 [inline] btf_check_all_types kernel/bpf/btf.c:4723 [inline] btf_parse_type_sec kernel/bpf/btf.c:4752 [inline] btf_parse kernel/bpf/btf.c:5026 [inline] btf_new_fd+0x1926/0x1e70 kernel/bpf/btf.c:6892 bpf_btf_load kernel/bpf/syscall.c:4324 [inline] __sys_bpf+0xb7d/0x4cf0 kernel/bpf/syscall.c:5010 __do_sys_bpf kernel/bpf/syscall.c:5069 [inline] __se_sys_bpf kernel/bpf/syscall.c:5067 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:5067 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0fbae41c69 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc8aeb6228 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0fbae41c69 RDX: 0000000000000020 RSI: 0000000020000140 RDI: 0000000000000012 RBP: 00007f0fbae05e10 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007f0fbae05ea0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Looks like it tries to create a func_proto which return type is decl_tag. For the details, see Martin's spot on analysis in [0]. 0: https://lore.kernel.org/bpf/CAKH8qBuQDLva_hHxxBuZzyAcYNO4ejhovz6TQeVSk8HY-2SO6g@mail.gmail.com/T/#mea6524b3fcd6298347432226e81b1e6155efc62c Cc: Yonghong Song Cc: Martin KaFai Lau Fixes: bd16dee66ae4 ("bpf: Add BTF_KIND_DECL_TAG typedef support") Reported-by: syzbot+d8bd751aef7c6b39a344@syzkaller.appspotmail.com Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20221015002444.2680969-2-sdf@google.com Signed-off-by: Martin KaFai Lau commit 35cc9d622e8cd45029a1656ab2c6817538bc4180 Author: Stanislav Fomichev Date: Fri Oct 14 17:24:43 2022 -0700 selftests/bpf: Add reproducer for decl_tag in func_proto return type It should trigger a WARN_ON_ONCE in btf_type_id_size. btf_func_proto_check kernel/bpf/btf.c:4447 [inline] btf_check_all_types kernel/bpf/btf.c:4723 [inline] btf_parse_type_sec kernel/bpf/btf.c:4752 [inline] btf_parse kernel/bpf/btf.c:5026 [inline] btf_new_fd+0x1926/0x1e70 kernel/bpf/btf.c:6892 bpf_btf_load kernel/bpf/syscall.c:4324 [inline] __sys_bpf+0xb7d/0x4cf0 kernel/bpf/syscall.c:5010 __do_sys_bpf kernel/bpf/syscall.c:5069 [inline] __se_sys_bpf kernel/bpf/syscall.c:5067 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:5067 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Cc: Yonghong Song Cc: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20221015002444.2680969-1-sdf@google.com Signed-off-by: Martin KaFai Lau commit 10f3f10f202109e3841c0c75add5a743ca197205 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:39 2022 -0700 MAINTAINERS: git://github -> https://github.com for broadcom Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Acked-by: William Zhang Reviewed-by: Philippe Mathieu-Daudé Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Florian Fainelli commit bbb8ceb5e2421184db9560e9d2cfaf858e1db616 Merge: 9abf2313adc1c 96cb9d0554457 Author: Linus Torvalds Date: Mon Oct 17 10:20:04 2022 -0700 Merge tag 'v6.1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "This fixes an issue exposed by the recent change to feed untrusted sources into /dev/random" * tag 'v6.1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() commit 33806e7cb8d50379f55c3e8f335e91e1b359dc7b Author: Nathan Chancellor Date: Thu Sep 29 08:20:10 2022 -0700 x86/Kconfig: Drop check for -mabi=ms for CONFIG_EFI_STUB A recent change in LLVM made CONFIG_EFI_STUB unselectable because it no longer pretends to support -mabi=ms, breaking the dependency in Kconfig. Lack of CONFIG_EFI_STUB can prevent kernels from booting via EFI in certain circumstances. This check was added by 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi") to ensure that __attribute__((ms_abi)) was available, as -mabi=ms is not actually used in any cflags. According to the GCC documentation, this attribute has been supported since GCC 4.4.7. The kernel currently requires GCC 5.1 so this check is not necessary; even when that change landed in 5.6, the kernel required GCC 4.9 so it was unnecessary then as well. Clang supports __attribute__((ms_abi)) for all versions that are supported for building the kernel so no additional check is needed. Remove the 'depends on' line altogether to allow CONFIG_EFI_STUB to be selected when CONFIG_EFI is enabled, regardless of compiler. Fixes: 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi") Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Acked-by: Ard Biesheuvel Cc: stable@vger.kernel.org Link: https://github.com/llvm/llvm-project/commit/d1ad006a8f64bdc17f618deffa9e7c91d82c444d commit 897a66d281983c4fe2b805f26b315309b35fb028 Author: Jon Hunter Date: Mon Oct 17 09:40:06 2022 +0100 Revert "PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro" This reverts commit 8bb7ff12a91429eb76e093b517ae810b146448fe. Commit 8bb7ff12a914 ("PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro") updated the Tegra PCI driver to use the macro PCI_CONF1_EXT_ADDRESS() instead of a local function in the Tegra PCI driver. This broke PCI for some Tegra platforms because, when calculating the offset value, the mask applied to the lower 8-bits changed from 0xff to 0xfc. For now, fix this by reverting this commit. Fixes: 8bb7ff12a914 ("PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro") Link: https://lore.kernel.org/r/20221017084006.11770-1-jonathanh@nvidia.com Signed-off-by: Jon Hunter Signed-off-by: Bjorn Helgaas Acked-by: Thierry Reding Acked-by: Lorenzo Pieralisi commit 8e5bad7dccec2014f24497b57d8a8ee0b752c290 Author: Kees Cook Date: Fri Oct 7 17:07:58 2022 -0700 sched: Introduce struct balance_callback to avoid CFI mismatches Introduce distinct struct balance_callback instead of performing function pointer casting which will trip CFI. Avoids warnings as found by Clang's future -Wcast-function-type-strict option: In file included from kernel/sched/core.c:84: kernel/sched/sched.h:1755:15: warning: cast from 'void (*)(struct rq *)' to 'void (*)(struct callback_head *)' converts to incompatible function type [-Wcast-function-type-strict] head->func = (void (*)(struct callback_head *))func; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ No binary differences result from this change. This patch is a cleanup based on Brad Spengler/PaX Team's modifications to sched code in their last public patch of grsecurity/PaX based on my understanding of the code. Changes or omissions from the original code are mine and don't reflect the original grsecurity/PaX code. Reported-by: Sami Tolvanen Signed-off-by: Kees Cook Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/1724 Link: https://lkml.kernel.org/r/20221008000758.2957718-1-keescook@chromium.org commit e705968dd687574b6ca3ebe772683d5642759132 Author: Lin Shengwang Date: Sat Oct 8 10:27:09 2022 +0800 sched/core: Fix comparison in sched_group_cookie_match() In commit 97886d9dcd86 ("sched: Migration changes for core scheduling"), sched_group_cookie_match() was added to help determine if a cookie matches the core state. However, while it iterates the SMT group, it fails to actually use the RQ for each of the CPUs iterated, use cpu_rq(cpu) instead of rq to fix things. Fixes: 97886d9dcd86 ("sched: Migration changes for core scheduling") Signed-off-by: Lin Shengwang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221008022709.642-1-linshengwang1@huawei.com commit 21da7472a040420f2dc624ffec70291a72c5d6a6 Author: Sumanth Korikkar Date: Fri Oct 7 10:13:27 2022 +0200 bpf: Fix sample_flags for bpf_perf_event_output * Raw data is also filled by bpf_perf_event_output. * Add sample_flags to indicate raw data. * This eliminates the segfaults as shown below: Run ./samples/bpf/trace_output BUG pid 9 cookie 1001000000004 sized 4 BUG pid 9 cookie 1001000000004 sized 4 BUG pid 9 cookie 1001000000004 sized 4 Segmentation fault (core dumped) Fixes: 838d9bb62d13 ("perf: Use sample_flags for raw_data") Signed-off-by: Sumanth Korikkar Signed-off-by: Peter Zijlstra (Intel) Acked-by: Namhyung Kim Link: https://lkml.kernel.org/r/20221007081327.1047552-1-sumanthk@linux.ibm.com commit 23488ec66867f7e673b694623a951fb583e464a7 Author: Marco Elver Date: Tue Oct 11 14:45:35 2022 +0200 selftests/perf_events: Add a SIGTRAP stress test with disables Add a SIGTRAP stress test that exercises repeatedly enabling/disabling an event while it concurrently keeps firing. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/Y0E3uG7jOywn7vy3@elver.google.com/ commit ca6c21327c6af02b7eec31ce4b9a740a18c6c13f Author: Peter Zijlstra Date: Thu Oct 6 15:00:39 2022 +0200 perf: Fix missing SIGTRAPs Marco reported: Due to the implementation of how SIGTRAP are delivered if perf_event_attr::sigtrap is set, we've noticed 3 issues: 1. Missing SIGTRAP due to a race with event_sched_out() (more details below). 2. Hardware PMU events being disabled due to returning 1 from perf_event_overflow(). The only way to re-enable the event is for user space to first "properly" disable the event and then re-enable it. 3. The inability to automatically disable an event after a specified number of overflows via PERF_EVENT_IOC_REFRESH. The worst of the 3 issues is problem (1), which occurs when a pending_disable is "consumed" by a racing event_sched_out(), observed as follows: CPU0 | CPU1 --------------------------------+--------------------------- __perf_event_overflow() | perf_event_disable_inatomic() | pending_disable = CPU0 | ... | _perf_event_enable() | event_function_call() | task_function_call() | /* sends IPI to CPU0 */ | ... __perf_event_enable() +--------------------------- ctx_resched() task_ctx_sched_out() ctx_sched_out() group_sched_out() event_sched_out() pending_disable = -1 perf_pending_event() perf_pending_event_disable() /* Fails to send SIGTRAP because no pending_disable! */ In the above case, not only is that particular SIGTRAP missed, but also all future SIGTRAPs because 'event_limit' is not reset back to 1. To fix, rework pending delivery of SIGTRAP via IRQ-work by introduction of a separate 'pending_sigtrap', no longer using 'event_limit' and 'pending_disable' for its delivery. Additionally; and different to Marco's proposed patch: - recognise that pending_disable effectively duplicates oncpu for the case where it is set. As such, change the irq_work handler to use ->oncpu to target the event and use pending_* as boolean toggles. - observe that SIGTRAP targets the ctx->task, so the context switch optimization that carries contexts between tasks is invalid. If the irq_work were delayed enough to hit after a context switch the SIGTRAP would be delivered to the wrong task. - observe that if the event gets scheduled out (rotation/migration/context-switch/...) the irq-work would be insufficient to deliver the SIGTRAP when the event gets scheduled back in (the irq-work might still be pending on the old CPU). Therefore have event_sched_out() convert the pending sigtrap into a task_work which will deliver the signal at return_to_user. Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events") Reported-by: Dmitry Vyukov Debugged-by: Dmitry Vyukov Reported-by: Marco Elver Debugged-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marco Elver Tested-by: Marco Elver commit ec0286dce78c3bb0e6a665c0baade2f2db56ce00 Author: Dan Carpenter Date: Wed Oct 12 17:51:25 2022 +0300 counter: ti-ecap-capture: fix IS_ERR() vs NULL check The devm_counter_alloc() function returns NULL on error. It doesn't return error pointers. Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP") Signed-off-by: Dan Carpenter Reviewed-by: Julien Panis Acked-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/Y0bUbZvfDJHBG9C6@kili/ Signed-off-by: William Breathitt Gray commit 472a1482325b3a285e0bcf82c0b0edc689b7e8cd Author: William Breathitt Gray Date: Sun Oct 2 08:04:19 2022 -0400 counter: Reduce DEFINE_COUNTER_ARRAY_POLARITY() to defining counter_array A spare warning was reported for drivers/counter/ti-ecap-capture.c:: sparse warnings: (new ones prefixed by >>) >> drivers/counter/ti-ecap-capture.c:380:8: sparse: sparse: symbol 'ecap_cnt_pol_array' was not declared. Should it be static? vim +/ecap_cnt_pol_array +380 drivers/counter/ti-ecap-capture.c 379 > 380 static DEFINE_COUNTER_ARRAY_POLARITY(ecap_cnt_pol_array, ecap_cnt_pol_avail, ECAP_NB_CEVT); 381 The first argument to the DEFINE_COUNTER_ARRAY_POLARITY() macro is a token serving as the symbol name in the definition of a new struct counter_array structure. However, this macro actually expands to two statements:: #define DEFINE_COUNTER_ARRAY_POLARITY(_name, _enums, _length) \ DEFINE_COUNTER_AVAILABLE(_name##_available, _enums); \ struct counter_array _name = { \ .type = COUNTER_COMP_SIGNAL_POLARITY, \ .avail = &(_name##_available), \ .length = (_length), \ } Because of this, the "static" on line 380 only applies to the first statement. This patch splits out the DEFINE_COUNTER_AVAILABLE() line and leaves DEFINE_COUNTER_ARRAY_POLARITY() as a simple structure definition to avoid issues like this. Reported-by: kernel test robot Link: https://lore.kernel.org/all/202210020619.NQbyomII-lkp@intel.com/ Cc: Julien Panis Signed-off-by: William Breathitt Gray commit a401f45e38754953c9d402f8b3bc965707eecc91 Author: Chang S. Bae Date: Wed Aug 24 12:12:23 2022 -0700 x86/fpu: Exclude dynamic states from init_fpstate == Background == The XSTATE init code initializes all enabled and supported components. Then, the init states are saved in the init_fpstate buffer that is statically allocated in about one page. The AMX TILE_DATA state is large (8KB) but its init state is zero. And the feature comes only with the compacted format with these established dependencies: AMX->XFD->XSAVES. So this state is excludable from init_fpstate. == Problem == But the buffer is formatted to include that large state. Then, this can be the cause of a noisy splat like the below. This came from XRSTORS for the task with init_fpstate in its XSAVE buffer. It is reproducible on AMX systems when the running kernel is built with CONFIG_DEBUG_PAGEALLOC=y and CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y: Bad FPU state detected at restore_fpregs_from_fpstate+0x57/0xd0, reinitializing FPU registers. ... RIP: 0010:restore_fpregs_from_fpstate+0x57/0xd0 ? restore_fpregs_from_fpstate+0x45/0xd0 switch_fpu_return+0x4e/0xe0 exit_to_user_mode_prepare+0x17b/0x1b0 syscall_exit_to_user_mode+0x29/0x40 do_syscall_64+0x67/0x80 ? do_syscall_64+0x67/0x80 ? exc_page_fault+0x86/0x180 entry_SYSCALL_64_after_hwframe+0x63/0xcd == Solution == Adjust init_fpstate to exclude dynamic states. XRSTORS from init_fpstate still initializes those states when their bits are set in the requested-feature bitmap. Fixes: 2308ee57d93d ("x86/fpu/amx: Enable the AMX feature in 64-bit mode") Reported-by: Lin X Wang Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Tested-by: Lin X Wang Link: https://lore.kernel.org/r/20220824191223.1248-4-chang.seok.bae@intel.com commit d3e021adac7c51a26d9ede167c789fcc1b878467 Author: Chang S. Bae Date: Wed Aug 24 12:12:22 2022 -0700 x86/fpu: Fix the init_fpstate size check with the actual size The init_fpstate buffer is statically allocated. Thus, the sanity test was established to check whether the pre-allocated buffer is enough for the calculated size or not. The currently measured size is not strictly relevant. Fix to validate the calculated init_fpstate size with the pre-allocated area. Also, replace the sanity check function with open code for clarity. The abstraction itself and the function naming do not tend to represent simply what it does. Fixes: 2ae996e0c1a3 ("x86/fpu: Calculate the default sizes independently") Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220824191223.1248-3-chang.seok.bae@intel.com commit c32d7cab57e3a77af8ecc17cde7a5761a26483b8 Author: Chang S. Bae Date: Wed Aug 24 12:12:21 2022 -0700 x86/fpu: Configure init_fpstate attributes orderly The init_fpstate setup code is spread out and out of order. The init image is recorded before its scoped features and the buffer size are determined. Determine the scope of init_fpstate components and its size before recording the init state. Also move the relevant code together. Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Acked-by: neelnatu@google.com Link: https://lore.kernel.org/r/20220824191223.1248-2-chang.seok.bae@intel.com commit 17cc1ee6e83b16989118237294327bd0dd12b1a4 Author: Damien Le Moal Date: Thu Oct 13 17:16:10 2022 +0900 ata: ahci_st: Fix compilation warning If CONFIG_OF is disabled and the ahci_st driver is builtin (or CONFIG_MODULES is disabled), then using the macro of_match_ptr() results in the st_ahci_match variable being unused, which generates a compilation warning and a compilation error if CONFIG_WERROR is enabled. Fix this by directly assigning st_ahci_match to .of_match_table in the st_ahci_driver platform driver definition. Reported-by: kernel test robot Signed-off-by: Damien Le Moal Acked-by: Arnd Bergmann commit 849c19d14940b87332d5d59c7fc581d73f2099fd Author: FUKAUMI Naoki Date: Sat Sep 24 11:28:12 2022 +0000 arm64: dts: rockchip: keep I2S1 disabled for GPIO function on ROCK Pi 4 series I2S1 pins are exposed on 40-pin header on Radxa ROCK Pi 4 series. their default function is GPIO, so I2S1 need to be disabled. Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220924112812.1219-1-naoki@radxa.com Signed-off-by: Heiko Stuebner commit 2dcd7e0c821fe9b663f7d3382b6d2faa8edf2129 Author: Lev Popov Date: Mon Sep 26 14:53:48 2022 +0200 arm64: dts: rockchip: fix quartz64-a bluetooth configuration For "Quartz64 Model A" add missing RTS line to the UART interface used by bluetooth and swap bluetooth host-wakeup and device-wakeup gpio pins to match the boards physical layout. This changes are necessary to make bluetooth provided by the wireless module work. Also set max-speed on the bluetooth device as it's not automatically detected. Fixes: b33a22a1e7c4 ("arm64: dts: rockchip: add basic dts for Pine64 Quartz64-A") Signed-off-by: Lev Popov Link: https://lore.kernel.org/r/20220926125350.64783-1-leo@nabam.net Signed-off-by: Heiko Stuebner commit 463be3cb357dab7d7e4d8dcc7c15c642e10c5bef Author: Jensen Huang Date: Wed Sep 28 17:11:29 2022 +0800 arm64: dts: rockchip: add enable-strobe-pulldown to emmc phy on nanopi4 Internal pull-down for strobe line (GRF_EMMCPHY_CON2[9]) was disabled by commit 8b5c2b45b8f0, which causes I/O error in HS400 mode. Tested on NanoPC-T4. Fixes: 8b5c2b45b8f0 ("phy: rockchip: set pulldown for strobe line in dts") Signed-off-by: Jensen Huang Link: https://lore.kernel.org/r/20220928091129.20597-1-jensenhuang@friendlyarm.com Signed-off-by: Heiko Stuebner commit 80852f8268769715db335a22305e81a0c4a38a84 Author: Siarhei Volkau Date: Sun Oct 16 16:26:45 2022 +0300 ASoC: codecs: jz4725b: fix capture selector naming At the moment Capture source selector appears on Playback tab in the alsamixer and has a senseless name. Let's fix that. Signed-off-by: Siarhei Volkau Link: https://lore.kernel.org/r/20221016132648.3011729-5-lis8215@gmail.com Signed-off-by: Mark Brown commit 1538e2c8c9b7e7a656effcc6e4e7cfe8c1b405fd Author: Siarhei Volkau Date: Sun Oct 16 16:26:44 2022 +0300 ASoC: codecs: jz4725b: use right control for Capture Volume Line In Bypass control is used as Master Capture at the moment this is completely incorrect. Current control routed to Mixer instead of ADC, thus can't affect Capture path. ADC control shall be used instead. ADC volume control parameters are different, so the patch fixes that as well. Manual says (16.6.3.2 Programmable input attenuation amplifier: PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step. Signed-off-by: Siarhei Volkau Link: https://lore.kernel.org/r/20221016132648.3011729-4-lis8215@gmail.com Signed-off-by: Mark Brown commit 088777bf65b98cfa4b5378119d0a7d49a58ece44 Author: Siarhei Volkau Date: Sun Oct 16 16:26:43 2022 +0300 ASoC: codecs: jz4725b: fix reported volume for Master ctl DAC volume control is the Master Playback Volume at the moment and it reports wrong levels in alsamixer and other alsa apps. The patch fixes that, as stated in manual on the jz4725b SoC (16.6.3.4 Programmable attenuation: GOD) the ctl range varies from -22.5dB to 0dB with 1.5dB step. Signed-off-by: Siarhei Volkau Link: https://lore.kernel.org/r/20221016132648.3011729-3-lis8215@gmail.com Signed-off-by: Mark Brown commit 1013999b431b4bcdc1f5ae47dd3338122751db31 Author: Siarhei Volkau Date: Sun Oct 16 16:26:42 2022 +0300 ASoC: codecs: jz4725b: add missed Line In power control bit Line In path stayed powered off during capturing or bypass to mixer. Signed-off-by: Siarhei Volkau Link: https://lore.kernel.org/r/20221016132648.3011729-2-lis8215@gmail.com Signed-off-by: Mark Brown commit b44bc59d0d279fa4f3dc11b895f2c8f77719885d Author: Furkan Kardame Date: Mon Oct 10 22:01:42 2022 +0300 arm64: dts: rockchip: remove i2c5 from rk3566-roc-pc i2c5 is owned by hdmi port Signed-off-by: Furkan Kardame Link: https://lore.kernel.org/r/20221010190142.18340-4-f.kardame@manjaro.org Signed-off-by: Heiko Stuebner commit 25b72d530e7aa185955196b63f53c38f751f1632 Author: Kees Cook Date: Wed Oct 12 12:18:54 2022 -0700 fbdev: MIPS supports iomem addresses Add MIPS to fb_* helpers list for iomem addresses. This silences Sparse warnings about lacking __iomem address space casts: drivers/video/fbdev/pvr2fb.c:800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) drivers/video/fbdev/pvr2fb.c:800:9: sparse: expected void const * drivers/video/fbdev/pvr2fb.c:800:9: sparse: got char [noderef] __iomem *screen_base Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202210100209.tR2Iqbqk-lkp@intel.com/ Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Signed-off-by: Helge Deller commit 2440ad0d851e404adcd1b9ad758f28bd59365bae Author: Furkan Kardame Date: Mon Oct 10 22:01:41 2022 +0300 arm64: dts: rockchip: Fix i2c3 pinctrl on rk3566-roc-pc As per device schematic i2c3 pinctrl is connected to m0 instead of m1 Signed-off-by: Furkan Kardame Link: https://lore.kernel.org/r/20221010190142.18340-3-f.kardame@manjaro.org Signed-off-by: Heiko Stuebner commit adbab347ec8861aa80d850693df3cd005ec65a99 Author: Furkan Kardame Date: Mon Oct 10 22:01:40 2022 +0300 arm64: dts: rockchip: Fix gmac failure of rgmii-id from rk3566-roc-pc Lan does not work on rgmii-id, most rk356x devices lan is being switched to rgmii. Signed-off-by: Furkan Kardame Link: https://lore.kernel.org/r/20221010190142.18340-2-f.kardame@manjaro.org Signed-off-by: Heiko Stuebner commit ef40e88d1be172ca05e6e8cef00284a1cf4f43d8 Author: Brian Norris Date: Thu Oct 13 14:33:35 2022 -0700 arm64: dts: rockchip: Drop RK3399-Scarlet's repeated ec_ap_int_l definition This is repeated a few lines down. Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20221013213336.1779917-1-briannorris@chromium.org Signed-off-by: Heiko Stuebner commit b40af6183b685b0cf7870987b858de0d48db9ea0 Author: Robert Marko Date: Thu Oct 6 21:48:19 2022 +0200 spi: qup: support using GPIO as chip select line Most of the device with QUP SPI adapter are actually using GPIO-s for chip select. However, this stopped working after ("spi: Retire legacy GPIO handling") as it introduced a check on ->use_gpio_descriptors flag and since spi-qup driver does not set the flag it meant that all of boards using GPIO-s and with QUP adapter SPI devices stopped working. So, to enable using GPIO-s again set ->use_gpio_descriptors to true and populate ->max_native_cs. Fixes: f48dc6b96649 ("spi: Retire legacy GPIO handling") Signed-off-by: Robert Marko Cc: luka.perkov@sartura.hr Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20221006194819.1536932-1-robert.marko@sartura.hr Signed-off-by: Mark Brown commit a8dfb85095dd8b884ee962e64b16ef52bc54119d Author: Yang Yingliang Date: Fri Oct 14 09:36:40 2022 +0800 ALSA: hda/realtek: simplify the return of comp_bind() After commit 23904f7b2518 ("ALSA: hda: cs35l41: Remove suspend/resume hda hooks"), the return of comp_bind() can be simplified. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221014013640.1142107-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit d21f4b7ffc22c009da925046b69b15af08de9d75 Author: Douglas Anderson Date: Fri Oct 14 10:33:18 2022 -0700 pinctrl: qcom: Avoid glitching lines when we first mux to output Back in the description of commit e440e30e26dd ("arm64: dts: qcom: sc7180: Avoid glitching SPI CS at bootup on trogdor") we described a problem that we were seeing on trogdor devices. I'll re-summarize here but you can also re-read the original commit. On trogdor devices, the BIOS is setting up the SPI chip select as: - mux special function (SPI chip select) - output enable - output low (unused because we've muxed as special function) In the kernel, however, we've moved away from using the chip select line as special function. Since the kernel wants to fully control the chip select it's far more efficient to treat the line as a GPIO rather than sending packet-like commands to the GENI firmware every time we want the line to toggle. When we transition from how the BIOS had the pin configured to how the kernel has the pin configured we end up glitching the line. That's because we _first_ change the mux of the line and then later set its output. This glitch is bad and can confuse the device on the other end of the line. The old commit e440e30e26dd ("arm64: dts: qcom: sc7180: Avoid glitching SPI CS at bootup on trogdor") fixed the glitch, though the solution was far from elegant. It essentially did the thing that everyone always hates: encoding a sequential program in device tree, even if it's a simple one. It also, unfortunately, got broken by commit b991f8c3622c ("pinctrl: core: Handling pinmux and pinconf separately"). After that commit we did all the muxing _first_ even though the config (set the pin to output high) was listed first. :( I looked at ideas for how to solve this more properly. My first thought was to use the "init" pinctrl state. In theory the "init" pinctrl state is supposed to be exactly for achieving glitch-free transitions. My dream would have been for the "init" pinctrl to do nothing at all. That would let us delay the automatic pin muxing until the driver could set things up and call pinctrl_init_done(). In other words, my dream was: /* Request the GPIO; init it 1 (because DT says GPIO_ACTIVE_LOW) */ devm_gpiod_get_index(dev, "cs", GPIOD_OUT_LOW); /* Output should be right, so we can remux, yay! */ pinctrl_init_done(dev); Unfortunately, it didn't work out. The primary reason is that the MSM GPIO driver implements gpio_request_enable(). As documented in pinmux.h, that function automatically remuxes a line as a GPIO. ...and it does this remuxing _before_ specifying the output of the pin. You can see in gpiod_get_index() that we call gpiod_request() before gpiod_configure_flags(). gpiod_request() isn't passed any flags so it has no idea what the eventual output will be. We could have debates about whether or not the automatic remuxing to GPIO for the MSM pinctrl was a good idea or not, but at this point I think there is a plethora of code that's relying on it and I certainly wouldn't suggest changing it. Alternatively, we could try to come up with a way to pass the initial output state to gpio_request_enable() and plumb all that through. That seems like it would be doable, but we'd have to plumb it through several layers in the stack. This patch implements yet another alternative. Here, we specifically avoid glitching the first time a pin is muxed to GPIO function if the direction of the pin is output. The idea is that we can read the state of the pin before we set the mux and make sure that the re-mux won't change the state. NOTES: - We only do this the first time since later swaps between mux states might want to preserve the old output value. In other words, I wouldn't want to break a driver that did: gpiod_set_value(g, 1); pinctrl_select_state(pinctrl, special_state); pinctrl_select_default_state(); /* We should be driving 1 even if "special_state" made the pin 0 */ - It's safe to do this the first time since the driver _couldn't_ have explicitly set a state. In order to even be able to control the GPIO (at least using gpiod) we have to have requested it which would have counted as the first mux. - In theory, instead of keeping track of the first time a pin was set as a GPIO we could enable the glitch-free behavior only when msm_pinmux_request_gpio() is in the callchain. That works an enables my "dream" implementation above where we use an "init" state to solve this. However, it's nice not to have to do this. By handling just the first transition to GPIO we can simply let the normal "default" remuxing happen and we can be assured that there won't be a glitch. Before this change I could see the glitch reported on the EC console when booting. It would say this when booting the kernel: Unexpected state 1 in CSNRE ISR After this change there is no error reported. Note that I haven't reproduced the original problem described in e440e30e26dd ("arm64: dts: qcom: sc7180: Avoid glitching SPI CS at bootup on trogdor") but I could believe it might happen in certain timing conditions. Fixes: b991f8c3622c ("pinctrl: core: Handling pinmux and pinconf separately") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20221014103217.1.I656bb2c976ed626e5d37294eb252c1cf3be769dc@changeid Signed-off-by: Linus Walleij commit 9972e6b404884adae9eec7463e30d9b3c9a70b18 Author: Matthew Ma Date: Fri Oct 14 11:49:51 2022 +0800 mmc: core: Fix kernel panic when remove non-standard SDIO card SDIO tuple is only allocated for standard SDIO card, especially it causes memory corruption issues when the non-standard SDIO card has removed, which is because the card device's reference counter does not increase for it at sdio_init_func(), but all SDIO card device reference counter gets decreased at sdio_release_func(). Fixes: 6f51be3d37df ("sdio: allow non-standard SDIO cards") Signed-off-by: Matthew Ma Reviewed-by: Weizhao Ouyang Reviewed-by: John Wang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221014034951.2300386-1-ouyangweizhao@zeku.com Signed-off-by: Ulf Hansson commit 9dc0033e4658d6f9d9952c3c0c6be3ec25bc2985 Author: Patrick Thompson Date: Thu Oct 13 17:00:17 2022 -0400 mmc: sdhci-pci-core: Disable ES for ASUS BIOS on Jasper Lake Enhanced Strobe (ES) does not work correctly on the ASUS 1100 series of devices. Jasper Lake eMMCs (pci_id 8086:4dc4) are supposed to support ES. There are also two system families under the series, thus this is being scoped to the ASUS BIOS. The failing ES prevents the installer from writing to disk. Falling back to HS400 without ES fixes the issue. Signed-off-by: Patrick Thompson Fixes: 315e3bd7ac19 ("mmc: sdhci-pci: Add support for Intel JSL") Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221013210017.3751025-1-ptf@google.com Signed-off-by: Ulf Hansson commit 1ed5c3b22fc78735c539e4767832aea58db6761c Author: Sascha Hauer Date: Thu Oct 13 11:32:48 2022 +0200 mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus The core issues the warning "drop HS400 support since no 8-bit bus" when one of the ESDHC_FLAG_HS400* flags is set on a non 8bit capable host. To avoid this warning set these flags only on hosts that actually can do 8bit, i.e. have bus-width = <8> set in the device tree. Signed-off-by: Sascha Hauer Reviewed-by: Haibo Chen Fixes: 029e2476f9e6 ("mmc: sdhci-esdhc-imx: add HS400_ES support for i.MX8QXP") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221013093248.2220802-1-s.hauer@pengutronix.de Signed-off-by: Ulf Hansson commit 339e3eb1facd18a98ceb1171d70674780e5014a7 Author: Christian Löhle Date: Fri Oct 7 15:43:52 2022 +0000 mmc: queue: Cancel recovery work on cleanup To prevent any recovery work running after the queue cleanup cancel it. Any recovery running post-cleanup dereferenced mq->card as NULL and was not meaningful to begin with. Cc: stable@vger.kernel.org Signed-off-by: Christian Loehle Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/c865c0c9789d428494b67b820a78923e@hyperstone.com Signed-off-by: Ulf Hansson commit 406e14808ee695cbae1eafa5fd3ac563c29470ab Author: Christian Löhle Date: Thu Oct 13 11:16:37 2022 +0000 mmc: block: Remove error check of hw_reset on reset Before switching back to the right partition in mmc_blk_reset there used to be a check if hw_reset was even supported. This return value was removed, so there is no reason to check. Furthermore ensure part_curr is not falsely set to a valid value on reset or partition switch error. As part of this change the code paths of mmc_blk_reset calls were checked to ensure no commands are issued after a failed mmc_blk_reset directly without going through the block layer. Fixes: fefdd3c91e0a ("mmc: core: Drop superfluous validations in mmc_hw|sw_reset()") Cc: stable@vger.kernel.org Signed-off-by: Christian Loehle Reviewed-by: Adrian Hunter Link: https://lore.kernel.org/r/e91be6199d04414a91e20611c81bfe1d@hyperstone.com Signed-off-by: Ulf Hansson commit 17747577bbcb496e1b1c4096d64c2fc1e7bc0fef Author: Siarhei Volkau Date: Sun Oct 16 18:35:48 2022 +0300 pinctrl: Ingenic: JZ4755 bug fixes Fixes UART1 function bits and MMC groups typo. For pins 0x97,0x99 function 0 is designated to PWM3/PWM5 respectively, function is 1 designated to the UART1. Diff from v1: - sent separately - added tag Fixes Cc: stable@vger.kernel.org Fixes: b582b5a434d3 ("pinctrl: Ingenic: Add pinctrl driver for JZ4755.") Tested-by: Siarhei Volkau Signed-off-by: Siarhei Volkau Link: https://lore.kernel.org/r/20221016153548.3024209-1-lis8215@gmail.com Signed-off-by: Linus Walleij commit 402fe7a5728789f3a3998d2823b7a110f4cd924e Author: Jiapeng Chong Date: Mon Oct 17 14:49:20 2022 +0800 net: ethernet: mediatek: ppe: Remove the unused function mtk_foe_entry_usable() The function mtk_foe_entry_usable() is defined in the mtk_ppe.c file, but not called elsewhere, so delete this unused function. drivers/net/ethernet/mediatek/mtk_ppe.c:400:20: warning: unused function 'mtk_foe_entry_usable'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2409 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller commit a887b59f6a168e13a7608c64b61e6d5b769f80ee Merge: 2d1f274b95c6e e0bb4659e2357 Author: David S. Miller Date: Mon Oct 17 09:35:06 2022 +0100 Merge branch 'mtk_eth_wed-leak-fixes' Yang Yingliang says: ==================== net: ethernet: mtk_eth_wed: fixe some leaks I found some leaks in mtk_eth_soc.c/mtk_wed.c. patch#1 - I found mtk_wed_exit() is never called, I think mtk_wed_exit() need be called in error path or module remove function to free the memory allocated in mtk_wed_add_hw(). patch#2 - The device is not put in error path in mtk_wed_add_hw(). patch#3 - The device_node pointer returned by of_parse_phandle() with refcount incremented, it should be decreased when it done. This patchset was just compiled tested because I don't have any HW on which to do the actual tests. ==================== Signed-off-by: David S. Miller commit e0bb4659e235770e6f53b3692e958591f49448f5 Author: Yang Yingliang Date: Mon Oct 17 11:51:56 2022 +0800 net: ethernet: mtk_eth_wed: add missing of_node_put() The device_node pointer returned by of_parse_phandle() with refcount incremented, when finish using it, the refcount need be decreased. Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 9d4f20a476ca57e4c9246eb1fa2a61bea2354720 Author: Yang Yingliang Date: Mon Oct 17 11:51:55 2022 +0800 net: ethernet: mtk_eth_wed: add missing put_device() in mtk_wed_add_hw() After calling get_device() in mtk_wed_add_hw(), in error path, put_device() needs be called. Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit b3d0d98179d62f9d55635a600679c4fa362baf8d Author: Yang Yingliang Date: Mon Oct 17 11:51:54 2022 +0800 net: ethernet: mtk_eth_soc: fix possible memory leak in mtk_probe() If mtk_wed_add_hw() has been called, mtk_wed_exit() needs be called in error path or removing module to free the memory allocated in mtk_wed_add_hw(). Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit a10a0f385ab8af08ddb762ac3eca11e1b6d1fe69 Author: Matti Vaittinen Date: Mon Oct 3 11:11:12 2022 +0300 iio: bmc150-accel-core: Fix unsafe buffer attributes The iio_triggered_buffer_setup_ext() was changed by commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") to silently expect that all attributes given in buffer_attrs array are device-attributes. This expectation was not forced by the API - and some drivers did register attributes created by IIO_CONST_ATTR(). The added attribute "wrapping" does not copy the pointer to stored string constant and when the sysfs file is read the kernel will access to invalid location. Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order to prevent the invalid memory access. Signed-off-by: Matti Vaittinen Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Link: https://lore.kernel.org/r/cf8a56658fc38db8bed64f456d898f5ad5a2814f.1664782676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 5e23b33d1e84f04c80da6f1d89cbb3d3a3f81e01 Author: Matti Vaittinen Date: Mon Oct 3 11:10:29 2022 +0300 iio: adxl367: Fix unsafe buffer attributes The devm_iio_kfifo_buffer_setup_ext() was changed by commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") to silently expect that all attributes given in buffer_attrs array are device-attributes. This expectation was not forced by the API - and some drivers did register attributes created by IIO_CONST_ATTR(). The added attribute "wrapping" does not copy the pointer to stored string constant and when the sysfs file is read the kernel will access to invalid location. Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order to prevent the invalid memory access. Signed-off-by: Matti Vaittinen Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Cc: Link: https://lore.kernel.org/r/2e2d9ec34fb1df8ab8e2749199822db8cc91d302.1664782676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit ab0ee36e90f611f32c3a53afe9dc743de48138e2 Author: Matti Vaittinen Date: Mon Oct 3 11:10:51 2022 +0300 iio: adxl372: Fix unsafe buffer attributes The iio_triggered_buffer_setup_ext() was changed by commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") to silently expect that all attributes given in buffer_attrs array are device-attributes. This expectation was not forced by the API - and some drivers did register attributes created by IIO_CONST_ATTR(). The added attribute "wrapping" does not copy the pointer to stored string constant and when the sysfs file is read the kernel will access to invalid location. Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order to prevent the invalid memory access. Signed-off-by: Matti Vaittinen Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Cc: Link: https://lore.kernel.org/r/19158499623cdf7f9c5efae1f13c9f1a918ff75f.1664782676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 54246b9034da08087ceb2083478c0d13403e12b4 Author: Matti Vaittinen Date: Mon Oct 3 11:11:33 2022 +0300 iio: at91-sama5d2_adc: Fix unsafe buffer attributes The iio_triggered_buffer_setup_ext() was changed by commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") to silently expect that all attributes given in buffer_attrs array are device-attributes. This expectation was not forced by the API - and some drivers did register attributes created by IIO_CONST_ATTR(). The added attribute "wrapping" does not copy the pointer to stored string constant and when the sysfs file is read the kernel will access to invalid location. Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order to prevent the invalid memory access. Signed-off-by: Matti Vaittinen Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Tested-by: Claudiu Beznea Link: https://lore.kernel.org/r/be69775aa302159f088b8b91894e6ec449bca65b.1664782676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 4132f19173211856d35180958d2754f5c56d520a Author: Cosmin Tanislav Date: Fri Oct 14 15:37:22 2022 +0300 iio: temperature: ltc2983: allocate iio channels once Currently, every time the device wakes up from sleep, the iio_chan array is reallocated, leaking the previous one until the device is removed (basically never). Move the allocation to the probe function to avoid this. Signed-off-by: Cosmin Tanislav Fixes: f110f3188e563 ("iio: temperature: Add support for LTC2983") Cc: Link: https://lore.kernel.org/r/20221014123724.1401011-2-demonsingur@gmail.com Signed-off-by: Jonathan Cameron commit 72b2aa38191bcba28389b0e20bf6b4f15017ff2b Author: Matti Vaittinen Date: Thu Oct 13 15:04:04 2022 +0300 tools: iio: iio_utils: fix digit calculation The iio_utils uses a digit calculation in order to know length of the file name containing a buffer number. The digit calculation does not work for number 0. This leads to allocation of one character too small buffer for the file-name when file name contains value '0'. (Eg. buffer0). Fix digit calculation by returning one digit to be present for number '0'. Fixes: 096f9b862e60 ("tools:iio:iio_utils: implement digit calculation") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/Y0f+tKCz+ZAIoroQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi Cc: Signed-off-by: Jonathan Cameron commit 174dac5dc800e4e2e4552baf6340846a344d01a3 Author: Olivier Moysan Date: Wed Oct 12 16:21:58 2022 +0200 iio: adc: stm32-adc: fix channel sampling time init Fix channel init for ADC generic channel bindings. In generic channel initialization, stm32_adc_smpr_init() is called to initialize channel sampling time. The "st,min-sample-time-ns" property is an optional property. If it is not defined, stm32_adc_smpr_init() is currently skipped. However stm32_adc_smpr_init() must always be called, to force a minimum sampling time for the internal channels, as the minimum sampling time is known. Make stm32_adc_smpr_init() call unconditional. Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time") Signed-off-by: Olivier Moysan Reviewed-by: Andy Shevchenko Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20221012142205.13041-2-olivier.moysan@foss.st.com Cc: Signed-off-by: Jonathan Cameron commit aa6c77d05eb1c57ee5b95a7b83a39384c37df4d9 Author: Marcus Folkesson Date: Mon Oct 10 21:46:54 2022 +0200 iio: adc: mcp3911: mask out device ID in debug prints The Device ID should not be included when printing register. Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20221010194654.676525-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 815f1647a603a822d66630bbe22cab4bc097c8c3 Author: Marcus Folkesson Date: Mon Oct 10 21:46:41 2022 +0200 iio: adc: mcp3911: use correct id bits The device ID should be shifted 6 bits to left according to datasheet. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20221010194641.676484-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit a83695a666eb3541873c3c9734ec4e1d10ca2d7f Author: Marcus Folkesson Date: Tue Sep 27 11:25:37 2022 +0200 iio: adc: mcp3911: return proper error code on failure to allocate trigger smatch warnings: drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR' Fixes: 08a65f61db69 ("iio: adc: mcp3911: add support for interrupts") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20220927092537.94663-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 7578847b5949db3a75163908bd99c46d27e8b19f Author: Dan Carpenter Date: Mon Sep 26 12:10:37 2022 +0300 iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug This code uses sizeof() instead of ARRAY_SIZE() so it reads beyond the end of the mcp3911_osr_table[] array. Fixes: 6d965885f4ea ("iio: adc: mcp3911: add support for oversampling ratio") Signed-off-by: Dan Carpenter Reviewed-by: Marcus Folkesson Link: https://lore.kernel.org/r/YzFsjY3xLHUQMjVr@kili Signed-off-by: Jonathan Cameron commit 0dec4d2f2636b9e54d9d29f17afc7687c5407f78 Author: Shreeya Patel Date: Fri Aug 26 17:53:52 2022 +0530 iio: light: tsl2583: Fix module unloading tsl2583 probe() uses devm_iio_device_register() and calling iio_device_unregister() causes the unregister to occur twice. s Switch to iio_device_register() instead of devm_iio_device_register() in probe to avoid the device managed cleanup. Fixes: 371894f5d1a0 ("iio: tsl2583: add runtime power management support") Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220826122352.288438-1-shreeya.patel@collabora.com Cc: Signed-off-by: Jonathan Cameron commit ce4b815686573bef82d5ee53bf6f509bf20904dc Author: Dawei Li Date: Mon Oct 17 09:55:53 2022 +0800 erofs: protect s_inodes with s_inode_list_lock for fscache s_inodes is superblock-specific resource, which should be protected by sb's specific lock s_inode_list_lock. Link: https://lore.kernel.org/r/TYCP286MB23238380DE3B74874E8D78ABCA299@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM Fixes: 7d41963759fe ("erofs: Support sharing cookies in the same domain") Reviewed-by: Yue Hu Reviewed-by: Jia Zhu Reviewed-by: Jingbo Xu Signed-off-by: Dawei Li Signed-off-by: Gao Xiang commit 2a4ea83bb8e54986703187edce59c9130a75eb26 Author: Jon Hunter Date: Mon Oct 10 14:51:32 2022 +0100 phy: tegra: xusb: Fix crash during pad power on/down Commit a88520bfc0ec ("usb: gadget: tegra: Reduce pad power") added calls to tegra_phy_xusb_utmi_pad_power_on/down in the Tegra XUDC driver to control the pad power. This change is causing a kernel panic when powering down the pads on entering suspend with the Jetson TX2 platform. The panic occurs because the 'xudc->curr_utmi_phy' is not configured on this platform and we do not check to see if the pointer is valid before attempting to deference the pointer. Fix this by checking to see if the 'phy' pointer passed to tegra_phy_xusb_utmi_pad_power_on/down is valid. Fixes: a88520bfc0ec ("usb: gadget: tegra: Reduce pad power") Signed-off-by: Jon Hunter Link: https://lore.kernel.org/r/20221010135132.30809-1-jonathanh@nvidia.com Signed-off-by: Vinod Koul commit ca1c73628f5bd0c1ef6e46073cc3be2450605b06 Author: Dan Carpenter Date: Fri Oct 14 12:25:06 2022 +0300 phy: stm32: fix an error code in probe If "index > usbphyc->nphys" is true then this returns success but it should return -EINVAL. Fixes: 94c358da3a05 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)") Signed-off-by: Dan Carpenter Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/Y0kq8j6S+5nDdMpr@kili Signed-off-by: Vinod Koul commit 76845ba539c3693f572377b38563d19a87266a5b Author: Kishon Vijay Abraham I Date: Fri Oct 14 11:54:24 2022 +0530 MAINTAINERS: Update Kishon's email address in GENERIC PHY FRAMEWORK Update Kishon's email address in GENERIC PHY FRAMEWORK maintainer entry. Cc: Kishon Vijay Abraham I Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20221014062424.3327-1-kishon@ti.com Signed-off-by: Vinod Koul commit a01aca4b05174b6dee2392ec44406f85e0f8bd46 Author: Sheng-Liang Pan Date: Sun Oct 16 21:47:46 2022 -0700 dt-bindings: input: touchscreen: Add compatible for Goodix GT7986U chip Add a compatible for Goodix touch screen chip GT7986U which is is expected to be fully compatible with a driver written for GT7375P. Signed-off-by: Sheng-Liang Pan Reviewed-by: Douglas Anderson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20221006185333.v7.3.I52e4b4b20e2eb0ae20f2a9bb198aa6410f04cf16@changeid Signed-off-by: Dmitry Torokhov commit 1e41e693f458eef2d5728207dbd327cd3b16580a Author: Kai-Heng Feng Date: Tue Oct 11 10:46:17 2022 +0800 ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS UBSAN complains about array-index-out-of-bounds: [ 1.980703] kernel: UBSAN: array-index-out-of-bounds in /build/linux-9H675w/linux-5.15.0/drivers/ata/libahci.c:968:41 [ 1.980709] kernel: index 15 is out of range for type 'ahci_em_priv [8]' [ 1.980713] kernel: CPU: 0 PID: 209 Comm: scsi_eh_8 Not tainted 5.15.0-25-generic #25-Ubuntu [ 1.980716] kernel: Hardware name: System manufacturer System Product Name/P5Q3, BIOS 1102 06/11/2010 [ 1.980718] kernel: Call Trace: [ 1.980721] kernel: [ 1.980723] kernel: show_stack+0x52/0x58 [ 1.980729] kernel: dump_stack_lvl+0x4a/0x5f [ 1.980734] kernel: dump_stack+0x10/0x12 [ 1.980736] kernel: ubsan_epilogue+0x9/0x45 [ 1.980739] kernel: __ubsan_handle_out_of_bounds.cold+0x44/0x49 [ 1.980742] kernel: ahci_qc_issue+0x166/0x170 [libahci] [ 1.980748] kernel: ata_qc_issue+0x135/0x240 [ 1.980752] kernel: ata_exec_internal_sg+0x2c4/0x580 [ 1.980754] kernel: ? vprintk_default+0x1d/0x20 [ 1.980759] kernel: ata_exec_internal+0x67/0xa0 [ 1.980762] kernel: sata_pmp_read+0x8d/0xc0 [ 1.980765] kernel: sata_pmp_read_gscr+0x3c/0x90 [ 1.980768] kernel: sata_pmp_attach+0x8b/0x310 [ 1.980771] kernel: ata_eh_revalidate_and_attach+0x28c/0x4b0 [ 1.980775] kernel: ata_eh_recover+0x6b6/0xb30 [ 1.980778] kernel: ? ahci_do_hardreset+0x180/0x180 [libahci] [ 1.980783] kernel: ? ahci_stop_engine+0xb0/0xb0 [libahci] [ 1.980787] kernel: ? ahci_do_softreset+0x290/0x290 [libahci] [ 1.980792] kernel: ? trace_event_raw_event_ata_eh_link_autopsy_qc+0xe0/0xe0 [ 1.980795] kernel: sata_pmp_eh_recover.isra.0+0x214/0x560 [ 1.980799] kernel: sata_pmp_error_handler+0x23/0x40 [ 1.980802] kernel: ahci_error_handler+0x43/0x80 [libahci] [ 1.980806] kernel: ata_scsi_port_error_handler+0x2b1/0x600 [ 1.980810] kernel: ata_scsi_error+0x9c/0xd0 [ 1.980813] kernel: scsi_error_handler+0xa1/0x180 [ 1.980817] kernel: ? scsi_unjam_host+0x1c0/0x1c0 [ 1.980820] kernel: kthread+0x12a/0x150 [ 1.980823] kernel: ? set_kthread_struct+0x50/0x50 [ 1.980826] kernel: ret_from_fork+0x22/0x30 [ 1.980831] kernel: This happens because sata_pmp_init_links() initialize link->pmp up to SATA_PMP_MAX_PORTS while em_priv is declared as 8 elements array. I can't find the maximum Enclosure Management ports specified in AHCI spec v1.3.1, but "12.2.1 LED message type" states that "Port Multiplier Information" can utilize 4 bits, which implies it can support up to 16 ports. Hence, use SATA_PMP_MAX_PORTS as EM_MAX_SLOTS to resolve the issue. BugLink: https://bugs.launchpad.net/bugs/1970074 Cc: stable@vger.kernel.org Signed-off-by: Kai-Heng Feng Signed-off-by: Damien Le Moal commit 979556f1521a835a059de3b117b9c6c6642c7d58 Author: Alexander Stein Date: Wed Oct 12 15:11:05 2022 +0200 ata: ahci-imx: Fix MODULE_ALIAS 'ahci:' is an invalid prefix, preventing the module from autoloading. Fix this by using the 'platform:' prefix and DRV_NAME. Fixes: 9e54eae23bc9 ("ahci_imx: add ahci sata support on imx platforms") Cc: stable@vger.kernel.org Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Damien Le Moal commit 5c61795ea97c170347c5c4af0c159bd877b8af71 Author: Jens Axboe Date: Sun Oct 16 17:24:10 2022 -0600 io_uring/rw: remove leftover debug statement This debug statement was never meant to go into the upstream release, kill it off before it ends up in a release. It was just part of the testing for the initial version of the patch. Fixes: 2ec33a6c3cca ("io_uring/rw: ensure kiocb_end_write() is always called") Signed-off-by: Jens Axboe commit 76dd298094f484c6250ebd076fa53287477b2328 Author: Yu Kuai Date: Tue Oct 11 22:22:53 2022 +0800 blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping() Our syzkaller report a null pointer dereference, root cause is following: __blk_mq_alloc_map_and_rqs set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs blk_mq_alloc_map_and_rqs blk_mq_alloc_rqs // failed due to oom alloc_pages_node // set->tags[hctx_idx] is still NULL blk_mq_free_rqs drv_tags = set->tags[hctx_idx]; // null pointer dereference is triggered blk_mq_clear_rq_mapping(drv_tags, ...) This is because commit 63064be150e4 ("blk-mq: Add blk_mq_alloc_map_and_rqs()") merged the two steps: 1) set->tags[hctx_idx] = blk_mq_alloc_rq_map() 2) blk_mq_alloc_rqs(..., set->tags[hctx_idx]) into one step: set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs() Since tags is not initialized yet in this case, fix the problem by checking if tags is NULL pointer in blk_mq_clear_rq_mapping(). Fixes: 63064be150e4 ("blk-mq: Add blk_mq_alloc_map_and_rqs()") Signed-off-by: Yu Kuai Reviewed-by: John Garry Link: https://lore.kernel.org/r/20221011142253.4015966-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 8048b8358031ae742c1c8f16f196f6d8070bb09f Merge: 280330fac4828 9abf2313adc1c Author: Andrew Morton Date: Sun Oct 16 16:09:11 2022 -0700 Merge branch 'master' into mm-hotfixes-stable commit 02bac94bd8efd75f615ac7515dd2def75b43e5b9 Author: Pavel Begunkov Date: Sun Oct 16 21:30:51 2022 +0100 io_uring: don't iopoll from io_ring_ctx_wait_and_kill() We should not be completing requests from a task context that has already undergone io_uring cancellations, i.e. __io_uring_cancel(), as there are some assumptions, e.g. around cached task refs draining. Remove iopolling from io_ring_ctx_wait_and_kill() as it can be called later after PF_EXITING is set with the last task_work run. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7c03cc91455c4a1af49c6b9cbda4e57ea467aa11.1665891182.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 34f0bc427e94065e7f828e70690f8fe1e01b3a9d Author: Pavel Begunkov Date: Sun Oct 16 21:30:50 2022 +0100 io_uring: reuse io_alloc_req() Don't duplicate io_alloc_req() in io_req_caches_free() but reuse the helper. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6005fc88274864a49fc3096c22d8bdd605cf8576.1665891182.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4d5059512d283dab7372d282c2fbd43c7f5a2456 Author: Pavel Begunkov Date: Sun Oct 16 21:30:49 2022 +0100 io_uring: kill hot path fixed file bitmap debug checks We test file_table.bitmap in io_file_get_fixed() to check invariants, don't do it, it's expensive and was showing up in profiles. No reports of this triggering has come in. Move the check to the file clear instead, which will still catch any wrong usage. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/cf77f2ded68d2e5b2bc7355784d969837d48e023.1665891182.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 38eddb2c75fb99b9cd78445094ca0e1bda08d102 Author: Pavel Begunkov Date: Sun Oct 16 21:30:48 2022 +0100 io_uring: remove FFS_SCM THe lifetime of SCM'ed files is bound to ring_sock, which is destroyed strictly after we're done with registered file tables. This means there is no need for the FFS_SCM hack, which was not available on 32-bit builds anyway. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/984226a1045adf42dc35d8bd7fb5a8bbfa472ce1.1665891182.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 280330fac48280e16454cfa46c368af4812ad79c Merge: d0d51a97063db 4fe89d07dcc28 Author: Andrew Morton Date: Sun Oct 16 16:06:53 2022 -0700 Merge branch 'master' into mm-hotfixes-stable commit e7933278b442f97809b1ea84264586302bd08a03 Author: Gao Xiang Date: Fri Oct 14 14:49:15 2022 +0800 erofs: fix up inplace decompression success rate Partial decompression should be checked after updating length. It's a new regression when introducing multi-reference pclusters. Fixes: 2bfab9c0edac ("erofs: record the longest decompressed size in this round") Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20221014064915.8103-1-hsiangkao@linux.alibaba.com commit 63bbb85658ea43dd35dbfde6d4150b47c407fc87 Author: Gao Xiang Date: Wed Oct 12 12:50:56 2022 +0800 erofs: shouldn't churn the mapping page for duplicated copies If other duplicated copies exist in one decompression shot, should leave the old page as is rather than replace it with the new duplicated one. Otherwise, the following cold path to deal with duplicated copies will use the invalid bvec. It impacts compressed data deduplication. Also, shift the onlinepage EIO bit to avoid touching the signed bit. Fixes: 267f2492c8f7 ("erofs: introduce multi-reference pclusters (fully-referenced)") Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20221012045056.13421-1-hsiangkao@linux.alibaba.com commit 664609e49f1c84fc97987b2bf64544e586b8849c Author: Yue Hu Date: Wed Oct 5 09:35:28 2022 +0800 erofs: fix illegal unmapped accesses in z_erofs_fill_inode_lazy() Note that we are still accessing 'h_idata_size' and 'h_fragmentoff' after calling erofs_put_metabuf(), that is not correct. Fix it. Fixes: ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support") Fixes: b15b2e307c3a ("erofs: support on-disk compressed fragments data") Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221005013528.62977-1-zbestahu@163.com Signed-off-by: Gao Xiang commit 3008d20f5445ee6f214e3b2d42114c8c923d9625 Author: Matthias Schiffer Date: Thu Oct 13 15:59:51 2022 +0200 hwmon: (pwm-fan) Explicitly switch off fan power when setting pwm1_enable to 0 When pwm1_enable is changed from 1 to 0 while pwm1 == 0, the regulator is not switched off as expected. The reason is that when the fan is already off, ctx->enabled is false, so pwm_fan_power_off() will be a no-op. Handle this case explicitly in pwm_fan_update_enable() by calling pwm_fan_switch_power() directly. Fixes: b99152d4f04b ("hwmon: (pwm-fan) Switch regulator dynamically") Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20221013135951.4902-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Guenter Roeck commit b6291023f659482fdb25f8ee5ab00c74682e658c Author: Wilken Gottwalt Date: Mon Oct 3 09:05:27 2022 +0000 hwmon: (corsair-psu) fix typo in USB id description Fix spelling mistake (Corsaur -> Corsair). Fixes: 0cf46a653bda ("hwmon: (corsair-psu) add USB id of new revision of the HX1000i psu") Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/Yzql13NOvQLlrye1@monster.localdomain Signed-off-by: Guenter Roeck commit 9abf2313adc1ca1b6180c508c25f22f9395cc780 Author: Linus Torvalds Date: Sun Oct 16 15:36:24 2022 -0700 Linux 6.1-rc1 commit f1947d7c8a61db1cb0ef909a6512ede0b1f2115b Merge: 8636df94ec917 de492c83cae0a Author: Linus Torvalds Date: Sun Oct 16 15:27:07 2022 -0700 Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull more random number generator updates from Jason Donenfeld: "This time with some large scale treewide cleanups. The intent of this pull is to clean up the way callers fetch random integers. The current rules for doing this right are: - If you want a secure or an insecure random u64, use get_random_u64() - If you want a secure or an insecure random u32, use get_random_u32() The old function prandom_u32() has been deprecated for a while now and is just a wrapper around get_random_u32(). Same for get_random_int(). - If you want a secure or an insecure random u16, use get_random_u16() - If you want a secure or an insecure random u8, use get_random_u8() - If you want secure or insecure random bytes, use get_random_bytes(). The old function prandom_bytes() has been deprecated for a while now and has long been a wrapper around get_random_bytes() - If you want a non-uniform random u32, u16, or u8 bounded by a certain open interval maximum, use prandom_u32_max() I say "non-uniform", because it doesn't do any rejection sampling or divisions. Hence, it stays within the prandom_*() namespace, not the get_random_*() namespace. I'm currently investigating a "uniform" function for 6.2. We'll see what comes of that. By applying these rules uniformly, we get several benefits: - By using prandom_u32_max() with an upper-bound that the compiler can prove at compile-time is ≤65536 or ≤256, internally get_random_u16() or get_random_u8() is used, which wastes fewer batched random bytes, and hence has higher throughput. - By using prandom_u32_max() instead of %, when the upper-bound is not a constant, division is still avoided, because prandom_u32_max() uses a faster multiplication-based trick instead. - By using get_random_u16() or get_random_u8() in cases where the return value is intended to indeed be a u16 or a u8, we waste fewer batched random bytes, and hence have higher throughput. This series was originally done by hand while I was on an airplane without Internet. Later, Kees and I worked on retroactively figuring out what could be done with Coccinelle and what had to be done manually, and then we split things up based on that. So while this touches a lot of files, the actual amount of code that's hand fiddled is comfortably small" * tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: prandom: remove unused functions treewide: use get_random_bytes() when possible treewide: use get_random_u32() when possible treewide: use get_random_{u8,u16}() when possible, part 2 treewide: use get_random_{u8,u16}() when possible, part 1 treewide: use prandom_u32_max() when possible, part 2 treewide: use prandom_u32_max() when possible, part 1 commit 8636df94ec917019c4cb744ba0a1f94cf9057790 Merge: 2df76606db9de a3a365655a28f Author: Linus Torvalds Date: Sun Oct 16 15:14:29 2022 -0700 Merge tag 'perf-tools-for-v6.1-2-2022-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Use BPF CO-RE (Compile Once, Run Everywhere) to support old kernels when using bperf (perf BPF based counters) with cgroups. - Support HiSilicon PCIe Performance Monitoring Unit (PMU), that monitors bandwidth, latency, bus utilization and buffer occupancy. Documented in Documentation/admin-guide/perf/hisi-pcie-pmu.rst. - User space tasks can migrate between CPUs, so when tracing selected CPUs, system-wide sideband is still needed, fix it in the setup of Intel PT on hybrid systems. - Fix metricgroups title message in 'perf list', it should state that the metrics groups are to be used with the '-M' option, not '-e'. - Sync the msr-index.h copy with the kernel sources, adding support for using "AMD64_TSC_RATIO" in filter expressions in 'perf trace' as well as decoding it when printing the MSR tracepoint arguments. - Fix program header size and alignment when generating a JIT ELF in 'perf inject'. - Add multiple new Intel PT 'perf test' entries, including a jitdump one. - Fix the 'perf test' entries for 'perf stat' CSV and JSON output when running on PowerPC due to an invalid topology number in that arch. - Fix the 'perf test' for arm_coresight failures on the ARM Juno system. - Fix the 'perf test' attr entry for PERF_FORMAT_LOST, adding this option to the or expression expected in the intercepted perf_event_open() syscall. - Add missing condition flags ('hs', 'lo', 'vc', 'vs') for arm64 in the 'perf annotate' asm parser. - Fix 'perf mem record -C' option processing, it was being chopped up when preparing the underlying 'perf record -e mem-events' and thus being ignored, requiring using '-- -C CPUs' as a workaround. - Improvements and tidy ups for 'perf test' shell infra. - Fix Intel PT information printing segfault in uClibc, where a NULL format was being passed to fprintf. * tag 'perf-tools-for-v6.1-2-2022-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (23 commits) tools arch x86: Sync the msr-index.h copy with the kernel sources perf auxtrace arm64: Add support for parsing HiSilicon PCIe Trace packet perf auxtrace arm64: Add support for HiSilicon PCIe Tune and Trace device driver perf auxtrace arm: Refactor event list iteration in auxtrace_record__init() perf tests stat+json_output: Include sanity check for topology perf tests stat+csv_output: Include sanity check for topology perf intel-pt: Fix system_wide dummy event for hybrid perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc perf test: Fix attr tests for PERF_FORMAT_LOST perf test: test_intel_pt.sh: Add 9 tests perf inject: Fix GEN_ELF_TEXT_OFFSET for jit perf test: test_intel_pt.sh: Add jitdump test perf test: test_intel_pt.sh: Tidy some alignment perf test: test_intel_pt.sh: Print a message when skipping kernel tracing perf test: test_intel_pt.sh: Tidy some perf record options perf test: test_intel_pt.sh: Fix return checking again perf: Skip and warn on unknown format 'configN' attrs perf list: Fix metricgroups title message perf mem: Fix -C option behavior for perf mem record perf annotate: Add missing condition flags for arm64 ... commit 2d1f274b95c6e4ba6a813b3b8e7a1a38d54a0a08 Author: Eric Dumazet Date: Sat Oct 15 21:24:41 2022 +0000 skmsg: pass gfp argument to alloc_sk_msg() syzbot found that alloc_sk_msg() could be called from a non sleepable context. sk_psock_verdict_recv() uses rcu_read_lock() protection. We need the callers to pass a gfp_t argument to avoid issues. syzbot report was: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 3613, name: syz-executor414 preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 INFO: lockdep is turned off. CPU: 0 PID: 3613 Comm: syz-executor414 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 __might_resched+0x538/0x6a0 kernel/sched/core.c:9877 might_alloc include/linux/sched/mm.h:274 [inline] slab_pre_alloc_hook mm/slab.h:700 [inline] slab_alloc_node mm/slub.c:3162 [inline] slab_alloc mm/slub.c:3256 [inline] kmem_cache_alloc_trace+0x59/0x310 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] alloc_sk_msg net/core/skmsg.c:507 [inline] sk_psock_skb_ingress_self+0x5c/0x330 net/core/skmsg.c:600 sk_psock_verdict_apply+0x395/0x440 net/core/skmsg.c:1014 sk_psock_verdict_recv+0x34d/0x560 net/core/skmsg.c:1201 tcp_read_skb+0x4a1/0x790 net/ipv4/tcp.c:1770 tcp_rcv_established+0x129d/0x1a10 net/ipv4/tcp_input.c:5971 tcp_v4_do_rcv+0x479/0xac0 net/ipv4/tcp_ipv4.c:1681 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2906 release_sock+0x5d/0x1c0 net/core/sock.c:3462 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1483 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x46d/0x5f0 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 43312915b5ba ("skmsg: Get rid of unncessary memset()") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Cong Wang Cc: Daniel Borkmann Cc: John Fastabend Signed-off-by: David S. Miller commit 2df76606db9de579bc96725981db4e8daa281993 Merge: 2fcd8f108f25e 0a6de78cff600 Author: Linus Torvalds Date: Sun Oct 16 11:12:22 2022 -0700 Merge tag 'kbuild-fixes-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y compile error for the combination of Clang >= 14 and GAS <= 2.35. - Drop vmlinux.bz2 from the rpm package as it just annoyingly increased the package size. - Fix modpost error under build environments using musl. - Make *.ll files keep value names for easier debugging - Fix single directory build - Prevent RISC-V from selecting the broken DWARF5 support when Clang and GAS are used together. * tag 'kbuild-fixes-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: lib/Kconfig.debug: Add check for non-constant .{s,u}leb128 support to DWARF5 kbuild: fix single directory build kbuild: add -fno-discard-value-names to cmd_cc_ll_c scripts/clang-tools: Convert clang-tidy args to list modpost: put modpost options before argument kbuild: Stop including vmlinux.bz2 in the rpm's Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Kconfig.debug: simplify the dependency of DEBUG_INFO_DWARF4/5 commit 2fcd8f108f25ef0cbbfcb57acf1c42934c238ed5 Merge: b08cd74448faf a7b78befbce2e Author: Linus Torvalds Date: Sun Oct 16 11:08:19 2022 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull more clk updates from Stephen Boyd: "This is the final part of the clk patches for this merge window. The clk rate range series needed another week to fully bake. Maxime fixed the bug that broke clk notifiers and prevented this from being included in the first pull request. He also added a unit test on top to make sure it doesn't break so easily again. The majority of the series fixes up how the clk_set_rate_*() APIs work, particularly around when the rate constraints are dropped and how they move around when reparenting clks. Overall it's a much needed improvement to the clk rate range APIs that used to be pretty broken if you looked sideways. Beyond the core changes there are a few driver fixes for a compilation issue or improper data causing clks to fail to register or have the wrong parents. These are good to get in before the first -rc so that the system actually boots on the affected devices" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (31 commits) clk: tegra: Fix Tegra PWM parent clock clk: at91: fix the build with binutils 2.27 clk: qcom: gcc-msm8660: Drop hardcoded fixed board clocks clk: mediatek: clk-mux: Add .determine_rate() callback clk: tests: Add tests for notifiers clk: Update req_rate on __clk_recalc_rates() clk: tests: Add missing test case for ranges clk: qcom: clk-rcg2: Take clock boundaries into consideration for gfx3d clk: Introduce the clk_hw_get_rate_range function clk: Zero the clk_rate_request structure clk: Stop forwarding clk_rate_requests to the parent clk: Constify clk_has_parent() clk: Introduce clk_core_has_parent() clk: Switch from __clk_determine_rate to clk_core_round_rate_nolock clk: Add our request boundaries in clk_core_init_rate_req clk: Introduce clk_hw_init_rate_request() clk: Move clk_core_init_rate_req() from clk_core_round_rate_nolock() to its caller clk: Change clk_core_init_rate_req prototype clk: Set req_rate on reparenting clk: Take into account uncached clocks in clk_set_rate_range() ... commit b08cd74448fafaa302ce2bc11beab5e5a55d0065 Merge: 80493877d7d0a e3e9463414f61 Author: Linus Torvalds Date: Sun Oct 16 11:01:40 2022 -0700 Merge tag '6.1-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull more cifs updates from Steve French: - fix a regression in guest mounts to old servers - improvements to directory leasing (caching directory entries safely beyond the root directory) - symlink improvement (reducing roundtrips needed to process symlinks) - an lseek fix (to problem where some dir entries could be skipped) - improved ioctl for returning more detailed information on directory change notifications - clarify multichannel interface query warning - cleanup fix (for better aligning buffers using ALIGN and round_up) - a compounding fix - fix some uninitialized variable bugs found by Coverity and the kernel test robot * tag '6.1-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: smb3: improve SMB3 change notification support cifs: lease key is uninitialized in two additional functions when smb1 cifs: lease key is uninitialized in smb1 paths smb3: must initialize two ACL struct fields to zero cifs: fix double-fault crash during ntlmssp cifs: fix static checker warning cifs: use ALIGN() and round_up() macros cifs: find and use the dentry for cached non-root directories also cifs: enable caching of directories for which a lease is held cifs: prevent copying past input buffer boundaries cifs: fix uninitialised var in smb2_compound_op() cifs: improve symlink handling for smb2+ smb3: clarify multichannel warning cifs: fix regression in very old smb1 mounts cifs: fix skipping to incorrect offset in emit_cached_dirents commit 80493877d7d0ae0cbe62921d748682811c58026f Author: Tetsuo Handa Date: Sun Oct 16 00:53:51 2022 +0900 Revert "cpumask: fix checking valid cpu range". This reverts commit 78e5a3399421 ("cpumask: fix checking valid cpu range"). syzbot is hitting WARN_ON_ONCE(cpu >= nr_cpumask_bits) warning at cpu_max_bits_warn() [1], for commit 78e5a3399421 ("cpumask: fix checking valid cpu range") is broken. Obviously that patch hits WARN_ON_ONCE() when e.g. reading /proc/cpuinfo because passing "cpu + 1" instead of "cpu" will trivially hit cpu == nr_cpumask_bits condition. Although syzbot found this problem in linux-next.git on 2022/09/27 [2], this problem was not fixed immediately. As a result, that patch was sent to linux.git before the patch author recognizes this problem, and syzbot started failing to test changes in linux.git since 2022/10/10 [3]. Andrew Jones proposed a fix for x86 and riscv architectures [4]. But [2] and [5] indicate that affected locations are not limited to arch code. More delay before we find and fix affected locations, less tested kernel (and more difficult to bisect and fix) before release. We should have inspected and fixed basically all cpumask users before applying that patch. We should not crash kernels in order to ask existing cpumask users to update their code, even if limited to CONFIG_DEBUG_PER_CPU_MAPS=y case. Link: https://syzkaller.appspot.com/bug?extid=d0fd2bf0dd6da72496dd [1] Link: https://syzkaller.appspot.com/bug?extid=21da700f3c9f0bc40150 [2] Link: https://syzkaller.appspot.com/bug?extid=51a652e2d24d53e75734 [3] Link: https://lkml.kernel.org/r/20221014155845.1986223-1-ajones@ventanamicro.com [4] Link: https://syzkaller.appspot.com/bug?extid=4d46c43d81c3bd155060 [5] Reported-by: Andrew Jones Reported-by: syzbot+d0fd2bf0dd6da72496dd@syzkaller.appspotmail.com Signed-off-by: Tetsuo Handa Cc: Yury Norov Cc: Borislav Petkov Signed-off-by: Linus Torvalds commit 0a6de78cff600cb991f2a1b7ed376935871796a0 Author: Nathan Chancellor Date: Fri Oct 14 13:42:11 2022 -0700 lib/Kconfig.debug: Add check for non-constant .{s,u}leb128 support to DWARF5 When building with a RISC-V kernel with DWARF5 debug info using clang and the GNU assembler, several instances of the following error appear: /tmp/vgettimeofday-48aa35.s:2963: Error: non-constant .uleb128 is not supported Dumping the .s file reveals these .uleb128 directives come from .debug_loc and .debug_ranges: .Ldebug_loc0: .byte 4 # DW_LLE_offset_pair .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset .byte 1 # Loc expr size .byte 90 # DW_OP_reg10 .byte 0 # DW_LLE_end_of_list .Ldebug_ranges0: .byte 4 # DW_RLE_offset_pair .uleb128 .Ltmp6-.Lfunc_begin0 # starting offset .uleb128 .Ltmp27-.Lfunc_begin0 # ending offset .byte 4 # DW_RLE_offset_pair .uleb128 .Ltmp28-.Lfunc_begin0 # starting offset .uleb128 .Ltmp30-.Lfunc_begin0 # ending offset .byte 0 # DW_RLE_end_of_list There is an outstanding binutils issue to support a non-constant operand to .sleb128 and .uleb128 in GAS for RISC-V but there does not appear to be any movement on it, due to concerns over how it would work with linker relaxation. To avoid these build errors, prevent DWARF5 from being selected when using clang and an assembler that does not have support for these symbol deltas, which can be easily checked in Kconfig with as-instr plus the small test program from the dwz test suite from the binutils issue. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27215 Link: https://github.com/ClangBuiltLinux/linux/issues/1719 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 3753af778dd9d0d5199d6a7d01b0ead33135d095 Author: Masahiro Yamada Date: Sat Oct 15 05:18:11 2022 +0900 kbuild: fix single directory build Commit f110e5a250e3 ("kbuild: refactor single builds of *.ko") was wrong. KBUILD_MODULES _is_ needed for single builds. Otherwise, "make foo/bar/baz/" does not build module objects at all. Fixes: f110e5a250e3 ("kbuild: refactor single builds of *.ko") Reported-by: David Sterba Signed-off-by: Masahiro Yamada Tested-by: David Sterba commit ac5408991ea6b06e29129b4d4861097c4c3e0d59 Author: Aman Dhoot Date: Sat Oct 15 20:41:17 2022 -0700 Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode The device works fine in native RMI mode, there is no reason to use legacy PS/2 mode with it. Signed-off-by: Aman Dhoot Signed-off-by: Dmitry Torokhov commit 1501278bb7ba0728b869d3399ea94b67853256a2 Merge: 36d8a3edf8bd5 e36ce448a08d4 Author: Linus Torvalds Date: Sat Oct 15 17:05:07 2022 -0700 Merge tag 'slab-for-6.1-rc1-hotfix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab hotfix from Vlastimil Babka: "A single fix for the common-kmalloc series, for warnings on mips and sparc64 reported by Guenter Roeck" * tag 'slab-for-6.1-rc1-hotfix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm/slab: use kmalloc_node() for off slab freelist_idx_t array allocation commit 36d8a3edf8bd504320fca970f8b0633b8226cb58 Merge: 41410965c3629 34a0bac084e49 Author: Linus Torvalds Date: Sat Oct 15 16:47:33 2022 -0700 Merge tag 'for-linus' of https://github.com/openrisc/linux Pull OpenRISC updates from Stafford Horne: "I have relocated to London so not much work from me while I get settled. Still, OpenRISC picked up two patches in this window: - Fix for kernel page table walking from Jann Horn - MAINTAINER entry cleanup from Palmer Dabbelt" * tag 'for-linus' of https://github.com/openrisc/linux: MAINTAINERS: git://github -> https://github.com for openrisc openrisc: Fix pagewalk usage in arch_dma_{clear, set}_uncached commit 41410965c3629367cbd0889dc0c8bddfb9e8a2d5 Merge: 19d17ab7c68b6 5632e2beaf9d5 Author: Linus Torvalds Date: Sat Oct 15 16:36:38 2022 -0700 Merge tag 'pci-v6.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: "Revert the attempt to distribute spare resources to unconfigured hotplug bridges at boot time. This fixed some dock hot-add scenarios, but Jonathan Cameron reported that it broke a topology with a multi-function device where one function was a Switch Upstream Port and the other was an Endpoint" * tag 'pci-v6.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI: Distribute available resources for root buses, too" commit e36ce448a08d43de69e7449eb225805a7a8addf8 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sat Oct 15 13:34:29 2022 +0900 mm/slab: use kmalloc_node() for off slab freelist_idx_t array allocation After commit d6a71648dbc0 ("mm/slab: kmalloc: pass requests larger than order-1 page to page allocator"), SLAB passes large ( > PAGE_SIZE * 2) requests to buddy like SLUB does. SLAB has been using kmalloc caches to allocate freelist_idx_t array for off slab caches. But after the commit, freelist_size can be bigger than KMALLOC_MAX_CACHE_SIZE. Instead of using pointer to kmalloc cache, use kmalloc_node() and only check if the kmalloc cache is off slab during calculate_slab_order(). If freelist_size > KMALLOC_MAX_CACHE_SIZE, no looping condition happens as it allocates freelist_idx_t array directly from buddy. Link: https://lore.kernel.org/all/20221014205818.GA1428667@roeck-us.net/ Reported-and-tested-by: Guenter Roeck Fixes: d6a71648dbc0 ("mm/slab: kmalloc: pass requests larger than order-1 page to page allocator") Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 4bb7f6c2781e46fc5bd00475a66df2ea30ef330d Author: Rafael J. Wysocki Date: Thu Oct 13 14:50:28 2022 +0200 thermal: intel_powerclamp: Use first online CPU as control_cpu Commit 68b99e94a4a2 ("thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash") fixed an issue related to using smp_processor_id() in preemptible context by replacing it with a pair of get_cpu()/put_cpu(), but what is needed there really is any online CPU and not necessarily the one currently running the code. Arguably, getting the one that's running the code in there is confusing. For this reason, simply give the control CPU role to the first online one which automatically will be CPU0 if it is online, so one check can be dropped from the code for an added benefit. Link: https://lore.kernel.org/linux-pm/20221011113646.GA12080@duo.ucw.cz/ Fixes: 68b99e94a4a2 ("thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash") Signed-off-by: Rafael J. Wysocki Reviewed-by: Chen Yu commit 34a0bac084e49324c29e6d0984d24096e02c6314 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:37 2022 -0700 MAINTAINERS: git://github -> https://github.com for openrisc Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Stafford Horne commit e3e9463414f610e91528f2b920b8cb655f4bae33 Author: Steve French Date: Sat Oct 15 00:43:22 2022 -0500 smb3: improve SMB3 change notification support Change notification is a commonly supported feature by most servers, but the current ioctl to request notification when a directory is changed does not return the information about what changed (even though it is returned by the server in the SMB3 change notify response), it simply returns when there is a change. This ioctl improves upon CIFS_IOC_NOTIFY by returning the notify information structure which includes the name of the file(s) that changed and why. See MS-SMB2 2.2.35 for details on the individual filter flags and the file_notify_information structure returned. To use this simply pass in the following (with enough space to fit at least one file_notify_information structure) struct __attribute__((__packed__)) smb3_notify { uint32_t completion_filter; bool watch_tree; uint32_t data_len; uint8_t data[]; } __packed; using CIFS_IOC_NOTIFY_INFO 0xc009cf0b or equivalently _IOWR(CIFS_IOCTL_MAGIC, 11, struct smb3_notify_info) The ioctl will block until the server detects a change to that directory or its subdirectories (if watch_tree is set). Acked-by: Paulo Alcantara (SUSE) Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 2bff0659338e58a3a24698a35e7dcb2b62199ba4 Author: Steve French Date: Fri Oct 14 20:00:32 2022 -0500 cifs: lease key is uninitialized in two additional functions when smb1 cifs_open and _cifsFileInfo_put also end up with lease_key uninitialized in smb1 mounts. It is cleaner to set lease key to zero in these places where leases are not supported (smb1 can not return lease keys so the field was uninitialized). Addresses-Coverity: 1514207 ("Uninitialized scalar variable") Addresses-Coverity: 1514331 ("Uninitialized scalar variable") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 625b60d4f9517903ad499633776825e67fdb0c16 Author: Steve French Date: Fri Oct 14 19:18:32 2022 -0500 cifs: lease key is uninitialized in smb1 paths It is cleaner to set lease key to zero in the places where leases are not supported (smb1 can not return lease keys so the field was uninitialized). Addresses-Coverity: 1513994 ("Uninitialized scalar variable") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit f09bd695af3b8ab46fc24e5d6954a24104c38387 Author: Steve French Date: Fri Oct 14 18:50:20 2022 -0500 smb3: must initialize two ACL struct fields to zero Coverity spotted that we were not initalizing Stbz1 and Stbz2 to zero in create_sd_buf. Addresses-Coverity: 1513848 ("Uninitialized scalar variable") Cc: Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit b854b4ee66437e6e1622fda90529c814978cb4ca Author: Paulo Alcantara Date: Fri Oct 14 17:14:54 2022 -0300 cifs: fix double-fault crash during ntlmssp The crash occurred because we were calling memzero_explicit() on an already freed sess_data::iov[1] (ntlmsspblob) in sess_free_buffer(). Fix this by not calling memzero_explicit() on sess_data::iov[1] as it's already by handled by callers. Fixes: a4e430c8c8ba ("cifs: replace kfree() with kfree_sensitive() for sensitive data") Reviewed-by: Enzo Matsumiya Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a3a365655a28f12f07eddf4f3fd596987b175e1d Author: Arnaldo Carvalho de Melo Date: Fri Aug 7 08:45:47 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: b8d1d163604bd1e6 ("x86/apic: Don't disable x2APIC if locked") ca5b7c0d9621702e ("perf/x86/amd/lbr: Add LbrExtV2 branch record support") Addressing these tools/perf build warnings: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' That makes the beautification scripts to pick some new entries: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after --- before 2022-10-14 18:06:34.294561729 -0300 +++ after 2022-10-14 18:06:41.285744044 -0300 @@ -264,6 +264,7 @@ [0xc0000102 - x86_64_specific_MSRs_offset] = "KERNEL_GS_BASE", [0xc0000103 - x86_64_specific_MSRs_offset] = "TSC_AUX", [0xc0000104 - x86_64_specific_MSRs_offset] = "AMD64_TSC_RATIO", + [0xc000010e - x86_64_specific_MSRs_offset] = "AMD64_LBR_SELECT", [0xc000010f - x86_64_specific_MSRs_offset] = "AMD_DBG_EXTN_CFG", [0xc0000300 - x86_64_specific_MSRs_offset] = "AMD64_PERF_CNTR_GLOBAL_STATUS", [0xc0000301 - x86_64_specific_MSRs_offset] = "AMD64_PERF_CNTR_GLOBAL_CTL", $ Now one can trace systemwide asking to see backtraces to where that MSR is being read/written, see this example with a previous update: # perf trace -e msr:*_msr/max-stack=32/ --filter="msr>=IA32_U_CET && msr<=IA32_INT_SSP_TAB" ^C# If we use -v (verbose mode) we can see what it does behind the scenes: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr>=IA32_U_CET && msr<=IA32_INT_SSP_TAB" Using CPUID AuthenticAMD-25-21-0 0x6a0 0x6a8 New filter for msr:read_msr: (msr>=0x6a0 && msr<=0x6a8) && (common_pid != 597499 && common_pid != 3313) 0x6a0 0x6a8 New filter for msr:write_msr: (msr>=0x6a0 && msr<=0x6a8) && (common_pid != 597499 && common_pid != 3313) mmap size 528384B ^C# Example with a frequent msr: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2 Using CPUID AuthenticAMD-25-21-0 0x48 New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) 0x48 New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) mmap size 528384B Looking at the vmlinux_path (8 entries long) symsrc__init: build id mismatch for vmlinux. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols 0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule ([kernel.kallsyms]) futex_wait_queue_me ([kernel.kallsyms]) futex_wait ([kernel.kallsyms]) do_futex ([kernel.kallsyms]) __x64_sys_futex ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64_after_hwframe ([kernel.kallsyms]) __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so) 0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule_idle ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) secondary_startup_64_no_verify ([kernel.kallsyms]) # Cc: Adrian Hunter Cc: Daniel Sneddon Cc: Dave Hansen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Link: https://lore.kernel.org/lkml/Y0nQkz2TUJxwfXJd@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5e91e57e68090c0e8ab0acecdbb309af8417d415 Author: Qi Liu Date: Tue Sep 27 16:14:00 2022 +0800 perf auxtrace arm64: Add support for parsing HiSilicon PCIe Trace packet Add support for using 'perf report --dump-raw-trace' to parse PTT packet. Example usage: Output will contain raw PTT data and its textual representation, such as (8DW format): 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x400000 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HISI PTT data: size 4194304 bytes . 00000000: 00 00 00 00 Prefix . 00000004: 08 20 00 60 Header DW0 . 00000008: ff 02 00 01 Header DW1 . 0000000c: 20 08 00 00 Header DW2 . 00000010: 10 e7 44 ab Header DW3 . 00000014: 2a a8 1e 01 Time . 00000020: 00 00 00 00 Prefix . 00000024: 01 00 00 60 Header DW0 . 00000028: 0f 1e 00 01 Header DW1 . 0000002c: 04 00 00 00 Header DW2 . 00000030: 40 00 81 02 Header DW3 . 00000034: ee 02 00 00 Time .... This patch only add basic parsing support according to the definition of the PTT packet described in Documentation/trace/hisi-ptt.rst. And the fields of each packet can be further decoded following the PCIe Spec's definition of TLP packet. Signed-off-by: Qi Liu Signed-off-by: Yicong Yang Cc: Alexander Shishkin Cc: Bjorn Helgaas Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Clark Cc: John Garry Cc: Jonathan Cameron Cc: Leo Yan Cc: Lorenzo Pieralisi Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Peter Zijlstra Cc: Qi Liu Cc: Shameerali Kolothum Thodi Cc: Shaokun Zhang Cc: Suzuki Poulouse Cc: Will Deacon Cc: Zeng Prime Cc: linux-arm-kernel@lists.infradead.org Cc: linux-pci@vger.kernel.org Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/20220927081400.14364-4-yangyicong@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 057381a7ece1b2726509ce47cdb9c1a111acfce9 Author: Qi Liu Date: Tue Sep 27 16:13:59 2022 +0800 perf auxtrace arm64: Add support for HiSilicon PCIe Tune and Trace device driver HiSilicon PCIe tune and trace device (PTT) could dynamically tune the PCIe link's events, and trace the TLP headers). This patch add support for PTT device in perf tool, so users could use 'perf record' to get TLP headers trace data. Reviewed-by: Leo Yan Signed-off-by: Qi Liu Signed-off-by: Yicong Yang Acked-by: John Garry Cc: Alexander Shishkin Cc: Bjorn Helgaas Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Clark Cc: Jonathan Cameron Cc: Lorenzo Pieralisi Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Peter Zijlstra Cc: Qi Liu Cc: Shameerali Kolothum Thodi Cc: Shaokun Zhang Cc: Suzuki Poulouse Cc: Will Deacon Cc: Zeng Prime Cc: linux-arm-kernel@lists.infradead.org Cc: linux-pci@vger.kernel.org Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/20220927081400.14364-3-yangyicong@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 45a3975f8e4c56829ada20f7a6a29095ca05e375 Author: Qi Liu Date: Tue Sep 27 16:13:58 2022 +0800 perf auxtrace arm: Refactor event list iteration in auxtrace_record__init() Add find_pmu_for_event() and use to simplify logic in auxtrace_record_init(). find_pmu_for_event() will be reused in subsequent patches. Reviewed-by: John Garry Reviewed-by: Jonathan Cameron Reviewed-by: Leo Yan Signed-off-by: Qi Liu Signed-off-by: Yicong Yang Cc: Alexander Shishkin Cc: Bjorn Helgaas Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Clark Cc: Lorenzo Pieralisi Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Peter Zijlstra Cc: Qi Liu Cc: Shameerali Kolothum Thodi Cc: Shaokun Zhang Cc: Suzuki Poulouse Cc: Will Deacon Cc: Zeng Prime Cc: linux-arm-kernel@lists.infradead.org Cc: linux-pci@vger.kernel.org Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/20220927081400.14364-2-yangyicong@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 58d4802a5eaab55e174f4d31262daada6665aa22 Author: Athira Rajeev Date: Thu Oct 6 21:21:49 2022 +0530 perf tests stat+json_output: Include sanity check for topology Testcase stat+json_output.sh fails in powerpc: 86: perf stat JSON output linter : FAILED! The testcase "stat+json_output.sh" verifies perf stat JSON output. The test covers aggregation modes like per-socket, per-core, per-die, -A (no_aggr mode) along with few other tests. It counts expected fields for various commands. For example say -A (i.e, AGGR_NONE mode), expects 7 fields in the output having "CPU" as first field. Same way, for per-socket, it expects the first field in result to point to socket id. The testcases compares the result with expected count. The values for socket, die, core and cpu are fetched from topology directory: /sys/devices/system/cpu/cpu*/topology. For example, socket value is fetched from "physical_package_id" file of topology directory. (cpu__get_topology_int() in util/cpumap.c) If a platform fails to fetch the topology information, values will be set to -1. For example, incase of pSeries platform of powerpc, value for "physical_package_id" is restricted and not exposed. So, -1 will be assigned. Perf code has a checks for valid cpu id in "aggr_printout" (stat-display.c), which displays the fields. So, in cases where topology values not exposed, first field of the output displaying will be empty. This cause the testcase to fail, as it counts number of fields in the output. Incase of -A (AGGR_NONE mode,), testcase expects 7 fields in the output, becos of -1 value obtained from topology files for some, only 6 fields are printed. Hence a testcase failure reported due to mismatch in number of fields in the output. Patch here adds a sanity check in the testcase for topology. Check will help to skip the test if -1 value found. Fixes: 0c343af2a2f82844 ("perf test: JSON format checking") Reported-by: Disha Goel Suggested-by: Ian Rogers Suggested-by: James Clark Signed-off-by: Athira Jajeev Cc: Claire Jensen Cc: Jiri Olsa Cc: Kajol Jain Cc: linuxppc-dev@lists.ozlabs.org Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Link: https://lore.kernel.org/r/20221006155149.67205-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit cd400f6f18421b75e64e4aa7bc359d2606033412 Author: Athira Rajeev Date: Thu Oct 6 21:21:48 2022 +0530 perf tests stat+csv_output: Include sanity check for topology Testcase stat+csv_output.sh fails in powerpc: 84: perf stat CSV output linter: FAILED! The testcase "stat+csv_output.sh" verifies perf stat CSV output. The test covers aggregation modes like per-socket, per-core, per-die, -A (no_aggr mode) along with few other tests. It counts expected fields for various commands. For example say -A (i.e, AGGR_NONE mode), expects 7 fields in the output having "CPU" as first field. Same way, for per-socket, it expects the first field in result to point to socket id. The testcases compares the result with expected count. The values for socket, die, core and cpu are fetched from topology directory: /sys/devices/system/cpu/cpu*/topology. For example, socket value is fetched from "physical_package_id" file of topology directory. (cpu__get_topology_int() in util/cpumap.c) If a platform fails to fetch the topology information, values will be set to -1. For example, incase of pSeries platform of powerpc, value for "physical_package_id" is restricted and not exposed. So, -1 will be assigned. Perf code has a checks for valid cpu id in "aggr_printout" (stat-display.c), which displays the fields. So, in cases where topology values not exposed, first field of the output displaying will be empty. This cause the testcase to fail, as it counts number of fields in the output. Incase of -A (AGGR_NONE mode,), testcase expects 7 fields in the output, becos of -1 value obtained from topology files for some, only 6 fields are printed. Hence a testcase failure reported due to mismatch in number of fields in the output. Patch here adds a sanity check in the testcase for topology. Check will help to skip the test if -1 value found. Fixes: 7473ee56dbc91c98 ("perf test: Add checking for perf stat CSV output.") Reported-by: Disha Goel Suggested-by: Ian Rogers Suggested-by: James Clark Signed-off-by: Athira Jajeev Cc: Claire Jensen Cc: Jiri Olsa Cc: Kajol Jain Cc: linuxppc-dev@lists.ozlabs.org Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Link: https://lore.kernel.org/r/20221006155149.67205-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6cef7dab3e2e5cb23a13569c3880c0532326748c Author: Adrian Hunter Date: Wed Oct 12 11:22:59 2022 +0300 perf intel-pt: Fix system_wide dummy event for hybrid User space tasks can migrate between CPUs, so when tracing selected CPUs, system-wide sideband is still needed, however evlist->core.has_user_cpus is not set in the hybrid case, so check the target cpu_list instead. Fixes: 7d189cadbeebc778 ("perf intel-pt: Track sideband system-wide when needed") Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221012082259.22394-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5a3d47071f0ced0431ef82a5fb6bd077ed9493db Author: Adrian Hunter Date: Wed Oct 12 11:22:58 2022 +0300 perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc uClibc segfaulted because NULL was passed as the format to fprintf(). That happened because one of the format strings was missing and intel_pt_print_info() didn't check that before calling fprintf(). Add the missing format string, and check format is not NULL before calling fprintf(). Fixes: 11fa7cb86b56d361 ("perf tools: Pass Intel PT information for decoding MTC and CYC") Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221012082259.22394-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e28039667cea2cbea72aeb19665a1c57c6756253 Author: James Clark Date: Wed Oct 12 10:46:32 2022 +0100 perf test: Fix attr tests for PERF_FORMAT_LOST Since PERF_FORMAT_LOST was added, the default read format has that bit set, so add it to the tests. Keep the old value as well so that the test still passes on older kernels. This fixes the following failure: expected read_format=0|4, got 20 FAILED './tests/attr/test-record-C0' - match failure Fixes: 85b425f31c8866e0 ("perf record: Set PERF_FORMAT_LOST by default") Signed-off-by: James Clark Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221012094633.21669-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f77811a0f62577d2d51e57c5740a4fbd53dd3331 Author: Ammy Yi Date: Fri Oct 14 20:09:05 2022 +0300 perf test: test_intel_pt.sh: Add 9 tests Add tests: Test with MTC and TSC disabled Test with branches disabled Test with/without CYC Test recording with sample mode Test with kernel trace Test virtual LBR Test power events Test with TNT packets disabled Test with event_trace These tests mostly check that perf record works with the corresponding Intel PT config terms, sometimes also checking that certain packets do or do not appear in the resulting trace as appropriate. The "Test virtual LBR" is slightly trickier, using a Python script to check that branch stacks are actually synthesized. Signed-off-by: Ammy Yi Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-8-adrian.hunter@intel.com Signed-off-by: Adrian Hunter Signed-off-by: Arnaldo Carvalho de Melo commit 89b15d00527b7825ff19130ed83478e80e3fae99 Author: Adrian Hunter Date: Fri Oct 14 20:09:04 2022 +0300 perf inject: Fix GEN_ELF_TEXT_OFFSET for jit When a program header was added, it moved the text section but GEN_ELF_TEXT_OFFSET was not updated. Fix by adding the program header size and aligning. Fixes: babd04386b1df8c3 ("perf jit: Include program header in ELF files") Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Lieven Hey Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 973db24079fc6b292e896b3b9c057a0a6c0d8e93 Author: Adrian Hunter Date: Fri Oct 14 20:09:03 2022 +0300 perf test: test_intel_pt.sh: Add jitdump test Add a test for decoding self-modifying code using a jitdump file. The test creates a workload that uses self-modifying code and generates its own jitdump file. The result is processed with perf inject --jit and checked for decoding errors. Note the test will fail without patch "perf inject: Fix GEN_ELF_TEXT_OFFSET for jit" applied. Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 40053a4b7ebd227e923eb996f5e3e328a647db93 Author: Adrian Hunter Date: Fri Oct 14 20:09:02 2022 +0300 perf test: test_intel_pt.sh: Tidy some alignment Tidy alignment of test function lines to make them more readable. Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 9637bf8ff0f050cfb9fe84f5734af633e7902796 Author: Adrian Hunter Date: Fri Oct 14 20:09:01 2022 +0300 perf test: test_intel_pt.sh: Print a message when skipping kernel tracing Messages display with the perf test -v option. Add a message to show when skipping a test because the user cannot do kernel tracing. Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5021d82bca4f5335b29de71f0533b93c6c15007e Author: Adrian Hunter Date: Fri Oct 14 20:09:00 2022 +0300 perf test: test_intel_pt.sh: Tidy some perf record options When not decoding, the options "-B -N --no-bpf-event" speed up perf record. Make a common function for them. Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e4080492877d3125ffd0c6dd3e3c997fbe0ebe6d Author: Adrian Hunter Date: Fri Oct 14 20:08:59 2022 +0300 perf test: test_intel_pt.sh: Fix return checking again count_result() does not always reset ret=0 which means the value can spill into the next test result. Fix by explicitly setting it to zero between tests. Committer testing: # perf test "Miscellaneous Intel PT testing" 110: Miscellaneous Intel PT testing : Ok # Tested as well with: # perf test -v "Miscellaneous Intel PT testing" Fixes: fd9b45e39cfaf885 ("perf test: test_intel_pt.sh: Fix return checking") Tested-by: Arnaldo Carvalho de Melo Signed-off-by: Adrian Hunter Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20221014170905.64069-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c000a2607145d28b06c697f968491372ea56c23a Author: Eric Ren Date: Sat Oct 15 11:19:28 2022 +0800 KVM: arm64: vgic: Fix exit condition in scan_its_table() With some PCIe topologies, restoring a guest fails while parsing the ITS device tables. Reproducer hints: 1. Create ARM virt VM with pxb-pcie bus which adds extra host bridges, with qemu command like: ``` -device pxb-pcie,bus_nr=8,id=pci.x,numa_node=0,bus=pcie.0 \ -device pcie-root-port,..,bus=pci.x \ ... -device pxb-pcie,bus_nr=37,id=pci.y,numa_node=1,bus=pcie.0 \ -device pcie-root-port,..,bus=pci.y \ ... ``` 2. Ensure the guest uses 2-level device table 3. Perform VM migration which calls save/restore device tables In that setup, we get a big "offset" between 2 device_ids, which makes unsigned "len" round up a big positive number, causing the scan loop to continue with a bad GPA. For example: 1. L1 table has 2 entries; 2. and we are now scanning at L2 table entry index 2075 (pointed to by L1 first entry) 3. if next device id is 9472, we will get a big offset: 7397; 4. with unsigned 'len', 'len -= offset * esz', len will underflow to a positive number, mistakenly into next iteration with a bad GPA; (It should break out of the current L2 table scanning, and jump into the next L1 table entry) 5. that bad GPA fails the guest read. Fix it by stopping the L2 table scan when the next device id is outside of the current table, allowing the scan to continue from the next L1 table entry. Thanks to Eric Auger for the fix suggestion. Fixes: 920a7a8fa92a ("KVM: arm64: vgic-its: Add infrastructure for tableookup") Suggested-by: Eric Auger Signed-off-by: Eric Ren [maz: commit message tidy-up] Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/d9c3a564af9e2c5bf63f48a7dcbf08cd593c5c0b.1665802985.git.renzhengeek@gmail.com commit bde971a83bbff78561458ded236605a365411b87 Author: Denis Nikitin Date: Fri Oct 14 11:45:32 2022 -0700 KVM: arm64: nvhe: Fix build with profile optimization Kernel build with clang and KCFLAGS=-fprofile-sample-use= fails with: error: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.tmp.o: Unexpected SHT_REL section ".rel.llvm.call-graph-profile" Starting from 13.0.0 llvm can generate SHT_REL section, see https://reviews.llvm.org/rGca3bdb57fa1ac98b711a735de048c12b5fdd8086. gen-hyprel does not support SHT_REL relocation section. Filter out profile use flags to fix the build with profile optimization. Signed-off-by: Denis Nikitin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221014184532.3153551-1-denik@chromium.org commit a1b6b102df03ac10e83d6c4ea31f07af05fa19c4 Merge: fc8695eb11f07 f151c147b3afc Author: David S. Miller Date: Sat Oct 15 11:51:52 2022 +0100 Merge branch 'phylink_set_mac_pm' Shenwei Wang says: ==================== net: phylink: add phylink_set_mac_pm() helper Per Russell's suggestion, the implementation is changed from the helper function to add an extra property in phylink_config structure because this change can easily cover SFP usecase too. Changes in v6: - update the fix tag hash and format Changes in v5: - Add fix tag in the commit message Changes in v4: - Clean up the codes in phylink.c - Continue the version number ==================== Signed-off-by: David S. Miller commit f151c147b3afcf92dedff53f5f0e965414e4fd2c Author: Shenwei Wang Date: Fri Oct 14 09:47:29 2022 -0500 net: stmmac: Enable mac_managed_pm phylink config Enable the mac_managed_pm configuration in the phylink_config structure to avoid the kernel warning during system resume. Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") Signed-off-by: Shenwei Wang Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 96de900ae78e7dbedc937fd91bafe2934579c65a Author: Shenwei Wang Date: Fri Oct 14 09:47:28 2022 -0500 net: phylink: add mac_managed_pm in phylink_config structure The recent commit 'commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")' requires the MAC driver explicitly tell the phy driver who is managing the PM, otherwise you will see warning during resume stage. Add a boolean property in the phylink_config structure so that the MAC driver can use it to tell the PHY driver if it wants to manage the PM. Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") Signed-off-by: Shenwei Wang Acked-by: Florian Fainelli Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit fc8695eb11f07d936a4a9dbd15d7797986bc8b89 Author: Jakub Kicinski Date: Fri Oct 14 09:07:46 2022 -0700 Revert "net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}" This reverts commit 854701ba4c39afae2362ba19a580c461cb183e4f. We have more violations around, which leads to: WARNING: CPU: 2 PID: 1 at include/linux/cpumask.h:110 __netif_set_xps_queue+0x14e/0x770 Let's back this out and retry with a larger clean up in -next. Fixes: 854701ba4c39 ("net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}") Link: https://lore.kernel.org/all/20221014030459.3272206-2-guoren@kernel.org/ Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0a6d58a70a39d9a74882af6d00ec6df0737503ff Author: Dan Carpenter Date: Fri Oct 14 18:08:39 2022 +0300 net: dsa: uninitialized variable in dsa_slave_netdevice_event() Return zero if both dsa_slave_dev_check() and netdev_uses_dsa() are false. Fixes: acc43b7bf52a ("net: dsa: allow masters to join a LAG") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 9408f3d321ed2286b9722bceff08ca28b741c026 Author: Dan Carpenter Date: Fri Oct 14 17:33:02 2022 +0300 sunhme: Uninitialized variable in happy_meal_init() The "burst" string is only initialized for CONFIG_SPARC. It should be set to "64" because that's what is used by PCI. Fixes: 24cddbc3ef11 ("sunhme: Combine continued messages") Signed-off-by: Dan Carpenter Reviewed-by: Sean Anderson Signed-off-by: David S. Miller commit bdee15e8c58b450ad736a2b62ef8c7a12548b704 Author: Dan Carpenter Date: Fri Oct 14 12:34:36 2022 +0300 net/smc: Fix an error code in smc_lgr_create() If smc_wr_alloc_lgr_mem() fails then return an error code. Don't return success. Fixes: 8799e310fb3f ("net/smc: add v2 support to the work request layer") Signed-off-by: Dan Carpenter Reviewed-by: Wenjia Zhang Signed-off-by: David S. Miller commit 0c9efbd5c50c64ead434960a404c9c9a097b0403 Author: Harini Katakam Date: Fri Oct 14 12:17:35 2022 +0530 net: phy: dp83867: Extend RX strap quirk for SGMII mode When RX strap in HW is not set to MODE 3 or 4, bit 7 and 8 in CF4 register should be set. The former is already handled in dp83867_config_init; add the latter in SGMII specific initialization. Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") Signed-off-by: Harini Katakam Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 017e42540639a46fdf7c7f5ee647e0b7806c9013 Author: Cezar Bulinaru Date: Thu Oct 13 22:45:03 2022 -0400 net: hv_netvsc: Fix a warning triggered by memcpy in rndis_filter memcpy: detected field-spanning write (size 168) of single field "(void *)&request->response_msg + (sizeof(struct rndis_message) - sizeof(union rndis_message_container)) + sizeof(*req_id)" at drivers/net/hyperv/rndis_filter.c:338 (size 40) RSP: 0018:ffffc90000144de0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8881766b4000 RCX: 0000000000000000 RDX: 0000000000000102 RSI: 0000000000009ffb RDI: 00000000ffffffff RBP: ffffc90000144e38 R08: 0000000000000000 R09: 00000000ffffdfff R10: ffffc90000144c48 R11: ffffffff82f56ac8 R12: ffff8881766b403c R13: 00000000000000a8 R14: ffff888100b75000 R15: ffff888179301d00 FS: 0000000000000000(0000) GS:ffff8884d6280000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055f8b024c418 CR3: 0000000176548001 CR4: 00000000003706e0 Call Trace: ? _raw_spin_unlock_irqrestore+0x27/0x50 netvsc_poll+0x556/0x940 [hv_netvsc] __napi_poll+0x2e/0x170 net_rx_action+0x299/0x2f0 __do_softirq+0xed/0x2ef __irq_exit_rcu+0x9f/0x110 irq_exit_rcu+0xe/0x20 sysvec_hyperv_callback+0xb0/0xd0 asm_sysvec_hyperv_callback+0x1b/0x20 RIP: 0010:native_safe_halt+0xb/0x10 Fixes: A warning triggered when the response message len exceeds the size of rndis_message. Inside the rndis_request structure these fields are however followed by a RNDIS_EXT_LEN padding so it is safe to use unsafe_memcpy. Reviewed-by: Michael Kelley Signed-off-by: Cezar Bulinaru Signed-off-by: David S. Miller commit d8bde3bf7f82dac5fc68a62c2816793a12cafa2a Author: Xiaobo Liu Date: Fri Oct 14 10:05:40 2022 +0800 net/atm: fix proc_mpc_write incorrect return value Then the input contains '\0' or '\n', proc_mpc_write has read them, so the return value needs +1. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xiaobo Liu Signed-off-by: David S. Miller commit a8aed7b35becfd21f22a77c7014029ea837b018f Author: Jonathan Cooper Date: Thu Oct 13 10:55:53 2022 +0100 sfc: Change VF mac via PF as first preference if available. Changing a VF's mac address through the VF (rather than via the PF) fails with EPERM because the latter part of efx_ef10_set_mac_address attempts to change the vport mac address list as the VF. Even with this fixed it still fails with EBUSY because the vadaptor is still assigned on the VF - the vadaptor reassignment must be within a section where the VF has torn down its state. A major reason this has broken is because we have two functions that ostensibly do the same thing - have a PF and VF cooperate to change a VF mac address. Rather than do this, if we are changing the mac of a VF that has a link to the PF in the same VM then simply call sriov_set_vf_mac instead, which is a proven working function that does that. If there is no PF available, or that fails non-fatally, then attempt to change the VF's mac address as we would a PF, without updating the PF's data. Test case: Create a VF: echo 1 > /sys/class/net//device/sriov_numvfs Set the mac address of the VF directly: ip link set addr 00:11:22:33:44:55 Set the MAC address of the VF via the PF: ip link set vf 0 mac 00:11:22:33:44:66 Without this patch the last command will fail with ENOENT. Signed-off-by: Jonathan Cooper Reported-by: Íñigo Huguet Fixes: 910c8789a777 ("set the MAC address using MC_CMD_VADAPTOR_SET_MAC") Acked-by: Edward Cree Signed-off-by: David S. Miller commit 19d17ab7c68b62180e0537f92400a6f798019775 Merge: b7270c69a36ef 305a72efa791c Author: Linus Torvalds Date: Fri Oct 14 18:41:41 2022 -0700 Merge tag 'libnvdimm-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull nvdimm updates from Dan Williams: "Some small cleanups and fixes in and around the nvdimm subsystem. The most significant change is a regression fix for nvdimm namespace (volume) creation when the namespace size is smaller than 2MB/ Summary: - Fix nvdimm namespace creation on platforms that do not publish associated 'DIMM' metadata for a persistent memory region. - Miscellaneous fixes and cleanups" * tag 'libnvdimm-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: ACPI: HMAT: Release platform device in case of platform_device_add_data() fails dax: Remove usage of the deprecated ida_simple_xxx API libnvdimm/region: Allow setting align attribute on regions without mappings nvdimm/namespace: Fix comment typo nvdimm: make __nvdimm_security_overwrite_query static nvdimm/region: Fix kernel-doc nvdimm/namespace: drop unneeded temporary variable in size_store() nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid() commit b7270c69a36efc61ed6ebd31a8a458f354a6edc0 Merge: 4ce1b97949cbf e5f12a3983712 Author: Linus Torvalds Date: Fri Oct 14 18:36:42 2022 -0700 Merge tag 'rtc-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A great rework of the isl12022 driver makes up the bulk of the changes. There is also an important fix for CMOS and then the usual small fixes: - switch to devm_clk_get_enabled() where relevant - cmos: event handler registration fix - isl12022: code improvements" * tag 'rtc-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: rv3028: Fix codestyle errors rtc: cmos: Fix event handler registration ordering issue rtc: k3: Use devm_clk_get_enabled() helper rtc: jz4740: Use devm_clk_get_enabled() helper rtc: mpfs: Use devm_clk_get_enabled() helper rtc: ds1685: Fix spelling of function name in comment block rtc: isl12022: switch to using regmap API rtc: isl12022: drop redundant write to HR register rtc: isl12022: use dev_set_drvdata() instead of i2c_set_clientdata() rtc: isl12022: use %ptR rtc: isl12022: simplify some expressions rtc: isl12022: drop a dev_info() rtc: isl12022: specify range_min and range_max rtc: isl12022: stop using deprecated devm_rtc_device_register() rtc: stmp3xxx: Add failure handling for stmp3xxx_wdt_register() rtc: mxc: Use devm_clk_get_enabled() helper rtc: gamecube: Always reset HW_SRNPROT after read rtc: k3: detect SoC to determine erratum fix rtc: k3: wait until the unlock field is not zero rtc: mpfs: Remove printing of stray CR commit 4ce1b97949cbf46e847722461386170e0f709c59 Merge: b7cef0d21c379 90f4a09a15239 Author: Linus Torvalds Date: Fri Oct 14 18:31:28 2022 -0700 Merge tag 'i3c/for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: "Not much this cycle, only two fixes for a rare event" - fix device reattach issues" * tag 'i3c/for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: Remove the wrong place of reattach. i3c: master: Free the old_dyn_addr when reattach. commit b7cef0d21c379669c9f620c9692b5c7c885a6311 Merge: 91080ab38f3ea 669d204469c46 Author: Linus Torvalds Date: Fri Oct 14 18:23:23 2022 -0700 Merge tag 'for-linus-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull UBI and UBIFS updates from Richard Weinberger: "UBI: - Use bitmap API to allocate bitmaps - New attach mode, disable_fm, to attach without fastmap - Fixes for various typos in comments UBIFS: - Fix for a deadlock when setting xattrs for encrypted file - Fix for an assertion failures when truncating encrypted files - Fixes for various typos in comments" * tag 'for-linus-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: fastmap: Add fastmap control support for 'UBI_IOCATT' ioctl ubi: fastmap: Use the bitmap API to allocate bitmaps ubifs: Fix AA deadlock when setting xattr for encrypted file ubifs: Fix UBIFS ro fail due to truncate in the encrypted directory mtd: ubi: drop unexpected word 'a' in comments ubi: block: Fix typos in comments ubi: fastmap: Fix typo in comments ubi: Fix repeated words in comments ubi: ubi-media.h: Fix comment typo ubi: block: Remove in vain semicolon ubifs: Fix ubifs_check_dir_empty() kernel-doc comment commit 91080ab38f3eaa2a0af4888220d007698a2e7b03 Merge: 73344a3f6793d 193cb83724241 Author: Linus Torvalds Date: Fri Oct 14 18:14:48 2022 -0700 Merge tag 'for-linus-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux Pull UML updates from Richard Weinberger: - Move to strscpy() - Improve panic notifiers - Fix NR_CPUS usage - Fixes for various comments - Fixes for virtio driver * tag 'for-linus-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: uml: Remove the initialization of statics to 0 um: Do not initialise statics to 0. um: Fix comment typo um: Improve panic notifiers consistency and ordering um: remove unused reactivate_chan() declaration um: mmaper: add __exit annotations to module exit funcs um: virt-pci: add __init/__exit annotations to module init/exit funcs hostfs: move from strlcpy with unused retval to strscpy um: move from strlcpy with unused retval to strscpy um: increase default virtual physical memory to 64 MiB UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK um: read multiple msg from virtio slave request fd commit 73344a3f6793d6b5384077be1e5ce6b90bbcaeb4 Merge: ca1aaf993755d 2e21c15752087 Author: Linus Torvalds Date: Fri Oct 14 13:47:42 2022 -0700 Merge tag 'asm-generic-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic fix from Arnd Bergmann: "A last-minute arch/alpha regression fix: the previous asm-generic branch contained a new regression from a typo" * tag 'asm-generic-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: alpha: fix marvel_ioread8 build regression commit ca1aaf993755d21b8a0060c3bf0f77e303a7bf21 Merge: dca45efbe3c87 bd60aafce5e19 Author: Linus Torvalds Date: Fri Oct 14 13:44:53 2022 -0700 Merge tag 'arm-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "These are three fixes for build warnings that came in during the merge window" * tag 'arm-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: mmp: Make some symbols static ARM: spear6xx: Staticize few definitions clk: spear: Move prototype to accessible header commit a7b78befbce2e79425224d57c05275083cf7ed61 Merge: c461c677a8cb1 b05ea3314390e Author: Stephen Boyd Date: Fri Oct 14 13:44:44 2022 -0700 Merge branch 'clk-rate-range' into clk-next - Various clk rate range fixes - Drop clk rate range constraints on clk_put() (redux) * clk-rate-range: (28 commits) clk: mediatek: clk-mux: Add .determine_rate() callback clk: tests: Add tests for notifiers clk: Update req_rate on __clk_recalc_rates() clk: tests: Add missing test case for ranges clk: qcom: clk-rcg2: Take clock boundaries into consideration for gfx3d clk: Introduce the clk_hw_get_rate_range function clk: Zero the clk_rate_request structure clk: Stop forwarding clk_rate_requests to the parent clk: Constify clk_has_parent() clk: Introduce clk_core_has_parent() clk: Switch from __clk_determine_rate to clk_core_round_rate_nolock clk: Add our request boundaries in clk_core_init_rate_req clk: Introduce clk_hw_init_rate_request() clk: Move clk_core_init_rate_req() from clk_core_round_rate_nolock() to its caller clk: Change clk_core_init_rate_req prototype clk: Set req_rate on reparenting clk: Take into account uncached clocks in clk_set_rate_range() clk: tests: Add some tests for orphan with multiple parents clk: tests: Add tests for mux with multiple parents clk: tests: Add tests for single parent mux ... commit c461c677a8cb19026fd06741a23ff32d0759342b Author: Jon Hunter Date: Mon Oct 10 11:00:46 2022 +0100 clk: tegra: Fix Tegra PWM parent clock Commit 8c193f4714df ("pwm: tegra: Optimize period calculation") updated the period calculation in the Tegra PWM driver and now returns an error if the period requested is less than minimum period supported. This is breaking PWM support on various Tegra platforms. For example, on the Tegra210 Jetson Nano platform this is breaking the PWM fan support and probing the PWM fan driver now fails ... pwm-fan pwm-fan: Failed to configure PWM: -22 pwm-fan: probe of pwm-fan failed with error -22 The problem is that the default parent clock for the PWM on Tegra210 is a 32kHz clock and is unable to support the requested PWM period. Fix PWM support on Tegra20, Tegra30, Tegra114, Tegra124 and Tegra210 by updating the parent clock for the PWM to be the PLL_P. Fixes: 8c193f4714df ("pwm: tegra: Optimize period calculation") Signed-off-by: Jon Hunter Tested-by: Robert Eckelmann # TF101 T20 Tested-by: Antoni Aloy Torrens # TF101 T20 Tested-by: Svyatoslav Ryhel # TF201 T30 Tested-by: Andreas Westman Dorcsak # TF700T T3 Link: https://lore.kernel.org/r/20221010100046.6477-1-jonathanh@nvidia.com Acked-by: Uwe Kleine-König Signed-off-by: Stephen Boyd commit 57d849636a04a12713dd3a10a97cb9658ec7edf6 Author: Kefeng Wang Date: Wed Oct 12 11:06:35 2022 +0800 clk: at91: fix the build with binutils 2.27 There is an issue when build with older versions of binutils 2.27.0, arch/arm/mach-at91/pm_suspend.S: Assembler messages: arch/arm/mach-at91/pm_suspend.S:1086: Error: garbage following instruction -- `ldr tmp1,=0x00020010UL' Use UL() macro to fix the issue in assembly file. Fixes: 4fd36e458392 ("ARM: at91: pm: add plla disable/enable support for sam9x60") Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20221012030635.13140-1-wangkefeng.wang@huawei.com Signed-off-by: Stephen Boyd commit 8c7bc6ca3740959edc6abe5d8214e5c84aa8a853 Author: Linus Walleij Date: Thu Oct 13 16:07:45 2022 +0200 clk: qcom: gcc-msm8660: Drop hardcoded fixed board clocks These two clocks are now registered in the device tree as fixed clocks, causing a regression in the driver as the clock already exists with e.g. the name "pxo_board" as the MSM8660 GCC driver probes. Fix this by just not hard-coding this anymore and everything works like a charm. Cc: Dmitry Baryshkov Fixes: baecbda52933 ("ARM: dts: qcom: msm8660: fix node names for fixed clocks") Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20221013140745.7801-1-linus.walleij@linaro.org Signed-off-by: Stephen Boyd commit b05ea3314390e9cb3c27cf2928d48e38fef97050 Author: AngeloGioacchino Del Regno Date: Tue Oct 11 15:55:48 2022 +0200 clk: mediatek: clk-mux: Add .determine_rate() callback Since commit 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent"), the clk_rate_request is .. as the title says, not forwarded anymore to the parent: this produces an issue with the MediaTek clock MUX driver during GPU DVFS on MT8195, but not on MT8192 or others. This is because, differently from others, like MT8192 where all of the clocks in the MFG parents tree are of mtk_mux type, but in the parent tree of MT8195's MFG clock, we have one mtk_mux clock and one (clk framework generic) mux clock, like so: names: mfg_bg3d -> mfg_ck_fast_ref -> top_mfg_core_tmp (or) mfgpll types: mtk_gate -> mux -> mtk_mux (or) mtk_pll To solve this issue and also keep the GPU DVFS clocks code working as expected, wire up a .determine_rate() callback for the mtk_mux ops; for that, the standard clk_mux_determine_rate_flags() was used as it was possible to. This commit was successfully tested on MT6795 Xperia M5, MT8173 Elm, MT8192 Spherion and MT8195 Tomato; no regressions were seen. For the sake of some more documentation about this issue here's the trace of it: [ 12.211587] ------------[ cut here ]------------ [ 12.211589] WARNING: CPU: 6 PID: 78 at drivers/clk/clk.c:1462 clk_core_init_rate_req+0x84/0x90 [ 12.211593] Modules linked in: stp crct10dif_ce mtk_adsp_common llc rfkill snd_sof_xtensa_dsp panfrost(+) sbs_battery cros_ec_lid_angle cros_ec_sensors snd_sof_of cros_ec_sensors_core hid_multitouch cros_usbpd_logger snd_sof gpu_sched snd_sof_utils fuse ipv6 [ 12.211614] CPU: 6 PID: 78 Comm: kworker/u16:2 Tainted: G W 6.0.0-next-20221011+ #58 [ 12.211616] Hardware name: Acer Tomato (rev2) board (DT) [ 12.211617] Workqueue: devfreq_wq devfreq_monitor [ 12.211620] pstate: 40400009 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 12.211622] pc : clk_core_init_rate_req+0x84/0x90 [ 12.211625] lr : clk_core_forward_rate_req+0xa4/0xe4 [ 12.211627] sp : ffff80000893b8e0 [ 12.211628] x29: ffff80000893b8e0 x28: ffffdddf92f9b000 x27: ffff46a2c0e8bc05 [ 12.211632] x26: ffff46a2c1041200 x25: 0000000000000000 x24: 00000000173eed80 [ 12.211636] x23: ffff80000893b9c0 x22: ffff80000893b940 x21: 0000000000000000 [ 12.211641] x20: ffff46a2c1039f00 x19: ffff46a2c1039f00 x18: 0000000000000000 [ 12.211645] x17: 0000000000000038 x16: 000000000000d904 x15: 0000000000000003 [ 12.211649] x14: ffffdddf9357ce48 x13: ffffdddf935e71c8 x12: 000000000004803c [ 12.211653] x11: 00000000a867d7ad x10: 00000000a867d7ad x9 : ffffdddf90c28df4 [ 12.211657] x8 : ffffdddf9357a980 x7 : 0000000000000000 x6 : 0000000000000004 [ 12.211661] x5 : ffffffffffffffc8 x4 : 00000000173eed80 x3 : ffff80000893b940 [ 12.211665] x2 : 00000000173eed80 x1 : ffff80000893b940 x0 : 0000000000000000 [ 12.211669] Call trace: [ 12.211670] clk_core_init_rate_req+0x84/0x90 [ 12.211673] clk_core_round_rate_nolock+0xe8/0x10c [ 12.211675] clk_mux_determine_rate_flags+0x174/0x1f0 [ 12.211677] clk_mux_determine_rate+0x1c/0x30 [ 12.211680] clk_core_determine_round_nolock+0x74/0x130 [ 12.211682] clk_core_round_rate_nolock+0x58/0x10c [ 12.211684] clk_core_round_rate_nolock+0xf4/0x10c [ 12.211686] clk_core_set_rate_nolock+0x194/0x2ac [ 12.211688] clk_set_rate+0x40/0x94 [ 12.211691] _opp_config_clk_single+0x38/0xa0 [ 12.211693] _set_opp+0x1b0/0x500 [ 12.211695] dev_pm_opp_set_rate+0x120/0x290 [ 12.211697] panfrost_devfreq_target+0x3c/0x50 [panfrost] [ 12.211705] devfreq_set_target+0x8c/0x2d0 [ 12.211707] devfreq_update_target+0xcc/0xf4 [ 12.211708] devfreq_monitor+0x40/0x1d0 [ 12.211710] process_one_work+0x294/0x664 [ 12.211712] worker_thread+0x7c/0x45c [ 12.211713] kthread+0x104/0x110 [ 12.211716] ret_from_fork+0x10/0x20 [ 12.211718] irq event stamp: 7102 [ 12.211719] hardirqs last enabled at (7101): [] finish_task_switch.isra.0+0xec/0x2f0 [ 12.211723] hardirqs last disabled at (7102): [] el1_dbg+0x24/0x90 [ 12.211726] softirqs last enabled at (6716): [] __do_softirq+0x414/0x588 [ 12.211728] softirqs last disabled at (6507): [] ____do_softirq+0x18/0x24 [ 12.211730] ---[ end trace 0000000000000000 ]--- Fixes: 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221011135548.318323-1-angelogioacchino.delregno@collabora.com Signed-off-by: Stephen Boyd commit c67a85bee78db74c6889a5ca645c3763ad23d863 Author: Nick Desaulniers Date: Fri Oct 14 09:53:02 2022 -0700 kbuild: add -fno-discard-value-names to cmd_cc_ll_c When debugging LLVM IR, it can be handy for clang to not discard value names used for local variables and parameters. Compare the generated IR. -fdiscard-value-names: define i32 @core_sys_select(i32 %0, ptr %1, ptr %2, ptr %3, ptr %4) { %6 = alloca i64 %7 = alloca %struct.poll_wqueues %8 = alloca [64 x i32] -fno-discard-value-names: define i32 @core_sys_select(i32 %n, ptr %inp, ptr %outp, ptr %exp, ptr %end_time) { %expire.i = alloca i64 %table.i = alloca %struct.poll_wqueues %stack_fds = alloca [64 x i32] The rule for generating human readable LLVM IR (.ll) is only useful as a debugging feature: $ make LLVM=1 fs/select.ll As Fangrui notes: A LLVM_ENABLE_ASSERTIONS=off build of Clang defaults to -fdiscard-value-names. A LLVM_ENABLE_ASSERTIONS=on build of Clang defaults to -fno-discard-value-names. Explicitly enable -fno-discard-value-names so that the IR always contains value names regardless of whether assertions were enabled or not. Assertions generally are not enabled in releases of clang packaged by distributions. Link: https://github.com/ClangBuiltLinux/linux/issues/1467 Reviewed-by: Nathan Chancellor Reviewed-by: Fangrui Song Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit dca45efbe3c870a4ad2107fe625109b3765c0fea Merge: 5964c927b4c13 88672826e2a46 Author: Linus Torvalds Date: Fri Oct 14 13:22:14 2022 -0700 Merge tag 'sound-fix-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Here are a few remaining patches for 6.1-rc1. The major changes are the hibernation fixes for HD-audio CS35L41 codec and the USB-audio small fixes against the last change. In addition, a couple of HD-audio regression fixes and a couple of potential mutex-deadlock fixes with OSS emulation in ALSA core side are seen" * tag 'sound-fix-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: cs35l41: Support System Suspend ALSA: hda: cs35l41: Remove suspend/resume hda hooks ALSA: hda/cs_dsp_ctl: Fix mutex inversion when creating controls ALSA: hda: hda_cs_dsp_ctl: Ensure pwr_lock is held before reading/writing controls ALSA: hda: hda_cs_dsp_ctl: Minor clean and redundant code removal ALSA: oss: Fix potential deadlock at unregistration ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() ALSA: hda/realtek: Add Intel Reference SSID to support headset keys ALSA: hda/realtek: Add quirk for ASUS GV601R laptop ALSA: hda/realtek: Correct pin configs for ASUS G533Z ALSA: usb-audio: Avoid superfluous endpoint setup ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params() ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params() ALSA: usb-audio: Avoid unnecessary interface change at EP close ALSA: hda: Update register polling macros ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530 commit 5964c927b4c1399bd3ab80ebaa62eb6eef96ab07 Merge: bd9a3dba185ce 4d1632151bde8 Author: Linus Torvalds Date: Fri Oct 14 13:14:03 2022 -0700 Merge tag 'leds-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "This is very quiet release for LEDs, pca963 got blinking support and that's pretty much it" * tag 'leds-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: pca963: fix misleading indentation dt-bindings: leds: Document mmc trigger leds: pca963x: fix blink with hw acceleration commit bd9a3dba185ce6701b41f0341470d3f53bbbbaed Merge: 1df046ab1c652 34f26a15611af Author: Linus Torvalds Date: Fri Oct 14 13:03:00 2022 -0700 Merge tag 'sched-psi-2022-10-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull PSI updates from Ingo Molnar: - Various performance optimizations, resulting in a 4%-9% speedup in the mmtests/config-scheduler-perfpipe micro-benchmark. - New interface to turn PSI on/off on a per cgroup level. * tag 'sched-psi-2022-10-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/psi: Per-cgroup PSI accounting disable/re-enable interface sched/psi: Cache parent psi_group to speed up group iteration sched/psi: Consolidate cgroup_psi() sched/psi: Add PSI_IRQ to track IRQ/SOFTIRQ pressure sched/psi: Remove NR_ONCPU task accounting sched/psi: Optimize task switch inside shared cgroups again sched/psi: Move private helpers to sched/stats.h sched/psi: Save percpu memory when !psi_cgroups_enabled sched/psi: Don't create cgroup PSI files when psi_disabled sched/psi: Fix periodic aggregation shut off commit 1df046ab1c6520911774911f8c710ca8e981305c Merge: 5e714bf1713b4 0e5d5ae837c8c Author: Linus Torvalds Date: Fri Oct 14 12:38:03 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Cortex-A55 errata workaround (repeat TLBI) - AMPERE1 added to the Spectre-BHB affected list - MTE fix to avoid setting PG_mte_tagged if no tags have been touched on a page - Fixed typo in the SCTLR_EL1.SPINTMASK bit naming (the commit log has other typos) - perf: return value check in ali_drw_pmu_probe(), ALIBABA_UNCORE_DRW_PMU dependency on ACPI * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add AMPERE1 to the Spectre-BHB affected list arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored MAINTAINERS: rectify file entry in ALIBABA PMU DRIVER drivers/perf: ALIBABA_UNCORE_DRW_PMU should depend on ACPI drivers/perf: fix return value check in ali_drw_pmu_probe() arm64: errata: Add Cortex-A55 to the repeat tlbi list arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK commit 5e714bf1713b4b096d20ec75c13880b7086964bd Merge: f2e44139f3e0e ef6e06b2ef870 Author: Linus Torvalds Date: Fri Oct 14 12:28:43 2022 -0700 Merge tag 'mm-stable-2022-10-13' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull more MM updates from Andrew Morton: - fix a race which causes page refcounting errors in ZONE_DEVICE pages (Alistair Popple) - fix userfaultfd test harness instability (Peter Xu) - various other patches in MM, mainly fixes * tag 'mm-stable-2022-10-13' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (29 commits) highmem: fix kmap_to_page() for kmap_local_page() addresses mm/page_alloc: fix incorrect PGFREE and PGALLOC for high-order page mm/selftest: uffd: explain the write missing fault check mm/hugetlb: use hugetlb_pte_stable in migration race check mm/hugetlb: fix race condition of uffd missing/minor handling zram: always expose rw_page LoongArch: update local TLB if PTE entry exists mm: use update_mmu_tlb() on the second thread kasan: fix array-bounds warnings in tests hmm-tests: add test for migrate_device_range() nouveau/dmem: evict device private memory during release nouveau/dmem: refactor nouveau_dmem_fault_copy_one() mm/migrate_device.c: add migrate_device_range() mm/migrate_device.c: refactor migrate_vma and migrate_deivce_coherent_page() mm/memremap.c: take a pgmap reference on page allocation mm: free device private pages have zero refcount mm/memory.c: fix race when faulting a device private page mm/damon: use damon_sz_region() in appropriate place mm/damon: move sz_damon_region to damon_sz_region lib/test_meminit: add checks for the allocation functions ... commit 5632e2beaf9d5dda694c0572684dea783d8a9492 Author: Bjorn Helgaas Date: Fri Oct 14 13:45:45 2022 -0500 Revert "PCI: Distribute available resources for root buses, too" This reverts commit e96e27fc6f7971380283768e9a734af16b1716ee. Jonathan reported that this commit broke this topology, where all the space available on bus 02 was assigned to the 02:00.0 bridge window, leaving none for the e1000 device at 02:00.1: pci 0000:00:04.0: bridge window [mem 0x10200000-0x103fffff] to [bus 02-04] pci 0000:02:00.0: bridge window [mem 0x10200000-0x103fffff] to [bus 03-04] pci 0000:02:00.1: BAR 0: failed to assign [mem size 0x00020000] e1000 0000:02:00.1: can't ioremap BAR 0: [??? 0x00000000 flags 0x0] Link: https://lore.kernel.org/r/20221014124553.0000696f@huawei.com Reported-by: Jonathan Cameron Signed-off-by: Bjorn Helgaas commit f2e44139f3e0edb8be8821fe4dc93afd7b034182 Merge: ebdca8ecc31b0 34314cd615af5 Author: Linus Torvalds Date: Fri Oct 14 12:10:01 2022 -0700 Merge tag 'parisc-for-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc updates from Helge Deller: "Fixes: - When we added basic vDSO support in kernel 5.18 we introduced a bug which prevented a mmap() of graphic card memory. This is because we used the DMB (data memory break trap bit) page flag as special-bit, but missed to clear that bit when loading the TLB. - Graphics card memory size was not correctly aligned - Spelling fixes (from Colin Ian King) Enhancements: - PDC console (which uses firmware calls) now rewritten as early console - Reduced size of alternative tables" * tag 'parisc-for-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix spelling mistake "mis-match" -> "mismatch" in eisa driver parisc: Fix userspace graphics card breakage due to pgtable special bit parisc: fbdev/stifb: Align graphics memory size to 4MB parisc: Convert PDC console to an early console parisc: Reduce kernel size by packing alternative tables commit ebdca8ecc31b07385cd83200532522bd5d95f02c Merge: 498574970fc96 bf18140d30541 Author: Linus Torvalds Date: Fri Oct 14 11:36:05 2022 -0700 Merge tag 's390-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Vasily Gorbik: - Generate a change uevent on unsolicited device end I/O interrupt for z/VM unit record devices supported by the vmur driver. This event can be used to automatically trigger processing of files as they arrive in the z/VM reader. * tag 's390-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/vmur: generate uevent on unsolicited device end s390/vmur: remove unnecessary BUG statement commit 498574970fc968ee17cfea9e6959b78c094c00a5 Merge: 70609c1495ae6 ab0c23b535f3f Author: Linus Torvalds Date: Fri Oct 14 11:21:11 2022 -0700 Merge tag 'riscv-for-linus-6.1-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - DT updates for the PolarFire SOC - a fix to correct the handling of write-only mappings - m{vetndor,arcd,imp}id is now in /proc/cpuinfo - the SiFive L2 cache controller support has been refactored to also support L3 caches - misc fixes, cleanups and improvements throughout the tree * tag 'riscv-for-linus-6.1-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (42 commits) MAINTAINERS: add RISC-V's patchwork RISC-V: Make port I/O string accessors actually work riscv: enable software resend of irqs RISC-V: Re-enable counter access from userspace riscv: vdso: fix NULL deference in vdso_join_timens() when vfork riscv: Add cache information in AUX vector soc: sifive: ccache: define the macro for the register shifts soc: sifive: ccache: use pr_fmt() to remove CCACHE: prefixes soc: sifive: ccache: reduce printing on init soc: sifive: ccache: determine the cache level from dts soc: sifive: ccache: Rename SiFive L2 cache to Composable cache. dt-bindings: sifive-ccache: change Sifive L2 cache to Composable cache riscv: check for kernel config option in t-head memory types errata riscv: use BIT() marco for cpufeature probing riscv: use BIT() macros in t-head errata init riscv: drop some idefs from CMO initialization riscv: cleanup svpbmt cpufeature probing riscv: Pass -mno-relax only on lld < 15.0.0 RISC-V: Avoid dereferening NULL regs in die() dt-bindings: riscv: add new riscv,isa strings for emulators ... commit 70609c1495ae64e6534d8db7d6280dd7c79de815 Merge: 2130b87b22733 90d5ce82e143b Author: Linus Torvalds Date: Fri Oct 14 11:16:18 2022 -0700 Merge tag 'powerpc-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix 32-bit syscall wrappers with 64-bit arguments of unaligned register-pairs. Notably this broke ftruncate64 & pread/write64, which can lead to file corruption. - Fix lost interrupts when returning to soft-masked context on 64-bit. - Fix build failure when CONFIG_DTL=n. Thanks to Nicholas Piggin, Jason A. Donenfeld, Guenter Roeck, Arnd Bergmann, and Sachin Sant. * tag 'powerpc-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/pseries: Fix CONFIG_DTL=n build powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs commit 2130b87b2273389cafe6765bf09ef564cda01407 Author: Nathan Chancellor Date: Fri Oct 14 08:21:03 2022 -0700 drm/amd/display: Fix build breakage with CONFIG_DEBUG_FS=n After commit 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr transition"), a build with CONFIG_DEBUG_FS=n is broken due to a misplaced brace, along the lines of: In file included from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_trace.h:39, from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:41: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: At top level: ./include/drm/drm_atomic.h:864:9: error: expected identifier or ‘(’ before ‘for’ 864 | for ((__i) = 0; \ | ^~~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8317:9: note: in expansion of macro ‘for_each_new_crtc_in_state’ 8317 | for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Move the brace within the #ifdef so that the file can be built with or without CONFIG_DEBUG_FS. Fixes: 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr transition") Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 34314cd615af5036e582fad14f2bb13e4383bfe1 Author: Colin Ian King Date: Thu Oct 13 23:19:15 2022 +0100 parisc: Fix spelling mistake "mis-match" -> "mismatch" in eisa driver There are several spelling mistakes in kernel error messages. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Helge Deller commit a9e17d3d74d14e5fd10d54f0a07e0fce4e5f80dd Author: Paulo Alcantara Date: Fri Oct 14 13:40:42 2022 -0300 cifs: fix static checker warning Remove unnecessary NULL check of oparam->cifs_sb when parsing symlink error response as it's already set by all smb2_open_file() callers and deferenced earlier. This fixes below report: fs/cifs/smb2file.c:126 smb2_open_file() warn: variable dereferenced before check 'oparms->cifs_sb' (see line 112) Link: https://lore.kernel.org/r/Y0kt42j2tdpYakRu@kili Reported-by: Dan Carpenter Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit e0e86f25fd469ca76c1b50091372aed1ff99ca1a Author: Colin Ian King Date: Fri Oct 7 21:23:38 2022 +0100 drm/msm: Kconfig: Fix spelling mistake "throught" -> "through" There is a spelling mistake in a Kconfig description. Fix it. Signed-off-by: Colin Ian King Patchwork: https://patchwork.freedesktop.org/patch/506301/ Link: https://lore.kernel.org/r/20221007202338.2755731-1-colin.i.king@gmail.com Signed-off-by: Rob Clark commit ccc40d42bd59ac858b58322775004613f1d805af Author: Aashish Sharma Date: Tue Oct 11 13:25:19 2022 +0530 drm/msm: Remove redundant check for 'submit' Rectify the below smatch warning: drivers/gpu/drm/msm/msm_gem_submit.c:963 msm_ioctl_gem_submit() warn: variable dereferenced before check 'submit' 'submit' is normally error pointer or valid, so remove its NULL initializer as it's confusing and also remove a redundant check for it's value. Signed-off-by: Aashish Sharma Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Guenter Roeck Patchwork: https://patchwork.freedesktop.org/patch/506653/ Link: https://lore.kernel.org/r/20221011075519.3111928-1-shraash@google.com Signed-off-by: Rob Clark commit ec4fbd791519423726ce9fd5130de9a95365c8eb Author: Rob Clark Date: Thu Oct 13 15:55:15 2022 -0700 drm/msm/a6xx: Remove state objects from list before freeing Technically it worked as it was before, only because it was using the _safe version of the iterator. But it is sloppy practice to leave dangling pointers. Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu Reviewed-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/507017/ Link: https://lore.kernel.org/r/20221013225520.371226-4-robdclark@gmail.com commit fab384c496a313a1083554fb1eb2332a6756be2e Author: Rob Clark Date: Thu Oct 13 15:55:14 2022 -0700 drm/msm/a6xx: Skip snapshotting unused GMU buffers Some buffers are unused on certain sub-generations of a6xx. So just skip them. Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu Reviewed-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/507013/ Link: https://lore.kernel.org/r/20221013225520.371226-3-robdclark@gmail.com commit 83d18e9d9c0150d98dc24e3642ea93f5e245322c Author: Rob Clark Date: Thu Oct 13 15:55:13 2022 -0700 drm/msm/a6xx: Fix kvzalloc vs state_kcalloc usage adreno_show_object() is a trap! It will re-allocate the pointer it is passed on first call, when the data is ascii85 encoded, using kvmalloc/ kvfree(). Which means the data *passed* to it must be kvmalloc'd, ie. we cannot use the state_kcalloc() helper. This partially reverts commit ec8f1813bf8d ("drm/msm/a6xx: Replace kcalloc() with kvzalloc()"), but adds the missing kvfree() to fix the memory leak that was present previously. And adds a warning comment. Fixes: ec8f1813bf8d ("drm/msm/a6xx: Replace kcalloc() with kvzalloc()") Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/20 Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu Reviewed-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/507014/ Link: https://lore.kernel.org/r/20221013225520.371226-2-robdclark@gmail.com commit e552b7be12ed62357df84392efa525ecb01910fb Author: Rob Herring Date: Tue Oct 4 14:12:35 2022 -0500 perf: Skip and warn on unknown format 'configN' attrs If the kernel exposes a new perf_event_attr field in a format attr, perf will return an error stating the specified PMU can't be found. For example, a format attr with 'config3:0-63' causes an error as config3 is unknown to perf. This causes a compatibility issue between a newer kernel with older perf tool. Before this change with a kernel adding 'config3' I get: $ perf record -e arm_spe// -- true event syntax error: 'arm_spe//' \___ Cannot find PMU `arm_spe'. Missing kernel support? Run 'perf list' for a list of valid events Usage: perf record [] [] or: perf record [] -- [] -e, --event event selector. use 'perf list' to list available events After this change, I get: $ perf record -e arm_spe// -- true WARNING: 'arm_spe_0' format 'inv_event_filter' requires 'perf_event_attr::config3' which is not supported by this version of perf! [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.091 MB perf.data ] To support unknown configN formats, rework the YACC implementation to pass any config[0-9]+ format to perf_pmu__new_format() to handle with a warning. Reviewed-by: Namhyung Kim Signed-off-by: Rob Herring Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220914-arm-perf-tool-spe1-2-v2-v4-1-83c098e6212e@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0cef141e8630c0b08bd1c4309be2ba74480c69a3 Author: Andi Kleen Date: Tue Oct 4 12:26:34 2022 -0700 perf list: Fix metricgroups title message $ perf list metricgroups gives List of pre-defined events (to be used in -e): Metric Groups: Backend Bad BadSpec But that's incorrect of course because metric groups or metrics can only be specified with -M. So fix the message to say -e or -M Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: https://lore.kernel.org/r/20221004192634.998984-1-ak@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7d60fa2cde0d3d80c55492f86a2a944da7510a67 Author: Namhyung Kim Date: Tue Oct 4 13:02:11 2022 -0700 perf mem: Fix -C option behavior for perf mem record The -C/--cpu option was maily for report but it also affected record as it ate the option. So users needed to use "--" after perf mem record to pass the info to the perf record properly. Check if this option is set for record, and pass it to the actual perf record. Before) $ sudo perf --debug perf-event-open mem record -C 0 2>&1 | grep -a sys_perf_event_open ... sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 4 sys_perf_event_open: pid -1 cpu 1 group_fd -1 flags 0x8 = 5 sys_perf_event_open: pid -1 cpu 2 group_fd -1 flags 0x8 = 6 sys_perf_event_open: pid -1 cpu 3 group_fd -1 flags 0x8 = 7 sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 8 sys_perf_event_open: pid -1 cpu 1 group_fd -1 flags 0x8 = 9 sys_perf_event_open: pid -1 cpu 2 group_fd -1 flags 0x8 = 10 sys_perf_event_open: pid -1 cpu 3 group_fd -1 flags 0x8 = 11 ... After) $ sudo perf --debug perf-event-open mem record -C 0 2>&1 | grep -a sys_perf_event_open ... sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 4 sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 Reported-by: Ravi Bangoria Reviewed-by: Leo Yan Signed-off-by: Namhyung Kim Tested-by: Leo Yan Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221004200211.1444521-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 531778b129937ea3a6923bc67a45d024712a12f7 Author: Namhyung Kim Date: Thu Oct 6 15:22:32 2022 -0700 perf annotate: Add missing condition flags for arm64 According to the document [1], it can also have 'hs', 'lo', 'vc', 'vs' as a condition code. Let's add them too. [1] https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/condition-codes-1-condition-flags-and-codes Reported-by: Kevin Nomura Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mike Leach Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20221006222232.266416-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d5e57375a562f021b455e3f958cc28d54d0ff54b Author: Arnaldo Carvalho de Melo Date: Fri Oct 14 10:39:21 2022 -0300 libperf: Do not include non-UAPI linux/compiler.h header Its just for that __packed define, so use it expanded as __attribute__((packed)), like the other files in /usr/include do. This was problem was preventing building the libperf examples on ALT Linux and Fedora 35, fix it. Reported-by: Vitaly Chikunov Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Dmitry Levin Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/Y0lnpl2Ix7VljVDc@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 04518e4c2edc78bc90b4651d50c4aad48d09ac23 Author: Guru Das Srinagesh Date: Tue Oct 11 12:06:00 2022 -0700 scripts/clang-tools: Convert clang-tidy args to list Convert list of clang-tidy arguments to a list for ease of adding to them and extending them as required. Signed-off-by: Guru Das Srinagesh Suggested-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 11df33c36c4b7a04d2674531f2c6178ad8d61572 Author: Richard Acayan Date: Mon Oct 10 21:38:28 2022 -0400 modpost: put modpost options before argument The musl implementation of getopt stops looking for options after the first non-option argument. Put the options before the non-option argument so environments using musl can still build the kernel and modules. Fixes: f73edc8951b2 ("kbuild: unify two modpost invocations") Link: https://git.musl-libc.org/cgit/musl/tree/src/misc/getopt.c?h=dc9285ad1dc19349c407072cc48ba70dab86de45#n44 Signed-off-by: Richard Acayan Signed-off-by: Masahiro Yamada commit fe180a52014fd4a768345fc7ff11a7ced45765e6 Author: James Clark Date: Wed Oct 5 15:05:08 2022 +0100 perf test: Fix test_arm_coresight.sh failures on Juno This test commonly fails on Arm Juno because the instruction interval is large enough to miss generating any samples for Perf in system-wide mode. Fix this by lowering the interval until a comfortable number of Perf instructions are generated. The test is still quick to run because only a small amount of trace is gathered. Before: sudo ./perf test coresight -vvv ... Recording trace with system wide mode Looking at perf.data file for dumping branch samples: Looking at perf.data file for reporting branch samples: Looking at perf.data file for instruction samples: CoreSight system wide testing: FAIL ... After: sudo ./perf test coresight -vvv ... Recording trace with system wide mode Looking at perf.data file for dumping branch samples: Looking at perf.data file for reporting branch samples: Looking at perf.data file for instruction samples: CoreSight system wide testing: PASS ... Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20221005140508.1537277-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f21cb52036373a108acde5853931facfea727a7b Author: Namhyung Kim Date: Mon Oct 10 22:28:08 2022 -0700 perf stat: Support old kernels for bperf cgroup counting The recent change in the cgroup will break the backward compatiblity in the BPF program. It should support both old and new kernels using BPF CO-RE technique. Like the task_struct->__state handling in the offcpu analysis, we can check the field name in the cgroup struct. Signed-off-by: Namhyung Kim Acked-by: Andrii Nakryiko Acked-by: Jiri Olsa Cc: Johannes Weiner Cc: Song Liu Cc: Tejun Heo Cc: bpf@vger.kernel.org Cc: cgroups@vger.kernel.org Cc: zefan li Link: http://lore.kernel.org/lkml/20221011052808.282394-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a383dcb1cca8305497877119fba0a320f41fe853 Author: Oleksandr Tyshchenko Date: Sat Oct 8 18:10:13 2022 +0300 xen/virtio: Convert PAGE_SIZE/PAGE_SHIFT/PFN_UP to Xen counterparts Currently, a grant ref is always based on the Xen page granularity (4KB), and guest commonly uses the same page granularity. But the guest may use a different page granularity (i.e 64KB). So adopt the code to be able to deal with it. Signed-off-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Reviewed-by: Xenia Ragiadakou Link: https://lore.kernel.org/r/20221008151013.2537826-3-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 875553e317b28e66824fec73ad4459372576ec68 Author: Oleksandr Tyshchenko Date: Sat Oct 8 18:10:12 2022 +0300 xen/virtio: Handle cases when page offset > PAGE_SIZE properly Passed to xen_grant_dma_map_page() offset in the page can be > PAGE_SIZE even if the guest uses the same page granularity as Xen (4KB). Before current patch, if such case happened we ended up providing grants for the whole region in xen_grant_dma_map_page() which was really unnecessary. The more, we ended up not releasing all grants which represented that region in xen_grant_dma_unmap_page(). Current patch updates the code to be able to deal with such cases. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Reviewed-by: Xenia Ragiadakou Link: https://lore.kernel.org/r/20221008151013.2537826-2-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 4efb365a3f04d0bee7833f168b0b00a15edefeac Author: David Sterba Date: Tue Oct 11 15:08:32 2022 +0200 MAINTAINERS: update btrfs website links and files We have the new documentation hosted on Read The Docs and content is migrated there from the wiki. Also update http to https and add the tracepoint definition header. Signed-off-by: David Sterba commit 96cb9d0554457086664d3bd10630b11193d863f1 Author: Jason A. Donenfeld Date: Mon Oct 10 09:06:07 2022 -0600 hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() Rather than busy looping, yield back to the scheduler and sleep for a bit in the event that there's no data. This should hopefully prevent the stalls that Mark reported: <6>[ 3.362859] Freeing initrd memory: 16196K <3>[ 23.160131] rcu: INFO: rcu_sched self-detected stall on CPU <3>[ 23.166057] rcu: 0-....: (2099 ticks this GP) idle=03b4/1/0x40000002 softirq=28/28 fqs=1050 <4>[ 23.174895] (t=2101 jiffies g=-1147 q=2353 ncpus=4) <4>[ 23.180203] CPU: 0 PID: 49 Comm: hwrng Not tainted 6.0.0 #1 <4>[ 23.186125] Hardware name: BCM2835 <4>[ 23.189837] PC is at bcm2835_rng_read+0x30/0x6c <4>[ 23.194709] LR is at hwrng_fillfn+0x71/0xf4 <4>[ 23.199218] pc : [] lr : [] psr: 40000033 <4>[ 23.205840] sp : f093df70 ip : 00000000 fp : 00000000 <4>[ 23.211404] r10: c3c7e800 r9 : 00000000 r8 : c17e6b20 <4>[ 23.216968] r7 : c17e6b64 r6 : c18b0a74 r5 : c07ccd99 r4 : c3f171c0 <4>[ 23.223855] r3 : 000fffff r2 : 00000040 r1 : c3c7e800 r0 : c3f171c0 <4>[ 23.230743] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment none <4>[ 23.238426] Control: 50c5387d Table: 0020406a DAC: 00000051 <4>[ 23.244519] CPU: 0 PID: 49 Comm: hwrng Not tainted 6.0.0 #1 Link: https://lore.kernel.org/all/Y0QJLauamRnCDUef@sirena.org.uk/ Signed-off-by: Jason A. Donenfeld Acked-by: Florian Fainelli Signed-off-by: Herbert Xu commit 9fecab247ed15e6145c126fc56ee1e89860741a7 Author: Roderick Colenbrander Date: Mon Oct 10 14:23:13 2022 -0700 HID: playstation: support updated DualSense rumble mode. Newer DualSense firmware supports a revised classic rumble mode, which feels more similar to rumble as supported on previous PlayStation controllers. It has been made the default on PlayStation and non-PlayStation devices now (e.g. iOS and Windows). Default to this new mode when supported. Signed-off-by: Roderick Colenbrander Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20221010212313.78275-4-roderick.colenbrander@sony.com commit b8a968efab301743fd659b5649c5d7d3e30e63a6 Author: Roderick Colenbrander Date: Mon Oct 10 14:23:12 2022 -0700 HID: playstation: add initial DualSense Edge controller support Provide initial support for the DualSense Edge controller. The brings support up to the level of the original DualSense, but won't yet provide support for new features (e.g. reprogrammable buttons). Signed-off-by: Roderick Colenbrander CC: stable@vger.kernel.org Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20221010212313.78275-3-roderick.colenbrander@sony.com commit 182934a1e93b17f4edf71f4fcc8d19b19a6fe67a Author: Roderick Colenbrander Date: Mon Oct 10 14:23:11 2022 -0700 HID: playstation: stop DualSense output work on remove. Ensure we don't schedule any new output work on removal and wait for any existing work to complete. If we don't do this e.g. rumble work can get queued during deletion and we trigger a kernel crash. Signed-off-by: Roderick Colenbrander CC: stable@vger.kernel.org Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20221010212313.78275-2-roderick.colenbrander@sony.com commit bb5f0c855dcfc893ae5ed90e4c646bde9e4498bf Author: José Expósito Date: Sun Oct 9 20:27:47 2022 +0200 HID: magicmouse: Do not set BTN_MOUSE on double report Under certain conditions the Magic Trackpad can group 2 reports in a single packet. The packet is split and the raw event function is invoked recursively for each part. However, after processing each part, the BTN_MOUSE status is updated, sending multiple click events. [1] Return after processing double reports to avoid this issue. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/811 # [1] Fixes: a462230e16ac ("HID: magicmouse: enable Magic Trackpad support") Reported-by: Nulo Signed-off-by: José Expósito Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20221009182747.90730-1-jose.exposito89@gmail.com commit 70be49f2f6223ddd2fcddb0089a40864c37e1494 Author: Helge Deller Date: Fri Oct 14 10:18:53 2022 +0200 parisc: Fix userspace graphics card breakage due to pgtable special bit Commit df24e1783e6e ("parisc: Add vDSO support") introduced the vDSO support, for which a _PAGE_SPECIAL page table flag was needed. Since we wanted to keep every page table entry in 32-bits, this patch re-used the existing - but yet unused - _PAGE_DMB flag (which triggers a hardware break if a page is accessed) to store the special bit. But when graphics card memory is mmapped into userspace, the kernel uses vm_iomap_memory() which sets the the special flag. So, with the DMB bit set, every access to the graphics memory now triggered a hardware exception and segfaulted the userspace program. Fix this breakage by dropping the DMB bit when writing the page protection bits to the CPU TLB. In addition this patch adds a small optimization: if huge pages aren't configured (which is at least the case for 32-bit kernels), then the special bit is stored in the hpage (HUGE PAGE) bit instead. That way we can skip to reset the DMB bit. Fixes: df24e1783e6e ("parisc: Add vDSO support") Cc: # 5.18+ Signed-off-by: Helge Deller commit aca7c13d3bee81a968337a5515411409ae9d095d Author: Helge Deller Date: Fri Oct 14 10:13:55 2022 +0200 parisc: fbdev/stifb: Align graphics memory size to 4MB Independend of the current graphics resolution, adjust the reported graphics card memory size to the next 4MB boundary. This fixes the fbtest program which expects a naturally aligned size. Signed-off-by: Helge Deller Cc: commit 0c93411795513a0e8dfcb5bcc7bab756b98bfc73 Author: Krzysztof Kozlowski Date: Thu Oct 13 19:42:05 2022 -0400 MAINTAINERS: nfc: s3fwrn5: Drop Krzysztof Opasiak Emails to Krzysztof Opasiak bounce ("Recipient address rejected: User unknown") so drop his email from maintainers of s3fwrn5 NFC bindings and driver. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 9a9a5d80ec9887814042c69768c2fee7961db7f4 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:36 2022 -0700 MAINTAINERS: git://github -> https://github.com for petkan Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: David S. Miller commit 3d6642eac74d9442fde232181aa52d26d47991df Author: zhangxiangqian Date: Thu Oct 13 15:41:12 2022 +0800 net: macvlan: change schedule system_wq to system_unbound_wq For FT2000+/64 devices, when four virtual machines share the same physical network interface, DROP will occur due to the single core CPU performance problem. ip_check_defrag and macvlan_process_broadcast is on the same CPU. When the MACVLAN PORT increases, the CPU usage reaches more than 90%. bc_queue > bc_queue_len_used (default 1000), causing DROP. Signed-off-by: zhangxiangqian Signed-off-by: David S. Miller commit 0d87bbd39d7fd1135ab9eca672d760470f6508e8 Author: Jakub Kicinski Date: Wed Oct 12 15:55:20 2022 -0700 tls: strp: make sure the TCP skbs do not have overlapping data TLS tries to get away with using the TCP input queue directly. This does not work if there is duplicated data (multiple skbs holding bytes for the same seq number range due to retransmits). Check for this condition and fall back to copy mode, it should be rare. Fixes: 84c61fe1a75b ("tls: rx: do not use the standard strparser") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit aae425efdfd1b1d8452260a3cb49344ebf20b1f5 Author: Jan Sokolowski Date: Wed Oct 12 13:54:40 2022 -0700 i40e: Fix DMA mappings leak During reallocation of RX buffers, new DMA mappings are created for those buffers. steps for reproduction: while : do for ((i=0; i<=8160; i=i+32)) do ethtool -G enp130s0f0 rx $i tx $i sleep 0.5 ethtool -g enp130s0f0 done done This resulted in crash: i40e 0000:01:00.1: Unable to allocate memory for the Rx descriptor ring, size=65536 Driver BUG WARNING: CPU: 0 PID: 4300 at net/core/xdp.c:141 xdp_rxq_info_unreg+0x43/0x50 Call Trace: i40e_free_rx_resources+0x70/0x80 [i40e] i40e_set_ringparam+0x27c/0x800 [i40e] ethnl_set_rings+0x1b2/0x290 genl_family_rcv_msg_doit.isra.15+0x10f/0x150 genl_family_rcv_msg+0xb3/0x160 ? rings_fill_reply+0x1a0/0x1a0 genl_rcv_msg+0x47/0x90 ? genl_family_rcv_msg+0x160/0x160 netlink_rcv_skb+0x4c/0x120 genl_rcv+0x24/0x40 netlink_unicast+0x196/0x230 netlink_sendmsg+0x204/0x3d0 sock_sendmsg+0x4c/0x50 __sys_sendto+0xee/0x160 ? handle_mm_fault+0xbe/0x1e0 ? syscall_trace_enter+0x1d3/0x2c0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca RIP: 0033:0x7f5eac8b035b Missing register, driver bug WARNING: CPU: 0 PID: 4300 at net/core/xdp.c:119 xdp_rxq_info_unreg_mem_model+0x69/0x140 Call Trace: xdp_rxq_info_unreg+0x1e/0x50 i40e_free_rx_resources+0x70/0x80 [i40e] i40e_set_ringparam+0x27c/0x800 [i40e] ethnl_set_rings+0x1b2/0x290 genl_family_rcv_msg_doit.isra.15+0x10f/0x150 genl_family_rcv_msg+0xb3/0x160 ? rings_fill_reply+0x1a0/0x1a0 genl_rcv_msg+0x47/0x90 ? genl_family_rcv_msg+0x160/0x160 netlink_rcv_skb+0x4c/0x120 genl_rcv+0x24/0x40 netlink_unicast+0x196/0x230 netlink_sendmsg+0x204/0x3d0 sock_sendmsg+0x4c/0x50 __sys_sendto+0xee/0x160 ? handle_mm_fault+0xbe/0x1e0 ? syscall_trace_enter+0x1d3/0x2c0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca RIP: 0033:0x7f5eac8b035b This was caused because of new buffers with different RX ring count should substitute older ones, but those buffers were freed in i40e_configure_rx_ring and reallocated again with i40e_alloc_rx_bi, thus kfree on rx_bi caused leak of already mapped DMA. Fix this by reallocating ZC with rx_bi_zc struct when BPF program loads. Additionally reallocate back to rx_bi when BPF program unloads. If BPF program is loaded/unloaded and XSK pools are created, reallocate RX queues accordingly in XSP_SETUP_XSK_POOL handler. Fixes: be1222b585fd ("i40e: Separate kernel allocated rx_bi rings from AF_XDP rings") Signed-off-by: Jan Sokolowski Signed-off-by: Mateusz Palczewski Signed-off-by: Jacob Keller Tested-by: Chandan (A Contingent Worker at Intel) Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: David S. Miller commit 0d4636f7d72df3179b20a2d32b647881917a5e2a Author: Christian Marangi Date: Wed Oct 12 19:18:37 2022 +0200 net: dsa: qca8k: fix ethtool autocast mib for big-endian systems The switch sends autocast mib in little-endian. This is problematic for big-endian system as the values needs to be converted. Fix this by converting each mib value to cpu byte order. Fixes: 5c957c7ca78c ("net: dsa: qca8k: add support for mib autocast in Ethernet packet") Tested-by: Pawel Dembicki Tested-by: Lech Perczak Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit a2550d3ce53c68f54042bc5e468c4d07491ffe0e Author: Christian Marangi Date: Wed Oct 12 19:18:36 2022 +0200 net: dsa: qca8k: fix inband mgmt for big-endian systems The header and the data of the skb for the inband mgmt requires to be in little-endian. This is problematic for big-endian system as the mgmt header is written in the cpu byte order. Fix this by converting each value for the mgmt header and data to little-endian, and convert to cpu byte order the mgmt header and data sent by the switch. Fixes: 5950c7c0a68c ("net: dsa: qca8k: add support for mgmt read/write in Ethernet packet") Tested-by: Pawel Dembicki Tested-by: Lech Perczak Signed-off-by: Christian Marangi Reviewed-by: Lech Perczak Signed-off-by: David S. Miller commit 777ecaabd614d47c482a5c9031579e66da13989a Author: Alexander Potapenko Date: Wed Oct 12 17:25:14 2022 +0200 tipc: fix an information leak in tipc_topsrv_kern_subscr Use a 8-byte write to initialize sub.usr_handle in tipc_topsrv_kern_subscr(), otherwise four bytes remain uninitialized when issuing setsockopt(..., SOL_TIPC, ...). This resulted in an infoleak reported by KMSAN when the packet was received: ===================================================== BUG: KMSAN: kernel-infoleak in copyout+0xbc/0x100 lib/iov_iter.c:169 instrument_copy_to_user ./include/linux/instrumented.h:121 copyout+0xbc/0x100 lib/iov_iter.c:169 _copy_to_iter+0x5c0/0x20a0 lib/iov_iter.c:527 copy_to_iter ./include/linux/uio.h:176 simple_copy_to_iter+0x64/0xa0 net/core/datagram.c:513 __skb_datagram_iter+0x123/0xdc0 net/core/datagram.c:419 skb_copy_datagram_iter+0x58/0x200 net/core/datagram.c:527 skb_copy_datagram_msg ./include/linux/skbuff.h:3903 packet_recvmsg+0x521/0x1e70 net/packet/af_packet.c:3469 ____sys_recvmsg+0x2c4/0x810 net/socket.c:? ___sys_recvmsg+0x217/0x840 net/socket.c:2743 __sys_recvmsg net/socket.c:2773 __do_sys_recvmsg net/socket.c:2783 __se_sys_recvmsg net/socket.c:2780 __x64_sys_recvmsg+0x364/0x540 net/socket.c:2780 do_syscall_x64 arch/x86/entry/common.c:50 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd arch/x86/entry/entry_64.S:120 ... Uninit was stored to memory at: tipc_sub_subscribe+0x42d/0xb50 net/tipc/subscr.c:156 tipc_conn_rcv_sub+0x246/0x620 net/tipc/topsrv.c:375 tipc_topsrv_kern_subscr+0x2e8/0x400 net/tipc/topsrv.c:579 tipc_group_create+0x4e7/0x7d0 net/tipc/group.c:190 tipc_sk_join+0x2a8/0x770 net/tipc/socket.c:3084 tipc_setsockopt+0xae5/0xe40 net/tipc/socket.c:3201 __sys_setsockopt+0x87f/0xdc0 net/socket.c:2252 __do_sys_setsockopt net/socket.c:2263 __se_sys_setsockopt net/socket.c:2260 __x64_sys_setsockopt+0xe0/0x160 net/socket.c:2260 do_syscall_x64 arch/x86/entry/common.c:50 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd arch/x86/entry/entry_64.S:120 Local variable sub created at: tipc_topsrv_kern_subscr+0x57/0x400 net/tipc/topsrv.c:562 tipc_group_create+0x4e7/0x7d0 net/tipc/group.c:190 Bytes 84-87 of 88 are uninitialized Memory access of size 88 starts at ffff88801ed57cd0 Data copied to user address 0000000020000400 ... ===================================================== Signed-off-by: Alexander Potapenko Fixes: 026321c6d056a5 ("tipc: rename tipc_server to tipc_topsrv") Signed-off-by: David S. Miller commit 28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e Author: Mark Tomlinson Date: Mon Oct 10 15:46:13 2022 +1300 tipc: Fix recognition of trial period The trial period exists until jiffies is after addr_trial_end. But as jiffies will eventually overflow, just using time_after will eventually give incorrect results. As the node address is set once the trial period ends, this can be used to know that we are not in the trial period. Fixes: e415577f57f4 ("tipc: correct discovery message handling during address trial period") Signed-off-by: Mark Tomlinson Signed-off-by: David S. Miller commit 9c9155a3509a2ebdb06d77c7a621e9685c802eac Merge: a521fc3cfbf45 fc3523a833c9c Author: Linus Torvalds Date: Thu Oct 13 21:56:34 2022 -0700 Merge tag 'drm-next-2022-10-14' of git://anongit.freedesktop.org/drm/drm Pull more drm updates from Dave Airlie: "Round of fixes for the merge window stuff, bunch of amdgpu and i915 changes, this should have the gcc11 warning fix, amongst other changes. amdgpu: - DC mutex fix - DC SubVP fixes - DCN 3.2.x fixes - DCN 3.1.x fixes - SDMA 6.x fixes - Enable DPIA for 3.1.4 - VRR fixes - VRAM BO swapping fix - Revert dirty fb helper change - SR-IOV suspend/resume fixes - Work around GCC array bounds check fail warning - UMC 8.10 fixes - Misc fixes and cleanups i915: - Round to closest in g4x+ HDMI clock readout - Update MOCS table for EHL - Fix PSR_IMR/IIR field handling - Fix watermark calculations for gen12+/DG2 modifiers - Reject excessive dotclocks early - Fix revocation of non-persistent contexts - Handle migration for dpt - Fix display problems after resume - Allow control over the flags when migrating - Consider DG2_RC_CCS_CC when migrating buffers" * tag 'drm-next-2022-10-14' of git://anongit.freedesktop.org/drm/drm: (110 commits) drm/amd/display: Add HUBP surface flip interrupt handler drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers drm/i915: allow control over the flags when migrating drm/amd/display: Simplify bool conversion drm/amd/display: fix transfer function passed to build_coefficients() drm/amd/display: add a license to cursor_reg_cache.h drm/amd/display: make virtual_disable_link_output static drm/amd/display: fix indentation in dc.c drm/amd/display: make dcn32_split_stream_for_mpc_or_odm static drm/amd/display: fix build error on arm64 drm/amd/display: 3.2.207 drm/amd/display: Clean some DCN32 macros drm/amdgpu: Add poison mode query for umc v8_10_0 drm/amdgpu: Update umc v8_10_0 headers drm/amdgpu: fix coding style issue for mca notifier drm/amdgpu: define convert_error_address for umc v8.7 drm/amdgpu: define RAS convert_error_address API drm/amdgpu: remove check for CE in RAS error address query drm/i915: Fix display problems after resume drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() [take 2] ... commit a521fc3cfbf45f910d6f4438cc222fda15a4987b Merge: c98c70ed43cc3 3bc429c1e2cf6 Author: Linus Torvalds Date: Thu Oct 13 21:25:57 2022 -0700 Merge tag 'block-6.1-2022-10-13' of git://git.kernel.dk/linux Pull more block updates from Jens Axboe: "Fixes that ended up landing later than the initial block pull request. Nothing really major in here: - NVMe pull request via Christoph: - add NVME_QUIRK_BOGUS_NID for Lexar NM760 (Abhijit) - add NVME_QUIRK_NO_DEEPEST_PS to avoid the deepest sleep state on ZHITAI TiPro5000 SSDs (Xi Ruoyao) - fix possible hang caused during ctrl deletion (Sagi Grimberg) - fix possible hang in live ns resize with ANA access (Sagi Grimberg) - Proactively avoid a sign extension issue with the queue flags (Brian) - Regression fix for hidden disks (Christoph) - Update OPAL maintainers entry (Jonathan) - blk-wbt regression initialization fix (Yu)" * tag 'block-6.1-2022-10-13' of git://git.kernel.dk/linux: nvme-multipath: fix possible hang in live ns resize with ANA access nvme-pci: avoid the deepest sleep state on ZHITAI TiPro5000 SSDs nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM760 nvme-tcp: fix possible hang caused during ctrl deletion nvme-rdma: fix possible hang caused during ctrl deletion block: fix leaking minors of hidden disks block: avoid sign extend problem with default queue flags mask blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() block: Remove the repeat word 'can' MAINTAINERS: Update SED-Opal Maintainers commit c98c70ed43cc35b6d5ca9713e037bfe2debc251c Merge: 6d84c258e804d 2ec33a6c3cca9 Author: Linus Torvalds Date: Thu Oct 13 21:15:30 2022 -0700 Merge tag 'io_uring-6.1-2022-10-13' of git://git.kernel.dk/linux Pull more io_uring updates from Jens Axboe: "A collection of fixes that ended up either being later than the initial pull, or dependent on multiple branches (6.0-late being one of them) and hence deferred purposely. This contains: - Cleanup fixes for the single submitter late 6.0 change, which we pushed to 6.1 to keep the 6.0 changes small (Dylan, Pavel) - Fix for IORING_OP_CONNECT not handling -EINPROGRESS correctly (me) - Ensure that the zc sendmsg variant gets audited correctly (me) - Regression fix from this merge window where kiocb_end_write() doesn't always gets called, which can cause issues with fs freezing (me) - Registered files SCM handling fix (Pavel) - Regression fix for big sqe dumping in fdinfo (Pavel) - Registered buffers accounting fix (Pavel) - Remove leftover notification structures, we killed them off late in 6.0 (Pavel) - Minor optimizations (Pavel) - Cosmetic variable shadowing fix (Stefan)" * tag 'io_uring-6.1-2022-10-13' of git://git.kernel.dk/linux: io_uring/rw: ensure kiocb_end_write() is always called io_uring: fix fdinfo sqe offsets calculation io_uring: local variable rw shadows outer variable in io_write io_uring/opdef: remove 'audit_skip' from SENDMSG_ZC io_uring: optimise locking for local tw with submit_wait io_uring: remove redundant memory barrier in io_req_local_work_add io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT io_uring: remove notif leftovers io_uring: correct pinned_vm accounting io_uring/af_unix: defer registered files gc to io_uring release io_uring: limit registration w/ SINGLE_ISSUER io_uring: remove io_register_submitter io_uring: simplify __io_uring_add_tctx_node commit ab0c23b535f3f9d8345d8ad4c18c0a8594459d55 Author: Conor Dooley Date: Tue Oct 11 17:07:45 2022 +0100 MAINTAINERS: add RISC-V's patchwork The RISC-V patchwork instance on kernel.org has had some necromancy performed on it & will be used going forward. The statuses that are intended to be used are: - New: No action has been taken yet - Under Review: The maintainer is waiting for review comments from others - Changes Requested: Either the maintainer or a reviewer requested changes in the patch. The patch author is expected to submit a new version - Superseded: There's a new version of the patch available - Not Applicable: The patch is not intended for the RISC-V tree - Accepted: The patch has been applied - Rejected: The patch has been rejected, with reasons stated in an email Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221011160744.2167025-1-conor@kernel.org/ Signed-off-by: Palmer Dabbelt commit fc3523a833c9c109e68209f1ecdd15864373e66a Merge: e55978a4f2646 0811b9e4530d7 Author: Dave Airlie Date: Fri Oct 14 07:47:25 2022 +1000 Merge tag 'amd-drm-fixes-6.1-2022-10-12' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-fixes-6.1-2022-10-12: amdgpu: - DC mutex fix - DC SubVP fixes - DCN 3.2.x fixes - DCN 3.1.x fixes - SDMA 6.x fixes - Enable DPIA for 3.1.4 - VRR fixes - VRAM BO swapping fix - Revert dirty fb helper change - SR-IOV suspend/resume fixes - Work around GCC array bounds check fail warning - UMC 8.10 fixes - Misc fixes and cleanups Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20221012162650.8810-1-alexander.deucher@amd.com commit e55978a4f264676dfbbd5d955c88a60c6eb3aa7a Merge: d6fe5887ca891 ea19684afb545 Author: Dave Airlie Date: Fri Oct 14 07:46:50 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-10-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Fix revocation of non-persistent contexts (Tvrtko Ursulin) - Handle migration for dpt (Matthew Auld) - Fix display problems after resume (Thomas Hellström) - Allow control over the flags when migrating (Matthew Auld) - Consider DG2_RC_CCS_CC when migrating buffers (Matthew Auld) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Y0gK9QmCmktLLzqp@tursulin-desk commit e5f12a398371280649ccc9d6eb0b97fd42a5df98 Author: Ke Sun Date: Sat Oct 8 15:13:21 2022 +0800 rtc: rv3028: Fix codestyle errors Compiler warnings: drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_set': drivers/rtc/rtc-rv3028.c:559:20: warning: statement will never be executed [-Wswitch-unreachable] 559 | u8 mode; | ^~~~ drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_get': drivers/rtc/rtc-rv3028.c:526:21: warning: statement will never be executed [-Wswitch-unreachable] 526 | u32 value; | ^~~~~ Fix it by moving the variable declaration to the beginning of the function. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reported-by: k2ci Signed-off-by: Ke Sun Link: https://lore.kernel.org/r/20221008071321.1799971-1-sunke@kylinos.cn Signed-off-by: Alexandre Belloni commit 4919d3eb2ec0ee364f7e3cf2d99646c1b224fae8 Author: Rafael J. Wysocki Date: Wed Oct 12 20:07:01 2022 +0200 rtc: cmos: Fix event handler registration ordering issue Because acpi_install_fixed_event_handler() enables the event automatically on success, it is incorrect to call it before the handler routine passed to it is ready to handle events. Unfortunately, the rtc-cmos driver does exactly the incorrect thing by calling cmos_wake_setup(), which passes rtc_handler() to acpi_install_fixed_event_handler(), before cmos_do_probe(), because rtc_handler() uses dev_get_drvdata() to get to the cmos object pointer and the driver data pointer is only populated in cmos_do_probe(). This leads to a NULL pointer dereference in rtc_handler() on boot if the RTC fixed event happens to be active at the init time. To address this issue, change the initialization ordering of the driver so that cmos_wake_setup() is always called after a successful cmos_do_probe() call. While at it, change cmos_pnp_probe() to call cmos_do_probe() after the initial if () statement used for computing the IRQ argument to be passed to cmos_do_probe() which is cleaner than calling it in each branch of that if () (local variable "irq" can be of type int, because it is passed to that function as an argument of type int). Note that commit 6492fed7d8c9 ("rtc: rtc-cmos: Do not check ACPI_FADT_LOW_POWER_S0") caused this issue to affect a larger number of systems, because previously it only affected systems with ACPI_FADT_LOW_POWER_S0 set, but it is present regardless of that commit. Fixes: 6492fed7d8c9 ("rtc: rtc-cmos: Do not check ACPI_FADT_LOW_POWER_S0") Fixes: a474aaedac99 ("rtc-cmos: move wake setup from ACPI glue into RTC driver") Link: https://lore.kernel.org/linux-acpi/20221010141630.zfzi7mk7zvnmclzy@techsingularity.net/ Reported-by: Mel Gorman Signed-off-by: Rafael J. Wysocki Reviewed-by: Bjorn Helgaas Tested-by: Mel Gorman Link: https://lore.kernel.org/r/5629262.DvuYhMxLoT@kreacher Signed-off-by: Alexandre Belloni commit 9cc205e3c17d5716da7ebb7fa0c985555e95d009 Author: Maciej W. Rozycki Date: Thu Sep 22 22:56:06 2022 +0100 RISC-V: Make port I/O string accessors actually work Fix port I/O string accessors such as `insb', `outsb', etc. which use the physical PCI port I/O address rather than the corresponding memory mapping to get at the requested location, which in turn breaks at least accesses made by our parport driver to a PCIe parallel port such as: PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20 parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP] causing a memory access fault: Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008 Oops [#1] Modules linked in: CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23 Hardware name: SiFive HiFive Unmatched A00 (DT) epc : parport_pc_fifo_write_block_pio+0x266/0x416 ra : parport_pc_fifo_write_block_pio+0xb4/0x416 epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60 gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000 t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0 s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000 a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000 s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50 s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000 s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000 s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930 t5 : 0000000000001000 t6 : 0000000000040000 status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f [] parport_pc_compat_write_block_pio+0xfe/0x200 [] parport_write+0x46/0xf8 [] lp_write+0x158/0x2d2 [] vfs_write+0x8e/0x2c2 [] ksys_write+0x52/0xc2 [] sys_write+0xe/0x16 [] ret_from_syscall+0x0/0x2 ---[ end trace 0000000000000000 ]--- For simplicity address the problem by adding PCI_IOBASE to the physical address requested in the respective wrapper macros only, observing that the raw accessors such as `__insb', `__outsb', etc. are not supposed to be used other than by said macros. Remove the cast to `long' that is no longer needed on `addr' now that it is used as an offset from PCI_IOBASE and add parentheses around `addr' needed for predictable evaluation in macro expansion. No need to make said adjustments in separate changes given that current code is gravely broken and does not ever work. Signed-off-by: Maciej W. Rozycki Fixes: fab957c11efe2 ("RISC-V: Atomic and Locking Code") Cc: stable@vger.kernel.org # v4.15+ Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209220223080.29493@angie.orcam.me.uk Signed-off-by: Palmer Dabbelt commit 4c540c92b46497dcda59203eea78e4620bc96f47 Merge: 8aeb7b17f04ef 3baca1a4d4904 Author: Palmer Dabbelt Date: Thu Oct 13 14:02:36 2022 -0700 RISC-V: Add mvendorid, marchid, and mimpid to /proc/cpuinfo output I'm merging this in as a single commit as it's a dependency for some other work. * commit '3baca1a4d490484fcd555413f1fec85b2e071912': RISC-V: Add mvendorid, marchid, and mimpid to /proc/cpuinfo output commit 8aeb7b17f04ef40f620c763502e2b644c5c73efd Merge: c45fc916c2b2c 9e2e6042a7ec6 Author: Palmer Dabbelt Date: Thu Oct 13 12:49:12 2022 -0700 RISC-V: Make mmap() with PROT_WRITE imply PROT_READ Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") made mmap() reject mappings with only PROT_WRITE set in an attempt to fix an observed inconsistency in behavior when attempting to read from a PROT_WRITE-only mapping. The root cause of this behavior was actually that while RISC-V's protection_map maps VM_WRITE to readable PTE permissions (since write-only PTEs are considered reserved by the privileged spec), the page fault handler considered loads from VM_WRITE-only VMAs illegal accesses. Fix the underlying cause by handling faults in VM_WRITE-only VMAs (patch 1) and then re-enable use of mmap(PROT_WRITE) (patch 2), making RISC-V's behavior consistent with all other architectures that don't support write-only PTEs. * remotes/palmer/riscv-wonly: riscv: Allow PROT_WRITE-only mmap() riscv: Make VM_WRITE imply VM_READ Link: https://lore.kernel.org/r/20220915193702.2201018-1-abrestic@rivosinc.com/ Signed-off-by: Palmer Dabbelt commit 6d84c258e804db1983e70803af8be64bc8cb9a65 Merge: 098179413d073 917c362b5f8a6 Author: Linus Torvalds Date: Thu Oct 13 12:22:42 2022 -0700 Merge tag 'devicetree-fixes-for-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fixes for Mediatek MT6370 binding - Merge the DT overlay maintainer entry to the main entry as Pantelis is not active and Frank is taking a step back * tag 'devicetree-fixes-for-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: MAINTAINERS: of: collapse overlay entry into main device tree entry dt-bindings: mfd: mt6370: fix the interrupt order of the charger in the example dt-bindings: leds: mt6370: Fix MT6370 LED indicator DT warning commit 098179413d07392ad8c52c7c7605d3d3886ef569 Merge: f2b220ef93ea3 6e141772e6465 Author: Linus Torvalds Date: Thu Oct 13 12:19:18 2022 -0700 Merge tag 'mmc-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Add SD card quirk for broken discard MMC host: - renesas_sdhi: Fix clock rounding errors - sdhci-sprd: Fix minimum clock limit to detect cards - sdhci-tegra: Use actual clock rate for SW tuning correction" * tag 'mmc-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-sprd: Fix minimum clock limit mmc: sdhci-tegra: Use actual clock rate for SW tuning correction mmc: renesas_sdhi: Fix rounding errors mmc: core: Add SD card quirk for broken discard commit 4ef96d4dc8e1c418260abf817a90a3adb2d386ac Author: Jiri Slaby (SUSE) Date: Tue Oct 4 12:33:41 2022 +0200 ACPI: resource: note more about IRQ override Use an exclamation mark to note which of the properties was overridden. Signed-off-by: Jiri Slaby (SUSE) Signed-off-by: Rafael J. Wysocki commit bfcdf58380b1d9be564a78a9370da722ed1a9965 Author: Jiri Slaby (SUSE) Date: Tue Oct 4 12:33:40 2022 +0200 ACPI: resource: do IRQ override on LENOVO IdeaPad LENOVO IdeaPad Flex 5 is ryzen-5 based and the commit below removed IRQ overriding for those. This broke touchscreen and trackpad: i2c_designware AMDI0010:00: controller timed out i2c_designware AMDI0010:03: controller timed out i2c_hid_acpi i2c-MSFT0001:00: failed to reset device: -61 i2c_designware AMDI0010:03: controller timed out ... i2c_hid_acpi i2c-MSFT0001:00: can't add hid device: -61 i2c_hid_acpi: probe of i2c-MSFT0001:00 failed with error -61 White-list this specific model in the override_table. For this to work, the ZEN test needs to be put below the table walk. Fixes: 37c81d9f1d1b (ACPI: resource: skip IRQ override on AMD Zen platforms) Link: https://bugzilla.suse.com/show_bug.cgi?id=1203794 Signed-off-by: Jiri Slaby (SUSE) Signed-off-by: Rafael J. Wysocki commit f6ec01da40e4139b41179f046044ee7c4f6370dc Author: Tony Luck Date: Mon Oct 10 13:34:23 2022 -0700 ACPI: extlog: Handle multiple records If there is no user space consumer of extlog_mem trace records, then Linux properly handles multiple error records in an ELOG block extlog_print() print_extlog_rcd() __print_extlog_rcd() cper_estatus_print() apei_estatus_for_each_section() But the other code path hard codes looking for a single record to output a trace record. Fix by using the same apei_estatus_for_each_section() iterator to step over all records. Fixes: 2dfb7d51a61d ("trace, RAS: Add eMCA trace event interface") Signed-off-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit 43d2748394c3feb86c0c771466f5847e274fc043 Author: Ashish Kalra Date: Wed Oct 5 16:32:53 2022 +0000 ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() Change num_ghes from int to unsigned int, preventing an overflow and causing subsequent vmalloc() to fail. The overflow happens in ghes_estatus_pool_init() when calculating len during execution of the statement below as both multiplication operands here are signed int: len += (num_ghes * GHES_ESOURCE_PREALLOC_MAX_SIZE); The following call trace is observed because of this bug: [ 9.317108] swapper/0: vmalloc error: size 18446744071562596352, exceeds total pages, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=/,mems_allowed=0-1 [ 9.317131] Call Trace: [ 9.317134] [ 9.317137] dump_stack_lvl+0x49/0x5f [ 9.317145] dump_stack+0x10/0x12 [ 9.317146] warn_alloc.cold+0x7b/0xdf [ 9.317150] ? __device_attach+0x16a/0x1b0 [ 9.317155] __vmalloc_node_range+0x702/0x740 [ 9.317160] ? device_add+0x17f/0x920 [ 9.317164] ? dev_set_name+0x53/0x70 [ 9.317166] ? platform_device_add+0xf9/0x240 [ 9.317168] __vmalloc_node+0x49/0x50 [ 9.317170] ? ghes_estatus_pool_init+0x43/0xa0 [ 9.317176] vmalloc+0x21/0x30 [ 9.317177] ghes_estatus_pool_init+0x43/0xa0 [ 9.317179] acpi_hest_init+0x129/0x19c [ 9.317185] acpi_init+0x434/0x4a4 [ 9.317188] ? acpi_sleep_proc_init+0x2a/0x2a [ 9.317190] do_one_initcall+0x48/0x200 [ 9.317195] kernel_init_freeable+0x221/0x284 [ 9.317200] ? rest_init+0xe0/0xe0 [ 9.317204] kernel_init+0x1a/0x130 [ 9.317205] ret_from_fork+0x22/0x30 [ 9.317208] Signed-off-by: Ashish Kalra [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 83439a0f1ce6a592f95e41338320b5f01b98a356 Author: Bagas Sanjaya Date: Tue Oct 11 19:26:01 2022 +0700 Documentation: ACPI: Prune DSDT override documentation from index Commit d206cef03c4827 ("ACPI: docs: Drop useless DSDT override documentation") removes useless DSDT override documentation. However, the commit forgets to prune the documentation entry from table of contents of ACPI admin guide documentation, hence triggers Sphinx warning: Documentation/admin-guide/acpi/index.rst:8: WARNING: toctree contains reference to nonexisting document 'admin-guide/acpi/dsdt-override' Prune the entry to fix the warning. Fixes: d206cef03c4827 ("ACPI: docs: Drop useless DSDT override documentation") Signed-off-by: Bagas Sanjaya Signed-off-by: Rafael J. Wysocki commit c45fc916c2b2cc2a0587659c18d6ceef9b7299be Author: Conor Dooley Date: Fri Jul 29 12:11:17 2022 +0100 riscv: enable software resend of irqs The PLIC specification does not describe the interrupt pendings bits as read-write, only that they "can be read". To allow for retriggering of interrupts (and the use of the irq debugfs interface) enable HARDIRQS_SW_RESEND for RISC-V. Link: https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interrupt-pending-bits Signed-off-by: Conor Dooley Acked-by: Marc Zyngier Acked-by: Palmer Dabbelt Tested-by: Palmer Dabbelt # on QEMU Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20220729111116.259146-1-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 5a5294fbe0200d1327f0e089135dad77b45aa2ee Author: Palmer Dabbelt Date: Wed Sep 28 06:18:07 2022 -0700 RISC-V: Re-enable counter access from userspace These counters were part of the ISA when we froze the uABI, removing them breaks userspace. Link: https://lore.kernel.org/all/YxEhC%2FmDW1lFt36J@aurel32.net/ Fixes: e9991434596f ("RISC-V: Add perf platform driver based on SBI PMU extension") Tested-by: Conor Dooley Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220928131807.30386-1-palmer@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit a8616d2dc193b6becc36b5f3cfeaa9ac7a5762f9 Author: Jisheng Zhang Date: Sat Sep 24 15:07:37 2022 +0800 riscv: vdso: fix NULL deference in vdso_join_timens() when vfork Testing tools/testing/selftests/timens/vfork_exec.c got below kernel log: [ 6.838454] Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000000020 [ 6.842255] Oops [#1] [ 6.842871] Modules linked in: [ 6.844249] CPU: 1 PID: 64 Comm: vfork_exec Not tainted 6.0.0-rc3-rt15+ #8 [ 6.845861] Hardware name: riscv-virtio,qemu (DT) [ 6.848009] epc : vdso_join_timens+0xd2/0x110 [ 6.850097] ra : vdso_join_timens+0xd2/0x110 [ 6.851164] epc : ffffffff8000635c ra : ffffffff8000635c sp : ff6000000181fbf0 [ 6.852562] gp : ffffffff80cff648 tp : ff60000000fdb700 t0 : 3030303030303030 [ 6.853852] t1 : 0000000000000030 t2 : 3030303030303030 s0 : ff6000000181fc40 [ 6.854984] s1 : ff60000001e6c000 a0 : 0000000000000010 a1 : ffffffff8005654c [ 6.856221] a2 : 00000000ffffefff a3 : 0000000000000000 a4 : 0000000000000000 [ 6.858114] a5 : 0000000000000000 a6 : 0000000000000008 a7 : 0000000000000038 [ 6.859484] s2 : ff60000001e6c068 s3 : ff6000000108abb0 s4 : 0000000000000000 [ 6.860751] s5 : 0000000000001000 s6 : ffffffff8089dc40 s7 : ffffffff8089dc38 [ 6.862029] s8 : ffffffff8089dc30 s9 : ff60000000fdbe38 s10: 000000000000005e [ 6.863304] s11: ffffffff80cc3510 t3 : ffffffff80d1112f t4 : ffffffff80d1112f [ 6.864565] t5 : ffffffff80d11130 t6 : ff6000000181fa00 [ 6.865561] status: 0000000000000120 badaddr: 0000000000000020 cause: 000000000000000d [ 6.868046] [] timens_commit+0x38/0x11a [ 6.869089] [] timens_on_fork+0x72/0xb4 [ 6.870055] [] begin_new_exec+0x3c6/0x9f0 [ 6.871231] [] load_elf_binary+0x628/0x1214 [ 6.872304] [] bprm_execve+0x1f2/0x4e4 [ 6.873243] [] do_execveat_common+0x16e/0x1ee [ 6.874258] [] sys_execve+0x3c/0x48 [ 6.875162] [] ret_from_syscall+0x0/0x2 [ 6.877484] ---[ end trace 0000000000000000 ]--- This is because the mm->context.vdso_info is NULL in vfork case. From another side, mm->context.vdso_info either points to vdso info for RV64 or vdso info for compat, there's no need to bloat riscv's mm_context_t, we can handle the difference when setup the additional page for vdso. Signed-off-by: Jisheng Zhang Suggested-by: Palmer Dabbelt Fixes: 3092eb456375 ("riscv: compat: vdso: Add setup additional pages implementation") Link: https://lore.kernel.org/r/20220924070737.3048-1-jszhang@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 1a5a2cbd21e58a824688ae2120a3e47b3cd0f876 Merge: 6224db7881936 da29dbcda49d6 Author: Palmer Dabbelt Date: Thu Oct 13 11:06:57 2022 -0700 Merge patch series "Use composable cache instead of L2 cache" Zong Li says: Since composable cache may be L3 cache if private L2 cache exists, we should use its original name "composable cache" to prevent confusion. This patchset contains the modification which is related to ccache, such as DT binding and EDAC driver. * b4-shazam-merge: riscv: Add cache information in AUX vector soc: sifive: ccache: define the macro for the register shifts soc: sifive: ccache: use pr_fmt() to remove CCACHE: prefixes soc: sifive: ccache: reduce printing on init soc: sifive: ccache: determine the cache level from dts soc: sifive: ccache: Rename SiFive L2 cache to Composable cache. dt-bindings: sifive-ccache: change Sifive L2 cache to Composable cache Link: https://lore.kernel.org/r/20220913061817.22564-1-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit da29dbcda49d60f34055df19bd4783b889fc7dfc Author: Greentime Hu Date: Tue Sep 13 06:18:17 2022 +0000 riscv: Add cache information in AUX vector There are no standard CSR registers to provide cache information, the way for RISC-V is to get this information from DT. sysconf syscall could use them to get information of cache through AUX vector. The result of 'getconf -a|grep -i cache' as follows: LEVEL1_ICACHE_SIZE 32768 LEVEL1_ICACHE_ASSOC 2 LEVEL1_ICACHE_LINESIZE 64 LEVEL1_DCACHE_SIZE 32768 LEVEL1_DCACHE_ASSOC 4 LEVEL1_DCACHE_LINESIZE 64 LEVEL2_CACHE_SIZE 524288 LEVEL2_CACHE_ASSOC 8 LEVEL2_CACHE_LINESIZE 64 LEVEL3_CACHE_SIZE 4194304 LEVEL3_CACHE_ASSOC 16 LEVEL3_CACHE_LINESIZE 64 LEVEL4_CACHE_SIZE 0 LEVEL4_CACHE_ASSOC 0 LEVEL4_CACHE_LINESIZE 0 Signed-off-by: Greentime Hu Signed-off-by: Zong Li Suggested-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-8-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit afc7a5834f0de13aee46df62f09e479c1bbf7b9d Author: Zong Li Date: Tue Sep 13 06:18:16 2022 +0000 soc: sifive: ccache: define the macro for the register shifts Define the macro for the register shifts, it could make the code be more readable Signed-off-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-7-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit 696ab9bda22a770d079dc3a23bac9aaa553d98f4 Author: Ben Dooks Date: Tue Sep 13 06:18:15 2022 +0000 soc: sifive: ccache: use pr_fmt() to remove CCACHE: prefixes Use the pr_fmt() macro to prefix all the output with "CCACHE:" to avoid having to write it out each time, or make a large diff when the next change comes along. Signed-off-by: Ben Dooks Signed-off-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-6-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit 3fb787e5bad50687a65ded7f3bb805cab70dff59 Author: Ben Dooks Date: Tue Sep 13 06:18:14 2022 +0000 soc: sifive: ccache: reduce printing on init The driver prints out 6 lines on startup, which can easily be redcued to two lines without losing any information. Note, to make the types work better, uint64_t has been replaced with ULL to make the unsigned long long match the format in the print statement. Signed-off-by: Ben Dooks Signed-off-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-5-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit 95f196f3212bbc258611c22865aef12b98304e1d Author: Zong Li Date: Tue Sep 13 06:18:13 2022 +0000 soc: sifive: ccache: determine the cache level from dts Composable cache could be L2 or L3 cache, use 'cache-level' property of device node to determine the level. Signed-off-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-4-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit ca120a79cf5a3323172c82e77efd70ae10d120ef Author: Greentime Hu Date: Tue Sep 13 06:18:12 2022 +0000 soc: sifive: ccache: Rename SiFive L2 cache to Composable cache. Since composable cache may be L3 cache if there is a L2 cache, we should use its original name composable cache to prevent confusion. There are some new lines were generated due to adding the compatible "sifive,ccache0" into ID table and indent requirement. The sifive L2 has been renamed to sifive CCACHE, EDAC driver needs to apply the change as well. Signed-off-by: Greentime Hu Signed-off-by: Zong Li Co-developed-by: Zong Li Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220913061817.22564-3-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit 44dce4b084f83f41922ed8c2a2c7d148254848bb Author: Zong Li Date: Tue Sep 13 06:18:11 2022 +0000 dt-bindings: sifive-ccache: change Sifive L2 cache to Composable cache Since composable cache may be L3 cache if private L2 cache exists, we should use its original name Composable cache to prevent confusion. Signed-off-by: Zong Li Suggested-by: Conor Dooley Suggested-by: Ben Dooks Reviewed-by: Conor Dooley Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220913061817.22564-2-zong.li@sifive.com Signed-off-by: Palmer Dabbelt commit f2b220ef93ea34ff6ce48fec382689cf02099f39 Merge: 66ae04368efbe 877d95dcfd0a5 Author: Linus Torvalds Date: Thu Oct 13 10:58:32 2022 -0700 Merge tag 'docs-6.1-2' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "A handful of relatively simple documentation fixes, plus a set of patches catching the Chinese translation up with the front-page rework" * tag 'docs-6.1-2' of git://git.lwn.net/linux: Documentation: rtla: Correct command line example docs/zh_CN: add a man-pages link to zh_CN/index.rst docs/zh_CN: Rewrite the Chinese translation front page docs/zh_CN: add zh_CN/arch.rst docs/zh_CN: promote the title of zh_CN/process/index.rst docs/zh_CN: Update the translation of page_owner to 6.0-rc7 docs/zh_CN: Update the translation of ksm to 6.0-rc7 docs/howto: Replace abundoned URL of gmane.org Documentation: ubifs: Fix compression idiom Documentation/mm/page_owner.rst: delete frequently changing experimental data docs/zh_CN: Fix build warning docs: ftrace: Correct access mode commit 66ae04368efbe20eb8951c9a76158f99ce672f25 Merge: d6f04f26e2524 99df45c9e0a43 Author: Linus Torvalds Date: Thu Oct 13 10:51:01 2022 -0700 Merge tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, and wifi. Current release - regressions: - Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs", it may cause crashes when the qdisc is reconfigured - inet: ping: fix splat due to packet allocation refactoring in inet - tcp: clean up kernel listener's reqsk in inet_twsk_purge(), fix UAF due to races when per-netns hash table is used Current release - new code bugs: - eth: adin1110: check in netdev_event that netdev belongs to driver - fixes for PTR_ERR() vs NULL bugs in driver code, from Dan and co. Previous releases - regressions: - ipv4: handle attempt to delete multipath route when fib_info contains an nh reference, avoid oob access - wifi: fix handful of bugs in the new Multi-BSSID code - wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer, fix checksum offload - wifi: iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue (other cases) - wifi: mac80211: do not drop packets smaller than the LLC-SNAP header on fast-rx Previous releases - always broken: - ieee802154: don't warn zero-sized raw_sendmsg() - ipv6: ping: fix wrong checksum for large frames - mctp: prevent double key removal and unref - tcp/udp: fix memory leaks and races around IPV6_ADDRFORM - hv_netvsc: fix race between VF offering and VF association message Misc: - remove -Warray-bounds silencing in the drivers, compilers fixed" * tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (73 commits) sunhme: fix an IS_ERR() vs NULL check in probe net: marvell: prestera: fix a couple NULL vs IS_ERR() checks kcm: avoid potential race in kcm_tx_work tcp: Clean up kernel listener's reqsk in inet_twsk_purge() net: phy: micrel: Fixes FIELD_GET assertion openvswitch: add nf_ct_is_confirmed check before assigning the helper tcp: Fix data races around icsk->icsk_af_ops. ipv6: Fix data races around sk->sk_prot. tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM). tcp/udp: Fix memory leak in ipv6_renew_options(). mctp: prevent double key removal and unref selftests: netfilter: Fix nft_fib.sh for all.rp_filter=1 netfilter: rpfilter/fib: Populate flowic_l3mdev field selftests: netfilter: Test reverse path filtering net/mlx5: Make ASO poll CQ usable in atomic context tcp: cdg: allow tcp_cdg_release() to be called multiple times inet: ping: fix recent breakage ipv6: ping: fix wrong checksum for large frames net: ethernet: ti: am65-cpsw: set correct devlink flavour for unused ports ... commit d6f04f26e25242898959b1758432e4076fabc0c0 Merge: aa41478a57623 be8ddea9e75e6 Author: Linus Torvalds Date: Thu Oct 13 10:44:36 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: - Fix a regression in virtio pci on power - Add a reviewer for ifcvf * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vdpa/ifcvf: add reviewer virtio_pci: use irq to detect interrupt support commit aa41478a576238995c8d414ab9e0d35d1200c9fb Merge: 3d33e6dd5c231 0934ae9977c27 Author: Linus Torvalds Date: Thu Oct 13 10:36:57 2022 -0700 Merge tag 'trace-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Found that the synthetic events were using strlen/strscpy() on values that could have come from userspace, and that is bad. Consolidate the string logic of kprobe and eprobe and extend it to the synthetic events to safely process string addresses. - Clean up content of text dump in ftrace_bug() where the output does not make char reads into signed and sign extending the byte output. - Fix some kernel docs in the ring buffer code. * tag 'trace-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix reading strings from synthetic events tracing: Add "(fault)" name injection to kernel probes tracing: Move duplicate code of trace_kprobe/eprobe.c into header ring-buffer: Fix kernel-doc ftrace: Fix char print issue in print_ip_ins() commit 3d33e6dd5c23136fb57e688131ca58acd7963dcb Merge: 524d0c68826bc 099d387ebbcd7 Author: Linus Torvalds Date: Thu Oct 13 10:31:13 2022 -0700 Merge tag 'linux-watchdog-6.1-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - new driver for Exar/MaxLinear XR28V38x - support for exynosautov9 SoC - support for Renesas R-Car V5H (R8A779G0) and RZ/V2M (r9a09g011) SoC - support for imx93 - several other fixes and improvements * tag 'linux-watchdog-6.1-rc1' of git://www.linux-watchdog.org/linux-watchdog: (36 commits) watchdog: twl4030_wdt: add missing mod_devicetable.h include dt-bindings: watchdog: migrate mt7621 text bindings to YAML watchdog: sp5100_tco: Add "action" module parameter watchdog: imx93: add watchdog timer on imx93 watchdog: imx7ulp_wdt: init wdog when it was active watchdog: imx7ulp_wdt: Handle wdog reconfigure failure watchdog: imx7ulp_wdt: Fix RCS timeout issue watchdog: imx7ulp_wdt: Check CMD32EN in wdog init watchdog: imx7ulp: Add explict memory barrier for unlock sequence watchdog: imx7ulp: Move suspend/resume to noirq phase watchdog: rti-wdt:using the pm_runtime_resume_and_get to simplify the code dt-bindings: watchdog: rockchip: add rockchip,rk3128-wdt watchdog: s3c2410_wdt: support exynosautov9 watchdog dt-bindings: watchdog: add exynosautov9 compatible watchdog: npcm: Enable clock if provided watchdog: meson: keep running if already active watchdog: dt-bindings: atmel,at91sam9-wdt: convert to json-schema watchdog: armada_37xx_wdt: Fix .set_timeout callback watchdog: sa1100: make variable sa1100dog_driver static watchdog: w83977f_wdt: Fix comment typo ... commit 524d0c68826bc1adf9d1946e540eb4f7b16699a7 Merge: 66b834558537c 71cf0c1c4f9f8 Author: Linus Torvalds Date: Thu Oct 13 10:21:37 2022 -0700 Merge tag 'ceph-for-6.1-rc1' of https://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "A quiet round this time: several assorted filesystem fixes, the most noteworthy one being some additional wakeups in cap handling code, and a messenger cleanup" * tag 'ceph-for-6.1-rc1' of https://github.com/ceph/ceph-client: ceph: remove Sage's git tree from documentation ceph: fix incorrectly showing the .snap size for stat ceph: fail the open_by_handle_at() if the dentry is being unlinked ceph: increment i_version when doing a setattr with caps ceph: Use kcalloc for allocating multiple elements ceph: no need to wait for transition RDCACHE|RD -> RD ceph: fail the request if the peer MDS doesn't support getvxattr op ceph: wake up the waiters if any new caps comes libceph: drop last_piece flag from ceph_msg_data_cursor commit 66b834558537c623135241e1ea9ddf11b31596e4 Merge: 531d3b5f73112 b739a5bd9d9f1 Author: Linus Torvalds Date: Thu Oct 13 09:58:42 2022 -0700 Merge tag 'nfs-for-6.1-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "New Features: - Add NFSv4.2 xattr tracepoints - Replace xprtiod WQ in rpcrdma - Flexfiles cancels I/O on layout recall or revoke Bugfixes and Cleanups: - Directly use ida_alloc() / ida_free() - Don't open-code max_t() - Prefer using strscpy over strlcpy - Remove unused forward declarations - Always return layout states on flexfiles layout return - Have LISTXATTR treat NFS4ERR_NOXATTR as an empty reply instead of error - Allow more xprtrdma memory allocations to fail without triggering a reclaim - Various other xprtrdma clean ups - Fix rpc_killall_tasks() races" * tag 'nfs-for-6.1-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (27 commits) NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked SUNRPC: Add API to force the client to disconnect SUNRPC: Add a helper to allow pNFS drivers to selectively cancel RPC calls SUNRPC: Fix races with rpc_killall_tasks() xprtrdma: Fix uninitialized variable xprtrdma: Prevent memory allocations from driving a reclaim xprtrdma: Memory allocation should be allowed to fail during connect xprtrdma: MR-related memory allocation should be allowed to fail xprtrdma: Clean up synopsis of rpcrdma_regbuf_alloc() xprtrdma: Clean up synopsis of rpcrdma_req_create() svcrdma: Clean up RPCRDMA_DEF_GFP SUNRPC: Replace the use of the xprtiod WQ in rpcrdma NFSv4.2: Add a tracepoint for listxattr NFSv4.2: Add tracepoints for getxattr, setxattr, and removexattr NFSv4.2: Move TRACE_DEFINE_ENUM(NFS4_CONTENT_*) under CONFIG_NFS_V4_2 NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR nfs: remove nfs_wait_atomic_killable() and nfs_write_prepare() declaration NFSv4: remove nfs4_renewd_prepare_shutdown() declaration fs/nfs/pnfs_nfs.c: fix spelling typo and syntax error in comment NFSv4/pNFS: Always return layout stats on layout return for flexfiles ... commit 531d3b5f731123a1ea91887a84f99bb8cb64be8e Merge: a185a0995518a 2ad4b6f5e1179 Author: Linus Torvalds Date: Thu Oct 13 09:56:14 2022 -0700 Merge tag 'for-linus-6.1-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs update from Mike Marshall: "Change iterate to iterate_shared" * tag 'for-linus-6.1-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: Orangefs: change iterate to iterate_shared commit 877d95dcfd0a56102d4b97a9691115f5fb5e9ea3 Author: Pierre Gondois Date: Thu Oct 6 10:44:09 2022 +0200 Documentation: rtla: Correct command line example The '-t/-T' parameters seem to have been swapped: -t/--trace[=file]: save the stopped trace to [file|timerlat_trace.txt] -T/--thread us: stop trace if the thread latency is higher than the argument in us Swap them back. Signed-off-by: Pierre Gondois Acked-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20221006084409.3882542-1-pierre.gondois@arm.com Signed-off-by: Jonathan Corbet commit 99df45c9e0a43b1b88dab294265e2be4a040a441 Author: Dan Carpenter Date: Wed Oct 12 18:01:32 2022 +0300 sunhme: fix an IS_ERR() vs NULL check in probe The devm_request_region() function does not return error pointers, it returns NULL on error. Fixes: 914d9b2711dd ("sunhme: switch to devres") Signed-off-by: Dan Carpenter Reviewed-by: Sean Anderson Reviewed-by: Rolf Eike Beer Link: https://lore.kernel.org/r/Y0bWzJL8JknX8MUf@kili Signed-off-by: Jakub Kicinski commit 30e9672ac37f7b8b9e1379d25882798d8e76a96f Author: Dan Carpenter Date: Wed Oct 12 18:00:59 2022 +0300 net: marvell: prestera: fix a couple NULL vs IS_ERR() checks The __prestera_nexthop_group_create() function returns NULL on error and the prestera_nexthop_group_get() returns error pointers. Fix these two checks. Fixes: 0a23ae237171 ("net: marvell: prestera: Add router nexthops ABI") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Y0bWq+7DoKK465z8@kili Signed-off-by: Jakub Kicinski commit ec7eede369fe5b0d085ac51fdbb95184f87bfc6c Author: Eric Dumazet Date: Wed Oct 12 13:34:12 2022 +0000 kcm: avoid potential race in kcm_tx_work syzbot found that kcm_tx_work() could crash [1] in: /* Primarily for SOCK_SEQPACKET sockets */ if (likely(sk->sk_socket) && test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { <<*>> clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags); sk->sk_write_space(sk); } I think the reason is that another thread might concurrently run in kcm_release() and call sock_orphan(sk) while sk is not locked. kcm_tx_work() find sk->sk_socket being NULL. [1] BUG: KASAN: null-ptr-deref in instrument_atomic_write include/linux/instrumented.h:86 [inline] BUG: KASAN: null-ptr-deref in clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] BUG: KASAN: null-ptr-deref in kcm_tx_work+0xff/0x160 net/kcm/kcmsock.c:742 Write of size 8 at addr 0000000000000008 by task kworker/u4:3/53 CPU: 0 PID: 53 Comm: kworker/u4:3 Not tainted 5.19.0-rc3-next-20220621-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: kkcmd kcm_tx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 kasan_report+0xbe/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_write include/linux/instrumented.h:86 [inline] clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] kcm_tx_work+0xff/0x160 net/kcm/kcmsock.c:742 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Tom Herbert Link: https://lore.kernel.org/r/20221012133412.519394-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 740ea3c4a0b2e326b23d7cdf05472a0e92aa39bc Author: Kuniyuki Iwashima Date: Wed Oct 12 07:50:36 2022 -0700 tcp: Clean up kernel listener's reqsk in inet_twsk_purge() Eric Dumazet reported a use-after-free related to the per-netns ehash series. [0] When we create a TCP socket from userspace, the socket always holds a refcnt of the netns. This guarantees that a reqsk timer is always fired before netns dismantle. Each reqsk has a refcnt of its listener, so the listener is not freed before the reqsk, and the net is not freed before the listener as well. OTOH, when in-kernel users create a TCP socket, it might not hold a refcnt of its netns. Thus, a reqsk timer can be fired after the netns dismantle and access freed per-netns ehash. To avoid the use-after-free, we need to clean up TCP_NEW_SYN_RECV sockets in inet_twsk_purge() if the netns uses a per-netns ehash. [0]: https://lore.kernel.org/netdev/CANn89iLXMup0dRD_Ov79Xt8N9FM0XdhCHEN05sf3eLwxKweM6w@mail.gmail.com/ BUG: KASAN: use-after-free in tcp_or_dccp_get_hashinfo include/net/inet_hashtables.h:181 [inline] BUG: KASAN: use-after-free in reqsk_queue_unlink+0x320/0x350 net/ipv4/inet_connection_sock.c:913 Read of size 8 at addr ffff88807545bd80 by task syz-executor.2/8301 CPU: 1 PID: 8301 Comm: syz-executor.2 Not tainted 6.0.0-syzkaller-02757-gaf7d23f9d96a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 tcp_or_dccp_get_hashinfo include/net/inet_hashtables.h:181 [inline] reqsk_queue_unlink+0x320/0x350 net/ipv4/inet_connection_sock.c:913 inet_csk_reqsk_queue_drop net/ipv4/inet_connection_sock.c:927 [inline] inet_csk_reqsk_queue_drop_and_put net/ipv4/inet_connection_sock.c:939 [inline] reqsk_timer_handler+0x724/0x1160 net/ipv4/inet_connection_sock.c:1053 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d0/0x9c8 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107 Fixes: d1e5e6408b30 ("tcp: Introduce optional per-netns ehash.") Reported-by: syzbot Reported-by: Eric Dumazet Suggested-by: Eric Dumazet Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20221012145036.74960-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 93c128e709aec23b10f3a2f78a824080d4085318 Author: Jeff Layton Date: Wed Oct 12 14:42:54 2022 -0400 nfsd: ensure we always call fh_verify_error tracepoint This is a conditional tracepoint. Call it every time, not just when nfs_permission fails. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 917c362b5f8a6e31ff35719b1bacfc1b76a1fd2f Author: Frank Rowand Date: Wed Oct 12 17:05:48 2022 -0500 MAINTAINERS: of: collapse overlay entry into main device tree entry Pantelis has not been active in recent years so no need to maintain a separate entry for device tree overlays. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20221012220548.4163865-1-frowand.list@gmail.com Signed-off-by: Rob Herring commit 6224db7881936c8e1c3b352b5debbbbd8856911a Merge: 3cebf80e9a0d3 14057733109dc Author: Palmer Dabbelt Date: Thu Oct 13 08:46:31 2022 -0700 Merge patch series "Some style cleanups for recent extension additions" Heiko Stuebner says: As noted by some people, some parts of the recently added extensions (svpbmt, zicbom) + t-head errata could use some styling upgrades. So this series provides these. changes in v2: - add patch also converting cpufeature probe to BIT() - update commit message in patch1 (Conor) Heiko Stuebner (5): riscv: cleanup svpbmt cpufeature probing riscv: drop some idefs from CMO initialization riscv: use BIT() macros in t-head errata init riscv: use BIT() marco for cpufeature probing riscv: check for kernel config option in t-head memory types errata arch/riscv/errata/thead/errata.c | 14 ++++++----- arch/riscv/include/asm/cacheflush.h | 2 ++ arch/riscv/kernel/cpufeature.c | 39 ++++++++++++----------------- 3 files changed, 26 insertions(+), 29 deletions(-) Link: https://lore.kernel.org/r/20220905111027.2463297-1-heiko@sntech.de * b4-shazam-merge: riscv: check for kernel config option in t-head memory types errata riscv: use BIT() marco for cpufeature probing riscv: use BIT() macros in t-head errata init riscv: drop some idefs from CMO initialization riscv: cleanup svpbmt cpufeature probing Signed-off-by: Palmer Dabbelt commit 14057733109dcc83c35a6730f3b7112aac4d2b82 Author: Heiko Stuebner Date: Mon Sep 5 13:10:27 2022 +0200 riscv: check for kernel config option in t-head memory types errata The t-head variant of page-based memory types should also check first for the enabled kernel config option. Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head") Signed-off-by: Heiko Stuebner Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220905111027.2463297-6-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e283187c034cd80c1dd98ad732c73ce930a5efa4 Author: Heiko Stuebner Date: Mon Sep 5 13:10:26 2022 +0200 riscv: use BIT() marco for cpufeature probing Using the appropriate BIT macro makes the code better readable. Suggested-by: Conor Dooley Signed-off-by: Heiko Stuebner Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220905111027.2463297-5-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit 499590c084f13b6aca225e5766edeebd48437ee8 Author: Heiko Stuebner Date: Mon Sep 5 13:10:25 2022 +0200 riscv: use BIT() macros in t-head errata init Using the appropriate BIT macro makes the code better readable. Suggested-by: Conor Dooley Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20220905111027.2463297-4-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit f055268e3946555deb9bb80b2c8c9798c64dbc47 Author: Heiko Stuebner Date: Mon Sep 5 13:10:24 2022 +0200 riscv: drop some idefs from CMO initialization Wrapping things in #ifdefs makes the code harder to read while we also have IS_ENABLED() macros to do this in regular code and the extension detection is not _that_ runtime critical. So define a stub for riscv_noncoherent_supported() in the non-CONFIG_RISCV_DMA_NONCOHERENT case and move the code to us IS_ENABLED. Suggested-by: Conor Dooley Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20220905111027.2463297-3-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e47bddcb2ec531022a915f896f13586470b593d0 Author: Heiko Stuebner Date: Mon Sep 5 13:10:23 2022 +0200 riscv: cleanup svpbmt cpufeature probing For better readability (and compile time coverage) use IS_ENABLED instead of ifdef and drop the new unneeded switch statement. Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20220905111027.2463297-2-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e7b09357453a99e6f9e74c39e9ca1363c22c0b96 Merge: 0326074ff4652 6e44b9f375a31 Author: Andrii Nakryiko Date: Thu Oct 13 08:27:38 2022 -0700 Merge branch 'Allow bpf_user_ringbuf_drain() callbacks to return 1' David Vernet says: ==================== The bpf_user_ringbuf_drain() helper function allows a BPF program to specify a callback that is invoked when draining entries from a BPF_MAP_TYPE_USER_RINGBUF ring buffer map. The API is meant to allow the callback to return 0 if it wants to continue draining samples, and 1 if it's done draining. Unfortunately, bpf_user_ringbuf_drain() landed shortly after commit 1bfe26fb0827 ("bpf: Add verifier support for custom callback return range"), which changed the default behavior of callbacks to only support returning 0, and the corresponding necessary change to bpf_user_ringbuf_drain() callbacks was missed. This patch set fixes this oversight, and updates the user_ringbuf selftests to return 1 in a callback to catch future instances of regression. ==================== Signed-off-by: Andrii Nakryiko commit 6e44b9f375a3135fc4960d76a9ea6720625cad73 Author: David Vernet Date: Wed Oct 12 18:20:15 2022 -0500 selftests/bpf: Make bpf_user_ringbuf_drain() selftest callback return 1 In commit 1bfe26fb0827 ("bpf: Add verifier support for custom callback return range"), the verifier was updated to require callbacks to BPF helpers to explicitly specify the range of values that can be returned. bpf_user_ringbuf_drain() was merged after this in commit 205715673844 ("bpf: Add bpf_user_ringbuf_drain() helper"), and this change in default behavior was missed. This patch updates the BPF_MAP_TYPE_USER_RINGBUF selftests to also return 1 from a bpf_user_ringbuf_drain() callback so as to properly test this going forward. Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221012232015.1510043-3-void@manifault.com commit c92a7a52243871eb10e0ea2260685def47fb5094 Author: David Vernet Date: Wed Oct 12 18:20:14 2022 -0500 bpf: Allow bpf_user_ringbuf_drain() callbacks to return 1 The bpf_user_ringbuf_drain() helper function allows a BPF program to specify a callback that is invoked when draining entries from a BPF_MAP_TYPE_USER_RINGBUF ring buffer map. The API is meant to allow the callback to return 0 if it wants to continue draining samples, and 1 if it's done draining. Unfortunately, bpf_user_ringbuf_drain() landed shortly after commit 1bfe26fb0827 ("bpf: Add verifier support for custom callback return range"), which changed the default behavior of callbacks to only support returning 0. This patch corrects that oversight by allowing bpf_user_ringbuf_drain() callbacks to return 0 or 1. A follow-on patch will update the user_ringbuf selftests to also return 1 from a bpf_user_ringbuf_drain() callback to prevent this from regressing in the future. Fixes: 205715673844 ("bpf: Add bpf_user_ringbuf_drain() helper") Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20221012232015.1510043-2-void@manifault.com commit 3cebf80e9a0d3adcb174053be32c88a640b3344b Author: Fangrui Song Date: Sun Sep 18 02:29:34 2022 -0700 riscv: Pass -mno-relax only on lld < 15.0.0 lld since llvm:6611d58f5bbc ("[ELF] Relax R_RISCV_ALIGN"), which will be included in the 15.0.0 release, has implemented some RISC-V linker relaxation. -mno-relax is no longer needed in KBUILD_CFLAGS/KBUILD_AFLAGS to suppress R_RISCV_ALIGN which older lld can not handle: ld.lld: error: capability.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax but the .o is already compiled with -mno-relax Signed-off-by: Fangrui Song Link: https://lore.kernel.org/r/20220710071117.446112-1-maskray@google.com/ Link: https://lore.kernel.org/r/20220918092933.19943-1-palmer@rivosinc.com Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Tested-by: Nathan Chancellor Tested-by: Conor Dooley Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce Author: Enzo Matsumiya Date: Wed Oct 12 22:53:09 2022 -0500 cifs: use ALIGN() and round_up() macros Improve code readability by using existing macros: Replace hardcoded alignment computations (e.g. (len + 7) & ~0x7) by ALIGN()/IS_ALIGNED() macros. Also replace (DIV_ROUND_UP(len, 8) * 8) with ALIGN(len, 8), which, if not optimized by the compiler, has the overhead of a multiplication and a division. Do the same for roundup() by replacing it by round_up() (division-less version, but requires the multiple to be a power of 2, which is always the case for us). And remove some unnecessary checks where !IS_ALIGNED() would fit, but calling round_up() directly is fine as it's a no-op if the value is already aligned. Signed-off-by: Enzo Matsumiya Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit e4029e072673d8a694f660f551609dd4f9265088 Author: Ronnie Sahlberg Date: Wed Oct 12 06:13:03 2022 -0500 cifs: find and use the dentry for cached non-root directories also This allows us to use cached attributes for the entries in a cached directory for as long as a lease is held on the directory itself. Previously we have always allowed "used cached attributes for 1 second" but this extends this to the lifetime of the lease as well as making the caching safer. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit ebe98f1447bbccf8228335c62d86af02a0ed23f7 Author: Ronnie Sahlberg Date: Thu Oct 6 00:14:31 2022 -0500 cifs: enable caching of directories for which a lease is held This expands the directory caching to now cache an open handle for all directories (up to a maximum) and not just the root directory. In this patch, locking and refcounting is intended to work as so: The main function to get a reference to a cached handle is find_or_create_cached_dir() called from open_cached_dir() These functions are protected under the cfid_list_lock spin-lock to make sure we do not race creating new references for cached dirs with deletion of expired ones. An successful open_cached_dir() will take out 2 references to the cfid if this was the very first and successful call to open the directory and it acquired a lease from the server. One reference is for the lease and the other is for the cfid that we return. The is lease reference is tracked by cfid->has_lease. If the directory already has a handle with an active lease, then we just take out one new reference for the cfid and return it. It can happen that we have a thread that tries to open a cached directory where we have a cfid already but we do not, yet, have a working lease. In this case we will just return NULL, and this the caller will fall back to the case when no handle was available. In this model the total number of references we have on a cfid is 1 for while the handle is open and we have a lease, and one additional reference for each open instance of a cfid. Once we get a lease break (cached_dir_lease_break()) we remove the cfid from the list under the spinlock. This prevents any new threads to use it, and we also call smb2_cached_lease_break() via the work_queue in order to drop the reference we got for the lease (we drop it outside of the spin-lock.) Anytime a thread calls close_cached_dir() we also drop a reference to the cfid. When the last reference to the cfid is released smb2_close_cached_fid() will be invoked which will drop the reference ot the dentry we held for this cfid and it will also, if we the handle is open/has a lease also call SMB2_close() to close the handle on the server. Two events require special handling: invalidate_all_cached_dirs() this function is called from SMB2_tdis() and cifs_mark_open_files_invalid(). In both cases the tcon is either gone already or will be shortly so we do not need to actually close the handles. They will be dropped server side as part of the tcon dropping. But we have to be careful about a potential race with a concurrent lease break so we need to take out additional refences to avoid the cfid from being freed while we are still referencing it. free_cached_dirs() which is called from tconInfoFree(). This is called quite late in the umount process so there should no longer be any open handles or files and we can just free all the remaining data. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 9ee2afe5207b63b20426ee081f486d831bae871d Author: Paulo Alcantara Date: Thu Oct 6 13:04:05 2022 -0300 cifs: prevent copying past input buffer boundaries Prevent copying past @data buffer in smb2_validate_and_copy_iov() as the output buffer in @iov might be potentially bigger and thus copying more bytes than requested in @minbufsize. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 69ccafdd35cdffd72504bfed58dcaee5e73a88a7 Author: Paulo Alcantara Date: Tue Oct 4 15:10:09 2022 -0300 cifs: fix uninitialised var in smb2_compound_op() Fix uninitialised variable @idata when calling smb2_compound_op() with SMB2_OP_POSIX_QUERY_INFO. Reported-by: kernel test robot Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 76894f3e2f71177747b8b4763fb180e800279585 Author: Paulo Alcantara Date: Mon Oct 3 18:43:50 2022 -0300 cifs: improve symlink handling for smb2+ When creating inode for symlink, the client used to send below requests to fill it in: * create+query_info+close (STATUS_STOPPED_ON_SYMLINK) * create(+reparse_flag)+query_info+close (set file attrs) * create+ioctl(get_reparse)+close (query reparse tag) and then for every access to the symlink dentry, the ->link() method would send another: * create+ioctl(get_reparse)+close (parse symlink) So, in order to improve: (i) Get rid of unnecessary roundtrips and then resolve symlinks as follows: * create+query_info+close (STATUS_STOPPED_ON_SYMLINK + parse symlink + get reparse tag) * create(+reparse_flag)+query_info+close (set file attrs) (ii) Set the resolved symlink target directly in inode->i_link and use simple_get_link() for ->link() to simply return it. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 977bb6530807a9a8e7f29d7dfba5737135b50df6 Author: Steve French Date: Tue Oct 11 23:26:33 2022 -0500 smb3: clarify multichannel warning When server does not return network interfaces, clarify the message to indicate that "multichannel not available" not just that "empty network interface returned by server ..." Suggested-by: Tom Talpey Reviewed-by: Bharath SM Signed-off-by: Steve French commit 2f6f19c7aaad5005dc75298a413eb0243c5d312d Author: Ronnie Sahlberg Date: Wed Oct 12 09:12:07 2022 +1000 cifs: fix regression in very old smb1 mounts BZ: 215375 Fixes: 76a3c92ec9e0 ("cifs: remove support for NTLM and weaker authentication algorithms") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit be8ddea9e75e65b05837f6d51dc5774b866d0bcf Author: Michael S. Tsirkin Date: Wed Oct 12 00:49:23 2022 -0400 vdpa/ifcvf: add reviewer Zhu Lingshan has been writing and reviewing ifcvf patches for a while now, add as reviewer. Signed-off-by: Michael S. Tsirkin Acked-by: Zhu Lingshan Acked-by: Jason Wang commit 2145ab513e3b3f910bd4a93abbdfa74fc65dfea4 Author: Michael S. Tsirkin Date: Wed Oct 12 17:58:28 2022 -0400 virtio_pci: use irq to detect interrupt support commit 71491c54eafa ("virtio_pci: don't try to use intxif pin is zero") breaks virtio_pci on powerpc, when running as a qemu guest. vp_find_vqs() bails out because pci_dev->pin == 0. But pci_dev->irq is populated correctly, so vp_find_vqs_intx() would succeed if we called it - which is what the code used to do. This seems to happen because pci_dev->pin is not populated in pci_assign_irq(). A PCI core bug? Maybe. However Linus said: I really think that that is basically the only time you should use that 'pci_dev->pin' thing: it basically exists not for "does this device have an IRQ", but for "what is the routing of this irq on this device". and The correct way to check for "no irq" doesn't use NO_IRQ at all, it just does if (dev->irq) ... so let's just check irq and be done with it. Suggested-by: Linus Torvalds Reported-by: Michael Ellerman Fixes: 71491c54eafa ("virtio_pci: don't try to use intxif pin is zero") Cc: "Angus Chen" Signed-off-by: Michael S. Tsirkin Tested-by: Michael Ellerman Acked-by: Jason Wang Message-Id: <20221012220312.308522-1-mst@redhat.com> commit 6a43cd02ddbc597dc9a1f82c1e433f871a2f6f06 Author: Mauro Lima Date: Wed Oct 12 12:21:35 2022 -0300 spi: intel: Fix the offset to get the 64K erase opcode According to documentation, the 64K erase opcode is located in VSCC range [16:23] instead of [8:15]. Use the proper value to shift the mask over the correct range. Signed-off-by: Mauro Lima Reviewed-by: Mika Westerberg Link: https://lore.kernel.org/r/20221012152135.28353-1-mauro.lima@eclypsium.com Signed-off-by: Mark Brown commit c9a3545b1d771fb7b06a487796c40288c02c41c5 Author: Srinivasa Rao Mandadapu Date: Thu Oct 13 10:38:31 2022 +0530 ASoC: qcom: lpass-cpu: mark HDMI TX registers as volatile Update HDMI volatile registers list as DMA, Channel Selection registers, vbit control registers are being reflected by hardware DP port disconnection. This update is required to fix no display and no sound issue observed after reconnecting TAMA/SANWA DP cables. Once DP cable is unplugged, DMA control registers are being reset by hardware, however at second plugin, new dma control values does not updated to the dma hardware registers since new register value and cached values at the time of first plugin are same. Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver") Signed-off-by: Srinivasa Rao Mandadapu Reported-by: Kuogee Hsieh Link: https://lore.kernel.org/r/1665637711-13300-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit ee1aa2ae3eaa96e70229fa61deee87ef4528ffdf Author: Xiaolei Wang Date: Mon Oct 10 17:20:14 2022 +0800 ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK In wm8962 driver, the WM8962_ADDITIONAL_CONTROL_4 is used as a volatile register, but this register mixes a bunch of volatile status bits and a bunch of non-volatile control bits. The dapm widgets TEMP_HP and TEMP_SPK leverages the control bits in this register. After the wm8962 probe, the regmap will bet set to cache only mode, then a read error like below would be triggered when trying to read the initial power state of the dapm widgets TEMP_HP and TEMP_SPK. wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16 In order to fix this issue, we add event handler to actually power up/down these widgets. With this change, we also need to explicitly power off these widgets in the wm8962 probe since they are enabled by default. Signed-off-by: Xiaolei Wang Tested-by: Adam Ford Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221010092014.2229246-1-xiaolei.wang@windriver.com Signed-off-by: Mark Brown commit f2635d45a750182c6d5de15e2d6b059e0c302d7e Author: Derek Fang Date: Wed Oct 12 11:01:02 2022 +0800 ASoC: rt1019: Fix the TDM settings Complete the missing and correct the TDM settings. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20221012030102.4042-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit d94bf16e920047c9b4ea2b57f7b53b4ff5039d9f Author: Derek Fang Date: Wed Oct 12 11:13:20 2022 +0800 ASoC: rt5682s: Fix the TDM Tx settings Complete the missing and correct the TDM Tx settings. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20221012031320.6980-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit 4190e8bbcbc77a9c36724681801cedc5229e7fc2 Author: Maxime Ripard Date: Thu Sep 29 11:21:18 2022 +0200 drm/vc4: hdmi: Check the HSM rate at runtime_resume If our HSM clock has not been properly initialized, any register access will silently lock up the system. Let's check that this can't happen by adding a check for the rate before any register access, and error out otherwise. Link: https://lore.kernel.org/dri-devel/20220922145448.w3xfywkn5ecak2et@pengutronix.de/ Reviewed-by: Javier Martinez Canillas Tested-by: Stefan Wahren Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220929-rpi-pi3-unplugged-fixes-v1-2-cd22e962296c@cerno.tech commit ae71ab585c819f83aec84f91eb01157a90552ef2 Author: Maxime Ripard Date: Thu Sep 29 11:21:17 2022 +0200 drm/vc4: hdmi: Enforce the minimum rate at runtime_resume This is a revert of commit fd5894fa2413 ("drm/vc4: hdmi: Remove clock rate initialization"), with the code slightly moved around. It turns out that we can't downright remove that code from the driver, since the Pi0-3 and Pi4 are in different cases, and it only works for the Pi4. Indeed, the commit mentioned above was relying on the RaspberryPi firmware clocks driver to initialize the rate if it wasn't done by the firmware. However, the Pi0-3 are using the clk-bcm2835 clock driver that wasn't doing this initialization. We therefore end up with the clock not being assigned a rate, and the CPU stalling when trying to access a register. We can't move that initialization in the clk-bcm2835 driver, since the HSM clock we depend on is actually part of the HDMI power domain, so any rate setup is only valid when the power domain is enabled. Thus, we reinstated the minimum rate setup at runtime_suspend, which should address both issues. Link: https://lore.kernel.org/dri-devel/20220922145448.w3xfywkn5ecak2et@pengutronix.de/ Fixes: fd5894fa2413 ("drm/vc4: hdmi: Remove clock rate initialization") Reported-by: Marc Kleine-Budde Reviewed-by: Javier Martinez Canillas Tested-by: Stefan Wahren Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220929-rpi-pi3-unplugged-fixes-v1-1-cd22e962296c@cerno.tech commit d1c0b7de4dfa5505cf7a1d6220aa72aace4435d0 Author: Maxime Ripard Date: Fri Sep 2 16:41:11 2022 +0200 drm/vc4: Add module dependency on hdmi-codec The VC4 HDMI controller driver relies on the HDMI codec ASoC driver. In order to set it up properly, in vc4_hdmi_audio_init(), our HDMI driver will register a device matching the HDMI codec driver, and then register an ASoC card using that codec. However, if vc4 is compiled as a module, chances are that the hdmi-codec driver will be too. In such a case, the module loader will have a very narrow window to load the module between the device registration and the card registration. If it fails to load the module in time, the card registration will fail with EPROBE_DEFER, and we'll abort the audio initialisation, unregistering the HDMI codec device in the process. The next time the bind callback will be run, it's likely that we end up missing that window again, effectively preventing vc4 to probe entirely. In order to prevent this, we can create a soft dependency of the vc4 driver on the HDMI codec one so that we're sure the HDMI codec will be loaded before the VC4 module is, and thus we'll never end up in the previous situation. Fixes: 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec") Reviewed-by: Javier Martinez Canillas Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220902144111.3424560-1-maxime@cerno.tech commit 90d5ce82e143b42b2fdfb95401a89f86b71cedb7 Author: Nicholas Piggin Date: Thu Oct 13 17:31:31 2022 +1000 powerpc/pseries: Fix CONFIG_DTL=n build The recently moved dtl code must be compiled-in if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y even if CONFIG_DTL=n. Fixes: 6ba5aa541aaa0 ("powerpc/pseries: Move dtl scanning and steal time accounting to pseries platform") Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013073131.1485742-1-npiggin@gmail.com commit a4cb3651a174366cc85a677da9e3681fbe97fdae Author: Nicholas Piggin Date: Thu Oct 13 16:44:18 2022 +1000 powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context It's possible for an interrupt returning to an irqs-disabled context to lose a pending soft-masked irq because it branches to part of the exit code for irqs-enabled contexts, which is meant to clear only the PACA_IRQS_HARD_DIS flag from PACAIRQHAPPENED by zeroing the byte. This just looks like a simple thinko from a recent commit (if there was no hard mask pending, there would be no reason to clear it anyway). This also adds comment to the code that actually does need to clear the flag. Fixes: e485f6c751e0a ("powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending") Reported-by: Sachin Sant Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221013064418.1311104-1-npiggin@gmail.com commit ac85bc717cb5af334563c3622afd8fe543ca5fd5 Merge: fa182ea26ff09 e7ad651c31c5e Author: Paolo Abeni Date: Thu Oct 13 13:19:41 2022 +0200 Merge tag 'wireless-2022-10-13' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== More wireless fixes for 6.1 This has only the fixes for the scan parsing issues. * tag 'wireless-2022-10-13' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: cfg80211: update hidden BSSes to avoid WARN_ON wifi: mac80211: fix crash in beacon protection for P2P-device wifi: mac80211_hwsim: avoid mac80211 warning on bad rate wifi: cfg80211: avoid nontransmitted BSS list corruption wifi: cfg80211: fix BSS refcounting bugs wifi: cfg80211: ensure length byte is present before access wifi: mac80211: fix MBSSID parsing use-after-free wifi: cfg80211/mac80211: reject bad MBSSID elements wifi: cfg80211: fix u8 overflow in cfg80211_update_notlisted_nontrans() ==================== Link: https://lore.kernel.org/r/20221013100522.46346-1-johannes@sipsolutions.net Signed-off-by: Paolo Abeni commit 05c2224d4b049406b0545a10be05280ff4b8ba0a Author: Gavin Shan Date: Thu Oct 13 14:30:20 2022 +0800 KVM: selftests: Fix number of pages for memory slot in memslot_modification_stress_test It's required by vm_userspace_mem_region_add() that memory size should be aligned to host page size. However, one guest page is provided by memslot_modification_stress_test. It triggers failure in the scenario of 64KB-page-size-host and 4KB-page-size-guest, as the following messages indicate. # ./memslot_modification_stress_test Testing guest mode: PA-bits:40, VA-bits:48, 4K pages guest physical test memory: [0xffbfff0000, 0xffffff0000) Finished creating vCPUs Started all vCPUs ==== Test Assertion Failure ==== lib/kvm_util.c:824: vm_adjust_num_guest_pages(vm->mode, npages) == npages pid=5712 tid=5712 errno=0 - Success 1 0x0000000000404eeb: vm_userspace_mem_region_add at kvm_util.c:822 2 0x0000000000401a5b: add_remove_memslot at memslot_modification_stress_test.c:82 3 (inlined by) run_test at memslot_modification_stress_test.c:110 4 0x0000000000402417: for_each_guest_mode at guest_modes.c:100 5 0x00000000004016a7: main at memslot_modification_stress_test.c:187 6 0x0000ffffb8cd4383: ?? ??:0 7 0x0000000000401827: _start at :? Number of guest pages is not compatible with the host. Try npages=16 Fix the issue by providing 16 guest pages to the memory slot for this particular combination of 64KB-page-size-host and 4KB-page-size-guest on aarch64. Fixes: ef4c9f4f65462 ("KVM: selftests: Fix 32-bit truncation of vm_get_max_gfn()") Signed-off-by: Gavin Shan Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221013063020.201856-1-gshan@redhat.com commit e7ad651c31c5e1289323e6c680be6e582a593b26 Merge: abf93f3694192 c90b93b5b7828 Author: Johannes Berg Date: Thu Oct 13 11:59:16 2022 +0200 Merge branch 'cve-fixes-2022-10-13' Pull in the fixes for various scan parsing bugs found by Sönke Huster by fuzzing. commit f2913d006fcdb61719635e093d1b5dd0dafecac7 Author: Palmer Dabbelt Date: Tue Sep 20 13:00:37 2022 -0700 RISC-V: Avoid dereferening NULL regs in die() I don't think we can actually die() without a regs pointer, but the compiler was warning about a NULL check after a dereference. It seems prudent to just avoid the possibly-NULL dereference, given that when die()ing the system is already toast so who knows how we got there. Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220920200037.6727-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit ef6e06b2ef87077104d1145a0fd452ff8dbbc4b7 Author: Ira Weiny Date: Wed Oct 5 21:05:55 2022 -0700 highmem: fix kmap_to_page() for kmap_local_page() addresses kmap_to_page() is used to get the page for a virtual address which may be kmap'ed. Unfortunately, kmap_local_page() stores mappings in a thread local array separate from kmap(). These mappings were not checked by the call. Check the kmap_local_page() mappings and return the page if found. Because it is intended to remove kmap_to_page() add a warn on once to the kmap checks to flag potential issues early. NOTE Due to 32bit x86 use of kmap local in iomap atmoic, KMAP_LOCAL does not require HIGHMEM to be set. Therefore the support calls required a new KMAP_LOCAL section to fix 0day build errors. [akpm@linux-foundation.org: fix warning] Link: https://lkml.kernel.org/r/20221006040555.1502679-1-ira.weiny@intel.com Signed-off-by: Ira Weiny Reported-by: Al Viro Reported-by: kernel test robot Cc: "Fabio M. De Francesco" Cc: Thomas Gleixner Cc: Christoph Hellwig Signed-off-by: Andrew Morton commit 15cd90049d595e592d8860ee15a3f23491d54d17 Author: Yafang Shao Date: Thu Oct 6 10:15:40 2022 +0000 mm/page_alloc: fix incorrect PGFREE and PGALLOC for high-order page PGFREE and PGALLOC represent the number of freed and allocated pages. So the page order must be considered. Link: https://lkml.kernel.org/r/20221006101540.40686-1-laoar.shao@gmail.com Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") Signed-off-by: Yafang Shao Acked-by: Mel Gorman Reviewed-by: Miaohe Lin Signed-off-by: Andrew Morton commit 26c92d37d3dc484157bdb4eb7d29991c017b168b Author: Peter Xu Date: Tue Oct 4 15:34:00 2022 -0400 mm/selftest: uffd: explain the write missing fault check It's not obvious why we had a write check for each of the missing messages, especially when it should be a locking op. Add a rich comment for that, and also try to explain its good side and limitations, so that if someone hit it again for either a bug or a different glibc impl there'll be some clue to start with. Link: https://lkml.kernel.org/r/20221004193400.110155-4-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit f9bf6c03eca1077cae8de0e6d86427656fa42a9b Author: Peter Xu Date: Tue Oct 4 15:33:59 2022 -0400 mm/hugetlb: use hugetlb_pte_stable in migration race check After hugetlb_pte_stable() introduced, we can also rewrite the migration race condition against page allocation to use the new helper too. Link: https://lkml.kernel.org/r/20221004193400.110155-3-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 2ea7ff1e39cbe3753d3c649beb70f2cf861dca75 Author: Peter Xu Date: Tue Oct 4 15:33:58 2022 -0400 mm/hugetlb: fix race condition of uffd missing/minor handling Patch series "mm/hugetlb: Fix selftest failures with write check", v3. Currently akpm mm-unstable fails with uffd hugetlb private mapping test randomly on a write check. The initial bisection of that points to the recent pmd unshare series, but it turns out there's no direction relationship with the series but only some timing change caused the race to start trigger. The race should be fixed in patch 1. Patch 2 is a trivial cleanup on the similar race with hugetlb migrations, patch 3 comment on the write check so when anyone read it again it'll be clear why it's there. This patch (of 3): After the recent rework patchset of hugetlb locking on pmd sharing, kselftest for userfaultfd sometimes fails on hugetlb private tests with unexpected write fault checks. It turns out there's nothing wrong within the locking series regarding this matter, but it could have changed the timing of threads so it can trigger an old bug. The real bug is when we call hugetlb_no_page() we're not with the pgtable lock. It means we're reading the pte values lockless. It's perfectly fine in most cases because before we do normal page allocations we'll take the lock and check pte_same() again. However before that, there are actually two paths on userfaultfd missing/minor handling that may directly move on with the fault process without checking the pte values. It means for these two paths we may be generating an uffd message based on an unstable pte, while an unstable pte can legally be anything as long as the modifier holds the pgtable lock. One example, which is also what happened in the failing kselftest and caused the test failure, is that for private mappings wr-protection changes can happen on one page. While hugetlb_change_protection() generally requires pte being cleared before being changed, then there can be a race condition like: thread 1 thread 2 -------- -------- UFFDIO_WRITEPROTECT hugetlb_fault hugetlb_change_protection pgtable_lock() huge_ptep_modify_prot_start pte==NULL hugetlb_no_page generate uffd missing event even if page existed!! huge_ptep_modify_prot_commit pgtable_unlock() Fix this by rechecking the pte after pgtable lock for both userfaultfd missing & minor fault paths. This bug should have been around starting from uffd hugetlb introduced, so attaching a Fixes to the commit. Also attach another Fixes to the minor support commit for easier tracking. Note that userfaultfd is actually fine with false positives (e.g. caused by pte changed), but not wrong logical events (e.g. caused by reading a pte during changing). The latter can confuse the userspace, so the strictness is very much preferred. E.g., MISSING event should never happen on the page after UFFDIO_COPY has correctly installed the page and returned. Link: https://lkml.kernel.org/r/20221004193400.110155-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20221004193400.110155-2-peterx@redhat.com Fixes: 1a1aad8a9b7b ("userfaultfd: hugetlbfs: add userfaultfd hugetlb hook") Fixes: 7677f7fd8be7 ("userfaultfd: add minor fault registration mode") Signed-off-by: Peter Xu Co-developed-by: Mike Kravetz Reviewed-by: Mike Kravetz Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: Nadav Amit Cc: David Hildenbrand Cc: Mike Rapoport Signed-off-by: Andrew Morton commit 94541bc3fbde45bbd40e7989995246b22732679a Author: Brian Geffon Date: Mon Oct 3 10:48:32 2022 -0400 zram: always expose rw_page Currently zram will adjust its fops to a version which does not contain rw_page when a backing device has been assigned. This is done to prevent upper layers from assuming a synchronous operation when a page may have been written back. This forces every operation through bio which has overhead associated with bio_alloc/frees. The code can be simplified to always expose an rw_page method and only in the rare event that a page is written back we instead will return -EOPNOTSUPP forcing the upper layer to fallback to bio. Link: https://lkml.kernel.org/r/20221003144832.2906610-1-bgeffon@google.com Signed-off-by: Brian Geffon Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Cc: Rom Lemarchand Cc: Suleiman Souhlal Signed-off-by: Andrew Morton commit 14c2ac36811b82479b1138383b2c9ff1ab6ba47d Author: Qi Zheng Date: Thu Sep 29 19:23:18 2022 +0800 LoongArch: update local TLB if PTE entry exists Currently, the implementation of update_mmu_tlb() is empty if __HAVE_ARCH_UPDATE_MMU_TLB is not defined. Then if two threads concurrently fault at the same page, the second thread that did not win the race will give up and do nothing. In the LoongArch architecture, this second thread will trigger another fault, and only updates its local TLB. Instead of triggering another fault, it's better to implement update_mmu_tlb() to directly update the local TLB of the second thread. Just do it. Link: https://lkml.kernel.org/r/20220929112318.32393-3-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Suggested-by: Bibo Mao Acked-by: Huacai Chen Cc: Chris Zankel Cc: David Hildenbrand Cc: Max Filippov Cc: Muchun Song Signed-off-by: Andrew Morton commit bce8cb3c04dc01d21b6b17baf1cb6c277e7e6848 Author: Qi Zheng Date: Thu Sep 29 19:23:17 2022 +0800 mm: use update_mmu_tlb() on the second thread As message in commit 7df676974359 ("mm/memory.c: Update local TLB if PTE entry exists") said, we should update local TLB only on the second thread. So in the do_anonymous_page() here, we should use update_mmu_tlb() instead of update_mmu_cache() on the second thread. As David pointed out, this is a performance improvement, not a correctness fix. Link: https://lkml.kernel.org/r/20220929112318.32393-2-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: David Hildenbrand Cc: Bibo Mao Cc: Chris Zankel Cc: Huacai Chen Cc: Max Filippov Signed-off-by: Andrew Morton commit d6e5040bd8e53371fafd7e0c7c63b090b3a675db Author: Andrey Konovalov Date: Mon Sep 26 20:08:47 2022 +0200 kasan: fix array-bounds warnings in tests GCC's -Warray-bounds option detects out-of-bounds accesses to statically-sized allocations in krealloc out-of-bounds tests. Use OPTIMIZER_HIDE_VAR to suppress the warning. Also change kmalloc_memmove_invalid_size to use OPTIMIZER_HIDE_VAR instead of a volatile variable. Link: https://lkml.kernel.org/r/e94399242d32e00bba6fd0d9ec4c897f188128e8.1664215688.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reported-by: kernel test robot Reviewed-by: Kees Cook Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit ad4c365221b0f92f9c24a203119f2bade30c970e Author: Alistair Popple Date: Wed Sep 28 22:01:22 2022 +1000 hmm-tests: add test for migrate_device_range() Link: https://lkml.kernel.org/r/a73cf109de0224cfd118d22be58ddebac3ae2897.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Cc: Jason Gunthorpe Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Sierra Cc: Felix Kuehling Cc: Alex Deucher Cc: Ben Skeggs Cc: Christian König Cc: Dan Williams Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Lyude Paul Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit 249881232e1471d28b68f9a3829acc14d150cf5d Author: Alistair Popple Date: Wed Sep 28 22:01:21 2022 +1000 nouveau/dmem: evict device private memory during release When the module is unloaded or a GPU is unbound from the module it is possible for device private pages to still be mapped in currently running processes. This can lead to a hangs and RCU stall warnings when unbinding the device as memunmap_pages() will wait in an uninterruptible state until all device pages have been freed which may never happen. Fix this by migrating device mappings back to normal CPU memory prior to freeing the GPU memory chunks and associated device private pages. Link: https://lkml.kernel.org/r/66277601fb8fda9af408b33da9887192bf895bda.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Cc: Lyude Paul Cc: Ben Skeggs Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Deucher Cc: Alex Sierra Cc: Christian König Cc: Dan Williams Cc: David Hildenbrand Cc: Felix Kuehling Cc: "Huang, Ying" Cc: Jason Gunthorpe Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit d9b719394a1147614351961ac454589111c76e76 Author: Alistair Popple Date: Wed Sep 28 22:01:20 2022 +1000 nouveau/dmem: refactor nouveau_dmem_fault_copy_one() nouveau_dmem_fault_copy_one() is used during handling of CPU faults via the migrate_to_ram() callback and is used to copy data from GPU to CPU memory. It is currently specific to fault handling, however a future patch implementing eviction of data during teardown needs similar functionality. Refactor out the core functionality so that it is not specific to fault handling. Link: https://lkml.kernel.org/r/20573d7b4e641a78fde9935f948e64e71c9e709e.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Reviewed-by: Lyude Paul Cc: Ben Skeggs Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Deucher Cc: Alex Sierra Cc: Christian König Cc: Dan Williams Cc: David Hildenbrand Cc: Felix Kuehling Cc: "Huang, Ying" Cc: Jason Gunthorpe Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit e778406b40dbb1342a1888cd751ca9d2982a12e2 Author: Alistair Popple Date: Wed Sep 28 22:01:19 2022 +1000 mm/migrate_device.c: add migrate_device_range() Device drivers can use the migrate_vma family of functions to migrate existing private anonymous mappings to device private pages. These pages are backed by memory on the device with drivers being responsible for copying data to and from device memory. Device private pages are freed via the pgmap->page_free() callback when they are unmapped and their refcount drops to zero. Alternatively they may be freed indirectly via migration back to CPU memory in response to a pgmap->migrate_to_ram() callback called whenever the CPU accesses an address mapped to a device private page. In other words drivers cannot control the lifetime of data allocated on the devices and must wait until these pages are freed from userspace. This causes issues when memory needs to reclaimed on the device, either because the device is going away due to a ->release() callback or because another user needs to use the memory. Drivers could use the existing migrate_vma functions to migrate data off the device. However this would require them to track the mappings of each page which is both complicated and not always possible. Instead drivers need to be able to migrate device pages directly so they can free up device memory. To allow that this patch introduces the migrate_device family of functions which are functionally similar to migrate_vma but which skips the initial lookup based on mapping. Link: https://lkml.kernel.org/r/868116aab70b0c8ee467d62498bb2cf0ef907295.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Cc: "Huang, Ying" Cc: Zi Yan Cc: Matthew Wilcox Cc: Yang Shi Cc: David Hildenbrand Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Deucher Cc: Alex Sierra Cc: Ben Skeggs Cc: Christian König Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Lyude Paul Cc: Michael Ellerman Signed-off-by: Andrew Morton commit 241f68859656836ae3e85179cc224cc4c5e4e6a7 Author: Alistair Popple Date: Wed Sep 28 22:01:18 2022 +1000 mm/migrate_device.c: refactor migrate_vma and migrate_deivce_coherent_page() migrate_device_coherent_page() reuses the existing migrate_vma family of functions to migrate a specific page without providing a valid mapping or vma. This looks a bit odd because it means we are calling migrate_vma_*() without setting a valid vma, however it was considered acceptable at the time because the details were internal to migrate_device.c and there was only a single user. One of the reasons the details could be kept internal was that this was strictly for migrating device coherent memory. Such memory can be copied directly by the CPU without intervention from a driver. However this isn't true for device private memory, and a future change requires similar functionality for device private memory. So refactor the code into something more sensible for migrating device memory without a vma. Link: https://lkml.kernel.org/r/c7b2ff84e9b33d022cf4a40f87d051f281a16d8f.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Cc: "Huang, Ying" Cc: Zi Yan Cc: Matthew Wilcox Cc: Yang Shi Cc: David Hildenbrand Cc: Ralph Campbell Cc: John Hubbard Cc: Alex Deucher Cc: Alex Sierra Cc: Ben Skeggs Cc: Christian König Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Lyude Paul Cc: Michael Ellerman Signed-off-by: Andrew Morton commit 0dc45ca1ce18900572282c4f054bbe78351cb6a7 Author: Alistair Popple Date: Wed Sep 28 22:01:17 2022 +1000 mm/memremap.c: take a pgmap reference on page allocation ZONE_DEVICE pages have a struct dev_pagemap which is allocated by a driver. When the struct page is first allocated by the kernel in memremap_pages() a reference is taken on the associated pagemap to ensure it is not freed prior to the pages being freed. Prior to 27674ef6c73f ("mm: remove the extra ZONE_DEVICE struct page refcount") pages were considered free and returned to the driver when the reference count dropped to one. However the pagemap reference was not dropped until the page reference count hit zero. This would occur as part of the final put_page() in memunmap_pages() which would wait for all pages to be freed prior to returning. When the extra refcount was removed the pagemap reference was no longer being dropped in put_page(). Instead memunmap_pages() was changed to explicitly drop the pagemap references. This means that memunmap_pages() can complete even though pages are still mapped by the kernel which can lead to kernel crashes, particularly if a driver frees the pagemap. To fix this drivers should take a pagemap reference when allocating the page. This reference can then be returned when the page is freed. Link: https://lkml.kernel.org/r/12d155ec727935ebfbb4d639a03ab374917ea51b.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Fixes: 27674ef6c73f ("mm: remove the extra ZONE_DEVICE struct page refcount") Cc: Jason Gunthorpe Cc: Felix Kuehling Cc: Alex Deucher Cc: Christian König Cc: Ben Skeggs Cc: Lyude Paul Cc: Ralph Campbell Cc: Alex Sierra Cc: John Hubbard Cc: Dan Williams Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit ef233450898f8893dafa193a9f3211fa077a3d05 Author: Alistair Popple Date: Wed Sep 28 22:01:16 2022 +1000 mm: free device private pages have zero refcount Since 27674ef6c73f ("mm: remove the extra ZONE_DEVICE struct page refcount") device private pages have no longer had an extra reference count when the page is in use. However before handing them back to the owning device driver we add an extra reference count such that free pages have a reference count of one. This makes it difficult to tell if a page is free or not because both free and in use pages will have a non-zero refcount. Instead we should return pages to the drivers page allocator with a zero reference count. Kernel code can then safely use kernel functions such as get_page_unless_zero(). Link: https://lkml.kernel.org/r/cf70cf6f8c0bdb8aaebdbfb0d790aea4c683c3c6.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Acked-by: Felix Kuehling Cc: Jason Gunthorpe Cc: Michael Ellerman Cc: Alex Deucher Cc: Christian König Cc: Ben Skeggs Cc: Lyude Paul Cc: Ralph Campbell Cc: Alex Sierra Cc: John Hubbard Cc: Dan Williams Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Matthew Wilcox Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit 16ce101db85db694a91380aa4c89b25530871d33 Author: Alistair Popple Date: Wed Sep 28 22:01:15 2022 +1000 mm/memory.c: fix race when faulting a device private page Patch series "Fix several device private page reference counting issues", v2 This series aims to fix a number of page reference counting issues in drivers dealing with device private ZONE_DEVICE pages. These result in use-after-free type bugs, either from accessing a struct page which no longer exists because it has been removed or accessing fields within the struct page which are no longer valid because the page has been freed. During normal usage it is unlikely these will cause any problems. However without these fixes it is possible to crash the kernel from userspace. These crashes can be triggered either by unloading the kernel module or unbinding the device from the driver prior to a userspace task exiting. In modules such as Nouveau it is also possible to trigger some of these issues by explicitly closing the device file-descriptor prior to the task exiting and then accessing device private memory. This involves some minor changes to both PowerPC and AMD GPU code. Unfortunately I lack hardware to test either of those so any help there would be appreciated. The changes mimic what is done in for both Nouveau and hmm-tests though so I doubt they will cause problems. This patch (of 8): When the CPU tries to access a device private page the migrate_to_ram() callback associated with the pgmap for the page is called. However no reference is taken on the faulting page. Therefore a concurrent migration of the device private page can free the page and possibly the underlying pgmap. This results in a race which can crash the kernel due to the migrate_to_ram() function pointer becoming invalid. It also means drivers can't reliably read the zone_device_data field because the page may have been freed with memunmap_pages(). Close the race by getting a reference on the page while holding the ptl to ensure it has not been freed. Unfortunately the elevated reference count will cause the migration required to handle the fault to fail. To avoid this failure pass the faulting page into the migrate_vma functions so that if an elevated reference count is found it can be checked to see if it's expected or not. [mpe@ellerman.id.au: fix build] Link: https://lkml.kernel.org/r/87fsgbf3gh.fsf@mpe.ellerman.id.au Link: https://lkml.kernel.org/r/cover.60659b549d8509ddecafad4f498ee7f03bb23c69.1664366292.git-series.apopple@nvidia.com Link: https://lkml.kernel.org/r/d3e813178a59e565e8d78d9b9a4e2562f6494f90.1664366292.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Acked-by: Felix Kuehling Cc: Jason Gunthorpe Cc: John Hubbard Cc: Ralph Campbell Cc: Michael Ellerman Cc: Lyude Paul Cc: Alex Deucher Cc: Alex Sierra Cc: Ben Skeggs Cc: Christian König Cc: Dan Williams Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Matthew Wilcox Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton commit ab63f63f3885d492e62da55304b0483a2a9e6a7d Author: Xin Hao Date: Tue Sep 27 08:19:46 2022 +0800 mm/damon: use damon_sz_region() in appropriate place In many places we can use damon_sz_region() to instead of "r->ar.end - r->ar.start". Link: https://lkml.kernel.org/r/20220927001946.85375-2-xhao@linux.alibaba.com Signed-off-by: Xin Hao Suggested-by: SeongJae Park Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 652e04464d3944226052c827bdaaf5113b072870 Author: Xin Hao Date: Tue Sep 27 08:19:45 2022 +0800 mm/damon: move sz_damon_region to damon_sz_region Rename sz_damon_region() to damon_sz_region(), and move it to "include/linux/damon.h", because in many places, we can to use this func. Link: https://lkml.kernel.org/r/20220927001946.85375-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Suggested-by: SeongJae Park Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit ea091fa53680030881b56520d731e36d3ff6cdd5 Author: Xiaoke Wang Date: Fri Mar 4 17:12:15 2022 +0800 lib/test_meminit: add checks for the allocation functions alloc_pages(), kmalloc() and vmalloc() are all memory allocation functions which can return NULL when some internal memory failures happen. So it is better to check the return of them to catch the failure in time for better test them. Link: https://lkml.kernel.org/r/tencent_D44A49FFB420EDCCBFB9221C8D14DFE12908@qq.com Signed-off-by: Xiaoke Wang Reviewed-by: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit ac801e7e252c5588325e3c983c7d4167fc68c024 Author: Alexander Potapenko Date: Mon Sep 5 14:24:27 2022 +0200 kmsan: unpoison @tlb in arch_tlb_gather_mmu() This is an optimization to reduce stackdepot pressure. struct mmu_gather contains 7 1-bit fields packed into a 32-bit unsigned int value. The remaining 25 bits remain uninitialized and are never used, but KMSAN updates the origin for them in zap_pXX_range() in mm/memory.c, thus creating very long origin chains. This is technically correct, but consumes too much memory. Unpoisoning the whole structure will prevent creating such chains. Link: https://lkml.kernel.org/r/20220905122452.2258262-20-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Liu Shixin Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4fa0e3ff217f775cb58d2d6d51820ec519243fb9 Author: Matthew Wilcox (Oracle) Date: Wed Oct 12 20:34:19 2022 +0100 ext4,f2fs: fix readahead of verity data The recent change of page_cache_ra_unbounded() arguments was buggy in the two callers, causing us to readahead the wrong pages. Move the definition of ractl down to after the index is set correctly. This affected performance on configurations that use fs-verity. Link: https://lkml.kernel.org/r/20221012193419.1453558-1-willy@infradead.org Fixes: 73bb49da50cd ("mm/readahead: make page_cache_ra_unbounded take a readahead_control") Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Jintao Yin Signed-off-by: Andrew Morton commit deb0f6562884b5b4beb883d73e66a7d3a1b96d99 Author: Carlos Llamas Date: Fri Sep 30 00:38:43 2022 +0000 mm/mmap: undo ->mmap() when arch_validate_flags() fails Commit c462ac288f2c ("mm: Introduce arch_validate_flags()") added a late check in mmap_region() to let architectures validate vm_flags. The check needs to happen after calling ->mmap() as the flags can potentially be modified during this callback. If arch_validate_flags() check fails we unmap and free the vma. However, the error path fails to undo the ->mmap() call that previously succeeded and depending on the specific ->mmap() implementation this translates to reference increments, memory allocations and other operations what will not be cleaned up. There are several places (mainly device drivers) where this is an issue. However, one specific example is bpf_map_mmap() which keeps count of the mappings in map->writecnt. The count is incremented on ->mmap() and then decremented on vm_ops->close(). When arch_validate_flags() fails this count is off since bpf_map_mmap_close() is never called. One can reproduce this issue in arm64 devices with MTE support. Here the vm_flags are checked to only allow VM_MTE if VM_MTE_ALLOWED has been set previously. From userspace then is enough to pass the PROT_MTE flag to mmap() syscall to trigger the arch_validate_flags() failure. The following program reproduces this issue: #include #include #include #include #include int main(void) { union bpf_attr attr = { .map_type = BPF_MAP_TYPE_ARRAY, .key_size = sizeof(int), .value_size = sizeof(long long), .max_entries = 256, .map_flags = BPF_F_MMAPABLE, }; int fd; fd = syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr)); mmap(NULL, 4096, PROT_WRITE | PROT_MTE, MAP_SHARED, fd, 0); return 0; } By manually adding some log statements to the vm_ops callbacks we can confirm that when passing PROT_MTE to mmap() the map->writecnt is off upon ->release(): With PROT_MTE flag: root@debian:~# ./bpf-test [ 111.263874] bpf_map_write_active_inc: map=9 writecnt=1 [ 111.288763] bpf_map_release: map=9 writecnt=1 Without PROT_MTE flag: root@debian:~# ./bpf-test [ 157.816912] bpf_map_write_active_inc: map=10 writecnt=1 [ 157.830442] bpf_map_write_active_dec: map=10 writecnt=0 [ 157.832396] bpf_map_release: map=10 writecnt=0 This patch fixes the above issue by calling vm_ops->close() when the arch_validate_flags() check fails, after this we can proceed to unmap and free the vma on the error path. Link: https://lkml.kernel.org/r/20220930003844.1210987-1-cmllamas@google.com Fixes: c462ac288f2c ("mm: Introduce arch_validate_flags()") Signed-off-by: Carlos Llamas Reviewed-by: Catalin Marinas Acked-by: Andrii Nakryiko Reviewed-by: Liam Howlett Cc: Christian Brauner (Microsoft) Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: [5.10+] Signed-off-by: Andrew Morton commit fa182ea26ff09cbadb28bbcd6196209b3555eb1d Author: Divya Koppera Date: Tue Oct 11 15:24:37 2022 +0530 net: phy: micrel: Fixes FIELD_GET assertion FIELD_GET() must only be used with a mask that is a compile-time constant. Mark the functions as __always_inline to avoid the problem. Fixes: 21b688dabecb6a ("net: phy: micrel: Cable Diag feature for lan8814 phy") Reported-by: kernel test robot Signed-off-by: Divya Koppera Link: https://lore.kernel.org/r/20221011095437.12580-1-Divya.Koppera@microchip.com Signed-off-by: Jakub Kicinski commit 3c1860543fccc1d0cfe3fd6b190e414a418fe60e Author: Xin Long Date: Thu Oct 6 15:45:02 2022 -0400 openvswitch: add nf_ct_is_confirmed check before assigning the helper A WARN_ON call trace would be triggered when 'ct(commit, alg=helper)' applies on a confirmed connection: WARNING: CPU: 0 PID: 1251 at net/netfilter/nf_conntrack_extend.c:98 RIP: 0010:nf_ct_ext_add+0x12d/0x150 [nf_conntrack] Call Trace: nf_ct_helper_ext_add+0x12/0x60 [nf_conntrack] __nf_ct_try_assign_helper+0xc4/0x160 [nf_conntrack] __ovs_ct_lookup+0x72e/0x780 [openvswitch] ovs_ct_execute+0x1d8/0x920 [openvswitch] do_execute_actions+0x4e6/0xb60 [openvswitch] ovs_execute_actions+0x60/0x140 [openvswitch] ovs_packet_cmd_execute+0x2ad/0x310 [openvswitch] genl_family_rcv_msg_doit.isra.15+0x113/0x150 genl_rcv_msg+0xef/0x1f0 which can be reproduced with these OVS flows: table=0, in_port=veth1,tcp,tcp_dst=2121,ct_state=-trk actions=ct(commit, table=1) table=1, in_port=veth1,tcp,tcp_dst=2121,ct_state=+trk+new actions=ct(commit, alg=ftp),normal The issue was introduced by commit 248d45f1e193 ("openvswitch: Allow attaching helper in later commit") where it somehow removed the check of nf_ct_is_confirmed before asigning the helper. This patch is to fix it by bringing it back. Fixes: 248d45f1e193 ("openvswitch: Allow attaching helper in later commit") Reported-by: Pablo Neira Ayuso Signed-off-by: Xin Long Acked-by: Aaron Conole Tested-by: Aaron Conole Link: https://lore.kernel.org/r/c5c9092a22a2194650222bffaf786902613deb16.1665085502.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 4f0f2121a63ca57845fac78beb313ae6d2b8e957 Merge: 3a732b46736cd f49cd2f4d6170 Author: Jakub Kicinski Date: Wed Oct 12 17:50:40 2022 -0700 Merge branch 'tcp-udp-fix-memory-leaks-and-data-races-around-ipv6_addrform' Kuniyuki Iwashima says: ==================== tcp/udp: Fix memory leaks and data races around IPV6_ADDRFORM. This series fixes some memory leaks and data races caused in the same scenario where one thread converts an IPv6 socket into IPv4 with IPV6_ADDRFORM and another accesses the socket concurrently. v4: https://lore.kernel.org/netdev/20221004171802.40968-1-kuniyu@amazon.com/ v3 (Resend): https://lore.kernel.org/netdev/20221003154425.49458-1-kuniyu@amazon.com/ v3: https://lore.kernel.org/netdev/20220929012542.55424-1-kuniyu@amazon.com/ v2: https://lore.kernel.org/netdev/20220928002741.64237-1-kuniyu@amazon.com/ v1: https://lore.kernel.org/netdev/20220927161209.32939-1-kuniyu@amazon.com/ ==================== Link: https://lore.kernel.org/r/20221006185349.74777-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57 Author: Kuniyuki Iwashima Date: Thu Oct 6 11:53:49 2022 -0700 tcp: Fix data races around icsk->icsk_af_ops. setsockopt(IPV6_ADDRFORM) and tcp_v6_connect() change icsk->icsk_af_ops under lock_sock(), but tcp_(get|set)sockopt() read it locklessly. To avoid load/store tearing, we need to add READ_ONCE() and WRITE_ONCE() for the reads and writes. Thanks to Eric Dumazet for providing the syzbot report: BUG: KCSAN: data-race in tcp_setsockopt / tcp_v6_connect write to 0xffff88813c624518 of 8 bytes by task 23936 on cpu 0: tcp_v6_connect+0x5b3/0xce0 net/ipv6/tcp_ipv6.c:240 __inet_stream_connect+0x159/0x6d0 net/ipv4/af_inet.c:660 inet_stream_connect+0x44/0x70 net/ipv4/af_inet.c:724 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x197/0x1b0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x3d/0x50 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff88813c624518 of 8 bytes by task 23937 on cpu 1: tcp_setsockopt+0x147/0x1c80 net/ipv4/tcp.c:3789 sock_common_setsockopt+0x5d/0x70 net/core/sock.c:3585 __sys_setsockopt+0x212/0x2b0 net/socket.c:2252 __do_sys_setsockopt net/socket.c:2263 [inline] __se_sys_setsockopt net/socket.c:2260 [inline] __x64_sys_setsockopt+0x62/0x70 net/socket.c:2260 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0xffffffff8539af68 -> 0xffffffff8539aff8 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 23937 Comm: syz-executor.5 Not tainted 6.0.0-rc4-syzkaller-00331-g4ed9c1e971b1-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot Reported-by: Eric Dumazet Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 364f997b5cfe1db0d63a390fe7c801fa2b3115f6 Author: Kuniyuki Iwashima Date: Thu Oct 6 11:53:48 2022 -0700 ipv6: Fix data races around sk->sk_prot. Commit 086d49058cd8 ("ipv6: annotate some data-races around sk->sk_prot") fixed some data-races around sk->sk_prot but it was not enough. Some functions in inet6_(stream|dgram)_ops still access sk->sk_prot without lock_sock() or rtnl_lock(), so they need READ_ONCE() to avoid load tearing. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit d38afeec26ed4739c640bf286c270559aab2ba5f Author: Kuniyuki Iwashima Date: Thu Oct 6 11:53:47 2022 -0700 tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). Originally, inet6_sk(sk)->XXX were changed under lock_sock(), so we were able to clean them up by calling inet6_destroy_sock() during the IPv6 -> IPv4 conversion by IPV6_ADDRFORM. However, commit 03485f2adcde ("udpv6: Add lockless sendmsg() support") added a lockless memory allocation path, which could cause a memory leak: setsockopt(IPV6_ADDRFORM) sendmsg() +-----------------------+ +-------+ - do_ipv6_setsockopt(sk, ...) - udpv6_sendmsg(sk, ...) - sockopt_lock_sock(sk) ^._ called via udpv6_prot - lock_sock(sk) before WRITE_ONCE() - WRITE_ONCE(sk->sk_prot, &tcp_prot) - inet6_destroy_sock() - if (!corkreq) - sockopt_release_sock(sk) - ip6_make_skb(sk, ...) - release_sock(sk) ^._ lockless fast path for the non-corking case - __ip6_append_data(sk, ...) - ipv6_local_rxpmtu(sk, ...) - xchg(&np->rxpmtu, skb) ^._ rxpmtu is never freed. - goto out_no_dst; - lock_sock(sk) For now, rxpmtu is only the case, but not to miss the future change and a similar bug fixed in commit e27326009a3d ("net: ping6: Fix memleak in ipv6_renew_options()."), let's set a new function to IPv6 sk->sk_destruct() and call inet6_cleanup_sock() there. Since the conversion does not change sk->sk_destruct(), we can guarantee that we can clean up IPv6 resources finally. We can now remove all inet6_destroy_sock() calls from IPv6 protocol specific ->destroy() functions, but such changes are invasive to backport. So they can be posted as a follow-up later for net-next. Fixes: 03485f2adcde ("udpv6: Add lockless sendmsg() support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 21985f43376cee092702d6cb963ff97a9d2ede68 Author: Kuniyuki Iwashima Date: Thu Oct 6 11:53:46 2022 -0700 udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM). Commit 4b340ae20d0e ("IPv6: Complete IPV6_DONTFRAG support") forgot to add a change to free inet6_sk(sk)->rxpmtu while converting an IPv6 socket into IPv4 with IPV6_ADDRFORM. After conversion, sk_prot is changed to udp_prot and ->destroy() never cleans it up, resulting in a memory leak. This is due to the discrepancy between inet6_destroy_sock() and IPV6_ADDRFORM, so let's call inet6_destroy_sock() from IPV6_ADDRFORM to remove the difference. However, this is not enough for now because rxpmtu can be changed without lock_sock() after commit 03485f2adcde ("udpv6: Add lockless sendmsg() support"). We will fix this case in the following patch. Note we will rename inet6_destroy_sock() to inet6_cleanup_sock() and remove unnecessary inet6_destroy_sock() calls in sk_prot->destroy() in the future. Fixes: 4b340ae20d0e ("IPv6: Complete IPV6_DONTFRAG support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 3c52c6bb831f6335c176a0fc7214e26f43adbd11 Author: Kuniyuki Iwashima Date: Thu Oct 6 11:53:45 2022 -0700 tcp/udp: Fix memory leak in ipv6_renew_options(). syzbot reported a memory leak [0] related to IPV6_ADDRFORM. The scenario is that while one thread is converting an IPv6 socket into IPv4 with IPV6_ADDRFORM, another thread calls do_ipv6_setsockopt() and allocates memory to inet6_sk(sk)->XXX after conversion. Then, the converted sk with (tcp|udp)_prot never frees the IPv6 resources, which inet6_destroy_sock() should have cleaned up. setsockopt(IPV6_ADDRFORM) setsockopt(IPV6_DSTOPTS) +-----------------------+ +----------------------+ - do_ipv6_setsockopt(sk, ...) - sockopt_lock_sock(sk) - do_ipv6_setsockopt(sk, ...) - lock_sock(sk) ^._ called via tcpv6_prot - WRITE_ONCE(sk->sk_prot, &tcp_prot) before WRITE_ONCE() - xchg(&np->opt, NULL) - txopt_put(opt) - sockopt_release_sock(sk) - release_sock(sk) - sockopt_lock_sock(sk) - lock_sock(sk) - ipv6_set_opt_hdr(sk, ...) - ipv6_update_options(sk, opt) - xchg(&inet6_sk(sk)->opt, opt) ^._ opt is never freed. - sockopt_release_sock(sk) - release_sock(sk) Since IPV6_DSTOPTS allocates options under lock_sock(), we can avoid this memory leak by testing whether sk_family is changed by IPV6_ADDRFORM after acquiring the lock. This issue exists from the initial commit between IPV6_ADDRFORM and IPV6_PKTOPTIONS. [0]: BUG: memory leak unreferenced object 0xffff888009ab9f80 (size 96): comm "syz-executor583", pid 328, jiffies 4294916198 (age 13.034s) hex dump (first 32 bytes): 01 00 00 00 48 00 00 00 08 00 00 00 00 00 00 00 ....H........... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000002ee98ae1>] kmalloc include/linux/slab.h:605 [inline] [<000000002ee98ae1>] sock_kmalloc+0xb3/0x100 net/core/sock.c:2566 [<0000000065d7b698>] ipv6_renew_options+0x21e/0x10b0 net/ipv6/exthdrs.c:1318 [<00000000a8c756d7>] ipv6_set_opt_hdr net/ipv6/ipv6_sockglue.c:354 [inline] [<00000000a8c756d7>] do_ipv6_setsockopt.constprop.0+0x28b7/0x4350 net/ipv6/ipv6_sockglue.c:668 [<000000002854d204>] ipv6_setsockopt+0xdf/0x190 net/ipv6/ipv6_sockglue.c:1021 [<00000000e69fdcf8>] tcp_setsockopt+0x13b/0x2620 net/ipv4/tcp.c:3789 [<0000000090da4b9b>] __sys_setsockopt+0x239/0x620 net/socket.c:2252 [<00000000b10d192f>] __do_sys_setsockopt net/socket.c:2263 [inline] [<00000000b10d192f>] __se_sys_setsockopt net/socket.c:2260 [inline] [<00000000b10d192f>] __x64_sys_setsockopt+0xbe/0x160 net/socket.c:2260 [<000000000a80d7aa>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<000000000a80d7aa>] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 [<000000004562b5c6>] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 1b5964b2f9f67ded7ce522870698ffdd4c889255 Merge: 90e0d94d369d3 299824e68bd0f Author: Palmer Dabbelt Date: Wed Oct 12 17:05:21 2022 -0700 Merge patch series "Fix dt-validate issues on qemu dtbdumps due to dt-bindings" Conor Dooley says: From: Conor Dooley The device trees produced automatically for the virt and spike machines fail dt-validate on several grounds. Some of these need to be fixed in the linux kernel's dt-bindings, but others are caused by bugs in QEMU. Patches been sent that fix the QEMU issues [0], but a couple of them need to be fixed in the kernel's dt-bindings. The first patches add compatibles for "riscv,{clint,plic}0" which are present in drivers and the auto generated QEMU dtbs. Thanks to Rob Herring for reporting these issues [1], Conor. To reproduce the errors: ./build/qemu-system-riscv64 -nographic -machine virt,dumpdtb=qemu.dtb dt-validate -p /path/to/linux/kernel/Documentation/devicetree/bindings/processed-schema.json qemu.dtb (The processed schema needs to be generated first) 0 - https://lore.kernel.org/linux-riscv/20220810184612.157317-1-mail@conchuod.ie/ 1 - https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ * fix-dt-validate: dt-bindings: riscv: add new riscv,isa strings for emulators dt-bindings: interrupt-controller: sifive,plic: add legacy riscv compatible dt-bindings: timer: sifive,clint: add legacy riscv compatible Link: https://lore.kernel.org/r/20220823183319.3314940-1-mail@conchuod.ie [Palmer: some cover letter pruning, and dropped #4 as suggested.] Signed-off-by: Palmer Dabbelt commit 299824e68bd0fac60f8352c940fd731fde609de1 Author: Conor Dooley Date: Tue Aug 23 19:33:19 2022 +0100 dt-bindings: riscv: add new riscv,isa strings for emulators The QEMU virt and spike machines currently export a riscv,isa string of "rv64imafdcsuh", While the RISC-V foundation has been ratifying a bunch of extenstions etc, the kernel has remained relatively static with what hardware is supported - but the same is not true of QEMU. Using the virt machine and running dt-validate on the dumped dtb fails, partly due to the unexpected isa string. Rather than enumerate the many many possbilities, change the pattern to a regex, with the following assumptions: - ima are required - the single letter order is fixed & we don't care about things that can't even do "ima" - the standard multi letter extensions are all in a "_z" format where the first letter of is a valid single letter extension - _s & _h are used for supervisor and hyper visor extensions - convention says that after the first two chars, a standard multi letter extension name could be an english word (ifencei anyone?) so it's not worth restricting the charset - as the above is just convention, don't apply any charset restrictions to reduce future churn - vendor ISA extensions begind with _x and have no charset restrictions - we don't care about an e extension from an OS pov - that attempting to validate the contents of the multiletter extensions with dt-validate beyond the formatting is a futile, massively verbose or unwieldy exercise at best The following limitations also apply: - multi letter extension ordering is not enforced. dt-schema does not appear to allow for named match groups, so the resulting regex would be even more of a headache - ditto for the numbered extensions Finally, add me as a maintainer of the binding so that when it breaks in the future, I can be held responsible! Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Reviewed-by: Andrew Jones Acked-by: Guo Ren Signed-off-by: Conor Dooley Acked-by: Heiko Stuebner Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220823183319.3314940-4-mail@conchuod.ie Signed-off-by: Palmer Dabbelt commit 6e965c9bd7388762b302dca5852eb25cbe9cc085 Author: Conor Dooley Date: Tue Aug 23 19:33:18 2022 +0100 dt-bindings: interrupt-controller: sifive,plic: add legacy riscv compatible While "real" hardware might not use the compatible string "riscv,plic0" it is present in the driver & QEMU uses it for automatically generated virt machine dtbs. To avoid dt-validate problems with QEMU produced dtbs, such as the following, add it to the binding. riscv-virt.dtb: plic@c000000: compatible: 'oneOf' conditional failed, one must be fixed: 'sifive,plic-1.0.0' is not one of ['sifive,fu540-c000-plic', 'starfive,jh7100-plic', 'canaan,k210-plic'] 'sifive,plic-1.0.0' is not one of ['allwinner,sun20i-d1-plic'] 'sifive,plic-1.0.0' was expected 'thead,c900-plic' was expected riscv-virt.dtb: plic@c000000: '#address-cells' is a required property Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Reviewed-by: Rob Herring Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220823183319.3314940-3-mail@conchuod.ie Signed-off-by: Palmer Dabbelt commit 826249942679a110353e71a1d92764fcf43e7cf7 Author: Conor Dooley Date: Tue Aug 23 19:33:17 2022 +0100 dt-bindings: timer: sifive,clint: add legacy riscv compatible While "real" hardware might not use the compatible string "riscv,clint0" it is present in the driver & QEMU uses it for automatically generated virt machine dtbs. To avoid dt-validate problems with QEMU produced dtbs, such as the following, add it to the binding. riscv-virt.dtb: clint@2000000: compatible:0: 'sifive,clint0' is not one of ['sifive,fu540-c000-clint', 'starfive,jh7100-clint', 'canaan,k210-clint'] Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Reviewed-by: Rob Herring Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220823183319.3314940-2-mail@conchuod.ie Signed-off-by: Palmer Dabbelt commit 515778e2d790652a38a24554fdb7f21420d91efc Author: Peter Xu Date: Fri Sep 30 20:25:55 2022 -0400 mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in When PTE_MARKER_UFFD_WP not configured, it's still possible to reach pte marker code and trigger an warning. Add a few CONFIG_PTE_MARKER_UFFD_WP ifdefs to make sure the code won't be reached when not compiled in. Link: https://lkml.kernel.org/r/YzeR+R6b4bwBlBHh@x1n Fixes: b1f9e876862d ("mm/uffd: enable write protection for shmem & hugetlbfs") Signed-off-by: Peter Xu Reported-by: Cc: Axel Rasmussen Cc: Brian Geffon Cc: Edward Liaw Cc: Liu Shixin Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton commit 28c5609fb236807910ca347ad3e26c4567998526 Author: Liam Howlett Date: Tue Oct 11 16:08:37 2022 +0000 mm/mmap: preallocate maple nodes for brk vma expansion If the brk VMA is the last vma in a maple node and meets the rare criteria that it can be expanded, then preallocation is necessary to avoid a potential fs_reclaim circular lock issue on low resources. At the same time use the actual vma start address (unaligned) when calling vma_adjust_trans_huge(). Link: https://lkml.kernel.org/r/20221011160624.1253454-1-Liam.Howlett@oracle.com Fixes: 2e7ce7d354f2 (mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()) Signed-off-by: Liam R. Howlett Reported-by: Yu Zhao Signed-off-by: Andrew Morton commit 7be1c1a3c7b13fb259bb5159662a7b83622013b8 Author: Alexey Dobriyan Date: Tue Oct 11 20:55:31 2022 +0300 mm: more vma cache removal Link: https://lkml.kernel.org/r/Y0WuE3Riv4iy5Jx8@localhost.localdomain Fixes: 7964cf8caa4d ("mm: remove vmacache") Signed-off-by: Alexey Dobriyan Acked-by: Liam Howlett Signed-off-by: Andrew Morton commit 92b7399695a5cc961c44fc6e4624d3bc3c699ee7 Author: Liam Howlett Date: Tue Oct 11 20:36:51 2022 +0000 mmap: fix copy_vma() failure path The anon vma was not unlinked and the file was not closed in the failure path when the machine runs out of memory during the maple tree modification. This caused a memory leak of the anon vma chain and vma since neither would be freed. Link: https://lkml.kernel.org/r/20221011203621.1446507-1-Liam.Howlett@oracle.com Fixes: 524e00b36e8c ("mm: remove rb tree") Signed-off-by: Liam R. Howlett Reported-by: Lukas Bulwahn Tested-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit 7efc3b7261030da79001c00d92bc3392fd6c664c Author: Chuyi Zhou Date: Wed Jul 13 14:20:09 2022 +0800 mm/compaction: fix set skip in fast_find_migrateblock When we successfully find a pageblock in fast_find_migrateblock(), the block will be set skip-flag through set_pageblock_skip(). However, when entering isolate_migratepages_block(), the whole pageblock will be skipped due to the branch 'if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages))'. Eventually we will goto isolate_abort and isolate nothing. That makes fast_find_migrateblock useless. In this patch, when we find a suitable pageblock in fast_find_migrateblock, we do noting but let isolate_migratepages_block to set skip flag to the pageblock after scan it. Normally, we would isolate some pages from the fast-find block. I use mmtest/thpscale-madvhugepage test it. Here is the result: baseline patch Amean fault-both-1 1331.66 ( 0.00%) 1261.04 * 5.30%* Amean fault-both-3 1383.95 ( 0.00%) 1191.69 * 13.89%* Amean fault-both-5 1568.13 ( 0.00%) 1445.20 * 7.84%* Amean fault-both-7 1819.62 ( 0.00%) 1555.13 * 14.54%* Amean fault-both-12 1106.96 ( 0.00%) 1149.43 * -3.84%* Amean fault-both-18 2196.93 ( 0.00%) 1875.77 * 14.62%* Amean fault-both-24 2642.69 ( 0.00%) 2671.21 * -1.08%* Amean fault-both-30 2901.89 ( 0.00%) 2857.32 * 1.54%* Amean fault-both-32 3747.00 ( 0.00%) 3479.23 * 7.15%* Link: https://lkml.kernel.org/r/20220713062009.597255-1-zhouchuyi@bytedance.com Fixes: 70b44595eafe9 ("mm, compaction: use free lists to quickly locate a migration source") Signed-off-by: zhouchuyi Cc: Mel Gorman Signed-off-by: Andrew Morton commit acfac37851e01b40c30a7afd0d93ad8db8914f25 Author: Andrew Morton Date: Fri Oct 7 12:59:20 2022 -0700 mm/hugetlb.c: make __hugetlb_vma_unlock_write_put() static Reported-by: kernel test robot Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 8f08553e7e4370cdb8f55f0e3dc4db91ed6a4931 Author: Christophe JAILLET Date: Wed Aug 24 10:25:11 2022 +0200 rtc: k3: Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 12843 4804 64 17711 452f drivers/rtc/rtc-ti-k3.o down to: 12523 4804 64 17391 43ef drivers/rtc/rtc-ti-k3.o Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/601288834ab71c0fddde7eedd8cdb8001254ed7e.1661329498.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni commit 94e4603d1a262f8d79f6186d0df0379243613b95 Author: Christophe JAILLET Date: Wed Aug 24 10:42:29 2022 +0200 rtc: jz4740: Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). As a side effect, some error messages are not logged anymore, so also use dev_err_probe() instead of dev_err() in case of error. At least the error code will be logged (and -EPROBE_DEFER will be filtered) Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 9025 2488 128 11641 2d79 drivers/rtc/rtc-jz4740.o down to: 8267 2080 128 10475 28eb drivers/rtc/rtc-jz4740.o Signed-off-by: Christophe JAILLET Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/af10570000d7e103d70bbea590ce8df4f8902b67.1661330532.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni commit 24fb316155a5f6ba278a8b110c60e67b79900356 Author: Christophe JAILLET Date: Wed Aug 24 10:18:25 2022 +0200 rtc: mpfs: Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). That said, mpfs_rtc_init_clk() is the same as devm_clk_get_enabled(), so use this function directly instead. This also fixes an (unlikely) unchecked devm_add_action_or_reset() error. Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 5330 2208 0 7538 1d72 drivers/rtc/rtc-mpfs.o down to: 5074 2208 0 7282 1c72 drivers/rtc/rtc-mpfs.o Signed-off-by: Christophe JAILLET Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/e55c959f2821a2c367a4c5de529a638b1cc6b8cd.1661329086.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni commit 2ec33a6c3cca9fe2465e82050c81f5ffdc508b36 Author: Jens Axboe Date: Tue Oct 11 09:06:23 2022 -0600 io_uring/rw: ensure kiocb_end_write() is always called A previous commit moved the notifications and end-write handling, but it is now missing a few spots where we also want to call both of those. Without that, we can potentially be missing file notifications, and more importantly, have an imbalance in the super_block writers sem accounting. Fixes: b000145e9907 ("io_uring/rw: defer fsnotify calls to task context") Reported-by: Dave Chinner Link: https://lore.kernel.org/all/20221010050319.GC2703033@dread.disaster.area/ Signed-off-by: Jens Axboe commit 00927931cb630bbf8edb6d7f4dadb25139fc5e16 Author: Pavel Begunkov Date: Tue Oct 11 01:59:57 2022 +0100 io_uring: fix fdinfo sqe offsets calculation Only with the big sqe feature they take 128 bytes per entry, but we unconditionally advance by 128B. Fix it by using sq_shift. Fixes: 3b8fdd1dc35e3 ("io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128") Reported-and-tested-by: syzbot+e5198737e8a2d23d958c@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8b41287cb75d5efb8fcb5cccde845ddbbadd8372.1665449983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c86416c6ff5ba7f7e5f3ff1dd8a9d1b3d0be827c Author: Stefan Roesch Date: Mon Oct 10 16:43:30 2022 -0700 io_uring: local variable rw shadows outer variable in io_write This fixes the shadowing of the outer variable rw in the function io_write(). No issue is caused by this, but let's silence the shadowing warning anyway. Reported-by: kernel test robot Signed-off-by: Stefan Roesch Link: https://lore.kernel.org/r/20221010234330.244244-1-shr@devkernel.io Signed-off-by: Jens Axboe commit 11528491c65a493050c682786c6b7cfd9e9b4a8f Author: Jens Axboe Date: Fri Oct 7 12:26:02 2022 -0600 io_uring/opdef: remove 'audit_skip' from SENDMSG_ZC The msg variants of sending aren't audited separately, so we should not be setting audit_skip for the zerocopy sendmsg variant either. Fixes: 493108d95f14 ("io_uring/net: zerocopy sendmsg") Reported-by: Paul Moore Reviewed-by: Paul Moore Signed-off-by: Jens Axboe commit 44f87745d5f24a3cdf0548bf1d84fbb7316ce229 Author: Pavel Begunkov Date: Thu Oct 6 21:42:33 2022 +0100 io_uring: optimise locking for local tw with submit_wait Running local task_work requires taking uring_lock, for submit + wait we can try to run them right after submit while we still hold the lock and save one lock/unlokc pair. The optimisation was implemented in the first local tw patches but got dropped for simplicity. Suggested-by: Dylan Yudaken Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/281fc79d98b5d91fe4778c5137a17a2ab4693e5c.1665088876.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit fc86f9d3bb4904117eea70347d323fde34a47c79 Author: Pavel Begunkov Date: Thu Oct 6 02:06:10 2022 +0100 io_uring: remove redundant memory barrier in io_req_local_work_add io_cqring_wake() needs a barrier for the waitqueue_active() check. However, in the case of io_req_local_work_add(), we call llist_add() first, which implies an atomic. Hence we can replace smb_mb() with smp_mb__after_atomic(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/43983bc8bc507172adda7a0f00cab1aff09fd238.1665018309.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3fb1bd68817288729179444caf1fd5c5c4d2d65d Author: Jens Axboe Date: Tue Oct 4 20:29:48 2022 -0600 io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT We treat EINPROGRESS like EAGAIN, but if we're retrying post getting EINPROGRESS, then we just need to check the socket for errors and terminate the request. This was exposed on a bluetooth connection request which ends up taking a while and hitting EINPROGRESS, and yields a CQE result of -EBADFD because we're retrying a connect on a socket that is now connected. Cc: stable@vger.kernel.org Fixes: 87f80d623c6c ("io_uring: handle connect -EINPROGRESS like -EAGAIN") Link: https://github.com/axboe/liburing/issues/671 Reported-by: Aidan Sun Signed-off-by: Jens Axboe commit b7a817752efc850603c4c23ed78da2b990a6a34a Author: Pavel Begunkov Date: Tue Oct 4 03:19:25 2022 +0100 io_uring: remove notif leftovers Notifications were killed but there is a couple of fields and struct declarations left, remove them. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8df8877d677be5a2b43afd936d600e60105ea960.1664849941.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 42b6419d0aba47c5d8644cdc0b68502254671de5 Author: Pavel Begunkov Date: Tue Oct 4 03:19:08 2022 +0100 io_uring: correct pinned_vm accounting ->mm_account should be released only after we free all registered buffers, otherwise __io_sqe_buffers_unregister() will see a NULL ->mm_account and skip locked_vm accounting. Cc: Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6d798f65ed4ab8db3664c4d3397d4af16ca98846.1664849932.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0091bfc81741b8d3aeb3b7ab8636f911b2de6e80 Author: Pavel Begunkov Date: Mon Oct 3 13:59:47 2022 +0100 io_uring/af_unix: defer registered files gc to io_uring release Instead of putting io_uring's registered files in unix_gc() we want it to be done by io_uring itself. The trick here is to consider io_uring registered files for cycle detection but not actually putting them down. Because io_uring can't register other ring instances, this will remove all refs to the ring file triggering the ->release path and clean up with io_ring_ctx_free(). Cc: stable@vger.kernel.org Fixes: 6b06314c47e1 ("io_uring: add file set registration") Reported-and-tested-by: David Bouman Signed-off-by: Pavel Begunkov Signed-off-by: Thadeu Lima de Souza Cascardo [axboe: add kerneldoc comment to skb, fold in skb leak fix] Signed-off-by: Jens Axboe commit d73d66c0e05741b35b7398e647b8c4f2aaea9b09 Author: Colin Ian King Date: Mon Oct 3 16:37:11 2022 +0100 rtc: ds1685: Fix spelling of function name in comment block The function name is missing the letter 'd' in the comment block. Fix it. Signed-off-by: Colin Ian King Acked-by: Joshua Kinard Link: https://lore.kernel.org/r/20221003153711.271630-1-colin.i.king@gmail.com Signed-off-by: Alexandre Belloni commit b1a1baa657c738e8bb0107ce304f5e78b9847f37 Author: Rasmus Villemoes Date: Wed Sep 21 13:46:23 2022 +0200 rtc: isl12022: switch to using regmap API The regmap abstraction allows us to avoid the private i2c transfer helpers, and also offers some nice utility functions such as the regmap_update_bits family. While at it, simplify the code even more by not keeping track of ->write_enabled: rtc_set_time is not a hot path, so one extra i2c read doesn't hurt (regmap_update_bits elides the write when the bits are already as desired). Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-9-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit 0a2abbfd8586d396a8581ebf9b96fd5746f08b14 Author: Rasmus Villemoes Date: Wed Sep 21 13:46:22 2022 +0200 rtc: isl12022: drop redundant write to HR register There's nothing in the data sheet that says writing to one of the time keeping registers is necessary to start the RTC. It does so at the stop condition of the i2c transfer setting the WRTC bit: Upon initialization or power-up, the WRTC must be set to "1" to enable the RTC. Upon the completion of a valid write (STOP), the RTC starts counting. Moreover, even if such a write to one of the timekeeping registers was necessary, that's exactly what we do anyway just below when we actually write the given struct rtc_time to the device. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-8-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit 31b108acc50cddf3d16472ead45c4cd0d1337289 Author: Rasmus Villemoes Date: Wed Sep 21 13:46:21 2022 +0200 rtc: isl12022: use dev_set_drvdata() instead of i2c_set_clientdata() As another preparation for removing direct references to the i2c_client in the helper functions, stash a pointer to the private data via dev_set_drvdata() instead of i2c_set_clientdata(). Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-7-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit 7093b8a471f48d49891da2108f44fd64742408cb Author: Rasmus Villemoes Date: Wed Sep 21 13:46:20 2022 +0200 rtc: isl12022: use %ptR Simplify the code and make the output format consistent with other RTC drivers by standardizing on using the %ptR printf extension. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-6-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit ca35887186b7c53f26c42aee1285ba213adb4365 Author: Rasmus Villemoes Date: Wed Sep 21 13:46:19 2022 +0200 rtc: isl12022: simplify some expressions These instances of '&client->dev' might as well be spelled 'dev', since 'client' has been computed from 'dev' via 'client = to_i2c_client(dev)'. Later patches will get rid of that local variable 'client', so remove these unnecessary references so those later patches become easier to read. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-5-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit 43a96b9cf67770d4bb46267e1554d3d8b4cf78ac Author: Rasmus Villemoes Date: Wed Sep 21 13:46:18 2022 +0200 rtc: isl12022: drop a dev_info() This dev_info() seems to be a debug leftover, and it would only get printed once (or, once per battery change). Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-4-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit ca03b7a2c0b098321365f69538823d1bcc860552 Author: Rasmus Villemoes Date: Wed Sep 21 13:46:17 2022 +0200 rtc: isl12022: specify range_min and range_max The isl12022 can (only) keep track of times in the range 2000-2099. The data sheet says The calendar registers track date, month, year, and day of the week and are accurate through 2099, with automatic leap year correction. The lower bound of 2000 is obtained by simply observing that its YR register only counts from 00 through 99. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-3-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit a35a2ad2b88a66732ac442ad5f86dc49af51673f Author: Rasmus Villemoes Date: Wed Sep 21 13:46:16 2022 +0200 rtc: isl12022: stop using deprecated devm_rtc_device_register() The comments say that devm_rtc_device_register() is deprecated and that one should instead use devm_rtc_allocate_device() and [devm_]rtc_register_device. So do that. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220921114624.3250848-2-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni commit 0759011157b0d666b02b03b986d3de005d84027e Author: Lin Yujun Date: Thu Sep 15 14:52:53 2022 +0800 rtc: stmp3xxx: Add failure handling for stmp3xxx_wdt_register() Use platform_device_put() to free platform device before print error message when platform_device_add() fails to run. Fixes: 1a71fb84fda6 ("rtc: stmp3xxx: add wdt-accessor function") Signed-off-by: Lin Yujun Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20220915065253.43668-1-linyujun809@huawei.com Signed-off-by: Alexandre Belloni commit a185a0995518a3355c8623c95c36aaaae489de10 Merge: 661e00960f072 e98c4f6afc5e2 Author: Linus Torvalds Date: Wed Oct 12 15:01:58 2022 -0700 Merge tag 'linux-kselftest-kunit-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull more KUnit updates from Shuah Khan: "Features and fixes: - simplify resource use - make kunit_malloc() and kunit_free() allocations and frees consistent. kunit_free() frees only the memory allocated by kunit_malloc() - stop downloading risc-v opensbi binaries using wget - other fixes and improvements to tool and KUnit framework" * tag 'linux-kselftest-kunit-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: kunit: Update description of --alltests option kunit: declare kunit_assert structs as const kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED kunit: remove format func from struct kunit_assert, get it to 0 bytes kunit: tool: Don't download risc-v opensbi firmware with wget kunit: make kunit_kfree(NULL) a no-op to match kfree() kunit: make kunit_kfree() not segfault on invalid inputs kunit: make kunit_kfree() only work on pointers from kunit_malloc() and friends kunit: drop test pointer in string_stream_fragment kunit: string-stream: Simplify resource use commit 90e0d94d369d342e735a75174439482119b6c393 Merge: 06267eb2decaa c210b91818e81 Author: Palmer Dabbelt Date: Wed Oct 12 14:59:53 2022 -0700 Merge tag 'dt-for-palmer-v6.1-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into for-next Microchip RISC-V devicetrees for v6.1 Fixups, reference design changes and new boards: - The addition of QSPI support for mpfs had a corresponding change to the devicetree node. - The v2022.{09,10} reference designs brought with them several memory map changes which are not backwards compatible. The old devicetrees from the v2022.08 and earlier releases still work with current kernels. - Two new devicetrees for a first-party development kit and for the Aries Embedded M100FPSEVP kit. - Corresponding dt-bindings changes for the above. Signed-off-by: Conor Dooley * tag 'dt-for-palmer-v6.1-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: microchip: fix fabric i2c reg size riscv: dts: microchip: update memory configuration for v2022.10 riscv: dts: microchip: add a devicetree for aries' m100pfsevp riscv: dts: microchip: add sevkit device tree riscv: dts: microchip: reduce the fic3 clock rate riscv: dts: microchip: icicle: re-jig fabric peripheral addresses riscv: dts: microchip: icicle: update pci address properties riscv: dts: microchip: move the mpfs' pci node to -fabric.dtsi riscv: dts: microchip: add pci dma ranges for the icicle kit dt-bindings: riscv: microchip: document the sev kit dt-bindings: riscv: microchip: document the aries m100pfsevp dt-bindings: riscv: microchip: document icicle reference design riscv: dts: microchip: add qspi compatible fallback Signed-off-by: Palmer Dabbelt commit 661e00960f072a63bb956836e65f2ce3a1ca8793 Merge: d3cf405133307 6a24247132db8 Author: Linus Torvalds Date: Wed Oct 12 14:59:13 2022 -0700 Merge tag 'linux-kselftest-next-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull more Kselftest updates from Shuah Khan: "This consists of fixes and improvements to memory-hotplug test and a minor spelling fix to ftrace test" * tag 'linux-kselftest-next-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: docs: notifier-error-inject: Correct test's name selftests/memory-hotplug: Adjust log info for maintainability selftests/memory-hotplug: Restore memory before exit selftests/memory-hotplug: Add checking after online or offline selftests/ftrace: func_event_triggers: fix typo in user message commit d3cf40513330752238ae585fdb0e46ec6baa588b Merge: 778ce723e93ee b1b8132a651cf Author: Linus Torvalds Date: Wed Oct 12 14:46:48 2022 -0700 Merge tag 'vfio-v6.1-rc1' of https://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Prune private items from vfio_pci_core.h to a new internal header, fix missed function rename, and refactor vfio-pci interrupt defines (Jason Gunthorpe) - Create consistent naming and handling of ioctls with a function per ioctl for vfio-pci and vfio group handling, use proper type args where available (Jason Gunthorpe) - Implement a set of low power device feature ioctls allowing userspace to make use of power states such as D3cold where supported (Abhishek Sahu) - Remove device counter on vfio groups, which had restricted the page pinning interface to singleton groups to account for limitations in the type1 IOMMU backend. Document usage as limited to emulated IOMMU devices, ie. traditional mdev devices where this restriction is consistent (Jason Gunthorpe) - Correct function prefix in hisi_acc driver incurred during previous refactoring (Shameer Kolothum) - Correct typo and remove redundant warning triggers in vfio-fsl driver (Christophe JAILLET) - Introduce device level DMA dirty tracking uAPI and implementation in the mlx5 variant driver (Yishai Hadas & Joao Martins) - Move much of the vfio_device life cycle management into vfio core, simplifying and avoiding duplication across drivers. This also facilitates adding a struct device to vfio_device which begins the introduction of device rather than group level user support and fills a gap allowing userspace identify devices as vfio capable without implicit knowledge of the driver (Kevin Tian & Yi Liu) - Split vfio container handling to a separate file, creating a more well defined API between the core and container code, masking IOMMU backend implementation from the core, allowing for an easier future transition to an iommufd based implementation of the same (Jason Gunthorpe) - Attempt to resolve race accessing the iommu_group for a device between vfio releasing DMA ownership and removal of the device from the IOMMU driver. Follow-up with support to allow vfio_group to exist with NULL iommu_group pointer to support existing userspace use cases of holding the group file open (Jason Gunthorpe) - Fix error code and hi/lo register manipulation issues in the hisi_acc variant driver, along with various code cleanups (Longfang Liu) - Fix a prior regression in GVT-g group teardown, resulting in unreleased resources (Jason Gunthorpe) - A significant cleanup and simplification of the mdev interface, consolidating much of the open coded per driver sysfs interface support into the mdev core (Christoph Hellwig) - Simplification of tracking and locking around vfio_groups that fall out from previous refactoring (Jason Gunthorpe) - Replace trivial open coded f_ops tests with new helper (Alex Williamson) * tag 'vfio-v6.1-rc1' of https://github.com/awilliam/linux-vfio: (77 commits) vfio: More vfio_file_is_group() use cases vfio: Make the group FD disassociate from the iommu_group vfio: Hold a reference to the iommu_group in kvm for SPAPR vfio: Add vfio_file_is_group() vfio: Change vfio_group->group_rwsem to a mutex vfio: Remove the vfio_group->users and users_comp vfio/mdev: add mdev available instance checking to the core vfio/mdev: consolidate all the description sysfs into the core code vfio/mdev: consolidate all the available_instance sysfs into the core code vfio/mdev: consolidate all the name sysfs into the core code vfio/mdev: consolidate all the device_api sysfs into the core code vfio/mdev: remove mtype_get_parent_dev vfio/mdev: remove mdev_parent_dev vfio/mdev: unexport mdev_bus_type vfio/mdev: remove mdev_from_dev vfio/mdev: simplify mdev_type handling vfio/mdev: embedd struct mdev_parent in the parent data structure vfio/mdev: make mdev.h standalone includable drm/i915/gvt: simplify vgpu configuration management drm/i915/gvt: fix a memory leak in intel_gvt_init_vgpu_types ... commit 90f4a09a15239f4a819b2e90a7a0b92a75060655 Author: Billy Tsai Date: Mon Sep 26 18:51:45 2022 +0800 i3c: master: Remove the wrong place of reattach. The reattach should be used when an I3C device has its address changed. But the modified place in this patch doesn't have the address changed of the newdev. This wrong reattach will reserve the same address slot twice and return unexpected -EBUSY when the bus find the duplicate device with diffent dynamic address. Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20220926105145.8145-2-billy_tsai@aspeedtech.com Signed-off-by: Alexandre Belloni commit d4fa7d772adc02451076b3ad1f990d8b822909fc Author: Billy Tsai Date: Mon Sep 26 18:51:44 2022 +0800 i3c: master: Free the old_dyn_addr when reattach. This patch is used to free the old_dyn_addr when the caller want to reattach the device to the different dynamic address. If the old_dyn_addr is 0 the function will treat it as no old_dyn_addr is reserved on the bus. Without the patch, when the driver reattach the i3c device after setnewda the old_dyn_addr will be permanently occupied. Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20220926105145.8145-1-billy_tsai@aspeedtech.com Signed-off-by: Alexandre Belloni commit 778ce723e93ee803ef5883619fe2391e00dbc209 Merge: 1440f57602288 7880672bdc975 Author: Linus Torvalds Date: Wed Oct 12 14:39:38 2022 -0700 Merge tag 'for-linus-6.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - Some minor typo fixes - A fix of the Xen pcifront driver for supporting the device model to run in a Linux stub domain - A cleanup of the pcifront driver - A series to enable grant-based virtio with Xen on x86 - A cleanup of Xen PV guests to distinguish between safe and faulting MSR accesses - Two fixes of the Xen gntdev driver - Two fixes of the new xen grant DMA driver * tag 'for-linus-6.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: Kconfig: Fix spelling mistake "Maxmium" -> "Maximum" xen/pv: support selecting safe/unsafe msr accesses xen/pv: refactor msr access functions to support safe and unsafe accesses xen/pv: fix vendor checks for pmu emulation xen/pv: add fault recovery control to pmu msr accesses xen/virtio: enable grant based virtio on x86 xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT xen/virtio: restructure xen grant dma setup xen/pcifront: move xenstore config scanning into sub-function xen/gntdev: Accommodate VMA splitting xen/gntdev: Prevent leaking grants xen/virtio: Fix potential deadlock when accessing xen_grant_dma_devices xen/virtio: Fix n_pages calculation in xen_grant_dma_map(unmap)_page() xen/xenbus: Fix spelling mistake "hardward" -> "hardware" xen-pcifront: Handle missed Connected state commit 1440f576022887004f719883acb094e7e0dd4944 Merge: 676cb49573964 d0d51a97063db Author: Linus Torvalds Date: Wed Oct 12 11:16:58 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc hotfixes from Andrew Morton: "Five hotfixes - three for nilfs2, two for MM. For are cc:stable, one is not" * tag 'mm-hotfixes-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: nilfs2: fix leak of nilfs_root in case of writer thread creation failure nilfs2: fix NULL pointer dereference at nilfs_bmap_lookup_at_level() nilfs2: fix use-after-free bug of struct nilfs_root mm/damon/core: initialize damon_target->list in damon_new_target() mm/hugetlb: fix races when looking up a CONT-PTE/PMD size hugetlb page commit 676cb4957396411fdb7aba906d5f950fc3de7cc9 Merge: 95b8b5953a315 6a961bffd1c35 Author: Linus Torvalds Date: Wed Oct 12 11:00:22 2022 -0700 Merge tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: - hfs and hfsplus kmap API modernization (Fabio Francesco) - make crash-kexec work properly when invoked from an NMI-time panic (Valentin Schneider) - ntfs bugfixes (Hawkins Jiawei) - improve IPC msg scalability by replacing atomic_t's with percpu counters (Jiebin Sun) - nilfs2 cleanups (Minghao Chi) - lots of other single patches all over the tree! * tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (71 commits) include/linux/entry-common.h: remove has_signal comment of arch_do_signal_or_restart() prototype proc: test how it holds up with mapping'less process mailmap: update Frank Rowand email address ia64: mca: use strscpy() is more robust and safer init/Kconfig: fix unmet direct dependencies ia64: update config files nilfs2: replace WARN_ONs by nilfs_error for checkpoint acquisition failure fork: remove duplicate included header files init/main.c: remove unnecessary (void*) conversions proc: mark more files as permanent nilfs2: remove the unneeded result variable nilfs2: delete unnecessary checks before brelse() checkpatch: warn for non-standard fixes tag style usr/gen_init_cpio.c: remove unnecessary -1 values from int file ipc/msg: mitigate the lock contention with percpu counter percpu: add percpu_counter_add_local and percpu_counter_sub_local fs/ocfs2: fix repeated words in comments relay: use kvcalloc to alloc page array in relay_alloc_page_array proc: make config PROC_CHILDREN depend on PROC_FS fs: uninline inode_maybe_inc_iversion() ... commit 0934ae9977c27133449b6dd8c6213970e7eece38 Author: Steven Rostedt (Google) Date: Wed Oct 12 06:40:58 2022 -0400 tracing: Fix reading strings from synthetic events The follow commands caused a crash: # cd /sys/kernel/tracing # echo 's:open char file[]' > dynamic_events # echo 'hist:keys=common_pid:file=filename:onchange($file).trace(open,$file)' > events/syscalls/sys_enter_openat/trigger' # echo 1 > events/synthetic/open/enable BOOM! The problem is that the synthetic event field "char file[]" will read the value given to it as a string without any memory checks to make sure the address is valid. The above example will pass in the user space address and the sythetic event code will happily call strlen() on it and then strscpy() where either one will cause an oops when accessing user space addresses. Use the helper functions from trace_kprobe and trace_eprobe that can read strings safely (and actually succeed when the address is from user space and the memory is mapped in). Now the above can show: packagekitd-1721 [000] ...2. 104.597170: open: file=/usr/lib/rpm/fileattrs/cmake.attr in:imjournal-978 [006] ...2. 104.599642: open: file=/var/lib/rsyslog/imjournal.state.tmp packagekitd-1721 [000] ...2. 104.626308: open: file=/usr/lib/rpm/fileattrs/debuginfo.attr Link: https://lkml.kernel.org/r/20221012104534.826549315@goodmis.org Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Tom Zanussi Acked-by: Masami Hiramatsu (Google) Reviewed-by: Tom Zanussi Fixes: bd82631d7ccdc ("tracing: Add support for dynamic strings to synthetic events") Signed-off-by: Steven Rostedt (Google) commit 2e9906f84fc7c99388bb7123ade167250d50f1c0 Author: Steven Rostedt (Google) Date: Wed Oct 12 06:40:57 2022 -0400 tracing: Add "(fault)" name injection to kernel probes Have the specific functions for kernel probes that read strings to inject the "(fault)" name directly. trace_probes.c does this too (for uprobes) but as the code to read strings are going to be used by synthetic events (and perhaps other utilities), it simplifies the code by making sure those other uses do not need to implement the "(fault)" name injection as well. Link: https://lkml.kernel.org/r/20221012104534.644803645@goodmis.org Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Tom Zanussi Acked-by: Masami Hiramatsu (Google) Reviewed-by: Tom Zanussi Fixes: bd82631d7ccdc ("tracing: Add support for dynamic strings to synthetic events") Signed-off-by: Steven Rostedt (Google) commit f1d3cbfaafc10464550c6d3a125f4fc802bbaed5 Author: Steven Rostedt (Google) Date: Wed Oct 12 06:40:56 2022 -0400 tracing: Move duplicate code of trace_kprobe/eprobe.c into header The functions: fetch_store_strlen_user() fetch_store_strlen() fetch_store_string_user() fetch_store_string() are identical in both trace_kprobe.c and trace_eprobe.c. Move them into a new header file trace_probe_kernel.h to share it. This code will later be used by the synthetic events as well. Marked for stable as a fix for a crash in synthetic events requires it. Link: https://lkml.kernel.org/r/20221012104534.467668078@goodmis.org Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Tom Zanussi Acked-by: Masami Hiramatsu (Google) Reviewed-by: Tom Zanussi Fixes: bd82631d7ccdc ("tracing: Add support for dynamic strings to synthetic events") Signed-off-by: Steven Rostedt (Google) commit 95b8b5953a315081eadbadf49200e57d7e05aae7 Merge: 60ac35bf6b98f 2c8577f5e455b Author: Linus Torvalds Date: Wed Oct 12 10:35:20 2022 -0700 Merge tag 'loongarch-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch updates from Huacai Chen: - Use EXPLICIT_RELOCS (ABIv2.0) - Use generic BUG() handler - Refactor TLB/Cache operations - Add qspinlock support - Add perf events support - Add kexec/kdump support - Add BPF JIT support - Add ACPI-based laptop driver - Update the default config file * tag 'loongarch-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: (25 commits) LoongArch: Update Loongson-3 default config file LoongArch: Add ACPI-based generic laptop driver LoongArch: Add BPF JIT support LoongArch: Add some instruction opcodes and formats LoongArch: Move {signed,unsigned}_imm_check() to inst.h LoongArch: Add kdump support LoongArch: Add kexec support LoongArch: Use generic BUG() handler LoongArch: Add SysRq-x (TLB Dump) support LoongArch: Add perf events support LoongArch: Add qspinlock support LoongArch: Use TLB for ioremap() LoongArch: Support access filter to /dev/mem interface LoongArch: Refactor cache probe and flush methods LoongArch: mm: Refactor TLB exception handlers LoongArch: Support R_LARCH_GOT_PC_{LO12,HI20} in modules LoongArch: Support PC-relative relocations in modules LoongArch: Define ELF relocation types added in ABIv2.0 LoongArch: Adjust symbol addressing for AS_HAS_EXPLICIT_RELOCS LoongArch: Add Kconfig option AS_HAS_EXPLICIT_RELOCS ... commit 60ac35bf6b98fb87475c2f85f022d5ea737dd68c Merge: 49da070062390 b8d49bcd8fd19 Author: Linus Torvalds Date: Wed Oct 12 10:23:24 2022 -0700 Merge tag 'irq-core-2022-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull interrupt updates from Thomas Gleixner: "Core code: - Provide a generic wrapper which can be utilized in drivers to handle the problem of force threaded demultiplex interrupts on RT enabled kernels. This avoids conditionals and horrible quirks in drivers all over the place - Fix up affected pinctrl and GPIO drivers to make them cleanly RT safe Interrupt drivers: - A new driver for the FSL MU platform specific MSI implementation - Make irqchip_init() available for pure ACPI based systems - Provide a functional DT binding for the Realtek RTL interrupt chip - The usual DT updates and small code improvements all over the place" * tag 'irq-core-2022-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits) irqchip: IMX_MU_MSI should depend on ARCH_MXC irqchip/imx-mu-msi: Fix wrong register offset for 8ulp irqchip/ls-extirq: Fix invalid wait context by avoiding to use regmap dt-bindings: irqchip: Describe the IMX MU block as a MSI controller irqchip: Add IMX MU MSI controller driver dt-bindings: irqchip: renesas,irqc: Add r8a779g0 support irqchip/gic-v3: Fix typo in comment dt-bindings: interrupt-controller: ti,sci-intr: Fix missing reg property in the binding dt-bindings: irqchip: ti,sci-inta: Fix warning for missing #interrupt-cells irqchip: Allow extra fields to be passed to IRQCHIP_PLATFORM_DRIVER_END platform-msi: Export symbol platform_msi_create_irq_domain() irqchip/realtek-rtl: use parent interrupts dt-bindings: interrupt-controller: realtek,rtl-intc: require parents irqchip/realtek-rtl: use irq_domain_add_linear() irqchip: Make irqchip_init() usable on pure ACPI systems bcma: gpio: Use generic_handle_irq_safe() gpio: mlxbf2: Use generic_handle_irq_safe() platform/x86: intel_int0002_vgpio: Use generic_handle_irq_safe() ssb: gpio: Use generic_handle_irq_safe() pinctrl: amd: Use generic_handle_irq_safe() ... commit fc8c2d8ff20651f887e574767533d1176e3a479c Author: Zack Rusin Date: Thu Oct 6 10:33:19 2022 -0400 kbuild: Stop including vmlinux.bz2 in the rpm's vmlinux.bz2 was added to the rpm packages in 2009 in the fc370ecfdb37 ("kbuild: add vmlinux to kernel rpm") but seemingly hasn't been used since. Originally this should have been split up in a seperate debugging package because it massively increases the size of the generated rpm's e.g. kernel rpm built using binrpm-pkg on Fedora 36 default 5.19.8 kernel config and localmodconfig is ~255MB with vmlinux.bz2 and only ~65MB without it. Make the kernel built rpms about 4x smaller by not including the unused vmlinux.bz2 in them. Signed-off-by: Zack Rusin Signed-off-by: Masahiro Yamada commit bb1435f3f575b5213eaf27434efa3971f51c01de Author: Masahiro Yamada Date: Wed Oct 5 01:29:04 2022 +0900 Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT does not give explicit -gdwarf-* flag. The actual DWARF version is up to the toolchain. The combination of GCC and GAS works fine, and Clang with the integrated assembler is good too. The combination of Clang and GAS is tricky, but at least, the -g flag works for Clang <=13, which defaults to DWARF v4. Clang 14 switched its default to DWARF v5. Now, CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT has the same issue as addressed by commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5"). CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y for Clang >= 14 and GAS < 2.35 produces a ton of errors like follows: /tmp/main-c2741c.s: Assembler messages: /tmp/main-c2741c.s:109: Error: junk at end of line, first unrecognized character is `"' /tmp/main-c2741c.s:109: Error: file number less than one Add 'depends on' to check toolchains. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor commit 4f001a21080ff2e2f0e1c3692f5e119aedbb3bc1 Author: Masahiro Yamada Date: Wed Oct 5 01:29:03 2022 +0900 Kconfig.debug: simplify the dependency of DEBUG_INFO_DWARF4/5 Commit c0a5c81ca9be ("Kconfig.debug: drop GCC 5+ version check for DWARF5") could have cleaned up the code a bit more. "CC_IS_CLANG &&" is unneeded. No functional change is intended. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor commit 0e5d5ae837c8ce04d2ddb874ec5f920118bd9d31 Author: D Scott Phillips Date: Mon Oct 10 19:21:40 2022 -0700 arm64: Add AMPERE1 to the Spectre-BHB affected list Per AmpereOne erratum AC03_CPU_12, "Branch history may allow control of speculative execution across software contexts," the AMPERE1 core needs the bhb clearing loop to mitigate Spectre-BHB, with a loop iteration count of 11. Signed-off-by: D Scott Phillips Link: https://lore.kernel.org/r/20221011022140.432370-1-scott@os.amperecomputing.com Reviewed-by: James Morse Signed-off-by: Catalin Marinas commit 06267eb2decaa6baac81bbd882265a8e7782dba4 Author: Palmer Dabbelt Date: Thu Jul 28 14:07:15 2022 -0700 doc: RISC-V: Document that misaligned accesses are supported The RISC-V ISA manual used to mandate that misaligned accesses were supported in user mode, but that requirement was removed in 2018 via riscv-isa-manual commit 61cadb9 ("Provide new description of misaligned load/store behavior compatible with privileged architecture."). Since the Linux uABI was already frozen at that point it's just been demoted to part of the uABI, but that was never written down. Link: https://lore.kernel.org/r/20220728210715.17214-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 0811b9e4530d7c46542a8993ce6b725d042c6154 Author: Aurabindo Pillai Date: Thu Oct 6 17:17:40 2022 -0400 drm/amd/display: Add HUBP surface flip interrupt handler Add the hubp surface flip handler. This fixes some flip timeout issues. Acked-by: Alex Deucher Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 6127dab7a126387744290101514d31b79bb62b8e Author: ChiaEn Wu Date: Wed Oct 12 15:08:14 2022 +0800 dt-bindings: mfd: mt6370: fix the interrupt order of the charger in the example Fix the interrupt order of the charger in the binding example. Fixes: 76f52f815f1a ("dt-bindings: mfd: Add MediaTek MT6370") Signed-off-by: ChiaEn Wu Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/fcf4e7e7594070a8698dc0d4b96e031bcaa9b3a3.1665585952.git.chiaen_wu@richtek.com Signed-off-by: Rob Herring commit 37a3a3278516eae364006d5597f2b9d40580a450 Author: ChiaEn Wu Date: Thu Oct 6 11:16:13 2022 +0800 dt-bindings: leds: mt6370: Fix MT6370 LED indicator DT warning Add '$ref' and 'unevaluatedProperties: false' in 'multi-led', and remove unused 'allOf' property. Fixes: 440c57dabb45 ("dt-bindings: leds: mt6370: Add MediaTek MT6370 current sink type LED indicator") Signed-off-by: ChiaEn Wu Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/435f6888ebc20c5abae63eb9cb3a055b60db2ed1.1665050503.git.chiaen_wu@richtek.com Signed-off-by: Rob Herring commit e237506238352f3bfa9cf3983cdab873e35651eb Author: Nicholas Piggin Date: Wed Oct 12 13:53:34 2022 +1000 powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs powerpc 32-bit system call (and function) calling convention for 64-bit arguments requires the next available odd-pair (two sequential registers with the first being odd-numbered) from the standard register argument allocation. The first argument register is r3, so a 64-bit argument that appears at an even position in the argument list must skip a register (unless there were preceding 64-bit arguments, which might throw things off). This requires non-standard compat definitions to deal with the holes in the argument register allocation. With pt_regs syscall wrappers which use a standard mapper to map pt_regs GPRs to function arguments, 32-bit kernels hit the same basic problem, the standard definitions don't cope with the unused argument registers. Fix this by having 32-bit kernels share those syscall definitions with compat. Thanks to Jason for spending a lot of time finding and bisecting this and developing a trivial reproducer. The perfect bug report. Reported-by: Jason A. Donenfeld Signed-off-by: Nicholas Piggin Fixes: 7e92e01b72452 ("powerpc: Provide syscall wrapper") Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221012035335.866440-1-npiggin@gmail.com commit 3bc429c1e2cf6fa830057c61ae93d483f270b8ff Merge: 24a403340d70a 72e3b8883a36e Author: Jens Axboe Date: Wed Oct 12 07:15:53 2022 -0600 Merge tag 'nvme-6.1-2022-10-12' of git://git.infradead.org/nvme into block-6.1 Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - add NVME_QUIRK_BOGUS_NID for Lexar NM760 (Abhijit) - avoid the deepest sleep state on ZHITAI TiPro5000 SSDs (Xi Ruoyao) - fix possible hang caused during ctrl deletion (Sagi Grimberg) - fix possible hang in live ns resize with ANA access (Sagi Grimberg)" * tag 'nvme-6.1-2022-10-12' of git://git.infradead.org/nvme: nvme-multipath: fix possible hang in live ns resize with ANA access nvme-pci: avoid the deepest sleep state on ZHITAI TiPro5000 SSDs nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM760 nvme-tcp: fix possible hang caused during ctrl deletion nvme-rdma: fix possible hang caused during ctrl deletion commit b7085b6ffe71ac2668f27a2ced6a1e516f66f8c1 Author: Jiapeng Chong Date: Sun Oct 9 10:06:42 2022 +0800 ring-buffer: Fix kernel-doc kernel/trace/ring_buffer.c:895: warning: expecting prototype for ring_buffer_nr_pages_dirty(). Prototype was for ring_buffer_nr_dirty_pages() instead. kernel/trace/ring_buffer.c:5313: warning: expecting prototype for ring_buffer_reset_cpu(). Prototype was for ring_buffer_reset_online_cpus() instead. kernel/trace/ring_buffer.c:5382: warning: expecting prototype for rind_buffer_empty(). Prototype was for ring_buffer_empty() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2340 Link: https://lkml.kernel.org/r/20221009020642.12506-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Steven Rostedt (Google) commit 3a732b46736cd8a29092e4b0b1a9ba83e672bf89 Author: Jeremy Kerr Date: Wed Oct 12 10:08:51 2022 +0800 mctp: prevent double key removal and unref Currently, we have a bug where a simultaneous DROPTAG ioctl and socket close may race, as we attempt to remove a key from lists twice, and perform an unref for each removal operation. This may result in a uaf when we attempt the second unref. This change fixes the race by making __mctp_key_remove tolerant to being called on a key that has already been removed from the socket/net lists, and only performs the unref when we do the actual remove. We also need to hold the list lock on the ioctl cleanup path. This fix is based on a bug report and comprehensive analysis from butt3rflyh4ck , found via syzkaller. Cc: stable@vger.kernel.org Fixes: 63ed1aab3d40 ("mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control") Reported-by: butt3rflyh4ck Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit ed5d1f61b4069c8b91a00ac29cfe1cef324e8bc2 Merge: 739cfa34518ef 6a91e7270936c Author: David S. Miller Date: Wed Oct 12 13:29:07 2022 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florian Westphal says: ==================== netfilter fixes for net This series from Phil Sutter for the *net* tree fixes a problem with a change from the 6.1 development phase: the change to nft_fib should have used the more recent flowic_l3mdev field. Pointed out by Guillaume Nault. This also makes the older iptables module follow the same pattern. Also add selftest case and avoid test failure in nft_fib.sh when the host environment has set rp_filter=1. ==================== Signed-off-by: David S. Miller commit 6a91e7270936c5a504af7e0a197d7021e169d281 Author: Phil Sutter Date: Wed Oct 5 17:34:36 2022 +0200 selftests: netfilter: Fix nft_fib.sh for all.rp_filter=1 If net.ipv4.conf.all.rp_filter is set, it overrides the per-interface setting and thus defeats the fix from bbe4c0896d250 ("selftests: netfilter: disable rp_filter on router"). Unset it as well to cover that case. Fixes: bbe4c0896d250 ("selftests: netfilter: disable rp_filter on router") Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit acc641ab95b66b813c1ce856c377a2bbe71e7f52 Author: Phil Sutter Date: Wed Oct 5 18:07:05 2022 +0200 netfilter: rpfilter/fib: Populate flowic_l3mdev field Use the introduced field for correct operation with VRF devices instead of conditionally overwriting flowic_oif. This is a partial revert of commit b575b24b8eee3 ("netfilter: Fix rpfilter dropping vrf packets by mistake"), implementing a simpler solution. Signed-off-by: Phil Sutter Reviewed-by: David Ahern Reviewed-by: Guillaume Nault Signed-off-by: Florian Westphal commit 6e31ce831c63bd7aec8ff9cc2a6d50ee8c4d4e04 Author: Phil Sutter Date: Wed Oct 5 18:07:04 2022 +0200 selftests: netfilter: Test reverse path filtering Test reverse path (filter) matches in iptables, ip6tables and nftables. Both with a regular interface and a VRF. Signed-off-by: Phil Sutter Reviewed-by: Guillaume Nault Signed-off-by: Florian Westphal commit 30f7d1cac2aab8fec560a388ad31ca5e5d04a822 Author: Zheng Yejian Date: Tue Oct 11 12:03:52 2022 +0000 ftrace: Fix char print issue in print_ip_ins() When ftrace bug happened, following log shows every hex data in problematic ip address: actual: ffffffe8:6b:ffffffd9:01:21 But so many 'f's seem a little confusing, and that is because format '%x' being used to print signed chars in array 'ins'. As suggested by Joe, change to use format "%*phC" to print array 'ins'. After this patch, the log is like: actual: e8:6b:d9:01:21 Link: https://lkml.kernel.org/r/20221011120352.1878494-1-zhengyejian1@huawei.com Fixes: 6c14133d2d3f ("ftrace: Do not blindly read the ip address in ftrace_bug()") Suggested-by: Joe Perches Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 72e3b8883a36e80ebfa41015c7b6926ce31ace05 Author: Sagi Grimberg Date: Thu Sep 29 10:36:47 2022 +0300 nvme-multipath: fix possible hang in live ns resize with ANA access When we revalidate paths as part of ns size change (as of commit e7d65803e2bb), it is possible that during the path revalidation, the only paths that is IO capable (i.e. optimized/non-optimized) are the ones that ns resize was not yet informed to the host, which will cause inflight requests to be requeued (as we have available paths but none are IO capable). These requests on the requeue list are waiting for someone to resubmit them at some point. The IO capable paths will eventually notify the ns resize change to the host, but there is nothing that will kick the requeue list to resubmit the queued requests. Fix this by always kicking the requeue list, and if no IO capable path exists, these requests will be queued again. A typical log that indicates that IOs are requeued: -- nvme nvme1: creating 4 I/O queues. nvme nvme1: new ctrl: "testnqn1" nvme nvme2: creating 4 I/O queues. nvme nvme2: mapped 4/0/0 default/read/poll queues. nvme nvme2: new ctrl: NQN "testnqn1", addr 127.0.0.1:8009 nvme nvme1: rescanning namespaces. nvme1n1: detected capacity change from 2097152 to 4194304 block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O nvme nvme2: rescanning namespaces. -- Reported-by: Yogev Cohen Fixes: e7d65803e2bb ("nvme-multipath: revalidate paths during rescan") Signed-off-by: Sagi Grimberg Cc: # v5.15+ Signed-off-by: Christoph Hellwig commit d5d3c100ac40dcb03959a6f1d2f0f13204c4f145 Author: Xi Ruoyao Date: Wed Sep 28 17:39:13 2022 +0800 nvme-pci: avoid the deepest sleep state on ZHITAI TiPro5000 SSDs ZHITAI TiPro5000 SSDs has the same APST sleep problem as its cousin, TiPro7000. The quirk for TiPro7000 has been added in commit 6b961bce50e4 ("nvme-pci: avoid the deepest sleep state on ZHITAI TiPro7000 SSDs"), use the same quirk for TiPro5000. The ASPT data from "nvme id-ctrl /dev/nvme1": vid : 0x1e49 ssvid : 0x1e49 sn : ZTA21T0KA2227304LM mn : ZHITAI TiPlus5000 1TB fr : ZTA09139 [...] ps 0 : mp:6.50W operational enlat:0 exlat:0 rrt:0 rrl:0 rwt:0 rwl:0 idle_power:- active_power:- ps 1 : mp:5.80W operational enlat:0 exlat:0 rrt:1 rrl:1 rwt:1 rwl:1 idle_power:- active_power:- ps 2 : mp:3.60W operational enlat:0 exlat:0 rrt:2 rrl:2 rwt:2 rwl:2 idle_power:- active_power:- ps 3 : mp:0.0500W non-operational enlat:5000 exlat:10000 rrt:3 rrl:3 rwt:3 rwl:3 idle_power:- active_power:- ps 4 : mp:0.0025W non-operational enlat:8000 exlat:45000 rrt:4 rrl:4 rwt:4 rwl:4 idle_power:- active_power:- Reported-and-tested-by: Chang Feng Signed-off-by: Xi Ruoyao Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 80b2624094c8d369a3c6eab515e8f1564d2e5db2 Author: Abhijit Date: Mon Oct 10 10:30:05 2022 +0200 nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM760 Add a quirk to fix Lexar NM760 SSD drives reporting duplicate nsids. Signed-off-by: Abhijit Signed-off-by: Christoph Hellwig commit c4abd8757189c7ca5803828f9c892328d7d94943 Author: Sagi Grimberg Date: Wed Sep 28 09:23:25 2022 +0300 nvme-tcp: fix possible hang caused during ctrl deletion When we delete a controller, we execute the following: 1. nvme_stop_ctrl() - stop some work elements that may be inflight or scheduled (specifically also .stop_ctrl which cancels ctrl error recovery work) 2. nvme_remove_namespaces() - which first flushes scan_work to avoid competing ns addition/removal 3. continue to teardown the controller However, if err_work was scheduled to run in (1), it is designed to cancel any inflight I/O, particularly I/O that is originating from ns scan_work in (2), but because it is cancelled in .stop_ctrl(), we can prevent forward progress of (2) as ns scanning is blocking on I/O (that will never be cancelled). The race is: 1. transport layer error observed -> err_work is scheduled 2. scan_work executes, discovers ns, generate I/O to it 3. nvme_ctop_ctrl() -> .stop_ctrl() -> cancel_work_sync(err_work) - err_work never executed 4. nvme_remove_namespaces() -> flush_work(scan_work) --> deadlock, because scan_work is blocked on I/O that was supposed to be cancelled by err_work, but was cancelled before executing (see stack trace [1]). Fix this by flushing err_work instead of cancelling it, to force it to execute and cancel all inflight I/O. [1]: -- Call Trace: __schedule+0x390/0x910 ? scan_shadow_nodes+0x40/0x40 schedule+0x55/0xe0 io_schedule+0x16/0x40 do_read_cache_page+0x55d/0x850 ? __page_cache_alloc+0x90/0x90 read_cache_page+0x12/0x20 read_part_sector+0x3f/0x110 amiga_partition+0x3d/0x3e0 ? osf_partition+0x33/0x220 ? put_partition+0x90/0x90 bdev_disk_changed+0x1fe/0x4d0 blkdev_get_whole+0x7b/0x90 blkdev_get_by_dev+0xda/0x2d0 device_add_disk+0x356/0x3b0 nvme_mpath_set_live+0x13c/0x1a0 [nvme_core] ? nvme_parse_ana_log+0xae/0x1a0 [nvme_core] nvme_update_ns_ana_state+0x3a/0x40 [nvme_core] nvme_mpath_add_disk+0x120/0x160 [nvme_core] nvme_alloc_ns+0x594/0xa00 [nvme_core] nvme_validate_or_alloc_ns+0xb9/0x1a0 [nvme_core] ? __nvme_submit_sync_cmd+0x1d2/0x210 [nvme_core] nvme_scan_work+0x281/0x410 [nvme_core] process_one_work+0x1be/0x380 worker_thread+0x37/0x3b0 ? process_one_work+0x380/0x380 kthread+0x12d/0x150 ? set_kthread_struct+0x50/0x50 ret_from_fork+0x1f/0x30 INFO: task nvme:6725 blocked for more than 491 seconds. Not tainted 5.15.65-f0.el7.x86_64 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:nvme state:D stack: 0 pid: 6725 ppid: 1761 flags:0x00004000 Call Trace: __schedule+0x390/0x910 ? sched_clock+0x9/0x10 schedule+0x55/0xe0 schedule_timeout+0x24b/0x2e0 ? try_to_wake_up+0x358/0x510 ? finish_task_switch+0x88/0x2c0 wait_for_completion+0xa5/0x110 __flush_work+0x144/0x210 ? worker_attach_to_pool+0xc0/0xc0 flush_work+0x10/0x20 nvme_remove_namespaces+0x41/0xf0 [nvme_core] nvme_do_delete_ctrl+0x47/0x66 [nvme_core] nvme_sysfs_delete.cold.96+0x8/0xd [nvme_core] dev_attr_store+0x14/0x30 sysfs_kf_write+0x38/0x50 kernfs_fop_write_iter+0x146/0x1d0 new_sync_write+0x114/0x1b0 ? intel_pmu_handle_irq+0xe0/0x420 vfs_write+0x18d/0x270 ksys_write+0x61/0xe0 __x64_sys_write+0x1a/0x20 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x61/0xcb -- Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Reported-by: Jonathan Nicklin Signed-off-by: Sagi Grimberg Tested-by: Jonathan Nicklin Signed-off-by: Christoph Hellwig commit a1ae8d4d9be0178132df7c4931a1ba77d0e76039 Author: Sagi Grimberg Date: Wed Sep 28 09:23:26 2022 +0300 nvme-rdma: fix possible hang caused during ctrl deletion When we delete a controller, we execute the following: 1. nvme_stop_ctrl() - stop some work elements that may be inflight or scheduled (specifically also .stop_ctrl which cancels ctrl error recovery work) 2. nvme_remove_namespaces() - which first flushes scan_work to avoid competing ns addition/removal 3. continue to teardown the controller However, if err_work was scheduled to run in (1), it is designed to cancel any inflight I/O, particularly I/O that is originating from ns scan_work in (2), but because it is cancelled in .stop_ctrl(), we can prevent forward progress of (2) as ns scanning is blocking on I/O (that will never be cancelled). The race is: 1. transport layer error observed -> err_work is scheduled 2. scan_work executes, discovers ns, generate I/O to it 3. nvme_ctop_ctrl() -> .stop_ctrl() -> cancel_work_sync(err_work) - err_work never executed 4. nvme_remove_namespaces() -> flush_work(scan_work) --> deadlock, because scan_work is blocked on I/O that was supposed to be cancelled by err_work, but was cancelled before executing. Fix this by flushing err_work instead of cancelling it, to force it to execute and cancel all inflight I/O. Fixes: b435ecea2a4d ("nvme: Add .stop_ctrl to nvme ctrl ops") Fixes: f6c8e432cb04 ("nvme: flush namespace scanning work just before removing namespaces") Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit a8e5e5146ad08d794c58252bab00b261045ef16d Author: Catalin Marinas Date: Thu Oct 6 17:33:54 2022 +0100 arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored Prior to commit 69e3b846d8a7 ("arm64: mte: Sync tags for pages where PTE is untagged"), mte_sync_tags() was only called for pte_tagged() entries (those mapped with PROT_MTE). Therefore mte_sync_tags() could safely use test_and_set_bit(PG_mte_tagged, &page->flags) without inadvertently setting PG_mte_tagged on an untagged page. The above commit was required as guests may enable MTE without any control at the stage 2 mapping, nor a PROT_MTE mapping in the VMM. However, the side-effect was that any page with a PTE that looked like swap (or migration) was getting PG_mte_tagged set automatically. A subsequent page copy (e.g. migration) copied the tags to the destination page even if the tags were owned by KASAN. This issue was masked by the page_kasan_tag_reset() call introduced in commit e5b8d9218951 ("arm64: mte: reset the page tag in page->flags"). When this commit was reverted (20794545c146), KASAN started reporting access faults because the overriding tags in a page did not match the original page->flags (with CONFIG_KASAN_HW_TAGS=y): BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26 Read at addr f5ff000017f2e000 by task syz-executor.1/2218 Pointer tag: [f5], memory tag: [f2] Move the PG_mte_tagged bit setting from mte_sync_tags() to the actual place where tags are cleared (mte_sync_page_tags()) or restored (mte_restore_tags()). Signed-off-by: Catalin Marinas Reported-by: syzbot+c2c79c6d6eddc5262b77@syzkaller.appspotmail.com Fixes: 69e3b846d8a7 ("arm64: mte: Sync tags for pages where PTE is untagged") Cc: # 5.14.x Cc: Steven Price Cc: Andrey Konovalov Cc: Vincenzo Frascino Cc: Will Deacon Link: https://lore.kernel.org/r/0000000000004387dc05e5888ae5@google.com/ Reviewed-by: Steven Price Link: https://lore.kernel.org/r/20221006163354.3194102-1-catalin.marinas@arm.com Signed-off-by: Catalin Marinas commit d83f7040e18489265b4b121f33f99b02e52dabda Author: Eyal Birger Date: Tue Oct 11 11:01:37 2022 +0300 xfrm: lwtunnel: squelch kernel warning in case XFRM encap type is not available Ido reported that a kernel warning [1] can be triggered from user space when the kernel is compiled with CONFIG_MODULES=y and CONFIG_XFRM=n when adding an xfrm encap type route, e.g: $ ip route add 198.51.100.0/24 dev dummy1 encap xfrm if_id 1 Error: lwt encapsulation type not supported. The reason for the warning is that the LWT infrastructure has an autoloading feature which is meant only for encap types that don't use a net device, which is not the case in xfrm encap. Mute this warning for xfrm encap as there's no encap module to autoload in this case. [1] WARNING: CPU: 3 PID: 2746262 at net/core/lwtunnel.c:57 lwtunnel_valid_encap_type+0x4f/0x120 [...] Call Trace: rtm_to_fib_config+0x211/0x350 inet_rtm_newroute+0x3a/0xa0 rtnetlink_rcv_msg+0x154/0x3c0 netlink_rcv_skb+0x49/0xf0 netlink_unicast+0x22f/0x350 netlink_sendmsg+0x208/0x440 ____sys_sendmsg+0x21f/0x250 ___sys_sendmsg+0x83/0xd0 __sys_sendmsg+0x54/0xa0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Reported-by: Ido Schimmel Fixes: 2c2493b9da91 ("xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode") Signed-off-by: Eyal Birger Tested-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Steffen Klassert commit 3a5913183aa1b14148c723bda030e6102ad73008 Author: Eyal Birger Date: Sun Oct 9 22:16:43 2022 +0300 xfrm: fix "disable_policy" on ipv4 early demux The commit in the "Fixes" tag tried to avoid a case where policy check is ignored due to dst caching in next hops. However, when the traffic is locally consumed, the dst may be cached in a local TCP or UDP socket as part of early demux. In this case the "disable_policy" flag is not checked as ip_route_input_noref() was only called before caching, and thus, packets after the initial packet in a flow will be dropped if not matching policies. Fix by checking the "disable_policy" flag also when a valid dst is already available. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216557 Reported-by: Monil Patel Fixes: e6175a2ed1f1 ("xfrm: fix "disable_policy" flag use when arriving from different devices") Signed-off-by: Eyal Birger ---- v2: use dev instead of skb->dev Signed-off-by: Steffen Klassert commit 2c8577f5e455b149f3ecb24e9a9f48f372a5d71a Author: Huacai Chen Date: Wed Oct 12 16:36:23 2022 +0800 LoongArch: Update Loongson-3 default config file 1, Enable ZBOOT, KEXEC and BPF_JIT; 2, Add more patition types; 3, Add some USB Type-C options; 4, Add some common network options; 5, Add some Bluetooth device drivers; 6, Remove obsolete config options (for some detailed information, see Link). Link: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Co-developed-by: Tiezhu Yang Signed-off-by: Tiezhu Yang Co-developed-by: Youling Tang Signed-off-by: Youling Tang Co-developed-by: Lukas Bulwahn Signed-off-by: Lukas Bulwahn Signed-off-by: Huacai Chen commit 6246ed09111fbb17168619006b4380103c6673c3 Author: Jianmin Lv Date: Wed Oct 12 16:36:20 2022 +0800 LoongArch: Add ACPI-based generic laptop driver This add ACPI-based generic laptop driver for Loongson-3. Some of the codes are derived from drivers/platform/x86/thinkpad_acpi.c. Signed-off-by: Jianmin Lv Signed-off-by: Huacai Chen commit 5dc615520c4dfb358245680f1904bad61116648e Author: Tiezhu Yang Date: Wed Oct 12 16:36:20 2022 +0800 LoongArch: Add BPF JIT support BPF programs are normally handled by a BPF interpreter, add BPF JIT support for LoongArch to allow the kernel to generate native code when a program is loaded into the kernel. This will significantly speed-up processing of BPF programs. Co-developed-by: Youling Tang Signed-off-by: Youling Tang Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 4e59e5a46936dd649208f348ead678c35197203d Author: Tiezhu Yang Date: Wed Oct 12 16:36:19 2022 +0800 LoongArch: Add some instruction opcodes and formats According to the "Table of Instruction Encoding" in LoongArch Reference Manual [1], add some instruction opcodes and formats which are used in the BPF JIT for LoongArch. [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#table-of-instruction-encoding Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 8a34228eb30308f6e223c6f2b87e2381d45056e2 Author: Tiezhu Yang Date: Wed Oct 12 16:36:19 2022 +0800 LoongArch: Move {signed,unsigned}_imm_check() to inst.h {signed,unsigned}_imm_check() will also be used in the bpf jit, so move them from module.c to inst.h, this is preparation for later patches. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 4e62d1d86585e1b62b4f96ee586881dd45a443dc Author: Youling Tang Date: Wed Oct 12 16:36:19 2022 +0800 LoongArch: Add kdump support This patch adds support for kdump. In kdump case the normal kernel will reserve a region for the crash kernel and jump there on panic. Arch-specific functions are added to allow for implementing a crash dump file interface, /proc/vmcore, which can be viewed as a ELF file. A user-space tool, such as kexec-tools, is responsible for allocating a separate region for the core's ELF header within the crash kdump kernel memory and filling it in when executing kexec_load(). Then, its location will be advertised to the crash dump kernel via a command line argument "elfcorehdr=", and the crash dump kernel will preserve this region for later use with arch_reserve_vmcore() at boot time. At the same time, the crash kdump kernel is also limited within the "crashkernel" area via a command line argument "mem=", so as not to destroy the original kernel dump data. In the crash dump kernel environment, /proc/vmcore is used to access the primary kernel's memory with copy_oldmem_page(). I tested kdump on LoongArch machines (Loongson-3A5000) and it works as expected (suggested crashkernel parameter is "crashkernel=512M@2560M"), you may test it by triggering a crash through /proc/sysrq-trigger: $ sudo kexec -p /boot/vmlinux-kdump --reuse-cmdline --append="nr_cpus=1" # echo c > /proc/sysrq-trigger Signed-off-by: Youling Tang Signed-off-by: Huacai Chen commit 4a03b2ac06a5bcae29371866d9d11f5bfd4c9188 Author: Youling Tang Date: Wed Oct 12 16:36:19 2022 +0800 LoongArch: Add kexec support Add three new files, kexec.h, machine_kexec.c and relocate_kernel.S to the LoongArch architecture, so as to add support for the kexec re-boot mechanism (CONFIG_KEXEC) on LoongArch platforms. Kexec supports loading vmlinux.elf in ELF format and vmlinux.efi in PE format. I tested kexec on LoongArch machines (Loongson-3A5000) and it works as expected: $ sudo kexec -l /boot/vmlinux.efi --reuse-cmdline $ sudo kexec -e Signed-off-by: Youling Tang Signed-off-by: Huacai Chen commit 2d2c395217d2233e752dbddcae3c5d94050b48c1 Author: Youling Tang Date: Wed Oct 12 16:36:19 2022 +0800 LoongArch: Use generic BUG() handler Inspired by commit 9fb7410f955("arm64/BUG: Use BRK instruction for generic BUG traps"), do similar for LoongArch to use generic BUG() handler. This patch uses the BREAK software breakpoint instruction to generate a trap instead, similarly to most other arches, with the generic BUG code generating the dmesg boilerplate. This allows bug metadata to be moved to a separate table and reduces the amount of inline code at BUG() and WARN() sites. This also avoids clobbering any registers before they can be dumped. To mitigate the size of the bug table further, this patch makes use of the existing infrastructure for encoding addresses within the bug table as 32-bit relative pointers instead of absolute pointers. (Note: this limits the max kernel size to 2GB.) Before patch: [ 3018.338013] lkdtm: Performing direct entry BUG [ 3018.342445] Kernel bug detected[#5]: [ 3018.345992] CPU: 2 PID: 865 Comm: cat Tainted: G D 6.0.0-rc6+ #35 After patch: [ 125.585985] lkdtm: Performing direct entry BUG [ 125.590433] ------------[ cut here ]------------ [ 125.595020] kernel BUG at drivers/misc/lkdtm/bugs.c:78! [ 125.600211] Oops - BUG[#1]: [ 125.602980] CPU: 3 PID: 410 Comm: cat Not tainted 6.0.0-rc6+ #36 Out-of-line file/line data information obtained compared to before. Signed-off-by: Youling Tang Signed-off-by: Huacai Chen commit dea2df3cc72555633cc7858ce1daa4b757f843ad Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Add SysRq-x (TLB Dump) support Add SysRq-x (TLB Dump) support for LoongArch, which is useful for debugging. Signed-off-by: Huacai Chen commit b37042b2bb7cd751f03b73afb90364a418d870f4 Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Add perf events support The perf events infrastructure of LoongArch is very similar to old MIPS- based Loongson, so most of the codes are derived from MIPS. Signed-off-by: Huacai Chen commit 5f1e001be579c2b7f37e7d5ff87c208c33e90fca Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Add qspinlock support On NUMA system, the performance of qspinlock is better than generic spinlock. Below is the UnixBench test results on a 8 nodes (4 cores per node, 32 cores in total) machine. A. With generic spinlock: System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 449574022.5 38523.9 Double-Precision Whetstone 55.0 85190.4 15489.2 Execl Throughput 43.0 14696.2 3417.7 File Copy 1024 bufsize 2000 maxblocks 3960.0 143157.8 361.5 File Copy 256 bufsize 500 maxblocks 1655.0 37631.8 227.4 File Copy 4096 bufsize 8000 maxblocks 5800.0 444814.2 766.9 Pipe Throughput 12440.0 5047490.7 4057.5 Pipe-based Context Switching 4000.0 2021545.7 5053.9 Process Creation 126.0 23829.8 1891.3 Shell Scripts (1 concurrent) 42.4 33756.7 7961.5 Shell Scripts (8 concurrent) 6.0 4062.9 6771.5 System Call Overhead 15000.0 2479748.6 1653.2 ======== System Benchmarks Index Score 2955.6 B. With qspinlock: System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 449467876.9 38514.8 Double-Precision Whetstone 55.0 85174.6 15486.3 Execl Throughput 43.0 14769.1 3434.7 File Copy 1024 bufsize 2000 maxblocks 3960.0 146150.5 369.1 File Copy 256 bufsize 500 maxblocks 1655.0 37496.8 226.6 File Copy 4096 bufsize 8000 maxblocks 5800.0 447527.0 771.6 Pipe Throughput 12440.0 5175989.2 4160.8 Pipe-based Context Switching 4000.0 2207747.8 5519.4 Process Creation 126.0 25125.5 1994.1 Shell Scripts (1 concurrent) 42.4 33461.2 7891.8 Shell Scripts (8 concurrent) 6.0 4024.7 6707.8 System Call Overhead 15000.0 2917278.6 1944.9 ======== System Benchmarks Index Score 3040.1 Signed-off-by: Rui Wang Signed-off-by: Huacai Chen commit d279134168c78ac2caa1f7cd2a846579da1c93ac Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Use TLB for ioremap() We can support more cache attributes (e.g., CC, SUC and WUC) and page protection when we use TLB for ioremap(). The implementation is based on GENERIC_IOREMAP. The existing simple ioremap() implementation has better performance so we keep it and introduce ARCH_IOREMAP to control the selection. We move pagetable_init() earlier to make early ioremap() works, and we modify the PCI ecam mapping because the TLB-based version of ioremap() will actually take the size into account. Signed-off-by: Huacai Chen commit 235d074fdc9a69e3720b8bb6efeb7c6d30c12d8e Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Support access filter to /dev/mem interface Accidental access to /dev/mem is obviously disastrous, but specific access can be used by people debugging the kernel. So select GENERIC_ LIB_DEVMEM_IS_ALLOWED, as well as define ARCH_HAS_VALID_PHYS_ADDR_RANGE and related helpers, to support access filter to /dev/mem interface. Signed-off-by: Weihao Li Signed-off-by: Huacai Chen commit b61a40afca164a9bd066f749beff3bf209c5e209 Author: Huacai Chen Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Refactor cache probe and flush methods Current cache probe and flush methods have some drawbacks: 1, Assume there are 3 cache levels and only 3 levels; 2, Assume L1 = I + D, L2 = V, L3 = S, V is exclusive, S is inclusive. However, the fact is I + D, I + D + V, I + D + S and I + D + V + S are all valid. So, refactor the cache probe and flush methods to adapt more types of cache hierarchy. Signed-off-by: Huacai Chen commit a2a84e36331af3b000ad12b552c5485b8282b366 Author: Rui Wang Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: mm: Refactor TLB exception handlers This patch simplifies TLB load, store and modify exception handlers: 1. Reduce instructions, such as alu/csr and memory access; 2. Execute tlb search instruction only in the fast path; 3. Return directly from the fast path for both normal and huge pages; 4. Re-tab the assembly for better vertical alignment. And fixes the concurrent modification issue of fast path for huge pages. This issue will occur in the following steps: CPU-1 (In TLB exception) CPU-2 (In THP splitting) 1: Load PMD entry (HUGE=1) 2: Goto huge path 3: Store PMD entry (HUGE=0) 4: Reload PMD entry (HUGE=0) 5: Fill TLB entry (PA is incorrect) This patch also slightly improves the TLB processing performance: * Normal pages: 2.15%, Huge pages: 1.70%. #include #include #include #include int main(int argc, char *argv[]) { size_t page_size; size_t mem_size; size_t off; void *base; int flags; int i; if (argc < 2) { fprintf(stderr, "%s MEM_SIZE [HUGE]\n", argv[0]); return -1; } page_size = sysconf(_SC_PAGESIZE); flags = MAP_PRIVATE | MAP_ANONYMOUS; mem_size = strtoul(argv[1], NULL, 10); if (argc > 2) flags |= MAP_HUGETLB; for (i = 0; i < 10; i++) { base = mmap(NULL, mem_size, PROT_READ, flags, -1, 0); if (base == MAP_FAILED) { fprintf(stderr, "Map memory failed!\n"); return -1; } for (off = 0; off < mem_size; off += page_size) *(volatile int *)(base + off); munmap(base, mem_size); } return 0; } Signed-off-by: Rui Wang Signed-off-by: Huacai Chen commit 59b3d4a9b0cc065a6a88446f8dd9b6d4659cc3df Author: Xi Ruoyao Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Support R_LARCH_GOT_PC_{LO12,HI20} in modules GCC >= 13 and GNU assembler >= 2.40 use these relocations to address external symbols, so we need to add them. Let the module loader emit GOT entries for data symbols so we would be able to handle GOT relocations. The GOT entry is just the data's symbol address. In module.lds, emit a stub .got section for a section header entry. The actual content of the section entry will be filled at runtime by module_ frob_arch_sections(). Tested-by: WANG Xuerui Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 9bd1e38032fb72982d9efe11948037cfa01eaa50 Author: Xi Ruoyao Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Support PC-relative relocations in modules Binutils >= 2.40 uses R_LARCH_B26 instead of R_LARCH_SOP_PUSH_PLT_PCREL, and R_LARCH_PCALA* instead of R_LARCH_SOP_PUSH_PCREL. Handle R_LARCH_B26 and R_LARCH_PCALA* in the module loader. For R_LARCH_ B26, also create a PLT entry as needed. Tested-by: WANG Xuerui Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 0a75e5d1a1845db94b9c462e7b0ee755642febfe Author: Xi Ruoyao Date: Wed Oct 12 16:36:14 2022 +0800 LoongArch: Define ELF relocation types added in ABIv2.0 These relocation types are used by GNU binutils >= 2.40 and GCC >= 13. Add their definitions so we will be able to use them in later patches. Link: https://github.com/loongson/LoongArch-Documentation/pull/57 Tested-by: WANG Xuerui Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 11cd8a648301af0ad6937ed9493519d1e93fd4c8 Author: Xi Ruoyao Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Adjust symbol addressing for AS_HAS_EXPLICIT_RELOCS If explicit relocation hints are used by the toolchain, -Wa,-mla-* options will be useless for the C code. So only use them for the !CONFIG_AS_HAS_EXPLICIT_RELOCS case. Replace "la" with "la.pcrel" in head.S to keep the semantic consistent with new and old toolchains for the low level startup code. For per-CPU variables, the "address" of the symbol is actually an offset from $r21. The value is near the loading address of main kernel image, but far from the loading address of modules. So we use model("extreme") attibute to tell the compiler that a PC-relative addressing with 32-bit offset is not sufficient for local per-CPU variables. The behavior with different assemblers and compilers are summarized in the following table: AS has CC has explicit relocs explicit relocs * Behavior ============================================================== No No Use la.* macros. No change from Linux 6.0. -------------------------------------------------------------- No Yes Disable explicit relocs. No change from Linux 6.0. -------------------------------------------------------------- Yes No Not supported. -------------------------------------------------------------- Yes Yes Enable explicit relocs. No -Wa,-mla* options used. ============================================================== *: We assume CC must have model attribute if it has explicit relocs. Both features are added in GCC 13 development cycle, so any GCC release >= 13 should be OK. Using early GCC 13 development snapshots may produce modules with unsupported relocations. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f09482a Link: https://gcc.gnu.org/r13-1834 Link: https://gcc.gnu.org/r13-2199 Tested-by: WANG Xuerui Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 0d8dad7048611e5ba02ae8519539ce4b8b1482d3 Author: Xi Ruoyao Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Add Kconfig option AS_HAS_EXPLICIT_RELOCS GNU as >= 2.40 and GCC >= 13 will support using explicit relocation hints in the assembly code, instead of la.* macros. The usage of explicit relocation hints can improve code generation so it's enabled by default by GCC >= 13. Introduce a Kconfig option AS_HAS_EXPLICIT_RELOCS as the switch for "use explicit relocation hints or not". Tested-by: WANG Xuerui Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 9550dfde5eb83558c9c21f664d9b622a26bacf7d Author: Colin Ian King Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Kconfig: Fix spelling mistake "delibrately" -> "deliberately" There is a spelling mistake in a commented section. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Huacai Chen commit ddf502717da029c9f065ade7e9bce90a1890e7df Author: Huacai Chen Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Mark __xchg() and __cmpxchg() as __always_inline Commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") allows compiler to uninline functions marked as 'inline'. In case of __xchg()/__cmpxchg() this would cause to reference BUILD_BUG(), which is an error case for catching bugs and will not happen for correct code, if __xchg()/__cmpxchg() is inlined. This bug can be produced with CONFIG_DEBUG_SECTION_MISMATCH enabled, and the solution is similar to below commits: 46f1619500d0225 ("MIPS: include: Mark __xchg as __always_inline"), 88356d09904bc60 ("MIPS: include: Mark __cmpxchg as __always_inline"). Acked-by: Arnd Bergmann Signed-off-by: Huacai Chen commit 1299a129a9f927433ba792b242c1f287a96059e7 Author: Huacai Chen Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Flush TLB earlier at initialization Move local_flush_tlb_all() earlier (just after setup_ptwalker() and before page allocation). This can avoid stale TLB entries misguiding the later page allocation. Without this patch the second kernel of kexec/kdump fails to boot SMP. BTW, move output_pgtable_bits_defines() into tlb_init() since it has nothing to do with tlb handler setup. Signed-off-by: Huacai Chen commit a522b7ad8e66fd9021d354844c1c6bd7893bde6f Author: Tiezhu Yang Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Do not create sysfs control file for io master CPUs Now io master CPUs are not hotpluggable on LoongArch, but in the current code only /sys/devices/system/cpu/cpu0/online is not created. Let us set the hotpluggable field of all the io master CPUs as 0, then prevent to create sysfs control file for all the io master CPUs which confuses some user space tools. This is similar with commit 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable"). Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 4b2edd38282a42742d8f2039767fa4f1919330f0 Author: Jianmin Lv Date: Wed Oct 12 16:36:08 2022 +0800 LoongArch: Fix cpu name after CPU-hotplug Don't overwrite the SMBIOS-provided CPU name on coming back from CPU- hotplug (including S3/S4) if it is already initialized. Reviewed-by: WANG Xuerui Signed-off-by: Jianmin Lv Signed-off-by: Huacai Chen commit 739cfa34518ef3a6789f5f77239073972a387359 Author: Leon Romanovsky Date: Tue Oct 11 16:14:55 2022 +0300 net/mlx5: Make ASO poll CQ usable in atomic context Poll CQ functions shouldn't sleep as they are called in atomic context. The following splat appears once the mlx5_aso_poll_cq() is used in such flow. BUG: scheduling while atomic: swapper/17/0/0x00000100 Modules linked in: sch_ingress openvswitch nsh mlx5_vdpa vringh vhost_iotlb vdpa mlx5_ib mlx5_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter overlay rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm ib_uverbs ib_core fuse [last unloaded: mlx5_core] CPU: 17 PID: 0 Comm: swapper/17 Tainted: G W 6.0.0-rc2+ #13 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x34/0x44 __schedule_bug.cold+0x47/0x53 __schedule+0x4b6/0x670 ? hrtimer_start_range_ns+0x28d/0x360 schedule+0x50/0x90 schedule_hrtimeout_range_clock+0x98/0x120 ? __hrtimer_init+0xb0/0xb0 usleep_range_state+0x60/0x90 mlx5_aso_poll_cq+0xad/0x190 [mlx5_core] mlx5e_ipsec_aso_update_curlft+0x81/0xb0 [mlx5_core] xfrm_timer_handler+0x6b/0x360 ? xfrm_find_acq_byseq+0x50/0x50 __hrtimer_run_queues+0x139/0x290 hrtimer_run_softirq+0x7d/0xe0 __do_softirq+0xc7/0x272 irq_exit_rcu+0x87/0xb0 sysvec_apic_timer_interrupt+0x72/0x90 asm_sysvec_apic_timer_interrupt+0x16/0x20 RIP: 0010:default_idle+0x18/0x20 Code: ae 7d ff ff cc cc cc cc cc cc cc cc cc cc cc cc cc cc 0f 1f 44 00 00 8b 05 b5 30 0d 01 85 c0 7e 07 0f 00 2d 0a e3 53 00 fb f4 0f 1f 80 00 00 00 00 0f 1f 44 00 00 65 48 8b 04 25 80 ad 01 00 RSP: 0018:ffff888100883ee0 EFLAGS: 00000242 RAX: 0000000000000001 RBX: ffff888100849580 RCX: 4000000000000000 RDX: 0000000000000001 RSI: 0000000000000083 RDI: 000000000008863c RBP: 0000000000000011 R08: 00000064e6977fa9 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 default_idle_call+0x37/0xb0 do_idle+0x1cd/0x1e0 cpu_startup_entry+0x19/0x20 start_secondary+0xfe/0x120 secondary_startup_64_no_verify+0xcd/0xdb softirq: huh, entered softirq 8 HRTIMER 00000000a97c08cb with preempt_count 00000100, exited with 00000000? Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit b8d49bcd8fd19824888c766a217891855d8692ad Merge: 36de4f9419731 6c9f7434159b9 Author: Thomas Gleixner Date: Wed Oct 12 10:14:09 2022 +0200 Merge tag 'irqchip-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip fixes from Marc Zyngier: - Fix IMX-MU Kconfig, keeping it private to IMX - Fix a register offset for the same IMX-MU driver - Fix the ls-extirq irqchip driver that would use the wrong flavour of spinlocks Link: https://lore.kernel.org/r/20221012075125.1244143-1-maz@kernel.org commit 72e560cb8c6f80fc2b4afc5d3634a32465e13a51 Author: Eric Dumazet Date: Tue Oct 11 15:07:48 2022 -0700 tcp: cdg: allow tcp_cdg_release() to be called multiple times Apparently, mptcp is able to call tcp_disconnect() on an already disconnected flow. This is generally fine, unless current congestion control is CDG, because it might trigger a double-free [1] Instead of fixing MPTCP, and future bugs, we can make tcp_disconnect() more resilient. [1] BUG: KASAN: double-free in slab_free mm/slub.c:3539 [inline] BUG: KASAN: double-free in kfree+0xe2/0x580 mm/slub.c:4567 CPU: 0 PID: 3645 Comm: kworker/0:7 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: events mptcp_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report_invalid_free+0x81/0x190 mm/kasan/report.c:462 ____kasan_slab_free+0x18b/0x1c0 mm/kasan/common.c:356 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 tcp_disconnect+0x980/0x1e20 net/ipv4/tcp.c:3145 __mptcp_close_ssk+0x5ca/0x7e0 net/mptcp/protocol.c:2327 mptcp_do_fastclose net/mptcp/protocol.c:2592 [inline] mptcp_worker+0x78c/0xff0 net/mptcp/protocol.c:2627 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3671: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_array include/linux/slab.h:640 [inline] kcalloc include/linux/slab.h:671 [inline] tcp_cdg_init+0x10d/0x170 net/ipv4/tcp_cdg.c:380 tcp_init_congestion_control+0xab/0x550 net/ipv4/tcp_cong.c:193 tcp_reinit_congestion_control net/ipv4/tcp_cong.c:217 [inline] tcp_set_congestion_control+0x96c/0xaa0 net/ipv4/tcp_cong.c:391 do_tcp_setsockopt+0x505/0x2320 net/ipv4/tcp.c:3513 tcp_setsockopt+0xd4/0x100 net/ipv4/tcp.c:3801 mptcp_setsockopt+0x35f/0x2570 net/mptcp/sockopt.c:844 __sys_setsockopt+0x2d6/0x690 net/socket.c:2252 __do_sys_setsockopt net/socket.c:2263 [inline] __se_sys_setsockopt net/socket.c:2260 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2260 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 16: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 tcp_cleanup_congestion_control+0x70/0x120 net/ipv4/tcp_cong.c:226 tcp_v4_destroy_sock+0xdd/0x750 net/ipv4/tcp_ipv4.c:2254 tcp_v6_destroy_sock+0x11/0x20 net/ipv6/tcp_ipv6.c:1969 inet_csk_destroy_sock+0x196/0x440 net/ipv4/inet_connection_sock.c:1157 tcp_done+0x23b/0x340 net/ipv4/tcp.c:4649 tcp_rcv_state_process+0x40e7/0x4990 net/ipv4/tcp_input.c:6624 tcp_v6_do_rcv+0x3fc/0x13c0 net/ipv6/tcp_ipv6.c:1525 tcp_v6_rcv+0x2e8e/0x3830 net/ipv6/tcp_ipv6.c:1759 ip6_protocol_deliver_rcu+0x2db/0x1950 net/ipv6/ip6_input.c:439 ip6_input_finish+0x14c/0x2c0 net/ipv6/ip6_input.c:484 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:493 dst_input include/net/dst.h:455 [inline] ip6_rcv_finish+0x193/0x2c0 net/ipv6/ip6_input.c:79 ip_sabotage_in net/bridge/br_netfilter_hooks.c:874 [inline] ip_sabotage_in+0x1fa/0x260 net/bridge/br_netfilter_hooks.c:865 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xc5/0x1f0 net/netfilter/core.c:614 nf_hook.constprop.0+0x3ac/0x650 include/linux/netfilter.h:257 NF_HOOK include/linux/netfilter.h:300 [inline] ipv6_rcv+0x9e/0x380 net/ipv6/ip6_input.c:309 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5485 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5599 netif_receive_skb_internal net/core/dev.c:5685 [inline] netif_receive_skb+0x12f/0x8d0 net/core/dev.c:5744 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] br_pass_frame_up+0x303/0x410 net/bridge/br_input.c:68 br_handle_frame_finish+0x909/0x1aa0 net/bridge/br_input.c:199 br_nf_hook_thresh+0x2f8/0x3d0 net/bridge/br_netfilter_hooks.c:1041 br_nf_pre_routing_finish_ipv6+0x695/0xef0 net/bridge/br_netfilter_ipv6.c:207 NF_HOOK include/linux/netfilter.h:302 [inline] br_nf_pre_routing_ipv6+0x417/0x7c0 net/bridge/br_netfilter_ipv6.c:237 br_nf_pre_routing+0x1496/0x1fe0 net/bridge/br_netfilter_hooks.c:507 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_bridge_pre net/bridge/br_input.c:255 [inline] br_handle_frame+0x9c9/0x12d0 net/bridge/br_input.c:399 __netif_receive_skb_core+0x9fe/0x38f0 net/core/dev.c:5379 __netif_receive_skb_one_core+0xae/0x180 net/core/dev.c:5483 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5599 process_backlog+0x3a0/0x7c0 net/core/dev.c:5927 __napi_poll+0xb3/0x6d0 net/core/dev.c:6494 napi_poll net/core/dev.c:6561 [inline] net_rx_action+0x9c1/0xd90 net/core/dev.c:6672 __do_softirq+0x1d0/0x9c8 kernel/softirq.c:571 Fixes: 2b0a8c9eee81 ("tcp: add CDG congestion control") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 4a4462a06b18c9e013d6b94ccf4aea2a1e570de2 Merge: 7e777b1b012e9 0d24148bd276e Author: David S. Miller Date: Wed Oct 12 09:10:02 2022 +0100 Merge branch 'inet-ping-fixes' Eric Dumazet says: ==================== inet: ping: give ping some care First patch fixes an ipv6 ping bug that has been there forever, for large sizes. Second patch fixes a recent and elusive bug, that can potentially crash the host. This is what I mentioned privately to Paolo and Jakub at LPC in Dublin. ==================== Signed-off-by: David S. Miller commit 0d24148bd276ead5708ef56a4725580555bb48a3 Author: Eric Dumazet Date: Tue Oct 11 14:27:29 2022 -0700 inet: ping: fix recent breakage Blamed commit broke the assumption used by ping sendmsg() that allocated skb would have MAX_HEADER bytes in skb->head. This patch changes the way ping works, by making sure the skb head contains space for the icmp header, and adjusting ping_getfrag() which was desperate about going past the icmp header :/ This is adopting what UDP does, mostly. syzbot is able to crash a host using both kfence and following repro in a loop. fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6) connect(fd, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28 sendmsg(fd, {msg_name=NULL, msg_namelen=0, msg_iov=[ {iov_base="\200\0\0\0\23\0\0\0\0\0\0\0\0\0"..., iov_len=65496}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0 When kfence triggers, skb->head only has 64 bytes, immediately followed by struct skb_shared_info (no extra headroom based on ksize(ptr)) Then icmpv6_push_pending_frames() is overwriting first bytes of skb_shinfo(skb), making nr_frags bigger than MAX_SKB_FRAGS, and/or setting shinfo->gso_size to a non zero value. If nr_frags is mangled, a crash happens in skb_release_data() If gso_size is mangled, we have the following report: lo: caps=(0x00000516401d7c69, 0x00000516401d7c69) WARNING: CPU: 0 PID: 7548 at net/core/dev.c:3239 skb_warn_bad_offload+0x119/0x230 net/core/dev.c:3239 Modules linked in: CPU: 0 PID: 7548 Comm: syz-executor268 Not tainted 6.0.0-syzkaller-02754-g557f050166e5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 RIP: 0010:skb_warn_bad_offload+0x119/0x230 net/core/dev.c:3239 Code: 70 03 00 00 e8 58 c3 24 fa 4c 8d a5 e8 00 00 00 e8 4c c3 24 fa 4c 89 e9 4c 89 e2 4c 89 f6 48 c7 c7 00 53 f5 8a e8 13 ac e7 01 <0f> 0b 5b 5d 41 5c 41 5d 41 5e e9 28 c3 24 fa e8 23 c3 24 fa 48 89 RSP: 0018:ffffc9000366f3e8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff88807a9d9d00 RCX: 0000000000000000 RDX: ffff8880780c0000 RSI: ffffffff8160f6f8 RDI: fffff520006cde6f RBP: ffff888079952000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000400 R11: 0000000000000000 R12: ffff8880799520e8 R13: ffff88807a9da070 R14: ffff888079952000 R15: 0000000000000000 FS: 0000555556be6300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010000 CR3: 000000006eb7b000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: gso_features_check net/core/dev.c:3521 [inline] netif_skb_features+0x83e/0xb90 net/core/dev.c:3554 validate_xmit_skb+0x2b/0xf10 net/core/dev.c:3659 __dev_queue_xmit+0x998/0x3ad0 net/core/dev.c:4248 dev_queue_xmit include/linux/netdevice.h:3008 [inline] neigh_hh_output include/net/neighbour.h:530 [inline] neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0xf97/0x1520 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x690/0x1160 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1ed/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:445 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:161 ip6_send_skb+0xb7/0x340 net/ipv6/ip6_output.c:1966 ip6_push_pending_frames+0xdd/0x100 net/ipv6/ip6_output.c:1986 icmpv6_push_pending_frames+0x2af/0x490 net/ipv6/icmp.c:303 ping_v6_sendmsg+0xc44/0x1190 net/ipv6/ping.c:190 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f21aab42b89 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff1729d038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f21aab42b89 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d R10: 000000000000000d R11: 0000000000000246 R12: 00007fff1729d050 R13: 00000000000f4240 R14: 0000000000021dd1 R15: 00007fff1729d044 Fixes: 47cf88993c91 ("net: unify alloclen calculation for paged requests") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Pavel Begunkov Cc: Lorenzo Colitti Cc: Willem de Bruijn Cc: Maciej Żenczykowski Signed-off-by: David S. Miller commit 87445f369cca2965620e79f87145d3d7fa35befd Author: Eric Dumazet Date: Tue Oct 11 14:27:28 2022 -0700 ipv6: ping: fix wrong checksum for large frames For a given ping datagram, ping_getfrag() is called once per skb fragment. A large datagram requiring more than one page fragment is currently getting the checksum of the last fragment, instead of the cumulative one. After this patch, "ping -s 35000 ::1" is working correctly. Fixes: 6d0bfe226116 ("net: ipv6: Add IPv6 support to the ping socket.") Signed-off-by: Eric Dumazet Cc: Lorenzo Colitti Cc: Maciej Żenczykowski Signed-off-by: David S. Miller commit 7e777b1b012e977cfd04347fb347f3f5d097f99e Author: Matthias Schiffer Date: Tue Oct 11 09:50:02 2022 +0200 net: ethernet: ti: am65-cpsw: set correct devlink flavour for unused ports am65_cpsw_nuss_register_ndevs() skips calling devlink_port_type_eth_set() for ports without assigned netdev, triggering the following warning when DEVLINK_PORT_TYPE_WARN_TIMEOUT elapses after 3600s: Type was not set for devlink port. WARNING: CPU: 0 PID: 129 at net/core/devlink.c:8095 devlink_port_type_warn+0x18/0x30 Fixes: 0680e20af5fb ("net: ethernet: ti: am65-cpsw: Fix devlink port register sequence") Signed-off-by: Matthias Schiffer Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b675d4bdfefac2fd46838383ecb3c06ad0f4c94d Author: Yosry Ahmed Date: Tue Oct 11 22:51:55 2022 +0000 mm: cgroup: fix comments for get from fd/file helpers Fix the documentation comments for cgroup_[v1v2_]get_from_[fd/file](). Reported-by: kernel test robot Signed-off-by: Yosry Ahmed Signed-off-by: Tejun Heo commit e25b091bed4946078c0998e4be77bc56824a9adf Author: Uwe Kleine-König Date: Sat Oct 8 19:46:02 2022 +0200 watchdog: Add tracing events for the most usual watchdog events To simplify debugging which process touches a watchdog and when, add tracing events for .start(), .set_timeout(), .ping() and .stop(). Signed-off-by: Uwe Kleine-König Reviewed-by: Steven Rostedt (Google) Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20221008174602.3972859-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6c9f7434159b96231f5b27ab938f4766e3586b48 Author: Geert Uytterhoeven Date: Tue Oct 4 18:22:30 2022 +0200 irqchip: IMX_MU_MSI should depend on ARCH_MXC The Freescale/NXP i.MX Messaging Unit is only present on Freescale/NXP i.MX SoCs. Hence add a dependency on ARCH_MXC, to prevent asking the user about this driver when configuring a kernel without Freescale/NXP i.MX SoC family support. While at it, expand "MU" to "Messaging Unit" in the help text. Fixes: 70afdab904d2d1e6 ("irqchip: Add IMX MU MSI controller driver") Signed-off-by: Geert Uytterhoeven Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/7f3bd932614ddbff46a1b750ef45b231130364ad.1664900434.git.geert+renesas@glider.be commit 7880672bdc975daa586e8256714d9906d30c615e Author: Colin Ian King Date: Fri Oct 7 21:35:00 2022 +0100 xen: Kconfig: Fix spelling mistake "Maxmium" -> "Maximum" There is a spelling mistake in a Kconfig description. Fix it. Signed-off-by: Colin Ian King Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/20221007203500.2756787-1-colin.i.king@gmail.com Signed-off-by: Juergen Gross commit 88672826e2a465d2f4c0a50fb5ced2956f4ffcbc Author: Stefan Binding Date: Tue Oct 11 15:35:52 2022 +0100 ALSA: hda: cs35l41: Support System Suspend Add support for system suspend into the CS35L41 HDA Driver. Since S4 suspend may power off the system, it is required that the driver ensure the part is safe to be shutdown before system suspend, as well as ensuring that the firmware is unloaded before shutdown. The part must then be restored on system resume, including re-downloading the firmware. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20221011143552.621792-6-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 23904f7b2518e9b6bbfe2ac7bbe9e284bcdda18e Author: Stefan Binding Date: Tue Oct 11 15:35:51 2022 +0100 ALSA: hda: cs35l41: Remove suspend/resume hda hooks The current code uses calls from the HDA Codec driver to determine when to suspend/resume by calling hooks via the hda_component binding. However, this means the cs35l41 driver relies on the HDA Codec driver to tell it when to suspend or resume, creating an additional external dependency, and potentially creating race conditions in the future. It is better for the cs35l41 hda driver to decide for itself when the part should be suspended or resumed. This makes supporting system suspend easier. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20221011143552.621792-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2176c6b599dba55a640cffec0182c0b6bab680d1 Author: Richard Fitzgerald Date: Tue Oct 11 15:35:50 2022 +0100 ALSA: hda/cs_dsp_ctl: Fix mutex inversion when creating controls Redesign the creation of ALSA controls so that the cs_dsp pwr_lock is not held when calling snd_ctl_add(). Instead of creating the ALSA control from the cs_dsp control_add callback, do it after cs_dsp_power_up() has completed. The existing functions are changed to return void instead of passing errors back - this duplicates the original behaviour, as cs_dsp does not abort firmware load if creation of a control fails. It is safe to walk the control list without taking any mutex provided that the caller is not trying to load a new firmware or remove the driver in parallel. There is no other situation that the list can change. So the caller can trigger creation of ALSA controls after cs_dsp_power_up() has returned. A cs_dsp control will have a non-NULL priv pointer if we have created an ALSA control. With the previous code the ALSA controls were created from the cs_dsp control_add callback. But this is called with pwr_lock held (as it is part of the DSP power-up sequence). The kernel lock checking will show a mutex inversion between this and the control creation path: control_add pwr_lock held, takes controls_rwsem (in snd_ctl_add) get/put controls_rwsem held, takes pwr_lock to call cs_dsp. This is not completely theoretical. Although the time window is very small, it is possible for these to run in parallel and deadlock the old implementation. Signed-off-by: Richard Fitzgerald Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20221011143552.621792-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 06f3a0a758c4246dc644e22fb33f85c6e5f92af6 Author: Stefan Binding Date: Tue Oct 11 15:35:49 2022 +0100 ALSA: hda: hda_cs_dsp_ctl: Ensure pwr_lock is held before reading/writing controls These apis require the pwr_lock to be held. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20221011143552.621792-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 49b0dea1eb5e0fd5e498a2c2ce50d2e036494072 Author: Stefan Binding Date: Tue Oct 11 15:35:48 2022 +0100 ALSA: hda: hda_cs_dsp_ctl: Minor clean and redundant code removal The cs_dsp core will return an error if passed a NULL cs_dsp struct so there is no need for the hda_cs_dsp_write|read_ctl functions to manually check that. The cs_dsp core will also check the data is within bounds of the control so the additional bounds check is redundant too. Simplify things a bit by removing said code. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20221011143552.621792-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit d6fe5887ca891f5a7a3998bcbeccd6ec2e215132 Merge: bafaf67c42f4b cdf6428dd5184 Author: Dave Airlie Date: Wed Oct 12 14:20:59 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-10-06-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Round to closest in g4x+ HDMI clock readout (Ville Syrjälä) - Update MOCS table for EHL (Tejas Upadhyay) - Fix PSR_IMR/IIR field handling (Jouni Högander) - Fix watermark calculations for gen12+ RC CCS modifier (Ville Syrjälä) - Fix watermark calculations for gen12+ MC CCS modifier (Ville Syrjälä) - Fix watermark calculations for gen12+ CCS+CC modifier (Ville Syrjälä) - Fix watermark calculations for DG2 CCS modifiers (Ville Syrjälä) - Fix watermark calculations for DG2 CCS+CC modifier (Ville Syrjälä) - Reject excessive dotclocks early (Ville Syrjälä) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Yz6rkXI9HKFUvtWK@tursulin-desk commit 49da070062390094112b423ba443ea193527b2e4 Merge: f311d498be8f1 3e4519b7afc2f Author: Linus Torvalds Date: Tue Oct 11 20:48:55 2022 -0700 Merge tag 'memblock-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock updates from Mike Rapoport: "Test suite improvements: - Added verification that memblock allocations zero the allocated memory - Added more test cases for memblock_add(), memblock_remove(), memblock_reserve() and memblock_free() - Added tests for memblock_*_raw() family - Added tests for NUMA-aware allocations in memblock_alloc_try_nid() and memblock_alloc_try_nid_raw()" * tag 'memblock-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock tests: add generic NUMA tests for memblock_alloc_try_nid* memblock tests: add bottom-up NUMA tests for memblock_alloc_try_nid* memblock tests: add top-down NUMA tests for memblock_alloc_try_nid* memblock tests: add simulation of physical memory with multiple NUMA nodes memblock_tests: move variable declarations to single block memblock tests: remove 'cleared' from comment blocks memblock tests: add tests for memblock_trim_memory memblock tests: add tests for memblock_*bottom_up functions memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw memblock tests: update alloc_api to test memblock_alloc_raw memblock tests: add additional tests for basic api and memblock_alloc memblock tests: add labels to verbose output for generic alloc tests memblock tests: update zeroed memory check for memblock_alloc_* tests memblock tests: update tests to check if memblock_alloc zeroed memory memblock tests: update reference to obsolete build option in comments memblock tests: add command line help option commit f311d498be8f1aa49d5cfca0b18d6db4f77845b7 Merge: d465bff130bf4 e18d6152ff0f4 Author: Linus Torvalds Date: Tue Oct 11 20:07:44 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull more kvm updates from Paolo Bonzini: "The main batch of ARM + RISC-V changes, and a few fixes and cleanups for x86 (PMU virtualization and selftests). ARM: - Fixes for single-stepping in the presence of an async exception as well as the preservation of PSTATE.SS - Better handling of AArch32 ID registers on AArch64-only systems - Fixes for the dirty-ring API, allowing it to work on architectures with relaxed memory ordering - Advertise the new kvmarm mailing list - Various minor cleanups and spelling fixes RISC-V: - Improved instruction encoding infrastructure for instructions not yet supported by binutils - Svinval support for both KVM Host and KVM Guest - Zihintpause support for KVM Guest - Zicbom support for KVM Guest - Record number of signal exits as a VCPU stat - Use generic guest entry infrastructure x86: - Misc PMU fixes and cleanups. - selftests: fixes for Hyper-V hypercall - selftests: fix nx_huge_pages_test on TDP-disabled hosts - selftests: cleanups for fix_hypercall_test" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (57 commits) riscv: select HAVE_POSIX_CPU_TIMERS_TASK_WORK RISC-V: KVM: Use generic guest entry infrastructure RISC-V: KVM: Record number of signal exits as a vCPU stat RISC-V: KVM: add __init annotation to riscv_kvm_init() RISC-V: KVM: Expose Zicbom to the guest RISC-V: KVM: Provide UAPI for Zicbom block size RISC-V: KVM: Make ISA ext mappings explicit RISC-V: KVM: Allow Guest use Zihintpause extension RISC-V: KVM: Allow Guest use Svinval extension RISC-V: KVM: Use Svinval for local TLB maintenance when available RISC-V: Probe Svinval extension form ISA string RISC-V: KVM: Change the SBI specification version to v1.0 riscv: KVM: Apply insn-def to hlv encodings riscv: KVM: Apply insn-def to hfence encodings riscv: Introduce support for defining instructions riscv: Add X register names to gpr-nums KVM: arm64: Advertise new kvmarm mailing list kvm: vmx: keep constant definition format consistent kvm: mmu: fix typos in struct kvm_arch KVM: selftests: Fix nx_huge_pages_test on TDP-disabled hosts ... commit 10f6913c548b32ecb73801a16b120e761c6957ea Author: Wenting Zhang Date: Fri Jul 8 16:38:22 2022 -0400 riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb When CONFIG_CMDLINE_FORCE is enabled, cmdline provided by CONFIG_CMDLINE are always used. This allows CONFIG_CMDLINE to be used regardless of the result of device tree scanning. This especially fixes the case where a device tree without the chosen node is supplied to the kernel. In such cases, early_init_dt_scan would return true. But inside early_init_dt_scan_chosen, the cmdline won't be updated as there is no chosen node in the device tree. As a result, CONFIG_CMDLINE is not copied into boot_command_line even if CONFIG_CMDLINE_FORCE is enabled. This commit allows properly update boot_command_line in this situation. Fixes: 8fd6e05c7463 ("arch: riscv: support kernel command line forcing when no DTB passed") Signed-off-by: Wenting Zhang Reviewed-by: Björn Töpel Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/PSBPR04MB399135DFC54928AB958D0638B1829@PSBPR04MB3991.apcprd04.prod.outlook.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit d0d51a97063db4704a5ef6bc978dddab1636a306 Author: Ryusuke Konishi Date: Fri Oct 7 17:52:26 2022 +0900 nilfs2: fix leak of nilfs_root in case of writer thread creation failure If nilfs_attach_log_writer() failed to create a log writer thread, it frees a data structure of the log writer without any cleanup. After commit e912a5b66837 ("nilfs2: use root object to get ifile"), this causes a leak of struct nilfs_root, which started to leak an ifile metadata inode and a kobject on that struct. In addition, if the kernel is booted with panic_on_warn, the above ifile metadata inode leak will cause the following panic when the nilfs2 kernel module is removed: kmem_cache_destroy nilfs2_inode_cache: Slab cache still has objects when called from nilfs_destroy_cachep+0x16/0x3a [nilfs2] WARNING: CPU: 8 PID: 1464 at mm/slab_common.c:494 kmem_cache_destroy+0x138/0x140 ... RIP: 0010:kmem_cache_destroy+0x138/0x140 Code: 00 20 00 00 e8 a9 55 d8 ff e9 76 ff ff ff 48 8b 53 60 48 c7 c6 20 70 65 86 48 c7 c7 d8 69 9c 86 48 8b 4c 24 28 e8 ef 71 c7 00 <0f> 0b e9 53 ff ff ff c3 48 81 ff ff 0f 00 00 77 03 31 c0 c3 53 48 ... Call Trace: ? nilfs_palloc_freev.cold.24+0x58/0x58 [nilfs2] nilfs_destroy_cachep+0x16/0x3a [nilfs2] exit_nilfs_fs+0xa/0x1b [nilfs2] __x64_sys_delete_module+0x1d9/0x3a0 ? __sanitizer_cov_trace_pc+0x1a/0x50 ? syscall_trace_enter.isra.19+0x119/0x190 do_syscall_64+0x34/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd ... Kernel panic - not syncing: panic_on_warn set ... This patch fixes these issues by calling nilfs_detach_log_writer() cleanup function if spawning the log writer thread fails. Link: https://lkml.kernel.org/r/20221007085226.57667-1-konishi.ryusuke@gmail.com Fixes: e912a5b66837 ("nilfs2: use root object to get ifile") Signed-off-by: Ryusuke Konishi Reported-by: syzbot+7381dc4ad60658ca4c05@syzkaller.appspotmail.com Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit 21a87d88c2253350e115029f14fe2a10a7e6c856 Author: Ryusuke Konishi Date: Sun Oct 2 12:08:04 2022 +0900 nilfs2: fix NULL pointer dereference at nilfs_bmap_lookup_at_level() If the i_mode field in inode of metadata files is corrupted on disk, it can cause the initialization of bmap structure, which should have been called from nilfs_read_inode_common(), not to be called. This causes a lockdep warning followed by a NULL pointer dereference at nilfs_bmap_lookup_at_level(). This patch fixes these issues by adding a missing sanitiy check for the i_mode field of metadata file's inode. Link: https://lkml.kernel.org/r/20221002030804.29978-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+2b32eb36c1a825b7a74c@syzkaller.appspotmail.com Reported-by: Tetsuo Handa Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit d325dc6eb763c10f591c239550b8c7e5466a5d09 Author: Ryusuke Konishi Date: Tue Oct 4 00:05:19 2022 +0900 nilfs2: fix use-after-free bug of struct nilfs_root If the beginning of the inode bitmap area is corrupted on disk, an inode with the same inode number as the root inode can be allocated and fail soon after. In this case, the subsequent call to nilfs_clear_inode() on that bogus root inode will wrongly decrement the reference counter of struct nilfs_root, and this will erroneously free struct nilfs_root, causing kernel oopses. This fixes the problem by changing nilfs_new_inode() to skip reserved inode numbers while repairing the inode bitmap. Link: https://lkml.kernel.org/r/20221003150519.39789-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+b8c672b0e22615c80fe0@syzkaller.appspotmail.com Reported-by: Khalid Masum Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit b1f44cdabad8c50cd72d6b6731e9fdf3730a8f4f Author: SeongJae Park Date: Sun Oct 2 19:31:30 2022 +0000 mm/damon/core: initialize damon_target->list in damon_new_target() 'struct damon_target' creation function, 'damon_new_target()' is not initializing its '->list' field, unlike other DAMON structs creator functions such as 'damon_new_region()'. Normal users of 'damon_new_target()' initializes the field by adding the target to DAMON context's targets list, but some code could access the uninitialized field. This commit avoids the case by initializing the field in 'damon_new_target()'. Link: https://lkml.kernel.org/r/20221002193130.8227-1-sj@kernel.org Fixes: f23b8eee1871 ("mm/damon/core: implement region-based sampling") Signed-off-by: SeongJae Park Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Andrew Morton commit fac35ba763ed07ba93154c95ffc0c4a55023707f Author: Baolin Wang Date: Thu Sep 1 18:41:31 2022 +0800 mm/hugetlb: fix races when looking up a CONT-PTE/PMD size hugetlb page On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb (2M and 1G), but also CONT-PTE/PMD size(64K and 32M) if a 4K page size specified. So when looking up a CONT-PTE size hugetlb page by follow_page(), it will use pte_offset_map_lock() to get the pte entry lock for the CONT-PTE size hugetlb in follow_page_pte(). However this pte entry lock is incorrect for the CONT-PTE size hugetlb, since we should use huge_pte_lock() to get the correct lock, which is mm->page_table_lock. That means the pte entry of the CONT-PTE size hugetlb under current pte lock is unstable in follow_page_pte(), we can continue to migrate or poison the pte entry of the CONT-PTE size hugetlb, which can cause some potential race issues, even though they are under the 'pte lock'. For example, suppose thread A is trying to look up a CONT-PTE size hugetlb page by move_pages() syscall under the lock, however antoher thread B can migrate the CONT-PTE hugetlb page at the same time, which will cause thread A to get an incorrect page, if thread A also wants to do page migration, then data inconsistency error occurs. Moreover we have the same issue for CONT-PMD size hugetlb in follow_huge_pmd(). To fix above issues, rename the follow_huge_pmd() as follow_huge_pmd_pte() to handle PMD and PTE level size hugetlb, which uses huge_pte_lock() to get the correct pte entry lock to make the pte entry stable. Mike said: Support for CONT_PMD/_PTE was added with bb9dd3df8ee9 ("arm64: hugetlb: refactor find_num_contig()"). Patch series "Support for contiguous pte hugepages", v4. However, I do not believe these code paths were executed until migration support was added with 5480280d3f2d ("arm64/mm: enable HugeTLB migration for contiguous bit HugeTLB pages") I would go with 5480280d3f2d for the Fixes: targe. Link: https://lkml.kernel.org/r/635f43bdd85ac2615a58405da82b4d33c6e5eb05.1662017562.git.baolin.wang@linux.alibaba.com Fixes: 5480280d3f2d ("arm64/mm: enable HugeTLB migration for contiguous bit HugeTLB pages") Signed-off-by: Baolin Wang Suggested-by: Mike Kravetz Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: Muchun Song Cc: Signed-off-by: Andrew Morton commit 72da9dc22ff34c0dbdbc1222d6b6adc2d725caa9 Merge: 0cf3cae9697bd abf93f3694192 Author: Jakub Kicinski Date: Tue Oct 11 19:04:22 2022 -0700 Merge tag 'wireless-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v6.1 First set of fixes for v6.1. Quite a lot of fixes in stack but also for mt76. cfg80211/mac80211 - fix locking error in mac80211's hw addr change - fix TX queue stop for internal TXQs - handling of very small (e.g. STP TCN) packets - two memcpy() hardening fixes - fix probe request 6 GHz capability warning - fix various connection prints - fix decapsulation offload for AP VLAN mt76 - fix rate reporting, LLC packets and receive checksum offload on specific chipsets iwlwifi - fix crash due to list corruption ath11k - fix a compiler warning with GCC 11 and KASAN * tag 'wireless-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: ath11k: mac: fix reading 16 bytes from a region of size 0 warning wifi: iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue (other cases) wifi: mt76: fix rx checksum offload on mt7615/mt7915/mt7921 wifi: mt76: fix receiving LLC packets on mt7615/mt7915 wifi: nl80211: Split memcpy() of struct nl80211_wowlan_tcp_data_token flexible array wifi: wext: use flex array destination for memcpy() wifi: cfg80211: fix ieee80211_data_to_8023_exthdr handling of small packets wifi: mac80211: netdev compatible TX stop for iTXQ drivers wifi: mac80211: fix decap offload for stations on AP_VLAN interfaces wifi: mac80211: unlock on error in ieee80211_can_powered_addr_change() wifi: mac80211: remove/avoid misleading prints wifi: mac80211: fix probe req HE capabilities access wifi: mac80211: do not drop packets smaller than the LLC-SNAP header on fast-rx wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer ==================== Link: https://lore.kernel.org/r/20221011163123.A093CC433D6@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 6a961bffd1c3505c13b4d33bbb8385fe08239cb8 Author: Tiezhu Yang Date: Fri Sep 2 11:41:46 2022 +0800 include/linux/entry-common.h: remove has_signal comment of arch_do_signal_or_restart() prototype The argument has_signal of arch_do_signal_or_restart() has been removed in commit 8ba62d37949e ("task_work: Call tracehook_notify_signal from get_signal on all architectures"), let us remove the related comment. Link: https://lkml.kernel.org/r/1662090106-5545-1-git-send-email-yangtiezhu@loongson.cn Fixes: 8ba62d37949e ("task_work: Call tracehook_notify_signal from get_signal on all architectures") Signed-off-by: Tiezhu Yang Reviewed-by: Kees Cook Signed-off-by: Andrew Morton commit 5bc73bb3451b9e449828694733a4c6b413ceeb3b Author: Alexey Dobriyan Date: Wed Oct 5 23:14:00 2022 +0300 proc: test how it holds up with mapping'less process Create process without mappings and check /proc/*/maps /proc/*/numa_maps /proc/*/smaps /proc/*/smaps_rollup They must be empty (excluding vsyscall page) or full of zeroes. Retroactively this test should've caught embarassing /proc/*/smaps_rollup oops: [17752.703567] BUG: kernel NULL pointer dereference, address: 0000000000000000 [17752.703580] #PF: supervisor read access in kernel mode [17752.703583] #PF: error_code(0x0000) - not-present page [17752.703587] PGD 0 P4D 0 [17752.703593] Oops: 0000 [#1] PREEMPT SMP PTI [17752.703598] CPU: 0 PID: 60649 Comm: cat Tainted: G W 5.19.9-100.fc35.x86_64 #1 [17752.703603] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./X99 Extreme6/3.1, BIOS P3.30 08/05/2016 [17752.703607] RIP: 0010:show_smaps_rollup+0x159/0x2e0 Note 1: ProtectionKey field in /proc/*/smaps is optional, so check most of its contents, not everything. Note 2: due to the nature of this test, child process hardly can signal its readiness (after unmapping everything!) to parent. I feel like "sleep(1)" is justified. If you know how to do it without sleep please tell me. Note 3: /proc/*/statm is not tested but can be. Link: https://lkml.kernel.org/r/Yz3liL6Dn+n2SD8Q@localhost.localdomain Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 0f4107d1798f7ee603845b2a6699c9559a1fec9f Author: Frank Rowand Date: Fri Sep 30 20:50:09 2022 -0500 mailmap: update Frank Rowand email address Frank is no longer at Sony, add an entry for his latest Sony email Link: https://lkml.kernel.org/r/20221001015009.3994518-1-frowand.list@gmail.com Signed-off-by: Frank Rowand Cc: Tim Bird Signed-off-by: Andrew Morton commit 95e9a8552e85a7b7c885d3458c7c74c28dfe359b Author: xu xin Date: Fri Sep 30 06:19:50 2022 +0000 ia64: mca: use strscpy() is more robust and safer The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Link: https://lkml.kernel.org/r/20220930061950.288290-1-xu.xin16@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Xu Panda Signed-off-by: xu xin Cc: Haowen Bai Signed-off-by: Andrew Morton commit 30341ec95af4f6e85b981c975c23929bbea8b58a Author: Ren Zhijie Date: Thu Sep 29 07:00:57 2022 +0000 init/Kconfig: fix unmet direct dependencies Commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") make config PROC_CHILDREN depend on PROC_FS. When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, make menuconfig screams like this: WARNING: unmet direct dependencies detected for PROC_CHILDREN Depends on [n]: PROC_FS [=n] Selected by [y]: - CHECKPOINT_RESTORE [=y] CHECKPOINT_RESTORE would select PROC_CHILDREN which depends on PROC_FS, so add depends on PROC_FS to CHECKPOINT_RESTORE to fix this. Link: https://lkml.kernel.org/r/20220929070057.59044-1-renzhijie2@huawei.com Fixes: 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") Signed-off-by: Ren Zhijie Reviewed-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit 329028e04a0b4d6a2e37b75ea90335436b7c3c8c Author: Lukas Bulwahn Date: Thu Sep 29 12:14:41 2022 +0200 ia64: update config files Clean up config files by: - removing configs that were deleted in the past - removing configs not in tree and without recently pending patches - adding new configs that are replacements for old configs in the file For some detailed information, see Link. Link: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Link: https://lkml.kernel.org/r/20220929101441.32009-1-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit 723ac751208f6d6540191689cfbf6c77135a7a1b Author: Ryusuke Konishi Date: Thu Sep 29 21:33:30 2022 +0900 nilfs2: replace WARN_ONs by nilfs_error for checkpoint acquisition failure If creation or finalization of a checkpoint fails due to anomalies in the checkpoint metadata on disk, a kernel warning is generated. This patch replaces the WARN_ONs by nilfs_error, so that a kernel, booted with panic_on_warn, does not panic. A nilfs_error is appropriate here to handle the abnormal filesystem condition. This also replaces the detected error codes with an I/O error so that neither of the internal error codes is returned to callers. Link: https://lkml.kernel.org/r/20220929123330.19658-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+fbb3e0b24e8dae5a16ee@syzkaller.appspotmail.com Signed-off-by: Andrew Morton commit ef79361b265dd229725ad62bc850f6913ef2f94a Author: Xu Panda Date: Mon Sep 12 07:15:57 2022 +0000 fork: remove duplicate included header files linux/sched/mm.h is included more than once. Link: https://lkml.kernel.org/r/20220912071556.16811-1-xu.panda@zte.com.cn Signed-off-by: Xu Panda Reported-by: Zeal Robot Cc: Andy Lutomirski Cc: Christian Brauner (Microsoft) Cc: "Eric W . Biederman" Cc: Fenghua Yu Cc: Liam Howlett Cc: Sebastian Andrzej Siewior Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit de492c83cae0af72de370b9404aacda93dafcad5 Author: Jason A. Donenfeld Date: Wed Oct 5 17:50:20 2022 +0200 prandom: remove unused functions With no callers left of prandom_u32() and prandom_bytes(), as well as get_random_int(), remove these deprecated wrappers, in favor of get_random_u32() and get_random_bytes(). Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Acked-by: Jakub Kicinski Signed-off-by: Jason A. Donenfeld commit 197173db990cad244221ba73c43b1df6170ae278 Author: Jason A. Donenfeld Date: Wed Oct 5 17:49:46 2022 +0200 treewide: use get_random_bytes() when possible The prandom_bytes() function has been a deprecated inline wrapper around get_random_bytes() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. This was done as a basic find and replace. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Reviewed-by: Christophe Leroy # powerpc Acked-by: Jakub Kicinski Signed-off-by: Jason A. Donenfeld commit a251c17aa558d8e3128a528af5cf8b9d7caae4fd Author: Jason A. Donenfeld Date: Wed Oct 5 17:43:22 2022 +0200 treewide: use get_random_u32() when possible The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. The same also applies to get_random_int(), which is just a wrapper around get_random_u32(). This was done as a basic find and replace. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Reviewed-by: Jan Kara # for ext4 Acked-by: Toke Høiland-Jørgensen # for sch_cake Acked-by: Chuck Lever # for nfsd Acked-by: Jakub Kicinski Acked-by: Mika Westerberg # for thunderbolt Acked-by: Darrick J. Wong # for xfs Acked-by: Helge Deller # for parisc Acked-by: Heiko Carstens # for s390 Signed-off-by: Jason A. Donenfeld commit f743f16c548b1a2633e8b6034058d6475d7f26a3 Author: Jason A. Donenfeld Date: Wed Oct 5 17:23:53 2022 +0200 treewide: use get_random_{u8,u16}() when possible, part 2 Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, simply use the get_random_{u8,u16}() functions, which are faster than wasting the additional bytes from a 32-bit value. This was done by hand, identifying all of the places where one of the random integer functions was used in a non-32-bit context. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Acked-by: Jakub Kicinski Acked-by: Heiko Carstens # for s390 Signed-off-by: Jason A. Donenfeld commit 7e3cf0843fe505491baa05e355e83e6997e089dd Author: Jason A. Donenfeld Date: Wed Oct 5 17:23:53 2022 +0200 treewide: use get_random_{u8,u16}() when possible, part 1 Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, simply use the get_random_{u8,u16}() functions, which are faster than wasting the additional bytes from a 32-bit value. This was done mechanically with this coccinelle script: @@ expression E; identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u16; typedef __be16; typedef __le16; typedef u8; @@ ( - (get_random_u32() & 0xffff) + get_random_u16() | - (get_random_u32() & 0xff) + get_random_u8() | - (get_random_u32() % 65536) + get_random_u16() | - (get_random_u32() % 256) + get_random_u8() | - (get_random_u32() >> 16) + get_random_u16() | - (get_random_u32() >> 24) + get_random_u8() | - (u16)get_random_u32() + get_random_u16() | - (u8)get_random_u32() + get_random_u8() | - (__be16)get_random_u32() + (__be16)get_random_u16() | - (__le16)get_random_u32() + (__le16)get_random_u16() | - prandom_u32_max(65536) + get_random_u16() | - prandom_u32_max(256) + get_random_u8() | - E->inet_id = get_random_u32() + E->inet_id = get_random_u16() ) @@ identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u16; identifier v; @@ - u16 v = get_random_u32(); + u16 v = get_random_u16(); @@ identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u8; identifier v; @@ - u8 v = get_random_u32(); + u8 v = get_random_u8(); @@ identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u16; u16 v; @@ - v = get_random_u32(); + v = get_random_u16(); @@ identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u8; u8 v; @@ - v = get_random_u32(); + v = get_random_u8(); // Find a potential literal @literal_mask@ expression LITERAL; type T; identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; position p; @@ ((T)get_random_u32()@p & (LITERAL)) // Examine limits @script:python add_one@ literal << literal_mask.LITERAL; RESULT; @@ value = None if literal.startswith('0x'): value = int(literal, 16) elif literal[0] in '123456789': value = int(literal, 10) if value is None: print("I don't know how to handle %s" % (literal)) cocci.include_match(False) elif value < 256: coccinelle.RESULT = cocci.make_ident("get_random_u8") elif value < 65536: coccinelle.RESULT = cocci.make_ident("get_random_u16") else: print("Skipping large mask of %s" % (literal)) cocci.include_match(False) // Replace the literal mask with the calculated result. @plus_one@ expression literal_mask.LITERAL; position literal_mask.p; identifier add_one.RESULT; identifier FUNC; @@ - (FUNC()@p & (LITERAL)) + (RESULT() & LITERAL) Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Acked-by: Jakub Kicinski Acked-by: Toke Høiland-Jørgensen # for sch_cake Signed-off-by: Jason A. Donenfeld commit 8b3ccbc1f1f91847160951aa15dd27c22dddcb49 Author: Jason A. Donenfeld Date: Wed Oct 5 16:43:38 2022 +0200 treewide: use prandom_u32_max() when possible, part 2 Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. This was done by hand, covering things that coccinelle could not do on its own. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Reviewed-by: Jan Kara # for ext2, ext4, and sbitmap Acked-by: Jakub Kicinski Signed-off-by: Jason A. Donenfeld commit 81895a65ec63ee1daec3255dc1a06675d2fbe915 Author: Jason A. Donenfeld Date: Wed Oct 5 16:43:38 2022 +0200 treewide: use prandom_u32_max() when possible, part 1 Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. This was done mechanically with this coccinelle script: @basic@ expression E; type T; identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; typedef u64; @@ ( - ((T)get_random_u32() % (E)) + prandom_u32_max(E) | - ((T)get_random_u32() & ((E) - 1)) + prandom_u32_max(E * XXX_MAKE_SURE_E_IS_POW2) | - ((u64)(E) * get_random_u32() >> 32) + prandom_u32_max(E) | - ((T)get_random_u32() & ~PAGE_MASK) + prandom_u32_max(PAGE_SIZE) ) @multi_line@ identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; identifier RAND; expression E; @@ - RAND = get_random_u32(); ... when != RAND - RAND %= (E); + RAND = prandom_u32_max(E); // Find a potential literal @literal_mask@ expression LITERAL; type T; identifier get_random_u32 =~ "get_random_int|prandom_u32|get_random_u32"; position p; @@ ((T)get_random_u32()@p & (LITERAL)) // Add one to the literal. @script:python add_one@ literal << literal_mask.LITERAL; RESULT; @@ value = None if literal.startswith('0x'): value = int(literal, 16) elif literal[0] in '123456789': value = int(literal, 10) if value is None: print("I don't know how to handle %s" % (literal)) cocci.include_match(False) elif value == 2**32 - 1 or value == 2**31 - 1 or value == 2**24 - 1 or value == 2**16 - 1 or value == 2**8 - 1: print("Skipping 0x%x for cleanup elsewhere" % (value)) cocci.include_match(False) elif value & (value + 1) != 0: print("Skipping 0x%x because it's not a power of two minus one" % (value)) cocci.include_match(False) elif literal.startswith('0x'): coccinelle.RESULT = cocci.make_expr("0x%x" % (value + 1)) else: coccinelle.RESULT = cocci.make_expr("%d" % (value + 1)) // Replace the literal mask with the calculated result. @plus_one@ expression literal_mask.LITERAL; position literal_mask.p; expression add_one.RESULT; identifier FUNC; @@ - (FUNC()@p & (LITERAL)) + prandom_u32_max(RESULT) @collapse_ret@ type T; identifier VAR; expression E; @@ { - T VAR; - VAR = (E); - return VAR; + return E; } @drop_var@ type T; identifier VAR; @@ { - T VAR; ... when != VAR } Reviewed-by: Greg Kroah-Hartman Reviewed-by: Kees Cook Reviewed-by: Yury Norov Reviewed-by: KP Singh Reviewed-by: Jan Kara # for ext4 and sbitmap Reviewed-by: Christoph Böhmwalder # for drbd Acked-by: Jakub Kicinski Acked-by: Heiko Carstens # for s390 Acked-by: Ulf Hansson # for mmc Acked-by: Darrick J. Wong # for xfs Signed-off-by: Jason A. Donenfeld commit 780614ce1988f9d8ab05a58b49d5506bca60b935 Author: Ronnie Sahlberg Date: Wed Oct 12 08:07:29 2022 +1000 cifs: fix skipping to incorrect offset in emit_cached_dirents When application has done lseek() to a different offset on a directory fd we skipped one entry too many before we start emitting directory entries from the cache. We need to also make sure that when we are starting to emit directory entries from the cache, the ->pos sequence might have holes and skip some indices. Signed-off-by: Ronnie Sahlberg Reviewed-by: Tom Talpey Signed-off-by: Steve French commit d465bff130bf4ca17b6980abe51164ace1e0cba4 Merge: 041bc24d867a2 d79310700590b Author: Linus Torvalds Date: Tue Oct 11 15:02:25 2022 -0700 Merge tag 'perf-tools-for-v6.1-1-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools updates from Arnaldo Carvalho de Melo: - Add support for AMD on 'perf mem' and 'perf c2c', the kernel enablement patches went via tip. Example: $ sudo perf mem record -- -c 10000 ^C[ perf record: Woken up 227 times to write data ] [ perf record: Captured and wrote 58.760 MB perf.data (836978 samples) ] $ sudo perf mem report -F mem,sample,snoop Samples: 836K of event 'ibs_op//', Event count (approx.): 8418762 Memory access Samples Snoop N/A 700620 N/A L1 hit 126675 N/A L2 hit 424 N/A L3 hit 664 HitM L3 hit 10 N/A Local RAM hit 2 N/A Remote RAM (1 hop) hit 8558 N/A Remote Cache (1 hop) hit 3 N/A Remote Cache (1 hop) hit 2 HitM Remote Cache (2 hops) hit 10 HitM Remote Cache (2 hops) hit 6 N/A Uncached hit 4 N/A $ - "perf lock" improvements: - Add -E/--entries option to limit the number of entries to display, say to ask for just the top 5 contended locks. - Add -q/--quiet option to suppress header and debug messages. - Add a 'perf test' kernel lock contention entry to test 'perf lock'. - "perf lock contention" improvements: - Ask BPF's bpf_get_stackid() to skip some callchain entries. The ones closer to the tooling are bpf related and not that interesting, the ones calling the locking function are the ones we're interested in, example of a full, unskipped callstack: - Allow changing the callstack depth and number of entries to skip. 1 10.74 us 10.74 us 10.74 us spinlock __bpf_trace_contention_begin+0xb 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffbb8b8e75 bpf_trace_run2+0x35 0xffffffffbb7eab9b __bpf_trace_contention_begin+0xb 0xffffffffbb7ebe75 queued_spin_lock_slowpath+0x1f5 0xffffffffbc1c26ff _raw_spin_lock+0x1f 0xffffffffbb841015 tick_do_update_jiffies64+0x25 0xffffffffbb8409ee tick_irq_enter+0x9e - Show full callstack in verbose mode (-v option), sometimes this is desirable instead of showing just one callstack entry. - Allow multiple time ranges in 'perf record --delay' to help in reducing the amount of data collected from hardware tracing (Intel PT, etc) when there is a rough idea of periods of time where events of interest take time. - Add Intel PT to record only decoder debug messages when error happens. - Improve layout of Intel PT man page. - Add new branch types: alignment, data and inst faults and arch specific ones, such as fiq, debug_halt, debug_exit, debug_inst and debug_data on arm64. Kernel enablement went thru the tip tree. - Fix 'perf probe' error log check in 'perf test' when no debuginfo is available. - Fix 'perf stat' aggregation mode logic, it should be looking at the CPU not at the core number. - Fix flags parsing in 'perf trace' filters. - Introduce compact encoding of CPU range encoding on perf.data, to avoid having a bitmap with all the CPUs. - Improvements to the 'perf stat' metrics, including adding "core_wide", and computing "smt" from the CPU topology. - Add support to the new PERF_FORMAT_LOST perf_event_attr.read_format, that allows tooling to ask for the precise number of lost samples for a given event. - Add 'addr' sort key to see just the address of sampled instructions: $ perf record -o- true | perf report -i- -s addr [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] # Samples: 12 of event 'cycles:u' # Event count (approx.): 252512 # # Overhead Address # ........ .................. 42.96% 0x7f96f08443d7 29.55% 0x7f96f0859b50 14.76% 0x7f96f0852e02 8.30% 0x7f96f0855028 4.43% 0xffffffff8de01087 perf annotate: Toggle full address <-> offset display - Add 'f' hotkey to the 'perf annotate' TUI interface when in 'disassembler output' mode ('o' hotkey) to toggle showing full virtual address or just the offset. - Cache DSO build-ids when synthesizing PERF_RECORD_MMAP records for pre-existing threads, at the start of a 'perf record' session, speeding up that record startup phase. - Add a command line option to specify build ids in 'perf inject'. - Update JSON event files for the Intel alderlake, broadwell, broadwellde, broadwellx, cascadelakex, haswell, haswellx, icelake, icelakex, ivybridge, ivytown, jaketown, sandybridge, sapphirerapids, skylake, skylakex, and tigerlake processors. - Update vendor JSON event files for the ARM Neoverse V1 and E1 platforms. - Add a 'perf test' entry for 'perf mem' where a struct has false sharing and this gets detected in the 'perf mem' output, tested with Intel, AMD and ARM64 systems. - Add a 'perf test' entry to test the resolution of java symbols, where an output like this is expected: 8.18% jshell jitted-50116-29.so [.] Interpreter 0.75% Thread-1 jitted-83602-1670.so [.] jdk.internal.jimage.BasicImageReader.getString(int) - Add tests for the ARM64 CoreSight hardware tracing feature, with specially crafted pureloop, memcpy, thread loop and unroll tread that then gets traced and the output compared with expected output. Documentation explaining it is also included. - Add per thread Intel PT 'perf test' entry to check that PERF_RECORD_TEXT_POKE events are recorded per CPU, resulting in a mixture of per thread and per CPU events and mmaps, verify that this gets all recorded correctly. - Introduce pthread mutex wrappers to allow for building with clang's -Wthread-safety, i.e. using the "guarded_by" "pt_guarded_by" "lockable", "exclusive_lock_function", "exclusive_trylock_function", "exclusive_locks_required", and "no_thread_safety_analysis" compiler function attributes. - Fix empty version number when building outside of a git repo. - Improve feature detection display when multiple versions of a feature are present, such as for binutils libbfd, that has a mix of possible ways to detect according to the Linux distribution. Previously in some cases we had: Auto-detecting system features ... libbfd: [ on ] ... libbfd-liberty: [ on ] ... libbfd-liberty-z: [ on ] Now for this case we show just the main feature: Auto-detecting system features ... libbfd: [ on ] - Remove some unused structs, variables, macros, function prototypes and includes from various places. * tag 'perf-tools-for-v6.1-1-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (169 commits) perf script: Add missing fields in usage hint perf mem: Print "LFB/MAB" for PERF_MEM_LVLNUM_LFB perf mem/c2c: Avoid printing empty lines for unsupported events perf mem/c2c: Add load store event mappings for AMD perf mem/c2c: Set PERF_SAMPLE_WEIGHT for LOAD_STORE events perf mem: Add support for printing PERF_MEM_LVLNUM_{CXL|IO} perf amd ibs: Sync arch/x86/include/asm/amd-ibs.h header with the kernel tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel perf stat: Fix cpu check to use id.cpu.cpu in aggr_printout() perf test coresight: Add relevant documentation about ARM64 CoreSight testing perf test: Add git ignore for tmp and output files of ARM CoreSight tests perf test coresight: Add unroll thread test shell script perf test coresight: Add unroll thread test tool perf test coresight: Add thread loop test shell scripts perf test coresight: Add thread loop test tool perf test coresight: Add memcpy thread test shell script perf test coresight: Add memcpy thread test tool perf test: Add git ignore for perf data generated by the ARM CoreSight tests perf test: Add arm64 asm pureloop test shell script perf test: Add asm pureloop test tool ... commit abbb388d335f8c400d1baecb15d360fa0062de77 Author: Conor Dooley Date: Mon Oct 10 23:17:05 2022 +0100 dt-bindings: riscv: update microchip.yaml's maintainership Daire and I are the platform maintainers for Microchip's RISC-V FPGAs. Update the maintainers in microchip.yaml to reflect this and explicitly add the binding to the SoC's MAINTAINERS entry. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221010221704.2161221-3-conor@kernel.org/ Signed-off-by: Palmer Dabbelt commit 71c8517e004b950a148581ea2d2abe10aa46e02d Author: Conor Dooley Date: Mon Oct 10 23:17:04 2022 +0100 MAINTAINERS: update polarfire soc clock binding The clock binding has been renamed and a new binding added for the clock controllers in the FPGA fabric. Generalise the pattern to cover both. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20221010221704.2161221-2-conor@kernel.org/ Signed-off-by: Palmer Dabbelt commit 041bc24d867a2a577a06534d6d25e500b24a01ef Merge: c440f99695236 0e00a3aeae255 Author: Linus Torvalds Date: Tue Oct 11 11:08:18 2022 -0700 Merge tag 'pci-v6.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci updates from Bjorn Helgaas: "Resource management: - Distribute spare resources to unconfigured hotplug bridges at boot-time (not just when hot-adding such a bridge), which makes hot-adding devices to docks work better. - Revert to a BAR assignment inherited from firmware only when the address is actually reachable via any upstream bridges, which fixes some cases where firmware doesn't configure all devices. - Add a sysfs interface to resize BARs so this can be done before assigning devices to a VM through VFIO. Power management: - Disable Precision Time Management for all devices on suspend to enable lower-power PM state. We previously did this just for Root Ports, which isn't enough because downstream devices can still generate PTM messages, which cause errors if it's disabled in the Root Port. - Save and restore the ASPM L1 PM Substates configuration for suspend/ resume. Previously this configuration was lost, so L1.x states likely stopped working after resume. - Check whether the L1 PM Substates Capability exists. If it didn't exist, we previously read junk and tried to configure L1 Substates based on that. - Fix the LTR_L1.2_THRESHOLD computation, which previously set a threshold for entering L1.2 that was too low in some cases. - Reduce the delay after transitions to or from D3cold by using usleep_range() rather than msleep(), which often slept for ~19ms instead of the 10ms normally required. The spec says 10ms is enough, but it's possible we could trip over devices that need a little more. Error handling: - Work around a BIOS bug that caused Intel Root Ports to advertise a Root Port Programmed I/O (RP PIO) log size of zero, which caused annoying warnings and prevented the kernel from dumping log registers for DPC errors. Qualcomm PCIe controller driver: - Add support for SC8280XP and SA8540P host controllers and SM8450 endpoint controller. - Disable Master AXI clock on endpoint controllers to save power when link is idle or in L1.x. - Expose link state transition counts via debugfs to help debug issues with low-power states. - Add auto-loading module support. Synopsys DesignWare PCIe controller driver: - Remove a dependency on ZONE_DMA32 by allocating the MSI target page differently. There's more work to do related to eDMA controllers, so it's not completely settled" * tag 'pci-v6.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (71 commits) PCI: qcom-ep: Check platform_get_resource_byname() return value PCI: qcom-ep: Add support for SM8450 SoC dt-bindings: PCI: qcom-ep: Add support for SM8450 SoC dt-bindings: PCI: qcom-ep: Define clocks per platform PCI: qcom-ep: Make PERST separation optional dt-bindings: PCI: qcom-ep: Make PERST separation optional PCI: qcom-ep: Disable Master AXI Clock when there is no PCIe traffic PCI: Expose PCIe Resizable BAR support via sysfs PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation PCI/ASPM: Ignore L1 PM Substates if device lacks capability PCI/ASPM: Factor out L1 PM Substates configuration PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS PCI: qcom-ep: Expose link transition counts via debugfs PCI: qcom-ep: Disable IRQs during driver remove PCI/ASPM: Save L1 PM Substates Capability for suspend/resume PCI/ASPM: Refactor L1 PM Substates Control Register programming PCI: qcom-ep: Make use of the cached dev pointer PCI: qcom-ep: Rely on the clocks supplied by devicetree PCI: qcom-ep: Add kernel-doc for qcom_pcie_ep structure phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on() ... commit c440f99695236ceb610606e4b5c50e150981f6c5 Merge: 979bb59016aed fd66bd74afe88 Author: Linus Torvalds Date: Tue Oct 11 11:03:42 2022 -0700 Merge tag 'i2c-for-6.1-rc1-batch2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull more i2c updates from Wolfram Sang: - correct a variable type in the new pci1xxxx driver - add a new SoC to the qcom-cci driver - fix an issue with the designware driver which now got enough testing - the aspeed driver now handles busy target backends better * tag 'i2c-for-6.1-rc1-batch2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: aspeed: Assert NAK when slave is busy i2c: designware: Fix handling of real but unexpected device interrupts i2c: qcom-cci: Add MSM8226 compatible dt-bindings: i2c: qcom,i2c-cci: Document clocks for MSM8974 dt-bindings: i2c: qcom,i2c-cci: Document MSM8226 compatible i2c: microchip: pci1xxxx: Fix comparison of -EPERM against an unsigned variable commit 979bb59016aed7c7c58baca2307d9d13890cc6ab Merge: 694b37a5dd3c8 9d157c89c5569 Author: Linus Torvalds Date: Tue Oct 11 10:59:59 2022 -0700 Merge tag 'pinctrl-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "There is nothing exciting going on, no core changes, just a few drivers and cleanups. New drivers: - Cypress CY8C95x0 chip pin control support, along with an immediate cleanup - Mediatek MT8188 SoC pin control support - Qualcomm SM8450 and SC8280XP LPASS (low power audio subsystem) pin control support - Qualcomm PM7250, PM8450 - Rockchip RV1126 SoC pin control support Improvements: - Fix some missing pins in the Armada 37xx driver - Convert Broadcom and Nomadik drivers to use PINCTRL_PINGROUP() macro - Fix some GPIO irq_chips to be immutable - Massive Qualcomm device tree binding cleanup, with more to come" * tag 'pinctrl-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (119 commits) MAINTAINERS: adjust STARFIVE JH7100 PINCTRL DRIVER after file movement pinctrl: starfive: Rename "pinctrl-starfive" to "pinctrl-starfive-jh7100" pinctrl: Create subdirectory for StarFive drivers dt-bindings: pinctrl: st,stm32: Document interrupt-controller property dt-bindings: pinctrl: st,stm32: Document gpio-hog pattern property dt-bindings: pinctrl: st,stm32: Document gpio-line-names pinctrl: st: stop abusing of_get_named_gpio() pinctrl: wpcm450: Correct the fwnode_irq_get() return value check pinctrl: bcm: Remove unused struct bcm6328_pingroup pinctrl: qcom: restrict drivers per ARM/ARM64 pinctrl: bcm: ns: Remove redundant dev_err call gpio: rockchip: request GPIO mux to pinctrl when setting direction pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback pinctrl: cy8c95x0: Align function names in cy8c95x0_pmxops pinctrl: cy8c95x0: Drop atomicity on operations on push_pull pinctrl: cy8c95x0: Lock register accesses in cy8c95x0_set_mux() pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper pinctrl: stm32: Switch to use dev_err_probe() helper dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings pinctrl: qcom: spmi-gpio: Add compatible for PM7250B ... commit 694b37a5dd3c87235e02fabbe7b394f6ab1f444b Merge: eec4ed317dccd 5f8f8574c7f55 Author: Linus Torvalds Date: Tue Oct 11 10:53:25 2022 -0700 Merge tag 'input-for-v6.1-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for IBM Operational Panel - a new driver for PinePhone keyboards - RT5120 PMIC power key support - various enhancements and support for new models in xpad (Xbox) driver - a new compatible ID for Elan touchscreen driver - rework of adp5588-keys driver to support configuring via device properties (OF, ACPI, etc) instead of platform data, and proper support of optional gpiochip functionality (and removal of gpio-adp5588 driver) - improvements to firmware update handling in Synaptics RMI4 driver - support for double key matrix in mt6779-keypad - support for polled mode in adc-joystick driver - other assorted driver fixes, cleanups and improvements * tag 'input-for-v6.1-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (90 commits) Input: i8042 - fix refount leak on sparc Input: i8042 - add LoongArch support in i8042-acpipnpio.h Input: i8042 - rename i8042-x86ia64io.h to i8042-acpipnpio.h Input: pinephone-keyboard - support the proxied I2C bus Input: pinephone-keyboard - add PinePhone keyboard driver dt-bindings: input: Add the PinePhone keyboard binding dt-bindings: input: Convert hid-over-i2c to DT schema input: drop empty comment blocks Input: xpad - add X-Box Adaptive Profile button Input: add ABS_PROFILE to uapi and documentation Input: xpad - add X-Box Adaptive XBox button Input: xpad - add X-Box Adaptive support Input: ims-pcu - fix spelling mistake "BOOLTLOADER" -> "BOOTLOADER" Input: ibm-panel - add missing MODULE_DEVICE_TABLE Input: icn8505 - utilize acpi_get_subsystem_id() Input: xpad - decipher xpadone packages with GIP defines Input: xpad - refactor using BIT() macro Input: synaptics-rmi4 - convert to use sysfs_emit() APIs Input: twl4030-pwrbutton - add missing of.h include Input: applespi - replace zero-length array with DECLARE_FLEX_ARRAY() helper ... commit eec4ed317dccdef610b54224f45e0e1f4fdb75fb Merge: 500b717fe36f3 29926f1cd3535 Author: Linus Torvalds Date: Tue Oct 11 10:49:17 2022 -0700 Merge tag 'fbdev-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev updates from Helge Deller: "Here's a fix for the smscufx USB graphics card to prevent a kernel crash if it's plugged in/out too fast. The other patches are mostly small cleanups, fixes in failure paths and code removal: - fix an use-after-free in smscufx USB graphics driver - add missing pci_disable_device() in tridentfb failure paths - correctly handle irq detection failure in mb862xx driver - fix resume code in omapfb/dss - drop unused code in controlfb, tridentfb, arkfb, imxfb and udlfb - convert uvesafb to use scnprintf() instead of snprintf() - convert gbefb to use dev_groups - add MODULE_DEVICE_TABLE() entry to vga16fb" * tag 'fbdev-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: mb862xx: Fix check of return value from irq_of_parse_and_map() fbdev: vga16fb: Add missing MODULE_DEVICE_TABLE() entry fbdev: tridentfb: Fix missing pci_disable_device() in probe and remove fbdev: smscufx: Fix use-after-free in ufx_ops_open() fbdev: gbefb: Convert to use dev_groups fbdev: imxfb: Remove redundant dev_err() call fbdev: omapfb/dss: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() fbdev: uvesafb: Convert snprintf to scnprintf fbdev: arkfb: Remove the unused function dac_read_reg() fbdev: tridentfb: Remove the unused function shadowmode_off() fbdev: controlfb: Remove the unused function VAR_MATCH() fbdev: udlfb: Remove redundant initialization to variable identical commit 500b717fe36f31eec487adae4824f9be7c48d998 Merge: 8de1037a96ef3 13a0ac816d22a Author: Linus Torvalds Date: Tue Oct 11 10:44:20 2022 -0700 Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull dmi updates from Jean Delvare. * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: firmware: dmi: Fortify entry point length checks commit 8de1037a96ef33363727302f9afadb6535fd8b05 Merge: c6cc4f7241d92 05763c996f72e Author: Linus Torvalds Date: Tue Oct 11 10:42:25 2022 -0700 Merge tag 'for-linus-6.1-1' of https://github.com/cminyard/linux-ipmi Pull IPMI updates from Corey Minyard: "Fix a bunch of little problems in IPMI This is mostly just doc, config, and little tweaks. Nothing big, which is why there was nothing for 6.0. There is one crash fix, but it's not something that I think anyone is using yet" * tag 'for-linus-6.1-1' of https://github.com/cminyard/linux-ipmi: ipmi: Remove unused struct watcher_entry ipmi: kcs: aspeed: Update port address comments ipmi: Add __init/__exit annotations to module init/exit funcs ipmi:ipmb: Don't call ipmi_unregister_smi() on a register failure ipmi:ipmb: Fix a vague comment and a typo dt-binding: ipmi: add fallback to npcm845 compatible ipmi: Fix comment typo char: ipmi: modify NPCM KCS configuration dt-bindings: ipmi: Add npcm845 compatible commit c6cc4f7241d92cfdc36f9a13dfe318492f7eaa73 Author: Lukas Bulwahn Date: Tue Oct 4 09:13:02 2022 +0200 alpha: remove the needless aliases osf_{readv,writev} Commit 987f20a9dcce ("a.out: Remove the a.out implementation") removes CONFIG_OSF4_COMPAT and its functionality. Hence, sys_osf_{readv,writev} are now just aliases of sys_{readv,writev}. Remove these needless aliases. [ Identical patch also posted by Jason A. Donenfeld ] Link: https://lore.kernel.org/lkml/CAHk-=wjwvBc3VQMNtUVUrMBVoMPSPu26OuatZ_+1gZ2m-PmmRA@mail.gmail.com/ Link: https://lore.kernel.org/all/20221004135301.1420873-1-Jason@zx2c4.com/ Suggested-by: Linus Torvalds Signed-off-by: Lukas Bulwahn Signed-off-by: Linus Torvalds commit ae5b6779fa8724628bbad58126a626d0cd599414 Author: Joel Stanley Date: Tue Oct 11 14:29:10 2022 +1030 powerpc: Fix 85xx build The merge of the kbuild tree dropped the renaming of the FSL_BOOKE kconfig option. Fixes: 8afc66e8d43b ("Merge tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild") Signed-off-by: Joel Stanley Signed-off-by: Linus Torvalds commit ff2be4420863cc93bd4e0bea333ac9cb090a3415 Author: Wu XiangCheng Date: Tue Oct 11 14:03:00 2022 +0800 docs/zh_CN: add a man-pages link to zh_CN/index.rst update to commit 489876063fb1 ("docs: add a man-pages link to the front page") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/6e289528ed1b40c1fcc03ea5e854e7c8ba264e67.1665467392.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit eef24f7054a63058d6400a4386ee8bb2164fec44 Author: Wu XiangCheng Date: Tue Oct 11 14:02:23 2022 +0800 docs/zh_CN: Rewrite the Chinese translation front page update to commit 0c7b4366f1ab ("docs: Rewrite the front page") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/440d7cb3c9f1526ed7c2996aa88ba2bc7fdc018c.1665467392.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit da2e928b2ddbcca793207ca670c6213f925a95f5 Author: Wu XiangCheng Date: Tue Oct 11 14:01:28 2022 +0800 docs/zh_CN: add zh_CN/arch.rst Add an entry for all zh arch documents. Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/4e9675ac83a06f2597d069f44a94c4e2cbd7ab2b.1665467392.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit 10f43fda55404cd6b5e1d422d9ecb570ce49d5de Author: Wu XiangCheng Date: Tue Oct 11 14:00:45 2022 +0800 docs/zh_CN: promote the title of zh_CN/process/index.rst update to commit 9d0f5cd16744 ("docs: promote the title of process/index.rst") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/2741340f3b5f131a32d0f295224edd569aab0d98.1665467392.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit 8248fe413216732f98563e8882b6c6ae617c327b Author: Namhyung Kim Date: Mon Oct 10 22:28:08 2022 -0700 perf stat: Support old kernels for bperf cgroup counting The recent change in the cgroup will break the backward compatiblity in the BPF program. It should support both old and new kernels using BPF CO-RE technique. Like the task_struct->__state handling in the offcpu analysis, we can check the field name in the cgroup struct. Acked-by: Jiri Olsa Acked-by: Andrii Nakryiko Signed-off-by: Namhyung Kim Signed-off-by: Tejun Heo commit 35256d673a9cf723d9e2edb5d51e1b1b6b197ba3 Author: Yosry Ahmed Date: Tue Oct 11 00:33:59 2022 +0000 bpf: cgroup_iter: support cgroup1 using cgroup fd Use cgroup_v1v2_get_from_fd() in cgroup_iter to support attaching to both cgroup v1 and v2 using fds. Signed-off-by: Yosry Ahmed Acked-by: Martin KaFai Lau Signed-off-by: Tejun Heo commit a6d1ce5951185ee91bbe6909fe2758f3625561b0 Author: Yosry Ahmed Date: Tue Oct 11 00:33:58 2022 +0000 cgroup: add cgroup_v1v2_get_from_[fd/file]() Add cgroup_v1v2_get_from_fd() and cgroup_v1v2_get_from_file() that support both cgroup1 and cgroup2. Signed-off-by: Yosry Ahmed Signed-off-by: Tejun Heo commit ea19684afb545605bbcb690c49a91ce2c8e596dd Author: Matthew Auld Date: Tue Oct 4 14:19:15 2022 +0100 drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers For these types of display buffers, we need to able to CPU access some part of the backing memory in prepare_plane_clear_colors(). As a result we need to ensure we always place in the mappable part of lmem, which becomes necessary on small-bar systems. v2(Nirmoy & Ville): - Add some commentary for why we need to CPU access the buffer. - Split out the other changes, so we just consider the display change here. v3: - Handle this in the dpt path. v4(Ville): - Drop the intel_fb_rc_ccs_cc_plane() sanity check in pin_and_fence_fb_obj(), since we can also trigger this on DG1 it seems. Fixes: eb1c535f0d69 ("drm/i915: turn on small BAR support") Reported-by: Jianshui Yu Signed-off-by: Matthew Auld Cc: Ville Syrjälä Cc: Nirmoy Das Reviewed-by: Ville Syrjälä Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-4-matthew.auld@intel.com (cherry picked from commit e3afc690188be8e4385d13d1b0e7f0ba01caea40) Signed-off-by: Tvrtko Ursulin commit 695ddc9318ad45b6a32f902b7c6998c65d575f26 Author: Matthew Auld Date: Tue Oct 4 14:19:14 2022 +0100 drm/i915: allow control over the flags when migrating In the next patch we want to move the object (if the current resource is not compatible), to the mappable part of lmem for some display buffers. Currently that requires being able to unset the I915_BO_ALLOC_GPU_ONLY hint. Signed-off-by: Matthew Auld Cc: Jianshui Yu Cc: Ville Syrjälä Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-3-matthew.auld@intel.com (cherry picked from commit 999f4562077208b683f0519e5f1aa1e5c2fd2191) Signed-off-by: Tvrtko Ursulin commit 1f768ba469002d2dcad5c3d667151977417df7d9 Author: Yang Li Date: Mon Oct 10 15:38:03 2022 +0800 drm/amd/display: Simplify bool conversion The result of 'pwr_status == 0' is Boolean, and the question mark expression is redundant. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2354 Reported-by: Abaci Robot Reviewed-by: Harry Wentland Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit a895014853ea6df2778533e2a0bb7a0d53f02ec2 Author: Alex Deucher Date: Mon Sep 19 12:36:29 2022 -0400 drm/amd/display: fix transfer function passed to build_coefficients() The default argument should be enum TRANSFER_FUNCTION_SRGB rather than the current boolean value which improperly maps to TRANSFER_FUNCTION_BT709. Commit 9b3d76527f6e ("drm/amd/display: Revert adding degamma coefficients") looks to have improperly reverted commit d02097095916 ("drm/amd/display: Add regamma/degamma coefficients and set sRGB when TF is BT709") replacing the enum value with a boolean value. Cc: Krunoslav Kovac Cc: Jaehyun Chung Cc: Zeng Heng Fixes: 9b3d76527f6e ("drm/amd/display: Revert adding degamma coefficients") Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit f00844daa5212aac609d9cb97ce5e0a74c67890a Author: Alex Deucher Date: Mon Oct 10 17:30:08 2022 -0400 drm/amd/display: add a license to cursor_reg_cache.h It's MIT. Fixes: b73353f7f3d434 ("drm/amd/display: Use the same cursor info across features") Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b1d1666276cce28743e2cf90be07182ceac14f1e Author: Alex Deucher Date: Mon Oct 10 10:37:43 2022 -0400 drm/amd/display: make virtual_disable_link_output static It's not used outside of virtual_link_hwss.c. Fixes a -Wmissing-prototypes warning. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e1e6889fc7b3e5152218db7d9f03c2f81569d54c Author: Alex Deucher Date: Thu Oct 6 11:31:25 2022 -0400 drm/amd/display: fix indentation in dc.c Fixes a warning in dc.c. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 9f30bf9917612b3a85cc28dc8ef98667ad5c07f8 Author: Alex Deucher Date: Tue Oct 11 09:27:29 2022 -0400 drm/amd/display: make dcn32_split_stream_for_mpc_or_odm static It's not used outside of dcn32_fpu.c. Fixes: 20dad3813b3c15 ("drm/amd/display: Add a helper to map ODM/MPC/Multi-Plane resources") Reviewed-by: Harry Wentland Reported-by: kernel test robot Signed-off-by: Alex Deucher commit eff4ccd11313ecc8ec94c0f39961ffbf227a406d Author: Yang Yingliang Date: Tue Oct 11 20:41:03 2022 +0800 drm/amd/display: fix build error on arm64 dcn20_build_mapped_resource() and dcn20_acquire_dsc() is not defined, if CONFIG_DRM_AMD_DC_DCN is disabled. Fix the following build error on arm64: ERROR: modpost: "dcn20_build_mapped_resource" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "dcn20_acquire_dsc" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! Fixes: 20dad3813b3c ("drm/amd/display: Add a helper to map ODM/MPC/Multi-Plane resources") Signed-off-by: Yang Yingliang Signed-off-by: Alex Deucher commit 1ba25b6ff24303fac890d657ffdebf3e8db3bc25 Author: Aric Cyr Date: Sun Oct 2 11:59:13 2022 -0400 drm/amd/display: 3.2.207 DC version 3.2.207 brings along the following: - PMFW z-state interface update - Cursor update refactor - Fixes to DSC validation, DCFCLK during Freesync, etc. - Code cleanup Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 09f1ef99ce900dbc3659d478f006081c96cc977f Author: Rodrigo Siqueira Date: Tue Sep 27 17:59:21 2022 -0400 drm/amd/display: Clean some DCN32 macros Some unused macros might mislead developers during the debug, which can be removed without any issue. This commit drops some unused references to SE_COMMON_MASK_SH_LIST_DCN32. Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 832e72dd0d705bfcb4236bb2d561d82afe253e63 Author: Candice Li Date: Mon Sep 26 16:21:05 2022 +0800 drm/amdgpu: Add poison mode query for umc v8_10_0 Add poison mode query support on umc v8_10_0. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 6dddc1eb9632b0eb6098d1dc849e8acb2408c1b6 Author: Candice Li Date: Mon Sep 26 16:18:56 2022 +0800 drm/amdgpu: Update umc v8_10_0 headers Add GeccCtrl offset and mask to umc v8_10_0 headers. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 38dbbfa57c08b29ef8cf1d3fb3ad639ae819754e Author: Tao Zhou Date: Thu Sep 29 14:59:11 2022 +0800 drm/amdgpu: fix coding style issue for mca notifier Fix some issues found by checkpatch script. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fb4d5891cee6d1c14b8d8f1b65c9d061ed3a495c Author: Tao Zhou Date: Tue Sep 27 11:42:45 2022 +0800 drm/amdgpu: define convert_error_address for umc v8.7 So the code can be simplified. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 44420ac5f855f5704d8f939926ed145f99e49e55 Author: Tao Zhou Date: Tue Sep 27 11:36:46 2022 +0800 drm/amdgpu: define RAS convert_error_address API Make the code reusable and remove redundant code. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cdbb816b5bfeb69ad925805d99b2ec312b241f1c Author: Tao Zhou Date: Mon Sep 26 17:01:33 2022 +0800 drm/amdgpu: remove check for CE in RAS error address query Only RAS UE error address is queried currently, no need to check CE status. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bd86c69dae65de30f6d47249418ba7889809e31a Author: Tetsuo Handa Date: Mon Oct 10 14:59:02 2022 +0900 NFSD: unregister shrinker when nfsd_init_net() fails syzbot is reporting UAF read at register_shrinker_prepared() [1], for commit 7746b32f467b3813 ("NFSD: add shrinker to reap courtesy clients on low memory condition") missed that nfsd4_leases_net_shutdown() from nfsd_exit_net() is called only when nfsd_init_net() succeeded. If nfsd_init_net() fails due to nfsd_reply_cache_init() failure, register_shrinker() from nfsd4_init_leases_net() has to be undone before nfsd_init_net() returns. Link: https://syzkaller.appspot.com/bug?extid=ff796f04613b4c84ad89 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 7746b32f467b3813 ("NFSD: add shrinker to reap courtesy clients on low memory condition") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6c482c62a635aa4f534d2439fbf8afa37452b986 Author: Thomas Hellström Date: Wed Oct 5 14:11:59 2022 +0200 drm/i915: Fix display problems after resume Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding") introduced a regression that due to the vma resource tracking of the binding state, dpt ptes were not correctly repopulated. Fix this by clearing the vma resource state before repopulating. The state will subsequently be restored by the bind_vma operation. Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding") Signed-off-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-thomas.hellstrom@linux.intel.com Cc: Matthew Auld Cc: intel-gfx@lists.freedesktop.org Cc: # v5.18+ Reported-and-tested-by: Kevin Boulain Tested-by: David de Sousa Reviewed-by: Matthew Auld Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20221005121159.340245-1-thomas.hellstrom@linux.intel.com (cherry picked from commit bc2472538c0d1cce334ffc9e97df0614cd2b1469) Signed-off-by: Tvrtko Ursulin commit 6e141772e6465f937458b35ddcfd0a981b6f5280 Author: Wenchao Chen Date: Tue Oct 11 18:49:35 2022 +0800 mmc: sdhci-sprd: Fix minimum clock limit The Spreadtrum controller supports 100KHz minimal clock rate, which means that the current value 400KHz is wrong. Unfortunately this has also lead to fail to initialize some cards, which are allowed to require 100KHz to work. So, let's fix the problem by changing the minimal supported clock rate to 100KHz. Signed-off-by: Wenchao Chen Acked-by: Adrian Hunter Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221011104935.10980-1-wenchao.chen666@gmail.com [Ulf: Clarified to commit-message] Signed-off-by: Ulf Hansson commit 63c84b46b3b75798f1ad63527b6250de00331907 Author: Filipe Manana Date: Tue Oct 11 13:16:53 2022 +0100 btrfs: ignore fiemap path cache if we have multiple leaves for a data extent The path cache used during fiemap used to determine the sharedness of extent buffers in a path from a leaf containing a file extent item pointing to our data extent up to the root node of the tree, is meant to be used for a single path. Having a single path is by far the most common case, and therefore worth to optimize for, but it's possible to actually have multiple paths because we have 2 or more leaves. If we have multiple leaves, the 'level' variable keeps getting incremented in each iteration of the while loop at btrfs_is_data_extent_shared(), which means we will treat the second leaf in the 'tmp' ulist as a level 1 node, and so forth. In the worst case this can lead to getting a level greater than or equals to BTRFS_MAX_LEVEL (8), which will trigger a WARN_ON_ONCE() in the functions to lookup from or store in the path cache (lookup_backref_shared_cache() and store_backref_shared_cache()). If the current level never goes beyond 8, due to shared nodes in the paths and a fs tree height smaller than 8, it can still result in incorrectly marking one leaf as shared because some other leaf is shared and is stored one level below that other leaf, as when storing a true sharedness value in the cache results in updating the sharedness to true of all entries in the cache below the current level. Having multiple leaves happens in a case like the following: - We have a file extent item point to data extent at bytenr X, for a file range [0, 1M[ for example; - At this moment we have an extent data ref for the extent, with an offset of 0 and a count of 1; - A write into the middle of the extent happens, file range [64K, 128K) so the file extent item is split into two (at btrfs_drop_extents()): 1) One for file range [0, 64K), with a length (num_bytes field) of 64K and an extent offset of 0; 2) Another one for file range [128K, 1M), with a length of 896K (1M - 128K) and an extent offset of 128K. - At this moment the two file extent items are located in the same leaf; - A new file extent item for the range [64K, 128K), pointing to a new data extent, is inserted in the leaf. This results in a leaf split and now those two file extent items pointing to data extent X end up located in different leaves; - Once delayed refs are run, we still have a single extent data ref item for our data extent at bytenr X, for offset 0, but now with a count of 2 instead of 1; - So during fiemap, at btrfs_is_data_extent_shared(), after we call find_parent_nodes() for the data extent, we get two leaves, since we have two file extent items point to data extent at bytenr X that are located in two different leaves. So skip the use of the path cache when we get more than one leaf. Fixes: 12a824dc67a61e ("btrfs: speedup checking for extent sharedness during fiemap") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 943553ef9b51db303ab2b955c1025261abfdf6fb Author: Filipe Manana Date: Tue Oct 11 13:16:52 2022 +0100 btrfs: fix processing of delayed tree block refs during backref walking During backref walking, when processing a delayed reference with a type of BTRFS_TREE_BLOCK_REF_KEY, we have two bugs there: 1) We are accessing the delayed references extent_op, and its key, without the protection of the delayed ref head's lock; 2) If there's no extent op for the delayed ref head, we end up with an uninitialized key in the stack, variable 'tmp_op_key', and then pass it to add_indirect_ref(), which adds the reference to the indirect refs rb tree. This is wrong, because indirect references should have a NULL key when we don't have access to the key, and in that case they should be added to the indirect_missing_keys rb tree and not to the indirect rb tree. This means that if have BTRFS_TREE_BLOCK_REF_KEY delayed ref resulting from freeing an extent buffer, therefore with a count of -1, it will not cancel out the corresponding reference we have in the extent tree (with a count of 1), since both references end up in different rb trees. When using fiemap, where we often need to check if extents are shared through shared subtrees resulting from snapshots, it means we can incorrectly report an extent as shared when it's no longer shared. However this is temporary because after the transaction is committed the extent is no longer reported as shared, as running the delayed reference results in deleting the tree block reference from the extent tree. Outside the fiemap context, the result is unpredictable, as the key was not initialized but it's used when navigating the rb trees to insert and search for references (prelim_ref_compare()), and we expect all references in the indirect rb tree to have valid keys. The following reproducer triggers the second bug: $ cat test.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount -o compress $DEV $MNT # With a compressed 128M file we get a tree height of 2 (level 1 root). xfs_io -f -c "pwrite -b 1M 0 128M" $MNT/foo btrfs subvolume snapshot $MNT $MNT/snap # Fiemap should output 0x2008 in the flags column. # 0x2000 means shared extent # 0x8 means encoded extent (because it's compressed) echo echo "fiemap after snapshot, range [120M, 120M + 128K):" xfs_io -c "fiemap -v 120M 128K" $MNT/foo echo # Overwrite one extent and fsync to flush delalloc and COW a new path # in the snapshot's tree. # # After this we have a BTRFS_DROP_DELAYED_REF delayed ref of type # BTRFS_TREE_BLOCK_REF_KEY with a count of -1 for every COWed extent # buffer in the path. # # In the extent tree we have inline references of type # BTRFS_TREE_BLOCK_REF_KEY, with a count of 1, for the same extent # buffers, so they should cancel each other, and the extent buffers in # the fs tree should no longer be considered as shared. # echo "Overwriting file range [120M, 120M + 128K)..." xfs_io -c "pwrite -b 128K 120M 128K" $MNT/snap/foo xfs_io -c "fsync" $MNT/snap/foo # Fiemap should output 0x8 in the flags column. The extent in the range # [120M, 120M + 128K) is no longer shared, it's now exclusive to the fs # tree. echo echo "fiemap after overwrite range [120M, 120M + 128K):" xfs_io -c "fiemap -v 120M 128K" $MNT/foo echo umount $MNT Running it before this patch: $ ./test.sh (...) wrote 134217728/134217728 bytes at offset 0 128 MiB, 128 ops; 0.1152 sec (1.085 GiB/sec and 1110.5809 ops/sec) Create a snapshot of '/mnt/sdj' in '/mnt/sdj/snap' fiemap after snapshot, range [120M, 120M + 128K): /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [245760..246015]: 34304..34559 256 0x2008 Overwriting file range [120M, 120M + 128K)... wrote 131072/131072 bytes at offset 125829120 128 KiB, 1 ops; 0.0001 sec (683.060 MiB/sec and 5464.4809 ops/sec) fiemap after overwrite range [120M, 120M + 128K): /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [245760..246015]: 34304..34559 256 0x2008 The extent in the range [120M, 120M + 128K) is still reported as shared (0x2000 bit set) after overwriting that range and flushing delalloc, which is not correct - an entire path was COWed in the snapshot's tree and the extent is now only referenced by the original fs tree. Running it after this patch: $ ./test.sh (...) wrote 134217728/134217728 bytes at offset 0 128 MiB, 128 ops; 0.1198 sec (1.043 GiB/sec and 1068.2067 ops/sec) Create a snapshot of '/mnt/sdj' in '/mnt/sdj/snap' fiemap after snapshot, range [120M, 120M + 128K): /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [245760..246015]: 34304..34559 256 0x2008 Overwriting file range [120M, 120M + 128K)... wrote 131072/131072 bytes at offset 125829120 128 KiB, 1 ops; 0.0001 sec (694.444 MiB/sec and 5555.5556 ops/sec) fiemap after overwrite range [120M, 120M + 128K): /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [245760..246015]: 34304..34559 256 0x8 Now the extent is not reported as shared anymore. So fix this by passing a NULL key pointer to add_indirect_ref() when processing a delayed reference for a tree block if there's no extent op for our delayed ref head with a defined key. Also access the extent op only after locking the delayed ref head's lock. The reproducer will be converted later to a test case for fstests. Fixes: 86d5f994425252 ("btrfs: convert prelimary reference tracking to use rbtrees") Fixes: a6dbceafb915e8 ("btrfs: Remove unused op_key var from add_delayed_refs") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4fc7b57228243d09c0d878873bf24fa64a90fa01 Author: Filipe Manana Date: Tue Oct 11 13:16:51 2022 +0100 btrfs: fix processing of delayed data refs during backref walking When processing delayed data references during backref walking and we are using a share context (we are being called through fiemap), whenever we find a delayed data reference for an inode different from the one we are interested in, then we immediately exit and consider the data extent as shared. This is wrong, because: 1) This might be a DROP reference that will cancel out a reference in the extent tree; 2) Even if it's an ADD reference, it may be followed by a DROP reference that cancels it out. In either case we should not exit immediately. Fix this by never exiting when we find a delayed data reference for another inode - instead add the reference and if it does not cancel out other delayed reference, we will exit early when we call extent_is_shared() after processing all delayed references. If we find a drop reference, then signal the code that processes references from the extent tree (add_inline_refs() and add_keyed_refs()) to not exit immediately if it finds there a reference for another inode, since we have delayed drop references that may cancel it out. In this later case we exit once we don't have references in the rb trees that cancel out each other and have two references for different inodes. Example reproducer for case 1): $ cat test-1.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT xfs_io -f -c "pwrite 0 64K" $MNT/foo cp --reflink=always $MNT/foo $MNT/bar echo echo "fiemap after cloning:" xfs_io -c "fiemap -v" $MNT/foo rm -f $MNT/bar echo echo "fiemap after removing file bar:" xfs_io -c "fiemap -v" $MNT/foo umount $MNT Running it before this patch, the extent is still listed as shared, it has the flag 0x2000 (FIEMAP_EXTENT_SHARED) set: $ ./test-1.sh fiemap after cloning: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 fiemap after removing file bar: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 Example reproducer for case 2): $ cat test-2.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT xfs_io -f -c "pwrite 0 64K" $MNT/foo cp --reflink=always $MNT/foo $MNT/bar # Flush delayed references to the extent tree and commit current # transaction. sync echo echo "fiemap after cloning:" xfs_io -c "fiemap -v" $MNT/foo rm -f $MNT/bar echo echo "fiemap after removing file bar:" xfs_io -c "fiemap -v" $MNT/foo umount $MNT Running it before this patch, the extent is still listed as shared, it has the flag 0x2000 (FIEMAP_EXTENT_SHARED) set: $ ./test-2.sh fiemap after cloning: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 fiemap after removing file bar: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 After this patch, after deleting bar in both tests, the extent is not reported with the 0x2000 flag anymore, it gets only the flag 0x1 (which is FIEMAP_EXTENT_LAST): $ ./test-1.sh fiemap after cloning: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 fiemap after removing file bar: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x1 $ ./test-2.sh fiemap after cloning: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x2001 fiemap after removing file bar: /mnt/sdj/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: 26624..26751 128 0x1 These tests will later be converted to a test case for fstests. Fixes: dc046b10c8b7d4 ("Btrfs: make fiemap not blow when you have lots of snapshots") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 295a53ccc4ca8383f6d107534b466b91aa013f79 Author: David Sterba Date: Tue Oct 11 11:25:33 2022 +0200 btrfs: delete stale comments after merge conflict resolution There are two comments in btrfs_cache_block_group that I left when resolving conflict between commits ced8ecf026fd8 "btrfs: fix space cache corruption and potential double allocations" and 527c490f44f6f "btrfs: delete btrfs_wait_space_cache_v1_finished". The former reworked the caching logic to wait until the caching ends in btrfs_cache_block_group while the latter only open coded the waiting. Both removed btrfs_wait_space_cache_v1_finished, the correct code is with the waiting and returning error. Thus the conflict resolution was OK. Signed-off-by: David Sterba commit 9e769bd7e5db5e3bd76e7c67004c261f7fcaa8f1 Author: Josef Bacik Date: Fri Sep 30 16:45:08 2022 -0400 btrfs: unlock locked extent area if we have contention In production we hit the following deadlock task 1 task 2 task 3 ------ ------ ------ fiemap(file) falloc(file) fsync(file) write(0, 1MiB) btrfs_commit_transaction() wait_on(!pending_ordered) lock(512MiB, 1GiB) start_transaction wait_on_transaction lock(0, 1GiB) wait_extent_bit(512MiB) task 4 ------ finish_ordered_extent(0, 1MiB) lock(0, 1MiB) **DEADLOCK** This occurs because when task 1 does it's lock, it locks everything from 0-512MiB, and then waits for the 512MiB chunk to unlock. task 2 will never unlock because it's waiting on the transaction commit to happen, the transaction commit is waiting for the outstanding ordered extents, and then the ordered extent thread is blocked waiting on the 0-1MiB range to unlock. To fix this we have to clear anything we've locked so far, wait for the extent_state that we contended on, and then try to re-lock the entire range again. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit c86eab81a23f368d08efd3df96a95f3d0b471f85 Author: David Sterba Date: Fri Oct 7 17:10:02 2022 +0200 btrfs: send: update command for protocol version check For a protocol and command compatibility we have a helper that hasn't been updated for v3 yet. We use it for verity so update where necessary. Fixes: 38622010a6de ("btrfs: send: add support for fs-verity") Signed-off-by: David Sterba commit 9971a741c5f44fd72e664c35be9bc6fedb8a3498 Author: Boris Burkov Date: Tue Sep 27 09:30:39 2022 -0700 btrfs: send: allow protocol version 3 with CONFIG_BTRFS_DEBUG We haven't finalized send stream v3 yet, so gate the send stream version behind CONFIG_BTRFS_DEBUG as we want some way to test it. The original verity send did not check the protocol version, so add that actual protection as well. Reviewed-by: Anand Jain Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 0cf3cae9697bddeeab3eb84b8cabae13c656fbb6 Merge: b15e2e49bfc49 8183602b8cbc4 Author: Paolo Abeni Date: Tue Oct 11 13:46:55 2022 +0200 Merge tag 'linux-can-fixes-for-6.1-20221011' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-10-11 this is a pull request of 4 patches for net/main. Anssi Hannula and Jimmy Assarsson contribute 4 patches for the kvaser_usb driver. A check for actual received length of USB transfers is added, the use of an uninitialized completion is fixed, the TX queue is re-synced after restart, and the CAN state is fixed after restart. * tag 'linux-can-fixes-for-6.1-20221011' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: kvaser_usb_leaf: Fix CAN state after restart can: kvaser_usb_leaf: Fix TX queue out of sync after restart can: kvaser_usb: Fix use of uninitialized completion can: kvaser_usb_leaf: Fix overread with an invalid command ==================== Link: https://lore.kernel.org/r/20221011074815.397301-1-mkl@pengutronix.de Signed-off-by: Paolo Abeni commit 027c3d345e2a1ea61d6e4506a250eb392e6e7b18 Author: Helge Deller Date: Sat Oct 1 00:32:07 2022 +0200 parisc: Convert PDC console to an early console Rewrite the PDC console to become an early console. Beside the fact that now boot information is visible until another (text- or graphics) console takes over, this benefits as well machines with a yet-unsupported STI console and kgdb. Signed-off-by: Helge Deller commit b148766e2b8b7b61c9aef53aefedae33f637a1e7 Author: Helge Deller Date: Wed Sep 28 23:31:20 2022 +0200 parisc: Reduce kernel size by packing alternative tables The values stored in the length and condition fields of the alternative tables fit into 16 bits, so we can save 4 bytes per alternative table entry. Since a typical 32-bit kernel has more than 3000 entries this saves > 12k of storage on disc. bloat-o-meter shows a reduction of -0.01% by this change: Total: Before=10196505, After=10195529, chg -0.01% $ ls -la vmlinux vmlinux.before -rwxr-xr-x 14437324 vmlinux -rwxr-xr-x 14449512 vmlinux.before Signed-off-by: Helge Deller commit 3fac3734c43a2e21fefeb72124d8bd31dff3956f Author: Juergen Gross Date: Mon Sep 26 13:16:56 2022 +0200 xen/pv: support selecting safe/unsafe msr accesses Instead of always doing the safe variants for reading and writing MSRs in Xen PV guests, make the behavior controllable via Kconfig option and a boot parameter. The default will be the current behavior, which is to always use the safe variant. Signed-off-by: Juergen Gross commit a1886b915e81439ba045b1431f3319d37ac1b906 Author: Juergen Gross Date: Mon Sep 26 12:33:03 2022 +0200 xen/pv: refactor msr access functions to support safe and unsafe accesses Refactor and rename xen_read_msr_safe() and xen_write_msr_safe() to support both cases of MSR accesses, safe ones and potentially GP-fault generating ones. This will prepare to no longer swallow GPs silently in xen_read_msr() and xen_write_msr(). Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross commit f90d98bdd06c0f3d1a60462c85324bd61f2a7142 Author: Juergen Gross Date: Wed Oct 5 09:42:33 2022 +0200 xen/pv: fix vendor checks for pmu emulation The CPU vendor checks for pmu emulation are rather limited today, as the assumption seems to be that only Intel and AMD are existing and/or supported vendors. Fix that by handling Centaur and Zhaoxin CPUs the same way as Intel, and Hygon the same way as AMD. While at it fix the return type of is_intel_pmu_msr(). Suggested-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross commit 8714f7bcd3c20d36890f43cc6a8e0c3c17b843aa Author: Juergen Gross Date: Mon Sep 26 08:23:51 2022 +0200 xen/pv: add fault recovery control to pmu msr accesses Today pmu_msr_read() and pmu_msr_write() fall back to the safe variants of read/write MSR in case the MSR access isn't emulated via Xen. Allow the caller to select that faults should not be recovered from by passing NULL for the error pointer. Restructure the code to make it more readable. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross commit abf93f369419249ca482a8911039fe1c75a94227 Author: Kalle Valo Date: Mon Oct 10 19:06:38 2022 +0300 wifi: ath11k: mac: fix reading 16 bytes from a region of size 0 warning Linaro reported stringop-overread warnings in ath11k (this is one of many): drivers/net/wireless/ath/ath11k/mac.c:2238:29: error: 'ath11k_peer_assoc_h_he_limit' reading 16 bytes from a region of size 0 [-Werror=stringop-overread] My further investigation showed that these warnings happen on GCC 11.3 but not with GCC 12.2, and with only the kernel config Linaro provided: https://builds.tuxbuild.com/2F4W7nZHNx3T88RB0gaCZ9hBX6c/config I saw the same warnings both with arm64 and x86_64 builds and KASAN seems to be the reason triggering these warnings with GCC 11. Nobody else has reported this so this seems to be quite rare corner case. I don't know what specific commit started emitting this warning so I can't provide a Fixes tag. The function hasn't been touched for a year. I decided to workaround this by converting the pointer to a new array in stack, and then copying the data to the new array. It's only 16 bytes anyway and this is executed during association, so not in a hotpath. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9 Reported-by: Linux Kernel Functional Testing Link: https://lore.kernel.org/all/CA+G9fYsZ_qypa=jHY_dJ=tqX4515+qrV9n2SWXVDHve826nF7Q@mail.gmail.com/ Signed-off-by: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221010160638.20152-1-kvalo@kernel.org commit 95b0f66649bb04c6c9c15e461ecf9522efe9555c Author: Jose Ignacio Tornos Martinez Date: Mon Oct 10 10:16:11 2022 +0200 wifi: iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue (other cases) BUGs like this are still reproducible: [ 31.509616] list_add corruption. prev->next should be next (ffff8f8644242300), but was ffff8f86493fd300. (prev=ffff8f86493fd300). [ 31.521544] ------------[ cut here ]------------ [ 31.526248] kernel BUG at lib/list_debug.c:30! [ 31.530781] invalid opcode: 0000 [#1] PREEMPT SMP PTI [ 31.535831] CPU: 1 PID: 626 Comm: wpa_supplicant Not tainted 6.0.0+ #7 [ 31.542450] Hardware name: Dell Inc. Inspiron 660s/0478VN , BIOS A07 08/24/2012 [ 31.550484] RIP: 0010:__list_add_valid.cold+0x3a/0x5b [ 31.555537] Code: f2 4c 89 c1 48 89 fe 48 c7 c7 28 20 69 89 e8 4c e3 fd ff 0f 0b 48 89 d1 4c 89 c6 4c 89 ca 48 c7 c7 d0 1f 69 89 e8 35 e3 fd ff <0f> 0b 4c 89 c1 48 c7 c7 78 1f 69 89 e8 24 e3 fd ff 0f 0b 48 c7 c7 [ 31.574605] RSP: 0018:ffff9f6f00dc3748 EFLAGS: 00010286 [ 31.579990] RAX: 0000000000000075 RBX: ffff8f8644242080 RCX: 0000000000000000 [ 31.587155] RDX: 0000000000000201 RSI: ffffffff8967862d RDI: 00000000ffffffff [ 31.594482] RBP: ffff8f86493fd2e8 R08: 0000000000000000 R09: 00000000ffffdfff [ 31.601735] R10: ffff9f6f00dc3608 R11: ffffffff89f46128 R12: ffff8f86493fd300 [ 31.608986] R13: ffff8f86493fd300 R14: ffff8f8644242300 R15: ffff8f8643dd3f2c [ 31.616151] FS: 00007f3bb9a707c0(0000) GS:ffff8f865a300000(0000) knlGS:0000000000000000 [ 31.624447] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 31.630286] CR2: 00007fe3647d5600 CR3: 00000001125a6002 CR4: 00000000000606e0 [ 31.637539] Call Trace: [ 31.639936] [ 31.642143] iwl_mvm_mac_wake_tx_queue+0x71/0x90 [iwlmvm] [ 31.647569] ieee80211_queue_skb+0x4b6/0x720 [mac80211] ... So, it is necessary to extend the applied solution with commit 14a3aacf517a9 ("iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue") to all other cases where the station queues are invalidated and the related lists are not emptied. Because, otherwise as before, if some new element is added later to the list in iwl_mvm_mac_wake_tx_queue, it can match with the old one and produce the same commented BUG. That is, in order to avoid this problem completely, we must also remove the related lists for the other cases when station queues are invalidated. Fixes: cfbc6c4c5b91c ("iwlwifi: mvm: support mac80211 TXQs model") Reported-by: Petr Stourac Tested-by: Petr Stourac Signed-off-by: Jose Ignacio Tornos Martinez Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221010081611.145027-1-jtornosm@redhat.com commit 443dc85ad13eeb0340fa3a555c04a6c04c9b61ed Author: Felix Fietkau Date: Wed Oct 5 15:08:24 2022 +0200 wifi: mt76: fix rx checksum offload on mt7615/mt7915/mt7921 Checking the relevant rxd bits for the checksum information only indicates if the checksum verification was performed by the hardware and doesn't show actual checksum errors. Checksum errors are indicated in the info field of the DMA descriptor. Fix packets erroneously marked as CHECKSUM_UNNECESSARY by checking the extra bits as well. Those bits are only passed to the driver for MMIO devices at the moment, so limit checksum offload to those. Fixes: 2122dfbfd0bd ("mt76: mt7615: add rx checksum offload support") Fixes: 94244d2ea503 ("mt76: mt7915: add rx checksum offload support") Fixes: 0e75732764e8 ("mt76: mt7921: enable rx csum offload") Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221005130824.23371-2-nbd@nbd.name commit 47c44088ac089adfa2f852770ac11e3b7ce8d7c5 Author: Felix Fietkau Date: Wed Oct 5 15:08:23 2022 +0200 wifi: mt76: fix receiving LLC packets on mt7615/mt7915 When 802.3 decap offload is enabled, the hardware indicates header translation failure, whenever either the LLC-SNAP header was not found, or a VLAN header with an unregcognized tag is present. In that case, the hardware inserts a 2-byte length fields after the MAC addresses. For VLAN packets, this tag needs to be removed. However, for 802.3 LLC packets, the length bytes should be preserved, since there is no separate ethertype field in the data. This fixes an issue where the length field was omitted for LLC frames, causing them to be malformed after hardware decap. Fixes: 1eeff0b4c1a6 ("mt76: mt7915: fix decap offload corner case with 4-addr VLAN frames") Reported-by: Chad Monroe Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221005130824.23371-1-nbd@nbd.name commit 97d917879d7f92df09c3f21fd54609a8bcd654b2 Author: Takashi Iwai Date: Tue Oct 11 09:01:47 2022 +0200 ALSA: oss: Fix potential deadlock at unregistration We took sound_oss_mutex around the calls of unregister_sound_special() at unregistering OSS devices. This may, however, lead to a deadlock, because we manage the card release via the card's device object, and the release may happen at unregister_sound_special() call -- which will take sound_oss_mutex again in turn. Although the deadlock might be fixed by relaxing the rawmidi mutex in the previous commit, it's safer to move unregister_sound_special() calls themselves out of the sound_oss_mutex, too. The call is race-safe as the function has a spinlock protection by itself. Link: https://lore.kernel.org/r/CAB7eexJP7w1B0mVgDF0dQ+gWor7UdkiwPczmL7pn91xx8xpzOA@mail.gmail.com Cc: Link: https://lore.kernel.org/r/20221011070147.7611-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit a70aef7982b012e86dfd39fbb235e76a21ae778a Author: Takashi Iwai Date: Tue Oct 11 09:01:46 2022 +0200 ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() The register_mutex taken around the dev_unregister callback call in snd_rawmidi_free() may potentially lead to a mutex deadlock, when OSS emulation and a hot unplug are involved. Since the mutex doesn't protect the actual race (as the registration itself is already protected by another means), let's drop it. Link: https://lore.kernel.org/r/CAB7eexJP7w1B0mVgDF0dQ+gWor7UdkiwPczmL7pn91xx8xpzOA@mail.gmail.com Cc: Link: https://lore.kernel.org/r/20221011070147.7611-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8183602b8cbc4d865068c6c5705228760d30b003 Merge: b15e2e49bfc49 0be1a655fe68c Author: Marc Kleine-Budde Date: Tue Oct 11 08:51:22 2022 +0200 Merge patch series "can: kvaser_usb: Various fixes" Jimmy Assarsson says: Changes in v5: https://lore.kernel.org/all/20221010150829.199676-1-extja@kvaser.com - Split series [1], kept only critical bug fixes that should go into stable, since v4 got rejected [2]. Non-critical fixes are posted in a separate series. Changes in v4: https://lore.kernel.org/all/20220903182344.139-1-extja@kvaser.com - Add Tested-by: Anssi Hannula to [PATCH v4 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device - Update commit message in [PATCH v4 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device Changes in v3: https://lore.kernel.org/all/20220901122729.271-1-extja@kvaser.com - Rebase on top of commit 1d5eeda23f36 ("can: kvaser_usb: advertise timestamping capabilities and add ioctl support") - Add Tested-by: Anssi Hannula - Add stable@vger.kernel.org to CC. - Add my S-o-b to all patches - Fix regression introduced in [PATCH v2 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device found by Anssi Hannula https://lore.kernel.org/all/b25bc059-d776-146d-0b3c-41aecf4bd9f8@bitwise.fi v2: https://lore.kernel.org/all/20220708115709.232815-1-extja@kvaser.com v1: https://lore.kernel.org/all/20220516134748.3724796-1-anssi.hannula@bitwise.fi [1] https://lore.kernel.org/linux-can/20220903182344.139-1-extja@kvaser.com [2] https://lore.kernel.org/linux-can/20220920192708.jcvyph3ec7lscuqj@pengutronix.de Link: https://lore.kernel.org/all/20221010150829.199676-1-extja@kvaser.com [mkl: add/update links] Signed-off-by: Marc Kleine-Budde commit 0be1a655fe68c8e6dcadbcbddb69cf2fb29881f5 Author: Anssi Hannula Date: Mon Oct 10 17:08:29 2022 +0200 can: kvaser_usb_leaf: Fix CAN state after restart can_restart() expects CMD_START_CHIP to set the error state to ERROR_ACTIVE as it calls netif_carrier_on() immediately afterwards. Otherwise the user may immediately trigger restart again and hit a BUG_ON() in can_restart(). Fix kvaser_usb_leaf set_mode(CMD_START_CHIP) to set the expected state. Cc: stable@vger.kernel.org Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson Signed-off-by: Anssi Hannula Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/all/20221010150829.199676-5-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 455561fb618fde40558776b5b8435f9420f335db Author: Anssi Hannula Date: Mon Oct 10 17:08:28 2022 +0200 can: kvaser_usb_leaf: Fix TX queue out of sync after restart The TX queue seems to be implicitly flushed by the hardware during bus-off or bus-off recovery, but the driver does not reset the TX bookkeeping. Despite not resetting TX bookkeeping the driver still re-enables TX queue unconditionally, leading to "cannot find free context" / NETDEV_TX_BUSY errors if the TX queue was full at bus-off time. Fix that by resetting TX bookkeeping on CAN restart. Tested with 0bfd:0124 Kvaser Mini PCI Express 2xHS FW 4.18.778. Cc: stable@vger.kernel.org Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson Signed-off-by: Anssi Hannula Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/all/20221010150829.199676-4-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit cd7f30e174d09a02ca2afa5ef093fb0f0352e0d8 Author: Anssi Hannula Date: Mon Oct 10 17:08:27 2022 +0200 can: kvaser_usb: Fix use of uninitialized completion flush_comp is initialized when CMD_FLUSH_QUEUE is sent to the device and completed when the device sends CMD_FLUSH_QUEUE_RESP. This causes completion of uninitialized completion if the device sends CMD_FLUSH_QUEUE_RESP before CMD_FLUSH_QUEUE is ever sent (e.g. as a response to a flush by a previously bound driver, or a misbehaving device). Fix that by initializing flush_comp in kvaser_usb_init_one() like the other completions. This issue is only triggerable after RX URBs have been set up, i.e. the interface has been opened at least once. Cc: stable@vger.kernel.org Fixes: aec5fb2268b7 ("can: kvaser_usb: Add support for Kvaser USB hydra family") Tested-by: Jimmy Assarsson Signed-off-by: Anssi Hannula Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/all/20221010150829.199676-3-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 1499ecaea9d2ba68d5e18d80573b4561a8dc4ee7 Author: Anssi Hannula Date: Mon Oct 10 17:08:26 2022 +0200 can: kvaser_usb_leaf: Fix overread with an invalid command For command events read from the device, kvaser_usb_leaf_read_bulk_callback() verifies that cmd->len does not exceed the size of the received data, but the actual kvaser_cmd handlers will happily read any kvaser_cmd fields without checking for cmd->len. This can cause an overread if the last cmd in the buffer is shorter than expected for the command type (with cmd->len showing the actual short size). Maximum overread seems to be 22 bytes (CMD_LEAF_LOG_MESSAGE), some of which are delivered to userspace as-is. Fix that by verifying the length of command before handling it. This issue can only occur after RX URBs have been set up, i.e. the interface has been opened at least once. Cc: stable@vger.kernel.org Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson Signed-off-by: Anssi Hannula Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/all/20221010150829.199676-2-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 4f2e56a59b9947b3e698d3cabcb858765c12b1e8 Author: Saranya Gopal Date: Tue Oct 11 10:19:16 2022 +0530 ALSA: hda/realtek: Add Intel Reference SSID to support headset keys This patch fixes the issue with 3.5mm headset keys on RPL-P platform. [ Rearranged the entry in SSID order by tiwai ] Signed-off-by: Saranya Gopal Signed-off-by: Ninad Naik Cc: Link: https://lore.kernel.org/r/20221011044916.2278867-1-saranya.gopal@intel.com Signed-off-by: Takashi Iwai commit 589a2004881f0941ca46146a5de68b3666d1d54a Author: Maxime Ripard Date: Mon Oct 10 16:47:39 2022 +0200 clk: tests: Add tests for notifiers We're recently encountered a regression due to the rates reported through the clk_notifier_data being off when changing parents. Let's add a test suite and a test to make sure that we do get notified and with the proper rates. Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221010-rpi-clk-fixes-again-v1-2-d87ba82ac404@cerno.tech Tested-by: Marek Szyprowski Signed-off-by: Stephen Boyd commit 096f2a0c6469c8a8e70cfbb83345b7ada2929f13 Author: Maxime Ripard Date: Mon Oct 10 16:47:38 2022 +0200 clk: Update req_rate on __clk_recalc_rates() Commit cb1b1dd96241 ("clk: Set req_rate on reparenting") introduced a new function, clk_core_update_orphan_child_rates(), that updates the req_rate field on reparenting. It turns out that that function will interfere with the clock notifying done by __clk_recalc_rates(). This ends up reporting the new rate in both the old_rate and new_rate fields of struct clk_notifier_data. Since clk_core_update_orphan_child_rates() is basically __clk_recalc_rates() without the notifiers, and with the req_rate field update, we can drop clk_core_update_orphan_child_rates() entirely, and make __clk_recalc_rates() update req_rate. However, __clk_recalc_rates() is being called in several code paths: when retrieving a rate (most likely through clk_get_rate()), when changing parents (through clk_set_rate() or clk_hw_reparent()), or when updating the orphan status (through clk_core_reparent_orphans_nolock(), called at registration). Updating req_rate on reparenting or initialisation makes sense, but we shouldn't do it on clk_get_rate(). Thus an extra flag has been added to update or not req_rate depending on the context. Fixes: cb1b1dd96241 ("clk: Set req_rate on reparenting") Link: https://lore.kernel.org/linux-clk/0acc7217-762c-7c0d-45a0-55c384824ce4@samsung.com/ Link: https://lore.kernel.org/linux-clk/Y0QNSx+ZgqKSvPOC@sirena.org.uk/ Reported-by: Marek Szyprowski Reported-by: Mark Brown Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221010-rpi-clk-fixes-again-v1-1-d87ba82ac404@cerno.tech Tested-by: Marek Szyprowski Signed-off-by: Stephen Boyd commit 60bb8154d1d77042a5d43d335a68fdb202302cbe Merge: 5d170fe435e54 e033f40be262c Author: Linus Torvalds Date: Mon Oct 10 20:32:10 2022 -0700 Merge tag 'xfs-6.1-for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Dave Chinner: "There are relatively few updates this cycle; half the cycle was eaten by a grue, the other half was eaten by a tricky data corruption issue that I still haven't entirely solved. Hence there's no major changes in this cycle and it's largely just minor cleanups and small bug fixes: - fixes for filesystem shutdown procedure during a DAX memory failure notification - bug fixes - logic cleanups - log message cleanups - updates to use vfs{g,u}id_t helpers where appropriate" * tag 'xfs-6.1-for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: on memory failure, only shut down fs after scanning all mappings xfs: rearrange the logic and remove the broken comment for xfs_dir2_isxx xfs: trim the mapp array accordingly in xfs_da_grow_inode_int xfs: do not need to check return value of xlog_kvmalloc() xfs: port to vfs{g,u}id_t and associated helpers xfs: remove xfs_setattr_time() declaration xfs: Remove the unneeded result variable xfs: missing space in xfs trace log xfs: simplify if-else condition in xfs_reflink_trim_around_shared xfs: simplify if-else condition in xfs_validate_new_dalign xfs: replace unnecessary seq_printf with seq_puts xfs: clean up "%Ld/%Lu" which doesn't meet C standard xfs: remove redundant else for clean code xfs: remove the redundant word in comment commit 5d170fe435e54cafa599a21521ea65fe9535f537 Merge: 00833408bb164 b4dac1203f398 Author: Linus Torvalds Date: Mon Oct 10 20:28:41 2022 -0700 Merge tag 'f2fs-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "This round looks fairly small comparing to the previous updates and includes mostly minor bug fixes. Nevertheless, as we've still interested in improving the stability, Chao added some debugging methods to diagnoze subtle runtime inconsistency problem. Enhancements: - store all the corruption or failure reasons in superblock - detect meta inode, summary info, and block address inconsistency - increase the limit for reserve_root for low-end devices - add the number of compressed IO in iostat Bug fixes: - DIO write fix for zoned devices - do out-of-place writes for cold files - fix some stat updates (FS_CP_DATA_IO, dirty page count) - fix race condition on setting FI_NO_EXTENT flag - fix data races when freezing super - fix wrong continue condition check in GC - do not allow ATGC for LFS mode In addition, there're some code enhancement and clean-ups as usual" * tag 'f2fs-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (32 commits) f2fs: change to use atomic_t type form sbi.atomic_files f2fs: account swapfile inodes f2fs: allow direct read for zoned device f2fs: support recording errors into superblock f2fs: support recording stop_checkpoint reason into super_block f2fs: remove the unnecessary check in f2fs_xattr_fiemap f2fs: introduce cp_status sysfs entry f2fs: fix to detect corrupted meta ino f2fs: fix to account FS_CP_DATA_IO correctly f2fs: code clean and fix a type error f2fs: add "c_len" into trace_f2fs_update_extent_tree_range for compressed file f2fs: fix to do sanity check on summary info f2fs: port to vfs{g,u}id_t and associated helpers f2fs: fix to do sanity check on destination blkaddr during recovery f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT f2fs: fix race condition on setting FI_NO_EXTENT flag f2fs: remove redundant check in f2fs_sanity_check_cluster f2fs: add static init_idisk_time function to reduce the code f2fs: fix typo f2fs: fix wrong dirty page count when race between mmap and fallocate. ... commit 00833408bb164342990102f272c77983f1ca5e94 Merge: 288fc86067620 a8e633c604476 Author: Linus Torvalds Date: Mon Oct 10 20:21:09 2022 -0700 Merge tag '9p-for-6.1' of https://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: "Smaller buffers for small messages and fixes. The highlight of this is Christian's patch to allocate smaller buffers for most metadata requests: 9p with a big msize would try to allocate large buffers when just 4 or 8k would be more than enough; this brings in nice performance improvements. There's also a few fixes for problems reported by syzkaller (thanks to Schspa Shi, Tetsuo Handa for tests and feedback/patches) as well as some minor cleanup" * tag '9p-for-6.1' of https://github.com/martinetd/linux: net/9p: clarify trans_fd parse_opt failure handling net/9p: add __init/__exit annotations to module init/exit funcs net/9p: use a dedicated spinlock for trans_fd 9p/trans_fd: always use O_NONBLOCK read/write net/9p: allocate appropriate reduced message buffers net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module net/9p: add p9_msg_buf_size() 9p: add P9_ERRMAX for 9p2000 and 9p2000.u net/9p: split message size argument into 't_size' and 'r_size' pair 9p: trans_fd/p9_conn_cancel: drop client lock earlier commit 288fc86067620dcbec34a335b95b75635551e8fe Merge: 4875d2ffb0104 c7d7d2d345697 Author: Linus Torvalds Date: Mon Oct 10 20:13:22 2022 -0700 Merge tag 'gfs2-nopid-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 debugfs updates from Andreas Gruenbacher: - Improve the way how the state of glocks is reported in debugfs for glocks which are not held by processes, but rather by other resouces like cached inodes or flocks. * tag 'gfs2-nopid-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Mark the remaining process-independent glock holders as GL_NOPID gfs2: Mark flock glock holders as GL_NOPID gfs2: Add GL_NOPID flag for process-independent glock holders gfs2: Add flocks to glockfd debugfs file gfs2: Add glockfd debugfs file commit 4875d2ffb0104db625db281944d18e8987f97030 Merge: ac1e8c6c95bf8 74b1b10e29b1f Author: Linus Torvalds Date: Mon Oct 10 20:08:52 2022 -0700 Merge tag 'gfs2-v6.0-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - Make sure to initialize the filesystem work queues before registering the filesystem; this prevents them from being used uninitialized. - On filesystem withdraw: prevent a a double iput() and immediately reject pending locking requests that can no longer succeed. - Use TRY lock in gfs2_inode_lookup() to prevent a rare glock hang during evict. - During filesystem mount, explicitly make sure that the sb_bsize and sb_bsize_shift super block fields are consistent with each other. This prevents messy error messages during fuzz testing. - Switch from strlcpy to strscpy. * tag 'gfs2-v6.0-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Register fs after creating workqueues gfs2: Check sb_bsize_shift after reading superblock gfs2: Switch from strlcpy to strscpy gfs2: Clear flags when withdraw prevents xmote gfs2: Dequeue waiters when withdrawn gfs2: Prevent double iput for journal on error gfs2: Use TRY lock in gfs2_inode_lookup for UNLINKED inodes commit ac1e8c6c95bf805c699656046aef0a05205edfbd Merge: dc914858561c4 958553d13478a Author: Linus Torvalds Date: Mon Oct 10 20:04:22 2022 -0700 Merge tag '6.1-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs updates from Steve French: - data corruption fix when cache disabled - four RDMA (smbdirect) improvements, including enabling support for SoftiWARP - four signing improvements - three directory lease improvements - four cleanup fixes - minor security fix - two debugging improvements * tag '6.1-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: (21 commits) smb3: fix oops in calculating shash_setkey cifs: secmech: use shash_desc directly, remove sdesc smb3: rename encryption/decryption TFMs cifs: replace kfree() with kfree_sensitive() for sensitive data cifs: remove initialization value cifs: Replace a couple of one-element arrays with flexible-array members smb3: do not log confusing message when server returns no network interfaces smb3: define missing create contexts cifs: store a pointer to a fid in the cfid structure instead of the struct cifs: improve handlecaching cifs: Make tcon contain a wrapper structure cached_fids instead of cached_fid smb3: add dynamic trace points for tree disconnect Fix formatting of client smbdirect RDMA logging Handle variable number of SGEs in client smbdirect send. Reduce client smbdirect max receive segment size Decrease the number of SMB3 smbdirect client SGEs cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message cifs: destage dirty pages before re-reading them for cache=none cifs: return correct error in ->calc_signature() MAINTAINERS: Add Tom Talpey as cifs.ko reviewer ... commit dc914858561c424978307561492fcf3145b8b525 Merge: f721d24e5dae8 243a5263014a3 Author: Linus Torvalds Date: Mon Oct 10 19:58:04 2022 -0700 Merge tag 'nfsd-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull more nfsd updates from Chuck Lever: - filecache code clean-ups * tag 'nfsd-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: rework hashtable handling in nfsd_do_file_acquire nfsd: fix nfsd_file_unhash_and_dispose commit f721d24e5dae8358b49b24399d27ba5d12a7e049 Merge: 27bc50fc90647 7d37539037c2f Author: Linus Torvalds Date: Mon Oct 10 19:45:17 2022 -0700 Merge tag 'pull-tmpfile' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs tmpfile updates from Al Viro: "Miklos' ->tmpfile() signature change; pass an unopened struct file to it, let it open the damn thing. Allows to add tmpfile support to FUSE" * tag 'pull-tmpfile' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fuse: implement ->tmpfile() vfs: open inside ->tmpfile() vfs: move open right after ->tmpfile() vfs: make vfs_tmpfile() static ovl: use vfs_tmpfile_open() helper cachefiles: use vfs_tmpfile_open() helper cachefiles: only pass inode to *mark_inode_inuse() helpers cachefiles: tmpfile error handling cleanup hugetlbfs: cleanup mknod and tmpfile vfs: add vfs_tmpfile_open() helper commit b15e2e49bfc4965d86b9bc4a8426d53ec90a7192 Author: Louis Peens Date: Fri Oct 7 11:21:32 2022 +0200 nfp: flower: fix incorrect struct type in GRE key_size Looks like a copy-paste error sneaked in here at some point, causing the key_size for these tunnels to be calculated incorrectly. This size ends up being send to the firmware, causing unexpected behaviour in some cases. Fixes: 78a722af4ad9 ("nfp: flower: compile match for IPv6 tunnels") Reported-by: Chaoyong He Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20221007092132.218386-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 5b4c189d660a9b8a852f0863360eb40a100226fc Author: Marek Behún Date: Fri Oct 7 10:48:44 2022 +0200 net: sfp: fill also 5gbase-r and 25gbase-r modes in sfp_parse_support() Fill in also 5gbase-r and 25gbase-r PHY interface modes into the phy_interface_t bitmap in sfp_parse_support(). Fixes: fd580c983031 ("net: sfp: augment SFP parsing with phy_interface_t bitmap") Signed-off-by: Marek Behún Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20221007084844.20352-1-kabel@kernel.org Signed-off-by: Jakub Kicinski commit a390e03401e908ebfecdab0c53b70ff512f11d71 Author: Florian Fainelli Date: Thu Oct 6 20:42:01 2022 -0700 net: systemport: Enable all RX descriptors for SYSTEMPORT Lite The original commit that added support for the SYSTEMPORT Lite variant halved the number of RX descriptors due to a confusion between the number of descriptors and the number of descriptor words. There are 512 descriptor *words* which means 256 descriptors total. Fixes: 44a4524c54af ("net: systemport: Add support for SYSTEMPORT Lite") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20221007034201.4126054-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 32391e646a71fc4cca4a74740bf401423d7a926d Author: Maksym Glubokiy Date: Thu Oct 6 22:06:00 2022 +0300 net: prestera: span: do not unbind things things that were never bound Fixes: 13defa275eef ("net: marvell: prestera: Add matchall support") Signed-off-by: Maksym Glubokiy Link: https://lore.kernel.org/r/20221006190600.881740-1-maksym.glubokiy@plvision.eu Signed-off-by: Jakub Kicinski commit 27bc50fc90647bbf7b734c3fc306a5e61350da53 Merge: 70442fc54e688 bbff39cc6cbcb Author: Linus Torvalds Date: Mon Oct 10 17:53:04 2022 -0700 Merge tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull MM updates from Andrew Morton: - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in linux-next for a couple of months without, to my knowledge, any negative reports (or any positive ones, come to that). - Also the Maple Tree from Liam Howlett. An overlapping range-based tree for vmas. It it apparently slightly more efficient in its own right, but is mainly targeted at enabling work to reduce mmap_lock contention. Liam has identified a number of other tree users in the kernel which could be beneficially onverted to mapletrees. Yu Zhao has identified a hard-to-hit but "easy to fix" lockdep splat at [1]. This has yet to be addressed due to Liam's unfortunately timed vacation. He is now back and we'll get this fixed up. - Dmitry Vyukov introduces KMSAN: the Kernel Memory Sanitizer. It uses clang-generated instrumentation to detect used-unintialized bugs down to the single bit level. KMSAN keeps finding bugs. New ones, as well as the legacy ones. - Yang Shi adds a userspace mechanism (madvise) to induce a collapse of memory into THPs. - Zach O'Keefe has expanded Yang Shi's madvise(MADV_COLLAPSE) to support file/shmem-backed pages. - userfaultfd updates from Axel Rasmussen - zsmalloc cleanups from Alexey Romanov - cleanups from Miaohe Lin: vmscan, hugetlb_cgroup, hugetlb and memory-failure - Huang Ying adds enhancements to NUMA balancing memory tiering mode's page promotion, with a new way of detecting hot pages. - memcg updates from Shakeel Butt: charging optimizations and reduced memory consumption. - memcg cleanups from Kairui Song. - memcg fixes and cleanups from Johannes Weiner. - Vishal Moola provides more folio conversions - Zhang Yi removed ll_rw_block() :( - migration enhancements from Peter Xu - migration error-path bugfixes from Huang Ying - Aneesh Kumar added ability for a device driver to alter the memory tiering promotion paths. For optimizations by PMEM drivers, DRM drivers, etc. - vma merging improvements from Jakub Matěn. - NUMA hinting cleanups from David Hildenbrand. - xu xin added aditional userspace visibility into KSM merging activity. - THP & KSM code consolidation from Qi Zheng. - more folio work from Matthew Wilcox. - KASAN updates from Andrey Konovalov. - DAMON cleanups from Kaixu Xia. - DAMON work from SeongJae Park: fixes, cleanups. - hugetlb sysfs cleanups from Muchun Song. - Mike Kravetz fixes locking issues in hugetlbfs and in hugetlb core. Link: https://lkml.kernel.org/r/CAOUHufZabH85CeUN-MEMgL8gJGzJEWUrkiM58JkTbBhh-jew0Q@mail.gmail.com [1] * tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (555 commits) hugetlb: allocate vma lock for all sharable vmas hugetlb: take hugetlb vma_lock when clearing vma_lock->vma pointer hugetlb: fix vma lock handling during split vma and range unmapping mglru: mm/vmscan.c: fix imprecise comments mm/mglru: don't sync disk for each aging cycle mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol mm: memcontrol: use do_memsw_account() in a few more places mm: memcontrol: deprecate swapaccounting=0 mode mm: memcontrol: don't allocate cgroup swap arrays when memcg is disabled mm/secretmem: remove reduntant return value mm/hugetlb: add available_huge_pages() func mm: remove unused inline functions from include/linux/mm_inline.h selftests/vm: add selftest for MADV_COLLAPSE of uffd-minor memory selftests/vm: add file/shmem MADV_COLLAPSE selftest for cleared pmd selftests/vm: add thp collapse shmem testing selftests/vm: add thp collapse file and tmpfs testing selftests/vm: modularize thp collapse memory operations selftests/vm: dedup THP helpers mm/khugepaged: add tracepoint to hpage_collapse_scan_file() mm/madvise: add file and shmem support to MADV_COLLAPSE ... commit 70442fc54e6889a2a77f0e9554e8188a1557f00e Merge: e2302539dd4f1 c5129ecc12a31 Author: Linus Torvalds Date: Mon Oct 10 17:13:07 2022 -0700 Merge tag 'x86_mm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Dave Hansen: "There are some small things here, plus one big one. The big one detected and refused to create W+X kernel mappings. This caused a bit of trouble and it is entirely disabled on 32-bit due to known unfixable EFI issues. It also oopsed on some systemd eBPF use, which kept some users from booting. The eBPF issue is fixed, but those troubles were caught relatively recently which made me nervous that there are more lurking. The final commit in here retains the warnings, but doesn't actually refuse to create W+X mappings. Summary: - Detect insecure W+X mappings and warn about them, including a few bug fixes and relaxing the enforcement - Do a long-overdue defconfig update and enabling W+X boot-time detection - Cleanup _PAGE_PSE handling (follow-up on an earlier bug) - Rename a change_page_attr function" * tag 'x86_mm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Ease W^X enforcement back to just a warning x86/mm: Disable W^X detection and enforcement on 32-bit x86/mm: Add prot_sethuge() helper to abstract out _PAGE_PSE handling x86/mm/32: Fix W^X detection when page tables do not support NX x86/defconfig: Enable CONFIG_DEBUG_WX=y x86/defconfig: Refresh the defconfigs x86/mm: Refuse W^X violations x86/mm: Rename set_memory_present() to set_memory_p() commit faf4d8e07f5b67bece91723ad3e8b3f88a3dbf23 Author: Guenter Roeck Date: Sun Oct 9 23:05:12 2022 -0700 drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() [take 2] Commit 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()") tried to fix an array bounds error seen with gcc 12.0. Unfortunately, that results in another array bounds error, seen with older versions of gcc. Building csky:allmodconfig ... failed -------------- Error log: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function 'dc_stream_remove_writeback': drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:83: error: array subscript 1 is above array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds] 527 | stream->writeback_info[j] = stream->writeback_info[i]; | ~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:1269, from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:29, from drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc_common.h:29, from drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:27: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_stream.h:241:34: note: while referencing 'writeback_info' 241 | struct dc_writeback_info writeback_info[MAX_DWB_PIPES]; We could check both i and j for overflow to fix the problem. That would, however, be not make much sense since it is known and provable that j <= i. Also, the check introduced with commit 5d8c3e836fc2 does not really add value since it checks if j < MAX_DWB_PIPES. Since it is known that j <= i, it would make more sense to check if i < MAX_DWB_PIPES. Unfortunately, that does not help to solve the problem observed here: gcc still complains. To solve the problem, replace the subsequent check for 'i != j' with 'j < i'. This is identical to the original check since we know that j <= i, and it makes all versions of gcc happy. Drop the check introduced with commit 5d8c3e836fc2 since it is not really useful and does not solve the problem. Cc: Aurabindo Pillai Cc: Hamza Mahfooz Fixes: 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()") Signed-off-by: Guenter Roeck Signed-off-by: Alex Deucher commit d2bd0831b51d1123fc86c019db3452d6a1ce5029 Author: Alexey Kodanev Date: Tue Oct 4 11:14:02 2022 +0300 drm/amd/pm: smu7_hwmgr: fix potential off-by-one overflow in 'performance_levels' Since 'hardwareActivityPerformanceLevels' is set to the size of the 'performance_levels' array in smu7_hwmgr_backend_init(), using the '<=' assertion to check for the next index value is incorrect. Replace it with '<'. Detected using the static analysis tool - Svace. Fixes: 599a7e9fe1b6 ("drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.") Reviewed-by: Evan Quan Signed-off-by: Alexey Kodanev Signed-off-by: Alex Deucher commit 2cc4a5914ce952d6fc83b0f8089a23095ad4f677 Author: Alexey Kodanev Date: Tue Oct 4 11:14:01 2022 +0300 drm/amd/pm: vega10_hwmgr: fix potential off-by-one overflow in 'performance_levels' Since 'hardwareActivityPerformanceLevels' is set to the size of the 'performance_levels' array in vega10_hwmgr_backend_init(), using the '<=' assertion to check for the next index value is incorrect. Replace it with '<'. Detected using the static analysis tool - Svace. Fixes: f83a9991648b ("drm/amd/powerplay: add Vega10 powerplay support (v5)") Reviewed-by: Evan Quan Signed-off-by: Alexey Kodanev Signed-off-by: Alex Deucher commit a98cec220aa4b2502704aa0196da1bdc9eb455b4 Author: Alex Deucher Date: Thu Oct 6 15:53:10 2022 -0400 drm/amdgpu: fix SDMA suspend/resume on SR-IOV Update all SDMA versions that support SR-IOV to properly tear down the ttm buffer functions on suspend. Tested-by: Bokun Zhang Signed-off-by: Alex Deucher commit 571c053658926df3321633b7133f574d3e656c81 Author: Alex Deucher Date: Thu Oct 6 15:31:40 2022 -0400 drm/amdgpu: switch sdma buffer function tear down to a helper Switch all of the SDMA implementations to use the helper to tear down the ttm buffer manager. Tested-by: Bokun Zhang Signed-off-by: Alex Deucher commit e5da651985be20616a9e0662032e0ea2ee4dd468 Author: Bokun Zhang Date: Fri Oct 7 02:08:38 2022 +0800 drm/amdgpu: Fix SDMA engine resume issue under SRIOV - Under SRIOV, SDMA engine is shared between VFs. Therefore, we will not stop SDMA during hw_fini. This is not an issue with normal dirver loading and unloading. - However, when we put the SDMA engine to suspend state and resume it, the issue starts to show up. Something could attempt to use that SDMA engine to clear or move memory before the engine is initialized since the DRM entity is still there. - Therefore, we will call sdma_v5_2_enable(false) during hw_fini, and if we are under SRIOV, we will call sdma_v5_2_enable(true) afterwards to allow other VFs to use SDMA. This way, the DRM entity of SDMA engine is emptied and it will follow the flow of resume code path. Tested-by: Bokun Zhang Signed-off-by: Bokun Zhang Signed-off-by: Alex Deucher commit 9799702360d51a714e888fef4ab5fb9123dfb41f Author: Alvin Lee Date: Wed Jun 29 12:35:12 2022 -0400 drm/amd/display: Fix watermark calculation Watermark calculation was incorrect due to missing brackets. Fixes: 85f4bc0c333c ("drm/amd/display: Add SubVP required code") Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0 commit c8588697aa4ec1f3b7fc09277cf2a5a662d40834 Author: Rodrigo Siqueira Date: Tue Sep 27 18:30:08 2022 -0400 drm/amd/display: Drop uncessary OTG lock check The OTG_MASTER_UPDATE_LOCK_SEL is used for GSL and OTGs in the same group for selecting the OTG_MASTER_UPDATE_LOCK from the same OTG. At some point, it a check was added to see if OTG is running or not, which is not necessary, and for this reason, this commit dropped that check. Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 15e8b368981e1e8420f08b35bb12b794b200f4a0 Author: Rodrigo Siqueira Date: Fri Mar 12 11:58:57 2021 -0500 drm/amd/display: Use set_vtotal_min_max to configure OTG VTOTAL In multiple parts of the DCN code, we write directly to the OTG_V_TOTAL_* registers in some OPTC functions. Let's avoid it by using the set_vtotal_min_max. Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1298d9ab848653fc35431581d6e36662c7b6935a Author: Rodrigo Siqueira Date: Tue Sep 27 17:59:05 2022 -0400 drm/amd/display: Add a missing hook to DCN20 The struct timing_generator_funcs provides a hook for setting up the maximum possible vertical dimension of display for OTG, as the panel supports. DCN10 has a standard function named optc1_set_vtotal_min_max which all ASICs can use to set the aforementioned hook. Since we did not set it for DCN20, this commit initializes the set_vtotal_min_max with the DCN10 function. Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit ba30b223c93ec5af63993b6397cd7316e5acb6c1 Author: Dmytro Laktyushkin Date: Tue Oct 4 13:30:51 2022 -0400 drm/amd/display: always allow pstate change when no dpps are active on dcn315 Prevents certain configs blocking s0i3 when streams aren't completely removed Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit 6f4f8ff567c48823f8279206e236643e8e8f377e Author: Meenakshikumar Somasundaram Date: Thu Sep 29 23:55:41 2022 -0400 drm/amd/display: Display does not light up after S4 resume [Why] Dpia hpd interrupt processing is disabled when entering S4/S0i3 and would be reenabled after detection completes during resuming. Because, keeping hpd interrupts enabled during detection leads to multiple detections for the same hpd transition. There is a S4 case where dpia hpd interrupt is missed when driver is in transitioning from hpd interrupt processing disable to enable and the display does not light up. [How] - Added dmub inbox command DMUB_CMD__DPIA_HPD_INT_ENABLE to explicitly control dmub to issue dpia hpd interrupt or not. If dpia hpd interrupt is disabled, dmub will keep the hpd pending and post it once driver reenables dpia hpd interrupt or when querying with DMUB_CMD__QUERY_HPD_STATE. - Added dmub boot option dpia_hpd_int_enable_supported to notify dmub about whether DMUB_CMD__DPIA_HPD_INT_ENABLE command would be used. Tested-by: Daniel Wheeler Reviewed-by: Mustapha Ghaddar Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Meenakshikumar Somasundaram Signed-off-by: Alex Deucher commit b73353f7f3d434e90da9f0e127bba1fe26cb1287 Author: Max Tseng Date: Sun Oct 2 20:45:37 2022 +0800 drm/amd/display: Use the same cursor info across features Since different features would need to update cursor registers, However, they would use different approaches. To unify varied methods, this refactor is implemented the same update cursor info method for current varied features. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Max Tseng Signed-off-by: Alex Deucher commit 3867bbd44f2894a4e2b01286b3b378c058992cd7 Author: Dillon Varone Date: Sat Oct 1 11:51:48 2022 -0400 drm/amd/display: Fix bug preventing FCLK Pstate allow message being sent [Why & How] FCLK pstate allow message should not be dependent on local "update_fclk". Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit d6170e418d1d3ae7e98cb6d96d1444e880131bbf Author: Dillon Varone Date: Wed Sep 28 15:44:38 2022 -0400 drm/amd/display: Acquire FCLK DPM levels on DCN32 [Why & How] Acquire FCLK DPM levels to properly construct DML clock limits. Further add new logic to keep number of indices for each clock in clk_mgr. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 876fcc4222e1d0e5b73343f4010a8b66be058f48 Author: Fangzhi Zuo Date: Tue Aug 30 12:12:53 2022 -0400 drm/amd/display: Validate DSC After Enable All New CRTCs Before enabling new crtc, stream_count in dc_state does not sync with that in drm_atomic_state. Validating dsc in such case would leave newly added stream not jointly participating in dsc optimization with existing streams, but simply using default initialized vcpi all the time which gives wrong dsc determination decision. Consider the scenaio where one 4k60 connected to the dock under dp-alt mode. Since dp-alt mode is 2-lane setup, stream 1 consumes 63 slots with dsc needed. Then hook up a second 4k60 to the dock. stream 2 connected with 65 slot initialized by default without dsc. dsc pre validate will not jointly optimize stream 2 with stream 1 before crtc 2 added into the dc_state. That leads to stream 2 not getting dsc optimization, and trigger atomic_check failure all the time, as 65 > 63 limit. After getting all new crtcs added into the state, stream_count in dc_state correctly reflect that in drm_atomic_state which comes up with correct dsc decision. Fixes: 71be4b16d39a ("drm/amd/display: dsc validate fail not pass to atomic check") Tested-by: Daniel Wheeler Reviewed-by: Roman Li Acked-by: Qingqing Zhuo Signed-off-by: Fangzhi Zuo Tested-by: Mark Broadworth Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 20dad3813b3c15d118bda0496711eb7dff98e74a Author: Jun Lei Date: Thu Sep 29 15:47:31 2022 -0400 drm/amd/display: Add a helper to map ODM/MPC/Multi-Plane resources [Why & How] Add a helper to map ODM/MPC/Multi-Plane resources from DC Tested-by: Daniel Wheeler Reviewed-by: Nevenko Stupar Reviewed-by: Chaitanya Dhere Acked-by: Qingqing Zhuo Signed-off-by: Jun Lei Signed-off-by: Alex Deucher commit e2302539dd4f1c62d96651c07ddb05aa2461d29c Merge: 34fdd22c8fd9c e3ddb8bbe0f8c Author: Linus Torvalds Date: Mon Oct 10 14:21:11 2022 -0700 Merge tag 'xtensa-20221010' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa updates from Max Filippov: - add support for FDPIC and static PIE executable formats for noMMU * tag 'xtensa-20221010' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: add FDPIC and static PIE support for noMMU xtensa: clean up ELF_PLAT_INIT macro commit 34fdd22c8fd9c5ebda999b5bb1bfe25f293bd030 Merge: 8aeab132e05fe 404b7577cee2d Author: Linus Torvalds Date: Mon Oct 10 14:19:05 2022 -0700 Merge tag 'm68knommu-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "Just a couple of changes. Fixes to compilation of the old/legacy Freescale 68328 targets in some kernel configurations, and some default configuration updates. Summary: - fix build problems for legacy 68328 targets - clean out configs of removed options" * tag 'm68knommu-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: update config files m68knommu: fix non-mmu classic 68000 legacy timer tick selection m68knommu: fix non-specific 68328 choice interrupt build failure commit fa28030a83a6302f8724cdbf0c477536b2101033 Author: Vladimir Stempen Date: Thu Sep 29 13:32:50 2022 -0400 drm/amd/display: increase hardware status wait time [Why] Diagnostics reports exceptions generated when timeout waiting for DISPCLK frequency divider change expires when testing ODM4to1. Diagnostics reports exceptions generated when timeout waiting for OTG busy status expires when disabling OTG during ODM4to1 test. [How] Increase HW status waiting time for DISPCLK frequency divider change and OTG busy status when disable OTG. Tested-by: Daniel Wheeler Reviewed-by: Ariel Bernstein Acked-by: Qingqing Zhuo Signed-off-by: Vladimir Stempen Signed-off-by: Alex Deucher commit e50f67cf5e168d92e24cfb61fb11f2f0a35708cd Author: Aurabindo Pillai Date: Thu Sep 29 11:15:12 2022 -0400 drm/amd/display: Do not trigger timing sync for phantom pipes [Why&How] Doing timing sync seqence for phantom pipes will not go through since they are not fully programmed like normal pipes. Skip the sequence on such pipes Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit c19d3eace484ca5627817a1de85af1de06d538b6 Author: Dillon Varone Date: Wed Sep 28 16:33:47 2022 -0400 drm/amd/display: Use correct pixel clock to program DTBCLK DTO's [Why?] Currently phy_pix_clk is used to program DTO's which is incorrect. [How?] Use the timing pixel clock to program DTO's correctly. Reviewed-by: Martin Leung Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 2fd23d467d4fb4e9bb3c3758ee49799f690f5f72 Author: Josip Pavic Date: Fri Sep 23 15:29:07 2022 -0400 drm/amd/display: do not compare integers of different widths [Why & How] Increase width of some variables to avoid comparing integers of different widths Reviewed-by: Alvin Lee Tested-by: Daniel Wheeler Acked-by: Qingqing Zhuo Signed-off-by: Josip Pavic Signed-off-by: Alex Deucher commit 5ff32b52995155f91de582124485d0f0f8881363 Author: Martin Leung Date: Tue Sep 27 18:13:38 2022 -0400 drm/amd/display: zeromem mypipe heap struct before using it [Why & How] bug was caused when moving variable from stack to heap because it was reusable and garbage was left over, so we need to zero mem Fixes: 7acc487ab57e ("drm/amd/display: reduce stack size in dcn32 dml (v2)") Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Acked-by: Qingqing Zhuo Signed-off-by: Martin Leung Cc: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit eae2331899f9dcc923d37d1d753f2de847c92359 Author: Vladimir Stempen Date: Thu Sep 22 15:03:05 2022 -0400 drm/amd/display: properly configure DCFCLK when enable/disable Freesync [Why] Bandwidth validation is using Freesync parameters from previous Freesync state. Bandwidth validation ignores DCFCLK calculated after Freesync parameters are configured [How] Set Freesync bandwidth parameters to its default state before running bandwidth validation. Take DCFCLK calculated after Freesync bandwidth parameters are assigned and bandwidth is recalculated. Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Vladimir Stempen Signed-off-by: Alex Deucher commit 99243fd1f3ca40d487209ac76241de0478962a9d Author: Dillon Varone Date: Tue Sep 27 12:35:10 2022 -0400 Revert "drm/amd/display: skip commit minimal transition state" This reverts commit e4e481e4d838f30985dd46d43ed195110ed265f5. [Why & How] The reverted commit creates memory leak and causes issue upon driver install. Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 4f5bdde386d3b8e9317df5562950e1b4fa177599 Author: Nicholas Kazlauskas Date: Fri Sep 9 15:24:55 2022 -0400 drm/amd/display: Update PMFW z-state interface for DCN314 [Why] Request from PMFW to change the messaging format to specify whether we support z-state via individual bits. [How] Update the args we pass in the support message. Fixes: d5c6909e7460 ("drm/amd/display: Add DCN314 clock manager") Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Reviewed-by: Mario Limonciello Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0 commit 6094b9136ca9038b61e9c4b5d25cd5512ce50b34 Author: Shirish S Date: Fri Oct 7 20:31:49 2022 +0530 drm/amd/display: explicitly disable psr_feature_enable appropriately [Why] If psr_feature_enable is set to true by default, it continues to be enabled for non capable links. [How] explicitly disable the feature on links that are not capable of the same. Fixes: 8c322309e48e9 ("drm/amd/display: Enable PSR") Signed-off-by: Shirish S Reviewed-by: Leo Li Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.15+ commit 03db7716159477b595e9af01be8003b7e994cc79 Author: Tejun Heo Date: Mon Oct 10 11:08:17 2022 -1000 Revert "cgroup: enable cgroup_get_from_file() on cgroup1" This reverts commit f3a2aebdd6fb90e444d595e46de64e822af419da. The commit enabled looking up v1 cgroups via cgroup_get_from_file(). However, there are multiple users, including CLONE_INTO_CGROUP, which have been assuming that it would only look up v2 cgroups. Returning v1 cgroups breaks them. Let's revert the commit and retry later with a separate lookup interface which allows both v1 and v2. Signed-off-by: Tejun Heo Link: http://lkml.kernel.org/r/000000000000385cbf05ea3f1862@google.com Cc: Yosry Ahmed commit 8aeab132e05fefc3a1a5277878629586bd7a3547 Merge: 0e0073eb1b60f 71491c54eafa3 Author: Linus Torvalds Date: Mon Oct 10 14:02:53 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: - 9k mtu perf improvements - vdpa feature provisioning - virtio blk SECURE ERASE support - fixes and cleanups all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio_pci: don't try to use intxif pin is zero vDPA: conditionally read MTU and MAC in dev cfg space vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill vDPA: check virtio device features to detect MQ vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence vDPA: only report driver features if FEATURES_OK is set vDPA: allow userspace to query features of a vDPA device virtio_blk: add SECURE ERASE command support vp_vdpa: support feature provisioning vdpa_sim_net: support feature provisioning vdpa: device feature provisioning virtio-net: use mtu size as buffer length for big packets virtio-net: introduce and use helper function for guest gso support checks virtio: drop vp_legacy_set_queue_size virtio_ring: make vring_alloc_queue_packed prettier virtio_ring: split: Operators use unified style vhost: add __init/__exit annotations to module init/exit funcs commit 0e0073eb1b60f4ec6faecea034a6772fe1409a88 Merge: aa512c115a09d 154fb14df7a3c Author: Linus Torvalds Date: Mon Oct 10 13:59:01 2022 -0700 Merge tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: - Remove unnecessary delay while probing for VMBus (Stanislav Kinsburskiy) - Optimize vmbus_on_event (Saurabh Sengar) - Fix a race in Hyper-V DRM driver (Saurabh Sengar) - Miscellaneous clean-up patches from various people * tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: Replace kmap() with kmap_local_page() drm/hyperv: Add ratelimit on error message hyperv: simplify and rename generate_guest_id Drivers: hv: vmbus: Split memcpy of flex-array scsi: storvsc: remove an extraneous "to" in a comment Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization Drivers: hv: vmbus: Use PCI_VENDOR_ID_MICROSOFT for better discoverability Drivers: hv: vmbus: Fix kernel-doc drm/hyperv: Don't overwrite dirt_needed value set by host Drivers: hv: vmbus: Optimize vmbus_on_event commit aa512c115a09d9133dcb09466e39f93f99a82fdb Merge: f848b3cda39b5 e021563fd09e1 Author: Linus Torvalds Date: Mon Oct 10 13:52:14 2022 -0700 Merge tag 'thermal-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more thermal control updates from Rafael Wysocki: "These fix assorted issues in the thermal core and ARM thermal drivers. Specifics: - Use platform data to get the sensor ID instead of parsing the device in imx_sc thermal driver and remove the dedicated OF function from the core code (Daniel Lezcano). - Fix Kconfig dependency for the QCom tsens thermal driver (Jonathan Cameron). - Add missing const annotation to the RCar ops thermal driver (Lad Prabhakar). - Drop duplicate parameter check from thermal_zone_device_register_with_trips() (Lad Prabhakar). - Fix NULL pointer dereference in trip_point_temp_store() by making it check if the ->set_trip_temp() operation is present (Lad Prabhakar). - Fix the MSM8939 fourth sensor hardware ID in the QCom tsens thermal driver (Vincent Knecht)" * tag 'thermal-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id thermal/core: Add a check before calling set_trip_temp() thermal/core: Drop valid pointer check for type thermal/drivers/rcar_thermal: Constify static thermal_zone_device_ops thermal/drivers/qcom: Drop false build dependency of all QCOM drivers on QCOM_TSENS thermal/of: Remove the thermal_zone_of_get_sensor_id() function thermal/drivers/imx_sc: Rely on the platform data to get the resource id commit f848b3cda39b5d41746040eb51f8e87a685bf0d9 Merge: 3a1e24fa70a06 f7e6b99f22f22 Author: Linus Torvalds Date: Mon Oct 10 13:39:03 2022 -0700 Merge tag 'pm-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These update the turbostat utility, extend the macros used for defining device power management callbacks and add a diagnostic message to the generic power domains code. Specifics: - Add an error message to be printed when a power domain marked as "always on" is not actually on during initialization (Johan Hovold). - Extend macros used for defining power management callbacks to allow conditional exporting of noirq and late/early suspend/resume PM callbacks (Paul Cercueil). - Update the turbostat utility: - Add support for two new platforms (Zhang Rui). - Adjust energy unit for Sapphire Rapids (Zhang Rui). - Do not dump TRL if turbo is not supported (Artem Bityutskiy)" * tag 'pm-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: tools/power turbostat: version 2022.10.04 tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain tools/power turbostat: Do not dump TRL if turbo is not supported tools/power turbostat: Add support for MeteorLake platforms tools/power turbostat: Add support for RPL-S PM: Improve EXPORT_*_DEV_PM_OPS macros PM: domains: log failures to register always-on domains commit 3a1e24fa70a06ab6b087361ffe90d4cb5e1d059d Merge: 10b22b533ee2c 056a81549c272 Author: Linus Torvalds Date: Mon Oct 10 13:28:06 2022 -0700 Merge tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These fix two issues, in APEI and in the int3472 driver, clean up the ACPI thermal driver, add ACPI support for non-GPE system wakeup events and make the system reboot code use the S5 (system off) state by default. Specifics: - Fix ACPI device object reference counting in (recently updated) skl_int3472_fill_clk_pdata() (Andy Shevchenko). - Fix a memory leak in APEI by avoiding to add a task_work to kernel threads running when an asynchronous error is detected (Shuai Xue). - Add ACPI support for handling system wakeups via GPIO wake capable IRQs in addition to GPEs (Raul E Rangel). - Make the system reboot code put ACPI-enabled systems into the S5 (system off) state which is necessary for some platforms to work as expected (Kai-Heng Feng). - Make the white space usage in the ACPI thermal driver more consistent and drop redundant code from it (Rafael Wysocki)" * tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: thermal: Drop some redundant code ACPI: thermal: Drop redundant parens from expressions ACPI: thermal: Use white space more consistently platform/x86: int3472: Don't leak reference on error ACPI: APEI: do not add task_work to kernel thread to avoid memory leak PM: ACPI: reboot: Reinstate S5 for reboot kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle i2c: acpi: Use ACPI wake capability bit to set wake_irq ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get commit 10b22b533ee2c9621f8ab74cf9df1021b5731dbc Merge: f23cdfcd04f7c c9cb01369b926 Author: Linus Torvalds Date: Mon Oct 10 13:24:55 2022 -0700 Merge tag 'dma-mapping-6.1-2022-10-10' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - fix a regression in the ARM dma-direct conversion (Christoph Hellwig) - use memcpy_{from,to}_page (Fabio M. De Francesco) - cleanup the swiotlb MAINTAINERS entry (Lukas Bulwahn) - make SG table pool allocation less fragile (Masahiro Yamada) - don't panic on swiotlb initialization failure (Robin Murphy) * tag 'dma-mapping-6.1-2022-10-10' of git://git.infradead.org/users/hch/dma-mapping: ARM/dma-mapping: remove the dma_coherent member of struct dev_archdata ARM/dma-mappіng: don't override ->dma_coherent when set from a bus notifier lib/sg_pool: change module_init(sg_pool_init) to subsys_initcall MAINTAINERS: merge SWIOTLB SUBSYSTEM into DMA MAPPING HELPERS swiotlb: don't panic! swiotlb: replace kmap_atomic() with memcpy_{from,to}_page() commit 46307fd6e27a3f678a1678b02e667678c22aa8cc Author: Michal Koutný Date: Mon Oct 10 10:29:18 2022 +0200 cgroup: Reorganize css_set_lock and kernfs path processing The commit 74e4b956eb1c incorrectly wrapped kernfs_walk_and_get (might_sleep) under css_set_lock (spinlock). css_set_lock is needed by __cset_cgroup_from_root to ensure stable cset->cgrp_links but not for kernfs_walk_and_get. We only need to make sure that the returned root_cgrp won't be freed under us. This is given in the case of global root because it is static (cgrp_dfl_root.cgrp). When the root_cgrp is lower in the hierarchy, it is pinned by cgroup_ns->root_cset (and `current` task cannot switch namespace asynchronously so ns_proxy pins cgroup_ns). Note this reasoning won't hold for root cgroups in v1 hierarchies, therefore create a special-cased helper function just for the default hierarchy. Fixes: 74e4b956eb1c ("cgroup: Honor caller's cgroup NS when resolving path") Reported-by: Dan Carpenter Signed-off-by: Michal Koutný Signed-off-by: Tejun Heo commit f23cdfcd04f7c044ee47dac04484b8d289088776 Merge: 706eacadd5c5c 38713c6028a31 Author: Linus Torvalds Date: Mon Oct 10 13:20:53 2022 -0700 Merge tag 'iommu-updates-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: - remove the bus_set_iommu() interface which became unnecesary because of IOMMU per-device probing - make the dma-iommu.h header private - Intel VT-d changes from Lu Baolu: - Decouple PASID and PRI from SVA - Add ESRTPS & ESIRTPS capability check - Cleanups - Apple DART support for the M1 Pro/MAX SOCs - support for AMD IOMMUv2 page-tables for the DMA-API layer. The v2 page-tables are compatible with the x86 CPU page-tables. Using them for DMA-API prepares support for hardware-assisted IOMMU virtualization - support for MT6795 Helio X10 M4Us in the Mediatek IOMMU driver - some smaller fixes and cleanups * tag 'iommu-updates-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (59 commits) iommu/vt-d: Avoid unnecessary global DMA cache invalidation iommu/vt-d: Avoid unnecessary global IRTE cache invalidation iommu/vt-d: Rename cap_5lp_support to cap_fl5lp_support iommu/vt-d: Remove pasid_set_eafe() iommu/vt-d: Decouple PASID & PRI enabling from SVA iommu/vt-d: Remove unnecessary SVA data accesses in page fault path dt-bindings: iommu: arm,smmu-v3: Relax order of interrupt names iommu: dart: Support t6000 variant iommu/io-pgtable-dart: Add DART PTE support for t6000 iommu/io-pgtable: Add DART subpage protection support iommu/io-pgtable: Move Apple DART support to its own file iommu/mediatek: Add support for MT6795 Helio X10 M4Us iommu/mediatek: Introduce new flag TF_PORT_TO_ADDR_MT8173 dt-bindings: mediatek: Add bindings for MT6795 M4U iommu/iova: Fix module config properly iommu/amd: Fix sparse warning iommu/amd: Remove outdated comment iommu/amd: Free domain ID after domain_flush_pages iommu/amd: Free domain id in error path iommu/virtio: Fix compile error with viommu_capable() ... commit 706eacadd5c5cc13510ba69eea2917c2ce5ffa99 Merge: ada3bfb6492a6 7a7f58575483a Author: Linus Torvalds Date: Mon Oct 10 13:13:51 2022 -0700 Merge tag 'devicetree-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "DT core: - Fix node refcounting in of_find_last_cache_level() - Constify device_node in of_device_compatible_match() - Fix 'dma-ranges' handling in bus controller nodes - Fix handling of initrd start > end - Improve error reporting in of_irq_init() - Taint kernel on DT unittest running - Use strscpy instead of strlcpy - Add a build target, dt_compatible_check, to check for compatible strings used in kernel sources against compatible strings in DT schemas. - Handle DT_SCHEMA_FILES changes when rebuilding DT bindings: - LED bindings for MT6370 PMIC - Convert Mediatek mtk-gce mailbox, MIPS CPU interrupt controller, mt7621 I2C, virtio,pci-iommu, nxp,tda998x, QCom fastrpc, qcom,pdc, and arm,versatile-sysreg to DT schema format - Add nvmem cells to u-boot,env schema - Add more LED_COLOR_ID definitions - Require 'opp-table' uses to be a node - Various schema fixes to match QEMU 'virt' DT usage - Tree wide dropping of redundant 'Device Tree Binding' in schema titles - More (unevaluated|additional)Properties fixes in schema child nodes - Drop various redundant minItems equal to maxItems" * tag 'devicetree-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (62 commits) of: base: Shift refcount decrement in of_find_last_cache_level() dt-bindings: leds: Add MediaTek MT6370 flashlight dt-bindings: leds: mt6370: Add MediaTek MT6370 current sink type LED indicator dt-bindings: mailbox: Convert mtk-gce to DT schema of: base: make of_device_compatible_match() accept const device node of: Fix "dma-ranges" handling for bus controllers of: fdt: Remove unused struct fdt_scan_status dt-bindings: display: st,stm32-dsi: Handle data-lanes in DSI port node dt-bindings: timer: Add power-domains for TI timer-dm on K3 dt: Add a check for undocumented compatible strings in kernel kbuild: take into account DT_SCHEMA_FILES changes while checking dtbs dt-bindings: interrupt-controller: migrate MIPS CPU interrupt controller text bindings to YAML dt-bindings: i2c: migrate mt7621 text bindings to YAML dt-bindings: power: gpcv2: correct patternProperties dt-bindings: virtio: Convert virtio,pci-iommu to DT schema dt-bindings: timer: arm,arch_timer: Allow dual compatible string dt-bindings: arm: cpus: Add kryo240 compatible dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema dt-bindings: nvmem: u-boot,env: add basic NVMEM cells dt-bindings: remoteproc: qcom,adsp: enforce smd-edge schema ... commit ada3bfb6492a6d0d3eca50f3b61315fe032efc72 Merge: 3604a7f568d3f 2d869f0b45854 Author: Linus Torvalds Date: Mon Oct 10 13:09:33 2022 -0700 Merge tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm updates from Jarkko Sakkinen: "Just a few bug fixes this time" * tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle security/keys: Remove inconsistent __user annotation char: move from strlcpy with unused retval to strscpy commit 3604a7f568d3f67be8c13736201411ee83b210a1 Merge: d4013bc4d49f6 b411b1a0c8bdd Author: Linus Torvalds Date: Mon Oct 10 13:04:25 2022 -0700 Merge tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Feed untrusted RNGs into /dev/random - Allow HWRNG sleeping to be more interruptible - Create lib/utils module - Setting private keys no longer required for akcipher - Remove tcrypt mode=1000 - Reorganised Kconfig entries Algorithms: - Load x86/sha512 based on CPU features - Add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher Drivers: - Add HACE crypto driver aspeed" * tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (124 commits) crypto: aspeed - Remove redundant dev_err call crypto: scatterwalk - Remove unused inline function scatterwalk_aligned() crypto: aead - Remove unused inline functions from aead crypto: bcm - Simplify obtain the name for cipher crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf() hwrng: core - start hwrng kthread also for untrusted sources crypto: zip - remove the unneeded result variable crypto: qat - add limit to linked list parsing crypto: octeontx2 - Remove the unneeded result variable crypto: ccp - Remove the unneeded result variable crypto: aspeed - Fix check for platform_get_irq() errors crypto: virtio - fix memory-leak crypto: cavium - prevent integer overflow loading firmware crypto: marvell/octeontx - prevent integer overflows crypto: aspeed - fix build error when only CRYPTO_DEV_ASPEED is enabled crypto: hisilicon/qm - fix the qos value initialization crypto: sun4i-ss - use DEFINE_SHOW_ATTRIBUTE to simplify sun4i_ss_debugfs crypto: tcrypt - add async speed test for aria cipher crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher crypto: aria - prepare generic module for optimized implementations ... commit d4013bc4d49f6da8178a340348369bb9920225c9 Merge: cdf072acb5baa 585463f0d58aa Author: Linus Torvalds Date: Mon Oct 10 12:49:34 2022 -0700 Merge tag 'bitmap-6.1-rc1' of https://github.com/norov/linux Pull bitmap updates from Yury Norov: - Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES (Phil Auld) - cleanup nr_cpu_ids vs nr_cpumask_bits mess (me) This series cleans that mess and adds new config FORCE_NR_CPUS that allows to optimize cpumask subsystem if the number of CPUs is known at compile-time. - optimize find_bit() functions (me) Reworks find_bit() functions based on new FIND_{FIRST,NEXT}_BIT() macros. - add find_nth_bit() (me) Adds find_nth_bit(), which is ~70 times faster than bitcounting with for_each() loop: for_each_set_bit(bit, mask, size) if (n-- == 0) return bit; Also adds bitmap_weight_and() to let people replace this pattern: tmp = bitmap_alloc(nbits); bitmap_and(tmp, map1, map2, nbits); weight = bitmap_weight(tmp, nbits); bitmap_free(tmp); with a single bitmap_weight_and() call. - repair cpumask_check() (me) After switching cpumask to use nr_cpu_ids, cpumask_check() started generating many false-positive warnings. This series fixes it. - Add for_each_cpu_andnot() and for_each_cpu_andnot() (Valentin Schneider) Extends the API with one more function and applies it in sched/core. * tag 'bitmap-6.1-rc1' of https://github.com/norov/linux: (28 commits) sched/core: Merge cpumask_andnot()+for_each_cpu() into for_each_cpu_andnot() lib/test_cpumask: Add for_each_cpu_and(not) tests cpumask: Introduce for_each_cpu_andnot() lib/find_bit: Introduce find_next_andnot_bit() cpumask: fix checking valid cpu range lib/bitmap: add tests for for_each() loops lib/find: optimize for_each() macros lib/bitmap: introduce for_each_set_bit_wrap() macro lib/find_bit: add find_next{,_and}_bit_wrap cpumask: switch for_each_cpu{,_not} to use for_each_bit() net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and} cpumask: add cpumask_nth_{,and,andnot} lib/bitmap: remove bitmap_ord_to_pos lib/bitmap: add tests for find_nth_bit() lib: add find_nth{,_and,_andnot}_bit() lib/bitmap: add bitmap_weight_and() lib/bitmap: don't call __bitmap_weight() in kernel code tools: sync find_bit() implementation lib/find_bit: optimize find_next_bit() functions lib/find_bit: create find_first_zero_bit_le() ... commit cdf072acb5baa18e5b05bdf3f13d6481f62396fc Merge: dc55342867c9c 4f881a696484a Author: Linus Torvalds Date: Mon Oct 10 12:20:55 2022 -0700 Merge tag 'trace-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing updates from Steven Rostedt: "Major changes: - Changed location of tracing repo from personal git repo to: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git - Added Masami Hiramatsu as co-maintainer - Updated MAINTAINERS file to separate out FTRACE as it is more than just TRACING. Minor changes: - Added Mark Rutland as FTRACE reviewer - Updated user_events to make it on its way to remove the BROKEN tag. The changes should now be acceptable but will run it through a cycle and hopefully we can remove the BROKEN tag next release. - Added filtering to eprobes - Added a delta time to the benchmark trace event - Have the histogram and filter callbacks called via a switch statement instead of indirect functions. This speeds it up to avoid retpolines. - Add a way to wake up ring buffer waiters waiting for the ring buffer to fill up to its watermark. - New ioctl() on the trace_pipe_raw file to wake up ring buffer waiters. - Wake up waiters when the ring buffer is disabled. A reader may block when the ring buffer is disabled, but if it was blocked when the ring buffer is disabled it should then wake up. Fixes: - Allow splice to read partially read ring buffer pages. This fixes splice never moving forward. - Fix inverted compare that made the "shortest" ring buffer wait queue actually the longest. - Fix a race in the ring buffer between resetting a page when a writer goes to another page, and the reader. - Fix ftrace accounting bug when function hooks are added at boot up before the weak functions are set to "disabled". - Fix bug that freed a user allocated snapshot buffer when enabling a tracer. - Fix possible recursive locks in osnoise tracer - Fix recursive locking direct functions - Other minor clean ups and fixes" * tag 'trace-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (44 commits) ftrace: Create separate entry in MAINTAINERS for function hooks tracing: Update MAINTAINERS to reflect new tracing git repo tracing: Do not free snapshot if tracer is on cmdline ftrace: Still disable enabled records marked as disabled tracing/user_events: Move pages/locks into groups to prepare for namespaces tracing: Add Masami Hiramatsu as co-maintainer tracing: Remove unused variable 'dups' MAINTAINERS: add myself as a tracing reviewer ring-buffer: Fix race between reset page and reading page tracing/user_events: Update ABI documentation to align to bits vs bytes tracing/user_events: Use bits vs bytes for enabled status page data tracing/user_events: Use refcount instead of atomic for ref tracking tracing/user_events: Ensure user provided strings are safely formatted tracing/user_events: Use WRITE instead of READ for io vector import tracing/user_events: Use NULL for strstr checks tracing: Fix spelling mistake "preapre" -> "prepare" tracing: Wake up waiters when tracing is disabled tracing: Add ioctl() to force ring buffer waiters to wake up tracing: Wake up ring buffer waiters on closing of the file ring-buffer: Add ring_buffer_wake_waiters() ... commit dc55342867c9cf2295f4330420461361a9c8117d Merge: 47cc75aa92837 c06a17fe056b8 Author: Linus Torvalds Date: Mon Oct 10 12:18:28 2022 -0700 Merge tag 'sysctl-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull sysctl updates from Luis Chamberlain: "Just some boring cleanups on the sysctl front for this release" * tag 'sysctl-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: kernel/sysctl-test: use SYSCTL_{ZERO/ONE_HUNDRED} instead of i_{zero/one_hundred} kernel/sysctl.c: move sysctl_vals and sysctl_long_vals to sysctl.c sysctl: remove max_extfrag_threshold kernel/sysctl.c: remove unnecessary (void*) conversions proc: remove initialization assignment commit 47cc75aa92837a9d3f15157d6272ff285585d75d Author: Aaron Tomlin Date: Fri Oct 7 14:38:12 2022 +0100 module: tracking: Keep a record of tainted unloaded modules only This ensures that no module record/or entry is added to the unloaded_tainted_modules list if it does not carry a taint. Reported-by: Alexey Dobriyan Fixes: 99bd9956551b ("module: Introduce module unload taint tracking") Signed-off-by: Aaron Tomlin Acked-by: Luis Chamberlain Signed-off-by: Linus Torvalds commit 385f4a10191d95f40b5af72097df06e70f85d69a Merge: 8afc66e8d43be 77d6354bd422c Author: Linus Torvalds Date: Mon Oct 10 12:13:36 2022 -0700 Merge tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module updates from Luis Chamberlain: - minor enhancement for sysfs compression string (David Disseldorp) - debugfs interface to view unloaded tainted modules (Aaron Tomlin) * tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module/decompress: generate sysfs string at compile time module: Add debugfs interface to view unloaded tainted modules commit 4e3ce6d04da3d1058ad887000440e81ce34c0149 Author: Yanteng Si Date: Wed Sep 28 18:31:30 2022 +0800 docs/zh_CN: Update the translation of page_owner to 6.0-rc7 1)Update to commit 8f0efa81dfbc ("mm/page_owner.c: add llseek for page_owner") 2)Translate some words into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/52bc8df87618af951b34759487f05775416cb4d4.1664360331.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 84bed8a8bf3133ace08d6fb62a4d14d129f6ff8e Author: Yanteng Si Date: Wed Sep 28 18:31:29 2022 +0800 docs/zh_CN: Update the translation of ksm to 6.0-rc7 Update to commit bc6a2828a963 ("ksm: add the ksm prefix to the names of the ksm private structures") Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/60017007349357dc1fd8fa849a5ddb5672f8ab5b.1664360331.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 7cc395312a364777ed428257c014cb7569fe3f48 Author: Akira Yokosawa Date: Fri Sep 30 11:19:36 2022 +0900 docs/howto: Replace abundoned URL of gmane.org Somehow, there remains a link to gmane.org, which stopped working in 2016, in howto.rst. Replace it with the one at lore.kernel.org. Do the same changes under translations/ as well. Signed-off-by: Akira Yokosawa Cc: Federico Vaga Cc: Alex Shi Cc: Yanteng Si Cc: Hu Haowen Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20220930021936.26238-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit 5f5cae9b0e815c27b614e761b065129b8481821a Author: Joel Stanley Date: Wed Oct 5 13:39:04 2022 +1030 Documentation: ubifs: Fix compression idiom Clearly the author meant 'on the fly'. Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20221005030904.65604-1-joel@jms.id.au Signed-off-by: Jonathan Corbet commit 8afc66e8d43be8edcf442165b70d50dd33091e68 Merge: 4de65c5830233 0715fdb03e2c4 Author: Linus Torvalds Date: Mon Oct 10 12:00:45 2022 -0700 Merge tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Remove potentially incomplete targets when Kbuid is interrupted by SIGINT etc in case GNU Make may miss to do that when stderr is piped to another program. - Rewrite the single target build so it works more correctly. - Fix rpm-pkg builds with V=1. - List top-level subdirectories in ./Kbuild. - Ignore auto-generated __kstrtab_* and __kstrtabns_* symbols in kallsyms. - Avoid two different modules in lib/zstd/ having shared code, which potentially causes building the common code as build-in and modular back-and-forth. - Unify two modpost invocations to optimize the build process. - Remove head-y syntax in favor of linker scripts for placing particular sections in the head of vmlinux. - Bump the minimal GNU Make version to 3.82. - Clean up misc Makefiles and scripts. * tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits) docs: bump minimal GNU Make version to 3.82 ia64: simplify esi object addition in Makefile Revert "kbuild: Check if linker supports the -X option" kbuild: rebuild .vmlinux.export.o when its prerequisite is updated kbuild: move modules.builtin(.modinfo) rules to Makefile.vmlinux_o zstd: Fixing mixed module-builtin objects kallsyms: ignore __kstrtab_* and __kstrtabns_* symbols kallsyms: take the input file instead of reading stdin kallsyms: drop duplicated ignore patterns from kallsyms.c kbuild: reuse mksysmap output for kallsyms mksysmap: update comment about __crc_* kbuild: remove head-y syntax kbuild: use obj-y instead extra-y for objects placed at the head kbuild: hide error checker logs for V=1 builds kbuild: re-run modpost when it is updated kbuild: unify two modpost invocations kbuild: move vmlinux.o rule to the top Makefile kbuild: move .vmlinux.objs rule to Makefile.modpost kbuild: list sub-directories in ./Kbuild Makefile.compiler: replace cc-ifversion with compiler-specific macros ... commit 0719fdba54836b6d7acbe7d74f81df2153a40810 Author: Yixuan Cao Date: Wed Oct 5 22:55:25 2022 +0800 Documentation/mm/page_owner.rst: delete frequently changing experimental data The kernel size changes due to many factors, such as compiler version, configuration, and the build environment. This makes size comparison figures irrelevant to reader's setup. Remove these figures and describe the effects of page owner to the kernel size in general instead. Thanks for Jonathan Corbet, Bagas Sanjaya and Mike Rapoport's constructive suggestions. Signed-off-by: Yixuan Cao Link: https://lore.kernel.org/r/20221005145525.10359-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Jonathan Corbet commit a0a6859f8330e007e014ae6f7187766786745e74 Author: Yanteng Si Date: Sat Oct 8 17:41:39 2022 +0800 docs/zh_CN: Fix build warning Since a patch set in my translation devicetree introduce some build warnings: Warning: Documentation/translations/zh_CN/devicetree/changesets.rst references a file that doesn't exist: Documentation/Devicetree/changesets.rst ... Change the first letter of Devicetree to lowercase. Fixes: 9485acfded20 ("docs/zh_CN: add dt kernel-api translation") Fixes: f773455ce59d ("docs/zh_CN: add dt overlay-notes translation") Fixes: 5e38432db8f3 ("docs/zh_CN: add dt dynamic-resolution-notes translation") Fixes: 330f5a300548 ("docs/zh_CN: add dt changesets translation") Reported-by: kernel test robot Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/20221008094139.314151-1-siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 9c1ab6d54a2e9e59b8922d12145d895e7f88b62c Author: Leo Yan Date: Sat Oct 8 08:32:50 2022 +0000 docs: ftrace: Correct access mode The documentation gives an example for opening trace marker with write-only mode, but the flag WR_ONLY is not defined by glibc. Use O_WRONLY to replace it. Signed-off-by: Leo Yan Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20221008083250.3160-1-leo.yan@linaro.org Signed-off-by: Jonathan Corbet commit 4de65c5830233e7a4adf2e679510089ec4e210c7 Merge: b520410654103 59b2a38c6afdc Author: Linus Torvalds Date: Mon Oct 10 11:36:19 2022 -0700 Merge tag 'livepatching-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching updates from Petr Mladek: - Fix race between fork and livepatch transition revert - Add sysfs entry that shows "patched" state for each object (module) that can be livepatched by the given livepatch - Some clean up * tag 'livepatching-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: selftests/livepatch: add sysfs test livepatch: add sysfs entry "patched" for each klp_object selftests/livepatch: normalize sysctl error message livepatch: Add a missing newline character in klp_module_coming() livepatch: fix race between fork and KLP transition commit b520410654103086ccc0d339c0ff645d4c4dd697 Merge: adf4bfc4a9ab8 c77ae0b86322f Author: Linus Torvalds Date: Mon Oct 10 11:24:19 2022 -0700 Merge tag 'printk-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Initialize pointer hashing using the system workqueue. It avoids taking locks in printk()/vsprintf() code path - Misc code clean up * tag 'printk-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Mark __printk percpu data ready __ro_after_init printk: Remove bogus comment vs. boot consoles printk: Remove write only variable nr_ext_console_drivers printk: Declare log_wait properly printk: Make pr_flush() static lib/vsprintf: Initialize vsprintf's pointer hash once the random core is ready. lib/vsprintf: Remove static_branch_likely() from __ptr_to_hashval(). lib/vnsprintf: add const modifier for param 'bitmap' commit adf4bfc4a9ab86be0b72fa9cadc9e7ab6ad15dfe Merge: 8adc0486f3c85 8619e94d3be37 Author: Linus Torvalds Date: Mon Oct 10 11:12:25 2022 -0700 Merge tag 'cgroup-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: - cpuset now support isolated cpus.partition type, which will enable dynamic CPU isolation - pids.peak added to remember the max number of pids used - holes in cgroup namespace plugged - internal cleanups * tag 'cgroup-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (25 commits) cgroup: use strscpy() is more robust and safer iocost_monitor: reorder BlkgIterator cgroup: simplify code in cgroup_apply_control cgroup: Make cgroup_get_from_id() prettier cgroup/cpuset: remove unreachable code cgroup: Remove CFTYPE_PRESSURE cgroup: Improve cftype add/rm error handling kselftest/cgroup: Add cpuset v2 partition root state test cgroup/cpuset: Update description of cpuset.cpus.partition in cgroup-v2.rst cgroup/cpuset: Make partition invalid if cpumask change violates exclusivity rule cgroup/cpuset: Relocate a code block in validate_change() cgroup/cpuset: Show invalid partition reason string cgroup/cpuset: Add a new isolated cpus.partition type cgroup/cpuset: Relax constraints to partition & cpus changes cgroup/cpuset: Allow no-task partition to have empty cpuset.cpus.effective cgroup/cpuset: Miscellaneous cleanups & add helper functions cgroup/cpuset: Enable update_tasks_cpumask() on top_cpuset cgroup: add pids.peak interface for pids controller cgroup: Remove data-race around cgrp_dfl_visible cgroup: Fix build failure when CONFIG_SHRINKER_DEBUG ... commit 8adc0486f3c85e3c1e40c1ce6884317a17c380d3 Merge: 52abb27abfff8 a890d1c657ecb Author: Linus Torvalds Date: Mon Oct 10 10:41:21 2022 -0700 Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator updates from Jason Donenfeld: - Huawei reported that when they updated their kernel from 4.4 to something much newer, some userspace code they had broke, the culprit being the accidental removal of O_NONBLOCK from /dev/random way back in 5.6. It's been gone for over 2 years now and this is the first we've heard of it, but userspace breakage is userspace breakage, so O_NONBLOCK is now back. - Use randomness from hardware RNGs much more often during early boot, at the same interval that crng reseeds are done, from Dominik. - A semantic change in hardware RNG throttling, so that the hwrng framework can properly feed random.c with randomness from hardware RNGs that aren't specifically marked as creditable. A related patch coming to you via Herbert's hwrng tree depends on this one, not to compile, but just to function properly, so you may want to merge this PULL before that one. - A fix to clamp credited bits from the interrupts pool to the size of the pool sample. This is mainly just a theoretical fix, as it'd be pretty hard to exceed it in practice. - Oracle reported that InfiniBand TCP latency regressed by around 10-15% after a change a few cycles ago made at the request of the RT folks, in which we hoisted a somewhat rare operation (1 in 1024 times) out of the hard IRQ handler and into a workqueue, a pretty common and boring pattern. It turns out, though, that scheduling a worker from there has overhead of its own, whereas scheduling a timer on that same CPU for the next jiffy amortizes better and doesn't incur the same overhead. I also eliminated a cache miss by moving the work_struct (and subsequently, the timer_list) to below a critical cache line, so that the more critical members that are accessed on every hard IRQ aren't split between two cache lines. - The boot-time initialization of the RNG has been split into two approximate phases: what we can accomplish before timekeeping is possible and what we can accomplish after. This winds up being useful so that we can use RDRAND to seed the RNG before CONFIG_SLAB_FREELIST_RANDOM=y systems initialize slabs, in addition to other early uses of randomness. The effect is that systems with RDRAND (or a bootloader seed) will never see any warnings at all when setting CONFIG_WARN_ALL_UNSEEDED_RANDOM=y. And kfence benefits from getting a better seed of its own. - Small systems without much entropy sometimes wind up putting some truncated serial number read from flash into hostname, so contribute utsname changes to the RNG, without crediting. - Add smaller batches to serve requests for smaller integers, and make use of them when people ask for random numbers bounded by a given compile-time constant. This has positive effects all over the tree, most notably in networking and kfence. - The original jitter algorithm intended (I believe) to schedule the timer for the next jiffy, not the next-next jiffy, yet it used mod_timer(jiffies + 1), which will fire on the next-next jiffy, instead of what I believe was intended, mod_timer(jiffies), which will fire on the next jiffy. So fix that. - Fix a comment typo, from William. * tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: clear new batches when bringing new CPUs online random: fix typos in get_random_bytes() comment random: schedule jitter credit for next jiffy, not in two jiffies prandom: make use of smaller types in prandom_u32_max random: add 8-bit and 16-bit batches utsname: contribute changes to RNG random: use init_utsname() instead of utsname() kfence: use better stack hash seed random: split initialization into early step and later step random: use expired timer rather than wq for mixing fast pool random: avoid reading two cache lines on irq randomness random: clamp credited irq bits to maximum mixed random: throttle hwrng writes if no entropy is credited random: use hwgenerator randomness more frequently at early boot random: restore O_NONBLOCK support commit 24a403340d70aad3667b3ee0f9a7aa5c0a5193a0 Merge: 493ffd6605b2d a0a6314ae774f Author: Jens Axboe Date: Mon Oct 10 11:26:40 2022 -0600 Merge branch 'for-6.1/block' into block-6.1 Merge in later fixes. * for-6.1/block: block: fix leaking minors of hidden disks block: avoid sign extend problem with default queue flags mask blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() block: Remove the repeat word 'can' MAINTAINERS: Update SED-Opal Maintainers commit 52abb27abfff8c5ddf44eef4d759f3d1e9f166c5 Merge: 55be6084c8e0e 00a7829ba8a44 Author: Linus Torvalds Date: Mon Oct 10 10:21:22 2022 -0700 Merge tag 'slab-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab fixes from Vlastimil Babka: - The "common kmalloc v4" series [1] by Hyeonggon Yoo. While the plan after LPC is to try again if it's possible to get rid of SLOB and SLAB (and if any critical aspect of those is not possible to achieve with SLUB today, modify it accordingly), it will take a while even in case there are no objections. Meanwhile this is a nice cleanup and some parts (e.g. to the tracepoints) will be useful even if we end up with a single slab implementation in the future: - Improves the mm/slab_common.c wrappers to allow deleting duplicated code between SLAB and SLUB. - Large kmalloc() allocations in SLAB are passed to page allocator like in SLUB, reducing number of kmalloc caches. - Removes the {kmem_cache_alloc,kmalloc}_node variants of tracepoints, node id parameter added to non-_node variants. - Addition of kmalloc_size_roundup() The first two patches from a series by Kees Cook [2] that introduce kmalloc_size_roundup(). This will allow merging of per-subsystem patches using the new function and ultimately stop (ab)using ksize() in a way that causes ongoing trouble for debugging functionality and static checkers. - Wasted kmalloc() memory tracking in debugfs alloc_traces A patch from Feng Tang that enhances the existing debugfs alloc_traces file for kmalloc caches with information about how much space is wasted by allocations that needs less space than the particular kmalloc cache provides. - My series [3] to fix validation races for caches with enabled debugging: - By decoupling the debug cache operation more from non-debug fastpaths, extra locking simplifications were possible and thus done afterwards. - Additional cleanup of PREEMPT_RT specific code on top, by Thomas Gleixner. - A late fix for slab page leaks caused by the series, by Feng Tang. - Smaller fixes and cleanups: - Unneeded variable removals, by ye xingchen - A cleanup removing a BUG_ON() in create_unique_id(), by Chao Yu Link: https://lore.kernel.org/all/20220817101826.236819-1-42.hyeyoo@gmail.com/ [1] Link: https://lore.kernel.org/all/20220923202822.2667581-1-keescook@chromium.org/ [2] Link: https://lore.kernel.org/all/20220823170400.26546-1-vbabka@suse.cz/ [3] * tag 'slab-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: (30 commits) mm/slub: fix a slab missed to be freed problem slab: Introduce kmalloc_size_roundup() slab: Remove __malloc attribute from realloc functions mm/slub: clean up create_unique_id() mm/slub: enable debugging memory wasting of kmalloc slub: Make PREEMPT_RT support less convoluted mm/slub: simplify __cmpxchg_double_slab() and slab_[un]lock() mm/slub: convert object_map_lock to non-raw spinlock mm/slub: remove slab_lock() usage for debug operations mm/slub: restrict sysfs validation to debug caches and make it safe mm/sl[au]b: check if large object is valid in __ksize() mm/slab_common: move declaration of __ksize() to mm/slab.h mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using mm/slab_common: unify NUMA and UMA version of tracepoints mm/sl[au]b: cleanup kmem_cache_alloc[_node]_trace() mm/sl[au]b: generalize kmalloc subsystem mm/slub: move free_debug_processing() further mm/sl[au]b: introduce common alloc/free functions without tracepoint mm/slab: kmalloc: pass requests larger than order-1 page to page allocator mm/slab_common: cleanup kmalloc_large() ... commit 55be6084c8e0e0ada9278c2ab60b7a584378efda Merge: 7f6dcffb44ad2 6cb5ce13357de Author: Linus Torvalds Date: Mon Oct 10 10:16:00 2022 -0700 Merge tag 'timers-core-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "A boring time, timekeeping, timers update: - No core code changes - No new clocksource/event driver - Cleanup of the TI DM clocksource/event driver - The usual set of device tree binding updates - Small improvement, fixes and cleanups all over the place" * tag 'timers-core-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits) clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value clocksource/drivers/imx-sysctr: handle nxp,no-divider property dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property clocksource/drivers/timer-ti-dm: Get clock in probe with devm_clk_get() clocksource/drivers/timer-ti-dm: Add flag to detect omap1 clocksource/drivers/timer-ti-dm: Move struct omap_dm_timer fields to driver clocksource/drivers/timer-ti-dm: Use runtime PM directly and check errors clocksource/drivers/timer-ti-dm: Move private defines to the driver clocksource/drivers/timer-ti-dm: Simplify register access further clocksource/drivers/timer-ti-dm: Simplify register writes with dmtimer_write() clocksource/drivers/timer-ti-dm: Simplify register reads with dmtimer_read() clocksource/drivers/timer-ti-dm: Drop unused functions clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921 clocksource/drivers/exynos_mct: Enable building on ARTPEC clocksource/drivers/exynos_mct: Support local-timers property clocksource/drivers/exynos_mct: Support frc-shared property dt-bindings: timer: exynos4210-mct: Add ARTPEC-8 MCT support clocksource/drivers/sun4i: Add definition of clear interrupt clocksource/drivers/renesas-ostm: Add support for RZ/V2L SoC ... commit 7f6dcffb44ad246e3211c6aeaba8a625e2766836 Merge: 65f109e19976a 44b0c2957adc6 Author: Linus Torvalds Date: Mon Oct 10 10:03:24 2022 -0700 Merge tag 'sched-rt-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull preempt RT updates from Thomas Gleixner: "Introduce preempt_[dis|enable_nested() and use it to clean up various places which have open coded PREEMPT_RT conditionals. On PREEMPT_RT enabled kernels, spinlocks and rwlocks are neither disabling preemption nor interrupts. Though there are a few places which depend on the implicit preemption/interrupt disable of those locks, e.g. seqcount write sections, per CPU statistics updates etc. PREEMPT_RT added open coded CONFIG_PREEMPT_RT conditionals to disable/enable preemption in the related code parts all over the place. That's hard to read and does not really explain why this is necessary. Linus suggested to use helper functions (preempt_disable_nested() and preempt_enable_nested()) and use those in the affected places. On !RT enabled kernels these functions are NOPs, but contain a lockdep assert to validate that preemption is actually disabled to catch call sites which do not have preemption disabled. Clean up the affected code paths in mm, dentry and lib" * tag 'sched-rt-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: u64_stats: Streamline the implementation flex_proportions: Disable preemption entering the write section. mm/compaction: Get rid of RT ifdeffery mm/memcontrol: Replace the PREEMPT_RT conditionals mm/debug: Provide VM_WARN_ON_IRQS_ENABLED() mm/vmstat: Use preempt_[dis|en]able_nested() dentry: Use preempt_[dis|en]able_nested() preempt: Provide preempt_[dis|en]able_nested() commit 65f109e19976a833c18820e3950c8f2bb8bd19b4 Merge: 3e71f0167b3db 7a7621dfa417a Author: Linus Torvalds Date: Mon Oct 10 09:56:19 2022 -0700 Merge tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool updates from Ingo Molnar: - Remove the "ANNOTATE_NOENDBR on ENDBR" warning: it's not really useful and only found a non-bug false positive so far. - Properly decode LOOP/LOOPE/LOOPNE, which were missing from the x86 decoder. Because these instructions are rather ineffective, they never showed up in compiler output, but they are simple enough to support, so add them for completeness. - A bit more cross-arch preparatory work. * tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool,x86: Teach decode about LOOP* instructions objtool: Remove "ANNOTATE_NOENDBR on ENDBR" warning objtool: Use arch_jump_destination() in read_intra_function_calls() commit 3e71f0167b3db4e4b3d0d8353c375f6587323052 Merge: 3871d93b82a4a 76e64c73db954 Author: Linus Torvalds Date: Mon Oct 10 09:44:12 2022 -0700 Merge tag 'locking-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: - Disable preemption in rwsem_write_trylock()'s attempt to take the rwsem, to avoid RT tasks hogging the CPU, which managed to preempt this function after the owner has been cleared but before a new owner is set. Also add debug checks to enforce this. - Add __lockfunc to more slow path functions and add __sched to semaphore functions. - Mark spinlock APIs noinline when the respective CONFIG_INLINE_SPIN_* toggles are disabled, to reduce LTO text size. - Print more debug information when lockdep gets confused in look_up_lock_class(). - Improve header file abuse checks. - Misc cleanups * tag 'locking-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Print more debug information - report name and key when look_up_lock_class() got confused locking: Add __sched to semaphore functions locking/rwsem: Disable preemption while trying for rwsem lock locking: Detect includes rwlock.h outside of spinlock.h locking: Add __lockfunc to slow path functions locking/spinlocks: Mark spinlocks noinline when inline spinlocks are disabled selftests: futex: Fix 'the the' typo in comment commit f7e6b99f22f22f3630139aeaeecb83d77e47bf9b Merge: cf4e0f8a396e4 129b60c957711 34e1ed189fab1 Author: Rafael J. Wysocki Date: Mon Oct 10 18:34:02 2022 +0200 Merge branches 'pm-domains' and 'pm-core' Merge additional generic power domains handling update and an improvement of the PM callback definition macros for 6.1-rc1: - Add an error message to be printed when a power domain marked as "always on" is not actually on during initialization (Johan Hovold). - Extend macros used for defining power management callbacks to allow conditional exporting of noirq and late/early suspend/resume PM callbacks (Paul Cercueil). * pm-domains: PM: domains: log failures to register always-on domains * pm-core: PM: Improve EXPORT_*_DEV_PM_OPS macros commit 3871d93b82a4a6c1f4308064f046a544f16ada21 Merge: 30c999937f69a 82aad7ff7ac25 Author: Linus Torvalds Date: Mon Oct 10 09:27:46 2022 -0700 Merge tag 'perf-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf events updates from Ingo Molnar: "PMU driver updates: - Add AMD Last Branch Record Extension Version 2 (LbrExtV2) feature support for Zen 4 processors. - Extend the perf ABI to provide branch speculation information, if available, and use this on CPUs that have it (eg. LbrExtV2). - Improve Intel PEBS TSC timestamp handling & integration. - Add Intel Raptor Lake S CPU support. - Add 'perf mem' and 'perf c2c' memory profiling support on AMD CPUs by utilizing IBS tagged load/store samples. - Clean up & optimize various x86 PMU details. HW breakpoints: - Big rework to optimize the code for systems with hundreds of CPUs and thousands of breakpoints: - Replace the nr_bp_mutex global mutex with the bp_cpuinfo_sem per-CPU rwsem that is read-locked during most of the key operations. - Improve the O(#cpus * #tasks) logic in toggle_bp_slot() and fetch_bp_busy_slots(). - Apply micro-optimizations & cleanups. - Misc cleanups & enhancements" * tag 'perf-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (75 commits) perf/hw_breakpoint: Annotate tsk->perf_event_mutex vs ctx->mutex perf: Fix pmu_filter_match() perf: Fix lockdep_assert_event_ctx() perf/x86/amd/lbr: Adjust LBR regardless of filtering perf/x86/utils: Fix uninitialized var in get_branch_type() perf/uapi: Define PERF_MEM_SNOOPX_PEER in kernel header file perf/x86/amd: Support PERF_SAMPLE_PHY_ADDR perf/x86/amd: Support PERF_SAMPLE_ADDR perf/x86/amd: Support PERF_SAMPLE_{WEIGHT|WEIGHT_STRUCT} perf/x86/amd: Support PERF_SAMPLE_DATA_SRC perf/x86/amd: Add IBS OP_DATA2 DataSrc bit definitions perf/mem: Introduce PERF_MEM_LVLNUM_{EXTN_MEM|IO} perf/x86/uncore: Add new Raptor Lake S support perf/x86/cstate: Add new Raptor Lake S support perf/x86/msr: Add new Raptor Lake S support perf/x86: Add new Raptor Lake S support bpf: Check flags for branch stack in bpf_read_branch_records helper perf, hw_breakpoint: Fix use-after-free if perf_event_open() fails perf: Use sample_flags for raw_data perf: Use sample_flags for addr ... commit 056a81549c2722f0e7a9cceb7a98728eb1d67434 Merge: 800b8eecb284e 415fed694fe11 a6c05e1223c9f 38f34dba806a4 36f554046bd6d Author: Rafael J. Wysocki Date: Mon Oct 10 18:11:11 2022 +0200 Merge branches 'acpi-apei', 'acpi-wakeup', 'acpi-reboot' and 'acpi-thermal' Merge additional APEI changes, ACPI updates related to device wakeup and system restart and ACPI thermal driver cleanups for 6.1-rc1: - Fix a memory leak in APEI by avoiding to add do not add task_work to kernel threads running when an asynchronous error is detected (Shuai Xue). - Add ACPI support for handling system wakeups via GPIO wake capable IRQs in addition to GPEs (Raul E Rangel). - Make the system reboot code put ACPI-enabled systems into the S5 (system off) state which is necessary for some platforms to work as expected (Kai-Heng Feng). - Make the white space usage in the ACPI thermal driver more consistent and drop redundant code from it (Rafael Wysocki). * acpi-apei: ACPI: APEI: do not add task_work to kernel thread to avoid memory leak * acpi-wakeup: ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle i2c: acpi: Use ACPI wake capability bit to set wake_irq ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get * acpi-reboot: PM: ACPI: reboot: Reinstate S5 for reboot kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode * acpi-thermal: ACPI: thermal: Drop some redundant code ACPI: thermal: Drop redundant parens from expressions ACPI: thermal: Use white space more consistently commit 30c999937f69abf935b0228b8411713737377d9e Merge: 493ffd6605b2d fdf756f712718 Author: Linus Torvalds Date: Mon Oct 10 09:10:28 2022 -0700 Merge tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "Debuggability: - Change most occurances of BUG_ON() to WARN_ON_ONCE() - Reorganize & fix TASK_ state comparisons, turn it into a bitmap - Update/fix misc scheduler debugging facilities Load-balancing & regular scheduling: - Improve the behavior of the scheduler in presence of lot of SCHED_IDLE tasks - in particular they should not impact other scheduling classes. - Optimize task load tracking, cleanups & fixes - Clean up & simplify misc load-balancing code Freezer: - Rewrite the core freezer to behave better wrt thawing and be simpler in general, by replacing PF_FROZEN with TASK_FROZEN & fixing/adjusting all the fallout. Deadline scheduler: - Fix the DL capacity-aware code - Factor out dl_task_is_earliest_deadline() & replenish_dl_new_period() - Relax/optimize locking in task_non_contending() Cleanups: - Factor out the update_current_exec_runtime() helper - Various cleanups, simplifications" * tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits) sched: Fix more TASK_state comparisons sched: Fix TASK_state comparisons sched/fair: Move call to list_last_entry() in detach_tasks sched/fair: Cleanup loop_max and loop_break sched/fair: Make sure to try to detach at least one movable task sched: Show PF_flag holes freezer,sched: Rewrite core freezer logic sched: Widen TAKS_state literals sched/wait: Add wait_event_state() sched/completion: Add wait_for_completion_state() sched: Add TASK_ANY for wait_task_inactive() sched: Change wait_task_inactive()s match_state freezer,umh: Clean up freezer/initrd interaction freezer: Have {,un}lock_system_sleep() save/restore flags sched: Rename task_running() to task_on_cpu() sched/fair: Cleanup for SIS_PROP sched/fair: Default to false in test_idle_cores() sched/fair: Remove useless check in select_idle_core() sched/fair: Avoid double search on same cpu sched/fair: Remove redundant check in select_idle_smt() ... commit a0a6314ae774f8a5e52a599946aa2ad0db867b83 Author: Christoph Hellwig Date: Mon Oct 10 15:18:57 2022 +0200 block: fix leaking minors of hidden disks The major/minor of a hidden gendisk is not propagated to the block device because it is never registered using bdev_add. But the lack of bd_dev also causes the dynamic major minor number not to be freed. Assign bd_dev manually to ensure the dynamic major minor gets freed. Based on a patch by Keith Busch. Fixes: 8ddcd653257c ("block: introduce GENHD_FL_HIDDEN") Reported-by: Daniel Wagner Signed-off-by: Christoph Hellwig Tested-by: Daniel Wagner Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/20221010131857.748129-1-hch@lst.de Signed-off-by: Jens Axboe commit 25e06831eb6f8903714f80c61f6c15352d77b07b Merge: 29eb79a9a6283 68ce83e3bb26f Author: Mark Brown Date: Mon Oct 10 15:33:47 2022 +0100 ASoC: wmxxxx: Revert old "ASoC: wmxxxx: Fix PM disable depth imbalance in wmxxxx_probe" Merge series from Zhang Qilong : Both the old and new patch have been applied, it will resulted in redundant calling of pm_runtime_disable when error returns. We Just revert the old three patches to fix it. commit ca5eebda3e1c1a58a1c5a337da393ed6734593e3 Author: Brian Foster Date: Mon Oct 3 09:35:34 2022 -0400 block: avoid sign extend problem with default queue flags mask request_queue->queue_flags is unsigned long, which is 8-bytes on 64-bit architectures. Most queue flag modifications occur through bit field helpers, but default flags can be logically OR'd via the QUEUE_FLAG_MQ_DEFAULT mask. If this mask happens to include bit 31, the assignment can sign extend the field and set all upper 32 bits. This exact problem has been observed on a downstream kernel that happens to use bit 31 for QUEUE_FLAG_NOWAIT. This is not an immediate problem for current upstream because bit 31 is not included in the default flag assignment (and is not used at all, actually). Regardless, fix up the QUEUE_FLAG_MQ_DEFAULT mask definition to avoid the landmine in the future. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221003133534.1075582-1-bfoster@redhat.com Signed-off-by: Jens Axboe commit 2ea8e1297801f7b0220ebf6ae61a5b74ca83981e Author: Luke D. Jones Date: Mon Oct 10 20:03:47 2022 +1300 ALSA: hda/realtek: Add quirk for ASUS GV601R laptop The ASUS ROG X16 (GV601R) series laptop has the same node-to-DAC pairs as early models and the G14, this includes bass speakers which are by default mapped incorrectly to the 0x06 node. Add a quirk to use the same DAC pairs as the G14. Signed-off-by: Luke D. Jones Cc: Link: https://lore.kernel.org/r/20221010070347.36883-1-luke@ljones.dev Signed-off-by: Takashi Iwai commit 66ba7c88507344dee68ad1acbdb630473ab36114 Author: Luke D. Jones Date: Mon Oct 10 19:57:02 2022 +1300 ALSA: hda/realtek: Correct pin configs for ASUS G533Z The initial fix for ASUS G533Z was based on faulty information. This fixes the pincfg to values that have been verified with no existing module options or other hacks enabled. Enables headphone jack, and 5.1 surround. [ corrected the indent level by tiwai ] Fixes: bc2c23549ccd ("ALSA: hda/realtek: Add pincfg for ASUS G533Z HP jack") Signed-off-by: Luke D. Jones Cc: Link: https://lore.kernel.org/r/20221010065702.35190-1-luke@ljones.dev Signed-off-by: Takashi Iwai commit 61367688f1fb07678b1d865a0ce9364f5267a896 Author: Juergen Gross Date: Mon Aug 29 13:26:08 2022 +0200 xen/virtio: enable grant based virtio on x86 Use an x86-specific virtio_check_mem_acc_cb() for Xen in order to setup the correct DMA ops. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko # common code Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 5302e1ff315b40dfc9bb3f08911f5a788cc1de01 Author: Chin-Ting Kuo Date: Wed Oct 5 16:32:09 2022 +0800 spi: aspeed: Fix typo in mode_bits field for AST2600 platform Both quad SPI TX and RX modes can be supported on AST2600. Correct typo in mode_bits field in both ast2600_fmc_data and ast2600_spi_data structs. Signed-off-by: Chin-Ting Kuo Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20221005083209.222272-1-chin-ting_kuo@aspeedtech.com Signed-off-by: Mark Brown commit b25fe93ff705cdd8e98ad8d0435c621ea5462c82 Author: Christophe Leroy Date: Thu Oct 6 07:35:12 2022 +0200 spi: mpc52xx: Replace NO_IRQ by 0 NO_IRQ is used to check the return of irq_of_parse_and_map(). On some architecture NO_IRQ is 0, on other architectures it is -1. irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ. So use 0 instead of using NO_IRQ. Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/f41e09d710879726eacb98daedf16d0847303b9b.1665034444.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown commit b994d8f0773cf3b01129c094d00050710f2c422b Author: Jonathan Neuschäfer Date: Sat Oct 8 17:14:59 2022 +0200 spi: spi-mem: Fix typo (of -> or) In this instance, "or" makes more sense than "of", so I guess that "or" was intended and "of" was a typo. Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20221008151459.1421406-1-j.neuschaefer@gmx.net Signed-off-by: Mark Brown commit 29eb79a9a6283d661ea1f70ab012809fdbf057a7 Author: Jiangshan Yi Date: Sun Oct 9 15:48:16 2022 +0800 ASoC: cx2072x: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Link: https://lore.kernel.org/r/20221009074816.2641162-1-13667453960@163.com Signed-off-by: Mark Brown commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 Author: Zhang Qilong Date: Sat Oct 8 22:05:22 2022 +0800 ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe It would be better to keep the pm_runtime enables before the IRQ and component stuff. Both of those could start triggering PM runtime events. Signed-off-by: Zhang Qilong Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 551f2994b8ccdbe296e239278531e345d6e94d4d Author: Randy Dunlap Date: Thu Oct 6 16:58:22 2022 -0700 ASoC: codec: tlv320adc3xxx: add GPIOLIB dependency Fix build errors when CONFIG_GPIOLIB is not enabled: ../sound/soc/codecs/tlv320adc3xxx.c: In function 'adc3xxx_i2c_probe': ../sound/soc/codecs/tlv320adc3xxx.c:1352:28: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration] 1352 | adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ../sound/soc/codecs/tlv320adc3xxx.c:1352:57: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'? 1352 | adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); CC lib/dynamic_debug.o ../sound/soc/codecs/tlv320adc3xxx.c:1400:9: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration] 1400 | gpiod_set_value_cansleep(adc3xxx->rst_pin, 1); Fixes: e9a3b57efd28 ("ASoC: codec: tlv320adc3xxx: New codec driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Mark Brown Cc: Liam Girdwood Cc: Ricard Wanderlof Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20221006235822.30074-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 68ce83e3bb26feba0fcdd59667fde942b3a600a1 Author: Zhang Qilong Date: Mon Oct 10 19:48:52 2022 +0800 ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe" This reverts commit 41a736ac20602f64773e80f0f5b32cde1830a44a. The pm_runtime_disable is redundant when error returns in wm8997_probe, we just revert the old patch to fix it. Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221010114852.88127-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 7d4e966f4cd73ff69bf06934e8e14a33fb7ef447 Author: Zhang Qilong Date: Mon Oct 10 19:48:51 2022 +0800 ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe" This reverts commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7. The pm_runtime_disable is redundant when error returns in wm5110_probe, we just revert the old patch to fix it. Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221010114852.88127-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit de71d7567e358effd06dfc3e2a154b25f1331c10 Author: Zhang Qilong Date: Mon Oct 10 19:48:50 2022 +0800 ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe" This reverts commit fcbb60820cd3008bb44334a0395e5e57ccb77329. The pm_runtime_disable is redundant when error returns in wm5102_probe, we just revert the old patch to fix it. Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20221010114852.88127-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 8a6ffcbe26fd14d58075dcf3cbdf1b5b69b20402 Author: Zenghui Yu Date: Sun Oct 9 11:31:31 2022 +0800 KVM: arm64: selftests: Fix multiple versions of GIC creation Commit 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper") wrongly converted a "real" GIC device creation to __kvm_test_create_device() and caused the test failure on my D05 (which supports v2 emulation). Fix it. Fixes: 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper") Signed-off-by: Zenghui Yu Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221009033131.365-1-yuzenghui@huawei.com commit bd60aafce5e1943fd395b8bf726e9824fa621eca Author: Chen Lifu Date: Wed Aug 17 16:14:20 2022 +0800 ARM: mmp: Make some symbols static These symbols pxa168_usb_phy_resources, pxa168_u2o_resources, pxa168_u2oehci_resources and pxa168_u2ootg_resources are not used outside of arch/arm/mach-mmp/devices.c, so mark them static. Fixes the following sparse warning: arch/arm/mach-mmp/devices.c:241:17: warning: symbol 'pxa168_usb_phy_resources' was not declared. Should it be static? arch/arm/mach-mmp/devices.c:262:17: warning: symbol 'pxa168_u2o_resources' was not declared. Should it be static? arch/arm/mach-mmp/devices.c:297:17: warning: symbol 'pxa168_u2oehci_resources' was not declared. Should it be static? arch/arm/mach-mmp/devices.c:324:17: warning: symbol 'pxa168_u2ootg_resources' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: Chen Lifu Signed-off-by: Arnd Bergmann commit 390ca5bca7cdb95042dcb445375db0d9eba7aa4a Author: Viresh Kumar Date: Mon Oct 10 09:41:07 2022 +0530 ARM: spear6xx: Staticize few definitions Fix warnings with clang like: arch/arm/mach-spear/spear6xx.c:365:13: warning: no previous prototype for function 'spear6xx_map_io' [-Wmissing-prototypes] by making few definitions static. Reported-by: kernel test robot Signed-off-by: Viresh Kumar Signed-off-by: Arnd Bergmann commit 9afd20a5a1b3558950b5e12f3ed057ef93c64a05 Author: Viresh Kumar Date: Mon Oct 10 09:52:37 2022 +0530 clk: spear: Move prototype to accessible header Fixes the following W=1 kernel build warning(s): drivers/clk/spear/spear6xx_clock.c:116:13: warning: no previous prototype for function 'spear6xx_clk_init' [-Wmissing-prototypes] Reported-by: kernel test robot Signed-off-by: Viresh Kumar Signed-off-by: Arnd Bergmann commit 2e21c1575208786f667cb66d8cf87a52160b81db Author: Arnd Bergmann Date: Mon Oct 10 10:33:38 2022 +0200 alpha: fix marvel_ioread8 build regression The previous build fix contained a small typo that led to another regression: arch/alpha/kernel/core_marvel.c:807:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'marvel_ioread8' Reported-by: kernel test robot Fixes: e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation") Signed-off-by: Arnd Bergmann commit bf18140d30541c2c1e5c0f57879634f3d0d04912 Author: Peter Oberparleiter Date: Mon Sep 26 16:56:04 2022 +0200 s390/vmur: generate uevent on unsolicited device end When a traditional channel-attached device transitions from not-ready to ready state, an unsolicited DEVICE END I/O interrupt is raised. This happens for example when a new file arrives in the z/VM virtual reader device. Change the Linux kernel to generate a change uevent when such an interrupt occurs for any online unit record devices supported by the vmur driver. This can be useful to automatically trigger processing of files as they arrive in the reader device. A sample udev rule for running a program when this event occurs looks as follows: ENV{DRIVER}=="vmur", ACTION=="change", ENV{EVENT}=="unsol_de", \ RUN{program}="/path/to/program" The rule can be tested using the following steps: 1. Set reader device online (assuming default reader device number 000c) $ chzdev -ea 0.0.000c 2. Force a ready-state transition using z/VM's READY CP command $ vmcp ready 000c Suggested-by: Alan Altmark Reviewed-by: Heiko Carstens Reviewed-by: Sven Schnelle Signed-off-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit f3e59ff348c077a6afd4edb23d7e69e9cba62fdc Author: Peter Oberparleiter Date: Wed Sep 28 15:34:33 2022 +0200 s390/vmur: remove unnecessary BUG statement An existing BUG statement in vmur's interrupt handler triggers if: 1. An online vmur device is removed (e.g. due to driver unload, manual unbind or channel-report words indicating hypervisor-side device removal) 2. Device deactivation fails due to firmware/hypervisor error, leaving subchannel enabled for interrupts + drvdata=NULL 3. Interrupt occurs This situation is highly unlikely and not a clear indication of a general system error that would warrant stopping the full Linux system. Also it can be prevented completely by clearing the interrupt handler when unsetting a vmur device's drvdata. Replace the BUG statement in vmur's interrupt handler by clearing the interrupt handler callback during device removal. Also move the initial setting of the interrupt handler callback under lock for consistency reasons. Reviewed-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit c90b93b5b782891ebfda49d4e5da36632fefd5d1 Author: Johannes Berg Date: Wed Oct 5 23:11:43 2022 +0200 wifi: cfg80211: update hidden BSSes to avoid WARN_ON When updating beacon elements in a non-transmitted BSS, also update the hidden sub-entries to the same beacon elements, so that a future update through other paths won't trigger a WARN_ON(). The warning is triggered because the beacon elements in the hidden BSSes that are children of the BSS should always be the same as in the parent. Reported-by: Sönke Huster Tested-by: Sönke Huster Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Johannes Berg commit b2d03cabe2b2e150ff5a381731ea0355459be09f Author: Johannes Berg Date: Wed Oct 5 21:24:10 2022 +0200 wifi: mac80211: fix crash in beacon protection for P2P-device If beacon protection is active but the beacon cannot be decrypted or is otherwise malformed, we call the cfg80211 API to report this to userspace, but that uses a netdev pointer, which isn't present for P2P-Device. Fix this to call it only conditionally to ensure cfg80211 won't crash in the case of P2P-Device. This fixes CVE-2022-42722. Reported-by: Sönke Huster Fixes: 9eaf183af741 ("mac80211: Report beacon protection failures to user space") Signed-off-by: Johannes Berg commit 1833b6f46d7e2830251a063935ab464256defe22 Author: Johannes Berg Date: Wed Oct 5 15:10:09 2022 +0200 wifi: mac80211_hwsim: avoid mac80211 warning on bad rate If the tool on the other side (e.g. wmediumd) gets confused about the rate, we hit a warning in mac80211. Silence that by effectively duplicating the check here and dropping the frame silently (in mac80211 it's dropped with the warning). Reported-by: Sönke Huster Tested-by: Sönke Huster Signed-off-by: Johannes Berg commit bcca852027e5878aec911a347407ecc88d6fff7f Author: Johannes Berg Date: Sat Oct 1 00:01:44 2022 +0200 wifi: cfg80211: avoid nontransmitted BSS list corruption If a non-transmitted BSS shares enough information (both SSID and BSSID!) with another non-transmitted BSS of a different AP, then we can find and update it, and then try to add it to the non-transmitted BSS list. We do a search for it on the transmitted BSS, but if it's not there (but belongs to another transmitted BSS), the list gets corrupted. Since this is an erroneous situation, simply fail the list insertion in this case and free the non-transmitted BSS. This fixes CVE-2022-42721. Reported-by: Sönke Huster Tested-by: Sönke Huster Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Johannes Berg commit 0b7808818cb9df6680f98996b8e9a439fa7bcc2f Author: Johannes Berg Date: Fri Sep 30 23:44:23 2022 +0200 wifi: cfg80211: fix BSS refcounting bugs There are multiple refcounting bugs related to multi-BSSID: - In bss_ref_get(), if the BSS has a hidden_beacon_bss, then the bss pointer is overwritten before checking for the transmitted BSS, which is clearly wrong. Fix this by using the bss_from_pub() macro. - In cfg80211_bss_update() we copy the transmitted_bss pointer from tmp into new, but then if we release new, we'll unref it erroneously. We already set the pointer and ref it, but need to NULL it since it was copied from the tmp data. - In cfg80211_inform_single_bss_data(), if adding to the non- transmitted list fails, we unlink the BSS and yet still we return it, but this results in returning an entry without a reference. We shouldn't return it anyway if it was broken enough to not get added there. This fixes CVE-2022-42720. Reported-by: Sönke Huster Tested-by: Sönke Huster Fixes: a3584f56de1c ("cfg80211: Properly track transmitting and non-transmitting BSS") Signed-off-by: Johannes Berg commit 567e14e39e8f8c6997a1378bc3be615afca86063 Author: Johannes Berg Date: Thu Sep 29 21:50:44 2022 +0200 wifi: cfg80211: ensure length byte is present before access When iterating the elements here, ensure the length byte is present before checking it to see if the entire element will fit into the buffer. Longer term, we should rewrite this code using the type-safe element iteration macros that check all of this. Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Reported-by: Soenke Huster Signed-off-by: Johannes Berg commit ff05d4b45dd89b922578dac497dcabf57cf771c6 Author: Johannes Berg Date: Wed Sep 28 22:07:15 2022 +0200 wifi: mac80211: fix MBSSID parsing use-after-free When we parse a multi-BSSID element, we might point some element pointers into the allocated nontransmitted_profile. However, we free this before returning, causing UAF when the relevant pointers in the parsed elements are accessed. Fix this by not allocating the scratch buffer separately but as part of the returned structure instead, that way, there are no lifetime issues with it. The scratch buffer introduction as part of the returned data here is taken from MLO feature work done by Ilan. This fixes CVE-2022-42719. Fixes: 5023b14cf4df ("mac80211: support profile split between elements") Co-developed-by: Ilan Peer Signed-off-by: Ilan Peer Reviewed-by: Kees Cook Signed-off-by: Johannes Berg commit 8f033d2becc24aa6bfd2a5c104407963560caabc Author: Johannes Berg Date: Wed Sep 28 22:01:37 2022 +0200 wifi: cfg80211/mac80211: reject bad MBSSID elements Per spec, the maximum value for the MaxBSSID ('n') indicator is 8, and the minimum is 1 since a multiple BSSID set with just one BSSID doesn't make sense (the # of BSSIDs is limited by 2^n). Limit this in the parsing in both cfg80211 and mac80211, rejecting any elements with an invalid value. This fixes potentially bad shifts in the processing of these inside the cfg80211_gen_new_bssid() function later. I found this during the investigation of CVE-2022-41674 fixed by the previous patch. Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Fixes: 78ac51f81532 ("mac80211: support multi-bssid") Reviewed-by: Kees Cook Signed-off-by: Johannes Berg commit aebe9f4639b13a1f4e9a6b42cdd2e38c617b442d Author: Johannes Berg Date: Wed Sep 28 21:56:15 2022 +0200 wifi: cfg80211: fix u8 overflow in cfg80211_update_notlisted_nontrans() In the copy code of the elements, we do the following calculation to reach the end of the MBSSID element: /* copy the IEs after MBSSID */ cpy_len = mbssid[1] + 2; This looks fine, however, cpy_len is a u8, the same as mbssid[1], so the addition of two can overflow. In this case the subsequent memcpy() will overflow the allocated buffer, since it copies 256 bytes too much due to the way the allocation and memcpy() sizes are calculated. Fix this by using size_t for the cpy_len variable. This fixes CVE-2022-41674. Reported-by: Soenke Huster Tested-by: Soenke Huster Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Reviewed-by: Kees Cook Signed-off-by: Johannes Berg commit c5e595e752b3a1c68cca57c3559521237332fbec Author: Matthew Auld Date: Tue Oct 4 14:19:13 2022 +0100 drm/i915/display: handle migration for dpt On platforms like DG2, it looks like the dpt path here is missing the migrate-to-lmem step on discrete platforms. v2: - Move the vma_pin() under the for_i915_gem_ww(), otherwise the object can be moved after dropping the lock and then doing the pin. Fixes: 33e7a975103c ("drm/i915/xelpd: First stab at DPT support") Signed-off-by: Matthew Auld Cc: Jianshui Yu Cc: Ville Syrjälä Cc: Nirmoy Das Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-2-matthew.auld@intel.com (cherry picked from commit 5769f64ff09aab23a9045fa13b464fb5070d3fb2) Signed-off-by: Tvrtko Ursulin commit 7023472834a39341460dae5c9b506c76c5940cad Author: Tvrtko Ursulin Date: Mon Oct 3 13:16:30 2022 +0100 drm/i915/guc: Fix revocation of non-persistent contexts Patch which added graceful exit for non-persistent contexts missed the fact it is not enough to set the exiting flag on a context and let the backend handle it from there. GuC backend cannot handle it because it runs independently in the firmware and driver might not see the requests ever again. Patch also missed the fact some usages of intel_context_is_banned in the GuC backend needed replacing with newly introduced intel_context_is_schedulable. Fix the first issue by calling into backend revoke when we know this is the last chance to do it. Fix the second issue by replacing intel_context_is_banned with intel_context_is_schedulable, which should always be safe since latter is a superset of the former. v2: * Just call ce->ops->revoke unconditionally. (Andrzej) Signed-off-by: Tvrtko Ursulin Fixes: 45c64ecf97ee ("drm/i915: Improve user experience and driver robustness under SIGINT or similar") Cc: Andrzej Hajda Cc: John Harrison Cc: Daniele Ceraolo Spurio Cc: # v6.0+ Reviewed-by: Andrzej Hajda Acked-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20221003121630.694249-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 0add082cebac8555ee3972ba768ae5c01db7a498) Signed-off-by: Tvrtko Ursulin commit af7d23f9d96a3e9647cff8619a6860d73b109b5f Author: Yang Yingliang Date: Mon Oct 10 11:39:45 2022 +0800 octeontx2-pf: mcs: fix possible memory leak in otx2_probe() In error path after calling cn10k_mcs_init(), cn10k_mcs_free() need be called to avoid memory leak. Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 84cdf5bcbdce1622eeb6c857f8a7e383de1074a9 Author: Vadim Fedorenko Date: Mon Oct 10 04:29:34 2022 +0300 ] ptp: ocp: remove symlink for second GNSS Destroy code doesn't remove symlink for ttyGNSS2 device introduced earlier. Add cleanup code. Fixes: 71d7e0850476 ("ptp: ocp: Add second GNSS device") Signed-off-by: Vadim Fedorenko Acked-by: Jonathan Lemon Signed-off-by: David S. Miller commit 5f8f8574c7f5585b09a9623f0f13462e4eb67b4d Merge: e62563db857f8 fe5b6aaef72a0 Author: Dmitry Torokhov Date: Sun Oct 9 22:30:23 2022 -0700 Merge branch 'next' into for-linus Prepare input updates for 6.1 merge window. commit fe5b6aaef72a0f7daa06e7960e0bee45c2984e41 Author: Liang He Date: Sat Oct 1 14:42:24 2022 -0700 Input: i8042 - fix refount leak on sparc In i8042_platform_init() and i8042_platform_exit(), we should call of_node_put() for the reference 'root' returned by of_find_node_by_path() which has increased the refcount. Fixes: f57caaefacc2 ("[SERIO] i8042-sparcio.h: Convert to of_driver framework.") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220711064300.358757-1-windhl@126.com [dtor: rearranged i8042_is_mr_coffee() a bit] Signed-off-by: Dmitry Torokhov commit fdd7c96176de823229d88e787b9e554b0f05b6c1 Author: Huacai Chen Date: Sat Oct 1 14:29:01 2022 -0700 Input: i8042 - add LoongArch support in i8042-acpipnpio.h LoongArch uses ACPI and nearly the same as X86/IA64 for 8042. So modify i8042-acpipnpio.h slightly and enable it for LoongArch in i8042.h. Then i8042 driver can work well under the ACPI firmware with PNP typed key- board and mouse configured in DSDT. Signed-off-by: Huacai Chen Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220917064020.1639709-2-chenhuacai@loongson.cn Signed-off-by: Dmitry Torokhov commit 8761b9b580d53162cca7868385069c0d4354c9e0 Author: Huacai Chen Date: Sat Oct 1 14:28:34 2022 -0700 Input: i8042 - rename i8042-x86ia64io.h to i8042-acpipnpio.h Now i8042-x86ia64io.h is shared by X86 and IA64, but it can be shared by more platforms (such as LoongArch) with ACPI firmware on which PNP typed keyboard and mouse is configured in DSDT. So rename it to i8042- acpipnpio.h. Signed-off-by: Huacai Chen Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220917064020.1639709-1-chenhuacai@loongson.cn Signed-off-by: Dmitry Torokhov commit 63c5eb157cfdb6f20387c4492d27d7248e239e85 Author: Samuel Holland Date: Fri Sep 30 22:53:23 2022 -0700 Input: pinephone-keyboard - support the proxied I2C bus The PinePhone keyboard case contains a battery managed by an integrated power bank IC. The power bank IC communicates over I2C, and the keyboard MCU firmware provides an interface to read and write its registers. Let's use this interface to implement a SMBus adapter, so we can reuse the driver for the power bank IC. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220618165747.55709-4-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit 17406967ec0ff8e14737ee7a073c7a45fc8210f1 Author: Samuel Holland Date: Fri Sep 30 22:53:06 2022 -0700 Input: pinephone-keyboard - add PinePhone keyboard driver The official Pine64 PinePhone keyboard case contains a matrix keypad and a MCU which runs a libre firmware. Add support for its I2C interface. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220618165747.55709-3-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit 493ffd6605b2d3d4dc7008ab927dba319f36671f Merge: e572410e47a4e de399236e2407 Author: Linus Torvalds Date: Sun Oct 9 16:24:05 2022 -0700 Merge tag 'ucount-rlimits-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ucounts update from Eric Biederman: "Split rlimit and ucount values and max values After the ucount rlimit code was merged a bunch of small but siginificant bugs were found and fixed. At the time it was realized that part of the problem was that while the ucount rlimits were very similar to the oridinary ucounts (in being nested counts with limits) the semantics were slightly different and the code would be less error prone if there was less sharing. This is the long awaited cleanup that should hopefully keep things more comprehensible and less error prone for whoever needs to touch that code next" * tag 'ucount-rlimits-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ucounts: Split rlimit and ucount values and max values commit e572410e47a4e9647d5d7a49ca699a1497378707 Merge: 86fb9c53d82f1 9a95f78eab70d Author: Linus Torvalds Date: Sun Oct 9 16:14:15 2022 -0700 Merge tag 'signal-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ptrace update from Eric Biederman: "ptrace: Stop supporting SIGKILL for PTRACE_EVENT_EXIT Recently I had a conversation where it was pointed out to me that SIGKILL sent to a tracee stropped in PTRACE_EVENT_EXIT is quite difficult for a tracer to handle. Keeping SIGKILL working after the process has been killed is pain from an implementation point of view. So since the debuggers don't want this behavior let's see if we can remove this wart for the userspace API If a regression is detected it should only need to be the last change that is the reverted. The other two are just general cleanups that make the last patch simpler" * tag 'signal-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: Drop signals received after a fatal signal has been processed signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit commit 86fb9c53d82f1dadf960553a3bd351de6173911f Merge: c71370bde7dbd c579d60f0d0cd Author: Linus Torvalds Date: Sun Oct 9 16:10:22 2022 -0700 Merge tag 'retire_mq_sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull mqueue fix from Eric Biederman: "A fix for an unlikely but possible memory leak" * tag 'retire_mq_sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ipc: mqueue: fix possible memory leak in init_mqueue_fs() commit c71370bde7dbd3aefae0c2e8dd643d68fb2c51c8 Merge: 4899a36f91a9f a7c01fa93aeb0 Author: Linus Torvalds Date: Sun Oct 9 16:01:59 2022 -0700 Merge tag 'interrupting_kthread_stop-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull kthread update from Eric Biederman: "Break out of wait loops on kthread_stop() This is a small tweak to kthread_stop so it breaks out of interruptible waits, that don't explicitly test for kthread_stop. These interruptible waits occassionaly occur in kernel threads do to code sharing" * tag 'interrupting_kthread_stop-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: break out of wait loops on kthread_stop() commit 4899a36f91a9f9b06878471096bd143e7253006d Merge: 03785a69ae47a 376b3275c19f8 Author: Linus Torvalds Date: Sun Oct 9 14:05:15 2022 -0700 Merge tag 'powerpc-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Remove our now never-true definitions for pgd_huge() and p4d_leaf(). - Add pte_needs_flush() and huge_pmd_needs_flush() for 64-bit. - Add support for syscall wrappers. - Add support for KFENCE on 64-bit. - Update 64-bit HV KVM to use the new guest state entry/exit accounting API. - Support execute-only memory when using the Radix MMU (P9 or later). - Implement CONFIG_PARAVIRT_TIME_ACCOUNTING for pseries guests. - Updates to our linker script to move more data into read-only sections. - Allow the VDSO to be randomised on 32-bit. - Many other small features and fixes. Thanks to Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Athira Rajeev, Christophe Leroy, David Hildenbrand, Disha Goel, Fabiano Rosas, Gaosheng Cui, Gustavo A. R. Silva, Haren Myneni, Hari Bathini, Jilin Yuan, Joel Stanley, Kajol Jain, Kees Cook, Krzysztof Kozlowski, Laurent Dufour, Liang He, Li Huafei, Lukas Bulwahn, Madhavan Srinivasan, Nathan Chancellor, Nathan Lynch, Nicholas Miehlbradt, Nicholas Piggin, Pali Rohár, Rohan McLure, Russell Currey, Sachin Sant, Segher Boessenkool, Shrikanth Hegde, Tyrel Datwyler, Wolfram Sang, ye xingchen, and Zheng Yongjun. * tag 'powerpc-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (214 commits) KVM: PPC: Book3S HV: Fix stack frame regs marker powerpc: Don't add __powerpc_ prefix to syscall entry points powerpc/64s/interrupt: Fix stack frame regs marker powerpc/64: Fix msr_check_and_set/clear MSR[EE] race powerpc/64s/interrupt: Change must-hard-mask interrupt check from BUG to WARN powerpc/pseries: Add firmware details to the hardware description powerpc/powernv: Add opal details to the hardware description powerpc: Add device-tree model to the hardware description powerpc/64: Add logical PVR to the hardware description powerpc: Add PVR & CPU name to hardware description powerpc: Add hardware description string powerpc/configs: Enable PPC_UV in powernv_defconfig powerpc/configs: Update config files for removed/renamed symbols powerpc/mm: Fix UBSAN warning reported on hugetlb powerpc/mm: Always update max/min_low_pfn in mem_topology_setup() powerpc/mm/book3s/hash: Rename flush_tlb_pmd_range powerpc: Drops STABS_DEBUG from linker scripts powerpc/64s: Remove lost/old comment powerpc/64s: Remove old STAB comment powerpc: remove orphan systbl_chk.sh ... commit c7d7d2d345697eb3781198e58a22504feb74af63 Merge: 74b1b10e29b1f ebdc416c9c0be Author: Andreas Gruenbacher Date: Sun Oct 9 22:56:28 2022 +0200 gfs2: Merge branch 'for-next.nopid' into for-next Resolves a conflict in gfs2_inode_lookup() between the following commits: gfs2: Use TRY lock in gfs2_inode_lookup for UNLINKED inodes gfs2: Mark the remaining process-independent glock holders as GL_NOPID Signed-off-by: Andreas Gruenbacher commit 03785a69ae47a17fe57fee31058fef7cd3042977 Merge: 2e64066dab157 8fb65e05bd600 Author: Linus Torvalds Date: Sun Oct 9 13:51:40 2022 -0700 Merge tag 's390-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: - Make use of the IBM z16 processor activity instrumentation facility extension to count neural network processor assist operations: add a new PMU device driver so that perf can make use of this. - Rework memcpy_real() to avoid DAT-off mode. - Rework absolute lowcore access code. - Various small fixes and improvements all over the code. * tag 's390-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/pci: remove unused bus_next field from struct zpci_dev s390/cio: remove unused ccw_device_force_console() declaration s390/pai: Add support for PAI Extension 1 NNPA counters s390/mm: fix no previous prototype warnings in maccess.c s390/mm: uninline copy_oldmem_kernel() function s390/mm,ptdump: add real memory copy page markers s390/mm: rework memcpy_real() to avoid DAT-off mode s390/dump: save IPL CPU registers once DAT is available s390/pci: convert high_memory to physical address s390/smp,ptdump: add absolute lowcore markers s390/smp: rework absolute lowcore access s390/smp: call smp_reinit_ipl_cpu() before scheduler is available s390/ptdump: add missing amode31 markers s390/mm: split lowcore pages with set_memory_4k() s390/mm: remove unused access parameter from do_fault_error() s390/delay: sync comment within __delay() with reality s390: move from strlcpy with unused retval to strscpy commit b2cf5d902ec1a7560f20945ddd2b0de82eff7cf3 Author: Yang Yingliang Date: Sun Oct 9 09:51:26 2022 +0800 octeontx2-af: cn10k: mcs: Fix error return code in mcs_register_interrupts() If alloc_mem() fails in mcs_register_interrupts(), it should return error code. Fixes: 6c635f78c474 ("octeontx2-af: cn10k: mcs: Handle MCS block interrupts") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 2e64066dab157ffcd0e9ec2ff631862e6e222876 Merge: 57c92724c8c19 87f81e66e2e84 Author: Linus Torvalds Date: Sun Oct 9 13:24:01 2022 -0700 Merge tag 'riscv-for-linus-6.1-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Improvements to the CPU topology subsystem, which fix some issues where RISC-V would report bad topology information. - The default NR_CPUS has increased to XLEN, and the maximum configurable value is 512. - The CD-ROM filesystems have been enabled in the defconfig. - Support for THP_SWAP has been added for rv64 systems. There are also a handful of cleanups and fixes throughout the tree. * tag 'riscv-for-linus-6.1-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: enable THP_SWAP for RV64 RISC-V: Print SSTC in canonical order riscv: compat: s/failed/unsupported if compat mode isn't supported RISC-V: Increase range and default value of NR_CPUS cpuidle: riscv-sbi: Fix CPU_PM_CPU_IDLE_ENTER_xyz() macro usage perf: RISC-V: throttle perf events perf: RISC-V: exclude invalid pmu counters from SBI calls riscv: enable CD-ROM file systems in defconfig riscv: topology: fix default topology reporting arm64: topology: move store_cpu_topology() to shared code commit 57c92724c8c19fc1b099826610fdb51985de12ba Merge: ef688f8b8cd3e adc4cefae9cfa Author: Linus Torvalds Date: Sun Oct 9 13:13:48 2022 -0700 Merge tag 'microblaze-v6.1' of git://git.monstr.eu/linux-2.6-microblaze Pull microblaze updates from Michal Simek: "This adds architecture support for error injection which can be done only via local memory (BRAM) with enabling path for recovery after reset. These patches targets Triple Modular Redundacy (TMR) configuration where 3 Microblazes are running in parallel with monitoring logic. When an error happens (or is injected) system goes to break handler with full CPU reset and system recovery back to origin context. More information can be found at [1]" Link: https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/tmr/v1_0/pg268-tmr.pdf [1] * tag 'microblaze-v6.1' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Add support for error injection microblaze: Add custom break vector handler for mb manager microblaze: Add xmb_manager_register function commit 557f050166e523ce86018d7a43e7d543d9598b3d Author: Yang Yingliang Date: Sat Oct 8 16:39:42 2022 +0800 net: dsa: fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() Fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() to print error message. Fixes: cf5ca4ddc37a ("net: dsa: don't leave dangling pointers in dp->pl when failing") Signed-off-by: Yang Yingliang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 897fab7a726aa461ad0dcda7c345d5261bb6a0ca Author: Yang Yingliang Date: Sat Oct 8 16:26:50 2022 +0800 octeontx2-pf: mcs: fix missing unlock in some error paths Add the missing unlock in some error paths. Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit b64085b00044bdf3cd1c9825e9ef5b2e0feae91a Author: Eric Dumazet Date: Fri Oct 7 15:57:43 2022 -0700 macvlan: enforce a consistent minimal mtu macvlan should enforce a minimal mtu of 68, even at link creation. This patch avoids the current behavior (which could lead to crashes in ipv6 stack if the link is brought up) $ ip link add macvlan1 link eno1 mtu 8 type macvlan # This should fail ! $ ip link sh dev macvlan1 5: macvlan1@eno1: mtu 8 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 02:47:6c:24:74:82 brd ff:ff:ff:ff:ff:ff $ ip link set macvlan1 mtu 67 Error: mtu less than device minimum. $ ip link set macvlan1 mtu 68 $ ip link set macvlan1 mtu 8 Error: mtu less than device minimum. Fixes: 91572088e3fd ("net: use core MTU range checking in core net infra") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 175302f6b79ebbb207c2d58d6d3e679465de23b0 Author: Duoming Zhou Date: Sun Oct 9 14:37:31 2022 +0800 mISDN: hfcpci: Fix use-after-free bug in hfcpci_softirq The function hfcpci_softirq() is a timer handler. If it is running, the timer_pending() will return 0 and the del_timer_sync() in HFC_cleanup() will not be executed. As a result, the use-after-free bug will happen. The process is shown below: (cleanup routine) | (timer handler) HFC_cleanup() | hfcpci_softirq() if (timer_pending(&hfc_tl)) | del_timer_sync() | ... | ... pci_unregister_driver(hc) | driver_unregister | driver_for_each_device bus_remove_driver | _hfcpci_softirq driver_detach | ... put_device(dev) //[1]FREE | | dev_get_drvdata(dev) //[2]USE The device is deallocated is position [1] and used in position [2]. Fix by removing the "timer_pending" check in HFC_cleanup(), which makes sure that the hfcpci_softirq() have finished before the resource is deallocated. Fixes: 009fc857c5f6 ("mISDN: fix possible use-after-free in HFC_cleanup()") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit ef688f8b8cd3eb20547a6543f03e3d8952b87769 Merge: 0e470763d84dc c59fb12758386 Author: Linus Torvalds Date: Sun Oct 9 09:39:55 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "The first batch of KVM patches, mostly covering x86. ARM: - Account stage2 page table allocations in memory stats x86: - Account EPT/NPT arm64 page table allocations in memory stats - Tracepoint cleanups/fixes for nested VM-Enter and emulated MSR accesses - Drop eVMCS controls filtering for KVM on Hyper-V, all known versions of Hyper-V now support eVMCS fields associated with features that are enumerated to the guest - Use KVM's sanitized VMCS config as the basis for the values of nested VMX capabilities MSRs - A myriad event/exception fixes and cleanups. Most notably, pending exceptions morph into VM-Exits earlier, as soon as the exception is queued, instead of waiting until the next vmentry. This fixed a longstanding issue where the exceptions would incorrecly become double-faults instead of triggering a vmexit; the common case of page-fault vmexits had a special workaround, but now it's fixed for good - A handful of fixes for memory leaks in error paths - Cleanups for VMREAD trampoline and VMX's VM-Exit assembly flow - Never write to memory from non-sleepable kvm_vcpu_check_block() - Selftests refinements and cleanups - Misc typo cleanups Generic: - remove KVM_REQ_UNHALT" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (94 commits) KVM: remove KVM_REQ_UNHALT KVM: mips, x86: do not rely on KVM_REQ_UNHALT KVM: x86: never write to memory from kvm_vcpu_check_block() KVM: x86: Don't snapshot pending INIT/SIPI prior to checking nested events KVM: nVMX: Make event request on VMXOFF iff INIT/SIPI is pending KVM: nVMX: Make an event request if INIT or SIPI is pending on VM-Enter KVM: SVM: Make an event request if INIT or SIPI is pending when GIF is set KVM: x86: lapic does not have to process INIT if it is blocked KVM: x86: Rename kvm_apic_has_events() to make it INIT/SIPI specific KVM: x86: Rename and expose helper to detect if INIT/SIPI are allowed KVM: nVMX: Make an event request when pending an MTF nested VM-Exit KVM: x86: make vendor code check for all nested events mailmap: Update Oliver's email address KVM: x86: Allow force_emulation_prefix to be written without a reload KVM: selftests: Add an x86-only test to verify nested exception queueing KVM: selftests: Use uapi header to get VMX and SVM exit reasons/codes KVM: x86: Rename inject_pending_events() to kvm_check_and_inject_events() KVM: VMX: Update MTF and ICEBP comments to document KVM's subtle behavior KVM: x86: Treat pending TRIPLE_FAULT requests as pending exceptions KVM: x86: Morph pending exceptions to pending VM-Exits at queue time ... commit 0e470763d84dcad27284067647dfb4b1a94dfce0 Merge: a6afa4199d3d0 d3549a938b73f Author: Linus Torvalds Date: Sun Oct 9 08:56:54 2022 -0700 Merge tag 'efi-next-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI updates from Ard Biesheuvel: "A bit more going on than usual in the EFI subsystem. The main driver for this has been the introduction of the LoonArch architecture last cycle, which inspired some cleanup and refactoring of the EFI code. Another driver for EFI changes this cycle and in the future is confidential compute. The LoongArch architecture does not use either struct bootparams or DT natively [yet], and so passing information between the EFI stub and the core kernel using either of those is undesirable. And in general, overloading DT has been a source of issues on arm64, so using DT for this on new architectures is a to avoid for the time being (even if we might converge on something DT based for non-x86 architectures in the future). For this reason, in addition to the patch that enables EFI boot for LoongArch, there are a number of refactoring patches applied on top of which separate the DT bits from the generic EFI stub bits. These changes are on a separate topich branch that has been shared with the LoongArch maintainers, who will include it in their pull request as well. This is not ideal, but the best way to manage the conflicts without stalling LoongArch for another cycle. Another development inspired by LoongArch is the newly added support for EFI based decompressors. Instead of adding yet another arch-specific incarnation of this pattern for LoongArch, we are introducing an EFI app based on the existing EFI libstub infrastructure that encapulates the decompression code we use on other architectures, but in a way that is fully generic. This has been developed and tested in collaboration with distro and systemd folks, who are eager to start using this for systemd-boot and also for arm64 secure boot on Fedora. Note that the EFI zimage files this introduces can also be decompressed by non-EFI bootloaders if needed, as the image header describes the location of the payload inside the image, and the type of compression that was used. (Note that Fedora's arm64 GRUB is buggy [0] so you'll need a recent version or switch to systemd-boot in order to use this.) Finally, we are adding TPM measurement of the kernel command line provided by EFI. There is an oversight in the TCG spec which results in a blind spot for command line arguments passed to loaded images, which means that either the loader or the stub needs to take the measurement. Given the combinatorial explosion I am anticipating when it comes to firmware/bootloader stacks and firmware based attestation protocols (SEV-SNP, TDX, DICE, DRTM), it is good to set a baseline now when it comes to EFI measured boot, which is that the kernel measures the initrd and command line. Intermediate loaders can measure additional assets if needed, but with the baseline in place, we can deploy measured boot in a meaningful way even if you boot into Linux straight from the EFI firmware. Summary: - implement EFI boot support for LoongArch - implement generic EFI compressed boot support for arm64, RISC-V and LoongArch, none of which implement a decompressor today - measure the kernel command line into the TPM if measured boot is in effect - refactor the EFI stub code in order to isolate DT dependencies for architectures other than x86 - avoid calling SetVirtualAddressMap() on arm64 if the configured size of the VA space guarantees that doing so is unnecessary - move some ARM specific code out of the generic EFI source files - unmap kernel code from the x86 mixed mode 1:1 page tables" * tag 'efi-next-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: (24 commits) efi/arm64: libstub: avoid SetVirtualAddressMap() when possible efi: zboot: create MemoryMapped() device path for the parent if needed efi: libstub: fix up the last remaining open coded boot service call efi/arm: libstub: move ARM specific code out of generic routines efi/libstub: measure EFI LoadOptions efi/libstub: refactor the initrd measuring functions efi/loongarch: libstub: remove dependency on flattened DT efi: libstub: install boot-time memory map as config table efi: libstub: remove DT dependency from generic stub efi: libstub: unify initrd loading between architectures efi: libstub: remove pointless goto kludge efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap efi: libstub: avoid efi_get_memory_map() for allocating the virt map efi: libstub: drop pointless get_memory_map() call efi: libstub: fix type confusion for load_options_size arm64: efi: enable generic EFI compressed boot loongarch: efi: enable generic EFI compressed boot riscv: efi: enable generic EFI compressed boot efi/libstub: implement generic EFI zboot efi/libstub: move efi_system_table global var into separate object ... commit 285febabac4a16655372d23ff43e89ff6f216691 Author: Yu Kuai Date: Sun Oct 9 18:10:38 2022 +0800 blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() commit 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is initialized") moves wbt_set_write_cache() before rq_qos_add(), which is wrong because wbt_rq_qos() is still NULL. Fix the problem by removing wbt_set_write_cache() and setting 'rwb->wc' directly. Noted that this patch also remove the redundant setting of 'rab->wc'. Fixes: 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is initialized") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210081045.77ddf59b-yujie.liu@intel.com Signed-off-by: Yu Kuai Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20221009101038.1692875-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 1045f5f1ff0751423aeb65648e5e1abd7a7a8672 Author: Takashi Iwai Date: Sun Oct 9 12:42:12 2022 +0200 ALSA: usb-audio: Avoid superfluous endpoint setup After splitting to snd_usb_endpoint_set_params() and *_prepare(), the skip of each function should be checked with different flags, while we still use ep->need_setup as the single one. Introduce ep->need_prepare for indicating the need of prepare, and also add the missing check of ep->need_setup at the set_params. Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)") Link: https://lore.kernel.org/r/20221009104212.18877-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9355b60e401d825590d37f04ea873c58efe9b7bf Author: Takashi Iwai Date: Sun Oct 9 12:42:11 2022 +0200 ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params() snd_usb_endpoint_set_params() should return zero for a success, but currently it returns the sample rate. Correct it. Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)") Link: https://lore.kernel.org/r/20221009104212.18877-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit a74f8d0aa902ca494676b79226e0b5a1747b81d4 Author: Takashi Iwai Date: Sun Oct 9 12:42:10 2022 +0200 ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params() The protection with chip->mutex was lost after splitting snd_usb_endpoint_set_params() and snd_usb_endpoint_prepare(). Apply the same mutex again to the former function. Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)") Link: https://lore.kernel.org/r/20221009104212.18877-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9902b303b5ade208b58f0dd38a09831813582211 Author: Takashi Iwai Date: Sun Oct 9 12:42:09 2022 +0200 ALSA: usb-audio: Avoid unnecessary interface change at EP close We toggle USB interface at PCM prepare and reset at close. When the PCM isn't prepared, resetting again makes little sense. Check the current altset and avoid unnecessary interface reset at EP close. Link: https://lore.kernel.org/r/20221009104212.18877-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 556a11a082ee208455ed42e7c460849cc3dbd68c Author: Amadeusz Sławiński Date: Fri Oct 7 10:48:56 2022 +0200 ALSA: hda: Update register polling macros Recent commit d91857059def ("ALSA: hda: Rework snd_hdac_stream_reset() to use macros") missed that on some devices register access needs to be done with unaligned access helper. Change polling macros to use read_poll_timeout_atomic() in order to specify register read function. Fixes: d91857059def ("ALSA: hda: Rework snd_hdac_stream_reset() to use macros") Reported-by: Jon Hunter Link: https://lore.kernel.org/alsa-devel/20220818141517.109280-1-amadeuszx.slawinski@linux.intel.com/T/#m1270737db52b5ef163eff73cb5f862d16a07a428 Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20221007084856.1638302-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit 837d632a383f13df7a67207a196d6eb4aeb4adca Author: Vincent Donnefort Date: Tue Oct 4 16:42:16 2022 +0100 KVM: arm64: Enable stack protection and branch profiling for VHE For historical reasons, the VHE code inherited the build configuration from nVHE. Now those two parts have their own folder and makefile, we can enable stack protection and branch profiling for VHE. Signed-off-by: Vincent Donnefort Reviewed-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221004154216.2833636-1-vdonnefort@google.com commit 5994bc9e05c2f8811f233aa434e391cd2783f0f5 Author: Oliver Upton Date: Fri Oct 7 23:41:51 2022 +0000 KVM: arm64: Limit stage2_apply_range() batch size to largest block Presently stage2_apply_range() works on a batch of memory addressed by a stage 2 root table entry for the VM. Depending on the IPA limit of the VM and PAGE_SIZE of the host, this could address a massive range of memory. Some examples: 4 level, 4K paging -> 512 GB batch size 3 level, 64K paging -> 4TB batch size Unsurprisingly, working on such a large range of memory can lead to soft lockups. When running dirty_log_perf_test: ./dirty_log_perf_test -m -2 -s anonymous_thp -b 4G -v 48 watchdog: BUG: soft lockup - CPU#0 stuck for 45s! [dirty_log_perf_:16703] Modules linked in: vfat fat cdc_ether usbnet mii xhci_pci xhci_hcd sha3_generic gq(O) CPU: 0 PID: 16703 Comm: dirty_log_perf_ Tainted: G O 6.0.0-smp-DEV #1 pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : dcache_clean_inval_poc+0x24/0x38 lr : clean_dcache_guest_page+0x28/0x4c sp : ffff800021763990 pmr_save: 000000e0 x29: ffff800021763990 x28: 0000000000000005 x27: 0000000000000de0 x26: 0000000000000001 x25: 00400830b13bc77f x24: ffffad4f91ead9c0 x23: 0000000000000000 x22: ffff8000082ad9c8 x21: 0000fffafa7bc000 x20: ffffad4f9066ce50 x19: 0000000000000003 x18: ffffad4f92402000 x17: 000000000000011b x16: 000000000000011b x15: 0000000000000124 x14: ffff07ff8301d280 x13: 0000000000000000 x12: 00000000ffffffff x11: 0000000000010001 x10: fffffc0000000000 x9 : ffffad4f9069e580 x8 : 000000000000000c x7 : 0000000000000000 x6 : 000000000000003f x5 : ffff07ffa2076980 x4 : 0000000000000001 x3 : 000000000000003f x2 : 0000000000000040 x1 : ffff0830313bd000 x0 : ffff0830313bcc40 Call trace: dcache_clean_inval_poc+0x24/0x38 stage2_unmap_walker+0x138/0x1ec __kvm_pgtable_walk+0x130/0x1d4 __kvm_pgtable_walk+0x170/0x1d4 __kvm_pgtable_walk+0x170/0x1d4 __kvm_pgtable_walk+0x170/0x1d4 kvm_pgtable_stage2_unmap+0xc4/0xf8 kvm_arch_flush_shadow_memslot+0xa4/0x10c kvm_set_memslot+0xb8/0x454 __kvm_set_memory_region+0x194/0x244 kvm_vm_ioctl_set_memory_region+0x58/0x7c kvm_vm_ioctl+0x49c/0x560 __arm64_sys_ioctl+0x9c/0xd4 invoke_syscall+0x4c/0x124 el0_svc_common+0xc8/0x194 do_el0_svc+0x38/0xc0 el0_svc+0x2c/0xa4 el0t_64_sync_handler+0x84/0xf0 el0t_64_sync+0x1a0/0x1a4 Use the largest supported block mapping for the configured page size as the batch granularity. In so doing the walker is guaranteed to visit a leaf only once. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221007234151.461779-3-oliver.upton@linux.dev commit 3b5c082bbfa20d9a57924edd655bbe63fe98ab06 Author: Oliver Upton Date: Fri Oct 7 23:41:50 2022 +0000 KVM: arm64: Work out supported block level at compile time Work out the minimum page table level where KVM supports block mappings at compile time. While at it, rewrite the comment around supported block mappings to directly describe what KVM supports instead of phrasing in terms of what it does not. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221007234151.461779-2-oliver.upton@linux.dev commit a6afa4199d3d038fbfdff5511f7523b0e30cb774 Merge: bdc753c7fcb4e b8ae88e1e75e5 Author: Linus Torvalds Date: Sat Oct 8 10:30:44 2022 -0700 Merge tag 'mailbox-v6.1' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - apple: implement poll and flush callbacks - qcom: fix clocks for IPQ6018 and IPQ8074 irq handler as not-a-thread - microchip: split reg-space into two - imx: RST channel fix - bcm: fix dma_map_sg error handling - misc: spelling fix in pcc driver * tag 'mailbox-v6.1' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: qcom-ipcc: flag IRQ NO_THREAD mailbox: pcc: Fix spelling mistake "Plaform" -> "Platform" mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 dt-bindings: mailbox: qcom: set correct #clock-cells mailbox: mpfs: account for mbox offsets while sending mailbox: mpfs: fix handling of the reg property dt-bindings: mailbox: fix the mpfs' reg property mailbox: imx: fix RST channel support mailbox: apple: Implement poll_data() operation mailbox: apple: Implement flush() operation commit bdc753c7fcb4eb009ae246a188ea7ac6dac98ce1 Merge: f01603979a4af f9efefdba95a5 Author: Linus Torvalds Date: Sat Oct 8 10:06:48 2022 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "We have some late breaking reports that a patch series to rework clk rate range support broke boot on some devices, so I've left that branch out of this. Hopefully we can get to that next week, or punt on it and let it bake another cycle. That means we don't really have any changes to the core framework this time around besides a few typo fixes. Instead this is all clk driver updates and fixes. The usual suspects are here (again), with Qualcomm dominating the diffstat. We look to have gained support for quite a few new Qualcomm SoCs and Dmitry worked on updating many of the existing Qualcomm drivers to use clk_parent_data. After that we have MediaTek drivers getting some much needed updates, in particular to support GPU DVFS. There are also quite a few Samsung clk driver patches, but that's mostly because there was a maintainer change and so last release we missed some of those patches. Overall things look normal, but I'm slowly reviewing core framework code nowadays and that shows given the rate range patches had to be yanked last minute. Let's hope this situation changes soon. New Drivers: - Support for Renesas VersaClock7 clock generator family - Add Spreadtrum UMS512 SoC clk support - New clock drivers for MediaTek Helio X10 MT6795 - Display clks for Qualcomm SM6115, SM8450 - GPU clks for Qualcomm SC8280XP - Qualcomm MSM8909 and SM6375 global and SMD RPM clk drivers Deleted Drivers: - Remove DaVinci DM644x and DM646x clk driver support Updates: - Convert Baikal-T1 CCU driver to platform driver - Split reset support out of primary Baikal-T1 CCU driver - Add some missing clks required for RPiVid Video Decoder on RaspberryPi - Mark PLLC critical on bcm2835 - More devm helpers for fixed rate registration - Various PXA168 clk driver fixes - Add resets for MediaTek MT8195 PCIe and USB - Miscellaneous of_node_put() fixes - Nuke dt-bindings/clk path (again) by moving headers to dt-bindings/clock - Convert gpio-clk-gate binding to YAML - Various fixes to AMD/Xilinx Zynqmp clk driver - Graduate AMD/Xilinx "clocking wizard" driver from staging - Add missing DPI1_HDMI clock in MT8195 VDOSYS1 - Clock driver changes to support GPU DVFS on MT8183, MT8192, MT8195 - Fix GPU clock topology on MT8195 - Propogate rate changes from GPU clock gate up the tree - Clock mux notifiers for GPU-related PLLs - Conversion of more "simple" drivers to mtk_clk_simple_probe() - Hook up mtk_clk_simple_remove() for "simple" MT8192 clock drivers - Fixes to previous |struct clk| to |struct clk_hw| conversion on MediaTek - Shrink MT8192 clock driver by deduplicating clock parent lists - Change order between 'sim_enet_root_clk' and 'enet_qos_root_clk' clocks for i.MX8MP - Drop unnecessary newline in i.MX8MM dt-bindings - Add more MU1 and SAI clocks dt-bindings Ids - Introduce slice busy bit check for i.MX93 composite clock - Introduce white list bit check for i.MX93 composite clock - Add new i.MX93 clock gate - Add MU1 and MU2 clocks to i.MX93 clock provider - Add SAI IPG clocks to i.MX93 clock provider - add generic clocks for U(S)ART available on SAMA5D2 SoCs - reset controller support for Polarfire clocks - .round_rate and .set rate support for clk-mpfs - code cleanup for clk-mpfs - PLL support for PolarFire SoC's Clock Conditioning Circuitry - Add watchdog, I2C, pin control/GPIO, and Ethernet clocks on R-Car V4H - Add SDHI, Timer (CMT/TMU), and SPI (MSIOF) clocks on R-Car S4-8 - Add I2C clocks and resets on RZ/V2M - Document clock support for the RZ/Five SoC - mux-variant clock using the table variant to select parents - clock controller for the rv1126 soc - conversion of rk3128 to yaml and relicensing of the yaml bindings to gpl2+MIT (following dt-binding guildelines) - Exynos7885: add FSYS, TREX and MFC clock controllers - Exynos850: add IS and AUD (audio) clock controllers with bindings - ExynosAutov9: add FSYS clock controllers with bindings - ExynosAutov9: correct clock IDs in bindings of Peric 0 and 1 clock controllers, due to duplicated entries. This is an acceptable ABI break: recently developed/added platform so without legacies, acked by known users/developers - ExynosAutov9: add few missing Peric 0/1 gates - ExynosAutov9: correct register offsets of few Peric 0/1 clocks - Minor code improvements (use of_device_get_match_data() helper, code style) - Add Krzysztof Kozlowski as co-maintainer of Samsung SoC clocks, as he already maintainers that architecture/platform - Keep Qualcomm GDSCs enabled when PWRSTS_RET flag is there, solving retention issues during suspend of USB on Qualcomm sc7180/sc7280 and SC8280XP - Qualcomm SM6115 and QCM2260 are moved to reuse PLL configuration - Qualcomm SDM660 SDCC1 moved to floor clk ops - Support for the APCS PLLs for Qualcomm IPQ8064, IPQ8074 and IPQ6018 was added/fixed - The Qualcomm MSM8996 CPU clocks are updated with support for ACD - Support for Qualcomm SDM670 GCC and RPMh clks was added - Transition to parent_data, parent_hws and use of ARRAY_SIZE() for num_parents was done for many Qualcomm SoCs - Support for per-reset defined delay on Qualcomm was introduced" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (283 commits) clk: qcom: gcc-sm6375: Ensure unsigned long type clk: qcom: gcc-sm6375: Remove unused variables clk: qcom: kpss-xcc: convert to parent data API clk: introduce (devm_)hw_register_mux_parent_data_table API clk: allow building lan966x as a module clk: clk-xgene: simplify if-if to if-else clk: ast2600: BCLK comes from EPLL clk: clocking-wizard: Depend on HAS_IOMEM clk: clocking-wizard: Use dev_err_probe() helper clk: nxp: fix typo in comment clk: pxa: add a check for the return value of kzalloc() clk: vc5: Add support for IDT/Renesas VersaClock 5P49V6975 dt-bindings: clock: vc5: Add 5P49V6975 clk: mvebu: armada-37xx-tbg: Remove the unneeded result variable clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe clk: Renesas versaclock7 ccf device driver dt-bindings: Renesas versaclock7 device tree bindings clk: ti: Balance of_node_get() calls for of_find_node_by_name() clk: imx: scu: fix memleak on platform_device_add() fails clk: vc5: Use regmap_{set,clear}_bits() where appropriate ... commit f01603979a4afaad7504a728918b678d572cda9e Merge: 3002b7a31894c 3c92506d86785 Author: Linus Torvalds Date: Sat Oct 8 09:46:29 2022 -0700 Merge tag 'gpio-updates-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have a single new driver, support for a bunch of new models, improvements in drivers and core gpiolib code as well device-tree bindings changes. Summary: New driver: - IMX System Controller Unit GPIOs GPIO core: - add fdinfo output for the GPIO character device file descriptors (allows user-space to determine which processes own which GPIO lines) - improvements to OF GPIO code - new quirk for Asus UM325UAZ in gpiolib-acpi - new quirk for Freescale SPI in gpiolib-of Driver improvements: - add a new macro that reduces the amount of boilerplate code in ISA drivers and use it in relevant drivers - support two new models in gpio-pca953x - support new model in gpio-f7188x - convert more drivers to use immutable irq chips - other minor tweaks Device-tree bindings: - add DT bindings for gpio-imx-scu - convert Xilinx GPIO bindings to YAML - reference the properties from the SPI peripheral device-tree bindings instead of providing custom ones in the GPIO controller document - add parsing of GPIO hog nodes to the DT bindings for gpio-mpfs-gpio - relax the node name requirements in gpio-stmpe - add new models for gpio-rcar and gpio-pxa95xx - add a new vendor prefix: Diodes (for Diodes, Inc.) Misc: - pulled in the immutable branch from the x86 platform drivers tree including support for a new simatic board that depends on GPIO changes" * tag 'gpio-updates-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (36 commits) gpio: tc3589x: Make irqchip immutable gpiolib: cdev: add fdinfo output for line request file descriptors gpio: twl4030: Reorder functions which allows to drop a forward declaraion gpiolib: fix OOB access in quirk callbacks gpiolib: of: factor out conversion from OF flags gpiolib: rework quirk handling in of_find_gpio() gpiolib: of: make Freescale SPI quirk similar to all others gpiolib: of: do not ignore requested index when applying quirks gpio: ws16c48: Ensure number of irq matches number of base gpio: 104-idio-16: Ensure number of irq matches number of base gpio: 104-idi-48: Ensure number of irq matches number of base gpio: 104-dio-48e: Ensure number of irq matches number of base counter: 104-quad-8: Ensure number of irq matches number of base isa: Introduce the module_isa_driver_with_irq helper macro gpio: pca953x: Add support for PCAL6534 gpio: pca953x: Swap if statements to save later complexity gpio: pca953x: Fix pca953x_gpio_set_pull_up_down() dt-bindings: gpio: pca95xx: add entry for pcal6534 and PI4IOE5V6534Q dt-bindings: vendor-prefixes: add Diodes gpio: mt7621: Switch to use platform_get_irq() function ... commit 3002b7a31894cfa0e57080f7e0961b5fee788aa3 Merge: a09476668e301 4256e500f6192 Author: Linus Torvalds Date: Sat Oct 8 09:19:24 2022 -0700 Merge tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.1-rc1. Nothing really interesting in here at all except we deleted a driver (fwserial) as no one had been using it for a long time. Other than that, just the normal cleanups and minor fixes: - rtl8723bs driver cleanups - loads of r8188eu driver cleanups, making the driver smaller and fixing up some firmware dependency issues. - vt6655 driver cleanups. - lots of other small staging driver cleanups. All of these have been in linux-next for a while with no reported issues" * tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (266 commits) staging: rtl8192e: Rename variable Bandwidth to avoid CamelCase staging: r8188eu: remove PHY_RFConfig8188E() staging: r8188eu: remove PHY_RF6052_Config8188E() staging: r8188eu: convert ODM_ReadAndConfig_AGC_TAB_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_PHY_REG_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_RadioA_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_MAC_REG_8188E() to int staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair staging: r8188eu: Use skb_put_data() instead of skb_put/memcpy pair staging: r8188eu: remove hal/odm_RegConfig8188E.c staging: r8188eu: make odm_ConfigRF_RadioA_8188E() static staging: r8188eu: make odm_ConfigMAC_8188E() static staging: r8188eu: don't check for stop/removal in the blink worker staging: r8188eu: don't check bSurpriseRemoved in SwLedOff staging: rtl8192e: Remove unused variables ForcedAMSDUMaxSize, ... staging: rtl8192e: Rename CurrentMPDU..., ForcedAMPDU... and ForcedMPDU... staging: rtl8192e: Rename SelfMimoPs, CurrentOpMode and bForcedShortGI staging: rtl8192e: Rename PeerMimoPs, IOTAction and IOTRaFunc staging: rtl8192e: Rename RxRe...WinSize, RxReorder... and RxReorderDr... staging: rtl8192e: Rename szRT2RTAggBuffer, bRegRxRe... and bCurRxReo... ... commit a09476668e3016ea4a7b0a7ebd02f44e0546c12c Merge: e8bc52cb8df80 7cd04013fbf3e Author: Linus Torvalds Date: Sat Oct 8 08:56:37 2022 -0700 Merge tag 'char-misc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc and other driver updates from Greg KH: "Here is the large set of char/misc and other small driver subsystem changes for 6.1-rc1. Loads of different things in here: - IIO driver updates, additions, and changes. Probably the largest part of the diffstat - habanalabs driver update with support for new hardware and features, the second largest part of the diff. - fpga subsystem driver updates and additions - mhi subsystem updates - Coresight driver updates - gnss subsystem updates - extcon driver updates - icc subsystem updates - fsi subsystem updates - nvmem subsystem and driver updates - misc driver updates - speakup driver additions for new features - lots of tiny driver updates and cleanups All of these have been in the linux-next tree for a while with no reported issues" * tag 'char-misc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (411 commits) w1: Split memcpy() of struct cn_msg flexible array spmi: pmic-arb: increase SPMI transaction timeout delay spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes spmi: pmic-arb: correct duplicate APID to PPID mapping logic spmi: pmic-arb: add support to dispatch interrupt based on IRQ status spmi: pmic-arb: check apid against limits before calling irq handler spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq spmi: pmic-arb: handle spurious interrupt spmi: pmic-arb: add a print in cleanup_irq drivers: spmi: Directly use ida_alloc()/free() MAINTAINERS: add TI ECAP driver info counter: ti-ecap-capture: capture driver support for ECAP Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows items dt-bindings: counter: add ti,am62-ecap-capture.yaml counter: Introduce the COUNTER_COMP_ARRAY component type counter: Consolidate Counter extension sysfs attribute creation counter: Introduce the Count capture component counter: 104-quad-8: Add Signal polarity component counter: Introduce the Signal polarity component counter: interrupt-cnt: Implement watch_validate callback ... commit 29926f1cd3535f565f200430d5b6a794543fe130 Author: Christophe Leroy Date: Thu Oct 6 07:33:17 2022 +0200 fbdev: mb862xx: Fix check of return value from irq_of_parse_and_map() NO_IRQ is used to check the return of irq_of_parse_and_map(). On some architecture NO_IRQ is 0, on other architectures it is -1. irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ. So use 0 instead of using NO_IRQ. Signed-off-by: Christophe Leroy Signed-off-by: Helge Deller commit 3b29f36efc2fc0d09a178d6d4f9e772f3ffe8591 Author: Zeng Heng Date: Wed Sep 28 23:17:10 2022 +0800 fbdev: vga16fb: Add missing MODULE_DEVICE_TABLE() entry This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Signed-off-by: Zeng Heng Signed-off-by: Helge Deller commit e82b0c3ea520609b953ace13ae8d44ba7b3cee54 Author: Ruan Jinjie Date: Thu Sep 22 09:37:09 2022 +0800 fbdev: tridentfb: Fix missing pci_disable_device() in probe and remove Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() and pci_release_regions() will be called in release automatically. Signed-off-by: ruanjinjie Signed-off-by: Helge Deller commit 5610bcfe8693c02e2e4c8b31427f1bdbdecc839c Author: Hyunwoo Kim Date: Sun Sep 25 06:32:43 2022 -0700 fbdev: smscufx: Fix use-after-free in ufx_ops_open() A race condition may occur if the user physically removes the USB device while calling open() for this device node. This is a race condition between the ufx_ops_open() function and the ufx_usb_disconnect() function, which may eventually result in UAF. So, add a mutex to the ufx_ops_open() and ufx_usb_disconnect() functions to avoid race contidion of krefs. Signed-off-by: Hyunwoo Kim Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit e69dade8a4cfe49f3f3af90d966dd34b67721d26 Author: Jiasheng Jiang Date: Fri Sep 2 10:55:55 2022 +0800 fbdev: gbefb: Convert to use dev_groups The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Moreover, it can guarantee the success of creation. Therefore, it should be better to convert to use dev_groups. Signed-off-by: Jiasheng Jiang Signed-off-by: Helge Deller commit d13189badcb2d850244034eb73faeb61edce914e Author: Shang XiaoJing Date: Fri Sep 23 18:20:07 2022 +0800 fbdev: imxfb: Remove redundant dev_err() call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Signed-off-by: Helge Deller commit b0e0706007030d1eb05d25de0359725357fe5be6 Author: Zhang Qilong Date: Fri Sep 23 21:38:44 2022 +0800 fbdev: omapfb/dss: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here. Signed-off-by: Zhang Qilong Signed-off-by: Helge Deller commit 2559f17ec878adf5c54815e55cf0b72c02bb5303 Author: Jules Irenge Date: Sun Sep 18 00:44:20 2022 +0100 fbdev: uvesafb: Convert snprintf to scnprintf Coccinelle reports: WARNING: use scnprintf or sprintf Adding to that, there has also been some slow migration from snprintf to scnprintf. This article explains the rationale for this change: https: //lwn.net/Articles/69419/ Signed-off-by: Jules Irenge Signed-off-by: Helge Deller commit 851e0986d964bb75deea24011b0845d550215076 Author: Jiapeng Chong Date: Wed Sep 14 18:23:01 2022 +0800 fbdev: arkfb: Remove the unused function dac_read_reg() The function dac_read_reg() is defined in the arkfb.c file, but not called elsewhere, so delete this unused function. drivers/video/fbdev/arkfb.c:322:18: warning: unused function 'dac_read_reg'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2155 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Helge Deller commit eec5190fc0b14130ed2f67b0de43b6a302b7837f Author: Jiapeng Chong Date: Wed Sep 14 18:23:00 2022 +0800 fbdev: tridentfb: Remove the unused function shadowmode_off() The function shadowmode_off() is defined in the tridentfb.c file, but not called elsewhere, so delete this unused function. drivers/video/fbdev/tridentfb.c:1131:20: warning: unused function 'shadowmode_off'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2154 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Helge Deller commit 83434cc0ae8c344b085d0ed6104e3b91e5f02a09 Author: Jiapeng Chong Date: Wed Sep 14 18:22:59 2022 +0800 fbdev: controlfb: Remove the unused function VAR_MATCH() The function VAR_MATCH is defined in the controlfb.c file, but not called elsewhere, so delete this unused function. drivers/video/fbdev/controlfb.c:111:19: warning: unused function 'VAR_MATCH'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2153 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Helge Deller commit 59945216889518982d262d4cab099c6554f58867 Author: Colin Ian King Date: Wed Sep 7 14:50:56 2022 +0100 fbdev: udlfb: Remove redundant initialization to variable identical The variable identical is being initialized with a value that is never read. The variable is being re-assigned later on. The initialization is redundant and can be removed. Cleans up clang scan-build warning: drivers/video/fbdev/udlfb.c:373:6: warning: Value stored to 'identical' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Helge Deller commit 28148a17c988b614534f457da86893f83664ad43 Author: Jann Horn Date: Thu Oct 6 20:33:01 2022 +0200 openrisc: Fix pagewalk usage in arch_dma_{clear, set}_uncached Since commit 8782fb61cc848 ("mm: pagewalk: Fix race between unmap and page walker"), walk_page_range() on kernel ranges won't work anymore, walk_page_range_novma() must be used instead. Note: I don't have an openrisc development setup, so this is completely untested. Fixes: 8782fb61cc848 ("mm: pagewalk: Fix race between unmap and page walker") Signed-off-by: Jann Horn Signed-off-by: Stafford Horne commit 958553d13478ad0e35fa09fecad3ce73277ccaf5 Author: Steve French Date: Sun Oct 2 22:09:45 2022 -0500 smb3: fix oops in calculating shash_setkey shash was not being initialized in one place in smb3_calc_signature and smb2_calc_signature Reviewed-by: Enzo Matsumiya Acked-by: Tom Talpey Signed-off-by: Steve French commit 1f3d5477b944c8db8d73d7070ea98d8f1a8224c0 Author: Enzo Matsumiya Date: Thu Sep 29 17:36:50 2022 -0300 cifs: secmech: use shash_desc directly, remove sdesc The struct sdesc is just a wrapper around shash_desc, with exact same memory layout. Replace the hashing TFMs with shash_desc as it's what's passed to the crypto API anyway. Also remove the crypto_shash pointers as they can be accessed via shash_desc->tfm (and are actually only used in the setkey calls). Adapt cifs_{alloc,free}_hash functions to this change. Signed-off-by: Enzo Matsumiya Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 8698baa1b768fc5cd4bf73e846680a812678d029 Author: Enzo Matsumiya Date: Wed Oct 5 02:42:07 2022 -0500 smb3: rename encryption/decryption TFMs Detach the TFM name from a specific algorithm (AES-CCM) as AES-GCM is also supported, making the name misleading. s/ccmaesencrypt/enc/ s/ccmaesdecrypt/dec/ Signed-off-by: Enzo Matsumiya Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a4e430c8c8ba96be8c6ec4f2eb108bb8bcbee069 Author: Enzo Matsumiya Date: Tue Sep 20 15:10:35 2022 -0300 cifs: replace kfree() with kfree_sensitive() for sensitive data Replace kfree with kfree_sensitive, or prepend memzero_explicit() in other cases, when freeing sensitive material that could still be left in memory. Signed-off-by: Enzo Matsumiya Reported-by: kernel test robot Link: https://lore.kernel.org/r/202209201529.ec633796-oliver.sang@intel.com Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit e8bc52cb8df80c31c73c726ab58ea9746e9ff734 Merge: d3dcbe24a0fc6 fda8c908bc2d5 Author: Linus Torvalds Date: Fri Oct 7 17:04:10 2022 -0700 Merge tag 'driver-core-6.1-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 and debug printk changes for 6.1-rc1. Included in here is: - dynamic debug updates for the core and the drm subsystem. The drm changes have all been acked by the relevant maintainers - kernfs fixes for syzbot reported problems - kernfs refactors and updates for cgroup requirements - magic number cleanups and removals from the kernel tree (they were not being used and they really did not actually do anything) - other tiny cleanups All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (74 commits) docs: filesystems: sysfs: Make text and code for ->show() consistent Documentation: NBD_REQUEST_MAGIC isn't a magic number a.out: restore CMAGIC device property: Add const qualifier to device_get_match_data() parameter drm_print: add _ddebug descriptor to drm_*dbg prototypes drm_print: prefer bare printk KERN_DEBUG on generic fn drm_print: optimize drm_debug_enabled for jump-label drm-print: add drm_dbg_driver to improve namespace symmetry drm-print.h: include dyndbg header drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro drm_print: interpose drm_*dbg with forwarding macros drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers. drm_print: condense enum drm_debug_category debugfs: use DEFINE_SHOW_ATTRIBUTE to define debugfs_regset32_fops driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs() Documentation: ENI155_MAGIC isn't a magic number Documentation: NBD_REPLY_MAGIC isn't a magic number nbd: remove define-only NBD_MAGIC, previously magic number Documentation: FW_HEADER_MAGIC isn't a magic number Documentation: EEPROM_MAGIC_VALUE isn't a magic number ... commit 71491c54eafa318fdd24a1f26a1c82b28e1ac21d Author: Angus Chen Date: Fri Sep 30 08:09:15 2022 +0800 virtio_pci: don't try to use intxif pin is zero The background is that we use dpu in cloud computing,the arch is x86,80 cores. We will have a lots of virtio devices,like 512 or more. When we probe about 200 virtio_blk devices,it will fail and the stack is printed as follows: [25338.485128] virtio-pci 0000:b3:00.0: virtio_pci: leaving for legacy driver [25338.496174] genirq: Flags mismatch irq 0. 00000080 (virtio418) vs. 00015a00 (timer) [25338.503822] CPU: 20 PID: 5431 Comm: kworker/20:0 Kdump: loaded Tainted: G OE --------- - - 4.18.0-305.30.1.el8.x86_64 [25338.516403] Hardware name: Inspur NF5280M5/YZMB-00882-10E, BIOS 4.1.21 08/25/2021 [25338.523881] Workqueue: events work_for_cpu_fn [25338.528235] Call Trace: [25338.530687] dump_stack+0x5c/0x80 [25338.534000] __setup_irq.cold.53+0x7c/0xd3 [25338.538098] request_threaded_irq+0xf5/0x160 [25338.542371] vp_find_vqs+0xc7/0x190 [25338.545866] init_vq+0x17c/0x2e0 [virtio_blk] [25338.550223] ? ncpus_cmp_func+0x10/0x10 [25338.554061] virtblk_probe+0xe6/0x8a0 [virtio_blk] [25338.558846] virtio_dev_probe+0x158/0x1f0 [25338.562861] really_probe+0x255/0x4a0 [25338.566524] ? __driver_attach_async_helper+0x90/0x90 [25338.571567] driver_probe_device+0x49/0xc0 [25338.575660] bus_for_each_drv+0x79/0xc0 [25338.579499] __device_attach+0xdc/0x160 [25338.583337] bus_probe_device+0x9d/0xb0 [25338.587167] device_add+0x418/0x780 [25338.590654] register_virtio_device+0x9e/0xe0 [25338.595011] virtio_pci_probe+0xb3/0x140 [25338.598941] local_pci_probe+0x41/0x90 [25338.602689] work_for_cpu_fn+0x16/0x20 [25338.606443] process_one_work+0x1a7/0x360 [25338.610456] ? create_worker+0x1a0/0x1a0 [25338.614381] worker_thread+0x1cf/0x390 [25338.618132] ? create_worker+0x1a0/0x1a0 [25338.622051] kthread+0x116/0x130 [25338.625283] ? kthread_flush_work_fn+0x10/0x10 [25338.629731] ret_from_fork+0x1f/0x40 [25338.633395] virtio_blk: probe of virtio418 failed with error -16 The log : "genirq: Flags mismatch irq 0. 00000080 (virtio418) vs. 00015a00 (timer)" was printed because of the irq 0 is used by timer exclusive,and when vp_find_vqs call vp_find_vqs_msix and returns false twice (for whatever reason), then it will call vp_find_vqs_intx as a fallback. Because vp_dev->pci_dev->irq is zero, we request irq 0 with flag IRQF_SHARED, and get a backtrace like above. According to PCI spec about "Interrupt Pin" Register (Offset 3Dh): "The Interrupt Pin register is a read-only register that identifies the legacy interrupt Message(s) the Function uses. Valid values are 01h, 02h, 03h, and 04h that map to legacy interrupt Messages for INTA, INTB, INTC, and INTD respectively. A value of 00h indicates that the Function uses no legacy interrupt Message(s)." So if vp_dev->pci_dev->pin is zero, we should not request legacy interrupt. Signed-off-by: Angus Chen Suggested-by: Michael S. Tsirkin Message-Id: <20220930000915.548-1-angus.chen@jaguarmicro.com> Signed-off-by: Michael S. Tsirkin commit 41a2ad927aa23ef7a2cbf26a1f77fb8ee421ca30 Author: Zhu Lingshan Date: Thu Sep 29 09:45:55 2022 +0800 vDPA: conditionally read MTU and MAC in dev cfg space The spec says: mtu only exists if VIRTIO_NET_F_MTU is set The mac address field always exists (though is only valid if VIRTIO_NET_F_MAC is set) So vdpa_dev_net_config_fill() should read MTU and MAC conditionally on the feature bits. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20220929014555.112323-7-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 35b37c33eb75f532606e8d333a4eb63d4c22401b Author: Zhu Lingshan Date: Thu Sep 29 09:45:54 2022 +0800 vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill This commit fixes spars warnings: cast to restricted __le16 in function vdpa_dev_net_mq_config_fill() Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20220929014555.112323-6-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 9d97aa124cde0264587b034bc34438acc2b44ecf Author: Zhu Lingshan Date: Thu Sep 29 09:45:53 2022 +0800 vDPA: check virtio device features to detect MQ vdpa_dev_net_mq_config_fill() should checks device features for MQ than driver features. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20220929014555.112323-5-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 8a505711fa2749a43bc3208f0c75f57b6491fec4 Author: Zhu Lingshan Date: Thu Sep 29 09:45:52 2022 +0800 vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence virtio 1.2 spec says: max_virtqueue_pairs only exists if VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is set. So when reporint MQ to userspace, it should check both VIRTIO_NET_F_MQ and VIRTIO_NET_F_RSS. unused parameter struct vdpa_device *vdev is removed Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20220929014555.112323-4-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit c6dac2ecfa36a73ffec65a869f34274f08ccbd4f Author: Zhu Lingshan Date: Thu Sep 29 09:45:51 2022 +0800 vDPA: only report driver features if FEATURES_OK is set This commit reports driver features to user space only after FEATURES_OK is features negotiation is done. Signed-off-by: Zhu Lingshan Message-Id: <20220929014555.112323-3-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 228565100def593df0f26ee07d5fb810039454d5 Author: Zhu Lingshan Date: Thu Sep 29 09:45:50 2022 +0800 vDPA: allow userspace to query features of a vDPA device This commit adds a new vDPA netlink attribution VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Userspace can query features of vDPA devices through this new attr. This commit invokes vdpa_config_ops.get_config() rather than vdpa_get_config_unlocked() to read the device config spcae, so no races in vdpa_set_features_unlocked() Userspace tool iproute2 example: $ vdpa dev config show vdpa0 vdpa0: mac 00:e8:ca:11:be:05 link up link_announce false max_vq_pairs 4 mtu 1500 negotiated_features MRG_RXBUF CTRL_VQ MQ VERSION_1 ACCESS_PLATFORM dev_features MTU MAC MRG_RXBUF CTRL_VQ MQ ANY_LAYOUT VERSION_1 ACCESS_PLATFORM Signed-off-by: Zhu Lingshan Message-Id: <20220929014555.112323-2-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit d3dcbe24a0fc6373ce7e4a65acd5c785aa8e2396 Merge: 6181073dd6a7e 00988f70a0763 Author: Linus Torvalds Date: Fri Oct 7 16:48:26 2022 -0700 Merge tag 'usb-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / Thunderbolt updates from Greg KH: "Here is the big set of USB and Thunderbolt driver changes for 6.1-rc1. Nothing major in here, lots of little things with new devices supported and updates for a few drivers. Highlights include: - thunderbolt/USB4 devices supported a bit better than before, and some new ids to enable new hardware devices - USB gadget uvc updates for newer video formats and better v4l integration (the v4l portions were acked by those maintainers) - typec updates for tiny issues and more typec drivers for new chips. - xhci tiny updates for minor issues - big usb-serial ftdi_sio driver update to handle new devices better - lots of tiny dwc3 fixes and updates for the IP block that is showing up everywhere these days - dts updates for new devices being supported - other tiny janitorial and cleanups fixes for lots of different USB drivers. Full details are in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'usb-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (169 commits) usb: gadget: uvc: don't put item still in use usb: gadget: uvc: Fix argument to sizeof() in uvc_register_video() usb: host: ehci-exynos: switch to using gpiod API Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" Revert "USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"" dt-bindings: usb: Convert FOTG210 to dt schema usb: mtu3: fix failed runtime suspend in host only mode USB: omap_udc: Fix spelling mistake: "tranceiver_ctrl" -> "transceiver_ctrl" usb: typec: ucsi_ccg: Disable UCSI ALT support on Tegra usb: typec: Replace custom implementation of device_match_fwnode() usb: typec: ucsi: Don't warn on probe deferral usb: add quirks for Lenovo OneLink+ Dock MAINTAINERS: switch dwc3 to Thinh usb: idmouse: fix an uninit-value in idmouse_open USB: PHY: JZ4770: Switch to use dev_err_probe() helper usb: phy: generic: Switch to use dev_err_probe() helper usb: ulpi: use DEFINE_SHOW_ATTRIBUTE to simplify ulpi_regs usb: cdns3: remove dead code usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair usb: musb: sunxi: Switch to use dev_err_probe() helper ... commit 6181073dd6a7e5deafc60e7981bd765b6c93da8c Merge: 881eccbef5256 30963b2f75bfd Author: Linus Torvalds Date: Fri Oct 7 16:36:24 2022 -0700 Merge tag 'tty-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the big set of TTY and Serial driver updates for 6.1-rc1. Lots of cleanups in here, no real new functionality this time around, with the diffstat being that we removed more lines than we added! Included in here are: - termios unification cleanups from Al Viro, it's nice to finally get this work done - tty serial transmit cleanups in various drivers in preparation for more cleanup and unification in future releases (that work was not ready for this release) - n_gsm fixes and updates - ktermios cleanups and code reductions - dt bindings json conversions and updates for new devices - some serial driver updates for new devices - lots of other tiny cleanups and janitorial stuff. Full details in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'tty-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (102 commits) serial: cpm_uart: Don't request IRQ too early for console port tty: serial: do unlock on a common path in altera_jtaguart_console_putc() tty: serial: unify TX space reads under altera_jtaguart_tx_space() tty: serial: use FIELD_GET() in lqasc_tx_ready() tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar() tty: serial: allow pxa.c to be COMPILE_TESTed serial: stm32: Fix unused-variable warning tty: serial: atmel: Add COMMON_CLK dependency to SERIAL_ATMEL serial: 8250: Fix restoring termios speed after suspend serial: Deassert Transmit Enable on probe in driver-specific way serial: 8250_dma: Convert to use uart_xmit_advance() serial: 8250_omap: Convert to use uart_xmit_advance() MAINTAINERS: Solve warning regarding inexistent atmel-usart binding serial: stm32: Deassert Transmit Enable on ->rs485_config() serial: ar933x: Deassert Transmit Enable on ->rs485_config() tty: serial: atmel: Use FIELD_PREP/FIELD_GET tty: serial: atmel: Make the driver aware of the existence of GCLK tty: serial: atmel: Only divide Clock Divisor if the IP is USART tty: serial: atmel: Separate mode clearing between UART and USART dt-bindings: serial: atmel,at91-usart: Add gclk as a possible USART clock ... commit 881eccbef52563feb4fde0d19d375884798783f7 Merge: 33e591dee9158 503ae285944a5 Author: Linus Torvalds Date: Fri Oct 7 16:13:55 2022 -0700 Merge tag 'soundwire-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire updates from Vinod Koul: "Updates for Intel, Cadence and Qualcomm drivers: - another round of Intel driver cleanup to prepare for future code reorg which is expected in next cycle (Pierre-Louis Bossart) - bus unattach notifications processing during re-enumeration along with Cadence driver updates for this (Richard Fitzgerald) - Qualcomm driver updates to handle device0 status (Srinivas Kandagatla)" * tag 'soundwire-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (42 commits) soundwire: intel: add helper to stop bus soundwire: intel: introduce helpers to start bus soundwire: intel: introduce intel_shim_check_wake() helper soundwire: intel: simplify read ops assignment soundwire: intel: remove intel_init() wrapper soundwire: intel: move shim initialization before power up/down soundwire: intel: remove clock_stop parameter in intel_shim_init() soundwire: intel: move all PDI initialization under intel_register_dai() soundwire: intel: move DAI registration and debugfs init earlier soundwire: intel: simplify flow and use devm_ for DAI registration soundwire: intel: fix error handling on dai registration issues soundwire: cadence: Simplify error paths in cdns_xfer_msg() soundwire: cadence: Fix error check in cdns_xfer_msg() soundwire: cadence: Write to correct address for each FIFO chunk soundwire: bus: Fix wrong port number in sdw_handle_slave_alerts() soundwire: qcom: do not send status of device 0 during alert soundwire: qcom: update status from device id 1 soundwire: cadence: Don't overwrite msg->buf during write commands soundwire: bus: Don't exit early if no device IDs were programmed soundwire: cadence: Fix lost ATTACHED interrupts when enumerating ... commit 33e591dee915832c618cf68bb1058c8e7d296128 Merge: 416a2f4f91525 9aa0dade8f6b4 Author: Linus Torvalds Date: Fri Oct 7 16:03:01 2022 -0700 Merge tag 'phy-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull phy updates from Vinod Koul: "This contains bunch of new device support and one new Sunplus driver along with updates which include another big round of qmp phy conversion. New support: - Qualcomm SC8280XP eDP & DP and USB3 UNI phy (Bjorn Andersson) - Rockchip rk3568 inno dsidphy (Chris Morgan) - ocelot-serdes phy yaml binding (Colin Foster) - Renesas gen2-usb phy yaml binding (Geert Uytterhoeven) - RGMII suport in lan966x driver (Horatiu Vultur) - Qualcomm SM6375 usb snps-femto-v2 bindings (Konrad Dybcio) - Rockchip rk356x csi-dphya (Michael Riesch) - Qualcomm sdm670 usb2 bindings (Richard Acayan) - Sunplus USB2 PHY (Vincent Shih) Updates: - Mediatek hdmi, ufs, tphy and xsphy updates to use bitfield helpers (Chunfeng Yun) - Continued Qualcomm qmp phy driver split and cleanup. More patches are under review and expected that next cycle might see completion of this activity (Dmitry Baryshkov & Johan Hovold) - TI wiz driver support for j7200 10g (Roger Quadros) - Qualcomm femto phy driver support for override params to help with tuning (Sandeep Maheswaram) - SGMII support in TI wiz driver (Siddharth Vadapalli) - dev_err_probe simplification (Yuan Can)" * tag 'phy-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (170 commits) phy: phy-mtk-dp: make array driving_params static const dt-bindings: phy: qcom,qusb2: document sdm670 compatible phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY phy: rockchip-snps-pcie3: only look for rockchip,pipe-grf on rk3588 phy: tegra: xusb: Enable usb role switch attribute phy: mediatek: fix build warning of FIELD_PREP() phy: qcom-qmp-usb: Use dev_err_probe() to simplify code phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code phy: qcom-qmp-combo: Use dev_err_probe() to simplify code phy: qualcomm: call clk_disable_unprepare in the error handling phy: intel: Use dev_err_probe() to simplify code phy: tegra: xusb: Use dev_err_probe() to simplify code phy: qcom-snps: Use dev_err_probe() to simplify code phy: qcom-qusb2: Use dev_err_probe() to simplify code phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe() phy: mediatek: mipi: remove register access helpers phy: mediatek: mipi: mt8183: use common helper to access registers phy: mediatek: mipi: mt8183: use GENMASK to generate bits mask ... commit 416a2f4f91525fcdec821320bc4608cf012d418e Merge: 62e6e5940c0c0 b957df9846924 Author: Linus Torvalds Date: Fri Oct 7 15:56:34 2022 -0700 Merge tag 'dmaengine-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "New Support: - MT6795 SoC dma controller (AngeloGioacchino Del Regno) - qcom-adm controller yaml binding (Christian Marangi) - Renesas r8a779g0 dma controller yaml binding (Geert Uytterhoeven) - Qualcomm SM6350 GPI dma controller (Luca Weiss) Updates: - STM32 DMA-MDMA chaining support (Amelie Delaunay) - make hsu driver use managed resources (Andy Shevchenko) - the usual round of idxd driver updates (Dave Jiang & Jerry Snitselaar) - apple dma driver iommu and pd properties and remove use of devres for irqs (Janne Grunau & Martin Povišer) - device_synchronize support for Xilinx zynqmp driver (Swati Agarwal)" * tag 'dmaengine-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (60 commits) dmaengine: ioat: remove unused declarations in dma.h dmaengine: ti: k3-udma: Respond TX done if DMA_PREP_INTERRUPT is not requested dmaengine: zynqmp_dma: Add device_synchronize support dt-bindings: dma: add additional pbus reset to qcom,adm dt-bindings: dma: rework qcom,adm Documentation to yaml schema dt-bindings: dma: apple,admac: Add iommus and power-domains properties dmaengine: dw-edma: Remove runtime PM support dmaengine: idxd: add configuration for concurrent batch descriptor processing dmaengine: idxd: add configuration for concurrent work descriptor processing dmaengine: idxd: add WQ operation cap restriction support dmanegine: idxd: reformat opcap output to match bitmap_parse() input dmaengine: idxd: convert ats_dis to a wq flag dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() dmaengine: qcom-adm: fix wrong calling convention for prep_slave_sg dmaengine: qcom-adm: fix wrong sizeof config in slave_config dmaengine: ti: k3-psil: add additional TX threads for j721e dmaengine: ti: k3-psil: add additional TX threads for j7200 dmaengine: apple-admac: Trigger shared reset dmaengine: apple-admac: Do not use devres for IRQs dmaengine: ti: edma: Remove some unused functions ... commit bbff39cc6cbcb86ccfacb2dcafc79912a9f9df69 Author: Mike Kravetz Date: Tue Oct 4 18:17:07 2022 -0700 hugetlb: allocate vma lock for all sharable vmas The hugetlb vma lock was originally designed to synchronize pmd sharing. As such, it was only necessary to allocate the lock for vmas that were capable of pmd sharing. Later in the development cycle, it was discovered that it could also be used to simplify fault/truncation races as described in [1]. However, a subsequent change to allocate the lock for all vmas that use the page cache was never made. A fault/truncation race could leave pages in a file past i_size until the file is removed. Remove the previous restriction and allocate lock for all VM_MAYSHARE vmas. Warn in the unlikely event of allocation failure. [1] https://lore.kernel.org/lkml/Yxiv0SkMkZ0JWGGp@monkey/#t Link: https://lkml.kernel.org/r/20221005011707.514612-4-mike.kravetz@oracle.com Fixes: "hugetlb: clean up code checking for fault/truncation races" Signed-off-by: Mike Kravetz Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit ecfbd733878da48ed03a5b8a9c301366a03e3cca Author: Mike Kravetz Date: Tue Oct 4 18:17:06 2022 -0700 hugetlb: take hugetlb vma_lock when clearing vma_lock->vma pointer hugetlb file truncation/hole punch code may need to back out and take locks in order in the routine hugetlb_unmap_file_folio(). This code could race with vma freeing as pointed out in [1] and result in accessing a stale vma pointer. To address this, take the vma_lock when clearing the vma_lock->vma pointer. [1] https://lore.kernel.org/linux-mm/01f10195-7088-4462-6def-909549c75ef4@huawei.com/ [mike.kravetz@oracle.com: address build issues] Link: https://lkml.kernel.org/r/Yz5L1uxQYR1VqFtJ@monkey Link: https://lkml.kernel.org/r/20221005011707.514612-3-mike.kravetz@oracle.com Fixes: "hugetlb: use new vma_lock for pmd sharing synchronization" Signed-off-by: Mike Kravetz Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 131a79b474e973f023c5c75e2323a940332103be Author: Mike Kravetz Date: Tue Oct 4 18:17:05 2022 -0700 hugetlb: fix vma lock handling during split vma and range unmapping Patch series "hugetlb: fixes for new vma lock series". In review of the series "hugetlb: Use new vma lock for huge pmd sharing synchronization", Miaohe Lin pointed out two key issues: 1) There is a race in the routine hugetlb_unmap_file_folio when locks are dropped and reacquired in the correct order [1]. 2) With the switch to using vma lock for fault/truncate synchronization, we need to make sure lock exists for all VM_MAYSHARE vmas, not just vmas capable of pmd sharing. These two issues are addressed here. In addition, having a vma lock present in all VM_MAYSHARE vmas, uncovered some issues around vma splitting. Those are also addressed. [1] https://lore.kernel.org/linux-mm/01f10195-7088-4462-6def-909549c75ef4@huawei.com/ This patch (of 3): The hugetlb vma lock hangs off the vm_private_data field and is specific to the vma. When vm_area_dup() is called as part of vma splitting, the vma lock pointer is copied to the new vma. This will result in issues such as double freeing of the structure. Update the hugetlb open vm_ops to allocate a new vma lock for the new vma. The routine __unmap_hugepage_range_final unconditionally unset VM_MAYSHARE to prevent subsequent pmd sharing. hugetlb_vma_lock_free attempted to anticipate this by checking both VM_MAYSHARE and VM_SHARED. However, if only VM_MAYSHARE was set we would miss the free. With the introduction of the vma lock, a vma can not participate in pmd sharing if vm_private_data is NULL. Instead of clearing VM_MAYSHARE in __unmap_hugepage_range_final, free the vma lock to prevent sharing. Also, update the sharing code to make sure vma lock is indeed a condition for pmd sharing. hugetlb_vma_lock_free can then key off VM_MAYSHARE and not miss any vmas. Link: https://lkml.kernel.org/r/20221005011707.514612-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20221005011707.514612-2-mike.kravetz@oracle.com Fixes: "hugetlb: add vma based lock for pmd sharing" Signed-off-by: Mike Kravetz Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit e4fea72b143848d8bbbeae6d39a890212bcf848e Author: Yu Zhao Date: Wed Sep 28 12:46:20 2022 -0600 mglru: mm/vmscan.c: fix imprecise comments Link: https://lkml.kernel.org/r/YzSWfFI+MOeb1ils@google.com Signed-off-by: Yu Zhao Signed-off-by: Andrew Morton commit 14aa8b2d5c2ebead01b542f62d68029023054774 Author: Yu Zhao Date: Wed Sep 28 13:36:58 2022 -0600 mm/mglru: don't sync disk for each aging cycle wakeup_flusher_threads() was added under the assumption that if a system runs out of clean cold pages, it might want to write back dirty pages more aggressively so that they can become clean and be dropped. However, doing so can breach the rate limit a system wants to impose on writeback, resulting in early SSD wearout. Link: https://lkml.kernel.org/r/YzSiWq9UEER5LKup@google.com Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks") Signed-off-by: Yu Zhao Reported-by: Axel Rasmussen Signed-off-by: Andrew Morton commit b4dac1203f39821c6119033cdeebcea83cf45786 Author: Chao Yu Date: Tue Oct 4 09:41:02 2022 +0800 f2fs: change to use atomic_t type form sbi.atomic_files inode_lock[ATOMIC_FILE] was used for protecting sbi->atomic_files, update atomic_files variable's type to atomic_t instead of unsigned int, then inode_lock[ATOMIC_FILE] can be obsoleted. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8ec071c363da3f45585b338b2037de289379939c Author: Chao Yu Date: Tue Oct 4 09:11:33 2022 +0800 f2fs: account swapfile inodes In order to check count of opened swapfile inodes. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 62e6e5940c0c09433efa52d0fa9a11623a4704b2 Merge: e08466a7c0073 57569c37f0add Author: Linus Torvalds Date: Fri Oct 7 12:33:18 2022 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "Updates to the usual drivers (qla2xxx, lpfc, ufs, hisi_sas, mpi3mr, mpt3sas, target). The biggest change (from my biased viewpoint) being that the mpi3mr now attached to the SAS transport class, making it the first fusion type device to do so. Beyond the usual bug fixing and security class reworks, there aren't a huge number of core changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (141 commits) scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername() scsi: mpi3mr: Remove unnecessary cast scsi: stex: Properly zero out the passthrough command structure scsi: mpi3mr: Update driver version to 8.2.0.3.0 scsi: mpi3mr: Fix scheduling while atomic type bug scsi: mpi3mr: Scan the devices during resume time scsi: mpi3mr: Free enclosure objects during driver unload scsi: mpi3mr: Handle 0xF003 Fault Code scsi: mpi3mr: Graceful handling of surprise removal of PCIe HBA scsi: mpi3mr: Schedule IRQ kthreads only on non-RT kernels scsi: mpi3mr: Support new power management framework scsi: mpi3mr: Update mpi3 header files scsi: mpt3sas: Revert "scsi: mpt3sas: Fix ioc->base_readl() use" scsi: mpt3sas: Revert "scsi: mpt3sas: Fix writel() use" scsi: wd33c93: Remove dead code related to the long-gone config WD33C93_PIO scsi: core: Add I/O timeout count for SCSI device scsi: qedf: Populate sysfs attributes for vport scsi: pm8001: Replace one-element array with flexible-array member scsi: 3w-xxxx: Replace one-element array with flexible-array member scsi: hptiop: Replace one-element array with flexible-array member in struct hpt_iop_request_ioctl_command() ... commit b1b8132a651cf6a5b18a01d8f1bd304f5d210315 Author: Alex Williamson Date: Fri Oct 7 12:03:00 2022 -0600 vfio: More vfio_file_is_group() use cases Replace further open coded tests with helper. Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/166516896843.1215571.5378890510536477434.stgit@omen Signed-off-by: Alex Williamson commit e08466a7c00733a501d3c5328d29ec974478d717 Merge: 1227db9eab18f 33331a728c83f Author: Linus Torvalds Date: Fri Oct 7 12:05:29 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "Not a big list of changes this cycle, mostly small things. The new MANA rdma driver should come next cycle along with a bunch of work on rxe. Summary: - Small bug fixes in mlx5, efa, rxe, hns, irdma, erdma, siw - rts tracing improvements - Code improvements: strlscpy conversion, unused parameter, spelling mistakes, unused variables, flex arrays - restrack device details report for hns - Simplify struct device initialization in SRP - Eliminate the never-used service_mask support in IB CM - Make rxe not print to the console for some kinds of network packets - Asymetric paths and router support in the CM through netlink messages - DMABUF importer support for mlx5devx umem's" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (84 commits) RDMA/rxe: Remove error/warning messages from packet receiver path RDMA/usnic: fix set-but-not-unused variable 'flags' warning IB/hfi1: Use skb_put_data() instead of skb_put/memcpy pair RDMA/hns: Unified Log Printing Style RDMA/hns: Replacing magic number with macros in apply_func_caps() RDMA/hns: Repacing 'dseg_len' by macros in fill_ext_sge_inl_data() RDMA/hns: Remove redundant 'max_srq_desc_sz' in caps RDMA/hns: Remove redundant 'num_mtt_segs' and 'max_extend_sg' RDMA/hns: Remove redundant 'phy_addr' in hns_roce_hem_list_find_mtt() RDMA/hns: Remove redundant 'use_lowmem' argument from hns_roce_init_hem_table() RDMA/hns: Remove redundant 'bt_level' for hem_list_alloc_item() RDMA/hns: Remove redundant 'attr_mask' in modify_qp_init_to_init() RDMA/hns: Remove unnecessary brackets when getting point RDMA/hns: Remove unnecessary braces for single statement blocks RDMA/hns: Cleanup for a spelling error of Asynchronous IB/rdmavt: Add __init/__exit annotations to module init/exit funcs RDMA/rxe: Remove redundant num_sge fields RDMA/mlx5: Enable ATS support for MRs and umems RDMA/mlx5: Add support for dmabuf to devx umem RDMA/core: Add UVERBS_ATTR_RAW_FD ... commit 1227db9eab18f1ebaac990223d3f18eaddf1b442 Merge: 94e8ca6ebd1bc 63c30d7044306 Author: Linus Torvalds Date: Fri Oct 7 11:59:11 2022 -0700 Merge tag 'mtd/for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD updates from Miquel Raynal: "Core MTD changes: - mtdchar: add MEMREAD ioctl - Add ECC error accounting for each read request - always initialize 'stats' in struct mtd_oob_ops - Track maximum number of bitflips for each read request - Fix repeated word in comment - Move from strlcpy with unused retval to strscpy - Fix a typo in a comment - Add binding for U-Boot bootloader partitions MTD device drivers changes: - FTL: use container_of() rather than cast - docg3: - Use correct function names in comment blocks - Check the return value of devm_ioremap() in the probe - physmap-core: Fix NULL pointer dereferencing in of_select_probe_type() - parsers: add Broadcom's U-Boot parser Raw NAND core changes: - Replace of_gpio_named_count() by gpiod_count() - Remove misguided comment of nand_get_device() - bbt: Use the bitmap API to allocate bitmaps Raw NAND controller drivers changes: - Meson: - Stop supporting legacy clocks - Refine resource getting in probe - Convert bindings to yaml - Fix clock handling and update the bindings accordingly - Fix bit map use in meson_nfc_ecc_correct() - bcm47xx: - Fix spelling typo in comment - STM32 FMC2: - Switch to using devm_fwnode_gpiod_get() - Fix dma_map_sg error check - Cadence: - Remove an unneeded result variable - Marvell: - Fix error handle regarding dma_map_sg - Orion: - Use devm_clk_get_optional() - Cafe: - Use correct function name in comment block - Atmel: - Unmap streaming DMA mappings - Arasan: - Stop using 0 as NULL pointer - GPMI: - Fix typo 'the the' in comment - BRCM: - Add individual glue driver selection - Move Kconfig to driver folder - FSL: Fix none ECC mode - Intel: - Use devm_platform_ioremap_resource_byname() - Remove unused clk_rate member from struct ebu_nand - Remove unused nand_pa member from ebu_nand_cs - Don't re-define NAND_DATA_IFACE_CHECK_ONLY - Remove undocumented compatible string - Fix compatible string in the bindings - Read the chip-select line from the correct OF node - Fix maximum chip select value in the bindings" * tag 'mtd/for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (43 commits) mtd: rawnand: meson: stop supporting legacy clocks dt-bindings: nand: meson: convert txt to yaml mtd: rawnand: meson: refine resource getting in probe mtd: rawnand: meson: fix the clock dt-bindings: nand: meson: fix meson nfc clock mtd: rawnand: bcm47xx: fix spelling typo in comment mtd: rawnand: stm32_fmc2: switch to using devm_fwnode_gpiod_get() mtd: rawnand: cadence: Remove an unneeded result variable mtd: rawnand: Replace of_gpio_named_count() by gpiod_count() mtd: rawnand: marvell: Fix error handle regarding dma_map_sg mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check mtd: rawnand: remove misguided comment of nand_get_device() mtd: rawnand: orion: Use devm_clk_get_optional() mtd: rawnand: cafe: Use correct function name in comment block mtd: rawnand: atmel: Unmap streaming DMA mappings mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct() mtd: rawnand: arasan: stop using 0 as NULL pointer mtd: rawnand: gpmi: Fix typo 'the the' in comment mtd: rawnand: brcmnand: Add individual glue driver selection mtd: rawnand: brcmnand: Move Kconfig to driver folder ... commit 94e8ca6ebd1bc20a193eb552dee4de884a954938 Merge: e5df1d3ebed25 ccf22a48cc878 Author: Linus Torvalds Date: Fri Oct 7 11:53:53 2022 -0700 Merge tag 'rproc-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "Support for remoteprocs that will perform recovery without help from Linux is introduced. The virtio integration is transitioned towards remoteproc_virtio.c and represented by a platform_device, in preparation for instantiating virtio instances from DeviceTree. The iMX remoteproc driver has a couple of sparse warnings corrected and a couple of error message printouts are cleaned up. The keystone driver is transitioned to use the gpiod API" * tag 'rproc-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: remoteproc: virtio: Fix warning on bindings by removing the of_match_table remoteproc: Support attach recovery after rproc crash remoteproc: Introduce rproc features remoteproc: virtio: Create platform device for the remoteproc_virtio remoteproc: Move rproc_vdev management to remoteproc_virtio.c remoteproc: core: Introduce rproc_add_rvdev function remoteproc: core: Introduce rproc_rvdev_add_device function remoteproc: Harden rproc_handle_vdev() against integer overflow remoteproc/keystone: Switch to using gpiod API drivers/remoteproc: Fix repeated words in comments remoteproc: imx_dsp_rproc: fix argument 2 of rproc_mem_entry_init remoteproc: imx_rproc: Simplify some error message commit e5df1d3ebed2568caf45564946b4a60aa75f0277 Merge: 11c747e5a1f90 467233a4ac29b Author: Linus Torvalds Date: Fri Oct 7 11:51:14 2022 -0700 Merge tag 'rpmsg-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "This fixes a double free/destroy and drops an unnecessary local variable in the rpmsg char driver" * tag 'rpmsg-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: char: Avoid double destroy of default endpoint rpmsg: char: Remove the unneeded result variable commit 11c747e5a1f908e9e3a868461ba9992e5396402a Merge: 83da5ec6b7fcc 189a2aaef9cbe Author: Linus Torvalds Date: Fri Oct 7 11:48:30 2022 -0700 Merge tag 'for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - new maintenance charging documentation - mt6370: new charger driver - bq25890: support input current limit - added Qualcomm PMK8350 PON support - misc minor fixes * tag 'for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (22 commits) power: supply: ab8500: remove unused static local variable power: supply: mt6370: Fix return value check in mt6370_chg_probe() power: supply: ab8500: Remove unused struct ab8500_chargalg_sysfs_entry power: supply: mt6370: uses IIO interfaces, depends on IIO power: supply: max1721x: Fix spelling mistake "Gauage" -> "Gauge" power: supply: mt6370: Add MediaTek MT6370 charger driver dt-bindings: power: supply: Add MediaTek MT6370 Charger lib: add linear range index macro power: supply: bq25890: Fix enum conversion in bq25890_power_supply_set_property() power: supply: bq27xxx: fix NULL vs 0 warnings power: supply: bq27xxx: fix __be16 warnings power: supply: bq25890: Add support for setting IINLIM power: supply: bq25890: Disable PUMPX_EN on errors power: supply: Fix repeated word in comments power: supply: adp5061: show unknown capacity_level as text power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type() power: supply: tps65217: Fix comments typo power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string dt-bindings: power: reset: qcom-pon: Add new compatible "qcom,pmk8350-pon" power: supply: cw2015: Use device managed API to simplify the code ... commit 83da5ec6b7fccd37547477effa6a4b1162c1acf1 Merge: 3fb55dd14036b 811908159e7ee Author: Linus Torvalds Date: Fri Oct 7 11:46:18 2022 -0700 Merge tag 'hsi-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi Pull HSI updates from Sebastian Reichel: - completely switch to gpiod API - misc small fixes * tag 'hsi-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: HSI: nokia-modem: Replace of_gpio_count() by gpiod_count() HSI: ssi_protocol: fix potential resource leak in ssip_pn_open() HSI: omap_ssi_port: Fix dma_map_sg error check HSI: cmt_speech: Pass a pointer to virt_to_page() HSI: omap_ssi: Fix refcount leak in ssi_probe HSI: clients: remove duplicate assignment commit 3fb55dd14036b875b96c39d6e18fc53feb891891 Merge: ae9559594cb85 4709f9ea338d3 Author: Linus Torvalds Date: Fri Oct 7 11:32:10 2022 -0700 Merge tag 'pwm/for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "The Rockchip and Mediatek drivers gain support for more chips and the LPSS driver undergoes some refactoring and receives some improvements. Other than that there are various cleanups of the core" * tag 'pwm/for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: sysfs: Replace sprintf() with sysfs_emit() pwm: core: Replace custom implementation of device_match_fwnode() pwm: lpss: Add a comment to the bypass field pwm: lpss: Make use of bits.h macros for all masks pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros pwm: lpss: Use device_get_match_data() to get device data pwm: lpss: Move resource mapping to the glue drivers pwm: lpss: Move exported symbols to PWM_LPSS namespace pwm: lpss: Deduplicate board info data structures dt-bindings: pwm: Add compatible for Mediatek MT8188 dt-bindings: pwm: rockchip: Add rockchip,rk3128-pwm dt-bindings: pwm: rockchip: Add description for rk3588 pwm: sysfs: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() pwm: rockchip: Convert to use dev_err_probe() commit d7cce96c449e35bbfd41e830b341b95973891eed Author: Pavel Begunkov Date: Tue Sep 27 01:13:30 2022 +0100 io_uring: limit registration w/ SINGLE_ISSUER IORING_SETUP_SINGLE_ISSUER restricts what tasks can submit requests. Extend it to registration as well, so non-owning task can't do registrations. It's not necessary at the moment but might be useful in the future. Cc: # 6.0 Fixes: 97bbdc06a444 ("io_uring: add IORING_SETUP_SINGLE_ISSUER") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f52a6a9c8a8990d4a831f73c0571e7406aac2bba.1664237592.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4add705e4eebbdd919741de0548d7029c8c92b68 Author: Dylan Yudaken Date: Mon Sep 26 10:09:27 2022 -0700 io_uring: remove io_register_submitter this is no longer needed, as submitter_task is set at creation time. Signed-off-by: Dylan Yudaken Fixes: 97bbdc06a444 ("io_uring: add IORING_SETUP_SINGLE_ISSUER") Signed-off-by: Jens Axboe commit 97c96e9fa36616d7890a6f3438172fc501927f01 Author: Dylan Yudaken Date: Mon Sep 26 10:09:26 2022 -0700 io_uring: simplify __io_uring_add_tctx_node Remove submitter parameter from __io_uring_add_tctx_node. It was only called from one place, and we can do that logic in that one place. Signed-off-by: Dylan Yudaken Fixes: 97bbdc06a444 ("io_uring: add IORING_SETUP_SINGLE_ISSUER") Signed-off-by: Jens Axboe commit ae9559594cb851aff774d5bea243b84c6acf761d Merge: 79d11de9637a3 72a95859728a7 Author: Linus Torvalds Date: Fri Oct 7 11:24:20 2022 -0700 Merge tag 'mfd-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Fix 'mfd_of_node_list' OF node entry resource leak New Drivers: - Add support for Ocelot VSC7512 Networking Chip - Add support for MediaTek MT6370 subPMIC - Add support for Richtek RT5120 (I2C) PMIC New Device Support: - Add support for Rockchip RV1126 and RK3588 to Syscon - Add support for Rockchip RK817 Battery Charger to RK808 - Add support for Silergy SY7636a Voltage Regulator to Simple MFD - Add support for Qualcomm PMP8074 PMIC to QCOM SPMI - Add support for Secure Update to Intel M10 BMC New Functionality: - Provide SSP type to Intel's LPSS (PCI) SPI driver Fix-ups: - Remove legacy / unused code; stmpe, intel_soc_pmic_crc, syscon - Unify / simplify; intel_soc_pmic_crc - Trivial reordering / spelling, etc; Makefile, twl-core - Convert to managed resources; intel_soc_pmic_crc - Use appropriate APIs; intel_soc_pmic_crc - strscpy() conversion; htc-i2cpld, lpc_ich, mfd-core - GPIOD conversion; htc-i2cpld, stmpe - Add missing header file includes; twl4030-irq - DT goodies; stmpe, mediatek,mt6370, x-powers,axp152, aspeed,ast2x00-scu, mediatek,mt8195-scpsys, qcom,spmi-pmic, syscon, qcom,tcsr, rockchip,rk817, sprd,ums512-glbreg, dlg,da9063 Bug Fixes: - Properly check return values; sm501, htc-i2cpld - Repair Two-Wire Bus Mode; da9062-core - Fix error handling; intel_soc_pmic_core, fsl-imx25-tsadc, lp8788, lp8788-irq" * tag 'mfd-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (60 commits) mfd: syscon: Remove repetition of the regmap_get_val_endian() mfd: ocelot-spi: Add missing MODULE_DEVICE_TABLE power: supply: Add charger driver for Rockchip RK817 dt-bindings: mfd: mt6370: Fix the indentation in the example mfd: da9061: Fix Failed to set Two-Wire Bus Mode. mfd: htc-i2cpld: Fix an IS_ERR() vs NULL bug in htcpld_core_probe() dt-bindings: mfd: qcom,tcsr: Drop simple-mfd from IPQ6018 mfd: sm501: Add check for platform_driver_register() dt-bindings: mfd: mediatek: Add scpsys compatible for mt8186 mfd: twl4030: Add missed linux/device.h header dt-bindings: mfd: dlg,da9063: Add missing regulator patterns dt-bindings: mfd: sprd: Add bindings for ums512 global registers mfd: intel_soc_pmic_chtdc_ti: Switch from __maybe_unused to pm_sleep_ptr() etc dt-bindings: mfd: syscon: Add rk3588 QoS register compatible mfd: stmpe: Switch to using gpiod API mfd: qcom-spmi-pmic: Add pm7250b compatible dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver mfd: intel-m10-bmc: Add d5005 bmc secure update driver dt-bindings: mfd: syscon: Drop ref from reg-io-width ... commit 79d11de9637a37035b4a72ccb528b3dfebc1bf67 Merge: 5d435a3f7b6cb cb7c02e91c31f Author: Linus Torvalds Date: Fri Oct 7 11:13:42 2022 -0700 Merge tag 'for-linus-2022100501' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Benjamin Tissoires: - handle of all Logitech Bluetooth HID++ devices in the Logitech HID++ drivers (Bastien Nocera) - fix broken atomic checks in hid-multitouch by adding memory barriers (Andri Yngvason) - better handling of devices with AMD SFH1.1 (Basavaraj Natikar) - better support of Nintendo clone controllers (Icenowy Zheng and Johnothan King) - Support for various RC controllers (Marcus Folkesson) - Add UGEEv2 support in hid-uclogic (XP-PEN Deco Pro S and Parblo A610 PRO) (José Expósito) - some conversions to use dev_groups (Greg Kroah-Hartman) - HID-BPF preparatory patches, mostly to convert blank defines as enums (Benjamin Tissoires) * tag 'for-linus-2022100501' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (38 commits) HID: wacom: add three styli to wacom_intuos_get_tool_type HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 HID: amd_sfh: Change dev_err to dev_dbg for additional debug info HID: nintendo: check analog user calibration for plausibility HID: nintendo: deregister home LED when it fails HID: roccat: Fix use-after-free in roccat_read() hid: topre: Add driver fixing report descriptor HID: multitouch: Add memory barriers HID: convert defines of HID class requests into a proper enum HID: export hid_report_type to uapi HID: core: store the unique system identifier in hid_device HID: Add driver for PhoenixRC Flight Controller HID: Add driver for VRC-2 Car Controller HID: sony: Fix double word in comments hid: hid-logitech-hidpp: avoid unnecessary assignments in hidpp_connect_event HID: logitech-hidpp: Detect hi-res scrolling support HID: logitech-hidpp: Remove hard-coded "Sw. Id." for HID++ 2.0 commands HID: logitech-hidpp: Fix "Sw. Id." for HID++ 2.0 commands HID: logitech-hidpp: Remove special-casing of Bluetooth devices HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices ... commit 5d435a3f7b6cb1db566d0f56f5f8dc33be0dde69 Merge: 4078aa6850974 fbb6c848dd897 Author: Linus Torvalds Date: Fri Oct 7 11:04:35 2022 -0700 Merge tag 'media/v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - New driver for Mediatek MDP V3 - New driver for NXP i.MX DW100 dewarper - Zoran driver got promoted from staging - Hantro and related drivers got promoted from staging - Several VB1 drivers got moved to staging/deprecated (cpia2, fsl-viu, meye, saa7146, av7110, stkwebcam, tm6000, vpfe_capture, davinci, zr364xx) - Usual set of driver fixes, improvements and cleanups * tag 'media/v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (107 commits) media: destage Hantro VPU driver media: platform: mtk-mdp3: add MediaTek MDP3 driver media: dt-binding: mediatek: add bindings for MediaTek CCORR and WDMA media: dt-binding: mediatek: add bindings for MediaTek MDP3 components media: xilinx: vipp: Fix refcount leak in xvip_graph_dma_init media: xilinx: video: Add 1X12 greyscale format media: xilinx: csi2rxss: Add 1X12 greyscale format media: staging: media: imx: imx7-media-csi: Increase video mem limit media: uvcvideo: Limit power line control for Sonix Technology media: uvcvideo: Use entity get_cur in uvc_ctrl_set media: uvcvideo: Fix typo 'the the' in comment media: uvcvideo: Use indexed loops in uvc_ctrl_init_ctrl() media: uvcvideo: Fix memory leak in uvc_gpio_parse media: renesas: vsp1: Add support for RZ/G2L VSPD media: renesas: vsp1: Add VSP1_HAS_NON_ZERO_LBA feature bit media: renesas: vsp1: Add support for VSP software version media: renesas: vsp1: Add support to deassert/assert reset line media: dt-bindings: media: renesas,vsp1: Document RZ/G2L VSPD bindings media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() media: amphion: fix a bug that vpu core may not resume after suspend ... commit 4078aa68509746d0c1a70c50ab22a761ad7c2e0d Merge: 9d84bb40bcb30 71d7b6e51ad33 Author: Linus Torvalds Date: Fri Oct 7 10:48:49 2022 -0700 Merge tag 'ata-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata updates from Damien Le Moal: - Print the timeout value for internal command failures due to a timeout (from Tomas) - Improve parameter names in ata_dev_set_feature() to clarify this function use (from Niklas) - Improve the ahci driver low power mode setting initialization to allow more flexibility for the user (from Rafael) - Several patches to remove redundant variables in libata-core, libata-eh and the pata_macio driver and to fix typos in comments (from Jinpeng, Shaomin, Ye) - Some code simplifications and macro renaming (for clarity) in various functions of libata-core (from me) - Add a missing check for a potential failure of sata_scr_read() in sata_print_link_status() (from Li) - Cleanup of libata Kconfig PATA_PLATFORM and PATA_OF_PLATFORM options (from Lukas) - Cleanups of ata dt-bindings and improvements of libahci_platform, ahci and libahci code (from Serge) - New driver for Synopsys AHCI SATA controllers, based of the generic ahci code (from Serge). One compilation warning fix is added for this driver (from me) - Several fixes to macros used to discover a drive capabilities to be consistent with the ACS specifications (from Niklas) - A couple of simplifcations to some libata functions, removing unnecessary arguments (from Niklas) - An improvements to libata-eh code to avoid unnecessary link reset when revalidating a drive after a failed command. In practice, this extra, unneeded reset, reset does not cause any arm beyond slightly slowing down error recovery (from Niklas) * tag 'ata-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (45 commits) ata: libata-eh: avoid needless hard reset when revalidating link ata: libata: drop superfluous ata_eh_analyze_tf() parameter ata: libata: drop superfluous ata_eh_request_sense() parameter ata: fix ata_id_has_dipm() ata: fix ata_id_has_ncq_autosense() ata: fix ata_id_has_devslp() ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() ata: libata-eh: Remove the unneeded result variable ata: ahci_st: Enable compile test ata: ahci_st: Fix compilation warning MAINTAINERS: Add maintainers for DWC AHCI SATA driver ata: ahci-dwc: Add Baikal-T1 AHCI SATA interface support ata: ahci-dwc: Add platform-specific quirks support dt-bindings: ata: ahci: Add Baikal-T1 AHCI SATA controller DT schema ata: ahci: Add DWC AHCI SATA controller support ata: libahci_platform: Add function returning a clock-handle by id dt-bindings: ata: ahci: Add DWC AHCI SATA controller DT schema ata: ahci: Introduce firmware-specific caps initialization ata: ahci: Convert __ahci_port_base to accepting hpriv as arguments ata: libahci: Don't read AHCI version twice in the save-config method ... commit 9d84bb40bcb30a7fa16f33baa967aeb9953dda78 Merge: 7c989b1da3946 bafaf67c42f4b Author: Linus Torvalds Date: Fri Oct 7 09:47:47 2022 -0700 Merge tag 'drm-next-2022-10-07-1' of git://anongit.freedesktop.org/drm/drm Pull drm fix from Dave Airlie: "This reverts the patch I found with rough bisection to instability around fences and the oops I got from netconsole. sched: - revert patch causing oopses" * tag 'drm-next-2022-10-07-1' of git://anongit.freedesktop.org/drm/drm: Revert "drm/sched: Use parent fence instead of finished" commit 7c989b1da3946e40bf71be00a0b401015235605a Merge: 513389809e138 0e0abad2a71bc Author: Linus Torvalds Date: Fri Oct 7 09:35:50 2022 -0700 Merge tag 'for-6.1/passthrough-2022-10-04' of git://git.kernel.dk/linux Pull passthrough updates from Jens Axboe: "With these changes, passthrough NVMe support over io_uring now performs at the same level as block device O_DIRECT, and in many cases 6-8% better. This contains: - Add support for fixed buffers for passthrough (Anuj, Kanchan) - Enable batched allocations and freeing on passthrough, similarly to what we support on the normal storage path (me) - Fix from Geert fixing an issue with !CONFIG_IO_URING" * tag 'for-6.1/passthrough-2022-10-04' of git://git.kernel.dk/linux: io_uring: Add missing inline to io_uring_cmd_import_fixed() dummy nvme: wire up fixed buffer support for nvme passthrough nvme: pass ubuffer as an integer block: extend functionality to map bvec iterator block: factor out blk_rq_map_bio_alloc helper block: rename bio_map_put to blk_mq_map_bio_put nvme: refactor nvme_alloc_request nvme: refactor nvme_add_user_metadata nvme: Use blk_rq_map_user_io helper scsi: Use blk_rq_map_user_io helper block: add blk_rq_map_user_io io_uring: introduce fixed buffer support for io_uring_cmd io_uring: add io_uring_cmd_import_fixed nvme: enable batched completions of passthrough IO nvme: split out metadata vs non metadata end_io uring_cmd completions block: allow end_io based requests in the completion batch handling block: change request end_io handler to pass back a return value block: enable batched allocation for blk_mq_alloc_request() block: kill deprecated BUG_ON() in the flush handling commit 6a24247132db8122600dc5523e3a62fa8fd28367 Author: Zhao Gongyi Date: Fri Sep 30 14:35:27 2022 +0800 docs: notifier-error-inject: Correct test's name Correct test's name for mem-on-off-test.sh/cpu-on-off-test.sh. Signed-off-by: Zhao Gongyi Reviewed-by: David Hildenbrand Signed-off-by: Shuah Khan commit 95e5a911f9746710daf4753ba494426f802c2299 Author: Zhao Gongyi Date: Fri Sep 30 14:35:26 2022 +0800 selftests/memory-hotplug: Adjust log info for maintainability Redirect misleading error message to /dev/null for offline_memory_expect_success(), And, add an output for online->offline test. Signed-off-by: Zhao Gongyi Acked-by: David Hildenbrand Signed-off-by: Shuah Khan commit 3e77a49aa78a65c7cfc4a2662366442ea1498fbb Author: Zhao Gongyi Date: Fri Sep 30 14:35:25 2022 +0800 selftests/memory-hotplug: Restore memory before exit Some momory will be left in offline state when calling offline_memory_expect_fail() failed. Restore it before exit. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 13023c33c962730a38d6b43995910c8805637a9a Author: Zhao Gongyi Date: Fri Sep 30 14:35:24 2022 +0800 selftests/memory-hotplug: Add checking after online or offline Add checking for online_memory_expect_success()/ offline_memory_expect_success()/offline_memory_expect_fail(), or the test would exit 0 although the functions return 1. Signed-off-by: Zhao Gongyi Reviewed-by: David Hildenbrand Signed-off-by: Shuah Khan commit cadf306460c8f1281fc8bdd270514944ed75d3d0 Author: Randy Dunlap Date: Mon Oct 3 10:58:23 2022 -0700 selftests/ftrace: func_event_triggers: fix typo in user message Correct typo of "it's" to "it". Signed-off-by: Randy Dunlap Cc: Steven Rostedt Cc: Ingo Molnar Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit e98c4f6afc5e21507737066433699f225a180db7 Author: David Gow Date: Sat Oct 1 14:46:43 2022 +0800 Documentation: kunit: Update description of --alltests option kunit_tool's --alltests option was changed in commit 980ac3ad0512 ("kunit: tool: rename all_test_uml.config, use it for --alltests") to use a manually curated list of architecture-indpendent Kconfig options, rather than attempting to use make allyesconfig on UML, which was broken. Update the kunit_tool documentation to reflect the new behaviour of --alltests. Signed-off-by: David Gow Reviewed-by: Daniel Latypov Signed-off-by: Shuah Khan commit c1144e01063e67f807517a393b91fae054929dc8 Author: Daniel Latypov Date: Fri Sep 30 17:26:38 2022 -0700 kunit: declare kunit_assert structs as const Everywhere we use the assert structs now takes them via const*, as of commit 7466886b400b ("kunit: take `kunit_assert` as `const`"). So now let's properly declare the structs as const as well. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Miguel Ojeda Signed-off-by: Shuah Khan commit 513389809e138ae903b6ef43c1d5d2ffaf4dca17 Merge: 0a78a376ef3c2 30514bd2dd4e8 Author: Linus Torvalds Date: Fri Oct 7 09:19:14 2022 -0700 Merge tag 'for-6.1/block-2022-10-03' of git://git.kernel.dk/linux Pull block updates from Jens Axboe: - NVMe pull requests via Christoph: - handle number of queue changes in the TCP and RDMA drivers (Daniel Wagner) - allow changing the number of queues in nvmet (Daniel Wagner) - also consider host_iface when checking ip options (Daniel Wagner) - don't map pages which can't come from HIGHMEM (Fabio M. De Francesco) - avoid unnecessary flush bios in nvmet (Guixin Liu) - shrink and better pack the nvme_iod structure (Keith Busch) - add comment for unaligned "fake" nqn (Linjun Bao) - print actual source IP address through sysfs "address" attr (Martin Belanger) - various cleanups (Jackie Liu, Wolfram Sang, Genjian Zhang) - handle effects after freeing the request (Keith Busch) - copy firmware_rev on each init (Keith Busch) - restrict management ioctls to admin (Keith Busch) - ensure subsystem reset is single threaded (Keith Busch) - report the actual number of tagset maps in nvme-pci (Keith Busch) - small fabrics authentication fixups (Christoph Hellwig) - add common code for tagset allocation and freeing (Christoph Hellwig) - stop using the request_queue in nvmet (Christoph Hellwig) - set min_align_mask before calculating max_hw_sectors (Rishabh Bhatnagar) - send a rediscover uevent when a persistent discovery controller reconnects (Sagi Grimberg) - misc nvmet-tcp fixes (Varun Prakash, zhenwei pi) - MD pull request via Song: - Various raid5 fix and clean up, by Logan Gunthorpe and David Sloan. - Raid10 performance optimization, by Yu Kuai. - sbitmap wakeup hang fixes (Hugh, Keith, Jan, Yu) - IO scheduler switching quisce fix (Keith) - s390/dasd block driver updates (Stefan) - support for recovery for the ublk driver (ZiyangZhang) - rnbd drivers fixes and updates (Guoqing, Santosh, ye, Christoph) - blk-mq and null_blk map fixes (Bart) - various bcache fixes (Coly, Jilin, Jules) - nbd signal hang fix (Shigeru) - block writeback throttling fix (Yu) - optimize the passthrough mapping handling (me) - prepare block cgroups to being gendisk based (Christoph) - get rid of an old PSI hack in the block layer, moving it to the callers instead where it belongs (Christoph) - blk-throttle fixes and cleanups (Yu) - misc fixes and cleanups (Liu Shixin, Liu Song, Miaohe, Pankaj, Ping-Xiang, Wolfram, Saurabh, Li Jinlin, Li Lei, Lin, Li zeming, Miaohe, Bart, Coly, Gaosheng * tag 'for-6.1/block-2022-10-03' of git://git.kernel.dk/linux: (162 commits) sbitmap: fix lockup while swapping block: add rationale for not using blk_mq_plug() when applicable block: adapt blk_mq_plug() to not plug for writes that require a zone lock s390/dasd: use blk_mq_alloc_disk blk-cgroup: don't update the blkg lookup hint in blkg_conf_prep nvmet: don't look at the request_queue in nvmet_bdev_set_limits nvmet: don't look at the request_queue in nvmet_bdev_zone_mgmt_emulate_all blk-mq: use quiesced elevator switch when reinitializing queues block: replace blk_queue_nowait with bdev_nowait nvme: remove nvme_ctrl_init_connect_q nvme-loop: use the tagset alloc/free helpers nvme-loop: store the generic nvme_ctrl in set->driver_data nvme-loop: initialize sqsize later nvme-fc: use the tagset alloc/free helpers nvme-fc: store the generic nvme_ctrl in set->driver_data nvme-fc: keep ctrl->sqsize in sync with opts->queue_size nvme-rdma: use the tagset alloc/free helpers nvme-rdma: store the generic nvme_ctrl in set->driver_data nvme-tcp: use the tagset alloc/free helpers nvme-tcp: store the generic nvme_ctrl in set->driver_data ... commit 97d453bc4007d4ac148c2ba89904026612b91ec9 Author: Daniel Latypov Date: Fri Sep 30 17:26:36 2022 -0700 kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED Context: Currently this macro's name, KUNIT_ASSERTION conflicts with the name of an enum whose values are {KUNIT_EXPECTATION, KUNIT_ASSERTION}. It's hard to think of a better name for the enum, so rename this macro. It's also a bit strange that the macro might do nothing depending on the boolean argument `pass`. Why not have callers check themselves? This patch: Moves the pass/fail checking into the callers of KUNIT_ASSERTION, so now we only call it when the check has failed. Then we rename the macro the _KUNIT_FAILED() to reflect the new semantics. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit a8495ad8e973cb6aabbe855d3dfb66ec4c9b281a Author: Daniel Latypov Date: Fri Sep 30 17:26:35 2022 -0700 kunit: remove format func from struct kunit_assert, get it to 0 bytes Each calll to a KUNIT_EXPECT_*() macro creates a local variable which contains a struct kunit_assert. Normally, we'd hope the compiler would be able to optimize this away, but we've seen cases where it hasn't, see https://groups.google.com/g/kunit-dev/c/i3fZXgvBrfA/m/GbrMNej2BAAJ. In changes like commit 21957f90b28f ("kunit: split out part of kunit_assert into a static const"), we've moved more and more parts out of struct kunit_assert and its children types (kunit_binary_assert). This patch removes the final field and gets us to: sizeof(struct kunit_assert) == 0 sizeof(struct kunit_binary_assert) == 24 (on UML x86_64). This also reduces the amount of macro plumbing going on at the cost of passing in one more arg to the base KUNIT_ASSERTION macro and kunit_do_failed_assertion(). Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 3c4fc7bf4c9e66fe71abcbf93f62f4ddb89b7f15 Author: David Gow Date: Fri Sep 23 13:00:39 2022 +0800 kunit: tool: Don't download risc-v opensbi firmware with wget When running a RISC-V test kernel under QEMU, we need an OpenSBI BIOS file. In the original QEMU support patchset, kunit_tool would optionally download this file from GitHub if it didn't exist, using wget. These days, it can usually be found in the distro's qemu-system-riscv package, and is located in /usr/share/qemu on all the distros I tried (Debian, Arch, OpenSUSE). Use this file, and thereby don't do any downloading in kunit_tool. In addition, we used to shell out to whatever 'wget' was in the path, which could have potentially been used to trick the developer into running another binary. By not using wget at all, we nicely sidestep this issue. Cc: Xu Panda Fixes: 87c9c1631788 ("kunit: tool: add support for QEMU") Reported-by: Zeal Robot Signed-off-by: David Gow Tested-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 185d57797c5ea82e941befc2489dba0cf162b9c4 Author: Daniel Latypov Date: Fri Jul 22 17:15:34 2022 +0000 kunit: make kunit_kfree(NULL) a no-op to match kfree() The real kfree() function will silently return when given a NULL. So a user might reasonably think they can write the following code: char *buffer = NULL; if (param->use_buffer) buffer = kunit_kzalloc(test, 10, GFP_KERNEL); ... kunit_kfree(test, buffer); As-is, kunit_kfree() will mark the test as FAILED when buffer is NULL. (And in earlier times, it would segfault). Let's match the semantics of kfree(). Suggested-by: David Gow Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e562e309d1d4ac05457c1454b6007071f13b5684 Author: Daniel Latypov Date: Fri Jul 22 17:15:33 2022 +0000 kunit: make kunit_kfree() not segfault on invalid inputs kunit_kfree() can only work on data ("resources") allocated by KUnit. Currently for code like this, > void *ptr = kmalloc(4, GFP_KERNEL); > kunit_kfree(test, ptr); kunit_kfree() will segfault. It'll try and look up the kunit_resource associated with `ptr` and get a NULL back, but it won't check for this. This means we also segfault if you double-free. Change kunit_kfree() so it'll notice these invalid pointers and respond by failing the test. Implementation: kunit_destroy_resource() does what kunit_kfree() does, but is more generic and returns -ENOENT when it can't find the resource. Sadly, unlike just letting it crash, this means we don't get a stack trace. But kunit_kfree() is so infrequently used it shouldn't be hard to track down the bad callsite anyways. After this change, the above code gives: > # example_simple_test: EXPECTATION FAILED at lib/kunit/test.c:702 > kunit_kfree: 00000000626ec200 already freed or not allocated by kunit Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 047a8a0a2da716fecfd325d21ccf509c431992d9 Author: Daniel Latypov Date: Fri Jul 22 17:15:32 2022 +0000 kunit: make kunit_kfree() only work on pointers from kunit_malloc() and friends kunit_kfree() exists to clean up allocations from kunit_kmalloc() and friends early instead of waiting for this to happen automatically at the end of the test. But it can be used on *anything* registered with the kunit resource API. E.g. the last 2 statements are equivalent: struct kunit_resource *res = something(); kfree(res->data); kunit_put_resource(res); The problem is that there could be multiple resources that point to the same `data`. E.g. you can have a named resource acting as a pseudo-global variable in a test. If you point it to data allocated with kunit_kmalloc(), then calling `kunit_kfree(ptr)` has the chance to delete either the named resource or to kfree `ptr`. Which one it does depends on the order the resources are registered as kunit_kfree() will delete resources in LIFO order. So this patch restricts kunit_kfree() to only working on resources created by kunit_kmalloc(). Calling it is therefore guaranteed to free the memory, not do anything else. Note: kunit_resource_instance_match() wasn't used outside of KUnit, so it should be safe to remove from the public interface. It's also generally dangerous, as shown above, and shouldn't be used. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 4db4598b5ed8fc26f5fd9312623a9ec5cebbe74a Author: Daniel Latypov Date: Fri Jul 22 17:15:31 2022 +0000 kunit: drop test pointer in string_stream_fragment We already store the `struct kunit *test` in the string_stream object itself, so we need don't need to store a copy of this pointer in every fragment in the stream. Drop it, getting string_stream_fragment down the bare minimum: a list_head and the `char *` with the actual fragment. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 78b1c6584fcedcf2d9687a4455c461859094cf04 Author: David Gow Date: Fri Jul 22 17:15:30 2022 +0000 kunit: string-stream: Simplify resource use Currently, KUnit's string streams are themselves "KUnit resources". This is redundant since the stream itself is already allocated with kunit_kzalloc() and will thus be freed automatically at the end of the test. string-stream is only used internally within KUnit, and isn't using the extra features that resources provide like reference counting, being able to locate them dynamically as "test-local variables", etc. Indeed, the resource's refcount is never incremented when the pointer is returned. The fact that it's always manually destroyed is more evidence that the reference counting is unused. Signed-off-by: David Gow Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 96dbcc0072acf4f9565a16e8da96e57e5cee1068 Author: Filipe Manana Date: Mon Oct 3 15:57:30 2022 +0100 btrfs: add missing path cache update during fiemap When looking the stored result for a cached path node, if the stored result is valid and has a value of true, we must update all the nodes for all levels below it with a result of true as well. This is necessary when moving from one leaf in the fs tree to the next one, as well as when moving from a node at any level to the next node at the same level. Currently this logic is missing as it was somehow forgotten by a recent patch with the subject: "btrfs: speedup checking for extent sharedness during fiemap". This adds the missing logic, which is the counter part to what we do when adding a shared node to the cache at store_backref_shared_cache(). Fixes: 12a824dc67a6 ("btrfs: speedup checking for extent sharedness during fiemap") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 0a78a376ef3c2f3d397df48909f00cd75f92137a Merge: 188943a15638c 108893ddcc4d3 Author: Linus Torvalds Date: Fri Oct 7 08:52:43 2022 -0700 Merge tag 'for-6.1/io_uring-2022-10-03' of git://git.kernel.dk/linux Pull io_uring updates from Jens Axboe: - Add supported for more directly managed task_work running. This is beneficial for real world applications that end up issuing lots of system calls as part of handling work. Normal task_work will always execute as we transition in and out of the kernel, even for "unrelated" system calls. It's more efficient to defer the handling of io_uring's deferred work until the application wants it to be run, generally in batches. As part of ongoing work to write an io_uring network backend for Thrift, this has been shown to greatly improve performance. (Dylan) - Add IOPOLL support for passthrough (Kanchan) - Improvements and fixes to the send zero-copy support (Pavel) - Partial IO handling fixes (Pavel) - CQE ordering fixes around CQ ring overflow (Pavel) - Support sendto() for non-zc as well (Pavel) - Support sendmsg for zerocopy (Pavel) - Networking iov_iter fix (Stefan) - Misc fixes and cleanups (Pavel, me) * tag 'for-6.1/io_uring-2022-10-03' of git://git.kernel.dk/linux: (56 commits) io_uring/net: fix notif cqe reordering io_uring/net: don't update msg_name if not provided io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL io_uring/rw: defer fsnotify calls to task context io_uring/net: fix fast_iov assignment in io_setup_async_msg() io_uring/net: fix non-zc send with address io_uring/net: don't skip notifs for failed requests io_uring/rw: don't lose short results on io_setup_async_rw() io_uring/rw: fix unexpected link breakage io_uring/net: fix cleanup double free free_iov init io_uring: fix CQE reordering io_uring/net: fix UAF in io_sendrecv_fail() selftest/net: adjust io_uring sendzc notif handling io_uring: ensure local task_work marks task as running io_uring/net: zerocopy sendmsg io_uring/net: combine fail handlers io_uring/net: rename io_sendzc() io_uring/net: support non-zerocopy sendto io_uring/net: refactor io_setup_async_addr io_uring/net: don't lose partial send_zc on fail ... commit 188943a15638ceb91f960e072ed7609b2d7f2a55 Merge: abf625dc8c1db 191249f708897 Author: Linus Torvalds Date: Fri Oct 7 08:42:37 2022 -0700 Merge tag 'fs-for_v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2, udf, reiserfs, and quota updates from Jan Kara: - Fix for udf to make splicing work again - More disk format sanity checks for ext2 to avoid crashes found by syzbot - More quota disk format checks to avoid crashes found by fuzzing - Reiserfs & isofs cleanups * tag 'fs-for_v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: Add more checking after reading from quota file quota: Replace all block number checking with helper function quota: Check next/prev free block number after reading from quota file ext2: Use kvmalloc() for group descriptor array ext2: Add sanity checks for group and filesystem size udf: Support splicing to file isofs: delete unnecessary checks before brelse() fs/reiserfs: replace ternary operator with min() and min_t() commit abf625dc8c1db167150c844028a2f9f4c329fe68 Merge: 9f4b9beeb9cf4 7a80bf902d2bc Author: Linus Torvalds Date: Fri Oct 7 08:28:50 2022 -0700 Merge tag 'fsnotify-for_v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "Two cleanups for fsnotify code" * tag 'fsnotify-for_v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: Remove obsoleted fanotify_event_has_path() fsnotify: remove unused declaration commit 9f4b9beeb9cf46c4b172fca06de5bd6831108641 Merge: 4c86114194e64 f5ba1cdaf5eb3 Author: Linus Torvalds Date: Fri Oct 7 08:19:26 2022 -0700 Merge tag '6.1-rc-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd updates from Steve French: - RDMA (smbdirect) fixes - fixes for SMB3.1.1 POSIX Extensions (especially for id mapping) - various casemapping fixes for mount and lookup - UID mapping fixes - fix confusing error message - protocol negotiation fixes, including NTLMSSP fix - two encryption fixes - directory listing fix - some cleanup fixes * tag '6.1-rc-ksmbd-fixes' of git://git.samba.org/ksmbd: (24 commits) ksmbd: validate share name from share config response ksmbd: call ib_drain_qp when disconnected ksmbd: make utf-8 file name comparison work in __caseless_lookup() ksmbd: Fix user namespace mapping ksmbd: hide socket error message when ipv6 config is disable ksmbd: reduce server smbdirect max send/receive segment sizes ksmbd: decrease the number of SMB3 smbdirect server SGEs ksmbd: Fix wrong return value and message length check in smb2_ioctl() ksmbd: set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob ksmbd: fix encryption failure issue for session logoff response ksmbd: fix endless loop when encryption for response fails ksmbd: fill sids in SMB_FIND_FILE_POSIX_INFO response ksmbd: set file permission mode to match Samba server posix extension behavior ksmbd: change security id to the one samba used for posix extension ksmbd: update documentation ksmbd: casefold utf-8 share names and fix ascii lowercase conversion ksmbd: port to vfs{g,u}id_t and associated helpers ksmbd: fix incorrect handling of iterate_dir MAINTAINERS: remove Hyunchul Lee from ksmbd maintainers MAINTAINERS: Add Tom Talpey as ksmbd reviewer ... commit 63c30d70443064d71340e02024b4a463db5c77d9 Merge: 095bb6e44eb17 ba47a6ac4658f Author: Miquel Raynal Date: Fri Oct 7 16:56:14 2022 +0200 Merge tag 'nand/for-6.1' into mtd/next Raw NAND core changes: * Replace of_gpio_named_count() by gpiod_count() - Remove misguided comment of nand_get_device() - bbt: Use the bitmap API to allocate bitmaps Raw NAND controller drivers changes: * Meson: - Stop supporting legacy clocks - Refine resource getting in probe - Convert bindings to yaml - Fix clock handling and update the bindings accordingly - Fix bit map use in meson_nfc_ecc_correct() * bcm47xx: - Fix spelling typo in comment * STM32 FMC2: - Switch to using devm_fwnode_gpiod_get() - Fix dma_map_sg error check * Cadence: - Remove an unneeded result variable * Marvell: - Fix error handle regarding dma_map_sg * Orion: - Use devm_clk_get_optional() * Cafe: - Use correct function name in comment block * Atmel: - Unmap streaming DMA mappings * Arasan: - Stop using 0 as NULL pointer * GPMI: - Fix typo 'the the' in comment * BRCM: - Add individual glue driver selection - Move Kconfig to driver folder * FSL: Fix none ECC mode * Intel: - Use devm_platform_ioremap_resource_byname() - Remove unused clk_rate member from struct ebu_nand - Remove unused nand_pa member from ebu_nand_cs - Don't re-define NAND_DATA_IFACE_CHECK_ONLY - Remove undocumented compatible string - Fix compatible string in the bindings - Read the chip-select line from the correct OF node - Fix maximum chip select value in the bindings Signed-off-by: Miquel Raynal commit 7228113d1fa0107a377aef71094d610eb8824aa2 Author: Juergen Gross Date: Mon Aug 29 13:26:08 2022 +0200 xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT With CONFIG_XEN_VIRTIO_FORCE_GRANT set the default backend domid to 0, enabling to use xen_grant_dma_ops for those devices. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Signed-off-by: Juergen Gross commit c9133112f347907774055bbf73179a7ff8504689 Author: Juergen Gross Date: Mon Aug 29 13:26:07 2022 +0200 xen/virtio: restructure xen grant dma setup In order to prepare supporting other means than device tree for setting up virtio devices under Xen, restructure the functions xen_is_grant_dma_device() and xen_grant_setup_dma_ops() a little bit. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Acked-by: Stefano Stabellini Signed-off-by: Juergen Gross commit 3dd59a7dcb97e6e40d6385a1a3faa9392b6d184a Author: Jason Gunthorpe Date: Fri Oct 7 11:04:41 2022 -0300 vfio: Make the group FD disassociate from the iommu_group Allow the vfio_group struct to exist with a NULL iommu_group pointer. When the pointer is NULL the vfio_group users promise not to touch the iommu_group. This allows a driver to be hot unplugged while userspace is keeping the group FD open. Remove all the code waiting for the group FD to close. This fixes a userspace regression where we learned that virtnodedevd leaves a group FD open even though the /dev/ node for it has been deleted and all the drivers for it unplugged. Fixes: ca5f21b25749 ("vfio: Follow a strict lifetime for struct iommu_group") Reported-by: Christian Borntraeger Tested-by: Matthew Rosato Tested-by: Christian Borntraeger Tested-by: Eric Farman Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v2-15417f29324e+1c-vfio_group_disassociate_jgg@nvidia.com Signed-off-by: Alex Williamson commit 819da99a7360f7e197038d12f0eba626bde11856 Author: Jason Gunthorpe Date: Fri Oct 7 11:04:40 2022 -0300 vfio: Hold a reference to the iommu_group in kvm for SPAPR SPAPR exists completely outside the normal iommu driver framework, the groups it creates are fake and are only created to enable VFIO's uAPI. Thus, it does not need to follow the iommu core rule that the iommu_group will only be touched while a driver is attached. Carry a group reference into KVM and have KVM directly manage the lifetime of this object independently of VFIO. This means KVM no longer relies on the vfio group file being valid to maintain the group reference. Tested-by: Matthew Rosato Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v2-15417f29324e+1c-vfio_group_disassociate_jgg@nvidia.com Signed-off-by: Alex Williamson commit 4b22ef042d6f54a6e5899555f2db71749133eca8 Author: Jason Gunthorpe Date: Fri Oct 7 11:04:39 2022 -0300 vfio: Add vfio_file_is_group() This replaces uses of vfio_file_iommu_group() which were only detecting if the file is a VFIO file with no interest in the actual group. The only remaning user of vfio_file_iommu_group() is in KVM for the SPAPR stuff. It passes the iommu_group into the arch code through kvm for some reason. Tested-by: Matthew Rosato Tested-by: Christian Borntraeger Tested-by: Eric Farman Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v2-15417f29324e+1c-vfio_group_disassociate_jgg@nvidia.com Signed-off-by: Alex Williamson commit 5f4853e810943af5e45fcc040cbbcbba07d8fc25 Author: Lukas Bulwahn Date: Thu Sep 29 14:29:37 2022 +0200 MAINTAINERS: rectify file entry in ALIBABA PMU DRIVER Commit cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") adds the DDR Sub-System Driveway PMU driver here: drivers/perf/alibaba_uncore_drw_pmu.c The file entry in MAINTAINERS for the ALIBABA PMU DRIVER, introduced with commit d813a19e7d2e ("MAINTAINERS: add maintainers for Alibaba' T-Head PMU driver"), however refers to: drivers/perf/alibaba_uncore_dwr_pmu.c Note the swapping of characters. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken file pattern. Repair this file entry in ALIBABA PMU DRIVER. Signed-off-by: Lukas Bulwahn Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220929122937.20132-1-lukas.bulwahn@gmail.com Signed-off-by: Catalin Marinas commit e08d07dd9f80e997ad36a088eb276509ca484e97 Author: Geert Uytterhoeven Date: Tue Sep 27 15:37:16 2022 +0200 drivers/perf: ALIBABA_UNCORE_DRW_PMU should depend on ACPI The Alibaba T-Head Yitian 710 DDR Sub-system Driveway PMU driver relies solely on ACPI for matching. Hence add a dependency on ACPI, to prevent asking the user about this driver when configuring a kernel without ACPI support. Fixes: cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") Signed-off-by: Geert Uytterhoeven Acked-by: Will Deacon Link: https://lore.kernel.org/r/2a4407bb598285660fa5e604e56823ddb12bb0aa.1664285774.git.geert+renesas@glider.be Signed-off-by: Catalin Marinas commit ad0112f2d54cafee839e2ee99ec0b5fb9ce5c4b8 Author: Sun Ke Date: Sat Sep 24 11:21:27 2022 +0800 drivers/perf: fix return value check in ali_drw_pmu_probe() In case of error, 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: cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") Signed-off-by: Sun Ke Acked-by: Will Deacon Reviewed-by: Shuai Xue Link: https://lore.kernel.org/r/20220924032127.313156-1-sunke32@huawei.com Signed-off-by: Catalin Marinas commit 171df58028bf4649460fb146a56a58dcb0c8f75a Author: James Morse Date: Fri Sep 30 14:19:59 2022 +0100 arm64: errata: Add Cortex-A55 to the repeat tlbi list Cortex-A55 is affected by an erratum where in rare circumstances the CPUs may not handle a race between a break-before-make sequence on one CPU, and another CPU accessing the same page. This could allow a store to a page that has been unmapped. Work around this by adding the affected CPUs to the list that needs TLB sequences to be done twice. Signed-off-by: James Morse Cc: Link: https://lore.kernel.org/r/20220930131959.3082594-1-james.morse@arm.com Signed-off-by: Catalin Marinas commit e60d64074214db7207fc13c25ee39d8d47cb4a34 Author: Alvaro Karsz Date: Wed Sep 21 11:27:29 2022 +0300 virtio_blk: add SECURE ERASE command support Support for the VIRTIO_BLK_F_SECURE_ERASE VirtIO feature. A device that offers this feature can receive VIRTIO_BLK_T_SECURE_ERASE commands. A device which supports this feature has the following fields in the virtio config: - max_secure_erase_sectors - max_secure_erase_seg - secure_erase_sector_alignment max_secure_erase_sectors and secure_erase_sector_alignment are expressed in 512-byte units. Every secure erase command has the following fields: - sectors: The starting offset in 512-byte units. - num_sectors: The number of sectors. Signed-off-by: Alvaro Karsz Message-Id: <20220921082729.2516779-1-alvaro.karsz@solid-run.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi commit c1ca352d371f724f7fb40f016abdb563aa85fe55 Author: Jason Wang Date: Tue Sep 27 15:48:10 2022 +0800 vp_vdpa: support feature provisioning This patch allows the device features to be provisioned via netlink. This is done by: 1) validating the provisioned features to be a subset of the parent features. 2) clearing the features that is not wanted by the userspace For example: # vdpa mgmtdev show pci/0000:02:00.0: supported_classes net max_supported_vqs 3 dev_features CSUM GUEST_CSUM CTRL_GUEST_OFFLOADS MAC GUEST_TSO4 GUEST_TSO6 GUEST_ECN GUEST_UFO HOST_TSO4 HOST_TSO6 HOST_ECN HOST_UFO MRG_RXBUF STATUS CTRL_VQ CTRL_RX CTRL_VLAN CTRL_RX_EXTRA GUEST_ANNOUNCE CTRL_MAC_ADDR RING_INDIRECT_DESC RING_EVENT_IDX VERSION_1 ACCESS_PLATFORM 1) provision vDPA device with all features that are supported by the virtio-pci # vdpa dev add name dev1 mgmtdev pci/0000:02:00.0 # vdpa dev config show dev1: mac 52:54:00:12:34:56 link up link_announce false mtu 65535 negotiated_features CSUM GUEST_CSUM CTRL_GUEST_OFFLOADS MAC GUEST_TSO4 GUEST_TSO6 GUEST_ECN GUEST_UFO HOST_TSO4 HOST_TSO6 HOST_ECN HOST_UFO MRG_RXBUF STATUS CTRL_VQ CTRL_RX CTRL_VLAN GUEST_ANNOUNCE CTRL_MAC_ADDR RING_INDIRECT_DESC RING_EVENT_IDX VERSION_1 ACCESS_PLATFORM 2) provision vDPA device with a subset of the features # vdpa dev add name dev1 mgmtdev pci/0000:02:00.0 device_features 0x300020000 # dev1: mac 52:54:00:12:34:56 link up link_announce false mtu 65535 negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20220927074810.28627-4-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit 477f71971422fb225337b30f7b79363387b1d78c Author: Jason Wang Date: Tue Sep 27 15:48:09 2022 +0800 vdpa_sim_net: support feature provisioning This patch implements features provisioning for vdpa_sim_net. 1) validating the provisioned features to be a subset of the parent features. 2) clearing the features that is not wanted by the userspace For example: vdpasim_net: supported_classes net max_supported_vqs 3 dev_features MTU MAC CTRL_VQ CTRL_MAC_ADDR ANY_LAYOUT VERSION_1 ACCESS_PLATFORM 1) provision vDPA device with all features that are supported by the net simulator dev1: mac 00:00:00:00:00:00 link up link_announce false mtu 1500 negotiated_features MTU MAC CTRL_VQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM 2) provision vDPA device with a subset of the features dev1: mac 00:00:00:00:00:00 link up link_announce false mtu 1500 negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20220927074810.28627-3-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 90fea5a800c3dd80fb8ad9a02929bcef5fde42b8 Author: Jason Wang Date: Tue Sep 27 15:48:08 2022 +0800 vdpa: device feature provisioning This patch allows the device features to be provisioned through netlink. A new attribute is introduced to allow the userspace to pass a 64bit device features during device adding. This provides several advantages: - Allow to provision a subset of the features to ease the cross vendor live migration. - Better debug-ability for vDPA framework and parent. Reviewed-by: Eli Cohen Signed-off-by: Jason Wang Message-Id: <20220927074810.28627-2-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit 4959aebba8c06992abafa09d1e80965e0825af54 Author: Gavin Li Date: Wed Sep 14 17:49:11 2022 +0300 virtio-net: use mtu size as buffer length for big packets Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big packets even when GUEST_* offloads are not present on the device. However, if guest GSO is not supported, it would be sufficient to allocate segments to cover just up the MTU size and no further. Allocating the maximum amount of segments results in a large waste of buffer space in the queue, which limits the number of packets that can be buffered and can result in reduced performance. Therefore, if guest GSO is not supported, use the MTU to calculate the optimal amount of segments required. Below is the iperf TCP test results over a Mellanox NIC, using vDPA for 1 VQ, queue size 1024, before and after the change, with the iperf server running over the virtio-net interface. MTU(Bytes)/Bandwidth (Gbit/s) Before After 1500 22.5 22.4 9000 12.8 25.9 And result of queue size 256. MTU(Bytes)/Bandwidth (Gbit/s) Before After 9000 2.15 11.9 With this patch no degradation is observed with multiple below tests and feature bit combinations. Results are summarized below for q depth of 1024. Interface MTU is 1500 if MTU feature is disabled. MTU is set to 9000 in other tests. Features/ Bandwidth (Gbit/s) Before After mtu off 20.1 20.2 mtu/indirect on 17.4 17.3 mtu/indirect/packed on 17.2 17.2 Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Parav Pandit Reviewed-by: Xuan Zhuo Reviewed-by: Si-Wei Liu Message-Id: <20220914144911.56422-3-gavinl@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 46cd26f4108714d2e28c93d773e1602917ac0691 Author: Gavin Li Date: Wed Sep 14 17:49:10 2022 +0300 virtio-net: introduce and use helper function for guest gso support checks Probe routine is already several hundred lines. Use helper function for guest gso support check. Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Parav Pandit Reviewed-by: Xuan Zhuo Reviewed-by: Si-Wei Liu Message-Id: <20220914144911.56422-2-gavinl@nvidia.com> Signed-off-by: Michael S. Tsirkin commit cdbd952bb7b5fca36676b3d318796b196b127397 Author: Michael S. Tsirkin Date: Mon Aug 15 18:04:20 2022 -0400 virtio: drop vp_legacy_set_queue_size There's actually no way to set queue size on legacy virtio pci. Signed-off-by: Michael S. Tsirkin Message-Id: <20220815220447.155860-1-mst@redhat.com> commit f7adf38928301576193910c94ab575804b81cf73 Author: Deming Wang Date: Mon Sep 26 14:33:06 2022 -0400 virtio_ring: make vring_alloc_queue_packed prettier Add some spaces to vring_alloc_queue(make it look prettier). Signed-off-by: Deming Wang Message-Id: <20220926183306.4535-1-wangdeming@inspur.com> Signed-off-by: Michael S. Tsirkin commit bdeb2f9836c4fd323d87fad4d7a8abd00746c359 Author: Deming Wang Date: Sun Sep 25 22:22:02 2022 -0400 virtio_ring: split: Operators use unified style The operators of vring_alloc_queue_split should use the unified style.Add space for the '|' ,make it be looked more pretty. Signed-off-by: Deming Wang Message-Id: <20220926022202.1516-1-wangdeming@inspur.com> Signed-off-by: Michael S. Tsirkin commit 078adb3bf43388d4e1c8f1a63b14f2629f2ad995 Author: Xiu Jianfeng Date: Sat Sep 17 16:38:03 2022 +0800 vhost: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Message-Id: <20220917083803.21521-1-xiujianfeng@huawei.com> Signed-off-by: Michael S. Tsirkin commit e1567b4f0eec779af99b372773ddeb5be9b6208b Author: Mark Brown Date: Wed Oct 5 19:16:42 2022 +0100 arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK SPINTMASK was typoed as SPINMASK, fix it. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20221005181642.711734-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 10d5ea5a436da8d60cdb5845f454d595accdbce0 Author: Kees Cook Date: Mon Sep 26 19:29:23 2022 -0700 wifi: nl80211: Split memcpy() of struct nl80211_wowlan_tcp_data_token flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/ Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Johannes Berg commit e3e6e1d16a4cf7b63159ec71774e822194071954 Author: Hawkins Jiawei Date: Tue Sep 27 07:34:59 2022 +0800 wifi: wext: use flex array destination for memcpy() Syzkaller reports buffer overflow false positive as follows: ------------[ cut here ]------------ memcpy: detected field-spanning write (size 8) of single field "&compat_event->pointer" at net/wireless/wext-core.c:623 (size 4) WARNING: CPU: 0 PID: 3607 at net/wireless/wext-core.c:623 wireless_send_event+0xab5/0xca0 net/wireless/wext-core.c:623 Modules linked in: CPU: 1 PID: 3607 Comm: syz-executor659 Not tainted 6.0.0-rc6-next-20220921-syzkaller #0 [...] Call Trace: ioctl_standard_call+0x155/0x1f0 net/wireless/wext-core.c:1022 wireless_process_ioctl+0xc8/0x4c0 net/wireless/wext-core.c:955 wext_ioctl_dispatch net/wireless/wext-core.c:988 [inline] wext_ioctl_dispatch net/wireless/wext-core.c:976 [inline] wext_handle_ioctl+0x26b/0x280 net/wireless/wext-core.c:1049 sock_ioctl+0x285/0x640 net/socket.c:1220 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] Wireless events will be sent on the appropriate channels in wireless_send_event(). Different wireless events may have different payload structure and size, so kernel uses **len** and **cmd** field in struct __compat_iw_event as wireless event common LCP part, uses **pointer** as a label to mark the position of remaining different part. Yet the problem is that, **pointer** is a compat_caddr_t type, which may be smaller than the relative structure at the same position. So during wireless_send_event() tries to parse the wireless events payload, it may trigger the memcpy() run-time destination buffer bounds checking when the relative structure's data is copied to the position marked by **pointer**. This patch solves it by introducing flexible-array field **ptr_bytes**, to mark the position of the wireless events remaining part next to LCP part. What's more, this patch also adds **ptr_len** variable in wireless_send_event() to improve its maintainability. Reported-and-tested-by: syzbot+473754e5af963cf014cf@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/00000000000070db2005e95a5984@google.com/ Suggested-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: Hawkins Jiawei Signed-off-by: Johannes Berg commit d9e249704084982ac7581a560ffa284e11621d43 Author: Felix Fietkau Date: Fri Oct 7 14:56:11 2022 +0200 wifi: cfg80211: fix ieee80211_data_to_8023_exthdr handling of small packets STP topology change notification packets only have a payload of 7 bytes, so they get dropped due to the skb->len < hdrlen + 8 check. Fix this by removing the extra 8 from the skb->len check and checking the return code on the skb_copy_bits calls. Fixes: 2d1c304cb2d5 ("cfg80211: add function for 802.3 conversion with separate output buffer") Reported-by: Chad Monroe Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg commit c95014e1d05b5acfd9e6fbe5d1f048b07c6902ff Author: Alexander Wetzel Date: Tue Sep 20 17:55:41 2022 +0200 wifi: mac80211: netdev compatible TX stop for iTXQ drivers Properly handle TX stop for internal queues (iTXQs) within mac80211. mac80211 must not stop netdev queues when using mac80211 iTXQs. For these drivers the netdev interface is created with IFF_NO_QUEUE. While netdev still drops frames for IFF_NO_QUEUE interfaces when we stop the netdev queues, it also prints a warning when this happens: Assuming the mac80211 interface is called wlan0 we would get "Virtual device wlan0 asks to queue packet!" when netdev has to drop a frame. This patch is keeping the harmless netdev queue starts for iTXQ drivers. Signed-off-by: Alexander Wetzel Signed-off-by: Johannes Berg commit c210b91818e81068ca2573c20684644b8e110a07 Author: Conor Dooley Date: Tue Sep 20 10:37:35 2022 +0100 riscv: dts: microchip: fix fabric i2c reg size The size of the reg should've been changed when the address was changed, but obviously I forgot to do so. Fixes: ab291621a8b8 ("riscv: dts: microchip: icicle: re-jig fabric peripheral addresses") Signed-off-by: Conor Dooley commit 3bf9e30e493356912f9cb600f59b51133680639e Author: Felix Fietkau Date: Sat Oct 1 12:01:13 2022 +0200 wifi: mac80211: fix decap offload for stations on AP_VLAN interfaces Since AP_VLAN interfaces are not passed to the driver, check offload_flags on the bss vif instead. Reported-by: Howard Hsu Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support") Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg commit ceb3d688f92231e9d9e663c56a1c8bee90140bad Author: Dan Carpenter Date: Mon Sep 12 18:07:16 2022 +0300 wifi: mac80211: unlock on error in ieee80211_can_powered_addr_change() Unlock before returning -EOPNOTSUPP. Fixes: 3c06e91b40db ("wifi: mac80211: Support POWERED_ADDR_CHANGE feature") Signed-off-by: Dan Carpenter Signed-off-by: Johannes Berg commit 092197f1f47f8359b46ea62445d87561949b577d Author: James Prestwood Date: Thu Sep 15 12:55:53 2022 -0700 wifi: mac80211: remove/avoid misleading prints At some point a few kernel debug prints started appearing which indicated something was sending invalid IEs: "bad VHT capabilities, disabling VHT" "Invalid HE elem, Disable HE" Turns out these were being printed because the local hardware supported HE/VHT but the peer/AP did not. Bad/invalid indicates, to me at least, that the IE is in some way malformed, not missing. For the HE print (ieee80211_verify_peer_he_mcs_support) it will now silently fail if the HE capability element is missing (still prints if the element size is wrong). For the VHT print, it has been removed completely and will silently set the DISABLE_VHT flag which is consistent with how DISABLE_HT is set. Signed-off-by: James Prestwood Signed-off-by: Johannes Berg commit b650009fcb701ea99aa133bbe18dbfc5305ddf1a Author: James Prestwood Date: Wed Sep 28 15:49:10 2022 -0700 wifi: mac80211: fix probe req HE capabilities access When building the probe request IEs HE support is checked for the 6GHz band (wiphy->bands[NL80211_BAND_6GHZ]). If supported the HE capability IE should be included according to the spec. The problem is the 16-bit capability is obtained from the band object (sband) that was passed in, not the 6GHz band object (sband6). If the sband object doesn't support HE it will result in a warning. Fixes: 7d29bc50b30e ("mac80211: always include HE 6GHz capability in probe request") Signed-off-by: James Prestwood Signed-off-by: Johannes Berg commit f5369dcf5c0a76260cd301bd5c25d59c451d62c1 Author: Felix Fietkau Date: Fri Oct 7 11:05:09 2022 +0200 wifi: mac80211: do not drop packets smaller than the LLC-SNAP header on fast-rx Since STP TCN frames are only 7 bytes, the pskb_may_pull call returns an error. Instead of dropping those packets, bump them back to the slow path for proper processing. Fixes: 49ddf8e6e234 ("mac80211: add fast-rx path") Reported-by: Chad Monroe Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg commit a8e633c604476e24d26a636582c0f5bdb421e70d Author: Li Zhong Date: Wed Sep 21 14:09:21 2022 -0700 net/9p: clarify trans_fd parse_opt failure handling This parse_opts will set invalid opts.rfd/wfd in case of failure which we already check, but it is not clear for readers that parse_opts error are handled in p9_fd_create: clarify this by explicitely checking the return value. Link: https://lkml.kernel.org/r/20220921210921.1654735-1-floridsleeves@gmail.com Signed-off-by: Li Zhong [Dominique: reworded commit message to clarify this is NOOP] Signed-off-by: Dominique Martinet commit 0664c63af16dceb4b40a9825e738136a2dac0260 Author: Xiu Jianfeng Date: Fri Sep 9 18:35:46 2022 +0800 net/9p: add __init/__exit annotations to module init/exit funcs xen transport was missing annotations Link: https://lkml.kernel.org/r/20220909103546.73015-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Dominique Martinet commit 296ab4a813841ba1d5f40b03190fd1bd8f25aab0 Author: Dominique Martinet Date: Sun Sep 4 20:17:49 2022 +0900 net/9p: use a dedicated spinlock for trans_fd Shamelessly copying the explanation from Tetsuo Handa's suggested patch[1] (slightly reworded): syzbot is reporting inconsistent lock state in p9_req_put()[2], for p9_tag_remove() from p9_req_put() from IRQ context is using spin_lock_irqsave() on "struct p9_client"->lock but trans_fd (not from IRQ context) is using spin_lock(). Since the locks actually protect different things in client.c and in trans_fd.c, just replace trans_fd.c's lock by a new one specific to the transport (client.c's protect the idr for fid/tag allocations, while trans_fd.c's protects its own req list and request status field that acts as the transport's state machine) Link: https://lore.kernel.org/r/20220904112928.1308799-1-asmadeus@codewreck.org Link: https://lkml.kernel.org/r/2470e028-9b05-2013-7198-1fdad071d999@I-love.SAKURA.ne.jp [1] Link: https://syzkaller.appspot.com/bug?extid=2f20b523930c32c160cc [2] Reported-by: syzbot Reported-by: Tetsuo Handa Reviewed-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 376b3275c19f83d373e841e9af2d7658693190b9 Author: Nicholas Piggin Date: Fri Oct 7 00:33:45 2022 +1000 KVM: PPC: Book3S HV: Fix stack frame regs marker The hard-coded marker is out of date now, fix it using the nice define. Fixes: 17773afdcd15 ("powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER") Reported-by: Joel Stanley Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221006143345.129077-1-npiggin@gmail.com commit b78870e7f41534cc719c295d1f8809aca93aeeab Author: Prathamesh Shete Date: Thu Oct 6 18:36:22 2022 +0530 mmc: sdhci-tegra: Use actual clock rate for SW tuning correction Ensure tegra_host member "curr_clk_rate" holds the actual clock rate instead of requested clock rate for proper use during tuning correction algorithm. Actual clk rate may not be the same as the requested clk frequency depending on the parent clock source set. Tuning correction algorithm depends on certain parameters which are sensitive to current clk rate. If the host clk is selected instead of the actual clock rate, tuning correction algorithm may end up applying invalid correction, which could result in errors Fixes: ea8fc5953e8b ("mmc: tegra: update hw tuning process") Signed-off-by: Aniruddha TVS Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221006130622.22900-4-pshete@nvidia.com Signed-off-by: Ulf Hansson commit 099d387ebbcd70c6adc906ab5b66ef639c09dede Author: Dmitry Torokhov Date: Tue Sep 27 08:46:09 2022 -0700 watchdog: twl4030_wdt: add missing mod_devicetable.h include The driver is using of_device_id and therefore needs to include mod_devicetable.h header. We used to get this definition indirectly via inclusion of matrix_keypad.h from twl.h, but we are cleaning up matrix_keypad.h from unnecessary includes. Signed-off-by: Dmitry Torokhov Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220927154611.3330871-1-dmitry.torokhov@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f0c00454bf78975925eccc9737faaa4d4951edbf Author: Biju Das Date: Wed Sep 28 12:07:55 2022 +0100 mmc: renesas_sdhi: Fix rounding errors Due to clk rounding errors on RZ/G2L platforms, it selects a clock source with a lower clock rate compared to a higher one. For eg: The rounding error (533333333 Hz / 4 * 4 = 533333332 Hz < 5333333 33 Hz) selects a clk source of 400 MHz instead of 533.333333 MHz. This patch fixes this issue by adding a margin of (1/1024) higher to the clock rate. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Fixes: bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220928110755.849275-1-biju.das.jz@bp.renesas.com Signed-off-by: Ulf Hansson commit aabf6155dfb83262ef9a10af4bef945e7aba9b8e Author: Kees Cook Date: Thu Oct 6 12:20:53 2022 -0700 net: ethernet: bgmac: Remove -Warray-bounds exception GCC-12 emits false positive -Warray-bounds warnings with CONFIG_UBSAN_SHIFT (-fsanitize=shift). This is fixed in GCC 13[1], and there is top-level Makefile logic to remove -Warray-bounds for known-bad GCC versions staring with commit f0be87c42cbd ("gcc-12: disable '-Warray-bounds' universally for now"). Remove the local work-around. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105679 Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 4af609b216e8d9e8d4b03d49ca5b965e87c344b3 Author: Kees Cook Date: Thu Oct 6 12:20:52 2022 -0700 net: ethernet: mediatek: Remove -Warray-bounds exception GCC-12 emits false positive -Warray-bounds warnings with CONFIG_UBSAN_SHIFT (-fsanitize=shift). This is fixed in GCC 13[1], and there is top-level Makefile logic to remove -Warray-bounds for known-bad GCC versions staring with commit f0be87c42cbd ("gcc-12: disable '-Warray-bounds' universally for now"). Remove the local work-around. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105679 Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit fb4a5dfca0f0a027e2d89be00e53adb2827943f6 Author: Serhiy Boiko Date: Thu Oct 6 22:04:09 2022 +0300 prestera: matchall: do not rollback if rule exists If you try to create a 'mirror' ACL rule on a port that already has a mirror rule, prestera_span_rule_add() will fail with EEXIST error. This forces rollback procedure which destroys existing mirror rule on hardware leaving it visible in linux. Add an explicit check for EEXIST to prevent the deletion of the existing rule but keep user seeing error message: $ tc filter add dev sw1p1 ... skip_sw action mirred egress mirror dev sw1p2 $ tc filter add dev sw1p1 ... skip_sw action mirred egress mirror dev sw1p3 RTNETLINK answers: File exists We have an error talking to the kernel Fixes: 13defa275eef ("net: marvell: prestera: Add matchall support") Signed-off-by: Serhiy Boiko Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit 61b91eb33a69c3be11b259c5ea484505cd79f883 Author: David Ahern Date: Thu Oct 6 10:48:49 2022 -0600 ipv4: Handle attempt to delete multipath route when fib_info contains an nh reference Gwangun Jung reported a slab-out-of-bounds access in fib_nh_match: fib_nh_match+0xf98/0x1130 linux-6.0-rc7/net/ipv4/fib_semantics.c:961 fib_table_delete+0x5f3/0xa40 linux-6.0-rc7/net/ipv4/fib_trie.c:1753 inet_rtm_delroute+0x2b3/0x380 linux-6.0-rc7/net/ipv4/fib_frontend.c:874 Separate nexthop objects are mutually exclusive with the legacy multipath spec. Fix fib_nh_match to return if the config for the to be deleted route contains a multipath spec while the fib_info is using a nexthop object. Fixes: 493ced1ac47c ("ipv4: Allow routes to use nexthop objects") Fixes: 6bf92d70e690 ("net: ipv4: fix route with nexthop object delete warning") Reported-by: Gwangun Jung Signed-off-by: David Ahern Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller commit 3030cbff67a7ae12b4b7bf69a605699372424f41 Author: Yang Li Date: Thu Oct 6 20:01:36 2022 +0800 net: enetc: Remove duplicated include in enetc_qos.c net/pkt_sched.h is included twice in enetc_qos.c, remove one of them. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2334 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: David S. Miller commit 7305e7804d04eafff615a24e241aa6105101d48b Author: Yang Li Date: Thu Oct 6 19:44:00 2022 +0800 octeontx2-pf: mcs: remove unneeded semicolon Semicolon is not required after curly braces. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2332 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: David S. Miller commit 365e1ececb2905f94cc10a5817c5b644a32a3ae2 Author: Gaurav Kohli Date: Wed Oct 5 22:52:59 2022 -0700 hv_netvsc: Fix race between VF offering and VF association message from host During vm boot, there might be possibility that vf registration call comes before the vf association from host to vm. And this might break netvsc vf path, To prevent the same block vf registration until vf bind message comes from host. Cc: stable@vger.kernel.org Fixes: 00d7ddba11436 ("hv_netvsc: pair VF based on serial number") Reviewed-by: Haiyang Zhang Signed-off-by: Gaurav Kohli Signed-off-by: David S. Miller commit 30393181fdbc1608cc683b4ee99dcce05ffcc8c7 Author: Alexander Aring Date: Wed Oct 5 22:02:37 2022 -0400 net: ieee802154: return -EINVAL for unknown addr type This patch adds handling to return -EINVAL for an unknown addr type. The current behaviour is to return 0 as successful but the size of an unknown addr type is not defined and should return an error like -EINVAL. Fixes: 94160108a70c ("net/ieee802154: fix uninit value bug in dgram_sendmsg") Signed-off-by: Alexander Aring Signed-off-by: David S. Miller commit 87d1aa8b90d83b0084c7d9baadefaeaf928014c3 Author: Wenjia Zhang Date: Fri Oct 7 08:54:36 2022 +0200 MAINTAINERS: add Jan as SMC maintainer Add Jan as maintainer for Shared Memory Communications (SMC) Sockets. Acked-by: Jan Karcher Acked-by: Alexandra Winter Signed-off-by: Wenjia Zhang Signed-off-by: David S. Miller commit 444d8ad4916edec8a9fc684e841287db9b1e999f Author: Wei Yongjun Date: Mon Sep 19 16:08:30 2022 +0000 net: ieee802154: fix error return code in dgram_bind() Fix to return error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function. Fixes: 94160108a70c ("net/ieee802154: fix uninit value bug in dgram_sendmsg") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220919160830.1436109-1-weiyongjun@huaweicloud.com Signed-off-by: Stefan Schmidt commit 68fe1db04443cee58ddbeae9c506f7262b256168 Author: Alexander Aring Date: Wed Oct 5 22:02:37 2022 -0400 net: ieee802154: return -EINVAL for unknown addr type This patch adds handling to return -EINVAL for an unknown addr type. The current behaviour is to return 0 as successful but the size of an unknown addr type is not defined and should return an error like -EINVAL. Fixes: 94160108a70c ("net/ieee802154: fix uninit value bug in dgram_sendmsg") Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20221006020237.318511-1-aahringo@redhat.com Signed-off-by: Stefan Schmidt commit 2849752f36848359034616eb70dfc7fb14eb3cd4 Author: Juergen Gross Date: Thu Oct 6 10:50:28 2022 +0200 xen/pcifront: move xenstore config scanning into sub-function pcifront_try_connect() and pcifront_attach_devices() share a large chunk of duplicated code for reading the config information from Xenstore, which only differs regarding calling pcifront_rescan_root() or pcifront_scan_root(). Put that code into a new sub-function. It is fine to always call pcifront_rescan_root() from that common function, as it will fallback to pcifront_scan_root() if the domain/bus combination isn't known yet (and pcifront_scan_root() should never be called for an already known domain/bus combination anyway). In order to avoid duplicate messages for the fallback case move the check for domain/bus not known to the beginning of pcifront_rescan_root(). While at it fix the error reporting in case the root-xx node had the wrong format. As the return value of pcifront_try_connect() and pcifront_attach_devices() are not used anywhere make those functions return void. As an additional bonus this removes the dubious return of -EFAULT in case of an unexpected driver state. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk Signed-off-by: Juergen Gross commit 87f81e66e2e84c7e6056413703d732a99c20c09b Author: Jisheng Zhang Date: Mon Aug 29 22:57:42 2022 +0800 riscv: enable THP_SWAP for RV64 I have a Sipeed Lichee RV dock board which only has 512MB DDR, so memory optimizations such as swap on zram are helpful. As is seen in commit d0637c505f8a ("arm64: enable THP_SWAP for arm64") and commit bd4c82c22c367e ("mm, THP, swap: delay splitting THP after swapped out"), THP_SWAP can improve the swap throughput significantly. Enable THP_SWAP for RV64, testing the micro-benchmark which is introduced by commit d0637c505f8a ("arm64: enable THP_SWAP for arm64") shows below numbers on the Lichee RV dock board: swp out bandwidth w/o patch: 66908 bytes/ms (mean of 10 tests) swp out bandwidth w/ patch: 322638 bytes/ms (mean of 10 tests) Improved by 382%! Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220829145742.3139-1-jszhang@kernel.org/ Signed-off-by: Palmer Dabbelt commit 61a41d16ad20657f93613229a8b17766c51dc849 Author: Palmer Dabbelt Date: Tue Sep 20 13:45:18 2022 -0700 RISC-V: Print SSTC in canonical order This got out of order during a merge conflict, fix it by putting the entries in the correct order. Fixes: 7ab52f75a9cf ("RISC-V: Add Sstc extension support") Signed-off-by: Palmer Dabbelt Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220920204518.10988-1-palmer@rivosinc.com/ Signed-off-by: Palmer Dabbelt commit bafaf67c42f4b547bf4fb329ac6dcb28b05de15e Author: Dave Airlie Date: Fri Oct 7 12:40:50 2022 +1000 Revert "drm/sched: Use parent fence instead of finished" This reverts commit e4dc45b1848bc6bcac31eb1b4ccdd7f6718b3c86. This is causing instability on Linus' desktop, and I'm seeing oops with VK CTS runs. netconsole got me the following oops: [ 1234.778760] BUG: kernel NULL pointer dereference, address: 0000000000000088 [ 1234.778782] #PF: supervisor read access in kernel mode [ 1234.778787] #PF: error_code(0x0000) - not-present page [ 1234.778791] PGD 0 P4D 0 [ 1234.778798] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 1234.778803] CPU: 7 PID: 805 Comm: systemd-journal Not tainted 6.0.0+ #2 [ 1234.778809] Hardware name: System manufacturer System Product Name/PRIME X370-PRO, BIOS 5603 07/28/2020 [ 1234.778813] RIP: 0010:drm_sched_job_done.isra.0+0xc/0x140 [gpu_sched] [ 1234.778828] Code: aa 0f 1d ce e9 57 ff ff ff 48 89 d7 e8 9d 8f 3f ce e9 4a ff ff ff 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 55 53 48 89 fb <48> 8b af 88 00 00 00 f0 ff 8d f0 00 00 00 48 8b 85 80 01 00 00 f0 [ 1234.778834] RSP: 0000:ffffabe680380de0 EFLAGS: 00010087 [ 1234.778839] RAX: ffffffffc04e9230 RBX: 0000000000000000 RCX: 0000000000000018 [ 1234.778897] RDX: 00000ba278e8977a RSI: ffff953fb288b460 RDI: 0000000000000000 [ 1234.778901] RBP: ffff953fb288b598 R08: 00000000000000e0 R09: ffff953fbd98b808 [ 1234.778905] R10: 0000000000000000 R11: ffffabe680380ff8 R12: ffffabe680380e00 [ 1234.778908] R13: 0000000000000001 R14: 00000000ffffffff R15: ffff953fbd9ec458 [ 1234.778912] FS: 00007f35e7008580(0000) GS:ffff95428ebc0000(0000) knlGS:0000000000000000 [ 1234.778916] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1234.778919] CR2: 0000000000000088 CR3: 000000010147c000 CR4: 00000000003506e0 [ 1234.778924] Call Trace: [ 1234.778981] [ 1234.778989] dma_fence_signal_timestamp_locked+0x6a/0xe0 [ 1234.778999] dma_fence_signal+0x2c/0x50 [ 1234.779005] amdgpu_fence_process+0xc8/0x140 [amdgpu] [ 1234.779234] sdma_v3_0_process_trap_irq+0x70/0x80 [amdgpu] [ 1234.779395] amdgpu_irq_dispatch+0xa9/0x1d0 [amdgpu] [ 1234.779609] amdgpu_ih_process+0x80/0x100 [amdgpu] [ 1234.779783] amdgpu_irq_handler+0x1f/0x60 [amdgpu] [ 1234.779940] __handle_irq_event_percpu+0x46/0x190 [ 1234.779946] handle_irq_event+0x34/0x70 [ 1234.779949] handle_edge_irq+0x9f/0x240 [ 1234.779954] __common_interrupt+0x66/0x100 [ 1234.779960] common_interrupt+0xa0/0xc0 [ 1234.779965] [ 1234.779968] [ 1234.779971] asm_common_interrupt+0x22/0x40 [ 1234.779976] RIP: 0010:finish_mkwrite_fault+0x22/0x110 [ 1234.779981] Code: 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 41 55 41 54 55 48 89 fd 53 48 8b 07 f6 40 50 08 0f 84 eb 00 00 00 48 8b 45 30 48 8b 18 <48> 89 df e8 66 bd ff ff 48 85 c0 74 0d 48 89 c2 83 e2 01 48 83 ea [ 1234.779985] RSP: 0000:ffffabe680bcfd78 EFLAGS: 00000202 Revert it for now and figure it out later. Signed-off-by: Dave Airlie commit ef575281b21e9a34dfae544a187c6aac2ae424a9 Author: Tetsuo Handa Date: Sat Aug 27 00:27:46 2022 +0900 9p/trans_fd: always use O_NONBLOCK read/write syzbot is reporting hung task at p9_fd_close() [1], for p9_mux_poll_stop() from p9_conn_destroy() from p9_fd_close() is failing to interrupt already started kernel_read() from p9_fd_read() from p9_read_work() and/or kernel_write() from p9_fd_write() from p9_write_work() requests. Since p9_socket_open() sets O_NONBLOCK flag, p9_mux_poll_stop() does not need to interrupt kernel_read()/kernel_write(). However, since p9_fd_open() does not set O_NONBLOCK flag, but pipe blocks unless signal is pending, p9_mux_poll_stop() needs to interrupt kernel_read()/kernel_write() when the file descriptor refers to a pipe. In other words, pipe file descriptor needs to be handled as if socket file descriptor. We somehow need to interrupt kernel_read()/kernel_write() on pipes. A minimal change, which this patch is doing, is to set O_NONBLOCK flag from p9_fd_open(), for O_NONBLOCK flag does not affect reading/writing of regular files. But this approach changes O_NONBLOCK flag on userspace- supplied file descriptors (which might break userspace programs), and O_NONBLOCK flag could be changed by userspace. It would be possible to set O_NONBLOCK flag every time p9_fd_read()/p9_fd_write() is invoked, but still remains small race window for clearing O_NONBLOCK flag. If we don't want to manipulate O_NONBLOCK flag, we might be able to surround kernel_read()/kernel_write() with set_thread_flag(TIF_SIGPENDING) and recalc_sigpending(). Since p9_read_work()/p9_write_work() works are processed by kernel threads which process global system_wq workqueue, signals could not be delivered from remote threads when p9_mux_poll_stop() from p9_conn_destroy() from p9_fd_close() is called. Therefore, calling set_thread_flag(TIF_SIGPENDING)/recalc_sigpending() every time would be needed if we count on signals for making kernel_read()/kernel_write() non-blocking. Link: https://lkml.kernel.org/r/345de429-a88b-7097-d177-adecf9fed342@I-love.SAKURA.ne.jp Link: https://syzkaller.appspot.com/bug?extid=8b41a1365f1106fd0f33 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Tested-by: syzbot Reviewed-by: Christian Schoenebeck [Dominique: add comment at Christian's suggestion] Signed-off-by: Dominique Martinet commit 4c86114194e644b6da9107d75910635c9e87179e Merge: bc32a6330fb0e adc9c2e5a7230 Author: Linus Torvalds Date: Thu Oct 6 17:57:50 2022 -0700 Merge tag 'iomap-6.1-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap updates from Darrick Wong: "It's pretty quiet this time around -- a UAF bugfix and a new tracepoint so we can watch file writeback: - Fix a UAF bug when recording writeback mapping errors - Add a tracepoint so that we can monitor writeback mappings" * tag 'iomap-6.1-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: add a tracepoint for mappings returned by map_blocks iomap: iomap: fix memory corruption when recording errors during writeback commit bc32a6330fb0e90d1ce813c720d50098a41ec2e6 Merge: 7f198ba7ae987 1b45cc5c7b920 Author: Linus Torvalds Date: Thu Oct 6 17:45:53 2022 -0700 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "The first two changes involve files outside of fs/ext4: - submit_bh() can never return an error, so change it to return void, and remove the unused checks from its callers - fix I_DIRTY_TIME handling so it will be set even if the inode already has I_DIRTY_INODE Performance: - Always enable i_version counter (as btrfs and xfs already do). Remove some uneeded i_version bumps to avoid unnecessary nfs cache invalidations - Wake up journal waiters in FIFO order, to avoid some journal users from not getting a journal handle for an unfairly long time - In ext4_write_begin() allocate any necessary buffer heads before starting the journal handle - Don't try to prefetch the block allocation bitmaps for a read-only file system Bug Fixes: - Fix a number of fast commit bugs, including resources leaks and out of bound references in various error handling paths and/or if the fast commit log is corrupted - Avoid stopping the online resize early when expanding a file system which is less than 16TiB to a size greater than 16TiB - Fix apparent metadata corruption caused by a race with a metadata buffer head getting migrated while it was trying to be read - Mark the lazy initialization thread freezable to prevent suspend failures - Other miscellaneous bug fixes Cleanups: - Break up the incredibly long ext4_full_super() function by refactoring to move code into more understandable, smaller functions - Remove the deprecated (and ignored) noacl and nouser_attr mount option - Factor out some common code in fast commit handling - Other miscellaneous cleanups" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (53 commits) ext4: fix potential out of bound read in ext4_fc_replay_scan() ext4: factor out ext4_fc_get_tl() ext4: introduce EXT4_FC_TAG_BASE_LEN helper ext4: factor out ext4_free_ext_path() ext4: remove unnecessary drop path references in mext_check_coverage() ext4: update 'state->fc_regions_size' after successful memory allocation ext4: fix potential memory leak in ext4_fc_record_regions() ext4: fix potential memory leak in ext4_fc_record_modified_inode() ext4: remove redundant checking in ext4_ioctl_checkpoint jbd2: add miss release buffer head in fc_do_one_pass() ext4: move DIOREAD_NOLOCK setting to ext4_set_def_opts() ext4: remove useless local variable 'blocksize' ext4: unify the ext4 super block loading operation ext4: factor out ext4_journal_data_mode_check() ext4: factor out ext4_load_and_init_journal() ext4: factor out ext4_group_desc_init() and ext4_group_desc_free() ext4: factor out ext4_geometry_check() ext4: factor out ext4_check_feature_compatibility() ext4: factor out ext4_init_metadata_csum() ext4: factor out ext4_encoding_init() ... commit 7f198ba7ae9874c64ffe8cd3aa60cf5dab78ce3a Merge: 76e45035348c2 505ffcc852401 Author: Linus Torvalds Date: Thu Oct 6 17:42:29 2022 -0700 Merge tag 'affs-for-6.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull affs update from David Sterba: "One minor update for AFFS, switching away from strlcpy" * tag 'affs-for-6.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: affs: move from strlcpy with unused retval to strscpy commit 76e45035348c247a70ed50eb29a9906657e4444f Merge: 4c0ed7d8d6e3d cbddcc4fa3443 Author: Linus Torvalds Date: Thu Oct 6 17:36:48 2022 -0700 Merge tag 'for-6.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "There's a bunch of performance improvements, most notably the FIEMAP speedup, the new block group tree to speed up mount on large filesystems, more io_uring integration, some sysfs exports and the usual fixes and core updates. Summary: Performance: - outstanding FIEMAP speed improvement - algorithmic change how extents are enumerated leads to orders of magnitude speed boost (uncached and cached) - extent sharing check speedup (2.2x uncached, 3x cached) - add more cancellation points, allowing to interrupt seeking in files with large number of extents - more efficient hole and data seeking (4x uncached, 1.3x cached) - sample results: 256M, 32K extents: 4s -> 29ms (~150x) 512M, 64K extents: 30s -> 59ms (~550x) 1G, 128K extents: 225s -> 120ms (~1800x) - improved inode logging, especially for directories (on dbench workload throughput +25%, max latency -21%) - improved buffered IO, remove redundant extent state tracking, lowering memory consumption and avoiding rb tree traversal - add sysfs tunable to let qgroup temporarily skip exact accounting when deleting snapshot, leading to a speedup but requiring a rescan after that, will be used by snapper - support io_uring and buffered writes, until now it was just for direct IO, with the no-wait semantics implemented in the buffered write path it now works and leads to speed improvement in IOPS (2x), throughput (2.2x), latency (depends, 2x to 150x) - small performance improvements when dropping and searching for extent maps as well as when flushing delalloc in COW mode (throughput +5MB/s) User visible changes: - new incompatible feature block-group-tree adding a dedicated tree for tracking block groups, this allows a much faster load during mount and avoids seeking unlike when it's scattered in the extent tree items - this reduces mount time for many-terabyte sized filesystems - conversion tool will be provided so existing filesystem can also be updated in place - to reduce test matrix and feature combinations requires no-holes and free-space-tree (mkfs defaults since 5.15) - improved reporting of super block corruption detected by scrub - scrub also tries to repair super block and does not wait until next commit - discard stats and tunables are exported in sysfs (/sys/fs/btrfs/FSID/discard) - qgroup status is exported in sysfs (/sys/sys/fs/btrfs/FSID/qgroups/) - verify that super block was not modified when thawing filesystem Fixes: - FIEMAP fixes - fix extent sharing status, does not depend on the cached status where merged - flush delalloc so compressed extents are reported correctly - fix alignment of VMA for memory mapped files on THP - send: fix failures when processing inodes with no links (orphan files and directories) - fix race between quota enable and quota rescan ioctl - handle more corner cases for read-only compat feature verification - fix missed extent on fsync after dropping extent maps Core: - lockdep annotations to validate various transactions states and state transitions - preliminary support for fs-verity in send - more effective memory use in scrub for subpage where sector is smaller than page - block group caching progress logic has been removed, load is now synchronous - simplify end IO callbacks and bio handling, use chained bios instead of own tracking - add no-wait semantics to several functions (tree search, nocow, flushing, buffered write - cleanups and refactoring MM changes: - export balance_dirty_pages_ratelimited_flags" * tag 'for-6.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (177 commits) btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer btrfs: drop extent map range more efficiently btrfs: avoid pointless extent map tree search when flushing delalloc btrfs: remove unnecessary next extent map search btrfs: remove unnecessary NULL pointer checks when searching extent maps btrfs: assert tree is locked when clearing extent map from logging btrfs: remove unnecessary extent map initializations btrfs: remove the refcount warning/check at free_extent_map() btrfs: add helper to replace extent map range with a new extent map btrfs: move open coded extent map tree deletion out of inode eviction btrfs: use cond_resched_rwlock_write() during inode eviction btrfs: use extent_map_end() at btrfs_drop_extent_map_range() btrfs: move btrfs_drop_extent_cache() to extent_map.c btrfs: fix missed extent on fsync after dropping extent maps btrfs: remove stale prototype of btrfs_write_inode btrfs: enable nowait async buffered writes btrfs: assert nowait mode is not used for some btree search functions btrfs: make btrfs_buffered_write nowait compatible btrfs: plumb NOWAIT through the write path btrfs: make lock_and_cleanup_extent_if_need nowait compatible ... commit 4c0ed7d8d6e3dc013c4599a837de84794baa5b62 Merge: 1586a7036d3f0 88569546e8a13 Author: Linus Torvalds Date: Thu Oct 6 17:31:02 2022 -0700 Merge tag 'pull-path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs constification updates from Al Viro: "whack-a-mole: constifying struct path *" * tag 'pull-path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ecryptfs: constify path spufs: constify path nd_jump_link(): constify path audit_init_parent(): constify path __io_setxattr(): constify path do_proc_readlink(): constify path overlayfs: constify path fs/notify: constify path may_linkat(): constify path do_sys_name_to_handle(): constify path ->getprocattr(): attribute name is const char *, TYVM... commit 1586a7036d3f0e7dd29a3090b9dfa4eb2c15f12c Merge: ab29622157971 467cf8ef88d31 Author: Linus Torvalds Date: Thu Oct 6 17:26:56 2022 -0700 Merge tag 'pull-tomoyo' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull misc tomoyo changes from Al Viro: "A couple of assorted tomoyo patches" * tag 'pull-tomoyo' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: tomoyo: struct path it might get from LSM callers won't have NULL dentry or mnt tomoyo: use vsnprintf() properly commit ab296221579715fb8f36a27c374ebabe5bfb7e9e Merge: 7a3353c5c4411 4094d98e33758 Author: Linus Torvalds Date: Thu Oct 6 17:22:11 2022 -0700 Merge tag 'pull-file_inode' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull file_inode() updates from Al Vrio: "whack-a-mole: cropped up open-coded file_inode() uses..." * tag 'pull-file_inode' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: orangefs: use ->f_mapping _nfs42_proc_copy(): use ->f_mapping instead of file_inode()->i_mapping dma_buf: no need to bother with file_inode()->i_mapping nfs_finish_open(): don't open-code file_inode() bprm_fill_uid(): don't open-code file_inode() sgx: use ->f_mapping... exfat_iterate(): don't open-code file_inode(file) ibmvmc: don't open-code file_inode() commit 7a3353c5c441175582cf0d17f855b2ffd83fb9db Merge: 70df64d6c6c2f 47091e4ed9af6 Author: Linus Torvalds Date: Thu Oct 6 17:13:18 2022 -0700 Merge tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs file updates from Al Viro: "struct file-related stuff" * tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: dma_buf_getfile(): don't bother with ->f_flags reassignments Change calling conventions for filldir_t locks: fix TOCTOU race when granting write lease commit 70df64d6c6c2f76be47311fa6630d6edbefa711e Merge: 46811b5cb369f c4c8451147da5 Author: Linus Torvalds Date: Thu Oct 6 16:55:41 2022 -0700 Merge tag 'pull-d_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs d_path updates from Al Viro. * tag 'pull-d_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: d_path.c: typo fix... dynamic_dname(): drop unused dentry argument commit 46811b5cb369fe638665b805f3c84683f78e5379 Merge: ffb39098bf87d 2e488f13755ff Author: Linus Torvalds Date: Thu Oct 6 16:49:00 2022 -0700 Merge tag 'pull-inode' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs inode update from Al Viro: "Saner inode_init_always(), also fixing a nilfs problem" * tag 'pull-inode' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: fix UAF/GPF bug in nilfs_mdt_destroy commit 33331a728c83f380e53a3dbf2be0c1893da1d739 Merge: 8ad891ed435ba 4fe89d07dcc28 Author: Jason Gunthorpe Date: Thu Oct 6 19:47:03 2022 -0300 Merge tag 'v6.0' into rdma.git for-next Trvial merge conflicts against rdma.git for-rc resolved matching linux-next: drivers/infiniband/hw/hns/hns_roce_hw_v2.c drivers/infiniband/hw/hns/hns_roce_main.c https://lore.kernel.org/r/20220929124005.105149-1-broonie@kernel.org Signed-off-by: Jason Gunthorpe commit 0e00a3aeae255416577fc69b9b49be4778c05464 Merge: 17fc2a3f41b37 0e1fa5155a364 Author: Bjorn Helgaas Date: Thu Oct 6 16:06:56 2022 -0500 Merge branch 'for-linus' into next - Add Mahesh J Salgaonkar as EEH maintainer - Add Manivannan Sadhasivam as PCI Endpoint reviewer commit ffb39098bf87db327b2be4b5c6f1087bcba94ce9 Merge: dd42d9c3f461a 4e37057387cca Author: Linus Torvalds Date: Thu Oct 6 12:57:55 2022 -0700 Merge tag 'linux-kselftest-kunit-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: "Several documentation fixes, UML related cleanups, and a feature to enable/disable KUnit tests This includes the change to rename all_test_uml.config, and use it for '--alltests'. Note: if anyone was using all_tests_uml.config, this change breaks them. This change simplifies the usage and eliminates the need to type: --kunitconfig=tools/testing/kunit/configs/all_tests_uml.config A simple workaround to create a symlink to the new name can solve the problem for anyone using all_tests_uml.config. all_tests_uml.config should work across ~all architectures" * tag 'linux-kselftest-kunit-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: Kunit: Use full path to .kunitconfig kunit: tool: rename all_test_uml.config, use it for --alltests kunit: tool: remove UML specific options from all_tests_uml.config lib: stackinit: update reference to kunit-tool lib: overflow: update reference to kunit-tool Documentation: KUnit: update links in the index page Documentation: KUnit: add intro to the getting-started page Documentation: KUnit: Reword start guide for selecting tests Documentation: KUnit: add note about mrproper in start.rst Documentation: KUnit: avoid repeating "kunit.py run" in start.rst Documentation: KUnit: remove duplicated docs for kunit_tool Documentation: Kunit: Add ref for other kinds of tests Documentation: KUnit: Fix non-uml anchor Documentation: Kunit: Fix inconsistent titles Documentation: kunit: fix trivial typo kunit: no longer call module_info(test, "Y") for kunit modules kunit: add kunit.enable to enable/disable KUnit test kunit: tool: make --raw_output=kunit (aka --raw_output) preserve leading spaces commit dd42d9c3f461a7dc896076691ba42cf97225973e Merge: 93ed07a23fd08 83e14a57d59f2 Author: Linus Torvalds Date: Thu Oct 6 12:53:15 2022 -0700 Merge tag 'linux-kselftest-next-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest updates from Shuah Khan: "Fixes and new tests: - Add an amd-pstate-ut test module, used by kselftest to unit test amd-pstate functionality - Fixes and cleanups to to cpu-hotplug to delete the fault injection test code - Improvements to vm test to use top_srcdir for builds" * tag 'linux-kselftest-next-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: docs:kselftest: fix kselftest_module.h path of example module cpufreq: amd-pstate: Add explanation for X86_AMD_PSTATE_UT selftests/cpu-hotplug: Add log info when test success selftests/cpu-hotplug: Reserve one cpu online at least selftests/cpu-hotplug: Delete fault injection related code selftests/cpu-hotplug: Use return instead of exit selftests/cpu-hotplug: Correct log info cpufreq: amd-pstate: modify type in argument 2 for filp_open Documentation: amd-pstate: Add unit test introduction selftests: amd-pstate: Add test trigger for amd-pstate driver cpufreq: amd-pstate: Add test module for amd-pstate driver cpufreq: amd-pstate: Expose struct amd_cpudata selftests/vm: use top_srcdir instead of recomputing relative paths commit d79310700590b8b40d8c867012d6c899ea6fd505 Author: Ravi Bangoria Date: Thu Oct 6 21:09:46 2022 +0530 perf script: Add missing fields in usage hint A few fields are missing in the usage message printed when an unknown field option is passed. Add them to the list. Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-9-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit c72de11605c5e291981cd30225542169fb3da4df Author: Ravi Bangoria Date: Thu Oct 6 21:09:45 2022 +0530 perf mem: Print "LFB/MAB" for PERF_MEM_LVLNUM_LFB A hw component to track outstanding L1 Data Cache misses is called LFB (Line Fill Buffer) on Intel and Arm. However similar component exists on other arch with different names, for ex, it's called MAB (Miss Address Buffer) on AMD. Use 'LFB/MAB' instead of just 'LFB'. Signed-off-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-8-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 2c5f652c442600cfd86fc2a7a7cfd8152f254971 Author: Ravi Bangoria Date: Thu Oct 6 21:09:44 2022 +0530 perf mem/c2c: Avoid printing empty lines for unsupported events The 'perf mem' and 'perf c2c' tools can be used with 3 different events: load, store and combined load-store. Some architectures might support only partial set of events in which case, perf prints an empty line for unsupported events. Avoid that. Ex, AMD Zen cpus supports only combined load-store event and does not support individual load and store event. Before patch: $ perf mem record -e list mem-ldst : available $ After patch: $ perf mem record -e list mem-ldst : available $ Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-7-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit f7b58cbdb3ff36eba8622e67eee66c10dd1c9995 Author: Ravi Bangoria Date: Thu Oct 6 21:09:43 2022 +0530 perf mem/c2c: Add load store event mappings for AMD The 'perf mem' and 'perf c2c' tools are wrappers around 'perf record' with mem load/ store events. IBS tagged load/store sample provides most of the information needed for these tools. Wire in the "ibs_op//" event as mem-ldst event for AMD. There are some limitations though: Only load/store micro-ops provide mem/c2c information. Whereas, IBS does not have a way to choose a particular type of micro-op to tag. This results in many non-LS micro-ops being tagged which appear as N/A in the perf report. IBS, being an uncore pmu from kernel point of view[1], does not support per process monitoring. Thus, perf mem/c2c on AMD are currently supported in per-cpu mode only. Example: $ sudo perf mem record -- -c 10000 ^C[ perf record: Woken up 227 times to write data ] [ perf record: Captured and wrote 58.760 MB perf.data (836978 samples) ] $ sudo perf mem report -F mem,sample,snoop Samples: 836K of event 'ibs_op//', Event count (approx.): 8418762 Memory access Samples Snoop N/A 700620 N/A L1 hit 126675 N/A L2 hit 424 N/A L3 hit 664 HitM L3 hit 10 N/A Local RAM hit 2 N/A Remote RAM (1 hop) hit 8558 N/A Remote Cache (1 hop) hit 3 N/A Remote Cache (1 hop) hit 2 HitM Remote Cache (2 hops) hit 10 HitM Remote Cache (2 hops) hit 6 N/A Uncached hit 4 N/A $ [1]: https://lore.kernel.org/lkml/20220829113347.295-1-ravi.bangoria@amd.com Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-6-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 4173cc055dc92f199a43775775e54dc7fafd37b6 Author: Ravi Bangoria Date: Thu Oct 6 21:09:42 2022 +0530 perf mem/c2c: Set PERF_SAMPLE_WEIGHT for LOAD_STORE events Currently perf sets PERF_SAMPLE_WEIGHT flag only for mem load events. Set it for combined load-store event as well which will enable recording of load latency by default on arch that does not support independent mem load event. Also document missing -W in perf-record man page. Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-5-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 923396f6827d00ef18c1bf589551e5a604191261 Author: Ravi Bangoria Date: Thu Oct 6 21:09:41 2022 +0530 perf mem: Add support for printing PERF_MEM_LVLNUM_{CXL|IO} Add support for printing these new fields in perf mem report. Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-4-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 160ae99365abeac216aeaa3407dce6cf038037e1 Author: Ravi Bangoria Date: Thu Oct 6 21:09:40 2022 +0530 perf amd ibs: Sync arch/x86/include/asm/amd-ibs.h header with the kernel Although new details added into this header is currently used by kernel only, tools copy needs to be in sync with kernel file to avoid tools/perf/check-headers.sh warnings. Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-3-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit b7ddd38ccc723f0dca68151baed1e6c07c2a6005 Author: Ravi Bangoria Date: Thu Oct 6 21:09:39 2022 +0530 tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel Two new fields for mem_lvl_num has been introduced: PERF_MEM_LVLNUM_IO and PERF_MEM_LVLNUM_CXL which are required to support perf mem/c2c on AMD platform. Signed-off-by: Ravi Bangoria Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ananth Narayan Cc: Andi Kleen Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ian Rogers Cc: Ingo Molnar Cc: Joe Mario Cc: Kan Liang Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Thomas Gleixner Cc: x86@kernel.org Link: https://lore.kernel.org/r/20221006153946.7816-2-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 93ed07a23fd08b8613f64cf0a15d7fbdaca010fd Merge: 18fd049731e67 e19d4ebc536da Author: Linus Torvalds Date: Thu Oct 6 12:10:37 2022 -0700 Merge tag 'asm-generic-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic updates from Arnd Bergmann: "This contains a series from Linus Walleij to unify the linux/io.h interface by making the ia64, alpha, parisc and sparc include asm-generic/io.h. All functions provided by the generic header are now available to all drivers, but the architectures can still override this. For the moment, mips and sh still don't include asm-generic/io.h but provide a full set of functions themselves. There are also a few minor cleanups unrelated to this" * tag 'asm-generic-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: alpha: add full ioread64/iowrite64 implementation parisc: Drop homebrewn io[read|write]64_[lo_hi|hi_lo] parisc: hide ioread64 declaration on 32-bit ia64: export memory_add_physaddr_to_nid to fix cxl build error asm-generic: Remove empty #ifdef SA_RESTORER parisc: Use the generic IO helpers parisc: Remove 64bit access on 32bit machines sparc: Fix the generic IO helpers alpha: Use generic commit 18fd049731e67651009f316195da9281b756f2cf Merge: 41fc64a0550b8 d2995249a2f72 Author: Linus Torvalds Date: Thu Oct 6 11:51:49 2022 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: - arm64 perf: DDR PMU driver for Alibaba's T-Head Yitian 710 SoC, SVE vector granule register added to the user regs together with SVE perf extensions documentation. - SVE updates: add HWCAP for SVE EBF16, update the SVE ABI documentation to match the actual kernel behaviour (zeroing the registers on syscall rather than "zeroed or preserved" previously). - More conversions to automatic system registers generation. - vDSO: use self-synchronising virtual counter access in gettimeofday() if the architecture supports it. - arm64 stacktrace cleanups and improvements. - arm64 atomics improvements: always inline assembly, remove LL/SC trampolines. - Improve the reporting of EL1 exceptions: rework BTI and FPAC exception handling, better EL1 undefs reporting. - Cortex-A510 erratum 2658417: remove BF16 support due to incorrect result. - arm64 defconfig updates: build CoreSight as a module, enable options necessary for docker, memory hotplug/hotremove, enable all PMUs provided by Arm. - arm64 ptrace() support for TPIDR2_EL0 (register provided with the SME extensions). - arm64 ftraces updates/fixes: fix module PLTs with mcount, remove unused function. - kselftest updates for arm64: simple HWCAP validation, FP stress test improvements, validation of ZA regs in signal handlers, include larger SVE and SME vector lengths in signal tests, various cleanups. - arm64 alternatives (code patching) improvements to robustness and consistency: replace cpucap static branches with equivalent alternatives, associate callback alternatives with a cpucap. - Miscellaneous updates: optimise kprobe performance of patching single-step slots, simplify uaccess_mask_ptr(), move MTE registers initialisation to C, support huge vmalloc() mappings, run softirqs on the per-CPU IRQ stack, compat (arm32) misalignment fixups for multiword accesses. * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (126 commits) arm64: alternatives: Use vdso/bits.h instead of linux/bits.h arm64/kprobe: Optimize the performance of patching single-step slot arm64: defconfig: Add Coresight as module kselftest/arm64: Handle EINTR while reading data from children kselftest/arm64: Flag fp-stress as exiting when we begin finishing up kselftest/arm64: Don't repeat termination handler for fp-stress ARM64: reloc_test: add __init/__exit annotations to module init/exit funcs arm64/mm: fold check for KFENCE into can_set_direct_map() arm64: ftrace: fix module PLTs with mcount arm64: module: Remove unused plt_entry_is_initialized() arm64: module: Make plt_equals_entry() static arm64: fix the build with binutils 2.27 kselftest/arm64: Don't enable v8.5 for MTE selftest builds arm64: uaccess: simplify uaccess_mask_ptr() arm64: asm/perf_regs.h: Avoid C++-style comment in UAPI header kselftest/arm64: Fix typo in hwcap check arm64: mte: move register initialization to C arm64: mm: handle ARM64_KERNEL_USES_PMD_MAPS in vmemmap_populate() arm64: dma: Drop cache invalidation from arch_dma_prep_coherent() arm64/sve: Add Perf extensions documentation ... commit 41fc64a0550b86f4428e8d3fa23ab97678a65ae8 Merge: 7171a8da00035 ef2fb84c130b0 Author: Linus Torvalds Date: Thu Oct 6 11:22:25 2022 -0700 Merge tag 'arm-soc-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "The main changes this time are for the organization of the Kconfig files, introducing per-vendor top-level options on arm64 to match those on arm32, and making the platform selection on arm32 more uniform, in particular for the remaining StrongARM platforms that still have a couple of special cases compared to the more recent ones. I also did a cleanup of the old Footbridge platform, which was the last holdout for the phys_to_dma()/dma_to_phys() interface that is now completely gone from arm32, completing work started by Christoph Hellwig" * tag 'arm-soc-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (21 commits) ARM: aspeed: Kconfig: Fix indentation ARM: Drop CMDLINE_* dependency on ATAGS ARM: Drop CMDLINE_FORCE dependency on !ARCH_MULTIPLATFORM ARM: s3c: remove orphan declarations from arch/arm/mach-s3c/devs.h pxa: Drop if with an always false condition ARM: orion: fix include path ARM: shmobile: Drop selecting SOC_BUS arm64: renesas: Drop selecting SOC_BUS ARM: disallow PCI with MMU=n again ARM: footbridge: remove custom DMA address handling MAINTAINERS: Add BCM4908 maintainer to BCMBCA entry ARM: footbridge: move isa-dma support into footbridge ARM: footbridge: remove leftover from personal-server ARM: footbridge: remove addin mode arm64: Kconfig.platforms: Group NXP platforms together arm64: Kconfig.platforms: Re-organized Broadcom menu ARM: make ARCH_MULTIPLATFORM user-visible ARM: fix XIP_KERNEL dependencies ARM: Kconfig: clean up platform selection ARM: simplify machdirs/platdirs handling ... commit 7171a8da00035e7913c3013ca5fb5beb5b8b22f0 Merge: ff6862c23d2e8 114b9da7ebd96 Author: Linus Torvalds Date: Thu Oct 6 11:13:04 2022 -0700 Merge tag 'arm-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM devicetree updates from Arnd Bergmann: "Most of the changes fall into one of three categories: adding support for additional devices on existing machines, cleaning up issues found by the ongoing conversion to machine-readable bindings, and addressing minor mistakes in the existing DT data. Across SoC vendors, Qualcomm and Freescale stick out as getting the most updates, which corresponds to their dominance in the mobile phone and embedded industrial markets, respectively. There are 636 non-merge changeset in this branch, which is a little lower than most times, but more importantly we only add 36 machine files, which is about half of what we had the past few releases. Eight new SoCs are added, but all of them are variations of already supported SoC families, and most of them come with one reference board design from the SoC vendor: - Mediatek MT8186 is a Chromebook/Tablet type SoC, similar to the MT65xx series of phone SoCs, with two Cortex-A76 and six Cortex-A55 cores. - TI AM62A is another member of the K3 family with Cortex-A53 cores, this one is targetted at Video/Vision processing for industrial and automotive applications. - NXP i.MX8DXL is another chip for this market in the ever-growing i.MX8 family, this one again with two Cortex-A35 cores. - Renesas R-Car H3Ne-1.7G (R8A779MB) and R-Car V3H2 (R8A77980A) are minor updates of R8A77951 and R8A77980, respectively. - Qualcomm IPQ8064-v2.0, IPQ8062 and IPQ8065 are all variants of the IPQ8064 chip, with minimally different features. The AMD Pensando Elba and Apple M1 Ultra SoC support was getting close this time, but in the end did not make the cut. The new machines based on existing SoC support are fairly uneventful: - Sony Xperia 1 IV is a fairly recent phone based on Qualcomm Snapdragon 8 Gen 1. - Three Samsung phones based on Snapdragon 410: Galaxy E5, E7 and Grand Max. These are added for both 32-bit and 64-bit kernels, as they originally shipped running 32-bit code. - Two new servers using AST2600 BMCs: AMD DaytonaX and Ampere Mt. Mitchell - Three new machines based on Rockchips RK3399 and RK3566: Anberic RG353P and RG503, Pine64 Pinephone Pro, Open AI Lab - Multiple NXP i.MX6/i.MX8 based boards: Kontron SL/BL i.MX8MM OSM-S, i.MX8MM Gateworks GW7904, MSC SM2S-IMX8PLUS SoM and carrier board - Two development boards in the Microchip AT91 family: SAMA5D3-EDS and lan966x-pcb8290. - Minor variants of existing boards using Amlogic, Broadcom, Marvell, Rockchips, Freescale Layerscape and Socionext Uniphier SoCs" * tag 'arm-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (617 commits) Revert "ARM: dts: BCM5301X: Add basic PCI controller properties" ARM: dts: s5pv210: correct double "pins" in pinmux node ARM: dts: exynos: fix polarity of VBUS GPIO of Origen arm64: dts: exynos: fix polarity of "enable" line of NFC chip in TM2 arm64: dts: uniphier: Add L2 cache node arm64: dts: uniphier: Remove compatible "snps,dw-pcie" from pcie node arm64: dts: uniphier: Fix opp-table node name for LD20 arm64: dts: uniphier: Add USB-device support for PXs3 reference board arm64: dts: uniphier: Add ahci controller nodes for PXs3 arm64: dts: uniphier: Use GIC interrupt definitions arm64: dts: uniphier: Rename gpio-hog nodes arm64: dts: uniphier: Rename usb-glue node for USB3 to usb-controller arm64: dts: uniphier: Rename usb-phy node for USB2 to usb-controller arm64: dts: uniphier: Rename pvtctl node to thermal-sensor ARM: dts: uniphier: Remove compatible "snps,dw-pcie-ep" from pcie-ep node ARM: dts: uniphier: Move interrupt-parent property to each child node in uniphier-support-card ARM: dts: uniphier: Add ahci controller nodes for PXs2 ARM: dts: uniphier: Add ahci controller nodes for Pro4 ARM: dts: uniphier: Use GIC interrupt definitions ARM: dts: uniphier: Rename gpio-hog node ... commit ff6862c23d2e83d12d1759bf4337d41248fb4dc8 Merge: 40285e64c5654 4413794917ba3 Author: Linus Torvalds Date: Thu Oct 6 11:04:57 2022 -0700 Merge tag 'arm-drivers-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM driver updates from Arnd Bergmann: "The drivers branch for 6.1 is a bit larger than for most releases. Most of the changes come from SoC maintainers for the drivers/soc subsystem: - A new driver for error handling on the NVIDIA Tegra 'control backbone' bus. - A new driver for Qualcomm LLCC/DDR bandwidth measurement - New Rockchip rv1126 and rk3588 power domain drivers - DT binding updates for memory controllers, older Rockchip SoCs, various Mediatek devices, Qualcomm SCM firmware - Minor updates to Hisilicon LPC bus, the Allwinner SRAM driver, the Apple rtkit firmware driver, Tegra firmware - Minor updates for SoC drivers (Samsung, Mediatek, Renesas, Tegra, Qualcomm, Broadcom, NXP, ...) There are also some separate subsystem with downstream maintainers that merge updates this way: - Various updates and new drivers in the memory controller subsystem for Mediatek and Broadcom SoCs - Small set of changes in preparation to add support for FF-A v1.1 specification later, in the Arm FF-A firmware subsystem - debugfs support in the PSCI firmware subsystem" * tag 'arm-drivers-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (149 commits) ARM: remove check for CONFIG_DEBUG_LL_SER3 firmware/psci: Add debugfs support to ease debugging firmware/psci: Print a warning if PSCI doesn't accept PC mode dt-bindings: memory: snps,dw-umctl2-ddrc: Extend schema with IRQs/resets/clocks props dt-bindings: memory: snps,dw-umctl2-ddrc: Replace opencoded numbers with macros dt-bindings: memory: snps,dw-umctl2-ddrc: Use more descriptive device name dt-bindings: memory: synopsys,ddrc-ecc: Detach Zynq DDRC controller support soc: sunxi: sram: Add support for the D1 system control soc: sunxi: sram: Export the LDO control register soc: sunxi: sram: Save a pointer to the OF match data soc: sunxi: sram: Return void from the release function soc: apple: rtkit: Add apple_rtkit_poll soc: imx: add i.MX93 media blk ctrl driver soc: imx: add i.MX93 SRC power domain driver soc: imx: imx8m-blk-ctrl: Use genpd_xlate_onecell soc: imx: imx8mp-blk-ctrl: handle PCIe PHY resets soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV_MWR soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl soc: imx: add icc paths for i.MX8MP media blk ctrl ... commit cad3b68954134f6b871e76d9b39354e8d9a53db5 Author: Athira Rajeev Date: Thu Oct 6 17:12:25 2022 +0530 perf stat: Fix cpu check to use id.cpu.cpu in aggr_printout() 'perf stat' has options to aggregate the counts in different modes like per socket, per core etc. The function "aggr_printout" in util/stat-display.c which is used to print the aggregates, has a check for cpu in case of AGGR_NONE. This check was originally using condition : "if (id.cpu.cpu > -1)". But this got changed after commit df936cadfb58 ("perf stat: Add JSON output option"), which added option to output json format for different aggregation modes. After this commit, the check in "aggr_printout" is using "if (id.core > -1)". The old code was using "id.cpu.cpu > -1" while the new code is using "id.core > -1". But since the value printed is id.cpu.cpu, fix this check to use cpu and not core. Suggested-by: Ian Rogers Suggested-by: James Clark Signed-off-by: Athira Jajeev Tested-by: Ian Rogers Cc: Disha Goel Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20221006114225.66303-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit dc2e0fb00bb2b24f0b6c4877c34bb1d288d31fb2 Author: Carsten Haitzler Date: Fri Sep 9 16:28:03 2022 +0100 perf test coresight: Add relevant documentation about ARM64 CoreSight testing Add/improve documentation helping people get started with CoreSight and perf as well as describe the testing and how it works. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/20220909152803.2317006-14-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 43c688cb32412e4466d0be614e9d6003ae4cf451 Author: Carsten Haitzler Date: Fri Sep 9 16:28:02 2022 +0100 perf test: Add git ignore for tmp and output files of ARM CoreSight tests Ignore other output files of the new CoreSight tests so they don't fill git status with noise we don't need or want. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-13-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b65c6477f6bb1147e34164bb8580138daa12ddab Author: Carsten Haitzler Date: Fri Sep 9 16:28:01 2022 +0100 perf test coresight: Add unroll thread test shell script This adds scripts to drive the unroll thread tests to compare perf output against a minimum bar of content/quality. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-12-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit fc0a0ea039802e1546c19b8514fd2efee43d10b5 Author: Carsten Haitzler Date: Fri Sep 9 16:28:00 2022 +0100 perf test coresight: Add unroll thread test tool Add test tool to be driven by further test scripts. This is a simple C based test that is for arm64 with some inline ASM to manually unroll a lot of code to have a very long sequence of commands. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-11-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 74c62b8d6161678b72854d95e47b41782dfec39a Author: Carsten Haitzler Date: Fri Sep 9 16:27:59 2022 +0100 perf test coresight: Add thread loop test shell scripts Add a script to drive the thread loop test that gathers data so it passes a minimum bar (in this case do we get any perf context data for every thread). Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-10-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit e9664b96c6c0d7f3bac45d1141afacec45725169 Author: Carsten Haitzler Date: Fri Sep 9 16:27:58 2022 +0100 perf test coresight: Add thread loop test tool Add test tool to be driven by further test scripts. This is a simple C based loop with threads test to drive from scripts that can output TIDs for tracking/checking. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-9-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b76692fea7f29f80b88d52dcfa9f994b76337988 Author: Carsten Haitzler Date: Fri Sep 9 16:27:57 2022 +0100 perf test coresight: Add memcpy thread test shell script Add a script to drive the threaded memcpy test that gathers data so it passes a minimum bar for amount and quality of content that we extract from the kernel's perf support. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-8-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f1288bdb6d48324e46406230ebd70190ec815fbb Author: Carsten Haitzler Date: Fri Sep 9 16:27:56 2022 +0100 perf test coresight: Add memcpy thread test tool Add test tool to be driven by further test scripts. This is a simple C based memcpy with threads test to drive from scripts. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-7-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6ea586b1e3dc56e831488f1c80acdf21f301b6b6 Author: Carsten Haitzler Date: Fri Sep 9 16:27:55 2022 +0100 perf test: Add git ignore for perf data generated by the ARM CoreSight tests Ignore perf output data files generated by perf tests for cleaner git status. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-6-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit fdc25cc59c7126952f04beafb0de6143a7fa574d Author: Carsten Haitzler Date: Fri Sep 9 16:27:54 2022 +0100 perf test: Add arm64 asm pureloop test shell script Add a script to drive the asm pureloop test for arm64/CoreSight that gathers data so it passes a minimum bar for amount and quality of content that we extract from the kernel's perf support. Committer notes: Add the install of tests/shell/coresight/*.sh to tools/perf/Makefile.perf as we're starting to populate that dir. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-5-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 8b97519711c3a0f9eb8274a227dff3fe4f0f72a2 Author: Carsten Haitzler Date: Fri Sep 9 16:27:53 2022 +0100 perf test: Add asm pureloop test tool Add test tool to be driven by further test scripts. This tool is pure arm64 ASM with no libc usage to ensure it is the same exact binary/code every time so it can also be re-used for many uses. It just loops for a given fixed number of loops. Reviewed-by: James Clark Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-4-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 34bec35cbbb23e5fd18100f2a2b217ebb6cb129c Author: Carsten Haitzler Date: Fri Sep 9 16:27:52 2022 +0100 perf test: Add build infra for perf test tools for ARM CoreSight tests This adds the initial build infrastructure (makefiles maintainers information) for adding follow-on tests for CoreSight. Committer notes: Remove the installation of tests/shell/coresight/*.sh, as there are no files there yet and thus, at this point, make install fails. Use $(QUIET_CLEAN) to avoid having extraneous output in the 'make clean' output. Also use @$(MAKE) in tools/perf/tests/shell/coresight/Makefile as $(Q) is not turning into @ when V=1 isn't used, i.e. in the default case it is not being quiet. The >/dev/null in the all for tools/perf/tests/shell/coresight/Makefile is to avoid this: make[4]: Nothing to be done for 'all'. make[4]: Nothing to be done for 'all'. make[4]: Nothing to be done for 'all'. DESCEND plugins GEN /tmp/build/perf/python/perf.so make[4]: Nothing to be done for 'all'. INSTALL trace_plugins On !arm64 where nothing is done on the main target for tools/perf/tests/shell/coresight/*/Makefile. Signed-off-by: Carsten Haitzler Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20220909152803.2317006-3-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 40285e64c5654c956505dad34ed2ee4be163b1f0 Merge: 7782aae498b92 25631f1fec2a1 Author: Linus Torvalds Date: Thu Oct 6 10:38:24 2022 -0700 Merge tag 'arm-defconfig-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "As usual, we enable newly added device drivers in the various defconfig files. This time, there is also a larger cleanup series that just reorders symbols according to what 'make savedefconfig' outputs and then tracks down the most common removed or renamed symbols on top" * tag 'arm-defconfig-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (43 commits) ARM: config: aspeed_g5: Enable PECI ARM: configs: aspeed_g4: Remove appended DTB and ATAG ARM: configs: aspeed: Refresh defconfigs ARM: config: aspeed: Enable namespaces ARM: configs: aspeed_g4: Enable IPV6 options ARM: configs: aspeed_g4: Enable OCC and NBD drivers ARM: configs: aspeed_g5: Enable MCTP stack ARM: configs: aspeed_g5: Add PL2303 USB serial driver ARM: configs: aspeed_g5: Add TPM TIS I2C driver ARM: configs: aspeed_g5: Add mp5023 driver ARM: configs: aspeed: Add support for USB flash drives arm64: configs: Enable all PMUs provided by Arm arm64: defconfig: Enable Synopsys DWC MSHC driver arm64: defconfig: Enabled SC8180x configs arm64: defconfig: Make TEGRA186_GPC_DMA built-in arm64: tegra: Enable Tegra SPI & QSPI in deconfig arm64: defconfig: enable newer Qualcomm SoC sound drivers ARM: config: ixp4xx: Disable legacy EEPROM driver arm64: defconfig: Enable devfreq cooling device arm64: defconfig: enable ARCH_NXP ... commit 7782aae498b92f124267b366293100d121fe0f56 Merge: 833477fce7a14 e66372ecb80dc Author: Linus Torvalds Date: Thu Oct 6 10:32:34 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - Print an un-hashed userspace PC on undefined instruction exception - Disable FDPIC ABI - Remove redundant vfp_flush/release_thread functions - Use raw_cpu_* rather than this_cpu_* in handle_bad_stack() - Avoid needlessly long backtraces when show_regs() is called - Fix an issue with stack traces through call_with_stack() - Avoid stack traces saving a duplicate exception PC value - Pass a void pointer to virt_to_page() in DMA mapping code - Fix kasan maps for modules when CONFIG_KASAN_VMALLOC=n - Show FDT region and page table level names in kernel page tables dump * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9246/1: dump: show page table level name ARM: 9245/1: dump: show FDT region ARM: 9242/1: kasan: Only map modules if CONFIG_KASAN_VMALLOC=n ARM: 9240/1: dma-mapping: Pass (void *) to virt_to_page() ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value ARM: 9233/1: stacktrace: Skip frame pointer boundary check for call_with_stack() ARM: 9224/1: Dump the stack traces based on the parameter 'regs' of show_regs() ARM: 9232/1: Replace this_cpu_* with raw_cpu_* in handle_bad_stack() ARM: 9228/1: vfp: kill vfp_flush/release_thread() ARM: 9226/1: disable FDPIC ABI ARM: 9221/1: traps: print un-hashed user pc on undefined instruction commit 17d819e2828cacca2e4c909044eb9798ed379cd2 Author: Hamza Mahfooz Date: Wed Oct 5 11:30:38 2022 -0400 Revert "drm/amdgpu: use dirty framebuffer helper" This reverts commit 66f99628eb24409cb8feb5061f78283c8b65f820. Unfortunately, that commit causes performance regressions on non-PSR setups. So, just revert it until FB_DAMAGE_CLIPS support can be added. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2189 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216554 Fixes: 66f99628eb2440 ("drm/amdgpu: use dirty framebuffer helper") Fixes: abbc7a3dafb91b ("drm/amdgpu: don't register a dirty callback for non-atomic") Signed-off-by: Hamza Mahfooz Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2302d507149f0ae7cc697089ab5675a2d4cf9d2a Author: Philip Yang Date: Mon Oct 3 17:53:25 2022 -0400 drm/amdgpu: Correct amdgpu_amdkfd_total_mem_size calculation amdkfd_total_mem_size is the size of total GPUs vram plus system memory to estimate page tables memory usage and leave enough VRAM room for page tables allocation. Calculate amdkfd_total_mem_size in amdgpu_amdkfd_device_probe is incorrect because adev->gmc.real_vram_size is still 0 called from amdgpu_device_ip_early_init. Move the calculation to amdgpu_amdkfd_device_init to get the correct VRAM size. Do reverse calculation in amdgpu_amdkfd_device_fini_sw to support hot-unplugging GPUs. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9a3c6067bd2ee2ca2652fbb0679f422f3c9109f9 Author: Philip Yang Date: Mon Oct 3 13:03:26 2022 -0400 drm/amdgpu: Set vmbo destroy after pt bo is created Under VRAM usage pression, map to GPU may fail to create pt bo and vmbo->shadow_list is not initialized, then ttm_bo_release calling amdgpu_bo_vm_destroy to access vmbo->shadow_list generates below dmesg and NULL pointer access backtrace: Set vmbo destroy callback to amdgpu_bo_vm_destroy only after creating pt bo successfully, otherwise use default callback amdgpu_bo_destroy. amdgpu: amdgpu_vm_bo_update failed amdgpu: update_gpuvm_pte() failed amdgpu: Failed to map bo to gpuvm amdgpu 0000:43:00.0: amdgpu: Failed to map peer:0000:43:00.0 mem_domain:2 BUG: kernel NULL pointer dereference, address: RIP: 0010:amdgpu_bo_vm_destroy+0x4d/0x80 [amdgpu] Call Trace: ttm_bo_release+0x207/0x320 [amdttm] amdttm_bo_init_reserved+0x1d6/0x210 [amdttm] amdgpu_bo_create+0x1ba/0x520 [amdgpu] amdgpu_bo_create_vm+0x3a/0x80 [amdgpu] amdgpu_vm_pt_create+0xde/0x270 [amdgpu] amdgpu_vm_ptes_update+0x63b/0x710 [amdgpu] amdgpu_vm_update_range+0x2e7/0x6e0 [amdgpu] amdgpu_vm_bo_update+0x2bd/0x600 [amdgpu] update_gpuvm_pte+0x160/0x420 [amdgpu] amdgpu_amdkfd_gpuvm_map_memory_to_gpu+0x313/0x1130 [amdgpu] kfd_ioctl_map_memory_to_gpu+0x115/0x390 [amdgpu] kfd_ioctl+0x24a/0x5b0 [amdgpu] Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 312b4dc11d4f74bfe03ea25ffe04c1f2fdd13cb9 Author: Arunpravin Paneer Selvam Date: Tue Oct 4 07:33:39 2022 -0700 drm/amdgpu: Fix VRAM BO swap issue DRM buddy manager allocates the contiguous memory requests in a single block or multiple blocks. So for the ttm move operation (incase of low vram memory) we should consider all the blocks to compute the total memory size which compared with the struct ttm_resource num_pages in order to verify that the blocks are contiguous for the eviction process. v2: Added a Fixes tag v3: Rewrite the code to save a bit of calculations and variables (Christian) Fixes: c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu") Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7e4ab9fb2b9449ef01977e79157d06c8900f73fd Author: Yuan Can Date: Tue Sep 27 13:39:08 2022 +0000 drm/amd/display: Remove unused struct i2c_id_config_access After commit 5a8132b9f606 ("drm/amd/display: remove dead dc vbios code"), no one use struct i2c_id_config_access, so remove it. Reviewed-by: Rodrigo Siqueira Signed-off-by: Yuan Can Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 5e69732d4a89928b7daaa651ad869cebee28bfff Author: Dong Chenchen Date: Fri Sep 30 14:38:27 2022 +0800 drm/amd/display: Removed unused variable 'sdp_stream_enable' Kernel test robot throws below warning -> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c: In function 'dcn31_hpo_dp_stream_enc_update_dp_info_packets': drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c:439:14: warning: variable 'sdp_stream_enable' set but not used [-Wunused-but-set-variable] 439 | bool sdp_stream_enable = false; Removed unused variable 'sdp_stream_enable'. Reviewed-by: Rodrigo Siqueira Reported-by: kernel test robot Signed-off-by: Dong Chenchen Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7d30ccc7761cfcd6756aa0b760c5f5493038d30a Author: Randy Dunlap Date: Fri Sep 30 21:33:54 2022 -0700 drm/amd/display: clean up dcn32_fpu.c kernel-doc Rectify multiple kernel-doc warnings in dcn32_fpu.c. E.g.: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:247: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Finds dummy_latency_index when MCLK switching using firmware based drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:484: warning: Function parameter or member 'phantom_stream' not described in 'dcn32_set_phantom_stream_timing' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:601: warning: Function parameter or member 'dc' not described in 'dcn32_assign_subvp_pipe' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:601: warning: Function parameter or member 'context' not described in 'dcn32_assign_subvp_pipe' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:601: warning: Function parameter or member 'index' not described in 'dcn32_assign_subvp_pipe' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2140: warning: Function parameter or member 'dc' not described in 'dcn32_update_bw_bounding_box_fpu' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2140: warning: Function parameter or member 'bw_params' not described in 'dcn32_update_bw_bounding_box_fpu' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2140: warning: expecting prototype for dcn32_update_bw_bounding_box(). Prototype was for dcn32_update_bw_bounding_box_fpu() instead Reviewed-by: Rodrigo Siqueira Reported-by: kernel test robot Signed-off-by: Randy Dunlap Signed-off-by: Rodrigo Siqueira Cc: George Shen Cc: Alvin Lee Cc: Nevenko Stupar Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Signed-off-by: Alex Deucher commit 8799c0be89ebb99a16098bdf618f49f817bef76a Author: Yunxiang Li Date: Wed Sep 21 17:20:19 2022 -0400 drm/amd/display: Fix vblank refcount in vrr transition manage_dm_interrupts disable/enable vblank using drm_crtc_vblank_off/on which causes drm_crtc_vblank_get in vrr_transition to fail, and later when drm_crtc_vblank_put is called the refcount on vblank will be messed up. Therefore move the call to after manage_dm_interrupts. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1247 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1380 Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Signed-off-by: Yunxiang Li Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f6aa84b83aee629fbbbc4ea16c2c142caf920d5a Author: Roman Li Date: Thu Sep 29 14:37:00 2022 -0400 drm/amd/display: Enable dpia support for dcn314 [Why] DCN 3.1.4 supports DPIA. [How] - Set dpia_supported flag for dcn314 in dmub_hw_init() - Remove comment that becomes irrelevant after this change. Signed-off-by: Roman Li Reviewed-by: Nicholas Kazlauskas Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 21a550de5faf9f54013334c9a6a7643b8fd80b36 Author: Ruili Ji Date: Mon Oct 3 17:39:45 2022 +0800 drm/amdgpu: Enable F32_WPTR_POLL_ENABLE in mqd This patch is to fix the SDMA user queue doorbell missing issue on SDMA 6.0. F32_WPTR_POLL_ENABLE has to be set if doorbell mode is used. Otherwise ringing SDMA user queue doorbell can't wake up system from gfxoff. Signed-off-by: Ruili Ji Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 525530ad9a7ec9aa34266e1429cc5ef9acb58e6c Author: Yang Yingliang Date: Thu Sep 29 22:20:15 2022 +0800 drm/amdgpu/sdma: add missing release_firmware() in amdgpu_sdma_init_microcode() In some error path in amdgpu_sdma_init_microcode(), release_firmware() is not called, the memory allocated in request_firmware() will be leaked, calling amdgpu_sdma_destroy_inst_ctx() which calls release_firmware() to avoid memory leak. Fixes: 15aa13056d11da ("drm/amdgpu: add function to init SDMA microcode") Signed-off-by: Yang Yingliang Signed-off-by: Alex Deucher commit 8c39634d28fa460869702b9801d2efe06671b342 Author: Yang Li Date: Fri Sep 30 13:38:59 2022 +0800 drm/amd/display: clean up one inconsistent indenting clean up one inconsistent indenting Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2321 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 95c985ffc63e2a7d8f6aa18f9351f5010a8d1adb Author: Yang Li Date: Fri Sep 30 13:38:58 2022 +0800 drm/amd/display: clean up one inconsistent indenting clean up one inconsistent indenting Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2238 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 7e6d5cf8e3e3f8050de52a28236d5a172caf2da9 Author: Rodrigo Siqueira Date: Thu Sep 22 10:08:11 2022 -0400 drm/amd/display: Minor code style change This commit adds some minor code style changes just to reduce the merge conflicts we have when we upstream some of the VBA code. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a3daede47576037ff7bbbe9cbd36e52a71d92bc8 Author: Rodrigo Siqueira Date: Thu Sep 22 10:06:48 2022 -0400 drm/amd/display: update DSC for DCN32 Update DSC checks in the DCN32 VBA. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 07ebc18c047adcd72905619e72ae7c48db28ab48 Author: Rodrigo Siqueira Date: Thu Sep 22 09:24:12 2022 -0400 drm/amd/display: Disconnect DSC for unused pipes during ODM transition [Why] During transition from ODM combine to ODM bypass, if DSC is enabled need to disconnect the DSC mux for pipes no longer in use. [How] During ODM update, detect pipes with DSC that are no longer being used for new state and call new DSC interface to disconnect. Add new DSC interface to disconnect from pipe Reviewed-by: Alvin Lee Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 9691a7a776302c85c10294f1a92c15c7f57a5947 Author: Martin Leung Date: Mon May 23 14:57:30 2022 -0400 drm/amd/display: unblock mcm_luts why and how: needed to fix bad assumption for enable mcm_luts Reviewed-by: Rodrigo Siqueira Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit 36939c94689ae7e6aaa9a0fa37e5c41616f76665 Author: Aric Cyr Date: Mon Sep 26 10:21:48 2022 -0400 drm/amd/display: 3.2.206 This version brings along the following: - ILR improvements - PSR fixes - DCN315 fixes - DCN32 fixes - ODM fixes - DSC fixes - SubVP fixes Reviewed-by: Hamza Mahfooz Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 54fae65ff469a79fc0ca46f480c4e7fce50f3963 Author: Rodrigo Siqueira Date: Tue Sep 20 16:06:36 2022 -0400 drm/amd/display: Enable 2 to 1 ODM policy if supported If the current configuration supports 2 to 1 ODM policy, let's also enable the windowed MPO feature. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 11895d32ffddb50152f0a1e671d36b7f60e4daba Author: Rodrigo Siqueira Date: Tue Sep 20 15:46:58 2022 -0400 drm/amd/display: Add PState change high hook for DCN32 For some reason, we missed the PState check for DCN32 which may cause issues for clock transition. This commit add that required hook. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e626d9b9c6e038a6918aad1b5affd38f6b9deaed Author: Sonny Jiang Date: Fri Sep 30 16:23:32 2022 -0400 drm/amdgpu: Enable VCN PG on GC11_0_1 Enable VCN PG on GC11_0_1 Signed-off-by: Sonny Jiang Reviewed-by: James Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x commit 46c87432e3d4cea8e1a7ac6e9e3ebd2462f47617 Author: Wenjing Liu Date: Thu Jun 23 16:09:25 2022 -0400 drm/amd/display: Add missing mask sh for SYM32_TP_SQ_PULSE register There is a missing register mask in dcn32 causing the hardware programming is not executed when programming SQ_num test pattern for DP2. Reviewed-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit f638fe27b817c755e017b8a6ae4b9b4224461941 Author: George Shen Date: Thu Jun 2 11:10:25 2022 -0400 drm/amd/display: Add missing SDP registers to DCN32 reglist [Why] Certain features require the additional DP SDP configuration registers DP_SEC_CNTL1 and DP_SEC_CNTL5 in order to function correctly. The DCN32 DIO stream encoder reglist is currently missing these two registers. [How] Add the missing registers to the DCN32 DIO stream encoder reglist. Reviewed-by: Rodrigo Siqueira Signed-off-by: George Shen Signed-off-by: Alex Deucher commit fe674c0b6f5382b7c377ca2c418c26dd78b428b4 Author: Eric Bernstein Date: Tue Jan 25 14:42:12 2022 -0500 drm/amd/display: Fix disable DSC logic in the DIO code [Why] In DIO stream encoder, definition of DP_DSC_MODE is changed (only enable/disable) In OPTC, OTG_SET_V_TOTAL_MIN_MASK_EN is removed (same as DCN3.1) [How] In DIO stream encoder, update enc32_dp_set_dsc_config(). In OPTC, use DCN3.1 version for function interfaces .set_vrr_m_const and .set_drr Reviewed-by: Rodrigo Siqueira Signed-off-by: Eric Bernstein Signed-off-by: Alex Deucher commit 3f4dee59253a6882acde98a2a027e55f1330ae86 Author: Dillon Varone Date: Fri Sep 23 14:00:09 2022 -0400 drm/amd/display: Fix merging dynamic ODM+MPO configs on DCN32 [WHY&HOW?] When merging ODM pipes that are using MPO, we must copy the stream_res from the new top pipe to the bottom pipe so that the overlayed plane is not pointing to the wrong stream assets. Reviewed-by: Martin Leung Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit f1b47f0004cfff051441aa93b7115d756d5eebb7 Author: Rodrigo Siqueira Date: Tue Sep 20 15:34:55 2022 -0400 drm/amd/display: Adding missing HDMI ACP SEND register Add HDMI ACP bit field definition for DCN32. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b33cd65df18f1cf60b066a02c09df92b4763bb31 Author: Rodrigo Siqueira Date: Wed Sep 21 08:47:44 2022 -0400 drm/amd/display: Remove OPTC lock check At some point, we decided to blank HUBP during pixel data blank, and to handle that, we added some OPTC lock checks. Later, we realized that this change caused multiple regression, and we removed it. Nevertheless, we still have some leftovers that might affect some ASIC behavior, and this commit drops those changes to keep the code consistent. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 9114b55fabae5522b7124af4f16ea6ce6378aa19 Author: Rodrigo Siqueira Date: Tue Sep 20 14:27:04 2022 -0400 drm/amd/display: Fix SubVP control flow in the MPO context SubVP has some issues related to how we allocate and enable it. This commit fixes this behavior by adding the proper check and configuration to the SubVP code path. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 47b7dd9f68c12e7d33a0dfd3d9a5bed755097de0 Author: Rodrigo Siqueira Date: Tue Sep 20 13:29:19 2022 -0400 drm/amd/display: Update DCN321 hook that deals with pipe aquire DCN provides a hook to check if we can have a new pipe allocation based on some DC constraints. If the current configuration supports the new pipe request, DC updates its context; otherwise, it will keep the same configuration. This behavior is similar across multiple ASICs, and for this reason, we reused DCN20 on DCN321. However, this DCN32x has some peculiarities which require its function to avoid weird pipe split issues. This commit update this issue by using dcn32_acquire_idle_pipe_for_head_pipe_in_layer instead of dcn20_acquire_idle_pipe_for_layer. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a2909ff460a8e02168b3658372ebc897f7ab2315 Author: Rodrigo Siqueira Date: Tue Sep 20 13:06:50 2022 -0400 drm/amd/display: Drop unused code for DCN32/321 Under DCN32/321 we identified some code paths that DC never executes. This commit removes those unused codes to avoid distractions when debugging issues. Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2d550a159c55ac836a554fd605545b0feb5f7266 Author: Martin Leung Date: Fri Sep 23 17:55:14 2022 -0400 drm/amd/display: block odd h_total timings from halving pixel rate why: when dynamic odm was turned on, there is also logic to halve the pixelclk this still turned on when we avoided odm in the case of odd h_total timings how: block the pixel clk mechanism also in the case of odd h_total timings Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit 51619c671316e96d7adaf2b6ea94ce245b81b6dd Author: Aric Cyr Date: Fri Sep 23 17:09:54 2022 -0400 drm/amd/display: Fix vupdate and vline position calculation [how] Large deltas for periodic interrupts could result in the interrupt not being programmed properly and thus not firing. [why] Add proper wrap-around support for calculating VUPDATE and VLINE positions. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit baec651f4160f4c3f029edf84bbc18b4fcba9cf5 Author: Wenjing Liu Date: Thu Sep 22 14:36:32 2022 -0400 drm/amd/display: write all 4 bytes of FFE_PRESET dpcd value [why] According to specs, it expects us to write all 4 bytes even if current lane count is less than 4. Reviewed-by: George Shen Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit b808a7eb30b02e05023b505fe6db590ba799683f Author: Dillon Varone Date: Tue Sep 20 20:50:49 2022 -0400 drm/amd/display: Increase compbuf size prior to updating clocks [WHY?] Clocks are updating based on the incoming context's support, however the new compbuf size is not programmed prior to udpating clocks, which can result in P-State hangs. [HOW?] Increase compbuf size prior to updating clocks. Reviewed-by: Alvin Lee Reviewed-by: Martin Leung Acked-by: Hamza Mahfooz Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 8cab4ef0ad9521030e1ae4bd294a1e2e6a04659f Author: Lewis Huang Date: Fri Sep 23 10:42:40 2022 +0800 drm/amd/display: Keep OTG on when Z10 is disable [Why] Disable OTG when PSRSU with z10 even if z10 is disable [How] Reverse condition to keep OTG on when Z10 is disable Reviewed-by: Robin Chen Acked-by: Hamza Mahfooz Signed-off-by: Lewis Huang Signed-off-by: Alex Deucher commit 4931ce22eca6ed5f8a3a3820fd13e586011ac219 Author: Dmytro Laktyushkin Date: Fri Sep 16 15:55:55 2022 -0400 drm/amd/display: add dummy pstate workaround to dcn315 DCN315 has to always allow pstate change or SMU will hang. This workaround achieves this by applying a low pstate change latency to be used when pstate is calculated to be unsupported. This lower latency only accounts for memory retraining; a previous change handles locking in the highest available pstate allowing us to minimize required latency hiding to only account for memory retraining. Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit e4e481e4d838f30985dd46d43ed195110ed265f5 Author: Zhikai Zhai Date: Tue Sep 20 18:51:02 2022 +0800 drm/amd/display: skip commit minimal transition state [WHY] Now dynamic ODM will now be disabled when MPO is required safe transitions to avoid underflow, but we are triggering the way of minimal transition too often. Commit state of dc with no check will do pipeline setup which may re-initialize the component with no need such as audio. [HOW] Just do the minimal transition when all of pipes are in use, otherwise return true to skip. Reviewed-by: Dillon Varone Acked-by: Hamza Mahfooz Signed-off-by: Zhikai Zhai Signed-off-by: Alex Deucher commit 345d6493476615494bd79a8fe77661918ea7c61a Author: Leo Chen Date: Fri Sep 16 14:13:11 2022 -0400 drm/amd/display: Add log for LTTPR [Why & How] Adding log for LTTPR to facilitate debugging. Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit 380202c84454e89d29a9abc670f09b9145617d58 Author: Alvin Lee Date: Wed Sep 21 12:04:25 2022 -0400 drm/amd/display: For SubVP pipe split case use min transition into MPO [Description] - For SubVP pipe split case we need to use a minimial transition when opening MPO video since we are transitioning from 4 pipes to 3 pipes where an OPP for a previous MPCC will change - Also save and restore mall config when doing fast_validate in case there was a shallow copy of the dc->current_state Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 1178ac68dc2869a2f4192600b701de3d853272d2 Author: Ian Chen Date: Tue Aug 23 17:26:51 2022 +0800 drm/amd/display: Refactor edp ILR caps codes We split out ILR config from "global" to "per-panel" config settings. Reviewed-by: Anthony Koo Acked-by: Hamza Mahfooz Signed-off-by: Ian Chen Signed-off-by: Alex Deucher commit 7aeb2e47e43d5acd4638c64b4c0c01ad90feea51 Author: Iswara Nagulendran Date: Mon Sep 19 15:53:56 2022 -0400 drm/amd/display: Allow PSR exit when panel is disconnected [HOW&WHY] Fixed check to only avoid PSR entry when panel is disconnected. PSR exit can be permitted to restore the HW to it's non-PSR state. Reviewed-by: Jayendran Ramani Acked-by: Hamza Mahfooz Signed-off-by: Iswara Nagulendran Signed-off-by: Alex Deucher commit 749b6c2ac9d9a7a4d8f4c2e4dc6fa830fd6c6ac7 Author: Leo (Hanghong) Ma Date: Tue Sep 20 15:23:42 2022 -0400 drm/amd/display: AUX tracing cleanup [Why && How] Remove the unnecessary AUX trace and use one trace for AUX failure. Reviewed-by: Martin Leung Acked-by: Hamza Mahfooz Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit 283e0a673cdf59fe103707ac0466492b315c81a2 Author: Wenjing Liu Date: Thu Sep 22 14:22:04 2022 -0400 drm/amd/display: fix integer overflow during MSA V_Freq calculation [why] Analyzer shows incorrect V freq in MSA for some large timing. [how] Cast an 32 bit integer to uint64_t before multiplication to avoid integer overflow for a very large timing. Reviewed-by: Ariel Bernstein Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 40169e2f37127b7fe60736045b1f9fc04f76b471 Author: Alvin Lee Date: Tue Sep 20 19:26:27 2022 -0400 drm/amd/display: Disable GSL when enabling phantom pipe [Description] When enabling phantom pipe on a pipe that was previously using immediate flip, we have to disable GSL or this will prevent the update from taking place right away on the phantom pipe when we enable it in FW Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit dfb3367bd082ccf52d3c13ff62257f08407dffcf Author: Charlene Liu Date: Tue Sep 20 09:23:06 2022 -0400 drm/amd/display: prevent S4 test from failing [why] limit the vm prefetch check for now, until the feature is fully verified. Reviewed-by: Hansen Dsouza Acked-by: Hamza Mahfooz Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 96ab3cb3b0f862308a03046d01d66c7b4154846b Author: Aric Cyr Date: Mon Sep 19 17:42:22 2022 -0400 Revert "drm/amd/display: correct hostvm flag" This reverts commit 796d6a37ff5ffaf9f2dc0f3f4bf9f4a1034c00de. 4K144 resolution isn't available on DCN31. Reviewed-by: Sherry Wang Acked-by: Hamza Mahfooz Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit d35e8b7ae01430b1e722547b2ef40f42dc30520f Author: Alvin Lee Date: Tue Sep 20 10:46:18 2022 -0400 drm/amd/display: Block SubVP if rotation being used [Description] - SubVP rotation support is not explicitly implemented, so block SubVP in rotation cases to avoid unexpected behaviors Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit ab5220bb5a910246c61512a9e29a4e2406cb1ecd Author: Dmytro Laktyushkin Date: Thu Sep 8 11:37:58 2022 -0400 drm/amd/display: fix dcn315 dml detile overestimation DML does not take the fact that dcn315 does not have enough detile buffer to max all pipes. This change adds a workaround to apply the same logic DC does when calculating detile buffer size in DML. Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit c1969fbaa57d88ddef626bb8ae313d38478d8631 Author: Dillon Varone Date: Mon Sep 19 13:14:02 2022 -0400 drm/amd/display: Reorder FCLK P-state switch sequence for DCN32 [WHY?] In some cases, DCFCLK hardmin requests are not acknowledged by SMU as the requested clock does not have a compatible ratio with current FCLK, and it cannot be changed as FCLK P-state is not allowed. [HOW?] Allow FCLK p-state change prior to changing DCFCLK hardmin. Reviewed-by: Alvin Lee Acked-by: Hamza Mahfooz Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit f7367b5fe0e38af02d6915a355f2ee63b172c9ac Author: Dillon Varone Date: Mon Sep 19 10:29:24 2022 -0400 drm/amd/display: Program SubVP in dc_commit_state_no_check [Why?] Currently SubVP programming is only done in commit_planes_for_stream, as it was expected only this call would add/remove planes from a display. [How?] Add SubVP programming to dc_commit_state_no_check. Reviewed-by: Alvin Lee Acked-by: Hamza Mahfooz Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 8abbc4f768ddc5c2190ab8966e529cec42b4b2d4 Author: Li Zhong Date: Sat Sep 24 15:19:39 2022 -0700 drivers/amd/pm: check the return value of amdgpu_bo_kmap amdgpu_bo_kmap() returns error when fails to map buffer object. Add the error check and propagate the error. Signed-off-by: Li Zhong Signed-off-by: Alex Deucher commit d37f379ad04dcc21ebd1d2380c3bc979d54f7c46 Author: Yang Yingliang Date: Thu Sep 29 17:02:00 2022 +0800 drm/amd/display: change to enc314_stream_encoder_dp_blank static enc314_stream_encoder_dp_blank is only used in dcn314_dio_stream_encoder.c now, change it to static. Fixes: c55bf690fe79 ("drm/amd/display: Add explicit FIFO disable for DP blank") Signed-off-by: Yang Yingliang Signed-off-by: Alex Deucher commit 8ab1d7a27eff87001ebd0977db600e4187f63f78 Author: Alvin Lee Date: Wed Aug 17 10:47:59 2022 -0400 drm/amd/display: Only commit SubVP state after pipe programming [Description] We only want to commit the SubVP config to DMCUB after the main and phantom pipe programming has completed. Commiting the state early can cause issues such as P-State being allowed by the HW early which causes the SubVP state machine to go into a bad state Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 91954c6c904b515baafaee6a1f35c94409a3bb68 Author: Daniel Gomez Date: Sun Sep 25 23:53:13 2022 +0200 drm/amd/display: Fix mutex lock in dcn10 Removal of DC_FP_* wrappers from dml (9696679bf7ac) provokes a mutex lock [2] on the amdgpu driver. Re-arrange the dcn10 code to avoid locking the mutex by placing the DC_FP_* wrappers around the proper functions. This fixes the following WARN/stacktrace: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:283 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 227, name: systemd-udevd preempt_count: 1, expected: 0 CPU: 4 PID: 227 Comm: systemd-udevd Not tainted 6.0.0-rc6-qtec-standard #2 Hardware name: Qtechnology A/S QT5222/QT5221, BIOS v1.0.1 06/07/2021 Call Trace: dump_stack_lvl+0x33/0x42 __might_resched.cold.172+0xa5/0xb3 mutex_lock+0x1a/0x40 amdgpu_dpm_get_clock_by_type_with_voltage+0x38/0x70 [amdgpu] dm_pp_get_clock_levels_by_type_with_voltage+0x64/0xa0 [amdgpu] dcn_bw_update_from_pplib+0x70/0x340 [amdgpu] dcn10_create_resource_pool+0x8c8/0xd20 [amdgpu] ? __kmalloc+0x1c7/0x4a0 dc_create_resource_pool+0xe7/0x190 [amdgpu] dc_create+0x212/0x5d0 [amdgpu] amdgpu_dm_init+0x246/0x370 [amdgpu] ? schedule_hrtimeout_range_clock+0x93/0x120 ? phm_wait_for_register_unequal.part.1+0x4a/0x80 [amdgpu] dm_hw_init+0xe/0x20 [amdgpu] amdgpu_device_init.cold.56+0x1324/0x1653 [amdgpu] ? pci_bus_read_config_word+0x43/0x80 amdgpu_driver_load_kms+0x15/0x120 [amdgpu] amdgpu_pci_probe+0x116/0x320 [amdgpu] pci_device_probe+0x97/0x110 really_probe+0xdd/0x340 __driver_probe_device+0x80/0x170 driver_probe_device+0x1f/0x90 __driver_attach+0xdc/0x180 ? __device_attach_driver+0x100/0x100 ? __device_attach_driver+0x100/0x100 bus_for_each_dev+0x74/0xc0 bus_add_driver+0x19e/0x210 ? kset_find_obj+0x30/0xa0 ? 0xffffffffa0a5b000 driver_register+0x6b/0xc0 ? 0xffffffffa0a5b000 do_one_initcall+0x4a/0x1f0 ? __vunmap+0x28e/0x2f0 ? __cond_resched+0x15/0x30 ? kmem_cache_alloc_trace+0x3d/0x440 do_init_module+0x4a/0x1e0 load_module+0x1cba/0x1e10 ? __do_sys_finit_module+0xb7/0x120 __do_sys_finit_module+0xb7/0x120 do_syscall_64+0x3c/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff2b5f5422d Code: 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 ab 0e 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc44ab28e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000555c566a9240 RCX: 00007ff2b5f5422d RDX: 0000000000000000 RSI: 00007ff2b60bb353 RDI: 0000000000000019 RBP: 00007ff2b60bb353 R08: 0000000000000000 R09: 0000555c566a9240 R10: 0000000000000019 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000020000 R14: 0000000000000000 R15: 0000000000000000 Fixes: 9696679bf7ac ("drm/amd/display: remove DC_FP_* wrapper from dml folder") Reviewed-by: Hamza Mahfooz Tested-by: Daniel Wheeler Signed-off-by: Daniel Gomez Signed-off-by: Alex Deucher commit a890d1c657ecba73a7b28591c92587aef1be1888 Author: Jason A. Donenfeld Date: Wed Oct 5 12:54:38 2022 +0200 random: clear new batches when bringing new CPUs online The commit that added the new get_random_{u8,u16}() functions neglected to update the code that clears the batches when bringing up a new CPU. It also forgot a few comments and helper defines, so add those in too. Fixes: 585cd5fe9f73 ("random: add 8-bit and 16-bit batches") Signed-off-by: Jason A. Donenfeld commit 4f881a696484a7d31a4d1b12547615b1a3ee5771 Author: Steven Rostedt (Google) Date: Thu Oct 6 10:43:48 2022 -0400 ftrace: Create separate entry in MAINTAINERS for function hooks The function hooks (ftrace) is a completely different subsystem from the general tracing. It manages how to attach callbacks to most functions in the kernel. It is also used by live kernel patching. It really is not part of tracing, although tracing uses it. Create a separate entry for FUNCTION HOOKS (FTRACE) to be separate from tracing itself in the MAINTAINERS file. Perhaps it should be moved out of the kernel/trace directory, but that's for another time. Link: https://lkml.kernel.org/r/20221006144439.459272364@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Acked-by: Mark Rutland Signed-off-by: Steven Rostedt (Google) commit fb17b268396046ee8a10c0f5d30c0a7afeef77e2 Author: Steven Rostedt (Google) Date: Thu Oct 6 10:43:47 2022 -0400 tracing: Update MAINTAINERS to reflect new tracing git repo The tracing git repo will no longer be housed in my personal git repo, but instead live in trace/linux-trace.git. Update the MAINTAINERS file appropriately. Link: https://lkml.kernel.org/r/20221006144439.282193367@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Signed-off-by: Steven Rostedt (Google) commit c63317ab14b0319690495b98d638c93ba81f1fb1 Author: Carsten Haitzler Date: Fri Sep 9 16:27:51 2022 +0100 perf test: Add CoreSight shell lib shared code for future tests This adds a library of shell "code" to be shared and used by future tests that target quality testing for Arm CoreSight support in perf and the Linux kernel. Signed-off-by: Carsten Haitzler Reviewed-by: James Clark Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20220909152803.2317006-2-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 60abedb8aa902b0692025d41351e8938991e3062 Author: Leo Yan Date: Thu Oct 6 18:10:39 2022 +0800 perf test: Introduce script for data symbol testing The test is designed with a data structure with 64-byte alignment, it has two fields "data1" and "data2", and other fields are reserved. Using the "perf mem" command, we can record and report memory samples for a self-contained workload with 1 second duration. If no samples are obtained for the data structure "buf1", it reports failure; and by checking the offset in structure "buf1", if the memory samples aren't for the "data1" and "data2" fields, it means wrong data symbol parsing and returns failure. Committer testing: [root@quaco ~]# grep -m1 "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz [root@quaco ~]# [root@quaco ~]# perf test -v "data symbol" 104: Test data symbol : --- start --- test child forked, pid 192318 Compiling test program... Recording workload... [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.389 MB /tmp/__perf_test.perf.data.LIuQl (5570 samples) ] Cleaning up files... test child finished with 0 ---- end ---- Test data symbol: Ok [root@quaco ~]# Signed-off-by: Leo Yan Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Link: https://lore.kernel.org/r/20221006101039.47870-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit fd643afc8f605bcbb4181a2ad5eacf3233a47187 Author: Namhyung Kim Date: Tue Sep 20 15:28:22 2022 -0700 perf record: Save DSO build-ID for synthesizing When synthesizing MMAP2 with build-id, it'd read the same file repeatedly as it has no idea if it's done already. Maintain a dsos to check that and skip the file access if possible. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220920222822.2171056-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 94746890202cf18e5266b4de77895243e55b0a79 Author: Michael Ellerman Date: Thu Oct 6 23:34:17 2022 +1100 powerpc: Don't add __powerpc_ prefix to syscall entry points When using syscall wrappers the __SYSCALL_DEFINEx() and related macros add a "__powerpc_" prefix to all syscall entry points. So for example sys_mmap becomes __powerpc_sys_mmap. This risks breaking workflows and tools that expect the old naming scheme. At a minimum setting a breakpoint on eg. sys_mmap with gdb no longer works. There seems to be no compelling reason to add the "__powerpc_" prefix, other than that it follows what some other arches do (x86, arm64, s390). But unlike other arches powerpc doesn't always enable syscall wrappers, so the syscall entry points can change name depending on CONFIG options. For those reasons drop the "__powerpc_" prefix, reverting to the existing naming. Doing so reveals two prototypes in signal.h that have the incorrect type when syscall wrappers are enabled. There are already prototypes for both functions in syscalls.h, so drop the ones from signal.h. Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221006135940.1223988-1-mpe@ellerman.id.au commit b739a5bd9d9f18cc69dced8db128ef7206e000cd Author: Trond Myklebust Date: Wed Oct 5 15:57:38 2022 -0400 NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked If the layout is recalled or revoked, we want to cancel I/O as quickly as possible so that we can return the layout. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit dc4c4304855a5721d214e2a53e17df5152dd5f34 Author: Trond Myklebust Date: Wed Oct 5 15:57:37 2022 -0400 SUNRPC: Add API to force the client to disconnect Allow the caller to force a disconnection of the RPC client so that we can clear any pending requests that are buffered in the socket. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit f8423909ecca208834a9d704e58409800f8b5f21 Author: Trond Myklebust Date: Wed Oct 5 15:57:36 2022 -0400 SUNRPC: Add a helper to allow pNFS drivers to selectively cancel RPC calls Add the helper rpc_cancel_tasks(), which uses a caller-defined selection function to define a set of in-flight RPC calls to cancel. This is mainly intended for pNFS drivers which are subject to a layout recall, and which may therefore want to cancel all pending I/O using that layout in order to redrive it after the layout recall has been satisfied. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 39494194f93bed7926d4b3bd03a6a76ba23e612b Author: Trond Myklebust Date: Wed Oct 5 15:57:35 2022 -0400 SUNRPC: Fix races with rpc_killall_tasks() Ensure that we immediately call rpc_exit_task() after waking up, and that the tk_rpc_status cannot get clobbered by some other function. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 340e134727c9adaefadc7e79b765c038e18e55c3 Author: Deming Wang Date: Thu Oct 6 04:44:50 2022 -0400 block: Remove the repeat word 'can' Remove the repeat word 'can' from the comments of bio_kmalloc. Signed-off-by: Deming Wang Link: https://lore.kernel.org/r/20221006084450.1513-1-wangdeming@inspur.com Signed-off-by: Jens Axboe commit 585463f0d58aa4d29b744c7c53b222b8028de87f Author: Valentin Schneider Date: Mon Oct 3 16:34:20 2022 +0100 sched/core: Merge cpumask_andnot()+for_each_cpu() into for_each_cpu_andnot() This removes the second use of the sched_core_mask temporary mask. Suggested-by: Yury Norov Signed-off-by: Valentin Schneider commit 49937cd12331cc3966b3f8628253fe62fbbd35a1 Author: Valentin Schneider Date: Mon Oct 3 16:34:19 2022 +0100 lib/test_cpumask: Add for_each_cpu_and(not) tests Following the recent introduction of for_each_andnot(), add some tests to ensure for_each_cpu_and(not) results in the same as iterating over the result of cpumask_and(not)(). Suggested-by: Yury Norov Signed-off-by: Valentin Schneider commit 5f75ff295c662c1c8fb9e1737e9dc3b9a1e7fb29 Author: Valentin Schneider Date: Mon Oct 3 16:34:18 2022 +0100 cpumask: Introduce for_each_cpu_andnot() for_each_cpu_and() is very convenient as it saves having to allocate a temporary cpumask to store the result of cpumask_and(). The same issue applies to cpumask_andnot() which doesn't actually need temporary storage for iteration purposes. Following what has been done for for_each_cpu_and(), introduce for_each_cpu_andnot(). Signed-off-by: Valentin Schneider commit 90d482908eedd56f01a707325aa541cf9c40f936 Author: Valentin Schneider Date: Mon Oct 3 16:34:17 2022 +0100 lib/find_bit: Introduce find_next_andnot_bit() In preparation of introducing for_each_cpu_andnot(), add a variant of find_next_bit() that negate the bits in @addr2 when ANDing them with the bits in @addr1. Signed-off-by: Valentin Schneider commit c9cb01369b926a074004714ab9f9b65f75bf3c60 Author: Christoph Hellwig Date: Thu Oct 6 09:43:01 2022 +0200 ARM/dma-mapping: remove the dma_coherent member of struct dev_archdata Since commit ae626eb97376 ("ARM/dma-mapping: use dma-direct unconditionally") only the dma_coherent flag in struct device is used, so remove the now write only flag in struct dev_archdata. Signed-off-by: Christoph Hellwig Reviewed-by: Russell King (Oracle) commit 49bc8bebae79c8516cb12f91818f3a7907e3ebce Author: Christoph Hellwig Date: Tue Oct 4 09:10:19 2022 +0200 ARM/dma-mappіng: don't override ->dma_coherent when set from a bus notifier Commit ae626eb97376 ("ARM/dma-mapping: use dma-direct unconditionally") caused a regression on the mvebu platform, wherein devices that are dma-coherent are marked as dma-noncoherent, because although mvebu_hwcc_notifier() after that commit still marks then as coherent, the arm_coherent_dma_ops() function, which is called later, overwrites this setting, since it is being called from drivers/of/device.c with coherency parameter determined by of_dma_is_coherent(), and the device-trees do not declare the 'dma-coherent' property. Fix this by defaulting never clearing the dma_coherent flag in arm_coherent_dma_ops(). Fixes: ae626eb97376 ("ARM/dma-mapping: use dma-direct unconditionally") Reported-by: Marek Behún Signed-off-by: Christoph Hellwig Reviewed-by: Russell King (Oracle) Tested-by: Marek Behún commit 07d2872bf4c864eb83d034263c155746a2fb7a3b Author: Avri Altman Date: Wed Sep 28 12:57:44 2022 +0300 mmc: core: Add SD card quirk for broken discard Some SD-cards from Sandisk that are SDA-6.0 compliant reports they supports discard, while they actually don't. This might cause mk2fs to fail while trying to format the card and revert it to a read-only mode. To fix this problem, let's add a card quirk (MMC_QUIRK_BROKEN_SD_DISCARD) to indicate that we shall fall-back to use the legacy erase command instead. Signed-off-by: Avri Altman Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220928095744.16455-1-avri.altman@wdc.com [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson commit fa2edc07b4643f9dc1db80b2c51ef81f62b26614 Author: Namhyung Kim Date: Fri Sep 30 13:21:10 2022 -0700 perf stat: Rename to aggr_cpu_id.thread_idx The aggr_cpu_id has a thread value but it's actually an index to the thread_map. To reduce possible confusion, rename it to thread_idx. Suggested-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-8-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 01b8957b738f42f96a130079bc951b3cc78c5b8a Author: Namhyung Kim Date: Fri Sep 30 13:21:09 2022 -0700 perf stat: Don't compare runtime stat for shadow stats Now it always uses the global rt_stat. Let's get rid of the field from the saved_value. When the both evsels are NULL, it'd return 0 so remove the block in the saved_value_cmp. Reviewed-by: James Clark Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-7-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f407aac4056c9ce52ea9ec7a8dabbd0f553684c2 Author: Namhyung Kim Date: Fri Sep 30 13:21:08 2022 -0700 perf stat: Kill unused per-thread runtime stats Now it's using the global rt_stat, no need to use per-thread stats. Let get rid of them. Reviewed-by: James Clark Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 87ae87fd6c61c93a93b79c6c6c8ec5f47e4839dd Author: Namhyung Kim Date: Fri Sep 30 13:21:07 2022 -0700 perf stat: Use thread map index for shadow stat When AGGR_THREAD is active, it aggregates the values for each thread. Previously it used cpu map index which is invalid for AGGR_THREAD so it had to use separate runtime stats with index 0. But it can just use the rt_stat with thread_map_index. Rename the first_shadow_map_idx() and make it return the thread index. Reviewed-by: James Clark Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dfca2d692d035a276811d050cb0c4e4e825b3415 Author: Namhyung Kim Date: Fri Sep 30 13:21:06 2022 -0700 perf stat: Rename saved_value->cpu_map_idx The cpu_map_idx fields is just to differentiate values from other entries. It doesn't need to be strictly cpu map index. Actually we can pass thread map index or aggr map index. So rename the fields first. No functional change intended. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 429b8e84517b0ccdb3feace4b264c74ab61b16b0 Author: Namhyung Kim Date: Fri Sep 30 13:21:05 2022 -0700 perf stat: Don't call perf_stat_evsel_id_init() repeatedly evsel__reset_stat_priv() is called more than once if user gave -r option for multiple runs. But it doesn't need to re-initialize the id. Reviewed-by: James Clark Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 66b76e30ee36c0c58836bf91b8602f5f2c94093a Author: Namhyung Kim Date: Fri Sep 30 13:21:04 2022 -0700 perf stat: Convert perf_stat_evsel.res_stats array It uses only one member, no need to have it as an array. Reviewed-by: James Clark Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220930202110.845199-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1337b9dcb03b1c81448eed1b70296148f62730b8 Author: Namhyung Kim Date: Mon Oct 3 13:46:47 2022 -0700 perf tools: Remove special handling of system-wide evsel For system-wide evsels, the thread map should be dummy - i.e. it has a single entry of -1. But the code guarantees such a thread map, so no need to handle it specially. No functional change intended. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221003204647.1481128-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 182bb594e0678b3ceac99f4ec3daa5d22ea3d0ce Author: Namhyung Kim Date: Mon Oct 3 13:46:46 2022 -0700 perf tools: Add evlist__add_sched_switch() Add a help to create a system-wide sched_switch event. One merit is that it sets the system-wide bit before adding it to evlist so that the libperf can handle the cpu and thread maps correctly. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221003204647.1481128-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 60ea006f72512fd7c36f16cdbe91f4fc284f8115 Author: Namhyung Kim Date: Mon Oct 3 13:46:45 2022 -0700 perf tools: Get rid of evlist__add_on_all_cpus() The cpu and thread maps are properly handled in libperf now. No need to do it in the perf tools anymore. Let's remove the logic. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221003204647.1481128-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7e2450bb756c84cdc2b2668b1036ac105453ed5f Author: Namhyung Kim Date: Mon Oct 3 13:46:44 2022 -0700 libperf: Propagate maps only if necessary The current code propagate evsel's cpu map settings to evlist when it's added to an evlist. But the evlist->all_cpus and each evsel's cpus will be updated in perf_evlist__set_maps() later. No need to do it before evlist's cpus are set actually. In fact it discards this intermediate all_cpus maps at the beginning of perf_evlist__set_maps(). Let's not do this. It's only needed when an evsel is added after the evlist cpu/thread maps are set. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221003204647.1481128-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 06b552ee378193a3a67d7124f3f0e76989881fed Author: Namhyung Kim Date: Mon Oct 3 13:46:43 2022 -0700 libperf: Populate system-wide evsel maps Setting proper cpu and thread maps for system wide evsels regardless of user requested cpu in __perf_evlist__propagate_maps(). Those evsels need to be active on all cpus always. Do it in the libperf so that we can guarantee it has proper maps. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221003204647.1481128-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d7184d9487e9791a89f3304bd015da9569b1099b Author: Ian Rogers Date: Mon Oct 3 19:16:12 2022 -0700 perf vendor events: Update Intel broadwellde Events remain at v23, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Switch for core metrics from BDX to BDW. - Switch for Page_Walks_Utilization to BDX version. - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-24-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a7c1aaa639e08e3f29035a863e2169bfb2cf592e Author: Ian Rogers Date: Mon Oct 3 19:16:11 2022 -0700 perf vendor events: Update Intel tigerlake Events remain at v1.07, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit aac53e8f0730e921e56be6d362aee7e1d004b6c6 Author: Ian Rogers Date: Mon Oct 3 19:16:10 2022 -0700 perf vendor events: Update Intel skylake Events remain at v53, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-22-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e762a998e71cc579487cf478d0a3b56634189ffa Author: Ian Rogers Date: Mon Oct 3 19:16:09 2022 -0700 perf vendor events: Update silvermont cpuids Add cpuid that was added to https://download.01.org/perfmon/mapfile.csv Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9a1b4aa4c9b25a40b17c29f9e198f67e185bfe44 Author: Ian Rogers Date: Mon Oct 3 19:16:08 2022 -0700 perf vendor events: Update Intel sapphirerapids Events are updated to v1.06 the core metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-20-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit db35c1dc0b5567dcaef68809b789ee25bf088647 Author: Ian Rogers Date: Mon Oct 3 19:16:07 2022 -0700 perf vendor events: Update Intel sandybridge Events remain at v17, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3405de19abf54ef891280564e381a8f277f5fc76 Author: Ian Rogers Date: Mon Oct 3 19:16:06 2022 -0700 perf vendor events: Update Intel jaketown Events remain at v21, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d2aaf04076ea217443707775c0dc792aeca3c641 Author: Ian Rogers Date: Mon Oct 3 19:16:05 2022 -0700 perf vendor events: Update Intel ivytown Events are updated to v22 the core metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3bd2d21171b72754628957385c78f0307662b394 Author: Ian Rogers Date: Mon Oct 3 19:16:04 2022 -0700 perf vendor events: Update Intel ivybridge Events remain at v22, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bd035250c5e80ed24aa709b12a7e12402c0037b5 Author: Ian Rogers Date: Mon Oct 3 19:16:03 2022 -0700 perf vendor events: Update Intel icelakex Events are updated to v1.16 the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8fb4ddf499ebbdeaa1bafb16f2c0b6818325d981 Author: Ian Rogers Date: Mon Oct 3 19:16:02 2022 -0700 perf vendor events: Update Intel icelake Events are updated to v1.15, the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 08ce57dd1b89f0e125c8d0cb03c9578ecae348c1 Author: Ian Rogers Date: Mon Oct 3 19:16:01 2022 -0700 perf vendor events: Update Intel haswellx Events are updated to v26, the core metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Uncore event updates by Zhengjun Xing . - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dd7aae2c2d651c34f3a006313fa1f46ce9bf48a0 Author: Ian Rogers Date: Mon Oct 3 19:16:00 2022 -0700 perf vendor events: Update Intel haswell Events are updated to v32, the core metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ed4fc264c2becdae2d2fed4db94eb2dc45668fe Author: Ian Rogers Date: Mon Oct 3 19:15:59 2022 -0700 perf vendor events: Update elkhartlake cpuids Add cpuid that was added to https://download.01.org/perfmon/mapfile.csv Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 55b201a833664bf6bd4dc17ac3e75882a34daacf Author: Ian Rogers Date: Mon Oct 3 19:15:58 2022 -0700 perf vendor events: Update Intel cascadelakex Events remain at v1.16, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Removal of ScaleUnit from uncore events by Zhengjun Xing . - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5bc4e39eecb069d49060ebcebf07dada088de026 Author: Ian Rogers Date: Mon Oct 3 19:15:57 2022 -0700 perf vendor events: Update Intel broadwellx Events remain at v19, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Uncore event updates by Zhengjun Xing . - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit eb4f8d7787f115a724e4ffcb8d1d659249b04f9b Author: Ian Rogers Date: Mon Oct 3 19:15:56 2022 -0700 perf vendor events: Update Intel broadwell Events remain at v26, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a80de06698a7c7dc4f875bd3118bc9e650c18c14 Author: Ian Rogers Date: Mon Oct 3 19:15:55 2022 -0700 perf vendor events: Update Intel alderlake Events are updated to v1.15, the core metrics are based on TMA 4.4 full and the atom metrics on E-core TMA 2.2. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - Addition of all 6 levels of TMA metrics. Previously metrics involving topdown events were dropped. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Update mapfile.csv CPUIDs to match 01.org. Tested with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 313b2f384be160b83a72328cbeab8a53902aaef4 Author: Ian Rogers Date: Mon Oct 3 19:15:54 2022 -0700 perf vendor events: Update Intel skylakex Events remain at v1.28, and the metrics are based on TMA 4.4 full. Use script at: https://github.com/intel/event-converter-for-linux-perf/blob/master/download_and_gen.py with updates at: https://github.com/captain5050/event-converter-for-linux-perf Updates include: - Removal of ScaleUnit from uncore events by Zhengjun Xing . - Rename of topdown TMA metrics from Frontend_Bound to tma_frontend_bound. - _SMT suffix metrics are dropped as the #SMT_On and #EBS_Mode are correctly expanded in the single main metric. - Addition of all 6 levels of TMA metrics. Child metrics are placed in a group named after their parent allowing children of a metric to be easily measured using the metric name with a _group suffix. - ## and ##? operators are correctly expanded. - The locate-with column is added to the long description describing a sampling event. - Metrics are written in terms of other metrics to reduce the expression size and increase readability. - Latest metrics from: https://github.com/intel/perfmon-metrics Tested on a skylakex manually and with 'perf test': 10: PMU events : 10.1: PMU event table sanity : Ok 10.2: PMU event map aliases : Ok 10.3: Parsing of PMU event table metrics : Ok 10.4: Parsing of PMU event table metrics with fake PMUs : Ok 93: perf all metricgroups test : Ok 94: perf all metrics test : Skip 95: perf all PMU test : Ok Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8cff7490fc05333f163c0130ec6c64e7a433a4a0 Author: Ian Rogers Date: Mon Oct 3 19:15:53 2022 -0700 perf metrics: Don't scale counts going into metrics Counts are scaled prior to going into saved_value, reverse the scaling so that metrics don't double scale values. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 715b824f4a1f21e3eeb78076efa6215421bb8f98 Author: Ian Rogers Date: Mon Oct 3 19:15:52 2022 -0700 perf expr: Remove jevents case workaround jevents.py no longer lowercases metrics and altering the case can cause hashmap lookups to fail, so remove. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0e4079154ea2ed4434c960df74551cb14de32324 Author: Ian Rogers Date: Mon Oct 3 19:15:51 2022 -0700 perf test: Adjust case of test metrics Icelake and later architectures have slots events and SLOTS metrics meaning case sensitivity is important. Make the test metrics case agree with the name of the metrics. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4b65fc7bca1299de12ceeed1de31f252a185ed47 Author: Ian Rogers Date: Mon Oct 3 19:15:50 2022 -0700 perf expr: Allow a double if expression Some TMA metrics have double if expressions like: ( CPU_CLK_UNHALTED.THREAD / 2 ) * ( 1 + CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE / CPU_CLK_UNHALTED.REF_XCLK ) ) if #core_wide < 1 else ( CPU_CLK_UNHALTED.THREAD_ANY / 2 ) if #SMT_on else CPU_CLK_UNHALTED.THREAD This currently fails to parse as the left hand side if expression needs to be in parentheses. By allowing the if expression to have a right hand side that is an if expression we can parse the expression above, with left to right evaluation order that matches languages like Python. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20221004021612.325521-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 30b842d27dfa90046c46bbfa884113885e742279 Author: Chen Zhongjin Date: Tue Oct 4 08:59:25 2022 -0300 perf parse-events: Remove unused macros __PERF_EVENT_FIELD() Unused macros reported by [-Wunused-macros]. This macros were introduced as __PERF_COUNTER_FIELD and used for reading the bit in config. cdd6c482c9ff9c55 ("perf: Do the big rename: Performance Counters -> Performance Events") Changes it to __PERF_EVENT_FIELD but at this commit there is already nowhere else using these macros, also no macros called PERF_EVENT_##name##_MASK/SHIFT. Now we are not reading type or id from config. These macros are useless and incomplete. So removing them for code cleaning. Signed-off-by: Chen Zhongjin Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220926031440.28275-5-chenzhongjin@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 81935f10e694e390c7d23055952ebe0ac2173d1d Author: Will Chandler Date: Fri Sep 30 11:11:57 2022 -0400 perf tools: Fix empty version number when building outside of a git repo When perf is built in a full source tree that is not a git repository, e.g. from a kernel source tarball, `perf version` will print empty tag and commit strings: $ perf version perf version Currently the tag version is only generated from the root Makefile when building in a git repository. If PERF-VERSION-FILE has not been generated and the source tree is not in a git repository, then PERF-VERSION-GEN will return an empty version. The problem can be reproduced with the following steps: $ wget https://git.kernel.org/torvalds/t/linux-6.0-rc7.tar.gz $ tar -xf linux-6.0-rc7.tar.gz && cd linux-6.0-rc7 $ make -C tools/perf $ tools/perf/perf -v perf version Builds from tarballs generated with `make perf-tar-src-pkg` are not impacted by this issue as PERF-VERSION-FILE is included in the archive. The perf RPM provided by Fedora for 5.18+ is experiencing this problem. Package build logs[0] show that the build is attempting to fall back on PERF-VERSION-FILE, but it is not present. To resolve this, revert back to the previous logic of using the kernel Makefile version if not in a git repository and PERF-VERSION-FILE does not exist. [0] https://kojipkgs.fedoraproject.org/packages/kernel-tools/5.19.4/200.fc36/data/logs/x86_64/build.log Fixes: 7572733b84997d23 ("perf tools: Fix version kernel tag") Reviewed-by: John Garry Signed-off-by: Will Chandler Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220930151157.529674-1-wfc@wfchandler.org Signed-off-by: Arnaldo Carvalho de Melo commit 20b2194eeee3ff8df8f2bbf7631e7278fced404a Author: Yuan Can Date: Tue Sep 27 01:39:31 2022 +0000 perf lock: Remove unused struct lock_contention_key The struct lock_contention_key is never used, remove it. Signed-off-by: Yuan Can Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/20220927013931.110475-6-yuancan@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit d28a8fd3c0f82c29dec7225a2e33f3801d9ec026 Author: Yuan Can Date: Tue Sep 27 01:39:30 2022 +0000 perf jit: Remove unused struct debug_line_info The struct debug_line_info is never used, remove it. Signed-off-by: Yuan Can Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/20220927013931.110475-5-yuancan@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 18f224ee8170137b80bb99c4bb36a7817a9433e3 Author: Yuan Can Date: Tue Sep 27 01:39:29 2022 +0000 perf metric: Remove unused struct metric_ref_node After commit 46bdc0bf8d21 ("perf metric: Simplify metric_refs calculation"), no one use struct metric_ref_node, so remove it. Signed-off-by: Yuan Can Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/20220927013931.110475-4-yuancan@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 8d9b1734c7372390428346860f47b11652639fb2 Author: Yuan Can Date: Tue Sep 27 01:39:28 2022 +0000 perf annotate: Remove unused struct disasm_line_samples After commit 3ab6db8d0f3b ("perf annotate browser: Use samples data from struct annotation_line"), no one use struct disasm_line_samples, so remove it. Signed-off-by: Yuan Can Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/20220927013931.110475-3-yuancan@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit dae09ffca00df015db96ffe3819777525cd26170 Author: Yuan Can Date: Tue Sep 27 01:39:27 2022 +0000 perf machine: Remove unused struct process_args After commit a93f0e551af9 ("perf symbols: Get kernel start address by symbol name"), no one uses struct process_args any more, so remove it. Signed-off-by: Yuan Can Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/20220927013931.110475-2-yuancan@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 433b31fa00797a2a6205a023e9345f2c5e7896b6 Author: Namhyung Kim Date: Mon Sep 26 14:56:38 2022 -0700 perf lock contention: Fix a build error on 32-bit It was reported that it failed to build the BPF lock contention skeleton on 32 bit arch due to the size of long. The lost count is used only for reporting errors due to lack of stackmap space through bad_hist which type is 'int'. Let's use int type then. Fixes: 6d499a6b3d90277d ("perf lock: Print the number of lost entries for BPF") Reported-by: Jiri Slaby Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Link: http://lore.kernel.org/lkml/20220926215638.3931222-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c7c43e38b236eb80ae6ee60d3dffd8f894cd751c Author: Shang XiaoJing Date: Thu Sep 22 22:14:38 2022 +0800 perf stat: Clean redundant if in process_evlist Since the first if statment is covered by the following one, clean up the first if statment. Signed-off-by: Shang XiaoJing Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220922141438.22487-5-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 9d157c89c5569f0ef560b7a5b2d7bf59ae98499c Author: Lukas Bulwahn Date: Thu Oct 6 10:01:54 2022 +0200 MAINTAINERS: adjust STARFIVE JH7100 PINCTRL DRIVER after file movement Commit ba7fdf88e98a ("pinctrl: Create subdirectory for StarFive drivers") moves pinctrl-starfive.c into its own subdirectory starfive; further, commit ba99b756da17 ("pinctrl: starfive: Rename "pinctrl-starfive" to "pinctrl-starfive-jh7100"") adds the suffix jh7100 to the driver and dt-bindings header file name. These commits however do not adjust the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Adjust the entries for STARFIVE JH7100 PINCTRL DRIVER after file movement. Signed-off-by: Lukas Bulwahn Reviewed-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20221006080154.5396-1-lukas.bulwahn@gmail.com Signed-off-by: Linus Walleij commit 5c13a4a0291b30191eff9ead8d010e1ca43a4d0c Author: M. Vefa Bicakci Date: Sun Oct 2 18:20:06 2022 -0400 xen/gntdev: Accommodate VMA splitting Prior to this commit, the gntdev driver code did not handle the following scenario correctly with paravirtualized (PV) Xen domains: * User process sets up a gntdev mapping composed of two grant mappings (i.e., two pages shared by another Xen domain). * User process munmap()s one of the pages. * User process munmap()s the remaining page. * User process exits. In the scenario above, the user process would cause the kernel to log the following messages in dmesg for the first munmap(), and the second munmap() call would result in similar log messages: BUG: Bad page map in process doublemap.test pte:... pmd:... page:0000000057c97bff refcount:1 mapcount:-1 \ mapping:0000000000000000 index:0x0 pfn:... ... page dumped because: bad pte ... file:gntdev fault:0x0 mmap:gntdev_mmap [xen_gntdev] readpage:0x0 ... Call Trace: dump_stack_lvl+0x46/0x5e print_bad_pte.cold+0x66/0xb6 unmap_page_range+0x7e5/0xdc0 unmap_vmas+0x78/0xf0 unmap_region+0xa8/0x110 __do_munmap+0x1ea/0x4e0 __vm_munmap+0x75/0x120 __x64_sys_munmap+0x28/0x40 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x61/0xcb ... For each munmap() call, the Xen hypervisor (if built with CONFIG_DEBUG) would print out the following and trigger a general protection fault in the affected Xen PV domain: (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... As of this writing, gntdev_grant_map structure's vma field (referred to as map->vma below) is mainly used for checking the start and end addresses of mappings. However, with split VMAs, these may change, and there could be more than one VMA associated with a gntdev mapping. Hence, remove the use of map->vma and rely on map->pages_vm_start for the original start address and on (map->count << PAGE_SHIFT) for the original mapping size. Let the invalidate() and find_special_page() hooks use these. Also, given that there can be multiple VMAs associated with a gntdev mapping, move the "mmu_interval_notifier_remove(&map->notifier)" call to the end of gntdev_put_map, so that the MMU notifier is only removed after the closing of the last remaining VMA. Finally, use an atomic to prevent inadvertent gntdev mapping re-use, instead of using the map->live_grants atomic counter and/or the map->vma pointer (the latter of which is now removed). This prevents the userspace from mmap()'ing (with MAP_FIXED) a gntdev mapping over the same address range as a previously set up gntdev mapping. This scenario can be summarized with the following call-trace, which was valid prior to this commit: mmap gntdev_mmap mmap (repeat mmap with MAP_FIXED over the same address range) gntdev_invalidate unmap_grant_pages (sets 'being_removed' entries to true) gnttab_unmap_refs_async unmap_single_vma gntdev_mmap (maps the shared pages again) munmap gntdev_invalidate unmap_grant_pages (no-op because 'being_removed' entries are true) unmap_single_vma (For PV domains, Xen reports that a granted page is being unmapped and triggers a general protection fault in the affected domain, if Xen was built with CONFIG_DEBUG) The fix for this last scenario could be worth its own commit, but we opted for a single commit, because removing the gntdev_grant_map structure's vma field requires guarding the entry to gntdev_mmap(), and the live_grants atomic counter is not sufficient on its own to prevent the mmap() over a pre-existing mapping. Link: https://github.com/QubesOS/qubes-issues/issues/7631 Fixes: ab31523c2fca ("xen/gntdev: allow usermode to map granted pages") Cc: stable@vger.kernel.org Signed-off-by: M. Vefa Bicakci Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221002222006.2077-3-m.v.b@runbox.com Signed-off-by: Juergen Gross commit 0991028cd49567d7016d1b224fe0117c35059f86 Author: M. Vefa Bicakci Date: Sun Oct 2 18:20:05 2022 -0400 xen/gntdev: Prevent leaking grants Prior to this commit, if a grant mapping operation failed partially, some of the entries in the map_ops array would be invalid, whereas all of the entries in the kmap_ops array would be valid. This in turn would cause the following logic in gntdev_map_grant_pages to become invalid: for (i = 0; i < map->count; i++) { if (map->map_ops[i].status == GNTST_okay) { map->unmap_ops[i].handle = map->map_ops[i].handle; if (!use_ptemod) alloced++; } if (use_ptemod) { if (map->kmap_ops[i].status == GNTST_okay) { if (map->map_ops[i].status == GNTST_okay) alloced++; map->kunmap_ops[i].handle = map->kmap_ops[i].handle; } } } ... atomic_add(alloced, &map->live_grants); Assume that use_ptemod is true (i.e., the domain mapping the granted pages is a paravirtualized domain). In the code excerpt above, note that the "alloced" variable is only incremented when both kmap_ops[i].status and map_ops[i].status are set to GNTST_okay (i.e., both mapping operations are successful). However, as also noted above, there are cases where a grant mapping operation fails partially, breaking the assumption of the code excerpt above. The aforementioned causes map->live_grants to be incorrectly set. In some cases, all of the map_ops mappings fail, but all of the kmap_ops mappings succeed, meaning that live_grants may remain zero. This in turn makes it impossible to unmap the successfully grant-mapped pages pointed to by kmap_ops, because unmap_grant_pages has the following snippet of code at its beginning: if (atomic_read(&map->live_grants) == 0) return; /* Nothing to do */ In other cases where only some of the map_ops mappings fail but all kmap_ops mappings succeed, live_grants is made positive, but when the user requests unmapping the grant-mapped pages, __unmap_grant_pages_done will then make map->live_grants negative, because the latter function does not check if all of the pages that were requested to be unmapped were actually unmapped, and the same function unconditionally subtracts "data->count" (i.e., a value that can be greater than map->live_grants) from map->live_grants. The side effects of a negative live_grants value have not been studied. The net effect of all of this is that grant references are leaked in one of the above conditions. In Qubes OS v4.1 (which uses Xen's grant mechanism extensively for X11 GUI isolation), this issue manifests itself with warning messages like the following to be printed out by the Linux kernel in the VM that had granted pages (that contain X11 GUI window data) to dom0: "g.e. 0x1234 still pending", especially after the user rapidly resizes GUI VM windows (causing some grant-mapping operations to partially or completely fail, due to the fact that the VM unshares some of the pages as part of the window resizing, making the pages impossible to grant-map from dom0). The fix for this issue involves counting all successful map_ops and kmap_ops mappings separately, and then adding the sum to live_grants. During unmapping, only the number of successfully unmapped grants is subtracted from live_grants. The code is also modified to check for negative live_grants values after the subtraction and warn the user. Link: https://github.com/QubesOS/qubes-issues/issues/7631 Fixes: dbe97cff7dd9 ("xen/gntdev: Avoid blocking in unmap_grant_pages()") Cc: stable@vger.kernel.org Signed-off-by: M. Vefa Bicakci Acked-by: Demi Marie Obenour Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221002222006.2077-2-m.v.b@runbox.com Signed-off-by: Juergen Gross commit 77be00f194b6e1647cddb644b7023b352c2c6ee8 Author: Oleksandr Tyshchenko Date: Wed Oct 5 20:48:23 2022 +0300 xen/virtio: Fix potential deadlock when accessing xen_grant_dma_devices As find_xen_grant_dma_data() is called from both interrupt and process contexts, the access to xen_grant_dma_devices XArray must be protected by xa_lock_irqsave to avoid deadlock scenario. As XArray API doesn't provide xa_store_irqsave helper, call lockless __xa_store directly and guard it externally. Also move the storage of the XArray's entry to a separate helper. Fixes: d6aca3504c7d ("xen/grant-dma-ops: Add option to restrict memory access under Xen") Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221005174823.1800761-3-olekstysh@gmail.com Signed-off-by: Juergen Gross commit e433715b116553892ecad8796018ae4b64304252 Author: Oleksandr Tyshchenko Date: Wed Oct 5 20:48:22 2022 +0300 xen/virtio: Fix n_pages calculation in xen_grant_dma_map(unmap)_page() Take page offset into the account when calculating the number of pages to be granted. Fixes: d6aca3504c7d ("xen/grant-dma-ops: Add option to restrict memory access under Xen") Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221005174823.1800761-2-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 06c62f8cbb1f660a4147b0d8cbe65cf2cfc1aa5a Author: Colin Ian King Date: Tue Oct 4 17:06:39 2022 +0100 xen/xenbus: Fix spelling mistake "hardward" -> "hardware" There is a spelling mistake in the module description. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20221004160639.154421-1-colin.i.king@gmail.com Signed-off-by: Juergen Gross commit 6b430f72b2bc14fd0ac922dda92eaa51c82e15a4 Author: Felix Fietkau Date: Tue Sep 27 11:38:23 2022 +0200 wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer mt7915 and newer need to report the rate_info that's stored in wcid->rate, since they don't fill info->status.rates. Cc: Jonas Jelonek Reported-by: Mikhail Gavrilov Link: https://lore.kernel.org/all/CABXGCsP0znm9pS-MiKtyxTXR7XiyFVqen0qzNpicGHDZKCzbwg@mail.gmail.com/ Fixes: 44fa75f207d8 ("mac80211: extend current rate control tx status API") Signed-off-by: Felix Fietkau Tested-by: Mikhail Gavrilov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927093823.6007-1-nbd@nbd.name commit 1d22f78d05737ce21bff7b88b6e58873f35e65ba Merge: f93719351b0e3 b12e924a2f5b9 Author: Jakub Kicinski Date: Wed Oct 5 20:38:46 2022 -0700 Merge tag 'ieee802154-for-net-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-10-05 Only two patches this time around. A revert from Alexander Aring to a patch that hit net and the updated patch to fix the problem from Tetsuo Handa. * tag 'ieee802154-for-net-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan: net/ieee802154: don't warn zero-sized raw_sendmsg() Revert "net/ieee802154: reject zero-sized raw_sendmsg()" ==================== Link: https://lore.kernel.org/r/20221005144508.787376-1-stefan@datenfreihafen.org Signed-off-by: Jakub Kicinski commit f93719351b0e3684675b3824708a735c0e57005e Author: Alexandru Tachici Date: Mon Oct 3 14:16:36 2022 +0300 net: ethernet: adi: adin1110: Add check in netdev_event Check whether this driver actually is the intended recipient of upper change event. Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20221003111636.54973-1-alexandru.tachici@analog.com Signed-off-by: Jakub Kicinski commit 229a0027591c970e89992313d87330a3cfe6d028 Author: Casper Andersson Date: Tue Oct 4 09:32:42 2022 +0200 docs: networking: phy: add missing space Missing space between "pins'" and "strength" Signed-off-by: Casper Andersson Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20221004073242.304425-1-casper.casan@gmail.com Signed-off-by: Jakub Kicinski commit 304ee24bdb43d095621669e926feab728454bc63 Author: Geert Uytterhoeven Date: Tue Oct 4 18:23:53 2022 +0200 net: pse-pd: PSE_REGULATOR should depend on REGULATOR The Regulator based PSE controller driver relies on regulator support to be enabled. If regulator support is disabled, it will still compile fine, but won't operate correctly. Hence add a dependency on REGULATOR, to prevent asking the user about this driver when configuring a kernel without regulator support. Fixes: 66741b4e94ca7bb1 ("net: pse-pd: add regulator based PSE driver") Signed-off-by: Geert Uytterhoeven Reviewed-by: Oleksij Rempel Link: https://lore.kernel.org/r/709caac8873ff2a8b72b92091429be7c1a939959.1664900558.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit af7b29b1deaac6da3bb7637f0e263dfab7bfc7a3 Author: Vladimir Oltean Date: Wed Oct 5 01:01:00 2022 +0300 Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs" taprio_attach() has this logic at the end, which should have been removed with the blamed patch (which is now being reverted): /* access to the child qdiscs is not needed in offload mode */ if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { kfree(q->qdiscs); q->qdiscs = NULL; } because otherwise, we make use of q->qdiscs[] even after this array was deallocated, namely in taprio_leaf(). Therefore, whenever one would try to attach a valid child qdisc to a fully offloaded taprio root, one would immediately dereference a NULL pointer. $ tc qdisc replace dev eno0 handle 8001: parent root taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ max-sdu 0 0 0 0 0 200 0 0 \ base-time 200 \ sched-entry S 80 20000 \ sched-entry S a0 20000 \ sched-entry S 5f 60000 \ flags 2 $ max_frame_size=1500 $ data_rate_kbps=20000 $ port_transmit_rate_kbps=1000000 $ idleslope=$data_rate_kbps $ sendslope=$(($idleslope - $port_transmit_rate_kbps)) $ locredit=$(($max_frame_size * $sendslope / $port_transmit_rate_kbps)) $ hicredit=$(($max_frame_size * $idleslope / $port_transmit_rate_kbps)) $ tc qdisc replace dev eno0 parent 8001:7 cbs \ idleslope $idleslope \ sendslope $sendslope \ hicredit $hicredit \ locredit $locredit \ offload 0 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 pc : taprio_leaf+0x28/0x40 lr : qdisc_leaf+0x3c/0x60 Call trace: taprio_leaf+0x28/0x40 tc_modify_qdisc+0xf0/0x72c rtnetlink_rcv_msg+0x12c/0x390 netlink_rcv_skb+0x5c/0x130 rtnetlink_rcv+0x1c/0x2c The solution is not as obvious as the problem. The code which deallocates q->qdiscs[] is in fact copied and pasted from mqprio, which also deallocates the array in mqprio_attach() and never uses it afterwards. Therefore, the identical cleanup logic of priv->qdiscs[] that mqprio_destroy() has is deceptive because it will never take place at qdisc_destroy() time, but just at raw ops->destroy() time (otherwise said, priv->qdiscs[] do not last for the entire lifetime of the mqprio root), but rather, this is just the twisted way in which the Qdisc API understands error path cleanup should be done (Qdisc_ops :: destroy() is called even when Qdisc_ops :: init() never succeeded). Side note, in fact this is also what the comment in mqprio_init() says: /* pre-allocate qdisc, attachment can't fail */ Or reworded, mqprio's priv->qdiscs[] scheme is only meant to serve as data passing between Qdisc_ops :: init() and Qdisc_ops :: attach(). [ this comment was also copied and pasted into the initial taprio commit, even though taprio_attach() came way later ] The problem is that taprio also makes extensive use of the q->qdiscs[] array in the software fast path (taprio_enqueue() and taprio_dequeue()), but it does not keep a reference of its own on q->qdiscs[i] (you'd think that since it creates these Qdiscs, it holds the reference, but nope, this is not completely true). To understand the difference between taprio_destroy() and mqprio_destroy() one must look before commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), because that just muddied the waters. In the "original" taprio design, taprio always attached itself (the root Qdisc) to all netdev TX queues, so that dev_qdisc_enqueue() would go through taprio_enqueue(). It also called qdisc_refcount_inc() on itself for as many times as there were netdev TX queues, in order to counter-balance what tc_get_qdisc() does when destroying a Qdisc (simplified for brevity below): if (n->nlmsg_type == RTM_DELQDISC) err = qdisc_graft(dev, parent=NULL, new=NULL, q, extack); qdisc_graft(where "new" is NULL so this deletes the Qdisc): for (i = 0; i < num_q; i++) { struct netdev_queue *dev_queue; dev_queue = netdev_get_tx_queue(dev, i); old = dev_graft_qdisc(dev_queue, new); if (new && i > 0) qdisc_refcount_inc(new); qdisc_put(old); ~~~~~~~~~~~~~~ this decrements taprio's refcount once for each TX queue } notify_and_destroy(net, skb, n, classid, rtnl_dereference(dev->qdisc), new); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and this finally decrements it to zero, making qdisc_put() call qdisc_destroy() The q->qdiscs[] created using qdisc_create_dflt() (or their replacements, if taprio_graft() was ever to get called) were then privately freed by taprio_destroy(). This is still what is happening after commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), but only for software mode. In full offload mode, the per-txq "qdisc_put(old)" calls from qdisc_graft() now deallocate the child Qdiscs rather than decrement taprio's refcount. So when notify_and_destroy(taprio) finally calls taprio_destroy(), the difference is that the child Qdiscs were already deallocated. And this is exactly why the taprio_attach() comment "access to the child qdiscs is not needed in offload mode" is deceptive too. Not only the q->qdiscs[] array is not needed, but it is also necessary to get rid of it as soon as possible, because otherwise, we will also call qdisc_put() on the child Qdiscs in qdisc_destroy() -> taprio_destroy(), and this will cause a nasty use-after-free/refcount-saturate/whatever. In short, the problem is that since the blamed commit, taprio_leaf() needs q->qdiscs[] to not be freed by taprio_attach(), while qdisc_destroy() -> taprio_destroy() does need q->qdiscs[] to be freed by taprio_attach() for full offload. Fixing one problem triggers the other. All of this can be solved by making taprio keep its q->qdiscs[i] with a refcount elevated at 2 (in offloaded mode where they are attached to the netdev TX queues), both in taprio_attach() and in taprio_graft(). The generic qdisc_graft() would just decrement the child qdiscs' refcounts to 1, and taprio_destroy() would give them the final coup de grace. However the rabbit hole of changes is getting quite deep, and the complexity increases. The blamed commit was supposed to be a bug fix in the first place, and the bug it addressed is not so significant so as to justify further rework in stable trees. So I'd rather just revert it. I don't know enough about multi-queue Qdisc design to make a proper judgement right now regarding what is/isn't idiomatic use of Qdisc concepts in taprio. I will try to study the problem more and come with a different solution in net-next. Fixes: 1461d212ab27 ("net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs") Reported-by: Muhammad Husaini Zulkifli Reported-by: Vinicius Costa Gomes Signed-off-by: Vladimir Oltean Reviewed-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20221004220100.1650558-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit b8ae88e1e75e5cb7a6df5298ab75334362ed631c Author: Eric Chanudet Date: Mon Oct 3 13:08:49 2022 -0400 mailbox: qcom-ipcc: flag IRQ NO_THREAD PREEMPT_RT forces qcom-ipcc's handler to be threaded with interrupts enabled, which triggers a warning in __handle_irq_event_percpu(): irq 173 handler irq_default_primary_handler+0x0/0x10 enabled interrupts WARNING: CPU: 0 PID: 77 at kernel/irq/handle.c:161 __handle_irq_event_percpu+0x4c4/0x4d0 Mark it IRQF_NO_THREAD to avoid running the handler in a threaded context with threadirqs or PREEMPT_RT enabled. Signed-off-by: Eric Chanudet Acked-by: Sebastian Andrzej Siewior Signed-off-by: Jassi Brar commit 8ac1111055afc863c78e389b051d843babbf2ca9 Author: Colin Ian King Date: Wed Sep 28 22:22:57 2022 +0100 mailbox: pcc: Fix spelling mistake "Plaform" -> "Platform" There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Jassi Brar commit 6b207ce8a96a71e966831e3a13c38143ba9a73c1 Author: Jack Wang Date: Fri Aug 26 12:13:35 2022 +0200 mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg dma_map_sg return 0 on error, fix the error check, and return -EIO to caller. Fixes: dbc049eee730 ("mailbox: Add driver for Broadcom FlexRM ring manager") Signed-off-by: Jack Wang Signed-off-by: Jassi Brar commit f5fe925df802eb3c7a71a97c01cf371eea24ea6a Author: Robert Marko Date: Fri Aug 19 00:08:48 2022 +0200 mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support IPQ8074 has the APSS clock controller utilizing the same register space as the APCS, so provide access to the APSS utilizing a child device like IPQ6018. IPQ6018 and IPQ8074 use the same controller and driver, so just utilize IPQ6018 match data for IPQ8074. Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov Signed-off-by: Jassi Brar commit 75d439edb1550d3cc7f33c1fd4abe4aef288d780 Author: Robert Marko Date: Fri Aug 19 00:08:47 2022 +0200 dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 IPQ6018 APSS driver is registered by APCS as they share the same register space, and it uses "pll" and "xo" as inputs. Correct the allowed clocks for IPQ6018 and IPQ8074 as they share the same driver to allow "pll" and "xo" as clock-names. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jassi Brar commit f3d961299cdd484e1aeb60b392a4c5efaf323a9c Author: Robert Marko Date: Fri Aug 19 00:08:46 2022 +0200 dt-bindings: mailbox: qcom: set correct #clock-cells IPQ6018 and IPQ8074 require #clock-cells to be set to 1 as their APSS clock driver provides multiple clock outputs. So allow setting 1 as #clock-cells and check that its set to 1 for IPQ6018 and IPQ8074, check others for 0 as its currently. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jassi Brar commit 0d1aadfe10ba17ebdeb96abb9638eb0f623f9b55 Author: Conor Dooley Date: Wed Aug 24 08:08:12 2022 +0100 mailbox: mpfs: account for mbox offsets while sending The mailbox offset is not only used for receiving messages, but it is also used by messages sent to the system controller by Linux that have a payload, such as the "digital signature service". It is also overloaded by certain other services (reprogramming of the FPGA fabric, see Link:) to have a meaning other than the offset the system controller should read from. When the driver was written, no such services of the latter type were in use & those of the former used an offset of zero so this has gone un-noticed. Link: https://www.microsemi.com/document-portal/doc_download/1245815-polarfire-fpga-and-polarfire-soc-fpga-system-services-user-guide # Section 5.2 Fixes: 83d7b1560810 ("mbox: add polarfire soc system controller mailbox") Signed-off-by: Conor Dooley Signed-off-by: Jassi Brar commit 2e10289d1f304f5082a4dda55a677b72b3bdb581 Author: Conor Dooley Date: Wed Aug 24 08:08:11 2022 +0100 mailbox: mpfs: fix handling of the reg property The "data" region of the PolarFire SoC's system controller mailbox is not one continuous register space - the system controller's QSPI sits between the control and data registers. Split the "data" reg into two parts: "data" & "control". Optionally get the "data" register address from the 3rd reg property in the devicetree & fall back to using the old base + MAILBOX_REG_OFFSET that the current code uses. Fixes: 83d7b1560810 ("mbox: add polarfire soc system controller mailbox") Signed-off-by: Conor Dooley Signed-off-by: Jassi Brar commit 6e2bdf7dc3c817dd91d84adb306a5dfab999c309 Author: Conor Dooley Date: Wed Aug 24 08:08:10 2022 +0100 dt-bindings: mailbox: fix the mpfs' reg property The "data" region of the PolarFire SoC's system controller mailbox is not one continuous register space - the system controller's QSPI sits between the control and data registers. Split the "data" reg into two parts: "data" & "control". Fixes: 213556235526 ("dt-bindings: soc/microchip: update syscontroller compatibles") Fixes: ed9543d6f2c4 ("dt-bindings: add bindings for polarfire soc mailbox") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Signed-off-by: Jassi Brar commit 7e5cd064f73ccecd2ac1aadca078394bd25ea3ce Author: Peng Fan Date: Mon Sep 19 11:01:36 2022 +0800 mailbox: imx: fix RST channel support Because IMX_MU_xCR_MAX was increased to 5, some mu cfgs were not updated to include the CR register. Add the missed CR register to xcr array. Fixes: 82ab513baed5 ("mailbox: imx: support RST channel") Reported-by: Liu Ying Signed-off-by: Peng Fan Tested-by: Liu Ying # i.MX8qm/qxp MEK boards boot Signed-off-by: Jassi Brar commit a541a9559bb0a8ecc434de01d3e4826c32e8bb53 Author: Steven Rostedt (Google) Date: Wed Oct 5 11:37:57 2022 -0400 tracing: Do not free snapshot if tracer is on cmdline The ftrace_boot_snapshot and alloc_snapshot cmdline options allocate the snapshot buffer at boot up for use later. The ftrace_boot_snapshot in particular requires the snapshot to be allocated because it will take a snapshot at the end of boot up allowing to see the traces that happened during boot so that it's not lost when user space takes over. When a tracer is registered (started) there's a path that checks if it requires the snapshot buffer or not, and if it does not and it was allocated it will do a synchronization and free the snapshot buffer. This is only required if the previous tracer was using it for "max latency" snapshots, as it needs to make sure all max snapshots are complete before freeing. But this is only needed if the previous tracer was using the snapshot buffer for latency (like irqoff tracer and friends). But it does not make sense to free it, if the previous tracer was not using it, and the snapshot was allocated by the cmdline parameters. This basically takes away the point of allocating it in the first place! Note, the allocated snapshot worked fine for just trace events, but fails when a tracer is enabled on the cmdline. Further investigation, this goes back even further and it does not require a tracer on the cmdline to fail. Simply enable snapshots and then enable a tracer, and it will remove the snapshot. Link: https://lkml.kernel.org/r/20221005113757.041df7fe@gandalf.local.home Cc: Masami Hiramatsu Cc: Andrew Morton Cc: stable@vger.kernel.org Fixes: 45ad21ca5530 ("tracing: Have trace_array keep track if snapshot buffer is allocated") Reported-by: Ross Zwisler Tested-by: Ross Zwisler Signed-off-by: Steven Rostedt (Google) commit cf04f2d5df0037741207382ac8fe289e8bf84ced Author: Steven Rostedt (Google) Date: Wed Oct 5 00:38:09 2022 -0400 ftrace: Still disable enabled records marked as disabled Weak functions started causing havoc as they showed up in the "available_filter_functions" and this confused people as to why some functions marked as "notrace" were listed, but when enabled they did nothing. This was because weak functions can still have fentry calls, and these addresses get added to the "available_filter_functions" file. kallsyms is what converts those addresses to names, and since the weak functions are not listed in kallsyms, it would just pick the function before that. To solve this, there was a trick to detect weak functions listed, and these records would be marked as DISABLED so that they do not get enabled and are mostly ignored. As the processing of the list of all functions to figure out what is weak or not can take a long time, this process is put off into a kernel thread and run in parallel with the rest of start up. Now the issue happens whet function tracing is enabled via the kernel command line. As it starts very early in boot up, it can be enabled before the records that are weak are marked to be disabled. This causes an issue in the accounting, as the weak records are enabled by the command line function tracing, but after boot up, they are not disabled. The ftrace records have several accounting flags and a ref count. The DISABLED flag is just one. If the record is enabled before it is marked DISABLED it will get an ENABLED flag and also have its ref counter incremented. After it is marked for DISABLED, neither the ENABLED flag nor the ref counter is cleared. There's sanity checks on the records that are performed after an ftrace function is registered or unregistered, and this detected that there were records marked as ENABLED with ref counter that should not have been. Note, the module loading code uses the DISABLED flag as well to keep its functions from being modified while its being loaded and some of these flags may get set in this process. So changing the verification code to ignore DISABLED records is a no go, as it still needs to verify that the module records are working too. Also, the weak functions still are calling a trampoline. Even though they should never be called, it is dangerous to leave these weak functions calling a trampoline that is freed, so they should still be set back to nops. There's two places that need to not skip records that have the ENABLED and the DISABLED flags set. That is where the ftrace_ops is processed and sets the records ref counts, and then later when the function itself is to be updated, and the ENABLED flag gets removed. Add a helper function "skip_record()" that returns true if the record has the DISABLED flag set but not the ENABLED flag. Link: https://lkml.kernel.org/r/20221005003809.27d2b97b@gandalf.local.home Cc: Masami Hiramatsu Cc: Andrew Morton Cc: stable@vger.kernel.org Fixes: b39181f7c6907 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function") Signed-off-by: Steven Rostedt (Google) commit 542d353e25520e7db11d2cdb31d19c50ed921812 Author: Jisheng Zhang Date: Sun Aug 21 22:18:19 2022 +0800 riscv: compat: s/failed/unsupported if compat mode isn't supported When compat mode isn't supported(I believe this is the most case now), kernel will emit somthing as: [ 0.050407] riscv: ELF compat mode failed This msg may make users think there's something wrong with the kernel itself, replace "failed" with "unsupported" to make it clear. In fact this is the real compat_mode_supported meaning. After the patch, the msg would be: [ 0.050407] riscv: ELF compat mode unsupported Signed-off-by: Jisheng Zhang Acked-by: Guo Ren Link: https://lore.kernel.org/r/20220821141819.3804-1-jszhang@kernel.org/ Signed-off-by: Palmer Dabbelt commit 0715fdb03e2c4f5748d245a231e422602ed29f33 Author: Masahiro Yamada Date: Sun Oct 2 05:28:35 2022 +0900 docs: bump minimal GNU Make version to 3.82 GNU Make 3.81 fails in CONFIG_RUST=y builds. rust/Makefile:105: *** multiple target patterns. Stop. make[1]: *** [prepare] Error 2 make: *** [__sub-make] Error 2 The error message is unclear, but the reason is because the 'private' keyword is only supported since GNU Make 3.82. GNU Make 3.81 is still able to build the kernel when CONFIG_RUST is disabled, but it might be a good timing to raise the minimal GNU Make version. Perhaps, I am the last person who was testing GNU Make 3.81. GNU Make 3.81 was released in 2006, GNU Make 3.82 in 2010. Signed-off-by: Masahiro Yamada Reviewed-by: Miguel Ojeda commit f5823f5ee36040c2a8b8b36afe0783fe0bd7ad14 Author: Muhammad Usama Anjum Date: Tue Oct 4 11:23:32 2022 +0500 cifs: remove initialization value Don't initialize the rc as its value is being overwritten before its use. Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Muhammad Usama Anjum Signed-off-by: Steve French commit 943deb6066538aeb5417eae5fdc222defdcb9949 Author: Gustavo A. R. Silva Date: Tue Oct 4 20:51:39 2022 -0500 cifs: Replace a couple of one-element arrays with flexible-array members One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array member in structs negotiate_req and extended_response, and refactor the rest of the code, accordingly. Also, make use of the DECLARE_FLEX_ARRAY() helper to declare flexible array member EncryptionKey in union u. This new helper allows for flexible-array members in unions. Change pointer notation to proper array notation in a call to memcpy() where flexible-array member DialectsArray is being used as destination argument. Important to mention is that doing a build before/after this patch results in no binary output differences. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/229 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1] Reviewed-by: Kees Cook Reviewed-by: Ronnie Sahlberg Signed-off-by: Gustavo A. R. Silva Signed-off-by: Steve French commit 4659f01e3cd94f64d9bd06764ace2ef8fe1b6227 Author: Steve French Date: Sat Oct 1 11:44:08 2022 -0500 smb3: do not log confusing message when server returns no network interfaces Some servers can return an empty network interface list so, unless multichannel is requested, no need to log an error for this, and when multichannel is requested on mount but no interfaces, log something less confusing. For this case change parse_server_interfaces: malformed interface info to empty network interface list returned by server localhost Also do not relog this error every ten minutes (only log on mount, once) Cc: Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 17fc2a3f41b37596bbcf1e6b765f0620a8f34c9a Merge: 14868d783c16b e01bae16a7d68 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:58 2022 -0500 Merge branch 'pci/misc' - Use the for_each_pci_dev() helper instead of open-coding it (Yang Yingliang) * pci/misc: PCI/P2PDMA: Use for_each_pci_dev() helper commit 14868d783c16b2f7cd46ca1f7fe23b84cdae911d Merge: e302bafff6fa5 8bb7ff12a9142 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:57 2022 -0500 Merge branch 'remotes/lorenzo/pci/misc' - Add macros for PCI Configuration Mechanism #1 and use them in the ftpci100, mt7621, and tegra drivers (Pali Rohár) * remotes/lorenzo/pci/misc: PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro PCI: mt7621: Use PCI_CONF1_EXT_ADDRESS() macro PCI: ftpci100: Use PCI_CONF1_ADDRESS() macro PCI: Add standard PCI Config Address macros commit e302bafff6fa5192c8d7afe8387d7fd2a45ce799 Merge: fba236f96ccb3 94f0b955e4ed6 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:57 2022 -0500 Merge branch 'pci/qcom' - List platforms that use a single MSI host interrupt in qcom DT (Johan Hovold) - Add SC8280XP, SA8540P support to qcom DT binding and driver(Johan Hovold) - Make all optional clocks truly optional in the driver (Johan Hovold) - Rename per-IP structs to reflect the IP version (Johan Hovold) - Sort device ID match table by compatible string (Johan Hovold) - Add MODULE_DEVICE_TABLE to enable module autoloading (Dmitry Baryshkov) - Drop the unused .post_deinit() callback (Johan Hovold) - Rely on DT for clock information instead of hard-coding it in the driver (Manivannan Sadhasivam) - Disable IRQs when removing driver to avoid spurious IRQs later (Manivannan Sadhasivam) - Expose link transition counts via debugfs to help debug issues with low-power states (Manivannan Sadhasivam) - Gate Master AXI clock to the MHI bus while in L1 substates to save power (Manivannan Sadhasivam) - Disable Master AXI clock to save power when there is no traffic on PCIe (Manivannan Sadhasivam) - Make the "PERST separation" debug feature optional in the DT and the driver (Manivannan Sadhasivam) - Define clocks to be per-platform in DT to prepare for future SoCs (Manivannan Sadhasivam) - Add SM8450 SoC support (Manivannan Sadhasivam) - Check for platform_get_resource_byname() to avoid a NULL pointer dereference (Yang Yingliang) * pci/qcom: PCI: qcom-ep: Check platform_get_resource_byname() return value PCI: qcom-ep: Add support for SM8450 SoC dt-bindings: PCI: qcom-ep: Add support for SM8450 SoC dt-bindings: PCI: qcom-ep: Define clocks per platform PCI: qcom-ep: Make PERST separation optional dt-bindings: PCI: qcom-ep: Make PERST separation optional PCI: qcom-ep: Disable Master AXI Clock when there is no PCIe traffic PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS PCI: qcom-ep: Expose link transition counts via debugfs PCI: qcom-ep: Disable IRQs during driver remove PCI: qcom-ep: Make use of the cached dev pointer PCI: qcom-ep: Rely on the clocks supplied by devicetree PCI: qcom-ep: Add kernel-doc for qcom_pcie_ep structure PCI: qcom: Rename host-init error label PCI: qcom: Drop unused post_deinit callback PCI: qcom-ep: Add MODULE_DEVICE_TABLE PCI: qcom: Sort device-id table PCI: qcom: Clean up IP configurations PCI: qcom: Make all optional clocks optional PCI: qcom: Add support for SA8540P PCI: qcom: Add support for SC8280XP dt-bindings: PCI: qcom: Add SA8540P to binding dt-bindings: PCI: qcom: Add SC8280XP to binding dt-bindings: PCI: qcom: Enumerate platforms with single msi interrupt commit fba236f96ccb3982799b54f5b26a988e4c08f562 Merge: 7cb0a666998dd 2e379ac66d4b7 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:56 2022 -0500 Merge branch 'remotes/lorenzo/pci/mvebu' - Fix endianness of emulated bridge iolimitupper, iobaseupper, memlimit and membase members (Pali Rohár) * remotes/lorenzo/pci/mvebu: PCI: mvebu: Fix endianness when accessing PCI emul bridge members commit 7cb0a666998ddc5c2ca9c5dcaf916dd48c4eef0c Merge: fefb75d842494 034fdac01fe51 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:56 2022 -0500 Merge branch 'remotes/lorenzo/pci/mediatek' - Rename the pcie-mediatek-gen3 driver from 'mtk-pcie' to 'mtk-pcie-gen3' so it can coexist with the pcie-mediatek driver, which also uses 'mtk-pcie' (Felix Fietkau) * remotes/lorenzo/pci/mediatek: PCI: mediatek-gen3: Change driver name to mtk-pcie-gen3 commit fefb75d842494f54c7ff0931ecec66c988eff0c9 Merge: 3de810ac719dc cbcf8722b523d Author: Bjorn Helgaas Date: Wed Oct 5 17:32:56 2022 -0500 Merge branch 'remotes/lorenzo/pci/dwc' - Use dmam_alloc_coherent() instead of dma_map_page() to allocate the MSI target page, which means dwc drivers will work even when ZONE_DMA32 is disabled (Will McVicker) - If we can't allocate an MSI target page with a 32-bit address, try allocating one with a 64-bit address (Will McVicker) - Switch from of_gpio_named_count() to generic gpiod_count() (Andy Shevchenko) - Add support for i.MX8MP PCIe (Richard Zhu) - Fix the Freescale i.MX8 PHY driver, which had interchanged the phy_init() and phy_power_on() interfaces (Richard Zhu) * remotes/lorenzo/pci/dwc: phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on() PCI: imx6: Add i.MX8MP PCIe support PCI: dwc: Replace of_gpio_named_count() by gpiod_count() PCI: dwc: Drop dependency on ZONE_DMA32 commit 3de810ac719dcdfe87888a45a42d64d71a7533d8 Merge: 84aabff88098a 1abbe04a1b552 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:55 2022 -0500 Merge branch 'remotes/lorenzo/pci/dt' - Add MT8188 and MT8195 to mediatek-gen3 DT binding (Jianjun Wang) - Add 'clock-names' back to fu740 DT binding (Conor Dooley) - Add 'clocks', 'clock-names', 'dma-ranges' to microchip DT binding (Conor Dooley) - Add 'aggre0' and 'aggre1' clocks to qcom DT binding (Krishna chaitanya chundru) * remotes/lorenzo/pci/dt: dt-bindings: pci: QCOM Add missing sc7280 aggre0, aggre1 clocks dt-bindings: PCI: microchip,pcie-host: fix missing dma-ranges dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties dt-bindings: PCI: fu740-pci: fix missing clock-names dt-bindings: PCI: mediatek-gen3: Add support for MT8188 and MT8195 commit 84aabff88098af3121498443abe48ad489550f58 Merge: 9d17becd49d16 658aea35ab88d Author: Bjorn Helgaas Date: Wed Oct 5 17:32:55 2022 -0500 Merge branch 'remotes/lorenzo/pci/bridge-emul' - In an emulated PCI bridge, set Capability offsets so they match the hardware offsets shown by U-Boot (Pali Rohár) * remotes/lorenzo/pci/bridge-emul: PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value commit 9d17becd49d168443362e54a74eeca2b174dd70c Merge: ec6daf2535083 a6b9ede1f3dfa Author: Bjorn Helgaas Date: Wed Oct 5 17:32:54 2022 -0500 Merge branch 'remotes/lorenzo/pci/apple' - Switch from gpiod_get_from_of_node() to generic devm GPIO API (Dmitry Torokhov) * remotes/lorenzo/pci/apple: PCI: apple: Do not leak reset GPIO on unbind/unload/error commit ec6daf2535083fad917e1c621a59d90b942d52f2 Merge: 99e2c73df8820 a080f9ad60459 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:54 2022 -0500 Merge branch 'remotes/lorenzo/pci/aardvark' - Emulate the PCI Bridge Subsystem Vendor ID (Pali Rohár) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge commit 99e2c73df882096d8139323f9827195718b50fcb Merge: c3acb5661986e 0e32818397426 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:54 2022 -0500 Merge branch 'pci/resource' - Distribute resources to unconfigured hotplug bridges at boot-time (not just when hot-adding such a bridge), which makes hot-adding devices to docks work (Mika Westerberg) - Fix the "revert to firmware assignment" code so we do the revert only if the address is actually reachable. Previously we sometimes assigned addresses that could not be reached via upstream bridges (Maciej W. Rozycki) * pci/resource: PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge PCI: Fix typo in pci_scan_child_bus_extend() PCI: Fix whitespace and indentation PCI: Distribute available resources for root buses, too PCI: Move pci_assign_unassigned_root_bus_resources() PCI: Pass available buses even if the bridge is already configured PCI: Fix used_buses calculation in pci_scan_child_bus_extend() commit c3acb5661986e2b9bafa2900307d37752c94fb62 Merge: 034f93fcb12f5 91fa127794ac1 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:53 2022 -0500 Merge branch 'pci/rebar' - Expose a sysfs interface for configuring Resizable BARs so we can resize BARs before assigning devices to a VM through VFIO (Alex Williamson) * pci/rebar: PCI: Expose PCIe Resizable BAR support via sysfs commit 034f93fcb12f579c0108c7e2ca2d17ec4e5170aa Merge: 519e512110e45 3e347969a5776 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:53 2022 -0500 Merge branch 'pci/pm' - Cache the PTM capability offset instead of searching for it every time (Bjorn Helgaas) - Separate PTM configuration from PTM enable (Bjorn Helgaas) - Add pci_suspend_ptm() and pci_resume_ptm() to disable and re-enable PTM on suspend/resume so some Root Ports can safely enter a lower-power PM state (Bjorn Helgaas) - Disable PTM for all devices during suspend; previously we only did this for Root Ports and even then only in certain cases (Bjorn Helgaas) - Simplify pci_pm_suspend_noirq() (Rajvi Jingar) - Reduce the delay after transitions to/from D3hot by using usleep_range() instead of msleep(), which reduces the typical delay from 19ms to 10ms (Sajid Dalvi, Will McVicker) * pci/pm: PCI/PM: Reduce D3hot delay with usleep_range() PCI/PM: Simplify pci_pm_suspend_noirq() PCI/PM: Always disable PTM for all devices during suspend PCI/PTM: Consolidate PTM interface declarations PCI/PTM: Reorder functions in logical order PCI/PTM: Preserve RsvdP bits in PTM Control register PCI/PTM: Move pci_ptm_info() body into its only caller PCI/PTM: Add pci_suspend_ptm() and pci_resume_ptm() PCI/PTM: Separate configuration and enable PCI/PTM: Add pci_upstream_ptm() helper PCI/PTM: Cache PTM Capability offset commit 519e512110e45c818ea8bd5c657b246d87c5ccd8 Merge: f9538e27a2d9a 2b96f92ca4257 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:53 2022 -0500 Merge branch 'pci/msi' - Correct a typo in 71020a3c0dff4 ('PCI/MSI: Use msi_add_msi_desc()') that reversed the sense of 'can_mask' in msi_add_msi_desc() (Josef Johansson) * pci/msi: PCI/MSI: Correct 'can_mask' test in msi_add_msi_desc() commit f9538e27a2d9a386b1b488075e687867c599cd51 Merge: c1c2d8921f10f 5459c0b704675 Author: Bjorn Helgaas Date: Wed Oct 5 17:32:52 2022 -0500 Merge branch 'pci/dpc' - Work around a BIOS defect that makes some Intel Root Ports report an RP PIO log size of zero (Mika Westerberg) * pci/dpc: PCI/DPC: Quirk PIO log size for certain Intel Root Ports commit c1c2d8921f10f8b81c57ed3838f150bb711c83c0 Merge: 568035b01cfb1 7afeb84d14eaa Author: Bjorn Helgaas Date: Wed Oct 5 17:32:52 2022 -0500 Merge branch 'pci/aspm' - Save L1 PM Substates Capability across suspend/resume so L1SS keeps working after resume (Vidya Sagar) - If device lacks L1 PM Substates Capability, don't read junk and treat it as such a Capability (Bjorn Helgaas) - Fix the LTR_L1.2_THRESHOLD computation, which previously configured the threshold for entering L1.2 to be lower than intended, so L1.2 could be used when it shouldn't be (Bjorn Helgaas) * pci/aspm: PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation PCI/ASPM: Ignore L1 PM Substates if device lacks capability PCI/ASPM: Factor out L1 PM Substates configuration PCI/ASPM: Save L1 PM Substates Capability for suspend/resume PCI/ASPM: Refactor L1 PM Substates Control Register programming commit 94f0b955e4ed610e4ee93ee72b88c4415bed685d Author: Yang Yingliang Date: Fri Apr 29 16:07:40 2022 +0800 PCI: qcom-ep: Check platform_get_resource_byname() return value If platform_get_resource_byname() fails, 'mmio_res' will be set to NULL pointer, which causes a NULL pointer dereference when it is used in qcom_pcie_perst_deassert(). Check the return value to prevent it. Link: https://lore.kernel.org/r/20220429080740.1294797-1-yangyingliang@huawei.com Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") Signed-off-by: Yang Yingliang Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Andrew Halaney commit 867ec26c16064b271b1d5fd292a1610ed3a754ec Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:50 2022 +0530 PCI: qcom-ep: Add support for SM8450 SoC Add support for SM8450 SoC to the Qualcomm PCIe Endpoint Controller driver. The driver uses the same config as the existing SDX55 chipset, so additional settings are not required. Link: https://lore.kernel.org/r/20220914075350.7992-13-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 63e445b746aa466525a483b81581e4798eb2f321 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:49 2022 +0530 dt-bindings: PCI: qcom-ep: Add support for SM8450 SoC Add devicetree bindings support for SM8450 SoC. Only the clocks are different on this platform, rest is same as SDX55. Link: https://lore.kernel.org/r/20220914075350.7992-12-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Rob Herring commit 8dffa879ac79ffb6421dd924e74e6d07b0996207 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:48 2022 +0530 dt-bindings: PCI: qcom-ep: Define clocks per platform In preparation for adding the bindings for future SoCs, define the clocks per platform. Link: https://lore.kernel.org/r/20220914075350.7992-11-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Kozlowski commit aa4b1753625ce97a703e71928f67bac07d9d2b55 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:47 2022 +0530 PCI: qcom-ep: Make PERST separation optional PERST separation is an optional debug feature used to collect the crash dump from the PCIe endpoint devices by the PCIe host when the endpoint crashes. This feature keeps the PCIe link up by separating the PCIe IP block from the SoC reset logic. Make the property optional in the driver. Link: https://lore.kernel.org/r/20220914075350.7992-10-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 299915d6bee257880139528cd3d293707717eca5 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:46 2022 +0530 dt-bindings: PCI: qcom-ep: Make PERST separation optional PERST separation is an optional debug feature used to collect the crash dump from the PCIe endpoint devices by the PCIe host when the endpoint crashes. This feature keeps the PCIe link up by separating the PCIe IP block from the SoC reset logic. Remove the corresponding property "qcom,perst-regs" from the required properties list. Link: https://lore.kernel.org/r/20220914075350.7992-9-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Krzysztof Kozlowski commit 0391632948d9c1394601ae56d0cb25a1630874ed Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:45 2022 +0530 PCI: qcom-ep: Disable Master AXI Clock when there is no PCIe traffic The Master AXI clock can be disabled when it is not used i.e., when there is no traffic on the PCIe bus. This helps to save power during idle state. [bhelgaas: tidy and wrap comment] Link: https://lore.kernel.org/r/20220914075350.7992-8-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 689fe57e7ecefd2eeba76c32aa569bb3e1e790d9 Author: Jaegeuk Kim Date: Fri Sep 30 15:48:24 2022 -0700 f2fs: allow direct read for zoned device This reverts dbf8e63f48af ("f2fs: remove device type check for direct IO"), and apply the below first version, since it contributed out-of-order DIO writes. For zoned devices, f2fs forbids direct IO and forces buffered IO to serialize write IOs. However, the constraint does not apply to read IOs. Cc: stable@vger.kernel.org Fixes: dbf8e63f48af ("f2fs: remove device type check for direct IO") Signed-off-by: Eunhee Rho Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 189a2aaef9cbee4cd7c3d1bd142f790cc14c598e Author: Tom Rix Date: Mon Jul 18 22:27:43 2022 -0400 power: supply: ab8500: remove unused static local variable cpp_check reports [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used. From inspection, this variable is never used. So remove it. Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers") Signed-off-by: Tom Rix Reviewed-by: Linus Walleij Reviewed-by: Chen Lifu Signed-off-by: Sebastian Reichel commit e4266f23ecdf0d3d1f1d9e8fff730e1f962b0687 Author: Chuck Lever Date: Wed Sep 28 09:00:48 2022 -0400 xprtrdma: Fix uninitialized variable net/sunrpc/xprtrdma/frwr_ops.c:151:32: warning: variable 'rc' is uninitialized when used here [-Wuninitialized] trace_xprtrdma_frwr_alloc(mr, rc); ^~ net/sunrpc/xprtrdma/frwr_ops.c:127:8: note: initialize the variable 'rc' to silence this warning int rc; ^ = 0 1 warning generated. The tracepoint is intended to record the error returned from ib_alloc_mr(). In the current code there is no other purpose for @rc, so simply replace it. Reported-by: kernel test robot Fixes: d8cf39a280c3b0 ('xprtrdma: MR-related memory allocation should be allowed to fail') Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit f20f18c95630e9b53f5081fd5df3bb705c450bbe Author: Chuck Lever Date: Fri Sep 23 09:06:37 2022 -0400 xprtrdma: Prevent memory allocations from driving a reclaim Many memory allocations that xprtrdma does can fail safely. Let's use this fact to avoid some potential deadlocks: Replace GFP_KERNEL with GFP flags that do not try hard to acquire memory. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 9c8f332fbf995dc1d4d30a973d7ad6e1adb56437 Author: Chuck Lever Date: Fri Sep 23 09:06:30 2022 -0400 xprtrdma: Memory allocation should be allowed to fail during connect An attempt to establish a connection can always fail and then be retried. GFP_KERNEL allocation is not necessary here. Like MR allocation, establishing a connection is always done in a worker thread. The new GFP flags align with the flags that would be returned by rpc_task_gfp_mask() in this case. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 2d77058cce9fbff3d69cc05d4eb695f4ff421c03 Author: Chuck Lever Date: Fri Sep 23 09:06:24 2022 -0400 xprtrdma: MR-related memory allocation should be allowed to fail xprtrdma always drives a retry of MR allocation if it should fail. It should be safe to not use GFP_KERNEL for this purpose rather than sleeping in the memory allocator. In theory, if these weaker allocations are attempted first, memory exhaustion is likely to cause xprtrdma to fail fast and not then invoke the RDMA core APIs, which still might use GFP_KERNEL. Also note that rpc_task_gfp_mask() always sets __GFP_NORETRY and __GFP_NOWARN when an RPC-related allocation is being done in a worker thread. MR allocation is already always done in worker threads. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 7ac1879875fffa8f7acfe8b8d6932a039f2b736d Author: Chuck Lever Date: Fri Sep 23 09:06:18 2022 -0400 xprtrdma: Clean up synopsis of rpcrdma_regbuf_alloc() Currently all rpcrdma_regbuf_alloc() call sites pass the same value as their third argument. That argument can therefore be eliminated. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 3b50cc1c7f2170f2eb0fec040b6c3a8574026fce Author: Chuck Lever Date: Fri Sep 23 09:06:11 2022 -0400 xprtrdma: Clean up synopsis of rpcrdma_req_create() Commit 1769e6a816df ("xprtrdma: Clean up rpcrdma_create_req()") added rpcrdma_req_create() with a GFP flags argument in case a caller might want to avoid waiting for memory. There has never been a caller that does not pass GFP_KERNEL as the third argument. That argument can therefore be eliminated. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5014831264b05be11090668ae2211e64a1765f7e Author: Chuck Lever Date: Fri Sep 23 09:06:05 2022 -0400 svcrdma: Clean up RPCRDMA_DEF_GFP xprt_rdma_bc_allocate() is now the only user of RPCRDMA_DEF_GFP. Replace that macro with the raw flags. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 6b1eb3b22272713b5153deba812b6e3943ddd683 Author: Chuck Lever Date: Sun Sep 18 13:28:16 2022 -0400 SUNRPC: Replace the use of the xprtiod WQ in rpcrdma While setting up a new lab, I accidentally misconfigured the Ethernet port for a system that tried an NFS mount using RoCE. This made the NFS server unreachable. The following WARNING popped on the NFS client while waiting for the mount attempt to time out: kernel: workqueue: WQ_MEM_RECLAIM xprtiod:xprt_rdma_connect_worker [rpcrdma] is flushing !WQ_MEM_RECLAI> kernel: WARNING: CPU: 0 PID: 100 at kernel/workqueue.c:2628 check_flush_dependency+0xbf/0xca kernel: Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs 8021q garp stp mrp llc rfkill rpcrdma> kernel: CPU: 0 PID: 100 Comm: kworker/u8:8 Not tainted 6.0.0-rc1-00002-g6229f8c054e5 #13 kernel: Hardware name: Supermicro X10SRA-F/X10SRA-F, BIOS 2.0b 06/12/2017 kernel: Workqueue: xprtiod xprt_rdma_connect_worker [rpcrdma] kernel: RIP: 0010:check_flush_dependency+0xbf/0xca kernel: Code: 75 2a 48 8b 55 18 48 8d 8b b0 00 00 00 4d 89 e0 48 81 c6 b0 00 00 00 48 c7 c7 65 33 2e be> kernel: RSP: 0018:ffffb562806cfcf8 EFLAGS: 00010092 kernel: RAX: 0000000000000082 RBX: ffff97894f8c3c00 RCX: 0000000000000027 kernel: RDX: 0000000000000002 RSI: ffffffffbe3447d1 RDI: 00000000ffffffff kernel: RBP: ffff978941315840 R08: 0000000000000000 R09: 0000000000000000 kernel: R10: 00000000000008b0 R11: 0000000000000001 R12: ffffffffc0ce3731 kernel: R13: ffff978950c00500 R14: ffff97894341f0c0 R15: ffff978951112eb0 kernel: FS: 0000000000000000(0000) GS:ffff97987fc00000(0000) knlGS:0000000000000000 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kernel: CR2: 00007f807535eae8 CR3: 000000010b8e4002 CR4: 00000000003706f0 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kernel: Call Trace: kernel: kernel: __flush_work.isra.0+0xaf/0x188 kernel: ? _raw_spin_lock_irqsave+0x2c/0x37 kernel: ? lock_timer_base+0x38/0x5f kernel: __cancel_work_timer+0xea/0x13d kernel: ? preempt_latency_start+0x2b/0x46 kernel: rdma_addr_cancel+0x70/0x81 [ib_core] kernel: _destroy_id+0x1a/0x246 [rdma_cm] kernel: rpcrdma_xprt_connect+0x115/0x5ae [rpcrdma] kernel: ? _raw_spin_unlock+0x14/0x29 kernel: ? raw_spin_rq_unlock_irq+0x5/0x10 kernel: ? finish_task_switch.isra.0+0x171/0x249 kernel: xprt_rdma_connect_worker+0x3b/0xc7 [rpcrdma] kernel: process_one_work+0x1d8/0x2d4 kernel: worker_thread+0x18b/0x24f kernel: ? rescuer_thread+0x280/0x280 kernel: kthread+0xf4/0xfc kernel: ? kthread_complete_and_exit+0x1b/0x1b kernel: ret_from_fork+0x22/0x30 kernel: SUNRPC's xprtiod workqueue is WQ_MEM_RECLAIM, so any workqueue that one of its work items tries to cancel has to be WQ_MEM_RECLAIM to prevent a priority inversion. The internal workqueues in the RDMA/core are currently non-MEM_RECLAIM. Jason Gunthorpe says this about the current state of RDMA/core: > If you attempt to do a reconnection/etc from within a RECLAIM > context it will deadlock on one of the many allocations that are > made to support opening the connection. > > The general idea of reclaim is that the entire task context > working under the reclaim is marked with an override of the gfp > flags to make all allocations under that call chain reclaim safe. > > But rdmacm does allocations outside this, eg in the WQs processing > the CM packets. So this doesn't work and we will deadlock. > > Fixing it is a big deal and needs more than poking WQ_MEM_RECLAIM > here and there. So we will change the ULP in this case to avoid the use of WQ_MEM_RECLAIM where possible. Deadlocks that were possible before are not fixed, but at least we no longer have a false sense of confidence that the stack won't allocate memory during memory reclaim. Suggested-by: Leon Romanovsky Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit a0b685e7bd7c5d232a64b0707d2f83ae3e1840dc Author: Anna Schumaker Date: Mon Oct 3 13:03:52 2022 -0400 NFSv4.2: Add a tracepoint for listxattr This can be defined as simply an NFS4_INODE_EVENT() since we don't have the name of a specific xattr to list. This roughly matches readdir, which also uses an NFS4_INODE_EVENT() tracepoint. Signed-off-by: Anna Schumaker commit 27ffed1040f7703e368f37f5f97fef87a79527dd Author: Anna Schumaker Date: Thu Sep 22 15:18:50 2022 -0400 NFSv4.2: Add tracepoints for getxattr, setxattr, and removexattr These functions take similar arguments, and can share a tracepoint class for common formatting. Signed-off-by: Anna Schumaker commit 3a100e4d8a2f7660d220c000364fe57679da9c92 Author: Anna Schumaker Date: Wed Sep 21 16:29:57 2022 -0400 NFSv4.2: Move TRACE_DEFINE_ENUM(NFS4_CONTENT_*) under CONFIG_NFS_V4_2 NFS4_CONTENT_DATA and NFS4_CONTENT_HOLE both only exist under NFS v4.2. Move their corresponding TRACE_DEFINE_ENUM calls under this Kconfig option. Signed-off-by: Anna Schumaker commit 963694615d9d5a860e6571da18e50f14ab3583b3 Author: Anna Schumaker Date: Wed Sep 21 13:21:52 2022 -0400 NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR We can translate this into an empty response list instead of passing an error up to userspace. Signed-off-by: Anna Schumaker commit a035618caf8718a1d4e840ec39dfc5fce0dcdee1 Author: Gaosheng Cui Date: Fri Sep 9 14:24:11 2022 +0800 nfs: remove nfs_wait_atomic_killable() and nfs_write_prepare() declaration nfs_write_prepare() has been removed since commit a4cdda59111f ("NFS: Create a common pgio_rpc_prepare function"), so remove it. nfs_wait_atomic_killable() has been removed since commit 723c921e7dfc ("sched/wait, fs/nfs: Convert wait_on_atomic_t() usage to the new wait_var_event() API"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Anna Schumaker commit 8aa7cf85248f7b1fb49a1117c60a160b5b22b337 Author: Gaosheng Cui Date: Fri Sep 9 14:46:40 2022 +0800 NFSv4: remove nfs4_renewd_prepare_shutdown() declaration nfs4_renewd_prepare_shutdown() has been removed since commit 3050141bae57 ("NFSv4: Kill nfs4_renewd_prepare_shutdown()"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Anna Schumaker commit 74fd2ca0f6af9cc332957b2e6ef70772e421403a Author: Jiangshan Yi Date: Tue Sep 6 10:41:19 2022 +0800 fs/nfs/pnfs_nfs.c: fix spelling typo and syntax error in comment Fix spelling typo and syntax error in comment. Suggested-by: Randy Dunlap Reported-by: k2ci Signed-off-by: Jiangshan Yi Reviewed-by: Randy Dunlap Signed-off-by: Anna Schumaker commit fd66bd74afe880de4f008f96a795fedee887ff44 Author: Quan Nguyen Date: Tue Oct 4 16:31:06 2022 +0700 i2c: aspeed: Assert NAK when slave is busy On I2C_SLAVE_WRITE_REQUESTED event, Slave already ACK'ed on the address phase. But as the backend driver is busy and unable to process any request from Master, issue RxCmdLast for Slave to auto send NACK on next incoming byte. Signed-off-by: Quan Nguyen Signed-off-by: Wolfram Sang commit 833477fce7a14d43ae4c07f8ddc32fa5119471a2 Merge: 7e6739b9336e6 86a4d29e75540 Author: Linus Torvalds Date: Wed Oct 5 12:02:07 2022 -0700 Merge tag 'sound-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "The majority of changes are ASoC drivers (SOF, Intel, AMD, Mediatek, Qualcomm, TI, Apple Silicon, etc), while we see a few small fixes in ALSA / ASoC core side, too. Here are highlights: Core: - A new string helper parse_int_array_user() and cleanups with it - Continued cleanup of memory allocation helpers - PCM core optimization and hardening - Continued ASoC core code cleanups ASoC: - Improvements to the SOF IPC4 code, especially around trace - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silicon systems, Everest ES8326, Intel Sky Lake and Kaby Lake, Mediatek MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450 and Texas Instruments SRC4392 HD- and USB-audio: - Cleanups for unification of hda-ext bus - HD-audio HDMI codec driver cleanups - Continued endpoint management fixes for USB-audio - New quirks as usual" * tag 'sound-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (422 commits) ALSA: hda: Fix position reporting on Poulsbo ALSA: hda/hdmi: Don't skip notification handling during PM operation ASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR ASoC: dt-bindings: Document audio OF graph dai-tdm-slot-num dai-tdm-slot-width props ASoC: qcom: fix unmet direct dependencies for SND_SOC_QDSP6 ALSA: usb-audio: Fix potential memory leaks ALSA: usb-audio: Fix NULL dererence at error path ASoC: mediatek: mt8192-mt6359: Set the driver name for the card ALSA: hda/realtek: More robust component matching for CS35L41 ASoC: Intel: sof_rt5682: remove SOF_RT1015_SPEAKER_AMP_100FS flag ASoC: nau8825: Add TDM support ASoC: core: clarify the driver name initialization ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()" ASoC: mediatek: mt8186: Fix spelling mistake "slect" -> "select" ALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model ALSA: asihpi - Remove unused struct hpi_subsys_response ... commit 301c8f5c32c8fb79c67539bc23972dc3ef48024c Author: Jarkko Nikula Date: Tue Sep 27 16:56:44 2022 +0300 i2c: designware: Fix handling of real but unexpected device interrupts Commit c7b79a752871 ("mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs") caused a regression on certain Gigabyte motherboards for Intel Alder Lake-S where system crashes to NULL pointer dereference in i2c_dw_xfer_msg() when system resumes from S3 sleep state ("deep"). I was able to debug the issue on Gigabyte Z690 AORUS ELITE and made following notes: - Issue happens when resuming from S3 but not when resuming from "s2idle" - PCI device 00:15.0 == i2c_designware.0 is already in D0 state when system enters into pci_pm_resume_noirq() while all other i2c_designware PCI devices are in D3. Devices were runtime suspended and in D3 prior entering into suspend - Interrupt comes after pci_pm_resume_noirq() when device interrupts are re-enabled - According to register dump the interrupt really comes from the i2c_designware.0. Controller is enabled, I2C target address register points to a one detectable I2C device address 0x60 and the DW_IC_RAW_INTR_STAT register START_DET, STOP_DET, ACTIVITY and TX_EMPTY bits are set indicating completed I2C transaction. My guess is that the firmware uses this controller to communicate with an on-board I2C device during resume but does not disable the controller before giving control to an operating system. I was told the UEFI update fixes this but never the less it revealed the driver is not ready to handle TX_EMPTY (or RX_FULL) interrupt when device is supposed to be idle and state variables are not set (especially the dev->msgs pointer which may point to NULL or stale old data). Introduce a new software status flag STATUS_ACTIVE indicating when the controller is active in driver point of view. Now treat all interrupts that occur when is not set as unexpected and mask all interrupts from the controller. Fixes: c7b79a752871 ("mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs") Reported-by: Samuel Clark Link: https://bugzilla.kernel.org/show_bug.cgi?id=215907 Cc: stable@vger.kernel.org # v5.12+ Signed-off-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit d046bd1372a5c5448c7c7ba3383a4316fdb32a60 Author: Rayyan Ansari Date: Sun Oct 2 15:28:56 2022 +0300 i2c: qcom-cci: Add MSM8226 compatible Add a compatible for MSM8226's Camera Control Interface, which is similar to the one used on MSM8916. Signed-off-by: Rayyan Ansari Signed-off-by: Matti Lehtimäki Reviewed-by: Loic Poulain Signed-off-by: Wolfram Sang commit 9ad16f9639646762455bf3ed1e6dfcc6ccc2c099 Author: Matti Lehtimäki Date: Sun Oct 2 15:28:55 2022 +0300 dt-bindings: i2c: qcom,i2c-cci: Document clocks for MSM8974 Uses same clocks as MSM8226. Signed-off-by: Matti Lehtimäki Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit 8673b6d97a314c2e73352f4a34c1aa9b2730d7c2 Author: Matti Lehtimäki Date: Sun Oct 2 15:28:54 2022 +0300 dt-bindings: i2c: qcom,i2c-cci: Document MSM8226 compatible MSM8226's Camera Control Interface has one master and 3 clocks. Signed-off-by: Matti Lehtimäki Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit 4a74e79b543c115bf2b5b7a4b29db139da20b90d Author: Colin Ian King Date: Tue Oct 4 20:27:15 2022 +0100 i2c: microchip: pci1xxxx: Fix comparison of -EPERM against an unsigned variable The comparison of variable ret with -EPERM is always false because ret is an u8 type. Fix this by making ret an int. Cleans up clang warning: drivers/i2c/busses/i2c-mchp-pci1xxxx.c:714:10: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare] Fixes: 361693697249 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch") Signed-off-by: Colin Ian King Signed-off-by: Wolfram Sang commit 7e6739b9336e61fe23ca4e2c8d1fda8f19f979bf Merge: a47e60729d962 65898687cf739 Author: Linus Torvalds Date: Wed Oct 5 11:24:12 2022 -0700 Merge tag 'drm-next-2022-10-05' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Lots of stuff all over, some new AMD IP support and gang submit support. i915 has further DG2 and Meteorlake pieces, and a bunch of i915 display refactoring. msm has a shrinker rework. There are also a bunch of conversions to use kunit. This has two external pieces, some MEI changes needed for future Intel discrete GPUs. These should be acked by Greg. There is also a cross maintainer shared tree with some backlight rework from Hans in here. Core: - convert selftests to kunit - managed init for more objects - move to idr_init_base - rename fb and gem cma helpers to dma - hide unregistered connectors from getconnector ioctl - DSC passthrough aux support - backlight handling improvements - add dma_resv_assert_held to vmap/vunmap edid: - move luminance calculation to core fbdev: - fix aperture helper usage fourcc: - add more format helpers - add DRM_FORMAT_Cxx, DRM_FORMAT_Rxx, DRM_FORMAT_Dxx - add packed AYUV8888, XYUV8888 - add some kunit tests ttm: - allow bos without backing store - rewrite placement to use intersect/compatible functions dma-buf: - docs update - improve signalling when debugging udmabuf: - fix failure path GPF dp: - drop dp/mst legacy code - atomic mst state support - audio infoframe packing panel: - Samsung LTL101AL01 - B120XAN01.0 - R140NWF5 RH - DMT028VGHMCMI-1A T - AUO B133UAN02.1 - IVO M133NW4J-R3 - Innolux N120ACA-EA1 amdgpu: - Gang submit support - Mode2 reset for RDNA2 - New IP support: DCN 3.1.4, 3.2 SMU 13.x NBIO 7.7 GC 11.x PSP 13.x SDMA 6.x GMC 11.x - DSC passthrough support - PSP fixes for TA support - vangogh GFXOFF stats - clang fixes - gang submit CS cleanup prep work - fix VRAM eviction issues amdkfd: - GC 10.3 IP ISA fixes - fix CRIU regression - CPU fault on COW mapping fixes i915: - align fw versioning with kernel practices - add display substruct to i915 private - add initial runtime info to driver info - split out HDCP and backlight registers - MEI XeHP SDV GSC support - add per-gt sysfs defaults - TLB invalidation improvements - Disable PCI BAR resize on 32-bit - GuC firmware updates and compat changes - GuC log timestamp translation - DG2 preemption workaround changes - DG2 improved HDMI pixel clocks support - PCI BAR sanity checks - Enable DC5 on DG2 - DG2 DMC fw bumped - ADL-S PCI ID added - Meteorlake enablement - Rename ggtt_view to gtt_view - host RPS fixes - release mmaps on rpm suspend on discrete - clocking and dpll refactoring - VBT definitions and parsing updates - SKL watermark code extracted to separate file - allow seamless M/N changes on eDP panels - BUG_ON removal and cleanups msm: - DPU: simplified VBIF configuration cleanup CTL interfaces - DSI: removed unused msm_display_dsc_config struct switch regulator calls to new API switched to PANEL_BRIDGE for direct attached panels - DSI_PHY: convert drivers to parent_hws - DP: cleanup pixel_rate handling - HDMI: turned hdmi-phy-8996 into OF clk provider - misc dt-bindings fixes - choose eDP as primary display if it's available - support getting interconnects from either the mdss or the mdp5/dpu device nodes - gem: Shrinker + LRU re-work: - adds a shared GEM LRU+shrinker helper and moves msm over to that - reduce lock contention between retire and submit by avoiding the need to acquire obj lock in retire path (and instead using resv seeing obj's busyness in the shrinker - fix reclaim vs submit issues - GEM fault injection for triggering userspace error paths - Map/unmap optimization - Improved robustness for a6xx GPU recovery virtio: - improve error and edge conditions handling - convert to use managed helpers - stop exposing LINEAR modifier mgag200: - split modeset handling per model udl: - suspend/disconnect handling improvements vc4: - rework HDMI power up - depend on PM - better unplugging support ast: - resolution handling improvements ingenic: - add JZ4760(B) support - avoid a modeset when sharpness property is unchanged - use the new PM ops it6505: - power seq and clock updates ssd130x: - regmap bulk write - use atomic helpers instead of simple helpers via: - rename via_drv to via_dri1, consolidate all code. radeon: - drop DP MST experimental support - delayed work flush fix - use time_after ti-sn65dsi86: - DP support mediatek: - MT8195 DP support - drop of_gpio header - remove unneeded result - small DP code improvements vkms: - RGB565, XRGB64 and ARGB64 support sun4i: - tv: convert to atomic rcar-du: - Synopsys DW HDMI bridge DT bindings update exynos: - use drm_display_info.is_hdmi - correct return of mixer_mode_valid and hdmi_mode_valid omap: - refcounting fix rockchip: - RK3568 support - RK3399 gamma support" * tag 'drm-next-2022-10-05' of git://anongit.freedesktop.org/drm/drm: (1374 commits) drm/amdkfd: Fix UBSAN shift-out-of-bounds warning drm/amdkfd: Track unified memory when switching xnack mode drm/amdgpu: Enable sram on vcn_4_0_2 drm/amdgpu: Enable VCN DPG for GC11_0_1 drm/msm: Fix build break with recent mm tree drm/panel: simple: Use dev_err_probe() to simplify code drm/panel: panel-edp: Use dev_err_probe() to simplify code drm/panel: simple: Add Multi-Inno Technology MI0800FT-9 dt-bindings: display: simple: Add Multi-Inno Technology MI0800FT-9 panel drm/amdgpu: correct the memcpy size for ip discovery firmware drm/amdgpu: Skip put_reset_domain if it doesn't exist drm/amdgpu: remove switch from amdgpu_gmc_noretry_set drm/amdgpu: Fix mc_umc_status used uninitialized warning drm/amd/display: Prevent OTG shutdown during PSR SU drm/amdgpu: add page retirement handling for CPU RAS drm/amdgpu: use RAS error address convert api in mca notifier drm/amdgpu: support to convert dedicated umc mca address drm/amdgpu: export umc error address convert interface drm/amdgpu: fix sdma v4 init microcode error drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() ... commit a47e60729d9624e931f988709ab76e043e2ee8b9 Merge: 7fb68b6c821be e7647de058cba Author: Linus Torvalds Date: Wed Oct 5 10:45:15 2022 -0700 Merge tag 'backlight-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight update from Lee Jones: - Add support for MediaTek MT6370 Backlight * tag 'backlight-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: video: backlight: mt6370: Add MediaTek MT6370 support dt-bindings: backlight: Add MediaTek MT6370 backlight commit 7fb68b6c821be7165d5be5d8801d909912af9159 Merge: 1c2daf52185bb 8d05fc0394565 Author: Linus Torvalds Date: Wed Oct 5 10:38:24 2022 -0700 Merge tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: - AMD Platform Management Framework (PMF) driver with AMT and QnQF support - AMD PMC: Improved logging for debugging s2idle issues - Big refactor of the ACPI/x86 backlight handling, ensuring that we only register 1 /sys/class/backlight device per LCD panel - Microsoft Surface: - Surface Laptop Go 2 support - Surface Pro 8 HID sensor support - Asus WMI: - Lots of cleanups - Support for TUF RGB keyboard backlight control - Add support for ROG X13 tablet mode - Siemens Simatic: IPC227G and IPC427G support - Toshiba ACPI laptop driver: Fan hwmon and battery ECO mode support - tools/power/x86/intel-speed-select: Various improvements - Various cleanups - Various small bugfixes * tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (153 commits) platform/x86: use PLATFORM_DEVID_NONE instead of -1 platform/x86/amd: pmc: Dump idle mask during "check" stage instead platform/x86/intel/wmi: thunderbolt: Use dev_groups callback platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks platform/surface: Split memcpy() of struct ssam_event flexible array platform/x86: compal-laptop: Get rid of a few forward declarations platform/x86: intel-uncore-freq: Use sysfs_emit() to instead of scnprintf() platform/x86: dell-smbios-base: Use sysfs_emit() platform/x86/amd/pmf: Remove unused power_delta instances platform/x86/amd/pmf: install notify handler after acpi init Documentation/ABI/testing/sysfs-amd-pmf: Add ABI doc for AMD PMF platform/x86/amd/pmf: Add sysfs to toggle CnQF platform/x86/amd/pmf: Add support for CnQF platform/x86/amd: pmc: Fix build without debugfs platform/x86: hp-wmi: Support touchpad on/off platform/x86: int3472/discrete: Drop a forward declaration platform/x86: toshiba_acpi: change turn_on_panel_on_resume to static platform/x86: wmi: Drop forward declaration of static functions platform/x86: toshiba_acpi: Remove duplicate include platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading ... commit 91fa127794ac1c48069479b9d45eb4c7378c0e30 Author: Alex Williamson Date: Fri Sep 16 14:44:48 2022 -0600 PCI: Expose PCIe Resizable BAR support via sysfs Add a simple sysfs interface to Resizable BAR support, largely for the purposes of assigning such devices to a VM through VFIO. Resizable BARs present a difficult feature to expose to a VM through emulation, as resizing a BAR is done on the host. It can fail, and often does, but we have no means via emulation of a PCIe REBAR capability to handle the error cases. A vfio-pci specific ioctl interface is also cumbersome as there are often multiple devices within the same bridge aperture and handling them is a challenge. In the interface proposed here, expanding a BAR potentially requires such devices to be soft-removed during the resize operation and rescanned after, in order for all the necessary resources to be released. A pci-sysfs interface is also more universal than a vfio specific interface. Please see the ABI documentation update for usage. Link: https://lore.kernel.org/r/166336088796.3597940.14973499936692558556.stgit@omen Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas Reviewed-by: Christian König Cc: Krzysztof Wilczyński commit 1c2daf52185bbc91421f0e84e6bf2706bb350cce Merge: c3f13bbfc2f02 8edd2752b0aa4 Author: Linus Torvalds Date: Wed Oct 5 10:14:48 2022 -0700 Merge tag 'tag-chrome-platform-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Tzung-Bi Shih: "cros_ec_proto: - Fix protocol failure if EC firmware jumps to RO part cros_typec_switch: - Add USB Type-C switch driver for mode switches and retimers - Integrate to EC for retimers, status update, and mode switches - Clean-ups cros_ec_typec: - Clean-ups - Use partner PDOs to register USB PD capabilities chromeos_laptop: - Fix a double-free cros_ec_chardev: - Check data length from userland to avoid a memory corruption cros_ec: - Expose suspend_timeout_ms in debugfs - Notify the PM about wake events during resume" * tag 'tag-chrome-platform-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec: Notify the PM of wake events during resume platform/chrome: cros_ec_typec: Register partner PDOs platform/chrome: cros_typec_switch: Inline DRV_NAME platform/chrome: cros_typec_switch: Use PTR_ERR_OR_ZERO() to simplify platform/chrome: cros_typec_switch: Remove impossible condition platform/chrome: cros_typec_switch: Add missing newline on printk platform/chrome: cros_ec_typec: Correct alt mode index platform/chrome: cros_ec_typec: Add bit offset for DP VDO platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs platform/chrome: fix memory corruption in ioctl platform/chrome: fix double-free in chromeos_laptop_prepare() platform/chrome: cros_ec_typec: Get retimer handle platform/chrome: cros_ec_typec: Cleanup switch handle return paths platform/chrome: cros_typec_switch: Register mode switches platform/chrome: cros_typec_switch: Add event check platform/chrome: cros_typec_switch: Set EC retimer platform/chrome: cros_typec_switch: Add switch driver platform/chrome: Add Type-C mux set command definitions platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure commit 7afeb84d14eaaebb71f5c558ed57ca858e4304e7 Author: Bjorn Helgaas Date: Tue Oct 4 21:58:09 2022 -0500 PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation 80d7d7a904fa ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device characteristics") replaced a fixed value (163840ns) with one computed from T_POWER_OFF, Common_Mode_Restore_Time, etc., but it encoded the LTR_L1.2_THRESHOLD value incorrectly. This is especially a problem for small thresholds, e.g., 63ns fell into the "threshold_ns < 1024" case and was encoded as 32ns: LTR_L1.2_THRESHOLD_Scale = 1 (multiplier is 32ns) LTR_L1.2_THRESHOLD_Value = 63 >> 5 = 1 LTR_L1.2_THRESHOLD = multiplier * value = 32ns * 1 = 32ns Correct the algorithm to encode all times of 1023ns (0x3ff) or smaller exactly and larger times conservatively (the encoded threshold is never smaller than was requested). This reduces the chance of entering L1.2 when the device can't tolerate the exit latency. Fixes: 80d7d7a904fa ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device characteristics") Link: https://lore.kernel.org/r/20221005025809.2247547-4-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit cfc0028627cadfa271fab0290f18731193d63d87 Author: Bjorn Helgaas Date: Tue Oct 4 21:58:08 2022 -0500 PCI/ASPM: Ignore L1 PM Substates if device lacks capability 187f91db8237 ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap") inadvertently removed a check for existence of the L1 PM Substates (L1SS) Capability before reading it. If there is no L1SS Capability, this means we mistakenly read PCI_COMMAND and PCI_STATUS (config address 0x04) and interpret that as the PCI_L1SS_CAP register, so we may incorrectly configure L1SS. Make sure the L1SS Capability exists before trying to read it. Fixes: 187f91db8237 ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap") Link: https://lore.kernel.org/r/20221005025809.2247547-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit 9e2a03173d1b4544c1113059e61e3caa7ce5e3a4 Author: Bjorn Helgaas Date: Tue Oct 4 21:58:07 2022 -0500 PCI/ASPM: Factor out L1 PM Substates configuration Move L1 PM Substates configuration from pcie_aspm_cap_init() to a new aspm_l1ss_init() function. No functional change intended. Link: https://lore.kernel.org/r/20221005025809.2247547-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit 83e14a57d59f22a89ad7d59752f5b69189299531 Author: Hoi Pok Wu Date: Wed Aug 24 22:25:05 2022 +0800 docs:kselftest: fix kselftest_module.h path of example module "module.h" does not exist in kselftest, it should be "kselftest_module.h". Signed-off-by: Hoi Pok Wu Signed-off-by: Shuah Khan commit bf6430f8512de304ec95c4558c2a47ad0787f90e Author: Meng Li Date: Thu Sep 8 08:28:21 2022 +0800 cpufreq: amd-pstate: Add explanation for X86_AMD_PSTATE_UT This kernel module is used for testing. It's safe to say M here. It can also be built-in without X86_AMD_PSTATE enabled. Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE is set disabled, it can tell the users test can only run on amd-pstate driver, please set X86_AMD_PSTATE enabled. In the future, comparison tests will be added. It can set amd-pstate disabled and set acpi-cpufreq enabled to run test cases, then compare the test results. Suggested-by: Shuah Khan Signed-off-by: Meng Li Acked-by: Huang Rui Signed-off-by: Shuah Khan commit 96788ac53dbab980e2308c4dc57bea4ba8e0bd2a Author: Zhao Gongyi Date: Mon Sep 5 21:36:15 2022 +0800 selftests/cpu-hotplug: Add log info when test success Add log information when run full test successfully. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 51d4c851465c32143d9c7b1cfb46fc581922b116 Author: Zhao Gongyi Date: Mon Sep 5 21:36:14 2022 +0800 selftests/cpu-hotplug: Reserve one cpu online at least Considering that we can not offline all cpus in any cases, we need to reserve one cpu online when the test offline all hotpluggable online cpus, otherwise the test will fail forever. Fixes: d89dffa976bc ("fault-injection: add selftests for cpu and memory hotplug") Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 195d74be717af14e5991f818f73f067367bfc1ed Author: Zhao Gongyi Date: Mon Sep 5 21:36:13 2022 +0800 selftests/cpu-hotplug: Delete fault injection related code Delete fault injection related code since the module has been deleted. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 972cf4ce51ef5532d56822af17defb148aac0ccb Author: Zhao Gongyi Date: Mon Sep 5 21:36:12 2022 +0800 selftests/cpu-hotplug: Use return instead of exit Some cpus will be left in offline state when online function exits in some error conditions. Use return instead of exit to fix it. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit 2354edd07b2336cd3ca9d81791f9411b8fe92d6e Author: Zhao Gongyi Date: Mon Sep 5 21:36:11 2022 +0800 selftests/cpu-hotplug: Correct log info Correct the log info to match the test. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan commit ce29a148f34fe93601dab835ec25ada1d95aac02 Author: Meng Li Date: Tue Sep 6 10:48:26 2022 +0800 cpufreq: amd-pstate: modify type in argument 2 for filp_open Modify restricted FMODE_PREAD to experted int O_RDONLY to fix the sparse warnings below: sparse warnings: (new ones prefixed by >>) >> drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: sparse: incorrect type >> in argument 2 (different base types) @@ expected int @@ got >> restricted fmode_t [usertype] @@ drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: expected int drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: got restricted fmode_t [usertype] Signed-off-by: Meng Li Reported-by: kernel test robot Acked-by: Huang Rui Signed-off-by: Shuah Khan commit 7fe3629729ce5466f865b75c506d7cb6223838ba Author: Meng Li Date: Wed Aug 17 11:46:30 2022 +0800 Documentation: amd-pstate: Add unit test introduction Introduce the AMD P-State unit test module design and implementation. It also talks about kselftest and how to use. Signed-off-by: Meng Li Acked-by: Huang Rui Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit e1083a03c553f12186556776e67eae44665318de Author: Meng Li Date: Wed Aug 17 11:46:29 2022 +0800 selftests: amd-pstate: Add test trigger for amd-pstate driver Add amd-pstate test trigger in kselftest, it will load/unload amd-pstate-ut module to test some cases etc. Signed-off-by: Meng Li Acked-by: Huang Rui Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit 14eb1c96e3a3fd9cd377ac9af3c7a410f8bf1015 Author: Meng Li Date: Wed Aug 17 11:46:28 2022 +0800 cpufreq: amd-pstate: Add test module for amd-pstate driver Add amd-pstate-ut test module, this module is used by kselftest to unit test amd-pstate functionality. This module will be expected by some of selftests to be present and loaded. Signed-off-by: Meng Li Acked-by: Huang Rui Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit f1375ec1df09fb09fecfdf9418d3784e7ba12469 Author: Meng Li Date: Wed Aug 17 11:46:27 2022 +0800 cpufreq: amd-pstate: Expose struct amd_cpudata Expose struct amd_cpudata to AMD P-State unit test module. This data struct will be used on the following AMD P-State unit test (amd-pstate-ut) module. The amd-pstate-ut module can get some AMD infomations by this data struct. For example: highest perf, nominal perf, boost supported etc. Signed-off-by: Meng Li Acked-by: Huang Rui Acked-by: Shuah Khan Signed-off-by: Shuah Khan commit 0e29bc0ebaabf4e5270a23fd5ccce06fac3e140d Author: Axel Rasmussen Date: Fri Aug 19 12:19:29 2022 -0700 selftests/vm: use top_srcdir instead of recomputing relative paths In various places both in t/t/s/v/Makefile as well as some of the test sources, we were referring to headers or directories using some fairly long relative paths. Since we have a working top_srcdir variable though, which refers to the root of the kernel tree, we can clean up all of these "up and over" relative paths, just relying on the single variable instead. Signed-off-by: Axel Rasmussen Signed-off-by: Shuah Khan commit c3f13bbfc2f0240743a4d03a8a890d03730f5a6d Merge: ebcfaeeceaf1d 178422c27badb Author: Linus Torvalds Date: Wed Oct 5 10:00:19 2022 -0700 Merge tag 'mmc-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: - dt-bindings: Increase maximum supported frequency to 384MHz - dw_mmc-rockchip: Add support for the rk3128 variant - meson-gx: Add support for SDIO interrupts - mtk-sd: Add support for MT6795 Helio X10 variant - sdhci: Improve the code by centralizing the CMD/DATA reset handling - sdhci-msm: - Add support for the sdm670 variant - Add support for the sm6115 variant - sdhci-omap: Make Vignesh replace Kishon as the maintainer - sdhci-pci-o2micro: Disable fragile support for DDR50 in favor of SDR50 - sdhci-sprd: Fix clock divider limitation * tag 'mmc-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (31 commits) mmc: sdhci: Centralize CMD and DATA reset handling mmc: sdhci: Get rid of SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS mmc: sdhci: Remove misleading comment about resets mmc: sdhci: Separate out sdhci_reset_for_all() MAINTAINERS: Add Vignesh as maintainer of TI SDHCI OMAP DRIVER mmc: sdhci-msm: add compatible string check for sdm670 dt-bindings: mmc: sdhci-msm: add sdm670 compatible mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() mmc: rtsx_usb_sdmmc: Remove the unneeded result variable mmc: sdhci-of-aspeed: Add dependency on ARCH_ASPEED mmc: mtk-sd: Add support for MT6795 Helio X10 mmc: mtk-sd: Reorder of_device_id and platform data by name mmc: sdhci-sprd: Fix the limitation of div dt-bindings: mmc: sdhci-msm: Add pinctrl-1 property dt-bindings: mmc: rockchip: add rockchip,rk3128-dw-mshc dt-bindings: mmc: renesas,sdhi: Add iommus property mmc: sdhci_am654: Remove the unneeded result variable mmc: meson-gx: add SDIO interrupt support mmc: meson-gx: adjust and re-use constant IRQ_EN_MASK mmc: jz4740_mmc: Fix error check for dma_map_sg ... commit ebcfaeeceaf1d60de48f0b3c17b057d54ef790e9 Merge: 2bca25eaeba61 15e74c6c1ce2d Author: Linus Torvalds Date: Wed Oct 5 09:54:20 2022 -0700 Merge tag 'pcmcia-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull PCMCIA updates from Dominik Brodowski: "Odd cleanups and fixes for v6.1 Remove the obsolete VR41XX and AT91RM9200 Compact Flash drivers, and fix some minor coding issues (__init/__exit annotations, unused variable)" * tag 'pcmcia-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: remove AT91RM9200 Compact Flash driver pcmcia: Removed unused variable control. pcmcia: Add __init/__exit annotations to module init/exit funcs pcmcia: at91_cf: make mc static pcmcia: remove VR41XX PCMCIA driver pcmcia: sa1100: Make sa11x0_drv_pcmcia_legacy_remove() return void commit 36f554046bd6da91b7e71bddeb38952c6d92cd98 Author: Rafael J. Wysocki Date: Tue Oct 4 18:32:52 2022 +0200 ACPI: thermal: Drop some redundant code Drop some redundant initialization of local variables, a redundant return statement and a redundant "else" from the ACPI thermal driver. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 9e8bc16626a007108f2c3496cd48f0eda4d09045 Author: Rafael J. Wysocki Date: Tue Oct 4 18:32:08 2022 +0200 ACPI: thermal: Drop redundant parens from expressions Some expressions in the ACPI thermal driver contain redundant parentheses. Drop them. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 52ce50498c6f432fad13315f0387bfc100e2d18b Author: Rafael J. Wysocki Date: Tue Oct 4 18:31:11 2022 +0200 ACPI: thermal: Use white space more consistently The usage of white space in the ACPI thermal driver is not very consistent, so improve that a bit. While at it, add missing braces to if()/else in a few places. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit ccf22a48cc8789a35befea783448c259463a5eef Author: Arnaud Pouliquen Date: Wed Oct 5 10:13:17 2022 +0200 remoteproc: virtio: Fix warning on bindings by removing the of_match_table The checkpatch tool complains that "virtio,rproc" is not documented. But it is not possible to probe the device "rproc-virtio" by declaring it in the device tree. So documenting it in the bindings does not make sense. This commit solves the checkpatch warning by suppressing the useless of_match_table. Suggested-by: Rob Herring Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the remoteproc_virtio") Signed-off-by: Arnaud Pouliquen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20221005081317.3411684-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit cf4e0f8a396e42144d4b984ade8735621db5c20e Merge: c79e6fa98ca86 9992dd777123b Author: Rafael J. Wysocki Date: Wed Oct 5 17:18:16 2022 +0200 Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull turbostat changes for 6.1-rc1 from Len Brown: "Add support for two new platforms, and two bug fixes on existing platforms." * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: tools/power turbostat: version 2022.10.04 tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain tools/power turbostat: Do not dump TRL if turbo is not supported tools/power turbostat: Add support for MeteorLake platforms tools/power turbostat: Add support for RPL-S commit 243a5263014a30436c93ed3f1f864c1da845455e Author: Jeff Layton Date: Tue Oct 4 15:41:10 2022 -0400 nfsd: rework hashtable handling in nfsd_do_file_acquire nfsd_file is RCU-freed, so we need to hold the rcu_read_lock long enough to get a reference after finding it in the hash. Take the rcu_read_lock() and call rhashtable_lookup directly. Switch to using rhashtable_lookup_insert_key as well, and use the usual retry mechanism if we hit an -EEXIST. Rename the "retry" bool to open_retry, and eliminiate the insert_err goto target. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 8d0d254b15cc5b7d46d85fb7ab8ecede9575e672 Author: Jeff Layton Date: Fri Sep 30 16:56:02 2022 -0400 nfsd: fix nfsd_file_unhash_and_dispose nfsd_file_unhash_and_dispose() is called for two reasons: We're either shutting down and purging the filecache, or we've gotten a notification about a file delete, so we want to go ahead and unhash it so that it'll get cleaned up when we close. We're either walking the hashtable or doing a lookup in it and we don't take a reference in either case. What we want to do in both cases is to try and unhash the object and put it on the dispose list if that was successful. If it's no longer hashed, then we don't want to touch it, with the assumption being that something else is already cleaning up the sentinel reference. Instead of trying to selectively decrement the refcount in this function, just unhash it, and if that was successful, move it to the dispose list. Then, the disposal routine will just clean that up as usual. Also, just make this a void function, drop the WARN_ON_ONCE, and the comments about deadlocking since the nature of the purported deadlock is no longer clear. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit c457ac029e443faa5886f59f849e94701375b80f Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:44 2022 +0530 PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS During L1SS, gate the Master clock supplied to the MHI bus to save power. Link: https://lore.kernel.org/r/20220914075350.7992-7-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit 6dbba2b53c3bcbbee849d2fa8cf6acc973ab2e81 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:43 2022 +0530 PCI: qcom-ep: Expose link transition counts via debugfs Qualcomm PCIe controllers have debug registers in the MMIO region that count PCIe link transitions. Expose them over debugfs to userspace to help debug the low power issues. Link: https://lore.kernel.org/r/20220914075350.7992-6-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit 19619b43f0319c7a0564f6ff35aca5f62e7cb118 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:42 2022 +0530 PCI: qcom-ep: Disable IRQs during driver remove Disable the Global and PERST IRQs during driver remove to avoid getting spurious IRQs after resource deallocation. Link: https://lore.kernel.org/r/20220914075350.7992-5-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit 417b9c51f59734d852e47252476fadc293ad994a Author: Callum Osmotherly Date: Wed Oct 5 17:44:16 2022 +1030 ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530 After some feedback from users with Dell Precision 5530 machines, this patch reverts the previous change to add ALC289_FIXUP_DUAL_SPK. While it improved the speaker output quality, it caused the headphone jack to have an audible "pop" sound when power saving was toggled. Fixes: 1885ff13d4c4 ("ALSA: hda/realtek: Enable 4-speaker output Dell Precision 5530 laptop") Signed-off-by: Callum Osmotherly Cc: Link: https://lore.kernel.org/r/Yz0uyN1zwZhnyRD6@piranha Signed-off-by: Takashi Iwai commit 59b2a38c6afdc9341ac4fcff455bfdf77113ed37 Merge: 857300b7d5fd5 ff1b80ec84156 Author: Petr Mladek Date: Wed Oct 5 13:00:03 2022 +0200 Merge branch 'for-6.1/sysfs-patched-object' into for-linus commit b12e924a2f5b960373459c8f8a514f887adf5cac Author: Tetsuo Handa Date: Tue Oct 4 21:47:50 2022 -0400 net/ieee802154: don't warn zero-sized raw_sendmsg() syzbot is hitting skb_assert_len() warning at __dev_queue_xmit() [1], for PF_IEEE802154 socket's zero-sized raw_sendmsg() request is hitting __dev_queue_xmit() with skb->len == 0. Since PF_IEEE802154 socket's zero-sized raw_sendmsg() request was able to return 0, don't call __dev_queue_xmit() if packet length is 0. ---------- #include #include int main(int argc, char *argv[]) { struct sockaddr_in addr = { .sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK) }; struct iovec iov = { }; struct msghdr hdr = { .msg_name = &addr, .msg_namelen = sizeof(addr), .msg_iov = &iov, .msg_iovlen = 1 }; sendmsg(socket(PF_IEEE802154, SOCK_RAW, 0), &hdr, 0); return 0; } ---------- Note that this might be a sign that commit fd1894224407c484 ("bpf: Don't redirect packets with invalid pkt_len") should be reverted, for skb->len == 0 was acceptable for at least PF_IEEE802154 socket. Link: https://syzkaller.appspot.com/bug?extid=5ea725c25d06fb9114c4 [1] Reported-by: syzbot Fixes: fd1894224407c484 ("bpf: Don't redirect packets with invalid pkt_len") Signed-off-by: Tetsuo Handa Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20221005014750.3685555-2-aahringo@redhat.com Signed-off-by: Stefan Schmidt commit 2eb2756f6c9e9621e022d78321ce40a62c4520b5 Author: Alexander Aring Date: Tue Oct 4 21:47:49 2022 -0400 Revert "net/ieee802154: reject zero-sized raw_sendmsg()" This reverts commit 3a4d061c699bd3eedc80dc97a4b2a2e1af83c6f5. There is a v2 which does return zero if zero length is given. Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20221005014750.3685555-1-aahringo@redhat.com Signed-off-by: Stefan Schmidt commit d2995249a2f72333a4ab4922ff3c42a76c023791 Author: Nathan Chancellor Date: Mon Oct 3 12:37:59 2022 -0700 arm64: alternatives: Use vdso/bits.h instead of linux/bits.h When building with CONFIG_LTO after commit ba00c2a04fa5 ("arm64: fix the build with binutils 2.27"), the following build error occurs: In file included from arch/arm64/kernel/module-plts.c:6: In file included from include/linux/elf.h:6: In file included from arch/arm64/include/asm/elf.h:8: In file included from arch/arm64/include/asm/hwcap.h:9: In file included from arch/arm64/include/asm/cpufeature.h:9: In file included from arch/arm64/include/asm/alternative-macros.h:5: In file included from include/linux/bits.h:22: In file included from include/linux/build_bug.h:5: In file included from include/linux/compiler.h:248: In file included from arch/arm64/include/asm/rwonce.h:71: include/asm-generic/rwonce.h:67:9: error: expected string literal in 'asm' return __READ_ONCE(*(unsigned long *)addr); ^ arch/arm64/include/asm/rwonce.h:43:16: note: expanded from macro '__READ_ONCE' asm volatile(__LOAD_RCPC(b, %w0, %1) \ ^ arch/arm64/include/asm/rwonce.h:17:2: note: expanded from macro '__LOAD_RCPC' ALTERNATIVE( \ ^ Similar to the issue resolved by commit 0072dc1b53c3 ("arm64: avoid BUILD_BUG_ON() in alternative-macros"), there is a circular include dependency through when CONFIG_LTO is enabled due to appearing in the include chain before the contents of , which results in ALTERNATIVE() not getting expanded properly because it has not been defined yet. Avoid this issue by including , which includes the definition of the BIT() macro, instead of , as BIT() is the only macro from bits.h that is relevant to this header. Fixes: ba00c2a04fa5 ("arm64: fix the build with binutils 2.27") Link: https://github.com/ClangBuiltLinux/linux/issues/1728 Signed-off-by: Nathan Chancellor Tested-by: Will Deacon Link: https://lore.kernel.org/r/20221003193759.1141709-1-nathan@kernel.org Signed-off-by: Catalin Marinas commit cb7c02e91c31f55d08760f04a09bf9334d809426 Merge: 1145c3d5e7028 9f4441fcbb721 Author: Benjamin Tissoires Date: Wed Oct 5 10:38:35 2022 +0100 Merge branch 'for-6.1/google' into for-linus - convert to use dev_groups (Greg Kroah-Hartman) commit 1145c3d5e7028e95741fb86693ddce00202decf6 Merge: 1af52d6b35bb7 486da113c698a Author: Benjamin Tissoires Date: Wed Oct 5 10:37:17 2022 +0100 Merge branch 'for-6.1/rmi' into for-linus - compilation warning fix (Jiangshan Yi) commit 1af52d6b35bb7faaabb1f0b34fbcae7c619e54e7 Merge: 430257d8329b5 35f473864f1dc Author: Benjamin Tissoires Date: Wed Oct 5 10:36:30 2022 +0100 Merge branch 'for-6.1/wacom' into for-linus - Simplify comments (Christophe JAILLET) commit 430257d8329b58170a92364597e474fa607e28b2 Merge: d7ae8ff97e624 7495fb7e74259 Author: Benjamin Tissoires Date: Wed Oct 5 10:34:48 2022 +0100 Merge branch 'for-6.1/uclogic' into for-linus - Add UGEEv2 support (XP-PEN Deco Pro S and Parblo A610 PRO) (José Expósito) commit d7ae8ff97e6243c09ac4ab8d737504224bd3475c Merge: b0400ff2942a7 acc3e34613da1 Author: Benjamin Tissoires Date: Wed Oct 5 10:31:33 2022 +0100 Merge branch 'for-6.1/rc-controllers' into for-linus - Support for various RC controllers (Marcus Folkesson) commit b0400ff2942a71b7cde2107786084ac38126519c Merge: 2f5b0059b31a3 a109d5c45b3d6 Author: Benjamin Tissoires Date: Wed Oct 5 10:30:18 2022 +0100 Merge branch 'for-6.1/topre' into for-linus - Fix Topre REALFORCE R2 keyboard so it can send more than 6 keys at the time (Harry Stern) commit 2f5b0059b31a3e554cb8c5a40682411a2f53f4d3 Merge: 599fb2ab2aa73 50503e360eeb9 Author: Benjamin Tissoires Date: Wed Oct 5 10:28:48 2022 +0100 Merge branch 'for-6.1/nintendo' into for-linus - better support of Nintendo clone controllers (Icenowy Zheng and Johnothan King) commit 599fb2ab2aa73a8bb450ceff90191eeeb4287451 Merge: b320467e27db3 68266bdcceec1 Author: Benjamin Tissoires Date: Wed Oct 5 10:27:18 2022 +0100 Merge branch 'for-6.1/amd_sfh' into for-linus - reduce verbosity of amd_sfh driver (Basavaraj Natikar) - better handling of devices with SFH1.1 (Basavaraj Natikar) commit b320467e27db3964225de6b451feddf4207baf5f Merge: 684e00cfc6176 be6e2b5734a42 Author: Benjamin Tissoires Date: Wed Oct 5 10:26:15 2022 +0100 Merge branch 'for-6.1/multitouch' into for-linus - fix broken atomic checks by adding memory barriers (Andri Yngvason) commit 684e00cfc6176f4a06a2aec1606430393b66fa74 Merge: edd1533d3ccd8 454d243a00f50 Author: Benjamin Tissoires Date: Wed Oct 5 10:25:06 2022 +0100 Merge branch 'for-6.1/sony' into for-linus - playstation: convert to use dev_groups (Greg Kroah-Hartman) commit edd1533d3ccd82dd5d600986d27d524e6be4c5fd Merge: 7d8fe4cfc54b5 98d67f250472c Author: Benjamin Tissoires Date: Wed Oct 5 10:21:55 2022 +0100 Merge branch 'for-6.1/logitech' into for-linus - Add hanlding of all Bluetooth HID++ devices and fixes in hid++ (Bastien Nocera) commit 7d8fe4cfc54b5fb2093e12cffa8ca74d3c88e0fa Merge: bfdc750c4cb2f 735e1bb1b8067 Author: Benjamin Tissoires Date: Wed Oct 5 10:19:06 2022 +0100 Merge branch 'for-6.1/core' into for-linus - move from strlcpy with unused retval to strscpy (Wolfram Sang) - Kconfig fixes (Randy Dunlap) - HID-BPF preparatory patches, convert blank defines as enums (Benjamin Tissoires) commit 114b9da7ebd964697a7ca5f85f68f61503e91f3a Author: Arnd Bergmann Date: Wed Oct 5 10:12:43 2022 +0200 Revert "ARM: dts: BCM5301X: Add basic PCI controller properties" Adding the #address-cells/#size-cells properties without also adding the other required properties for PCI nodes causes new build warnings from dtc that now show up everywhere, rather than just while verifying the yaml bindings: arch/arm/boot/dts/bcm5301x.dtsi:240.21-246.5: Warning (pci_bridge): /axi@18000000/pcie@12000: missing ranges for PCI bridge (or not a bridge) arch/arm/boot/dts/bcm5301x.dtsi:248.21-254.5: Warning (pci_bridge): /axi@18000000/pcie@13000: missing ranges for PCI bridge (or not a bridge) arch/arm/boot/dts/bcm5301x.dtsi:256.21-262.5: Warning (pci_bridge): /axi@18000000/pcie@14000: missing ranges for PCI bridge (or not a bridge) arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge' Revert it for now. Fixes: 61dc1e3850a6 ("ARM: dts: BCM5301X: Add basic PCI controller properties") Reported-by: Stephen Rothwell Signed-off-by: Arnd Bergmann commit 3afdfb0dd4baed45b7010e672e44c21fa790bace Author: Steve French Date: Sat Oct 1 22:52:20 2022 -0500 smb3: define missing create contexts Update the list of create contexts to include the three more recent ones and the one used for mounts to Macs. Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 30f8f37147bc9af794b89e37d42fc858f201e5b0 Author: Ronnie Sahlberg Date: Wed Aug 31 12:49:44 2022 +1000 cifs: store a pointer to a fid in the cfid structure instead of the struct also create a constructor that takes a path name and stores it in the fid. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 47fc2491e108f253cf963c50acc59a74d34c7f2b Author: Ronnie Sahlberg Date: Wed Aug 31 12:49:43 2022 +1000 cifs: improve handlecaching Only track the dentry for the root handle Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit aea6794e664a07324288f3d3484b950922baeebd Author: Ronnie Sahlberg Date: Wed Aug 31 12:49:42 2022 +1000 cifs: Make tcon contain a wrapper structure cached_fids instead of cached_fid This wrapper structure will later be expanded to contain a list of fids that are cached and not just the root fid. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 68e14569d7e5a1798fcbfd945022a4de86f944a0 Author: Steve French Date: Wed Sep 21 14:05:53 2022 -0500 smb3: add dynamic trace points for tree disconnect Needed this for debugging a failing xfstest. Also change camel case for "treeName" to "tree_name" in tcon struct. Example trace output (from "trace-cmd record -e smb3_tdis*"): umount-9718 [006] ..... 5909.780244: smb3_tdis_enter: xid=206 sid=0xcf38894e tid=0x3d0b8cf8 path=\\localhost\test umount-9718 [007] ..... 5909.780878: smb3_tdis_done: xid=206 sid=0xcf38894e tid=0x3d0b8cf8 Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 0350d7a39c7f8175fca001b6d6a39481da5ef22c Author: Tom Talpey Date: Fri Sep 23 21:54:00 2022 +0000 Fix formatting of client smbdirect RDMA logging Make the debug logging more consistent in formatting of addresses, lengths, and bitfields. Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Tom Talpey Signed-off-by: Steve French commit adeb964d3791e1eea8c4c3ab13549ccc7e411e07 Author: Tom Talpey Date: Fri Sep 23 21:53:59 2022 +0000 Handle variable number of SGEs in client smbdirect send. If/when an outgoing request contains more scatter/gather segments than can be mapped in a single RDMA send work request, use smbdirect fragments to send it in multiple packets. Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Tom Talpey Signed-off-by: Steve French commit 3c62df55f3306238f36dc19cbe40b5e3d288d116 Author: Tom Talpey Date: Fri Sep 23 21:53:57 2022 +0000 Reduce client smbdirect max receive segment size Reduce client smbdirect max segment receive size to 1364 to match protocol norms. Larger buffers are unnecessary and add significant memory overhead. Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Tom Talpey Signed-off-by: Steve French commit d2e81f92e5b76c4c260141928700442876fa4bb3 Author: Tom Talpey Date: Fri Sep 23 21:53:55 2022 +0000 Decrease the number of SMB3 smbdirect client SGEs The client-side SMBDirect layer requires no more than 6 send SGEs and 1 receive SGE. The previous default of 8 send and 8 receive causes smbdirect to fail on the SoftiWARP (siw) provider, and possibly others. Additionally, large numbers of SGEs reduces performance significantly on adapter implementations. Also correct the frmr page count comment (not an SGE count). Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Tom Talpey Signed-off-by: Steve French commit e98ecc6e94f4e6d21c06660b0f336df02836694f Author: Zhang Xiaoxu Date: Mon Sep 26 11:36:29 2022 +0800 cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message Commit d5c7076b772a ("smb3: add smb3.1.1 to default dialect list") extend the dialects from 3 to 4, but forget to decrease the extended length when specific the dialect, then the message length is larger than expected. This maybe leak some info through network because not initialize the message body. After apply this patch, the VALIDATE_NEGOTIATE_INFO message length is reduced from 28 bytes to 26 bytes. Fixes: d5c7076b772a ("smb3: add smb3.1.1 to default dialect list") Signed-off-by: Zhang Xiaoxu Cc: Acked-by: Paulo Alcantara (SUSE) Reviewed-by: Tom Talpey Signed-off-by: Steve French commit f5ba1cdaf5eb380e148183bda06d4844b457d095 Author: Atte Heikkilä Date: Mon Oct 3 02:09:34 2022 +0300 ksmbd: validate share name from share config response Share config response may contain the share name without casefolding as it is known to the user space daemon. When it is present, casefold and compare it to the share name the share config request was made with. If they differ, we have a share config which is incompatible with the way share config caching is done. This is the case when CONFIG_UNICODE is not set, the share name contains non-ASCII characters, and those non- ASCII characters do not match those in the share name known to user space. In other words, when CONFIG_UNICODE is not set, UTF-8 share names now work but are only case-insensitive in the ASCII range. Signed-off-by: Atte Heikkilä Acked-by: Tom Talpey Acked-by: Namjae Jeon Signed-off-by: Steve French commit 141fa9824c0fc11d44b2d5bb1266a33e95fa67fd Author: Namjae Jeon Date: Sun Oct 2 09:38:48 2022 +0900 ksmbd: call ib_drain_qp when disconnected When disconnected, call ib_drain_qp to cancel all pending work requests and prevent ksmbd_conn_handler_loop from waiting for a long time for those work requests to compelete. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Reviewed-by: Tom Talpey Signed-off-by: Steve French commit dbab80e2071ad8c702e50dab43326608a127d27b Author: Atte Heikkilä Date: Wed Sep 28 00:57:21 2022 +0300 ksmbd: make utf-8 file name comparison work in __caseless_lookup() Case-insensitive file name lookups with __caseless_lookup() use strncasecmp() for file name comparison. strncasecmp() assumes an ISO8859-1-compatible encoding, which is not the case here as UTF-8 is always used. As such, use of strncasecmp() here produces correct results only if both strings use characters in the ASCII range only. Fix this by using utf8_strncasecmp() if CONFIG_UNICODE is set. On failure or if CONFIG_UNICODE is not set, fallback to strncasecmp(). Also, as we are adding an include for `linux/unicode.h', include it in `fs/ksmbd/connection.h' as well since it should be explicit there. Signed-off-by: Atte Heikkilä Acked-by: Namjae Jeon Signed-off-by: Steve French commit 7c88c1e0ab1704bacb751341ee6431c3be34b834 Author: Mickaël Salaün Date: Thu Sep 29 12:04:47 2022 +0200 ksmbd: Fix user namespace mapping A kernel daemon should not rely on the current thread, which is unknown and might be malicious. Before this security fix, ksmbd_override_fsids() didn't correctly override FS UID/GID which means that arbitrary user space threads could trick the kernel to impersonate arbitrary users or groups for file system access checks, leading to file system access bypass. This was found while investigating truncate support for Landlock: https://lore.kernel.org/r/CAKYAXd8fpMJ7guizOjHgxEyyjoUwPsx3jLOPZP=wPYcbhkVXqA@mail.gmail.com Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: Hyunchul Lee Cc: Steve French Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220929100447.108468-1-mic@digikod.net Acked-by: Christian Brauner (Microsoft) Acked-by: Namjae Jeon Signed-off-by: Steve French commit 5876e99611a91dfb2fb1f7af9d1ae5c017c8331c Author: Namjae Jeon Date: Tue Sep 27 21:21:58 2022 +0900 ksmbd: hide socket error message when ipv6 config is disable When ipv6 config is disable(CONFIG_IPV6 is not set), ksmbd fallback to create ipv4 socket. User reported that this error message lead to misunderstood some issue. Users have requested not to print this error message that occurs even though there is no problem. Signed-off-by: Namjae Jeon Acked-by: Tom Talpey Signed-off-by: Steve French commit 78af146e109bef5b3c411964141c6f8adbccd3b0 Author: Tom Talpey Date: Fri Sep 23 21:53:58 2022 +0000 ksmbd: reduce server smbdirect max send/receive segment sizes Reduce ksmbd smbdirect max segment send and receive size to 1364 to match protocol norms. Larger buffers are unnecessary and add significant memory overhead. Signed-off-by: Tom Talpey Acked-by: Namjae Jeon Signed-off-by: Steve French commit 2b4eeeaa90617c5e37da7c804c422b4e833b87b2 Author: Tom Talpey Date: Fri Sep 23 21:53:56 2022 +0000 ksmbd: decrease the number of SMB3 smbdirect server SGEs The server-side SMBDirect layer requires no more than 6 send SGEs The previous default of 8 causes ksmbd to fail on the SoftiWARP (siw) provider, and possibly others. Additionally, large numbers of SGEs reduces performance significantly on adapter implementations. Signed-off-by: Tom Talpey Acked-by: Namjae Jeon Signed-off-by: Steve French commit b1763d265af62800ec96eeb79803c4c537dcef3a Author: Zhang Xiaoxu Date: Mon Sep 26 11:36:30 2022 +0800 ksmbd: Fix wrong return value and message length check in smb2_ioctl() Commit c7803b05f74b ("smb3: fix ksmbd bigendian bug in oplock break, and move its struct to smbfs_common") use the defination of 'struct validate_negotiate_info_req' in smbfs_common, the array length of 'Dialects' changed from 1 to 4, but the protocol does not require the client to send all 4. This lead the request which satisfied with protocol and server to fail. So just ensure the request payload has the 'DialectCount' in smb2_ioctl(), then fsctl_validate_negotiate_info() will use it to validate the payload length and each dialect. Also when the {in, out}_buf_len is less than the required, should goto out to initialize the status in the response header. Fixes: f7db8fd03a4b ("ksmbd: add validation in smb2_ioctl") Cc: stable@vger.kernel.org Signed-off-by: Zhang Xiaoxu Acked-by: Namjae Jeon Signed-off-by: Steve French commit 5bedae90b369ca1a7660b9af39591ed19009b495 Author: Namjae Jeon Date: Thu Sep 22 23:37:41 2022 +0900 ksmbd: set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob If NTLMSSP_NEGOTIATE_SEAL flags is set in negotiate blob from client, Set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit af705ef2b0ded0d8f54c238fdf3c17a1d47ad924 Author: Namjae Jeon Date: Thu Sep 22 23:36:34 2022 +0900 ksmbd: fix encryption failure issue for session logoff response If client send encrypted session logoff request on seal mount, Encryption for that response fails. ksmbd: Could not get encryption key CIFS: VFS: cifs_put_smb_ses: Session Logoff failure rc=-512 Session lookup fails in ksmbd_get_encryption_key() because sess->state is set to SMB2_SESSION_EXPIRED in session logoff. There is no need to do session lookup again to encrypt the response. This patch change to use ksmbd_session in ksmbd_work. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 360c8ee6fefdb496fffd2c18bb9a96a376a1a804 Author: Namjae Jeon Date: Thu Sep 22 23:35:43 2022 +0900 ksmbd: fix endless loop when encryption for response fails If ->encrypt_resp return error, goto statement cause endless loop. It send an error response immediately after removing it. Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers") Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d5919f2a1459083bd0aaede7fc44e945290e44df Author: Namjae Jeon Date: Thu Sep 22 23:27:34 2022 +0900 ksmbd: fill sids in SMB_FIND_FILE_POSIX_INFO response This patch fill missing sids in SMB_FIND_FILE_POSIX_INFO response. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f6c2b201da7588f7f7688ddc99b7bb000609129c Author: Namjae Jeon Date: Thu Sep 22 23:16:12 2022 +0900 ksmbd: set file permission mode to match Samba server posix extension behavior Set file permission mode to match Samba server posix extension behavior. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5609bdd9ffdccd83f9003511b1801584b703baa5 Author: Namjae Jeon Date: Thu Sep 22 23:08:49 2022 +0900 ksmbd: change security id to the one samba used for posix extension Samba set SIDOWNER and SIDUNIX_GROUP in create posix context and set SIDUNIX_USER/GROUP in other sids for posix extension. This patch change security id to the one samba used. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b1c6b8403afb0e2083e3ed16694d5d5819400e4b Author: Namjae Jeon Date: Thu Sep 15 23:01:06 2022 +0900 ksmbd: update documentation configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method. Signed-off-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Reviewed-by: Tom Talpey Signed-off-by: Steve French commit 16b5f54e30c1ddec36bdf946a299b3254aace477 Author: Atte Heikkilä Date: Thu Sep 15 22:49:11 2022 +0900 ksmbd: casefold utf-8 share names and fix ascii lowercase conversion strtolower() corrupts all UTF-8 share names that have a byte in the C0 (À ISO8859-1) to DE (Þ ISO8859-1) range, since the non-ASCII part of ISO8859-1 is incompatible with UTF-8. Prevent this by checking that a byte is in the ASCII range with isascii(), before the conversion to lowercase with tolower(). Properly handle case-insensitivity of UTF-8 share names by casefolding them, but fallback to ASCII lowercase conversion on failure or if CONFIG_UNICODE is not set. Refactor to move the share name casefolding immediately after the share name extraction. Also, make the associated constness corrections. Signed-off-by: Atte Heikkilä Acked-by: Namjae Jeon Signed-off-by: Steve French commit 276a3f7cf1d9bae125d8cdc345f67ec52751d704 Author: Christian Brauner Date: Fri Sep 9 12:51:19 2022 +0200 ksmbd: port to vfs{g,u}id_t and associated helpers A while ago we introduced a dedicated vfs{g,u}id_t type in commit 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched over a good part of the VFS. Ultimately we will remove all legacy idmapped mount helpers that operate only on k{g,u}id_t in favor of the new type safe helpers that operate on vfs{g,u}id_t. Cc: Seth Forshee (Digital Ocean) Cc: Steve French Cc: Christoph Hellwig Cc: Namjae Jeon Cc: Hyunchul Lee Cc: Sergey Senozhatsky Cc: linux-cifs@vger.kernel.org Signed-off-by: Christian Brauner (Microsoft) Acked-by: Namjae Jeon Signed-off-by: Steve French commit 88541cb414b7a2450c45fc9c131b37b5753b7679 Author: Namjae Jeon Date: Fri Sep 9 17:43:53 2022 +0900 ksmbd: fix incorrect handling of iterate_dir if iterate_dir() returns non-negative value, caller has to treat it as normal and check there is any error while populating dentry information. ksmbd doesn't have to do anything because ksmbd already checks too small OutputBufferLength to store one file information. And because ctx->pos is set to file->f_pos when iterative_dir is called, remove restart_ctx(). And if iterate_dir() return -EIO, which mean directory entry is corrupted, return STATUS_FILE_CORRUPT_ERROR error response. This patch fixes some failure of SMB2_QUERY_DIRECTORY, which happens when ntfs3 is local filesystem. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ae2dc0b103d918dc0328e4e71c41495bc627c31b Author: Hyunchul Lee Date: Thu Sep 8 23:44:45 2022 +0900 MAINTAINERS: remove Hyunchul Lee from ksmbd maintainers I don't have the necessary time to maintain the ksmbd code. So remove myself from maintainers of ksmbd. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit 1129a4ff545b13ed71e25d52bf4b6e74dfabac8c Author: Namjae Jeon Date: Sat Sep 3 10:42:36 2022 +0900 MAINTAINERS: Add Tom Talpey as ksmbd reviewer Tom have been actively reviewing ksmbd patches as well as smb-direct patches. He agreed to help us as a reviewer, So adding him to reviewer list in ksmbd entry. Signed-off-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Reviewed-by: Hyunchul Lee Acked-by: Tom Talpey Signed-off-by: Steve French commit 823d0d3e2b05791ba8cbab22574b947c21f89c18 Author: Namjae Jeon Date: Tue Aug 30 23:01:18 2022 +0900 ksmbd: remove generic_fillattr use in smb2_open() Removed the use of unneeded generic_fillattr() in smb2_open(). Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c22180a5e2a9e1426fab01d9e54011ec531b1b52 Author: Al Viro Date: Thu Aug 4 12:51:14 2022 -0400 ksmbd: constify struct path ... in particular, there should never be a non-const pointers to any file->f_path. Acked-by: Namjae Jeon Signed-off-by: Al Viro Signed-off-by: Steve French commit 369c1634cc7ae8645a5cba4c7eb874755c2a6a07 Author: Al Viro Date: Sun Jan 30 21:11:02 2022 -0500 ksmbd: don't open-code %pD a bunch of places used %pd with file->f_path.dentry; shorter (and saner) way to spell that is %pD with file... Acked-by: Namjae Jeon Signed-off-by: Al Viro Signed-off-by: Steve French commit 2f5930c1d7936b74eb820c5b157011994c707a74 Author: Al Viro Date: Sun Jan 30 19:43:00 2022 -0500 ksmbd: don't open-code file_path() Acked-by: Namjae Jeon Signed-off-by: Al Viro Signed-off-by: Steve French commit 2bca25eaeba6190efbfcb38ed169bd7ee43b5aaf Merge: d40c874573145 8e9204cddcc3f Author: Linus Torvalds Date: Tue Oct 4 19:36:53 2022 -0700 Merge tag 'spi-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "With the exception of some refactoring to fix long standing issues where we weren't handling cache syncs properly for messages which had PIO and DMA transfers going to the same page correctly there has been no work on the core this time around, and it's also been quite a quiet release for the drivers too: - Fix cache syncs for cases where we have DMA and PIO transfers in the same message going to the same page - Update the fsl_spi driver to use transfer_one() rather than a custom transfer function - Support for configuring transfer speeds with the AMD SPI controller - Support for a second chip select and 64K erase on Intel SPI - Support for Microchip coreQSPI, Nuvoton NPCM845, NXP i.MX93, and Rockchip RK3128 and RK3588" * tag 'spi-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (73 commits) spi: Ensure that sg_table won't be used after being freed spi: spi-gxp: Use devm_platform_ioremap_resource() spi: s3c64xx: Fix large transfers with DMA spi: Split transfers larger than max size spi: Fix cache corruption due to DMA/PIO overlap spi: Save current RX and TX DMA devices spi: mt65xx: Add dma max segment size declaration spi: migrate mt7621 text bindings to YAML spi: renesas,sh-msiof: Add r8a779g0 support spi: spi-fsl-qspi: Use devm_platform_ioremap_resource_byname() spi: spi-fsl-lpspi: Use devm_platform_get_and_ioremap_resource() spi: spi-fsl-dspi: Use devm_platform_get_and_ioremap_resource() spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe spi: s3c24xx: Switch to use devm_spi_alloc_master() spi: xilinx: Switch to use devm_spi_alloc_master() spi: img-spfi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync spi: aspeed: Remove redundant dev_err call spi: spi-mpc52xx: switch to using gpiod API ... commit d40c874573145b4af3b3b6205f3741b498697623 Merge: 521d04e3c8a7d 392cc0a4a0c4b Author: Linus Torvalds Date: Tue Oct 4 19:27:45 2022 -0700 Merge tag 'regulator-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "The core work this time around has mostly been around the code to manage regulator modes, simplifying the interface for configuring modes to not take account of the voltage and as a side effect resolving a bootstrapping issue on systems where we can't read the voltage from the regulator. Otherwise it's been quite a quiet release with some new drivers and a devm helper: - Make the load handling in the Qualcomm RPMH regulators much more idiomatic and general cleanups to the handling of load configuration - devm helper for a combined get and enable operation - Support for MediaTek MT6331, Qualcomm PM660, 660L and PM6125, Texas Instruments TPS65219" * tag 'regulator-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (45 commits) dt-bindings: gpio-regulator: add vin-supply property support regulator: gpio: Add input_supply support in gpio_regulator_config regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass regulator: qcom,rpmh: add pm660 and pm660l pmics regulator: qcom-rpmh: add pm660 and pm660l pmics regulator: of: Fix kernel-doc regulator: of: Fix kernel-doc regulator: Add driver for MT6332 PMIC regulators regulator: Add bindings for MT6332 regulator regulator: Add driver for MT6331 PMIC regulators regulator: Add bindings for MT6331 regulator regulator: tps65219: Fix .bypass_val_on setting regulator: qcom_rpm: Fix circular deferral regression regulator: core: Prevent integer underflow regulator: dt-bindings: qcom,rpmh: Indicate regulator-allow-set-load dependencies regulator: bd9576: switch to using devm_fwnode_gpiod_get() regulator: bd71815: switch to using devm_fwnode_gpiod_get() regulator: core: Fix regulator supply registration with sysfs regulator: tps65219: change tps65219_regulator_irq_types to static regulator: core: Don't err if allow-set-load but no allowed-modes ... commit 521d04e3c8a7dda4ed1ee1630e92d370688f6b33 Merge: 0baf6dcc02c13 01ed230761e51 Author: Linus Torvalds Date: Tue Oct 4 19:12:16 2022 -0700 Merge tag 'regmap-v6.1' 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 regmap with one thing and other, there's been an especially large interest in MMIO regmaps for some reason. The bulk of the changes are cleanups but there are several user visible changes too: - Support for I/O ports in regmap-mmio - Support for accelerated noinc operations in regmap-mmio - Support for tracing the register values in bulk operations" * tag 'regmap-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: mmio: replace return 0 with break in switch statement regmap: spi-avmm: Use swabXX_array() helpers regmap: mmio: Use swabXX_array() helpers swab: Add array operations regmap: trace: Remove unneeded blank lines regmap: trace: Remove explicit castings regmap: trace: Remove useless check for NULL for bulk ops regmap: mmio: Fix rebase error regmap: check right noinc bounds in debug print regmap: introduce value tracing for regmap bulk operations regmap/hexagon: Properly fix the generic IO helpers regmap: mmio: Support accelerared noinc operations regmap: Support accelerated noinc operations regmap: Make use of get_unaligned_be24(), put_unaligned_be24() regmap: mmio: Fix MMIO accessors to avoid talking to IO port regmap: mmio: Introduce IO accessors that can talk to IO port regmap: mmio: Get rid of broken 64-bit IO regmap: mmio: Remove mmio_relaxed member from context commit 0baf6dcc02c130a69fb21088ec31a0ba7a896f22 Merge: b86406d42ae3c 0cf46a653bdae Author: Linus Torvalds Date: Tue Oct 4 19:02:54 2022 -0700 Merge tag 'hwmon-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for MAX31760 fan speed controller - Driver for TEXAS TPS546D24 Buck Converter - Driver for EMC2301/2/3/5 RPM-based PWM Fan Speed Controller Removed drivers: - Drop obsolete asus_wmi_ec_sensors driver Cleanups, affecting various drivers: - Use DEFINE_SIMPLE_DEV_PM_OPS where appropriate - Remove forward declarations - Move from strlcpy with unused retval to strscpy - Make use of devm_clk_get_enabled() - Drop devm_of_pwm_get() Other notable cleanup and improvements: - Support for additional USB devide ID and support for reporting of rail mode via debugfs added to corsair-psu driver - Support for aditional USB ID in nzxt-smart2 driver - Support for Aquacomputer High Flow Next in aquacomputer_d5next driver - Major cleanup of pwm-fan driver - Major cleanup of mr75203 driver, and added support for new device revision And various other minor fixes and cleanups" * tag 'hwmon-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (86 commits) hwmon: (corsair-psu) add USB id of new revision of the HX1000i psu hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller dt-bindings: hwmon: sensirion,shtc1: Clean up spelling mistakes and grammar hwmon: (nct6683) remove unused variable in nct6683_create_attr_group hwmon: w83627hf: Reorder symbols to get rid of a few forward declarations hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() hwmon: (w83627ehf) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp108) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp103) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp102) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (pwm-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (nct6775) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max6639) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max31730) witch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max31722) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (ltc2947) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (lm90) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (adt7x10) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() ... commit b86406d42ae3c41ae0ce332ea24350829b88af51 Merge: 0326074ff4652 228336f50711e Author: Linus Torvalds Date: Tue Oct 4 18:54:33 2022 -0700 Merge tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - 'remove' callback converted to return void. Big change with trivial fixes all over the tree. Other subsystems depending on this change have been asked to pull an immutable topic branch for this. - new driver for Microchip PCI1xxxx switch - heavy refactoring of the Mellanox BlueField driver - we prefer async probe in the i801 driver now - the rest is usual driver updates (support for more SoCs, some refactoring, some feature additions) * tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (37 commits) i2c: pci1xxxx: prevent signed integer overflow i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper i2c: i801: Prefer async probe i2c: designware-pci: Use standard pattern for memory allocation i2c: designware-pci: Group AMD NAVI quirk parts together i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED i2c: mlxbf: remove device tree support i2c: mlxbf: support BlueField-3 SoC i2c: cadence: Add standard bus recovery support i2c: mlxbf: add multi slave functionality i2c: mlxbf: support lock mechanism macintosh/ams: Adapt declaration of ams_i2c_remove() to earlier change i2c: riic: Use devm_platform_ioremap_resource() i2c: mlxbf: remove IRQF_ONESHOT dt-bindings: i2c: rockchip: add rockchip,rk3128-i2c dt-bindings: i2c: renesas,rcar-i2c: Add r8a779g0 support i2c: tegra: Add GPCDMA support i2c: scmi: Convert to be a platform driver i2c: rk3x: Add rv1126 support ... commit 4ff116d0d5fd8a025604b0802d93a2d5f4e465d1 Author: Vidya Sagar Date: Tue Sep 13 18:48:22 2022 +0530 PCI/ASPM: Save L1 PM Substates Capability for suspend/resume Previously the L1 PM Substates Control Registers (CTL1 and CTL2) weren't saved and restored during suspend/resume leading to the L1 PM Substates configuration being lost post-resume. Save the L1 PM Substates Control Registers so that the configuration is retained post-resume. [bhelgaas: drop pci_is_pcie() testing; we can rely on pci_configure_ltr() having already done that] Link: https://lore.kernel.org/r/20220913131822.16557-3-vidyas@nvidia.com Signed-off-by: Vidya Sagar Signed-off-by: Bjorn Helgaas commit 5e85eba6f50dc288c22083a7e213152bcc4b8208 Author: Vidya Sagar Date: Tue Sep 13 18:48:21 2022 +0530 PCI/ASPM: Refactor L1 PM Substates Control Register programming Refactor the code to extract the common code to program Control Registers 1 and 2 of the L1 PM Substates capability to a new function aspm_program_l1ss() and call it for both parent and child devices. [bhelgaas: squash in update to preserve fields we're not updating from https://lore.kernel.org/r/36fa13c5-e0f8-022f-77f7-7908e4df98b8@nvidia.com] Link: https://lore.kernel.org/r/20220913131822.16557-2-vidyas@nvidia.com Signed-off-by: Vidya Sagar Signed-off-by: Bjorn Helgaas commit b2e82e495a528eed77c15f3923c2b049a21d7280 Author: Nicholas Piggin Date: Tue Oct 4 23:29:52 2022 +1000 powerpc/64s/interrupt: Fix stack frame regs marker The value of the stack frame regs marker that gets saved on the stack in interrupt entry code does not match the regs marker value, which breaks stack frame marker matching. This stray instruction looks to have been introduced in a mismerge. Fixes: bf75a3258a403 ("powerpc/64s/interrupt: move early boot ILE fixup into a macro") Signed-off-by: Nicholas Piggin [mpe: Mismerge by yours truly -_-] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221004132952.984341-1-npiggin@gmail.com commit e4a7e67a08ac409f1485c82a2190636d5c81b932 Author: Frank Li Date: Tue Oct 4 15:24:14 2022 -0500 irqchip/imx-mu-msi: Fix wrong register offset for 8ulp Offset 0x124 should be for IMX_MU_TSR, not IMX_MU_GSR. Fixes: 70afdab904d2 ("irqchip: Add IMX MU MSI controller driver") Reported-by: Colin King Signed-off-by: Frank Li [maz: updated commit message, tags] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221004202414.216577-1-Frank.Li@nxp.com commit 60ece0833b6c2bc1465eb2803fec20b670e2ee93 Author: Christian Schoenebeck Date: Fri Jul 15 23:33:56 2022 +0200 net/9p: allocate appropriate reduced message buffers So far 'msize' was simply used for all 9p message types, which is far too much and slowed down performance tremendously with large values for user configurable 'msize' option. Let's stop this waste by using the new p9_msg_buf_size() function for allocating more appropriate, smaller buffers according to what is actually sent over the wire. Only exception: RDMA transport is currently excluded from this message size optimization - for its response buffers that is - as RDMA transport would not cope with it, due to its response buffers being pulled from a shared pool. [1] Link: https://lore.kernel.org/all/Ys3jjg52EIyITPua@codewreck.org/ [1] Link: https://lkml.kernel.org/r/3f51590535dc96ed0a165b8218c57639cfa5c36c.1657920926.git.linux_oss@crudebyte.com Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 01d205d936ae18532e14814808592b926aacc6d5 Author: Christian Schoenebeck Date: Fri Jul 15 23:33:09 2022 +0200 net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module This is a preparatory change for the subsequent patch: the RDMA transport pulls the buffers for its 9p response messages from a shared pool. [1] So this case has to be considered when choosing an appropriate response message size in the subsequent patch. Link: https://lore.kernel.org/all/Ys3jjg52EIyITPua@codewreck.org/ [1] Link: https://lkml.kernel.org/r/79d24310226bc4eb037892b5c097ec4ad4819a03.1657920926.git.linux_oss@crudebyte.com Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 1effdbf94a728b74b23a24ce7b6f1d1d9a2480a4 Author: Christian Schoenebeck Date: Fri Jul 15 23:32:34 2022 +0200 net/9p: add p9_msg_buf_size() This new function calculates a buffer size suitable for holding the intended 9p request or response. For rather small message types (which applies to almost all 9p message types actually) simply use hard coded values. For some variable-length and potentially large message types calculate a more precise value according to what data is actually transmitted to avoid unnecessarily huge buffers. So p9_msg_buf_size() divides the individual 9p message types into 3 message size categories: - dynamically calculated message size (i.e. potentially large) - 8k hard coded message size - 4k hard coded message size As for the latter two hard coded message types: for most 9p message types it is pretty obvious whether they would always fit into 4k or 8k. But for some of them it depends on the maximum directory entry name length allowed by OS and filesystem for determining into which of the two size categories they would fit into. Currently Linux supports directory entry names up to NAME_MAX (255), however when comparing the limitation of individual filesystems, ReiserFS theoretically supports up to slightly below 4k long names. So in order to make this code more future proof, and as revisiting it later on is a bit tedious and has the potential to miss out details, the decision [1] was made to take 4k as basis as for max. name length. Link: https://lkml.kernel.org/r/bd6be891cf67e867688e8c8796d06408bfafa0d9.1657920926.git.linux_oss@crudebyte.com Link: https://lore.kernel.org/all/5564296.oo812IJUPE@silver/ [1] Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 58d331312bf78a10740fc3c6c370c98e8c53fa6b Author: Christian Schoenebeck Date: Fri Jul 15 23:32:30 2022 +0200 9p: add P9_ERRMAX for 9p2000 and 9p2000.u Add P9_ERRMAX macro to 9P protocol header which reflects the maximum error string length of Rerror replies for 9p2000 and 9p2000.u protocol versions. Unfortunately a maximum error string length is not defined by the 9p2000 spec, picking 128 as value for now, as this seems to be a common max. size for POSIX error strings in practice. 9p2000.L protocol version uses Rlerror replies instead which does not contain an error string. Link: https://lkml.kernel.org/r/3f23191d21032e7c14852b1e1a4ae26417a36739.1657920926.git.linux_oss@crudebyte.com Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit e7c6219778e46143ee9e68a25febac10a66383ae Author: Christian Schoenebeck Date: Fri Jul 15 23:32:28 2022 +0200 net/9p: split message size argument into 't_size' and 'r_size' pair Refactor 'max_size' argument of p9_tag_alloc() and 'req_size' argument of p9_client_prepare_req() both into a pair of arguments 't_size' and 'r_size' respectively to allow handling the buffer size for request and reply separately from each other. Link: https://lkml.kernel.org/r/9431a25fe4b37fd12cecbd715c13af71f701f220.1657920926.git.linux_oss@crudebyte.com Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 52f1c45dde9136f964d63a77d19826c8a74e2c7f Author: Dominique Martinet Date: Wed Aug 17 14:58:44 2022 +0900 9p: trans_fd/p9_conn_cancel: drop client lock earlier syzbot reported a double-lock here and we no longer need this lock after requests have been moved off to local list: just drop the lock earlier. Link: https://lkml.kernel.org/r/20220904064028.1305220-1-asmadeus@codewreck.org Reported-by: syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com Signed-off-by: Dominique Martinet Tested-by: Schspa Shi commit 2d869f0b458547386fbcd8cf3004b271b7347b7f Author: Stefan Berger Date: Tue Sep 20 09:15:18 2022 -0400 selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle The following output can bee seen when the test is executed: test_flush_context (tpm2_tests.SpaceTest) ... \ /usr/lib64/python3.6/unittest/case.py:605: ResourceWarning: \ unclosed file <_io.FileIO name='/dev/tpmrm0' mode='rb+' closefd=True> An instance of Client does not implicitly close /dev/tpm* handle, once it gets destroyed. Close the file handle in the class destructor Client.__del__(). Fixes: 6ea3dfe1e0732 ("selftests: add TPM 2.0 tests") Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Cc: Jarkko Sakkinen Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 72e9be6be9c08d882f94f80c7cf1b27f0896213d Author: Vincenzo Frascino Date: Wed Sep 7 13:12:30 2022 +0100 security/keys: Remove inconsistent __user annotation The declaration of keyring_read does not match the definition (security/keys/keyring.c). In this case the definition is correct because it matches what defined in "struct key_type::read" (linux/key-type.h). Fix the declaration removing the inconsistent __user annotation. Cc: David Howells Cc: Jarkko Sakkinen Cc: Paul Moore Cc: James Morris Signed-off-by: Vincenzo Frascino Reviewed-by: Paul Moore Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit e174b1273ef97d090ef85cb09a6bfdc10ea8dcf6 Author: Wolfram Sang Date: Thu Aug 18 22:59:59 2022 +0200 char: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Jarkko Sakkinen commit 9992dd777123b052e106eb5633de47148fef502e Author: Len Brown Date: Tue Oct 4 23:02:03 2022 +0200 tools/power turbostat: version 2022.10.04 Signed-off-by: Len Brown commit b2d433ae637626d44c9d4a75dd3330cf68fed9de Author: Zhang Rui Date: Sat Sep 24 13:47:38 2022 +0800 tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR rapl_dram_energy_units quirk. Fixes: e7af1ed3fa47 ("tools/power turbostat: Support additional CPU model numbers") Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Len Brown commit 3ea8e52ec94de6cd5e8a9dc7b2ec72a7745b4e47 Author: Artem Bityutskiy Date: Fri Sep 16 14:59:50 2022 +0300 tools/power turbostat: Do not dump TRL if turbo is not supported Do not dump turbo ratio limits if platform does not support turbo, because it is confusing and the TRL MSRs may even include misleading information. And they are not supposed to be relied on if turbo is not supported. Signed-off-by: Artem Bityutskiy Signed-off-by: Len Brown commit 8e45a9bf7ac1337f65772901d432b6d811bec67a Author: Zhang Rui Date: Sat Sep 10 21:15:42 2022 +0800 tools/power turbostat: Add support for MeteorLake platforms Add turbostat support for MeteorLake platforms, which behave the same as RaptorLake platforms. Signed-off-by: Zhang Rui Signed-off-by: Len Brown commit 9b1c2ecfa02bc2645e6e9d55f0f39bc191991270 Author: Zhang Rui Date: Wed Aug 31 14:49:57 2022 +0800 tools/power turbostat: Add support for RPL-S Add turbostat support for RAPTORLAKE_S platform, which behaves the same as RAPTORLAKE and RAPTORLAKE_P platforms. RPL-S 601/801 have different CPU ID than the Hybrid ADL-S platforms. Signed-off-by: Zhang Rui Signed-off-by: Len Brown commit 40a5af128af54dc0fbd06e11ef2d8a693e25d33f Merge: 302c9454e4d68 17fffac44943a Author: Arnd Bergmann Date: Tue Oct 4 22:43:32 2022 +0200 Merge tag 'samsung-dt-dt64-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM and ARM64 changes for v6.1 Late cleanup and fixes for Samsung DTS: 1. Fix polarity of pins: - enable GPIO of NFC chip in Exynos5433 TM2 boards, - vbus GPIO of EHCI in Exynos4412 Origen board. 2. Correct name of pin configuration nodes - redundant "pins" in the name (no functional impact). * tag 'samsung-dt-dt64-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: s5pv210: correct double "pins" in pinmux node ARM: dts: exynos: fix polarity of VBUS GPIO of Origen arm64: dts: exynos: fix polarity of "enable" line of NFC chip in TM2 Link: https://lore.kernel.org/r/20221003073916.12588-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 0326074ff4652329f2a1a9c8685104576bd8d131 Merge: 522667b24f080 681bf011b9b59 Author: Linus Torvalds Date: Tue Oct 4 13:38:03 2022 -0700 Merge tag 'net-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "Core: - Introduce and use a single page frag cache for allocating small skb heads, clawing back the 10-20% performance regression in UDP flood test from previous fixes. - Run packets which already went thru HW coalescing thru SW GRO. This significantly improves TCP segment coalescing and simplifies deployments as different workloads benefit from HW or SW GRO. - Shrink the size of the base zero-copy send structure. - Move TCP init under a new slow / sleepable version of DO_ONCE(). BPF: - Add BPF-specific, any-context-safe memory allocator. - Add helpers/kfuncs for PKCS#7 signature verification from BPF programs. - Define a new map type and related helpers for user space -> kernel communication over a ring buffer (BPF_MAP_TYPE_USER_RINGBUF). - Allow targeting BPF iterators to loop through resources of one task/thread. - Add ability to call selected destructive functions. Expose crash_kexec() to allow BPF to trigger a kernel dump. Use CAP_SYS_BOOT check on the loading process to judge permissions. - Enable BPF to collect custom hierarchical cgroup stats efficiently by integrating with the rstat framework. - Support struct arguments for trampoline based programs. Only structs with size <= 16B and x86 are supported. - Invoke cgroup/connect{4,6} programs for unprivileged ICMP ping sockets (instead of just TCP and UDP sockets). - Add a helper for accessing CLOCK_TAI for time sensitive network related programs. - Support accessing network tunnel metadata's flags. - Make TCP SYN ACK RTO tunable by BPF programs with TCP Fast Open. - Add support for writing to Netfilter's nf_conn:mark. Protocols: - WiFi: more Extremely High Throughput (EHT) and Multi-Link Operation (MLO) work (802.11be, WiFi 7). - vsock: improve support for SO_RCVLOWAT. - SMC: support SO_REUSEPORT. - Netlink: define and document how to use netlink in a "modern" way. Support reporting missing attributes via extended ACK. - IPSec: support collect metadata mode for xfrm interfaces. - TCPv6: send consistent autoflowlabel in SYN_RECV state and RST packets. - TCP: introduce optional per-netns connection hash table to allow better isolation between namespaces (opt-in, at the cost of memory and cache pressure). - MPTCP: support TCP_FASTOPEN_CONNECT. - Add NEXT-C-SID support in Segment Routing (SRv6) End behavior. - Adjust IP_UNICAST_IF sockopt behavior for connected UDP sockets. - Open vSwitch: - Allow specifying ifindex of new interfaces. - Allow conntrack and metering in non-initial user namespace. - TLS: support the Korean ARIA-GCM crypto algorithm. - Remove DECnet support. Driver API: - Allow selecting the conduit interface used by each port in DSA switches, at runtime. - Ethernet Power Sourcing Equipment and Power Device support. - Add tc-taprio support for queueMaxSDU parameter, i.e. setting per traffic class max frame size for time-based packet schedules. - Support PHY rate matching - adapting between differing host-side and link-side speeds. - Introduce QUSGMII PHY mode and 1000BASE-KX interface mode. - Validate OF (device tree) nodes for DSA shared ports; make phylink-related properties mandatory on DSA and CPU ports. Enforcing more uniformity should allow transitioning to phylink. - Require that flash component name used during update matches one of the components for which version is reported by info_get(). - Remove "weight" argument from driver-facing NAPI API as much as possible. It's one of those magic knobs which seemed like a good idea at the time but is too indirect to use in practice. - Support offload of TLS connections with 256 bit keys. New hardware / drivers: - Ethernet: - Microchip KSZ9896 6-port Gigabit Ethernet Switch - Renesas Ethernet AVB (EtherAVB-IF) Gen4 SoCs - Analog Devices ADIN1110 and ADIN2111 industrial single pair Ethernet (10BASE-T1L) MAC+PHY. - Rockchip RV1126 Gigabit Ethernet (a version of stmmac IP). - Ethernet SFPs / modules: - RollBall / Hilink / Turris 10G copper SFPs - HALNy GPON module - WiFi: - CYW43439 SDIO chipset (brcmfmac) - CYW89459 PCIe chipset (brcmfmac) - BCM4378 on Apple platforms (brcmfmac) Drivers: - CAN: - gs_usb: HW timestamp support - Ethernet PHYs: - lan8814: cable diagnostics - Ethernet NICs: - Intel (100G): - implement control of FCS/CRC stripping - port splitting via devlink - L2TPv3 filtering offload - nVidia/Mellanox: - tunnel offload for sub-functions - MACSec offload, w/ Extended packet number and replay window offload - significantly restructure, and optimize the AF_XDP support, align the behavior with other vendors - Huawei: - configuring DSCP map for traffic class selection - querying standard FEC statistics - querying SerDes lane number via ethtool - Marvell/Cavium: - egress priority flow control - MACSec offload - AMD/SolarFlare: - PTP over IPv6 and raw Ethernet - small / embedded: - ax88772: convert to phylink (to support SFP cages) - altera: tse: convert to phylink - ftgmac100: support fixed link - enetc: standard Ethtool counters - macb: ZynqMP SGMII dynamic configuration support - tsnep: support multi-queue and use page pool - lan743x: Rx IP & TCP checksum offload - igc: add xdp frags support to ndo_xdp_xmit - Ethernet high-speed switches: - Marvell (prestera): - support SPAN port features (traffic mirroring) - nexthop object offloading - Microchip (sparx5): - multicast forwarding offload - QoS queuing offload (tc-mqprio, tc-tbf, tc-ets) - Ethernet embedded switches: - Marvell (mv88e6xxx): - support RGMII cmode - NXP (felix): - standardized ethtool counters - Microchip (lan966x): - QoS queuing offload (tc-mqprio, tc-tbf, tc-cbs, tc-ets) - traffic policing and mirroring - link aggregation / bonding offload - QUSGMII PHY mode support - Qualcomm 802.11ax WiFi (ath11k): - cold boot calibration support on WCN6750 - support to connect to a non-transmit MBSSID AP profile - enable remain-on-channel support on WCN6750 - Wake-on-WLAN support for WCN6750 - support to provide transmit power from firmware via nl80211 - support to get power save duration for each client - spectral scan support for 160 MHz - MediaTek WiFi (mt76): - WiFi-to-Ethernet bridging offload for MT7986 chips - RealTek WiFi (rtw89): - P2P support" * tag 'net-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1864 commits) eth: pse: add missing static inlines once: rename _SLOW to _SLEEPABLE net: pse-pd: add regulator based PSE driver dt-bindings: net: pse-dt: add bindings for regulator based PoDL PSE controller ethtool: add interface to interact with Ethernet Power Equipment net: mdiobus: search for PSE nodes by parsing PHY nodes. net: mdiobus: fwnode_mdiobus_register_phy() rework error handling net: add framework to support Ethernet PSE and PDs devices dt-bindings: net: phy: add PoDL PSE property net: marvell: prestera: Propagate nh state from hw to kernel net: marvell: prestera: Add neighbour cache accounting net: marvell: prestera: add stub handler neighbour events net: marvell: prestera: Add heplers to interact with fib_notifier_info net: marvell: prestera: Add length macros for prestera_ip_addr net: marvell: prestera: add delayed wq and flush wq on deinit net: marvell: prestera: Add strict cleanup of fib arbiter net: marvell: prestera: Add cleanup of allocated fib_nodes net: marvell: prestera: Add router nexthops ABI eth: octeon: fix build after netif_napi_add() changes net/mlx5: E-Switch, Return EBUSY if can't get mode lock ... commit 95fa90c9e5a7f14c2497d5b032544478c9377c3a Author: Chao Yu Date: Wed Sep 28 23:38:54 2022 +0800 f2fs: support recording errors into superblock This patch supports to record detail reason of FSCORRUPTED error into f2fs_super_block.s_errors[]. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a9cfee0ef98e99c8b1951dfd1d57a88580354d0d Author: Chao Yu Date: Wed Sep 28 23:38:53 2022 +0800 f2fs: support recording stop_checkpoint reason into super_block This patch supports to record stop_checkpoint error into f2fs_super_block.s_stop_reason[]. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ca7efd71c3dffd5442b448dd553a903425222597 Author: Zhang Qilong Date: Fri Sep 23 15:17:55 2022 +0800 f2fs: remove the unnecessary check in f2fs_xattr_fiemap Whehter or not error occurs, checking "err == 1" is unnecessary in f2fs_xattr_fiemap(), and just remove it here. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 718693c84d8f4b235d030c377258f12f38a71c67 Author: Chao Yu Date: Tue Sep 27 10:44:47 2022 +0800 f2fs: introduce cp_status sysfs entry This patch adds a new sysfs entry named cp_status, it can output checkpoint flags in real time. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fcc2d8cc96b2f6141bbbe5b1e8953db990794b44 Author: Chao Yu Date: Tue Sep 13 15:48:12 2022 +0800 f2fs: fix to detect corrupted meta ino It is possible that ino of dirent or orphan inode is corrupted in a fuzzed image, occasionally, if corrupted ino is equal to meta ino: meta_ino, node_ino or compress_ino, caller of f2fs_iget() from below call paths will get meta inode directly, it's not allowed, let's add sanity check to detect such cases. case #1 - recover_dentry - __f2fs_find_entry - f2fs_iget_retry case #2 - recover_orphan_inode - f2fs_iget_retry Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d80afefb17e01aa0c46a8eebc01882e0ebd8b0f6 Author: Chao Yu Date: Wed Sep 14 21:28:46 2022 +0800 f2fs: fix to account FS_CP_DATA_IO correctly f2fs_inode_info.cp_task was introduced for FS_CP_DATA_IO accounting since commit b0af6d491a6b ("f2fs: add app/fs io stat"). However, cp_task usage coverage has been increased due to below commits: commit 040d2bb318d1 ("f2fs: fix to avoid deadloop if data_flush is on") commit 186857c5a14a ("f2fs: fix potential recursive call when enabling data_flush") So that, if data_flush mountoption is on, when data flush was triggered from background, the IO from data flush will be accounted as checkpoint IO type incorrectly. In order to fix this issue, this patch splits cp_task into two: a) cp_task: used for IO accounting b) wb_task: used to avoid deadlock Fixes: 040d2bb318d1 ("f2fs: fix to avoid deadloop if data_flush is on") Fixes: 186857c5a14a ("f2fs: fix potential recursive call when enabling data_flush") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 544b53dadc208278fd0796f2c22ea24a3fe16564 Author: Zhang Qilong Date: Wed Sep 14 09:33:22 2022 +0800 f2fs: code clean and fix a type error ERROR: code indent should use tabs where possible ERROR: spaces required around that ':' ERROR: incorrect tab Found serveral code type errors when review the code and fix it. There is no function change. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a834aa3ec95b0d1a465854b27016eec1af2f0e1f Author: Zhang Qilong Date: Mon Sep 19 19:57:09 2022 +0800 f2fs: add "c_len" into trace_f2fs_update_extent_tree_range for compressed file The trace_f2fs_update_extent_tree_range could not record compressed block length in the cluster of compress file and we just add it. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c6ad7fd16657ebd34a87a97d9588195aae87597d Author: Chao Yu Date: Wed Sep 14 19:51:51 2022 +0800 f2fs: fix to do sanity check on summary info As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216456 BUG: KASAN: use-after-free in recover_data+0x63ae/0x6ae0 [f2fs] Read of size 4 at addr ffff8881464dcd80 by task mount/1013 CPU: 3 PID: 1013 Comm: mount Tainted: G W 6.0.0-rc4 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x5e print_report.cold+0xf3/0x68d kasan_report+0xa8/0x130 recover_data+0x63ae/0x6ae0 [f2fs] f2fs_recover_fsync_data+0x120d/0x1fc0 [f2fs] f2fs_fill_super+0x4665/0x61e0 [f2fs] mount_bdev+0x2cf/0x3b0 legacy_get_tree+0xed/0x1d0 vfs_get_tree+0x81/0x2b0 path_mount+0x47e/0x19d0 do_mount+0xce/0xf0 __x64_sys_mount+0x12c/0x1a0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause is: in fuzzed image, SSA table is corrupted: ofs_in_node is larger than ADDRS_PER_PAGE(), result in out-of-range access on 4k-size page. - recover_data - do_recover_data - check_index_in_prev_nodes - f2fs_data_blkaddr This patch adds sanity check on summary info in recovery and GC flow in where the flows rely on them. After patch: [ 29.310883] F2FS-fs (loop0): Inconsistent ofs_in_node:65286 in summary, ino:0, nid:6, max:1018 Cc: stable@vger.kernel.org Reported-by: Wenqing Liu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1e8a9191ccc286bbbfc1f9dccd31ac3bc9ec8a3f Author: Christian Brauner Date: Fri Sep 9 11:17:44 2022 +0200 f2fs: port to vfs{g,u}id_t and associated helpers A while ago we introduced a dedicated vfs{g,u}id_t type in commit 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched over a good part of the VFS. Ultimately we will remove all legacy idmapped mount helpers that operate only on k{g,u}id_t in favor of the new type safe helpers that operate on vfs{g,u}id_t. Cc: Seth Forshee (Digital Ocean) Cc: Christoph Hellwig Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0ef4ca04a3f9223ff8bc440041c524b2123e09a3 Author: Chao Yu Date: Tue Sep 13 10:08:41 2022 +0800 f2fs: fix to do sanity check on destination blkaddr during recovery As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216456 loop5: detected capacity change from 0 to 131072 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): Bitmap was wrongly set, blk:5634 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1013 at fs/f2fs/segment.c:2198 RIP: 0010:update_sit_entry+0xa55/0x10b0 [f2fs] Call Trace: f2fs_do_replace_block+0xa98/0x1890 [f2fs] f2fs_replace_block+0xeb/0x180 [f2fs] recover_data+0x1a69/0x6ae0 [f2fs] f2fs_recover_fsync_data+0x120d/0x1fc0 [f2fs] f2fs_fill_super+0x4665/0x61e0 [f2fs] mount_bdev+0x2cf/0x3b0 legacy_get_tree+0xed/0x1d0 vfs_get_tree+0x81/0x2b0 path_mount+0x47e/0x19d0 do_mount+0xce/0xf0 __x64_sys_mount+0x12c/0x1a0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd If we enable CONFIG_F2FS_CHECK_FS config, it will trigger a kernel panic instead of warning. The root cause is: in fuzzed image, SIT table is inconsistent with inode mapping table, result in triggering such warning during SIT table update. This patch introduces a new flag DATA_GENERIC_ENHANCE_UPDATE, w/ this flag, data block recovery flow can check destination blkaddr's validation in SIT table, and skip f2fs_replace_block() to avoid inconsistent status. Cc: stable@vger.kernel.org Reported-by: Wenqing Liu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f3b23c785aa5d1920f479533f1d7361c2feceea5 Author: Weichao Guo Date: Wed Sep 7 10:38:48 2022 +0800 f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT Cold files may be fragmented due to SSR, defragment is needed as sequential reads are dominant scenarios of these files. FI_OPU_WRITE should override FADVISE_COLD_BIT to avoid defragment fails. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 07725adc55c0a414c10acb5c8c86cea34b95ddef Author: Zhang Qilong Date: Mon Sep 5 12:59:17 2022 +0800 f2fs: fix race condition on setting FI_NO_EXTENT flag The following scenarios exist. process A: process B: ->f2fs_drop_extent_tree ->f2fs_update_extent_cache_range ->f2fs_update_extent_tree_range ->write_lock ->set_inode_flag ->is_inode_flag_set ->__free_extent_tree // Shouldn't // have been // cleaned up // here ->write_lock In this case, the "FI_NO_EXTENT" flag is set between f2fs_update_extent_tree_range and is_inode_flag_set by other process. it leads to clearing the whole exten tree which should not have happened. And we fix it by move the setting it to the range of write_lock. Fixes:5f281fab9b9a3 ("f2fs: disable extent_cache for fcollapse/finsert inodes") Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9df6d6f9be4754da96d3c91ec518ed974e6b81e7 Author: Zhang Qilong Date: Thu Sep 1 15:19:37 2022 +0800 f2fs: remove redundant check in f2fs_sanity_check_cluster It have checked "compressed" at the entry of f2fs_sanity_check_cluster, just remove the redundant check for better performance here. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 049ea86cb5c7212a6e7e617a67fe686f9b0b0669 Author: Zhang Qilong Date: Wed Aug 31 17:48:15 2022 +0800 f2fs: add static init_idisk_time function to reduce the code We can use a inner function to init the disk time of f2fs_inode_info for cleaning redundant code. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d382e36970ecf8242921400db2afde15fb6ed49e Author: Yonggil Song Date: Fri Sep 2 11:07:49 2022 +0900 f2fs: fix typo Fix typo in f2fs.h Detected by Jaeyoon Choi Signed-off-by: Yonggil Song Signed-off-by: Jaegeuk Kim commit 9b7eadd9bd3a0cc24533a23d83c46430a0ea60ff Author: Shuqi Zhang Date: Wed Aug 31 10:24:40 2022 +0800 f2fs: fix wrong dirty page count when race between mmap and fallocate. This is a BUG_ON issue as follows when running xfstest-generic-503: WARNING: CPU: 21 PID: 1385 at fs/f2fs/inode.c:762 f2fs_evict_inode+0x847/0xaa0 Modules linked in: CPU: 21 PID: 1385 Comm: umount Not tainted 5.19.0-rc5+ #73 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014 Call Trace: evict+0x129/0x2d0 dispose_list+0x4f/0xb0 evict_inodes+0x204/0x230 generic_shutdown_super+0x5b/0x1e0 kill_block_super+0x29/0x80 kill_f2fs_super+0xe6/0x140 deactivate_locked_super+0x44/0xc0 deactivate_super+0x79/0x90 cleanup_mnt+0x114/0x1a0 __cleanup_mnt+0x16/0x20 task_work_run+0x98/0x100 exit_to_user_mode_prepare+0x3d0/0x3e0 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Function flow analysis when BUG occurs: f2fs_fallocate mmap do_page_fault pte_spinlock // ---lock_pte do_wp_page wp_page_shared pte_unmap_unlock // unlock_pte do_page_mkwrite f2fs_vm_page_mkwrite down_read(invalidate_lock) lock_page if (PageMappedToDisk(page)) goto out; // set_page_dirty --NOT RUN out: up_read(invalidate_lock); finish_mkwrite_fault // unlock_pte f2fs_collapse_range down_write(i_mmap_sem) truncate_pagecache unmap_mapping_pages i_mmap_lock_write // down_write(i_mmap_rwsem) ...... zap_pte_range pte_offset_map_lock // ---lock_pte set_page_dirty f2fs_dirty_data_folio if (!folio_test_dirty(folio)) { fault_dirty_shared_page set_page_dirty f2fs_dirty_data_folio if (!folio_test_dirty(folio)) { filemap_dirty_folio f2fs_update_dirty_folio // ++ } unlock_page filemap_dirty_folio f2fs_update_dirty_folio // page count++ } pte_unmap_unlock // --unlock_pte i_mmap_unlock_write // up_write(i_mmap_rwsem) truncate_inode_pages up_write(i_mmap_sem) When race happens between mmap-do_page_fault-wp_page_shared and fallocate-truncate_pagecache-zap_pte_range, the zap_pte_range calls function set_page_dirty without page lock. Besides, though truncate_pagecache has immap and pte lock, wp_page_shared calls fault_dirty_shared_page without any. In this case, two threads race in f2fs_dirty_data_folio function. Page is set to dirty only ONCE, but the count is added TWICE by calling filemap_dirty_folio. Thus the count of dirty page cannot accord with the real dirty pages. Following is the solution to in case of race happens without any lock. Since folio_test_set_dirty in filemap_dirty_folio is atomic, judge return value will not be at risk of race. Signed-off-by: Shuqi Zhang Signed-off-by: Jaegeuk Kim commit 173cdf2c32b4b02474006d87648383244c0a6db9 Author: Zhang Qilong Date: Tue Aug 30 14:55:15 2022 +0800 f2fs: use COMPRESS_MAPPING to get compress cache mapping Just use the defined COMPRESS_MAPPING to get compress cache mapping instaed of direct accessing name. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 280dfeae56e6fbfff21cfece356379e318ae10fe Author: Zhang Qilong Date: Tue Aug 30 20:13:23 2022 +0800 f2fs: return the tmp_ptr directly in __bitmap_ptr Just return tmp_ptr here, it's no need to dereference checkpoint pointer again. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e623715f3d67ad10985b2c10cf7edd9ad85db372 Author: Anup Patel Date: Wed Apr 20 16:54:08 2022 +0530 RISC-V: Increase range and default value of NR_CPUS Currently, the range and default value of NR_CPUS is too restrictive for high-end RISC-V systems with large number of HARTs. The latest QEMU virt machine supports upto 512 CPUs so the current NR_CPUS is restrictive for QEMU as well. Other major architectures (such as ARM64, x86_64, MIPS, etc) have a much higher range and default value of NR_CPUS. This patch increases NR_CPUS range to 2-512 and default value to XLEN (i.e. 32 for RV32 and 64 for RV64). Signed-off-by: Anup Patel Reviewed-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20220420112408.155561-1-apatel@ventanamicro.com/ Signed-off-by: Palmer Dabbelt commit c5129ecc12a3101555d8922b1e0aa90f91247ab6 Author: Dave Hansen Date: Mon Oct 3 13:23:46 2022 -0700 x86/mm: Ease W^X enforcement back to just a warning Currently, the "change_page_attr" (CPA) code refuses to create W+X mappings on 64-bit kernels. There have been reports both from 32-bit[1] and from BPF[2] users where this change kept the system from booting. These reports are showing up even after about a month of soak time in -next. To avoid breaking anything, never enforce W^X. Always warn and return the requested permissions even if a problem is detected. 1. https://lore.kernel.org/all/CAMj1kXHcF_iK_g0OZSkSv56Wmr=eQGQwNstcNjLEfS=mm7a06w@mail.gmail.com/ 2. https://lore.kernel.org/bpf/c84cc27c1a5031a003039748c3c099732a718aec.camel@kernel.org/T/#u Signed-off-by: Dave Hansen Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Kees Cook Cc: Peter Zijlstra commit 34e1ed189fab1b7533befb266b96051104c1deb6 Author: Paul Cercueil Date: Mon Aug 8 19:40:38 2022 +0200 PM: Improve EXPORT_*_DEV_PM_OPS macros Update the _EXPORT_DEV_PM_OPS() internal macro. It was not used anywhere outside pm.h and pm_runtime.h, so it is safe to update it. Before, this macro would take a few parameters to be used as sleep and runtime callbacks. This made it unsuitable to use with different callbacks, for instance the "noirq" ones. It is now semantically different: instead of creating a conditionally exported dev_pm_ops structure, it only contains part of the definition. This macro should however never be used directly (hence the trailing underscore). Instead, the following four macros are provided: - EXPORT_DEV_PM_OPS(name) - EXPORT_GPL_DEV_PM_OPS(name) - EXPORT_NS_DEV_PM_OPS(name, ns) - EXPORT_NS_GPL_DEV_PM_OPS(name, ns) For instance, it is now possible to conditionally export noirq suspend/resume PM functions like this: EXPORT_GPL_DEV_PM_OPS(foo_pm_ops) = { NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) }; The existing helper macros EXPORT_*_SIMPLE_DEV_PM_OPS() and EXPORT_*_RUNTIME_DEV_PM_OPS() have been updated to use these new macros. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron Signed-off-by: Rafael J. Wysocki commit 522667b24f08009591c90e75bfe2ffb67f555498 Merge: c645c11a2dba1 2fff00c81d4c3 Author: Linus Torvalds Date: Tue Oct 4 11:13:38 2022 -0700 Merge tag 'landlock-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull landlock updates from Mickaël Salaün: "Improve user help for Landlock (documentation and sample)" * tag 'landlock-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: landlock: Fix documentation style landlock: Slightly improve documentation and fix spelling samples/landlock: Print hints about ABI versions commit c82e81ab2569559ad873b3061217c2f37560682b Author: Jason Gunthorpe Date: Thu Sep 29 11:59:25 2022 -0300 vfio: Change vfio_group->group_rwsem to a mutex These days not much is using the read side: - device first open - ioctl_get_status - device FD release - check enforced_coherent None of this is performance, so just make it into a normal mutex. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/2-v1-917e3647f123+b1a-vfio_group_users_jgg@nvidia.com Signed-off-by: Alex Williamson commit 912b74d26c7df2da1e261f3dac8942c8cbb76a49 Author: Jason Gunthorpe Date: Thu Sep 29 11:59:24 2022 -0300 vfio: Remove the vfio_group->users and users_comp Kevin points out that the users is really just tracking if group->opened_file is set, so we can simplify this code to a wait_queue that looks for !opened_file under the group_rwsem. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/1-v1-917e3647f123+b1a-vfio_group_users_jgg@nvidia.com Signed-off-by: Alex Williamson commit 9c799c224d6ebc5be51065bd3217a2d7eea23b8f Author: Jason Gunthorpe Date: Fri Sep 23 11:26:52 2022 +0200 vfio/mdev: add mdev available instance checking to the core Many of the mdev drivers use a simple counter for keeping track of the available instances. Move this code to the core code and store the counter in the mdev_parent. Implement it using correct locking, fixing mdpy. Drivers just provide the value in the mdev_driver at registration time and the core code takes care of maintaining it and exposing the value in sysfs. [hch: count instances per-parent instead of per-type, use an atomic_t to avoid taking mdev_list_lock in the show method] Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-15-hch@lst.de Signed-off-by: Alex Williamson commit 685a1537f4c603cfcaf4b9be56ff6a571f7ddd08 Author: Christoph Hellwig Date: Fri Sep 23 11:26:51 2022 +0200 vfio/mdev: consolidate all the description sysfs into the core code Every driver just emits a string, simply add a method to the mdev_driver to return it and provide a standard sysfs show function. Remove the now unused types_attrs field in struct mdev_driver and the support code for it. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Link: https://lore.kernel.org/r/20220923092652.100656-14-hch@lst.de Signed-off-by: Alex Williamson commit f2fbc72e6da4f8e01fe5fe3d6871a791e76271c3 Author: Christoph Hellwig Date: Fri Sep 23 11:26:50 2022 +0200 vfio/mdev: consolidate all the available_instance sysfs into the core code Every driver just print a number, simply add a method to the mdev_driver to return it and provide a standard sysfs show function. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-13-hch@lst.de Signed-off-by: Alex Williamson commit 0bc79069ccbdbe26492493dd0c4e38b7cadf8ad5 Author: Christoph Hellwig Date: Fri Sep 23 11:26:49 2022 +0200 vfio/mdev: consolidate all the name sysfs into the core code Every driver just emits a static string, simply add a field to the mdev_type for the driver to fill out or fall back to the sysfs name and provide a standard sysfs show function. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-12-hch@lst.de Signed-off-by: Alex Williamson commit 290aac5df88a83e264b3a73ec146e5e5b3c45793 Author: Jason Gunthorpe Date: Fri Sep 23 11:26:48 2022 +0200 vfio/mdev: consolidate all the device_api sysfs into the core code Every driver just emits a static string, simply feed it through the ops and provide a standard sysfs show function. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-11-hch@lst.de Signed-off-by: Alex Williamson commit c7c1f38f6cba7e3249866c06639ea62755f0a24e Author: Christoph Hellwig Date: Fri Sep 23 11:26:47 2022 +0200 vfio/mdev: remove mtype_get_parent_dev Just open code the dereferences in the only user. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Jason J. Herne Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-10-hch@lst.de Signed-off-by: Alex Williamson commit 062e720cd209d8091c4f3d118d93973f02209aca Author: Christoph Hellwig Date: Fri Sep 23 11:26:46 2022 +0200 vfio/mdev: remove mdev_parent_dev Just open code the dereferences in the only user. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Link: https://lore.kernel.org/r/20220923092652.100656-9-hch@lst.de Signed-off-by: Alex Williamson commit 2815fe149ffa8e1a022b2830ab62999135c00a4e Author: Christoph Hellwig Date: Fri Sep 23 11:26:45 2022 +0200 vfio/mdev: unexport mdev_bus_type mdev_bus_type is only used in mdev.ko now, so unexport it. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Link: https://lore.kernel.org/r/20220923092652.100656-8-hch@lst.de Signed-off-by: Alex Williamson commit cbf3bb28aaeaee425ca7b9c537a3efff1f8c98ae Author: Christoph Hellwig Date: Fri Sep 23 11:26:44 2022 +0200 vfio/mdev: remove mdev_from_dev Just open code it in the only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Link: https://lore.kernel.org/r/20220923092652.100656-7-hch@lst.de Signed-off-by: Alex Williamson commit da44c340c4fe9d9653ae84fa6a60f406bafcffce Author: Christoph Hellwig Date: Fri Sep 23 11:26:43 2022 +0200 vfio/mdev: simplify mdev_type handling Instead of abusing struct attribute_group to control initialization of struct mdev_type, just define the actual attributes in the mdev_driver, allocate the mdev_type structures in the caller and pass them to mdev_register_parent. This allows the caller to use container_of to get at the containing structure and thus significantly simplify the code. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-6-hch@lst.de Signed-off-by: Alex Williamson commit 89345d5177aa0f6d678251e1e0870b0eeb1ab510 Author: Christoph Hellwig Date: Fri Sep 23 11:26:42 2022 +0200 vfio/mdev: embedd struct mdev_parent in the parent data structure Simplify mdev_{un}register_device by requiring the caller to pass in a structure allocate as part of the parent device structure. This removes the need for a list of parents and the separate mdev_parent refcount as we can simplify rely on the reference to the parent device. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220923092652.100656-5-hch@lst.de Signed-off-by: Alex Williamson commit bdef2b7896df293736330eb6eb0f43947049b828 Author: Christoph Hellwig Date: Fri Sep 23 11:26:41 2022 +0200 vfio/mdev: make mdev.h standalone includable Include and so that users of this headers don't need to do that and remove those includes that aren't needed any more. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Farman Reviewed-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Kirti Wankhede Link: https://lore.kernel.org/r/20220923092652.100656-4-hch@lst.de Signed-off-by: Alex Williamson commit 1aa3834f510c9d9206ce4d40aff4903b0c016761 Author: Christoph Hellwig Date: Fri Sep 23 11:26:40 2022 +0200 drm/i915/gvt: simplify vgpu configuration management Instead of copying the information from the vgpu_types arrays into each intel_vgpu_type structure, just reference this constant information with a pointer to the already existing data structure, and pass it into the low-level VGPU creation helpers intead of copying the data into yet anothe params data structure. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Zhenyu Wang Link: https://lore.kernel.org/r/20220923092652.100656-3-hch@lst.de [aw: Fold fix from 20220928121110.GA30738@lst.de] Signed-off-by: Alex Williamson commit 98828955971363e838149105c268b1fad905f15b Author: Christoph Hellwig Date: Fri Sep 23 11:26:39 2022 +0200 drm/i915/gvt: fix a memory leak in intel_gvt_init_vgpu_types gvt->types needs to be freed on error. Fixes: bc90d097ae14 ("drm/i915/gvt: define weight according to vGPU type") Reported-by: Kevin Tian Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Zhenyu Wang Link: https://lore.kernel.org/r/20220923092652.100656-2-hch@lst.de [aw: Correct fixes commit ID as reported by Stephen Rothwell] Signed-off-by: Alex Williamson commit c645c11a2dba116bad3ee43e08e330db8f03ede6 Merge: 3eba620e7bd77 934f70d9d498a Author: Linus Torvalds Date: Tue Oct 4 11:05:43 2022 -0700 Merge tag 'audit-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit updates from Paul Moore: "Six audit patches for v6.1, most are pretty trivial, but a quick list of the highlights are below: - Only free the audit proctitle information on task exit. This allows us to cache the information and improve performance slightly. - Use the time_after() macro to do time comparisons instead of doing it directly and potentially causing ourselves problems when the timer wraps. - Convert an audit_context state comparison from a relative enum comparison, e.g. (x < y), to a not-equal comparison to ensure that we are not caught out at some unknown point in the future by an enum shuffle. - A handful of small cleanups such as tidying up comments and removing unused declarations" * tag 'audit-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: remove selinux_audit_rule_update() declaration audit: use time_after to compare time audit: free audit_proctitle only on task exit audit: explicitly check audit_context->context enum value audit: audit_context pid unused, context enum comment fix audit: fix repeated words in comments commit f9efefdba95a5110a1346bb03acdd8ff3cdf557f Merge: b7f257ceb3c88 c4e05443b6d40 1777cb60f7df8 d8473831066b1 48c5e98fedd9e Author: Stephen Boyd Date: Tue Oct 4 10:54:34 2022 -0700 Merge branches 'clk-baikal', 'clk-broadcom', 'clk-vc5' and 'clk-versaclock' into clk-next - Convert Baikal-T1 CCU driver to platform driver - Split reset support out of primary Baikal-T1 CCU driver - Add some missing clks required for RPiVid Video Decoder on RaspberryPi - Mark PLLC critical on bcm2835 - Support for Renesas VersaClock7 clock generator family * clk-baikal: clk: baikal-t1: Convert to platform device driver clk: baikal-t1: Add DDR/PCIe directly controlled resets support dt-bindings: clk: baikal-t1: Add DDR/PCIe reset IDs clk: baikal-t1: Move reset-controls code into a dedicated module clk: baikal-t1: Add SATA internal ref clock buffer clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent clk: baikal-t1: Fix invalid xGMAC PTP clock divider clk: vc5: Fix 5P49V6901 outputs disabling when enabling FOD * clk-broadcom: clk: bcm: rpi: Add support for VEC clock clk: bcm: rpi: Handle pixel clock in firmware clk: bcm: rpi: Add support HEVC clock clk: bcm2835: fix bcm2835_clock_rate_from_divisor declaration clk: bcm2835: Round UART input clock up clk: bcm2835: Make peripheral PLLC critical * clk-vc5: clk: vc5: Add support for IDT/Renesas VersaClock 5P49V6975 dt-bindings: clock: vc5: Add 5P49V6975 clk: vc5: Use regmap_{set,clear}_bits() where appropriate clk: vc5: Check IO access results * clk-versaclock: clk: Renesas versaclock7 ccf device driver dt-bindings: Renesas versaclock7 device tree bindings commit b7f257ceb3c88ee3e2c6b0d1db703c818d3971f1 Merge: 26bebbfed5bd0 1d7d20658534c af3bd36573e36 117a1542c0bc9 3475c88548081 Author: Stephen Boyd Date: Tue Oct 4 10:54:14 2022 -0700 Merge branches 'clk-fixed-rate', 'clk-spreadtrum', 'clk-pxa' and 'clk-ti' into clk-next - More devm helpers for fixed rate registration - Add Spreadtrum UMS512 SoC clk support - Various PXA168 clk driver fixes * clk-fixed-rate: clk: fixed-rate: add devm_clk_hw_register_fixed_rate clk: asm9260: use parent index to link the reference clock * clk-spreadtrum: clk: sprd: Add clocks support for UMS512 * clk-pxa: clk: pxa: add a check for the return value of kzalloc() clk: mmp: pxa168: control shared SDH bits with separate clock dt-bindings: marvell,pxa168: add clock ids for SDH AXI clocks clk: mmp: pxa168: add clocks for SDH2 and SDH3 dt-bindings: marvell,pxa168: add clock id for SDH3 clk: mmp: pxa168: fix GPIO clock enable bits clk: mmp: pxa168: add muxes for more peripherals clk: mmp: pxa168: fix incorrect parent clocks clk: mmp: pxa168: fix const-correctness clk: mmp: pxa168: add new clocks for peripherals dt-bindings: marvell,pxa168: add clock ids for additional dividers clk: mmp: pxa168: fix incorrect dividers clk: mmp: pxa168: add additional register defines * clk-ti: clk: davinci: cfgchip: Use dev_err_probe() helper clk: davinci: pll: fix spelling typo in comment MAINTAINERS: add header file to TI DAVINCI SERIES CLOCK DRIVER commit 26bebbfed5bd06fd7202fd1befa6c2c935a593e8 Merge: a64b79c01c283 9e1343ede72af acb84a167f14a 50cf94b419d57 d772c9370fe8c 855ae87a2073e Author: Stephen Boyd Date: Tue Oct 4 10:54:02 2022 -0700 Merge branches 'clk-rockchip', 'clk-renesas', 'clk-microchip', 'clk-allwinner' and 'clk-imx' into clk-next * clk-rockchip: dt-bindings: clock: rockchip: change SPDX-License-Identifier dt-bindings: clock: convert rockchip,rk3128-cru.txt to YAML clk: rockchip: Add clock controller support for RV1126 SoC dt-bindings: clock: rockchip: Document RV1126 CRU clk: rockchip: Add dt-binding header for RV1126 clk: rockchip: Add MUXTBL variant * clk-renesas: clk: renesas: r8a779g0: Add EtherAVB clocks clk: renesas: r8a779g0: Add PFC/GPIO clocks clk: renesas: r8a779g0: Add I2C clocks clk: renesas: r8a779g0: Add watchdog clock dt-bindings: clock: renesas,rzg2l: Document RZ/Five SoC clk: renesas: r8a779f0: Add MSIOF clocks clk: renesas: r9a09g011: Add IIC clock and reset entries clk: renesas: r9a07g044: Add conditional compilation for r9a07g044_cpg_info clk: renesas: r8a779f0: Add TMU and parent SASYNC clocks clk: renesas: r8a779f0: Add CMT clocks clk: renesas: r8a779f0: Add SDH0 clock * clk-microchip: clk: at91: sama5d2: Add Generic Clocks for UART/USART clk: microchip: add PolarFire SoC fabric clock support dt-bindings: clk: add PolarFire SoC fabric clock ids dt-bindings: clk: document PolarFire SoC fabric clocks dt-bindings: clk: rename mpfs-clkcfg binding clk: microchip: mpfs: update module authorship & licencing clk: microchip: mpfs: convert periph_clk to clk_gate clk: microchip: mpfs: convert cfg_clk to clk_divider clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo() clk: microchip: mpfs: simplify control reg access clk: microchip: mpfs: move id & offset out of clock structs clk: microchip: mpfs: add MSS pll's set & round rate MAINTAINERS: add polarfire soc reset controller reset: add polarfire soc reset support clk: microchip: mpfs: add reset controller dt-bindings: clk: microchip: mpfs: add reset controller support clk: microchip: mpfs: make the rtc's ahb clock critical clk: microchip: mpfs: fix clk_cfg array bounds violation * clk-allwinner: clk: sunxi-ng: ccu-sun9i-a80-usb: Use dev_err_probe() helper clk: sunxi-ng: ccu-sun9i-a80-de: Use dev_err_probe() helper clk: sunxi-ng: sun8i-de2: Use dev_err_probe() helper clk: sunxi-ng: d1: Limit PLL rates to stable ranges * clk-imx: clk: imx: scu: fix memleak on platform_device_add() fails clk: imx93: add SAI IPG clk clk: imx93: add MU1/2 clock clk: imx93: switch to use new clk gate API clk: imx: add i.MX93 clk gate clk: imx: clk-composite-93: check white_list clk: imx: clk-composite-93: check slice busy dt-bindings: clock: imx93-clock: add more MU/SAI clocks dt-bindings: clock: imx8mm: don't use multiple blank lines clk: imx8mp: tune the order of enet_qos_root_clk commit a64b79c01c2836ddd8e1eb7c8173b44c3e66f999 Merge: 49f4c2d101bbf 37eceb69205b2 d46adccb79668 12198d9179aaa b8c1dc9c00b25 39bc9b589ea3d Author: Stephen Boyd Date: Tue Oct 4 10:53:41 2022 -0700 Merge branches 'clk-samsung', 'clk-mtk', 'clk-rm', 'clk-ast' and 'clk-qcom' into clk-next - Add resets for MediaTek MT8195 PCIe and USB - Remove DaVinci DM644x and DM646x clk driver support * clk-samsung: clk: samsung: MAINTAINERS: add Krzysztof Kozlowski clk: samsung: exynos850: Implement CMU_MFCMSCL domain clk: samsung: exynos850: Implement CMU_IS domain clk: samsung: exynos850: Implement CMU_AUD domain clk: samsung: exynos850: Style fixes clk: samsung: exynosautov9: add fsys1 clock support clk: samsung: exynosautov9: add fsys0 clock support clk: samsung: exynosautov9: correct register offsets of peric0/c1 clk: samsung: exynosautov9: add missing gate clks for peric0/c1 dt-bindings: clock: exynos850: Add Exynos850 CMU_MFCMSCL dt-bindings: clock: exynos850: Add Exynos850 CMU_IS dt-bindings: clock: exynos850: Add Exynos850 CMU_AUD dt-bindings: clock: exynosautov9: add schema for cmu_fsys0/1 dt-bindings: clock: exynosautov9: add fsys1 clock definitions dt-bindings: clock: exynosautov9: add fys0 clock definitions clk: samsung: exynos7885: Add TREX clocks clk: samsung: exynos7885: Implement CMU_FSYS domain dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1 clk: samsung: exynos-clkout: Use of_device_get_match_data() * clk-mtk: (42 commits) clk: mediatek: add driver for MT8365 SoC clk: mediatek: Export required common code symbols clk: mediatek: Provide mtk_devm_alloc_clk_data dt-bindings: clock: mediatek: add bindings for MT8365 SoC clk: mediatek: mt8192: deduplicate parent clock lists clk: mediatek: Migrate remaining clk_unregister_*() to clk_hw_unregister_*() clk: mediatek: fix unregister function in mtk_clk_register_dividers cleanup clk: mediatek: clk-mt8192: Add clock mux notifier for mfg_pll_sel clk: mediatek: clk-mt8192-mfg: Propagate rate changes to parent clk: mediatek: clk-mt8195-topckgen: Drop univplls from mfg mux parents clk: mediatek: clk-mt8195-topckgen: Add GPU clock mux notifier clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes clk: mediatek: mt8183: Add clk mux notifier for MFG mux clk: mediatek: mux: add clk notifier functions clk: mediatek: mt8183: mfgcfg: Propagate rate changes to parent clk: mediatek: Use mtk_clk_register_gates_with_dev in simple probe clk: mediatek: gate: Export mtk_clk_register_gates_with_dev clk: mediatek: add VDOSYS1 clock dt-bindings: clk: mediatek: Add MT8195 DPI clocks ... * clk-rm: clk: davinci: remove PLL and PSC clocks for DaVinci DM644x and DM646x * clk-ast: clk: ast2600: BCLK comes from EPLL * clk-qcom: (97 commits) clk: qcom: gcc-sm6375: Ensure unsigned long type clk: qcom: gcc-sm6375: Remove unused variables clk: qcom: kpss-xcc: convert to parent data API clk: introduce (devm_)hw_register_mux_parent_data_table API clk: qcom: gcc-msm8939: use ARRAY_SIZE instead of specifying num_parents clk: qcom: gcc-msm8939: use parent_hws where possible dt-bindings: clock: move qcom,gcc-msm8939 to qcom,gcc-msm8916.yaml clk: qcom: gcc-sm6350: Update the .pwrsts for usb gdscs clk: qcom: gcc-sc8280xp: use retention for USB power domains clk: qcom: gdsc: add missing error handling dt-bindings: clocks: qcom,gcc-sc8280xp: Fix typos clk: qcom: Add global clock controller driver for SM6375 dt-bindings: clock: add SM6375 QCOM global clock bindings clk: qcom: alpha: Add support for programming the PLL_FSM_LEGACY_MODE bit clk: qcom: gcc-sc7280: Update the .pwrsts for usb gdscs clk: qcom: gcc-sc7180: Update the .pwrsts for usb gdsc clk: qcom: gdsc: Fix the handling of PWRSTS_RET support clk: qcom: Add SC8280XP GPU clock controller dt-bindings: clock: Add Qualcomm SC8280XP GPU binding clk: qcom: smd: Add SM6375 clocks ... commit 49f4c2d101bbf93c62e3fa58e666f71352c54121 Merge: 1c23f9e627a7b 058a3996b888a 4bafca831386b 8a977bbb17e26 30eaf02149ecc c00b5f2040415 Author: Stephen Boyd Date: Tue Oct 4 10:53:04 2022 -0700 Merge branches 'clk-ofnode', 'clk-bindings', 'clk-cleanup', 'clk-zynq' and 'clk-xilinx' into clk-next - Miscellaneous of_node_put() fixes - Nuke dt-bindings/clk path (again) by moving headers to dt-bindings/clock - Convert gpio-clk-gate binding to YAML - Various fixes to AMD/Xilinx Zynqmp clk driver - Graduate AMD/Xilinx "clocking wizard" driver from staging * clk-ofnode: clk: ti: Balance of_node_get() calls for of_find_node_by_name() clk: tegra20: Fix refcount leak in tegra20_clock_init clk: tegra: Fix refcount leak in tegra114_clock_init clk: tegra: Fix refcount leak in tegra210_clock_init clk: sprd: Hold reference returned by of_get_parent() clk: berlin: Add of_node_put() for of_get_parent() clk: at91: dt-compat: Hold reference returned by of_get_parent() clk: qoriq: Hold reference returned by of_get_parent() clk: oxnas: Hold reference returned by of_get_parent() clk: st: Hold reference returned by of_get_parent() clk: tegra: Add missing of_node_put() clk: meson: Hold reference returned by of_get_parent() clk: nomadik: Add missing of_node_put() * clk-bindings: dt-bindings: clock: drop minItems equal to maxItems dt-bindings: clock: gpio-gate-clock: Convert to json-schema dt-bindings: clock: Move versaclock.h to dt-bindings/clock dt-bindings: clock: Move lochnagar.h to dt-bindings/clock * clk-cleanup: clk: allow building lan966x as a module clk: clk-xgene: simplify if-if to if-else clk: nxp: fix typo in comment clk: mvebu: armada-37xx-tbg: Remove the unneeded result variable clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe clkdev: Simplify devm_clk_hw_register_clkdev() function clkdev: Remove never used devm_clk_release_clkdev() clk: Remove never used devm_of_clk_del_provider() clk: pistachio: Fix initconst confusion clk: clk-npcm7xx: Remove unused struct npcm7xx_clk_gate_data and npcm7xx_clk_div_fixed_data clk: do not initialize ret clk: remove extra empty line clk: Fix comment typo clk: move from strlcpy with unused retval to strscpy * clk-zynq: clk: zynqmp: pll: rectify rate rounding in zynqmp_pll_round_rate clk: zynqmp: Check the return type zynqmp_pm_query_data clk: zynqmp: Add a check for NULL pointer clk: zynqmp: Replaced strncpy() with strscpy() clk: zynqmp: Fix stack-out-of-bounds in strncpy` clk: zynqmp: make bestdiv unsigned * clk-xilinx: clk: clocking-wizard: Depend on HAS_IOMEM clk: clocking-wizard: Use dev_err_probe() helper clk: clocking-wizard: Update the compatible clk: clocking-wizard: Fix the reconfig for 5.2 clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs clk: clocking-wizard: Move clocking-wizard out dt-bindings: add documentation of xilinx clocking wizard commit 39bc9b589ea3d2750a6fec6409cd7fc687bc99fe Author: Stephen Boyd Date: Tue Oct 4 10:17:23 2022 -0700 clk: qcom: gcc-sm6375: Ensure unsigned long type This PLL frequency needs a UL postfix to avoid compiler warnings on 32-bit architectures. Fixes: 184fdd873d83 ("clk: qcom: Add global clock controller driver for SM6375") Cc: Konrad Dybcio Signed-off-by: Stephen Boyd commit 3eba620e7bd772a0c7dc91966cb107872b54a910 Merge: 193e2268a3bb1 30ea703a38ef7 Author: Linus Torvalds Date: Tue Oct 4 10:24:11 2022 -0700 Merge tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Borislav Petkov: - The usual round of smaller fixes and cleanups all over the tree * tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype x86/uaccess: Improve __try_cmpxchg64_user_asm() for x86_32 x86: Fix various duplicate-word comment typos x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h commit a76d550f761d4f1b0a0e2faa27af122e51904b86 Author: Konrad Dybcio Date: Mon Oct 3 23:14:38 2022 +0200 clk: qcom: gcc-sm6375: Remove unused variables gcc_parent_data_15 and gcc_parent_map_15 are not used in this driver. Remove them. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20221003211438.25691-1-konrad.dybcio@somainline.org Fixes: 184fdd873d83 ("clk: qcom: Add global clock controller driver for SM6375") Signed-off-by: Stephen Boyd commit 71cf0c1c4f9f8e42c84ca53a5ca7091e4eea7f6a Author: Tiezhu Yang Date: Mon Sep 5 14:35:35 2022 +0800 ceph: remove Sage's git tree from documentation Sage's git tree has not been pushed to in years, and it was removed in commit 3a5ccecd9af7 ("MAINTAINERS: remove myself as ceph co-maintainer"), so it is better to remove it in the documentation too. Signed-off-by: Tiezhu Yang Signed-off-by: Ilya Dryomov commit aa87052dd965a6094355fcc13d5abc3f5bebfbe4 Author: Xiubo Li Date: Wed Aug 31 12:13:28 2022 +0800 ceph: fix incorrectly showing the .snap size for stat We should set the 'stat->size' to the real number of snapshots for snapdirs. Link: https://tracker.ceph.com/issues/57342 Signed-off-by: Xiubo Li Signed-off-by: Ilya Dryomov commit bd04b9192e1ff6859d6b3906e91cfd5c9b0ad55b Author: Xiubo Li Date: Tue Aug 30 22:49:36 2022 +0800 ceph: fail the open_by_handle_at() if the dentry is being unlinked When unlinking a file the kclient will send a unlink request to MDS by holding the dentry reference, and then the MDS will return 2 replies, which are unsafe reply and a deferred safe reply. After the unsafe reply received the kernel will return and succeed the unlink request to user space apps. Only when the safe reply received the dentry's reference will be released. Or the dentry will only be unhashed from dcache. But when the open_by_handle_at() begins to open the unlinked files it will succeed. The inode->i_count couldn't be used to check whether the inode is opened or not. Link: https://tracker.ceph.com/issues/56524 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Reviewed-by: Luís Henriques Tested-by: Luís Henriques Signed-off-by: Ilya Dryomov commit b4b924c7a16e857b0715603456045251a49f2ea6 Author: Jeff Layton Date: Wed Aug 24 09:24:42 2022 -0400 ceph: increment i_version when doing a setattr with caps When the client has enough caps to satisfy a setattr locally without having to talk to the server, we currently do the setattr without incrementing the change attribute. Ensure that if the ctime changes locally, then the change attribute does too. Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit aa1d627207cace003163dee24d1c06fa4e910c6b Author: Kenneth Lee Date: Thu Aug 18 22:42:55 2022 -0700 ceph: Use kcalloc for allocating multiple elements Prefer using kcalloc(a, b) over kzalloc(a * b) as this improves semantics since kcalloc is intended for allocating an array of memory. Signed-off-by: Kenneth Lee Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 7c3ea9870e09e193981695dd67c37a1a2b6d600b Author: Xiubo Li Date: Thu Aug 11 13:00:53 2022 +0800 ceph: no need to wait for transition RDCACHE|RD -> RD For write when trying to get the Fwb caps we need to keep waiting on transition from WRBUFFER|WR -> WR to avoid a new WR sync write from going before a prior buffered writeback happens. While for read there is no need to wait on transition from RDCACHE|RD -> RD, and we can just exclude the revoking caps and force to sync read. Signed-off-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 6eb06c46214d33c71ae86d60b3fc9cb17c20beca Author: Xiubo Li Date: Wed Jul 27 12:29:10 2022 +0800 ceph: fail the request if the peer MDS doesn't support getvxattr op Just fail the request instead sending the request out, or the peer MDS will crash. Link: https://tracker.ceph.com/issues/56529 Signed-off-by: Xiubo Li Signed-off-by: Ilya Dryomov commit f791357330b0043ec953ce122ab7519af4b9d24a Author: Xiubo Li Date: Fri Aug 5 12:33:03 2022 +0800 ceph: wake up the waiters if any new caps comes When new caps comes we need to wake up the waiters and also when revoking the caps, there also could be new caps comes. Link: https://tracker.ceph.com/issues/54044 Signed-off-by: Xiubo Li Signed-off-by: Ilya Dryomov commit da4ab869e37cf81f93333ba74b16e0ea6d322e15 Author: Jeff Layton Date: Wed May 25 06:11:00 2022 -0400 libceph: drop last_piece flag from ceph_msg_data_cursor ceph_msg_data_next is always passed a NULL pointer for this field. Some of the "next" operations look at it in order to determine the length, but we can just take the min of the data on the page or cursor->resid. Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 193e2268a3bb1404b42f8edcc037a3eafd165aa9 Merge: b5f0b11353a6a f7b1843eca6fe Author: Linus Torvalds Date: Tue Oct 4 10:14:58 2022 -0700 Merge tag 'x86_cache_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cache resource control updates from Borislav Petkov: - More work by James Morse to disentangle the resctrl filesystem generic code from the architectural one with the endgoal of plugging ARM's MPAM implementation into it too so that the user interface remains the same - Properly restore the MSR_MISC_FEATURE_CONTROL value instead of blindly overwriting it to 0 * tag 'x86_cache_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits) x86/resctrl: Make resctrl_arch_rmid_read() return values in bytes x86/resctrl: Add resctrl_rmid_realloc_limit to abstract x86's boot_cpu_data x86/resctrl: Rename and change the units of resctrl_cqm_threshold x86/resctrl: Move get_corrected_mbm_count() into resctrl_arch_rmid_read() x86/resctrl: Move mbm_overflow_count() into resctrl_arch_rmid_read() x86/resctrl: Pass the required parameters into resctrl_arch_rmid_read() x86/resctrl: Abstract __rmid_read() x86/resctrl: Allow per-rmid arch private storage to be reset x86/resctrl: Add per-rmid arch private storage for overflow and chunks x86/resctrl: Calculate bandwidth from the previous __mon_event_count() chunks x86/resctrl: Allow update_mba_bw() to update controls directly x86/resctrl: Remove architecture copy of mbps_val x86/resctrl: Switch over to the resctrl mbps_val list x86/resctrl: Create mba_sc configuration in the rdt_domain x86/resctrl: Abstract and use supports_mba_mbps() x86/resctrl: Remove set_mba_sc()s control array re-initialisation x86/resctrl: Add domain offline callback for resctrl work x86/resctrl: Group struct rdt_hw_domain cleanup x86/resctrl: Add domain online callback for resctrl work x86/resctrl: Merge mon_capable and mon_enabled ... commit b5f0b11353a6a33a1accd0b742c80ed6b2f35ac0 Merge: 9bf445b65dd7d 712f210a457d9 Author: Linus Torvalds Date: Tue Oct 4 10:12:08 2022 -0700 Merge tag 'x86_microcode_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x75 microcode loader updates from Borislav Petkov: - Get rid of a single ksize() usage - By popular demand, print the previous microcode revision an update was done over - Remove more code related to the now gone MICROCODE_OLD_INTERFACE - Document the problems stemming from microcode late loading * tag 'x86_microcode_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode/AMD: Track patch allocation size explicitly x86/microcode: Print previous version of microcode after reload x86/microcode: Remove ->request_microcode_user() x86/microcode: Document the whole late loading problem commit 9bf445b65dd7d4c7d0e4efaecf38525abbbe74e3 Merge: 901735e51e4de f92ff8f5dca2a Author: Linus Torvalds Date: Tue Oct 4 10:03:40 2022 -0700 Merge tag 'x86_paravirt_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 paravirt fix from Borislav Petkov: - Ensure paravirt patching site descriptors are aligned properly so that code can do proper arithmetic with their addresses * tag 'x86_paravirt_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/paravirt: Ensure proper alignment commit 901735e51e4dea1eee816b0b57d1d6abbd94b3d5 Merge: bb1f11546eb3c 5258b80e60da6 Author: Linus Torvalds Date: Tue Oct 4 10:00:27 2022 -0700 Merge tag 'x86_misc_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 fixes from Borislav Petkov: - Drop misleading "RIP" from the opcodes dumping message - Correct APM entry's Konfig help text * tag 'x86_misc_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/dumpstack: Don't mention RIP in "Code: " x86/Kconfig: Specify idle=poll instead of no-hlt commit bb1f11546eb3cd1e2b8ea45653eb0f530e42b035 Merge: 8cded8fb1299e fdb6649ab7c14 Author: Linus Torvalds Date: Tue Oct 4 09:49:50 2022 -0700 Merge tag 'x86_asm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 asm update from Borislav Petkov: - Use the __builtin_ffs/ctzl() compiler builtins for the constant argument case in the kernel's optimized ffs()/ffz() helpers in order to make use of the compiler's constant folding optmization passes. * tag 'x86_asm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/asm/bitops: Use __builtin_ctzl() to evaluate constant expressions x86/asm/bitops: Use __builtin_ffs() to evaluate constant expressions commit 8cded8fb1299eb20fc2f7a89dc9328cdf1baf9e5 Merge: 5bb3a16dbea8a 8c03af3e090e9 Author: Linus Torvalds Date: Tue Oct 4 09:46:22 2022 -0700 Merge tag 'x86_core_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 core fixes from Borislav Petkov: - Make sure an INT3 is slapped after every unconditional retpoline JMP as both vendors suggest - Clean up pciserial a bit * tag 'x86_core_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86,retpoline: Be sure to emit INT3 after JMP *%\reg x86/earlyprintk: Clean up pciserial commit 1d800f32b2574c1d055984ad17223198caddbb54 Author: Jonathan Derrick Date: Mon Oct 3 14:25:11 2022 -0600 MAINTAINERS: Update SED-Opal Maintainers Add my new email address and remove Revanth Signed-off-by: Jonathan Derrick Link: https://lore.kernel.org/r/20221003202511.5124-1-jonathan.derrick@linux.dev Signed-off-by: Jens Axboe commit 5bb3a16dbea8ac40a36056e8ca79d37d47198a67 Merge: 51eaa866a50f3 b8d1d163604bd Author: Linus Torvalds Date: Tue Oct 4 09:37:02 2022 -0700 Merge tag 'x86_apic_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 APIC update from Borislav Petkov: - Add support for locking the APIC in X2APIC mode to prevent SGX enclave leaks * tag 'x86_apic_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Don't disable x2APIC if locked commit 51eaa866a50f3e5f006b0c4876ddfa0e5c72c5f0 Merge: 7db99f01d1879 f9781bb18ed82 Author: Linus Torvalds Date: Tue Oct 4 09:33:12 2022 -0700 Merge tag 'ras_core_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Borislav Petkov: - Fix the APEI MCE callback handler to consult the hardware about the granularity of the memory error instead of hard-coding it - Offline memory pages on Intel machines after 2 errors reported per page * tag 'ras_core_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Retrieve poison range from hardware RAS/CEC: Reduce offline page threshold for Intel systems commit 7db99f01d1879f30af95f14dfd5cbcf009d15166 Merge: ba94a7a90008f c926087eb3852 Author: Linus Torvalds Date: Tue Oct 4 09:21:30 2022 -0700 Merge tag 'x86_cpu_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu updates from Borislav Petkov: - Print the CPU number at segfault time. The number printed is not always accurate (preemption is enabled at that time) but the print string contains "likely" and after a lot of back'n'forth on this, this was the consensus that was reached. See thread at [1]. - After a *lot* of testing and polishing, finally the clear_user() improvements to inline REP; STOSB by default Link: https://lore.kernel.org/r/5d62c1d0-7425-d5bb-ecb5-1dc3b4d7d245@intel.com [1] * tag 'x86_cpu_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Print likely CPU at segfault time x86/clear_user: Make it faster commit ba94a7a90008fd55c7ff1c5b4ca1853e6277dc37 Merge: f8475a6749ae9 ee56a283988d7 Author: Linus Torvalds Date: Tue Oct 4 09:17:44 2022 -0700 Merge tag 'x86_sgx_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX update from Borislav Petkov: - Improve the documentation of a couple of SGX functions handling backing storage * tag 'x86_sgx_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Improve comments for sgx_encl_lookup/alloc_backing() commit f8475a6749ae9727878c189bbff073a257e43cba Merge: 3339914a5832c e1a6bc7c69695 Author: Linus Torvalds Date: Tue Oct 4 09:13:21 2022 -0700 Merge tag 'x86_timers_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RTC cleanups from Borislav Petkov: - Cleanup x86/rtc.c and delete duplicated functionality in favor of using the respective functionality from the RTC library * tag 'x86_timers_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/rtc: Rename mach_set_rtc_mmss() to mach_set_cmos_time() x86/rtc: Rewrite & simplify mach_get_cmos_time() by deleting duplicated functionality commit 3339914a5832cffdecd578931b3db20d3deba5f6 Merge: bf7676251b49c 81a71f51b89e8 Author: Linus Torvalds Date: Tue Oct 4 09:06:35 2022 -0700 Merge tag 'x86_platform_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform update from Borislav Petkov: "A single x86/platform improvement when the kernel is running as an ACRN guest: - Get TSC and CPU frequency from CPUID leaf 0x40000010 when the kernel is running as a guest on the ACRN hypervisor" * tag 'x86_platform_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/acrn: Set up timekeeping commit bf7676251b49cc4a97572da7e10f52b97cf65c75 Merge: 725737e7c21d2 c257795609e9c Author: Linus Torvalds Date: Tue Oct 4 08:58:02 2022 -0700 Merge tag 'edac_updates_for_v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - Add support for Skylake-S CPUs to ie31200_edac - Improve error decoding speed of the Intel drivers by avoiding the ACPI facilities but doing decoding in the driver itself - Other misc improvements to the Intel drivers - The usual cleanups and fixlets all over EDAC land * tag 'edac_updates_for_v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/i7300: Correct the i7300_exit() function name in comment x86/sb_edac: Add row column translation for Broadwell EDAC/i10nm: Print an extra register set of retry_rd_err_log EDAC/i10nm: Retrieve and print retry_rd_err_log registers for HBM EDAC/skx_common: Add ChipSelect ADXL component EDAC/ppc_4xx: Reorder symbols to get rid of a few forward declarations EDAC: Remove obsolete declarations in edac_module.h EDAC/i10nm: Add driver decoder for Ice Lake and Tremont CPUs EDAC/skx_common: Make output format similar EDAC/skx_common: Use driver decoder first EDAC/mc: Drop duplicated dimm->nr_pages debug printout EDAC/mc: Replace spaces with tabs in memtype flags definition EDAC/wq: Remove unneeded flush_workqueue() EDAC/ie31200: Add Skylake-S support commit 728c2edfcf14b3b61bd0ff82894f03455ca0e7d7 Author: Jason Andryuk Date: Mon Aug 29 11:15:36 2022 -0400 xen-pcifront: Handle missed Connected state An HVM guest with linux stubdomain and 2 PCI devices failed to start as libxl timed out waiting for the PCI devices to be added. It happens intermittently but with some regularity. libxl wrote the two xenstore entries for the devices, but then timed out waiting for backend state 4 (Connected) - the state stayed at 7 (Reconfiguring). (PCI passthrough to an HVM with stubdomain is PV passthrough to the stubdomain and then HVM passthrough with the QEMU inside the stubdomain.) The stubdomain kernel never printed "pcifront pci-0: Installing PCI frontend", so it seems to have missed state 4 which would have called pcifront_try_connect() -> pcifront_connect_and_init_dma() Have pcifront_detach_devices() special-case state Initialised and call pcifront_connect_and_init_dma(). Don't use pcifront_try_connect() because that sets the xenbus state which may throw off the backend. After connecting, skip the remainder of detach_devices since none have been initialized yet. When the backend switches to Reconfigured, pcifront_attach_devices() will pick them up again. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220829151536.8578-1-jandryuk@gmail.com Signed-off-by: Juergen Gross commit e021563fd09e1fd4041a6a573ec10fb5b5d275b0 Merge: a5088ee7251e5 b0c883e900702 Author: Rafael J. Wysocki Date: Tue Oct 4 16:48:16 2022 +0200 Merge tag 'thermal-v6.1-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal control fixes for 6.1-rc1 from Daniel Lezcano: "- Used the platform data to get the sensor id instead of parsing the device in the driver and remove the dedicated OF function (Daniel Lezcano) - Fixed Kconfig dependency for the QCom tsens driver (Jonathan Cameron) - Fixed missing const annotation for the RCar ops driver and removed a duplicate parameter check (Lad Prabhakar) - Fixed a NULL pointer dereference when calling set_trip_temp() (Lad Prabhakar) - Fixed the fourth hardware id in the QCom tsens driver (Vincent Knecht)" * tag 'thermal-v6.1-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id thermal/core: Add a check before calling set_trip_temp() thermal/core: Drop valid pointer check for type thermal/drivers/rcar_thermal: Constify static thermal_zone_device_ops thermal/drivers/qcom: Drop false build dependency of all QCOM drivers on QCOM_TSENS thermal/of: Remove the thermal_zone_of_get_sensor_id() function thermal/drivers/imx_sc: Rely on the platform data to get the resource id commit 129b60c957711a20434f4d4404652f0720e1ba1d Author: Johan Hovold Date: Thu Sep 29 17:42:14 2022 +0200 PM: domains: log failures to register always-on domains Always-on PM domains must be on during initialisation or the domain is currently silently rejected. Print an error message in case an always-on domain is not on to make it easier to debug drivers getting this wrong (e.g. by setting an always-on genpd flag without making sure that the state matches). Signed-off-by: Johan Hovold Reviewed-by: Kevin Hilman Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 0e0abad2a71bcd7ba0f30e7975f5b4199ade4e60 Author: Geert Uytterhoeven Date: Tue Oct 4 14:39:10 2022 +0200 io_uring: Add missing inline to io_uring_cmd_import_fixed() dummy If CONFIG_IO_URING is not set: include/linux/io_uring.h:65:12: error: ‘io_uring_cmd_import_fixed’ defined but not used [-Werror=unused-function] 65 | static int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, | ^~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by adding the missing "inline" keyword. Fixes: a9216fac3ed8819c ("io_uring: add io_uring_cmd_import_fixed") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7404b4a696f64e33e5ef3c5bd3754d4f26d13e50.1664887093.git.geert+renesas@glider.be Signed-off-by: Jens Axboe commit 800b8eecb284eb0f1d213dae5d00b4f372b7353a Author: Andy Shevchenko Date: Tue Oct 4 15:26:36 2022 +0300 platform/x86: int3472: Don't leak reference on error The for_each_acpi_consumer_dev() takes a reference to the iterator and if we break a loop we must drop that reference. This usually happens when error handling is involved. However it's not the case for skl_int3472_fill_clk_pdata(). Don't leak reference on error by dropping it properly. Fixes: 43cf36974d76 ("platform/x86: int3472: Support multiple clock consumers") Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 415fed694fe11395df56e05022d6e7cee1d39dd3 Author: Shuai Xue Date: Sat Sep 24 15:49:53 2022 +0800 ACPI: APEI: do not add task_work to kernel thread to avoid memory leak If an error is detected as a result of user-space process accessing a corrupt memory location, the CPU may take an abort. Then the platform firmware reports kernel via NMI like notifications, e.g. NOTIFY_SEA, NOTIFY_SOFTWARE_DELEGATED, etc. For NMI like notifications, commit 7f17b4a121d0 ("ACPI: APEI: Kick the memory_failure() queue for synchronous errors") keep track of whether memory_failure() work was queued, and make task_work pending to flush out the queue so that the work is processed before return to user-space. The code use init_mm to check whether the error occurs in user space: if (current->mm != &init_mm) The condition is always true, becase _nobody_ ever has "init_mm" as a real VM any more. In addition to abort, errors can also be signaled as asynchronous exceptions, such as interrupt and SError. In such case, the interrupted current process could be any kind of thread. When a kernel thread is interrupted, the work ghes_kick_task_work deferred to task_work will never be processed because entry_handler returns to call ret_to_kernel() instead of ret_to_user(). Consequently, the estatus_node alloced from ghes_estatus_pool in ghes_in_nmi_queue_one_entry() will not be freed. After around 200 allocations in our platform, the ghes_estatus_pool will run of memory and ghes_in_nmi_queue_one_entry() returns ENOMEM. As a result, the event failed to be processed. sdei: event 805 on CPU 113 failed with error: -2 Finally, a lot of unhandled events may cause platform firmware to exceed some threshold and reboot. The condition should generally just do if (current->mm) as described in active_mm.rst documentation. Then if an asynchronous error is detected when a kernel thread is running, (e.g. when detected by a background scrubber), do not add task_work to it as the original patch intends to do. Fixes: 7f17b4a121d0 ("ACPI: APEI: Kick the memory_failure() queue for synchronous errors") Signed-off-by: Shuai Xue Reviewed-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit 38f34dba806a4cb54ef3b2256948e770699a5769 Author: Kai-Heng Feng Date: Thu Sep 29 15:05:24 2022 +0800 PM: ACPI: reboot: Reinstate S5 for reboot Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused Dell PowerEdge r440 hangs at reboot. The issue is fixed by commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on system reboot to avoid triggering AER"), so use the new sysoff API to reinstate S5 for reboot on ACPI-based systems. Using S5 for reboot is default behavior under Windows: "A full shutdown (S5) occurs when a system restart is requested" [1]. Link: https://docs.microsoft.com/en-us/windows/win32/power/system-power-state # [1] Suggested-by: Dmitry Osipenko Signed-off-by: Kai-Heng Feng Signed-off-by: Rafael J. Wysocki commit e7fd8b68404f3d8bc03f85bc3c078d67096be06f Author: Kai-Heng Feng Date: Thu Sep 29 15:05:23 2022 +0800 kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode Add SYS_OFF_MODE_RESTART_PREPARE callbacks to be invoked before a system restart. Suggested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Signed-off-by: Kai-Heng Feng [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit c77ae0b86322fe91115d8188cbd3b36ecdb8120e Merge: da743a92e5895 78ba392c84c74 Author: Petr Mladek Date: Tue Oct 4 15:55:55 2022 +0200 Merge branch 'rework/kthreads' into for-linus commit da743a92e5895eb1b225de7d9806274fdbd43061 Merge: dc453dd89daac 6f0ac3b52a907 Author: Petr Mladek Date: Tue Oct 4 15:55:44 2022 +0200 Merge branch 'for-6.1-hash-pointer-init' into for-linus commit a6c05e1223c9f32836ee8df3d66208b869e5b5d7 Author: Raul E Rangel Date: Thu Sep 29 10:19:12 2022 -0600 ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle This change adds support for ACPI devices that use ExclusiveAndWake or SharedAndWake in their _CRS GpioInt definition (instead of using _PRW), and also provide power resources. Previously the ACPI subsystem had no idea if the device had a wake capable interrupt armed. This resulted in the ACPI device PM system placing the device into D3Cold, and thus cutting power to the device. With this change we will now query the _S0W method to figure out the appropriate wake capable D-state. Signed-off-by: Raul E Rangel Signed-off-by: Rafael J. Wysocki commit b38f2d5d9615cf991fb68626e70b042cb8b6dc3e Author: Raul E Rangel Date: Thu Sep 29 10:19:11 2022 -0600 i2c: acpi: Use ACPI wake capability bit to set wake_irq Device tree already has a mechanism to pass the wake_irq. It does this by looking for the wakeup-source property and setting the I2C_CLIENT_WAKE flag. This CL adds the ACPI equivalent. It uses the ACPI interrupt wake flag to determine if the interrupt can be used to wake the system. Previously the i2c drivers had to make assumptions and blindly enable the wake IRQ. This can cause spurious wake events. e.g., If there is a device with an Active Low interrupt and the device gets powered off while suspending, the interrupt line will go low since it's no longer powered and wakes the system. For this reason we should respect the board designers wishes and honor the wake bit defined on the interrupt. Signed-off-by: Raul E Rangel Reviewed-by: Mika Westerberg Reviewed-by: Andy Shevchenko Acked-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit 5ff811604f93bdd2650beed80b48c2ca16c6fba6 Author: Raul E Rangel Date: Thu Sep 29 10:19:10 2022 -0600 ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags ACPI IRQ/Interrupt resources contain a bit that describes if the interrupt should wake the system. This change exposes that bit via a new IORESOURCE_IRQ_WAKECAPABLE flag. Drivers should check this flag before arming an IRQ to wake the system. Signed-off-by: Raul E Rangel Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 4c99256013fa4e0fe9733ca1bab2b5684ccc02a1 Author: Raul E Rangel Date: Thu Sep 29 10:19:09 2022 -0600 gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get The ACPI spec defines the SharedAndWake and ExclusiveAndWake share type keywords. This is an indication that the GPIO IRQ can also be used as a wake source. This change exposes the wake_capable bit so drivers can correctly enable wake functionality instead of making an assumption. Signed-off-by: Raul E Rangel Reviewed-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 0c72dbc96be870e4de8f9707c9a4c6d7a641381c Author: Peter Ujfalusi Date: Tue Oct 4 14:51:21 2022 +0300 Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync" This reverts commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee. The reverted commit causes the following warnigs: Runtime PM usage count underflow! This is due to the fact that the pm_runtime_resume_and_get() is calling pm_runtime_put_noidle() in case of < 0 return value of pm_runtime_get_sync() which includes the -EACCES. The change is wrong as -EACCES is returned in case of 'nested' get_sync() and it is a valid use of PM runtime. Fixes: 08fc2a7448af ("ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20221004115121.26180-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0fa6831811f62cfc10415d731bcf9fde2647ad81 Author: Nicholas Piggin Date: Tue Oct 4 15:11:57 2022 +1000 powerpc/64: Fix msr_check_and_set/clear MSR[EE] race irq soft-masking means that when Linux irqs are disabled, the MSR[EE] value can change from 1 to 0 asynchronously: if a masked interrupt of the PACA_IRQ_MUST_HARD_MASK variety fires while irqs are disabled, the masked handler will return with MSR[EE]=0. This means a sequence like mtmsr(mfmsr() | MSR_FP) is racy if it can be called with local irqs disabled, unless a hard_irq_disable has been done. Reported-by: Sachin Sant Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221004051157.308999-2-npiggin@gmail.com commit 8154850b28bd57a35ea73a7518ffcb9ccd5e43bc Author: Nicholas Piggin Date: Tue Oct 4 15:11:56 2022 +1000 powerpc/64s/interrupt: Change must-hard-mask interrupt check from BUG to WARN This new assertion added is generally harmless and gets fixed up naturally, but it does indicate a problem with MSR manipulation somewhere. Fixes: c39fb71a54f0 ("powerpc/64s/interrupt: masked handler debug check for previous hard disable") Reported-by: Sachin Sant Signed-off-by: Nicholas Piggin Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221004051157.308999-1-npiggin@gmail.com commit 1dc86fc731addf783d076cb6182ebc84e2624cc0 Author: Leo Yan Date: Sun Sep 25 10:58:35 2022 +0800 perf test: Introduce script for java symbol testing This commit introduces a script for testing java symbols. The test records java program, inject samples with JIT samples, check specific JIT symbols in the report, the test will pass only when these two symbols are detected. Suggested-by: Ian Rogers Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220925025835.70364-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 058443934524590d5537a80f490267cc95a61c05 Author: Leo Yan Date: Sun Sep 25 10:58:34 2022 +0800 perf subcmd: Set environment variable "PREFIX" Set environment variable "PREFIX", it will be used by invoked shell script, e.g. the shell script uses it to find lib paths. Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220925025835.70364-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 96b731412d51c6d19c5269f8e6bf2b6621d3b994 Author: Chen Zhongjin Date: Mon Sep 26 11:14:37 2022 +0800 perf trace: Fix incorrectly parsed hexadecimal value for flags in filter When parsing flags in filter, the strtoul function uses wrong parsing condition (tok[1] = 'x'), which can make the flags be corrupted and treat all numbers start with 0 as hex. In fact strtoul() will auto test hex format when base == 0 (See _parse_integer_fixup_radix). So there is no need to test this again. Remove the unnessesary is_hexa test. Fixes: 154c978d484c6104 ("libbeauty: Introduce strarray__strtoul_flags()") Signed-off-by: Chen Zhongjin Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220926031440.28275-3-chenzhongjin@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 888964a05d13f014d21deeb7414904c82afcd82b Author: Chen Zhongjin Date: Mon Sep 26 11:14:36 2022 +0800 perf trace: Fix show_arg_names not working for tp arg names trace__fprintf_tp_fields() will always print arg names because when implemented it is forced to print arg_names with: (1 || trace->show_arg_names) So the printing looks like: > cat ~/.perfconfig [trace] show_arg_names = no > perf trace -e syscalls:*mmap sleep 1 0.000 sleep/1119 syscalls:sys_enter_mmap(NULL, 8192, READ|WRITE, PRIVATE|ANONYMOUS) 0.179 sleep/1119 syscalls:sys_exit_mmap(__syscall_nr: 9, ret: 140535426170880) ... Although the comment said that perhaps we need a show_tp_arg_names. I don't think it's necessary to control them separately because it's not so clean that part of the log shows arg names but other not. Also when we are tracing functions it's rare to especially distinguish syscalls and tp trace. Only use one option to control arg names printing is more resonable and simple. So remove the force condition and commit. After fix: > perf trace -e syscalls:*mmap sleep 1 0.000 sleep/1121 syscalls:sys_enter_mmap(NULL, 8192, READ|WRITE, PRIVATE|ANONYMOUS) 0.163 sleep/1121 syscalls:sys_exit_mmap(9, 140454467661824) ... Fixes: f11b2803bb88655d ("perf trace: Allow choosing how to augment the tracepoint arguments") Signed-off-by: Chen Zhongjin Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220926031440.28275-2-chenzhongjin@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit b71536a4925e630466d2817e65a42f57f0f5b33e Author: Chen Zhongjin Date: Mon Sep 26 11:14:40 2022 +0800 perf string: Remove unused macro K() Unused macro reported by [-Wunused-macros]. This macro is introduced to calculate the 'unit' size, in: d2fb8b4151a92223 ("perf tools: Add new perf_atoll() function to parse string representing size in bytes") 8ba7f6c2faada3ad ("saner perf_atoll()") This commit has simplified the perf_atoll() function and remove the 'unit' variable. This macro is not deleted, but nowhere else is using it. A single letter macro is confusing and easy to be misused. So remove it for code cleaning. Signed-off-by: Chen Zhongjin Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220926031440.28275-6-chenzhongjin@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit ec685de25b6718f85380bb4bbaacf23748708ad0 Author: Namhyung Kim Date: Fri Sep 23 17:42:21 2022 -0700 perf test: Add kernel lock contention test Add a new shell test to check if both normal 'perf lock record' + contention and BPF (with -b) option are working. Use 'perf bench sched messaging' as a workload since it creates some contention for sending and receiving messages. Signed-off-by: Namhyung Kim Acked-by: Adrian Hunter Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220924004221.841024-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6bbc482017deeacf5c9953bafdeb90517e22dc90 Author: Namhyung Kim Date: Fri Sep 23 17:42:20 2022 -0700 perf lock: Add -q/--quiet option to suppress header and debug messages Like in 'perf report', this option is to suppress header and debug messages. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220924004221.841024-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6282a1f4f846fda21b16065a2ef094c7b71b2771 Author: Namhyung Kim Date: Fri Sep 23 17:42:19 2022 -0700 perf lock: Add -E/--entries option Like in 'perf top', the -E option can limit number of entries to print. It can be useful when users want to see top N contended locks only. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220924004221.841024-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 84838712e92eab3dfa37b97100f32490507373b2 Author: Adrian Hunter Date: Wed Sep 14 11:01:50 2022 +0300 perf test: waiting.sh: Parameterize timeouts Let helper functions accept a parameter to specify time out values in tenths of a second. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220914080150.5888-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ebcdf07f7e4cdfdcfb3589f6bd3f81c3c061164 Author: Adrian Hunter Date: Wed Sep 14 11:01:49 2022 +0300 perf test: test_intel_pt.sh: Move helper functions for waiting Move helper functions for waiting to a separate file so they can be shared. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220914080150.5888-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit fea753f8e3c88c056806792c4d9de719939e0ef0 Author: Adrian Hunter Date: Mon Sep 12 11:34:12 2022 +0300 perf test: test_intel_pt.sh: Add per-thread test When tracing the kernel with Intel PT, text_poke events are recorded per-cpu. In per-thread mode that results in a mixture of per-thread and per-cpu events and mmaps. Check that happens correctly. The debug output from perf record -vvv is recorded and then awk used to process the debug messages that indicate what file descriptors were opened and whether they were mmapped or set-output. Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220912083412.7058-12-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit da4062021e0e6da52d4919b6d77dbd77fa847f97 Author: Adrian Hunter Date: Mon Sep 12 11:34:11 2022 +0300 perf tools: Add debug messages and comments for testing Add debug messages to enable scripts to track aspects of 'perf record' behaviour. The messages will be consumed after 'perf record' has run, with the exception of "perf record has started" which is consequently flushed. Put comments so developers know which messages are also being used by test scripts. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-11-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2c1c9e351a43878043684be92615d7002c8ea0c6 Author: Adrian Hunter Date: Mon Sep 12 11:34:10 2022 +0300 perf test: test_intel_pt.sh: Add more output in preparation for more tests When there are more tests it won't be obvious which test failed. Add more output so that it is. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit fd9b45e39cfaf885a8767bcb7631868155a2f4d6 Author: Adrian Hunter Date: Mon Sep 12 11:34:09 2022 +0300 perf test: test_intel_pt.sh: Fix return checking The use of set -e will cause a function that returns non-zero to terminate the script unless the result is consumed by || for example. That is OK if there is only 1 test function, but not if there are more. Prepare for more by using ||. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d7aac2bf87ab6b9f759c107b44bf8a0326c4c19 Author: Adrian Hunter Date: Mon Sep 12 11:34:08 2022 +0300 perf test: test_intel_pt.sh: Use quotes around variable expansion As suggested by shellcheck, use quotes around variable expansion. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 711949e2f0bac0c8894cf84360354344be55c057 Author: Adrian Hunter Date: Mon Sep 12 11:34:07 2022 +0300 perf test: test_intel_pt.sh: Use grep -c instead of grep plus wc -l As suggested by shellcheck, use grep -c instead of grep plus wc -l Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1aaff2bac6cdb372ca83f3da6e1f4af6c04eefcd Author: Adrian Hunter Date: Mon Sep 12 11:34:06 2022 +0300 perf test: test_intel_pt.sh: Stop using backticks As suggested by shellcheck, stop using backticks. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 202d039413818b0cf421d98b6a6068fdd2ec8d08 Author: Adrian Hunter Date: Mon Sep 12 11:34:05 2022 +0300 perf test: test_intel_pt.sh: Stop using expr As suggested by shellcheck, stop using expr. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3f79fff8bd561f22678e7008e0910ffdbc9891ea Author: Adrian Hunter Date: Mon Sep 12 11:34:04 2022 +0300 perf test: test_intel_pt.sh: Fix redirection As reported by shellcheck, 2>&1 must come after >/dev/null Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 170ac70f16e7993449ae20a5c5f23d965e3e171d Author: Adrian Hunter Date: Mon Sep 12 11:34:03 2022 +0300 perf test: test_intel_pt.sh: Use a temp directory Create a directory for temporary files so that mktemp needs to be used only once. It also enables more temp files to be added without having to add them also to the cleanup. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 19af23df66b412106ce90f2e2258fefe6a256acd Author: Adrian Hunter Date: Mon Sep 12 11:34:02 2022 +0300 perf test: test_intel_pt.sh: Add cleanup function Add a cleanup function that will still clean up if the script is terminated prematurely. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220912083412.7058-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 4627a000dced43ae9e81a9c174e75773794ce905 Author: Athira Rajeev Date: Fri Sep 16 16:19:04 2022 +0530 perf tests: Fix 'perf probe' error log check in skip_if_no_debuginfo The perf probe related tests like probe_vfs_getname.sh which is in "tools/perf/tests/shell" directory have dependency on debuginfo information in the kernel. Currently debuginfo check is handled by skip_if_no_debuginfo function in the file "lib/probe_vfs_getname.sh". skip_if_no_debuginfo function looks for this specific error log from perf probe to skip the testcase: <<>> Failed to find the path for the kernel|Debuginfo-analysis is not supported <>> But in some case, like this one in powerpc, while running this test, observed error logs is: <<>> The /lib/modules//build/vmlinux file has no debug information. Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package. Error: Failed to add events. <<>> Update the skip_if_no_debuginfo function to include the above error, to skip the test in these scenarios too. Reported-by: Disha Goel Signed-off-by: Athira Jajeev Tested-by: Disha Goel Cc: Jiri Olsa Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220916104904.99798-1-atrajeev@linux.vnet.ibm.com Reviewed-By: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 7d18a824b5e57ddd1261e0116c9d7d81183eca85 Author: Namhyung Kim Date: Fri Sep 23 10:31:42 2022 -0700 perf annotate: Toggle full address <-> offset display Handle 'f' key to toggle the display offset and full address. Obviously it only works when users set to see disassembler output ('o' key). It'd be useful when users want to see the full virtual address in the TUI annotate browser. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220923173142.805896-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 762461f1a53b268e44fbd941d3734f4553a6e925 Author: Namhyung Kim Date: Fri Sep 23 10:31:41 2022 -0700 perf tools: Add 'addr' sort key Sometimes users want to see actual (virtual) address of sampled instructions. Add a new 'addr' sort key to display the raw addresses. $ perf record -o- true | perf report -i- -s addr # To display the perf.data header info, please use --header/--header-only options. # [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] # # Total Lost Samples: 0 # # Samples: 12 of event 'cycles:u' # Event count (approx.): 252512 # # Overhead Address # ........ .................. # 42.96% 0x7f96f08443d7 29.55% 0x7f96f0859b50 14.76% 0x7f96f0852e02 8.30% 0x7f96f0855028 4.43% 0xffffffff8de01087 Note that it just compares and displays the sample ip. Each process can have a different memory layout and the ip will be different even if they run the same binary. So this sort key is mostly meaningful for per-process profile data. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220923173142.805896-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fd941521e81fd24e4ab164f88513612fb5f3af85 Author: Namhyung Kim Date: Fri Sep 23 10:31:40 2022 -0700 perf inject: Clarify build-id options a little bit Update the documentation of --build-id and --buildid-all options to clarify the difference between them. The former requires full sample processing to find which DSOs are actually used. While the latter simply injects every DSO's build-id from MMAP{,2} records, skipping SAMPLEs. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220923173142.805896-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d031a00a29b2b2a6ad99c41fadb1ea3c0dc5046c Author: Namhyung Kim Date: Fri Sep 9 16:50:24 2022 -0700 perf record: Fix a segfault in record__read_lost_samples() When it fails to open events record__open() returns without setting the session->evlist. Then it gets a segfault in the function trying to read lost sample counts. You can easily reproduce it as a normal user like: $ perf record -p 1 true ... perf: Segmentation fault ... Skip the function if it has no evlist. And add more protection for evsels which are not properly initialized. Fixes: a49aa8a54e861af1 ("perf record: Read and inject LOST_SAMPLES events") Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Acked-by: Leo Yan Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220909235024.278281-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dc64641c8f917f20ad5cf678de3b77ebc8fb3a9a Author: Shang XiaoJing Date: Thu Sep 22 22:14:37 2022 +0800 perf top: Fix error code in cmd_top() There are three error paths which return success: 1. Propagate the errno from evlist__create_maps() if it failed. 2. Return -EINVAL if top.sb_evlist is NULL. 3. Return -EINVAL if evlist__add_bpf_sb_event() failed. Signed-off-by: Shang XiaoJing Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220922141438.22487-4-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit cdd3b15d6871e7b164e3dd82514dfcc4daa7559b Author: Shang XiaoJing Date: Thu Sep 22 22:14:36 2022 +0800 perf stat: Merge cases in process_evlist As two cases in process_evlist has same behavior, make the first fall through to the second. Commiter notes: Added __fallthrough, the kernel has "fallthrough", we need to make tools/ use it. Signed-off-by: Shang XiaoJing Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220922141438.22487-3-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e8a6430ff605734ab5a7da42097f6b786a78ba2b Author: Shang XiaoJing Date: Thu Sep 22 22:14:35 2022 +0800 perf genelf: Fix error code in jit_write_elf() The error code is set to -1 at the beginning of jit_write_elf(), but it is assigned by jit_add_eh_frame_info() in the middle, hence the following error can only return the error code of jit_add_eh_frame_info(). Reset the error code to the default value after being assigned by jit_add_eh_frame_info(). Fixes: 086f9f3d7897d808 ("perf jit: Generate .eh_frame/.eh_frame_hdr in DSO") Signed-off-by: Shang XiaoJing Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stefano Sanfilippo Link: https://lore.kernel.org/r/20220922141438.22487-2-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit c1da8dd5c11dabd50b1578c6b43d73c7bbc28963 Author: Namhyung Kim Date: Sun Sep 11 22:53:14 2022 -0700 perf lock contention: Skip stack trace from BPF Currently it collects stack traces to max size then skip entries. Because we don't have control how to skip perf callchains. But BPF can do it with bpf_get_stackid() with a flag. Say we have max-stack=4 and stack-skip=2, we get these stack traces. Before: After: .---> +---+ <--. .---> +---+ <--. | | | | | | | | | +---+ usable | +---+ | max | | | max | | | stack +---+ <--' stack +---+ usable | | X | | | | | | +---+ skip | +---+ | | | X | | | | | `---> +---+ `---> +---+ <--' <=== collection | X | +---+ skip | X | +---+ Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220912055314.744552-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 96532a83ee8e30035e584b046c859adb001a3b8d Author: Namhyung Kim Date: Sun Sep 11 22:53:13 2022 -0700 perf lock contention: Allow to change stack depth and skip It needs stack traces to find callers of locks. To minimize the performance overhead it only collects up to 8 entries for each stack trace. And it skips first 3 entries as they came from BPF, tracepoint and lock functions which are not interested for most users. But it turned out that those numbers are different in some configuration. Using fixed number can result in non meaningful caller names. Let's make them adjustable with --stack-depth and --skip-stack options. On my setup, the default output is like below: # /perf lock con -ab -F contended,wait_total sleep 3 contended total wait type caller 28 4.55 ms rwlock:W __bpf_trace_contention_begin+0xb 33 1.67 ms rwlock:W __bpf_trace_contention_begin+0xb 12 580.28 us spinlock __bpf_trace_contention_begin+0xb 60 240.54 us rwsem:R __bpf_trace_contention_begin+0xb 27 64.45 us spinlock __bpf_trace_contention_begin+0xb If I change the stack skip to 5, the result will be like: # perf lock con -ab -F contended,wait_total --stack-skip 5 sleep 3 contended total wait type caller 32 715.45 us spinlock folio_lruvec_lock_irqsave+0x61 26 550.22 us spinlock folio_lruvec_lock_irqsave+0x61 15 486.93 us rwsem:R mmap_read_lock+0x13 12 139.66 us rwsem:W vm_mmap_pgoff+0x93 1 7.04 us spinlock tick_do_update_jiffies64+0x25 Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220912055314.744552-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a6eaf966bce9a30ccd0969fed195e051b8904983 Author: Namhyung Kim Date: Sun Sep 11 22:53:12 2022 -0700 perf lock contention: Show full callstack with -v option Currently it shows a caller function for each entry, but users need to see the full call stacks sometimes. Use -v/--verbose option to do that. # perf lock con -a -b -v sleep 3 Looking at the vmlinux_path (8 entries long) symsrc__init: cannot get elf header. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols contended total wait max wait avg wait type caller 1 10.74 us 10.74 us 10.74 us spinlock __bpf_trace_contention_begin+0xb 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffbb8b8e75 bpf_trace_run2+0x35 0xffffffffbb7eab9b __bpf_trace_contention_begin+0xb 0xffffffffbb7ebe75 queued_spin_lock_slowpath+0x1f5 0xffffffffbc1c26ff _raw_spin_lock+0x1f 0xffffffffbb841015 tick_do_update_jiffies64+0x25 0xffffffffbb8409ee tick_irq_enter+0x9e 1 7.70 us 7.70 us 7.70 us spinlock __bpf_trace_contention_begin+0xb 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffc03b5c47 bpf_prog_bf07ae9e2cbd02c5_contention_begin+0x117 0xffffffffbb8b8e75 bpf_trace_run2+0x35 0xffffffffbb7eab9b __bpf_trace_contention_begin+0xb 0xffffffffbb7ebe75 queued_spin_lock_slowpath+0x1f5 0xffffffffbc1c26ff _raw_spin_lock+0x1f 0xffffffffbb7bc27e raw_spin_rq_lock_nested+0xe 0xffffffffbb7cef9c load_balance+0x66c Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220912055314.744552-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 637522ce97b49550bac5a053175c9c9562e2c6b5 Author: Namhyung Kim Date: Sun Sep 11 22:53:11 2022 -0700 perf lock contention: Factor out get_symbol_name_offset() It's to convert addr to symbol+offset. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220912055314.744552-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f0c4b97a292741270d764a13df3969f7628382b3 Author: Ian Rogers Date: Wed Aug 31 10:49:26 2022 -0700 perf test: Add basic core_wide expression test Add basic test for coverage, similar to #smt_on. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1725e9cd32a0109b1257777a2a74f632ee45b068 Author: Ian Rogers Date: Wed Aug 31 10:49:25 2022 -0700 perf metrics: Wire up core_wide Pass state necessary for core_wide into the expression parser. Add system_wide and user_requested_cpu_list to perf_stat_config to make it available at display time. evlist isn't used as the evlist__create_maps, that computes user_requested_cpus, needs the list of events which is generated by the metric. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a4b8cfcabb1d90ec40ca5505f0dee71966d338cf Author: Ian Rogers Date: Wed Aug 31 10:49:24 2022 -0700 perf stat: Delay metric parsing Having metric parsing as part of argument processing causes issues as flags like metric-no-group may be specified later. It also denies the opportunity to optimize the events on SMT systems where fewer events may be possible if we know the target is system-wide. Move metric parsing to after command line option parsing. Because of how stat runs this moves the parsing after record/report which fail to work with metrics currently anyway. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cc2c4e26ece19b4118f059f3a526c048793e58af Author: Ian Rogers Date: Wed Aug 31 10:49:23 2022 -0700 perf topology: Add core_wide It is possible to optimize metrics when all SMT threads (CPUs) on a core are measuring events in system wide mode. For example, TMA metrics defines CORE_CLKS for Sandybrdige as: if SMT is disabled: CPU_CLK_UNHALTED.THREAD if SMT is enabled and recording on all SMT threads: CPU_CLK_UNHALTED.THREAD_ANY / 2 if SMT is enabled and not recording on all SMT threads: (CPU_CLK_UNHALTED.THREAD/2)* (1+CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE/CPU_CLK_UNHALTED.REF_XCLK ) That is two more events are necessary when not gathering counts on all SMT threads. To distinguish all SMT threads on a core vs system wide (all CPUs) call the new property core wide. Add a core wide test that determines the property from user requested CPUs, the topology and system wide. System wide is required as other processes running on a SMT thread will change the counts. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 09b73fe9e3debfeed61c1395652aeff59bda6ae4 Author: Ian Rogers Date: Wed Aug 31 10:49:22 2022 -0700 perf smt: Compute SMT from topology The topology records sibling threads. Rather than computing SMT using siblings in sysfs, reuse the values in topology. This only applies when the file smt/active isn't available. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1a6abdde13bb6542e72dbe7a2219762795f0161a Author: Ian Rogers Date: Wed Aug 31 10:49:21 2022 -0700 perf expr: Move the scanner_ctx into the parse_ctx We currently maintain the two independently and copy from one to the other. This is a burden when additional scanner context values are necessary, so combine them. Signed-off-by: Ian Rogers Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220831174926.579643-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 76ed5927ca6185f141336061c4865eb20048c288 Author: Gaosheng Cui Date: Fri Sep 9 12:45:42 2022 +0800 perf pmu: Remove perf_pmu_lex() needless declaration It builds without it, perhaps with some older combination of flex/bison we needed this, clean it up a bit removing this. Signed-off-by: Gaosheng Cui Cc: Alexander Shishkin Cc: Athira Jajeev Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220909044542.1087870-3-cuigaosheng1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 4671855ae7d9f711b8fe2b558a6000b1eb2e4fa3 Author: Gaosheng Cui Date: Fri Sep 9 12:45:41 2022 +0800 perf sort: Remove hist_entry__sort_list() and sort__first_dimension() leftover declarations The hist_entry__sort_list and sort__first_dimension functions have been removed in commit cfaa154b2335d4c8 ("perf tools: Get rid of obsolete hist_entry__sort_list"), remove them. Signed-off-by: Gaosheng Cui Cc: Alexander Shishkin Cc: Athira Jajeev Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220909044542.1087870-2-cuigaosheng1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 187c7723e4aae6d5729e27179542956975624ff8 Author: Namhyung Kim Date: Thu Sep 8 16:01:50 2022 -0700 perf test: Skip sigtrap test on old kernels If it runs on an old kernel, perf_event_open would fail because of the new fields sigtrap and sig_data. Just skipping the test could miss an actual bug in the kernel. Let's check BTF (when we have libbpf) if it has the sigtrap field in the perf_event_attr. Otherwise, we can check it with a minimal event config. Signed-off-by: Namhyung Kim Acked-by: Song Liu Suggested-by: Arnaldo Carvalho de Melo # Using BTF to check for the struct members Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908230150.4105955-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 165da80296ea6bc996eea4551026e39a0109f71e Author: Namhyung Kim Date: Thu Sep 8 15:54:48 2022 -0700 perf sched: Factor out destroy_tasks() Add destroy_tasks() as a counterpart of create_tasks() and put the thread safety notations there. After join, it destroys semaphores too. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908225448.4105056-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c7202d20fb4584435ce2af5ef3a7a770f79ab59e Author: Ian Rogers Date: Tue Jun 14 07:33:53 2022 -0700 perf cpumap: Add range data encoding Often cpumaps encode a range of all CPUs, add a compact encoding that doesn't require a bit mask or list of all CPUs. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Athira Jajeev Cc: Colin Ian King Cc: Dave Marchevsky Cc: German Gomez Cc: Gustavo A. R. Silva Cc: Ingo Molnar Cc: James Clark Cc: Kees Kook Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220614143353.1559597-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d773c999b8d22ad3ffd42eca373ebae4cb6512fd Author: Ian Rogers Date: Tue Jun 14 07:33:52 2022 -0700 perf events: Prefer union over variable length array It is possible for casts to introduce alignment issues, prefer a union for perf_record_event_update. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Athira Jajeev Cc: Colin Ian King Cc: Dave Marchevsky Cc: German Gomez Cc: Gustavo A. R. Silva Cc: Ingo Molnar Cc: James Clark Cc: Kees Kook Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220614143353.1559597-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3657ad4b0fb6a6c3df12cec92013614212f5f401 Author: Nick Forrington Date: Wed Sep 7 16:49:30 2022 +0100 perf vendor events: Update events for Neoverse E1 These CPUs contain the same PMU events (as per the Arm Technical Reference manuals for Cortex A65 and Neoverse E1) This de-duplicates event data, and avoids issues in previous E1 event data (not present in A65 data) * Missing implementation defined events * Inclusion of events that are not implemented: - L1D_CACHE_ALLOCATE - SAMPLE_POP - SAMPLE_FEED - SAMPLE_FILTRATE - SAMPLE_COLLISION Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220907154932.60808-1-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e8d21b922af782954d083d938c117b488c4578c Author: Shang XiaoJing Date: Thu Sep 8 10:11:41 2022 +0800 perf timechart: Add p_state_end helper Wrap repeated code in helper functions p_state_end, which alloc a new power_event recording last pstate, and insert to the head of tchart->power_events. Signed-off-by: Shang XiaoJing Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908021141.27134-5-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 569c746b8a1eab64ebf5b3ebb5d414742c8fc40b Author: Shang XiaoJing Date: Thu Sep 8 10:11:40 2022 +0800 perf timechart: Add create_pidcomm helper Wrap repeated code combined with alloc of per_pidcomm in helper function create_pidcomm. Signed-off-by: Shang XiaoJing Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908021141.27134-4-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 0f405f878bc15674e38648121e124a93d0cef9c3 Author: Shang XiaoJing Date: Thu Sep 8 10:11:39 2022 +0800 perf lock: Add get_key_by_aggr_mode helper Wrap repeated code in helper functions get_key_by_aggr_mode and get_key_by_aggr_mode_simple, which assign the value to key based on aggregation mode. Note that for the conditions not support LOCK_AGGR_CALLER, should call get_key_by_aggr_mode_simple directly. Signed-off-by: Shang XiaoJing Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908021141.27134-3-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e3e7572fa8062b72385575bf04170621a4a8c447 Author: Shang XiaoJing Date: Thu Sep 8 10:11:38 2022 +0800 perf trace: Use zalloc() to save initialization of syscall_stats As most members of syscall_stats is set to 0 in thread__update_stats, using zalloc() directly. Signed-off-by: Shang XiaoJing Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220908021141.27134-2-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit c581e46ba2988a6198b07bcf264beab1895a28ac Author: Nick Forrington Date: Thu Sep 8 12:25:18 2022 +0100 perf vendor events arm64: Move REMOTE_ACCESS to "memory" category Move REMOTE_ACCESS event from other.json to memory.json for Neoverse CPUs. This is consistent with other Arm (Cortex) CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220908112519.64614-1-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3b7ae354c1fcb783848b46e1c1140a66ba742672 Author: Adrian Hunter Date: Mon Sep 5 10:34:24 2022 +0300 perf intel-pt: Remove first line of log dumped on error Instead of printing "(first line may be sliced)", always remove the first line of the debug log if the buffer has wrapped when dumping on error. Signed-off-by: Adrian Hunter Reviewed-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 65aee81afe7f6a54e2fb2de59e1d6cd47dcf8eb9 Author: Adrian Hunter Date: Mon Sep 5 10:34:23 2022 +0300 perf intel-pt: Support itrace option flag d+e to log on error Pass d+e option and log size via intel_pt_log_enable(). Allocate a buffer for log messages and provide intel_pt_log_dump_buf() to dump and reset the buffer upon decoder errors. Example: $ sudo perf record -e intel_pt// sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.094 MB perf.data ] $ sudo perf config itrace.debug-log-buffer-size=300 $ sudo perf script --itrace=ed+e+o | head -20 Dumping debug log buffer (first line may be sliced) Other ffffffff96ca22f6: 48 89 e5 Other ffffffff96ca22f9: 65 48 8b 05 ff e0 38 69 Other ffffffff96ca2301: 48 3d c0 a5 c1 98 Other ffffffff96ca2307: 74 08 Jcc +8 ffffffff96ca2311: 5d Other ffffffff96ca2312: c3 Ret ERROR: Bad RET compression (TNT=N) at 0xffffffff96ca2312 End of debug log buffer dump instruction trace error type 1 time 15913.537143482 cpu 5 pid 36292 tid 36292 ip 0xffffffff96ca2312 code 6: Trace doesn't match instruction Dumping debug log buffer (first line may be sliced) Other ffffffff96ce7fe9: f6 47 2e 20 Other ffffffff96ce7fed: 74 11 Jcc +17 ffffffff96ce7fef: 48 8b 87 28 0a 00 00 Other ffffffff96ce7ff6: 5d Other ffffffff96ce7ff7: 48 8b 40 18 Other ffffffff96ce7ffb: c3 Ret ERROR: Bad RET compression (TNT=N) at 0xffffffff96ce7ffb Warning: 8 instruction trace errors Reviewed-by: Andi Kleen Reviewed-by: Namhyung Kim Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 50d7620b27d19bfa4cc12764d27c272f2ee3e28a Author: Adrian Hunter Date: Mon Sep 5 10:34:22 2022 +0300 perf intel-pt: Improve object code read error message The offset is more readable in hex instead of decimal. Reviewed-by: Andi Kleen Reviewed-by: Namhyung Kim Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 52de6aacbe3dc498456a565a85adb2b35f2d05b6 Author: Adrian Hunter Date: Mon Sep 5 10:34:21 2022 +0300 perf intel-pt: Improve man page layout slightly Improve man page layout slightly by adding blank lines. Reviewed-by: Andi Kleen Reviewed-by: Namhyung Kim Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a7fdd30a22448f17e942436b9db2a94b48218eb6 Author: Adrian Hunter Date: Mon Sep 5 10:34:20 2022 +0300 perf auxtrace: Add itrace option flag d+e to log on error Add flag +e to the itrace d (decoder debug log) option to get output only on decoding errors. The log can be very big so reducing the output to where there are decoding errors can be useful for analyzing errors. By default, the log size in that case is 16384 bytes, but can be altered by perf config e.g. perf config itrace.debug-log-buffer-size=30000 Reviewed-by: Andi Kleen Reviewed-by: Namhyung Kim Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c3ca8d44185cc2ac5ca75d2d38647979da5b0035 Author: Adrian Hunter Date: Mon Sep 5 10:34:19 2022 +0300 perf tools: Add perf_config_scan() To simplify getting a single config value, add a function to scan a config variable. Reviewed-by: Andi Kleen Reviewed-by: Namhyung Kim Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220905073424.3971-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 016f2f9821bd5d056d454aefa603f8b4f7d0e0f0 Author: ye xingchen Date: Tue Aug 23 07:56:05 2022 +0000 perf callchain: Remove unneeded 'result' variable Return the value scnprintf() directly instead of storing it in a redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Cc: Alexandre Truong Cc: Ian Rogers Cc: James Clark Cc: Mark Rutland Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit cf874a0165e4a6ea906db9e735d52ee50fdf760b Author: Shang XiaoJing Date: Tue Sep 6 11:29:05 2022 +0800 perf c2c: Add helpers to get counts of loads or stores Wrap repeated code in helper functions get_load_llc_misses, get_load_cache_hits. For consistence, helper function get_stores is wraped as well. Reviewed-by: Leo Yan Signed-off-by: Shang XiaoJing Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220906032906.21395-3-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 4fb47c8c20ec851128a36f82295886d325920864 Author: Shang XiaoJing Date: Tue Sep 6 11:29:04 2022 +0800 perf tools: Add same_cmd_with_prefix() helper Wrap repeated code in helper function same_cmd_with_prefix for more clearly. Signed-off-by: Shang XiaoJing Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220906032906.21395-2-shangxiaojing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit b304c173e3fffc241bc51650980c8342db396bcb Author: Nick Forrington Date: Mon Sep 5 12:40:24 2022 +0100 perf vendor events: Add missing Neoverse V1 events Based on updated data from: https://github.com/ARM-software/data/blob/master/pmu/neoverse-v1.json which is based on PMU event descriptions from the Arm Neoverse V1 Technical Reference Manual. This adds the following missing events: ASE_INST_SPEC SVE_INST_SPEC SVE_PRED_SPEC SVE_PRED_EMPTY_SPEC SVE_PRED_FULL_SPEC SVE_PRED_PARTIAL_SPEC SVE_LDFF_SPEC SVE_LDFF_FAULT_SPEC FP_SCALE_OPS_SPEC FP_FIXED_OPS_SPEC Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220905114024.7552-1-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d7ba22d4a3fe0fb878d64263253a7d36bd0aac14 Author: Namhyung Kim Date: Thu Sep 1 12:57:39 2022 -0700 perf report: Show per-event LOST SAMPLES stat Display lost samples with --stat (if not zero): $ perf report --stat Aggregated stats: TOTAL events: 64 COMM events: 2 ( 3.1%) EXIT events: 1 ( 1.6%) SAMPLE events: 26 (40.6%) MMAP2 events: 4 ( 6.2%) LOST_SAMPLES events: 1 ( 1.6%) ATTR events: 2 ( 3.1%) FINISHED_ROUND events: 1 ( 1.6%) ID_INDEX events: 1 ( 1.6%) THREAD_MAP events: 1 ( 1.6%) CPU_MAP events: 1 ( 1.6%) EVENT_UPDATE events: 2 ( 3.1%) TIME_CONV events: 1 ( 1.6%) FEATURE events: 20 (31.2%) FINISHED_INIT events: 1 ( 1.6%) cycles:uH stats: SAMPLE events: 14 LOST_SAMPLES events: 1 instructions:uH stats: SAMPLE events: 12 Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220901195739.668604-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 75b37db096e30b12f1de88052a19b1a3fff62b5e Author: Namhyung Kim Date: Thu Sep 1 12:57:38 2022 -0700 perf hist: Add nr_lost_samples to hist_stats This is a preparation to display accurate lost sample counts for each evsel. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220901195739.668604-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e3a23261ad06d5986dce0f17a2cfb4d22d493385 Author: Namhyung Kim Date: Thu Sep 1 12:57:37 2022 -0700 perf record: Read and inject LOST_SAMPLES events When there are lost samples, it can read the number of PERF_FORMAT_LOST and convert it to PERF_RECORD_LOST_SAMPLES and write to the data file at the end. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220901195739.668604-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e17f343c3ba1b317574a4218c631547bb09e72bf Author: Namhyung Kim Date: Thu Sep 1 12:57:36 2022 -0700 perf record: Set PERF_FORMAT_LOST by default As we want to see the number of lost samples in the perf report, set the LOST format when it configs evsel. On old kernels, it'd fallback to disable it. Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220901195739.668604-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a8d68cc45799dc7bc8065fd7bb2405335f7d4fa6 Author: Namhyung Kim Date: Thu Sep 1 12:57:35 2022 -0700 perf tools: Print LOST read format in the verbose mode So that we can see it with: $ perf record -vv pwd ... perf_event_attr: size 128 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD read_format ID|LOST disabled 1 inherit 1 exclude_kernel 1 freq 1 enable_on_exec 1 precise_ip 3 sample_id_all 1 exclude_guest 1 Reviewed-by: Adrian Hunter Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220901195739.668604-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9dcc22efff4b699a12661f34231a96506338da2e Author: Ian Rogers Date: Tue Aug 30 09:48:39 2022 -0700 perf smt: Tidy header guard add SPDX Make the header guard consistent with others. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Caleb Biggers Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Cc: Xing Zhengjun Cc: florian fischer Link: http://lore.kernel.org/lkml/20220830164846.401143-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fb42f8b729f431b53acfaa8bf1b4d43b98e62e14 Author: Anshuman Khandual Date: Wed Aug 24 10:18:22 2022 +0530 perf branch: Add PERF_BR_NEW_ARCH_[N] map for BRBE on arm64 platform This updates the perf tool with arch specific branch type classification used for BRBE on arm64 platform as added in the kernel earlier. Signed-off-by: Anshuman Khandual Cc: Alexander Shishkin Cc: Catalin Marinas Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robin Murphy Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220824044822.70230-9-anshuman.khandual@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit bcb96ce6d2544ae0738cf54fd0a6d048fad791ec Author: Anshuman Khandual Date: Wed Aug 24 10:18:21 2022 +0530 perf branch: Add branch privilege information request flag This updates the perf tools with branch privilege information request flag i.e PERF_SAMPLE_BRANCH_PRIV_SAVE that has been added earlier in the kernel. This also updates 'perf record' documentation, branch_modes[], and generic branch privilege level enumeration as added earlier in the kernel. Signed-off-by: Anshuman Khandual Cc: Alexander Shishkin Cc: Catalin Marinas Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robin Murphy Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220824044822.70230-8-anshuman.khandual@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0ddea8e2a0c20ff32a28ef21574f704d8f4699a2 Author: Anshuman Khandual Date: Wed Aug 24 10:18:20 2022 +0530 perf branch: Extend branch type classification This updates the perf tool with generic branch type classification with new ABI extender place holder i.e PERF_BR_EXTEND_ABI, the new 4 bit branch type field i.e perf_branch_entry.new_type, new generic page fault related branch types and some arch specific branch types as added earlier in the kernel. Committer note: Add an extra entry to the branch_type_name array to cope with PERF_BR_EXTEND_ABI, to address build warnings on some compiler/systems, like: 75 8.89 ubuntu:20.04-x-powerpc64el : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04) inlined from 'branch_type_stat_display' at util/branch.c:152:4: /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=] 100 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ Signed-off-by: Anshuman Khandual Cc: Alexander Shishkin Cc: Catalin Marinas Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robin Murphy Cc: Stephen Rothwell Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220824044822.70230-7-anshuman.khandual@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 1c96b6e45f140a4a43b1e831907e250e6302067c Author: Anshuman Khandual Date: Wed Aug 24 10:18:19 2022 +0530 perf branch: Add system error and not in transaction branch types This updates the perf tool with generic branch type classification with two new branch types i.e system error (PERF_BR_SERROR) and not in transaction (PERF_BR_NO_TX) which got updated earlier in the kernel. This also updates corresponding branch type strings in branch_type_name(). Committer notes: At perf tools merge time this is only on PeterZ's tree, at: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core So for testing one has to build a kernel with that branch, then test the tooling side from: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core Reviewed-by: James Clark Signed-off-by: Anshuman Khandual Cc: Alexander Shishkin Cc: Catalin Marinas Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robin Murphy Cc: Suzuki Poulouse Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220824044822.70230-6-anshuman.khandual@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit dca571ed9753b4cd8d19d8b5a896351a78e3c5eb Author: Ian Rogers Date: Fri Aug 26 09:42:42 2022 -0700 perf build: Enable -Wthread-safety with clang If building with clang then enable -Wthread-safety warnings. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b40b2122566ea2d948032370000f0b06b8d507fc Author: Ian Rogers Date: Fri Aug 26 09:42:41 2022 -0700 perf top: Fixes for thread safety analysis Add annotations to describe lock behavior. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 59c266604922898ad8aa1ef881a60eb02fcb385f Author: Ian Rogers Date: Fri Aug 26 09:42:40 2022 -0700 perf sched: Fixes for thread safety analysis Add annotations to describe lock behavior. Add unlocks so that mutexes aren't conditionally held on exit from perf_sched__replay. Add an exit variable so that thread_func can terminate, rather than leaving the threads blocked on mutexes. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bfa339ceda3c9e49ffb58c7de50fd86912ab9e6d Author: Ian Rogers Date: Fri Aug 26 09:42:39 2022 -0700 perf mutex: Add thread safety annotations Add thread safety annotations to struct mutex so that when compiled with clang's -Wthread-safety warnings are generated for erroneous lock patterns. NO_THREAD_SAFETY_ANALYSIS is needed for mutex_lock/mutex_unlock as the analysis doesn't under pthread calls. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e54dea69cdf6ed4bfcb266160d348be83bcbe826 Author: Ian Rogers Date: Fri Aug 26 09:42:38 2022 -0700 perf dso: Hold lock when accessing nsinfo There may be threads racing to update dso->nsinfo: https://lore.kernel.org/linux-perf-users/CAP-5=fWZH20L4kv-BwVtGLwR=Em3AOOT+Q4QGivvQuYn5AsPRg@mail.gmail.com/ Holding the dso->lock avoids use-after-free, memory leaks and other such bugs. Apply the fix in: https://lore.kernel.org/linux-perf-users/20211118193714.2293728-1-irogers@google.com/ of there being a missing nsinfo__put now that the accesses are data race free. Fixes test "Lookup mmap thread" when compiled with address sanitizer. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d8e40b58ad4701198bfe83b860a29153d17dc478 Author: Ian Rogers Date: Fri Aug 26 09:42:37 2022 -0700 perf top: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9b3726ef836f6059af948c4b83317070da8b95f9 Author: Ian Rogers Date: Fri Aug 26 09:42:36 2022 -0700 perf annotate: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d9a0d6b83950bde861d2e2715ef476dae67d7873 Author: Ian Rogers Date: Fri Aug 26 09:42:35 2022 -0700 perf dso: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 26b3a5fa41a6063c19747e25174fc6f4cd315c34 Author: Ian Rogers Date: Fri Aug 26 09:42:34 2022 -0700 perf mmap: Remove unnecessary pthread.h include The comment says it is for cpu_set_t which isn't used in the header. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 82aff6cc070417f26f9b02b26e63c17ff43b4044 Author: Ian Rogers Date: Fri Aug 26 09:42:33 2022 -0700 perf ui: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0bd14ac2d6aab7339c4b410543d978cd254b24f9 Author: Ian Rogers Date: Fri Aug 26 09:42:32 2022 -0700 perf sched: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Update cmd_sched so that we always explicitly destroy the mutexes. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 49c670b17e555bb9fab4308bb4dd9eadf29872fb Author: Ian Rogers Date: Fri Aug 26 09:42:31 2022 -0700 perf record: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking for synth_lock. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f37dc6ed0f45c476b88c0b25f829749a812238a Author: Ian Rogers Date: Fri Aug 26 09:42:30 2022 -0700 perf lock: Remove unused pthread.h include No pthread usage in builtin-lock.c. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ed0546b7b8376c2bc137a46babfffd14ab060c10 Author: Ian Rogers Date: Fri Aug 26 09:42:29 2022 -0700 perf bpf: Remove unused pthread.h include No pthread usage in bpf-event.h. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8e03bb88ab8b60b52baafc4f909bddc1c2323cb5 Author: Ian Rogers Date: Fri Aug 26 09:42:28 2022 -0700 perf hist: Update use of pthread mutex Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 130f267af6e3e607f9101f2ec1d24d855cd3fb04 Author: Ian Rogers Date: Fri Aug 26 09:42:27 2022 -0700 perf tests: Avoid pthread.h inclusion pthread.h is being included for the side-effect of getting sched.h and macros like CPU_CLR. Switch to directly using sched.h, or if that is already present, just remove the pthread.h inclusion entirely. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a64d3af5d9eca3058ab6e0d3715ff36e4d6b5983 Author: Ian Rogers Date: Fri Aug 26 09:42:26 2022 -0700 perf bench: Update use of pthread mutex/cond Switch to the use of mutex wrappers that provide better error checking. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e57d897703c3bf8b66680c69c0e75fbd9d9617f1 Author: Pavithra Gurushankar Date: Fri Aug 26 09:42:25 2022 -0700 perf mutex: Wrapped usage of mutex and cond Added a new header file mutex.h that wraps the usage of pthread_mutex_t and pthread_cond_t. By abstracting these it is possible to introduce error checking. Signed-off-by: Pavithra Gurushankar Reviewed-by: Adrian Hunter Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andres Freund Cc: Andrii Nakryiko Cc: André Almeida Cc: Athira Jajeev Cc: Christophe JAILLET Cc: Colin Ian King Cc: Dario Petrillo Cc: Darren Hart Cc: Dave Marchevsky Cc: Davidlohr Bueso Cc: Fangrui Song Cc: Hewenliang Cc: Ingo Molnar Cc: James Clark Cc: Jason Wang Cc: Jiri Olsa Cc: Kajol Jain Cc: Kim Phillips Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tom Rix Cc: Weiguo Li Cc: Wenyu Liu Cc: William Cohen Cc: Zechuan Chen Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Cc: yaowenbin Link: https://lore.kernel.org/r/20220826164242.43412-2-irogers@google.com Signed-off-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo commit 6657a099e1858e4a39b501c38c16c6ef77c71a5a Author: Adrian Hunter Date: Wed Aug 24 10:28:14 2022 +0300 perf record: Allow multiple recording time ranges AUX area traces can produce too much data to record successfully or analyze subsequently. Add another means to reduce data collection by allowing multiple recording time ranges. This is useful, for instance, in cases where a workload produces predictably reproducible events in specific time ranges. Today we only have perf record -D to start at a specific region, or some complicated approach using snapshot mode and external scripts sending signals or using the fifos. But these approaches are difficult to set up compared with simply having perf do it. Extend perf record option -D/--delay option to specifying relative time stamps for start stop controlled by perf with the right time offset, for instance: perf record -e intel_pt// -D 10-20,30-40 to record 10ms to 20ms into the trace and 30ms to 40ms. Example: The example workload is: $ cat repeat-usleep.c int usleep(useconds_t usec); int usage(int ret, const char *msg) { if (msg) fprintf(stderr, "%s\n", msg); fprintf(stderr, "Usage is: repeat-usleep \n"); return ret; } int main(int argc, char *argv[]) { unsigned long usecs; char *end_ptr; if (argc != 2) return usage(1, "Error: Wrong number of arguments!"); errno = 0; usecs = strtoul(argv[1], &end_ptr, 0); if (errno || *end_ptr || usecs > UINT_MAX) return usage(1, "Error: Invalid argument!"); while (1) { int ret = usleep(usecs); if (ret & errno != EINTR) return usage(1, "Error: usleep() failed!"); } return 0; } $ perf record -e intel_pt//u --delay 10-20,40-70,110-160 -- ./repeat-usleep 500 Events disabled Events enabled Events disabled Events enabled Events disabled Events enabled Events disabled [ perf record: Woken up 5 times to write data ] [ perf record: Captured and wrote 0.204 MB perf.data ] Terminated A dlfilter is used to determine continuous data collection (timestamps less than 1ms apart): $ cat dlfilter-show-delays.c static __u64 start_time; static __u64 last_time; int start(void **data, void *ctx) { printf("%-17s\t%-9s\t%-6s\n", " Time", " Duration", " Delay"); return 0; } int filter_event_early(void *data, const struct perf_dlfilter_sample *sample, void *ctx) { __u64 delta; if (!sample->time) return 1; if (!last_time) goto out; delta = sample->time - last_time; if (delta < 1000000) goto out2;; printf("%17.9f\t%9.1f\t%6.1f\n", start_time / 1000000000.0, (last_time - start_time) / 1000000.0, delta / 1000000.0); out: start_time = sample->time; out2: last_time = sample->time; return 1; } int stop(void *data, void *ctx) { printf("%17.9f\t%9.1f\n", start_time / 1000000000.0, (last_time - start_time) / 1000000.0); return 0; } The result shows the times roughly match the --delay option: $ perf script --itrace=qb --dlfilter dlfilter-show-delays.so Time Duration Delay 39215.302317300 9.7 20.5 39215.332480217 30.4 40.9 39215.403837717 49.8 Signed-off-by: Adrian Hunter Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220824072814.16422-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 329725d5f6e139fbdb62a9f45d19fd62822ac3fc Author: Adrian Hunter Date: Wed Aug 24 10:28:13 2022 +0300 perf evlist: Add evlist__{en/dis}able_non_dummy() Dummy events are used to provide sideband information like MMAP events that are always needed even when main events are disabled. Add functions that take that into account. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220824072814.16422-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit feff0b61ffd831dbe4a7f28cfc8064b59c9f90c1 Author: Adrian Hunter Date: Wed Aug 24 10:28:12 2022 +0300 perf record: Change evlist->ctl_fd to use fdarray_flag__non_perf_event Patch "perf record: Fix way of handling non-perf-event pollfds" added a generic way to handle non-perf-event file descriptors like evlist->ctl_fd. Use it instead of handling evlist->ctl_fd separately. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220824072814.16422-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a032ad87aa3bcc6f90cb5771c4ed593844eecc1a Author: Adrian Hunter Date: Wed Aug 24 10:28:11 2022 +0300 perf record: Fix done_fd wakeup event evlist__add_wakeup_eventfd() calls perf_evlist__add_pollfd() to add a non-perf-event to the evlist pollfds. Since commit 415ccb58f68a ("perf record: Introduce thread specific data array") that doesn't work because evlist pollfs is not polled and done_fd is not duplicated into thread-data. Patch "perf record: Fix way of handling non-perf-event pollfds" added a new approach that ensures file descriptors like done_fd are handled correctly by flagging them as fdarray_flag__non_perf_event. Fix by flagging done_fd as fdarray_flag__non_perf_event. Example: Before: $ sleep 3 & perf record -vv -p $! ... thread_data[0x55f44bd34140]: pollfd[0] <- event_fd=5 thread_data[0x55f44bd34140]: pollfd[1] <- event_fd=6 thread_data[0x55f44bd34140]: pollfd[2] <- event_fd=7 thread_data[0x55f44bd34140]: pollfd[3] <- event_fd=8 thread_data[0x55f44bd34140]: pollfd[4] <- event_fd=9 thread_data[0x55f44bd34140]: pollfd[5] <- event_fd=10 thread_data[0x55f44bd34140]: pollfd[6] <- event_fd=11 thread_data[0x55f44bd34140]: pollfd[7] <- event_fd=12 ... After: $ sleep 3 & perf record -vv -p $! ... thread_data[0x55a8ded89140]: pollfd[0] <- event_fd=5 thread_data[0x55a8ded89140]: pollfd[1] <- event_fd=6 thread_data[0x55a8ded89140]: pollfd[2] <- event_fd=7 thread_data[0x55a8ded89140]: pollfd[3] <- event_fd=8 thread_data[0x55a8ded89140]: pollfd[4] <- event_fd=9 thread_data[0x55a8ded89140]: pollfd[5] <- event_fd=10 thread_data[0x55a8ded89140]: pollfd[6] <- event_fd=11 thread_data[0x55a8ded89140]: pollfd[7] <- event_fd=12 thread_data[0x55a8ded89140]: pollfd[8] <- non_perf_event fd=4 ... This patch depends on "perf record: Fix way of handling non-perf-event pollfds". Fixes: 415ccb58f68a6beb ("perf record: Introduce thread specific data array") Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220824072814.16422-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6562c9acb43ac69ba5a956b0c3911b883d90541f Author: Adrian Hunter Date: Wed Aug 24 10:28:10 2022 +0300 perf record: Fix way of handling non-perf-event pollfds perf record __cmd_record() does not poll evlist pollfds. Instead it polls thread_data[0].pollfd. That happens whether or not threads are being used. perf record duplicates evlist mmap pollfds as needed for separate threads. The non-perf-event represented by evlist->ctl_fd has to handled separately, which is done explicitly, duplicating it into the thread_data[0] pollfds. That approach neglects any other non-perf-event file descriptors. Currently there is also done_fd which needs the same handling. Add a new generalized approach. Add fdarray_flag__non_perf_event to identify the file descriptors that need the special handling. For those cases, also keep a mapping of the evlist pollfd index and thread pollfd index, so that the evlist revents can be updated. Although this patch adds the new handling, it does not take it into use. There is no functional change, but it is the precursor to a fix, so is marked as a fix. Fixes: 415ccb58f68a6beb ("perf record: Introduce thread specific data array") Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220824072814.16422-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit bdf4572555652074272d7dd1c694674efe60bea6 Author: Ian Rogers Date: Tue Aug 23 22:06:04 2022 -0700 perf hashmap: Tidy hashmap dependency When libbpf is present the build uses definitions in libbpf hashmap.c, however, libbpf's hashmap.h wasn't being used. Switch to using the correct hashmap.h dependent on the define HAVE_LIBBPF_SUPPORT. This was the original intent in: https://lore.kernel.org/lkml/20200515221732.44078-8-irogers@google.com/ Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20220824050604.352156-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 84f879c5331873a7b4036ff2f319d0f2fcf4179b Author: Xin Gao Date: Wed Aug 17 01:38:04 2022 +0800 perf metrics: Use 'unsigned int' instead of just 'unsigned'. 'unsigned int' should be clearer than 'unsigned'. Signed-off-by: Xin Gao Cc: Ian Rogers Cc: John Garry Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220816173804.7539-1-gaoxin@cdjrlc.com Signed-off-by: Arnaldo Carvalho de Melo commit f1417cea017dff2bbf2836bf67abd8e25e624411 Author: Xin Gao Date: Wed Aug 17 01:41:09 2022 +0800 perf parse-events: Use 'unsigned int' instead of plain 'unsigned'. 'unsigned int' should be clearer than 'unsigned'. Signed-off-by: Xin Gao Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220816174109.7718-1-gaoxin@cdjrlc.com Signed-off-by: Arnaldo Carvalho de Melo commit 74ef1cc9587870016f2a528c03634607b9d53093 Author: Roberto Sassu Date: Thu Aug 18 14:09:57 2022 +0200 tools build: Display logical OR of a feature flavors Sometimes, features are simply different flavors of another feature, to properly detect the exact dependencies needed by different Linux distributions. For example, libbfd has three flavors: libbfd if the distro does not require any additional dependency; libbfd-liberty if it requires libiberty; libbfd-liberty-z if it requires libiberty and libz. It might not be clear to the user whether a feature has been successfully detected or not, given that some of its flavors will be set to OFF, others to ON. Instead, display only the feature main flavor if not in verbose mode (VF != 1), and set it to ON if at least one of its flavors has been successfully detected (logical OR), OFF otherwise. Omit the other flavors. Accomplish that by declaring a FEATURE_GROUP_MEMBERS- variable, with the list of the other flavors as variable value. For now, do it just for libbfd. In verbose mode, of if no group is defined for a feature, show the feature detection result as before. Committer testing: Collecting the output from: $ make -C tools/bpf/bpftool/ clean $ make -C tools/bpf/bpftool/ |& grep "Auto-detecting system features" -A10 $ diff -u before after --- before 2022-08-18 10:06:40.422086966 -0300 +++ after 2022-08-18 10:07:59.202138282 -0300 @@ -1,6 +1,4 @@ Auto-detecting system features: ... libbfd: [ on ] -... libbfd-liberty: [ on ] -... libbfd-liberty-z: [ on ] ... libcap: [ on ] ... clang-bpf-co-re: [ on ] $ Signed-off-by: Roberto Sassu Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220818120957.319995-3-roberto.sassu@huaweicloud.com Signed-off-by: Arnaldo Carvalho de Melo commit 74da7697a2ab988e3889ba4db78992a0944ea83d Author: Roberto Sassu Date: Thu Aug 18 14:09:56 2022 +0200 tools build: Increment room for feature name in feature detection output Since now there are features with a long name, increase the room for them, so that fields are correctly aligned. Signed-off-by: Roberto Sassu Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220818120957.319995-2-roberto.sassu@huaweicloud.com Signed-off-by: Arnaldo Carvalho de Melo commit 709533e51b166d5a520589a03f0044ed304b33bd Author: Roberto Sassu Date: Thu Aug 18 14:09:55 2022 +0200 tools build: Fix feature detection output due to eval expansion As the first eval expansion is used only to generate Makefile statements, messages should not be displayed at this stage, as for example conditional expressions are not evaluated. It can be seen for example in the output of feature detection for bpftool, where the number of detected features does not change, despite turning on the verbose mode (VF = 1) and there are additional features to display. Fix this issue by escaping the $ before $(info) statements, to ensure that messages are printed only when the function containing them is actually executed, and not when it is expanded. In addition, move the $(info) statement out of feature_print_status, due to the fact that is called both inside and outside an eval context, and place it to the caller so that the $ can be escaped when necessary. For symmetry, move the $(info) statement also out of feature_print_text, and place it to the caller. Force the TMP variable evaluation in verbose mode, to display the features in FEATURE_TESTS that are not in FEATURE_DISPLAY. Reorder perf feature detection messages (first non-verbose, then verbose ones) by moving the call to feature_display_entries earlier, before the VF environment variable check. Also, remove the newline from that function, as perf might display additional messages. Move the newline to perf Makefile, and display another one if displaying the detection result is not deferred as in the case of bpftool. Committer testing: Collecting the output from: $ make VF=1 -C tools/bpf/bpftool/ |& grep "Auto-detecting system features" -A20 $ diff -u before after --- before 2022-08-18 09:59:55.460529231 -0300 +++ after 2022-08-18 10:01:11.182517282 -0300 @@ -4,3 +4,5 @@ ... libbfd-liberty-z: [ on ] ... libcap: [ on ] ... clang-bpf-co-re: [ on ] +... disassembler-four-args: [ on ] +... disassembler-init-styled: [ OFF ] $ Fixes: 0afc5cad387db560 ("perf build: Separate feature make support into config/Makefile.feature") Signed-off-by: Roberto Sassu Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: bpf@vger.kernel.org Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Link: https://lore.kernel.org/r/20220818120957.319995-1-roberto.sassu@huaweicloud.com Signed-off-by: Arnaldo Carvalho de Melo commit 8012243e62b5e13bded3ce8a3b69d28f8ea694fe Author: Raul Silvera Date: Mon Aug 15 22:59:22 2022 +0000 perf inject: Add a command line option to specify build ids. This commit adds the option --known-build-ids to perf inject. It allows the user to explicitly specify the build id for a given path, instead of retrieving it from the current system. This is useful in cases where a perf.data file is processed on a different system from where it was collected, or if some of the binaries are no longer available. The build ids and paths are specified in pairs in the command line. Using the file:// specifier, build ids can be loaded from a file directly generated by perf buildid-list. This is convenient to copy build ids from one perf.data file to another. ** Example: In this example we use perf record to create two perf.data files, one with build ids and another without, and use perf buildid-list and perf inject to copy the build ids from the first file to the second. $ perf record ls /tmp $ perf record --no-buildid -o perf.data.no-buildid ls /tmp $ perf buildid-list > build-ids.txt $ perf inject -b --known-build-ids='file://build-ids.txt' \ -i perf.data.no-buildid -o perf.data.buildid Signed-off-by: Raul Silvera Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220815225922.2118745-1-rsilvera@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 033d2d13a25113b6ffd24d72490f0e363dd3eb4c Author: Bird, Tim Date: Mon Oct 3 19:05:18 2022 +0000 spi: spi-gxp: fix typo in SPDX identifier line Use '-' instead of '=' in identifier: "GPL-2.0-or-later" Signed-off-by: Tim Bird Link: https://lore.kernel.org/r/BYAPR13MB2503FF6412666D29FEAC8DCDFD5B9@BYAPR13MB2503.namprd13.prod.outlook.com Signed-off-by: Mark Brown commit 82aad7ff7ac25c8cf09d491ae23b9823f1901486 Author: Peter Zijlstra Date: Tue Oct 4 12:20:39 2022 +0200 perf/hw_breakpoint: Annotate tsk->perf_event_mutex vs ctx->mutex Perf fuzzer gifted a lockdep splat: perf_event_init_context() mutex_lock(parent_ctx->mutex); (B) inherit_task_group() inherit_group() inherit_event() perf_event_alloc() perf_try_init_event() := hw_breakpoint_event_init() register_perf_hw_breakpoint() mutex_lock(child->perf_event_mutex); (A) Which is against the normal (documented) order. Now, this is a false positive in that child is not published yet, but also inherited events never end up on ->perf_event_list. Annotate this one away. Fixes: 0912037fec11 ("perf/hw_breakpoint: Reduce contention with large number of tasks") Signed-off-by: Peter Zijlstra (Intel) commit 7be51cc1c68dfa180ef84e71bcb4204237bb5620 Author: Peter Zijlstra Date: Tue Oct 4 11:03:47 2022 +0200 perf: Fix pmu_filter_match() Mark reported that the new for_each_sibling_event() assertion triggers in pmu_filter_match() -- which isn't always called with IRQs disabled or ctx->mutex held. Fixes: f3c0eba28704 ("perf: Add a few assertions") Reported-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YvvJq2f/7eFVcnNy@FVFF77S0Q05N commit 0ce38047e82a02017839b6cae837f13a1383a3a0 Author: Peter Zijlstra Date: Tue Oct 4 10:46:58 2022 +0200 perf: Fix lockdep_assert_event_ctx() I'm a flamin' moron; because even after Mark told me it should be '&&' I still got it wrong in the final commit. Fixes: f3c0eba28704 ("perf: Add a few assertions") Reported-by: Borislav Petkov Reported-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Tested-by: Borislav Petkov Link: https://lkml.kernel.org/r/YvvIWmDBWdIUCMZj@FVFF77S0Q05N commit e66372ecb80dc5179c7abb880229c7452e813d15 Author: Wang Kefeng Date: Tue Sep 13 05:25:52 2022 +0100 ARM: 9246/1: dump: show page table level name ARM could have 3 page table level if ARM_LPAE enabled, or only 2 page table level, let's show the page table level name when dump. Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit afd1efa1d80162cd48bacb3b848136249df28c62 Author: Wang Kefeng Date: Tue Sep 13 05:25:53 2022 +0100 ARM: 9245/1: dump: show FDT region Since commit 7a1be318f579 ("ARM: 9012/1: move device tree mapping out of linear region"), FDT is placed between the end of the vmalloc region and the start of the fixmap region, let's show it in dump. Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 823f606ab6b4759a1faf0388abcf4fb0776710d2 Author: Alex Sverdlin Date: Mon Sep 5 16:26:59 2022 +0100 ARM: 9242/1: kasan: Only map modules if CONFIG_KASAN_VMALLOC=n In case CONFIG_KASAN_VMALLOC=y kasan_populate_vmalloc() allocates the shadow pages dynamically. But even worse is that kasan_release_vmalloc() releases them, which is not compatible with create_mapping() of MODULES_VADDR..MODULES_END range: BUG: Bad page state in process kworker/9:1 pfn:2068b page:e5e06160 refcount:0 mapcount:0 mapping:00000000 index:0x0 flags: 0x1000(reserved) raw: 00001000 e5e06164 e5e06164 00000000 00000000 00000000 ffffffff 00000000 page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set bad because of flags: 0x1000(reserved) Modules linked in: ip_tables CPU: 9 PID: 154 Comm: kworker/9:1 Not tainted 5.4.188-... #1 Hardware name: LSI Axxia AXM55XX Workqueue: events do_free_init unwind_backtrace show_stack dump_stack bad_page free_pcp_prepare free_unref_page kasan_depopulate_vmalloc_pte __apply_to_page_range apply_to_existing_page_range kasan_release_vmalloc __purge_vmap_area_lazy _vm_unmap_aliases.part.0 __vunmap do_free_init process_one_work worker_thread kthread Reviewed-by: Linus Walleij Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King (Oracle) commit 8770b9e575ce5727b4f95b6bcb086247dcce4eb3 Author: Linus Walleij Date: Wed Aug 31 13:28:02 2022 +0100 ARM: 9240/1: dma-mapping: Pass (void *) to virt_to_page() Pointers to virtual memory functions are (void *) but the __dma_update_pte() function is passing an unsigned long. Fix this up by explicit cast. Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 752ec621ef5c30777958cc5eb5f1cf394f7733f4 Author: Li Huafei Date: Fri Aug 26 09:08:46 2022 +0100 ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value Because an exception stack frame is not created in the exception entry, save_trace() does special handling for the exception PC, but this is only needed when CONFIG_FRAME_POINTER_UNWIND=y. When CONFIG_ARM_UNWIND=y, unwind annotations have been added to the exception entry and save_trace() will repeatedly save the exception PC: [0x7f000090] hrtimer_hander+0x8/0x10 [hrtimer] [0x8019ec50] __hrtimer_run_queues+0x18c/0x394 [0x8019f760] hrtimer_run_queues+0xbc/0xd0 [0x8019def0] update_process_times+0x34/0x80 [0x801ad2a4] tick_periodic+0x48/0xd0 [0x801ad3dc] tick_handle_periodic+0x1c/0x7c [0x8010f2e0] twd_handler+0x30/0x40 [0x80177620] handle_percpu_devid_irq+0xa0/0x23c [0x801718d0] generic_handle_domain_irq+0x24/0x34 [0x80502d28] gic_handle_irq+0x74/0x88 [0x8085817c] generic_handle_arch_irq+0x58/0x78 [0x80100ba8] __irq_svc+0x88/0xc8 [0x80108114] arch_cpu_idle+0x38/0x3c [0x80108114] arch_cpu_idle+0x38/0x3c <==== duplicate saved exception PC [0x80861bf8] default_idle_call+0x38/0x130 [0x8015d5cc] do_idle+0x150/0x214 [0x8015d978] cpu_startup_entry+0x18/0x1c [0x808589c0] rest_init+0xd8/0xdc [0x80c00a44] arch_post_acpi_subsys_init+0x0/0x8 We can move the special handling of the exception PC in save_trace() to the unwind_frame() of the frame pointer unwinder. Signed-off-by: Li Huafei Reviewed-by: Linus Waleij Signed-off-by: Russell King (Oracle) commit 5854e4d8530e6ed4c2532a71a6b0474e199d44dd Author: Li Huafei Date: Fri Aug 26 09:06:22 2022 +0100 ARM: 9233/1: stacktrace: Skip frame pointer boundary check for call_with_stack() When using the frame pointer unwinder, it was found that the stack trace output of stack_trace_save() is incomplete if the stack contains call_with_stack(): [0x7f00002c] dump_stack_task+0x2c/0x90 [hrtimer] [0x7f0000a0] hrtimer_hander+0x10/0x18 [hrtimer] [0x801a67f0] __hrtimer_run_queues+0x1b0/0x3b4 [0x801a7350] hrtimer_run_queues+0xc4/0xd8 [0x801a597c] update_process_times+0x3c/0x88 [0x801b5a98] tick_periodic+0x50/0xd8 [0x801b5bf4] tick_handle_periodic+0x24/0x84 [0x8010ffc4] twd_handler+0x38/0x48 [0x8017d220] handle_percpu_devid_irq+0xa8/0x244 [0x80176e9c] generic_handle_domain_irq+0x2c/0x3c [0x8052e3a8] gic_handle_irq+0x7c/0x90 [0x808ab15c] generic_handle_arch_irq+0x60/0x80 [0x8051191c] call_with_stack+0x1c/0x20 For the frame pointer unwinder, unwind_frame() checks stackframe::fp by stackframe::sp. Since call_with_stack() switches the SP from one stack to another, stackframe::fp and stackframe: :sp will point to different stacks, so we can no longer check stackframe::fp by stackframe::sp. Skip checking stackframe::fp at this point to avoid this problem. Signed-off-by: Li Huafei Reviewed-by: Linus Waleij Signed-off-by: Russell King (Oracle) commit 36de4f94197318e45ba77badb5b07274f5bc72a9 Merge: 94ec234a16cf3 732d69c80cb04 Author: Thomas Gleixner Date: Tue Oct 4 11:35:20 2022 +0200 Merge tag 'irqchip-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - A new driver for the FSL MU widget that provides platform MSI - An update for the Realtek RTL irqchip to use a DT binding that actually describes the hardware - A handful of DT updates, as well as minor code and spelling fixes Link: https://lore.kernel.org/r/20221002125554.3902840-1-maz@kernel.org commit e19d4ebc536dadb607fe305fdaf48218d3e32d7c Author: Arnd Bergmann Date: Mon Oct 3 13:12:54 2022 +0200 alpha: add full ioread64/iowrite64 implementation The previous patch introduced ioread64/iowrite64 declarations, but this means we no longer get the io-64-nonatomic variant, and run into a long error when someone actually wants to use these: ERROR: modpost: "ioread64" [drivers/net/ethernet/freescale/enetc/fsl-enetc.ko] undefined! Add the (hopefully) correct implementation for each machine type, based on the 32-bit accessor. Since the 32-bit return type does not work for ioread64(), change the internal implementation to use the correct width consistently, but leave the external interface to match the asm-generic/iomap.h header that uses 32-bit or 64-bit return values. Reported-by: Guenter Roeck Tested-by: Guenter Roeck Reviewed-by: Linus Walleij Fixes: 7e772dad9913 ("alpha: Use generic ") Signed-off-by: Arnd Bergmann commit 6cb5ce13357de06d376d300778eee2009f53d8cb Merge: cceeeb6a6d02e af246cc6d0ed1 Author: Thomas Gleixner Date: Tue Oct 4 11:22:43 2022 +0200 Merge tag 'timers-v6.1-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clocksource/event updates from Daniel Lezcano: - Added DT bindings for Mediatek MT8188 (Johnson Wang) - Added DT bindings for Renesas r8a779f0 (Wolfram Sang) - Added support for RZ/V2L SoC (Lad Prabhakar) - Rename TIMER_IRQ_EN to TIMER_IRQ_CLEAR to prevent confusion on sun4i (Victor Hassan) - Added support for Exynos ARTPEC-8 MCT, including DT bindings (Vincent Whitchurch) - Fixed handling of ARM erratum 858921 on the ARM Arch timer (Kunkun Jiang) - Added missing call platform_device_put() in the error path on ther GXP timer (Lin Yujun) - Cleaned the timer TI DM driver by self-encapsulating the code, dropping dead code and simplifying some functions (Tony Lindgren) - Added a DT property to tell the driver the clock is no longer divided on recent NXP hardware (Peng Fan) - Fixed the CNTPCT_LO and CNTVCT_LO values in the ARM arch timer (Yang Guo) Link: https://lore.kernel.org/r/b28ac4b0-5745-b3a9-b7e7-cc86dcb1b023@linaro.org commit b0c883e900702f408d62cf92b0ef01303ed69be9 Author: Vincent Knecht Date: Thu Aug 11 12:50:14 2022 +0200 thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id Reading temperature from this sensor fails with 'Invalid argument'. Looking at old vendor dts [1], its hw_id should be 3 instead of 4. Change this hw_id accordingly. [1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/master/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L511 Fixes: 332bc8ebab2c ("thermal: qcom: tsens-v0_1: Add support for MSM8939") Signed-off-by: Vincent Knecht Reviewed-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20220811105014.7194-1-vincent.knecht@mailoo.org Signed-off-by: Daniel Lezcano commit 597f500fde76e129b51a5719da9e3df84acfb939 Author: Lad Prabhakar Date: Thu Sep 8 18:46:10 2022 +0100 thermal/core: Add a check before calling set_trip_temp() The thermal driver [0] for Renesas RZ/G2L SoC does not implement set_trip_temp() callback but has trips commit 9326167058e8 ("thermal/core: Move set_trip_temp ops to the sysfs code") changed the behaviour which causes the below panic when trying to set the trip temperature: root@smarc-rzg2l:~# echo 51000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp [ 92.461521] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 92.470958] Mem abort info: [ 92.474311] ESR = 0x0000000086000004 [ 92.478546] EC = 0x21: IABT (current EL), IL = 32 bits [ 92.484290] SET = 0, FnV = 0 [ 92.487693] EA = 0, S1PTW = 0 [ 92.491153] FSC = 0x04: level 0 translation fault [ 92.496461] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004e885000 [ 92.503736] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000 [ 92.510869] Internal error: Oops: 86000004 [#3] PREEMPT SMP [ 92.516556] CPU: 0 PID: 290 Comm: sh Tainted: G D 6.0.0-rc4-next-20220906-arm64-renesas-00124-g84633c87c5f6-dirty #509 [ 92.528814] Hardware name: Renesas SMARC EVK based on r9a07g044l2 (DT) [ 92.535441] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 92.542516] pc : 0x0 [ 92.544764] lr : trip_point_temp_store+0x84/0x140 [ 92.549582] sp : ffff80000a92bc10 [ 92.552961] x29: ffff80000a92bc10 x28: ffff00000d8a45c0 x27: 0000000000000000 [ 92.560249] x26: 0000000000000000 x25: ffff8000082b53e8 x24: ffff00000eaffc20 [ 92.567532] x23: ffff80000a92bd68 x22: ffff00000d3e0f80 x21: 0000000000000006 [ 92.574814] x20: ffff800009149000 x19: ffff00000b8ab000 x18: 0000000000000000 [ 92.582097] x17: 0000000000000000 x16: 0000000000000000 x15: 0000aaab028cdee0 [ 92.589378] x14: 0000000000000000 x13: 0000000000000000 x12: ffff80000a92bbd0 [ 92.596659] x11: ffff00000d3e0f80 x10: ffff800009149eb8 x9 : 000000000000000a [ 92.603940] x8 : 00000000ffffffc9 x7 : 0000000000000005 x6 : 000000000000002a [ 92.611220] x5 : 000000000000c738 x4 : 00000000ffffffd3 x3 : 0000000000000000 [ 92.618500] x2 : 000000000000c738 x1 : 0000000000000000 x0 : ffff00000b8ab000 [ 92.625781] Call trace: [ 92.628282] 0x0 [ 92.630176] dev_attr_store+0x14/0x28 [ 92.633935] sysfs_kf_write+0x4c/0x70 [ 92.637681] kernfs_fop_write_iter+0x160/0x1e0 [ 92.642213] vfs_write+0x474/0x540 [ 92.645703] ksys_write+0x68/0xf8 [ 92.649100] __arm64_sys_write+0x18/0x20 [ 92.653111] invoke_syscall+0x40/0xf8 [ 92.656866] el0_svc_common.constprop.3+0x88/0x110 [ 92.661758] do_el0_svc+0x20/0x78 [ 92.665158] el0_svc+0x3c/0x90 [ 92.668291] el0t_64_sync_handler+0x90/0xb8 [ 92.672563] el0t_64_sync+0x148/0x14c [ 92.676322] Code: bad PC value [ 92.679453] ---[ end trace 0000000000000000 ]--- /bin/start_getty: line 40: 290 Segmentation fault ${setsid:-} ${getty} -L $1 $2 $3 Poky (Yocto Project Reference Distro) 3.2.1 smarc-rzg2l ttySC0 smarc-rzg2l login: This patch fixes the above issue by adding a check to see if set_trip_temp() callback is implemented before calling it. [0] drivers/thermal/rzg2l_thermal.c Fixes: 9326167058e8 ("thermal/core: Move set_trip_temp ops to the sysfs code") Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220908174610.7837-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit c71d8035f1b77dc8e29e41942ab31900fa79c1ae Author: Lad Prabhakar Date: Fri Sep 9 19:13:22 2022 +0100 thermal/core: Drop valid pointer check for type Drop the valid pointer check for type in thermal_zone_device_register_with_trips() as we already have it confirmed for != NULL from the previous if block. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220909181322.10933-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit c7114365e3b7566cba86902123538c7d9bb62b7a Author: Lad Prabhakar Date: Fri Sep 9 19:28:38 2022 +0100 thermal/drivers/rcar_thermal: Constify static thermal_zone_device_ops The only usage of rcar_thermal_zone_of_ops is to pass its address to devm_thermal_of_zone_register(), which takes a pointer to const struct thermal_zone_device_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Lad Prabhakar Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20220909182838.11154-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit 34dc523bba724f2ec1f29328dadc7f4609cae645 Author: Jonathan Cameron Date: Sun Aug 21 17:00:32 2022 +0100 thermal/drivers/qcom: Drop false build dependency of all QCOM drivers on QCOM_TSENS The SPMI QCOM drivers have no dependency in Kconfig, but the Makefile will not be included without QCOM_TSENS. This unnecessarily reduces build coverage. Signed-off-by: Jonathan Cameron Cc: Dmitry Baryshkov Cc: Bhupesh Sharma Acked-by: Amit Kucheria Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220821160032.2206349-1-jic23@kernel.org Signed-off-by: Daniel Lezcano commit 5d10f480f77b67332e4835ad565bfe4cb8528159 Author: Daniel Lezcano Date: Thu Aug 18 10:23:16 2022 +0200 thermal/of: Remove the thermal_zone_of_get_sensor_id() function The function thermal_zone_of_get_sensor_id() is no longer used anywhere, remove it. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220818082316.2717095-2-daniel.lezcano@linaro.org commit 31fd4b9db13b1877b20426e79ac7fec606587872 Author: Daniel Lezcano Date: Thu Aug 18 10:23:15 2022 +0200 thermal/drivers/imx_sc: Rely on the platform data to get the resource id Currently the imx_sc driver is reimplementing part of the thermal zone parsing from the thermal OF tree code to get the sensor id associated with a thermal zone sensor. The driver platform specific code should know what sensor is present and not rely on the thermal zone description to do a discovery. Well that is arguable but all the other drivers have a per platform data telling what sensor id to use. The imx_sc thermal driver is the only one using a different approach. Not invalid but forcing to keep a specific function 'thermal_zone_of_get_sensor_id()' to get the sensor id for a specific thermal zone as the self-explanatory function tells and having device tree code inside the driver. The thermal OF code had a rework and remains now self-encapsulated with a register/unregister functions and their 'devm' variants, except for the function mentioned above. After investigating, it appears the imx_sc sensor is defined in arch/arm64/boot/dts/freescale/imx8qxp.dtsi: which defines the cpu-thermal zone with the id: IMX_SC_R_SYSTEM This dtsi is included by: - imx8qxp-ai_ml.dts - imx8qxp-colibri.dtsi - imx8qxp-mek.dts The two first ones do not define more thermal zones The third one adds the pmic-thermal0 zone with id: IMX_SC_R_PMIC_0 The thermal OF code returns -ENODEV if the thermal zone registration with a specific id fails because the description is not available in the DT for such a sensor id. In this case we continue with the other ids without bailing out with an error. So we can build for the 'fsl,imx-sc-thermal' a compatible data, an array of sensor ids containing IMX_SC_R_SYSTEM and IMX_SC_R_PMIC_0. The latter won't be found but that will not result in an error but a normal case where we continue the initialization with other ids. Just to clarify, it is what the thermal framework does and what the other drivers are expecting: when a registration fails with -ENODEV this is not an error but a case where the description is not found in the device tree, that be can the entire thermal zones description or a specific thermal zone with an unknown id. There is one small functional change but without impact. When there is no 'thermal-zones' description the probe function was returning '-ENODEV', now it returns zero. When a thermal zone fails to register with an error different from '-ENODEV', the error is detected and returned. Change the code accordingly and remove the OF code from the driver. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220818082316.2717095-1-daniel.lezcano@linaro.org commit ba99b756da178aa8c608c4499a91074466050c10 Author: Jianlong Huang Date: Fri Sep 30 14:14:04 2022 +0800 pinctrl: starfive: Rename "pinctrl-starfive" to "pinctrl-starfive-jh7100" Add the SoC name to make it more clear. Also the next generation StarFive SoCs will use "pinctrl-starfive" as the core of StarFive pinctrl driver. No functional change. Signed-off-by: Jianlong Huang Signed-off-by: Hal Feng Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220930061404.5418-1-hal.feng@linux.starfivetech.com Signed-off-by: Linus Walleij commit ba7fdf88e98acadc00c56e1272d022564f7ac721 Author: Jianlong Huang Date: Fri Sep 30 14:08:19 2022 +0800 pinctrl: Create subdirectory for StarFive drivers Move the StarFive JH7100 pinctrl driver to a new subdirectory in preparation for adding more StarFive pinctrl drivers. No functional change. Signed-off-by: Jianlong Huang Signed-off-by: Hal Feng Link: https://lore.kernel.org/r/20220930060819.5320-1-hal.feng@linux.starfivetech.com Signed-off-by: Linus Walleij commit 5197b707d68ad75a165db743ac1151ea3407c1eb Author: Marek Vasut Date: Mon Sep 26 22:47:52 2022 +0200 dt-bindings: pinctrl: st,stm32: Document interrupt-controller property Document interrupt-controller property and its interrupt-cells. This fixes dtbs_check warnings when building current Linux DTs: " arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dtb: pinctrl@50002000: gpio@5000a000: '#interrupt-cells', 'interrupt-controller' do not match any of the regexes: 'pinctrl-[0-9]+' " Signed-off-by: Marek Vasut Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220926204752.381798-1-marex@denx.de Signed-off-by: Linus Walleij commit 140bb02315e78923dc0ecd7d3c7f021c0167a817 Author: Marek Vasut Date: Mon Sep 26 22:47:35 2022 +0200 dt-bindings: pinctrl: st,stm32: Document gpio-hog pattern property Document gpio-hog pattern property and its subnodes. This fixes dtbs_check warnings when building current Linux DTs: " arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dtb: pinctrl@50002000: gpio@50003000: 'rs485-rx-en-hog' does not match any of the regexes: 'pinctrl-[0-9]+' " Signed-off-by: Marek Vasut Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220926204735.381779-1-marex@denx.de Signed-off-by: Linus Walleij commit 448921706bdd1758ac63c07185c5a4713278d6f8 Author: Marek Vasut Date: Mon Sep 26 22:47:24 2022 +0200 dt-bindings: pinctrl: st,stm32: Document gpio-line-names Document gpio-line-names property as valid property. This fixes dtbs_check warnings when building current Linux DTs: " arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dtb: pinctrl@50002000: gpio@50009000: 'gpio-line-names' does not match any of the regexes: 'pinctrl-[0-9]+' " Signed-off-by: Marek Vasut Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220926204724.381760-1-marex@denx.de Signed-off-by: Linus Walleij commit c257795609e9c9f063c92a6c7ea2e798417700c4 Merge: 7a14a11f93dfb d3923513edd7f Author: Borislav Petkov Date: Tue Oct 4 10:00:25 2022 +0200 Merge branches 'edac-drivers' and 'edac-misc' into edac-updates-for-v6.1 Combine all queued EDAC changes for submission into v6.1: * edac-drivers: EDAC/ie31200: Add Skylake-S support * edac-misc: EDAC/i7300: Correct the i7300_exit() function name in comment x86/sb_edac: Add row column translation for Broadwell EDAC/i10nm: Print an extra register set of retry_rd_err_log EDAC/i10nm: Retrieve and print retry_rd_err_log registers for HBM EDAC/skx_common: Add ChipSelect ADXL component EDAC/ppc_4xx: Reorder symbols to get rid of a few forward declarations EDAC: Remove obsolete declarations in edac_module.h EDAC/i10nm: Add driver decoder for Ice Lake and Tremont CPUs EDAC/skx_common: Make output format similar EDAC/skx_common: Use driver decoder first EDAC/mc: Drop duplicated dimm->nr_pages debug printout EDAC/mc: Replace spaces with tabs in memtype flags definition EDAC/wq: Remove unneeded flush_workqueue() Signed-off-by: Borislav Petkov commit e75729b2f63fbdbf776930de8b0eee0d43a68be6 Author: Dmitry Torokhov Date: Wed Sep 28 13:20:18 2022 -0700 pinctrl: st: stop abusing of_get_named_gpio() Pin descriptions for this chip only look like standard GPIO device tree descriptions, while in fact they contain additional data (in excess of number of cells specified in description of gpio controllers). They also refer to only pins/gpios belonging to the driver and not to arbitrary gpio in the system. Because we want to stop exporting OF-specific handlers from gpiolib-of, let's parse the pin reference ourself instead of trying to call of_get_named_gpio(). Signed-off-by: Dmitry Torokhov Tested-by: Patrice Chotard Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/YzSsgoVoJn4+mSpv@google.com Signed-off-by: Linus Walleij commit f4a31facfa80df2f440a2fdc2b7f58d6c23925b0 Author: Andy Shevchenko Date: Tue Sep 27 20:55:09 2022 +0300 pinctrl: wpcm450: Correct the fwnode_irq_get() return value check fwnode_irq_get() can return zero to indicate IRQ mapping errors. Handle this case by skipping the interrupt resource. Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Signed-off-by: Andy Shevchenko Reviewed-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220927175509.15695-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 66db794ad54ce49d4fd564a16f682f257f608655 Author: Yuan Can Date: Tue Sep 27 13:39:26 2022 +0000 pinctrl: bcm: Remove unused struct bcm6328_pingroup After commit 0e3db16300fb("pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP()"), no one use struct bcm6328_pingroup, so remove it. Signed-off-by: Yuan Can Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220927133926.103943-1-yuancan@huawei.com Signed-off-by: Linus Walleij commit 203672e1208c2f36ff31a305f6a70d73d9dbce63 Author: Krzysztof Kozlowski Date: Sun Sep 25 13:21:03 2022 +0200 pinctrl: qcom: restrict drivers per ARM/ARM64 There is no point to allow selecting pin-controller drivers for Qualcomm ARMv7 SoCs when building ARM64 kernel, and vice versa. This makes kernel configuration more difficult as many do not remember the Qualcomm SoCs. There won't be a single image for ARMv7 and ARMv8/9 SoCs, so no features/options are lost. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220925112103.148836-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 19fdcb1d98a6adcab27db4cc0d111fcba0f7bd8f Author: Shang XiaoJing Date: Fri Sep 23 18:10:38 2022 +0800 pinctrl: bcm: ns: Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Acked-by: Florian Fainelli Acked-by: Ray Jui Link: https://lore.kernel.org/r/20220923101038.18036-1-shangxiaojing@huawei.com Signed-off-by: Linus Walleij commit 8ea8af6c8469156ac2042d83d73f6b74eb4b4b45 Author: Quentin Schulz Date: Fri Sep 30 15:20:33 2022 +0200 gpio: rockchip: request GPIO mux to pinctrl when setting direction Before the split of gpio and pinctrl sections in their own driver, rockchip_set_mux was called in pinmux_ops.gpio_set_direction for configuring a pin in its GPIO function. This is essential for cases where pinctrl is "bypassed" by gpio consumers otherwise the GPIO function is not configured for the pin and it does not work. Such was the case for the sysfs/libgpiod userspace GPIO handling. Let's call pinctrl_gpio_direction_input/output when setting the direction of a GPIO so that the pinctrl core requests from the rockchip pinctrl driver to put the pin in its GPIO function. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio") Cc: stable@vger.kernel.org Reviewed-by: Heiko Stuebner Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220930132033.4003377-3-foss+kernel@0leil.net Signed-off-by: Linus Walleij commit 4635c0e2a7f7f3568cbfccae70121f9835efa62c Author: Quentin Schulz Date: Fri Sep 30 15:20:32 2022 +0200 pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback Before the split of gpio and pinctrl sections in their own driver, rockchip_set_mux was called in pinmux_ops.gpio_set_direction for configuring a pin in its GPIO function. This is essential for cases where pinctrl is "bypassed" by gpio consumers otherwise the GPIO function is not configured for the pin and it does not work. Such was the case for the sysfs/libgpiod userspace GPIO handling. Let's re-implement the pinmux_ops.gpio_set_direction callback so that the gpio subsystem can request from the pinctrl driver to put the pin in its GPIO function. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Cc: stable@vger.kernel.org Reviewed-by: Heiko Stuebner Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220930132033.4003377-2-foss+kernel@0leil.net Signed-off-by: Linus Walleij commit e033f40be262c4d227f8fbde52856e1d8646872b Author: Darrick J. Wong Date: Tue Oct 4 16:40:01 2022 +1100 xfs: on memory failure, only shut down fs after scanning all mappings xfs_dax_failure_fn is used to scan the filesystem during a memory failure event to look for memory mappings to revoke. Unfortunately, if it encounters an rmap record for filesystem metadata, it will shut down the filesystem and the scan immediately. This means that we don't complete the mapping revocation scan and instead leave live mappings to failed memory. Fix the function to defer the shutdown until after we've finished culling mappings. While we're at it, add the usual "xfs_" prefix to struct failure_info, and actually initialize mf_flags. Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit c098576f5f63bc0ee2424bba50892514a71d54e8 Author: Shida Zhang Date: Tue Oct 4 16:39:58 2022 +1100 xfs: rearrange the logic and remove the broken comment for xfs_dir2_isxx xfs_dir2_isleaf is used to see if the directory is a single-leaf form directory instead, as commented right above the function. Besides getting rid of the broken comment, we rearrange the logic by converting everything over to standard formatting and conventions, at the same time, to make it easier to understand and self documenting. Signed-off-by: Shida Zhang Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 44159659df8ca381b84261e11058b2176fa03ba0 Author: Shida Zhang Date: Tue Oct 4 16:39:42 2022 +1100 xfs: trim the mapp array accordingly in xfs_da_grow_inode_int Take a look at the for-loop in xfs_da_grow_inode_int: ====== for(){ nmap = min(XFS_BMAP_MAX_NMAP, count); ... error = xfs_bmapi_write(...,&mapp[mapi], &nmap);//(..., $1, $2) ... mapi += nmap; } ===== where $1 stands for the start address of the array, while $2 is used to indicate the size of the array. The array $1 will advance by $nmap in each iteration after the allocation of extents. But the size $2 still remains unchanged, which is determined by min(XFS_BMAP_MAX_NMAP, count). It seems that it has forgotten to trim the mapp array after each iteration, so change it. Signed-off-by: Shida Zhang Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 681bf011b9b5989c6e9db6beb64494918aab9a43 Author: Jakub Kicinski Date: Mon Oct 3 21:03:27 2022 -0700 eth: pse: add missing static inlines build bot reports missing 'static inline' qualifiers in the header. Reported-by: kernel test robot Fixes: 18ff0bcda6d1 ("ethtool: add interface to interact with Ethernet Power Equipment") Reviewed-by: Oleksij Rempel Link: https://lore.kernel.org/r/20221004040327.2034878-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit c3db5128e80e1437cb08d0d41aeb7163004897e7 Author: Christian Marangi Date: Wed Sep 14 16:47:43 2022 +0200 clk: qcom: kpss-xcc: convert to parent data API Convert the driver to parent data API. From the Documentation pll8_vote and pxo should be declared in the DTS so fw_name can be used instead of parent_names. .name is changed to the legacy pxo_board following how it's declared in other drivers. Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20220914144743.17369-2-ansuelsmth@gmail.com Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephen Boyd commit d7915651fe9a6474e06161c34c637e6aeb811e9d Author: Christian Marangi Date: Wed Sep 14 16:47:42 2022 +0200 clk: introduce (devm_)hw_register_mux_parent_data_table API Introduce (devm_)hw_register_mux_parent_data_table new API. We have basic support for clk_register_mux using parent_data but we lack any API to provide a custom parent_map. Add these 2 new API to correctly handle these special configuration instead of using the generic __(devm_)clk_hw_register_mux API. Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20220914144743.17369-1-ansuelsmth@gmail.com Signed-off-by: Stephen Boyd commit 8f2fcac809be13c433ae188f0e9f3f05755326c5 Merge: 568035b01cfb1 994c77ed371e4 Author: Stephen Boyd Date: Mon Oct 3 20:48:41 2022 -0700 Merge tag 'qcom-clk-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull Qualcomm clk driver updates from Bjorn Andersson: This introduces display clock controllers are introduces for SM6115 and SM8450, and SC8280XP gains a GPU clock controller. MSM8909 and SM6375 gains global and SMD RPM clock controller drivers. The handling of GDSCs with PWRSTS_RET was fixed, to keep the GDSC on while powering down the parent supply. This solved retention issues during suspend of USB on sc7180/7280 and SC8280XP. SM6115 and QCM2260 are moved to reuse PLL configuration. SDM660 SDCC1 was moved to floor ops. Support for the APCS PLLs for IPQ8064, IPQ8074 and IPQ6018 was added/fixed. The MSM8996 CPU clocks was updated, with support for ACD clocks added. Support for SDM670 was added to the SDM845 Glbal clock controller and the RPMh clock controller driver. Transition to parent_data, parent_hws and use of ARRAY_SIZE() for num_parents was done for MSM8660, MSM8916, MSM8939, MSM8960 global clock controllers, IPQ8064 LPASS clock controller and MSM8960 multimedia clock controller. Support for per-reset defined delay of was introduced. * tag 'qcom-clk-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (93 commits) clk: qcom: gcc-msm8939: use ARRAY_SIZE instead of specifying num_parents clk: qcom: gcc-msm8939: use parent_hws where possible dt-bindings: clock: move qcom,gcc-msm8939 to qcom,gcc-msm8916.yaml clk: qcom: gcc-sm6350: Update the .pwrsts for usb gdscs clk: qcom: gcc-sc8280xp: use retention for USB power domains clk: qcom: gdsc: add missing error handling dt-bindings: clocks: qcom,gcc-sc8280xp: Fix typos clk: qcom: Add global clock controller driver for SM6375 dt-bindings: clock: add SM6375 QCOM global clock bindings clk: qcom: alpha: Add support for programming the PLL_FSM_LEGACY_MODE bit clk: qcom: gcc-sc7280: Update the .pwrsts for usb gdscs clk: qcom: gcc-sc7180: Update the .pwrsts for usb gdsc clk: qcom: gdsc: Fix the handling of PWRSTS_RET support clk: qcom: Add SC8280XP GPU clock controller dt-bindings: clock: Add Qualcomm SC8280XP GPU binding clk: qcom: smd: Add SM6375 clocks dt-bindings: clock: qcom: rpmcc: Add BIMC_FREQ_LOG dt-bindings: clock: qcom,rpmcc: Add compatible for SM6375 clk: qcom: rpmhcc: add sdm670 clocks dt-bindings: clock: add rpmhcc bindings for sdm670 ... commit 725737e7c21d2d25a4312c2aaa82a52bd03e3126 Merge: 5779aa2dac9a8 61a223df421f6 Author: Linus Torvalds Date: Mon Oct 3 20:33:41 2022 -0700 Merge tag 'statx-dioalign-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux Pull STATX_DIOALIGN support from Eric Biggers: "Make statx() support reporting direct I/O (DIO) alignment information. This provides a generic interface for userspace programs to determine whether a file supports DIO, and if so with what alignment restrictions. Specifically, STATX_DIOALIGN works on block devices, and on regular files when their containing filesystem has implemented support. An interface like this has been requested for years, since the conditions for when DIO is supported in Linux have gotten increasingly complex over time. Today, DIO support and alignment requirements can be affected by various filesystem features such as multi-device support, data journalling, inline data, encryption, verity, compression, checkpoint disabling, log-structured mode, etc. Further complicating things, Linux v6.0 relaxed the traditional rule of DIO needing to be aligned to the block device's logical block size; now user buffers (but not file offsets) only need to be aligned to the DMA alignment. The approach of uplifting the XFS specific ioctl XFS_IOC_DIOINFO was discarded in favor of creating a clean new interface with statx(). For more information, see the individual commits and the man page update[1]" Link: https://lore.kernel.org/r/20220722074229.148925-1-ebiggers@kernel.org [1] * tag 'statx-dioalign-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: xfs: support STATX_DIOALIGN f2fs: support STATX_DIOALIGN f2fs: simplify f2fs_force_buffered_io() f2fs: move f2fs_force_buffered_io() into file.c ext4: support STATX_DIOALIGN fscrypt: change fscrypt_dio_supported() to prepare for STATX_DIOALIGN vfs: support STATX_DIOALIGN on block devices statx: add direct I/O alignment information commit 5779aa2dac9a8dcad89b3774ee354de8b453ab21 Merge: 438b2cdd17a6c 8377e8a24bba1 Author: Linus Torvalds Date: Mon Oct 3 20:27:34 2022 -0700 Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fsverity updates from Eric Biggers: "Minor changes to convert uses of kmap() to kmap_local_page()" * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fs-verity: use kmap_local_page() instead of kmap() fs-verity: use memcpy_from_page() commit 438b2cdd17a6c9df607f574bd13b6b637795a411 Merge: f4309528f3dec 0e91fc1e0f5c7 Author: Linus Torvalds Date: Mon Oct 3 20:18:34 2022 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt updates from Eric Biggers: "This release contains some implementation changes, but no new features: - Rework the implementation of the fscrypt filesystem-level keyring to not be as tightly coupled to the keyrings subsystem. This resolves several issues. - Eliminate most direct uses of struct request_queue from fs/crypto/, since struct request_queue is considered to be a block layer implementation detail. - Stop using the PG_error flag to track decryption failures. This is a prerequisite for freeing up PG_error for other uses" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: work on block_devices instead of request_queues fscrypt: stop holding extra request_queue references fscrypt: stop using keyrings subsystem for fscrypt_master_key fscrypt: stop using PG_error to track error status fscrypt: remove fscrypt_set_test_dummy_encryption() commit f4309528f3dec3ead08cd4bd09e0e5fe081ab9f9 Merge: f90497a16e434 3b7610302a75f Author: Linus Torvalds Date: Mon Oct 3 20:11:59 2022 -0700 Merge tag 'dlm-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: - Fix a couple races found with a new torture test - Improve errors when api functions are used incorrectly - Improve tracing for lock requests from user space - Fix use after free in recently added tracing cod. - Small internal code cleanups * tag 'dlm-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: fs: dlm: fix possible use after free if tracing fs: dlm: const void resource name parameter fs: dlm: LSFL_CB_DELAY only for kernel lockspaces fs: dlm: remove DLM_LSFL_FS from uapi fs: dlm: trace user space callbacks fs: dlm: change ls_clear_proc_locks to spinlock fs: dlm: remove dlm_del_ast prototype fs: dlm: handle rcom in else if branch fs: dlm: allow lockspaces have zero lvblen fs: dlm: fix invalid derefence of sb_lvbptr fs: dlm: handle -EINVAL as log_error() fs: dlm: use __func__ for function name fs: dlm: handle -EBUSY first in unlock validation fs: dlm: handle -EBUSY first in lock arg validation fs: dlm: fix race between test_bit() and queue_work() fs: dlm: fix race in lowcomms commit f90497a16e434c2211c66e3de8e77b17868382b8 Merge: 3497640a80d77 895ddf5ed4c54 Author: Linus Torvalds Date: Mon Oct 3 20:07:15 2022 -0700 Merge tag 'nfsd-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "This release is mostly bug fixes, clean-ups, and optimizations. One notable set of fixes addresses a subtle buffer overflow issue that occurs if a small RPC Call message arrives in an oversized RPC record. This is only possible on a framed RPC transport such as TCP. Because NFSD shares the receive and send buffers in one set of pages, an oversized RPC record steals pages from the send buffer that will be used to construct the RPC Reply message. NFSD must not assume that a full-sized buffer is always available to it; otherwise, it will walk off the end of the send buffer while constructing its reply. In this release, we also introduce the ability for the server to wait a moment for clients to return delegations before it responds with NFS4ERR_DELAY. This saves a retransmit and a network round- trip when a delegation recall is needed. This work will be built upon in future releases. The NFS server adds another shrinker to its collection. Because courtesy clients can linger for quite some time, they might be freeable when the server host comes under memory pressure. A new shrinker has been added that releases courtesy client resources during low memory scenarios. Lastly, of note: the maximum number of operations per NFSv4 COMPOUND that NFSD can handle is increased from 16 to 50. There are NFSv4 client implementations that need more than 16 to successfully perform a mount operation that uses a pathname with many components" * tag 'nfsd-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (53 commits) nfsd: extra checks when freeing delegation stateids nfsd: make nfsd4_run_cb a bool return function nfsd: fix comments about spinlock handling with delegations nfsd: only fill out return pointer on success in nfsd4_lookup_stateid NFSD: fix use-after-free on source server when doing inter-server copy NFSD: Cap rsize_bop result based on send buffer size NFSD: Rename the fields in copy_stateid_t nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_file_cache_stats_fops nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops nfsd: use DEFINE_SHOW_ATTRIBUTE to define client_info_fops nfsd: use DEFINE_SHOW_ATTRIBUTE to define export_features_fops and supported_enctypes_fops nfsd: use DEFINE_PROC_SHOW_ATTRIBUTE to define nfsd_proc_ops NFSD: Pack struct nfsd4_compoundres NFSD: Remove unused nfsd4_compoundargs::cachetype field NFSD: Remove "inline" directives on op_rsize_bop helpers NFSD: Clean up nfs4svc_encode_compoundres() SUNRPC: Fix typo in xdr_buf_subsegment's kdoc comment NFSD: Clean up WRITE arg decoders NFSD: Use xdr_inline_decode() to decode NFSv3 symlinks NFSD: Refactor common code out of dirlist helpers ... commit 3497640a80d77cd098d45c9f3ab235b1aa472dbc Merge: 8bea8ff34a8a5 312fe643ad115 Author: Linus Torvalds Date: Mon Oct 3 20:01:40 2022 -0700 Merge tag 'erofs-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "In this cycle, for container use cases, fscache-based shared domain is introduced [1] so that data blobs in the same domain will be storage deduplicated and it will also be used for page cache sharing later. Also, a special packed inode is now introduced to record inode fragments which keep the tail part of files by Yue Hu [2]. You can keep arbitary length or (at will) the whole file as a fragment and then fragments can be optionally compressed in the packed inode together and even deduplicated for smaller image sizes. In addition to that, global compressed data deduplication by sharing partial-referenced pclusters is also supported in this cycle. Summary: - Introduce fscache-based domain to share blobs between images - Support recording fragments in a special packed inode - Support partial-referenced pclusters for global compressed data deduplication - Fix an order >= MAX_ORDER warning due to crafted negative i_size - Several cleanups" Link: https://lore.kernel.org/r/20220916085940.89392-1-zhujia.zj@bytedance.com [1] Link: https://lore.kernel.org/r/cover.1663065968.git.huyue2@coolpad.com [2] * tag 'erofs-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: clean up erofs_iget() erofs: clean up unnecessary code and comments erofs: fold in z_erofs_reload_indexes() erofs: introduce partial-referenced pclusters erofs: support on-disk compressed fragments data erofs: support interlaced uncompressed data for compressed files erofs: clean up .read_folio() and .readahead() in fscache mode erofs: introduce 'domain_id' mount option erofs: Support sharing cookies in the same domain erofs: introduce a pseudo mnt to manage shared cookies erofs: introduce fscache-based domain erofs: code clean up for fscache erofs: use kill_anon_super() to kill super in fscache mode erofs: fix order >= MAX_ORDER warning due to crafted negative i_size commit 8bea8ff34a8a5a46c9550aad6f6381b9fce0f958 Merge: 223b8452530da 41d27f518b955 Author: Linus Torvalds Date: Mon Oct 3 19:54:29 2022 -0700 Merge tag 'fs.vfsuid.fat.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping Pull fatfs vfsuid conversion from Christian Brauner: "Last cycle we introduced the new vfs{g,u}id_t types that we had agreed on. The most important parts of the vfs have been converted but there are a few more places we need to switch before we can remove the old helpers completely. This cycle we converted all filesystems that called idmapped mount helpers directly. The affected filesystems are f2fs, fat, fuse, ksmbd, overlayfs, and xfs. We've sent patches for all of them. Looking at -next f2fs, ksmbd, overlayfs, and xfs have all picked up these patches and they should land in mainline during the v6.1 merge window. So all filesystems that have a separate tree should send the vfsuid conversion themselves. Onle the fat conversion is going through this generic fs trees because there is no fat tree. In order to change time settings on an inode fat checks that the caller either is the owner of the inode or the inode's group is in the caller's group list. If fat is on an idmapped mount we compare whether the inode mapped into the mount is equivalent to the caller's fsuid. If it isn't we compare whether the inode's group mapped into the mount is in the caller's group list. We now use the new vfsuid based helpers for that" * tag 'fs.vfsuid.fat.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping: fat: port to vfs{g,u}id_t and associated helpers commit 223b8452530da8816de09ec76a2182d1ad8f4fe2 Merge: da380aefdd185 38e316398e4e6 Author: Linus Torvalds Date: Mon Oct 3 19:48:54 2022 -0700 Merge tag 'fs.acl.rework.prep.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping Pull vfs acl updates from Christian Brauner: "These are general fixes and preparatory changes related to the ongoing posix acl rework. The actual rework where we build a type safe posix acl api wasn't ready for this merge window but we're hopeful for the next merge window. General fixes: - Some filesystems like 9p and cifs have to implement custom posix acl handlers because they require access to the dentry in order to set and get posix acls while the set and get inode operations currently don't. But the ntfs3 filesystem has no such requirement and thus implemented custom posix acl xattr handlers when it really didn't have to. So this pr contains patch that just implements set and get inode operations for ntfs3 and switches it to rely on the generic posix acl xattr handlers. (We would've appreciated reviews from the ntfs3 maintainers but we didn't get any. But hey, if we really broke it we'll fix it. But fstests for ntfs3 said it's fine.) - The posix_acl_fix_xattr_common() helper has been adapted so it can be used by a few more callers and avoiding open-coding the same checks over and over. Other than the two general fixes this series introduces a new helper vfs_set_acl_prepare(). The reason for this helper is so that we can mitigate one of the source that change {g,u}id values directly in the uapi struct. With the vfs_set_acl_prepare() helper we can move the idmapped mount fixup into the generic posix acl set handler. The advantage of this is that it allows us to remove the posix_acl_setxattr_idmapped_mnt() helper which so far we had to call in vfs_setxattr() to account for idmapped mounts. While semantically correct the problem with this approach was that we had to keep the value parameter of the generic vfs_setxattr() call as non-const. This is rectified in this series. Ultimately, we will get rid of all the extreme kludges and type unsafety once we have merged the posix api - hopefully during the next merge window - built solely around get and set inode operations. Which incidentally will also improve handling of posix acls in security and especially in integrity modesl. While this will come with temporarily having two inode operation for posix acls that is nothing compared to the problems we have right now and so well worth it. We'll end up with something that we can actually reason about instead of needing to write novels to explain what's going on" * tag 'fs.acl.rework.prep.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping: xattr: always us is_posix_acl_xattr() helper acl: fix the comments of posix_acl_xattr_set xattr: constify value argument in vfs_setxattr() ovl: use vfs_set_acl_prepare() acl: move idmapping handling into posix_acl_xattr_set() acl: add vfs_set_acl_prepare() acl: return EOPNOTSUPP in posix_acl_fix_xattr_common() ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers commit 3baca1a4d490484fcd555413f1fec85b2e071912 Author: Anup Patel Date: Wed Jul 27 10:08:29 2022 +0530 RISC-V: Add mvendorid, marchid, and mimpid to /proc/cpuinfo output Identifying the underlying RISC-V implementation can be important for some of the user space applications. For example, the perf tool uses arch specific CPU implementation id (i.e. CPUID) to select a JSON file describing custom perf events on a CPU. Currently, there is no way to identify RISC-V implementation so we add mvendorid, marchid, and mimpid to /proc/cpuinfo output. Signed-off-by: Anup Patel Reviewed-by: Heinrich Schuchardt Tested-by: Nikita Shubin Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220727043829.151794-1-apatel@ventanamicro.com/ Signed-off-by: Palmer Dabbelt commit da380aefdd185f6dfe3e5555d554dc6a006d2682 Merge: 26b84401da845 4f526fef91b24 Author: Linus Torvalds Date: Mon Oct 3 18:03:58 2022 -0700 Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull coredump fix from Al Viro: "Brown paper bag bug fix for the coredumping fix late in the 6.0 release cycle" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: [brown paperbag] fix coredump breakage commit 26b84401da8458c5cbd6818d5732f7bbb84124a2 Merge: e816da29bc0cf 1e7d8bcbe37d3 Author: Linus Torvalds Date: Mon Oct 3 17:51:52 2022 -0700 Merge tag 'lsm-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull LSM updates from Paul Moore: "Seven patches for the LSM layer and we've got a mix of trivial and significant patches. Highlights below, starting with the smaller bits first so they don't get lost in the discussion of the larger items: - Remove some redundant NULL pointer checks in the common LSM audit code. - Ratelimit the lockdown LSM's access denial messages. With this change there is a chance that the last visible lockdown message on the console is outdated/old, but it does help preserve the initial series of lockdown denials that started the denial message flood and my gut feeling is that these might be the more valuable messages. - Open userfaultfds as readonly instead of read/write. While this code obviously lives outside the LSM, it does have a noticeable impact on the LSMs with Ondrej explaining the situation in the commit description. It is worth noting that this patch languished on the VFS list for over a year without any comments (objections or otherwise) so I took the liberty of pulling it into the LSM tree after giving fair notice. It has been in linux-next since the end of August without any noticeable problems. - Add a LSM hook for user namespace creation, with implementations for both the BPF LSM and SELinux. Even though the changes are fairly small, this is the bulk of the diffstat as we are also including BPF LSM selftests for the new hook. It's also the most contentious of the changes in this pull request with Eric Biederman NACK'ing the LSM hook multiple times during its development and discussion upstream. While I've never taken NACK's lightly, I'm sending these patches to you because it is my belief that they are of good quality, satisfy a long-standing need of users and distros, and are in keeping with the existing nature of the LSM layer and the Linux Kernel as a whole. The patches in implement a LSM hook for user namespace creation that allows for a granular approach, configurable at runtime, which enables both monitoring and control of user namespaces. The general consensus has been that this is far preferable to the other solutions that have been adopted downstream including outright removal from the kernel, disabling via system wide sysctls, or various other out-of-tree mechanisms that users have been forced to adopt since we haven't been able to provide them an upstream solution for their requests. Eric has been steadfast in his objections to this LSM hook, explaining that any restrictions on the user namespace could have significant impact on userspace. While there is the possibility of impacting userspace, it is important to note that this solution only impacts userspace when it is requested based on the runtime configuration supplied by the distro/admin/user. Frederick (the pathset author), the LSM/security community, and myself have tried to work with Eric during development of this patchset to find a mutually acceptable solution, but Eric's approach and unwillingness to engage in a meaningful way have made this impossible. I have CC'd Eric directly on this pull request so he has a chance to provide his side of the story; there have been no objections outside of Eric's" * tag 'lsm-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: lockdown: ratelimit denial messages userfaultfd: open userfaultfds with O_RDONLY selinux: Implement userns_create hook selftests/bpf: Add tests verifying bpf lsm userns_create hook bpf-lsm: Make bpf_lsm_userns_create() sleepable security, lsm: Introduce security_create_user_ns() lsm: clean up redundant NULL pointer check commit e816da29bc0cf0504afddd314a2d71b694b5d7af Merge: eafb121ec0dbc 2fe2fb4ce60be Author: Linus Torvalds Date: Mon Oct 3 17:45:15 2022 -0700 Merge tag 'selinux-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux updates from Paul Moore: "Six SELinux patches, all are simple and easily understood, but a list of the highlights is below: - Use 'grep -E' instead of 'egrep' in the SELinux policy install script. Fun fact, this seems to be GregKH's *second* dedicated SELinux patch since we transitioned to git (ignoring merges, the SPDX stuff, and a trivial fs reference removal when lustre was yanked); the first was back in 2011 when selinuxfs was placed in /sys/fs/selinux. Oh, the memories ... - Convert the SELinux policy boolean values to use signed integer types throughout the SELinux kernel code. Prior to this we were using a mix of signed and unsigned integers which was probably okay in this particular case, but it is definitely not a good idea in general. - Remove a reference to the SELinux runtime disable functionality in /etc/selinux/config as we are in the process of deprecating that. See [1] for more background on this if you missed the previous notes on the deprecation. - Minor cleanups: remove unneeded variables and function parameter constification" Link: https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-runtime-disable [1] * tag 'selinux-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: remove runtime disable message in the install_policy.sh script selinux: use "grep -E" instead of "egrep" selinux: remove the unneeded result variable selinux: declare read-only parameters const selinux: use int arrays for boolean values selinux: remove an unneeded variable in sel_make_class_dir_entries() commit e52f7c1ddf3e47243c330923ea764e7ccfbe99f7 Merge: 2a4187f4406ec 0152dfee235e8 Author: Jakub Kicinski Date: Mon Oct 3 17:44:18 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Merge in the left-over fixes before the net-next pull-request. Conflicts: drivers/net/ethernet/mediatek/mtk_ppe.c ae3ed15da588 ("net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear") 9d8cb4c096ab ("net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc") https://lore.kernel.org/all/6cb6893b-4921-a068-4c30-1109795110bb@tessares.net/ kernel/bpf/helpers.c 8addbfc7b308 ("bpf: Gate dynptr API behind CAP_BPF") 5679ff2f138f ("bpf: Move bpf_loop and bpf_for_each_map_elem under CAP_BPF") 8a67f2de9b1d ("bpf: expose bpf_strtol and bpf_strtoul to all program types") https://lore.kernel.org/all/20221003201957.13149-1-daniel@iogearbox.net/ Signed-off-by: Jakub Kicinski commit eafb121ec0dbcd9a5a1ab0e78dfc06a67af7d536 Merge: 74a0f84590eef bab715bdaa9eb Author: Linus Torvalds Date: Mon Oct 3 17:42:12 2022 -0700 Merge tag 'integrity-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity updates from Mimi Zohar: "Just two bug fixes" * tag 'integrity-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: efi: Correct Macmini DMI match in uefi cert quirk ima: fix blocking of security.ima xattrs of unsupported algorithms commit 74a0f84590eefaf0b55941e8bd8c476b35cdd40b Merge: d0989d01c66fe cc71271f5b793 Author: Linus Torvalds Date: Mon Oct 3 17:38:09 2022 -0700 Merge tag 'Smack-for-6.1' of https://github.com/cschaufler/smack-next Pull smack updates from Casey Schaufler: "Two minor code clean-ups: one removes constants left over from the old mount API, while the other gets rid of an unneeded variable. The other change fixes a flaw in handling IPv6 labeling" * tag 'Smack-for-6.1' of https://github.com/cschaufler/smack-next: smack: cleanup obsolete mount option flags smack: lsm: remove the unneeded result variable SMACK: Add sk_clone_security LSM hook commit 2a4187f4406ec3236f8b9d0d5150d2bf8d021b68 Author: Jason A. Donenfeld Date: Mon Oct 3 20:14:13 2022 +0200 once: rename _SLOW to _SLEEPABLE The _SLOW designation wasn't really descriptive of anything. This is meant to be called from process context when it's possible to sleep. So name this more aptly _SLEEPABLE, which better fits its intended use. Fixes: 62c07983bef9 ("once: add DO_ONCE_SLOW() for sleepable contexts") Cc: Christophe Leroy Signed-off-by: Jason A. Donenfeld Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20221003181413.1221968-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 331834898f2b19ddd54e14468dd686f208412ce5 Merge: 46a275a561673 66741b4e94ca7 Author: Jakub Kicinski Date: Mon Oct 3 17:34:06 2022 -0700 Merge branch 'add-generic-pse-support' Oleksij Rempel says: ==================== add generic PSE support Add generic support for the Ethernet Power Sourcing Equipment. ==================== Link: https://lore.kernel.org/r/20221003065202.3889095-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 66741b4e94ca7bb162063fa930c286619e719bce Author: Oleksij Rempel Date: Mon Oct 3 08:52:02 2022 +0200 net: pse-pd: add regulator based PSE driver Add generic, regulator based PSE driver to support simple Power Sourcing Equipment without automatic classification support. This driver was tested on 10Bast-T1L switch with regulator based PoDL PSE. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit f05dfdaf567aaa482e6e4474bbf5993c5ffffc49 Author: Oleksij Rempel Date: Mon Oct 3 08:52:01 2022 +0200 dt-bindings: net: pse-dt: add bindings for regulator based PoDL PSE controller Add bindings for the regulator based Ethernet PoDL PSE controller and generic bindings for all PSE controllers. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Rob Herring Signed-off-by: Jakub Kicinski commit 18ff0bcda6d1dd3d53b4ce3f03e61bf1a648f960 Author: Oleksij Rempel Date: Mon Oct 3 08:52:00 2022 +0200 ethtool: add interface to interact with Ethernet Power Equipment Add interface to support Power Sourcing Equipment. At current step it provides generic way to address all variants of PSE devices as defined in IEEE 802.3-2018 but support only objects specified for IEEE 802.3-2018 104.4 PoDL Power Sourcing Equipment (PSE). Currently supported and mandatory objects are: IEEE 802.3-2018 30.15.1.1.3 aPoDLPSEPowerDetectionStatus IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState IEEE 802.3-2018 30.15.1.2.1 acPoDLPSEAdminControl This is minimal interface needed to control PSE on each separate ethernet port but it provides not all mandatory objects specified in IEEE 802.3-2018. Since "PoDL PSE" and "PSE" have similar names, but some different values I decide to not merge them and keep separate naming schema. This should allow as to be as close to IEEE 802.3 spec as possible and avoid name conflicts in the future. This implementation is connected to PHYs instead of MACs because PSE auto classification can potentially interfere with PHY auto negotiation. So, may be some extra PHY related initialization will be needed. With WIP version of ethtools interaction with PSE capable link looks as following: $ ip l ... 5: t1l1@eth0: .. ... $ ethtool --show-pse t1l1 PSE attributs for t1l1: PoDL PSE Admin State: disabled PoDL PSE Power Detection Status: disabled $ ethtool --set-pse t1l1 podl-pse-admin-control enable $ ethtool --show-pse t1l1 PSE attributs for t1l1: PoDL PSE Admin State: enabled PoDL PSE Power Detection Status: delivering power Signed-off-by: kernel test robot Signed-off-by: Oleksij Rempel Reviewed-by: Bagas Sanjaya Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 5e82147de1cbd758bb280908daa39d95ed467538 Author: Oleksij Rempel Date: Mon Oct 3 08:51:59 2022 +0200 net: mdiobus: search for PSE nodes by parsing PHY nodes. Some PHYs can be linked with PSE (Power Sourcing Equipment), so search for related nodes and attach it to the phydev. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit cfaa202a73eafaf91a3d0a86b5e5df006562f5c0 Author: Oleksij Rempel Date: Mon Oct 3 08:51:58 2022 +0200 net: mdiobus: fwnode_mdiobus_register_phy() rework error handling Rework error handling as preparation for PSE patch. This patch should make it easier to extend this function. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 3114b075eb2531dea31a961944309485d6a53040 Author: Oleksij Rempel Date: Mon Oct 3 08:51:57 2022 +0200 net: add framework to support Ethernet PSE and PDs devices This framework was create with intention to provide support for Ethernet PSE (Power Sourcing Equipment) and PDs (Powered Device). At current step this patch implements generic PSE support for PoDL (Power over Data Lines 802.3bu) specification with reserving name space for PD devices as well. This framework can be extended to support 802.3af and 802.3at "Power via the Media Dependent Interface" (or PoE/Power over Ethernet) Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit e9554b31aff011c4d0f11a4692d2d45c92cb508d Author: Oleksij Rempel Date: Mon Oct 3 08:51:56 2022 +0200 dt-bindings: net: phy: add PoDL PSE property Add property to reference node representing a PoDL Power Sourcing Equipment. Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring Signed-off-by: Jakub Kicinski commit 4f526fef91b24197d489ff86789744c67f475bb4 Author: Al Viro Date: Mon Oct 3 20:26:08 2022 -0400 [brown paperbag] fix coredump breakage Let me count the ways in which I'd screwed up: * when emitting a page, handling of gaps in coredump should happen before fetching the current file position. * fix for a problem that occurs on rather uncommon setups (and hadn't been observed in the wild) had been sent very late in the cycle. * ... with badly insufficient testing, introducing an easily reproducible breakage. Without giving it time to soak in -next. Fucked-up-by: Al Viro Reported-by: "J. R. Okajima" Tested-by: "J. R. Okajima" Fixes: 06bbaa6dc53c "[coredump] don't use __kernel_write() on kmap_local_page()" Cc: stable@kernel.org # v6.0-only Signed-off-by: Al Viro commit d0989d01c66fed6a741820a96b8cca6688f183ff Merge: 865dad2022c52 2120635108b35 Author: Linus Torvalds Date: Mon Oct 3 17:24:22 2022 -0700 Merge tag 'hardening-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kernel hardening updates from Kees Cook: "Most of the collected changes here are fixes across the tree for various hardening features (details noted below). The most notable new feature here is the addition of the memcpy() overflow warning (under CONFIG_FORTIFY_SOURCE), which is the next step on the path to killing the common class of "trivially detectable" buffer overflow conditions (i.e. on arrays with sizes known at compile time) that have resulted in many exploitable vulnerabilities over the years (e.g. BleedingTooth). This feature is expected to still have some undiscovered false positives. It's been in -next for a full development cycle and all the reported false positives have been fixed in their respective trees. All the known-bad code patterns we could find with Coccinelle are also either fixed in their respective trees or in flight. The commit message in commit 54d9469bc515 ("fortify: Add run-time WARN for cross-field memcpy()") for the feature has extensive details, but I'll repeat here that this is a warning _only_, and is not intended to actually block overflows (yet). The many patches fixing array sizes and struct members have been landing for several years now, and we're finally able to turn this on to find any remaining stragglers. Summary: Various fixes across several hardening areas: - loadpin: Fix verity target enforcement (Matthias Kaehlcke). - zero-call-used-regs: Add missing clobbers in paravirt (Bill Wendling). - CFI: clean up sparc function pointer type mismatches (Bart Van Assche). - Clang: Adjust compiler flag detection for various Clang changes (Sami Tolvanen, Kees Cook). - fortify: Fix warnings in arch-specific code in sh, ARM, and xen. Improvements to existing features: - testing: improve overflow KUnit test, introduce fortify KUnit test, add more coverage to LKDTM tests (Bart Van Assche, Kees Cook). - overflow: Relax overflow type checking for wider utility. New features: - string: Introduce strtomem() and strtomem_pad() to fill a gap in strncpy() replacement needs. - um: Enable FORTIFY_SOURCE support. - fortify: Enable run-time struct member memcpy() overflow warning" * tag 'hardening-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (27 commits) Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero sparc: Unbreak the build x86/paravirt: add extra clobbers with ZERO_CALL_USED_REGS enabled x86/paravirt: clean up typos and grammaros fortify: Convert to struct vs member helpers fortify: Explicitly check bounds are compile-time constants x86/entry: Work around Clang __bdos() bug ARM: decompressor: Include .data.rel.ro.local fortify: Adjust KUnit test for modular build sh: machvec: Use char[] for section boundaries kunit/memcpy: Avoid pathological compile-time string size lib: Improve the is_signed_type() kunit test LoadPin: Require file with verity root digests to have a header dm: verity-loadpin: Only trust verity targets with enforcement LoadPin: Fix Kconfig doc about format of file with verity digests um: Enable FORTIFY_SOURCE lkdtm: Update tests for memcpy() run-time warnings fortify: Add run-time WARN for cross-field memcpy() fortify: Use SIZE_MAX instead of (size_t)-1 ... commit 46a275a5616736cbe70012311bc9003817e96b51 Merge: 899b8cd0d3922 ae15ed6e40c96 Author: Jakub Kicinski Date: Mon Oct 3 17:14:56 2022 -0700 Merge branch 'net-marvell-prestera-add-nexthop-routes-offloading' Yevhen Orlov says: ==================== net: marvell: prestera: add nexthop routes offloading Add support for nexthop routes for Marvell Prestera driver. Subscribe on NEIGH_UPDATE events. Add features: - Support connected route adding e.g.: "ip address add 1.1.1.1/24 dev sw1p1" e.g.: "ip route add 6.6.6/24 dev sw1p1" - Support nexthop route adding e.g.: "ip route add 5.5.5/24 via 1.1.1.2" - Support ECMP route adding e.g.: "ip route add 5.5.5/24 nexthop via 1.1.1.2 nexthop via 1.1.1.3" - Support "offload" and "trap" flags per each nexthop - Support "offload" flag for neighbours Limitations: - Only "local" and "main" tables supported - Only generic interfaces supported for router (no bridges or vlans) Flags meaning: ip route add 5.5.5/24 nexthop via 2.2.2.2 nexthop via 2.2.2.3 ip route show ... 5.5.5.0/24 rt_offload nexthop via 2.2.2.2 dev sw1p31 weight 1 trap nexthop via 2.2.2.3 dev sw1p31 weight 1 trap ... # When you just add route - lpm entry became occupied # in HW ("rt_offload" flag), but related to nexthops neighbours # still not resolved ("trap" flag). # # After some time... ip route show ... 5.5.5.0/24 rt_offload nexthop via 2.2.2.2 dev sw1p31 weight 1 offload nexthop via 2.2.2.3 dev sw1p31 weight 1 offload ... # You will see, that appropriate neighbours was resolved and nexthop # entries occupied in HW too ("offload" flag) Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Changes for v2: * Add more reviewers in CC * Check if route nexthop or direct with fib_nh_gw_family instead of fib_nh_scope This is needed after, 747c14307214 ("ip: fix dflt addr selection for connected nexthop"), because direct route is now with the same scope as nexthop (RT_SCOPE_LINK) Changes for v3: * Resolve "unused functions" warnings, after patch ("net: marvell: prestera: Add heplers to interact ... "), and before patch ("net: marvell: prestera: Add neighbour cache accounting") Changes for v4: * Rebase to the latest master to resolve patch applying issues Changes for v5: * Repack structures to prevent holes * Remove unused variables * Fix misspeling issues Changes for v6: * Rebase on top of master * Fix smatch warnings Changes for v7: * Rebase on top of master * Refactor: use "fib_lookup" instead of "fib_new_table"+"fib_table_lookup", according to Paolo Abeni suggestion * Refactor: use "rhashtable_free_and_destroy" instead of rhashtable walk, according to Paolo Abeni suggestion ==================== Link: https://lore.kernel.org/r/20221001093417.22388-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit ae15ed6e40c9623e3a295a76cb164b4d3564a20b Author: Yevhen Orlov Date: Sat Oct 1 12:34:17 2022 +0300 net: marvell: prestera: Propagate nh state from hw to kernel We poll nexthops in HW and call for each active nexthop appropriate neighbour. Also we provide implicity neighbour resolving. For example, user have added nexthop route: # ip route add 5.5.5.5 via 1.1.1.2 But neighbour 1.1.1.2 doesn't exist. In this case we will try to call neigh_event_send, even if there is no traffic. This is useful, when you have add route, which will be used after some time but with a lot of traffic (burst). So, we has prepared, offloaded route in advance. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 396b80cb5cc8006a488ea25ef84fae245dc1b43c Author: Yevhen Orlov Date: Sat Oct 1 12:34:16 2022 +0300 net: marvell: prestera: Add neighbour cache accounting Move forward and use new PRESTERA_FIB_TYPE_UC_NH to provide basic nexthop routes support. Provide deinitialization sequence for all created router objects. Limitations: - Only "local" and "main" tables supported - Only generic interfaces supported for router (no bridges or vlans) Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 8b1ef4911a41c18df730eb913129f4259a98dab9 Author: Yevhen Orlov Date: Sat Oct 1 12:34:15 2022 +0300 net: marvell: prestera: add stub handler neighbour events Actual handler will be added in next patches Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 04f24a1e6de6e9cf9358ed5fe6677bc56dbd11fa Author: Yevhen Orlov Date: Sat Oct 1 12:34:14 2022 +0300 net: marvell: prestera: Add heplers to interact with fib_notifier_info This will be used to implement nexthops related logic in next patches. Also try to keep ipv4/6 abstraction to be able to reuse helpers for ipv6 in the future. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 59b44ea8aa56cec1c6b29019bf00b1f9474a9c51 Author: Yevhen Orlov Date: Sat Oct 1 12:34:13 2022 +0300 net: marvell: prestera: Add length macros for prestera_ip_addr Add macros to determine IP address length (internal driver types). This will be used in next patches for nexthops logic. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 90b6f9c098512b72b77028893e42f60316409fb1 Author: Yevhen Orlov Date: Sat Oct 1 12:34:12 2022 +0300 net: marvell: prestera: add delayed wq and flush wq on deinit Flushing workqueues ensures, that no more pending works, related to just unregistered or deinitialized notifiers. After that we can free memory. Delayed wq will be used for neighbours in next patches. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 333fe4d033fa5aac139f66d8f185877f47427c3d Author: Yevhen Orlov Date: Sat Oct 1 12:34:11 2022 +0300 net: marvell: prestera: Add strict cleanup of fib arbiter This will, ensure, that there is no more, preciously allocated fib_cache entries left after deinit. Will be used to free allocated resources of nexthop routes, that points to "not our" port (e.g. eth0). Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 1e7313e83ef7859ecc7fb9458d094a084d30bc7f Author: Yevhen Orlov Date: Sat Oct 1 12:34:10 2022 +0300 net: marvell: prestera: Add cleanup of allocated fib_nodes Do explicity cleanup on router_hw_fini, to ensure, that all allocated objects cleaned. This will be used in cases, when upper layer (cache) is not mapped to router_hw layer. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 0a23ae23717156f1cebb8dbc3ad68765765d7bd7 Author: Yevhen Orlov Date: Sat Oct 1 12:34:09 2022 +0300 net: marvell: prestera: Add router nexthops ABI - Add functions to allocate/delete/set nexthop group - NOTE: non-ECMP nexthop is nexthop group with allocated size = 1 - Add function to read state of HW nh (if packets going through it) Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 865dad2022c52ac6c5c9a87c5cec78a69f633fb6 Merge: 12ed00ba01abf 3c516f89e17e5 Author: Linus Torvalds Date: Mon Oct 3 17:11:07 2022 -0700 Merge tag 'kcfi-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kcfi updates from Kees Cook: "This replaces the prior support for Clang's standard Control Flow Integrity (CFI) instrumentation, which has required a lot of special conditions (e.g. LTO) and work-arounds. The new implementation ("Kernel CFI") is specific to C, directly designed for the Linux kernel, and takes advantage of architectural features like x86's IBT. This series retains arm64 support and adds x86 support. GCC support is expected in the future[1], and additional "generic" architectural support is expected soon[2]. Summary: - treewide: Remove old CFI support details - arm64: Replace Clang CFI support with Clang KCFI support - x86: Introduce Clang KCFI support" Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107048 [1] Link: https://github.com/samitolvanen/llvm-project/commits/kcfi_generic [2] * tag 'kcfi-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (22 commits) x86: Add support for CONFIG_CFI_CLANG x86/purgatory: Disable CFI x86: Add types to indirectly called assembly functions x86/tools/relocs: Ignore __kcfi_typeid_ relocations kallsyms: Drop CONFIG_CFI_CLANG workarounds objtool: Disable CFI warnings objtool: Preserve special st_shndx indexes in elf_update_symbol treewide: Drop __cficanonical treewide: Drop WARN_ON_FUNCTION_MISMATCH treewide: Drop function_nocfi init: Drop __nocfi from __init arm64: Drop unneeded __nocfi attributes arm64: Add CFI error handling arm64: Add types to indirect called assembly functions psci: Fix the function type for psci_initcall_t lkdtm: Emit an indirect call for CFI tests cfi: Add type helper macros cfi: Switch to -fsanitize=kcfi cfi: Drop __CFI_ADDRESSABLE cfi: Remove CONFIG_CFI_CLANG_SHADOW ... commit 899b8cd0d3922f57176f5a7f552ce93d8a5cd90b Author: Jakub Kicinski Date: Sun Oct 2 10:56:50 2022 -0700 eth: octeon: fix build after netif_napi_add() changes Guenter reports I missed a netif_napi_add() call in one of the platform-specific drivers: drivers/net/ethernet/cavium/octeon/octeon_mgmt.c: In function 'octeon_mgmt_probe': drivers/net/ethernet/cavium/octeon/octeon_mgmt.c:1399:9: error: too many arguments to function 'netif_napi_add' 1399 | netif_napi_add(netdev, &p->napi, octeon_mgmt_napi_poll, | ^~~~~~~~~~~~~~ Reported-by: Guenter Roeck Fixes: b48b89f9c189 ("net: drop the weight argument from netif_napi_add") Link: https://lore.kernel.org/r/20221002175650.1491124-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 12ed00ba01abf39e0869c02ccdde5e24a357466b Merge: 8aebac82933ff 9f4beead610c8 Author: Linus Torvalds Date: Mon Oct 3 16:56:40 2022 -0700 Merge tag 'execve-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: "This removes a.out support globally; it has been disabled for a while now. - Remove a.out implementation globally (Eric W. Biederman) - Remove unused linux_binprm::taso member (Lukas Bulwahn)" * tag 'execve-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt: remove taso from linux_binprm struct a.out: Remove the a.out implementation commit b89eced8c329ebadfe704de005a2db1025a4f1ab Merge: a4388da51ad56 794131c40850a Author: Jakub Kicinski Date: Mon Oct 3 16:55:33 2022 -0700 Merge branch 'mlx5-xsk-updates-part4-and-more' Saeed Mahameed says: ==================== mlx5 xsk updates part4 and more 1) Final part of xsk improvements, in this series Maxim continues to improve xsk implementation a) XSK Busy polling support b) Use KLM to avoid Frame overrun in unaligned mode c) Optimize unaligned more for certain frame sizes d) Other straight forward minor optimizations. part 1: https://lore.kernel.org/netdev/20220927203611.244301-1-saeed@kernel.org/ part 2: https://lore.kernel.org/netdev/20220929072156.93299-1-saeed@kernel.org/ part 3: https://lore.kernel.org/netdev/20220930162903.62262-1-saeed@kernel.org/ 2) Oversize packets firmware counter, from Gal. 3) Set default grace period for health reporters based on function type 4) Some minor E-Switch improvements ==================== Link: https://lore.kernel.org/r/20221002045632.291612-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 794131c40850a9c68ba9955aa7749e92b903d73f Author: Jianbo Liu Date: Sat Oct 1 21:56:32 2022 -0700 net/mlx5: E-Switch, Return EBUSY if can't get mode lock It is to avoid tc retrying during device mode change. Signed-off-by: Jianbo Liu Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 909ffe462a18041f064656b796999bb524c72a66 Author: Chris Mi Date: Sat Oct 1 21:56:31 2022 -0700 net/mlx5: E-switch, Don't update group if qos is not enabled Currently, qos group will be updated and qos will be enabled when unregistering devlink port. Actually no need to update group if qos is not enabled. Add a check to prevent unnecessary enabling and disabling qos for every port. Signed-off-by: Chris Mi Reviewed-by: Dmytro Linkin Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 8c9cc1eb90c13ee3ec2a8a52af4e564a9b161047 Author: Roi Dayan Date: Sat Oct 1 21:56:30 2022 -0700 net/mlx5: E-Switch, Allow offloading fwd dest flow table with vport Before this commit a fwd dest flow table resulted in ignoring vport dests which is incorrect and is supported. With this commit the dests can be a mix of flow table and vport dests. There is still a limitation that there cannot be more than one flow table dest. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 1330bd9884efc49f5b5ca854cf1185f1bec705d0 Author: Maher Sanalla Date: Sat Oct 1 21:56:29 2022 -0700 net/mlx5: Set default grace period based on function type Currently, driver sets the same grace period for fw fatal health reporter to any type of function. Since the lower level functions are more vulnerable to fw fatal errors as a result of parent function closure/reload, set a smaller grace period for the lower level functions, as follows: 1. For ECPF: 180 seconds. 2. For PF: 60 seconds. 3. For VF/SF: 30 seconds. Signed-off-by: Maher Sanalla Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 9b98d395b85dd042fe83fb696b1ac02e6c93a520 Author: Moshe Shemesh Date: Sat Oct 1 21:56:28 2022 -0700 net/mlx5: Start health poll at earlier stage of driver load Start health poll at earlier stage, so if fw fatal issue occurred before or during initialization commands such as init_hca or set_hca_cap the poll health can detect and indicate that the driver is already in error state. Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 16ab85e78439bab1201ff26ba430231d1574b4ae Author: Gal Pressman Date: Sat Oct 1 21:56:27 2022 -0700 net/mlx5e: Expose rx_oversize_pkts_buffer counter Add the rx_oversize_pkts_buffer counter to ethtool statistics. This counter exposes the number of dropped received packets due to length which arrived to RQ and exceed software buffer size allocated by the device for incoming traffic. It might imply that the device MTU is larger than the software buffers size. Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit c2c9e31dfa4f23045f72f613c5809d5b030cd27f Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:26 2022 -0700 net/mlx5e: xsk: Optimize for unaligned mode with 3072-byte frames When XSK frame size is 3072 (or another power of two multiplied by 3), KLM mechanism for NIC virtual memory page mapping can be optimized by replacing it with KSM. Before this change, two KLM entries were needed to map an XSK frame that is not a power of two: one entry maps the UMEM memory up to the frame length, the other maps the rest of the stride to the garbage page. When the frame length divided by 3 is a power of two, it can be mapped using 3 KSM entries, and the fourth will map the rest of the stride to the garbage page. All 4 KSM entries are of the same size, which allows for a much faster lookup. Frame size 3072 is useful in certain use cases, because it allows packing 4 frames into 3 pages. Generally speaking, other frame sizes equal to PAGE_SIZE minus a power of two can be optimized in a similar way, but it will require many more KSMs per frame, which slows down UMRs a little bit, but more importantly may hit the limit for the maximum number of KSM entries. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit c6f0420468fb2e7bbe006ed492608d63a4ac9e28 Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:25 2022 -0700 net/mlx5e: xsk: Print a warning in slow configurations On striding RQ, when the XSK frame size doesn't match the MKey page size, KLM is used for memory mappings, which is a slower mechanism than MTT or KSM. It may happen in two cases: 1. Frame size is not a power of two (only possible in the unaligned mode of XSK). 2. Frame size is 2048 bytes, and the firmware doesn't support MKey pages smaller than 4096 bytes. Depending on the case, print a warning and recommend to disable striding RQ or upgrade the firmware. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 139213451046eb6653a058a8922796f29b267b0f Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:24 2022 -0700 net/mlx5e: xsk: Use KLM to protect frame overrun in unaligned mode XSK RQs support striding RQ linear mode, but the stride size may be bigger than the XSK frame size, because: 1. The stride size must be a power of two. 2. The stride size must be equal to the UMR page size. Each XSK frame is treated as a separate page, because they aren't necessarily adjacent in physical memory, so the driver can't put more than one stride per page. 3. The minimal MTT page size is 4096 on older firmware. That means that if XSK frame size is 2048 or not a power of two, the strides may be bigger than XSK frames. Normally, it's not a problem if the hardware enforces the MTU. However, traffic between vports skips the hardware MTU check, and oversized packets may be received. If an oversized packet is bigger than the XSK frame but not bigger than the stride, it will cause overwriting of the adjacent UMEM region. If the packet takes more than one stride, they can be recycled for reuse, so it's not a problem when the XSK frame size matches the stride size. Work around the above issue by leveraging KLM to make a more fine-grained mapping. The beginning of each stride is mapped to the frame memory, and the padding up to the closest power of two is mapped to the overflow page that doesn't belong to UMEM. This way, application data corruption won't happen upon receiving packets bigger than MTU. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 9f123f740428e96ef2eae8b5e2876b675b6a4605 Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:23 2022 -0700 net/mlx5e: Improve MTT/KSM alignment Make mlx5e_mpwrq_mtts_per_wqe take into account that KSM requires smaller alignment than MTT. Ensure that there is always an even amount of MTTs in a UMR WQE, so that complete octwords are formed, and no garbage is mapped. Drop extra alignment in MLX5_MTT_OCTW that may cause setting too big ucseg->xlt_octowords, also leading to mapping garbage. Generalize some calculations by introducing the MLX5_OCTWORD constant. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 168723c1f8d6e1e823d4c6ad3cf64478cf58330a Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:22 2022 -0700 net/mlx5e: xsk: Use umr_mode to calculate striding RQ parameters Instead of passing the unaligned flag, pass an enum that indicates the UMR mode. The next commit will add the third mode (KLM for certain configurations of XSK), which will be added to this enum instead of adding another bool flag everywhere. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit cfb4d09c30c9d5b2b4d09766ebff2ec7a0f669da Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:21 2022 -0700 net/mlx5e: xsk: Improve need_wakeup logic XSK need_wakeup mechanism allows the driver to stop busy waiting for buffers when the fill ring is empty, yield to the application and signal it that the driver needs to be waken up after the application refills the fill ring. Add protection against the race condition on the RX (refill) side: if the application refills buffers after xskrq->post_wqes is called, but before mlx5e_xsk_update_rx_wakeup, NAPI will exit, skipping taking these buffers to the hardware WQ, and the application won't wake it up again. Optimize the whole need_wakeup logic, removing unneeded flows, to compensate for this new check. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 1ca6492ec964325396d5822a26ff53876e466f71 Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:20 2022 -0700 net/mlx5e: xsk: Include XSK skb_from_cqe callbacks in INDIRECT_CALL XSK is a performance-critical data path. To avoid an indirect function call with a retpoline, include XSK callbacks in the INDIRECT_CALL macro, so that they are called directly in XSK flows. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit a2740f529da2dab929e10bf565073f6659c863fc Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:19 2022 -0700 net/mlx5e: xsk: Set napi_id to support busy polling xdp_rxq_info_reg should get the actual napi_id, not 0, in order to support socket busy polling properly. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 082a9edf12fef88400172e7d1b131d65a3ed492e Author: Maxim Mikityanskiy Date: Sat Oct 1 21:56:18 2022 -0700 net/mlx5e: xsk: Flush RQ on XSK activation to save memory The regular RQ remains open after opening an XSK socket, in order to guarantee that closing the XSK socket never fails due to an error when reopening the regular RQ. To save memory, the regular RQ can be deactivated and flushed, releasing all pages, when an XSK socket is open. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0152dfee235e87660f52a117fc9f70dc55956bb4 Author: Russell King (Oracle) Date: Mon Oct 3 17:19:27 2022 +0100 net: mvpp2: fix mvpp2 debugfs leak When mvpp2 is unloaded, the driver specific debugfs directory is not removed, which technically leads to a memory leak. However, this directory is only created when the first device is probed, so the hardware is present. Removing the module is only something a developer would to when e.g. testing out changes, so the module would be reloaded. So this memory leak is minor. The original attempt in commit fe2c9c61f668 ("net: mvpp2: debugfs: fix memory leak when using debugfs_lookup()") that was labelled as a memory leak fix was not, it fixed a refcount leak, but in doing so created a problem when the module is reloaded - the directory already exists, but mvpp2_root is NULL, so we lose all debugfs entries. This fix has been reverted. This is the alternative fix, where we remove the offending directory whenever the driver is unloaded. Fixes: 21da57a23125 ("net: mvpp2: add a debugfs interface for the Header Parser") Signed-off-by: Russell King (Oracle) Reviewed-by: Greg Kroah-Hartman Reviewed-by: Marcin Wojtas Link: https://lore.kernel.org/r/E1ofOAB-00CzkG-UO@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit a4388da51ad56366d330144975e50f162a10bd8b Author: Alex Elder Date: Fri Sep 30 17:45:49 2022 -0500 net: ipa: update copyrights Some source files state copyright dates that are earlier than the last modification of the file. Change the copyright year to 2022 in all such cases. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20220930224549.3503434-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit ace5dc61620ba1592bf9e24da4c290a357830b8c Author: Alex Elder Date: Fri Sep 30 17:45:27 2022 -0500 net: ipa: update comments This patch just updates comments throughout the IPA code. Transaction state is now tracked using indexes into an array rather than linked lists, and a few comments refer to the "old way" of doing things. The description of how transactions are used was changed to refer to "operations" rather than "commands", to (hopefully) remove a possible ambiguity. IPA register offsets and fields are now handled differently as well, and the register documentation is updated to better describe the code. A few minor updates to comments were made (e.g., adding a missing word, fixing a typo or punctuation, etc.). Finally, the local macro atomic_dec_not_zero() is no longer used, so it is deleted. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20220930224527.3503404-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 93e2be344a7db169b7119de21ac1bf253b8c6907 Author: Andrew Gaul Date: Sun Oct 2 12:41:28 2022 +0900 r8152: Rate limit overflow messages My system shows almost 10 million of these messages over a 24-hour period which pollutes my logs. Signed-off-by: Andrew Gaul Link: https://lore.kernel.org/r/20221002034128.2026653-1-gaul@google.com Signed-off-by: Jakub Kicinski commit 65898687cf7392c372ea8d04a88617e2cb794465 Merge: 4ae9f874dc1d6 b292cafe2dd02 Author: Dave Airlie Date: Tue Oct 4 09:42:23 2022 +1000 Merge tag 'amd-drm-next-6.1-2022-09-30' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.1-2022-09-30: amdgpu: - RLC FW code cleanup - RLC fixes for GC 11.x - SMU 13.x fixes - CP FW code cleanup - SDMA FW code cleanup - GC 11.x fixes - DCN 3.2.x fixes - DCN 3.1.4 fixes - Misc fixes - RAS fixes - SR-IOV fixes - VCN 4.x fixes amdkfd: - GC 11.x fixes - Xnack fixes - UBSAN warning fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220930162012.5823-1-alexander.deucher@amd.com commit 450a580fc4b5e7f7fb8d9b1a0208bf0d1efc53a8 Author: Nathan Huckleberry Date: Thu Sep 29 11:27:03 2022 -0700 net: lan966x: Fix return type of lan966x_port_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of lan966x_port_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220929182704.64438-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 8aebac82933ff1a7c8eede18cab11e1115e2062b Merge: a5088ee7251e5 615131b8e9bcd Author: Linus Torvalds Date: Mon Oct 3 16:39:37 2022 -0700 Merge tag 'rust-v6.1-rc1' of https://github.com/Rust-for-Linux/linux Pull Rust introductory support from Kees Cook: "The tree has a recent base, but has fundamentally been in linux-next for a year and a half[1]. It's been updated based on feedback from the Kernel Maintainer's Summit, and to gain recent Reviewed-by: tags. Miguel is the primary maintainer, with me helping where needed/wanted. Our plan is for the tree to switch to the standard non-rebasing practice once this initial infrastructure series lands. The contents are the absolute minimum to get Rust code building in the kernel, with many more interfaces[2] (and drivers - NVMe[3], 9p[4], M1 GPU[5]) on the way. The initial support of Rust-for-Linux comes in roughly 4 areas: - Kernel internals (kallsyms expansion for Rust symbols, %pA format) - Kbuild infrastructure (Rust build rules and support scripts) - Rust crates and bindings for initial minimum viable build - Rust kernel documentation and samples Rust support has been in linux-next for a year and a half now, and the short log doesn't do justice to the number of people who have contributed both to the Linux kernel side but also to the upstream Rust side to support the kernel's needs. Thanks to these 173 people, and many more, who have been involved in all kinds of ways: Miguel Ojeda, Wedson Almeida Filho, Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron, Andreas Hindborg, Adam Bratschi-Kaye, Benno Lossin, Maciej Falkowski, Finn Behrens, Sven Van Asbroeck, Asahi Lina, FUJITA Tomonori, John Baublitz, Wei Liu, Geoffrey Thomas, Philip Herron, Arthur Cohen, David Faust, Antoni Boucher, Philip Li, Yujie Liu, Jonathan Corbet, Greg Kroah-Hartman, Paul E. McKenney, Josh Triplett, Kent Overstreet, David Gow, Alice Ryhl, Robin Randhawa, Kees Cook, Nick Desaulniers, Matthew Wilcox, Linus Walleij, Joe Perches, Michael Ellerman, Petr Mladek, Masahiro Yamada, Arnaldo Carvalho de Melo, Andrii Nakryiko, Konstantin Shelekhin, Rasmus Villemoes, Konstantin Ryabitsev, Stephen Rothwell, Andy Shevchenko, Sergey Senozhatsky, John Paul Adrian Glaubitz, David Laight, Nathan Chancellor, Jonathan Cameron, Daniel Latypov, Shuah Khan, Brendan Higgins, Julia Lawall, Laurent Pinchart, Geert Uytterhoeven, Akira Yokosawa, Pavel Machek, David S. Miller, John Hawley, James Bottomley, Arnd Bergmann, Christian Brauner, Dan Robertson, Nicholas Piggin, Zhouyi Zhou, Elena Zannoni, Jose E. Marchesi, Leon Romanovsky, Will Deacon, Richard Weinberger, Randy Dunlap, Paolo Bonzini, Roland Dreier, Mark Brown, Sasha Levin, Ted Ts'o, Steven Rostedt, Jarkko Sakkinen, Michal Kubecek, Marco Elver, Al Viro, Keith Busch, Johannes Berg, Jan Kara, David Sterba, Connor Kuehl, Andy Lutomirski, Andrew Lunn, Alexandre Belloni, Peter Zijlstra, Russell King, Eric W. Biederman, Willy Tarreau, Christoph Hellwig, Emilio Cobos Álvarez, Christian Poveda, Mark Rousskov, John Ericson, TennyZhuang, Xuanwo, Daniel Paoliello, Manish Goregaokar, comex, Josh Stone, Stephan Sokolow, Philipp Krones, Guillaume Gomez, Joshua Nelson, Mats Larsen, Marc Poulhiès, Samantha Miller, Esteban Blanc, Martin Schmidt, Martin Rodriguez Reboredo, Daniel Xu, Viresh Kumar, Bartosz Golaszewski, Vegard Nossum, Milan Landaverde, Dariusz Sosnowski, Yuki Okushi, Matthew Bakhtiari, Wu XiangCheng, Tiago Lam, Boris-Chengbiao Zhou, Sumera Priyadarsini, Viktor Garske, Niklas Mohrin, Nándor István Krácser, Morgan Bartlett, Miguel Cano, Léo Lanteri Thauvin, Julian Merkle, Andreas Reindl, Jiapeng Chong, Fox Chen, Douglas Su, Antonio Terceiro, SeongJae Park, Sergio González Collado, Ngo Iok Ui (Wu Yu Wei), Joshua Abraham, Milan, Daniel Kolsoi, ahomescu, Manas, Luis Gerhorst, Li Hongyu, Philipp Gesang, Russell Currey, Jalil David Salamé Messina, Jon Olson, Raghvender, Angelos, Kaviraj Kanagaraj, Paul Römer, Sladyn Nunes, Mauro Baladés, Hsiang-Cheng Yang, Abhik Jain, Hongyu Li, Sean Nash, Yuheng Su, Peng Hao, Anhad Singh, Roel Kluin, Sara Saa, Geert Stappers, Garrett LeSage, IFo Hancroft, and Linus Torvalds" Link: https://lwn.net/Articles/849849/ [1] Link: https://github.com/Rust-for-Linux/linux/commits/rust [2] Link: https://github.com/metaspace/rust-linux/commit/d88c3744d6cbdf11767e08bad56cbfb67c4c96d0 [3] Link: https://github.com/wedsonaf/linux/commit/9367032607f7670de0ba1537cf09ab0f4365a338 [4] Link: https://github.com/AsahiLinux/linux/commits/gpu/rust-wip [5] * tag 'rust-v6.1-rc1' of https://github.com/Rust-for-Linux/linux: (27 commits) MAINTAINERS: Rust samples: add first Rust examples x86: enable initial Rust support docs: add Rust documentation Kbuild: add Rust support rust: add `.rustfmt.toml` scripts: add `is_rust_module.sh` scripts: add `rust_is_available.sh` scripts: add `generate_rust_target.rs` scripts: add `generate_rust_analyzer.py` scripts: decode_stacktrace: demangle Rust symbols scripts: checkpatch: enable language-independent checks for Rust scripts: checkpatch: diagnose uses of `%pA` in the C side as errors vsprintf: add new `%pA` format specifier rust: export generated symbols rust: add `kernel` crate rust: add `bindings` crate rust: add `macros` crate rust: add `compiler_builtins` crate rust: adapt `alloc` crate to the kernel ... commit 4ae9f874dc1d662ce7bfdb8144903608bcc3706b Merge: 7860d720a84c7 c9b48b91e2fbb Author: Dave Airlie Date: Tue Oct 4 09:29:15 2022 +1000 Merge tag 'drm-misc-next-2022-09-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.1: Core Changes: - Add dma_resv_assert_held to vmap/vunmap calls. - Add kunit tests for some format conversion calls. - Don't rewrite link config when setting phy test pattern in DP link training. Driver Changes: - Assorted small fixes in bridge/lt8192b, qxl, virtio-gpu, ast. - Fix corrupted image output in lt8912b. - Fix driver unbind in meson. - Add INX, BOE, AUO, Multi-Inno Technology panels to panel-edp. - Synchronize access to GEM bo's in simpledrm, ssd130x. - Use dev_err_probe in panel-edp and panel-simple. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/afbd505a-3799-c73b-8008-ef6e156ad7e1@linux.intel.com commit ad061cf4222f88a6b1e246c63a4524f5094ff7aa Merge: 3a4d061c699bd 60240bc261145 Author: Jakub Kicinski Date: Mon Oct 3 16:17:44 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-10-03 We've added 10 non-merge commits during the last 23 day(s) which contain a total of 14 files changed, 130 insertions(+), 69 deletions(-). The main changes are: 1) Fix dynptr helper API to gate behind CAP_BPF given it was not intended for unprivileged BPF programs, from Kumar Kartikeya Dwivedi. 2) Fix need_wakeup flag inheritance from umem buffer pool for shared xsk sockets, from Jalal Mostafa. 3) Fix truncated last_member_type_id in btf_struct_resolve() which had a wrong storage type, from Lorenz Bauer. 4) Fix xsk back-pressure mechanism on tx when amount of produced descriptors to CQ is lower than what was grabbed from xsk tx ring, from Maciej Fijalkowski. 5) Fix wrong cgroup attach flags being displayed to effective progs, from Pu Lehui. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: xsk: Inherit need_wakeup flag for shared sockets bpf: Gate dynptr API behind CAP_BPF selftests/bpf: Adapt cgroup effective query uapi change bpftool: Fix wrong cgroup attach flags being assigned to effective progs bpf, cgroup: Reject prog_attach_flags array when effective query bpf: Ensure correct locking around vulnerable function find_vpid() bpf: btf: fix truncated last_member_type_id in btf_struct_resolve selftests/xsk: Add missing close() on netns fd xsk: Fix backpressure mechanism on Tx MAINTAINERS: Add include/linux/tnum.h to BPF CORE ==================== Link: https://lore.kernel.org/r/20221003201957.13149-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit a5088ee7251e5106a4efa9588a73866eb4b4154e Merge: c79e6fa98ca86 2e70ea7fb9873 Author: Linus Torvalds Date: Mon Oct 3 15:33:38 2022 -0700 Merge tag 'thermal-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "The most significant part of this update is the thermal control DT initialization rework from Daniel Lezcano and the following conversion of drivers to use the new API introduced by it Apart from that, the maximum number of trip points in a thermal zone is increased and there are some fixes and code cleanups Specifics: - Rework the device tree initialization, convert the drivers to the new API and remove the old OF code (Daniel Lezcano) - Fix return value to -ENODEV when searching for a specific thermal zone which does not exist (Daniel Lezcano) - Fix the return value inspection in of_thermal_zone_find() (Dan Carpenter) - Fix kernel panic when KASAN is enabled as it detects use after free when unregistering a thermal zone (Daniel Lezcano) - Move the set_trip ops inside the therma sysfs code (Daniel Lezcano) - Remove unnecessary error message as it is already shown in the underlying function (Jiapeng Chong) - Rework the monitoring path and move the locks upper in the call stack to fix some potentials race windows (Daniel Lezcano) - Fix lockdep_assert() warning introduced by the lock rework (Daniel Lezcano) - Do not lock thermal zone mutex in the user space governor (Rafael Wysocki) - Revert the Mellanox 'hotter thermal zone' feature because it is already handled in the thermal framework core code (Daniel Lezcano) - Increase maximum number of trip points in the thermal core (Sumeet Pawnikar) - Replace strlcpy() with unused retval with strscpy() in the core thermal control code (Wolfram Sang) - Use module_pci_driver() macro in the int340x processor_thermal driver (Shang XiaoJing) - Use get_cpu() instead of smp_processor_id() in the intel_powerclamp thermal driver to prevent it from crashing and remove unused accounting for IRQ wakes from it (Srinivas Pandruvada) - Consolidate priv->data_vault checks in int340x_thermal (Rafael Wysocki) - Check the policy first in cpufreq_cooling_register() (Xuewen Yan) - Drop redundant error message from da9062-thermal (zhaoxiao) - Drop of_match_ptr() from thermal_mmio (Jean Delvare)" * tag 'thermal-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (55 commits) thermal: core: Increase maximum number of trip points thermal: int340x: processor_thermal: Use module_pci_driver() macro thermal: intel_powerclamp: Remove accounting for IRQ wakes thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash thermal: int340x_thermal: Consolidate priv->data_vault checks thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register() thermal: Drop duplicate words from comments thermal: move from strlcpy() with unused retval to strscpy() thermal: da9062-thermal: Drop redundant error message thermal/drivers/thermal_mmio: Drop of_match_ptr() thermal: gov_user_space: Do not lock thermal zone mutex Revert "mlxsw: core: Add the hottest thermal zone detection" thermal/core: Fix lockdep_assert() warning thermal/core: Move the mutex inside the thermal_zone_device_update() function thermal/core: Move the thermal zone lock out of the governors thermal/governors: Group the thermal zone lock inside the throttle function thermal/core: Rework the monitoring a bit thermal/core: Rearm the monitoring only one time thermal/drivers/qcom/spmi-adc-tm5: Remove unnecessary print function dev_err() thermal/of: Remove old OF code ... commit 374d6cda7946431611c41cbb6e75dc4a25727ea8 Author: Zhou jie Date: Wed Sep 28 09:45:39 2022 +0800 init/main.c: remove unnecessary (void*) conversions The void pointer object can be directly assigned to different structure objects, it does not need to be cast. Link: https://lkml.kernel.org/r/20220928014539.11046-1-zhoujie@nfschina.com Signed-off-by: Zhou jie Reviewed-by: Andrew Halaney Acked-by: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit ef1d61781bc6708ccc4a21262cc80a7dad952e04 Author: Alexey Dobriyan Date: Tue Sep 20 20:35:23 2022 +0300 proc: mark more files as permanent Mark /proc/devices /proc/kpagecount /proc/kpageflags /proc/kpagecgroup /proc/loadavg /proc/meminfo /proc/softirqs /proc/uptime /proc/version as permanent /proc entries, saving alloc/free and some list/spinlock ops per use. These files are never removed by the kernel so it is OK to mark them. Link: https://lkml.kernel.org/r/Yyn527DzDMa+r0Yj@localhost.localdomain Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit da6f79164e98de4ab3f2fdeea4875207fe282014 Author: ye xingchen Date: Wed Sep 21 12:48:03 2022 +0900 nilfs2: remove the unneeded result variable Return the value nilfs_segctor_sync() directly instead of storing it in another redundant variable. Link: https://lkml.kernel.org/r/20220831033403.302184-1-ye.xingchen@zte.com.cn Link: https://lkml.kernel.org/r/20220921034803.2476-3-konishi.ryusuke@gmail.com Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Ryusuke Konishi Cc: Minghao Chi Signed-off-by: Andrew Morton commit 0badb2e46a7699d09ef09a2c7f8f4fe66c15e606 Author: Minghao Chi Date: Wed Sep 21 12:48:02 2022 +0900 nilfs2: delete unnecessary checks before brelse() Patch series "nilfs2 minor amendments". This patch (of 2): The brelse() inline function tests whether its argument is NULL and then returns immediately. Thus remove the tests which are not needed around the shown calls. Link: https://lkml.kernel.org/r/20220921034803.2476-1-konishi.ryusuke@gmail.com Link: https://lkml.kernel.org/r/20220819081700.96279-1-chi.minghao@zte.com.cn Link: https://lkml.kernel.org/r/20220921034803.2476-2-konishi.ryusuke@gmail.com Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Ryusuke Konishi Cc: ye xingchen Signed-off-by: Andrew Morton commit bd17e036b495bebbf07a5fc814c868e30e1dc131 Author: Niklas Söderlund Date: Wed Sep 14 12:02:55 2022 +0200 checkpatch: warn for non-standard fixes tag style Add a warning for fixes tags that does not follow community conventions. Link: https://lkml.kernel.org/r/20220914100255.1048460-1-niklas.soderlund@corigine.com Signed-off-by: Niklas Söderlund Reviewed-by: Simon Horman Reviewed-by: Louis Peens Reviewed-by: Philippe Schenker Acked-by: Dwaipayan Ray Reviewed-by: Lukas Bulwahn Acked-by: Lukas Bulwahn Acked-by: Joe Perches Signed-off-by: Andrew Morton commit 462cd7724e2341472c9f9670ac88e250788d4c82 Author: Li zeming Date: Mon Sep 19 09:44:06 2022 +0800 usr/gen_init_cpio.c: remove unnecessary -1 values from int file The file variable is assigned first, it does not need to be initialized. Link: https://lkml.kernel.org/r/20220919014406.3242-1-zeming@nfschina.com Signed-off-by: Li zeming Cc: Li zeming Cc: Masahiro Yamada Cc: Nicolas Schier Signed-off-by: Andrew Morton commit 72d1e611082eda18689106a0c192f2827072713c Author: Jiebin Sun Date: Wed Sep 14 03:25:38 2022 +0800 ipc/msg: mitigate the lock contention with percpu counter The msg_bytes and msg_hdrs atomic counters are frequently updated when IPC msg queue is in heavy use, causing heavy cache bounce and overhead. Change them to percpu_counter greatly improve the performance. Since there is one percpu struct per namespace, additional memory cost is minimal. Reading of the count done in msgctl call, which is infrequent. So the need to sum up the counts in each CPU is infrequent. Apply the patch and test the pts/stress-ng-1.4.0 -- system v message passing (160 threads). Score gain: 3.99x CPU: ICX 8380 x 2 sockets Core number: 40 x 2 physical cores Benchmark: pts/stress-ng-1.4.0 -- system v message passing (160 threads) [akpm@linux-foundation.org: coding-style cleanups] [jiebin.sun@intel.com: avoid negative value by overflow in msginfo] Link: https://lkml.kernel.org/r/20220920150809.4014944-1-jiebin.sun@intel.com [akpm@linux-foundation.org: fix min() warnings] Link: https://lkml.kernel.org/r/20220913192538.3023708-3-jiebin.sun@intel.com Signed-off-by: Jiebin Sun Reviewed-by: Tim Chen Cc: Alexander Mikhalitsyn Cc: Alexey Gladkov Cc: Christoph Lameter Cc: Davidlohr Bueso Cc: Dennis Zhou Cc: "Eric W . Biederman" Cc: Manfred Spraul Cc: Shakeel Butt Cc: Tejun Heo Cc: Vasily Averin Signed-off-by: Andrew Morton commit 5d0ce3595ab75330a15cec914096efbbb8b41e4a Author: Jiebin Sun Date: Wed Sep 14 03:25:37 2022 +0800 percpu: add percpu_counter_add_local and percpu_counter_sub_local Patch series "/msg: mitigate the lock contention in ipc/msg", v6. Here are two patches to mitigate the lock contention in ipc/msg. The 1st patch is to add the new interface percpu_counter_add_local and percpu_counter_sub_local. The batch size in percpu_counter_add_batch should be very large in heavy writing and rare reading case. Add the "_local" version, and mostly it will do local adding, reduce the global updating and mitigate lock contention in writing. The 2nd patch is to use percpu_counter instead of atomic update in ipc/msg. The msg_bytes and msg_hdrs atomic counters are frequently updated when IPC msg queue is in heavy use, causing heavy cache bounce and overhead. Change them to percpu_counter greatly improve the performance. Since there is one percpu struct per namespace, additional memory cost is minimal. Reading of the count done in msgctl call, which is infrequent. So the need to sum up the counts in each CPU is infrequent. This patch (of 2): The batch size in percpu_counter_add_batch should be very large in heavy writing and rare reading case. Add the "_local" version, and mostly it will do local adding, reduce the global updating and mitigate lock contention in writing. Link: https://lkml.kernel.org/r/20220913192538.3023708-1-jiebin.sun@intel.com Link: https://lkml.kernel.org/r/20220913192538.3023708-2-jiebin.sun@intel.com Signed-off-by: Jiebin Sun Reviewed-by: Tim Chen Cc: Alexander Mikhalitsyn Cc: Alexey Gladkov Cc: Christoph Lameter Cc: Dennis Zhou Cc: "Eric W . Biederman" Cc: Manfred Spraul Cc: Shakeel Butt Cc: Tejun Heo Cc: Vasily Averin Cc: Davidlohr Bueso Signed-off-by: Andrew Morton commit e77999c1d4d26df7a3fe83627d05898052437269 Author: wangjianli Date: Thu Sep 8 21:00:36 2022 +0800 fs/ocfs2: fix repeated words in comments Delete the redundant word 'to'. Link: https://lkml.kernel.org/r/20220908130036.31149-1-wangjianli@cdjrlc.com Signed-off-by: wangjianli Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit 83d87a4ddb3b4a42bb73b314b3d1acc3965a689f Author: wuchi Date: Fri Sep 9 18:10:25 2022 +0800 relay: use kvcalloc to alloc page array in relay_alloc_page_array kvcalloc() is safer because it will check the integer overflows, and using it will simple the logic of allocation size. Link: https://lkml.kernel.org/r/20220909101025.82955-1-wuchi.zero@gmail.com Signed-off-by: wuchi Cc: Christoph Hellwig Cc: Jens Axboe Signed-off-by: Andrew Morton commit 7ec354baa2ad6dcf1b481a5a582293cec0eb2a67 Author: Lukas Bulwahn Date: Fri Sep 9 14:25:29 2022 +0200 proc: make config PROC_CHILDREN depend on PROC_FS Commit 2e13ba54a268 ("fs, proc: introduce CONFIG_PROC_CHILDREN") introduces the config PROC_CHILDREN to configure kernels to provide the /proc//task//children file. When one deselects PROC_FS for kernel builds without /proc/, the config PROC_CHILDREN has no effect anymore, but is still visible in menuconfig. Add the dependency on PROC_FS to make the PROC_CHILDREN option disappear for kernel builds without /proc/. Link: https://lkml.kernel.org/r/20220909122529.1941-1-lukas.bulwahn@gmail.com Fixes: 2e13ba54a268 ("fs, proc: introduce CONFIG_PROC_CHILDREN") Signed-off-by: Lukas Bulwahn Cc: Iago López Galeiras Cc: Alexey Dobriyan Signed-off-by: Andrew Morton commit 5ca14835dc429c09fefb290f60343fe266382760 Author: Andrew Morton Date: Fri Sep 9 13:57:41 2022 -0700 fs: uninline inode_maybe_inc_iversion() It has many callsites and is large. text data bss dec hex filename 91796 15984 512 108292 1a704 mm/shmem.o-before 91180 15984 512 107676 1a49c mm/shmem.o-after Acked-by: Jeff Layton Cc: Chuck Lever Cc: Alexander Viro Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 1179083ff07698b870da30a5aad34d44ed5dae10 Author: Guilherme G. Piccoli Date: Fri Sep 9 17:07:55 2022 -0300 firmware: google: test spinlock on panic path to avoid lockups Currently the gsmi driver registers a panic notifier as well as reboot and die notifiers. The callbacks registered are called in atomic and very limited context - for instance, panic disables preemption and local IRQs, also all secondary CPUs (not executing the panic path) are shutdown. With that said, taking a spinlock in this scenario is a dangerous invitation for lockup scenarios. So, fix that by checking if the spinlock is free to acquire in the panic notifier callback - if not, bail-out and avoid a potential hang. Link: https://lkml.kernel.org/r/20220909200755.189679-1-gpiccoli@igalia.com Fixes: 74c5b31c6618 ("driver: Google EFI SMI") Signed-off-by: Guilherme G. Piccoli Reviewed-by: Evan Green Cc: Ard Biesheuvel Cc: David Gow Cc: Greg Kroah-Hartman Cc: Julius Werner Cc: Petr Mladek Signed-off-by: Andrew Morton commit 5758478a3d3c42a78ee9ddc4b08db3e968a68058 Author: Jingyu Wang Date: Fri Sep 9 02:54:52 2022 +0800 ipc: mqueue: remove unnecessary conditionals iput() already handles null and non-null parameters, so there is no need to use if(). Link: https://lkml.kernel.org/r/20220908185452.76590-1-jingyuwang_vip@163.com Signed-off-by: Jingyu Wang Acked-by: Roman Gushchin Signed-off-by: Andrew Morton commit 8f824b4abd31c5ea32ae1d6725c47bdb247d18da Author: Jiangshan Yi Date: Mon Sep 5 10:10:34 2022 +0800 init.h: fix spelling typo in comment Fix spelling typo in comment. Link: https://lkml.kernel.org/r/20220905021034.947701-1-13667453960@163.com Signed-off-by: Jiangshan Yi Reported-by: k2ci Signed-off-by: Andrew Morton commit 1c320cfa17701cbf98085b34ad6159e9f41e5268 Author: Jiangshan Yi Date: Mon Sep 5 14:16:56 2022 +0800 fs/ocfs2/suballoc.h: fix spelling typo in comment Fix spelling typo in comment. Link: https://lkml.kernel.org/r/20220905061656.1829179-1-13667453960@163.com Signed-off-by: Jiangshan Yi Reported-by: k2ci Acked-by: Joseph Qi Signed-off-by: Andrew Morton commit 6e4a53ee7989c8a2b9fc3b14cd90f6e2d613ca76 Author: Gustavo A. R. Silva Date: Sat Sep 3 00:59:36 2022 +0100 ocfs2: replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length array declarations in a couple of structures and unions with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for a flexible-array member in a union and as only member in a structure. Also, this addresses multiple warnings reported when building with Clang-15 and -Wzero-length-array. Lastly, this will also help memcpy (in a coming hardening update) execute proper bounds-checking on variable length object i_symlink at fs/ocfs2/namei.c:1973: fs/ocfs2/namei.c: 1973 memcpy((char *) fe->id2.i_symlink, symname, l); Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/197 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Link: https://lkml.kernel.org/r/YxKY6O2hmdwNh8r8@work Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit 8a977bbb17e2619ba06559f102cffd8678c3084e Author: Clément Léger Date: Fri Jun 17 12:33:06 2022 +0200 clk: allow building lan966x as a module Set the COMMON_CLK_LAN966X option as a tristate and switch from builtin_platform_driver() to module_platform_driver() to allow building and using this driver as a module. Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20220617103306.489466-1-clement.leger@bootlin.com Signed-off-by: Stephen Boyd commit ae039f0fc0432922e95888cb470e5d9e1d8f6934 Author: Yihao Han Date: Fri Apr 8 06:06:09 2022 -0700 clk: clk-xgene: simplify if-if to if-else Replace `if (!pclk->param.csr_reg)` with `else` for simplification and add curly brackets according to the kernel coding style: "Do not unnecessarily use braces where a single statement will do." ... "This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches" Please refer to: https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220408130617.14963-1-hanyihao@vivo.com Signed-off-by: Stephen Boyd commit b8c1dc9c00b252b3be853720a71b05ed451ddd9f Author: Joel Stanley Date: Thu Apr 21 13:34:26 2022 +0930 clk: ast2600: BCLK comes from EPLL This correction was made in the u-boot SDK recently. There are no in-tree users of this clock so the impact is minimal. Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC") Link: https://github.com/AspeedTech-BMC/u-boot/commit/8ad54a5ae15f27fea5e894cc2539a20d90019717 Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20220421040426.171256-1-joel@jms.id.au Signed-off-by: Stephen Boyd commit e55b9f96860f6c6026cff97966a740576285e07b Author: Johannes Weiner Date: Mon Sep 26 09:57:04 2022 -0400 mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol Since 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of memory control"), CONFIG_MEMCG_SWAP hasn't been a user-visible config option anymore, it just means CONFIG_MEMCG && CONFIG_SWAP. Update the sites accordingly and drop the symbol. [ While touching the docs, remove two references to CONFIG_MEMCG_KMEM, which hasn't been a user-visible symbol for over half a decade. ] Link: https://lkml.kernel.org/r/20220926135704.400818-5-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Shakeel Butt Cc: Hugh Dickins Cc: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton commit b94c4e949c36e0e363515822ade0d8305e9a6ef2 Author: Johannes Weiner Date: Mon Sep 26 09:57:03 2022 -0400 mm: memcontrol: use do_memsw_account() in a few more places It's slightly more descriptive and consistent with other places that distinguish cgroup1's combined memory+swap accounting scheme from cgroup2's dedicated swap accounting. Link: https://lkml.kernel.org/r/20220926135704.400818-4-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Shakeel Butt Cc: Hugh Dickins Cc: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton commit b25806dcd3d5248833f7d2544ee29a701735159f Author: Johannes Weiner Date: Mon Sep 26 09:57:02 2022 -0400 mm: memcontrol: deprecate swapaccounting=0 mode The swapaccounting= commandline option already does very little today. To close a trivial containment failure case, the swap ownership tracking part of the swap controller has recently become mandatory (see commit 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of memory control") for details), which makes up the majority of the work during swapout, swapin, and the swap slot map. The only thing left under this flag is the page_counter operations and the visibility of the swap control files in the first place, which are rather meager savings. There also aren't many scenarios, if any, where controlling the memory of a cgroup while allowing it unlimited access to a global swap space is a workable resource isolation strategy. On the other hand, there have been several bugs and confusion around the many possible swap controller states (cgroup1 vs cgroup2 behavior, memory accounting without swap accounting, memcg runtime disabled). This puts the maintenance overhead of retaining the toggle above its practical benefits. Deprecate it. Link: https://lkml.kernel.org/r/20220926135704.400818-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Suggested-by: Shakeel Butt Reviewed-by: Shakeel Butt Cc: Hugh Dickins Cc: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton commit c91bdc9358992856721ff77887202a7e80b7ab22 Author: Johannes Weiner Date: Mon Sep 26 09:57:01 2022 -0400 mm: memcontrol: don't allocate cgroup swap arrays when memcg is disabled Patch series "memcg swap fix & cleanups". This patch (of 4): Since commit 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of memory control"), the cgroup swap arrays are used to track memory ownership at the time of swap readahead and swapoff, even if swap space *accounting* has been turned off by the user via swapaccount=0 (which sets cgroup_memory_noswap). However, the patch was overzealous: by simply dropping the cgroup_memory_noswap conditionals in the swapon, swapoff and uncharge path, it caused the cgroup arrays being allocated even when the memory controller as a whole is disabled. This is a waste of that memory. Restore mem_cgroup_disabled() checks, implied previously by cgroup_memory_noswap, in the swapon, swapoff, and swap_entry_free callbacks. Link: https://lkml.kernel.org/r/20220926135704.400818-1-hannes@cmpxchg.org Link: https://lkml.kernel.org/r/20220926135704.400818-2-hannes@cmpxchg.org Fixes: 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of memory control") Signed-off-by: Johannes Weiner Reported-by: Hugh Dickins Reviewed-by: Shakeel Butt Acked-by: Hugh Dickins Acked-by: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton commit f7c5b1aab5ef18b0eb4136a33fc2c78b54e3e777 Author: Xiu Jianfeng Date: Tue Sep 20 09:22:05 2022 +0800 mm/secretmem: remove reduntant return value The return value @ret is always 0, so remove it and return 0 directly. Link: https://lkml.kernel.org/r/20220920012205.246217-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Andrew Morton commit 8346d69d8bcb6c526a0d8bd126241dff41a60723 Author: Xin Hao Date: Thu Sep 22 10:19:29 2022 +0800 mm/hugetlb: add available_huge_pages() func In hugetlb.c there are several places which compare the values of 'h->free_huge_pages' and 'h->resv_huge_pages', it looks a bit messy, so add a new available_huge_pages() function to do these. Link: https://lkml.kernel.org/r/20220922021929.98961-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Andrew Morton commit 6b91e5dfb3c7ef485587e7ab494dcb47bcdadce3 Author: Gaosheng Cui Date: Thu Sep 22 19:09:35 2022 +0800 mm: remove unused inline functions from include/linux/mm_inline.h Remove the following unused inline functions from mm_inline.h: 1. All uses of add_page_to_lru_list_tail() have been removed since commit 7a3dbfe8a52b ("mm/swap: convert lru_deactivate_file to a folio_batch"), and it can be replaced by lruvec_add_folio_tail(). 2. All uses of __clear_page_lru_flags() have been removed since commit 188e8caee968 ("mm/swap: convert __page_cache_release() to use a folio"), and it can be replaced by __folio_clear_lru_flags(). They are useless, so remove them. Link: https://lkml.kernel.org/r/20220922110935.1495099-1-cuigaosheng1@huawei.com Signed-off-by: Gaosheng Cui Signed-off-by: Andrew Morton commit 0f633baac0f1716200bbccc6430b6006d103d7b9 Author: Zach O'Keefe Date: Thu Sep 22 15:40:46 2022 -0700 selftests/vm: add selftest for MADV_COLLAPSE of uffd-minor memory Add :collapse mod to userfaultfd selftest. Currently this mod is only valid for "shmem" test type, but could be used for other test types. When provided, memory allocated by ->allocate_area() will be hugepage-aligned enforced to be hugepage-sized. userfaultf_minor_test, after the UFFD-registered mapping has been populated by UUFD minor fault handler, attempt to MADV_COLLAPSE the UFFD-registered mapping to collapse the memory into a pmd-mapped THP. This test is meant to be a functional test of what occurs during UFFD-driven live migration of VMs backed by huge tmpfs where, after a hugepage-sized region has been successfully migrated (in native page-sized chunks, to avoid latency of fetched a hugepage over the network), we want to reclaim previous VM performance by remapping it at the PMD level. Link: https://lkml.kernel.org/r/20220907144521.3115321-11-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-11-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 69d9428ce97f28eb1ba8acee552cf46014663d2b Author: Zach O'Keefe Date: Thu Sep 22 15:40:45 2022 -0700 selftests/vm: add file/shmem MADV_COLLAPSE selftest for cleared pmd This test tests that MADV_COLLAPSE acting on file/shmem memory for which (1) the file extent mapping by the memory is already a huge page in the page cache, and (2) the pmd mapping this memory in the target process is none. In practice, (1)+(2) is the state left over after khugepaged has successfully collapsed file/shmem memory for a target VMA, but the memory has not yet been refaulted. So, this test in-effect tests MADV_COLLAPSE racing with khugepaged to collapse the memory first. Link: https://lkml.kernel.org/r/20220907144521.3115321-10-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-10-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit d0d35b6010a8bcc12b986f51d29cf3a8635cdbb4 Author: Zach O'Keefe Date: Thu Sep 22 15:40:44 2022 -0700 selftests/vm: add thp collapse shmem testing Add memory operations for shmem (memfd) memory, and reuse existing tests with the new memory operations. Shmem tests can be called with "shmem" mem_type, and shmem tests are ran with "all" mem_type as well. Link: https://lkml.kernel.org/r/20220907144521.3115321-9-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-9-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 1b03d0d558a281f12f68e5917dfa781c3b94e074 Author: Zach O'Keefe Date: Thu Sep 22 15:40:43 2022 -0700 selftests/vm: add thp collapse file and tmpfs testing Add memory operations for file-backed and tmpfs memory. Call existing tests with these new memory operations to test collapse functionality of khugepaged and MADV_COLLAPSE on file-backed and tmpfs memory. Not all tests are reusable; for example, collapse_swapin_single_pte() which checks swap usage. Refactor test arguments. Usage is now: Usage: ./khugepaged [dir] : : : [all|khugepaged|madvise] : [all|anon|file] "file,all" mem_type requires [dir] argument "file,all" mem_type requires kernel built with CONFIG_READ_ONLY_THP_FOR_FS=y if [dir] is a (sub)directory of a tmpfs mount, tmpfs must be mounted with huge=madvise option for khugepaged tests to work Refactor calling tests to make it clear what collapse context / memory operations they support, but only invoke tests requested by user. Also log what test is being ran, and with what context / memory, to make test logs more human readable. A new test file is created and deleted for every test to ensure no pages remain in the page cache between tests (tests also may attempt to collapse different amount of memory). For file-backed memory where the file is stored on a block device, disable /sys/block//queue/read_ahead_kb so that pages don't find their way into the page cache without the tests faulting them in. Add file and shmem wrappers to vm_utils check for file and shmem hugepages in smaps. [zokeefe@google.com: fix "add thp collapse file and tmpfs testing" for tmpfs] Link: https://lkml.kernel.org/r/20220913212517.3163701-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220907144521.3115321-8-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-8-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 8e638707a3f1a82dccbdc9285980329644946d4f Author: Zach O'Keefe Date: Thu Sep 22 15:40:42 2022 -0700 selftests/vm: modularize thp collapse memory operations Modularize operations to setup, cleanup, fault, and check for huge pages, for a given memory type. This allows reusing existing tests with additional memory types by defining new memory operations. Following patches will add file and shmem memory types. Link: https://lkml.kernel.org/r/20220907144521.3115321-7-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-7-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit c07c343cda8ef02985ac6583a2e5af892726f734 Author: Zach O'Keefe Date: Thu Sep 22 15:40:41 2022 -0700 selftests/vm: dedup THP helpers These files: tools/testing/selftests/vm/vm_util.c tools/testing/selftests/vm/khugepaged.c Both contain logic to: 1) Determine hugepage size on current system 2) Read /proc/self/smaps to determine number of THPs at an address Refactor selftests/vm/khugepaged.c to use the vm_util common helpers and add it as a build dependency. Since selftests/vm/khugepaged.c is the largest user of check_huge(), change the signature of check_huge() to match selftests/vm/khugepaged.c's useage: take an expected number of hugepages, and return a bool indicating if the correct number of hugepages were found. Add a wrapper, check_huge_anon(), in anticipation of checking smaps for file and shmem hugepages. Update existing callsites to use the new pattern / function. Likewise, check_for_pattern() was duplicated, and it's a general enough helper to include in vm_util helpers as well. Link: https://lkml.kernel.org/r/20220907144521.3115321-6-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-6-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Zi Yan Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit d41fd2016ed07a630da2817b76c98eeab7931e1e Author: Zach O'Keefe Date: Thu Sep 22 15:40:40 2022 -0700 mm/khugepaged: add tracepoint to hpage_collapse_scan_file() Add huge_memory:trace_mm_khugepaged_scan_file tracepoint to hpage_collapse_scan_file() analogously to hpage_collapse_scan_pmd(). While this change is targeted at debugging MADV_COLLAPSE pathway, the "mm_khugepaged" prefix is retained for symmetry with huge_memory:trace_mm_khugepaged_scan_pmd, which retains it's legacy name to prevent changing kernel ABI as much as possible. Link: https://lkml.kernel.org/r/20220907144521.3115321-5-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-5-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 34488399fa08faaf664743fa54b271eb6f9e1321 Author: Zach O'Keefe Date: Thu Sep 22 15:40:39 2022 -0700 mm/madvise: add file and shmem support to MADV_COLLAPSE Add support for MADV_COLLAPSE to collapse shmem-backed and file-backed memory into THPs (requires CONFIG_READ_ONLY_THP_FOR_FS=y). On success, the backing memory will be a hugepage. For the memory range and process provided, the page tables will synchronously have a huge pmd installed, mapping the THP. Other mappings of the file extent mapped by the memory range may be added to a set of entries that khugepaged will later process and attempt update their page tables to map the THP by a pmd. This functionality unlocks two important uses: (1) Immediately back executable text by THPs. Current support provided by CONFIG_READ_ONLY_THP_FOR_FS may take a long time on a large system which might impair services from serving at their full rated load after (re)starting. Tricks like mremap(2)'ing text onto anonymous memory to immediately realize iTLB performance prevents page sharing and demand paging, both of which increase steady state memory footprint. Now, we can have the best of both worlds: Peak upfront performance and lower RAM footprints. (2) userfaultfd-based live migration of virtual machines satisfy UFFD faults by fetching native-sized pages over the network (to avoid latency of transferring an entire hugepage). However, after guest memory has been fully copied to the new host, MADV_COLLAPSE can be used to immediately increase guest performance. Since khugepaged is single threaded, this change now introduces possibility of collapse contexts racing in file collapse path. There a important few places to consider: (1) hpage_collapse_scan_file(), when we xas_pause() and drop RCU. We could have the memory collapsed out from under us, but the next xas_for_each() iteration will correctly pick up the hugepage. The hugepage might not be up to date (insofar as copying of small page contents might not have completed - the page still may be locked), but regardless what small page index we were iterating over, we'll find the hugepage and identify it as a suitably aligned compound page of order HPAGE_PMD_ORDER. In khugepaged path, we locklessly check the value of the pmd, and only add it to deferred collapse array if we find pmd mapping pte table. This is fine, since other values that could have raced in right afterwards denote failure, or that the memory was successfully collapsed, so we don't need further processing. In madvise path, we'll take mmap_lock() in write to serialize against page table updates and will know what to do based on the true value of the pmd: recheck all ptes if we point to a pte table, directly install the pmd, if the pmd has been cleared, but memory not yet faulted, or nothing at all if we find a huge pmd. It's worth putting emphasis here on how we treat the none pmd here. If khugepaged has processed this mm's page tables already, it will have left the pmd cleared (ready for refault by the process). Depending on the VMA flags and sysfs settings, amount of RAM on the machine, and the current load, could be a relatively common occurrence - and as such is one we'd like to handle successfully in MADV_COLLAPSE. When we see the none pmd in collapse_pte_mapped_thp(), we've locked mmap_lock in write and checked (a) huepaged_vma_check() to see if the backing memory is appropriate still, along with VMA sizing and appropriate hugepage alignment within the file, and (b) we've found a hugepage head of order HPAGE_PMD_ORDER at the offset in the file mapped by our hugepage-aligned virtual address. Even though the common-case is likely race with khugepaged, given these checks (regardless how we got here - we could be operating on a completely different file than originally checked in hpage_collapse_scan_file() for all we know) it should be safe to directly make the pmd a huge pmd pointing to this hugepage. (2) collapse_file() is mostly serialized on the same file extent by lock sequence: | lock hupepage | lock mapping->i_pages | lock 1st page | unlock mapping->i_pages | | lock mapping->i_pages | page_ref_freeze(3) | xas_store(hugepage) | unlock mapping->i_pages | page_ref_unfreeze(1) | unlock 1st page V unlock hugepage Once a context (who already has their fresh hugepage locked) locks mapping->i_pages exclusively, it will hold said lock until it locks the first page, and it will hold that lock until the after the hugepage has been added to the page cache (and will unlock the hugepage after page table update, though that isn't important here). A racing context that loses the race for mapping->i_pages will then lose the race to locking the first page. Here - depending on how far the other racing context has gotten - we might find the new hugepage (in which case we'll exit cleanly when we check PageTransCompound()), or we'll find the "old" 1st small page (in which we'll exit cleanly when we discover unexpected refcount of 2 after isolate_lru_page()). This is assuming we are able to successfully lock the page we find - in shmem path, we could just fail the trylock and exit cleanly anyways. Failure path in collapse_file() is similar: once we hold lock on 1st small page, we are serialized against other collapse contexts. Before the 1st small page is unlocked, we add it back to the pagecache and unfreeze the refcount appropriately. Contexts who lost the race to the 1st small page will then find the same 1st small page with the correct refcount and will be able to proceed. [zokeefe@google.com: don't check pmd value twice in collapse_pte_mapped_thp()] Link: https://lkml.kernel.org/r/20220927033854.477018-1-zokeefe@google.com [shy828301@gmail.com: Delete hugepage_vma_revalidate_anon(), remove check for multi-add in khugepaged_add_pte_mapped_thp()] Link: https://lore.kernel.org/linux-mm/CAHbLzkrtpM=ic7cYAHcqkubah5VTR8N5=k5RT8MTvv5rN1Y91w@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220907144521.3115321-4-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-4-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 58ac9a8993a13ebcbb0682ede0e3a158b4a41b28 Author: Zach O'Keefe Date: Thu Sep 22 15:40:38 2022 -0700 mm/khugepaged: attempt to map file/shmem-backed pte-mapped THPs by pmds The main benefit of THPs are that they can be mapped at the pmd level, increasing the likelihood of TLB hit and spending less cycles in page table walks. pte-mapped hugepages - that is - hugepage-aligned compound pages of order HPAGE_PMD_ORDER mapped by ptes - although being contiguous in physical memory, don't have this advantage. In fact, one could argue they are detrimental to system performance overall since they occupy a precious hugepage-aligned/sized region of physical memory that could otherwise be used more effectively. Additionally, pte-mapped hugepages can be the cheapest memory to collapse for khugepaged since no new hugepage allocation or copying of memory contents is necessary - we only need to update the mapping page tables. In the anonymous collapse path, we are able to collapse pte-mapped hugepages (albeit, perhaps suboptimally), but the file/shmem path makes no effort when compound pages (of any order) are encountered. Identify pte-mapped hugepages in the file/shmem collapse path. The final step of which makes a racy check of the value of the pmd to ensure it maps a pte table. This should be fine, since races that result in false-positive (i.e. attempt collapse even though we shouldn't) will fail later in collapse_pte_mapped_thp() once we actually lock mmap_lock and reinspect the pmd value. Races that result in false-negatives (i.e. where we decide to not attempt collapse, but should have) shouldn't be an issue, since in the worst case, we do nothing - which is what we've done up to this point. We make a similar check in retract_page_tables(). If we do think we've found a pte-mapped hugepgae in khugepaged context, attempt to update page tables mapping this hugepage. Note that these collapses still count towards the /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed counter, and if the pte-mapped hugepage was also mapped into multiple process' address spaces, could be incremented for each page table update. Since we increment the counter when a pte-mapped hugepage is successfully added to the list of to-collapse pte-mapped THPs, it's possible that we never actually update the page table either. This is different from how file/shmem pages_collapsed accounting works today where only a successful page cache update is counted (it's also possible here that no page tables are actually changed). Though it incurs some slop, this is preferred to either not accounting for the event at all, or plumbing through data in struct mm_slot on whether to account for the collapse or not. Also note that work still needs to be done to support arbitrary compound pages, and that this should all be converted to using folios. [shy828301@gmail.com: Spelling mistake, update comment, and add Documentation] Link: https://lore.kernel.org/linux-mm/CAHbLzkpHwZxFzjfX9nxVoRhzup8WMjMfyL6Xiq8mZ9M-N3ombw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220907144521.3115321-3-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-3-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 7c6c6cc4d3a213e7303ef06ff40f6193df01839c Author: Zach O'Keefe Date: Thu Sep 22 15:40:37 2022 -0700 mm/shmem: add flag to enforce shmem THP in hugepage_vma_check() Patch series "mm: add file/shmem support to MADV_COLLAPSE", v4. This series builds on top of the previous "mm: userspace hugepage collapse" series which introduced the MADV_COLLAPSE madvise mode and added support for private, anonymous mappings[2], by adding support for file and shmem backed memory to CONFIG_READ_ONLY_THP_FOR_FS=y kernels. File and shmem support have been added with effort to align with existing MADV_COLLAPSE semantics and policy decisions[3]. Collapse of shmem-backed memory ignores kernel-guiding directives and heuristics including all sysfs settings (transparent_hugepage/shmem_enabled), and tmpfs huge= mount options (shmem always supports large folios). Like anonymous mappings, on successful return of MADV_COLLAPSE on file/shmem memory, the contents of memory mapped by the addresses provided will be synchronously pmd-mapped THPs. This functionality unlocks two important uses: (1) Immediately back executable text by THPs. Current support provided by CONFIG_READ_ONLY_THP_FOR_FS may take a long time on a large system which might impair services from serving at their full rated load after (re)starting. Tricks like mremap(2)'ing text onto anonymous memory to immediately realize iTLB performance prevents page sharing and demand paging, both of which increase steady state memory footprint. Now, we can have the best of both worlds: Peak upfront performance and lower RAM footprints. (2) userfaultfd-based live migration of virtual machines satisfy UFFD faults by fetching native-sized pages over the network (to avoid latency of transferring an entire hugepage). However, after guest memory has been fully copied to the new host, MADV_COLLAPSE can be used to immediately increase guest performance. khugepaged has received a small improvement by association and can now detect and collapse pte-mapped THPs. However, there is still work to be done along the file collapse path. Compound pages of arbitrary order still needs to be supported and THP collapse needs to be converted to using folios in general. Eventually, we'd like to move away from the read-only and executable-mapped constraints currently imposed on eligible files and support any inode claiming huge folio support. That said, I think the series as-is covers enough to claim that MADV_COLLAPSE supports file/shmem memory. Patches 1-3 Implement the guts of the series. Patch 4 Is a tracepoint for debugging. Patches 5-9 Refactor existing khugepaged selftests to work with new memory types + new collapse tests. Patch 10 Adds a userfaultfd selftest mode to mimic a functional test of UFFDIO_REGISTER_MODE_MINOR+MADV_COLLAPSE live migration. (v4 note: "userfaultfd shmem" selftest is failing as of Sep 22 mm-unstable) [1] https://lore.kernel.org/linux-mm/YyiK8YvVcrtZo0z3@google.com/ [2] https://lore.kernel.org/linux-mm/20220706235936.2197195-1-zokeefe@google.com/ [3] https://lore.kernel.org/linux-mm/YtBmhaiPHUTkJml8@google.com/ [4] https://lore.kernel.org/linux-mm/20220922222731.1124481-1-zokeefe@google.com/ [5] https://lore.kernel.org/linux-mm/20220922184651.1016461-1-zokeefe@google.com/ This patch (of 10): Extend 'mm/thp: add flag to enforce sysfs THP in hugepage_vma_check()' to shmem, allowing callers to ignore /sys/kernel/transparent_hugepage/shmem_enabled and tmpfs huge= mount. This is intended to be used by MADV_COLLAPSE, and the rationale is analogous to the anon/file case: MADV_COLLAPSE is not coupled to directives that advise the kernel's decisions on when THPs should be considered eligible. shmem/tmpfs always claims large folio support, regardless of sysfs or mount options. [shy828301@gmail.com: test shmem_huge_force explicitly] Link: https://lore.kernel.org/linux-mm/CAHbLzko3A5-TpS0BgBeKkx5cuOkWgLvWXQH=TdgW-baO4rPtdg@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220922224046.1143204-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220907144521.3115321-2-zokeefe@google.com Link: https://lkml.kernel.org/r/20220922224046.1143204-2-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 3505c8e62acfb62908ffd7d2d6c5971657596d1d Author: Zach O'Keefe Date: Thu Sep 22 11:46:51 2022 -0700 selftests/vm: retry on EAGAIN for MADV_COLLAPSE selftest MADV_COLLAPSE is a best-effort request that will set errno to an actionable value if the request cannot be performed. For example, if pages are not found on the LRU, or if they are currently locked by something else, MADV_COLLAPSE will fail and set errno to EAGAIN to inform callers that they may try again. Since the khugepaged selftest is the first public use of MADV_COLLAPSE, set a best practice of checking errno and retrying on EAGAIN. Link: https://lkml.kernel.org/r/20220922184651.1016461-2-zokeefe@google.com Fixes: 9330694de59f ("selftests/vm: add MADV_COLLAPSE collapse context to selftests") Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 0f3e2a2c4243695c5ac3fbccce18dc74c0250df6 Author: Zach O'Keefe Date: Thu Sep 22 11:46:50 2022 -0700 mm/madvise: MADV_COLLAPSE return EAGAIN when page cannot be isolated MADV_COLLAPSE is a best-effort request that attempts to set an actionable errno value if the request cannot be fulfilled at the time. EAGAIN should be used to communicate that a resource was temporarily unavailable, but that the user may try again immediately. SCAN_DEL_PAGE_LRU is an internal result code used when a page cannot be isolated from it's LRU list. Since this, like SCAN_PAGE_LRU, is likely a transitory state, make MADV_COLLAPSE return EAGAIN so that users know they may reattempt the operation. Another important scenario to consider is race with khugepaged. khugepaged might isolate a page while MADV_COLLAPSE is interested in it. Even though racing with khugepaged might mean that the memory has already been collapsed, signalling an errno that is non-intrinsic to that memory or arguments provided to madvise(2) lets the user know that future attempts might (and in this case likely would) succeed, and avoids false-negative assumptions by the user. Link: https://lkml.kernel.org/r/20220922184651.1016461-1-zokeefe@google.com Fixes: 7d8faaf15545 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse") Signed-off-by: Zach O'Keefe Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 780a4b6fb865534fcb3aa9150942f3a719d11ce9 Author: Zach O'Keefe Date: Thu Sep 22 15:27:31 2022 -0700 mm/khugepaged: check compound_order() in collapse_pte_mapped_thp() By the time we lock a page in collapse_pte_mapped_thp(), the page mapped by the address pushed onto the slot's .pte_mapped_thp[] array might have changed arbitrarily since we last looked at it. We revalidate that the page is still the head of a compound page, but we don't revalidate if the compound page is of order HPAGE_PMD_ORDER before applying rmap and page table updates. Since the kernel now supports large folios of arbitrary order, and since replacing page's pte mappings by a pmd mapping only makes sense for compound pages of order HPAGE_PMD_ORDER, revalidate that the compound order is indeed of order HPAGE_PMD_ORDER before proceeding. Link: https://lore.kernel.org/linux-mm/CAHbLzkon+2ky8v9ywGcsTUgXM_B35jt5NThYqQKXW2YV_GUacw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220922222731.1124481-1-zokeefe@google.com Signed-off-by: Zach O'Keefe Suggested-by: Yang Shi Reviewed-by: Yang Shi Cc: Axel Rasmussen Cc: Chris Kennelly Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Minchan Kim Cc: Pasha Tatashin Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 958f32ce832ba781ac20e11bb2d12a9352ea28fc Author: Liu Shixin Date: Fri Sep 23 12:21:13 2022 +0800 mm: hugetlb: fix UAF in hugetlb_handle_userfault The vma_lock and hugetlb_fault_mutex are dropped before handling userfault and reacquire them again after handle_userfault(), but reacquire the vma_lock could lead to UAF[1,2] due to the following race, hugetlb_fault hugetlb_no_page /*unlock vma_lock */ hugetlb_handle_userfault handle_userfault /* unlock mm->mmap_lock*/ vm_mmap_pgoff do_mmap mmap_region munmap_vma_range /* clean old vma */ /* lock vma_lock again <--- UAF */ /* unlock vma_lock */ Since the vma_lock will unlock immediately after hugetlb_handle_userfault(), let's drop the unneeded lock and unlock in hugetlb_handle_userfault() to fix the issue. [1] https://lore.kernel.org/linux-mm/000000000000d5e00a05e834962e@google.com/ [2] https://lore.kernel.org/linux-mm/20220921014457.1668-1-liuzixian4@huawei.com/ Link: https://lkml.kernel.org/r/20220923042113.137273-1-liushixin2@huawei.com Fixes: 1a1aad8a9b7b ("userfaultfd: hugetlbfs: add userfaultfd hugetlb hook") Signed-off-by: Liu Shixin Signed-off-by: Kefeng Wang Reported-by: syzbot+193f9cee8638750b23cf@syzkaller.appspotmail.com Reported-by: Liu Zixian Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: John Hubbard Cc: Muchun Song Cc: Sidhartha Kumar Cc: [4.14+] Signed-off-by: Andrew Morton commit c1b8fdae62e59904ecdfe4f50410575ea02fec18 Author: Kairui Song Date: Tue Sep 20 02:06:34 2022 +0800 mm: memcontrol: make cgroup_memory_noswap a static key cgroup_memory_noswap is used in many hot path, so make it a static key to lower the kernel overhead. Using 8G of ZRAM as SWAP, benchmark using `perf stat -d -d -d --repeat 100` with the following code snip in a non-root cgroup: #include #include #include #include #define MB 1024UL * 1024UL int main(int argc, char **argv){ void *p = mmap(NULL, 8000 * MB, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); memset(p, 0xff, 8000 * MB); madvise(p, 8000 * MB, MADV_PAGEOUT); memset(p, 0xff, 8000 * MB); return 0; } Before: 7,021.43 msec task-clock # 0.967 CPUs utilized ( +- 0.03% ) 4,010 context-switches # 573.853 /sec ( +- 0.01% ) 0 cpu-migrations # 0.000 /sec 2,052,057 page-faults # 293.661 K/sec ( +- 0.00% ) 12,616,546,027 cycles # 1.805 GHz ( +- 0.06% ) (39.92%) 156,823,666 stalled-cycles-frontend # 1.25% frontend cycles idle ( +- 0.10% ) (40.25%) 310,130,812 stalled-cycles-backend # 2.47% backend cycles idle ( +- 4.39% ) (40.73%) 18,692,516,591 instructions # 1.49 insn per cycle # 0.01 stalled cycles per insn ( +- 0.04% ) (40.75%) 4,907,447,976 branches # 702.283 M/sec ( +- 0.05% ) (40.30%) 13,002,578 branch-misses # 0.26% of all branches ( +- 0.08% ) (40.48%) 7,069,786,296 L1-dcache-loads # 1.012 G/sec ( +- 0.03% ) (40.32%) 649,385,847 L1-dcache-load-misses # 9.13% of all L1-dcache accesses ( +- 0.07% ) (40.10%) 1,485,448,688 L1-icache-loads # 212.576 M/sec ( +- 0.15% ) (39.49%) 31,628,457 L1-icache-load-misses # 2.13% of all L1-icache accesses ( +- 0.40% ) (39.57%) 6,667,311 dTLB-loads # 954.129 K/sec ( +- 0.21% ) (39.50%) 5,668,555 dTLB-load-misses # 86.40% of all dTLB cache accesses ( +- 0.12% ) (39.03%) 765 iTLB-loads # 109.476 /sec ( +- 21.81% ) (39.44%) 4,370,351 iTLB-load-misses # 214320.09% of all iTLB cache accesses ( +- 1.44% ) (39.86%) 149,207,254 L1-dcache-prefetches # 21.352 M/sec ( +- 0.13% ) (40.27%) 7.25869 +- 0.00203 seconds time elapsed ( +- 0.03% ) After: 6,576.16 msec task-clock # 0.953 CPUs utilized ( +- 0.10% ) 4,020 context-switches # 605.595 /sec ( +- 0.01% ) 0 cpu-migrations # 0.000 /sec 2,052,056 page-faults # 309.133 K/sec ( +- 0.00% ) 11,967,619,180 cycles # 1.803 GHz ( +- 0.36% ) (38.76%) 161,259,240 stalled-cycles-frontend # 1.38% frontend cycles idle ( +- 0.27% ) (36.58%) 253,605,302 stalled-cycles-backend # 2.16% backend cycles idle ( +- 4.45% ) (34.78%) 19,328,171,892 instructions # 1.65 insn per cycle # 0.01 stalled cycles per insn ( +- 0.10% ) (31.46%) 5,213,967,902 branches # 785.461 M/sec ( +- 0.18% ) (30.68%) 12,385,170 branch-misses # 0.24% of all branches ( +- 0.26% ) (34.13%) 7,271,687,822 L1-dcache-loads # 1.095 G/sec ( +- 0.12% ) (35.29%) 649,873,045 L1-dcache-load-misses # 8.93% of all L1-dcache accesses ( +- 0.11% ) (41.41%) 1,950,037,608 L1-icache-loads # 293.764 M/sec ( +- 0.33% ) (43.11%) 31,365,566 L1-icache-load-misses # 1.62% of all L1-icache accesses ( +- 0.39% ) (45.89%) 6,767,809 dTLB-loads # 1.020 M/sec ( +- 0.47% ) (48.42%) 6,339,590 dTLB-load-misses # 95.43% of all dTLB cache accesses ( +- 0.50% ) (46.60%) 736 iTLB-loads # 110.875 /sec ( +- 1.79% ) (48.60%) 4,314,836 iTLB-load-misses # 518653.73% of all iTLB cache accesses ( +- 0.63% ) (42.91%) 144,950,156 L1-dcache-prefetches # 21.836 M/sec ( +- 0.37% ) (41.39%) 6.89935 +- 0.00703 seconds time elapsed ( +- 0.10% ) The performance is clearly better. There is no significant hotspot improvement according to perf report, as there are quite a few callers of memcg_swap_enabled and do_memsw_account (which calls memcg_swap_enabled). Many pieces of minor optimizations resulted in lower overhead for the branch predictor, and bettter performance. Link: https://lkml.kernel.org/r/20220919180634.45958-3-ryncsn@gmail.com Signed-off-by: Kairui Song Acked-by: Michal Hocko Acked-by: Shakeel Butt Acked-by: Roman Gushchin Acked-by: Muchun Song Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 2eb989195d9a361d13d66ffb8738847649e080ad Author: Kairui Song Date: Tue Sep 20 02:06:33 2022 +0800 mm: memcontrol: use memcg_kmem_enabled in count_objcg_event Patch series "mm: memcontrol: cleanup and optimize for two accounting params", v2. This patch (of 2): There are currently two helpers for checking if cgroup kmem accounting is enabled: - mem_cgroup_kmem_disabled - memcg_kmem_enabled mem_cgroup_kmem_disabled is a simple helper that returns true if cgroup.memory=nokmem is specified, otherwise returns false. memcg_kmem_enabled is a bit different, it returns true if cgroup.memory=nokmem is not specified and there was at least one non-root memory control enabled cgroup ever created. This help improve performance when kmem accounting was not actually activated. And it's optimized with static branch. The usage of mem_cgroup_kmem_disabled is for sub-systems that need to preallocate data for kmem accounting since they could be initialized before kmem accounting is activated. But count_objcg_event doesn't need that, so using memcg_kmem_enabled is better here. Link: https://lkml.kernel.org/r/20220919180634.45958-1-ryncsn@gmail.com Link: https://lkml.kernel.org/r/20220919180634.45958-2-ryncsn@gmail.com Signed-off-by: Kairui Song Acked-by: Shakeel Butt Acked-by: Roman Gushchin Acked-by: Muchun Song Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton commit 233f0b31bd9503ce2be7be0bde69c67287c8a741 Author: Kaixu Xia Date: Tue Sep 20 16:53:22 2022 +0000 mm/damon: deduplicate damon_{reclaim,lru_sort}_apply_parameters() The bodies of damon_{reclaim,lru_sort}_apply_parameters() contain duplicates. This commit adds a common function damon_set_region_biggest_system_ram_default() to remove the duplicates. Link: https://lkml.kernel.org/r/6329f00d.a70a0220.9bb29.3678SMTPIN_ADDED_BROKEN@mx.google.com Signed-off-by: Kaixu Xia Suggested-by: SeongJae Park Reviewed-by: SeongJae Park Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 30b6242c49cd2a98def3bb2feee68d82a0e9686b Author: Xin Hao Date: Tue Sep 20 16:35:30 2022 +0000 mm/damon/sysfs: return 'err' value when call kstrtoul() failed We had better return the 'err' value when calling kstrtoul() failed, so the user will know why it really fails, there do little change, let it return the 'err' value when failed. Link: https://lkml.kernel.org/r/6329ebe0.050a0220.ec4bd.297cSMTPIN_ADDED_BROKEN@mx.google.com Suggested-by: SeongJae Park Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: SeongJae Park Reviewed-by: Xin Hao Signed-off-by: Andrew Morton commit a57ae9ef9e1a20b68ae841a8cab7aff3f000ed9d Author: Ran Xiaokai Date: Sun Sep 18 02:56:40 2022 +0000 mm/page_alloc: update comments for rmqueue() Since commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists"), the per-cpu page allocators (PCP) is not only for order-0 pages. Update the comments. Link: https://lkml.kernel.org/r/20220918025640.208586-1-ran.xiaokai@zte.com.cn Signed-off-by: Ran Xiaokai Cc: Mel Gorman Signed-off-by: Andrew Morton commit e3e486e634bfd652036292c3d66f9d388614ffe6 Author: Kaixu Xia Date: Sat Sep 17 21:56:54 2022 +0800 mm/damon: rename damon_pageout_score() to damon_cold_score() In the beginning there is only one damos_action 'DAMOS_PAGEOUT' that need to get the coldness score of a region for a scheme, which using damon_pageout_score() to do that. But now there are also other damos_action actions need the coldness score, so rename it to damon_cold_score() to make more sense. Link: https://lkml.kernel.org/r/1663423014-28907-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 2b21624fc23277553ef254b3ad02c37afa1c484d Author: Mike Kravetz Date: Fri Sep 16 14:46:38 2022 -0700 hugetlb: freeze allocated pages before creating hugetlb pages When creating hugetlb pages, the hugetlb code must first allocate contiguous pages from a low level allocator such as buddy, cma or memblock. The pages returned from these low level allocators are ref counted. This creates potential issues with other code taking speculative references on these pages before they can be transformed to a hugetlb page. This issue has been addressed with methods and code such as that provided in [1]. Recent discussions about vmemmap freeing [2] have indicated that it would be beneficial to freeze all sub pages, including the head page of pages returned from low level allocators before converting to a hugetlb page. This helps avoid races if we want to replace the page containing vmemmap for the head page. There have been proposals to change at least the buddy allocator to return frozen pages as described at [3]. If such a change is made, it can be employed by the hugetlb code. However, as mentioned above hugetlb uses several low level allocators so each would need to be modified to return frozen pages. For now, we can manually freeze the returned pages. This is done in two places: 1) alloc_buddy_huge_page, only the returned head page is ref counted. We freeze the head page, retrying once in the VERY rare case where there may be an inflated ref count. 2) prep_compound_gigantic_page, for gigantic pages the current code freezes all pages except the head page. New code will simply freeze the head page as well. In a few other places, code checks for inflated ref counts on newly allocated hugetlb pages. With the modifications to freeze after allocating, this code can be removed. After hugetlb pages are freshly allocated, they are often added to the hugetlb free lists. Since these pages were previously ref counted, this was done via put_page() which would end up calling the hugetlb destructor: free_huge_page. With changes to freeze pages, we simply call free_huge_page directly to add the pages to the free list. In a few other places, freshly allocated hugetlb pages were immediately put into use, and the expectation was they were already ref counted. In these cases, we must manually ref count the page. [1] https://lore.kernel.org/linux-mm/20210622021423.154662-3-mike.kravetz@oracle.com/ [2] https://lore.kernel.org/linux-mm/20220802180309.19340-1-joao.m.martins@oracle.com/ [3] https://lore.kernel.org/linux-mm/20220809171854.3725722-1-willy@infradead.org/ [mike.kravetz@oracle.com: fix NULL pointer dereference] Link: https://lkml.kernel.org/r/20220921202702.106069-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20220916214638.155744-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Oscar Salvador Reviewed-by: Muchun Song Reviewed-by: Miaohe Lin Cc: Joao Martins Cc: Matthew Wilcox Cc: Michal Hocko Cc: Peter Xu Signed-off-by: Andrew Morton commit c9b3637f8a5a4c869f78c26773c559669796212f Author: Miaohe Lin Date: Fri Sep 16 15:22:57 2022 +0800 mm/page_alloc: fix obsolete comment in deferred_pfn_valid() There are no architectures that can have holes in the memory map within a pageblock since commit 859a85ddf90e ("mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE"). Update the corresponding comment. Link: https://lkml.kernel.org/r/20220916072257.9639-17-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit def76fd549c513bb90278a8d6d0fe3ef3faa20a7 Author: Miaohe Lin Date: Fri Sep 16 15:22:56 2022 +0800 mm/page_alloc: remove obsolete gfpflags_normal_context() Since commit dacb5d8875cc ("tcp: fix page frag corruption on page fault"), there's no caller of gfpflags_normal_context(). Remove it as this helper is strictly tied to the sk page frag usage and there won't be other user in the future. [linmiaohe@huawei.com: fix htmldocs] Link: https://lkml.kernel.org/r/1bc55727-9b66-0e9e-c306-f10c4716ea89@huawei.com Link: https://lkml.kernel.org/r/20220916072257.9639-16-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 896c4d52538df231c3847491acc4f2c23891fe6a Author: Miaohe Lin Date: Fri Sep 16 15:22:55 2022 +0800 mm/page_alloc: use costly_order in WARN_ON_ONCE_GFP() There's no need to check whether order > PAGE_ALLOC_COSTLY_ORDER again. Minor readability improvement. Link: https://lkml.kernel.org/r/20220916072257.9639-15-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit dae37a5dccd104fc465241c42d9e17756ddebbc1 Author: Miaohe Lin Date: Fri Sep 16 15:22:54 2022 +0800 mm/page_alloc: init local variable buddy_pfn The local variable buddy_pfn could be passed to buddy_merge_likely() without initialization if the passed in order is MAX_ORDER - 1. This looks buggy but buddy_pfn won't be used in this case as there's a order >= MAX_ORDER - 2 check. Init buddy_pfn to 0 anyway to avoid possible future misuse. Link: https://lkml.kernel.org/r/20220916072257.9639-14-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit c940e0207a1c307fdab92b32d0522271036fc3ef Author: Miaohe Lin Date: Fri Sep 16 15:22:53 2022 +0800 mm/page_alloc: use helper macro SZ_1{K,M} Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor readability improvement. Link: https://lkml.kernel.org/r/20220916072257.9639-13-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Anshuman Khandual Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 6dc2c87a5a8878b657d08e34ca0e757d31273e12 Author: Miaohe Lin Date: Fri Sep 16 15:22:52 2022 +0800 mm/page_alloc: make boot_nodestats static It's only used in mm/page_alloc.c now. Make it static. Link: https://lkml.kernel.org/r/20220916072257.9639-12-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit f774a6a6fd39e1b5677bdf71f6813b382faddeeb Author: Miaohe Lin Date: Fri Sep 16 15:22:51 2022 +0800 mm, memory_hotplug: remove obsolete generic_free_nodedata() Commit 390511e1476e ("mm, memory_hotplug: drop arch_free_nodedata") drops the last caller of generic_free_nodedata(). Remove it too. Link: https://lkml.kernel.org/r/20220916072257.9639-11-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit c035290424a9b7b64477752058b460d0ecc21987 Author: Miaohe Lin Date: Fri Sep 16 15:22:50 2022 +0800 mm/page_alloc: use local variable zone_idx directly Use local variable zone_idx directly since it holds the exact value of zone_idx(). No functional change intended. Link: https://lkml.kernel.org/r/20220916072257.9639-10-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit b36184553d41c59e6712f9d4699aca24577fbd4a Author: Miaohe Lin Date: Fri Sep 16 15:22:49 2022 +0800 mm/page_alloc: add missing is_migrate_isolate() check in set_page_guard() In MIGRATE_ISOLATE case, zone freepage state shouldn't be modified as caller will take care of it. Add missing is_migrate_isolate() here to avoid possible unbalanced freepage state. This would happen if someone isolates the block, and then we face an MCE failure/soft-offline on a page within that block. __mod_zone_freepage_state() will be triggered via below call trace which already had been triggered back when block was isolated: take_page_off_buddy break_down_buddy_pages set_page_guard Link: https://lkml.kernel.org/r/20220916072257.9639-9-linmiaohe@huawei.com Fixes: 06be6ff3d2ec ("mm,hwpoison: rework soft offline for free pages") Signed-off-by: Miaohe Lin Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Cc: Anshuman Khandual Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 30e3b5d7c82f78c63c53197b5d8b99636bb60d56 Author: Miaohe Lin Date: Fri Sep 16 15:22:48 2022 +0800 mm: remove obsolete pgdat_is_empty() There's no caller. Remove it. Link: https://lkml.kernel.org/r/20220916072257.9639-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 022e7fa0f73d7c90cf3d6bea3d4e4cc5df1e1087 Author: Miaohe Lin Date: Fri Sep 16 15:22:47 2022 +0800 mm/page_alloc: fix freeing static percpu memory The size of struct per_cpu_zonestat can be 0 on !SMP && !NUMA. In that case, zone->per_cpu_zonestats will always equal to boot_zonestats. But in zone_pcp_reset(), zone->per_cpu_zonestats is freed via free_percpu() directly without checking against boot_zonestats first. boot_zonestats will be released by free_percpu() unexpectedly. Link: https://lkml.kernel.org/r/20220916072257.9639-7-linmiaohe@huawei.com Fixes: 28f836b6777b ("mm/page_alloc: split per cpu page lists and zone stats") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Anshuman Khandual Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 5749fcc5f04cef4091dea0c2ba6b5c5f5e05a549 Author: Miaohe Lin Date: Fri Sep 16 15:22:46 2022 +0800 mm/page_alloc: add __init annotations to init_mem_debugging_and_hardening() It's only called by mm_init(). Add __init annotations to it. Link: https://lkml.kernel.org/r/20220916072257.9639-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 709924bc7555db4867403f1f6e51cac4250bca87 Author: Miaohe Lin Date: Fri Sep 16 15:22:45 2022 +0800 mm/page_alloc: remove obsolete comment in zone_statistics() Since commit 43c95bcc51e4 ("mm/page_alloc: reduce duration that IRQs are disabled for VM counters"), zone_statistics() is not called with interrupts disabled. Update the corresponding comment. Link: https://lkml.kernel.org/r/20220916072257.9639-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 638a9ae97ab596f1f7b7522dad709e69cb5b4e9d Author: Miaohe Lin Date: Fri Sep 16 15:22:44 2022 +0800 mm: remove obsolete macro NR_PCP_ORDER_MASK and NR_PCP_ORDER_WIDTH Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass during bulk free"), they're not used anymore. Remove them. Link: https://lkml.kernel.org/r/20220916072257.9639-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit b89f1735169b8ab54b6a03bf4823657ee4e30073 Author: Miaohe Lin Date: Fri Sep 16 15:22:43 2022 +0800 mm/page_alloc: make zone_pcp_update() static Since commit b92ca18e8ca5 ("mm/page_alloc: disassociate the pcp->high from pcp->batch"), zone_pcp_update() is only used in mm/page_alloc.c. Move zone_pcp_update() up to avoid forward declaration and then make it static. No functional change intended. Link: https://lkml.kernel.org/r/20220916072257.9639-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit ce96fa6223ee851cb83118678f6e75f260852a80 Author: Miaohe Lin Date: Fri Sep 16 15:22:42 2022 +0800 mm/page_alloc: ensure kswapd doesn't accidentally go to sleep Patch series "A few cleanup patches for mm", v2. This series contains a few cleanup patches to remove the obsolete comments and functions, use helper macro to improve readability and so on. More details can be found in the respective changelogs. This patch (of 16): If ALLOC_KSWAPD is set, wake_all_kswapds() will be called to ensure kswapd doesn't accidentally go to sleep. But when reserve_flags is set, alloc_flags will be overwritten and ALLOC_KSWAPD is thus lost. Preserve the ALLOC_KSWAPD flag in alloc_flags to ensure kswapd won't go to sleep accidentally. Link: https://lkml.kernel.org/r/20220916072257.9639-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220916072257.9639-2-linmiaohe@huawei.com Fixes: 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Anshuman Khandual Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 3ae6d3e30a52a7af222f284d0bf5d424b4f2f365 Author: Chih-En Lin Date: Fri Sep 16 17:04:34 2022 +0800 mm/page_table_check: fix typos Link: https://lkml.kernel.org/r/20220916090434.701194-1-shiyn.lin@gmail.com Signed-off-by: Chih-En Lin Acked-by: Pasha Tatashin Signed-off-by: Andrew Morton commit cc713520bdc1b84fc5394f6ac8649b93ad2c5dde Author: Kaixu Xia Date: Fri Sep 16 23:20:35 2022 +0800 mm/damon: return void from damon_set_schemes() There is no point in returning an int from damon_set_schemes(). It always returns 0 which is meaningless for the caller, so change it to return void directly. Link: https://lkml.kernel.org/r/1663341635-12675-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit 1ea41595f606e21ba422c59dcdc637f9a9513f2e Author: Xiu Jianfeng Date: Thu Sep 15 09:16:02 2022 +0800 mm/secretmem: add __init annotation to secretmem_init() It's a fs_initcall entry, add __init annotation to it. Link: https://lkml.kernel.org/r/20220915011602.176967-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Cc: Mike Rapoport Signed-off-by: Andrew Morton commit e47b082579f307d0367b1fb7ca3698fd9c73a88b Author: Yang Yingliang Date: Thu Sep 15 10:10:24 2022 +0800 mm/damon/lru_sort: change damon_lru_sort_wmarks to static damon_lru_sort_wmarks is only used in lru_sort.c now, change it to static. Link: https://lkml.kernel.org/r/20220915021024.4177940-2-yangyingliang@huawei.com Fixes: 189aa3d58206 ("mm/damon/lru_sort: use watermarks parameters generator macro") Signed-off-by: Yang Yingliang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 81f8f57f853ed6fb8ae9bbc96e3aead10d6e248a Author: Yang Yingliang Date: Thu Sep 15 10:10:23 2022 +0800 mm/damon/reclaim: change damon_reclaim_wmarks to static damon_reclaim_wmarks is only used in reclaim.c now, change it to static. Link: https://lkml.kernel.org/r/20220915021024.4177940-1-yangyingliang@huawei.com Fixes: 89dd02d8abd1 ("mm/damon/reclaim: use watermarks parameters generator macro") Signed-off-by: Yang Yingliang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 16bc1b0f0269b6110f6d25880b52947d354e2980 Author: Kaixu Xia Date: Thu Sep 15 19:33:41 2022 +0800 mm/damon: use 'struct damon_target *' instead of 'void *' in target_valid() We could use 'struct damon_target *' directly instead of 'void *' in target_valid() operation to make code simple. Link: https://lkml.kernel.org/r/1663241621-13293-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit a07b8eafa43fdbe1df33256b06d625c80829e557 Author: Xin Hao Date: Thu Sep 15 13:30:41 2022 +0000 mm/damon: simplify scheme create in lru_sort.c In damon_lru_sort_new_hot_scheme() and damon_lru_sort_new_cold_scheme(), they have so much in common, so we can combine them into a single function, and we just need to distinguish their differences. [yangyingliang@huawei.com: change damon_lru_sort_stub_pattern to static] Link: https://lkml.kernel.org/r/20220917121228.1889699-1-yangyingliang@huawei.com Link: https://lkml.kernel.org/r/20220915133041.71819-1-sj@kernel.org Signed-off-by: Xin Hao Signed-off-by: SeongJae Park Signed-off-by: Yang Yingliang Suggested-by: SeongJae Park Reviewed-by: Xin Hao Signed-off-by: Andrew Morton commit 871f697b494b04f8d78cc090e49b416062d23a10 Author: Xin Hao Date: Thu Sep 15 22:22:36 2022 +0800 mm/damon/sysfs: avoid call damon_target_has_pid() repeatedly In damon_sysfs_destroy_targets(), we call damon_target_has_pid() to check whether the 'ctx' include a valid pid, but there no need to call damon_target_has_pid() to check repeatedly, just need call it once. [xhao@linux.alibaba.com: more simplified code calls damon_target_has_pid()] Link: https://lkml.kernel.org/r/20220916133535.7428-1-xhao@linux.alibaba.com Link: https://lkml.kernel.org/r/20220915142237.92529-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit ce732a7520b093091c345cba1b84542d1abd83ed Author: Alexander Potapenko Date: Wed Sep 28 14:32:19 2022 +0200 x86: kmsan: handle CPU entry area Among other data, CPU entry area holds exception stacks, so addresses from this area can be passed to kmsan_get_metadata(). This previously led to kmsan_get_metadata() returning NULL, which in turn resulted in a warning that triggered further attempts to call kmsan_get_metadata() in the exception context, which quickly exhausted the exception stack. This patch allocates shadow and origin for the CPU entry area on x86 and introduces arch_kmsan_get_meta_or_null(), which performs arch-specific metadata mapping. Link: https://lkml.kernel.org/r/20220928123219.1101883-1-glider@google.com Signed-off-by: Alexander Potapenko Fixes: 21d723a7c1409 ("kmsan: add KMSAN runtime core") Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4ca8cc8d1bbe582bfc7a4d80bd72cfd8d3d0e2e8 Author: Alexander Potapenko Date: Thu Sep 15 17:04:17 2022 +0200 x86: kmsan: enable KMSAN builds for x86 Make KMSAN usable by adding the necessary Kconfig bits. Also declare x86-specific functions checking address validity in arch/x86/include/asm/kmsan.h. Link: https://lkml.kernel.org/r/20220915150417.722975-44-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 1468c6f4558b1bcd92aa0400f2920f9dc7588402 Author: Alexander Potapenko Date: Thu Sep 15 17:04:16 2022 +0200 mm: fs: initialize fsdata passed to write_begin/write_end interface Functions implementing the a_ops->write_end() interface accept the `void *fsdata` parameter that is supposed to be initialized by the corresponding a_ops->write_begin() (which accepts `void **fsdata`). However not all a_ops->write_begin() implementations initialize `fsdata` unconditionally, so it may get passed uninitialized to a_ops->write_end(), resulting in undefined behavior. Fix this by initializing fsdata with NULL before the call to write_begin(), rather than doing so in all possible a_ops implementations. This patch covers only the following cases found by running x86 KMSAN under syzkaller: - generic_perform_write() - cont_expand_zero() and generic_cont_expand_simple() - page_symlink() Other cases of passing uninitialized fsdata may persist in the codebase. Link: https://lkml.kernel.org/r/20220915150417.722975-43-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit a6a7aaba7f39ee439f3d42e4b5bfc6e7f762d126 Author: Alexander Potapenko Date: Thu Sep 15 17:04:15 2022 +0200 bpf: kmsan: initialize BPF registers with zeroes When executing BPF programs, certain registers may get passed uninitialized to helper functions. E.g. when performing a JMP_CALL, registers BPF_R1-BPF_R5 are always passed to the helper, no matter how many of them are actually used. Passing uninitialized values as function parameters is technically undefined behavior, so we work around it by always initializing the registers. Link: https://lkml.kernel.org/r/20220915150417.722975-42-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6cae637fa26df867449c6bc20ea8bc693abe49b0 Author: Alexander Potapenko Date: Thu Sep 15 17:04:14 2022 +0200 entry: kmsan: introduce kmsan_unpoison_entry_regs() struct pt_regs passed into IRQ entry code is set up by uninstrumented asm functions, therefore KMSAN may not notice the registers are initialized. kmsan_unpoison_entry_regs() unpoisons the contents of struct pt_regs, preventing potential false positives. Unlike kmsan_unpoison_memory(), it can be called under kmsan_in_runtime(), which is often the case in IRQ entry code. Link: https://lkml.kernel.org/r/20220915150417.722975-41-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 37ad4ee8364255c73026a3c343403b5977fa7e79 Author: Alexander Potapenko Date: Thu Sep 15 17:04:13 2022 +0200 x86: kmsan: don't instrument stack walking functions Upon function exit, KMSAN marks local variables as uninitialized. Further function calls may result in the compiler creating the stack frame where these local variables resided. This results in frame pointers being marked as uninitialized data, which is normally correct, because they are not stack-allocated. However stack unwinding functions are supposed to read and dereference the frame pointers, in which case KMSAN might be reporting uses of uninitialized values. To work around that, we mark update_stack_state(), unwind_next_frame() and show_trace_log_lvl() with __no_kmsan_checks, preventing all KMSAN reports inside those functions and making them return initialized values. Link: https://lkml.kernel.org/r/20220915150417.722975-40-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 7cf8f44a5a1c0cb10a594996797e5a988cf0589d Author: Alexander Potapenko Date: Thu Sep 15 17:04:12 2022 +0200 x86: fs: kmsan: disable CONFIG_DCACHE_WORD_ACCESS dentry_string_cmp() calls read_word_at_a_time(), which might read uninitialized bytes to optimize string comparisons. Disabling CONFIG_DCACHE_WORD_ACCESS should prohibit this optimization, as well as (probably) similar ones. Link: https://lkml.kernel.org/r/20220915150417.722975-39-glider@google.com Signed-off-by: Alexander Potapenko Suggested-by: Andrey Konovalov Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit d911c67e10b47eb1ace08dcf95ce98fe4d408c88 Author: Alexander Potapenko Date: Thu Sep 15 17:04:11 2022 +0200 x86: kasan: kmsan: support CONFIG_GENERIC_CSUM on x86, enable it for KASAN/KMSAN This is needed to allow memory tools like KASAN and KMSAN see the memory accesses from the checksum code. Without CONFIG_GENERIC_CSUM the tools can't see memory accesses originating from handwritten assembly code. For KASAN it's a question of detecting more bugs, for KMSAN using the C implementation also helps avoid false positives originating from seemingly uninitialized checksum values. Link: https://lkml.kernel.org/r/20220915150417.722975-38-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 3f1e2c7a9099c1ed32c67f12cdf432ba782cf51f Author: Alexander Potapenko Date: Thu Sep 15 17:04:10 2022 +0200 x86: kmsan: sync metadata pages on page fault KMSAN assumes shadow and origin pages for every allocated page are accessible. For pages between [VMALLOC_START, VMALLOC_END] those metadata pages start at KMSAN_VMALLOC_SHADOW_START and KMSAN_VMALLOC_ORIGIN_START, therefore we must sync a bigger memory region. Link: https://lkml.kernel.org/r/20220915150417.722975-37-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit ff901d80fff6d65ada6f2a60a1f7d180ee2e0416 Author: Alexander Potapenko Date: Thu Sep 15 17:04:09 2022 +0200 x86: kmsan: use __msan_ string functions where possible. Unless stated otherwise (by explicitly calling __memcpy(), __memset() or __memmove()) we want all string functions to call their __msan_ versions (e.g. __msan_memcpy() instead of memcpy()), so that shadow and origin values are updated accordingly. Bootloader must still use the default string functions to avoid crashes. Link: https://lkml.kernel.org/r/20220915150417.722975-36-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 9245ec01ce848eb5147e2e5030cf33ffbf1befff Author: Alexander Potapenko Date: Thu Sep 15 17:04:08 2022 +0200 x86: kmsan: handle open-coded assembly in lib/iomem.c KMSAN cannot intercept memory accesses within asm() statements. That's why we add kmsan_unpoison_memory() and kmsan_check_memory() to hint it how to handle memory copied from/to I/O memory. Link: https://lkml.kernel.org/r/20220915150417.722975-35-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b11671b37f8f4761ff5a3d344553d65238309954 Author: Alexander Potapenko Date: Thu Sep 15 17:04:07 2022 +0200 x86: kmsan: skip shadow checks in __switch_to() When instrumenting functions, KMSAN obtains the per-task state (mostly pointers to metadata for function arguments and return values) once per function at its beginning, using the `current` pointer. Every time the instrumented function calls another function, this state (`struct kmsan_context_state`) is updated with shadow/origin data of the passed and returned values. When `current` changes in the low-level arch code, instrumented code can not notice that, and will still refer to the old state, possibly corrupting it or using stale data. This may result in false positive reports. To deal with that, we need to apply __no_kmsan_checks to the functions performing context switching - this will result in skipping all KMSAN shadow checks and marking newly created values as initialized, preventing all false positive reports in those functions. False negatives are still possible, but we expect them to be rare and impersistent. Link: https://lkml.kernel.org/r/20220915150417.722975-34-glider@google.com Suggested-by: Marco Elver Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 93324e6842148cfdb44d1437fb586b957ace1f8c Author: Alexander Potapenko Date: Thu Sep 15 17:04:06 2022 +0200 x86: kmsan: disable instrumentation of unsupported code Instrumenting some files with KMSAN will result in kernel being unable to link, boot or crashing at runtime for various reasons (e.g. infinite recursion caused by instrumentation hooks calling instrumented code again). Completely omit KMSAN instrumentation in the following places: - arch/x86/boot and arch/x86/realmode/rm, as KMSAN doesn't work for i386; - arch/x86/entry/vdso, which isn't linked with KMSAN runtime; - three files in arch/x86/kernel - boot problems; - arch/x86/mm/cpu_entry_area.c - recursion. Link: https://lkml.kernel.org/r/20220915150417.722975-33-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 40b22c9df2c51c6ce459953f57c720b129332fbf Author: Alexander Potapenko Date: Thu Sep 15 17:04:05 2022 +0200 objtool: kmsan: list KMSAN API functions as uaccess-safe KMSAN inserts API function calls in a lot of places (function entries and exits, local variables, memory accesses), so they may get called from the uaccess regions as well. KMSAN API functions are used to update the metadata (shadow/origin pages) for kernel memory accesses. The metadata pages for kernel pointers are also located in the kernel memory, so touching them is not a problem. For userspace pointers, no metadata is allocated. If an API function is supposed to read or modify the metadata, it does so for kernel pointers and ignores userspace pointers. If an API function is supposed to return a pair of metadata pointers for the instrumentation to use (like all __msan_metadata_ptr_for_TYPE_SIZE() functions do), it returns the allocated metadata for kernel pointers and special dummy buffers residing in the kernel memory for userspace pointers. As a result, none of KMSAN API functions perform userspace accesses, but since they might be called from UACCESS regions they use user_access_save/restore(). Link: https://lkml.kernel.org/r/20220915150417.722975-32-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 42eaa27d9e7aafb4049fc3a5b02005a917013e65 Author: Alexander Potapenko Date: Thu Sep 15 17:04:04 2022 +0200 security: kmsan: fix interoperability with auto-initialization Heap and stack initialization is great, but not when we are trying uses of uninitialized memory. When the kernel is built with KMSAN, having kernel memory initialization enabled may introduce false negatives. We disable CONFIG_INIT_STACK_ALL_PATTERN and CONFIG_INIT_STACK_ALL_ZERO under CONFIG_KMSAN, making it impossible to auto-initialize stack variables in KMSAN builds. We also disable CONFIG_INIT_ON_ALLOC_DEFAULT_ON and CONFIG_INIT_ON_FREE_DEFAULT_ON to prevent accidental use of heap auto-initialization. We however still let the users enable heap auto-initialization at boot-time (by setting init_on_alloc=1 or init_on_free=1), in which case a warning is printed. Link: https://lkml.kernel.org/r/20220915150417.722975-31-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 74d899098854b4e56cf9dc9d0245d4d40f5efcd4 Author: Alexander Potapenko Date: Thu Sep 15 17:04:03 2022 +0200 kcov: kmsan: unpoison area->list in kcov_remote_area_put() KMSAN does not instrument kernel/kcov.c for performance reasons (with CONFIG_KCOV=y virtually every place in the kernel invokes kcov instrumentation). Therefore the tool may miss writes from kcov.c that initialize memory. When CONFIG_DEBUG_LIST is enabled, list pointers from kernel/kcov.c are passed to instrumented helpers in lib/list_debug.c, resulting in false positives. To work around these reports, we unpoison the contents of area->list after initializing it. Link: https://lkml.kernel.org/r/20220915150417.722975-30-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 11b331f857b5fc3ff76bfec36c44a137a6b37de1 Author: Alexander Potapenko Date: Thu Sep 15 17:04:02 2022 +0200 block: kmsan: skip bio block merging logic for KMSAN KMSAN doesn't allow treating adjacent memory pages as such, if they were allocated by different alloc_pages() calls. The block layer however does so: adjacent pages end up being used together. To prevent this, make page_is_mergeable() return false under KMSAN. Link: https://lkml.kernel.org/r/20220915150417.722975-29-glider@google.com Signed-off-by: Alexander Potapenko Suggested-by: Eric Biggers Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit f630a5d0ca59a6e73b61e3f82c371dc230da99ff Author: Alexander Potapenko Date: Thu Sep 15 17:04:01 2022 +0200 kmsan: disable physical page merging in biovec KMSAN metadata for adjacent physical pages may not be adjacent, therefore accessing such pages together may lead to metadata corruption. We disable merging pages in biovec to prevent such corruptions. Link: https://lkml.kernel.org/r/20220915150417.722975-28-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 440fed95ebc30420d1f7802c6578f95e18523140 Author: Alexander Potapenko Date: Thu Sep 15 17:04:00 2022 +0200 crypto: kmsan: disable accelerated configs under KMSAN KMSAN is unable to understand when initialized values come from assembly. Disable accelerated configs in KMSAN builds to prevent false positive reports. Link: https://lkml.kernel.org/r/20220915150417.722975-27-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 2de6f3bf75058e35eff04e6fab7ca41533bdb027 Author: Alexander Potapenko Date: Thu Sep 15 17:03:59 2022 +0200 kmsan: disable strscpy() optimization under KMSAN Disable the efficient 8-byte reading under KMSAN to avoid false positives. Link: https://lkml.kernel.org/r/20220915150417.722975-26-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 8ed691b02ade8f755f34aa1fa8beff8ce4f81f6d Author: Alexander Potapenko Date: Thu Sep 15 17:03:58 2022 +0200 kmsan: add tests for KMSAN The testing module triggers KMSAN warnings in different cases and checks that the errors are properly reported, using console probes to capture the tool's output. Link: https://lkml.kernel.org/r/20220915150417.722975-25-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 553a80188a5d7164d2b0688b06bf3fe297023bfe Author: Alexander Potapenko Date: Thu Sep 15 17:03:57 2022 +0200 kmsan: handle memory sent to/from USB Depending on the value of is_out kmsan_handle_urb() KMSAN either marks the data copied to the kernel from a USB device as initialized, or checks the data sent to the device for being initialized. Link: https://lkml.kernel.org/r/20220915150417.722975-24-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 88938359e2dfe1f5f5840268b98935948db8fbd9 Author: Alexander Potapenko Date: Thu Sep 15 17:03:56 2022 +0200 virtio: kmsan: check/unpoison scatterlist in vring_map_one_sg() If vring doesn't use the DMA API, KMSAN is unable to tell whether the memory is initialized by hardware. Explicitly call kmsan_handle_dma() from vring_map_one_sg() in this case to prevent false positives. Link: https://lkml.kernel.org/r/20220915150417.722975-23-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Michael S. Tsirkin Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 7ade4f10779cb46f5c29ced9b7a41f68501cf0ed Author: Alexander Potapenko Date: Thu Sep 15 17:03:55 2022 +0200 dma: kmsan: unpoison DMA mappings KMSAN doesn't know about DMA memory writes performed by devices. We unpoison such memory when it's mapped to avoid false positive reports. Link: https://lkml.kernel.org/r/20220915150417.722975-22-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 38317724f6a85572af373229a27e214d5282ddf8 Author: Alexander Potapenko Date: Thu Sep 15 17:03:54 2022 +0200 input: libps2: mark data received in __ps2_command() as initialized KMSAN does not know that the device initializes certain bytes in ps2dev->cmdbuf. Call kmsan_unpoison_memory() to explicitly mark them as initialized. Link: https://lkml.kernel.org/r/20220915150417.722975-21-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit a28a4d4723c11fe5fd3e725f5eb1b3472e80fe12 Author: Alexander Potapenko Date: Thu Sep 15 17:03:53 2022 +0200 kmsan: add iomap support Functions from lib/iomap.c interact with hardware, so KMSAN must ensure that: - every read function returns an initialized value - every write function checks values before sending them to hardware. Link: https://lkml.kernel.org/r/20220915150417.722975-20-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 75cf0290271bf6dae9dee982aef15242dadf97e4 Author: Alexander Potapenko Date: Thu Sep 15 17:03:52 2022 +0200 instrumented.h: add KMSAN support To avoid false positives, KMSAN needs to unpoison the data copied from the userspace. To detect infoleaks - check the memory buffer passed to copy_to_user(). Link: https://lkml.kernel.org/r/20220915150417.722975-19-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 3c206509826094e85ead0b056f484db96829248d Author: Alexander Potapenko Date: Thu Sep 15 17:03:51 2022 +0200 init: kmsan: call KMSAN initialization routines kmsan_init_shadow() scans the mappings created at boot time and creates metadata pages for those mappings. When the memblock allocator returns pages to pagealloc, we reserve 2/3 of those pages and use them as metadata for the remaining 1/3. Once KMSAN starts, every page allocated by pagealloc has its associated shadow and origin pages. kmsan_initialize() initializes the bookkeeping for init_task and enables KMSAN. Link: https://lkml.kernel.org/r/20220915150417.722975-18-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 50b5e49ca694a60f84a2a12d62b6cb6ec8e3649f Author: Alexander Potapenko Date: Thu Sep 15 17:03:50 2022 +0200 kmsan: handle task creation and exiting Tell KMSAN that a new task is created, so the tool creates a backing metadata structure for that task. Link: https://lkml.kernel.org/r/20220915150417.722975-17-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 68ef169a1dd20df5cfa5a161b7304ad9fdd14c36 Author: Alexander Potapenko Date: Thu Sep 15 17:03:49 2022 +0200 mm: kmsan: call KMSAN hooks from SLUB code In order to report uninitialized memory coming from heap allocations KMSAN has to poison them unless they're created with __GFP_ZERO. It's handy that we need KMSAN hooks in the places where init_on_alloc/init_on_free initialization is performed. In addition, we apply __no_kmsan_checks to get_freepointer_safe() to suppress reports when accessing freelist pointers that reside in freed objects. Link: https://lkml.kernel.org/r/20220915150417.722975-16-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b073d7f8aee4ebf05d10e3380df377b73120cf16 Author: Alexander Potapenko Date: Thu Sep 15 17:03:48 2022 +0200 mm: kmsan: maintain KMSAN metadata for page operations Insert KMSAN hooks that make the necessary bookkeeping changes: - poison page shadow and origins in alloc_pages()/free_page(); - clear page shadow and origins in clear_page(), copy_user_highpage(); - copy page metadata in copy_highpage(), wp_page_copy(); - handle vmap()/vunmap()/iounmap(); Link: https://lkml.kernel.org/r/20220915150417.722975-15-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit d596b04f5967c75c196eb582fefba49488c57289 Author: Alexander Potapenko Date: Thu Sep 15 17:03:47 2022 +0200 MAINTAINERS: add entry for KMSAN Add entry for KMSAN maintainers/reviewers. Link: https://lkml.kernel.org/r/20220915150417.722975-14-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 79dbd006a6d6f51777ba4948046561b6d9270504 Author: Alexander Potapenko Date: Thu Sep 15 17:03:46 2022 +0200 kmsan: disable instrumentation of unsupported common kernel code EFI stub cannot be linked with KMSAN runtime, so we disable instrumentation for it. Instrumenting kcov, stackdepot or lockdep leads to infinite recursion caused by instrumentation hooks calling instrumented code again. Link: https://lkml.kernel.org/r/20220915150417.722975-13-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit f80be4571b19b9fd8dd1528cd2a2f123aff51f70 Author: Alexander Potapenko Date: Thu Sep 15 17:03:45 2022 +0200 kmsan: add KMSAN runtime core For each memory location KernelMemorySanitizer maintains two types of metadata: 1. The so-called shadow of that location - а byte:byte mapping describing whether or not individual bits of memory are initialized (shadow is 0) or not (shadow is 1). 2. The origins of that location - а 4-byte:4-byte mapping containing 4-byte IDs of the stack traces where uninitialized values were created. Each struct page now contains pointers to two struct pages holding KMSAN metadata (shadow and origins) for the original struct page. Utility routines in mm/kmsan/core.c and mm/kmsan/shadow.c handle the metadata creation, addressing, copying and checking. mm/kmsan/report.c performs error reporting in the cases an uninitialized value is used in a way that leads to undefined behavior. KMSAN compiler instrumentation is responsible for tracking the metadata along with the kernel memory. mm/kmsan/instrumentation.c provides the implementation for instrumentation hooks that are called from files compiled with -fsanitize=kernel-memory. To aid parameter passing (also done at instrumentation level), each task_struct now contains a struct kmsan_task_state used to track the metadata of function parameters and return values for that task. Finally, this patch provides CONFIG_KMSAN that enables KMSAN, and declares CFLAGS_KMSAN, which are applied to files compiled with KMSAN. The KMSAN_SANITIZE:=n Makefile directive can be used to completely disable KMSAN instrumentation for certain files. Similarly, KMSAN_ENABLE_CHECKS:=n disables KMSAN checks and makes newly created stack memory initialized. Users can also use functions from include/linux/kmsan-checks.h to mark certain memory regions as uninitialized or initialized (this is called "poisoning" and "unpoisoning") or check that a particular region is initialized. Link: https://lkml.kernel.org/r/20220915150417.722975-12-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6e9f05dc66f951e8812c84a3ef148b601e3f8f45 Author: Alexander Potapenko Date: Thu Sep 15 17:03:44 2022 +0200 libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE KMSAN adds extra metadata fields to struct page, so it does not fit into 64 bytes anymore. This change leads to increased memory consumption of the nvdimm driver, regardless of whether the kernel is built with KMSAN or not. Link: https://lkml.kernel.org/r/20220915150417.722975-11-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 1a167ddd3c561b21a76187a81530a167e3522261 Author: Alexander Potapenko Date: Thu Sep 15 17:03:43 2022 +0200 x86: kmsan: pgtable: reduce vmalloc space KMSAN is going to use 3/4 of existing vmalloc space to hold the metadata, therefore we lower VMALLOC_END to make sure vmalloc() doesn't allocate past the first 1/4. Link: https://lkml.kernel.org/r/20220915150417.722975-10-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 5de0ce85f5a4d2883eae6f48eb015bc5dfbd91e9 Author: Alexander Potapenko Date: Thu Sep 15 17:03:42 2022 +0200 kmsan: mark noinstr as __no_sanitize_memory noinstr functions should never be instrumented, so make KMSAN skip them by applying the __no_sanitize_memory attribute. Link: https://lkml.kernel.org/r/20220915150417.722975-9-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 9b448bc25b776daab3215393c3ce6953dd3bb8ad Author: Alexander Potapenko Date: Thu Sep 15 17:03:41 2022 +0200 kmsan: introduce __no_sanitize_memory and __no_kmsan_checks __no_sanitize_memory is a function attribute that instructs KMSAN to skip a function during instrumentation. This is needed to e.g. implement the noinstr functions. __no_kmsan_checks is a function attribute that makes KMSAN ignore the uninitialized values coming from the function's inputs, and initialize the function's outputs. Functions marked with this attribute can't be inlined into functions not marked with it, and vice versa. This behavior is overridden by __always_inline. __SANITIZE_MEMORY__ is a macro that's defined iff the file is instrumented with KMSAN. This is not the same as CONFIG_KMSAN, which is defined for every file. Link: https://lkml.kernel.org/r/20220915150417.722975-8-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 93858ae70cf4fb2ec75ae2f1e495b85b26614883 Author: Alexander Potapenko Date: Thu Sep 15 17:03:40 2022 +0200 kmsan: add ReST documentation Add Documentation/dev-tools/kmsan.rst and reference it in the dev-tools index. Link: https://lkml.kernel.org/r/20220915150417.722975-7-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 2b420aaf80408fd45d86ce983819813d43ac210f Author: Alexander Potapenko Date: Thu Sep 15 17:03:39 2022 +0200 asm-generic: instrument usercopy in cacheflush.h Notify memory tools about usercopy events in copy_to_user_page() and copy_from_user_page(). Link: https://lkml.kernel.org/r/20220915150417.722975-6-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 888f84a6da4d17e453058169fa7b235fff34f5bf Author: Alexander Potapenko Date: Thu Sep 15 17:03:38 2022 +0200 x86: asm: instrument usercopy in get_user() and put_user() Use hooks from instrumented.h to notify bug detection tools about usercopy events in variations of get_user() and put_user(). Link: https://lkml.kernel.org/r/20220915150417.722975-5-glider@google.com Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 33b75c1d884e81ec97525e0a6fdcb187adf273f4 Author: Alexander Potapenko Date: Thu Sep 15 17:03:37 2022 +0200 instrumented.h: allow instrumenting both sides of copy_from_user() Introduce instrument_copy_from_user_before() and instrument_copy_from_user_after() hooks to be invoked before and after the call to copy_from_user(). KASAN and KCSAN will be only using instrument_copy_from_user_before(), but for KMSAN we'll need to insert code after copy_from_user(). Link: https://lkml.kernel.org/r/20220915150417.722975-4-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 83a4f1ef45a90d740bc6edf6a2533b14a3e5d183 Author: Alexander Potapenko Date: Thu Sep 15 17:03:36 2022 +0200 stackdepot: reserve 5 extra bits in depot_stack_handle_t Some users (currently only KMSAN) may want to use spare bits in depot_stack_handle_t. Let them do so by adding @extra_bits to __stack_depot_save() to store arbitrary flags, and providing stack_depot_get_extra_bits() to retrieve those flags. Also adapt KASAN to the new prototype by passing extra_bits=0, as KASAN does not intend to store additional information in the stack handle. Link: https://lkml.kernel.org/r/20220915150417.722975-3-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit e41e614f6a3e3d0d21874a785d3a67d353e282da Author: Dmitry Vyukov Date: Thu Sep 15 17:03:35 2022 +0200 x86: add missing include to sparsemem.h Patch series "Add KernelMemorySanitizer infrastructure", v7. KernelMemorySanitizer (KMSAN) is a detector of errors related to uses of uninitialized memory. It relies on compile-time Clang instrumentation (similar to MSan in the userspace [1]) and tracks the state of every bit of kernel memory, being able to report an error if uninitialized value is used in a condition, dereferenced, or escapes to userspace, USB or DMA. KMSAN has reported more than 300 bugs in the past few years (recently fixed bugs: [2]), most of them with the help of syzkaller. Such bugs keep getting introduced into the kernel despite new compiler warnings and other analyses (the 6.0 cycle already resulted in several KMSAN-reported bugs, e.g. [3]). Mitigations like total stack and heap initialization are unfortunately very far from being deployable. The proposed patchset contains KMSAN runtime implementation together with small changes to other subsystems needed to make KMSAN work. The latter changes fall into several categories: 1. Changes and refactorings of existing code required to add KMSAN: - [01/43] x86: add missing include to sparsemem.h - [02/43] stackdepot: reserve 5 extra bits in depot_stack_handle_t - [03/43] instrumented.h: allow instrumenting both sides of copy_from_user() - [04/43] x86: asm: instrument usercopy in get_user() and __put_user_size() - [05/43] asm-generic: instrument usercopy in cacheflush.h - [10/43] libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE 2. KMSAN-related declarations in generic code, KMSAN runtime library, docs and configs: - [06/43] kmsan: add ReST documentation - [07/43] kmsan: introduce __no_sanitize_memory and __no_kmsan_checks - [09/43] x86: kmsan: pgtable: reduce vmalloc space - [11/43] kmsan: add KMSAN runtime core - [13/43] MAINTAINERS: add entry for KMSAN - [24/43] kmsan: add tests for KMSAN - [31/43] objtool: kmsan: list KMSAN API functions as uaccess-safe - [35/43] x86: kmsan: use __msan_ string functions where possible - [43/43] x86: kmsan: enable KMSAN builds for x86 3. Adding hooks from different subsystems to notify KMSAN about memory state changes: - [14/43] mm: kmsan: maintain KMSAN metadata for page - [15/43] mm: kmsan: call KMSAN hooks from SLUB code - [16/43] kmsan: handle task creation and exiting - [17/43] init: kmsan: call KMSAN initialization routines - [18/43] instrumented.h: add KMSAN support - [19/43] kmsan: add iomap support - [20/43] Input: libps2: mark data received in __ps2_command() as initialized - [21/43] dma: kmsan: unpoison DMA mappings - [34/43] x86: kmsan: handle open-coded assembly in lib/iomem.c - [36/43] x86: kmsan: sync metadata pages on page fault 4. Changes that prevent false reports by explicitly initializing memory, disabling optimized code that may trick KMSAN, selectively skipping instrumentation: - [08/43] kmsan: mark noinstr as __no_sanitize_memory - [12/43] kmsan: disable instrumentation of unsupported common kernel code - [22/43] virtio: kmsan: check/unpoison scatterlist in vring_map_one_sg() - [23/43] kmsan: handle memory sent to/from USB - [25/43] kmsan: disable strscpy() optimization under KMSAN - [26/43] crypto: kmsan: disable accelerated configs under KMSAN - [27/43] kmsan: disable physical page merging in biovec - [28/43] block: kmsan: skip bio block merging logic for KMSAN - [29/43] kcov: kmsan: unpoison area->list in kcov_remote_area_put() - [30/43] security: kmsan: fix interoperability with auto-initialization - [32/43] x86: kmsan: disable instrumentation of unsupported code - [33/43] x86: kmsan: skip shadow checks in __switch_to() - [37/43] x86: kasan: kmsan: support CONFIG_GENERIC_CSUM on x86, enable it for KASAN/KMSAN - [38/43] x86: fs: kmsan: disable CONFIG_DCACHE_WORD_ACCESS - [39/43] x86: kmsan: don't instrument stack walking functions - [40/43] entry: kmsan: introduce kmsan_unpoison_entry_regs() 5. Fixes for bugs detected with CONFIG_KMSAN_CHECK_PARAM_RETVAL: - [41/43] bpf: kmsan: initialize BPF registers with zeroes - [42/43] mm: fs: initialize fsdata passed to write_begin/write_end interface This patchset allows one to boot and run a defconfig+KMSAN kernel on a QEMU without known false positives. It however doesn't guarantee there are no false positives in drivers of certain devices or less tested subsystems, although KMSAN is actively tested on syzbot with a large config. By default, KMSAN enforces conservative checks of most kernel function parameters passed by value (via CONFIG_KMSAN_CHECK_PARAM_RETVAL, which maps to the -fsanitize-memory-param-retval compiler flag). As discussed in [4] and [5], passing uninitialized values as function parameters is considered undefined behavior, therefore KMSAN now reports such cases as errors. Several newly added patches fix known manifestations of these errors. This patch (of 43): Including sparsemem.h from other files (e.g. transitively via asm/pgtable_64_types.h) results in compilation errors due to unknown types: sparsemem.h:34:32: error: unknown type name 'phys_addr_t' extern int phys_to_target_node(phys_addr_t start); ^ sparsemem.h:36:39: error: unknown type name 'u64' extern int memory_add_physaddr_to_nid(u64 start); ^ Fix these errors by including linux/types.h from sparsemem.h This is required for the upcoming KMSAN patches. Link: https://lkml.kernel.org/r/20220915150417.722975-1-glider@google.com Link: https://lkml.kernel.org/r/20220915150417.722975-2-glider@google.com Signed-off-by: Dmitry Vyukov Signed-off-by: Alexander Potapenko Cc: Alexander Viro Cc: Alexei Starovoitov Cc: Andrey Konovalov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Christoph Lameter Cc: David Rientjes Cc: Eric Biggers Cc: Eric Dumazet Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Ilya Leoshkevich Cc: Ingo Molnar Cc: Jens Axboe Cc: Joonsoo Kim Cc: Kees Cook Cc: Marco Elver Cc: Mark Rutland Cc: Matthew Wilcox Cc: Michael S. Tsirkin Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Petr Mladek Cc: Stephen Rothwell Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vegard Nossum Cc: Vlastimil Babka Cc: Andrey Konovalov Cc: Eric Biggers Signed-off-by: Andrew Morton commit fa27759af4a6d7494c986c44695b13bcd6eaf46b Author: Mike Kravetz Date: Wed Sep 14 15:18:10 2022 -0700 hugetlb: clean up code checking for fault/truncation races With the new hugetlb vma lock in place, it can also be used to handle page fault races with file truncation. The lock is taken at the beginning of the code fault path in read mode. During truncation, it is taken in write mode for each vma which has the file mapped. The file's size (i_size) is modified before taking the vma lock to unmap. How are races handled? The page fault code checks i_size early in processing after taking the vma lock. If the fault is beyond i_size, the fault is aborted. If the fault is not beyond i_size the fault will continue and a new page will be added to the file. It could be that truncation code modifies i_size after the check in fault code. That is OK, as truncation code will soon remove the page. The truncation code will wait until the fault is finished, as it must obtain the vma lock in write mode. This patch cleans up/removes late checks in the fault paths that try to back out pages racing with truncation. As noted above, we just let the truncation code remove the pages. [mike.kravetz@oracle.com: fix reserve_alloc set but not used compiler warning] Link: https://lkml.kernel.org/r/Yyj7HsJWfHDoU24U@monkey Link: https://lkml.kernel.org/r/20220914221810.95771-10-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 40549ba8f8e0ed1f8b235979563f619e9aa34fdf Author: Mike Kravetz Date: Wed Sep 14 15:18:09 2022 -0700 hugetlb: use new vma_lock for pmd sharing synchronization The new hugetlb vma lock is used to address this race: Faulting thread Unsharing thread ... ... ptep = huge_pte_offset() or ptep = huge_pte_alloc() ... i_mmap_lock_write lock page table ptep invalid <------------------------ huge_pmd_unshare() Could be in a previously unlock_page_table sharing process or worse i_mmap_unlock_write ... The vma_lock is used as follows: - During fault processing. The lock is acquired in read mode before doing a page table lock and allocation (huge_pte_alloc). The lock is held until code is finished with the page table entry (ptep). - The lock must be held in write mode whenever huge_pmd_unshare is called. Lock ordering issues come into play when unmapping a page from all vmas mapping the page. The i_mmap_rwsem must be held to search for the vmas, and the vma lock must be held before calling unmap which will call huge_pmd_unshare. This is done today in: - try_to_migrate_one and try_to_unmap_ for page migration and memory error handling. In these routines we 'try' to obtain the vma lock and fail to unmap if unsuccessful. Calling routines already deal with the failure of unmapping. - hugetlb_vmdelete_list for truncation and hole punch. This routine also tries to acquire the vma lock. If it fails, it skips the unmapping. However, we can not have file truncation or hole punch fail because of contention. After hugetlb_vmdelete_list, truncation and hole punch call remove_inode_hugepages. remove_inode_hugepages checks for mapped pages and call hugetlb_unmap_file_page to unmap them. hugetlb_unmap_file_page is designed to drop locks and reacquire in the correct order to guarantee unmap success. Link: https://lkml.kernel.org/r/20220914221810.95771-9-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Miaohe Lin Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 378397ccb8e5a695a42e819df545ccd28641b683 Author: Mike Kravetz Date: Wed Sep 14 15:18:08 2022 -0700 hugetlb: create hugetlb_unmap_file_folio to unmap single file folio Create the new routine hugetlb_unmap_file_folio that will unmap a single file folio. This is refactored code from hugetlb_vmdelete_list. It is modified to do locking within the routine itself and check whether the page is mapped within a specific vma before unmapping. This refactoring will be put to use and expanded upon in a subsequent patch adding vma specific locking. Link: https://lkml.kernel.org/r/20220914221810.95771-8-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 8d9bfb2608145cf3e408428c224099e1585471af Author: Mike Kravetz Date: Wed Sep 14 15:18:07 2022 -0700 hugetlb: add vma based lock for pmd sharing Allocate a new hugetlb_vma_lock structure and hang off vm_private_data for synchronization use by vmas that could be involved in pmd sharing. This data structure contains a rw semaphore that is the primary tool used for synchronization. This new structure is ref counted, so that it can exist when NOT attached to a vma. This is only helpful in resolving lock ordering issues where code may need to obtain the vma_lock while there are no guarantees the vma may go away. By obtaining a ref on the structure, it can be guaranteed that at least the rw semaphore will not go away. Only add infrastructure for the new lock here. Actual use will be added in subsequent patches. [mike.kravetz@oracle.com: fix build issue for missing hugetlb_vma_lock_release] Link: https://lkml.kernel.org/r/YyNUtA1vRASOE4+M@monkey Link: https://lkml.kernel.org/r/20220914221810.95771-7-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 12710fd696343a0d6c318bdad22fa7809af7859b Author: Mike Kravetz Date: Wed Sep 14 15:18:06 2022 -0700 hugetlb: rename vma_shareable() and refactor code Rename the routine vma_shareable to vma_addr_pmd_shareable as it is checking a specific address within the vma. Refactor code to check if an aligned range is shareable as this will be needed in a subsequent patch. Link: https://lkml.kernel.org/r/20220914221810.95771-6-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit c86272287bc65cb3d698a95c19651265e9f287cd Author: Mike Kravetz Date: Wed Sep 14 15:18:05 2022 -0700 hugetlb: create remove_inode_single_folio to remove single file folio Create the new routine remove_inode_single_folio that will remove a single folio from a file. This is refactored code from remove_inode_hugepages. It checks for the uncommon case in which the folio is still mapped and unmaps. No functional change. This refactoring will be put to use and expanded upon in a subsequent patches. Link: https://lkml.kernel.org/r/20220914221810.95771-5-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 7e1813d48dd30e6c6f235f6661d1bc108fcab528 Author: Mike Kravetz Date: Wed Sep 14 15:18:04 2022 -0700 hugetlb: rename remove_huge_page to hugetlb_delete_from_page_cache remove_huge_page removes a hugetlb page from the page cache. Change to hugetlb_delete_from_page_cache as it is a more descriptive name. huge_add_to_page_cache is global in scope, but only deals with hugetlb pages. For consistency and clarity, rename to hugetlb_add_to_page_cache. Link: https://lkml.kernel.org/r/20220914221810.95771-4-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 3a47c54f09c4c89128d8f67d49296b1c25b317d0 Author: Mike Kravetz Date: Wed Sep 14 15:18:03 2022 -0700 hugetlbfs: revert use i_mmap_rwsem for more pmd sharing synchronization Commit c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") added code to take i_mmap_rwsem in read mode for the duration of fault processing. However, this has been shown to cause performance/scaling issues. Revert the code and go back to only taking the semaphore in huge_pmd_share during the fault path. Keep the code that takes i_mmap_rwsem in write mode before calling try_to_unmap as this is required if huge_pmd_unshare is called. NOTE: Reverting this code does expose the following race condition. Faulting thread Unsharing thread ... ... ptep = huge_pte_offset() or ptep = huge_pte_alloc() ... i_mmap_lock_write lock page table ptep invalid <------------------------ huge_pmd_unshare() Could be in a previously unlock_page_table sharing process or worse i_mmap_unlock_write ... ptl = huge_pte_lock(ptep) get/update pte set_pte_at(pte, ptep) It is unknown if the above race was ever experienced by a user. It was discovered via code inspection when initially addressed. In subsequent patches, a new synchronization mechanism will be added to coordinate pmd sharing and eliminate this race. Link: https://lkml.kernel.org/r/20220914221810.95771-3-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 188a39725ad7ded2d13e752a1a620152b0750175 Author: Mike Kravetz Date: Wed Sep 14 15:18:02 2022 -0700 hugetlbfs: revert use i_mmap_rwsem to address page fault/truncate race Patch series "hugetlb: Use new vma lock for huge pmd sharing synchronization", v2. hugetlb fault scalability regressions have recently been reported [1]. This is not the first such report, as regressions were also noted when commit c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") was added [2] in v5.7. At that time, a proposal to address the regression was suggested [3] but went nowhere. The regression and benefit of this patch series is not evident when using the vm_scalability benchmark reported in [2] on a recent kernel. Results from running, "./usemem -n 48 --prealloc --prefault -O -U 3448054972" 48 sample Avg next-20220913 next-20220913 next-20220913 unmodified revert i_mmap_sema locking vma sema locking, this series ----------------------------------------------------------------------------- 498150 KB/s 501934 KB/s 504793 KB/s The recent regression report [1] notes page fault and fork latency of shared hugetlb mappings. To measure this, I created two simple programs: 1) map a shared hugetlb area, write fault all pages, unmap area Do this in a continuous loop to measure faults per second 2) map a shared hugetlb area, write fault a few pages, fork and exit Do this in a continuous loop to measure forks per second These programs were run on a 48 CPU VM with 320GB memory. The shared mapping size was 250GB. For comparison, a single instance of the program was run. Then, multiple instances were run in parallel to introduce lock contention. Changing the locking scheme results in a significant performance benefit. test instances unmodified revert vma -------------------------------------------------------------------------- faults per sec 1 393043 395680 389932 faults per sec 24 71405 81191 79048 forks per sec 1 2802 2747 2725 forks per sec 24 439 536 500 Combined faults 24 1621 68070 53662 Combined forks 24 358 67 142 Combined test is when running both faulting program and forking program simultaneously. Patches 1 and 2 of this series revert c0d0381ade79 and 87bf91d39bb5 which depends on c0d0381ade79. Acquisition of i_mmap_rwsem is still required in the fault path to establish pmd sharing, so this is moved back to huge_pmd_share. With c0d0381ade79 reverted, this race is exposed: Faulting thread Unsharing thread ... ... ptep = huge_pte_offset() or ptep = huge_pte_alloc() ... i_mmap_lock_write lock page table ptep invalid <------------------------ huge_pmd_unshare() Could be in a previously unlock_page_table sharing process or worse i_mmap_unlock_write ... ptl = huge_pte_lock(ptep) get/update pte set_pte_at(pte, ptep) Reverting 87bf91d39bb5 exposes races in page fault/file truncation. When the new vma lock is put to use in patch 8, this will handle the fault/file truncation races. This is explained in patch 9 where code associated with these races is cleaned up. Patches 3 - 5 restructure existing code in preparation for using the new vma lock (rw semaphore) for pmd sharing synchronization. The idea is that this semaphore will be held in read mode for the duration of fault processing, and held in write mode for unmap operations which may call huge_pmd_unshare. Acquiring i_mmap_rwsem is also still required to synchronize huge pmd sharing. However it is only required in the fault path when setting up sharing, and will be acquired in huge_pmd_share(). Patch 6 adds the new vma lock and all supporting routines, but does not actually change code to use the new lock. Patch 7 refactors code in preparation for using the new lock. And, patch 8 finally adds code to make use of this new vma lock. Unfortunately, the fault code and truncate/hole punch code would naturally take locks in the opposite order which could lead to deadlock. Since the performance of page faults is more important, the truncation/hole punch code is modified to back out and take locks in the correct order if necessary. [1] https://lore.kernel.org/linux-mm/43faf292-245b-5db5-cce9-369d8fb6bd21@infradead.org/ [2] https://lore.kernel.org/lkml/20200622005551.GK5535@shao2-debian/ [3] https://lore.kernel.org/linux-mm/20200706202615.32111-1-mike.kravetz@oracle.com/ This patch (of 9): Commit c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") added code to take i_mmap_rwsem in read mode for the duration of fault processing. The use of i_mmap_rwsem to prevent fault/truncate races depends on this. However, this has been shown to cause performance/scaling issues. As a result, that code will be reverted. Since the use i_mmap_rwsem to address page fault/truncate races depends on this, it must also be reverted. In a subsequent patch, code will be added to detect the fault/truncate race and back out operations as required. Link: https://lkml.kernel.org/r/20220914221810.95771-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20220914221810.95771-2-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Miaohe Lin Cc: Andrea Arcangeli Cc: "Aneesh Kumar K.V" Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: James Houghton Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mina Almasry Cc: Muchun Song Cc: Naoya Horiguchi Cc: Pasha Tatashin Cc: Peter Xu Cc: Prakash Sangappa Cc: Sven Schnelle Signed-off-by: Andrew Morton commit 3259914f8cab1bab3fe691a90ac3c47411cb0aba Author: XU pengfei Date: Wed Sep 14 09:21:14 2022 +0800 mm/hugetlb: remove unnecessary 'NULL' values from pointer Pointer variables allocate memory first, and then judge. There is no need to initialize the assignment. Link: https://lkml.kernel.org/r/20220914012113.6271-1-xupengfei@nfschina.com Signed-off-by: XU pengfei Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit c195c3215741746b1eb7ab7980b926ddc37a4be3 Author: Ke Sun Date: Wed Sep 14 10:17:38 2022 +0800 mm/filemap: make folio_put_wait_locked static It's only used in mm/filemap.c, since commit ("mm/migrate.c: rework migration_entry_wait() to not take a pageref"). Make it static. Link: https://lkml.kernel.org/r/20220914021738.3228011-1-sunke@kylinos.cn Signed-off-by: Ke Sun Reported-by: k2ci Signed-off-by: Andrew Morton commit a4a00b451ef5e1deb959088e25e248f4ee399792 Author: Muchun Song Date: Wed Sep 14 15:26:03 2022 +0800 mm: hugetlb: eliminate memory-less nodes handling The memory-notify-based approach aims to handle meory-less nodes, however, it just adds the complexity of code as pointed by David in thread [1]. The handling of memory-less nodes is introduced by commit 4faf8d950ec4 ("hugetlb: handle memory hot-plug events"). >From its commit message, we cannot find any necessity of handling this case. So, we can simply register/unregister sysfs entries in register_node/unregister_node to simlify the code. BTW, hotplug callback added because in hugetlb_register_all_nodes() we register sysfs nodes only for N_MEMORY nodes, seeing commit 9b5e5d0fdc91, which said it was a preparation for handling memory-less nodes via memory hotplug. Since we want to remove memory hotplug, so make sure we only register per-node sysfs for online (N_ONLINE) nodes in hugetlb_register_all_nodes(). https://lore.kernel.org/linux-mm/60933ffc-b850-976c-78a0-0ee6e0ea9ef0@redhat.com/ [1] Link: https://lkml.kernel.org/r/20220914072603.60293-3-songmuchun@bytedance.com Suggested-by: David Hildenbrand Signed-off-by: Muchun Song Acked-by: David Hildenbrand Cc: Andi Kleen Cc: Greg Kroah-Hartman Cc: Mike Kravetz Cc: Oscar Salvador Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit b958d4d08fbfe938af24ea06ebbf839b48fa18a9 Author: Muchun Song Date: Wed Sep 14 15:26:02 2022 +0800 mm: hugetlb: simplify per-node sysfs creation and removal Patch series "simplify handling of per-node sysfs creation and removal", v4. This patch (of 2): The following commit offload per-node sysfs creation and removal to a kworker and did not say why it is needed. And it also said "I don't know that this is absolutely required". It seems like the author was not sure as well. Since it only complicates the code, this patch will revert the changes to simplify the code. 39da08cb074c ("hugetlb: offload per node attribute registrations") We could use memory hotplug notifier to do per-node sysfs creation and removal instead of inserting those operations to node registration and unregistration. Then, it can reduce the code coupling between node.c and hugetlb.c. Also, it can simplify the code. Link: https://lkml.kernel.org/r/20220914072603.60293-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220914072603.60293-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Mike Kravetz Acked-by: David Hildenbrand Cc: Andi Kleen Cc: Greg Kroah-Hartman Cc: Muchun Song Cc: Oscar Salvador Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit aaa31e058dd82453c89302c9331945894ff555a6 Author: ze zuo Date: Tue Sep 13 01:55:05 2022 +0000 mm/mempolicy: use PAGE_ALIGN instead of open-coding it Replace the simple calculation with PAGE_ALIGN. Link: https://lkml.kernel.org/r/20220913015505.1998958-1-zuoze1@huawei.com Signed-off-by: ze zuo Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit d452289fcd68f13f4067f0ddd78a5d948cb7d9ea Author: Andrew Morton Date: Tue Sep 13 15:30:38 2022 -0700 mm/page_alloc.c: document bulkfree_pcp_prepare() return value Cc: Catalin Marinas Cc: ke.wang Cc: Matthew Wilcox Cc: Zhaoyang Huang Signed-off-by: Andrew Morton commit a8368cd8e22531b3b248a2c869d71b668aeeb789 Author: Andrew Morton Date: Tue Sep 13 15:20:48 2022 -0700 mm/page_alloc.c: rename check_free_page() to free_page_is_bad() The name "check_free_page()" provides no information regarding its return value when the page is indeed found to be bad. Renaming it to "free_page_is_bad()" makes it clear that a `true' return value means the page was bad. And make it return a bool, not an int. [akpm@linux-foundation.org: don't use bool as int] Cc: Catalin Marinas Cc: ke.wang Cc: Matthew Wilcox Cc: Zhaoyang Huang Signed-off-by: Andrew Morton commit 4988fe69527c6e02066aeb454c2db4d6d51d317b Author: Liu Shixin Date: Tue Sep 13 15:13:58 2022 +0800 mm/memcontrol: use kstrtobool for swapaccount param parsing Use kstrtobool which is more powerful to handle all kinds of parameters like 'Yy1Nn0' or [oO][NnFf] for "on" and "off". Link: https://lkml.kernel.org/r/20220913071358.1812206-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Kefeng Wang Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 29454cf6ab3c49bc5d3f443e1d1417feca3d0ce5 Author: Kaixu Xia Date: Tue Sep 13 17:11:26 2022 +0800 mm/damon/core: simplify the kdamond stop mechanism by removing 'done' When the 'kdamond_wait_activation()' function or 'after_sampling()' or 'after_aggregation()' DAMON callbacks return an error, it is unnecessary to use bool 'done' to check if kdamond should be finished. This commit simplifies the kdamond stop mechanism by removing 'done' and break the while loop directly in the cases. Link: https://lkml.kernel.org/r/1663060287-30201-4-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit f1c71c2825218dc8b35c04ab439fdf3d32778c7c Author: Kaixu Xia Date: Tue Sep 13 17:11:25 2022 +0800 mm/damon/sysfs: simplify the variable 'pid' assignment operation We can initialize the variable 'pid' with '-1' in pid_show() to simplify the variable assignment operation and make the code more readable. Link: https://lkml.kernel.org/r/1663060287-30201-3-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 8ef4d5caa66d62b3b87a14d01562fb487651df2e Author: Kaixu Xia Date: Tue Sep 13 17:11:24 2022 +0800 mm/damon: simplify the parameter passing for 'prepare_access_checks' Patch series "mm/damon: code simplifications and cleanups". This patchset contains some code simplifications and cleanups for DAMON. This patch (of 4): The parameter 'struct damon_ctx *ctx' isn't used in the functions __damon_{p,v}a_prepare_access_check(), so we can remove it and simplify the parameter passing. Link: https://lkml.kernel.org/r/1663060287-30201-1-git-send-email-kaixuxia@tencent.com Link: https://lkml.kernel.org/r/1663060287-30201-2-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit a62518ab1da4eb8bf0335c0e254b3e82e9ce222e Author: SeongJae Park Date: Tue Sep 13 17:44:49 2022 +0000 mm/damon/lru_sort: deduplicate hot/cold schemes generators damon_lru_sort_new_{hot,cold}_scheme() have quite a lot of duplicates. This commit factors out the duplicate to a separate function and use it for reducing the duplicate. Link: https://lkml.kernel.org/r/20220913174449.50645-23-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 45b8212fc555d07ed78b9270283d61afbdee1df6 Author: SeongJae Park Date: Tue Sep 13 17:44:48 2022 +0000 mm/damon/lru_sort: use quotas param generator This commit makes DAMON_LRU_SORT to generate the module parameters for DAMOS watermarks using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-22-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit a9d57c7369532cdcd3a834c3f0cc5ad6b2f0f1ff Author: SeongJae Park Date: Tue Sep 13 17:44:47 2022 +0000 mm/damon/reclaim: use the quota params generator macro This commit makes DAMON_RECLAIM to generate the module parameters for DAMOS quotas using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-21-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 1f55402685d10aa336cf9b25e83b416e4fc0c153 Author: SeongJae Park Date: Tue Sep 13 17:44:46 2022 +0000 mm/damon/modules-common: implement damos time quota params generator DAMON_LRU_SORT have module parameters for DAMOS time quota only but size quota. This commit implements a macro for generating the module parameters so that we can reuse later. Link: https://lkml.kernel.org/r/20220913174449.50645-20-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 63e0f90bac0c772c14aecfe36783ab60795d05db Author: SeongJae Park Date: Tue Sep 13 17:44:45 2022 +0000 mm/damon/modules-common: implement a damos quota params generator DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for DAMOS quotas that having same names. This commit implements a macro for generating such module parameters so that we can reuse later. Link: https://lkml.kernel.org/r/20220913174449.50645-19-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit dd172fbf8f1d3befd0a22357a251d8d516354d5f Author: SeongJae Park Date: Tue Sep 13 17:44:44 2022 +0000 mm/damon/lru_sort: use stat generator This commit makes DAMON_LRU_SORT to generate the module parameters for DAMOS statistics using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-18-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit b71f3ea83242890900bb0668201568df81244547 Author: SeongJae Park Date: Tue Sep 13 17:44:43 2022 +0000 mm/damon/reclaim: use stat parameters generator This commit makes DAMON_RECLAIM to generate the module parameters for DAMOS statistics using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-17-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 528ef2d996408d4b9cccf4b23a9976ab5e75cf39 Author: SeongJae Park Date: Tue Sep 13 17:44:42 2022 +0000 mm/damon/modules-common: implement a stats parameters generator macro DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for DAMOS statistics that having same names. This commit implements a macro for generating such module parameters so that we can reuse later. Link: https://lkml.kernel.org/r/20220913174449.50645-16-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 34f47ea688bb6d1c6d04f8d72546a623bd8d59de Author: SeongJae Park Date: Tue Sep 13 17:44:41 2022 +0000 mm/damon/reclaim: use watermarks parameters generator macro This commit makes DAMON_RECLAIM to generate the module parameters for DAMOS watermarks using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-15-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 6517d2d97709e01c6758dcccc7a51e3731c8706f Author: SeongJae Park Date: Tue Sep 13 17:44:40 2022 +0000 mm/damon/lru_sort: use watermarks parameters generator macro This commit makes DAMON_LRU_SORT to generate the module parameters for DAMOS watermarks using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-14-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit b324ee36e9685689a55c1faee669cd7a1a42bae0 Author: SeongJae Park Date: Tue Sep 13 17:44:39 2022 +0000 mm/damon/modules-common: implement a watermarks module parameters generator macro DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for watermarks that having same names. This commit implements a macro for generating such module parameters so that we can reuse later. Link: https://lkml.kernel.org/r/20220913174449.50645-13-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit fdfc119c17cfbc0aa26be6b070f49aa1584a7e08 Author: SeongJae Park Date: Tue Sep 13 17:44:38 2022 +0000 mm/damon/reclaim: use monitoring attributes parameters generator macro This commit makes DAMON_RECLAIM to generate the module parameters for DAMON monitoring attributes using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-12-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 95f7c05d73fc6d9cfe43fb18b2f16b21eb55b5bf Author: SeongJae Park Date: Tue Sep 13 17:44:37 2022 +0000 mm/damon/lru_sort: use monitoring attributes parameters generaotr macro This commit makes DAMON_LRU_SORT to generate the module parameters for DAMON monitoring attributes using the generator macro to simplify the code and reduce duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-11-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit b3c28d886329d8df66679f72f3f3c81c0dd21e88 Author: SeongJae Park Date: Tue Sep 13 17:44:36 2022 +0000 mm/damon: implement a monitoring attributes module parameters generator macro DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for monitoring attributes that having same names. This commot implements a macro for generating such module parameters so that we can reuse later. Link: https://lkml.kernel.org/r/20220913174449.50645-10-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 135e128f8e48f30ea65e0ffad34dca37d2c8d171 Author: SeongJae Park Date: Tue Sep 13 17:44:35 2022 +0000 mm/damon/lru_sort: use 'struct damon_attrs' for storing parameters for it DAMON_LRU_SORT receives monitoring attributes by parameters one by one to separate variables, and then combines those into 'struct damon_attrs'. This commit makes the module directly stores the parameter values to a static 'struct damon_attrs' variable and use it to simplify the code. Link: https://lkml.kernel.org/r/20220913174449.50645-9-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 8c341ae3341188a0bcef02f05aca7345501ce697 Author: SeongJae Park Date: Tue Sep 13 17:44:34 2022 +0000 mm/damon/reclaim: use 'struct damon_attrs' for storing parameters for it DAMON_RECLAIM receives monitoring attributes by parameters one by one to separate variables, and then combine those into 'struct damon_attrs'. This commit makes the module directly stores the parameter values to a static 'struct damon_attrs' variable and use it to simplify the code. Link: https://lkml.kernel.org/r/20220913174449.50645-8-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit bead3b00088eb8016b32cafa7e0701b3283e68a4 Author: SeongJae Park Date: Tue Sep 13 17:44:33 2022 +0000 mm/damon/core: reduce parameters for damon_set_attrs() Number of parameters for 'damon_set_attrs()' is six. As it could be confusing and verbose, this commit reduces the number by receiving single pointer to a 'struct damon_attrs'. Link: https://lkml.kernel.org/r/20220913174449.50645-7-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit cbeaa77b044938cfe91818821ece6b0b1511e967 Author: SeongJae Park Date: Tue Sep 13 17:44:32 2022 +0000 mm/damon/core: use a dedicated struct for monitoring attributes DAMON monitoring attributes are directly defined as fields of 'struct damon_ctx'. This makes 'struct damon_ctx' a little long and complicated. This commit defines and uses a struct, 'struct damon_attrs', which is dedicated for only the monitoring attributes to make the purpose of the five values clearer and simplify 'struct damon_ctx'. Link: https://lkml.kernel.org/r/20220913174449.50645-6-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 70e0c1d1bf945328915f52f7132b2d6ee8f25d46 Author: SeongJae Park Date: Tue Sep 13 17:44:31 2022 +0000 mm/damon/core: factor out 'damos_quota' private fileds initialization The 'struct damos' creation function, 'damon_new_scheme()', does initialization of private fileds of 'struct damos_quota' in it. As its verbose and makes the function unnecessarily long, this commit factors it out to separate function. Link: https://lkml.kernel.org/r/20220913174449.50645-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 02f17037fc6e38ca1c00ac87a112372a3867ba45 Author: SeongJae Park Date: Tue Sep 13 17:44:30 2022 +0000 mm/damon/core: copy struct-to-struct instead of field-to-field in damon_new_scheme() The function for new 'struct damos' creation, 'damon_new_scheme()', copies each field of the struct one by one, though it could simply copied via struct to struct. This commit replaces the unnecessarily verbose field-to-field copies with struct-to-struct copies to make code simple and short. Link: https://lkml.kernel.org/r/20220913174449.50645-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 8193321ac90d525b33815c77faae7d2d12042c03 Author: SeongJae Park Date: Tue Sep 13 17:44:29 2022 +0000 mm/damon/paddr: deduplicate damon_pa_{mark_accessed,deactivate_pages}() The bodies of damon_pa_{mark_accessed,deactivate_pages}() contains duplicates. This commit factors out the common part to a separate function and removes the duplicates. Link: https://lkml.kernel.org/r/20220913174449.50645-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit f82e70e26b505cd8a1d5c670dc5038a938708d4a Author: SeongJae Park Date: Tue Sep 13 17:44:28 2022 +0000 mm/damon/paddr: make supported DAMOS actions of paddr clear Patch series "mm/damon: cleanup code". DAMON code was not so clean from the beginning, but it has been too much nowadays, especially due to the duplicates in DAMON_RECLAIM and DAMON_LRU_SORT. This patchset cleans some of the mess. This patch (of 22): The 'switch-case' statement in 'damon_va_apply_scheme()' function provides a 'case' for every supported DAMOS action while all not-yet-supported DAMOS actions fall through the 'default' case, and comment it so that people can easily know which actions are supported. Its counterpart in 'paddr', 'damon_pa_apply_scheme()', however, doesn't. This commit makes the 'paddr' side function follows the pattern of 'vaddr' for better readability and consistency. Link: https://lkml.kernel.org/r/20220913174449.50645-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220913174449.50645-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 3791bc7bf1034dcce89541e54630d0307cc199fb Author: Xin Hao Date: Sun Sep 11 08:59:17 2022 +0800 mm/damon: simplify scheme create in damon_lru_sort_apply_parameters In damon_lru_sort_apply_parameters(), we can use damon_set_schemes() to replace the way of creating the first 'scheme' in original code, this makes the code look cleaner. Link: https://lkml.kernel.org/r/20220911005917.835-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit f9bceb2f4114fe9a9725c922f9f1500d173d4763 Author: Sergey Senozhatsky Date: Wed Sep 14 14:20:33 2022 +0900 zram: keep comments within 80-columns limit Several trivial fixups (that I should have spotted during review). Link: https://lkml.kernel.org/r/20220914052033.838050-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Signed-off-by: Andrew Morton commit f635725c3905e755a8c3e2dc8cab7fcd0d38977f Author: Sergey Senozhatsky Date: Tue Sep 13 00:27:44 2022 +0900 zram: do not waste zram_table_entry flags bits zram_table_entry::flags stores object size in the lower bits and zram pageflags in the upper bits. However, for some reason, we use 24 lower bits, while maximum zram object size is PAGE_SIZE, which requires PAGE_SHIFT bits (up to 16 on arm64). This wastes 24 - PAGE_SHIFT bits that we can use for additional zram pageflags instead. Also add a BUILD_BUG_ON() to alert us should we run out of bits in zram_table_entry::flags. Link: https://lkml.kernel.org/r/20220912152744.527438-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Reviewed-by: Brian Geffon Acked-by: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit a18709442869e55c42969142d5abf6beb776dbba Author: Dawei Li Date: Mon Sep 12 22:39:03 2022 +0800 mm/damon: improve damon_new_region strategy Kdamond is implemented as a periodical split-merge pattern, which will create and destroy regions possibly at high frequency (hundreds or even thousands of per sec), depending on the number of regions and aggregation period. In that case, kmalloc and kfree could bring speed and space overheads, which can be improved by using a private kmem cache. [set_pte_at@outlook.com: creating kmem cache for damon regions by KMEM_CACHE()] Link: https://lkml.kernel.org/r/Message-ID: Link: https://lkml.kernel.org/r/TYCP286MB2323DA1894FA55BB9CF90978CA449@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Dawei Li Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit e7fcac4cd2674fe6849c6ac8a51a7fc878a5e436 Author: Kaixu Xia Date: Mon Sep 12 23:11:53 2022 +0800 mm/damon/sysfs: use the wrapper directly to check if the kdamond is running We can use the 'damon_sysfs_kdamond_running()' wrapper directly to check if the kdamond is running in 'damon_sysfs_turn_damon_on()'. Link: https://lkml.kernel.org/r/1662995513-24489-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit a17a8b3b3e6b08a9cd3b2134789843323d998bed Author: Xin Hao Date: Thu Sep 8 16:19:32 2022 +0800 mm/damon/sysfs: change few functions execute order There's no need to run container_of() as early as we do. The compiler figures this out, but the resulting code is more readable. Link: https://lkml.kernel.org/r/20220908081932.77370-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit f4981502088f8ea704beeedf3470e1d53bc2e46c Author: Liu Shixin Date: Fri Sep 9 10:16:53 2022 +0800 mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice A user who reads THP_ZERO_PAGE_ALLOC may be more concerned about the huge zero pages that are really allocated for thp. It is misleading to increase THP_ZERO_PAGE_ALLOC twice if two threads call get_huge_zero_page concurrently. Don't increase the value if the huge page is not really used. Update Documentation/admin-guide/mm/transhuge.rst to suit. Link: https://lkml.kernel.org/r/20220909021653.3371879-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Cc: Alexander Potapenko Cc: Vlastimil Babka Cc: Andrea Arcangeli Cc: Kefeng Wang Cc: "Kirill A. Shutemov" Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 13cc378403a83e70430ae9bad53fd65199f21fe1 Author: Miaohe Lin Date: Fri Sep 9 10:57:11 2022 +0800 writeback: remove unused macro DIRTY_FULL_SCOPE It's introduced but never used. Remove it. Link: https://lkml.kernel.org/r/20220909025711.32012-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Jan Kara Acked-by: Jens Axboe Cc: Bart Van Assche Cc: David Howells Cc: Matthew Wilcox Cc: NeilBrown Cc: Vlastimil Babka Cc: zhanglianjie Signed-off-by: Andrew Morton commit 14455eabd8404a503dc8e80cd8ce185e96a94b22 Author: Cheng Li Date: Fri Sep 9 07:31:09 2022 +0000 mm: use nth_page instead of mem_map_offset mem_map_next To handle the discontiguous case, mem_map_next() has a parameter named `offset`. As a function caller, one would be confused why "get next entry" needs a parameter named "offset". The other drawback of mem_map_next() is that the callers must take care of the map between parameter "iter" and "offset", otherwise we may get an hole or duplication during iteration. So we use nth_page instead of mem_map_next. And replace mem_map_offset with nth_page() per Matthew's comments. Link: https://lkml.kernel.org/r/1662708669-9395-1-git-send-email-lic121@chinatelecom.cn Signed-off-by: Cheng Li Fixes: 69d177c2fc70 ("hugetlbfs: handle pages higher order than MAX_ORDER") Reviewed-by: Matthew Wilcox (Oracle) Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 0d83b2d89dbfad17b62d4e7fb8f0b0525ba1a204 Author: Xin Hao Date: Fri Sep 9 21:36:06 2022 +0000 mm/damon: remove duplicate get_monitoring_region() definitions In lru_sort.c and reclaim.c, they are all defining get_monitoring_region() function, there is no need to define it separately. As 'get_monitoring_region()' is not a 'static' function anymore, we try to use a prefix to distinguish with other functions, so there rename it to 'damon_find_biggest_system_ram'. Link: https://lkml.kernel.org/r/20220909213606.136221-1-sj@kernel.org Signed-off-by: Xin Hao Signed-off-by: SeongJae Park Suggested-by: SeongJae Park Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 6b1964e685544b8f8ba6780c10a6b38c2b1282a5 Author: Liu Shixin Date: Fri Sep 9 16:31:40 2022 +0800 mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE Use DEFINE_SEQ_ATTRIBUTE helper macro to simplify the code. Link: https://lkml.kernel.org/r/20220909083140.3592919-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Reviewed-by: Marco Elver Tested-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Kefeng Wang Signed-off-by: Andrew Morton commit 671f2fa8a2b2d15940d80be4a2baf22758724647 Author: Alexey Romanov Date: Fri Sep 9 11:37:22 2022 +0300 zsmalloc: use correct types in _first_obj_offset functions Since commit ffedd09fa9b0 ("zsmalloc: Stop using slab fields in struct page") we are using page->page_type (unsigned int) field instead of page->units (int) as first object offset in a subpage of zspage. So get_first_obj_offset() and set_first_obj_offset() functions should work with unsigned int type. Link: https://lkml.kernel.org/r/20220909083722.85024-1-avromanov@sberdevices.ru Fixes: ffedd09fa9b0 ("zsmalloc: Stop using slab fields in struct page") Signed-off-by: Alexey Romanov Reviewed-by: Sergey Senozhatsky Cc: Alexey Romanov Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 85a34107eba913a2cb7c7c47c49f50073bfb67dd Author: Liu Shixin Date: Fri Sep 9 16:39:47 2022 +0800 mm/shuffle: convert module_param_call to module_param_cb module_param_call is now completely consistent with module_param_cb, so there is no need to keep two macros. Convert module_param_call to module_param_cb since former is obsolete and latter is more kernel-ish. Link: https://lkml.kernel.org/r/20220909083947.3595610-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Reviewed-by: David Hildenbrand Cc: Dan Williams Cc: Kefeng Wang Cc: Liu Shixin Cc: Paul Russel Signed-off-by: Andrew Morton commit f1f3afd59d78db163f6655394980290c1bdf9eab Author: SeongJae Park Date: Fri Sep 9 20:29:01 2022 +0000 Docs/admin-guide/mm/damon/usage: note DAMON debugfs interface deprecation plan Commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface") announced the DAMON debugfs interface deprecation plan, but it is not so aggressively announced. As the deprecation time is coming, this commit makes the announce more easy to be found by adding the note at the beginning of the DAMON debugfs interface usage document. Link: https://lkml.kernel.org/r/20220909202901.57977-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit 04cc7e4bf7c4bdff24b62432d2beafdde60cb72b Author: SeongJae Park Date: Fri Sep 9 20:29:00 2022 +0000 Docs/admin-guide/mm/damon/start: mention the dependency as sysfs instead of debugfs 'Getting Started' document of DAMON says DAMON user-space tool, damo[1], is using DAMON debugfs interface, and therefore it needs to ensure debugfs is mounted. However, the latest version of the tool is using DAMON sysfs interface. Moreover, DAMON debugfs interface is going to be deprecated as announced by commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface"). This commit therefore update the document to tell readers about DAMON sysfs interface dependency instead and never mention about debugfs interface, which will be deprecated. [1] https://github.com/awslabs/damo Link: https://lkml.kernel.org/r/20220909202901.57977-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit e8600ce2d2e6ad1df4d0717beb362ee4cd39aaa3 Author: SeongJae Park Date: Fri Sep 9 20:28:59 2022 +0000 mm/damon/Kconfig: notify debugfs deprecation plan Commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface") announced the DAMON debugfs interface deprecation plan, but it is not so aggressively announced. As the deprecation time is coming, this commit makes the announce more easy to be found by adding the note to the config menu of DAMON debugfs interface. Link: https://lkml.kernel.org/r/20220909202901.57977-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit 0ff11f103f5d9daf14dddf05de9b12611eaf3fc1 Author: SeongJae Park Date: Fri Sep 9 20:28:58 2022 +0000 Docs/admin-guide/mm/damon: rename the title of the document The title of the DAMON document for admin-guide, 'Monitoring Data Accesses', could confuse readers in some ways. First of all, DAMON is not the only single way for data access monitoring. And the document is for not only the data access monitoring but also data access pattern based memory management optimizations (DAMOS). This commit updates the title to 'DAMON: Data Access MONitor', which more explicitly explains what the document describes. Link: https://lkml.kernel.org/r/20220909202901.57977-5-sj@kernel.org Fixes: c4ba6014aec3 ("Documentation: add documents for DAMON") Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit 62f409560eb235ad9c2c9dbe1a3a57801431da5a Author: SeongJae Park Date: Fri Sep 9 20:28:57 2022 +0000 mm/damon/core-test: test damon_set_regions Preceding commit fixes a bug in 'damon_set_regions()', which allows holes in the new monitoring target ranges. This commit adds a kunit test case for the problem to avoid any regression. Link: https://lkml.kernel.org/r/20220909202901.57977-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit 9c950c22833cfd9887da7679534e5c6deb44b008 Author: SeongJae Park Date: Fri Sep 9 20:28:56 2022 +0000 mm/damon/core: avoid holes in newly set monitoring target ranges When there are two or more non-contiguous regions intersecting with given new ranges, 'damon_set_regions()' does not fill the holes. This commit makes the function to fill the holes with newly created regions. [sj@kernel.org: handle error from 'damon_fill_regions_holes()'] Link: https://lkml.kernel.org/r/20220913215420.57761-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220909202901.57977-3-sj@kernel.org Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces") Signed-off-by: SeongJae Park Reported-by: Yun Levi Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Signed-off-by: Andrew Morton commit ade38b8ca5ceeeb72e8d01357f3dcde7c87570cc Author: SeongJae Park Date: Fri Sep 9 20:28:55 2022 +0000 selftest/damon: add a test for duplicate context dirs creation Patch series "mm/damon: minor fixes and cleanups". This patchset contains minor fixes and cleanups for DAMON including - selftest for a bug we found before (Patch 1), - fix of region holes in vaddr corner case and a kunit test for it (Patches 2 and 3), and - documents/Kconfig updates for title wordsmithing (Patch 4) and more aggressive DAMON debugfs interface deprecation announcement (Patches 5-7). This patch (of 7): Commit d26f60703606 ("mm/damon/dbgfs: avoid duplicate context directory creation") fixes a bug which could result in memory leak and DAMON disablement. This commit adds a selftest for verifying the fix and avoid regression. Link: https://lkml.kernel.org/r/20220909202901.57977-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220909202901.57977-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yun Levi Signed-off-by: Andrew Morton commit 36f05cab0a2c97bda288c3b6a557ec5fb8d9bba6 Author: Jeff Layton Date: Fri Sep 9 09:00:31 2022 -0400 tmpfs: add support for an i_version counter NFSv4 mandates a change attribute to avoid problems with timestamp granularity, which Linux implements using the i_version counter. This is particularly important when the underlying filesystem is fast. Give tmpfs an i_version counter. Since it doesn't have to be persistent, we can just turn on SB_I_VERSION and sprinkle some inode_inc_iversion calls in the right places. Also, while there is no formal spec for xattrs, most implementations update the ctime on setxattr. Fix shmem_xattr_handler_set to update the ctime and bump the i_version appropriately. Link: https://lkml.kernel.org/r/20220909130031.15477-1-jlayton@kernel.org Signed-off-by: Jeff Layton Cc: Chuck Lever Cc: Alexander Viro Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 5934ec1362b235c4341807c28f79b6a596ce1b40 Author: Kaixu Xia Date: Thu Sep 8 11:13:17 2022 +0800 mm/damon/vaddr: add a comment for 'default' case in damon_va_apply_scheme() The switch case 'DAMOS_STAT' and switch case 'default' have same return value in damon_va_apply_scheme(), and the 'default' case is for DAMOS actions that not supported by 'vaddr'. It might make sense to add a comment here. [akpm@linux-foundation.org: fx comment grammar] Link: https://lkml.kernel.org/r/1662606797-23534-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit f5a79d7c0c87c8d88bb5e3f3c898258fdf1b3b05 Author: Yajun Deng Date: Thu Sep 8 19:14:43 2022 +0000 mm/damon: introduce struct damos_access_pattern damon_new_scheme() has too many parameters, so introduce struct damos_access_pattern to simplify it. In additon, we can't use a bpf trace kprobe that has more than 5 parameters. Link: https://lkml.kernel.org/r/20220908191443.129534-1-sj@kernel.org Signed-off-by: Yajun Deng Signed-off-by: SeongJae Park Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 679d7f69d60bbd124542e620b745c17643cdf680 Author: Xiu Jianfeng Date: Tue Sep 6 15:53:12 2022 +0800 mm/rodata_test: use PAGE_ALIGNED() helper Use PAGE_ALIGNED() helper instead of open-coding operation, no functional changes here. Link: https://lkml.kernel.org/r/20220906075312.166595-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Andrew Morton commit 4e07acdda7fc23f5c4666e54961ef972a1195ffd Author: Xiu Jianfeng Date: Tue Sep 6 17:35:30 2022 +0800 mm/hwpoison: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Link: https://lkml.kernel.org/r/20220906093530.243262-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Reviewed-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 8278f1c7b4920105f2f30a8df9b8212b378101d2 Author: Shakeel Butt Date: Wed Sep 7 04:35:37 2022 +0000 memcg: reduce size of memcg vmstats structures The struct memcg_vmstats and struct memcg_vmstats_percpu contains two arrays each for events of size NR_VM_EVENT_ITEMS which can be as large as 110. However the memcg v1 only uses 4 of those while memcg v2 uses 15. The union of both is 17. On a 64 bit system, we are wasting approximately ((110 - 17) * 8 * 2) * (nr_cpus + 1) bytes which is significant on large machines. This patch reduces the size of the given structures by adding one indirection and only stores array of events which are actually used by the memcg code. With this patch, the size of memcg_vmstats has reduced from 2544 bytes to 1056 bytes while the size of memcg_vmstats_percpu has reduced from 2568 bytes to 1080 bytes. [akpm@linux-foundation.org: fix memcg_events_local() array index, per Shakeel] Link: https://lkml.kernel.org/r/CALvZod70Mvxr+Nzb6k0yiU2RFYjTD=0NFhKK-Eyp+5ejd1PSFw@mail.gmail.com Link: https://lkml.kernel.org/r/20220907043537.3457014-4-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit d396def5d86dbeb4ceb4a9dca92611ce206dc66a Author: Shakeel Butt Date: Wed Sep 7 04:35:36 2022 +0000 memcg: rearrange code This is a preparatory patch for easing the review of the follow up patch which will reduce the memory overhead of memory cgroups. Link: https://lkml.kernel.org/r/20220907043537.3457014-3-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit 410f8e82689e1e66044fea51ef852054a09502b7 Author: Shakeel Butt Date: Wed Sep 7 04:35:35 2022 +0000 memcg: extract memcg_vmstats from struct mem_cgroup Patch series "memcg: reduce memory overhead of memory cgroups". Currently a lot of memory is wasted to maintain the vmevents for memory cgroups as we have multiple arrays of size NR_VM_EVENT_ITEMS which can be as large as 110. However memcg code uses small portion of those entries. This patch series eliminate this overhead by removing the unneeded vmevent entries from memory cgroup data structures. This patch (of 3): This is a preparatory patch to reduce the memory overhead of memory cgroup. The struct memcg_vmstats is the largest object embedded into the struct mem_cgroup. This patch extracts struct memcg_vmstats from struct mem_cgroup to ease the following patches in reducing the size of struct memcg_vmstats. Link: https://lkml.kernel.org/r/20220907043537.3457014-1-shakeelb@google.com Link: https://lkml.kernel.org/r/20220907043537.3457014-2-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit fc5dfebc8055426299739dd1a7828af9638c94fb Author: Kefeng Wang Date: Wed Sep 7 16:26:43 2022 +0800 memblock tests: add new pageblock related macro Add new pageblock_start_pfn() and pageblock_align() macro which are needed by memblock tests. Link: https://lkml.kernel.org/r/20220907082643.186979-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Mike Rapoport Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit ee0913c4719610204315a0d8a35122c6233249e0 Author: Kefeng Wang Date: Wed Sep 7 14:08:44 2022 +0800 mm: add pageblock_aligned() macro Add pageblock_aligned() and use it to simplify code. Link: https://lkml.kernel.org/r/20220907060844.126891-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Mike Rapoport Cc: David Hildenbrand Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 5f7fa13fa858c17580ed513bd5e0a4b36d68fdd6 Author: Kefeng Wang Date: Wed Sep 7 14:08:43 2022 +0800 mm: add pageblock_align() macro Add pageblock_align() macro and use it to simplify code. Link: https://lkml.kernel.org/r/20220907060844.126891-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4f9bc69ac5ce34071a9a51343bc81ca76cb2e3f1 Author: Kefeng Wang Date: Wed Sep 7 14:08:42 2022 +0800 mm: reuse pageblock_start/end_pfn() macro Move pageblock_start_pfn/pageblock_end_pfn() into pageblock-flags.h, then they could be used somewhere else, not only in compaction, also use ALIGN_DOWN() instead of round_down() to be pair with ALIGN(), which should be same for pageblock usage. Link: https://lkml.kernel.org/r/20220907060844.126891-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 0bba9af03d55d2cc1aa7616a8b9e522ceb49d180 Author: Zhenhua Huang Date: Wed Sep 7 16:01:13 2022 +0800 mm/page_owner.c: remove redundant drain_all_pages Remove an expensive and unnecessary operation as PCP pages are safely skipped when reading page owner.PCP pages can be skipped because PAGE_EXT_OWNER_ALLOCATED is cleared. With draining PCP pages, these pages are moved to buddy list so they can be identified as buddy pages and skipped quickly. Although it improved efficiency of PFN walker, the drain is guaranteed expensive that is unlikely to be offset by a slight increase in efficiency when skipping free pages. PAGE_EXT_OWNER_ALLOCATED is cleared in the page owner reset path below: free_unref_page -> free_unref_page_prepare -> free_pcp_prepare -> free_pages_prepare which do page owner reset -> free_unref_page_commit which add pages into pcp list Link: https://lkml.kernel.org/r/1662704326-15899-1-git-send-email-quic_zhenhuah@quicinc.com Link: https://lkml.kernel.org/r/1662633204-10044-1-git-send-email-quic_zhenhuah@quicinc.com Link: https://lkml.kernel.org/r/1662537673-9392-1-git-send-email-quic_zhenhuah@quicinc.com Signed-off-by: Zhenhua Huang Acked-by: Mel Gorman Signed-off-by: Andrew Morton commit 61768a1b37c664faf028d925e6b7825768afcc00 Author: Xin Hao Date: Wed Sep 7 16:41:16 2022 +0800 mm/damon: simplify damon_ctx check in damon_sysfs_before_terminate In damon_sysfs_before_terminate(), it needs to check whether ctx->ops.id supports 'DAMON_OPS_VADDR' or 'DAMON_OPS_FVADDR', there we can use damon_target_has_pid() instead. Link: https://lkml.kernel.org/r/20220907084116.62053-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 36001cba4f728e7fa2a58bc69fece22eaeef5cca Author: Kaixu Xia Date: Tue Sep 6 23:18:47 2022 +0800 mm/damon/core: iterate the regions list from current point in damon_set_regions() We iterate the whole regions list every time to get the first/last regions intersecting with the specific range in damon_set_regions(), in order to add new region or resize existing regions to fit in the specific range. Actually, it is unnecessary to iterate the new added regions and the front regions that have been checked. Just iterate the regions list from the current point using list_for_each_entry_from() every time to improve performance. The kunit tests passed: [PASSED] damon_test_apply_three_regions1 [PASSED] damon_test_apply_three_regions2 [PASSED] damon_test_apply_three_regions3 [PASSED] damon_test_apply_three_regions4 Link: https://lkml.kernel.org/r/1662477527-13003-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 6a760f58c792b6f7411f886271bb03f697464433 Author: Mika Penttilä Date: Fri Aug 26 08:06:31 2022 +0300 mm/hmm/test: use char dev with struct device to get device node HMM selftests use an in-kernel pseudo device to emulate device memory. The pseudo device registers a major device range for two or four pseudo device instances. User space has a script that reads /proc/devices in order to find the assigned major number, and sends that to mknod(1), once for each node. Change this to properly use cdev and struct device APIs. Delete the /proc/devices parsing from the user-space test script, now that it is unnecessary. Also, delete an unused field in struct dmirror_device: devmem. Link: https://lkml.kernel.org/r/20220826050631.25771-1-mpenttil@redhat.com Signed-off-by: Mika Penttilä Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Cc: Alistair Popple Cc: Ralph Campbell Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit dcc579663f607392ade99a2301278239e819f57e Author: Andrey Konovalov Date: Sun Sep 11 01:25:30 2022 +0200 kasan: better invalid/double-free report header Update the report header for invalid- and double-free bugs to contain the address being freed: BUG: KASAN: invalid-free in kfree+0x280/0x2a8 Free of addr ffff00000beac001 by task kunit_try_catch/99 Link: https://lkml.kernel.org/r/fce40f8dbd160972fe01a1ff39d0c426c310e4b7.1662852281.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit f7e01ab828fd4bf6d25b1f143a3994241e8572bf Author: Andrey Konovalov Date: Tue Sep 6 00:18:36 2022 +0200 kasan: move tests to mm/kasan/ Move KASAN tests to mm/kasan/ to keep the test code alongside the implementation. Link: https://lkml.kernel.org/r/676398f0aeecd47d2f8e3369ea0e95563f641a36.1662416260.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit 34b592ce5cc2dbd7d94812bff12ec32d3ec6f65c Author: Andrey Konovalov Date: Mon Sep 5 23:05:49 2022 +0200 kasan: add another use-after-free test Add a new use-after-free test that checks that KASAN detects use-after-free when another object was allocated in the same slot. This test is mainly relevant for the tag-based modes, which do not use quarantine. Once [1] is resolved, this test can be extended to check that the stack traces in the report point to the proper kmalloc/kfree calls. [1] https://bugzilla.kernel.org/show_bug.cgi?id=212203 Link: https://lkml.kernel.org/r/0659cfa15809dd38faa02bc0a59d0b5dbbd81211.1662411800.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 1f538e1f2d294cf8a9486fb1a7d4d4f0d16e2b01 Author: Andrey Konovalov Date: Mon Sep 5 23:05:48 2022 +0200 kasan: better identify bug types for tag-based modes Identify the bug type for the tag-based modes based on the stack trace entries found in the stack ring. If a free entry is found first (meaning that it was added last), mark the bug as use-after-free. If an alloc entry is found first, mark the bug as slab-out-of-bounds. Otherwise, assign the common bug type. This change returns the functionalify of the previously dropped CONFIG_KASAN_TAGS_IDENTIFY. Link: https://lkml.kernel.org/r/13ce7fa07d9d995caedd1439dfae4d51401842f2.1662411800.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 80b92bfe3bb75aa6688f58af9df356757a46f659 Author: Andrey Konovalov Date: Mon Sep 5 23:05:47 2022 +0200 kasan: dynamically allocate stack ring entries Instead of using a large static array, allocate the stack ring dynamically via memblock_alloc(). The size of the stack ring is controlled by a new kasan.stack_ring_size command-line parameter. When kasan.stack_ring_size is not provided, the default value of 32 << 10 is used. When the stack trace collection is disabled via kasan.stacktrace=off, the stack ring is not allocated. Link: https://lkml.kernel.org/r/03b82ab60db53427e9818e0b0c1971baa10c3cbc.1662411800.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 7ebfce33125100e3f0c5e059845a019a1401433d Author: Andrey Konovalov Date: Mon Sep 5 23:05:46 2022 +0200 kasan: support kasan.stacktrace for SW_TAGS Add support for the kasan.stacktrace command-line argument for Software Tag-Based KASAN. The following patch adds a command-line argument for selecting the stack ring size, and, as the stack ring is supported by both the Software and the Hardware Tag-Based KASAN modes, it is natural that both of them have support for kasan.stacktrace too. Link: https://lkml.kernel.org/r/3b43059103faa7f8796017847b7d674b658f11b5.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 7bc0584e5d2a687c0855a1b3dec9a6d6857d757b Author: Andrey Konovalov Date: Mon Sep 5 23:05:45 2022 +0200 kasan: implement stack ring for tag-based modes Implement storing stack depot handles for alloc/free stack traces for slab objects for the tag-based KASAN modes in a ring buffer. This ring buffer is referred to as the stack ring. On each alloc/free of a slab object, the tagged address of the object and the current stack trace are recorded in the stack ring. On each bug report, if the accessed address belongs to a slab object, the stack ring is scanned for matching entries. The newest entries are used to print the alloc/free stack traces in the report: one entry for alloc and one for free. The number of entries in the stack ring is fixed in this patch, but one of the following patches adds a command-line argument to control it. [andreyknvl@google.com: initialize read-write lock in stack ring] Link: https://lkml.kernel.org/r/576182d194e27531e8090bad809e4136953895f4.1663700262.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/692de14b6b6a1bc817fd55e4ad92fc1f83c1ab59.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 59e6e098d1c156f7c449af903c3b48a5470f6120 Author: Andrey Konovalov Date: Mon Sep 5 23:05:44 2022 +0200 kasan: introduce kasan_complete_mode_report_info Add bug_type and alloc/free_track fields to kasan_report_info and add a kasan_complete_mode_report_info() function that fills in these fields. This function is implemented differently for different KASAN mode. Change the reporting code to use the filled in fields instead of invoking kasan_get_bug_type() and kasan_get_alloc/free_track(). For the Generic mode, kasan_complete_mode_report_info() invokes these functions instead. For the tag-based modes, only the bug_type field is filled in; alloc/free_track are handled in the next patch. Using a single function that fills in these fields is required for the tag-based modes, as the values for all three fields are determined in a single procedure implemented in the following patch. Link: https://lkml.kernel.org/r/8432b861054fa8d0cee79a8877dedeaf3b677ca8.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 92a38eacd6412bb09f98245ba5b3aa89e3dd6656 Author: Andrey Konovalov Date: Mon Sep 5 23:05:43 2022 +0200 kasan: rework function arguments in report.c Pass a pointer to kasan_report_info to describe_object() and describe_object_stacks(), instead of passing the structure's fields. The untagged pointer and the tag are still passed as separate arguments to some of the functions to avoid duplicating the untagging logic. This is preparatory change for the next patch. Link: https://lkml.kernel.org/r/2e0cdb91524ab528a3c2b12b6d8bcb69512fc4af.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 7fae3dd08e3e88491f06e22e648913e3f8cf30f0 Author: Andrey Konovalov Date: Mon Sep 5 23:05:42 2022 +0200 kasan: fill in cache and object in complete_report_info Add cache and object fields to kasan_report_info and fill them in in complete_report_info() instead of fetching them in the middle of the report printing code. This allows the reporting code to get access to the object information before starting printing the report. One of the following patches uses this information to determine the bug type with the tag-based modes. Link: https://lkml.kernel.org/r/23264572cb2cbb8f0efbb51509b6757eb3cc1fc9.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 015b109f1f7a799a51def6be37a53b650c4a8fda Author: Andrey Konovalov Date: Mon Sep 5 23:05:41 2022 +0200 kasan: introduce complete_report_info Introduce a complete_report_info() function that fills in the first_bad_addr field of kasan_report_info instead of doing it in kasan_report_*(). This function will be extended in the next patch. Link: https://lkml.kernel.org/r/8eb1a9bd01f5d31eab4524da54a101b8720b469e.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit a794898a0e17c1c563fcce614efbd3644d48fa2e Author: Andrey Konovalov Date: Mon Sep 5 23:05:40 2022 +0200 kasan: simplify print_report To simplify reading the implementation of print_report(), remove the tagged_addr variable and rename untagged_addr to addr. Link: https://lkml.kernel.org/r/f64f5f1093b3c06896bf0f850c5d9e661313fcb2.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 559756e8a2e153f0f2ddf29c0ed9ac7b88345fb6 Author: Andrey Konovalov Date: Mon Sep 5 23:05:39 2022 +0200 kasan: make kasan_addr_to_page static As kasan_addr_to_page() is only used in report.c, rename it to addr_to_page() and make it static. Link: https://lkml.kernel.org/r/66c1267200fe0c16e2ac8847a9315fda041918cb.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 0f282f15dcc479b1f70ef4c2324db8a6df670fcb Author: Andrey Konovalov Date: Mon Sep 5 23:05:38 2022 +0200 kasan: use kasan_addr_to_slab in print_address_description Use the kasan_addr_to_slab() helper in print_address_description() instead of separately invoking PageSlab() and page_slab(). Link: https://lkml.kernel.org/r/8b744fbf8c3c7fc5d34329ec70b60ee5c8dba66c.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 2c9fb1fd1dd0b17cf8f48935a9c3ecea066f10e8 Author: Andrey Konovalov Date: Mon Sep 5 23:05:37 2022 +0200 kasan: use virt_addr_valid in kasan_addr_to_page/slab Instead of open-coding the validity checks for addr in kasan_addr_to_page/slab(), use the virt_addr_valid() helper. Link: https://lkml.kernel.org/r/c22a4850d74d7430f8a6c08216fd55c2860a2b9e.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 9ef08d265e3f02b3266a46f684de5741724bd7f8 Author: Andrey Konovalov Date: Mon Sep 5 23:05:36 2022 +0200 kasan: cosmetic changes in report.c Do a few non-functional style fixes for the code in report.c. Link: https://lkml.kernel.org/r/b728eae71f3ea505a885449724de21cf3f476a7b.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit b89933e9a54d3e7c4da081bc0b986341b62cdab6 Author: Andrey Konovalov Date: Mon Sep 5 23:05:35 2022 +0200 kasan: move kasan_get_alloc/free_track definitions Move the definitions of kasan_get_alloc/free_track() to report_*.c, as they belong with other the reporting code. Link: https://lkml.kernel.org/r/0cb15423956889b3905a0174b58782633bbbd72e.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 6b07434980a1926780cb5c5644fb198fb9c3997b Author: Andrey Konovalov Date: Mon Sep 5 23:05:34 2022 +0200 kasan: pass tagged pointers to kasan_save_alloc/free_info Pass tagged pointers to kasan_save_alloc/free_info(). This is a preparatory patch to simplify other changes in the series. Link: https://lkml.kernel.org/r/d5bc48cfcf0dca8269dc3ed863047e4d4d2030f1.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 682ed08924407b719fa0b1123a26971748d76ace Author: Andrey Konovalov Date: Mon Sep 5 23:05:33 2022 +0200 kasan: only define kasan_cache_create for Generic mode Right now, kasan_cache_create() assigns SLAB_KASAN for all KASAN modes and then sets up metadata-related cache parameters for the Generic mode. SLAB_KASAN is used in two places: 1. In slab_ksize() to account for per-object metadata when calculating the size of the accessible memory within the object. 2. In slab_common.c via kasan_never_merge() to prevent merging of caches with per-object metadata. Both cases are only relevant when per-object metadata is present, which is only the case with the Generic mode. Thus, assign SLAB_KASAN and define kasan_cache_create() only for the Generic mode. Also update the SLAB_KASAN-related comment. Link: https://lkml.kernel.org/r/61faa2aa1906e2d02c97d00ddf99ce8911dda095.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit be95e13fcc6ded156c65ece01486d9cc33d22dc8 Author: Andrey Konovalov Date: Mon Sep 5 23:05:32 2022 +0200 kasan: only define metadata structs for Generic mode Hide the definitions of kasan_alloc_meta and kasan_free_meta under an ifdef CONFIG_KASAN_GENERIC check, as these structures are now only used when the Generic mode is enabled. Link: https://lkml.kernel.org/r/8d2aabff8c227c444a3f62edf87d5630beb77640.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 26f21f3ac76df6cf3b447e8231f8754991165475 Author: Andrey Konovalov Date: Mon Sep 5 23:05:31 2022 +0200 kasan: only define metadata offsets for Generic mode Hide the definitions of alloc_meta_offset and free_meta_offset under an ifdef CONFIG_KASAN_GENERIC check, as these fields are now only used when the Generic mode is enabled. Link: https://lkml.kernel.org/r/d4bafa0534facafd1a23c465a94261e64f366493.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 3b7f8813e9ecf7fe91f2f8dc3b581a111cd374a5 Author: Andrey Konovalov Date: Mon Sep 5 23:05:30 2022 +0200 kasan: only define kasan_never_merge for Generic mode KASAN prevents merging of slab caches whose objects have per-object metadata stored in redzones. As now only the Generic mode uses per-object metadata, define kasan_never_merge() only for this mode. Link: https://lkml.kernel.org/r/81ed01f29ff3443580b7e2fe362a8b47b1e8006d.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit f372bde922e2ced8e0b5a928887b4cf587cc4453 Author: Andrey Konovalov Date: Mon Sep 5 23:05:29 2022 +0200 kasan: only define kasan_metadata_size for Generic mode KASAN provides a helper for calculating the size of per-object metadata stored in the redzone. As now only the Generic mode uses per-object metadata, only define kasan_metadata_size() for this mode. Link: https://lkml.kernel.org/r/8f81d4938b80446bc72538a08217009f328a3e23.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 02856beb2d801423f88f2e8cb2eed0d6f14a4f92 Author: Andrey Konovalov Date: Mon Sep 5 23:05:28 2022 +0200 kasan: drop CONFIG_KASAN_GENERIC check from kasan_init_cache_meta As kasan_init_cache_meta() is only defined for the Generic mode, it does not require the CONFIG_KASAN_GENERIC check. Link: https://lkml.kernel.org/r/211f8f2b213aa91e9148ca63342990b491c4917a.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 5935143d118569cdbccbae182763d2b451120c40 Author: Andrey Konovalov Date: Mon Sep 5 23:05:27 2022 +0200 kasan: introduce kasan_init_cache_meta Add a kasan_init_cache_meta() helper that initializes metadata-related cache parameters and use this helper in the common KASAN code. Put the implementation of this new helper into generic.c, as only the Generic mode uses per-object metadata. Link: https://lkml.kernel.org/r/a6d7ea01876eb36472c9879f7b23f1b24766276e.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 284f8590a1dfbe1c33b50bf6e8f8dc714e61bfd3 Author: Andrey Konovalov Date: Mon Sep 5 23:05:26 2022 +0200 kasan: introduce kasan_requires_meta Add a kasan_requires_meta() helper that indicates whether the enabled KASAN mode requires per-object metadata and use this helper in the common code. Also hide kasan_init_object_meta() under CONFIG_KASAN_GENERIC ifdef check, as Generic is the only mode that uses per-object metadata. To allow for a potential future change that makes Generic KASAN support the kasan.stacktrace command-line parameter, let kasan_requires_meta() return kasan_stack_collection_enabled() instead of simply returning true. Link: https://lkml.kernel.org/r/cf837e9996246aaaeebf704ccf8ec26a34fcf64f.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 2f3568017268fc34eb0b6b4b3163c0f2e619fde6 Author: Andrey Konovalov Date: Mon Sep 5 23:05:25 2022 +0200 kasan: move kasan_get_*_meta to generic.c Move the implementations of kasan_get_alloc/free_meta() to generic.c, as the common KASAN code does not use these functions anymore. Also drop kasan_reset_tag() from the implementation, as the Generic mode does not tag pointers. Link: https://lkml.kernel.org/r/ffcfc0ad654d78a2ef4ca054c943ddb4e5ca477b.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 74984e79071aafd528f03b8418657c05011b94f3 Author: Andrey Konovalov Date: Mon Sep 5 23:05:24 2022 +0200 kasan: clear metadata functions for tag-based modes Remove implementations of the metadata-related functions for the tag-based modes. The following patches in the series will provide alternative implementations. As of this patch, the tag-based modes no longer collect alloc and free stack traces. This functionality will be restored later in the series. Link: https://lkml.kernel.org/r/470fbe5d15e8015092e76e395de354be18ccceab.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 836daba099472baaa8b6a57772e8bb2d55f1f9d7 Author: Andrey Konovalov Date: Mon Sep 5 23:05:23 2022 +0200 kasan: introduce kasan_init_object_meta Add a kasan_init_object_meta() helper that initializes metadata for a slab object and use it in the common code. For now, the implementations of this helper are the same for the Generic and tag-based modes, but they will diverge later in the series. This change hides references to alloc_meta from the common code. This is desired as only the Generic mode will be using per-object metadata after this series. Link: https://lkml.kernel.org/r/47c12938fc7f8105e7aaa592527c0e9d3c81fc37.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit f3647cbfe5a34af1a22f2627dda5fb078a47f0d3 Author: Andrey Konovalov Date: Mon Sep 5 23:05:22 2022 +0200 kasan: introduce kasan_get_alloc_track Add a kasan_get_alloc_track() helper that fetches alloc_track for a slab object and use this helper in the common reporting code. For now, the implementations of this helper are the same for the Generic and tag-based modes, but they will diverge later in the series. This change hides references to alloc_meta from the common reporting code. This is desired as only the Generic mode will be using per-object metadata after this series. Link: https://lkml.kernel.org/r/0c365a35f4a833fff46f9d42c3212b32f7166556.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 88f29765ae3b00f8b9362f299f6140cd9b988f75 Author: Andrey Konovalov Date: Mon Sep 5 23:05:21 2022 +0200 kasan: introduce kasan_print_aux_stacks Add a kasan_print_aux_stacks() helper that prints the auxiliary stack traces for the Generic mode. This change hides references to alloc_meta from the common reporting code. This is desired as only the Generic mode will be using per-object metadata after this series. Link: https://lkml.kernel.org/r/67c7a9ea6615533762b1f8ccc267cd7f9bafb749.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 687c85afa67a635dae683cf0ab6012e76333065b Author: Andrey Konovalov Date: Mon Sep 5 23:05:20 2022 +0200 kasan: drop CONFIG_KASAN_TAGS_IDENTIFY Drop CONFIG_KASAN_TAGS_IDENTIFY and related code to simplify making changes to the reporting code. The dropped functionality will be restored in the following patches in this series. Link: https://lkml.kernel.org/r/4c66ba98eb237e9ed9312c19d423bbcf4ecf88f8.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit ccf643e6dacf33ec618bd64e10eb0347173ad482 Author: Andrey Konovalov Date: Mon Sep 5 23:05:19 2022 +0200 kasan: split save_alloc_info implementations Provide standalone implementations of save_alloc_info() for the Generic and tag-based modes. For now, the implementations are the same, but they will diverge later in the series. Link: https://lkml.kernel.org/r/77f1a078489c1e859aedb5403f772e5e1f7410a0.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 196894a6e20273d78479bdf76eec3a741e72d31c Author: Andrey Konovalov Date: Mon Sep 5 23:05:18 2022 +0200 kasan: move is_kmalloc check out of save_alloc_info Move kasan_info.is_kmalloc check out of save_alloc_info(). This is a preparatory change that simplifies the following patches in this series. Link: https://lkml.kernel.org/r/df89f1915b788f9a10319905af6d0202a3b30c30.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit c249f9af85ee006976c0fae584daf947cc959931 Author: Andrey Konovalov Date: Mon Sep 5 23:05:17 2022 +0200 kasan: rename kasan_set_*_info to kasan_save_*_info Rename set_alloc_info() and kasan_set_free_info() to save_alloc_info() and kasan_save_free_info(). The new names make more sense. Link: https://lkml.kernel.org/r/9f04777a15cb9d96bf00331da98e021d732fe1c9.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit ca77f290cff1dfa095d71ae16cc7cda8ee6df495 Author: Andrey Konovalov Date: Mon Sep 5 23:05:16 2022 +0200 kasan: check KASAN_NO_FREE_META in __kasan_metadata_size Patch series "kasan: switch tag-based modes to stack ring from per-object metadata", v3. This series makes the tag-based KASAN modes use a ring buffer for storing stack depot handles for alloc/free stack traces for slab objects instead of per-object metadata. This ring buffer is referred to as the stack ring. On each alloc/free of a slab object, the tagged address of the object and the current stack trace are recorded in the stack ring. On each bug report, if the accessed address belongs to a slab object, the stack ring is scanned for matching entries. The newest entries are used to print the alloc/free stack traces in the report: one entry for alloc and one for free. The advantages of this approach over storing stack trace handles in per-object metadata with the tag-based KASAN modes: - Allows to find relevant stack traces for use-after-free bugs without using quarantine for freed memory. (Currently, if the object was reallocated multiple times, the report contains the latest alloc/free stack traces, not necessarily the ones relevant to the buggy allocation.) - Allows to better identify and mark use-after-free bugs, effectively making the CONFIG_KASAN_TAGS_IDENTIFY functionality always-on. - Has fixed memory overhead. The disadvantage: - If the affected object was allocated/freed long before the bug happened and the stack trace events were purged from the stack ring, the report will have no stack traces. Discussion ========== The proposed implementation of the stack ring uses a single ring buffer for the whole kernel. This might lead to contention due to atomic accesses to the ring buffer index on multicore systems. At this point, it is unknown whether the performance impact from this contention would be significant compared to the slowdown introduced by collecting stack traces due to the planned changes to the latter part, see the section below. For now, the proposed implementation is deemed to be good enough, but this might need to be revisited once the stack collection becomes faster. A considered alternative is to keep a separate ring buffer for each CPU and then iterate over all of them when printing a bug report. This approach requires somehow figuring out which of the stack rings has the freshest stack traces for an object if multiple stack rings have them. Further plans ============= This series is a part of an effort to make KASAN stack trace collection suitable for production. This requires stack trace collection to be fast and memory-bounded. The planned steps are: 1. Speed up stack trace collection (potentially, by using SCS; patches on-hold until steps #2 and #3 are completed). 2. Keep stack trace handles in the stack ring (this series). 3. Add a memory-bounded mode to stack depot or provide an alternative memory-bounded stack storage. 4. Potentially, implement stack trace collection sampling to minimize the performance impact. This patch (of 34): __kasan_metadata_size() calculates the size of the redzone for objects in a slab cache. When accounting for presence of kasan_free_meta in the redzone, this function only compares free_meta_offset with 0. But free_meta_offset could also be equal to KASAN_NO_FREE_META, which indicates that kasan_free_meta is not present at all. Add a comparison with KASAN_NO_FREE_META into __kasan_metadata_size(). Link: https://lkml.kernel.org/r/cover.1662411799.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/c7b316d30d90e5947eb8280f4dc78856a49298cf.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit b05f41a1aa56fd646f2aa048ee446b6a2edb80d3 Author: Vishal Moola (Oracle) Date: Mon Sep 5 14:45:57 2022 -0700 filemap: convert filemap_range_has_writeback() to use folios Removes 3 calls to compound_head(). Link: https://lkml.kernel.org/r/20220905214557.868606-1-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 710bb68c2e3a24512e2d2bae470960d7488e97b1 Author: Matthias Goergens Date: Mon Sep 5 11:19:04 2022 +0800 hugetlb_encode.h: fix undefined behaviour (34 << 26) Left-shifting past the size of your datatype is undefined behaviour in C. The literal 34 gets the type `int`, and that one is not big enough to be left shifted by 26 bits. An `unsigned` is long enough (on any machine that has at least 32 bits for their ints.) For uniformity, we mark all the literals as unsigned. But it's only really needed for HUGETLB_FLAG_ENCODE_16GB. Thanks to Randy Dunlap for an initial review and suggestion. Link: https://lkml.kernel.org/r/20220905031904.150925-1-matthias.goergens@gmail.com Signed-off-by: Matthias Goergens Acked-by: Randy Dunlap Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit c274cd5c9bf5ded4b3f2a4e99f76223c8f006051 Author: Kaixu Xia Date: Sun Sep 4 22:36:06 2022 +0800 mm/damon/sysfs: simplify the judgement whether kdamonds are busy It is unnecessary to get the number of the running kdamond to judge whether kdamonds are busy. Here we can use the damon_sysfs_kdamond_running() helper and return -EBUSY directly when finding a running kdamond. Meanwhile, merging with the judgement that a kdamond has current sysfs command callback request to make the code more clear. Link: https://lkml.kernel.org/r/1662302166-13216-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 8eeda55fe08944421cf57f6185fe37b069829e7b Author: Li zeming Date: Mon Sep 5 10:09:18 2022 +0800 mm/hugetlb.c: remove unnecessary initialization of local `err' Link: https://lkml.kernel.org/r/20220905020918.3552-1-zeming@nfschina.com Signed-off-by: Li zeming Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 19672a9e4a75252871cba319f4e3b859b8fdf671 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:53 2022 +0100 mm: convert lock_page_or_retry() to folio_lock_or_retry() Remove a call to compound_head() in each of the two callers. Link: https://lkml.kernel.org/r/20220902194653.1739778-58-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 82e66bf76173a1525db9866455a7fdbc07b57297 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:52 2022 +0100 uprobes: use new_folio in __replace_page() Saves several calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-57-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 0c826c0b6a176b9ed5ace7106fd1770bb48f1898 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:51 2022 +0100 rmap: remove page_unlock_anon_vma_read() This was simply an alias for anon_vma_unlock_read() since 2011. Link: https://lkml.kernel.org/r/20220902194653.1739778-56-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 29eea9b5a9c9ecf21164a082a42bfabe06fdcb30 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:50 2022 +0100 mm: convert page_get_anon_vma() to folio_get_anon_vma() With all callers now passing in a folio, rename the function and convert all callers. Removes a couple of calls to compound_head() and a reference to page->mapping. Link: https://lkml.kernel.org/r/20220902194653.1739778-55-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 684555aacc90d70e6a4b96b3b238f1d9ea87408d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:49 2022 +0100 huge_memory: convert unmap_page() to unmap_folio() Remove a folio->page->folio conversion. Link: https://lkml.kernel.org/r/20220902194653.1739778-54-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 3e9a13daa61253e28a1c7d8f366931e0a58a2b5a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:48 2022 +0100 huge_memory: convert split_huge_page_to_list() to use a folio Saves many calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-53-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit c33db29231ad242b0c381c60b1603f5e1dec7e46 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:47 2022 +0100 migrate: convert unmap_and_move_huge_page() to use folios Saves several calls to compound_head() and removes a couple of uses of page->lru. Link: https://lkml.kernel.org/r/20220902194653.1739778-52-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 682a71a1b6b363bff71440f4eca6498f827a839d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:46 2022 +0100 migrate: convert __unmap_and_move() to use folios Removes a lot of calls to compound_head(). Also remove a VM_BUG_ON that can never trigger as the PageAnon bit is the bottom bit of page->mapping. Link: https://lkml.kernel.org/r/20220902194653.1739778-51-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 595af4c9368aba88c45831ef80ed686b602fe3fe Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:45 2022 +0100 rmap: convert page_move_anon_rmap() to use a folio Removes one call to compound_head() and a reference to page->mapping. Link: https://lkml.kernel.org/r/20220902194653.1739778-50-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 3b344157c0c15b8f9588e3021dfb22ee25f4508a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:44 2022 +0100 mm: remove try_to_free_swap() All callers have now been converted to folio_free_swap() and we can remove this wrapper. Link: https://lkml.kernel.org/r/20220902194653.1739778-49-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 9202d527b715f67bcdccbb9b712b65fe053f8109 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:43 2022 +0100 memcg: convert mem_cgroup_swap_full() to take a folio All callers now have a folio, so convert the function to take a folio. Saves a couple of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-48-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a160e5377b55bc5c1925a7456b656aabfc07261f Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:42 2022 +0100 mm: convert do_swap_page() to use folio_free_swap() Also convert should_try_to_free_swap() to use a folio. This removes a few calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-47-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit b4e6f66e45b43aed0903731b6c0700573f88282a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:41 2022 +0100 ksm: use a folio in replace_page() Replace three calls to compound_head() with one. Link: https://lkml.kernel.org/r/20220902194653.1739778-46-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 5fcd079af9ed4e69cca0a2f77c6255d0eb8a8cca Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:40 2022 +0100 uprobes: use folios more widely in __replace_page() Remove a few hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-45-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 98b211d6415f9538b81e50da71f09d195ce2afe6 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:39 2022 +0100 madvise: convert madvise_free_pte_range() to use a folio Saves a lot of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-44-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 2fad3d14b9ebc8e42977bfb34a8165bb61a7c3f7 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:38 2022 +0100 huge_memory: convert do_huge_pmd_wp_page() to use a folio Removes many calls to compound_head(). Does not remove the assumption that a folio may not be larger than a PMD. Link: https://lkml.kernel.org/r/20220902194653.1739778-43-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit e4a2ed94908cc0104b8826ed8d831661ed1c3ea1 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:37 2022 +0100 mm: convert do_wp_page() to use a folio Saves many calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-42-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 71fa1a533d2e027a3df98fd065605bebab42d7bf Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:36 2022 +0100 swap: convert swap_writepage() to use a folio Removes many calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-41-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit aedd74d4397a2b1a4882215b6169b47d139c0319 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:35 2022 +0100 swap_state: convert free_swap_cache() to use a folio Saves several calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-40-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit cb691e2f28bc63b1a872aa593dd542ee796e8364 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:34 2022 +0100 mm: remove lookup_swap_cache() All callers have now been converted to swap_cache_get_folio(), so we can remove this wrapper. Link: https://lkml.kernel.org/r/20220902194653.1739778-39-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 5a423081b2465d38baf2fcbbc19f77d211507061 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:33 2022 +0100 mm: convert do_swap_page() to use swap_cache_get_folio() Saves a folio->page->folio conversion. Link: https://lkml.kernel.org/r/20220902194653.1739778-38-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit f102cd8b173e066179b472fb6e3b18e31a1cc394 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:32 2022 +0100 swapfile: convert unuse_pte_range() to use a folio Delay fetching the precise page from the folio until we're in unuse_pte(). Saves many calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-37-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 2c3f6194b008b23e52a8e135bdd56b67fdaa55ca Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:31 2022 +0100 swapfile: convert __try_to_reclaim_swap() to use a folio Saves five calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-36-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 000085b9af9f3ca13dd672a753f815ac0cb45d0a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:30 2022 +0100 swapfile: convert try_to_unuse() to use a folio Saves five calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-35-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 923e2f0e7c30db5c1ee5d680050ab781e6c114fb Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:29 2022 +0100 shmem: remove shmem_getpage() With all callers removed, remove this wrapper function. The flags are now mysteriously called SGP, but I think we can live with that. Link: https://lkml.kernel.org/r/20220902194653.1739778-34-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 12acf4fbc4f78b24822317888b9406d56dc9ad2a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:28 2022 +0100 userfaultfd: convert mcontinue_atomic_pte() to use a folio shmem_getpage() is being replaced by shmem_get_folio() so use a folio throughout this function. Saves several calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-33-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 7459c149ae9ca7d6f241b3a3764aa81b9c405a0e Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:27 2022 +0100 khugepaged: call shmem_get_folio() shmem_getpage() is being removed, so call its replacement and find the precise page ourselves. Link: https://lkml.kernel.org/r/20220902194653.1739778-32-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit e4b57722d0e6be8820039a7d506378640aee5073 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:26 2022 +0100 shmem: convert shmem_get_link() to use a folio Symlinks will never use a large folio, but using the folio API removes a lot of unnecessary folio->page->folio conversions. Link: https://lkml.kernel.org/r/20220902194653.1739778-31-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 7ad0414bded6e8678840368be5cc72b9957a4478 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:25 2022 +0100 shmem: convert shmem_symlink() to use a folio While symlinks will always be < PAGE_SIZE, using the folio APIs gets rid of unnecessary calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-30-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit b0802b22a97581608df3d2db2e705fe599777b18 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:24 2022 +0100 shmem: convert shmem_fallocate() to use a folio Call shmem_get_folio() and use the folio APIs instead of the page APIs. Saves several calls to compound_head() and removes assumptions about the size of a large folio. Link: https://lkml.kernel.org/r/20220902194653.1739778-29-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4601e2fc8b57840660ce1a1ee98aea873fa15eee Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:23 2022 +0100 shmem: convert shmem_file_read_iter() to use shmem_get_folio() Use a folio throughout, saving five calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-28-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit eff1f906c2dcd83ce7cbd38d2b853d2c49027f39 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:22 2022 +0100 shmem: convert shmem_write_begin() to use shmem_get_folio() Use a folio throughout this function, saving a couple of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-27-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a7f5862cc0624ca6b21da5a634ff232dc65776b5 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:21 2022 +0100 shmem: convert shmem_get_partial_folio() to use shmem_get_folio() Get rid of an unnecessary folio->page->folio conversion. Link: https://lkml.kernel.org/r/20220902194653.1739778-26-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4e1fc793ad9892cec67b40c9f67583160e08f695 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:20 2022 +0100 shmem: add shmem_get_folio() With no remaining callers of shmem_getpage_gfp(), add shmem_get_folio() and reimplement shmem_getpage() as a call to shmem_get_folio(). Link: https://lkml.kernel.org/r/20220902194653.1739778-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a3a9c39704f4fec403ef173e62e069558b7eb85a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:19 2022 +0100 shmem: convert shmem_read_mapping_page_gfp() to use shmem_get_folio_gfp() Saves a couple of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-24-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 68a541001a31856fb99614861de1c03109d2ea4d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:18 2022 +0100 shmem: convert shmem_fault() to use shmem_get_folio_gfp() No particular advantage for this function, but necessary to remove shmem_getpage_gfp(). [hughd@google.com: fix crash] Link: https://lkml.kernel.org/r/7693a84-bdc2-27b5-2695-d0fe8566571f@google.com Link: https://lkml.kernel.org/r/20220902194653.1739778-23-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit fc26babbc7d45a98607918d336744269bc59d7b5 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:17 2022 +0100 shmem: convert shmem_getpage_gfp() to shmem_get_folio_gfp() Add a shmem_getpage_gfp() wrapper for compatibility with current users. Link: https://lkml.kernel.org/r/20220902194653.1739778-22-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 5739a81cf89f2bbbfff691439b8fcdf3c8d33f5d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:16 2022 +0100 shmem: eliminate struct page from shmem_swapin_folio() Convert shmem_swapin() to return a folio and use swap_cache_get_folio(), removing all uses of struct page in this function. Link: https://lkml.kernel.org/r/20220902194653.1739778-21-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit c9edc242811d4c4b939b283f4f40b89f9c5b3b5a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:15 2022 +0100 swap: add swap_cache_get_folio() Convert lookup_swap_cache() into swap_cache_get_folio() and add a lookup_swap_cache() wrapper around it. [akpm@linux-foundation.org: add CONFIG_SWAP=n stub for swap_cache_get_folio()] Link: https://lkml.kernel.org/r/20220902194653.1739778-20-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 0d698e257241436e01182508d93fc290987eb37d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:14 2022 +0100 shmem: convert shmem_replace_page() to shmem_replace_folio() The caller has a folio, so convert the calling convention and rename the function. Link: https://lkml.kernel.org/r/20220902194653.1739778-19-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 7a7256d5f512b6c17957df7f59cf5e281b3ddba3 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:13 2022 +0100 shmem: convert shmem_mfill_atomic_pte() to use a folio Assert that this is a single-page folio as there are several assumptions in here that it's exactly PAGE_SIZE bytes large. Saves several calls to compound_head() and removes the last caller of shmem_alloc_page(). Link: https://lkml.kernel.org/r/20220902194653.1739778-18-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 6599591816f522c1cc8ec4eb5cea75738963756a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:12 2022 +0100 memcg: convert mem_cgroup_swapin_charge_page() to mem_cgroup_swapin_charge_folio() All callers now have a folio, so pass it in here and remove an unnecessary call to page_folio(). Link: https://lkml.kernel.org/r/20220902194653.1739778-17-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit d4f9565ae598bd6b6ffbd8b4dfbf97a9e339da2d Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:11 2022 +0100 mm: convert do_swap_page()'s swapcache variable to a folio The 'swapcache' variable is used to track whether the page is from the swapcache or not. It can do this equally well by being the folio of the page rather than the page itself, and this saves a number of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-16-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 63ad4add3823051aeb1fcd1ba981f6efd07086bf Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:10 2022 +0100 mm: convert do_swap_page() to use a folio Removes quite a lot of calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4081f7446d95a9d3ced12dc04ff02c187a761e90 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:09 2022 +0100 mm/swap: convert put_swap_page() to put_swap_folio() With all callers now using a folio, we can convert this function. Link: https://lkml.kernel.org/r/20220902194653.1739778-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a4c366f01f10073e0220656561b875627ff7cd90 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:08 2022 +0100 mm/swap: convert add_to_swap_cache() to take a folio With all callers using folios, we can convert add_to_swap_cache() to take a folio and use it throughout. Link: https://lkml.kernel.org/r/20220902194653.1739778-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a0d3374b070776e985bbd7b165b178fa688bf37a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:07 2022 +0100 mm/swap: convert __read_swap_cache_async() to use a folio Remove a few hidden (and one visible) calls to compound_head(). Link: https://lkml.kernel.org/r/20220902194653.1739778-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit bdb0ed54a4768dc3c2613d4c45f94c887d43cd7a Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:06 2022 +0100 mm/swapfile: convert try_to_free_swap() to folio_free_swap() Add kernel-doc for folio_free_swap() and make it return bool. Add a try_to_free_swap() compatibility wrapper. Link: https://lkml.kernel.org/r/20220902194653.1739778-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 14d01ee9fcb901c9e020f2dcd71c500f10c3bd03 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:05 2022 +0100 mm/swapfile: remove page_swapcount() By restructuring folio_swapped(), it can use swap_swapcount() instead of page_swapcount(). It's even a little more efficient. Link: https://lkml.kernel.org/r/20220902194653.1739778-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 907ea17eb2b436f07332c935476d77893abae735 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:04 2022 +0100 shmem: convert shmem_replace_page() to use folios throughout Introduce folio_set_swap_entry() to abstract how both folio->private and swp_entry_t work. Use swap_address_space() directly instead of indirecting through folio_mapping(). Include an assertion that the old folio is not large as we only allocate a single-page folio to replace it. Use folio_put_refs() instead of calling folio_put() twice. Link: https://lkml.kernel.org/r/20220902194653.1739778-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4cd400fd1f55dde1fa430a706828042daed94c43 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:03 2022 +0100 shmem: convert shmem_delete_from_page_cache() to take a folio Remove the assertion that the page is not Compound as this function now handles large folios correctly. Link: https://lkml.kernel.org/r/20220902194653.1739778-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit f530ed0e2d01aafc4d0e3cf8ab6b64bbdb7696a7 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:02 2022 +0100 shmem: convert shmem_writepage() to use a folio throughout Even though we will split any large folio that comes in, write the code to handle large folios so as to not leave a trap for whoever tries to handle large folios in the swap cache. Link: https://lkml.kernel.org/r/20220902194653.1739778-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 681ecf6301786cb06942b57f0ef7103b07ae6813 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:01 2022 +0100 mm: add folio_add_lru_vma() Convert lru_cache_add_inactive_or_unevictable() to folio_add_lru_vma() and add a compatibility wrapper. Link: https://lkml.kernel.org/r/20220902194653.1739778-6-willy@infradead.org Signed-off-by: "Matthew Wilcox (Oracle)" Signed-off-by: Andrew Morton commit d788f5b374c2ba204fed57e39acf2452acc24812 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:46:00 2022 +0100 mm: add split_folio() This wrapper removes a need to use split_huge_page(&folio->page). Convert two callers. Link: https://lkml.kernel.org/r/20220902194653.1739778-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit c3a15bff46cb5149aeae4c8ae69443d791fa6578 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:45:59 2022 +0100 mm: reimplement folio_order() and folio_nr_pages() Instead of calling compound_order() and compound_nr_pages(), use the folio directly. Saves 1905 bytes from mm/filemap.o due to folio_test_large() now being a cheaper check than PageHead(). Link: https://lkml.kernel.org/r/20220902194653.1739778-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 379708ffde1b049bc41084e0a0572c44c8a1d2c4 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:45:58 2022 +0100 mm: add the first tail page to struct folio Some of the static checkers get confused by extracting the page from the folio and referring to fields in the first tail page. Adding these fields to struct folio lets us avoid doing that. It has the risk that people will refer to those fields without checking that the folio is actually a large folio, so prefix them with underscores and document the preferred function to use instead. Link: https://lkml.kernel.org/r/20220902194653.1739778-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 49fd9b6df54e610d817f04ab0f94919f5c1a4f66 Author: Matthew Wilcox (Oracle) Date: Fri Sep 2 20:45:57 2022 +0100 mm/vmscan: fix a lot of comments Patch series "MM folio changes for 6.1", v2. My focus this round has been on shmem. I believe it is now fully converted to folios. Of course, shmem interacts with a lot of the swap cache and other parts of the kernel, so there are patches all over the MM. This patch series survives a round of xfstests on tmpfs, which is nice, but hardly an exhaustive test. Hugh was nice enough to run a round of tests on it and found a bug which is fixed in this edition. This patch (of 57): A lot of comments mention pages when they should say folios. Fix them up. [akpm@linux-foundation.org: fixups for mglru additions] Link: https://lkml.kernel.org/r/20220902194653.1739778-1-willy@infradead.org Link: https://lkml.kernel.org/r/20220902194653.1739778-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 58730ab6c7cab4e8525b7492ac369ccbfff5093a Author: Qi Zheng Date: Wed Aug 31 11:19:51 2022 +0800 ksm: convert to use common struct mm_slot Convert to use common struct mm_slot, no functional change. Link: https://lkml.kernel.org/r/20220831031951.43152-8-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 79b09941563737fad52a6b5ce9b9f0e1abf01bec Author: Qi Zheng Date: Wed Aug 31 11:19:50 2022 +0800 ksm: convert ksm_mm_slot.link to ksm_mm_slot.hash In order to use common struct mm_slot, convert ksm_mm_slot.link to ksm_mm_slot.hash in advance, no functional change. Link: https://lkml.kernel.org/r/20220831031951.43152-7-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 23f746e412b405fbd6fb9652c0f7c33818713c43 Author: Qi Zheng Date: Wed Aug 31 11:19:49 2022 +0800 ksm: convert ksm_mm_slot.mm_list to ksm_mm_slot.mm_node In order to use common struct mm_slot, convert ksm_mm_slot.mm_list to ksm_mm_slot.mm_node in advance, no functional change. Link: https://lkml.kernel.org/r/20220831031951.43152-6-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 21fbd59136e0773e0b920371860d9b6757cdb250 Author: Qi Zheng Date: Wed Aug 31 11:19:48 2022 +0800 ksm: add the ksm prefix to the names of the ksm private structures In order to prevent the name of the private structure of ksm from being the same as the name of the common structure used in subsequent patches, prefix their names with ksm in advance. Link: https://lkml.kernel.org/r/20220831031951.43152-5-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 79e1119b7e0099c6c9379ca3129ffb7aa2a1c249 Author: Qi Zheng Date: Wed Aug 31 11:19:47 2022 +0800 ksm: remove redundant declarations in ksm.h Currently, for struct stable_node, no one uses it in both the include/linux/ksm.h file and the file that contains it. For struct mem_cgroup, it's also not used in ksm.h. So they're all redundant, just remove them. Link: https://lkml.kernel.org/r/20220831031951.43152-4-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit b26e27015ec9a47eed3c960b7e3065c8ba8d16d7 Author: Qi Zheng Date: Wed Aug 31 11:19:46 2022 +0800 mm: thp: convert to use common struct mm_slot Rename private struct mm_slot to struct khugepaged_mm_slot and convert to use common struct mm_slot with no functional change. [zhengqi.arch@bytedance.com: fix build error with CONFIG_SHMEM disabled] Link: https://lkml.kernel.org/r/639fa8d5-8e5b-2333-69dc-40ed46219364@bytedance.com Link: https://lkml.kernel.org/r/20220831031951.43152-3-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit 7e736b8e36ff87080890690670c90c91d6d80091 Author: Qi Zheng Date: Wed Aug 31 11:19:45 2022 +0800 mm: introduce common struct mm_slot Patch series "add common struct mm_slot and use it in THP and KSM", v2. At present, both THP and KSM module have similar structures mm_slot for organizing and recording the information required for scanning mm, and each defines the following exactly the same operation functions: - alloc_mm_slot - free_mm_slot - get_mm_slot - insert_to_mm_slots_hash In order to de-duplicate these codes, this patchset introduces a common struct mm_slot, and lets THP and KSM to use it. This patch (of 7): At present, both THP and KSM module have similar structures mm_slot for organizing and recording the information required for scanning mm, and each defines the following exactly the same operation functions: - alloc_mm_slot - free_mm_slot - get_mm_slot - insert_to_mm_slots_hash In order to de-duplicate these codes, this patch introduces a common struct mm_slot, and subsequent patches will let THP and KSM to use it. Link: https://lkml.kernel.org/r/20220831031951.43152-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20220831031951.43152-2-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Minchan Kim Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton commit c00b5f204041581fadcc6d3de7f9407d2d110035 Author: Stephen Boyd Date: Mon Oct 3 13:26:08 2022 -0700 clk: clocking-wizard: Depend on HAS_IOMEM This driver uses devm_platform_ioremap_resource() and thus depends on HAS_IOMEM. Add the Kconfig dependency to avoid build issues. Reported-by: kernel test robot Cc: Shubhrajyoti Datta Fixes: c822490f52da ("clk: clocking-wizard: Move clocking-wizard out") Link: https://lore.kernel.org/r/20221003202608.2611295-1-sboyd@kernel.org Signed-off-by: Stephen Boyd commit c79e6fa98ca8628556a01fe277022bda64829fdf Merge: 9388076b4cedf ac73ce394a129 Author: Linus Torvalds Date: Mon Oct 3 13:26:47 2022 -0700 Merge tag 'pm-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add support for some new hardware, extend the existing hardware support, fix some issues and clean up code Specifics: - Add isupport for Tiger Lake in no-HWP mode to intel_pstate (Doug Smythies) - Update the AMD P-state driver (Perry Yuan): - Fix wrong lowest perf fetch - Map desired perf into pstate scope for powersave governor - Update pstate frequency transition delay time - Fix initial highest_perf value - Clean up - Move max CPU capacity to sugov_policy in the schedutil cpufreq governor (Lukasz Luba) - Add SM6115 to cpufreq-dt blocklist (Adam Skladowski) - Add support for Tegra239 and minor cleanups (Sumit Gupta, ye xingchen, and Yang Yingliang) - Add freq qos for qcom cpufreq driver and minor cleanups (Xuewen Yan, and Viresh Kumar) - Minor cleanups around functions called at module_init() (Xiu Jianfeng) - Use module_init and add module_exit for bmips driver (Zhang Jianhua) - Add AlderLake-N support to intel_idle (Zhang Rui) - Replace strlcpy() with unused retval with strscpy() in intel_idle (Wolfram Sang) - Remove redundant check from cpuidle_switch_governor() (Yu Liao) - Replace strlcpy() with unused retval with strscpy() in the powernv cpuidle driver (Wolfram Sang) - Drop duplicate word from a comment in the coupled cpuidle driver (Jason Wang) - Make rpm_resume() return -EINPROGRESS if RPM_NOWAIT is passed to it in the flags and the device is about to resume (Rafael Wysocki) - Add extra debugging statement for multiple active IRQs to system wakeup handling code (Mario Limonciello) - Replace strlcpy() with unused retval with strscpy() in the core system suspend support code (Wolfram Sang) - Update the intel_rapl power capping driver: - Use standard Energy Unit for SPR Dram RAPL domain (Zhang Rui). - Add support for RAPTORLAKE_S (Zhang Rui). - Fix UBSAN shift-out-of-bounds issue (Chao Qin) - Handle -EPROBE_DEFER when regulator is not probed on mtk-ci-devfreq.c (AngeloGioacchino Del Regno) - Fix message typo and use dev_err_probe() in rockchip-dfi.c (Christophe JAILLET)" * tag 'pm-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (29 commits) cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh cpufreq: Add __init annotation to module init funcs cpufreq: tegra194: change tegra239_cpufreq_soc to static PM / devfreq: rockchip-dfi: Fix an error message PM / devfreq: mtk-cci: Handle sram regulator probe deferral powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain PM: runtime: Return -EINPROGRESS from rpm_resume() in the RPM_NOWAIT case intel_idle: Add AlderLake-N support powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue cpufreq: tegra194: Add support for Tegra239 cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning cpufreq: intel_pstate: Add Tigerlake support in no-HWP mode powercap: intel_rapl: Add support for RAPTORLAKE_S cpufreq: amd-pstate: Fix initial highest_perf value cpuidle: Remove redundant check in cpuidle_switch_governor() PM: wakeup: Add extra debugging statement for multiple active IRQs cpufreq: tegra194: Remove the unneeded result variable PM: suspend: move from strlcpy() with unused retval to strscpy() intel_idle: move from strlcpy() with unused retval to strscpy() cpuidle: powernv: move from strlcpy() with unused retval to strscpy() ... commit fd30ac84f3022ea3c8c6380dfb919c869c6fd9e2 Author: Yang Yingliang Date: Tue Sep 13 11:14:42 2022 +0800 clk: clocking-wizard: Use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220913031442.980720-1-yangyingliang@huawei.com Signed-off-by: Stephen Boyd commit 9388076b4cedf199624173b4fcd3f208c02632d6 Merge: f3dfe925f9548 c8efe77f23d50 Author: Linus Torvalds Date: Mon Oct 3 13:19:53 2022 -0700 Merge tag 'acpi-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "ACPI and PNP updates for 6.1-rc1. These rearrange the ACPI device object initialization code (to get rid of a redundant parent pointer from struct acpi_device among other things), unify the _UID handling, drop support for some _OSI strings that should not be necessary any more, add new IDs to support more hardware and some more quirks, fix a few issues and clean up code all over. Specifics: - Reimplement acpi_get_pci_dev() using the list of physical devices associated with the given ACPI device object (Rafael Wysocki) - Rename ACPI device object reference counting functions (Rafael Wysocki) - Rearrange ACPI device object initialization code (Rafael Wysocki) - Drop parent field from struct acpi_device (Rafael Wysocki) - Extend the the int3472-tps68470 driver to support multiple consumers of a single TPS68470 along with the requisite framework-level support (Daniel Scally) - Filter out non-memory resources in is_memory(), add a helper function to find all memory type resources of an ACPI device object and use that function in 3 places (Heikki Krogerus) - Add IRQ override quirks for Asus Vivobook K3402ZA/K3502ZA and ASUS model S5402ZA (Tamim Khan, Kellen Renshaw) - Fix acpi_dev_state_d0() kerneldoc (Sakari Ailus) - Fix up suspend-to-idle support on ASUS Rembrandt laptops (Mario Limonciello) - Clean up ACPI platform devices support code (Andy Shevchenko, John Garry) - Clean up ACPI bus management code (Andy Shevchenko, ye xingchen) - Add support for multiple DMA windows with different offsets to the ACPI device enumeration code and use it on LoongArch (Jianmin Lv) - Clean up the ACPI LPSS (Intel SoC) driver (Andy Shevchenko) - Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable (Mario Limonciello) - Drop unused dev_fmt() and redundant 'HMAT' prefix from the HMAT parsing code (Liu Shixin) - Make ACPI FPDT parsing code avoid calling acpi_os_map_memory() on invalid physical addresses (Hans de Goede) - Silence missing-declarations warning related to Apple device properties management (Lukas Wunner) - Disable frequency invariance in the CPPC library if registers used by cppc_get_perf_ctrs() are accessed via PCC (Jeremy Linton) - Add ACPI disabled check to acpi_cpc_valid() (Perry Yuan) - Fix Tx acknowledge in the PCC address space handler (Huisong Li) - Use wait_for_completion_timeout() for PCC mailbox operations (Huisong Li) - Release resources on PCC address space setup failure path (Rafael Mendonca) - Remove unneeded result variables from APEI code (ye xingchen) - Print total number of records found during BERT log parsing (Dmitry Monakhov) - Drop support for 3 _OSI strings that should not be necessary any more and update documentation on custom _OSI strings so that adding new ones is not encouraged any more (Mario Limonciello) - Drop unneeded result variable from ec_write() (ye xingchen) - Remove the leftover struct acpi_ac_bl from the ACPI AC driver (Hanjun Guo) - Reorder symbols to get rid of a few forward declarations in the ACPI fan driver (Uwe Kleine-König) - Add Toshiba Satellite/Portege Z830 ACPI backlight quirk (Arvid Norlander) - Add ARM DMA-330 controller to the supported list in the ACPI AMBA driver (Vijayenthiran Subramaniam) - Drop references to non-functional 01.org/linux-acpi web site from MAINTAINERS and Kconfig help texts (Rafael Wysocki) - Replace strlcpy() with unused retval with strscpy() in the ACPI support code (Wolfram Sang) - Do not initialize ret in main() in the pfrut utility (Shi junming) - Drop useless ACPI DSDT override documentation (Rafael Wysocki) - Fix a few typos and wording mistakes in the ACPI device enumeration documentation (Jean Delvare) - Introduce acpi_dev_uid_to_integer() to convert a _UID string into an integer value (Andy Shevchenko) - Use acpi_dev_uid_to_integer() in several places to unify _UID handling (Andy Shevchenko) - Drop unused pnpid32_to_pnpid() declaration from PNP code (Gaosheng Cui)" * tag 'acpi-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (79 commits) ACPI: LPSS: Deduplicate skipping device in acpi_lpss_create_device() ACPI: LPSS: Replace loop with first entry retrieval ACPI: x86: s2idle: Add another ID to s2idle_dmi_table ACPI: x86: s2idle: Fix a NULL pointer dereference MAINTAINERS: Drop records pointing to 01.org/linux-acpi ACPI: Kconfig: Drop link to https://01.org/linux-acpi ACPI: docs: Drop useless DSDT override documentation ACPI: DPTF: Drop stale link from Kconfig help ACPI: x86: s2idle: Add a quirk for ASUSTeK COMPUTER INC. ROG Flow X13 ACPI: x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7 ACPI: x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14 ACPI: x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE ACPI: x86: s2idle: Add module parameter to prefer Microsoft GUID ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt ACPI: x86: s2idle: Move _HID handling for AMD systems into structures platform/x86: int3472: Add board data for Surface Go2 IR camera platform/x86: int3472: Support multiple gpio lookups in board data platform/x86: int3472: Support multiple clock consumers ACPI: bus: Add iterator for dependent devices ACPI: scan: Add acpi_dev_get_next_consumer_dev() ... commit 8c4934f4754057e3577bb1536c6ecc0efa2c966e Author: Dave Hansen Date: Fri Sep 23 14:29:45 2022 -0700 x86/mm: Disable W^X detection and enforcement on 32-bit The 32-bit code is in a weird spot. Some 32-bit builds (non-PAE) do not even have NX support. Even PAE builds that support NX have to contend with things like EFI data and code mixed in the same pages where W+X is unavoidable. The folks still running X86_32=y kernels are unlikely to care much about NX. That combined with the fundamental inability fix _all_ of the W+X things means this code had little value on X86_32=y. Disable the checks. Reported-by: Guenter Roeck Signed-off-by: Dave Hansen Cc: Ard Biesheuvel Cc: Darren Hart Cc: Andy Shevchenko Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: linux-efi@vger.kernel.org Cc: "H. Peter Anvin" Cc: Kees Cook Link: https://lore.kernel.org/all/CAMj1kXHcF_iK_g0OZSkSv56Wmr=eQGQwNstcNjLEfS=mm7a06w@mail.gmail.com/ commit a08d97a1935bee66b099b21feddad19c1fd90d0e Merge: 62c07983bef9d 820dc0523e05c Author: Jakub Kicinski Date: Mon Oct 3 13:02:48 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-10-03 We've added 143 non-merge commits during the last 27 day(s) which contain a total of 151 files changed, 8321 insertions(+), 1402 deletions(-). The main changes are: 1) Add kfuncs for PKCS#7 signature verification from BPF programs, from Roberto Sassu. 2) Add support for struct-based arguments for trampoline based BPF programs, from Yonghong Song. 3) Fix entry IP for kprobe-multi and trampoline probes under IBT enabled, from Jiri Olsa. 4) Batch of improvements to veristat selftest tool in particular to add CSV output, a comparison mode for CSV outputs and filtering, from Andrii Nakryiko. 5) Add preparatory changes needed for the BPF core for upcoming BPF HID support, from Benjamin Tissoires. 6) Support for direct writes to nf_conn's mark field from tc and XDP BPF program types, from Daniel Xu. 7) Initial batch of documentation improvements for BPF insn set spec, from Dave Thaler. 8) Add a new BPF_MAP_TYPE_USER_RINGBUF map which provides single-user-space-producer / single-kernel-consumer semantics for BPF ring buffer, from David Vernet. 9) Follow-up fixes to BPF allocator under RT to always use raw spinlock for the BPF hashtab's bucket lock, from Hou Tao. 10) Allow creating an iterator that loops through only the resources of one task/thread instead of all, from Kui-Feng Lee. 11) Add support for kptrs in the per-CPU arraymap, from Kumar Kartikeya Dwivedi. 12) Add a new kfunc helper for nf to set src/dst NAT IP/port in a newly allocated CT entry which is not yet inserted, from Lorenzo Bianconi. 13) Remove invalid recursion check for struct_ops for TCP congestion control BPF programs, from Martin KaFai Lau. 14) Fix W^X issue with BPF trampoline and BPF dispatcher, from Song Liu. 15) Fix percpu_counter leakage in BPF hashtab allocation error path, from Tetsuo Handa. 16) Various cleanups in BPF selftests to use preferred ASSERT_* macros, from Wang Yufen. 17) Add invocation for cgroup/connect{4,6} BPF programs for ICMP pings, from YiFei Zhu. 18) Lift blinding decision under bpf_jit_harden = 1 to bpf_capable(), from Yauheni Kaliuta. 19) Various libbpf fixes and cleanups including a libbpf NULL pointer deref, from Xin Liu. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (143 commits) net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c Documentation: bpf: Add implementation notes documentations to table of contents bpf, docs: Delete misformatted table. selftests/xsk: Fix double free bpftool: Fix error message of strerror libbpf: Fix overrun in netlink attribute iteration selftests/bpf: Fix spelling mistake "unpriviledged" -> "unprivileged" samples/bpf: Fix typo in xdp_router_ipv4 sample bpftool: Remove unused struct event_ring_info bpftool: Remove unused struct btf_attach_point bpf, docs: Add TOC and fix formatting. bpf, docs: Add Clang note about BPF_ALU bpf, docs: Move Clang notes to a separate file bpf, docs: Linux byteswap note bpf, docs: Move legacy packet instructions to a separate file selftests/bpf: Check -EBUSY for the recurred bpf_setsockopt(TCP_CONGESTION) bpf: tcp: Stop bpf_setsockopt(TCP_CONGESTION) in init ops to recur itself bpf: Refactor bpf_setsockopt(TCP_CONGESTION) handling into another function bpf: Move the "cdg" tcp-cc check to the common sol_tcp_sockopt() bpf: Add __bpf_prog_{enter,exit}_struct_ops for struct_ops trampoline ... ==================== Link: https://lore.kernel.org/r/20221003194915.11847-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 7942ac9fe9c30804fc9403a6e1fae4b8ad50181d Author: Julia Lawall Date: Sat May 21 13:10:52 2022 +0200 clk: nxp: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220521111145.81697-42-Julia.Lawall@inria.fr Acked-by: Vladimir Zapolskiy Signed-off-by: Stephen Boyd commit e18d6152ff0f41b7f01f9817372022df04e0d354 Merge: fe4d9e4abf622 b60ca69715fcc Author: Paolo Bonzini Date: Mon Oct 3 15:33:43 2022 -0400 Merge tag 'kvm-riscv-6.1-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 6.1 - Improved instruction encoding infrastructure for instructions not yet supported by binutils - Svinval support for both KVM Host and KVM Guest - Zihintpause support for KVM Guest - Zicbom support for KVM Guest - Record number of signal exits as a VCPU stat - Use generic guest entry infrastructure commit fe4d9e4abf622598bd199d0805d20afa12f70c92 Merge: e779ce9d17c44 b302ca52ba823 Author: Paolo Bonzini Date: Mon Oct 3 15:33:32 2022 -0400 Merge tag 'kvmarm-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for v6.1 - Fixes for single-stepping in the presence of an async exception as well as the preservation of PSTATE.SS - Better handling of AArch32 ID registers on AArch64-only systems - Fixes for the dirty-ring API, allowing it to work on architectures with relaxed memory ordering - Advertise the new kvmarm mailing list - Various minor cleanups and spelling fixes commit 117a1542c0bc9bcce0c5b9bc63ff54dc967acdf5 Author: Xiaoke Wang Date: Thu Apr 7 17:33:49 2022 +0800 clk: pxa: add a check for the return value of kzalloc() kzalloc() is a memory allocation function which can return NULL when some internal memory errors happen. So it is better to check it to prevent potential wrong memory access. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_2B9817738F38B02844C245946EFF3B407E09@qq.com Signed-off-by: Stephen Boyd commit d8473831066b163d3af59ab0bb75a93b211ee1aa Author: Matthias Fend Date: Wed May 11 07:34:55 2022 +0200 clk: vc5: Add support for IDT/Renesas VersaClock 5P49V6975 Update IDT VersaClock 5 driver to support 5P49V6975. The 5P49V6975 is a member of the VersaClock 6E family and supports four fractional dividers (FODs), five clock outputs and an internal oscillator. Signed-off-by: Matthias Fend Link: https://lore.kernel.org/r/20220511053455.360335-2-matthias.fend@emfend.at Reviewed-by: Luca Ceresoli Acked-by: Krzysztof Kozlowski Reviewed-by: Luca Ceresoli Signed-off-by: Stephen Boyd commit f0fa3a3614b90b43ed590d484ae391eb03fa4a07 Author: Matthias Fend Date: Wed May 11 07:34:54 2022 +0200 dt-bindings: clock: vc5: Add 5P49V6975 The 5P49V6975 is a member of the VersaClock 6E family and supports four fractional dividers (FODs), five clock outputs and an internal oscillator. Signed-off-by: Matthias Fend Link: https://lore.kernel.org/r/20220511053455.360335-1-matthias.fend@emfend.at Signed-off-by: Stephen Boyd commit 3c92506d86785967fd7e7933e04491b9276c2f00 Author: Linus Walleij Date: Mon Oct 3 09:45:20 2022 +0200 gpio: tc3589x: Make irqchip immutable This turns the Toshiba tc3589x gpio irqchip immutable. Cc: Marc Zyngier Signed-off-by: Linus Walleij Acked-by: Marc Zyngier Signed-off-by: Bartosz Golaszewski commit 2e70ea7fb9873e642982f166bf9aaa4a6206fbec Merge: a7ae50fc34eb9 53e41b8593954 cff895277c855 Author: Rafael J. Wysocki Date: Mon Oct 3 20:43:32 2022 +0200 Merge branches 'thermal-intel' and 'thermal-drivers' Merge thermal control driver changes for 6.1-rc1: - Use module_pci_driver() macro in the int340x processor_thermal driver (Shang XiaoJing). - Use get_cpu() instead of smp_processor_id() in the intel_powerclamp thermal driver to prevent it from crashing and remove unused accounting for IRQ wakes from it (Srinivas Pandruvada). - Consolidate priv->data_vault checks in int340x_thermal (Rafael Wysocki). - Check the policy first in cpufreq_cooling_register() (Xuewen Yan). - Drop redundant error message from da9062-thermal (zhaoxiao). - Drop of_match_ptr() from thermal_mmio (Jean Delvare). * thermal-intel: thermal: int340x: processor_thermal: Use module_pci_driver() macro thermal: intel_powerclamp: Remove accounting for IRQ wakes thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash thermal: int340x_thermal: Consolidate priv->data_vault checks * thermal-drivers: thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register() thermal: da9062-thermal: Drop redundant error message thermal/drivers/thermal_mmio: Drop of_match_ptr() commit a7ae50fc34eb985b4ce9c8c8d937394890f7c36c Merge: 96f1c52992e5a 82b1ec794d701 Author: Rafael J. Wysocki Date: Mon Oct 3 20:38:43 2022 +0200 Merge branch 'thermal-core' Merge core thermal control changes for 6.1-rc1: - Increase maximum number of trip points in the thermal core (Sumeet Pawnikar). - Replace strlcpy() with unused retval with strscpy() in the core thermal control code (Wolfram Sang). - Do not lock thermal zone mutex in the user space governor (Rafael Wysocki) - Rework the device tree initialization, convert the drivers to the new API and remove the old OF code (Daniel Lezcano) - Fix return value to -ENODEV when searching for a specific thermal zone which does not exist (Daniel Lezcano) - Fix the return value inspection in of_thermal_zone_find() (Dan Carpenter) - Fix kernel panic when KASAN is enabled as it detects use after free when unregistering a thermal zone (Daniel Lezcano) - Move the set_trip ops inside the therma sysfs code (Daniel Lezcano) - Remove unnecessary error message as it is already showed in the underlying function (Jiapeng Chong) - Rework the monitoring path and move the locks upper in the call stack to fix some potentials race windows (Daniel Lezcano) - Fix lockdep_assert() warning introduced by the lock rework (Daniel Lezcano) - Revert the Mellanox 'hotter thermal zone' feature because it is already handled in the thermal framework core code (Daniel Lezcano) * thermal-core: (47 commits) thermal: core: Increase maximum number of trip points thermal: move from strlcpy() with unused retval to strscpy() thermal: gov_user_space: Do not lock thermal zone mutex Revert "mlxsw: core: Add the hottest thermal zone detection" thermal/core: Fix lockdep_assert() warning thermal/core: Move the mutex inside the thermal_zone_device_update() function thermal/core: Move the thermal zone lock out of the governors thermal/governors: Group the thermal zone lock inside the throttle function thermal/core: Rework the monitoring a bit thermal/core: Rearm the monitoring only one time thermal/drivers/qcom/spmi-adc-tm5: Remove unnecessary print function dev_err() thermal/of: Remove old OF code thermal/core: Move set_trip_temp ops to the sysfs code thermal/drivers/samsung: Switch to new of thermal API regulator/drivers/max8976: Switch to new of thermal API Input: sun4i-ts - switch to new of thermal API iio/drivers/sun4i_gpadc: Switch to new of thermal API hwmon/drivers/core: Switch to new of thermal API hwmon: pm_bus: core: Switch to new of thermal API ata/drivers/ahci_imx: Switch to new of thermal API ... commit ac73ce394a129a88cb01ce190844bcd172ce14fb Merge: 0766fa2e8a2e9 65c0c2367e9e6 e66332a4bc89e cb3e7d624c3ff 4c081324df560 Author: Rafael J. Wysocki Date: Mon Oct 3 20:27:49 2022 +0200 Merge branches 'pm-cpuidle', 'pm-core', 'pm-sleep' and 'powercap' Merge cpuidle changes, PM core changes and power capping changes for 6.1-rc1: - Add AlderLake-N support to intel_idle (Zhang Rui). - Replace strlcpy() with unused retval with strscpy() in intel_idle (Wolfram Sang). - Remove redundant check from cpuidle_switch_governor() (Yu Liao). - Replace strlcpy() with unused retval with strscpy() in the powernv cpuidle driver (Wolfram Sang). - Drop duplicate word from a comment in the coupled cpuidle driver (Jason Wang). - Make rpm_resume() return -EINPROGRESS if RPM_NOWAIT is passed to it in the flags and the device is about to resume (Rafael Wysocki). - Add extra debugging statement for multiple active IRQs to system wakeup handling code (Mario Limonciello). - Replace strlcpy() with unused retval with strscpy() in the core system suspend support code (Wolfram Sang). - Update the intel_rapl power capping driver: * Use standard Energy Unit for SPR Dram RAPL domain (Zhang Rui). * Add support for RAPTORLAKE_S (Zhang Rui). * Fix UBSAN shift-out-of-bounds issue (Chao Qin). * pm-cpuidle: intel_idle: Add AlderLake-N support cpuidle: Remove redundant check in cpuidle_switch_governor() intel_idle: move from strlcpy() with unused retval to strscpy() cpuidle: powernv: move from strlcpy() with unused retval to strscpy() cpuidle: coupled: Drop duplicate word from a comment * pm-core: PM: runtime: Return -EINPROGRESS from rpm_resume() in the RPM_NOWAIT case * pm-sleep: PM: wakeup: Add extra debugging statement for multiple active IRQs PM: suspend: move from strlcpy() with unused retval to strscpy() * powercap: powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue powercap: intel_rapl: Add support for RAPTORLAKE_S commit 0766fa2e8a2e9da0a11326f2dd68d01c7800672b Merge: 599618e5891e7 8e3d08676735c Author: Rafael J. Wysocki Date: Mon Oct 3 20:19:13 2022 +0200 Merge branch 'pm-cpufreq' Merge cpufreq changes for 6.1-rc1: - Add isupport for Tiger Lake in no-HWP mode to intel_pstate (Doug Smythies). - Update the AMD P-state driver (Perry Yuan): * Fix wrong lowest perf fetch. * Map desired perf into pstate scope for powersave governor. * Update pstate frequency transition delay time. * Fix initial highest_perf value. * Clean up. - Move max CPU capacity to sugov_policy in the schedutil cpufreq governor (Lukasz Luba). - Add SM6115 to cpufreq-dt blocklist (Adam Skladowski). - Add support for Tegra239 and minor cleanups (Sumit Gupta, ye xingchen, and Yang Yingliang). - Add freq qos for qcom cpufreq driver and minor cleanups (Xuewen Yan, and Viresh Kumar). - Minor cleanups around functions called at module_init() (Xiu Jianfeng). - Use module_init and add module_exit for bmips driver (Zhang Jianhua). * pm-cpufreq: cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh cpufreq: Add __init annotation to module init funcs cpufreq: tegra194: change tegra239_cpufreq_soc to static cpufreq: tegra194: Add support for Tegra239 cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning cpufreq: intel_pstate: Add Tigerlake support in no-HWP mode cpufreq: amd-pstate: Fix initial highest_perf value cpufreq: tegra194: Remove the unneeded result variable cpufreq: amd-pstate: update pstate frequency transition delay time cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor cpufreq: amd_pstate: fix wrong lowest perf fetch cpufreq: amd-pstate: fix white-space cpufreq: amd-pstate: simplify cpudata pointer assignment cpufreq: bmips-cpufreq: Use module_init and add module_exit cpufreq: schedutil: Move max CPU capacity to sugov_policy cpufreq: Add SM6115 to cpufreq-dt-platdev blocklist commit c8efe77f23d508d62e232de612e739dbf4da4659 Merge: 4aa497ca10a00 564d53b8b5909 Author: Rafael J. Wysocki Date: Mon Oct 3 20:16:28 2022 +0200 Merge branch 'pnp' Merge a PNP changes for 6.1-rc1: - Drop unused pnpid32_to_pnpid() declaration from PNP code (Gaosheng Cui). * pnp: PNPBIOS: remove unused pnpid32_to_pnpid() declaration commit 4aa497ca10a003153dd4b7af5f33d5f71a8f30d8 Merge: a7ece531b9401 7fc90e8617095 Author: Rafael J. Wysocki Date: Mon Oct 3 20:09:22 2022 +0200 Merge branch 'acpi-uid' Merge ACPI _UID handling unification changes for 6.1-rc1: - Introduce acpi_dev_uid_to_integer() to convert a _UID string into an integer value (Andy Shevchenko). - Use acpi_dev_uid_to_integer() in several places to unify _UID handling (Andy Shevchenko). * acpi-uid: efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer() spi: pxa2xx: Refactor _UID handling to use acpi_dev_uid_to_integer() perf: qcom_l2_pmu: Refactor _UID handling to use acpi_dev_uid_to_integer() i2c: mlxbf: Refactor _UID handling to use acpi_dev_uid_to_integer() i2c: amd-mp2-plat: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI: x86: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as integer commit a7ece531b940199d2f4a5fae310d8088309ed2cf Merge: 7b4baa39de503 67ef3d7a96b28 40083734d9f94 d206cef03c482 Author: Rafael J. Wysocki Date: Mon Oct 3 20:03:49 2022 +0200 Merge branches 'acpi-misc', 'acpi-tools' and 'acpi-docs' Merge miscellaneous ACPI material, ACPI tools changes and ACPI documentation updates for 6.1-rc1: - Drop references to non-functional 01.org/linux-acpi web site from MAINTAINERS and Kconfig help texts (Rafael Wysocki). - Replace strlcpy() with unused retval with strscpy() in the ACPI support code (Wolfram Sang). - Do not initialize ret in main() in the pfrut utility (Shi junming). - Drop useless ACPI DSDT override documentation (Rafael Wysocki). - Fix a few typos and wording mistakes in the ACPI device enumeration documentation (Jean Delvare). * acpi-misc: MAINTAINERS: Drop records pointing to 01.org/linux-acpi ACPI: Kconfig: Drop link to https://01.org/linux-acpi ACPI: DPTF: Drop stale link from Kconfig help ACPI: move from strlcpy() with unused retval to strscpy() * acpi-tools: ACPI: tools: pfrut: Do not initialize ret in main() * acpi-docs: ACPI: docs: Drop useless DSDT override documentation ACPI: docs: enumeration: Fix a few typos and wording mistakes commit 7b4baa39de503391b5537c9667b2214a3e6592d5 Merge: b1d03b7ec7215 b3c0e38bdb52a f336443acc890 f23470e659964 574160b8548de 53e7380c9338a Author: Rafael J. Wysocki Date: Mon Oct 3 19:59:47 2022 +0200 Merge branches 'acpi-ec', 'acpi-ac', 'acpi-fan', 'acpi-video' and 'acpi-amba' Merge EC, AC, fan and backlight driver changes and ACPI AMBA support update for 6.1-rc1: - Drop unneeded result variable from ec_write() (ye xingchen). - Remove the leftover struct acpi_ac_bl from the ACPI AC driver (Hanjun Guo). - Reorder symbols to get rid of a few forward declarations in the ACPI fan driver (Uwe Kleine-König). - Add Toshiba Satellite/Portege Z830 ACPI backlight quirk (Arvid Norlander). - Add ARM DMA-330 controller to the supported list in the ACPI AMBA driver (Vijayenthiran Subramaniam). * acpi-ec: ACPI: EC: Drop unneeded result variable from ec_write() * acpi-ac: ACPI: AC: Remove the leftover struct acpi_ac_bl * acpi-fan: ACPI: fan: Reorder symbols to get rid of a few forward declarations * acpi-video: ACPI: video: Add Toshiba Satellite/Portege Z830 quirk * acpi-amba: ACPI: AMBA: Add ARM DMA-330 controller to the supported list commit b1d03b7ec7215f366d8909efbfcc2fee72328389 Merge: e996c7e01892a ae2df912d1a55 18729106c26fb 382c5fec89f3b 2f190ac250b32 Author: Rafael J. Wysocki Date: Mon Oct 3 19:49:05 2022 +0200 Merge branches 'acpi-cppc', 'acpi-pcc', 'acpi-apei' and 'acpi-osi' Merge new material related to CPPC, PCC, APEI and OSI strings handling for 6.1-rc1: - Disable frequency invariance in the CPPC library if registers used by cppc_get_perf_ctrs() are accessed via PCC (Jeremy Linton). - Add ACPI disabled check to acpi_cpc_valid() (Perry Yuan). - Fix Tx acknowledge in the PCC address space handler (Huisong Li). - Use wait_for_completion_timeout() for PCC mailbox operations (Huisong Li). - Release resources on PCC address space setup failure path (Rafael Mendonca). - Remove unneeded result variables from APEI code (ye xingchen). - Print total number of records found during BERT log parsing (Dmitry Monakhov). - Drop support for 3 _OSI strings that should not be necessary any more and update documentation on custom _OSI strings so that adding new ones is not encouraged any more (Mario Limonciello). * acpi-cppc: ACPI: CPPC: Disable FIE if registers in PCC regions ACPI: CPPC: Add ACPI disabled check to acpi_cpc_valid() * acpi-pcc: ACPI: PCC: Fix Tx acknowledge in the PCC address space handler ACPI: PCC: replace wait_for_completion() ACPI: PCC: Release resources on address space setup failure path * acpi-apei: ACPI: APEI: Remove unneeded result variables ACPI: APEI: Add BERT error log footer * acpi-osi: ACPI: OSI: Update Documentation on custom _OSI strings ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string ACPI: OSI: Remove Linux-Lenovo-NV-HDMI-Audio _OSI string ACPI: OSI: Remove Linux-Dell-Video _OSI string commit 96e4abbd35adb5582573c463ccc554a644ac2434 Author: Zhang Qilong Date: Thu Sep 29 23:06:52 2022 +0800 ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by calling pm_runtime_disable when error returns. Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver") Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220929150653.63845-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 6ab646c985b529a32bf162de48d2d4a8bb7c9b64 Author: Zhang Qilong Date: Thu Sep 29 23:06:51 2022 +0800 ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by calling pm_runtime_enable when error returns. Fixes:5c6af635fd772 ("ASoC: wm5110: Add audio CODEC driver") Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220929150653.63845-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit fdabc3f10e774ddc86ba715b9bc0c861d7e0834c Author: Zhang Qilong Date: Thu Sep 29 23:06:50 2022 +0800 ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by calling pm_runtime_disable when error returns. Fixes:40843aea5a9bd ("ASoC: wm8997: Initial CODEC driver") Signed-off-by: Zhang Qilong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220929150653.63845-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit e5d271812e7a4d527e65b0228b4a16795c0e0c6c Author: Beau Belgrave Date: Fri Sep 30 17:10:16 2022 -0700 tracing/user_events: Move pages/locks into groups to prepare for namespaces In order to enable namespaces or any sort of isolation within user_events the register lock and pages need to be broken up into groups. Each event and file now has a group pointer which stores the actual pages to map, lookup data and synchronization objects. This only enables a single group that maps to init_user_ns, as IMA namespace has done. This enables user_events to start the work of supporting namespaces by walking the namespaces up to the init_user_ns. Future patches will address other user namespaces and will align to the approaches the IMA namespace uses. Link: https://lore.kernel.org/linux-kernel/20220915193221.1728029-15-stefanb@linux.ibm.com/#t Link: https://lkml.kernel.org/r/20221001001016.2832-2-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit f3dfe925f9548a4337883926db542ccf4ca55fe1 Merge: 890f242084c9e 69d517e6e2109 Author: Linus Torvalds Date: Mon Oct 3 10:23:32 2022 -0700 Merge tag 'docs-6.1' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "There's not a huge amount of activity in the docs tree this time around, but a few significant changes even so: - A complete rewriting of the top-level index.rst file, which mostly reflects itself in a redone top page in the HTML-rendered docs. The hope is that the new organization will be a friendlier starting point for both users and developers. - Some math-rendering improvements. - A coding-style.rst update on the use of BUG() and WARN() - A big maintainer-PHP guide update. - Some code-of-conduct updates - More Chinese translation work Plus the usual pile of typo fixes, corrections, and updates" * tag 'docs-6.1' of git://git.lwn.net/linux: (66 commits) checkpatch: warn on usage of VM_BUG_ON() and other BUG variants coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") Documentation: devres: add missing IO helper Documentation: devres: update IRQ helper Documentation/mm: modify page_referenced to folio_referenced Documentation/CoC: Reflect current CoC interpretation and practices docs/doc-guide: Add documentation on SPHINX_IMGMATH docs: process/5.Posting.rst: clarify use of Reported-by: tag docs, kprobes: Fix the wrong location of Kprobes docs: add a man-pages link to the front page docs: put atomic*.txt and memory-barriers.txt into the core-api book docs: move asm-annotations.rst into core-api docs: remove some index.rst cruft docs: reconfigure the HTML left column docs: Rewrite the front page docs: promote the title of process/index.rst Documentation: devres: add missing SPI helper Documentation: devres: add missing PINCTRL helpers docs: hugetlbpage.rst: fix a typo of hugepage size docs/zh_CN: Add new translation of admin-guide/bootconfig.rst ... commit 890f242084c9eac18ef87031d95e0bdbaac01ed4 Merge: b8fb65e1d3320 5c0ec4900497f Author: Linus Torvalds Date: Mon Oct 3 10:11:11 2022 -0700 Merge tag 'rcu.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU updates from Paul McKenney: - Documentation updates. This is the first in a series from an ongoing review of the RCU documentation. "Why are people thinking -that- about RCU? Oh. Because that is an entirely reasonable interpretation of its documentation." - Miscellaneous fixes. - Improved memory allocation and heuristics. - Improve rcu_nocbs diagnostic output. - Add full-sized polled RCU grace period state values. These are the same size as an rcu_head structure, which is double that of the traditional unsigned long state values that may still be obtained from et_state_synchronize_rcu(). The added size avoids missing overlapping grace periods. This benefit is that call_rcu() can be replaced by polling, which can be attractive in situations where RCU-protected data is aged out of memory. Early in the series, the size of this state value is three unsigned longs. Later in the series, the fastpaths in synchronize_rcu() and synchronize_rcu_expedited() are reworked to permit the full state to be represented by only two unsigned longs. This reworking slows these two functions down in SMP kernels running either on single-CPU systems or on systems with all but one CPU offlined, but this should not be a significant problem. And if it somehow becomes a problem in some yet-as-unforeseen situations, three-value state values can be provided for only those situations. Finally, a pair of functions named same_state_synchronize_rcu() and same_state_synchronize_rcu_full() allow grace-period state values to be compared for equality. This permits users to maintain lists of data structures having the same state value, removing the need for per-data-structure grace-period state values, thus decreasing memory footprint. - Polled SRCU grace-period updates, including adding tests to rcutorture and reducing the incidence of Tiny SRCU grace-period-state counter wrap. - Improve Tasks RCU diagnostics and quiescent-state detection. * tag 'rcu.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (55 commits) rcutorture: Use the barrier operation specified by cur_ops rcu-tasks: Make RCU Tasks Trace check for userspace execution rcu-tasks: Ensure RCU Tasks Trace loops have quiescent states rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() srcu: Make Tiny SRCU use full-sized grace-period counters srcu: Make Tiny SRCU poll_state_synchronize_srcu() more precise srcu: Add GP and maximum requested GP to Tiny SRCU rcutorture output rcutorture: Make "srcud" option also test polled grace-period API rcutorture: Limit read-side polling-API testing rcu: Add functions to compare grace-period state values rcutorture: Expand rcu_torture_write_types() first "if" statement rcutorture: Use 1-suffixed variable in rcu_torture_write_types() check rcu: Make synchronize_rcu() fastpath update only boot-CPU counters rcutorture: Adjust rcu_poll_need_2gp() for rcu_gp_oldstate field removal rcu: Remove ->rgos_polled field from rcu_gp_oldstate structure rcu: Make synchronize_rcu_expedited() fast path update .expedited_sequence rcu: Remove expedited grace-period fast-path forward-progress helper rcu: Make synchronize_rcu() fast path update ->gp_seq counters rcu-tasks: Remove grace-period fast-path rcu-tasks helper rcu: Set rcu_data structures' initial ->gpwrap value to true ... commit b8fb65e1d33206f78ad62e10ceb93095ecac24a6 Merge: dda0ba40da682 be94ecf7608cc Author: Linus Torvalds Date: Mon Oct 3 10:06:15 2022 -0700 Merge tag 'lkmm.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull LKMM (Linux Kernel Memory Model) updates from Paul McKenney: "Several documentation updates" * tag 'lkmm.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/memory-model: Clarify LKMM's limitations in litmus-tests.txt docs/memory-barriers.txt: Fixup long lines docs/memory-barriers.txt: Fix confusing name of 'data dependency barrier' commit 2ad4b6f5e1179f3879b6d4392070039e32ce55a3 Author: Mike Marshall Date: Mon Oct 3 13:05:38 2022 -0400 Orangefs: change iterate to iterate_shared Changed .iterate to .iterate_shared in orangefs_dir_operations. I didn't change anything else, there were no xfstests regressions and no problem with any of my other tests... Signed-off-by: Mike Marshall commit dda0ba40da68255cea24474e69bcf14499408e2b Merge: 038239640e3af 43cf168fa9999 Author: Linus Torvalds Date: Mon Oct 3 10:01:19 2022 -0700 Merge tag 'nolibc.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull nolibc updates from Paul McKenney: "Most notably greatly improved testing. These tests are located in tools/testing/selftests/nolibc. The output of "make help" is as follows: Supported targets under selftests/nolibc: all call the "run" target below help this help sysroot create the nolibc sysroot here (uses $ARCH) nolibc-test build the executable (uses $CC and $CROSS_COMPILE) initramfs prepare the initramfs with nolibc-test defconfig create a fresh new default config (uses $ARCH) kernel (re)build the kernel with the initramfs (uses $ARCH) run runs the kernel in QEMU after building it (uses $ARCH, $TEST) rerun runs a previously prebuilt kernel in QEMU (uses $ARCH, $TEST) clean clean the sysroot, initramfs, build and output files The output file is "run.out". Test ranges may be passed using $TEST. Currently using the following variables: ARCH = x86 CROSS_COMPILE = CC = gcc OUTPUT = /home/git/linux-rcu/tools/testing/selftests/nolibc/ TEST = QEMU_ARCH = x86_64 [determined from $ARCH] IMAGE_NAME = bzImage [determined from $ARCH] The output of a successful x86 "make run" is currently as follows, with kernel build output omitted: $ make run 71 test(s) passed." * tag 'nolibc.2022.09.30a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: selftests/nolibc: Avoid generated files being committed selftests/nolibc: add a "help" target selftests/nolibc: "sysroot" target installs a local copy of the sysroot selftests/nolibc: add a "run" target to start the kernel in QEMU selftests/nolibc: add a "defconfig" target selftests/nolibc: add a "kernel" target to build the kernel with the initramfs selftests/nolibc: support glibc as well selftests/nolibc: condition some tests on /proc existence selftests/nolibc: recreate and populate /dev and /proc if missing selftests/nolibc: on x86, support exiting with isa-debug-exit selftests/nolibc: exit with poweroff on success when getpid() == 1 selftests/nolibc: add a few tests for some libc functions selftests/nolibc: implement a few tests for various syscalls selftests/nolibc: support a test definition format selftests/nolibc: add basic infrastructure to ease creation of nolibc tests tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition tools/nolibc: fix build warning in sys_mmap() when my_syscall6 is not defined tools/nolibc: make argc 32-bit in riscv startup code commit 038239640e3afc8370a4de9880cbd4f942154fc3 Merge: 75003fa726e99 14ca1a4690750 Author: Linus Torvalds Date: Mon Oct 3 09:56:25 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: "Three fixes for ARM: - unbreak the RiscPC build - fix wrong pg_level in page table dumper - make MT_MEMORY_RO really read-only with LPAE" * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE ARM: 9244/1: dump: Fix wrong pg_level in walk_pmd() ARM: 9243/1: riscpc: Unbreak the build commit cdf6428dd518435a05739abf7659589de30970f4 Author: Ville Syrjälä Date: Tue Sep 27 21:24:55 2022 +0300 drm/i915: Reject excessive dotclocks early Make sure modes with crazy big dotclocks are rejected early, so as to not cause problems for subsequent code via integer overflows and whatnot. These would eventually be rejected in intel_crtc_compute_pipe_mode() but that is now too late as we do the clock computations a bit earlier than that. And we don't want to just reorder the two since we still want to check the final computed dotclock against the hardware limit to make sure we didn't end up above the limit due to rounding/etc. Fixes: 0ff0e219d9b8 ("drm/i915: Compute clocks earlier") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220927182455.3422-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit df2f59c5857b56a5cc40b6562b032c5d8d50cdfc) Signed-off-by: Tvrtko Ursulin commit b2e3a1af8cce4117de06ff1a4eab0749753ede27 Author: Ville Syrjälä Date: Mon Oct 3 14:15:43 2022 +0300 drm/i915: Fix watermark calculations for DG2 CCS+CC modifier Take the DG2 CCS+CC modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this tile-4 modifier is linear. The rc_surface part is actually a nop since that is not used for any glk+ platform. Cc: stable@vger.kernel.org Fixes: 680025dcc400 ("drm/i915/dg2: Add support for DG2 clear color compression") Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-6-ville.syrjala@linux.intel.com (cherry picked from commit 334810f82024815283a6e7febd3d2de1fed6c232) Signed-off-by: Tvrtko Ursulin commit ccfa6d35f9233702c924316cdf40c05b6ce88113 Author: Ville Syrjälä Date: Mon Oct 3 14:15:42 2022 +0300 drm/i915: Fix watermark calculations for DG2 CCS modifiers Take the DG2 CCS modifiers into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking these tile-4 modifiers are linear. The rc_surface part is actually a nop since that is not used for any glk+ platform. Cc: stable@vger.kernel.org Fixes: 4c3afa72138c ("drm/i915/dg2: Add support for DG2 render and media compression") Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-5-ville.syrjala@linux.intel.com (cherry picked from commit f25d9f81a8e09ace4f04106995550bae1f522143) Signed-off-by: Tvrtko Ursulin commit 070a2855900de17b1e11a0dc35af9794e80f1a28 Author: Ville Syrjälä Date: Mon Oct 3 14:15:41 2022 +0300 drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier Take the gen12+ CCS+CC modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this Y-tiled modifier is linear. The rc_surface part is actually a nop since that is not used for any glk+ platform. Cc: stable@vger.kernel.org Fixes: d1e2775e9b96 ("drm/i915/tgl: Add Clear Color support for TGL Render Decompression") Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-4-ville.syrjala@linux.intel.com (cherry picked from commit a627455bbe50a111475d7a42beb58fa64bd96c83) Signed-off-by: Tvrtko Ursulin commit 484b2b9281000274ef7c5cb0a9ebc5da6f5c281c Author: Ville Syrjälä Date: Mon Oct 3 14:15:40 2022 +0300 drm/i915: Fix watermark calculations for gen12+ MC CCS modifier Take the gen12+ MC CCS modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this Y-tiled modifier is linear. The rc_surface part is actually a nop since that is not used for any glk+ platform. v2: Split RC CCS vs. MC CCS to separate patches Cc: stable@vger.kernel.org Fixes: 2dfbf9d2873a ("drm/i915/tgl: Gen-12 display can decompress surfaces compressed by the media engine") Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-3-ville.syrjala@linux.intel.com (cherry picked from commit 91c9651425fe955b1387f3637607dda005f3f710) Signed-off-by: Tvrtko Ursulin commit c56453a00f19ccddee302f5f9fe96b80e0b47fd3 Author: Ville Syrjälä Date: Mon Oct 3 14:15:39 2022 +0300 drm/i915: Fix watermark calculations for gen12+ RC CCS modifier Take the gen12+ RC CCS modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this Y-tiled modifier is linear. The rc_surface part is actually a nop since that is not used for any glk+ platform. v2: Split RC CCS vs. MC CCS to separate patches Cc: stable@vger.kernel.org Fixes: b3e57bccd68a ("drm/i915/tgl: Gen-12 render decompression") Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-2-ville.syrjala@linux.intel.com (cherry picked from commit a89a96a586114f67598c6391c75678b4dba5c2da) Signed-off-by: Tvrtko Ursulin commit 1de2e7e08e8cd0f281ba9f079a25e72543fe82f6 Author: Jouni Högander Date: Mon Oct 3 10:20:11 2022 +0300 drm/i915/psr: Fix PSR_IMR/IIR field handling Current PSR code is supposed to use TRANSCODER_EDP to force 0 shift for bits in PSR_IMR/IIR registers: /* * gen12+ has registers relative to transcoder and one per transcoder * using the same bit definition: handle it as TRANSCODER_EDP to force * 0 shift in bit definition */ At the time of writing the code assumption "TRANSCODER_EDP == 0" was made. This is not the case and all fields in PSR_IMR and PSR_IIR are shifted incorrectly if DISPLAY_VER >= 12. Fix this by adding separate register field defines for >=12 and add bit getter functions to keep code readability. v4: - Remove EDP from TGL definitions (José) - Use REG_BIT and REG_GENMASK (José) v3: - Add separate register field defines (José) - Add bit getter functions (José) v2: - Improve commit message (José) Cc: José Roberto de Souza Cc: Mika Kahola Fixes: 8241cfbe67f4 ("drm/i915/tgl: Access the right register when handling PSR interruptions") Signed-off-by: Jouni Högander Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20221003072011.72408-1-jouni.hogander@intel.com (cherry picked from commit 8da8e32e0b095613af2c2ce4b322240269164a8e) Signed-off-by: Tvrtko Ursulin commit af4e20d335d4414814030ba26f1689884c831269 Author: Tejas Upadhyay Date: Fri Sep 30 19:02:23 2022 +0530 drm/i915/ehl: Update MOCS table for EHL Add these extra EHL entries back since we have drm-tip commit 13d29c823738 ("drm/i915/ehl: unconditionally flush the pages on acquire") introduces proper flushing to make it work as expected. Cc: Chris Wilson Cc: Matthew Auld Fixes: 046091758b50 ("Revert "drm/i915/ehl: Update MOCS table for EHL"") Signed-off-by: Matt Roper Signed-off-by: Tejas Upadhyay Acked-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220930133223.2757282-1-tejas.upadhyay@intel.com (cherry picked from commit 6fa964c045a6bc3321a9186e87bfbcfd1059b0f1) Signed-off-by: Tvrtko Ursulin commit 75003fa726e990883bba5b38c4c4d873dab45d62 Merge: fb443f36f3b9a dc63a086daee9 Author: Linus Torvalds Date: Mon Oct 3 09:48:47 2022 -0700 Merge tag 'm68k-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Fix forward secrecy of RNG seed boot record handling - Make RNG seed boot record handling generic for all m68k platforms using bootinfo - defconfig updates - Minor fixes and improvements * tag 'm68k-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Rework BI_VIRT_RNG_SEED as BI_RNG_SEED m68k: Process bootinfo records before saving them m68k: defconfig: Update defconfigs for v6.0-rc2 m68k: Allow kexec on M68KCLASSIC with MMU enabled only m68k: Move from strlcpy with unused retval to strscpy commit fb443f36f3b9af6a4590b6e65e2d7affdfe0da18 Merge: 4fe89d07dcc28 90c2d2eb7ab58 Author: Linus Torvalds Date: Mon Oct 3 09:31:55 2022 -0700 Merge tag 'mips_6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - mainly cleanups - fix enabling interrupts on second VPE for Lantiq platform - switch to use gpiod API - allow firmware passing RND seed * tag 'mips_6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (29 commits) MIPS: pci: lantiq: switch to using gpiod API mips: allow firmware to pass RNG seed to kernel MIPS: Simplify __bswapdi2() and __bswapsi2() MIPS: Silence missing prototype warning mips: update config files MIPS: Lantiq: vmmc: fix compile break introduced by gpiod patch MIPS: IRQ: remove orphan allocate_irqno() declaration MIPS: remove orphan sb1250_time_init() declaration MIPS: Lantiq: switch vmmc to use gpiod API MIPS: lantiq: enable all hardware interrupts on second VPE MIPS: BCM47XX: Cast memcmp() of function to (void *) mips: ralink: convert to DEFINE_SHOW_ATTRIBUTE mips: kernel: convert to DEFINE_SHOW_ATTRIBUTE mips: cavium: convert to DEFINE_SHOW_ATTRIBUTE MIPS: AR7: remove orphan declarations from arch/mips/include/asm/mach-ar7/ar7.h MIPS: remove orphan sni_cpu_time_init() declaration MIPS: IRQ: remove orphan declarations from arch/mips/include/asm/irq.h MIPS: Octeon: remove orphan octeon_hal_setup_reserved32() declaration MIPS: Octeon: remove orphan cvmx_fpa_setup_pool() declaration MIPS: Octeon: remove orphan octeon_swiotlb declaration ... commit 5d8d2bb946dd24d00c99384471ad8148571a9fbd Author: Steven Rostedt (Google) Date: Fri Sep 30 12:41:31 2022 -0400 tracing: Add Masami Hiramatsu as co-maintainer Masami has been maintaining kprobes for a while now and that code has been an integral part of tracing. He has also been an excellent reviewer of all the tracing code and contributor as well. The tracing subsystem needs another active maintainer to keep it running smoothly, and I do not know anyone more qualified for the job than Masami. Ingo has also told me that he has not been active in the tracing code for some time and said he could be removed from the TRACING portion of the MAINTAINERS file. Link: https://lkml.kernel.org/r/20220930124131.7b6432dd@gandalf.local.home Acked-by: Ingo Molnar Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 7a7f58575483a74db4cc2c1e37f21ddda057083d Author: Pierre Gondois Date: Fri Sep 30 16:49:36 2022 +0200 of: base: Shift refcount decrement in of_find_last_cache_level() Currently, of_find_next_cache_node() and of_property_read_u32() are called on objects after their refcount have been decremented. Re-order the calls to decrement the refcount after the function calls. Signed-off-by: Pierre Gondois Link: https://lore.kernel.org/r/20220930144936.2882481-1-pierre.gondois@arm.com Signed-off-by: Rob Herring commit ed87277f122674a943239c6e60d352c8d56deb50 Author: Chen Zhongjin Date: Fri Sep 30 18:32:36 2022 +0800 tracing: Remove unused variable 'dups' Reported by Clang [-Wunused-but-set-variable] 'commit c193707dde77 ("tracing: Remove code which merges duplicates")' This commit removed the code which merges duplicates in detect_dups(), but forgot to delete the variable 'dups' which used to merge duplicates in the loop. Now only 'total_dups' is needed, remove 'dups' for clean code. Link: https://lkml.kernel.org/r/20220930103236.253985-1-chenzhongjin@huawei.com Signed-off-by: Chen Zhongjin Signed-off-by: Steven Rostedt (Google) commit 820dc0523e05c12810bb6bf4e56ce26e4c1948a2 Author: Lorenzo Bianconi Date: Fri Sep 30 00:38:43 2022 +0200 net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c Remove circular dependency between nf_nat module and nf_conntrack one moving bpf_ct_set_nat_info kfunc in nf_nat_bpf.c Fixes: 0fabd2aa199f ("net: netfilter: add bpf_ct_set_nat_info kfunc helper") Suggested-by: Kumar Kartikeya Dwivedi Tested-by: Nathan Chancellor Tested-by: Yauheni Kaliuta Signed-off-by: Lorenzo Bianconi Acked-by: John Fastabend Link: https://lore.kernel.org/r/51a65513d2cda3eeb0754842e8025ab3966068d8.1664490511.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov commit 736baae643cb1ccaeaf989ef8eb09ce085020479 Author: Bagas Sanjaya Date: Sun Oct 2 10:20:23 2022 +0700 Documentation: bpf: Add implementation notes documentations to table of contents Sphinx reported warnings on missing implementation notes documentations in the table of contents: Documentation/bpf/clang-notes.rst: WARNING: document isn't included in any toctree Documentation/bpf/linux-notes.rst: WARNING: document isn't included in any toctree Add these documentations to the table of contents (index.rst) of BPF documentation to fix the warnings. Link: https://lore.kernel.org/linux-doc/202210020749.yfgDZbRL-lkp@intel.com/ Fixes: 6c7aaffb24efbd ("bpf, docs: Move Clang notes to a separate file") Fixes: 6166da0a02cde2 ("bpf, docs: Move legacy packet instructions to a separate file") Reported-by: kernel test robot Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20221002032022.24693-1-bagasdotme@gmail.com Signed-off-by: Alexei Starovoitov commit 0e0f0b74f895942afaf2f9213b97a6cb021d05df Author: Mark Rutland Date: Wed Sep 28 12:46:21 2022 +0100 MAINTAINERS: add myself as a tracing reviewer Since I'm actively involved in a number of arch bits that intersect ftrace (e.g. the actual arch implementation on arm64, stacktracing, entry management, and general instrumentation safety), add myself as a reviewer of the core ftrace code so that I have the change to catch any potential problems early. I spoke with Steven about this at LPC, and it seemed to make sense to add me as a reviewer. Link: https://lkml.kernel.org/r/20220928114621.248038-1-mark.rutland@arm.com Cc: Ingo Molnar Signed-off-by: Mark Rutland Signed-off-by: Steven Rostedt (Google) commit 1b00adce8afdb842615a5bf3774510f14a9b769a Author: Vladimir Oltean Date: Thu Jul 28 17:42:54 2022 +0300 irqchip/ls-extirq: Fix invalid wait context by avoiding to use regmap The irqchip->irq_set_type method is called by __irq_set_trigger() under the desc->lock raw spinlock. The ls-extirq implementation, ls_extirq_irq_set_type(), uses an MMIO regmap created by of_syscon_register(), which uses plain spinlocks (the kind that are sleepable on RT). Therefore, this is an invalid locking scheme for which we get a kernel splat stating just that ("[ BUG: Invalid wait context ]"), because the context in which the plain spinlock may sleep is atomic due to the raw spinlock. We need to go raw spinlocks all the way. Make this driver ioremap its INTPCR register on its own, and stop relying on syscon to provide a regmap. Fixes: 0dcd9f872769 ("irqchip: Add support for Layerscape external interrupt lines") Signed-off-by: Vladimir Oltean [maz: trimmed down commit log] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220728144254.175385-1-vladimir.oltean@nxp.com commit 8777dd9dff4020bba66654ec92e4b0ab6367ad30 Author: Krishna Yarlagadda Date: Sat Oct 1 17:51:44 2022 +0530 spi: tegra210-quad: Fix combined sequence Return value should be updated to zero in combined sequence routine if transfer is completed successfully. Currently it holds timeout value resulting in errors. Signed-off-by: Krishna Yarlagadda Link: https://lore.kernel.org/r/20221001122148.9158-1-kyarlagadda@nvidia.com Signed-off-by: Mark Brown commit 90377158bd2d2acd20e6131e84c234d715b7aa42 Author: Trond Myklebust Date: Wed Aug 24 16:56:48 2022 -0400 NFSv4/pNFS: Always return layout stats on layout return for flexfiles We want to ensure that the server never misses the layout stats when we're closing the file, so that it knows whether or not to update its internal state. Otherwise, if we were racing with a layout stat, we might cause the server to invalidate its layout before the layout stat got processed. Fixes: 06946c6a3d8b ("pNFS/flexfiles: Only send layoutstats updates for mirrors that were updated") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 0dd7439f382518e9997cfa7ca9d06799dbeb33fa Author: Wolfram Sang Date: Thu Aug 18 23:01:15 2022 +0200 NFS: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Anna Schumaker commit 15bcdc92d108b3bd85a44d7712496c89cf3ffddd Author: Wolfram Sang Date: Thu Aug 18 23:02:29 2022 +0200 SUNRPC: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Anna Schumaker commit 384edeb46f07f4ee1b3adda9416e724421e2fad5 Author: Lukas Bulwahn Date: Wed Aug 10 13:40:01 2022 +0200 NFS: clean up a needless assignment in nfs_file_write() Commit 064109db53ec ("NFS: remove redundant code in nfs_file_write()") identifies that filemap_fdatawait_range() will always return 0 and removes a dead error-handling case in nfs_file_write(). With this change however, assigning the return of filemap_fdatawait_range() to the result variable is a dead store. Remove this needless assignment. No functional change. No change in object code. Signed-off-by: Lukas Bulwahn Signed-off-by: Anna Schumaker commit 7e7ce2ccbae746a88e21b4ce94dbf372b31c152c Author: yuzhe Date: Wed Jun 15 13:39:24 2022 +0800 nfs: remove unnecessary (void*) conversions. remove unnecessary void* type castings. Signed-off-by: yuzhe Signed-off-by: Anna Schumaker commit d6abc719a213b8c409789799786e11d203adb3b0 Author: Ziyang Xuan Date: Tue Jun 7 15:32:01 2022 +0800 SUNRPC: use max_t() to simplify open code Use max_t() to simplify open code which uses "if...else" to get maximum of two values. Generated by coccinelle script: scripts/coccinelle/misc/minmax.cocci Signed-off-by: Ziyang Xuan Signed-off-by: Anna Schumaker commit 724e2df95b08a7e6ca989a9f96b29dc92ece9cd9 Author: Bo Liu Date: Wed Jun 15 02:27:45 2022 -0400 NFSv4: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu Signed-off-by: Anna Schumaker commit 9947e57b22ddfb6f697fa45ef5c92d2aa17b2edf Author: Bo Liu Date: Wed Jun 15 04:20:02 2022 -0400 SUNRPC: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu Signed-off-by: Anna Schumaker commit abb1bc7ed95a98ae828470a0e482e2b7f8e9631c Author: Alice Chen Date: Fri Sep 23 10:51:23 2022 +0800 dt-bindings: leds: Add MediaTek MT6370 flashlight Add MediaTek MT6370 flashlight binding documentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alice Chen Signed-off-by: ChiaEn Wu Link: https://lore.kernel.org/r/5632ef04d7807f78259e4e9f3d952849a839a50c.1663926551.git.chiaen_wu@richtek.com Signed-off-by: Rob Herring commit 440c57dabb45ecf580fa7e188cb20e982a4f60ba Author: ChiYuan Huang Date: Fri Sep 23 10:51:22 2022 +0800 dt-bindings: leds: mt6370: Add MediaTek MT6370 current sink type LED indicator Add MediaTek MT6370 current sink type LED indicator binding documentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Link: https://lore.kernel.org/r/27df85c30277a171ae85ff6d5b7d867625765d0a.1663926551.git.chiaen_wu@richtek.com Signed-off-by: Rob Herring commit cd425807288579bac95f2cdcbd98dba53a76f55a Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:00:06 2022 +0200 dt-bindings: mailbox: Convert mtk-gce to DT schema Convert the mtk-gce mailbox binding to DT schema format. During the conversion, the examples for client device/mutex nodes were removed, as these are found in their respective bindings: arm/mediatek/mediatek,mmsys.yaml for "mediatek,mt8173-mmsys" soc/mediatek/mediatek,mutex.yaml for "mediatek,mt8173-disp-mutex" Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921090006.37642-1-angelogioacchino.delregno@collabora.com Signed-off-by: Rob Herring commit 86a4d29e75540e20f991e72f17aa51d0e775a397 Merge: 02f2e785c4834 f0c8d7468af00 Author: Takashi Iwai Date: Mon Oct 3 16:30:42 2022 +0200 Merge tag 'asoc-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.1 This has been a very quiet release for the core but quite a busy one for drivers with a big crop of new drivers and lots of feature additions and fixes to existing ones: - A new string helper parse_int_array_user(). - Improvements to the SOF IPC4 code, especially around trace. - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450 and Texas Instruments SRC4392 There is a conflict with the conversion of I2C remove functions to void in the cs42l42 driver which is fairly straightforward to resolve but should be highlighted to Linus. commit 1625c8cba77086a90c4a037f2ab4597ebfdce08e Merge: 4fe89d07dcc28 d3549a938b73f Author: Huacai Chen Date: Mon Oct 3 22:08:38 2022 +0800 Merge tag 'efi-next-for-v6.1' into loongarch-next LoongArch architecture changes for 6.1 depend on the efi changes to work, so merge them to create a base. commit 62c07983bef9d3e78e71189441e1a470f0d1e653 Author: Eric Dumazet Date: Sat Oct 1 13:51:02 2022 -0700 once: add DO_ONCE_SLOW() for sleepable contexts Christophe Leroy reported a ~80ms latency spike happening at first TCP connect() time. This is because __inet_hash_connect() uses get_random_once() to populate a perturbation table which became quite big after commit 4c2c8f03a5ab ("tcp: increase source port perturb table to 2^16") get_random_once() uses DO_ONCE(), which block hard irqs for the duration of the operation. This patch adds DO_ONCE_SLOW() which uses a mutex instead of a spinlock for operations where we prefer to stay in process context. Then __inet_hash_connect() can use get_random_slow_once() to populate its perturbation table. Fixes: 4c2c8f03a5ab ("tcp: increase source port perturb table to 2^16") Fixes: 190cc82489f4 ("tcp: change source port randomizarion at connect() time") Reported-by: Christophe Leroy Link: https://lore.kernel.org/netdev/CANn89iLAEYBaoYajy0Y9UmGFff5GPxDUoG-ErVB2jDdRNQ5Tug@mail.gmail.com/T/#t Signed-off-by: Eric Dumazet Cc: Willy Tarreau Tested-by: Christophe Leroy Signed-off-by: David S. Miller commit 3a4d061c699bd3eedc80dc97a4b2a2e1af83c6f5 Author: Tetsuo Handa Date: Sun Oct 2 01:43:44 2022 +0900 net/ieee802154: reject zero-sized raw_sendmsg() syzbot is hitting skb_assert_len() warning at raw_sendmsg() for ieee802154 socket. What commit dc633700f00f726e ("net/af_packet: check len when min_header_len equals to 0") does also applies to ieee802154 socket. Link: https://syzkaller.appspot.com/bug?extid=5ea725c25d06fb9114c4 Reported-by: syzbot Fixes: fd1894224407c484 ("bpf: Don't redirect packets with invalid pkt_len") Signed-off-by: Tetsuo Handa Signed-off-by: David S. Miller commit ba0fbdb95da5ddd8db457ce6ba09d16dd979a294 Author: Maxim Mikityanskiy Date: Sat Oct 1 13:57:13 2022 +0300 net: wwan: iosm: Call mutex_init before locking it wwan_register_ops calls wwan_create_default_link, which ends up in the ipc_wwan_newlink callback that locks ipc_wwan->if_mutex. However, this mutex is not yet initialized by that point. Fix it by moving mutex_init above the wwan_register_ops call. This also makes the order of operations in ipc_wwan_init symmetric to ipc_wwan_deinit. Fixes: 83068395bbfc ("net: iosm: create default link via WWAN core") Signed-off-by: Maxim Mikityanskiy Reviewed-by: M Chetan Kumar Signed-off-by: David S. Miller commit f75886a045531fedf4c11cf06d977a91f4cb266c Merge: 99507e762df0f c54ffc73601c0 Author: David S. Miller Date: Mon Oct 3 12:50:19 2022 +0100 Merge branch 'octeontx2-macsec-offload' Subbaraya Sundeep says: ==================== net: Introduce macsec hardware offload for cn10k platform CN10K-B and CNF10K-B variaints of CN10K silicon has macsec block(MCS) to encrypt and decrypt packets at MAC/hardware level. This block is a global resource with hardware resources like SecYs, SCs and SAs and is in between NIX block and RPM LMAC. CN10K-B silicon has only one MCS block which receives packets from all LMACS whereas CNF10K-B has seven MCS blocks for seven LMACs. Both MCS blocks are similar in operation except for few register offsets and some configurations require writing to different registers. This patchset introduces macsec hardware offloading support. AF driver manages hardware resources and PF driver consumes them when macsec hardware offloading is needed. Patch 1 adds basic pci driver for both CN10K-B and CNF10K-B silicons and initializes hardware block. Patches 2 and 3 adds mailboxes to init, reset and manage resources of the MCS block Patch 4 adds a low priority rule in MCS TCAM so that the traffic which do not need macsec processing can be sent/received Patch 5 adds macsec stats collection support Patch 6 adds interrupt handling support and any event in which AF consumer is interested can be notified via mbox notification Patch 7 adds debugfs support which helps in debugging packet path Patch 8 introduces macsec hardware offload feature for PF netdev driver. v3 changes: Fixed clang and sparse warnings v2 changes: Fix build error by changing #ifdef CONFIG_MACSEC to #if IS_ENABLED(CONFIG_MACSEC) ==================== Signed-off-by: David S. Miller commit c54ffc73601c0a239e55911923a6e23a2a74f143 Author: Subbaraya Sundeep Date: Sat Oct 1 10:29:49 2022 +0530 octeontx2-pf: mcs: Introduce MACSEC hardware offloading This patch introduces the macsec offload feature to cn10k PF netdev driver. The macsec offload ops like adding, deleting and updating SecYs, SCs, SAs and stats are supported. XPN support will be added in later patches. Some stats use same counter in hardware which means based on the SecY mode the same counter represents different stat. Hence when SecY mode/policy is changed then snapshot of current stats are captured. Also there is no provision to specify the unique flow-id/SCI per packet to hardware hence different mac address needs to be set for macsec interfaces. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit d06c2aba51631bf6cd32a2f8f1edd67c110ade8a Author: Geetha sowjanya Date: Sat Oct 1 10:29:48 2022 +0530 octeontx2-af: cn10k: mcs: Add debugfs support This patch adds debugfs entry to dump MCS secy, sc, sa, flowid and port stats. This helps in debugging the packet path and to figure out where exactly packet was dropped. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 6c635f78c4749d09f2fd100e1a4d328fca3f5bd7 Author: Geetha sowjanya Date: Sat Oct 1 10:29:47 2022 +0530 octeontx2-af: cn10k: mcs: Handle MCS block interrupts Hardware triggers an interrupt for events like PN wrap to zero, PN crosses set threshold. This interrupt is received by the MCS_AF. MCS AF then finds the PF/VF to which SA is mapped and notifies them using mcs_intr_notify mbox message. PF/VF using mcs_intr_cfg mbox can configure the list of interrupts for which they want to receive the notification from AF. Signed-off-by: Geetha sowjanya Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 9312150af8da446d54a4bf73cfcab6896ccba84b Author: Geetha sowjanya Date: Sat Oct 1 10:29:46 2022 +0530 octeontx2-af: cn10k: mcs: Support for stats collection Add mailbox messages to return the resource stats to the caller. Stats of SecY, SC and SAs as per the macsec standard, TCAM flow id hits/miss, mailbox to clear the stats are implemented. Signed-off-by: Geetha sowjanya Signed-off-by: Ankur Dwivedi Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit bd69476e86fcce8b9e408ed801ac5a794ce8b13d Author: Geetha sowjanya Date: Sat Oct 1 10:29:45 2022 +0530 octeontx2-af: cn10k: mcs: Install a default TCAM for normal traffic Out of all the TCAM entries, reserve last TX and RX TCAM flow entry(low priority) so that normal traffic can be sent out and received. The traffic which needs macsec processing hits the high priority TCAM flows. Also install a FLR handler to free the allocated resources for PF/VF. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit cfc14181d497cd7241d2aca7dcbca9039bf8d7dd Author: Geetha sowjanya Date: Sat Oct 1 10:29:44 2022 +0530 octeontx2-af: cn10k: mcs: Manage the MCS block hardware resources To establish a macsec connection association netdev driver needs hardware resources like SecY, TCAM flows, SCs and SAs. This patch manages allocating, freeing and configuring those resources. AF consumers can request resources and configure them via these mailbox messages. AF can allocate until it runs out of hardware resources. Signed-off-by: Geetha sowjanya Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 080bbd19c9dd386fa5be2cdec6baaf01cf00db5e Author: Geetha sowjanya Date: Sat Oct 1 10:29:43 2022 +0530 octeontx2-af: cn10k: mcs: Add mailboxes for port related operations There are set of configurations to be done at MCS port level like bringing port out of reset, making port as operational or bypass. This patch adds all the port related mailbox message handlers so that AF consumers can use them. Signed-off-by: Geetha sowjanya Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit ca7f49ff884677f97858c3934806e0e666425af0 Author: Geetha sowjanya Date: Sat Oct 1 10:29:42 2022 +0530 octeontx2-af: cn10k: Introduce driver for macsec block. CN10K-B and CNF10K-B has macsec block(MCS) to encrypt and decrypt packets at MAC level. This block is a global resource with hardware resources like SecYs, SCs and SAs and is in between NIX block and RPM LMAC. CN10K-B silicon has only one MCS block which receives packets from all LMACS whereas CNF10K-B has seven MCS blocks for seven LMACs. Both MCS blocks are similar in operation except for few register offsets and some configurations require writing to different registers. Those differences between IPs are handled using separate ops. This patch adds basic driver and does the initial hardware calibration and parser configuration. Signed-off-by: Geetha sowjanya Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 12aece8b01507a2d357a1861f470e83621fbb6f2 Author: Zheng Wang Date: Sat Oct 1 01:57:25 2022 +0800 eth: sp7021: fix use after free bug in spl2sw_nvmem_get_mac_address This frees "mac" and tries to display its address as part of the error message on the next line. Swap the order. Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Signed-off-by: Zheng Wang Signed-off-by: David S. Miller commit 99507e762df0f174bfabf50a213f91d4f1ee03e0 Merge: 95698ff6177b5 b69e95397c3ca Author: David S. Miller Date: Mon Oct 3 12:46:47 2022 +0100 Merge branch 'lan966x-police-mirroring' Horatiu Vultur says: ==================== net: lan966x: Add police and mirror using tc-matchall Add tc-matchall classifier offload support both for ingress and egress. For this add support for the port police and port mirroring action support. Port police can happen only on ingress while port mirroring is supported both on ingress and egress ==================== Signed-off-by: David S. Miller commit b69e95397c3ca8c596da006fa16076b54c54d1d4 Author: Horatiu Vultur Date: Fri Sep 30 10:35:40 2022 +0200 net: lan966x: Add port mirroring support using tc-matchall Add support for port mirroring. It is possible to mirror only one port at a time and it is possible to have both ingress and egress mirroring. Frames injected by the CPU don't get egress mirrored because they are bypassing the analyzer module. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 5390334b59a3a011f1e9eff2d3023b0e407dd61b Author: Horatiu Vultur Date: Fri Sep 30 10:35:39 2022 +0200 net: lan966x: Add port police support using tc-matchall Add support for port police. It is possible to police only on the ingress side. To be able to add police support also it was required to add tc-matchall classifier offload support. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 95698ff6177b5f1f13f251da60e7348413046ae4 Author: Shenwei Wang Date: Fri Sep 30 15:44:27 2022 -0500 net: fec: using page pool to manage RX buffers This patch optimizes the RX buffer management by using the page pool. The purpose for this change is to prepare for the following XDP support. The current driver uses one frame per page for easy management. Added __maybe_unused attribute to the following functions to avoid the compiling warning. Those functions will be removed by a separate patch once this page pool solution is accepted. - fec_enet_new_rxbdp - fec_enet_copybreak The following are the comparing result between page pool implementation and the original implementation (non page pool). --- small packet (64 bytes) testing are almost the same --- no matter what the implementation is --- on both i.MX8 and i.MX6SX platforms. shenwei@5810:~/pktgen$ iperf -c 10.81.16.245 -w 2m -i 1 -l 64 ------------------------------------------------------------ Client connecting to 10.81.16.245, TCP port 5001 TCP window size: 416 KByte (WARNING: requested 1.91 MByte) ------------------------------------------------------------ [ 1] local 10.81.17.20 port 39728 connected with 10.81.16.245 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.0000-1.0000 sec 37.0 MBytes 311 Mbits/sec [ 1] 1.0000-2.0000 sec 36.6 MBytes 307 Mbits/sec [ 1] 2.0000-3.0000 sec 37.2 MBytes 312 Mbits/sec [ 1] 3.0000-4.0000 sec 37.1 MBytes 312 Mbits/sec [ 1] 4.0000-5.0000 sec 37.2 MBytes 312 Mbits/sec [ 1] 5.0000-6.0000 sec 37.2 MBytes 312 Mbits/sec [ 1] 6.0000-7.0000 sec 37.2 MBytes 312 Mbits/sec [ 1] 7.0000-8.0000 sec 37.2 MBytes 312 Mbits/sec [ 1] 0.0000-8.0943 sec 299 MBytes 310 Mbits/sec --- Page Pool implementation on i.MX8 ---- shenwei@5810:~$ iperf -c 10.81.16.245 -w 2m -i 1 ------------------------------------------------------------ Client connecting to 10.81.16.245, TCP port 5001 TCP window size: 416 KByte (WARNING: requested 1.91 MByte) ------------------------------------------------------------ [ 1] local 10.81.17.20 port 43204 connected with 10.81.16.245 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.0000-1.0000 sec 111 MBytes 933 Mbits/sec [ 1] 1.0000-2.0000 sec 111 MBytes 934 Mbits/sec [ 1] 2.0000-3.0000 sec 112 MBytes 935 Mbits/sec [ 1] 3.0000-4.0000 sec 111 MBytes 933 Mbits/sec [ 1] 4.0000-5.0000 sec 111 MBytes 934 Mbits/sec [ 1] 5.0000-6.0000 sec 111 MBytes 933 Mbits/sec [ 1] 6.0000-7.0000 sec 111 MBytes 931 Mbits/sec [ 1] 7.0000-8.0000 sec 112 MBytes 935 Mbits/sec [ 1] 8.0000-9.0000 sec 111 MBytes 933 Mbits/sec [ 1] 9.0000-10.0000 sec 112 MBytes 935 Mbits/sec [ 1] 0.0000-10.0077 sec 1.09 GBytes 933 Mbits/sec --- Non Page Pool implementation on i.MX8 ---- shenwei@5810:~$ iperf -c 10.81.16.245 -w 2m -i 1 ------------------------------------------------------------ Client connecting to 10.81.16.245, TCP port 5001 TCP window size: 416 KByte (WARNING: requested 1.91 MByte) ------------------------------------------------------------ [ 1] local 10.81.17.20 port 49154 connected with 10.81.16.245 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.0000-1.0000 sec 104 MBytes 868 Mbits/sec [ 1] 1.0000-2.0000 sec 105 MBytes 878 Mbits/sec [ 1] 2.0000-3.0000 sec 105 MBytes 881 Mbits/sec [ 1] 3.0000-4.0000 sec 105 MBytes 879 Mbits/sec [ 1] 4.0000-5.0000 sec 105 MBytes 878 Mbits/sec [ 1] 5.0000-6.0000 sec 105 MBytes 878 Mbits/sec [ 1] 6.0000-7.0000 sec 104 MBytes 875 Mbits/sec [ 1] 7.0000-8.0000 sec 104 MBytes 875 Mbits/sec [ 1] 8.0000-9.0000 sec 104 MBytes 873 Mbits/sec [ 1] 9.0000-10.0000 sec 104 MBytes 875 Mbits/sec [ 1] 0.0000-10.0073 sec 1.02 GBytes 875 Mbits/sec --- Page Pool implementation on i.MX6SX ---- shenwei@5810:~/pktgen$ iperf -c 10.81.16.245 -w 2m -i 1 ------------------------------------------------------------ Client connecting to 10.81.16.245, TCP port 5001 TCP window size: 416 KByte (WARNING: requested 1.91 MByte) ------------------------------------------------------------ [ 1] local 10.81.17.20 port 57288 connected with 10.81.16.245 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.0000-1.0000 sec 78.8 MBytes 661 Mbits/sec [ 1] 1.0000-2.0000 sec 82.5 MBytes 692 Mbits/sec [ 1] 2.0000-3.0000 sec 82.4 MBytes 691 Mbits/sec [ 1] 3.0000-4.0000 sec 82.4 MBytes 691 Mbits/sec [ 1] 4.0000-5.0000 sec 82.5 MBytes 692 Mbits/sec [ 1] 5.0000-6.0000 sec 82.4 MBytes 691 Mbits/sec [ 1] 6.0000-7.0000 sec 82.5 MBytes 692 Mbits/sec [ 1] 7.0000-8.0000 sec 82.4 MBytes 691 Mbits/sec [ 1] 8.0000-9.0000 sec 82.4 MBytes 691 Mbits/sec [ 1] 9.0000-9.5506 sec 45.0 MBytes 686 Mbits/sec [ 1] 0.0000-9.5506 sec 783 MBytes 688 Mbits/sec --- Non Page Pool implementation on i.MX6SX ---- shenwei@5810:~/pktgen$ iperf -c 10.81.16.245 -w 2m -i 1 ------------------------------------------------------------ Client connecting to 10.81.16.245, TCP port 5001 TCP window size: 416 KByte (WARNING: requested 1.91 MByte) ------------------------------------------------------------ [ 1] local 10.81.17.20 port 36486 connected with 10.81.16.245 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.0000-1.0000 sec 70.5 MBytes 591 Mbits/sec [ 1] 1.0000-2.0000 sec 64.5 MBytes 541 Mbits/sec [ 1] 2.0000-3.0000 sec 73.6 MBytes 618 Mbits/sec [ 1] 3.0000-4.0000 sec 73.6 MBytes 618 Mbits/sec [ 1] 4.0000-5.0000 sec 72.9 MBytes 611 Mbits/sec [ 1] 5.0000-6.0000 sec 73.4 MBytes 616 Mbits/sec [ 1] 6.0000-7.0000 sec 73.5 MBytes 617 Mbits/sec [ 1] 7.0000-8.0000 sec 73.4 MBytes 616 Mbits/sec [ 1] 8.0000-9.0000 sec 73.4 MBytes 616 Mbits/sec [ 1] 9.0000-10.0000 sec 73.9 MBytes 620 Mbits/sec [ 1] 0.0000-10.0174 sec 723 MBytes 605 Mbits/sec Signed-off-by: Shenwei Wang Signed-off-by: David S. Miller commit 9bc61c04ff6cce6a3756b86e6b34914f7b39d734 Author: Guillaume Nault Date: Fri Sep 30 16:37:30 2022 +0200 net: Remove DECnet leftovers from flow.h. DECnet was removed by commit 1202cdd66531 ("Remove DECnet support from kernel"). Let's also revome its flow structure. Compile-tested only (allmodconfig). Signed-off-by: Guillaume Nault Acked-by: Stephen Hemminger Signed-off-by: David S. Miller commit b43f9acbb8942b05252be83ac25a81cec70cc192 Author: Jianglei Nie Date: Fri Sep 30 14:28:43 2022 +0800 bnx2x: fix potential memory leak in bnx2x_tpa_stop() bnx2x_tpa_stop() allocates a memory chunk from new_data with bnx2x_frag_alloc(). The new_data should be freed when gets some error. But when "pad + len > fp->rx_buf_size" is true, bnx2x_tpa_stop() returns without releasing the new_data, which will lead to a memory leak. We should free the new_data with bnx2x_frag_free() when "pad + len > fp->rx_buf_size" is true. Fixes: 07b0f00964def8af9321cfd6c4a7e84f6362f728 ("bnx2x: fix possible panic under memory stress") Signed-off-by: Jianglei Nie Signed-off-by: David S. Miller commit cb4b12071a4b68df323c339f60805834246b3e9e Author: Raju Lakkaraju Date: Fri Sep 30 14:57:40 2022 +0530 eth: lan743x: reject extts for non-pci11x1x devices Remove PTP_PF_EXTTS support for non-PCI11x1x devices since they do not support the PTP-IO Input event triggered timestamping mechanisms added Fixes: 60942c397af6 ("net: lan743x: Add support for PTP-IO Event Input External Timestamp (extts)") Signed-off-by: Raju Lakkaraju Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit 5eddb24901ee49eee23c0bfce6af2e83fd5679bd Author: Coco Li Date: Fri Sep 30 15:09:05 2022 -0700 gro: add support of (hw)gro packets to gro stack Current GRO stack only supports incoming packets containing one frame/MSS. This patch changes GRO to accept packets that are already GRO. HW-GRO (aka RSC for some vendors) is very often limited in presence of interleaved packets. Linux SW GRO stack can complete the job and provide larger GRO packets, thus reducing rate of ACK packets and cpu overhead. This also means BIG TCP can still be used, even if HW-GRO/RSC was able to cook ~64 KB GRO packets. v2: fix logic in tcp_gro_receive() Only support TCP for the moment (Paolo) Co-Developed-by: Eric Dumazet Signed-off-by: Eric Dumazet Signed-off-by: Coco Li Acked-by: Paolo Abeni Signed-off-by: David S. Miller commit 9e6fd874c7bb47b6a4295abc4c81b2f41b97e970 Author: Jiasheng Jiang Date: Fri Sep 30 12:48:43 2022 +0800 net: prestera: acl: Add check for kmemdup As the kemdup could return NULL, it should be better to check the return value and return error if fails. Moreover, the return value of prestera_acl_ruleset_keymask_set() should be checked by cascade. Fixes: 604ba230902d ("net: prestera: flower template support") Signed-off-by: Jiasheng Jiang Reviewed-by: Taras Chornyi Signed-off-by: David S. Miller commit 197060c155106c48b2f35b0c1306c1b1d320a47a Merge: 7171e8a1a4a86 d89e3ed76b6ef Author: David S. Miller Date: Mon Oct 3 11:18:53 2022 +0100 Merge branch 'mptcp-fastclose' Mat Martineau says: ==================== mptcp: Fastclose edge cases and error handling MPTCP has existing code to use the MP_FASTCLOSE option header, which works like a RST for the MPTCP-level connection (regular RSTs only affect specific subflows in MPTCP). This series has some improvements for fastclose. Patch 1 aligns fastclose socket error handling with TCP RST behavior on TCP sockets. Patch 2 adds use of MP_FASTCLOSE in some more edge cases, like file descriptor close, FIN_WAIT timeout, and when the socket has unread data. Patch 3 updates the fastclose self tests. Patch 4 does not change any code, just fixes some outdated comments. ==================== Signed-off-by: David S. Miller commit d89e3ed76b6efd1a4fd213feebedd01337a16b5a Author: Paolo Abeni Date: Fri Sep 30 08:59:34 2022 -0700 mptcp: update misleading comments. The MPTCP data path is quite complex and hard to understend even without some foggy comments referring to modified code and/or completely misleading from the beginning. Update a few of them to more accurately describing the current status. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 6bf41020b72b1c5ab96acc309a135153abbe20c8 Author: Paolo Abeni Date: Fri Sep 30 08:59:33 2022 -0700 selftests: mptcp: update and extend fastclose test-cases After the previous patches, the MPTCP protocol can generate fast-closes on both ends of the connection. Rework the relevant test-case to carefully trigger the fast-close code-path on a single end at the time, while ensuring than a predictable amount of data is spooled on both ends. Additionally add another test-cases for the passive socket fast-close. Reviewed-by: Matthieu Baerts Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit d21f8348551831efd917528afc545832a372426e Author: Paolo Abeni Date: Fri Sep 30 08:59:32 2022 -0700 mptcp: use fastclose on more edge scenarios Daire reported a user-space application hang-up when the peer is forcibly closed before the data transfer completion. The relevant application expects the peer to either do an application-level clean shutdown or a transport-level connection reset. We can accommodate a such user by extending the fastclose usage: at fd close time, if the msk socket has some unread data, and at FIN_WAIT timeout. Note that at MPTCP close time we must ensure that the TCP subflows will reset: set the linger socket option to a suitable value. Reviewed-by: Matthieu Baerts Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 69800e516e968fa1cf9202b872dc86515eeeebe6 Author: Paolo Abeni Date: Fri Sep 30 08:59:31 2022 -0700 mptcp: propagate fastclose error When an mptcp socket is closed due to an incoming FASTCLOSE option, so specific sk_err is set and later syscall will fail usually with EPIPE. Align the current fastclose error handling with TCP reset, properly setting the socket error according to the current msk state and propagating such error. Additionally sendmsg() is currently not handling properly the sk_err, always returning EPIPE. Reviewed-by: Matthieu Baerts Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 7171e8a1a4a8671783ccd21c5b51108cce8986ed Merge: 3735264d722c4 324e88cbe3b7b Author: David S. Miller Date: Mon Oct 3 11:08:33 2022 +0100 Merge branch 'RollBall-Hilink-Turris-10G-copper-SFP-support' Marek Behún says: ==================== RollBall / Hilink / Turris 10G copper SFP support I am resurrecting my attempt to add support for RollBall / Hilink / Turris 10G copper SFPs modules. The modules contain Marvell 88X3310 PHY, which can communicate with the system via sgmii, 2500base-x, 5gbase-r, 10gbase-r or usxgmii mode. Some of the patches I've taken from Russell King's net-queue [1] (with some rebasing). The important change from my previous attempts are: - I am including the changes needed to phylink and marvell10g driver, so that the 88X3310 PHY is configured to use PHY modes supported by the host (the PHY defaults to use 10gbase-r only on host's side) - I have changed the patch that informs phylib about the interfaces supported by the host (patch 5 of this series): it now fills in the phydev->host_interfaces member only when connecting a PHY that is inside a SFP module. This may change in the future. ==================== Signed-off-by: David S. Miller commit 324e88cbe3b7be03af67828469cedb52c8610bd1 Author: Marek Behún Date: Fri Sep 30 16:21:10 2022 +0200 net: sfp: add support for multigig RollBall transceivers This adds support for multigig copper SFP modules from RollBall/Hilink. These modules have a specific way to access clause 45 registers of the internal PHY. We also need to wait at least 22 seconds after deasserting TX disable before accessing the PHY. The code waits for 25 seconds just to be sure. Signed-off-by: Marek Behún Reviewed-by: Russell King Signed-off-by: David S. Miller commit 09bbedac72d5a9267088c15d1a71c8c3a8fb47e7 Author: Marek Behún Date: Fri Sep 30 16:21:09 2022 +0200 net: phy: mdio-i2c: support I2C MDIO protocol for RollBall SFP modules Some multigig SFPs from RollBall and Hilink do not expose functional MDIO access to the internal PHY of the SFP via I2C address 0x56 (although there seems to be read-only clause 22 access on this address). Instead these SFPs PHY can be accessed via I2C via the SFP Enhanced Digital Diagnostic Interface - I2C address 0x51. The SFP_PAGE has to be selected to 3 and the password must be filled with 0xff bytes for this PHY communication to work. This extends the mdio-i2c driver to support this protocol by adding a special parameter to mdio_i2c_alloc function via which this RollBall protocol can be selected. Signed-off-by: Marek Behún Cc: Andrew Lunn Cc: Russell King Signed-off-by: David S. Miller commit e85b1347ace677c3822c12d9332dfaaffe594da6 Author: Marek Behún Date: Fri Sep 30 16:21:08 2022 +0200 net: sfp: create/destroy I2C mdiobus before PHY probe/after PHY release Instead of configuring the I2C mdiobus when SFP driver is probed, create/destroy the mdiobus before the PHY is probed for/after it is released. This way we can tell the mdio-i2c code which protocol to use for each SFP transceiver. Move the code that determines MDIO I2C protocol from sfp_sm_probe_for_phy() to sfp_sm_mod_probe(), where most of the SFP ID parsing is done. Don't allocate I2C bus if no PHY is expected. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 13c8adcf221f1ff407115d3269e0fb57e8cecf82 Author: Marek Behún Date: Fri Sep 30 16:21:07 2022 +0200 net: sfp: Add and use macros for SFP quirks definitions Add macros SFP_QUIRK(), SFP_QUIRK_M() and SFP_QUIRK_F() for defining SFP quirk table entries. Use them to deduplicate the code a little bit. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 31eb8907aa5b9e9be1a63f2ac574973715172ab4 Author: Marek Behún Date: Fri Sep 30 16:21:06 2022 +0200 net: phylink: allow attaching phy for SFP modules on 802.3z mode Some SFPs may contain an internal PHY which may in some cases want to connect with the host interface in 1000base-x/2500base-x mode. Do not fail if such PHY is being attached in one of these PHY interface modes. Signed-off-by: Marek Behún Reviewed-by: Russell King Reviewed-by: Pali Rohár Cc: Andrew Lunn Signed-off-by: David S. Miller commit d6d29292640d3f778a28a74c53ae1733c023392f Author: Russell King Date: Fri Sep 30 16:21:05 2022 +0200 net: phy: marvell10g: select host interface configuration Select the host interface configuration according to the capabilities of the host if the host provided them. This is currently provided only when connecting PHY that is inside a SFP. The PHY supports several configurations of host communication: - always communicate with host in 10gbase-r, even if copper speed is lower (rate matching mode), - the same as above but use xaui/rxaui instead of 10gbase-r, - switch host SerDes mode between 10gbase-r, 5gbase-r, 2500base-x and sgmii according to copper speed, - the same as above but use xaui/rxaui instead of 10gbase-r. This mode of host communication, called MACTYPE, is by default selected by strapping pins, but it can be changed in software. This adds support for selecting this mode according to which modes are supported by the host. This allows the kernel to: - support SFP modules with 88X33X0 or 88E21X0 inside them Note: we use mv3310_select_mactype() for both 88X3310 and 88X3340, although 88X3340 does not support XAUI. This is not a problem because 88X3340 does not declare XAUI in it's supported_interfaces, and so this function will never choose that MACTYPE. Signed-off-by: Russell King [ rebase, updated, also added support for 88E21X0 ] Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 3891569b2fc378e7fb882f5dbdc001ee8f78f024 Author: Marek Behún Date: Fri Sep 30 16:21:04 2022 +0200 net: phy: marvell10g: Use tabs instead of spaces for indentation Some register definitions were defined with spaces used for indentation. Change them to tabs. Signed-off-by: Marek Behún Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit eca68a3c7d05b38b4e728cead0c49718f2bc1d5a Author: Marek Behún Date: Fri Sep 30 16:21:03 2022 +0200 net: phylink: pass supported host PHY interface modes to phylib for SFP's PHYs Pass the supported PHY interface types to phylib if the PHY we are connecting is inside a SFP, so that the PHY driver can select an appropriate host configuration mode for their interface according to the host capabilities. For example the Marvell 88X3310 PHY inside RollBall SFP modules defaults to 10gbase-r mode on host's side, and the marvell10g driver currently does not change this setting. But a host may not support 10gbase-r. For example Turris Omnia only supports sgmii, 1000base-x and 2500base-x modes. The PHY can be configured to use those modes, but in order for the PHY driver to do that, it needs to know which modes are supported. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit e60846370ca96a042d0e203782b84ed9558a8546 Author: Russell King (Oracle) Date: Fri Sep 30 16:21:02 2022 +0200 net: phylink: rename phylink_sfp_config() phylink_sfp_config() now only deals with configuring the MAC for a SFP containing a PHY. Rename it to be specific. Signed-off-by: Russell King (Oracle) Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit f81fa96d8a6c7a7723b7cfa2ef8f6e514843d577 Author: Russell King Date: Fri Sep 30 16:21:01 2022 +0200 net: phylink: use phy_interface_t bitmaps for optical modules Where a MAC provides a phy_interface_t bitmap, use these bitmaps to select the operating interface mode for optical SFP modules, rather than using the linkmode bitmaps. Signed-off-by: Russell King Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit fd580c9830316edad6f8b1d9f542563730658efe Author: Russell King Date: Fri Sep 30 16:21:00 2022 +0200 net: sfp: augment SFP parsing with phy_interface_t bitmap We currently parse the SFP EEPROM to a bitmap of ethtool link modes, and then attempt to convert the link modes to a PHY interface mode. While this works at present, there are cases where this is sub-optimal. For example, where a module can operate with several different PHY interface modes. To start addressing this, arrange for the SFP EEPROM parsing to also provide a bitmap of the possible PHY interface modes. Signed-off-by: Russell King Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 1645f44dd5b846a473d7789fe622c278eb880d48 Author: Russell King (Oracle) Date: Fri Sep 30 16:20:59 2022 +0200 net: phylink: add ability to validate a set of interface modes Rather than having the ability to validate all supported interface modes or a single interface mode, introduce the ability to validate a subset of supported modes. Signed-off-by: Russell King (Oracle) [ rebased on current net-next ] Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 154fb14df7a3c81dea82eca7c0c46590f5ffc3d2 Author: Zhao Liu Date: Wed Sep 28 17:56:40 2022 +0800 x86/hyperv: Replace kmap() with kmap_local_page() kmap() is being deprecated in favor of kmap_local_page()[1]. There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid. In the fuction hyperv_init() of hyperv/hv_init.c, the mapping is used in a single thread and is short live. So, in this case, it's safe to simply use kmap_local_page() to create mapping, and this avoids the wasted cost of kmap() for global synchronization. In addtion, the fuction hyperv_init() checks if kmap() fails by BUG_ON(). From the original discussion[2], the BUG_ON() here is just used to explicitly panic NULL pointer. So still keep the BUG_ON() in place to check if kmap_local_page() fails. Based on this consideration, memcpy_to_page() is not selected here but only kmap_local_page() is used. Therefore, replace kmap() with kmap_local_page() in hyperv/hv_init.c. [1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com [2]: https://lore.kernel.org/lkml/20200915103710.cqmdvzh5lys4wsqo@liuwe-devbox-debian-v2/ Suggested-by: Dave Hansen Suggested-by: Ira Weiny Suggested-by: Fabio M. De Francesco Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20220928095640.626350-1-zhao1.liu@linux.intel.com Signed-off-by: Wei Liu commit 54b978e03a3ce7aa3b40deeb1b4c0c9dd6660aa1 Author: Ville Syrjälä Date: Mon Sep 26 22:30:21 2022 +0300 drm/i915: Round to closest in g4x+ HDMI clock readout On pre-ddi platforms we have slightly different code being used for HDMI TMDS clock to dotclock conversion between the state computation and state readout. Both of these need to round the same way in order to not get a mismatch between the computed and read out states. Fix up the rounding direction in the readout path to match what is used during state computation. Another option would to just use intel_crtc_dotclock() in the readout path as well, but I don't really want to do that as the current code more accurately represents how the hardware really works; The HDMI port register defines whether we're actually outputting 8bpc or 12bpc over HDMI, and the PIPECONF bpc setting just defines what goes over FDI between the CPU and PCH. The fact that we try to cram all that into a single pipe_bpp during state computation is perhaps not entirely great... Fixes: f2c9df101095 ("drm/i915: Round TMDS clock to nearest") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220926193021.23287-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit 86b972ef1091882d66672399c6f8ebdd12a3b707) Signed-off-by: Tvrtko Ursulin commit 9cf4843e1acf08ab5c523bc4fa8f7b24de2bea3a Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:41 2022 +0530 PCI: qcom-ep: Make use of the cached dev pointer In the qcom_pcie_ep_get_resources() function, dev pointer is already cached in a local variable. So let's make use of it instead of getting the dev pointer again from pdev struct. Link: https://lore.kernel.org/r/20220914075350.7992-4-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit e2efd31465b1d97a0bca6f93cb75ccdc8001c8d3 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:40 2022 +0530 PCI: qcom-ep: Rely on the clocks supplied by devicetree Generally, device drivers should just rely on the platform data like devicetree to supply the clocks required for the functioning of the peripheral. There is no need to hardcode the clk info in the driver. So get rid of the static clk info and obtain the platform supplied clks. The total number of clocks supplied is obtained using the devm_clk_bulk_get_all() API and used for the rest of the clk_bulk_ APIs. Link: https://lore.kernel.org/r/20220914075350.7992-3-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit f1bfbd000f3bc42a34aec9208c6aaa9076682601 Author: Manivannan Sadhasivam Date: Wed Sep 14 13:23:39 2022 +0530 PCI: qcom-ep: Add kernel-doc for qcom_pcie_ep structure Add kernel-doc for qcom_pcie_ep structure. Link: https://lore.kernel.org/r/20220914075350.7992-2-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit cbcf8722b523dcf0970ab67dc3d5ced1ea7b334e Author: Richard Zhu Date: Mon Sep 5 10:23:03 2022 +0800 phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on() Refer to phy_core driver, phy_init() must be called before phy_power_on(). Fix the wrong order of phy_init() and phy_power_on() here. Link: https://lore.kernel.org/r/1662344583-18874-1-git-send-email-hongxing.zhu@nxp.com Fixes: 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver") Tested-by: Alexander Stein Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Acked-by: Vinod Koul Acked-by: Lorenzo Pieralisi commit 3db1e531e444290f0f54dd794b5cc22cf189930a Author: Richard Zhu Date: Fri Sep 2 16:58:06 2022 +0800 PCI: imx6: Add i.MX8MP PCIe support Add i.MX8MP PCIe support. To avoid codes duplication when find the syscon regmap, add the iomux gpr syscon compatible into drvdata. Link: https://lore.kernel.org/r/1662109086-15881-8-git-send-email-hongxing.zhu@nxp.com Tested-by: Marek Vasut Tested-by: Richard Leitner Tested-by: Alexander Stein Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach commit 0dbc45241dc3f8d51957d4c770c16e49387cd6c2 Author: Andy Shevchenko Date: Tue Aug 30 21:33:10 2022 +0300 PCI: dwc: Replace of_gpio_named_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Link: https://lore.kernel.org/r/20220830183310.48541-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 8d05fc039456517d2c246c7b202891188ba40c4d Author: Barnabás Pőcze Date: Fri Sep 30 10:59:14 2022 +0000 platform/x86: use PLATFORM_DEVID_NONE instead of -1 Use the `PLATFORM_DEVID_NONE` constant instead of hard-coding -1 when creating a platform device. No functional changes are intended. Signed-off-by: Barnabás Pőcze Link: https://lore.kernel.org/r/20220930104857.2796923-1-pobrn@protonmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c928df03bde92d70babeb22d500f528256758aee Author: Mario Limonciello Date: Thu Sep 29 16:50:42 2022 -0500 platform/x86/amd: pmc: Dump idle mask during "check" stage instead The idle mask is dumped during the "prepare" and "restore" stage right now, which helps to demonstrate issues only related to the first s2idle entry. If the system has entered s2idle once, but was woken up never breaking the s2idle loop but also never went back to sleep we might still have another issue to deal with however. Move the dynamic debugging message here so that we'll catch it on each iteration. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216516 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220929215042.745-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 73ea735073599430818e89b8901452287a15a718 Author: Nathan Huckleberry Date: Thu Sep 29 11:19:47 2022 -0700 net: sparx5: Fix return type of sparx5_port_xmit_impl The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of sparx5_port_xmit_impl should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Signed-off-by: David S. Miller commit 7a62ed61367b8fd01bae1e18e30602c25060d824 Author: Kuniyuki Iwashima Date: Thu Sep 29 08:52:04 2022 -0700 af_unix: Fix memory leaks of the whole sk due to OOB skb. syzbot reported a sequence of memory leaks, and one of them indicated we failed to free a whole sk: unreferenced object 0xffff8880126e0000 (size 1088): comm "syz-executor419", pid 326, jiffies 4294773607 (age 12.609s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 7d 00 00 00 00 00 00 00 ........}....... 01 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............ backtrace: [<000000006fefe750>] sk_prot_alloc+0x64/0x2a0 net/core/sock.c:1970 [<0000000074006db5>] sk_alloc+0x3b/0x800 net/core/sock.c:2029 [<00000000728cd434>] unix_create1+0xaf/0x920 net/unix/af_unix.c:928 [<00000000a279a139>] unix_create+0x113/0x1d0 net/unix/af_unix.c:997 [<0000000068259812>] __sock_create+0x2ab/0x550 net/socket.c:1516 [<00000000da1521e1>] sock_create net/socket.c:1566 [inline] [<00000000da1521e1>] __sys_socketpair+0x1a8/0x550 net/socket.c:1698 [<000000007ab259e1>] __do_sys_socketpair net/socket.c:1751 [inline] [<000000007ab259e1>] __se_sys_socketpair net/socket.c:1748 [inline] [<000000007ab259e1>] __x64_sys_socketpair+0x97/0x100 net/socket.c:1748 [<000000007dedddc1>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<000000007dedddc1>] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 [<000000009456679f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd We can reproduce this issue by creating two AF_UNIX SOCK_STREAM sockets, send()ing an OOB skb to each other, and close()ing them without consuming the OOB skbs. int skpair[2]; socketpair(AF_UNIX, SOCK_STREAM, 0, skpair); send(skpair[0], "x", 1, MSG_OOB); send(skpair[1], "x", 1, MSG_OOB); close(skpair[0]); close(skpair[1]); Currently, we free an OOB skb in unix_sock_destructor() which is called via __sk_free(), but it's too late because the receiver's unix_sk(sk)->oob_skb is accounted against the sender's sk->sk_wmem_alloc and __sk_free() is called only when sk->sk_wmem_alloc is 0. In the repro sequences, we do not consume the OOB skb, so both two sk's sock_put() never reach __sk_free() due to the positive sk->sk_wmem_alloc. Then, no one can consume the OOB skb nor call __sk_free(), and we finally leak the two whole sk. Thus, we must free the unconsumed OOB skb earlier when close()ing the socket. Fixes: 314001f0bf92 ("af_unix: Add OOB support") Reported-by: syzbot Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 3735264d722c48745db6503a5af4d68289bef4c6 Merge: 42e8e6d906dab b86fca800a6a3 Author: David S. Miller Date: Mon Oct 3 07:59:06 2022 +0100 Merge branch 'ip_tunnel-netlink-parms' Liu Jian says: ==================== Add helper functions to parse netlink msg of ip_tunnel v1->v2: Move the implementation of the helper function to ip_tunnel_core.c v2->v3: Change EXPORT_SYMBOL to EXPORT_SYMBOL_GPL ==================== Signed-off-by: David S. Miller commit b86fca800a6a3d439c454b462f7f067a18234e60 Author: Liu Jian Date: Thu Sep 29 21:52:03 2022 +0800 net: Add helper function to parse netlink msg of ip_tunnel_parm Add ip_tunnel_netlink_parms to parse netlink msg of ip_tunnel_parm. Reduces duplicate code, no actual functional changes. Signed-off-by: Liu Jian Signed-off-by: David S. Miller commit 537dd2d9fb9f4aa7939fb4fcf552ebe4f497bd7e Author: Liu Jian Date: Thu Sep 29 21:52:02 2022 +0800 net: Add helper function to parse netlink msg of ip_tunnel_encap Add ip_tunnel_netlink_encap_parms to parse netlink msg of ip_tunnel_encap. Reduces duplicate code, no actual functional changes. Signed-off-by: Liu Jian Signed-off-by: David S. Miller commit a91b750fd6629354460282bbf5146c01b05c4859 Author: Tetsuo Handa Date: Thu Sep 29 00:25:37 2022 +0900 net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() syzbot is reporting lockdep warning at rds_tcp_reset_callbacks() [1], for commit ac3615e7f3cffe2a ("RDS: TCP: Reduce code duplication in rds_tcp_reset_callbacks()") added cancel_delayed_work_sync() into a section protected by lock_sock() without realizing that rds_send_xmit() might call lock_sock(). We don't need to protect cancel_delayed_work_sync() using lock_sock(), for even if rds_{send,recv}_worker() re-queued this work while __flush_work() from cancel_delayed_work_sync() was waiting for this work to complete, retried rds_{send,recv}_worker() is no-op due to the absence of RDS_CONN_UP bit. Link: https://syzkaller.appspot.com/bug?extid=78c55c7bc6f66e53dce2 [1] Reported-by: syzbot Co-developed-by: Hillf Danton Signed-off-by: Hillf Danton Signed-off-by: Tetsuo Handa Tested-by: syzbot Fixes: ac3615e7f3cffe2a ("RDS: TCP: Reduce code duplication in rds_tcp_reset_callbacks()") Signed-off-by: David S. Miller commit 42e8e6d906dabb58a0e0ea53443b0e0a0821f1d5 Merge: 9d43507319cc2 c39596f6ad1bf Author: David S. Miller Date: Mon Oct 3 07:46:08 2022 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== 1) Refactor selftests to use an array of structs in xfrm_fill_key(). From Gautam Menghani. 2) Drop an unused argument from xfrm_policy_match. From Hongbin Wang. 3) Support collect metadata mode for xfrm interfaces. From Eyal Birger. 4) Add netlink extack support to xfrm. From Sabrina Dubroca. Please note, there is a merge conflict in: include/net/dst_metadata.h between commit: 0a28bfd4971f ("net/macsec: Add MACsec skb_metadata_dst Tx Data path support") from the net-next tree and commit: 5182a5d48c3d ("net: allow storing xfrm interface metadata in metadata_dst") from the ipsec-next tree. Can be solved as done in linux-next. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit 02f2e785c4834828876a4701926416157dfd7b26 Merge: 84ab9408118ca 56e696c0f0c71 Author: Takashi Iwai Date: Mon Oct 3 08:48:26 2022 +0200 Merge branch 'for-next' into for-linus commit 0cf46a653bdae56683fece68dc50340f7520e6c4 Author: Wilken Gottwalt Date: Sun Oct 2 17:45:53 2022 +0000 hwmon: (corsair-psu) add USB id of new revision of the HX1000i psu Also updates the documentation accordingly. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/YznOUQ7Pijedu0NW@monster.localdomain Signed-off-by: Guenter Roeck commit cff6fdf0b2d45f563e2c25f243c624a2723d5f58 Author: Masahiro Yamada Date: Fri Sep 30 03:17:15 2022 +0900 ia64: simplify esi object addition in Makefile CONFIG_IA64_ESI is a bool option. I do not know why the Makefile was written like this, but this should not have any functional change. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 0f1fe9d6168306cd003d26dfdbb3bf3e79643e78 Author: Masahiro Yamada Date: Fri Sep 30 03:12:23 2022 +0900 Revert "kbuild: Check if linker supports the -X option" This reverts commit d79a27195a33f4b5e591de5536799ad874ea6cf5. According to the commit description, this ld-option test was added for the gold linker at that time. Commit 75959d44f9dc ("kbuild: Fail if gold linker is detected") gave up the gold linker support after all. I tested the BFD linker from binutils 2.23 and LLD from LLVM 11.0.0. Both of them support the -X option. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 5d4aeffbf7092b6bd7b2de71c2cd6fa14dffbad5 Author: Masahiro Yamada Date: Wed Sep 28 15:39:41 2022 +0900 kbuild: rebuild .vmlinux.export.o when its prerequisite is updated When include/linux/export-internal.h is updated, .vmlinux.export.o must be rebuilt, but it does not happen because its rule is hidden behind scripts/link-vmlinux.sh. Move it out of the shell script, so that Make can see the dependency between vmlinux and .vmlinux.export.o. Move the vmlinux rule to scripts/Makefile.vmlinux. Signed-off-by: Masahiro Yamada commit 7a342e6c7735e13b294374cb0a0f6283d8667496 Author: Masahiro Yamada Date: Wed Sep 28 15:39:40 2022 +0900 kbuild: move modules.builtin(.modinfo) rules to Makefile.vmlinux_o Do not build modules.builtin(.modinfo) as a side-effect of vmlinux. There are no good reason to rebuild them just because any of vmlinux's prerequistes (vmlinux.lds, .vmlinux.export.c, etc.) has been updated. Signed-off-by: Masahiro Yamada commit 637a642f5ca5e850186bb64ac75ebb0f124b458d Author: Alexey Kardashevskiy Date: Thu Sep 29 12:08:23 2022 +1000 zstd: Fixing mixed module-builtin objects With CONFIG_ZSTD_COMPRESS=m and CONFIG_ZSTD_DECOMPRESS=y we end up in a situation when files from lib/zstd/common/ are compiled once to be linked later for ZSTD_DECOMPRESS (build-in) and ZSTD_COMPRESS (module) even though CFLAGS are different for builtins and modules. So far somehow this was not a problem but enabling LLVM LTO exposes the problem as: ld.lld: error: linking module flags 'Code Model': IDs have conflicting values in 'lib/built-in.a(zstd_common.o at 5868)' and 'ld-temp.o' This particular conflict is caused by KBUILD_CFLAGS=-mcmodel=medium vs. KBUILD_CFLAGS_MODULE=-mcmodel=large , modules use the large model on POWERPC as explained at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/Makefile?h=v5.18-rc4#n127 but the current use of common files is wrong anyway. This works around the issue by introducing a zstd_common module with shared code. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Masahiro Yamada commit d32b55f4bb43466bc6cdd98a00f8a600bbf7e8ec Author: Masahiro Yamada Date: Mon Sep 26 18:02:29 2022 +0900 kallsyms: ignore __kstrtab_* and __kstrtabns_* symbols Every EXPORT_SYMBOL creates __kstrtab_* and __kstrtabns_*, which consumes 15-20% of the kallsyms entries. For example, on the system built from the x86_64 defconfig, $ cat /proc/kallsyms | wc 129527 388581 5685465 $ cat /proc/kallsyms | grep __kstrtab | wc 23489 70467 1187932 We already ignore __crc_* symbols populated by EXPORT_SYMBOL, so it should be fine to ignore __kstrtab_* and __kstrtabns_* as well. This makes vmlinux a bit smaller. $ size vmlinux.before vmlinux.after text data bss dec hex filename 22785374 8559694 1413328 32758396 1f3da7c vmlinux.before 22785374 8137806 1413328 32336508 1ed6a7c vmlinux.after Signed-off-by: Masahiro Yamada commit adc9c2e5a723052de4f5bd7e3d6add050ba400e1 Author: Darrick J. Wong Date: Fri Sep 30 17:02:32 2022 -0700 iomap: add a tracepoint for mappings returned by map_blocks Add a new tracepoint so we can see what mapping the filesystem returns to writeback a dirty page. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 3d5f3ba1ac28059bdf7000cae2403e4e984308d2 Author: Darrick J. Wong Date: Fri Sep 30 17:02:32 2022 -0700 iomap: iomap: fix memory corruption when recording errors during writeback Every now and then I see this crash on arm64: Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 Buffer I/O error on dev dm-0, logical block 8733687, async page read Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 user pgtable: 64k pages, 42-bit VAs, pgdp=0000000139750000 [00000000000000f8] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Buffer I/O error on dev dm-0, logical block 8733688, async page read Dumping ftrace buffer: Buffer I/O error on dev dm-0, logical block 8733689, async page read (ftrace buffer empty) XFS (dm-0): log I/O error -5 Modules linked in: dm_thin_pool dm_persistent_data XFS (dm-0): Metadata I/O Error (0x1) detected at xfs_trans_read_buf_map+0x1ec/0x590 [xfs] (fs/xfs/xfs_trans_buf.c:296). dm_bio_prison XFS (dm-0): Please unmount the filesystem and rectify the problem(s) XFS (dm-0): xfs_imap_lookup: xfs_ialloc_read_agi() returned error -5, agno 0 dm_bufio dm_log_writes xfs nft_chain_nat xt_REDIRECT nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_REJECT potentially unexpected fatal signal 6. nf_reject_ipv6 potentially unexpected fatal signal 6. ipt_REJECT nf_reject_ipv4 CPU: 1 PID: 122166 Comm: fsstress Tainted: G W 6.0.0-rc5-djwa #rc5 3004c9f1de887ebae86015f2677638ce51ee7 rpcsec_gss_krb5 auth_rpcgss xt_tcpudp ip_set_hash_ip ip_set_hash_net xt_set nft_compat ip_set_hash_mac ip_set nf_tables Hardware name: QEMU KVM Virtual Machine, BIOS 1.5.1 06/16/2021 pstate: 60001000 (nZCv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--) ip_tables pc : 000003fd6d7df200 x_tables lr : 000003fd6d7df1ec overlay nfsv4 CPU: 0 PID: 54031 Comm: u4:3 Tainted: G W 6.0.0-rc5-djwa #rc5 3004c9f1de887ebae86015f2677638ce51ee7405 Hardware name: QEMU KVM Virtual Machine, BIOS 1.5.1 06/16/2021 Workqueue: writeback wb_workfn sp : 000003ffd9522fd0 (flush-253:0) pstate: 60401005 (nZCv daif +PAN -UAO -TCO -DIT +SSBS BTYPE=--) pc : errseq_set+0x1c/0x100 x29: 000003ffd9522fd0 x28: 0000000000000023 x27: 000002acefeb6780 x26: 0000000000000005 x25: 0000000000000001 x24: 0000000000000000 x23: 00000000ffffffff x22: 0000000000000005 lr : __filemap_set_wb_err+0x24/0xe0 x21: 0000000000000006 sp : fffffe000f80f760 x29: fffffe000f80f760 x28: 0000000000000003 x27: fffffe000f80f9f8 x26: 0000000002523000 x25: 00000000fffffffb x24: fffffe000f80f868 x23: fffffe000f80fbb0 x22: fffffc0180c26a78 x21: 0000000002530000 x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000001 x13: 0000000000470af3 x12: fffffc0058f70000 x11: 0000000000000040 x10: 0000000000001b20 x9 : fffffe000836b288 x8 : fffffc00eb9fd480 x7 : 0000000000f83659 x6 : 0000000000000000 x5 : 0000000000000869 x4 : 0000000000000005 x3 : 00000000000000f8 x20: 000003fd6d740020 x19: 000000000001dd36 x18: 0000000000000001 x17: 000003fd6d78704c x16: 0000000000000001 x15: 000002acfac87668 x2 : 0000000000000ffa x1 : 00000000fffffffb x0 : 00000000000000f8 Call trace: errseq_set+0x1c/0x100 __filemap_set_wb_err+0x24/0xe0 iomap_do_writepage+0x5e4/0xd5c write_cache_pages+0x208/0x674 iomap_writepages+0x34/0x60 xfs_vm_writepages+0x8c/0xcc [xfs 7a861f39c43631f15d3a5884246ba5035d4ca78b] x14: 0000000000000000 x13: 2064656e72757465 x12: 0000000000002180 x11: 000003fd6d8a82d0 x10: 0000000000000000 x9 : 000003fd6d8ae288 x8 : 0000000000000083 x7 : 00000000ffffffff x6 : 00000000ffffffee x5 : 00000000fbad2887 x4 : 000003fd6d9abb58 x3 : 000003fd6d740020 x2 : 0000000000000006 x1 : 000000000001dd36 x0 : 0000000000000000 CPU: 1 PID: 122167 Comm: fsstress Tainted: G W 6.0.0-rc5-djwa #rc5 3004c9f1de887ebae86015f2677638ce51ee7 do_writepages+0x90/0x1c4 __writeback_single_inode+0x4c/0x4ac Hardware name: QEMU KVM Virtual Machine, BIOS 1.5.1 06/16/2021 writeback_sb_inodes+0x214/0x4ac wb_writeback+0xf4/0x3b0 pstate: 60001000 (nZCv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--) wb_workfn+0xfc/0x580 process_one_work+0x1e8/0x480 pc : 000003fd6d7df200 worker_thread+0x78/0x430 This crash is a result of iomap_writepage_map encountering some sort of error during writeback and wanting to set that error code in the file mapping so that fsync will report it. Unfortunately, the code dereferences folio->mapping after unlocking the folio, which means that another thread could have removed the page from the page cache (writeback doesn't hold the invalidation lock) and give it to somebody else. At best we crash the system like above; at worst, we corrupt memory or set an error on some other unsuspecting file while failing to record the problems with *this* file. Regardless, fix the problem by reporting the error to the inode mapping. NOTE: Commit 598ecfbaa742 lifted the XFS writeback code to iomap, so this fix should be backported to XFS in the 4.6-5.4 kernels in addition to iomap in the 5.5-5.19 kernels. Fixes: e735c0079465 ("iomap: Convert iomap_add_to_ioend() to take a folio") # 5.17 onward Fixes: 598ecfbaa742 ("iomap: lift the xfs writeback code to iomap") # 5.5-5.16, needs backporting Fixes: 150d5be09ce4 ("xfs: remove xfs_cancel_ioend") # 4.6-5.4, needs backporting Signed-off-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) commit 9d43507319cc256c8383e3e2dcc394b458b7aa37 Merge: bc37b24ee05e3 cc9039a134942 Author: David S. Miller Date: Sun Oct 2 16:07:17 2022 +0100 Merge branch 'tc-bind_class-hook' Zhengchao Shao says: ==================== refactor duplicate codes in bind_class hook function All the bind_class callback duplicate the same logic, so we can refactor them. First, ensure n arg not empty before call bind_class hook function. Then, add tc_cls_bind_class() helper. Last, use tc_cls_bind_class() in filter. ==================== Signed-off-by: David S. Miller commit cc9039a1349425516eca369183c5a8d2f139cb1b Author: Zhengchao Shao Date: Tue Sep 27 20:48:55 2022 +0800 net: sched: use tc_cls_bind_class() in filter Use tc_cls_bind_class() in filter. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 402963e34a707e4a8f1854ed86437bc375d65766 Author: Zhengchao Shao Date: Tue Sep 27 20:48:54 2022 +0800 net: sched: cls_api: introduce tc_cls_bind_class() helper All the bind_class callback duplicate the same logic, this patch introduces tc_cls_bind_class() helper for common usage. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 4e6263ec8bc965f0bd1c24bb40694a38e382e7a9 Author: Zhengchao Shao Date: Tue Sep 27 20:48:53 2022 +0800 net: sched: ensure n arg not empty before call bind_class All bind_class callbacks are directly returned when n arg is empty. Therefore, bind_class is invoked only when n arg is not empty. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 525dd5aed67a2f4f7278116fb92a24e6a53e2622 Author: Oleksandr Shamray Date: Thu Sep 29 15:16:42 2022 +0300 hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller Fix scale factors for reading MPS Multi-phase mp2888 controller. Fixed sensors: - PIN/POUT: based on vendor documentation, set bscale factor 0.5W/LSB - IOUT: based on vendor documentation, set scale factor 0.25 A/LSB Fixes: e4db7719d037 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2888 controller") Signed-off-by: Oleksandr Shamray Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220929121642.63051-1-oleksandrs@nvidia.com Signed-off-by: Guenter Roeck commit 1793bed346f0dc8f04c0ac6dbbc7eb3203c7d3f5 Author: Colin Ian King Date: Wed Sep 28 22:31:39 2022 +0100 dt-bindings: hwmon: sensirion,shtc1: Clean up spelling mistakes and grammar The yaml text contains some minor spelling mistakes and grammar issues, clean these up. Signed-off-by: Colin Ian King Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220928213139.63819-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 1e4aa3e18dac1ef3a07a9d0e2662208644bd93de Author: Zeng Heng Date: Tue Sep 27 19:43:52 2022 +0800 hwmon: (nct6683) remove unused variable in nct6683_create_attr_group When enable 'unused-but-set-variable' compile warning option, it would raise warning as below: drivers/hwmon/nct6683.c:415:9: warning: variable 'j' set but not used [-Wunused-but-set-variable] Variable 'j' in nct6683_create_attr_group is unused, so remove it and simplify the 'for' loop. Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20220927114352.2498079-1-zengheng4@huawei.com Signed-off-by: Guenter Roeck commit 9023e05b7a5809593a7ea09896eee0bbb6ae1685 Author: Sergio Paracuellos Date: Mon Sep 26 18:25:49 2022 +0200 dt-bindings: watchdog: migrate mt7621 text bindings to YAML Soc Mt7621 Watchdog bindings used text format, so migrate them to YAML. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sergio Paracuellos Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220926162549.805108-1-sergio.paracuellos@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 081574f76d010532ff406d682f532ac410559a3b Author: Vladimir Panteleev Date: Tue Sep 20 09:27:21 2022 +0000 watchdog: sp5100_tco: Add "action" module parameter Allow configuring the "action" bit, as documented in [1]. Previously, the only action supported by this module was to reset the system (0). It can now be configured to power off (1) instead. [1]: https://www.amd.com/system/files/TechDocs/44413.pdf Signed-off-by: Vladimir Panteleev Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220920092721.7686-1-git@vladimir.panteleev.md Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8ed2dc48551354bbf33df869f3968b7805cbaa61 Author: Alice Guo Date: Thu Aug 25 16:32:56 2022 +0800 watchdog: imx93: add watchdog timer on imx93 The WDOG clocks are sourced from lpo_clk, and lpo_clk is the fixed 32KHz. TOVAL contains the 16-bit value used to set the timeout period of the watchdog. When the timeout period exceeds 2 seconds, the value written to the TOVAL register is larger than 16-bit can represent. Enabling watchdog prescaler can solve this problem. Two points need to be aware of: 1. watchdog prescaler enables a fixed 256 pre-scaling of watchdog counter reference clock 2. reconfiguration takes about 55ms on imx93 Reviewed-by: Jacky Bai Signed-off-by: Alice Guo Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-8-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cef6bc98d50da24252fb289759f1790e17afa448 Author: Jason Liu Date: Thu Aug 25 16:32:55 2022 +0800 watchdog: imx7ulp_wdt: init wdog when it was active Paired with suspend, we can only init wdog again when it was active and ping it once to avoid the watchdog timeout after it resumed. Signed-off-by: Jason Liu Signed-off-by: Alice Guo Reviewed-by: Ye Li Reviewed-by: Jacky Bai Tested-by: Jacky Bai Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-7-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c32b53f965edcab53e16a2dea02d34e1c2c8173c Author: Ye Li Date: Thu Aug 25 16:32:54 2022 +0800 watchdog: imx7ulp_wdt: Handle wdog reconfigure failure Current driver may meet reconfigure failure caused by below reasons: 1. The wdog on iMX7ULP has different behavior after RCS valid. It needs to wait more than 2.5 wdog clock for clock sync before next reconfiguration, while imx8ulp wdog does not need such delay. 2. After unlock, there is 128 bus clock window opened for reconfiguration, but on iMX8ULP, the HW can't guarantee the latency. So it is possible the window is closed before the writing arrives to wdog. 3. If the PRES is enabled, the RCS valid time becomes x256 to the time of PRES disabled. It is about 1715ms on iMX8ULP. So We have to increase the RCS timeout and can't wait it in IRQ disabled. The patch updates the driver to handle failures 1. Using different wait for unlock and RCS. Unlock valid time is very short and only related to bus clock. It must be in IRQ disabled to avoid being interrupted in 128 clock window. But for RCS time, it is longer and ok for IRQ enabled. 2. Add retry for any reconfigure failure with default 5 times. 3. Add "fsl,imx8ulp-wdt" compatile string for iMX8ULP and afterwards platform which don't need more 2.5 wdog clock after RCS valid. For imx7ulp, add post delay of 2.5 clock after RCS valid. Signed-off-by: Ye Li Signed-off-by: Alice Guo Reviewed-by: Jacky Bai Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-6-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 52c4d05113264aa406d8d33751f09178e2476177 Author: Ye Li Date: Thu Aug 25 16:32:53 2022 +0800 watchdog: imx7ulp_wdt: Fix RCS timeout issue According to measure on i.MX7ULP and i.MX8ULP, the RCS done needs about 3400us and 6700us respectively. So current 20us timeout is not enough. When reconfiguring is on-going, unlock and configure CS will lead to unknown result. Increase the wait timeout value to 10ms and check the return value of RCS wait to fix the issue Signed-off-by: Ye Li Signed-off-by: Alice Guo Reviewed-by: Jacky Bai Acked-by: Jason Liu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-5-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e809daec17572216d91b6c41a8e04f9bb24d00a5 Author: Ye Li Date: Thu Aug 25 16:32:52 2022 +0800 watchdog: imx7ulp_wdt: Check CMD32EN in wdog init When bootloader has enabled the CMD32EN bit, switch to use 32bits unlock command to unlock the CS register. Using 32bits command will help on avoiding 16 bus cycle window violation for two 16 bits commands. Signed-off-by: Ye Li Signed-off-by: Alice Guo Reviewed-by: Jacky Bai Acked-by: Jason Liu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-4-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6371593fbad75cfb9ee14e8b462a5ebb1aa38c02 Author: Jacky Bai Date: Thu Aug 25 16:32:51 2022 +0800 watchdog: imx7ulp: Add explict memory barrier for unlock sequence When reconfiguring the WDOG Timer of i.MX7ULP, there is a certain probability causes it to reset. The reason is that the CMD32EN of the WDOG Timer of i.MX7ULP is disabled in bootloader. The unlock sequence are two 16-bit writes to the CNT register within 16 bus clocks. Adding mb() is to guarantee that two 16-bit writes are finished within 16 bus clocks. Memory barriers cannot be added between these two 16-bit writes so that writel_relaxed is used. Suggested-by: Ye Li Signed-off-by: Jacky Bai Signed-off-by: Alice Guo Reviewed-by: Ye Li Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-3-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f182683333b5d8ac4af64517b6e3c444c4579e6e Author: Anson Huang Date: Thu Aug 25 16:32:50 2022 +0800 watchdog: imx7ulp: Move suspend/resume to noirq phase The i.MX7ULP's watchdog is enabled by default when out of reset, so the resume callback which is to disable watchdog should be called earlier to avoid unexpected timeout, move suspend/resume callback to noirq phase. Signed-off-by: Anson Huang Signed-off-by: Alice Guo Reviewed-by: Jacky Bai Tested-by: Peter Chen Tested-by: Li Jun Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220825083256.14565-2-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a1f136fd8725243a69681e4e20e29f7b2043ad93 Author: ye xingchen Date: Tue Aug 2 07:46:43 2022 +0000 watchdog: rti-wdt:using the pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync and pm_runtime_put_noidle. Reported-by: Zeal Robot Signed-off-by: ye xingchen Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220802074643.1648660-1-ye.xingchen@zte.com.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5946401e25b36f755f401447e3ffb6d0e6a3769a Author: Johan Jonker Date: Sat Sep 10 00:01:56 2022 +0200 dt-bindings: watchdog: rockchip: add rockchip,rk3128-wdt Add rockchip,rk3128-wdt compatible string. Signed-off-by: Johan Jonker Reviewed-by: Guenter Roeck Acked-by: Rob Herring Link: https://lore.kernel.org/r/a4da79fe-3449-6538-742f-790835ffe43a@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 0c91aa185a63324183c67eff2d3bb2af605f05a7 Author: Chanho Park Date: Fri May 20 21:17:48 2022 +0900 watchdog: s3c2410_wdt: support exynosautov9 watchdog Like exynos850, exynosautov9 SoC also has two cpu watchdogs. Unfortunately, some configurations are slightly different so we need to add samsung,exynosautov9-wdt and separate drv data for those watchdogs. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220520121750.71473-3-chanho61.park@samsung.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit eadf8c4c737f6e88e1b1e86f2f52ea5acf28bb04 Author: Chanho Park Date: Fri May 20 21:17:47 2022 +0900 dt-bindings: watchdog: add exynosautov9 compatible Adds "samsung,exynosautov9-wdt" to samsung-wdt compatible. This has two cpu watchdogs like exynos850. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220520121750.71473-2-chanho61.park@samsung.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit af084fdccfafa79ad30a6a42c8eced79b71fb0e7 Author: Jonathan Neuschäfer Date: Fri Jun 10 09:21:37 2022 +0200 watchdog: npcm: Enable clock if provided On the Nuvoton WPCM450 SoC, with its upcoming clock driver, peripheral clocks are individually gated and ungated. Therefore, the watchdog driver must be able to ungate the watchdog clock. Signed-off-by: Jonathan Neuschäfer Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220610072141.347795-3-j.neuschaefer@gmx.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6adbfbab0f039bb89edb9d3ad0d9ac8a18efa6db Author: Philippe Boos Date: Mon Aug 1 11:21:50 2022 +0200 watchdog: meson: keep running if already active If the watchdog is already running (e.g.: started by bootloader) then the kernel driver should keep the watchdog active but the amlogic driver turns it off. Let the driver fix the clock rate if already active because we do not know the previous timebase value. To avoid unintentional resetting we temporarily set it to its maximum value. Then keep the enable bit if is was previously active. Signed-off-by: Philippe Boos Reviewed-by: Jerome Brunet Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220801092150.4449-1-pboos@baylibre.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b24620608dc2b54cb9df511e3d2c789f99497538 Author: Sergiu Moga Date: Thu Jul 14 15:51:24 2022 +0300 watchdog: dt-bindings: atmel,at91sam9-wdt: convert to json-schema Convert at91sam9 WDT binding for Atmel/Microchip SoCs to json-schema format. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220714125122.144377-1-sergiu.moga@microchip.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8007935305610d577746b888bd1864b34fb0ea13 Author: Pali Rohár Date: Tue Jul 26 10:56:12 2022 +0200 watchdog: armada_37xx_wdt: Fix .set_timeout callback ioctl(WDIOC_SETTIMEOUT) calls .set_timeout and .ping callbacks and it is expected that it changes current watchdog timeout. armada_37xx_wdt's .ping callback just reping counter 0 and does not touch counter 1 used for timeout. So it is needed to set counter 1 to the new value in .set_timeout callback to ensure ioctl(WDIOC_SETTIMEOUT) functionality. Fix it. Fixes: 54e3d9b518c8 ("watchdog: Add support for Armada 37xx CPU watchdog") Signed-off-by: Pali Rohár Reviewed-by: Guenter Roeck Reviewed-by: Marek Behún Link: https://lore.kernel.org/r/20220726085612.10672-1-pali@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 74b31987e281e31d7bd4184c027d57543e9e0392 Author: sunliming Date: Fri Aug 26 16:52:43 2022 +0800 watchdog: sa1100: make variable sa1100dog_driver static This symbol is not used outside of sa1100_wdt.c, so marks it static. Fixes the following warning: >> drivers/watchdog/sa1100_wdt.c:241:24: sparse: sparse: symbol 'sa1100dog_driver' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: sunliming Acked-by: Arnd Bergmann Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220802020819.1226454-1-sunliming@kylinos.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b26b96085d521466bd8ddf624c0853842215d0f0 Author: Jason Wang Date: Wed Aug 3 04:11:09 2022 +0800 watchdog: w83977f_wdt: Fix comment typo The double `we' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220802201109.6843-1-wangborong@cdjrlc.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 08a884cf03048142629e6dd748c7633e11d98b9b Author: shaomin Deng Date: Mon Aug 8 11:39:56 2022 -0400 watchdog: eurotechwdt: Remove redundant word in comments There is a rebundant word "we" in comments, so remove it. Signed-off-by: shaomin Deng Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220808153956.8374-1-dengshaomin@cdjrlc.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 0e01297212244b5a769aa956854e45da1f0cd1f4 Author: Bo Liu Date: Mon Sep 19 22:03:12 2022 -0400 watchdog: Check dev_set_name() return value It's possible that dev_set_name() returns -ENOMEM, catch and handle this. Signed-off-by: Bo Liu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220920020312.2383-1-liubo03@inspur.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ec122fd94eeb87b2e906360efe7447362f83e9ae Author: Phil Edworthy Date: Tue Aug 23 10:32:33 2022 +0100 watchdog: rzg2l_wdt: Add rzv2m support The WDT on RZ/V2M devices is basically the same as RZ/G2L, but without the parity error registers. This means the driver has to reset the hardware plus set the minimum timeout in order to do a restart and has a single interrupt. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220823093233.8577-3-phil.edworthy@renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit d59913b0a5b6b8c52c8fbceca910d4aedbbd4cf1 Author: Phil Edworthy Date: Tue Aug 23 10:32:32 2022 +0100 dt-bindings: watchdog: renesas,wdt: Add r9a09g011 (RZ/V2M) support Add the documentation for the r9a09g011 SoC, but in doing so also reorganise the doc to make it easier to read. Additionally, make the binding require an interrupt to be specified. Whilst the driver does not need an interrupt, all of the SoCs that use this binding actually provide one. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220823093233.8577-2-phil.edworthy@renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 695bfff55327caf6e9b098ada32b39b1d81dafc4 Author: Dan Carpenter Date: Thu Aug 11 13:56:06 2022 +0300 watchdog: ftwdt010_wdt: fix test for platform_get_irq() failure This code assumes that platform_get_irq() function returns zero on failure. In fact, platform_get_irq() never returns zero. It returns negative error codes or positive non-zero values on success. Fixes: eca10ae6000d ("watchdog: add driver for Cortina Gemini watchdog") Signed-off-by: Dan Carpenter Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/YvTgRk/ABp62/hNA@kili Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 22b455eecca0a3b73673898099d55db516eddbe1 Author: Thanh Quan Date: Fri Sep 9 11:08:11 2022 +0200 dt-bindings: watchdog: renesas-wdt: Add r8a779g0 support Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Thanh Quan Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/e3a246be066d5e9c2231285bc1488fc12866cf5d.1662714387.git.geert+renesas@glider.be Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 81126222bd3ad30eed486aafa66b52b5fc88b236 Author: David Müller Date: Wed Sep 14 11:46:05 2022 +0200 watchdog: Exar/MaxLinear XR28V38x driver Simple driver for the watchdog present in some Exar/MaxLinear UART chips. Please see https://www.maxlinear.com/product/interface/uarts/lpc-uarts/xr28v384 for more info. Signed-off-by: David Müller Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220914094605.93377-1-d.mueller@elsoft.ch Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 64ee9375090e3c677b6e4e089d41362ac16e4357 Author: Sergei Antonov Date: Mon Aug 29 12:04:36 2022 +0300 watchdog: ftwdt010_wdt: implement _restart() function Implement ftwdt010_wdt_restart(). It enables watchdog with timeout = 0 and disabled IRQ. Since it needs code similar to ftwdt010_wdt_start(), add a new function ftwdt010_enable() and move common code there. Suggested-by: Guenter Roeck Signed-off-by: Sergei Antonov Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220829090436.452742-1-saproj@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5a9fbf8b807c0e35fc99bb65a9559ec9b0abde66 Author: Henning Schild Date: Wed Aug 24 17:24:48 2022 +0200 watchdog: w83627hf_wdt: add bootstatus support The status bit in the status and control register can tell us whether the last reboot was caused by the watchdog. Make sure to take that into the bootstatus before clearing it. Signed-off-by: Henning Schild Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220824152448.7736-1-henning.schild@siemens.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit dc1f12b916005e1a1a908fbfcded356634a07038 Author: Srinivas Neeli Date: Thu Aug 18 20:36:37 2022 +0530 dt-bindings: watchdog: Convert Xilinx watchdog bindings to json-schema Convert Xilinx watchdog bindings to DT schema format using json-schema Signed-off-by: Shubhrajyoti Datta Signed-off-by: Radhey Shyam Pandey Signed-off-by: Srinivas Neeli Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220818150637.815-1-srinivas.neeli@xilinx.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 19f04459f019743310d17e8d426ff5d1a4b81041 Author: Chin-Ting Kuo Date: Fri Aug 19 17:49:05 2022 +0800 watchdog: aspeed_wdt: Reorder output signal register configuration If the output driving type is push-pull mode, the output polarity should be selected in advance. Otherwise, an unexpected value will be output at the moment of changing to push-pull mode. Thus, output polarity, WDT18[31], must be configured before changing driving type, WDT18[30]. Signed-off-by: Chin-Ting Kuo Reviewed-by: Guenter Roeck Tested-by: Bonnie Lo Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220819094905.1962513-1-chin-ting_kuo@aspeedtech.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 891862d5ba11da739ac796221ff64e4ccf5a275f Author: Jerry Hoemann Date: Sat Aug 20 14:28:21 2022 -0600 watchdog/hpwdt: Enable HP_WATCHDOG for ARM64 systems. Enable HP_WATCHDOG for ARM64 systems. HPWDT_NMI_DECODING requires X86 as NMI handlers are X86 specific. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220820202821.1263837-3-jerry.hoemann@hpe.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ed835d8171fc884c7750cdd54128df16d4571e3a Author: Jerry Hoemann Date: Sat Aug 20 14:28:20 2022 -0600 watchdog/hpwdt: Include nmi.h only if CONFIG_HPWDT_NMI_DECODING Fixes: d48b0e173715 ("x86, nmi, drivers: Fix nmi splitup build bug") Arm64 does not support NMI and has no . Include only if CONFIG_HPWDT_NMI_DECODING is defined to avoid build failure on non-existent header file on Arm64. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220820202821.1263837-2-jerry.hoemann@hpe.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 926e099267950f3b4442eb48dffc5cc3a870ad34 Author: Jean Delvare Date: Tue Aug 23 15:47:13 2022 +0200 watchdog: wdat_wdt: Set the min and max timeout values properly The wdat_wdt driver is misusing the min_hw_heartbeat_ms field. This field should only be used when the hardware watchdog device should not be pinged more frequently than a specific period. The ACPI WDAT "Minimum Count" field, on the other hand, specifies the minimum timeout value that can be set. This corresponds to the min_timeout field in Linux's watchdog infrastructure. Setting min_hw_heartbeat_ms instead can cause pings to the hardware to be delayed when there is no reason for that, eventually leading to unexpected firing of the watchdog timer (and thus unexpected reboot). Since commit 6d72c7ac9fbe ("watchdog: wdat_wdt: Using the existing function to check parameter timeout"), min_timeout is being set too, but to the arbitrary value of 1 second, which doesn't make sense and allows setting timeout values lower that the ACPI WDAT "Minimum Count" field. I'm also changing max_hw_heartbeat_ms to max_timeout for symmetry, although the use of this one isn't fundamentally wrong, but there is also no reason to enable the software-driven ping mechanism for the wdat_wdt driver. Signed-off-by: Jean Delvare Fixes: 058dfc767008 ("ACPI / watchdog: Add support for WDAT hardware watchdog") Fixes: 6d72c7ac9fbe ("watchdog: wdat_wdt: Using the existing function to check parameter timeout") Reviewed-by: Mika Westerberg Reviewed-by: Guenter Roeck Cc: Wim Van Sebroeck Cc: Rafael J. Wysocki Cc: Liu Xinpeng Link: https://lore.kernel.org/r/20220823154713.023ee771@endymion.delvare Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4f719022a753bb15720c9ddeb0387a93caa372ce Author: Dmitry Torokhov Date: Sun Sep 4 23:31:02 2022 -0700 watchdog: bd9576_wdt: switch to using devm_fwnode_gpiod_get() I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. While at it, switch the rest of the calls to read properties in bd9576_wdt_probe() to the generic device property API as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Guenter Roeck Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-10-b29adfb27a6c@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 434e5f93ed16f01936bfc492798cf610be60fbe9 Author: Nobuhiro Iwamatsu Date: Wed May 25 09:46:05 2022 +0900 dt-bindings: watchdog: toshiba,visconti-wdt: Update the common clock properties The clock for this driver switched to the common clock controller driver. Therefore, update common clock properties for watchdog in the binding document. And this matched this example with the actual dts. Signed-off-by: Nobuhiro Iwamatsu Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220525004605.2128727-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit aa221f2ea58655f5360e7b0c6fe5482f7c41855e Author: Masahiro Yamada Date: Mon Sep 26 18:02:28 2022 +0900 kallsyms: take the input file instead of reading stdin This gets rid of the pipe operator connected with 'cat'. Also use getopt_long() to parse the command line. Signed-off-by: Masahiro Yamada commit a2833d1b07ab107db71a18e6f3855f6908886361 Author: Masahiro Yamada Date: Mon Sep 26 18:02:27 2022 +0900 kallsyms: drop duplicated ignore patterns from kallsyms.c Now that kallsyms.c parses the output from mksysmap, some symbols have already been dropped. Move comments to scripts/mksysmap. Also, make the grep command readable. Signed-off-by: Masahiro Yamada commit 94ff2f63d6a31501ceb36ebc600240937cfff35f Author: Masahiro Yamada Date: Mon Sep 26 18:02:26 2022 +0900 kbuild: reuse mksysmap output for kallsyms scripts/mksysmap internally runs ${NM} (dropping some symbols). When CONFIG_KALLSYMS=y, mksysmap creates .tmp_System.map, but it is almost the same as the output from the ${NM} invocation in kallsyms(). It is true scripts/mksysmap drops some symbols, but scripts/kallsyms.c ignores more anyway. Keep the mksysmap output as *.syms, and reuse it for kallsyms and 'cmp -s'. It saves one ${NM} invocation. Signed-off-by: Masahiro Yamada commit c13461693ea21d787f82232ce3a5667da370d973 Author: Masahiro Yamada Date: Mon Sep 26 18:02:25 2022 +0900 mksysmap: update comment about __crc_* Since commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS"), __crc_* symbols never become absolute. Keep ignoring __crc_*, but update the comment. Signed-off-by: Masahiro Yamada commit ce697ccee1a8661da4e23fbe5f3d45d8d6922c20 Author: Masahiro Yamada Date: Sun Sep 25 03:19:15 2022 +0900 kbuild: remove head-y syntax Kbuild puts the objects listed in head-y at the head of vmlinux. Conventionally, we do this for head*.S, which contains the kernel entry point. A counter approach is to control the section order by the linker script. Actually, the code marked as __HEAD goes into the ".head.text" section, which is placed before the normal ".text" section. I do not know if both of them are needed. From the build system perspective, head-y is not mandatory. If you can achieve the proper code placement by the linker script only, it would be cleaner. I collected the current head-y objects into head-object-list.txt. It is a whitelist. My hope is it will be reduced in the long run. Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 3216484550610470013b7ce1c9ed272da0a74589 Author: Masahiro Yamada Date: Sun Sep 25 03:19:14 2022 +0900 kbuild: use obj-y instead extra-y for objects placed at the head The objects placed at the head of vmlinux need special treatments: - arch/$(SRCARCH)/Makefile adds them to head-y in order to place them before other archives in the linker command line. - arch/$(SRCARCH)/kernel/Makefile adds them to extra-y instead of obj-y to avoid them going into built-in.a. This commit gets rid of the latter. Create vmlinux.a to collect all the objects that are unconditionally linked to vmlinux. The objects listed in head-y are moved to the head of vmlinux.a by using 'ar m'. With this, arch/$(SRCARCH)/kernel/Makefile can consistently use obj-y for builtin objects. There is no *.o that is directly linked to vmlinux. Drop unneeded code in scripts/clang-tools/gen_compile_commands.py. $(AR) mPi needs 'T' to workaround the llvm-ar bug. The fix was suggested by Nathan Chancellor [1]. [1]: https://lore.kernel.org/llvm/YyjjT5gQ2hGMH0ni@dev-arch.thelio-3990X/ Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit b60ca69715fcc39a5f4bdd56ca2ea691b7358455 Author: Jisheng Zhang Date: Sun Oct 2 10:19:31 2022 +0530 riscv: select HAVE_POSIX_CPU_TIMERS_TASK_WORK Move POSIX CPU timer expiry and signal delivery into task context to allow PREEMPT_RT setups to coexist with KVM. Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 9c00fbdd93a22a6657378292f2eb29e9754cde7f Author: Jisheng Zhang Date: Sun Oct 2 10:19:25 2022 +0530 RISC-V: KVM: Use generic guest entry infrastructure Use generic guest entry infrastructure to properly handle TIF_NOTIFY_RESUME. Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 54ce3f7ff3395f12ad142d46b628606ab1e926ef Author: Jisheng Zhang Date: Sun Oct 2 10:19:16 2022 +0530 RISC-V: KVM: Record number of signal exits as a vCPU stat Record a statistic indicating the number of times a vCPU has exited due to a pending signal. Signed-off-by: Jisheng Zhang Reviewed-by: Guo Ren Reviewed-by: Andrew Jones Signed-off-by: Anup Patel Date: Sun Oct 2 10:19:11 2022 +0530 RISC-V: KVM: add __init annotation to riscv_kvm_init() The riscv_kvm_init() is a module_init entry so let us add __init annotation to it. Signed-off-by: Xiu Jianfeng Signed-off-by: Anup Patel commit 56852c6211971798dfbe4098c8a8528b59234de2 Author: Andrew Jones Date: Sun Oct 2 10:19:05 2022 +0530 RISC-V: KVM: Expose Zicbom to the guest Guests may use the cbo.inval,clean,flush instructions when the CPU has the Zicbom extension and the hypervisor sets henvcfg.CBIE (for cbo.inval) and henvcfg.CBCFE (for cbo.clean,flush). Add Zicbom support for KVM guests which may be enabled and disabled from KVM userspace using the ISA extension ONE_REG API. Also opportunistically switch the other isa extension checks in kvm_riscv_vcpu_update_config() to riscv_isa_extension_available(). Signed-off-by: Andrew Jones Reviewed-by: Conor Dooley Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit afd5dde9a186b8fc5742fff707f184760c4af1a9 Author: Andrew Jones Date: Sun Oct 2 10:18:59 2022 +0530 RISC-V: KVM: Provide UAPI for Zicbom block size We're about to allow guests to use the Zicbom extension. KVM userspace needs to know the cache block size in order to properly advertise it to the guest. Provide a virtual config register for userspace to get it with the GET_ONE_REG API, but setting it cannot be supported, so disallow SET_ONE_REG. Signed-off-by: Andrew Jones Reviewed-by: Conor Dooley Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 1b5cbb8733f924c99bc48a8e4c2a95449f0f514d Author: Andrew Jones Date: Sun Oct 2 10:18:54 2022 +0530 RISC-V: KVM: Make ISA ext mappings explicit While adding new extensions at the bottom of the array isn't hard to do, it's a pain to review in order to ensure we're not missing any. Also, resolving merge conflicts for multiple new ISA extensions can be error-prone. To make adding new mappings foolproof, explicitly assign the array elements. And, now that the order doesn't matter, we can alphabetize the extensions, so we do that too. Signed-off-by: Andrew Jones Signed-off-by: Anup Patel commit 0bba48978f6b63aee0fa4ee3a8097ec94e75f7f2 Author: Mayuresh Chitale Date: Sun Oct 2 10:18:48 2022 +0530 RISC-V: KVM: Allow Guest use Zihintpause extension We should advertise Zihintpause ISA extension to KVM user-space whenever host supports it. This will allow KVM user-space (i.e. QEMU or KVMTOOL) to pass on this information to Guest via ISA string. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit bad6ea07c876a67c4d8f46b0c565ab500150720f Author: Anup Patel Date: Sun Oct 2 10:18:42 2022 +0530 RISC-V: KVM: Allow Guest use Svinval extension We should advertise Svinval ISA extension to KVM user-space whenever host supports it. This will allow KVM user-space (i.e. QEMU or KVMTOOL) to pass on this information to Guest via ISA string. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 5ff112484f2e63c5cac9f865181ca7ce467d0f89 Author: Anup Patel Date: Sun Oct 2 10:18:37 2022 +0530 RISC-V: KVM: Use Svinval for local TLB maintenance when available We should prefer HINVAL.GVMA and HINVAL.VVMA instruction for local TLB maintenance when underlying host supports Svinval extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 122979aa26cd4a314aae889a0496eb829d50bc9e Author: Mayuresh Chitale Date: Sun Oct 2 10:18:31 2022 +0530 RISC-V: Probe Svinval extension form ISA string Just like other ISA extensions, we allow callers/users to detect the presence of Svinval extension from ISA string. Signed-off-by: Mayuresh Chitale Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit d837f19195e77f7c89b6645c8311f5ea6ff67905 Author: Anup Patel Date: Sun Oct 2 10:18:25 2022 +0530 RISC-V: KVM: Change the SBI specification version to v1.0 The SBI v1.0 specificaiton is functionally same as SBI v0.3 specification except that SBI v1.0 specification went through the full RISC-V International ratification process. Let us change the SBI specification version to v1.0. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 26b73f14933e9c0beb88bb2fcee69d93572558ef Author: Andrew Jones Date: Sun Oct 2 10:18:20 2022 +0530 riscv: KVM: Apply insn-def to hlv encodings Introduce hlv instruction encodings and apply them to KVM's use. We're careful not to introduce hlv.d to 32-bit builds. Indeed, we ensure the build fails if someone tries to use it. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit bb233a11dc6b3774fd46087242d7627ecf5293ed Author: Andrew Jones Date: Sun Oct 2 10:18:14 2022 +0530 riscv: KVM: Apply insn-def to hfence encodings Introduce hfence instruction encodings and apply them to KVM's use. With the self-documenting nature of the instruction encoding macros, and a spec always within arm's reach, it's safe to remove the comments, so we do that too. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 5ac43ab2e3fe4e5d48ef313a99d0591021c3bbdd Author: Andrew Jones Date: Sun Oct 2 10:18:07 2022 +0530 riscv: Introduce support for defining instructions When compiling with toolchains that haven't yet been taught about new instructions we need to encode them ourselves. Create a new file where support for instruction definitions will evolve. We initiate the file with a macro called INSN_R(), which implements the R-type instruction encoding. INSN_R() will use the assembler's .insn directive when available, which should give the assembler a chance to do some validation. When .insn is not available we fall back to manual encoding. Not only should using instruction encoding macros improve readability and maintainability of code over the alternative of inserting instructions directly (e.g. '.word 0xc0de'), but we should also gain potential for more optimized code after compilation because the compiler will have control over the input and output registers used. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 7fc4426959e17178654404e6bde4b920b5fee7c7 Author: Andrew Jones Date: Sun Oct 2 10:17:58 2022 +0530 riscv: Add X register names to gpr-nums When encoding instructions it's sometimes necessary to set a register field to a precise number. This is easiest to do using the x naming. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 305a72efa791c826fe84768ca55e31adc4113ea8 Merge: 53fc59511fc4c 6a02124c87f0b Author: Dan Williams Date: Sat Oct 1 19:16:16 2022 -0700 Merge branch 'for-6.1/nvdimm' into libnvdimm-for-next Add v6.1 content on top of some straggling updates that missed v6.0. commit 228336f50711e9f0f47352483a8501e0c598845b Author: Wolfram Sang Date: Wed Sep 28 22:12:14 2022 +0200 i2c: pci1xxxx: prevent signed integer overflow Some constants need 'UL' markings, otherwise they are shifted into the sign bit. Fixes: 361693697249 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch") Signed-off-by: Wolfram Sang commit 492baeb958b1a94b8d52ec3960f82079ebbbebfb Author: Gustavo A. R. Silva Date: Mon Sep 26 16:47:25 2022 -0500 i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/218 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Wolfram Sang commit 342530f7fe1ada578452c4daa2c9b5902cedf480 Author: Mani Milani Date: Fri Aug 26 17:44:30 2022 +1000 i2c: i801: Prefer async probe This i801 driver probe can take more than ~190ms in some devices, since the "i2c_register_spd()" call was added inside "i801_probe_optional_slaves()". Prefer async probe so that other drivers can be probed and boot can continue in parallel while this driver loads, to reduce boot time. There is no reason to block other drivers from probing while this driver is loading. Signed-off-by: Mani Milani Tested-by: Jarkko Nikula Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit fe682780d5cdf7b3932c6a1c669db8fc344f7e17 Author: Andy Shevchenko Date: Thu Sep 29 12:42:15 2022 +0300 i2c: designware-pci: Use standard pattern for memory allocation The pattern foo = kmalloc(sizeof(*foo), GFP_KERNEL); has an advantage when foo type is changed. Since we are planning a such, better to be prepared by using standard pattern for memory allocation. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 65769162ae4b7f2d82e54998be446226b05fcd8f Author: Andy Shevchenko Date: Thu Sep 29 12:42:14 2022 +0300 i2c: designware-pci: Group AMD NAVI quirk parts together The code is ogranized in a way that all related parts to the certain platform quirk go together. This is not the case for AMD NAVI. Shuffle code to make it happen. While at it, drop the frequency definition and use hard coded value as it's done for other platforms and add a comment to the PCI ID list. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit d687772e6d2cbffd91fdda64812f79192c1e7ca0 Author: William Zijl Date: Sat Oct 1 17:36:21 2022 +0200 random: fix typos in get_random_bytes() comment Remove extra whitespace and add a missing word to a sentence describing get_random_bytes(). Signed-off-by: William Zijl Signed-off-by: Jason A. Donenfeld commit bc37b24ee05e3fc4eae3e51c25572ccda9c34c11 Merge: 5fcc2cfc14ae0 3db4c85cde7a5 Author: Jakub Kicinski Date: Sat Oct 1 13:30:25 2022 -0700 Merge branch 'mlx5-xsk-updates-part3-2022-09-30' Saeed Mahameed says: ==================== mlx5 xsk updates part3 2022-09-30 The gist of this 4 part series is in this patchset's last patch This series contains performance optimizations. XSK starts using the batching allocator, and XSK data path gets separated from the regular RX, allowing to drop some branches not relevant for non-XSK use cases. Some minor optimizations for indirect calls and need_wakeup are also included. Other than that, this series adds a few features to the mlx5e implementation of XSK: 1. XDP metadata support on XSK RQs. 2. RSS contexts support for XSK RQs. 3. Some other optimizations 4. Last but not least, change the queuing scheme, so that XSK RQs no longer use higher indices, but replace the regular RQs. Maxim Says: ========== In the initial implementation of XSK in mlx5e, XSK RQs coexisted with regular RQs in the same channel. The main idea was to allow RSS work the same for regular traffic, without need to reconfigure RSS to exclude XSK queues. However, this scheme didn't prove to be beneficial, mainly because of incompatibility with other vendors. Some tools don't properly support using higher indices for XSK queues, some tools get confused with the double amount of RQs exposed in sysfs. Some use cases are purely XSK, and allocating the same amount of unused regular RQs is a waste of resources. This commit changes the queuing scheme to the standard one, where XSK RQs replace regular RQs on the channels where XSK sockets are open. Two RQs still exist in the channel to allow failsafe disable of XSK, but only one is exposed at a time. The next commit will achieve the desired memory save by flushing the buffers when the regular RQ is unused. As the result of this transition: 1. It's possible to use RSS contexts over XSK RQs. 2. It's possible to dedicate all queues to XSK. 3. When XSK RQs coexist with regular RQs, the admin should make sure no unwanted traffic goes into XSK RQs by either excluding them from RSS or settings up the XDP program to return XDP_PASS for non-XSK traffic. 4. When using a mixed fleet of mlx5e devices and other netdevs, the same configuration can be applied. If the application supports the fallback to copy mode on unsupported drivers, it will work too. ========== Part 4 will include some final xsk optimizations and minor improvements part 1: https://lore.kernel.org/netdev/20220927203611.244301-1-saeed@kernel.org/ part 2: https://lore.kernel.org/netdev/20220929072156.93299-1-saeed@kernel.org/ ==================== Link: https://lore.kernel.org/r/20220930162903.62262-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 3db4c85cde7a514a5277070b32e776dbefcaa838 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:29:03 2022 -0700 net/mlx5e: xsk: Use queue indices starting from 0 for XSK queues In the initial implementation of XSK in mlx5e, XSK RQs coexisted with regular RQs in the same channel. The main idea was to allow RSS work the same for regular traffic, without need to reconfigure RSS to exclude XSK queues. However, this scheme didn't prove to be beneficial, mainly because of incompatibility with other vendors. Some tools don't properly support using higher indices for XSK queues, some tools get confused with the double amount of RQs exposed in sysfs. Some use cases are purely XSK, and allocating the same amount of unused regular RQs is a waste of resources. This commit changes the queuing scheme to the standard one, where XSK RQs replace regular RQs on the channels where XSK sockets are open. Two RQs still exist in the channel to allow failsafe disable of XSK, but only one is exposed at a time. The next commit will achieve the desired memory save by flushing the buffers when the regular RQ is unused. As the result of this transition: 1. It's possible to use RSS contexts over XSK RQs. 2. It's possible to dedicate all queues to XSK. 3. When XSK RQs coexist with regular RQs, the admin should make sure no unwanted traffic goes into XSK RQs by either excluding them from RSS or settings up the XDP program to return XDP_PASS for non-XSK traffic. 4. When using a mixed fleet of mlx5e devices and other netdevs, the same configuration can be applied. If the application supports the fallback to copy mode on unsupported drivers, it will work too. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit d9ba64deb2f1ad58eb3067c7485518f3e96559ee Author: Maxim Mikityanskiy Date: Fri Sep 30 09:29:02 2022 -0700 net/mlx5e: Introduce the mlx5e_flush_rq function Add a function to flush an RQ: clean up descriptors, release pages and reset the RQ. This procedure is used by the recovery flow, and it will also be used in a following commit to free some memory when switching a channel to the XSK mode. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit a752b2edb5c158f4ca3386387a3b3df1be856d03 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:29:01 2022 -0700 net/mlx5e: xsk: Support XDP metadata on XSK RQs Add support for XDP metadata on XSK RQs for cross-program communication. The driver no longer calls xdp_set_data_meta_invalid and copies the metadata to a newly allocated SKB on XDP_PASS. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit ddb7afeee28bc37b4815470d00f0c8db3fcabd2e Author: Maxim Mikityanskiy Date: Fri Sep 30 09:29:00 2022 -0700 net/mlx5e: Optimize RQ page deallocation mlx5e_free_rx_mpwqe loops over all pages of a MPWQE, calling mlx5e_page_release for ones that are not scheduled for XDP_TX or XDP_REDIRECT; and mlx5e_page_release checks whether it's an XSK RQ or a regular one for each page/XSK frame. This check can be moved outside the loop to reduce the number of branches. mlx5e_free_rx_wqe loops over all fragments, calling mlx5e_page_release for the ones that are last in a page; and mlx5e_page_release checks whether it's an XSK RQ or a regular one for each fragment. Using the fact that XSK doesn't support multiple fragments, it can be optimized for both XSK and regular usages: 1. Make an early check for XSK and call its deallocator directly, saving 3 branches (loop condition, frag->last_in_page and selection of deallocator). 2. Call the regular deallocator directly in the non-XSK case, saving a branch per fragment, except the first one. After the changes, mlx5e_page_release is removed, as there are no callers left. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 96d37d861a09ba4b6ea08b87fa1c173c1af522b1 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:59 2022 -0700 net/mlx5e: Call mlx5e_page_release_dynamic directly where possible mlx5e_page_release calls the appropriate deallocator depending on whether it's an XSK RQ or a regular one. Some flows that call this function are not compatible with XSK, so they can call the non-XSK deallocator directly to save a branch. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 132857d9124c853c105acf96b557ce866c044970 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:58 2022 -0700 net/mlx5e: Use non-XSK page allocator in SHAMPO The SHAMPO flow is not compatible with XSK, it can call the page pool allocator directly to save a branch. mlx5e_page_alloc is removed, as it's no longer used in any flow. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit cf544517c4690fd886aa5e664188abe92a377cbf Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:57 2022 -0700 net/mlx5e: xsk: Use xsk_buff_alloc_batch on striding RQ XSK provides a function to allocate frames in batches for more efficient processing. This commit starts using this function on striding RQ and creates an optimized flow for XSK. A side effect is an opportunity to optimize the regular RX flow by dropping branching for XSK cases. Performance improvement is up to 6.4% in the aligned mode and up to 7.5% in the unaligned mode. Aligned mode, 2048-byte frames: 12.9 Mpps -> 13.8 Mpps Aligned mode, 4096-byte frames: 11.8 Mpps -> 12.5 Mpps Unaligned mode, 2048-byte frames: 11.9 Mpps -> 12.8 Mpps Unaligned mode, 3072-byte frames: 11.4 Mpps -> 12.1 Mpps Unaligned mode, 4096-byte frames: 11.0 Mpps -> 11.2 Mpps CPU: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 259bbc64367a130b49c56e68744262ee909a2549 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:56 2022 -0700 net/mlx5e: xsk: Use xsk_buff_alloc_batch on legacy RQ XSK provides a function to allocate frames in batches for more efficient processing. This commit starts using this function on legacy RQ, adding a special case for XSK. The new branch introduced basically replaces the branch that was removed from the same place a few commits before. A check is made that DMA sync is not needed, because the batching allocator falls back to returning one frame when DMA sync is needed, and this is best handled by the loop in the standard case. Performance improvement is up to 8% in the aligned mode and up to 9% in the unaligned mode. Aligned mode, 2048-byte frames: 12.8 Mpps -> 13.5 Mpps Aligned mode, 4096-byte frames: 11.5 Mpps -> 12.4 Mpps Unaligned mode, 2048-byte frames: 12.2 Mpps -> 13.4 Mpps Unaligned mode, 3072-byte frames: 11.6 Mpps -> 12.5 Mpps Unaligned mode, 4096-byte frames: 11.2 Mpps -> 12.2 Mpps CPU: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit a2e5ba242c338208024cd814128c7fa9e22ae2b4 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:55 2022 -0700 net/mlx5e: xsk: Split out WQE allocation for legacy XSK RQ Allocation of XSK frames on legacy RQ may be made more efficient with a specialized routine that relies on certain assumptions, such as there is only one fragment, allocation units (XSK frames) are not shared among multiple packets. It reduces the number of branches both in the XSK code and in the regular RQ, because with this approach there is only a single check whether it's an XSK or regular RQ. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0b482232374528b62ef978241f8efc548dce7edb Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:54 2022 -0700 net/mlx5e: Remove the outer loop when allocating legacy RQ WQEs Legacy RQ WQEs are allocated in a loop in small batches (8 WQEs). As partial batches are allowed, there is no point to have a loop in a loop, so the outer loop is removed, and the batch size is increased up to the total number of WQEs to allocate, still not smaller than 8. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 3f5fe0b2e606ab71d3425c138e311bce60b09543 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:53 2022 -0700 net/mlx5e: xsk: Use partial batches in legacy RQ with XSK The previous commit allowed allocating WQE batches in legacy RQ partially, however, XSK still checks whether there are enough frames in the fill ring. Remove this check to allow to allocate batches partially also with XSK. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 42847fed55523bebb712bfd7e2c4616db00c3aef Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:52 2022 -0700 net/mlx5e: Use partial batches in legacy RQ Legacy RQ allocates WQEs in batches. If the batch allocation fails, the pages of the allocated part are released. This commit changes this behavior to allow to use the pages that have been already allocated. After this change, we need to be careful about indexing rq->wqe.frags[]. The WQ size is a power of two that divides by wqe_bulk (8), and the old code used whole bulks, which allowed to use indices [8*K; 8*K+7] without overflowing. Now that the bulks may be partial, the range can start at any location (not only at 8*K), so we need to wrap them around to avoid out-of-bounds array access. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 5758c3145b88aa9d0919681a9d3edf39353f1dbd Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:51 2022 -0700 net/mlx5e: Make the wqe_index_mask calculation more exact The old calculation of wqe_index_mask may give false positives, i.e. request bulking of pairs of WQEs when not strictly needed, for example, when the first fragment size is equal to the PAGE_SIZE, bulking is not needed, even if the number of fragments is odd. Make the calculation more exact to cut false positives. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit a064c609849bf71adc7484b030539568cd2a5155 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:50 2022 -0700 net/mlx5e: Introduce wqe_index_mask for legacy RQ When fragments of different WQEs share the same page, mlx5e_post_rx_wqes must wait until the old WQE stops using the page, only then the new WQE can allocate the new page. Essentially, it means that if WQE index i is still in use, the allocation must stop before `i % bulk`, where bulk is the number of WQEs that may share the same page. As bulk is always a power of two, `i % bulk = i & (bulk - 1)`, and the new wqe_index_mask field will be equal to `bulk - 1`. At the same time, wqe_bulk remains for optimization purposes and stores `max(bulk, 8)`, which allows to skip the allocation until we have at least 8 WQEs free. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 8cbcafcee1910ece54990f9aebae78fcbdb93913 Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:49 2022 -0700 net/mlx5e: xsk: Drop the check for XSK state in mlx5e_xsk_wakeup The MLX5E_CHANNEL_STATE_XSK flag checked in mlx5e_xsk_wakeup indicates that XSK queues are open, but not necessarily activated. This check is not very useful, because: 0. Both XSK setup and netdev state transitions take the same state_lock mutex, so they can't happen at the same time. 1. If the netdev is up, xsk_is_bound can return true only when MLX5E_CHANNEL_STATE_XSK is set on the corresponding channel. mlx5e_xsk_wakeup is only called when xsk_is_bound is true. 2. If the XSK socket is bound, and the netdev is going up or down, mlx5e_xsk_wakeup can take one of two branches, depending on the return value of napi_if_scheduled_mark_missed: 2.1. True means one of two things: either NAPI was enabled at this point, which means MLX5E_CHANNEL_STATE_XSK was also set; or NAPI was disabled, and nothing really happened. 2.2. False means that NAPI was enabled by this point, which also implies MLX5E_CHANNEL_STATE_XSK was set. Additionally, mlx5e_xsk_wakeup contains a following check for MLX5E_SQ_STATE_ENABLED on async_icosq, and this flag implies MLX5E_CHANNEL_STATE_XSK too on XSK channels. As checking this flag doesn't cut any flows, remove the check. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit d54d7194ba48e074d4d51580753d3a396b82aecf Author: Maxim Mikityanskiy Date: Fri Sep 30 09:28:48 2022 -0700 net/mlx5e: xsk: Use mlx5e_trigger_napi_icosq for XSK wakeup mlx5e_xsk_wakeup triggers an IRQ by posting a NOP to async_icosq, taking a spinlock to protect from concurrent access. There is already a function that does the same: mlx5e_trigger_napi_icosq. Use this function in mlx5e_xsk_wakeup. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 5738d49fa47e0046050f5e62e4921d667b7ee3c3 Author: Yang Yingliang Date: Wed Sep 21 23:29:15 2022 +0800 power: supply: mt6370: Fix return value check in mt6370_chg_probe() If create_singlethread_workqueue() fails, it returns a null pointer, replace IS_ERR() check with NULL pointer check. Fixes: 233cb8a47d65 ("power: supply: mt6370: Add MediaTek MT6370 charger driver") Signed-off-by: Yang Yingliang Reviewed-by: ChiaEn Wu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Sebastian Reichel commit fe259a2155b43dff59be1e1e3c59ac72cfeab630 Author: Yuan Can Date: Tue Sep 27 13:37:58 2022 +0000 power: supply: ab8500: Remove unused struct ab8500_chargalg_sysfs_entry After commit 75ee3f6f0c1a("power: supply: ab8500_chargalg: Drop enable/disable sysfs"), no one use struct ab8500_chargalg_sysfs_entry, so remove it. Signed-off-by: Yuan Can Signed-off-by: Sebastian Reichel commit d8be4fe92433ad905eedc7d877099685eb2eaaa1 Author: Randy Dunlap Date: Wed Sep 28 23:29:40 2022 -0700 power: supply: mt6370: uses IIO interfaces, depends on IIO The mt6370-charger driver uses IIO interfaces and produces build errors when CONFIG_IIO is not set, so it should depend on IIO. ERROR: modpost: "iio_read_channel_processed" [drivers/power/supply/mt6370-charger.ko] undefined! ERROR: modpost: "devm_iio_channel_get_all" [drivers/power/supply/mt6370-charger.ko] undefined! Fixes: 233cb8a47d65 ("power: supply: mt6370: Add MediaTek MT6370 charger driver") Signed-off-by: Randy Dunlap Cc: ChiaEn Wu Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel commit 8bc800062221adb40eb24c4b4fd5c572a637114c Author: Colin Ian King Date: Wed Sep 28 22:19:26 2022 +0100 power: supply: max1721x: Fix spelling mistake "Gauage" -> "Gauge" There is a spelling mistake in the module description. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Sebastian Reichel commit 78e5a3399421ad79fc024e6d78e2deb7809d26af Author: Yury Norov Date: Mon Sep 19 14:05:53 2022 -0700 cpumask: fix checking valid cpu range The range of valid CPUs is [0, nr_cpu_ids). Some cpumask functions are passed with a shifted CPU index, and for them, the valid range is [-1, nr_cpu_ids-1). Currently for those functions, we check the index against [-1, nr_cpu_ids), which is wrong. Signed-off-by: Yury Norov commit 8173aa26260e6d0153db0c7135d41a4da612da5b Author: Yury Norov Date: Mon Sep 19 14:05:59 2022 -0700 lib/bitmap: add tests for for_each() loops We have a test for test_for_each_set_clump8 only. Add basic tests for the others. Signed-off-by: Yury Norov commit fdae96a3fc7f70eb8ff9619550d7fa604719626a Author: Yury Norov Date: Mon Sep 19 14:05:58 2022 -0700 lib/find: optimize for_each() macros Moving an iterator of the macros inside conditional part of for-loop helps to generate a better code. It had been first implemented in commit 7baac8b91f9871ba ("cpumask: make for_each_cpu_mask a bit smaller"). Now that cpumask for-loops are the aliases to bitmap loops, it's worth to optimize them the same way. Bloat-o-meter says: add/remove: 8/12 grow/shrink: 147/592 up/down: 4876/-24416 (-19540) Signed-off-by: Yury Norov commit 4fe49b3b97c2640147c46519c2a6fdb06df34f5f Author: Yury Norov Date: Mon Sep 19 14:05:57 2022 -0700 lib/bitmap: introduce for_each_set_bit_wrap() macro Add for_each_set_bit_wrap() macro and use it in for_each_cpu_wrap(). The new macro is based on __for_each_wrap() iterator, which is simpler and smaller than cpumask_next_wrap(). Signed-off-by: Yury Norov commit 6cc18331a987c4a29d66b9c4fd292587fba4d7bd Author: Yury Norov Date: Mon Sep 19 14:05:56 2022 -0700 lib/find_bit: add find_next{,_and}_bit_wrap The helper is better optimized for the worst case: in case of empty cpumask, current code traverses 2 * size: next = cpumask_next_and(prev, src1p, src2p); if (next >= nr_cpu_ids) next = cpumask_first_and(src1p, src2p); At bitmap level we can stop earlier after checking 'size + offset' bits. Signed-off-by: Yury Norov commit 33e67710beda78aed38a2fe10be6088d4aeb1c53 Author: Yury Norov Date: Mon Sep 19 14:05:55 2022 -0700 cpumask: switch for_each_cpu{,_not} to use for_each_bit() The difference between for_each_cpu() and for_each_set_bit() is that the latter uses cpumask_next() instead of find_next_bit(), and so calls cpumask_check(). This check is useless because the iterator value is not provided by user. It generates false-positives for the very last iteration of for_each_cpu(). Signed-off-by: Yury Norov commit 854701ba4c39afae2362ba19a580c461cb183e4f Author: Yury Norov Date: Mon Sep 19 14:05:54 2022 -0700 net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and} The functions require to be passed with a cpu index prior to one that is the first to start search, so the valid input range is [-1, nr_cpu_ids-1). However, the code checks against [-1, nr_cpu_ids). Acked-by: Jakub Kicinski Signed-off-by: Yury Norov commit 00988f70a0763f14c97c4c0df76fb9aa4959e953 Merge: 3180d827c807d eee48781ea199 Author: Greg Kroah-Hartman Date: Sat Oct 1 18:36:04 2022 +0200 Merge tag 'usb-serial-6.0-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: "USB-serial fixes for 6.0-rc8 Here's one more modem device id for 6.0-rc8/final. All have been in linux-next with no reported issues." * tag 'usb-serial-6.0-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: qcserial: add new usb-id for Dell branded EM7455 commit 90c2d2eb7ab5848c4f853751f12b96bdc460ad1b Author: Dmitry Torokhov Date: Fri Sep 30 08:57:18 2022 -0700 MIPS: pci: lantiq: switch to using gpiod API This patch switches the driver from legacy gpio API to the newer gpiod API. Signed-off-by: Dmitry Torokhov Signed-off-by: Thomas Bogendoerfer commit 056a68cea01edfa78b3474af1bfa39cc6bcc7bee Author: Jason A. Donenfeld Date: Fri Sep 30 16:01:38 2022 +0200 mips: allow firmware to pass RNG seed to kernel Nearly all other firmware environments have some way of passing a RNG seed to initialize the RNG: DTB's rng-seed, EFI's RNG protocol, m68k's bootinfo block, x86's setup_data, and so forth. This adds something similar for MIPS, which will allow various firmware environments, bootloaders, and hypervisors to pass an RNG seed to initialize the kernel's RNG. Signed-off-by: Jason A. Donenfeld Signed-off-by: Thomas Bogendoerfer commit b502a6fb46d275aa978c1e0655bada2cafc81fea Author: Alexei Starovoitov Date: Sat Oct 1 08:49:45 2022 -0700 bpf, docs: Delete misformatted table. Delete misformatted table. Fixes: 6166da0a02cd ("bpf, docs: Move legacy packet instructions to a separate file") Signed-off-by: Alexei Starovoitov commit 2120635108b35ecad9c59c8b44f6cbdf4f98214e Author: Sami Tolvanen Date: Fri Sep 30 20:33:10 2022 +0000 Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 We enable -Wcast-function-type globally in the kernel to warn about mismatching types in function pointer casts. Compilers currently warn only about ABI incompability with this flag, but Clang 16 will enable a stricter version of the check by default that checks for an exact type match. This will be very noisy in the kernel, so disable -Wcast-function-type-strict without W=1 until the new warnings have been addressed. Cc: stable@vger.kernel.org Link: https://reviews.llvm.org/D134831 Link: https://github.com/ClangBuiltLinux/linux/issues/1724 Suggested-by: Nathan Chancellor Signed-off-by: Sami Tolvanen Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220930203310.4010564-1-samitolvanen@google.com commit 56e696c0f0c71b77fff921fc94b58a02f0445b2c Author: Takashi Iwai Date: Sat Oct 1 16:21:24 2022 +0200 ALSA: hda: Fix position reporting on Poulsbo Hans reported that his Sony VAIO VPX11S1E showed the broken sound behavior at the start of the stream for a couple of seconds, and it turned out that the position_fix=1 option fixes the issue. It implies that the position reporting is inaccurate, and very likely hitting on all Poulsbo devices. The patch applies the workaround for Poulsbo generically to switch to LPIB mode instead of the default position buffer. Reported-and-tested-by: Hans de Goede Cc: Link: https://lore.kernel.org/r/3e8697e1-87c6-7a7b-d2e8-b21f1d2f181b@redhat.com Link: https://lore.kernel.org/r/20221001142124.7241-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 122733471384be8c23f019fbbd46bdf7be561dcd Author: Jason A. Donenfeld Date: Sat Oct 1 00:31:00 2022 +0200 random: schedule jitter credit for next jiffy, not in two jiffies Counterintuitively, mod_timer(..., jiffies + 1) will cause the timer to fire not in the next jiffy, but in two jiffies. The way to cause the timer to fire in the next jiffy is with mod_timer(..., jiffies). Doing so then lets us bump the upper bound back up again. Fixes: 50ee7529ec45 ("random: try to actively add entropy rather than passively wait for it") Fixes: 829d680e82a9 ("random: cap jitter samples per bit to factor of HZ") Cc: Dominik Brodowski Cc: Sebastian Andrzej Siewior Cc: Sultan Alsawaf Signed-off-by: Jason A. Donenfeld commit 67d0a917fb3f9e80c3fb6098ada2080d1b425c94 Author: Markus Fuchs Date: Thu Sep 29 00:22:42 2022 +0200 scsi: ufs: core: Remove unneeded casts from void * The end_io_data member of the "struct request" type has type "void *", so no cast is necessary. Link: https://lore.kernel.org/r/20220928222241.131334-1-mklntf@gmail.com Reviewed-by: Bart Van Assche Signed-off-by: Markus Fuchs Signed-off-by: Martin K. Petersen commit 638eec06c7f4df8eb415a0b33dd18cc6dfc986e6 Author: Colin Ian King Date: Wed Sep 28 23:21:16 2022 +0100 scsi: lpfc: Fix spelling mistake "unsolicted" -> "unsolicited" There are spelling mistakes in a log message and two comments. Fix them. Link: https://lore.kernel.org/r/20220928222116.68294-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 0b863257c17c5f57a41e0a48de140ed026957a63 Author: Manish Rangankar Date: Tue Sep 27 04:59:46 2022 -0700 scsi: qla2xxx: Use transport-defined speed mask for supported_speeds One of the sysfs values reported for supported_speeds was not valid (20Gb/s reported instead of 64Gb/s). Instead of driver internal speed mask definition, use speed mask defined in transport_fc for reporting host->supported_speeds. Link: https://lore.kernel.org/r/20220927115946.17559-1-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Manish Rangankar Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit f915f58e382e907e2be0b2f5472617dc13f2c390 Author: Christoph Hellwig Date: Tue Sep 27 10:22:25 2022 +0200 scsi: target: iblock: Fold iblock_emulate_read_cap_with_block_size() into iblock_get_blocks() Fold iblock_emulate_read_cap_with_block_size() into its only caller. Link: https://lore.kernel.org/r/20220927082225.271975-1-hch@lst.de Reviewed-by: Mike Christie Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 3ddeabd1536a71abf2b66a577c90df84514a0af2 Author: Rafael Mendonca Date: Mon Sep 26 20:02:44 2022 -0300 scsi: qla2xxx: Fix serialization of DCBX TLV data request Commit b6faaaf796d7 ("scsi: qla2xxx: Serialize mailbox request") serialized mailbox requests from userspace using the 'optrom' mutex. However, in the case of DCBX TLV data, if the memory for it is already allocated, then the mailbox request ends up not being serialized because it is done without holding the 'optrom' mutex. Link: https://lore.kernel.org/r/20220926230245.790508-1-rafaelmendsr@gmail.com Fixes: b6faaaf796d7 ("scsi: qla2xxx: Serialize mailbox request") Reviewed-by: Himanshu Madhani Signed-off-by: Rafael Mendonca Signed-off-by: Martin K. Petersen commit 07e433614cdb91e6f85cc79d738bb0a3d8c741a2 Author: Shang XiaoJing Date: Fri Sep 23 18:12:17 2022 +0800 scsi: ufs: qcom: Remove redundant dev_err() call devm_ioremap_resource() already prints an error message. Remove the redundant dev_err() call. Link: https://lore.kernel.org/r/20220923101217.18345-1-shangxiaojing@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Shang XiaoJing Signed-off-by: Martin K. Petersen commit 27b571cc454e5a5939b4940ed0bf20aaf37f5225 Author: Guixin Liu Date: Wed Sep 14 16:48:03 2022 +0800 scsi: megaraid_sas: Move megasas_dbg_lvl init to megasas_init() The megasas_dbg_lvl is a driver level parameter. Do not initialize it in the probe path. Otherwise we will miss the debug print when binding a new device to the megaraid driver. Link: https://lore.kernel.org/r/1663145283-4872-6-git-send-email-kanie@linux.alibaba.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen commit ad40d51992392a2336af861f83c17c0b08ca64b6 Author: Guixin Liu Date: Wed Sep 14 16:48:02 2022 +0800 scsi: megaraid_sas: Remove unnecessary memset() Remove memset() of pd_list and ld_ids in megasas_get_device_list(). These lists will be cleared by megasas_host_device_list_query(), megasas_get_pd_list(), and megasas_ld_list_query(). Link: https://lore.kernel.org/r/1663145283-4872-5-git-send-email-kanie@linux.alibaba.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen commit 17883cd59f5575ebe5b3cce2fd0f0d91738871bb Author: Guixin Liu Date: Wed Sep 14 16:48:01 2022 +0800 scsi: megaraid_sas: Simplify megasas_update_device_list Remove unnecessary dcmd_ret check and goto statement. Link: https://lore.kernel.org/r/1663145283-4872-4-git-send-email-kanie@linux.alibaba.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen commit 9b201b5dff81f298cebda10d51767cd25b432a1a Author: Guixin Liu Date: Wed Sep 14 16:48:00 2022 +0800 scsi: megaraid_sas: Correct an error message Correct the error message logged when allocation of ioc_init_request fails. Link: https://lore.kernel.org/r/1663145283-4872-3-git-send-email-kanie@linux.alibaba.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen commit 9b78d8fadeee078ca947a3b44157f42035fdf8b1 Author: Guixin Liu Date: Wed Sep 14 16:47:59 2022 +0800 scsi: megaraid_sas: Correct value passed to scsi_device_lookup() The "id" parameter currently passed to scsi_device_lookup() when removing a device is incorrect. It should be "ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL". Link: https://lore.kernel.org/r/1663145283-4872-2-git-send-email-kanie@linux.alibaba.com Fixes: ae6874ba4b43 ("scsi: megaraid_sas: Early detection of VD deletion through RaidMap update") Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen commit b302ca52ba8235ff0e18c0fa1fa92b51784aef6a Merge: 250012dd58406 ac107abef1976 Author: Marc Zyngier Date: Sat Oct 1 10:19:36 2022 +0100 Merge branch kvm-arm64/misc-6.1 into kvmarm-master/next * kvm-arm64/misc-6.1: : . : Misc KVM/arm64 fixes and improvement for v6.1 : : - Simplify the affinity check when moving a GICv3 collection : : - Tone down the shouting when kvm-arm.mode=protected is passed : to a guest : : - Fix various comments : : - Advertise the new kvmarm@lists.linux.dev and deprecate the : old Columbia list : . KVM: arm64: Advertise new kvmarm mailing list KVM: arm64: Fix comment typo in nvhe/switch.c KVM: selftests: Update top-of-file comment in psci_test KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available() KVM: arm64: vgic: Remove duplicate check in update_affinity_collection() Signed-off-by: Marc Zyngier commit 250012dd58406fdcce0bc4d825f56acd7a0d93a5 Merge: bb0cca240a16d 4b3402f1f4d98 Author: Marc Zyngier Date: Sat Oct 1 10:19:29 2022 +0100 Merge branch kvm-arm64/dirty-log-ordered into kvmarm-master/next * kvm-arm64/dirty-log-ordered: : . : Retrofit some ordering into the existing API dirty-ring by: : : - relying on acquire/release semantics which are the default on x86, : but need to be explicit on arm64 : : - adding a new capability that indicate which flavor is supported, either : with explicit ordering (arm64) or both implicit and explicit (x86), : as suggested by Paolo at KVM Forum : : - documenting the requirements for this new capability on weakly ordered : architectures : : - updating the selftests to do the right thing : . KVM: selftests: dirty-log: Use KVM_CAP_DIRTY_LOG_RING_ACQ_REL if available KVM: selftests: dirty-log: Upgrade flag accesses to acquire/release semantics KVM: Document weakly ordered architecture requirements for dirty ring KVM: x86: Select CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option KVM: Use acquire/release semantics when accessing dirty ring GFN state Signed-off-by: Marc Zyngier commit ac107abef197660c9db529fe550080ad07b46a67 Author: Marc Zyngier Date: Sat Oct 1 10:12:45 2022 +0100 KVM: arm64: Advertise new kvmarm mailing list As announced on the kvmarm list, we're moving the mailing list over to kvmarm@lists.linux.dev: As you probably all know, the kvmarm mailing has been hosted on Columbia's machines for as long as the project existed (over 13 years). After all this time, the university has decided to retire the list infrastructure and asked us to find a new hosting. A new mailing list has been created on lists.linux.dev[1], and I'm kindly asking everyone interested in following the KVM/arm64 developments to start subscribing to it (and start posting your patches there). I hope that people will move over to it quickly enough that we can soon give Columbia the green light to turn their systems off. Note that the new list will only get archived automatically once we fully switch over, but I'll make sure we fill any gap and not lose any message. In the meantime, please Cc both lists. [...] [1] https://subspace.kernel.org/lists.linux.dev.html Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221001091245.3900668-1-maz@kernel.org commit 6290e23f3bd8cee52fb8fd98980bb1eb31c8284d Author: Dmitry Bogdanov Date: Tue Sep 13 19:36:02 2022 +0300 scsi: target: core: UA on all LUNs after reset Allocate UNIT ATTENTION "BUS DEVICE RESET OCCURRED" on all LUNs on all target ports of the device upon reception of TMF LUN RESET. This change passes libiscsi test SCSI.MultipathIO.Reset. Link: https://lore.kernel.org/r/20220913163602.20597-1-d.bogdanov@yadro.com Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 3e2deba7aa662862c8046aa24148b83b49298a9b Author: Dmitry Bogdanov Date: Fri Sep 9 12:04:25 2022 +0300 scsi: target: core: New key must be used for moved PR According to SPC4 5.12.8: e) Retain the reservation key specified in the SERVICE ACTION RESERVATION KEY field and associated information; But currently sa_res_key is only used for the not existing I_T nexus. Add a changing of the key for the existing I_T nexus the PR moved to. Link: https://lore.kernel.org/r/20220909090425.14479-5-d.bogdanov@yadro.com Reviewed-by: Mike Christie Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 49790e6a582012c36ca17174cda228444f9a2414 Author: Dmitry Bogdanov Date: Fri Sep 9 12:04:24 2022 +0300 scsi: target: core: Abort all preempted regs if requested According to SPC the preempted commands shall be always aborted. SPC-4: 5.12.11.2.6 Preempting and aborting c) all commands from the I_T nexus(es) associated with the persistent reservations or registrations being preempted (i.e., preempted commands) except the PERSISTENT RESERVE OUT command itself shall be aborted as defined in SAM-5; Link: https://lore.kernel.org/r/20220909090425.14479-4-d.bogdanov@yadro.com Reviewed-by: Mike Christie Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit f050a7c66ca56aa2f49ab9b53e01d04b3e7e94c5 Author: Dmitry Bogdanov Date: Fri Sep 9 12:04:23 2022 +0300 scsi: target: core: Fix memory leak in preempt_and_abort Always release preempt_and_abort_list to avoid memory leak of t10_pr_registration objects in it. Link: https://lore.kernel.org/r/20220909090425.14479-3-d.bogdanov@yadro.com Reviewed-by: Mike Christie Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 1f1009ea8ca5a0271ad69afe8a86c887d530b5c8 Author: Dmitry Bogdanov Date: Fri Sep 9 12:04:22 2022 +0300 scsi: target: core: Fix preempt and abort for allreg res Match a key only if SARK is not zero according to SPC-4 and the comment above the code: If an all registrants persistent reservation is present and the SERVICE ACTION RESERVATION KEY field is set to zero, then all registrations shall be removed except for that of the I_T nexus that is being used for the PERSISTENT RESERVE OUT command; Without this patch in case of SARK==0 no registrants will be removed. Link: https://lore.kernel.org/r/20220909090425.14479-2-d.bogdanov@yadro.com Reviewed-by: Mike Christie Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 5226c7b9784eee215e3914f440b3c2e1764f67a8 Author: Takashi Iwai Date: Sat Oct 1 09:48:10 2022 +0200 ALSA: hda/hdmi: Don't skip notification handling during PM operation The HDMI driver skips the notification handling from the graphics driver when the codec driver is being in the PM operation. This behavior was introduced by the commit eb399d3c99d8 ("ALSA: hda - Skip ELD notification during PM process"). This skip may cause a problem, as we may miss the ELD update when the connection/disconnection happens right at the runtime-PM operation of the audio codec. Although this workaround was valid at that time, it's no longer true; the fix was required just because the ELD update procedure needed to wake up the audio codec, which had lead to a runtime-resume during a runtime-suspend. Meanwhile, the ELD update procedure doesn't need a codec wake up any longer since the commit 788d441a164c ("ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling"); i.e. there is no much reason for skipping the notification. Let's drop those checks for addressing the missing notification. Fixes: 788d441a164c ("ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling") Reported-by: Brent Lu Link: https://lore.kernel.org/r/20220927135807.4097052-1-brent.lu@intel.com Link: https://lore.kernel.org/r/20221001074809.7461-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 75024261403af74051e6aeb1b0a2dc2bca2458dc Author: Samuel Holland Date: Fri Sep 30 22:52:34 2022 -0700 dt-bindings: input: Add the PinePhone keyboard binding Add devicetree support for the PinePhone keyboard case, which provides a matrix keyboard interface and a proxied I2C bus. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220618165747.55709-2-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit 1d666ab2dad5b311cd7d742607afcc59a2558925 Author: Rob Herring Date: Fri Sep 30 20:50:18 2022 -0700 dt-bindings: input: Convert hid-over-i2c to DT schema Convert the hid-over-i2c binding to DT schema format. The supplies should probably be specific to a specific device, but it seems they are already in use otherwise. 'wakeup-source' is added as it was not explicitly documented. There's a few warnings for undocumented properties 'vcc-supply' and 'reset-gpios'. Those remain as they probably should have a specific compatible as well. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220927150916.1091217-1-robh@kernel.org Signed-off-by: Dmitry Torokhov commit 1b45cc5c7b920fd8bf72e5a888ec7abeadf41e09 Author: Ye Bin Date: Sat Sep 24 15:52:33 2022 +0800 ext4: fix potential out of bound read in ext4_fc_replay_scan() For scan loop must ensure that at least EXT4_FC_TAG_BASE_LEN space. If remain space less than EXT4_FC_TAG_BASE_LEN which will lead to out of bound read when mounting corrupt file system image. ADD_RANGE/HEAD/TAIL is needed to add extra check when do journal scan, as this three tags will read data during scan, tag length couldn't less than data length which will read. Cc: stable@kernel.org Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20220924075233.2315259-4-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit dcc5827484d6e53ccda12334f8bbfafcc593ceda Author: Ye Bin Date: Sat Sep 24 15:52:32 2022 +0800 ext4: factor out ext4_fc_get_tl() Factor out ext4_fc_get_tl() to fill 'tl' with host byte order. Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20220924075233.2315259-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit fdc2a3c75dd8345c5b48718af90bad1a7811bedb Author: Ye Bin Date: Sat Sep 24 15:52:31 2022 +0800 ext4: introduce EXT4_FC_TAG_BASE_LEN helper Introduce EXT4_FC_TAG_BASE_LEN helper for calculate length of struct ext4_fc_tl. Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20220924075233.2315259-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 7ff5fddaddf2cc8d394f71e68648e9d8d7e41da8 Author: Ye Bin Date: Sat Sep 24 10:12:11 2022 +0800 ext4: factor out ext4_free_ext_path() Factor out ext4_free_ext_path() to free extent path. As after previous patch 'ext4_ext_drop_refs()' is only used in 'extents.c', so make it static. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220924021211.3831551-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit b6a750c01925954d0dc6c360e91b5fcb53664a26 Author: Ye Bin Date: Sat Sep 24 10:12:10 2022 +0800 ext4: remove unnecessary drop path references in mext_check_coverage() According to Jan Kara's suggestion: "The use in mext_check_coverage() can be actually removed - get_ext_path() -> ext4_find_extent() takes care of dropping the references." So remove unnecessary call ext4_ext_drop_refs() in mext_check_coverage(). Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220924021211.3831551-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 27cd49780381c6ccbf248798e5e8fd076200ffba Author: Ye Bin Date: Wed Sep 21 14:40:40 2022 +0800 ext4: update 'state->fc_regions_size' after successful memory allocation To avoid to 'state->fc_regions_size' mismatch with 'state->fc_regions' when fail to reallocate 'fc_reqions',only update 'state->fc_regions_size' after 'state->fc_regions' is allocated successfully. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220921064040.3693255-4-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 7069d105c1f15c442b68af43f7fde784f3126739 Author: Ye Bin Date: Wed Sep 21 14:40:39 2022 +0800 ext4: fix potential memory leak in ext4_fc_record_regions() As krealloc may return NULL, in this case 'state->fc_regions' may not be freed by krealloc, but 'state->fc_regions' already set NULL. Then will lead to 'state->fc_regions' memory leak. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220921064040.3693255-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 9305721a309fa1bd7c194e0d4a2335bf3b29dca4 Author: Ye Bin Date: Wed Sep 21 14:40:38 2022 +0800 ext4: fix potential memory leak in ext4_fc_record_modified_inode() As krealloc may return NULL, in this case 'state->fc_modified_inodes' may not be freed by krealloc, but 'state->fc_modified_inodes' already set NULL. Then will lead to 'state->fc_modified_inodes' memory leak. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220921064040.3693255-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 78ed9354c57f31000e88783496fc84dce7c8021c Author: Guoqing Jiang Date: Sun Sep 18 19:52:19 2022 +0800 ext4: remove redundant checking in ext4_ioctl_checkpoint It is already checked after comment "check for invalid bits set", so let's remove this one. Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20220918115219.12407-1-guoqing.jiang@linux.dev Signed-off-by: Theodore Ts'o commit dfff66f30f66b9524b661f311bbed8ff3d2ca49f Author: Ye Bin Date: Sat Sep 17 17:38:05 2022 +0800 jbd2: add miss release buffer head in fc_do_one_pass() In fc_do_one_pass() miss release buffer head after use which will lead to reference count leak. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220917093805.1782845-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 3df11e27f02c3dea5a3a0e45628d67f0d82c3c5e Author: Jason Yan Date: Fri Sep 16 22:15:27 2022 +0800 ext4: move DIOREAD_NOLOCK setting to ext4_set_def_opts() Now since all preparations is done, we can move the DIOREAD_NOLOCK setting to ext4_set_def_opts(). Suggested-by: Ritesh Harjani (IBM) Signed-off-by: Jason Yan Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916141527.1012715-17-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit c8267c51425abd4f75d0ad07c4d3ee748908e2f8 Author: Jason Yan Date: Fri Sep 16 22:15:26 2022 +0800 ext4: remove useless local variable 'blocksize' Since sb->s_blocksize is now initialized at the very beginning, the local variable 'blocksize' in __ext4_fill_super() is not needed now. Remove it and use sb->s_blocksize instead. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916141527.1012715-16-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit a7a79c292ac3776bed20d575a96194181a397125 Author: Jason Yan Date: Fri Sep 16 22:15:25 2022 +0800 ext4: unify the ext4 super block loading operation Now we load the super block from the disk in two steps. First we load the super block with the default block size(EXT4_MIN_BLOCK_SIZE). Second we load the super block with the real block size. The second step is a little far from the first step. This patch move these two steps together in a new function. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916141527.1012715-15-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit a5991e539c9a4be0bdec2e427d833196339ec7c6 Author: Jason Yan Date: Fri Sep 16 22:15:24 2022 +0800 ext4: factor out ext4_journal_data_mode_check() Factor out ext4_journal_data_mode_check(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-14-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 9c1dd22d742249cfae7bbf3680a7c188d194d3ce Author: Jason Yan Date: Fri Sep 16 22:15:23 2022 +0800 ext4: factor out ext4_load_and_init_journal() This patch group the journal load and initialize code together and factor out ext4_load_and_init_journal(). This patch also removes the lable 'no_journal' which is not needed after refactor. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-13-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit a4e6a511d7de5d2afa4e8138146c29b926c6a449 Author: Jason Yan Date: Fri Sep 16 22:15:22 2022 +0800 ext4: factor out ext4_group_desc_init() and ext4_group_desc_free() Factor out ext4_group_desc_init() and ext4_group_desc_free(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-12-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit bc62dbf9145746c442b5b4a960e842ff7e8fdd2e Author: Jason Yan Date: Fri Sep 16 22:15:21 2022 +0800 ext4: factor out ext4_geometry_check() Factor out ext4_geometry_check(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-11-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit d7f3542b3219622308079dca521851be9b924c05 Author: Jason Yan Date: Fri Sep 16 22:15:20 2022 +0800 ext4: factor out ext4_check_feature_compatibility() Factor out ext4_check_feature_compatibility(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-10-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit b26458d151019ec279a2622ac6f15b5b913252ff Author: Jason Yan Date: Fri Sep 16 22:15:19 2022 +0800 ext4: factor out ext4_init_metadata_csum() Factor out ext4_init_metadata_csum(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-9-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 39c135b08c8220dd1dca885e73eae3f3de5fa082 Author: Jason Yan Date: Fri Sep 16 22:15:18 2022 +0800 ext4: factor out ext4_encoding_init() Factor out ext4_encoding_init(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916141527.1012715-8-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 0e495f7cc3f91d8473f16045c61c60bffd95639c Author: Jason Yan Date: Fri Sep 16 22:15:17 2022 +0800 ext4: factor out ext4_inode_info_init() Factor out ext4_inode_info_init(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-7-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit f7314a67322ef04a4df51fbf6dc2b77fe71ef9ad Author: Jason Yan Date: Fri Sep 16 22:15:16 2022 +0800 ext4: factor out ext4_fast_commit_init() Factor out ext4_fast_commit_init(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-6-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 4a8557b094671de1c986f2764cf4d1965541dda7 Author: Jason Yan Date: Fri Sep 16 22:15:15 2022 +0800 ext4: factor out ext4_handle_clustersize() Factor out ext4_handle_clustersize(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-5-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 5f6d662d12b889ab91cc25fb19afa5699fb05bcb Author: Jason Yan Date: Fri Sep 16 22:15:14 2022 +0800 ext4: factor out ext4_set_def_opts() Factor out ext4_set_def_opts(). No functional change. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-4-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit a5fc51193507e10a0733c40282e71216dd0486ff Author: Jason Yan Date: Fri Sep 16 22:15:13 2022 +0800 ext4: remove cantfind_ext4 error handler The 'cantfind_ext4' error handler is just a error msg print and then goto failed_mount. This two level goto makes the code complex and not easy to read. The only benefit is that is saves a little bit code. However some branches can merge and some branches dot not even need it. So do some refactor and remove it. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-3-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit 43bd6f1b49b61f43de4d4e33661b8dbe8c911f14 Author: Jason Yan Date: Fri Sep 16 22:15:12 2022 +0800 ext4: goto right label 'failed_mount3a' Before these two branches neither loaded the journal nor created the xattr cache. So the right label to goto is 'failed_mount3a'. Although this did not cause any issues because the error handler validated if the pointer is null. However this still made me confused when reading the code. So it's still worth to modify to goto the right label. Signed-off-by: Jason Yan Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220916141527.1012715-2-yanaijie@huawei.com Signed-off-by: Theodore Ts'o commit e64e6ca90913b0dfe14bf7d529df0753a6746e23 Author: Ye Bin Date: Fri Sep 16 16:38:36 2022 +0800 ext4: adjust fast commit disable judgement order in ext4_fc_track_inode If fastcommit is already disabled, there isn't need to mark inode ineligible. So move 'ext4_fc_disabled()' judgement bofore 'ext4_should_journal_data(inode)' judgement which can avoid to do meaningless judgement. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916083836.388347-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit b7b80a35fb51319223e1fbf84128b8e5ebb91f86 Author: Ye Bin Date: Fri Sep 16 16:38:35 2022 +0800 ext4: factor out ext4_fc_disabled() Factor out ext4_fc_disabled(). No functional change. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220916083836.388347-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit ccbf8eeb39f2ff00b54726a2b20b35d788c4ecb5 Author: Ye Bin Date: Wed Sep 14 18:08:59 2022 +0800 ext4: fix miss release buffer head in ext4_fc_write_inode In 'ext4_fc_write_inode' function first call 'ext4_get_inode_loc' get 'iloc', after use it miss release 'iloc.bh'. So just release 'iloc.bh' before 'ext4_fc_write_inode' return. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220914100859.1415196-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 243d1a5d505d0b0460c9af0ad56ed4a56ef0bebd Author: Ye Bin Date: Wed Sep 14 18:08:12 2022 +0800 jbd2: fix potential use-after-free in jbd2_fc_wait_bufs In 'jbd2_fc_wait_bufs' use 'bh' after put buffer head reference count which may lead to use-after-free. So judge buffer if uptodate before put buffer head reference count. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220914100812.1414768-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit e0d5fc7a6d80ac2406c7dfc6bb625201d0250a8a Author: Ye Bin Date: Wed Sep 14 18:08:11 2022 +0800 jbd2: fix potential buffer head reference count leak As in 'jbd2_fc_wait_bufs' if buffer isn't uptodate, will return -EIO without update 'journal->j_fc_off'. But 'jbd2_fc_release_bufs' will release buffer head from ‘j_fc_off - 1’ if 'bh' is NULL will terminal release which will lead to buffer head buffer head reference count leak. To solve above issue, update 'journal->j_fc_off' before return -EIO. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220914100812.1414768-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 7177dd009c7c04290891e9a534cd47d1b620bd04 Author: Zhihao Cheng Date: Sun Sep 11 12:52:04 2022 +0800 ext4: fix dir corruption when ext4_dx_add_entry() fails Following process may lead to fs corruption: 1. ext4_create(dir/foo) ext4_add_nondir ext4_add_entry ext4_dx_add_entry a. add_dirent_to_buf ext4_mark_inode_dirty ext4_handle_dirty_metadata // dir inode bh is recorded into journal b. ext4_append // dx_get_count(entries) == dx_get_limit(entries) ext4_bread(EXT4_GET_BLOCKS_CREATE) ext4_getblk ext4_map_blocks ext4_ext_map_blocks ext4_mb_new_blocks dquot_alloc_block dquot_alloc_space_nodirty inode_add_bytes // update dir's i_blocks ext4_ext_insert_extent ext4_ext_dirty // record extent bh into journal ext4_handle_dirty_metadata(bh) // record new block into journal inode->i_size += inode->i_sb->s_blocksize // new size(in mem) c. ext4_handle_dirty_dx_node(bh2) // record dir's new block(dx_node) into journal d. ext4_handle_dirty_dx_node((frame - 1)->bh) e. ext4_handle_dirty_dx_node(frame->bh) f. do_split // ret err! g. add_dirent_to_buf ext4_mark_inode_dirty(dir) // update raw_inode on disk(skipped) 2. fsck -a /dev/sdb drop last block(dx_node) which beyonds dir's i_size. /dev/sdb: recovering journal /dev/sdb contains a file system with errors, check forced. /dev/sdb: Inode 12, end of extent exceeds allowed value (logical block 128, physical block 3938, len 1) 3. fsck -fn /dev/sdb dx_node->entry[i].blk > dir->i_size Pass 2: Checking directory structure Problem in HTREE directory inode 12 (/dir): bad block number 128. Clear HTree index? no Problem in HTREE directory inode 12: block #3 has invalid depth (2) Problem in HTREE directory inode 12: block #3 has bad max hash Problem in HTREE directory inode 12: block #3 not referenced Fix it by marking inode dirty directly inside ext4_append(). Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216466 Cc: stable@vger.kernel.org Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220911045204.516460-1-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit ebd5d23e88b7fc84cbbb7a002aa35bfd5bfadb10 Author: Gaosheng Cui Date: Fri Sep 9 14:53:07 2022 +0800 ext4: remove ext4_inline_data_fiemap() declaration ext4_inline_data_fiemap() has been removed since commit d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework"), so remove it. Signed-off-by: Gaosheng Cui Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220909065307.1155201-1-cuigaosheng1@huawei.com Signed-off-by: Theodore Ts'o commit a642c2c0827f5604a93f9fa1e5701eecdce4ae22 Author: Jeff Layton Date: Thu Sep 8 13:24:42 2022 -0400 ext4: fix i_version handling in ext4 ext4 currently updates the i_version counter when the atime is updated during a read. This is less than ideal as it can cause unnecessary cache invalidations with NFSv4 and unnecessary remeasurements for IMA. The increment in ext4_mark_iloc_dirty is also problematic since it can corrupt the i_version counter for ea_inodes. We aren't bumping the file times in ext4_mark_iloc_dirty, so changing the i_version there seems wrong, and is the cause of both problems. Remove that callsite and add increments to the setattr, setxattr and ioctl codepaths, at the same times that we update the ctime. The i_version bump that already happens during timestamp updates should take care of the rest. In ext4_move_extents, increment the i_version on both inodes, and also add in missing ctime updates. [ Some minor updates since we've already enabled the i_version counter unconditionally already via another patch series. -- TYT ] Cc: stable@kernel.org Cc: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20220908172448.208585-3-jlayton@kernel.org Signed-off-by: Theodore Ts'o commit 5fc4cbd9fde5d4630494fd6ffc884148fb618087 Author: Jan Kara Date: Thu Sep 8 11:10:32 2022 +0200 mbcache: Avoid nesting of cache->c_list_lock under bit locks Commit 307af6c87937 ("mbcache: automatically delete entries from cache on freeing") started nesting cache->c_list_lock under the bit locks protecting hash buckets of the mbcache hash table in mb_cache_entry_create(). This causes problems for real-time kernels because there spinlocks are sleeping locks while bitlocks stay atomic. Luckily the nesting is easy to avoid by holding entry reference until the entry is added to the LRU list. This makes sure we cannot race with entry deletion. Cc: stable@kernel.org Fixes: 307af6c87937 ("mbcache: automatically delete entries from cache on freeing") Reported-by: Mike Galbraith Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220908091032.10513-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 34fc8768ec6089565d6d73bad26724083cecf7bd Author: Andrew Perepechko Date: Wed Sep 7 19:59:59 2022 +0300 jbd2: wake up journal waiters in FIFO order, not LIFO LIFO wakeup order is unfair and sometimes leads to a journal user not being able to get a journal handle for hundreds of transactions in a row. FIFO wakeup can make things more fair. Cc: stable@kernel.org Signed-off-by: Alexey Lyashkov Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20220907165959.1137482-1-alexey.lyashkov@gmail.com Signed-off-by: Theodore Ts'o commit d1052d236eddf6aa851434db1897b942e8db9921 Author: Jinke Han Date: Sat Sep 3 09:24:29 2022 +0800 ext4: place buffer head allocation before handle start In our product environment, we encounter some jbd hung waiting handles to stop while several writters were doing memory reclaim for buffer head allocation in delay alloc write path. Ext4 do buffer head allocation with holding transaction handle which may be blocked too long if the reclaim works not so smooth. According to our bcc trace, the reclaim time in buffer head allocation can reach 258s and the jbd transaction commit also take almost the same time meanwhile. Except for these extreme cases, we often see several seconds delays for cgroup memory reclaim on our servers. This is more likely to happen considering docker environment. One thing to note, the allocation of buffer heads is as often as page allocation or more often when blocksize less than page size. Just like page cache allocation, we should also place the buffer head allocation before startting the handle. Cc: stable@kernel.org Signed-off-by: Jinke Han Link: https://lore.kernel.org/r/20220903012429.22555-1-hanjinke.666@bytedance.com Signed-off-by: Theodore Ts'o commit 0b73284c564d3ae4feef4bc920292f004acf4980 Author: Zhang Yi Date: Wed Aug 31 15:46:29 2022 +0800 ext4: ext4_read_bh_lock() should submit IO if the buffer isn't uptodate Recently we notice that ext4 filesystem would occasionally fail to read metadata from disk and report error message, but the disk and block layer looks fine. After analyse, we lockon commit 88dbcbb3a484 ("blkdev: avoid migration stalls for blkdev pages"). It provide a migration method for the bdev, we could move page that has buffers without extra users now, but it lock the buffers on the page, which breaks the fragile metadata read operation on ext4 filesystem, ext4_read_bh_lock() was copied from ll_rw_block(), it depends on the assumption of that locked buffer means it is under IO. So it just trylock the buffer and skip submit IO if it lock failed, after wait_on_buffer() we conclude IO error because the buffer is not uptodate. This issue could be easily reproduced by add some delay just after buffer_migrate_lock_buffers() in __buffer_migrate_folio() and do fsstress on ext4 filesystem. EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #73193: comm fsstress: reading directory lblock 0 EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #75334: comm fsstress: reading directory lblock 0 Fix it by removing the trylock logic in ext4_read_bh_lock(), just lock the buffer and submit IO if it's not uptodate, and also leave over readahead helper. Cc: stable@kernel.org Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220831074629.3755110-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 1ff20307393e17dc57fde62226df625a3a3c36e9 Author: Jeff Layton Date: Wed Aug 24 18:03:49 2022 +0200 ext4: unconditionally enable the i_version counter The original i_version implementation was pretty expensive, requiring a log flush on every change. Because of this, it was gated behind a mount option (implemented via the MS_I_VERSION mountoption flag). Commit ae5e165d855d (fs: new API for handling inode->i_version) made the i_version flag much less expensive, so there is no longer a performance penalty from enabling it. xfs and btrfs already enable it unconditionally when the on-disk format can support it. Have ext4 ignore the SB_I_VERSION flag, and just enable it unconditionally. While we're in here, mark the i_version mount option Opt_removed. [ Removed leftover bits of i_version from ext4_apply_options() since it now can't ever be set in ctx->mask_s_flags -- lczerner ] Cc: stable@kernel.org Cc: Dave Chinner Cc: Benjamin Coddington Cc: Christoph Hellwig Cc: Darrick J. Wong Signed-off-by: Jeff Layton Signed-off-by: Lukas Czerner Reviewed-by: Christian Brauner (Microsoft) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220824160349.39664-3-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit ae3ed15da5889263de372ff9df2e83e16acca4cb Author: Daniel Golle Date: Fri Sep 30 01:56:53 2022 +0100 net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear Setting ib1 state to MTK_FOE_STATE_UNBIND in __mtk_foe_entry_clear routine as done by commit 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear") breaks flow offloading, at least on older MTK_NETSYS_V1 SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems. Felix Fietkau suggested to use MTK_FOE_STATE_INVALID instead which works well on both, MTK_NETSYS_V1 and MTK_NETSYS_V2. Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3). Suggested-by: Felix Fietkau Fixes: 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear") Fixes: 33fc42de33278b ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/YzY+1Yg0FBXcnrtc@makrotopia.org Signed-off-by: Jakub Kicinski commit 5fcc2cfc14ae0b44a47b8dcaa037068ff8151bde Merge: f77a9f3cd1e66 2820a400dfd35 Author: Jakub Kicinski Date: Fri Sep 30 19:03:49 2022 -0700 Merge branch 'nfp-support-fec-mode-reporting-and-auto-neg' Simon Horman says: ==================== nfp: support FEC mode reporting and auto-neg this series adds support for the following features to the nfp driver: * Patch 1/5: Support active FEC mode * Patch 2/5: Don't halt driver on non-fatal error when interacting with fw * Patch 3/5: Treat port independence as a firmware rather than port property * Patch 4/5: Support link auto negotiation * Patch 5/5: Support restart of link auto negotiation ==================== Link: https://lore.kernel.org/r/20220929085832.622510-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 2820a400dfd3579af6db41b6bd5f5114b8749cae Author: Fei Qin Date: Thu Sep 29 10:58:32 2022 +0200 nfp: add support restart of link auto-negotiation Add support restart of link auto-negotiation. This may be initiated using: # ethtool -r Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 8d545385bf267e071fee1b6d00d5639cd46aae13 Author: Yinjun Zhang Date: Thu Sep 29 10:58:31 2022 +0200 nfp: add support for link auto negotiation Report the auto negotiation capability if it's supported in management firmware, and advertise it if it's enabled. Changing port speed is not allowed when autoneg is enabled. The ethtool command displays the auto-neg capability: # ethtool enp1s0np0 Settings for enp1s0np0: Supported ports: [ FIBRE ] Supported link modes: Not reported Supported pause frame use: Symmetric Supports auto-negotiation: Yes Supported FEC modes: None RS BASER Advertised link modes: Not reported Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Advertised FEC modes: None RS BASER Speed: 25000Mb/s Duplex: Full Auto-negotiation: on Port: FIBRE PHYAD: 0 Transceiver: internal Link detected: yes Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit b1e4f11e426dba8fd8baa549208e40dbe39c03de Author: Yinjun Zhang Date: Thu Sep 29 10:58:30 2022 +0200 nfp: refine the ABI of getting `sp_indiff` info Considering that whether application firmware is indifferent to port speed is a firmware property instead of port property, now use a new rtsym to get the property instead of parsing per-port tlv caps. With this change, relevant code is moved to `nfp_main` layer. Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 965dd27d9893f543c014c96e8beb52a8ae8a02a5 Author: Yinjun Zhang Date: Thu Sep 29 10:58:29 2022 +0200 nfp: avoid halt of driver init process when non-fatal error happens It's not a fatal error when setting `hwinfo` into management firmware fails, no need to halt the whole driver initialization process. Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit fc26e70f8acaa2279cb00c1d15c91ecbe961bd2f Author: Yinjun Zhang Date: Thu Sep 29 10:58:28 2022 +0200 nfp: add support for reporting active FEC mode The latest management firmware can now report the active FEC mode. Adapt driver accordingly so that user can get the active FEC mode by running command: # ethtool --show-fec Also correct use of `fec` field. Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit f77a9f3cd1e669b83d575e1f4df69c0079704842 Author: Zhengchao Shao Date: Thu Sep 29 12:19:09 2022 +0800 selftests/tc-testing: update qdisc/cls/action features in config Since three patchsets "add tc-testing test cases", "refactor duplicate codes in the tc cls walk function", and "refactor duplicate codes in the qdisc class walk function" are merged to net-next tree, the list of supported features needs to be updated in config file. Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20220929041909.83913-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 70d5ab532059f06c2833b0e4ffae8a785c3692df Author: Dmitry Torokhov Date: Thu Sep 29 13:22:55 2022 -0700 dt-bindings: nfc: marvell,nci: fix reset line polarity in examples The reset line is supposed to be "active low" (it even says so in the description), but examples incorrectly show it as "active high" (likely because original examples use 0 which is technically "active high" but in practice often "don't care" if the driver is using legacy gpio API, as this one does). Signed-off-by: Dmitry Torokhov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/YzX+nzJolxAKmt+z@google.com Signed-off-by: Jakub Kicinski commit 2483223e19b16b423b71e775be2359c2c0c8949c Merge: 3406079bbb279 61e4a51621587 Author: Jakub Kicinski Date: Fri Sep 30 18:17:22 2022 -0700 Merge branch 'devlink-sanitize-per-port-region-creation-destruction' Jiri Pirko says: ==================== devlink: sanitize per-port region creation/destruction Currently the only user of per-port devlink regions is DSA. All drivers that use regions register them before devlink registration. For DSA, this was not possible as the internals of struct devlink_port needed for region creation are initialized during port registration. This introduced a mismatch in creation flow of devlink and devlink port regions. As you can see, it causes the DSA driver to make the port init/exit flow a bit cumbersome. Fix this by introducing port_init/fini() which could be optionally called by drivers like DSA, to prepare struct devlink_port to be used for region creation purposes before devlink port register is called. Tested by Vladimir on his setup. ==================== Link: https://lore.kernel.org/r/20220929072902.2986539-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 61e4a51621587c939672d6a9354f6d0aa3d4e131 Author: Vladimir Oltean Date: Thu Sep 29 09:29:02 2022 +0200 net: dsa: remove bool devlink_port_setup Since dsa_port_devlink_setup() and dsa_port_devlink_teardown() are already called from code paths which only execute once per port (due to the existing bool dp->setup), keeping another dp->devlink_port_setup is redundant, because we can already manage to balance the calls properly (and not call teardown when setup was never called, or call setup twice, or things like that). Signed-off-by: Vladimir Oltean Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit c698a5fbf7fd9f5bb909d09626319b59d55db36b Author: Jiri Pirko Date: Thu Sep 29 09:29:01 2022 +0200 net: dsa: don't do devlink port setup early Commit 3122433eb533 ("net: dsa: Register devlink ports before calling DSA driver setup()") moved devlink port setup to be done early before driver setup() was called. That is no longer needed, so move the devlink port initialization back to dsa_port_setup(), as the first thing done there. Note there is no longer needed to reinit port as unused if dsa_port_setup() fails, as it unregisters the devlink port instance on the error path. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit cf5ca4ddc37a693b17fdb653cb84b920b1185d71 Author: Vladimir Oltean Date: Thu Sep 29 09:29:00 2022 +0200 net: dsa: don't leave dangling pointers in dp->pl when failing There is a desire to simplify the dsa_port registration path with devlink, and this involves reworking a bit how user ports which fail to connect to their PHY (because it's missing) get reinitialized as UNUSED devlink ports. The desire is for the change to look something like this; basically dsa_port_setup() has failed, we just change dp->type and call dsa_port_setup() again. -/* Destroy the current devlink port, and create a new one which has the UNUSED - * flavour. - */ -static int dsa_port_reinit_as_unused(struct dsa_port *dp) +static int dsa_port_setup_as_unused(struct dsa_port *dp) { - dsa_port_devlink_teardown(dp); dp->type = DSA_PORT_TYPE_UNUSED; - return dsa_port_devlink_setup(dp); + return dsa_port_setup(dp); } For an UNUSED port, dsa_port_setup() mostly only calls dsa_port_devlink_setup() anyway, so we could get away with calling just that. But if we call the full blown dsa_port_setup(dp) (which will be needed to properly set dp->setup = true), the callee will have the tendency to go through this code block too, and call dsa_port_disable(dp): switch (dp->type) { case DSA_PORT_TYPE_UNUSED: dsa_port_disable(dp); break; That is not very good, because dsa_port_disable() has this hidden inside of it: if (dp->pl) phylink_stop(dp->pl); Fact is, we are not prepared to handle a call to dsa_port_disable() with a struct dsa_port that came from a previous (and failed) call to dsa_port_setup(). We do not clean up dp->pl, and this will make the second call to dsa_port_setup() call phylink_stop() on a dangling dp->pl pointer. Solve this by creating an API for phylink destruction which is symmetric to the phylink creation, and never leave dp->pl set to anything except NULL or a valid phylink structure. Signed-off-by: Vladimir Oltean Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit d82acd85cc41a8e5d5e0e4c2a3f4b645def29723 Author: Jiri Pirko Date: Thu Sep 29 09:28:59 2022 +0200 net: dsa: move port_setup/teardown to be called outside devlink port registered area Move port_setup() op to be called before devlink_port_register() and port_teardown() after devlink_port_unregister(). Note it makes sense to move this alongside the rest of the devlink port code, the reinit() function also gets much nicer, as clearly the fact that port_setup()->devlink_port_region_create() was called in dsa_port_setup did not fit the flow. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit ae3bbc04d4bfef5d0332cd4edda3ac8f714cea23 Author: Jiri Pirko Date: Thu Sep 29 09:28:58 2022 +0200 net: devlink: add port_init/fini() helpers to allow pre-register/post-unregister functions Lifetime of some of the devlink objects, like regions, is currently forced to be different for devlink instance and devlink port instance (per-port regions). The reason is that for devlink ports, the internal structures initialization happens only after devlink_port_register() is called. To resolve this inconsistency, introduce new set of helpers to allow driver to initialize devlink pointer and region list before devlink_register() is called. That allows port regions to be created before devlink port registration and destroyed after devlink port unregistration. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 081adcfe930e4b01a55eaa329b2e453a442f35a9 Author: Jiri Pirko Date: Thu Sep 29 09:28:57 2022 +0200 net: devlink: introduce a flag to indicate devlink port being registered Instead of relying on devlink pointer not being initialized, introduce an extra flag to indicate if devlink port is registered. This is needed as later on devlink pointer is going to be initialized even in case devlink port is not registered yet. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 3fcb698d9c773d1e0ce5eb4374273457eb4c8338 Author: Jiri Pirko Date: Thu Sep 29 09:28:56 2022 +0200 net: devlink: introduce port registered assert helper and use it Instead of checking devlink_port->devlink pointer for not being NULL which indicates that devlink port is registered, put this check to new pair of helpers similar to what we have for devlink and use them in other functions. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 3406079bbb279e33ab4b8d9a30e4dd68ce7bcafe Author: Chunhao Lin Date: Thu Sep 29 01:13:56 2022 +0800 r8169: add rtl_disable_rxdvgate() rtl_disable_rxdvgate() is used for disable RXDV_GATE. It is opposite function of rtl_enable_rxdvgate(). Disable RXDV_GATE does not have to delay. So in this patch, also remove the delay after disale RXDV_GATE. Signed-off-by: Chunhao Lin Link: https://lore.kernel.org/r/20220928171356.3951-1-hau@realtek.com Signed-off-by: Jakub Kicinski commit a507ea32b9c2c407012bf89109ac0cf89fae313c Merge: cff2d762cde66 6abf0dae8c3c9 Author: Jakub Kicinski Date: Fri Sep 30 18:02:18 2022 -0700 Merge tag 'for-net-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Luiz Augusto von Dentz says: ==================== bluetooth-next pull request for net-next - Add RTL8761BUV device (Edimax BT-8500) - Add a new PID/VID 13d3/3583 for MT7921 - Add Realtek RTL8852C support ID 0x13D3:0x3592 - Add VID/PID 0489/e0e0 for MediaTek MT7921 - Add a new VID/PID 0e8d/0608 for MT7921 - Add a new PID/VID 13d3/3578 for MT7921 - Add BT device 0cb8:c549 from RTW8852AE - Add support for Intel Magnetor * tag 'for-net-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (49 commits) Bluetooth: hci_sync: Fix not indicating power state Bluetooth: L2CAP: Fix user-after-free Bluetooth: Call shutdown for HCI_USER_CHANNEL Bluetooth: Prevent double register of suspend Bluetooth: hci_core: Fix not handling link timeouts propertly Bluetooth: hci_event: Make sure ISO events don't affect non-ISO connections Bluetooth: hci_debugfs: Fix not checking conn->debugfs Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times Bluetooth: MGMT: fix zalloc-simple.cocci warnings Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure Bluetooth: use hdev->workqueue when queuing hdev->{cmd,ncmd}_timer works Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() Bluetooth: RFCOMM: Fix possible deadlock on socket shutdown/release Bluetooth: hci_sync: allow advertise when scan without RPA Bluetooth: btusb: Add a new VID/PID 0e8d/0608 for MT7921 Bluetooth: btusb: Add a new PID/VID 13d3/3583 for MT7921 Bluetooth: avoid hci_dev_test_and_set_flag() in mgmt_init_hdev() Bluetooth: btintel: Mark Intel controller to support LE_STATES quirk Bluetooth: btintel: Add support for Magnetor Bluetooth: btusb: Add a new PID/VID 13d3/3578 for MT7921 ... ==================== Link: https://lore.kernel.org/r/20221001004602.297366-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit f816ac1115b9d4f874efa04f721eba99cf69067e Author: ye xingchen Date: Tue Sep 6 07:23:22 2022 +0000 clk: mvebu: armada-37xx-tbg: Remove the unneeded result variable Return the value of_clk_add_hw_provider() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220906072322.337253-1-ye.xingchen@zte.com.cn Signed-off-by: Stephen Boyd commit cff2d762cde669023f345157f875b7ea6658992a Author: Jakub Kicinski Date: Thu Sep 29 07:28:09 2022 -0700 genetlink: reject use of nlmsg_flags for new commands Commit 9c5d03d36251 ("genetlink: start to validate reserved header bytes") introduced extra validation for genetlink headers. We had to gate it to only apply to new commands, to maintain bug-wards compatibility. Use this opportunity (before the new checks make it to Linus's tree) to add more conditions. Validate that Generic Netlink families do not use nlmsg_flags outside of the well-understood set. Link: https://lore.kernel.org/all/20220928073709.1b93b74a@kernel.org/ Reviewed-by: Johannes Berg Acked-by: Nikolay Aleksandrov Reviewed-by: Nicolas Dichtel Reviewed-by: Guillaume Nault Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20220929142809.1167546-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9c59a01caba26ec06fefd6ca1f22d5fd1de57d63 Author: Miaoqian Lin Date: Thu Jun 2 07:08:36 2022 +0400 clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe pm_runtime_get_sync() will increment pm usage counter. Forgetting to putting operation will result in reference leak. Add missing pm_runtime_put_sync in some error paths. Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220602030838.52057-1-linmq006@gmail.com Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 48c5e98fedd9e0b164df4de592fd740537ead9e2 Author: Alex Helms Date: Mon Sep 12 11:36:13 2022 -0700 clk: Renesas versaclock7 ccf device driver Renesas Versaclock7 is a family of configurable clock generator ICs with fractional and integer dividers. This driver has basic support for the RC21008A device, a clock synthesizer with a crystal input and 8 outputs. The supports changing the FOD and IOD rates, and each output can be gated. Signed-off-by: Alex Helms Link: https://lore.kernel.org/r/20220912183613.22213-3-alexander.helms.jy@renesas.com Tested-by: Saeed Nowshadi Signed-off-by: Stephen Boyd commit 09d1855656dad04127aee195baf2eedae029175d Author: Alex Helms Date: Mon Sep 12 11:36:12 2022 -0700 dt-bindings: Renesas versaclock7 device tree bindings Renesas Versaclock7 is a family of configurable clock generator ICs with fractional and integer dividers. This driver has basic support for the RC21008A device, a clock synthesizer with a crystal input and 8 outputs. The supports changing the FOD and IOD rates, and each output can be gated. Signed-off-by: Alex Helms Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220912183613.22213-2-alexander.helms.jy@renesas.com Tested-by: Saeed Nowshadi [sboyd@kernel.org: Rename nodes in example to generic names] Signed-off-by: Stephen Boyd commit 6abf0dae8c3c927f54e62c46faf8aba580ba0d04 Author: Luiz Augusto von Dentz Date: Fri Sep 30 13:12:30 2022 -0700 Bluetooth: hci_sync: Fix not indicating power state When setting power state using legacy/non-mgmt API (e.g hcitool hci0 up) the likes of mgmt_set_powered_complete won't be called causing clients of the MGMT API to not be notified of the change of the state. Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Signed-off-by: Luiz Augusto von Dentz Tested-by: Tedd Ho-Jeong An commit 058a3996b888ab60eb1857fb4fd28f1b89a9a95a Author: Liang He Date: Thu Sep 15 11:11:21 2022 +0800 clk: ti: Balance of_node_get() calls for of_find_node_by_name() In ti_find_clock_provider(), of_find_node_by_name() will call of_node_put() for the 'from' argument, possibly putting the node one too many times. Let's maintain the of_node_get() from the previous search and only put when we're exiting the function early. This should avoid a misbalanced reference count on the node. Fixes: 51f661ef9a10 ("clk: ti: Add ti_find_clock_provider() to use clock-output-names") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220915031121.4003589-1-windhl@126.com [sboyd@kernel.org: Rewrite commit text, maintain reference instead of get again] Signed-off-by: Stephen Boyd commit 855ae87a2073ebf1b395e020de54fdf9ce7d166f Author: Lin Yujun Date: Wed Sep 14 11:32:06 2022 +0800 clk: imx: scu: fix memleak on platform_device_add() fails No error handling is performed when platform_device_add() fails. Add error processing before return, and modified the return value. Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support") Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220914033206.98046-1-linyujun809@huawei.com Signed-off-by: Stephen Boyd commit 01874fb2a3e60365d9cc68cd931ac9ad6e90025a Author: Lars-Peter Clausen Date: Tue Jul 19 11:46:37 2022 +0200 clk: vc5: Use regmap_{set,clear}_bits() where appropriate regmap_set_bits() and regmap_clear_bits() are variations of regmap_update_bits() that can be used if all bits of the mask have to be set to either 1 or 0 respectively. Update the versaclk driver to use regmap_set_bits() and regmap_clear_bits() where appropriate. This results in slightly more compact code and also makes the intention of the code clearer which can help with review. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220719094637.844946-2-lars@metafoo.de Reviewed-by: Luca Ceresoli Signed-off-by: Stephen Boyd commit cc3237827a21ca6fe29085a78f96b0509cf6d095 Author: Lars-Peter Clausen Date: Tue Jul 19 11:46:36 2022 +0200 clk: vc5: Check IO access results The devices of the versaclk clock generator family use an I2C control bus. IO access on an I2C bus can fail for various reasons. The driver currently ignores the return value of most IO operations. This results in silent failure. To avoid this check the return value and in case of an error abort the operation and propagate the error code to the caller. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220719094637.844946-1-lars@metafoo.de Reviewed-by: Luca Ceresoli Signed-off-by: Stephen Boyd commit 5f388bba7acbdb097a9e7ed932a39b40f7eb2acf Author: Magnus Karlsson Date: Thu Sep 29 11:01:33 2022 +0200 selftests/xsk: Fix double free Fix a double free at exit of the test suite. Fixes: a693ff3ed561 ("selftests/xsk: Add support for executing tests on physical device") Signed-off-by: Magnus Karlsson Signed-off-by: Andrii Nakryiko Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20220929090133.7869-1-magnus.karlsson@gmail.com commit 3ca2fb497440a3c8294f9df0ce7b2c3c9a1c5875 Author: Tianyi Liu Date: Wed Sep 28 16:09:32 2022 +0800 bpftool: Fix error message of strerror strerror() expects a positive errno, however variable err will never be positive when an error occurs. This causes bpftool to output too many "unknown error", even a simple "file not exist" error can not get an accurate message. This patch fixed all "strerror(err)" patterns in bpftool. Specially in btf.c#L823, hashmap__append() is an internal function of libbpf and will not change errno, so there's a little difference. Some libbpf_get_error() calls are kept for return values. Changes since v1: https://lore.kernel.org/bpf/SY4P282MB1084B61CD8671DFA395AA8579D539@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM/ Check directly for NULL values instead of calling libbpf_get_error(). Signed-off-by: Tianyi Liu Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/SY4P282MB1084AD9CD84A920F08DF83E29D549@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM commit 51e05a8cf8eb34da7473823b7f236a77adfef0b4 Author: Xin Liu Date: Fri Sep 30 17:07:08 2022 +0800 libbpf: Fix overrun in netlink attribute iteration I accidentally found that a change in commit 1045b03e07d8 ("netlink: fix overrun in attribute iteration") was not synchronized to the function `nla_ok` in tools/lib/bpf/nlattr.c, I think it is necessary to modify, this patch will do it. Signed-off-by: Xin Liu Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220930090708.62394-1-liuxin350@huawei.com commit d46adccb79668877fe4548a9cde83f9ad3c09e41 Author: Fabien Parent Date: Mon Aug 22 17:26:52 2022 +0200 clk: mediatek: add driver for MT8365 SoC Add clock drivers for MT8365 SoC. Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220822152652.3499972-5-msp@baylibre.com Reported-by: kernel test robot Signed-off-by: Stephen Boyd commit 083cc5e402c7eba818e5a4770c3ab1521bf6c341 Author: Markus Schneider-Pargmann Date: Mon Aug 22 17:26:51 2022 +0200 clk: mediatek: Export required common code symbols To make clk-mt8365 compilable as a module there are a few function symbols missing. This patch adds the required EXPORT_SYMBOL_GPL to the functions. Signed-off-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220822152652.3499972-4-msp@baylibre.com Signed-off-by: Stephen Boyd commit 2efcf695bfc0f078dd7d5d23d96a97db34c930d5 Author: Colin Ian King Date: Wed Sep 28 23:15:55 2022 +0100 selftests/bpf: Fix spelling mistake "unpriviledged" -> "unprivileged" There are a couple of spelling mistakes, one in a literal string and one in a comment. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220928221555.67873-1-colin.i.king@gmail.com commit 50e68b99049ac6e850da025c0aa0a6ce23189234 Author: Markus Schneider-Pargmann Date: Mon Aug 22 17:26:50 2022 +0200 clk: mediatek: Provide mtk_devm_alloc_clk_data Provide a helper that replaces the kzalloc with devm_kzalloc so error handling gets easier. Signed-off-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220822152652.3499972-3-msp@baylibre.com Reported-by: kernel test robot Signed-off-by: Stephen Boyd commit c61978175ac1337f028ac1f956666f16db84f4e5 Author: Fabien Parent Date: Mon Aug 22 17:26:49 2022 +0200 dt-bindings: clock: mediatek: add bindings for MT8365 SoC Add the clock bindings for the MediaTek MT8365 SoC. Signed-off-by: Fabien Parent Reviewed-by: Krzysztof Kozlowski Signed-off-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220822152652.3499972-2-msp@baylibre.com Signed-off-by: Stephen Boyd commit b59cc7fcbaebde52ed97f63c6c50e49b8dd5be37 Author: Deming Wang Date: Tue Sep 27 15:25:27 2022 -0400 samples/bpf: Fix typo in xdp_router_ipv4 sample Fix typo in xdp_router_ipv4 sample. Signed-off-by: Deming Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220927192527.8722-1-wangdeming@inspur.com commit d61876a2850faf0f07843ecf157a42a79e7e34a2 Author: Andy Shevchenko Date: Thu Jun 23 14:57:19 2022 +0300 clkdev: Simplify devm_clk_hw_register_clkdev() function Use devm_add_action_or_reset() instead of devres_alloc() and devres_add(), which works the same. This will simplify the code. There is no functional changes. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220623115719.52683-3-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd commit 07bdf48d3fee12268bf9a179821aee9b80f5239c Author: Andy Shevchenko Date: Thu Jun 23 14:57:18 2022 +0300 clkdev: Remove never used devm_clk_release_clkdev() For the entire history of the devm_clk_release_clkdev() existence (since 2018) it was never used. Remove it for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220623115719.52683-2-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd commit 1c8934b4802d2744c97e7c97d244af967f4bf141 Author: Andy Shevchenko Date: Thu Jun 23 14:57:17 2022 +0300 clk: Remove never used devm_of_clk_del_provider() For the entire history of the devm_of_clk_del_provider) existence (since 2017) it was never used. Remove it for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220623115719.52683-1-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd commit 1777cb60f7df80d9b4ca3385eca1d2c0bed61cb6 Author: Dom Cobley Date: Mon Aug 29 18:21:54 2022 +0300 clk: bcm: rpi: Add support for VEC clock Platform driver clk-bcm2835 gets an inaccurate clock for VEC (107MHz). Export VEC clock trough clk-raspberrypi which uses the right PLL to get an accurate 108MHz. Signed-off-by: Dom Cobley [iivanov: Adapted on top of v5.17-rc6] Signed-off-by: Ivan T. Ivanov Link: https://lore.kernel.org/r/20220829152154.147250-4-iivanov@suse.de Signed-off-by: Stephen Boyd commit 16baa8c1c1ba00506d367d00856c58f5985f9b2e Author: Ivan T. Ivanov Date: Mon Aug 29 18:21:53 2022 +0300 clk: bcm: rpi: Handle pixel clock in firmware The clk-bcm2835 handling of the pixel clock does not function correctly when the HDMI power domain is disabled. The firmware supports it correctly, so add it to the firmware clock driver. Acked-by: Maxime Ripard Acked-by: Dave Stevenson Signed-off-by: Ivan T. Ivanov Link: https://lore.kernel.org/r/20220829152154.147250-3-iivanov@suse.de Signed-off-by: Stephen Boyd commit 4c68a345c157db23a59edb8e3227932c00de83a1 Author: Ivan T. Ivanov Date: Mon Aug 29 18:21:52 2022 +0300 clk: bcm: rpi: Add support HEVC clock Export clock required for RPiVid video decoder hardware. Cc: Dom Cobley Acked-by: Maxime Ripard Signed-off-by: Ivan T. Ivanov Link: https://lore.kernel.org/r/20220829152154.147250-2-iivanov@suse.de Signed-off-by: Stephen Boyd commit 0b919a3728691c172312dee99ba654055ccd8c84 Author: Stefan Wahren Date: Sun Sep 4 16:10:37 2022 +0200 clk: bcm2835: fix bcm2835_clock_rate_from_divisor declaration The return value of bcm2835_clock_rate_from_divisor is always unsigned and also all caller expect this. So fix the declaration accordingly. Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20220904141037.38816-1-stefan.wahren@i2se.com Reviewed-by: Ivan T. Ivanov Reviewed-by: Florian Fainelli Signed-off-by: Stephen Boyd commit f690a4d7a8f66430662975511c86819dc9965bcc Author: Ivan T. Ivanov Date: Mon Sep 12 11:13:04 2022 +0300 clk: bcm2835: Round UART input clock up It was reported that RPi3[1] and RPi Zero 2W boards have issues with the Bluetooth. It turns out that when switching from initial to operation speed host and device no longer can talk each other because host uses incorrect UART baud rate. The UART driver used in this case is amba-pl011. Original fix, see below Github link[2], was inside pl011 module, but somehow it didn't look as the right place to fix. Beside that this original rounding function is not exactly perfect for all possible clock values. So I deiced to move the hack to the platform which actually need it. The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a clock manager that returns the actual frequencies, an expected 48MHz clock is reported as 47999625. If the requested baud rate == requested clock/16, there is no headroom and the slight reduction in actual clock rate results in failure. If increasing a clock by less than 0.1% changes it from ..999.. to ..000.., round it up. [1] https://bugzilla.suse.com/show_bug.cgi?id=1188238 [2] https://github.com/raspberrypi/linux/commit/ab3f1b39537f6d3825b8873006fbe2fc5ff057b7 Cc: Phil Elwell Signed-off-by: Ivan T. Ivanov Reviewed-by: Stefan Wahren Link: https://lore.kernel.org/r/20220912081306.24662-1-iivanov@suse.de Signed-off-by: Stephen Boyd commit 6c5422851d8be8c7451e968fd2e6da41b6109e17 Author: Maxime Ripard Date: Mon Sep 26 10:45:09 2022 +0200 clk: bcm2835: Make peripheral PLLC critical When testing for a series affecting the VEC, it was discovered that turning off and on the VEC clock is crashing the system. It turns out that, when disabling the VEC clock, it's the only child of the PLLC-per clock which will also get disabled. The source of the crash is PLLC-per being disabled. It's likely that some other device might not take a clock reference that it actually needs, but it's unclear which at this point. Let's make PLLC-per critical so that we don't have that crash. Reported-by: Noralf Trønnes Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220926084509.12233-1-maxime@cerno.tech Reviewed-by: Stefan Wahren Acked-by: Noralf Trønnes Signed-off-by: Stephen Boyd commit 88269151be679b9accb2f1e73487eaeb9eae9e39 Author: Dmitry Torokhov Date: Thu Sep 29 17:32:49 2022 -0700 of: base: make of_device_compatible_match() accept const device node of_device_is_compatible() accepts const device node pointer, there is no reason why of_device_compatible_match() can't do the same. Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/YzY5MaU5N4A2st5R@google.com Signed-off-by: Rob Herring commit c4e05443b6d400ed026cef9107188899a6d5e632 Author: Serge Semin Date: Fri Sep 30 01:54:02 2022 +0300 clk: baikal-t1: Convert to platform device driver In accordance with the way the MIPS platform is normally design there are only six clock sources which need to be available on the kernel start in order to one end up booting correctly: + CPU PLL: needed by the r4k and MIPS GIC timer drivers. The former one is initialized by the arch code, while the later one is implemented in the mips-gic-timer.c driver as the OF-declared timer. + PCIe PLL: required as a parental clock source for the APB/timer domains. + APB clock: needed in order to access all the SoC CSRs at least for the timer OF-declared drivers. + APB Timer{0-2} clocks: these are the DW APB timers which drivers dw_apb_timer_of.c are implemented as the OF-declared timers. So as long as the clocks above are available early the kernel will normally work. Let's convert the Baikal-T1 CCU drivers to the platform device drivers keeping that in mind. Generally speaking the conversion isn't that complicated since the driver infrastructure has been designed as flexible enough for that. First we need to add a new PLL/Divider clock features flag which indicates the corresponding clock source as a basic one and that clock sources will be available on the kernel early boot stages. Second the internal PLL/Divider descriptors need to be initialized with -EPROBE_DEFER value as the corresponding clock source is unavailable at the early stages. They will be allocated and initialized on the Baikal-T1 clock platform driver probe procedure. Finally the already available PLL/Divider init functions need to be split up into two ones: init procedure performed in the framework of the OF-declared clock initialization (of_clk_init()), and the probe procedure called by the platform devices bus driver. Note the later method will just continue the system clocks initialization started in the former one. Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220929225402.9696-9-Sergey.Semin@baikalelectronics.ru [sboyd@kernel.org: Remove module things because the Kconfig is still bool] Signed-off-by: Stephen Boyd commit fa6bd541d786aa6db93bcddf23cea26fcfa859a3 Author: Serge Semin Date: Fri Sep 30 01:54:01 2022 +0300 clk: baikal-t1: Add DDR/PCIe directly controlled resets support Aside with a set of the trigger-like resets Baikal-T1 CCU provides two additional blocks with directly controlled reset signals. In particular it concerns DDR full and initial resets and various PCIe sub-domains resets. Let's add the direct reset assertion/de-assertion of the corresponding flags support into the Baikal-T1 CCU driver then. It will be required at least for the PCIe platform driver. Obviously the DDR controller isn't supposed to be fully reset in the kernel, so the corresponding controls are added just for the sake of the interface implementation completeness. Signed-off-by: Serge Semin Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/20220929225402.9696-8-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit c0cd3b1790df76049d1806100d6c744b757fe004 Author: Serge Semin Date: Fri Sep 30 01:54:00 2022 +0300 dt-bindings: clk: baikal-t1: Add DDR/PCIe reset IDs Aside with a set of the trigger-like resets Baikal-T1 CCU provides additional directly controlled reset signals for the DDR and PCIe controllers. As a preparation before adding these resets support to the kernel let's extent the Baikal-T1 CCU IDs list with the new IDs, which will be used to access the corresponding reset controls. Signed-off-by: Serge Semin Reviewed-by: Philipp Zabel Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220929225402.9696-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit 70fa895488a4ebdae8b2d08b4c84e164ef14696e Author: Serge Semin Date: Fri Sep 30 01:53:59 2022 +0300 clk: baikal-t1: Move reset-controls code into a dedicated module Before adding the directly controlled resets support it's reasonable to move the existing resets control functionality into a dedicated object for the sake of the CCU dividers clock driver simplification. After the new functionality was added clk-ccu-div.c would have got to a mixture of the weakly dependent clocks and resets methods. Splitting the methods up into the two objects will make the code easier to read and maintain. It shall also improve the code scalability (though hopefully we won't need this part that much in the future). The reset control functionality is now implemented in the framework of a single unit since splitting it up doesn't make much sense due to relatively simple reset operations. The ccu-rst.c has been designed to be looking like ccu-div.c or ccu-pll.c with two globally available methods for the sake of the code unification and better code readability. This commit doesn't provide any change in the CCU reset implementation semantics. As before the driver will support the trigger-like CCU resets only, which are responsible for the AXI-bus, APB-bus and SATA-ref blocks reset. The assert/de-assert-capable reset controls support will be added in the next commit. Note the CCU Clock dividers and resets functionality split up was possible due to not having any side-effects (at least we didn't found ones) of the regmap-based concurrent access of the common CCU dividers/reset CSRs. Signed-off-by: Serge Semin Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/20220929225402.9696-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit 081a9b7c74eae4e12b2cb1b86720f836a8f29247 Author: Serge Semin Date: Fri Sep 30 01:53:58 2022 +0300 clk: baikal-t1: Add SATA internal ref clock buffer It turns out the internal SATA reference clock signal will stay unavailable for the SATA interface consumer until the buffer on it's way is ungated. So aside with having the actual clock divider enabled we need to ungate a buffer placed on the signal way to the SATA controller (most likely some rudiment from the initial SoC release). Seeing the switch flag is placed in the same register as the SATA-ref clock divider at a non-standard ffset, let's implement it as a separate clock controller with the set-rate propagation to the parental clock divider wrapper. As such we'll be able to disable/enable and still change the original clock source rate. Fixes: 353afa3a8d2e ("clk: Add Baikal-T1 CCU Dividers driver") Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220929225402.9696-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit e2eef312762e0b5a5a70d29fe59a245c0a3cffa0 Author: Serge Semin Date: Fri Sep 30 01:53:57 2022 +0300 clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent Baikal-T1 CCU reference manual says that both xGMAC reference and xGMAC PTP clocks are generated by two different wrappers with the same constant divider thus each producing a 156.25 MHz signal. But for some reason both of these clock sources are gated by a single switch-flag in the CCU registers space - CCU_SYS_XGMAC_BASE.BIT(0). In order to make the clocks handled independently we need to define a shared parental gate so the base clock signal would be switched off only if both of the child-clocks are disabled. Note the ID is intentionally set to -2 since we are going to add a one more internal clock identifier in the next commit. Fixes: 353afa3a8d2e ("clk: Add Baikal-T1 CCU Dividers driver") Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220929225402.9696-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit 3c742088686ce922704aec5b11d09bcc5a396589 Author: Serge Semin Date: Fri Sep 30 01:53:56 2022 +0300 clk: baikal-t1: Fix invalid xGMAC PTP clock divider Most likely due to copy-paste mistake the divider has been set to 10 while according to the SoC reference manual it's supposed to be 8 thus having PTP clock frequency of 156.25 MHz. Fixes: 353afa3a8d2e ("clk: Add Baikal-T1 CCU Dividers driver") Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220929225402.9696-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit c388cc804016cf0f65afdc2362b120aa594ff3e6 Author: Serge Semin Date: Fri Sep 30 01:53:55 2022 +0300 clk: vc5: Fix 5P49V6901 outputs disabling when enabling FOD We have discovered random glitches during the system boot up procedure. The problem investigation led us to the weird outcomes: when none of the Renesas 5P49V6901 ports are explicitly enabled by the kernel driver, the glitches disappeared. It was a mystery since the SoC external clock domains were fed with different 5P49V6901 outputs. The driver code didn't seem like bogus either. We almost despaired to find out a root cause when the solution has been found for a more modern revision of the chip. It turned out the 5P49V6901 clock generator stopped its output for a short period of time during the VC5_OUT_DIV_CONTROL register writing. The same problem was found for the 5P49V6965 revision of the chip and was successfully fixed in commit fc336ae622df ("clk: vc5: fix output disabling when enabling a FOD") by enabling the "bypass_sync" flag hidden inside "Unused Factory Reserved Register". Even though the 5P49V6901 registers description and programming guide doesn't provide any intel regarding that flag, setting it up anyway in the officially unused register completely eliminated the denoted glitches. Thus let's activate the functionality submitted in commit fc336ae622df ("clk: vc5: fix output disabling when enabling a FOD") for the Renesas 5P49V6901 chip too in order to remove the ports implicit inter-dependency. Fixes: dbf6b16f5683 ("clk: vc5: Add support for IDT VersaClock 5P49V6901") Signed-off-by: Serge Semin Reviewed-by: Luca Ceresoli Link: https://lore.kernel.org/r/20220929225402.9696-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Stephen Boyd commit 2ade1cd95b8d4cedc0eeacac1998a441fa285ab6 Merge: 5a8921ba96cea f95a479797dc2 Author: Andrii Nakryiko Date: Fri Sep 30 14:08:26 2022 -0700 Merge branch 'tools: bpftool: Remove unused struct' Yuan Can says: ==================== This series contains two cleanup patches, remove unused struct. ==================== Signed-off-by: Andrii Nakryiko commit f95a479797dc2c65fdf2809a7c388e7a9e2bc853 Author: Yuan Can Date: Wed Sep 28 09:04:40 2022 +0000 bpftool: Remove unused struct event_ring_info After commit 9b190f185d2f ("tools/bpftool: switch map event_pipe to libbpf's perf_buffer"), struct event_ring_info is not used any more and can be removed as well. Signed-off-by: Yuan Can Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220928090440.79637-3-yuancan@huawei.com commit d863f42930db35e82f47e4b4c78531a2b8d396ae Author: Yuan Can Date: Wed Sep 28 09:04:39 2022 +0000 bpftool: Remove unused struct btf_attach_point After commit 2828d0d75b73 ("bpftool: Switch to libbpf's hashmap for programs/maps in BTF listing"), struct btf_attach_point is not used anymore and can be removed as well. Signed-off-by: Yuan Can Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220928090440.79637-2-yuancan@huawei.com commit 3475c885480817c9e340fb75b9f6e31b19331ba9 Author: Yang Yingliang Date: Tue Sep 13 11:22:28 2022 +0800 clk: davinci: cfgchip: Use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220913032228.985852-1-yangyingliang@huawei.com Reviewed-by: David Lechner Signed-off-by: Stephen Boyd commit 225bb79123ea7ecd555a4992ff41414dd9cd604e Author: Jiangshan Yi Date: Mon Sep 5 14:58:33 2022 +0800 clk: davinci: pll: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Link: https://lore.kernel.org/r/20220905065833.1831473-1-13667453960@163.com Reviewed-by: David Lechner Signed-off-by: Stephen Boyd commit e488db982c67327fa2cc70312a27e23e91efa620 Author: Lukas Bulwahn Date: Wed Jul 20 13:00:26 2022 +0200 MAINTAINERS: add header file to TI DAVINCI SERIES CLOCK DRIVER While creating a patch submission on the davinci clock drivers, I noticed that the header file include/linux/clk/davinci.h belongs to the section TI DAVINCI SERIES CLOCK DRIVER. Add a file entry for this header file in TI DAVINCI SERIES CLOCK DRIVER. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220720110026.9173-1-lukas.bulwahn@gmail.com Reviewed-by: David Lechner Signed-off-by: Stephen Boyd commit 5a8921ba96ceaec0c00c8855e48940d2739c5c3b Author: Dave Thaler Date: Tue Sep 27 18:59:48 2022 +0000 bpf, docs: Add TOC and fix formatting. Add TOC and fix formatting. Signed-off-by: Dave Thaler Link: https://lore.kernel.org/r/20220927185958.14995-5-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov commit ee159bdbdbce293e66d7b9249208f367faff5d81 Author: Dave Thaler Date: Tue Sep 27 18:59:47 2022 +0000 bpf, docs: Add Clang note about BPF_ALU Add Clang note about BPF_ALU. Signed-off-by: Dave Thaler Link: https://lore.kernel.org/r/20220927185958.14995-4-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov commit 6c7aaffb24efbd5d1ae067b2b629b3ffcc37e18e Author: Dave Thaler Date: Tue Sep 27 18:59:46 2022 +0000 bpf, docs: Move Clang notes to a separate file Move Clang notes to a separate file. Signed-off-by: Dave Thaler Link: https://lore.kernel.org/r/20220927185958.14995-3-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov commit 9a0bf21337c667375d918adc41239ce54304a12c Author: Dave Thaler Date: Tue Sep 27 18:59:45 2022 +0000 bpf, docs: Linux byteswap note Add Linux byteswap note. Signed-off-by: Dave Thaler Link: https://lore.kernel.org/r/20220927185958.14995-2-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov commit 6166da0a02cde26c065692d0c05eb685178fee75 Author: Dave Thaler Date: Tue Sep 27 18:59:44 2022 +0000 bpf, docs: Move legacy packet instructions to a separate file Move legacy packet instructions to a separate file. Signed-off-by: Dave Thaler Link: https://lore.kernel.org/r/20220927185958.14995-1-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov commit e11a47f52098dc88d82c2a22f165ac9f4f7a5997 Author: Doug Brown Date: Sun Jun 12 12:29:37 2022 -0700 clk: mmp: pxa168: control shared SDH bits with separate clock The PXA168 has a peculiar setup with the AXI clock enable control for the SDHC controllers. The bits in the SDH0 register control the AXI clock enable for both SDH0 and SDH1. Likewise, the bits in the SDH2 register control both SDH2 and SDH3. This is modeled with two new parentless clocks that control the shared bits. Previously, SDH0 had to be enabled in order for SDH1 to be used, and when SDH1 was enabled, unused bits in the SDH1 register were being controlled. This fixes those issues. A future commit will add support for these new shared clocks to be enabled by the PXA168 SDHC driver. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-13-doug@schmorgal.com Signed-off-by: Stephen Boyd commit 238e73edcea557b1aef35113cf4333b41ebe35d9 Author: Doug Brown Date: Sun Jun 12 12:29:36 2022 -0700 dt-bindings: marvell,pxa168: add clock ids for SDH AXI clocks These are clocks shared by SDH0/1 and SDH2/3, respectively. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-12-doug@schmorgal.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 69ec86917c00b035b56e86d6a453940943f975da Author: Doug Brown Date: Sun Jun 12 12:29:35 2022 -0700 clk: mmp: pxa168: add clocks for SDH2 and SDH3 The PXA168 has four SDHC peripherals. This commit adds the last two. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-11-doug@schmorgal.com Signed-off-by: Stephen Boyd commit ca41820b9d569d92162ee470610564ec6bc5012c Author: Doug Brown Date: Sun Jun 12 12:29:34 2022 -0700 dt-bindings: marvell,pxa168: add clock id for SDH3 There are four SDHC peripherals on the PXA168, but only three of them were present in the DT bindings. This commit adds the fourth. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-10-doug@schmorgal.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit d4161f7e7358eb3f20e6b82fa2ace19712ea5e6e Author: Doug Brown Date: Sun Jun 12 12:29:33 2022 -0700 clk: mmp: pxa168: fix GPIO clock enable bits According to the datasheet, only bit 0 of APBC_GPIO should be controlled for the clock enable. Bit 1 is marked as reserved (always write 0). Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-9-doug@schmorgal.com Signed-off-by: Stephen Boyd commit 7fad6b755fcb5fd4fe9127662cf41eb84d02fdb8 Author: Doug Brown Date: Sun Jun 12 12:29:32 2022 -0700 clk: mmp: pxa168: add muxes for more peripherals The TWSI, KPC, PWM, and DFC peripherals didn't have their muxes modeled in the code, but the PXA168 datasheet shows that they are indeed muxed: - TWSI can be 31.2 MHz or 62.4 MHz - KPC can be 32 kHz, 16 kHz, or 26 MHz - PWM can be 13 MHz or 32 kHz - DFC can be 156 MHz or 78 MHz Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-8-doug@schmorgal.com Signed-off-by: Stephen Boyd commit 30c0368207b1efa3bbcafcdca0b1749a375f86e3 Author: Doug Brown Date: Sun Jun 12 12:29:31 2022 -0700 clk: mmp: pxa168: fix incorrect parent clocks The UART, SDHC, LCD, and CCIC peripherals' muxed parent clocks didn't match the information provided by the PXA168 datasheet: - The UART clocks can be 58.5 MHz or the UART PLL. Previously, the first mux option was being calculated as 117 MHz, confirmed on hardware to be incorrect. - The SDHC clocks can be 48 MHz, 52 MHz, or 78 MHz. Previously, 48 MHz and 52 MHz were swapped. 78 MHz wasn't listed as an option. - The LCD clock can be 624 MHz or 312 Mhz. Previously, it was being calculated as 312 MHz or 52 MHz. - The CCIC clock can be 156 MHz or 78 MHz. Previously, it was being calculated as 312 MHz or 52 MHz. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-7-doug@schmorgal.com Signed-off-by: Stephen Boyd commit e2fd64dd472bea0da332da0cc8e8946d2d3294c4 Author: Doug Brown Date: Sun Jun 12 12:29:30 2022 -0700 clk: mmp: pxa168: fix const-correctness While working on this series of patches, checkpatch recommended that an extra const should be added to the mux parent arrays. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-6-doug@schmorgal.com Signed-off-by: Stephen Boyd commit ac1d62c948d063ec99b3b23d02af8260bba4660c Author: Doug Brown Date: Sun Jun 12 12:29:29 2022 -0700 clk: mmp: pxa168: add new clocks for peripherals This commit adds three new clocks that previously didn't exist, but are needed in order to match the clock parenting as described in the PXA168 datasheet. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-5-doug@schmorgal.com Signed-off-by: Stephen Boyd commit 260d2f347b765422584a5fa5209b8ecd17d773b4 Author: Doug Brown Date: Sun Jun 12 12:29:28 2022 -0700 dt-bindings: marvell,pxa168: add clock ids for additional dividers This adds a few new clocks divided from PLL1 and CLK32 that are potentially used by a few peripherals with muxed clocks. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-4-doug@schmorgal.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit a77a1e2f1b00ec3385523283b8fcbd56ed166797 Author: Doug Brown Date: Sun Jun 12 12:29:27 2022 -0700 clk: mmp: pxa168: fix incorrect dividers These two clocks had multipliers and dividers that didn't match their names. A subsequent commit goes through all of the existing peripherals and ensure the correct clocks are being used everywhere. Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-3-doug@schmorgal.com Signed-off-by: Stephen Boyd commit a5ff3d8c85ab3c5677e2b4bba3cc1f0068063e5d Author: Doug Brown Date: Sun Jun 12 12:29:26 2022 -0700 clk: mmp: pxa168: add additional register defines In preparation for adding additional peripherals over time, this commit adds a bunch of extra APBC_* defines based on information from the datasheet. It also reorganizes the list of defines to be ordered sequentially by address (grouped by type). Signed-off-by: Doug Brown Link: https://lore.kernel.org/r/20220612192937.162952-2-doug@schmorgal.com Signed-off-by: Stephen Boyd commit f1ad5338a4d57fe1fe6475003acb8c70bf9d1bdf Author: Robin Murphy Date: Thu Sep 29 13:48:38 2022 +0100 of: Fix "dma-ranges" handling for bus controllers Commit 951d48855d86 ("of: Make of_dma_get_range() work on bus nodes") relaxed the handling of "dma-ranges" for any leaf node on the assumption that it would still represent a usage error for the property to be present on a non-bus leaf node. However there turns out to be a fiddly case where a bus also represents a DMA-capable device in its own right, such as a PCIe root complex with an integrated DMA engine on its platform side. In such cases, "dma-ranges" translation is entirely valid for devices discovered behind the bus, but should not be erroneously applied to the bus controller device itself which operates in its parent's address space. Fix this by restoring the previous behaviour for the specific case where a device is configured via its own OF node, since it is logical to assume that a device should never represent its own parent bus. Reported-by: Serge Semin Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/112e8f3d3e7c054ecf5e12b5ac0aa5596ec00681.1664455433.git.robin.murphy@arm.com Signed-off-by: Rob Herring commit 4e37057387cca749b7fbc8c77e3d86605117fffd Author: Khalid Masum Date: Wed Sep 28 10:00:58 2022 +0600 Documentation: Kunit: Use full path to .kunitconfig The numbered list contains full path to every files that need to be modified or created in order to implement misc-example kunit test. Except for .kunitconfig. Which might make a newcommer confused about where the file exists. Since there are multiple .kunitconfig files. Fix this by using the full path to .kunitconfig. Signed-off-by: Khalid Masum Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 980ac3ad051215150b637e26f3f46873687909a9 Author: Daniel Latypov Date: Fri Sep 2 13:22:48 2022 -0700 kunit: tool: rename all_test_uml.config, use it for --alltests Context: 1. all_tests_uml.config used to be UML specific back when users to manually specify CONFIG_VIRTIO_UML=y to enable CONFIG_PCI=y. 2. --alltests used allyesconfig along with a curated list of options to disable. It's only ever worked for brief periods of time and has perennially been broken due to compile issues. Now all_tests_uml.config should work across ~all architectures. Let's instead use this to implement --alltests. Note: if anyone was using all_tests_uml.config, this change breaks them. I think that's unlikely since it was added in 5.19 and was a lot to type: --kunitconfig=tools/testing/kunit/configs/all_tests_uml.config. We could make it a symlink to the new name, but I don't think the caution is warranted here. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit cb8a7d5340a3b1ad3f9099f9fbd7fa4e2309e83b Author: Daniel Latypov Date: Fri Sep 2 13:22:47 2022 -0700 kunit: tool: remove UML specific options from all_tests_uml.config Commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML") made it so we enable these options by default for UML. Specifying them here is now redundant. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit af3bd36573e3686a82ebb79114cd9c9ccbd5374f Author: Cixi Geng Date: Fri Sep 9 23:24:21 2022 +0800 clk: sprd: Add clocks support for UMS512 Add the list of clocks for the Unisoc UMS512, along with clock initialization. Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220909152421.278662-3-gengcixi@gmail.com Reviewed-by: Baolin Wang Signed-off-by: Stephen Boyd commit 4bba2a04ef98b92f21eddb492d7602d6ded026cd Author: Tales Aparecida Date: Sun Aug 21 23:26:46 2022 -0300 lib: stackinit: update reference to kunit-tool Replace URL with an updated path to the full Documentation page Signed-off-by: Tales Aparecida Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 0f3f1123ac6e14a2c0a32f7a43163e6704beb74f Author: Tales Aparecida Date: Sun Aug 21 23:26:45 2022 -0300 lib: overflow: update reference to kunit-tool Replace URL with an updated path to the full Documentation page Signed-off-by: Tales Aparecida Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 79c18e37c4e645560f3952bf177a10b43e94bf88 Author: Tales Aparecida Date: Sun Aug 21 23:26:44 2022 -0300 Documentation: KUnit: update links in the index page Replace out-of-date external links with references to the kernel documentation, replacing TAP webpage for the more appropriate KTAP documentation and the UML webpage by its documentation. Signed-off-by: Tales Aparecida Reviewed-by: David Gow Signed-off-by: Shuah Khan commit deff8d2955aa045d7053a7770cdae9874af6f474 Author: Tales Aparecida Date: Sun Aug 21 23:26:43 2022 -0300 Documentation: KUnit: add intro to the getting-started page Describe the objective of the Getting Started page, which should be a brief and beginner-friendly walkthrough for running and writing tests, showing the reader where to find detailed instructions in other pages. Signed-off-by: Tales Aparecida Reviewed-by: Maíra Canal Reviewed-by:Sadiya Kazi Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 7a79b7df4e5122ae3b5b5f2bd5b52ecb1295398a Author: Tales Aparecida Date: Sun Aug 21 23:26:42 2022 -0300 Documentation: KUnit: Reword start guide for selecting tests Reword "Creating a ``.kunitconfig``" into "Selecting which tests to run" covering the current alternatives for editing configs and glob-filtering Signed-off-by: Tales Aparecida Reviewed-by: Maíra Canal Reviewed-by:Sadiya Kazi Reviewed-by: David Gow Signed-off-by: Shuah Khan commit c5b6c4ecbd95c8e56ef1350ab091e57e401b01fe Author: Tales Aparecida Date: Sun Aug 21 23:26:41 2022 -0300 Documentation: KUnit: add note about mrproper in start.rst The "Getting Started" guide should be beginner-friendly, therefore add a note about the requirement of a clean source tree when running kunit_tool for the first time, and its related error. Signed-off-by: Tales Aparecida Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 5ceb9a2558593658276854770f0d4e84fbcddf14 Author: Tales Aparecida Date: Sun Aug 21 23:26:40 2022 -0300 Documentation: KUnit: avoid repeating "kunit.py run" in start.rst Combine two sections mentioning "kunit.py run" to streamline the getting-started guide. Update "kunit.py run" expected output in the guide and run_wrapper. Signed-off-by: Tales Aparecida Reviewed-by: Maíra Canal Reviewed-by: Sadiya Kazi Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 2327f7e956bab3e25f472e8c9d0aa6380970a91a Author: Tales Aparecida Date: Sun Aug 21 23:26:39 2022 -0300 Documentation: KUnit: remove duplicated docs for kunit_tool Delete "kunit-tool.rst" to remove repeated info from KUnit docs. "What is kunit_tool?" was integrated into index.rst, the remaining sections were moved into run_wrapper.rst and renamed as follows: "What is a .kunitconfig?" -> "Creating a ``.kunitconfig`` file" "Getting Started with kunit_tool" -> "Running tests with kunit_tool" "Configuring, Building, and Running Tests" -> "Configuring, building, and running tests" "Running Tests on QEMU" -> "Running tests on QEMU" "Parsing Test Results" -> "Parsing test results" "Filtering Tests" -> "Filtering tests" "Other Useful Options" -> "Running command-line arguments" Signed-off-by: Tales Aparecida Reviewed-by: Sadiya Kazi Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 3920c725cbff5c6db69d7077716987a93b0e6a9a Author: Tales Aparecida Date: Sat Aug 13 01:20:55 2022 -0300 Documentation: Kunit: Add ref for other kinds of tests Add an organic link to the "other kinds of tests" in the index page Signed-off-by: Tales Aparecida Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 43ca52a910d15026b474160c2b625db5be687f51 Author: Tales Aparecida Date: Sat Aug 13 01:20:54 2022 -0300 Documentation: KUnit: Fix non-uml anchor The section was rewritten but its anchor got left behind. Fix the anchor and add some references to running on QEMU. Signed-off-by: Tales Aparecida Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 8ae4826363cedc84b6b4e18952a49793586fa92b Author: Tales Aparecida Date: Sat Aug 13 01:20:53 2022 -0300 Documentation: Kunit: Fix inconsistent titles Use the same wording when citing and describing Kunit parts. Signed-off-by: Tales Aparecida Reviewed-by: David Gow Reviewed-by: Sadiya Kazi Signed-off-by: Shuah Khan commit 7e2d619411cbcb5ee6c6e97a53dcba605d276f44 Author: Tales Aparecida Date: Sat Aug 13 01:20:52 2022 -0300 Documentation: kunit: fix trivial typo Missing closing block-quote Signed-off-by: Tales Aparecida Reviewed-by: David Gow Reviewed-by: Sadiya Kazi Signed-off-by: Shuah Khan commit 7d97635b72813d80f909ad24d7a64b2fe9a29c0b Author: Joe Fradley Date: Tue Aug 23 07:24:55 2022 -0700 kunit: no longer call module_info(test, "Y") for kunit modules Because KUnit test execution is not a guarantee with the kunit.enable parameter we want to be careful to only taint the kernel when actual tests run. Calling module_info(test, "Y") for every KUnit module automatically causes the kernel to be tainted upon module load. Therefore, we're removing this call and relying on the KUnit framework to taint the kernel or not. Signed-off-by: Joe Fradley Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit d20a6ba5e3be5f8d9002c6c5a5d4dfecc5dc48f9 Author: Joe Fradley Date: Tue Aug 23 07:24:54 2022 -0700 kunit: add kunit.enable to enable/disable KUnit test This patch adds the kunit.enable module parameter that will need to be set to true in addition to KUNIT being enabled for KUnit tests to run. The default value is true giving backwards compatibility. However, for the production+testing use case the new config option KUNIT_DEFAULT_ENABLED can be set to N requiring the tester to opt-in by passing kunit.enable=1 to the kernel. Signed-off-by: Joe Fradley Reviewed-by: David Gow Signed-off-by: Shuah Khan commit a15cfa39e8cf9bb20d755978c2f25a9c427bf7b2 Author: Daniel Latypov Date: Wed Aug 10 16:02:58 2022 -0700 kunit: tool: make --raw_output=kunit (aka --raw_output) preserve leading spaces With $ kunit.py run --raw_output=all ... you get the raw output from the kernel, e.g. something like > TAP version 14 > 1..26 > # Subtest: time_test_cases > 1..1 > ok 1 - time64_to_tm_test_date_range > ok 1 - time_test_cases But --raw_output=kunit or equivalently --raw_output, you get > TAP version 14 > 1..26 > # Subtest: time_test_cases > 1..1 > ok 1 - time64_to_tm_test_date_range > ok 1 - time_test_cases It looks less readable in my opinion, and it also isn't "raw output." This is due to sharing code with kunit_parser.py, which wants to strip leading whitespace since it uses anchored regexes. We could update the kunit_parser.py code to tolerate leaading spaces, but this patch takes the easier way out and adds a bool flag. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Signed-off-by: Shuah Khan commit e996c7e01892ac18ec0db447294d4f591c325efe Merge: c77f54a9bcecb a1cf1fd62ae71 562163595a912 018d6711c26e4 6cc401be16482 Author: Rafael J. Wysocki Date: Fri Sep 30 20:52:39 2022 +0200 Merge branches 'acpi-properties', 'acpi-tables', 'acpi-x86' and 'acpi-soc' Merge changes related to ACPI data-only tables handling and ACPI device properties management, x86-specific ACPI code changes and ACPI SoC driver changes for 6.1-rc1: - Clean up the ACPI LPSS (Intel SoC) driver (Andy Shevchenko). - Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable (Mario Limonciello). - Drop unused dev_fmt() and redundant 'HMAT' prefix from the HMAT parsing code (Liu Shixin). - Make ACPI FPDT parsing code avoid calling acpi_os_map_memory() on invalid physical addresses (Hans de Goede). - Silence missing-declarations warning related to Apple device properties management (Lukas Wunner). * acpi-properties: ACPI: property: Silence missing-declarations warning in apple.c * acpi-tables: ACPI: HMAT: Drop unused dev_fmt() and redundant 'HMAT' prefix ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address * acpi-x86: ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable * acpi-soc: ACPI: LPSS: Deduplicate skipping device in acpi_lpss_create_device() ACPI: LPSS: Replace loop with first entry retrieval commit 6cc401be16482bf35522c328be395507e331f9df Author: Andy Shevchenko Date: Mon Aug 29 17:11:29 2022 +0300 ACPI: LPSS: Deduplicate skipping device in acpi_lpss_create_device() Add a new label to deduplicate skipping device code in the acpi_lpss_create_device(). No functional change intended. While at it, convert the last conditional to use the classical pattern, i.e. if (err) ...handle err... Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit da13b3361bb609f5e3fde3f57b8e2b42001513a3 Author: Andy Shevchenko Date: Mon Aug 29 17:11:28 2022 +0300 ACPI: LPSS: Replace loop with first entry retrieval After the commit 6505e452371d ("ACPI: LPSS: Use the helper acpi_dev_get_memory_resources()") the list is empty or contains only resource of IORESOURCE_MEM type. Hence, no need to check for the type, and since we break after the first found, no need to iterate over full list. That said, replace loop with first entry retrieval. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit c77f54a9bcecb844db284de1ba0c7dc0c7796510 Merge: d61991db685f9 c78c43fe7d425 fe79e392cf08a 2814108cbf54c Author: Rafael J. Wysocki Date: Fri Sep 30 20:28:22 2022 +0200 Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' Merge changes related to ACPI device enumeration and ACPI support for platform devices for 6.1-rc1: - Clean up ACPI platform devices support code (Andy Shevchenko, John Garry). - Clean up ACPI bus management code (Andy Shevchenko, ye xingchen). - Add support for multiple DMA windows with different offsets to the ACPI device enumeration code and use it on LoongArch (Jianmin Lv). * acpi-scan: LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA ACPI: scan: Support multiple DMA windows with different offsets * acpi-bus: ACPI: bus: Refactor ACPI matching functions for better readability ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() ACPI: bus: Remove the unneeded result variable * acpi-platform: ACPI: platform: Use PLATFORM_DEVID_NONE in acpi_create_platform_device() ACPI: platform: Sort forbidden_id_list[] in ascending order ACPI: platform: Use sizeof(*pointer) instead of sizeof(type) ACPI: platform: Remove redundant print on -ENOMEM ACPI: platform: Get rid of redundant 'else' commit d61991db685f96d9028e03742ec59060378c5c61 Merge: 80487a37def2a 6e5cbe7c4b418 54bd1e5487016 Author: Rafael J. Wysocki Date: Fri Sep 30 20:17:02 2022 +0200 Merge branches 'acpi-resource' and 'acpi-pm' Merge ACPI resource management and ACPI power management chages for 6.1-rc1: - Filter out non-memory resources in is_memory(), add a helper function to find all memory type resources of an ACPI device object and use that function in 3 places (Heikki Krogerus). - Add IRQ override quirks for Asus Vivobook K3402ZA/K3502ZA and ASUS model S5402ZA (Tamim Khan, Kellen Renshaw). - Fix acpi_dev_state_d0() kerneldoc (Sakari Ailus). - Fix up suspend-to-idle support on ASUS Rembrandt laptops (Mario Limonciello). * acpi-resource: ACPI: resource: Add ASUS model S5402ZA to quirks usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() ACPI: resource: Skip IRQ override on Asus Vivobook K3402ZA/K3502ZA ACPI: LPSS: Use the helper acpi_dev_get_memory_resources() ACPI: APD: Use the helper acpi_dev_get_memory_resources() ACPI: resource: Add helper function acpi_dev_get_memory_resources() ACPI: resource: Filter out the non memory resources in is_memory() * acpi-pm: ACPI: x86: s2idle: Add another ID to s2idle_dmi_table ACPI: x86: s2idle: Fix a NULL pointer dereference ACPI: x86: s2idle: Add a quirk for ASUSTeK COMPUTER INC. ROG Flow X13 ACPI: x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7 ACPI: x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14 ACPI: x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE ACPI: x86: s2idle: Add module parameter to prefer Microsoft GUID ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt ACPI: x86: s2idle: Move _HID handling for AMD systems into structures ACPI: PM: Fix acpi_dev_state_d0() kerneldoc commit 80487a37def2a75f083388cf6e811bff9b6140df Merge: 63f534b8bad91 2a5a191c67ba4 Author: Rafael J. Wysocki Date: Fri Sep 30 20:05:16 2022 +0200 Merge branch 'acpi-dev' Merge changes regarding the management of ACPI device objects for 6.1-rc1: - Rename ACPI device object reference counting functions (Rafael Wysocki). - Rearrange ACPI device object initialization code (Rafael Wysocki). - Drop parent field from struct acpi_device (Rafael Wysocki). - Extend the the int3472-tps68470 driver to support multiple consumers of a single TPS68470 along with the requisite framework-level support (Daniel Scally). * acpi-dev: platform/x86: int3472: Add board data for Surface Go2 IR camera platform/x86: int3472: Support multiple gpio lookups in board data platform/x86: int3472: Support multiple clock consumers ACPI: bus: Add iterator for dependent devices ACPI: scan: Add acpi_dev_get_next_consumer_dev() ACPI: property: Use acpi_dev_parent() ACPI: Drop redundant acpi_dev_parent() header ACPI: PM: Fix NULL argument handling in acpi_device_get/set_power() ACPI: Drop parent field from struct acpi_device ACPI: scan: Eliminate __acpi_device_add() ACPI: scan: Rearrange initialization of ACPI device objects ACPI: scan: Rename acpi_bus_get_parent() and rearrange it ACPI: Rename acpi_bus_get/put_acpi_device() commit f423fa1bc9fe1978e6b9f54927411b62cb43eb04 Author: Jason Gunthorpe Date: Thu Sep 29 14:48:35 2022 -0300 drm/i915/gvt: Add missing vfio_unregister_group_dev() call When converting to directly create the vfio_device the mdev driver has to put a vfio_register_emulated_iommu_dev() in the probe() and a pairing vfio_unregister_group_dev() in the remove. This was missed for gvt, add it. Cc: stable@vger.kernel.org Fixes: 978cf586ac35 ("drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev") Reported-by: Alex Williamson Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/0-v1-013609965fe8+9d-vfio_gvt_unregister_jgg@nvidia.com Signed-off-by: Alex Williamson commit 82b1ec794d701478381482264f3bfada3a7bf2d9 Author: Sumeet Pawnikar Date: Tue Sep 27 21:17:09 2022 +0530 thermal: core: Increase maximum number of trip points On one of the Chrome system, if we define more than 12 trip points, probe for thermal sensor fails with "int3403 thermal: probe of INTC1046:03 failed with error -22" and throws an error as "thermal_sys: Error: Incorrect number of thermal trips". The thermal_zone_device_register() interface needs maximum number of trip points supported in a zone as an argument. This number can't exceed THERMAL_MAX_TRIPS, which is currently set to 12. To address this issue, THERMAL_MAX_TRIPS value has to be increased. This interface also has an argument to specify a mask of trips which are writable. This mask is defined as an int. This mask sets the ceiling for increasing maximum number of supported trips. With the current implementation, maximum number of trips can be supported is 31. Also, THERMAL_MAX_TRIPS macro is used in one place only. So, remove THERMAL_MAX_TRIPS macro and compare num_trips directly with using a macro BITS_PER_TYPE(int)-1. Signed-off-by: Sumeet Pawnikar Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit bab715bdaa9ebf28d99a6d1efb2704a30125e96d Author: Orlando Chamberlain Date: Thu Sep 29 11:49:56 2022 +0000 efi: Correct Macmini DMI match in uefi cert quirk It turns out Apple doesn't capitalise the "mini" in "Macmini" in DMI, which is inconsistent with other model line names. Correct the capitalisation of Macmini in the quirk for skipping loading platform certs on T2 Macs. Currently users get: ------------[ cut here ]------------ [Firmware Bug]: Page fault caused by firmware at PA: 0xffffa30640054000 WARNING: CPU: 1 PID: 8 at arch/x86/platform/efi/quirks.c:735 efi_crash_gracefully_on_page_fault+0x55/0xe0 Modules linked in: CPU: 1 PID: 8 Comm: kworker/u12:0 Not tainted 5.18.14-arch1-2-t2 #1 4535eb3fc40fd08edab32a509fbf4c9bc52d111e Hardware name: Apple Inc. Macmini8,1/Mac-7BA5B2DFE22DDD8C, BIOS 1731.120.10.0.0 (iBridge: 19.16.15071.0.0,0) 04/24/2022 Workqueue: efi_rts_wq efi_call_rts ... ---[ end trace 0000000000000000 ]--- efi: Froze efi_rts_wq and disabled EFI Runtime Services integrity: Couldn't get size: 0x8000000000000015 integrity: MODSIGN: Couldn't get UEFI db list efi: EFI Runtime Services are disabled! integrity: Couldn't get size: 0x8000000000000015 integrity: Couldn't get UEFI dbx list Fixes: 155ca952c7ca ("efi: Do not import certificates from UEFI Secure Boot for T2 Macs") Cc: stable@vger.kernel.org Cc: Aditya Garg Tested-by: Samuel Jiang Signed-off-by: Orlando Chamberlain Signed-off-by: Mimi Zohar commit 915b96c52763e2988e6368b538b487a7138b8fa4 Merge: 6690c2c4c4eaa 2fc6de5c6924a Author: Jakub Kicinski Date: Fri Sep 30 10:07:30 2022 -0700 Merge tag 'wireless-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.1 Few stack changes and lots of driver changes in this round. brcmfmac has more activity as usual and it gets new hardware support. ath11k improves WCN6750 support and also other smaller features. And of course changes all over. Note: in early September wireless tree was merged to wireless-next to avoid some conflicts with mac80211 patches, this shouldn't cause any problems but wanted to mention anyway. Major changes: mac80211 - refactoring and preparation for Wi-Fi 7 Multi-Link Operation (MLO) feature continues brcmfmac - support CYW43439 SDIO chipset - support BCM4378 on Apple platforms - support CYW89459 PCIe chipset rtw89 - more work to get rtw8852c supported - P2P support - support for enabling and disabling MSDU aggregation via nl80211 mt76 - tx status reporting improvements ath11k - cold boot calibration support on WCN6750 - Target Wake Time (TWT) debugfs support for STA interface - support to connect to a non-transmit MBSSID AP profile - enable remain-on-channel support on WCN6750 - implement SRAM dump debugfs interface - enable threaded NAPI on all hardware - WoW support for WCN6750 - support to provide transmit power from firmware via nl80211 - support to get power save duration for each client - spectral scan support for 160 MHz wcn36xx - add SNR from a received frame as a source of system entropy * tag 'wireless-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (231 commits) wifi: rtl8xxxu: Improve rtl8xxxu_queue_select wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM wifi: rtl8xxxu: gen2: Enable 40 MHz channel width wifi: rtw89: 8852b: configure DLE mem wifi: rtw89: check DLE FIFO size with reserved size wifi: rtw89: mac: correct register of report IMR wifi: rtw89: pci: set power cut closed for 8852be wifi: rtw89: pci: add to do PCI auto calibration wifi: rtw89: 8852b: implement chip_ops::{enable,disable}_bb_rf wifi: rtw89: add DMA busy checking bits to chip info wifi: rtw89: mac: define DMA channel mask to avoid unsupported channels wifi: rtw89: pci: mask out unsupported TX channels iwlegacy: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper wifi: iwlwifi: Track scan_cmd allocation size explicitly brcmfmac: Remove the call to "dtim_assoc" IOVAR brcmfmac: increase dcmd maximum buffer size brcmfmac: Support 89459 pcie brcmfmac: increase default max WOWL patterns to 16 cw1200: fix incorrect check to determine if no element is found in list ... ==================== Link: https://lore.kernel.org/r/20220930150413.A7984C433D6@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 70445dee1b4cf44c9fecc580dfa08079011866f1 Author: Kuogee Hsieh Date: Mon Sep 12 09:23:48 2022 -0700 drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CTRL register to 0 before start link training. At rare case that DP MSA timing parameters may be mis-interpreted by the sink which causes audio sampling rate be calculated wrongly and cause audio did not work at sink if DOWNSPREAD_CTRL register is not cleared to 0. Changes in v2: 1) fix spelling at commit text 2) merge ssc variable into encoding[0] Changes in v3: -- correct spelling of DOWNSPREAD_CTRL -- replace err with len of ssize_t Changes in v4: -- split into 2 patches Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Patchwork: https://patchwork.freedesktop.org/patch/502532/ Link: https://lore.kernel.org/r/1662999830-13916-2-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar commit 152d394842bb564148e68b92486a87db0bf54859 Author: Johan Hovold Date: Tue Sep 13 10:53:18 2022 +0200 drm/msm/hdmi: fix IRQ lifetime Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the HDMI IRQ, which will otherwise remain requested so that the next bind attempt fails when requesting the IRQ a second time. Fix this by tying the device-managed lifetime of the HDMI IRQ to the DRM device so that it is released when bind fails. Fixes: 067fef372c73 ("drm/msm/hdmi: refactor bind/init") Cc: stable@vger.kernel.org # 3.19 Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/502666/ Link: https://lore.kernel.org/r/20220913085320.8577-9-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 16194958f888d63839042d1190f7001e5ddec47b Author: Johan Hovold Date: Tue Sep 13 10:53:17 2022 +0200 drm/msm/dp: fix bridge lifetime Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the aggregate device when binding is later retried and a second attempt to allocate the resources is made. For the DP bridges, previously allocated bridges will leak on probe deferral. Fix this by amending the DP parser interface and tying the lifetime of the bridge device to the DRM device rather than DP platform device. Fixes: c3bf8e21b38a ("drm/msm/dp: Add eDP support via aux_bus") Cc: stable@vger.kernel.org # 5.19 Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/502667/ Link: https://lore.kernel.org/r/20220913085320.8577-8-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 2b57f726611e294dc4297dd48eb8c98ef1938e82 Author: Johan Hovold Date: Tue Sep 13 10:53:16 2022 +0200 drm/msm/dp: fix aux-bus EP lifetime Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the aggregate device when binding is later retried and a second attempt to allocate the resources is made. For the DP aux-bus, an attempt to populate the bus a second time will simply fail ("DP AUX EP device already populated"). Fix this by tying the lifetime of the EP device to the DRM device rather than DP controller platform device. Fixes: c3bf8e21b38a ("drm/msm/dp: Add eDP support via aux_bus") Cc: stable@vger.kernel.org # 5.19 Signed-off-by: Johan Hovold Reviewed-by: Douglas Anderson Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/502672/ Link: https://lore.kernel.org/r/20220913085320.8577-7-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit a79343dcaba4b11adb57350e0b6426906a9b658e Author: Johan Hovold Date: Tue Sep 13 10:53:15 2022 +0200 drm/msm/dp: fix IRQ lifetime Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the DP IRQ, which will otherwise remain requested so that the next bind attempt fails when requesting the IRQ a second time. Since commit c3bf8e21b38a ("drm/msm/dp: Add eDP support via aux_bus") this can happen when the aux-bus panel driver has not yet been loaded so that probe is deferred. Fix this by tying the device-managed lifetime of the DP IRQ to the DRM device so that it is released when bind fails. Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Cc: stable@vger.kernel.org # 5.10 Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/502679/ Link: https://lore.kernel.org/r/20220913085320.8577-6-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 4c1294da6aed1f16d47a417dcfe6602833c3c95c Author: Johan Hovold Date: Tue Sep 13 10:53:14 2022 +0200 drm/msm/hdmi: fix memory corruption with too many bridges Add the missing sanity check on the bridge counter to avoid corrupting data beyond the fixed-sized bridge array in case there are ever more than eight bridges. Fixes: a3376e3ec81c ("drm/msm: convert to drm_bridge") Cc: stable@vger.kernel.org # 3.12 Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/502670/ Link: https://lore.kernel.org/r/20220913085320.8577-5-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 2e786eb2f9cebb07e317226b60054df510b60c65 Author: Johan Hovold Date: Tue Sep 13 10:53:13 2022 +0200 drm/msm/dsi: fix memory corruption with too many bridges Add the missing sanity check on the bridge counter to avoid corrupting data beyond the fixed-sized bridge array in case there are ever more than eight bridges. Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") Cc: stable@vger.kernel.org # 4.1 Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/502668/ Link: https://lore.kernel.org/r/20220913085320.8577-4-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 74466e46e7543c7f74f1502181e9ba93f7521374 Author: Johan Hovold Date: Tue Sep 13 10:53:12 2022 +0200 drm/msm/dp: fix memory corruption with too many bridges Add the missing sanity check on the bridge counter to avoid corrupting data beyond the fixed-sized bridge array in case there are ever more than eight bridges. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Cc: stable@vger.kernel.org # 5.17 Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/502664/ Link: https://lore.kernel.org/r/20220913085320.8577-3-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 6808abdb33bf90330e70a687d29f038507e06ebb Author: Johan Hovold Date: Tue Sep 13 10:53:11 2022 +0200 drm/msm: fix use-after-free on probe deferral The bridge counter was never reset when tearing down the DRM device so that stale pointers to deallocated structures would be accessed on the next tear down (e.g. after a second late bind deferral). Given enough bridges and a few probe deferrals this could currently also lead to data beyond the bridge array being corrupted. Fixes: d28ea556267c ("drm/msm: properly add and remove internal bridges") Fixes: a3376e3ec81c ("drm/msm: convert to drm_bridge") Cc: stable@vger.kernel.org # 3.12 Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/502665/ Link: https://lore.kernel.org/r/20220913085320.8577-2-johan+linaro@kernel.org Signed-off-by: Abhinav Kumar commit 0b33a33bd15d5bab73b87152b220a8d0153a4587 Author: Nathan Huckleberry Date: Tue Sep 13 13:55:48 2022 -0700 drm/msm: Fix return type of mdp4_lvds_connector_mode_valid The mode_valid field in drm_connector_helper_funcs is expected to be of type: enum drm_mode_status (* mode_valid) (struct drm_connector *connector, struct drm_display_mode *mode); The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of mdp4_lvds_connector_mode_valid should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Fixes: 3e87599b68e7 ("drm/msm/mdp4: add LVDS panel support") Reviewed-by: Abhinav Kumar Reviewed-by: Nathan Chancellor Patchwork: https://patchwork.freedesktop.org/patch/502878/ Link: https://lore.kernel.org/r/20220913205551.155128-1-nhuck@google.com Signed-off-by: Abhinav Kumar commit 3a661247967a6f3c99a95a8ba4c8073c5846ea4b Author: Kuogee Hsieh Date: Wed Sep 28 16:36:51 2022 -0700 drm/msm/dp: add atomic_check to bridge ops DRM commit_tails() will disable downstream crtc/encoder/bridge if both disable crtc is required and crtc->active is set before pushing a new frame downstream. There is a rare case that user space display manager issue an extra screen update immediately followed by close DRM device while down stream display interface is disabled. This extra screen update will timeout due to the downstream interface is disabled but will cause crtc->active be set. Hence the followed commit_tails() called by drm_release() will pass the disable downstream crtc/encoder/bridge conditions checking even downstream interface is disabled. This cause the crash to happen at dp_bridge_disable() due to it trying to access the main link register to push the idle pattern out while main link clocks is disabled. This patch adds atomic_check to prevent the extra frame will not be pushed down if display interface is down so that crtc->active will not be set neither. This will fail the conditions checking of disabling down stream crtc/encoder/bridge which prevent drm_release() from calling dp_bridge_disable() so that crash at dp_bridge_disable() prevented. There is no protection in the DRM framework to check if the display pipeline has been already disabled before trying again. The only check is the crtc_state->active but this is controlled by usermode using UAPI. Hence if the usermode sets this and then crashes, the driver needs to protect against double disable. SError Interrupt on CPU7, code 0x00000000be000411 -- SError CPU: 7 PID: 3878 Comm: Xorg Not tainted 5.19.0-stb-cbq #19 Hardware name: Google Lazor (rev3 - 8) (DT) pstate: a04000c9 (NzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __cmpxchg_case_acq_32+0x14/0x2c lr : do_raw_spin_lock+0xa4/0xdc sp : ffffffc01092b6a0 x29: ffffffc01092b6a0 x28: 0000000000000028 x27: 0000000000000038 x26: 0000000000000004 x25: ffffffd2973dce48 x24: 0000000000000000 x23: 00000000ffffffff x22: 00000000ffffffff x21: ffffffd2978d0008 x20: ffffffd2978d0008 x19: ffffff80ff759fc0 x18: 0000000000000000 x17: 004800a501260460 x16: 0441043b04600438 x15: 04380000089807d0 x14: 07b0089807800780 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000438 x10: 00000000000007d0 x9 : ffffffd2973e09e4 x8 : ffffff8092d53300 x7 : ffffff808902e8b8 x6 : 0000000000000001 x5 : ffffff808902e880 x4 : 0000000000000000 x3 : ffffff80ff759fc0 x2 : 0000000000000001 x1 : 0000000000000000 x0 : ffffff80ff759fc0 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 7 PID: 3878 Comm: Xorg Not tainted 5.19.0-stb-cbq #19 Hardware name: Google Lazor (rev3 - 8) (DT) Call trace: dump_backtrace.part.0+0xbc/0xe4 show_stack+0x24/0x70 dump_stack_lvl+0x68/0x84 dump_stack+0x18/0x34 panic+0x14c/0x32c nmi_panic+0x58/0x7c arm64_serror_panic+0x78/0x84 do_serror+0x40/0x64 el1h_64_error_handler+0x30/0x48 el1h_64_error+0x68/0x6c __cmpxchg_case_acq_32+0x14/0x2c _raw_spin_lock_irqsave+0x38/0x4c lock_timer_base+0x40/0x78 __mod_timer+0xf4/0x25c schedule_timeout+0xd4/0xfc __wait_for_common+0xac/0x140 wait_for_completion_timeout+0x2c/0x54 dp_ctrl_push_idle+0x40/0x88 dp_bridge_disable+0x24/0x30 drm_atomic_bridge_chain_disable+0x90/0xbc drm_atomic_helper_commit_modeset_disables+0x198/0x444 msm_atomic_commit_tail+0x1d0/0x374 commit_tail+0x80/0x108 drm_atomic_helper_commit+0x118/0x11c drm_atomic_commit+0xb4/0xe0 drm_client_modeset_commit_atomic+0x184/0x224 drm_client_modeset_commit_locked+0x58/0x160 drm_client_modeset_commit+0x3c/0x64 __drm_fb_helper_restore_fbdev_mode_unlocked+0x98/0xac drm_fb_helper_set_par+0x74/0x80 drm_fb_helper_hotplug_event+0xdc/0xe0 __drm_fb_helper_restore_fbdev_mode_unlocked+0x7c/0xac drm_fb_helper_restore_fbdev_mode_unlocked+0x20/0x2c drm_fb_helper_lastclose+0x20/0x2c drm_lastclose+0x44/0x6c drm_release+0x88/0xd4 __fput+0x104/0x220 ____fput+0x1c/0x28 task_work_run+0x8c/0x100 do_exit+0x450/0x8d0 do_group_exit+0x40/0xac __wake_up_parent+0x0/0x38 invoke_syscall+0x84/0x11c el0_svc_common.constprop.0+0xb8/0xe4 do_el0_svc+0x8c/0xb8 el0_svc+0x2c/0x54 el0t_64_sync_handler+0x120/0x1c0 el0t_64_sync+0x190/0x194 SMP: stopping secondary CPUs Kernel Offset: 0x128e800000 from 0xffffffc008000000 PHYS_OFFSET: 0x80000000 CPU features: 0x800,00c2a015,19801c82 Memory Limit: none Changes in v2: -- add more commit text Changes in v3: -- add comments into dp_bridge_atomic_check() Changes in v4: -- rewording the comment into dp_bridge_atomic_check() Changes in v5: -- removed quote x at end of commit text Changes in v6: -- removed quote x at end of comment in dp_bridge_atomic_check() Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Reported-by: Leonard Lausen Suggested-by: Rob Clark Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/17 Signed-off-by: Kuogee Hsieh Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/505331/ Link: https://lore.kernel.org/r/1664408211-25314-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar commit 84ab9408118cac99ab83f1f7f6066d75dd3f24b6 Merge: c35fbea48659e e18f6bcf8e864 Author: Takashi Iwai Date: Fri Sep 30 18:18:20 2022 +0200 Merge tag 'asoc-fix-v6.0-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Last fixes for v6.0 In the even that there's another pull request here's some more driver specific fixes. commit f0c8d7468af0001b80b0c86802ee28063f800987 Author: Judy Hsiao Date: Fri Sep 30 15:15:46 2022 +0000 ASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR 1. Uses regmap_read_poll_timeout_atomic to poll I2S_CLR as it is called within a spin lock. 2. Fixes the typo of break condition in regmap_read_poll_timeout_atomic. Fixes: fbb0ec656ee5 ("ASoC: rockchip: i2s: use regmap_read_poll_timeout to poll I2S_CLR") Signed-off-by: Judy Hsiao Link: https://lore.kernel.org/r/20220930151546.2017667-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 76efc2453d0e8e5d6692ef69981b183ad674edea Author: Akhil P Oommen Date: Wed Sep 28 12:49:00 2022 +0530 drm/msm/gpu: Fix crash during system suspend after unbind In adreno_unbind, we should clean up gpu device's drvdata to avoid accessing a stale pointer during system suspend. Also, check for NULL ptr in both system suspend/resume callbacks. Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/505075/ Link: https://lore.kernel.org/r/20220928124830.2.I5ee0ac073ccdeb81961e5ec0cce5f741a7207a71@changeid Signed-off-by: Rob Clark commit ec8f1813bf8d0737898f99a8c1c69df0cde0d7dd Author: Akhil P Oommen Date: Wed Sep 28 12:48:59 2022 +0530 drm/msm/a6xx: Replace kcalloc() with kvzalloc() In order to reduce chance of allocation failure while capturing a6xx gpu state, use kvzalloc() instead of kcalloc() in state_kcalloc(). Indirectly, this patch helps to fix leaking memory allocated for gmu_debug object. Fixes: b859f9b009b (drm/msm/gpu: Snapshot GMU debug buffer) Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/505074/ Link: https://lore.kernel.org/r/20220928124830.1.I8ea24a8d586b4978823b848adde000f92f74d5c2@changeid Signed-off-by: Rob Clark commit 084b9e1732f71e36c21a820162c9f601577932c6 Author: Rob Clark Date: Fri Sep 23 15:40:44 2022 -0700 drm/msm/gem: Unpin objects slightly later The introduction of "drm/msm/gem: Evict active GEM objects when necessary" exposes a problem with "drm/msm/gem: Unpin buffers earlier", in that we need to keep the object pinned in the time the submit is queued up in the gpu scheduler. Otherwise the shrinker will see it as a thing that can be evicted if we wait for it to be signaled. But if the shrinker path is waiting on it with the obj lock held, the job cannot be scheduled, as that also requires briefly grabbing the obj lock, leading to deadlock. (Not to mention, we don't want the shrinker to evict an obj queued up in gpu scheduler.) Fixes: f371bcc0c2ac ("drm/msm/gem: Unpin buffers earlier") Fixes: 025d27239a2f ("drm/msm/gem: Evict active GEM objects when necessary") Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/19 Signed-off-by: Rob Clark Tested-by: Chia-I Wu Patchwork: https://patchwork.freedesktop.org/patch/504528/ Link: https://lore.kernel.org/r/20220923224043.2449152-1-robdclark@gmail.com commit b292cafe2dd02d96a07147e4b160927e8399d5cc Author: Felix Kuehling Date: Wed Sep 21 17:45:59 2022 -0400 drm/amdkfd: Fix UBSAN shift-out-of-bounds warning This was fixed in initialize_cpsch before, but not in initialize_nocpsch. Factor sdma bitmap initialization into a helper function to apply the correct implementation in both cases without duplicating it. v2: Added a range check Reported-by: Ellis Michael Signed-off-by: Felix Kuehling Reviewed-by: Graham Sider Signed-off-by: Alex Deucher commit 8a7c3ce108544334a9c7906f61d2701f433e44ee Author: Philip Yang Date: Wed Sep 7 22:38:00 2022 -0400 drm/amdkfd: Track unified memory when switching xnack mode Unified memory usage with xnack off is tracked to avoid oversubscribe system memory, with xnack on, we don't track unified memory usage to allow memory oversubscribe. When switching xnack mode from off to on, subsequent free ranges allocated with xnack off will not unreserve memory. When switching xnack mode from on to off, subsequent free ranges allocated with xnack on will unreserve memory. Both cases cause memory accounting unbalanced. When switching xnack mode from on to off, need reserve already allocated svm range memory. When switching xnack mode from off to on, need unreserve already allocated svm range memory. v6: Take prange lock to access range child list v5: Handle prange child ranges v4: Handle reservation memory failure v3: Handle switching xnack mode race with svm_range_deferred_list_work v2: Handle both switching xnack from on to off and from off to on cases Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 730548ba023113a15e5233deebd49ffbb02b7322 Author: Sonny Jiang Date: Thu Sep 29 12:26:45 2022 -0400 drm/amdgpu: Enable sram on vcn_4_0_2 Enable sram on vcn_4_0_2 Signed-off-by: Sonny Jiang Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 0b37f47494099e74b3cc11d71a763b36b70ea2b7 Author: Sonny Jiang Date: Thu Sep 29 12:24:27 2022 -0400 drm/amdgpu: Enable VCN DPG for GC11_0_1 Enable VCN DPG on GC11_0_1 Signed-off-by: Sonny Jiang Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 853110992cfefec433ca58cf7d69df4f639abe18 Author: Marek Vasut Date: Tue Sep 27 20:53:59 2022 +0200 ASoC: dt-bindings: Document audio OF graph dai-tdm-slot-num dai-tdm-slot-width props Document dai-tdm-slot-num and dai-tdm-slot-width props as those are parsed by simple graph card and may therefore appear in audio OF graph node. Signed-off-by: Marek Vasut Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220927185359.294322-1-marex@denx.de Signed-off-by: Mark Brown commit 17fffac44943a619ec76463655b1ed7fccd8bea7 Author: Krzysztof Kozlowski Date: Mon Sep 26 14:58:24 2022 +0200 ARM: dts: s5pv210: correct double "pins" in pinmux node Drop second "pins" suffix from pin configuration/mux nodes. Link: https://lore.kernel.org/r/20220926125824.477920-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 6690c2c4c4eaa2a01f1c50ccd35dbe479bba85e3 Merge: 0f5ef005310d4 8f5ed1c140f84 Author: Jakub Kicinski Date: Fri Sep 30 07:55:55 2022 -0700 Merge branch 'mlx5-xsk-updates-part2-2022-09-28' Saeed Mahameed says: ==================== mlx5 xsk updates part2 2022-09-28 XSK buffer improvements, This is part #2 of 4 parts series. 1) Expose xsk min chunk size to drivers, to allow the driver to adjust to a better buffer stride size 2) Adjust MTT page size to the XSK frame size, to avoid umem overrun in certain situations. 3) Use xsk frame size as the striding RQ page size for XSK RQs 4) KSM for unaligned XSK, KSM allows arbitrary buffer chunk lengths registration in HW, which makes more sense for unaligned XSK. 4) More cleanups and optimizations in preparation for next improvements in part3 part 1: https://lore.kernel.org/netdev/20220927203611.244301-1-saeed@kernel.org/ ==================== Link: https://lore.kernel.org/r/20220929072156.93299-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 8f5ed1c140f8437be2881e4388d7ecfdb9a9b5ec Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:56 2022 -0700 net/mlx5e: Clean up and fix error flows in mlx5e_alloc_rq Although mlx5e_rq_free_shampo can be called unconditionally, it belongs to case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ. Move it there to allow to add more init/cleanup actions to the striding RQ case. If xdp_rxq_info_reg_mem_model fails, don't forget to destroy the page pool. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit e64d71d055ca01fa5054d25b99fb29b98e543a31 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:55 2022 -0700 net/mlx5e: Move repeating clear_bit in mlx5e_rx_reporter_err_rq_cqe_recover The same clear_bit is called in both error and success flows. Move the call to do it only once and remove the out label. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit d32c225316d407109aa8ea9835863f124aedea28 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:54 2022 -0700 net/mlx5e: Split out channel (de)activation in rx_res To decrease the nesting level and reduce duplication of code, create functions to redirect direct RQTs to the actual RQs or drop_rq, which are used in the activation and deactivation flows of channels. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 2d0765f78c130ce692097de8a5e30a938ee41102 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:53 2022 -0700 net/mlx5e: xsk: Remove mlx5e_xsk_page_alloc_pool mlx5e_xsk_page_alloc_pool became a thin wrapper around xsk_buff_alloc. Drop it and call xsk_buff_alloc directly. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 672db0243349d3510e2c7f9942e97945a296f73e Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:52 2022 -0700 net/mlx5e: Convert struct mlx5e_alloc_unit to a union struct mlx5e_alloc_unit consists of a single union. Convert it to a union itself to simplify casting it to struct xdp_buff *, which will be used to implement XSK batching on striding RQ. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 6bdeb963822af244dc4b4341d4e65a9ec6fda668 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:51 2022 -0700 net/mlx5e: Remove DMA address from mlx5e_alloc_unit mlx5e_alloc_unit stores the DMA address and a pointer to either struct page (regular RQ) or struct xdp_buff (XSK RQ). This DMA address is redundant, because when a page or an XSK frame is allocated, the same address is also stored there. Some flows take the address from struct mlx5e_alloc_unit, and some take it from struct page or xdp_buff. This commit removes the address from struct mlx5e_alloc_unit, which makes it twice as small and improves locality (this struct is used in an array), also saving on unnecessary stores to the addr field. Almost all flows know unambiguously whether the DMA address should be taken from page or from xdp_buff. The exception is the allocation flows, where a new branch appeared, which will be optimized out in the next commits. struct mlx5e_alloc_unit used to be called mlx5e_dma_info. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 79008676d533b7ea92a5938b6526411ca5f2657f Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:50 2022 -0700 net/mlx5e: Rename mlx5e_dma_info to prepare for removal of DMA address The next commit will remove the DMA address from the struct currently called mlx5e_dma_info, because the same value can be retrieved with page_pool_get_dma_addr(page) in almost all cases, with the notable exception of SHAMPO (HW GRO implementation) that modifies this address on the fly, after the initial allocation. To keep the SHAMPO logic intact, struct mlx5e_dma_info remains in the SHAMPO code, consisting of addr and page (XSK is not compatible with SHAMPO). The struct used in all other places is renamed to mlx5e_alloc_unit, allowing the next commit to remove the addr field without affecting SHAMPO. The new name means "allocation unit", and it's more appropriate after the field with the DMA address gets removed. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 707f908e31d7e2c3b24fe8cafa773f67e44fc5ef Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:49 2022 -0700 net/mlx5e: Optimize the page cache reducing its size 2x RX page cache stores dma_info structs, that consist of a pointer to struct page and a DMA address. In fact, the DMA address is extracted from struct page using page_pool_get_dma_addr when a page is pushed to the cache. By moving this call to the point when a page is popped from the cache, we can avoid storing the DMA address in the cache, effectively reducing its size by two times without losing any functionality. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0b9c86c78586c209926fc360687dd4a13666840b Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:48 2022 -0700 net/mlx5e: Fix calculations for ICOSQ size WQEs must not cross page boundaries, they are padded with NOPs if they don't fit the page. mlx5e_mpwrq_total_umr_wqebbs doesn't take into account this padding, risking reserving not enough space. The padding is not straightforward to add to this calculation, because WQEs of different sizes may be mixed together in the queue. If each page ends with a big WQE that doesn't fit and requires at most its size minus 1 WQEBB of padding, the total space can be much bigger than in case when smaller WQEs take advantage of this padding. Replace the wrong exact calculation by the following estimation. Each padding can be at most the size of the maximum WQE used in the queue minus one WQEBB. Let's call the rest of the page "useful space". If we divide the total size of all needed WQEs by this useful space, rounding up, we'll get the number of pages, which is enough to contain all these WQEs. It's correct, because every WQE that appeared on the boundary between two blocks of useful space would start in the useful space of one page and end in the padding of the same page, while our estimation reserved space for its tail in the next space, making the estimation not smaller than the real space occupied in the queue. The code actually uses a looser estimation: instead of taking the maximum size of all used WQE types minus 1 WQEBB, it takes the maximum hardware size of a WQE. It's made for simplicity and extensibility. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit f2f1675836015e79ba9720d4f7f02441fd0bb5e5 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:47 2022 -0700 xsk: Remove unused xsk_buff_discard The previous commit removed the last usage of xsk_buff_discard in mlx5e, so the function that is no longer used can be removed. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan CC: "Björn Töpel" CC: Magnus Karlsson CC: Maciej Fijalkowski Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 6470d2e7e8ed8e9dd560d8dc3e09d1100a17ee26 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:46 2022 -0700 net/mlx5e: xsk: Use KSM for unaligned XSK UMR MTTs used in striding RQ have certain alignment requirements. While it's guaranteed to work when UMR pages are aligned to the UMR page size, in practice it works then UMR pages are aligned to 8 bytes. However, it's still not enough flexibility for the unaligned mode of XSK. This patch leverages KSM to map UMR pages without alignment requirements, when unaligned XSK is active. The downside is that KSM entries are twice as big as MTTs, which limits the maximum WQE size, so regular RQs and aligned XSK continue using MTTs. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit c4418f34955440fbdebd0b00771bdd76e2cd3f63 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:45 2022 -0700 net/mlx5: Add MLX5_FLEXIBLE_INLEN to safely calculate cmd inlen Some commands use a flexible array after a common header. Add a macro to safely calculate the total input length of the command, detecting overflows and printing errors with specific values when such overflows happen. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit ecc7ad2eab35f180588a60adc5c2b76262dc8d71 Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:44 2022 -0700 net/mlx5e: Keep a separate MKey for striding RQ Currently, rq->mkey_be keeps a big-endian value of either the PA MKey (for legacy RQ, no address translation) or MTT MKey (for striding RQ, direct address translation). Striding RQ stores the same value in rq->umr_mkey in the native endianness. The next commit will make striding RQ use KSM MKey (indirect address translation) for the unaligned mode of XSK, which will require storing both KSM MKey and PA MKey in the RQ struct. This commit optimizes fields of mlx5e_rq: umr_mkey is removed (it's redundant), mkey_be always points to the PA MKey, and mpwqe.umr_mkey_be points to the MTT MKey (or to the KSM MKey, starting from the next commit). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit fa5573359aae63d36518e2821f968ff2f5eae02e Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:43 2022 -0700 net/mlx5e: xsk: Use XSK frame size as striding RQ page size XSK RQs support striding RQ linear mode, but the stride size is always set to PAGE_SIZE. It may be larger than the XSK frame size, unnecessarily reducing the useful space in a WQE, but more importantly causing UMEM data corruption in certain cases. Normally, stride size bigger than XSK frame size is not a problem if the hardware enforces the MTU. However, traffic between vports skips the hardware MTU check, and oversized packets may be received. If an oversized packet is bigger than the XSK frame but not bigger than the stride, it will cause overwriting of the adjacent UMEM region. If the packet takes more than one stride, they can be recycled for reuse so it's not a problem when the XSK frame size matches the stride size. To reduce the impact of the above issue, attempt to use the MTT page size for striding RQ that matches the XSK frame size, allowing to safely use 2048-byte frames on an up-to-date firmware. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit e5a3cc83d54019a90119ce0cf17b5e21729b79bf Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:42 2022 -0700 net/mlx5e: Use runtime page_shift for striding RQ This commit allows striding RQ to determine MTT page size at runtime, instead of sticking to the compile-time PAGE_SIZE. This functionality will be used by a following commit that adjusts the MTT page size to the XSK frame size. Stick with PAGE_SIZE for XSK on legacy RQ, as frag_stride is not used in data path, it only helps calculate how pages are partitioned into fragments, and PAGE_SIZE will ensure each fragment starts at the beginning of a new allocation unit (XSK frame). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 9ca66afe73da16cd2c529e6770cc5aea0c4454df Author: Maxim Mikityanskiy Date: Thu Sep 29 00:21:41 2022 -0700 xsk: Expose min chunk size to drivers Drivers should be aware of the range of valid UMEM chunk sizes to be able to allocate their internal structures of an appropriate size. It will be used by mlx5e in the following patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan CC: "Björn Töpel" CC: Magnus Karlsson CC: Maciej Fijalkowski Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit fdf756f7127185eeffe00e918e66dfee797f3625 Author: Peter Zijlstra Date: Fri Sep 30 16:39:46 2022 +0200 sched: Fix more TASK_state comparisons Boris reported hung_task splats after commit 5aec788aeb8e ("sched: Fix TASK_state comparisons"). Upon closer consideration of that change it doesn't only exclude TASK_KILLABLE, but also TASK_IDLE. Update the comment to reflect this fact and add an additional TASK_NOLOAD test to exclude them. Additionally, remove the TASK_FREEZABLE early exit from check_hung_task(), a freezable task is not a frozen task. Fixes: 5aec788aeb8e ("sched: Fix TASK_state comparisons") Reported-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Tested-by: Borislav Petkov commit 8e6ec6ce02b5a58f01099118ddfed71d3f657b1c Author: Tiezhu Yang Date: Thu Sep 29 15:39:58 2022 +0800 MIPS: Simplify __bswapdi2() and __bswapsi2() Use macro definitions ___constant_swab64 and ___constant_swab32 to simplify __bswapdi2() and __bswapsi2(). Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 0668951705d356d77c8263010c7ae59e78fdb2c6 Author: Tiezhu Yang Date: Thu Sep 29 15:39:57 2022 +0800 MIPS: Silence missing prototype warning Silence the following two warnings when make W=1: CC arch/mips/lib/bswapsi.o arch/mips/lib/bswapsi.c:5:22: warning: no previous prototype for '__bswapsi2' [-Wmissing-prototypes] unsigned int notrace __bswapsi2(unsigned int u) ^~~~~~~~~~ CC arch/mips/lib/bswapdi.o arch/mips/lib/bswapdi.c:5:28: warning: no previous prototype for '__bswapdi2' [-Wmissing-prototypes] unsigned long long notrace __bswapdi2(unsigned long long u) ^~~~~~~~~~ AR arch/mips/lib/built-in.a Reported-by: kernel test robot Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 00a7829ba8a44d720269e8a7562b51d4c68c03f7 Merge: 445d41d7a7c15 b731e3575f7a4 Author: Vlastimil Babka Date: Fri Sep 30 16:46:18 2022 +0200 Merge branch 'slab/for-6.1/slub_validation_locking' into slab/for-next A fix for a regression in slub_debug caches that could cause slab page leaks and subsequent warnings on cache shutdown, by Feng Tang. commit 84aff0b6905c1101aab1525c2d649127f307218b Author: Lukas Bulwahn Date: Thu Sep 29 12:14:51 2022 +0200 mips: update config files Clean up config files by: - removing configs that were deleted in the past - removing configs not in tree and without recently pending patches - adding new configs that are replacements for old configs in the file For some detailed information, see Link. Link: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit b731e3575f7a45a46512708f9fdf953b40c46a53 Author: Feng Tang Date: Fri Sep 30 18:07:30 2022 +0800 mm/slub: fix a slab missed to be freed problem When enable kasan and kfence's in-kernel kunit test with slub_debug on, it caught a problem (in linux-next tree): ------------[ cut here ]------------ kmem_cache_destroy test: Slab cache still has objects when called from test_exit+0x1a/0x30 WARNING: CPU: 3 PID: 240 at mm/slab_common.c:492 kmem_cache_destroy+0x16c/0x170 Modules linked in: CPU: 3 PID: 240 Comm: kunit_try_catch Tainted: G B N 6.0.0-rc7-next-20220929 #52 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:kmem_cache_destroy+0x16c/0x170 Code: 41 5c 41 5d e9 a5 04 0b 00 c3 cc cc cc cc 48 8b 55 60 48 8b 4c 24 20 48 c7 c6 40 37 d2 82 48 c7 c7 e8 a0 33 83 e8 4e d7 14 01 <0f> 0b eb a7 41 56 41 89 d6 41 55 49 89 f5 41 54 49 89 fc 55 48 89 RSP: 0000:ffff88800775fea0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffffffff83bdec48 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 1ffff11000eebf9e RDI: ffffed1000eebfc6 RBP: ffff88804362fa00 R08: ffffffff81182e58 R09: ffff88800775fbdf R10: ffffed1000eebf7b R11: 0000000000000001 R12: 000000008c800d00 R13: ffff888005e78040 R14: 0000000000000000 R15: ffff888005cdfad0 FS: 0000000000000000(0000) GS:ffff88807ed00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000360e001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: test_exit+0x1a/0x30 kunit_try_run_case+0xad/0xc0 kunit_generic_run_threadfn_adapter+0x26/0x50 kthread+0x17b/0x1b0 It was biscted to commit c7323a5ad078 ("mm/slub: restrict sysfs validation to debug caches and make it safe") The problem is inside free_debug_processing(), under certain circumstances the slab can be removed from the partial list but not freed by discard_slab() and thus n->nr_slabs is not decreased accordingly. During shutdown, this non-zero n->nr_slabs is detected and reported. Specifically, the problem is that there are two checks for detecting a full partial list by comparing n->nr_partial >= s->min_partial where the latter check is affected by remove_partial() decreasing n->nr_partial between the checks. Reoganize the code so there is a single check upfront. Link: https://lore.kernel.org/all/20220930100730.250248-1-feng.tang@intel.com/ Fixes: c7323a5ad078 ("mm/slub: restrict sysfs validation to debug caches and make it safe") Signed-off-by: Feng Tang Signed-off-by: Vlastimil Babka commit 23fd22e55b767be9c31fda57205afb2023cd6aad Author: Kanchan Joshi Date: Fri Sep 30 11:57:49 2022 +0530 nvme: wire up fixed buffer support for nvme passthrough if io_uring sends passthrough command with IORING_URING_CMD_FIXED flag, use the pre-registered buffer for IO (non-vectored variant). Pass the buffer/length to io_uring and get the bvec iterator for the range. Next, pass this bvec to block-layer and obtain a bio/request for subsequent processing. Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220930062749.152261-13-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 4d174486820e625fa85bac5d4235d4b4cb659866 Author: Kanchan Joshi Date: Fri Sep 30 11:57:48 2022 +0530 nvme: pass ubuffer as an integer This is a prep patch. Modify nvme_submit_user_cmd and nvme_map_user_request to take ubuffer as plain integer argument, and do away with nvme_to_user_ptr conversion in callers. Signed-off-by: Anuj Gupta Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-12-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 37987547932c89f15f9b76950040131ddb591a8b Author: Kanchan Joshi Date: Fri Sep 30 11:57:47 2022 +0530 block: extend functionality to map bvec iterator Extend blk_rq_map_user_iov so that it can handle bvec iterator, using the new blk_rq_map_user_bvec function. It maps the pages from bvec iterator into a bio and place the bio into request. This helper will be used by nvme for uring-passthrough path when IO is done using pre-mapped buffers. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta Suggested-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-11-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit ab89e8e7ca526ca04baaad2aa28172d336425d67 Author: Kanchan Joshi Date: Fri Sep 30 11:57:46 2022 +0530 block: factor out blk_rq_map_bio_alloc helper Move bio allocation logic from bio_map_user_iov to a new helper blk_rq_map_bio_alloc. It is named so because functionality is opposite of what is done inside blk_mq_map_bio_put. This is a prep patch. Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220930062749.152261-10-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 32f1c71b15fc9cb8e964c3d0c15ca99a70cfe8a7 Author: Anuj Gupta Date: Fri Sep 30 11:57:45 2022 +0530 block: rename bio_map_put to blk_mq_map_bio_put This patch renames existing bio_map_put function to blk_mq_map_bio_put. Signed-off-by: Anuj Gupta Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-9-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 470e900c8036ff1aafeb5f06f3cb7a375a081399 Author: Kanchan Joshi Date: Fri Sep 30 11:57:44 2022 +0530 nvme: refactor nvme_alloc_request nvme_alloc_request expects a large number of parameters. Split this out into two functions to reduce number of parameters. First one retains the name nvme_alloc_request, while second one is named nvme_map_user_request. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-8-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 38c0ddab7b93daa90c046d0b9064a34fb0e586e5 Author: Kanchan Joshi Date: Fri Sep 30 11:57:43 2022 +0530 nvme: refactor nvme_add_user_metadata Pass struct request rather than bio. It helps to kill a parameter, and some processing clean-up too. Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-7-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 7f05635764390d5f811971af9f4c89b794032c80 Author: Anuj Gupta Date: Fri Sep 30 11:57:42 2022 +0530 nvme: Use blk_rq_map_user_io helper User blk_rq_map_user_io instead of duplicating the same code at different places Signed-off-by: Anuj Gupta Link: https://lore.kernel.org/r/20220930062749.152261-6-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 6732932c836a4313f471b92b4d90761f31d3fa81 Author: Anuj Gupta Date: Fri Sep 30 11:57:41 2022 +0530 scsi: Use blk_rq_map_user_io helper Use the new blk_rq_map_user_io helper instead of duplicating code at various places. Additionally this also takes advantage of the on-stack iov fast path. Signed-off-by: Anuj Gupta Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-5-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 557654025df5706785d395558244890dc4b2c875 Author: Anuj Gupta Date: Fri Sep 30 11:57:40 2022 +0530 block: add blk_rq_map_user_io Create a helper blk_rq_map_user_io for mapping of vectored as well as non-vectored requests. This will help in saving dupilcation of code at few places in scsi and nvme. Signed-off-by: Anuj Gupta Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220930062749.152261-4-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 9cda70f622cdcf049521a9c2886e5fd8a90a0591 Author: Anuj Gupta Date: Fri Sep 30 11:57:39 2022 +0530 io_uring: introduce fixed buffer support for io_uring_cmd Add IORING_URING_CMD_FIXED flag that is to be used for sending io_uring command with previously registered buffers. User-space passes the buffer index in sqe->buf_index, same as done in read/write variants that uses fixed buffers. Signed-off-by: Anuj Gupta Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220930062749.152261-3-anuj20.g@samsung.com [axboe: shuffle valid flags check before acting on it] Signed-off-by: Jens Axboe commit a9216fac3ed8819cbbda5d39dd5fcaa43dfd35d8 Author: Anuj Gupta Date: Fri Sep 30 11:57:38 2022 +0530 io_uring: add io_uring_cmd_import_fixed This is a new helper that callers can use to obtain a bvec iterator for the previously mapped buffer. This is preparatory work to enable fixed-buffer support for io_uring_cmd. Signed-off-by: Anuj Gupta Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220930062749.152261-2-anuj20.g@samsung.com Signed-off-by: Jens Axboe commit 851eb780decb7180bcf09fad0035cba9aae669df Author: Jens Axboe Date: Thu Sep 22 11:41:51 2022 -0600 nvme: enable batched completions of passthrough IO Now that the normal passthrough end_io path doesn't need the request anymore, we can kill the explicit blk_mq_free_request() and just pass back RQ_END_IO_FREE instead. This enables the batched completion from freeing batches of requests at the time. This brings passthrough IO performance at least on par with bdev based O_DIRECT with io_uring. With this and batche allocations, peak performance goes from 110M IOPS to 122M IOPS. For IRQ based, passthrough is now also about 10% faster than previously, going from ~61M to ~67M IOPS. Reviewed-by: Anuj Gupta Reviewed-by: Sagi Grimberg Reviewed-by: Keith Busch Co-developed-by: Stefan Roesch Signed-off-by: Jens Axboe commit c0a7ba77e81b8440d10f38559a5e1d219ff7e87c Author: Jens Axboe Date: Wed Sep 21 08:26:26 2022 -0600 nvme: split out metadata vs non metadata end_io uring_cmd completions By splitting up the metadata and non-metadata end_io handling, we can remove any request dependencies on the normal non-metadata IO path. This is in preparation for enabling the normal IO passthrough path to pass the ownership of the request back to the block layer. Reviewed-by: Christoph Hellwig Reviewed-by: Anuj Gupta Reviewed-by: Sagi Grimberg Reviewed-by: Keith Busch Co-developed-by: Stefan Roesch Signed-off-by: Jens Axboe commit ab3e1d3bbab9e973aeb4dd4603251578658a47ff Author: Jens Axboe Date: Wed Sep 21 08:24:16 2022 -0600 block: allow end_io based requests in the completion batch handling With end_io handlers now being able to potentially pass ownership of the request upon completion, we can allow requests with end_io handlers in the batch completion handling. Reviewed-by: Anuj Gupta Reviewed-by: Keith Busch Co-developed-by: Stefan Roesch Signed-off-by: Jens Axboe commit de671d6116b5210097cd6fbb877bac92536f265b Author: Jens Axboe Date: Wed Sep 21 15:19:54 2022 -0600 block: change request end_io handler to pass back a return value Everything is just converted to returning RQ_END_IO_NONE, and there should be no functional changes with this patch. In preparation for allowing the end_io handler to pass ownership back to the block layer, rather than retain ownership of the request. Reviewed-by: Keith Busch Signed-off-by: Jens Axboe commit 4b6a5d9cea911424e84107df8c4eb8317938d2cd Author: Jens Axboe Date: Wed Sep 21 08:22:09 2022 -0600 block: enable batched allocation for blk_mq_alloc_request() The filesystem IO path can take advantage of allocating batches of requests, if the underlying submitter tells the block layer about it through the blk_plug. For passthrough IO, the exported API is the blk_mq_alloc_request() helper, and that one does not allow for request caching. Wire up request caching for blk_mq_alloc_request(), which is generally done without having a bio available upfront. Tested-by: Anuj Gupta Reviewed-by: Keith Busch Signed-off-by: Jens Axboe commit e73a625bc24880f1fe5abaa89bb63e0918fbd66c Author: Jens Axboe Date: Wed Sep 28 09:19:59 2022 -0600 block: kill deprecated BUG_ON() in the flush handling We've never had any useful reports from this BUG_ON(), and in fact a number of the BUG_ON()'s in the flush handling need to be turned into more graceful handling. In preparation for allowing batched completions of the end_io handling, where we can enter the flush completion with queuelist having been reused for the batch, get rid of this BUG_ON(). Signed-off-by: Jens Axboe commit 5853a7b5512c3017f64ca26494bd7361a12d6992 Merge: 736feaa3a0812 108893ddcc4d3 Author: Jens Axboe Date: Fri Sep 30 07:47:42 2022 -0600 Merge branch 'for-6.1/io_uring' into for-6.1/passthrough * for-6.1/io_uring: (56 commits) io_uring/net: fix notif cqe reordering io_uring/net: don't update msg_name if not provided io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL io_uring/rw: defer fsnotify calls to task context io_uring/net: fix fast_iov assignment in io_setup_async_msg() io_uring/net: fix non-zc send with address io_uring/net: don't skip notifs for failed requests io_uring/rw: don't lose short results on io_setup_async_rw() io_uring/rw: fix unexpected link breakage io_uring/net: fix cleanup double free free_iov init io_uring: fix CQE reordering io_uring/net: fix UAF in io_sendrecv_fail() selftest/net: adjust io_uring sendzc notif handling io_uring: ensure local task_work marks task as running io_uring/net: zerocopy sendmsg io_uring/net: combine fail handlers io_uring/net: rename io_sendzc() io_uring/net: support non-zerocopy sendto io_uring/net: refactor io_setup_async_addr io_uring/net: don't lose partial send_zc on fail ... commit 736feaa3a08124020afe6e51f50bae8598c99f55 Merge: f76349cf41451 30514bd2dd4e8 Author: Jens Axboe Date: Fri Sep 30 07:47:38 2022 -0600 Merge branch 'for-6.1/block' into for-6.1/passthrough * for-6.1/block: (162 commits) sbitmap: fix lockup while swapping block: add rationale for not using blk_mq_plug() when applicable block: adapt blk_mq_plug() to not plug for writes that require a zone lock s390/dasd: use blk_mq_alloc_disk blk-cgroup: don't update the blkg lookup hint in blkg_conf_prep nvmet: don't look at the request_queue in nvmet_bdev_set_limits nvmet: don't look at the request_queue in nvmet_bdev_zone_mgmt_emulate_all blk-mq: use quiesced elevator switch when reinitializing queues block: replace blk_queue_nowait with bdev_nowait nvme: remove nvme_ctrl_init_connect_q nvme-loop: use the tagset alloc/free helpers nvme-loop: store the generic nvme_ctrl in set->driver_data nvme-loop: initialize sqsize later nvme-fc: use the tagset alloc/free helpers nvme-fc: store the generic nvme_ctrl in set->driver_data nvme-fc: keep ctrl->sqsize in sync with opts->queue_size nvme-rdma: use the tagset alloc/free helpers nvme-rdma: store the generic nvme_ctrl in set->driver_data nvme-tcp: use the tagset alloc/free helpers nvme-tcp: store the generic nvme_ctrl in set->driver_data ... Signed-off-by: Jens Axboe commit 3180d827c807d8d6e5d6ba4f2e08eed9efa083af Author: Michael Grzeschik Date: Fri Sep 30 14:28:39 2022 +0200 usb: gadget: uvc: don't put item still in use With the patch "588b9e85609b (usb: gadget: uvc: add v4l2 enumeration api calls)" the driver is keeping a list of configfs entries currently configured. The list is used in uvc_v4l2 on runtime. The driver now is giving back the list item just after it was referenced with config_item_put. It also calls config_item_put on uvc_free, which is the only and right place to give back the reference. This patch fixes the issue by removing the extra config_item_put in uvc_alloc. Fixes: 588b9e85609b (usb: gadget: uvc: add v4l2 enumeration api calls) Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220930122839.1747279-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 30963b2f75bfdbbcf1cc5d80bf88fec7aaba808d Author: Christophe Leroy Date: Fri Sep 30 10:33:56 2022 +0200 serial: cpm_uart: Don't request IRQ too early for console port The following message is seen during boot and the activation of console port gets delayed until normal serial ports activation. [ 0.001346] irq: no irq domain found for pic@930 ! The console port doesn't need irq, perform irq reservation later, during cpm_uart probe. While at it, don't use NO_IRQ but 0 which is the value returned by irq_of_parse_and_map() in case of error. By chance powerpc's NO_IRQ has value 0 but on some architectures it is -1. Fixes: 14d893fc6846 ("powerpc/8xx: Convert CPM1 interrupt controller to platform_device") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/8bed0f30c2e9ef16ae64fb1243a16d54a48eb8da.1664526717.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit 12f3a5eba3c4eb0031d7db36773579e517459a41 Author: Jiri Slaby Date: Tue Sep 27 13:18:19 2022 +0200 tty: serial: do unlock on a common path in altera_jtaguart_console_putc() port->lock is unlocked in each branch in altera_jtaguart_console_putc(), so do it before the "if". "status" needs not be under the lock, as the register was already read. Cc: Tobias Klauser Signed-off-by: Jiri Slaby Reviewed-by: Ilpo Järvinen Acked-by: Tobias Klauser Link: https://lore.kernel.org/r/20220927111819.18516-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 523f54ed3be7e23340b1c43921e39fddfe149c09 Author: Jiri Slaby Date: Tue Sep 27 13:18:18 2022 +0200 tty: serial: unify TX space reads under altera_jtaguart_tx_space() TX space reads from the control register are performed in various forms on 4 places in altera_jtaguart. Unify all those and do the read and masking on a single place. The new helper altera_jtaguart_tx_space() uses FIELD_GET(), so we can drop ALTERA_JTAGUART_CONTROL_WSPACE_OFF now. Cc: Tobias Klauser Signed-off-by: Jiri Slaby Reviewed-by: Ilpo Järvinen Acked-by: Tobias Klauser Link: https://lore.kernel.org/r/20220927111819.18516-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit ed9bf4aea06e36bbb3482e01061c433d703bcaff Author: Jiri Slaby Date: Tue Sep 27 13:18:17 2022 +0200 tty: serial: use FIELD_GET() in lqasc_tx_ready() FIELD_GET() can do the job smarter and more readable. We don't even need ASCFSTAT_TXFREEOFF. So switch to the former and remove the latter. Suggested-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220927111819.18516-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d8544c9c7cf77100be9340c61a9e3e88fe4bb12c Author: Jiri Slaby Date: Tue Sep 27 13:18:16 2022 +0200 tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar() There is one more place where lqasc_tx_ready() can be used now: lqasc_console_putchar(). So replace the open-coded variant by the helper. Suggested-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220927111819.18516-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8a1088116ba5ddbfcd69789b4a153733c9686cbb Author: Jiri Slaby Date: Tue Sep 27 13:05:28 2022 +0200 tty: serial: allow pxa.c to be COMPILE_TESTed There is no issue compiling pxa.c even in the SERIAL_8250=y case. So to cover it in the usual configurations, add "|| COMPILE_TEST" there. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220927110528.12815-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit dfdabd3856547c3bed996134e84b9452fb19e695 Author: Ren Zhijie Date: Mon Sep 26 02:58:26 2022 +0000 serial: stm32: Fix unused-variable warning If CONFIG_SERIAL_EARLYCON and CONFIG_OF are both not set, gcc warns about unused variable: drivers/tty/serial/stm32-usart.c:83:32: error: ‘stm32h7_info’ defined but not used [-Werror=unused-variable] static struct stm32_usart_info stm32h7_info = { ^~~~~~~~~~~~ drivers/tty/serial/stm32-usart.c:61:32: error: ‘stm32f7_info’ defined but not used [-Werror=unused-variable] static struct stm32_usart_info stm32f7_info = { ^~~~~~~~~~~~ drivers/tty/serial/stm32-usart.c:40:32: error: ‘stm32f4_info’ defined but not used [-Werror=unused-variable] static struct stm32_usart_info stm32f4_info = { ^~~~~~~~~~~~ cc1: all warnings being treated as errors Mark these variables as __maybe_unused to fix this. Fixes: c7039ce904c0 ("serial: stm32: make info structs static to avoid sparse warnings") Signed-off-by: Ren Zhijie Link: https://lore.kernel.org/r/20220926025826.44145-1-renzhijie2@huawei.com Signed-off-by: Greg Kroah-Hartman commit fda8c908bc2d523c0770ded667dcdad29c06ff52 Author: Andy Shevchenko Date: Wed Sep 28 16:57:41 2022 +0300 docs: filesystems: sysfs: Make text and code for ->show() consistent The documentation says that ->show() should only use sysfs_emit() or sysfs_emit_at(), but example keeps outdated code. Update the code to be consistent. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220928135741.54919-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 468cdabe93c5fa969de65752e38c31f07a5e048d Author: Sergiu Moga Date: Mon Sep 26 17:32:45 2022 +0300 tty: serial: atmel: Add COMMON_CLK dependency to SERIAL_ATMEL Now that the driver makes use of `__clk_is_enabled()` in order to know whether a `clk_disable_unprepare()` is needed or not on the GCLK, a new dependency has been introduced: COMMON_CLK. If this `CONFIG_COMMON_CLK` is not enabled, whatever config may have this driver enabled without COMMON_CLK then an undefined reference to `__clk_is_enabled()` will be issued by the linker. Thus, make sure that, unless `CONFIG_COMMON_CLK` is enabled, this driver is not compiled. Fixes: 5e3ce1f26129 ("tty: serial: atmel: Make the driver aware of the existence of GCLK") Reported-by: kernel test robot Signed-off-by: Sergiu Moga Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220926143244.485578-1-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 7cd04013fbf3e6dcb67ca6b59aa813269a2ad9ce Author: Kees Cook Date: Mon Sep 26 17:39:27 2022 -0700 w1: Split memcpy() of struct cn_msg flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/ Cc: Evgeniy Polyakov Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20220927003927.1942170-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit 4256e500f61922a3e59c7ecb6a11aab972d41b18 Author: Yogesh Hegde Date: Wed Sep 28 23:33:50 2022 +0530 staging: rtl8192e: Rename variable Bandwidth to avoid CamelCase Rename variable Bandwidth to bandwidth to avoid CamelCase which is not accepted by checkpatch.pl . Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20220928180350.GA82748@zephyrus Signed-off-by: Greg Kroah-Hartman commit 006d2f4872b8bd05f2aca0c2c0bed5aaec1efe53 Author: Michael Straube Date: Wed Sep 28 10:36:41 2022 +0200 staging: r8188eu: remove PHY_RFConfig8188E() The function PHY_RFConfig8188E() is just a wrapper around phy_RF6052_Config_ParaFile(). Remove the wrapper. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928083641.8275-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1206c0e9e325502ef37bf34caf97dbe0716abcf0 Author: Michael Straube Date: Wed Sep 28 10:36:40 2022 +0200 staging: r8188eu: remove PHY_RF6052_Config8188E() The function PHY_RF6052_Config8188E() is just a wrapper around phy_RF6052_Config_ParaFile(). Remove the wrapper. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928083641.8275-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b933b6a2667a988e999fef92e7d4bf7a4f41eaff Author: Michael Straube Date: Wed Sep 28 16:43:23 2022 +0200 staging: r8188eu: convert ODM_ReadAndConfig_AGC_TAB_1T_8188E() to int The function ODM_ReadAndConfig_AGC_TAB_1T_8188E() has return type 'enum HAL_STATUS'. Convert the return type to int and use common kernel error logic. Return 0 on success and negative values on failure. The enum HAL_STATUS is unused now and we can remove it. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928144323.13164-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d09f25aa60bd8fc6865c2a385746afc7cc1860c Author: Michael Straube Date: Wed Sep 28 16:43:22 2022 +0200 staging: r8188eu: convert ODM_ReadAndConfig_PHY_REG_1T_8188E() to int The function ODM_ReadAndConfig_PHY_REG_1T_8188E() has return type 'enum HAL_STATUS'. Convert the return type to int and use common kernel error logic. Return 0 on success and negative values on failure. The goal is to get rid of enum HAL_STATUS in the end. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928144323.13164-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9090b84a7b43148c33139abe0da1623ac1345d38 Author: Michael Straube Date: Wed Sep 28 16:43:21 2022 +0200 staging: r8188eu: convert ODM_ReadAndConfig_RadioA_1T_8188E() to int The function ODM_ReadAndConfig_RadioA_1T_8188E() has return type 'enum HAL_STATUS'. Convert the return type to int and use common kernel error logic. Return 0 on success and negative values on failure. The goal is to get rid of enum HAL_STATUS in the end. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928144323.13164-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 29c7dbbcd08c6d7f168797867e85dc008d868eb9 Author: Michael Straube Date: Wed Sep 28 16:43:20 2022 +0200 staging: r8188eu: convert ODM_ReadAndConfig_MAC_REG_8188E() to int The function ODM_ReadAndConfig_MAC_REG_8188E() has return type 'enum HAL_STATUS'. Convert the return type to int and use common kernel error logic. Return 0 on success and negative values on failure. The goal is to get rid of enum HAL_STATUS in the end. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220928144323.13164-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c573cdcf913e0a38bc260634017be3174595c56 Author: David Collins Date: Thu Sep 29 17:50:18 2022 -0700 spmi: pmic-arb: increase SPMI transaction timeout delay Increase the SPMI transaction timeout delay from 100 us to 1000 us in order to account for the slower execution time found on some simulator targets. Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-11-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-10-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit c8669773c74e26ceb2412215a2db40399e3fe119 Author: David Collins Date: Thu Sep 29 17:50:17 2022 -0700 spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes The system crashes due to an access permission violation when writing to a PMIC peripheral which is not owned by the current ee. Add a check for PMIC arbiter version 5 for such invalid write requests and return an error instead of crashing the system. Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-8-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-9-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 1f1693118c2476cb1666ad357edcf3cf48bf9b16 Author: David Collins Date: Thu Sep 29 17:50:16 2022 -0700 spmi: pmic-arb: correct duplicate APID to PPID mapping logic Correct the way that duplicate PPID mappings are handled for PMIC arbiter v5. The final APID mapped to a given PPID should be the one which has write owner = APPS EE, if it exists, or if not that, then the first APID mapped to the PPID, if it exists. Fixes: 40f318f0ed67 ("spmi: pmic-arb: add support for HW version 5") Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-7-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-8-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4df88fe5b631bb9e381880b4cca73e91750afffe Author: Ashay Jaiswal Date: Thu Sep 29 17:50:15 2022 -0700 spmi: pmic-arb: add support to dispatch interrupt based on IRQ status Current implementation of SPMI arbiter dispatches interrupt based on the Arbiter's accumulator status, in some cases the accumulator status may remain zero and the interrupt remains un-handled. Add logic to dispatch interrupts based Arbiter's IRQ status if the accumulator status is zero. Signed-off-by: Ashay Jaiswal Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-6-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-7-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 191adbdd26f1a26c9302369b2701bfddf8c0780e Author: David Collins Date: Thu Sep 29 17:50:14 2022 -0700 spmi: pmic-arb: check apid against limits before calling irq handler Check that the apid for an SPMI interrupt falls between the min_apid and max_apid that can be handled by the APPS processor before invoking the per-apid interrupt handler: periph_interrupt(). This avoids an access violation in rare cases where the status bit is set for an interrupt that is not owned by the APPS processor. Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-5-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-6-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b6c1761721193c52234e3ed048e4d16ab527bb74 Author: Subbaraman Narayanamurthy Date: Thu Sep 29 17:50:13 2022 -0700 spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq Currently, cleanup_irq() is invoked when a peripheral's interrupt fires and there is no mapping present in the interrupt domain of spmi interrupt controller. The cleanup_irq clears the arbiter bit, clears the pmic interrupt and disables it at the pmic in that order. The last disable in cleanup_irq races with request_irq() in that it stomps over the enable issued by request_irq. Fix this by not writing to the pmic in cleanup_irq. The latched bit will be left set in the pmic, which will not send us more interrupts even if the enable bit stays enabled. When a client wants to request an interrupt, use the activate callback on the irq_domain to clear latched bit. This ensures that the latched, if set due to the above changes in cleanup_irq or when the bootloader leaves it set, gets cleaned up, paving way for upcoming interrupts to trigger. With this, there is a possibility of unwanted triggering of interrupt right after the latched bit is cleared - the interrupt may be left enabled too. To avoid that, clear the enable first followed by clearing the latched bit in the activate callback. Fixes: 6bc546e71e50 ("spmi: pmic-arb: cleanup unrequested irqs") Fixes: 02abec3616c1 ("spmi: pmic-arb: rename pa_xx to pmic_arb_xx and other cleanup") Signed-off-by: Subbaraman Narayanamurthy [collinsd@codeaurora.org: fix merge conflict] Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-4-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-5-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit abb9088b3a39cfec1321e93170ee3c0c1255fd9d Author: Fenglin Wu Date: Thu Sep 29 17:50:12 2022 -0700 spmi: pmic-arb: handle spurious interrupt Call handle_bad_irq() when the summary interrupt is fired spuriously. Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-3-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-4-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 33c912d3c5efea62298921627fad7f5ad396b8fb Author: Abhijeet Dharmapurikar Date: Thu Sep 29 17:50:11 2022 -0700 spmi: pmic-arb: add a print in cleanup_irq The cleanup_irq() was meant to clear and mask interrupts that were left enabled in the hardware but there was no interrupt handler registered for it. Add an error print when it gets invoked. Signed-off-by: Abhijeet Dharmapurikar Signed-off-by: David Collins Signed-off-by: Fenglin Wu Link: https://lore.kernel.org/r/1655004286-11493-2-git-send-email-quic_fenglinw@quicinc.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-3-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9357fc3b3b85a7d9f0dedf5446222a26957852b4 Author: keliu Date: Thu Sep 29 17:50:10 2022 -0700 drivers: spmi: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu Link: https://lore.kernel.org/r/20220527071338.2359733-1-liuke94@huawei.com Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220930005019.2663064-2-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 54d0999f96abadcc0586fe577e6cf4dc4c2749c1 Author: Julien Panis Date: Tue Sep 27 18:53:46 2022 -0400 MAINTAINERS: add TI ECAP driver info This commit adds driver info for TI ECAP used in capture operating mode. Signed-off-by: Julien Panis Link: https://lore.kernel.org/r/20220923142437.271328-5-jpanis@baylibre.com/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/bb980cb69381c570b72701398991100ac91079ec.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4e2f42aa00b67605938173a61d07a44fe13bad68 Author: Julien Panis Date: Tue Sep 27 18:53:45 2022 -0400 counter: ti-ecap-capture: capture driver support for ECAP ECAP hardware on TI AM62x SoC supports capture feature. It can be used to timestamp events (falling/rising edges) detected on input signal. This commit adds capture driver support for ECAP hardware on AM62x SoC. In the ECAP hardware, capture pin can also be configured to be in PWM mode. Current implementation only supports capture operating mode. Hardware also supports timebase sync between multiple instances, but this driver supports simple independent capture functionality. Signed-off-by: Julien Panis Link: https://lore.kernel.org/r/20220923142437.271328-4-jpanis@baylibre.com/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/25644ce1f2fd15d116977770ede20e024f658513.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5a47aed0d651490ad0d6f9dbc98bc6dfc71de787 Author: Julien Panis Date: Tue Sep 27 18:53:44 2022 -0400 Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows items This commit adds frequency and num_overflows items to counter ABI file (e.g. for TI ECAP hardware used in capture operating mode). Signed-off-by: Julien Panis Link: https://lore.kernel.org/r/20220923142437.271328-3-jpanis@baylibre.com/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/467ae80e97c586c6bc9c453c6156ffcb5d4853d6.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit b5bee6ced21ca98389000b7017dd41b0cc37fa50 Author: Julien Panis Date: Tue Sep 27 18:53:43 2022 -0400 dt-bindings: counter: add ti,am62-ecap-capture.yaml This commit adds a YAML binding for TI ECAP used in capture operating mode. Signed-off-by: Julien Panis Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220923142437.271328-2-jpanis@baylibre.com/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/33c27451f61b3a01d886da5e6bf6456088956439.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit d2011be1e22f7769c7c71d6d7f777ffcc544808d Author: William Breathitt Gray Date: Tue Sep 27 18:53:42 2022 -0400 counter: Introduce the COUNTER_COMP_ARRAY component type The COUNTER_COMP_ARRAY Counter component type is introduced to enable support for Counter array components. With Counter array components, exposure for buffers on counter devices can be defined via new Counter array component macros. This should simplify code for driver authors who would otherwise need to define individual Counter components for each array element. Eight Counter array component macros are introduced:: DEFINE_COUNTER_ARRAY_U64(_name, _length) DEFINE_COUNTER_ARRAY_CAPTURE(_name, _length) DEFINE_COUNTER_ARRAY_POLARITY(_name, _enums, _length) COUNTER_COMP_DEVICE_ARRAY_U64(_name, _read, _write, _array) COUNTER_COMP_COUNT_ARRAY_U64(_name, _read, _write, _array) COUNTER_COMP_SIGNAL_ARRAY_U64(_name, _read, _write, _array) COUNTER_COMP_ARRAY_CAPTURE(_read, _write, _array) COUNTER_COMP_ARRAY_POLARITY(_read, _write, _array) Eight Counter array callbacks are introduced as well:: int (*signal_array_u32_read)(struct counter_device *counter, struct counter_signal *signal, size_t idx, u32 *val); int (*signal_array_u32_write)(struct counter_device *counter, struct counter_signal *signal, size_t idx, u32 val); int (*device_array_u64_read)(struct counter_device *counter, size_t idx, u64 *val); int (*count_array_u64_read)(struct counter_device *counter, struct counter_count *count, size_t idx, u64 *val); int (*signal_array_u64_read)(struct counter_device *counter, struct counter_signal *signal, size_t idx, u64 *val); int (*device_array_u64_write)(struct counter_device *counter, size_t idx, u64 val); int (*count_array_u64_write)(struct counter_device *counter, struct counter_count *count, size_t idx, u64 val); int (*signal_array_u64_write)(struct counter_device *counter, struct counter_signal *signal, size_t idx, u64 val); Driver authors can handle reads/writes for an array component by receiving an element index via the `idx` parameter and processing the respective value via the `val` parameter. For example, suppose a driver wants to expose a Count's read-only capture buffer of four elements using a callback `foobar_capture_read()`:: DEFINE_COUNTER_ARRAY_CAPTURE(foobar_capture_array, 4); COUNTER_COMP_ARRAY_CAPTURE(foobar_capture_read, NULL, foobar_capture_array) Respective sysfs attributes for each array element would appear for the respective Count: * /sys/bus/counter/devices/counterX/countY/capture0 * /sys/bus/counter/devices/counterX/countY/capture1 * /sys/bus/counter/devices/counterX/countY/capture2 * /sys/bus/counter/devices/counterX/countY/capture3 If a user tries to read _capture2_ for example, `idx` will be `2` when passed to the `foobar_capture_read()` callback, and thus the driver knows which array element to handle. Counter arrays for polarity elements can be defined in a similar manner as u64 elements:: const enum counter_signal_polarity foobar_polarity_states[] = { COUNTER_SIGNAL_POLARITY_POSITIVE, COUNTER_SIGNAL_POLARITY_NEGATIVE, }; DEFINE_COUNTER_ARRAY_POLARITY(foobar_polarity_array, foobar_polarity_states, 4); COUNTER_COMP_ARRAY_POLARITY(foobar_polarity_read, foobar_polarity_write, foobar_polarity_array) Tested-by: Julien Panis Link: https://lore.kernel.org/r/5310c22520aeae65b1b74952419f49ac4c8e1ec1.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/a51fd608704bdfc5a0efa503fc5481df34241e0a.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit bb4bbbec664ffdb4652bf3d5daf7c930e68e5c40 Author: William Breathitt Gray Date: Tue Sep 27 18:53:41 2022 -0400 counter: Consolidate Counter extension sysfs attribute creation Counter extensions are handled for the Device, Counts, and Signals. The code loops through each Counter extension and creates the expected sysfs attributes. This patch consolidates that code into functions to reduce redundancy and make the intention of the code clearer. Link: https://lore.kernel.org/r/6f2121cf52073028c119dbf981a8b72f3eb625d2.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/0469c3ae3fbccbca908993c78d94f221761a6a3a.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 45d2918520b2d8e640e4fb3fbf664dfb823dc520 Author: William Breathitt Gray Date: Tue Sep 27 18:53:40 2022 -0400 counter: Introduce the Count capture component Some devices provide a latch function to save historic Count values. This patch standardizes exposure of such functionality as Count capture components. A COUNTER_COMP_CAPTURE macro is provided for driver authors to define a capture component. A new event COUNTER_EVENT_CAPTURE is introduced to represent Count value capture events. Cc: Julien Panis Link: https://lore.kernel.org/r/c239572ab4208d0d6728136e82a88ad464369a7a.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/3cebaa0b807a225eb277d771504fe6dba7269ffd.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9830288aeada5ec8ded1665aafe2d2b8f4121bad Author: William Breathitt Gray Date: Tue Sep 27 18:53:39 2022 -0400 counter: 104-quad-8: Add Signal polarity component The 104-quad-8 driver provides support for Index signal polarity modes via the "index_polarity" Signal component. This patch exposes the same functionality through the more standard "polarity" Signal component. Link: https://lore.kernel.org/r/01d00c21873159833035cb6775d0d0e8ad55f2ef.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/0bf840beee1665e9f04ea82368ecdde87c791a22.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 650ae67bbf7ba5ac193f053969612fbb93247b64 Author: William Breathitt Gray Date: Tue Sep 27 18:53:38 2022 -0400 counter: Introduce the Signal polarity component The Signal polarity component represents the active level of a respective Signal. There are two possible states: positive (rising edge) and negative (falling edge); enum counter_signal_polarity represents these states. A convenience macro COUNTER_COMP_POLARITY() is provided for driver authors to declare a Signal polarity component. Cc: Julien Panis Link: https://lore.kernel.org/r/8f47d6e1db71a11bb1e2666f8e2a6e9d256d4131.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/b6e53438badcb6318997d13dd2fc052f97d808ac.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7bbf842cdcff30ddd1da4ab9059cf92f9d1a4326 Author: William Breathitt Gray Date: Tue Sep 27 18:53:37 2022 -0400 counter: interrupt-cnt: Implement watch_validate callback The interrupt-cnt counter driver only pushes one type of event on only one channel: COUNTER_EVENT_CHANGE_OF_STATE on channel 0. The interrupt_cnt_watch_validate() watch_valid callback is implemented to ensure watch configurations are valid for this driver. Cc: Oleksij Rempel Cc: Pengutronix Kernel Team Link: https://lore.kernel.org/r/20220815225058.144203-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/c50b5eede7d3f523de8dc3937dc44680f2773e1d.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3216e5512abdd1fc671ed8443ffc8fa9e4adc78c Author: William Breathitt Gray Date: Tue Sep 27 18:53:36 2022 -0400 counter: Move symbols into COUNTER namespace Counter subsystem symbols are only relevant to counter drivers. A COUNTER namespace is created to control the availability of these symbols to modules that import this namespace explicitly. Cc: Patrick Havelange Cc: Jarkko Nikula Cc: Oleksij Rempel Cc: Pengutronix Kernel Team Cc: Kamel Bouhara Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Acked-by: David Lechner Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220815220321.74161-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/8a756df96c24946547a7ece5caa5f654809c5e7f.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 55e5832bb1f24237ce294acca5b2c67ed1197cbc Author: William Breathitt Gray Date: Tue Sep 27 18:53:35 2022 -0400 MAINTAINERS: Update Counter subsystem git tree repo link The Counter subsystem git tree is now located on the kernel.org git server. Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/075c91bb0af32d27a139112701b12b118a50edd6.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit a08137bd1e0a7ce951dce9ce4a83e39d379b6e1b Author: Dmitry Torokhov Date: Tue Sep 27 15:05:03 2022 -0700 ARM: dts: exynos: fix polarity of VBUS GPIO of Origen EHCI Oxynos (drivers/usb/host/ehci-exynos.c) drives VBUS GPIO high when trying to power up the bus, therefore the GPIO in DTS must be marked as "active high". This will be important when EHCI driver is converted to gpiod API that respects declared polarities. Fixes: 4e8991def565 ("ARM: dts: exynos: Enable AX88760 USB hub on Origen board") Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220927220504.3744878-1-dmitry.torokhov@gmail.com Signed-off-by: Krzysztof Kozlowski commit bd1a665a01b4d65fd8dc6fece4b376fa5c8c55bb Author: Dmitry Torokhov Date: Wed Sep 28 18:15:55 2022 -0700 arm64: dts: exynos: fix polarity of "enable" line of NFC chip in TM2 According to s3fwrn5 driver code the "enable" GPIO line is driven "high" when chip is not in use (mode is S3FWRN5_MODE_COLD), and is driven "low" when chip is in use. s3fwrn5_phy_power_ctrl(): ... gpio_set_value(phy->gpio_en, 1); ... if (mode != S3FWRN5_MODE_COLD) { msleep(S3FWRN5_EN_WAIT_TIME); gpio_set_value(phy->gpio_en, 0); msleep(S3FWRN5_EN_WAIT_TIME); } Therefore the line described by "en-gpios" property should be annotated as "active low". The wakeup gpio appears to have correct polarity (active high). Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220929011557.4165216-1-dmitry.torokhov@gmail.com Signed-off-by: Krzysztof Kozlowski commit 0f5ef005310d4820926c76bc1e94d4d2a0e49d97 Author: Hongbin Wang Date: Thu Sep 29 02:12:05 2022 -0400 ip6_vti:Remove the space before the comma There should be no space before the comma Signed-off-by: Hongbin Wang Signed-off-by: David S. Miller commit 0bafedc536499a533dd7a94c9c980d53f3ca2afc Merge: f4ce91ce12a7c 4f4920669d21e Author: David S. Miller Date: Fri Sep 30 13:09:11 2022 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2022-09-29 1) Use the inner instead of the outer protocol for GSO on inter address family tunnels. This fixes the GSO case for address family tunnels. From Sabrina Dubroca. 2) Reset ipcomp_scratches with NULL when freed, otherwise it holds obsolete address. From Khalid Masum. 3) Reinject transport-mode packets through workqueue instead of a tasklet. The tasklet might take too long to finish. From Liu Jian. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit aa58c9bc833113621b3fdf0d43ada106a1e6f2fc Merge: fd01b9b5b02b5 83936ea8d8ad2 Author: David S. Miller Date: Fri Sep 30 13:04:23 2022 +0100 Merge branch 'Mediatek-mt8188' Jianguo Zhang says: ==================== Mediatek ethernet patches for mt8188 Changes in v7: v7: 1) Add 'Reviewed-by: AngeloGioacchino Del Regno ' info in commit message of patch 'dt-bindings: net: snps,dwmac: add new property snps,clk-csr', 'arm64: dts: mediatek: mt2712e: Update the name of property 'clk_csr'' and 'net: stmmac: add a parse for new property 'snps,clk-csr''. v6: 1) Update commit message of patch 'dt-bindings: net: snps,dwmac: add new property snps,clk-csr' 2) Add a parse for new property 'snps,clk-csr' in patch 'net: stmmac: add a parse for new property 'snps,clk-csr'' v5: 1) Rename the property 'clk_csr' as 'snps,clk-csr' in binding file as Krzysztof Kozlowski'comment. 2) Add DTS patch 'arm64: dts: mediatek: mt2712e: Update the name of property 'clk_csr'' as Krzysztof Kozlowski'comment. 3) Add driver patch 'net: stmmac: Update the name of property 'clk_csr'' as Krzysztof Kozlowski'comment. v4: 1) Update the commit message of patch 'dt-bindings: net: snps,dwmac: add clk_csr property' as Krzysztof Kozlowski'comment. v3: 1) List the names of SoCs mt8188 and mt8195 in correct order as AngeloGioacchino Del Regno's comment. 2) Add patch version info as Krzysztof Kozlowski'comment. v2: 1) Delete patch 'stmmac: dwmac-mediatek: add support for mt8188' as Krzysztof Kozlowski's comment. 2) Update patch 'dt-bindings: net: mediatek-dwmac: add support for mt8188' as Krzysztof Kozlowski's comment. 3) Add clk_csr property to fix warning ('clk_csr' was unexpected) when runnig 'make dtbs_check'. v1: 1) Add ethernet driver entry for mt8188. 2) Add binding document for ethernet on mt8188. ==================== Signed-off-by: David S. Miller commit 83936ea8d8ad22d094172e35cc36ec80d4ddfa96 Author: Jianguo Zhang Date: Thu Sep 29 09:47:58 2022 +0800 net: stmmac: add a parse for new property 'snps,clk-csr' Parse new property 'snps,clk-csr' firstly because the new property is documented in binding file, if failed, fall back to old property 'clk_csr' for legacy case Signed-off-by: Jianguo Zhang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller commit 7871785ce92d689b2aaa430ebc488fffa94620b0 Author: Jianguo Zhang Date: Thu Sep 29 09:47:57 2022 +0800 arm64: dts: mediatek: mt2712e: Update the name of property 'clk_csr' Update the name of property 'clk_csr' as 'snps,clk-csr' to align with the property name in the binding file. Signed-off-by: Jianguo Zhang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller commit 22ba1afdec082b48d3fcec89b396839915af163f Author: Jianguo Zhang Date: Thu Sep 29 09:47:56 2022 +0800 dt-bindings: net: snps,dwmac: add new property snps,clk-csr Add description for new property snps,clk-csr in binding file Signed-off-by: Jianguo Zhang Reviewed-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller commit c827b7a3fed54e5ea23584774bfc4ca27ff90272 Author: Jianguo Zhang Date: Thu Sep 29 09:47:55 2022 +0800 dt-bindings: net: mediatek-dwmac: add support for mt8188 Add binding document for the ethernet on mt8188 Signed-off-by: Jianguo Zhang Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit f5e536af4860a7d07b769d0388a68e74fe453c9b Merge: 3aa12610b481f 35af9fb49bc5c Author: Greg Kroah-Hartman Date: Fri Sep 30 14:02:47 2022 +0200 Merge tag 'fsi-for-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi into char-misc-next Joel writes: "FSI changes for v6.1 * Fix a OCC hwmon userspace compatibility regression that was introduced in v5.19 * Device tree bindings for the OCC * A bunch of janitor type fixes" * tag 'fsi-for-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi: fsi: core: Check error number after calling ida_simple_get hwmon: (occ) Check for device property for setting OCC active during probe fsi: occ: Support probing the hwmon child device from dts node dt-bindings: hwmon: Add IBM OCC bindings fsi: master-ast-cf: Fix missing of_node_put in fsi_master_acf_probe fsi: sbefifo: Add detailed debugging information fsi: cleanup extern usage in function definition fsi: occ: Prevent use after free hwmon (occ): Retry for checksum failure fsi: occ: Fix checksum failure mode fsi: Fix typo in comment commit fd01b9b5b02b5eb0ff8aac748a86940e8113cf66 Author: Colin Ian King Date: Wed Sep 28 23:07:55 2022 +0100 net/mlx5: Fix spelling mistake "syndrom" -> "syndrome" There is a spelling mistake in a devlink_health_report message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 3b882a7bf6cded3af1589c4eae9b6153d6767c26 Author: Colin Ian King Date: Wed Sep 28 22:54:39 2022 +0100 net: bna: Fix spelling mistake "muliple" -> "multiple" There is a spelling mistake in a literal string in the array bnad_net_stats_strings. Fix it. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit a15e17acce5aaae54243f55a7349c2225450b9bc Author: Nathan Chancellor Date: Wed Sep 28 13:19:21 2022 -0700 usb: gadget: uvc: Fix argument to sizeof() in uvc_register_video() When building s390 allmodconfig after commit 9b91a6523078 ("usb: gadget: uvc: increase worker prio to WQ_HIGHPRI"), the following error occurs: In file included from ../include/linux/string.h:253, from ../include/linux/bitmap.h:11, from ../include/linux/cpumask.h:12, from ../include/linux/smp.h:13, from ../include/linux/lockdep.h:14, from ../include/linux/rcupdate.h:29, from ../include/linux/rculist.h:11, from ../include/linux/pid.h:5, from ../include/linux/sched.h:14, from ../include/linux/ratelimit.h:6, from ../include/linux/dev_printk.h:16, from ../include/linux/device.h:15, from ../drivers/usb/gadget/function/f_uvc.c:9: In function ‘fortify_memset_chk’, inlined from ‘uvc_register_video’ at ../drivers/usb/gadget/function/f_uvc.c:424:2: ../include/linux/fortify-string.h:301:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 301 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This points to the memset() in uvc_register_video(). It is clear that the argument to sizeof() is incorrect, as uvc->vdev (a 'struct video_device') is being zeroed out but the size of uvc->video (a 'struct uvc_video') is being used as the third arugment to memset(). pahole shows that prior to commit 9b91a6523078 ("usb: gadget: uvc: increase worker prio to WQ_HIGHPRI"), 'struct video_device' and 'struct ucv_video' had the same size, meaning that the argument to sizeof() is incorrect semantically but there is no visible issue: $ pahole -s build/drivers/usb/gadget/function/f_uvc.o | grep -E "(uvc_video|video_device)\s+" video_device 1400 4 uvc_video 1400 3 After that change, uvc_video becomes slightly larger, meaning that the memset() will overwrite by 8 bytes: $ pahole -s build/drivers/usb/gadget/function/f_uvc.o | grep -E "(uvc_video|video_device)\s+" video_device 1400 4 uvc_video 1408 3 Fix the arugment to sizeof() so that there is no overwrite. Cc: stable@vger.kernel.org Fixes: e4ce9ed835bc ("usb: gadget: uvc: ensure the vdev is unset") Signed-off-by: Nathan Chancellor Reviewed-by: Laurent Pinchart Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220928201921.3152163-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit a0d381caf99317977942e1228cdc2e14392e1d72 Author: Dmitry Torokhov Date: Tue Sep 27 15:05:04 2022 -0700 usb: host: ehci-exynos: switch to using gpiod API This patch switches the driver from using legacy gpio API to the newer gpiod API. Signed-off-by: Dmitry Torokhov Acked-by: Alan Stern Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220927220504.3744878-2-dmitry.torokhov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7a84e7353e23202d4f82b05093af4db2b26e6768 Author: Andy Shevchenko Date: Tue Sep 27 18:53:32 2022 +0300 Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" This reverts commit 0f01017191384e3962fa31520a9fd9846c3d352f. As pointed out by Ferry this breaks Dual Role support on Intel Merrifield platforms. Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") Reported-by: Ferry Toth Cc: stable@vger.kernel.org Signed-off-by: Andy Shevchenko Tested-by: Ferry Toth # for Merrifield Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20220927155332.10762-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2adc960ce79d3231b02f820daeee434542fe2911 Author: Andy Shevchenko Date: Tue Sep 27 18:53:31 2022 +0300 Revert "USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"" This reverts commit 8bd6b8c4b1009d7d2662138d6bdc6fe58a9274c5. Prerequisite revert for the reverting of the original commit 0f0101719138. Fixes: 8bd6b8c4b100 ("USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"") Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") Reported-by: Ferry Toth Cc: stable@vger.kernel.org Signed-off-by: Andy Shevchenko Tested-by: Ferry Toth # for Merrifield Link: https://lore.kernel.org/r/20220927155332.10762-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8e9204cddcc3fea9affcfa411715ba4f66e97587 Author: Marek Szyprowski Date: Fri Sep 30 13:34:08 2022 +0200 spi: Ensure that sg_table won't be used after being freed SPI code checks for non-zero sgt->orig_nents to determine if the buffer has been DMA-mapped. Ensure that sg_table is really zeroed after free to avoid potential NULL pointer dereference if the given SPI xfer object is reused again without being DMA-mapped. Fixes: 0c17ba73c08f ("spi: Fix cache corruption due to DMA/PIO overlap") Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220930113408.19720-1-m.szyprowski@samsung.com Signed-off-by: Mark Brown commit fb87c979fd89a262481a8c49e2b78b07e1f4d229 Author: Linus Walleij Date: Sun Sep 25 14:35:46 2022 +0200 dt-bindings: usb: Convert FOTG210 to dt schema This converts the Faraday FOTG210 OTG USB controller to use a YAML schema. We add all the right includes for OTG controllers and make it possible to specify dr_mode and phy. Cc: devicetree@vger.kernel.org Cc: Hans Ulli Kroll Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220925123546.770843-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1c703e29da5efac6180e4c189029fa34b7e48e97 Author: Chunfeng Yun Date: Thu Sep 29 14:44:59 2022 +0800 usb: mtu3: fix failed runtime suspend in host only mode When the dr_mode is "host", after the host enter runtime suspend, the mtu3 can't do it, because the mtu3's device wakeup function is not enabled, instead it's enabled in gadget init function, to fix the issue, init wakeup early in mtu3's probe() Fixes: 6b587394c65c ("usb: mtu3: support suspend/resume for dual-role mode") Reviewed-by: AngeloGioacchino Del Regno Reported-by: Tianping Fang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220929064459.32522-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 4b833fb3eb1e5c87f51211844b39743ccd01eac9 Author: Colin Ian King Date: Wed Sep 28 23:11:40 2022 +0100 USB: omap_udc: Fix spelling mistake: "tranceiver_ctrl" -> "transceiver_ctrl" There is a spelling mistake in the control name. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220928221140.67495-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 691f43cbfe631488cc3fe2d01658fd372c9ef0a7 Author: Sing-Han Chen Date: Wed Sep 28 23:08:40 2022 +0800 usb: typec: ucsi_ccg: Disable UCSI ALT support on Tegra Firmware built for Tegra doesn't support UCSI ALT command and has known issue of reporting wrong capability info. This commit disables UCSI ALT support when reading the capability on Tegra. Signed-off-by: Sing-Han Chen Signed-off-by: Wayne Chang Link: https://lore.kernel.org/r/20220928150840.3804313-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman commit c9180362a920b99f2aef7d55b89ae94b8138474e Author: Andy Shevchenko Date: Tue Sep 27 20:19:24 2022 +0300 usb: typec: Replace custom implementation of device_match_fwnode() Replace custom implementation of the device_match_fwnode(). Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220927171924.61908-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fce703a991b7e8c7e1371de95b9abaa832ecf9c3 Author: Wayne Chang Date: Tue Sep 27 21:45:12 2022 +0800 usb: typec: ucsi: Don't warn on probe deferral Deferred probe is an expected return value for fwnode_usb_role_switch_get(). Given that the driver deals with it properly, there's no need to output a warning that may potentially confuse users. -- V2 -> V3: remove the Fixes and Cc V1 -> V2: adjust the coding style for better reading format. drivers/usb/typec/ucsi/ucsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) Signed-off-by: Wayne Chang Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220927134512.2651067-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 37d49519b41405b08748392c6a7f193d9f77ecd2 Author: Jean-Francois Le Fillatre Date: Tue Sep 27 09:34:07 2022 +0200 usb: add quirks for Lenovo OneLink+ Dock The Lenovo OneLink+ Dock contains two VL812 USB3.0 controllers: 17ef:1018 upstream 17ef:1019 downstream These hubs suffer from two separate problems: 1) After the host system was suspended and woken up, the hubs appear to be in a random state. Some downstream ports (both internal to the built-in audio and network controllers, and external to USB sockets) may no longer be functional. The exact list of disabled ports (if any) changes from wakeup to wakeup. Ports remain in that state until the dock is power-cycled, or until the laptop is rebooted. Wakeup sources connected to the hubs (keyboard, WoL on the integrated gigabit controller) will wake the system up from suspend, but they may no longer work after wakeup (and in that case will no longer work as wakeup source in a subsequent suspend-wakeup cycle). This issue appears in the logs with messages such as: usb 1-6.1-port4: cannot disable (err = -71) usb 1-6-port2: cannot disable (err = -71) usb 1-6.1: clear tt 1 (80c0) error -71 usb 1-6-port4: cannot disable (err = -71) usb 1-6.4: PM: dpm_run_callback(): usb_dev_resume+0x0/0x10 [usbcore] returns -71 usb 1-6.4: PM: failed to resume async: error -71 usb 1-7: reset full-speed USB device number 5 using xhci_hcd usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad? usb 1-6.1-port1: cannot disable (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: cannot reset (err = -71) usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad? usb 1-6.1-port1: cannot disable (err = -71) 2) Some USB devices cannot be enumerated properly. So far I have only seen the issue with USB 3.0 devices. The same devices work without problem directly connected to the host system, to other systems or to other hubs (even when those hubs are connected to the OneLink+ dock). One very reliable reproducer is this USB 3.0 HDD enclosure: 152d:9561 JMicron Technology Corp. / JMicron USA Technology Corp. Mobius I have seen it happen sporadically with other USB 3.0 enclosures, with controllers from different manufacturers, all self-powered. Typical messages in the logs: xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 6, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 7, error -62 usb 2-1-port4: attempt power cycle xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 8, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 9, error -62 usb 2-1-port4: unable to enumerate USB device Through trial and error, I found that the USB_QUIRK_RESET_RESUME solved the second issue. Further testing then uncovered the first issue. Test results are summarized in this table: ======================================================================================= Settings USB2 hotplug USB3 hotplug State after waking up --------------------------------------------------------------------------------------- power/control=auto works fails broken usbcore.autosuspend=-1 works works broken OR power/control=on power/control=auto works (1) works (1) works and USB_QUIRK_RESET_RESUME power/control=on works works works and USB_QUIRK_RESET_RESUME HUB_QUIRK_DISABLE_AUTOSUSPEND works works works and USB_QUIRK_RESET_RESUME ======================================================================================= In those results, the power/control settings are applied to both hubs, both on the USB2 and USB3 side, before each test. From those results, USB_QUIRK_RESET_RESUME is required to reset the hubs properly after a suspend-wakeup cycle, and the hubs must not autosuspend to work around the USB3 issue. A secondary effect of USB_QUIRK_RESET_RESUME is to prevent the hubs' upstream links from suspending (the downstream ports can still suspend). This secondary effect is used in results (1). It is enough to solve the USB3 problem. Setting USB_QUIRK_RESET_RESUME on those hubs is the smallest patch that solves both issues. Prior to creating this patch, I have used the USB_QUIRK_RESET_RESUME via the kernel command line for over a year without noticing any side effect. Thanks to Oliver Neukum @Suse for explanations of the operations of USB_QUIRK_RESET_RESUME, and requesting more testing. Signed-off-by: Jean-Francois Le Fillatre Cc: stable Link: https://lore.kernel.org/r/20220927073407.5672-1-jflf_kernel@gmx.com Signed-off-by: Greg Kroah-Hartman commit bffcd14facbdc25ba4da9993cc7811b55b50b6e8 Merge: a62e6791476a5 5d2569cb4a65c Author: Greg Kroah-Hartman Date: Fri Sep 30 13:44:59 2022 +0200 Merge tag 'thunderbolt-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: "thunderbolt: Changes for v6.1 merge window This includes following Thunderbolt/USB4 changes for the v6.1 merge window: - Support for Intel Meteor Lake integrated Thunderbolt/USB4 controller - Support for ASMedia USB4 controller NVM firmware upgrade - Receiver lane margining support - Few fixes and cleanups. All these have been in linux-next with no reported issues." * tag 'thunderbolt-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Explicitly enable lane adapter hotplug events at startup thunderbolt: Use dev_err_probe() thunderbolt: Convert to use sysfs_emit()/sysfs_emit_at() APIs thunderbolt: Fix spelling mistake "simultaneusly" -> "simultaneously" thunderbolt: debugfs: Fix spelling mistakes in seq_puts text thunderbolt: Add support for ASMedia NVM image format thunderbolt: Move vendor specific NVM handling into nvm.c thunderbolt: Provide tb_retimer_nvm_read() analogous to tb_switch_nvm_read() thunderbolt: Rename and make nvm_read() available for other files thunderbolt: Extend NVM version fields to 32-bits thunderbolt: Allow NVM upgrade of USB4 host routers thunderbolt: Add support for receiver lane margining thunderbolt: Add helper to check if CL states are enabled on port thunderbolt: Pass CL state bitmask to tb_port_clx_supported() thunderbolt: Move port CL state functions into correct place in switch.c thunderbolt: Move tb_xdomain_parent() to tb.h thunderbolt: Add support for Intel Meteor Lake thunderbolt: Add comment where Thunderbolt 4 PCI IDs start thunderbolt: Add DP OUT resource when DP tunnel is discovered commit 10c2aba89cc0535b23ebc795f44b8b8b16785ec9 Author: Nick Child Date: Wed Sep 28 16:43:50 2022 -0500 ibmveth: Ethtool set queue support Implement channel management functions to allow dynamic addition and removal of transmit queues. The `ethtool --show-channels` and `ethtool --set-channels` commands can be used to get and set the number of queues, respectively. Allow the ability to add as many transmit queues as available processors but never allow more than the hard maximum of 16. The number of receive queues is one and cannot be modified. Depending on whether the requested number of queues is larger or smaller than the current value, either allocate or free long term buffers. Since long term buffer construction and destruction can occur in two different areas, from either channel set requests or device open/close, define functions for performing this work. If allocation of a new buffer fails, then attempt to revert back to the previous number of queues. Signed-off-by: Nick Child Signed-off-by: David S. Miller commit d926793c1de96e4e519b5489fe5be95a470c175f Author: Nick Child Date: Wed Sep 28 16:43:49 2022 -0500 ibmveth: Implement multi queue on xmit The `ndo_start_xmit` function is protected by a spinlock on the tx queue being used to transmit the skb. Allow concurrent calls to `ndo_start_xmit` by using more than one tx queue. This allows for greater throughput when several jobs are trying to transmit data. Introduce 16 tx queues (leave single rx queue as is) which each correspond to one DMA mapped long term buffer. Signed-off-by: Nick Child Signed-off-by: David S. Miller commit d6832ca48d8af0ec3d02d93c17027304c429c087 Author: Nick Child Date: Wed Sep 28 16:43:48 2022 -0500 ibmveth: Copy tx skbs into a premapped buffer Rather than DMA mapping and unmapping every outgoing skb, copy the skb into a buffer that was mapped during the drivers open function. Copying the skb and its frags have proven to be more time efficient than mapping and unmapping. As an effect, performance increases by 3-5 Gbits/s. Allocate and DMA map one continuous 64KB buffer at `ndo_open`. This buffer is maintained until `ibmveth_close` is called. This buffer is large enough to hold the largest possible linnear skb. During `ndo_start_xmit`, copy the skb and all of it's frags into the continuous buffer. By manually linnearizing all the socket buffers, time is saved during memcpy as well as more efficient handling in FW. As a result, we no longer need to worry about the firmware limitation of handling a max of 6 frags. So, we only need to maintain 1 descriptor instead of 6 and can hardcode 0 for the other 5 descriptors during h_send_logical_lan. Since, DMA allocation/mapping issues can no longer arise in xmit functions, we can further reduce code size by removing the need for a bounce buffer on DMA errors. Signed-off-by: Nick Child Signed-off-by: David S. Miller commit ea9b9a985d58d8e2abd91e8d7514b14398fe414f Author: Colin Ian King Date: Wed Sep 28 22:37:53 2022 +0100 bnx2: Fix spelling mistake "bufferred" -> "buffered" There are spelling mistakes in two literal strings. Fix these. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit f4ce91ce12a7c6ead19b128ffa8cff6e3ded2a14 Author: Neal Cardwell Date: Wed Sep 28 16:03:31 2022 -0400 tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited This commit fixes a bug in the tracking of max_packets_out and is_cwnd_limited. This bug can cause the connection to fail to remember that is_cwnd_limited is true, causing the connection to fail to grow cwnd when it should, causing throughput to be lower than it should be. The following event sequence is an example that triggers the bug: (a) The connection is cwnd_limited, but packets_out is not at its peak due to TSO deferral deciding not to send another skb yet. In such cases the connection can advance max_packets_seq and set tp->is_cwnd_limited to true and max_packets_out to a small number. (b) Then later in the round trip the connection is pacing-limited (not cwnd-limited), and packets_out is larger. In such cases the connection would raise max_packets_out to a bigger number but (unexpectedly) flip tp->is_cwnd_limited from true to false. This commit fixes that bug. One straightforward fix would be to separately track (a) the next window after max_packets_out reaches a maximum, and (b) the next window after tp->is_cwnd_limited is set to true. But this would require consuming an extra u32 sequence number. Instead, to save space we track only the most important information. Specifically, we track the strongest available signal of the degree to which the cwnd is fully utilized: (1) If the connection is cwnd-limited then we remember that fact for the current window. (2) If the connection not cwnd-limited then we track the maximum number of outstanding packets in the current window. In particular, note that the new logic cannot trigger the buggy (a)/(b) sequence above because with the new logic a condition where tp->packets_out > tp->max_packets_out can only trigger an update of tp->is_cwnd_limited if tp->is_cwnd_limited is false. This first showed up in a testing of a BBRv2 dev branch, but this buggy behavior highlighted a general issue with the tcp_cwnd_validate() logic that can cause cwnd to fail to increase at the proper rate for any TCP congestion control, including Reno or CUBIC. Fixes: ca8a22634381 ("tcp: make cwnd-limited checks measurement-based, and gentler") Signed-off-by: Neal Cardwell Signed-off-by: Kevin(Yudong) Yang Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 022152aaebe116a25c39818a07e175a8cd3c1e11 Author: Xin Long Date: Wed Sep 28 14:10:13 2022 -0400 sctp: handle the error returned from sctp_auth_asoc_init_active_key When it returns an error from sctp_auth_asoc_init_active_key(), the active_key is actually not updated. The old sh_key will be freeed while it's still used as active key in asoc. Then an use-after-free will be triggered when sending patckets, as found by syzbot: sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112 sctp_set_owner_w net/sctp/socket.c:132 [inline] sctp_sendmsg_to_asoc+0xbd5/0x1a20 net/sctp/socket.c:1863 sctp_sendmsg+0x1053/0x1d50 net/sctp/socket.c:2025 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 This patch is to fix it by not replacing the sh_key when it returns errors from sctp_auth_asoc_init_active_key() in sctp_auth_set_key(). For sctp_auth_set_active_key(), old active_key_id will be set back to asoc->active_key_id when the same thing happens. Fixes: 58acd1009226 ("sctp: update active_key for asoc when old key is being replaced") Reported-by: syzbot+a236dd8e9622ed8954a3@syzkaller.appspotmail.com Signed-off-by: Xin Long Signed-off-by: David S. Miller commit bd139381531987091d8c38e0d2c68faf1ad83668 Author: Steven Hsieh Date: Wed Sep 28 10:57:58 2022 -0700 net: bridge: assign path_cost for 2.5G and 5G link speed As 2.5G, 5G ethernet ports are more common and affordable, these ports are being used in LAN bridge devices. STP port_cost() is missing path_cost assignment for these link speeds, causes highest cost 100 being used. This result in lower speed port being picked when there is loop between 5G and 1G ports. Original path_cost: 10G=2, 1G=4, 100m=19, 10m=100 Adjusted path_cost: 10G=2, 5G=3, 2.5G=4, 1G=5, 100m=19, 10m=100 speed greater than 10G = 1 Signed-off-by: Steven Hsieh Signed-off-by: David S. Miller commit db7fccc122f4b5a6886e2a57b61019bdcab6dc22 Author: Colin Ian King Date: Wed Sep 28 15:36:18 2022 +0100 net: lan966x: Fix spelling mistake "tarffic" -> "traffic" There is a spelling mistake in a netdev_err message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2568a7e0832ee30b0a351016d03062ab4e0e0a3f Author: Duoming Zhou Date: Wed Sep 28 21:39:38 2022 +0800 mISDN: fix use-after-free bugs in l1oip timer handlers The l1oip_cleanup() traverses the l1oip_ilist and calls release_card() to cleanup module and stack. However, release_card() calls del_timer() to delete the timers such as keep_tl and timeout_tl. If the timer handler is running, the del_timer() will not stop it and result in UAF bugs. One of the processes is shown below: (cleanup routine) | (timer handler) release_card() | l1oip_timeout() ... | del_timer() | ... ... | kfree(hc) //FREE | | hc->timeout_on = 0 //USE Fix by calling del_timer_sync() in release_card(), which makes sure the timer handlers have finished before the resources, such as l1oip and so on, have been deallocated. What's more, the hc->workq and hc->socket_thread can kick those timers right back in. We add a bool flag to show if card is released. Then, check this flag in hc->workq and hc->socket_thread. Fixes: 3712b42d4b1b ("Add layer1 over IP support") Signed-off-by: Duoming Zhou Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit d427c8999b071af2003203b42a007c4a80156c18 Author: Richard Gobert Date: Wed Sep 28 14:55:31 2022 +0200 net-next: skbuff: refactor pskb_pull pskb_may_pull already contains all of the checks performed by pskb_pull. Use pskb_may_pull for validation in pskb_pull, eliminating the duplication and making __pskb_pull obsolete. Replace __pskb_pull with pskb_pull where applicable. Signed-off-by: Richard Gobert Signed-off-by: David S. Miller commit a62e6791476a5d07abb8dec9afc2c6d0f65f7e4e Author: Felipe Balbi Date: Thu Sep 29 10:48:44 2022 +0300 MAINTAINERS: switch dwc3 to Thinh Thinh Nguyen has agreed to become the new dwc3 maintainer seeing that I haven't had time to dedicate to the mailing list. Signed-off-by: Felipe Balbi Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20220929074844.351938-1-balbi@kernel.org Signed-off-by: Greg Kroah-Hartman commit 96e0718165a0d36ed4cba365c542818f20bf7640 Author: Wang Yufen Date: Wed Sep 28 20:30:14 2022 +0800 net: bonding: Convert to use sysfs_emit()/sysfs_emit_at() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Wang Yufen Signed-off-by: David S. Miller commit 73c2e90a0edc84751c4b95b12fc52051dd60f542 Author: Wang Yufen Date: Wed Sep 28 19:49:44 2022 +0800 net-sysfs: Convert to use sysfs_emit() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Wang Yufen Signed-off-by: David S. Miller commit aff3069954ef534bfbfa1f3d196cb1a6fa8b01b6 Author: Wang Yufen Date: Wed Sep 28 19:49:43 2022 +0800 net: tun: Convert to use sysfs_emit() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Wang Yufen Signed-off-by: David S. Miller commit e779ce9d17c44a338b4fa3be8715e3b7eb9706f0 Author: Peng Hao Date: Fri Sep 23 23:03:03 2022 +0800 kvm: vmx: keep constant definition format consistent Keep all constants using lowercase "x". Signed-off-by: Peng Hao Message-Id: Signed-off-by: Paolo Bonzini commit f96c48e9ddf40f6abf0a67aa94642701294daf79 Author: Peng Hao Date: Fri Sep 23 23:05:36 2022 +0800 kvm: mmu: fix typos in struct kvm_arch No 'kvmp_mmu_pages', it should be 'kvm_mmu_page'. And struct kvm_mmu_pages and struct kvm_mmu_page are different structures, here should be kvm_mmu_page. kvm_mmu_pages is defined in arch/x86/kvm/mmu/mmu.c. Suggested-by: David Matlack Signed-off-by: Peng Hao Reviewed-by: David Matlack Message-Id: Signed-off-by: Paolo Bonzini commit c99ad25b0d2bdb703a23217cfb0cf4bab364e9c7 Merge: 458e98746fa85 ea5cbc9ff8390 Author: Paolo Bonzini Date: Thu Sep 29 13:25:13 2022 -0400 Merge tag 'kvm-x86-6.1-2' of https://github.com/sean-jc/linux into HEAD KVM x86 updates for 6.1, batch #2: - Misc PMU fixes and cleanups. - Fixes for Hyper-V hypercall selftest commit 7bc08355a4917f2bbd38e7af5207f339f47e5d36 Author: Srinivas Kandagatla Date: Fri Sep 30 11:53:47 2022 +0100 ASoC: qcom: fix unmet direct dependencies for SND_SOC_QDSP6 SND_SOC_QDSP6 already has COMPILE_TEST so remove that from SND_SOC_SC8280XP and also add QCOM_APR dependencies to SND_SOC_SC8280XP like other Qualcomm machine drivers. This should also fix below warning: on x86_64, when QCOM_APR is not set and COMPILE_TEST=y: WARNING: unmet direct dependencies detected for SND_SOC_QDSP6 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && QCOM_APR [=n] && COMMON_CLK [=y] Selected by [y]: - SND_SOC_SC8280XP [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && (QCOM_APR [=n] || COMPILE_TEST [=y]) && SOUNDWIRE [=y] && COMMON_CLK [=y] Fixes: 295aeea6646a ("ASoC: qcom: add machine driver for sc8280xp") Reported-by: Randy Dunlap Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220930105347.41127-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 458e98746fa852d744d34b5a8d0b1673959efc2f Author: David Matlack Date: Thu Sep 29 11:12:07 2022 -0700 KVM: selftests: Fix nx_huge_pages_test on TDP-disabled hosts Map the test's huge page region with 2MiB virtual mappings when TDP is disabled so that KVM can shadow the region with huge pages. This fixes nx_huge_pages_test on hosts where TDP hardware support is disabled. Purposely do not skip this test on TDP-disabled hosts. While we don't care about NX Huge Pages on TDP-disabled hosts from a security perspective, KVM does support it, and so we should test it. For TDP-enabled hosts, continue mapping the region with 4KiB pages to ensure that KVM can map it with huge pages irrespective of the guest mappings. Fixes: 8448ec5993be ("KVM: selftests: Add NX huge pages test") Signed-off-by: David Matlack Message-Id: <20220929181207.2281449-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 4d2bd14319e4e0a49fc868c50ca0b2a747b58208 Author: David Matlack Date: Thu Sep 29 11:12:06 2022 -0700 KVM: selftests: Add helpers to read kvm_{intel,amd} boolean module parameters Add helper functions for reading the value of kvm_intel and kvm_amd boolean module parameters. Use the kvm_intel variant in vm_is_unrestricted_guest() to simplify the check for kvm_intel.unrestricted_guest. No functional change intended. Signed-off-by: David Matlack Message-Id: <20220929181207.2281449-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 62ece2c5a95cc989648c39155173d3bae27e89a3 Author: David Matlack Date: Thu Sep 29 11:12:05 2022 -0700 KVM: selftests: Tell the compiler that code after TEST_FAIL() is unreachable Add __builtin_unreachable() to TEST_FAIL() so that the compiler knows that any code after a TEST_FAIL() is unreachable. Signed-off-by: David Matlack Message-Id: <20220929181207.2281449-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit c96409d1e58905bfc8c73b630481228382ab8846 Author: Sean Christopherson Date: Wed Sep 28 23:36:52 2022 +0000 Revert "KVM: selftests: Fix nested SVM tests when built with clang" Revert back to using memset() in generic_svm_setup() now that KVM selftests override memset() and friends specifically to prevent the compiler from generating fancy code and/or linking to the libc implementation. This reverts commit ed290e1c20da19fa100a3e0f421aa31b65984960. Suggested-by: Jim Mattson Signed-off-by: Sean Christopherson Message-Id: <20220928233652.783504-8-seanjc@google.com> Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 53c9bdb922f40a7abf3b1642f8a39d3b94d10d62 Author: Sean Christopherson Date: Wed Sep 28 23:36:51 2022 +0000 KVM: selftests: Dedup subtests of fix_hypercall_test Combine fix_hypercall_test's two subtests into a common routine, the only difference between the two is whether or not the quirk is disabled. Passing a boolean is a little gross, but using an enum to make it super obvious that the callers are enabling/disabling the quirk seems like overkill. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Oliver Upton Message-Id: <20220928233652.783504-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit b7ab6d7d2cf7d5400592d1ff0448e8e0a09e5188 Author: Sean Christopherson Date: Wed Sep 28 23:36:50 2022 +0000 KVM: selftests: Explicitly verify KVM doesn't patch hypercall if quirk==off Explicitly verify that KVM doesn't patch in the native hypercall if the FIX_HYPERCALL_INSN quirk is disabled. The test currently verifies that a #UD occurred, but doesn't actually verify that no patching occurred. Signed-off-by: Sean Christopherson Message-Id: <20220928233652.783504-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit fca6d06cd164c6c3029be6323ed06020fca0d933 Author: Sean Christopherson Date: Wed Sep 28 23:36:49 2022 +0000 KVM: selftests: Hardcode VMCALL/VMMCALL opcodes in "fix hypercall" test Hardcode the VMCALL/VMMCALL opcodes in dedicated arrays instead of extracting the opcodes from inline asm, and patch in the "other" opcode so as to preserve the original opcode, i.e. the opcode that the test executes in the guest. Preserving the original opcode (by not patching the source), will make it easier to implement a check that KVM doesn't modify the opcode (the test currently only verifies that a #UD occurred). Use INT3 (0xcc) as the placeholder so that the guest will likely die a horrible death if the test's patching goes awry. As a bonus, patching from within the test dedups a decent chunk of code. Signed-off-by: Sean Christopherson Message-Id: <20220928233652.783504-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 04f2f60befc9af274c1790e626cc79334b1f4489 Author: Sean Christopherson Date: Wed Sep 28 23:36:48 2022 +0000 KVM: selftests: Remove unnecessary register shuffling in fix_hypercall_test Use input constraints to load RAX and RBX when testing that KVM correctly does/doesn't patch the "wrong" hypercall. There's no need to manually load RAX and RBX, and no reason to clobber them either (KVM is not supposed to modify anything other than RAX). Signed-off-by: Sean Christopherson Reviewed-by: Oliver Upton Message-Id: <20220928233652.783504-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ae404c219d6029030275c3f498028eb536fdd32d Merge: d742ea6b8e85f bb837a37db8d9 Author: David S. Miller Date: Fri Sep 30 11:32:54 2022 +0100 Merge branch 'net-tsnep-multiqueue' Gerhard Engleder says: ==================== tsnep: multi queue support and some other improvements Add support for additional TX/RX queues along with RX flow classification support. Binding is extended to allow additional interrupts for additional TX/RX queues. Also dma-coherent is allowed as minor improvement. RX path optimisation is done by using page pool as preparations for future XDP support. v4: - rework dma-coherent commit message (Krzysztof Kozlowski) - fixed order of interrupt-names in binding (Krzysztof Kozlowski) - add line break between examples in binding (Krzysztof Kozlowski) - add RX_CLS_LOC_ANY support to RX flow classification v3: - now with changes in cover letter v2: - use netdev_name() (Jakub Kicinski) - use ENOENT if RX flow rule is not found (Jakub Kicinski) - eliminate return code of tsnep_add_rule() (Jakub Kicinski) - remove commit with lazy refill due to depletion problem (Jakub Kicinski) ==================== Signed-off-by: David S. Miller commit bb837a37db8d9ce4c69c7c328e825ff35344df4f Author: Gerhard Engleder Date: Tue Sep 27 21:58:42 2022 +0200 tsnep: Use page pool for RX Use page pool for RX buffer handling. Makes RX path more efficient and is required prework for future XDP support. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 308ce1426509c18b4203dcaa38b9da858312a765 Author: Gerhard Engleder Date: Tue Sep 27 21:58:41 2022 +0200 tsnep: Add EtherType RX flow classification support Received Ethernet frames are assigned to first RX queue per default. Based on EtherType Ethernet frames can be assigned to other RX queues. This enables processing of real-time Ethernet protocols on dedicated RX queues. Add RX flow classification interface for EtherType based RX queue assignment. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 762031375d5ca1d36cf0a17d8430f42ad711ea90 Author: Gerhard Engleder Date: Tue Sep 27 21:58:40 2022 +0200 tsnep: Support multiple TX/RX queue pairs Support additional TX/RX queue pairs if dedicated interrupt is available. Interrupts are detected by name in device tree. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 58eaa8abe43a0c20e4b899d51f666393e95e4833 Author: Gerhard Engleder Date: Tue Sep 27 21:58:39 2022 +0200 tsnep: Move interrupt from device to queue For multiple queues multiple interrupts shall be used. Therefore, rework global interrupt to per queue interrupt. Every interrupt name shall contain interface name and queue information. To get a valid interface name, the interrupt request needs to by done during open like in other drivers. Additionally, this allows the removal of some initialisation checks in the interrupt handler. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 60e1b494ef88790c2bd1ca44dba0cc3e1f814aef Author: Gerhard Engleder Date: Tue Sep 27 21:58:38 2022 +0200 dt-bindings: net: tsnep: Allow additional interrupts Additional TX/RX queue pairs require dedicated interrupts. Extend binding with additional interrupts. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit ff46c610abd62a3dc120dc05ad726b2a47d347ea Author: Gerhard Engleder Date: Tue Sep 27 21:58:37 2022 +0200 dt-bindings: net: tsnep: Allow dma-coherent Within SoCs like ZynqMP, FPGA logic can be connected to different kinds of AXI master ports. Also cache coherent AXI master ports are available. The property "dma-coherent" is used to signal that DMA is cache coherent. Add "dma-coherent" property to allow the configuration of cache coherent DMA. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 6382da0828995af87aa8b8bef28cc61aceb4aff3 Author: Takashi Iwai Date: Fri Sep 30 12:01:51 2022 +0200 ALSA: usb-audio: Fix potential memory leaks When the driver hits -ENOMEM at allocating a URB or a buffer, it aborts and goes to the error path that releases the all previously allocated resources. However, when -ENOMEM hits at the middle of the sync EP URB allocation loop, the partially allocated URBs might be left without released, because ep->nurbs is still zero at that point. Fix it by setting ep->nurbs at first, so that the error handler loops over the full URB list. Cc: Link: https://lore.kernel.org/r/20220930100151.19461-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 568be8aaf8a535f79c4db76cabe17b035aa2584d Author: Takashi Iwai Date: Fri Sep 30 12:01:29 2022 +0200 ALSA: usb-audio: Fix NULL dererence at error path At an error path to release URB buffers and contexts, the driver might hit a NULL dererence for u->urb pointer, when u->buffer_size has been already set but the actual URB allocation failed. Fix it by adding the NULL check of urb. Also, make sure that buffer_size is cleared after the error path or the close. Cc: Reported-by: Sabri N. Ferreiro Link: https://lore.kernel.org/r/CAKG+3NRjTey+fFfUEGwuxL-pi_=T4cUskYG9OzpzHytF+tzYng@mail.gmail.com Link: https://lore.kernel.org/r/20220930100129.19445-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4674284aa74cfc6db0c54c16f9557ed8c3552409 Author: Nícolas F. R. A. Prado Date: Thu Sep 29 16:54:53 2022 -0400 ASoC: mediatek: mt8192-mt6359: Set the driver name for the card The ASoC core automatically populates the driver name field in the card from the card name if left unset. However, since the driver name can be at most 16 characters long, wrapping will happen if the card name is longer, which is the case for the mt8192-mt6359 driver. Explicitly set the driver name for the card in order to avoid said wrapping and have a readable driver name exposed to userspace. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220929205453.1144142-1-nfraprado@collabora.com Signed-off-by: Mark Brown commit bfdc750c4cb2f3461b9b00a2755e2145ac195c9a Author: Ping Cheng Date: Wed Sep 28 13:49:29 2022 -0700 HID: wacom: add three styli to wacom_intuos_get_tool_type We forgot to add the 3D pen ID a year ago. There are two new pro pen IDs to be added. Signed-off-by: Ping Cheng Signed-off-by: Jiri Kosina commit 35a1744423743247026668e2323d1b932583fc2a Author: Takashi Iwai Date: Fri Sep 30 10:48:10 2022 +0200 ALSA: hda/realtek: More robust component matching for CS35L41 As the previous commit implies, a system may have a different SPI bus number that is embedded in the device string. And, assuming the fixed bus number is rather fragile; it may be assigned differently depending on the configuration or on the boot environment. Once when a bus number change happens, the binding fails, resulting in the silence. This patch tries to make the matching a bit more relaxed, allowing to bind with a different bus number (or without it). So the previous fix, the introduction of ALC245_FIXUP_CS35L41_SPI1_2 fixup became superfluous, and this is unified to ALC245_FIXUP_CS35L41_SPI_2. Fixes: 225f6e1bc151 ("ALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model") Link: https://lore.kernel.org/r/20220930084810.10435-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8535a1afff0f4f568eb589f3795a930ef3d483b0 Author: Michael Ellerman Date: Fri Sep 30 18:27:09 2022 +1000 powerpc/pseries: Add firmware details to the hardware description Add firmware version details to the hardware description, which is printed at boot and in case of an oops. Use /hypervisor if we find it, though currently it only exists if we're running under qemu. Look for "ibm,powervm-partition" which is specified in PAPR+ v2.11 and tells us we're running under PowerVM. Failing that look for "ibm,fw-net-version" which is seen on PowerVM going back to at least Power6. eg: Hardware name: ... of:IBM,FW860.42 (SV860_138) hv:phyp Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-6-mpe@ellerman.id.au commit 37576cb0961fe9d3318c17e4e4bc5ecebf38e9bb Author: Michael Ellerman Date: Fri Sep 30 18:27:08 2022 +1000 powerpc/powernv: Add opal details to the hardware description Add OPAL version details to the hardware description, which is printed at boot and in case of an oops. eg: Hardware name: ... opal:v6.2 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-5-mpe@ellerman.id.au commit 541229707970ff2ad3f7705b1dbd025d7cc9bc48 Author: Michael Ellerman Date: Fri Sep 30 18:27:07 2022 +1000 powerpc: Add device-tree model to the hardware description Add the model of the machine we're on to the hardware description, which is printed at boot and in case of an oops. eg: Hardware name: IBM,8247-22L Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-4-mpe@ellerman.id.au commit 48b7019b6abd029d3800620bb53f0ae3ca052441 Author: Michael Ellerman Date: Fri Sep 30 18:27:06 2022 +1000 powerpc/64: Add logical PVR to the hardware description If we detect a logical PVR add that to the hardware description, which is printed at boot and in case of an oops. eg: Hardware name: ... 0xf000004 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-3-mpe@ellerman.id.au commit bd649d40e0f2ffa1e16b4dbb93dc627177410e78 Author: Michael Ellerman Date: Fri Sep 30 18:27:05 2022 +1000 powerpc: Add PVR & CPU name to hardware description Add the PVR and CPU name to the hardware description, which is printed at boot and in case of an oops. eg: Hardware name: ... POWER8E (raw) 0x4b0201 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-2-mpe@ellerman.id.au commit 41dc056391b334fae646b55ee020bfa8f67b60c8 Author: Michael Ellerman Date: Fri Sep 30 18:27:04 2022 +1000 powerpc: Add hardware description string Create a hardware description string, which we will use to record various details of the hardware platform we are running on. Print the accumulated description at boot, and use it to set the generic description which is printed in oopses. To begin with add ppc_md.name, aka the "machine description". Example output at boot with the full series applied: Linux version 6.0.0-rc2-gcc-11.1.0-00199-g893f9007a5ce-dirty (michael@alpine1-p1) (powerpc64-linux-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #844 SMP Thu Sep 29 22:29:53 AEST 2022 Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1200 0xf000005 of:SLOF,git-5b4c5a pSeries printk: bootconsole [udbg0] enabled Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220930082709.55830-1-mpe@ellerman.id.au commit d91c3f15fcaf90723ebdcd1c9172f9bb8ea4f09b Author: Michael Ellerman Date: Thu Sep 29 15:15:17 2022 +1000 powerpc/configs: Enable PPC_UV in powernv_defconfig Make sure the ultravisor code at least gets some build testing by enabling it in powernv_defconfig. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220929051517.1903079-1-mpe@ellerman.id.au commit d210ee3fdfe8584f84f8fdd0ac4a9895d023325b Author: Lukas Bulwahn Date: Thu Sep 29 12:15:02 2022 +0200 powerpc/configs: Update config files for removed/renamed symbols Clean up config files by: - removing configs that were deleted in the past - removing configs not in tree and without recently pending patches - adding new configs that are replacements for old configs in the file For some detailed information, see: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Renamed: - CONFIG_PPC_PTDUMP -> CONFIG_GENERIC_PTDUMP e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") Removed: - CONFIG_BLK_DEV_CRYPTOLOOP 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer") - CONFIG_CRYPTO_RMD128 b21b9a5e0aef ("crypto: rmd128 - remove RIPE-MD 128 hash algorithm") - CONFIG_CRYPTO_RMD256 c15d4167f0b0 ("crypto: rmd256 - remove RIPE-MD 256 hash algorithm") - CONFIG_CRYPTO_RMD320 93f64202926f ("crypto: rmd320 - remove RIPE-MD 320 hash algorithm") - CONFIG_CRYPTO_SALSA20 663f63ee6d9c ("crypto: salsa20 - remove Salsa20 stream cipher algorithm") - CONFIG_CRYPTO_TGR192 87cd723f8978 ("crypto: tgr192 - remove Tiger 128/160/192 hash algorithms") - CONFIG_HARDENED_USERCOPY_PAGESPAN 1109a5d90701 ("usercopy: Remove HARDENED_USERCOPY_PAGESPAN") - CONFIG_RAPIDIO_TSI568, CONFIG_RAPIDIO_TSI57X 612d4904191f ("rapidio: remove not used code about RIO_VID_TUNDRA") - CONFIG_RAW_DRIVER 603e4922f1c8 ("remove the raw driver") - CONFIG_ROCKETPORT 3b00b6af7a5b ("tty: rocket, remove the driver") - CONFIG_ENABLE_MUST_CHECK 196793946264 ("Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK") Signed-off-by: Lukas Bulwahn [mpe: Add documentation of relevant commit for each symbol change] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220929101502.32527-1-lukas.bulwahn@gmail.com commit 7dd3a7b90bca2c12e2146a47d63cf69a2f5d7e89 Author: Aneesh Kumar K.V Date: Thu Sep 8 12:54:40 2022 +0530 powerpc/mm: Fix UBSAN warning reported on hugetlb Powerpc architecture supports 16GB hugetlb pages with hash translation. For 4K page size, this is implemented as a hugepage directory entry at PGD level and for 64K it is implemented as a huge page pte at PUD level With 16GB hugetlb size, offset within a page is greater than 32 bits. Hence switch to use unsigned long type when using hugepd_shift. In order to keep things simpler, we make sure we always use unsigned long type when using hugepd_shift() even though all the hugetlb page size won't require that. The hugetlb_free_p*d_range changes are all related to nohash usage where we can have multiple pgd entries pointing to the same hugepd entries. Hence on book3s64 where we can have > 4GB hugetlb page size we will always find more < next even if we compute the value of more correctly. Hence there is no functional change in this patch except that it fixes the below warning. UBSAN: shift-out-of-bounds in arch/powerpc/mm/hugetlbpage.c:499:21 shift exponent 34 is too large for 32-bit type 'int' CPU: 39 PID: 1673 Comm: a.out Not tainted 6.0.0-rc2-00327-gee88a56e8517-dirty #1 Call Trace: dump_stack_lvl+0x98/0xe0 (unreliable) ubsan_epilogue+0x18/0x70 __ubsan_handle_shift_out_of_bounds+0x1bc/0x390 hugetlb_free_pgd_range+0x5d8/0x600 free_pgtables+0x114/0x290 exit_mmap+0x150/0x550 mmput+0xcc/0x210 do_exit+0x420/0xdd0 do_group_exit+0x4c/0xd0 sys_exit_group+0x24/0x30 system_call_exception+0x250/0x600 system_call_common+0xec/0x250 Signed-off-by: Aneesh Kumar K.V [mpe: Drop generic change to be sent separately, change 1ULL to 1UL] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908072440.258301-1-aneesh.kumar@linux.ibm.com commit 7b31f7dadd7074fa70bb14a53bd286ffdfc98b04 Author: Aneesh Kumar K.V Date: Mon Jul 4 12:08:51 2022 +0530 powerpc/mm: Always update max/min_low_pfn in mem_topology_setup() For both CONFIG_NUMA enabled/disabled use mem_topology_setup() to update max/min_low_pfn. This also adds min_low_pfn update to CONFIG_NUMA which was initialized to zero before. (mpe: Though MEMORY_START is == 0 for PPC64=y which is all possible NUMA=y systems) Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220704063851.295482-1-aneesh.kumar@linux.ibm.com commit d368e0c478a628f36680650f8d1d1634037b046e Author: Aneesh Kumar K.V Date: Wed Sep 7 13:49:41 2022 +0530 powerpc/mm/book3s/hash: Rename flush_tlb_pmd_range This function does the hash page table update. Hence rename it to indicate this better to avoid confusion with flush_pmd_tlb_range() Signed-off-by: Aneesh Kumar K.V [mpe: Drop unnecessary extern] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220907081941.209501-1-aneesh.kumar@linux.ibm.com commit 7673335e2a0b8e68a2a238773a34e287a089a8fe Author: Michael Ellerman Date: Wed Sep 28 23:09:51 2022 +1000 powerpc: Drops STABS_DEBUG from linker scripts No toolchain we support should be generating stabs debug information anymore. Drop the sections entirely from our linker scripts. We removed all the manual stabs annotations in commit 12318163737c ("powerpc/32: Remove remaining .stabs annotations"). Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220928130951.1732983-1-mpe@ellerman.id.au commit 0c360996425e36945c10479e2bc6ad5992c57794 Author: Michael Ellerman Date: Wed Sep 28 23:09:41 2022 +1000 powerpc/64s: Remove lost/old comment The bulk of this was moved/reworded in: 57f266497d81 ("powerpc: Use gas sections for arranging exception vectors") And now appears around line 700 in arch/powerpc/kernel/exceptions-64s.S. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220928130941.1732818-1-mpe@ellerman.id.au commit 57a8e4b26eaa8f30aa8bc737255d192915a53023 Author: Michael Ellerman Date: Wed Sep 28 23:09:12 2022 +1000 powerpc/64s: Remove old STAB comment This used to be about the 0x4300 handler, but that was moved in commit da2bc4644c75 ("powerpc/64s: Add new exception vector macros"). Note that "STAB" here refers to "Segment Table" not the debug format. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220928130912.1732466-1-mpe@ellerman.id.au commit a08661af4c52068972c552deb940b3b13635eb3e Author: Nicholas Piggin Date: Thu Sep 29 13:21:20 2022 +1000 powerpc: remove orphan systbl_chk.sh arch/powerpc/kernel/systbl_chk.sh has not been referenced since commit ab66dcc76d6a ("powerpc: generate uapi header and system call table files"). Remove it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220929032120.3592593-1-npiggin@gmail.com commit f3e5d9e53e74d77e711a2c90a91a8b0836a9e0b3 Author: Haren Myneni Date: Wed Sep 28 18:57:33 2022 -0700 powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL Generally the hypervisor decides to allocate a window on different VAS instances. But if user space wishes to allocate on the current VAS instance where the process is executing, the kernel has to pass associativity domain IDs to allocate VAS window HCALL. To determine the associativity domain IDs for the current CPU, smp_processor_id() is passed to node associativity HCALL which may return H_P2 (-55) error during DLPAR CPU event. This is because Linux CPU numbers (smp_processor_id()) are not the same as the hypervisor's view of CPU numbers. Fix the issue by passing hard_smp_processor_id() with VPHN_FLAG_VCPU flag (PAPR 14.11.6.1 H_HOME_NODE_ASSOCIATIVITY). Fixes: b22f2d88e435 ("powerpc/pseries/vas: Integrate API with open/close windows") Reviewed-by: Nathan Lynch Signed-off-by: Haren Myneni [mpe: Update change log to mention Linux vs HV CPU numbers] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/55380253ea0c11341824cd4c0fc6bbcfc5752689.camel@linux.ibm.com commit e4335f53198fa0c0aefb2a38bb5518e94253412c Author: Nicholas Piggin Date: Thu Sep 8 23:25:45 2022 +1000 KVM: PPC: Book3S HV: Implement scheduling wait interval counters in the VPA PAPR specifies accumulated virtual processor wait intervals that relate to partition scheduling interval times. Implement these counters in the same way as they are repoted by dtl. Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908132545.4085849-5-npiggin@gmail.com commit 9511b5a033e99070ae1f54cd3c0aa3d10eae7c26 Merge: 335e1a9104276 1a5486b3c3517 Author: Michael Ellerman Date: Fri Sep 30 18:35:16 2022 +1000 Merge branch 'topic/ppc-kvm' into next Merge some KVM commits we are keeping in our topic branch. commit 68266bdcceec10ea364e62c63732cd6fe5a256a8 Author: Basavaraj Natikar Date: Tue Sep 27 15:57:26 2022 +0530 HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 Based on num_hid_devices, each sensor device registers to HID. If "no sensors" then amd_sfh work initialization and scheduling doesn’t make sense and return ENODEV to stop driver probe. Hence add a check for num_hid_devices to handle special case in the situation of "no sensors" for SFH1.1. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit beb18bb22cd4fb88648bb2925d56f36131c1ac21 Author: Basavaraj Natikar Date: Tue Sep 27 15:57:25 2022 +0530 HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Users should only be notified at most one time on systems doesn't have any sensors connected or non-supported systems. Check the return code and don't display error messages in those conditions. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 53630a1f6186e9df5fb75e9b55328e22b64de150 Merge: c704cf27a1adc a0caebbd04602 Author: Catalin Marinas Date: Fri Sep 30 09:18:26 2022 +0100 Merge branch 'for-next/misc' into for-next/core * for-next/misc: : Miscellaneous patches arm64/kprobe: Optimize the performance of patching single-step slot ARM64: reloc_test: add __init/__exit annotations to module init/exit funcs arm64/mm: fold check for KFENCE into can_set_direct_map() arm64: uaccess: simplify uaccess_mask_ptr() arm64: mte: move register initialization to C arm64: mm: handle ARM64_KERNEL_USES_PMD_MAPS in vmemmap_populate() arm64: dma: Drop cache invalidation from arch_dma_prep_coherent() arm64: support huge vmalloc mappings arm64: spectre: increase parameters that can be used to turn off bhb mitigation individually arm64: run softirqs on the per-CPU IRQ stack arm64: compat: Implement misalignment fixups for multiword loads commit c704cf27a1adc5fa40fb8e40b5617bdca889a419 Merge: c397623262fad ba00c2a04fa54 Author: Catalin Marinas Date: Fri Sep 30 09:18:22 2022 +0100 Merge branch 'for-next/alternatives' into for-next/core * for-next/alternatives: : Alternatives (code patching) improvements arm64: fix the build with binutils 2.27 arm64: avoid BUILD_BUG_ON() in alternative-macros arm64: alternatives: add shared NOP callback arm64: alternatives: add alternative_has_feature_*() arm64: alternatives: have callbacks take a cap arm64: alternatives: make alt_region const arm64: alternatives: hoist print out of __apply_alternatives() arm64: alternatives: proton-pack: prepare for cap changes arm64: alternatives: kvm: prepare for cap changes arm64: cpufeature: make cpus_have_cap() noinstr-safe commit c397623262fada5df2f92a861000957c36f330c1 Merge: b23ec74cbd7ac a711987490a17 Author: Catalin Marinas Date: Fri Sep 30 09:18:11 2022 +0100 Merge branch 'for-next/kselftest' into for-next/core * for-next/kselftest: (28 commits) : Kselftest updates for arm64 kselftest/arm64: Handle EINTR while reading data from children kselftest/arm64: Flag fp-stress as exiting when we begin finishing up kselftest/arm64: Don't repeat termination handler for fp-stress kselftest/arm64: Don't enable v8.5 for MTE selftest builds kselftest/arm64: Fix typo in hwcap check kselftest/arm64: Add hwcap test for RNG kselftest/arm64: Add SVE 2 to the tested hwcaps kselftest/arm64: Add missing newline in hwcap output kselftest/arm64: Fix spelling misakes of signal names kselftest/arm64: Enforce actual ABI for SVE syscalls kselftest/arm64: Correct buffer allocation for SVE Z registers kselftest/arm64: Include larger SVE and SME VLs in signal tests kselftest/arm64: Allow larger buffers in get_signal_context() kselftest/arm64: Preserve any EXTRA_CONTEXT in handle_signal_copyctx() kselftest/arm64: Validate contents of EXTRA_CONTEXT blocks kselftest/arm64: Only validate each signal context once kselftest/arm64: Remove unneeded protype for validate_extra_context() kselftest/arm64: Fix validation of EXTRA_CONTEXT signal context location kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT kselftest/arm64: Validate signal ucontext in place ... commit b23ec74cbd7ac0d141ee4d17235b08336fbd6612 Merge: aa3e49b606e07 d09ee410a3c30 81ff692ad924d db74cd6337d26 9025cebf12d17 4b5e694e25ca2 78f6f5c994ed2 830a2a4d853f2 1bdb0fbb2e27c d56f66d2bd4a7 2ddadec2206ca 8cfb08575c6d4 Author: Catalin Marinas Date: Fri Sep 30 09:17:57 2022 +0100 Merge branches 'for-next/doc', 'for-next/sve', 'for-next/sysreg', 'for-next/gettimeofday', 'for-next/stacktrace', 'for-next/atomics', 'for-next/el1-exceptions', 'for-next/a510-erratum-2658417', 'for-next/defconfig', 'for-next/tpidr2_el0' and 'for-next/ftrace', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: arm64: asm/perf_regs.h: Avoid C++-style comment in UAPI header arm64/sve: Add Perf extensions documentation perf: arm64: Add SVE vector granule register to user regs MAINTAINERS: add maintainers for Alibaba' T-Head PMU driver drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC docs: perf: Add description for Alibaba's T-Head PMU driver * for-next/doc: : Documentation/arm64 updates arm64/sve: Document our actual ABI for clearing registers on syscall * for-next/sve: : SVE updates arm64/sysreg: Add hwcap for SVE EBF16 * for-next/sysreg: (35 commits) : arm64 system registers generation (more conversions) arm64/sysreg: Fix a few missed conversions arm64/sysreg: Convert ID_AA64AFRn_EL1 to automatic generation arm64/sysreg: Convert ID_AA64DFR1_EL1 to automatic generation arm64/sysreg: Convert ID_AA64FDR0_EL1 to automatic generation arm64/sysreg: Use feature numbering for PMU and SPE revisions arm64/sysreg: Add _EL1 into ID_AA64DFR0_EL1 definition names arm64/sysreg: Align field names in ID_AA64DFR0_EL1 with architecture arm64/sysreg: Add defintion for ALLINT arm64/sysreg: Convert SCXTNUM_EL1 to automatic generation arm64/sysreg: Convert TIPDR_EL1 to automatic generation arm64/sysreg: Convert ID_AA64PFR1_EL1 to automatic generation arm64/sysreg: Convert ID_AA64PFR0_EL1 to automatic generation arm64/sysreg: Convert ID_AA64MMFR2_EL1 to automatic generation arm64/sysreg: Convert ID_AA64MMFR1_EL1 to automatic generation arm64/sysreg: Convert ID_AA64MMFR0_EL1 to automatic generation arm64/sysreg: Convert HCRX_EL2 to automatic generation arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 SME enumeration arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 BTI enumeration arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 fractional version fields arm64/sysreg: Standardise naming for MTE feature enumeration ... * for-next/gettimeofday: : Use self-synchronising counter access in gettimeofday() (if FEAT_ECV) arm64: vdso: use SYS_CNTVCTSS_EL0 for gettimeofday arm64: alternative: patch alternatives in the vDSO arm64: module: move find_section to header * for-next/stacktrace: : arm64 stacktrace cleanups and improvements arm64: stacktrace: track hyp stacks in unwinder's address space arm64: stacktrace: track all stack boundaries explicitly arm64: stacktrace: remove stack type from fp translator arm64: stacktrace: rework stack boundary discovery arm64: stacktrace: add stackinfo_on_stack() helper arm64: stacktrace: move SDEI stack helpers to stacktrace code arm64: stacktrace: rename unwind_next_common() -> unwind_next_frame_record() arm64: stacktrace: simplify unwind_next_common() arm64: stacktrace: fix kerneldoc comments * for-next/atomics: : arm64 atomics improvements arm64: atomic: always inline the assembly arm64: atomics: remove LL/SC trampolines * for-next/el1-exceptions: : Improve the reporting of EL1 exceptions arm64: rework BTI exception handling arm64: rework FPAC exception handling arm64: consistently pass ESR_ELx to die() arm64: die(): pass 'err' as long arm64: report EL1 UNDEFs better * for-next/a510-erratum-2658417: : Cortex-A510: 2658417: remove BF16 support due to incorrect result arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510 arm64: cpufeature: Expose get_arm64_ftr_reg() outside cpufeature.c arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space * for-next/defconfig: : arm64 defconfig updates arm64: defconfig: Add Coresight as module arm64: Enable docker support in defconfig arm64: defconfig: Enable memory hotplug and hotremove config arm64: configs: Enable all PMUs provided by Arm * for-next/tpidr2_el0: : arm64 ptrace() support for TPIDR2_EL0 kselftest/arm64: Add coverage of TPIDR2_EL0 ptrace interface arm64/ptrace: Support access to TPIDR2_EL0 arm64/ptrace: Document extension of NT_ARM_TLS to cover TPIDR2_EL0 kselftest/arm64: Add test coverage for NT_ARM_TLS * for-next/ftrace: : arm64 ftraces updates/fixes arm64: ftrace: fix module PLTs with mcount arm64: module: Remove unused plt_entry_is_initialized() arm64: module: Make plt_equals_entry() static commit a0caebbd04602cb7d28f6f316213a915ffab92a2 Author: Liao Chang Date: Tue Sep 27 10:24:35 2022 +0800 arm64/kprobe: Optimize the performance of patching single-step slot Single-step slot would not be used until kprobe is enabled, that means no race condition occurs on it under SMP, hence it is safe to pacth ss slot without stopping machine. Since I and D caches are coherent within single-step slot from aarch64_insn_patch_text_nosync(), hence no need to do it again via flush_icache_range(). Acked-by: Will Deacon Acked-by: Masami Hiramatsu (Google) Signed-off-by: Liao Chang Link: https://lore.kernel.org/r/20220927022435.129965-4-liaochang1@huawei.com Signed-off-by: Catalin Marinas commit 4157155df7d34bd91879c06a787944529f0d9a0d Author: Brent Lu Date: Tue Sep 13 15:49:06 2022 +0800 ASoC: Intel: sof_rt5682: remove SOF_RT1015_SPEAKER_AMP_100FS flag This flag could be removed since we now have API to query bclk fequency setting in the topology. The dai link structure itself also provides DAI format information instead of figuring it out with fs number. Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220913074906.926774-1-brent.lu@intel.com Signed-off-by: Mark Brown commit dacdef1bd2fc6e1ab528fa16d70756965cd2877b Author: David Lin Date: Fri Sep 30 15:28:05 2022 +0800 ASoC: nau8825: Add TDM support Support TDM format for NAU88L25. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20220930072804.2524352-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit d488b28502d7c22b1b50f0543da119748e575919 Merge: c8d18e4402251 b73f11e895e14 Author: Mark Brown Date: Fri Sep 30 09:15:58 2022 +0100 Fix PM disable depth imbalance in probe Merge series from Zhang Qilong : The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of probe. Zhang Qilong (4): ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe sound/soc/codecs/mt6660.c | 8 ++++++-- sound/soc/codecs/wm5102.c | 6 +++--- sound/soc/codecs/wm5110.c | 6 +++--- sound/soc/codecs/wm8997.c | 6 +++--- 4 files changed, 15 insertions(+), 11 deletions(-) -- 2.25.1 commit c39596f6ad1bfe65fc2d926e0703cf26e3fae90a Merge: 48ff45dade87e 28b5dbd5dcf76 Author: Steffen Klassert Date: Fri Sep 30 09:49:33 2022 +0200 Merge branch 'xfrm: add netlink extack to all the ->init_stat' Sabrina Dubroca says: ============ This series completes extack support for state creation. ============ Signed-off-by: Steffen Klassert commit 607e57c6c62c00965ae276902c166834ce73014a Author: Kees Cook Date: Thu Sep 29 22:57:43 2022 -0700 hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero Now that Clang's -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang option is no longer required, remove it from the command line. Clang 16 and later will warn when it is used, which will cause Kconfig to think it can't use -ftrivial-auto-var-init=zero at all. Check for whether it is required and only use it when so. Cc: Nathan Chancellor Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: linux-kbuild@vger.kernel.org Cc: llvm@lists.linux.dev Cc: stable@vger.kernel.org Fixes: f02003c860d9 ("hardening: Avoid harmless Clang option under CONFIG_INIT_STACK_ALL_ZERO") Signed-off-by: Kees Cook commit b411b1a0c8bddd470fc8c3457629ac25a168cba0 Author: Shang XiaoJing Date: Fri Sep 23 18:01:59 2022 +0800 crypto: aspeed - Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Signed-off-by: Herbert Xu commit d438d94d6483c379935d94a7dcc2d1bf9cdf0803 Author: Gaosheng Cui Date: Fri Sep 23 17:08:23 2022 +0800 crypto: scatterwalk - Remove unused inline function scatterwalk_aligned() The scatterwalk_aligned() are no longer used since removing blkcipher and ablkcipher support, all use of it has been removed since commit d63007eb954e ("crypto: ablkcipher - remove deprecated and unused ablkcipher support"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Herbert Xu commit d126edd77148e0eacf27039a14b32d1c5ac51c6e Author: Gaosheng Cui Date: Fri Sep 23 17:08:22 2022 +0800 crypto: aead - Remove unused inline functions from aead The aead_enqueue_request, aead_dequeue_request and aead_get_backlog are no longer used since commit 04a4616e6a21 ("crypto: omap-aes-gcm - convert to use crypto engine"), their functinoality has been replaced by crypto engine, so remove them. Signed-off-by: Gaosheng Cui Signed-off-by: Herbert Xu commit 5e9578b29aff681ec30a3866c049305e26629a41 Author: Gaosheng Cui Date: Fri Sep 23 17:08:21 2022 +0800 crypto: bcm - Simplify obtain the name for cipher The crypto_ahash_alg_name(tfm) can obtain the name for cipher in include/crypto/hash.h, but now the function is not in use, so we use it to simplify the code, and optimize the code structure. Signed-off-by: Gaosheng Cui Signed-off-by: Herbert Xu commit edfc7e76d2252eebb98328b23e09336d47810569 Author: ye xingchen Date: Fri Sep 23 01:29:52 2022 +0000 crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf() Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit b006c439d58db625318bf2207feabf847510a8a6 Author: Dominik Brodowski Date: Thu Sep 22 15:59:31 2022 +0200 hwrng: core - start hwrng kthread also for untrusted sources Start the hwrng kthread even if the hwrng source has a quality setting of zero. Then, every crng reseed interval, one batch of data from this zero-quality hwrng source will be mixed into the CRNG pool. This patch is based on the assumption that data from a hwrng source will not actively harm the CRNG state. Instead, many hwrng sources (such as TPM devices), even though they are assigend a quality level of zero, actually provide some entropy, which is good enough to mix into the CRNG pool every once in a while. Cc: Herbert Xu Cc: Jason A. Donenfeld Signed-off-by: Dominik Brodowski Signed-off-by: Herbert Xu commit 4edff849f7a0abca962374512907b3e2151091f4 Author: ye xingchen Date: Thu Sep 22 11:27:53 2022 +0000 crypto: zip - remove the unneeded result variable Return the value directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Herbert Xu commit 72f6e0ea2b0ecea8585f3cd4298286c85c5121e6 Author: Adam Guerin Date: Wed Sep 21 10:38:30 2022 +0100 crypto: qat - add limit to linked list parsing adf_copy_key_value_data() copies data from userland to kernel, based on a linked link provided by userland. If userland provides a circular list (or just a very long one) then it would drive a long loop where allocation occurs in every loop. This could lead to low memory conditions. Adding a limit to stop endless loop. Signed-off-by: Adam Guerin Co-developed-by: Ciunas Bennett Signed-off-by: Ciunas Bennett Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 0cb3c9cdf7fcc2ef75a6008223d2e3ee58ea00e1 Author: ye xingchen Date: Tue Sep 20 06:47:54 2022 +0000 crypto: octeontx2 - Remove the unneeded result variable Return the value otx2_cpt_send_mbox_msg() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Herbert Xu commit 6a40fb0d9db15f95b9ea884fbaedf8f82c51399f Author: ye xingchen Date: Tue Sep 20 06:32:52 2022 +0000 crypto: ccp - Remove the unneeded result variable Return the value ccp_crypto_enqueue_request() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: John Allen Signed-off-by: Herbert Xu commit 70513e1d65599f39aba4fa6594546f7c81fa59f4 Author: YueHaibing Date: Tue Sep 20 11:21:18 2022 +0800 crypto: aspeed - Fix check for platform_get_irq() errors The platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Also remove redundant dev_err() print as platform_get_irq() already prints an error. Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver") Signed-off-by: YueHaibing Reviewed-by: Neal Liu Signed-off-by: Herbert Xu commit 4a209078656c3ada49c81d69c4b556be2dda1310 Author: lei he Date: Mon Sep 19 15:51:58 2022 +0800 crypto: virtio - fix memory-leak Fix memory-leak for virtio-crypto akcipher request, this problem is introduced by 59ca6c93387d3(virtio-crypto: implement RSA algorithm). The leak can be reproduced and tested with the following script inside virtual machine: #!/bin/bash LOOP_TIMES=10000 # required module: pkcs8_key_parser, virtio_crypto modprobe pkcs8_key_parser # if CONFIG_PKCS8_PRIVATE_KEY_PARSER=m modprobe virtio_crypto # if CONFIG_CRYPTO_DEV_VIRTIO=m rm -rf /tmp/data dd if=/dev/random of=/tmp/data count=1 bs=230 # generate private key and self-signed cert openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem \ -outform der -out cert.der \ -subj "/C=CN/ST=GD/L=SZ/O=vihoo/OU=dev/CN=always.com/emailAddress=yy@always.com" # convert private key from pem to der openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER -out key.der # add key PRIV_KEY_ID=`cat key.der | keyctl padd asymmetric test_priv_key @s` echo "priv key id = "$PRIV_KEY_ID PUB_KEY_ID=`cat cert.der | keyctl padd asymmetric test_pub_key @s` echo "pub key id = "$PUB_KEY_ID # query key keyctl pkey_query $PRIV_KEY_ID 0 keyctl pkey_query $PUB_KEY_ID 0 # here we only run pkey_encrypt becasuse it is the fastest interface function bench_pub() { keyctl pkey_encrypt $PUB_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.pub } # do bench_pub in loop to obtain the memory leak for (( i = 0; i < ${LOOP_TIMES}; ++i )); do bench_pub done Signed-off-by: lei he Acked-by: Michael S. Tsirkin Reviewed-by: Gonglei Signed-off-by: Herbert Xu commit 2526d6bf27d15054bb0778b2f7bc6625fd934905 Author: Dan Carpenter Date: Mon Sep 19 09:43:27 2022 +0300 crypto: cavium - prevent integer overflow loading firmware The "code_length" value comes from the firmware file. If your firmware is untrusted realistically there is probably very little you can do to protect yourself. Still we try to limit the damage as much as possible. Also Smatch marks any data read from the filesystem as untrusted and prints warnings if it not capped correctly. The "ntohl(ucode->code_length) * 2" multiplication can have an integer overflow. Fixes: 9e2c7d99941d ("crypto: cavium - Add Support for Octeon-tx CPT Engine") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit caca37cf6c749ff0303f68418cfe7b757a4e0697 Author: Dan Carpenter Date: Mon Sep 19 09:43:19 2022 +0300 crypto: marvell/octeontx - prevent integer overflows The "code_length" value comes from the firmware file. If your firmware is untrusted realistically there is probably very little you can do to protect yourself. Still we try to limit the damage as much as possible. Also Smatch marks any data read from the filesystem as untrusted and prints warnings if it not capped correctly. The "code_length * 2" can overflow. The round_up(ucode_size, 16) + sizeof() expression can overflow too. Prevent these overflows. Fixes: d9110b0b01ff ("crypto: marvell - add support for OCTEON TX CPT engine") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit f78f6f0bf34fd85c17ebcb31d645536112aa25d3 Author: Neal Liu Date: Mon Sep 19 14:37:05 2022 +0800 crypto: aspeed - fix build error when only CRYPTO_DEV_ASPEED is enabled Fix build error within the following configs setting: - CONFIG_CRYPTO_DEV_ASPEED=y - CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH is not set - CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO is not set Error messages: make[4]: *** No rule to make target 'drivers/crypto/aspeed/aspeed_crypto.o' , needed by 'drivers/crypto/aspeed/built-in.a'. make[4]: Target '__build' not remade because of errors. Reported-by: kernel test robot Signed-off-by: Neal Liu Signed-off-by: Herbert Xu commit cbfecb927f429a6fa613d74b998496bd71e4438a Author: Lukas Czerner Date: Thu Aug 25 12:06:57 2022 +0200 fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE Currently the I_DIRTY_TIME will never get set if the inode already has I_DIRTY_INODE with assumption that it supersedes I_DIRTY_TIME. That's true, however ext4 will only update the on-disk inode in ->dirty_inode(), not on actual writeback. As a result if the inode already has I_DIRTY_INODE state by the time we get to __mark_inode_dirty() only with I_DIRTY_TIME, the time was already filled into on-disk inode and will not get updated until the next I_DIRTY_INODE update, which might never come if we crash or get a power failure. The problem can be reproduced on ext4 by running xfstest generic/622 with -o iversion mount option. Fix it by allowing I_DIRTY_TIME to be set even if the inode already has I_DIRTY_INODE. Also make sure that the case is properly handled in writeback_single_inode() as well. Additionally changes in xfs_fs_dirty_inode() was made to accommodate for I_DIRTY_TIME in flag. Thanks Jan Kara for suggestions on how to make this work properly. Cc: Dave Chinner Cc: Christoph Hellwig Cc: stable@kernel.org Signed-off-by: Lukas Czerner Suggested-by: Jan Kara Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220825100657.44217-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 50f094a5580e6297bf10a807d16f0ee23fa576cf Author: Lukas Czerner Date: Wed Aug 24 18:03:47 2022 +0200 ext4: don't increase iversion counter for ea_inodes ea_inodes are using i_version for storing part of the reference count so we really need to leave it alone. The problem can be reproduced by xfstest ext4/026 when iversion is enabled. Fix it by not calling inode_inc_iversion() for EXT4_EA_INODE_FL inodes in ext4_mark_iloc_dirty(). Cc: stable@kernel.org Signed-off-by: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220824160349.39664-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 61a1d87a324ad5e3ed27c6699dfc93218fcf3201 Author: Jan Kara Date: Mon Aug 22 13:48:32 2022 +0200 ext4: fix check for block being out of directory size The check in __ext4_read_dirblock() for block being outside of directory size was wrong because it compared block number against directory size in bytes. Fix it. Fixes: 65f8ea4cd57d ("ext4: check if directory block is within i_size") CVE: CVE-2022-1184 CC: stable@vger.kernel.org Signed-off-by: Jan Kara Reviewed-by: Lukas Czerner Link: https://lore.kernel.org/r/20220822114832.1482-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 5bdf402a05fafc55c876b9993b4c948bb2bc2361 Author: Ritesh Harjani (IBM) Date: Thu Aug 18 10:34:40 2022 +0530 fs/buffer: make submit_bh & submit_bh_wbc return type as void submit_bh/submit_bh_wbc are non-blocking functions which just submit the bio and return. The caller of submit_bh/submit_bh_wbc needs to wait on buffer till I/O completion and then check buffer head's b_state field to know if there was any I/O error. Hence there is no need for these functions to have any return type. Even now they always returns 0. Hence drop the return value and make their return type as void to avoid any confusion. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Signed-off-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/cb66ef823374cdd94d2d03083ce13de844fffd41.1660788334.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit ab620620bf426af110093c5921888c0a4bf86ab4 Author: Ritesh Harjani (IBM) Date: Thu Aug 18 10:34:39 2022 +0530 fs/buffer: drop useless return value of submit_bh submit_bh always returns 0. This patch drops the useless return value of submit_bh from __sync_dirty_buffer(). Once all of submit_bh callers are cleaned up, we can make it's return type as void. Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/a98a6ddfac68f73d684c2724952e825bc1f4d238.1660788334.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit c547524852deb2eb29c1214174de9782c5b3b8b0 Author: Ritesh Harjani (IBM) Date: Thu Aug 18 10:34:38 2022 +0530 fs/ntfs: drop useless return value of submit_bh from ntfs_submit_bh_for_read submit_bh always returns 0. This patch drops the useless return value of submit_bh from ntfs_submit_bh_for_read(). Once all of submit_bh callers are cleaned up, we can make it's return type as void. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reported-by: kernel test robot Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/d82eb29e8dbc52fe13a7affef5c907ea4076aa31.1660788334.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit f3ed5df398e8bc5b5e38f2db9b6494997e5ada49 Author: Ritesh Harjani (IBM) Date: Thu Aug 18 10:34:37 2022 +0530 jbd2: drop useless return value of submit_bh submit_bh always returns 0. This patch cleans up 2 of it's caller in jbd2 to drop submit_bh's useless return value. Once all submit_bh callers are cleaned up, we can make it's return type as void. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Signed-off-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/e069c0539be0aec61abcdc6f6141982ec85d489d.1660788334.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 3b575495ab8dbb4dbe85b4ac7f991693c3668ff5 Author: Lalith Rajendran Date: Thu Aug 18 21:40:49 2022 +0000 ext4: make ext4_lazyinit_thread freezable ext4_lazyinit_thread is not set freezable. Hence when the thread calls try_to_freeze it doesn't freeze during suspend and continues to send requests to the storage during suspend, resulting in suspend failures. Cc: stable@kernel.org Signed-off-by: Lalith Rajendran Link: https://lore.kernel.org/r/20220818214049.1519544-1-lalithkraj@google.com Signed-off-by: Theodore Ts'o commit d742ea6b8e85f7b0d484bc23392d607b50667da6 Merge: b5155ddd22bc2 34800178b3027 Author: Jakub Kicinski Date: Thu Sep 29 19:29:02 2022 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-09-28 (ice) Arkadiusz implements a single pin initialization function, checking feature bits, instead of having separate device functions and updates sub-device IDs for recognizing E810T devices. Martyna adds support for switchdev filters on VLAN priority field. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: Add support for VLAN priority filters in switchdev ice: support features on new E810T variants ice: Merge pin initialization of E810 and E810T adapters ==================== Link: https://lore.kernel.org/r/20220928203217.411078-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 6ad1c94e1e7e374d88f0cfd77936dddb8339aaba Author: Jakub Kicinski Date: Wed Sep 28 11:12:36 2022 -0700 eth: alx: take rtnl_lock on resume Zbynek reports that alx trips an rtnl assertion on resume: RTNL: assertion failed at net/core/dev.c (2891) RIP: 0010:netif_set_real_num_tx_queues+0x1ac/0x1c0 Call Trace: __alx_open+0x230/0x570 [alx] alx_resume+0x54/0x80 [alx] ? pci_legacy_resume+0x80/0x80 dpm_run_callback+0x4a/0x150 device_resume+0x8b/0x190 async_resume+0x19/0x30 async_run_entry_fn+0x30/0x130 process_one_work+0x1e5/0x3b0 indeed the driver does not hold rtnl_lock during its internal close and re-open functions during suspend/resume. Note that this is not a huge bug as the driver implements its own locking, and does not implement changing the number of queues, but we need to silence the splat. Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL") Reported-and-tested-by: Zbynek Michl Reviewed-by: Niels Dossche Link: https://lore.kernel.org/r/20220928181236.1053043-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 17006e86a7641fa3c50324cfb602f0e74dac8527 Author: Bart Van Assche Date: Tue Aug 30 13:58:42 2022 -0700 sparc: Unbreak the build Fix the following build errors: arch/sparc/mm/srmmu.c: In function ‘smp_flush_page_for_dma’: arch/sparc/mm/srmmu.c:1639:13: error: cast between incompatible function types from ‘void (*)(long unsigned int)’ to ‘void (*)(long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int)’ [-Werror=cast-function-type] 1639 | xc1((smpfunc_t) local_ops->page_for_dma, page); | ^ arch/sparc/mm/srmmu.c: In function ‘smp_flush_cache_mm’: arch/sparc/mm/srmmu.c:1662:29: error: cast between incompatible function types from ‘void (*)(struct mm_struct *)’ to ‘void (*)(long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int)’ [-Werror=cast-function-type] 1662 | xc1((smpfunc_t) local_ops->cache_mm, (unsigned long) mm); | [ ... ] Compile-tested only. Fixes: 552a23a0e5d0 ("Makefile: Enable -Wcast-function-type") Cc: stable@vger.kernel.org Signed-off-by: Bart Van Assche Tested-by: Andreas Larsson Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220830205854.1918026-1-bvanassche@acm.org commit b5155ddd22bc2427465a97c494bbe6289152e80a Author: Wang Yufen Date: Wed Sep 28 19:34:20 2022 +0800 net: phy: Convert to use sysfs_emit() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Wang Yufen Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/1664364860-29153-1-git-send-email-wangyufen@huawei.com Signed-off-by: Jakub Kicinski commit 92346bde96d6044900a9add8013b97b3241e60b1 Merge: 8af535b6b14c5 dfc7175de3b0a Author: Jakub Kicinski Date: Thu Sep 29 18:52:06 2022 -0700 Merge branch 'add-tc-taprio-support-for-queuemaxsdu' Vladimir Oltean says: ==================== Add tc-taprio support for queueMaxSDU The tc-taprio offload mode supported by the Felix DSA driver has limitations surrounding its guard bands. The initial discussion was at: https://lore.kernel.org/netdev/c7618025da6723418c56a54fe4683bd7@walle.cc/ with the latest status being that we now have a vsc9959_tas_guard_bands_update() method which makes a best-guess attempt at how much useful space to reserve for packet scheduling in a taprio interval, and how much to reserve for guard bands. IEEE 802.1Q actually does offer a tunable variable (queueMaxSDU) which can determine the max MTU supported per traffic class. In turn we can determine the size we need for the guard bands, depending on the queueMaxSDU. This way we can make the guard band of small taprio intervals smaller than one full MTU worth of transmission time, if we know that said traffic class will transport only smaller packets. As discussed with Gerhard Engleder, the queueMaxSDU may also be useful in limiting the latency on an endpoint, if some of the TX queues are outside of the control of the Linux driver. https://patchwork.kernel.org/project/netdevbpf/patch/20220914153303.1792444-11-vladimir.oltean@nxp.com/ Allow input of queueMaxSDU through netlink into tc-taprio, offload it to the hardware I have access to (LS1028A), and (implicitly) deny non-default values to everyone else. Kurt Kanzenbach has also kindly tested and shared a patch to offload this to hellcreek. v3 at: https://patchwork.kernel.org/project/netdevbpf/cover/20220927234746.1823648-1-vladimir.oltean@nxp.com/ v2 at: https://patchwork.kernel.org/project/netdevbpf/list/?series=679954&state=* v1 at: https://patchwork.kernel.org/project/netdevbpf/cover/20220914153303.1792444-1-vladimir.oltean@nxp.com/ ==================== Link: https://lore.kernel.org/r/20220928095204.2093716-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit dfc7175de3b0a01dbc9d8a16f8417f19fa2ba4cb Author: Vladimir Oltean Date: Wed Sep 28 12:52:04 2022 +0300 net: enetc: offload per-tc max SDU from tc-taprio The driver currently sets the PTCMSDUR register statically to the max MTU supported by the interface. Keep this logic if tc-taprio is absent or if the max_sdu for a traffic class is 0, and follow the requested max SDU size otherwise. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 9a2ea26d97a9acbb909c5ada0cfd09cea16a32ca Author: Vladimir Oltean Date: Wed Sep 28 12:52:03 2022 +0300 net: enetc: use common naming scheme for PTGCR and PTGCAPR registers The Port Time Gating Control Register (PTGCR) and Port Time Gating Capability Register (PTGCAPR) have definitions in the driver which aren't in line with the other registers. Rename these. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 715bf2610f1d1adf3d4f9b7b3dd729984ec4270a Author: Vladimir Oltean Date: Wed Sep 28 12:52:02 2022 +0300 net: enetc: cache accesses to &priv->si->hw The &priv->si->hw construct dereferences 2 pointers and makes lines longer than they need to be, in turn making the code harder to read. Replace &priv->si->hw accesses with a "hw" variable when there are 2 or more accesses within a function that dereference this. This includes loops, since &priv->si->hw is a loop invariant. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit a745c697830b74e4787b0c849f763941928aa06d Author: Kurt Kanzenbach Date: Wed Sep 28 12:52:01 2022 +0300 net: dsa: hellcreek: Offload per-tc max SDU from tc-taprio Add support for configuring the max SDU per priority and per port. If not specified, keep the default. Signed-off-by: Kurt Kanzenbach Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 248376b1b13f7300e94a9f8d97062d43dfa4a847 Author: Vladimir Oltean Date: Wed Sep 28 12:52:00 2022 +0300 net: dsa: hellcreek: refactor hellcreek_port_setup_tc() to use switch/case The following patch will need to make this function also respond to TC_QUERY_BASE, so make the processing more structured around the tc_setup_type. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit 1712be05a8a7713d2f564d01cf0bbf25d4310cb2 Author: Vladimir Oltean Date: Wed Sep 28 12:51:59 2022 +0300 net: dsa: felix: offload per-tc max SDU from tc-taprio Our current vsc9959_tas_guard_bands_update() algorithm has a limitation imposed by the hardware design. To avoid packet overruns between one gate interval and the next (which would add jitter for scheduled traffic in the next gate), we configure the switch to use guard bands. These are as large as the largest packet which is possible to be transmitted. The problem is that at tc-taprio intervals of sizes comparable to a guard band, there isn't an obvious place in which to split the interval between the useful portion (for scheduling) and the guard band portion (where scheduling is blocked). For example, a 10 us interval at 1Gbps allows 1225 octets to be transmitted. We currently split the interval between the bare minimum of 33 ns useful time (required to schedule a single packet) and the rest as guard band. But 33 ns of useful scheduling time will only allow a single packet to be sent, be that packet 1200 octets in size, or 60 octets in size. It is impossible to send 2 60 octets frames in the 10 us window. Except that if we reduced the guard band (and therefore the maximum allowable SDU size) to 5 us, the useful time for scheduling is now also 5 us, so more packets could be scheduled. The hardware inflexibility of not scheduling according to individual packet lengths must unfortunately propagate to the user, who needs to tune the queueMaxSDU values if he wants to fit more small packets into a 10 us interval, rather than one large packet. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit a54fc09e4cba3004443aa05979f8c678196c8226 Author: Vladimir Oltean Date: Wed Sep 28 12:51:58 2022 +0300 net/sched: taprio: allow user input of per-tc max SDU IEEE 802.1Q clause 12.29.1.1 "The queueMaxSDUTable structure and data types" and 8.6.8.4 "Enhancements for scheduled traffic" talk about the existence of a per traffic class limitation of maximum frame sizes, with a fallback on the port-based MTU. As far as I am able to understand, the 802.1Q Service Data Unit (SDU) represents the MAC Service Data Unit (MSDU, i.e. L2 payload), excluding any number of prepended VLAN headers which may be otherwise present in the MSDU. Therefore, the queueMaxSDU is directly comparable to the device MTU (1500 means L2 payload sizes are accepted, or frame sizes of 1518 octets, or 1522 plus one VLAN header). Drivers which offload this are directly responsible of translating into other units of measurement. To keep the fast path checks optimized, we keep 2 arrays in the qdisc, one for max_sdu translated into frame length (so that it's comparable to skb->len), and another for offloading and for dumping back to the user. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit aac4daa8941ea6566563ac001e9e5d4e54a674e2 Author: Vladimir Oltean Date: Wed Sep 28 12:51:57 2022 +0300 net/sched: query offload capabilities through ndo_setup_tc() When adding optional new features to Qdisc offloads, existing drivers must reject the new configuration until they are coded up to act on it. Since modifying all drivers in lockstep with the changes in the Qdisc can create problems of its own, it would be nice if there existed an automatic opt-in mechanism for offloading optional features. Jakub proposes that we multiplex one more kind of call through ndo_setup_tc(): one where the driver populates a Qdisc-specific capability structure. First user will be taprio in further changes. Here we are introducing the definitions for the base functionality. Link: https://patchwork.kernel.org/project/netdevbpf/patch/20220923163310.3192733-3-vladimir.oltean@nxp.com/ Suggested-by: Jakub Kicinski Co-developed-by: Jakub Kicinski Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 8af535b6b14c57b3c1ba7eaf64919f4b4ef0f260 Author: Yuan Can Date: Wed Sep 28 08:56:36 2022 +0000 net/tipc: Remove unused struct distr_queue_item After commit 09b5678c778f("tipc: remove dead code in tipc_net and relatives"), struct distr_queue_item is not used any more and can be removed as well. Signed-off-by: Yuan Can Acked-by: Jon Maloy Link: https://lore.kernel.org/r/20220928085636.71749-1-yuancan@huawei.com Signed-off-by: Jakub Kicinski commit dbae2b062824fc2d35ae2d5df2f500626c758e80 Author: Paolo Abeni Date: Wed Sep 28 10:43:09 2022 +0200 net: skb: introduce and use a single page frag cache After commit 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") we are observing 10-20% regressions in performance tests with small packets. The perf trace points to high pressure on the slab allocator. This change tries to improve the allocation schema for small packets using an idea originally suggested by Eric: a new per CPU page frag is introduced and used in __napi_alloc_skb to cope with small allocation requests. To ensure that the above does not lead to excessive truesize underestimation, the frag size for small allocation is inflated to 1K and all the above is restricted to build with 4K page size. Note that we need to update accordingly the run-time check introduced with commit fd9ea57f4e95 ("net: add napi_get_frags_check() helper"). Alex suggested a smart page refcount schema to reduce the number of atomic operations and deal properly with pfmemalloc pages. Under small packet UDP flood, I measure a 15% peak tput increases. Suggested-by: Eric Dumazet Suggested-by: Alexander H Duyck Signed-off-by: Paolo Abeni Reviewed-by: Eric Dumazet Reviewed-by: Alexander Duyck Link: https://lore.kernel.org/r/6b6f65957c59f86a353fc09a5127e83a32ab5999.1664350652.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski commit 7cba18332e3635aaae60e4e7d4e52849de50d91b Author: Kees Cook Date: Tue Sep 27 08:37:01 2022 -0700 net: sched: cls_u32: Avoid memcpy() false-positive warning To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), use unsafe_memcpy(), as the sizing, bounds-checking, and allocation are all very tightly coupled here. This silences the false-positive reported by syzbot: memcpy: detected field-spanning write (size 80) of single field "&n->sel" at net/sched/cls_u32.c:1043 (size 16) [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org Cc: Cong Wang Cc: Jiri Pirko Reported-by: syzbot+a2c4601efc75848ba321@syzkaller.appspotmail.com Link: https://lore.kernel.org/lkml/000000000000a96c0b05e97f0444@google.com/ Signed-off-by: Kees Cook Reviewed-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20220927153700.3071688-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 5361660af6d35f2b84926f5fcbf0491a9c21d82e Author: Marek Vasut Date: Tue Sep 27 03:24:49 2022 +0200 dt-bindings: net: snps,dwmac: Document stmmac-axi-config subnode The stmmac-axi-config subnode is present in multiple dwmac instance DTs, document its content per snps,axi-config property description which is a phandle to this subnode. Signed-off-by: Marek Vasut Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220927012449.698915-1-marex@denx.de Signed-off-by: Jakub Kicinski commit 5493a2ad0d20944b16aba7ed7a951a43ad1f5fba Author: Jakub Kicinski Date: Tue Sep 27 14:23:06 2022 -0700 docs: netlink: clarify the historical baggage of Netlink flags nlmsg_flags are full of historical baggage, inconsistencies and strangeness. Try to document it more thoroughly. Explain the meaning of the ECHO flag (and while at it clarify the comment in the uAPI). Handwave a little about the NEW request flags and how they make sense on the surface but cater to really old paradigm before commands were a thing. I will add more notes on how to make use of ECHO and discouragement for reuse of flags to the kernel-side documentation. Link: https://lore.kernel.org/r/20220927212306.823862-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 0e3f72931fc47bb81686020cc643cde5d9cd0bb8 Author: Junichi Uekawa Date: Wed Sep 28 15:45:38 2022 +0900 vhost/vsock: Use kvmalloc/kvfree for larger packets. When copying a large file over sftp over vsock, data size is usually 32kB, and kmalloc seems to fail to try to allocate 32 32kB regions. vhost-5837: page allocation failure: order:4, mode:0x24040c0 Call Trace: [] dump_stack+0x97/0xdb [] warn_alloc_failed+0x10f/0x138 [] ? __alloc_pages_direct_compact+0x38/0xc8 [] __alloc_pages_nodemask+0x84c/0x90d [] alloc_kmem_pages+0x17/0x19 [] kmalloc_order_trace+0x2b/0xdb [] __kmalloc+0x177/0x1f7 [] ? copy_from_iter+0x8d/0x31d [] vhost_vsock_handle_tx_kick+0x1fa/0x301 [vhost_vsock] [] vhost_worker+0xf7/0x157 [vhost] [] kthread+0xfd/0x105 [] ? vhost_dev_set_owner+0x22e/0x22e [vhost] [] ? flush_kthread_worker+0xf3/0xf3 [] ret_from_fork+0x4e/0x80 [] ? flush_kthread_worker+0xf3/0xf3 Work around by doing kvmalloc instead. Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko") Signed-off-by: Junichi Uekawa Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20220928064538.667678-1-uekawa@chromium.org Signed-off-by: Jakub Kicinski commit 1d7d20658534c7d36fe6f4252f6f1a27d9631a99 Author: Dmitry Baryshkov Date: Fri Sep 16 09:17:39 2022 +0300 clk: fixed-rate: add devm_clk_hw_register_fixed_rate Add devm_clk_hw_register_fixed_rate(), devres-managed helper to register fixed-rate clock. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220916061740.87167-3-dmitry.baryshkov@linaro.org Signed-off-by: Stephen Boyd commit f5290d8e4f0caa81a491448a27dd70e726095d07 Author: Dmitry Baryshkov Date: Fri Sep 16 09:17:38 2022 +0300 clk: asm9260: use parent index to link the reference clock Rewrite clk-asm9260 to use parent index to use the reference clock. During this rework two helpers are added: - clk_hw_register_mux_table_parent_data() to supplement clk_hw_register_mux_table() but using parent_data instead of parent_names - clk_hw_register_fixed_rate_parent_accuracy() to be used instead of directly calling __clk_hw_register_fixed_rate(). The later function is an internal API, which is better not to be called directly. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220916061740.87167-2-dmitry.baryshkov@linaro.org Signed-off-by: Stephen Boyd commit 6a02124c87f0b61dcaaeb65e7fd406d8afb40fd4 Author: Lin Yujun Date: Wed Sep 14 11:37:55 2022 +0800 ACPI: HMAT: Release platform device in case of platform_device_add_data() fails The platform device is not released when platform_device_add_data() fails. And platform_device_put() perfom one more pointer check than put_device() to check for errors in the 'pdev' pointer. Use platform_device_put() to release platform device in platform_device_add()/platform_device_add_data()/ platform_device_add_resources() error case. Fixes: c01044cc8191 ("ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device") Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220914033755.99924-1-linyujun809@huawei.com Signed-off-by: Dan Williams commit f882a1e20519230ab8998f94e3359825a3b13f7c Merge: 3cc53c57d0d54 99f3a5e851e9a Author: Stephen Boyd Date: Thu Sep 29 17:39:10 2022 -0700 Merge tag 'mtk-clk-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/wens/linux into clk-mtk Pull MediaTek clk driver updates from Chen-Yu Tsai: A lot of clean up work, as well as new drivers and new functions - New clock drivers for MediaTek Helio X10 MT6795 - Add missing DPI1_HDMI clock in MT8195 VDOSYS1 - Clock driver changes to support GPU DVFS on MT8183, MT8192, MT8195 - Fix GPU clock topology on MT8195 - Propogate rate changes from GPU clock gate up the tree - Clock mux notifiers for GPU-related PLLs - Conversion of more "simple" drivers to mtk_clk_simple_probe() - Hook up mtk_clk_simple_remove() for "simple" MT8192 clock drivers - Fixes to previous |struct clk| to |struct clk_hw| conversion - Shrink MT8192 clock driver by deduplicating clock parent lists * tag 'mtk-clk-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/wens/linux: (31 commits) clk: mediatek: mt8192: deduplicate parent clock lists clk: mediatek: Migrate remaining clk_unregister_*() to clk_hw_unregister_*() clk: mediatek: fix unregister function in mtk_clk_register_dividers cleanup clk: mediatek: clk-mt8192: Add clock mux notifier for mfg_pll_sel clk: mediatek: clk-mt8192-mfg: Propagate rate changes to parent clk: mediatek: clk-mt8195-topckgen: Drop univplls from mfg mux parents clk: mediatek: clk-mt8195-topckgen: Add GPU clock mux notifier clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes clk: mediatek: mt8183: Add clk mux notifier for MFG mux clk: mediatek: mux: add clk notifier functions clk: mediatek: mt8183: mfgcfg: Propagate rate changes to parent clk: mediatek: Use mtk_clk_register_gates_with_dev in simple probe clk: mediatek: gate: Export mtk_clk_register_gates_with_dev clk: mediatek: add VDOSYS1 clock dt-bindings: clk: mediatek: Add MT8195 DPI clocks clk: mediatek: mt8192: add mtk_clk_simple_remove clk: mediatek: mt8183: use mtk_clk_simple_probe to simplify driver clk: mediatek: mt6797: use mtk_clk_simple_probe to simplify driver clk: mediatek: mt6779: use mtk_clk_simple_probe to simplify driver ... commit 0f702033a64bd3adcd57c9d5cf91ea64c08fad42 Author: Bo Liu Date: Sun Sep 25 21:26:35 2022 -0400 dax: Remove usage of the deprecated ida_simple_xxx API ida_alloc_max() makes it clear that the second argument is inclusive, and the alloc/free terminology is more idiomatic and symmetric then get/remove. Signed-off-by: Bo Liu Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220926012635.3205-1-liubo03@inspur.com [djbw: reword changelog] Signed-off-by: Dan Williams commit 2e5021cc42ba26c98fe83b973d774a999fa4f219 Author: Tyler Hicks Date: Tue Aug 30 00:45:05 2022 -0500 libnvdimm/region: Allow setting align attribute on regions without mappings The alignment constraint for namespace creation in a region was increased, from 2M to 16M, for non-PowerPC architectures in v5.7 with commit 2522afb86a8c ("libnvdimm/region: Introduce an 'align' attribute"). The thought behind the change was that region alignment should be uniform across all architectures and, since PowerPC had the largest alignment constraint of 16M, all architectures should conform to that alignment. The change regressed namespace creation in pre-defined regions that relied on 2M alignment but a workaround was provided in the form of a sysfs attribute, named 'align', that could be adjusted to a non-default alignment value. However, the sysfs attribute's store function returned an error (-ENXIO) when userspace attempted to change the alignment of a region that had no mappings. This affected 2M aligned regions of volatile memory that were defined in a device tree using "pmem-region" and created by the of_pmem_region_driver, since those regions do not contain mappings (ndr_mappings is 0). Allow userspace to set the align attribute on pre-existing regions that do not have mappings so that namespaces can still be within those regions, despite not being aligned to 16M. Link: https://lore.kernel.org/lkml/CA+CK2bDJ3hrWoE91L2wpAk+Yu0_=GtYw=4gLDDD7mxs321b_aA@mail.gmail.com Fixes: 2522afb86a8c ("libnvdimm/region: Introduce an 'align' attribute") Signed-off-by: Tyler Hicks Link: https://lore.kernel.org/r/20220830054505.1159488-1-tyhicks@linux.microsoft.com Signed-off-by: Dan Williams commit 7860d720a84c74b2761c6b7995392a798ab0a3cb Author: Rob Clark Date: Thu Sep 29 09:14:04 2022 -0700 drm/msm: Fix build break with recent mm tree 9178e3dcb121 ("mm: discard __GFP_ATOMIC") removed __GFP_ATOMIC, replacing it with a check for not __GFP_DIRECT_RECLAIM. Reported-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Rob Clark Acked-by: Randy Dunlap # build-tested Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20220929161404.2769414-1-robdclark@gmail.com commit 404b7577cee2dc302ae259604b163cabd9bfd4f3 Author: Lukas Bulwahn Date: Thu Sep 29 12:14:48 2022 +0200 m68k: update config files Clean up config files by: - removing configs that were deleted in the past - removing configs not in tree and without recently pending patches - adding new configs that are replacements for old configs in the file For some detailed information, see Link. Link: https://lore.kernel.org/kernel-janitors/20220929090645.1389-1-lukas.bulwahn@gmail.com/ Signed-off-by: Lukas Bulwahn Signed-off-by: Greg Ungerer commit 30514bd2dd4e86a3ecfd6a93a3eadf7b9ea164a0 Author: Hugh Dickins Date: Thu Sep 29 12:50:12 2022 -0700 sbitmap: fix lockup while swapping Commit 4acb83417cad ("sbitmap: fix batched wait_cnt accounting") is a big improvement: without it, I had to revert to before commit 040b83fcecfb ("sbitmap: fix possible io hung due to lost wakeup") to avoid the high system time and freezes which that had introduced. Now okay on the NVME laptop, but 4acb83417cad is a disaster for heavy swapping (kernel builds in low memory) on another: soon locking up in sbitmap_queue_wake_up() (into which __sbq_wake_up() is inlined), cycling around with waitqueue_active() but wait_cnt 0 . Here is a backtrace, showing the common pattern of outer sbitmap_queue_wake_up() interrupted before setting wait_cnt 0 back to wake_batch (in some cases other CPUs are idle, in other cases they're spinning for a lock in dd_bio_merge()): sbitmap_queue_wake_up < sbitmap_queue_clear < blk_mq_put_tag < __blk_mq_free_request < blk_mq_free_request < __blk_mq_end_request < scsi_end_request < scsi_io_completion < scsi_finish_command < scsi_complete < blk_complete_reqs < blk_done_softirq < __do_softirq < __irq_exit_rcu < irq_exit_rcu < common_interrupt < asm_common_interrupt < _raw_spin_unlock_irqrestore < __wake_up_common_lock < __wake_up < sbitmap_queue_wake_up < sbitmap_queue_clear < blk_mq_put_tag < __blk_mq_free_request < blk_mq_free_request < dd_bio_merge < blk_mq_sched_bio_merge < blk_mq_attempt_bio_merge < blk_mq_submit_bio < __submit_bio < submit_bio_noacct_nocheck < submit_bio_noacct < submit_bio < __swap_writepage < swap_writepage < pageout < shrink_folio_list < evict_folios < lru_gen_shrink_lruvec < shrink_lruvec < shrink_node < do_try_to_free_pages < try_to_free_pages < __alloc_pages_slowpath < __alloc_pages < folio_alloc < vma_alloc_folio < do_anonymous_page < __handle_mm_fault < handle_mm_fault < do_user_addr_fault < exc_page_fault < asm_exc_page_fault See how the process-context sbitmap_queue_wake_up() has been interrupted, after bringing wait_cnt down to 0 (and in this example, after doing its wakeups), before advancing wake_index and refilling wake_cnt: an interrupt-context sbitmap_queue_wake_up() of the same sbq gets stuck. I have almost no grasp of all the possible sbitmap races, and their consequences: but __sbq_wake_up() can do nothing useful while wait_cnt 0, so it is better if sbq_wake_ptr() skips on to the next ws in that case: which fixes the lockup and shows no adverse consequence for me. The check for wait_cnt being 0 is obviously racy, and ultimately can lead to lost wakeups: for example, when there is only a single waitqueue with waiters. However, lost wakeups are unlikely to matter in these cases, and a proper fix requires redesign (and benchmarking) of the batched wakeup code: so let's plug the hole with this bandaid for now. Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/9c2038a7-cdc5-5ee-854c-fbc6168bf16@google.com Signed-off-by: Jens Axboe commit 108893ddcc4d3aa0a4a02aeb02d478e997001227 Author: Pavel Begunkov Date: Thu Sep 29 22:23:19 2022 +0100 io_uring/net: fix notif cqe reordering send zc is not restricted to !IO_URING_F_UNLOCKED anymore and so we can't use task-tw ordering trick to order notification cqes with requests completions. In this case leave it alone and let io_send_zc_cleanup() flush it. Cc: stable@vger.kernel.org Fixes: 53bdc88aac9a2 ("io_uring/notif: order notif vs send CQEs") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0031f3a00d492e814a4a0935a2029a46d9c9ba06.1664486545.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6f10ae8a155446248055c7ddd480ef40139af788 Author: Pavel Begunkov Date: Thu Sep 29 22:23:18 2022 +0100 io_uring/net: don't update msg_name if not provided io_sendmsg_copy_hdr() may clear msg->msg_name if the userspace didn't provide it, we should retain NULL in this case. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/97d49f61b5ec76d0900df658cfde3aa59ff22121.1664486545.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0bda8d828f3af92c37d7667d598dee77a64cc46b Merge: e8573000f4bbb 20e377e7b2e7c Author: Dave Airlie Date: Fri Sep 30 09:40:29 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-09-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Fix release build bug in 'remove GuC log size module parameters' (John Harrison) - Remove ipc_enabled from struct drm_i915_private (Jani Nikula) - Do not cleanup obj with NULL bo->resource (Nirmoy Das) - Fix device info for devices without display (Jani Nikula) - Force DPLL calculation for TC ports after readout (Ville Syrjälä) - Use i915_vm_put on ppgtt_create error paths (Chris Wilson) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YzWqtwPNxAe+r9FO@tursulin-desk commit 9f4beead610c83065cc0410bfe97ff51d8e9578d Author: Lukas Bulwahn Date: Thu Sep 29 22:39:03 2022 +0200 binfmt: remove taso from linux_binprm struct With commit 987f20a9dcce ("a.out: Remove the a.out implementation"), the use of the special taso flag for alpha architectures in the linux_binprm struct is gone. Remove the definition of taso in the linux_binprm struct. No functional change. Signed-off-by: Lukas Bulwahn Reviewed-by: "Eric W. Biederman" Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220929203903.9475-1-lukas.bulwahn@gmail.com commit 2d09ac951b7750780ecb3de3ccb642dffd7ef62b Author: Christophe JAILLET Date: Thu Sep 29 21:11:36 2022 +0200 input: drop empty comment blocks Commit 1a59d1b8e05e ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156") has left some empty comment blocks. Remove them to save a few lines of code. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/26a2b905b259bfffaf2de5b26f2007b8606970ed.1664478665.git.christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov commit 17005609548f1f0204cbfc988b325533470e585c Author: Yuan Can Date: Tue Sep 27 13:37:39 2022 +0000 of: fdt: Remove unused struct fdt_scan_status After commit bba04d965d06("of/fdt: remove unused of_scan_flat_dt_by_path"), no one use struct fdt_scan_status, so remove it. Signed-off-by: Yuan Can Reviewed-by: Frank Rowand Link: https://lore.kernel.org/r/20220927133739.98493-1-yuancan@huawei.com Signed-off-by: Rob Herring commit 8ec747e5d585cc8efaf5ebc3caf5dd71af86eaaa Author: Marek Vasut Date: Tue Sep 27 01:45:01 2022 +0200 dt-bindings: display: st,stm32-dsi: Handle data-lanes in DSI port node Handle 'data-lanes' property of the DSI output endpoint, it is possible to describe DSI link with 1 or 2 data lanes this way. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20220926234501.583115-1-marex@denx.de Signed-off-by: Rob Herring commit 46a525e199e4037516f7e498c18f065b09df32ac Author: Jens Axboe Date: Thu Sep 29 15:29:13 2022 -0600 io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL This isn't a reliable mechanism to tell if we have task_work pending, we really should be looking at whether we have any items queued. This is problematic if forward progress is gated on running said task_work. One such example is reading from a pipe, where the write side has been closed right before the read is started. The fput() of the file queues TWA_RESUME task_work, and we need that task_work to be run before ->release() is called for the pipe. If ->release() isn't called, then the read will sit forever waiting on data that will never arise. Fix this by io_run_task_work() so it checks if we have task_work pending rather than rely on TIF_NOTIFY_SIGNAL for that. The latter obviously doesn't work for task_work that is queued without TWA_SIGNAL. Reported-by: Christiano Haesbaert Cc: stable@vger.kernel.org Link: https://github.com/axboe/liburing/issues/665 Signed-off-by: Jens Axboe commit accc3b4a572bba903a801a393532272727f83f5b Merge: 510bbf82f8dc3 511cce163b75b Author: Jakub Kicinski Date: Thu Sep 29 14:30:51 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit c9b48b91e2fbb74fb981aa616a6ef3c78194077f Author: Yuan Can Date: Thu Sep 29 01:55:03 2022 +0000 drm/panel: simple: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220929015503.17301-3-yuancan@huawei.com commit b28d204a7c19231c0a37359f82dc8c4b234d1d16 Author: Yuan Can Date: Thu Sep 29 01:55:02 2022 +0000 drm/panel: panel-edp: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220929015503.17301-2-yuancan@huawei.com Link: https://patchwork.freedesktop.org/patch/msgid/20220929015503.17301-2-yuancan@huawei.com commit 35fcbc4243aad7e7d020b7c1dfb14bb888b20a4f Author: Luiz Augusto von Dentz Date: Thu Sep 29 13:27:13 2022 -0700 Bluetooth: L2CAP: Fix user-after-free This uses l2cap_chan_hold_unless_zero() after calling __l2cap_get_chan_blah() to prevent the following trace: Bluetooth: l2cap_core.c:static void l2cap_chan_destroy(struct kref *kref) Bluetooth: chan 0000000023c4974d Bluetooth: parent 00000000ae861c08 ================================================================== BUG: KASAN: use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:191 [inline] BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:671 [inline] BUG: KASAN: use-after-free in __mutex_lock+0x278/0x400 kernel/locking/mutex.c:729 Read of size 8 at addr ffff888006a49b08 by task kworker/u3:2/389 Link: https://lore.kernel.org/lkml/20220622082716.478486-1-lee.jones@linaro.org Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sungwoo Kim commit 4c95236a335d8b62aa8dbd587bed6a5f30d8265a Author: Jason A. Donenfeld Date: Thu Sep 29 11:49:35 2022 +0200 prandom: make use of smaller types in prandom_u32_max When possible at compile-time, make use of smaller types in prandom_u32_max(), so that we can use smaller batches from random.c, which in turn leads to a 2x or 4x performance boost. This makes a difference, for example, in kfence, which needs a fast stream of small numbers (booleans). At the same time, we use the occasion to update the old documentation on these functions. prandom_u32() and prandom_bytes() have direct replacements now in random.h, while prandom_u32_max() remains useful as a prandom.h function, since it's not cryptographically secure by virtue of not being evenly distributed. Cc: Dominik Brodowski Acked-by: Marco Elver Signed-off-by: Jason A. Donenfeld commit 585cd5fe9f7378601b1d4915ad6e9088333b5e5e Author: Jason A. Donenfeld Date: Wed Sep 28 18:47:30 2022 +0200 random: add 8-bit and 16-bit batches There are numerous places in the kernel that would be sped up by having smaller batches. Currently those callsites do `get_random_u32() & 0xff` or similar. Since these are pretty spread out, and will require patches to multiple different trees, let's get ahead of the curve and lay the foundation for `get_random_u8()` and `get_random_u16()`, so that it's then possible to start submitting conversion patches leisurely. Signed-off-by: Jason A. Donenfeld commit 37608ba315a2b1b548aa5b1064e5559e029cb016 Author: Jason A. Donenfeld Date: Tue Sep 27 11:35:16 2022 +0200 utsname: contribute changes to RNG On some small machines with little entropy, a quasi-unique hostname is sometimes a relevant factor. I've seen, for example, 8 character alpha-numeric serial numbers. In addition, the time at which the hostname is set is usually a decent measurement of how long early boot took. So, call add_device_randomness() on new hostnames, which feeds its arguments to the RNG in addition to a fresh cycle counter. Low cost hooks like this never hurt and can only ever help, and since this costs basically nothing for an operation that is never a fast path, this is an overall easy win. Cc: Andrew Morton Cc: Dominik Brodowski Reviewed-by: Kees Cook Signed-off-by: Jason A. Donenfeld commit dd54fd7dfa4574fe350b75a90693dc6552c535e3 Author: Jason A. Donenfeld Date: Tue Sep 27 11:26:44 2022 +0200 random: use init_utsname() instead of utsname() Rather than going through the current-> indirection for utsname, at this point in boot, init_utsname()==utsname(), so just use it directly that way. Additionally, init_utsname() appears to be available nearly always, so move it into random_init_early(). Suggested-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: Jason A. Donenfeld commit 08475dab7cf5b610ea2420828e97c54f5f370d7d Author: Jason A. Donenfeld Date: Mon Sep 26 18:32:25 2022 +0200 kfence: use better stack hash seed As of the prior commit, the RNG will have incorporated both a cycle counter value and RDRAND, in addition to various other environmental noise. Therefore, using get_random_u32() will supply a stronger seed than simply using random_get_entropy(). N.B.: random_get_entropy() should be considered an internal API of random.c and not generally consumed. Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrew Morton Reviewed-by: Marco Elver Signed-off-by: Jason A. Donenfeld commit f62384995e4cb7703e5295779c44135c5311770d Author: Jason A. Donenfeld Date: Mon Sep 26 17:43:14 2022 +0200 random: split initialization into early step and later step The full RNG initialization relies on some timestamps, made possible with initialization functions like time_init() and timekeeping_init(). However, these are only available rather late in initialization. Meanwhile, other things, such as memory allocator functions, make use of the RNG much earlier. So split RNG initialization into two phases. We can provide arch randomness very early on, and then later, after timekeeping and such are available, initialize the rest. This ensures that, for example, slabs are properly randomized if RDRAND is available. Without this, CONFIG_SLAB_FREELIST_RANDOM=y loses a degree of its security, because its random seed is potentially deterministic, since it hasn't yet incorporated RDRAND. It also makes it possible to use a better seed in kfence, which currently relies on only the cycle counter. Another positive consequence is that on systems with RDRAND, running with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y results in no warnings at all. One subtle side effect of this change is that on systems with no RDRAND, RDTSC is now only queried by random_init() once, committing the moment of the function call, instead of multiple times as before. This is intentional, as the multiple RDTSCs in a loop before weren't accomplishing very much, with jitter being better provided by try_to_generate_entropy(). Plus, filling blocks with RDTSC is still being done in extract_entropy(), which is necessarily called before random bytes are served anyway. Cc: Andrew Morton Reviewed-by: Kees Cook Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 3e347969a5776947a115649dae740a9ed47473f5 Author: Sajid Dalvi Date: Wed Sep 21 21:27:35 2022 +0000 PCI/PM: Reduce D3hot delay with usleep_range() PCIe r6.0, sec 5.9, requires a 10ms delay between programming a device to change to or from D3hot and the time the device is next accessed (unless Readiness Notifications are used). The 10ms value (PCI_PM_D3HOT_WAIT) doesn't appear directly here because some chipsets require 120ms for devices *below* them (pci_pm_d3hot_delay) and some devices require more or less than 10ms (dev->d3hot_delay). But msleep(10) typically waits about *20*ms, which is more than we need. Switch to usleep_range() to improve the delay accuracy. Based on a commit from Sajid in the Pixel 6 kernel tree [1]. On a Pixel 6, the 10ms delay for the Exynos PCIe device delayed for an average of 19ms. Switching to usleep_range() decreased the resume time by about 9ms. [1] https://android.googlesource.com/kernel/gs/+/18a8cad68d8e6d50f339a716a18295e6d987cee3 [bhelgaas commit log, add timers-howto.rst link] Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/timers/timers-howto.rst?id=v5.19#n73 Link: https://lore.kernel.org/r/20220921212735.2131588-1-willmcvicker@google.com Signed-off-by: Sajid Dalvi Signed-off-by: Will McVicker Signed-off-by: Bjorn Helgaas Reviewed-by: Matthias Kaehlcke commit 69d517e6e21099f81efbd39e47874649ae575804 Author: David Hildenbrand Date: Fri Sep 23 13:34:25 2022 +0200 checkpatch: warn on usage of VM_BUG_ON() and other BUG variants checkpatch does not point out that VM_BUG_ON() and friends should be avoided, however, Linus notes: VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally no different, the only difference is "we can make the code smaller because these are less important". [1] So let's warn on VM_BUG_ON() and other BUG variants as well. While at it, make it clearer that the kernel really shouldn't be crashed. As there are some subsystem BUG macros that actually don't end up crashing the kernel -- for example, KVM_BUG_ON() -- exclude these manually. [1] https://lore.kernel.org/r/CAHk-=wg40EAZofO16Eviaj7mfqDhZ2gVEbvfsMf6gYzspRjYvw@mail.gmail.com Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20220923113426.52871-3-david@redhat.com Signed-off-by: Jonathan Corbet commit 1cfd9d7e43d5a1cf739d1420b10b1e65feb02f88 Author: David Hildenbrand Date: Fri Sep 23 13:34:24 2022 +0200 coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") Linus notes [1] that the introduction of new code that uses VM_BUG_ON() is just as bad as BUG_ON(), because it will crash the kernel on distributions that enable CONFIG_DEBUG_VM (like Fedora): VM_BUG_ON() has the exact same semantics as BUG_ON. It is literally no different, the only difference is "we can make the code smaller because these are less important". [2] This resulted in a more generic discussion about usage of BUG() and friends. While there might be corner cases that still deserve a BUG_ON(), most BUG_ON() cases should simply use WARN_ON_ONCE() and implement a recovery path if reasonable: The only possible case where BUG_ON can validly be used is "I have some fundamental data corruption and cannot possibly return an error". [2] As a very good approximation is the general rule: "absolutely no new BUG_ON() calls _ever_" [2] ... not even if something really shouldn't ever happen and is merely for documenting that an invariant always has to hold. However, there are sill exceptions where BUG_ON() may be used: If you have a "this is major internal corruption, there's no way we can continue", then BUG_ON() is appropriate. [3] There is only one good BUG_ON(): Now, that said, there is one very valid sub-form of BUG_ON(): BUILD_BUG_ON() is absolutely 100% fine. [2] While WARN will also crash the machine with panic_on_warn set, that's exactly to be expected: So we have two very different cases: the "virtual machine with good logging where a dead machine is fine" - use 'panic_on_warn'. And the actual real hardware with real drivers, running real loads by users. [4] The basic idea is that warnings will similarly get reported by users and be found during testing. However, in contrast to a BUG(), there is a way to actually influence the expected behavior (e.g., panic_on_warn) and to eventually keep the machine alive to extract some debug info. Ingo notes that not all WARN_ON_ONCE cases need recovery. If we don't ever expect this code to trigger in any case, recovery code is not really helpful. I'd prefer to keep all these warnings 'simple' - i.e. no attempted recovery & control flow, unless we ever expect these to trigger. [5] There have been different rules floating around that were never properly documented. Let's try to clarify. [1] https://lkml.kernel.org/r/CAHk-=wiEAH+ojSpAgx_Ep=NKPWHU8AdO3V56BXcCsU97oYJ1EA@mail.gmail.com [2] https://lore.kernel.org/r/CAHk-=wg40EAZofO16Eviaj7mfqDhZ2gVEbvfsMf6gYzspRjYvw@mail.gmail.com [3] https://lkml.kernel.org/r/CAHk-=wit-DmhMfQErY29JSPjFgebx_Ld+pnerc4J2Ag990WwAA@mail.gmail.com [4] https://lore.kernel.org/r/CAHk-=wgF7K2gSSpy=m_=K3Nov4zaceUX9puQf1TjkTJLA2XC_g@mail.gmail.com [5] https://lore.kernel.org/r/YwIW+mVeZoTOxn%2F4@gmail.com Reviewed-by: John Hubbard Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20220923113426.52871-2-david@redhat.com Signed-off-by: Jonathan Corbet commit 657ed9c9bca059660238771dd1fcecb57b59f90a Author: Yang Yingliang Date: Tue Sep 27 16:02:15 2022 +0800 Documentation: devres: add missing IO helper Add missing devm_request_free_mem_region() to devres.rst. It's introduced by commit 0092908d16c6 ("mm: factor out a devm_request_free_mem_region helper"). Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927080215.1359979-1-yangyingliang@huawei.com Signed-off-by: Jonathan Corbet commit 06699e6915536b88ec9457f105a5facf5bc81f88 Author: Yang Yingliang Date: Tue Sep 27 16:38:19 2022 +0800 Documentation: devres: update IRQ helper devm_irq_sim_init() has been changed to devm_irq_domain_create_sim() in commit 337cbeb2c13e ("genirq/irq_sim: Simplify the API"). Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927083819.12484-1-yangyingliang@huawei.com Signed-off-by: Jonathan Corbet commit 9a7d7a80e11025e5e8b4dedf75c97096b67a7b9b Author: Vernon Yang Date: Mon Sep 26 23:20:32 2022 +0800 Documentation/mm: modify page_referenced to folio_referenced Since commit b3ac04132c4b ("mm/rmap: Turn page_referenced() into folio_referenced()") the page_referenced function name was modified, so fix it up to use the correct one. Signed-off-by: Vernon Yang Reviewed-by: Mike Rapoport Link: https://lore.kernel.org/r/20220926152032.74621-1-vernon2gm@gmail.com Signed-off-by: Jonathan Corbet commit 26e54448092917edd54c4255382f78b24e07b01f Author: Kristen Carlson Accardi Date: Mon Sep 26 14:11:49 2022 -0700 Documentation/CoC: Reflect current CoC interpretation and practices The Code of Conduct interpretation does not reflect the current practices of the CoC committee or the TAB. Update the documentation to remove references to initial committees and boot strap periods since it is past that time, and note that the this document does serve as the documentation for the CoC committee processes. Signed-off-by: Kristen Carlson Accardi Reviewed-by: Shuah Khan Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220926211149.2278214-1-kristen@linux.intel.com Signed-off-by: Jonathan Corbet commit 679b4bc25fc7b5b742622eb760211f2b5b1dc4db Author: Akira Yokosawa Date: Fri Sep 16 19:08:05 2022 +0900 docs/doc-guide: Add documentation on SPHINX_IMGMATH Now that building html docs with math expressions does not need texlive packages, remove the note on the requirement in the "Sphinx Install" section. Instead, add sections of "Math Expressions in HTML" and "Choice of Math Renderer". Describe the effect of setting SPHINX_IMGMATH in the latter section. Signed-off-by: Akira Yokosawa Cc: Mauro Carvalho Chehab Cc: Randy Dunlap Link: https://lore.kernel.org/r/a67e3279-6bc7-ee2c-2b49-9275252460b0@gmail.com Signed-off-by: Jonathan Corbet commit 2f993509a97ed210ed0ada9198d380885265fa0b Author: Thorsten Leemhuis Date: Wed Sep 28 15:39:40 2022 +0200 docs: process/5.Posting.rst: clarify use of Reported-by: tag Bring the description on when to use the Reported-by: tag found in Documentation/process/5.Posting.rst more in line with the description in Documentation/process/submitting-patches.rst: before this change the two were contradicting each other, as the latter is way more permissive and only states '[...] if the bug was reported in private, then ask for permission first before using the Reported-by tag.' Signed-off-by: Thorsten Leemhuis Link: https://lore.kernel.org/r/2fc7162dfb76e04da5ea903c9c170d913e735dad.1664372256.git.linux@leemhuis.info Signed-off-by: Jonathan Corbet commit e94102e5067591aa713e623d7d1226f07d4431cf Author: Tiezhu Yang Date: Fri Sep 16 17:55:06 2022 +0800 docs, kprobes: Fix the wrong location of Kprobes After commit 22471e1313f2 ("kconfig: use a menu in arch/Kconfig to reduce clutter"), the location of Kprobes is under "General architecture-dependent options" rather than "General setup". Signed-off-by: Tiezhu Yang Acked-by: Steven Rostedt (Google) Fixes: 22471e1313f2 ("kconfig: use a menu in arch/Kconfig to reduce clutter") Link: https://lore.kernel.org/r/1663322106-12178-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Jonathan Corbet commit 3b684d0467973c2a18c4bdc5a8bc1be4df5a5486 Author: Tony Lindgren Date: Mon Sep 19 14:23:57 2022 +0300 dt-bindings: timer: Add power-domains for TI timer-dm on K3 On K3 SoCs, the power-domains property is needed. On the earlier SoCs, the power-domains property is handled by the interconnect target module parent device. Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Nishanth Menon Cc: Vignesh Raghavendra Signed-off-by: Tony Lindgren Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220919112357.64997-1-tony@atomide.com Signed-off-by: Rob Herring commit 1404f29258dc87a5fc971ea96743d4635caeb9b3 Merge: 49beeea7ebdb1 489876063fb14 Author: Jonathan Corbet Date: Thu Sep 29 12:55:45 2022 -0600 Merge branch 'fp' into docs-mw The top-level index.rst file is the entry point for the kernel's documentation, especially for readers of the HTML output. It is currently a mess containing everything we thought to throw in there. Firefox says it would require 26 pages of paper to print it. That is not a user-friendly introduction. This series aims to improve our documentation entry point with a focus on rewriting index.rst. The result is, IMO, simpler and more approachable. For anybody who wants to see the rendered results without building the docs, have a look at: https://static.lwn.net/kerneldoc/ This time around I've rendered the pages using the "Read The Docs" theme, since that's what everybody will get by default. That theme ignores the directives regarding the left column, so the results are not as good there. I have a series proposing a default-theme change in the works, but that's a separate topic. This is only a beginning; I think this kind of organizational effort has to be pushed down into the lower layers of the docs tree itself. But one has to start somewhere. commit 489876063fb14290d2d1b6080c5fdc02b7a481d4 Author: Jonathan Corbet Date: Tue Sep 27 10:05:59 2022 -0600 docs: add a man-pages link to the front page Readers looking for user-oriented information may benefit from it. Signed-off-by: Jonathan Corbet Reviewed-by: David Vernet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-8-corbet@lwn.net Signed-off-by: Jonathan Corbet commit e40573a43d163a5c9fe14c647bc4c5201d782893 Author: Jonathan Corbet Date: Tue Sep 27 10:05:58 2022 -0600 docs: put atomic*.txt and memory-barriers.txt into the core-api book These files describe part of the core API, but have never been converted to RST due to ... let's say local oppposition. So, create a set of special-purpose wrappers to ..include these files into a separate page so that they can be a part of the htmldocs build. Then link them into the core-api manual and remove them from the "staging" dumping ground. Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Reviewed-by: David Vernet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-7-corbet@lwn.net Signed-off-by: Jonathan Corbet commit f4bf1cd4ac9c8c4610b687e49a1ba691ab286235 Author: Jonathan Corbet Date: Tue Sep 27 10:05:57 2022 -0600 docs: move asm-annotations.rst into core-api This one file should not really be in the top-level documentation directory. core-api/ may not be a perfect fit but seems to be best, so move it there. Adjust a couple of internal document references to make them location-independent, and point checkpatch.pl at the new location. Cc: Jiri Slaby Cc: Joe Perches Reviewed-by: David Vernet Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-6-corbet@lwn.net Signed-off-by: Jonathan Corbet commit 90c0bf89dec0c66d2e6538857060586073427059 Author: Jonathan Corbet Date: Tue Sep 27 10:05:56 2022 -0600 docs: remove some index.rst cruft There is some useless boilerplate text that was added by sphinx when this file was first created; take it out. Reviewed-by: David Vernet Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-5-corbet@lwn.net Signed-off-by: Jonathan Corbet commit 3aa024e4e91249524e1342a6790bb561fbea89a4 Author: Jonathan Corbet Date: Tue Sep 27 10:05:55 2022 -0600 docs: reconfigure the HTML left column Use the html_sidebars directive to get a more useful set of links in the left column. Unfortunately, this is a no-op with the default RTD theme, but others observe it. Reviewed-by: David Vernet Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-4-corbet@lwn.net Signed-off-by: Jonathan Corbet commit 0c7b4366f1ab955f0b8411c14e764d75e21e1a1c Author: Jonathan Corbet Date: Tue Sep 27 10:05:54 2022 -0600 docs: Rewrite the front page The front page is the entry point to the documentation, especially for people who read it online. It's a big mess of everything we could think to toss into it. Rewrite the page with an eye toward simplicity and making it easy for readers to get going toward what they really want to find. This is only a beginning, but it makes our docs more approachable than before. Acked-by: Jani Nikula Reviewed-by: David Vernet Signed-off-by: Jonathan Corbet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-3-corbet@lwn.net Signed-off-by: Jonathan Corbet commit 9d0f5cd167444dcffcd46fe19a2cf86f30371f5c Author: Jonathan Corbet Date: Tue Sep 27 10:05:53 2022 -0600 docs: promote the title of process/index.rst ...otherwise Sphinx won't cooperate when trying to list it explicitly in the top-level index.rst file Reviewed-by: David Vernet Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220927160559.97154-2-corbet@lwn.net Signed-off-by: Jonathan Corbet commit 72a95859728a7866522e6633818bebc1c2519b17 Author: Andy Shevchenko Date: Mon Aug 8 17:08:11 2022 +0300 mfd: syscon: Remove repetition of the regmap_get_val_endian() Since the commit 0dbdb76c0ca8 ("regmap: mmio: Parse endianness definitions from DT") regmap MMIO parses DT itsef, no need to repeat this in the caller(s). Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220808140811.26734-1-andriy.shevchenko@linux.intel.com commit b957df98469240d459bcfae6904b36d6ecea9bee Author: Gaosheng Cui Date: Sun Sep 11 17:18:17 2022 +0800 dmaengine: ioat: remove unused declarations in dma.h ioat_ring_alloc_order and ioat_ring_max_alloc_order have been removed since commit cd60cd96137f ("dmaengine: IOATDMA: Removing descriptor ring reshape"), so remove them. Signed-off-by: Gaosheng Cui Acked-by: Dave Jiang Link: https://lore.kernel.org/r/20220911091817.3214271-1-cuigaosheng1@huawei.com Signed-off-by: Vinod Koul commit e8e2f92b1553b977aef8bb4fa4e4c5b69c8d9d54 Author: Vaishnav Achath Date: Wed Sep 14 16:30:49 2022 +0530 dmaengine: ti: k3-udma: Respond TX done if DMA_PREP_INTERRUPT is not requested If the DMA consumer driver does not expect the callback for TX done, then we need not perform the channel RT byte counter calculations and estimate the completion but return complete on first attempt itself.This assumes that the consumer who did not request DMA_PREP_INTERRUPT has its own mechanism for understanding TX completion, example: MCSPI EOW interrupt can be used as TX completion signal for a SPI transaction. Signed-off-by: Vaishnav Achath Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220914110049.5842-1-vaishnav.a@ti.com Signed-off-by: Vinod Koul commit f2b816a1dfb8b4bbbecd1603e6c17c3d457e2c0a Author: Swati Agarwal Date: Thu Sep 15 14:35:16 2022 +0530 dmaengine: zynqmp_dma: Add device_synchronize support dmaengine_synchronize implementation is required to synchronize proper termination of current transfers so that any memory resources are not freed while still in use. Implement this callback in the driver so that framework can use the same (in dmaengine_terminate_sync/ dmaengine_synchronize). Signed-off-by: Swati Agarwal Link: https://lore.kernel.org/r/20220915090516.5812-1-swati.agarwal@amd.com Signed-off-by: Vinod Koul commit 41d8ffd7cb2add394a2626f12357770846abcf1e Author: Christian Marangi Date: Wed Sep 14 16:04:26 2022 +0200 dt-bindings: dma: add additional pbus reset to qcom,adm qcom,adm require an additional reset for the pbus line. Add this missing reset to match the current implementation on ipq806x.dtsi. Signed-off-by: Christian Marangi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220914140426.7609-2-ansuelsmth@gmail.com Signed-off-by: Vinod Koul commit 84641a1e32cbbabfe9a808b4df79f75ed4c88576 Author: Christian Marangi Date: Wed Sep 14 16:04:25 2022 +0200 dt-bindings: dma: rework qcom,adm Documentation to yaml schema Rework the qcom,adm Documentation to yaml schema. This is not a pure conversion since originally the driver has changed implementation for the #dma-cells and was wrong from the start. Also the driver now handles the common DMA clients implementation with the first cell that denotes the channel number and nothing else since the client will have to provide the crci information via other means. Signed-off-by: Christian Marangi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220914140426.7609-1-ansuelsmth@gmail.com Signed-off-by: Vinod Koul commit 41742afd34b7ac354ec354a3efa3651e486d8c54 Author: Janne Grunau Date: Fri Sep 16 16:25:41 2022 +0200 dt-bindings: dma: apple,admac: Add iommus and power-domains properties Apple's ADMAC is on all supported Apple silicon SoCs behind an IOMMU and has its own power-domain. Signed-off-by: Janne Grunau Acked-by: Martin Povišer Acked-by: Krzysztof Kozlowski Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220916142550.269905-2-j@jannau.net Signed-off-by: Vinod Koul commit a0188eb6e71c93ab7dd9bfa4305fac43c70db309 Author: Manivannan Sadhasivam Date: Sat Sep 10 11:17:00 2022 +0530 dmaengine: dw-edma: Remove runtime PM support Currently, the dw-edma driver enables the runtime_pm for parent device (chip->dev) and increments/decrements the refcount during alloc/free chan resources callbacks. This leads to a problem when the eDMA driver has been probed, but the channels were not used. This scenario can happen when the DW PCIe driver probes eDMA driver successfully, but the PCI EPF driver decides not to use eDMA channels and use iATU instead for PCI transfers. In this case, the underlying device would be runtime suspended due to pm_runtime_enable() in dw_edma_probe() and the PCI EPF driver would have no knowledge of it. Ideally, the eDMA driver should not be the one doing the runtime PM of the parent device. The responsibility should instead belong to the client drivers like PCI EPF. So let's remove the runtime PM support from eDMA driver. Cc: Serge Semin Cc: Frank Li Reviewed-by: Serge Semin Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220910054700.12205-1-manivannan.sadhasivam@linaro.org Signed-off-by: Vinod Koul commit 7ca68fa3c8ab83dfa539f16c5b4b1aec2e33320d Author: Dave Jiang Date: Sat Sep 17 09:12:22 2022 -0700 dmaengine: idxd: add configuration for concurrent batch descriptor processing Add sysfs knob to allow control of the number of batch descriptors that can be concurrently processed by an engine in the group as a fraction of the Maximum Work Descriptors in Progress value specfied in ENGCAP register. This control knob is part of toggle for QoS control. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220917161222.2835172-6-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 1f2737521af2b7d018971f1d873856fff02d2b33 Author: Dave Jiang Date: Sat Sep 17 09:12:21 2022 -0700 dmaengine: idxd: add configuration for concurrent work descriptor processing Add sysfs knob to allow control of the number of work descriptors that can be concurrently processed by an engine in the group as a fraction of the Maximum Work Descriptors in Progress value specified in ENGCAP register. This control knob is part of toggle for QoS control. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220917161222.2835172-5-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit b0325aefd398d8b536ba46ee2e5d24252c1b2258 Author: Dave Jiang Date: Sat Sep 17 09:12:20 2022 -0700 dmaengine: idxd: add WQ operation cap restriction support DSA 2.0 add the capability of configuring DMA ops on a per workqueue basis. This means that certain ops can be disabled by the system administrator for certain wq. By default, all ops are available. A bitmap is used to store the ops due to total op size of 256 bits and it is more convenient to use a range list to specify which bits are enabled. One of the usage to support this is for VM migration between different iteration of devices. The newer ops are disabled in order to allow guest to migrate to a host that only support older ops. Another usage is to restrict the WQ to certain operations for QoS of performance. A sysfs of ops_config attribute is added per wq. It is only usable when the ops_config bit is set under WQ_CAP register. This means that this attribute will return -EOPNOTSUPP on DSA 1.x devices. The expected input is a range list for the bits per operation the WQ supports. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220917161222.2835172-4-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit a8563a33a5e26064061f2fb34215c97f0e2995f4 Author: Dave Jiang Date: Sat Sep 17 09:12:19 2022 -0700 dmanegine: idxd: reformat opcap output to match bitmap_parse() input To make input and output consistent and prepping for the per WQ operation configuration support, change the output of opcap display to match the input that is expected by bitmap_parse() helper function. The output will be a bitmap with field width as the number of bits using the %*pb format specifier for printk() family. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220917161222.2835172-3-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 22bd0df846ca1388ce9f5d54fb6e9f597c932ba9 Author: Dave Jiang Date: Sat Sep 17 09:12:18 2022 -0700 dmaengine: idxd: convert ats_dis to a wq flag Make wq attributes access consistent. Convert ats_dis to wq flag WQ_FLAG_ATS_DISABLE. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220917161222.2835172-2-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 898ec89dbb55b8294695ad71694a0684e62b2a73 Author: Dave Jiang Date: Mon Sep 19 09:58:42 2022 -0700 dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() User reports observing timer event report channel halted but no error observed in CHANERR register. The driver finished self-test and released channel resources. Debug shows that __cleanup() can call mod_timer() after the timer has been deleted and thus resurrect the timer. While harmless, it causes suprious error message to be emitted. Use mod_timer_pending() call to prevent deleted timer from being resurrected. Fixes: 3372de5813e4 ("dmaengine: ioatdma: removal of dma_v3.c and relevant ioat3 references") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/166360672197.3851724.17040290563764838369.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit b9d2140c3badf4107973ad77c5a0ec3075705c85 Author: Christian Marangi Date: Fri Sep 16 06:12:56 2022 +0200 dmaengine: qcom-adm: fix wrong calling convention for prep_slave_sg The calling convention for pre_slave_sg is to return NULL on error and provide an error log to the system. Qcom-adm instead provide error pointer when an error occur. This indirectly cause kernel panic for example for the nandc driver that checks only if the pointer returned by device_prep_slave_sg is not NULL. Returning an error pointer makes nandc think the device_prep_slave_sg function correctly completed and makes the kernel panics later in the code. While nandc is the one that makes the kernel crash, it was pointed out that the real problem is qcom-adm not following calling convention for that function. To fix this, drop returning error pointer and return NULL with an error log. Fixes: 03de6b273805 ("dmaengine: qcom-adm: stop abusing slave_id config") Fixes: 5c9f8c2dbdbe ("dmaengine: qcom: Add ADM driver") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org # v5.11+ Link: https://lore.kernel.org/r/20220916041256.7104-1-ansuelsmth@gmail.com Signed-off-by: Vinod Koul commit 7c8765308371be30f50c1b5b97618b731514b207 Author: Christian Marangi Date: Thu Sep 15 22:48:44 2022 +0200 dmaengine: qcom-adm: fix wrong sizeof config in slave_config Fix broken slave_config function that uncorrectly compare the peripheral_size with the size of the config pointer instead of the size of the config struct. This cause the crci value to be ignored and cause a kernel panic on any slave that use adm driver. To fix this, compare to the size of the struct and NOT the size of the pointer. Fixes: 03de6b273805 ("dmaengine: qcom-adm: stop abusing slave_id config") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org # v5.17+ Reviewed-by: Arnd Bergmann Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220915204844.3838-1-ansuelsmth@gmail.com Signed-off-by: Vinod Koul commit d56f66d2bd4a7133e7d6a4c814c7582b4a7d1000 Author: James Clark Date: Thu Sep 22 15:24:00 2022 +0100 arm64: defconfig: Add Coresight as module Add Coresight to defconfig so that build errors are caught. CONFIG_CORESIGHT_SOURCE_ETM4X is excluded because it depends on CONFIG_PID_IN_CONTEXTIDR which has a performance cost. Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220922142400.478815-2-james.clark@arm.com Signed-off-by: Catalin Marinas commit a711987490a1784c3e3fd6d752a63501c11eb80b Author: Mark Brown Date: Wed Sep 21 19:13:45 2022 +0100 kselftest/arm64: Handle EINTR while reading data from children Currently we treat any error when reading from the child as a failure and don't read any more output from that child as a result. This ignores the fact that it is valid for read() to return EINTR as the error code if there is a signal pending so we could stop handling the output of children, especially during exit when we will get some SIGCHLD signals delivered to us. Fix this by pulling the read handling out into a separate function which returns a flag if reads should be continued and wrapping it in a loop. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220921181345.618085-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit dd72dd7cd527ff9313af5866434e698fdbda98ae Author: Mark Brown Date: Wed Sep 21 19:13:44 2022 +0100 kselftest/arm64: Flag fp-stress as exiting when we begin finishing up Once we have started exiting the termination handler will have the same effect as what we're already running so set the termination flag at that point. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220921181345.618085-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit c38d381fff26ece271447d558dcb4b42f0ccda51 Author: Mark Brown Date: Wed Sep 21 19:13:43 2022 +0100 kselftest/arm64: Don't repeat termination handler for fp-stress When fp-stress gets a termination signal it sets a flag telling itself to exit and sends a termination signal to all the children. If the flag is set then don't bother repeating this process, it isn't going to accomplish anything other than consume CPU time which can be an issue when running in emulation. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220921181345.618085-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8c6e3657be6b39cd5943041d0a4ab6bd5d0c2258 Author: Xiu Jianfeng Date: Sun Sep 11 11:47:47 2022 +0800 ARM64: reloc_test: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220911034747.132098-1-xiujianfeng@huawei.com Signed-off-by: Catalin Marinas commit b000145e9907809406d8164c3b2b8861d95aecd1 Author: Jens Axboe Date: Thu Sep 29 10:57:05 2022 -0600 io_uring/rw: defer fsnotify calls to task context We can't call these off the kiocb completion as that might be off soft/hard irq context. Defer the calls to when we process the task_work for this request. That avoids valid complaints like: stack backtrace: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.0.0-rc6-syzkaller-00321-g105a36f3694e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3961 [inline] valid_state kernel/locking/lockdep.c:3973 [inline] mark_lock_irq kernel/locking/lockdep.c:4176 [inline] mark_lock.part.0.cold+0x18/0xd8 kernel/locking/lockdep.c:4632 mark_lock kernel/locking/lockdep.c:4596 [inline] mark_usage kernel/locking/lockdep.c:4527 [inline] __lock_acquire+0x11d9/0x56d0 kernel/locking/lockdep.c:5007 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __fs_reclaim_acquire mm/page_alloc.c:4674 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4688 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:700 [inline] slab_alloc mm/slab.c:3278 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc+0x39/0x520 mm/slab.c:3491 fanotify_alloc_fid_event fs/notify/fanotify/fanotify.c:580 [inline] fanotify_alloc_event fs/notify/fanotify/fanotify.c:813 [inline] fanotify_handle_event+0x1130/0x3f40 fs/notify/fanotify/fanotify.c:948 send_to_group fs/notify/fsnotify.c:360 [inline] fsnotify+0xafb/0x1680 fs/notify/fsnotify.c:570 __fsnotify_parent+0x62f/0xa60 fs/notify/fsnotify.c:230 fsnotify_parent include/linux/fsnotify.h:77 [inline] fsnotify_file include/linux/fsnotify.h:99 [inline] fsnotify_access include/linux/fsnotify.h:309 [inline] __io_complete_rw_common+0x485/0x720 io_uring/rw.c:195 io_complete_rw+0x1a/0x1f0 io_uring/rw.c:228 iomap_dio_complete_work fs/iomap/direct-io.c:144 [inline] iomap_dio_bio_end_io+0x438/0x5e0 fs/iomap/direct-io.c:178 bio_endio+0x5f9/0x780 block/bio.c:1564 req_bio_endio block/blk-mq.c:695 [inline] blk_update_request+0x3fc/0x1300 block/blk-mq.c:825 scsi_end_request+0x7a/0x9a0 drivers/scsi/scsi_lib.c:541 scsi_io_completion+0x173/0x1f70 drivers/scsi/scsi_lib.c:971 scsi_complete+0x122/0x3b0 drivers/scsi/scsi_lib.c:1438 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1022 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 common_interrupt+0xa9/0xc0 arch/x86/kernel/irq.c:240 Fixes: f63cf5192fe3 ("io_uring: ensure that fsnotify is always called") Link: https://lore.kernel.org/all/20220929135627.ykivmdks2w5vzrwg@quack3/ Reported-by: syzbot+dfcc5f4da15868df7d4d@syzkaller.appspotmail.com Reported-by: Jan Kara Signed-off-by: Jens Axboe commit b9dd04a20f81333e4b99662f1bbaf7c9e3a1e137 Author: Mike Rapoport Date: Wed Sep 21 10:48:41 2022 +0300 arm64/mm: fold check for KFENCE into can_set_direct_map() KFENCE requires linear map to be mapped at page granularity, so that it is possible to protect/unprotect single pages, just like with rodata_full and DEBUG_PAGEALLOC. Instead of repating can_set_direct_map() || IS_ENABLED(CONFIG_KFENCE) make can_set_direct_map() handle the KFENCE case. This also prevents potential false positives in kernel_page_present() that may return true for non-present page if CONFIG_KFENCE is enabled. Signed-off-by: Mike Rapoport Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220921074841.382615-1-rppt@kernel.org Signed-off-by: Catalin Marinas commit 8cfb08575c6d4585f1ce0deeb189e5c824776b04 Author: Mark Rutland Date: Thu Sep 29 14:45:25 2022 +0100 arm64: ftrace: fix module PLTs with mcount Li Huafei reports that mcount-based ftrace with module PLTs was broken by commit: a6253579977e4c6f ("arm64: ftrace: consistently handle PLTs.") When a module PLTs are used and a module is loaded sufficiently far away from the kernel, we'll create PLTs for any branches which are out-of-range. These are separate from the special ftrace trampoline PLTs, which the module PLT code doesn't directly manipulate. When mcount is in use this is a problem, as each mcount callsite in a module will be initialized to point to a module PLT, but since commit a6253579977e4c6f ftrace_make_nop() will assume that the callsite has been initialized to point to the special ftrace trampoline PLT, and ftrace_find_callable_addr() rejects other cases. This means that when ftrace tries to initialize a callsite via ftrace_make_nop(), the call to ftrace_find_callable_addr() will find that the `_mcount` stub is out-of-range and is not handled by the ftrace PLT, resulting in a splat: | ftrace_test: loading out-of-tree module taints kernel. | ftrace: no module PLT for _mcount | ------------[ ftrace bug ]------------ | ftrace failed to modify | [] 0xffff800029180014 | actual: 44:00:00:94 | Initializing ftrace call sites | ftrace record flags: 2000000 | (0) | expected tramp: ffff80000802eb3c | ------------[ cut here ]------------ | WARNING: CPU: 3 PID: 157 at kernel/trace/ftrace.c:2120 ftrace_bug+0x94/0x270 | Modules linked in: | CPU: 3 PID: 157 Comm: insmod Tainted: G O 6.0.0-rc6-00151-gcd722513a189-dirty #22 | Hardware name: linux,dummy-virt (DT) | pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : ftrace_bug+0x94/0x270 | lr : ftrace_bug+0x21c/0x270 | sp : ffff80000b2bbaf0 | x29: ffff80000b2bbaf0 x28: 0000000000000000 x27: ffff0000c4d38000 | x26: 0000000000000001 x25: ffff800009d7e000 x24: ffff0000c4d86e00 | x23: 0000000002000000 x22: ffff80000a62b000 x21: ffff8000098ebea8 | x20: ffff0000c4d38000 x19: ffff80000aa24158 x18: ffffffffffffffff | x17: 0000000000000000 x16: 0a0d2d2d2d2d2d2d x15: ffff800009aa9118 | x14: 0000000000000000 x13: 6333626532303830 x12: 3030303866666666 | x11: 203a706d61727420 x10: 6465746365707865 x9 : 3362653230383030 | x8 : c0000000ffffefff x7 : 0000000000017fe8 x6 : 000000000000bff4 | x5 : 0000000000057fa8 x4 : 0000000000000000 x3 : 0000000000000001 | x2 : ad2cb14bb5438900 x1 : 0000000000000000 x0 : 0000000000000022 | Call trace: | ftrace_bug+0x94/0x270 | ftrace_process_locs+0x308/0x430 | ftrace_module_init+0x44/0x60 | load_module+0x15b4/0x1ce8 | __do_sys_init_module+0x1ec/0x238 | __arm64_sys_init_module+0x24/0x30 | invoke_syscall+0x54/0x118 | el0_svc_common.constprop.4+0x84/0x100 | do_el0_svc+0x3c/0xd0 | el0_svc+0x1c/0x50 | el0t_64_sync_handler+0x90/0xb8 | el0t_64_sync+0x15c/0x160 | ---[ end trace 0000000000000000 ]--- | ---------test_init----------- Fix this by reverting to the old behaviour of ignoring the old instruction when initialising an mcount callsite in a module, which was the behaviour prior to commit a6253579977e4c6f. Signed-off-by: Mark Rutland Fixes: a6253579977e ("arm64: ftrace: consistently handle PLTs.") Reported-by: Li Huafei Link: https://lore.kernel.org/linux-arm-kernel/20220929094134.99512-1-lihuafei1@huawei.com Cc: Ard Biesheuvel Cc: Will Deacon Link: https://lore.kernel.org/r/20220929134525.798593-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 5de2291605087b7a0cbc978c1a55dd4916f04e6e Author: Li Huafei Date: Thu Sep 29 17:41:33 2022 +0800 arm64: module: Remove unused plt_entry_is_initialized() Since commit f1a54ae9af0d ("arm64: module/ftrace: intialize PLT at load time"), plt_entry_is_initialized() is unused anymore , so remove it. Signed-off-by: Li Huafei Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220929094134.99512-3-lihuafei1@huawei.com Signed-off-by: Catalin Marinas commit 3fb420f56cbf06b6ef8c39b886fed8f8f9aedee3 Author: Li Huafei Date: Thu Sep 29 17:41:32 2022 +0800 arm64: module: Make plt_equals_entry() static Since commit 4e69ecf4da1e ("arm64/module: ftrace: deal with place relative nature of PLTs"), plt_equals_entry() is not used outside of module-plts.c, so make it static. Signed-off-by: Li Huafei Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220929094134.99512-2-lihuafei1@huawei.com Signed-off-by: Catalin Marinas commit ba00c2a04fa5431d204a4183062b30372c062aa7 Author: Mark Rutland Date: Thu Sep 29 16:02:27 2022 +0100 arm64: fix the build with binutils 2.27 Jon Hunter reports that for some toolchains the build has been broken since commit: 4c0bd995d73ed889 ("arm64: alternatives: have callbacks take a cap") ... with a stream of build-time splats of the form: | CC arch/arm64/kvm/hyp/vhe/debug-sr.o | /tmp/ccY3kbki.s: Assembler messages: | /tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1600: Error: junk at end of line, first unrecognized character | is `L' | /tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')' | /tmp/ccY3kbki.s:1723: Error: junk at end of line, first unrecognized character | is `L' | scripts/Makefile.build:249: recipe for target | 'arch/arm64/kvm/hyp/vhe/debug-sr.o' failed The issue here is that older versions of binutils (up to and including 2.27.0) don't like an 'L' suffix on constants. For plain assembly files, UL() avoids this suffix, but in C files this gets added, and so for inline assembly we can't directly use a constant defined with `UL()`. We could avoid this by passing the constant as an input parameter, but this isn't practical given the way we use the alternative macros. Instead, just open code the constant without the `UL` suffix, and for consistency do this for both the inline assembly macro and the regular assembly macro. Signed-off-by: Mark Rutland Fixes: 4c0bd995d73e ("arm64: alternatives: have callbacks take a cap") Reported-by: Jon Hunter Link: https://lore.kernel.org/linux-arm-kernel/3cecc3a5-30b0-f0bd-c3de-9e09bd21909b@nvidia.com/ Tested-by: Jon Hunter Cc: Ard Biesheuvel Cc: Will Deacon Link: https://lore.kernel.org/r/20220929150227.1028556-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 2fff00c81d4c37a037cf704d2d219fbcb45aea3c Author: Mickaël Salaün Date: Fri Sep 23 17:42:07 2022 +0200 landlock: Fix documentation style It seems that all code should use double backquotes, which is also used to convert "%" defines. Let's use an homogeneous style and remove all use of simple backquotes (which should only be used for emphasis). Cc: Günther Noack Cc: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220923154207.3311629-4-mic@digikod.net commit 16023b05f0832f5bc14e6e0d1e7be4d00e01e1bb Author: Mickaël Salaün Date: Fri Sep 23 17:42:06 2022 +0200 landlock: Slightly improve documentation and fix spelling Now that we have more than one ABI version, make limitation explanation more consistent by replacing "ABI 1" with "ABI < 2". This also indicates which ABIs support such past limitation. Improve documentation consistency by not using contractions. Fix spelling in fs.c . Cc: Paul Moore Signed-off-by: Mickaël Salaün Reviewed-by: Günther Noack Link: https://lore.kernel.org/r/20220923154207.3311629-3-mic@digikod.net commit 903cfe8a7aa8894ae60ef47a9c011e551d7bafef Author: Mickaël Salaün Date: Fri Sep 23 17:42:05 2022 +0200 samples/landlock: Print hints about ABI versions Extend the help with the latest Landlock ABI version supported by the sandboxer. Inform users about the sandboxer or the kernel not being up-to-date. Make the version check code easier to update and harder to misuse. Cc: Paul Moore Signed-off-by: Mickaël Salaün Reviewed-by: Günther Noack Link: https://lore.kernel.org/r/20220923154207.3311629-2-mic@digikod.net commit 994c77ed371e464ae4c1bfc316f7aff7309b2d59 Author: Dmitry Baryshkov Date: Wed Sep 28 17:56:09 2022 +0300 clk: qcom: gcc-msm8939: use ARRAY_SIZE instead of specifying num_parents Use ARRAY_SIZE() instead of manually specifying num_parents. This makes adding/removing entries to/from parent_data easy and errorproof. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220928145609.375860-4-dmitry.baryshkov@linaro.org commit f565f9235a675e6eb5a105daa9b70ffa96aab715 Author: Dmitry Baryshkov Date: Wed Sep 28 17:56:08 2022 +0300 clk: qcom: gcc-msm8939: use parent_hws where possible Use parent_hws instead of hanving parent_data with just a single .hw entry to speed up and simplify parent lookups. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220928145609.375860-3-dmitry.baryshkov@linaro.org commit 2ab5b5663805ec8e5dc1dbdd9cb14ffac5b06ed1 Author: Dmitry Baryshkov Date: Wed Sep 28 17:56:07 2022 +0300 dt-bindings: clock: move qcom,gcc-msm8939 to qcom,gcc-msm8916.yaml The MSM8939 GCC bindings are fully comptible with MSM8916, the clock controller requires the same parent clocks, move MSM8939 GCC compatible to qcom,msm8916.yaml Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220928145609.375860-2-dmitry.baryshkov@linaro.org commit a01ef02093ac45cc4991dbf93134c3cb4c293c32 Author: Luca Weiss Date: Wed Sep 28 15:28:54 2022 +0200 clk: qcom: gcc-sm6350: Update the .pwrsts for usb gdscs The USB controllers on sm6350 do not retain the state when the system goes into low power state and the GDSCs are turned off. This can be observed by the USB connection not coming back alive after putting the device into suspend, essentially breaking USB. Fix this by updating the .pwrsts for the USB GDSCs so they only transition to retention state in low power. Cc: Rajendra Nayak Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220928132853.179425-1-luca.weiss@fairphone.com commit 27da533af9b050e751a419c743096d06017daf0e Author: Johan Hovold Date: Thu Sep 29 18:11:24 2022 +0200 clk: qcom: gcc-sc8280xp: use retention for USB power domains Since commit d399723950c4 ("clk: qcom: gdsc: Fix the handling of PWRSTS_RET support) retention mode can be used on sc8280xp to maintain state during suspend instead of leaving the domain always on. This is needed to eventually allow the parent CX domain to be powered down during suspend. Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220929161124.18138-1-johan+linaro@kernel.org commit eab4c1ebdd657957bf7ae66ffb8849b462db78b3 Author: Johan Hovold Date: Thu Sep 29 17:58:16 2022 +0200 clk: qcom: gdsc: add missing error handling Since commit 7eb231c337e0 ("PM / Domains: Convert pm_genpd_init() to return an error code") pm_genpd_init() can return an error which the caller must handle. The current error handling was also incomplete as the runtime PM and regulator use counts were not balanced in all error paths. Add the missing error handling to the GDSC initialisation to avoid continuing as if nothing happened on errors. Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220929155816.17425-1-johan+linaro@kernel.org commit 55c8a987dd73a7ef9e53119f3329620768d4a655 Author: Mark Brown Date: Wed Sep 28 16:45:17 2022 +0100 kselftest/arm64: Don't enable v8.5 for MTE selftest builds Currently we set -march=armv8.5+memtag when building the MTE selftests, allowing the compiler to emit v8.5 and MTE instructions for anything it generates. This means that we may get code that will generate SIGILLs when run on older systems rather than skipping on non-MTE systems as should be the case. Most toolchains don't select any incompatible instructions but I have seen some reports which suggest that some may be appearing which do so. This is also potentially problematic in that if the compiler chooses to emit any MTE instructions for the C code it may interfere with the MTE usage we are trying to test. Since the only reason we are specifying this option is to allow us to assemble MTE instructions in mte_helper.S we can avoid these issues by moving to using a .arch directive there and adding the -march explicitly to the toolchain support check instead of the generic CFLAGS. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220928154517.173108-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4c3386f64a432b3697fede579d06f9c1058043ad Author: Saurabh Sengar Date: Fri Sep 9 08:09:53 2022 -0700 drm/hyperv: Add ratelimit on error message Due to a full ring buffer, the driver may be unable to send updates to the Hyper-V host. But outputing the error message can make the problem worse because console output is also typically written to the frame buffer. Rate limiting the error message, also output the error code for additional diagnosability. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1662736193-31379-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 5ee35abb461e34ec8727dd8abc621ba9abec3e31 Merge: 8526f0d6135f7 3411c5b6f8d6e Author: Alexei Starovoitov Date: Thu Sep 29 09:25:48 2022 -0700 Merge branch 'bpf: Remove recursion check for struct_ops prog' Martin KaFai Lau says: ==================== From: Martin KaFai Lau The struct_ops is sharing the tracing-trampoline's enter/exit function which tracks prog->active to avoid recursion. It turns out the struct_ops bpf prog will hit this prog->active and unnecessarily skipped running the struct_ops prog. eg. The '.ssthresh' may run in_task() and then interrupted by softirq that runs the same '.ssthresh'. The kernel does not call the tcp-cc's ops in a recursive way, so this set is to remove the recursion check for struct_ops prog. v3: - Clear the bpf_chg_cc_inprogress from the newly cloned tcp_sock in tcp_create_openreq_child() because the listen sk can be cloned without lock being held. (Eric Dumazet) v2: - v1 [0] turned into a long discussion on a few cases and also whether it needs to follow the bpf_run_ctx chain if there is tracing bpf_run_ctx (kprobe/trace/trampoline) running in between. It is a good signal that it is not obvious enough to reason about it and needs a tradeoff for a more straight forward approach. This revision uses one bit out of an existing 1 byte hole in the tcp_sock. It is in Patch 4. [0]: https://lore.kernel.org/bpf/20220922225616.3054840-1-kafai@fb.com/T/#md98d40ac5ec295fdadef476c227a3401b2b6b911 ==================== Signed-off-by: Alexei Starovoitov commit 3411c5b6f8d6e08d98e606dcf74fc42e2f9d731f Author: Martin KaFai Lau Date: Thu Sep 29 00:04:07 2022 -0700 selftests/bpf: Check -EBUSY for the recurred bpf_setsockopt(TCP_CONGESTION) This patch changes the bpf_dctcp test to ensure the recurred bpf_setsockopt(TCP_CONGESTION) returns -EBUSY. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220929070407.965581-6-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit 061ff040710e9f6f043d1fa80b1b362d2845b17a Author: Martin KaFai Lau Date: Thu Sep 29 00:04:06 2022 -0700 bpf: tcp: Stop bpf_setsockopt(TCP_CONGESTION) in init ops to recur itself When a bad bpf prog '.init' calls bpf_setsockopt(TCP_CONGESTION, "itself"), it will trigger this loop: .init => bpf_setsockopt(tcp_cc) => .init => bpf_setsockopt(tcp_cc) ... ... => .init => bpf_setsockopt(tcp_cc). It was prevented by the prog->active counter before but the prog->active detection cannot be used in struct_ops as explained in the earlier patch of the set. In this patch, the second bpf_setsockopt(tcp_cc) is not allowed in order to break the loop. This is done by using a bit of an existing 1 byte hole in tcp_sock to check if there is on-going bpf_setsockopt(TCP_CONGESTION) in this tcp_sock. Note that this essentially limits only the first '.init' can call bpf_setsockopt(TCP_CONGESTION) to pick a fallback cc (eg. peer does not support ECN) and the second '.init' cannot fallback to another cc. This applies even the second bpf_setsockopt(TCP_CONGESTION) will not cause a loop. Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220929070407.965581-5-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit 1e7d217faa11ac027f622124a3842aafbd0c4a42 Author: Martin KaFai Lau Date: Thu Sep 29 00:04:05 2022 -0700 bpf: Refactor bpf_setsockopt(TCP_CONGESTION) handling into another function This patch moves the bpf_setsockopt(TCP_CONGESTION) logic into another function. The next patch will add extra logic to avoid recursion and this will make the latter patch easier to follow. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220929070407.965581-4-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit 37cfbe0bf2e85287350a6b0ca9521f5a4c7389ce Author: Martin KaFai Lau Date: Thu Sep 29 00:04:04 2022 -0700 bpf: Move the "cdg" tcp-cc check to the common sol_tcp_sockopt() The check on the tcp-cc, "cdg", is done in the bpf_sk_setsockopt which is used by the bpf_tcp_ca, bpf_lsm, cg_sockopt, and tcp_iter hooks. However, it is not done for cg sock_ddr, cg sockops, and some of the bpf_lsm_cgroup hooks. The tcp-cc "cdg" should have very limited usage. This patch is to move the "cdg" check to the common sol_tcp_sockopt() so that all hooks have a consistent behavior. The motivation to make this check consistent now is because the latter patch will refactor the bpf_setsockopt(TCP_CONGESTION) into another function, so it is better to take this chance to refactor this piece also. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220929070407.965581-3-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit 64696c40d03c01e0ea2e3e9aa1c490a7b6a1b6be Author: Martin KaFai Lau Date: Thu Sep 29 00:04:03 2022 -0700 bpf: Add __bpf_prog_{enter,exit}_struct_ops for struct_ops trampoline The struct_ops prog is to allow using bpf to implement the functions in a struct (eg. kernel module). The current usage is to implement the tcp_congestion. The kernel does not call the tcp-cc's ops (ie. the bpf prog) in a recursive way. The struct_ops is sharing the tracing-trampoline's enter/exit function which tracks prog->active to avoid recursion. It is needed for tracing prog. However, it turns out the struct_ops bpf prog will hit this prog->active and unnecessarily skipped running the struct_ops prog. eg. The '.ssthresh' may run in_task() and then interrupted by softirq that runs the same '.ssthresh'. Skip running the '.ssthresh' will end up returning random value to the caller. The patch adds __bpf_prog_{enter,exit}_struct_ops for the struct_ops trampoline. They do not track the prog->active to detect recursion. One exception is when the tcp_congestion's '.init' ops is doing bpf_setsockopt(TCP_CONGESTION) and then recurs to the same '.init' ops. This will be addressed in the following patches. Fixes: ca06f55b9002 ("bpf: Add per-program recursion prevention mechanism") Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220929070407.965581-2-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit c8d18e44022518ab026338ae86bf14cdf2e71887 Author: Jaroslav Kysela Date: Thu Sep 29 16:37:54 2022 +0200 ASoC: core: clarify the driver name initialization The driver field in the struct snd_ctl_card_info is a valid user space identifier. Actually, many ASoC drivers do not care and let to initialize this field using a standard wrapping method. Unfortunately, in this way, this field becomes unusable and unreadable for the drivers with longer card names. Also, there is a possibility to have clashes (driver field has only limit of 15 characters). This change will print an error when the wrapping is used. The developers of the affected drivers should fix the problem. Signed-off-by: Jaroslav Kysela Reviewed-by: Nícolas F. R. A. Prado Signed-off-by: Mark Brown commit 732d69c80cb04a587d9ec2935bcb63989e66eb92 Merge: aa2808087335a 872f3a4e90ef2 Author: Marc Zyngier Date: Thu Sep 29 17:21:16 2022 +0100 Merge branch irq/misc-6.1 into irq/irqchip-next * irq/misc-6.1: : . : Misc irqchip updates for 6.1: : : - Allow generic irqchip support without selecting CONFIG_OF_IRQ : : - Fix a couple of bindings for TI interrupts controllers : : - Yet another binding update for a Renesas SoC : : - The obligatory fixes from the spelling police : . dt-bindings: irqchip: renesas,irqc: Add r8a779g0 support irqchip/gic-v3: Fix typo in comment dt-bindings: interrupt-controller: ti,sci-intr: Fix missing reg property in the binding dt-bindings: irqchip: ti,sci-inta: Fix warning for missing #interrupt-cells irqchip: Make irqchip_init() usable on pure ACPI systems Signed-off-by: Marc Zyngier commit aa2808087335af628032da25e2801d7ab562635c Merge: 4b0b6c7cd746c 9070f1ce31c50 Author: Marc Zyngier Date: Thu Sep 29 17:21:09 2022 +0100 Merge branch irq/rtl-imap-deprecation into irq/irqchip-next * irq/rtl-imap-deprecation: : . : Deprecate interrupt-map property for realtek-rtl irqchip : : Patches from Sander Vanheule. : . irqchip/realtek-rtl: use parent interrupts dt-bindings: interrupt-controller: realtek,rtl-intc: require parents irqchip/realtek-rtl: use irq_domain_add_linear() Signed-off-by: Marc Zyngier commit 4b0b6c7cd746c13bbe7b44e663266df5413931c2 Merge: b90cb10531903 7c025238b47a5 Author: Marc Zyngier Date: Thu Sep 29 17:20:58 2022 +0100 Merge branch irq/fsl-mu-msi into irq/irqchip-next * irq/fsl-mu-msi: : . : Platform MSI controller driver for the IMX MU block : : Patches from Frank Li. : . dt-bindings: irqchip: Describe the IMX MU block as a MSI controller irqchip: Add IMX MU MSI controller driver irqchip: Allow extra fields to be passed to IRQCHIP_PLATFORM_DRIVER_END platform-msi: Export symbol platform_msi_create_irq_domain() Signed-off-by: Marc Zyngier commit 7c025238b47a55c81c61dfe85a200ab82e6a6ece Author: Frank Li Date: Thu Sep 22 11:12:44 2022 -0500 dt-bindings: irqchip: Describe the IMX MU block as a MSI controller I.MX MU supports generating IRQs by writing to a register. Describe its use as a MSI controller so that other blocks (such as a PCI EP) can use it directly. Reviewed-by: Rob Herring Signed-off-by: Frank Li [maz: commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220922161246.20586-5-Frank.Li@nxp.com commit 693e9c269e8e8fb16f1d7fac38bd774402722e87 Author: Matt Ranostay Date: Mon Sep 19 13:59:30 2022 -0700 dmaengine: ti: k3-psil: add additional TX threads for j721e Add matching PSI-L threads mapping for transmission DMA channels on the J721E platform. Signed-off-by: Matt Ranostay Link: https://lore.kernel.org/r/20220919205931.8397-2-mranostay@ti.com Signed-off-by: Vinod Koul commit 5cfeaf7cc5d2a349ba7f2cc1942e106c972e0a1c Author: Matt Ranostay Date: Mon Sep 19 13:59:31 2022 -0700 dmaengine: ti: k3-psil: add additional TX threads for j7200 Add matching PSI-L threads mapping for transmission DMA channels on the J7200 platform. Signed-off-by: Matt Ranostay Link: https://lore.kernel.org/r/20220919205931.8397-3-mranostay@ti.com Signed-off-by: Vinod Koul commit 6aed75d7ccb3288029287c50fc594a4314698be0 Author: Martin Povišer Date: Sun Sep 18 11:58:45 2022 +0200 dmaengine: apple-admac: Trigger shared reset If a reset domain is attached to the device, obtain a shared reference to it and trigger it. Typically on a chip the ADMAC controller will share a reset domain with the MCA peripheral. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220918095845.68860-5-povik+lin@cutebit.org Signed-off-by: Vinod Koul commit 072431595a57bc6605c29724afce5f9ef8114915 Author: Martin Povišer Date: Sun Sep 18 11:58:44 2022 +0200 dmaengine: apple-admac: Do not use devres for IRQs This is in advance of adding support for triggering the reset signal to the peripheral, since registering the IRQ handler will have to be sequenced with it. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220918095845.68860-4-povik+lin@cutebit.org Signed-off-by: Vinod Koul commit 70afdab904d2d1e68bffe75fe08e7e48e0b0ff8e Author: Frank Li Date: Thu Sep 22 11:12:43 2022 -0500 irqchip: Add IMX MU MSI controller driver The MU block found in a number of Freescale/NXP SoCs supports generating IRQs by writing data to a register. This enables the MU block to be used as a MSI controller, by leveraging the platform-MSI API. Signed-off-by: Frank Li [maz: dropped pointless dma-iommu.h and of_pci.h includes] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220922161246.20586-4-Frank.Li@nxp.com commit 334b2cea811944df99ae2172bcc0effcdfdbe862 Author: Linus Torvalds Date: Wed Sep 28 09:30:31 2022 +0200 x86/mm: Add prot_sethuge() helper to abstract out _PAGE_PSE handling We still have some historic cases of direct fiddling of page attributes with (dangerous & fragile) type casting and address shifting. Add the prot_sethuge() helper instead that gets the types right and doesn't have to transform addresses. ( Also add a debug check to make sure this doesn't get applied to _PAGE_BIT_PAT/_PAGE_BIT_PAT_LARGE pages. ) Signed-off-by: Linus Torvalds Signed-off-by: Ingo Molnar Reviewed-by: Dave Hansen commit 0f4c5b29e3337c2718b812ae2dade5fc55a8321b Author: Jiapeng Chong Date: Wed Sep 14 18:19:43 2022 +0800 dmaengine: ti: edma: Remove some unused functions These functions are defined in the edma.c file, but not called elsewhere, so delete these unused functions. drivers/dma/ti/edma.c:746:31: warning: unused function 'to_edma_cc'. drivers/dma/ti/edma.c:420:20: warning: unused function 'edma_param_or'. drivers/dma/ti/edma.c:414:20: warning: unused function 'edma_param_and'. drivers/dma/ti/edma.c:402:20: warning: unused function 'edma_param_write'. drivers/dma/ti/edma.c:373:28: warning: unused function 'edma_shadow0_read'. drivers/dma/ti/edma.c:396:28: warning: unused function 'edma_param_read'. drivers/dma/ti/edma.c:355:20: warning: unused function 'edma_or_array'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2152 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220914101943.83929-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Vinod Koul commit 65add05cfd6e44ea45b2b4e6135745564595cf4f Author: Bhupesh Sharma Date: Mon Sep 26 16:52:00 2022 +0530 dt-bindings: dma: Make minor fixes to qcom,bam-dma binding doc As a user recently noted, the qcom,bam-dma binding document describes the msm8974 BAM DMA node in the 'example section' incorrectly. Fix the same by making it consistent with the node present inside 'qcom-msm8974' dts file, namely the 'reg' and 'interrupt' values which are incorrect in the 'example section'. While at it also make two additioanal minor cleanups: - mention Bjorn's new email ID in the document, and - add SDM845 in the comment line for the SoCs on which qcom,bam-v1.7.0 version is supported. Signed-off-by: Bhupesh Sharma Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220926112200.1948080-1-bhupesh.sharma@linaro.org Signed-off-by: Vinod Koul commit 19ea810e88e08f87d07aafcf82f45084c360ed03 Author: Deming Wang Date: Mon Sep 19 22:07:21 2022 -0400 Documentation: devicetree: dma: update the comments remove the double word to. Signed-off-by: Deming Wang Acked-by: Rob Herring Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220920020721.2190-1-wangdeming@inspur.com Signed-off-by: Vinod Koul commit 45ecf27f300765d135f98d444957675ff6bb9837 Author: Gustavo A. R. Silva Date: Mon Sep 26 16:46:24 2022 -0500 dmaengine: sh: rcar-dmac: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/217 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/YzIdsJqsR3LH2qEK@work Signed-off-by: Vinod Koul commit 9aa0dade8f6b4cdcbb114e1a06037939ee3238bc Author: Colin Ian King Date: Thu Sep 29 14:01:47 2022 +0100 phy: phy-mtk-dp: make array driving_params static const Don't populate the read-only array driving_params on the stack but instead make it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220929130147.97375-1-colin.i.king@gmail.com Signed-off-by: Vinod Koul commit 28366dd2ecb2c47cfd706a0743dd78f287f1abd7 Author: Yang Yingliang Date: Wed Sep 28 22:52:56 2022 +0800 spi: spi-gxp: Use devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220928145256.1879256-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit b73f11e895e140537e7f8c7251211ccd3ce0782b Author: Zhang Qilong Date: Thu Sep 29 00:01:16 2022 +0800 ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of mt6660_i2c_probe. Fixes:f289e55c6eeb4 ("ASoC: Add MediaTek MT6660 Speaker Amp Driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-5-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit fcbb60820cd3008bb44334a0395e5e57ccb77329 Author: Zhang Qilong Date: Thu Sep 29 00:01:15 2022 +0800 ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of wm5102_probe. Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7 Author: Zhang Qilong Date: Thu Sep 29 00:01:14 2022 +0800 ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of wm5110_probe. Fixes:5c6af635fd772 ("ASoC: wm5110: Add audio CODEC driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 41a736ac20602f64773e80f0f5b32cde1830a44a Author: Zhang Qilong Date: Thu Sep 29 00:01:13 2022 +0800 ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of wm8997_probe Fixes:40843aea5a9bd ("ASoC: wm8997: Initial CODEC driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38 Author: Tetsuo Handa Date: Tue Sep 20 22:43:51 2022 +0900 btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer syzbot is reporting uninit-value in btrfs_clean_tree_block() [1], for commit bc877d285ca3dba2 ("btrfs: Deduplicate extent_buffer init code") missed that btrfs_set_header_generation() in btrfs_init_new_buffer() must not be moved to after clean_tree_block() because clean_tree_block() is calling btrfs_header_generation() since commit 55c69072d6bd5be1 ("Btrfs: Fix extent_buffer usage when nodesize != leafsize"). Since memzero_extent_buffer() will reset "struct btrfs_header" part, we can't move btrfs_set_header_generation() to before memzero_extent_buffer(). Just re-add btrfs_set_header_generation() before btrfs_clean_tree_block(). Link: https://syzkaller.appspot.com/bug?extid=fba8e2116a12609b6c59 [1] Reported-by: syzbot Fixes: bc877d285ca3dba2 ("btrfs: Deduplicate extent_buffer init code") CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Tetsuo Handa Signed-off-by: David Sterba commit db21370bffbc966253ba32edb112f4beec1531cc Author: Filipe Manana Date: Mon Sep 19 15:06:40 2022 +0100 btrfs: drop extent map range more efficiently Currently when dropping extent maps for a file range, through btrfs_drop_extent_map_range(), we do the following non-optimal things: 1) We lookup for extent maps one by one, always starting the search from the root of the extent map tree. This is not efficient if we have multiple extent maps in the range; 2) We check on every iteration if we have the 'split' and 'split2' spare extent maps in case we need to split an extent map that intersects our range but also crosses its boundaries (to the left, to the right or both cases). If our target range is for example: [2M, 8M) And we have 3 extents maps in the range: [1M, 3M) [3M, 6M) [6M, 10M[ The on the first iteration we allocate two extent maps for 'split' and 'split2', and use the 'split' to split the first extent map, so after the split we set 'split' to 'split2' and then set 'split2' to NULL. On the second iteration, we don't need to split the second extent map, but because 'split2' is now NULL, we allocate a new extent map for 'split2'. On the third iteration we need to split the third extent map, so we use the extent map pointed by 'split'. So we ended up allocating 3 extent maps for splitting, but all we needed was 2 extent maps. We never need to allocate more than 2, because extent maps that need to be split are always the first one and the last one in the target range. Improve on this by: 1) Using rb_next() to move on to the next extent map. This results in iterating over less nodes of the tree and it does not require comparing the ranges of nodes to our start/end offset; 2) Allocate the 2 extent maps for splitting before entering the loop and never allocate more than 2. In practice it's very rare to have the combination of both extent map allocations fail, since we have a dedicated slab for extent maps, and also have the need to split two extent maps. This patch is part of a patchset comprised of the following patches: btrfs: fix missed extent on fsync after dropping extent maps btrfs: move btrfs_drop_extent_cache() to extent_map.c btrfs: use extent_map_end() at btrfs_drop_extent_map_range() btrfs: use cond_resched_rwlock_write() during inode eviction btrfs: move open coded extent map tree deletion out of inode eviction btrfs: add helper to replace extent map range with a new extent map btrfs: remove the refcount warning/check at free_extent_map() btrfs: remove unnecessary extent map initializations btrfs: assert tree is locked when clearing extent map from logging btrfs: remove unnecessary NULL pointer checks when searching extent maps btrfs: remove unnecessary next extent map search btrfs: avoid pointless extent map tree search when flushing delalloc btrfs: drop extent map range more efficiently And the following fio test was done before and after applying the whole patchset, on a non-debug kernel (Debian's default kernel config) on a 12 cores Intel box with 64G of ram: $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-R free-space-tree -O no-holes" cat < /tmp/fio-job.ini [writers] rw=randwrite fsync=8 fallocate=none group_reporting=1 direct=0 bssplit=4k/20:8k/20:16k/20:32k/10:64k/10:128k/5:256k/5:512k/5:1m/5 ioengine=psync filesize=2G runtime=300 time_based directory=$MNT numjobs=8 thread EOF echo performance | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor echo echo "Using config:" echo cat /tmp/fio-job.ini echo umount $MNT &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT fio /tmp/fio-job.ini umount $MNT Result before applying the patchset: WRITE: bw=197MiB/s (206MB/s), 197MiB/s-197MiB/s (206MB/s-206MB/s), io=57.7GiB (61.9GB), run=300188-300188msec Result after applying the patchset: WRITE: bw=203MiB/s (213MB/s), 203MiB/s-203MiB/s (213MB/s-213MB/s), io=59.5GiB (63.9GB), run=300019-300019msec Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b54bb86556d609622236006b9b0a75c1716154df Author: Filipe Manana Date: Mon Sep 19 15:06:39 2022 +0100 btrfs: avoid pointless extent map tree search when flushing delalloc When flushing delalloc, in COW mode at cow_file_range(), before entering the loop that allocates extents and creates ordered extents, we do a call to btrfs_drop_extent_map_range() for the whole range. This is pointless because in the loop we call create_io_em(), which will also call btrfs_drop_extent_map_range() before inserting the new extent map. So remove that call at cow_file_range() not only because it is not needed, but also because it will make the btrfs_drop_extent_map_range() calls made from create_io_em() waste time searching the extent map tree, and that tree can be large for files with many extents. It also makes us waste time at btrfs_drop_extent_map_range() allocating and freeing the split extent maps for nothing. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6c05813ebb5a634add71f942a21b29eb6ff09695 Author: Filipe Manana Date: Mon Sep 19 15:06:38 2022 +0100 btrfs: remove unnecessary next extent map search At __tree_search(), and its single caller __lookup_extent_mapping(), there is no point in finding the next extent map that starts after the search offset if we were able to find the previous extent map that ends before our search offset, because __lookup_extent_mapping() ignores the next acceptable extent map if we were able to find the previous one. So just return immediately if we were able to find the previous extent map, therefore avoiding wasting time iterating the tree looking for the next extent map which will not be used by __lookup_extent_mapping(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 08f088dd63abebb2cce5510cedd33a36bd0cf490 Author: Filipe Manana Date: Mon Sep 19 15:06:37 2022 +0100 btrfs: remove unnecessary NULL pointer checks when searching extent maps The previous and next pointer arguments passed to __tree_search() are never NULL as the only caller of this function, __lookup_extent_mapping(), always passes the address of two on stack pointers. So remove the NULL checks and add assertions to verify the pointers. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 74333c7d87914ef1c250d3ea9441e88e15039bd8 Author: Filipe Manana Date: Mon Sep 19 15:06:36 2022 +0100 btrfs: assert tree is locked when clearing extent map from logging When calling clear_em_logging() we should have a write lock on the extent map tree, as we will try to merge the extent map with the previous and next ones in the tree. So assert that we have a write lock. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2e0cdaa0288bbe3d6a05937bc7b61aa9da0cb2bf Author: Filipe Manana Date: Mon Sep 19 15:06:35 2022 +0100 btrfs: remove unnecessary extent map initializations When allocating an extent map, we use kmem_cache_zalloc() which guarantees the returned memory is initialized to zeroes, therefore it's pointless to initialize the generation and flags of the extent map to zero again. Remove those initializations, as they are pointless and slightly increase the object text size. Before removing them: $ size fs/btrfs/extent_map.o text data bss dec hex filename 9241 274 24 9539 2543 fs/btrfs/extent_map.o After removing them: $ size fs/btrfs/extent_map.o text data bss dec hex filename 9209 274 24 9507 2523 fs/btrfs/extent_map.o Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit ad5d6e9148b6774625149dc4dece0e54f3e7f7c9 Author: Filipe Manana Date: Mon Sep 19 15:06:34 2022 +0100 btrfs: remove the refcount warning/check at free_extent_map() At free_extent_map(), it's pointless to have a WARN_ON() to check if the refcount of the extent map is zero. Such check is already done by the refcount_t module and refcount_dec_and_test(), which loudly complains if we try to decrement a reference count that is currently 0. The WARN_ON() dates back to the time when used a regular atomic_t type for the reference counter, before we switched to the refcount_t type. The main goal of the refcount_t type/module is precisely to catch such types of bugs and loudly complain if they happen. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit a1ba4c080bef187f5bdbc2191092fbe7341a5794 Author: Filipe Manana Date: Mon Sep 19 15:06:33 2022 +0100 btrfs: add helper to replace extent map range with a new extent map We have several places that need to drop all the extent maps in a given file range and then add a new extent map for that range. Currently they call btrfs_drop_extent_map_range() to delete all extent maps in the range and then keep trying to add the new extent map in a loop that keeps retrying while the insertion of the new extent map fails with -EEXIST. So instead of repeating this logic, add a helper to extent_map.c that does these steps and name it btrfs_replace_extent_map_range(). Also add a comment about why the retry loop is necessary. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 9c9d1b4f74c5e96779e561af9b57c65607bf8a6d Author: Filipe Manana Date: Mon Sep 19 15:06:32 2022 +0100 btrfs: move open coded extent map tree deletion out of inode eviction Move the loop that removes all the extent maps from the inode's extent map tree during inode eviction out of inode.c and into extent_map.c, to btrfs_drop_extent_map_range(). Anything manipulating extent maps or the extent map tree should be in extent_map.c. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 99ba0c815058805a179d0edf8ddd421898798957 Author: Filipe Manana Date: Mon Sep 19 15:06:31 2022 +0100 btrfs: use cond_resched_rwlock_write() during inode eviction At evict_inode_truncate_pages(), instead of manually checking if rescheduling is needed, then unlock the extent map tree, reschedule and then write lock again the tree, use the helper cond_resched_rwlock_write() which does all that. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f3109e33bb0a523f70a3394b51c878dbedb60528 Author: Filipe Manana Date: Mon Sep 19 15:06:30 2022 +0100 btrfs: use extent_map_end() at btrfs_drop_extent_map_range() Instead of open coding the end offset calculation of an extent map, use the helper extent_map_end() and cache its result in a local variable, since it's used several times. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4c0c8cfc8433457ed545e67df0d689d2e0de0746 Author: Filipe Manana Date: Mon Sep 19 15:06:29 2022 +0100 btrfs: move btrfs_drop_extent_cache() to extent_map.c The function btrfs_drop_extent_cache() doesn't really belong at file.c because what it does is drop a range of extent maps for a file range. It directly allocates and manipulates extent maps, by dropping, splitting and replacing them in an extent map tree, so it should be located at extent_map.c, where all manipulations of an extent map tree and its extent maps are supposed to be done. So move it out of file.c and into extent_map.c. Additionally do the following changes: 1) Rename it into btrfs_drop_extent_map_range(), as this makes it more clear about what it does. The term "cache" is a bit confusing as it's not widely used, "extent maps" or "extent mapping" is much more common; 2) Change its 'skip_pinned' argument from int to bool; 3) Turn several of its local variables from int to bool, since they are used as booleans; 4) Move the declaration of some variables out of the function's main scope and into the scopes where they are used; 5) Remove pointless assignment of false to 'modified' early in the while loop, as later that variable is set and it's not used before that second assignment; 6) Remove checks for NULL before calling free_extent_map(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit cef7820d6abf8d61f8e1db411eae3c712f6d72a2 Author: Filipe Manana Date: Mon Sep 19 15:06:28 2022 +0100 btrfs: fix missed extent on fsync after dropping extent maps When dropping extent maps for a range, through btrfs_drop_extent_cache(), if we find an extent map that starts before our target range and/or ends before the target range, and we are not able to allocate extent maps for splitting that extent map, then we don't fail and simply remove the entire extent map from the inode's extent map tree. This is generally fine, because in case anyone needs to access the extent map, it can just load it again later from the respective file extent item(s) in the subvolume btree. However, if that extent map is new and is in the list of modified extents, then a fast fsync will miss the parts of the extent that were outside our range (that needed to be split), therefore not logging them. Fix that by marking the inode for a full fsync. This issue was introduced after removing BUG_ON()s triggered when the split extent map allocations failed, done by commit 7014cdb49305ed ("Btrfs: btrfs_drop_extent_cache should never fail"), back in 2012, and the fast fsync path already existed but was very recent. Also, in the case where we could allocate extent maps for the split operations but then fail to add a split extent map to the tree, mark the inode for a full fsync as well. This is not supposed to ever fail, and we assert that, but in case assertions are disabled (CONFIG_BTRFS_ASSERT is not set), it's the correct thing to do to make sure a fast fsync will not miss a new extent. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 3050dfa63e1f39b095fbfd0de7a3fa9778d7dcc2 Author: Jeff Layton Date: Thu Sep 22 09:08:48 2022 -0400 btrfs: remove stale prototype of btrfs_write_inode This function no longer exists, was removed in 3c4276936f6f ("Btrfs: fix btrfs_write_inode vs delayed iput deadlock"). Signed-off-by: Jeff Layton Reviewed-by: David Sterba Signed-off-by: David Sterba commit 926078b21db91b72b444277fdc2166914cf113fc Author: Stefan Roesch Date: Mon Sep 12 12:27:52 2022 -0700 btrfs: enable nowait async buffered writes Enable nowait async buffered writes in btrfs_do_write_iter() and btrfs_file_open(). In this version encoded buffered writes have the optimization not enabled. Encoded writes are enabled by using an ioctl. io_uring currently does not support ioctls. This might be enabled in the future. Performance results: For fio the following results have been obtained with a queue depth of 1 and 4k block size (runtime 600 secs): sequential writes: without patch with patch libaio psync iops: 55k 134k 117K 148K bw: 221MB/s 538MB/s 469MB/s 592MB/s clat: 15286ns 82ns 994ns 6340ns For an io depth of 1, the new patch improves throughput by over two times (compared to the existing behavior, where buffered writes are processed by an io-worker process) and also the latency is considerably reduced. To achieve the same or better performance with the existing code an io depth of 4 is required. Increasing the iodepth further does not lead to improvements. The tests have been run like this: ./fio --name=seq-writers --ioengine=psync --iodepth=1 --rw=write \ --bs=4k --direct=0 --size=100000m --time_based --runtime=600 \ --numjobs=1 --filename=... ./fio --name=seq-writers --ioengine=io_uring --iodepth=1 --rw=write \ --bs=4k --direct=0 --size=100000m --time_based --runtime=600 \ --numjobs=1 --filename=... ./fio --name=seq-writers --ioengine=libaio --iodepth=1 --rw=write \ --bs=4k --direct=0 --size=100000m --time_based --runtime=600 \ --numjobs=1 --filename=... Testing: This patch has been tested with xfstests, fsx, fio. xfstests shows no new diffs compared to running without the patch series. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit c922b016f353eafb69997d8c0f06efdf945315ce Author: Stefan Roesch Date: Mon Sep 12 12:27:51 2022 -0700 btrfs: assert nowait mode is not used for some btree search functions Adds nowait asserts to btree search functions which are not used by buffered IO and direct IO paths. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit 965f47aeb5deddc59a1ace28e99b2a578df57305 Author: Stefan Roesch Date: Mon Sep 12 12:27:50 2022 -0700 btrfs: make btrfs_buffered_write nowait compatible We need to avoid unconditionally calling balance_dirty_pages_ratelimited as it could wait for some reason. Use balance_dirty_pages_ratelimited_flags with the BDP_ASYNC in case the buffered write is nowait, returning EAGAIN eventually. It also moves the function after the again label. This can cause the function to be called a bit later, but this should have no impact in the real world. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit 304e45acdb8f68a974e8a64a6296803530bb851f Author: Stefan Roesch Date: Mon Sep 12 12:27:49 2022 -0700 btrfs: plumb NOWAIT through the write path We have everywhere setup for nowait, plumb NOWAIT through the write path. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Signed-off-by: David Sterba commit 2fcab928ccc2bac0c22e3b3b04f5acf0dc8de96b Author: Stefan Roesch Date: Mon Sep 12 12:27:48 2022 -0700 btrfs: make lock_and_cleanup_extent_if_need nowait compatible Add the nowait parameter to lock_and_cleanup_extent_if_need(). If the nowait parameter is specified we try to lock the extent in nowait mode. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc2260001232766c1836d5a6053913194ce23f88 Author: Stefan Roesch Date: Mon Sep 12 12:27:47 2022 -0700 btrfs: make prepare_pages nowait compatible Add nowait parameter to the prepare_pages function. In case nowait is specified for an async buffered write request, do a nowait allocation or return -EAGAIN. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit 80f9d24130e45b01984a918d6b2006c10687b138 Author: Josef Bacik Date: Mon Sep 12 12:27:46 2022 -0700 btrfs: make btrfs_check_nocow_lock nowait compatible Now all the helpers that btrfs_check_nocow_lock uses handle nowait, add a nowait flag to btrfs_check_nocow_lock so it can be used by the write path. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Signed-off-by: David Sterba commit d2c7a19f5c82ace6ea0ec00ae53c6dd97ee8e274 Author: Josef Bacik Date: Mon Sep 12 12:27:45 2022 -0700 btrfs: add btrfs_try_lock_ordered_range For IOCB_NOWAIT we're going to want to use try lock on the extent lock, and simply bail if there's an ordered extent in the range because the only choice there is to wait for the ordered extent to complete. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1daedb1d6bf24c7185e00cd341404f262f8de7c8 Author: Josef Bacik Date: Mon Sep 12 12:27:44 2022 -0700 btrfs: add the ability to use NO_FLUSH for data reservations In order to accommodate NOWAIT IOCB's we need to be able to do NO_FLUSH data reservations, so plumb this through the delalloc reservation system. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Signed-off-by: David Sterba commit 26ce91144631a402ff82c93358d8880326a7caa3 Author: Josef Bacik Date: Mon Sep 12 12:27:43 2022 -0700 btrfs: make can_nocow_extent nowait compatible If we have NOWAIT specified on our IOCB and we're writing into a PREALLOC or NOCOW extent then we need to be able to tell can_nocow_extent that we don't want to wait on any locks or metadata IO. Fix can_nocow_extent to allow for NOWAIT. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit 110fdb4486d3a5e67d55bc6866d6426e6d49ccfc Author: Pankaj Raghav Date: Thu Sep 29 16:41:41 2022 +0200 block: add rationale for not using blk_mq_plug() when applicable There are two places in the block layer at the moment where blk_mq_plug() helper could be used instead of directly accessing the plug from struct current. In both these cases, directly accessing the plug should not have any consequences for zoned devices. Make the intent explicit by adding comments instead of introducing unwanted checks with blk_mq_plug() helper.[1] [1] https://lore.kernel.org/linux-block/f6e54907-1035-2b2c-6387-ed178be05ccb@kernel.dk/ Signed-off-by: Pankaj Raghav Suggested-by: Jens Axboe Link: https://lore.kernel.org/r/20220929144141.140077-1-p.raghav@samsung.com [axboe: fixup multi-line comment style] Signed-off-by: Jens Axboe commit a0fcaaed0c46cf9399d3a2d6e0c87ddb3df0e044 Author: Steven Rostedt (Google) Date: Thu Sep 29 10:49:09 2022 -0400 ring-buffer: Fix race between reset page and reading page The ring buffer is broken up into sub buffers (currently of page size). Each sub buffer has a pointer to its "tail" (the last event written to the sub buffer). When a new event is requested, the tail is locally incremented to cover the size of the new event. This is done in a way that there is no need for locking. If the tail goes past the end of the sub buffer, the process of moving to the next sub buffer takes place. After setting the current sub buffer to the next one, the previous one that had the tail go passed the end of the sub buffer needs to be reset back to the original tail location (before the new event was requested) and the rest of the sub buffer needs to be "padded". The race happens when a reader takes control of the sub buffer. As readers do a "swap" of sub buffers from the ring buffer to get exclusive access to the sub buffer, it replaces the "head" sub buffer with an empty sub buffer that goes back into the writable portion of the ring buffer. This swap can happen as soon as the writer moves to the next sub buffer and before it updates the last sub buffer with padding. Because the sub buffer can be released to the reader while the writer is still updating the padding, it is possible for the reader to see the event that goes past the end of the sub buffer. This can cause obvious issues. To fix this, add a few memory barriers so that the reader definitely sees the updates to the sub buffer, and also waits until the writer has put back the "tail" of the sub buffer back to the last event that was written on it. To be paranoid, it will only spin for 1 second, otherwise it will warn and shutdown the ring buffer code. 1 second should be enough as the writer does have preemption disabled. If the writer doesn't move within 1 second (with preemption disabled) something is horribly wrong. No interrupt should last 1 second! Link: https://lore.kernel.org/all/20220830120854.7545-1-jiazi.li@transsion.com/ Link: https://bugzilla.kernel.org/show_bug.cgi?id=216369 Link: https://lkml.kernel.org/r/20220929104909.0650a36c@gandalf.local.home Cc: Ingo Molnar Cc: Andrew Morton Cc: stable@vger.kernel.org Fixes: c7b0930857e22 ("ring-buffer: prevent adding write in discarded area") Reported-by: Jiazi.Li Signed-off-by: Steven Rostedt (Google) commit f9c1f248607d5546075d3f731e7607d5571f2b60 Author: Baokun Li Date: Fri Aug 5 20:39:47 2022 +0800 ext4: fix null-ptr-deref in ext4_write_info I caught a null-ptr-deref bug as follows: ================================================================== KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] CPU: 1 PID: 1589 Comm: umount Not tainted 5.10.0-02219-dirty #339 RIP: 0010:ext4_write_info+0x53/0x1b0 [...] Call Trace: dquot_writeback_dquots+0x341/0x9a0 ext4_sync_fs+0x19e/0x800 __sync_filesystem+0x83/0x100 sync_filesystem+0x89/0xf0 generic_shutdown_super+0x79/0x3e0 kill_block_super+0xa1/0x110 deactivate_locked_super+0xac/0x130 deactivate_super+0xb6/0xd0 cleanup_mnt+0x289/0x400 __cleanup_mnt+0x16/0x20 task_work_run+0x11c/0x1c0 exit_to_user_mode_prepare+0x203/0x210 syscall_exit_to_user_mode+0x5b/0x3a0 do_syscall_64+0x59/0x70 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ================================================================== Above issue may happen as follows: ------------------------------------- exit_to_user_mode_prepare task_work_run __cleanup_mnt cleanup_mnt deactivate_super deactivate_locked_super kill_block_super generic_shutdown_super shrink_dcache_for_umount dentry = sb->s_root sb->s_root = NULL <--- Here set NULL sync_filesystem __sync_filesystem sb->s_op->sync_fs > ext4_sync_fs dquot_writeback_dquots sb->dq_op->write_info > ext4_write_info ext4_journal_start(d_inode(sb->s_root), EXT4_HT_QUOTA, 2) d_inode(sb->s_root) s_root->d_inode <--- Null pointer dereference To solve this problem, we use ext4_journal_start_sb directly to avoid s_root being used. Cc: stable@kernel.org Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220805123947.565152-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 426d15ad11419066f7042ffa8fbf1b5c21a1ecbe Author: Josh Triplett Date: Sun Jul 31 20:24:53 2022 -0700 ext4: don't run ext4lazyinit for read-only filesystems On a read-only filesystem, we won't invoke the block allocator, so we don't need to prefetch the block bitmaps. This avoids starting and running the ext4lazyinit thread at all on a system with no read-write ext4 filesystems (for instance, a container VM with read-only filesystems underneath an overlayfs). Fixes: 21175ca434c5 ("ext4: make prefetch_block_bitmaps default") Signed-off-by: Josh Triplett Reviewed-by: Lukas Czerner Link: https://lore.kernel.org/r/48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o commit 2d544ec923dbe5fbed64a7f43dccf527218380bc Author: Yang Xu Date: Thu Jul 28 11:02:49 2022 +0800 ext4: remove deprecated noacl/nouser_xattr options These two options should have been removed since 3.5, but none notices it. Recently, I and Darrick found this. Also, have some discussion for this[1][2][3]. So now, let's remove them. Link: https://lore.kernel.org/linux-ext4/6258F7BB.8010104@fujitsu.com/T/#u[1] Link: https://lore.kernel.org/linux-ext4/20220602110421.ymoug3rwfspmryqg@fedora/T/#t[2] Link: https://lore.kernel.org/linux-ext4/08e2ca4c8f6344bdcd76d75b821116c6147fd57a.camel@kernel.org/T/#t[3] Signed-off-by: Yang Xu Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/1658977369-2478-1-git-send-email-xuyang2018.jy@fujitsu.com Signed-off-by: Theodore Ts'o commit 4bb26f2885ac6930984ee451b952c5a6042f2c0e Author: Jan Kara Date: Wed Jul 27 17:57:53 2022 +0200 ext4: avoid crash when inline data creation follows DIO write When inode is created and written to using direct IO, there is nothing to clear the EXT4_STATE_MAY_INLINE_DATA flag. Thus when inode gets truncated later to say 1 byte and written using normal write, we will try to store the data as inline data. This confuses the code later because the inode now has both normal block and inline data allocated and the confusion manifests for example as: kernel BUG at fs/ext4/inode.c:2721! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 359 Comm: repro Not tainted 5.19.0-rc8-00001-g31ba1e3b8305-dirty #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 RIP: 0010:ext4_writepages+0x363d/0x3660 RSP: 0018:ffffc90000ccf260 EFLAGS: 00010293 RAX: ffffffff81e1abcd RBX: 0000008000000000 RCX: ffff88810842a180 RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000 RBP: ffffc90000ccf650 R08: ffffffff81e17d58 R09: ffffed10222c680b R10: dfffe910222c680c R11: 1ffff110222c680a R12: ffff888111634128 R13: ffffc90000ccf880 R14: 0000008410000000 R15: 0000000000000001 FS: 00007f72635d2640(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000565243379180 CR3: 000000010aa74000 CR4: 0000000000150eb0 Call Trace: do_writepages+0x397/0x640 filemap_fdatawrite_wbc+0x151/0x1b0 file_write_and_wait_range+0x1c9/0x2b0 ext4_sync_file+0x19e/0xa00 vfs_fsync_range+0x17b/0x190 ext4_buffered_write_iter+0x488/0x530 ext4_file_write_iter+0x449/0x1b90 vfs_write+0xbcd/0xf40 ksys_write+0x198/0x2c0 __x64_sys_write+0x7b/0x90 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fix the problem by clearing EXT4_STATE_MAY_INLINE_DATA when we are doing direct IO write to a file. Cc: stable@kernel.org Reported-by: Tadeusz Struk Reported-by: syzbot+bd13648a53ed6933ca49@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=a1e89d09bbbcbd5c4cb45db230ee28c822953984 Signed-off-by: Jan Kara Reviewed-by: Lukas Czerner Tested-by: Tadeusz Struk Link: https://lore.kernel.org/r/20220727155753.13969-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 392cc0a4a0c4b25534f3148b192f18be468f67bd Author: Jerome Neanne Date: Thu Sep 29 15:25:26 2022 +0200 dt-bindings: gpio-regulator: add vin-supply property support This is same scheme as fixed-regulator. Without that property used, the parent regulator can be shut down (if not an always on). Thus leading to inappropriate behavior: On am62-SP-SK this fix is required to avoid tps65219 ldo1 (SDMMC rail) to be shut down after boot completion. Signed-off-by: Jerome Neanne Link: https://lore.kernel.org/r/20220929132526.29427-3-jneanne@baylibre.com Signed-off-by: Mark Brown commit adfdfcbdbd32b356323a3db6d3a683270051a7e6 Author: Jerome Neanne Date: Thu Sep 29 15:25:25 2022 +0200 regulator: gpio: Add input_supply support in gpio_regulator_config This is simillar as fixed-regulator. Used to extract regulator parent from the device tree. Without that property used, the parent regulator can be shut down (if not an always on). Thus leading to inappropriate behavior: On am62-SP-SK this fix is required to avoid tps65219 ldo1 (SDMMC rail) to be shut down after boot completion. Signed-off-by: Jerome Neanne Link: https://lore.kernel.org/r/20220929132526.29427-2-jneanne@baylibre.com Signed-off-by: Mark Brown commit e18f6bcf8e864ea0e9690691d0d749c662b6a2c7 Author: Krzysztof Kozlowski Date: Thu Sep 29 15:15:28 2022 +0200 ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()" This reverts commit ddea4bbf287b6028eaa15a185d0693856956ecf2 ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"), because it introduced double runtime PM put if pm_runtime_get_sync() returns -EACCES: wcd934x-codec wcd934x-codec.3.auto: WCD934X Minor:0x1 Version:0x401 wcd934x-codec wcd934x-codec.3.auto: Runtime PM usage count underflow! The commit claimed no changes in functionality except dropping the reference on -EACCESS. This is exactly the change introducing bug because function calls unconditionally pm_runtime_put_autosuspend() at the end. Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220929131528.217502-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 933678b6183bbe7afa332e70132065db3305ee44 Author: Beau Belgrave Date: Thu Jul 28 16:33:09 2022 -0700 tracing/user_events: Update ABI documentation to align to bits vs bytes Update the documentation to reflect the new ABI requirements and how to use the byte index with the mask properly to check event status. Link: https://lkml.kernel.org/r/20220728233309.1896-7-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 39d6d08b2edf99c4b39a689a70bf0adee065b357 Author: Beau Belgrave Date: Thu Jul 28 16:33:08 2022 -0700 tracing/user_events: Use bits vs bytes for enabled status page data User processes may require many events and when they do the cache performance of a byte index status check is less ideal than a bit index. The previous event limit per-page was 4096, the new limit is 32,768. This change adds a bitwise index to the user_reg struct. Programs check that the bit at status_bit has a bit set within the status page(s). Link: https://lkml.kernel.org/r/20220728233309.1896-6-beaub@linux.microsoft.com Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Suggested-by: Mathieu Desnoyers Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit d401b72458562c2f2a81dad162de5c1b8e191e17 Author: Beau Belgrave Date: Thu Jul 28 16:33:07 2022 -0700 tracing/user_events: Use refcount instead of atomic for ref tracking User processes could open up enough event references to cause rollovers. These could cause use after free scenarios, which we do not want. Switching to refcount APIs prevent this, but will leak memory once saturated. Once saturated, user processes can still use the events. This prevents a bad user process from stopping existing telemetry from being emitted. Link: https://lkml.kernel.org/r/20220728233309.1896-5-beaub@linux.microsoft.com Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Reported-by: Mathieu Desnoyers Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit e6f89a149872ab0e03cfded97983df74dfb0ef21 Author: Beau Belgrave Date: Thu Jul 28 16:33:06 2022 -0700 tracing/user_events: Ensure user provided strings are safely formatted User processes can provide bad strings that may cause issues or leak kernel details back out. Don't trust the content of these strings when formatting strings for matching. This also moves to a consistent dynamic length string creation model. Link: https://lkml.kernel.org/r/20220728233309.1896-4-beaub@linux.microsoft.com Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Reported-by: Mathieu Desnoyers Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 95f187603dbff69bef19b2ab3bb54d2c060f556d Author: Beau Belgrave Date: Thu Jul 28 16:33:05 2022 -0700 tracing/user_events: Use WRITE instead of READ for io vector import import_single_range expects the direction/rw to be where it came from, not the protection/limit. Since the import is in a write path use WRITE. Link: https://lkml.kernel.org/r/20220728233309.1896-3-beaub@linux.microsoft.com Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Reported-by: Mathieu Desnoyers Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 9cbf12343d595a1a5ecc84c4471b1fe52e2be19b Author: Beau Belgrave Date: Thu Jul 28 16:33:04 2022 -0700 tracing/user_events: Use NULL for strstr checks Trivial fix to ensure strstr checks use NULL instead of 0. Link: https://lkml.kernel.org/r/20220728233309.1896-2-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit e841e8bfac490957fed3157326b96342dc76798a Author: Colin Ian King Date: Wed Sep 28 22:58:28 2022 +0100 tracing: Fix spelling mistake "preapre" -> "prepare" There is a spelling mistake in the trace text. Fix it. Link: https://lkml.kernel.org/r/20220928215828.66325-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Steven Rostedt (Google) commit 2b0fd9a59b7990c161fa1cb7b79edb22847c87c2 Author: Steven Rostedt (Google) Date: Wed Sep 28 18:22:20 2022 -0400 tracing: Wake up waiters when tracing is disabled When tracing is disabled, there's no reason that waiters should stay waiting, wake them up, otherwise tasks get stuck when they should be flushing the buffers. Cc: stable@vger.kernel.org Fixes: e30f53aad2202 ("tracing: Do not busy wait in buffer splice") Signed-off-by: Steven Rostedt (Google) commit 01b2a52171735c6eea80ee2f355f32bea6c41418 Author: Steven Rostedt (Google) Date: Thu Sep 29 09:50:29 2022 -0400 tracing: Add ioctl() to force ring buffer waiters to wake up If a process is waiting on the ring buffer for data, there currently isn't a clean way to force it to wake up. Add an ioctl call that will force any tasks that are waiting on the trace_pipe_raw file to wake up. Link: https://lkml.kernel.org/r/20220929095029.117f913f@gandalf.local.home Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Fixes: e30f53aad2202 ("tracing: Do not busy wait in buffer splice") Signed-off-by: Steven Rostedt (Google) commit b55002b9b575770fc0619dee8f6203697054c861 Author: Christoph Niedermaier Date: Fri Aug 12 13:48:32 2022 +0200 drm/panel: simple: Add Multi-Inno Technology MI0800FT-9 Add Multi-Inno Technology MI0800FT-9 8" 800x600 DPI panel support. Signed-off-by: Christoph Niedermaier Cc: Sam Ravnborg To: dri-devel@lists.freedesktop.org Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220812114832.4946-1-cniedermaier@dh-electronics.com commit dec015f135e8df446d3a8f2bf732cdba6a40cbe2 Author: Christoph Niedermaier Date: Fri Aug 12 13:46:00 2022 +0200 dt-bindings: display: simple: Add Multi-Inno Technology MI0800FT-9 panel Add Multi-Inno Technology MI0800FT-9 8" 800x600 DPI panel compatible string. Signed-off-by: Christoph Niedermaier Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Acked-by: Rob Herring Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220812114600.4895-1-cniedermaier@dh-electronics.com commit 872f3a4e90ef2a0245f9143558d9f45bfc352194 Author: Geert Uytterhoeven Date: Wed Sep 28 14:33:36 2022 +0200 dt-bindings: irqchip: renesas,irqc: Add r8a779g0 support Document support for the Interrupt Controller for External Devices (INT-EX) in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/4fdb6ff47f62814aab3b06efd1d4c2d7de83b109.1664368373.git.geert+renesas@glider.be commit 8cafdb5ab94cda3ebb0975be16e2d564a05132ea Author: Pankaj Raghav Date: Thu Sep 29 09:47:44 2022 +0200 block: adapt blk_mq_plug() to not plug for writes that require a zone lock The current implementation of blk_mq_plug() disables plugging for all operations that involves a transfer to the device as we just check if the last bit in op_is_write() function. Modify blk_mq_plug() to disable plugging only for REQ_OP_WRITE and REQ_OP_WRITE_ZEROS as they might require a zone lock. Suggested-by: Christoph Hellwig Suggested-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Pankaj Raghav Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220929074745.103073-2-p.raghav@samsung.com Signed-off-by: Jens Axboe commit a79852a39332614d30a0f81785803ba72877a575 Author: Le Ma Date: Tue Sep 6 15:07:53 2022 +0800 drm/amdgpu: correct the memcpy size for ip discovery firmware Use fw->size instead of discovery_tmr_size for fallback path. Signed-off-by: Le Ma Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f61a825aa86115dbdcaba25bba78e007b5e8e1b1 Author: Vignesh Chander Date: Wed Sep 28 14:59:45 2022 -0400 drm/amdgpu: Skip put_reset_domain if it doesn't exist For xgmi sriov, the reset is handled by host driver and hive->reset_domain is not initialized so need to check if it exists before doing a put. Signed-off-by: Vignesh Chander Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit e67135571e4073e1ee252f839d7a1ccf10f89410 Author: Graham Sider Date: Thu Apr 7 11:12:01 2022 -0400 drm/amdgpu: remove switch from amdgpu_gmc_noretry_set Simplify the logic in amdgpu_gmc_noretry_set by getting rid of the switch. Also set noretry=1 as default for GFX 10.3.0 and greater since retry faults are not supported. Signed-off-by: Graham Sider Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3ff4ccc3e938159c47c4dc3ed8e2b964c3604b50 Author: Leo Li Date: Wed Sep 28 10:42:21 2022 -0400 drm/amdgpu: Fix mc_umc_status used uninitialized warning On ChromeOS clang build, the following warning is seen: /mnt/host/source/src/third_party/kernel/v5.15/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:463:6: error: variable 'mc_umc_status' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (mca_addr == UMC_INVALID_ADDR) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /mnt/host/source/src/third_party/kernel/v5.15/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:485:21: note: uninitialized use occurs here if ((REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1 && ^~~~~~~~~~~~~ /mnt/host/source/src/third_party/kernel/v5.15/drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:1208:5: note: expanded from macro 'REG_GET_FIELD' (((value) & REG_FIELD_MASK(reg, field)) >> REG_FIELD_SHIFT(reg, field)) ^~~~~ /mnt/host/source/src/third_party/kernel/v5.15/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:463:2: note: remove the 'if' if its condition is always true if (mca_addr == UMC_INVALID_ADDR) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /mnt/host/source/src/third_party/kernel/v5.15/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:460:24: note: initialize the variable 'mc_umc_status' to silence this warning uint64_t mc_umc_status, mc_umc_addrt0; ^ = 0 1 error generated. make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.15/scripts/Makefile.build:289: drivers/gpu/drm/amd/amdgpu/umc_v6_7.o] Error 1 Fix by initializing mc_umc_status = 0. Fixes: 1014bd1cb32552 ("drm/amdgpu: support to convert dedicated umc mca address") Reviewed-by: Hamza Mahfooz Signed-off-by: Leo Li Signed-off-by: Alex Deucher commit ab5c467087c1e9868a7392306c3578d903a37b7f Author: Leo Li Date: Mon Sep 26 17:53:55 2022 -0400 drm/amd/display: Prevent OTG shutdown during PSR SU [Why] Enabling Z10 optimizations allows DMUB to disable the OTG during PSR link-off. This theoretically saves power by putting more of the display hardware to sleep. However, we observe that with PSR SU, it causes visual artifacts, higher power usage, and potential system hang. This is partly due to an odd behavior with the VStartup interrupt used to signal DRM vblank events. If the OTG is toggled on/off during a PSR link on/off cycle, the vstartup interrupt fires twice in quick succession. This generates incorrectly timed vblank events. Additionally, it can cause cursor updates to generate visual artifacts. Note that this is not observed with PSR1 since PSR is fully disabled when there are vblank event requestors. Cursor updates are also artifact-free, likely because there are no selectively-updated (SU) frames that can generate artifacts. [How] A potential solution is to disable z10 idle optimizations only when fast updates (flips & cursor updates) are committed. A mechanism to do so would require some thoughtful design. Let's just disable idle optimizations for PSR2 for now. Fixes: 7cc191ee7621 ("drm/amd/display: Implement MPO PSR SU") Reported-by: August Wikerfors Link: https://lore.kernel.org/r/c1f8886a-5624-8f49-31b1-e42b6d20dcf5@augustwikerfors.se/ Tested-by: August Wikerfors Reviewed-by: Harry Wentland Signed-off-by: Leo Li Signed-off-by: Alex Deucher commit 5e1fdf76cf9b1b764d6061d78c29901d774fc061 Author: Tao Zhou Date: Wed Sep 21 17:03:00 2022 +0800 drm/amdgpu: add page retirement handling for CPU RAS Do RAS page retirement in poison consumption handler unconditionally. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cd4c99f103af5a85fcae5d31a9e85361679ab979 Author: Tao Zhou Date: Wed Sep 21 16:46:19 2022 +0800 drm/amdgpu: use RAS error address convert api in mca notifier Use the convert interface to simplify code. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1014bd1cb32552b732fd0f6ff4e68f32188d59e7 Author: Tao Zhou Date: Wed Sep 21 16:43:47 2022 +0800 drm/amdgpu: support to convert dedicated umc mca address Update umc error address query interface, the mca address can be read from register or input from parameter. TODO: define a common address conversion function to simplify the code. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c19a5f325a7fb5b353976d66d6a92b35c0322138 Author: Tao Zhou Date: Wed Sep 21 16:25:33 2022 +0800 drm/amdgpu: export umc error address convert interface Make it global so we can convert specific mca address. v2: rename query_error_address_per_channel to convert_ras_error_address Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit baf28cc10ade932cec707e3fd723e6c2850efe3a Author: Likun Gao Date: Wed Sep 28 15:48:07 2022 +0800 drm/amdgpu: fix sdma v4 init microcode error Fix init SDMA microcode error for sdma v4, which caused by mistake when rearch sdma init microcode function (coding 4.2.2 to 4.2.0). Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5d8c3e836fc224dfe633e41f7f2856753b39a905 Author: Hamza Mahfooz Date: Tue Sep 27 15:01:46 2022 -0400 drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() Address the following error: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: error: array subscript [0, 0] is outside array bounds of ‘struct dc_writeback_info[1]’ [-Werror=array-bounds] 527 | stream->writeback_info[j] = stream->writeback_info[i]; | ~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:1269, from ./drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:29, from ./drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc_common.h:29, from drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:27: ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc_stream.h:241:34: note: while referencing ‘writeback_info’ 241 | struct dc_writeback_info writeback_info[MAX_DWB_PIPES]; | Currently, we aren't checking to see if j remains within writeback_info[]'s bounds. So, add a check to make sure that we aren't overflowing the buffer. Reviewed-by: Aurabindo Pillai Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit d7274ec723cd0c2359ef75f84deca462a60c5025 Author: Bokun Zhang Date: Wed Sep 28 00:30:04 2022 +0800 drm/amdgpu: Add amdgpu suspend-resume code path under SRIOV - Under SRIOV, we need to send REQ_GPU_FINI to the hypervisor during the suspend time. Furthermore, we cannot request a mode 1 reset under SRIOV as VF. Therefore, we will skip it as it is called in suspend_noirq() function. - In the resume code path, we need to send REQ_GPU_INIT to the hypervisor and also resume PSP IP block under SRIOV. Signed-off-by: Bokun Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2d89e2ddfd00ca569dd73883c7c70badbd57f4ac Author: Likun Gao Date: Tue Sep 27 17:15:20 2022 +0800 drm/amdgpu: fix compiler warning for amdgpu_gfx_cp_init_microcode Change the type of parameter on amdgpu_gfx_cp_init_microcode to fix compiler warning. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9e447c811ab31cd69d8fff18283fb695e1ff59a5 Author: Asher Song Date: Tue Sep 27 15:22:53 2022 +0800 drm/amdgpu: fix a compiling error in old kernels This patch is used to fix following compiling error that occurs in some old kernels. error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < dc->res_pool->res_cap->num_dsc; i++) { Signed-off-by: Asher Song Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 940d4dd402e97941aa0a92436cc3d4c2d7c13157 Author: Hawking Zhang Date: Tue Sep 27 10:18:15 2022 +0800 drm/amdgpu: add rlc_sr_cntl_list to firmware array To allow upload the list via psp Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit e7b8e90addf1e9f5175a0b8b4587e9dd5f139b62 Author: Jiadong.Zhu Date: Fri Sep 23 21:17:53 2022 +0800 drm/amdgpu: Remove fence_process in count_emitted The function amdgpu_fence_count_emitted used in work_hander should not call amdgpu_fence_process which must be used in irq handler. Reviewed-by: Christian König Signed-off-by: Jiadong.Zhu Signed-off-by: Alex Deucher commit 415be17fb2f4a70afc827332c936955b801085ad Author: Jiadong.Zhu Date: Thu Sep 15 15:19:20 2022 +0800 drm/amdgpu: Correct the position in patch_cond_exec The current position calulated in gfx_v9_0_ring_emit_patch_cond_exec underflows when the wptr is divisible by ring->buf_mask + 1. Reviewed-by: Christian König Signed-off-by: Jiadong.Zhu Signed-off-by: Alex Deucher commit e844cc250f33d207077d0af9337484d6c94048f0 Author: Michael Strauss Date: Mon Jul 25 16:24:42 2022 -0400 drm/amd/display: Refactor LTTPR mode selection [WHY] Previously, LTTPR mode was decided during detection which makes link training inflexible as mode can't be dynamically changed. [HOW] -Remove lttpr_mode from link struct, and move to link training settings -Defer choosing LTTPR mode until link training Other DP changes included: -Only use fixed vs/pe link training sequence for 8b/10b encoding -Restrict fixed vs aux timeout workaround to Yellow Carp family Reviewed-by: Wenjing Liu Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ce438e99015871b9226c27066fe72fc05f18e8bf Author: Aric Cyr Date: Sun Sep 18 12:20:03 2022 -0400 drm/amd/display: 3.2.205 This version brings along following fixes: - LTTPR mode can be be dynamically changed - fixes divide by zero error - features able to use same interface to update cursor info - fixes for llvm compilation issues - Fixes DIO FIFO underflow and other FIFO errors - Partially valid EDIDs handled properly - Phatom pipes are skipped when checking pending flip - Fixed audio on audio on display after unplugging Acked-by: Jasdeep Dhillon Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 18b85e98e10d9cea5c23b710e78c5f68897fb3a7 Author: Aurabindo Pillai Date: Tue Sep 13 16:21:09 2022 -0400 drm/amd/display: fix a divide by zero error [Why&How] Incorrect variable was being checked for zero condition. Reviewed-by: Alvin Lee Acked-by: Jasdeep Dhillon Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 047783cdd5f604d87398236beb4971abb4d43293 Author: Alvin Lee Date: Wed Sep 21 12:04:39 2022 -0400 drm/amd/display: Only use ODM2:1 policy for high pixel rate displays We only gain a benefit of using the ODM2:1 dynamic policy if it allow us to decrease DISPCLK to use the VMIN freq. If the display config can already achieve VMIN DISPCLK freq without ODM2:1, don't apply the policy. Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1e939ea1bf4917095575fe4ff1a42578ff234605 Author: Dillon Varone Date: Fri Sep 9 12:49:55 2022 -0400 drm/amd/display: Fix various dynamic ODM transitions on DCN32 [Why&How] Several transitions were fixed that will allow Dynamic ODM and MPO transitions to be supported on DCN32. 1) Due to resource limitations, in certain scenarios that require an MPO plane to be split, the features cannot be combined with the current policy. This is due to unsafe transitions being required (OPP instance per MPCC being switched on active pipe is not supported by DCN), to support the split plane with ODM active as it moves across the viewport. Dynamic ODM will now be disabled when MPO is required. 2) When exiting MPO and re-entering ODM, DC assigns an inactive pipe for the next ODM pipe, which under previous power gating policy would result in programming a gated DSC HW block. New policy dynamically gates/un-gates DSC blocks when Dynamic ODM is active to support transitions on DCN32 only. 3) Entry and exit from 3 plane MPO and Dynamic ODM requires a minimal transition so that all pipes which require their MPCC OPP instance to be changed have a full frame to be disabled before reprogramming. To solve this, the Dynamic ODM policy now utilizes minimal state transitions when entering or exiting 3 plane scenarios. 4) Various fixes to DCN32 pipe merge/split algorithm to support Dynamic ODM and MPO transitions. In summary, this commit fixes various transitions to support ODM->MPO and MPO->ODM. Reviewed-by: Martin Leung Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e32df0c7ecead95d70ca89f39b1b2b02a59ff691 Author: Wenjing Liu Date: Thu Sep 15 15:23:38 2022 -0400 drm/amd/display: polling vid stream status in hpo dp blank [why] vid stream control is double bufferred, if we don't wait for video stream enable set to 0, we may get temporary image corruption showing on the stream when setting PIXEL_TO_SYMBOL_FIFO_ENABLE to 0. Reviewed-by: Ariel Bernstein Acked-by: Jasdeep Dhillon Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5caa63c7b7e1cbffd5095b7c884752aa7228b7ef Author: Alvin Lee Date: Thu Sep 15 11:32:19 2022 -0400 drm/amd/display: Fix CAB allocation calculation [Description] Accidentally added when should have subtracted in calculation Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 553bf264a5e736d0a6186a35b00bdc634bb5facd Author: Aurabindo Pillai Date: Tue Sep 13 14:08:05 2022 -0400 drm/amd/display: skip phantom pipes when checking for pending flip [Why&How] Phantom pipes are not programmed fully to hardware and hence we should not expect a flip completion. Reviewed-by: Alvin Lee Acked-by: Jasdeep Dhillon Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 525a65c77db51cf5d6c6d8e3f8d07efeb2270416 Author: Alvin Lee Date: Wed Sep 14 11:05:17 2022 -0400 drm/amd/display: Update MALL SS NumWays calculation [Description] Update MALL SS NumWays calculation according to programming guide. Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c08978577a7b17736d9680aaa7e0d22dc775c326 Author: Aurabindo Pillai Date: Tue Sep 13 14:08:05 2022 -0400 drm/amd/display: skip phantom pipes when checking for pending flip [Why&How] Phantom pipes are not programmed fully to hardware and hence we should not expect a flip completion. Reviewed-by: Alvin Lee Acked-by: Jasdeep Dhillon Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3141d6cb64e7a76af0b87e1f28c54d67963db871 Author: Samson Tam Date: Fri Sep 9 17:16:32 2022 -0400 drm/amd/display: fill in clock values when DPM is not enabled [Why] For individual feature testing, PMFW may not report all clock values back. Driver will default them to 0 but this will cause the BB table to be skipped and default to one state with max clocks. [How] Add helper function to scan through initial clock values and populate them with default clock limits so that BB table can be built. Add dpm_enabled flag to check when DPM is not enabled and to trigger helper function. Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e18d9839b174d6bfa0d620293098b3c6a441cc4b Author: Max Tseng Date: Thu Sep 15 11:32:35 2022 +0800 drm/amd/display: Cursor Info Update refactor Dc: cursor info update: phase 1: [Why] Different feature might need to update cursor info, but With different approaches. To unify this diversity problem, all features should use The same interface to update cursor. Reviewed-by: Reza Amini Acked-by: Jasdeep Dhillon Signed-off-by: Max Tseng Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cc8dee689a6bced98c8bd83ffbf4b2041641a860 Author: Taimur Hassan Date: Tue Sep 13 18:35:20 2022 -0400 drm/amd/display: Avoid unnecessary pixel rate divider programming [Why] Programming pixel rate divider when FIFO is enabled can cause FIFO error. [How] Skip divider programming when divider values are the same to prevent FIFO error. Reviewed-by: Alvin Lee Acked-by: Jasdeep Dhillon Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 17caab0f0b47d53ad02e20673b51f30a6a16025a Author: Eric Bernstein Date: Mon Mar 21 10:42:34 2022 -0400 drm/amd/display: Remove assert for odm transition case Remove assert that will hit during odm transition case, since this is a valid case. Signed-off-by: Eric Bernstein Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5d4b5914607803407c1bd3fc8483f93a67cafd0d Author: Ian Chen Date: Wed Sep 7 14:10:27 2022 +0800 drm/amd/display: Add ABM control to panel_config struct. Reviewed-by: Josip Pavic Acked-by: Jasdeep Dhillon Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a6135ddec2258cd52b5c8d20b45bbaa29b80c5a0 Author: Alvin Lee Date: Thu Sep 15 10:47:34 2022 -0400 drm/amd/display: Disable MALL when TMZ surface [Description] - Don't use MALL buffering of any kind when the surface is TMZ - Workaround for a HW bug Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c02e6444117f112bea468d3615ad6293cc7de64e Author: Taimur Hassan Date: Wed Sep 14 16:25:31 2022 -0400 drm/amd/display: Fix typo in get_pixel_rate_div [Why & How] Some FIFO errors still occur due to reading wrong pixel rate divider. Fix typo to prevent FIFO error. Reviewed-by: Nicholas Kazlauskas Acked-by: Jasdeep Dhillon Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3267b7c05bb76f8eb6da90ae0f5b0d523b9f611e Author: Charlene Liu Date: Tue Sep 13 20:03:46 2022 -0400 drm/amd/display: add debug keys for override bios settings. [why] adding debug keys used for compliance test. Reviewed-by: Chris Park Acked-by: Jasdeep Dhillon Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1f21390ec6026da538a71ac254295461be7ee0c4 Author: Aric Cyr Date: Wed Sep 14 12:54:52 2022 -0400 drm/amd/display: Fix audio on display after unplugging another Revert "dc: skip audio setup when audio stream is enabled" This reverts commit 65fbfb02c2734cacffec5e3f492e1b4f1dabcf98 [why] We have minimal pipe split transition method to avoid pipe allocation outage.However, this method will invoke audio setup which cause audio output stuck once pipe reallocate. [how] skip audio setup for pipelines which audio stream has been enabled Reviewed-by: Martin Leung Acked-by: Jasdeep Dhillon Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 567df29f51a582ced8d2f56c7f531757496fe7f4 Author: Wenjing Liu Date: Tue Sep 13 19:04:56 2022 -0400 drm/amd/display: add missing null check [why] There is a coding error for a missing null check for stream pointer when iterating through pipe_ctx. Reviewed-by: Martin Leung Acked-by: Jasdeep Dhillon Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c55bf690fe79f04cb8ebfe34144079777021cd7c Author: Nicholas Kazlauskas Date: Thu Sep 8 11:11:47 2022 -0400 drm/amd/display: Add explicit FIFO disable for DP blank [Why] We rely on DMCUB to do this when disabling the link but it should actually come before we disable the DP VID stream. If we don't then the FIFO can end up with underflow that persists the next time it's enabled. [How] Add a DCN314 specific blank sequence that will disable the DIG FIFO first. Reviewed-by: Syed Hassan Acked-by: Jasdeep Dhillon Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ec55a1c0813efcc8629f4af8e17b6da5265642e3 Author: Nicholas Kazlauskas Date: Thu Sep 8 14:17:01 2022 -0400 drm/amd/display: Wrap OTG disable workaround with FIFO control [Why] The DIO FIFO will underflow if we turn off the OTG before we turn off the FIFO. Since this happens as part of the OTG workaround and we don't reset the FIFO afterwards we see the error persist. [How] Add disable FIFO before the disable CRTC and enable FIFO after enabling the CRTC. Reviewed-by: Syed Hassan Acked-by: Jasdeep Dhillon Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 936675464b1f481ad432d6a4fb75405c0abc71c7 Author: Brandon Syu Date: Thu Sep 15 18:16:13 2022 +0800 drm/amd/display: Add debug option for exiting idle optimizations on cursor updates [Description] - Have option to exit idle opt on cursor updates for debug and optimizations purposes Reviewed-by: Aric Cyr Acked-by: Jasdeep Dhillon Signed-off-by: Brandon Syu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7712b0a7df76447515752afcf8ec470b17ea30ef Author: Ilya Bakoulin Date: Tue Sep 13 14:56:13 2022 -0400 drm/amd/display: Change EDID fallback condition [Why] Partially valid EDIDs on MST sinks are treated the same way as broken EDIDs or read failures and result in a fallback EDID being used instead. [How] If edid_status is EDID_PARTIAL_VALID, prefer to use the valid EDID blocks instead of using a fallback EDID. Reviewed-by: Martin Leung Acked-by: Jasdeep Dhillon Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d3d61281edc0ab0c3d566e760d5bd4db5a9c217a Author: Nicholas Kazlauskas Date: Wed Sep 7 10:11:34 2022 -0400 drm/amd/display: Do DIO FIFO enable after DP video stream enable [Why] Avoids a race condition where DIO FIFO can underflow due to no incoming data available. [How] Shift the FIFO enable below stream enable. Make sure fullness level is written before the DIO reset takes place and that we're not doing it twice. Reviewed-by: Syed Hassan Acked-by: Jasdeep Dhillon Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 97d8d6f075bd8f988589be02b91f6fa644d0b0b8 Author: Aric Cyr Date: Fri Sep 9 18:07:59 2022 -0400 drm/amd/display: Remove interface for periodic interrupt 1 [why] Only a single VLINE interrupt is available so interface should not expose the second one which is used by DMU firmware. [how] Remove references to periodic_interrupt1 and VLINE1 from DC interfaces. Reviewed-by: Jaehyun Chung Acked-by: Jasdeep Dhillon Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c054375159802704d099986f03d0b7d21b590fac Author: Alvin Lee Date: Tue Sep 13 11:06:31 2022 -0400 drm/amd/display: Update DCN32 to use new SR latencies [Description] Update to new SR latencies for DCN32 Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Acked-by: Jasdeep Dhillon Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 202c1e3dbc882c9040208223c12d158286475084 Author: Taimur Hassan Date: Tue Sep 13 16:04:06 2022 -0400 drm/amd/display: Avoid avoid unnecessary pixel rate divider programming [Why] Programming pixel rate divider when FIFO is enabled can cause FIFO error. [How] Skip divider programming when divider values are the same to prevent FIFO error. Reviewed-by: Nicholas Kazlauskas Acked-by: Jasdeep Dhillon Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 15afe32388bac88661ffdc1645be2a038f49b9f2 Author: Graham Sider Date: Fri Sep 23 10:07:15 2022 -0400 drm/amdkfd: fix dropped interrupt in kfd_int_process_v11 Shader wave interrupts were getting dropped in event_interrupt_wq_v11 if the PRIV bit was set to 1. This would often lead to a hang. Until debugger logic is upstreamed, expand comment to stop early return. Signed-off-by: Graham Sider Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 3e9cf23428701f055765d66951b01286f94df056 Author: Graham Sider Date: Mon Sep 19 13:57:14 2022 -0400 drm/amdgpu: pass queue size and is_aql_queue to MES Update mes_v11_api_def.h add_queue API with is_aql_queue parameter. Also re-use gds_size for the queue size (unused for KFD). MES requires the queue size in order to compute the actual wptr offset within the queue RB since it increases monotonically for AQL queues. v2: Make is_aql_queue assign clearer Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7971b5c253cb1b3293dd1479f4912899021451d1 Author: Graham Sider Date: Tue Sep 20 17:16:13 2022 -0400 drm/amdkfd: fix MQD init for GFX11 in init_mqd Set remaining compute_static_thread_mgmt_se* accordingly. Signed-off-by: Graham Sider Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 585a82618bc422508c0c8ae0dfe2f76f22c28361 Author: David Belanger Date: Thu Aug 25 10:39:37 2022 -0400 drm/amdgpu: Enable SA software trap. Enables support for software trap for MES >= 4. Adapted from implementation from Jay Cornwall. v2: Add IP version check in conditions. v3: Remove debugger code changes. Signed-off-by: Jay Cornwall Signed-off-by: David Belanger Reviewed-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 82806c25d5e9d927ecb68c0c3679dd41187c9af6 Author: Tom St Denis Date: Fri Sep 23 08:55:50 2022 -0400 drm/amd/amdgpu: Add missing XGMI hive registers for mmhub 9.4.1 These are used by umr to sort the hive nodes since the kernel initializes the nodes in order of bus enumeration not XGMI hive enumeration. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 167be8522821fd38636410103e1c154b589cb1d9 Author: Ruijing Dong Date: Thu Sep 22 11:27:52 2022 -0400 drm/amdgpu/vcn: update vcn4 fw shared data structure update VF_RB_SETUP_FLAG, add SMU_DPM_INTERFACE_FLAG, and corresponding change in VCN4. Reviewed-by: Leo Liu Signed-off-by: Ruijing Dong Signed-off-by: Alex Deucher commit b077656b8c5ec9ac238782e20fad42f6d6d299d4 Author: Likun Gao Date: Thu Sep 22 16:50:44 2022 +0800 drm/amdgpu/sdma6: use common function to init sdma fw Use common function to init sdma v6 firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 52642d13d600e7580fbf4c09dfaf15e187ab1625 Author: Likun Gao Date: Thu Sep 22 16:48:49 2022 +0800 drm/amdgpu: support sdma struct v2 fw init Support SDMA firmware init on common function for sdma v2 struct. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 108db8decf0e5ac5f7b64967f434a32125b75bb0 Author: Likun Gao Date: Thu Sep 22 14:38:51 2022 +0800 drm/amdgpu/sdma5: use common function to init sdma fw Use common function to init sdma v5 firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a2d3b4b81fd49b14782ce0ff68ca74e40f16609a Author: Likun Gao Date: Thu Sep 22 14:37:52 2022 +0800 drm/amdgpu/sdma4: use common function to init sdma fw Use common function to init sdma v4 firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 15aa13056d11dad1e54d65acd854184f3f74a5b7 Author: Likun Gao Date: Thu Sep 22 14:33:06 2022 +0800 drm/amdgpu: add function to init SDMA microcode Add an common function to init SDMA related microcode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e268df1d20b89d1d448277e16ce1720887e8bdbb Author: Likun Gao Date: Tue Sep 20 13:52:36 2022 +0800 drm/amdgpu/gfx11: use common function to init cp fw Use common function to init gfx v11 CP firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5993e4c68add76bdec1efff1c534b8610f69ac05 Author: Likun Gao Date: Tue Sep 20 13:49:07 2022 +0800 drm/amdgpu/gfx10: use common function to init CP fw Use common function to init gfx v10 CP firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 93cad722d3fe546744bcc484c5945d09d5f22d45 Author: Likun Gao Date: Tue Sep 20 13:53:26 2022 +0800 drm/amdgpu/gfx9: use common function to init cp fw Use common function to init gfx v9 CP firmware ucode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ec71b250170f60986ea1d2feba6d3b6a63bb1ac2 Author: Likun Gao Date: Tue Sep 20 13:46:52 2022 +0800 drm/amdgpu: add function to init CP microcode Add an common function to init CP related microcode. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 425ad8a5d3b09f09256e44cb6b55959b18c15618 Author: Evan Quan Date: Thu Sep 1 11:45:02 2022 +0800 drm/amd/pm: use adverse selection for dpm features unsupported by driver It's vbios and pmfw instead of driver who decide whether some dpm features is supported or not. Driver just de-selects those features which are not permitted on user's request. Thus, we use adverse selects model. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ce754eb9392ecdf1e843b209a643c4d5fcb2d7f3 Author: Evan Quan Date: Wed Aug 3 16:46:47 2022 +0800 drm/amd/pm: enable gfxoff feature for SMU 13.0.0 The feature is ready with latest 78.58.0 PMFW. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 74365388999386d8becd147945a714be2c36228d Author: Evan Quan Date: Fri Aug 26 19:30:20 2022 +0800 drm/amdgpu: avoid gfx register accessing during gfxoff Make sure gfxoff is disabled before gfx register accessing. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 629c30db7c6812fe82d2dcc0110c9e994a831182 Author: Li Zhong Date: Wed Sep 21 21:17:56 2022 -0700 drivers/amd/pm: check the return value of amdgpu_bo_kmap amdgpu_bo_kmap() returns error when fails to map buffer object. Add the error check and propagate the error. Reviewed-by: Evan Quan Reviewed-by: Christian König Signed-off-by: Li Zhong Signed-off-by: Alex Deucher commit bb66ecbf122cc5ca52c569f0f84b5d1b2c00f6b9 Author: Lijo Lazar Date: Wed Sep 21 17:54:59 2022 +0530 drm/amdgpu: Use simplified API for p2p dist calc Use the simpified API that calculates distance between two devices. Signed-off-by: Lijo Lazar Reviewed-by: Christian König Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit d0fa84f174770679ea22076f4f754bfde2f3f0e1 Author: Lijo Lazar Date: Wed Sep 21 17:37:37 2022 +0530 drm/amdgpu: Disable verbose for p2p dist calc Disable verbose while getting p2p distance. With verbose, it shows warning if ACS redirect is set between the devices. Adds noise to dmesg logs when a few GPU devices are on the same platform. Example log: amdgpu 0000:34:00.0: ACS redirect is set between the client and provider (0000:31:00.0) amdgpu 0000:34:00.0: to disable ACS redirect for this path, add the kernel parameter: pci=disable_acs_redir=0000:30:00.0;0000:2e:00.0;0000:33:00.0;0000:2e:10.0 Signed-off-by: Lijo Lazar Reviewed-by: Christian König Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 642c0401135d9877d6888fdd2b0fbbee3b134409 Author: YiPeng Chai Date: Thu Sep 8 09:48:11 2022 +0800 drm/amdgpu: Fixed ras warning when uninstalling amdgpu For the asic using smu v13_0_2, there is the following warning when uninstalling amdgpu: amdgpu: ras disable gfx failed poison:1 ret:-22. [Why]: For the asic using smu v13_0_2, the psp .suspend and mode1reset is called before amdgpu_ras_pre_fini during amdgpu uninstall, it has disabled all ras features and reset the psp. Since the psp is reset, calling amdgpu_ras_disable_all_features in amdgpu_ras_pre_fini to disable ras features will fail. [How]: If all ras features are disabled, amdgpu_ras_disable_all_features will not be called to disable all ras features again. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7c32d4e37ff3595ce947e4e0a2f098fdd05ae7d4 Author: Hawking Zhang Date: Fri Sep 16 00:48:27 2022 +0800 drm/amdgpu/gfx11: switch to amdgpu_gfx_rlc_init_microcode switch to common helper to initialize rlc firmware for gfx11 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 39a35d52d48402957ba915a9d50b2d77dac45bb3 Author: Hawking Zhang Date: Fri Sep 16 00:43:47 2022 +0800 drm/amdgpu/gfx10: switch to amdgpu_gfx_rlc_init_microcode switch to common helper to initialize rlc firmware for gfx10 v2: squash in size validation fix (Alex) Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 191249f708897fc34c78f4494f7156896aaaeca9 Author: Zhihao Cheng Date: Fri Sep 23 21:45:54 2022 +0800 quota: Add more checking after reading from quota file It would be better to do more sanity checking (eg. dqdh_entries, block no.) for the content read from quota file, which can prevent corrupting the quota file. Link: https://lore.kernel.org/r/20220923134555.2623931-4-chengzhihao1@huawei.com Signed-off-by: Zhihao Cheng Signed-off-by: Jan Kara commit 3fc61e0e96a3261aacfd3150fb3a9228f7ce5dd6 Author: Zhihao Cheng Date: Fri Sep 23 21:45:53 2022 +0800 quota: Replace all block number checking with helper function Cleanup all block checking places, replace them with helper function do_check_range(). Link: https://lore.kernel.org/r/20220923134555.2623931-3-chengzhihao1@huawei.com Signed-off-by: Zhihao Cheng Signed-off-by: Jan Kara commit 6c8ea8b8cd4722efd419f91ca46a2dc81b7d89a3 Author: Zhihao Cheng Date: Fri Sep 23 21:45:52 2022 +0800 quota: Check next/prev free block number after reading from quota file Following process: Init: v2_read_file_info: <3> dqi_free_blk 0 dqi_free_entry 5 dqi_blks 6 Step 1. chown bin f_a -> dquot_acquire -> v2_write_dquot: qtree_write_dquot do_insert_tree find_free_dqentry get_free_dqblk write_blk(info->dqi_blocks) // info->dqi_blocks = 6, failure. The content in physical block (corresponding to blk 6) is random. Step 2. chown root f_a -> dquot_transfer -> dqput_all -> dqput -> ext4_release_dquot -> v2_release_dquot -> qtree_delete_dquot: dquot_release remove_tree free_dqentry put_free_dqblk(6) info->dqi_free_blk = blk // info->dqi_free_blk = 6 Step 3. drop cache (buffer head for block 6 is released) Step 4. chown bin f_b -> dquot_acquire -> commit_dqblk -> v2_write_dquot: qtree_write_dquot do_insert_tree find_free_dqentry get_free_dqblk dh = (struct qt_disk_dqdbheader *)buf blk = info->dqi_free_blk // 6 ret = read_blk(info, blk, buf) // The content of buf is random info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free) // random blk Step 5. chown bin f_c -> notify_change -> ext4_setattr -> dquot_transfer: dquot = dqget -> acquire_dquot -> ext4_acquire_dquot -> dquot_acquire -> commit_dqblk -> v2_write_dquot -> dq_insert_tree: do_insert_tree find_free_dqentry get_free_dqblk blk = info->dqi_free_blk // If blk < 0 and blk is not an error code, it will be returned as dquot transfer_to[USRQUOTA] = dquot // A random negative value __dquot_transfer(transfer_to) dquot_add_inodes(transfer_to[cnt]) spin_lock(&dquot->dq_dqb_lock) // page fault , which will lead to kernel page fault: Quota error (device sda): qtree_write_dquot: Error -8000 occurred while creating quota BUG: unable to handle page fault for address: ffffffffffffe120 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 5974 Comm: chown Not tainted 6.0.0-rc1-00004 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:_raw_spin_lock+0x3a/0x90 Call Trace: dquot_add_inodes+0x28/0x270 __dquot_transfer+0x377/0x840 dquot_transfer+0xde/0x540 ext4_setattr+0x405/0x14d0 notify_change+0x68e/0x9f0 chown_common+0x300/0x430 __x64_sys_fchownat+0x29/0x40 In order to avoid accessing invalid quota memory address, this patch adds block number checking of next/prev free block read from quota file. Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216372 Fixes: 1da177e4c3f4152 ("Linux-2.6.12-rc2") CC: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220923134555.2623931-2-chengzhihao1@huawei.com Signed-off-by: Zhihao Cheng Signed-off-by: Jan Kara commit 78ba392c84c74903b979c1ef5ded93430acd9ad6 Author: Thomas Gleixner Date: Sat Sep 24 02:10:41 2022 +0206 printk: Mark __printk percpu data ready __ro_after_init This variable cannot change post boot. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220924000454.3319186-6-john.ogness@linutronix.de commit eb4531b346c93fd01edc0cb155330bbee102d0bd Author: Thomas Gleixner Date: Sat Sep 24 02:10:40 2022 +0206 printk: Remove bogus comment vs. boot consoles The comment about unregistering boot consoles is just not matching the reality. Remove it. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220924000454.3319186-5-john.ogness@linutronix.de commit 7fc11a521e7c1b8cec5904b28dba9b85186f37d7 Author: Thomas Gleixner Date: Sat Sep 24 02:10:39 2022 +0206 printk: Remove write only variable nr_ext_console_drivers Commit a699449bb13b ("printk: refactor and rework printing logic") removed the need for @nr_ext_console_drivers. Remove the unneeded variable. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220924000454.3319186-4-john.ogness@linutronix.de commit e3f12f0602833c88ad2cbe3aff397acd0cfd2695 Author: Thomas Gleixner Date: Sat Sep 24 02:10:38 2022 +0206 printk: Declare log_wait properly kernel/printk/printk.c:365:1: warning: symbol 'log_wait' was not declared. Should it be static? Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220924000454.3319186-3-john.ogness@linutronix.de commit c60ba2d34608dc6e224440267ed392adf65e05f2 Author: Thomas Gleixner Date: Sat Sep 24 02:10:37 2022 +0206 printk: Make pr_flush() static No user outside the printk code and no reason to export this. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220924000454.3319186-2-john.ogness@linutronix.de commit 3e4cb6ebbb2bad201c1186bc0b7e8cf41dd7f7e6 Author: Stefan Metzmacher Date: Thu Sep 29 09:39:10 2022 +0200 io_uring/net: fix fast_iov assignment in io_setup_async_msg() I hit a very bad problem during my tests of SENDMSG_ZC. BUG(); in first_iovec_segment() triggered very easily. The problem was io_setup_async_msg() in the partial retry case, which seems to happen more often with _ZC. iov_iter_iovec_advance() may change i->iov in order to have i->iov_offset being only relative to the first element. Which means kmsg->msg.msg_iter.iov is no longer the same as kmsg->fast_iov. But this would rewind the copy to be the start of async_msg->fast_iov, which means the internal state of sync_msg->msg.msg_iter is inconsitent. I tested with 5 vectors with length like this 4, 0, 64, 20, 8388608 and got a short writes with: - ret=2675244 min_ret=8388692 => remaining 5713448 sr->done_io=2675244 - ret=-EAGAIN => io_uring_poll_arm - ret=4911225 min_ret=5713448 => remaining 802223 sr->done_io=7586469 - ret=-EAGAIN => io_uring_poll_arm - ret=802223 min_ret=802223 => res=8388692 While this was easily triggered with SENDMSG_ZC (queued for 6.1), it was a potential problem starting with 7ba89d2af17aa879dda30f5d5d3f152e587fc551 in 5.18 for IORING_OP_RECVMSG. And also with 4c3c09439c08b03d9503df0ca4c7619c5842892e in 5.19 for IORING_OP_SENDMSG. However 257e84a5377fbbc336ff563833a8712619acce56 introduced the critical code into io_setup_async_msg() in 5.11. Fixes: 7ba89d2af17aa ("io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly") Fixes: 257e84a5377fb ("io_uring: refactor sendmsg/recvmsg iov managing") Cc: stable@vger.kernel.org Signed-off-by: Stefan Metzmacher Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/b2e7be246e2fb173520862b0c7098e55767567a2.1664436949.git.metze@samba.org Signed-off-by: Jens Axboe commit 6f0ac3b52a9075b7291a72fb338d08491c1f0a64 Author: Sebastian Andrzej Siewior Date: Tue Sep 27 12:49:12 2022 +0200 lib/vsprintf: Initialize vsprintf's pointer hash once the random core is ready. The printk code invokes vnsprintf in order to compute the complete string before adding it into its buffer. This happens in an IRQ-off region which leads to a warning on PREEMPT_RT in the random code if the format strings contains a %p for pointer printing. This happens because the random core acquires locks which become sleeping locks on PREEMPT_RT which must not be acquired with disabled interrupts and or preemption disabled. By default the pointers are hashed which requires a random value on the first invocation (either by printk or another user which comes first. One could argue that there is no need for printk to disable interrupts during the vsprintf() invocation which would fix the just mentioned problem. However printk itself can be invoked in a context with disabled interrupts which would lead to the very same problem. Move the initialization of ptr_key into a worker and schedule it from subsys_initcall(). This happens early but after the workqueue subsystem is ready. Use get_random_bytes() to retrieve the random value if the RNG core is ready, otherwise schedule a worker in two seconds and try again. Another advantage is that it removes a lock from the vsprintf() code path. It prevents a possible deadlock when printk("%p", ptr) is called under the lock taken in get_random_bytes(). Reported-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior Acked-by: Jason A. Donenfeld Reviewed-by: Petr Mladek [pmladek@suse.com: Added a note about the it prevented a possible deadlock in printk().] Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220927104912.622645-3-bigeasy@linutronix.de commit e4279b599863dd1aa71fb8e35bffa943545bbaeb Author: Sebastian Andrzej Siewior Date: Tue Sep 27 12:49:11 2022 +0200 lib/vsprintf: Remove static_branch_likely() from __ptr_to_hashval(). Using static_branch_likely() to signal that ptr_key has been filled is a bit much given that it is not a fast path. Replace static_branch_likely() with bool for condition and a memory barrier for ptr_key. Suggested-by: Petr Mladek Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220927104912.622645-2-bigeasy@linutronix.de commit 510bbf82f8dc36804114873d30ed1d0c8533af81 Author: ruanjinjie Date: Wed Sep 28 11:17:08 2022 +0800 net: cpmac: Add __init/__exit annotations to module init/exit funcs Add __init/__exit annotations to module init/exit funcs Signed-off-by: ruanjinjie Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220928031708.89120-1-ruanjinjie@huawei.com Signed-off-by: Paolo Abeni commit 65c94e4d15830406a31a55085887e97bacd25434 Author: Colin Ian King Date: Wed Sep 28 23:04:17 2022 +0100 ASoC: mediatek: mt8186: Fix spelling mistake "slect" -> "select" There are some spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220928220417.66799-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit 3f9a1b3591003b122a6ea2d69f89a0fd96ec58b9 Author: Stephane Eranian Date: Wed Sep 28 11:40:43 2022 -0700 perf/x86/amd/lbr: Adjust LBR regardless of filtering In case of fused compare and taken branch instructions, the AMD LBR points to the compare instruction instead of the branch. Users of LBR usually expects the from address to point to a branch instruction. The kernel has code to adjust the from address via get_branch_type_fused(). However this correction is only applied when a branch filter is applied. That means that if no filter is present, the quality of the data is lower. Fix the problem by applying the adjustment regardless of the filter setting, bringing the AMD LBR to the same level as other LBR implementations. Fixes: 245268c19f70 ("perf/x86/amd/lbr: Use fusion-aware branch classifier") Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Sandipan Das Link: https://lore.kernel.org/r/20220928184043.408364-3-eranian@google.com commit 117ceeb1f4f87331e45a77e71f18303d15ec882e Author: Stephane Eranian Date: Wed Sep 28 11:40:42 2022 -0700 perf/x86/utils: Fix uninitialized var in get_branch_type() offset is passed as a pointer and on certain call path is not set by the function. If the caller does not re-initialize offset between calls, value could be inherited between calls. Prevent this by initializing offset on each call. This impacts the code in amd_pmu_lbr_filter() which does: for(i=0; ...) { ret = get_branch_type_fused(..., &offset); if (offset) lbr_entries[i].from += offset; } Fixes: df3e9612f758 ("perf/x86: Make branch classifier fusion-aware") Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Sandipan Das Link: https://lore.kernel.org/r/20220928184043.408364-2-eranian@google.com commit cfef80bad4cf79cdc964a53c98254dfa462be83f Author: Ravi Bangoria Date: Wed Sep 28 15:27:57 2022 +0530 perf/uapi: Define PERF_MEM_SNOOPX_PEER in kernel header file PERF_MEM_SNOOPX_PEER is defined only in tools uapi header. Although it's used only by perf tool, not defining it in kernel header can create problems in future. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-8-ravi.bangoria@amd.com commit 5b26af6d2b7854639ddf893366bbca7e74fa7c54 Author: Ravi Bangoria Date: Wed Sep 28 15:27:56 2022 +0530 perf/x86/amd: Support PERF_SAMPLE_PHY_ADDR IBS_DC_PHYSADDR provides the physical data address for the tagged load/ store operation. Populate perf sample physical address using it. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-7-ravi.bangoria@amd.com commit cb2bb85f7ed8740ab5fc06bbec386faa39ba44ef Author: Ravi Bangoria Date: Wed Sep 28 15:27:55 2022 +0530 perf/x86/amd: Support PERF_SAMPLE_ADDR IBS_DC_LINADDR provides the linear data address for the tagged load/ store operation. Populate perf sample address using it. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-6-ravi.bangoria@amd.com commit 6b2ae4952ef8ac23b467bc10776404092b581143 Author: Ravi Bangoria Date: Wed Sep 28 15:27:54 2022 +0530 perf/x86/amd: Support PERF_SAMPLE_{WEIGHT|WEIGHT_STRUCT} IbsDcMissLat indicates the number of clock cycles from when a miss is detected in the data cache to when the data was delivered to the core. Similarly, IbsTagToRetCtr provides number of cycles from when the op was tagged to when the op was retired. Consider these fields for sample->weight. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-5-ravi.bangoria@amd.com commit 7c10dd0a88b1cc6ae4637fffb494c5e080027eb6 Author: Ravi Bangoria Date: Wed Sep 28 15:27:53 2022 +0530 perf/x86/amd: Support PERF_SAMPLE_DATA_SRC struct perf_mem_data_src is used to pass arch specific memory access details into generic form. These details gets consumed by tools like perf mem and c2c. IBS tagged load/store sample provides most of the information needed for these tools. Add a logic to convert IBS specific raw data into perf_mem_data_src. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-4-ravi.bangoria@amd.com commit 610c238041fbc682936d34132362a54a802600fe Author: Ravi Bangoria Date: Wed Sep 28 15:27:52 2022 +0530 perf/x86/amd: Add IBS OP_DATA2 DataSrc bit definitions IBS_OP_DATA2 DataSrc provides detail about location of the data being accessed from by load ops. Define macros for legacy and extended DataSrc values. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-3-ravi.bangoria@amd.com commit ee3e88dfec23153d0675b5d00522297b9adf657c Author: Ravi Bangoria Date: Wed Sep 28 15:27:51 2022 +0530 perf/mem: Introduce PERF_MEM_LVLNUM_{EXTN_MEM|IO} PERF_MEM_LVLNUM_EXTN_MEM which can be used to indicate accesses to extension memory like CXL etc. PERF_MEM_LVL_IO can be used for IO accesses but it can not distinguish between local and remote IO. Introduce new field PERF_MEM_LVLNUM_IO which can be clubbed with PERF_MEM_REMOTE_REMOTE to indicate Remote IO accesses. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220928095805.596-2-ravi.bangoria@amd.com commit e04a1607c9c3c0e2dc48715aeb570f2581f514bc Author: Kan Liang Date: Wed Sep 28 08:33:31 2022 -0700 perf/x86/uncore: Add new Raptor Lake S support From the perspective of the uncore PMU, the new Raptor Lake S is the same as the other hybrid {ALDER,RAPTOP}LAKE. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220928153331.3757388-4-kan.liang@linux.intel.com commit d12940d2ead51c6978e7d38b2abf12b833270b2a Author: Kan Liang Date: Wed Sep 28 08:33:30 2022 -0700 perf/x86/cstate: Add new Raptor Lake S support From the perspective of Intel cstate residency counters, the new Raptor Lake S is the same as the other hybrid {ALDER,RAPTOP}LAKE. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220928153331.3757388-3-kan.liang@linux.intel.com commit 193c888b7ffe4da97346950c0e98dd77cc629f24 Author: Kan Liang Date: Wed Sep 28 08:33:29 2022 -0700 perf/x86/msr: Add new Raptor Lake S support The same as the other hybrid {ALDER,RAPTOP}LAKE, the new Raptor Lake S also support PPERF and SMI_COUNT MSRs. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220928153331.3757388-2-kan.liang@linux.intel.com commit 50b0c97bf00e4815aee09cace28b940ebb060e69 Author: Kan Liang Date: Wed Sep 28 08:33:28 2022 -0700 perf/x86: Add new Raptor Lake S support From PMU's perspective, the new Raptor Lake S is the same as the other of hybrid {ALDER,RAPTOP}LAKE. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220928153331.3757388-1-kan.liang@linux.intel.com commit a1ebcd59430236b336428bbf8e1da16fb87d56e4 Merge: cce6a2d7e0e49 f76349cf41451 Author: Peter Zijlstra Date: Thu Sep 29 12:20:50 2022 +0200 Merge branch 'v6.0-rc7' Merge upstream to get RAPTORLAKE_S Signed-off-by: Peter Zijlstra commit 4d96829774b7bd70ed81b5e2830afb9d97b9fea2 Author: Zhiyuan Dai Date: Wed Sep 28 10:39:27 2022 +0800 irqchip/gic-v3: Fix typo in comment Fix typo in comment (cleanip/cleanup). Signed-off-by: Zhiyuan Dai [maz: commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1664332767-6909-1-git-send-email-daizhiyuan@phytium.com.cn commit daa0b6d0187599a574cb5cb392b259bda3dcf979 Author: Apurva Nandan Date: Sat Aug 20 00:37:29 2022 +0530 dt-bindings: interrupt-controller: ti,sci-intr: Fix missing reg property in the binding Fix the following warning in dtbs_check interrupt-controller@a00000: Unevaluated properties are not allowed ('reg' was unexpected) Add the reg property in the schema. Signed-off-by: Apurva Nandan Acked-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220819190729.32358-4-a-nandan@ti.com commit d9fc272bfd76acadf0537901549d07a1b81dbeed Author: Apurva Nandan Date: Sat Aug 20 00:37:27 2022 +0530 dt-bindings: irqchip: ti,sci-inta: Fix warning for missing #interrupt-cells ti,sci-inta nodes, or else we will have following warning when building device tree files with W=2 warning level. arch/arm64/boot/dts/ti/k3-j721e-main.dtsi:147.51-156.5: Warning (interrupt_provider): /bus@100000/main-navss/interrupt-controller@33d00000: Missing #interrupt-cells in interrupt provider And further, #interrupt-cells is required to be in yaml bindings as well to prevent following schema warnings: k3-j721e-common-proc-board.dtb: interrupt-controller@33d00000: Unevaluated properties are not allowed ('#interrupt-cells' was unexpected) >From schema: linux/Documentation/devicetree/bindings/interrupt-controller/ti,sci-inta.yaml Add #interrupt-cells property in ti,sci-inta.yaml Signed-off-by: Apurva Nandan Acked-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220819190729.32358-2-a-nandan@ti.com commit 8ad891ed435ba24465e0650942267e90a060675f Author: Daisuke Matsuda Date: Thu Sep 29 17:00:23 2022 +0900 RDMA/rxe: Remove error/warning messages from packet receiver path Incoming packets to rxe are passed from UDP layer using an encapsulation socket. If there are any clients reachable to a node, they can invoke the encapsulation handler arbitrarily by sending malicious or irrelevant packets. This can potentially cause a message overflow and a subsequent slowdown on the node. Signed-off-by: Daisuke Matsuda Link: https://lore.kernel.org/r/20220929080023.304242-1-matsuda-daisuke@fujitsu.com Signed-off-by: Leon Romanovsky commit 445d41d7a7c15793933f47c0c23fae3a1d09a8c1 Merge: af961f8059a42 05a940656e1eb Author: Vlastimil Babka Date: Thu Sep 29 11:30:55 2022 +0200 Merge branch 'slab/for-6.1/kmalloc_size_roundup' into slab/for-next The first two patches from a series by Kees Cook [1] that introduce kmalloc_size_roundup(). This will allow merging of per-subsystem patches using the new function and ultimately stop (ab)using ksize() in a way that causes ongoing trouble for debugging functionality and static checkers. [1] https://lore.kernel.org/all/20220923202822.2667581-1-keescook@chromium.org/ -- Resolved a conflict of modifying mm/slab.c __ksize() comment with a commit that unifies __ksize() implementation into mm/slab_common.c commit af961f8059a42d1b9941dd8aa83420b25fd17e91 Merge: 0bdcef54a25b1 6edf2576a6cc4 Author: Vlastimil Babka Date: Thu Sep 29 11:28:26 2022 +0200 Merge branch 'slab/for-6.1/slub_debug_waste' into slab/for-next A patch from Feng Tang that enhances the existing debugfs alloc_traces file for kmalloc caches with information about how much space is wasted by allocations that needs less space than the particular kmalloc cache provides. commit 0bdcef54a25b1990ab43cb58817731290b07dc50 Merge: 5959725a4af61 d65360f224069 Author: Vlastimil Babka Date: Thu Sep 29 11:27:58 2022 +0200 Merge branch 'slab/for-6.1/trivial' into slab/for-next Additional cleanup by Chao Yu removing a BUG_ON() in create_unique_id(). commit 4b3402f1f4d9860301d6d5cd7aff3b67f678d577 Author: Marc Zyngier Date: Mon Sep 26 15:51:20 2022 +0100 KVM: selftests: dirty-log: Use KVM_CAP_DIRTY_LOG_RING_ACQ_REL if available Pick KVM_CAP_DIRTY_LOG_RING_ACQ_REL if exposed by the kernel. Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-7-maz@kernel.org commit 4eb6486cb43c93382c27a2659ba978c660e98498 Author: Marc Zyngier Date: Mon Sep 26 15:51:19 2022 +0100 KVM: selftests: dirty-log: Upgrade flag accesses to acquire/release semantics In order to preserve ordering, make sure that the flag accesses in the dirty log are done using acquire/release accessors. Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-6-maz@kernel.org commit 671c8c7f9f2349d8b2176ad810f1406794011f63 Author: Marc Zyngier Date: Mon Sep 26 15:51:18 2022 +0100 KVM: Document weakly ordered architecture requirements for dirty ring Now that the kernel can expose to userspace that its dirty ring management relies on explicit ordering, document these new requirements for VMMs to do the right thing. Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-5-maz@kernel.org commit fc0693d4e5afe3c110503c3afa9f60600f9e964b Author: Marc Zyngier Date: Mon Sep 26 15:51:17 2022 +0100 KVM: x86: Select CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL Since x86 is TSO (give or take), allow it to advertise the new ACQ_REL version of the dirty ring capability. No other change is required for it. Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-4-maz@kernel.org commit 17601bfed909fa080fcfd227b57da2bd4dc2d2a6 Author: Marc Zyngier Date: Mon Sep 26 15:51:16 2022 +0100 KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option In order to differenciate between architectures that require no extra synchronisation when accessing the dirty ring and those who do, add a new capability (KVM_CAP_DIRTY_LOG_RING_ACQ_REL) that identify the latter sort. TSO architectures can obviously advertise both, while relaxed architectures must only advertise the ACQ_REL version. This requires some configuration symbol rejigging, with HAVE_KVM_DIRTY_RING being only indirectly selected by two top-level config symbols: - HAVE_KVM_DIRTY_RING_TSO for strongly ordered architectures (x86) - HAVE_KVM_DIRTY_RING_ACQ_REL for weakly ordered architectures (arm64) Suggested-by: Paolo Bonzini Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-3-maz@kernel.org commit 8929bc9659640f35dd2ef8373263cbd885b4a072 Author: Marc Zyngier Date: Mon Sep 26 15:51:15 2022 +0100 KVM: Use acquire/release semantics when accessing dirty ring GFN state The current implementation of the dirty ring has an implicit requirement that stores to the dirty ring from userspace must be: - be ordered with one another - visible from another CPU executing a ring reset While these implicit requirements work well for x86 (and any other TSO-like architecture), they do not work for more relaxed architectures such as arm64 where stores to different addresses can be freely reordered, and loads from these addresses not observing writes from another CPU unless the required barriers (or acquire/release semantics) are used. In order to start fixing this, upgrade the ring reset accesses: - the kvm_dirty_gfn_harvested() helper now uses acquire semantics so it is ordered after all previous writes, including that from userspace - the kvm_dirty_gfn_set_invalid() helper now uses release semantics so that the next_slot and next_offset reads don't drift past the entry invalidation This is only a partial fix as the userspace side also need upgrading. Signed-off-by: Marc Zyngier Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20220926145120.27974-2-maz@kernel.org commit 05a940656e1eb2026d9ee31019d5b47e9545124d Author: Kees Cook Date: Fri Sep 23 13:28:08 2022 -0700 slab: Introduce kmalloc_size_roundup() In the effort to help the compiler reason about buffer sizes, the __alloc_size attribute was added to allocators. This improves the scope of the compiler's ability to apply CONFIG_UBSAN_BOUNDS and (in the near future) CONFIG_FORTIFY_SOURCE. For most allocations, this works well, as the vast majority of callers are not expecting to use more memory than what they asked for. There is, however, one common exception to this: anticipatory resizing of kmalloc allocations. These cases all use ksize() to determine the actual bucket size of a given allocation (e.g. 128 when 126 was asked for). This comes in two styles in the kernel: 1) An allocation has been determined to be too small, and needs to be resized. Instead of the caller choosing its own next best size, it wants to minimize the number of calls to krealloc(), so it just uses ksize() plus some additional bytes, forcing the realloc into the next bucket size, from which it can learn how large it is now. For example: data = krealloc(data, ksize(data) + 1, gfp); data_len = ksize(data); 2) The minimum size of an allocation is calculated, but since it may grow in the future, just use all the space available in the chosen bucket immediately, to avoid needing to reallocate later. A good example of this is skbuff's allocators: data = kmalloc_reserve(size, gfp_mask, node, &pfmemalloc); ... /* kmalloc(size) might give us more room than requested. * Put skb_shared_info exactly at the end of allocated zone, * to allow max possible filling before reallocation. */ osize = ksize(data); size = SKB_WITH_OVERHEAD(osize); In both cases, the "how much was actually allocated?" question is answered _after_ the allocation, where the compiler hinting is not in an easy place to make the association any more. This mismatch between the compiler's view of the buffer length and the code's intention about how much it is going to actually use has already caused problems[1]. It is possible to fix this by reordering the use of the "actual size" information. We can serve the needs of users of ksize() and still have accurate buffer length hinting for the compiler by doing the bucket size calculation _before_ the allocation. Code can instead ask "how large an allocation would I get for a given size?". Introduce kmalloc_size_roundup(), to serve this function so we can start replacing the "anticipatory resizing" uses of ksize(). [1] https://github.com/ClangBuiltLinux/linux/issues/1599 https://github.com/KSPP/linux/issues/183 [ vbabka@suse.cz: add SLOB version ] Cc: Vlastimil Babka Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: linux-mm@kvack.org Signed-off-by: Kees Cook Signed-off-by: Vlastimil Babka commit 9ed9cac1850a2a55674b4a17100c50b46f645921 Author: Kees Cook Date: Fri Sep 23 13:28:07 2022 -0700 slab: Remove __malloc attribute from realloc functions The __malloc attribute should not be applied to "realloc" functions, as the returned pointer may alias the storage of the prior pointer. Instead of splitting __malloc from __alloc_size, which would be a huge amount of churn, just create __realloc_size for the few cases where it is needed. Thanks to Geert Uytterhoeven for reporting build failures with gcc-8 in earlier version which tried to remove the #ifdef. While the "alloc_size" attribute is available on all GCC versions, I forgot that it gets disabled explicitly by the kernel in GCC < 9.1 due to misbehaviors. Add a note to the compiler_attributes.h entry for it. Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: Vlastimil Babka Cc: Roman Gushchin Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Marco Elver Cc: linux-mm@kvack.org Signed-off-by: Kees Cook Signed-off-by: Vlastimil Babka commit 0e9804cff18223e750f3af52a2701945bb362f55 Author: Yang Yingliang Date: Tue Sep 27 23:14:06 2022 +0800 ethernet: 8390: remove unnecessary check of mem The 'mem' returned by platform_get_resource() has been checked in probe function, so it is no need do this check in remove function. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927151406.797800-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni commit d49e265b66d9cf1537e93c44e189110f87cb656d Author: Shang XiaoJing Date: Tue Sep 27 22:18:35 2022 +0800 nfp: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing Reviewed-by: Simon Horman Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20220927141835.19221-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni commit 8bb7ff12a91429eb76e093b517ae810b146448fe Author: Pali Rohár Date: Wed Sep 28 14:19:11 2022 +0200 PCI: tegra: Use PCI_CONF1_EXT_ADDRESS() macro Simplify pci-tegra.c driver code and use new PCI_CONF1_EXT_ADDRESS() macro for accessing PCI config space. Link: https://lore.kernel.org/r/20220928121911.14994-1-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding commit 0e4d9a5cc7670d59e73cc372263a7417330aa56f Author: Johan Hovold Date: Wed Sep 28 17:54:21 2022 +0200 PCI: qcom: Rename host-init error label Use a more descriptive name for the reset host-init error label for consistency. Link: https://lore.kernel.org/r/20220928155421.21660-3-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi commit b623023225abed7a7d76cf1cc9f7187c1a3e7cff Author: Johan Hovold Date: Wed Sep 28 17:54:20 2022 +0200 PCI: qcom: Drop unused post_deinit callback Drop the unused and confusingly named post_deinit callback that was added for the now removed pipe clock handling. If ever needed we can add back a callback named pre_deinit (or perhaps rather pre_phy_power_off) instead. Link: https://lore.kernel.org/r/20220928155421.21660-2-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi commit 4b83ddc0924752ebb5f99e84e00d1cb725a9aa51 Author: Zeng Heng Date: Thu Sep 29 11:12:00 2022 +0800 RDMA/usnic: fix set-but-not-unused variable 'flags' warning Remove unused local variable 'flag' without any logic changes. Fixes: e3cf00d0a87f ("IB/usnic: Add Cisco VIC low-level hardware driver") Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20220929031200.4060891-1-zengheng4@huawei.com Signed-off-by: Leon Romanovsky commit 01c617d73f840c097d1db4c367c6b4044edfc827 Author: Yuan Can Date: Tue Sep 27 13:39:40 2022 +0000 net: liquidio: Remove unused struct lio_trusted_vf_ctx After commit 6870957ed5bc("liquidio: make soft command calls synchronous"), no one use struct lio_trusted_vf_ctx, so remove it. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220927133940.104181-1-yuancan@huawei.com Signed-off-by: Paolo Abeni commit 43b233b1582de501e441deb7c4ed1f944e60b1f9 Author: Wei-Lin Chang Date: Thu Sep 29 12:28:39 2022 +0800 KVM: arm64: Fix comment typo in nvhe/switch.c Fix the comment of __hyp_vgic_restore_state() from saying VEH to VHE, also change the underscore to a dash to match the comment above __hyp_vgic_save_state(). Signed-off-by: Wei-Lin Chang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220929042839.24277-1-r09922117@csie.ntu.edu.tw commit 1a0c667ea8e34edbad27f9c7f435e4825fab2163 Author: Liu Shixin Date: Tue Sep 27 19:19:25 2022 +0800 net: ethernet: mtk_eth_soc: use DEFINE_SHOW_ATTRIBUTE to simplify code Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin Link: https://lore.kernel.org/r/20220927111925.2424100-1-liushixin2@huawei.com Signed-off-by: Paolo Abeni commit d1083fd04302a95bc4dcf1c059537da87b39bd9a Author: Yuan Can Date: Wed Sep 28 01:47:47 2022 +0000 dmaengine: idxd: Remove unused struct idxd_fault Since fault processing code has been removed, struct idxd_fault is not used any more and can be removed as well. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220928014747.106808-1-yuancan@huawei.com Signed-off-by: Vinod Koul commit 6db239f01abc7e04a9bc2a0c59c1db1c1ebf9eb3 Author: Shang XiaoJing Date: Tue Sep 27 10:45:11 2022 +0800 wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927024511.14665-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni commit 225f6e1bc151978041595c7d2acaded3aac41f54 Author: Takashi Iwai Date: Thu Sep 29 08:14:55 2022 +0200 ALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model HP Zbook Firefly 14 G9 model (103c:8abb) requires yet another binding with CS35L41 codec, but with a slightly different configuration. It's over spi1 instead of spi0. Create a new fixup entry for that. Cc: Link: https://lore.kernel.org/r/20220929061455.13355-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 85e69a7dd693667b3e3114713d61edef7552ca88 Author: Shang XiaoJing Date: Tue Sep 27 10:30:43 2022 +0800 net: ax88796c: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927023043.17769-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni commit 612fcfdd1a7ccb1968052250f2622de0bdcd513b Author: Geert Uytterhoeven Date: Mon Sep 26 17:03:24 2022 +0200 dt-bindings: renesas,rcar-dmac: Add r8a779g0 support Document support for the Direct Memory Access Controllers (DMAC) in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/0a4d40092a51345003742725aea512a815d27e89.1664204526.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit de5819b994893197c71c86d21af10f85f50d6499 Author: Jerry Snitselaar Date: Wed Sep 28 08:48:56 2022 -0700 dmaengine: idxd: track enabled workqueues in bitmap Now that idxd_wq_disable_cleanup() sets the workqueue state to IDXD_WQ_DISABLED, use a bitmap to track which workqueues have been enabled. This will then be used to determine which workqueues should be re-enabled when attempting a software reset to recover from a device halt state. Cc: Fenghua Yu Cc: Dave Jiang Cc: Vinod Koul Signed-off-by: Jerry Snitselaar Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20220928154856.623545-3-jsnitsel@redhat.com Signed-off-by: Vinod Koul commit 8e527aac055557897d43a3d74d7970ef5cf6a8bb Author: Jerry Snitselaar Date: Wed Sep 28 08:48:55 2022 -0700 dmaengine: idxd: Set wq state to disabled in idxd_wq_disable_cleanup() If we are calling idxd_wq_disable_cleanup(), the workqueue should be in a disabled state. So set the workqueue state to IDXD_WQ_DISABLED so that the state reflects that. Currently if there is a device failure, and a software reset is attempted the workqueues will not be re-enabled due to idxd_wq_enable() seeing that state as already being IDXD_WQ_ENABLED. Cc: Fenghua Yu Cc: Dave Jiang Cc: Vinod Koul Signed-off-by: Jerry Snitselaar Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20220928154856.623545-2-jsnitsel@redhat.com Signed-off-by: Vinod Koul commit 1469327bb3dd04c0c84692e9af930bdd3f7b4230 Author: Shang XiaoJing Date: Tue Sep 27 10:28:02 2022 +0800 ethernet: s2io: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Drop the tmp variable that is not needed any more. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927022802.16050-1-shangxiaojing@huawei.com Signed-off-by: Paolo Abeni commit 5c43442fee2d37881eb4c3781409ad9508685df8 Author: Shaomin Deng Date: Tue Aug 30 11:07:08 2022 -0400 dmaengine: pl08x: Fix double word Fix the double word "many" in comments. Signed-off-by: Shaomin Deng Link: https://lore.kernel.org/r/20220830150708.24507-1-dengshaomin@cdjrlc.com Signed-off-by: Vinod Koul commit d7873903cc6bb681138c263a1648d23a71dafbd2 Author: Shaomin Deng Date: Thu Aug 25 10:45:45 2022 -0400 dmaengine: virt-dma: Fix double word in comments Delete the double word "many" in comments. Signed-off-by: Shaomin Deng Link: https://lore.kernel.org/r/20220825144545.3528-1-dengshaomin@cdjrlc.com Signed-off-by: Vinod Koul commit c10a7777dd30e36a0105055cc393aad7c35a9713 Author: Tuo Cao <91tuocao@gmail.com> Date: Sun Aug 14 21:13:23 2022 +0800 dmaengine: qcom: gpi: move read_lock_bh to read_lock in tasklet it is unnecessary to call read_lock_bh in a tasklet. Signed-off-by: Tuo Cao <91tuocao@gmail.com> Link: https://lore.kernel.org/r/20220814131323.7029-1-91tuocao@gmail.com Signed-off-by: Vinod Koul commit 26696d4657167112a1079f86cba1739765c1360e Author: Dario Binacchi Date: Wed Sep 21 19:05:56 2022 +0200 dmaengine: mxs: use platform_driver_register Driver registration fails on SOC imx8mn as its supplier, the clock control module, is probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clock not being available at that time. This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when the clock control module will be available. The __init annotation has been dropped because it is not compatible with deferred probing. The code is not executed once and its memory cannot be freed. Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi Acked-by: Sascha Hauer Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220921170556.1055962-1-dario.binacchi@amarulasolutions.com Signed-off-by: Vinod Koul commit 74157538a17879e77a8540e5e6503c98a1509109 Author: Richard Acayan Date: Wed Sep 21 22:46:55 2022 -0400 dt-bindings: phy: qcom,qusb2: document sdm670 compatible The Snapdragon 670 uses the QUSB driver for USB 2.0. Document the compatible used in the device tree. Signed-off-by: Richard Acayan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220922024656.178529-2-mailingradian@gmail.com Signed-off-by: Vinod Koul commit 0a40891b83f257b25a2b983758f72f6813f361cb Author: Dmitry Baryshkov Date: Mon Sep 26 20:25:14 2022 +0300 phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY On SDM845 one of PCIe PHYs (the QHP one) has the same region for TX and RX registers. Since the commit 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral") added checking that resources are not allocated beforehand, this PHY can not be probed anymore. Fix this by skipping the map of ->rx resource on the QHP PHY and assign it manually. Fixes: 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral") Signed-off-by: Dmitry Baryshkov Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20220926172514.880776-1-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 2fc6de5c6924aea5e84d2edaa40ed744f0720844 Author: Bitterblue Smith Date: Sun Sep 18 15:47:05 2022 +0300 wifi: rtl8xxxu: Improve rtl8xxxu_queue_select Remove the unused ieee80211_hw* parameter, and pass ieee80211_hdr* instead of relying on skb->data having the right value at the time the function is called. This doesn't change the functionality at all. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith Acked-by: Jes Sorensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/2af44c28-1c12-46b9-85b9-011560bf7f7e@gmail.com commit 5574d3290449916397f3092dcd2bac92415498e1 Author: Bitterblue Smith Date: Sun Sep 18 15:42:25 2022 +0300 wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM ieee80211_tx_queue_params.aifs is not supposed to be written directly to the REG_EDCA_*_PARAM registers. Instead process it like the vendor drivers do. It's kinda hacky but it works. This change boosts the download speed and makes it more stable. Tested with RTL8188FU but all the other supported chips should also benefit. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith Acked-by: Jes Sorensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/038cc03f-3567-77ba-a7bd-c4930e3b2fad@gmail.com commit a8b5aef2cca15b7fa533421d462e4e0a3429bd6f Author: Bitterblue Smith Date: Sun Sep 18 15:40:56 2022 +0300 wifi: rtl8xxxu: gen2: Enable 40 MHz channel width The module parameter ht40_2g was supposed to enable 40 MHz operation, but it didn't. Tell the firmware about the channel width when updating the rate mask. This makes it work with my gen 2 chip RTL8188FU. I'm not sure if anything needs to be done for the gen 1 chips, if 40 MHz channel width already works or not. They update the rate mask with a different structure which doesn't have a field for the channel width. Also set the channel width correctly for sta_statistics. Fixes: f653e69009c6 ("rtl8xxxu: Implement basic 8723b specific update_rate_mask() function") Fixes: bd917b3d28c9 ("rtl8xxxu: fill up txrate info for gen1 chips") Signed-off-by: Bitterblue Smith Acked-by: Jes Sorensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/3a950997-7580-8a6b-97a0-e0a81a135456@gmail.com commit 37d40a21473fdf1d0194089eb259b8ceeec2a4b9 Author: Aurelien Jarno Date: Tue Sep 27 07:17:52 2022 +0200 phy: rockchip-snps-pcie3: only look for rockchip,pipe-grf on rk3588 The rockchip,pipe-grf property is only used on rk3588, but not on rk3568. Therefore this property is not present on rk3568 devices, leading to the following message: rockchip-snps-pcie3-phy fe8c0000.phy: failed to find rockchip,pipe_grf regmap Fix that by only looking for this property on rk3588. Fixes: 2e9bffc4f713d ("phy: rockchip: Support PCIe v3") Signed-off-by: Aurelien Jarno Link: https://lore.kernel.org/r/20220927051752.53089-1-aurelien@aurel32.net Signed-off-by: Vinod Koul commit 2d6bd853cabc40f9fa7bf48edaa728e19f335e48 Author: Yuan Can Date: Wed Sep 28 08:48:33 2022 +0000 ALSA: asihpi - Remove unused struct hpi_subsys_response After commit 3285ea10e9b0("ALSA: asihpi - Interrelated HPI tidy up."), struct hpi_subsys_response is not used any more and can be removed as well. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220928084833.61131-1-yuancan@huawei.com Signed-off-by: Takashi Iwai commit eefe77fdc0de86480f5dbb6bc721396d82d095d3 Author: Shang XiaoJing Date: Tue Sep 27 22:11:10 2022 +0800 ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927141110.18033-1-shangxiaojing@huawei.com Signed-off-by: Takashi Iwai commit 03b756d293484057b4248695345f4344b174af00 Author: Wayne Chang Date: Wed Sep 28 20:56:40 2022 +0800 phy: tegra: xusb: Enable usb role switch attribute This patch enables the usb-role-switch attribute and lets users check the current device role of the otg capability ports Signed-off-by: Wayne Chang Signed-off-by: Haotien Hsu Link: https://lore.kernel.org/r/20220928125640.2219402-1-haotienh@nvidia.com Signed-off-by: Vinod Koul commit 84513eccd67804c02a0c42017bc7eaa4ad112478 Author: Chunfeng Yun Date: Wed Sep 28 15:07:46 2022 +0800 phy: mediatek: fix build warning of FIELD_PREP() Change the inline function mtk_phy_update_field() into a macro to avoid check warning of FIELD_PREP() with compiler parameter -Wtautological-constant-out-of-range-compare the warning is caused by mask check: "BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \" Fixes: 29c07477556e ("phy: mediatek: add a new helper to update bitfield") Reported-by: kernel test robot Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220928070746.5393-1-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 28b5dbd5dcf7659f64713c66eb7301924e070bf8 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:34 2022 +0200 xfrm: mip6: add extack to mip6_destopt_init_state, mip6_rthdr_init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 6ee55320520e31f5dae637e928d5792352b22776 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:33 2022 +0200 xfrm: ipcomp: add extack to ipcomp{4,6}_init_state And the shared helper ipcomp_init_state. Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 25ec92cd042ace0c109c3f6e5e6b634073414cc0 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:32 2022 +0200 xfrm: tunnel: add extack to ipip_init_state, xfrm6_tunnel_init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 67c44f93c951937b80735ada68f2de25885d1834 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:31 2022 +0200 xfrm: esp: add extack to esp_init_state, esp6_init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit ef87a4f84b10187a1db8aee95ed5b863474750c1 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:30 2022 +0200 xfrm: ah: add extack to ah_init_state, ah6_init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit e1e10b44cf284248fb099681f48cc723564a1cc8 Author: Sabrina Dubroca Date: Tue Sep 27 17:45:29 2022 +0200 xfrm: pass extack down to xfrm_type ->init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 99f3a5e851e9a1d82d73c4f396c6dbf123413c16 Author: Chen-Yu Tsai Date: Mon Sep 26 18:25:22 2022 +0800 clk: mediatek: mt8192: deduplicate parent clock lists Some groups of clocks of the same type share the same list of parents. These lists were declared separately for each clock in older drivers, bloating the code. Merge some obvious duplicate parent clock lists in the MT8192 clock driver together to reduce the code size. These include: - apll_i2s*_m_parents into one as apll_i2s_m_parents - img1_parents & img2_parents into one as img_parents - msdc30_*_parents into one as msdc30_parents - camtg*_parents into cam_tg_parents - seninf*_parents into seninf_parents Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220926102523.2367530-6-wenst@chromium.org Signed-off-by: Chen-Yu Tsai commit fef14676fc4be40b8441745a3c96b7e7d7d8592d Author: Chen-Yu Tsai Date: Mon Sep 26 18:25:19 2022 +0800 clk: mediatek: Migrate remaining clk_unregister_*() to clk_hw_unregister_*() During the previous |struct clk| to |struct clk_hw| clk provider API migration in commit 6f691a586296 ("clk: mediatek: Switch to clk_hw provider APIs"), a few clk_unregister_*() calls were missed. Migrate the remaining ones to the |struct clk_hw| provider API, i.e. change clk_unregister_*() to clk_hw_unregister_*(). Fixes: 6f691a586296 ("clk: mediatek: Switch to clk_hw provider APIs") Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220926102523.2367530-3-wenst@chromium.org Signed-off-by: Chen-Yu Tsai commit 20f7a0dba9075fb0e3d645495bc24d7025b58de1 Author: Chen-Yu Tsai Date: Mon Sep 26 18:25:18 2022 +0800 clk: mediatek: fix unregister function in mtk_clk_register_dividers cleanup When the cleanup paths for the various clk register APIs in the MediaTek clk library were added, the one in the dividers type used the wrong type of unregister function. This would result in incorrect dereferencing of the clk pointer and freeing of invalid pointers. Fix this by switching to the correct type of clk unregistration call. Fixes: 3c3ba2ab0226 ("clk: mediatek: mtk: Implement error handling in register APIs") Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220926102523.2367530-2-wenst@chromium.org Signed-off-by: Chen-Yu Tsai commit 116151bd95d5050581c8f77be7fe91f0cedfb32a Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:28 2022 +0200 clk: mediatek: clk-mt8192: Add clock mux notifier for mfg_pll_sel Following the changes that were done for mt8183, add a clock notifier for the GPU PLL selector mux: this allows safe clock rate changes by temporarily reparenting the GPU to a safe clock (clk26m) while the MFGPLL is reprogrammed and stabilizes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-11-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 341d2035fac07d710e1035f9922d97d96ddfa295 Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:27 2022 +0200 clk: mediatek: clk-mt8192-mfg: Propagate rate changes to parent Following what was done on MT8183 and MT8195, also propagate the rate changes to MFG_BG3D's parent on MT8192 to allow for proper GPU DVFS. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-10-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 72d38ed720e97e0e5fe2ee48b3e5ba573dba193d Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:26 2022 +0200 clk: mediatek: clk-mt8195-topckgen: Drop univplls from mfg mux parents These PLLs are conflicting with GPU rates that can be generated by the GPU-dedicated MFGPLL and would require a special clock handler to be used, for very little and ignorable power consumption benefits. Also, we're in any case unable to set the rate of these PLLs to something else that is sensible for this task, so simply drop them: this will make the GPU to be clocked exclusively from MFGPLL for "fast" rates, while still achieving the right "safe" rate during PLL frequency locking. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-9-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit f8fd4b550caca0413f958a0788ee1c0e215596ce Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:25 2022 +0200 clk: mediatek: clk-mt8195-topckgen: Add GPU clock mux notifier Following the changes done to MT8183, register a similar notifier for MT8195 as well, allowing safe clockrate updates for the MFGPLL. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220927101128.44758-8-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit deeb2af77cf6bae26a51b70ba3a1ba968981a14a Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:24 2022 +0200 clk: mediatek: clk-mt8195-topckgen: Register mfg_ck_fast_ref as generic mux This clock was being registered as clk-composite through the helpers for the same in the MediaTek clock APIs but, in reality, this isn't a composite clock. Appropriately register this clock with devm_clk_hw_register_mux(). No functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-7-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit a5f7bf5458c2cf6730106e16a6373638a0e5ed1e Author: AngeloGioacchino Del Regno Date: Tue Sep 27 12:11:23 2022 +0200 clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes The MFG_BG3D is a gate to enable/disable clock output to the GPU, but the actual output is decided by multiple muxes; in particular: mfg_ck_fast_ref muxes between "slow" (top_mfg_core_tmp) and "fast" (MFGPLL) clock, while top_mfg_core_tmp muxes between the 26MHz clock and various system PLLs. The clock gate comes after all the muxes, so its parent is mfg_ck_fast_reg, not top_mfg_core_tmp. Reparent MFG_BG3D to the latter to match the hardware and add the CLK_SET_RATE_PARENT flag to it: this way we ensure propagating rate changes that are requested on MFG_BG3D along its entire clock tree. Fixes: 35016f10c0e5 ("clk: mediatek: Add MT8195 mfgcfg clock support") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-6-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit ae333e63a2474a8277c9c34709615a40e46d2bb8 Author: Chen-Yu Tsai Date: Tue Sep 27 12:11:22 2022 +0200 clk: mediatek: mt8183: Add clk mux notifier for MFG mux When the MFG PLL clock, which is upstream of the MFG clock, is changed, the downstream clock and consumers need to be switched away from the PLL over to a stable clock to avoid glitches. This is done through the use of the newly added clk mux notifier. The notifier is set on the mux itself instead of the upstream PLL, but in practice this works, as the rate change notifitcations are propogated throughout the sub-tree hanging off the PLL. Just before rate changes, the MFG mux is temporarily and transparently switched to the 26 MHz main crystal. After the rate change, the mux is switched back. Signed-off-by: Chen-Yu Tsai [Angelo: Rebased to assign clk_ops in mtk_mux_nb] Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220927101128.44758-5-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit b66add7a74e84a915dc8e1da89e192751e74bb4c Author: Chen-Yu Tsai Date: Tue Sep 27 12:11:21 2022 +0200 clk: mediatek: mux: add clk notifier functions With device frequency scaling, the mux clock that (indirectly) feeds the device selects between a dedicated PLL, and some other stable clocks. When a clk rate change is requested, the (normally) upstream PLL is reconfigured. It's possible for the clock output of the PLL to become unstable during this process. To avoid causing the device to glitch, the mux should temporarily be switched over to another "stable" clock during the PLL rate change. This is done with clk notifiers. This patch adds common functions for notifiers to temporarily and transparently reparent mux clocks. This was loosely based on commit 8adfb08605a9 ("clk: sunxi-ng: mux: Add clk notifier functions"). Signed-off-by: Chen-Yu Tsai [Angelo: Changed mtk_mux_nb to hold a pointer to clk_ops instead of mtk_mux] Co-developed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220927101128.44758-4-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 9f94f545f258b15bfa6357eb62e1e307b712851e Author: Chen-Yu Tsai Date: Tue Sep 27 12:11:20 2022 +0200 clk: mediatek: mt8183: mfgcfg: Propagate rate changes to parent The only clock in the MT8183 MFGCFG block feeds the GPU. Propagate its rate change requests to its parent, so that DVFS for the GPU can work properly. Fixes: acddfc2c261b ("clk: mediatek: Add MT8183 clock support") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220927101128.44758-3-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit ceed40d79956d6e40882a8b4fa34a2f91ac2513a Merge: 0d5bfebf74019 997ce6affe264 Author: Jakub Kicinski Date: Wed Sep 28 19:30:21 2022 -0700 Merge tag 'mlx5-updates-2022-09-27' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-09-27 This is Part #1 of 4 parts series to align mlx5's implementation of XSK (AF_XDP) RX-Qs indexing and management with other vendors: Maxim Says: =========== xsk: Bug fixes for frame mapping on striding RQ Striding RQ relies on the driver mapping RX buffers into the NIC's virtual memory space. Currently, regadless of the XSK frame size, mlx5e maps them using MTT, and each mapping's length is PAGE_SIZE. As the result, the stride size used by striding RQ is also equal to PAGE_SIZE. This decision has the following issues: 1. In the XSK aligned mode with frame size smaller than PAGE_SIZE, it's suboptimal. Using 2K strides and 2K pages allows to post twice as fewer WQEs. 2. MTT is not suitable for unaligned frames, as it requires natural alignment theoretically, in practice at least 8-byte alignment. 3. Using mapping and stride bigger than the frame has risk of writing over the bounds of the XSK frame upon receiving packets bigger than MTU, which is possible in some specific configurations. This series addresses issues 1 and 2 and alleviates issue 3. Where possible, page and stride size will match the XSK frame size (firmware upgrade may be needed to have effect for 2K frames). Unaligned mode will use KSM instead of MTT, which allows to drop the partial workaround [1]. [1]: https://lore.kernel.org/netdev/YufYFQ6JN91lQbso@boxer/T/ ==================== Link: https://lore.kernel.org/r/20220927203611.244301-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 997ce6affe264e80c2fd1ab6f09d22c00d7bfa38 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:11 2022 -0700 net/mlx5e: Use runtime values of striding RQ parameters in datapath Some of the parameters of striding RQ are compile-time constants, but they are going to become dynamically calculated at runtime in a following commit. This commit prepares the datapath to take cached runtime parameters, prefilled at queue creation. New fields added to struct mlx5e_rq fit into an existing 7-byte hole. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 258e655c00734d2e4b5fd8ee2827f76cd0fe39c4 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:10 2022 -0700 net/mlx5e: Make dma_info array dynamic in struct mlx5e_mpw_info This commit moves the dma_info array to the end of struct mlx5e_mpw_info to make it a flexible array. It also removes the intermediate struct mlx5e_umr_dma_info, which used to contain only this array. The flexibility of dma_info will allow to choose its size dynamically in a following commit. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 3904d2afad4ccf9ec7dbe9b7096ee5f9acde3a00 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:09 2022 -0700 net/mlx5e: Improve the MTU change shortcut Normally, the MTU change requires reopening the channels, but it can be skipped if the new MTU doesn't change any of the queue parameters and if MTU is not used in the data path. The shortcut is applicable to the non-linear mode of striding RQ, because the only thing affected by MTU is the queue length. As ethtool sets the queue length in packets, but striding RQ length is defined in strides or bytes, we estimate the RQ length to be at least as big as the requested number of MTU-sized packets, that's why it depends on MTU. Improve the shortcut by actually checking whether the RQ length stayed the same, instead of an intermediate step in the calculation. As MTU also affects the SHAMPO parameters, skip the shortcut if SHAMPO is in use. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 411295fbe6f4643b7fed30c27542af7d752f8e16 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:08 2022 -0700 net/mlx5e: xsk: Fix SKB headroom calculation in validation In a typical scenario, if an XSK socket is opened first, then an XDP program is attached, mlx5e_validate_xsk_param will be called twice: first on XSK bind, second on channel restart caused by enabling XDP. The validation includes a call to mlx5e_rx_is_linear_skb, which checks the presence of the XDP program. The above means that mlx5e_rx_is_linear_skb might return true the first time, but false the second time, as mlx5e_rx_get_linear_sz_skb's return value will increase, because of a different headroom used with XDP. As XSK RQs never exist without XDP, it would make sense to trick mlx5e_rx_get_linear_sz_skb into thinking XDP is enabled at the first check as well. This way, if MTU is too big, it would be detected on XSK bind, without giving false hope to the userspace application. However, it turns out that this check is too restrictive in the first place. SKBs created on XDP_PASS on XSK RQs don't have any headroom. That means that big MTUs filtered out on the first and the second checks might actually work. So, address this issue in the proper way, but taking into account the absence of the SKB headroom on XSK RQs, when calculating the buffer size. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 8c654a1bb686bf847aa00e0ea7a545b3a30a5e66 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:07 2022 -0700 net/mlx5e: xsk: Remove dead code in validation One of the checks in mlx5e_rx_is_linear_skb verifies that the RX buffer fits into the XSK frame size. Remove the duplicating check from mlx5e_validate_xsk_param. It allows to make mlx5e_rx_get_min_frag_sz static. Remove mlx5e_rx_is_xdp altogether, as its only usage is located in a branch where xsk == NULL. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit ddbef365607216ddea9c515f54aab97a3b48f1b1 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:06 2022 -0700 net/mlx5e: Simplify stride size calculation for linear RQ Linear RX buffers must be big enough to fit the MTU-sized packet along with the headroom. On the other hand, they must be small enough to fit into a page (or into an XSK frame). A straightforward way to check whether the linear mode is possible would be comparing the required buffer size to PAGE_SIZE or XSK frame size. Stride size in the linear mode is defined by the following constraints: 1. A stride is at least as big as the buffer size, and it's a power of two. 2. If non-XSK XDP is enabled, the stride size is PAGE_SIZE, because mlx5e requires each packet to be in its own page when XDP is in use. The previous constraint is automatically fulfilled, because buffer size can't be bigger than PAGE_SIZE. 3. XSK uses stride size equal to PAGE_SIZE, but the following commits will allow it to use roundup_pow_of_two(XSK frame size), by allowing the NIC's MMU to use page sizes not equal to the CPU page size. This commit puts the above requirements and constraints straight to the code in an attempt to simplify it and to prepare it for changes made in the next patches. For the reference, the old code uses an equivalent, but trickier calculation (high-level simplified pseudocode): if XDP or XSK: mlx5e_rx_get_linear_frag_sz := max(buffer size, PAGE_SIZE) else: mlx5e_rx_get_linear_frag_sz := buffer size mlx5e_rx_is_linear_skb := mlx5e_rx_get_linear_frag_sz <= PAGE_SIZE stride size := roundup_pow_of_two(mlx5e_rx_get_linear_frag_sz) The new code effectively removes mlx5e_rx_get_linear_frag_sz that used to return either buffer size or stride size, depending on the situation, making it hard to work with and to make changes: if XDP or XSK: mlx5e_rx_get_linear_stride_sz := PAGE_SIZE else mlx5e_rx_get_linear_stride_sz := roundup_pow_of_two(buffer size) mlx5e_rx_is_linear_skb := buffer size <= (PAGE_SIZE or XSK frame sz) stride size := mlx5e_rx_get_linear_stride_sz Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 4c78782e2e98f117b1bc69eef17034d09a6ac127 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:05 2022 -0700 net/mlx5e: kTLS, Check ICOSQ WQE size in advance Instead of WARNing in runtime when TLS offload WQEs posted to ICOSQ are over the hardware limit, check their size before enabling TLS RX offload, and block the offload if the condition fails. It also allows to drop a u16 field from struct mlx5e_icosq. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 21a0502d59109792b830b476f73287573981a0dd Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:04 2022 -0700 net/mlx5e: Use the aligned max TX MPWQE size TX MPWQE size is limited to the cacheline-aligned maximum. Use the same value for the stop room and the capability check. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit e3c4c496dc9a44412bae6e1c5a9cf7fd0cdafba1 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:03 2022 -0700 net/mlx5e: Fix a typo in mlx5e_xdp_mpwqe_is_full Fix a typo in the function name: mpqwe -> mpwqe (stands for multi-packet work queue element). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 527918e9cc4d0578dbea7c67594050c2056bd2e4 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:02 2022 -0700 net/mlx5e: Use mlx5e_stop_room_for_max_wqe where appropriate mlx5e_alloc_xdpsq calculates sq->stop_room internally, but there is already a function for that: mlx5e_stop_room_for_max_wqe. This commit makes use of this function. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit ed5c92ff0f3e2e1a9b9b7bf1d14f96bf9ceebfb3 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:01 2022 -0700 net/mlx5e: Let mlx5e_get_sw_max_sq_mpw_wqebbs accept mdev To shorten and simplify code, let mlx5e_get_sw_max_sq_mpw_wqebbs accept mdev and derive max SQ WQEBBs from it. Also rename the function to a more generic name mlx5e_get_max_sq_aligned_wqebbs, because the following patches will use it in non-MPWQE contexts. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 44f4fd03b51705ce8af54c103c9af55926c5d950 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:36:00 2022 -0700 net/mlx5e: Validate striding RQ before enabling XDP Currently, the driver can silently fall back to legacy RQ after enabling XDP, even if striding RQ was active before. It happens when PAGE_SIZE is bigger than the maximum supported stride size. This commit changes this behavior to more straightforward: if an operation (enabling XDP) doesn't support the current parameters (striding RQ mode), it fails. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 7e49abb1e393c3fe741bd47462f5c1f5d714ec24 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:35:59 2022 -0700 net/mlx5e: Make mlx5e_verify_rx_mpwqe_strides static mlx5e_verify_rx_mpwqe_strides is only used in en/params.c, so it can be made static and removed from en/params.h. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 665f29de4ca31e65487fd63bac38e80a76142df1 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:35:58 2022 -0700 net/mlx5e: Remove unused fields from datapath structs No need to keep max_sq_wqebbs in mlx5e_txqsq and mlx5e_xdpsq, as it's only used when allocating the queues. Removing an extra field reduces the struct size. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit f060ccc2afaa099a6bb86e5ec89efbaea5dd2ecf Author: Maxim Mikityanskiy Date: Tue Sep 27 13:35:57 2022 -0700 net/mlx5e: Convert mlx5e_get_max_sq_wqebbs to u8 The return value of mlx5e_get_max_sq_wqebbs is clamped down to MLX5_SEND_WQE_MAX_WQEBBS = 16, which fits into u8. This commit changes the return type of this function to u8 for stricter type safety. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 40b72108f9c609c5043903efb70c52d46b8aa871 Author: Maxim Mikityanskiy Date: Tue Sep 27 13:35:56 2022 -0700 net/mlx5: Add the log_min_mkey_entity_size capability Add the capability that will allow the driver to determine the minimal MTT page size to be able to map the smallest possible pages in XSK. The older firmwares that don't have this capability default to 12 (i.e. 4096-byte pages). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0d5bfebf74019deb9d3ce4fcfb55a39481590a4e Merge: d4ddeefa64ab3 9175d81037800 Author: Jakub Kicinski Date: Wed Sep 28 19:20:49 2022 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Saeed Mahameed says: ==================== updates from mlx5-next 2022-09-24 Updates form mlx5-next including[1]: 1) HW definitions and support for NPPS clock settings. 2) various cleanups 3) Enable hash mode by default for all NICs 4) page tracker and advanced virtualization HW definitions for vfio [1] https://lore.kernel.org/netdev/20220907233636.388475-1-saeed@kernel.org/ * 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Remove from FPGA IFC file not-needed definitions net/mlx5: Remove unused structs net/mlx5: Remove unused functions net/mlx5: detect and enable bypass port select flow table net/mlx5: Lag, enable hash mode by default for all NICs net/mlx5: Lag, set active ports if support bypass port select flow table RDMA/mlx5: Don't set tx affinity when lag is in hash mode net/mlx5: add IFC bits for bypassing port select flow table net/mlx5: Add support for NPPS with real time mode net/mlx5: Expose NPPS related registers net/mlx5: Query ADV_VIRTUALIZATION capabilities net/mlx5: Introduce ifc bits for page tracker RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib ==================== Link: https://lore.kernel.org/all/20220927201906.234015-1-saeed@kernel.org/ Signed-off-by: Jakub Kicinski commit d4ddeefa64ab36d211ff57a64d263c158e017581 Author: Sean Anderson Date: Tue Sep 27 20:41:57 2022 -0400 net: sunhme: Fix undersized zeroing of quattro->happy_meals Just use kzalloc instead. Fixes: d6f1e89bdbb8 ("sunhme: Return an ERR_PTR from quattro_pci_find") Reported-by: kernel test robot Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220928004157.279731-1-seanga2@gmail.com Signed-off-by: Jakub Kicinski commit f45892f750384433056cdb5601ef13ce9acbad76 Author: Shang XiaoJing Date: Tue Sep 27 10:32:54 2022 +0800 net: wwan: iosm: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing Reviewed-by: M Chetan Kumar Link: https://lore.kernel.org/r/20220927023254.30342-1-shangxiaojing@huawei.com Signed-off-by: Jakub Kicinski commit 8278ddb16156c4aafc53e26ad6b18a76e9b86c8a Merge: b48b89f9c189d 1109b97b61613 Author: Jakub Kicinski Date: Wed Sep 28 19:15:29 2022 -0700 Merge branch 'rework-resource-allocation-in-felix-dsa-driver' Vladimir Oltean says: ==================== Rework resource allocation in Felix DSA driver The Felix DSA driver controls NXP variations of Microchip switches. Colin Foster is trying to add support in this driver for "genuine" Microchip hardware, but some of the NXP-isms in this driver need to go away before that happens cleanly. https://patchwork.kernel.org/project/netdevbpf/cover/20220926002928.2744638-1-colin.foster@in-advantage.com/ The starting point was Colin's patch 08/14 "net: dsa: felix: update init_regmap to be string-based", and this continues to be the central theme here, but things are done differently. In short (full explanations are in patches), the goal is for MFD-based switches like Colin's SPI-controlled VSC7512 to be able to request a regmap that was created 100% externally (by drivers/mfd/ocelot-core.c) in a very simple way, that does not create dependencies on other modules. That is dev_get_regmap(), and as input it wants a string, for the resource name. So we rework the resource allocation in this driver to be based on string names provided by the specific instantiation (in Colin's case, ocelot_ext.c). Patch set was boot-tested on NXP LS1028A. ==================== Link: https://lore.kernel.org/r/20220927191521.1578084-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 1109b97b6161307cdd78e13b2c24cf2f7af4fe5b Author: Vladimir Oltean Date: Tue Sep 27 22:15:20 2022 +0300 net: dsa: felix: update regmap requests to be string-based Existing felix DSA drivers (vsc9959, vsc9953) are all switches that were integrated in NXP SoCs, which makes them a bit unusual compared to the usual Microchip branded Ocelot switches. To be precise, looking at Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml, one can see 21 memory regions for the "switch" node, and these correspond to the "targets" of the switch IP, which are spread throughout the guts of that SoC's memory space. In NXP integrations, those targets still exist, but they were condensed within a single memory region, with no other peripheral in between them, so it made more sense for the driver to ioremap the entire memory space of the switch, and then find the targets within that memory space via some offsets hardcoded in the driver. The effect of this design decision is that now, the felix driver expects hardware instantiations to provide their own resource definitions, which is kind of odd when considering a typical device (those are retrieved from 'reg' properties in the device tree, using platform_get_resource() or similar). Allow other hardware instantiations that share the felix driver to not provide a hardcoded array of resources in the future. Instead, make the common denominator based on which regmaps are created be just the resource "names". Each instantiation comes with its own array of names that are mandatory for it, and with an optional array of resources. So we split the resources in 2 arrays, one is what's requested and the other is what's provided. There is one pool of provided resources, in felix->info->resources (of length felix->info->num_resources). There are 2 different ways of requesting a resource. One is by enum ocelot_target (this handles the global regmaps), and one is by int port (this handles the per-port ones). For the existing vsc9959 and vsc9953, it would be a bit stupid to request something that's not provided, given that the 2 arrays are both defined in the same place. The advantage is that we can now modify felix_request_regmap_by_name() to make felix->info->resources[] optional, and if absent, the implementation can call dev_get_regmap() and this is something that is compatible with MFD. Co-developed-by: Colin Foster Signed-off-by: Colin Foster Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 044d447a801f2d0c03e153ef41835aebf66ca2d6 Author: Vladimir Oltean Date: Tue Sep 27 22:15:19 2022 +0300 net: dsa: felix: use DEFINE_RES_MEM_NAMED for resources Use less verbose resource definitions in vsc9959 and vsc9953. This also sets IORESOURCE_MEM in the constant array of resources, so we don't have to do this from felix_init_structs() - in fact, in the future, we may even support IORESOURCE_REG resources. Note that this macro takes start and length as argument, and we had start and end before. So transform end into length. While at it, sort the resources according to their offset. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 8f66c64bfca33fd863e2bf0f53d7774d0c9c6aba Author: Vladimir Oltean Date: Tue Sep 27 22:15:18 2022 +0300 net: dsa: felix: remove felix_info :: init_regmap It turns out that the idea of having a customizable implementation of a regmap creation from a resource is not exactly useful. The idea was for the new MFD-based VSC7512 driver to use something that creates a SPI regmap from a resource. But there are problems in actually getting those resources (it involves getting them from MFD). To avoid all that, we'll be getting resources by name, so this custom init_regmap() method won't be needed. Remove it. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 1382ba68a0535924f1bd0221dd373d44b6c57609 Author: Vladimir Oltean Date: Tue Sep 27 22:15:17 2022 +0300 net: dsa: felix: remove felix_info :: imdio_base This address is only relevant for the vsc9959, which is a PCIe device that holds its switch registers in a different PCIe BAR compared to the registers for the internal MDIO controller. Hide this aspect from the common felix driver and move the pci_resource_start() call to the only place that needs it, which is in vsc9959_mdio_bus_alloc(). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 5fc080de89f12b4415338c8d2ab58530c7706f3b Author: Vladimir Oltean Date: Tue Sep 27 22:15:16 2022 +0300 net: dsa: felix: remove felix_info :: imdio_res The imdio_res is used only by vsc9959, which references its own vsc9959_imdio_res through the common felix_info->imdio_res pointer. Since the common code doesn't care about this resource (and it can't be part of the common array of resources, either, because it belongs in a different PCI BAR), just reference it directly. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d Author: Jakub Kicinski Date: Tue Sep 27 06:27:53 2022 -0700 net: drop the weight argument from netif_napi_add We tell driver developers to always pass NAPI_POLL_WEIGHT as the weight to netif_napi_add(). This may be confusing to newcomers, drop the weight argument, those who really need to tweak the weight can use netif_napi_add_weight(). Acked-by: Marc Kleine-Budde # for CAN Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 5456262d2baa43c38e0c770543d5a31b0942f41c Author: Martin KaFai Lau Date: Mon Sep 26 17:25:44 2022 -0700 net: Fix incorrect address comparison when searching for a bind2 bucket The v6_rcv_saddr and rcv_saddr are inside a union in the 'struct inet_bind2_bucket'. When searching a bucket by following the bhash2 hashtable chain, eg. inet_bind2_bucket_match, it is only using the sk->sk_family and there is no way to check if the inet_bind2_bucket has a v6 or v4 address in the union. This leads to an uninit-value KMSAN report in [0] and also potentially incorrect matches. This patch fixes it by adding a family member to the inet_bind2_bucket and then tests 'sk->sk_family != tb->family' before matching the sk's address to the tb's address. Cc: Joanne Koong Fixes: 28044fc1d495 ("net: Add a bhash2 table hashed by port and address") Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Tested-by: Alexander Potapenko Link: https://lore.kernel.org/r/20220927002544.3381205-1-kafai@fb.com Signed-off-by: Jakub Kicinski commit 30b172ee56658b9c297c6d73f0a5c32ed1470dd0 Merge: 63a8bf85568b3 a42cf9d18278a Author: Jakub Kicinski Date: Wed Sep 28 18:52:11 2022 -0700 Merge branch 'mptcp-mptcp-support-for-tcp_fastopen_connect' Mat Martineau says: ==================== mptcp: MPTCP support for TCP_FASTOPEN_CONNECT RFC 8684 appendix B describes how to use TCP Fast Open with MPTCP. This series allows TFO use with MPTCP using the TCP_FASTOPEN_CONNECT socket option. The scope here is limited to the initiator of the connection - support for MSG_FASTOPEN and the listener side of the connection will be in a separate series. The preexisting TCP fastopen code does most of the work, so these changes mostly involve plumbing MPTCP through to those TCP functions. Patch 1 changes the MPTCP socket option code to pass the TCP_FASTOPEN_CONNECT option through to the initial unconnected subflow. Patch 2 exports the existing tcp_sendmsg_fastopen() function from tcp.c Patch 3 adds the call to tcp_sendmsg_fastopen() from the MPTCP send function. Patch 4 modifies mptcp_poll() to handle the deferred TFO connection. ==================== Link: https://lore.kernel.org/r/20220926232739.76317-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit a42cf9d18278a172ff2dcdf51b8772462d2fa5a5 Author: Benjamin Hesmans Date: Mon Sep 26 16:27:39 2022 -0700 mptcp: poll allow write call before actual connect If fastopen is used, poll must allow a first write that will trigger the SYN+data Similar to what is done in tcp_poll(). Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Benjamin Hesmans Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d98a82a6afc764156d6ca7a437d52761ac9b062e Author: Dmytro Shytyi Date: Mon Sep 26 16:27:38 2022 -0700 mptcp: handle defer connect in mptcp_sendmsg When TCP_FASTOPEN_CONNECT has been set on the socket before a connect, the defer flag is set and must be handled when sendmsg is called. This is similar to what is done in tcp_sendmsg_locked(). Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Co-developed-by: Benjamin Hesmans Signed-off-by: Benjamin Hesmans Signed-off-by: Dmytro Shytyi Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 3242abeb8da7071fa40d32346ed36343bee33b80 Author: Benjamin Hesmans Date: Mon Sep 26 16:27:37 2022 -0700 tcp: export tcp_sendmsg_fastopen It will be used to support TCP FastOpen with MPTCP in the following commit. Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Co-developed-by: Dmytro Shytyi Signed-off-by: Dmytro Shytyi Signed-off-by: Benjamin Hesmans Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 54635bd047019513288f3cd3192cc5490912bd8c Author: Benjamin Hesmans Date: Mon Sep 26 16:27:36 2022 -0700 mptcp: add TCP_FASTOPEN_CONNECT socket option Set the option for the first subflow only. For the other subflows TFO can't be used because a mapping would be needed to cover the data in the SYN. Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Benjamin Hesmans Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 63a8bf85568b30438431d4d78afb2fde4a280760 Author: Gustavo A. R. Silva Date: Mon Sep 26 18:02:20 2022 -0500 netns: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/225 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/YzIvfGXxfjdXmIS3@work Signed-off-by: Jakub Kicinski commit 578b054684e6ad46f6089b726c05054fc5e3cd74 Merge: 929a6cdfaeac9 e7d2b510165ff Author: Jakub Kicinski Date: Wed Sep 28 18:51:27 2022 -0700 Merge branch 'shrink-struct-ubuf_info' Pavel Begunkov says: ==================== shrink struct ubuf_info struct ubuf_info is large but not all fields are needed for all cases. We have limited space in io_uring for it and large ubuf_info prevents some struct embedding, even though we use only a subset of the fields. It's also not very clean trying to use this typeless extra space. Shrink struct ubuf_info to only necessary fields used in generic paths, namely ->callback, ->refcnt and ->flags, which take only 16 bytes. And make MSG_ZEROCOPY and some other users to embed it into a larger struct ubuf_info_msgzc mimicking the former ubuf_info. Note, xen/vhost may also have some cleaning on top by creating new structs containing ubuf_info but with proper types. ==================== Link: https://lore.kernel.org/r/cover.1663892211.git.asml.silence@gmail.com Signed-off-by: Jakub Kicinski commit e7d2b510165fff6bedc9cca88c071ad846850c74 Author: Pavel Begunkov Date: Fri Sep 23 17:39:04 2022 +0100 net: shrink struct ubuf_info We can benefit from a smaller struct ubuf_info, so leave only mandatory fields and let users to decide how they want to extend it. Convert MSG_ZEROCOPY to struct ubuf_info_msgzc and remove duplicated fields. This reduces the size from 48 bytes to just 16. Signed-off-by: Pavel Begunkov Acked-by: Paolo Abeni Signed-off-by: Jakub Kicinski commit dfff202be5ea884498beb9f60492053144dd4b3f Author: Pavel Begunkov Date: Fri Sep 23 17:39:03 2022 +0100 vhost/net: use struct ubuf_info_msgzc struct ubuf_info will be changed, use ubuf_info_msgzc instead. Signed-off-by: Pavel Begunkov Acked-by: Paolo Abeni Signed-off-by: Jakub Kicinski commit b63ca3e822e7ae71f65f83df68ce18155db28eea Author: Pavel Begunkov Date: Fri Sep 23 17:39:02 2022 +0100 xen/netback: use struct ubuf_info_msgzc struct ubuf_info will be changed, use ubuf_info_msgzc instead. Signed-off-by: Pavel Begunkov Acked-by: Paolo Abeni Signed-off-by: Jakub Kicinski commit 6eaab4dfdd30ea8fb0dd4ee04940676c12b728e8 Author: Pavel Begunkov Date: Fri Sep 23 17:39:01 2022 +0100 net: introduce struct ubuf_info_msgzc We're going to split struct ubuf_info and leave there only mandatory fields. Users are free to extend it. Add struct ubuf_info_msgzc, which will be an extended version for MSG_ZEROCOPY and some other users. It duplicates of struct ubuf_info for now and will be removed in a couple of patches. Signed-off-by: Pavel Begunkov Acked-by: Paolo Abeni Signed-off-by: Jakub Kicinski commit fe9d25b46bc744d73491fb68f1c322910dc70437 Author: Andi Kleen Date: Tue Sep 20 07:58:38 2022 +0200 clk: pistachio: Fix initconst confusion A variable pointing to const isn't const itself. It has to contain "const" keyword after "*" too. So to keep it in __initconst (and not mark properly as __initdata), add the "const" keyword exactly there. Note we need to update struct pistachio_mux too. On the other hand, the clk core already counts with "const char *const" already. [js] more explanatory commit message. Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: Martin Liska Signed-off-by: Andi Kleen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920055838.22637-1-jslaby@suse.cz Signed-off-by: Stephen Boyd commit fff1011a26d6cbf26b18c8ee4c61d99943174f8c Author: Nate Yocom Date: Wed Sep 28 18:23:49 2022 -0700 Input: xpad - add X-Box Adaptive Profile button Adds a new quirk for controllers that have a Profile button which has 4 states, reflected as an ABS_PROFILE axis with 4 values. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera Link: https://lore.kernel.org/r/20220908173930.28940-6-nate@yocom.org Signed-off-by: Dmitry Torokhov commit 1260cd04a601e0e02e09fa332111b8639611970d Author: Nate Yocom Date: Wed Sep 28 18:23:22 2022 -0700 Input: add ABS_PROFILE to uapi and documentation Define new ABS_PROFILE axis for input devices which need it, e.g. X-Box Adaptive Controller and X-Box Elite 2. Signed-off-by: Nate Yocom Link: https://lore.kernel.org/r/20220908173930.28940-4-nate@yocom.org Signed-off-by: Dmitry Torokhov commit f45aaae6204d1c7b0200ce043102ec84d805ac34 Author: Nate Yocom Date: Wed Sep 28 18:18:54 2022 -0700 Input: xpad - add X-Box Adaptive XBox button Adaptive controller sets 0x02 bit for this button, all others set 0x01 so presence of either is used for BTN_MODE. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera Reviewed-by: Mattijs Korpershoek commit d218fe04335183518009f29f3270ec4dde1b66a2 Author: Nate Yocom Date: Wed Sep 28 18:10:35 2022 -0700 Input: xpad - add X-Box Adaptive support Adds correct VID/PID for this XTYPE_XBOXONE compatible controller to xpad_device[] table. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220908173930.28940-2-nate@yocom.org Signed-off-by: Dmitry Torokhov commit 04360d3e05e885621a5860f987c6a8a2eac4bb27 Author: Pavel Begunkov Date: Thu Sep 29 01:03:29 2022 +0100 io_uring/net: fix non-zc send with address We're currently ignoring the dest address with non-zerocopy send because even though we copy it from the userspace shortly after ->msg_name gets zeroed. Move msghdr init earlier. Fixes: 516e82f0e043a ("io_uring/net: support non-zerocopy sendto") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/176ced5e8568aa5d300ca899b7f05b303ebc49fd.1664409532.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 13b0452ddaa3f7d840ee16fc92aa433392a56685 Author: Yuan Can Date: Tue Sep 27 13:39:31 2022 +0000 clk: clk-npcm7xx: Remove unused struct npcm7xx_clk_gate_data and npcm7xx_clk_div_fixed_data After commit 6a5898411159("clk: clk-npcm7xx: Remove unused static const tables 'npcm7xx_gates' and 'npcm7xx_divs_fx'"), no one use struct npcm7xx_clk_gate_data and struct npcm7xx_clk_div_fixed_data, so remove them. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220927133931.104060-1-yuancan@huawei.com Signed-off-by: Stephen Boyd commit 8526f0d6135f77451566463ace6f0fb8b72cedaa Merge: aa55dfd3783f0 1fddca3d36d1d Author: Andrii Nakryiko Date: Wed Sep 28 17:29:29 2022 -0700 Merge branch 'bpf/selftests: convert some tests to ASSERT_* macros' Wang Yufen says: ==================== Convert some tests to use the preferred ASSERT_* macros instead of the deprecated CHECK(). ==================== Signed-off-by: Andrii Nakryiko commit 1fddca3d36d1dc4a19a8060d20de1b77edfe63e0 Author: Wang Yufen Date: Mon Sep 26 13:12:11 2022 +0800 selftests/bpf: Convert udp_limit test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-12-git-send-email-wangyufen@huawei.com commit 9d0b05bdfbea25693cdd63c29aa12b982307d81e Author: Wang Yufen Date: Mon Sep 26 13:12:10 2022 +0800 selftests/bpf: Convert tcpbpf_user test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-11-git-send-email-wangyufen@huawei.com commit 8dda32ac58b622f4c1ec0edd4f6b12f84170fe01 Author: Wang Yufen Date: Mon Sep 26 13:12:09 2022 +0800 selftests/bpf: Convert tcp_rtt test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-10-git-send-email-wangyufen@huawei.com commit 3082f8cd4ba32091be82c19c357ddfd300c5a433 Author: Wang Yufen Date: Mon Sep 26 13:12:08 2022 +0800 selftests/bpf: Convert tcp_hdr_options test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-9-git-send-email-wangyufen@huawei.com commit a0a17296713aea7b3cbc94662c6ffb53a79a3f2c Author: Wang Yufen Date: Mon Sep 26 13:12:07 2022 +0800 selftests/bpf: Convert tcp_estats test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-8-git-send-email-wangyufen@huawei.com commit f19708dfa0bf5a016f27e92ef4d3514788f6dc8b Author: Wang Yufen Date: Mon Sep 26 13:12:06 2022 +0800 selftests/bpf: Convert sockopt_sk test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-7-git-send-email-wangyufen@huawei.com commit a605a6bbccceebbb68ab9f8ff2b27e2faa38525d Author: Wang Yufen Date: Mon Sep 26 13:12:05 2022 +0800 selftests/bpf: Convert sockopt_multi test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-6-git-send-email-wangyufen@huawei.com commit 675bc8abe16d9ce97970e8a781e9e72bb8d47ca2 Author: Wang Yufen Date: Mon Sep 26 13:12:04 2022 +0800 selftests/bpf: Convert sockopt_inherit test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-5-git-send-email-wangyufen@huawei.com commit 099763e7da0beec120827547f227c123e9d4a155 Author: Wang Yufen Date: Mon Sep 26 13:12:03 2022 +0800 selftests/bpf: Convert sockopt test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-4-git-send-email-wangyufen@huawei.com commit d155fcb3fff16410ccd7583f9a16c15ddffeca1e Author: Wang Yufen Date: Mon Sep 26 13:12:02 2022 +0800 selftests/bpf: Convert sockmap_ktls test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-3-git-send-email-wangyufen@huawei.com commit 38e35e1d0cee3432baadfd6900e1d05a3419eda6 Author: Wang Yufen Date: Mon Sep 26 13:12:01 2022 +0800 selftests/bpf: Convert sockmap_basic test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1664169131-32405-2-git-send-email-wangyufen@huawei.com commit f3ddb74ad0790030c9592229fb14d8c451f4e9a8 Author: Steven Rostedt (Google) Date: Tue Sep 27 19:15:27 2022 -0400 tracing: Wake up ring buffer waiters on closing of the file When the file that represents the ring buffer is closed, there may be waiters waiting on more input from the ring buffer. Call ring_buffer_wake_waiters() to wake up any waiters when the file is closed. Link: https://lkml.kernel.org/r/20220927231825.182416969@goodmis.org Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Fixes: e30f53aad2202 ("tracing: Do not busy wait in buffer splice") Signed-off-by: Steven Rostedt (Google) commit 7e9fbbb1b776d8d7969551565bc246f74ec53b27 Author: Steven Rostedt (Google) Date: Wed Sep 28 13:39:38 2022 -0400 ring-buffer: Add ring_buffer_wake_waiters() On closing of a file that represents a ring buffer or flushing the file, there may be waiters on the ring buffer that needs to be woken up and exit the ring_buffer_wait() function. Add ring_buffer_wake_waiters() to wake up the waiters on the ring buffer and allow them to exit the wait loop. Link: https://lkml.kernel.org/r/20220928133938.28dc2c27@gandalf.local.home Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Fixes: 15693458c4bc0 ("tracing/ring-buffer: Move poll wake ups into ring buffer code") Signed-off-by: Steven Rostedt (Google) commit aa55dfd3783f0f8131bead061fb22b0d0d75a078 Merge: 87dbdc230d162 6bdb6d6be019f Author: Andrii Nakryiko Date: Wed Sep 28 16:27:55 2022 -0700 Merge branch 'Parameterize task iterators.' Kui-Feng Lee says: ==================== Allow creating an iterator that loops through resources of one task/thread. People could only create iterators to loop through all resources of files, vma, and tasks in the system, even though they were interested in only the resources of a specific task or process. Passing the additional parameters, people can now create an iterator to go through all resources or only the resources of a task. Major Changes: - Add new parameters in bpf_iter_link_info to indicate to go through all tasks or to go through a specific task. - Change the implementations of BPF iterators of vma, files, and tasks to allow going through only the resources of a specific task. - Provide the arguments of parameterized task iterators in bpf_link_info. Differences from v10: - Check pid_alive() to avoid potential errors. Differences from v9: - Fix the boundary check of computing page_shift. - Rewording the reason of checking and returning the same task. Differences from v8: - Fix uninitialized variable. - Avoid redundant work of getting task from pid. - Change format string to use %u instead of %d. - Use the value of page_shift to compute correct offset in bpf_iter_vm_offset.c. Differences from v7: - Travel the tasks of a process through task_group linked list instead of traveling through the whole namespace. Differences from v6: - Add part 5 to make bpftool show the value of parameters. - Change of wording of show_fdinfo() to show pid or tid instead of always pid. - Simplify error handling and naming of test cases. Differences from v5: - Use user-space tid/pid terminologies in bpf_iter_link_info and bpf_link_info. - Fix reference count - Merge all variants to one 'u32 pid' in internal structs. (bpf_iter_aux_info and bpf_iter_seq_task_common) - Compare the result of get_uprobe_offset() with the implementation with the vma iterators. - Implement show_fdinfo. Differences from v4: - Remove 'type' from bpf_iter_link_info and bpf_link_info. v10: https://lore.kernel.org/all/20220831181039.2680134-1-kuifeng@fb.com/ v9: https://lore.kernel.org/bpf/20220829192317.486946-1-kuifeng@fb.com/ v8: https://lore.kernel.org/bpf/20220829192317.486946-1-kuifeng@fb.com/ v7: https://lore.kernel.org/bpf/20220826003712.2810158-1-kuifeng@fb.com/ v6: https://lore.kernel.org/bpf/20220819220927.3409575-1-kuifeng@fb.com/ v5: https://lore.kernel.org/bpf/20220811001654.1316689-1-kuifeng@fb.com/ v4: https://lore.kernel.org/bpf/20220809195429.1043220-1-kuifeng@fb.com/ v3: https://lore.kernel.org/bpf/20220809063501.667610-1-kuifeng@fb.com/ v2: https://lore.kernel.org/bpf/20220801232649.2306614-1-kuifeng@fb.com/ v1: https://lore.kernel.org/bpf/20220726051713.840431-1-kuifeng@fb.com/ ==================== Signed-off-by: Andrii Nakryiko commit 6bdb6d6be019f697296f52c37865dd7b0ce80750 Author: Kui-Feng Lee Date: Mon Sep 26 11:49:57 2022 -0700 bpftool: Show parameters of BPF task iterators. Show tid or pid of iterators if giving an argument of tid or pid For example, the command `bpftool link list` may list following lines. 1: iter prog 2 target_name bpf_map 2: iter prog 3 target_name bpf_prog 33: iter prog 225 target_name task_file tid 1644 pids test_progs(1644) Link 33 is a task_file iterator with tid 1644. For now, only targets of task, task_file and task_vma may be with tid or pid to filter out tasks other than those belonging to a process (pid) or a thread (tid). Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220926184957.208194-6-kuifeng@fb.com commit b3e1331eb925a45df1cc5d02a725e5ea70da0e2e Author: Kui-Feng Lee Date: Mon Sep 26 11:49:56 2022 -0700 selftests/bpf: Test parameterized task BPF iterators. Test iterators of vma, files and tasks. Ensure the API works appropriately to visit all tasks, tasks in a process, or a particular task. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220926184957.208194-5-kuifeng@fb.com commit 2c4fe44fb020f3cce904da2ba9e42bb1c118e8a3 Author: Kui-Feng Lee Date: Mon Sep 26 11:49:55 2022 -0700 bpf: Handle show_fdinfo for the parameterized task BPF iterators Show information of iterators in the respective files under /proc//fdinfo/. For example, for a task file iterator with 1723 as the value of tid parameter, its fdinfo would look like the following lines. pos: 0 flags: 02000000 mnt_id: 14 ino: 38 link_type: iter link_id: 51 prog_tag: a590ac96db22b825 prog_id: 299 target_name: task_file task_type: TID tid: 1723 This patch add the last three fields. task_type is the type of the task parameter. TID means the iterator visit only the thread specified by tid. The value of tid in the above example is 1723. For the case of PID task_type, it means the iterator visits only threads of a process and will show the pid value of the process instead of a tid. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220926184957.208194-4-kuifeng@fb.com commit 21fb6f2aa3890b0d0abf88b7756d0098e9367a7c Author: Kui-Feng Lee Date: Mon Sep 26 11:49:54 2022 -0700 bpf: Handle bpf_link_info for the parameterized task BPF iterators. Add new fields to bpf_link_info that users can query it through bpf_obj_get_info_by_fd(). Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220926184957.208194-3-kuifeng@fb.com commit f0d74c4da1f060d2a66976193712a5e6abd361f5 Author: Kui-Feng Lee Date: Mon Sep 26 11:49:53 2022 -0700 bpf: Parameterize task iterators. Allow creating an iterator that loops through resources of one thread/process. People could only create iterators to loop through all resources of files, vma, and tasks in the system, even though they were interested in only the resources of a specific task or process. Passing the additional parameters, people can now create an iterator to go through all resources or only the resources of a task. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220926184957.208194-2-kuifeng@fb.com commit 0049eb1a44ce98bd0c8d3a2d9fec150664da8d66 Merge: 568035b01cfb1 67e16ac1fec47 Author: Stephen Boyd Date: Wed Sep 28 16:25:45 2022 -0700 Merge tag 'clk-imx-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Change order between 'sim_enet_root_clk' and 'enet_qos_root_clk' clocks for i.MX8MP - Drop unnecessary newline in i.MX8MM dt-bindings - Add more MU1 and SAI clocks dt-bindings Ids - Introduce slice busy bit check for i.MX93 composite clock - Introduce white list bit check for i.MX93 composite clock - Add new i.MX93 clock gate - Add MU1 and MU2 clocks to i.MX93 clock provider - Add SAI IPG clocks to i.MX93 clock provider * tag 'clk-imx-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx93: add SAI IPG clk clk: imx93: add MU1/2 clock clk: imx93: switch to use new clk gate API clk: imx: add i.MX93 clk gate clk: imx: clk-composite-93: check white_list clk: imx: clk-composite-93: check slice busy dt-bindings: clock: imx93-clock: add more MU/SAI clocks dt-bindings: clock: imx8mm: don't use multiple blank lines clk: imx8mp: tune the order of enet_qos_root_clk commit d772c9370fe8c3c8247dbc78dcd2f6d10eab3e18 Merge: 568035b01cfb1 6a6434482fc61 Author: Stephen Boyd Date: Wed Sep 28 16:21:13 2022 -0700 Merge tag 'sunxi-clk-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull Allwinner clk driver updates from Jernej Skrabec: Refactor A80 DE & USB and DE2 code to use dev_err_probe() helper * tag 'sunxi-clk-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: ccu-sun9i-a80-usb: Use dev_err_probe() helper clk: sunxi-ng: ccu-sun9i-a80-de: Use dev_err_probe() helper clk: sunxi-ng: sun8i-de2: Use dev_err_probe() helper clk: sunxi-ng: d1: Limit PLL rates to stable ranges commit 50cf94b419d5746b52393fa71f115e8c667a1a0f Merge: 568035b01cfb1 935edf0c14559 Author: Stephen Boyd Date: Wed Sep 28 16:10:20 2022 -0700 Merge tag 'clk-microchip-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip Pull Microchip clk driver updates from Claudiu Beznea: Microchip AT91: - add generic clocks for U(S)ART available on SAMA5D2 SoCs Microchip Polarfire: - reset controller support for Polarfire clocks - .round_rate and .set rate support for clk-mpfs - code cleanup for clk-mpfs - PLL support for PolarFire SoC's Clock Conditioning Circuitry * tag 'clk-microchip-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: at91: sama5d2: Add Generic Clocks for UART/USART clk: microchip: add PolarFire SoC fabric clock support dt-bindings: clk: add PolarFire SoC fabric clock ids dt-bindings: clk: document PolarFire SoC fabric clocks dt-bindings: clk: rename mpfs-clkcfg binding clk: microchip: mpfs: update module authorship & licencing clk: microchip: mpfs: convert periph_clk to clk_gate clk: microchip: mpfs: convert cfg_clk to clk_divider clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo() clk: microchip: mpfs: simplify control reg access clk: microchip: mpfs: move id & offset out of clock structs clk: microchip: mpfs: add MSS pll's set & round rate MAINTAINERS: add polarfire soc reset controller reset: add polarfire soc reset support clk: microchip: mpfs: add reset controller dt-bindings: clk: microchip: mpfs: add reset controller support clk: microchip: mpfs: make the rtc's ahb clock critical clk: microchip: mpfs: fix clk_cfg array bounds violation commit acb84a167f14ae7d51475379ca1ff2f7bb36e2b6 Merge: 9e1ab1fef1ec4 e46a1a9943c0e Author: Stephen Boyd Date: Wed Sep 28 16:07:09 2022 -0700 Merge tag 'renesas-clk-for-v6.1-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull some more Renesas clk driver updates from Geert Uytterhoeven: - Add watchdog, I2C, pin control/GPIO, and Ethernet clocks on R-Car V4H * tag 'renesas-clk-for-v6.1-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r8a779g0: Add EtherAVB clocks clk: renesas: r8a779g0: Add PFC/GPIO clocks clk: renesas: r8a779g0: Add I2C clocks clk: renesas: r8a779g0: Add watchdog clock commit 9e1ab1fef1ec4542fea79bb02ace412e70aa163c Merge: 568035b01cfb1 e312ae92077f9 Author: Stephen Boyd Date: Wed Sep 28 16:01:17 2022 -0700 Merge tag 'renesas-clk-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - Add SDHI, Timer (CMT/TMU), and SPI (MSIOF) clocks on R-Car S4-8 - Add I2C clocks and resets on RZ/V2M - Document clock support for the RZ/Five SoC - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: dt-bindings: clock: renesas,rzg2l: Document RZ/Five SoC clk: renesas: r8a779f0: Add MSIOF clocks clk: renesas: r9a09g011: Add IIC clock and reset entries clk: renesas: r9a07g044: Add conditional compilation for r9a07g044_cpg_info clk: renesas: r8a779f0: Add TMU and parent SASYNC clocks clk: renesas: r8a779f0: Add CMT clocks clk: renesas: r8a779f0: Add SDH0 clock commit 9e1343ede72af69675c103099560820e9de8fd4b Merge: 1c23f9e627a7b fffa0fa4d029c Author: Stephen Boyd Date: Wed Sep 28 15:54:35 2022 -0700 Merge tag 'v6.1-rockchip-clock1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull Rockchip clk driver updates from Heiko Stuebner: - mux-variant clock using the table variant to select parents - clock controller for the rv1126 soc - conversion of rk3128 to yaml and relicensing of the yaml bindings to gpl2+MIT (following dt-binding guildelines) * tag 'v6.1-rockchip-clock1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: dt-bindings: clock: rockchip: change SPDX-License-Identifier dt-bindings: clock: convert rockchip,rk3128-cru.txt to YAML clk: rockchip: Add clock controller support for RV1126 SoC dt-bindings: clock: rockchip: Document RV1126 CRU clk: rockchip: Add dt-binding header for RV1126 clk: rockchip: Add MUXTBL variant commit c85c36798bc2ed12af04b6cc274aed5b02984647 Author: Colin Ian King Date: Wed Sep 28 14:53:33 2022 -0700 Input: ims-pcu - fix spelling mistake "BOOLTLOADER" -> "BOOTLOADER" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220928211003.61872-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit 4b0986590062ce12c134c00cf32b9f9b846aeff5 Author: Masahiro Yamada Date: Sat Sep 24 17:24:25 2022 +0900 kbuild: hide error checker logs for V=1 builds V=1 (verbose build) shows commands executed by Make, but it may cause misunderstanding. For example, the following command shows the outstanding error message. $ make V=1 INSTALL_PATH=/tmp install test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo >&2; \ echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) unset sub_make_done; ./scripts/install.sh It is not an error. Make just showed the recipe lines it has executed, but people may think that 'make install' has failed. Likewise, the combination of V=1 and O= shows confusing "*** The source tree is not clean, please run 'make mrproper'". Suppress such misleading logs. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 425937381ec492d454cd4d8ba594711331128a44 Author: Masahiro Yamada Date: Thu Sep 15 15:26:23 2022 +0900 kbuild: re-run modpost when it is updated Modpost generates .vmlinux.export.c and *.mod.c, which are prerequisites of vmlinux and modules, respectively. The modpost stage should be re-run when the modpost code is updated. Signed-off-by: Masahiro Yamada commit f73edc8951b2de515b5ecc8a357ccd47dd41077e Author: Masahiro Yamada Date: Sun Sep 25 03:19:13 2022 +0900 kbuild: unify two modpost invocations Currently, modpost is executed twice; first for vmlinux, second for modules. This commit merges them. Current build flow ================== 1) build obj-y and obj-m objects 2) link vmlinux.o 3) modpost for vmlinux 4) link vmlinux 5) modpost for modules 6) link modules (*.ko) The build steps 1) through 6) are serialized, that is, modules are built after vmlinux. You do not get benefits of parallel builds when scripts/link-vmlinux.sh is being run. New build flow ============== 1) build obj-y and obj-m objects 2) link vmlinux.o 3) modpost for vmlinux and modules 4a) link vmlinux 4b) link modules (*.ko) In the new build flow, modpost is invoked just once. vmlinux and modules are built in parallel. One exception is CONFIG_DEBUG_INFO_BTF_MODULES=y, where modules depend on vmlinux. Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 302c9454e4d683bc3a46f0f50385534a0e2f74c1 Merge: 3ba2d4bb9592b 5381a96cd9c42 Author: Arnd Bergmann Date: Wed Sep 28 22:42:25 2022 +0200 Merge branch 'uniphier/dt' into arm/dt Updates from Kunihiko Hayashi via email: "Update devicetree sources for UniPhier armv8 SoCs to remove dtschema warnings, add support existing features that haven't yet been described, and replace constants with macros." * uniphier/dt: arm64: dts: uniphier: Add L2 cache node arm64: dts: uniphier: Remove compatible "snps,dw-pcie" from pcie node arm64: dts: uniphier: Fix opp-table node name for LD20 arm64: dts: uniphier: Add USB-device support for PXs3 reference board arm64: dts: uniphier: Add ahci controller nodes for PXs3 arm64: dts: uniphier: Use GIC interrupt definitions arm64: dts: uniphier: Rename gpio-hog nodes arm64: dts: uniphier: Rename usb-glue node for USB3 to usb-controller arm64: dts: uniphier: Rename usb-phy node for USB2 to usb-controller arm64: dts: uniphier: Rename pvtctl node to thermal-sensor ARM: dts: uniphier: Remove compatible "snps,dw-pcie-ep" from pcie-ep node ARM: dts: uniphier: Move interrupt-parent property to each child node in uniphier-support-card ARM: dts: uniphier: Add ahci controller nodes for PXs2 ARM: dts: uniphier: Add ahci controller nodes for Pro4 ARM: dts: uniphier: Use GIC interrupt definitions ARM: dts: uniphier: Rename gpio-hog node ARM: dts: uniphier: Rename usb-glue node for USB3 to usb-controller ARM: dts: uniphier: Rename usb-phy node for USB2 to usb-controller ARM: dts: uniphier: Rename pvtctl node to thermal-sensor commit 5381a96cd9c4247eafb2dfcfccf491d0bba2f5ca Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:21 2022 +0900 arm64: dts: uniphier: Add L2 cache node Add a L2 cache node referenced from CPU nodes as the missing cache hierarchy information because the following warning was issued. cacheinfo: Unable to detect cache hierarchy for CPU 0 Early cacheinfo failed, ret = -2 Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-11-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit d93ecbf56946640b3746dcd7b0fe4c808bf2b580 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:20 2022 +0900 arm64: dts: uniphier: Remove compatible "snps,dw-pcie" from pcie node The generic platform driver pcie-designware-plat.c doesn't work for UniPhier PCIe host controller, because the controller has some necessary initialization sequence for the controller-specific logic. Currently the controller doesn't use "snps,dw-pcie" compatible, so this is no longer needed. Remove the compatible string from the pcie node. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-10-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 4ff64e7089d15d6223d8e7eca12fc7ba090f25a4 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:19 2022 +0900 arm64: dts: uniphier: Fix opp-table node name for LD20 To fix dtbs_check warning: uniphier-ld20-akebi96.dt.yaml: opp-table0: $nodename:0: 'opp-table0' does not match '^opp-table(-[a-z0-9]+)?$' From schema: Documentation/devicetree/bindings/opp/opp-v2.yaml Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-9-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 19fee1a1096d21ab1f1e712148b5417bda2939a2 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:18 2022 +0900 arm64: dts: uniphier: Add USB-device support for PXs3 reference board PXs3 reference board can change each USB port 0 and 1 to device mode with jumpers. Prepare devicetree sources for USB port 0 and 1. This specifies dr_mode, pinctrl, and some quirks and removes nodes for unused phys and vbus-supply properties. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-8-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 23e001e75db79c2ef8f97a1175cdb4b2224ae6a9 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:17 2022 +0900 arm64: dts: uniphier: Add ahci controller nodes for PXs3 Add ahci core controller and glue layer nodes including reset-controller and sata-phy. This supports for PXs3 and the boards. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-7-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 5ba95e8ec2dd9fd8917a4e932c520234c6614c39 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:16 2022 +0900 arm64: dts: uniphier: Use GIC interrupt definitions Use human-readable definitions for GIC interrupt type and flag, instead of hard-coding the numbers. No functional change. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-6-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 173b9b8e5f8372e9fd15d8ed488ff86556d1b416 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:15 2022 +0900 arm64: dts: uniphier: Rename gpio-hog nodes According to gpio-hog schema, should add the suffix "-hog" to the node names including gpio-hog to fix the following warning. uniphier-ld11-ref.dtb: gpio@55000000: 'xirq0' does not match any of the regexes: '^.+-hog(-[0-9+)?$', 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml This applies to the devicetre for LD11, LD20 and PXs3 SoCs. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-5-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 4cc752a88ca92f44434dc57c9ead14490f93bfa8 Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:14 2022 +0900 arm64: dts: uniphier: Rename usb-glue node for USB3 to usb-controller This "usb-glue" stands for an external controller associated with USB core, however, this is not common. So rename to "usb-controller". Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-4-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 8fa3e658579ae0a80cd8ec05b1c2b4a9061aeafe Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:13 2022 +0900 arm64: dts: uniphier: Rename usb-phy node for USB2 to usb-controller Actual phy nodes are each child node. The parent node should be usb-controller node as a representation of the phy integration. This applies to the devicetree for LD11 SoC. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-3-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 2dfb62d6ce80b3536d1a915177ae82496bd7ac4a Author: Kunihiko Hayashi Date: Tue Sep 13 13:23:12 2022 +0900 arm64: dts: uniphier: Rename pvtctl node to thermal-sensor The pvtctl node belongs to thermal-sensor, so the node name should be renamed to thermal-sensor. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042321.4817-2-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 86b20827becef3fb69c41fb8327cce7511956783 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:49 2022 +0900 ARM: dts: uniphier: Remove compatible "snps,dw-pcie-ep" from pcie-ep node The generic platform driver pcie-designware-plat.c doesn't work for UniPhier PCIe endpoint controller, because the controller has some necessary initialization sequence for the controller-specific logic. Currently the controller doesn't use "snps,dw-pcie-ep" compatible, so this is no longer needed. Remove the compatible string from the pcie-ep node. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-10-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 0aca3912ce318b1b6a45d2945f08950a63197f3b Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:48 2022 +0900 ARM: dts: uniphier: Move interrupt-parent property to each child node in uniphier-support-card The dtschema warning: uniphier-ld11-ref.dt.yaml: system-bus@58c00000: 'interrupt-parent' does not match any of the regexes: '^.*@[1-5],[1-9a-f][0-9a-f]+$', 'pinctrl-[0-9]+' Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-9-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 97837505f067e9abcb2cc8b9c0a31e5330a36a36 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:47 2022 +0900 ARM: dts: uniphier: Add ahci controller nodes for PXs2 Add ahci core controller and glue layer nodes including reset-controller and sata-phy. This supports for PXs2 and the boards without PXs2 vodka board that doesn't implement any SATA connectors. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-8-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit d5566de59bddde675e91fa912aaa928d7e9ee277 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:46 2022 +0900 ARM: dts: uniphier: Add ahci controller nodes for Pro4 Add ahci controller, glue layer, and clock nodes for Pro4 SoC. The glue layer includes reset and phy, and the clock node is used for handling ahci clocks on SoC-glue. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-7-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit c9c50dfdf6e491c4e29e8d4cfeb2d129c085eeea Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:45 2022 +0900 ARM: dts: uniphier: Use GIC interrupt definitions Use human-readable definitions for GIC interrupt type and flag, instead of hard-coding the numbers. No functional change. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-6-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 888c701754a8af2cd9870e7dfbbf8bcc72915656 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:44 2022 +0900 ARM: dts: uniphier: Rename gpio-hog node According to gpio-hog schema, should add the suffix "-hog" to the node names including gpio-hog to fix the following warning. uniphier-pro4-ref.dtb: gpio@55000000: 'xirq2' does not match any of the regexes: '^.+-hog(-[0-9+)?$', 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml This applies to the devicetree for LD4, LD6b, Pro4 and sLD8 SoCs. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-5-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 7e115bdd4f64ea05209499fd2df609ca91ab1d13 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:43 2022 +0900 ARM: dts: uniphier: Rename usb-glue node for USB3 to usb-controller This "usb-glue" stands for an external controller associated with USB core, however, this is not common. So rename to "usb-controller". Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-4-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 242c78ff62ff2c4bd629993cfde616d963b53eec Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:42 2022 +0900 ARM: dts: uniphier: Rename usb-phy node for USB2 to usb-controller Actual phy nodes are each child node. The parent node should be usb-controller node as a representation of the phy integration. This applies to the devicetree for Pro4 SoC. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-3-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 2681eed29b9e7683c0e944b2f2221afd39de05e3 Author: Kunihiko Hayashi Date: Tue Sep 13 13:22:41 2022 +0900 ARM: dts: uniphier: Rename pvtctl node to thermal-sensor The pvtctl node belongs to thermal-sensor, so the node name should be renamed to thermal-sensor. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220913042249.4708-2-hayashi.kunihiko@socionext.com' Signed-off-by: Arnd Bergmann commit 4413794917ba3ff42ade432870248b500253f152 Author: Paul Bolle Date: Wed Sep 28 08:42:19 2022 +0200 ARM: remove check for CONFIG_DEBUG_LL_SER3 A check for CONFIG_DEBUG_LL_SER3 was added in v2.5.43. But the related symbol DEBUG_LL_SER3 was already removed in v2.5.8. This check has always evaluated to false. Remove it. Signed-off-by: Paul Bolle Signed-off-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit 3137f2e60098bccdf9b3a744747b06a96addab9e Author: Dmitry Baryshkov Date: Mon Sep 26 14:07:58 2022 +0300 firmware/psci: Add debugfs support to ease debugging To ease debugging of PSCI supported features, add debugfs file called 'psci' describing PSCI and SMC CC versions, enabled features and options. Signed-off-by: Dmitry Baryshkov Reviewed-by: Mark Brown Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/20220926110758.666922-1-dmitry.baryshkov@linaro.org' Signed-off-by: Arnd Bergmann commit 998fcd001feb8d71f2838d0949f2aeac2a0cbb9e Author: Dmitry Baryshkov Date: Mon Sep 26 14:02:49 2022 +0300 firmware/psci: Print a warning if PSCI doesn't accept PC mode The function psci_pd_try_set_osi_mode() will print an error if enabling OSI mode fails. To ease debugging PSCI issues print corresponding message if switching to PC mode fails too. Signed-off-by: Dmitry Baryshkov Reviewed-by: Sudeep Holla Reviewed-by: Ulf Hansson Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220926110249.666813-1-dmitry.baryshkov@linaro.org' Signed-off-by: Arnd Bergmann commit f6f7d870c5b6f3eac19ffedafffe8a8a9a034239 Merge: f8acc844c9eca 5514acb0dd030 Author: Arnd Bergmann Date: Wed Sep 28 22:36:48 2022 +0200 Merge tag 'memory-controller-drv-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v6.1, part 2 Improvements in Synopsys DesignWare Universal Multi-Protocol Memory Controller Devicetree bindings. The bindings are being split into one related to Synopsys core and into quite different derivative Zynq A05 DDR Memory Controller. Extend the Synopsys bindings with additional properties to match upcoming new device support (Baikal-T1 support). * tag 'memory-controller-drv-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: dt-bindings: memory: snps,dw-umctl2-ddrc: Extend schema with IRQs/resets/clocks props dt-bindings: memory: snps,dw-umctl2-ddrc: Replace opencoded numbers with macros dt-bindings: memory: snps,dw-umctl2-ddrc: Use more descriptive device name dt-bindings: memory: synopsys,ddrc-ecc: Detach Zynq DDRC controller support Link: https://lore.kernel.org/r/20220926105023.119781-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit f8acc844c9eca88a47fd7106a64c817fac4955a6 Merge: 3919d905351f2 adc4f190260a6 Author: Arnd Bergmann Date: Wed Sep 28 22:36:23 2022 +0200 Merge tag 'v6.1-rockchip-drivers2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/drivers Some binding additions for rk3128 and rv1126 * tag 'v6.1-rockchip-drivers2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: dt-bindings: soc: rockchip: grf: add rockchip,rk3128-grf dt-bindings: arm: rockchip: pmu: add rockchip,rk3128-pmu dt-bindings: soc: rockchip: Document RV1126 pmugrf dt-bindings: soc: rockchip: Document RV1126 grf Link: https://lore.kernel.org/r/3790767.LM0AJKV5NW@phil Signed-off-by: Arnd Bergmann commit 25631f1fec2a1e1aa93811fe7af2b29d49d79874 Merge: ffc79c2097fd5 489dd8611b64e Author: Arnd Bergmann Date: Wed Sep 28 22:35:14 2022 +0200 Merge tag 'v6.1-rockchip-defconfig64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/defconfig Enable Synopsys DWC MSHC (sdhci) driver in the defconfig. * tag 'v6.1-rockchip-defconfig64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: defconfig: Enable Synopsys DWC MSHC driver Link: https://lore.kernel.org/r/1989419.QkHrqEjB74@phil Signed-off-by: Arnd Bergmann commit ffc79c2097fd5e954d99dfeaaa5c0437a27a1ece Merge: 15116bf667241 e0d4684278825 Author: Arnd Bergmann Date: Wed Sep 28 22:34:20 2022 +0200 Merge tag 'aspeed-6.1-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/defconfig ASPEED defconfig updates for 6.1 - A long awaited sync to make the config closer to that used by OpenBMC machines - Enable PECI to provide defconfig coverage for the subsystem * tag 'aspeed-6.1-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: config: aspeed_g5: Enable PECI ARM: configs: aspeed_g4: Remove appended DTB and ATAG ARM: configs: aspeed: Refresh defconfigs ARM: config: aspeed: Enable namespaces ARM: configs: aspeed_g4: Enable IPV6 options ARM: configs: aspeed_g4: Enable OCC and NBD drivers ARM: configs: aspeed_g5: Enable MCTP stack ARM: configs: aspeed_g5: Add PL2303 USB serial driver ARM: configs: aspeed_g5: Add TPM TIS I2C driver ARM: configs: aspeed_g5: Add mp5023 driver ARM: configs: aspeed: Add support for USB flash drives Link: https://lore.kernel.org/r/CACPK8XeLzL3hT8fwVw9fV7Ccduz_PNhZn_67z2yXefCEha6jJg@mail.gmail.com Signed-off-by: Arnd Bergmann commit ef2fb84c130b08ce2a05359c35bc4e9541712375 Author: Juerg Haefliger Date: Wed Sep 28 12:29:26 2022 +0930 ARM: aspeed: Kconfig: Fix indentation The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Signed-off-by: Joel Stanley Acked-by: Andrew Jeffery Link: https://lore.kernel.org/r/20220523060532.7864-1-juergh@canonical.com Link: https://lore.kernel.org/r/20220928025926.2592030-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit 136f4b1ec7c962ee37a787e095fd37b058d72bd3 Author: Geert Uytterhoeven Date: Tue Sep 27 15:28:26 2022 +0200 ARM: Drop CMDLINE_* dependency on ATAGS On arm32, the configuration options to specify the kernel command line type depend on ATAGS. However, the actual CMDLINE cofiguration option does not depend on ATAGS, and the code that handles this is not specific to ATAGS (see drivers/of/fdt.c:early_init_dt_scan_chosen()). Hence users who desire to override the kernel command line on arm32 must enable support for ATAGS, even on a pure-DT system. Other architectures (arm64, loongarch, microblaze, nios2, powerpc, and riscv) do not impose such a restriction. Hence drop the dependency on ATAGS. Fixes: bd51e2f595580fb6 ("ARM: 7506/1: allow for ATAGS to be configured out when DT support is selected") Signed-off-by: Geert Uytterhoeven Acked-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann commit 502647105a1d0302d5fc32814da45bb4772becda Author: Geert Uytterhoeven Date: Tue Sep 27 15:26:26 2022 +0200 ARM: Drop CMDLINE_FORCE dependency on !ARCH_MULTIPLATFORM On older platforms that boot an image with an appended DTB, or where the boot loader has no support for updating chosen/bootargs, it is common to rely on CMDLINE_FORCE. While a fixed command line can make the kernel unbootable on other platforms, it is not guaranteed to cause that. E.g. all Renesas boards use the same chosen/bootargs in upstream DTS, which works fine if your DHCP server hands out proper nfsroot parameters. Fixes: 84fc863606239d8b ("ARM: make ARCH_MULTIPLATFORM user-visible") Signed-off-by: Geert Uytterhoeven Acked-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann commit c1ce7edcb69b61ea06c317e177518ab6bea7453a Author: Gaosheng Cui Date: Mon Sep 26 12:43:54 2022 +0200 ARM: s3c: remove orphan declarations from arch/arm/mach-s3c/devs.h s3c64xx_device_spi1 and s3c64xx_device_spi2 were removed by commit f1ba938e4f98 ("spi: s3c64xx: Delete unused boardfile helpers"), so remove the declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Krzysztof Kozlowski Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220914034615.1240860-3-cuigaosheng1@huawei.com Link: https://lore.kernel.org/r/20220926104354.118578-3-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann commit 3ba2d4bb9592bf7a6a3fe3dbe711ecfc3d004bab Author: Dmitry Torokhov Date: Mon Sep 26 12:43:53 2022 +0200 ARM: dts: exynos: correct s5k6a3 reset polarity on Midas family According to s5k6a3 driver code, the reset line for the chip appears to be active low. This also matches the typical polarity of reset lines in general. Let's fix it up as having correct polarity in DTS is important when the driver will be switched over to gpiod API. Fixes: b4fec64758ab ("ARM: dts: Add camera device nodes for Exynos4412 TRATS2 board") Signed-off-by: Dmitry Torokhov Signed-off-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220913164104.203957-1-dmitry.torokhov@gmail.com Link: https://lore.kernel.org/r/20220926104354.118578-2-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann commit a51278056107b1825886776b2bf96b14cfc03cab Merge: 286c1d1c3074b 73b4476562de2 Author: Arnd Bergmann Date: Wed Sep 28 22:28:47 2022 +0200 Merge tag 'aspeed-6.1-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/dt ASPEED device tree updates for 6.1 - New machines * AMD's DaytonaX AST2600 BMC, for the amd64 server * Ampre's Mt. Mitchell AST2600 BMC, for the AmpereOne arm64 server - Fixes and updates for bletchley, mtjade, yosemitev2 and the ast2600-evb * tag 'aspeed-6.1-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: dts: aspeed: ast2600-evb-a1: Add compatible ARM: dts: aspeed: ast2600evb: Fix compatible string ARM: dts: aspeed: ast2600-evb: Enable Quad SPI RX tranfers ARM: dts: aspeed-g6: Enable more UART controllers ARM: dts: aspeed: yosemitev2: Disable the EEPROM driver ARM: dts: aspeed: Add AMD DaytonaX BMC dt-bindings: arm: aspeed: document AMD DaytonaX ARM: dts: aspeed: Yosemite V2: Enable OCP debug card ARM: dts: aspeed: mtjade: Remove gpio-keys entries ARM: dts: aspeed: Add device tree for Ampere's Mt. Mitchell BMC dt-bindings: arm: aspeed: document Ampere Mt.Mitchell BMC compatibles ARM: dts: aspeed: bletchley: Remove hdc1080 node ARM: dts: aspeed: bletchley: Add USB debug card IPMB node ARM: dts: aspeed: ast2600-evb: Update I2C devices Link: https://lore.kernel.org/r/CACPK8Xepnci+f+7Pi1jtXod8Jmt+OnJYfDRENjiP-xDBQwFCVg@mail.gmail.com Signed-off-by: Arnd Bergmann commit 286c1d1c3074bc6bfb5df1660f8ff1b56d210b19 Merge: 01c65733fadbd 19d4aaf640913 Author: Arnd Bergmann Date: Wed Sep 28 22:26:20 2022 +0200 Merge tag 'v6.1-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt RK3399-Nanopi-R4S-enterprise as variant board, Gru-Scarlet SKU variants, DSI support for rk356x, display-gamma-control for rk3399, display output for quartz64-b and rk3566-roc-pc, hdmi supplies for rk3399-roc-pc, some pinctrl improvements for the px30-evb and a number of changes to bring rk3399 rock4 and rock-pi4 structure closer to names used in schematics. * tag 'v6.1-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: use pin constant for reset-gpios on px30-evb arm64: dts: rockchip: add pinctrl for mipi-pdn pin on px30-evb arm64: dts: rockchip: set max drive-strength for cif_clkout_m0 on px30-evb arm64: dts: rockchip: add avdd-0v9-supply and avdd-1v8-supply on rk3399 rock 4c and pi4 arm64: dts: rockchip: sort nodes/properties on rk3399-rock-4 arm64: dts: rockchip: fix regulator name on rk3399-rock-4 arm64: dts: rockchip: sort nodes/properties on rk3399-rock-4c-plus arm64: dts: rockchip: fix regulator structure on rk3399-rock-4c-plus arm64: dts: rockchip: connect vcca_1v8 to APIO5_VDD on rk3399-rock-4c-plus arm64: dts: rockchip: Add DSI and DSI-DPHY nodes to rk356x arm64: dts: rockchip: Enable HDMI and GPU on quartz64-b arm64: dts: rockchip: Add RK3399 NanoPi R4S Enterprise Edition dt-bindings: Add doc for FriendlyARM NanoPi R4S Enterprise Edition arm64: dts: rockchip: add i2s0 I2S/PDM/TDM 8ch controller to px30 arm64: dts: rockchip: Add HDMI supplies on rk3399-roc-pc arm64: dts: rockchip: Support gru-scarlet sku{2,4} variants dt-bindings: arm: rockchip: Add gru-scarlet sku{2,4} variants arm64: dts: rockchip: enable gamma control on RK3399 arm64: dts: rockchip: Enable video output on rk3566-roc-pc Link: https://lore.kernel.org/r/38114097.10thIPus4b@phil Signed-off-by: Arnd Bergmann commit dc63a086daee92c63e392e4e7cd7ed61f3693026 Author: Jason A. Donenfeld Date: Tue Sep 27 15:08:35 2022 +0200 m68k: Rework BI_VIRT_RNG_SEED as BI_RNG_SEED This is useful on !virt platforms for kexec, so change things from BI_VIRT_RNG_SEED to be BI_RNG_SEED, and simply remove BI_VIRT_RNG_SEED because it only ever lasted one release, and nothing is broken by not having it. At the same time, keep a comment noting that it's been removed, so that ID isn't reused. In addition, we previously documented 2-byte alignment, but 4-byte alignment is actually necessary, so update that comment. Suggested-by: Geert Uytterhoeven Fixes: a1ee38ab1a75 ("m68k: virt: Use RNG seed from bootinfo block") Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220927130835.1629806-2-Jason@zx2c4.com Signed-off-by: Geert Uytterhoeven commit 7c236d93c6764dcaca7ab66d76768a044647876d Author: Jason A. Donenfeld Date: Tue Sep 27 15:08:34 2022 +0200 m68k: Process bootinfo records before saving them The RNG seed boot record is memzeroed after processing, in order to preserve forward secrecy. By saving the bootinfo for procfs prior to that, forward secrecy is violated, since it becomes possible to recover past states. So, save the bootinfo block only after first processing them. Fixes: a1ee38ab1a75 ("m68k: virt: Use RNG seed from bootinfo block") Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220927130835.1629806-1-Jason@zx2c4.com Signed-off-by: Geert Uytterhoeven commit 3616936972493923afa4a11dc9f707b117e2bdf4 Author: Tharun Kumar P Date: Tue Sep 27 14:29:49 2022 +0530 i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch Microchip pci1xxxx is an unmanaged PCIe3.1a Switch for Consumer, Industrial and Automotive applications. This switch has multiple downstream ports. In one of the Switch's Downstream port, there is a multifunction endpoint for peripherals which includes an I2C host controller. The I2C function in the endpoint operates at 100KHz, 400KHz and 1 MHz and has buffer depth of 128 bytes. This patch provides the I2C controller driver for the I2C function of the switch. Signed-off-by: Tharun Kumar P Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit ea5cbc9ff839091a86558d4e2c082225b13e0055 Author: Like Xu Date: Wed Aug 31 16:53:28 2022 +0800 KVM: x86/svm/pmu: Rewrite get_gp_pmc_amd() for more counters scalability If the number of AMD gp counters continues to grow, the code will be very clumsy and the switch-case design of inline get_gp_pmc_amd() will also bloat the kernel text size. The target code is taught to manage two groups of MSRs, each representing a different version of the AMD PMU counter MSRs. The MSR addresses of each group are contiguous, with no holes, and there is no intersection between two sets of addresses, but they are discrete in functionality by design like this: [Group A : All counter MSRs are tightly bound to all event select MSRs ] MSR_K7_EVNTSEL0 0xc0010000 MSR_K7_EVNTSELi 0xc0010000 + i ... MSR_K7_EVNTSEL3 0xc0010003 MSR_K7_PERFCTR0 0xc0010004 MSR_K7_PERFCTRi 0xc0010004 + i ... MSR_K7_PERFCTR3 0xc0010007 [Group B : The counter MSRs are interleaved with the event select MSRs ] MSR_F15H_PERF_CTL0 0xc0010200 MSR_F15H_PERF_CTR0 (0xc0010200 + 1) ... MSR_F15H_PERF_CTLi (0xc0010200 + 2 * i) MSR_F15H_PERF_CTRi (0xc0010200 + 2 * i + 1) ... MSR_F15H_PERF_CTL5 (0xc0010200 + 2 * 5) MSR_F15H_PERF_CTR5 (0xc0010200 + 2 * 5 + 1) Rewrite get_gp_pmc_amd() in this way: first determine which group of registers is accessed, then determine if it matches its requested type, applying different scaling ratios respectively, and finally get pmc_idx to pass into amd_pmc_idx_to_pmc(). Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-8-likexu@tencent.com Signed-off-by: Sean Christopherson commit 5c6a67f4f265f84e1b8582f82562dda2a53f52d1 Author: Like Xu Date: Wed Aug 31 16:53:27 2022 +0800 KVM: x86/svm/pmu: Direct access pmu->gp_counter[] to implement amd_*_to_pmc() Access PMU counters on AMD by directly indexing the array of general purpose counters instead of translating the PMC index to an MSR index. AMD only supports gp counters, there's no need to translate a PMC index to an MSR index and back to a PMC index. Opportunistically apply array_index_nospec() to reduce the attack surface for speculative execution and remove the dead code. Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-7-likexu@tencent.com Signed-off-by: Sean Christopherson commit cf52de619c67bd1f6b1cf2751c3827815f74a5a5 Author: Like Xu Date: Wed Aug 31 16:53:24 2022 +0800 KVM: x86/pmu: Avoid using PEBS perf_events for normal counters The check logic in the pmc_resume_counter() to determine whether a perf_event is reusable is partial and flawed, especially when it comes to a pseudocode sequence (contrived, but valid) like: - enabling a counter and its PEBS bit - enable global_ctrl - run workload - disable only the PEBS bit, leaving the global_ctrl bit enabled In this corner case, a perf_event created for PEBS can be reused by a normal counter before it has been released and recreated, and when this normal counter overflows, it triggers a PEBS interrupt (precise_ip != 0). To address this issue, reprogram all affected counters when PEBS_ENABLE change and reuse a counter if and only if PEBS exactly matches precise. Fixes: 79f3e3b58386 ("KVM: x86/pmu: Reprogram PEBS event to emulate guest PEBS counter") Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-4-likexu@tencent.com Signed-off-by: Sean Christopherson commit c0245b774203f7341ddb1cce29a6ee607857f325 Author: Like Xu Date: Thu Sep 22 13:40:38 2022 -0700 KVM: x86/pmu: Refactor PERF_GLOBAL_CTRL update helper for reuse by PEBS Extract the "global ctrl" specific bits out of global_ctrl_changed() so that the helper only deals with reprogramming general purpose counters, and rename the helper accordingly. PEBS needs the same logic, i.e needs to reprogram counters associated when PEBS_ENABLE bits are toggled, and will use the helper in a future fix. No functional change intended. Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-4-likexu@tencent.com [sean: split to separate patch, write changelog] Signed-off-by: Sean Christopherson commit f331601c65ad217a5c000ce20c26266d3f0aceb3 Author: Like Xu Date: Wed Aug 31 16:53:23 2022 +0800 KVM: x86/pmu: Don't generate PEBS records for emulated instructions KVM will accumulate an enabled counter for at least INSTRUCTIONS or BRANCH_INSTRUCTION hw event from any KVM emulated instructions, generating emulated overflow interrupt on counter overflow, which in theory should also happen when the PEBS counter overflows but it currently lacks this part of the underlying support (e.g. through software injection of records in the irq context or a lazy approach). In this case, KVM skips the injection of this BUFFER_OVF PMI (effectively dropping one PEBS record) and let the overflow counter move on. The loss of a single sample does not introduce a loss of accuracy, but is easily noticeable for certain specific instructions. This issue is expected to be addressed along with the issue of PEBS cross-mapped counters with a slow-path proposal. Fixes: 79f3e3b58386 ("KVM: x86/pmu: Reprogram PEBS event to emulate guest PEBS counter") Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-3-likexu@tencent.com Signed-off-by: Sean Christopherson commit c23981df6642eec1da94a8125ec0ec402f7b1b7b Author: Like Xu Date: Wed Aug 31 16:53:22 2022 +0800 KVM: x86/pmu: Avoid setting BIT_ULL(-1) to pmu->host_cross_mapped_mask In the extreme case of host counters multiplexing and contention, the perf_event requested by the guest's pebs counter is not allocated to any actual physical counter, in which case hw.idx is bookkept as -1, resulting in an out-of-bounds access to host_cross_mapped_mask. Fixes: 854250329c02 ("KVM: x86/pmu: Disable guest PEBS temporarily in two rare situations") Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20220831085328.45489-2-likexu@tencent.com [sean: expand comment to explain how a negative idx can be encountered] Signed-off-by: Sean Christopherson commit 31d3b871f5ee9b195d90b4d14b74a7864209c6e8 Author: Vitaly Kuznetsov Date: Thu Sep 22 10:39:41 2022 +0200 KVM: selftests: Don't set reserved bits for invalid Hyper-V hypercall number Bits 27 through 31 in Hyper-V hypercall 'control' are reserved (see HV_HYPERCALL_RSVD0_MASK) but '0xdeadbeef' includes them. This causes KVM to return HV_STATUS_INVALID_HYPERCALL_INPUT instead of the expected HV_STATUS_INVALID_HYPERCALL_CODE. Signed-off-by: Vitaly Kuznetsov Link: https://lore.kernel.org/all/87fsgjol20.fsf@redhat.com Signed-off-by: Sean Christopherson commit dfb45db43e9f6283a79230c8ea9cb589f14791b0 Author: Vipin Sharma Date: Wed Sep 21 23:24:51 2022 -0700 KVM: selftests: Load RAX with -EFAULT before Hyper-V hypercall Load RAX with -EFAULT prior to making a Hyper-V hypercall so that tests can't get false negatives due to the compiler coincidentally loading the "right" value into RAX, i.e. to ensure that _KVM_ and not the compiler is correctly clearing RAX on a successful hypercall. Note, initializing *hv_status (in C code) to -EFAULT is not sufficient to avoid false negatives, as the compiler can still "clobber" RAX and thus load garbage into *hv_status if the hypercall faults (or if KVM doesn't set RAX). Suggested-by: Sean Christopherson Signed-off-by: Vipin Sharma Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20220922062451.2927010-1-vipinsh@google.com [sean: move to separate patch, massage changelog] Signed-off-by: Sean Christopherson commit bf3f11581893494a5fb01eb87b99627edc2a85ff Author: Vipin Sharma Date: Wed Sep 21 23:24:51 2022 -0700 KVM: selftests: Check result in hyperv_features for successful hypercalls Commit cc5851c6be86 ("KVM: selftests: Use exception fixup for #UD/#GP Hyper-V MSR/hcall tests") introduced a wrong guest assert in guest_hcall(). It is not checking the successful hypercall results and only checks the result when a fault happens. GUEST_ASSERT_2(!hcall->ud_expected || res == hcall->expect, hcall->expect, res); Correct the assertion by only checking results of the successful hypercalls. This issue was observed when this test started failing after building it in Clang. Above guest assert statement fails because "res" is not equal to "hcall->expect" when "hcall->ud_expected" is true. "res" gets some garbage value in Clang from the RAX register. In GCC, RAX is 0 because it using RAX for @output_address in the asm statement and resetting it to 0 before using it as output operand in the same asm statement. Clang is not using RAX for @output_address. Fixes: cc5851c6be86 ("KVM: selftests: Use exception fixup for #UD/#GP Hyper-V MSR/hcall tests") Signed-off-by: Vipin Sharma Suggested-by: Sean Christopherson Reviewed-by: Jim Mattson Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20220922062451.2927010-1-vipinsh@google.com [sean: wrap changelog at ~75 chars, move -EFAULT change to separate patch] Signed-off-by: Sean Christopherson commit 9c5a0ac3c36917c4258f734bda98be02ca36b992 Author: Masahiro Yamada Date: Sun Sep 25 03:19:12 2022 +0900 kbuild: move vmlinux.o rule to the top Makefile Move the build rules of vmlinux.o out of scripts/link-vmlinux.sh to clearly separate 1) pre-modpost, 2) modpost, 3) post-modpost stages. This will make further refactoring possible. Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 26ef40de5cbb24728a34a319e8d42cdec99f186c Author: Masahiro Yamada Date: Sun Sep 25 03:19:11 2022 +0900 kbuild: move .vmlinux.objs rule to Makefile.modpost .vmlinux.objs is used by modpost, so scripts/Makefile.modpost is a better place to generate it. It is used only when CONFIG_MODVERSIONS=y. It should be guarded by "ifdef CONFIG_MODVERSIONS". Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 09a7bab68b22ff862766d6ec543fdbaf126cd688 Author: Quan Nguyen Date: Thu Sep 15 10:54:40 2022 +0700 docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED In case backend is not ready, ie: fail to wakeup or initialization, on the returning of the I2C_SLAVE_WRITE_REQUESTED event, bus driver should aware the backend status and might auto sending NACK on the next incoming bytes for I2C master to retry. Signed-off-by: Quan Nguyen Links:https://lore.kernel.org/linux-arm-kernel/556fa9e1-c54b-8370-4de7-c2d3ec7d6906@os.amperecomputing.com/ [wsa: made some wording more precise] Signed-off-by: Wolfram Sang commit 5750121ae7382ebac8d47ce6d68012d6cd1d7926 Author: Masahiro Yamada Date: Sun Sep 25 03:19:10 2022 +0900 kbuild: list sub-directories in ./Kbuild Use the ordinary obj-y syntax to list subdirectories. Note1: Previously, the link order of lib-y depended on CONFIG_MODULES; lib-y was linked before drivers-y when CONFIG_MODULES=y, otherwise after drivers-y. This was a bug of commit 7273ad2b08f8 ("kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y"), but it was not a big deal after all. Now, all objects listed in lib-y are linked last, irrespective of CONFIG_MODULES. Note2: Finally, the single target build in arch/*/lib/ works correctly. There was a bug report about this. [1] $ make ARCH=arm arch/arm/lib/findbit.o CALL scripts/checksyscalls.sh AS arch/arm/lib/findbit.o [1]: https://lore.kernel.org/linux-kbuild/YvUQOwL6lD4%2F5%2FU6@shell.armlinux.org.uk/ Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 88b61e3bff93f99712718db785b4aa0c1165f35c Author: Nick Desaulniers Date: Mon Sep 19 10:08:28 2022 -0700 Makefile.compiler: replace cc-ifversion with compiler-specific macros cc-ifversion is GCC specific. Replace it with compiler specific variants. Update the users of cc-ifversion to use these new macros. Link: https://github.com/ClangBuiltLinux/linux/issues/350 Link: https://lore.kernel.org/llvm/CAGG=3QWSAUakO42kubrCap8fp-gm1ERJJAYXTnP1iHk_wrH=BQ@mail.gmail.com/ Suggested-by: Bill Wendling Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 2e07005f4813a9ff6e895787e0c2d1fea859b033 Author: Janis Schoetterl-Glausch Date: Fri Sep 16 14:41:12 2022 +0200 kbuild: rpm-pkg: fix breakage when V=1 is used Doing make V=1 binrpm-pkg results in: Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.EgV6qJ + umask 022 + cd . + /bin/rm -rf /home/scgl/rpmbuild/BUILDROOT/kernel-6.0.0_rc5+-1.s390x + /bin/mkdir -p /home/scgl/rpmbuild/BUILDROOT + /bin/mkdir /home/scgl/rpmbuild/BUILDROOT/kernel-6.0.0_rc5+-1.s390x + mkdir -p /home/scgl/rpmbuild/BUILDROOT/kernel-6.0.0_rc5+-1.s390x/boot + make -f ./Makefile image_name + cp test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo >&2; \ echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) arch/s390/boot/bzImage /home/scgl/rpmbuild/BUILDROOT/kernel-6.0.0_rc5+-1.s390x/boot/vmlinuz-6.0.0-rc5+ cp: invalid option -- 'e' Try 'cp --help' for more information. error: Bad exit status from /var/tmp/rpm-tmp.EgV6qJ (%install) Because the make call to get the image name is verbose and prints additional information. Fixes: 993bdde94547 ("kbuild: add image_name to no-sync-config-targets") Signed-off-by: Janis Schoetterl-Glausch Signed-off-by: Masahiro Yamada commit a8d5692659358eba46d3b2f7d96da7c390f41f71 Author: Zeng Heng Date: Wed Sep 14 20:09:21 2022 +0800 scripts: remove unused argument 'type' Remove unused function argument, and there is no logic changes. Signed-off-by: Zeng Heng Signed-off-by: Masahiro Yamada commit efc8338e3a72baf95294634b48c5f2d80dce1c5c Author: Zeng Heng Date: Wed Sep 14 09:59:06 2022 +0800 Kconfig: remove sym_set_choice_value sym_set_choice_value could be removed and directly call sym_set_tristate_value instead. Signed-off-by: Zeng Heng Suggested-by: Masahiro Yamada Signed-off-by: Masahiro Yamada commit f3304ecd7f060db1d4197fbdce5a503259f770d3 Author: Masahiro Yamada Date: Fri Sep 16 15:29:53 2022 +0900 linux/export: use inline assembler to populate symbol CRCs Since commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS"), the module versioning on the (non-upstreamed-yet) kvx Linux port is broken due to unexpected padding for __crc_* symbols. The kvx GCC adds padding so u32 gets 8-byte alignment instead of 4. I do not know if this happens for upstream architectures in general, but any compiler has the freedom to insert padding for faster access. Use the inline assembler to directly specify the wanted data layout. This is how we previously did before the breakage. Link: https://lore.kernel.org/lkml/20220817161438.32039-1-ysionneau@kalray.eu/ Link: https://lore.kernel.org/linux-kbuild/31ce5305-a76b-13d7-ea55-afca82c46cf2@kalray.eu/ Fixes: 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS") Reported-by: Yann Sionneau Signed-off-by: Masahiro Yamada Tested-by: Yann Sionneau commit 9ec6ab6ee5ca72afdf8f60c330ad997825c0819b Author: Masahiro Yamada Date: Wed Sep 7 03:49:35 2022 +0900 kbuild: use objtool-args-y to clean up objtool arguments Based on Linus' patch. Refactor scripts/Makefile.vmlinux_o as well. Link: https://lore.kernel.org/lkml/CAHk-=wgjTMQgiKzBZTmb=uWGDEQxDdyF1+qxBkODYciuNsmwnw@mail.gmail.com/ Suggested-by: Linus Torvalds Signed-off-by: Masahiro Yamada Acked-by: Peter Zijlstra Reviewed-by: Nick Desaulniers commit cc306abd19e8acdd85072b162d09e80408389cd8 Author: Masahiro Yamada Date: Tue Sep 6 15:13:06 2022 +0900 kbuild: fix and refactor single target build The single target build has a subtle bug for the combination for an individual file and a subdirectory. [1] 'make kernel/fork.i' builds only kernel/fork.i $ make kernel/fork.i CALL scripts/checksyscalls.sh DESCEND objtool CPP kernel/fork.i [2] 'make kernel/' builds only under the kernel/ directory. $ make kernel/ CALL scripts/checksyscalls.sh DESCEND objtool CC kernel/fork.o CC kernel/exec_domain.o [snip] CC kernel/rseq.o AR kernel/built-in.a But, if you try to do [1] and [2] in a single command, you will get only [1] with a weird log: $ make kernel/fork.i kernel/ CALL scripts/checksyscalls.sh DESCEND objtool CPP kernel/fork.i make[2]: Nothing to be done for 'kernel/'. With 'make kernel/fork.i kernel/', you should get both [1] and [2]. Rewrite the single target build. Signed-off-by: Masahiro Yamada commit 033a52d033607dab1c9b93962921dc6a9a9146b3 Author: Owen Rafferty Date: Wed Aug 31 15:57:08 2022 -0500 kbuild: rewrite check-local-export in sh/awk Remove the bash build dependency for those who otherwise do not have it installed. This also provides a significant speedup: $ make defconfig $ make yes2modconfig ... $ find . -name "*.o" | grep -v vmlinux | wc 3169 3169 89615 $ export NM=nm $ time sh -c 'find . -name "*.o" | grep -v vmlinux | xargs -n1 ./scripts/check-local-export' Without patch: 0m15.90s real 0m12.17s user 0m05.28s system With patch: dash + nawk 0m02.16s real 0m02.92s user 0m00.34s system dash + busybox awk 0m02.36s real 0m03.36s user 0m00.34s system dash + gawk 0m02.07s real 0m03.26s user 0m00.32s system bash + gawk 0m03.55s real 0m05.00s user 0m00.54s system Signed-off-by: Owen Rafferty Signed-off-by: Masahiro Yamada commit a6c26e38aa45c4732aeebb3203120aaf4997fc00 Author: Masahiro Yamada Date: Sun Aug 28 11:39:56 2022 +0900 Revert "kbuild: Make scripts/compile.h when sh != bash" This reverts commit [1] in the pre-git era. I do not know what problem happened in the script when sh != bash because there is no commit message. Now that this script is much simpler than it used to be, let's revert it, and let' see. (If this turns out to be problematic, fix the code with proper commit description.) [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=11acbbbb8a50f4de7dbe4bc1b5acc440dfe81810 Signed-off-by: Masahiro Yamada commit c7b594f53ed1c94d8bdab5e414f1fb3ef210884f Author: Masahiro Yamada Date: Sun Aug 28 11:39:55 2022 +0900 scripts/mkcompile_h: move LC_ALL=C to '$LD -v' Minimize the scope of LC_ALL=C like before commit 87c94bfb8ad3 ("kbuild: override build timestamp & version"). Give LC_ALL=C to '$LD -v' to get the consistent version output, as commit bcbcf50f5218 ("kbuild: fix ld-version.sh to not be affected by locale") mentioned the LD version is affected by locale. While I was here, I merged two sed invocations. Signed-off-by: Masahiro Yamada commit a55f283e8b473a3124705934a17d0ad61e34e6c1 Author: Masahiro Yamada Date: Sun Aug 28 11:39:54 2022 +0900 kbuild: generate include/generated/compile.h in top Makefile Now that UTS_VERSION was separated out, this header can be generated much earlier, and probably the top Makefile is a better place to do it than init/Makefile. Signed-off-by: Masahiro Yamada commit 2df8220cc511326508ec4da2f43ef69311bdd7b9 Author: Masahiro Yamada Date: Sun Aug 28 11:39:53 2022 +0900 kbuild: build init/built-in.a just once Kbuild builds init/built-in.a twice; first during the ordinary directory descending, second from scripts/link-vmlinux.sh. We do this because UTS_VERSION contains the build version and the timestamp. We cannot update it during the normal directory traversal since we do not yet know if we need to update vmlinux. UTS_VERSION is temporarily calculated, but omitted from the update check. Otherwise, vmlinux would be rebuilt every time. When Kbuild results in running link-vmlinux.sh, it increments the version number in the .version file and takes the timestamp at that time to really fix UTS_VERSION. However, updating the same file twice is a footgun. To avoid nasty timestamp issues, all build artifacts that depend on init/built-in.a are atomically generated in link-vmlinux.sh, where some of them do not need rebuilding. To fix this issue, this commit changes as follows: [1] Split UTS_VERSION out to include/generated/utsversion.h from include/generated/compile.h include/generated/utsversion.h is generated just before the vmlinux link. It is generated under include/generated/ because some decompressors (s390, x86) use UTS_VERSION. [2] Split init_uts_ns and linux_banner out to init/version-timestamp.c from init/version.c init_uts_ns and linux_banner contain UTS_VERSION. During the ordinary directory descending, they are compiled with __weak and used to determine if vmlinux needs relinking. Just before the vmlinux link, they are compiled without __weak to embed the real version and timestamp. Signed-off-by: Masahiro Yamada commit 561daaacb45eee3ccbe581da38c34ece77496312 Author: Masahiro Yamada Date: Sun Aug 28 11:39:52 2022 +0900 init/version.c: remove #include This is unneeded since commit 073a9ecb3a73 ("init/version.c: remove Version_ symbol"). Signed-off-by: Masahiro Yamada commit 7f37181393a9aaa695187701bb38f356df1f1cf8 Author: Masahiro Yamada Date: Sun Aug 28 11:39:51 2022 +0900 kbuild: move 'PHONY += modules_prepare' to the common part Unify the code between in-tree builds and external module builds. Signed-off-by: Masahiro Yamada commit f110e5a250e3c5db417e094b3dd86f1c135291ca Author: Masahiro Yamada Date: Sun Aug 28 11:39:50 2022 +0900 kbuild: refactor single builds of *.ko Remove the potentially invalid modules.order instead of using the temporary file. Also, KBUILD_MODULES is don't care for single builds. No need to cancel it. Signed-off-by: Masahiro Yamada commit f75a03340c2c2eea772e4d59412135021afea493 Author: Masahiro Yamada Date: Sun Aug 28 11:39:49 2022 +0900 kbuild: remove duplicated dependency between modules and modules_check The dependency, "modules: modules_check" is specified twice. Commit 1a998be620a1 ("kbuild: check module name conflict for external modules as well") missed to clean it up. 'PHONY += modules' also appears twice. Signed-off-by: Masahiro Yamada commit e30d448754284d6c7580b8f330e257e9801bec76 Author: Masahiro Yamada Date: Sat Aug 20 18:15:31 2022 +0900 nios2: move core-y in arch/nios2/Makefile to arch/nios2/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada commit d724b578a1f746db6fc1fd5e4cbba554a855dc8d Author: Masahiro Yamada Date: Sat Aug 20 18:15:30 2022 +0900 kbuild: do not deduplicate modules.order The AWK code was added to deduplicate modules.order in case $(obj-m) contains the same module multiple times, but it is actually unneeded since commit b2c885549122 ("kbuild: update modules.order only when contained modules are updated"). The list is already deduplicated before being processed by AWK because $^ is the deduplicated list of prerequisites. (Please note the real-prereqs macro uses $^) Yet, modules.order will contain duplication if two different Makefiles build the same module: foo/Makefile: obj-m += bar/baz.o foo/bar/Makefile: obj-m += baz.o However, the parallel builds cannot properly handle this case in the first place. So, it is better to let it fail (as already done by scripts/modules-check.sh). Signed-off-by: Masahiro Yamada commit b10fdeea8cf42c0d97b337e9e501c92da4389a03 Author: Masahiro Yamada Date: Sat Aug 20 18:15:29 2022 +0900 kbuild: check sha1sum just once for each atomic header It is unneeded to check the sha1sum every time. Create the timestamp files to manage it. Add '.' to clean-dirs because 'make clean' must visit ./Kbuild to clean up the timestamp files. Signed-off-by: Masahiro Yamada commit a3c4d4abaaf0b3fb3335a432fa9b75d414d1f987 Author: Masahiro Yamada Date: Sun Sep 25 03:19:09 2022 +0900 kbuild: hard-code KBUILD_ALLDIRS in scripts/Makefile.package My future plan is to list subdirectories in ./Kbuild. When it occurs, $(vmlinux-alldirs) will not contain all subdirectories. Let's hard-code the directory list until I get around to implementing a more sophisticated way for generating a source tarball. Signed-off-by: Masahiro Yamada Tested-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit 54bd1e548701640f2aff299aab192eec55571e01 Author: Mario Limonciello Date: Wed Sep 28 11:19:35 2022 -0500 ACPI: x86: s2idle: Add another ID to s2idle_dmi_table It's reported that "ASUSTeK COMPUTER INC. ROG Flow X16 GV601RW" has non-functional fans after resume when using the AMD codepath. This issue is fixed using the Microsoft codepath. Add the 3 variants of this system to the Microsoft codepath DMI table. * GV601RW * GV601RM * GV601RE Link: https://www.reddit.com/r/linuxhardware/comments/wh50nd/compatibility_report_asus_rog_flow_x16_gv601rm/ Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2148#note_1571241 Reported-by: Luke Jones Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 39f81776c6807d605cfec6fa7a2439fa4786034e Author: Mario Limonciello Date: Wed Sep 28 11:19:34 2022 -0500 ACPI: x86: s2idle: Fix a NULL pointer dereference Ryzen 7000 (Raphael) introduced AMDI0008 for _HID. This ID was added in commit ed470febf837 ("ACPI: PM: s2idle: Add support for upcoming AMD uPEP HID AMDI008"), but then removed in favor of aligning all new IDs to Rembrandt support in commit fd894f05cf30 ("ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt"). Unfortunately there was a mistake in commit 100a57379380 ("ACPI: x86: s2idle: Move _HID handling for AMD systems into structures") that can lead to a NULL pointer dereference accessing `dev_id->driver_data` in the sentinel of `amd_hid_ids`. Fix this dereference. Reported-by: Richard Gong Fixes: 100a57379380 ("ACPI: x86: s2idle: Move _HID handling for AMD systems into structures") Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 8dbc3e75a0a56fb0ab70781338a2283d28a09164 Author: Abhishek Pandit-Subedi Date: Tue Sep 27 13:17:20 2022 -0700 Bluetooth: Call shutdown for HCI_USER_CHANNEL Some drivers depend on shutdown being called for proper operation. Unset HCI_USER_CHANNEL and call the full close routine since shutdown is complementary to setup. Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Luiz Augusto von Dentz commit 4b8af331bb4d4cc8bb91c284b11b98dd1e265185 Author: Abhishek Pandit-Subedi Date: Tue Sep 27 09:58:15 2022 -0700 Bluetooth: Prevent double register of suspend Suspend notifier should only be registered and unregistered once per hdev. Simplify this by only registering during driver registration and simply exiting early when HCI_USER_CHANNEL is set. Reported-by: syzbot Fixes: 359ee4f834f5 (Bluetooth: Unregister suspend with userchannel) Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Luiz Augusto von Dentz commit 34800178b3027a7818446351db3b9730b8e9f912 Author: Martyna Szapar-Mudlaw Date: Thu Sep 15 14:14:34 2022 +0200 ice: Add support for VLAN priority filters in switchdev Enable support for adding TC rules that filter on the VLAN priority in switchdev mode. VLAN priority are the first 3 bits of 16b switch field vector word which contain also vlan id value within its last 12 bits. When getting vlan priority value from tc match.key it has to be shifted first to proper bits positions (by VLAN_PRIO_SHIFT) and then can be added to the joint 'vlan' field in ice_vlan_hdr in lookup element. The mask of lookup changes accordingly. 0x0FFF - when only vlan id is added in filter 0xE000 - when only vlan priority is added in filter 0xEFFF - when both these values are specified Signed-off-by: Martyna Szapar-Mudlaw Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 793189a2fc69465ed156b80f356b4e873e02d274 Author: Arkadiusz Kubalewski Date: Tue Sep 13 10:51:39 2022 +0200 ice: support features on new E810T variants Add new sub-device ids required for proper initialization of features on E810T devices supported by ice driver. Signed-off-by: Arkadiusz Kubalewski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 43c4958a3ddb4d1eac730ce95d3a9de589c96ba4 Author: Arkadiusz Kubalewski Date: Thu Sep 8 11:58:52 2022 +0200 ice: Merge pin initialization of E810 and E810T adapters Remove separate function initializing pins for E810T-based adapters and initialize pins based on feature bits. Signed-off-by: Maciej Machnikowski Signed-off-by: Arkadiusz Kubalewski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit dfdcbf1fc3ecc395e56afcacf0aa601dfadebd28 Merge: c68f4f4e296b6 84fe64f898913 Author: Jens Axboe Date: Wed Sep 28 11:11:16 2022 -0600 Merge tag 'nvme-6.1-2022-09-28' of git://git.infradead.org/nvme into for-6.1/block Pull NVMe updates from Christoph: "nvme updates for Linux 6.1 - handle effects after freeing the request (Keith Busch) - copy firmware_rev on each init (Keith Busch) - restrict management ioctls to admin (Keith Busch) - ensure subsystem reset is single threaded (Keith Busch) - report the actual number of tagset maps in nvme-pci (Keith Busch) - small fabrics authentication fixups (Christoph Hellwig) - add common code for tagset allocation and freeing (Christoph Hellwig) - stop using the request_queue in nvmet (Christoph Hellwig) - set min_align_mask before calculating max_hw_sectors (Rishabh Bhatnagar) - send a rediscover uevent when a persistent discovery controller reconnects (Sagi Grimberg) - misc nvmet-tcp fixes (Varun Prakash, zhenwei pi)" * tag 'nvme-6.1-2022-09-28' of git://git.infradead.org/nvme: (31 commits) nvmet: don't look at the request_queue in nvmet_bdev_set_limits nvmet: don't look at the request_queue in nvmet_bdev_zone_mgmt_emulate_all nvme: remove nvme_ctrl_init_connect_q nvme-loop: use the tagset alloc/free helpers nvme-loop: store the generic nvme_ctrl in set->driver_data nvme-loop: initialize sqsize later nvme-fc: use the tagset alloc/free helpers nvme-fc: store the generic nvme_ctrl in set->driver_data nvme-fc: keep ctrl->sqsize in sync with opts->queue_size nvme-rdma: use the tagset alloc/free helpers nvme-rdma: store the generic nvme_ctrl in set->driver_data nvme-tcp: use the tagset alloc/free helpers nvme-tcp: store the generic nvme_ctrl in set->driver_data nvme-tcp: remove the unused queue_size member in nvme_tcp_queue nvme: add common helpers to allocate and free tagsets nvme-auth: add a MAINTAINERS entry nvmet: add helpers to set the result field for connect commands nvme: improve the NVME_CONNECT_AUTHREQ* definitions nvmet-auth: don't try to cancel a non-initialized work_struct nvmet-tcp: remove nvmet_tcp_finish_cmd ... commit ed7ceac157c27bdc64e79a3229f5ab6e8899597f Author: Masahiro Yamada Date: Sat Aug 20 18:15:28 2022 +0900 kbuild: add phony targets to ./Kbuild missing-syscalls and old-atomics are meant to be phony targets. Adding them to always-y is odd. (always-y should generate something). Add a new phony target 'prepare', which depends on all the other. Signed-off-by: Masahiro Yamada commit a7f3257da8a86b96fb9bf1bba40ae0bbd7f1885a Author: Masahiro Yamada Date: Sun Aug 7 09:48:09 2022 +0900 kbuild: remove the target in signal traps when interrupted When receiving some signal, GNU Make automatically deletes the target if it has already been changed by the interrupted recipe. If the target is possibly incomplete due to interruption, it must be deleted so that it will be remade from scratch on the next run of make. Otherwise, the target would remain corrupted permanently because its timestamp had already been updated. Thanks to this behavior of Make, you can stop the build any time by pressing Ctrl-C, and just run 'make' to resume it. Kbuild also relies on this feature, but it is equivalently important for any build systems that make decisions based on timestamps (if you want to support Ctrl-C reliably). However, this does not always work as claimed; Make immediately dies with Ctrl-C if its stderr goes into a pipe. [Test Makefile] foo: echo hello > $@ sleep 3 echo world >> $@ [Test Result] $ make # hit Ctrl-C echo hello > foo sleep 3 ^Cmake: *** Deleting file 'foo' make: *** [Makefile:3: foo] Interrupt $ make 2>&1 | cat # hit Ctrl-C echo hello > foo sleep 3 ^C$ # 'foo' is often left-over The reason is because SIGINT is sent to the entire process group. In this example, SIGINT kills 'cat', and 'make' writes the message to the closed pipe, then dies with SIGPIPE before cleaning the target. A typical bad scenario (as reported by [1], [2]) is to save build log by using the 'tee' command: $ make 2>&1 | tee log This can be problematic for any build systems based on Make, so I hope it will be fixed in GNU Make. The maintainer of GNU Make stated this is a long-standing issue and difficult to fix [3]. It has not been fixed yet as of writing. So, we cannot rely on Make cleaning the target. We can do it by ourselves, in signal traps. As far as I understand, Make takes care of SIGHUP, SIGINT, SIGQUIT, and SITERM for the target removal. I added the traps for them, and also for SIGPIPE just in case cmd_* rule prints something to stdout or stderr (but I did not observe an actual case where SIGPIPE was triggered). [Note 1] The trap handler might be worth explaining. rm -f $@; trap - $(sig); kill -s $(sig) $$ This lets the shell kill itself by the signal it caught, so the parent process can tell the child has exited on the signal. Generally, this is a proper manner for handling signals, in case the calling program (like Bash) may monitor WIFSIGNALED() and WTERMSIG() for WCE although this may not be a big deal here because GNU Make handles SIGHUP, SIGINT, SIGQUIT in WUE and SIGTERM in IUE. IUE - Immediate Unconditional Exit WUE - Wait and Unconditional Exit WCE - Wait and Cooperative Exit For details, see "Proper handling of SIGINT/SIGQUIT" [4]. [Note 2] Reverting 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") would directly address [1], but it only saves if_changed_dep. As reported in [2], all commands that use redirection can potentially leave an empty (i.e. broken) target. [Note 3] Another (even safer) approach might be to always write to a temporary file, and rename it to $@ at the end of the recipe. > $(tmp-target) mv $(tmp-target) $@ It would require a lot of Makefile changes, and result in ugly code, so I did not take it. [Note 4] A little more thoughts about a pattern rule with multiple targets (or a grouped target). %.x %.y: %.z When interrupted, GNU Make deletes both %.x and %.y, while this solution only deletes $@. Probably, this is not a big deal. The next run of make will execute the rule again to create $@ along with the other files. [1]: https://lore.kernel.org/all/YLeot94yAaM4xbMY@gmail.com/ [2]: https://lore.kernel.org/all/20220510221333.2770571-1-robh@kernel.org/ [3]: https://lists.gnu.org/archive/html/help-make/2021-06/msg00001.html [4]: https://www.cons.org/cracauer/sigint.html Fixes: 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") Reported-by: Ingo Molnar Reported-by: Rob Herring Signed-off-by: Masahiro Yamada Tested-by: Ingo Molnar Reviewed-by: Nicolas Schier commit ba194232edc032be2188ed792330bdd7bd5d4363 Author: Peng Fan Date: Wed Sep 28 14:47:56 2022 +0800 remoteproc: Support attach recovery after rproc crash Current logic only support main processor to stop/start the remote processor after crash. However to SoC, such as i.MX8QM/QXP, the remote processor could do attach recovery after crash and trigger watchdog to reboot itself. It does not need main processor to load image, or stop/start remote processor. Introduce two functions: rproc_attach_recovery, rproc_boot_recovery for the two cases. Boot recovery is as before, let main processor to help recovery, while attach recovery is to recover itself without help. To attach recovery, we only do detach and attach. Acked-by: Arnaud Pouliquen Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220928064756.4059662-3-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 929a6cdfaeac9de6a1004eb18999e1439527cfb4 Merge: b9a5cbf8ba24e 2a8a7c0eaa874 Author: Jakub Kicinski Date: Wed Sep 28 09:46:35 2022 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== netfilter fix for net-next This is a late bug fix for the *net-next* tree to make nftables "fib" expression play nice with VRF devices. This was broken since day 1 (v4.10) so I don't see a compelling reason to push this via net at the last minute. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: nft_fib: Fix for rpath check with VRF devices ==================== Link: https://lore.kernel.org/r/20220928113908.4525-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 49f27f2b4bfa8b6e26f02df615e544f52648bfb2 Author: Peng Fan Date: Wed Sep 28 14:47:55 2022 +0800 remoteproc: Introduce rproc features remote processor may support: - boot recovery with help from main processor - self recovery without help from main processor - iommu - etc Introduce rproc features could simplify code to avoid adding more bool flags Acked-by: Arnaud Pouliquen Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220928064756.4059662-2-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 748bc4dd9e663f23448d8ad7e58c011a67ea1eca Author: Jason A. Donenfeld Date: Thu Sep 22 18:46:04 2022 +0200 random: use expired timer rather than wq for mixing fast pool Previously, the fast pool was dumped into the main pool periodically in the fast pool's hard IRQ handler. This worked fine and there weren't problems with it, until RT came around. Since RT converts spinlocks into sleeping locks, problems cropped up. Rather than switching to raw spinlocks, the RT developers preferred we make the transformation from originally doing: do_some_stuff() spin_lock() do_some_other_stuff() spin_unlock() to doing: do_some_stuff() queue_work_on(some_other_stuff_worker) This is an ordinary pattern done all over the kernel. However, Sherry noticed a 10% performance regression in qperf TCP over a 40gbps InfiniBand card. Quoting her message: > MT27500 Family [ConnectX-3] cards: > Infiniband device 'mlx4_0' port 1 status: > default gid: fe80:0000:0000:0000:0010:e000:0178:9eb1 > base lid: 0x6 > sm lid: 0x1 > state: 4: ACTIVE > phys state: 5: LinkUp > rate: 40 Gb/sec (4X QDR) > link_layer: InfiniBand > > Cards are configured with IP addresses on private subnet for IPoIB > performance testing. > Regression identified in this bug is in TCP latency in this stack as reported > by qperf tcp_lat metric: > > We have one system listen as a qperf server: > [root@yourQperfServer ~]# qperf > > Have the other system connect to qperf server as a client (in this > case, it’s X7 server with Mellanox card): > [root@yourQperfClient ~]# numactl -m0 -N0 qperf 20.20.20.101 -v -uu -ub --time 60 --wait_server 20 -oo msg_size:4K:1024K:*2 tcp_lat Rather than incur the scheduling latency from queue_work_on, we can instead switch to running on the next timer tick, on the same core. This also batches things a bit more -- once per jiffy -- which is okay now that mix_interrupt_randomness() can credit multiple bits at once. Reported-by: Sherry Yang Tested-by: Paul Webb Cc: Sherry Yang Cc: Phillip Goerl Cc: Jack Vogel Cc: Nicky Veitch Cc: Colm Harrington Cc: Ramanan Govindarajan Cc: Sebastian Andrzej Siewior Cc: Dominik Brodowski Cc: Tejun Heo Cc: Sultan Alsawaf Cc: stable@vger.kernel.org Fixes: 58340f8e952b ("random: defer fast pool mixing to worker") Signed-off-by: Jason A. Donenfeld commit 9ee0507e896b45af6d65408c77815800bce30008 Author: Jason A. Donenfeld Date: Thu Sep 22 18:46:04 2022 +0200 random: avoid reading two cache lines on irq randomness In order to avoid reading and dirtying two cache lines on every IRQ, move the work_struct to the bottom of the fast_pool struct. add_ interrupt_randomness() always touches .pool and .count, which are currently split, because .mix pushes everything down. Instead, move .mix to the bottom, so that .pool and .count are always in the first cache line, since .mix is only accessed when the pool is full. Fixes: 58340f8e952b ("random: defer fast pool mixing to worker") Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Jason A. Donenfeld commit 25d0bef5d1d0dc2f919baa033be157d5c313994c Author: Zeng Heng Date: Wed Sep 28 09:02:34 2022 -0700 Input: ibm-panel - add missing MODULE_DEVICE_TABLE This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20220928143133.1809491-1-zengheng4@huawei.com Signed-off-by: Dmitry Torokhov commit 600655cdc076fb7688887b3819628c9d0878601c Author: Andy Shevchenko Date: Wed Sep 28 14:05:48 2022 +0300 Input: icn8505 - utilize acpi_get_subsystem_id() Replace open coded variant of recently introduced acpi_get_subsystem_id(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220928110548.43955-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov commit 4709f9ea338d34276d747c88323f964e148c0c09 Author: Andy Shevchenko Date: Fri Aug 26 20:07:15 2022 +0300 pwm: sysfs: Replace sprintf() with sysfs_emit() While the uses in this code are unproblematic, it's generally safer for sysfs outputs to use the new sysfs_emit() helper instead of raw calls to sprintf() and friends. This also has the benefit of annotating the uses, which makes them easier to audit and potentially use them to generate sysfs documentation from them. This patch replaces existing sprintf() calls straightforwardly with the new helper. Signed-off-by: Andy Shevchenko Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 67ef3d7a96b28eba29a0b161541897fd6fab7b73 Author: Rafael J. Wysocki Date: Tue Sep 27 16:09:13 2022 +0200 MAINTAINERS: Drop records pointing to 01.org/linux-acpi The https://01.org/linux-acpi web site has become permanently inaccessible, so drop the records pointing to it from MAINTAINERS. Signed-off-by: Rafael J. Wysocki commit 448e711693e48d03f7933ab3673334701b0c3f41 Author: Oliver Upton Date: Fri Aug 19 16:21:00 2022 +0000 KVM: selftests: Update top-of-file comment in psci_test Fix the comment to accurately describe the test and recently added SYSTEM_SUSPEND test case. What was once psci_cpu_on_test was renamed and extended to squeeze in a test case for PSCI SYSTEM_SUSPEND. Nonetheless, the author of those changes (whoever they may be...) failed to update the file comment to reflect what had changed. Reported-by: Reiji Watanabe Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220819162100.213854-1-oliver.upton@linux.dev commit a97edbaa1906f4d8e01248939cf21c6382b11a6b Author: Rafael J. Wysocki Date: Mon Sep 26 22:27:56 2022 +0200 ACPI: Kconfig: Drop link to https://01.org/linux-acpi Because the https://01.org/linux-acpi web site has become permanently inaccessible, drop the remaining link to it from the ACPI Kconfig. Signed-off-by: Rafael J. Wysocki commit d206cef03c4827984e6ac88a9472b70c41f5b28d Author: Rafael J. Wysocki Date: Mon Sep 26 22:20:03 2022 +0200 ACPI: docs: Drop useless DSDT override documentation Because https://01.org/linux-acpi web site has become permanently inaccessible, the "Overriding DSDT" document in the kernel tree pointing to it as the main source of information is useless (and the config option name mentioned by it is incorrect), so drop it and drop the pointer to it from the ACPI Kconfig. Signed-off-by: Rafael J. Wysocki commit b9962b699878c2cc61b97304b24c9582d366c58f Author: Rafael J. Wysocki Date: Tue Sep 27 16:10:31 2022 +0200 ACPI: DPTF: Drop stale link from Kconfig help The web site pointed to from the DPTF Kconfig help is not accessible any more, so drop the link to it from there. Signed-off-by: Rafael J. Wysocki commit 02010cf0093629b9eeadade1f2684d85eaa3390f Author: Yang Yingliang Date: Thu Sep 22 18:37:03 2022 +0800 mfd: ocelot-spi: Add missing MODULE_DEVICE_TABLE This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Fixes: f3e893626abe ("mfd: ocelot: Add support for the vsc7512 chip via spi") Signed-off-by: Yang Yingliang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220922103703.1731266-1-yangyingliang@huawei.com commit 11cb8da0189b417392e2334ae967b0ba1f0d1be8 Author: Chris Morgan Date: Fri Aug 26 21:16:22 2022 -0500 power: supply: Add charger driver for Rockchip RK817 Add support for the Rockchip rk817 battery charger integrated into the rk817 PMIC. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220827021623.23829-4-macroalpha82@gmail.com commit e1f1629df957b2f352d1ac2a5b0919280858c7e3 Author: ChiYuan Huang Date: Fri Sep 16 10:38:49 2022 +0800 dt-bindings: mfd: mt6370: Fix the indentation in the example Fix the indentation in the binding example. There're two redudant space charactors need to be removed. Fixes: 76f52f815f1a ("dt-bindings: mfd: Add MediaTek MT6370") Signed-off-by: ChiYuan Huang Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/1663295929-9024-1-git-send-email-u0084500@gmail.com commit 834382ea32865a4bdeae83ec2dcb9321dc9489f2 Author: Jens Hillenstedt Date: Thu Sep 15 11:20:04 2022 +0200 mfd: da9061: Fix Failed to set Two-Wire Bus Mode. In da9062_i2c_probe() regmap_clear_bits() tries to access CONFIG_J register. As CONFIG_J is not present in da9061_aa_writeable_ranges[] probe of da9061 fails: da9062 2-0058: Entering I2C mode! da9062 2-0058: Failed to set Two-Wire Bus Mode. da9062: probe of 2-0058 failed with error -5 Add CONFIG_J register to da9061_aa_writeable_ranges[]. Fixes: 5c6f0f456351 ("mfd: da9062: Support SMBus and I2C mode") Signed-off-by: Jens Hillenstedt Reviewed-by: Adam Ward Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220915092004.168744-1-jens.hillenstedt@ise.de commit 9c90f21f93e4b9c8c9a799ca7c09b1323b9fca11 Author: Peng Wu Date: Tue Sep 13 07:16:59 2022 +0000 mfd: htc-i2cpld: Fix an IS_ERR() vs NULL bug in htcpld_core_probe() The gpiochip_request_own_desc() function returns error pointers on error, it doesn't return NULL. Fixes: 0ef5164a81fbf ("mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver") Signed-off-by: Peng Wu Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220913071659.94677-1-wupeng58@huawei.com commit a328ae8504dbc55f92be0e781aac301a23b5c21e Author: Krzysztof Kozlowski Date: Fri Sep 9 11:10:56 2022 +0200 dt-bindings: mfd: qcom,tcsr: Drop simple-mfd from IPQ6018 Commit 7677ed11e9fa ("dt-bindings: mfd: qcom,tcsr: Convert to dtschema") converted bindings to DT schema literally - including the qcom,tcsr-ipq6018 expecting syscon and simple-mfd. Such configuration is not used in DTS and there is no actual need of it. The TCSR block is purely configuration block and should not have children. Any child device should be simply moved outside of TCSR syscon block. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220909091056.128949-1-krzysztof.kozlowski@linaro.org commit 8325a6c24ad78b8c1acc3c42b098ee24105d68e5 Author: Jiasheng Jiang Date: Tue Sep 13 17:11:12 2022 +0800 mfd: sm501: Add check for platform_driver_register() As platform_driver_register() can return error numbers, it should be better to check platform_driver_register() and deal with the exception. Fixes: b6d6454fdb66 ("[PATCH] mfd: SM501 core driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220913091112.1739138-1-jiasheng@iscas.ac.cn commit a5e84f33cdd7957e5497a0b324cc4bd675fb8f08 Author: Allen-KH Cheng Date: Fri Sep 23 21:11:44 2022 +0800 dt-bindings: mfd: mediatek: Add scpsys compatible for mt8186 Add a new scpsys compatible for mt8186 SoC. Signed-off-by: Allen-KH Cheng Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220923131148.6678-2-allen-kh.cheng@mediatek.com commit 6c6a8c6af6423b5d316dcb8016857e33f36ddb35 Author: Andy Shevchenko Date: Fri Sep 23 20:54:01 2022 +0300 mfd: twl4030: Add missed linux/device.h header With compile testing on non-OMAP platforms compiler might be not happy: In function ‘twl4030_sih_setup’: error: implicit declaration of function ‘dev_err’ [-Werror=implicit-function-declaration] error: implicit declaration of function ‘dev_info’ [-Werror=implicit-function-declaration] In function ‘twl4030_init_irq’: error: invalid use of undefined type ‘struct device’ Add missed header. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220923175401.8723-1-andriy.shevchenko@linux.intel.com commit c15c19dd4eb81e38636564198e09364fe8fcb2a9 Author: Conor Dooley Date: Fri Sep 16 20:00:10 2022 +0100 dt-bindings: mfd: dlg,da9063: Add missing regulator patterns Commit 5621d3977e29 ("dt-bindings: mfd: Add missing (unevaluated| additional)Properties on child nodes") exposed a flaw in the original binding, where "merged" versions of some regulators were missing, leading to warnings on the HiFive Unmatched Devicetree. Add the missing patterns (and merge some of the trivial ones). Signed-off-by: Conor Dooley Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220916190009.2292223-1-conor@kernel.org commit a53ffb04ea5715ff2c33e33800382db6393f930a Author: Chunyan Zhang Date: Fri Sep 9 23:24:20 2022 +0800 dt-bindings: mfd: sprd: Add bindings for ums512 global registers Add bindings for Unisoc system global register which provide register map for clocks. Signed-off-by: Chunyan Zhang Signed-off-by: Cixi Geng Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220909152421.278662-2-gengcixi@gmail.com commit 1801c448d48405b1bfe7093f2ddc5461962521fa Author: Andy Shevchenko Date: Tue Sep 6 16:42:56 2022 +0300 mfd: intel_soc_pmic_chtdc_ti: Switch from __maybe_unused to pm_sleep_ptr() etc Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less heavier for builds than the use of __maybe_unused attributes. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220906134256.14293-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 3064c115bcb5165793366d348a7efc70d32b82e5 Author: Sebastian Reichel Date: Tue Sep 6 16:38:23 2022 +0200 dt-bindings: mfd: syscon: Add rk3588 QoS register compatible Document rk3588 compatible for QoS registers. Acked-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel Reviewed-by: Heiko Stuebner Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220906143825.199089-5-sebastian.reichel@collabora.com commit ac3e91199d694612a74673b0b53e339ad02b564d Author: Dmitry Torokhov Date: Tue Sep 6 11:35:00 2022 -0700 mfd: stmpe: Switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. We also need to patch relevant DTS files, as the original code relied on the fact that of_get_named_gpio_flags() would fetch any data encoded in GPIO flags, even if it does not reflect valid flags for a GPIO. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/YxeS1BK2OBH1P/kO@google.com commit 62a0261c9fa88721eb0cfb91bf51832b333e9f75 Author: Luca Weiss Date: Fri Sep 2 13:10:53 2022 +0200 mfd: qcom-spmi-pmic: Add pm7250b compatible Document the compatible for pm7250b that is used with e.g. sm6350. Also while we're at it, sort the compatibles alphabetically. Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220902111055.106814-1-luca.weiss@fairphone.com commit 42839dcafd0a8327d8f98a117e7beea3f72cf13b Author: Rob Herring Date: Tue Aug 23 09:56:35 2022 -0500 dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Acked-by: Heiko Stuebner Acked-by: Alistair Francis Reviewed-by: Jernej Skrabec Reviewed-by: Krzysztof Kozlowski Acked-by: Charles Keepax Acked-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220823145649.3118479-4-robh@kernel.org commit a47137a5134be2f0b4724fe548362a253727d8b1 Author: Linus Walleij Date: Mon Sep 5 13:58:10 2022 +0200 mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver Instead of passing GPIO numbers pertaining to ourselves through platform data, just request GPIO descriptors from our own GPIO chips and use them, and cut down on the unnecessary complexity. Cc: Aaro Koskinen Cc: Janusz Krzysztofik Cc: Tony Lindgren Cc: Cory Maccarrone Cc: linux-omap@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905115810.5987-1-linus.walleij@linaro.org commit 6a96f6c132f2a9bdd80bbe4cd8adee565f8af377 Author: Russ Weight Date: Fri Sep 2 09:57:05 2022 -0700 mfd: intel-m10-bmc: Add d5005 bmc secure update driver Add the D5005 BMC secure update driver to the MAX10 BMC driver for D5005 devices. Signed-off-by: Russ Weight Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220902165706.518074-2-russell.h.weight@intel.com commit 2002d60dcfc9066b788842849eae4f01bacd7228 Author: Krzysztof Kozlowski Date: Tue Aug 23 13:10:21 2022 +0300 dt-bindings: mfd: syscon: Drop ref from reg-io-width reg-io-width is a standard property, so no need for defining its type Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220823101021.387034-1-krzysztof.kozlowski@linaro.org commit a592aa3a2a8cb246547fca2c31922d51fcf4e1ed Author: Chris Morgan Date: Fri Aug 26 21:16:20 2022 -0500 dt-bindings: mfd: Add Rockchip rk817 battery charger support Create dt-binding documentation to document rk817 battery and charger usage. New device-tree properties have been added. - rockchip,resistor-sense-micro-ohms: The value in microohms of the sample resistor. - rockchip,sleep-enter-current-microamp: The value in microamps of the sleep enter current. - rockchip,sleep-filter-current: The value in microamps of the sleep filter current. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220827021623.23829-2-macroalpha82@gmail.com commit 07a1300336870ba84670c4b4816fcb03c9d45498 Author: Krzysztof Kozlowski Date: Mon Aug 8 14:11:13 2022 +0300 MAINTAINERS: Drop Robert Jones Emails to Robert Jones bounce ("550 5.2.1 The email account that you tried to reach is disabled"). Signed-off-by: Krzysztof Kozlowski Acked-By: Tim Harvey Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220808111113.71890-1-krzysztof.kozlowski@linaro.org commit 90d7c4033c9a1586bd46e38878aeae5a6c3146cb Author: Robert Marko Date: Fri Aug 19 00:18:12 2022 +0200 mfd: qcom-spmi-pmic: Add support for PMP8074 Add support for PMP8074 PMIC which is a companion PMIC for the Qualcomm IPQ8074 SoC-s. It shares the same subtype identifier as PM8901. Signed-off-by: Robert Marko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220818221815.346233-2-robimarko@gmail.com commit ce436a301615b9c256208f8d6e107d2983d43d62 Author: Robert Marko Date: Fri Aug 19 00:18:11 2022 +0200 dt-bindings: mfd: qcom-spmi-pmic: Add support for PMP8074 Document compatible for the PMP8074 PMIC. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220818221815.346233-1-robimarko@gmail.com commit 6a32d3995f7bcf04598548778da54d2b6932b6a5 Author: Wolfram Sang Date: Thu Aug 18 23:00:29 2022 +0200 mfd: Move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220818210030.7012-1-wsa+renesas@sang-engineering.com commit 75db7907355ca5e2ff606e9dd3e86b6c3a455fe2 Author: Dan Carpenter Date: Thu Aug 11 13:53:05 2022 +0300 mfd: fsl-imx25: Fix check for platform_get_irq() errors The mx25_tsadc_remove() function assumes all non-zero returns are success but the platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Fixes: 18f773937968 ("mfd: fsl-imx25: Clean up irq settings during removal") Signed-off-by: Dan Carpenter Reviewed-by: Martin Kaiser Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/YvTfkbVQWYKMKS/t@kili commit f8c1940165bea6200ce2aa1cb515a2ffa0709d74 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:54 2022 +0300 dt-bindings: mfd: qcom,tcsr: Add several devices Document existing (MSM8996, SC7280) and new compatibles for TCSR syscon registers (QCS404, SC7180, SDM630, SDM845, SM8150, MSM8998). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220819083209.50844-2-krzysztof.kozlowski@linaro.org commit 599618e5891e7d6f3caebae56f6ef65b2543ed05 Merge: f76349cf41451 fb2ac84f8accc Author: Rafael J. Wysocki Date: Wed Sep 28 17:14:48 2022 +0200 Merge tag 'devfreq-next-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull devfreq next for v6.1 from Chanwoo Choi: "1. Handle -EPROBE_DEFER when regulator is not probed on mtk-ci-devfreq.c 2. Use dev_err_probe to reduce the error log on rockchip-dfi.c" * tag 'devfreq-next-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: rockchip-dfi: Fix an error message PM / devfreq: mtk-cci: Handle sram regulator probe deferral commit 8e3d08676735c6df6e0781a94575315e0ee2bddb Merge: 71bb5c82aaaea c4c0efb06f17f Author: Rafael J. Wysocki Date: Wed Sep 28 17:10:15 2022 +0200 Merge tag 'cpufreq-arm-updates-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull cpufreq/arm updates for 6.1-rc1 from Viresh Kumar: "- Add SM6115 to cpufreq-dt blocklist (Adam Skladowski). - Add support for Tegra239 and minor cleanups (Sumit Gupta, ye xingchen, and Yang Yingliang). - Add freq qos for qcom cpufreq driver and minor cleanups (Xuewen Yan, and Viresh Kumar). - Minor cleanups around functions called at module_init() (Xiu Jianfeng). - Use module_init and add module_exit for bmips driver (Zhang Jianhua)." * tag 'cpufreq-arm-updates-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh cpufreq: Add __init annotation to module init funcs cpufreq: tegra194: change tegra239_cpufreq_soc to static cpufreq: tegra194: Add support for Tegra239 cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning cpufreq: tegra194: Remove the unneeded result variable cpufreq: bmips-cpufreq: Use module_init and add module_exit cpufreq: Add SM6115 to cpufreq-dt-platdev blocklist commit f4b632da13cf0ee39cdbd4ff08d1961ed50e3c14 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:41 2022 +0300 dt-bindings: mfd: qcom,spmi-pmic: Fix TM ADC node schema on PM8998 There are two bindings for Qualcomm SPMI PMIC Thermal Monitoring ADC: one for ADC HC and one for ADC TM5 and TM7. PM8998 uses the former one, so fix matching of child schema: qcom/msm8998-asus-novago-tp370ql.dtb: pmic@0: adc-tm@3400:compatible:0: 'qcom,spmi-adc-tm-hc' is not one of ['qcom,spmi-adc-tm5', 'qcom,spmi-adc-tm5-gen2', 'qcom,adc-tm7'] Fixes: 3f5117be9584 ("dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC") Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220828084341.112146-15-krzysztof.kozlowski@linaro.org commit ea0dd0df65cc4e5516fa3585c8768e6abb763929 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:40 2022 +0300 dt-bindings: mfd: qcom,spmi-pmic: Fix regulator node schema The regulators node of Qualcomm SPMI PMIC represents sub-device, so it has its own compatible, multiple regulators and uses dedicated bindings. Fixes: 3f5117be9584 ("dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC") Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220828084341.112146-14-krzysztof.kozlowski@linaro.org commit 6f42a14bc20618c13ffe26d01fffb162b4a01cb1 Author: Krzysztof Kozlowski Date: Sun Aug 28 16:01:13 2022 +0300 dt-bindings: mfd: qcom,spmi-pmic: Extend example Add a more complete example with PM6150 to provide better validation of the bindings. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220828130113.5845-1-krzysztof.kozlowski@linaro.org commit f5e90351a31f96e7e42a14a5cc686450b60fb94a Author: Krzysztof Kozlowski Date: Wed Aug 17 17:22:46 2022 +0300 dt-bindings: mfd: syscon: Require specific compatible also for simple-mfd The syscon bindings require a device specific compatible, beside the "syscon". However schema counts "simple-mfd" as such, which allows simple-mfd+syscon to sneak in. Adjust the match to be sure simple-mfd also comes with a device specific compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220817142246.828762-5-krzysztof.kozlowski@linaro.org commit 0a6df9f16f51bae699a2dee067e92d82a2a3ff05 Author: Krzysztof Kozlowski Date: Sun Aug 28 09:51:23 2022 +0300 dt-bindings: mfd: qcom,spmi-pmic: Add missing compatibles Conversion from TXT to DT schema lost several compatibles. Fixes: 3f5117be9584 ("dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: David Heidelberg Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220828065123.39734-1-krzysztof.kozlowski@linaro.org commit 26331d261f49949bff6477fc9c844b17076fa245 Author: Tinghan Shen Date: Thu Aug 11 10:57:59 2022 +0800 dt-bindings: mfd: mt8195: Add bindings for MediaTek SCPSYS The System Control Processor System (SCPSYS) has several power management related tasks in the system. Add the bindings for it. Signed-off-by: Tinghan Shen Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220811025813.21492-7-tinghan.shen@mediatek.com commit 79ea68e0a9cf8c0f479339aca0c60f915522ff32 Author: Rob Herring Date: Wed Aug 10 10:16:35 2022 -0600 dt-bindings: mfd: aspeed,ast2x00-scu: Convert to DT schema format Convert the aspeed,ast2[456]00-scu binding to DT schema format. The original binding was missing '#address-cells', '#size-cells', 'ranges', and child nodes, so add them. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220810161635.73936-3-robh@kernel.org commit 6460f51ae317aad1d0530e004890e09bff60674d Author: ChiYuan Huang Date: Wed Aug 10 10:55:40 2022 +0800 dt-binding: mfd: Add Richtek RT5120 PMIC support Add Richtek RT5120 PMIC devicetree document. Reviewed-by: Krzysztof Kozlowski Signed-off-by: ChiYuan Huang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/1660100142-32493-2-git-send-email-u0084500@gmail.com commit 4e4627e1aefdbf3a7f7ae85dc5ca8a583e30c87e Author: ChiYuan Huang Date: Wed Aug 10 10:55:41 2022 +0800 mfd: rt5120: Add Richtek PMIC support Add Richtek RT5120 PMIC I2C driver. Signed-off-by: ChiYuan Huang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/1660100142-32493-3-git-send-email-u0084500@gmail.com commit 8e88c61d6f3432f27a2c6b8bc58ae4fe974f4b6d Author: Michal Oleszczyk Date: Tue Aug 9 08:03:36 2022 +0200 mfd: core: Delete corresponding OF node entries from list on MFD removal When we consider MFD which implements hotplug (e.g. USB hotplug driver based on product and vendor IDs) functionality it turns out that its sub-devices are correctly matched with corresponding device tree nodes only at the first time. When physical device reboots or is replugged (and MFD driver is disconnected and probed back again) all sub-devices fails in mfd_add_device() with error 'Failed to locate of_node'. The reason of that behavior is that when any MFD sub-device is created for the first time (and matched with device tree node) it is added to the mfd_of_node_list. It looks like this list is never cleaned even if devices added there are intentionally removed from the system. So when MFD device is replugged and all sub-devices are matched with their device tree nodes again they fail as matched nodes already exist in mfd_of_node_list. In other words current implementation does not support MFD with hotplug feature. This commit extends MFD core for hotplugging support by removing appropriate OF node entry from mfd_of_node_list when corresponding device is removed from the system. Thanks to that when device is added once again it can be matched with its device tree node successfully. Signed-off-by: Michal Oleszczyk Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220809060336.31892-1-m.oleszczyk@grinn-global.com commit 31961dc598ab8d68c4c6f2e572f9f101e1317cba Author: Jason Wang Date: Wed Aug 3 04:17:57 2022 +0800 mfd: twl-core: Fix double "to to" in comment. The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220802201757.8142-1-wangborong@cdjrlc.com commit 557244f6284f30613f2d61f14b579303165876c3 Author: Christophe JAILLET Date: Sun Jul 31 11:55:38 2022 +0200 mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() In lp8788_irq_init(), if an error occurs after a successful irq_domain_add_linear() call, it must be undone by a corresponding irq_domain_remove() call. irq_domain_remove() should also be called in lp8788_irq_exit() for the same reason. Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver") Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/bcd5a72c9c1c383dd6324680116426e32737655a.1659261275.git.christophe.jaillet@wanadoo.fr commit becfdcd75126b20b8ec10066c5e85b34f8994ad5 Author: Christophe JAILLET Date: Sun Jul 31 11:55:27 2022 +0200 mfd: lp8788: Fix an error handling path in lp8788_probe() Should an error occurs in mfd_add_devices(), some resources need to be released, as already done in the .remove() function. Add an error handling path and a lp8788_irq_exit() call to undo a previous lp8788_irq_init(). Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver") Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/18398722da9df9490722d853e4797350189ae79b.1659261275.git.christophe.jaillet@wanadoo.fr commit 3fa9e4cfb55da512ebfd57336fde468830719298 Author: Christophe JAILLET Date: Sun Jul 31 14:06:23 2022 +0200 mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq() If devm_of_platform_populate() fails, some resources need to be released. Introduce a mx25_tsadc_unset_irq() function that undoes mx25_tsadc_setup_irq() and call it both from the new error handling path of the probe and in the remove function. Fixes: a55196eff6d6 ("mfd: fsl-imx25: Use devm_of_platform_populate()") Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/d404e04828fc06bcfddf81f9f3e9b4babbe35415.1659269156.git.christophe.jaillet@wanadoo.fr commit 625065dae9f1e7dc9744e6de45101bc1752ef1f3 Author: Samuel Holland Date: Tue Aug 9 20:34:30 2022 -0500 dt-bindings: mfd: x-powers,axp152: Document the AXP228 variant AXP228 is a PMIC used on boards such as the Clockwork ClockworkPi and DevTerm. Its register map appears to be identical to the AXP221 variant. The only known difference is in the default values for regulator on/off states and voltages. Signed-off-by: Samuel Holland Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220810013430.27061-1-samuel@sholland.org commit 5e88619b306482d0ac69fa8cce01271f540d551b Author: Alistair Francis Date: Wed May 25 21:55:51 2022 +1000 mfd: silergy,sy7636a: Add config option MFD_SY7636A Add a specific MFD_SY7636A config option. As part of this change we can use MFD_SY7636A as a dependency for all SY7636a components and also remove the name from MFD_SIMPLE_MFD_I2C as it no longer needs to be selectable. Signed-off-by: Alistair Francis Reviewed-by: Guenter Roeck Acked-by: Mark Brown Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220525115554.430971-2-alistair@alistair23.me commit b2adf788e6037cea0109313934f432f458190992 Author: ChiYuan Huang Date: Fri Aug 5 15:06:04 2022 +0800 mfd: mt6370: Add MediaTek MT6370 support This adds support for the MediaTek MT6370 SubPMIC. MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight driver, display bias voltage supply, one general purpose LDO, and the USB Type-C & PD controller complies with the latest USB Type-C and PD standards. Reviewed-by: Andy Shevchenko Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220805070610.3516-8-peterwu.pub@gmail.com commit 7f915eef50829c3719be003481ca2bb116fad852 Author: ChiYuan Huang Date: Fri Aug 5 15:06:03 2022 +0800 dt-bindings: mfd: Add MediaTek MT6370 Add MediaTek MT6370 binding documentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220805070610.3516-7-peterwu.pub@gmail.com commit 2d48bfca42a6d2b5f92d24ceae4425fc4fae14ab Author: Chris Morgan Date: Mon Aug 8 12:38:07 2022 -0500 mfd: rk808: Add Rockchip rk817 battery charger support Add rk817 charger support cell to rk808 mfd driver. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220808173809.11320-3-macroalpha82@gmail.com commit 03f271b0b1340350d47c23811feb08d80d2b066b Author: Andy Shevchenko Date: Mon Aug 1 14:42:11 2022 +0300 mfd: intel_soc_pmic_crc: Update the copyright year Update the copyright year to be 2012-2014, 2022. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-10-andriy.shevchenko@linux.intel.com commit 39c8980cb27d8cda707cbf4b3a5b8c82785a0db7 Author: Andy Shevchenko Date: Mon Aug 1 14:42:10 2022 +0300 mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove To reflect the point that this driver is only for one type of the PMICs, replace intel_soc_pmic with crystal_cove (avoid using crc for possible namespace collisions with CRC library APIs). Note, also rename the driver name since we don't expect any user that enumerates by it, only ACPI known so far. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-9-andriy.shevchenko@linux.intel.com commit 0c602c7f6d79b2904f0a74243f55addf4db4bd2a Author: Andy Shevchenko Date: Mon Aug 1 14:42:09 2022 +0300 mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Use the ->probe_new() callback. The driver does not use const struct i2c_device_id * argument, so convert it to utilise the simplified I²C driver registration. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-8-andriy.shevchenko@linux.intel.com commit 09c4e702bc9dbd3e8a1d93144571c31f977eb866 Author: Andy Shevchenko Date: Mon Aug 1 14:42:08 2022 +0300 mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery The driver depends on ACPI, ACPI_PTR() resolution is always the same. Otherwise a compiler may produce a warning. That said, the rule of thumb either ugly ifdeffery with ACPI_PTR or none should be used in a driver. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-7-andriy.shevchenko@linux.intel.com commit e1efbc8e464c6ff098ca6fda9398159882e146b0 Author: Andy Shevchenko Date: Mon Aug 1 14:42:07 2022 +0300 mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-6-andriy.shevchenko@linux.intel.com commit 4b74ec581a1c8d35f2902f47aaa181d71d17c902 Author: Andy Shevchenko Date: Mon Aug 1 14:42:06 2022 +0300 mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() We have the specific helpers for I2C device to set and get its driver data. Convert driver to use them instead of open coded variants. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-5-andriy.shevchenko@linux.intel.com commit cae02b7a5d908df3529432ead6f0a659c625a261 Author: Andy Shevchenko Date: Mon Aug 1 14:42:05 2022 +0300 mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Use devm_regmap_add_irq_chip() to simplify the code. While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when calling mfd_add_devices(). Note, the mfd_add_devices() left in non-devm variant here due to potentially increased churn while wrapping pwm_remove_table(). Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-4-andriy.shevchenko@linux.intel.com commit 81f22f284c0fe59b480492c3ecbdfd0dfa96d4b3 Author: Andy Shevchenko Date: Mon Aug 1 14:42:04 2022 +0300 mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group It looks like a random position for couple of Makefile entries that are disrupting Intel PMIC group. Move them to their own group. Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-3-andriy.shevchenko@linux.intel.com commit 5a30b210bfea26342ad061455a0d0ed122300f68 Author: Andy Shevchenko Date: Mon Aug 1 14:42:03 2022 +0300 mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc The core part is misleading since its only purpose to serve Crystal Cove PMIC, although for couple of different platforms. Merge core part into crc one. Advantages among others are: - speed up a compilation and build - decreasing the code base - reducing noise in the namespace by making some data static and const Signed-off-by: Andy Shevchenko Tested-by: Hans de Goede Reviewed-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-2-andriy.shevchenko@linux.intel.com commit 48749cabba109397b4e7dd556e85718ec0ec114d Author: Christophe JAILLET Date: Mon Aug 1 14:42:02 2022 +0300 mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() The commit in Fixes: has added a pwm_add_table() call in the probe() and a pwm_remove_table() call in the remove(), but forget to update the error handling path of the probe. Add the missing pwm_remove_table() call. Fixes: a3aa9a93df9f ("mfd: intel_soc_pmic_core: ADD PWM lookup table for CRC PMIC based PWM") Signed-off-by: Christophe JAILLET Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220801114211.36267-1-andriy.shevchenko@linux.intel.com commit fe969e9f017d5593169c157bc20df64f832b2ddd Author: Jagan Teki Date: Sun Jul 24 02:13:29 2022 +0530 dt-bindings: mfd: syscon: Add Rockchip RV1126 QoS register Document dt-bindings for Rockchip RV1126 QoS registers. Signed-off-by: Jagan Teki Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220723204335.750095-17-jagan@edgeble.ai commit d7667f19033925f263512145d8b7a02dd3d35fa6 Author: Francesco Dolcini Date: Tue Jul 12 18:33:42 2022 +0200 mfd: stmpe: Probe sub-function by compatible Use sub-function of_compatible during probe, instead of using the node name. The code should not rely on the node names during probe, in addition to that the previously hard-coded node names are not compliant to the latest naming convention (they are not generic and they use underscores), and it was broken by mistake already once [1]. [1] commit 56086b5e804f ("ARM: dts: imx6qdl-apalis: Avoid underscore in node name") Suggested-by: Ahmad Fatoum Signed-off-by: Francesco Dolcini Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220712163345.445811-3-francesco.dolcini@toradex.com commit 8c4352976ff2121d6d3dce5b7641f3c30c03a415 Author: Francesco Dolcini Date: Tue Jul 12 18:33:41 2022 +0200 mfd: stmpe: Remove rotator block from probe Remove rotator block from probe, it is not used in any device tree file, there is no related cell defined, it's just dead non-working code with no of_compatible for it. This is a preliminary change to allow probing by of_compatible and not by a fixed name. Signed-off-by: Francesco Dolcini Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220712163345.445811-2-francesco.dolcini@toradex.com commit fe55d732387ab39b08540fc93e829b409ec2161a Author: Andy Shevchenko Date: Sun Jul 3 00:19:02 2022 +0300 mfd: intel-lpss: Provide an SSP type to the SPI driver The SPI driver wants to know the exact type of the controller. Provide this information to it. This is a complementary part to the previously updated intel-lpss-acpi.c. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220702211903.9093-1-andriy.shevchenko@linux.intel.com commit c68f4f4e296b6011032b4f88d0ce72eb72a6bb07 Author: Christoph Hellwig Date: Wed Sep 28 16:39:45 2022 +0200 s390/dasd: use blk_mq_alloc_disk As far as I can tell there is no need for the staged setup in dasd, so allocate the tagset and the disk with the queue in dasd_gendisk_alloc. Signed-off-by: Christoph Hellwig Reviewed-by: Stefan Haberland Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20220928143945.1687114-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit b4319802867515ca6e492bff54879bc22a71a62c Author: Andy Shevchenko Date: Tue Sep 27 20:22:58 2022 +0300 pwm: core: Replace custom implementation of device_match_fwnode() Replace custom implementation of the device_match_fwnode(). This hides the implementation details and makes future changes easier. Signed-off-by: Andy Shevchenko Signed-off-by: Thierry Reding commit d632e864351ac3df3ab4bb224ba27b0634ce93be Author: Andy Shevchenko Date: Tue Sep 27 19:24:21 2022 +0300 pwm: lpss: Add a comment to the bypass field Add a comment to the bypass field based on the commit b997e3edca4f ("pwm: lpss: Set enable-bit before waiting for update-bit to go low"). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2ab69739209c843a47af82c0620036b233c83688 Author: Francesco Dolcini Date: Thu Sep 22 14:43:05 2022 +0200 drm/bridge: lt8912b: fix corrupted image output Correct I2C address for the register list in lt8912_write_lvds_config(), these registers are on the first I2C address (0x48), the current function is just writing garbage to the wrong registers and this creates multiple issues (artifacts and output completely corrupted) on some HDMI displays. Correct I2C address comes from Lontium documentation and it is the one used on other out-of-tree LT8912B drivers [1]. [1] https://github.com/boundarydevices/linux/blob/boundary-imx_5.10.x_2.0.0/drivers/video/lt8912.c#L296 Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Francesco Dolcini Signed-off-by: Philippe Schenker Acked-by: Adrien Grassein Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-4-dev@pschenker.ch Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-5-dev@pschenker.ch commit d25404a359b24a887db56b52064b754f79921bb7 Author: Philippe Schenker Date: Thu Sep 22 14:43:04 2022 +0200 drm/bridge: lt8912b: set hdmi or dvi mode The Lontium LT8912 does have a setting for DVI or HDMI. This patch reads from EDID what the display needs and sets it accordingly. Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Philippe Schenker Acked-by: Adrien Grassein Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-3-dev@pschenker.ch commit e3e7f178d4d82743786d5a002b714b5d516f5870 Author: Philippe Schenker Date: Thu Sep 22 14:43:03 2022 +0200 drm/bridge: lt8912b: add vsync hsync Currently the bridge driver does not take care whether or not the display needs positive/negative vertical/horizontal syncs. Pass these two flags to the bridge from the EDID that was read out from the display. Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Philippe Schenker Acked-by: Adrien Grassein Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-2-dev@pschenker.ch commit 4fdb3281bb8479ea0c41e6be0af5dcab669f9eb9 Author: Andy Shevchenko Date: Tue Sep 27 19:24:20 2022 +0300 pwm: lpss: Make use of bits.h macros for all masks Make use of the GENMASK() (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 163bb6f99312d50604783b35f0837f1fa89fefc1 Author: Andy Shevchenko Date: Tue Sep 27 19:24:19 2022 +0300 pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 7f8dd161787569949d8a5f93cad5a7ad629f884e Author: Andy Shevchenko Date: Tue Sep 27 19:24:18 2022 +0300 pwm: lpss: Use device_get_match_data() to get device data device_get_match_data() in ACPI case calls similar to the acpi_match_device(). We may simplify the code and make it generic by replacing the latter with the former. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 68af6fb00f2f1e72521169d5a4283faa8533694d Author: Andy Shevchenko Date: Tue Sep 27 19:24:17 2022 +0300 pwm: lpss: Move resource mapping to the glue drivers Move resource mapping to the glue drivers which helps to transform pwm_lpss_probe() to pure library function that may be used by others without need of specific resource management. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a3682d2fe3c36c68899bf1b956ed68d36d005868 Author: Andy Shevchenko Date: Tue Sep 27 19:24:16 2022 +0300 pwm: lpss: Move exported symbols to PWM_LPSS namespace Avoid unnecessary pollution of the global symbol namespace by moving library functions in to a specific namespace and import that into the drivers that make use of the functions. For more info: https://lwn.net/Articles/760045/ Suggested-by: Uwe Kleine-König Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 090e78d0d8942a56a70ef6d293b5df5141612969 Author: Uwe Kleine-König Date: Tue Sep 27 19:24:15 2022 +0300 pwm: lpss: Deduplicate board info data structures Move the board info structures from the glue drivers to the common library and hence deduplicate configuration data. For the Intel Braswell case the ACPI version should be used. Because switch to ACPI/PCI is done in BIOS while quite likely the rest of AML code is the same, meaning similar issue might be observed. There is no bug report due to no PCI enabled device in the wild, Andy thinks, and only reference boards can be tested, so nobody really cares about Intel Braswell PCI case. Signed-off-by: Uwe Kleine-König Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Thierry Reding commit 6db87be2e500c63c5030c848004e26f212f4c87c Author: xinlei lee Date: Fri Sep 23 14:43:14 2022 +0800 dt-bindings: pwm: Add compatible for Mediatek MT8188 Add dt-binding documentation of pwm for MediaTek MT8188 SoC. Signed-off-by: xinlei lee Acked-by: Uwe Kleine-König Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 6ae91ac9a6aa7d6005c3c6d0f4d263fbab9f377f Author: Pavel Begunkov Date: Wed Sep 28 00:51:49 2022 +0100 io_uring/net: don't skip notifs for failed requests We currently only add a notification CQE when the send succeded, i.e. cqe.res >= 0. However, it'd be more robust to do buffer notifications for failed requests as well in case drivers decide do something fanky. Always return a buffer notification after initial prep, don't hide it. This behaviour is better aligned with documentation and the patch also helps the userspace to respect it. Cc: stable@vger.kernel.org # 6.0 Suggested-by: Stefan Metzmacher Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9c8bead87b2b980fcec441b8faef52188b4a6588.1664292100.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d5ebde1e2b46154d7e03efb1ae3039a304e5386d Author: Li kunyu Date: Wed Sep 28 14:40:46 2022 +0800 hyperv: simplify and rename generate_guest_id The generate_guest_id function is more suitable for use after the following modifications. 1. The return value of the function is modified to u64. 2. Remove the d_info1 and d_info2 parameters from the function, keep the u64 type kernel_version parameter. 3. Rename the function to make it clearly a Hyper-V related function, and modify it to hv_generate_guest_id. Signed-off-by: Li kunyu Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220928064046.3545-1-kunyu@nfschina.com Signed-off-by: Wei Liu commit fb2d14add4f813c73bd9d28b750315ccb3f5f0ea Author: Kees Cook Date: Tue Sep 27 14:17:36 2022 -0700 Drivers: hv: vmbus: Split memcpy of flex-array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. This results in the already inlined memcpy getting unrolled a little more, which very slightly increases text size: $ size drivers/hv/vmbus_drv.o.before drivers/hv/vmbus_drv.o text data bss dec hex filename 22968 5239 232 28439 6f17 drivers/hv/vmbus_drv.o.before 23032 5239 232 28503 6f57 drivers/hv/vmbus_drv.o Avoids the run-time false-positive warning: memcpy: detected field-spanning write (size 212) of single field "&ctx->msg" at drivers/hv/vmbus_drv.c:1133 (size 16) [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/ Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Dexuan Cui Cc: linux-hyperv@vger.kernel.org Reported-by: Nathan Chancellor Reported-by: "Gustavo A. R. Silva" Tested-by: Nathan Chancellor Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220927211736.3241175-1-keescook@chromium.org Signed-off-by: Wei Liu commit 334f7d42db3eb0274aa6b4aba7ce14d87df3fef0 Author: Frank Li Date: Thu Sep 22 11:12:42 2022 -0500 irqchip: Allow extra fields to be passed to IRQCHIP_PLATFORM_DRIVER_END IRQCHIP_PLATFORM_DRIVER_* doesn't allow some fields (such as .pm) to be set in the platform_driver structure. Make IRQCHIP_PLATFORM_DRIVER_END variadic so that .pm or another field can be set if needed. Signed-off-by: Frank Li [maz: revamped commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220922161246.20586-3-Frank.Li@nxp.com commit aecd1de3b1438cc4ead086a025fb49a3a896d615 Author: Frank Li Date: Thu Sep 22 11:12:41 2022 -0500 platform-msi: Export symbol platform_msi_create_irq_domain() Allow irqchip drivers using platform MSI to be built as modules. Signed-off-by: Frank Li [maz: rewrote commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220922161246.20586-2-Frank.Li@nxp.com commit 9070f1ce31c5027821d5f37e9ca8dfb23158e457 Author: Sander Vanheule Date: Mon Sep 19 22:24:43 2022 +0200 irqchip/realtek-rtl: use parent interrupts The interrupt-map property for "realtek,rtl-intc" has been deprecated in favor of a list of parent interrupts. Drop the open-coded parser for interrupt-map, and use the first parent interrupt instead. If no parent was provided, the driver will assume that this is the first hardware interrupt of the SoC's MIPS CPU for compatibility with the legacy binding. All SoC interrupts were treated equally, independent of which output they were actually routed to. This means the driver might as well route all interrupts to the first output, and achieve the same behaviour. Without the interrupt-map property, interrupt usage information is no longer available at initialisation. Routing setup will now happen later, when a hardware interrupt is mapped by the subsystem. Signed-off-by: Sander Vanheule Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/5f901a82eaa9d97cadf6e9b73a894a92f3f83b7c.1663617425.git.sander@svanheule.net commit a3e77b70f19240f8a52bbe1c703aa8db6a8f7450 Author: Sander Vanheule Date: Mon Sep 19 22:24:42 2022 +0200 dt-bindings: interrupt-controller: realtek,rtl-intc: require parents The interrupt router has 32 inputs, and up to 15 outputs connected to the MIPS CPU's interrupts. The way these are mapped to each other is runtime configurable. This controller can also mask individual interrupt sources, and has a status register to indicate pending interrupts. This means the controller is not transparent, and the use of "interrupt-map" inappropriate. Instead, a list of parent interrupts should be specified. Two-part compatibles are introduced to be able to require "interrupts" for new devicetrees. For backward compatibility "interrupt-map" is still allowed on these new compatibles, but deprecated. The old compatible, with required "interrupt-map" and "#address-cells", is also deprecated. The relevant descriptions are added or extended to more clearly describe the functionality of this controller. To prevent spurious changes to the binding when more SoCs are added, "allOf" is used with one "if", and the compatible enum only has one item. The example is updated to provide a correct example for RTL8380 SoCs. Signed-off-by: Sander Vanheule Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/ba3ae8e521ef82dd94f18a602ef53078f4a0d8d5.1663617425.git.sander@svanheule.net commit a1cc8a62c2b21d6d71d5a3d5d7c7658e3ab42d47 Author: Sander Vanheule Date: Mon Sep 19 22:24:41 2022 +0200 irqchip/realtek-rtl: use irq_domain_add_linear() When using an offset of 0, irq_domain_add_simple() is identical to irq_domain_add_linear() on DT-based systems, so use the latter instead. Signed-off-by: Sander Vanheule Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/0c4cd9f7661a30a4cb7ab9881c4a94bc8a379162.1663617425.git.sander@svanheule.net commit 612d5494aef9bd2ab68d585a8c0ac2b16d12d520 Author: Huacai Chen Date: Tue Sep 27 20:45:57 2022 +0800 irqchip: Make irqchip_init() usable on pure ACPI systems Pure ACPI systems (e.g., LoongArch) do not need OF_IRQ, but still require irqchip_init() to perform the ACPI irqchip probing, even when OF_IRQ isn't selected. Relax the dependency to enable the generic irqchip support when ACPI_GENERIC_GSI is configured. Signed-off-by: Huacai Chen Tested-by: Tiezhu Yang [maz: revamped commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220927124557.3246737-1-chenhuacai@loongson.cn commit 9f87db8243c495fbac5334f797980b542f8f1710 Author: Johan Jonker Date: Sat Sep 10 00:02:22 2022 +0200 dt-bindings: pwm: rockchip: Add rockchip,rk3128-pwm Add rockchip,rk3128-pwm compatible string. Signed-off-by: Johan Jonker Acked-by: Uwe Kleine-König Acked-by: Rob Herring Acked-by: Heiko Stuebner Signed-off-by: Thierry Reding commit 59c719423753102def4e99490e0b2de7bebdcf05 Author: Sebastian Reichel Date: Thu Sep 1 15:55:23 2022 +0200 dt-bindings: pwm: rockchip: Add description for rk3588 Add "rockchip,rk3588-pwm" compatible string for PWM nodes found on a rk3588 platform. Signed-off-by: Sebastian Reichel Acked-by: Krzysztof Kozlowski Reviewed-by: Heiko Stuebner Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 335e1a91042764629fbbcd8c7e40379fa3762d35 Author: Haren Myneni Date: Tue Sep 27 18:29:27 2022 -0700 powerpc: Ignore DSI error caused by the copy/paste instruction The data storage interrupt (DSI) error will be generated when the paste operation is issued on the suspended Nest Accelerator (NX) window due to NX state changes. The hypervisor expects the partition to ignore this error during page fault handling. To differentiate DSI caused by an actual HW configuration or by the NX window, a new “ibm,pi-features” type value is defined. Byte 0, bit 3 of pi-attribute-specifier-type is now defined to indicate this DSI error. If this error is not ignored, the user space can get SIGBUS when the NX request is issued. This patch adds changes to read ibm,pi-features property and ignore DSI error during page fault handling if MMU_FTR_NX_DSI is defined. Signed-off-by: Haren Myneni [mpe: Mention PAPR version in comment] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b9cd844b85eb8f70459109ce1b14e44c4cc85fa7.camel@linux.ibm.com commit 19c95df1277c48e3ef8cc7d9f1d315dce949f203 Author: Michael Ellerman Date: Wed Sep 28 01:04:19 2022 +1000 powerpc: Reverse stack frame marker on little endian On little endian the stack frame marker appears reversed when dumping memory sequentially, as is typical in xmon or gdb, eg: c000000004733e40 0000000000000000 0000000000000000 |................| c000000004733e50 0000000000000000 0000000000000000 |................| c000000004733e60 0000000000000000 0000000000000000 |................| c000000004733e70 5347455200000000 0000000000000000 |SGER............| c000000004733e80 a700000000000000 708897f7ff7f0000 |........p.......| c000000004733e90 0073428fff7f0000 208997f7ff7f0000 |.sB..... .......| c000000004733ea0 0100000000000000 ffffffffffffffff |................| c000000004733eb0 0000000000000000 0000000000000000 |................| To make it easier to recognise, reverse the value on little endian, so it always appears as "REGS", eg: c000000004733e70 5245475300000000 0000000000000000 |REGS............| Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220927150419.1503001-2-mpe@ellerman.id.au commit bbd71709087a9d486d1da42399eec14e106072f2 Author: Michael Ellerman Date: Wed Sep 28 01:04:18 2022 +1000 powerpc: Make stack frame marker upper case Now that the stack frame regs marker is only 32-bits it is not as obvious in memory dumps and easier to miss, eg: c000000004733e40 0000000000000000 0000000000000000 |................| c000000004733e50 0000000000000000 0000000000000000 |................| c000000004733e60 0000000000000000 0000000000000000 |................| c000000004733e70 7367657200000000 0000000000000000 |sger............| c000000004733e80 a700000000000000 708897f7ff7f0000 |........p.......| c000000004733e90 0073428fff7f0000 208997f7ff7f0000 |.sB..... .......| c000000004733ea0 0100000000000000 ffffffffffffffff |................| c000000004733eb0 0000000000000000 0000000000000000 |................| So make it upper case to make it stand out a bit more: c000000004733e70 5347455200000000 0000000000000000 |SGER............| Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220927150419.1503001-1-mpe@ellerman.id.au commit 97f88a3d723162781d6cbfdc7b9617eefab55b19 Author: Li Huafei Date: Fri Sep 23 17:32:53 2022 +0800 powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe() I found a null pointer reference in arch_prepare_kprobe(): # echo 'p cmdline_proc_show' > kprobe_events # echo 'p cmdline_proc_show+16' >> kprobe_events Kernel attempted to read user page (0) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000000 Faulting instruction address: 0xc000000000050bfc Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV Modules linked in: CPU: 0 PID: 122 Comm: sh Not tainted 6.0.0-rc3-00007-gdcf8e5633e2e #10 NIP: c000000000050bfc LR: c000000000050bec CTR: 0000000000005bdc REGS: c0000000348475b0 TRAP: 0300 Not tainted (6.0.0-rc3-00007-gdcf8e5633e2e) MSR: 9000000000009033 CR: 88002444 XER: 20040006 CFAR: c00000000022d100 DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 0 ... NIP arch_prepare_kprobe+0x10c/0x2d0 LR arch_prepare_kprobe+0xfc/0x2d0 Call Trace: 0xc0000000012f77a0 (unreliable) register_kprobe+0x3c0/0x7a0 __register_trace_kprobe+0x140/0x1a0 __trace_kprobe_create+0x794/0x1040 trace_probe_create+0xc4/0xe0 create_or_delete_trace_kprobe+0x2c/0x80 trace_parse_run_command+0xf0/0x210 probes_write+0x20/0x40 vfs_write+0xfc/0x450 ksys_write+0x84/0x140 system_call_exception+0x17c/0x3a0 system_call_vectored_common+0xe8/0x278 --- interrupt: 3000 at 0x7fffa5682de0 NIP: 00007fffa5682de0 LR: 0000000000000000 CTR: 0000000000000000 REGS: c000000034847e80 TRAP: 3000 Not tainted (6.0.0-rc3-00007-gdcf8e5633e2e) MSR: 900000000280f033 CR: 44002408 XER: 00000000 The address being probed has some special: cmdline_proc_show: Probe based on ftrace cmdline_proc_show+16: Probe for the next instruction at the ftrace location The ftrace-based kprobe does not generate kprobe::ainsn::insn, it gets set to NULL. In arch_prepare_kprobe() it will check for: ... prev = get_kprobe(p->addr - 1); preempt_enable_no_resched(); if (prev && ppc_inst_prefixed(ppc_inst_read(prev->ainsn.insn))) { ... If prev is based on ftrace, 'ppc_inst_read(prev->ainsn.insn)' will occur with a null pointer reference. At this point prev->addr will not be a prefixed instruction, so the check can be skipped. Check if prev is ftrace-based kprobe before reading 'prev->ainsn.insn' to fix this problem. Fixes: b4657f7650ba ("powerpc/kprobes: Don't allow breakpoints on suffixes") Signed-off-by: Li Huafei [mpe: Trim oops] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220923093253.177298-1-lihuafei1@huawei.com commit f36216724b25f16f2118f3a983d13cafcdc31d5a Author: Andy Shevchenko Date: Fri Aug 26 20:07:13 2022 +0300 pwm: sysfs: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Andy Shevchenko Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 4b8857c3ca439ec968504f54ff5d60795be55d5d Author: zhaoxiao Date: Mon Aug 22 16:18:48 2022 +0800 pwm: rockchip: Convert to use dev_err_probe() It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: zhaoxiao Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1224e29572f655facfcd850cf0f0a4784f36a903 Author: Vincent Whitchurch Date: Tue Sep 27 13:21:17 2022 +0200 spi: s3c64xx: Fix large transfers with DMA The COUNT_VALUE in the PACKET_CNT register is 16-bit so the maximum value is 65535. Asking the driver to transfer a larger size currently leads to the DMA transfer timing out. Implement ->max_transfer_size() and have the core split the transfer as needed. Fixes: 230d42d422e7 ("spi: Add s3c64xx SPI Controller driver") Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220927112117.77599-5-vincent.whitchurch@axis.com Signed-off-by: Mark Brown commit 8d699ff95534747e394e0830399b8d5dcf03e738 Author: Vincent Whitchurch Date: Tue Sep 27 13:21:16 2022 +0200 spi: Split transfers larger than max size A couple of drivers call spi_split_transfers_maxsize() from their ->prepare_message() callbacks to split transfers which are too big for them to handle. Add support in the core to do this based on ->max_transfer_size() to avoid code duplication. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220927112117.77599-4-vincent.whitchurch@axis.com Signed-off-by: Mark Brown commit 0c17ba73c08ff2690c1eff8df374b6709eed55ce Author: Vincent Whitchurch Date: Tue Sep 27 13:21:15 2022 +0200 spi: Fix cache corruption due to DMA/PIO overlap The SPI core DMA mapping support performs cache management once for the entire message and not between transfers, and this leads to cache corruption if a message has two or more RX transfers with both transfers targeting the same cache line, and the controller driver decides to handle one using DMA and the other using PIO (for example, because one is much larger than the other). Fix it by syncing before/after the actual transfers. This also means that we can skip the sync during the map/unmap of the message. Fixes: 99adef310f68 ("spi: Provide core support for DMA mapping transfers") Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220927112117.77599-3-vincent.whitchurch@axis.com Signed-off-by: Mark Brown commit f25723dcef4a38f6a39e17afeabd1adf6402230e Author: Vincent Whitchurch Date: Tue Sep 27 13:21:14 2022 +0200 spi: Save current RX and TX DMA devices Save the current RX and TX DMA devices to avoid having to duplicate the logic to pick them, since we'll need access to them in some more functions to fix a bug in the cache handling. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220927112117.77599-2-vincent.whitchurch@axis.com Signed-off-by: Mark Brown commit 05763c996f72ef934432639fe412f5193816fd9d Author: Yuan Can Date: Tue Sep 27 13:38:14 2022 +0000 ipmi: Remove unused struct watcher_entry After commit e86ee2d44b44("ipmi: Rework locking and shutdown for hot remove"), no one use struct watcher_entry, so remove it. Signed-off-by: Yuan Can Message-Id: <20220927133814.98929-1-yuancan@huawei.com> Signed-off-by: Corey Minyard commit 35af9fb49bc5c6d61ef70b501c3a56fe161cce3e Author: Jiasheng Jiang Date: Tue Jan 11 15:34:11 2022 +0800 fsi: core: Check error number after calling ida_simple_get If allocation fails, the ida_simple_get() will return error number. So master->idx could be error number and be used in dev_set_name(). Therefore, it should be better to check it and return error if fails, like the ida_simple_get() in __fsi_get_new_minor(). Fixes: 09aecfab93b8 ("drivers/fsi: Add fsi master definition") Signed-off-by: Jiasheng Jiang Reviewed-by: Eddie James Link: https://lore.kernel.org/r/20220111073411.614138-1-jiasheng@iscas.ac.cn Signed-off-by: Joel Stanley commit 89a286fb153643b9b0f6e78160857f86eef16ba5 Author: Eddie James Date: Tue Aug 9 15:07:01 2022 -0500 hwmon: (occ) Check for device property for setting OCC active during probe A previous commit changed the existing behavior of the driver to skip attempting to communicate with the OCC during probe. Return to the previous default behavior of automatically communicating with the OCC and make it optional with a new device-tree property. Signed-off-by: Eddie James Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220809200701.218059-4-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 0fead4fc926f000d2daee938f0d4886ac8da11d0 Author: Eddie James Date: Tue Aug 9 15:07:00 2022 -0500 fsi: occ: Support probing the hwmon child device from dts node There is now a need for reading devicetree properties in the OCC hwmon driver, which isn't current supported as the FSI driver just instantiates a basic platform device. Add support for this use case by checking for an "occ-hwmon" node and if present, creating an OF device from it. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220809200701.218059-3-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 8d4c99002d2f38edd50a9896a29a1650be3de1af Author: Eddie James Date: Tue Aug 9 15:06:59 2022 -0500 dt-bindings: hwmon: Add IBM OCC bindings These bindings describe the POWER processor On Chip Controller accessed from a service processor or baseboard management controller (BMC). Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220809200701.218059-2-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 182d98e00e4745fe253cb0c24c63bbac253464a2 Author: Lv Ruyi Date: Thu Apr 7 08:59:11 2022 +0000 fsi: master-ast-cf: Fix missing of_node_put in fsi_master_acf_probe of_parse_phandle returns node pointer with refcount incremented, use of_node_put() on it when done. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220407085911.2491719-1-lv.ruyi@zte.com.cn Signed-off-by: Joel Stanley commit b1534a05e1f283a157231f1b334f34d07fdda511 Author: Joel Stanley Date: Fri Apr 15 14:37:57 2022 +0930 fsi: sbefifo: Add detailed debugging information Provide more output on the timeout status, and make some vdbg calls into dbg calls so they can be enabled at runtime. Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20220415050757.281158-1-joel@jms.id.au Signed-off-by: Joel Stanley commit 362fbc830a7ecd440d797c2ddce53020fd1020f5 Author: Tom Rix Date: Sun Apr 3 10:09:37 2022 -0400 fsi: cleanup extern usage in function definition Smatch reports these issues fsi-core.c:395:12: warning: function 'fsi_slave_claim_range' with external linkage has definition fsi-core.c:409:13: warning: function 'fsi_slave_release_range' with external linkage has definition The storage-class-specifier extern is not needed in a definition, so remove it. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220403140937.3833578-1-trix@redhat.com Signed-off-by: Joel Stanley commit d3e1e24604031b0d83b6c2d38f54eeea265cfcc0 Author: Eddie James Date: Fri May 13 14:44:24 2022 -0500 fsi: occ: Prevent use after free Use get_device and put_device in the open and close functions to make sure the device doesn't get freed while a file descriptor is open. Also, lock around the freeing of the device buffer and check the buffer before using it in the submit function. Signed-off-by: Eddie James Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220513194424.53468-1-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit dbed963ed62c4c2b8870a02c8b7dcb0c2af3ee0b Author: Eddie James Date: Tue Apr 26 10:49:56 2022 -0500 hwmon (occ): Retry for checksum failure Due to the OCC communication design with a shared SRAM area, checkum errors are expected due to corrupted buffer from OCC communications with other system components. Therefore, retry the command twice in the event of a checksum failure. Signed-off-by: Eddie James Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220426154956.27205-3-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 2a8a7c0eaa8747c16aa4a48d573aa920d5c00a5c Author: Phil Sutter Date: Wed Sep 21 13:07:31 2022 +0200 netfilter: nft_fib: Fix for rpath check with VRF devices Analogous to commit b575b24b8eee3 ("netfilter: Fix rpfilter dropping vrf packets by mistake") but for nftables fib expression: Add special treatment of VRF devices so that typical reverse path filtering via 'fib saddr . iif oif' expression works as expected. Fixes: f6d0cbcf09c50 ("netfilter: nf_tables: add fib expression") Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit 7ba6546b547c75b0196029c7e0aaaab2eb6694a4 Author: Trevor Wu Date: Tue Sep 27 23:11:41 2022 +0800 ASoC: mediatek: mt8195: update audio tuner settings Audio tuner is used to handle clock drift between 26M and APLL domain. It's expected when abs(chg_cnt) equals to upper bound, tuner updates pcw setting automatically, and then abs(chg_cnt) decreases. In the stress test, we found abs(chg_cnt) possibly equals to 2 at the unexpected timing. This results in wrong pcw updating. Finally, abs(chg_cnt) will always be larger than upper bound, As a result, we update the upper bound to 3 to handle the corner case. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220927151141.11846-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 7b4d8db657192066bc6f1f6635d348413dac1e18 Author: Khaled Almahallawy Date: Thu Sep 15 22:49:00 2022 -0700 drm/dp: Don't rewrite link config when setting phy test pattern The sequence for Source DP PHY CTS automation is [2][1]: 1- Emulate successful Link Training(LT) 2- Short HPD and change link rates and number of lanes by LT. (This is same flow for Link Layer CTS) 3- Short HPD and change PHY test pattern and swing/pre-emphasis levels (This step should not trigger LT) The problem is with DP PHY compliance setup as follow: [DPTX + on board LTTPR]------Main Link--->[Scope] ^ | | | | | ----------Aux Ch------>[Aux Emulator] At step 3, before writing TRAINING_LANEx_SET/LINK_QUAL_PATTERN_SET to declare the pattern/swing requested by scope, we write link config in LINK_BW_SET/LANE_COUNT_SET on a port that has LTTPR. As LTTPR snoops aux transaction, LINK_BW_SET/LANE_COUNT_SET writes indicate a LT will start [Check DP 2.0 E11 -Sec 3.6.8.2 & 3.6.8.6.3], and LTTPR will reset the link and stop sending DP signals to DPTX/Scope causing the measurements to fail. Note that step 3 will not trigger LT and DP link will never recovered by the Aux Emulator/Scope. The reset of link can be tested with a monitor connected to LTTPR port simply by writing to LINK_BW_SET or LANE_COUNT_SET as follow igt/tools/dpcd_reg write --offset=0x100 --value 0x14 --device=2 OR printf '\x14' | sudo dd of=/dev/drm_dp_aux2 bs=1 count=1 conv=notrunc seek=$((0x100)) This single aux write causes the screen to blank, sending short HPD to DPTX, setting LINK_STATUS_UPDATE = 1 in DPCD 0x204, and triggering LT. As stated in [1]: "Before any TX electrical testing can be performed, the link between a DPTX and DPRX (in this case, a piece of test equipment), including all LTTPRs within the path, shall be trained as defined in this Standard." In addition, changing Phy pattern/Swing/Pre-emphasis (Step 3) uses the same link rate and lane count applied on step 2, so no need to redo LT. The fix is to not rewrite link config in step 3, and just writes TRAINING_LANEx_SET and LINK_QUAL_PATTERN_SET [1]: DP 2.0 E11 - 3.6.11.1 LTTPR DPTX_PHY Electrical Compliance [2]: Configuring UnigrafDPTC Controller - Automation Test Sequence https://www.keysight.com/us/en/assets/9922-01244/help-files/ D9040DPPC-DisplayPort-Test-Software-Online-Help-latest.chm Cc: Imre Deak Cc: Jani Nikula Cc: Or Cochvi Signed-off-by: Khaled Almahallawy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220916054900.415804-1-khaled.almahallawy@intel.com commit 5e4952656bca1b5d8c2be36682dc66d844797ad2 Author: ye xingchen Date: Tue Sep 6 07:20:06 2022 +0000 ocxl: Remove the unneeded result variable Return the value opal_npu_spa_clear_cache() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220906072006.337099-1-ye.xingchen@zte.com.cn commit 91986d7f0300c2c01722e0eac5119bb0946fe9b5 Author: ye xingchen Date: Thu Aug 25 07:26:57 2022 +0000 powerpc/pseries/vas: Remove the unneeded result variable Return the value vas_register_coproc_api() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220825072657.229168-1-ye.xingchen@zte.com.cn commit b37ac1894ac3c014863986d6b8ed880195213e78 Author: Nathan Lynch Date: Mon Sep 26 17:02:50 2022 -0500 powerpc/smp: poll cpu_callin_map more aggressively in __cpu_up() At boot time, it is not necessary to delay between polls of cpu_callin_map when waiting for a kicked CPU to come up. Remove the delay intervals, but preserve the overall deadline (five seconds). At run time, the first poll result is usually negative and we incur a sleeping wait. If we spin on the callin word for a short time first, we can reduce __cpu_up() from dozens of milliseconds to under 1ms in the common case on a P9 LPAR: $ ppc64_cpu --smt=off $ bpftrace -e 'kprobe:__cpu_up { @start[tid] = nsecs; } kretprobe:__cpu_up /@start[tid]/ { @us = hist((nsecs - @start[tid]) / 1000); delete(@start[tid]); }' -c 'ppc64_cpu --smt=on' Before: @us: [16K, 32K) 85 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [32K, 64K) 13 |@@@@@@@ | After: @us: [128, 256) 95 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [256, 512) 3 |@ | Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926220250.157022-1-nathanl@linux.ibm.com commit b8f3e48834fe8c86b4f21739c6effd160e2c2c19 Author: Nathan Lynch Date: Mon Sep 26 08:16:43 2022 -0500 powerpc/rtas: block error injection when locked down The error injection facility on pseries VMs allows corruption of arbitrary guest memory, potentially enabling a sufficiently privileged user to disable lockdown or perform other modifications of the running kernel via the rtas syscall. Block the PAPR error injection facility from being opened or called when locked down. Signed-off-by: Nathan Lynch Acked-by: Paul Moore (LSM) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926131643.146502-3-nathanl@linux.ibm.com commit 99df7a2810b6d24651d4887ab61a142e042fb235 Author: Nathan Lynch Date: Mon Sep 26 08:16:42 2022 -0500 powerpc/pseries: block untrusted device tree changes when locked down The /proc/powerpc/ofdt interface allows the root user to freely alter the in-kernel device tree, enabling arbitrary physical address writes via drivers that could bind to malicious device nodes, thus making it possible to disable lockdown. Historically this interface has been used on the pseries platform to facilitate the runtime addition and removal of processor, memory, and device resources (aka Dynamic Logical Partitioning or DLPAR). Years ago, the processor and memory use cases were migrated to designs that happen to be lockdown-friendly: device tree updates are communicated directly to the kernel from firmware without passing through untrusted user space. I/O device DLPAR via the "drmgr" command in powerpc-utils remains the sole legitimate user of /proc/powerpc/ofdt, but it is already broken in lockdown since it uses /dev/mem to allocate argument buffers for the rtas syscall. So only illegitimate uses of the interface should see a behavior change when running on a locked down kernel. Signed-off-by: Nathan Lynch Acked-by: Paul Moore (LSM) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926131643.146502-2-nathanl@linux.ibm.com commit 6bd7ff497b4af13ea3d53781ffca7dc744dbb4da Author: Pali Rohár Date: Tue Aug 23 01:17:51 2022 +0200 powerpc/udbg: Remove extern function prototypes 'extern' keyword is pointless and deprecated for function prototypes. Signed-off-by: Pali Rohár Suggested-by: Gabriel Paubert Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220822231751.16973-1-pali@kernel.org commit 110a58b9f91c66f743c01a2c217243d94c899c23 Author: Pali Rohár Date: Sat Aug 27 15:44:54 2022 +0200 powerpc/boot: Explicitly disable usage of SPE instructions uImage boot wrapper should not use SPE instructions, like kernel itself. Boot wrapper has already disabled Altivec and VSX instructions but not SPE. Options -mno-spe and -mspe=no already set when compilation of kernel, but not when compiling uImage wrapper yet. Fix it. Cc: stable@vger.kernel.org Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220827134454.17365-1-pali@kernel.org commit c102432005e8811b80b25641e12c4577970b5558 Author: Pali Rohár Date: Fri Sep 2 23:21:03 2022 +0200 powerpc: Include e500v1_power_isa.dtsi for remaining e500v1 platforms There are still some board device tree files without Power ISA properties which have Freescale e500v1 cores, namely those which are based on Freescale mpc8540, mpc8541, mpc8555 and mpc8560 processors. So include newly introduced e500v1_power_isa.dtsi file in devices tree files with those processors. Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220902212103.22534-2-pali@kernel.org commit 37b9345ce7f4ab17538ea62def6f6d430f091355 Author: Pali Rohár Date: Fri Sep 2 23:21:02 2022 +0200 powerpc: Fix SPE Power ISA properties for e500v1 platforms Commit 2eb28006431c ("powerpc/e500v2: Add Power ISA properties to comply with ePAPR 1.1") introduced new include file e500v2_power_isa.dtsi and should have used it for all e500v2 platforms. But apparently it was used also for e500v1 platforms mpc8540, mpc8541, mpc8555 and mpc8560. e500v1 cores compared to e500v2 do not support double precision floating point SPE instructions. Hence power-isa-sp.fd should not be set on e500v1 platforms, which is in e500v2_power_isa.dtsi include file. Fix this issue by introducing a new e500v1_power_isa.dtsi include file and use it in all e500v1 device tree files. Fixes: 2eb28006431c ("powerpc/e500v2: Add Power ISA properties to comply with ePAPR 1.1") Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220902212103.22534-1-pali@kernel.org commit 18213532de7156af689cb0511d2f95bcbe3c98a0 Author: Athira Rajeev Date: Wed Sep 21 20:22:55 2022 +0530 selftests/powerpc: Update bhrb filter sampling test for multiple branch filters For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type, ie branch filters are supported. The testcase "bhrb_filter_map_test" tests the valid and invalid filter maps in different powerpc platforms. Update this testcase to include scenario to cover multiple branch filters at sametime. Since powerpc doesn't support multiple filters at sametime, expect failure during perf_event_open. Reported-by: Disha Goel Signed-off-by: Athira Rajeev Reviewed-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921145255.20972-3-atrajeev@linux.vnet.ibm.com commit b9c001276d4a756f98cc7dc4672eff5343949203 Author: Athira Rajeev Date: Wed Sep 21 20:22:53 2022 +0530 powerpc/perf: Fix branch_filter support for multiple filters For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type ie branch filters are supported. The branch filters are requested via event attribute "branch_sample_type". Multiple branch filters can be passed in event attribute. eg: $ perf record -b -o- -B --branch-filter any,ind_call true None of the Power PMUs support having multiple branch filters at the same time. Branch filters for branch stack sampling is set via MMCRA IFM bits [32:33]. But currently when requesting for multiple filter types, the "perf record" command does not report any error. eg: $ perf record -b -o- -B --branch-filter any,save_type true $ perf record -b -o- -B --branch-filter any,ind_call true The "bhrb_filter_map" function in PMU driver code does the validity check for supported branch filters. But this check is done for single filter. Hence "perf record" will proceed here without reporting any error. Fix power_pmu_event_init() to return EOPNOTSUPP when multiple branch filters are requested in the event attr. After the fix: $ perf record --branch-filter any,ind_call -- ls Error: cycles: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' Reported-by: Disha Goel Signed-off-by: Athira Rajeev Tested-by: Disha Goel Reviewed-by: Madhavan Srinivasan Reviewed-by: Kajol Jain [mpe: Tweak comment and change log wording] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921145255.20972-1-atrajeev@linux.vnet.ibm.com commit e1100cee059ad0bea6a668177e835baa087a0c65 Author: Nicholas Piggin Date: Mon Sep 26 15:56:20 2022 +1000 powerpc/64s/interrupt: halt early boot interrupts if paca is not set up Ensure r13 is zero from very early in boot until it gets set to the boot paca pointer. This allows early program and mce handlers to halt if there is no valid paca, rather than potentially run off into the weeds. This preserves register and memory contents for low level debugging tools. Nothing could be printed to console at this point in any case because even udbg is only set up after the boot paca is set, so this shouldn't be missed. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926055620.2676869-6-npiggin@gmail.com commit 519b2e317e39ac99ce589a7c8480c47a17d62638 Author: Nicholas Piggin Date: Mon Sep 26 15:56:19 2022 +1000 powerpc/64: don't set boot CPU's r13 to paca until the structure is set up The idea is to get to the point where if r13 is non-zero, then it should contain a reasonable paca. This can be used in early boot program check and machine check handlers to avoid running off into the weeds if they hit before r13 has a paca. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926055620.2676869-5-npiggin@gmail.com commit b830c8754e046f96e84da9d3b3e028c4ceef2b18 Author: Nicholas Piggin Date: Mon Sep 26 15:56:18 2022 +1000 powerpc/64: avoid using r13 in relocate relocate() uses r13 in early boot before it is used for the paca. Use a different register for this so r13 is kept unchanged until it is set to the paca pointer. Avoid r14 as well while we're here, there's no reason not to use the volatile registers which is a bit less surprising, and r14 could be used as another fixed reg one day. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926055620.2676869-4-npiggin@gmail.com commit 2f5182cffa43f31c241131a2c10a4ecd8e90fb3e Author: Nicholas Piggin Date: Mon Sep 26 15:56:17 2022 +1000 powerpc/64s: early boot machine check handler Use the early boot interrupt fixup in the machine check handler to allow the machine check handler to run before interrupt endian is set up. Branch to an early boot handler that just does a basic crash, which allows it to run before ppc_md is set up. MSR[ME] is enabled on the boot CPU earlier, and the machine check stack is temporarily set to the middle of the init task stack. This allows machine checks (e.g., due to invalid data access in real mode) to print something useful earlier in boot (as soon as udbg is set up, if CONFIG_PPC_EARLY_DEBUG=y). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926055620.2676869-3-npiggin@gmail.com commit bf75a3258a40327b73c5b4458ae8102cfa921b40 Author: Nicholas Piggin Date: Mon Sep 26 15:56:16 2022 +1000 powerpc/64s/interrupt: move early boot ILE fixup into a macro In preparation for using this sequence in machine check interrupt, move it into a macro, with a small change to make it position independent. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926055620.2676869-2-npiggin@gmail.com commit 3569d84bb26f6f07d426446da3d2c836180f1565 Author: Nicholas Piggin Date: Mon Sep 26 13:40:57 2022 +1000 powerpc/64e: provide an addressing macro for use with TOC in alternate register The interrupt entry code carefully saves a minimal number of registers, so in some places the TOC is required, it is loaded into a different register, so provide a macro that can supply an alternate TOC register. This continues to use got addressing because TOC-relative results in "got/toc optimization is not supported" messages by the linker. Having r2 be one of the saved registers and using that for TOC addressing may be the best way to avoid that and switch this to TOC addressing. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926034057.2360083-6-npiggin@gmail.com commit 8e93fb33c84f68db20c0bc2821334a4c54c3e251 Author: Nicholas Piggin Date: Mon Sep 26 13:40:56 2022 +1000 powerpc/64: provide a helper macro to load r2 with the kernel TOC A later change stops the kernel using r2 and loads it with a poison value. Provide a PACATOC loading abstraction which can hide this detail. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926034057.2360083-5-npiggin@gmail.com commit 754f611774e4b9357a944f5b703dd291c85161cf Author: Nicholas Piggin Date: Mon Sep 26 13:40:55 2022 +1000 powerpc/64: switch asm helpers from GOT to TOC relative addressing There is no need to use GOT addressing within the kernel. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926034057.2360083-4-npiggin@gmail.com commit dab3b8f4fd09c22e8dbb2d9608194c7d52252f33 Author: Nicholas Piggin Date: Mon Sep 26 13:40:54 2022 +1000 powerpc/64: asm use consistent global variable declaration and access Use helper macros to access global variables, and place them in .data sections rather than in .toc. Putting addresses in TOC is not required because the kernel is linked with a single TOC. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926034057.2360083-3-npiggin@gmail.com commit 17773afdcd1589c5925a984f512330410cb2ba4f Author: Nicholas Piggin Date: Mon Sep 26 13:40:53 2022 +1000 powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER Using a 32-bit constant for this marker allows it to be loaded with two ALU instructions, like 32-bit. This avoids a TOC entry and a TOC load that depends on the r2 value that has just been loaded from the PACA. This changes the value for 32-bit as well, so both have the same value in the low 4 bytes and 64-bit has 0 in the top bytes. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926034057.2360083-2-npiggin@gmail.com commit 4b2a9315f20d98576e25c9e4572e9a8e028d7aa2 Author: Nicholas Piggin Date: Fri Sep 23 13:30:04 2022 +1000 powerpc/64s: POWER10 CPU Kconfig build option This adds basic POWER10_CPU option, which builds with -mcpu=power10. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220923033004.536127-1-npiggin@gmail.com commit 465dda9d320d1cb9424f1015b0520ec4c4f0d279 Author: Haren Myneni Date: Thu Sep 22 01:27:07 2022 -0700 powerpc/pseries: Move vas_migration_handler early during migration When the migration is initiated, the hypervisor changes VAS mappings as part of pre-migration event. Then the OS gets the migration event which closes all VAS windows before the migration starts. NX generates continuous faults until windows are closed and the user space can not differentiate these NX faults coming from the actual migration. So to reduce this time window, close VAS windows first in pseries_migrate_partition(). Signed-off-by: Haren Myneni Reviewed-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d8efade91dda831c9ed4abb226dab627da594c5f.camel@linux.ibm.com commit 1da5351f9eb9b72a7d25316b4d38bf10b6e671b1 Author: Nicholas Piggin Date: Mon Sep 26 15:43:05 2022 +1000 powerpc/64/irq: tidy soft-masked irq replay and improve documentation irq replay is quite complicated because of softirq processing which itself enables and disables irqs. Several considerations need to be accounted for due to this, and they are not clearly documented. Refactor the irq replay code a bit to tidy and deduplicate some common functions. Add comments, debug checks. This has a minor functional change that irq tracing enable/disable is done after each interrupt replayed, rather than after a batch. It also re-sets state to IRQS_ALL_DISABLED after an interrupt, which doesn't matter much because interrupts are hard disabled at this point, but it is more consistent with how interrupt handlers are called. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-8-npiggin@gmail.com commit f7bff6e7759b1abb59334f6448f9ef3172c4c04a Author: Nicholas Piggin Date: Mon Sep 26 15:43:04 2022 +1000 powerpc/64/interrupt: avoid BUG/WARN recursion in interrupt entry BUG/WARN are handled with a program interrupt which can turn into an infinite recursion when there are bugs in interrupt handler entry (which can be irritated by bugs in other parts of the code). There is one feeble attempt to avoid this recursion, but it misses several cases. Make a tidier macro for this and switch most bugs in the interrupt entry wrapper over to use it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-7-npiggin@gmail.com commit c39fb71a54f09977eba7584ef0eebb25047097c6 Author: Nicholas Piggin Date: Mon Sep 26 15:43:03 2022 +1000 powerpc/64s/interrupt: masked handler debug check for previous hard disable Prior changes eliminated cases of masked PACA_IRQ_MUST_HARD_MASK interrupts that re-fire due to MSR[EE] being enabled while they are pending. Add a debug check in the masked interrupt handler to catch if this occurs. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-6-npiggin@gmail.com commit 9524f2278f2e6925f147d9140c83f658e7a7c84f Author: Nicholas Piggin Date: Mon Sep 26 15:43:02 2022 +1000 powerpc/64s: Fix irq state management in runlatch functions When irqs are soft-disabled, MSR[EE] is volatile and can change from 1 to 0 asynchronously (if a PACA_IRQ_MUST_HARD_MASK interrupt hits). So it can not be used to check hard IRQ enabled status, except to confirm it is disabled. ppc64_runlatch_on/off functions use MSR this way to decide whether to re-enable MSR[EE] after disabling it, which leads to MSR[EE] being enabled when it shouldn't be (when a PACA_IRQ_MUST_HARD_MASK had disabled it between reading the MSR and clearing EE). This has been tolerated in the kernel previously, and it doesn't seem to cause a problem, but it is unexpected and may trip warnings or cause other problems as we tighten up this state management. Fix this by only re-enabling if PACA_IRQ_HARD_DIS is clear. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-5-npiggin@gmail.com commit e485f6c751e0a969327336c635ca602feea117f0 Author: Nicholas Piggin Date: Mon Sep 26 15:43:01 2022 +1000 powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending If a synchronous interrupt (e.g., hash fault) is taken inside an irqs-disabled region which has MSR[EE]=1, then an asynchronous interrupt that is PACA_IRQ_MUST_HARD_MASK (e.g., PMI) is taken inside the synchronous interrupt handler, then the synchronous interrupt will return with MSR[EE]=1 and the asynchronous interrupt fires again. If the asynchronous interrupt is a PMI and the original context does not have PMIs disabled (only Linux IRQs), the asynchronous interrupt will fire despite having the PMI marked soft pending. This can confuse the perf code and cause warnings. This patch changes the interrupt return so that irqs-disabled MSR[EE]=1 contexts will be returned to with MSR[EE]=0 if a PACA_IRQ_MUST_HARD_MASK interrupt has become pending in the meantime. The longer explanation for what happens: 1. local_irq_disable() 2. Hash fault interrupt fires, do_hash_fault handler runs 3. interrupt_enter_prepare() sets IRQS_ALL_DISABLED 4. interrupt_enter_prepare() sets MSR[EE]=1 5. PMU interrupt fires, masked handler runs 6. Masked handler marks PMI pending 7. Masked handler returns with PACA_IRQ_HARD_DIS set, MSR[EE]=0 8. do_hash_fault interrupt return handler runs 9. interrupt_exit_kernel_prepare() clears PACA_IRQ_HARD_DIS 10. interrupt returns with MSR[EE]=1 11. PMU interrupt fires, perf handler runs Fixes: 4423eb5ae32e ("powerpc/64/interrupt: make normal synchronous interrupts enable MSR[EE] if possible") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-4-npiggin@gmail.com commit 799f7063c7645f9a751d17f5dfd73b952f962cd2 Author: Nicholas Piggin Date: Mon Sep 26 15:43:00 2022 +1000 powerpc/64: mark irqs hard disabled in boot paca This prevents interrupts in early boot (e.g., program check) from enabling MSR[EE], potentially causing endian mismatch or other crashes when reporting early boot traps. Fixes: 4423eb5ae32ec ("powerpc/64/interrupt: make normal synchronous interrupts enable MSR[EE] if possible") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-3-npiggin@gmail.com commit 56adbb7a8b6cc7fc9b940829c38494e53c9e57d1 Author: Nicholas Piggin Date: Mon Sep 26 15:42:59 2022 +1000 powerpc/64/interrupt: Fix false warning in context tracking due to idle state Commit 171476775d32 ("context_tracking: Convert state to atomic_t") added a CONTEXT_IDLE state which can be encountered by interrupts from kernel mode in the idle thread, causing a false positive warning. Fixes: 171476775d32 ("context_tracking: Convert state to atomic_t") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926054305.2671436-2-npiggin@gmail.com commit a5edf9815dd739fce660b4c8658f61b7d2517042 Author: Nicholas Miehlbradt Date: Mon Sep 26 07:57:26 2022 +0000 powerpc/64s: Enable KFENCE on book3s64 KFENCE support was added for ppc32 in commit 90cbac0e995d ("powerpc: Enable KFENCE for PPC32"). Enable KFENCE on ppc64 architecture with hash and radix MMUs. It uses the same mechanism as debug pagealloc to protect/unprotect pages. All KFENCE kunit tests pass on both MMUs. KFENCE memory is initially allocated using memblock but is later marked as SLAB allocated. This necessitates the change to __pud_free to ensure that the KFENCE pages are freed appropriately. Based on previous work by Christophe Leroy and Jordan Niethe. Signed-off-by: Nicholas Miehlbradt Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926075726.2846-4-nicholas@linux.ibm.com commit d7902d31cbc3bf72722768831a684b0286ccd523 Author: Christophe Leroy Date: Mon Sep 26 07:57:25 2022 +0000 powerpc/64s: Allow double call of kernel_[un]map_linear_page() If the page is already mapped resp. already unmapped, bail out. Signed-off-by: Christophe Leroy Signed-off-by: Nicholas Miehlbradt Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926075726.2846-3-nicholas@linux.ibm.com commit 3e791d0f32b10eff9437822c6099c7a158560151 Author: Christophe Leroy Date: Mon Sep 26 07:57:24 2022 +0000 powerpc/64s: Remove unneeded #ifdef CONFIG_DEBUG_PAGEALLOC in hash_utils debug_pagealloc_enabled() is always defined and constant folds to 'false' when CONFIG_DEBUG_PAGEALLOC is not enabled. Remove the #ifdefs, the code and associated static variables will be optimised out by the compiler when CONFIG_DEBUG_PAGEALLOC is not defined. Signed-off-by: Christophe Leroy Signed-off-by: Nicholas Miehlbradt Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926075726.2846-2-nicholas@linux.ibm.com commit 5e8b2c4dd3a0a4a2966e61d60dbeafab441cff28 Author: Nicholas Miehlbradt Date: Mon Sep 26 07:57:23 2022 +0000 powerpc/64s: Add DEBUG_PAGEALLOC for radix There is support for DEBUG_PAGEALLOC on hash but not on radix. Add support on radix. Signed-off-by: Nicholas Miehlbradt Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926075726.2846-1-nicholas@linux.ibm.com commit 7fd123e544886bf04fa853869efe55cb3f22d0c0 Author: Nicholas Piggin Date: Wed Sep 21 11:41:03 2022 +1000 powerpc/64s: update cpu selection options Update the 64s GENERIC_CPU option. POWER4 support has been dropped, so make that clear in the option name. The POWER5_CPU option is dropped because it's uncommon, and GENERIC_CPU covers it. -mtune= before power8 is dropped because the minimum gcc version supports power8, and tuning is made consistent between big and little endian. A 970 option is added for PowerPC 970 / G5 because they still have a user base, and -mtune=power8 does not generate good code for the 970. This also updates the ISA versions document to add Power4/Power4+ because I didn't realise Power4+ used 2.01. Signed-off-by: Nicholas Piggin Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921014103.587954-2-npiggin@gmail.com commit 58ec7f06b74e0d6e76c4110afce367c8b5f0837d Author: Nicholas Piggin Date: Wed Sep 21 11:41:02 2022 +1000 powerpc/64s: Fix GENERIC_CPU build flags for PPC970 / G5 Big-endian GENERIC_CPU supports 970, but builds with -mcpu=power5. POWER5 is ISA v2.02 whereas 970 is v2.01 plus Altivec. 2.02 added the popcntb instruction which a compiler might use. Use -mcpu=power4. Fixes: 471d7ff8b51b ("powerpc/64s: Remove POWER4 support") Signed-off-by: Nicholas Piggin Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921014103.587954-1-npiggin@gmail.com commit 9c7bfc2dc21e737e8e4a753630bce675e1e7c0ad Author: Nicholas Piggin Date: Tue Sep 20 22:22:59 2022 +1000 powerpc/64s: Make POWER10 and later use pause_short in cpu_relax loops We want to move away from using SMT priority updates for cpu_relax, and use a 'wait' instruction which is similar to x86. As well as being a much better fit for what everybody else uses and tests with, priority nops are stateful which is nasty (interrupts have to consider they might be taken at a different priority), and they're expensive to execute, similar to a mtSPR which can effect other threads in the pipe. This has shown to give results that are less affected by code alignment on benchmarks that cause a lot of spin waiting (e.g., rwsem contention on unixbench filesystem benchmarks) on POWER10. QEMU TCG only supports this instruction correctly since v7.1, versions without the fix may cause hangs whne running POWER10 CPUs. Reviewed-by: Segher Boessenkool Signed-off-by: Nicholas Piggin [mpe: Fix checkpatch warnings RE the macros] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220920122259.363092-2-npiggin@gmail.com commit dabeb572adf24bbd7cb21d1cc4d118bdf2c2ab74 Author: Nicholas Piggin Date: Tue Sep 20 22:22:58 2022 +1000 powerpc: add ISA v3.0 / v3.1 wait opcode macro The wait instruction encoding changed between ISA v2.07 and ISA v3.0. In v3.1 the instruction gained a new field. Update the PPC_WAIT macro to the current encoding. Rename the older incompatible one with a _v203 suffix as it was introduced in v2.03 (the WC field was introduced in v2.07 but the kernel only uses WC=0). Reviewed-by: Segher Boessenkool Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220920122259.363092-1-npiggin@gmail.com commit c84550203b3173511e8cdbe94bc2e33175ba1d72 Author: Nicholas Piggin Date: Sat Sep 10 00:24:57 2022 +1000 powerpc/time: avoid programming DEC at the start of the timer interrupt Setting DEC to maximum at the start of the timer interrupt is not necessary and can be avoided for performance when MSR[EE] is not enabled during the handler as explained in commit 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use"), where this change was first attempted. The idea is that the timer interrupt runs with MSR[EE]=0, and at the end of the interrupt DEC is programmed to the next timer interval, so there is no need to clear the decrementer exception before then. When the above commit was merged, that was not quite true. The low res timer subsystem had some cases in the oneshot timer code where if the tick was to be stopped and no timers active, the clock device would not get the ->set_state_oneshot_stopped() call, so DEC would not get reprogrammed, and this would hang taking continual timer interrupts. So this was reverted in commit d2b9be1f4af5 ("powerpc/time: Always set decrementer in timer_interrupt()"), which was a partial revert of the above commit. Commit 62c1256d5447 ("timers/nohz: Switch to ONESHOT_STOPPED in the low-res handler when the tick is stopped") was later merged to fix this missing case in the timer subsystem, so now the behaviour can be restored. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220909142457.278032-1-npiggin@gmail.com commit b19448fe846baad689ff51a991ebfc74b4b5e0a8 Author: Pali Rohár Date: Tue Aug 23 01:15:01 2022 +0200 powerpc: Add support for early debugging via Serial 16550 console Currently powerpc early debugging contains lot of platform specific options, but does not support standard UART / serial 16550 console. Later legacy_serial.c code supports registering UART as early debug console from device tree but it is not early during booting, but rather later after machine description code finishes. So for real early debugging via UART is current code unsuitable. Add support for new early debugging option CONFIG_PPC_EARLY_DEBUG_16550 which enable Serial 16550 console on address defined by new option CONFIG_PPC_EARLY_DEBUG_16550_PHYSADDR and by stride by option CONFIG_PPC_EARLY_DEBUG_16550_STRIDE. With this change it is possible to debug powerpc machine descriptor code. For example this early debugging code can print on serial console also "No suitable machine description found" error which is done before legacy_serial.c code. Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220822231501.16827-1-pali@kernel.org commit bd7dc90e52e8db7ee0f38c51bc9047bafb54fe43 Author: Hari Bathini Date: Mon Sep 12 12:20:31 2022 +0530 powerpc/64/kdump: Limit kdump base to 512MB Since commit e641eb03ab2b0 ("powerpc: Fix up the kdump base cap to 128M") memory for kdump kernel has been reserved at an offset of 128MB. This held up well for a long time before running into boot failure on LPARs having a lot of cores. Commit 7c5ed82b800d8 ("powerpc: Set crashkernel offset to mid of RMA region") fixed this boot failure by moving the offset to mid of RMA region. This change meant the offset is either 256MB or 512MB on LPARs as ppc64_rma_size was 512MB or 1024MB owing to commit 103a8542cb35b ("powerpc/book3s64/ radix: Fix boot failure with large amount of guest memory"). But ppc64_rma_size can be larger as well with newer f/w. So, limit crashkernel reservation offset to 512MB to avoid running into boot failures during kdump kernel boot, due to RTAS or other allocation restrictions. Also, while here, use SZ_128M instead of opening coding it. Signed-off-by: Hari Bathini Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220912065031.57416-1-hbathini@linux.ibm.com commit 7e92e01b724526b98cbc7f03dd4afa0295780d56 Author: Rohan McLure Date: Wed Sep 21 16:56:01 2022 +1000 powerpc: Provide syscall wrapper Implement syscall wrapper as per s390, x86, arm64. When enabled cause handlers to accept parameters from a stack frame rather than from user scratch register state. This allows for user registers to be safely cleared in order to reduce caller influence on speculation within syscall routine. The wrapper is a macro that emits syscall handler symbols that call into the target handler, obtaining its parameters from a struct pt_regs on the stack. As registers are already saved to the stack prior to calling system_call_exception, it appears that this function is executed more efficiently with the new stack-pointer convention than with parameters passed by registers, avoiding the allocation of a stack frame for this method. On a 32-bit system, we see >20% performance increases on the null_syscall microbenchmark, and on a Power 8 the performance gains amortise the cost of clearing and restoring registers which is implemented at the end of this series, seeing final result of ~5.6% performance improvement on null_syscall. Syscalls are wrapped in this fashion on all platforms except for the Cell processor as this commit does not provide SPU support. This can be quickly fixed in a successive patch, but requires spu_sys_callback to allocate a pt_regs structure to satisfy the wrapped calling convention. Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin [mpe: Make incompatible with COMPAT to retain clearing of high bits of args] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-22-rmclure@linux.ibm.com commit f8971c627b14040e533768985a99f4fd6ffa420f Author: Rohan McLure Date: Wed Sep 21 16:56:00 2022 +1000 powerpc: Change system_call_exception calling convention Change system_call_exception arguments to pass a pointer to a stack frame container caller state, as well as the original r0, which determines the number of the syscall. This has been observed to yield improved performance to passing them by registers, circumventing the need to allocate a stack frame. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin [mpe: Retain clearing of high bits of args for compat tasks] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-21-rmclure@linux.ibm.com commit 8640de0dee49cec50040d9845a2bc96fd15adc9e Author: Rohan McLure Date: Wed Sep 21 16:55:58 2022 +1000 powerpc: Use common syscall handler type Cause syscall handlers to be typed as follows when called indirectly throughout the kernel. This is to allow for better type checking. typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); Since both 32 and 64-bit abis allow for at least the first six machine-word length parameters to a function to be passed by registers, even handlers which admit fewer than six parameters may be viewed as having the above type. Coercing syscalls to syscall_fn requires a cast to void* to avoid -Wcast-function-type. Fixup comparisons in VDSO to avoid pointer-integer comparison. Introduce explicit cast on systems with SPUs. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-19-rmclure@linux.ibm.com commit 39859aea411b1696c6bc0c04bd2b5095ddba6196 Author: Rohan McLure Date: Wed Sep 21 16:55:57 2022 +1000 powerpc: Enable compile-time check for syscall handlers The table of syscall handlers and registered compatibility syscall handlers has in past been produced using assembly, with function references resolved at link time. This moves link-time errors to compile-time, by rewriting systbl.S in C, and including the linux/syscalls.h, linux/compat.h and asm/syscalls.h headers for prototypes. Reported-by: Arnd Bergmann Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-18-rmclure@linux.ibm.com commit 8cd1def4b8e4a592949509fac443e850da8428d0 Author: Rohan McLure Date: Wed Sep 21 16:55:56 2022 +1000 powerpc: Include all arch-specific syscall prototypes Forward declare all syscall handler prototypes where a generic prototype is not provided in either linux/syscalls.h or linux/compat.h in asm/syscalls.h. This is required for compile-time type-checking for syscall handlers, which is implemented later in this series. 32-bit compatibility syscall handlers are expressed in terms of types in ppc32.h. Expose this header globally. Signed-off-by: Rohan McLure Acked-by: Nicholas Piggin [mpe: Use standard include guard naming for syscalls_32.h] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-17-rmclure@linux.ibm.com commit dec20c50df79cadaff17e964ef7f622491a52134 Author: Rohan McLure Date: Wed Sep 21 16:55:55 2022 +1000 powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers Arch-specific implementations of syscall handlers are currently used over generic implementations for the following reasons: 1. Semantics unique to powerpc 2. Compatibility syscalls require 'argument padding' to comply with 64-bit argument convention in ELF32 abi. 3. Parameter types or order is different in other architectures. These syscall handlers have been defined prior to this patch series without invoking the SYSCALL_DEFINE or COMPAT_SYSCALL_DEFINE macros with custom input and output types. We remove every such direct definition in favour of the aforementioned macros. Also update syscalls.tbl in order to refer to the symbol names generated by each of these macros. Since ppc64_personality can be called by both 64 bit and 32 bit binaries through compatibility, we must generate both both compat_sys_ and sys_ symbols for this handler. As an aside: A number of architectures including arm and powerpc agree on an alternative argument order and numbering for most of these arch-specific handlers. A future patch series may allow for asm/unistd.h to signal through its defines that a generic implementation of these syscall handlers with the correct calling convention be emitted, through the __ARCH_WANT_COMPAT_SYS_... convention. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-16-rmclure@linux.ibm.com commit ac17defbeb4e8285c5b9752164b1d68b13bf3e3b Author: Rohan McLure Date: Wed Sep 21 16:55:54 2022 +1000 powerpc: Provide do_ppc64_personality helper Avoid duplication in future patch that will define the ppc64_personality syscall handler in terms of the SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE macros, by extracting the common body of ppc64_personality into a helper function. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-15-rmclure@linux.ibm.com commit b7fa9ce86d32baf2a3a8bf8fdaa44870084edd85 Author: Rohan McLure Date: Wed Sep 21 16:55:53 2022 +1000 powerpc: Remove direct call to mmap2 syscall handlers Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Move the compatibility syscall definition for mmap2 to syscalls.c, so that all mmap implementations can share a helper function. Remove 'inline' on static mmap helper. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin [mpe: Fix compat_sys_mmap2() prototype and offset handling] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-14-rmclure@linux.ibm.com commit 8fb65e05bd60058e15842e511b3ee5299ac51829 Author: Niklas Schnelle Date: Fri Sep 9 14:34:41 2022 +0200 s390/pci: remove unused bus_next field from struct zpci_dev This field was added in commit 44510d6fa0c0 ("s390/pci: Handling multifunctions") but is an unused remnant of an earlier version where the devices on the virtual bus were connected in a linked list instead of a fixed 256 entry array of pointers. It is also not used for the list of busses as that is threaded through struct zpci_bus not through struct zpci_dev. Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 4b39d40ea1a076ac643c7383cdb1cb66617fe860 Author: Gaosheng Cui Date: Wed Sep 14 12:52:33 2022 +0000 s390/cio: remove unused ccw_device_force_console() declaration ccw_device_force_console() has been removed by commit 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver"), so remove the declaration, too. Signed-off-by: Gaosheng Cui Acked-by: Vineeth Vijayan Signed-off-by: Vasily Gorbik commit 019d157e5b0355b4da957f262b3eeb3b7a948f8b Author: Simon Ser Date: Mon Sep 5 10:36:07 2022 +0000 drm/framebuffer: convert to drm_dbg_kms() Replace DRM_DEBUG_KMS() with drm_dbg_kms() which allows specifying the DRM device to provide more context. Signed-off-by: Simon Ser Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220905103559.118561-1-contact@emersion.fr commit b9a5cbf8ba24e88071a97a51a09ef5cdf0d1f6a1 Merge: c87e4ad1d3a09 d902e1a737d44 Author: David S. Miller Date: Wed Sep 28 09:43:22 2022 +0100 Merge branch 'sfc-tc-offload' Edward Cree says: ==================== sfc: bare bones TC offload This series begins the work of supporting TC flower offload on EF100 NICs. This is the absolute minimum viable TC implementation to get traffic to VFs and allow them to be tested; it supports no match fields besides ingress port, no actions besides mirred and drop, and no stats. More matches, actions, and counters will be added in subsequent patches. Changed in v2: - Add missing 'static' on declarations (kernel test robot, sparse) ==================== Signed-off-by: David S. Miller commit d902e1a737d44e678eeb981df11c842c2cc1db74 Author: Edward Cree Date: Mon Sep 26 19:57:36 2022 +0100 sfc: bare bones TC offload on EF100 This is the absolute minimum viable TC implementation to get traffic to VFs and allow them to be tested; it supports no match fields besides ingress port, no actions besides mirred and drop, and no stats. Example usage: tc filter add dev $PF parent ffff: flower skip_sw \ action mirred egress mirror dev $VFREP tc filter add dev $VFREP parent ffff: flower skip_sw \ action mirred egress redirect dev $PF gives a VF unfiltered access to the network out the physical port ($PF acts here as a physical port representor). More matches, actions, and counters will be added in subsequent patches. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 7ce3e235f21268905864fd9bcf71a026db045588 Author: Edward Cree Date: Mon Sep 26 19:57:35 2022 +0100 sfc: interrogate MAE capabilities at probe time Different versions of EF100 firmware and FPGA bitstreams support different matching capabilities in the Match-Action Engine. Probe for these at start of day; subsequent patches will validate TC offload requests against the reported capabilities. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit f54a28a211664017531aebc997bf3c6a279e0d6f Author: Edward Cree Date: Mon Sep 26 19:57:34 2022 +0100 sfc: add a hashtable for offloaded TC rules Nothing inserts into this table yet, but we have code to remove rules on FLOW_CLS_DESTROY or at driver teardown time, in both cases also attempting to remove the corresponding hardware rules. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 7c9d266d8faffab935fb7b30056a476289c2a4a3 Author: Edward Cree Date: Mon Sep 26 19:57:33 2022 +0100 sfc: optional logging of TC offload errors TC offload support will involve complex limitations on what matches and actions a rule can do, in some cases potentially depending on rules already offloaded. So add an ethtool private flag "log-tc-errors" which controls reporting the reasons for un-offloadable TC rules at NETIF_INFO. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 5b2e12d51bd8efaf0be8309d5b2c716ad848cb37 Author: Edward Cree Date: Mon Sep 26 19:57:32 2022 +0100 sfc: bind indirect blocks for TC offload on EF100 Bind indirect blocks for recognised tunnel netdevices. Currently these connect to a stub efx_tc_flower() that only returns -EOPNOTSUPP; subsequent patches will implement flower offloads to the Match-Action Engine. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 9dc0cad203ab57efac34e6bcb67635edf3b62ebf Author: Edward Cree Date: Mon Sep 26 19:57:31 2022 +0100 sfc: bind blocks for TC offload on EF100 Bind direct blocks for the MAE-admin PF and each VF representor. Currently these connect to a stub efx_tc_flower() that only returns -EOPNOTSUPP; subsequent patches will implement flower offloads to the Match-Action Engine. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit c87e4ad1d3a09504de0e573ff3a2ee3f04a24642 Author: Gustavo A. R. Silva Date: Mon Sep 26 16:50:03 2022 -0500 net: ethernet: rmnet: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/221 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 8fff09effb0720d13a52eb227bf0f23c4e4b9989 Author: Zhengchao Shao Date: Mon Sep 26 18:21:58 2022 +0800 net: sched: act_bpf: simplify code logic in tcf_bpf_init() Both is_bpf and is_ebpf are boolean types, so (!is_bpf && !is_ebpf) || (is_bpf && is_ebpf) can be reduced to is_bpf == is_ebpf in tcf_bpf_init(). Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 6a1dc68eb14eba47e039c2eeebaf403dd4689f52 Merge: 2ae3cb58b9afc 29aaf3d40e018 Author: David S. Miller Date: Wed Sep 28 09:36:28 2022 +0100 Merge branch 'lan966x-qos' Horatiu Vultur says: ==================== net: lan966x: Add tbf, cbs, ets support Add support for offloading QoS features with tc command to lan966x. The offloaded Qos features are tbf, cbs and ets. ==================== Signed-off-by: David S. Miller commit 29aaf3d40e0184ceafcda3b56c0af1ceb4d52aa4 Author: Horatiu Vultur Date: Sun Sep 25 20:46:33 2022 +0200 net: lan966x: Add offload support for ets Add ets qdisc which allows to mix strict priority with bandwidth-sharing bands. The ets qdisc needs to be attached as root qdisc. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 21ce14a8e71ca0c73090592fe4a99d76e425ef98 Author: Horatiu Vultur Date: Sun Sep 25 20:46:32 2022 +0200 net: lan966x: Add offload support for cbs Lan966x switch supports credit based shaper in hardware according to IEEE Std 802.1Q-2018 Section 8.6.8.2. Add support for cbs configuration on egress port of lan966x switch. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 94644b6d72b4ebb4b0cbea35ee542463b2225803 Author: Horatiu Vultur Date: Sun Sep 25 20:46:31 2022 +0200 net: lan966x: Add offload support for tbf The tbf qdisc allows to attach a shaper on traffic egress on a port or on a queue. On port they are attached directly to the root and on queue they are attached on one of the classes of the parent qdisc. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 178422c27badb8eee5edfae3f6cc3048cc140364 Merge: 1e63d2973ea39 e7afa79a3b35a Author: Ulf Hansson Date: Wed Sep 28 10:09:29 2022 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.0rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.1. Signed-off-by: Ulf Hansson commit 1e63d2973ea39ffebd829de632b6b2336d59f41f Author: Adrian Hunter Date: Mon Sep 26 22:20:22 2022 +0300 mmc: sdhci: Centralize CMD and DATA reset handling Centralize CMD and DATA reset handling so that is more obvious how reset is handled in different situations. Signed-off-by: Adrian Hunter Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20220926192022.85660-5-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 6fbde9e98a580feec73f3e1677c1f4b7a1ce8c64 Author: Adrian Hunter Date: Mon Sep 26 22:20:21 2022 +0300 mmc: sdhci: Get rid of SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS is used by only ENE controllers but can be replaced by driver code. Amend the ENE code to hook the ->set_ios() mmc host operation and do the reset there. Signed-off-by: Adrian Hunter Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20220926192022.85660-4-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit bd980df9c4d59ef416d8350f529f7611b06e355e Author: Adrian Hunter Date: Mon Sep 26 22:20:20 2022 +0300 mmc: sdhci: Remove misleading comment about resets In SDHCI specification section 3.10.1 Error Interrupt Recovery, the flow chart shows Software Reset for CMD separately and before Software Reset for DAT, so the comment "Spec says we should do both at the same time" is not correct. Remove it. Signed-off-by: Adrian Hunter Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20220926192022.85660-3-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit aa9907224b50b819ba5a7cf200e8ede70f6b1fef Author: Adrian Hunter Date: Mon Sep 26 22:20:19 2022 +0300 mmc: sdhci: Separate out sdhci_reset_for_all() Tidy sdhci_do_reset() slightly by separating out sdhci_reset_for_all() which removes the need to test the mask in sdhci_do_reset(). Signed-off-by: Adrian Hunter Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20220926192022.85660-2-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 5aec788aeb8eb74282b75ac1b317beb0fbb69a42 Author: Peter Zijlstra Date: Tue Sep 27 21:02:34 2022 +0200 sched: Fix TASK_state comparisons Task state is fundamentally a bitmask; direct comparisons are probably not working as intended. Specifically the normal wait-state have a number of possible modifiers: TASK_UNINTERRUPTIBLE: TASK_WAKEKILL, TASK_NOLOAD, TASK_FREEZABLE TASK_INTERRUPTIBLE: TASK_FREEZABLE Specifically, the addition of TASK_FREEZABLE wrecked __wait_is_interruptible(). This however led to an audit of direct comparisons yielding the rest of the changes. Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic") Reported-by: Christian Borntraeger Debugged-by: Christian Borntraeger Signed-off-by: Peter Zijlstra (Intel) Tested-by: Christian Borntraeger commit 2ae3cb58b9afc1ede5cb79d5718efbb4b798b140 Merge: d89318bbdf2b8 cc62fbe114c9f Author: David S. Miller Date: Wed Sep 28 08:32:55 2022 +0100 Merge branch 'tc-testing-qdisc' Zhengchao Shao says: ==================== net: add tc-testing qdisc test cases For this patchset, test cases of the qdisc modules are added to the tc-testing test suite. Last, thanks to Victor for testing and suggestion. After a test case is added locally, the test result is as follows: ./tdc.py -c atm ok 1 7628 - Create ATM with default setting ok 2 390a - Delete ATM with valid handle ok 3 32a0 - Show ATM class ok 4 6310 - Dump ATM stats ./tdc.py -c choke ok 1 8937 - Create CHOKE with default setting ok 2 48c0 - Create CHOKE with min packet setting ok 3 38c1 - Create CHOKE with max packet setting ok 4 234a - Create CHOKE with ecn setting ok 5 4380 - Create CHOKE with burst setting ok 6 48c7 - Delete CHOKE with valid handle ok 7 4398 - Replace CHOKE with min setting ok 8 0301 - Change CHOKE with limit setting ./tdc.py -c codel ok 1 983a - Create CODEL with default setting ok 2 38aa - Create CODEL with limit packet setting ok 3 9178 - Create CODEL with target setting ok 4 78d1 - Create CODEL with interval setting ok 5 238a - Create CODEL with ecn setting ok 6 939c - Create CODEL with ce_threshold setting ok 7 8380 - Delete CODEL with valid handle ok 8 289c - Replace CODEL with limit setting ok 9 0648 - Change CODEL with limit setting ./tdc.py -c etf ok 1 34ba - Create ETF with default setting ok 2 438f - Create ETF with delta nanos setting ok 3 9041 - Create ETF with deadline_mode setting ok 4 9a0c - Create ETF with skip_sock_check setting ok 5 2093 - Delete ETF with valid handle ./tdc.py -c fq ok 1 983b - Create FQ with default setting ok 2 38a1 - Create FQ with limit packet setting ok 3 0a18 - Create FQ with flow_limit setting ok 4 2390 - Create FQ with quantum setting ok 5 845b - Create FQ with initial_quantum setting ok 6 9398 - Create FQ with maxrate setting ok 7 342c - Create FQ with nopacing setting ok 8 6391 - Create FQ with refill_delay setting ok 9 238b - Create FQ with low_rate_threshold setting ok 10 7582 - Create FQ with orphan_mask setting ok 11 4894 - Create FQ with timer_slack setting ok 12 324c - Create FQ with ce_threshold setting ok 13 424a - Create FQ with horizon time setting ok 14 89e1 - Create FQ with horizon_cap setting ok 15 32e1 - Delete FQ with valid handle ok 16 49b0 - Replace FQ with limit setting ok 17 9478 - Change FQ with limit setting ./tdc.py -c gred ok 1 8942 - Create GRED with default setting ok 2 5783 - Create GRED with grio setting ok 3 8a09 - Create GRED with limit setting ok 4 48cb - Create GRED with ecn setting ok 5 763a - Change GRED setting ok 6 8309 - Show GRED class ./tdc.py -c hhf ok 1 4812 - Create HHF with default setting ok 2 8a92 - Create HHF with limit setting ok 3 3491 - Create HHF with quantum setting ok 4 ba04 - Create HHF with reset_timeout setting ok 5 4238 - Create HHF with admit_bytes setting ok 6 839f - Create HHF with evict_timeout setting ok 7 a044 - Create HHF with non_hh_weight setting ok 8 32f9 - Change HHF with limit setting ok 9 385e - Show HHF class ./tdc.py -c pfifo_fast ok 1 900c - Create pfifo_fast with default setting ok 2 7470 - Dump pfifo_fast stats ok 3 b974 - Replace pfifo_fast with different handle ok 4 3240 - Delete pfifo_fast with valid handle ok 5 4385 - Delete pfifo_fast with invalid handle ./tdc.py -c plug ok 1 3289 - Create PLUG with default setting ok 2 0917 - Create PLUG with block setting ok 3 483b - Create PLUG with release setting ok 4 4995 - Create PLUG with release_indefinite setting ok 5 389c - Create PLUG with limit setting ok 6 384a - Delete PLUG with valid handle ok 7 439a - Replace PLUG with limit setting ok 8 9831 - Change PLUG with limit setting ./tdc.py -c sfb ok 1 3294 - Create SFB with default setting ok 2 430a - Create SFB with rehash setting ok 3 3410 - Create SFB with db setting ok 4 49a0 - Create SFB with limit setting ok 5 1241 - Create SFB with max setting ok 6 3249 - Create SFB with target setting ok 7 30a9 - Create SFB with increment setting ok 8 239a - Create SFB with decrement setting ok 9 9301 - Create SFB with penalty_rate setting ok 10 2a01 - Create SFB with penalty_burst setting ok 11 3209 - Change SFB with rehash setting ok 12 5447 - Show SFB class ./tdc.py -c sfq ok 1 7482 - Create SFQ with default setting ok 2 c186 - Create SFQ with limit setting ok 3 ae23 - Create SFQ with perturb setting ok 4 a430 - Create SFQ with quantum setting ok 5 4539 - Create SFQ with divisor setting ok 6 b089 - Create SFQ with flows setting ok 7 99a0 - Create SFQ with depth setting ok 8 7389 - Create SFQ with headdrop setting ok 9 6472 - Create SFQ with redflowlimit setting ok 10 8929 - Show SFQ class ./tdc.py -c skbprio ok 1 283e - Create skbprio with default setting ok 2 c086 - Create skbprio with limit setting ok 3 6733 - Change skbprio with limit setting ok 4 2958 - Show skbprio class ./tdc.py -c taprio ok 1 ba39 - Add taprio Qdisc to multi-queue device (8 queues) ok 2 9462 - Add taprio Qdisc with multiple sched-entry ok 3 8d92 - Add taprio Qdisc with txtime-delay ok 4 d092 - Delete taprio Qdisc with valid handle ok 5 8471 - Show taprio class ok 6 0a85 - Add taprio Qdisc to single-queue device ./tdc.py -c tbf ok 1 6430 - Create TBF with default setting ok 2 0518 - Create TBF with mtu setting ok 3 320a - Create TBF with peakrate setting ok 4 239b - Create TBF with latency setting ok 5 c975 - Create TBF with overhead setting ok 6 948c - Create TBF with linklayer setting ok 7 3549 - Replace TBF with mtu ok 8 f948 - Change TBF with latency time ok 9 2348 - Show TBF class ./tdc.py -c teql ok 1 84a0 - Create TEQL with default setting ok 2 7734 - Create TEQL with multiple device ok 3 34a9 - Delete TEQL with valid handle ok 4 6289 - Show TEQL stats --- v3: add config v2: modify subject prefix ==================== Signed-off-by: David S. Miller commit cc62fbe114c9fada6594d7766acdd709c1c85cf1 Author: Zhengchao Shao Date: Sat Sep 24 10:51:57 2022 +0800 selftests/tc-testing: add selftests for teql qdisc Test 84a0: Create TEQL with default setting Test 7734: Create TEQL with multiple device Test 34a9: Delete TEQL with valid handle Test 6289: Show TEQL stats Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 10835be3f0f770254776512db21bba9b410da3c4 Author: Zhengchao Shao Date: Sat Sep 24 10:51:56 2022 +0800 selftests/tc-testing: add selftests for tbf qdisc Test 6430: Create TBF with default setting Test 0518: Create TBF with mtu setting Test 320a: Create TBF with peakrate setting Test 239b: Create TBF with latency setting Test c975: Create TBF with overhead setting Test 948c: Create TBF with linklayer setting Test 3549: Replace TBF with mtu Test f948: Change TBF with latency time Test 2348: Show TBF class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 8a3b3667ddbd426d2d1a92069954a930e0f1c476 Author: Zhengchao Shao Date: Sat Sep 24 10:51:55 2022 +0800 selftests/tc-testing: add selftests for taprio qdisc Test ba39: Add taprio Qdisc to multi-queue device (8 queues) Test 9462: Add taprio Qdisc with multiple sched-entry Test 8d92: Add taprio Qdisc with txtime-delay Test d092: Delete taprio Qdisc with valid handle Test 8471: Show taprio class Test 0a85: Add taprio Qdisc to single-queue device Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit c5a2d86b922868f7a3aecd4bb757d54acde85996 Author: Zhengchao Shao Date: Sat Sep 24 10:51:54 2022 +0800 selftests/tc-testing: add selftests for skbprio qdisc Test 283e: Create skbprio with default setting Test c086: Create skbprio with limit setting Test 6733: Change skbprio with limit setting Test 2958: Show skbprio class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 0158f65bfbdddae1ca72d7be548051fce6b42719 Author: Zhengchao Shao Date: Sat Sep 24 10:51:53 2022 +0800 selftests/tc-testing: add selftests for sfq qdisc Test 7482: Create SFQ with default setting Test c186: Create SFQ with limit setting Test ae23: Create SFQ with perturb setting Test a430: Create SFQ with quantum setting Test 4539: Create SFQ with divisor setting Test b089: Create SFQ with flows setting Test 99a0: Create SFQ with depth setting Test 7389: Create SFQ with headdrop setting Test 6472: Create SFQ with redflowlimit setting Test 8929: Show SFQ class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 6ad92dc56fca398ae0461fcfcb9f2a3370cf26ac Author: Zhengchao Shao Date: Sat Sep 24 10:51:52 2022 +0800 selftests/tc-testing: add selftests for sfb qdisc Test 3294: Create SFB with default setting Test 430a: Create SFB with rehash setting Test 3410: Create SFB with db setting Test 49a0: Create SFB with limit setting Test 1241: Create SFB with max setting Test 3249: Create SFB with target setting Test 30a9: Create SFB with increment setting Test 239a: Create SFB with decrement setting Test 9301: Create SFB with penalty_rate setting Test 2a01: Create SFB with penalty_burst setting Test 3209: Change SFB with rehash setting Test 5447: Show SFB class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 7d0b4b0ccb1526aca3101cfe352aefa9915fb9af Author: Zhengchao Shao Date: Sat Sep 24 10:51:51 2022 +0800 selftests/tc-testing: add selftests for plug qdisc Test 3289: Create PLUG with default setting Test 0917: Create PLUG with block setting Test 483b: Create PLUG with release setting Test 4995: Create PLUG with release_indefinite setting Test 389c: Create PLUG with limit setting Test 384a: Delete PLUG with valid handle Test 439a: Replace PLUG with limit setting Test 9831: Change PLUG with limit setting Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 379a6509452e1b3c2eb916786f4c336c4ef054c0 Author: Zhengchao Shao Date: Sat Sep 24 10:51:50 2022 +0800 selftests/tc-testing: add selftests for pfifo_fast qdisc Test 900c: Create pfifo_fast with default setting Test 7470: Dump pfifo_fast stats Test b974: Replace pfifo_fast with different handle Test 3240: Delete pfifo_fast with valid handle Test 4385: Delete pfifo_fast with invalid handle Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 225aeb62fe5812bd1d25ce37d771a21b8b029f6a Author: Zhengchao Shao Date: Sat Sep 24 10:51:49 2022 +0800 selftests/tc-testing: add selftests for hhf qdisc Test 4812: Create HHF with default setting Test 8a92: Create HHF with limit setting Test 3491: Create HHF with quantum setting Test ba04: Create HHF with reset_timeout setting Test 4238: Create HHF with admit_bytes setting Test 839f: Create HHF with evict_timeout setting Test a044: Create HHF with non_hh_weight setting Test 32f9: Change HHF with limit setting Test 385e: Show HHF class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit a4a8d3562b07e7390708c9d6dc85932fceffe8af Author: Zhengchao Shao Date: Sat Sep 24 10:51:48 2022 +0800 selftests/tc-testing: add selftests for gred qdisc Test 8942: Create GRED with default setting Test 5783: Create GRED with grio setting Test 8a09: Create GRED with limit setting Test 48cb: Create GRED with ecn setting Test 763a: Change GRED setting Test 8309: Show GRED class Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 9e274718cc050874761ad4314d43cd82e7556128 Author: Zhengchao Shao Date: Sat Sep 24 10:51:47 2022 +0800 selftests/tc-testing: add selftests for fq qdisc Test 983b: Create FQ with default setting Test 38a1: Create FQ with limit packet setting Test 0a18: Create FQ with flow_limit setting Test 2390: Create FQ with quantum setting Test 845b: Create FQ with initial_quantum setting Test 9398: Create FQ with maxrate setting Test 342c: Create FQ with nopacing setting Test 6391: Create FQ with refill_delay setting Test 238b: Create FQ with low_rate_threshold setting Test 7582: Create FQ with orphan_mask setting Test 4894: Create FQ with timer_slack setting Test 324c: Create FQ with ce_threshold setting Test 424a: Create FQ with horizon time setting Test 89e1: Create FQ with horizon_cap setting Test 32e1: Delete FQ with valid handle Test 49b0: Replace FQ with limit setting Test 9478: Change FQ with limit setting Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit fa4b3e9f057b51e5bed86804c9f897f686d520ee Author: Zhengchao Shao Date: Sat Sep 24 10:51:46 2022 +0800 selftests/tc-testing: add selftests for etf qdisc Test 34ba: Create ETF with default setting Test 438f: Create ETF with delta nanos setting Test 9041: Create ETF with deadline_mode setting Test 9a0c: Create ETF with skip_sock_check setting Test 2093: Delete ETF with valid handle Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 412233b1f7e7b4ea6a4c325ae44602cbc152100a Author: Zhengchao Shao Date: Sat Sep 24 10:51:45 2022 +0800 selftests/tc-testing: add selftests for codel qdisc Test 983a: Create CODEL with default setting Test 38aa: Create CODEL with limit packet setting Test 9178: Create CODEL with target setting Test 78d1: Create CODEL with interval setting Test 238a: Create CODEL with ecn setting Test 939c: Create CODEL with ce_threshold setting Test 8380: Delete CODEL with valid handle Test 289c: Replace CODEL with limit setting Test 0648: Change CODEL with limit setting Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 99e0f78d6bdd36b4d435fc14923430041eb9b051 Author: Zhengchao Shao Date: Sat Sep 24 10:51:44 2022 +0800 selftests/tc-testing: add selftests for choke qdisc Test 8937: Create CHOKE with default setting Test 48c0: Create CHOKE with min packet setting Test 38c1: Create CHOKE with max packet setting Test 234a: Create CHOKE with ecn setting Test 4380: Create CHOKE with burst setting Test 48c7: Delete CHOKE with valid handle Test 4398: Replace CHOKE with min setting Test 0301: Change CHOKE with limit setting Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 0335833b10cd0a7998ac1892c03802c1ec014f0d Author: Zhengchao Shao Date: Sat Sep 24 10:51:43 2022 +0800 selftests/tc-testing: add selftests for atm qdisc Test 7628: Create ATM with default setting Test 390a: Delete ATM with valid handle Test 32a0: Show ATM class Test 6310: Dump ATM stats Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 615131b8e9bcd88e2d3ef78a4954ff4abfbb1fb7 Author: Miguel Ojeda Date: Sat Jul 3 17:24:21 2021 +0200 MAINTAINERS: Rust Miguel, Alex and Wedson will be maintaining the Rust support. Boqun, Gary and Björn will be reviewers. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda commit 4f4920669d21e1060b7243e5118dc3b71ced1276 Author: Liu Jian Date: Sat Sep 24 16:01:57 2022 +0800 xfrm: Reinject transport-mode packets through workqueue The following warning is displayed when the tcp6-multi-diffip11 stress test case of the LTP test suite is tested: watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [ns-tcpserver:48198] CPU: 0 PID: 48198 Comm: ns-tcpserver Kdump: loaded Not tainted 6.0.0-rc6+ #39 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : des3_ede_encrypt+0x27c/0x460 [libdes] lr : 0x3f sp : ffff80000ceaa1b0 x29: ffff80000ceaa1b0 x28: ffff0000df056100 x27: ffff0000e51e5280 x26: ffff80004df75030 x25: ffff0000e51e4600 x24: 000000000000003b x23: 0000000000802080 x22: 000000000000003d x21: 0000000000000038 x20: 0000000080000020 x19: 000000000000000a x18: 0000000000000033 x17: ffff0000e51e4780 x16: ffff80004e2d1448 x15: ffff80004e2d1248 x14: ffff0000e51e4680 x13: ffff80004e2d1348 x12: ffff80004e2d1548 x11: ffff80004e2d1848 x10: ffff80004e2d1648 x9 : ffff80004e2d1748 x8 : ffff80004e2d1948 x7 : 000000000bcaf83d x6 : 000000000000001b x5 : ffff80004e2d1048 x4 : 00000000761bf3bf x3 : 000000007f1dd0a3 x2 : ffff0000e51e4780 x1 : ffff0000e3b9a2f8 x0 : 00000000db44e872 Call trace: des3_ede_encrypt+0x27c/0x460 [libdes] crypto_des3_ede_encrypt+0x1c/0x30 [des_generic] crypto_cbc_encrypt+0x148/0x190 crypto_skcipher_encrypt+0x2c/0x40 crypto_authenc_encrypt+0xc8/0xfc [authenc] crypto_aead_encrypt+0x2c/0x40 echainiv_encrypt+0x144/0x1a0 [echainiv] crypto_aead_encrypt+0x2c/0x40 esp6_output_tail+0x1c8/0x5d0 [esp6] esp6_output+0x120/0x278 [esp6] xfrm_output_one+0x458/0x4ec xfrm_output_resume+0x6c/0x1f0 xfrm_output+0xac/0x4ac __xfrm6_output+0x130/0x270 xfrm6_output+0x60/0xec ip6_xmit+0x2ec/0x5bc inet6_csk_xmit+0xbc/0x10c __tcp_transmit_skb+0x460/0x8c0 tcp_write_xmit+0x348/0x890 __tcp_push_pending_frames+0x44/0x110 tcp_rcv_established+0x3c8/0x720 tcp_v6_do_rcv+0xdc/0x4a0 tcp_v6_rcv+0xc24/0xcb0 ip6_protocol_deliver_rcu+0xf0/0x574 ip6_input_finish+0x48/0x7c ip6_input+0x48/0xc0 ip6_rcv_finish+0x80/0x9c xfrm_trans_reinject+0xb0/0xf4 tasklet_action_common.constprop.0+0xf8/0x134 tasklet_action+0x30/0x3c __do_softirq+0x128/0x368 do_softirq+0xb4/0xc0 __local_bh_enable_ip+0xb0/0xb4 put_cpu_fpsimd_context+0x40/0x70 kernel_neon_end+0x20/0x40 sha1_base_do_update.constprop.0.isra.0+0x11c/0x140 [sha1_ce] sha1_ce_finup+0x94/0x110 [sha1_ce] crypto_shash_finup+0x34/0xc0 hmac_finup+0x48/0xe0 crypto_shash_finup+0x34/0xc0 shash_digest_unaligned+0x74/0x90 crypto_shash_digest+0x4c/0x9c shash_ahash_digest+0xc8/0xf0 shash_async_digest+0x28/0x34 crypto_ahash_digest+0x48/0xcc crypto_authenc_genicv+0x88/0xcc [authenc] crypto_authenc_encrypt+0xd8/0xfc [authenc] crypto_aead_encrypt+0x2c/0x40 echainiv_encrypt+0x144/0x1a0 [echainiv] crypto_aead_encrypt+0x2c/0x40 esp6_output_tail+0x1c8/0x5d0 [esp6] esp6_output+0x120/0x278 [esp6] xfrm_output_one+0x458/0x4ec xfrm_output_resume+0x6c/0x1f0 xfrm_output+0xac/0x4ac __xfrm6_output+0x130/0x270 xfrm6_output+0x60/0xec ip6_xmit+0x2ec/0x5bc inet6_csk_xmit+0xbc/0x10c __tcp_transmit_skb+0x460/0x8c0 tcp_write_xmit+0x348/0x890 __tcp_push_pending_frames+0x44/0x110 tcp_push+0xb4/0x14c tcp_sendmsg_locked+0x71c/0xb64 tcp_sendmsg+0x40/0x6c inet6_sendmsg+0x4c/0x80 sock_sendmsg+0x5c/0x6c __sys_sendto+0x128/0x15c __arm64_sys_sendto+0x30/0x40 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0x170/0x194 do_el0_svc+0x38/0x4c el0_svc+0x28/0xe0 el0t_64_sync_handler+0xbc/0x13c el0t_64_sync+0x180/0x184 Get softirq info by bcc tool: ./softirqs -NT 10 Tracing soft irq event time... Hit Ctrl-C to end. 15:34:34 SOFTIRQ TOTAL_nsecs block 158990 timer 20030920 sched 46577080 net_rx 676746820 tasklet 9906067650 15:34:45 SOFTIRQ TOTAL_nsecs block 86100 sched 38849790 net_rx 676532470 timer 1163848790 tasklet 9409019620 15:34:55 SOFTIRQ TOTAL_nsecs sched 58078450 net_rx 475156720 timer 533832410 tasklet 9431333300 The tasklet software interrupt takes too much time. Therefore, the xfrm_trans_reinject executor is changed from tasklet to workqueue. Add add spin lock to protect the queue. This reduces the processing flow of the tcp_sendmsg function in this scenario. Fixes: acf568ee859f0 ("xfrm: Reinject transport-mode packets through tasklet") Signed-off-by: Liu Jian Signed-off-by: Steffen Klassert commit e4fc6580b0796bcba8ca12c2c4b0352d280c91e5 Author: Miguel Ojeda Date: Sat Jul 3 17:21:12 2021 +0200 samples: add first Rust examples The beginning of a set of Rust modules that showcase how Rust modules look like and how to use the abstracted kernel features. It also includes an example of a Rust host program with several modules. These samples also double as tests in the CI. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Milan Landaverde Signed-off-by: Milan Landaverde Signed-off-by: Miguel Ojeda commit 094981352ce27bc36018c009d07ddf974c9725f5 Author: Miguel Ojeda Date: Thu Aug 4 12:16:44 2022 +0200 x86: enable initial Rust support Note that only x86_64 is covered and not all features nor mitigations are handled, but it is enough as a starting point and showcases the basics needed to add Rust support for a new architecture. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: David Gow Signed-off-by: David Gow Signed-off-by: Miguel Ojeda commit d07479b211b7a86c93883c74b8f9b1e33d06e262 Author: Miguel Ojeda Date: Sat Jul 3 17:23:16 2021 +0200 docs: add Rust documentation Most of the documentation for Rust is written within the source code itself, as it is idiomatic for Rust projects. This applies to both the shared infrastructure at `rust/` as well as any other Rust module (e.g. drivers) written across the kernel. However, these documents contain general information that does not fit particularly well in the source code, like the Quick Start guide. It also contains a few other small changes elsewhere in the documentation folder. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Adam Bratschi-Kaye Signed-off-by: Adam Bratschi-Kaye Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Michael Ellerman Signed-off-by: Michael Ellerman Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Wu XiangCheng Signed-off-by: Wu XiangCheng Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boris-Chengbiao Zhou Signed-off-by: Boris-Chengbiao Zhou Co-developed-by: Yuki Okushi Signed-off-by: Yuki Okushi Co-developed-by: Wei Liu Signed-off-by: Wei Liu Co-developed-by: Daniel Xu Signed-off-by: Daniel Xu Co-developed-by: Julian Merkle Signed-off-by: Julian Merkle Signed-off-by: Miguel Ojeda commit 2f7ab1267dc9b2d1f29695aff3211c87483480f3 Author: Miguel Ojeda Date: Sat Jul 3 16:42:57 2021 +0200 Kbuild: add Rust support Having most of the new files in place, we now enable Rust support in the build system, including `Kconfig` entries related to Rust, the Rust configuration printer and a few other bits. Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Adam Bratschi-Kaye Signed-off-by: Adam Bratschi-Kaye Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Michael Ellerman Signed-off-by: Michael Ellerman Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boris-Chengbiao Zhou Signed-off-by: Boris-Chengbiao Zhou Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Co-developed-by: Douglas Su Signed-off-by: Douglas Su Co-developed-by: Dariusz Sosnowski Signed-off-by: Dariusz Sosnowski Co-developed-by: Antonio Terceiro Signed-off-by: Antonio Terceiro Co-developed-by: Daniel Xu Signed-off-by: Daniel Xu Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Co-developed-by: Martin Rodriguez Reboredo Signed-off-by: Martin Rodriguez Reboredo Signed-off-by: Miguel Ojeda commit 80db40bac8f42f23132b2898b0490f8f76868a57 Author: Miguel Ojeda Date: Thu Aug 4 12:54:09 2022 +0200 rust: add `.rustfmt.toml` This is the configuration file for the `rustfmt` tool. `rustfmt` is a tool for formatting Rust code according to style guidelines. It is very commonly used across Rust projects. The default configuration options are used. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda commit e4b69cb9a99a567d1611f9cced92f475ae224cdb Author: Daniel Xu Date: Thu Aug 4 12:55:07 2022 +0200 scripts: add `is_rust_module.sh` This script is used to detect whether a kernel module is written in Rust. It will later be used to disable BTF generation on Rust modules as BTF does not yet support Rust. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Daniel Xu Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda commit 78521f3399abce9bb9db16d848044be873e117ac Author: Miguel Ojeda Date: Thu Aug 4 12:25:53 2022 +0200 scripts: add `rust_is_available.sh` This script tests whether the Rust toolchain requirements are in place to enable Rust support. It uses `min-tool-version.sh` to fetch the version numbers. The build system will call it to set `CONFIG_RUST_IS_AVAILABLE` in a later patch. It also has an option (`-v`) to explain what is missing, which is useful to set up the development environment. This is used via the `make rustavailable` target added in a later patch. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Miguel Cano Signed-off-by: Miguel Cano Co-developed-by: Tiago Lam Signed-off-by: Tiago Lam Signed-off-by: Miguel Ojeda commit 9a8ff24ce584ad9895f9416fe8fad6f8842f758d Author: Miguel Ojeda Date: Thu Aug 4 12:20:37 2022 +0200 scripts: add `generate_rust_target.rs` This script takes care of generating the custom target specification file for `rustc`, based on the kernel configuration. It also serves as an example of a Rust host program. A dummy architecture is kept in this patch so that a later patch adds x86 support on top with as few changes as possible. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: David Gow Signed-off-by: David Gow Signed-off-by: Miguel Ojeda commit 8c4555ccc55cf90e1e3eb2507be3c354f3d15839 Author: Miguel Ojeda Date: Sat Jul 3 17:26:15 2021 +0200 scripts: add `generate_rust_analyzer.py` The `generate_rust_analyzer.py` script generates the configuration file (`rust-project.json`) for rust-analyzer. rust-analyzer is a modular compiler frontend for the Rust language. It provides an LSP server which can be used in editors such as VS Code, Emacs or Vim. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boris-Chengbiao Zhou Signed-off-by: Boris-Chengbiao Zhou Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Signed-off-by: Miguel Ojeda commit 99115db4ecc87af73415939439ec604ea0531e6f Author: Miguel Ojeda Date: Sun Dec 5 19:00:43 2021 +0100 scripts: decode_stacktrace: demangle Rust symbols Recent versions of both Binutils (`c++filt`) and LLVM (`llvm-cxxfilt`) provide Rust v0 mangling support. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda commit d1d84b5f73888ccb9fc148dfc3cb3e15d3604d65 Author: Miguel Ojeda Date: Sun May 22 17:22:58 2022 +0200 scripts: checkpatch: enable language-independent checks for Rust Include Rust in the "source code files" category, so that the language-independent tests are checked for Rust too, and teach `checkpatch` about the comment style for Rust files. This enables the malformed SPDX check, the misplaced SPDX license tag check, the long line checks, the lines without a newline check and the embedded filename check. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda commit de48fa1a01e7752135c960a20d6c3b26544a8120 Author: Miguel Ojeda Date: Sun May 22 03:11:08 2022 +0200 scripts: checkpatch: diagnose uses of `%pA` in the C side as errors The `%pA` format specifier is only intended to be used from Rust. `checkpatch.pl` already gives a warning for invalid specificers: WARNING: Invalid vsprintf pointer extension '%pA' This makes it an error and introduces an explanatory message: ERROR: Invalid vsprintf pointer extension '%pA' - '%pA' is only intended to be used from Rust code Suggested-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Joe Perches Signed-off-by: Joe Perches Signed-off-by: Miguel Ojeda commit 787983da77185d355564b0436f7b4eaa40b8904b Author: Gary Guo Date: Sat Jul 3 17:38:57 2021 +0200 vsprintf: add new `%pA` format specifier This patch adds a format specifier `%pA` to `vsprintf` which formats a pointer as `core::fmt::Arguments`. Doing so allows us to directly format to the internal buffer of `printf`, so we do not have to use a temporary buffer on the stack to pre-assemble the message on the Rust side. This specifier is intended only to be used from Rust and not for C, so `checkpatch.pl` is intentionally unchanged to catch any misuse. Reviewed-by: Kees Cook Acked-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Gary Guo Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda commit 8fcbf024920b96cd8c59f85d57d97af7237237b4 Author: Miguel Ojeda Date: Sat Jul 3 17:18:23 2021 +0200 rust: export generated symbols All symbols are reexported reusing the `EXPORT_SYMBOL_GPL` macro from C. The lists of symbols are generated on the fly. There are three main sets of symbols to distinguish: - The ones from the `core` and `alloc` crates (from the Rust standard library). The code is licensed as Apache/MIT. - The ones from our abstractions in the `kernel` crate. - The helpers (already exported since they are not generated). We export everything as GPL. This ensures we do not mistakenly expose GPL kernel symbols/features as non-GPL, even indirectly. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Signed-off-by: Miguel Ojeda commit 247b365dc8dc442412c88fe02346cd2bddac7bd6 Author: Wedson Almeida Filho Date: Fri Feb 11 20:25:34 2022 +0100 rust: add `kernel` crate The `kernel` crate currently includes all the abstractions that wrap kernel features written in C. These abstractions call the C side of the kernel via the generated bindings with the `bindgen` tool. Modules developed in Rust should never call the bindings themselves. In the future, as the abstractions grow in number, we may need to split this crate into several, possibly following a similar subdivision in subsystems as the kernel itself and/or moving the code to the actual subsystems. Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Geoffrey Thomas Signed-off-by: Geoffrey Thomas Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Adam Bratschi-Kaye Signed-off-by: Adam Bratschi-Kaye Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boris-Chengbiao Zhou Signed-off-by: Boris-Chengbiao Zhou Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Co-developed-by: Fox Chen Signed-off-by: Fox Chen Co-developed-by: Viktor Garske Signed-off-by: Viktor Garske Co-developed-by: Dariusz Sosnowski Signed-off-by: Dariusz Sosnowski Co-developed-by: Léo Lanteri Thauvin Signed-off-by: Léo Lanteri Thauvin Co-developed-by: Niklas Mohrin Signed-off-by: Niklas Mohrin Co-developed-by: Milan Landaverde Signed-off-by: Milan Landaverde Co-developed-by: Morgan Bartlett Signed-off-by: Morgan Bartlett Co-developed-by: Maciej Falkowski Signed-off-by: Maciej Falkowski Co-developed-by: Nándor István Krácser Signed-off-by: Nándor István Krácser Co-developed-by: David Gow Signed-off-by: David Gow Co-developed-by: John Baublitz Signed-off-by: John Baublitz Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Signed-off-by: Wedson Almeida Filho Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda commit 8326ac05ee8841e625a6a54d225242eec579fa13 Author: Miguel Ojeda Date: Mon Jul 25 23:46:47 2022 +0200 rust: add `bindings` crate This crate contains the bindings to the C side of the kernel. Calling C (in general, FFI) is assumed to be unsafe in Rust and, in many cases, this is accurate. For instance, virtually all C functions that take a pointer are unsafe since, typically, it will be dereferenced at some point (and in most cases there is no way for the callee to check its validity beforehand). Since one of the goals of using Rust in the kernel is precisely to avoid unsafe code in "leaf" kernel modules (e.g. drivers), these bindings should not be used directly by them. Instead, these bindings need to be wrapped into safe abstractions. These abstractions provide a safe API that kernel modules can use. In this way, unsafe code in kernel modules is minimized. Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Maciej Falkowski Signed-off-by: Maciej Falkowski Co-developed-by: Jiapeng Chong Signed-off-by: Jiapeng Chong Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Signed-off-by: Miguel Ojeda commit 1fbde52bde73e5a4c90577bce935e966a1ba1387 Author: Miguel Ojeda Date: Sat Jul 3 16:56:17 2021 +0200 rust: add `macros` crate This crate contains all the procedural macros ("proc macros") shared by all the kernel. Procedural macros allow to create syntax extensions. They run at compile-time and can consume as well as produce Rust syntax. For instance, the `module!` macro that is used by Rust modules is implemented here. It allows to easily declare the equivalent information to the `MODULE_*` macros in C modules, e.g.: module! { type: RustMinimal, name: b"rust_minimal", author: b"Rust for Linux Contributors", description: b"Rust minimal sample", license: b"GPL", } Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Finn Behrens Signed-off-by: Finn Behrens Co-developed-by: Adam Bratschi-Kaye Signed-off-by: Adam Bratschi-Kaye Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Sumera Priyadarsini Signed-off-by: Sumera Priyadarsini Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Matthew Bakhtiari Signed-off-by: Matthew Bakhtiari Co-developed-by: Björn Roy Baron Signed-off-by: Björn Roy Baron Signed-off-by: Miguel Ojeda commit db958dcf88e512c55595a30944467cb5bf3647fb Author: Miguel Ojeda Date: Sat Jul 3 16:54:11 2021 +0200 rust: add `compiler_builtins` crate Rust provides `compiler_builtins` as a port of LLVM's `compiler-rt`. Since we do not need the vast majority of them, we avoid the dependency by providing our own crate. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Gary Guo Signed-off-by: Gary Guo Signed-off-by: Miguel Ojeda commit 057b8d2571071da05d06810ca70f26c6316f6ea7 Author: Miguel Ojeda Date: Sat Jul 3 17:02:21 2021 +0200 rust: adapt `alloc` crate to the kernel This customizes the subset of the Rust standard library `alloc` that was just imported as-is, mainly by: - Adding SPDX license identifiers. - Skipping modules (e.g. `rc` and `sync`) via new `cfg`s. - Adding fallible (`try_*`) versions of existing infallible methods (i.e. returning a `Result` instead of panicking). Since the standard library requires stable/unstable attributes, these additions are annotated with: #[stable(feature = "kernel", since = "1.0.0")] Using "kernel" as the feature allows to have the additions clearly marked. The "1.0.0" version is just a placeholder. (At the moment, only one is needed, but in the future more fallible methods will be added). Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Matthew Bakhtiari Signed-off-by: Matthew Bakhtiari Signed-off-by: Miguel Ojeda commit 753dece88d70a23b015e01674a662e683235c08f Author: Miguel Ojeda Date: Fri May 6 17:52:44 2022 +0200 rust: import upstream `alloc` crate This is a subset of the Rust standard library `alloc` crate, version 1.62.0, licensed under "Apache-2.0 OR MIT", from: https://github.com/rust-lang/rust/tree/1.62.0/library/alloc/src The files are copied as-is, with no modifications whatsoever (not even adding the SPDX identifiers). For copyright details, please see: https://github.com/rust-lang/rust/blob/1.62.0/COPYRIGHT The next patch modifies these files as needed for use within the kernel. This patch split allows reviewers to double-check the import and to clearly see the differences introduced. Vendoring `alloc`, at least for the moment, allows us to have fallible allocations support (i.e. the `try_*` versions of methods which return a `Result` instead of panicking) early on. It also gives a bit more freedom to experiment with new interfaces and to iterate quickly. Eventually, the goal is to have everything the kernel needs in upstream `alloc` and drop it from the kernel tree. For a summary of work on `alloc` happening upstream, please see: https://github.com/Rust-for-Linux/linux/issues/408 The following script may be used to verify the contents: for path in $(cd rust/alloc/ && find . -type f -name '*.rs'); do curl --silent --show-error --location \ https://github.com/rust-lang/rust/raw/1.62.0/library/alloc/src/$path \ | diff --unified rust/alloc/$path - && echo $path: OK done Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda commit 12f577216a490b7afe809f53a11ecc734a3a9287 Author: Miguel Ojeda Date: Sat Jul 3 16:52:41 2021 +0200 rust: add C helpers Introduces the source file that will contain forwarders to C macros and inlined functions. Initially this only contains a single helper, but will gain more as more functionality is added to the `kernel` crate in the future. Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Geoffrey Thomas Signed-off-by: Geoffrey Thomas Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Co-developed-by: Maciej Falkowski Signed-off-by: Maciej Falkowski Co-developed-by: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Miguel Ojeda commit b8a94bfb33952bb17fbc65f8903d242a721c533d Author: Miguel Ojeda Date: Mon Apr 5 05:03:50 2021 +0200 kallsyms: increase maximum kernel symbol length to 512 Rust symbols can become quite long due to namespacing introduced by modules, types, traits, generics, etc. For instance, the following code: pub mod my_module { pub struct MyType; pub struct MyGenericType(T); pub trait MyTrait { fn my_method() -> u32; } impl MyTrait for MyGenericType { fn my_method() -> u32 { 42 } } } generates a symbol of length 96 when using the upcoming v0 mangling scheme: _RNvXNtCshGpAVYOtgW1_7example9my_moduleINtB2_13MyGenericTypeNtB2_6MyTypeENtB2_7MyTrait9my_method At the moment, Rust symbols may reach up to 300 in length. Setting 512 as the maximum seems like a reasonable choice to keep some headroom. Reviewed-by: Kees Cook Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Signed-off-by: Miguel Ojeda commit 73bbb94466fd3f8b313eeb0b0467314a262dddb3 Author: Miguel Ojeda Date: Mon Apr 5 04:58:39 2021 +0200 kallsyms: support "big" kernel symbols Rust symbols can become quite long due to namespacing introduced by modules, types, traits, generics, etc. Increasing to 255 is not enough in some cases, therefore introduce longer lengths to the symbol table. In order to avoid increasing all lengths to 2 bytes (since most of them are small, including many Rust ones), use ULEB128 to keep smaller symbols in 1 byte, with the rest in 2 bytes. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Gary Guo Signed-off-by: Gary Guo Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Co-developed-by: Matthew Wilcox Signed-off-by: Matthew Wilcox Signed-off-by: Miguel Ojeda commit 6e8c5bbd5e83e649251c198e743c8b9e7c48372b Author: Miguel Ojeda Date: Wed Jul 27 21:41:56 2022 +0200 kallsyms: add static relationship between `KSYM_NAME_LEN{,_BUFFER}` This adds a static assert to ensure `KSYM_NAME_LEN_BUFFER` gets updated when `KSYM_NAME_LEN` changes. The relationship used is one that keeps the new size (512+1) close to the original buffer size (500). Reviewed-by: Greg Kroah-Hartman Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Signed-off-by: Miguel Ojeda commit b471927ebf9bb54ba6e99f20848d70193e645eed Author: Boqun Feng Date: Wed Jul 27 20:54:19 2022 +0200 kallsyms: avoid hardcoding buffer size This introduces `KSYM_NAME_LEN_BUFFER` in place of the previously hardcoded size of the input buffer. It will also make it easier to update the size in a single place in a later patch. Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Signed-off-by: Boqun Feng Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda commit b66c874fdb6653aefb3019aeaa9b9f8c1aadd6a0 Author: Boqun Feng Date: Wed Jul 27 17:58:20 2022 +0200 kallsyms: use `ARRAY_SIZE` instead of hardcoded size This removes one place where the `500` constant is hardcoded. Reviewed-by: Kees Cook Reviewed-by: Geert Stappers Reviewed-by: Greg Kroah-Hartman Signed-off-by: Boqun Feng Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda commit a1cb097168fa23f5d3d1bdbea5f7f191bfbcc52f Author: Ping-Ke Shih Date: Tue Sep 27 14:26:11 2022 +0800 wifi: rtw89: 8852b: configure DLE mem Configure DLE (data link engine) memory size for operating modes. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-10-pkshih@realtek.com commit 5f8c35b9323abe2a0a3b13e65e4d5898e9e23a45 Author: Ping-Ke Shih Date: Tue Sep 27 14:26:10 2022 +0800 wifi: rtw89: check DLE FIFO size with reserved size For SCC mode, some FIFO are reserved, so compare the quantity after minus the reserved size. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-9-pkshih@realtek.com commit 75f1ed29e4314d21fbb3dc6e592637b86c212e86 Author: Ping-Ke Shih Date: Tue Sep 27 14:26:09 2022 +0800 wifi: rtw89: mac: correct register of report IMR The register of report IMR is chip specific, so add a field to strut to correct them. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-8-pkshih@realtek.com commit 3d7475897a952b3dca9db24056f0fbab0f6ced6a Author: Ping-Ke Shih Date: Tue Sep 27 14:26:08 2022 +0800 wifi: rtw89: pci: set power cut closed for 8852be Entering LPS with PCIe APHY power cut closed would cause PCIe link issue. To avoid the combinational issue, keep PCIe APHY power cut always on. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-7-pkshih@realtek.com commit 9e6e66ffba18e31c9860d5fda7524f7593f9f2c7 Author: Ping-Ke Shih Date: Tue Sep 27 14:26:07 2022 +0800 wifi: rtw89: pci: add to do PCI auto calibration 8852be needs this with n times calibration to correct hardware clock. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-6-pkshih@realtek.com commit 14b6e9f4b019ef5adfc0729e8166734490dd4709 Author: Ping-Ke Shih Date: Tue Sep 27 14:26:06 2022 +0800 wifi: rtw89: 8852b: implement chip_ops::{enable,disable}_bb_rf Implement to power on/off BB and RF via MAC registers. Add return type of chip_ops::disable_bb_rf, because it could fail to disable. Also, correct naming of register 0x0200 used by the ops as well. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-5-pkshih@realtek.com commit 61bdf7aacdc3bc98bf73c483e8c2dd88ed212dde Author: Ping-Ke Shih Date: Tue Sep 27 14:26:05 2022 +0800 wifi: rtw89: add DMA busy checking bits to chip info 8852B has less DMA channels, so its checking bits are different from other chips. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-4-pkshih@realtek.com commit a1b7163aab4cb5a40d866e40183c52094fad26f9 Author: Ping-Ke Shih Date: Tue Sep 27 14:26:04 2022 +0800 wifi: rtw89: mac: define DMA channel mask to avoid unsupported channels Six channels are unsupported by 8852b, so mask them out to prevent to access undefined registers in this chip. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-3-pkshih@realtek.com commit 1bebcf08a3053e92a9e0eb397163faf98dcc8beb Author: Ping-Ke Shih Date: Tue Sep 27 14:26:03 2022 +0800 wifi: rtw89: pci: mask out unsupported TX channels 8852BE doesn't support some TX channels, so mask them out, or it access undefined registers. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220927062611.30484-2-pkshih@realtek.com commit 56df3d408a8fa079bf4122895d6e004659795d4f Author: Gustavo A. R. Silva Date: Mon Sep 26 18:03:41 2022 -0500 iwlegacy: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/223 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YzIvzc0jsYLigO8a@work commit 413cda95648d705a7cc6c33d2e81bdccf6ea9a59 Author: Gustavo A. R. Silva Date: Mon Sep 26 16:49:04 2022 -0500 ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/220 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YzIeULWc17XSIglv@work commit 72c08d9f4c72787dde541ae5ed278e46771c9f2a Author: Kees Cook Date: Fri Sep 23 15:08:53 2022 -0700 wifi: iwlwifi: Track scan_cmd allocation size explicitly In preparation for reducing the use of ksize(), explicitly track the size of scan_cmd allocations. This also allows for noticing if the scan size changes unexpectedly. Note that using ksize() was already incorrect here, in the sense that ksize() would not match the actual allocation size, which would trigger future run-time allocation bounds checking. (In other words, memset() may know how large scan_cmd was allocated for, but ksize() will return the upper bounds of the actually allocated memory, causing a run-time warning about an overflow.) Cc: Gregory Greenman Cc: Kalle Valo Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Luca Coelho Cc: Johannes Berg Cc: Emmanuel Grumbach Cc: Miri Korenblit Cc: Ilan Peer Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220923220853.3302056-1-keescook@chromium.org commit e8573000f4bbb7bfe48da5de5981e5dca048c433 Merge: 907cc346ff6a6 3e43b760c9e14 Author: Dave Airlie Date: Wed Sep 28 14:56:09 2022 +1000 Merge tag 'amd-drm-next-6.1-2022-09-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.1-2022-09-23: amdgpu: - SDMA fix - Add new firmware types to debugfs/IOCTL version queries - Misc spelling and grammar fixes - Misc code cleanups - DCN 3.2.x fixes - DCN 3.1.x fixes - CS cleanup - Gang submit support - Clang fixes - Non-DC audio fix - GPUVM locking fixes - Vega10 PWN fan speed fix amdkgd: - MQD manager cleanup - Misc spelling and grammar fixes UAPI: - Add new firmware types to the FW version query IOCTL Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220923215729.6061-1-alexander.deucher@amd.com commit 907cc346ff6a69a08b4786c4ed2a78ac0120b9da Merge: 95d8c67187bcf 39dd0cc2e5bd0 Author: Dave Airlie Date: Wed Sep 28 13:50:28 2022 +1000 Merge tag 'drm-misc-next-2022-09-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 6.1: UAPI Changes: Cross-subsystem Changes: - dma-buf: Improve signaling when debugging Core Changes: - Backlight handling improvements - format-helper: Add drm_fb_build_fourcc_list() - fourcc: Kunit tests improvements - modes: Add DRM_MODE_INIT() macro - plane: Remove drm_plane_init(), Allocate planes with drm_universal_plane_alloc() - plane-helper: Add drm_plane_helper_atomic_check() - probe-helper: Add drm_connector_helper_get_modes_fixed() and drm_crtc_helper_mode_valid_fixed() - tests: Conversion to parametrized tests, test name consistency Driver Changes: - amdgpu: Fix for a VRAM eviction issue - ast: Resolution handling improvements - mediatek: small code improvements for DP - omap: Refcounting fix, small improvements - rockchip: RK3568 support, Gamma support for RK3399 - sun4i: Build failure fix when !OF - udl: Multiple fixes here and there - vc4: HDMI hotplug handling improvements - vkms: Warning fix Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220923073943.d43tne5hni3iknlv@houat commit 6632a6adae86265ca79cefc0e48e4a672a1108df Author: Andrew Halaney Date: Wed Sep 21 10:31:56 2022 -0500 dt-bindings: clocks: qcom,gcc-sc8280xp: Fix typos pipegmux and SuperSpeed are the proper spelling for those terms. Signed-off-by: Andrew Halaney Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921153155.279182-1-ahalaney@redhat.com commit 184fdd873d83bfcfdd25310ae3f2d7eb8dc5224a Author: Konrad Dybcio Date: Wed Sep 21 02:13:03 2022 +0200 clk: qcom: Add global clock controller driver for SM6375 Add support for the global clock controller found on SM6375. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921001303.56151-3-konrad.dybcio@somainline.org commit 43398afc0b561925a9ce57555afe3af2ddef8d35 Author: Konrad Dybcio Date: Wed Sep 21 02:13:02 2022 +0200 dt-bindings: clock: add SM6375 QCOM global clock bindings Add device tree bindings for global clock controller for SM6375 SoCs. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921001303.56151-2-konrad.dybcio@somainline.org commit dc99bbfe48e4f3b4827dc5b04a8642c23a12917e Author: Konrad Dybcio Date: Wed Sep 21 02:13:01 2022 +0200 clk: qcom: alpha: Add support for programming the PLL_FSM_LEGACY_MODE bit This is used on at least SM6375 and its variations. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921001303.56151-1-konrad.dybcio@somainline.org commit e0d468427882556b8815e09769bbbc3281478b1e Author: Joel Stanley Date: Thu Aug 18 16:56:24 2022 +1000 ARM: config: aspeed_g5: Enable PECI Intel systems use PECI, so provide build coverage for the driver stack. Signed-off-by: Joel Stanley commit 8a908a1c5dd1c97ffbe027d5304506b1ed3be37b Author: Joel Stanley Date: Thu Aug 18 16:53:53 2022 +1000 ARM: configs: aspeed_g4: Remove appended DTB and ATAG These machines boot using FIT and have done so since support was merged, so neither option is used. Signed-off-by: Joel Stanley commit 0cdc6ea53a21d5be698089baad7ad12c502e09d0 Author: Joel Stanley Date: Thu Aug 18 16:52:14 2022 +1000 ARM: configs: aspeed: Refresh defconfigs Remove the unused CONFIG_BLK_DEV_BSG option. Signed-off-by: Joel Stanley commit 1a9a571e5ee233f359fd4036ca1ca909c2007214 Author: Joel Stanley Date: Thu Aug 18 16:51:27 2022 +1000 ARM: config: aspeed: Enable namespaces Used by OpenBMC due to systemd. Signed-off-by: Joel Stanley commit 34f3b56d00cb76cc313380ab0949afbae673a0f3 Author: Joel Stanley Date: Thu Aug 18 16:49:25 2022 +1000 ARM: configs: aspeed_g4: Enable IPV6 options Match the aspeed_g5 defconfig and what is used in OpenBMC. Signed-off-by: Joel Stanley commit 92a207c9078184b74e2adab5eb8bd8aeb81de4c2 Author: Joel Stanley Date: Thu Aug 18 16:48:27 2022 +1000 ARM: configs: aspeed_g4: Enable OCC and NBD drivers These are used by OpenBMC machines such as palmetto. Signed-off-by: Joel Stanley commit 54789080a59ec45b9c265977c01df91b24ee20e6 Author: Joel Stanley Date: Fri Mar 18 11:27:36 2022 +1030 ARM: configs: aspeed_g5: Enable MCTP stack Enable the MCTP core along with the serial and i2c drivers. Signed-off-by: Joel Stanley commit 4cb069db3f511c17f6871951674a63f969b18535 Author: Joel Stanley Date: Mon Jan 31 16:40:11 2022 +1030 ARM: configs: aspeed_g5: Add PL2303 USB serial driver Used by P10 machines. Signed-off-by: Joel Stanley commit bb51f68c57cf47f74b335abd9f25bd8829744a3e Author: Joel Stanley Date: Tue Jan 11 17:15:35 2022 +1030 ARM: configs: aspeed_g5: Add TPM TIS I2C driver It is used by the rainier and other p10bmc machines. Signed-off-by: Joel Stanley commit 617baaacc5279e9b1350dbd33f9379d851e09dab Author: Joel Stanley Date: Thu Jan 13 16:02:47 2022 +1030 ARM: configs: aspeed_g5: Add mp5023 driver Signed-off-by: Joel Stanley commit 27c49cafd08060027ac8236cc720fb6507e077dd Author: Adriana Kobylak Date: Fri Nov 12 20:29:31 2021 +0000 ARM: configs: aspeed: Add support for USB flash drives Add support to detect USB flash drives and create the /dev/sd* devices. Also add support for vfat to support USB drives formatted as FAT32. This support will be used to enable firmware updates via USB flash drives where the firmware image is stored in the USB drive and it's plugged into the BMC USB port. Signed-off-by: Adriana Kobylak Tested-by: Adriana Kobylak Link: https://lore.kernel.org/r/20211112202931.2379145-1-anoo@linux.ibm.com Signed-off-by: Joel Stanley commit 73b4476562de2a26debc076801ca28148076c79f Author: Joel Stanley Date: Tue Sep 27 17:37:11 2022 +0930 ARM: dts: aspeed: ast2600-evb-a1: Add compatible The AST2600 EVB A1 is an AST2600 EVB. Signed-off-by: Joel Stanley commit d916109169159f9319f45ce7e1339e41eccf22c4 Author: Joel Stanley Date: Tue Sep 27 17:36:39 2022 +0930 ARM: dts: aspeed: ast2600evb: Fix compatible string The AST2600 EVB is not an A1. Signed-off-by: Joel Stanley commit da41645f11bb58eae3dda87dc459495a094f1935 Author: Cédric Le Goater Date: Fri Jun 3 09:37:05 2022 +0200 ARM: dts: aspeed: ast2600-evb: Enable Quad SPI RX tranfers Now that the pinctrl definitions of the ast2600 SoC have been fixed, see commit 925fbe1f7eb6 ("dt-bindings: pinctrl: aspeed-g6: add FWQSPI function/group"), it is safe to activate QSPI on the ast2600 evb. Cc: Chin-Ting Kuo Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220603073705.1624351-1-clg@kaod.org Signed-off-by: Joel Stanley commit e360b84c3366d02784972086bed8cf60bce64f3b Author: Ken Chen Date: Fri Aug 5 17:09:57 2022 +0800 ARM: dts: aspeed-g6: Enable more UART controllers Setup the configuration of UART6, UART7, UART8, and UART9 in aspeed-g6.dtsi. Signed-off-by: Ken Chen Link: https://lore.kernel.org/r/20220805090957.470434-1-j220584470k@gmail.com Signed-off-by: Joel Stanley commit 3d50a89cb28b5e1c76c1ec3e155f2327ad1ede91 Author: Karthikeyan Pasupathi Date: Wed Sep 14 17:23:07 2022 +0530 ARM: dts: aspeed: yosemitev2: Disable the EEPROM driver Removed NIC EEPROM driver IPMB-12 channel and enabled it as generic i2c EEPROM. Signed-off-by: Karthikeyan Pasupathi Link: https://lore.kernel.org/r/20220914115307.GA339@hcl-ThinkPad-T495 Signed-off-by: Joel Stanley commit 3293fca4a689dae1090b997145a46c816ff03a4a Author: Konstantin Aladyshev Date: Thu Sep 22 00:09:47 2022 +0300 ARM: dts: aspeed: Add AMD DaytonaX BMC Add initial version of device tree for the BMC in the AMD DaytonaX platform. AMD DaytonaX platform is a customer reference board (CRB) with an Aspeed ast2500 BMC manufactured by AMD. Signed-off-by: Konstantin Aladyshev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921210950.10568-3-aladyshev22@gmail.com Signed-off-by: Joel Stanley commit 4fb9c1489bb6b7e4d0b104495e11ed8e16d1e9a9 Author: Konstantin Aladyshev Date: Thu Sep 22 00:09:46 2022 +0300 dt-bindings: arm: aspeed: document AMD DaytonaX Document AMD DaytonaX board compatible. Signed-off-by: Konstantin Aladyshev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921210950.10568-2-aladyshev22@gmail.com Signed-off-by: Joel Stanley commit d61e4defc907ac070876d1e904b603393e7cb195 Author: Karthikeyan Pasupathi Date: Mon Sep 26 18:13:13 2022 +0530 ARM: dts: aspeed: Yosemite V2: Enable OCP debug card Added IPMB-13 channel for Debug Card communication which improves the readability of the machine and makes it easier to debug the server and it will display some pieces of information about the server like "system info", "Critical sensors" and "critical sel". Signed-off-by: Karthikeyan Pasupathi Reviewed-by: Patrick Williams Link: https://lore.kernel.org/r/20220926124313.GA8400@hcl-ThinkPad-T495 Signed-off-by: Joel Stanley commit 2e72cc0b52fab07c967ba4435409a4135c0008b8 Author: Quan Nguyen Date: Thu Sep 15 15:08:28 2022 +0700 ARM: dts: aspeed: mtjade: Remove gpio-keys entries Remove the gpio-keys entries from the Ampere's Mt. Jade BMC device tree. The user space applications are going to change from using libevdev to libgpiod. Signed-off-by: Quan Nguyen Link: https://lore.kernel.org/r/20220915080828.2894070-1-quan@os.amperecomputing.com Signed-off-by: Joel Stanley commit 36d96827f480e90037d162098061333e279ea35f Author: Quan Nguyen Date: Wed Aug 17 14:15:39 2022 +0700 ARM: dts: aspeed: Add device tree for Ampere's Mt. Mitchell BMC The Mt. Mitchell BMC is an ASPEED AST2600-based BMC for the Mt. Mitchell hardware reference platform with AmpereOne(TM) processor. Signed-off-by: Quan Nguyen Signed-off-by: Phong Vo Signed-off-by: Thang Q. Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220817071539.176110-3-quan@os.amperecomputing.com Signed-off-by: Joel Stanley commit 93eaac48ea90d33733f10f8fd3813df1e8cb8791 Author: Quan Nguyen Date: Wed Aug 17 14:15:38 2022 +0700 dt-bindings: arm: aspeed: document Ampere Mt.Mitchell BMC compatibles Document Ampere Mt.Mitchell BMC board compatible. Signed-off-by: Quan Nguyen Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817071539.176110-2-quan@os.amperecomputing.com Signed-off-by: Joel Stanley commit e3ae3e899aa0322ff685fd7cf1322c6670da7db7 Author: Rajendra Nayak Date: Tue Sep 20 16:45:17 2022 +0530 clk: qcom: gcc-sc7280: Update the .pwrsts for usb gdscs The USB controllers on sc7280 do not retain the state when the system goes into low power state and the GDSCs are turned off. This results in the controllers reinitializing and re-enumerating all the connected devices (resulting in additional delay while coming out of suspend) Fix this by updating the .pwrsts for the USB GDSCs so they only transition to retention state in low power. Since sc7280 only supports cx (parent of usb gdscs) Retention, there are no cxcs offsets mentioned in order to support the Retention state. Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920111517.10407-3-quic_rjendra@quicinc.com commit d9fe9f3fefe74d15e280fce628bff1b6fc6d9675 Author: Rajendra Nayak Date: Tue Sep 20 16:45:16 2022 +0530 clk: qcom: gcc-sc7180: Update the .pwrsts for usb gdsc The USB controller on sc7180 does not retain the state when the system goes into low power state and the GDSC is turned off. This results in the controller reinitializing and re-enumerating all the connected devices (resulting in additional delay while coming out of suspend) Fix this by updating the .pwrsts for the USB GDSC so it only transitions to retention state in low power. Since sc7180 only supports cx (parent of usb gdsc) Retention, there are no cxcs offsets mentioned in order to support the Retention state. Signed-off-by: Rajendra Nayak Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920111517.10407-2-quic_rjendra@quicinc.com commit d399723950c45cd9507aef848771826afc3f69b0 Author: Rajendra Nayak Date: Tue Sep 20 16:45:15 2022 +0530 clk: qcom: gdsc: Fix the handling of PWRSTS_RET support GDSCs cannot be transitioned into a Retention state in SW. When either the RETAIN_MEM bit, or both the RETAIN_MEM and RETAIN_PERIPH bits are set, and the GDSC is left ON, the HW takes care of retaining the memory/logic for the domain when the parent domain transitions to power collapse/power off state. On some platforms where the parent domains lowest power state itself is Retention, just leaving the GDSC in ON (without any RETAIN_MEM/RETAIN_PERIPH bits being set) will also transition it to Retention. The existing logic handling the PWRSTS_RET seems to set the RETAIN_MEM/RETAIN_PERIPH bits if the cxcs offsets are specified but then explicitly turns the GDSC OFF as part of _gdsc_disable(). Fix that by leaving the GDSC in ON state. Signed-off-by: Rajendra Nayak Cc: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920111517.10407-1-quic_rjendra@quicinc.com commit d89318bbdf2b8f472d7f1225bbe44ead7b57c5e4 Author: Kees Cook Date: Mon Sep 26 17:40:33 2022 -0700 mlxsw: core_acl_flex_actions: Split memcpy() of struct flow_action_cookie flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org Cc: Ido Schimmel Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Petr Machata Link: https://lore.kernel.org/r/20220927004033.1942992-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit e1d077003556fa603c5e5e01248e8e99a2102849 Merge: 8f1e1658d3654 181ca020261aa Author: Jakub Kicinski Date: Tue Sep 27 18:42:55 2022 -0700 Merge branch 'net-ipa-generalized-register-definitions' Alex Elder says: ==================== net: ipa: generalized register definitions This series is quite a bit bigger than what I normally like to send, and I apologize for that. I would like it to get incorporated in its entirety this week if possible, and splitting up the series carries a small risk that wouldn't happen. Each IPA register has a defined offset, and in most cases, a set of masks that define the width and position of fields within the register. Most registers currently use the same offset for all versions of IPA. Usually fields within registers are also the same across many versions. Offsets and fields like this are defined using preprocessor constants. When a register has a different offset for different versions of IPA, an inline function is used to determine its offset. And in places where a field differs between versions, an inline function is used to determine how a value is encoded within the field, depending on IPA version. Starting with IPA version 5.0, the number of IPA endpoints supported is greater than 32. As a consequence, *many* IPA register offsets differ considerably from prior versions. This increase in endpoints also requires a lot of field sizes and/or positions to change (such as those that contain an endpoint ID). Defining these things with constants is no longer simple, and rather than fill the code with one-off functions to define offsets and encode field values, this series puts in place a new way of defining IPA registers and their fields. Note that this series creates this new scheme, but does not add IPA v5.0+ support. An enumerated type will now define a unique ID for each IPA register. Each defined register will have a structure that contains its offset and its name (a printable string). Each version of IPA will have an array of these register structures, indexed by register ID. Some "parameterized" registers are duplicated (this is not new). For example, each endpoint has an INIT_HDR register, and the offset of a given endpoint's INIT_HDR register is dependent on the endpoint number (the parameter). In such cases, the register's "stride" is defined as the distance between two of these registers. If a register contains fields, each field will have a unique ID that's used as an index into an array of field masks defined for the register. The register structure also defines the number of entries in this field array. When a register is to be used in code, its register structure will be fetched using function ipa_reg(). Other functions are then used to determine the register's offset, or to encode a value into one of the register's fields, and so on. Each version of IPA defines the set of registers that are available, including all fields for these registers. The array of defined registers is set up at probe time based on the IPA version, and it is associated with the main IPA structure. ==================== Link: https://lore.kernel.org/r/20220926220931.3261749-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 181ca020261aa76c47ebb5a7c46b1c78461df407 Author: Alex Elder Date: Mon Sep 26 17:09:31 2022 -0500 net: ipa: define remaining IPA register fields Define the fields for the ENDP_INIT_DEAGGR, ENDP_INIT_RSRC_GRP, ENDP_INIT_SEQ, ENDP_STATUS, and ENDP_FILTER_ROUTER_HSH_CFG, and IPA_IRQ_UC IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_FIELDS() and IPA_REG_STRIDE_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_encode() and ipa_reg_bit() to build up the values to be written to these registers, remove an inline function and all the *_FMASK symbols that are now no longer used. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 216b409d0914f68c9a51760658cf687f3a5f84ba Author: Alex Elder Date: Mon Sep 26 17:09:30 2022 -0500 net: ipa: define more IPA endpoint register fields Define the fields for the ENDP_INIT_MODE, ENDP_INIT_AGGR, ENDP_INIT_HOL_BLOCK_EN, and ENDP_INIT_HOL_BLOCK_TIMER IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_STRIDE_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Change aggr_time_limit_encode() and hol_block_timer_encode() so they take an ipa_reg pointer, and use those register's fields to compute their encoded results. Have aggr_time_limit_encode() take an IPA pointer rather than version, to match hol_block_timer_encode(). Use ipa_reg_encode(), ipa_reg_bit(), and ipa_reg_field_max() to manipulate values to be written to these registers, remove the definitions of the various inline functions and *_FMASK symbols that are now no longer used. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 4468a3448b6aa1c00f25ce1162c57d4a7c2e7ba2 Author: Alex Elder Date: Mon Sep 26 17:09:29 2022 -0500 net: ipa: define some IPA endpoint register fields Define the fields for the ENDP_INIT_CTRL, ENDP_INIT_CFG, ENDP_INIT_NAT, ENDP_INIT_HDR, and ENDP_INIT_HDR_EXT IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_STRIDE_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Move ipa_header_size_encoded() and ipa_metadata_offset_encoded() out of "ipa_reg.h" and into "ipa_endpoint.c". Change them so they take an additional ipa_reg structure argument, and use ipa_reg_encode() to encode the parts of the header size and offset prior to writing to the register. Change their names to be verbs rather than nouns. Use ipa_reg_encode(), ipa_reg_bit, and ipa_reg_field_max() to manipulate values to be written to these registers, remove the definition of the no-longer-used *_FMASK symbols. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 1c418c4a929cae00780429fbceda7e163b5e0f71 Author: Alex Elder Date: Mon Sep 26 17:09:28 2022 -0500 net: ipa: define resource group/type IPA register fields Define the fields for the {SRC,DST}_RSRC_GRP_{01,23,45,67}_RSRC_TYPE IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_STRIDE_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_encode() to build up the values to be written to these registers. Remove the definition of the no-longer-used *_FMASK symbols. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 9265a4f0f0b4bdcebeb3ca4688e8213bdadaa759 Author: Alex Elder Date: Mon Sep 26 17:09:27 2022 -0500 net: ipa: define even more IPA register fields Define the fields for the FLAVOR_0, IDLE_INDICATION_CFG, QTIME_TIMESTAMP_CFG, TIMERS_XO_CLK_DIV_CFG and TIMERS_PULSE_GRAN_CFG IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_bit() and ipa_reg_encode() to build up the values to be written to these registers. Use ipa_reg_decode() to extract field values from the FLAVOR_0 register. Remove the definition of the no-longer-used *_FMASK symbols. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit b5c35fa470ecbfeeb7a8caf1ff4d739a6bafcd4a Author: Alex Elder Date: Mon Sep 26 17:09:26 2022 -0500 net: ipa: define more IPA register fields Define the fields for the LOCAL_PKT_PROC_CNTXT, COUNTER_CFG, and IPA_TX_CFG IPA registers for all supported IPA versions. Create enumerated types to identify fields for these IPA registers. Use IPA_REG_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_bit() and ipa_reg_encode() to build up the values to be written to these registers. Remove the definition of the *_FMASK symbols as well as proc_cntxt_base_addr_encoded(), because they are no longer needed. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 62b9c009a8621ec5bef656b641a910055f0d0f20 Author: Alex Elder Date: Mon Sep 26 17:09:25 2022 -0500 net: ipa: define some more IPA register fields Define the fields for the SHARED_MEM_SIZE, QSB_MAX_WRITES, QSB_MAX_READS, FILT_ROUT_HASH_EN, and FILT_ROUT_HASH_FLUSH IPA registers for all supported IPA versions. Create enumerated types to identify fields for these registers. Use IPA_REG_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_bit() and ipa_reg_encode() to build up the values to be written to these registers rather than using the *_FMASK preprocessor symbols. Remove the definition of the now unused *_FMASK symbols. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 479deb329884f2030dfcc22dd18696135090d2d4 Author: Alex Elder Date: Mon Sep 26 17:09:24 2022 -0500 net: ipa: define CLKON_CFG and ROUTE IPA register fields Create the ipa_reg_clkon_cfg_field_id enumerated type, which identifies the fields for the CLKON_CFG IPA register. Add "CLKON_" to a few short names to try to avoid name conflicts. Create the ipa_reg_route_field_id enumerated type, which identifies the fields for the ROUTE IPA register. Use IPA_REG_FIELDS() to specify the field mask values defined for these registers, for each supported version of IPA. Use ipa_reg_bit() and ipa_reg_encode() to build up the values to be written to these registers rather than using the *_FMASK preprocessor symbols. Remove the definition of the now unused *_FMASK symbols. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 12c7ea7dfd2c69f1db5bc19a330a5d2a7bfe44e8 Author: Alex Elder Date: Mon Sep 26 17:09:23 2022 -0500 net: ipa: define COMP_CFG IPA register fields Create the ipa_reg_comp_cfg_field_id enumerated type, which identifies the fields for the COMP_CFG IPA register. Use IPA_REG_FIELDS() to specify the field mask values defined for this register, for each supported version of IPA. Use ipa_reg_bit() to build up the value to be written to this register rather than using the *_FMASK preprocessor symbols. Remove the definition of the *_FMASK symbols, along with the inline functions that were used to encode certain fields whose position and/or width within the register was dependent on IPA version. Take this opportunity to represent all one-bit fields using BIT(x) rather than GENMASK(x, x). Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit a5ad8956f97ae1b97a3dd4923c8972573f2fc028 Author: Alex Elder Date: Mon Sep 26 17:09:22 2022 -0500 net: ipa: introduce ipa_reg field masks Add register field descriptors to the ipa_reg structure. A field in a register is defined by a field mask, which is a 32-bit mask having a single contiguous range of bits set. For each register that has at least one field defined, an enumerated type will identify the register's fields. The ipa_reg structure for that register will include an array fmask[] of field masks, indexed by that enumerated type. Each field mask defines the position and bit width of a field. An additional "fcount" records how many fields (masks) are defined for a given register. Introduce two macros to be used to define registers that have at least one field. Introduce a few new functions related to field masks. The first simply returns a field mask, given an IPA register pointer and field mask ID. A variant of that is meant to be used for the special case of single-bit field masks. Next, ipa_reg_encode(), identifies a field with an IPA register pointer and a field ID, and takes a value to represent in that field. The result encodes the value in the appropriate place to be stored in the register. This is roughly modeled after the bitmask operations (like u32_encode_bits()). Another function (ipa_reg_decode()) similarly identifies a register field, but the value supplied to it represents a full register value. The value encoded in the field is extracted from the value and returned. This is also roughly modeled after bitmask operations (such as u32_get_bits()). Finally, ipa_reg_field_max() returns the maximum value representable by a field. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 6a244b75cfab95ddd505fc9a80af76bf36071784 Author: Alex Elder Date: Mon Sep 26 17:09:21 2022 -0500 net: ipa: introduce ipa_reg() Create a new function that returns a register descriptor given its ID. Change ipa_reg_offset() and ipa_reg_n_offset() so they take a register descriptor argument rather than an IPA pointer and register ID. Have them accept null pointers (and return an invalid 0 offset), to avoid the need for excessive error checking. (A warning is issued whenever ipa_reg() returns 0). Call ipa_reg() or ipa_reg_n() to look up information about the register before calls to ipa_reg_offset() and ipa_reg_n_offset(). Delay looking up offsets until they're needed to read or write registers. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 82a06807453a6c0c282b3238f28164970100ffcd Author: Alex Elder Date: Mon Sep 26 17:09:20 2022 -0500 net: ipa: use ipa_reg[] array for register offsets Use the array of register descriptors assigned at initialization time to determine the offset (and where used, stride) for IPA registers. Issue a warning if an offset is requested for a register that's not valid for the current system. Remove all IPE_REG_*_OFFSET macros, as well as inline static functions that returned register offsets. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 07f120bcf76b6f0969a1bc18ce5b7a16555fadad Author: Alex Elder Date: Mon Sep 26 17:09:19 2022 -0500 net: ipa: add per-version IPA register definition files Create a new subdirectory "reg", which contains a register definition file for each supported version of IPA. Each register definition contains the register's offset, and for parameterized registers, the stride (distance between consecutive instances of the register). Finally, it includes an all-caps printable register name. In these files, each IPA version defines an array of IPA register definition pointers, with unsupported registers defined with a null pointer. The array is indexed by the ipa_reg_id enumerated type. At initialization time, the appropriate register definition array to use is selected based on the IPA version, and assigned to a new "regs" field in the IPA structure. Extend ipa_reg_valid() so it fails if a valid register is not defined. This patch simply puts this infrastructure in place; the next will use it. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 6bfb753850d3bad78fc2eb6f4e0fa5675055ad97 Author: Alex Elder Date: Mon Sep 26 17:09:18 2022 -0500 net: ipa: use IPA register IDs to determine offsets Expose two inline functions that return the offset for a register whose ID is provided; one of them takes an additional argument that's used for registers that are parameterized. These both use a common helper function __ipa_reg_offset(), which just uses the offset symbols already defined. Replace all references to the offset macros defined for IPA registers with calls to ipa_reg_offset() or ipa_reg_n_offset(). Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 98e2dd71a826c7d2a6de7a9444b5e3c7824082fe Author: Alex Elder Date: Mon Sep 26 17:09:17 2022 -0500 net: ipa: introduce IPA register IDs Create a new ipa_reg_id enumerated type, which identifies each IPA register with a symbolic identifier. Use short names, but in some cases (such as "BCR") add "IPA_" to the name to help avoid name conflicts. Create two functions that indicate register validity. The first concisely indicates whether a register is valid for a given version of IPA, and if so, whether it is defined. The second indicates whether a register is valid for TX or RX endpoints. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 95d8c67187bcfaa519bafcdef9091cd906505454 Merge: d601cc93036af e8b595f7b058c Author: Dave Airlie Date: Wed Sep 28 11:35:25 2022 +1000 Merge tag 'drm-msm-next-2022-09-22' of https://gitlab.freedesktop.org/drm/msm into drm-next msm-next for v6.1 DPU: - simplified VBIF configuration - cleaned up CTL interfaces to accept indices rather than flush masks DSI: - removed unused msm_display_dsc_config struct - switch regulator calls to new bulk API - switched to use PANEL_BRIDGE for directly attached panels DSI PHY: - converted drivers to use parent_hws instead of parent_names DP: - cleaned up pixel_rate handling HDMI PHY: - turned hdmi-phy-8996 into OF clk provider core: - misc dt-bindings fixes - choose eDP as primary display if it's available - support getting interconnects from either the mdss or the mdp5/dpu device nodes gpu+gem: - Shrinker + LRU re-work: - adds a shared GEM LRU+shrinker helper and moves msm over to that - reduces lock contention between retire and submit by avoiding the need to acquire obj lock in retire path (and instead using resv seeing obj's busyness in the shrinker - fix reclaim vs submit issues - GEM fault injection for triggering userspace error paths - Map/unmap optimization - Improved robustness for a6xx GPU recovery Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGsrfrr9v1oR9S4oYfOs9jm=jbKQiwPBTrCRHrjYerJJFA@mail.gmail.com commit 8f1e1658d365401159f407d78c240262673d1314 Author: Kees Cook Date: Mon Sep 26 17:39:53 2022 -0700 s390/qeth: Split memcpy() of struct qeth_ipacmd_addr_change flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/ Cc: Wenjia Zhang Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Alexandra Winter Link: https://lore.kernel.org/r/20220927003953.1942442-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 0d92efdee9152e400aa973229861c3cb84069a98 Author: Donald Hunter Date: Mon Sep 26 13:03:50 2022 +0100 Add skb drop reasons to IPv6 UDP receive path Enumerate the skb drop reasons in the receive path for IPv6 UDP packets. Signed-off-by: Donald Hunter Link: https://lore.kernel.org/r/20220926120350.14928-1-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit 677065244aa17265d7933782b1720cdf8727fcae Author: Pavel Rojtberg Date: Tue Sep 27 18:02:05 2022 -0700 Input: xpad - decipher xpadone packages with GIP defines only renames, no functional changes. Some of the packets we send seem superfluous now. Unfortunately I dont have the hardware to verify whether they are. Signed-off-by: Pavel Rojtberg Link: https://lore.kernel.org/r/20220913213133.584979-3-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit 90c9978959dacdecfc30d2e6ad5cefc4823399b8 Author: Pavel Rojtberg Date: Tue Sep 27 18:01:16 2022 -0700 Input: xpad - refactor using BIT() macro reduces the amount of magic numbers and makes the code more readable Signed-off-by: Pavel Rojtberg Link: https://lore.kernel.org/r/20220913213133.584979-2-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit ab7ea1e73532247217d3e450015dd7ece966dc0e Author: Bo Liu Date: Sun Sep 25 21:27:44 2022 -0400 ptp: Remove usage of the deprecated ida_simple_xxx API Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu Link: https://lore.kernel.org/r/20220926012744.3363-1-liubo03@inspur.com Signed-off-by: Jakub Kicinski commit 62e56ef57c04c0cacb33433d7984a4d71b690b3f Author: Taehee Yoo Date: Sun Sep 25 15:00:33 2022 +0000 net: tls: Add ARIA-GCM algorithm RFC 6209 describes ARIA for TLS 1.2. ARIA-128-GCM and ARIA-256-GCM are defined in RFC 6209. This patch would offer performance increment and an opportunity for hardware offload. Benchmark results: iperf-ssl are used. CPU: intel i3-12100. TLS(openssl-3.0-dev) [ 3] 0.0- 1.0 sec 185 MBytes 1.55 Gbits/sec [ 3] 1.0- 2.0 sec 186 MBytes 1.56 Gbits/sec [ 3] 2.0- 3.0 sec 186 MBytes 1.56 Gbits/sec [ 3] 3.0- 4.0 sec 186 MBytes 1.56 Gbits/sec [ 3] 4.0- 5.0 sec 186 MBytes 1.56 Gbits/sec [ 3] 0.0- 5.0 sec 927 MBytes 1.56 Gbits/sec kTLS(aria-generic) [ 3] 0.0- 1.0 sec 198 MBytes 1.66 Gbits/sec [ 3] 1.0- 2.0 sec 194 MBytes 1.62 Gbits/sec [ 3] 2.0- 3.0 sec 194 MBytes 1.63 Gbits/sec [ 3] 3.0- 4.0 sec 194 MBytes 1.63 Gbits/sec [ 3] 4.0- 5.0 sec 194 MBytes 1.62 Gbits/sec [ 3] 0.0- 5.0 sec 974 MBytes 1.63 Gbits/sec kTLS(aria-avx wirh GFNI) [ 3] 0.0- 1.0 sec 632 MBytes 5.30 Gbits/sec [ 3] 1.0- 2.0 sec 657 MBytes 5.51 Gbits/sec [ 3] 2.0- 3.0 sec 657 MBytes 5.51 Gbits/sec [ 3] 3.0- 4.0 sec 656 MBytes 5.50 Gbits/sec [ 3] 4.0- 5.0 sec 656 MBytes 5.50 Gbits/sec [ 3] 0.0- 5.0 sec 3.18 GBytes 5.47 Gbits/sec Signed-off-by: Taehee Yoo Reviewed-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20220925150033.24615-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski commit c64655f32fef795b12170d710c474422ee29b134 Author: Bhupesh Sharma Date: Sat Sep 24 16:15:14 2022 +0530 net: stmmac: Minor spell fix related to 'stmmac_clk_csr_set()' Minor spell fix related to 'stmmac_clk_csr_set()' inside a comment used in the 'stmmac_probe_config_dt()' function. Cc: Biao Huang Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220924104514.1666947-1-bhupesh.sharma@linaro.org Signed-off-by: Jakub Kicinski commit ec0bbc5ec5664dcee344f79373852117dc672c86 Author: Steven Rostedt (Google) Date: Tue Sep 27 19:15:25 2022 -0400 ring-buffer: Check pending waiters when doing wake ups as well The wake up waiters only checks the "wakeup_full" variable and not the "full_waiters_pending". The full_waiters_pending is set when a waiter is added to the wait queue. The wakeup_full is only set when an event is triggered, and it clears the full_waiters_pending to avoid multiple calls to irq_work_queue(). The irq_work callback really needs to check both wakeup_full as well as full_waiters_pending such that this code can be used to wake up waiters when a file is closed that represents the ring buffer and the waiters need to be woken up. Link: https://lkml.kernel.org/r/20220927231824.209460321@goodmis.org Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Fixes: 15693458c4bc0 ("tracing/ring-buffer: Move poll wake ups into ring buffer code") Signed-off-by: Steven Rostedt (Google) commit 3b19d614b61b93a131f463817e08219c9ce1fee3 Author: Steven Rostedt (Google) Date: Tue Sep 27 19:15:24 2022 -0400 ring-buffer: Have the shortest_full queue be the shortest not longest The logic to know when the shortest waiters on the ring buffer should be woken up or not has uses a less than instead of a greater than compare, which causes the shortest_full to actually be the longest. Link: https://lkml.kernel.org/r/20220927231823.718039222@goodmis.org Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Fixes: 2c2b0a78b3739 ("ring-buffer: Add percentage of ring buffer full to wake up reader") Signed-off-by: Steven Rostedt (Google) commit 5459c0b7046752e519a646e1c2404852bb628459 Author: Mika Westerberg Date: Tue Aug 16 13:20:42 2022 +0300 PCI/DPC: Quirk PIO log size for certain Intel Root Ports Some Root Ports on Intel Tiger Lake and Alder Lake systems support the RP Extensions for DPC and the RP PIO Log registers but incorrectly advertise an RP PIO Log Size of zero. This means the kernel complains that: DPC: RP PIO log size 0 is invalid and if DPC is triggered, the DPC driver will not dump the RP PIO Log registers when it should. This is caused by a BIOS bug and should be fixed the BIOS for future CPUs. Add a quirk to set the correct RP PIO Log size for the affected Root Ports. Link: https://bugzilla.kernel.org/show_bug.cgi?id=209943 Link: https://lore.kernel.org/r/20220816102042.69125-1-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit 116523c8fac05d1d26f748fee7919a4ec5df67ea Author: Luiz Augusto von Dentz Date: Mon Sep 26 15:44:42 2022 -0700 Bluetooth: hci_core: Fix not handling link timeouts propertly Change that introduced the use of __check_timeout did not account for link types properly, it always assumes ACL_LINK is used thus causing hdev->acl_last_tx to be used even in case of LE_LINK and then again uses ACL_LINK with hci_link_tx_to. To fix this __check_timeout now takes the link type as parameter and then procedure to use the right last_tx based on the link type and pass it to hci_link_tx_to. Fixes: 1b1d29e51499 ("Bluetooth: Make use of __check_timeout on hci_sched_le") Signed-off-by: Luiz Augusto von Dentz Tested-by: David Beinder commit d601cc93036aff7c603dda6d22cf6a8211dfed16 Merge: 8ffb78f3640e2 9d3feb6333952 Author: Dave Airlie Date: Wed Sep 28 07:05:38 2022 +1000 Merge tag 'mediatek-drm-next-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 6.1 1. Drop of_gpio header 2. Remove the unneeded result Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20220922234804.18557-1-chunkuang.hu@kernel.org commit f6f8bb5989a362d1c5f613c4487dc7adb8627dfe Author: Hawking Zhang Date: Fri Sep 16 00:38:49 2022 +0800 drm/amdgpu/gfx9: switch to amdgpu_gfx_rlc_init_microcode switch to common helper to initialize rlc firmware for gfx9 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 5b415212686a0fa03f9f906a0c8ad2410590230a Author: Hawking Zhang Date: Fri Sep 16 00:21:50 2022 +0800 drm/amdgpu: add helper to init rlc firmware To initialzie rlc firmware according to rlc firmware header version v2: squash in backwards compat fix Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit cce6a2d7e0e494c453ad73e1e78bd50684f20cca Author: Jiri Olsa Date: Tue Sep 27 22:32:59 2022 +0200 bpf: Check flags for branch stack in bpf_read_branch_records helper Recent commit [1] changed branch stack data indication from br_stack pointer to sample_flags in perf_sample_data struct. We need to check sample_flags for PERF_SAMPLE_BRANCH_STACK bit for valid branch stack data. [1] a9a931e26668 ("perf: Use sample_flags for branch stack") Fixes: a9a931e26668 ("perf: Use sample_flags for branch stack") Signed-off-by: Jiri Olsa Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lore.kernel.org/r/20220927203259.590950-1-jolsa@kernel.org commit 4674ffe2fcad45a9b164401cc0794115702326cf Author: Marco Elver Date: Tue Sep 27 19:20:25 2022 +0200 perf, hw_breakpoint: Fix use-after-free if perf_event_open() fails Local testing revealed that we can trigger a use-after-free during rhashtable lookup as follows: | BUG: KASAN: use-after-free in memcmp lib/string.c:757 | Read of size 8 at addr ffff888107544dc0 by task perf-rhltable-n/1293 | | CPU: 0 PID: 1293 Comm: perf-rhltable-n Not tainted 6.0.0-rc3-00014-g85260862789c #46 | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 | Call Trace: | | memcmp lib/string.c:757 | rhashtable_compare include/linux/rhashtable.h:577 [inline] | __rhashtable_lookup include/linux/rhashtable.h:602 [inline] | rhltable_lookup include/linux/rhashtable.h:688 [inline] | task_bp_pinned kernel/events/hw_breakpoint.c:324 | toggle_bp_slot kernel/events/hw_breakpoint.c:462 | __release_bp_slot kernel/events/hw_breakpoint.c:631 [inline] | release_bp_slot kernel/events/hw_breakpoint.c:639 | register_perf_hw_breakpoint kernel/events/hw_breakpoint.c:742 | hw_breakpoint_event_init kernel/events/hw_breakpoint.c:976 | perf_try_init_event kernel/events/core.c:11261 | perf_init_event kernel/events/core.c:11325 [inline] | perf_event_alloc kernel/events/core.c:11619 | __do_sys_perf_event_open kernel/events/core.c:12157 | do_syscall_x64 arch/x86/entry/common.c:50 [inline] | do_syscall_64 arch/x86/entry/common.c:80 | entry_SYSCALL_64_after_hwframe | | | Allocated by task 1292: | perf_event_alloc kernel/events/core.c:11505 | __do_sys_perf_event_open kernel/events/core.c:12157 | do_syscall_x64 arch/x86/entry/common.c:50 [inline] | do_syscall_64 arch/x86/entry/common.c:80 | entry_SYSCALL_64_after_hwframe | | Freed by task 1292: | perf_event_alloc kernel/events/core.c:11716 | __do_sys_perf_event_open kernel/events/core.c:12157 | do_syscall_x64 arch/x86/entry/common.c:50 [inline] | do_syscall_64 arch/x86/entry/common.c:80 | entry_SYSCALL_64_after_hwframe | | The buggy address belongs to the object at ffff888107544c00 | which belongs to the cache perf_event of size 1352 | The buggy address is located 448 bytes inside of | 1352-byte region [ffff888107544c00, ffff888107545148) This happens because the first perf_event_open() managed to reserve a HW breakpoint slot, however, later fails for other reasons and returns. The second perf_event_open() runs concurrently, and during rhltable_lookup() looks up an entry which is being freed: since rhltable_lookup() may run concurrently (under the RCU read lock) with rhltable_remove(), we may end up with a stale entry, for which memory may also have already been freed when being accessed. To fix, only free the failed perf_event after an RCU grace period. This allows subsystems that store references to an event to always access it concurrently under the RCU read lock, even if initialization will fail. Given failure is unlikely and a slow-path, turning the immediate free into a call_rcu()-wrapped free does not affect performance elsewhere. Fixes: 0370dc314df3 ("perf/hw_breakpoint: Optimize list of per-task breakpoints") Reported-by: syzkaller Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220927172025.1636995-1-elver@google.com commit 838d9bb62d132ec3baf1b5aba2e95ef9a7a9a3cd Author: Namhyung Kim Date: Wed Sep 21 15:00:32 2022 -0700 perf: Use sample_flags for raw_data Use the new sample_flags to indicate whether the raw data field is filled by the PMU driver. Although it could check with the NULL, follow the same rule with other fields. Remove the raw field from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220921220032.2858517-2-namhyung@kernel.org commit 7b084630153152239d84990ac4540c2dd360186f Author: Namhyung Kim Date: Wed Sep 21 15:00:31 2022 -0700 perf: Use sample_flags for addr Use the new sample_flags to indicate whether the addr field is filled by the PMU driver. As most PMU drivers pass 0, it can set the flag only if it has a non-zero value. And use 0 in perf_sample_output() if it's not filled already. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220921220032.2858517-1-namhyung@kernel.org commit d412df530f77d0f61c41b83f925997452fc3944c Author: Eric Whitney Date: Fri Jul 22 12:39:10 2022 -0400 ext4: minor defrag code improvements Modify the error returns for two file types that can't be defragged to more clearly communicate those restrictions to a caller. When the defrag code is applied to swap files, return -ETXTBSY, and when applied to quota files, return -EOPNOTSUPP. Move an extent tree search whose results are only occasionally required to the site always requiring them for improved efficiency. Address a few typos. Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20220722163910.268564-1-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit be18c5ede25da39a0eda541f6de3620a30cf731f Author: Asmaa Mnebhi Date: Tue Sep 27 16:39:24 2022 -0400 i2c: mlxbf: remove device tree support BlueField customers have to use the BlueField firmware with UEFI ACPI tables so there is no need to have device tree support in the i2c-mlxbf.c driver. Remove the device tree binding documentation as well. Signed-off-by: Asmaa Mnebhi Reviewed-by: Khalil Blaiech Signed-off-by: Wolfram Sang commit 19e13e1330c63506452eed80f473f344e6779b94 Author: Asmaa Mnebhi Date: Tue Sep 27 16:39:23 2022 -0400 i2c: mlxbf: support BlueField-3 SoC BlueField-3 SoC has the same I2C IP logic as previous BlueField-1 and 2 SoCs but it has different registers' addresses. This is an effort to keep this driver generic across all BlueField generations. This patch breaks down the "smbus" resource into 3 separate resources to enable us to use common registers' offsets for all BlueField SoCs: struct mlxbf_i2c_resource *timer; struct mlxbf_i2c_resource *mst; struct mlxbf_i2c_resource *slv; Of course, all offsets had to be adjusted accordingly, and we took this chance to reorganize the macros depending on the register block they target. There are only 2 registers' offsets that do not fit within this schema so their offsets are passed as SoC-specific parameters: smbus_master_rs_bytes_off smbus_master_fsm_off Reviewed-by: Khalil Blaiech Signed-off-by: Asmaa Mnebhi Signed-off-by: Wolfram Sang commit df3cb754d13d2cd5490db9b8d536311f8413a92e Author: Jerry Lee 李修賢 Date: Mon Jul 18 10:25:19 2022 +0000 ext4: continue to expand file system when the target size doesn't reach When expanding a file system from (16TiB-2MiB) to 18TiB, the operation exits early which leads to result inconsistency between resize2fs and Ext4 kernel driver. === before === ○ → resize2fs /dev/mapper/thin resize2fs 1.45.5 (07-Jan-2020) Filesystem at /dev/mapper/thin is mounted on /mnt/test; on-line resizing required old_desc_blocks = 2048, new_desc_blocks = 2304 The filesystem on /dev/mapper/thin is now 4831837696 (4k) blocks long. [ 865.186308] EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none. [ 912.091502] dm-4: detected capacity change from 34359738368 to 38654705664 [ 970.030550] dm-5: detected capacity change from 34359734272 to 38654701568 [ 1000.012751] EXT4-fs (dm-5): resizing filesystem from 4294966784 to 4831837696 blocks [ 1000.012878] EXT4-fs (dm-5): resized filesystem to 4294967296 === after === [ 129.104898] EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none. [ 143.773630] dm-4: detected capacity change from 34359738368 to 38654705664 [ 198.203246] dm-5: detected capacity change from 34359734272 to 38654701568 [ 207.918603] EXT4-fs (dm-5): resizing filesystem from 4294966784 to 4831837696 blocks [ 207.918754] EXT4-fs (dm-5): resizing filesystem from 4294967296 to 4831837696 blocks [ 207.918758] EXT4-fs (dm-5): Converting file system to meta_bg [ 207.918790] EXT4-fs (dm-5): resizing filesystem from 4294967296 to 4831837696 blocks [ 221.454050] EXT4-fs (dm-5): resized to 4658298880 blocks [ 227.634613] EXT4-fs (dm-5): resized filesystem to 4831837696 Signed-off-by: Jerry Lee Link: https://lore.kernel.org/r/PU1PR04MB22635E739BD21150DC182AC6A18C9@PU1PR04MB2263.apcprd04.prod.outlook.com Signed-off-by: Theodore Ts'o commit 58b924241d0a23eee8e86dd9e6f5dacd01c82e62 Author: Shubhrajyoti Datta Date: Thu Jul 28 11:21:50 2022 +0530 i2c: cadence: Add standard bus recovery support Hook up the standard GPIO/pinctrl-based recovery support. We are doing the recovery at the beginning on a timeout. Multiple people have contributed to the series. Original patch from Cirag and another one from Robert. Signed-off-by: Shubhrajyoti Datta Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 9175d8103780084e70bc89f2040ea62dc30f6f60 Author: Leon Romanovsky Date: Wed Sep 7 16:36:32 2022 -0700 net/mlx5: Remove from FPGA IFC file not-needed definitions Move IP layout bits definitions to be close to the place that actually uses it, together with removal extra defines that not in-use. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit b53ff37fcd5c7038d9dd000dcf682575a8f47999 Author: Gal Pressman Date: Wed Sep 7 16:36:31 2022 -0700 net/mlx5: Remove unused structs Remove structs which are no longer used in the driver: mlx5dr_cmd_qp_create_attr mlx5_fs_dr_ns mlx5_pas Signed-off-by: Gal Pressman Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 66af4fe37119dbf6a82078949a82e625155777ef Author: Gal Pressman Date: Wed Sep 7 16:36:30 2022 -0700 net/mlx5: Remove unused functions Remove functions which are no longer used in the driver: mlx5e_ipsec_is_tx_flow mlx5_health_flush get_cqe_enhanced_num_mini_cqes get_cqe_l3_hdr_type mlx5_health_flush mlx5_fs_is_ipsec_flow _mlx5_fs_is_outer_ipproto_flow mlx5_fs_is_outer_tcp_flow mlx5_fs_is_outer_udp_flow mlx5_fs_is_vxlan_flow mlx5_fs_is_outer_ipsec_flow Signed-off-by: Gal Pressman Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 90b1df74b56407ed43840b4db5b07aea0b7a8152 Author: Liu, Changcheng Date: Wed Sep 7 16:36:29 2022 -0700 net/mlx5: detect and enable bypass port select flow table Use port selection capability port_select_flow_table_bypass bit to detect and enable explicit port affinity even when in lag hash mode. Signed-off-by: Liu, Changcheng Reviewed-by: Mark Bloch Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit b146a7cd0a71cc22864f09bc186040e2ffd5aed8 Author: Liu, Changcheng Date: Wed Sep 7 16:36:28 2022 -0700 net/mlx5: Lag, enable hash mode by default for all NICs The firmware supports adding a steering rule to catch egress traffic of the QPs/TISs which are set port affinity explicitly in hash mode. Enable that mode for NICS with 2 ports as well. Signed-off-by: Liu, Changcheng Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit c5c13b456cb85a2ac298c4db1b396d3ccf621a9c Author: Liu, Changcheng Date: Wed Sep 7 16:36:27 2022 -0700 net/mlx5: Lag, set active ports if support bypass port select flow table active_port bit mask indicates the current active ports. Set bit indicates the port is active. Update active ports info to FW to redirect the QP/TIS from inactive ports to other ports. Signed-off-by: Liu, Changcheng Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit a83bb5df2ac604ab418fbe0a8720f55de46652eb Author: Liu, Changcheng Date: Wed Sep 7 16:36:26 2022 -0700 RDMA/mlx5: Don't set tx affinity when lag is in hash mode In hash mode, without setting tx affinity explicitly, the port select flow table decides which port is used for the traffic. If port_select_flow_table_bypass capability is supported and tx affinity is set explicitly for QP/TIS, they will be added into the explicit affinity table in FW to check which port is used for the traffic. 1. The overloaded explicit affinity table may affect performance. To avoid this, do not set tx affinity explicitly by default. 2. The packets of the same flow need to be transmitted on the same port. Because the packets of the same flow use different QPs in slow & fast path, it shouldn't set tx affinity explicitly for these QPs. Signed-off-by: Liu, Changcheng Reviewed-by: Mark Bloch Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 8d1ac895fff96a228db20db92243e93687659ef7 Author: Liu, Changcheng Date: Wed Sep 7 16:36:25 2022 -0700 net/mlx5: add IFC bits for bypassing port select flow table port_select_flow_table_bypass - When set, device supports bypass port select flow table. active_port - Bitmask indicates the current active ports in PORT_SELECT_FT LAG. MLX5_SET_HCA_CAP_OP_MODE_PORT_SELECTION - op_mod to operate PORT_SELECTION_Capabilities. Signed-off-by: Liu, Changcheng Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit f0462bc3e9024e9738fcd1a026456238317d84c7 Author: Aya Levin Date: Wed Sep 7 16:36:24 2022 -0700 net/mlx5: Add support for NPPS with real time mode Add support for setting NPPS. NPPS is currently available in REAL_TIME_CLOCK mode only. In addition allow the user to set the pulse duration. When NPPS pulse duration is not set explicitly by the user, driver set it to 50% of the NPPS period. Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit 976a859c9c68fdf160379bfc154431489f318292 Author: Aya Levin Date: Wed Sep 7 16:36:23 2022 -0700 net/mlx5: Expose NPPS related registers Add management capability bits indicating firmware may support N pulses per second. Add corresponding fields in MTPPS register. Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit bdc4af281b70b7fe2881fd08f1aa1b15f2b6adf0 Author: Asmaa Mnebhi Date: Mon Sep 26 15:45:05 2022 -0400 i2c: mlxbf: add multi slave functionality Support the multi slave functionality which enables the BlueField to be registered at up to 16 i2c slave addresses. Reviewed-by: Khalil Blaiech Signed-off-by: Asmaa Mnebhi Signed-off-by: Wolfram Sang commit 86067ccfa1424a26491542d6f6d7546d40b61a10 Author: Asmaa Mnebhi Date: Mon Sep 26 15:45:04 2022 -0400 i2c: mlxbf: support lock mechanism Linux is not the only entity using the BlueField I2C busses so support a lock mechanism provided by hardware to avoid issues when multiple entities are trying to access the same bus. The lock is acquired whenever written explicitely or the lock register is read. So make sure it is always released at the end of a successful or failed transaction. Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC) Reviewed-by: Khalil Blaiech Signed-off-by: Asmaa Mnebhi Signed-off-by: Wolfram Sang commit 85f17d677f6c40069287617630f202eb20fcfe36 Merge: 2dec3a7a7beb2 f76349cf41451 Author: Wolfram Sang Date: Tue Sep 27 21:33:37 2022 +0200 Merge branch 'master' into i2c/for-mergewindow commit bf21f3f8d0336ec28d9ab09ad274ac0bd71b7cf8 Author: Dmitry Torokhov Date: Tue Sep 27 08:29:42 2022 -0700 MIPS: Lantiq: vmmc: fix compile break introduced by gpiod patch "MIPS: Lantiq: switch vmmc to use gpiod API" patch introduced compile errors, this patch fixes them. Signed-off-by: Dmitry Torokhov Signed-off-by: Thomas Bogendoerfer commit 49beeea7ebdb1d86ba8465e5021d72ad9e9474b8 Author: Yang Yingliang Date: Fri Sep 23 22:18:03 2022 +0800 Documentation: devres: add missing SPI helper Add devm_spi_alloc_master() and devm_spi_alloc_slave() to devres.rst. They are introduced by commit 5e844cc37a5c ("spi: Introduce device-managed SPI controller allocation"). Signed-off-by: Yang Yingliang Reviewed-by: Lukas Wunner Link: https://lore.kernel.org/r/20220923141803.75734-1-yangyingliang@huawei.com Signed-off-by: Jonathan Corbet commit a9a7da031dcaeb5064df6605535cf360276b911a Author: Yang Yingliang Date: Thu Sep 22 23:37:37 2022 +0800 Documentation: devres: add missing PINCTRL helpers Add devm_pinctrl_get_select() and devm_pinctrl_register_and_init() to devres.rst. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220922153737.2863951-1-yangyingliang@huawei.com Signed-off-by: Jonathan Corbet commit 16461c66de0b559ee0b19e429561cae9cae72e8c Author: Hoi Pok Wu Date: Thu Sep 22 11:06:45 2022 +0800 docs: hugetlbpage.rst: fix a typo of hugepage size should be kB instead of Kb Signed-off-by: Hoi Pok Wu Reviewed-by: Muchun Song Link: https://lore.kernel.org/r/20220922030645.9719-1-wuhoipok@gmail.com Signed-off-by: Jonathan Corbet commit 0a13b6c3c546e3b6df75639cfe09954a1a17dd63 Author: Wu XiangCheng Date: Thu Sep 22 21:04:22 2022 +0800 docs/zh_CN: Add new translation of admin-guide/bootconfig.rst The last English version used: commit 2f51efc6b71d ("docs: bootconfig: Add how to embed the bootconfig into kernel") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/386249dc333a3e40b80c3a9483d60d2bfd24a6c4.1663850554.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit 8f0ec4094d01dbc40dcbad93a7ec85675cf035cf Author: Wu XiangCheng Date: Thu Sep 22 21:03:39 2022 +0800 docs/zh_CN: Update zh_CN/admin-guide/README.rst to 6.0-rc2 * update to commit ea052e7257bd ("docs: admin-guide: for kernel bugs refer to other kernel documentation") We are in 6.x now ;) Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/7f6e0b8961f79befa62e0070f9682ab3abde8622.1663850554.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit 6d75bb92f99260af29986657cea1426f4040b280 Author: Binbin Zhou Date: Fri Aug 19 14:28:40 2022 +0800 docs/zh_CN: core-api: Add packing Chinese translation Translate core-api/packing.rst into Chinese. Last English version used: commit 1ec779b9fabc ("docs: packing: move it to core-api book and adjust markups"). Signed-off-by: Binbin Zhou Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/96b19575ca7e9e23941e8a5ef92120f1bffbc518.1660881950.git.zhoubinbin@loongson.cn Signed-off-by: Jonathan Corbet commit eda91f4090e97dd75d5f4aec82021c097d4b3114 Author: Binbin Zhou Date: Fri Aug 19 14:28:39 2022 +0800 docs/zh_CN: core-api: Add generic-radix-tree Chinese translation Translate core-api/generic-radix-tree.rst into Chinese. Last English version used: commit ba20ba2e3743 ("generic radix trees"). Signed-off-by: Binbin Zhou Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/aad94e2a053ae021eb4d63240690b05c2f3e8dec.1660881950.git.zhoubinbin@loongson.cn Signed-off-by: Jonathan Corbet commit 2e6506c1a5a51eabaf1cc88a0fe6783509c905e8 Author: Binbin Zhou Date: Fri Aug 19 14:28:38 2022 +0800 docs/zh_CN: core-api: Add circular-buffers Chinese translation Translate core-api/circular-buffers.rst into Chinese. Last English version used: commit 714b6904e23e ("doc: Remove ".vnet" from paulmck email addresses"). Signed-off-by: Binbin Zhou Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/6b94f233dd4b4a9e6da6fa2f86a9b1d32f104004.1660881950.git.zhoubinbin@loongson.cn Signed-off-by: Jonathan Corbet commit 7675ea68d60554e119d7439472af056d07a521ba Author: Binbin Zhou Date: Fri Aug 19 14:28:37 2022 +0800 docs/zh_CN: core-api: Add idr Chinese translation Translate core-api/idr.rst into Chinese. Last English version used: commit 85656ec193e9 ("IDR: Note that the IDR API is deprecated"). Signed-off-by: Binbin Zhou Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/9f578ea087df7ef8665fc08541d208e7429176ec.1660881950.git.zhoubinbin@loongson.cn Signed-off-by: Jonathan Corbet commit a356c06699e2e9bde64b17fc220de3c01f0c7d20 Author: Tuo Cao <91tuocao@gmail.com> Date: Thu Sep 15 23:01:55 2022 +0800 docs: x86: replace do_IRQ int the entry_64.rst with common_interrupt() do_IRQ has been replaced by common_interrupt in commit fa5e5c409213 ("x86/entry: Use idtentry for interrupts"). Signed-off-by: Tuo Cao <91tuocao@gmail.com> Link: https://lore.kernel.org/r/20220915150155.9908-1-91tuocao@gmail.com Signed-off-by: Jonathan Corbet commit c68c0db4b25ff7336471ca32be7f9af5110528bc Author: Randy Dunlap Date: Sat Aug 27 13:32:17 2022 -0700 usb: chipidea: clarify Documentation/ABI text Fix grammar and improve readability of chipidea-usb2 text. Signed-off-by: Randy Dunlap Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Peter Chen Cc: linux-usb@vger.kernel.org Acked-by: Peter Chen Link: https://lore.kernel.org/r/20220827203217.7837-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit b270228753f241aa70ad37134f284566be86ec73 Author: Randy Dunlap Date: Sat Aug 27 17:28:45 2022 -0700 Documentation: W1: minor typo corrections Correct one typo/spello and remove one duplicated word in the W1 documentation. Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Evgeniy Polyakov Link: https://lore.kernel.org/r/20220828002845.7022-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 60e89a10eef2a3052dc35bea62f51acf26525698 Author: Randy Dunlap Date: Sun Aug 28 12:25:01 2022 -0700 Documentation: fb: udlfb: clean up text and formatting Clean up punctuation, spelling, and formatting for command line usage and modprobe config file usage in udlfb.rst. Signed-off-by: Randy Dunlap Cc: Bernie Thompson Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Helge Deller Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Bagas Sanjaya Link: https://lore.kernel.org/r/20220828192501.14232-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 3832d1fd84b6220842d92513239005b2c116633b Author: Robert Elliott Date: Sat Aug 27 14:38:36 2022 -0500 docs/core-api: expand Fedora instructions for GCC plugins In Fedora 36, cross-compiling an allmodconfig configuration for other architectures on x86 fails with this problem: In file included from ../scripts/gcc-plugins/gcc-common.h:95, from ../scripts/gcc-plugins/latent_entropy_plugin.c:78: /usr/lib/gcc/aarch64-linux-gnu/12/plugin/include/builtins.h:23:10: fatal error: mpc.h: No such file or directory 23 | #include | ^~~~~~~ compilation terminated. In that distro, that header file is available in the separate libmpc-devel package. Although future versions of Fedora might correctly mark that dependency, mention this additional package. To help detect such problems ahead of time, describe the gcc -print-file-name=plugin command that is used by scripts/gcc-plugins/Kconfig to detect plugins [1]. [1] https://lore.kernel.org/lkml/CAHk-=wjjiYjCp61gdAMpDOsUBU-A2hFFKJoVx5VAC7yV4K6WYg@xxxxxxxxxxxxxx/ Fixes: 43e96ef8b70c50f ("docs/core-api: Add Fedora instructions for GCC plugins"); Signed-off-by: Robert Elliott Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220827193836.2582079-1-elliott@hpe.com Signed-off-by: Jonathan Corbet commit e2815b71cc48c988474dc2f2fc4725c5913f7155 Author: Randy Dunlap Date: Mon Aug 29 16:29:08 2022 -0700 Documentation: spufs: correct a duplicate word typo Fix a typo of "or" which should be "of". Signed-off-by: Randy Dunlap Cc: Jeremy Kerr Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Cc: Jonathan Corbet Reviewed-by: Jeremy Kerr Link: https://lore.kernel.org/r/20220829232908.32437-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 5415673414c99b44db0c917f1400ad3b6d56fef7 Author: Wu XiangCheng Date: Tue Aug 30 13:23:12 2022 +0800 docs/zh_CN: Update zh_CN/process/coding-style.rst to 6.0-rc2 * update to commit c04639a7d2fb ("coding-style.rst: trivial: fix location of driver model macros") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/Yw2ewM4wfaDDLjTk@bobwxc.mipc Signed-off-by: Jonathan Corbet commit 06cb31cc761823ef444ba4e1df11347342a6e745 Author: Lin Yujun Date: Tue Aug 30 20:36:14 2022 +0800 Documentation/hw-vuln: Update spectre doc commit 7c693f54c873691 ("x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS") adds the "ibrs " option in Documentation/admin-guide/kernel-parameters.txt but omits it to Documentation/admin-guide/hw-vuln/spectre.rst, add it. Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220830123614.23007-1-linyujun809@huawei.com Signed-off-by: Jonathan Corbet commit 622d6f198737c26a47d892f29d054bf20df5a460 Author: Randy Dunlap Date: Wed Aug 31 17:28:28 2022 -0700 Documentation: filesystems: correct possessive "its" Change occurrences of "it's" that are possessive to "its" so that they don't read as "it is". For f2fs.rst, reword one description for better clarity. Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-fsdevel@vger.kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net Cc: linux-xfs@vger.kernel.org Cc: Christian Brauner Cc: Seth Forshee Cc: Al Viro Cc: Theodore Ts'o Cc: Jaegeuk Kim Reviewed-by: Darrick J. Wong Reviewed-by: "Christian Brauner (Microsoft)" Reviewed-by: Chao Yu Reviewed-by: Jaegeuk Kim Link: https://lore.kernel.org/r/20220901002828.25102-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 67fe6792a7fb9b7af85d1abf44605c3ab7d3b5f7 Author: Salvatore Bonaccorso Date: Thu Sep 1 20:43:28 2022 +0200 Documentation: stable: Document alternative for referring upstream commit hash Additionally to the "commit upstream." variant, "[ Upstream commit ]" is used as well as alternative to refer to the upstream commit hash. Signed-off-by: Salvatore Bonaccorso Link: https://lore.kernel.org/r/20220901184328.4075701-1-carnil@debian.org Signed-off-by: Jonathan Corbet commit 8bfdfa0d6b929ede7b6189e0e546ceb6a124d05d Author: Shuah Khan Date: Thu Sep 1 15:23:19 2022 -0600 docs: update mediator information in CoC docs Update mediator information in the CoC interpretation document. Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220901212319.56644-1-skhan@linuxfoundation.org Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet commit 9485acfded2024bcd28e9e4d5d503ed7beda0308 Author: Yanteng Si Date: Tue Sep 6 16:26:51 2022 +0800 docs/zh_CN: add dt kernel-api translation Translte .../devicetree/kernel-api.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/35fd1b5801d7191e078937908008115f8949aac3.1662449105.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit f773455ce59d9425c473e1e559fc26ea84bcdf00 Author: Yanteng Si Date: Tue Sep 6 16:26:50 2022 +0800 docs/zh_CN: add dt overlay-notes translation Translate .../devicetree/overlay-notes.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/b957580e448e2d0ab7917644c8f8f1614060b20a.1662449105.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 5e38432db8f361e002481b006e54ad4de678721f Author: Yanteng Si Date: Tue Sep 6 16:26:49 2022 +0800 docs/zh_CN: add dt dynamic-resolution-notes translation Translate .../devicetree/dynamic-resolution-notes.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/d8b7c06fe8fdb58cb2ec6989e09f9999aca2d8d1.1662449105.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 330f5a300548babcaada664668bb17165db8d54c Author: Yanteng Si Date: Tue Sep 6 16:26:48 2022 +0800 docs/zh_CN: add dt changesets translation Translate .../devicetree/changesets.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/07d23cedda1e2cd8cf40d68059024d116f8d004e.1662449105.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 980309d94e021ddac12e3bd9932e2a1686161899 Author: Yanteng Si Date: Tue Sep 6 16:26:47 2022 +0800 docs/zh_CN: add PCI acpi-info translation Translate .../PCI/acpi-info.rst into Chinese. Add PCI into .../zh_CN/index.rst. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/f07ba17ae9c6d728d6135ecc0577a932e9836fba.1662449105.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit adb95582a09f24201e071732824aef53593020e2 Author: Rong Tao Date: Wed Sep 14 08:33:00 2022 +0800 Documentation: process/submitting-patches: misspelling "mesages" Fix spelling mistakes, "mesages" should be spelled "messages". Signed-off-by: Rong Tao Link: https://lore.kernel.org/r/tencent_924BF0B25425E2D5673409D1CF604F682505@qq.com Signed-off-by: Jonathan Corbet commit 7f77ebbf758be6df89951713e7b234a9e6c5d32b Author: Akhil Raj Date: Mon Aug 29 12:22:39 2022 +0530 Delete duplicate words from kernel docs I have deleted duplicate words like to, guest, trace, when, we Signed-off-by: Akhil Raj Link: https://lore.kernel.org/r/20220829065239.4531-1-lf32.dev@gmail.com Signed-off-by: Jonathan Corbet commit 32a3a9db16eb7551a6763820a8ed6f151f879eaa Author: Lukas Bulwahn Date: Wed Jul 20 06:13:25 2022 +0200 docs: admin-guide: for kernel bugs refer to other kernel documentation The current section 'If something goes wrong' makes a number of suggestions for debugging, bug hunting and reporting issues, which are quite briefly described in that section. However, the suggestions are also well covered in other kernel documentation or sometimes simply outdated. Here, each suggestion in that section is summarized, and then followed with its assessment, and the derived action for each suggestion: - use MAINTAINERS and mailing list: covered in 'Reporting issues', summarized in the short guide, detailed in its further section. Reporting issues even provides some specific examples that guides readers well through the needed steps. Refer to 'Reporting issues'. - contact Linus Torvalds: probably outdated as currently described. nevertheless covered in 'Reporting issues'. Reporting issues points out to contact the relevant kernel maintainers first, and after some patience and failed attempts with those maintainers, contacting Linus Torvalds might be okay. Refer to 'Reporting issues'. - tell what kernel, how to duplicate, the setup, if the problem is new or old and when did you notice: covered in 'Reporting issues', especially in Step-by-step guide how to report issues to the kernel maintainers. Refer to 'Reporting issues'. - duplicate kernel bug reports exactly: covered in 'Reporting issues', especially in Write and send the report. Refer to 'Reporting issues'. - read 'Bug hunting': keep this reference. Refer to 'Bug hunting'. - compile the kernel with CONFIG_KALLSYMS: covered in 'Reporting issues', especially in Decode failure messages. Refer to 'Reporting issues'. - alternatively, use ksymoops: ksymoops at the mentioned URL seems not to be maintained anymore. It was released roughly once a year until version 2.4.11 in 2005, but has not seen a new release since then. The information in ./scripts/ksymoops/README is from 1999, and does not give more insight on its actual maintenance state either. Ksymoops is mentioned as system utility in changes.rst, but also not recommended there. Drop the explanation on using ksymoops. - alternatively, lookup dump manually with the EIP and nm to determine the function in which the kernel crashes: this method seems already a quite advanced and low-level debugging method. Even all the further references on bug hunting and debugging do not mention it. Drop this alternative method and limit mentioning methods explained in the other existing kernel documentation. - read 'Reporting issues': keep this reference. Refer to 'Reporting issues'. - use gdb for debugging: some specific details, e.g., edit arch/x86/Makefile, are probably outdated or limited to one (historic important) setup. Using gdb is covered in 'Bug hunting', 'Debugging kernel and modules via gdb' and 'Using kgdb, kdb and the kernel debugger internals'. Refer to those three documents. Overall, it is sufficient to refer to reporting-issues.rst, bug-hunting.rst, gdb-kernel-debugging.rst and kgdb.rst and this way cover the existing suggestions. 'Reporting issues' is quite new and probably up to date. 'Bug hunting', 'Debugging kernel and modules via gdb' and 'Using kgdb, kdb and the kernel debugger internals' might need some revisit and update, but they are generally in an acceptable state for referring to them. Replace the existing suggestions by reference to other existing kernel documentation covering those suggestions---partly even nicely summarized and then explained in greater detail. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220720041325.15693-3-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit 3f10b50829194eb7ce4c8f320a665b7b076a5fb6 Author: Lukas Bulwahn Date: Wed Jul 20 06:13:24 2022 +0200 docs: admin-guide: do not mention the 'run a.out user programs' feature Running a.out user programs with the latest kernel release is a very rare and uncommon use case nowadays. The support of a.out user programs is only remaining for the alpha architecture and is not defined and activated in the architecture's Kconfig (so even the activation of this support requires to modify the Kconfig file and not just kernel build configuration). The discussion on a.out support in 2019 (see Link) shows that the support of a.out user programs is just remaining for a special corner case from some (alpha architecture) users. There is no need to point out and mention this special feature to the general audience of kernel users. Delete the reference to this historic and special feature. Link: https://lore.kernel.org/all/CAHk-=wgt7M6yA5BJCJo0nF22WgPJnN8CvViL9CAJmd+S+Civ6w@mail.gmail.com/ Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220720041325.15693-2-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit 8a7f0e8ab9e8c1a32eefd632fb11cdc08af28aee Author: Randy Dunlap Date: Sun Jul 31 19:52:07 2022 -0700 Documentation/ABI: correct possessive "its" typos Correct all uses of "it's" that are meant to be possessive "its". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220801025207.29971-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit d2bef8e1037cc69695c6b146bb05ce053450e0de Author: Akhil Raj Date: Sat Aug 27 20:23:59 2022 +0530 Remove duplicate words inside documentation I have removed repeated `the` inside the documentation Signed-off-by: Akhil Raj Link: https://lore.kernel.org/r/20220827145359.32599-1-lf32.dev@gmail.com Signed-off-by: Jonathan Corbet commit 3b384e95642c0f01a34525a71b6a5a4826934b75 Author: Akira Yokosawa Date: Sat Aug 27 13:38:17 2022 +0900 docs/conf.py: Respect env variable SPHINX_IMGMATH On some distros with coarse-grained packaging policy, dvipng is installed along with latex. In such cases, math rendering will use imgmath by default. It is possible to override the choice by specifying the option string of "-D html_math_renderer='mathjax'" to sphinx-build (Sphinx >= 1.8). To provide developers an easier-to-use knob, add code for an env variable "SPHINX_IMGMATH" which overrides the automatic choice of math renderer for html docs. SPHINX_IMGMATH=yes : Load imgmath even if dvipng is not found SPHINX_IMGMATH=no : Don't load imgmath (fall back to mathjax) Signed-off-by: Akira Yokosawa Acked-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5a582b2b-d51c-a062-36b2-19479cf68fab@gmail.com Signed-off-by: Jonathan Corbet commit 6b0d3e7c5888d2ec0f5527ee699265dc852a5faa Author: Akira Yokosawa Date: Sat Aug 27 13:37:18 2022 +0900 docs/conf.py: Treat mathjax as fallback math renderer Currently, math expressions using the "math::" directive or the ":math:" role of Sphinx need the imgmath extension for proper rendering in html and epub builds. imgmath requires dvipng (and latex). Otherwise, "make htmldocs" will complain of missing commands. As a matter of fact, the mathjax extension is loaded by default since Sphinx v1.8 and it is good enough for html docs without any dependency on texlive packages. Stop loading the imgmath extension for html docs unless requirements for imgmath are met. To find out whether required commands are available, add a helper find_command(), which is a wrapper of shutil.which(). For epub docs, keep the same behavior of always loading imgmath. Signed-off-by: Akira Yokosawa Acked-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a6a877fc-dc93-2bda-a6d3-37001d99942a@gmail.com [jc: Took out the writing of the math_renderer decision] Signed-off-by: Jonathan Corbet commit 20e21951f3ebceac93168854edc1c222e515d292 Author: Wu XiangCheng Date: Sat Aug 27 08:18:53 2022 +0800 docs/zh_CN: Update zh_CN/process/submit-checklist.rst to 6.0-rc2 * update to commit 163ba35ff371 ("doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line") Signed-off-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/Ywli7VfhQVPHKiGw@bobwxc.mipc Signed-off-by: Jonathan Corbet commit 363fd2324c3ef9638a5ef42c5e5a2b75a8041d46 Author: Lukasz Luba Date: Tue Aug 16 13:19:07 2022 +0100 docs: scheduler: Update new path for the sysctl knobs Add missing update for the documentation bit of some scheduler knob. The knobs have been moved to /debug/sched/ location (with adjusted names). Signed-off-by: Lukasz Luba Reviewed-by: Alex Shi Tested-by: Yanteng Si Link: https://lore.kernel.org/r/20220816121907.841-1-lukasz.luba@arm.com Signed-off-by: Jonathan Corbet commit 7e94556e26c67138009169cd61959adc12db24b6 Author: Yanteng Si Date: Thu Aug 25 20:53:27 2022 +0800 docs/zh_TW: Remove oops-tracing The English version of oops-tracing has been refactored and has been translated into Chinese. Let's remove them. Signed-off-by: Yanteng Si Acked-by: Wu XiangCheng Link: https://lore.kernel.org/r/0d22733cea474b0a3784f8de6b4bc4841fbaba77.1661431365.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 876d8552fa7c116d93254c61e11596dbcb33c201 Author: Yanteng Si Date: Thu Aug 25 20:53:26 2022 +0800 docs/zh_CN: Remove IRQ and oops-tracing The English version of IRQ has been refactored and the new document (not called that anymore) has been moved to core-api/irq, which has been translated into Chinese. oops-tracing is pretty much the same, let's remove them. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/7dc43c33ea7e2edf668070b203dce83b285f2cdb.1661431365.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 3d8b56d7b10e1ca972330d8892da3f3e9a6346f2 Author: Yanteng Si Date: Thu Aug 25 20:53:25 2022 +0800 docs/zh_CN: Update the translation of io_ordering to 6.0-rc2 Update to commit d1ce350015d8 Documentation: ("Add io_ordering.rst to driver-api manual"). Move ../zh_CN/io_ordering.txt to ../zh_CN/driver-api/io_ordering.rst. Signed-off-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/c66f6d17c509c2c93f2afd30223c4bcf734f8317.1661431365.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 6cf3116d5eeda0284bbedb8610192df31f86cdf0 Author: JunChao Sun Date: Mon Aug 15 05:52:33 2022 -0700 Documentation: ext4: correct the document about superblock The description of s_lastcheck_hi, s_first_error_time_hi, and s_last_error_time_hi fields refer to themselves, while these means referring to upper 8 bits (byte) of corresponding fields (s_lastcheck, s_first_error_time, and s_last_error_time). Correct the mistake. Signed-off-by: JunChao Sun Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220815125233.2040-1-sunjunchao2870@gmail.com Signed-off-by: Jonathan Corbet commit 021904f38baed568bc12b017386740b7a4cff1df Author: Zhao Mengmeng Date: Mon Aug 22 21:36:53 2022 -0400 Documentation: filesystems: xfs: update pseudocode and typo fixes According to the implementation of xfs_trans_roll(), it calls xfs_trans_reserve(), which reserves not only log space, but also free disk blocks. In short, the "transaction stuff". So change xfs_log_reserve() to xfs_trans_reserve(). Besides, fix several typo issues. Signed-off-by: Zhao Mengmeng Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220823013653.203469-1-zhaomzhao@126.com Signed-off-by: Jonathan Corbet commit 78b07714c4ef4f7faeb4e7e57ed0530986ba8c88 Author: Wu XiangCheng Date: Fri Aug 19 09:09:42 2022 +0800 docs/zh_CN: Fix two missing labels in zh_CN/process * Add back still referenced labels in submitting-patches.rst and email-clients.rst. * Fix a typo. Fixes: fdb34b18b959 ("docs/zh_CN: Update zh_CN/process/submitting-patches.rst to 5.19") Fixes: d7aeaebb920f ("docs/zh_CN: Update zh_CN/process/email-clients.rst to 5.19") Signed-off-by: Wu XiangCheng Link: https://lore.kernel.org/r/Yv7i1tYMvK9J/NHj@bobwxc.mipc Signed-off-by: Jonathan Corbet commit 7114fe6f906cdec2d263c1c84cd0cf5f0726652f Author: Wu XiangCheng Date: Tue Aug 2 11:03:40 2022 +0800 docs/zh_CN: Update zh_CN/process/submitting-patches.rst to 5.19 * update to commit 9db370de2780 ("docs: process: remove outdated submitting-drivers.rst") * clean and reconstruct the whole translation Signed-off-by: Wu XiangCheng Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/717baee07920d3cecf09197a10c973dd46089fcb.1659406843.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit df8238629112b8f61f96367f84d5b236051d8c93 Author: Wu XiangCheng Date: Tue Aug 2 11:03:06 2022 +0800 docs/zh_CN: Update zh_CN/process/email-clients.rst to 5.19 * update to commit cbf4adfd4d19 ("Documentation: process: Update email client instructions for Thunderbird") * clean the whole translation Signed-off-by: Wu XiangCheng Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/3a19acf5929357f2702ac1e3538d1a9cc0085cc0.1659406843.git.bobwxc@email.cn Signed-off-by: Jonathan Corbet commit 16b51447b20c24d79b13a4477fdef93dbba123e4 Merge: 93618e5e05a3c 0325cc0ac7980 Author: Mark Brown Date: Tue Sep 27 19:58:57 2022 +0100 Fix PM disable depth imbalance in stm32 probe Merge series from Zhang Qilong : The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced. We fix it by moving pm_runtime_enable to the endding of probe. commit fa8f4a89736b654125fb254b0db753ac68a5fced Author: Steven Rostedt (Google) Date: Tue Sep 27 14:43:17 2022 -0400 ring-buffer: Allow splice to read previous partially read pages If a page is partially read, and then the splice system call is run against the ring buffer, it will always fail to read, no matter how much is in the ring buffer. That's because the code path for a partial read of the page does will fail if the "full" flag is set. The splice system call wants full pages, so if the read of the ring buffer is not yet full, it should return zero, and the splice will block. But if a previous read was done, where the beginning has been consumed, it should still be given to the splice caller if the rest of the page has been written to. This caused the splice command to never consume data in this scenario, and let the ring buffer just fill up and lose events. Link: https://lkml.kernel.org/r/20220927144317.46be6b80@gandalf.local.home Cc: stable@vger.kernel.org Fixes: 8789a9e7df6bf ("ring-buffer: read page interface") Signed-off-by: Steven Rostedt (Google) commit 9d2ce78ddcee159eb6a97449e9c68b6d60b9cec4 Author: Song Liu Date: Mon Sep 26 17:41:46 2022 -0700 ftrace: Fix recursive locking direct_mutex in ftrace_modify_direct_caller Naveen reported recursive locking of direct_mutex with sample ftrace-direct-modify.ko: [ 74.762406] WARNING: possible recursive locking detected [ 74.762887] 6.0.0-rc6+ #33 Not tainted [ 74.763216] -------------------------------------------- [ 74.763672] event-sample-fn/1084 is trying to acquire lock: [ 74.764152] ffffffff86c9d6b0 (direct_mutex){+.+.}-{3:3}, at: \ register_ftrace_function+0x1f/0x180 [ 74.764922] [ 74.764922] but task is already holding lock: [ 74.765421] ffffffff86c9d6b0 (direct_mutex){+.+.}-{3:3}, at: \ modify_ftrace_direct+0x34/0x1f0 [ 74.766142] [ 74.766142] other info that might help us debug this: [ 74.766701] Possible unsafe locking scenario: [ 74.766701] [ 74.767216] CPU0 [ 74.767437] ---- [ 74.767656] lock(direct_mutex); [ 74.767952] lock(direct_mutex); [ 74.768245] [ 74.768245] *** DEADLOCK *** [ 74.768245] [ 74.768750] May be due to missing lock nesting notation [ 74.768750] [ 74.769332] 1 lock held by event-sample-fn/1084: [ 74.769731] #0: ffffffff86c9d6b0 (direct_mutex){+.+.}-{3:3}, at: \ modify_ftrace_direct+0x34/0x1f0 [ 74.770496] [ 74.770496] stack backtrace: [ 74.770884] CPU: 4 PID: 1084 Comm: event-sample-fn Not tainted ... [ 74.771498] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), ... [ 74.772474] Call Trace: [ 74.772696] [ 74.772896] dump_stack_lvl+0x44/0x5b [ 74.773223] __lock_acquire.cold.74+0xac/0x2b7 [ 74.773616] lock_acquire+0xd2/0x310 [ 74.773936] ? register_ftrace_function+0x1f/0x180 [ 74.774357] ? lock_is_held_type+0xd8/0x130 [ 74.774744] ? my_tramp2+0x11/0x11 [ftrace_direct_modify] [ 74.775213] __mutex_lock+0x99/0x1010 [ 74.775536] ? register_ftrace_function+0x1f/0x180 [ 74.775954] ? slab_free_freelist_hook.isra.43+0x115/0x160 [ 74.776424] ? ftrace_set_hash+0x195/0x220 [ 74.776779] ? register_ftrace_function+0x1f/0x180 [ 74.777194] ? kfree+0x3e1/0x440 [ 74.777482] ? my_tramp2+0x11/0x11 [ftrace_direct_modify] [ 74.777941] ? __schedule+0xb40/0xb40 [ 74.778258] ? register_ftrace_function+0x1f/0x180 [ 74.778672] ? my_tramp1+0xf/0xf [ftrace_direct_modify] [ 74.779128] register_ftrace_function+0x1f/0x180 [ 74.779527] ? ftrace_set_filter_ip+0x33/0x70 [ 74.779910] ? __schedule+0xb40/0xb40 [ 74.780231] ? my_tramp1+0xf/0xf [ftrace_direct_modify] [ 74.780678] ? my_tramp2+0x11/0x11 [ftrace_direct_modify] [ 74.781147] ftrace_modify_direct_caller+0x5b/0x90 [ 74.781563] ? 0xffffffffa0201000 [ 74.781859] ? my_tramp1+0xf/0xf [ftrace_direct_modify] [ 74.782309] modify_ftrace_direct+0x1b2/0x1f0 [ 74.782690] ? __schedule+0xb40/0xb40 [ 74.783014] ? simple_thread+0x2a/0xb0 [ftrace_direct_modify] [ 74.783508] ? __schedule+0xb40/0xb40 [ 74.783832] ? my_tramp2+0x11/0x11 [ftrace_direct_modify] [ 74.784294] simple_thread+0x76/0xb0 [ftrace_direct_modify] [ 74.784766] kthread+0xf5/0x120 [ 74.785052] ? kthread_complete_and_exit+0x20/0x20 [ 74.785464] ret_from_fork+0x22/0x30 [ 74.785781] Fix this by using register_ftrace_function_nolock in ftrace_modify_direct_caller. Link: https://lkml.kernel.org/r/20220927004146.1215303-1-song@kernel.org Fixes: 53cd885bc5c3 ("ftrace: Allow IPMODIFY and DIRECT ops on the same function") Reported-and-tested-by: Naveen N. Rao Signed-off-by: Song Liu Signed-off-by: Steven Rostedt (Google) commit 0ce0638edf5ec83343302b884fa208179580700a Author: Zheng Yejian Date: Mon Sep 26 15:20:08 2022 +0000 ftrace: Properly unset FTRACE_HASH_FL_MOD When executing following commands like what document said, but the log "#### all functions enabled ####" was not shown as expect: 1. Set a 'mod' filter: $ echo 'write*:mod:ext3' > /sys/kernel/tracing/set_ftrace_filter 2. Invert above filter: $ echo '!write*:mod:ext3' >> /sys/kernel/tracing/set_ftrace_filter 3. Read the file: $ cat /sys/kernel/tracing/set_ftrace_filter By some debugging, I found that flag FTRACE_HASH_FL_MOD was not unset after inversion like above step 2 and then result of ftrace_hash_empty() is incorrect. Link: https://lkml.kernel.org/r/20220926152008.2239274-1-zhengyejian1@huawei.com Cc: Cc: stable@vger.kernel.org Fixes: 8c08f0d5c6fb ("ftrace: Have cached module filters be an active filter") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit dc399adecd4e2826868e5d116a58e33071b18346 Author: Tao Chen Date: Sat Sep 24 22:13:34 2022 +0800 tracing/eprobe: Fix alloc event dir failed when event name no set The event dir will alloc failed when event name no set, using the command: "echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string" >> dynamic_events" It seems that dir name="syscalls/sys_enter_openat" is not allowed in debugfs. So just use the "sys_enter_openat" as the event name. Link: https://lkml.kernel.org/r/1664028814-45923-1-git-send-email-chentao.kernel@linux.alibaba.com Cc: Ingo Molnar Cc: Tom Zanussi Cc: Linyu Yuan Cc: Tao Chen Signed-off-by: Tao Chen Signed-off-by: Steven Rostedt (Google) commit ae398ad89456847aab9f12b0e63c51443af5da48 Author: Chen Zhongjin Date: Sat Sep 24 15:26:29 2022 +0800 x86: kprobes: Remove unused macro stack_addr An unused macro reported by [-Wunused-macros]. This macro is used to access the sp in pt_regs because at that time x86_32 can only get sp by kernel_stack_pointer(regs). '3c88c692c287 ("x86/stackframe/32: Provide consistent pt_regs")' This commit have unified the pt_regs and from them we can get sp from pt_regs with regs->sp easily. Nowhere is using this macro anymore. Refrencing pt_regs directly is more clear. Remove this macro for code cleaning. Link: https://lkml.kernel.org/r/20220924072629.104759-1-chenzhongjin@huawei.com Signed-off-by: Chen Zhongjin Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 3008119a3dd8052b7e5c07488e20a7abb0d287f2 Author: Gaosheng Cui Date: Fri Sep 23 17:00:12 2022 +0800 ftrace: Remove obsoleted code from ftrace and task_struct The trace of "struct task_struct" was no longer used since commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do"), and the functions about flags for current->trace is useless, so remove them. Link: https://lkml.kernel.org/r/20220923090012.505990-1-cuigaosheng1@huawei.com Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit c0a581d7126c0bbc96163276f585fd7b4e4d8d0e Author: Waiman Long Date: Thu Sep 22 10:56:22 2022 -0400 tracing: Disable interrupt or preemption before acquiring arch_spinlock_t It was found that some tracing functions in kernel/trace/trace.c acquire an arch_spinlock_t with preemption and irqs enabled. An example is the tracing_saved_cmdlines_size_read() function which intermittently causes a "BUG: using smp_processor_id() in preemptible" warning when the LTP read_all_proc test is run. That can be problematic in case preemption happens after acquiring the lock. Add the necessary preemption or interrupt disabling code in the appropriate places before acquiring an arch_spinlock_t. The convention here is to disable preemption for trace_cmdline_lock and interupt for max_lock. Link: https://lkml.kernel.org/r/20220922145622.1744826-1-longman@redhat.com Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Boqun Feng Cc: stable@vger.kernel.org Fixes: a35873a0993b ("tracing: Add conditional snapshot") Fixes: 939c7a4f04fc ("tracing: Introduce saved_cmdlines_size file") Suggested-by: Steven Rostedt Signed-off-by: Waiman Long Signed-off-by: Steven Rostedt (Google) commit 87dbdc230d162bf9ee1ac77c8ade178b6b1e199e Author: Andrii Nakryiko Date: Mon Sep 26 21:29:39 2022 -0700 libbpf: Don't require full struct enum64 in UAPI headers Drop the requirement for system-wide kernel UAPI headers to provide full struct btf_enum64 definition. This is an unexpected requirement that slipped in libbpf 1.0 and put unnecessary pressure ([0]) on users to have a bleeding-edge kernel UAPI header from unreleased Linux 6.0. To achieve this, we forward declare struct btf_enum64. But that's not enough as there is btf_enum64_value() helper that expects to know the layout of struct btf_enum64. So we get a bit creative with reinterpreting memory layout as array of __u32 and accesing lo32/hi32 fields as array elements. Alternative way would be to have a local pointer variable for anonymous struct with exactly the same layout as struct btf_enum64, but that gets us into C++ compiler errors complaining about invalid type casts. So play it safe, if ugly. [0] Closes: https://github.com/libbpf/libbpf/issues/562 Fixes: d90ec262b35b ("libbpf: Add enum64 support for btf_dump") Reported-by: Toke Høiland-Jørgensen Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20220927042940.147185-1-andrii@kernel.org commit 8ffb78f3640e2a5671d34eb61a8f5ef062a6c585 Merge: 320305923c882 1261255531088 Author: Dave Airlie Date: Wed Sep 28 04:23:00 2022 +1000 Merge tag 'exynos-drm-next-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Cleanup - Use drm_display_info.is_hdmi instead of drm_detect_hdmi_monitor() for efficiency. Fixup - Correct return type of mixer_mode_valid and hdmi_mode_valid functions. This was reported by Dan Carpenter, https://github.com/ClangBuiltLinux/linux/issues/1703 Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20220926020723.270065-1-inki.dae@samsung.com commit 6c1193301791d3fcc0ad9ff3b861a8216e00773b Author: Conor Dooley Date: Tue Sep 27 12:19:23 2022 +0100 riscv: dts: microchip: update memory configuration for v2022.10 In the v2022.10 reference design, the seg registers are going to be changed, resulting in a required change to the memory map in Linux. A small 4M reservation is made at the end of 32-bit DDR to provide some memory for the HSS to use, so that it can cache its payload.bin between reboots of a specific context. Signed-off-by: Conor Dooley commit d49166646e44064b694a2e631fcdba4f814746d9 Author: Conor Dooley Date: Tue Sep 27 12:19:22 2022 +0100 riscv: dts: microchip: add a devicetree for aries' m100pfsevp Add device trees for both configs used by the Aries Embedded M100PFSEVP. The M100OFSEVP consists of a MPFS250T on a SOM, featuring: - 2GB DDR4 SDRAM dedicated to the HMS - 512MB DDR4 SDRAM dedicated to the FPGA - 32 MB SPI NOR Flash - 4 GByte eMMC and a carrier board with: - 2x Gigabit Ethernet - USB - 2x UART - 2x CAN - TFT connector - HSMC extension connector - 3x PMOD extension connectors - microSD-card slot Link: https://www.aries-embedded.com/polarfire-soc-fpga-microsemi-m100pfs-som-mpfs025t-pcie-serdes Link: https://www.aries-embedded.com/evaluation-kit/fpga/polarfire-microchip-soc-fpga-m100pfsevp-riscv-hsmc-pmod Link: https://downloads.aries-embedded.de/products/M100PFS/Hardware/M100PFSEVP-Schematics.pdf Co-developed-by: Wolfgang Grandegger Signed-off-by: Wolfgang Grandegger Signed-off-by: Conor Dooley commit 978a17d1a688db025275d282665ab3f39407191d Author: Vattipalli Praveen Date: Tue Sep 27 12:19:21 2022 +0100 riscv: dts: microchip: add sevkit device tree Add a basic dts for the Microchip Smart Embedded Vision dev kit. The SEV kit is an upcoming first party board, featuring an MPFS250T and: - Dual Sony Camera Sensors (IMX334) - IEEE 802.11 b/g/n 20MHz (1x1) Wi-Fi - Bluetooth 5 Low Energy - 4 GB DDR4 x64 - 2 GB LPDDR4 x32 - 1 GB SPI Flash - 8 GB eMMC flash & SD card slot (multiplexed) - HDMI2.0 Video Input/Output - MIPI DSI Output - MIPI CSI-2 Input Link: https://onlinedocs.microchip.com/pr/GUID-404D3738-DC76-46BA-8683-6A77E837C2DD-en-US-1/index.html?GUID-065AEBEE-7B2C-4895-8579-B1D73D797F06 Signed-off-by: Vattipalli Praveen Signed-off-by: Conor Dooley commit fa52935abef422d119dda3c10c02787a86e6289d Author: Conor Dooley Date: Tue Sep 27 12:19:20 2022 +0100 riscv: dts: microchip: reduce the fic3 clock rate For the v2022.09 release of the reference design, the fic3 clock rate been reduced from 62.5 MHz to 50 MHz as it allows timing to be closed significantly more quickly by customers who chose to build the reference design themselves. Signed-off-by: Conor Dooley commit ab291621a8b85269496ae9a964b6d49cd1e030c8 Author: Conor Dooley Date: Tue Sep 27 12:19:19 2022 +0100 riscv: dts: microchip: icicle: re-jig fabric peripheral addresses When users try to add onto the reference design, they find that the current addresses that peripherals connected to Fabric InterConnect (FIC) 3 use are restrictive. For the v2022.09 reference design, the peripherals have been shifted down, leaving more contiguous address space for their custom IP/peripherals. Signed-off-by: Conor Dooley commit 6fc655ed4986f88b91e3f7b339222fc1c4ffba08 Author: Conor Dooley Date: Tue Sep 27 12:19:18 2022 +0100 riscv: dts: microchip: icicle: update pci address properties For the v2022.09 reference design the PCI root port's data region has been moved to FIC1 from FIC0. This is a shorter path, allowing for higher clock rates and improved through-put. As a result, the address at which the PCIe's data region appears to the core complex has changed. The config region's address is unchanged. As FIC0 is no longer used, its clock can be removed too. Signed-off-by: Conor Dooley commit 99d451a7db1624308bc9eb94b7befb3722f67b10 Author: Conor Dooley Date: Tue Sep 27 12:19:17 2022 +0100 riscv: dts: microchip: move the mpfs' pci node to -fabric.dtsi In today's edition of moving things around: The PCIe root port on PolarFire SoC is more part of the FPGA than of the Core Complex. It is located on the other side of the chip and, apart from its interrupts, most of its configuration is determined by the FPGA bitstream rather. This includes: - address translation in both directions - the addresses at which the config and data regions appear to the core complex - the clocks used by the AXI bus - the plic interrupt used Moving the PCIe node to the -fabric.dtsi makes it clearer than a singular configuration for root port is not correct & allows the base SoC dtsi to be more easily included. Signed-off-by: Conor Dooley commit f890e67f292db46c9bd5b5c004ba0f98761d1a33 Author: Conor Dooley Date: Tue Sep 27 12:19:16 2022 +0100 riscv: dts: microchip: add pci dma ranges for the icicle kit The recently removed, accidentally included, "matr0" property was used in place of a dma-ranges property. The PCI controller is non-functional with mainline Linux in the v2022.02 or later reference designs and has not worked without configuration of address-translation since v2021.08. Add the address translation that will be used by the v2022.09 reference design & update the compatible used by the dts. Since this change is not backwards compatible, update the compatible to denote this, jumping over v2022.09 directly to v2022.10. Signed-off-by: Conor Dooley commit db3d481698efe8a7a943ecbba9491648c5a49ef3 Author: Shravan Chippa Date: Tue Sep 27 12:19:15 2022 +0100 dt-bindings: riscv: microchip: document the sev kit Update devicetree bindings document with PolarFire SoC Video Kit, known by its "sev-kit" product code. Link: https://onlinedocs.microchip.com/pr/GUID-404D3738-DC76-46BA-8683-6A77E837C2DD-en-US-1/index.html?GUID-065AEBEE-7B2C-4895-8579-B1D73D797F06 Signed-off-by: Shravan Chippa Reviewed-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley commit 0ebdc51787dbb8ef8d259daa98b8fd35babf8970 Author: Conor Dooley Date: Tue Sep 27 12:19:14 2022 +0100 dt-bindings: riscv: microchip: document the aries m100pfsevp Add a compatible for the Aries Embedded M100PFSEVP SOM + EVK platform. Link: https://www.aries-embedded.com/polarfire-soc-fpga-microsemi-m100pfs-som-mpfs025t-pcie-serdes Signed-off-by: Conor Dooley Acked-by: Rob Herring commit a0d49a8f77f26609036a05e7832393b6279554db Author: Conor Dooley Date: Tue Sep 27 12:19:13 2022 +0100 dt-bindings: riscv: microchip: document icicle reference design The icicle kit reference design's v2022.09 release made some changes to the memory map - including adding the ability to read the fabric clock controllers via the system controller bus & making the PCI controller work with upstream Linux. While the PCI was not working in the v2022.03 design, so nothing is broken there in terms of backwards compatibility, the fabric clocks used in the v2022.03 design were chosen by the individual run of the synthesis tool. In the v2022.09 reference design, the clocks are fixed to use the "north west" fabric Clock Conditioning Circuitry. In the v2022.10 release, the memory map on the DDR side is also changing, so to avoid making a breaking change here twice, jump over the v2022.09 release and straight to the v2022.10 one. Make use of a new compatible to denote that v2022.{09,10} reference design releases are not backwards compatible. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley commit 5765033cf77c54897848df683420bb62b6cc3d05 Author: Christoph Hellwig Date: Tue Sep 27 08:54:25 2022 +0200 blk-cgroup: don't update the blkg lookup hint in blkg_conf_prep blkg_conf_prep just creates a new blkg structure, there is no real need to update the lookup hint which should only be done on a successful lookup in the I/O path. Suggested-by: Tejun Heo Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220927065425.257876-1-hch@lst.de Signed-off-by: Jens Axboe commit 45eb009f8d1d3cc38de9c3b5be20301a2aa9cec0 Author: José Expósito Date: Mon Sep 26 10:08:37 2022 +0200 drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_gray8() Extend the existing test cases to test the conversion from XRGB8888 to grayscale. Tested-by: Maíra Canal Reviewed-by: David Gow Acked-by: Maxime Ripard Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220926080837.65734-4-jose.exposito89@gmail.com commit 453114319699b6bec2f2ab9bd87617ba25f6215e Author: José Expósito Date: Mon Sep 26 10:08:36 2022 +0200 drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_xrgb2101010() Extend the existing test cases to test the conversion from XRGB8888 to XRGB2101010. In order to be able to call drm_fb_xrgb8888_to_xrgb2101010() when compiling CONFIG_DRM_KMS_HELPER as a module export the symbol. Tested-by: Maíra Canal Reviewed-by: David Gow Acked-by: Maxime Ripard Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220926080837.65734-3-jose.exposito89@gmail.com commit f3f716ae5d827fbbdf994c9d5b05d05fe33c8ced Author: José Expósito Date: Mon Sep 26 10:08:35 2022 +0200 drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb888() Extend the existing test cases to test the conversion from XRGB8888 to RGB888. Tested-by: Maíra Canal Reviewed-by: David Gow Acked-by: Maxime Ripard Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220926080837.65734-2-jose.exposito89@gmail.com commit cc71271f5b793d619f8a7d2ef905374102533c75 Author: Xiu Jianfeng Date: Thu Sep 8 18:35:43 2022 +0800 smack: cleanup obsolete mount option flags These mount option flags are obsolete since commit 12085b14a444 ("smack: switch to private smack_mnt_opts"), remove them. Signed-off-by: Xiu Jianfeng Signed-off-by: Casey Schaufler commit d3f84f5c9627576b555976c7584514a2ca3ed02e Author: Xu Panda Date: Mon Sep 12 10:05:36 2022 +0000 smack: lsm: remove the unneeded result variable Return the value smk_ptrace_rule_check() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Xu Panda Signed-off-by: Casey Schaufler commit 4ca165fc6c49c3b0100f61524ffbca4743d46e8d Author: Lontke Michael Date: Wed Aug 31 14:03:26 2022 +0200 SMACK: Add sk_clone_security LSM hook Using smk_of_current() during sk_alloc_security hook leads in rare cases to a faulty initialization of the security context of the created socket. By adding the LSM hook sk_clone_security to SMACK this initialization fault is corrected by copying the security context of the old socket pointer to the newly cloned one. Co-authored-by: Martin Ostertag: Signed-off-by: Lontke Michael Signed-off-by: Casey Schaufler commit 93618e5e05a3ce4aa6750268c5025bdb4cb7dc6e Author: Zhang Qilong Date: Tue Sep 27 22:26:40 2022 +0800 ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of stm32_i2s_probe. Fixes:32a956a1fadf ("ASoC: stm32: i2s: add pm_runtime support") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142640.64647-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 0325cc0ac7980e1c7b744aab8df59afab6daeb43 Author: Zhang Qilong Date: Tue Sep 27 22:26:01 2022 +0800 ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of stm32_spdifrx_probe. Fixes:ac5e3efd55868 ("ASoC: stm32: spdifrx: add pm_runtime support") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142601.64266-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit b9a0da5b2edcae2a901b85c8cc42efc5bec4bd7b Author: Zhang Qilong Date: Tue Sep 27 22:26:00 2022 +0800 ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of stm32_adfsdm_probe. Fixes:98e500a12f934 ("ASoC: stm32: dfsdm: add pm_runtime support for audio") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142601.64266-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit e55d937d8cf391c1fb9afad296948b3697ad96f7 Author: Bjorn Andersson Date: Mon Sep 26 10:30:25 2022 -0700 clk: qcom: Add SC8280XP GPU clock controller Add driver for the GPU clock controller in the Qualcomm SC8280XP platform. Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio [bjorn: Included kernel.h and lower-cased hex numbers] Signed-off-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220926173025.4747-3-quic_bjorande@quicinc.com commit 9f60eb3ec02757ab9441f2463eceddf2c71ec5e3 Author: Bjorn Andersson Date: Mon Sep 26 10:30:24 2022 -0700 dt-bindings: clock: Add Qualcomm SC8280XP GPU binding Add compatible for the Qualcomm SC8280XP GPU. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220926173025.4747-2-quic_bjorande@quicinc.com commit 644c4229559257cadc4267fc36c2dc22ee9c040f Author: Konrad Dybcio Date: Wed Sep 21 02:44:58 2022 +0200 clk: qcom: smd: Add SM6375 clocks Add support for controlling SMD RPM clocks on SM6375. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921004458.151842-3-konrad.dybcio@somainline.org commit 65cfaf4eface0a347f62187b52eeb84f635b6be0 Author: Konrad Dybcio Date: Wed Sep 21 02:44:57 2022 +0200 dt-bindings: clock: qcom: rpmcc: Add BIMC_FREQ_LOG Add the missing definition for the aforementioned clock. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921004458.151842-2-konrad.dybcio@somainline.org commit de55ec3b3af0db790948906b0e41f468fcfa9f98 Author: Konrad Dybcio Date: Wed Sep 21 02:44:56 2022 +0200 dt-bindings: clock: qcom,rpmcc: Add compatible for SM6375 Add a compatible for RPMCC on SM6375. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220921004458.151842-1-konrad.dybcio@somainline.org commit 84fe64f898913ef69f70a8d91aea613b5722b63b Author: Christoph Hellwig Date: Tue Sep 27 10:26:26 2022 +0200 nvmet: don't look at the request_queue in nvmet_bdev_set_limits nvmet is a consumer of the block layer and should not directly look at the request_queue. Use the bdev_ helpers to retrieve the device limits instead. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch commit 8df20252c06046ef4c68107bcaaca56c21028d8c Author: Christoph Hellwig Date: Tue Sep 27 10:24:07 2022 +0200 nvmet: don't look at the request_queue in nvmet_bdev_zone_mgmt_emulate_all nvmet is a consumer of the block layer and should not directly look at the request_queue. Just use the NUMA node ID from the gendisk instead of the request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch commit 2ded040cedf830c698c04ee79d436bd23014811a Author: Richard Acayan Date: Tue Sep 20 18:37:34 2022 -0400 clk: qcom: rpmhcc: add sdm670 clocks The Snapdragon 670 uses the RPMh mailbox for most of the clocks used in SDM845 but omits two. Add clock data for SDM670 so the driver doesn't fail to resolve a clock. Link: https://android.googlesource.com/kernel/msm/+/443bd8d6e2cf54698234c752e6de97b4b8a528bd%5E%21/#F7 Signed-off-by: Richard Acayan Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920223734.151135-3-mailingradian@gmail.com commit c6648a402ced29ef826055583a96dcc85d9d3f55 Author: Richard Acayan Date: Tue Sep 20 18:37:33 2022 -0400 dt-bindings: clock: add rpmhcc bindings for sdm670 The Snapdragon 670 uses the RPMh mailbox for some clocks. Document its support. Signed-off-by: Richard Acayan Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220920223734.151135-2-mailingradian@gmail.com commit 9dedc915937c33302df7fcab01c45e7936d6195a Author: zhang songyi Date: Tue Sep 27 08:56:06 2022 -0700 Input: synaptics-rmi4 - convert to use sysfs_emit() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Reported-by: Zeal Robot Signed-off-by: zhang songyi Link: https://lore.kernel.org/r/20220927070936.258300-1-zhang.songyi@zte.com.cn Signed-off-by: Dmitry Torokhov commit 8237c01f1696bc53c470493bf1fe092a107648a6 Author: Keith Busch Date: Tue Sep 27 08:56:52 2022 -0700 blk-mq: use quiesced elevator switch when reinitializing queues The hctx's run_work may be racing with the elevator switch when reinitializing hardware queues. The queue is merely frozen in this context, but that only prevents requests from allocating and doesn't stop the hctx work from running. The work may get an elevator pointer that's being torn down, and can result in use-after-free errors and kernel panics (example below). Use the quiesced elevator switch instead, and make the previous one static since it is now only used locally. nvme nvme0: resetting controller nvme nvme0: 32/0/0 default/read/poll queues BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 80000020c8861067 P4D 80000020c8861067 PUD 250f8c8067 PMD 0 Oops: 0000 [#1] SMP PTI Workqueue: kblockd blk_mq_run_work_fn RIP: 0010:kyber_has_work+0x29/0x70 ... Call Trace: __blk_mq_do_dispatch_sched+0x83/0x2b0 __blk_mq_sched_dispatch_requests+0x12e/0x170 blk_mq_sched_dispatch_requests+0x30/0x60 __blk_mq_run_hw_queue+0x2b/0x50 process_one_work+0x1ef/0x380 worker_thread+0x2d/0x3e0 Signed-off-by: Keith Busch Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220927155652.3260724-1-kbusch@fb.com Signed-off-by: Jens Axboe commit 568ec936bf1384fc15873908c96a9aeb62536edb Author: Christoph Hellwig Date: Tue Sep 27 09:58:15 2022 +0200 block: replace blk_queue_nowait with bdev_nowait Replace blk_queue_nowait with a bdev_nowait helpers that takes the block_device given that the I/O submission path should not have to look into the request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Raghav Link: https://lore.kernel.org/r/20220927075815.269694-1-hch@lst.de Signed-off-by: Jens Axboe commit 2b7672b0fa0b833312aef5a366a741921af3634f Author: Dmitry Torokhov Date: Tue Sep 27 08:42:36 2022 -0700 Input: twl4030-pwrbutton - add missing of.h include The driver is using of_match_ptr() and therefore needs to include of.h header. Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220927052217.2784593-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit b6acf807351781c3c3810df7873b3f0d793d59b2 Author: Rob Herring Date: Thu Jun 30 15:37:22 2022 -0600 dt: Add a check for undocumented compatible strings in kernel Add a make target, dt_compatible_check, to extract compatible strings from kernel sources and check if they are documented by a schema. At least version v2022.08 of dtschema with dt-check-compatible is required. This check can also be run manually on specific files or directories: scripts/dtc/dt-extract-compatibles drivers/clk/ | \ xargs dt-check-compatible -v -s Documentation/devicetree/bindings/processed-schema.json Currently, there are about 3800 undocumented compatible strings. Most of these are cases where the binding is not yet converted (given there are 1900 .txt binding files remaining). Link: https://lore.kernel.org/all/20220916012510.2718170-1-robh@kernel.org/ Signed-off-by: Rob Herring commit 42e1d1eed20a17c6cbb1d600c77a6ca69a632d4c Author: Longfang Liu Date: Mon Sep 26 17:33:32 2022 +0800 hisi_acc_vfio_pci: Update some log and comment formats 1. Modify some annotation information formats to keep the entire driver annotation format consistent. 2. Modify some log description formats to be consistent with the format of the entire driver log. Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20220926093332.28824-6-liulongfang@huawei.com Signed-off-by: Alex Williamson commit 3b7cfba0d873e8a26ac4ec5848dcb7c93098cfab Author: Longfang Liu Date: Mon Sep 26 17:33:31 2022 +0800 hisi_acc_vfio_pci: Remove useless macro definitions The QM_QUE_ISO_CFG macro definition is no longer used and needs to be deleted from the current driver. Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20220926093332.28824-5-liulongfang@huawei.com Signed-off-by: Alex Williamson commit af72f53c1b4e9614448b5d4e7b39d30d3339e3f7 Author: Longfang Liu Date: Mon Sep 26 17:33:30 2022 +0800 hisi_acc_vfio_pci: Remove useless function parameter Remove unused function parameters for vf_qm_fun_reset() and ensure the device is enabled before the reset operation is performed. Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20220926093332.28824-4-liulongfang@huawei.com Signed-off-by: Alex Williamson commit 008e5e996f425f64c21755ebe77201895bbee3b8 Author: Longfang Liu Date: Mon Sep 26 17:33:29 2022 +0800 hisi_acc_vfio_pci: Fix device data address combination problem The queue address of the accelerator device should be combined into a dma address in a way of combining the low and high bits. The previous combination is wrong and needs to be modified. Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20220926093332.28824-3-liulongfang@huawei.com Signed-off-by: Alex Williamson commit 948f5ada58b552d975d1937a3f5939414f28cacb Author: Longfang Liu Date: Mon Sep 26 17:33:28 2022 +0800 hisi_acc_vfio_pci: Fixes error return code issue During the process of compatibility and matching of live migration device information, if the isolation status of the two devices is inconsistent, the live migration needs to be exited. The current driver does not return the error code correctly and needs to be fixed. Reviewed-by: Shameer Kolothum Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20220926093332.28824-2-liulongfang@huawei.com Signed-off-by: Alex Williamson commit 2f24fe8c54cc8d7e3432c17988ded0fffb192c1f Author: Sean Hong Date: Tue Sep 27 14:35:24 2022 +0800 drm/panel-edp: Add BOE NT116WHM-N4C (HW: V8.1) Add support for the BOE - NT116WHM-N4C (HW: V8.1) panel. Signed-off-by: Sean Hong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220927063524.493591-1-sean.hong@quanta.corp-partner.google.com commit d7c6ea024c08bbdb799768f51ffd9fdd6236d190 Author: Dmitry Baryshkov Date: Thu Sep 15 14:44:22 2022 +0300 kbuild: take into account DT_SCHEMA_FILES changes while checking dtbs It is useful to be able to recheck dtbs files against a limited set of DT schema files. This can be accomplished by using differnt DT_SCHEMA_FILES argument values while rerunning make dtbs_check. However for some reason if_changed_rule doesn't pick up the rule_dtc changes (and doesn't retrigger the build). Fix this by changing if_changed_rule to if_changed_dep and squashing DTC and dt-validate into a single new command. Then if_changed_dep triggers on DT_SCHEMA_FILES changes and reruns the build/check. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220915114422.79378-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Herring commit 43113fd4c5f562b47da68927b9ec2369e1e76358 Author: Sean Hong Date: Tue Sep 27 10:18:35 2022 +0800 drm/panel-edp: Fix delays for INX N116BCA-EA2 (HW: C1) This panel has the same delay timing as N116BCA-EA1. So, fix the delay timing from delay_200_500_p2e80 to delay_200_500_e80_d50. Fixes: c7bcc1056cff ("drm/panel-edp: Add INX N116BCA-EA2") Signed-off-by: Sean Hong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220927021835.488803-1-sean.hong@quanta.corp-partner.google.com commit 8397d2984528b838bd4a04af3173049426d2ba28 Author: Sean Hong Date: Tue Sep 27 10:10:21 2022 +0800 drm/panel-edp: Fix delays for INX N116BCN-EA1 (HW: C4) This panel has the same delay timing as N116BCA-EA1. So, fix the delay timing from delay_200_500_p2e80 to delay_200_500_e80_d50. Fixes: 9f4a57148120 ("drm/panel-edp: Add INX N116BCN-EA1") Signed-off-by: Sean Hong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220927021021.488295-1-sean.hong@quanta.corp-partner.google.com commit 1a5486b3c3517aa1f608a10003ade4da122cb175 Author: Nicholas Piggin Date: Thu Sep 8 23:25:44 2022 +1000 KVM: PPC: Book3S HV P9: Restore stolen time logging in dtl Stolen time logging in dtl was removed from the P9 path, so guests had no stolen time accounting. Add it back in a simpler way that still avoids locks and per-core accounting code. Fixes: ecb6a7207f92 ("KVM: PPC: Book3S HV P9: Remove most of the vcore logic") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908132545.4085849-4-npiggin@gmail.com commit b31bc24a49037aad7aa00d2b0354e9704d8134dc Author: Nicholas Piggin Date: Thu Sep 8 23:25:43 2022 +1000 KVM: PPC: Book3S HV: Update guest state entry/exit accounting to new API Update the guest state and timing entry/exit accounting to use the new API, which was introduced following issues found[1]. KVM HV does possibly call instrumented code inside the guest context, and it does call srcu inside the guest context which is fragile at best. Switch to the new API, moving the guest context inside the srcu_read_lock/unlock region. [1] https://lore.kernel.org/lkml/20220201132926.3301912-1-mark.rutland@arm.com/ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908132545.4085849-3-npiggin@gmail.com commit c953f7500b65f2b157d1eb468ca8b86328834cce Author: Nicholas Piggin Date: Thu Sep 8 23:25:42 2022 +1000 KVM: PPC: Book3S HV P9: Fix irq disabling in tick accounting kvmhv_run_single_vcpu() disables PMIs as well as Linux irqs, however the tick time accounting code enables and disables irqs and not PMIs within this region. By chance this might not actually cause a bug, but it is clearly an incorrect use of the APIs. Fixes: 2251fbe76395e ("KVM: PPC: Book3S HV P9: Improve mtmsrd scheduling by delaying MSR[EE] disable") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908132545.4085849-2-npiggin@gmail.com commit bc91c04bfff7cdf676011b97bb21b2861d7b21c9 Author: Nicholas Piggin Date: Thu Sep 8 23:25:41 2022 +1000 KVM: PPC: Book3S HV P9: Clear vcpu cpu fields before enabling host irqs On guest entry, vcpu->cpu and vcpu->arch.thread_cpu are set after disabling host irqs. On guest exit there is a window whre tick time accounting briefly enables irqs before these fields are cleared. Move them up to ensure they are cleared before host irqs are run. This is possibly not a problem, but is more symmetric and makes the fields less surprising. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220908132545.4085849-1-npiggin@gmail.com commit 0a5bfb824a6ea35e54b7e5ac6f881beea5e309d2 Author: Fabiano Rosas Date: Tue Aug 16 19:25:17 2022 -0300 KVM: PPC: Book3S HV: Fix decrementer migration We used to have a workaround[1] for a hang during migration that was made ineffective when we converted the decrementer expiry to be relative to guest timebase. The point of the workaround was that in the absence of an explicit decrementer expiry value provided by userspace during migration, KVM needs to initialize dec_expires to a value that will result in an expired decrementer after subtracting the current guest timebase. That stops the vcpu from hanging after migration due to a decrementer that's too large. If the dec_expires is now relative to guest timebase, its initialization needs to be guest timebase-relative as well, otherwise we end up with a decrementer expiry that is still larger than the guest timebase. 1- https://git.kernel.org/torvalds/c/5855564c8ab2 Fixes: 3c1a4322bba7 ("KVM: PPC: Book3S HV: Change dec_expires to be relative to guest timebase") Signed-off-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220816222517.1916391-1-farosas@linux.ibm.com commit ca5f21b2574903a7430fcb3590e534d92b2fa816 Author: Jason Gunthorpe Date: Thu Sep 22 21:06:10 2022 -0300 vfio: Follow a strict lifetime for struct iommu_group The iommu_group comes from the struct device that a driver has been bound to and then created a struct vfio_device against. To keep the iommu layer sane we want to have a simple rule that only an attached driver should be using the iommu API. Particularly only an attached driver should hold ownership. In VFIO's case since it uses the group APIs and it shares between different drivers it is a bit more complicated, but the principle still holds. Solve this by waiting for all users of the vfio_group to stop before allowing vfio_unregister_group_dev() to complete. This is done with a new completion to know when the users go away and an additional refcount to keep track of how many device drivers are sharing the vfio group. The last driver to be unregistered will clean up the group. This solves crashes in the S390 iommu driver that come because VFIO ends up racing releasing ownership (which attaches the default iommu_domain to the device) with the removal of that same device from the iommu driver. This is a side case that iommu drivers should not have to cope with. iommu driver failed to attach the default/blocking domain WARNING: CPU: 0 PID: 5082 at drivers/iommu/iommu.c:1961 iommu_detach_group+0x6c/0x80 Modules linked in: macvtap macvlan tap vfio_pci vfio_pci_core irqbypass vfio_virqfd kvm nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink mlx5_ib sunrpc ib_uverbs ism smc uvdevice ib_core s390_trng eadm_sch tape_3590 tape tape_class vfio_ccw mdev vfio_iommu_type1 vfio zcrypt_cex4 sch_fq_codel configfs ghash_s390 prng chacha_s390 libchacha aes_s390 mlx5_core des_s390 libdes sha3_512_s390 nvme sha3_256_s390 sha512_s390 sha256_s390 sha1_s390 sha_common nvme_core zfcp scsi_transport_fc pkey zcrypt rng_core autofs4 CPU: 0 PID: 5082 Comm: qemu-system-s39 Tainted: G W 6.0.0-rc3 #5 Hardware name: IBM 3931 A01 782 (LPAR) Krnl PSW : 0704c00180000000 000000095bb10d28 (iommu_detach_group+0x70/0x80) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3 Krnl GPRS: 0000000000000001 0000000900000027 0000000000000039 000000095c97ffe0 00000000fffeffff 00000009fc290000 00000000af1fda50 00000000af590b58 00000000af1fdaf0 0000000135c7a320 0000000135e52258 0000000135e52200 00000000a29e8000 00000000af590b40 000000095bb10d24 0000038004b13c98 Krnl Code: 000000095bb10d18: c020003d56fc larl %r2,000000095c2bbb10 000000095bb10d1e: c0e50019d901 brasl %r14,000000095be4bf20 #000000095bb10d24: af000000 mc 0,0 >000000095bb10d28: b904002a lgr %r2,%r10 000000095bb10d2c: ebaff0a00004 lmg %r10,%r15,160(%r15) 000000095bb10d32: c0f4001aa867 brcl 15,000000095be65e00 000000095bb10d38: c004002168e0 brcl 0,000000095bf3def8 000000095bb10d3e: eb6ff0480024 stmg %r6,%r15,72(%r15) Call Trace: [<000000095bb10d28>] iommu_detach_group+0x70/0x80 ([<000000095bb10d24>] iommu_detach_group+0x6c/0x80) [<000003ff80243b0e>] vfio_iommu_type1_detach_group+0x136/0x6c8 [vfio_iommu_type1] [<000003ff80137780>] __vfio_group_unset_container+0x58/0x158 [vfio] [<000003ff80138a16>] vfio_group_fops_unl_ioctl+0x1b6/0x210 [vfio] pci 0004:00:00.0: Removing from iommu group 4 [<000000095b5b62e8>] __s390x_sys_ioctl+0xc0/0x100 [<000000095be5d3b4>] __do_syscall+0x1d4/0x200 [<000000095be6c072>] system_call+0x82/0xb0 Last Breaking-Event-Address: [<000000095be4bf80>] __warn_printk+0x60/0x68 It indicates that domain->ops->attach_dev() failed because the driver has already passed the point of destructing the device. Fixes: 9ac8545199a1 ("iommu: Fix use-after-free in iommu_release_device") Reported-by: Matthew Rosato Tested-by: Matthew Rosato Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v2-a3c5f4429e2a+55-iommu_group_lifetime_jgg@nvidia.com Signed-off-by: Alex Williamson commit 7bcd9683e51575c72c9289c05213150245d1c186 Author: Pavel Begunkov Date: Mon Sep 26 11:35:36 2022 +0100 selftests/net: enable io_uring sendzc testing d8b6171bd58a5 ("selftests/io_uring: test zerocopy send") added io_uring zerocopy tests but forgot to enable it in make runs. Add missing io_uring_zerocopy_tx.sh into TEST_PROGS. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/28e743602cdd54ffc49f68bbcbcbafc59ba22dc2.1664142210.git.asml.silence@gmail.com Signed-off-by: Jakub Kicinski commit 9257f69273748635d5cb269ffac59d36db37bcde Merge: 73dfe93ea1b31 1fd7c08286cec Author: Jakub Kicinski Date: Tue Sep 27 07:54:48 2022 -0700 Merge branch 'devlink-fix-order-of-port-and-netdev-register-in-drivers' Jiri Pirko says: ==================== devlink: fix order of port and netdev register in drivers Some of the drivers use wrong order in registering devlink port and netdev, registering netdev first. That was not intended as the devlink port is some sort of parent for the netdev. Fix the ordering. Note that the follow-up patchset is going to make this ordering mandatory. ==================== Link: https://lore.kernel.org/r/20220926110938.2800005-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 1fd7c08286cec1805427ed0569ca08e24ade6702 Author: Jiri Pirko Date: Mon Sep 26 13:09:38 2022 +0200 ionic: change order of devlink port register and netdev register Make sure that devlink port is registered first and register netdev after. Unregister netdev before devlnk port unregister. Signed-off-by: Jiri Pirko Acked-by: Shannon Nelson Signed-off-by: Jakub Kicinski commit a286ba73871411b8615eb52e9de1dd8c5078ed3d Author: Jiri Pirko Date: Mon Sep 26 13:09:37 2022 +0200 ice: reorder PF/representor devlink port register/unregister flows Make sure that netdevice is registered/unregistered while devlink port is registered. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit dfe60949147627f22ec67084af09b3c460339dd0 Author: Jiri Pirko Date: Mon Sep 26 13:09:36 2022 +0200 funeth: unregister devlink port after netdevice unregister Fix the order of destroy_netdev() flow and unregister the devlink port after calling unregister_netdev(). Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 73dfe93ea1b319482e6d82a54fe06f953ceeeccb Author: Christophe JAILLET Date: Thu Sep 22 20:41:40 2022 +0200 headers: Remove some left-over license text Remove some left-over from commit e2be04c7f995 ("License cleanup: add SPDX license identifier to uapi header files with a license") When the SPDX-License-Identifier tag has been added, the corresponding license text has not been removed. Signed-off-by: Christophe JAILLET Acked-by: Alexander Duyck Reviewed-by: Jiri Pirko Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/88410cddd31197ea26840d7dd71612bece8c6acf.1663871981.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit de4feb4e3d61026f81b15ada6f64deaf40125ffc Author: Kees Cook Date: Fri Sep 23 21:08:35 2022 -0700 NFC: hci: Split memcpy() of struct hcp_message flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. This split already existed for the "firstfrag" case, so just generalize the logic further. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/ Cc: Eric Dumazet Cc: Paolo Abeni Reported-by: "Gustavo A. R. Silva" Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220924040835.3364912-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 454b20e19322e6a9375cbaad68fff3c93bd27716 Author: Daniel Golle Date: Sun Sep 25 15:48:43 2022 +0100 net: ethernet: mtk_eth_soc: fix usage of foe_entry_size As sizeof(hwe->data) can now longer be used as the actual size depends on foe_entry_size, in commit 9d8cb4c096ab02 ("net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc") the use of sizeof(hwe->data) is hence replaced. However, replacing it with ppe->eth->soc->foe_entry_size is wrong as foe_entry_size represents the size of the whole descriptor and not just the 'data' field. Fix this by subtracing the size of the only other field in the struct 'ib1', so we actually end up with the correct size to be copied to the data field. Reported-by: Chen Minqiang Fixes: 9d8cb4c096ab02 ("net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc") Signed-off-by: Daniel Golle Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/YzBqPIgQR2gLrPoK@makrotopia.org Signed-off-by: Jakub Kicinski commit fb7da771bc43d004bc150101a12a2b245b3ba6dc Author: Daniel Golle Date: Sun Sep 25 15:47:20 2022 +0100 net: ethernet: mtk_eth_soc: fix wrong use of new helper function In function mtk_foe_entry_set_vlan() the call to field accessor macro FIELD_GET(MTK_FOE_IB1_BIND_VLAN_LAYER, entry->ib1) has been wrongly replaced by mtk_prep_ib1_vlan_layer(eth, entry->ib1) Use correct helper function mtk_get_ib1_vlan_layer instead. Reported-by: Chen Minqiang Fixes: 03a3180e5c09e1 ("net: ethernet: mtk_eth_soc: introduce flow offloading support for mt7986") Signed-off-by: Daniel Golle Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/YzBp+Kk04CFDys4L@makrotopia.org Signed-off-by: Jakub Kicinski commit 987f20a9dcce3989e48d87cff3952c095c994445 Author: Eric W. Biederman Date: Mon Sep 26 17:15:32 2022 -0500 a.out: Remove the a.out implementation In commit 19e8b701e258 ("a.out: Stop building a.out/osf1 support on alpha and m68k") the last users of a.out were disabled. As nothing has turned up to cause this change to be reverted, let's remove the code implementing a.out support as well. There may be userspace users of the uapi bits left so the uapi headers have been left untouched. Signed-off-by: "Eric W. Biederman" Acked-by: Arnd Bergmann # arm defconfigs Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/871qrx3hq3.fsf@email.froward.int.ebiederm.org commit 4e3d731ba79e9d1bcbda668be7c3865dd02fddeb Author: Shyam Sundar S K Date: Tue Sep 27 19:26:12 2022 +0530 platform/x86/intel/wmi: thunderbolt: Use dev_groups callback Use .dev_groups callback instead of manual sysfs registration. Remove .probe and .remove callbacks as they become dummy after using .dev_groups. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220927135612.1602491-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 2702c789996d9001cb60ef1dac055aca84d3c51a Author: Yauheni Kaliuta Date: Mon Sep 26 12:23:20 2022 +0300 selftests/bpf: Fix passing arguments via function in test_kmod.sh Since the tests are run in a function $@ there actually contains the function arguments, not the script ones. Pass "$@" to the function as well. Fixes: 272d1f4cfa3c ("selftests: bpf: test_kmod.sh: Pass parameters to the module") Signed-off-by: Yauheni Kaliuta Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220926092320.564631-1-ykaliuta@redhat.com commit cbdae01d8b517b81ed271981395fee8ebd08ba7d Author: Shang XiaoJing Date: Tue Sep 27 10:29:19 2022 +0800 IB/hfi1: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Drop the tmp variable that is not needed any more. Link: https://lore.kernel.org/r/20220927022919.16902-1-shangxiaojing@huawei.com Signed-off-by: Shang XiaoJing Reviewed-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b37fe34c83099ba5105115f8287c5546af1f0a05 Author: Shyam Sundar S K Date: Thu Sep 22 23:26:08 2022 +0530 platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks Since linux/debugfs.h already has the stubs for the used debugfs functions when debugfs is not enabled, remove the #ifdef CONFIG_DEBUG_FS checks. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220922175608.630046-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f0588567976edcb6a7f6f20a9126b40e4d2da818 Author: Guofeng Yue Date: Thu Sep 22 20:33:15 2022 +0800 RDMA/hns: Unified Log Printing Style The first letter of the log information is changed to lowercase to keep the same style. Link: https://lore.kernel.org/r/20220922123315.3732205-13-xuhaoyue1@hisilicon.com Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 8c581c47b9ba064cc3c3ad399081c202b0b0bf78 Author: Yixing Liu Date: Thu Sep 22 20:33:14 2022 +0800 RDMA/hns: Replacing magic number with macros in apply_func_caps() Replacing magic number with macros in function apply_func_caps(). Link: https://lore.kernel.org/r/20220922123315.3732205-12-xuhaoyue1@hisilicon.com Signed-off-by: Yixing Liu Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 3b1f864c904915b3baebffb31ea05ee704b0df3c Author: Luoyouming Date: Thu Sep 22 20:33:13 2022 +0800 RDMA/hns: Repacing 'dseg_len' by macros in fill_ext_sge_inl_data() The sge size is known to be constant, so it's unnecessary to use sizeof to calculate. Link: https://lore.kernel.org/r/20220922123315.3732205-11-xuhaoyue1@hisilicon.com Signed-off-by: Luoyouming Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 6649b4a1c43c6ad153c3ff0c1754a436aa6b6390 Author: Yangyang Li Date: Thu Sep 22 20:33:12 2022 +0800 RDMA/hns: Remove redundant 'max_srq_desc_sz' in caps The max_srq_desc_sz is defined in the code, but never used, so delete this redundant variable. Link: https://lore.kernel.org/r/20220922123315.3732205-10-xuhaoyue1@hisilicon.com Signed-off-by: Yangyang Li Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 5436272c8cf4eb420fdb3926ec07560051c8fd11 Author: Yangyang Li Date: Thu Sep 22 20:33:11 2022 +0800 RDMA/hns: Remove redundant 'num_mtt_segs' and 'max_extend_sg' The num_mtt_segs and max_extend_sg used to be used for HIP06, remove them since the HIP06 code has been removed. Link: https://lore.kernel.org/r/20220922123315.3732205-9-xuhaoyue1@hisilicon.com Signed-off-by: Yangyang Li Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 5f652387c5423a82453c5cb446a88834bf41a94b Author: Chengchang Tang Date: Thu Sep 22 20:33:10 2022 +0800 RDMA/hns: Remove redundant 'phy_addr' in hns_roce_hem_list_find_mtt() This parameter has never been used. Remove it to simplify the function. Link: https://lore.kernel.org/r/20220922123315.3732205-8-xuhaoyue1@hisilicon.com Signed-off-by: Chengchang Tang Signed-off-by: Yunsheng Lin Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 29dc063596772368aa896f293f5c5aef06381712 Author: Yunsheng Lin Date: Thu Sep 22 20:33:09 2022 +0800 RDMA/hns: Remove redundant 'use_lowmem' argument from hns_roce_init_hem_table() As hns_roce_init_hem_table() is always called with use_lowmem being '1', and table->lowmem is set according to that argument, so remove table->lowmem too. Also, as the table->lowmem is used to indicate a dma buffer is allocated with GFP_HIGHUSER or GFP_KERNEL, and calling dma_alloc_coherent() with GFP_KERNEL seems like a common pattern. Link: https://lore.kernel.org/r/20220922123315.3732205-7-xuhaoyue1@hisilicon.com Signed-off-by: Yunsheng Lin Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit be1eeb667eb748391b1c8158678fe4d892187793 Author: Yunsheng Lin Date: Thu Sep 22 20:33:08 2022 +0800 RDMA/hns: Remove redundant 'bt_level' for hem_list_alloc_item() The 'bt_level' parameter is not used in hem_list_alloc_item(), so remove it. Link: https://lore.kernel.org/r/20220922123315.3732205-6-xuhaoyue1@hisilicon.com Signed-off-by: Yunsheng Lin Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit bb4874af19686019d0dafd58726ed7b4058663ca Author: Yixing Liu Date: Thu Sep 22 20:33:07 2022 +0800 RDMA/hns: Remove redundant 'attr_mask' in modify_qp_init_to_init() The attr_mask variable is not used in the function, so remove it. Link: https://lore.kernel.org/r/20220922123315.3732205-5-xuhaoyue1@hisilicon.com Signed-off-by: Yixing Liu Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 064fd299a70bae37a3c4d49ad6eb1766e57e4c24 Author: Guofeng Yue Date: Thu Sep 22 20:33:06 2022 +0800 RDMA/hns: Remove unnecessary brackets when getting point Delete () when using & to obtain an address. Link: https://lore.kernel.org/r/20220922123315.3732205-4-xuhaoyue1@hisilicon.com Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 77c3e303f691bb3d011426e5d8b5dcecd9b89c16 Author: Guofeng Yue Date: Thu Sep 22 20:33:05 2022 +0800 RDMA/hns: Remove unnecessary braces for single statement blocks Braces {} are not necessary for single statement blocks. Link: https://lore.kernel.org/r/20220922123315.3732205-3-xuhaoyue1@hisilicon.com Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit d8913213ffabe64cb7cfd20d59ef12dcecb47fd7 Author: Guofeng Yue Date: Thu Sep 22 20:33:04 2022 +0800 RDMA/hns: Cleanup for a spelling error of Asynchronous Fixed a spelling error for Asynchronous. Link: https://lore.kernel.org/r/20220922123315.3732205-2-xuhaoyue1@hisilicon.com Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: Jason Gunthorpe commit 78657a445ca7603024348781c921f8ecaee10a49 Author: Xiu Jianfeng Date: Sat Sep 24 17:14:57 2022 +0800 IB/rdmavt: Add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Fixes: 0194621b2253 ("IB/rdmavt: Create module framework and handle driver registration") Link: https://lore.kernel.org/r/20220924091457.52446-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Jason Gunthorpe commit 6c5e683925cf19d36033f3e9e9d90755f034614e Author: Bob Pearson Date: Tue Sep 13 17:27:17 2022 -0500 RDMA/rxe: Remove redundant num_sge fields In include/uapi/rdma/rdma_user_rxe.h there are redundant copies of num_sge in the rxe_send_wr, rxe_recv_wqe, and rxe_dma_info. Only the ones in rxe_dma_info are actually used by the rxe kernel driver. The userspace would set these values, but the kernel never read them. This change has no affect on the current ABI and new or old versions of rdma-core operate correctly with new or old versions of the kernel rxe driver. Link: https://lore.kernel.org/r/20220913222716.18335-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 72b2f7608a59727e7c2e5b11cff2749c2c080fac Author: Jason Gunthorpe Date: Thu Sep 1 11:20:56 2022 -0300 RDMA/mlx5: Enable ATS support for MRs and umems For mlx5 if ATS is enabled in the PCI config then the device will use ATS requests for only certain DMA operations. This has to be opted in by the SW side based on the mkey or umem settings. ATS slows down the PCI performance, so it should only be set in cases when it is needed. All of these cases revolve around optimizing PCI P2P transfers and avoiding bad cases where the bus just doesn't work. Link: https://lore.kernel.org/r/4-v1-bd147097458e+ede-umem_dmabuf_jgg@nvidia.com Signed-off-by: Jason Gunthorpe commit 9af859c58d0f169ead0ed95204cdd891b0ee623a Author: Jason Gunthorpe Date: Thu Sep 1 11:20:55 2022 -0300 RDMA/mlx5: Add support for dmabuf to devx umem This is modeled after the similar EFA enablement in commit 66f4817b5712 ("RDMA/efa: Add support for dmabuf memory regions"). Like EFA there is no support for revocation so we simply call the ib_umem_dmabuf_get_pinned() to obtain a umem instead of the normal ib_umem_get(). Everything else stays the same. Link: https://lore.kernel.org/r/3-v1-bd147097458e+ede-umem_dmabuf_jgg@nvidia.com Signed-off-by: Jason Gunthorpe commit 015bda8abd3a6a77656e60b36d499c43a2c0f0a1 Author: Jason Gunthorpe Date: Thu Sep 1 11:20:54 2022 -0300 RDMA/core: Add UVERBS_ATTR_RAW_FD This uses the same passing protocol as UVERBS_ATTR_FD (eg len = 0 data_s64 = fd), except that the FD is not required to be a uverbs object and the core code does not covert the FD to an object handle automatically. Access to the int fd is provided by uverbs_get_raw_fd(). Link: https://lore.kernel.org/r/2-v1-bd147097458e+ede-umem_dmabuf_jgg@nvidia.com Signed-off-by: Jason Gunthorpe commit 4bf207d7a54d49637da94dbc00d2c025b74764d1 Author: Jason Gunthorpe Date: Thu Sep 1 11:20:53 2022 -0300 net/mlx5: Add IFC bits for mkey ATS Allows telling a mkey to use PCI ATS for DMA that flows through it. Link: https://lore.kernel.org/r/1-v1-bd147097458e+ede-umem_dmabuf_jgg@nvidia.com Signed-off-by: Jason Gunthorpe commit fda5d0cf8aef12f0a4f714a96a4b2fce039a3e55 Author: Bob Pearson Date: Thu Aug 25 17:14:47 2022 -0500 RDMA/rxe: Fix resize_finish() in rxe_queue.c Currently in resize_finish() in rxe_queue.c there is a loop which copies the entries in the original queue into a newly allocated queue. The termination logic for this loop is incorrect. The call to queue_next_index() updates cons but has no effect on whether the queue is empty. So if the queue starts out empty nothing is copied but if it is not then the loop will run forever. This patch changes the loop to compare the value of cons to the original producer index. Fixes: ae6e843fe08d0 ("RDMA/rxe: Add memory barriers to kernel queues") Link: https://lore.kernel.org/r/20220825221446.6512-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Reviewed-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit 58651bbb30f87dab474eff31ab564391aa6ea1f3 Author: Bob Pearson Date: Fri Aug 5 13:31:54 2022 -0500 RDMA/rxe: Set pd early in mr alloc routines Move setting of pd in mr objects ahead of any possible errors so that it will always be set in rxe_mr_cleanup() to avoid seg faults when rxe_put(mr_pd(mr)) is called. Fixes: cf40367961d8 ("RDMA/rxe: Move mr cleanup code to rxe_mr_cleanup()") Link: https://lore.kernel.org/r/20220805183153.32007-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Reviewed-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit a776bf77c98ddea32233e2480f565797900975ba Author: Kees Cook Date: Mon Sep 26 17:40:11 2022 -0700 platform/surface: Split memcpy() of struct ssam_event flexible array To work around a misbehavior of the compiler's ability to see into composite flexible array structs (as detailed in the coming memcpy() hardening series[1]), split the memcpy() of the header and the payload so no false positive run-time overflow warning will be generated. [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org Cc: Maximilian Luz Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20220927004011.1942739-1-keescook@chromium.org Signed-off-by: Hans de Goede commit d443fcad6f644a98f2b2cee6a2bfd7e6620d2fe5 Author: Uwe Kleine-König Date: Fri Sep 23 11:47:59 2022 +0200 platform/x86: compal-laptop: Get rid of a few forward declarations Declarations for static symbols are useless repetition (unless there are cyclic dependencies). By changing the order of a few symbols two forward declarations can be dropped. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220923094759.87804-1-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 76a13da75d3ae5acc3cbc02eef558d8faa12e846 Author: ye xingchen Date: Fri Sep 23 06:33:14 2022 +0000 platform/x86: intel-uncore-freq: Use sysfs_emit() to instead of scnprintf() Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220923063314.239146-1-ye.xingchen@zte.com.cn Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bbfa903b4f9a0a76719f386367fed5e64187f577 Author: ye xingchen Date: Fri Sep 23 06:32:33 2022 +0000 platform/x86: dell-smbios-base: Use sysfs_emit() Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220923063233.239091-1-ye.xingchen@zte.com.cn Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 45560891506fae31be66f2a73693c5c8bd7dbedb Author: Stefan Binding Date: Tue Sep 27 13:14:40 2022 +0100 ASoC: cs42l42: Fallback to headphones for type detect After tip sense detects a jack insertion, if automatic type detection, and manual type detection fails, then fall back to assume the jack connected belongs to headphones. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20220927121440.2506632-1-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown commit db6ae79a7e4f729457ec42db5d6d0fbe0e35784c Author: Martin Povišer Date: Tue Sep 27 13:34:26 2022 +0200 ASoC: apple: mca: Adjust timing of component unregister On removal of the driver, the ASoC component should be unregistered first, before we start releasing any of the other resources. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220927113426.49724-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit e92e50e4263f5cf9c731ef5593c31f94dc3b7b8c Author: Martin Povišer Date: Tue Sep 27 13:34:25 2022 +0200 ASoC: apple: mca: Remove stale release of DMA channels The commit 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") shuffled around with the requesting and releasing of DMA channels. It left behind stale release calls from within apple_mca_release, remove those now. Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220927113426.49724-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit d584e73e7310971cc226ef0e2a1bc0526da0d582 Author: Martin Povišer Date: Tue Sep 27 13:34:24 2022 +0200 ASoC: apple: mca: Trigger, not deassert, the peripheral reset Replace the deassertion of the peripheral's shared reset with the triggering of a pulse on it. This is what we should have been using all along as the platform's custom is not leaving the reset asserted on unused peripherals. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220927113426.49724-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit a283781baa0c38a8e9c7b26780e3ee7a91a4f186 Merge: 9732f9c7b4a0c 22ee98cb696e9 Author: Hans de Goede Date: Tue Sep 27 14:57:38 2022 +0200 Merge branch 'platform-drivers-x86-amd-pmf' into review-hans commit 9732f9c7b4a0c18820cbf9c74f7c8abde60f2834 Author: Shyam Sundar S K Date: Thu Sep 22 22:21:18 2022 +0530 platform/x86/amd/pmf: Remove unused power_delta instances Initial version of the PMF ACPI documentation had the concept of "power_delta" which is removed in the recent revisions. So the entire cnqf_power_delta structure is never used/updated. Hence removing it. Fixes: 1738061c9ec8 ("platform/x86/amd/pmf: Add support for CnQF") Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220922165118.163165-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 309e98548c2b144512d0a212f2d786ae9694f5e4 Author: zhichao.liu Date: Tue Sep 27 16:32:48 2022 +0800 spi: mt65xx: Add dma max segment size declaration Add spi dma max segment size declaration according to spi hardware capability, instead of 64KB by system default setting, to improve bus bandwidth for mass data transmission. Signed-off-by: zhichao.liu Link: https://lore.kernel.org/r/20220927083248.25404-1-zhichao.liu@mediatek.com Signed-off-by: Mark Brown commit 22ee98cb696e95b05a188756d479d382d93559ef Author: Shyam Sundar S K Date: Fri Sep 23 18:47:24 2022 +0530 platform/x86/amd/pmf: install notify handler after acpi init It is observed that when thinkpad_acpi driver loads before amd-pmf driver, thinkpad_acpi driver sends the AMT "on" event and the request immediately will be part of the PMF BIOS "pending requests". With the current amd-pmf code, as soon as the amd-pmf driver gets probed, it calls apmf_acpi_init() where the notify handler will be installed. Handler callback would call amd_pmf_handle_amt() where the amd_pmf_set_automode() shall update the auto-mode thermals. In this case, the auto-mode config_store shall have "zeros", as the auto mode init gets called during the later stage. To fix this, change the order of the acpi notifer install and call it after the auto mode initialization is done. Fixes: 7d77dcc83ada ("platform/x86/amd/pmf: Handle AMT and CQL events for Auto mode") Cc: Mario Limonciello Cc: Mark Pearson Cc: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20220923131724.1812685-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit fe6f04c079d0e4b38178955e0ea9d3fbc5d4066b Author: Christoph Hellwig Date: Tue Sep 20 17:50:18 2022 +0200 nvme: remove nvme_ctrl_init_connect_q Unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit ceee1953f9239b699d80c5ef366712c3fd865cc2 Author: Christoph Hellwig Date: Tue Sep 20 17:21:17 2022 +0200 nvme-loop: use the tagset alloc/free helpers Use the common helpers to allocate and free the tagsets. To make this work the generic nvme_ctrl now needs to be stored in the hctx private data instead of the nvme_loop_ctrl. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit 2ade82213b7a35c761273fe0c982f4ab8707f30a Author: Christoph Hellwig Date: Tue Sep 20 17:20:46 2022 +0200 nvme-loop: store the generic nvme_ctrl in set->driver_data Point the private data to the generic controller structure in preparation of using the common tagset init/exit code. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit 379e0df5ab2c46e52e7ca2273d1238526631aa4f Author: Christoph Hellwig Date: Tue Sep 20 17:26:18 2022 +0200 nvme-loop: initialize sqsize later Defer initializing the sqsize field from the options until it has been capped by MAXCMD. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit 6dfba1c09c109f4a6ca12e156dbdbe27e0924862 Author: Christoph Hellwig Date: Tue Sep 20 17:19:36 2022 +0200 nvme-fc: use the tagset alloc/free helpers Use the common helpers to allocate and free the tagsets. To make this work the generic nvme_ctrl now needs to be stored in the hctx private data instead of the nvme_fc_ctrl. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: James Smart commit 1864ea46155ce5e12a3797532c531843688904cc Author: Christoph Hellwig Date: Tue Sep 20 17:17:59 2022 +0200 nvme-fc: store the generic nvme_ctrl in set->driver_data Point the private data to the generic controller structure in preparation of using the common tagset init/exit code and use the chance the cleanup the init_hctx methods a bit. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: James Smart commit 18ecd97506ab27d446ad5f7292b620fef3116089 Author: Christoph Hellwig Date: Tue Sep 20 17:27:33 2022 +0200 nvme-fc: keep ctrl->sqsize in sync with opts->queue_size Also update the sqsize field when capping the queue size, and remove the check a queue size that is larger than sqsize given that sqsize is only initialized from opts->queue_size. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: James Smart commit cefa1032f1114845de305f34dbe4c0c96ed6de1c Author: Christoph Hellwig Date: Tue Sep 20 17:14:53 2022 +0200 nvme-rdma: use the tagset alloc/free helpers Use the common helpers to allocate and free the tagsets. To make this work the generic nvme_ctrl now needs to be stored in the hctx private data instead of the nvme_rdma_ctrl. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit 2d60738c8f80684d469302d60edb2101f5e4190b Author: Christoph Hellwig Date: Tue Sep 20 17:14:01 2022 +0200 nvme-rdma: store the generic nvme_ctrl in set->driver_data Point the private data to the generic controller structure in preparation of using the common tagset init/exit code. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit de777825e462bc086dca9675312f1780b4b8c88e Author: Christoph Hellwig Date: Tue Sep 20 17:12:47 2022 +0200 nvme-tcp: use the tagset alloc/free helpers Use the common helpers to allocate and free the tagsets. To make this work the generic nvme_ctrl now needs to be stored in the hctx private data instead of the nvme_tcp_ctrl. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit 06427ca09b2f3103a60b384345c81cb784e19956 Author: Christoph Hellwig Date: Tue Sep 20 17:09:48 2022 +0200 nvme-tcp: store the generic nvme_ctrl in set->driver_data Point the private data to the generic controller structure in preparation of using the common tagset init/exit code. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit fb8745d040ef5b9080003325e56b91fefe1022bb Author: Christoph Hellwig Date: Tue Sep 20 17:23:24 2022 +0200 nvme-tcp: remove the unused queue_size member in nvme_tcp_queue ->nvme_tcp_queue is not used anywhere, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit fe60e8c534118a288cd251a59d747cbf5c03e160 Author: Christoph Hellwig Date: Sun Sep 4 15:18:30 2022 +0300 nvme: add common helpers to allocate and free tagsets Add common helpers to allocate and tear down the admin and I/O tag sets, including the special queues allocated with them. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni commit 3c69ed7aa546bd79b01977cf2c0a603cdb9e8ad5 Author: Christoph Hellwig Date: Thu Sep 22 08:33:14 2022 +0200 nvme-auth: add a MAINTAINERS entry Add Hannes as the nvme-auth maintainer. Signed-off-by: Christoph Hellwig Acked-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni commit c8b41c07d22719d31c3325a898ae80f2d58ac405 Author: Kishon Vijay Abraham I Date: Fri Sep 23 12:20:05 2022 +0530 MAINTAINERS: Add Vignesh as maintainer of TI SDHCI OMAP DRIVER Add Vignesh Raghavendra as maintainer of TI SDHCI OMAP DRIVER. Cc: Vignesh Raghavendra Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220923065005.20062-1-kishon@ti.com Signed-off-by: Ulf Hansson commit 4de95950d970c71a9e82a24573bb7a44fd95baa1 Author: Richard Acayan Date: Thu Sep 22 21:43:22 2022 -0400 mmc: sdhci-msm: add compatible string check for sdm670 The Snapdragon 670 has the same quirk as Snapdragon 845 (needing to restore the dll config). Add a compatible string check to detect the need for this. Signed-off-by: Richard Acayan Reviewed-by: Bhupesh Sharma Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220923014322.33620-3-mailingradian@gmail.com Signed-off-by: Ulf Hansson commit 07c7338f05d26b87713cb30f8d7c5e17abe4724e Author: Richard Acayan Date: Thu Sep 22 21:43:21 2022 -0400 dt-bindings: mmc: sdhci-msm: add sdm670 compatible The Snapdragon 670 supports eMMC with an SDHCI controller. Add the appropriate compatible to the documentation. Signed-off-by: Richard Acayan Reviewed-by: Bhupesh Sharma Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220923014322.33620-2-mailingradian@gmail.com Signed-off-by: Ulf Hansson commit cb58188ad90a61784a56a64f5107faaf2ad323e7 Author: Christophe JAILLET Date: Thu Sep 22 21:06:40 2022 +0200 mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe() A dma_free_coherent() call is missing in the error handling path of the probe, as already done in the remove function. Fixes: 3a96dff0f828 ("mmc: SD/MMC Host Controller for Wondermedia WM8505/WM8650") Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/53fc6ffa5d1c428fefeae7d313cf4a669c3a1e98.1663873255.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit 048f71f7685706dcc859160cc74f73e361cfe6c0 Author: Sergio Paracuellos Date: Tue Sep 27 05:19:29 2022 +0200 spi: migrate mt7621 text bindings to YAML SoC MT7621 SPI bindings used text format, so migrate them to YAML. There are some additions to the binding that were not in the original file. This binding is used in MT7621 and MT7628a Ralink SoCs. To properly match both dts nodes in tree we need to add to the schema 'clocks', 'clock-names' and 'reset-names'. Both 'clock-names' and 'reset-names' use 'spi' as string so maintain that as const in the schema. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220927031929.807070-1-sergio.paracuellos@gmail.com Signed-off-by: Mark Brown commit 09d6838f377e273e112bb20eba1e569c62e1ceb4 Author: Javier Martinez Canillas Date: Tue Sep 27 11:52:49 2022 +0200 drm/ssd130x: Synchronize access to dma-buf imported GEM BOs Synchronize CPU access to GEM BOs with other drivers when updating the screen buffer. Imported DMA buffers might otherwise contain stale data. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220927095249.1919385-1-javierm@redhat.com commit 30b1a0797e0bad14f95d349b43e3df3a157b83b6 Author: Javier Martinez Canillas Date: Fri Sep 23 10:34:47 2022 +0200 drm/ssd130x: Use drm_atomic_get_new_plane_state() The struct drm_plane .state shouldn't be accessed directly but instead the drm_atomic_get_new_plane_state() helper function should be used. This is based on a similar patch from Thomas Zimmermann for the simpledrm driver. No functional changes. Suggested-by: Ville Syrjälä Signed-off-by: Javier Martinez Canillas Reviewed-by: Ville Syrjälä Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220923083447.1679780-1-javierm@redhat.com commit d3549a938b73f203ef522562ae9f2d38aa43d234 Author: Ard Biesheuvel Date: Fri Sep 16 11:48:30 2022 +0200 efi/arm64: libstub: avoid SetVirtualAddressMap() when possible EFI's SetVirtualAddressMap() runtime service is a horrid hack that we'd like to avoid using, if possible. For 64-bit architectures such as arm64, the user and kernel mappings are entirely disjoint, and given that we use the user region for mapping the UEFI runtime regions when running under the OS, we don't rely on SetVirtualAddressMap() in the conventional way, i.e., to permit kernel mappings of the OS to coexist with kernel region mappings of the firmware regions. This means that, in principle, we should be able to avoid SetVirtualAddressMap() altogether, and simply use the 1:1 mapping that UEFI uses at boot time. (Note that omitting SetVirtualAddressMap() is explicitly permitted by the UEFI spec). However, there is a corner case on arm64, which, if configured for 3-level paging (or 2-level paging when using 64k pages), may not be able to cover the entire range of firmware mappings (which might contain both memory and MMIO peripheral mappings). So let's avoid SetVirtualAddressMap() on arm64, but only if the VA space is guaranteed to be of sufficient size. Signed-off-by: Ard Biesheuvel commit 3c6edd9034240ce9582be3392112321336bd25bb Author: Ard Biesheuvel Date: Thu Sep 22 12:03:52 2022 +0200 efi: zboot: create MemoryMapped() device path for the parent if needed LoadImage() is supposed to install an instance of the protocol EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL onto the loaded image's handle so that the program can figure out where it was loaded from. The reference implementation even does this (with a NULL protocol pointer) if the call to LoadImage() used the source buffer and size arguments, and passed NULL for the image device path. Hand rolled implementations of LoadImage may behave differently, though, and so it is better to tolerate situations where the protocol is missing. And actually, concatenating an Offset() node to a NULL device path (as we do currently) is not great either. So in cases where the protocol is absent, or when it points to NULL, construct a MemoryMapped() device node as the base node that describes the parent image's footprint in memory. Cc: Daan De Meyer Cc: Jeremy Linton Signed-off-by: Ard Biesheuvel commit 04419e8a7b41c83c628d45c684d6bd117c24cea9 Author: Ard Biesheuvel Date: Fri Sep 16 13:02:16 2022 +0200 efi: libstub: fix up the last remaining open coded boot service call We use a macro efi_bs_call() to call boot services, which is more concise, and on x86, it encapsulates the mixed mode handling. This code does not run in mixed mode, but let's switch to the macro for general tidiness. Signed-off-by: Ard Biesheuvel commit 69e377b289376147c84cfd09bab1ad0328a0ecc6 Author: Ard Biesheuvel Date: Fri Sep 16 10:04:57 2022 +0200 efi/arm: libstub: move ARM specific code out of generic routines Move some code that is only reachable when IS_ENABLED(CONFIG_ARM) into the ARM EFI arch code. Cc: Russell King Signed-off-by: Ard Biesheuvel commit 71c7adc9fffd4e38ebc197314f6909c9fd6051ef Author: Ilias Apalodimas Date: Fri Sep 16 11:14:35 2022 +0300 efi/libstub: measure EFI LoadOptions The EFI TCG spec, in §10.2.6 "Measuring UEFI Variables and UEFI GPT Data", only reasons about the load options passed to a loaded image in the context of boot options booted directly from the BDS, which are measured into PCR #5 along with the rest of the Boot#### EFI variable. However, the UEFI spec mentions the following in the documentation of the LoadImage() boot service and the EFI_LOADED_IMAGE protocol: The caller may fill in the image’s "load options" data, or add additional protocol support to the handle before passing control to the newly loaded image by calling EFI_BOOT_SERVICES.StartImage(). The typical boot sequence for Linux EFI systems is to load GRUB via a boot option from the BDS, which [hopefully] calls LoadImage to load the kernel image, passing the kernel command line via the mechanism described above. This means that we cannot rely on the firmware implementing TCG measured boot to ensure that the kernel command line gets measured before the image is started, so the EFI stub will have to take care of this itself. Given that PCR #5 has an official use in the TCG measured boot spec, let's avoid it in this case. Instead, add a measurement in PCR #9 (which we already use for our initrd) and extend it with the LoadOptions measurements Co-developed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas Signed-off-by: Ard Biesheuvel commit 566331696329c2f9ca0fe2a55a5dd029ac43d2d2 Author: Ilias Apalodimas Date: Fri Sep 16 11:14:34 2022 +0300 efi/libstub: refactor the initrd measuring functions Currently, from the efi-stub, we are only measuring the loaded initrd, using the TCG2 measured boot protocols. A following patch is introducing measurements of additional components, such as the kernel command line. On top of that, we will shortly have to support other types of measured boot that don't expose the TCG2 protocols. So let's prepare for that, by rejigging the efi_measure_initrd() routine into something that we should be able to reuse for measuring other assets, and which can be extended later to support other measured boot protocols. Co-developed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas Signed-off-by: Ard Biesheuvel commit 24e88ab0448814be43fc2781f3b54d7a73083345 Merge: a241d94bb532d 40cd01a9c324b Author: Ard Biesheuvel Date: Tue Sep 27 13:26:13 2022 +0200 Merge tag 'efi-loongarch-for-v6.1-2' into HEAD Second shared stable tag between EFI and LoongArch trees This is necessary because the EFI libstub refactoring patches are mostly directed at enabling LoongArch to wire up generic EFI boot support without being forced to consume DT properties that conflict with information that EFI also provides, e.g., memory map and reservations, etc. commit 40cd01a9c324bd238e107d9d5ecb6824146a7836 Author: Ard Biesheuvel Date: Fri Sep 16 19:48:53 2022 +0200 efi/loongarch: libstub: remove dependency on flattened DT LoongArch does not use FDT or DT natively [yet], and the only reason it currently uses it is so that it can reuse the existing EFI stub code. Overloading the DT with data passed between the EFI stub and the core kernel has been a source of problems: there is the overlap between information provided by EFI which DT can also provide (initrd base/size, command line, memory descriptions), requiring us to reason about which is which and what to prioritize. It has also resulted in ABI leaks, i.e., internal ABI being promoted to external ABI inadvertently because the bootloader can set the EFI stub's DT properties as well (e.g., "kaslr-seed"). This has become especially problematic with boot environments that want to pretend that EFI boot is being done (to access ACPI and SMBIOS tables, for instance) but have no ability to execute the EFI stub, and so the environment that the EFI stub creates is emulated [poorly, in some cases]. Another downside of treating DT like this is that the DT binary that the kernel receives is different from the one created by the firmware, which is undesirable in the context of secure and measured boot. Given that LoongArch support in Linux is brand new, we can avoid these pitfalls, and treat the DT strictly as a hardware description, and use a separate handover method between the EFI stub and the kernel. Now that initrd loading and passing the EFI memory map have been refactored into pure EFI routines that use EFI configuration tables, the only thing we need to pass directly is the kernel command line (even if we could pass this via a config table as well, it is used extremely early, so passing it directly is preferred in this case.) Signed-off-by: Ard Biesheuvel Acked-by: Huacai Chen commit 171539f5a90e3fdf7d17f5396fac79d7e44ad68e Author: Ard Biesheuvel Date: Thu Sep 15 23:20:06 2022 +0200 efi: libstub: install boot-time memory map as config table Expose the EFI boot time memory map to the kernel via a configuration table. This is arch agnostic and enables future changes that remove the dependency on DT on architectures that don't otherwise rely on it. Signed-off-by: Ard Biesheuvel commit 4fc8e738ff3e6a208855bb69783280870c7cf251 Author: Ard Biesheuvel Date: Fri Sep 16 18:51:36 2022 +0200 efi: libstub: remove DT dependency from generic stub Refactor the generic EFI stub entry code so that all the dependencies on device tree are abstracted and hidden behind a generic efi_boot_kernel() routine that can also be implemented in other ways. This allows users of the generic stub to avoid using FDT for passing information to the core kernel. Signed-off-by: Ard Biesheuvel commit f4dc7fffa9873db50ec25624572f8217a6225de8 Author: Ard Biesheuvel Date: Fri Sep 16 14:03:06 2022 +0200 efi: libstub: unify initrd loading between architectures Use a EFI configuration table to pass the initrd to the core kernel, instead of per-arch methods. This cleans up the code considerably, and should make it easier for architectures to get rid of their reliance on DT for doing EFI boot in the future. Signed-off-by: Ard Biesheuvel commit 6fed3265c3c811c79819860051375f6d7efc1d7e Author: Gustavo A. R. Silva Date: Mon Sep 26 17:58:17 2022 -0500 ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/226 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/YzIuiUul2CwPlkKh@work Signed-off-by: Mark Brown commit b3eec3e6670d4da653e742bae16e5a6ff3f03825 Author: Marek Vasut Date: Tue Sep 27 02:20:04 2022 +0200 ASoC: st,stm32-sai: Document audio OF graph port It is expected that the SAI subnodes would contain audio OF graph port with endpoint to link it with the other side of audio link. Document the port: property. Signed-off-by: Marek Vasut Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927002004.685108-1-marex@denx.de Signed-off-by: Mark Brown commit b264ef796959cb65cdbc811da5ab950e33df4162 Author: Gustavo A. R. Silva Date: Mon Sep 26 16:40:55 2022 -0500 ASoC: SOF: control.h: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/211 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/YzIcZ11k8RiQtS2T@work Signed-off-by: Mark Brown commit 5445e5db29fc5ac917ee4b5def62b5cf20e1ee9e Merge: 2b381b4a91e94 f7c91bf653885 Author: Mark Brown Date: Tue Sep 27 12:07:27 2022 +0100 ASoC: SOF: mediatek: mt8195: Add dsp_ops callback Merge series from Chunxu Li : Support more operations for MediaTek DSPs using SOF. commit aa69dc65e3b34ce67847f92be06ce9a624a02475 Author: Geert Uytterhoeven Date: Mon Sep 26 17:05:42 2022 +0200 spi: renesas,sh-msiof: Add r8a779g0 support Document support for the Clock-Synchronized Serial Interface with FIFO (MSIOF) in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/a840ca8487cfd612fae2b20c98e93ae7c7f50ef4.1664204638.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit dd1b25ec8b2072dfe58325e13785f0dfef94b2c3 Merge: fc13b5a25e18b 29f65f2171c85 Author: Mark Brown Date: Tue Sep 27 11:33:19 2022 +0100 Fix PM disable depth imbalance in probe Merge series from Zhang Qilong : The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed when error returns to keep it balanced. This series of patches fixed it in spi probe. commit 20e377e7b2e7c327039f10db80ba5bcc1f6c882d Author: Chris Wilson Date: Mon Sep 26 16:33:33 2022 +0100 drm/i915/gt: Use i915_vm_put on ppgtt_create error paths Now that the scratch page and page directories have a reference back to the i915_address_space, we cannot do an immediate free of the ppgtt upon error as those buffer objects will perform a later i915_vm_put in their deferred frees. The downside is that by replacing the onion unwind along the error paths, the ppgtt cleanup must handle a partially constructed vm. This includes ensuring that the vm->cleanup is set prior to the error path. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6900 Signed-off-by: Chris Wilson Fixes: 4d8151ae5329 ("drm/i915: Don't free shared locks while shared") Cc: Thomas Hellström Cc: Matthew Auld Cc: # v5.14+ Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220926153333.102195-1-matthew.auld@intel.com (cherry picked from commit c286558f58535cf97b717b946d6c96d774a09d17) Signed-off-by: Tvrtko Ursulin commit a50ab1bbab26b26fa070e83c47687e6a0bd52302 Author: Ville Syrjälä Date: Thu Sep 22 22:12:36 2022 +0300 drm/i915: Force DPLL calculation for TC ports after readout We always allocate two DPLLs (TC and TBT) for TC ports. This is because we can't know ahead of time wherher we need to put the PHY into DP-Alt or TBT mode. However during readout we can obviously only read out the state of the DPLL that the port is actually using. Thus the state after readout will not have both DPLLs populated. We run into problems if during readout the TC port is in DP-Alt mode, but we then perform a modeset on the port without going through the full .compute_config() machinery, and during said modeset the port cannot be switched back into DP-Alt mode and we need to take the TBT fallback path. Such a modeset can happen eg. due to cdclk reprogramming. This wasn't a problem earlier because we did all the DPLL calculations much later in the modeset. So even if flagged a modeset very late we'd still have gone through the DPLL calculations. But now all the DPLL calculations happen much earlier and so we need to deal with it, or else we'll attempt a modeset without a DPLL. To guarantee that we always have both DPLLs fully cal/ulated for TC ports force a full modeset computation during the initial commit. v2: Avoid bitwise operation on bool (Jani) Call the return variable 'fastset' to convey its meaning Reported-by: Lee Shawn C Fixes: b000abd3b3d2 ("drm/i915: Do .crtc_compute_clock() earlier") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220922191236.4194-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit eddb4afcb6c533d3f75f5f1a77e292fece27570e) Signed-off-by: Tvrtko Ursulin commit 47c3d0752bb6b412b8d1c08a1e88738fe5b9829f Author: Jani Nikula Date: Fri Sep 16 11:26:42 2022 +0300 drm/i915: fix device info for devices without display Commit 00c6cbfd4e8a ("drm/i915: move pipe_mask and cpu_transcoder_mask to runtime info") moved the pipe_mask member from struct intel_device_info to intel_runtime_info, but overlooked some of our platforms initializing device info .display = {}. This is significant, as pipe_mask is the single point of truth for a device having a display or not; the platforms in question left pipe_mask to whatever was set for the platforms they "inherit" from in the complex macro scheme we have. Add new NO_DISPLAY macro initializing .__runtime.pipe_mask = 0, which will cause the device info .display sub-struct to be zeroed in intel_device_info_runtime_init(). A better solution (or simply audit of proper use of HAS_DISPLAY() checks) is required before moving forward with [1]. Also clear all the display related members in runtime info if there's no display. The latter is a bit tedious, but it's for completeness at this time, to ensure similar functionality as before. [1] https://lore.kernel.org/r/dfda1bf67f02ceb07c280b7a13216405fd1f7a34.1660137416.git.jani.nikula@intel.com Fixes: 00c6cbfd4e8a ("drm/i915: move pipe_mask and cpu_transcoder_mask to runtime info") Cc: Lucas De Marchi Cc: Maarten Lankhort Signed-off-by: Jani Nikula Reviewed-by: Gwan-gyeong Mun Acked-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220916082642.3451961-1-jani.nikula@intel.com (cherry picked from commit 86570b7b126bd516aba770d1fc4c971c55c66dca) Signed-off-by: Tvrtko Ursulin commit 86a4e84a9d5247daa2eafef05078ae9f3e003bf1 Author: Nirmoy Das Date: Tue Sep 20 19:06:28 2022 +0200 drm/i915: Do not cleanup obj with NULL bo->resource For delayed BO release i915_ttm_delete_mem_notify() gets called twice, once with proper bo->resource and another time with NULL. We shouldn't do anything for the 2nd time as we already cleaned up the obj once. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6850 Fixes: ad74457a6b5a96 ("drm/i915/dgfx: Release mmap on rpm suspend") Signed-off-by: Nirmoy Das Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220920170628.3391-1-nirmoy.das@intel.com (cherry picked from commit fb7818989976317cc2e78008aa2df7b9fe423c86) Signed-off-by: Tvrtko Ursulin commit aa17e57e5c67330c36d915da2925ca27099c096a Author: Jani Nikula Date: Fri Sep 16 14:38:50 2022 +0300 drm/i915/display: remove ipc_enabled from struct drm_i915_private The ipc_enabled member was supposed to be moved under the display wm sub-struct, but due to a rebase fail only the new one was added and the old one was left behind. Finish the job. Fixes: 70296670f672 ("drm/i915/display: move IPC under display wm sub-struct") Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220916113850.3712354-1-jani.nikula@intel.com (cherry picked from commit 48176104003058e2ba540fd815ec46c350d65926) Signed-off-by: Tvrtko Ursulin commit 25bbfb930716390405770bb79f0d348ef93c5a7c Author: John Harrison Date: Mon Sep 12 18:09:29 2022 -0700 drm/i915/guc: Fix release build bug in 'remove log size module parameters' A patch was merged to remove the GuC log size override module parameters. That patch was broken and caused kernel error messages on boot in non CONFIG_DEBUG_GUC|GEM builds: [ 12.085121] i915 0000:00:02.0: [drm] *ERROR* Zero GuC log crash dump size! [ 12.092035] i915 0000:00:02.0: [drm] *ERROR* Zero GuC log debug size! So fit it. Fixes: f54e515c9180 ("drm/i915/guc: Remove log size module parameters") Cc: Joonas Lahtinen Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Alan Previn Cc: Jani Nikula Cc: Lucas De Marchi Cc: Matthew Brost Cc: Julia Lawall Cc: Chris Wilson Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220913010929.2734885-2-John.C.Harrison@Intel.com (cherry picked from commit 01f0ce3e859619ea84104d668a87ace924bd12df) Signed-off-by: Tvrtko Ursulin commit 70d1b1a7f8b32b78c09b30dbcfa25ba1e470568b Merge: 8a2dd123f12f6 939838632b911 Author: Leon Romanovsky Date: Tue Sep 27 12:56:24 2022 +0300 Merge branch 'mlx5-vfio' into mlx5-next Merge net/mlx5 dependencies for device DMA logging. Signed-off-by: Leon Romanovsky commit 5591b021e00ca8cd92487a9dbccb6d6da9476a8d Merge: 6627a2074d5c8 59cd7377660a7 Author: Paolo Abeni Date: Tue Sep 27 11:31:54 2022 +0200 Merge branch 'net-openvswitch-metering-and-conntrack-in-userns' Michael Weiß says: ==================== net: openvswitch: metering and conntrack in userns Currently using openvswitch in a non-initial user namespace, e.g., an unprivileged container, is possible but without metering and conntrack support. This is due to the restriction of the corresponding Netlink interfaces to the global CAP_NET_ADMIN. This simple patches switch from GENL_ADMIN_PERM to GENL_UNS_ADMIN_PERM in several cases to allow this also for the unprivileged container use case. We tested this for unprivileged containers created by the container manager of GyroidOS (gyroidos.github.io). However, for other container managers such as LXC or systemd which provide unprivileged containers this should be apply equally. ==================== Link: https://lore.kernel.org/r/20220923133820.993725-1-michael.weiss@aisec.fraunhofer.de Signed-off-by: Paolo Abeni commit 59cd7377660a76780bfdd9fd26da058bcca5320d Author: Michael Weiß Date: Fri Sep 23 15:38:20 2022 +0200 net: openvswitch: allow conntrack in non-initial user namespace Similar to the previous commit, the Netlink interface of the OVS conntrack module was restricted to global CAP_NET_ADMIN by using GENL_ADMIN_PERM. This is changed to GENL_UNS_ADMIN_PERM to support unprivileged containers in non-initial user namespace. Signed-off-by: Michael Weiß Signed-off-by: Paolo Abeni commit 8039371847174ff37dc3d02e83cd789dbb6140b0 Author: Michael Weiß Date: Fri Sep 23 15:38:19 2022 +0200 net: openvswitch: allow metering in non-initial user namespace The Netlink interface for metering was restricted to global CAP_NET_ADMIN by using GENL_ADMIN_PERM. To allow metring in a non-inital user namespace, e.g., a container, this is changed to GENL_UNS_ADMIN_PERM. Signed-off-by: Michael Weiß Signed-off-by: Paolo Abeni commit af246cc6d0ed11318223606128bb0b09866c4c08 Author: Yang Guo Date: Tue Sep 27 11:32:21 2022 +0800 clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value CNTPCT_LO and CNTVCT_LO are defined by mistake in commit '8b82c4f883a7', so fix them according to the Arm ARM DDI 0487I.a, Table I2-4 "CNTBaseN memory map" as follows: Offset Register Type Description 0x000 CNTPCT[31:0] RO Physical Count register. 0x004 CNTPCT[63:32] RO 0x008 CNTVCT[31:0] RO Virtual Count register. 0x00C CNTVCT[63:32] RO Fixes: 8b82c4f883a7 ("clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL") Cc: stable@vger.kernel.org Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Mark Rutland Acked-by: Marc Zyngier Signed-off-by: Yang Guo Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/20220927033221.49589-1-zhangshaokun@hisilicon.com Signed-off-by: Daniel Lezcano commit 312fe643ad1153fe0337c46f4573030d0c2bac73 Author: Gao Xiang Date: Tue Sep 27 14:36:07 2022 +0800 erofs: clean up erofs_iget() isdir indicated REQ_META|REQ_PRIO which no longer works now. Get rid of isdir entirely. Link: https://lore.kernel.org/r/20220927063607.54832-2-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Signed-off-by: Gao Xiang commit 53a7f9961cddf505a9f3a7baa017e5af31838840 Author: Gao Xiang Date: Tue Sep 27 14:36:06 2022 +0800 erofs: clean up unnecessary code and comments Some conditional macros and comments are useless. Link: https://lore.kernel.org/r/20220927063607.54832-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Signed-off-by: Gao Xiang commit 1abbe04a1b55200d0e3e93b2c15058c15126a225 Author: Krishna chaitanya chundru Date: Thu Sep 8 14:16:16 2022 +0530 dt-bindings: pci: QCOM Add missing sc7280 aggre0, aggre1 clocks Add missing aggre0 and aggre1 clocks. Link: https://lore.kernel.org/r/1662626776-19636-3-git-send-email-quic_krichai@quicinc.com Signed-off-by: Krishna chaitanya chundru Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Kozlowski commit 2301a3e1a5664cf8380d2b8ef051005dc90bc881 Author: Pali Rohár Date: Sat Sep 24 11:24:04 2022 +0200 PCI: mt7621: Use PCI_CONF1_EXT_ADDRESS() macro Simplify pcie-mt7621.c driver code and use new PCI_CONF1_EXT_ADDRESS() macro for accessing PCIe config space. Link: https://lore.kernel.org/r/20220924092404.31776-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Sergio Paracuellos commit f75a27dc6c07cbf371572cf0539c3b60e7d50c1d Author: Pali Rohár Date: Sat Sep 24 11:24:03 2022 +0200 PCI: ftpci100: Use PCI_CONF1_ADDRESS() macro Simplify pci-ftpci100.c driver code and use new PCI_CONF1_ADDRESS() macro for accessing PCI config space. Link: https://lore.kernel.org/r/20220924092404.31776-3-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 8a9b7ef74369f08a8bde2a45168056f1cad9fb2c Author: Pali Rohár Date: Sat Sep 24 11:24:02 2022 +0200 PCI: Add standard PCI Config Address macros Lot of PCI and PCIe controllers are using standard Config Address for PCI Configuration Mechanism #1 (as defined in PCI Local Bus Specification) or its extended version. So introduce new macros PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() in include file drivers/pci/pci.h which can be suitable for PCI and PCIe controllers which uses this type of access to PCI config space. Link: https://lore.kernel.org/r/20220924092404.31776-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas commit bce2b0539933e485d22d6f6f076c0fcd6f185c4c Author: Dongliang Mu Date: Thu Sep 22 21:48:44 2022 +0800 usb: idmouse: fix an uninit-value in idmouse_open In idmouse_create_image, if any ftip_command fails, it will go to the reset label. However, this leads to the data in bulk_in_buffer[HEADER..IMGSIZE] uninitialized. And the check for valid image incurs an uninitialized dereference. Fix this by moving the check before reset label since this check only be valid if the data after bulk_in_buffer[HEADER] has concrete data. Note that this is found by KMSAN, so only kernel compilation is tested. Reported-by: syzbot+79832d33eb89fb3cd092@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20220922134847.1101921-1-dzm91@hust.edu.cn Signed-off-by: Greg Kroah-Hartman commit 411c4597df7dcc60b7aae83761618c94a60ded3f Author: Yang Yingliang Date: Thu Sep 22 21:33:23 2022 +0800 USB: PHY: JZ4770: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220922133323.2135494-2-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit e0b27d38ffb7552b28a993c3c7029ce89670ff5b Author: Yang Yingliang Date: Thu Sep 22 21:33:22 2022 +0800 usb: phy: generic: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220922133323.2135494-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 5d5fb7c75f5a32b08089ab15dedcd5d83c809991 Author: Liu Shixin Date: Thu Sep 22 22:25:05 2022 +0800 usb: ulpi: use DEFINE_SHOW_ATTRIBUTE to simplify ulpi_regs Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220922142505.3248167-1-liushixin2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 29afbe5f5afc2f724b8aef2d11fbe6a7ee48997e Author: Dongliang Mu Date: Mon Sep 26 21:59:21 2022 +0800 usb: cdns3: remove dead code Smatch reports the following error: drivers/usb/cdns3/cdns3-plat.c:113 cdns3_plat_probe() warn: platform_get_irq() does not return zero From the document, platform_get_irq_byname_optional only returns non-zero value, and negative value on failure. Fix this by removing the zero value checking. Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20220926135922.24541-1-dzm91@hust.edu.cn Signed-off-by: Greg Kroah-Hartman commit 1abf6ab490c518164a3ffb62e4533850aaecb6fd Author: Shang XiaoJing Date: Tue Sep 27 10:43:44 2022 +0800 usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing Acked-by: Oliver Neukum Link: https://lore.kernel.org/r/20220927024344.14352-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7a8275099361e248d3c4dc350332606bf36b19b7 Author: Yang Yingliang Date: Tue Sep 27 15:26:16 2022 +0800 usb: musb: sunxi: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927072616.913672-6-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 82d788750e35ab0bf7f5cc1005b694bb2ca3cf20 Author: Yang Yingliang Date: Tue Sep 27 15:26:15 2022 +0800 usb: musb: jz4740: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927072616.913672-5-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit a806f67f15feca7449ffc792daa59af36a9c0135 Author: Yang Yingliang Date: Tue Sep 27 15:26:14 2022 +0800 usb: musb: cppi41: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927072616.913672-4-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 92150ca664e957d776ca25c29e4a09675c910747 Author: Yang Yingliang Date: Tue Sep 27 15:26:13 2022 +0800 usb: musb: da8xx: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927072616.913672-3-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7be7231d41971f5e244c0ba8f340dc4697868aa1 Author: Yang Yingliang Date: Tue Sep 27 15:26:12 2022 +0800 usb: musb: core: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220927072616.913672-2-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit a075590c0aa2b9d1bc1204bf8ea97519aef2994a Author: Yang Yingliang Date: Thu Sep 22 21:48:06 2022 +0800 usb: typec: fusb302: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220922134806.2204579-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3eab90ae9f5b8e7c40a619c4c8aadf9bcd8c24cf Author: Yang Yingliang Date: Thu Sep 22 21:57:08 2022 +0800 usb: typec: qcom-pmic-typec: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220922135708.2212249-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 759fcaaf600e56ec0a33678e85f317c5347562c7 Author: Yang Yingliang Date: Thu Sep 22 21:52:28 2022 +0800 usb: typec: stusb160x: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220922135228.2206755-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3fbfcf0c42166d7a5336ed7251f869b82b4f655c Author: Yang Yingliang Date: Thu Sep 22 20:39:51 2022 +0800 usb: usb251xb: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220922123951.2004328-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 280f669ba63aa20082ffc7daa8fade8e738c944e Author: Shang XiaoJing Date: Tue Sep 27 10:42:20 2022 +0800 staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927024220.14044-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman commit a6e7f8a49f99b25e29af578bf1d4e19b30a1212f Author: Shang XiaoJing Date: Tue Sep 27 10:40:50 2022 +0800 staging: r8188eu: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Drop the tmp variable that is not needed any more. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927024050.13556-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7622384c379fb2fbd6757190f5396d009bc89419 Author: Michael Straube Date: Mon Sep 26 19:32:43 2022 +0200 staging: r8188eu: remove hal/odm_RegConfig8188E.c All remaining functions in hal/odm_RegConfig8188E.c are only used in hal/HalHWImg8188E_BB.c. Make them static and remove the now empty file hal/odm_RegConfig8188E.c and the header odm_RegConfig8188E.h. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220926173243.8767-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1254b194f82f0539624064864d1fccdf4617b899 Author: Michael Straube Date: Mon Sep 26 19:32:42 2022 +0200 staging: r8188eu: make odm_ConfigRF_RadioA_8188E() static The function odm_ConfigRF_RadioA_8188E() is only used in HalHWImg8188E_RF.c. Make it static. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220926173243.8767-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0061a2a9550b845f7c0b291c0b74047290048571 Author: Michael Straube Date: Mon Sep 26 19:32:41 2022 +0200 staging: r8188eu: make odm_ConfigMAC_8188E() static The function odm_ConfigMAC_8188E() is only used in HalHWImg8188E_MAC.c. Make it static. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20220926173243.8767-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d67614f276c1499ad939fa5c1aadd35498cc6b34 Merge: 70a7ce22e9229 3a99c4474112f Author: Mauro Carvalho Chehab Date: Tue Sep 27 10:27:48 2022 +0200 Merge fixes into media_stage * fixes: media: rkvdec: Disable H.264 error detection media: mediatek: vcodec: Drop platform_get_resource(IORESOURCE_IRQ) media: dvb_vb2: fix possible out of bound access media: v4l2-ioctl.c: fix incorrect error path media: v4l2-compat-ioctl32.c: zero buffer passed to v4l2_compat_get_array_args() media: uvcvideo: Fix InterfaceProtocol for Quanta camera commit 4b5a51e45f296f0477485cadd1fb7e03295cc455 Author: Thomas Zimmermann Date: Thu Sep 22 15:09:44 2022 +0200 drm/simpledrm: Synchronize access to GEM BOs Synchronize CPU access to GEM BOs with other drivers when updating the screen buffer. Imported buffers might otherwise contain stale data. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220922130944.27138-6-tzimmermann@suse.de commit 52a504e868e78d866ed204be59be96abd62dc69c Author: Thomas Zimmermann Date: Thu Sep 22 15:09:43 2022 +0200 drm/simpledrm: Iterate over damage clips Iterate over all damage clips and updated them one by one. Replaces the merging of damage areas, which can result in significant overhead if damage areas are not close to each other. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220922130944.27138-5-tzimmermann@suse.de commit 7fcf19301ef745adfa9fa1baa7b829c77dec5e22 Author: Thomas Zimmermann Date: Thu Sep 22 15:09:42 2022 +0200 drm/simpledrm: Remove !fb check from atomic_update The primary plane implements atomic_disable, so atomic_update will not be called without a framebuffer set. Remove the test for !fb. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220922130944.27138-4-tzimmermann@suse.de commit 6627a2074d5c82b3efd71c978f13f93f7ab9bf46 Author: Tony Lu Date: Thu Sep 22 20:19:07 2022 +0800 net/smc: Support SO_REUSEPORT This enables SO_REUSEPORT [1] for clcsock when it is set on smc socket, so that some applications which uses it can be transparently replaced with SMC. Also, this helps improve load distribution. Here is a simple test of NGINX + wrk with SMC. The CPU usage is collected on NGINX (server) side as below. Disable SO_REUSEPORT: 05:15:33 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 05:15:34 PM all 7.02 0.00 11.86 0.00 2.04 8.93 0.00 0.00 0.00 70.15 05:15:34 PM 0 0.00 0.00 0.00 0.00 16.00 70.00 0.00 0.00 0.00 14.00 05:15:34 PM 1 11.58 0.00 22.11 0.00 0.00 0.00 0.00 0.00 0.00 66.32 05:15:34 PM 2 1.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 98.00 05:15:34 PM 3 16.84 0.00 30.53 0.00 0.00 0.00 0.00 0.00 0.00 52.63 05:15:34 PM 4 28.72 0.00 44.68 0.00 0.00 0.00 0.00 0.00 0.00 26.60 05:15:34 PM 5 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 05:15:34 PM 6 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 05:15:34 PM 7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 Enable SO_REUSEPORT: 05:15:20 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 05:15:21 PM all 8.56 0.00 14.40 0.00 2.20 9.86 0.00 0.00 0.00 64.98 05:15:21 PM 0 0.00 0.00 4.08 0.00 14.29 76.53 0.00 0.00 0.00 5.10 05:15:21 PM 1 9.09 0.00 16.16 0.00 1.01 0.00 0.00 0.00 0.00 73.74 05:15:21 PM 2 9.38 0.00 16.67 0.00 1.04 0.00 0.00 0.00 0.00 72.92 05:15:21 PM 3 10.42 0.00 17.71 0.00 1.04 0.00 0.00 0.00 0.00 70.83 05:15:21 PM 4 9.57 0.00 15.96 0.00 0.00 0.00 0.00 0.00 0.00 74.47 05:15:21 PM 5 9.18 0.00 15.31 0.00 0.00 1.02 0.00 0.00 0.00 74.49 05:15:21 PM 6 8.60 0.00 15.05 0.00 0.00 0.00 0.00 0.00 0.00 76.34 05:15:21 PM 7 12.37 0.00 14.43 0.00 0.00 0.00 0.00 0.00 0.00 73.20 Using SO_REUSEPORT helps the load distribution of NGINX be more balanced. [1] https://man7.org/linux/man-pages/man7/socket.7.html Signed-off-by: Tony Lu Acked-by: Wenjia Zhang Link: https://lore.kernel.org/r/20220922121906.72406-1-tonylu@linux.alibaba.com Signed-off-by: Paolo Abeni commit 0055e45d837483d644b868755eff6091b5b51ce0 Author: Thomas Zimmermann Date: Thu Sep 22 15:09:41 2022 +0200 drm/simpledrm: Use drm_atomic_get_new_plane_state() Lookup the plane's state in atomic_update with the helper drm_atomic_get_new_plane_state(). Also rename the helpers' state arguments. No functional changes. Suggested-by: Ville Syrjälä Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20220922130944.27138-3-tzimmermann@suse.de commit 7bfa5c7b28d66d89daf0808bf36ab7fe0e9e93a1 Author: Thomas Zimmermann Date: Thu Sep 22 15:09:40 2022 +0200 drm/simpledrm: Compute linestride with drm_format_info_min_pitch() If not given, compute the stride with drm_format_info_min_pitch(). It's the standard helper for this purpose. Suggested-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Fixes: fd9e3169e42b ("drm/simpledrm: Compute framebuffer stride if not set") Cc: Javier Martinez Canillas Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220922130944.27138-2-tzimmermann@suse.de commit 7326939faa4b8d078dd2b8cddc36b5758d9b984c Author: Eddie James Date: Tue Apr 26 10:49:55 2022 -0500 fsi: occ: Fix checksum failure mode Change the checksum errno to something different than the errno used for a bad SBE message. In addition, don't set the user's response length to the data length in this case, since it's not SBE FFDC. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220426154956.27205-2-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit f157555ea3b0f1f7ff19ca7d52576ab231fabfad Author: Luo Xueqin Date: Tue Jul 5 23:27:57 2022 +0800 fsi: Fix typo in comment Spelling mistake in comment. Reported-by: k2ci Signed-off-by: Luo Xueqin Link: https://lore.kernel.org/r/20220705152757.27843-1-luoxueqin66@gmail.com Signed-off-by: Joel Stanley commit ab46d8d40f01487bf637428c4767f0e75ac2a95a Author: Christoph Hellwig Date: Tue Sep 20 16:09:57 2022 +0200 nvmet: add helpers to set the result field for connect commands The code to set the result field for the admin and I/O connect commands is not only verbose and duplicated, but also violates the aliasing rules as it accesses both the u16 and u32 members in the union. Add a little helper to sort all that out. Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke commit 1c32a8012b7fabe469b6af826edfd4ae2a6201d3 Author: Christoph Hellwig Date: Tue Sep 20 15:38:58 2022 +0200 nvme: improve the NVME_CONNECT_AUTHREQ* definitions Mark them as unsigned so that we don't need extra casts, and define them relative to cdword0 instead of requiring extra shifts. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke commit 1befd944e05050d76950014f3dc04ed47faba2c3 Author: Christoph Hellwig Date: Tue Sep 20 15:37:18 2022 +0200 nvmet-auth: don't try to cancel a non-initialized work_struct Currently blktests nvme/002 trips up debugobjects if CONFIG_NVME_AUTH is enabled, but authentication is not on a queue. This is because nvmet_auth_sq_free cancels sq->auth_expired_work unconditionaly, while auth_expired_work is only ever initialized if authentication is enabled for a given controller. Fix this by calling most of what is nvmet_init_auth unconditionally when initializing the SQ, and just do the setting of the result field in the connect command handler. Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke commit 0700542a823ba3d3aa9c699a255aecc23dbbcaff Author: zhenwei pi Date: Thu Sep 22 15:06:16 2022 +0800 nvmet-tcp: remove nvmet_tcp_finish_cmd There is only a single call-site of nvmet_tcp_finish_cmd(), this becomes redundant. Remove nvmet_tcp_finish_cmd() and use the original function body instead. Suggested-by: Sagi Grimberg Signed-off-by: zhenwei pi Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit b6a545ffa2c192b1e6da4a7924edac5ba9f4ea2b Author: Varun Prakash Date: Wed Sep 21 00:06:49 2022 +0530 nvmet-tcp: add bounds check on Transfer Tag ttag is used as an index to get cmd in nvmet_tcp_handle_h2c_data_pdu(), add a bounds check to avoid out-of-bounds access. Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit f614b937d850193588f161ff854a4e19940a5e43 Author: Varun Prakash Date: Wed Sep 21 00:04:44 2022 +0530 nvmet-tcp: handle ICReq PDU received in NVMET_TCP_Q_LIVE state As per NVMe/TCP transport specification ICReq PDU is the first PDU received by the controller and controller should receive only one ICReq PDU. If controller receives more than one ICReq PDU then this can be considered as fatal error. nvmet-tcp driver does not check for ICReq PDU opcode if queue state is NVMET_TCP_Q_LIVE. In LIVE state ICReq PDU is treated as CapsuleCmd PDU, this can result in abnormal behavior. Add a check for ICReq PDU in nvmet_tcp_done_recv_pdu() to fix this issue. Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit db94f240280c1da8ba1e679c422312676549570d Author: zhenwei pi Date: Tue Sep 20 21:16:17 2022 +0800 nvmet-tcp: fix NULL pointer dereference during release nvmet-tcp frees CMD buffers in nvmet_tcp_uninit_data_in_cmds(), and waits the inflight IO requests in nvmet_sq_destroy(). During wait the inflight IO requests, the callback nvmet_tcp_queue_response() is called from backend after IO complete, this leads a typical Use-After-Free issue like this: BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 107f80067 P4D 107f80067 PUD 10789e067 PMD 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 123 Comm: kworker/1:1H Kdump: loaded Tainted: G E 6.0.0-rc2.bm.1-amd64 #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: nvmet_tcp_wq nvmet_tcp_io_work [nvmet_tcp] RIP: 0010:shash_ahash_digest+0x2b/0x110 Code: 1f 44 00 00 41 57 41 56 41 55 41 54 55 48 89 fd 53 48 89 f3 48 83 ec 08 44 8b 67 30 45 85 e4 74 1c 48 8b 57 38 b8 00 10 00 00 <44> 8b 7a 08 44 29 f8 39 42 0c 0f 46 42 0c 41 39 c4 76 43 48 8b 03 RSP: 0018:ffffc9000051bdd8 EFLAGS: 00010206 RAX: 0000000000001000 RBX: ffff888100ab5470 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff888100ab5470 RDI: ffff888100ab5420 RBP: ffff888100ab5420 R08: ffff8881024d08c8 R09: ffff888103e1b4b8 R10: 8080808080808080 R11: 0000000000000000 R12: 0000000000001000 R13: 0000000000000000 R14: ffff88813412bd4c R15: ffff8881024d0800 FS: 0000000000000000(0000) GS:ffff88883fa40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 0000000104b48000 CR4: 0000000000350ee0 Call Trace: nvmet_tcp_io_work+0xa52/0xb52 [nvmet_tcp] ? __switch_to+0x106/0x420 process_one_work+0x1ae/0x380 ? process_one_work+0x380/0x380 worker_thread+0x30/0x360 ? process_one_work+0x380/0x380 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Separate nvmet_tcp_uninit_data_in_cmds() into two steps: uninit data in cmds <- new step 1 nvmet_sq_destroy(); cancel_work_sync(&queue->io_work); free CMD buffers <- new step 2 Signed-off-by: zhenwei pi Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 6ee742fa8e5a7ee051604b16ec2ee6545461e794 Author: Keith Busch Date: Mon Sep 26 14:01:07 2022 -0700 nvme-pci: report the actual number of tagset maps We've been reporting 2 maps regardless of whether the module parameter asked for anything beyond the default queues. A consequence of this means that blk-mq will reinitialize the all the hardware contexts and io schedulers on every controller reset when the mapping is exactly the same as before. This unnecessary overhead is adding several milliseconds on a reset for environments that don't need it. Report the actual number of mappings in use. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 61ce339f19fabbc3e51237148a7ef6f2270e44fa Author: Rishabh Bhatnagar Date: Tue Sep 20 19:19:32 2022 +0000 nvme-pci: set min_align_mask before calculating max_hw_sectors If swiotlb is force enabled dma_max_mapping_size ends up calling swiotlb_max_mapping_size which takes into account the min align mask for the device. Set the min align mask for nvme driver before calling dma_max_mapping_size while calculating max hw sectors. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Christoph Hellwig commit f46ef9e87c9e8941b7acee45611c7c6a322592bb Author: Sagi Grimberg Date: Thu Sep 22 11:15:37 2022 +0300 nvme: send a rediscover uevent when a persistent discovery controller reconnects When a discovery controller is disconnected, no AENs will arrive to notify the host about discovery log change events. In order to solve this, send a uevent notification when a persistent discovery controller reconnects. We add a new ctrl flag NVME_CTRL_STARTED_ONCE that will be set on the first start, and consecutive calls will find it set, and send the event to userspace if the controller is a discovery controller. Upon the event reception, userspace will re-read the discovery log page and will act upon changes as it sees fit. Signed-off-by: Sagi Grimberg Reviewed-by: Daniel Wagner Reviewed-by: James Smart Signed-off-by: Christoph Hellwig commit bf093d971695f30e312d2d0567c5feecfbcef450 Author: Sagi Grimberg Date: Thu Sep 22 11:15:36 2022 +0300 nvme: enumerate controller flags We expect to grow a few of these flags for various purposes so make them a proper enumeration. Signed-off-by: Sagi Grimberg Reviewed-by: James Smart Reviewed-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 1da40c2667388dd70306bfd3d4dcb49fd20b50a9 Author: наб Date: Tue Sep 27 02:37:27 2022 +0200 Documentation: NBD_REQUEST_MAGIC isn't a magic number It's part of the line protocol, same as in commit 82805818898d ("Documentation: NBD_REPLY_MAGIC isn't a magic number") Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/20220927003727.slf4ofb7dgum6apt@tarta.nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 1e866afd4bcdd01a70a5eddb4371158d3035ce03 Author: Keith Busch Date: Thu Sep 22 08:13:47 2022 -0700 nvme: ensure subsystem reset is single threaded The subsystem reset writes to a register, so we have to ensure the device state is capable of handling that otherwise the driver may access unmapped registers. Use the state machine to ensure the subsystem reset doesn't try to write registers on a device already undergoing this type of reset. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214771 Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 23e085b2dead13b51fe86d27069895b740f749c0 Author: Keith Busch Date: Thu Sep 22 07:54:06 2022 -0700 nvme: restrict management ioctls to admin The passthrough commands already have this restriction, but the other operations do not. Require the same capabilities for all users as all of these operations, which include resets and rescans, can be disruptive. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit a8eb6c1ba48bddea82e8d74cbe6e119f006be97d Author: Keith Busch Date: Mon Sep 19 12:45:08 2022 -0700 nvme: copy firmware_rev on each init The firmware revision can change on after a reset so copy the most recent info each time instead of just the first time, otherwise the sysfs firmware_rev entry may contain stale data. Reported-by: Jeff Lien Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Chao Leng Signed-off-by: Christoph Hellwig commit bc8fb906b0ff9339b4286698cb7cd9cd5b8c53eb Author: Keith Busch Date: Mon Sep 19 12:36:46 2022 -0700 nvme: handle effects after freeing the request If a reset occurs after the scan work attempts to issue a command, the reset may quisce the admin queue, which blocks the scan work's command from dispatching. The scan work will not be able to complete while the queue is quiesced. Meanwhile, the reset work will cancel all outstanding admin tags and wait until all requests have transitioned to idle, which includes the passthrough request. But the passthrough request won't be set to idle until after the scan_work flushes, so we're deadlocked. Fix this by handling the end effects after the request has been freed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216354 Reported-by: Jonathan Derrick Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chao Leng Signed-off-by: Christoph Hellwig commit eee48781ea199e32c1d0c4732641c494833788ca Author: Frank Wunderlich Date: Mon Sep 26 17:07:39 2022 +0200 USB: serial: qcserial: add new usb-id for Dell branded EM7455 Add support for Dell 5811e (EM7455) with USB-id 0x413c:0x81c2. Signed-off-by: Frank Wunderlich Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit d1c442019594692c64a70a86ad88eb5b6db92216 Author: Andreas Pape Date: Mon Sep 26 18:58:13 2022 +0200 ALSA: dmaengine: increment buffer pointer atomically Setting pointer and afterwards checking for wraparound leads to the possibility of returning the inconsistent pointer position. This patch increments buffer pointer atomically to avoid this issue. Fixes: e7f73a1613567a ("ASoC: Add dmaengine PCM helper functions") Signed-off-by: Andreas Pape Signed-off-by: Eugeniu Rosca Link: https://lore.kernel.org/r/1664211493-11789-1-git-send-email-erosca@de.adit-jv.com Signed-off-by: Takashi Iwai commit 675b7cd16e21ce2452d4a11ed425996c34e5460c Author: Takashi Iwai Date: Mon Sep 26 15:55:58 2022 +0200 usb: gadget: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Reviewed-by: Greg Kroah-Hartman Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220926135558.26580-12-tiwai@suse.de Signed-off-by: Takashi Iwai commit a267fdd0a6ce3edd6419b10ee7bcde61aa15eb43 Author: Takashi Iwai Date: Mon Sep 26 15:55:57 2022 +0200 ASoC: sh: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Acked-by: Mark Brown Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220926135558.26580-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2bd2dc2672b2d0d45be371430970084330879a46 Author: Takashi Iwai Date: Mon Sep 26 15:55:56 2022 +0200 ASoC: intel: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Acked-by: Mark Brown Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220926135558.26580-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit ca4833c5a21bf419fe505e9798bbf49cbd482e8f Author: Takashi Iwai Date: Mon Sep 26 15:55:55 2022 +0200 ALSA: usx2y: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit d8b4efeeb37ae5e221be6b265a5b93f54c242e82 Author: Takashi Iwai Date: Mon Sep 26 15:55:54 2022 +0200 ALSA: usb-audio: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7246e5c80630bb4dfdd50c7de2c38c4a91fd36fc Author: Takashi Iwai Date: Mon Sep 26 15:55:53 2022 +0200 ALSA: asihpi: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 38d8be5df88539dc4a024250ab5988028e21826e Author: Takashi Iwai Date: Mon Sep 26 15:55:52 2022 +0200 ALSA: hda: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit 23cb0767f0544858169c02cec445d066d4e02e2b Author: Takashi Iwai Date: Mon Sep 26 15:55:51 2022 +0200 ALSA: firewire: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit f7efa9b8a7d959813c63275b2e980de996b8e626 Author: Takashi Iwai Date: Mon Sep 26 15:55:50 2022 +0200 ALSA: aloop: Replace runtime->status->state reference to runtime->state The recent change in ALSA core allows drivers to get the current PCM state directly from runtime object. Replace the calls accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1be2143fb7b19e247f7c4aa1097f85fe92c132bf Author: Takashi Iwai Date: Mon Sep 26 15:55:49 2022 +0200 ALSA: pcm: Make mmap status read-only The mmap status record should be read-only. Modifying it from user-space may screw up things unexpectedly, so let's clear the write bits at exposing it. Note that alsa-lib and other known user-space apps access the mmapped status only as read-only, hence this change shouldn't break the existing applications. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit f0061c18c169f0c32d96b59485c3edee85e343ed Author: Takashi Iwai Date: Mon Sep 26 15:55:48 2022 +0200 ALSA: pcm: Avoid reference to status->state In the PCM core and driver code, there are lots place referring to the current PCM state via runtime->status->state. This patch introduced a local PCM state in runtime itself and replaces those references with runtime->state. It has improvements in two aspects: - The reduction of a indirect access leads to more code optimization - It avoids a possible (unexpected) modification of the state via mmap of the status record The status->state is updated together with runtime->state, so that user-space can still read the current state via mmap like before, too. This patch touches only the ALSA core code. The changes in each driver will follow in later patches. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220926135558.26580-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 69ab6f5b00b1804ea42b375ca30d818d169cae82 Author: Christophe JAILLET Date: Sun Sep 25 15:20:46 2022 +0200 ALSA: Remove some left-over license text in include/uapi/sound/ There is already a SPDX-License-Identifier tag, so the corresponding license text can be removed. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/203c1db92c470925f31e361f6e7d180812501f2e.1664112023.git.christophe.jaillet@wanadoo.fr Signed-off-by: Takashi Iwai commit 1dd0dd0b1fefd1e51cfaddf62316f759fde7de7d Author: Christophe JAILLET Date: Sun Sep 25 14:57:51 2022 +0200 ALSA: firewire: Remove some left-over license text in sound/firewire There is already a SPDX-License-Identifier tag, so the corresponding license text can be removed. While at it, be more consistent and: - add a missing .c (ff-protocol-latter) - remove an empty line (motu-protocol-v1) Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/2bfe76c7eeb0f5205a1427e280bf8d9da0354a62.1664110649.git.christophe.jaillet@wanadoo.fr Signed-off-by: Takashi Iwai commit 31da107fdb0a01b889af41cd94a9904e1f6ffaa6 Author: Yue Hu Date: Tue Sep 27 11:25:18 2022 +0800 erofs: fold in z_erofs_reload_indexes() The name of this function looks not very accurate compared to it's implementation and it's only a wrapper to erofs_read_metabuf(). So, let's fold it directly instead. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220927032518.25266-1-zbestahu@gmail.com Signed-off-by: Gao Xiang commit 6cf5e9066dd3332cf4c77ea95a116f70e7f9acf7 Merge: a373f38cd1f5e d78c8b7131dc6 Author: Kalle Valo Date: Tue Sep 27 09:17:01 2022 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.1. Major changes: ath11k * cold boot calibration support on WCN6750 * Target Wake Time (TWT) debugfs support for STA interface * support to connect to a non-transmit MBSSID AP profile * enable remain-on-channel support on WCN6750 * implement SRAM dump debugfs interface * enable threaded NAPI on all hardware * WoW support for WCN6750 * support to provide transmit power from firmware via nl80211 * support to get power save duration for each client * spectral scan support for 160 MHz wcn36xx * add SNR from a received frame as a source of system entropy commit 15e74c6c1ce2d388e967f32cdaa83ca034fa6452 Author: Dominik Brodowski Date: Sat Sep 24 16:10:30 2022 +0200 pcmcia: remove AT91RM9200 Compact Flash driver As noted by Arnd Bergmann, "we used to have three drivers for the same hardware (pcmcia, pata and ide), and only the pcmcia driver remained in the tree after drivers/ide/ was removed and pata_at91 did not get converted to DT". "There is no dts file in tree that actually declares either of them, so chances are that nobody is actually using the CF slot on at91 any more."[1] On this rationale, remove the AT91RM9200 Compact Flash driver, which also assists in reaching "the goal of stopping exporting OF-specific APIs of gpiolib".[2] [1] https://lore.kernel.org/lkml/68c63077-848b-45f5-8aca-ed995391f2b6@www.fastmail.com/ [2] https://lore.kernel.org/lkml/Yy6d7TjqzUwGQnQa@penguin/ Acked-by: Dmitry Torokhov Acked-by: Linus Walleij Acked-by: Alexandre Belloni Acked-by: Arnd Bergmann Acked-by: Nicolas Ferre Signed-off-by: Dominik Brodowski commit a373f38cd1f5e86cae86157f0b77cf731c5049c1 Author: Ramesh Rangavittal Date: Thu Sep 22 05:41:40 2022 -0500 brcmfmac: Remove the call to "dtim_assoc" IOVAR When STA roams from one AP to another, after roam is complete, host driver tries to get TIM information from firmware. This is no longer supported in the firmware & hence, this call will always fail. This failure results in the below message being displayed on the console all the time when roam is done. ieee80211 phy0: brcmf_update_bss_info: wl dtim_assoc failed (-52) Changes ensure that the host driver will no longer try to get TIM information from firmware. Signed-off-by: Ramesh Rangavittal Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922104140.11889-5-ian.lin@infineon.com commit 11eda8f01d6a1b16341235459a6b2b5bf9a28669 Author: Lo(Double)Hsiang Lo Date: Thu Sep 22 05:41:39 2022 -0500 brcmfmac: increase dcmd maximum buffer size Increase dcmd maximum buffer size to match firmware configuration for new chips. Signed-off-by: Lo(Double)Hsiang Lo Signed-off-by: Chi-Hsien Lin Signed-off-by: Ian Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922104140.11889-4-ian.lin@infineon.com commit dce45ded761946c053b9901f4b49f0439d934251 Author: Alexander Prutskov Date: Thu Sep 22 05:41:38 2022 -0500 brcmfmac: Support 89459 pcie Adds support of 89459 chip pcie device and save restore support. Signed-off-by: Alexander Prutskov Signed-off-by: Joseph chuang Signed-off-by: Chi-Hsien Lin Signed-off-by: Ian Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922104140.11889-3-ian.lin@infineon.com commit 459e552bae9656453e5cb1fd826e19a75b621aa4 Author: Ryohei Kondo Date: Thu Sep 22 05:41:37 2022 -0500 brcmfmac: increase default max WOWL patterns to 16 4373 has support of 16 WOWL patterns thus increasing the default value Signed-off-by: Ryohei Kondo Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922104140.11889-2-ian.lin@infineon.com commit 86df5de5c632d3bd940f59bbb14ae912aa9cc363 Author: Xiaomeng Tong Date: Wed Apr 13 17:17:23 2022 +0800 cw1200: fix incorrect check to determine if no element is found in list The bug is here: "} else if (item) {". The list iterator value will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found in list. Use a new value 'iter' as the list iterator, while use the old value 'item' as a dedicated pointer to point to the found element, which 1. can fix this bug, due to now 'item' is NULL only if it's not found. 2. do not need to change all the uses of 'item' after the loop. 3. can also limit the scope of the list iterator 'iter' *only inside* the traversal loop by simply declaring 'iter' inside the loop in the future, as usage of the iterator outside of the list_for_each_entry is considered harmful. https://lkml.org/lkml/2022/2/17/1032 Fixes: a910e4a94f692 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Signed-off-by: Xiaomeng Tong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413091723.17596-1-xiam0nd.tong@gmail.com commit 24613f7c7f2dbd0b47ecdf9928600379e606dfda Author: Gustavo A. R. Silva Date: Mon Sep 26 16:48:21 2022 -0500 Input: applespi - replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/219 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/YzIeJeqU73G+UI8g@work Signed-off-by: Dmitry Torokhov commit 6a4ab8869d0bfcf83d7c5184561df8235553cf28 Author: Jon Doron Date: Sun Sep 25 10:04:31 2022 +0300 libbpf: Fix the case of running as non-root with capabilities When running rootless with special capabilities like: FOWNER / DAC_OVERRIDE / DAC_READ_SEARCH The "access" API will not make the proper check if there is really access to a file or not. >From the access man page: " The check is done using the calling process's real UID and GID, rather than the effective IDs as is done when actually attempting an operation (e.g., open(2)) on the file. Similarly, for the root user, the check uses the set of permitted capabilities rather than the set of effective capabilities; ***and for non-root users, the check uses an empty set of capabilities.*** " What that means is that for non-root user the access API will not do the proper validation if the process really has permission to a file or not. To resolve this this patch replaces all the access API calls with faccessat with AT_EACCESS flag. Signed-off-by: Jon Doron Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220925070431.1313680-1-arilou@gmail.com commit 46e0962ff2825790fecfc689f6f1135eab5c6e45 Author: Krzysztof Kozlowski Date: Sat Sep 24 10:13:29 2022 +0200 dt-bindings: clock: qcom,a53pll: replace maintainer Emails to codeaurora.org bounce ("Recipient address rejected: undeliverable address: No such user here."). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220924081329.15141-1-krzysztof.kozlowski@linaro.org commit 9666a702657e25e33f03dd326341e0d79b974662 Merge: 30b8fdbbe31b2 5b0d1c7bd5722 Author: Alexei Starovoitov Date: Mon Sep 26 20:40:44 2022 -0700 Merge branch 'enforce W^X for trampoline and dispatcher' Song Liu says: ==================== Changes v1 => v2: 1. Update arch_prepare_bpf_dispatcher to use a RO image and a RW buffer. (Alexei) Note: I haven't found an existing test to cover this part, so this part was tested manually (comparing the generated dispatcher is the same). Jeff Layton reported CPA W^X warning linux-next [1]. It turns out to be W^X issue with bpf trampoline and bpf dispatcher. Fix these by: 1. Use bpf_prog_pack for bpf_dispatcher; 2. Set memory permission properly with bpf trampoline. [1] https://lore.kernel.org/lkml/c84cc27c1a5031a003039748c3c099732a718aec.camel@kernel.org/ ==================== Signed-off-by: Alexei Starovoitov commit 5b0d1c7bd5722467960829af51d523f5a6ffd848 Author: Song Liu Date: Mon Sep 26 11:47:39 2022 -0700 bpf: Enforce W^X for bpf trampoline Mark the trampoline as RO+X after arch_prepare_bpf_trampoline, so that the trampoine follows W^X rule strictly. This will turn off warnings like CPA refuse W^X violation: 8000000000000163 -> 0000000000000163 range: ... Also remove bpf_jit_alloc_exec_page(), since it is not used any more. Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20220926184739.3512547-3-song@kernel.org Signed-off-by: Alexei Starovoitov commit 19c02415da2345d0dda2b5c4495bc17cc14b18b5 Author: Song Liu Date: Mon Sep 26 11:47:38 2022 -0700 bpf: use bpf_prog_pack for bpf_dispatcher Allocate bpf_dispatcher with bpf_prog_pack_alloc so that bpf_dispatcher can share pages with bpf programs. arch_prepare_bpf_dispatcher() is updated to provide a RW buffer as working area for arch code to write to. This also fixes CPA W^X warnning like: CPA refuse W^X violation: 8000000000000163 -> 0000000000000163 range: ... Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20220926184739.3512547-2-song@kernel.org Signed-off-by: Alexei Starovoitov commit 30b8fdbbe31b2422f46fcd6d3960e563affe76d7 Merge: bec217197b412 738c345b74b8d Author: Alexei Starovoitov Date: Mon Sep 26 20:30:40 2022 -0700 Merge branch 'bpf: Fixes for CONFIG_X86_KERNEL_IBT' Jiri Olsa says: ==================== Martynas reported bpf_get_func_ip returning +4 address when CONFIG_X86_KERNEL_IBT option is enabled and I found there are some failing bpf tests when this option is enabled. The CONFIG_X86_KERNEL_IBT option adds endbr instruction at the function entry, so the idea is to 'fix' entry ip for kprobe_multi and trampoline probes, because they are placed on the function entry. v5 changes: - updated uapi/linux/bpf.h headers with comment for bpf_get_func_ip returning 0 [Andrii] - added acks v4 changes: - used get_kernel_nofault to read previous instruction [Peter] - used movabs instruction in trampoline comment [Peter] - renamed fentry_ip argument in kprobe_multi_link_handler [Peter] v3 changes: - using 'unused' bpf function to get IBT config option into selftest skeleton - rebased to current bpf-next/master - added ack/review from Masami v2 changes: - change kprobes get_func_ip to return zero for kprobes attached within the function body [Andrii] - detect IBT config and properly test kprobe with offset [Andrii] v1 changes: - read previous instruction in kprobe_multi link handler and adjust entry_ip for CONFIG_X86_KERNEL_IBT option - split first patch into 2 separate changes - update changelogs ==================== Acked-by: Peter Zijlstra (Intel) Signed-off-by: Alexei Starovoitov commit 738c345b74b8d11edd01b6cee5628c6b8368d8ea Author: Jiri Olsa Date: Mon Sep 26 17:33:40 2022 +0200 selftests/bpf: Fix get_func_ip offset test for CONFIG_X86_KERNEL_IBT With CONFIG_X86_KERNEL_IBT enabled the test for kprobe with offset won't work because of the extra endbr instruction. As suggested by Andrii adding CONFIG_X86_KERNEL_IBT detection and using appropriate offset value based on that. Also removing test7 program, because it does the same as test6. Suggested-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-7-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 0e253f7e558a3e250902ba2034091e0185448836 Author: Jiri Olsa Date: Mon Sep 26 17:33:39 2022 +0200 bpf: Return value in kprobe get_func_ip only for entry address Changing return value of kprobe's version of bpf_get_func_ip to return zero if the attach address is not on the function's entry point. For kprobes attached in the middle of the function we can't easily get to the function address especially now with the CONFIG_X86_KERNEL_IBT support. If user cares about current IP for kprobes attached within the function body, they can get it with PT_REGS_IP(ctx). Suggested-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Acked-by: Martynas Pumputis Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-6-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit c09eb2e578eb1668bbc84dc07e8d8bd6f04b9a02 Author: Jiri Olsa Date: Mon Sep 26 17:33:38 2022 +0200 bpf: Adjust kprobe_multi entry_ip for CONFIG_X86_KERNEL_IBT Martynas reported bpf_get_func_ip returning +4 address when CONFIG_X86_KERNEL_IBT option is enabled. When CONFIG_X86_KERNEL_IBT is enabled we'll have endbr instruction at the function entry, which screws return value of bpf_get_func_ip() helper that should return the function address. There's short term workaround for kprobe_multi bpf program made by Alexei [1], but we need this fixup also for bpf_get_attach_cookie, that returns cookie based on the entry_ip value. Moving the fixup in the fprobe handler, so both bpf_get_func_ip and bpf_get_attach_cookie get expected function address when CONFIG_X86_KERNEL_IBT option is enabled. Also renaming kprobe_multi_link_handler entry_ip argument to fentry_ip so it's clearer this is an ftrace __fentry__ ip. [1] commit 7f0059b58f02 ("selftests/bpf: Fix kprobe_multi test.") Cc: Peter Zijlstra Reported-by: Martynas Pumputis Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-5-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 4d854f4f31ec4b317dfe316111ddac0fab81f735 Author: Jiri Olsa Date: Mon Sep 26 17:33:37 2022 +0200 bpf: Use given function address for trampoline ip arg Using function address given at the generation time as the trampoline ip argument. This way we get directly the function address that we need, so we don't need to: - read the ip from the stack - subtract X86_PATCH_SIZE - subtract ENDBR_INSN_SIZE if CONFIG_X86_KERNEL_IBT is enabled which is not even implemented yet ;-) Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-4-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 9d68c19c57d690547cde977bb3d9ccd3ceb6afe9 Author: Jiri Olsa Date: Mon Sep 26 17:33:36 2022 +0200 ftrace: Keep the resolved addr in kallsyms_callback Keeping the resolved 'addr' in kallsyms_callback, instead of taking ftrace_location value, because we depend on symbol address in the cookie related code. With CONFIG_X86_KERNEL_IBT option the ftrace_location value differs from symbol address, which screwes the symbol address cookies matching. There are 2 users of this function: - bpf_kprobe_multi_link_attach for which this fix is for - get_ftrace_locations which is used by register_fprobe_syms this function needs to get symbols resolved to addresses, but does not need 'ftrace location addresses' at this point there's another ftrace location translation in the path done by ftrace_set_filter_ips call: register_fprobe_syms addrs = get_ftrace_locations register_fprobe_ips(addrs) ... ftrace_set_filter_ips ... __ftrace_match_addr ip = ftrace_location(ip); ... Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-3-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit bf7a87f1075f67c286f794519f0fedfa8b0b18cc Author: Jiri Olsa Date: Mon Sep 26 17:33:35 2022 +0200 kprobes: Add new KPROBE_FLAG_ON_FUNC_ENTRY kprobe flag Adding KPROBE_FLAG_ON_FUNC_ENTRY kprobe flag to indicate that attach address is on function entry. This is used in following changes in get_func_ip helper to return correct function address. Acked-by: Masami Hiramatsu (Google) Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220926153340.1621984-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 9e48f0519bae644d91c85d0a99ea5887688e4bd5 Author: Iskren Chernev Date: Tue Aug 30 10:56:20 2022 +0300 clk: qcom: Merge alt alpha plls for qcm2260, sm6115 The qcom2260 and sm6115 GCC drivers use a common modified DEFAULT and BRAMMO alpha pll offsets. Move these common offsets to the shared place to avoid duplication. The new layouts have a suffix EVO similar to LUCID and RIVIAN. Signed-off-by: Iskren Chernev Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220830075620.974009-4-iskren.chernev@gmail.com commit 65f1fa35aa70b9e5abfd184ce3078c9aa93a1cb4 Author: Iskren Chernev Date: Tue Aug 30 10:56:19 2022 +0300 clk: qcom: gcc-sm6115: Move alpha pll bramo overrides sm6115 uses a modified default and bramo alpha pll offsets. Put them in the same place for consistency. Signed-off-by: Iskren Chernev Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220830075620.974009-3-iskren.chernev@gmail.com commit 068a0605ef5a6b430e7278c169bfcd25b680b28f Author: Adam Skladowski Date: Tue Aug 30 10:56:18 2022 +0300 clk: qcom: gcc-sm6115: Override default Alpha PLL regs The DEFAULT and BRAMMO PLL offsets are non-standard in downstream, but currently only BRAMMO ones are overridden. Override DEFAULT ones too. A very similar thing is happening in gcc-qcm2290 driver. Fixes: cbe63bfdc54f ("clk: qcom: Add Global Clock controller (GCC) driver for SM6115") Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220830075620.974009-2-iskren.chernev@gmail.com commit 16fb89f92ec4412ac49ddca64944d5f72e063f69 Author: Dmitry Baryshkov Date: Fri Sep 9 01:28:49 2022 +0300 clk: qcom: Add support for Display Clock Controller on SM8450 Add support for the dispcc on Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908222850.3552050-4-dmitry.baryshkov@linaro.org commit 9d062edd561f594b71130c4846c9032bfec8d97f Author: Dmitry Baryshkov Date: Fri Sep 9 01:28:48 2022 +0300 clk: qcom: alpha-pll: add support for power off mode for lucid evo PLL PLLs can be kept in standby (default configuration) or in off mode when disabled during power collapse. Hence add support for pll disable off mode for lucid evo PLL. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908222850.3552050-3-dmitry.baryshkov@linaro.org commit a7edd291636ac0bddf6c5a5aef6a94c2a9794830 Author: Dmitry Baryshkov Date: Fri Sep 9 01:28:47 2022 +0300 dt-bindings: clock: qcom: add bindings for dispcc on SM8450 Add device tree bindings for the display clock controller on Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908222850.3552050-2-dmitry.baryshkov@linaro.org commit 9b518788631cf7bc2b10d3967fd2343d1c88d65c Author: Adam Skladowski Date: Sun Sep 11 18:46:19 2022 +0200 clk: qcom: Add display clock controller driver for SM6115 Add support for the display clock controller found in SM6115/SM4250 based devices. This clock controller feeds the Multimedia Display SubSystem (MDSS). This driver is based upon one submitted for QCM2290. Signed-off-by: Adam Skladowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220911164635.182973-3-a39.skl@gmail.com commit 38557c6fc0771be5791e16837342db581daa6379 Author: Adam Skladowski Date: Sun Sep 11 18:46:18 2022 +0200 dt-bindings: clock: add QCOM SM6115 display clock bindings Add device tree bindings for display clock controller for Qualcomm Technology Inc's SM6115 SoC. Signed-off-by: Adam Skladowski Reviewed-by: Rob Herring [bjorn: Minor fix of binding description] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220911164635.182973-2-a39.skl@gmail.com commit 1a58ee1330b2cb6d71feb0aaf827cc10030f78b4 Author: Krishna chaitanya chundru Date: Tue Sep 20 15:52:27 2022 +0530 clk: qcom: gcc-sc7280: Update the .pwrsts for PCIe GDSC Enabling PCIe GDSC retention to ensure controller and its dependent clocks won't go down during system suspend. Update the .pwrsts for PCIe GDSC so it only transitions to RET in low power. Signed-off-by: Krishna chaitanya chundru Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1663669347-29308-6-git-send-email-quic_krichai@quicinc.com commit 21b7bdb504ae6b0a795c8d63818611ce02b532c1 Author: xu xin Date: Tue Aug 30 14:40:03 2022 +0000 ksm: add profit monitoring documentation Add the description of KSM profit and how to determine it separately in system-wide range and inner a single process. Link: https://lkml.kernel.org/r/20220830144003.299870-1-xu.xin16@zte.com.cn Signed-off-by: xu xin Reviewed-by: Xiaokai Ran Reviewed-by: Yang Yang Reviewed-by: Bagas Sanjaya Cc: Alexey Dobriyan Cc: Hugh Dickins Cc: Izik Eidus Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit cb4df4cae4f2bd8cf7a32eff81178fce31600f7c Author: xu xin Date: Tue Aug 30 14:38:38 2022 +0000 ksm: count allocated ksm rmap_items for each process Patch series "ksm: count allocated rmap_items and update documentation", v5. KSM can save memory by merging identical pages, but also can consume additional memory, because it needs to generate rmap_items to save each scanned page's brief rmap information. To determine how beneficial the ksm-policy (like madvise), they are using brings, so we add a new interface /proc//ksm_stat for each process The value "ksm_rmap_items" in it indicates the total allocated ksm rmap_items of this process. The detailed description can be seen in the following patches' commit message. This patch (of 2): KSM can save memory by merging identical pages, but also can consume additional memory, because it needs to generate rmap_items to save each scanned page's brief rmap information. Some of these pages may be merged, but some may not be abled to be merged after being checked several times, which are unprofitable memory consumed. The information about whether KSM save memory or consume memory in system-wide range can be determined by the comprehensive calculation of pages_sharing, pages_shared, pages_unshared and pages_volatile. A simple approximate calculation: profit =~ pages_sharing * sizeof(page) - (all_rmap_items) * sizeof(rmap_item); where all_rmap_items equals to the sum of pages_sharing, pages_shared, pages_unshared and pages_volatile. But we cannot calculate this kind of ksm profit inner single-process wide because the information of ksm rmap_item's number of a process is lacked. For user applications, if this kind of information could be obtained, it helps upper users know how beneficial the ksm-policy (like madvise) they are using brings, and then optimize their app code. For example, one application madvise 1000 pages as MERGEABLE, while only a few pages are really merged, then it's not cost-efficient. So we add a new interface /proc//ksm_stat for each process in which the value of ksm_rmap_itmes is only shown now and so more values can be added in future. So similarly, we can calculate the ksm profit approximately for a single process by: profit =~ ksm_merging_pages * sizeof(page) - ksm_rmap_items * sizeof(rmap_item); where ksm_merging_pages is shown at /proc//ksm_merging_pages, and ksm_rmap_items is shown in /proc//ksm_stat. Link: https://lkml.kernel.org/r/20220830143731.299702-1-xu.xin16@zte.com.cn Link: https://lkml.kernel.org/r/20220830143838.299758-1-xu.xin16@zte.com.cn Signed-off-by: xu xin Reviewed-by: Xiaokai Ran Reviewed-by: Yang Yang Signed-off-by: CGEL ZTE Cc: Alexey Dobriyan Cc: Bagas Sanjaya Cc: Hugh Dickins Cc: Izik Eidus Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit e6ad640bc404eb298dd1880113131768ddf5c6a8 Author: Shakeel Butt Date: Fri Aug 26 23:06:42 2022 +0000 mm: deduplicate cacheline padding code There are three users (mmzone.h, memcontrol.h, page_counter.h) using similar code for forcing cacheline padding between fields of different structures. Dedup that code. Link: https://lkml.kernel.org/r/20220826230642.566725-1-shakeelb@google.com Signed-off-by: Shakeel Butt Suggested-by: Feng Tang Reviewed-by: Feng Tang Acked-by: Michal Hocko Signed-off-by: Andrew Morton commit 974f4367dd315acc15ad4a6453f8304aea60dfbd Author: Michal Hocko Date: Tue Aug 23 11:22:30 2022 +0200 mm: reduce noise in show_mem for lowmem allocations While discussing early DMA pool pre-allocation failure with Christoph [1] I have realized that the allocation failure warning is rather noisy for constrained allocations like GFP_DMA{32}. Those zones are usually not populated on all nodes very often as their memory ranges are constrained. This is an attempt to reduce the ballast that doesn't provide any relevant information for those allocation failures investigation. Please note that I have only compile tested it (in my default config setup) and I am throwing it mostly to see what people think about it. [1] http://lkml.kernel.org/r/20220817060647.1032426-1-hch@lst.de [mhocko@suse.com: update] Link: https://lkml.kernel.org/r/Yw29bmJTIkKogTiW@dhcp22.suse.cz [mhocko@suse.com: fix build] [akpm@linux-foundation.org: fix it for mapletree] [akpm@linux-foundation.org: update it for Michal's update] [mhocko@suse.com: fix arch/powerpc/xmon/xmon.c] Link: https://lkml.kernel.org/r/Ywh3C4dKB9B93jIy@dhcp22.suse.cz [akpm@linux-foundation.org: fix arch/sparc/kernel/setup_32.c] Link: https://lkml.kernel.org/r/YwScVmVofIZkopkF@dhcp22.suse.cz Signed-off-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Christoph Hellwig Cc: Mel Gorman Cc: Dan Carpenter Signed-off-by: Andrew Morton commit 7014887a01587d8c50871d5985cd572ca08b29c0 Author: David Hildenbrand Date: Thu Aug 25 18:46:59 2022 +0200 mm: fixup documentation regarding pte_numa() and PROT_NUMA pte_numa() no longer exists -- replaced by pte_protnone() -- and PROT_NUMA probably never existed: MM_CP_PROT_NUMA also ends up using PROT_NONE. Let's fixup the doc. Link: https://lkml.kernel.org/r/20220825164659.89824-4-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: John Hubbard Cc: Matthew Wilcox Cc: Mel Gorman Cc: Peter Xu Signed-off-by: Andrew Morton commit 0cf459866a91c741eb14a92f3633638d1dd9db59 Author: David Hildenbrand Date: Thu Aug 25 18:46:58 2022 +0200 mm/gup: use gup_can_follow_protnone() also in GUP-fast There seems to be no reason why FOLL_FORCE during GUP-fast would have to fallback to the slow path when stumbling over a PROT_NONE mapped page. We only have to trigger hinting faults in case FOLL_FORCE is not set, and any kind of fault handling naturally happens from the slow path -- where NUMA hinting accounting/handling would be performed. Note that the comment regarding THP migration is outdated: commit 2b4847e73004 ("mm: numa: serialise parallel get_user_page against THP migration") described that this was required for THP due to lack of PMD migration entries. Nowadays, we do have proper PMD migration entries in place -- see set_pmd_migration_entry(), which does a proper pmdp_invalidate() when placing the migration entry. So let's just reuse gup_can_follow_protnone() here to make it consistent and drop the somewhat outdated comments. Link: https://lkml.kernel.org/r/20220825164659.89824-3-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: John Hubbard Cc: Matthew Wilcox Cc: Mel Gorman Cc: Peter Xu Signed-off-by: Andrew Morton commit 474098edac262ae26bfab1c48445877075a31cbd Author: David Hildenbrand Date: Thu Aug 25 18:46:57 2022 +0200 mm/gup: replace FOLL_NUMA by gup_can_follow_protnone() Patch series "mm: minor cleanups around NUMA hinting". Working on some GUP cleanups (e.g., getting rid of some FOLL_ flags) and preparing for other GUP changes (getting rid of FOLL_FORCE|FOLL_WRITE for for taking a R/O longterm pin), this is something I can easily send out independently. Get rid of FOLL_NUMA, allow FOLL_FORCE access to PROT_NONE mapped pages in GUP-fast, and fixup some documentation around NUMA hinting. This patch (of 3): No need for a special flag that is not even properly documented to be internal-only. Let's just factor this check out and get rid of this flag. The separate function has the nice benefit that we can centralize comments. Link: https://lkml.kernel.org/r/20220825164659.89824-2-david@redhat.com Link: https://lkml.kernel.org/r/20220825164659.89824-1-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: John Hubbard Cc: Matthew Wilcox Cc: Mel Gorman Cc: Peter Xu Signed-off-by: Andrew Morton commit f7091ed64ec8311b0c35865875f8c3e04e5ea532 Author: Haiyue Wang Date: Tue Aug 23 21:58:41 2022 +0800 mm: fix the handling Non-LRU pages returned by follow_page The handling Non-LRU pages returned by follow_page() jumps directly, it doesn't call put_page() to handle the reference count, since 'FOLL_GET' flag for follow_page() has get_page() called. Fix the zone device page check by handling the page reference count correctly before returning. And as David reviewed, "device pages are never PageKsm pages". Drop this zone device page check for break_ksm(). Since the zone device page can't be a transparent huge page, so drop the redundant zone device page check for split_huge_pages_pid(). (by Miaohe) Link: https://lkml.kernel.org/r/20220823135841.934465-3-haiyue.wang@intel.com Fixes: 3218f8712d6b ("mm: handling Non-LRU pages returned by vm_normal_pages") Signed-off-by: Haiyue Wang Reviewed-by: "Huang, Ying" Reviewed-by: Felix Kuehling Reviewed-by: Alistair Popple Reviewed-by: Miaohe Lin Acked-by: David Hildenbrand Cc: Alex Sierra Cc: Gerald Schaefer Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit ca3d76b0aa808a06997297d123b66d17b81e5285 Author: Jakub Matěna Date: Fri Jun 3 16:57:19 2022 +0200 mm: add merging after mremap resize When mremap call results in expansion, it might be possible to merge the VMA with the next VMA which might become adjacent. This patch adds vma_merge call after the expansion is done to try and merge. [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/20220603145719.1012094-3-matenajakub@gmail.com Signed-off-by: Jakub Matěna Reviewed-by: Vlastimil Babka Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Liam Howlett Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michal Hocko Cc: Peter Zijlstra (Intel) Cc: Rik van Riel Cc: Steven Rostedt Signed-off-by: Andrew Morton commit eef199440df950942b3c7ef2e2de507fd6ced031 Author: Jakub Matěna Date: Fri Jun 3 16:57:18 2022 +0200 mm: refactor of vma_merge() Patch series "Refactor of vma_merge and new merge call", v4. I am currently working on my master's thesis trying to increase number of merges of VMAs currently failing because of page offset incompatibility and difference in their anon_vmas. The following refactor and added merge call included in this series is just two smaller upgrades I created along the way. This patch (of 2): Refactor vma_merge() to make it shorter and more understandable. Main change is the elimination of code duplicity in the case of merge next check. This is done by first doing checks and caching the results before executing the merge itself. The variable 'area' is divided into 'mid' and 'res' as previously it was used for two purposes, as the middle VMA between prev and next and also as the result of the merge itself. Exit paths are also unified. Link: https://lkml.kernel.org/r/20220603145719.1012094-1-matenajakub@gmail.com Link: https://lkml.kernel.org/r/20220603145719.1012094-2-matenajakub@gmail.com Signed-off-by: Jakub Matěna Reviewed-by: Vlastimil Babka Cc: Michal Hocko Cc: Mel Gorman Cc: Matthew Wilcox Cc: Liam Howlett Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Rik van Riel Cc: Steven Rostedt Cc: Peter Zijlstra (Intel) Signed-off-by: Andrew Morton commit b3541d912a84dc40cabb516f2deeac9ae6fa30da Author: Suren Baghdasaryan Date: Tue May 31 15:31:00 2022 -0700 mm: delete unused MMF_OOM_VICTIM flag With the last usage of MMF_OOM_VICTIM in exit_mmap gone, this flag is now unused and can be removed. [akpm@linux-foundation.org: remove comment about now-removed mm_is_oom_victim()] Link: https://lkml.kernel.org/r/20220531223100.510392-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox Cc: Johannes Weiner Cc: Roman Gushchin Cc: Minchan Kim Cc: "Kirill A . Shutemov" Cc: Andrea Arcangeli Cc: Christian Brauner (Microsoft) Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: David Hildenbrand Cc: Jann Horn Cc: Shakeel Butt Cc: Peter Xu Cc: John Hubbard Cc: Shuah Khan Cc: Liam Howlett Signed-off-by: Andrew Morton commit bf3980c85212fc71512d27a46f5aab66f46ca284 Author: Suren Baghdasaryan Date: Tue May 31 15:30:59 2022 -0700 mm: drop oom code from exit_mmap The primary reason to invoke the oom reaper from the exit_mmap path used to be a prevention of an excessive oom killing if the oom victim exit races with the oom reaper (see [1] for more details). The invocation has moved around since then because of the interaction with the munlock logic but the underlying reason has remained the same (see [2]). Munlock code is no longer a problem since [3] and there shouldn't be any blocking operation before the memory is unmapped by exit_mmap so the oom reaper invocation can be dropped. The unmapping part can be done with the non-exclusive mmap_sem and the exclusive one is only required when page tables are freed. Remove the oom_reaper from exit_mmap which will make the code easier to read. This is really unlikely to make any observable difference although some microbenchmarks could benefit from one less branch that needs to be evaluated even though it almost never is true. [1] 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") [2] 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") [3] a213e5cf71cb ("mm/munlock: delete munlock_vma_pages_all(), allow oomreap") [akpm@linux-foundation.org: restore Suren's mmap_read_lock() optimization] Link: https://lkml.kernel.org/r/20220531223100.510392-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: Andrea Arcangeli Cc: Christian Brauner (Microsoft) Cc: Christoph Hellwig Cc: David Hildenbrand Cc: David Rientjes Cc: Jann Horn Cc: Johannes Weiner Cc: John Hubbard Cc: "Kirill A . Shutemov" Cc: Liam Howlett Cc: Matthew Wilcox Cc: Minchan Kim Cc: Oleg Nesterov Cc: Peter Xu Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Signed-off-by: Andrew Morton commit 66071896cdfe096fcd4aef55a5efbd5216fa15de Author: Liam Howlett Date: Wed Jun 15 17:40:58 2022 +0000 mm/mlock: drop dead code in count_mm_mlocked_page_nr() The check for mm being null has never been needed since the only caller has always passed in current->mm. Remove the check from count_mm_mlocked_page_nr(). Link: https://lkml.kernel.org/r/20220615174050.738523-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Lukas Bulwahn Signed-off-by: Andrew Morton commit c154124fe925a451e471233aa7d1ab9a91f0a5ad Author: Liam R. Howlett Date: Tue Sep 6 19:49:06 2022 +0000 mm/mmap.c: pass in mapping to __vma_link_file() __vma_link_file() resolves the mapping from the file, if there is one. Pass through the mapping and check the vm_file externally since most places already have the required information and check of vm_file. Link: https://lkml.kernel.org/r/20220906194824.2110408-71-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit d0601a500c35856f9c134126b2423c9cfc86c701 Author: Liam R. Howlett Date: Tue Sep 6 19:49:06 2022 +0000 mm/mmap: drop range_has_overlap() function Since there is no longer a linked list, the range_has_overlap() function is identical to the find_vma_intersection() function. Link: https://lkml.kernel.org/r/20220906194824.2110408-70-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 763ecb035029f500d7e6dc99acd1ad299b7726a1 Author: Liam R. Howlett Date: Tue Sep 6 19:49:06 2022 +0000 mm: remove the vma linked list Replace any vm_next use with vma_find(). Update free_pgtables(), unmap_vmas(), and zap_page_range() to use the maple tree. Use the new free_pgtables() and unmap_vmas() in do_mas_align_munmap(). At the same time, alter the loop to be more compact. Now that free_pgtables() and unmap_vmas() take a maple tree as an argument, rearrange do_mas_align_munmap() to use the new tree to hold the vmas to remove. Remove __vma_link_list() and __vma_unlink_list() as they are exclusively used to update the linked list. Drop linked list update from __insert_vm_struct(). Rework validation of tree as it was depending on the linked list. [yang.lee@linux.alibaba.com: fix one kernel-doc comment] Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1949 Link: https://lkml.kernel.org/r/20220824021918.94116-1-yang.lee@linux.alibaba.comLink: https://lkml.kernel.org/r/20220906194824.2110408-69-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Yang Li Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 78ba531ff3ec2a444001853d8636ff39ed11ca28 Author: Liam R. Howlett Date: Tue Sep 6 19:49:05 2022 +0000 mm/vmscan: use vma iterator instead of vm_next Use the vma iterator in in get_next_vma() instead of the linked list. [yuzhao@google.com: mm/vmscan: use the proper VMA iterator] Link: https://lkml.kernel.org/r/Yx+QGOgHg1Wk8tGK@google.com Link: https://lkml.kernel.org/r/20220906194824.2110408-68-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Yu Zhao Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 9b580a1d60de0e1c8957e63859aa989196952e63 Author: Liam R. Howlett Date: Tue Sep 6 19:49:05 2022 +0000 riscv: use vma iterator for vdso Remove the linked list use in favour of the vma iterator. Link: https://lkml.kernel.org/r/20220906194824.2110408-67-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 8220543df1489ef96c3d4e8b0b3b03c340e3943e Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:05 2022 +0000 nommu: remove uses of VMA linked list Use the maple tree or VMA iterator instead. This is faster and will allow us to shrink the VMA. Link: https://lkml.kernel.org/r/20220906194824.2110408-66-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit f683b9d613193362ceb954c216f663a43c027302 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:04 2022 +0000 i915: use the VMA iterator Replace the linked list in probe_range() with the VMA iterator. Link: https://lkml.kernel.org/r/20220906194824.2110408-65-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 208c09db6d88f4442fb755d20cfb237a37a49f48 Author: Liam R. Howlett Date: Tue Sep 6 19:49:04 2022 +0000 mm/swapfile: use vma iterator instead of vma linked list unuse_mm() no longer needs to reference the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-64-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 9ec08f30f86d70b8891c25642df7d1f16647fde4 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:04 2022 +0000 mm/pagewalk: use vma_find() instead of vma linked list walk_page_range() no longer uses the one vma linked list reference. Link: https://lkml.kernel.org/r/20220906194824.2110408-63-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit e1c2c775d448be0503a3ac90681d86980919bad0 Author: Liam R. Howlett Date: Tue Sep 6 19:49:03 2022 +0000 mm/oom_kill: use vma iterators instead of vma linked list Use vma iterator in preparation of removing the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-62-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 4267d1fd7825454ed41ebf53af62e7cedd779f83 Author: Liam R. Howlett Date: Tue Sep 6 19:49:03 2022 +0000 mm/msync: use vma_find() instead of vma linked list Remove a single use of the vma linked list in preparation for the removal of the linked list. Uses find_vma() to get the next element. Link: https://lkml.kernel.org/r/20220906194824.2110408-61-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 396a44cc58910317b03dd73a93ab4fe6b76df658 Author: Liam R. Howlett Date: Tue Sep 6 19:49:03 2022 +0000 mm/mremap: use vma_find_intersection() instead of vma linked list Using the vma_find_intersection() call allows for cleaner code and removes linked list users in preparation of the linked list removal. Also remove one user of the linked list at the same time in favour of find_vma(). Link: https://lkml.kernel.org/r/20220906194824.2110408-60-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 70821e0b89dd477109c42a92d571f6dc6f6aa956 Author: Liam R. Howlett Date: Tue Sep 6 19:49:02 2022 +0000 mm/mprotect: use maple tree navigation instead of VMA linked list Switch to navigating the VMA list with the maple tree operators in preparation for removing the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-59-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 33108b05f39b78137c38c677b7a2d0fb7defed14 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:02 2022 +0000 mm/mlock: use vma iterator and maple state instead of vma linked list Handle overflow checking in count_mm_mlocked_page_nr() differently. Link: https://lkml.kernel.org/r/20220906194824.2110408-58-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 66850be55e8e5f371db2c091751a932a656c5f4d Author: Liam R. Howlett Date: Tue Sep 6 19:49:02 2022 +0000 mm/mempolicy: use vma iterator & maple state instead of vma linked list Reworked the way mbind_range() finds the first VMA to reuse the maple state and limit the number of tree walks needed. Note, this drops the VM_BUG_ON(!vma) call, which would catch a start address higher than the last VMA. The code was written in a way that allowed no VMA updates to occur and still return success. There should be no functional change to this scenario with the new code. Link: https://lkml.kernel.org/r/20220906194824.2110408-57-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit ba0aff8ea6ff0ba4dacfc896facadf3d91c8cd8a Author: Liam R. Howlett Date: Tue Sep 6 19:49:01 2022 +0000 mm/memcontrol: stop using mm->highest_vm_end Pass through ULONG_MAX instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-56-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 3547481831acd99d6f9c3b2cef16f269e6eaad9c Author: Liam R. Howlett Date: Tue Sep 6 19:49:01 2022 +0000 mm/madvise: use vma_find() instead of vma linked list madvise_walk_vmas() no longer uses linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-55-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit a5f18ba0727656bd1fe3bcdb0d563f81790f9a04 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:01 2022 +0000 mm/ksm: use vma iterators instead of vma linked list Remove the use of the linked list for eventual removal. Link: https://lkml.kernel.org/r/20220906194824.2110408-54-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 685405020b9f24ec979d41e6c27207be97c000cf Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:49:00 2022 +0000 mm/khugepaged: stop using vma linked list Use vma iterator & find_vma() instead of vma linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-53-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit c4d1a92d0d3ada8a4073b8af8eff462d689d64c5 Author: Liam R. Howlett Date: Tue Sep 6 19:49:00 2022 +0000 mm/gup: use maple tree navigation instead of linked list Use find_vma_intersection() to locate the VMAs in __mm_populate() instead of using find_vma() and the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-52-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit becc8cdb6cb28d9fd3ecf890d1d6e59118a6a53d Author: Liam R. Howlett Date: Tue Sep 6 19:48:59 2022 +0000 bpf: remove VMA linked list Use vma_next() and remove reference to the start of the linked list Link: https://lkml.kernel.org/r/20220906194824.2110408-51-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit fa5e587679f034530e8c14bc1c466490053b2ff2 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:59 2022 +0000 fork: use VMA iterator The VMA iterator is faster than the linked list and removing the linked list will shrink the vm_area_struct. Link: https://lkml.kernel.org/r/20220906194824.2110408-50-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 0cd4d02c32123afc25647f1d7123bc13b51ac56b Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:59 2022 +0000 sched: use maple tree iterator to walk VMAs The linked list is slower than walking the VMAs using the maple tree. We can't use the VMA iterator here because it doesn't support moving to an earlier position. Link: https://lkml.kernel.org/r/20220906194824.2110408-49-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit fcb72a585aaa4caced555e98f8444e6162912cb7 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:58 2022 +0000 perf: use VMA iterator The VMA iterator is faster than the linked list and removing the linked list will shrink the vm_area_struct. Link: https://lkml.kernel.org/r/20220906194824.2110408-48-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 160c820023bbfe7c478ed3041cc50604d664f047 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:58 2022 +0000 acct: use VMA iterator instead of linked list The VMA iterator is faster than the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-47-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 01293a62bae2fa55c09cebf5a771eab7219171c3 Author: Liam R. Howlett Date: Tue Sep 6 19:48:58 2022 +0000 ipc/shm: use VMA iterator instead of linked list The VMA iterator is faster than the linked llist, and it can be walked even when VMAs are being removed from the address space, so there's no need to keep track of 'next'. Link: https://lkml.kernel.org/r/20220906194824.2110408-46-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 69dbe6daf1041e32e003f966d71f70f20c63af53 Author: Liam R. Howlett Date: Tue Sep 6 19:48:57 2022 +0000 userfaultfd: use maple tree iterator to iterate VMAs Don't use the mm_struct linked list or the vma->vm_next in prep for removal. Link: https://lkml.kernel.org/r/20220906194824.2110408-45-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit c4c84f06285e48f80e9843d0775ad92714ffc35a Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:57 2022 +0000 fs/proc/task_mmu: stop using linked list and highest_vm_end Remove references to mm_struct linked list and highest_vm_end for when they are removed Link: https://lkml.kernel.org/r/20220906194824.2110408-44-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 5f14b9246e8944243c70253b28830de619800d31 Author: Liam R. Howlett Date: Tue Sep 6 19:48:56 2022 +0000 fs/proc/base: use the vma iterators in place of linked list Use the vma iterator instead of a for loop across the linked list. The link list of vmas will be removed in this patch set. Link: https://lkml.kernel.org/r/20220906194824.2110408-43-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 19066e58682ec156aac8d6cf94b79ab2f122a556 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:56 2022 +0000 exec: use VMA iterator instead of linked list Remove a use of the vm_next list by doing the initial lookup with the VMA iterator and then using it to find the next entry. Link: https://lkml.kernel.org/r/20220906194824.2110408-42-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 182ea1d71750ff9a41e7f8225c842246a4375983 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:56 2022 +0000 coredump: remove vma linked list walk Use the Maple Tree iterator instead. This is too complicated for the VMA iterator to handle, so let's open-code it for now. If this turns out to be a common pattern, we can migrate it to common code. Link: https://lkml.kernel.org/r/20220906194824.2110408-41-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit cbd43755ad15687cf8c925793a0b6c60c6181615 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:56 2022 +0000 um: remove vma linked list walk Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-40-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit df724cedcfd7ce6638f40903144902a3e29fcec7 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:55 2022 +0000 optee: remove vma linked list walk Use the VMA iterator instead. Change the calling convention of __check_mem_type() to pass in the mm instead of the first vma in the range. Link: https://lkml.kernel.org/r/20220906194824.2110408-39-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit d9fa0e37cdd47cfb71f5fa7a599ef5b9e32c55ed Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:55 2022 +0000 cxl: remove vma linked list walk Use the VMA iterator instead. This requires a little restructuring of the surrounding code to hoist the mm to the caller. That turns cxl_prefault_one() into a trivial function, so call cxl_fault_segment() directly. Link: https://lkml.kernel.org/r/20220906194824.2110408-38-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 49c40fb4b826c90036f04abf583bb4cb5ba3d203 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:55 2022 +0000 xtensa: remove vma linked list walks Use the VMA iterator instead. Since VMA can no longer be NULL in the loop, then deal with out-of-memory outside the loop. This means a slightly longer run time in the failure case (-ENOMEM) - it will run to the end of the VMAs before erroring instead of in the middle of the loop. Link: https://lkml.kernel.org/r/20220906194824.2110408-37-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit a3884621163b7d7fab89b44461b2a48a29c5cc9a Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:54 2022 +0000 x86: remove vma linked list walks Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-36-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit e7b6b990e524f60994da70cf5a22159b1e88ce57 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:54 2022 +0000 s390: remove vma linked list walks Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-35-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 405e669172e20be9a42cecf8be0fbed089fab045 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:53 2022 +0000 powerpc: remove mmap linked list walks Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-34-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Reviewed-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 70fa203165d96ae03abb83cf60d30c44e6b81a12 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:53 2022 +0000 parisc: remove mmap linked list from cache handling Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-33-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit ef770d180ebae967b19a3964bc1cc026f3082f9a Author: Liam R. Howlett Date: Tue Sep 6 19:48:53 2022 +0000 arm64: Change elfcore for_each_mte_vma() to use VMA iterator Rework for_each_mte_vma() to use a VMA iterator instead of an explicit linked-list. Link: https://lkml.kernel.org/r/20220906194824.2110408-32-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220218023650.672072-1-Liam.Howlett@oracle.com Signed-off-by: Will Deacon Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: David Hildenbrand Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit de2b84d24b87172913754bca6db85d5c5998213b Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:53 2022 +0000 arm64: remove mmap linked list from vdso Use the VMA iterator instead. Link: https://lkml.kernel.org/r/20220906194824.2110408-31-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 67e7c16764c3cbf84a57d441fba3474217ac08d6 Author: Liam R. Howlett Date: Tue Sep 6 19:48:52 2022 +0000 mm/mmap: change do_brk_munmap() to use do_mas_align_munmap() do_brk_munmap() has already aligned the address and has a maple tree state to be used. Use the new do_mas_align_munmap() to avoid unnecessary alignment and error checks. Link: https://lkml.kernel.org/r/20220906194824.2110408-30-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 11f9a21ab65542189372b7d64bb2d2937dfdc9dc Author: Liam R. Howlett Date: Tue Sep 6 19:48:52 2022 +0000 mm/mmap: reorganize munmap to use maple states Remove __do_munmap() in favour of do_munmap(), do_mas_munmap(), and do_mas_align_munmap(). do_munmap() is a wrapper to create a maple state for any callers that have not been converted to the maple tree. do_mas_munmap() takes a maple state to mumap a range. This is just a small function which checks for error conditions and aligns the end of the range. do_mas_align_munmap() uses the aligned range to mumap a range. do_mas_align_munmap() starts with the first VMA in the range, then finds the last VMA in the range. Both start and end are split if necessary. Then the VMAs are removed from the linked list and the mm mlock count is updated at the same time. Followed by a single tree operation of overwriting the area in with a NULL. Finally, the detached list is unmapped and freed. By reorganizing the munmap calls as outlined, it is now possible to avoid extra work of aligning pre-aligned callers which are known to be safe, avoid extra VMA lookups or tree walks for modifications. detach_vmas_to_be_unmapped() is no longer used, so drop this code. vm_brk_flags() can just call the do_mas_munmap() as it checks for intersecting VMAs directly. Link: https://lkml.kernel.org/r/20220906194824.2110408-29-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit e99668a56430a25a871113bcd3989ed20eae1cfc Author: Liam R. Howlett Date: Tue Sep 6 19:48:52 2022 +0000 mm/mmap: move mmap_region() below do_munmap() Relocation of code for the next commit. There should be no changes here. Link: https://lkml.kernel.org/r/20220906194824.2110408-28-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit d7c62295570f012e1d386ae6ed472b36baf037ad Author: Liam R. Howlett Date: Tue Sep 6 19:48:51 2022 +0000 mm: convert vma_lookup() to use mtree_load() Unlike the rbtree, the Maple Tree will return a NULL if there's nothing at a particular address. Since the previous commit dropped the vmacache, it is now possible to consult the tree directly. Link: https://lkml.kernel.org/r/20220906194824.2110408-27-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 7964cf8caa4dfa42c4149f3833d3878713cda3dc Author: Liam R. Howlett Date: Tue Sep 6 19:48:51 2022 +0000 mm: remove vmacache By using the maple tree and the maple tree state, the vmacache is no longer beneficial and is complicating the VMA code. Remove the vmacache to reduce the work in keeping it up to date and code complexity. Link: https://lkml.kernel.org/r/20220906194824.2110408-26-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 4dd1b84140c1b87a89d69a683bebbbdaeb620e39 Author: Liam R. Howlett Date: Tue Sep 6 19:48:51 2022 +0000 mm/mmap: use advanced maple tree API for mmap_region() Changing mmap_region() to use the maple tree state and the advanced maple tree interface allows for a lot less tree walking. This change removes the last caller of munmap_vma_range(), so drop this unused function. Add vma_expand() to expand a VMA if possible by doing the necessary hugepage check, uprobe_munmap of files, dcache flush, modifications then undoing the detaches, etc. Link: https://lkml.kernel.org/r/20220906194824.2110408-25-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit abdba2dda0c477ca708a939b02f9b2e74666ed2d Author: Liam R. Howlett Date: Tue Sep 6 19:48:50 2022 +0000 mm: use maple tree operations for find_vma_intersection() Move find_vma_intersection() to mmap.c and change implementation to maple tree. When searching for a vma within a range, it is easier to use the maple tree interface. Exported find_vma_intersection() for kvm module. Link: https://lkml.kernel.org/r/20220906194824.2110408-24-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 2e7ce7d354f2fae4c9becb8af799cbedf4f71665 Author: Liam R. Howlett Date: Tue Sep 6 19:48:50 2022 +0000 mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap() Avoid allocating a new VMA when it a vma modification can occur. When a brk() can expand or contract a VMA, then the single store operation will only modify one index of the maple tree instead of causing a node to split or coalesce. This avoids unnecessary allocations/frees of maple tree nodes and VMAs. Move some limit & flag verifications out of the do_brk_flags() function to use only relevant checks in the code path of bkr() and vm_brk_flags(). Set the vma to check if it can expand in vm_brk_flags() if extra criteria are met. Drop userfaultfd from do_brk_flags() path and only use it in vm_brk_flags() path since that is the only place a munmap will happen. Add a wraper for munmap for the brk case called do_brk_munmap(). Link: https://lkml.kernel.org/r/20220906194824.2110408-23-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 94d815b2798bad12d0aec912add7665e69a48400 Author: Liam R. Howlett Date: Tue Sep 6 19:48:50 2022 +0000 mm/khugepaged: optimize collapse_pte_mapped_thp() by using vma_lookup() vma_lookup() will walk the vma tree once and not continue to look for the next vma. Since the exact vma is checked below, this is a more optimal way of searching. Link: https://lkml.kernel.org/r/20220906194824.2110408-22-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit dc8635b25e87232f62276c02899b9d21dd0793c2 Author: Liam R. Howlett Date: Tue Sep 6 19:48:49 2022 +0000 mm: optimize find_exact_vma() to use vma_lookup() Use vma_lookup() to walk the tree to the start value requested. If the vma at the start does not match, then the answer is NULL and there is no need to look at the next vma the way that find_vma() would. Link: https://lkml.kernel.org/r/20220906194824.2110408-21-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 7ccf089b262be2c7f2cdc6c08412a1939a812102 Author: Liam R. Howlett Date: Tue Sep 6 19:48:49 2022 +0000 xen: use vma_lookup() in privcmd_ioctl_mmap() vma_lookup() walks the VMA tree for a specific value, find_vma() will search the tree after walking to a specific value. It is more efficient to only walk to the requested value since privcmd_ioctl_mmap() will exit the loop if vm_start != msg->va. Link: https://lkml.kernel.org/r/20220906194824.2110408-20-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 3b0e81a1cdc9afbddb0543d08e38edb4e33c4baf Author: Liam R. Howlett Date: Tue Sep 6 19:48:49 2022 +0000 mmap: change zeroing of maple tree in __vma_adjust() Only write to the maple tree if we are not inserting or the insert isn't going to overwrite the area to clear. This avoids spanning writes and node coealescing when unnecessary. The change requires a custom search for the linked list addition to find the correct VMA for the prev link. Link: https://lkml.kernel.org/r/20220906194824.2110408-19-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 524e00b36e8c547f5582eef3fb645a8d9fc5e3df Author: Liam R. Howlett Date: Tue Sep 6 19:48:48 2022 +0000 mm: remove rb tree. Remove the RB tree and start using the maple tree for vm_area_struct tracking. Drop validate_mm() calls in expand_upwards() and expand_downwards() as the lock is not held. Link: https://lkml.kernel.org/r/20220906194824.2110408-18-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 0c563f148043569c81724ee0f9c5bad5a36b115a Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:48 2022 +0000 proc: remove VMA rbtree use from nommu These users of the rbtree should probably have been walks of the linked list, but convert them to use walks of the maple tree. Link: https://lkml.kernel.org/r/20220906194824.2110408-17-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit d0cf3dd47f0d5d3bc366063f455215b99b06d62b Author: Liam R. Howlett Date: Tue Sep 6 19:48:48 2022 +0000 damon: convert __damon_va_three_regions to use the VMA iterator This rather specialised walk can use the VMA iterator. If this proves to be too slow, we can write a custom routine to find the two largest gaps, but it will be somewhat complicated, so let's see if we need it first. Update the kunit test case to use the maple tree. This also fixes an issue with the kunit testcase not adding the last VMA to the list. Link: https://lkml.kernel.org/r/20220906194824.2110408-16-Liam.Howlett@oracle.com Fixes: 17ccae8bb5c9 (mm/damon: add kunit tests) Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: SeongJae Park Reviewed-by: David Hildenbrand Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Howells Cc: Davidlohr Bueso Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit c9dbe82cb99db5b6029c6bc43fcf7881d3f50268 Author: Liam R. Howlett Date: Tue Sep 6 19:48:47 2022 +0000 kernel/fork: use maple tree for dup_mmap() during forking The maple tree was already tracking VMAs in this function by an earlier commit, but the rbtree iterator was being used to iterate the list. Change the iterator to use a maple tree native iterator and switch to the maple tree advanced API to avoid multiple walks of the tree during insert operations. Unexport the now-unused vma_store() function. For performance reasons we bulk allocate the maple tree nodes. The node calculations are done internally to the tree and use the VMA count and assume the worst-case node requirements. The VM_DONT_COPY flag does not allow for the most efficient copy method of the tree and so a bulk loading algorithm is used. Link: https://lkml.kernel.org/r/20220906194824.2110408-15-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 3499a13168da6a0c122c70f24e653b650d18c882 Author: Liam R. Howlett Date: Tue Sep 6 19:48:47 2022 +0000 mm/mmap: use maple tree for unmapped_area{_topdown} The maple tree code was added to find the unmapped area in a previous commit and was checked against what the rbtree returned, but the actual result was never used. Start using the maple tree implementation and remove the rbtree code. Add kernel documentation comment for these functions. Link: https://lkml.kernel.org/r/20220906194824.2110408-14-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 7fdbd37da5c6ff002dc6d15e89a7708c2df4928e Author: Liam R. Howlett Date: Tue Sep 6 19:48:47 2022 +0000 mm/mmap: use the maple tree for find_vma_prev() instead of the rbtree Use the maple tree's advanced API and a maple state to walk the tree for the entry at the address of the next vma, then use the maple state to walk back one entry to find the previous entry. Add kernel documentation comments for this API. Link: https://lkml.kernel.org/r/20220906194824.2110408-13-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit be8432e7166ef8cc5647d6d350e73897d48a9659 Author: Liam R. Howlett Date: Tue Sep 6 19:48:46 2022 +0000 mm/mmap: use the maple tree in find_vma() instead of the rbtree. Using the maple tree interface mt_find() will handle the RCU locking and will start searching at the address up to the limit, ULONG_MAX in this case. Add kernel documentation to this API. Link: https://lkml.kernel.org/r/20220906194824.2110408-12-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit 2e3af1db174423e0fb75c7887251f168d8401424 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:46 2022 +0000 mmap: use the VMA iterator in count_vma_pages_range() This simplifies the implementation and is faster than using the linked list. Link: https://lkml.kernel.org/r/20220906194824.2110408-11-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit f39af05949a4280b9f04d5dd0f606b81aac3dae8 Author: Matthew Wilcox (Oracle) Date: Tue Sep 6 19:48:46 2022 +0000 mm: add VMA iterator This thin layer of abstraction over the maple tree state is for iterating over VMAs. You can go forwards, go backwards or ask where the iterator is. Rename the existing vma_next() to __vma_next() -- it will be removed by the end of this series. Link: https://lkml.kernel.org/r/20220906194824.2110408-10-Liam.Howlett@oracle.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Davidlohr Bueso Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Howells Cc: SeongJae Park Cc: Sven Schnelle Cc: Will Deacon Signed-off-by: Andrew Morton commit d4af56c5c7c6781ca6ca8075e2cf5bc119ed33d1 Author: Liam R. Howlett Date: Tue Sep 6 19:48:45 2022 +0000 mm: start tracking VMAs with maple tree Start tracking the VMAs with the new maple tree structure in parallel with the rb_tree. Add debug and trace events for maple tree operations and duplicate the rb_tree that is created on forks into the maple tree. The maple tree is added to the mm_struct including the mm_init struct, added support in required mm/mmap functions, added tracking in kernel/fork for process forking, and used to find the unmapped_area and checked against what the rbtree finds. This also moves the mmap_lock() in exit_mmap() since the oom reaper call does walk the VMAs. Otherwise lockdep will be unhappy if oom happens. When splitting a vma fails due to allocations of the maple tree nodes, the error path in __split_vma() calls new->vm_ops->close(new). The page accounting for hugetlb is actually in the close() operation, so it accounts for the removal of 1/2 of the VMA which was not adjusted. This results in a negative exit value. To avoid the negative charge, set vm_start = vm_end and vm_pgoff = 0. There is also a potential accounting issue in special mappings from insert_vm_struct() failing to allocate, so reverse the charge there in the failure scenario. Link: https://lkml.kernel.org/r/20220906194824.2110408-9-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit e15e06a8392321a19d8ebdbdd7643b7fa8874c17 Author: Liam R. Howlett Date: Tue Sep 6 19:48:45 2022 +0000 lib/test_maple_tree: add testing for maple tree This is a test suite that uses the radix test infrastructure. It has been split into its own commit to allow for easier review of the maple tree code. The testing includes: - Allocation of nodes - gfp flag allocation checks - Expansion & contraction of tree - preallocation checks - tree navigation by next/prev - tree navigation by iterators (mas_for_each, etc) - Number of nodes for a given number of entries - Generic tree construction tests - Addition and removal of entries in forward and reverse numerical indexes - gap searching both forward and reverse - Combining gaps by overwriting entries in different ways - splitting right-most node - splitting left-most node - overwriting multiple slots - overwriting across different levels of the tree - overwriting the middle of a tree - causing a 3-way split up to the root by overwriting the last slot and first slot of different nodes and spanning different levels - RCU stress testing of the tree with threads - Duplication of the tree by entry count - Tests which were generated by fuzzers have been added. - A large number of tests which come from recording crashing in a VM and reconstructing the tree (see check_erase2_set()) Link: https://lkml.kernel.org/r/20220906194824.2110408-8-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit c349fa1818d405c8d9ab77ddcaff919189a0b346 Author: Liam R. Howlett Date: Tue Sep 6 19:48:41 2022 +0000 radix tree test suite: add lockdep_is_held to header maple tree uses lockdep_is_held, so define it as external in the header. Link: https://lkml.kernel.org/r/20220906194824.2110408-7-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit cc86e0c2f306641454880611be901d6ffc478b07 Author: Liam R. Howlett Date: Tue Sep 6 19:48:41 2022 +0000 radix tree test suite: add support for slab bulk APIs Add support for kmem_cache_free_bulk() and kmem_cache_alloc_bulk() to the radix tree test suite. Link: https://lkml.kernel.org/r/20220906194824.2110408-6-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 000a449345bbb4ffbd880f7143b5fb4acac34121 Author: Liam R. Howlett Date: Tue Sep 6 19:48:40 2022 +0000 radix tree test suite: add allocation counts and size to kmem_cache Add functions to get the number of allocations, and total allocations from a kmem_cache. Also add a function to get the allocated size and a way to zero the total allocations. Link: https://lkml.kernel.org/r/20220906194824.2110408-5-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit e73cb368be374165b531d5ab1e74596b98e766a8 Author: Liam R. Howlett Date: Tue Sep 6 19:48:40 2022 +0000 radix tree test suite: add kmem_cache_set_non_kernel() kmem_cache_set_non_kernel() is a mechanism to allow a certain number of kmem_cache_alloc requests to succeed even when GFP_KERNEL is not set in the flags. This functionality allows for testing different paths though the code. Link: https://lkml.kernel.org/r/20220906194824.2110408-4-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit fbeea9d117ea8c43c7fb65b429ed7ebd010d0e3f Author: Liam R. Howlett Date: Tue Sep 6 19:48:39 2022 +0000 radix tree test suite: add pr_err define define pr_err to printk Link: https://lkml.kernel.org/r/20220906194824.2110408-3-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Tested-by: Yu Zhao Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Howells Cc: Davidlohr Bueso Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Sven Schnelle Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa Author: Liam R. Howlett Date: Tue Sep 6 19:48:39 2022 +0000 Maple Tree: add new data structure Patch series "Introducing the Maple Tree" The maple tree is an RCU-safe range based B-tree designed to use modern processor cache efficiently. There are a number of places in the kernel that a non-overlapping range-based tree would be beneficial, especially one with a simple interface. If you use an rbtree with other data structures to improve performance or an interval tree to track non-overlapping ranges, then this is for you. The tree has a branching factor of 10 for non-leaf nodes and 16 for leaf nodes. With the increased branching factor, it is significantly shorter than the rbtree so it has fewer cache misses. The removal of the linked list between subsequent entries also reduces the cache misses and the need to pull in the previous and next VMA during many tree alterations. The first user that is covered in this patch set is the vm_area_struct, where three data structures are replaced by the maple tree: the augmented rbtree, the vma cache, and the linked list of VMAs in the mm_struct. The long term goal is to reduce or remove the mmap_lock contention. The plan is to get to the point where we use the maple tree in RCU mode. Readers will not block for writers. A single write operation will be allowed at a time. A reader re-walks if stale data is encountered. VMAs would be RCU enabled and this mode would be entered once multiple tasks are using the mm_struct. Davidlor said : Yes I like the maple tree, and at this stage I don't think we can ask for : more from this series wrt the MM - albeit there seems to still be some : folks reporting breakage. Fundamentally I see Liam's work to (re)move : complexity out of the MM (not to say that the actual maple tree is not : complex) by consolidating the three complimentary data structures very : much worth it considering performance does not take a hit. This was very : much a turn off with the range locking approach, which worst case scenario : incurred in prohibitive overhead. Also as Liam and Matthew have : mentioned, RCU opens up a lot of nice performance opportunities, and in : addition academia[1] has shown outstanding scalability of address spaces : with the foundation of replacing the locked rbtree with RCU aware trees. A similar work has been discovered in the academic press https://pdos.csail.mit.edu/papers/rcuvm:asplos12.pdf Sheer coincidence. We designed our tree with the intention of solving the hardest problem first. Upon settling on a b-tree variant and a rough outline, we researched ranged based b-trees and RCU b-trees and did find that article. So it was nice to find reassurances that we were on the right path, but our design choice of using ranges made that paper unusable for us. This patch (of 70): The maple tree is an RCU-safe range based B-tree designed to use modern processor cache efficiently. There are a number of places in the kernel that a non-overlapping range-based tree would be beneficial, especially one with a simple interface. If you use an rbtree with other data structures to improve performance or an interval tree to track non-overlapping ranges, then this is for you. The tree has a branching factor of 10 for non-leaf nodes and 16 for leaf nodes. With the increased branching factor, it is significantly shorter than the rbtree so it has fewer cache misses. The removal of the linked list between subsequent entries also reduces the cache misses and the need to pull in the previous and next VMA during many tree alterations. The first user that is covered in this patch set is the vm_area_struct, where three data structures are replaced by the maple tree: the augmented rbtree, the vma cache, and the linked list of VMAs in the mm_struct. The long term goal is to reduce or remove the mmap_lock contention. The plan is to get to the point where we use the maple tree in RCU mode. Readers will not block for writers. A single write operation will be allowed at a time. A reader re-walks if stale data is encountered. VMAs would be RCU enabled and this mode would be entered once multiple tasks are using the mm_struct. There is additional BUG_ON() calls added within the tree, most of which are in debug code. These will be replaced with a WARN_ON() call in the future. There is also additional BUG_ON() calls within the code which will also be reduced in number at a later date. These exist to catch things such as out-of-range accesses which would crash anyways. Link: https://lkml.kernel.org/r/20220906194824.2110408-1-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20220906194824.2110408-2-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Tested-by: David Howells Tested-by: Sven Schnelle Tested-by: Yu Zhao Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: Catalin Marinas Cc: SeongJae Park Cc: Will Deacon Signed-off-by: Andrew Morton commit 9832fb87834e2bd925d30020962c81b05948fa7b Author: Aneesh Kumar K.V Date: Tue Aug 30 13:47:36 2022 +0530 mm/demotion: expose memory tier details via sysfs Add /sys/devices/virtual/memory_tiering/ where all memory tier related details can be found. All allocated memory tiers will be listed there as /sys/devices/virtual/memory_tiering/memory_tierN/ The nodes which are part of a specific memory tier can be listed via /sys/devices/virtual/memory_tiering/memory_tierN/nodes A directory hierarchy looks like :/sys/devices/virtual/memory_tiering$ tree memory_tier4/ memory_tier4/ ├── nodes ├── subsystem -> ../../../../bus/memory_tiering └── uevent :/sys/devices/virtual/memory_tiering$ cat memory_tier4/nodes 0,2 [aneesh.kumar@linux.ibm.com: drop toptier_nodes from sysfs] Link: https://lkml.kernel.org/r/20220922102201.62168-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20220830081736.119281-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: "Huang, Ying" Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Wei Xu Cc: Yang Shi Signed-off-by: Andrew Morton commit 3e061d924fe9c7b487ca45935f92fcd414ce6f1a Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:42 2022 +0530 lib/nodemask: optimize node_random for nodemask with single NUMA node The most common case for certain node_random usage (demotion nodemask) is with nodemask weight 1. We can avoid calling get_random_init() in that case and always return the only node set in the nodemask. A simple test as below before = rdtsc_ordered(); for (i= 0; i < 100; i++) { rand = node_random(&nmask); } after = rdtsc_ordered(); Without fix after - before : 16438 With fix after - before : 816 Link: https://lkml.kernel.org/r/20220818131042.113280-11-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 467b171af881282fc627328e6c164f044a6df888 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:41 2022 +0530 mm/demotion: update node_is_toptier to work with memory tiers With memory tier support we can have memory only NUMA nodes in the top tier from which we want to avoid promotion tracking NUMA faults. Update node_is_toptier to work with memory tiers. All NUMA nodes are by default top tier nodes. With lower(slower) memory tiers added we consider all memory tiers above a memory tier having CPU NUMA nodes as a top memory tier [sj@kernel.org: include missed header file, memory-tiers.h] Link: https://lkml.kernel.org/r/20220820190720.248704-1-sj@kernel.org [akpm@linux-foundation.org: mm/memory.c needs linux/memory-tiers.h] [aneesh.kumar@linux.ibm.com: make toptier_distance inclusive upper bound of toptiers] Link: https://lkml.kernel.org/r/20220830081457.118960-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20220818131042.113280-10-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 32008027289239100d8d2876f50b15d92bde1855 Author: Jagdish Gediya Date: Thu Aug 18 18:40:40 2022 +0530 mm/demotion: demote pages according to allocation fallback order Currently, a higher tier node can only be demoted to selected nodes on the next lower tier as defined by the demotion path. This strict demotion order does not work in all use cases (e.g. some use cases may want to allow cross-socket demotion to another node in the same demotion tier as a fallback when the preferred demotion node is out of space). This demotion order is also inconsistent with the page allocation fallback order when all the nodes in a higher tier are out of space: The page allocation can fall back to any node from any lower tier, whereas the demotion order doesn't allow that currently. This patch adds support to get all the allowed demotion targets for a memory tier. demote_page_list() function is now modified to utilize this allowed node mask as the fallback allocation mask. Link: https://lkml.kernel.org/r/20220818131042.113280-9-aneesh.kumar@linux.ibm.com Signed-off-by: Jagdish Gediya Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit b26ac6f3ba38fac83db2d72551e6d994d0e0516f Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:39 2022 +0530 mm/demotion: drop memtier from memtype Now that we track node-specific memtier in pg_data_t, we can drop memtier from memtype. Link: https://lkml.kernel.org/r/20220818131042.113280-8-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 7766cf7a7e7545ab434a16c6f9531b09efe14dc1 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:38 2022 +0530 mm/demotion: add pg_data_t member to track node memory tier details Also update different helpes to use NODE_DATA()->memtier. Since node specific memtier can change based on the reassignment of NUMA node to a different memory tiers, accessing NODE_DATA()->memtier needs to happen under an rcu read lock or memory_tier_lock. Link: https://lkml.kernel.org/r/20220818131042.113280-7-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 6c542ab75714fe90dae292aeb3e91ac53f5ff599 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:37 2022 +0530 mm/demotion: build demotion targets based on explicit memory tiers This patch switch the demotion target building logic to use memory tiers instead of NUMA distance. All N_MEMORY NUMA nodes will be placed in the default memory tier and additional memory tiers will be added by drivers like dax kmem. This patch builds the demotion target for a NUMA node by looking at all memory tiers below the tier to which the NUMA node belongs. The closest node in the immediately following memory tier is used as a demotion target. Since we are now only building demotion target for N_MEMORY NUMA nodes the CPU hotplug calls are removed in this patch. Link: https://lkml.kernel.org/r/20220818131042.113280-6-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 7b88bda3761b95856cf97822efe8281c8100067b Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:36 2022 +0530 mm/demotion/dax/kmem: set node's abstract distance to MEMTIER_DEFAULT_DAX_ADISTANCE By default, all nodes are assigned to the default memory tier which is the memory tier designated for nodes with DRAM Set dax kmem device node's tier to slower memory tier by assigning abstract distance to MEMTIER_DEFAULT_DAX_ADISTANCE. Low-level drivers like papr_scm or ACPI NFIT can initialize memory device type to a more accurate value based on device tree details or HMAT. If the kernel doesn't find the memory type initialized, a default slower memory type is assigned by the kmem driver. [aneesh.kumar@linux.ibm.com: assign correct memory type for multiple dax devices with the same node affinity] Link: https://lkml.kernel.org/r/20220826100224.542312-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20220818131042.113280-5-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit c6123a19c9f040e597f55f856c679651c26b31d1 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:35 2022 +0530 mm/demotion: add hotplug callbacks to handle new numa node onlined If the new NUMA node onlined doesn't have a abstract distance assigned, the kernel adds the NUMA node to default memory tier. [aneesh.kumar@linux.ibm.com: fix kernel error with memory hotplug] Link: https://lkml.kernel.org/r/20220825092019.379069-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20220818131042.113280-4-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 9195244022788935eac0df16132394ffa5613542 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:34 2022 +0530 mm/demotion: move memory demotion related code This moves memory demotion related code to mm/memory-tiers.c. No functional change in this patch. Link: https://lkml.kernel.org/r/20220818131042.113280-3-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Jagdish Gediya Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: SeongJae Park Signed-off-by: Andrew Morton commit 992bf77591cb7e696fcc59aa7e64d1200b673513 Author: Aneesh Kumar K.V Date: Thu Aug 18 18:40:33 2022 +0530 mm/demotion: add support for explicit memory tiers Patch series "mm/demotion: Memory tiers and demotion", v15. The current kernel has the basic memory tiering support: Inactive pages on a higher tier NUMA node can be migrated (demoted) to a lower tier NUMA node to make room for new allocations on the higher tier NUMA node. Frequently accessed pages on a lower tier NUMA node can be migrated (promoted) to a higher tier NUMA node to improve the performance. In the current kernel, memory tiers are defined implicitly via a demotion path relationship between NUMA nodes, which is created during the kernel initialization and updated when a NUMA node is hot-added or hot-removed. The current implementation puts all nodes with CPU into the highest tier, and builds the tier hierarchy tier-by-tier by establishing the per-node demotion targets based on the distances between nodes. This current memory tier kernel implementation needs to be improved for several important use cases: * The current tier initialization code always initializes each memory-only NUMA node into a lower tier. But a memory-only NUMA node may have a high performance memory device (e.g. a DRAM-backed memory-only node on a virtual machine) and that should be put into a higher tier. * The current tier hierarchy always puts CPU nodes into the top tier. But on a system with HBM (e.g. GPU memory) devices, these memory-only HBM NUMA nodes should be in the top tier, and DRAM nodes with CPUs are better to be placed into the next lower tier. * Also because the current tier hierarchy always puts CPU nodes into the top tier, when a CPU is hot-added (or hot-removed) and triggers a memory node from CPU-less into a CPU node (or vice versa), the memory tier hierarchy gets changed, even though no memory node is added or removed. This can make the tier hierarchy unstable and make it difficult to support tier-based memory accounting. * A higher tier node can only be demoted to nodes with shortest distance on the next lower tier as defined by the demotion path, not any other node from any lower tier. This strict, demotion order does not work in all use cases (e.g. some use cases may want to allow cross-socket demotion to another node in the same demotion tier as a fallback when the preferred demotion node is out of space), and has resulted in the feature request for an interface to override the system-wide, per-node demotion order from the userspace. This demotion order is also inconsistent with the page allocation fallback order when all the nodes in a higher tier are out of space: The page allocation can fall back to any node from any lower tier, whereas the demotion order doesn't allow that. This patch series make the creation of memory tiers explicit under the control of device driver. Memory Tier Initialization ========================== Linux kernel presents memory devices as NUMA nodes and each memory device is of a specific type. The memory type of a device is represented by its abstract distance. A memory tier corresponds to a range of abstract distance. This allows for classifying memory devices with a specific performance range into a memory tier. By default, all memory nodes are assigned to the default tier with abstract distance 512. A device driver can move its memory nodes from the default tier. For example, PMEM can move its memory nodes below the default tier, whereas GPU can move its memory nodes above the default tier. The kernel initialization code makes the decision on which exact tier a memory node should be assigned to based on the requests from the device drivers as well as the memory device hardware information provided by the firmware. Hot-adding/removing CPUs doesn't affect memory tier hierarchy. This patch (of 10): In the current kernel, memory tiers are defined implicitly via a demotion path relationship between NUMA nodes, which is created during the kernel initialization and updated when a NUMA node is hot-added or hot-removed. The current implementation puts all nodes with CPU into the highest tier, and builds the tier hierarchy by establishing the per-node demotion targets based on the distances between nodes. This current memory tier kernel implementation needs to be improved for several important use cases, The current tier initialization code always initializes each memory-only NUMA node into a lower tier. But a memory-only NUMA node may have a high performance memory device (e.g. a DRAM-backed memory-only node on a virtual machine) that should be put into a higher tier. The current tier hierarchy always puts CPU nodes into the top tier. But on a system with HBM or GPU devices, the memory-only NUMA nodes mapping these devices should be in the top tier, and DRAM nodes with CPUs are better to be placed into the next lower tier. With current kernel higher tier node can only be demoted to nodes with shortest distance on the next lower tier as defined by the demotion path, not any other node from any lower tier. This strict, demotion order does not work in all use cases (e.g. some use cases may want to allow cross-socket demotion to another node in the same demotion tier as a fallback when the preferred demotion node is out of space), This demotion order is also inconsistent with the page allocation fallback order when all the nodes in a higher tier are out of space: The page allocation can fall back to any node from any lower tier, whereas the demotion order doesn't allow that. This patch series address the above by defining memory tiers explicitly. Linux kernel presents memory devices as NUMA nodes and each memory device is of a specific type. The memory type of a device is represented by its abstract distance. A memory tier corresponds to a range of abstract distance. This allows for classifying memory devices with a specific performance range into a memory tier. This patch configures the range/chunk size to be 128. The default DRAM abstract distance is 512. We can have 4 memory tiers below the default DRAM with abstract distance range 0 - 127, 127 - 255, 256- 383, 384 - 511. Faster memory devices can be placed in these faster(higher) memory tiers. Slower memory devices like persistent memory will have abstract distance higher than the default DRAM level. [akpm@linux-foundation.org: fix comment, per Aneesh] Link: https://lkml.kernel.org/r/20220818131042.113280-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20220818131042.113280-2-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Reviewed-by: "Huang, Ying" Acked-by: Wei Xu Cc: Alistair Popple Cc: Bharata B Rao Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Hesham Almatary Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Tim Chen Cc: Yang Shi Cc: Jagdish Gediya Cc: SeongJae Park Signed-off-by: Andrew Morton commit 8be976a0937a18118424dd2505925081d9192fd5 Author: Yu Zhao Date: Sun Sep 18 02:00:11 2022 -0600 mm: multi-gen LRU: design doc Add a design doc. Link: https://lkml.kernel.org/r/20220918080010.2920238-15-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 07017acb06012d250fb68930e809257e6694d324 Author: Yu Zhao Date: Sun Sep 18 02:00:10 2022 -0600 mm: multi-gen LRU: admin guide Add an admin guide. Link: https://lkml.kernel.org/r/20220918080010.2920238-14-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Acked-by: Mike Rapoport Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit d6c3af7d8a2ba5602c28841248c551a712ac50f5 Author: Yu Zhao Date: Sun Sep 18 02:00:09 2022 -0600 mm: multi-gen LRU: debugfs interface Add /sys/kernel/debug/lru_gen for working set estimation and proactive reclaim. These techniques are commonly used to optimize job scheduling (bin packing) in data centers [1][2]. Compared with the page table-based approach and the PFN-based approach, this lruvec-based approach has the following advantages: 1. It offers better choices because it is aware of memcgs, NUMA nodes, shared mappings and unmapped page cache. 2. It is more scalable because it is O(nr_hot_pages), whereas the PFN-based approach is O(nr_total_pages). Add /sys/kernel/debug/lru_gen_full for debugging. [1] https://dl.acm.org/doi/10.1145/3297858.3304053 [2] https://dl.acm.org/doi/10.1145/3503222.3507731 Link: https://lkml.kernel.org/r/20220918080010.2920238-13-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Qi Zheng Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 1332a809d95a4fc763cabe5ecb6d4fb6a6d941b2 Author: Yu Zhao Date: Sun Sep 18 02:00:08 2022 -0600 mm: multi-gen LRU: thrashing prevention Add /sys/kernel/mm/lru_gen/min_ttl_ms for thrashing prevention, as requested by many desktop users [1]. When set to value N, it prevents the working set of N milliseconds from getting evicted. The OOM killer is triggered if this working set cannot be kept in memory. Based on the average human detectable lag (~100ms), N=1000 usually eliminates intolerable lags due to thrashing. Larger values like N=3000 make lags less noticeable at the risk of premature OOM kills. Compared with the size-based approach [2], this time-based approach has the following advantages: 1. It is easier to configure because it is agnostic to applications and memory sizes. 2. It is more reliable because it is directly wired to the OOM killer. [1] https://lore.kernel.org/r/Ydza%2FzXKY9ATRoh6@google.com/ [2] https://lore.kernel.org/r/20101028191523.GA14972@google.com/ Link: https://lkml.kernel.org/r/20220918080010.2920238-12-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 354ed597442952fb680c9cafc7e4eb8a76f9514c Author: Yu Zhao Date: Sun Sep 18 02:00:07 2022 -0600 mm: multi-gen LRU: kill switch Add /sys/kernel/mm/lru_gen/enabled as a kill switch. Components that can be disabled include: 0x0001: the multi-gen LRU core 0x0002: walking page table, when arch_has_hw_pte_young() returns true 0x0004: clearing the accessed bit in non-leaf PMD entries, when CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y [yYnN]: apply to all the components above E.g., echo y >/sys/kernel/mm/lru_gen/enabled cat /sys/kernel/mm/lru_gen/enabled 0x0007 echo 5 >/sys/kernel/mm/lru_gen/enabled cat /sys/kernel/mm/lru_gen/enabled 0x0005 NB: the page table walks happen on the scale of seconds under heavy memory pressure, in which case the mmap_lock contention is a lesser concern, compared with the LRU lock contention and the I/O congestion. So far the only well-known case of the mmap_lock contention happens on Android, due to Scudo [1] which allocates several thousand VMAs for merely a few hundred MBs. The SPF and the Maple Tree also have provided their own assessments [2][3]. However, if walking page tables does worsen the mmap_lock contention, the kill switch can be used to disable it. In this case the multi-gen LRU will suffer a minor performance degradation, as shown previously. Clearing the accessed bit in non-leaf PMD entries can also be disabled, since this behavior was not tested on x86 varieties other than Intel and AMD. [1] https://source.android.com/devices/tech/debug/scudo [2] https://lore.kernel.org/r/20220128131006.67712-1-michel@lespinasse.org/ [3] https://lore.kernel.org/r/20220426150616.3937571-1-Liam.Howlett@oracle.com/ Link: https://lkml.kernel.org/r/20220918080010.2920238-11-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit f76c83378851f8e70f032848c4e61203f39480e4 Author: Yu Zhao Date: Sun Sep 18 02:00:06 2022 -0600 mm: multi-gen LRU: optimize multiple memcgs When multiple memcgs are available, it is possible to use generations as a frame of reference to make better choices and improve overall performance under global memory pressure. This patch adds a basic optimization to select memcgs that can drop single-use unmapped clean pages first. Doing so reduces the chance of going into the aging path or swapping, which can be costly. A typical example that benefits from this optimization is a server running mixed types of workloads, e.g., heavy anon workload in one memcg and heavy buffered I/O workload in the other. Though this optimization can be applied to both kswapd and direct reclaim, it is only added to kswapd to keep the patchset manageable. Later improvements may cover the direct reclaim path. While ensuring certain fairness to all eligible memcgs, proportional scans of individual memcgs also require proper backoff to avoid overshooting their aggregate reclaim target by too much. Otherwise it can cause high direct reclaim latency. The conditions for backoff are: 1. At low priorities, for direct reclaim, if aging fairness or direct reclaim latency is at risk, i.e., aging one memcg multiple times or swapping after the target is met. 2. At high priorities, for global reclaim, if per-zone free pages are above respective watermarks. Server benchmark results: Mixed workloads: fio (buffered I/O): +[19, 21]% IOPS BW patch1-8: 1880k 7343MiB/s patch1-9: 2252k 8796MiB/s memcached (anon): +[119, 123]% Ops/sec KB/sec patch1-8: 862768.65 33514.68 patch1-9: 1911022.12 74234.54 Mixed workloads: fio (buffered I/O): +[75, 77]% IOPS BW 5.19-rc1: 1279k 4996MiB/s patch1-9: 2252k 8796MiB/s memcached (anon): +[13, 15]% Ops/sec KB/sec 5.19-rc1: 1673524.04 65008.87 patch1-9: 1911022.12 74234.54 Configurations: (changes since patch 6) cat mixed.sh modprobe brd rd_nr=2 rd_size=56623104 swapoff -a mkswap /dev/ram0 swapon /dev/ram0 mkfs.ext4 /dev/ram1 mount -t ext4 /dev/ram1 /mnt memtier_benchmark -S /var/run/memcached/memcached.sock \ -P memcache_binary -n allkeys --key-minimum=1 \ --key-maximum=50000000 --key-pattern=P:P -c 1 -t 36 \ --ratio 1:0 --pipeline 8 -d 2000 fio -name=mglru --numjobs=36 --directory=/mnt --size=1408m \ --buffered=1 --ioengine=io_uring --iodepth=128 \ --iodepth_batch_submit=32 --iodepth_batch_complete=32 \ --rw=randread --random_distribution=random --norandommap \ --time_based --ramp_time=10m --runtime=90m --group_reporting & pid=$! sleep 200 memtier_benchmark -S /var/run/memcached/memcached.sock \ -P memcache_binary -n allkeys --key-minimum=1 \ --key-maximum=50000000 --key-pattern=R:R -c 1 -t 36 \ --ratio 0:1 --pipeline 8 --randomize --distinct-client-seed kill -INT $pid wait Client benchmark results: no change (CONFIG_MEMCG=n) Link: https://lkml.kernel.org/r/20220918080010.2920238-10-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit bd74fdaea146029e4fa12c6de89adbe0779348a9 Author: Yu Zhao Date: Sun Sep 18 02:00:05 2022 -0600 mm: multi-gen LRU: support page table walks To further exploit spatial locality, the aging prefers to walk page tables to search for young PTEs and promote hot pages. A kill switch will be added in the next patch to disable this behavior. When disabled, the aging relies on the rmap only. NB: this behavior has nothing similar with the page table scanning in the 2.4 kernel [1], which searches page tables for old PTEs, adds cold pages to swapcache and unmaps them. To avoid confusion, the term "iteration" specifically means the traversal of an entire mm_struct list; the term "walk" will be applied to page tables and the rmap, as usual. An mm_struct list is maintained for each memcg, and an mm_struct follows its owner task to the new memcg when this task is migrated. Given an lruvec, the aging iterates lruvec_memcg()->mm_list and calls walk_page_range() with each mm_struct on this list to promote hot pages before it increments max_seq. When multiple page table walkers iterate the same list, each of them gets a unique mm_struct; therefore they can run concurrently. Page table walkers ignore any misplaced pages, e.g., if an mm_struct was migrated, pages it left in the previous memcg will not be promoted when its current memcg is under reclaim. Similarly, page table walkers will not promote pages from nodes other than the one under reclaim. This patch uses the following optimizations when walking page tables: 1. It tracks the usage of mm_struct's between context switches so that page table walkers can skip processes that have been sleeping since the last iteration. 2. It uses generational Bloom filters to record populated branches so that page table walkers can reduce their search space based on the query results, e.g., to skip page tables containing mostly holes or misplaced pages. 3. It takes advantage of the accessed bit in non-leaf PMD entries when CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y. 4. It does not zigzag between a PGD table and the same PMD table spanning multiple VMAs. IOW, it finishes all the VMAs within the range of the same PMD table before it returns to a PGD table. This improves the cache performance for workloads that have large numbers of tiny VMAs [2], especially when CONFIG_PGTABLE_LEVELS=5. Server benchmark results: Single workload: fio (buffered I/O): no change Single workload: memcached (anon): +[8, 10]% Ops/sec KB/sec patch1-7: 1147696.57 44640.29 patch1-8: 1245274.91 48435.66 Configurations: no change Client benchmark results: kswapd profiles: patch1-7 48.16% lzo1x_1_do_compress (real work) 8.20% page_vma_mapped_walk (overhead) 7.06% _raw_spin_unlock_irq 2.92% ptep_clear_flush 2.53% __zram_bvec_write 2.11% do_raw_spin_lock 2.02% memmove 1.93% lru_gen_look_around 1.56% free_unref_page_list 1.40% memset patch1-8 49.44% lzo1x_1_do_compress (real work) 6.19% page_vma_mapped_walk (overhead) 5.97% _raw_spin_unlock_irq 3.13% get_pfn_folio 2.85% ptep_clear_flush 2.42% __zram_bvec_write 2.08% do_raw_spin_lock 1.92% memmove 1.44% alloc_zspage 1.36% memset Configurations: no change Thanks to the following developers for their efforts [3]. kernel test robot [1] https://lwn.net/Articles/23732/ [2] https://llvm.org/docs/ScudoHardenedAllocator.html [3] https://lore.kernel.org/r/202204160827.ekEARWQo-lkp@intel.com/ Link: https://lkml.kernel.org/r/20220918080010.2920238-9-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 018ee47f14893d500131dfca2ff9f3ff8ebd4ed2 Author: Yu Zhao Date: Sun Sep 18 02:00:04 2022 -0600 mm: multi-gen LRU: exploit locality in rmap Searching the rmap for PTEs mapping each page on an LRU list (to test and clear the accessed bit) can be expensive because pages from different VMAs (PA space) are not cache friendly to the rmap (VA space). For workloads mostly using mapped pages, searching the rmap can incur the highest CPU cost in the reclaim path. This patch exploits spatial locality to reduce the trips into the rmap. When shrink_page_list() walks the rmap and finds a young PTE, a new function lru_gen_look_around() scans at most BITS_PER_LONG-1 adjacent PTEs. On finding another young PTE, it clears the accessed bit and updates the gen counter of the page mapped by this PTE to (max_seq%MAX_NR_GENS)+1. Server benchmark results: Single workload: fio (buffered I/O): no change Single workload: memcached (anon): +[3, 5]% Ops/sec KB/sec patch1-6: 1106168.46 43025.04 patch1-7: 1147696.57 44640.29 Configurations: no change Client benchmark results: kswapd profiles: patch1-6 39.03% lzo1x_1_do_compress (real work) 18.47% page_vma_mapped_walk (overhead) 6.74% _raw_spin_unlock_irq 3.97% do_raw_spin_lock 2.49% ptep_clear_flush 2.48% anon_vma_interval_tree_iter_first 1.92% folio_referenced_one 1.88% __zram_bvec_write 1.48% memmove 1.31% vma_interval_tree_iter_next patch1-7 48.16% lzo1x_1_do_compress (real work) 8.20% page_vma_mapped_walk (overhead) 7.06% _raw_spin_unlock_irq 2.92% ptep_clear_flush 2.53% __zram_bvec_write 2.11% do_raw_spin_lock 2.02% memmove 1.93% lru_gen_look_around 1.56% free_unref_page_list 1.40% memset Configurations: no change Link: https://lkml.kernel.org/r/20220918080010.2920238-8-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Barry Song Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit ac35a490237446b71e3b4b782b1596967edd0aa8 Author: Yu Zhao Date: Sun Sep 18 02:00:03 2022 -0600 mm: multi-gen LRU: minimal implementation To avoid confusion, the terms "promotion" and "demotion" will be applied to the multi-gen LRU, as a new convention; the terms "activation" and "deactivation" will be applied to the active/inactive LRU, as usual. The aging produces young generations. Given an lruvec, it increments max_seq when max_seq-min_seq+1 approaches MIN_NR_GENS. The aging promotes hot pages to the youngest generation when it finds them accessed through page tables; the demotion of cold pages happens consequently when it increments max_seq. Promotion in the aging path does not involve any LRU list operations, only the updates of the gen counter and lrugen->nr_pages[]; demotion, unless as the result of the increment of max_seq, requires LRU list operations, e.g., lru_deactivate_fn(). The aging has the complexity O(nr_hot_pages), since it is only interested in hot pages. The eviction consumes old generations. Given an lruvec, it increments min_seq when lrugen->lists[] indexed by min_seq%MAX_NR_GENS becomes empty. A feedback loop modeled after the PID controller monitors refaults over anon and file types and decides which type to evict when both types are available from the same generation. The protection of pages accessed multiple times through file descriptors takes place in the eviction path. Each generation is divided into multiple tiers. A page accessed N times through file descriptors is in tier order_base_2(N). Tiers do not have dedicated lrugen->lists[], only bits in folio->flags. The aforementioned feedback loop also monitors refaults over all tiers and decides when to protect pages in which tiers (N>1), using the first tier (N=0,1) as a baseline. The first tier contains single-use unmapped clean pages, which are most likely the best choices. In contrast to promotion in the aging path, the protection of a page in the eviction path is achieved by moving this page to the next generation, i.e., min_seq+1, if the feedback loop decides so. This approach has the following advantages: 1. It removes the cost of activation in the buffered access path by inferring whether pages accessed multiple times through file descriptors are statistically hot and thus worth protecting in the eviction path. 2. It takes pages accessed through page tables into account and avoids overprotecting pages accessed multiple times through file descriptors. (Pages accessed through page tables are in the first tier, since N=0.) 3. More tiers provide better protection for pages accessed more than twice through file descriptors, when under heavy buffered I/O workloads. Server benchmark results: Single workload: fio (buffered I/O): +[30, 32]% IOPS BW 5.19-rc1: 2673k 10.2GiB/s patch1-6: 3491k 13.3GiB/s Single workload: memcached (anon): -[4, 6]% Ops/sec KB/sec 5.19-rc1: 1161501.04 45177.25 patch1-6: 1106168.46 43025.04 Configurations: CPU: two Xeon 6154 Mem: total 256G Node 1 was only used as a ram disk to reduce the variance in the results. patch drivers/block/brd.c < gfp_flags = GFP_NOIO | __GFP_ZERO | __GFP_HIGHMEM | __GFP_THISNODE; > page = alloc_pages_node(1, gfp_flags, 0); EOF cat >>/etc/systemd/system.conf <>/etc/memcached.conf </sys/fs/cgroup/user.slice/test/memory.max echo $$ >/sys/fs/cgroup/user.slice/test/cgroup.procs fio -name=mglru --numjobs=72 --directory=/mnt --size=1408m \ --buffered=1 --ioengine=io_uring --iodepth=128 \ --iodepth_batch_submit=32 --iodepth_batch_complete=32 \ --rw=randread --random_distribution=random --norandommap \ --time_based --ramp_time=10m --runtime=5m --group_reporting cat memcached.sh modprobe brd rd_nr=1 rd_size=113246208 swapoff -a mkswap /dev/ram0 swapon /dev/ram0 memtier_benchmark -S /var/run/memcached/memcached.sock \ -P memcache_binary -n allkeys --key-minimum=1 \ --key-maximum=65000000 --key-pattern=P:P -c 1 -t 36 \ --ratio 1:0 --pipeline 8 -d 2000 memtier_benchmark -S /var/run/memcached/memcached.sock \ -P memcache_binary -n allkeys --key-minimum=1 \ --key-maximum=65000000 --key-pattern=R:R -c 1 -t 36 \ --ratio 0:1 --pipeline 8 --randomize --distinct-client-seed Client benchmark results: kswapd profiles: 5.19-rc1 40.33% page_vma_mapped_walk (overhead) 21.80% lzo1x_1_do_compress (real work) 7.53% do_raw_spin_lock 3.95% _raw_spin_unlock_irq 2.52% vma_interval_tree_iter_next 2.37% folio_referenced_one 2.28% vma_interval_tree_subtree_search 1.97% anon_vma_interval_tree_iter_first 1.60% ptep_clear_flush 1.06% __zram_bvec_write patch1-6 39.03% lzo1x_1_do_compress (real work) 18.47% page_vma_mapped_walk (overhead) 6.74% _raw_spin_unlock_irq 3.97% do_raw_spin_lock 2.49% ptep_clear_flush 2.48% anon_vma_interval_tree_iter_first 1.92% folio_referenced_one 1.88% __zram_bvec_write 1.48% memmove 1.31% vma_interval_tree_iter_next Configurations: CPU: single Snapdragon 7c Mem: total 4G ChromeOS MemoryPressure [1] [1] https://chromium.googlesource.com/chromiumos/platform/tast-tests/ Link: https://lkml.kernel.org/r/20220918080010.2920238-7-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit ec1c86b25f4bdd9dce6436c0539d2a6ae676e1c4 Author: Yu Zhao Date: Sun Sep 18 02:00:02 2022 -0600 mm: multi-gen LRU: groundwork Evictable pages are divided into multiple generations for each lruvec. The youngest generation number is stored in lrugen->max_seq for both anon and file types as they are aged on an equal footing. The oldest generation numbers are stored in lrugen->min_seq[] separately for anon and file types as clean file pages can be evicted regardless of swap constraints. These three variables are monotonically increasing. Generation numbers are truncated into order_base_2(MAX_NR_GENS+1) bits in order to fit into the gen counter in folio->flags. Each truncated generation number is an index to lrugen->lists[]. The sliding window technique is used to track at least MIN_NR_GENS and at most MAX_NR_GENS generations. The gen counter stores a value within [1, MAX_NR_GENS] while a page is on one of lrugen->lists[]. Otherwise it stores 0. There are two conceptually independent procedures: "the aging", which produces young generations, and "the eviction", which consumes old generations. They form a closed-loop system, i.e., "the page reclaim". Both procedures can be invoked from userspace for the purposes of working set estimation and proactive reclaim. These techniques are commonly used to optimize job scheduling (bin packing) in data centers [1][2]. To avoid confusion, the terms "hot" and "cold" will be applied to the multi-gen LRU, as a new convention; the terms "active" and "inactive" will be applied to the active/inactive LRU, as usual. The protection of hot pages and the selection of cold pages are based on page access channels and patterns. There are two access channels: one through page tables and the other through file descriptors. The protection of the former channel is by design stronger because: 1. The uncertainty in determining the access patterns of the former channel is higher due to the approximation of the accessed bit. 2. The cost of evicting the former channel is higher due to the TLB flushes required and the likelihood of encountering the dirty bit. 3. The penalty of underprotecting the former channel is higher because applications usually do not prepare themselves for major page faults like they do for blocked I/O. E.g., GUI applications commonly use dedicated I/O threads to avoid blocking rendering threads. There are also two access patterns: one with temporal locality and the other without. For the reasons listed above, the former channel is assumed to follow the former pattern unless VM_SEQ_READ or VM_RAND_READ is present; the latter channel is assumed to follow the latter pattern unless outlying refaults have been observed [3][4]. The next patch will address the "outlying refaults". Three macros, i.e., LRU_REFS_WIDTH, LRU_REFS_PGOFF and LRU_REFS_MASK, used later are added in this patch to make the entire patchset less diffy. A page is added to the youngest generation on faulting. The aging needs to check the accessed bit at least twice before handing this page over to the eviction. The first check takes care of the accessed bit set on the initial fault; the second check makes sure this page has not been used since then. This protocol, AKA second chance, requires a minimum of two generations, hence MIN_NR_GENS. [1] https://dl.acm.org/doi/10.1145/3297858.3304053 [2] https://dl.acm.org/doi/10.1145/3503222.3507731 [3] https://lwn.net/Articles/495543/ [4] https://lwn.net/Articles/815342/ Link: https://lkml.kernel.org/r/20220918080010.2920238-6-yuzhao@google.com Signed-off-by: Yu Zhao Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit aa1b67903a19e026d1749241fad177f6185c2d42 Author: Yu Zhao Date: Sun Sep 18 02:00:01 2022 -0600 Revert "include/linux/mm_inline.h: fold __update_lru_size() into its sole caller" This patch undoes the following refactor: commit 289ccba18af4 ("include/linux/mm_inline.h: fold __update_lru_size() into its sole caller") The upcoming changes to include/linux/mm_inline.h will reuse __update_lru_size(). Link: https://lkml.kernel.org/r/20220918080010.2920238-5-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Miaohe Lin Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Barry Song Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit f1e1a7be4718609042e3285bc2110d74825ad9d1 Author: Yu Zhao Date: Sun Sep 18 02:00:00 2022 -0600 mm/vmscan.c: refactor shrink_node() This patch refactors shrink_node() to improve readability for the upcoming changes to mm/vmscan.c. Link: https://lkml.kernel.org/r/20220918080010.2920238-4-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Barry Song Reviewed-by: Miaohe Lin Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit eed9a328aa1ae6ac1edaa026957e6882f57de0dd Author: Yu Zhao Date: Sun Sep 18 01:59:59 2022 -0600 mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG Some architectures support the accessed bit in non-leaf PMD entries, e.g., x86 sets the accessed bit in a non-leaf PMD entry when using it as part of linear address translation [1]. Page table walkers that clear the accessed bit may use this capability to reduce their search space. Note that: 1. Although an inline function is preferable, this capability is added as a configuration option for consistency with the existing macros. 2. Due to the little interest in other varieties, this capability was only tested on Intel and AMD CPUs. Thanks to the following developers for their efforts [2][3]. Randy Dunlap Stephen Rothwell [1]: Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3 (June 2021), section 4.8 [2] https://lore.kernel.org/r/bfdcc7c8-922f-61a9-aa15-7e7250f04af7@infradead.org/ [3] https://lore.kernel.org/r/20220413151513.5a0d7a7e@canb.auug.org.au/ Link: https://lkml.kernel.org/r/20220918080010.2920238-3-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Barry Song Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Qi Zheng Cc: Tejun Heo Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit e1fd09e3d1dd4a1a8b3b33bc1fd647eee9f4e475 Author: Yu Zhao Date: Sun Sep 18 01:59:58 2022 -0600 mm: x86, arm64: add arch_has_hw_pte_young() Patch series "Multi-Gen LRU Framework", v14. What's new ========== 1. OpenWrt, in addition to Android, Arch Linux Zen, Armbian, ChromeOS, Liquorix, post-factum and XanMod, is now shipping MGLRU on 5.15. 2. Fixed long-tailed direct reclaim latency seen on high-memory (TBs) machines. The old direct reclaim backoff, which tries to enforce a minimum fairness among all eligible memcgs, over-swapped by about (total_mem>>DEF_PRIORITY)-nr_to_reclaim. The new backoff, which pulls the plug on swapping once the target is met, trades some fairness for curtailed latency: https://lore.kernel.org/r/20220918080010.2920238-10-yuzhao@google.com/ 3. Fixed minior build warnings and conflicts. More comments and nits. TLDR ==== The current page reclaim is too expensive in terms of CPU usage and it often makes poor choices about what to evict. This patchset offers an alternative solution that is performant, versatile and straightforward. Patchset overview ================= The design and implementation overview is in patch 14: https://lore.kernel.org/r/20220918080010.2920238-15-yuzhao@google.com/ 01. mm: x86, arm64: add arch_has_hw_pte_young() 02. mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG Take advantage of hardware features when trying to clear the accessed bit in many PTEs. 03. mm/vmscan.c: refactor shrink_node() 04. Revert "include/linux/mm_inline.h: fold __update_lru_size() into its sole caller" Minor refactors to improve readability for the following patches. 05. mm: multi-gen LRU: groundwork Adds the basic data structure and the functions that insert pages to and remove pages from the multi-gen LRU (MGLRU) lists. 06. mm: multi-gen LRU: minimal implementation A minimal implementation without optimizations. 07. mm: multi-gen LRU: exploit locality in rmap Exploits spatial locality to improve efficiency when using the rmap. 08. mm: multi-gen LRU: support page table walks Further exploits spatial locality by optionally scanning page tables. 09. mm: multi-gen LRU: optimize multiple memcgs Optimizes the overall performance for multiple memcgs running mixed types of workloads. 10. mm: multi-gen LRU: kill switch Adds a kill switch to enable or disable MGLRU at runtime. 11. mm: multi-gen LRU: thrashing prevention 12. mm: multi-gen LRU: debugfs interface Provide userspace with features like thrashing prevention, working set estimation and proactive reclaim. 13. mm: multi-gen LRU: admin guide 14. mm: multi-gen LRU: design doc Add an admin guide and a design doc. Benchmark results ================= Independent lab results ----------------------- Based on the popularity of searches [01] and the memory usage in Google's public cloud, the most popular open-source memory-hungry applications, in alphabetical order, are: Apache Cassandra Memcached Apache Hadoop MongoDB Apache Spark PostgreSQL MariaDB (MySQL) Redis An independent lab evaluated MGLRU with the most widely used benchmark suites for the above applications. They posted 960 data points along with kernel metrics and perf profiles collected over more than 500 hours of total benchmark time. Their final reports show that, with 95% confidence intervals (CIs), the above applications all performed significantly better for at least part of their benchmark matrices. On 5.14: 1. Apache Spark [02] took 95% CIs [9.28, 11.19]% and [12.20, 14.93]% less wall time to sort three billion random integers, respectively, under the medium- and the high-concurrency conditions, when overcommitting memory. There were no statistically significant changes in wall time for the rest of the benchmark matrix. 2. MariaDB [03] achieved 95% CIs [5.24, 10.71]% and [20.22, 25.97]% more transactions per minute (TPM), respectively, under the medium- and the high-concurrency conditions, when overcommitting memory. There were no statistically significant changes in TPM for the rest of the benchmark matrix. 3. Memcached [04] achieved 95% CIs [23.54, 32.25]%, [20.76, 41.61]% and [21.59, 30.02]% more operations per second (OPS), respectively, for sequential access, random access and Gaussian (distribution) access, when THP=always; 95% CIs [13.85, 15.97]% and [23.94, 29.92]% more OPS, respectively, for random access and Gaussian access, when THP=never. There were no statistically significant changes in OPS for the rest of the benchmark matrix. 4. MongoDB [05] achieved 95% CIs [2.23, 3.44]%, [6.97, 9.73]% and [2.16, 3.55]% more operations per second (OPS), respectively, for exponential (distribution) access, random access and Zipfian (distribution) access, when underutilizing memory; 95% CIs [8.83, 10.03]%, [21.12, 23.14]% and [5.53, 6.46]% more OPS, respectively, for exponential access, random access and Zipfian access, when overcommitting memory. On 5.15: 5. Apache Cassandra [06] achieved 95% CIs [1.06, 4.10]%, [1.94, 5.43]% and [4.11, 7.50]% more operations per second (OPS), respectively, for exponential (distribution) access, random access and Zipfian (distribution) access, when swap was off; 95% CIs [0.50, 2.60]%, [6.51, 8.77]% and [3.29, 6.75]% more OPS, respectively, for exponential access, random access and Zipfian access, when swap was on. 6. Apache Hadoop [07] took 95% CIs [5.31, 9.69]% and [2.02, 7.86]% less average wall time to finish twelve parallel TeraSort jobs, respectively, under the medium- and the high-concurrency conditions, when swap was on. There were no statistically significant changes in average wall time for the rest of the benchmark matrix. 7. PostgreSQL [08] achieved 95% CI [1.75, 6.42]% more transactions per minute (TPM) under the high-concurrency condition, when swap was off; 95% CIs [12.82, 18.69]% and [22.70, 46.86]% more TPM, respectively, under the medium- and the high-concurrency conditions, when swap was on. There were no statistically significant changes in TPM for the rest of the benchmark matrix. 8. Redis [09] achieved 95% CIs [0.58, 5.94]%, [6.55, 14.58]% and [11.47, 19.36]% more total operations per second (OPS), respectively, for sequential access, random access and Gaussian (distribution) access, when THP=always; 95% CIs [1.27, 3.54]%, [10.11, 14.81]% and [8.75, 13.64]% more total OPS, respectively, for sequential access, random access and Gaussian access, when THP=never. Our lab results --------------- To supplement the above results, we ran the following benchmark suites on 5.16-rc7 and found no regressions [10]. fs_fio_bench_hdd_mq pft fs_lmbench pgsql-hammerdb fs_parallelio redis fs_postmark stream hackbench sysbenchthread kernbench tpcc_spark memcached unixbench multichase vm-scalability mutilate will-it-scale nginx [01] https://trends.google.com [02] https://lore.kernel.org/r/20211102002002.92051-1-bot@edi.works/ [03] https://lore.kernel.org/r/20211009054315.47073-1-bot@edi.works/ [04] https://lore.kernel.org/r/20211021194103.65648-1-bot@edi.works/ [05] https://lore.kernel.org/r/20211109021346.50266-1-bot@edi.works/ [06] https://lore.kernel.org/r/20211202062806.80365-1-bot@edi.works/ [07] https://lore.kernel.org/r/20211209072416.33606-1-bot@edi.works/ [08] https://lore.kernel.org/r/20211218071041.24077-1-bot@edi.works/ [09] https://lore.kernel.org/r/20211122053248.57311-1-bot@edi.works/ [10] https://lore.kernel.org/r/20220104202247.2903702-1-yuzhao@google.com/ Read-world applications ======================= Third-party testimonials ------------------------ Konstantin reported [11]: I have Archlinux with 8G RAM + zswap + swap. While developing, I have lots of apps opened such as multiple LSP-servers for different langs, chats, two browsers, etc... Usually, my system gets quickly to a point of SWAP-storms, where I have to kill LSP-servers, restart browsers to free memory, etc, otherwise the system lags heavily and is barely usable. 1.5 day ago I migrated from 5.11.15 kernel to 5.12 + the LRU patchset, and I started up by opening lots of apps to create memory pressure, and worked for a day like this. Till now I had not a single SWAP-storm, and mind you I got 3.4G in SWAP. I was never getting to the point of 3G in SWAP before without a single SWAP-storm. Vaibhav from IBM reported [12]: In a synthetic MongoDB Benchmark, seeing an average of ~19% throughput improvement on POWER10(Radix MMU + 64K Page Size) with MGLRU patches on top of 5.16 kernel for MongoDB + YCSB across three different request distributions, namely, Exponential, Uniform and Zipfan. Shuang from U of Rochester reported [13]: With the MGLRU, fio achieved 95% CIs [38.95, 40.26]%, [4.12, 6.64]% and [9.26, 10.36]% higher throughput, respectively, for random access, Zipfian (distribution) access and Gaussian (distribution) access, when the average number of jobs per CPU is 1; 95% CIs [42.32, 49.15]%, [9.44, 9.89]% and [20.99, 22.86]% higher throughput, respectively, for random access, Zipfian access and Gaussian access, when the average number of jobs per CPU is 2. Daniel from Michigan Tech reported [14]: With Memcached allocating ~100GB of byte-addressable Optante, performance improvement in terms of throughput (measured as queries per second) was about 10% for a series of workloads. Large-scale deployments ----------------------- We've rolled out MGLRU to tens of millions of ChromeOS users and about a million Android users. Google's fleetwide profiling [15] shows an overall 40% decrease in kswapd CPU usage, in addition to improvements in other UX metrics, e.g., an 85% decrease in the number of low-memory kills at the 75th percentile and an 18% decrease in app launch time at the 50th percentile. The downstream kernels that have been using MGLRU include: 1. Android [16] 2. Arch Linux Zen [17] 3. Armbian [18] 4. ChromeOS [19] 5. Liquorix [20] 6. OpenWrt [21] 7. post-factum [22] 8. XanMod [23] [11] https://lore.kernel.org/r/140226722f2032c86301fbd326d91baefe3d7d23.camel@yandex.ru/ [12] https://lore.kernel.org/r/87czj3mux0.fsf@vajain21.in.ibm.com/ [13] https://lore.kernel.org/r/20220105024423.26409-1-szhai2@cs.rochester.edu/ [14] https://lore.kernel.org/r/CA+4-3vksGvKd18FgRinxhqHetBS1hQekJE2gwco8Ja-bJWKtFw@mail.gmail.com/ [15] https://dl.acm.org/doi/10.1145/2749469.2750392 [16] https://android.com [17] https://archlinux.org [18] https://armbian.com [19] https://chromium.org [20] https://liquorix.net [21] https://openwrt.org [22] https://codeberg.org/pf-kernel [23] https://xanmod.org Summary ======= The facts are: 1. The independent lab results and the real-world applications indicate substantial improvements; there are no known regressions. 2. Thrashing prevention, working set estimation and proactive reclaim work out of the box; there are no equivalent solutions. 3. There is a lot of new code; no smaller changes have been demonstrated similar effects. Our options, accordingly, are: 1. Given the amount of evidence, the reported improvements will likely materialize for a wide range of workloads. 2. Gauging the interest from the past discussions, the new features will likely be put to use for both personal computers and data centers. 3. Based on Google's track record, the new code will likely be well maintained in the long term. It'd be more difficult if not impossible to achieve similar effects with other approaches. This patch (of 14): Some architectures automatically set the accessed bit in PTEs, e.g., x86 and arm64 v8.2. On architectures that do not have this capability, clearing the accessed bit in a PTE usually triggers a page fault following the TLB miss of this PTE (to emulate the accessed bit). Being aware of this capability can help make better decisions, e.g., whether to spread the work out over a period of time to reduce bursty page faults when trying to clear the accessed bit in many PTEs. Note that theoretically this capability can be unreliable, e.g., hotplugged CPUs might be different from builtin ones. Therefore it should not be used in architecture-independent code that involves correctness, e.g., to determine whether TLB flushes are required (in combination with the accessed bit). Link: https://lkml.kernel.org/r/20220918080010.2920238-1-yuzhao@google.com Link: https://lkml.kernel.org/r/20220918080010.2920238-2-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Barry Song Acked-by: Brian Geffon Acked-by: Jan Alexander Steffens (heftig) Acked-by: Oleksandr Natalenko Acked-by: Steven Barrett Acked-by: Suleiman Souhlal Acked-by: Will Deacon Tested-by: Daniel Byrne Tested-by: Donald Carr Tested-by: Holger Hoffstätte Tested-by: Konstantin Kharlamov Tested-by: Shuang Zhai Tested-by: Sofia Trinh Tested-by: Vaibhav Jain Cc: Andi Kleen Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Dave Hansen Cc: Hillf Danton Cc: Jens Axboe Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Linus Torvalds Cc: linux-arm-kernel@lists.infradead.org Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michael Larabel Cc: Michal Hocko Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Tejun Heo Cc: Vlastimil Babka Cc: Miaohe Lin Cc: Mike Rapoport Cc: Qi Zheng Signed-off-by: Andrew Morton commit 3a9bb7b1879bef057a5dbff1dac1fa1411638064 Author: Yang Yang Date: Mon Aug 15 07:28:37 2022 +0000 mm/page_io: count submission time as thrashing delay for delayacct Once upon a time, we only support accounting thrashing of page cache. Then Joonsoo introduced workingset detection for anonymous pages and we gained the ability to account thrashing of them[1]. Likes PSI, we count submission time as thrashing delay because when the device is congested, or the submitting cgroup IO-throttled, submission can be a significant part of overall IO time. Without this patch, swap thrashing through frontswap or some block device supporting rw_page operation isn't measured correctly. This patch is based on "delayacct: support re-entrance detection of thrashing accounting". [1] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") Link: https://lkml.kernel.org/r/20220815072835.74876-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Signed-off-by: CGEL ZTE Reviewed-by: Ran Xiaokai Reviewed-by: wangyong Cc: Joonsoo Kim Signed-off-by: Andrew Morton commit aa1cf99b87e934e761b46ce2b925335a398980da Author: Yang Yang Date: Mon Aug 15 07:11:35 2022 +0000 delayacct: support re-entrance detection of thrashing accounting Once upon a time, we only support accounting thrashing of page cache. Then Joonsoo introduced workingset detection for anonymous pages and we gained the ability to account thrashing of them[1]. For page cache thrashing accounting, there is no suitable place to do it in fs level likes swap_readpage(). So we have to do it in folio_wait_bit_common(). Then for anonymous pages thrashing accounting, we have to do it in both swap_readpage() and folio_wait_bit_common(). This likes PSI, so we should let thrashing accounting supports re-entrance detection. This patch is to prepare complete thrashing accounting, and is based on patch "filemap: make the accounting of thrashing more consistent". [1] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") Link: https://lkml.kernel.org/r/20220815071134.74551-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Signed-off-by: CGEL ZTE Reviewed-by: Ran Xiaokai Reviewed-by: wangyong Acked-by: Joonsoo Kim Signed-off-by: Andrew Morton commit 7047b5a40bce74883a10549bd609643b8bc4a3fb Author: Baolin Wang Date: Wed Aug 17 16:14:08 2022 +0800 mm: migrate: do not retry 10 times for the subpages of fail-to-migrate THP If THP is failed to migrate due to -ENOSYS or -ENOMEM case, the THP will be split, and the subpages of fail-to-migrate THP will be tried to migrate again, so we should not account the retry counter in the second loop, since we already accounted 'nr_thp_failed' in the first loop. Moreover we also do not need retry 10 times for -EAGAIN case for the subpages of fail-to-migrate THP in the second loop, since we already regarded the THP as migration failure, and save some migration time (for the worst case, will try 512 * 10 times) according to previous discussion [1]. [1] https://lore.kernel.org/linux-mm/87r13a7n04.fsf@yhuang6-desk2.ccr.corp.intel.com/ Link: https://lkml.kernel.org/r/20220817081408.513338-9-ying.huang@intel.com Tested-by: "Huang, Ying" Signed-off-by: Baolin Wang Signed-off-by: "Huang, Ying" Cc: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit 077309bc1eb8f41dd414902634c212606008bd54 Author: Huang Ying Date: Wed Aug 17 16:14:07 2022 +0800 migrate_pages(): fix failure counting for retry After 10 retries, we will give up and the remaining pages will be counted as failure in nr_failed and nr_thp_failed. We should count the failure in nr_failed_pages too. This is done in this patch. Link: https://lkml.kernel.org/r/20220817081408.513338-8-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit e6fa8a79fe03e1734c26287474b1ac09287fdeb7 Author: Huang Ying Date: Wed Aug 17 16:14:06 2022 +0800 migrate_pages(): fix failure counting for THP splitting If THP is failed to be migrated, it may be split and retry. But after splitting, the head page will be left in "from" list, although THP migration failure has been counted already. If the head page is failed to be migrated too, the failure will be counted twice incorrectly. So this is fixed in this patch via moving the head page of THP after splitting to "thp_split_pages" too. Link: https://lkml.kernel.org/r/20220817081408.513338-7-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit 577be05c8927aa593cf7e29e2b4940607f5756ff Author: Huang Ying Date: Wed Aug 17 16:14:05 2022 +0800 migrate_pages(): fix failure counting for THP on -ENOSYS If THP or hugetlbfs page migration isn't supported, unmap_and_move() or unmap_and_move_huge_page() will return -ENOSYS. For THP, splitting will be tried, but if splitting doesn't succeed, the THP will be left in "from" list wrongly. If some other pages are retried, the THP migration failure will counted again. This is fixed via moving the failure THP from "from" to "ret_pages". Another issue of the original code is that the unsupported failure processing isn't consistent between THP and hugetlbfs page. Make them consistent in this patch to make the code easier to be understood too. Link: https://lkml.kernel.org/r/20220817081408.513338-6-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Cc: Zi Yan Cc: Yang Shi Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 5fc30916b5cda697a7eb8f1167c38c27100a793a Author: Huang Ying Date: Wed Aug 17 16:14:04 2022 +0800 migrate_pages(): fix failure counting for THP subpages retrying If THP is failed to be migrated for -ENOSYS and -ENOMEM, the THP will be split into thp_split_pages, and after other pages are migrated, pages in thp_split_pages will be migrated with no_subpage_counting == true, because its failure have been counted already. If some pages in thp_split_pages are retried during migration, we should not count their failure if no_subpage_counting == true too. This is done this patch to fix the failure counting for THP subpages retrying. Link: https://lkml.kernel.org/r/20220817081408.513338-5-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit fbed53b47770b978be290cec0f4f22577766c12d Author: Huang Ying Date: Wed Aug 17 16:14:03 2022 +0800 migrate_pages(): fix THP failure counting for -ENOMEM In unmap_and_move(), if the new THP cannot be allocated, -ENOMEM will be returned, and migrate_pages() will try to split the THP unless "reason" is MR_NUMA_MISPLACED (that is, nosplit == true). But when nosplit == true, the THP migration failure will not be counted. This is incorrect, so in this patch, the THP migration failure will be counted for -ENOMEM regardless of nosplit is true or false. The nr_failed counting isn't fixed because it's not used. Added some comments for it per Baolin's suggestion. Link: https://lkml.kernel.org/r/20220817081408.513338-4-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit 9c62ff005fc774fb2ba14223b0d865a8aca48fb5 Author: Huang Ying Date: Wed Aug 17 16:14:02 2022 +0800 migrate_pages(): remove unnecessary list_safe_reset_next() Before commit b5bade978e9b ("mm: migrate: fix the return value of migrate_pages()"), the tail pages of THP will be put in the "from" list directly. So one of the loop cursors (page2) needs to be reset, as is done in try_split_thp() via list_safe_reset_next(). But after the commit, the tail pages of THP will be put in a dedicated list (thp_split_pages). That is, the "from" list will not be changed during splitting. So, it's unnecessary to call list_safe_reset_next() anymore. This is a code cleanup, no functionality changes are expected. Link: https://lkml.kernel.org/r/20220817081408.513338-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit a7504ed14f9b5e873599b2487eb95062dd0b65f8 Author: Huang Ying Date: Wed Aug 17 16:14:01 2022 +0800 migrate: fix syscall move_pages() return value for failure Patch series "migrate_pages(): fix several bugs in error path", v3. During review the code of migrate_pages() and build a test program for it. Several bugs in error path are identified and fixed in this series. Most patches are tested via - Apply error-inject.patch in Linux kernel - Compile test-migrate.c (with -lnuma) - Test with test-migrate.sh error-inject.patch, test-migrate.c, and test-migrate.sh are as below. It turns out that error injection is an important tool to fix bugs in error path. This patch (of 8): The return value of move_pages() syscall is incorrect when counting the remaining pages to be migrated. For example, for the following test program, " #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #ifndef MADV_FREE #define MADV_FREE 8 /* free pages only if memory pressure */ #endif #define ONE_MB (1024 * 1024) #define MAP_SIZE (16 * ONE_MB) #define THP_SIZE (2 * ONE_MB) #define THP_MASK (THP_SIZE - 1) #define ERR_EXIT_ON(cond, msg) \ do { \ int __cond_in_macro = (cond); \ if (__cond_in_macro) \ error_exit(__cond_in_macro, (msg)); \ } while (0) void error_msg(int ret, int nr, int *status, const char *msg) { int i; fprintf(stderr, "Error: %s, ret : %d, error: %s\n", msg, ret, strerror(errno)); if (!nr) return; fprintf(stderr, "status: "); for (i = 0; i < nr; i++) fprintf(stderr, "%d ", status[i]); fprintf(stderr, "\n"); } void error_exit(int ret, const char *msg) { error_msg(ret, 0, NULL, msg); exit(1); } int page_size; bool do_vmsplice; bool do_thp; static int pipe_fds[2]; void *addr; char *pn; char *pn1; void *pages[2]; int status[2]; void prepare() { int ret; struct iovec iov; if (addr) { munmap(addr, MAP_SIZE); close(pipe_fds[0]); close(pipe_fds[1]); } ret = pipe(pipe_fds); ERR_EXIT_ON(ret, "pipe"); addr = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ERR_EXIT_ON(addr == MAP_FAILED, "mmap"); if (do_thp) { ret = madvise(addr, MAP_SIZE, MADV_HUGEPAGE); ERR_EXIT_ON(ret, "advise hugepage"); } pn = (char *)(((unsigned long)addr + THP_SIZE) & ~THP_MASK); pn1 = pn + THP_SIZE; pages[0] = pn; pages[1] = pn1; *pn = 1; if (do_vmsplice) { iov.iov_base = pn; iov.iov_len = page_size; ret = vmsplice(pipe_fds[1], &iov, 1, 0); ERR_EXIT_ON(ret < 0, "vmsplice"); } status[0] = status[1] = 1024; } void test_migrate() { int ret; int nodes[2] = { 1, 1 }; pid_t pid = getpid(); prepare(); ret = move_pages(pid, 1, pages, nodes, status, MPOL_MF_MOVE_ALL); error_msg(ret, 1, status, "move 1 page"); prepare(); ret = move_pages(pid, 2, pages, nodes, status, MPOL_MF_MOVE_ALL); error_msg(ret, 2, status, "move 2 pages, page 1 not mapped"); prepare(); *pn1 = 1; ret = move_pages(pid, 2, pages, nodes, status, MPOL_MF_MOVE_ALL); error_msg(ret, 2, status, "move 2 pages"); prepare(); *pn1 = 1; nodes[1] = 0; ret = move_pages(pid, 2, pages, nodes, status, MPOL_MF_MOVE_ALL); error_msg(ret, 2, status, "move 2 pages, page 1 to node 0"); } int main(int argc, char *argv[]) { numa_run_on_node(0); page_size = getpagesize(); test_migrate(); fprintf(stderr, "\nMake page 0 cannot be migrated:\n"); do_vmsplice = true; test_migrate(); fprintf(stderr, "\nTest THP:\n"); do_thp = true; do_vmsplice = false; test_migrate(); fprintf(stderr, "\nTHP: make page 0 cannot be migrated:\n"); do_vmsplice = true; test_migrate(); return 0; } " The output of the current kernel is, " Error: move 1 page, ret : 0, error: Success status: 1 Error: move 2 pages, page 1 not mapped, ret : 0, error: Success status: 1 -14 Error: move 2 pages, ret : 0, error: Success status: 1 1 Error: move 2 pages, page 1 to node 0, ret : 0, error: Success status: 1 0 Make page 0 cannot be migrated: Error: move 1 page, ret : 0, error: Success status: 1024 Error: move 2 pages, page 1 not mapped, ret : 1, error: Success status: 1024 -14 Error: move 2 pages, ret : 0, error: Success status: 1024 1024 Error: move 2 pages, page 1 to node 0, ret : 1, error: Success status: 1024 1024 " While the expected output is, " Error: move 1 page, ret : 0, error: Success status: 1 Error: move 2 pages, page 1 not mapped, ret : 0, error: Success status: 1 -14 Error: move 2 pages, ret : 0, error: Success status: 1 1 Error: move 2 pages, page 1 to node 0, ret : 0, error: Success status: 1 0 Make page 0 cannot be migrated: Error: move 1 page, ret : 1, error: Success status: 1024 Error: move 2 pages, page 1 not mapped, ret : 1, error: Success status: 1024 -14 Error: move 2 pages, ret : 1, error: Success status: 1024 1024 Error: move 2 pages, page 1 to node 0, ret : 2, error: Success status: 1024 1024 " Fix this via correcting the remaining pages counting. With the fix, the output for the test program as above is expected. Link: https://lkml.kernel.org/r/20220817081408.513338-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20220817081408.513338-2-ying.huang@intel.com Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" Reviewed-by: Oscar Salvador Cc: Baolin Wang Cc: Zi Yan Cc: Yang Shi Signed-off-by: Andrew Morton commit f347c9d2697fcbbb64e077f7113a3887a181b8c0 Author: Yang Yang Date: Fri Aug 5 03:38:39 2022 +0000 filemap: make the accounting of thrashing more consistent Once upon a time, we only support accounting thrashing of page cache. Then Joonsoo introduced workingset detection for anonymous pages and we gained the ability to account thrashing of them[1]. So let delayacct account both the thrashing of page cache and anonymous pages, this could make the codes more consistent and simpler. [1] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") Link: https://lkml.kernel.org/r/20220805033838.1714674-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Signed-off-by: CGEL ZTE Acked-by: Joonsoo Kim Cc: Balbir Singh Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Yang Yang Cc: David Hildenbrand Signed-off-by: Andrew Morton commit 5154e607967d3f587fda84a40abbf900275016c9 Author: Peter Xu Date: Thu Aug 11 12:13:31 2022 -0400 mm/swap: cache swap migration A/D bits support Introduce a variable swap_migration_ad_supported to cache whether the arch supports swap migration A/D bits. Here one thing to mention is that SWP_MIG_TOTAL_BITS will internally reference the other macro MAX_PHYSMEM_BITS, which is a function call on x86 (constant on all the rest of archs). It's safe to reference it in swapfile_init() because when reaching here we're already during initcalls level 4 so we must have initialized 5-level pgtable for x86_64 (right after early_identify_cpu() finishes). - start_kernel - setup_arch - early_cpu_init - get_cpu_cap --> fetch from CPUID (including X86_FEATURE_LA57) - early_identify_cpu --> clear X86_FEATURE_LA57 (if early lvl5 not enabled (USE_EARLY_PGTABLE_L5)) - arch_call_rest_init - rest_init - kernel_init - kernel_init_freeable - do_basic_setup - do_initcalls --> calls swapfile_init() (initcall level 4) This should slightly speed up the migration swap entry handlings. Link: https://lkml.kernel.org/r/20220811161331.37055-8-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Huang Ying Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit be45a4902c7caa717fee6b2f671e59b396ed395c Author: Peter Xu Date: Thu Aug 11 12:13:30 2022 -0400 mm/swap: cache maximum swapfile size when init swap We used to have swapfile_maximum_size() fetching a maximum value of swapfile size per-arch. As the caller of max_swapfile_size() grows, this patch introduce a variable "swapfile_maximum_size" and cache the value of old max_swapfile_size(), so that we don't need to calculate the value every time. Caching the value in swapfile_init() is safe because when reaching the phase we should have initialized all the relevant information. Here the major arch to take care of is x86, which defines the max swapfile size based on L1TF mitigation. Here both X86_BUG_L1TF or l1tf_mitigation should have been setup properly when reaching swapfile_init(). As a reference, the code path looks like this for x86: - start_kernel - setup_arch - early_cpu_init - early_identify_cpu --> setup X86_BUG_L1TF - parse_early_param - l1tf_cmdline --> set l1tf_mitigation - check_bugs - l1tf_select_mitigation --> set l1tf_mitigation - arch_call_rest_init - rest_init - kernel_init - kernel_init_freeable - do_basic_setup - do_initcalls --> calls swapfile_init() (initcall level 4) The swapfile size only depends on swp pte format on non-x86 archs, so caching it is safe too. Since at it, rename max_swapfile_size() to arch_max_swapfile_size() because arch can define its own function, so it's more straightforward to have "arch_" as its prefix. At the meantime, export swapfile_maximum_size to replace the old usages of max_swapfile_size(). [peterx@redhat.com: declare arch_max_swapfile_size) in swapfile.h] Link: https://lkml.kernel.org/r/YxTh1GuC6ro5fKL5@xz-m1.local Link: https://lkml.kernel.org/r/20220811161331.37055-7-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: "Huang, Ying" Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit 2e3468778dbe3ec389a10c21a703bb8e5be5cfbc Author: Peter Xu Date: Thu Aug 11 12:13:29 2022 -0400 mm: remember young/dirty bit for page migrations When page migration happens, we always ignore the young/dirty bit settings in the old pgtable, and marking the page as old in the new page table using either pte_mkold() or pmd_mkold(), and keeping the pte clean. That's fine from functional-wise, but that's not friendly to page reclaim because the moving page can be actively accessed within the procedure. Not to mention hardware setting the young bit can bring quite some overhead on some systems, e.g. x86_64 needs a few hundreds nanoseconds to set the bit. The same slowdown problem to dirty bits when the memory is first written after page migration happened. Actually we can easily remember the A/D bit configuration and recover the information after the page is migrated. To achieve it, define a new set of bits in the migration swap offset field to cache the A/D bits for old pte. Then when removing/recovering the migration entry, we can recover the A/D bits even if the page changed. One thing to mention is that here we used max_swapfile_size() to detect how many swp offset bits we have, and we'll only enable this feature if we know the swp offset is big enough to store both the PFN value and the A/D bits. Otherwise the A/D bits are dropped like before. Link: https://lkml.kernel.org/r/20220811161331.37055-6-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: "Huang, Ying" Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit 0ccf7f168e17bb7eb5a322397ba5a841f4fbaccb Author: Peter Xu Date: Thu Aug 11 12:13:28 2022 -0400 mm/thp: carry over dirty bit when thp splits on pmd Carry over the dirty bit from pmd to pte when a huge pmd splits. It shouldn't be a correctness issue since when pmd_dirty() we'll have the page marked dirty anyway, however having dirty bit carried over helps the next initial writes of split ptes on some archs like x86. Link: https://lkml.kernel.org/r/20220811161331.37055-5-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Huang Ying Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit 0d206b5d2e0d7d7f09ac9540e3ab3e35a34f536e Author: Peter Xu Date: Thu Aug 11 12:13:27 2022 -0400 mm/swap: add swp_offset_pfn() to fetch PFN from swap entry We've got a bunch of special swap entries that stores PFN inside the swap offset fields. To fetch the PFN, normally the user just calls swp_offset() assuming that'll be the PFN. Add a helper swp_offset_pfn() to fetch the PFN instead, fetching only the max possible length of a PFN on the host, meanwhile doing proper check with MAX_PHYSMEM_BITS to make sure the swap offsets can actually store the PFNs properly always using the BUILD_BUG_ON() in is_pfn_swap_entry(). One reason to do so is we never tried to sanitize whether swap offset can really fit for storing PFN. At the meantime, this patch also prepares us with the future possibility to store more information inside the swp offset field, so assuming "swp_offset(entry)" to be the PFN will not stand any more very soon. Replace many of the swp_offset() callers to use swp_offset_pfn() where proper. Note that many of the existing users are not candidates for the replacement, e.g.: (1) When the swap entry is not a pfn swap entry at all, or, (2) when we wanna keep the whole swp_offset but only change the swp type. For the latter, it can happen when fork() triggered on a write-migration swap entry pte, we may want to only change the migration type from write->read but keep the rest, so it's not "fetching PFN" but "changing swap type only". They're left aside so that when there're more information within the swp offset they'll be carried over naturally in those cases. Since at it, dropping hwpoison_entry_to_pfn() because that's exactly what the new swp_offset_pfn() is about. Link: https://lkml.kernel.org/r/20220811161331.37055-4-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: "Huang, Ying" Cc: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit eba4d770efc86a3710e36b828190858abfa3bb74 Author: Peter Xu Date: Thu Aug 11 12:13:26 2022 -0400 mm/swap: comment all the ifdef in swapops.h swapops.h contains quite a few layers of ifdef, some of the "else" and "endif" doesn't get proper comment on the macro so it's hard to follow on what are they referring to. Add the comments. Link: https://lkml.kernel.org/r/20220811161331.37055-3-peterx@redhat.com Signed-off-by: Peter Xu Suggested-by: Nadav Amit Reviewed-by: Huang Ying Reviewed-by: Alistair Popple Cc: Andi Kleen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Minchan Kim Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit 9c61d5321e94a4d0678b5eb0515afc590bdb9740 Author: Peter Xu Date: Thu Aug 11 12:13:25 2022 -0400 mm/x86: use SWP_TYPE_BITS in 3-level swap macros Patch series "mm: Remember a/d bits for migration entries", v4. Problem ======= When migrating a page, right now we always mark the migrated page as old & clean. However that could lead to at least two problems: (1) We lost the real hot/cold information while we could have persisted. That information shouldn't change even if the backing page is changed after the migration, (2) There can be always extra overhead on the immediate next access to any migrated page, because hardware MMU needs cycles to set the young bit again for reads, and dirty bits for write, as long as the hardware MMU supports these bits. Many of the recent upstream works showed that (2) is not something trivial and actually very measurable. In my test case, reading 1G chunk of memory - jumping in page size intervals - could take 99ms just because of the extra setting on the young bit on a generic x86_64 system, comparing to 4ms if young set. This issue is originally reported by Andrea Arcangeli. Solution ======== To solve this problem, this patchset tries to remember the young/dirty bits in the migration entries and carry them over when recovering the ptes. We have the chance to do so because in many systems the swap offset is not really fully used. Migration entries use swp offset to store PFN only, while the PFN is normally not as large as swp offset and normally smaller. It means we do have some free bits in swp offset that we can use to store things like A/D bits, and that's how this series tried to approach this problem. max_swapfile_size() is used here to detect per-arch offset length in swp entries. We'll automatically remember the A/D bits when we find that we have enough swp offset field to keep both the PFN and the extra bits. Since max_swapfile_size() can be slow, the last two patches cache the results for it and also swap_migration_ad_supported as a whole. Known Issues / TODOs ==================== We still haven't taught madvise() to recognize the new A/D bits in migration entries, namely MADV_COLD/MADV_FREE. E.g. when MADV_COLD upon a migration entry. It's not clear yet on whether we should clear the A bit, or we should just drop the entry directly. We didn't teach idle page tracking on the new migration entries, because it'll need larger rework on the tree on rmap pgtable walk. However it should make it already better because before this patchset page will be old page after migration, so the series will fix potential false negative of idle page tracking when pages were migrated before observing. The other thing is migration A/D bits will not start to working for private device swap entries. The code is there for completeness but since private device swap entries do not yet have fields to store A/D bits, even if we'll persistent A/D across present pte switching to migration entry, we'll lose it again when the migration entry converted to private device swap entry. Tests ===== After the patchset applied, the immediate read access test [1] of above 1G chunk after migration can shrink from 99ms to 4ms. The test is done by moving 1G pages from node 0->1->0 then read it in page size jumps. The test is with Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz. Similar effect can also be measured when writting the memory the 1st time after migration. After applying the patchset, both initial immediate read/write after page migrated will perform similarly like before migration happened. Patch Layout ============ Patch 1-2: Cleanups from either previous versions or on swapops.h macros. Patch 3-4: Prepare for the introduction of migration A/D bits Patch 5: The core patch to remember young/dirty bit in swap offsets. Patch 6-7: Cache relevant fields to make migration_entry_supports_ad() fast. [1] https://github.com/xzpeter/clibs/blob/master/misc/swap-young.c This patch (of 7): Replace all the magic "5" with the macro. Link: https://lkml.kernel.org/r/20220811161331.37055-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20220811161331.37055-2-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: David Hildenbrand Reviewed-by: Huang Ying Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Minchan Kim Cc: Andi Kleen Cc: Nadav Amit Cc: Vlastimil Babka Cc: Dave Hansen Signed-off-by: Andrew Morton commit 9cf2819159d5a35311fc39c328ebeca5ce50d7c0 Author: Miaohe Lin Date: Tue Aug 30 20:36:04 2022 +0800 mm, hwpoison: cleanup some obsolete comments 1.Remove meaningless comment in kill_proc(). That doesn't tell anything. 2.Fix the wrong function name get_hwpoison_unless_zero(). It should be get_page_unless_zero(). 3.The gate keeper for free hwpoison page has moved to check_new_page(). Update the corresponding comment. Link: https://lkml.kernel.org/r/20220830123604.25763-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit b680dae9a881bbf80dc53a79a59e4f1386b7da5e Author: Miaohe Lin Date: Tue Aug 30 20:36:03 2022 +0800 mm, hwpoison: check PageTable() explicitly in hwpoison_user_mappings() PageTable can't be handled by memory_failure(). Filter it out explicitly in hwpoison_user_mappings(). This will also make code more consistent with the relevant check in unpoison_memory(). Link: https://lkml.kernel.org/r/20220830123604.25763-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 36537a67d3561bfe2b3654161d6c9008fff84d43 Author: Miaohe Lin Date: Tue Aug 30 20:36:02 2022 +0800 mm, hwpoison: avoid unneeded page_mapped_in_vma() overhead in collect_procs_anon() If vma->vm_mm != t->mm, there's no need to call page_mapped_in_vma() as add_to_kill() won't be called in this case. Move up the mm check to avoid possible unneeded calling to page_mapped_in_vma(). Link: https://lkml.kernel.org/r/20220830123604.25763-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 21c9e90ab9a4c991d21dd15cc5163c99a885d4a8 Author: Miaohe Lin Date: Tue Aug 30 20:36:01 2022 +0800 mm, hwpoison: use num_poisoned_pages_sub() to decrease num_poisoned_pages Use num_poisoned_pages_sub() to combine multiple atomic ops into one. Also num_poisoned_pages_dec() can be killed as there's no caller now. Link: https://lkml.kernel.org/r/20220830123604.25763-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit da29499124cd2221539b235c1f93c7d93faf6565 Author: Miaohe Lin Date: Tue Aug 30 20:36:00 2022 +0800 mm, hwpoison: use __PageMovable() to detect non-lru movable pages It's more recommended to use __PageMovable() to detect non-lru movable pages. We can avoid bumping page refcnt via isolate_movable_page() for the isolated lru pages. Also if pages become PageLRU just after they're checked but before trying to isolate them, isolate_lru_page() will be called to do the right work. [linmiaohe@huawei.com: fixes per Naoya Horiguchi] Link: https://lkml.kernel.org/r/1f7ee86e-7d28-0d8c-e0de-b7a5a94519e8@huawei.com Link: https://lkml.kernel.org/r/20220830123604.25763-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Naoya Horiguchi Signed-off-by: Andrew Morton commit 2fe62e222680e1d6ff7112cad5bcccdc858d020d Author: Miaohe Lin Date: Tue Aug 30 20:35:59 2022 +0800 mm, hwpoison: use ClearPageHWPoison() in memory_failure() Patch series "A few cleanup patches for memory-failure". his series contains a few cleanup patches to use __PageMovable() to detect non-lru movable pages, use num_poisoned_pages_sub() to reduce multiple atomic ops overheads and so on. More details can be found in the respective changelogs. This patch (of 6): Use ClearPageHWPoison() instead of TestClearPageHWPoison() to clear page hwpoison flags to avoid unneeded full memory barrier overhead. Link: https://lkml.kernel.org/r/20220830123604.25763-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220830123604.25763-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 4d24de9425f75fe489ab651113b97f3f7b4dea62 Author: Yang Shi Date: Wed Sep 14 09:22:20 2022 -0700 mm: MADV_COLLAPSE: refetch vm_end after reacquiring mmap_lock The syzbot reported the below problem: BUG: Bad page map in process syz-executor198 pte:8000000071c00227 pmd:74b30067 addr:0000000020563000 vm_flags:08100077 anon_vma:ffff8880547d2200 mapping:0000000000000000 index:20563 file:(null) fault:0x0 mmap:0x0 read_folio:0x0 CPU: 1 PID: 3614 Comm: syz-executor198 Not tainted 6.0.0-rc3-next-20220901-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_bad_pte.cold+0x2a7/0x2d0 mm/memory.c:565 vm_normal_page+0x10c/0x2a0 mm/memory.c:636 hpage_collapse_scan_pmd+0x729/0x1da0 mm/khugepaged.c:1199 madvise_collapse+0x481/0x910 mm/khugepaged.c:2433 madvise_vma_behavior+0xd0a/0x1cc0 mm/madvise.c:1062 madvise_walk_vmas+0x1c7/0x2b0 mm/madvise.c:1236 do_madvise.part.0+0x24a/0x340 mm/madvise.c:1415 do_madvise mm/madvise.c:1428 [inline] __do_sys_madvise mm/madvise.c:1428 [inline] __se_sys_madvise mm/madvise.c:1426 [inline] __x64_sys_madvise+0x113/0x150 mm/madvise.c:1426 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f770ba87929 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f770ba18308 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f770bb0f3f8 RCX: 00007f770ba87929 RDX: 0000000000000019 RSI: 0000000000600003 RDI: 0000000020000000 RBP: 00007f770bb0f3f0 R08: 00007f770ba18700 R09: 0000000000000000 R10: 00007f770ba18700 R11: 0000000000000246 R12: 00007f770bb0f3fc R13: 00007ffc2d8b62ef R14: 00007f770ba18400 R15: 0000000000022000 Basically the test program does the below conceptually: 1. mmap 0x2000000 - 0x21000000 as anonymous region 2. mmap io_uring SQ stuff at 0x20563000 with MAP_FIXED, io_uring_mmap() actually remaps the pages with special PTEs 3. call MADV_COLLAPSE for 0x20000000 - 0x21000000 It actually triggered the below race: CPU A CPU B mmap 0x20000000 - 0x21000000 as anon madvise_collapse is called on this area Retrieve start and end address from the vma (NEVER updated later!) Collapsed the first 2M area and dropped mmap_lock Acquire mmap_lock mmap io_uring file at 0x20563000 Release mmap_lock Reacquire mmap_lock revalidate vma pass since 0x20200000 + 0x200000 > 0x20563000 scan the next 2M (0x20200000 - 0x20400000), but due to whatever reason it didn't release mmap_lock scan the 3rd 2M area (start from 0x20400000) get into the vma created by io_uring The hend should be updated after MADV_COLLAPSE reacquire mmap_lock since the vma may be shrunk. We don't have to worry about shink from the other direction since it could be caught by hugepage_vma_revalidate(). Either no valid vma is found or the vma doesn't fit anymore. Link: https://lkml.kernel.org/r/20220914162220.787703-1-shy828301@gmail.com Fixes: 7d8faaf155454f8 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse") Reported-by: syzbot+915f3e317adb0e85835f@syzkaller.appspotmail.com Signed-off-by: Yang Shi Reviewed-by: Zach O'Keefe Signed-off-by: Andrew Morton commit 31e4fcf9713096c187f84bf3cb249637b8b681e1 Author: Satya Priya Date: Tue Sep 20 17:04:43 2022 +0530 clk: qcom: lpass: Fix lpass audiocc probe Change the qcom_cc_probe_by_index() call to qcom_cc_really_probe() to avoid remapping of memory region for index 0, which is already being done through qcom_cc_map(). Fixes: 7c6a6641c2 ("clk: qcom: lpass: Add support for resets & external mclk for SC7280") Signed-off-by: Satya Priya Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1663673683-7018-1-git-send-email-quic_c_skakit@quicinc.com commit cca7b7d5f168dc0da83429e4f5c0bfbd53c9a456 Author: Robert Marko Date: Fri Aug 19 00:06:26 2022 +0200 clk: qcom: apss-ipq-pll: add support for IPQ8074 Add support for IPQ8074 since it uses the same PLL setup, however it uses slightly different Alpha PLL config. Alpha PLL config was obtained by dumping PLL registers from a running device. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-7-robimarko@gmail.com commit 2a4d70246556af9eae086af2fc6d582143b1c6f5 Author: Robert Marko Date: Fri Aug 19 00:06:25 2022 +0200 clk: qcom: apss-ipq-pll: update IPQ6018 Alpha PLL config Update the IPQ6018 Alpha PLL config to the latest one from the downstream 5.4 kernel[1]. This one should match the production SoC-s. Tested on IPQ6018 CP01-C1 reference board. [1] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.1.r4/drivers/clk/qcom/apss-ipq-pll.c#L41 Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-6-robimarko@gmail.com commit 823a117e1d97b57d1ef9932c55cc02d6d7ba0523 Author: Robert Marko Date: Fri Aug 19 00:06:24 2022 +0200 clk: qcom: apss-ipq-pll: use OF match data for Alpha PLL config Convert the driver to use OF match data for providing the Alpha PLL config per compatible. This is required for IPQ8074 support since it uses a different Alpha PLL config. While we are here rename "ipq_pll_config" to "ipq6018_pll_config" to make it clear that it is for IPQ6018 only. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-5-robimarko@gmail.com commit d522c77aa86069abc7653ff73691ff4e2fff7707 Author: Robert Marko Date: Fri Aug 19 00:06:23 2022 +0200 dt-bindings: clock: qcom,a53pll: add IPQ8074 compatible Add IPQ8074 compatible to A53 PLL bindings. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-4-robimarko@gmail.com commit 86e78995c93ee182433f965babfccd48417d4dcf Author: Robert Marko Date: Fri Aug 19 00:06:22 2022 +0200 clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical While fixing up the driver I noticed that my IPQ8074 board was hanging after CPUFreq switched the frequency during boot, WDT would eventually reset it. So mark apcs_alias0_core_clk as critical since its the clock feeding the CPU cluster and must never be disabled. Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller") Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-3-robimarko@gmail.com commit 43a56cbf2a38170b02db29654607575b1b4b5bc0 Author: Robert Marko Date: Fri Aug 19 00:06:21 2022 +0200 clk: qcom: apss-ipq6018: fix apcs_alias0_clk_src While working on IPQ8074 APSS driver it was discovered that IPQ6018 and IPQ8074 use almost the same PLL and APSS clocks, however APSS driver is currently broken. More precisely apcs_alias0_clk_src is broken, it was added as regmap_mux clock. However after debugging why it was always stuck at 800Mhz, it was figured out that its not regmap_mux compatible at all. It is a simple mux but it uses RCG2 register layout and control bits, so utilize the new clk_rcg2_mux_closest_ops to correctly drive it while not having to provide a dummy frequency table. While we are here, use ARRAY_SIZE for number of parents. Tested on IPQ6018-CP01-C1 reference board and multiple IPQ8074 boards. Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller") Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-2-robimarko@gmail.com commit c5d2c96b3a7bd8987fad9957510034130037fccf Author: Christian Marangi Date: Fri Aug 19 00:06:20 2022 +0200 clk: qcom: clk-rcg2: add rcg2 mux ops An RCG may act as a mux that switch between 2 parents. This is the case on IPQ6018 and IPQ8074 where the APCS core clk that feeds the CPU cluster clock just switches between XO and the PLL that feeds it. Add the required ops to add support for this special configuration and use the generic mux function to determine the rate. This way we dont have to keep a essentially dummy frequency table to use RCG2 as a mux. Signed-off-by: Christian Marangi Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220818220628.339366-1-robimarko@gmail.com commit 99e603874366be1115b40ecbc0e25847186d84ea Author: Christoph Hellwig Date: Wed Sep 21 20:05:01 2022 +0200 blk-cgroup: pass a gendisk to the blkg allocation helpers Prepare for storing the blkcg information in the gendisk instead of the request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-18-hch@lst.de Signed-off-by: Jens Axboe commit de185b56e8a62822d4e1cdb3e068b38ca709aa47 Author: Christoph Hellwig Date: Wed Sep 21 20:05:00 2022 +0200 blk-cgroup: pass a gendisk to blkcg_schedule_throttle Pass the gendisk to blkcg_schedule_throttle as part of moving the blk-cgroup infrastructure to be gendisk based. Remove the unused !BLK_CGROUP stub while we're at it. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-17-hch@lst.de Signed-off-by: Jens Axboe commit 00ad6991bbae116b7c83f68754edd6f4d5e65e01 Author: Christoph Hellwig Date: Wed Sep 21 20:04:59 2022 +0200 blk-cgroup: pass a gendisk to blkg_destroy_all Pass the gendisk to blkg_destroy_all as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-16-hch@lst.de Signed-off-by: Jens Axboe commit cad9266abcef586aa95f6f4095781e3e55473f2a Author: Christoph Hellwig Date: Wed Sep 21 20:04:58 2022 +0200 blk-throttle: pass a gendisk to blk_throtl_cancel_bios Pass the gendisk to blk_throtl_cancel_bios as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-15-hch@lst.de Signed-off-by: Jens Axboe commit 5f6dc7522ac2e1701c92f20b9a1a664736787728 Author: Christoph Hellwig Date: Wed Sep 21 20:04:57 2022 +0200 blk-throttle: pass a gendisk to blk_throtl_register_queue Pass the gendisk to blk_throtl_register_queue as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-14-hch@lst.de Signed-off-by: Jens Axboe commit e13793bae65919cd3e6a7827f8d30f4dbb8584ee Author: Christoph Hellwig Date: Wed Sep 21 20:04:56 2022 +0200 blk-throttle: pass a gendisk to blk_throtl_init and blk_throtl_exit Pass the gendisk to blk_throtl_init and blk_throtl_exit as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-13-hch@lst.de Signed-off-by: Jens Axboe commit 3657647e33dff916a2d2d9df926d9bca3907d34f Author: Christoph Hellwig Date: Wed Sep 21 20:04:55 2022 +0200 blk-iocost: cleanup ioc_qos_write Use a local disk variable instead of retrieving the disk and request_queue over and over by various means. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-12-hch@lst.de Signed-off-by: Jens Axboe commit 57b64554977e28ab84d33d298032872a8047a557 Author: Christoph Hellwig Date: Wed Sep 21 20:04:54 2022 +0200 blk-iocost: pass a gendisk to blk_iocost_init Pass the gendisk to blk_iocost_init as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-11-hch@lst.de Signed-off-by: Jens Axboe commit 9df3e65139b923dfe98f76b7057882c7afb2d3e4 Author: Christoph Hellwig Date: Wed Sep 21 20:04:53 2022 +0200 blk-iocost: simplify ioc_name Just directly dereference the disk name instead of going through multiple hoops to find the same value. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-10-hch@lst.de Signed-off-by: Jens Axboe commit 16fac1b5912b778a30d8863dbc928bef25c8d307 Author: Christoph Hellwig Date: Wed Sep 21 20:04:52 2022 +0200 blk-iolatency: pass a gendisk to blk_iolatency_init Pass the gendisk to blk_iolatency_init as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-9-hch@lst.de [axboe: missed inline for blk_iolatency_init() and !CONFIG_BLK_CGROUP_IOLATENCY] Signed-off-by: Jens Axboe commit b0dde3f5d628f76f461fb650e2cebfac3460cff6 Author: Christoph Hellwig Date: Wed Sep 21 20:04:51 2022 +0200 blk-ioprio: pass a gendisk to blk_ioprio_init and blk_ioprio_exit Pass the gendisk to blk_ioprio_init and blk_ioprio_exit as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-8-hch@lst.de Signed-off-by: Jens Axboe commit 9823538fb7efe66ce987a1e4c0e0f3dc882623c4 Author: Christoph Hellwig Date: Wed Sep 21 20:04:50 2022 +0200 blk-cgroup: pass a gendisk to blkcg_init_queue and blkcg_exit_queue Pass the gendisk to blkcg_init_disk and blkcg_exit_disk as part of moving the blk-cgroup infrastructure to be gendisk based. Also remove the rather pointless kerneldoc comments for these internal functions with a single caller each. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-7-hch@lst.de Signed-off-by: Jens Axboe commit f753526e327bc849c445c084d0f374e992038ae9 Author: Christoph Hellwig Date: Wed Sep 21 20:04:49 2022 +0200 blk-cgroup: remove blkg_lookup_check The combinations of an error check with an ERR_PTR return and a lookup with a NULL return leads to ugly handling of the return values in the callers. Just open coding the check and the lookup is much simpler. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-6-hch@lst.de Signed-off-by: Jens Axboe commit 4a69f325aa43847e0827fbfe4b3623307b0c9baa Author: Christoph Hellwig Date: Wed Sep 21 20:04:48 2022 +0200 blk-cgroup: cleanup the blkg_lookup family of functions Add a fully inlined blkg_lookup as the extra two checks aren't going to generated a lot more code vs the call to the slowpath routine, and open code the hint update in the two callers that care. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-5-hch@lst.de Signed-off-by: Jens Axboe commit 79fcc5be93e5b17a2a5d36553f7a5c1ad9e953b6 Author: Christoph Hellwig Date: Wed Sep 21 20:04:47 2022 +0200 blk-cgroup: remove open coded blkg_lookup instances Use blkg_lookup instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-4-hch@lst.de Signed-off-by: Jens Axboe commit 928f6f00a91ecbef6cb1fe59474831ceaf205290 Author: Christoph Hellwig Date: Wed Sep 21 20:04:46 2022 +0200 blk-cgroup: remove blk_queue_root_blkg Just open code it in the only caller and drop the unused !BLK_CGROUP stub. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-3-hch@lst.de Signed-off-by: Jens Axboe commit 33dc62796cb657a633050138a86253fb2a553713 Author: Christoph Hellwig Date: Wed Sep 21 20:04:45 2022 +0200 blk-cgroup: fix error unwinding in blkcg_init_queue When blk_throtl_init fails, we need to call blk_ioprio_exit. Switch to proper goto based unwinding to fix this. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-2-hch@lst.de Signed-off-by: Jens Axboe commit 5dcf41a8e928ca084e1c38ef51d067cd7587999f Merge: ebb410a03e472 77ceb3731e128 Author: Jakub Kicinski Date: Mon Sep 26 17:45:40 2022 -0700 Merge branch 'net-sunhme-cleanups-and-logging-improvements' Sean Anderson says: ==================== net: sunhme: Cleanups and logging improvements This series is a continuation of [1] with a focus on logging improvements (in the style of commit b11e5f6a3a5c ("net: sunhme: output link status with a single print.")). I have included several of Rolf's patches in the series where appropriate (with slight modifications). After this series is applied, many more messages from this driver will come with driver/device information. Additionally, most messages (especially debug messages) have been condensed onto one line (as KERN_CONT messages get split). [1] https://lore.kernel.org/netdev/4686583.GXAFRqVoOG@eto.sf-tec.de/ ==================== Link: https://lore.kernel.org/r/20220924015339.1816744-1-seanga2@gmail.com Signed-off-by: Jakub Kicinski commit 77ceb3731e128ee9cc5b3f0e7413a1b4f868d8e3 Author: Sean Anderson Date: Fri Sep 23 21:53:39 2022 -0400 sunhme: Add myself as a maintainer I have the hardware so at the very least I can test things. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 26657c70b91cf859d2205c246b13e51a38a40aa4 Author: Sean Anderson Date: Fri Sep 23 21:53:38 2022 -0400 sunhme: Use vdbg for spam-y prints The SXD, TXD, and RXD macros are used only once (or twice). Just use the vdbg print, which seems to have been devised for these sorts of very verbose messages. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 24cddbc3ef11515e3e9ef43d37cab5cbcb1d75b3 Author: Sean Anderson Date: Fri Sep 23 21:53:37 2022 -0400 sunhme: Combine continued messages This driver seems to have been written under the assumption that messages can be continued arbitrarily. I'm not when this changed (if ever), but such ad-hoc continuations are liable to be rudely interrupted. Convert all such instances to single prints. This loses a bit of timing information (such as when a line was constructed piecemeal as the function executed), but it's easy to add a few prints if necessary. This also adds newlines to the ends of any prints without them. Since (almost every) debug print included the name of the function, include it automatically. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 8acf878f29d00563e2bbed36de6b1be75dc4ab7a Author: Sean Anderson Date: Fri Sep 23 21:53:36 2022 -0400 sunhme: Use (net)dev_foo wherever possible Wherever possible, use the associated netdev (or device) when printing errors or other messages. This makes it immediately clear what device caused the error, and provides more information than just the device name. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 0bc1f45410ea9f791698a0d0082e693434798188 Author: Sean Anderson Date: Fri Sep 23 21:53:35 2022 -0400 sunhme: Convert printk(KERN_FOO ...) to pr_foo(...) This is a mostly-mechanical translation of the existing printks into pr_foos. In several places, I have pasted messages which were broken over several lines to allow for easier grepping. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 30931367ba80a7457d8e67a22941071e6ecb346b Author: Sean Anderson Date: Fri Sep 23 21:53:34 2022 -0400 sunhme: Clean up debug infrastructure Remove all the single-use debug conditionals, and just collect the debug defines at the top of the file. HMD seems like it is used for general debug info, so just redefine it as pr_debug. Additionally, instead of using the default loglevel, use the debug loglevel for debugging. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 03290907a5d15080da5a04adbdb173d5ab8f743c Author: Sean Anderson Date: Fri Sep 23 21:53:33 2022 -0400 sunhme: Convert FOO((...)) to FOO(...) With the power of variadic macros, double parentheses are unnecessary. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 914d9b2711ddb86c3480cbdac74a55b453e491bc Author: Rolf Eike Beer Date: Fri Sep 23 21:53:32 2022 -0400 sunhme: switch to devres This not only removes a lot of code, it also fixes the memleak of the DMA memory when register_netdev() fails. Signed-off-by: Rolf Eike Beer [ rebased onto net-next/master; fixed error reporting ] Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 5b3dc6dda6b1af8a6117d99394a6db81ec9be3d5 Author: Sean Anderson Date: Fri Sep 23 21:53:31 2022 -0400 sunhme: Regularize probe errors This fixes several error paths to ensure they return an appropriate error (instead of ENODEV). Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit d6f1e89bdbb87365adcf16dfca40cdef6726d616 Author: Sean Anderson Date: Fri Sep 23 21:53:30 2022 -0400 sunhme: Return an ERR_PTR from quattro_pci_find In order to differentiate between a missing bridge and an OOM condition, return ERR_PTRs from quattro_pci_find. This also does some general linting in the area. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit acb3f35f920b532a22cafc10a0f78827b2d238f5 Author: Rolf Eike Beer Date: Fri Sep 23 21:53:29 2022 -0400 sunhme: forward the error code from pci_enable_device() This already returns a proper error value, so pass it to the caller. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 6478c6e994559ca2a4cb42808b35220704624660 Author: Sean Anderson Date: Fri Sep 23 21:53:28 2022 -0400 sunhme: Remove version Module versions are not very useful: > The basic problem is, the version string does not identify the sources > with enough accuracy. It says nothing about back ported fixes in > stable kernels. It tells you nothing about vendor patches to the > network core, etc. https://lore.kernel.org/all/Yf6mtvA1zO7cdzr7@lunn.ch/ While we're at it, inline the author and use the driver name a bit more. Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit 8247ab50c2ad01bf82127751d845f88dfec6b978 Author: Rolf Eike Beer Date: Fri Sep 23 21:53:27 2022 -0400 sunhme: remove unused tx_dump_ring() I can't find a reference to it in the entire git history. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson Signed-off-by: Jakub Kicinski commit ebb410a03e4724af5638dd7164ead5fadff26283 Merge: b860a1b964be7 6387bf7c390a1 Author: Jakub Kicinski Date: Mon Sep 26 17:44:31 2022 -0700 Merge branch 'net-dsa-remove-unnecessary-i2c_set_clientdata' Yang Yingliang says: ==================== net: dsa: remove unnecessary i2c_set_clientdata() This patchset https://lore.kernel.org/all/20220921140524.3831101-8-yangyingliang@huawei.com/T/ removed all set_drvdata(NULL) in driver remove function. i2c_set_clientdata() is another wrapper of set drvdata function, to follow the same convention, remove i2c_set_clientdata() called in driver remove function in drivers/net/dsa/. ==================== Link: https://lore.kernel.org/r/20220923143742.87093-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 6387bf7c390a17a03f05a70099e135f61c7cb437 Author: Yang Yingliang Date: Fri Sep 23 22:37:42 2022 +0800 net: dsa: xrs700x: remove unnecessary i2c_set_clientdata() Remove unnecessary i2c_set_clientdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 008971adb95d332d21b9cc94231d93d7324d859d Author: Yang Yingliang Date: Fri Sep 23 22:37:41 2022 +0800 net: dsa: microchip: ksz9477: remove unnecessary i2c_set_clientdata() Remove unnecessary i2c_set_clientdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit db5d451c4640a62b0971c7753ab321f089f32571 Author: Yang Yingliang Date: Fri Sep 23 22:37:40 2022 +0800 net: dsa: lan9303: remove unnecessary i2c_set_clientdata() Remove unnecessary i2c_set_clientdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit c278d9f8ac0db5590909e6d9e85b5ca2b786704f Author: Pavel Begunkov Date: Tue Sep 27 00:44:40 2022 +0100 io_uring/rw: don't lose short results on io_setup_async_rw() If a retry io_setup_async_rw() fails we lose result from the first io_iter_do_read(), which is a problem mostly for streams/sockets. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0e8d20cebe5fc9c96ed268463c394237daabc384.1664235732.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit bf68b5b34311ee57ed40749a1257a30b46127556 Author: Pavel Begunkov Date: Tue Sep 27 00:44:39 2022 +0100 io_uring/rw: fix unexpected link breakage req->cqe.res is set in io_read() to the amount of bytes left to be done, which is used to figure out whether to fail a read or not. However, io_read() may do another without returning, and we stash the previous value into ->bytes_done but forget to update cqe.res. Then we ask a read to do strictly less than cqe.res but expect the return to be exactly cqe.res. Fix the bug by updating cqe.res for retries. Cc: stable@vger.kernel.org Reported-and-Tested-by: Beld Zhang Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3a1088440c7be98e5800267af922a67da0ef9f13.1664235732.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 760bda91cb4f5f778a6193b20c22726209579164 Author: Uwe Kleine-König Date: Mon Sep 26 17:39:46 2022 +0200 hwmon: w83627hf: Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless code repetition (unless there are cyclic dependencies). Reorder some functions and variables which allows to get rid of 7 forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220926153946.1478260-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 834168fb2ce57681dee86a405ec560f54417830c Author: Xiu Jianfeng Date: Thu Sep 22 18:32:08 2022 +0800 rv/monitor: Add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Link: https://lkml.kernel.org/r/20220922103208.162869-1-xiujianfeng@huawei.com Fixes: 24bce201d798 ("tools/rv: Add dot2k") Fixes: 8812d21219b9 ("rv/monitor: Add the wip monitor skeleton created by dot2k") Fixes: ccc319dcb450 ("rv/monitor: Add the wwnr monitor") Signed-off-by: Xiu Jianfeng Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 4d1632151bde847230a0bd2318806380d309655f Author: Pavel Machek Date: Mon Sep 26 23:16:37 2022 +0200 leds: pca963: fix misleading indentation I'm getting warnings: /tmp/next/build/drivers/leds/leds-pca963x.c: In function 'pca963x_register_leds': /tmp/next/build/drivers/leds/leds-pca963x.c:355:3: error: this 'if' clause does not guard... +[-Werror=misleading-indentation] 355 | if (hw_blink) | ^~ /tmp/next/build/drivers/leds/leds-pca963x.c:357:4: note: ...this statement, but the latter is +misleadingly indented as if it were guarded by the 'if' 357 | led->blinking = false; | ^~~ cc1: all warnings being treated as errors Fix the indentation to make them go away. Signed-off-by: Pavel Machek commit a12b78b5714456e276b9545005f518802a319af9 Author: Ard Biesheuvel Date: Sun Sep 18 20:02:44 2022 +0200 efi: libstub: remove pointless goto kludge Remove some goto cruft that serves no purpose and obfuscates the code. Signed-off-by: Ard Biesheuvel commit eab3126571ed1e3e57ce0f066b566af472ebc47a Author: Ard Biesheuvel Date: Fri Jun 3 15:29:22 2022 +0200 efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap Currently, struct efi_boot_memmap is a struct that is passed around between callers of efi_get_memory_map() and the users of the resulting data, and which carries pointers to various variables whose values are provided by the EFI GetMemoryMap() boot service. This is overly complex, and it is much easier to carry these values in the struct itself. So turn the struct into one that carries these data items directly, including a flex array for the variable number of EFI memory descriptors that the boot service may return. Signed-off-by: Ard Biesheuvel commit f80d26043af91ceb5036c478101c015edb9e7630 Author: Ard Biesheuvel Date: Thu Sep 15 19:45:35 2022 +0200 efi: libstub: avoid efi_get_memory_map() for allocating the virt map The virt map is a set of efi_memory_desc_t descriptors that are passed to SetVirtualAddressMap() to inform the firmware about the desired virtual mapping of the regions marked as EFI_MEMORY_RUNTIME. The only reason we currently call the efi_get_memory_map() helper is that it gives us an allocation that is guaranteed to be of sufficient size. However, efi_get_memory_map() has grown some additional complexity over the years, and today, we're actually better off calling the EFI boot service directly with a zero size, which tells us how much memory should be enough for the virt map. While at it, avoid creating the VA map allocation if we will not be using it anyway, i.e., if efi_novamap is true. Signed-off-by: Ard Biesheuvel commit b860a1b964be7917ed3dcaa674ec0a2ba0a62aa0 Author: Jesper Dangaard Brouer Date: Fri Sep 23 14:48:00 2022 +0200 xdp: Adjust xdp_frame layout to avoid using bitfields Practical experience (and advice from Alexei) tell us that bitfields in structs lead to un-optimized assembly code. I've verified this change does lead to better x86_64 assembly, both via objdump and playing with code snippets in godbolt.org. Using scripts/bloat-o-meter shows the code size is reduced with 24 bytes for xdp_convert_buff_to_frame() that gets inlined e.g. in i40e_xmit_xdp_tx_ring() which were used for microbenchmarking. Microbenchmarking results do show improvements, but very small and varying between 0.5 to 2 nanosec improvement per packet. The member @metasize is changed from u8 to u32. Future users of this area could split this into two u16 fields. I've also benchmarked with two u16 fields showing equal performance gains and code size reduction. The moved member @frame_sz doesn't change sizeof struct due to existing padding. Like xdp_buff member @frame_sz is placed next to @flags, which allows compiler to optimize assignment of these. Signed-off-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/166393728005.2213882.4162674859542409548.stgit@firesoul Signed-off-by: Jakub Kicinski commit 4991931223e3b909aa4931face285e4658927824 Merge: bb65131bb62ca 162d52dfee445 Author: Jakub Kicinski Date: Mon Sep 26 13:22:03 2022 -0700 Merge branch 'improve-tsn_lib-selftests-for-future-distributed-tasks' Vladimir Oltean says: ==================== Improve tsn_lib selftests for future distributed tasks Some of the boards I am working with are limited in the number of ports that they offer, and as more TSN related selftests are added, it is important to be able to distribute the work among multiple boards. A large part of implementing that is ensuring network-wide synchronization, but also permitting more streams of data to flow through the network. There is the more important aspect of also coordinating the timing characteristics of those streams, and that is also something that is tackled, although not in this modest patch set. The goal here is not to introduce new selftests yet, but just to lay a better foundation for them. These patches are a part of the cleanup work I've done while working on selftests for frame preemption. They are regression-tested with psfp.sh. ==================== Link: https://lore.kernel.org/r/20220923210016.3406301-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 162d52dfee445c21d1fa5c4b1f55765946df4d3e Author: Vladimir Oltean Date: Sat Sep 24 00:00:15 2022 +0300 selftests: net: tsn_lib: run phc2sys in automatic mode We can make the phc2sys helper not only synchronize a PHC to CLOCK_REALTIME, which is what it currently does, but also CLOCK_REALTIME to a PHC, which is going to be needed in distributed TSN tests. Instead of making the complexity of the arguments passed to phc2sys_start() explode, we can let it figure out the sync direction automatically, based on ptp4l's port states. Towards that goal, pass just the path to the desired ptp4l instance's UNIX domain socket, and remove the $if_name argument (from which it derives the PHC). Also adapt the one caller from the ocelot psfp.sh test. In the case of psfp.sh, phc2sys_start is able to properly figure out that CLOCK_REALTIME is the source clock and swp1's PHC is the destination, because of the way in which ptp4l_start for the UDS_ADDRESS_SWP1 was called: with slave_only=false, so it will always win the BMCA and always become the sync master between itself and $h1. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit a7ce95ac837d9e74a66e5a2825595476722bb616 Author: Vladimir Oltean Date: Sat Sep 24 00:00:14 2022 +0300 selftests: net: tsn_lib: allow multiple isochron receivers Move the PID variable for the isochron receiver into a separate namespace per stats port, to allow multiple receivers (and/or orchestration daemons) to be instantiated by the same script. Preserve the existing behavior by making isochron_do() use the default stats TCP port of 5000. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit 7ff9396ee82c84ad18b897f70e4486c9ad1693f8 Author: Vladimir Oltean Date: Sat Sep 24 00:00:13 2022 +0300 selftests: net: tsn_lib: allow running ptp4l on multiple interfaces Switch ports will want to act as Boundary Clocks, which are configured using ptp4l by specifying the "-i" argument multiple times. Since we track a log file and a pid file for each ptp4l instance, and we want to be compatible with the existing single-port callers of ptp4l_start and ptp4l_stop, pass the interface list as a single string of space-separated values. Based on this, we create a label for each ptp4l instance, where the spaces are replaced with underscores (ptp4l_start "eth0 eth1" generates "ptp4l_pid_eth0_eth1"). Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit 7d45b5fd27b4ca53c19dba79d9d4936d6cb0f0ca Author: Vladimir Oltean Date: Sat Sep 24 00:00:12 2022 +0300 selftests: net: tsn_lib: don't overwrite isochron receiver extra args with UDS The extra_args argument ($3) of isochron_recv_start is overwritten with uds ($2), if that argument exists. This is currently not a problem, because the only TSN selftest (ocelot/psfp.sh) omits remote sync so it does not specify to the receiver a UNIX domain socket for ptp4l. So $uds is currently an empty string. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit 6d751329e761338faa9c24c2c9736f27bc54282b Merge: 088b8aa537c2c 59298997df89e Author: Andrew Morton Date: Mon Sep 26 13:13:15 2022 -0700 Merge branch 'mm-hotfixes-stable' into mm-stable commit 99ee9317a1305cd5626736785c8cb38b0e47686c Author: Nico Pache Date: Mon Sep 19 08:49:32 2022 -0600 tracing/osnoise: Fix possible recursive locking in stop_per_cpu_kthreads There is a recursive lock on the cpu_hotplug_lock. In kernel/trace/trace_osnoise.c:_per_cpu_kthreads: - start_per_cpu_kthreads calls cpus_read_lock() and if start_kthreads returns a error it will call stop_per_cpu_kthreads. - stop_per_cpu_kthreads then calls cpus_read_lock() again causing deadlock. Fix this by calling cpus_read_unlock() before calling stop_per_cpu_kthreads. This behavior can also be seen in commit f46b16520a08 ("trace/hwlat: Implement the per-cpu mode"). This error was noticed during the LTP ftrace-stress-test: WARNING: possible recursive locking detected -------------------------------------------- sh/275006 is trying to acquire lock: ffffffffb02f5400 (cpu_hotplug_lock){++++}-{0:0}, at: stop_per_cpu_kthreads but task is already holding lock: ffffffffb02f5400 (cpu_hotplug_lock){++++}-{0:0}, at: start_per_cpu_kthreads other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(cpu_hotplug_lock); lock(cpu_hotplug_lock); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by sh/275006: #0: ffff8881023f0470 (sb_writers#24){.+.+}-{0:0}, at: ksys_write #1: ffffffffb084f430 (trace_types_lock){+.+.}-{3:3}, at: rb_simple_write #2: ffffffffb02f5400 (cpu_hotplug_lock){++++}-{0:0}, at: start_per_cpu_kthreads Link: https://lkml.kernel.org/r/20220919144932.3064014-1-npache@redhat.com Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations") Signed-off-by: Nico Pache Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit d8ef45d66c01425ff748e13ef7dd1da7a91cc93c Author: Yipeng Zou Date: Mon Sep 19 20:56:29 2022 +0800 tracing: kprobe: Make gen test module work in arm and riscv For now, this selftest module can only work in x86 because of the kprobe cmd was fixed use of x86 registers. This patch adapted to register names under arm and riscv, So that this module can be worked on those platform. Link: https://lkml.kernel.org/r/20220919125629.238242-3-zouyipeng@huawei.com Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module") Signed-off-by: Yipeng Zou Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit ac48e189527fae87253ef2bf58892e782fb36874 Author: Yipeng Zou Date: Mon Sep 19 20:56:28 2022 +0800 tracing: kprobe: Fix kprobe event gen test module on exit Correct gen_kretprobe_test clr event para on module exit. This will make it can't to delete. Link: https://lkml.kernel.org/r/20220919125629.238242-2-zouyipeng@huawei.com Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Fixes: 64836248dda2 ("tracing: Add kprobe event command generation test module") Signed-off-by: Yipeng Zou Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit bb65131bb62cac309596a8825f80e1914080c776 Author: Yang Yingliang Date: Thu Sep 22 15:04:38 2022 +0800 net: ethernet: adin1110: Add missing MODULE_DEVICE_TABLE This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220922070438.586692-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 1bba1998bfd71f003786103dae35145f13ab7ca6 Author: Wei Yongjun Date: Thu Sep 22 06:57:17 2022 +0000 net: vertexcom: mse102x: Silence no spi_device_id warnings SPI devices use the spi_device_id for module autoloading even on systems using device tree, after commit 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible"), kernel warns as follows since the spi_device_id is missing: SPI driver mse102x has no spi_device_id for vertexcom,mse1021 SPI driver mse102x has no spi_device_id for vertexcom,mse1022 Add spi_device_id entries to silence the warnings, and ensure driver module autoloading works. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220922065717.1448498-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit 9f1e337851bed60fef8fbea2726a8cd976120c26 Author: Wei Yongjun Date: Thu Sep 22 02:10:23 2022 +0000 net: ethernet: adi: Fix return value check in adin1110_probe_netdevs() In case of error, the function get_phy_device() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220922021023.811581-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski commit 01bcfc1a166f596e61c1f99f9ef294803eec77f4 Merge: fc4f2fd02a1af db45c76bada3e Author: Jakub Kicinski Date: Mon Sep 26 12:41:12 2022 -0700 Merge branch 'net-dsa-microchip-ksz9477-enable-interrupt-for-internal-phy-link-detection' Arun Ramadoss says: ==================== net: dsa: microchip: ksz9477: enable interrupt for internal phy link detection This patch series implements the common interrupt handling for ksz9477 based switches and lan937x. The ksz9477 and lan937x has similar interrupt registers except ksz9477 has 4 port based interrupts whereas lan937x has 6 interrupts. The patch moves the phy interrupt hanler implemented in lan937x_main.c to ksz_common.c, along with the mdio_register functionality. ==================== Link: https://lore.kernel.org/r/20220922071028.18012-1-arun.ramadoss@microchip.com Signed-off-by: Jakub Kicinski commit db45c76bada3e4fa6f56fa8acda813c19e85e946 Author: Arun Ramadoss Date: Thu Sep 22 12:40:28 2022 +0530 net: phy: micrel: enable interrupt for ksz9477 phy Config_intr and handle_interrupt are enabled for ksz9477 phy. It is similar to all other phys in the micrel phys. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit e1add7dd6183b9d4184847c310f8dd9f1a2ba7a4 Author: Arun Ramadoss Date: Thu Sep 22 12:40:27 2022 +0530 net: dsa: microchip: use common irq routines for girq and pirq The global port interrupt routines and individual ports interrupt routines has similar implementation except the mask & status register and number of nested irqs in them. The mask & status register and pointer to ksz_device is added to ksz_irq and uses the ksz_irq as irq_chip_data. Signed-off-by: Arun Ramadoss Signed-off-by: Jakub Kicinski commit ff319a644829427ebe599185d05db308389f7d72 Author: Arun Ramadoss Date: Thu Sep 22 12:40:26 2022 +0530 net: dsa: microchip: move interrupt handling logic from lan937x to ksz_common To support the phy link detection through interrupt method for ksz9477 based switch, the interrupt handling routines are moved from lan937x_main.c to ksz_common.c. The only changes made are functions names are prefixed with ksz_ instead of lan937x_. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 68ccceaef0b46935e805f4c1cfd20b6af0e6fc77 Author: Arun Ramadoss Date: Thu Sep 22 12:40:25 2022 +0530 net: dsa: microchip: lan937x: return zero if mdio node not present Currently, if the mdio node is not present in the dts file then lan937x_mdio_register return -ENODEV and entire probing process fails. To make the mdio_register generic for all ksz series switches and to maintain back-compatibility with existing dts file, return -ENODEV is replaced with return 0. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit abc1cb8cbd7376a2f856e64986ee5ce0849d974b Author: Arun Ramadoss Date: Thu Sep 22 12:40:24 2022 +0530 net: dsa: microchip: enable phy interrupts only if interrupt enabled in dts In the lan937x_mdio_register function, phy interrupts are enabled irrespective of irq is enabled in the switch. Now, the check is added to enable the phy interrupt only if the irq is enabled in the switch. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 978f1f72460cb2dc742a35bae4de50b6b9ac653f Author: Arun Ramadoss Date: Thu Sep 22 12:40:23 2022 +0530 net: dsa: microchip: determine number of port irq based on switch type Currently the number of port irqs is hard coded for the lan937x switch as 6. In order to make the generic interrupt handler for ksz switches, number of port irq supported by the switch is added to the ksz_chip_data. It is 4 for ksz9477, 2 for ksz9897 and 3 for ksz9567. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit fc4f2fd02a1af919f79beaf406a8ef54327ff84b Author: Vladimir Oltean Date: Fri Sep 23 17:59:21 2022 +0300 net/sched: taprio: simplify list iteration in taprio_dev_notifier() taprio_dev_notifier() subscribes to netdev state changes in order to determine whether interfaces which have a taprio root qdisc have changed their link speed, so the internal calculations can be adapted properly. The 'qdev' temporary variable serves no purpose, because we just use it only once, and can just as well use qdisc_dev(q->root) directly (or the "dev" that comes from the netdev notifier; this is because qdev is only interesting if it was the subject of the state change, _and_ its root qdisc belongs in the taprio list). The 'found' variable also doesn't really serve too much of a purpose either; we can just call taprio_set_picos_per_byte() within the loop, and exit immediately afterwards. Signed-off-by: Vladimir Oltean Reviewed-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20220923145921.3038904-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 944c417daeb63fa345fe0f754c57a5a23ca6d701 Author: Yury Norov Date: Sat Sep 17 20:07:16 2022 -0700 cpumask: add cpumask_nth_{,and,andnot} Add cpumask_nth_{,and,andnot} as wrappers around corresponding find functions, and use it in cpumask_local_spread(). Signed-off-by: Yury Norov commit 97848c10f9f8a8ce4296b149d06cab424eba05b3 Author: Yury Norov Date: Sat Sep 17 20:07:15 2022 -0700 lib/bitmap: remove bitmap_ord_to_pos Now that we have find_nth_bit(), we can drop bitmap_ord_to_pos(). Signed-off-by: Yury Norov commit e3783c805db29c8cb3e8dcc8160f6449da1100e3 Author: Yury Norov Date: Sat Sep 17 20:07:14 2022 -0700 lib/bitmap: add tests for find_nth_bit() Add functional and performance tests for find_nth_bit(). Signed-off-by: Yury Norov commit 3cea8d475327756066e2a54f0b651bb7284dd448 Author: Yury Norov Date: Sat Sep 17 20:07:13 2022 -0700 lib: add find_nth{,_and,_andnot}_bit() Kernel lacks for a function that searches for Nth bit in a bitmap. Usually people do it like this: for_each_set_bit(bit, mask, size) if (n-- == 0) return bit; We can do it more efficiently, if we: 1. find a word containing Nth bit, using hweight(); and 2. find the bit, using a helper fns(), that works similarly to __ffs() and ffz(). fns() is implemented as a simple loop. For x86_64, there's PDEP instruction to do that: ret = clz(pdep(1 << idx, num)). However, for large bitmaps the most of improvement comes from using hweight(), so I kept fns() simple. New find_nth_bit() is ~70 times faster on x86_64/kvm in find_bit benchmark: find_nth_bit: 7154190 ns, 16411 iterations for_each_bit: 505493126 ns, 16315 iterations With all that, a family of 3 new functions is added, and used where appropriate in the following patches. Signed-off-by: Yury Norov commit 24291caf8447f6fc060c8d00136bdc30ee207f38 Author: Yury Norov Date: Sat Sep 17 20:07:12 2022 -0700 lib/bitmap: add bitmap_weight_and() The function calculates Hamming weight of (bitmap1 & bitmap2). Now we have to do like this: tmp = bitmap_alloc(nbits); bitmap_and(tmp, map1, map2, nbits); weight = bitmap_weight(tmp, nbits); bitmap_free(tmp); This requires additional memory, adds pressure on alloc subsystem, and way less cache-friendly than just: weight = bitmap_weight_and(map1, map2, nbits); The following patches apply it for cpumask functions. Signed-off-by: Yury Norov commit 70a1cb106d9410f1f37e0261728e46722b74c29f Author: Yury Norov Date: Sat Sep 17 20:07:11 2022 -0700 lib/bitmap: don't call __bitmap_weight() in kernel code __bitmap_weight() is not to be used directly in the kernel code because it's a helper for bitmap_weight(). Switch everything to bitmap_weight(). Signed-off-by: Yury Norov commit 722714205cece4085706eff047bc730a908751e2 Author: Sergio Paracuellos Date: Wed Sep 21 09:24:05 2022 +0200 dt-bindings: interrupt-controller: migrate MIPS CPU interrupt controller text bindings to YAML MIPS CPU interrupt controller bindings used text format, so migrate them to YAML. Signed-off-by: Sergio Paracuellos Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921072405.610739-1-sergio.paracuellos@gmail.com Signed-off-by: Rob Herring commit e7c21940463cf02bdefb4edd38d61dd7c589bb5c Author: Sergio Paracuellos Date: Tue Sep 20 07:20:50 2022 +0200 dt-bindings: i2c: migrate mt7621 text bindings to YAML SoC MT7621 I2C bindings used text format, so migrate them to YAML. There are some additions to the binding that were not in the original txt file. This binding is used in MT7621 and MT7628a Ralink SoCs. To properly match both dts nodes in tree we need to add to the schema 'clocks', 'clock-names' and 'reset-names'. Both 'clock-names' and 'reset-names' use 'i2c' as string so maintain that as const in the schema. Also, Properly update MAINTAINERS file to align the changes. Signed-off-by: Sergio Paracuellos Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220920052050.582321-1-sergio.paracuellos@gmail.com Signed-off-by: Rob Herring commit 895ddf5ed4c54ea9e3533606d7a8b4e4f27f95ef Author: Jeff Layton Date: Mon Sep 26 14:41:02 2022 -0400 nfsd: extra checks when freeing delegation stateids We've had some reports of problems in the refcounting for delegation stateids that we've yet to track down. Add some extra checks to ensure that we've removed the object from various lists before freeing it. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2127067 Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit b95239ca4954a0d48b19c09ce7e8f31b453b4216 Author: Jeff Layton Date: Mon Sep 26 14:41:01 2022 -0400 nfsd: make nfsd4_run_cb a bool return function queue_work can return false and not queue anything, if the work is already queued. If that happens in the case of a CB_RECALL, we'll have taken an extra reference to the stid that will never be put. Ensure we throw a warning in that case. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 73ce2ac63392bbf637d2c44fbf2ee4e70765d268 Merge: 56378f3ccb833 0b81882ddf8ac Author: Jakub Kicinski Date: Mon Sep 26 11:48:18 2022 -0700 Merge branch 'remove-useless-inline-functions-from-net' Gaosheng Cui says: ==================== Remove useless inline functions from net ==================== Link: https://lore.kernel.org/r/20220922083857.1430811-1-cuigaosheng1@huawei.com Signed-off-by: Jakub Kicinski commit 0b81882ddf8ac2743f657afb001beec7fc3929af Author: Gaosheng Cui Date: Thu Sep 22 16:38:57 2022 +0800 net: Remove unused inline function dst_hold_and_use() All uses of dst_hold_and_use() have been removed since commit 1202cdd66531 ("Remove DECnet support from kernel"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Jakub Kicinski commit d6755f37abfd009e7ca3520c319c93d14cae54b3 Author: Gaosheng Cui Date: Thu Sep 22 16:38:56 2022 +0800 net: Remove unused inline function sk_nulls_node_init() All uses of sk_nulls_node_init() have been removed since commit dbca1596bbb0 ("ping: convert to RCU lookups, get rid of rwlock"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Jakub Kicinski commit c8f01a4a54473f88f8cc0d9046ec9eb5a99815d5 Author: Gaosheng Cui Date: Thu Sep 22 16:38:55 2022 +0800 neighbour: Remove unused inline function neigh_key_eq16() All uses of neigh_key_eq16() have been removed since commit 1202cdd66531 ("Remove DECnet support from kernel"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Jakub Kicinski commit a9c3abf4e5765568c4d4567388230d746286c52e Author: Gaosheng Cui Date: Thu Sep 22 16:38:54 2022 +0800 mlxsw: reg: Remove deprecated code about SFTR-V2 Register Remove all the code about SFTR-V2 Register which have been deprecated since commit 77b7f83d5c25 ("mlxsw: Enable unified bridge model"). Signed-off-by: Gaosheng Cui Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 6d83bcf7826bef0e08165a692a1c2ed569840e78 Author: Peng Fan Date: Fri Sep 23 15:54:27 2022 +0800 dt-bindings: power: gpcv2: correct patternProperties i.MX8MQ has pgc 'power-domain@a', so correct patternProperties Signed-off-by: Peng Fan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220923075427.985504-1-peng.fan@oss.nxp.com Signed-off-by: Rob Herring commit 803184f1ef815b39ec266ff25a0e7f00760e2e69 Author: Jean-Philippe Brucker Date: Fri Sep 23 08:44:38 2022 +0100 dt-bindings: virtio: Convert virtio,pci-iommu to DT schema Convert the binding that describes the virtio-pci based IOMMU to DT schema. Change the compatible string to "pci,", which is defined by the PCI Bus Binding, but keep "virtio,pci-iommu" as an option for backward compatibility. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220923074435.420531-1-jean-philippe@linaro.org Signed-off-by: Rob Herring commit 8c86f29bfb18465d15b05cfd26a6454ec787b793 Author: Bill Wendling Date: Fri Sep 2 21:37:50 2022 +0000 x86/paravirt: add extra clobbers with ZERO_CALL_USED_REGS enabled The ZERO_CALL_USED_REGS feature may zero out caller-saved registers before returning. In spurious_kernel_fault(), the "pte_offset_kernel()" call results in this assembly code: .Ltmp151: #APP # ALT: oldnstr .Ltmp152: .Ltmp153: .Ltmp154: .section .discard.retpoline_safe,"",@progbits .quad .Ltmp154 .text callq *pv_ops+536(%rip) .Ltmp155: .section .parainstructions,"a",@progbits .p2align 3, 0x0 .quad .Ltmp153 .byte 67 .byte .Ltmp155-.Ltmp153 .short 1 .text .Ltmp156: # ALT: padding .zero (-(((.Ltmp157-.Ltmp158)-(.Ltmp156-.Ltmp152))>0))*((.Ltmp157-.Ltmp158)-(.Ltmp156-.Ltmp152)),144 .Ltmp159: .section .altinstructions,"a",@progbits .Ltmp160: .long .Ltmp152-.Ltmp160 .Ltmp161: .long .Ltmp158-.Ltmp161 .short 33040 .byte .Ltmp159-.Ltmp152 .byte .Ltmp157-.Ltmp158 .text .section .altinstr_replacement,"ax",@progbits # ALT: replacement 1 .Ltmp158: movq %rdi, %rax .Ltmp157: .text #NO_APP .Ltmp162: testb $-128, %dil The "testb" here is using %dil, but the %rdi register was cleared before returning from "callq *pv_ops+536(%rip)". Adding the proper constraints results in the use of a different register: movq %r11, %rdi # Similar to above. testb $-128, %r11b Link: https://github.com/KSPP/linux/issues/192 Signed-off-by: Bill Wendling Reported-and-tested-by: Nathan Chancellor Fixes: 035f7f87b729 ("randstruct: Enable Clang support") Reviewed-by: Juergen Gross Link: https://lore.kernel.org/lkml/fa6df43b-8a1a-8ad1-0236-94d2a0b588fa@suse.com/ Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220902213750.1124421-3-morbo@google.com commit 90c46d12ba524257ed11404e336211c71d523366 Author: Jean-Philippe Brucker Date: Thu Sep 22 17:11:50 2022 +0100 dt-bindings: timer: arm,arch_timer: Allow dual compatible string Since the Armv7 and Armv8 architected timers are compatible, it is valid to expose a devicetree node with compatible string "arm,armv8-timer" followed by "arm,armv7-timer". For example a 32-bit guest running on a 64-bit machine may look for the v7 string even though the hardware is v8. VMMs such as QEMU and kvmtool have been using this compatible string for some time. Clean up the compatible list a little and add the dual option. Acked-by: Krzysztof Kozlowski Signed-off-by: Jean-Philippe Brucker Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220922161149.371565-1-jean-philippe@linaro.org Signed-off-by: Rob Herring commit f67b90be20097294cd58b7db91435f4f3278d75f Author: Bill Wendling Date: Fri Sep 2 21:37:49 2022 +0000 x86/paravirt: clean up typos and grammaros Drive-by clean up of the comment. [ Impact: cleanup] Signed-off-by: Bill Wendling Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220902213750.1124421-2-morbo@google.com commit 56378f3ccb83328b9ea6e4c1bccd4ea6055763ab Author: Vladimir Oltean Date: Wed Sep 21 21:54:28 2022 +0300 net: dsa: make user ports return to init_net on netns deletion As pointed out during review, currently the following set of commands crashes the kernel: $ ip netns add ns0 $ ip link set swp0 netns ns0 $ ip netns del ns0 WARNING: CPU: 1 PID: 27 at net/core/dev.c:10884 unregister_netdevice_many+0xaa4/0xaec Workqueue: netns cleanup_net pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : unregister_netdevice_many+0xaa4/0xaec lr : unregister_netdevice_many+0x700/0xaec Call trace: unregister_netdevice_many+0xaa4/0xaec default_device_exit_batch+0x294/0x340 ops_exit_list+0xac/0xc4 cleanup_net+0x2e4/0x544 process_one_work+0x4ec/0xb40 ---[ end trace 0000000000000000 ]--- unregister_netdevice: waiting for swp0 to become free. Usage count = 2 This is because since DSA user ports, since they started populating dev->rtnl_link_ops in the blamed commit, gained a different treatment from default_device_exit_net(), which thinks these interfaces can now be unregistered. They can't; so set netns_refund = true to restore the behavior prior to populating dev->rtnl_link_ops. Fixes: 95f510d0b792 ("net: dsa: allow the DSA master to be seen and changed through rtnetlink") Suggested-by: Jakub Kicinski Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220921185428.1767001-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit fb33ec016b8710281343ce73bec92bfe54bad4fa Author: Jesper Dangaard Brouer Date: Wed Sep 21 19:05:32 2022 +0200 xdp: improve page_pool xdp_return performance During LPC2022 I meetup with my page_pool co-maintainer Ilias. When discussing page_pool code we realised/remembered certain optimizations had not been fully utilised. Since commit c07aea3ef4d4 ("mm: add a signature in struct page") struct page have a direct pointer to the page_pool object this page was allocated from. Thus, with this info it is possible to skip the rhashtable_lookup to find the page_pool object in __xdp_return(). The rcu_read_lock can be removed as it was tied to xdp_mem_allocator. The page_pool object is still safe to access as it tracks inflight pages and (potentially) schedules final release from a work queue. Created a micro benchmark of XDP redirecting from mlx5 into veth with XDP_DROP bpf-prog on the peer veth device. This increased performance 6.5% from approx 8.45Mpps to 9Mpps corresponding to using 7 nanosec (27 cycles at 3.8GHz) less per packet. Suggested-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Acked-by: Toke Høiland-Jørgensen Reviewed-by: Ilias Apalodimas Link: https://lore.kernel.org/r/166377993287.1737053.10258297257583703949.stgit@firesoul Signed-off-by: Jakub Kicinski commit c931b060f0939efc2e4c0eeaa5ae8268a7c5c22c Author: Anand Moon Date: Tue Sep 20 14:09:41 2022 +0000 net: ethernet: stmicro: stmmac: dwmac-rk: Add rv1126 support Rockchip RV1126 has GMAC 10/100/1000M ethernet controller via RGMII and RMII interfaces are configured via M0 and M1 pinmux. This patch adds rv1126 support by adding delay lines of M0 and M1 simultaneously. Signed-off-by: Sugar Zhang Signed-off-by: David Wu Signed-off-by: Anand Moon Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220920140944.2535-2-anand@edgeble.ai Signed-off-by: Jakub Kicinski commit b36fe2f436623afda98756828264cf18cb3c105d Author: Anand Moon Date: Tue Sep 20 14:09:40 2022 +0000 dt-bindings: net: rockchip-dwmac: add rv1126 compatible Add compatible string for RV1126 gmac, and constrain it to be compatible with Synopsys dwmac 4.20a. Reviewed-by: Heiko Stuebner Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Signed-off-by: Anand Moon Link: https://lore.kernel.org/r/20220920140944.2535-1-anand@edgeble.ai Signed-off-by: Jakub Kicinski commit 25fbe1fca14142beae6c882f7906510363d42bff Author: Jeff Layton Date: Mon Sep 26 12:38:45 2022 -0400 nfsd: fix comments about spinlock handling with delegations Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 4d01416ab41540bb13ec4a39ac4e6c4aa5934bc9 Author: Jeff Layton Date: Mon Sep 26 12:38:44 2022 -0400 nfsd: only fill out return pointer on success in nfsd4_lookup_stateid In the case of a revoked delegation, we still fill out the pointer even when returning an error, which is bad form. Only overwrite the pointer on success. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 019805fea91599b22dfa62ffb29c022f35abeb06 Author: Dai Ngo Date: Mon Sep 26 10:59:16 2022 -0700 NFSD: fix use-after-free on source server when doing inter-server copy Use-after-free occurred when the laundromat tried to free expired cpntf_state entry on the s2s_cp_stateids list after inter-server copy completed. The sc_cp_list that the expired copy state was inserted on was already freed. When COPY completes, the Linux client normally sends LOCKU(lock_state x), FREE_STATEID(lock_state x) and CLOSE(open_state y) to the source server. The nfs4_put_stid call from nfsd4_free_stateid cleans up the copy state from the s2s_cp_stateids list before freeing the lock state's stid. However, sometimes the CLOSE was sent before the FREE_STATEID request. When this happens, the nfsd4_close_open_stateid call from nfsd4_close frees all lock states on its st_locks list without cleaning up the copy state on the sc_cp_list list. When the time the FREE_STATEID arrives the server returns BAD_STATEID since the lock state was freed. This causes the use-after-free error to occur when the laundromat tries to free the expired cpntf_state. This patch adds a call to nfs4_free_cpntf_statelist in nfsd4_close_open_stateid to clean up the copy state before calling free_ol_stateid_reaplist to free the lock state's stid on the reaplist. Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 76ce4dcec0dc08a032db916841ddc4e3998be317 Author: Chuck Lever Date: Thu Sep 1 15:29:55 2022 -0400 NFSD: Cap rsize_bop result based on send buffer size Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply at the same time. Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large. Add an NFSv4 helper that computes the size of the send buffer. It replaces svc_max_payload() in spots where svc_max_payload() returns a value that might be larger than the remaining send buffer space. Callers who need to know the transport's actual maximum payload size will continue to use svc_max_payload(). Signed-off-by: Chuck Lever commit 781fde1a2ba2391f31142f46f964cf1148ca1791 Author: Chuck Lever Date: Thu Sep 22 13:10:35 2022 -0400 NFSD: Rename the fields in copy_stateid_t Code maintenance: The name of the copy_stateid_t::sc_count field collides with the sc_count field in struct nfs4_stid, making the latter difficult to grep for when auditing stateid reference counting. No behavior change expected. Signed-off-by: Chuck Lever commit 1342f9dd3fc219089deeb2620f6790f19b4129b1 Author: ChenXiaoSong Date: Fri Sep 23 00:31:56 2022 +0800 nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_file_cache_stats_fops Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: ChenXiaoSong Signed-off-by: Chuck Lever commit 64776611a06322b99386f8dfe3b3ba1aa0347a38 Author: ChenXiaoSong Date: Fri Sep 23 00:31:55 2022 +0800 nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. nfsd_net is converted from seq_file->file instead of seq_file->private in nfsd_reply_cache_stats_show(). Signed-off-by: ChenXiaoSong [ cel: reduce line length ] Signed-off-by: Chuck Lever commit 1d7f6b302b75ff7acb9eb3cab0c631b10cfa7542 Author: ChenXiaoSong Date: Fri Sep 23 00:31:54 2022 +0800 nfsd: use DEFINE_SHOW_ATTRIBUTE to define client_info_fops Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. inode is converted from seq_file->file instead of seq_file->private in client_info_show(). Signed-off-by: ChenXiaoSong Signed-off-by: Chuck Lever commit 9beeaab8e05d353d709103cafa1941714b4d5d94 Author: ChenXiaoSong Date: Fri Sep 23 00:31:53 2022 +0800 nfsd: use DEFINE_SHOW_ATTRIBUTE to define export_features_fops and supported_enctypes_fops Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: ChenXiaoSong [ cel: reduce line length ] Signed-off-by: Chuck Lever commit 0cfb0c4228a5c8e2ed2b58f8309b660b187cef02 Author: ChenXiaoSong Date: Fri Sep 23 00:31:52 2022 +0800 nfsd: use DEFINE_PROC_SHOW_ATTRIBUTE to define nfsd_proc_ops Use DEFINE_PROC_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: ChenXiaoSong Signed-off-by: Chuck Lever commit 9f553e61bd36c1048543ac2f6945103dd2f742be Author: Chuck Lever Date: Mon Sep 12 17:23:36 2022 -0400 NFSD: Pack struct nfsd4_compoundres Remove a couple of 4-byte holes on platforms with 64-bit pointers. Signed-off-by: Chuck Lever commit 77e378cf2a595d8e39cddf28a31efe6afd9394a0 Author: Chuck Lever Date: Mon Sep 12 17:23:30 2022 -0400 NFSD: Remove unused nfsd4_compoundargs::cachetype field This field was added by commit 1091006c5eb1 ("nfsd: turn on reply cache for NFSv4") but was never put to use. Signed-off-by: Chuck Lever commit 6604148cf961b57fc735e4204f8996536da9253c Author: Chuck Lever Date: Mon Sep 12 17:23:25 2022 -0400 NFSD: Remove "inline" directives on op_rsize_bop helpers These helpers are always invoked indirectly, so the compiler can't inline these anyway. While we're updating the synopses of these helpers, defensively convert their parameters to const pointers. Signed-off-by: Chuck Lever commit 9993a66317fc9951322483a9edbfae95a640b210 Author: Chuck Lever Date: Mon Sep 12 17:23:19 2022 -0400 NFSD: Clean up nfs4svc_encode_compoundres() In today's Linux NFS server implementation, the NFS dispatcher initializes each XDR result stream, and the NFSv4 .pc_func and .pc_encode methods all use xdr_stream-based encoding. This keeps rq_res.len automatically updated. There is no longer a need for the WARN_ON_ONCE() check in nfs4svc_encode_compoundres(). Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b8ab2a6f2d67a7f7b03a92348e3f29c1c767a9ca Author: Chuck Lever Date: Mon Sep 12 17:23:13 2022 -0400 SUNRPC: Fix typo in xdr_buf_subsegment's kdoc comment Fix a typo. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d4da5baa533215b14625458e645056baf646bb2e Author: Chuck Lever Date: Mon Sep 12 17:23:07 2022 -0400 NFSD: Clean up WRITE arg decoders xdr_stream_subsegment() already returns a boolean value. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c3d2a04f05c590303c125a176e6e43df4a436fdb Author: Chuck Lever Date: Mon Sep 12 17:23:02 2022 -0400 NFSD: Use xdr_inline_decode() to decode NFSv3 symlinks Replace the check for buffer over/underflow with a helper that is commonly used for this purpose. The helper also sets xdr->nwords correctly after successfully linearizing the symlink argument into the stream's scratch buffer. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 98124f5bd6c76699d514fbe491dd95265369cc99 Author: Chuck Lever Date: Mon Sep 12 17:22:56 2022 -0400 NFSD: Refactor common code out of dirlist helpers The dust has settled a bit and it's become obvious what code is totally common between nfsd_init_dirlist_pages() and nfsd3_init_dirlist_pages(). Move that common code to SUNRPC. The new helper brackets the existing xdr_init_decode_pages() API. Signed-off-by: Chuck Lever commit f18d8afbf2fae507fb7246f09fe1de5297c9f11a Author: Chuck Lever Date: Mon Sep 12 17:22:50 2022 -0400 SUNRPC: Clarify comment that documents svc_max_payload() Note the function returns a per-transport value, not a per-request value (eg, one that is related to the size of the available send or receive buffer space). Signed-off-by: Chuck Lever commit 3fdc546462348b8a497c72bc894e0cde9f10fc40 Author: Chuck Lever Date: Mon Sep 12 17:22:44 2022 -0400 NFSD: Reduce amount of struct nfsd4_compoundargs that needs clearing Have SunRPC clear everything except for the iops array. Then have each NFSv4 XDR decoder clear it's own argument before decoding. Now individual operations may have a large argument struct while not penalizing the vast majority of operations with a small struct. And, clearing the argument structure occurs as the argument fields are initialized, enabling the CPU to do write combining on that memory. In some cases, clearing is not even necessary because all of the fields in the argument structure are initialized by the decoder. Signed-off-by: Chuck Lever commit 103cc1fafee48adb91fca0e19deb869fd23e46ab Author: Chuck Lever Date: Mon Sep 12 17:22:38 2022 -0400 SUNRPC: Parametrize how much of argsize should be zeroed Currently, SUNRPC clears the whole of .pc_argsize before processing each incoming RPC transaction. Add an extra parameter to struct svc_procedure to enable upper layers to reduce the amount of each operation's argument structure that is zeroed by SUNRPC. The size of struct nfsd4_compoundargs, in particular, is a lot to clear on each incoming RPC Call. A subsequent patch will cut this down to something closer to what NFSv2 and NFSv3 uses. This patch should cause no behavior changes. Signed-off-by: Chuck Lever commit 81593c4dff32266102cd95cdc993576a6afe5650 Author: Chuck Lever Date: Mon Sep 12 17:22:33 2022 -0400 SUNRPC: Optimize svc_process() Move exception handling code out of the hot path, and avoid the need for a bswap of a non-constant. Signed-off-by: Chuck Lever commit 7746b32f467b3813fb61faaab3258de35806a7ac Author: Dai Ngo Date: Wed Sep 14 08:54:26 2022 -0700 NFSD: add shrinker to reap courtesy clients on low memory condition Add courtesy_client_reaper to react to low memory condition triggered by the system memory shrinker. The delayed_work for the courtesy_client_reaper is scheduled on the shrinker's count callback using the laundry_wq. The shrinker's scan callback is not used for expiring the courtesy clients due to potential deadlocks. Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 3a4ea23d86a317c4b68b9a69d51f7e84e1e04357 Author: Dai Ngo Date: Wed Sep 14 08:54:25 2022 -0700 NFSD: keep track of the number of courtesy clients in the system Add counter nfs4_courtesy_client_count to nfsd_net to keep track of the number of courtesy clients in the system. Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 06981d560606ac48d61e5f4fff6738b925c93173 Author: Anna Schumaker Date: Tue Sep 13 14:01:50 2022 -0400 NFSD: Return nfserr_serverfault if splice_ok but buf->pages have data This was discussed with Chuck as part of this patch set. Returning nfserr_resource was decided to not be the best error message here, and he suggested changing to nfserr_serverfault instead. Signed-off-by: Anna Schumaker Link: https://lore.kernel.org/linux-nfs/20220907195259.926736-1-anna@kernel.org/T/#t Signed-off-by: Chuck Lever commit 5f5f8b6d655fd947e899b1771c2f7cb581a06764 Author: Chuck Lever Date: Thu Sep 8 18:14:25 2022 -0400 NFSD: Make nfsd4_remove() wait before returning NFS4ERR_DELAY nfsd_unlink() can kick off a CB_RECALL (via vfs_unlink() -> leases_conflict()) if a delegation is present. Before returning NFS4ERR_DELAY, give the client holding that delegation a chance to return it and then retry the nfsd_unlink() again, once. Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=354 Tested-by: Igor Mammedov Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 68c522afd0b1936b48a03a4c8b81261e7597c62d Author: Chuck Lever Date: Thu Sep 8 18:14:19 2022 -0400 NFSD: Make nfsd4_rename() wait before returning NFS4ERR_DELAY nfsd_rename() can kick off a CB_RECALL (via vfs_rename() -> leases_conflict()) if a delegation is present. Before returning NFS4ERR_DELAY, give the client holding that delegation a chance to return it and then retry the nfsd_rename() again, once. This version of the patch handles renaming an existing file, but does not deal with renaming onto an existing file. That case will still always trigger an NFS4ERR_DELAY. Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=354 Tested-by: Igor Mammedov Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 34b91dda7124fc3259e4b2ae53e0c933dedfec01 Author: Chuck Lever Date: Thu Sep 8 18:14:13 2022 -0400 NFSD: Make nfsd4_setattr() wait before returning NFS4ERR_DELAY nfsd_setattr() can kick off a CB_RECALL (via notify_change() -> break_lease()) if a delegation is present. Before returning NFS4ERR_DELAY, give the client holding that delegation a chance to return it and then retry the nfsd_setattr() again, once. Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=354 Tested-by: Igor Mammedov Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit c0aa1913db57219e91a0a8832363cbafb3a9cf8f Author: Chuck Lever Date: Thu Sep 8 18:14:07 2022 -0400 NFSD: Refactor nfsd_setattr() Move code that will be retried (in a subsequent patch) into a helper function. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit c035362eb935fe9381d9d1cc453bc2a37460e24c Author: Chuck Lever Date: Thu Sep 8 18:14:00 2022 -0400 NFSD: Add a mechanism to wait for a DELEGRETURN Subsequent patches will use this mechanism to wake up an operation that is waiting for a client to return a delegation. The new tracepoint records whether the wait timed out or was properly awoken by the expected DELEGRETURN: nfsd-1155 [002] 83799.493199: nfsd_delegret_wakeup: xid=0x14b7d6ef fh_hash=0xf6826792 (timed out) Suggested-by: Jeff Layton Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 1035d65446a018ca2dd179e29a2fcd6d29057781 Author: Chuck Lever Date: Thu Sep 8 18:13:54 2022 -0400 NFSD: Add tracepoints to report NFSv4 callback completions Wireshark has always been lousy about dissecting NFSv4 callbacks, especially NFSv4.0 backchannel requests. Add tracepoints so we can surgically capture these events in the trace log. Tracepoints are time-stamped and ordered so that we can now observe the timing relationship between a CB_RECALL Reply and the client's DELEGRETURN Call. Example: nfsd-1153 [002] 211.986391: nfsd_cb_recall: addr=192.168.1.67:45767 client 62ea82e4:fee7492a stateid 00000003:00000001 nfsd-1153 [002] 212.095634: nfsd_compound: xid=0x0000002c opcnt=2 nfsd-1153 [002] 212.095647: nfsd_compound_status: op=1/2 OP_PUTFH status=0 nfsd-1153 [002] 212.095658: nfsd_file_put: hash=0xf72 inode=0xffff9291148c7410 ref=3 flags=HASHED|REFERENCED may=READ file=0xffff929103b3ea00 nfsd-1153 [002] 212.095661: nfsd_compound_status: op=2/2 OP_DELEGRETURN status=0 kworker/u25:8-148 [002] 212.096713: nfsd_cb_recall_done: client 62ea82e4:fee7492a stateid 00000003:00000001 status=0 Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit de29cf7e6cbbe236c3a51999c188fcd467762899 Author: Chuck Lever Date: Thu Sep 8 18:13:48 2022 -0400 NFSD: Trace NFSv4 COMPOUND tags The Linux NFSv4 client implementation does not use COMPOUND tags, but the Solaris and MacOS implementations do, and so does pynfs. Record these eye-catchers in the server's trace buffer to annotate client requests while troubleshooting. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 948755efc951de75c87d4fa916d9d36b58299295 Author: Chuck Lever Date: Thu Sep 8 18:13:42 2022 -0400 NFSD: Replace dprintk() call site in fh_verify() Record permission errors in the trace log. Note that the new trace event is conditional, so it will only record non-zero return values from nfsd_permission(). Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 18224dc58d960c65446971930d0487fc72d00598 Author: Gaosheng Cui Date: Fri Sep 9 14:59:10 2022 +0800 nfsd: remove nfsd4_prepare_cb_recall() declaration nfsd4_prepare_cb_recall() has been removed since commit 0162ac2b978e ("nfsd: introduce nfsd4_callback_ops"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Chuck Lever commit 6106d9119b6599fa23dc556b429d887b4c2d9f62 Author: Jeff Layton Date: Thu Sep 8 12:31:07 2022 -0400 nfsd: clean up mounted_on_fileid handling We only need the inode number for this, not a full rack of attributes. Rename this function make it take a pointer to a u64 instead of struct kstat, and change it to just request STATX_INO. Signed-off-by: Jeff Layton [ cel: renamed get_mounted_on_ino() ] Signed-off-by: Chuck Lever commit 7518a3dc5ea249d4112156ce71b8b184eb786151 Author: Chuck Lever Date: Mon Sep 5 15:33:32 2022 -0400 NFSD: Fix handling of oversized NFSv4 COMPOUND requests If an NFS server returns NFS4ERR_RESOURCE on the first operation in an NFSv4 COMPOUND, there's no way for a client to know where the problem is and then simplify the compound to make forward progress. So instead, make NFSD process as many operations in an oversized COMPOUND as it can and then return NFS4ERR_RESOURCE on the first operation it did not process. pynfs NFSv4.0 COMP6 exercises this case, but checks only for the COMPOUND status code, not whether the server has processed any of the operations. pynfs NFSv4.1 SEQ6 and SEQ7 exercise the NFSv4.1 case, which detects too many operations per COMPOUND by checking against the limits negotiated when the session was created. Suggested-by: Bruce Fields Fixes: 0078117c6d91 ("nfsd: return RESOURCE not GARBAGE_ARGS on too many ops") Signed-off-by: Chuck Lever commit 9558f9304ca1903090fa5d995a3269a8e82804b4 Author: NeilBrown Date: Tue Sep 6 10:42:19 2022 +1000 NFSD: drop fname and flen args from nfsd_create_locked() nfsd_create_locked() does not use the "fname" and "flen" arguments, so drop them from declaration and all callers. Signed-off-by: NeilBrown Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fa6be9cc6e80ec79892ddf08a8c10cabab9baf38 Author: Chuck Lever Date: Thu Sep 1 15:10:24 2022 -0400 NFSD: Protect against send buffer overflow in NFSv3 READ Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply at the same time. Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large. A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case. Cc: Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 401bc1f90874280a80b93f23be33a0e7e2d1f912 Author: Chuck Lever Date: Thu Sep 1 15:10:18 2022 -0400 NFSD: Protect against send buffer overflow in NFSv2 READ Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply at the same time. Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large. A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case. Cc: Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 640f87c190e0d1b2a0fcb2ecf6d2cd53b1c41991 Author: Chuck Lever Date: Thu Sep 1 15:10:12 2022 -0400 NFSD: Protect against send buffer overflow in NFSv3 READDIR Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply message at the same time. Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large. A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case. Thanks to Aleksi Illikainen and Kari Hulkko for uncovering this issue. Reported-by: Ben Ronallo Cc: Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 00b4492686e0497fdb924a9d4c8f6f99377e176c Author: Chuck Lever Date: Thu Sep 1 15:10:05 2022 -0400 NFSD: Protect against send buffer overflow in NFSv2 READDIR Restore the previous limit on the @count argument to prevent a buffer overflow attack. Fixes: 53b1119a6e50 ("NFSD: Fix READDIR buffer overflow") Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 1242a87da0d8cd2a428e96ca68e7ea899b0f4624 Author: Chuck Lever Date: Thu Sep 1 15:09:59 2022 -0400 SUNRPC: Fix svcxdr_init_encode's buflen calculation Commit 2825a7f90753 ("nfsd4: allow encoding across page boundaries") added an explicit computation of the remaining length in the rq_res XDR buffer. The computation appears to suffer from an "off-by-one" bug. Because buflen is too large by one page, XDR encoding can run off the end of the send buffer by eventually trying to use the struct page address in rq_page_end, which always contains NULL. Fixes: bddfdbcddbe2 ("NFSD: Extract the svcxdr_init_encode() helper") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 90bfc37b5ab91c1a6165e3e5cfc49bf04571b762 Author: Chuck Lever Date: Thu Sep 1 15:09:53 2022 -0400 SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation Ensure that stream-based argument decoding can't go past the actual end of the receive buffer. xdr_init_decode's calculation of the value of xdr->end over-estimates the end of the buffer because the Linux kernel RPC server code does not remove the size of the RPC header from rqstp->rq_arg before calling the upper layer's dispatcher. The server-side still uses the svc_getnl() macros to decode the RPC call header. These macros reduce the length of the head iov but do not update the total length of the message in the buffer (buf->len). A proper fix for this would be to replace the use of svc_getnl() and friends in the RPC header decoder, but that would be a large and invasive change that would be difficult to backport. Fixes: 5191955d6fc6 ("SUNRPC: Prepare for xdr_stream-style decoding on the server-side") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 80e591ce636f3ae6855a0ca26963da1fdd6d4508 Author: Chuck Lever Date: Fri Sep 2 18:18:16 2022 -0400 NFSD: Increase NFSD_MAX_OPS_PER_COMPOUND When attempting an NFSv4 mount, a Solaris NFSv4 client builds a single large COMPOUND that chains a series of LOOKUPs to get to the pseudo filesystem root directory that is to be mounted. The Linux NFS server's current maximum of 16 operations per NFSv4 COMPOUND is not large enough to ensure that this works for paths that are more than a few components deep. Since NFSD_MAX_OPS_PER_COMPOUND is mostly a sanity check, and most NFSv4 COMPOUNDS are between 3 and 6 operations (thus they do not trigger any re-allocation of the operation array on the server), increasing this maximum should result in little to no impact. The ops array can get large now, so allocate it via vmalloc() to help ensure memory fragmentation won't cause an allocation failure. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216383 Signed-off-by: Chuck Lever commit 30a30fcc3fc1ad4c5d017c9fcb75dc8f59e7bdad Author: Christophe JAILLET Date: Thu Sep 1 07:27:19 2022 +0200 nfsd: Propagate some error code returned by memdup_user() Propagate the error code returned by memdup_user() instead of a hard coded -EFAULT. Suggested-by: Dan Carpenter Signed-off-by: Christophe JAILLET Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d44899b8bb0b919f923186c616a84f0e70e04772 Author: Christophe JAILLET Date: Thu Sep 1 07:27:11 2022 +0200 nfsd: Avoid some useless tests memdup_user() can't return NULL, so there is no point for checking for it. Simplify some tests accordingly. Suggested-by: Dan Carpenter Signed-off-by: Christophe JAILLET Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fd1ef88049de09bc70d60b549992524cfc0e66ff Author: Christophe JAILLET Date: Thu Sep 1 07:27:04 2022 +0200 nfsd: Fix a memory leak in an error handling path If this memdup_user() call fails, the memory allocated in a previous call a few lines above should be freed. Otherwise it leaks. Fixes: 6ee95d1c8991 ("nfsd: add support for upcall version 2") Signed-off-by: Christophe JAILLET Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 4ab3442ca384a02abf8b1f2b3449a6c547851873 Author: Jinpeng Cui Date: Wed Aug 31 14:20:02 2022 +0000 NFSD: remove redundant variable status Return value directly from fh_verify() do_open_permission() exp_pseudoroot() instead of getting value from redundant variable status. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Chuck Lever commit 754035ff79a14886e68c0c9f6fa80adb21f12b53 Author: Olga Kornievskaia Date: Fri Aug 19 15:16:36 2022 -0400 NFSD enforce filehandle check for source file in COPY If the passed in filehandle for the source file in the COPY operation is not a regular file, the server MUST return NFS4ERR_WRONG_TYPE. Signed-off-by: Olga Kornievskaia Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 97f8e62572555f8ad578d7b1739ba64d5d2cac0f Author: Wolfram Sang Date: Thu Aug 18 23:01:16 2022 +0200 lockd: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Chuck Lever commit 72f78ae00a8e5d7abe13abac8305a300f6afd74b Author: Wolfram Sang Date: Thu Aug 18 23:01:14 2022 +0200 NFSD: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Chuck Lever commit 9f7d69c5cd23904a29178a7ecc4eee9c1cfba04b Author: Kees Cook Date: Mon Sep 19 19:50:32 2022 -0700 fortify: Convert to struct vs member helpers In preparation for adding support for __builtin_dynamic_object_size(), wrap each instance of __builtin_object_size(p, N) with either the new __struct_size(p) as __bos(p, 0), or __member_size(p) as __bos(p, 1). This will allow us to replace the definitions with __bdos() next. There are no binary differences from this change. Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: linux-hardening@vger.kernel.org Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/lkml/20220920192202.190793-4-keescook@chromium.org Signed-off-by: Kees Cook commit fa35198f39571bbdae53c5b321020021eaad6bd2 Author: Kees Cook Date: Mon Sep 19 16:33:33 2022 -0700 fortify: Explicitly check bounds are compile-time constants In preparation for replacing __builtin_object_size() with __builtin_dynamic_object_size(), all the compile-time size checks need to check that the bounds comparisons are, in fact, known at compile-time. Enforce what was guaranteed with __bos(). In other words, since all uses of __bos() were constant expressions, it was not required to test for this. When these change to __bdos(), they _may_ be constant expressions, and the checks are only valid when the prior condition holds. This results in no binary differences. Cc: linux-hardening@vger.kernel.org Link: https://lore.kernel.org/lkml/20220920192202.190793-3-keescook@chromium.org Signed-off-by: Kees Cook commit 3e1730842f142add55dc658929221521a9ea62b6 Author: Kees Cook Date: Mon Sep 19 19:45:14 2022 -0700 x86/entry: Work around Clang __bdos() bug Clang produces a false positive when building with CONFIG_FORTIFY_SOURCE=y and CONFIG_UBSAN_BOUNDS=y when operating on an array with a dynamic offset. Work around this by using a direct assignment of an empty instance. Avoids this warning: ../include/linux/fortify-string.h:309:4: warning: call to __write_overflow_field declared with 'warn ing' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wat tribute-warning] __write_overflow_field(p_size_field, size); ^ which was isolated to the memset() call in xen_load_idt(). Note that this looks very much like another bug that was worked around: https://github.com/ClangBuiltLinux/linux/issues/1592 Cc: Juergen Gross Cc: Boris Ostrovsky Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: xen-devel@lists.xenproject.org Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/lkml/41527d69-e8ab-3f86-ff37-6b298c01d5bc@oracle.com Signed-off-by: Kees Cook commit d6e3b27cbd2df555ff0736796ad2f9a17e74be8b Author: Peilin Ye Date: Thu Sep 22 21:59:26 2022 -0700 af_unix: Refactor unix_read_skb() Similar to udp_read_skb(), delete the unnecessary while loop in unix_read_skb() for readability. Since recv_actor() cannot return a value greater than skb->len (see sk_psock_verdict_recv()), remove the redundant check. Suggested-by: Cong Wang Signed-off-by: Peilin Ye Link: https://lore.kernel.org/r/7009141683ad6cd3785daced3e4a80ba0eb773b5.1663909008.git.peilin.ye@bytedance.com Signed-off-by: Jakub Kicinski commit 31f1fbcb346c9342f6860c322b3f33b2acbc640b Author: Peilin Ye Date: Thu Sep 22 21:59:13 2022 -0700 udp: Refactor udp_read_skb() Delete the unnecessary while loop in udp_read_skb() for readability. Additionally, since recv_actor() cannot return a value greater than skb->len (see sk_psock_verdict_recv()), remove the redundant check. Suggested-by: Cong Wang Signed-off-by: Peilin Ye Link: https://lore.kernel.org/r/343b5d8090a3eb764068e9f1d392939e2b423747.1663909008.git.peilin.ye@bytedance.com Signed-off-by: Jakub Kicinski commit 3aa12610b481f99b5e4e3f801ff7f9b7629e4ecf Merge: 0f65caa911019 7360d55ba1993 Author: Greg Kroah-Hartman Date: Mon Sep 26 19:25:32 2022 +0200 Merge tag 'icc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Grorgi writes: "interconnect changes for 6.1 These are the interconnect changes for the 6.1-rc1 merge window, which this time are tiny. One is a series to convert the remove() callback of platform devices to return void instead of int. The other change is enabling modular support for a driver." Signed-off-by: Georgi Djakov * tag 'icc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: Kconfig: Make INTERCONNECT_QCOM tristate interconnect: imx: Make imx_icc_unregister() return void interconnect: Make icc_provider_del() return void interconnect: sm8450: Ignore return value of icc_provider_del() in .remove() interconnect: osm-l3: Ignore return value of icc_provider_del() in .remove() interconnect: msm8974: Ignore return value of icc_provider_del() in .remove() interconnect: icc-rpmh: Ignore return value of icc_provider_del() in .remove() interconnect: icc-rpm: Ignore return value of icc_provider_del() in .remove() interconnect: imx: Ignore return value of icc_provider_del() in .remove() commit d4940b84da4fbba7f7ed6e6287e1bef48d1293e9 Author: Gaosheng Cui Date: Wed Sep 14 19:04:37 2022 +0800 x86/kprobes: Remove unused arch_kprobe_override_function() declaration All uses of arch_kprobe_override_function() have been removed by commit 540adea3809f ("error-injection: Separate error-injection from kprobe"), so remove the declaration, too. Link: https://lkml.kernel.org/r/20220914110437.1436353-3-cuigaosheng1@huawei.com Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit 40d81137f186f188f9aa9081ff12018be6ee19d0 Author: Gaosheng Cui Date: Wed Sep 14 19:04:36 2022 +0800 x86/ftrace: Remove unused modifying_ftrace_code declaration All uses of modifying_ftrace_code have been removed by commit 768ae4406a5c ("x86/ftrace: Use text_poke()"), so remove the declaration, too. Link: https://lkml.kernel.org/r/20220914110437.1436353-2-cuigaosheng1@huawei.com Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit 5d2569cb4a65c373896ec0217febdf88739ed295 Author: Mario Limonciello Date: Mon Sep 26 09:33:50 2022 -0500 thunderbolt: Explicitly enable lane adapter hotplug events at startup Software that has run before the USB4 CM in Linux runs may have disabled hotplug events for a given lane adapter. Other CMs such as that one distributed with Windows 11 will enable hotplug events. Do the same thing in the Linux CM which fixes hotplug events on "AMD Pink Sardine". Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg commit f994ae0a143485fcc02ebf17a329239430306b6c Author: Li Zhijian Date: Mon Aug 1 06:23:30 2022 +0000 RDMA/rxe: Add send_common_ack() helper Most code in send_ack() and send_atomic_ack() are duplicate, move them to a new helper send_common_ack(). In newer IBA spec, some opcodes require acknowledge with a zero-length read response, with this new helper, we can easily implement it later. Link: https://lore.kernel.org/r/1659335010-2-1-git-send-email-lizhijian@fujitsu.com Signed-off-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit 3c516f89e17e56b4738f05588e51267e295b5e63 Author: Sami Tolvanen Date: Thu Sep 8 14:55:04 2022 -0700 x86: Add support for CONFIG_CFI_CLANG With CONFIG_CFI_CLANG, the compiler injects a type preamble immediately before each function and a check to validate the target function type before indirect calls: ; type preamble __cfi_function: mov , %eax function: ... ; indirect call check mov -,%r10d add -0x4(%r11),%r10d je .Ltmp1 ud2 .Ltmp1: call __x86_indirect_thunk_r11 Add error handling code for the ud2 traps emitted for the checks, and allow CONFIG_CFI_CLANG to be selected on x86_64. This produces the following oops on CFI failure (generated using lkdtm): [ 21.441706] CFI failure at lkdtm_indirect_call+0x16/0x20 [lkdtm] (target: lkdtm_increment_int+0x0/0x10 [lkdtm]; expected type: 0x7e0c52a) [ 21.444579] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 21.445296] CPU: 0 PID: 132 Comm: sh Not tainted 5.19.0-rc8-00020-g9f27360e674c #1 [ 21.445296] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 21.445296] RIP: 0010:lkdtm_indirect_call+0x16/0x20 [lkdtm] [ 21.445296] Code: 52 1c c0 48 c7 c1 c5 50 1c c0 e9 25 48 2a cc 0f 1f 44 00 00 49 89 fb 48 c7 c7 50 b4 1c c0 41 ba 5b ad f3 81 45 03 53 f8 [ 21.445296] RSP: 0018:ffffa9f9c02ffdc0 EFLAGS: 00000292 [ 21.445296] RAX: 0000000000000027 RBX: ffffffffc01cb300 RCX: 385cbbd2e070a700 [ 21.445296] RDX: 0000000000000000 RSI: c0000000ffffdfff RDI: ffffffffc01cb450 [ 21.445296] RBP: 0000000000000006 R08: 0000000000000000 R09: ffffffff8d081610 [ 21.445296] R10: 00000000bcc90825 R11: ffffffffc01c2fc0 R12: 0000000000000000 [ 21.445296] R13: ffffa31b827a6000 R14: 0000000000000000 R15: 0000000000000002 [ 21.445296] FS: 00007f08b42216a0(0000) GS:ffffa31b9f400000(0000) knlGS:0000000000000000 [ 21.445296] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 21.445296] CR2: 0000000000c76678 CR3: 0000000001940000 CR4: 00000000000006f0 [ 21.445296] Call Trace: [ 21.445296] [ 21.445296] lkdtm_CFI_FORWARD_PROTO+0x30/0x50 [lkdtm] [ 21.445296] direct_entry+0x12d/0x140 [lkdtm] [ 21.445296] full_proxy_write+0x5d/0xb0 [ 21.445296] vfs_write+0x144/0x460 [ 21.445296] ? __x64_sys_wait4+0x5a/0xc0 [ 21.445296] ksys_write+0x69/0xd0 [ 21.445296] do_syscall_64+0x51/0xa0 [ 21.445296] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 21.445296] RIP: 0033:0x7f08b41a6fe1 [ 21.445296] Code: be 07 00 00 00 41 89 c0 e8 7e ff ff ff 44 89 c7 89 04 24 e8 91 c6 02 00 8b 04 24 48 83 c4 68 c3 48 63 ff b8 01 00 00 03 [ 21.445296] RSP: 002b:00007ffcdf65c2e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 21.445296] RAX: ffffffffffffffda RBX: 00007f08b4221690 RCX: 00007f08b41a6fe1 [ 21.445296] RDX: 0000000000000012 RSI: 0000000000c738f0 RDI: 0000000000000001 [ 21.445296] RBP: 0000000000000001 R08: fefefefefefefeff R09: fefefefeffc5ff4e [ 21.445296] R10: 00007f08b42222b0 R11: 0000000000000246 R12: 0000000000c738f0 [ 21.445296] R13: 0000000000000012 R14: 00007ffcdf65c401 R15: 0000000000c70450 [ 21.445296] [ 21.445296] Modules linked in: lkdtm [ 21.445296] Dumping ftrace buffer: [ 21.445296] (ftrace buffer empty) [ 21.471442] ---[ end trace 0000000000000000 ]--- [ 21.471811] RIP: 0010:lkdtm_indirect_call+0x16/0x20 [lkdtm] [ 21.472467] Code: 52 1c c0 48 c7 c1 c5 50 1c c0 e9 25 48 2a cc 0f 1f 44 00 00 49 89 fb 48 c7 c7 50 b4 1c c0 41 ba 5b ad f3 81 45 03 53 f8 [ 21.474400] RSP: 0018:ffffa9f9c02ffdc0 EFLAGS: 00000292 [ 21.474735] RAX: 0000000000000027 RBX: ffffffffc01cb300 RCX: 385cbbd2e070a700 [ 21.475664] RDX: 0000000000000000 RSI: c0000000ffffdfff RDI: ffffffffc01cb450 [ 21.476471] RBP: 0000000000000006 R08: 0000000000000000 R09: ffffffff8d081610 [ 21.477127] R10: 00000000bcc90825 R11: ffffffffc01c2fc0 R12: 0000000000000000 [ 21.477959] R13: ffffa31b827a6000 R14: 0000000000000000 R15: 0000000000000002 [ 21.478657] FS: 00007f08b42216a0(0000) GS:ffffa31b9f400000(0000) knlGS:0000000000000000 [ 21.479577] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 21.480307] CR2: 0000000000c76678 CR3: 0000000001940000 CR4: 00000000000006f0 [ 21.481460] Kernel panic - not syncing: Fatal exception Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-23-samitolvanen@google.com commit a4b7a12c5594fe5e6ab2a5aa514a9ae3c0b85573 Author: Sami Tolvanen Date: Thu Sep 8 14:55:03 2022 -0700 x86/purgatory: Disable CFI Disable CONFIG_CFI_CLANG for the stand-alone purgatory.ro. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Tested-by: Nick Desaulniers Tested-by: Sedat Dilek Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-22-samitolvanen@google.com commit ccace936eec7b805e1ab9268a6d163a00047b3a9 Author: Sami Tolvanen Date: Thu Sep 8 14:55:02 2022 -0700 x86: Add types to indirectly called assembly functions With CONFIG_CFI_CLANG, assembly functions indirectly called from C code must be annotated with type identifiers to pass CFI checking. Define the __CFI_TYPE helper macro to match the compiler generated function preamble, and ensure SYM_TYPED_FUNC_START also emits ENDBR with IBT. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-21-samitolvanen@google.com commit ca7e10bff196f69a450b9072a7b757713d3bb2dd Author: Sami Tolvanen Date: Thu Sep 8 14:55:01 2022 -0700 x86/tools/relocs: Ignore __kcfi_typeid_ relocations The compiler generates __kcfi_typeid_ symbols for annotating assembly functions with type information. These are constants that can be referenced in assembly code and are resolved by the linker. Ignore them in relocs. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-20-samitolvanen@google.com commit dfb352ab1162f73b8c6dc98150fa32cf5aa2f623 Author: Sami Tolvanen Date: Thu Sep 8 14:55:00 2022 -0700 kallsyms: Drop CONFIG_CFI_CLANG workarounds With -fsanitize=kcfi, the compiler no longer renames static functions with CONFIG_CFI_CLANG + ThinLTO. Drop the code that cleans up the ThinLTO hash from the function names. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-19-samitolvanen@google.com commit 3c68a92d17add767109441f4040391b9e8a14a98 Author: Sami Tolvanen Date: Thu Sep 8 14:54:59 2022 -0700 objtool: Disable CFI warnings The __cfi_ preambles contain a mov instruction that embeds the KCFI type identifier in the following format: ; type preamble __cfi_function: mov , %eax function: ... While the preamble symbols are STT_FUNC and contain valid instructions, they are never executed and always fall through. Skip the warning for them. .kcfi_traps sections point to CFI traps in text sections. Also skip the warning about them referencing !ENDBR instructions. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-18-samitolvanen@google.com commit 5141d3a06b2da1731ac82091298b766a1f95d3d8 Author: Sami Tolvanen Date: Thu Sep 8 14:54:58 2022 -0700 objtool: Preserve special st_shndx indexes in elf_update_symbol elf_update_symbol fails to preserve the special st_shndx values between [SHN_LORESERVE, SHN_HIRESERVE], which results in it converting SHN_ABS entries into SHN_UNDEF, for example. Explicitly check for the special indexes and ensure these symbols are not marked undefined. Fixes: ead165fa1042 ("objtool: Fix symbol creation") Signed-off-by: Sami Tolvanen Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-17-samitolvanen@google.com commit 5659b598b4dcb352b1a567c55fc5a658bc80076c Author: Sami Tolvanen Date: Thu Sep 8 14:54:57 2022 -0700 treewide: Drop __cficanonical CONFIG_CFI_CLANG doesn't use a jump table anymore and therefore, won't change function references to point elsewhere. Remove the __cficanonical attribute and all uses of it. Note that the Clang definition of the attribute was removed earlier, just clean up the no-op definition and users. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-16-samitolvanen@google.com commit 4b24356312fbe1bace72f9905d529b14fc34c1c3 Author: Sami Tolvanen Date: Thu Sep 8 14:54:56 2022 -0700 treewide: Drop WARN_ON_FUNCTION_MISMATCH CONFIG_CFI_CLANG no longer breaks cross-module function address equality, which makes WARN_ON_FUNCTION_MISMATCH unnecessary. Remove the definition and switch back to WARN_ON_ONCE. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-15-samitolvanen@google.com commit 607289a7cd7a3ca42b8a6877fcb6072e6eb20c34 Author: Sami Tolvanen Date: Thu Sep 8 14:54:55 2022 -0700 treewide: Drop function_nocfi With -fsanitize=kcfi, we no longer need function_nocfi() as the compiler won't change function references to point to a jump table. Remove all implementations and uses of the macro. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-14-samitolvanen@google.com commit 5dbbb3eaa2a784342f3206b77381b516181d089c Author: Sami Tolvanen Date: Thu Sep 8 14:54:54 2022 -0700 init: Drop __nocfi from __init It's no longer necessary to disable CFI checking for all __init functions. Drop the __nocfi attribute from __init. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-13-samitolvanen@google.com commit 5f20997c194e8b74254cbdb113b2b09bc1c0c734 Author: Sami Tolvanen Date: Thu Sep 8 14:54:53 2022 -0700 arm64: Drop unneeded __nocfi attributes With -fsanitize=kcfi, CONFIG_CFI_CLANG no longer has issues with address space confusion in functions that switch to linear mapping. Now that the indirectly called assembly functions have type annotations, drop the __nocfi attributes. Suggested-by: Mark Rutland Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-12-samitolvanen@google.com commit b26e484b8bb3a992ef30e851d771973a3dd2336b Author: Sami Tolvanen Date: Thu Sep 8 14:54:52 2022 -0700 arm64: Add CFI error handling With -fsanitize=kcfi, CFI always traps. Add arm64 support for handling CFI failures. The registers containing the target address and the expected type are encoded in the first ten bits of the ESR as follows: - 0-4: n, where the register Xn contains the target address - 5-9: m, where the register Wm contains the type hash This produces the following oops on CFI failure (generated using lkdtm): [ 21.885179] CFI failure at lkdtm_indirect_call+0x2c/0x44 [lkdtm] (target: lkdtm_increment_int+0x0/0x1c [lkdtm]; expected type: 0x7e0c52a) [ 21.886593] Internal error: Oops - CFI: 0 [#1] PREEMPT SMP [ 21.891060] Modules linked in: lkdtm [ 21.893363] CPU: 0 PID: 151 Comm: sh Not tainted 5.19.0-rc1-00021-g852f4e48dbab #1 [ 21.895560] Hardware name: linux,dummy-virt (DT) [ 21.896543] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 21.897583] pc : lkdtm_indirect_call+0x2c/0x44 [lkdtm] [ 21.898551] lr : lkdtm_CFI_FORWARD_PROTO+0x3c/0x6c [lkdtm] [ 21.899520] sp : ffff8000083a3c50 [ 21.900191] x29: ffff8000083a3c50 x28: ffff0000027e0ec0 x27: 0000000000000000 [ 21.902453] x26: 0000000000000000 x25: ffffc2aa3d07e7b0 x24: 0000000000000002 [ 21.903736] x23: ffffc2aa3d079088 x22: ffffc2aa3d07e7b0 x21: ffff000003379000 [ 21.905062] x20: ffff8000083a3dc0 x19: 0000000000000012 x18: 0000000000000000 [ 21.906371] x17: 000000007e0c52a5 x16: 000000003ad55aca x15: ffffc2aa60d92138 [ 21.907662] x14: ffffffffffffffff x13: 2e2e2e2065707974 x12: 0000000000000018 [ 21.909775] x11: ffffc2aa62322b88 x10: ffffc2aa62322aa0 x9 : c7e305fb5195d200 [ 21.911898] x8 : ffffc2aa3d077e20 x7 : 6d20676e696c6c61 x6 : 43203a6d74646b6c [ 21.913108] x5 : ffffc2aa6266c9df x4 : ffffc2aa6266c9e1 x3 : ffff8000083a3968 [ 21.914358] x2 : 80000000fffff122 x1 : 00000000fffff122 x0 : ffffc2aa3d07e8f8 [ 21.915827] Call trace: [ 21.916375] lkdtm_indirect_call+0x2c/0x44 [lkdtm] [ 21.918060] lkdtm_CFI_FORWARD_PROTO+0x3c/0x6c [lkdtm] [ 21.919030] lkdtm_do_action+0x34/0x4c [lkdtm] [ 21.919920] direct_entry+0x170/0x1ac [lkdtm] [ 21.920772] full_proxy_write+0x84/0x104 [ 21.921759] vfs_write+0x188/0x3d8 [ 21.922387] ksys_write+0x78/0xe8 [ 21.922986] __arm64_sys_write+0x1c/0x2c [ 21.923696] invoke_syscall+0x58/0x134 [ 21.924554] el0_svc_common+0xb4/0xf4 [ 21.925603] do_el0_svc+0x2c/0xb4 [ 21.926563] el0_svc+0x2c/0x7c [ 21.927147] el0t_64_sync_handler+0x84/0xf0 [ 21.927985] el0t_64_sync+0x18c/0x190 [ 21.929133] Code: 728a54b1 72afc191 6b11021f 54000040 (d4304500) [ 21.930690] ---[ end trace 0000000000000000 ]--- [ 21.930971] Kernel panic - not syncing: Oops - CFI: Fatal exception Suggested-by: Mark Rutland Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-11-samitolvanen@google.com commit c50d32859e70f6dbccb7d151408eb10afbbb7965 Author: Sami Tolvanen Date: Thu Sep 8 14:54:51 2022 -0700 arm64: Add types to indirect called assembly functions With CONFIG_CFI_CLANG, assembly functions indirectly called from C code must be annotated with type identifiers to pass CFI checking. Use SYM_TYPED_FUNC_START for the indirectly called functions, and ensure we emit `bti c` also with SYM_TYPED_FUNC_START. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-10-samitolvanen@google.com commit 44f665b69c67f0a17a0c8748030ed30205532149 Author: Sami Tolvanen Date: Thu Sep 8 14:54:50 2022 -0700 psci: Fix the function type for psci_initcall_t Functions called through a psci_initcall_t pointer all have non-const arguments. Fix the type definition to avoid tripping indirect call checks with CFI_CLANG. Suggested-by: Mark Rutland Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-9-samitolvanen@google.com commit cf90d0383560de12330de8cf3f831b14cdd45914 Author: Sami Tolvanen Date: Thu Sep 8 14:54:49 2022 -0700 lkdtm: Emit an indirect call for CFI tests Clang can convert the indirect calls in lkdtm_CFI_FORWARD_PROTO into direct calls. Move the call into a noinline function that accepts the target address as an argument to ensure the compiler actually emits an indirect call instead. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Kees Cook Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-8-samitolvanen@google.com commit e84e008e7b02c015047e76261726da1550130a59 Author: Sami Tolvanen Date: Thu Sep 8 14:54:48 2022 -0700 cfi: Add type helper macros With CONFIG_CFI_CLANG, assembly functions called indirectly from C code must be annotated with type identifiers to pass CFI checking. In order to make this easier, the compiler emits a __kcfi_typeid_ symbol for each address-taken function declaration in C, which contains the expected type identifier that we can refer to in assembly code. Add a typed version of SYM_FUNC_START, which emits the type identifier before the function. Architectures that support KCFI can define their own __CFI_TYPE macro to override the default preamble format. As an example, for the x86_64 blowfish_dec_blk function, the compiler emits the following type symbol: $ readelf -sW vmlinux | grep __kcfi_typeid_blowfish_dec_blk 120204: 00000000ef478db5 0 NOTYPE WEAK DEFAULT ABS __kcfi_typeid_blowfish_dec_blk And SYM_TYPED_FUNC_START will generate the following preamble based on the __CFI_TYPE definition for the architecture: $ objdump -dr arch/x86/crypto/blowfish-x86_64-asm_64.o ... 0000000000000400 <__cfi_blowfish_dec_blk>: ... 40b: b8 00 00 00 00 mov $0x0,%eax 40c: R_X86_64_32 __kcfi_typeid_blowfish_dec_blk 0000000000000410 : ... Note that the address of all assembly functions annotated with SYM_TYPED_FUNC_START must be taken in C code that's linked into the binary or the missing __kcfi_typeid_ symbol will result in a linker error with CONFIG_CFI_CLANG. If the code that contains the indirect call is not always compiled in, __ADDRESSABLE(functionname) can be used to ensure that the __kcfi_typeid_ symbol is emitted. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-7-samitolvanen@google.com commit 89245600941e4e0f87d77f60ee269b5e61ef4e49 Author: Sami Tolvanen Date: Thu Sep 8 14:54:47 2022 -0700 cfi: Switch to -fsanitize=kcfi Switch from Clang's original forward-edge control-flow integrity implementation to -fsanitize=kcfi, which is better suited for the kernel, as it doesn't require LTO, doesn't use a jump table that requires altering function references, and won't break cross-module function address equality. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-6-samitolvanen@google.com commit 92efda8eb15295a07f450828b2db14485bfc09c2 Author: Sami Tolvanen Date: Thu Sep 8 14:54:46 2022 -0700 cfi: Drop __CFI_ADDRESSABLE The __CFI_ADDRESSABLE macro is used for init_module and cleanup_module to ensure we have the address of the CFI jump table, and with CONFIG_X86_KERNEL_IBT to ensure LTO won't optimize away the symbols. As __CFI_ADDRESSABLE is no longer necessary with -fsanitize=kcfi, add a more flexible version of the __ADDRESSABLE macro and always ensure these symbols won't be dropped. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-5-samitolvanen@google.com commit 9fca7115827b2e5f48d84e50bceb4edfd4cb6375 Author: Sami Tolvanen Date: Thu Sep 8 14:54:45 2022 -0700 cfi: Remove CONFIG_CFI_CLANG_SHADOW In preparation to switching to -fsanitize=kcfi, remove support for the CFI module shadow that will no longer be needed. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-4-samitolvanen@google.com commit d0f9562ee43a135b941715d9e5e607de88898aca Author: Sami Tolvanen Date: Thu Sep 8 14:54:44 2022 -0700 scripts/kallsyms: Ignore __kcfi_typeid_ The compiler generates __kcfi_typeid_ symbols for annotating assembly functions with type information. These are constants that can be referenced in assembly code and are resolved by the linker. Ignore them in kallsyms. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-3-samitolvanen@google.com commit f143ff397a3f991e8b48542f77aad900845f436e Author: Sami Tolvanen Date: Thu Sep 8 14:54:43 2022 -0700 treewide: Filter out CC_FLAGS_CFI In preparation for removing CC_FLAGS_CFI from CC_FLAGS_LTO, explicitly filter out CC_FLAGS_CFI in all the makefiles where we currently filter out CC_FLAGS_LTO. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook Tested-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Tested-by: Peter Zijlstra (Intel) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220908215504.3686827-2-samitolvanen@google.com commit 51714678eacc91fcfb8b235ced57ea70ade81cad Author: Zhen Lei Date: Wed Sep 14 14:14:16 2022 +0800 tracepoint: Optimize the critical region of mutex_lock in tracepoint_module_coming() The memory allocation of 'tp_mod' does not require mutex_lock() protection, move it out. Link: https://lkml.kernel.org/r/20220914061416.1630-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Steven Rostedt (Google) commit fde59ab1614942a16dd0ce6f053ae96718f0ee50 Author: Steven Rostedt (Google) Date: Tue Sep 6 18:53:17 2022 -0400 tracing/filter: Call filter predicate functions directly via a switch statement Due to retpolines, indirect calls are much more expensive than direct calls. The filters have a select set of functions it uses for the predicates. Instead of using function pointers to call them, create a filter_pred_fn_call() function that uses a switch statement to call the predicate functions directly. This gives almost a 10% speedup to the filter logic. Using the histogram benchmark: Before: # event histogram # # trigger info: hist:keys=delta:vals=hitcount:sort=delta:size=2048 if delta > 0 [active] # { delta: 113 } hitcount: 272 { delta: 114 } hitcount: 840 { delta: 118 } hitcount: 344 { delta: 119 } hitcount: 25428 { delta: 120 } hitcount: 350590 { delta: 121 } hitcount: 1892484 { delta: 122 } hitcount: 6205004 { delta: 123 } hitcount: 11583521 { delta: 124 } hitcount: 37590979 { delta: 125 } hitcount: 108308504 { delta: 126 } hitcount: 131672461 { delta: 127 } hitcount: 88700598 { delta: 128 } hitcount: 65939870 { delta: 129 } hitcount: 45055004 { delta: 130 } hitcount: 33174464 { delta: 131 } hitcount: 31813493 { delta: 132 } hitcount: 29011676 { delta: 133 } hitcount: 22798782 { delta: 134 } hitcount: 22072486 { delta: 135 } hitcount: 17034113 { delta: 136 } hitcount: 8982490 { delta: 137 } hitcount: 2865908 { delta: 138 } hitcount: 980382 { delta: 139 } hitcount: 1651944 { delta: 140 } hitcount: 4112073 { delta: 141 } hitcount: 3963269 { delta: 142 } hitcount: 1712508 { delta: 143 } hitcount: 575941 After: # event histogram # # trigger info: hist:keys=delta:vals=hitcount:sort=delta:size=2048 if delta > 0 [active] # { delta: 103 } hitcount: 60 { delta: 104 } hitcount: 16966 { delta: 105 } hitcount: 396625 { delta: 106 } hitcount: 3223400 { delta: 107 } hitcount: 12053754 { delta: 108 } hitcount: 20241711 { delta: 109 } hitcount: 14850200 { delta: 110 } hitcount: 4946599 { delta: 111 } hitcount: 3479315 { delta: 112 } hitcount: 18698299 { delta: 113 } hitcount: 62388733 { delta: 114 } hitcount: 95803834 { delta: 115 } hitcount: 58278130 { delta: 116 } hitcount: 15364800 { delta: 117 } hitcount: 5586866 { delta: 118 } hitcount: 2346880 { delta: 119 } hitcount: 1131091 { delta: 120 } hitcount: 620896 { delta: 121 } hitcount: 236652 { delta: 122 } hitcount: 105957 { delta: 123 } hitcount: 119107 { delta: 124 } hitcount: 54494 { delta: 125 } hitcount: 63856 { delta: 126 } hitcount: 64454 { delta: 127 } hitcount: 34818 { delta: 128 } hitcount: 41446 { delta: 129 } hitcount: 51242 { delta: 130 } hitcount: 28361 { delta: 131 } hitcount: 23926 The peak before was 126ns per event, after the peak is 114ns, and the fastest time went from 113ns to 103ns. Link: https://lkml.kernel.org/r/20220906225529.781407172@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 26c4e3d10ad0566f8604e6c378e939f941707f36 Author: Steven Rostedt (Google) Date: Tue Sep 6 18:53:16 2022 -0400 tracing: Move struct filter_pred into trace_events_filter.c The structure filter_pred and the typedef of the function used are only referenced by trace_events_filter.c. There's no reason to have it in an external header file. Move them into the only file they are used in. Link: https://lkml.kernel.org/r/20220906225529.598047132@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 86087383ec0a7ac2bcc3284e13e0e9966f7e3bfa Author: Steven Rostedt (Google) Date: Tue Sep 6 18:53:15 2022 -0400 tracing/hist: Call hist functions directly via a switch statement Due to retpolines, indirect calls are much more expensive than direct calls. The histograms have a select set of functions it uses for the histograms, instead of using function pointers to call them, create a hist_fn_call() function that uses a switch statement to call the histogram functions directly. This gives a 13% speedup to the histogram logic. Using the histogram benchmark: Before: # event histogram # # trigger info: hist:keys=delta:vals=hitcount:sort=delta:size=2048 if delta > 0 [active] # { delta: 129 } hitcount: 2213 { delta: 130 } hitcount: 285965 { delta: 131 } hitcount: 1146545 { delta: 132 } hitcount: 5185432 { delta: 133 } hitcount: 19896215 { delta: 134 } hitcount: 53118616 { delta: 135 } hitcount: 83816709 { delta: 136 } hitcount: 68329562 { delta: 137 } hitcount: 41859349 { delta: 138 } hitcount: 46257797 { delta: 139 } hitcount: 54400831 { delta: 140 } hitcount: 72875007 { delta: 141 } hitcount: 76193272 { delta: 142 } hitcount: 49504263 { delta: 143 } hitcount: 38821072 { delta: 144 } hitcount: 47702679 { delta: 145 } hitcount: 41357297 { delta: 146 } hitcount: 22058238 { delta: 147 } hitcount: 9720002 { delta: 148 } hitcount: 3193542 { delta: 149 } hitcount: 927030 { delta: 150 } hitcount: 850772 { delta: 151 } hitcount: 1477380 { delta: 152 } hitcount: 2687977 { delta: 153 } hitcount: 2865985 { delta: 154 } hitcount: 1977492 { delta: 155 } hitcount: 2475607 { delta: 156 } hitcount: 3403612 After: # event histogram # # trigger info: hist:keys=delta:vals=hitcount:sort=delta:size=2048 if delta > 0 [active] # { delta: 113 } hitcount: 272 { delta: 114 } hitcount: 840 { delta: 118 } hitcount: 344 { delta: 119 } hitcount: 25428 { delta: 120 } hitcount: 350590 { delta: 121 } hitcount: 1892484 { delta: 122 } hitcount: 6205004 { delta: 123 } hitcount: 11583521 { delta: 124 } hitcount: 37590979 { delta: 125 } hitcount: 108308504 { delta: 126 } hitcount: 131672461 { delta: 127 } hitcount: 88700598 { delta: 128 } hitcount: 65939870 { delta: 129 } hitcount: 45055004 { delta: 130 } hitcount: 33174464 { delta: 131 } hitcount: 31813493 { delta: 132 } hitcount: 29011676 { delta: 133 } hitcount: 22798782 { delta: 134 } hitcount: 22072486 { delta: 135 } hitcount: 17034113 { delta: 136 } hitcount: 8982490 { delta: 137 } hitcount: 2865908 { delta: 138 } hitcount: 980382 { delta: 139 } hitcount: 1651944 { delta: 140 } hitcount: 4112073 { delta: 141 } hitcount: 3963269 { delta: 142 } hitcount: 1712508 { delta: 143 } hitcount: 575941 { delta: 144 } hitcount: 351427 { delta: 145 } hitcount: 218077 { delta: 146 } hitcount: 167297 { delta: 147 } hitcount: 146198 { delta: 148 } hitcount: 116122 { delta: 149 } hitcount: 58993 { delta: 150 } hitcount: 40228 The delta above is in nanoseconds. It brings the fastest time down from 129ns to 113ns, and the peak from 141ns to 126ns. Link: https://lkml.kernel.org/r/20220906225529.411545333@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit b7b037eb5f548cc947e743d456d66eb110316f1e Author: Steven Rostedt (Google) Date: Tue Sep 6 18:53:14 2022 -0400 tracing: Add numeric delta time to the trace event benchmark In order to testing filtering and histograms via the trace event benchmark, record the delta time of the last event as a numeric value (currently, it just saves it within the string) so that filters and histograms can use it. Link: https://lkml.kernel.org/r/20220906225529.213677569@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 4359a011e259a4608afc7fb3635370c9d4ba5943 Author: Zeng Heng Date: Wed Aug 24 11:43:57 2022 +0800 rv/dot2K: add 'static' qualifier for local variable Following Daniel's suggestion, fix similar warning in template files, which would prevent new monitors from such warning. Link: https://lkml.kernel.org/r/20220824034357.2014202-3-zengheng4@huawei.com Cc: Fixes: 24bce201d798 ("tools/rv: Add dot2k") Suggested-by: Daniel Bristot de Oliveira Signed-off-by: Zeng Heng Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 01c44bf8337ac79f31aa090e842bf3b9dd762aca Author: Zeng Heng Date: Wed Aug 24 11:43:56 2022 +0800 rv/monitors: add 'static' qualifier for local symbols The sparse tool complains as follows: kernel/trace/rv/monitors/wwnr/wwnr.c:18:19: warning: symbol 'rv_wwnr' was not declared. Should it be static? The `rv_wwnr` symbol is not dereferenced by other extern files, so add static qualifier for it. So does wip module. Link: https://lkml.kernel.org/r/20220824034357.2014202-2-zengheng4@huawei.com Cc: Fixes: ccc319dcb450 ("rv/monitor: Add the wwnr monitor") Fixes: 8812d21219b9 ("rv/monitor: Add the wip monitor skeleton created by dot2k") Signed-off-by: Zeng Heng Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 9e14bae7d049cfdd5ab22cb200bc7ea847cfa8c9 Author: Masami Hiramatsu (Google) Date: Mon Aug 1 11:32:34 2022 +0900 selftests/ftrace: Add eprobe syntax error testcase Add a syntax error test case for eprobe as same as kprobes. Link: https://lkml.kernel.org/r/165932115471.2850673.8014722990775242727.stgit@devnote2 Cc: Tzvetomir Stoyanov Cc: Ingo Molnar Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 752be5c5c910a1a270e97b5b39c7a7d06a39e7c6 Author: Masami Hiramatsu (Google) Date: Mon Aug 1 11:32:25 2022 +0900 tracing/eprobe: Add eprobe filter support Add the filter option to the event probe. This is useful if user wants to derive a new event based on the condition of the original event. E.g. echo 'e:egroup/stat_runtime_4core sched/sched_stat_runtime \ runtime=$runtime:u32 if cpu < 4' >> ../dynamic_events Then it can filter the events only on first 4 cores. Note that the fields used for 'if' must be the fields in the original events, not eprobe events. Link: https://lkml.kernel.org/r/165932114513.2850673.2592206685744598080.stgit@devnote2 Cc: Tzvetomir Stoyanov Cc: Ingo Molnar Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit cdc7daa9e3e102fc650321c8c0d2d8cf0ced3910 Author: наб Date: Mon Sep 26 17:15:54 2022 +0200 a.out: restore CMAGIC Part of UAPI and the on-disk format: this means that it's not a magic number per magic-number.rst, and it's best to leave it untouched to avoid breaking userspace and suffer the same fate as a.out in general Fixes: 53c2bd679017 ("a.out: remove define-only CMAGIC, previously magic number") Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/20220926151554.7gxd6unp5727vw3c@tarta.nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit c52add61c27ea23501be82a34854edd98e10e061 Author: Sabrina Dubroca Date: Fri Sep 23 11:07:09 2022 +0200 macsec: don't free NULL metadata_dst Commit 0a28bfd4971f added a metadata_dst to each tx_sc, but that's only allocated when macsec_add_dev has run, which happens after device registration. If the requested or computed SCI already exists, or if linking to the lower device fails, we will panic because metadata_dst_free can't handle NULL. Reproducer: ip link add link $lower type macsec ip link add link $lower type macsec Fixes: 0a28bfd4971f ("net/macsec: Add MACsec skb_metadata_dst Tx Data path support") Signed-off-by: Sabrina Dubroca Acked-by: Raed Salem Link: https://lore.kernel.org/r/60f2a1965fe553e2cade9472407d0fafff8de8ce.1663923580.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski commit c59fb127583869350256656b7ed848c398bef879 Author: Paolo Bonzini Date: Wed Sep 21 00:32:01 2022 +0000 KVM: remove KVM_REQ_UNHALT KVM_REQ_UNHALT is now unnecessary because it is replaced by the return value of kvm_vcpu_block/kvm_vcpu_halt. Remove it. No functional change intended. Signed-off-by: Paolo Bonzini Signed-off-by: Sean Christopherson Acked-by: Marc Zyngier Message-Id: <20220921003201.1441511-13-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 599275c060a02a8f0db19c2e6a70d026d4b445ca Author: Paolo Bonzini Date: Wed Sep 21 00:32:00 2022 +0000 KVM: mips, x86: do not rely on KVM_REQ_UNHALT KVM_REQ_UNHALT is a weird request that simply reports the value of kvm_arch_vcpu_runnable() on exit from kvm_vcpu_halt(). Only MIPS and x86 are looking at it, the others just clear it. Check the state of the vCPU directly so that the request is handled as a nop on all architectures. No functional change intended, except for corner cases where an event arrive immediately after a signal become pending or after another similar host-side event. Signed-off-by: Paolo Bonzini Signed-off-by: Sean Christopherson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220921003201.1441511-12-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 26844fee6adee9b1557d2279b0506285de9ee82b Author: Paolo Bonzini Date: Wed Sep 21 00:31:59 2022 +0000 KVM: x86: never write to memory from kvm_vcpu_check_block() kvm_vcpu_check_block() is called while not in TASK_RUNNING, and therefore it cannot sleep. Writing to guest memory is therefore forbidden, but it can happen on AMD processors if kvm_check_nested_events() causes a vmexit. Fortunately, all events that are caught by kvm_check_nested_events() are also recognized by kvm_vcpu_has_events() through vendor callbacks such as kvm_x86_interrupt_allowed() or kvm_x86_ops.nested_ops->has_events(), so remove the call and postpone the actual processing to vcpu_block(). Opportunistically honor the return of kvm_check_nested_events(). KVM punted on the check in kvm_vcpu_running() because the only error path is if vmx_complete_nested_posted_interrupt() fails, in which case KVM exits to userspace with "internal error" i.e. the VM is likely dead anyways so it wasn't worth overloading the return of kvm_vcpu_running(). Add the check mostly so that KVM is consistent with itself; the return of the call via kvm_apic_accept_events()=>kvm_check_nested_events() that immediately follows _is_ checked. Reported-by: Maxim Levitsky Signed-off-by: Paolo Bonzini [sean: check and handle return of kvm_check_nested_events()] Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-11-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1e17a6f8721ca165e0883fae00cb6d1b95d748d6 Author: Sean Christopherson Date: Wed Sep 21 00:31:58 2022 +0000 KVM: x86: Don't snapshot pending INIT/SIPI prior to checking nested events Don't snapshot pending INIT/SIPI events prior to checking nested events, architecturally there's nothing wrong with KVM processing (dropping) a SIPI that is received immediately after synthesizing a VM-Exit. Taking and consuming the snapshot makes the flow way more subtle than it needs to be, e.g. nVMX consumes/clears events that trigger VM-Exit (INIT/SIPI), and so at first glance it appears that KVM is double-dipping on pending INITs and SIPIs. But that's not the case because INIT is blocked unconditionally in VMX root mode the CPU cannot be in wait-for_SIPI after VM-Exit, i.e. the paths that truly consume the snapshot are unreachable if apic->pending_events is modified by kvm_check_nested_events(). nSVM is a similar story as GIF is cleared by the CPU on VM-Exit; INIT is blocked regardless of whether or not it was pending prior to VM-Exit. Drop the snapshot logic so that a future fix doesn't create weirdness when kvm_vcpu_running()'s call to kvm_check_nested_events() is moved to vcpu_block(). In that case, kvm_check_nested_events() will be called immediately before kvm_apic_accept_events(), which raises the obvious question of why that change doesn't break the snapshot logic. Note, there is a subtle functional change. Previously, KVM would clear pending SIPIs if and only SIPI was pending prior to VM-Exit, whereas now KVM clears pending SIPI unconditionally if INIT+SIPI are blocked. The latter is architecturally allowed, as SIPI is ignored if the CPU is not in wait-for-SIPI mode (arguably, KVM should be even more aggressive in dropping SIPIs). It is software's responsibility to ensure the SIPI is delivered, i.e. software shouldn't be firing INIT-SIPI at a CPU until it knows with 100% certaining that the target CPU isn't in VMX root mode. Furthermore, the existing code is extra weird as SIPIs that arrive after VM-Exit _are_ dropped if there also happened to be a pending SIPI before VM-Exit. Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-10-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ea2f00c6219e654ed7cdd11478001ea9df036bd4 Author: Sean Christopherson Date: Wed Sep 21 00:31:57 2022 +0000 KVM: nVMX: Make event request on VMXOFF iff INIT/SIPI is pending Explicitly check for a pending INIT/SIPI event when emulating VMXOFF instead of blindly making an event request. There's obviously no need to evaluate events if none are pending. Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a56953e9506c068c4becbd2c067ba08c82da78fc Author: Sean Christopherson Date: Wed Sep 21 00:31:56 2022 +0000 KVM: nVMX: Make an event request if INIT or SIPI is pending on VM-Enter Evaluate interrupts, i.e. set KVM_REQ_EVENT, if INIT or SIPI is pending when emulating nested VM-Enter. INIT is blocked while the CPU is in VMX root mode, but not in VMX non-root, i.e. becomes unblocked on VM-Enter. This bug has been masked by KVM calling ->check_nested_events() in the core run loop, but that hack will be fixed in the near future. Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 0bba8fc24c7593068d5defd0238b723bf7aecc84 Author: Sean Christopherson Date: Wed Sep 21 00:31:55 2022 +0000 KVM: SVM: Make an event request if INIT or SIPI is pending when GIF is set Set KVM_REQ_EVENT if INIT or SIPI is pending when the guest enables GIF. INIT in particular is blocked when GIF=0 and needs to be processed when GIF is toggled to '1'. This bug has been masked by (a) KVM calling ->check_nested_events() in the core run loop and (b) hypervisors toggling GIF from 0=>1 only when entering guest mode (L1 entering L2). Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit bf7f9352af5d184f28d352a58cb9230e404f8c5c Author: Paolo Bonzini Date: Wed Sep 21 00:31:54 2022 +0000 KVM: x86: lapic does not have to process INIT if it is blocked Do not return true from kvm_vcpu_has_events() if the vCPU isn' going to immediately process a pending INIT/SIPI. INIT/SIPI shouldn't be treated as wake events if they are blocked. Signed-off-by: Paolo Bonzini [sean: rebase onto refactored INIT/SIPI helpers, massage changelog] Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a61353acc574d8d81f07f156d992e14e63d06e95 Author: Sean Christopherson Date: Wed Sep 21 00:31:53 2022 +0000 KVM: x86: Rename kvm_apic_has_events() to make it INIT/SIPI specific Rename kvm_apic_has_events() to kvm_apic_has_pending_init_or_sipi() so that it's more obvious that "events" really just means "INIT or SIPI". Opportunistically clean up a weirdly worded comment that referenced kvm_apic_has_events() instead of kvm_apic_accept_events(). No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1b7a1b78d6601776cd8fed69b1e5803612184e93 Author: Sean Christopherson Date: Wed Sep 21 00:31:52 2022 +0000 KVM: x86: Rename and expose helper to detect if INIT/SIPI are allowed Rename and invert kvm_vcpu_latch_init() to kvm_apic_init_sipi_allowed() so as to match the behavior of {interrupt,nmi,smi}_allowed(), and expose the helper so that it can be used by kvm_vcpu_has_events() to determine whether or not an INIT or SIPI is pending _and_ can be taken immediately. Opportunistically replaced usage of the "latch" terminology with "blocked" and/or "allowed", again to align with KVM's terminology used for all other event types. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 2ea89c7f7f7b192e32d1842dafc2e972cd14329b Author: Sean Christopherson Date: Wed Sep 21 00:31:51 2022 +0000 KVM: nVMX: Make an event request when pending an MTF nested VM-Exit Set KVM_REQ_EVENT when MTF becomes pending to ensure that KVM will run through inject_pending_event() and thus vmx_check_nested_events() prior to re-entering the guest. MTF currently works by virtue of KVM's hack that calls kvm_check_nested_events() from kvm_vcpu_running(), but that hack will be removed in the near future. Until that call is removed, the patch introduces no real functional change. Fixes: 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing instruction emulation") Cc: stable@vger.kernel.org Reviewed-by: Maxim Levitsky Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5b4ac1a1b713736f906fb0378a5bde612fdad538 Author: Paolo Bonzini Date: Wed Sep 21 00:31:50 2022 +0000 KVM: x86: make vendor code check for all nested events Interrupts, NMIs etc. sent while in guest mode are already handled properly by the *_interrupt_allowed callbacks, but other events can cause a vCPU to be runnable that are specific to guest mode. In the case of VMX there are two, the preemption timer and the monitor trap. The VMX preemption timer is already special cased via the hv_timer_pending callback, but the purpose of the callback can be easily extended to MTF or in fact any other event that can occur only in guest mode. Rename the callback and add an MTF check; kvm_arch_vcpu_runnable() now can return true if an MTF is pending, without relying on kvm_vcpu_running()'s call to kvm_check_nested_events(). Until that call is removed, however, the patch introduces no functional change. Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20220921003201.1441511-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 18f6e9cd7fa3ef6a6dcb10d3fe357afaa52bd216 Author: Christian Marangi Date: Sun Jul 24 20:23:29 2022 +0200 clk: qcom: lcc-ipq806x: use ARRAY_SIZE for num_parents Use ARRAY_SIZE for num_parents instead of raw number to prevent any confusion/mistake. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724182329.9891-4-ansuelsmth@gmail.com commit 7458b82fa563468843a35fce946b9893d0445fd3 Author: Christian Marangi Date: Sun Jul 24 20:23:28 2022 +0200 clk: qcom: lcc-ipq806x: convert to parent data Convert lcc-ipq806x driver to parent_data API. Change parent_name for pll4 to pxo_board to prepare the future to eventually drop the double pxo board clk. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724182329.9891-3-ansuelsmth@gmail.com commit ce6bb04cad2632baa6ec27852f417b0baeaa58da Author: Christian Marangi Date: Sun Jul 24 20:23:27 2022 +0200 clk: qcom: lcc-ipq806x: add reset definition Add reset definition for lcc-ipq806x. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724182329.9891-2-ansuelsmth@gmail.com commit d7081998cca9df11727d77bf9a34f6499a13862b Author: Christian Marangi Date: Sun Jul 24 20:23:26 2022 +0200 dt-bindings: clock: add pcm reset for ipq806x lcc Add pcm reset define for ipq806x lcc. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724182329.9891-1-ansuelsmth@gmail.com commit f9ea0f59f7eefe44d82bbd4e86d2fac353fcfcbe Author: Dmitry Baryshkov Date: Thu Jul 14 13:03:51 2022 +0300 clk: qcom: cpu-8996: use constant mask for pmux Both pmux instances share the same width and shift. Specify the mask at compile time to simplify functions. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-7-dmitry.baryshkov@linaro.org commit f387d1c46f53457d0d9687295629f3db2f44d29b Author: Dmitry Baryshkov Date: Thu Jul 14 13:03:50 2022 +0300 clk: qcom: cpu-8996: don't store parents in clk_cpu_8996_pmux Don't store pointers to parents in struct clk_cpu_8996_pmux. Instead use clk_hw_get_parent_by_index to fetch them. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-6-dmitry.baryshkov@linaro.org commit 81165aca05dc003ea41c9bc725238dc249d477fd Author: Dmitry Baryshkov Date: Thu Jul 14 13:03:49 2022 +0300 clk: qcom: cpu-8996: move ACD logic to clk_cpu_8996_pmux_determine_rate Rather than telling everybody that we are using PLL as a parent (and using ACD clock instead) properly select ACD as a pmux parent clock. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-5-dmitry.baryshkov@linaro.org commit f1e3fcc4fc81e2aa78f4af754c460468e3f19782 Author: Dmitry Baryshkov Date: Thu Jul 14 13:03:48 2022 +0300 clk: qcom: cpu-8996: declare ACD clocks To simplify the code, define 1:1 fixed factor clocks to represent the ACD pmux parent. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-4-dmitry.baryshkov@linaro.org commit a808c7848a52523cb758c844f642b3d9e059c0c3 Author: Dmitry Baryshkov Date: Thu Jul 14 13:03:47 2022 +0300 clk: qcom: cpu-8996: switch to devm_clk_notifier_register Switch to using devres-managed version of clk_notifier_register(). This allows us to drop driver's remove() callback. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-3-dmitry.baryshkov@linaro.org commit da5daae8b412c922e08f86979e84ea80b60092a1 Author: Yassine Oudjana Date: Thu Jul 14 13:03:46 2022 +0300 clk: qcom: msm8996-cpu: Use parent_data/_hws for all clocks Replace parent_names in PLLs, secondary muxes and primary muxes with parent_data. For primary muxes there were never any *cl_pll_acd clocks, so instead of adding them, put the primary PLLs in both PLL_INDEX and ACD_INDEX, then make sure ACD_INDEX is always picked over PLL_INDEX when setting parent since we always want ACD when using the primary PLLs. Signed-off-by: Yassine Oudjana [DB: switch to parent_hws for pmux clocks] Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714100351.1834711-2-dmitry.baryshkov@linaro.org commit b4feed4a3d0a6b8cef4a574a9df707c556928ec2 Author: Yassine Oudjana Date: Tue Jun 21 20:06:20 2022 +0400 dt-bindings: clock: qcom,msm8996-apcc: Fix clocks The clocks currently listed in clocks and clock-names are the ones supplied by this clock controller, not the ones it consumes. Replace them with the only clock it consumes - the on-board oscillator (XO), and make the properties required. Signed-off-by: Yassine Oudjana Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220621160621.24415-6-y.oudjana@protonmail.com commit 9a9f5f9a5a0ca3f463eb28ba5920a6fd18dc9956 Author: Yassine Oudjana Date: Tue Jun 21 20:06:19 2022 +0400 clk: qcom: msm8996-cpu: Convert secondary muxes to clk_regmap_mux There is nothing special about the secondary muxes, unlike the primary muxes which need some extra logic to handle ACD and switching between primary PLL and secondary mux sources. Turn them into clk_regmap_mux and rename cpu_clk_msm8996_mux into cpu_clk_msm8996_pmux to make it specific to primary muxes. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220621160621.24415-5-y.oudjana@protonmail.com commit 382139bfd68fe6cc9dc94ffe3b9d783b85be3b1c Author: Yassine Oudjana Date: Tue Jun 21 20:06:18 2022 +0400 clk: qcom: msm8996-cpu: Unify cluster order The power cluster comes before the performance cluster. Make everything in the driver follow this order. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220621160621.24415-4-y.oudjana@protonmail.com commit de37e0214c28330cf0dbf4fe51db1d9d38c13c93 Author: Yassine Oudjana Date: Tue Jun 21 20:06:17 2022 +0400 clk: qcom: msm8996-cpu: Statically define PLL dividers This will allow for adding them to clk_parent_data arrays in an upcoming patch. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220621160621.24415-3-y.oudjana@protonmail.com commit 1ba0a3bbd5ed5a1bb8d0165912d9904b812af74b Author: Yassine Oudjana Date: Tue Jun 21 20:06:16 2022 +0400 clk: qcom: msm8996-cpu: Rename DIV_2_INDEX to SMUX_INDEX The parent at this index is the secondary mux, which can connect not only to primary PLL/2 but also to XO. Rename the index to SMUX_INDEX to better reflect the parent. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220621160621.24415-2-y.oudjana@protonmail.com commit 23e280172f1e16c601c8bc7c826ee9301f8c087b Author: Oliver Upton Date: Fri Aug 19 19:01:58 2022 +0000 mailmap: Update Oliver's email address While I'm still at Google, I've since switched to a linux.dev account for working upstream. Add an alias to the new address. Signed-off-by: Oliver Upton Message-Id: <20220819190158.234290-1-oliver.upton@linux.dev> Signed-off-by: Paolo Bonzini commit 40aaa5b6dadc2cbdfff004c31fdd00b9684ff1a8 Author: Sean Christopherson Date: Tue Aug 30 23:16:14 2022 +0000 KVM: x86: Allow force_emulation_prefix to be written without a reload Allow force_emulation_prefix to be written by privileged userspace without reloading KVM. The param does not have any persistent affects and is trivial to snapshot. Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830231614.3580124-28-seanjc@google.com Signed-off-by: Paolo Bonzini commit 28c40b2cfb841d55f9f10fd973e1a72e0bf09572 Author: Sean Christopherson Date: Tue Aug 30 23:16:13 2022 +0000 KVM: selftests: Add an x86-only test to verify nested exception queueing Add a test to verify that KVM_{G,S}ET_EVENTS play nice with pending vs. injected exceptions when an exception is being queued for L2, and that KVM correctly handles L1's exception intercept wants. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-27-seanjc@google.com Signed-off-by: Paolo Bonzini commit 1e2e9222e6e0367c8dc612013b07f76bbce87e9e Author: Sean Christopherson Date: Tue Aug 30 23:16:12 2022 +0000 KVM: selftests: Use uapi header to get VMX and SVM exit reasons/codes Include the vmx.h and svm.h uapi headers that KVM so kindly provides instead of manually defining all the same exit reasons/code. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-26-seanjc@google.com Signed-off-by: Paolo Bonzini commit e746c1f1b94ac9fa6c1f02fce808a6b2f3ef8cbd Author: Sean Christopherson Date: Tue Aug 30 23:16:11 2022 +0000 KVM: x86: Rename inject_pending_events() to kvm_check_and_inject_events() Rename inject_pending_events() to kvm_check_and_inject_events() in order to capture the fact that it handles more than just pending events, and to (mostly) align with kvm_check_nested_events(), which omits the "inject" for brevity. Add a comment above kvm_check_and_inject_events() to provide a high-level synopsis, and to document a virtualization hole (KVM erratum if you will) that exists due to KVM not strictly tracking instruction boundaries with respect to coincident instruction restarts and asynchronous events. No functional change inteded. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-25-seanjc@google.com Signed-off-by: Paolo Bonzini commit 65ec8f01beb62f76b2bf92009323cb3cb1865992 Author: Sean Christopherson Date: Tue Aug 30 23:16:10 2022 +0000 KVM: VMX: Update MTF and ICEBP comments to document KVM's subtle behavior Document the oddities of ICEBP interception (trap-like #DB is intercepted as a fault-like exception), and how using VMX's inner "skip" helper deliberately bypasses the pending MTF and single-step #DB logic. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-24-seanjc@google.com Signed-off-by: Paolo Bonzini commit 7055fb11311622852c16463b1ccaa59e7691e42e Author: Sean Christopherson Date: Tue Aug 30 23:16:09 2022 +0000 KVM: x86: Treat pending TRIPLE_FAULT requests as pending exceptions Treat pending TRIPLE_FAULTS as pending exceptions. A triple fault is an exception for all intents and purposes, it's just not tracked as such because there's no vector associated the exception. E.g. if userspace were to set vcpu->request_interrupt_window while running L2 and L2 hit a triple fault, a triple fault nested VM-Exit should be synthesized to L1 before exiting to userspace with KVM_EXIT_IRQ_WINDOW_OPEN. Link: https://lore.kernel.org/all/YoVHAIGcFgJit1qp@google.com Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-23-seanjc@google.com Signed-off-by: Paolo Bonzini commit 7709aba8f71613ae5d18d8c00adb54948e6bedb3 Author: Sean Christopherson Date: Tue Aug 30 23:16:08 2022 +0000 KVM: x86: Morph pending exceptions to pending VM-Exits at queue time Morph pending exceptions to pending VM-Exits (due to interception) when the exception is queued instead of waiting until nested events are checked at VM-Entry. This fixes a longstanding bug where KVM fails to handle an exception that occurs during delivery of a previous exception, KVM (L0) and L1 both want to intercept the exception (e.g. #PF for shadow paging), and KVM determines that the exception is in the guest's domain, i.e. queues the new exception for L2. Deferring the interception check causes KVM to esclate various combinations of injected+pending exceptions to double fault (#DF) without consulting L1's interception desires, and ends up injecting a spurious #DF into L2. KVM has fudged around the issue for #PF by special casing emulated #PF injection for shadow paging, but the underlying issue is not unique to shadow paging in L0, e.g. if KVM is intercepting #PF because the guest has a smaller maxphyaddr and L1 (but not L0) is using shadow paging. Other exceptions are affected as well, e.g. if KVM is intercepting #GP for one of SVM's workaround or for the VMware backdoor emulation stuff. The other cases have gone unnoticed because the #DF is spurious if and only if L1 resolves the exception, e.g. KVM's goofs go unnoticed if L1 would have injected #DF anyways. The hack-a-fix has also led to ugly code, e.g. bailing from the emulator if #PF injection forced a nested VM-Exit and the emulator finds itself back in L1. Allowing for direct-to-VM-Exit queueing also neatly solves the async #PF in L2 mess; no need to set a magic flag and token, simply queue a #PF nested VM-Exit. Deal with event migration by flagging that a pending exception was queued by userspace and check for interception at the next KVM_RUN, e.g. so that KVM does the right thing regardless of the order in which userspace restores nested state vs. event state. When "getting" events from userspace, simply drop any pending excpetion that is destined to be intercepted if there is also an injected exception to be migrated. Ideally, KVM would migrate both events, but that would require new ABI, and practically speaking losing the event is unlikely to be noticed, let alone fatal. The injected exception is captured, RIP still points at the original faulting instruction, etc... So either the injection on the target will trigger the same intercepted exception, or the source of the intercepted exception was transient and/or non-deterministic, thus dropping it is ok-ish. Fixes: a04aead144fd ("KVM: nSVM: fix running nested guests when npt=0") Fixes: feaf0c7dc473 ("KVM: nVMX: Do not generate #DF if #PF happens during exception delivery into L2") Cc: Jim Mattson Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-22-seanjc@google.com Signed-off-by: Paolo Bonzini commit f43f8a3ba9a615316fc0c059758dc1503bb17292 Author: Sean Christopherson Date: Tue Aug 30 23:16:07 2022 +0000 KVM: nVMX: Document priority of all known events on Intel CPUs Add a gigantic comment above vmx_check_nested_events() to document the priorities of all known events on Intel CPUs. Intel's SDM doesn't include VMX-specific events in its "Priority Among Concurrent Events", which makes it painfully difficult to suss out the correct priority between things like Monitor Trap Flag VM-Exits and pending #DBs. Kudos to Jim Mattson for doing the hard work of collecting and interpreting the priorities from various locations throughtout the SDM (because putting them all in one place in the SDM would be too easy). Cc: Jim Mattson Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-21-seanjc@google.com Signed-off-by: Paolo Bonzini commit 2b384165f4d15540f94998b751f50058642ad110 Author: Sean Christopherson Date: Tue Aug 30 23:16:06 2022 +0000 KVM: nVMX: Add a helper to identify low-priority #DB traps Add a helper to identify "low"-priority #DB traps, i.e. trap-like #DBs that aren't TSS T flag #DBs, and tweak the related code to operate on any queued exception. A future commit will separate exceptions that are intercepted by L1, i.e. cause nested VM-Exit, from those that do NOT trigger nested VM-Exit. I.e. there will be multiple exception structs and multiple invocations of the helpers. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-20-seanjc@google.com Signed-off-by: Paolo Bonzini commit 28360f88706837fc3f1ac8944b45b4a630a71c75 Author: Sean Christopherson Date: Tue Aug 30 23:16:05 2022 +0000 KVM: x86: Evaluate ability to inject SMI/NMI/IRQ after potential VM-Exit Determine whether or not new events can be injected after checking nested events. If a VM-Exit occurred during nested event handling, any previous event that needed re-injection is gone from's KVM perspective; the event is captured in the vmc*12 VM-Exit information, but doesn't exist in terms of what needs to be done for entry to L1. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-19-seanjc@google.com Signed-off-by: Paolo Bonzini commit 6c593b5276e6ce411dcdf03e2f7d4b93c2e7138e Author: Sean Christopherson Date: Tue Aug 30 23:16:04 2022 +0000 KVM: x86: Hoist nested event checks above event injection logic Perform nested event checks before re-injecting exceptions/events into L2. If a pending exception causes VM-Exit to L1, re-injecting events into vmcs02 is premature and wasted effort. Take care to ensure events that need to be re-injected are still re-injected if checking for nested events "fails", i.e. if KVM needs to force an immediate entry+exit to complete the to-be-re-injecteed event. Keep the "can_inject" logic the same for now; it too can be pushed below the nested checks, but is a slightly riskier change (see past bugs about events not being properly purged on nested VM-Exit). Add and/or modify comments to better document the various interactions. Of note is the comment regarding "blocking" previously injected NMIs and IRQs if an exception is pending. The old comment isn't wrong strictly speaking, but it failed to capture the reason why the logic even exists. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-18-seanjc@google.com Signed-off-by: Paolo Bonzini commit 81601495c5f9839b76eef4edb920b2f101f2fc77 Author: Sean Christopherson Date: Tue Aug 30 23:16:03 2022 +0000 KVM: x86: Use kvm_queue_exception_e() to queue #DF Queue #DF by recursing on kvm_multiple_exception() by way of kvm_queue_exception_e() instead of open coding the behavior. This will allow KVM to Just Work when a future commit moves exception interception checks (for L2 => L1) into kvm_multiple_exception(). No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-17-seanjc@google.com Signed-off-by: Paolo Bonzini commit 72c14e00bdc445e96045c28d04bba45cbe69cf95 Author: Sean Christopherson Date: Tue Aug 30 23:16:02 2022 +0000 KVM: x86: Formalize blocking of nested pending exceptions Capture nested_run_pending as block_pending_exceptions so that the logic of why exceptions are blocked only needs to be documented once instead of at every place that employs the logic. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-16-seanjc@google.com Signed-off-by: Paolo Bonzini commit d4963e319f1f7851a098df6610a27f9f4cf6d42a Author: Sean Christopherson Date: Tue Aug 30 23:16:01 2022 +0000 KVM: x86: Make kvm_queued_exception a properly named, visible struct Move the definition of "struct kvm_queued_exception" out of kvm_vcpu_arch in anticipation of adding a second instance in kvm_vcpu_arch to handle exceptions that occur when vectoring an injected exception and are morphed to VM-Exit instead of leading to #DF. Opportunistically take advantage of the churn to rename "nr" to "vector". No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-15-seanjc@google.com Signed-off-by: Paolo Bonzini commit 6ad75c5c99f78e28b6ff2a44be167cd857270405 Author: Sean Christopherson Date: Tue Aug 30 23:16:00 2022 +0000 KVM: x86: Rename kvm_x86_ops.queue_exception to inject_exception Rename the kvm_x86_ops hook for exception injection to better reflect reality, and to align with pretty much every other related function name in KVM. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-14-seanjc@google.com Signed-off-by: Paolo Bonzini commit bfcb08a0b9e99b959814a329fabace22c3df046d Author: Sean Christopherson Date: Tue Aug 30 23:15:59 2022 +0000 KVM: VMX: Inject #PF on ENCLS as "emulated" #PF Treat #PFs that occur during emulation of ENCLS as, wait for it, emulated page faults. Practically speaking, this is a glorified nop as the exception is never of the nested flavor, and it's extremely unlikely the guest is relying on the side effect of an implicit INVLPG on the faulting address. Fixes: 70210c044b4e ("KVM: VMX: Add SGX ENCLS[ECREATE] handler to enforce CPUID restrictions") Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-13-seanjc@google.com Signed-off-by: Paolo Bonzini commit 593a5c2e3c12a2f65967739267093255c47e9fe0 Author: Sean Christopherson Date: Tue Aug 30 23:15:58 2022 +0000 KVM: nVMX: Unconditionally clear mtf_pending on nested VM-Exit Clear mtf_pending on nested VM-Exit instead of handling the clear on a case-by-case basis in vmx_check_nested_events(). The pending MTF should never survive nested VM-Exit, as it is a property of KVM's run of the current L2, i.e. should never affect the next L2 run by L1. In practice, this is likely a nop as getting to L1 with nested_run_pending is impossible, and KVM doesn't correctly handle morphing a pending exception that occurs on a prior injected exception (need for re-injected exception being the other case where MTF isn't cleared). However, KVM will hopefully soon correctly deal with a pending exception on top of an injected exception. Add a TODO to document that KVM has an inversion priority bug between SMIs and MTF (and trap-like #DBS), and that KVM also doesn't properly save/restore MTF across SMI/RSM. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-12-seanjc@google.com Signed-off-by: Paolo Bonzini commit c2086eca86585bfd8132dd91e802497a202185c8 Author: Sean Christopherson Date: Tue Aug 30 23:15:57 2022 +0000 KVM: nVMX: Ignore SIPI that arrives in L2 when vCPU is not in WFS Fall through to handling other pending exception/events for L2 if SIPI is pending while the CPU is not in Wait-for-SIPI. KVM correctly ignores the event, but incorrectly returns immediately, e.g. a SIPI coincident with another event could lead to KVM incorrectly routing the event to L1 instead of L2. Fixes: bf0cd88ce363 ("KVM: x86: emulate wait-for-SIPI and SIPI-VMExit") Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-11-seanjc@google.com Signed-off-by: Paolo Bonzini commit 0701ec903e6bf1fcc07f92e64ca8474d151844da Author: Sean Christopherson Date: Tue Aug 30 23:15:56 2022 +0000 KVM: x86: Use DR7_GD macro instead of open coding check in emulator Use DR7_GD in the emulator instead of open coding the check, and drop a comically wrong comment. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-10-seanjc@google.com Signed-off-by: Paolo Bonzini commit 5623f751bd9c438ed12840e086f33c4646440d19 Author: Sean Christopherson Date: Tue Aug 30 23:15:55 2022 +0000 KVM: x86: Treat #DBs from the emulator as fault-like (code and DR7.GD=1) Add a dedicated "exception type" for #DBs, as #DBs can be fault-like or trap-like depending the sub-type of #DB, and effectively defer the decision of what to do with the #DB to the caller. For the emulator's two calls to exception_type(), treat the #DB as fault-like, as the emulator handles only code breakpoint and general detect #DBs, both of which are fault-like. For event injection, which uses exception_type() to determine whether to set EFLAGS.RF=1 on the stack, keep the current behavior of not setting RF=1 for #DBs. Intel and AMD explicitly state RF isn't set on code #DBs, so exempting by failing the "== EXCPT_FAULT" check is correct. The only other fault-like #DB is General Detect, and despite Intel and AMD both strongly implying (through omission) that General Detect #DBs should set RF=1, hardware (multiple generations of both Intel and AMD), in fact does not. Through insider knowledge, extreme foresight, sheer dumb luck, or some combination thereof, KVM correctly handled RF for General Detect #DBs. Fixes: 38827dbd3fb8 ("KVM: x86: Do not update EFLAGS on faulting emulation") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-9-seanjc@google.com Signed-off-by: Paolo Bonzini commit b9d44f9091ac6c325fc2f7b7671b462fb36abbed Author: Sean Christopherson Date: Tue Aug 30 23:15:54 2022 +0000 KVM: nVMX: Prioritize TSS T-flag #DBs over Monitor Trap Flag Service TSS T-flag #DBs prior to pending MTFs, as such #DBs are higher priority than MTF. KVM itself doesn't emulate TSS #DBs, and any such exceptions injected from L1 will be handled by hardware (or morphed to a fault-like exception if injection fails), but theoretically userspace could pend a TSS T-flag #DB in conjunction with a pending MTF. Note, there's no known use case this fixes, it's purely to be technically correct with respect to Intel's SDM. Cc: Oliver Upton Cc: Peter Shier Fixes: 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing instruction emulation") Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-8-seanjc@google.com Signed-off-by: Paolo Bonzini commit 8d178f460772ecdee8e6d72389b43a8d35a14ff5 Author: Sean Christopherson Date: Tue Aug 30 23:15:53 2022 +0000 KVM: nVMX: Treat General Detect #DB (DR7.GD=1) as fault-like Exclude General Detect #DBs, which have fault-like behavior but also have a non-zero payload (DR6.BD=1), from nVMX's handling of pending debug traps. Opportunistically rewrite the comment to better document what is being checked, i.e. "has a non-zero payload" vs. "has a payload", and to call out the many caveats surrounding #DBs that KVM dodges one way or another. Cc: Oliver Upton Cc: Peter Shier Fixes: 684c0422da71 ("KVM: nVMX: Handle pending #DB when injecting INIT VM-exit") Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-7-seanjc@google.com Signed-off-by: Paolo Bonzini commit baf67ca8e545b6ac77a7e2abd52b9961e672f8f0 Author: Sean Christopherson Date: Tue Aug 30 23:15:52 2022 +0000 KVM: x86: Suppress code #DBs on Intel if MOV/POP SS blocking is active Suppress code breakpoints if MOV/POP SS blocking is active and the guest CPU is Intel, i.e. if the guest thinks it's running on an Intel CPU. Intel CPUs inhibit code #DBs when MOV/POP SS blocking is active, whereas AMD (and its descendents) do not. Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830231614.3580124-6-seanjc@google.com Signed-off-by: Paolo Bonzini commit d500e1ed3dc873818277e109ccf6407118669236 Author: Sean Christopherson Date: Tue Aug 30 23:15:51 2022 +0000 KVM: x86: Allow clearing RFLAGS.RF on forced emulation to test code #DBs Extend force_emulation_prefix to an 'int' and use bit 1 as a flag to indicate that KVM should clear RFLAGS.RF before emulating, e.g. to allow tests to force emulation of code breakpoints in conjunction with MOV/POP SS blocking, which is impossible without KVM intervention as VMX unconditionally sets RFLAGS.RF on intercepted #UD. Make the behavior controllable so that tests can also test RFLAGS.RF=1 (again in conjunction with code #DBs). Note, clearing RFLAGS.RF won't create an infinite #DB loop as the guest's IRET from the #DB handler will return to the instruction and not the prefix, i.e. the restart won't force emulation. Opportunistically convert the permissions to the preferred octal format. Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830231614.3580124-5-seanjc@google.com Signed-off-by: Paolo Bonzini commit 750f8fcb261ae350af7a2467721e76082b527cbf Author: Sean Christopherson Date: Tue Aug 30 23:15:50 2022 +0000 KVM: x86: Don't check for code breakpoints when emulating on exception Don't check for code breakpoints during instruction emulation if the emulation was triggered by exception interception. Code breakpoints are the highest priority fault-like exception, and KVM only emulates on exceptions that are fault-like. Thus, if hardware signaled a different exception, then the vCPU is already passed the stage of checking for hardware breakpoints. This is likely a glorified nop in terms of functionality, and is more for clarification and is technically an optimization. Intel's SDM explicitly states vmcs.GUEST_RFLAGS.RF on exception interception is the same as the value that would have been saved on the stack had the exception not been intercepted, i.e. will be '1' due to all fault-like exceptions setting RF to '1'. AMD says "guest state saved ... is the processor state as of the moment the intercept triggers", but that begs the question, "when does the intercept trigger?". Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-4-seanjc@google.com Signed-off-by: Paolo Bonzini commit eba9799b5a6efe2993cf92529608e4aa8163d73b Author: Sean Christopherson Date: Tue Aug 30 23:15:49 2022 +0000 KVM: VMX: Drop bits 31:16 when shoving exception error code into VMCS Deliberately truncate the exception error code when shoving it into the VMCS (VM-Entry field for vmcs01 and vmcs02, VM-Exit field for vmcs12). Intel CPUs are incapable of handling 32-bit error codes and will never generate an error code with bits 31:16, but userspace can provide an arbitrary error code via KVM_SET_VCPU_EVENTS. Failure to drop the bits on exception injection results in failed VM-Entry, as VMX disallows setting bits 31:16. Setting the bits on VM-Exit would at best confuse L1, and at worse induce a nested VM-Entry failure, e.g. if L1 decided to reinject the exception back into L2. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-3-seanjc@google.com Signed-off-by: Paolo Bonzini commit d953540430c5af57f5de97ea9e36253908204027 Author: Sean Christopherson Date: Tue Aug 30 23:15:48 2022 +0000 KVM: nVMX: Unconditionally purge queued/injected events on nested "exit" Drop pending exceptions and events queued for re-injection when leaving nested guest mode, even if the "exit" is due to VM-Fail, SMI, or forced by host userspace. Failure to purge events could result in an event belonging to L2 being injected into L1. This _should_ never happen for VM-Fail as all events should be blocked by nested_run_pending, but it's possible if KVM, not the L1 hypervisor, is the source of VM-Fail when running vmcs02. SMI is a nop (barring unknown bugs) as recognition of SMI and thus entry to SMM is blocked by pending exceptions and re-injected events. Forced exit is definitely buggy, but has likely gone unnoticed because userspace probably follows the forced exit with KVM_SET_VCPU_EVENTS (or some other ioctl() that purges the queue). Fixes: 4f350c6dbcb9 ("kvm: nVMX: Handle deferred early VMLAUNCH/VMRESUME failure properly") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220830231614.3580124-2-seanjc@google.com Signed-off-by: Paolo Bonzini commit 794663e13f8815bf85d87dcef796ef2c55bf270a Author: Hou Wenlong Date: Fri Sep 2 10:47:01 2022 +0800 KVM: x86: Add missing trace points for RDMSR/WRMSR in emulator path Since the RDMSR/WRMSR emulation uses a sepearte emualtor interface, the trace points for RDMSR/WRMSR can be added in emulator path like normal path. Signed-off-by: Hou Wenlong Link: https://lore.kernel.org/r/39181a9f777a72d61a4d0bb9f6984ccbd1de2ea3.1661930557.git.houwenlong.hwl@antgroup.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 36d546d59af7cfc984b159016bed3e2a3113266f Author: Hou Wenlong Date: Fri Sep 2 10:47:00 2022 +0800 KVM: x86: Return emulator error if RDMSR/WRMSR emulation failed The return value of emulator_{get|set}_mst_with_filter() is confused, since msr access error and emulator error are mixed. Although, KVM_MSR_RET_* doesn't conflict with X86EMUL_IO_NEEDED at present, it is better to convert msr access error to emulator error if error value is needed. So move "r < 0" handling for wrmsr emulation into the set helper function, then only X86EMUL_* is returned in the helper functions. Also add "r < 0" check in the get helper function, although KVM doesn't return -errno today, but assuming that will always hold true is unnecessarily risking. Suggested-by: Sean Christopherson Signed-off-by: Hou Wenlong Link: https://lore.kernel.org/r/09b2847fc3bcb8937fb11738f0ccf7be7f61d9dd.1661930557.git.houwenlong.hwl@antgroup.com [sean: wrap changelog less aggressively] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit b85a97b851ca295fb475fa10ca5f0c83a8852cf7 Author: Jilin Yuan Date: Wed Aug 31 20:52:17 2022 +0800 KVM: x86/mmu: fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: Jilin Yuan Link: https://lore.kernel.org/r/20220831125217.12313-1-yuanjilin@cdjrlc.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 37d145ef62ff4f424ed05f8c99dc1c9ec67ff133 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:37 2022 +0200 KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up nested MSR vmcs_config has cached host MSR_IA32_VMX_MISC value, use it for setting up nested MSR_IA32_VMX_MISC in nested_vmx_setup_ctls_msrs() and avoid the redundant rdmsr(). No (real) functional change intended. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-34-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 0809d9b05a9154edecbd02649ddab296f4e9a227 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:36 2022 +0200 KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config Like other host VMX control MSRs, MSR_IA32_VMX_MISC can be cached in vmcs_config to avoid the need to re-read it later, e.g. from cpu_has_vmx_intel_pt() or cpu_has_vmx_shadow_vmcs(). No (real) functional change intended. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-33-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit bcdf201f8a4d09663b0608d5c9fce802558af3d7 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:35 2022 +0200 KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs Using raw host MSR values for setting up nested VMX control MSRs is incorrect as some features need to disabled, e.g. when KVM runs as a nested hypervisor on Hyper-V and uses Enlightened VMCS or when a workaround for IA32_PERF_GLOBAL_CTRL is applied. For non-nested VMX, this is done in setup_vmcs_config() and the result is stored in vmcs_config. Use it for setting up allowed-1 bits in nested VMX MSRs too. Suggested-by: Sean Christopherson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-32-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 66a329be4b0abc81ee3d9a7e4f77f5f33f435362 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:34 2022 +0200 KVM: nVMX: Always set required-1 bits of pinbased_ctls to PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR Similar to exit_ctls_low, entry_ctls_low, and procbased_ctls_low, pinbased_ctls_low should be set to PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR and not host's MSR_IA32_VMX_PINBASED_CTLS value |= PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR. The commit eabeaaccfca0 ("KVM: nVMX: Clean up and fix pin-based execution controls") which introduced '|=' doesn't mention anything about why this is needed, the change seems rather accidental. Note: normally, required-1 portion of MSR_IA32_VMX_PINBASED_CTLS should be equal to PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR so no behavioral change is expected, however, it is (in theory) possible to observe something different there when e.g. KVM is running as a nested hypervisor. Hope this doesn't happen in practice. Reported-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-31-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 9d78d6fb186bc4aff41b5d6c4726b76649d3cb53 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:33 2022 +0200 KVM: VMX: Move LOAD_IA32_PERF_GLOBAL_CTRL errata handling out of setup_vmcs_config() As a preparation to reusing the result of setup_vmcs_config() for setting up nested VMX control MSRs, move LOAD_IA32_PERF_GLOBAL_CTRL errata handling to vmx_vmexit_ctrl()/vmx_vmentry_ctrl() and print the warning from hardware_setup(). While it seems reasonable to not expose LOAD_IA32_PERF_GLOBAL_CTRL controls to L1 hypervisor on buggy CPUs, such change would inevitably break live migration from older KVMs where the controls are exposed. Keep the status quo for now, L1 hypervisor itself is supposed to take care of the errata. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-30-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit aef46a6476bbb48cd0d486c9e5d0b9ada2f48a6f Author: Jim Mattson Date: Tue Aug 30 15:37:32 2022 +0200 KVM: x86: VMX: Replace some Intel model numbers with mnemonics Intel processor code names are more familiar to many readers than their decimal model numbers. Signed-off-by: Jim Mattson Reviewed-by: Sean Christopherson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-29-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 64f80ea73b358265ee36fd827791bbd9a6069c52 Author: Sean Christopherson Date: Tue Aug 30 15:37:31 2022 +0200 KVM: VMX: Adjust CR3/INVPLG interception for EPT=y at runtime, not setup Clear the CR3 and INVLPG interception controls at runtime based on whether or not EPT is being _used_, as opposed to clearing the bits at setup if EPT is _supported_ in hardware, and then restoring them when EPT is not used. Not mucking with the base config will allow using the base config as the starting point for emulating the VMX capability MSRs. Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-28-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit a83bea73fa04b8551e1a38f75825a12eb6c7b3ae Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:30 2022 +0200 KVM: VMX: Add missing CPU based VM execution controls to vmcs_config As a preparation to reusing the result of setup_vmcs_config() in nested VMX MSR setup, add the CPU based VM execution controls which KVM doesn't use but supports for nVMX to KVM_OPT_VMX_CPU_BASED_VM_EXEC_CONTROL and filter them out in vmx_exec_control(). No functional change intended. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-27-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit f16e47429e46cbf9add0d665399646aae909b693 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:29 2022 +0200 KVM: VMX: Add missing VMEXIT controls to vmcs_config As a preparation to reusing the result of setup_vmcs_config() in nested VMX MSR setup, add the VMEXIT controls which KVM doesn't use but supports for nVMX to KVM_OPT_VMX_VM_EXIT_CONTROLS and filter them out in vmx_vmexit_ctrl(). No functional change intended. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-26-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit e89e1e2302d3db96ebc430ab24bef200d94d8cb8 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:28 2022 +0200 KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() As a preparation to reusing the result of setup_vmcs_config() in nested VMX MSR setup, move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering to vmx_exec_control(). No functional change intended. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Reviewed-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-25-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit ee087b4da022978a51fa3b363eea82c8bab8c3b5 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:27 2022 +0200 KVM: VMX: Extend VMX controls macro shenanigans When VMX controls macros are used to set or clear a control bit, make sure that this bit was checked in setup_vmcs_config() and thus is properly reflected in vmcs_config. Opportunistically drop pointless "< 0" check for adjust_vmx_controls()'s return value. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-24-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit ebb3c8d4094d9248ad026291740c27c6310cf1f4 Author: Sean Christopherson Date: Tue Aug 30 15:37:26 2022 +0200 KVM: VMX: Don't toggle VM_ENTRY_IA32E_MODE for 32-bit kernels/KVM Don't toggle VM_ENTRY_IA32E_MODE in 32-bit kernels/KVM and instead bug the VM if KVM attempts to run the guest with EFER.LMA=1. KVM doesn't support running 64-bit guests with 32-bit hosts. Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-23-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 1dae276569bd30ab6f3069179e5ffffed462b71e Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:25 2022 +0200 KVM: VMX: Tweak the special handling of SECONDARY_EXEC_ENCLS_EXITING in setup_vmcs_config() SECONDARY_EXEC_ENCLS_EXITING is the only control which is conditionally added to the 'optional' checklist in setup_vmcs_config() but the special case can be avoided by always checking for its presence first and filtering out the result later. Note: the situation when SECONDARY_EXEC_ENCLS_EXITING is present but cpu_has_sgx() is false is possible when SGX is "soft-disabled", e.g. if software writes MCE control MSRs or there's an uncorrectable #MC. Reviewed-by: Jim Mattson Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-22-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 378c4c18509b9eb268a18e03cc1c7e531a97f550 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:24 2022 +0200 KVM: VMX: Check CPU_BASED_{INTR,NMI}_WINDOW_EXITING in setup_vmcs_config() CPU_BASED_{INTR,NMI}_WINDOW_EXITING controls are toggled dynamically by vmx_enable_{irq,nmi}_window, handle_interrupt_window(), handle_nmi_window() but setup_vmcs_config() doesn't check their existence. Add the check and filter the controls out in vmx_exec_control(). Note: KVM explicitly supports CPUs without VIRTUAL_NMIS and all these CPUs are supposedly lacking NMI_WINDOW_EXITING too. Adjust cpu_has_virtual_nmis() accordingly. No functional change intended. Reviewed-by: Maxim Levitsky Reviewed-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-21-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit ffaaf5913f8ce8b2ad0cad8c203de9ecfb51b61b Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:23 2022 +0200 KVM: VMX: Check VM_ENTRY_IA32E_MODE in setup_vmcs_config() VM_ENTRY_IA32E_MODE control is toggled dynamically by vmx_set_efer() and setup_vmcs_config() doesn't check its existence. On the contrary, nested_vmx_setup_ctls_msrs() doesn set it on x86_64. Add the missing check and filter the bit out in vmx_vmentry_ctrl(). No (real) functional change intended as all existing CPUs supporting long mode and VMX are supposed to have it. Reviewed-by: Maxim Levitsky Reviewed-by: Jim Mattson Reviewed-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-20-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit f4c93d1a0e7190b61be25658519fe74c8c9f086a Author: Sean Christopherson Date: Tue Aug 30 15:37:22 2022 +0200 KVM: nVMX: Always emulate PERF_GLOBAL_CTRL VM-Entry/VM-Exit controls Advertise VM_{ENTRY,EXIT}_LOAD_IA32_PERF_GLOBAL_CTRL as being supported for nested VMs irrespective of hardware support. KVM fully emulates the controls, i.e. manually emulates MSR writes on entry/exit, and never propagates the guest settings directly to vmcs02. In addition to allowing L1 VMMs to use the controls on older hardware, unconditionally advertising the controls will also allow KVM to use its vmcs01 configuration as the basis for the nested VMX configuration without causing a regression (due the errata which causes KVM to "hide" the control from vmcs01 but not vmcs12). Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-19-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit def9d705c05eab3fdedeb10ad67907513b12038e Author: Sean Christopherson Date: Tue Aug 30 15:37:21 2022 +0200 KVM: nVMX: Don't propagate vmcs12's PERF_GLOBAL_CTRL settings to vmcs02 Don't propagate vmcs12's VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL to vmcs02. KVM doesn't disallow L1 from using VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL even when KVM itself doesn't use the control, e.g. due to the various CPU errata that where the MSR can be corrupted on VM-Exit. Preserve KVM's (vmcs01) setting to hopefully avoid having to toggle the bit in vmcs02 at a later point. E.g. if KVM is loading PERF_GLOBAL_CTRL when running L1, then odds are good KVM will also load the MSR when running L2. Fixes: 8bf00a529967 ("KVM: VMX: add support for switching of PERF_GLOBAL_CTRL") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20220830133737.1539624-18-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 9bcb90650e314ee8ac748f319ffcd2c1d7f53632 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:20 2022 +0200 KVM: VMX: Get rid of eVMCS specific VMX controls sanitization With the updated eVMCSv1 definition, there's no known 'problematic' controls which are exposed in VMX control MSRs but are not present in eVMCSv1: all known Hyper-V versions either don't expose the new fields by not setting bits in the VMX feature controls or support the new eVMCS revision. Get rid of VMX control MSRs filtering for KVM on Hyper-V. Note: VMX control MSRs filtering for Hyper-V on KVM (nested_evmcs_filter_control_msr()) stays as even the updated eVMCSv1 definition doesn't have all the features implemented by KVM and some fields are still missing. Moreover, nested_evmcs_filter_control_msr() has to support the original eVMCSv1 version when VMM wishes so. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-17-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 4da77090b0fcec1aa430e67631a1474343a33738 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:19 2022 +0200 KVM: nVMX: Support PERF_GLOBAL_CTRL with enlightened VMCS Enlightened VMCS v1 got updated and now includes the required fields for loading PERF_GLOBAL_CTRL upon VMENTER/VMEXIT features. For KVM on Hyper-V enablement, KVM can just observe VMX control MSRs and use the features (with or without eVMCS) when possible. Hyper-V on KVM is messier as Windows 11 guests fail to boot if the controls are advertised and a new PV feature flag, CPUID.0x4000000A.EBX BIT(0), is not set. Honor the Hyper-V CPUID feature flag to play nice with Windows guests. Signed-off-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20220830133737.1539624-16-vkuznets@redhat.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 3ff8a13d41b283932ec6ac692c6def22a157269b Author: Sean Christopherson Date: Tue Aug 30 15:37:18 2022 +0200 KVM: nVMX: WARN once and fail VM-Enter if eVMCS sees VMFUNC[63:32] != 0 WARN and reject nested VM-Enter if KVM is using eVMCS and manages to allow a non-zero value in the upper 32 bits of VM-function controls. The eVMCS code assumes all inputs are 32-bit values and subtly drops the upper bits. WARN instead of adding proper "support", it's unlikely the upper bits will be defined/used in the next decade. Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-15-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 8174193163095238e70e0decd121feb4b9ef8cc0 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:17 2022 +0200 KVM: selftests: Switch to updated eVMCSv1 definition Update Enlightened VMCS definition in selftests from KVM. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-14-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit a0fa4b7abf416dcea483a2e0d8f978314e72f2b6 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:16 2022 +0200 KVM: selftests: Add ENCLS_EXITING_BITMAP{,HIGH} VMCS fields The updated Enlightened VMCS definition has 'encls_exiting_bitmap' field which needs mapping to VMCS, add the missing encoding. Reviewed-by: Maxim Levitsky Reviewed-by: Kai Huang Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-13-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit dea6e140d927b8d9b299f972eac5574de71bc75f Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:15 2022 +0200 KVM: x86: hyper-v: Cache HYPERV_CPUID_NESTED_FEATURES CPUID leaf KVM has to check guest visible HYPERV_CPUID_NESTED_FEATURES.EBX CPUID leaf to know which Enlightened VMCS definition to use (original or 2022 update). Cache the leaf along with other Hyper-V CPUID feature leaves to make the check quick. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-12-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit c9d31986e86d0f4e237f17d2d56e5c6bcf1d9d12 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:14 2022 +0200 KVM: nVMX: Support several new fields in eVMCSv1 Enlightened VMCS v1 definition was updated with new fields, add support for them for Hyper-V on KVM. Note: SSP, CET and Guest LBR features are not supported by KVM yet and 'struct vmcs12' has no corresponding fields. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-11-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit b19e4ff5e5582217b0c1d2df3e4e1451b6c91e5d Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:13 2022 +0200 KVM: VMX: Define VMCS-to-EVMCS conversion for the new fields Enlightened VMCS v1 definition was updated with new fields, support them in KVM by defining VMCS-to-EVMCS conversion. Note: SSP, CET and Guest LBR features are not supported by KVM yet and the corresponding fields are not defined in 'enum vmcs_field', leave them commented out for now. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-10-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 6cce93de28c23ca0272111ec1eeeee4da6545722 Author: Sean Christopherson Date: Tue Aug 30 15:37:12 2022 +0200 KVM: nVMX: Use CC() macro to handle eVMCS unsupported controls checks Locally #define and use the nested virtualization Consistency Check (CC) macro to handle eVMCS unsupported controls checks. Using the macro loses the existing printing of the unsupported controls, but that's a feature and not a bug. The existing approach is flawed because the @err param to trace_kvm_nested_vmenter_failed() is the error code, not the error value. The eVMCS trickery mostly works as __print_symbolic() falls back to printing the raw hex value, but that subtly relies on not having a match between the unsupported value and VMX_VMENTER_INSTRUCTION_ERRORS. If it's really truly necessary to snapshot the bad value, then the tracepoint can be extended in the future. Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-9-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit f4d361b4c29477dbcc6e436b9425ee2716aecc6e Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:11 2022 +0200 KVM: nVMX: Refactor unsupported eVMCS controls logic to use 2-d array Refactor the handling of unsupported eVMCS to use a 2-d array to store the set of unsupported controls. KVM's handling of eVMCS is completely broken as there is no way for userspace to query which features are unsupported, nor does KVM prevent userspace from attempting to enable unsupported features. A future commit will remedy that by filtering and enforcing unsupported features when eVMCS, but that needs to be opt-in from userspace to avoid breakage, i.e. KVM needs to maintain its legacy behavior by snapshotting the exact set of controls that are currently (un)supported by eVMCS. No functional change intended. Suggested-by: Paolo Bonzini Signed-off-by: Vitaly Kuznetsov [sean: split to standalone patch, write changelog] Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-8-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 85ab071af83952a44473e3d02304c17053ade2f4 Author: Sean Christopherson Date: Tue Aug 30 15:37:10 2022 +0200 KVM: nVMX: Treat eVMCS as enabled for guest iff Hyper-V is also enabled When querying whether or not eVMCS is enabled on behalf of the guest, treat eVMCS as enable if and only if Hyper-V is enabled/exposed to the guest. Note, flows that come from the host, e.g. KVM_SET_NESTED_STATE, must NOT check for Hyper-V being enabled as KVM doesn't require guest CPUID to be set before most ioctls(). Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-7-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 3be29eb7b5251a772e2033761a9b67981fdfb0f7 Author: Sean Christopherson Date: Tue Aug 30 15:37:09 2022 +0200 KVM: x86: Report error when setting CPUID if Hyper-V allocation fails Return -ENOMEM back to userspace if allocating the Hyper-V vCPU struct fails when enabling Hyper-V in guest CPUID. Silently ignoring failure means that KVM will not have an up-to-date CPUID cache if allocating the struct succeeds later on, e.g. when activating SynIC. Rejecting the CPUID operation also guarantess that vcpu->arch.hyperv is non-NULL if hyperv_enabled is true, which will allow for additional cleanup, e.g. in the eVMCS code. Note, the initialization needs to be done before CPUID is set, and more subtly before kvm_check_cpuid(), which potentially enables dynamic XFEATURES. Sadly, there's no easy way to avoid exposing Hyper-V details to CPUID or vice versa. Expose kvm_hv_vcpu_init() and the Hyper-V CPUID signature to CPUID instead of exposing cpuid_entry2_find() outside of CPUID code. It's hard to envision kvm_hv_vcpu_init() being misused, whereas cpuid_entry2_find() absolutely shouldn't be used outside of core CPUID code. Fixes: 10d7bf1e46dc ("KVM: x86: hyper-v: Cache guest CPUID leaves determining features availability") Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-6-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 1cac8d9f6bd25df3713103e44e2d9ca0c2e03c33 Author: Sean Christopherson Date: Tue Aug 30 15:37:08 2022 +0200 KVM: x86: Check for existing Hyper-V vCPU in kvm_hv_vcpu_init() When potentially allocating/initializing the Hyper-V vCPU struct, check for an existing instance in kvm_hv_vcpu_init() instead of requiring callers to perform the check. Relying on callers to do the check is risky as it's all too easy for KVM to overwrite vcpu->arch.hyperv and leak memory, and it adds additional burden on callers without much benefit. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Reviewed-by: Wei Liu Link: https://lore.kernel.org/r/20220830133737.1539624-5-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit ce2196b831b1e9f8982b2904fc3e8658cc0e6573 Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:07 2022 +0200 KVM: x86: Zero out entire Hyper-V CPUID cache before processing entries Wipe the whole 'hv_vcpu->cpuid_cache' with memset() instead of having to zero each particular member when the corresponding CPUID entry was not found. No functional change intended. Signed-off-by: Vitaly Kuznetsov [sean: split to separate patch] Signed-off-by: Sean Christopherson Reviewed-by: Wei Liu Link: https://lore.kernel.org/r/20220830133737.1539624-4-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 5ef384a60f22f70a99b45f769144761de37b037c Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:06 2022 +0200 x86/hyperv: Update 'struct hv_enlightened_vmcs' definition Updated Hyper-V Enlightened VMCS specification lists several new fields for the following features: - PerfGlobalCtrl - EnclsExitingBitmap - Tsc Scaling - GuestLbrCtl - CET - SSP Update the definition. Note, the updated spec also provides an additional CPUID feature flag, CPUIDD.0x4000000A.EBX BIT(0), for PerfGlobalCtrl to workaround a Windows 11 quirk. Despite what the TLFS says: Indicates support for the GuestPerfGlobalCtrl and HostPerfGlobalCtrl fields in the enlightened VMCS. guests can safely use the fields if they are enumerated in the architectural VMX MSRs. I.e. KVM-on-HyperV doesn't need to check the CPUID bit, but KVM-as-HyperV must ensure the bit is set if PerfGlobalCtrl fields are exposed to L1. https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/tlfs Signed-off-by: Vitaly Kuznetsov [sean: tweak CPUID name to make it PerfGlobalCtrl only] Signed-off-by: Sean Christopherson Acked-by: Wei Liu Link: https://lore.kernel.org/r/20220830133737.1539624-3-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit ea9da788a61e47e7ab9cbad397453e51cd82ac0d Author: Vitaly Kuznetsov Date: Tue Aug 30 15:37:05 2022 +0200 x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition Section 1.9 of TLFS v6.0b says: "All structures are padded in such a way that fields are aligned naturally (that is, an 8-byte field is aligned to an offset of 8 bytes and so on)". 'struct enlightened_vmcs' has a glitch: ... struct { u32 nested_flush_hypercall:1; /* 836: 0 4 */ u32 msr_bitmap:1; /* 836: 1 4 */ u32 reserved:30; /* 836: 2 4 */ } hv_enlightenments_control; /* 836 4 */ u32 hv_vp_id; /* 840 4 */ u64 hv_vm_id; /* 844 8 */ u64 partition_assist_page; /* 852 8 */ ... And the observed values in 'partition_assist_page' make no sense at all. Fix the layout by padding the structure properly. Fixes: 68d1eb72ee99 ("x86/hyper-v: define struct hv_enlightened_vmcs and clean field bits") Reviewed-by: Maxim Levitsky Reviewed-by: Michael Kelley Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-2-vkuznets@redhat.com Signed-off-by: Paolo Bonzini commit 5f5651c67311fd10d2309339005db5118f29621d Author: Oliver Upton Date: Fri Aug 12 17:53:01 2022 +0000 KVM: selftests: Require DISABLE_NX_HUGE_PAGES cap for NX hugepage test Require KVM_CAP_VM_DISABLE_NX_HUGE_PAGES for the entire NX hugepage test instead of skipping the "disable" subtest if the capability isn't supported by the host kernel. While the "enable" subtest does provide value when the capability isn't supported, silently providing only half the promised coveraged is undesirable, i.e. it's better to skip the test so that the user knows something. Alternatively, the test could print something to alert the user instead of silently skipping the subtest, but that would encourage other tests to follow suit, and it's not clear that it's desirable to take selftests in that direction. And if selftests do head down the path of skipping subtests, such behavior needs first-class support in the framework. Opportunistically convert other test preconditions to TEST_REQUIRE(). Signed-off-by: Oliver Upton Reviewed-by: David Matlack Link: https://lore.kernel.org/r/20220812175301.3915004-1-oliver.upton@linux.dev [sean: rewrote changelog to capture discussion about skipping the test] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 57abfa11ba9b64d123289e261ddb05775f4fd3ac Author: Uros Bizjak Date: Wed Aug 17 16:40:45 2022 +0200 KVM: VMX: Do not declare vmread_error() asmlinkage There is no need to declare vmread_error() asmlinkage, its arguments can be passed via registers for both 32-bit and 64-bit targets. Function argument registers are considered call-clobbered registers, they are saved in the trampoline just before the function call and restored afterwards. Dropping "asmlinkage" patch unifies trampoline function argument handling between 32-bit and 64-bit targets and improves generated code for 32-bit targets. Cc: Paolo Bonzini Cc: Sean Christopherson Signed-off-by: Uros Bizjak Link: https://lore.kernel.org/r/20220817144045.3206-1-ubizjak@gmail.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e390f4d69da026149c8c80a7a2218e166d5643fc Author: Liam Ni Date: Thu Sep 8 22:12:10 2022 +0800 KVM:x86: Clean up ModR/M "reg" initialization in reg op decoding Refactor decode_register_operand() to get the ModR/M register if and only if the instruction uses a ModR/M encoding to make it more obvious how the register operand is retrieved. Signed-off-by: Liam Ni Link: https://lore.kernel.org/r/20220908141210.1375828-1-zhiguangni01@zhaoxin.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 02dfc44f205772f0edc0d8e58420205c1cf2f83b Author: Mingwei Zhang Date: Thu Aug 25 22:57:55 2022 +0000 KVM: x86: Print guest pgd in kvm_nested_vmenter() Print guest pgd in kvm_nested_vmenter() to enrich the information for tracing. When tdp is enabled, print the value of tdp page table (EPT/NPT); when tdp is disabled, print the value of non-nested CR3. Suggested-by: Sean Christopherson Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20220825225755.907001-4-mizhang@google.com [sean: print nested_cr3 vs. nested_eptp vs. guest_cr3] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 37ef0be269540028a375f28a68ac16979a4349df Author: David Matlack Date: Thu Aug 25 22:57:54 2022 +0000 KVM: nVMX: Add tracepoint for nested VM-Enter Call trace_kvm_nested_vmenter() during nested VMLAUNCH/VMRESUME to bring parity with nSVM's usage of the tracepoint during nested VMRUN. Attempt to use analagous VMCS fields to the VMCB fields that are reported in the SVM case: "int_ctl": 32-bit field of the VMCB that the CPU uses to deliver virtual interrupts. The analagous VMCS field is the 16-bit "guest interrupt status". "event_inj": 32-bit field of VMCB that is used to inject events (exceptions and interrupts) into the guest. The analagous VMCS field is the "VM-entry interruption-information field". "npt_enabled": 1 when the VCPU has enabled nested paging. The analagous VMCS field is the enable-EPT execution control. "npt_addr": 64-bit field when the VCPU has enabled nested paging. The analagous VMCS field is the ept_pointer. Signed-off-by: David Matlack [move the code into the nested_vmx_enter_non_root_mode().] Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20220825225755.907001-3-mizhang@google.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 89e54ec592324ed8b2b1eb41f91c1a4b724b0db5 Author: Mingwei Zhang Date: Thu Aug 25 22:57:53 2022 +0000 KVM: x86: Update trace function for nested VM entry to support VMX Update trace function for nested VM entry to support VMX. Existing trace function only supports nested VMX and the information printed out is AMD specific. So, rename trace_kvm_nested_vmrun() to trace_kvm_nested_vmenter(), since 'vmenter' is generic. Add a new field 'isa' to recognize Intel and AMD; Update the output to print out VMX/SVM related naming respectively, eg., vmcb vs. vmcs; npt vs. ept. Opportunistically update the call site of trace_kvm_nested_vmenter() to make one line per parameter. Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20220825225755.907001-2-mizhang@google.com [sean: align indentation, s/update/rename in changelog] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit bff0adc40c0050dbbcec74829ffa9ef5a5d29eba Author: Sean Christopherson Date: Tue Aug 30 12:26:24 2022 -0700 KVM: x86: Use u64 for address and error code in page fault tracepoint Track the address and error code as 64-bit values in the page fault tracepoint. When TDP is enabled, the address is a GPA and thus can be a 64-bit value even on 32-bit hosts. And SVM's #NPF genereates 64-bit error codes. Opportunistically clean up the formatting. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit faa03b39722a86e4b83e594151d1775875a0c7ca Author: Wonhyuk Yang Date: Tue May 10 16:10:00 2022 +0900 KVM: Add extra information in kvm_page_fault trace point Currently, kvm_page_fault trace point provide fault_address and error code. However it is not enough to find which cpu and instruction cause kvm_page_faults. So add vcpu id and instruction pointer in kvm_page_fault trace point. Cc: Baik Song An Cc: Hong Yeon Kim Cc: Taeung Song Cc: linuxgeek@linuxgeek.io Signed-off-by: Wonhyuk Yang Link: https://lore.kernel.org/r/20220510071001.87169-1-vvghjk1234@gmail.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit b5cb32b16ce7f757b53f14586bbdd05c3b7ebc29 Author: Aaron Lewis Date: Tue Jul 12 00:10:44 2022 +0000 KVM: x86: Delete duplicate documentation for KVM_X86_SET_MSR_FILTER Two copies of KVM_X86_SET_MSR_FILTER somehow managed to make it's way into the documentation. Remove one copy and merge the difference from the removed copy into the copy that's being kept. Fixes: fd49e8ee70b3 ("Merge branch 'kvm-sev-cgroup' into HEAD") Signed-off-by: Aaron Lewis Link: https://lore.kernel.org/r/20220712001045.2364298-2-aaronlewis@google.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit db25eb87ad42f6eb3dcc045e760fc9e23df3e845 Author: Paolo Bonzini Date: Fri Aug 19 12:56:43 2022 -0400 KVM: SVM: remove unnecessary check on INIT intercept Since svm_check_nested_events() is now handling INIT signals, there is no need to latch it until the VMEXIT is injected. The only condition under which INIT signals are latched is GIF=0. Suggested-by: Maxim Levitsky Signed-off-by: Paolo Bonzini Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20220819165643.83692-1-pbonzini@redhat.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit afe30b59d30b80d91c70664f58c05ba149ef3a5d Author: Uros Bizjak Date: Tue Aug 16 23:10:10 2022 +0200 KVM/VMX: Avoid stack engine synchronization uop in __vmx_vcpu_run Avoid instructions with explicit uses of the stack pointer between instructions that implicitly refer to it. The sequence of POP %reg; ADD $x, %RSP; POP %reg forces emission of synchronization uop to synchronize the value of the stack pointer in the stack engine and the out-of-order core. Using POP with the dummy register instead of ADD $x, %RSP results in a smaller code size and faster code. The patch also fixes the reference to the wrong register in the nearby comment. Cc: Paolo Bonzini Cc: Sean Christopherson Signed-off-by: Uros Bizjak Link: https://lore.kernel.org/r/20220816211010.25693-1-ubizjak@gmail.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 5a2a961be2ad6a16eb388a80442443b353c11d16 Author: Miaohe Lin Date: Tue Aug 23 14:34:14 2022 +0800 KVM: fix memoryleak in kvm_init() When alloc_cpumask_var_node() fails for a certain cpu, there might be some allocated cpumasks for percpu cpu_kick_mask. We should free these cpumasks or memoryleak will occur. Fixes: baff59ccdc65 ("KVM: Pre-allocate cpumasks for kvm_make_all_cpus_request_except()") Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220823063414.59778-1-linmiaohe@huawei.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 5c2a64252c5dc4cfe78e5b2a531c118894e3d155 Author: Gao Xiang Date: Fri Sep 23 09:49:15 2022 +0800 erofs: introduce partial-referenced pclusters Due to deduplication for compressed data, pclusters can be partially referenced with their prefixes. Together with the user-space implementation, it enables EROFS variable-length global compressed data deduplication with rolling hash. Link: https://lore.kernel.org/r/20220923014915.4362-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Signed-off-by: Gao Xiang commit b15b2e307c3a1970d92da77a3ef57ee53d119d8e Author: Yue Hu Date: Fri Sep 23 10:11:22 2022 +0800 erofs: support on-disk compressed fragments data Introduce on-disk compressed fragments data feature. This approach adds a new field called `h_fragmentoff' in the per-file compression header to indicate the fragment offset of each tail pcluster or the whole file in the special packed inode. Similar to ztailpacking, it will also find and record the 'headlcn' of the tail pcluster when initializing per-inode zmap for making follow-on requests more easy. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/YzHKxcFTlHGgXeH9@B-P7TQMD6M-0146.local Signed-off-by: Gao Xiang commit bec217197b412d74168c6a42fc0f76d0cc9cad00 Author: Liu Jian Date: Wed Sep 7 15:13:11 2022 +0800 skmsg: Schedule psock work if the cached skb exists on the psock In sk_psock_backlog function, for ingress direction skb, if no new data packet arrives after the skb is cached, the cached skb does not have a chance to be added to the receive queue of psock. As a result, the cached skb cannot be received by the upper-layer application. Fix this by reschedule the psock work to dispose the cached skb in sk_msg_recvmsg function. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220907071311.60534-1-liujian56@huawei.com commit 043a7356dbd0f44b2a2161649d89f4a43f3b0180 Author: Liu Jian Date: Tue Aug 23 21:37:55 2022 +0800 selftests/bpf: Add wait send memory test for sockmap redirect Add one test for wait redirect sock's send memory test for sockmap. Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220823133755.314697-3-liujian56@huawei.com commit 3f8ef65af927db247418d4e1db49164d7a158fc5 Author: Liu Jian Date: Tue Aug 23 21:37:54 2022 +0800 net: If sock is dead don't access sock's sk_wq in sk_stream_wait_memory Fixes the below NULL pointer dereference: [...] [ 14.471200] Call Trace: [ 14.471562] [ 14.471882] lock_acquire+0x245/0x2e0 [ 14.472416] ? remove_wait_queue+0x12/0x50 [ 14.473014] ? _raw_spin_lock_irqsave+0x17/0x50 [ 14.473681] _raw_spin_lock_irqsave+0x3d/0x50 [ 14.474318] ? remove_wait_queue+0x12/0x50 [ 14.474907] remove_wait_queue+0x12/0x50 [ 14.475480] sk_stream_wait_memory+0x20d/0x340 [ 14.476127] ? do_wait_intr_irq+0x80/0x80 [ 14.476704] do_tcp_sendpages+0x287/0x600 [ 14.477283] tcp_bpf_push+0xab/0x260 [ 14.477817] tcp_bpf_sendmsg_redir+0x297/0x500 [ 14.478461] ? __local_bh_enable_ip+0x77/0xe0 [ 14.479096] tcp_bpf_send_verdict+0x105/0x470 [ 14.479729] tcp_bpf_sendmsg+0x318/0x4f0 [ 14.480311] sock_sendmsg+0x2d/0x40 [ 14.480822] ____sys_sendmsg+0x1b4/0x1c0 [ 14.481390] ? copy_msghdr_from_user+0x62/0x80 [ 14.482048] ___sys_sendmsg+0x78/0xb0 [ 14.482580] ? vmf_insert_pfn_prot+0x91/0x150 [ 14.483215] ? __do_fault+0x2a/0x1a0 [ 14.483738] ? do_fault+0x15e/0x5d0 [ 14.484246] ? __handle_mm_fault+0x56b/0x1040 [ 14.484874] ? lock_is_held_type+0xdf/0x130 [ 14.485474] ? find_held_lock+0x2d/0x90 [ 14.486046] ? __sys_sendmsg+0x41/0x70 [ 14.486587] __sys_sendmsg+0x41/0x70 [ 14.487105] ? intel_pmu_drain_pebs_core+0x350/0x350 [ 14.487822] do_syscall_64+0x34/0x80 [ 14.488345] entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] The test scenario has the following flow: thread1 thread2 ----------- --------------- tcp_bpf_sendmsg tcp_bpf_send_verdict tcp_bpf_sendmsg_redir sock_close tcp_bpf_push_locked __sock_release tcp_bpf_push //inet_release do_tcp_sendpages sock->ops->release sk_stream_wait_memory // tcp_close sk_wait_event sk->sk_prot->close release_sock(__sk); *** lock_sock(sk); __tcp_close sock_orphan(sk) sk->sk_wq = NULL release_sock **** lock_sock(__sk); remove_wait_queue(sk_sleep(sk), &wait); sk_sleep(sk) //NULL pointer dereference &rcu_dereference_raw(sk->sk_wq)->wait While waiting for memory in thread1, the socket is released with its wait queue because thread2 has closed it. This caused by tcp_bpf_send_verdict didn't increase the f_count of psock->sk_redir->sk_socket->file in thread1. We should check if SOCK_DEAD flag is set on wakeup in sk_stream_wait_memory before accessing the wait queue. Suggested-by: Jakub Sitnicki Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Cc: Eric Dumazet Link: https://lore.kernel.org/bpf/20220823133755.314697-2-liujian56@huawei.com commit 2bd1228a70275530bd2f902bf3329a80736b3bb2 Author: Iskren Chernev Date: Mon Sep 19 21:06:12 2022 +0300 dt-bindings: arm: cpus: Add kryo240 compatible Kryo240 is found in SM4250, the slower sibling of the SM6115. Signed-off-by: Iskren Chernev Reviewed-by: Vinod Koul Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220919180618.1840194-3-iskren.chernev@gmail.com Signed-off-by: Rob Herring commit da7a0123ed77dacf6c7bd2c4748bcd39d6bd1b82 Author: Dmitry Torokhov Date: Fri Sep 23 12:47:38 2022 -0700 Input: ep93xx_keypad - add missing linux/input.h include We are going to clean up matrix_keymap.h from unnecessary includes, so the driver needs to include API that it uses directly. Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923194738.927408-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 4e9cded6192800a7aed8df7290896e0956b54782 Author: Dmitry Torokhov Date: Fri Sep 23 12:47:37 2022 -0700 Input: imx_keypad - add missing linux/input.h include We are going to clean up matrix_keymap.h from unnecessary includes, so the driver needs to include API that it uses directly. Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923194738.927408-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 81a7cba79d0015fd50eb99ea6f682efce6005d05 Author: Dmitry Torokhov Date: Fri Sep 23 12:47:36 2022 -0700 Input: mt6779-keypad - add missing linux/input.h include We are going to clean up matrix_keymap.h from unnecessary includes, so the driver needs to include API that it uses directly. Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923194738.927408-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit d25a9d8f8d314e65a229cc828433ce3cc9cfbd4e Author: Dmitry Torokhov Date: Fri Sep 23 12:47:35 2022 -0700 Input: st-keyscan - add missing linux/input.h and linux/of.h includes We are going to clean up matrix_keymap.h from unnecessary includes, so the driver needs to include API that it uses directly. Also let's sort includes alphabetically. Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923194738.927408-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit ddc9589d7921d7af4cc8fa6e0477d83fd95adef5 Author: Dmitry Torokhov Date: Fri Sep 23 12:47:34 2022 -0700 Input: lm8333 - add missing linux/input.h include We are going to clean up matrix_keymap.h from unnecessary includes, so the driver needs to include API that it uses directly. Also let's sort includes alphabetically and drop unneeded irq.h Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923194738.927408-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit fc13b5a25e18b0de5e04b6f5616c60d71d2610ee Author: Yang Yingliang Date: Sat Sep 24 21:18:54 2022 +0800 spi: spi-fsl-qspi: Use devm_platform_ioremap_resource_byname() Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220924131854.964923-3-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c9e1bb724d884b12a4c0d1dc9f802946cf427a92 Author: Yang Yingliang Date: Sat Sep 24 21:18:53 2022 +0800 spi: spi-fsl-lpspi: Use devm_platform_get_and_ioremap_resource() Use the devm_platform_get_and_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220924131854.964923-2-yangyingliang@huawei.com Signed-off-by: Mark Brown commit f96087a38cca6f3bb4c7cf582b949016aeb59d0e Author: Yang Yingliang Date: Sat Sep 24 21:18:52 2022 +0800 spi: spi-fsl-dspi: Use devm_platform_get_and_ioremap_resource() Use the devm_platform_get_and_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220924131854.964923-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 29f65f2171c85a9633daa380df14009a365f42f2 Author: Zhang Qilong Date: Sat Sep 24 20:13:09 2022 +0800 spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes:db91841b58f9a ("spi/omap100k: Convert to runtime PM") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220924121310.78331-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 618d815fc93477b1675878f3c04ff32657cc18b4 Author: Zhang Qilong Date: Sat Sep 24 20:13:08 2022 +0800 spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes:abf00907538e2 ("spi: dw: Add Baikal-T1 SPI Controller glue driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220924121310.78331-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 4d0ef0a1c35189a6e8377d8ee8310ea5ef22c5f3 Author: Zhang Qilong Date: Sat Sep 24 20:13:07 2022 +0800 spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes:73d5fe0462702 ("spi: cadence-quadspi: Remove spi_master_put() in probe failure path") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220924121310.78331-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 947934e389f716d505a656d04388b2ecbe43281d Author: Axel Lin Date: Mon Sep 19 20:23:53 2022 +0800 regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass Testing .enable cannot tell if a regulator is enabled or not, check return value of .is_enabled() instead. Also remove unneeded ret variable. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20220919122353.384171-1-axel.lin@ingics.com Signed-off-by: Mark Brown commit 2b381b4a91e94bd1d328de6e66cf97dec13bb40c Author: Krzysztof Kozlowski Date: Fri Sep 23 22:31:40 2022 +0200 ASoC: MAINTAINERS: add bindings and APR to Qualcomm Audio entry Extend the Qualcomm Audio maintainer entry to include sound related bindings and the Qualcomm APR/GPR (Asynchronous/Generic Packet Router) IPC driver, which is tightly related to the Audio DSP. Signed-off-by: Krzysztof Kozlowski Acked-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220923203140.514730-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 4d73b97b8dbaf09af6e5878ce3288ba93956a3fd Author: Ren Zhijie Date: Mon Sep 26 07:40:42 2022 +0000 ASoC: codecs: wcd934x: Fix Kconfig dependency If CONFIG_REGMAP_SLIMBUS is not set, make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this: sound/soc/codecs/wcd934x.o: In function `wcd934x_codec_probe': wcd934x.c:(.text+0x3310): undefined reference to `__regmap_init_slimbus' make: *** [vmlinux] Error 1 Add select REGMAP_SLIMBUS to config SND_SOC_WCD934X. Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Signed-off-by: Ren Zhijie Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220926074042.13297-1-renzhijie2@huawei.com Signed-off-by: Mark Brown commit f7c91bf65388547f61888b7a67169966fc698ce1 Author: Chunxu Li Date: Sat Sep 24 11:35:59 2022 +0800 ASoC: SOF: mediatek: mt8195: Add pcm_pointer callback Add pcm_pointer callback for mt8195 to support read host position from DSP Signed-off-by: Chunxu Li Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220924033559.26599-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 978a7144ae8497b40d833a3c0110b18810499f95 Author: Chunxu Li Date: Sat Sep 24 11:35:58 2022 +0800 ASoC: SOF: mediatek: mt8195: Add pcm_hw_params callback Add pcm_hw_params callback for mt8195 to support continue update dma host position Signed-off-by: Chunxu Li Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220924033559.26599-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 30ea703a38ef76ca119673cd8bdd05c6e068e2ac Author: Luciano Leão Date: Thu Sep 22 17:00:54 2022 -0300 x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype Include the header containing the prototype of init_ia32_feat_ctl(), solving the following warning: $ make W=1 arch/x86/kernel/cpu/feat_ctl.o arch/x86/kernel/cpu/feat_ctl.c:112:6: warning: no previous prototype for ‘init_ia32_feat_ctl’ [-Wmissing-prototypes] 112 | void init_ia32_feat_ctl(struct cpuinfo_x86 *c) This warning appeared after commit 5d5103595e9e5 ("x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup") had moved the function init_ia32_feat_ctl()'s prototype from arch/x86/kernel/cpu/cpu.h to arch/x86/include/asm/cpu.h. Note that, before the commit mentioned above, the header include "cpu.h" (arch/x86/kernel/cpu/cpu.h) was added by commit 0e79ad863df43 ("x86/cpu: Fix a -Wmissing-prototypes warning for init_ia32_feat_ctl()") solely to fix init_ia32_feat_ctl()'s missing prototype. So, the header include "cpu.h" is no longer necessary. [ bp: Massage commit message. ] Fixes: 5d5103595e9e5 ("x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup") Signed-off-by: Luciano Leão Signed-off-by: Borislav Petkov Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220922200053.1357470-1-lucianorsleao@gmail.com commit 3b7610302a75fc1032a6c9462862bec6948f85c9 Author: Alexander Aring Date: Thu Sep 1 12:05:32 2022 -0400 fs: dlm: fix possible use after free if tracing This patch fixes a possible use after free if tracing for the specific event is enabled. To avoid the use after free we introduce a out_put label like all other user lock specific requests and safe in a boolean to do a put or not which depends on the execution path of dlm_user_request(). Cc: stable@vger.kernel.org Fixes: 7a3de7324c2b ("fs: dlm: trace user space callbacks") Reported-by: Dan Carpenter Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 4c17a496a7a0730fdfc9e249b83cc58249111532 Author: Pavel Begunkov Date: Mon Sep 26 14:35:09 2022 +0100 io_uring/net: fix cleanup double free free_iov init Having ->async_data doesn't mean it's initialised and previously we vere relying on setting F_CLEANUP at the right moment. With zc sendmsg though, we set F_CLEANUP early in prep when we alloc a notif and so we may allocate async_data, fail in copy_msg_hdr() leaving struct io_async_msghdr not initialised correctly but with F_CLEANUP set, which causes a ->free_iov double free and probably other nastiness. Always initialise ->free_iov. Also, now it might point to fast_iov when fails, so avoid freeing it during cleanups. Reported-by: syzbot+edfd15cd4246a3fc615a@syzkaller.appspotmail.com Fixes: 493108d95f146 ("io_uring/net: zerocopy sendmsg") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe commit c7bcc1056cff6d99d173d4707057f3dba94d32d9 Author: Sean Hong Date: Mon Sep 26 18:08:39 2022 +0800 drm/panel-edp: Add INX N116BCA-EA2 Add support for the INX - N116BCA-EA2 (HW: C1) panel Signed-off-by: Sean Hong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220926100839.482804-1-sean.hong@quanta.corp-partner.google.com commit d65360f224069a6de56eb18e0425973914a10fe8 Author: Chao Yu Date: Mon Sep 26 22:20:41 2022 +0800 mm/slub: clean up create_unique_id() As Christophe JAILLET suggested [1] In create_unique_id(), "looks that ID_STR_LENGTH could even be reduced to 32 or 16. The 2nd BUG_ON at the end of the function could certainly be just removed as well or remplaced by a: if (p > name + ID_STR_LENGTH - 1) { kfree(name); return -E; } " According to above suggestion, let's do below cleanups: 1. reduce ID_STR_LENGTH to 32, as the buffer size should be enough; 2. use WARN_ON instead of BUG_ON() and return error if check condition is true; 3. use snprintf instead of sprintf to avoid overflow. [1] https://lore.kernel.org/linux-mm/2025305d-16db-abdf-6cd3-1fb93371c2b4@wanadoo.fr/ Suggested-by: Christophe JAILLET Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Chao Yu Signed-off-by: Vlastimil Babka commit 38713c6028a3172c4c256512c3fbcfc799fe2d43 Merge: a380b8dcf22cc 717ec15e5ce98 184233a520278 d2f2f1d10ccdb 0c9ccaf24efa5 6ad931a232e71 f9e2f0e835765 4f58330fcc848 Author: Joerg Roedel Date: Mon Sep 26 15:52:31 2022 +0200 Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next commit 6ad931a232e71620c6dbb8d573ccef51f84f2566 Author: Lu Baolu Date: Mon Sep 26 21:15:29 2022 +0800 iommu/vt-d: Avoid unnecessary global DMA cache invalidation Some VT-d hardware implementations invalidate all DMA remapping hardware translation caches as part of SRTP flow. The VT-d spec adds a ESRTPS (Enhanced Set Root Table Pointer Support, section 11.4.2 in VT-d spec) capability bit to indicate this. With this bit set, software has no need to issue the global invalidation request. Signed-off-by: Lu Baolu Reviewed-by: Jerry Snitselaar Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220919062523.3438951-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit eb5b20114b9710d1dcd4118dbf01b081c104bbc0 Author: Lu Baolu Date: Mon Sep 26 21:15:28 2022 +0800 iommu/vt-d: Avoid unnecessary global IRTE cache invalidation Some VT-d hardware implementations invalidate all interrupt remapping hardware translation caches as part of SIRTP flow. The VT-d spec adds a ESIRTPS (Enhanced Set Interrupt Remap Table Pointer Support, section 11.4.2 in VT-d spec) capability bit to indicate this. The spec also states in 11.4.4 that hardware also performs global invalidation on all interrupt remapping caches as part of Interrupt Remapping Disable operation if ESIRTPS capability bit is set. This checks the ESIRTPS capability bit and skip software global cache invalidation if it's set. Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Jerry Snitselaar Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220921065741.3572495-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit b722cb32f0a558409fa5def9aaf0b82d9b553686 Author: Yi Liu Date: Mon Sep 26 21:15:27 2022 +0800 iommu/vt-d: Rename cap_5lp_support to cap_fl5lp_support This renaming better describes it is for first level page table (a.k.a first stage page table since VT-d spec 3.4). Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220916071326.2223901-1-yi.l.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 4759858726e4b4a9dac740ec16f07612c90b4663 Author: Lu Baolu Date: Mon Sep 26 21:15:26 2022 +0800 iommu/vt-d: Remove pasid_set_eafe() It is not used anywhere in the tree. Remove it to avoid dead code. No functional change intended. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220915081645.1834555-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 0faa19a1515f8b04e9251b38ba522529906aeda7 Author: Lu Baolu Date: Mon Sep 26 21:15:25 2022 +0800 iommu/vt-d: Decouple PASID & PRI enabling from SVA Previously the PCI PASID and PRI capabilities are enabled in the path of iommu device probe only if INTEL_IOMMU_SVM is configured and the device supports ATS. As we've already decoupled the I/O page fault handler from SVA, we could also decouple PASID and PRI enabling from it to make room for growth of new features like kernel DMA with PASID, SIOV and nested translation. At the same time, the iommu_enable_dev_iotlb() helper is also called in iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA) path. It's unnecessary and duplicate. This cleanups this helper to make the code neat. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220915085814.2261409-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 06f4b8d09dbabec631ed7b033f5d5413d86c7134 Author: Lu Baolu Date: Mon Sep 26 21:15:24 2022 +0800 iommu/vt-d: Remove unnecessary SVA data accesses in page fault path The existing I/O page fault handling code accesses the per-PASID SVA data structures. This is unnecessary and makes the fault handling code only suitable for SVA scenarios. This removes the SVA data accesses from the I/O page fault reporting and responding code, so that the fault handling code could be generic. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220914011821.400986-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 4df0221f9ded8c39aecfb1a80cef346026671cb7 Author: Rohan McLure Date: Wed Sep 21 16:55:52 2022 +1000 powerpc: Remove direct call to personality syscall handler Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Fortunately, in the case of ppc64_personality, its call to sys_personality can be replaced with an invocation to the equivalent ksys_personality inline helper in . Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-13-rmclure@linux.ibm.com commit b6b1334c9510e162bd8ca0ae58403cafad9572f1 Author: Rohan McLure Date: Wed Sep 21 16:55:51 2022 +1000 powerpc/32: Remove powerpc select specialisation Syscall #82 has been implemented for 32-bit platforms in a unique way on powerpc systems. This hack will in effect guess whether the caller is expecting new select semantics or old select semantics. It does so via a guess, based off the first parameter. In new select, this parameter represents the length of a user-memory array of file descriptors, and in old select this is a pointer to an arguments structure. The heuristic simply interprets sufficiently large values of its first parameter as being a call to old select. The following is a discussion on how this syscall should be handled. As discussed in this thread, the existence of such a hack suggests that for whatever powerpc binaries may predate glibc, it is most likely that they would have taken use of the old select semantics. x86 and arm64 both implement this syscall with oldselect semantics. Remove the powerpc implementation, and update syscall.tbl to refer to emit a reference to sys_old_select and compat_sys_old_select for 32-bit binaries, in keeping with how other architectures support syscall #82. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/lkml/13737de5-0eb7-e881-9af0-163b0d29a1a0@csgroup.eu/ Link: https://lore.kernel.org/r/20220921065605.1051927-12-rmclure@linux.ibm.com commit c2e7a19827eec443a7cbe85e8d959052412d6dc3 Author: Rohan McLure Date: Wed Sep 21 16:55:50 2022 +1000 powerpc: Use generic fallocate compatibility syscall The powerpc fallocate compat syscall handler is identical to the generic implementation provided by commit 59c10c52f573f ("riscv: compat: syscall: Add compat_sys_call_table implementation"), and as such can be removed in favour of the generic implementation. A future patch series will replace more architecture-defined syscall handlers with generic implementations, dependent on introducing generic implementations that are compatible with powerpc and arm's parameter reorderings. Reported-by: Arnd Bergmann Signed-off-by: Rohan McLure Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-11-rmclure@linux.ibm.com commit 43d5de2b67d7f4a8478820005152f7f689608f2f Author: Rohan McLure Date: Wed Sep 21 16:55:49 2022 +1000 asm-generic: compat: Support BE for long long args in 32-bit ABIs 32-bit ABIs support passing 64-bit integers by registers via argument translation. Commit 59c10c52f573 ("riscv: compat: syscall: Add compat_sys_call_table implementation") implements the compat_arg_u64 macro for efficiently defining little endian compatibility syscalls. Architectures supporting big endianness may benefit from reciprocal argument translation, but are welcome also to implement their own. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-10-rmclure@linux.ibm.com commit 016ff72bd2090903715c0f9422a44afbb966f4ee Author: Rohan McLure Date: Wed Sep 21 16:55:48 2022 +1000 powerpc: Fix fallocate and fadvise64_64 compat parameter combination As reported[1] by Arnd, the arch-specific fadvise64_64 and fallocate compatibility handlers assume parameters are passed with 32-bit big-endian ABI. This affects the assignment of odd-even parameter pairs to the high or low words of a 64-bit syscall parameter. Fix fadvise64_64 fallocate compat handlers to correctly swap upper/lower 32 bits conditioned on endianness. A future patch will replace the arch-specific compat fallocate with an asm-generic implementation. This patch is intended for ease of back-port. [1]: https://lore.kernel.org/all/be29926f-226e-48dc-871a-e29a54e80583@www.fastmail.com/ Fixes: 57f48b4b74e7 ("powerpc/compat_sys: swap hi/lo parts of 64-bit syscall args in LE mode") Reported-by: Arnd Bergmann Signed-off-by: Rohan McLure Reviewed-by: Arnd Bergmann Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-9-rmclure@linux.ibm.com commit 620f5c59c8617d623428c03414a022fca4e9eea2 Author: Rohan McLure Date: Wed Sep 21 16:55:47 2022 +1000 powerpc/64s: Fix comment on interrupt handler prologue Interrupt handlers on 64s systems will often need to save register state from the interrupted process to make space for loading special purpose registers or for internal state. Fix a comment documenting a common code path macro in the beginning of interrupt handlers where r10 is saved to the PACA to afford space for the value of the CFAR. Comment is currently written as if r10-r12 are saved to PACA, but in fact only r10 is saved, with r11-r12 saved much later. The distance in code between these saves has grown over the many revisions of this macro. Fix this by signalling with a comment where r11-r12 are saved to the PACA. Signed-off-by: Rohan McLure Reported-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-8-rmclure@linux.ibm.com commit 53ecaa6778d613807e590c320ccfcf48a4114108 Author: Rohan McLure Date: Wed Sep 21 16:55:46 2022 +1000 powerpc/64e: Clarify register saves and clears with {SAVE,ZEROIZE}_GPRS The common interrupt handler prologue macro and the bad_stack trampolines include consecutive sequences of register saves, and some register clears. Neaten such instances by expanding use of the SAVE_GPRS macro and employing the ZEROIZE_GPR macro when appropriate. Also simplify an invocation of SAVE_GPRS targetting all non-volatile registers to SAVE_NVGPRS. Signed-off-by: Rohan McLure Reported-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-7-rmclure@linux.ibm.com commit 15ba74502ccfd0b34dad0ea022093ccc66b334d6 Author: Rohan McLure Date: Wed Sep 21 16:55:45 2022 +1000 powerpc/32: Clarify interrupt restores with REST_GPR macro in entry_32.S Restoring the register state of the interrupted thread involves issuing a large number of predictable loads to the kernel stack frame. Issue the REST_GPR{,S} macros to clearly signal when this is happening, and bunch together restores at the end of the interrupt handler where the saved value is not consumed earlier in the handler code. Signed-off-by: Rohan McLure Reported-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-6-rmclure@linux.ibm.com commit 2b1dac4b5f97ea88fb01dfcab7fc24500b5dea95 Author: Rohan McLure Date: Wed Sep 21 16:55:44 2022 +1000 powerpc/64s: Use {ZEROIZE,SAVE,REST}_GPRS macros in sc, scv 0 handlers Use the convenience macros for saving/clearing/restoring gprs in keeping with syscall calling conventions. The plural variants of these macros can store a range of registers for concision. This works well when the user gpr value we are hoping to save is still live. In the syscall interrupt handlers, user register state is sometimes juggled between registers. Hold-off from issuing the SAVE_GPR macro for applicable neighbouring lines to highlight the delicate register save logic. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-5-rmclure@linux.ibm.com commit 9d54a5ce3aa87810f13cd33b314097ac6d28c350 Author: Rohan McLure Date: Wed Sep 21 16:55:43 2022 +1000 powerpc: Add ZEROIZE_GPRS macros for register clears Provide register zeroing macros, following the same convention as existing register stack save/restore macros, to be used in later change to concisely zero a sequence of consecutive gprs. The resulting macros are called ZEROIZE_GPRS and ZEROIZE_NVGPRS, keeping with the naming of the accompanying restore and save macros, and usage of zeroize to describe this operation elsewhere in the kernel. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-4-rmclure@linux.ibm.com commit 2c27d4a419f627636b8c6038e55acb26df05c391 Author: Rohan McLure Date: Wed Sep 21 16:55:42 2022 +1000 powerpc: Save caller r3 prior to system_call_exception This reverts commit 8875f47b7681 ("powerpc/syscall: Save r3 in regs->orig_r3 "). Save caller's original r3 state to the kernel stackframe before entering system_call_exception. This allows for user registers to be cleared by the time system_call_exception is entered, reducing the influence of user registers on speculation within the kernel. Prior to this commit, orig_r3 was saved at the beginning of system_call_exception. Instead, save orig_r3 while the user value is still live in r3. Also replicate this early save in 32-bit. A similar save was removed in commit 6f76a01173cc ("powerpc/syscall: implement system call entry/exit logic in C for PPC32") when 32-bit adopted system_call_exception. Revert its removal of orig_r3 saves. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-3-rmclure@linux.ibm.com commit 5ba6c9a912fe4c60f84d6617ad10d2b8d7910990 Author: Rohan McLure Date: Wed Sep 21 16:55:41 2022 +1000 powerpc: Remove asmlinkage from syscall handler definitions The asmlinkage macro has no special meaning in powerpc, and prior to this patch is used sporadically on some syscall handler definitions. On architectures that do not define asmlinkage, it resolves to extern "C" for C++ compilers and a nop otherwise. The current invocations of asmlinkage provide far from complete support for C++ toolchains, and so the macro serves no purpose in powerpc. Remove all invocations of asmlinkage in arch/powerpc. These incidentally only occur in syscall definitions and prototypes. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220921065605.1051927-2-rmclure@linux.ibm.com commit 4af83545538a4fa80d14b9247ffc0db556e6a556 Author: Christophe Leroy Date: Tue Sep 20 08:41:08 2022 +0200 powerpc/irq: Refactor irq_soft_mask_{set,or}_return() This partialy reapply commit ef5b570d3700 ("powerpc/irq: Don't open code irq_soft_mask helpers") which was reverted by commit 684c68d92e2e ("Revert "powerpc/irq: Don't open code irq_soft_mask helpers"") irq_soft_mask_set_return() and irq_soft_mask_or_return() are overset of irq_soft_mask_set(). Have them use irq_soft_mask_set() instead of duplicating it. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/18473da42362ee8f07bce36b9caef8ba77d7633f.1663656054.git.christophe.leroy@csgroup.eu commit 605ba9ee8aaabc77178b369ec6f773616089020d Author: Christophe Leroy Date: Mon Sep 19 19:01:43 2022 +0200 powerpc: Remove impossible mmu_psize_defs[] on nohash Today there is: if e500 or 8xx if e500 mmu_psize_defs[] = else if 8xx mmu_psize_defs[] = else mmu_psize_defs[] = endif endif The else leg is dead definition. Drop that else leg and rewrite as: if e500 mmu_psize_defs[] = endif if 8xx mmu_psize_defs[] = endif Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/030a843449f348c0b709ca5349640624f36a016f.1663606876.git.christophe.leroy@csgroup.eu commit 6556fd1a1e9fcd180348c4368d2387bdc6a17613 Author: Christophe Leroy Date: Mon Sep 19 19:01:42 2022 +0200 powerpc: Cleanup idle for e500 e500 idle setup is a bit messy. e500_idle() is used for PPC32 while book3e_idle() is used for PPC64. As they are mutually exclusive, call them all e500_idle(). Use CONFIG_MPC_85xx instead of PPC32 + E500 in Makefile and rename idle_e500.c to idle_85xx.c . Rename idle_book3e.c to idle_64e.c and remove #ifdef PPC64 in as it's only built on PPC64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8039301334e948974c85ec5ef2db37751075185b.1663606876.git.christophe.leroy@csgroup.eu commit 73d11498793f495d64230308afa50905f012f080 Author: Christophe Leroy Date: Mon Sep 19 19:01:41 2022 +0200 powerpc: Simplify redundant Kconfig tests PPC_85xx implies PPC32 so no need to check PPC32 in addition. PPC64 && !PPC_BOOK3E_64 means PPC_BOOK3S_64. PPC_BOOK3E_64 implies PPC_E500. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/244cce3e603f2b79796314c0c1c46cab927b9adc.1663606876.git.christophe.leroy@csgroup.eu commit 772fd56deca62628c638d1a9bd2d34cbd371bb81 Author: Christophe Leroy Date: Mon Sep 19 19:01:40 2022 +0200 powerpc: Replace PPC_85xx || PPC_BOOKE_64 by PPC_E500 PPC_E500 is the same as PPC_85xx || PPC_BOOKE_64 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/af79696f8cb8536fb4e20c0d98a6bf159a9e371b.1663606876.git.christophe.leroy@csgroup.eu commit aa5f59df201dd350f7c291c845ac8b62c0d0edd5 Author: Christophe Leroy Date: Mon Sep 19 19:01:39 2022 +0200 powerpc: Remove CONFIG_PPC_BOOK3E_MMU CONFIG_PPC_BOOK3E_MMU is redundant with CONFIG_PPC_E500. Remove it. Also rename mmu-book3e.h to mmu-e500.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c5549cd59a131204ff94ab909cad2e2dad4ddf2f.1663606876.git.christophe.leroy@csgroup.eu commit 3e7318584dfec11992f3ac45658c4bc1210b3778 Author: Christophe Leroy Date: Mon Sep 19 19:01:38 2022 +0200 powerpc: Remove CONFIG_PPC_FSL_BOOK3E CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500. Remove it. And rename five files accordingly. Signed-off-by: Christophe Leroy [mpe: Rename include guards to match new file names] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/795cb93b88c9a0279289712e674f39e3b108a1b4.1663606876.git.christophe.leroy@csgroup.eu commit ec65560ad84d9d2eb98cf864e3b530856cafd233 Author: Christophe Leroy Date: Mon Sep 19 19:01:37 2022 +0200 watchdog: booke_wdt: Replace PPC_FSL_BOOK3E by PPC_E500 CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500. Replace it so that CONFIG_PPC_FSL_BOOK3E can be removed later. Signed-off-by: Christophe Leroy Acked-by: Guenter Roeck Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/01a9132d51d3d8d9c74576d3da4d9d1fa5a88bde.1663606876.git.christophe.leroy@csgroup.eu commit 404a5e72f4dfd80dda6a3e9edd18012f79287bff Author: Christophe Leroy Date: Mon Sep 19 19:01:36 2022 +0200 Documentation: Rename PPC_FSL_BOOK3E to PPC_E500 CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500. Rename it so that CONFIG_PPC_FSL_BOOK3E can be removed later. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d3d42b395c09e66b0705fda1e51779f33e13ac38.1663606876.git.christophe.leroy@csgroup.eu commit 688de017efaab8a7764ab2c05ce7128d0361023b Author: Christophe Leroy Date: Mon Sep 19 19:01:35 2022 +0200 powerpc: Change CONFIG_E500 to CONFIG_PPC_E500 It will be used outside arch/powerpc, make it clear its a powerpc configuration item. And we already have CONFIG_PPC_E500MC, so that will make it more consistent. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e63b22083c11c4300f4a82d3123a46e5fdd54fa6.1663606876.git.christophe.leroy@csgroup.eu commit 1df399012b6ab0b24466a0675710a53e3feb000f Author: Christophe Leroy Date: Mon Sep 19 19:01:34 2022 +0200 powerpc: Remove redundant selection of E500 and E500MC PPC_85xx and PPC_BOOK3E_64 already select E500 so no need to select it again by PPC_QEMU_E500 and CORENET_GENERIC as they depend on PPC_85xx || PPC_BOOK3E_64. PPC_BOOK3E_64 already selects E500MC so no need to select it again by PPC_QEMU_E500 if PPC64, PPC_BOOK3E_64 is the only way into PPC_QEMU_E500 with PPC64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/44f03fa1506892fabf626dceb2f47a049908b6af.1663606876.git.christophe.leroy@csgroup.eu commit e0d68273d7069537701bb91c51d90d1e12aacc33 Author: Christophe Leroy Date: Mon Sep 19 19:01:33 2022 +0200 powerpc: Remove CONFIG_PPC_BOOK3E CONFIG_PPC_BOOK3E is redundant with CONFIG_PPC_BOOK3E_64. The later is more explicit about the fact that it's a 64 bits target. Remove CONFIG_PPC_BOOK3E. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5d0891490813c19cdcfc04678f512ea68cba3e64.1663606876.git.christophe.leroy@csgroup.eu commit d7216567c65cbed655f9bf87ef906f9246d6f698 Author: Christophe Leroy Date: Mon Sep 19 19:01:32 2022 +0200 powerpc/cputable: Split cpu_specs[] for mpc85xx and e500mc e500v1/v2 and e500mc are said to be mutually exclusive in Kconfig. Split e500 cpu_specs[] and then restrict the non e500mc to PPC32 which is then 85xx. Signed-off-by: Christophe Leroy [mpe: Tweak formatting] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/553b901ea91e393df231103da4b018e9b251b0e9.1663606876.git.christophe.leroy@csgroup.eu commit e7c7fbb9a8574ebd89cc05db49d806c7476863ad Author: Jan Kara Date: Wed Sep 14 17:29:33 2022 +0200 ext2: Use kvmalloc() for group descriptor array Array of group descriptor block buffers can get rather large. In theory in can reach 1MB for perfectly valid filesystem and even more for maliciously crafted ones. Use kvmalloc() to allocate the array to avoid straining memory allocator with large order allocations unnecessarily. Reported-by: syzbot+0f2f7e65a3007d39539f@syzkaller.appspotmail.com Signed-off-by: Jan Kara commit d766f2d1e3e3bd44024a7f971ffcf8b8fbb7c5d2 Author: Jan Kara Date: Wed Sep 14 17:24:42 2022 +0200 ext2: Add sanity checks for group and filesystem size Add sanity check that filesystem size does not exceed the underlying device size and that group size is big enough so that metadata can fit into it. This avoid trying to mount some crafted filesystems with extremely large group counts. Reported-by: syzbot+0f2f7e65a3007d39539f@syzkaller.appspotmail.com Reported-by: kernel test robot # Test fixup CC: stable@vger.kernel.org Signed-off-by: Jan Kara commit dfc3095cec27f402c183da920f4733785e4c873d Author: Christophe Leroy Date: Mon Sep 19 19:01:31 2022 +0200 powerpc: Remove CONFIG_FSL_BOOKE PPC_85xx is PPC32 only. PPC_85xx always selects E500 and is the only PPC32 that selects E500. FSL_BOOKE is selected when E500 and PPC32 are selected. So FSL_BOOKE is redundant with PPC_85xx. Remove FSL_BOOKE. And rename four files accordingly. cpu_setup_fsl_booke.S is not renamed because it is linked to PPC_FSL_BOOK3E and not to FSL_BOOKE as suggested by its name. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/08e3e15594e66d63b9e89c5b4f9c35153913c28f.1663606875.git.christophe.leroy@csgroup.eu commit e320a76db4b02e1160eb4bfb17d8d1bc57979955 Author: Christophe Leroy Date: Mon Sep 19 19:01:30 2022 +0200 powerpc/cputable: Split cpu_specs[] out of cputable.h cpu_specs[] is full of #ifdefs depending on the different types of CPU. CPUs are mutually exclusive, it is therefore possible to split cpu_specs[] into smaller more readable pieces. Create cpu_specs_XXX.h that will each be dedicated on one of the following mutually exclusive families: - 40x - 44x - 47x - 8xx - e500 - book3s/32 - book3s/64 In book3s/32, the block for 603 has been moved in front in order to not have two 604 blocks. Signed-off-by: Christophe Leroy [mpe: Fix CONFIG_47x to be CONFIG_PPC_47x, tweak some formatting] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a44b865e0318286155273b10cdf524ab697928c1.1663606875.git.christophe.leroy@csgroup.eu commit 76b719881a26fec3b77652134f19cf1dfcc96318 Author: Christophe Leroy Date: Mon Sep 19 19:01:29 2022 +0200 powerpc/cputable: Move __cpu_setup() prototypes out of cputable.h Move all prototypes out of cputable.h For that rename cpu_setup_power.h to cpu_setup.h and move all prototypes in it. Signed-off-by: Christophe Leroy [mpe: Standardise cpu_spec *spec formatting] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f45118489ee450db654db8bbcdfd8f5907337c22.1663606875.git.christophe.leroy@csgroup.eu commit 0ae3109a839192920f09338e9abc4d5321107865 Author: Bartosz Golaszewski Date: Thu Sep 22 11:51:24 2022 +0200 gpiolib: cdev: add fdinfo output for line request file descriptors Add fdinfo output for file descriptors created for user-space line requests in GPIO uAPI v2. The fdinfo file now contains the name of the GPIO chip that is the "parent" of the request as well as offsets of the lines requested. This allows user-space to parse the /proc/$PID/fdinfo entries and deduce the PID of the process that requested a specific line. Signed-off-by: Bartosz Golaszewski Reviewed-by: Kent Gibson commit adc4cefae9cfafc1c88b789021266d6f09a0ecef Author: Appana Durga Kedareswara rao Date: Mon Jun 27 12:10:24 2022 +0530 microblaze: Add support for error injection To inject the error using the tmr inject IP reset vectors need to be placed in lmb(bram) due to the limitation in HW when this code runs out of DDR. Below code adds the error inject code to the .init.ivt section to copy it in machine_early_init to lmb/Bram location. C_BASE_VECTORS which allow moving reset vectors out of 0 location is not currently supported by Microblaze architecture, that's why all the time reset vectors with injection code is all the time copied to address 0. As of now getting this functionality working CPU switches to real mode and simply jumps to bram, which causes triggering of fault which continues to call_xmb_manager_break break handler which will at the end calls the error count callback function and performs recovery. Signed-off-by: Appana Durga Kedareswara rao Link: https://lore.kernel.org/r/20220627064024.771037-4-appana.durga.rao@xilinx.com Signed-off-by: Michal Simek commit 88707ebe77e23e856981e597f322cabbf6415662 Author: Appana Durga Kedareswara rao Date: Mon Jun 27 12:10:23 2022 +0530 microblaze: Add custom break vector handler for mb manager When the TMR Manager detects a fault Lockstep state it is signaled to the MicroBlaze processors by asserting a break signal, When Microblaze gets a break vector from tmr Microblaze it's needed to clear/block the break bit in the tmr manager before performing recovery. In order to perform recovery need to perform the following steps. 1) Store all internal MicroBlaze registers in RAM 2) Execute a suspend instruction which asserts the reset signal 3) Restore all registers from RAM and execute an RTBD instruction to return from the reset handler, to resume execution at the place where the break occurred. This API supports getting called from kernel space only. Signed-off-by: Appana Durga Kedareswara rao Link: https://lore.kernel.org/r/20220627064024.771037-3-appana.durga.rao@xilinx.com Signed-off-by: Michal Simek commit a5e3aaa654c15760afdfb85d0b6fd825ce068efc Author: Appana Durga Kedareswara rao Date: Mon Jun 27 12:10:22 2022 +0530 microblaze: Add xmb_manager_register function Triple Modular Redundancy (TMR) Microblaze solution provides soft error injection, detection, correction and recovery for Microblaze cores in the system. The Xilinx/AMD Triple Modular Redundancy (TMR) solution in Vivado provides all the necessary building blocks to implement a redundant triplicated MicroBlaze subsystem. This processing subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. When the break vector gets asserted because of error injection, the break signal must be blocked before exiting from the break handler, This commit adds support for xmb_manager_register api which updates the TMR manager address and control register and error count and reset callback function arguments, which will be used by the break handler to block the break and call the error count callback function and reset callback function. Signed-off-by: Appana Durga Kedareswara rao Link: https://lore.kernel.org/r/20220627064024.771037-2-appana.durga.rao@xilinx.com Signed-off-by: Michal Simek commit d2f2f1d10ccdb96aeea38c5ec647679fcc093b84 Author: Jean-Philippe Brucker Date: Fri Sep 16 14:31:47 2022 +0100 dt-bindings: iommu: arm,smmu-v3: Relax order of interrupt names The QEMU devicetree uses a different order for SMMUv3 interrupt names, and there isn't a good reason for enforcing a specific order. Since all interrupt lines are optional, operating systems should not expect a fixed interrupt array layout; they should instead match each interrupt to its name individually. Besides, as a result of commit e4783856a2e8 ("dt-bindings: iommu: arm,smmu-v3: make PRI IRQ optional"), "cmdq-sync" and "priq" are already permutable. Relax the interrupt-names array entirely by allowing any permutation, incidentally making the schema more readable. Note that dt-validate won't allow duplicate names here so we don't need to specify maxItems or add additional checks, it's quite neat. Signed-off-by: Jean-Philippe Brucker Acked-by: Will Deacon Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916133145.1910549-1-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit a380b8dcf22ccb5b872ae9ad7f4644cd0043aaee Author: Sven Peter Date: Fri Sep 16 11:41:52 2022 +0200 iommu: dart: Support t6000 variant The M1 Pro/Max/Ultra SoCs come with a new variant of DART which supports a larger physical address space with a different PTE format. Pass through the correct paddr address space size and the PTE format to the io-pgtable code which will take care of the rest. Signed-off-by: Sven Peter Co-developed-by: Janne Grunau Signed-off-by: Janne Grunau Reviewed-by: Rob Herring Acked-by: Hector Martin Link: https://lore.kernel.org/r/20220916094152.87137-6-j@jannau.net Signed-off-by: Joerg Roedel commit dc09fe1c5edd9c27a52cb6dc5a7bb4452d45c71c Author: Sven Peter Date: Fri Sep 16 11:41:51 2022 +0200 iommu/io-pgtable-dart: Add DART PTE support for t6000 The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format. They support a 42bit physical address space by shifting the paddr and extending its mask inside the PTE. They also come with mandatory sub-page protection now which we just configure to always allow access to the entire page. This feature is already present but optional on the previous DARTs which allows to unconditionally configure it. Signed-off-by: Sven Peter Co-developed-by: Janne Grunau Signed-off-by: Janne Grunau Reviewed-by: Rob Herring Acked-by: Hector Martin Link: https://lore.kernel.org/r/20220916094152.87137-5-j@jannau.net Signed-off-by: Joerg Roedel commit d8fe365a4f1c1aa5e2da3e41f50a08c9bd8d6112 Author: Sven Peter Date: Fri Sep 16 11:41:50 2022 +0200 iommu/io-pgtable: Add DART subpage protection support DART allows to only expose a subpage to the device. While this is an optional feature on the M1 DARTs the new ones present on the Pro/Max models require this field in every PTE. Signed-off-by: Sven Peter Signed-off-by: Janne Grunau Reviewed-by: Rob Herring Acked-by: Hector Martin Link: https://lore.kernel.org/r/20220916094152.87137-4-j@jannau.net Signed-off-by: Joerg Roedel commit 745ef1092bcfcf3bca8d82c260947ca498022dde Author: Janne Grunau Date: Fri Sep 16 11:41:49 2022 +0200 iommu/io-pgtable: Move Apple DART support to its own file The pte format used by the DARTs found in the Apple M1 (t8103) is not fully compatible with io-pgtable-arm. The 24 MSB are used for subpage protection (mapping only parts of page) and conflict with the address mask. In addition bit 1 is not available for tagging entries but disables subpage protection. Subpage protection could be useful to support a CPU granule of 4k with the fixed IOMMU page size of 16k. The DARTs found on Apple M1 Pro/Max/Ultra use another different pte format which is even less compatible. To support an output address size of 42 bit the address is shifted down by 4. Subpage protection is mandatory and bit 1 signifies uncached mappings used by the display controller. It would be advantageous to share code for all known Apple DART variants to support common features. The page table allocator for DARTs is less complex since it uses a two levels of translation table without support for huge pages. Signed-off-by: Janne Grunau Acked-by: Robin Murphy Acked-by: Sven Peter Acked-by: Hector Martin Link: https://lore.kernel.org/r/20220916094152.87137-3-j@jannau.net [ joro: Fix compile warning in __dart_alloc_pages()] Signed-off-by: Joerg Roedel commit 717ec15e5ce98ed267c9e31ff0469f57782c85e9 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 17:11:48 2022 +0200 iommu/mediatek: Add support for MT6795 Helio X10 M4Us Add support for the M4Us found in the MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220913151148.412312-4-angelogioacchino.delregno@collabora.com Signed-off-by: Joerg Roedel commit 86580ec969bb1df9dbc316643853e7664ace4cae Author: AngeloGioacchino Del Regno Date: Tue Sep 13 17:11:47 2022 +0200 iommu/mediatek: Introduce new flag TF_PORT_TO_ADDR_MT8173 In preparation for adding support for MT6795, add a new flag named TF_PORT_TO_ADDR_MT8173 and use that instead of checking for m4u_plat type in mtk_iommu_hw_init() to avoid seeing a long list of m4u_plat checks there in the future. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220913151148.412312-3-angelogioacchino.delregno@collabora.com Signed-off-by: Joerg Roedel commit 4e5f8465c65ed6b2c1878cca2727a741725be341 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 17:11:46 2022 +0200 dt-bindings: mediatek: Add bindings for MT6795 M4U Add bindings for the MediaTek Helio X10 (MT6795) IOMMU/M4U. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Acked-by: Krzysztof Kozlowski Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220913151148.412312-2-angelogioacchino.delregno@collabora.com Signed-off-by: Joerg Roedel commit 4f58330fcc8482aa90674e1f40f601e82f18ed4a Author: Robin Murphy Date: Tue Sep 13 12:47:20 2022 +0100 iommu/iova: Fix module config properly IOMMU_IOVA is intended to be an optional library for users to select as and when they desire. Since it can be a module now, this means that built-in code which has chosen not to select it should not fail to link if it happens to have selected as a module by someone else. Replace IS_ENABLED() with IS_REACHABLE() to do the right thing. CC: Thierry Reding Reported-by: John Garry Fixes: 15bbdec3931e ("iommu: Make the iova library a module") Signed-off-by: Robin Murphy Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/548c2f683ca379aface59639a8f0cccc3a1ac050.1663069227.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit f9e2f0e8357658c448fd5397cc959da3aae4435d Author: Vasant Hegde Date: Mon Sep 12 06:32:48 2022 +0000 iommu/amd: Fix sparse warning CHECK drivers/iommu/amd/iommu.c drivers/iommu/amd/iommu.c:73:24: warning: symbol 'amd_iommu_ops' was not declared. Should it be static? Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220912063248.7909-6-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 6b5b58626ef90ef45513c78bfc84540ff954431c Author: Vasant Hegde Date: Mon Sep 12 06:32:47 2022 +0000 iommu/amd: Remove outdated comment Comment is not related to amd_iommu_ops variable. Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220912063248.7909-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 2455d6a46c2da5703752772f49d56142ccd50463 Author: Vasant Hegde Date: Mon Sep 12 06:32:46 2022 +0000 iommu/amd: Free domain ID after domain_flush_pages free_io_pgtable_ops() path uses domain ID to flush pages. Hence free domain ID after flushing everything. Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220912063248.7909-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 053bab4c220be7749b7d7e101d9d172f3991b21a Author: Vasant Hegde Date: Mon Sep 12 06:32:44 2022 +0000 iommu/amd: Free domain id in error path Call domain_id_free() in error path. Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220912063248.7909-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit afd2288a4c7d3400a53cb29616742f4395a809a1 Author: Christophe Leroy Date: Mon Sep 19 19:01:28 2022 +0200 powerpc/cputable: Remove __machine_check_early_realmode_p{7/8/9} prototypes __machine_check_early_realmode_p{7/8/9} are already in mce.h which is included. Remove them from cputable.c Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b77fc0f90e3a9c065324cbff549b718ccf0809f8.1663606875.git.christophe.leroy@csgroup.eu commit b6100bedf1f9aea264757ac4a56eb1d8b04b9356 Author: Christophe Leroy Date: Mon Sep 19 19:01:27 2022 +0200 powerpc/64e: Remove unnecessary #ifdef CONFIG_PPC_FSL_BOOK3E CONFIG_PPC_BOOK3E_64 implies CONFIG_PPC_FSL_BOOK3E so no need of additional #ifdefs in files built exclusively for CONFIG_PPC_BOOK3E_64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/df16255c13b63b0221c9be63b94a6864bed22c12.1663606875.git.christophe.leroy@csgroup.eu commit 0069f3d14e7a656ba9d7dbaac72659687fdbf43c Author: Christophe Leroy Date: Mon Sep 19 19:01:26 2022 +0200 powerpc/64e: Tie PPC_BOOK3E_64 to PPC_E500MC The only 64-bit Book3E CPUs we support require the selection of CONFIG_PPC_E500MC. However our Kconfig allows configurating a kernel that has 64-bit Book3E support, but without CONFIG_PPC_E500MC enabled. Such a kernel would never boot, it doesn't know about any CPUs. To fix this, force CONFIG_PPC_E500MC to be selected whenever we are building a 64-bit Book3E kernel. And add a test to detect future situations where cpu_specs is empty. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ae5d8b8b3ccc346e61d2ec729767f92766273f0b.1663606875.git.christophe.leroy@csgroup.eu commit d1203f32d86987a3ccd7de9ba2448ba12d86d125 Author: Christophe Leroy Date: Mon Sep 19 19:01:25 2022 +0200 powerpc/Kconfig: Fix non existing CONFIG_PPC_FSL_BOOKE CONFIG_PPC_FSL_BOOKE doesn't exist. Should be CONFIG_FSL_BOOKE. Fixes: 49e3d8ea6248 ("powerpc/fsl_booke: Enable STRICT_KERNEL_RWX") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/828f6a64eeb51ce9abfa1d4e84c521a02fecebb8.1663606875.git.christophe.leroy@csgroup.eu commit 8bf056f57f1d16c561e43f9af37301f23990cd21 Author: Pali Rohár Date: Sat Aug 27 15:15:38 2022 +0200 powerpc: dts: turris1x.dts: Fix labels in DSA cpu port nodes DSA cpu port node has to be marked with "cpu" label. So fix it for both cpu port nodes. Fixes: 54c15ec3b738 ("powerpc: dts: Add DTS file for CZ.NIC Turris 1.x routers") Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220827131538.14577-1-pali@kernel.org commit c9986f0aefd1ae22fe9cf794d49699643f1e268b Author: Pali Rohár Date: Wed Aug 31 00:55:00 2022 +0200 powerpc: dts: turris1x.dts: Fix NOR partitions labels Partition partition@20000 contains generic kernel image and it does not have to be used only for rescue purposes. Partition partition@1c0000 contains bootable rescue system and partition partition@340000 contains factory image/data for restoring to NAND. So change partition labels to better fit their purpose by removing possible misleading substring "rootfs" from these labels. Fixes: 54c15ec3b738 ("powerpc: dts: Add DTS file for CZ.NIC Turris 1.x routers") Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220830225500.8856-1-pali@kernel.org commit ecf8f36446f53866727d9670df1746f8d20130a8 Author: Michael Ellerman Date: Fri Sep 16 23:15:23 2022 +1000 powerpc: Always select HAVE_EFFICIENT_UNALIGNED_ACCESS Currently powerpc selects HAVE_EFFICIENT_UNALIGNED_ACCESS in all cases but one. The exception is if the kernel is being built little endian and explicitly targeted for Power7. The combination of Power7 and little endian was never commercially supported, or widely used. It was only ever possible on bare metal machines, using unofficial firmware, or in qemu guests hosted on those machines. The bare metal firmware support for Power7 was removed in 2019, see skiboot commit 16b7ae64 ("Remove POWER7 and POWER7+ support"). Little endian kernel builds were switched to target Power8 or later in 2018, in commit a73657ea19ae ("powerpc/64: Add GENERIC_CPU support for little endian"). Since then it's only been possible to boot a Power7/LE kernel by explicitly building for Power7. So drop the exception and always select HAVE_EFFICIENT_UNALIGNED_ACCESS. If anyone does still have a Power7/LE machine it should hopefully continue to boot, just with some performance penality, and if not they can report a bug. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916131523.319123-1-mpe@ellerman.id.au commit 2fc1c63d2763ad7562ea7d241da79b42538a557b Author: Christophe Leroy Date: Tue Sep 20 19:36:42 2022 +0200 powerpc/highmem: Properly handle fragmented memory In addition to checking whether a page is reserved before allocating it to highmem, verify that it is valid memory. Otherwise the kernel Oopses as below: mem auto-init: stack:off, heap alloc:off, heap free:off Kernel attempted to read user page (7df58) - exploit attempt? (uid: 0) BUG: Unable to handle kernel data access on read at 0x0007df58 Faulting instruction address: 0xc01c8348 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=4K SMP NR_CPUS=2 P2020RDB-PC Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-rc2-0caacb197b677410bdac81bc34f05235+ #121 NIP: c01c8348 LR: c01cb2bc CTR: 0000000a REGS: c10d7e20 TRAP: 0300 Not tainted (6.0.0-rc2-0caacb197b677410bdac81bc34f05235+) MSR: 00021000 CR: 48044224 XER: 00000000 DEAR: 0007df58 ESR: 00000000 GPR00: c01cb294 c10d7f10 c1045340 00000001 00000004 c112bcc0 00000015 eedf1000 GPR08: 00000003 0007df58 00000000 f0000000 28044228 00000200 00000000 00000000 GPR16: 00000000 00000000 00000000 0275cb7a c0000000 00000001 0000075f 00000000 GPR24: c1031004 00000000 00000000 00000001 c10f0000 eedf1000 00080000 00080000 NIP free_unref_page_prepare.part.93+0x48/0x60 LR free_unref_page+0x84/0x4b8 Call Trace: 0xeedf1000 (unreliable) free_unref_page+0x5c/0x4b8 mem_init+0xd0/0x194 start_kernel+0x4c0/0x6d0 set_ivor+0x13c/0x178 Reported-by: Pali Rohár Signed-off-by: Christophe Leroy Fixes: b0e0d68b1c52 ("powerpc/32: Allow fragmented physical memory") Tested-by: Pali Rohár [mpe: Trim oops] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f08cca5c46d67399c53262eca48e015dcf1841f9.1663695394.git.christophe.leroy@csgroup.eu commit c4167aec98524fa4511b3222303a758b532b6009 Author: David Hildenbrand Date: Tue Sep 20 14:23:01 2022 +0200 powerpc/prom_init: drop PROM_BUG() Unused, let's drop it. Signed-off-by: David Hildenbrand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220920122302.99195-3-david@redhat.com commit 6cc07821adce44e864c3752a3842936a6a7f6aef Author: Christophe Leroy Date: Wed Sep 7 12:05:21 2022 +0200 powerpc/mm: Make PAGE_KERNEL_xxx macros grep-friendly Avoid multi-lines to help getting a complete view when using grep. They still remain under the 100 chars limit. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3bc3f5a51949ee7f52dba36677db23d4337c7995.1662544980.git.christophe.leroy@csgroup.eu commit b997b2f57cae396448bb62c428efa4b112dd90ed Author: Christophe Leroy Date: Wed Sep 7 12:05:01 2022 +0200 powerpc/mm: Reduce redundancy in pgtable.h PAGE_KERNEL_TEXT, PAGE_KERNEL_EXEC and PAGE_AGP are the same for all powerpcs. Remove duplicated definitions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/92254499430d13d99e4a4d7e9ad8e8284cb35380.1662544974.git.christophe.leroy@csgroup.eu commit 73ea68ad0d2f655815b6f1fbe1c5521d72f01b64 Author: Christophe Leroy Date: Mon Sep 5 11:38:25 2022 +0200 powerpc/book3s: Inline first level of update_mmu_cache() update_mmu_cache() voids when hash page tables are not used. On PPC32 that means when MMU_FTR_HPTE_TABLE is not defined. On PPC64 that means when RADIX is enabled. Rename core part of update_mmu_cache() as __update_mmu_cache() and include the initial verification in an inlined caller. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bea5ad0de7f83eff256116816d46c84fa0a444de.1662370698.git.christophe.leroy@csgroup.eu commit 691cdf016d3be6f66a3ea384809be229e0f9c590 Author: Christophe Leroy Date: Wed Sep 7 11:34:45 2022 +0200 powerpc: Rely on generic definition of hugepd_t and is_hugepd when unused CONFIG_ARCH_HAS_HUGEPD is used to tell core mm when huge page directories are used. When they are not used, no need to provide hugepd_t or is_hugepd(), just rely on the core mm fallback definition. For that, change core mm behaviour so that CONFIG_ARCH_HAS_HUGEPD is used instead of indirect is_hugepd macro existence. powerpc being the only user of huge page directories, there is no impact on other architectures. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/da81462d93069bb90fe5e762dd3283a644318937.1662543243.git.christophe.leroy@csgroup.eu commit a26494cf4aeb8e9888428a43f55cc486f06f1334 Author: Christophe Leroy Date: Wed Sep 7 11:34:44 2022 +0200 powerpc/nohash: Remove pgd_huge() stub linux/hugetlb.h has a fallback pgd_huge() macro for when pgd_huge is not defined. Remove the powerpc redundant definitions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ae6aa7fce84f7abcbf67f534271a4a6dd7949b0d.1662543243.git.christophe.leroy@csgroup.eu commit 79c5640ab4460a03535ce0f120193174e7701b65 Author: Michael Ellerman Date: Sat Sep 3 22:36:40 2022 +1000 powerpc/mm/64s: Drop p4d_leaf() Because 64-bit Book3S uses pgtable-nop4d.h, the P4D is folded into the PGD. So P4D entries are actually PGD entries, or vice versa. The other way to think of it is that the P4D is a single entry page table below the PGD. Zero bits of the address are needed to index into the P4D, therefore a P4D entry maps the same size address space as a PGD entry. As explained in the previous commit, there are no huge page sizes supported directly at the PGD level on 64-bit Book3S, so there are also no huge page sizes supported at the P4D level. Therefore p4d_is_leaf() can never be true, so drop the definition and fallback to the default implementation that always returns false. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220903123640.719846-2-mpe@ellerman.id.au commit 51da853e3708852f47cd95e6f5e1821c3d54c3ef Author: Michael Ellerman Date: Sat Sep 3 22:36:39 2022 +1000 powerpc/mm/64s: Drop pgd_huge() On powerpc there are two ways for huge pages to be represented in the top level page table, aka PGD (Page Global Directory). If the address space mapped by an individual PGD entry does not correspond to a given huge page size, then the PGD entry points to a non-standard page table, known as a "hugepd" (Huge Page Directory). The hugepd contains some number of huge page PTEs sufficient to map the address space with the given huge page size. On the other hand, if the address space mapped by an individual PGD entry does correspond exactly to a given huge page size, that PGD entry is used to directly encode the huge page PTE in place. In this case the pgd_huge() wrapper indicates to generic code that the PGD entry is actually a huge page PTE. This commit deals with the pgd_huge() case only, it does nothing with respect to the hugepd case. Over time the size of the virtual address space supported on powerpc has increased several times, which means the location at which huge pages can sit in the tree has also changed. There have also been new huge page sizes added, with the introduction of the Radix MMU. On Power9 and later with the Radix MMU, the largest huge page size in any implementation is 1GB. Since the introduction of Radix, 1GB entries have been supported at the PUD level, with both 4K and 64K base page size. Radix has never had a supported huge page size at the PGD level. On Power8 or earlier, which uses the Hash MMU, or Power9 or later with the Hash MMU enabled, the largest huge page size is 16GB. Using the Hash MMU and a base page size of 4K, 16GB has never been a supported huge page size at the PGD level, due to the geometry being incompatible. The two supported huge page sizes (16M & 16GB) both use the hugepd format. Using the Hash MMU and a base page size of 64K, 16GB pages were supported in the past at the PGD level. However in commit ba95b5d03596 ("powerpc/mm/book3s/64: Rework page table geometry for lower memory usage") the page table layout was reworked to shrink the size of the PGD. As a result the 16GB page size now fits at the PUD level when using 64K base page size. Therefore there are no longer any supported configurations where pgd_huge() can be true, so drop the definitions for pgd_huge(), and fallback to the generic definition which is always false. Fixes: ba95b5d03596 ("powerpc/mm/book3s/64: Rework page table geometry for lower memory usage") Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220903123640.719846-1-mpe@ellerman.id.au commit 456c3005102b18cce6662b1915c6efffe7744dcc Author: Michael Ellerman Date: Mon Sep 19 15:27:55 2022 +1000 powerpc/microwatt: Remove unused early debug code The original microwatt submission[1] included some early debug code for using the Microwatt "potato" UART. The series that was eventually merged switched to using a standard UART, and so doesn't need any special early debug handling. But some of the original code was merged accidentally under the non-existent CONFIG_PPC_EARLY_DEBUG_MICROWATT. Drop the unused code. 1: https://lore.kernel.org/linuxppc-dev/20200509050340.GD1464954@thinks.paulus.ozlabs.org/ Fixes: 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART for console") Reported-by: Lukas Bulwahn Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220919052755.800907-1-mpe@ellerman.id.au commit e74611aa91bb9939dfc4a41b045a1a19227cff98 Author: Michael Ellerman Date: Tue Sep 13 22:45:45 2022 +1000 powerpc/64: Remove unused SYS_CALL_TABLE symbol In interrupt_64.S, formerly entry_64.S, there are two toc entries created for sys_call_table and compat_sys_call_table. These are no longer used, since the system call entry was converted from asm to C, so remove them. Fixes: 68b34588e202 ("powerpc/64/sycall: Implement syscall entry/exit logic in C") Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913124545.2817825-1-mpe@ellerman.id.au commit fdfdcfd504933ed06eb6b4c9df21eede0e213c3e Author: Nicholas Piggin Date: Fri Sep 16 14:07:55 2022 +1000 powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE Const function pointers by convention live in .data.rel.ro if they need to be relocated. Now that .data.rel.ro is linked into the read-only region, put them in the right section. This doesn't make much practical difference, but it will make the C conversion of sys_call_table a smaller change as far as linking goes. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-8-npiggin@gmail.com commit 1e9eca485a840985a663080eb049c420272d4bdd Author: Nicholas Piggin Date: Fri Sep 16 14:07:54 2022 +1000 powerpc/64/build: merge .got and .toc input sections Follow the binutils ld internal linker script and merge .got and .toc input sections in the .got output section. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-7-npiggin@gmail.com commit c787fed11890babda1e4882cd3b6efaf412e1bde Author: Nicholas Piggin Date: Fri Sep 16 14:07:53 2022 +1000 powerpc/64/build: only include .opd with ELFv1 ELFv2 does not use function descriptors so .opd is not required. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-6-npiggin@gmail.com commit b6adc6d6d327229d75607a948cde2349d317f366 Author: Nicholas Piggin Date: Fri Sep 16 14:07:52 2022 +1000 powerpc/build: move .data.rel.ro, .sdata2 to read-only .sdata2 is a readonly small data section for ppc32, and .data.rel.ro is data that needs relocating but is read-only after that so these can both be moved to the read only memory region. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-5-npiggin@gmail.com commit f21ba4499a15b76ad6013ca0a60873dbcf164c7b Author: Nicholas Piggin Date: Fri Sep 16 14:07:51 2022 +1000 powerpc/build: move got, toc, plt, branch_lt sections to read-only This moves linker-related tables from .data to read-only area. Relocations are performed at early boot time before memory is protected, after which there should be no modifications required. Signed-off-by: Nicholas Piggin [mpe: Don't use SPECIAL as reported by lkp@intel.com] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-4-npiggin@gmail.com commit 1faa1235c1a00614bc4849a8dbd0790363c9a22f Author: Nicholas Piggin Date: Fri Sep 16 14:07:50 2022 +1000 powerpc/32/build: move got1/got2 sections out of text Following the example from the binutils default linker script, move .got1 and .got2 out of .text, to just after RO_DATA. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-3-npiggin@gmail.com commit 7082f8e7d2276575a8806370007cbb4a7b9abdce Author: Nicholas Piggin Date: Fri Sep 16 14:07:49 2022 +1000 powerpc: move __end_rodata to cover arch read-only sections powerpc has a number of read-only sections and tables that are put after RO_DATA(). Move the __end_rodata symbol to cover these as well. Setting memory to read-only at boot is done using __init_begin, change that to use __end_rodata. This makes is_kernel_rodata() exactly cover the read-only region, as well as other things using __end_rodata (e.g., kernel/dma/debug.c). Boot dmesg also prints the rodata size more accurately. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916040755.2398112-2-npiggin@gmail.com commit b150a4d12b919baf956b807aa305cf78df03d0fe Author: Michael Ellerman Date: Fri Sep 16 14:41:24 2022 +1000 powerpc/vmlinux.lds: Add an explicit symbol for the SRWX boundary Currently __init_begin is used as the boundary for strict RWX between executable/read-only text and data, and non-executable (after boot) code and data. But that's a little subtle, so add an explicit symbol to document that the SRWX boundary lies there, and add a comment making it clear that __init_begin must also begin there. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916131422.318752-2-mpe@ellerman.id.au commit 331771e836e6a32c8632d8cf5e2cdd94471258ad Author: Michael Ellerman Date: Fri Sep 16 14:40:57 2022 +1000 powerpc/vmlinux.lds: Ensure STRICT_ALIGN_SIZE is at least page aligned Add a check that STRICT_ALIGN_SIZE is aligned to at least PAGE_SIZE. That then makes the alignment to PAGE_SIZE immediately after the alignment to STRICT_ALIGN_SIZE redundant, so remove it. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220916131422.318752-1-mpe@ellerman.id.au commit 0c32903197ce9f7119aee75a6bcaa4b49e0cd21a Author: Michael Ellerman Date: Sat Sep 17 16:36:47 2022 +1000 powerpc/64: Remove unused prom_init_toc symbols Commit 24d33ac5b8ff ("powerpc/64s: Make prom_init require RELOCATABLE") made prom_init depend on CONFIG_RELOCATABLE. But it missed cleaning up a case in the linker script for RELOCATABLE=n, and associated symbols. Remove them now. Fixes: 24d33ac5b8ff ("powerpc/64s: Make prom_init require RELOCATABLE") Reported-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220920131157.1032707-1-mpe@ellerman.id.au commit 9a10ccb29c0a2befa5a9f691ed0ae37ee3e799a8 Author: Nicholas Piggin Date: Mon Sep 26 15:38:23 2022 +1000 powerpc/pseries: move hcall_tracepoint_refcount out of .toc The .toc section is not really intended for arbitrary data. Writable data in particular prevents making the TOC read-only after relocation. Move hcall_tracepoint_refcount into the .data section. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220926053823.2668799-1-npiggin@gmail.com commit 857bc13f857aea957ae038b2b43c28560976024a Author: Josef Bacik Date: Mon Sep 12 12:27:42 2022 -0700 btrfs: implement a nowait option for tree searches For NOWAIT IOCBs we'll need a way to tell search to not wait on locks or anything. Accomplish this by adding a path->nowait flag that will use trylocks and skip reading of metadata, returning -EAGAIN in either of these cases. For now we only need this for reads, so only the read side is handled. Add an ASSERT() to catch anybody trying to use this for writes so they know they'll have to implement the write side. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit a4d1846512e12f9e84be63b3f2f2165e4d0d2d1e Author: Uwe Kleine-König <(address hidden)> Date: Mon Sep 26 12:40:11 2022 +0200 pxa: Drop if with an always false condition The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so ssp is never NULL. Also note that returning an error code from a remove callback doesn't result in the device staying bound. It's still removed and devm callbacks are called. So the memory that ssp pointed to during probe, goes away without the node being removed from ssp_list. The probable result of an early exit is accessing freed memory when the list is walked the next time. Signed-off-by: Uwe Kleine-König <(address hidden)> Signed-off-by: Arnd Bergmann commit 611df5d6616d80a22906c352ccd80c395982fbd9 Author: Stefan Roesch Date: Mon Sep 12 12:27:41 2022 -0700 mm: export balance_dirty_pages_ratelimited_flags() Export the function balance_dirty_pages_ratelimited_flags(). It is now also called from btrfs. Reviewed-by: Filipe Manana Signed-off-by: Stefan Roesch Reviewed-by: David Sterba Signed-off-by: David Sterba commit d7f67ac9a928fa158a95573406eac0a887bbc28c Author: Qu Wenruo Date: Mon Sep 12 13:44:37 2022 +0800 btrfs: relax block-group-tree feature dependency checks [BUG] When one user did a wrong attempt to clear block group tree, which can not be done through mount option, by using "-o clear_cache,space_cache=v2", it will cause the following error on a fs with block-group-tree feature: BTRFS info (device dm-1): force clearing of disk cache BTRFS info (device dm-1): using free space tree BTRFS info (device dm-1): clearing free space tree BTRFS info (device dm-1): clearing compat-ro feature flag for FREE_SPACE_TREE (0x1) BTRFS info (device dm-1): clearing compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2) BTRFS error (device dm-1): block-group-tree feature requires fres-space-tree and no-holes BTRFS error (device dm-1): super block corruption detected before writing it to disk BTRFS: error (device dm-1) in write_all_supers:4318: errno=-117 Filesystem corrupted (unexpected superblock corruption detected) BTRFS warning (device dm-1: state E): Skipping commit of aborted transaction. [CAUSE] Although the dependency for block-group-tree feature is just an artificial one (to reduce test matrix), we put the dependency check into btrfs_validate_super(). This is too strict, and during space cache clearing, we will have a window where free space tree is cleared, and we need to commit the super block. In that window, we had block group tree without v2 cache, and triggered the artificial dependency check. This is not necessary at all, especially for such a soft dependency. [FIX] Introduce a new helper, btrfs_check_features(), to do all the runtime limitation checks, including: - Unsupported incompat flags check - Unsupported compat RO flags check - Setting missing incompat flags - Artificial feature dependency checks Currently only block group tree will rely on this. - Subpage runtime check for v1 cache With this helper, we can move quite some checks from open_ctree()/btrfs_remount() into it, and just call it after btrfs_parse_options(). Now "-o clear_cache,space_cache=v2" will not trigger the above error anymore. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba [ edit messages ] Signed-off-by: David Sterba commit 5467abba1cbd9e10be5b44a12ce42b6af08ba38b Author: Qu Wenruo Date: Tue Sep 13 13:31:14 2022 +0800 btrfs: move end_io_func argument to btrfs_bio_ctrl structure For function submit_extent_page() and alloc_new_bio(), we have an argument @end_io_func to indicate the end io function. But that function never change inside any call site of them, thus no need to pass the pointer around everywhere. There is a better match for the lifespan of all the call sites, as we have btrfs_bio_ctrl structure, thus we can put the endio function pointer there, and grab the pointer every time we allocate a new bio. Also add extra ASSERT()s to make sure every call site of submit_extent_page() and alloc_new_bio() has properly set the pointer inside btrfs_bio_ctrl. This removes one argument from the already long argument list of submit_extent_page(). Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 209ecde55c4a642c988f0beba0dfaaa260ab034d Author: Qu Wenruo Date: Tue Sep 13 13:31:13 2022 +0800 btrfs: switch page and disk_bytenr argument position for submit_extent_page() Normally we put (page, pg_len, pg_offset) arguments together, just like what __bio_add_page() does. But in submit_extent_page(), what we got is, (page, disk_bytenr, pg_len, pg_offset), which sometimes can be confusing. Change the order to (disk_bytenr, page, pg_len, pg_offset) to make it to follow the common schema. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 814b6f9158847767f53e3e5e5b620bc572ecaf91 Author: Qu Wenruo Date: Tue Sep 13 13:31:12 2022 +0800 btrfs: update the comment for submit_extent_page() Since commit 390ed29b817e ("btrfs: refactor submit_extent_page() to make bio and its flag tracing easier"), we are using bio_ctrl structure to replace some of arguments of submit_extent_page(). But unfortunately that commit didn't update the comment for submit_extent_page(), thus some arguments are stale like: - bio_ret - mirror_num Those are all contained in bio_ctrl now. - prev_bio_flags We no longer use this flag to determine if we can merge bios. Update the comment for submit_extent_page() to keep it up-to-date. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d6921739449f229de73671d666d384dd2be44729 Author: Josef Bacik Date: Wed Sep 14 19:04:51 2022 -0400 btrfs: add struct declarations in dev-replace.h dev-replace.h just has function prototypes for device replace, however if you happen to include it in the wrong order you'll get compile errors because of different structures not being defined. Since these are just pointer args to functions we can declare them at the top in order to reduce the pain of using the header. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9b9b88546539767b8e1a39dfe322285cce4647ed Author: Josef Bacik Date: Wed Sep 14 19:04:50 2022 -0400 btrfs: use a runtime flag to indicate an inode is a free space inode We always check the root of an inode as well as it's inode number to determine if it's a free space inode. This is problematic as the helper is in a header file where it doesn't have the fs_info definition. To avoid this and make the check a little cleaner simply add a flag to the runtime_flags to indicate that the inode is a free space inode, set that when we create the inode, and then change the helper to check for this flag. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e256927b8801f3cd1449e03629c75d5b9a379055 Author: Josef Bacik Date: Wed Sep 14 19:04:49 2022 -0400 btrfs: open code and remove btrfs_insert_inode_hash helper This exists to insert the btree_inode in the super blocks inode hash table. Since it's only used for the btree inode move the code to where we use it in disk-io.c and remove the helper. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ee8ba05cbbcee68113133249fc4f73e00a7ac3f5 Author: Josef Bacik Date: Wed Sep 14 19:04:48 2022 -0400 btrfs: open code and remove btrfs_inode_sectorsize helper This is defined in btrfs_inode.h, and dereferences btrfs_root and btrfs_fs_info, both of which aren't defined in btrfs_inode.h. Additionally, in many places we already have root or fs_info, so this helper often makes the code harder to read. So delete the helper and simply open code it in the few places that we use it. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2b6433c7f620b61ba5fac52a63053f6c56483f80 Author: Josef Bacik Date: Wed Sep 14 19:04:47 2022 -0400 btrfs: move btrfs_ordered_sum_size into file-item.c This is defined in ordered-data.h, but is only used in file-item.c. Move this to file-item.c as it doesn't need to be global. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit d9d88fde56d388108c07e87630caeac59781dd3e Author: Josef Bacik Date: Wed Sep 14 19:04:46 2022 -0400 btrfs: move the fs_info related helpers closer to fs_info in ctree.h This is purely cosmetic, to make it straightforward to copy and paste the definition and helpers from ctree.h into fs.h. These are helpers that act directly on the fs_info, and were scattered throughout ctree.h. Move them directly below the fs_info definition to make it easier to move them later. This includes the exclop prototypes, which shares an enum that's used in struct btrfs_fs_info as well. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit f119553fd3d2256b211d98fe9822b85510c59d8b Author: Josef Bacik Date: Wed Sep 14 19:04:45 2022 -0400 btrfs: move btrfs_csum_ptr to inode.c This helper is only used in inode.c, move it locally to that file instead of defining it in ctree.h. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0e75f0054a2a16295352f453eb1683b4d1b940dd Author: Josef Bacik Date: Wed Sep 14 19:04:44 2022 -0400 btrfs: move fs_info forward declarations to the top of ctree.h In order to make it more straightforward to move the fs_info struct and it's related structures, move the struct declarations to the top of ctree.h. This will make it easier to clean up after the fact. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2103da3b0e3a3a4846c74438ff44258e68567127 Author: Josef Bacik Date: Wed Sep 14 19:04:43 2022 -0400 btrfs: move btrfs_swapfile_pin into volumes.h This isn't a great spot for this, but one of the swapfile helper functions is in volumes.c, so move the struct to volumes.h. In the future when we have better separation of code there will be a more natural spot for this. Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c2e79e865b87c2920a3cd39de69c35f2bc758a51 Author: Josef Bacik Date: Wed Sep 14 19:04:40 2022 -0400 btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h This is defined in volumes.c, move the prototype into volumes.h. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 43712116f8c8fb9ae9e0853f1411f25ce3d01b7f Author: Josef Bacik Date: Wed Sep 14 19:04:39 2022 -0400 btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h The code for this helper is in space-info.c, move the prototype to space-info.h. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c29abab4f9edf843ccbfa9a552a58a12c41d2ce4 Author: Josef Bacik Date: Wed Sep 14 19:04:38 2022 -0400 btrfs: move btrfs_full_stripe_locks_tree into block-group.h This is actually embedded in struct btrfs_block_group, so move this definition to block-group.h, and then open-code the init of the tree where we init the rest of the block group instead of using a helper. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 16708a889867a77fb3f72820fe5046db9e437eee Author: Josef Bacik Date: Wed Sep 14 19:04:37 2022 -0400 btrfs: move btrfs_caching_type to block-group.h This is a block group related definition, move it into block-group.h. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit bd86a532b26355695e87a6cf394d9c8bd24686c9 Author: Christoph Hellwig Date: Wed Sep 7 13:17:41 2022 +0200 btrfs: stop tracking failed reads in the I/O tree There is a separate I/O failure tree to track the fail reads, so remove the extra EXTENT_DAMAGED bit in the I/O tree as it's set but never used. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 23408d8196779f16f3bdcb592dd3820e07b6b119 Author: Josef Bacik Date: Fri Sep 9 17:53:49 2022 -0400 btrfs: remove is_data_inode() checks in extent-io-tree.c We're only initializing extent_io_tree's with a private data if we're a normal inode, so we don't need this extra check. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit efb0645bd9dfd1cbfaab766444de4748556dc103 Author: Josef Bacik Date: Fri Sep 9 17:53:48 2022 -0400 btrfs: don't init io tree with private data for non-inodes We only use this for normal inodes, so don't set it if we're not a normal inode. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit bd015294af4d919f94ede252e035f3c11638ea1f Author: Josef Bacik Date: Fri Sep 9 17:53:47 2022 -0400 btrfs: replace delete argument with EXTENT_CLEAR_ALL_BITS Instead of taking up a whole argument to indicate we're clearing everything in a range, simply add another EXTENT bit to control this, and then update all the callers to drop this argument from the clear_extent_bit variants. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit b71fb16b2f41e7ba59cbee22fdb81665f0af08fc Author: Josef Bacik Date: Fri Sep 9 17:53:46 2022 -0400 btrfs: don't clear CTL bits when trying to release extent state When trying to release the extent states due to memory pressure we'll set all the bits except LOCKED, NODATASUM, and DELALLOC_NEW. This includes some of the CTL bits, which isn't really a problem but isn't correct either. Exclude the CTL bits from this clearing. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 71528e9e16c7ade3771f5ef9387673580cb2db38 Author: Josef Bacik Date: Fri Sep 9 17:53:45 2022 -0400 btrfs: get rid of extent_io_tree::dirty_bytes This was used as an optimization for count_range_bits(EXTENT_DIRTY), which was used by the failed record code. However this was removed in this series by patch "btrfs: convert the io_failure_tree to a plain rb_tree" which was the last user of this optimization. Remove the ->dirty_bytes as nobody cares anymore. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4374d03d21a9577c8536d78a941fba105143769d Author: Josef Bacik Date: Fri Sep 9 17:53:44 2022 -0400 btrfs: remove extent_io_tree::track_uptodate Since commit 78361f64ff42 ("btrfs: remove unnecessary EXTENT_UPTODATE state in buffered I/O path") we no longer check ->track_uptodate, remove it. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 570eb97bace8743f45c6830b64c7a0889d0915dd Author: Josef Bacik Date: Fri Sep 9 17:53:43 2022 -0400 btrfs: unify the lock/unlock extent variants We have two variants of lock/unlock extent, one set that takes a cached state, another that does not. This is slightly annoying, and generally speaking there are only a few places where we don't have a cached state. Simplify this by making lock_extent/unlock_extent the only variant and make it take a cached state, then convert all the callers appropriately. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 291bbb1e7ea84ef2aba3a5756b9c573d2c572bd7 Author: Josef Bacik Date: Fri Sep 9 17:53:42 2022 -0400 btrfs: drop extent_changeset from set_extent_bit The only places that set extent_changeset is set_record_extent_bits, everywhere else sets it to NULL. Drop this argument from set_extent_bit. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 994bcd1eae5bc6f24a90765b1fb8be471ab56b33 Author: Josef Bacik Date: Fri Sep 9 17:53:41 2022 -0400 btrfs: remove failed_start argument from set_extent_bit This is only used for internal locking related helpers, everybody else just passes in NULL. I've changed set_extent_bit to __set_extent_bit and made it static, removed failed_start from set_extent_bit and have it call __set_extent_bit with a NULL failed_start, and I've moved some code down below the now static __set_extent_bit. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit dbbf49928f2eb118036766fae503be1314620cce Author: Josef Bacik Date: Fri Sep 9 17:53:40 2022 -0400 btrfs: remove the wake argument from clear_extent_bits This is only used in the case that we are clearing EXTENT_LOCKED, so infer this value from the bits passed in instead of taking it as an argument. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c07d1004c55cd081aae9334227eabc1588179a65 Author: Josef Bacik Date: Fri Sep 9 17:53:39 2022 -0400 btrfs: drop exclusive_bits from set_extent_bit This is only ever set if we have EXTENT_LOCKED set, so simply push this into the function itself and remove the function argument. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit d6f65c27f5efedf515c37b40d93353f20495c638 Author: Josef Bacik Date: Fri Sep 9 17:53:38 2022 -0400 btrfs: move extent io tree unrelated prototypes to their appropriate header These prototypes have nothing to do with the extent_io_tree helpers, move them to their appropriate header. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e63b81aef26ba07849a3090befde12f2653aa6a8 Author: Josef Bacik Date: Fri Sep 9 17:53:37 2022 -0400 btrfs: use next_state/prev_state in merge_state We use rb_next/rb_prev and then get the entry for the adjacent items in an extent io tree. We have helpers for this, so convert merge_state to use next_state/prev_state and simplify the code. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 43b068cad58f2ae9cfb929a0f313499f70c16521 Author: Josef Bacik Date: Fri Sep 9 17:53:36 2022 -0400 btrfs: make tree_search_prev_next return extent_state's Instead of doing the rb_entry again once we return from this function, simply return the actual states themselves, and then clean up the only user of this helper to handle states instead of nodes. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e349fd3bfbe5808e1a6b2e0dc996e3da0bfe99e1 Author: Josef Bacik Date: Fri Sep 9 17:53:35 2022 -0400 btrfs: make tree_search_for_insert return extent_state We use this to search for an extent state, or return the nodes we need to insert a new extent state. This means we have the following pattern node = tree_search_for_insert(); if (!node) { /* alloc and insert. */ goto again; } state = rb_entry(node, struct extent_state, rb_node); we don't use the node for anything else. Making tree_search_for_insert() return the extent_state means we can drop the rb_node and clean this up by eliminating the rb_entry. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit aa852dabf9646cb2517e3e7d7d9077201938a6d3 Author: Josef Bacik Date: Fri Sep 9 17:53:34 2022 -0400 btrfs: make tree_search return struct extent_state We have a consistent pattern of n = tree_search(); if (!n) goto out; state = rb_entry(n, struct extent_state, rb_node); while (state) { /* do something. */ } which is a bit redundant. If we make tree_search return the state we can simply have state = tree_search(); while (state) { /* do something. */ } which cleans up the code quite a bit. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ccaeff929098dcad1661d0e4d524e569bac949be Author: Josef Bacik Date: Fri Sep 9 17:53:33 2022 -0400 btrfs: use next_state instead of rb_next where we can We can simplify a lot of these functions where we have to cycle through extent_state's by simply using next_state() instead of rb_next(). In many spots this allows us to do things like while (state) { /* whatever */ state = next_state(state); } instead of while (1) { state = rb_entry(n, struct extent_state, rb_node); n = rb_next(n); if (!n) break; } Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 071d19f5130ff699fccf6b766dd6366f5d861da7 Author: Josef Bacik Date: Fri Sep 9 17:53:32 2022 -0400 btrfs: remove struct tree_entry in extent-io-tree.c This existed when we overloaded the tree manipulation functions for both the extent_io_tree and the extent buffer tree. However the extent buffers are now stored in a radix tree, so we no longer need this abstraction. Remove struct tree_entry and use extent_state directly instead. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a4055213bf6912d850859f9166ee8016a557d4bf Author: Josef Bacik Date: Fri Sep 9 17:53:31 2022 -0400 btrfs: unexport all the temporary exports for extent-io-tree.c Now that we've moved everything we can unexport all the temporary exports, move the random helpers, and mark everything as static again. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8038a1f46f37680342d81d443f17bbd1b5b768c Author: Josef Bacik Date: Fri Sep 9 17:53:30 2022 -0400 btrfs: unexport btrfs_debug_check_extent_io_range We no longer need to export this as all users are in extent-io-tree.c, remove it from the header and put it into extent-io-tree.c. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e3974c669472fed95eca723b6ab1340d0db33334 Author: Josef Bacik Date: Fri Sep 9 17:53:29 2022 -0400 btrfs: move core extent_io_tree functions to extent-io-tree.c This is still huge, but unfortunately I cannot make it smaller without renaming tree_search() and changing all the callers to use the new name, then moving those chunks and then changing the name back. This feels like too much churn for code movement, so I've limited this to only things that called tree_search(). With this patch all of the extent_io_tree code is now in extent-io-tree.c. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 38830018387e64e5aba5a654da7cba6e0ec03098 Author: Josef Bacik Date: Fri Sep 9 17:53:28 2022 -0400 btrfs: move a few exported extent_io_tree helpers to extent-io-tree.c These are the last few helpers that do not rely on tree_search() and who's other helpers are exported and in extent-io-tree.c already. Move these across now in order to make the core move smaller. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 04eba8932392f6277ec0e6fca66370e47c4405ee Author: Josef Bacik Date: Fri Sep 9 17:53:27 2022 -0400 btrfs: temporarily export and then move extent state helpers In order to avoid moving all of the related code at once temporarily export all of the extent state related helpers. Then move these helpers into extent-io-tree.c. We will clean up the exports and make them static in followup patches. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 91af24e48474d9979a70af3894ba7544bb132b82 Author: Josef Bacik Date: Fri Sep 9 17:53:26 2022 -0400 btrfs: temporarily export and move core extent_io_tree tree functions A lot of the various internals of extent_io_tree call these two functions for insert or searching the rb tree for entries, so temporarily export them and then move them to extent-io-tree.c. We can't move tree_search() without renaming it, and I don't want to introduce a bunch of churn just to do that, so move these functions first and then we can move a few big functions and then the remaining users of tree_search(). Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6962541e964ff3004515dad65de92ec63ff4c182 Author: Josef Bacik Date: Fri Sep 9 17:53:25 2022 -0400 btrfs: move btrfs_debug_check_extent_io_range into extent-io-tree.c This helper is used by a lot of the core extent_io_tree helpers, so temporarily export it and move it into extent-io-tree.c in order to make it straightforward to migrate the helpers in batches. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ec39e39bbf97105c5ae95af485663a927dd07565 Author: Josef Bacik Date: Fri Sep 9 17:53:24 2022 -0400 btrfs: export wait_extent_bit This is used by the subpage code in addition to lock_extent_bits, so export it so we can move it out of extent_io.c Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a66318872c410a583470a8c3b65e99c1f923c950 Author: Josef Bacik Date: Fri Sep 9 17:53:23 2022 -0400 btrfs: move simple extent bit helpers out of extent_io.c These are just variants and wrappers around the actual work horses of the extent state. Extract these out of extent_io.c. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ad795329574c874d05084c11db01a71a5a824d47 Author: Josef Bacik Date: Fri Sep 9 17:53:22 2022 -0400 btrfs: convert BUG_ON(EXTENT_BIT_LOCKED) checks to ASSERT's We only call these functions from the qgroup code which doesn't call with EXTENT_BIT_LOCKED. These are BUG_ON()'s that exist to keep us developers from using these functions with EXTENT_BIT_LOCKED, so convert them to ASSERT()'s. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 83cf709a89fb97e78e60f310ea5f2b283e0f581c Author: Josef Bacik Date: Fri Sep 9 17:53:21 2022 -0400 btrfs: move extent state init and alloc functions to their own file Start cleaning up extent_io.c by moving the extent state code out of it. This patch starts with the extent state allocation code and the extent_io_tree init code. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c45379a20fbcbbd166966711cf9481ecb41b8271 Author: Josef Bacik Date: Fri Sep 9 17:53:20 2022 -0400 btrfs: temporarily export alloc_extent_state helpers We're going to move this code in stages, but while we're doing that we need to export these helpers so we can more easily move the code into the new file. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a40246e8afc0af3ffdee21854fb755c9364b8346 Author: Josef Bacik Date: Fri Sep 9 17:53:19 2022 -0400 btrfs: separate out the eb and extent state leak helpers Currently we have the add/del functions generic so that we can use them for both extent buffers and extent states. We want to separate this code however, so separate these helpers into per-object helpers in anticipation of the split. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a62a3bd9546b91a46bbb74f4b4a49815b64875b1 Author: Josef Bacik Date: Fri Sep 9 17:53:18 2022 -0400 btrfs: separate out the extent state and extent buffer init code In order to help separate the extent buffer from the extent io tree code we need to break up the init functions. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit cdca85b092fbf4ce6f209b174ac3e7ef2b80bebf Author: Josef Bacik Date: Fri Sep 9 17:53:17 2022 -0400 btrfs: use find_first_extent_bit in btrfs_clean_io_failure Currently we're using find_first_extent_bit_state to check if our state contains the given failrec range, however this is more of an internal extent_io_tree helper, and is technically unsafe to use because we're accessing the state outside of the extent_io_tree lock. Instead use the normal helper find_first_extent_bit which returns the range of the extent state we find in find_first_extent_bit_state and use that to do our sanity checking. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 87c11705cc94d6b822551e88d8d4579fe0370051 Author: Josef Bacik Date: Fri Sep 9 17:53:16 2022 -0400 btrfs: convert the io_failure_tree to a plain rb_tree We still have this oddity of stashing the io_failure_record in the extent state for the io_failure_tree, which is leftover from when we used to stuff private pointers in extent_io_trees. However this doesn't make a lot of sense for the io failure records, we can simply use a normal rb_tree for this. This will allow us to further simplify the extent_io_tree code by removing the io_failure_rec pointer from the extent state. Convert the io_failure_tree to an rb tree + spinlock in the inode, and then use our rb tree simple helpers to insert and find failed records. This greatly cleans up this code and makes it easier to separate out the extent_io_tree code. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a2061748052c0e41dd494c8760d57ba407b30e68 Author: Josef Bacik Date: Fri Sep 9 17:53:15 2022 -0400 btrfs: unexport internal failrec functions These are internally used functions and are not used outside of extent_io.c. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0d0a762c419a98dcf40db20b7f2681d7b7191d46 Author: Josef Bacik Date: Fri Sep 9 17:53:14 2022 -0400 btrfs: rename clean_io_failure and remove extraneous args This is exported, so rename it to btrfs_clean_io_failure. Additionally we are passing in the io tree's and such from the inode, so instead of doing all that simply pass in the inode itself and get all the components we need directly inside of btrfs_clean_io_failure. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 748f553c3c4c4f175c6c834358632aff802d72cf Author: David Sterba Date: Mon Sep 5 18:32:23 2022 +0200 btrfs: add KCSAN annotations for unlocked access to block_rsv->full KCSAN reports that there's unlocked access mixed with locked access, which is technically correct but is not a bug. To avoid false alerts at least from KCSAN, add annotation and use a wrapper whenever ->full is accessed for read outside of lock. It is used as a fast check and only advisory. In the worst case the block reserve is found !full and becomes full in the meantime, but properly handled. Depending on the value of ->full, btrfs_block_rsv_release decides where to return the reservation, and block_rsv_release_bytes handles a NULL pointer for block_rsv and if it's not NULL then it double checks the full status under a lock. Link: https://lore.kernel.org/linux-btrfs/CAAwBoOJDjei5Hnem155N_cJwiEkVwJYvgN-tQrwWbZQGhFU=cA@mail.gmail.com/ Link: https://lore.kernel.org/linux-btrfs/YvHU/vsXd7uz5V6j@hungrycats.org Reported-by: Zygo Blaxell Signed-off-by: David Sterba commit b0b47a38596f32130cb6cbdd4f7be80778fc359a Author: Filipe Manana Date: Thu Sep 8 12:31:52 2022 +0100 btrfs: remove useless used space increment during space reservation At space-info.c:__reserve_bytes(), we increment the 'used' variable, but then we don't use the variable anymore, making the increment pointless. The increment became useless with commit 2e294c60497f29 ("btrfs: simplify the logic in need_preemptive_flushing"), so just remove it. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 650c8a9c7d88f06c23a9794388623822f068a5df Author: Christoph Hellwig Date: Wed Sep 7 11:22:14 2022 +0200 btrfs: zoned: refactor device checks in btrfs_check_zoned_mode btrfs_check_zoned_mode is really hard to follow, mostly due to the fact that a lot of the checks use duplicate conditions after support for zone emulation for conventional devices on file systems with the ZONED flag was added. Fix this by factoring out the check for host managed devices for !ZONED file systems into a separate helper and then simplifying the rest of the code. Reviewed-by: Naohiro Aota Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 03ad25310fd45e52ab3a5a3c3e367aec4f7bd364 Author: Christophe JAILLET Date: Sat Aug 6 21:42:34 2022 +0200 btrfs: qgroup: fix a typo in a comment Add a missing 'r'. s/qgoup/qgroup/ . Codespell does not catch that for some reason. Signed-off-by: Christophe JAILLET Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6ea1a5264b7eef04f71f8bc0045489b3cf6121cb Author: Gaosheng Cui Date: Fri Sep 9 14:54:51 2022 +0800 btrfs: remove btrfs_bit_radix_cachep declaration btrfs_bit_radix_cachep has been removed since commit 45c06543afe2 ("Btrfs: remove unused btrfs_bit_radix slab"), so remove it. Reviewed-by: Josef Bacik Signed-off-by: Gaosheng Cui Reviewed-by: David Sterba Signed-off-by: David Sterba commit 011b46c30476329709571008a108765133ed78e0 Author: Qu Wenruo Date: Wed Aug 24 09:14:09 2022 +0800 btrfs: skip subtree scan if it's too high to avoid low stall in btrfs_commit_transaction() Btrfs qgroup has a long history of bringing performance penalty in btrfs_commit_transaction(). Although we tried our best to migrate such impact, there is still an unsolved call site, btrfs_drop_snapshot(). This function will find the highest shared tree block and modify its extent ownership to do a subvolume/snapshot dropping. Such change will affect the whole subtree, and cause tons of qgroup dirty extents and stall btrfs_commit_transaction(). To avoid such problem, here we introduce a new sysfs interface, /sys/fs/btrfs//qgroups/drop_subptree_threshold, to determine at whether and at which level we should skip qgroup accounting for subtree dropping. The default value is BTRFS_MAX_LEVEL, thus every subtree drop will go through qgroup accounting, to ensure qgroup numbers are kept as consistent as possible. While for performance sensitive cases, add a way to change the values to more reasonable values like 3, to make any subtree, which is at or higher than level 3, to mark qgroup inconsistent and skip the accounting. The cost is obvious, the qgroup number is no longer consistent, but at least performance is more reasonable, and users have the control. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e15e9f43c7ca25603fcf4c20d44ec777726f1034 Author: Qu Wenruo Date: Wed Aug 24 09:14:08 2022 +0800 btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING to skip qgroup accounting The new flag will make btrfs qgroup skip all its time consuming qgroup accounting. The lifespan is the same as BTRFS_QGROUP_RUNTIME_FLAG_CANCEL_RESCAN, only get cleared after a new rescan. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e562a8bdf652b010ce2525bcf15d145c9d3932bf Author: Qu Wenruo Date: Wed Aug 24 09:14:07 2022 +0800 btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_CANCEL_RESCAN Introduce a new runtime flag, BTRFS_QGROUP_RUNTIME_FLAG_CANCEL_RESCAN, which will inform qgroup rescan to cancel its work asynchronously. This is to address the window when an operation makes qgroup numbers inconsistent (like qgroup inheriting) while a qgroup rescan is running. In that case, qgroup inconsistent flag will be cleared when qgroup rescan finishes. But we changed the ownership of some extents, which means the rescan is already meaningless, and the qgroup inconsistent flag should not be cleared. With the new flag, each time we set INCONSISTENT flag, we also set this new flag to inform any running qgroup rescan to exit immediately, and leaving the INCONSISTENT flag there. The new runtime flag can only be cleared when a new rescan is started. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e71564c0438a1c0cffc5c8eb302ec5d849103b08 Author: Qu Wenruo Date: Wed Aug 24 09:14:06 2022 +0800 btrfs: introduce BTRFS_QGROUP_STATUS_FLAGS_MASK for later expansion Currently we only have 3 qgroup flags: - BTRFS_QGROUP_STATUS_FLAG_ON - BTRFS_QGROUP_STATUS_FLAG_RESCAN - BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT These flags match the on-disk flags used in btrfs_qgroup_status. But we're going to introduce extra runtime flags which will not reach disks. So here we introduce a new mask, BTRFS_QGROUP_STATUS_FLAGS_MASK, to make sure only those flags can reach disks. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ed2e35d85d61d00132dee8c04d02c837ebceaba2 Author: Qu Wenruo Date: Wed Aug 24 09:14:05 2022 +0800 btrfs: sysfs: introduce global qgroup attribute group Although we already have info kobject for each qgroup, we don't have global qgroup info attributes to show things like enabled or inconsistent status flags. Add this qgroups attribute groups, and the first member is qgroup_flags, which is a read-only attribute to show human readable qgroup flags. The path is: /sys/fs/btrfs//qgroups/enabled /sys/fs/btrfs//qgroups/inconsistent The output is simple, just 1 or 0. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ac3c0d36a2a2f7a8f9778faef3f2639f5bf29d44 Author: Filipe Manana Date: Thu Sep 1 14:18:30 2022 +0100 btrfs: make fiemap more efficient and accurate reporting extent sharedness The current fiemap implementation does not scale very well with the number of extents a file has. This is both because the main algorithm to find out the extents has a high algorithmic complexity and because for each extent we have to check if it's shared. This second part, checking if an extent is shared, is significantly improved by the two previous patches in this patchset, while the first part is improved by this specific patch. Every now and then we get reports from users mentioning fiemap is too slow or even unusable for files with a very large number of extents, such as the two recent reports referred to by the Link tags at the bottom of this change log. To understand why the part of finding which extents a file has is very inefficient, consider the example of doing a full ranged fiemap against a file that has over 100K extents (normal for example for a file with more than 10G of data and using compression, which limits the extent size to 128K). When we enter fiemap at extent_fiemap(), the following happens: 1) Before entering the main loop, we call get_extent_skip_holes() to get the first extent map. This leads us to btrfs_get_extent_fiemap(), which in turn calls btrfs_get_extent(), to find the first extent map that covers the file range [0, LLONG_MAX). btrfs_get_extent() will first search the inode's extent map tree, to see if we have an extent map there that covers the range. If it does not find one, then it will search the inode's subvolume b+tree for a fitting file extent item. After finding the file extent item, it will allocate an extent map, fill it in with information extracted from the file extent item, and add it to the inode's extent map tree (which requires a search for insertion in the tree). 2) Then we enter the main loop at extent_fiemap(), emit the details of the extent, and call again get_extent_skip_holes(), with a start offset matching the end of the extent map we previously processed. We end up at btrfs_get_extent() again, will search the extent map tree and then search the subvolume b+tree for a file extent item if we could not find an extent map in the extent tree. We allocate an extent map, fill it in with the details in the file extent item, and then insert it into the extent map tree (yet another search in this tree). 3) The second step is repeated over and over, until we have processed the whole file range. Each iteration ends at btrfs_get_extent(), which does a red black tree search on the extent map tree, then searches the subvolume b+tree, allocates an extent map and then does another search in the extent map tree in order to insert the extent map. In the best scenario we have all the extent maps already in the extent tree, and so for each extent we do a single search on a red black tree, so we have a complexity of O(n log n). In the worst scenario we don't have any extent map already loaded in the extent map tree, or have very few already there. In this case the complexity is much higher since we do: - A red black tree search on the extent map tree, which has O(log n) complexity, initially very fast since the tree is empty or very small, but as we end up allocating extent maps and adding them to the tree when we don't find them there, each subsequent search on the tree gets slower, since it's getting bigger and bigger after each iteration. - A search on the subvolume b+tree, also O(log n) complexity, but it has items for all inodes in the subvolume, not just items for our inode. Plus on a filesystem with concurrent operations on other inodes, we can block doing the search due to lock contention on b+tree nodes/leaves. - Allocate an extent map - this can block, and can also fail if we are under serious memory pressure. - Do another search on the extent maps red black tree, with the goal of inserting the extent map we just allocated. Again, after every iteration this tree is getting bigger by 1 element, so after many iterations the searches are slower and slower. - We will not need the allocated extent map anymore, so it's pointless to add it to the extent map tree. It's just wasting time and memory. In short we end up searching the extent map tree multiple times, on a tree that is growing bigger and bigger after each iteration. And besides that we visit the same leaf of the subvolume b+tree many times, since a leaf with the default size of 16K can easily have more than 200 file extent items. This is very inefficient overall. This patch changes the algorithm to instead iterate over the subvolume b+tree, visiting each leaf only once, and only searching in the extent map tree for file ranges that have holes or prealloc extents, in order to figure out if we have delalloc there. It will never allocate an extent map and add it to the extent map tree. This is very similar to what was previously done for the lseek's hole and data seeking features. Also, the current implementation relying on extent maps for figuring out which extents we have is not correct. This is because extent maps can be merged even if they represent different extents - we do this to minimize memory utilization and keep extent map trees smaller. For example if we have two extents that are contiguous on disk, once we load the two extent maps, they get merged into a single one - however if only one of the extents is shared, we end up reporting both as shared or both as not shared, which is incorrect. This reproducer triggers that bug: $ cat fiemap-bug.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT # Create a file with two 256K extents. # Since there is no other write activity, they will be contiguous, # and their extent maps merged, despite having two distinct extents. xfs_io -f -c "pwrite -S 0xab 0 256K" \ -c "fsync" \ -c "pwrite -S 0xcd 256K 256K" \ -c "fsync" \ $MNT/foo # Now clone only the second extent into another file. xfs_io -f -c "reflink $MNT/foo 256K 0 256K" $MNT/bar # Filefrag will report a single 512K extent, and say it's not shared. echo filefrag -v $MNT/foo umount $MNT Running the reproducer: $ ./fiemap-bug.sh wrote 262144/262144 bytes at offset 0 256 KiB, 64 ops; 0.0038 sec (65.479 MiB/sec and 16762.7030 ops/sec) wrote 262144/262144 bytes at offset 262144 256 KiB, 64 ops; 0.0040 sec (61.125 MiB/sec and 15647.9218 ops/sec) linked 262144/262144 bytes at offset 0 256 KiB, 1 ops; 0.0002 sec (1.034 GiB/sec and 4237.2881 ops/sec) Filesystem type is: 9123683e File size of /mnt/sdj/foo is 524288 (128 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 127: 3328.. 3455: 128: last,eof /mnt/sdj/foo: 1 extent found We end up reporting that we have a single 512K that is not shared, however we have two 256K extents, and the second one is shared. Changing the reproducer to clone instead the first extent into file 'bar', makes us report a single 512K extent that is shared, which is algo incorrect since we have two 256K extents and only the first one is shared. This patch is part of a larger patchset that is comprised of the following patches: btrfs: allow hole and data seeking to be interruptible btrfs: make hole and data seeking a lot more efficient btrfs: remove check for impossible block start for an extent map at fiemap btrfs: remove zero length check when entering fiemap btrfs: properly flush delalloc when entering fiemap btrfs: allow fiemap to be interruptible btrfs: rename btrfs_check_shared() to a more descriptive name btrfs: speedup checking for extent sharedness during fiemap btrfs: skip unnecessary extent buffer sharedness checks during fiemap btrfs: make fiemap more efficient and accurate reporting extent sharedness The patchset was tested on a machine running a non-debug kernel (Debian's default config) and compared the tests below on a branch without the patchset versus the same branch with the whole patchset applied. The following test for a large compressed file without holes: $ cat fiemap-perf-test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -f $DEV mount -o compress=lzo $DEV $MNT # 40G gives 327680 128K file extents (due to compression). xfs_io -f -c "pwrite -S 0xab -b 1M 0 20G" $MNT/foobar umount $MNT mount -o compress=lzo $DEV $MNT start=$(date +%s%N) filefrag $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "fiemap took $dur milliseconds (metadata not cached)" start=$(date +%s%N) filefrag $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "fiemap took $dur milliseconds (metadata cached)" umount $MNT Before patchset: $ ./fiemap-perf-test.sh (...) /mnt/sdi/foobar: 327680 extents found fiemap took 3597 milliseconds (metadata not cached) /mnt/sdi/foobar: 327680 extents found fiemap took 2107 milliseconds (metadata cached) After patchset: $ ./fiemap-perf-test.sh (...) /mnt/sdi/foobar: 327680 extents found fiemap took 1214 milliseconds (metadata not cached) /mnt/sdi/foobar: 327680 extents found fiemap took 684 milliseconds (metadata cached) That's a speedup of about 3x for both cases (no metadata cached and all metadata cached). The test provided by Pavel (first Link tag at the bottom), which uses files with a large number of holes, was also used to measure the gains, and it consists on a small C program and a shell script to invoke it. The C program is the following: $ cat pavels-test.c #include #include #include #include #include #include #include #include #include #define FILE_INTERVAL (1<<13) /* 8Kb */ long long interval(struct timeval t1, struct timeval t2) { long long val = 0; val += (t2.tv_usec - t1.tv_usec); val += (t2.tv_sec - t1.tv_sec) * 1000 * 1000; return val; } int main(int argc, char **argv) { struct fiemap fiemap = {}; struct timeval t1, t2; char data = 'a'; struct stat st; int fd, off, file_size = FILE_INTERVAL; if (argc != 3 && argc != 2) { printf("usage: %s [size]\n", argv[0]); return 1; } if (argc == 3) file_size = atoi(argv[2]); if (file_size < FILE_INTERVAL) file_size = FILE_INTERVAL; file_size -= file_size % FILE_INTERVAL; fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0644); if (fd < 0) { perror("open"); return 1; } for (off = 0; off < file_size; off += FILE_INTERVAL) { if (pwrite(fd, &data, 1, off) != 1) { perror("pwrite"); close(fd); return 1; } } if (ftruncate(fd, file_size)) { perror("ftruncate"); close(fd); return 1; } if (fstat(fd, &st) < 0) { perror("fstat"); close(fd); return 1; } printf("size: %ld\n", st.st_size); printf("actual size: %ld\n", st.st_blocks * 512); fiemap.fm_length = FIEMAP_MAX_OFFSET; gettimeofday(&t1, NULL); if (ioctl(fd, FS_IOC_FIEMAP, &fiemap) < 0) { perror("fiemap"); close(fd); return 1; } gettimeofday(&t2, NULL); printf("fiemap: fm_mapped_extents = %d\n", fiemap.fm_mapped_extents); printf("time = %lld us\n", interval(t1, t2)); close(fd); return 0; } $ gcc -o pavels_test pavels_test.c And the wrapper shell script: $ cat fiemap-pavels-test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -f -O no-holes $DEV mount $DEV $MNT echo echo "*********** 256M ***********" echo ./pavels-test $MNT/testfile $((1 << 28)) echo ./pavels-test $MNT/testfile $((1 << 28)) echo echo "*********** 512M ***********" echo ./pavels-test $MNT/testfile $((1 << 29)) echo ./pavels-test $MNT/testfile $((1 << 29)) echo echo "*********** 1G ***********" echo ./pavels-test $MNT/testfile $((1 << 30)) echo ./pavels-test $MNT/testfile $((1 << 30)) umount $MNT Running his reproducer before applying the patchset: *********** 256M *********** size: 268435456 actual size: 134217728 fiemap: fm_mapped_extents = 32768 time = 4003133 us size: 268435456 actual size: 134217728 fiemap: fm_mapped_extents = 32768 time = 4895330 us *********** 512M *********** size: 536870912 actual size: 268435456 fiemap: fm_mapped_extents = 65536 time = 30123675 us size: 536870912 actual size: 268435456 fiemap: fm_mapped_extents = 65536 time = 33450934 us *********** 1G *********** size: 1073741824 actual size: 536870912 fiemap: fm_mapped_extents = 131072 time = 224924074 us size: 1073741824 actual size: 536870912 fiemap: fm_mapped_extents = 131072 time = 217239242 us Running it after applying the patchset: *********** 256M *********** size: 268435456 actual size: 134217728 fiemap: fm_mapped_extents = 32768 time = 29475 us size: 268435456 actual size: 134217728 fiemap: fm_mapped_extents = 32768 time = 29307 us *********** 512M *********** size: 536870912 actual size: 268435456 fiemap: fm_mapped_extents = 65536 time = 58996 us size: 536870912 actual size: 268435456 fiemap: fm_mapped_extents = 65536 time = 59115 us *********** 1G *********** size: 1073741824 actual size: 536870912 fiemap: fm_mapped_extents = 116251 time = 124141 us size: 1073741824 actual size: 536870912 fiemap: fm_mapped_extents = 131072 time = 119387 us The speedup is massive, both on the first fiemap call and on the second one as well, as his test creates files with many holes and small extents (every extent follows a hole and precedes another hole). For the 256M file we go from 4 seconds down to 29 milliseconds in the first run, and then from 4.9 seconds down to 29 milliseconds again in the second run, a speedup of 138x and 169x, respectively. For the 512M file we go from 30.1 seconds down to 59 milliseconds in the first run, and then from 33.5 seconds down to 59 milliseconds again in the second run, a speedup of 510x and 568x, respectively. For the 1G file, we go from 225 seconds down to 124 milliseconds in the first run, and then from 217 seconds down to 119 milliseconds in the second run, a speedup of 1815x and 1824x, respectively. Reported-by: Pavel Tikhomirov Link: https://lore.kernel.org/linux-btrfs/21dd32c6-f1f9-f44a-466a-e18fdc6788a7@virtuozzo.com/ Reported-by: Dominique MARTINET Link: https://lore.kernel.org/linux-btrfs/Ysace25wh5BbLd5f@atmark-techno.com/ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b8f164e3e67f224f1751b708e66ccebcce1864c4 Author: Filipe Manana Date: Thu Sep 1 14:18:29 2022 +0100 btrfs: skip unnecessary extent buffer sharedness checks during fiemap During fiemap, for each file extent we find, we must check if it's shared or not. The sharedness check starts by verifying if the extent is directly shared (its refcount in the extent tree is > 1), and if it is not directly shared, then we will check if every node in the subvolume b+tree leading from the root to the leaf that has the file extent item (in reverse order), is shared (through snapshots). However this second step is not needed if our extent was created in a transaction more recent than the last transaction where a snapshot of the inode's root happened, because it can't be shared indirectly (through shared subtrees) without a snapshot created in a more recent transaction. So grab the generation of the extent from the extent map and pass it to btrfs_is_data_extent_shared(), which will skip this second phase when the generation is more recent than the root's last snapshot value. Note that we skip this optimization if the extent map is the result of merging 2 or more extent maps, because in this case its generation is the maximum of the generations of all merged extent maps. The fact the we use extent maps and they can be merged despite the underlying extents being distinct (different file extent items in the subvolume b+tree and different extent items in the extent b+tree), can result in some bugs when reporting shared extents. But this is a problem of the current implementation of fiemap relying on extent maps. One example where we get incorrect results is: $ cat fiemap-bug.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT # Create a file with two 256K extents. # Since there is no other write activity, they will be contiguous, # and their extent maps merged, despite having two distinct extents. xfs_io -f -c "pwrite -S 0xab 0 256K" \ -c "fsync" \ -c "pwrite -S 0xcd 256K 256K" \ -c "fsync" \ $MNT/foo # Now clone only the second extent into another file. xfs_io -f -c "reflink $MNT/foo 256K 0 256K" $MNT/bar # Filefrag will report a single 512K extent, and say it's not shared. echo filefrag -v $MNT/foo umount $MNT Running the reproducer: $ ./fiemap-bug.sh wrote 262144/262144 bytes at offset 0 256 KiB, 64 ops; 0.0038 sec (65.479 MiB/sec and 16762.7030 ops/sec) wrote 262144/262144 bytes at offset 262144 256 KiB, 64 ops; 0.0040 sec (61.125 MiB/sec and 15647.9218 ops/sec) linked 262144/262144 bytes at offset 0 256 KiB, 1 ops; 0.0002 sec (1.034 GiB/sec and 4237.2881 ops/sec) Filesystem type is: 9123683e File size of /mnt/sdj/foo is 524288 (128 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 127: 3328.. 3455: 128: last,eof /mnt/sdj/foo: 1 extent found We end up reporting that we have a single 512K that is not shared, however we have two 256K extents, and the second one is shared. Changing the reproducer to clone instead the first extent into file 'bar', makes us report a single 512K extent that is shared, which is algo incorrect since we have two 256K extents and only the first one is shared. This is z problem that existed before this change, and remains after this change, as it can't be easily fixed. The next patch in the series reworks fiemap to primarily use file extent items instead of extent maps (except for checking for delalloc ranges), with the goal of improving its scalability and performance, but it also ends up fixing this particular bug caused by extent map merging. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 12a824dc67a61ec02ad2960f1856654febcd5d9d Author: Filipe Manana Date: Thu Sep 1 14:18:28 2022 +0100 btrfs: speedup checking for extent sharedness during fiemap One of the most expensive tasks performed during fiemap is to check if an extent is shared. This task has two major steps: 1) Check if the data extent is shared. This implies checking the extent item in the extent tree, checking delayed references, etc. If we find the data extent is directly shared, we terminate immediately; 2) If the data extent is not directly shared (its extent item has a refcount of 1), then it may be shared if we have snapshots that share subtrees of the inode's subvolume b+tree. So we check if the leaf containing the file extent item is shared, then its parent node, then the parent node of the parent node, etc, until we reach the root node or we find one of them is shared - in which case we stop immediately. During fiemap we process the extents of a file from left to right, from file offset 0 to EOF. This means that we iterate b+tree leaves from left to right, and has the implication that we keep repeating that second step above several times for the same b+tree path of the inode's subvolume b+tree. For example, if we have two file extent items in leaf X, and the path to leaf X is A -> B -> C -> X, then when we try to determine if the data extent referenced by the first extent item is shared, we check if the data extent is shared - if it's not, then we check if leaf X is shared, if not, then we check if node C is shared, if not, then check if node B is shared, if not than check if node A is shared. When we move to the next file extent item, after determining the data extent is not shared, we repeat the checks for X, C, B and A - doing all the expensive searches in the extent tree, delayed refs, etc. If we have thousands of tile extents, then we keep repeating the sharedness checks for the same paths over and over. On a file that has no shared extents or only a small portion, it's easy to see that this scales terribly with the number of extents in the file and the sizes of the extent and subvolume b+trees. This change eliminates the repeated sharedness check on extent buffers by caching the results of the last path used. The results can be used as long as no snapshots were created since they were cached (for not shared extent buffers) or no roots were dropped since they were cached (for shared extent buffers). This greatly reduces the time spent by fiemap for files with thousands of extents and/or large extent and subvolume b+trees. Example performance test: $ cat fiemap-perf-test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -f $DEV mount -o compress=lzo $DEV $MNT # 40G gives 327680 128K file extents (due to compression). xfs_io -f -c "pwrite -S 0xab -b 1M 0 40G" $MNT/foobar umount $MNT mount -o compress=lzo $DEV $MNT start=$(date +%s%N) filefrag $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "fiemap took $dur milliseconds (metadata not cached)" start=$(date +%s%N) filefrag $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "fiemap took $dur milliseconds (metadata cached)" umount $MNT Before this patch: $ ./fiemap-perf-test.sh (...) /mnt/sdi/foobar: 327680 extents found fiemap took 3597 milliseconds (metadata not cached) /mnt/sdi/foobar: 327680 extents found fiemap took 2107 milliseconds (metadata cached) After this patch: $ ./fiemap-perf-test.sh (...) /mnt/sdi/foobar: 327680 extents found fiemap took 1646 milliseconds (metadata not cached) /mnt/sdi/foobar: 327680 extents found fiemap took 698 milliseconds (metadata cached) That's about 2.2x faster when no metadata is cached, and about 3x faster when all metadata is cached. On a real filesystem with many other files, data, directories, etc, the b+trees will be 2 or 3 levels higher, therefore this optimization will have a higher impact. Several reports of a slow fiemap show up often, the two Link tags below refer to two recent reports of such slowness. This patch, together with the next ones in the series, is meant to address that. Link: https://lore.kernel.org/linux-btrfs/21dd32c6-f1f9-f44a-466a-e18fdc6788a7@virtuozzo.com/ Link: https://lore.kernel.org/linux-btrfs/Ysace25wh5BbLd5f@atmark-techno.com/ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 8eedaddaab6a6b8ccfd8d942a173500b73894643 Author: Filipe Manana Date: Thu Sep 1 14:18:27 2022 +0100 btrfs: rename btrfs_check_shared() to a more descriptive name The function btrfs_check_shared() is supposed to be used to check if a data extent is shared, but its name is too generic, may easily cause confusion in the sense that it may be used for metadata extents. So rename it to btrfs_is_data_extent_shared(), which will also make it less confusing after the next change that adds a backref lookup cache for the b+tree nodes that lead to the leaf that contains the file extent item that points to the target data extent. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 09fbc1c8e7b00e260b18049af71bf8ca8c4cba99 Author: Filipe Manana Date: Thu Sep 1 14:18:26 2022 +0100 btrfs: allow fiemap to be interruptible Doing fiemap on a file with a very large number of extents can take a very long time, and we have reports of it being too slow (two recent examples in the Link tags below), so make it interruptible. Link: https://lore.kernel.org/linux-btrfs/21dd32c6-f1f9-f44a-466a-e18fdc6788a7@virtuozzo.com/ Link: https://lore.kernel.org/linux-btrfs/Ysace25wh5BbLd5f@atmark-techno.com/ Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 33a86cfa1741ef1668b0d312c7964b4f35e9d31e Author: Filipe Manana Date: Thu Sep 1 14:18:25 2022 +0100 btrfs: properly flush delalloc when entering fiemap If the flag FIEMAP_FLAG_SYNC is passed to fiemap, it means all delalloc should be flushed and writeback complete. We call the generic helper fiemap_prep() which does a filemap_write_and_wait() in case that flag is given, however that is not enough if we have compression. Because a single filemap_fdatawrite_range() only starts compression (in an async thread) and therefore returns before the compression is done and writeback is started. So make btrfs_fiemap(), actually wait for all writeback to start and complete if FIEMAP_FLAG_SYNC is set. We start and wait for writeback on the whole possible file range, from 0 to LLONG_MAX, because that is what the generic code at fiemap_prep() does. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9a42bbaeff2b101ffdb7fc8c3a326bff08a33917 Author: Filipe Manana Date: Thu Sep 1 14:18:24 2022 +0100 btrfs: remove zero length check when entering fiemap There's no point to check for a 0 length at extent_fiemap(), as before calling it, we called fiemap_prep() at btrfs_fiemap(), which already checks for a zero length and returns the same -EINVAL error. So remove the pointless check. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f12eec9a2665422f4a8e644b4f65475ae2ee5c30 Author: Filipe Manana Date: Thu Sep 1 14:18:23 2022 +0100 btrfs: remove check for impossible block start for an extent map at fiemap During fiemap we are testing if an extent map has a block start with a value of EXTENT_MAP_LAST_BYTE, but that is never set on an extent map, and never was according to git history. So remove that useless check. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit b6e833567ea12bc47d91e4b6497d49ba60d4f95f Author: Filipe Manana Date: Thu Sep 1 14:18:22 2022 +0100 btrfs: make hole and data seeking a lot more efficient The current implementation of hole and data seeking for llseek does not scale well in regards to the number of extents and the distance between the start offset and the next hole or extent. This is due to a very high algorithmic complexity. Often we also get reports of btrfs' hole and data seeking (llseek) being too slow, such as at 2017's LSFMM (see the Link tag at the bottom). In order to better understand it, lets consider the case where the start offset is 0, we are seeking for a hole and the file size is 16G. Between file offset 0 and the first hole in the file there are 100K extents - this is common for large files, specially if we have compression enabled, since the maximum extent size is limited to 128K. The steps take by the main loop of the current algorithm are the following: 1) We start by calling btrfs_get_extent_fiemap(), for file offset 0, which calls btrfs_get_extent(). This will first lookup for an extent map in the inode's extent map tree (a red black tree). If the extent map is not loaded in memory, then it will do a lookup for the corresponding file extent item in the subvolume's b+tree, create an extent map based on the contents of the file extent item and then add the extent map to the extent map tree of the inode; 2) The second iteration calls btrfs_get_extent_fiemap() again, this time with a start offset matching the end offset of the previous extent. Again, btrfs_get_extent() will first search the extent map tree, and if it doesn't find an extent map there, it will again search in the b+tree of the subvolume for a matching file extent item, build an extent map based on the file extent item, and add the extent map to to the extent map tree of the inode; 3) This repeats over and over until we find the first hole (when seeking for holes) or until we find the first extent (when seeking for data). If there no extent maps loaded in memory for each iteration, then on each iteration we do 1 extent map tree search, 1 b+tree search, plus 1 more extent map tree traversal to insert an extent map - plus we allocate memory for the extent map. On each iteration we are growing the size of the extent map tree, making each future search slower, and also visiting the same b+tree leaves over and over again - taking into account with the default leaf size of 16K we can fit more than 200 file extent items in a leaf - so we can visit the same b+tree leaf 200+ times, on each visit walking down a path from the root to the leaf. So it's easy to see that what we have now doesn't scale well. Also, it loads an extent map for every file extent item into memory, which is not efficient - we should add extents maps only when doing IO (writing or reading file data). This change implements a new algorithm which scales much better, and works like this: 1) We iterate over the subvolume's b+tree, visiting each leaf that has file extent items once and only once; 2) For any file extent items found, that don't represent holes or prealloc extents, it will not search the extent map tree - there's no need at all for that - an extent map is just an in-memory representation of a file extent item; 3) When a hole is found, or a prealloc extent, it will check if there's delalloc for its range. For this it will search for EXTENT_DELALLOC bits in the inode's io tree and check the extent map tree - this is for accounting for unflushed delalloc and for flushed delalloc (the period between running delalloc and ordered extent completion), respectively. This is similar to what the current implementation does when it finds a hole or prealloc extent, but without creating extent maps and adding them to the extent map tree in case they are not loaded in memory; 4) It never allocates extent maps, or adds extent maps to the inode's extent map tree. This not only saves memory and time (from the tree insertions and allocations), but also eliminates the possibility of -ENOMEM due to allocating too many extent maps. Part of this new code will also be used later for fiemap (which also suffers similar scalability problems). The following test example can be used to quickly measure the efficiency before and after this patch: $ cat test-seek-hole.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -f $DEV mount -o compress=lzo $DEV $MNT # 16G file -> 131073 compressed extents. xfs_io -f -c "pwrite -S 0xab -b 1M 0 16G" $MNT/foobar # Leave a 1M hole at file offset 15G. xfs_io -c "fpunch 15G 1M" $MNT/foobar # Unmount and mount again, so that we can test when there's no # metadata cached in memory. umount $MNT mount -o compress=lzo $DEV $MNT # Test seeking for hole from offset 0 (hole is at offset 15G). start=$(date +%s%N) xfs_io -c "seek -h 0" $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "Took $dur milliseconds to seek first hole (metadata not cached)" echo start=$(date +%s%N) xfs_io -c "seek -h 0" $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "Took $dur milliseconds to seek first hole (metadata cached)" echo umount $MNT Before this change: $ ./test-seek-hole.sh (...) Whence Result HOLE 16106127360 Took 176 milliseconds to seek first hole (metadata not cached) Whence Result HOLE 16106127360 Took 17 milliseconds to seek first hole (metadata cached) After this change: $ ./test-seek-hole.sh (...) Whence Result HOLE 16106127360 Took 43 milliseconds to seek first hole (metadata not cached) Whence Result HOLE 16106127360 Took 13 milliseconds to seek first hole (metadata cached) That's about 4x faster when no metadata is cached and about 30% faster when all metadata is cached. In practice the differences may often be significantly higher, either due to a higher number of extents in a file or because the subvolume's b+tree is much bigger than in this example, where we only have one file. Link: https://lwn.net/Articles/718805/ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit aed0ca180b45e145046b235cb61982a6292e756c Author: Filipe Manana Date: Thu Sep 1 14:18:21 2022 +0100 btrfs: allow hole and data seeking to be interruptible Doing hole or data seeking on a file with a very large number of extents can take a long time, and we have reports of it being too slow (such as at LSFMM from 2017, see the Link below). So make it interruptible. Link: https://lwn.net/Articles/718805/ Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit bd64f6221a98fb1857485c63fd3d8da8d47406c6 Author: zhang songyi Date: Fri Sep 2 15:40:29 2022 +0000 btrfs: remove the unnecessary result variables Return the sysfs_emit() and iterate_object_props() directly instead of using unnecessary variables. Reported-by: Zeal Robot Reviewed-by: Anand Jain Signed-off-by: zhang songyi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1c56ab991903dce60e905a08f431c0e6f79b9b9e Author: Qu Wenruo Date: Tue Aug 9 13:02:18 2022 +0800 btrfs: separate BLOCK_GROUP_TREE compat RO flag from EXTENT_TREE_V2 The problem of long mount time caused by block group item search is already known for some time, and the solution of block group tree has been proposed. There is really no need to bound this feature into extent tree v2, just introduce compat RO flag, BLOCK_GROUP_TREE, to correctly solve the problem. All the code handling block group root is already in the upstream kernel, thus this patch really only needs to introduce the new compat RO flag. This patch introduces one extra artificial limitation on block group tree feature, that free space cache v2 and no-holes feature must be enabled to use this new compat RO feature. This artificial requirement is mostly to reduce the test combinations, and can be a guideline for future features, to mostly rely on the latest default features. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 14033b08a02916e85ffc5397e4ac15337359f3ae Author: Qu Wenruo Date: Tue Aug 9 13:02:17 2022 +0800 btrfs: don't save block group root into super block The extent tree v2 needs a new root for storing all block group items, the whole feature hasn't been finished yet so we can afford to do some changes. My initial proposal years ago just added a new tree rootid, and load it from tree root, just like what we did for quota/free space tree/uuid/extent roots. But the extent tree v2 patches introduced a completely new way to store block group tree root into super block which is arguably wasteful. Currently there are only 3 trees stored in super blocks, and they all have their valid reasons: - Chunk root Needed for bootstrap. - Tree root Really the entry point for all trees. - Log root This is special as log root has to be updated out of existing transaction mechanism. There is not even any reason to put block group root into super blocks, the block group tree is updated at the same time as the old extent tree, no need for extra bootstrap/out-of-transaction update. So just move block group root from super block into tree root. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 81d5d61454c365718655cfc87d8200c84e25d596 Author: Qu Wenruo Date: Tue Aug 9 13:02:16 2022 +0800 btrfs: enhance unsupported compat RO flags handling Currently there are two corner cases not handling compat RO flags correctly: - Remount We can still mount the fs RO with compat RO flags, then remount it RW. We should not allow any write into a fs with unsupported RO flags. - Still try to search block group items In fact, behavior/on-disk format change to extent tree should not need a full incompat flag. And since we can ensure fs with unsupported RO flags never got any writes (with above case fixed), then we can even skip block group items search at mount time. This patch will enhance the unsupported RO compat flags by: - Reject read-write remount if there are unsupported RO compat flags - Go dummy block group items directly for unsupported RO compat flags In fact, only changes to chunk/subvolume/root/csum trees should go incompat flags. The latter part should allow future change to extent tree to be compat RO flags. Thus this patch also needs to be backported to all stable trees. CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8e327b9c0de858f27e711f854e8bf99e5d409c2e Author: Qu Wenruo Date: Thu Aug 25 15:09:10 2022 +0800 btrfs: dump all space infos if we abort transaction due to ENOSPC We have hit some transaction abort due to -ENOSPC internally. Normally we should always reserve enough space for metadata for every transaction, thus hitting -ENOSPC should really indicate some cases we didn't expect. But unfortunately current error reporting will only give a kernel warning and stack trace, not really helpful to debug what's causing the problem. And mount option debug_enospc can only help when user can reproduce the problem, but under most cases, such transaction abort by -ENOSPC is really hard to reproduce. So this patch will dump all space infos (data, metadata, system) when we abort the first transaction with -ENOSPC. This should at least provide some clue to us. The example of a dump would look like this: BTRFS: Transaction aborted (error -28) WARNING: CPU: 8 PID: 3366 at fs/btrfs/transaction.c:2137 btrfs_commit_transaction+0xf81/0xfb0 [btrfs] ---[ end trace 0000000000000000 ]--- BTRFS info (device dm-1: state A): dumping space info: BTRFS info (device dm-1: state A): space_info DATA has 6791168 free, is not full BTRFS info (device dm-1: state A): space_info total=8388608, used=1597440, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0 BTRFS info (device dm-1: state A): space_info METADATA has 257114112 free, is not full BTRFS info (device dm-1: state A): space_info total=268435456, used=131072, pinned=180224, reserved=65536, may_use=10878976, readonly=65536 zone_unusable=0 BTRFS info (device dm-1: state A): space_info SYSTEM has 8372224 free, is not full BTRFS info (device dm-1: state A): space_info total=8388608, used=16384, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0 BTRFS info (device dm-1: state A): global_block_rsv: size 3670016 reserved 3670016 BTRFS info (device dm-1: state A): trans_block_rsv: size 0 reserved 0 BTRFS info (device dm-1: state A): chunk_block_rsv: size 0 reserved 0 BTRFS info (device dm-1: state A): delayed_block_rsv: size 4063232 reserved 4063232 BTRFS info (device dm-1: state A): delayed_refs_rsv: size 3145728 reserved 3145728 BTRFS: error (device dm-1: state A) in btrfs_commit_transaction:2137: errno=-28 No space left BTRFS info (device dm-1: state EA): forced readonly Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 25a860c40952d91bacca77318354e71dee1e138e Author: Qu Wenruo Date: Thu Aug 25 15:09:09 2022 +0800 btrfs: output human readable space info flag For btrfs_space_info, its flags has only 4 possible values: - BTRFS_BLOCK_GROUP_SYSTEM - BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA - BTRFS_BLOCK_GROUP_METADATA - BTRFS_BLOCK_GROUP_DATA Make the output more human readable, now it looks like: BTRFS info (device dm-1: state A): space_info METADATA has 251494400 free, is not full Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a05d3c9153145283ce9c58a1d7a9056fbb85f6a1 Author: Qu Wenruo Date: Wed Aug 24 20:16:22 2022 +0800 btrfs: check superblock to ensure the fs was not modified at thaw time [BACKGROUND] There is an incident report that, one user hibernated the system, with one btrfs on removable device still mounted. Then by some incident, the btrfs got mounted and modified by another system/OS, then back to the hibernated system. After resuming from the hibernation, new write happened into the victim btrfs. Now the fs is completely broken, since the underlying btrfs is no longer the same one before the hibernation, and the user lost their data due to various transid mismatch. [REPRODUCER] We can emulate the situation using the following small script: truncate -s 1G $dev mkfs.btrfs -f $dev mount $dev $mnt fsstress -w -d $mnt -n 500 sync xfs_freeze -f $mnt cp $dev $dev.backup # There is no way to mount the same cloned fs on the same system, # as the conflicting fsid will be rejected by btrfs. # Thus here we have to wipe the fs using a different btrfs. mkfs.btrfs -f $dev.backup dd if=$dev.backup of=$dev bs=1M xfs_freeze -u $mnt fsstress -w -d $mnt -n 20 umount $mnt btrfs check $dev The final fsck will fail due to some tree blocks has incorrect fsid. This is enough to emulate the problem hit by the unfortunate user. [ENHANCEMENT] Although such case should not be that common, it can still happen from time to time. From the view of btrfs, we can detect any unexpected super block change, and if there is any unexpected change, we just mark the fs read-only, and thaw the fs. By this we can limit the damage to minimal, and I hope no one would lose their data by this anymore. Suggested-by: Goffredo Baroncelli Link: https://lore.kernel.org/linux-btrfs/83bf3b4b-7f4c-387a-b286-9251e3991e34@bluemole.com/ Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 928ff3beb8940f2a23d489d56b3cb12cf209d6db Author: Christoph Hellwig Date: Sat Aug 6 10:03:30 2022 +0200 btrfs: stop allocation a btrfs_io_context for simple I/O The I/O context structure is only used to pass the btrfs_device to the end I/O handler for I/Os that go to a single device. Stop allocating the I/O context for these cases by passing the optional btrfs_io_stripe argument to __btrfs_map_block to query the mapping information and then using a fast path submission and I/O completion handler. As the old btrfs_io_context based I/O submission path is only used for mirrored writes, rename the functions to make that clear and stop setting the btrfs_bio device and mirror_num field that is only used for reads. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 03793cbbc80fe616498f8141f853575b2d140222 Author: Christoph Hellwig Date: Sat Aug 6 10:03:29 2022 +0200 btrfs: add fast path for single device io in __btrfs_map_block There is no need for most of the btrfs_io_context when doing I/O to a single device. To support such I/O without the extra btrfs_io_context allocation, turn the mirror_num argument into a pointer so that it can be used to output the selected mirror number, and add an optional argument that points to a btrfs_io_stripe structure, which will be filled with a single extent if provided by the caller. In that case the btrfs_io_context allocation can be skipped as all information for the single device I/O is provided in the mirror_num argument and the on-stack btrfs_io_stripe. A caller that makes use of this new argument will be added in the next commit. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 28793b194e6a0e50d4abc6fec7472799aa734d1f Author: Christoph Hellwig Date: Sat Aug 6 10:03:28 2022 +0200 btrfs: decide bio cloning inside submit_stripe_bio Remove the orig_bio argument as it can be derived from the bioc, and the clone argument as it can be calculated from bioc and dev_nr. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 32747c44550c82a6a6ddf365b91216e4b8b0a6d6 Author: Christoph Hellwig Date: Sat Aug 6 10:03:27 2022 +0200 btrfs: factor out low-level bio setup from submit_stripe_bio Split out a low-level btrfs_submit_dev_bio helper that just submits the bio without any cloning decisions or setting up the end I/O handler for future reuse by a different caller. Reviewed-by: Nikolay Borisov Reviewed-by: Anand Jain Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 917f32a235017055104332487cb749c5f119c2ae Author: Christoph Hellwig Date: Sat Aug 6 10:03:26 2022 +0200 btrfs: give struct btrfs_bio a real end_io handler Currently btrfs_bio end I/O handling is a bit of a mess. The bi_end_io handler and bi_private pointer of the embedded struct bio are both used to handle the completion of the high-level btrfs_bio and for the I/O completion for the low-level device that the embedded bio ends up being sent to. To support this bi_end_io and bi_private are saved into the btrfs_io_context structure and then restored after the bio sent to the underlying device has completed the actual I/O. Untangle this by adding an end I/O handler and private data to struct btrfs_bio for the high-level btrfs_bio based completions, and leave the actual bio bi_end_io handler and bi_private pointer entirely to the low-level device I/O. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit f1c2937976be6cc2e4d5b322702fbba5833524cb Author: Christoph Hellwig Date: Sat Aug 6 10:03:25 2022 +0200 btrfs: properly abstract the parity raid bio handling The parity raid write/recover functionality is currently not very well abstracted from the bio submission and completion handling in volumes.c: - the raid56 code directly completes the original btrfs_bio fed into btrfs_submit_bio instead of dispatching back to volumes.c - the raid56 code consumes the bioc and bio_counter references taken by volumes.c, which also leads to special casing of the calls from the scrub code into the raid56 code To fix this up supply a bi_end_io handler that calls back into the volumes.c machinery, which then puts the bioc, decrements the bio_counter and completes the original bio, and updates the scrub code to also take ownership of the bioc and bio_counter in all cases. Reviewed-by: Nikolay Borisov Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit c3a62baf21ad691aae04c2f091debe667439537e Author: Christoph Hellwig Date: Sat Aug 6 10:03:24 2022 +0200 btrfs: use chained bios when cloning The stripes_pending in the btrfs_io_context counts number of inflight low-level bios for an upper btrfs_bio. For reads this is generally one as reads are never cloned, while for writes we can trivially use the bio remaining mechanisms that is used for chained bios. To be able to make use of that mechanism, split out a separate trivial end_io handler for the cloned bios that does a minimal amount of error tracking and which then calls bio_endio on the original bio to transfer control to that, with the remaining counter making sure it is completed last. This then allows to merge btrfs_end_bioc into the original bio bi_end_io handler. To make this all work all error handling needs to happen through the bi_end_io handler, which requires a small amount of reshuffling in submit_stripe_bio so that the bio is cloned already by the time the suitability of the device is checked. This reduces the size of the btrfs_io_context and prepares splitting the btrfs_bio at the stripe boundary. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 2bbc72f14f19031bdb26ba7854f4fc888c492e64 Author: Christoph Hellwig Date: Sat Aug 6 10:03:23 2022 +0200 btrfs: don't take a bio_counter reference for cloned bios Stop grabbing an extra bio_counter reference for each clone bio in a mirrored write and instead just release the one original reference in btrfs_end_bioc once all the bios for a single btrfs_bio have completed instead of at the end of btrfs_submit_bio once all bios have been submitted. This means the reference is now carried by the "upper" btrfs_bio only instead of each lower bio. Also remove the now unused btrfs_bio_counter_inc_noblocked helper. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 6b42f5e3439d64a725e022ef1711dd00981e68a9 Author: Christoph Hellwig Date: Sat Aug 6 10:03:22 2022 +0200 btrfs: pass the operation to btrfs_bio_alloc Pass the operation to btrfs_bio_alloc, matching what bio_alloc_bioset set does. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d45cfb883b1055651291bc3007ac2d02430f897c Author: Christoph Hellwig Date: Sat Aug 6 10:03:21 2022 +0200 btrfs: move btrfs_bio allocation to volumes.c volumes.c is the place that implements the storage layer using the btrfs_bio structure, so move the bio_set and allocation helpers there as well. To make up for the new initialization boilerplate, merge the two init/exit helpers in extent_io.c into a single one. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1e408af31b4adfae7b6af521315b4bfae0dcf2b5 Author: Christoph Hellwig Date: Sat Aug 6 10:03:20 2022 +0200 btrfs: don't create integrity bioset for btrfs_bioset btrfs never uses bio integrity data itself, so don't allocate the integrity pools for btrfs_bioset. This patch is a revert of the commit b208c2f7ceaf ("btrfs: Fix crash due to not allocating integrity data for a set"). The integrity data pool is not needed, the bio-integrity code now handles allocating the integrity payload without that. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Tested-by: Nikolay Borisov Tested-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit fc80f7aca55bfff8378f9aa3e6aa52015609132f Author: Josef Bacik Date: Mon Aug 8 16:10:27 2022 -0400 btrfs: remove use btrfs_remove_free_space_cache instead of variant We are calling __btrfs_remove_free_space_cache everywhere to cleanup the block group free space, however we can just use btrfs_remove_free_space_cache and pass in the block group in all of these places. Then we can remove __btrfs_remove_free_space_cache and rename __btrfs_remove_free_space_cache_locked to __btrfs_remove_free_space_cache. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 8a1ae2781dee9fc21ca82db682d37bea4bd074ad Author: Josef Bacik Date: Mon Aug 8 16:10:26 2022 -0400 btrfs: call __btrfs_remove_free_space_cache_locked on cache load failure Now that lockdep is staying enabled through our entire CI runs I started seeing the following stack in generic/475 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 2171864 at fs/btrfs/discard.c:604 btrfs_discard_update_discardable+0x98/0xb0 CPU: 1 PID: 2171864 Comm: kworker/u4:0 Not tainted 5.19.0-rc8+ #789 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Workqueue: btrfs-cache btrfs_work_helper RIP: 0010:btrfs_discard_update_discardable+0x98/0xb0 RSP: 0018:ffffb857c2f7bad0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8c85c605c200 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffffff86807c5b RDI: ffffffff868a831e RBP: ffff8c85c4c54000 R08: 0000000000000000 R09: 0000000000000000 R10: ffff8c85c66932f0 R11: 0000000000000001 R12: ffff8c85c3899010 R13: ffff8c85d5be4f40 R14: ffff8c85c4c54000 R15: ffff8c86114bfa80 FS: 0000000000000000(0000) GS:ffff8c863bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2e7f168160 CR3: 000000010289a004 CR4: 0000000000370ee0 Call Trace: __btrfs_remove_free_space_cache+0x27/0x30 load_free_space_cache+0xad2/0xaf0 caching_thread+0x40b/0x650 ? lock_release+0x137/0x2d0 btrfs_work_helper+0xf2/0x3e0 ? lock_is_held_type+0xe2/0x140 process_one_work+0x271/0x590 ? process_one_work+0x590/0x590 worker_thread+0x52/0x3b0 ? process_one_work+0x590/0x590 kthread+0xf0/0x120 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 This is the code ctl = block_group->free_space_ctl; discard_ctl = &block_group->fs_info->discard_ctl; lockdep_assert_held(&ctl->tree_lock); We have a temporary free space ctl for loading the free space cache in order to avoid having allocations happening while we're loading the cache. When we hit an error we free it all up, however this also calls btrfs_discard_update_discardable, which requires block_group->free_space_ctl->tree_lock to be held. However this is our temporary ctl so this lock isn't held. Fix this by calling __btrfs_remove_free_space_cache_locked instead so that we only clean up the entries and do not mess with the discardable stats. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 331cd9461412e103d07595a10289de90004ac890 Author: Filipe Manana Date: Tue Aug 23 12:45:42 2022 +0100 btrfs: fix race between quota enable and quota rescan ioctl When enabling quotas, at btrfs_quota_enable(), after committing the transaction, we change fs_info->quota_root to point to the quota root we created and set BTRFS_FS_QUOTA_ENABLED at fs_info->flags. Then we try to start the qgroup rescan worker, first by initializing it with a call to qgroup_rescan_init() - however if that fails we end up freeing the quota root but we leave fs_info->quota_root still pointing to it, this can later result in a use-after-free somewhere else. We have previously set the flags BTRFS_FS_QUOTA_ENABLED and BTRFS_QGROUP_STATUS_FLAG_ON, so we can only fail with -EINPROGRESS at btrfs_quota_enable(), which is possible if someone already called the quota rescan ioctl, and therefore started the rescan worker. So fix this by ignoring an -EINPROGRESS and asserting we can't get any other error. Reported-by: Ye Bin Link: https://lore.kernel.org/linux-btrfs/20220823015931.421355-1-yebin10@huawei.com/ CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit dbecac26630014d336a8e5ea67096ff18210fb9c Author: Maciej S. Szmigiero Date: Tue Aug 23 17:28:20 2022 +0200 btrfs: don't print information about space cache or tree every remount btrfs currently prints information about space cache or free space tree being in use on every remount, regardless whether such remount actually enabled or disabled one of these features. This is actually unnecessary since providing remount options changing the state of these features will explicitly print the appropriate notice. Let's instead print such unconditional information just on an initial mount to avoid filling the kernel log when, for example, laptop-mode-tools remount the fs on some events. Signed-off-by: Maciej S. Szmigiero Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1fdbd03d3d924415eb8abfb5d3b5e50ca0775469 Author: Filipe Manana Date: Mon Aug 22 15:47:10 2022 +0100 btrfs: simplify error handling at btrfs_del_root_ref() At btrfs_del_root_ref() we are using two return variables, named 'ret' and 'err'. This makes it harder to follow and easier to return the wrong value in case an error happens - the previous patch in the series, which has the subject "btrfs: fix silent failure when deleting root reference", fixed a bug due to confusion created by these two variables. So change the function to use a single variable for tracking the return value of the function, using only 'ret', which is consistent with most of the codebase. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 48ff70830bec1ccc714f4e31059df737f17ec909 Author: Omar Sandoval Date: Tue Aug 16 16:12:16 2022 -0700 btrfs: get rid of block group caching progress logic struct btrfs_caching_ctl::progress and struct btrfs_block_group::last_byte_to_unpin were previously needed to ensure that unpin_extent_range() didn't return a range to the free space cache before the caching thread had a chance to cache that range. However, the commit "btrfs: fix space cache corruption and potential double allocations" made it so that we always synchronously cache the block group at the time that we pin the extent, so this machinery is no longer necessary. Reviewed-by: Filipe Manana Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 9ed0a72e5b355d49fc9034ec35da3b602bfcef57 Author: BingJing Chang Date: Fri Aug 12 22:42:33 2022 +0800 btrfs: send: fix failures when processing inodes with no links There is a bug causing send failures when processing an orphan directory with no links. In commit 46b2f4590aab ("Btrfs: fix send failure when root has deleted files still open")', the orphan inode issue was addressed. The send operation fails with a ENOENT error because of any attempts to generate a path for the inode with a link count of zero. Therefore, in that patch, sctx->ignore_cur_inode was introduced to be set if the current inode has a link count of zero for bypassing some unnecessary steps. And a helper function btrfs_unlink_all_paths() was introduced and called to clean up old paths found in the parent snapshot. However, not only regular files but also directories can be orphan inodes. So if the send operation meets an orphan directory, it will issue a wrong unlink command for that directory now. Soon the receive operation fails with a EISDIR error. Besides, the send operation also fails with a ENOENT error later when it tries to generate a path of it. Similar example but making an orphan dir for an incremental send: $ btrfs subvolume create vol $ mkdir vol/dir $ touch vol/dir/foo $ btrfs subvolume snapshot -r vol snap1 $ btrfs subvolume snapshot -r vol snap2 # Turn the second snapshot to RW mode and delete the whole dir while # holding an open file descriptor on it. $ btrfs property set snap2 ro false $ exec 73 Machine B --> Machine C The idea to solve the problem is to delete all the items of orphan inodes before using these snapshots for sending. I used to think that the reasonable timing for doing that is during the ioctl of changing the subvolume from RW to RO because it sounds good that we will not modify the fs tree of a RO snapshot anymore. However, attempting to do the orphan cleanup in the ioctl would be pointless. Because if someone is holding an open file descriptor on the inode, the reference count of the inode will never drop to 0. Then iput() cannot trigger eviction, which finally deletes all the items of it. So we try to extend the original patch to handle orphans in send/parent snapshots. Here are several cases that need to be considered: Case 1: BTRFS_COMPARE_TREE_NEW | send snapshot | action -------------------------------- nlink | 0 | ignore In case 1, when we get a BTRFS_COMPARE_TREE_NEW tree comparison result, it means that a new inode is found in the send snapshot and it doesn't appear in the parent snapshot. Since this inode has a link count of zero (It's an orphan and there're no paths for it.), we can leverage sctx->ignore_cur_inode in the original patch to prevent it from being created. Case 2: BTRFS_COMPARE_TREE_DELETED | parent snapshot | action ---------------------------------- nlink | 0 | as usual In case 2, when we get a BTRFS_COMPARE_TREE_DELETED tree comparison result, it means that the inode only appears in the parent snapshot. As usual, the send operation will try to delete all its paths. However, this inode has a link count of zero, so no paths of it will be found. No deletion operations will be issued. We don't need to change any logic. Case 3: BTRFS_COMPARE_TREE_CHANGED | | parent snapshot | send snapshot | action ----------------------------------------------------------------------- subcase 1 | nlink | 0 | 0 | ignore subcase 2 | nlink | >0 | 0 | new_gen(deletion) subcase 3 | nlink | 0 | >0 | new_gen(creation) In case 3, when we get a BTRFS_COMPARE_TREE_CHANGED tree comparison result, it means that the inode appears in both snapshots. Here are 3 subcases. First, when the inode has link counts of zero in both snapshots. Since there are no paths for this inode in (source/destination) parent snapshots and we don't care about whether there is also an orphan inode in destination or not, we can set sctx->ignore_cur_inode on to prevent it from being created. For the second and the third subcases, if there are paths in one snapshot and there're no paths in the other snapshot for this inode. We can treat this inode as a new generation. We can also leverage the logic handling a new generation of an inode with small adjustments. Then it will delete all old paths and create a new inode with new attributes and paths only when there's a positive link count in the send snapshot. In subcase 2, the send operation only needs to delete all old paths as in the parent snapshot. But it may require more operations for a directory to remove its old paths. If a not-empty directory is going to be deleted (because it has a link count of zero in the send snapshot) but there are files/directories with bigger inode numbers under it, the send operation will need to rename it to its orphan name first. After processing and deleting the last item under this directory, the send operation will check this directory, aka the parent directory of the last item, again and issue a rmdir operation to remove it finally. Therefore, we also need to treat inodes with a link count of zero as if they didn't exist in get_cur_inode_state(), which is used in process_recorded_refs(). By doing this, when checking a directory with orphan names after the last item under it has been deleted, the send operation now can properly issue a rmdir operation. Otherwise, without doing this, the orphan directory with an orphan name would be kept here at the end due to the existing inode with a link count of zero being found. In subcase 3, as in case 2, no old paths would be found, so no deletion operations will be issued. The send operation will only create a new one for that inode. Note that subcase 3 is not common. That's because it's easy to reduce the hard links of an inode, but once all valid paths are removed, there are no valid paths for creating other hard links. The only way to do that is trying to send an older snapshot after a newer snapshot has been sent. Reviewed-by: Robbie Ko Reviewed-by: Filipe Manana Signed-off-by: BingJing Chang Signed-off-by: David Sterba commit 7e93f6dc11d91281a84937aa5ec7c4a72d6ca0ed Author: BingJing Chang Date: Fri Aug 12 22:42:32 2022 +0800 btrfs: send: refactor arguments of get_inode_info() Refactor get_inode_info() to populate all wanted fields on an output structure. Besides, also introduce a helper function called get_inode_gen(), which is commonly used. Reviewed-by: Robbie Ko Reviewed-by: Filipe Manana Signed-off-by: BingJing Chang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 52b029f42751d0aea2d9c05a584438f4f0dfc123 Author: Ethan Lien Date: Fri Aug 19 10:44:08 2022 +0800 btrfs: remove unnecessary EXTENT_UPTODATE state in buffered I/O path After we copied data to page cache in buffered I/O, we 1. Insert a EXTENT_UPTODATE state into inode's io_tree, by endio_readpage_release_extent(), set_extent_delalloc() or set_extent_defrag(). 2. Set page uptodate before we unlock the page. But the only place we check io_tree's EXTENT_UPTODATE state is in btrfs_do_readpage(). We know we enter btrfs_do_readpage() only when we have a non-uptodate page, so it is unnecessary to set EXTENT_UPTODATE. For example, when performing a buffered random read: fio --rw=randread --ioengine=libaio --direct=0 --numjobs=4 \ --filesize=32G --size=4G --bs=4k --name=job \ --filename=/mnt/file --name=job Then check how many extent_state in io_tree: cat /proc/slabinfo | grep btrfs_extent_state | awk '{print $2}' w/o this patch, we got 640567 btrfs_extent_state. w/ this patch, we got 204 btrfs_extent_state. Maintaining such a big tree brings overhead since every I/O needs to insert EXTENT_LOCKED, insert EXTENT_UPTODATE, then remove EXTENT_LOCKED. And in every insert or remove, we need to lock io_tree, do tree search, alloc or dealloc extent states. By removing unnecessary EXTENT_UPTODATE, we keep io_tree in a minimal size and reduce overhead when performing buffered I/O. Reviewed-by: Filipe Manana Reviewed-by: Robbie Ko Signed-off-by: Ethan Lien Signed-off-by: David Sterba commit 7059c658310e641b6976c8b10a591ad7b7279c20 Author: Filipe Manana Date: Mon Aug 1 14:57:53 2022 +0100 btrfs: simplify adding and replacing references during log replay During log replay, when adding/replacing inode references, there are two special cases that have special code for them: 1) When we have an inode with two or more hardlinks in the same directory, therefore two or more names encoded in the same inode reference item, and one of the hard links gets renamed to the old name of another hard link - that is, the index number for a name changes. This was added in commit 0d836392cadd55 ("Btrfs: fix mount failure after fsync due to hard link recreation"), and is covered by test case generic/502 from fstests; 2) When we have several inodes that got renamed to an old name of some other inode, in a cascading style. The code to deal with this special case was added in commit 6b5fc433a7ad67 ("Btrfs: fix fsync after succession of renames of different files"), and is covered by test cases generic/526 and generic/527 from fstests. Both cases can be deal with by making sure __add_inode_ref() is always called by add_inode_ref() for every name encoded in the inode reference item, and not just for the first name that has a conflict. With such change we no longer need that special casing for the two cases mentioned before. So do those changes. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit fb731430be32068735905c05a86b9eaaa3bb60c7 Author: David Sterba Date: Mon Jul 25 21:15:15 2022 +0200 btrfs: sysfs: show discard stats and tunables in non-debug build When discard=async was introduced there were also sysfs knobs and stats for debugging and tuning, hidden under CONFIG_BTRFS_DEBUG. The defaults have been set and so far seem to satisfy all users on a range of workloads. As there are not only tunables (like iops or kbps) but also stats tracking amount of discardable bytes, that should be available when the async discard is on (otherwise it's not). The stats are moved from the per-fs debug directory, so it's under /sys/fs/btrfs/FSID/discard - discard_bitmap_bytes - amount of discarded bytes from data tracked as bitmaps - discard_extent_bytes - dtto but as extents - discard_bytes_saved - - discardable_bytes - amount of bytes that can be discarded - discardable_extents - number of extents to be discarded - iops_limit - tunable limit of number of discard IOs to be issued - kbps_limit - tunable limit of kilobytes per second issued as discard IO - max_discard_size - tunable limit for size of one IO discard request Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 30b80f3ce0f9d58ab8a2094922f3d54d2fd4f92e Author: Filipe Manana Date: Mon Aug 22 11:51:44 2022 +0100 btrfs: use delayed items when logging a directory When logging a directory we start by flushing all its delayed items. That results in adding dir index items to the subvolume btree, for new dentries, and removing dir index items from the subvolume btree for any dentries that were deleted. This makes it straightforward to log a directory simply by iterating over all the modified subvolume btree leaves, especially when we used to log both dir index keys and dir item keys (before commit 339d035424849c ("btrfs: only copy dir index keys when logging a directory") and when we used to copy old dir index entries for leaves modified in the current transaction (before commit 732d591a5d6c12 ("btrfs: stop copying old dir items when logging a directory")). From an efficiency point of view this has a couple of drawbacks: 1) Adds extra latency, due to copying delayed items to the subvolume btree and deleting dir index items from the btree. Further if there are other tasks accessing the btree, which is common (syscalls like creat, mkdir, rename, link, unlink, truncate, reflinks, etc, finishing an ordered extent, etc), lock contention can cause further delays, both to the task logging a directory and to the other tasks accessing the btree; 2) More time spent overall flushing delayed items, if after logging the directory further changes are done to the directory in the same transaction. For example, if we add 10 dentries to a directory, fsync it, add more 10 dentries, fsync it again, then add more 10 dentries and fsync it again, then we end up inserting 3 batches of 10 items to the subvolume btree. With the changes from this patch, we flush all the delayed items to the btree only once - a single batch of 30 items, and outside the logging code (transaction commit or when delayed items are flushed asynchronously). This change simply skips the flushing of delayed items every time we log a directory. Instead we copy the delayed insertion items directly to the log tree and delete delayed deletion items directly from the log tree. Therefore avoiding changing first the subvolume btree and then scanning it for new items to copy from it to the log tree and detecting deletions by observing gaps in consecutive dir index keys in subvolume btree leaves. Running the following tests on a non-debug kernel (Debian's default kernel config), on a box with a NVMe device, a 12 cores Intel CPU and 64G of ram, produced the results below. The results compare a branch without this patch and all the other patches it depends on versus the same branch with the patchset applied. The patchset is comprised of the following patches: btrfs: don't drop dir index range items when logging a directory btrfs: remove the root argument from log_new_dir_dentries() btrfs: update stale comment for log_new_dir_dentries() btrfs: free list element sooner at log_new_dir_dentries() btrfs: avoid memory allocation at log_new_dir_dentries() for common case btrfs: remove root argument from btrfs_delayed_item_reserve_metadata() btrfs: store index number instead of key in struct btrfs_delayed_item btrfs: remove unused logic when looking up delayed items btrfs: shrink the size of struct btrfs_delayed_item btrfs: search for last logged dir index if it's not cached in the inode btrfs: move need_log_inode() to above log_conflicting_inodes() btrfs: move log_new_dir_dentries() above btrfs_log_inode() btrfs: log conflicting inodes without holding log mutex of the initial inode btrfs: skip logging parent dir when conflicting inode is not a dir btrfs: use delayed items when logging a directory Custom test script for testing time spent at btrfs_log_inode(): #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 # Total number of files to create in the test directory. NUM_FILES=10000 # Fsync after creating or renaming N files. FSYNC_AFTER=100 umount $DEV &> /dev/null mkfs.btrfs -f $DEV mount -o ssd $DEV $MNT TEST_DIR=$MNT/testdir mkdir $TEST_DIR echo "Creating files..." for ((i = 1; i <= $NUM_FILES; i++)); do echo -n > $TEST_DIR/file_$i if (( ($i % $FSYNC_AFTER) == 0 )); then xfs_io -c "fsync" $TEST_DIR fi done sync echo "Renaming files..." for ((i = 1; i <= $NUM_FILES; i++)); do mv $TEST_DIR/file_$i $TEST_DIR/file_$i.renamed if (( ($i % $FSYNC_AFTER) == 0 )); then xfs_io -c "fsync" $TEST_DIR fi done umount $MNT And using the following bpftrace script to capture the total time that is spent at btrfs_log_inode(): #!/usr/bin/bpftrace k:btrfs_log_inode { @start_log_inode[tid] = nsecs; } kr:btrfs_log_inode /@start_log_inode[tid]/ { $dur = (nsecs - @start_log_inode[tid]) / 1000; @btrfs_log_inode_total_time = sum($dur); delete(@start_log_inode[tid]); } END { clear(@start_log_inode); } Result before applying patchset: @btrfs_log_inode_total_time: 622642 Result after applying patchset: @btrfs_log_inode_total_time: 354134 (-43.1% time spent) The following dbench script was also used for testing: #!/bin/bash NUM_JOBS=$(nproc --all) DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-O no-holes -R free-space-tree" echo "performance" | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor umount $DEV &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT dbench -D $MNT --skip-cleanup -t 120 -S $NUM_JOBS umount $MNT Before patchset: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 3322265 0.034 21.032 Close 2440562 0.002 0.994 Rename 140664 1.150 269.633 Unlink 670796 1.093 269.678 Deltree 96 5.481 15.510 Mkdir 48 0.004 0.052 Qpathinfo 3010924 0.014 8.127 Qfileinfo 528055 0.001 0.518 Qfsinfo 552113 0.003 0.372 Sfileinfo 270575 0.005 0.688 Find 1164176 0.052 13.931 WriteX 1658537 0.019 5.918 ReadX 5207412 0.003 1.034 LockX 10818 0.003 0.079 UnlockX 10818 0.002 0.313 Flush 232811 1.027 269.735 Throughput 869.867 MB/sec (sync dirs) 12 clients 12 procs max_latency=269.741 ms After patchset: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 4152738 0.029 20.863 Close 3050770 0.002 1.119 Rename 175829 0.871 211.741 Unlink 838447 0.845 211.724 Deltree 120 4.798 14.162 Mkdir 60 0.003 0.005 Qpathinfo 3763807 0.011 4.673 Qfileinfo 660111 0.001 0.400 Qfsinfo 690141 0.003 0.429 Sfileinfo 338260 0.005 0.725 Find 1455273 0.046 6.787 WriteX 2073307 0.017 5.690 ReadX 6509193 0.003 1.171 LockX 13522 0.003 0.077 UnlockX 13522 0.002 0.125 Flush 291044 0.811 211.631 Throughput 1089.27 MB/sec (sync dirs) 12 clients 12 procs max_latency=211.750 ms (+25.2% throughput, -21.5% max latency) Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5557a069f3d7bfe5c9af5f04594133dad0fcacc7 Author: Filipe Manana Date: Wed Aug 17 12:22:47 2022 +0100 btrfs: skip logging parent dir when conflicting inode is not a dir When we find a conflicting inode (an inode that had the same name and parent directory as the inode we are logging now) that was deleted in the current transaction, we always end up logging its parent directory. This is to deal with the case where the conflicting inode corresponds to a deleted subvolume/snapshot or a directory that had subvolumes/snapshots (or some subdirectory inside it had subvolumes/snapshots, etc), because we can't deal with dropping subvolumes/snapshots during log replay. So if we log the parent directory, and if we are dealing with these special cases, then we fallback to a transaction commit when logging the parent, because its last_unlink_trans will match the current transaction (which gets set and propagated when a subvolume/snapshot is deleted). This change skips the logging of the parent directory when the conflicting inode is not a directory (or a subvolume/snapshot). This is ok because in this case logging the current inode is enough to trigger an unlink of the conflicting inode during log replay. So for a case like this: $ mkdir /mnt/dir $ echo -n "first foo data" > /mnt/dir/foo $ sync $ rm -f /mnt/dir/foo $ echo -n "second foo data" > /mnt/dir/foo $ xfs_io -c "fsync" /mnt/dir/foo We avoid logging parent directory "dir" when logging the new file "foo". In other cases it avoids falling back to a transaction commit, when the parent directory has a last_unlink_trans value that matches the current transaction, due to moving a file from it to some other directory. This is a case that happens frequently with dbench for example, where a new file that has the name/parent of another file that was deleted in the current transaction, is fsynced. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e09d94c9e44818527c936772f92b86aa22e73783 Author: Filipe Manana Date: Wed Aug 17 12:22:46 2022 +0100 btrfs: log conflicting inodes without holding log mutex of the initial inode When logging an inode, if we detect the inode has a reference that conflicts with some other inode that got renamed, we log that other inode while holding the log mutex of the current inode. We then find out if there are other inodes that conflict with the first conflicting inode, and log them while under the log mutex of the original inode. This is fine because the recursion can only happen once. For the upcoming work where we directly log delayed items without flushing them first to the subvolume tree, this recursion adds a lot of complexity and it's hard to keep lockdep happy about it. So collect a list of conflicting inodes and then log the inodes after unlocking the log mutex of the inode we started with. Also limit the maximum number of conflict inodes we log to 10, to avoid spending too much time logging (and maybe allocating too many list elements too), as typically we don't have more than 1 or 2 conflicting inodes - if we go over the limit, simply fallback to a transaction commit. It is possible to have a very long list of conflicting inodes to be intentionally created by a user if he/she creates a very long succession of renames like this: (...) rename E to F rename D to E rename C to D rename B to C rename A to B touch A (create a new file named A) fsync A If that happened for a sequence of hundreds or thousands of renames, it could massively slow down the logging and cause other secondary effects like for example blocking other fsync operations and transaction commits for a very long time (assuming it wouldn't run into -ENOSPC or -ENOMEM first). However such cases are very uncommon to happen in practice, nevertheless it's better to be prepared for them and avoid chaos. Such long sequence of conflicting inodes could be created before this change. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit f6d86dbebade107a852896fcaee9095bee231ca1 Author: Filipe Manana Date: Wed Aug 17 12:22:45 2022 +0100 btrfs: move log_new_dir_dentries() above btrfs_log_inode() The static function log_new_dir_dentries() is currently defined below btrfs_log_inode(), but in an upcoming patch a new function is introduced that is called by btrfs_log_inode() and this new function needs to call log_new_dir_dentries(). So move log_new_dir_dentries() to a location between btrfs_log_inode() and need_log_inode() (the later is called by log_new_dir_dentries()). Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit a375102426dfc4b4923c07165d5a38a2405d2f09 Author: Filipe Manana Date: Wed Aug 17 12:22:44 2022 +0100 btrfs: move need_log_inode() to above log_conflicting_inodes() The static function need_log_inode() is defined below btrfs_log_inode() and log_conflicting_inodes(), but in the next patches in the series we will need to call need_log_inode() in a couple new functions that will be used by btrfs_log_inode(). So move its definition to a location above log_conflicting_inodes(). Also make its arguments 'const', since they are not supposed to be modified. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 193df6245704dc6071b75d49f9036ca45b52ace6 Author: Filipe Manana Date: Mon Aug 22 11:51:39 2022 +0100 btrfs: search for last logged dir index if it's not cached in the inode The key offset of the last dir index item that was logged is stored in the inode's last_dir_index_offset field. However that field is not persisted in the inode item or elsewhere, so if the inode gets evicted and reloaded, it gets a value of (u64)-1, so that when we are logging dir index items we check if they were logged before, to avoid attempts to insert duplicated keys and fallback to a transaction commit. Improve on this by searching for the last dir index that was logged when we start logging a directory if the inode's last_dir_index_offset is not set (has a value of (u64)-1) and it was logged before. This avoids checking if each dir index item we find was already logged before, and simplifies the logging of dir index items (process_dir_items_leaf()). This will also be needed for an incoming change where we start logging delayed items directly, without flushing them first. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4c469798eee5c63dea359dbd39dc4efcf96ec0ba Author: Filipe Manana Date: Wed Aug 17 12:22:42 2022 +0100 btrfs: shrink the size of struct btrfs_delayed_item Currently struct btrfs_delayed_item has a base size of 96 bytes, but its size can be decreased by doing the following 2 tweaks: 1) Change data_len from u32 to u16. Our maximum possible leaf size is 64K, so the data_len can never be larger than that, and in fact it is always much smaller than that. The max length for a dentry's name is ensured at the VFS level (PATH_MAX, 4096 bytes) and in struct btrfs_inode_ref and btrfs_dir_item we use a u16 to store the name's length; 2) Change 'ins_or_del' to a 1 bit enum, which is all we need since it can only have 2 values. After this there's also no longer the need to BUG_ON() before using 'ins_or_del' in several places. Also rename the field from 'ins_or_del' to 'type', which is more clear. These two tweaks decrease the size of struct btrfs_delayed_item from 96 bytes down to 88 bytes. A previous patch already reduced the size of this structure by 16 bytes, but an upcoming change will increase its size by 16 bytes (adding a struct list_head element). Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4cbf37f504a5c4a9d1c695a8552be6025f37d668 Author: Filipe Manana Date: Wed Aug 17 12:22:41 2022 +0100 btrfs: remove unused logic when looking up delayed items All callers pass NULL to the 'prev' and 'next' arguments of the function __btrfs_lookup_delayed_item(), so remove these arguments. Also, remove the unnecessary wrapper __btrfs_lookup_delayed_insertion_item(), making btrfs_delete_delayed_insertion_item() directly call __btrfs_lookup_delayed_item(). Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 96d89923fa9496280e3cd1d504058d99df79f22e Author: Filipe Manana Date: Wed Aug 17 12:22:40 2022 +0100 btrfs: store index number instead of key in struct btrfs_delayed_item All delayed items are for dir index keys, so there's really no point of having an embedded struct btrfs_key in struct btrfs_delayed_item, which makes the structure use more space than necessary (and adds a hole of 7 bytes). So replace the key field with an index number (u64), which reduces the size of struct btrfs_delayed_item from 112 bytes down to 96 bytes. Some upcoming work will increase the structure size by 16 bytes, so this change compensates for that future size increase. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit df4928818b307373779dfce69ffc33764d065bea Author: Filipe Manana Date: Wed Aug 17 12:22:39 2022 +0100 btrfs: remove root argument from btrfs_delayed_item_reserve_metadata() The root argument of btrfs_delayed_item_reserve_metadata() is used only to get the fs_info object, but we already have a transaction handle, which we can use to get the fs_info. So remove the root argument. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 009d9bea49b4c78769da52b800412fb163ff0ae7 Author: Filipe Manana Date: Wed Aug 17 12:22:38 2022 +0100 btrfs: avoid memory allocation at log_new_dir_dentries() for common case At log_new_dir_dentries() we always start by allocating a list element for the starting inode and then do a while loop with the condition being a list emptiness check. This however is not needed, we can avoid allocating this initial list element and then just check for the list emptiness at the end of the loop's body. So just do that to save one memory allocation from the kmalloc-32 slab. This allows for not doing any memory allocation when we don't have any subdirectory to log, which is a very common case. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4008481343aa4d2587c6f2fa75759eda1f3fff41 Author: Filipe Manana Date: Wed Aug 17 12:22:37 2022 +0100 btrfs: free list element sooner at log_new_dir_dentries() At log_new_dir_dentries(), there's no need to keep the current list element allocated while processing the leaves with directory items for the current directory, and while logging other inodes. Plus in case we find a subdirectory, we also end up allocating a new list element while the current one is still allocated, temporarily using more memory than necessary. So free the current list element early on, before processing leaves. Also make the removal and release of all list elements in case of an error more simple by eliminating the label and goto, adding an explicit loop to release all list elements in case an error happens. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b96c552b99b3b22a0478a302fe61021239e5db38 Author: Filipe Manana Date: Wed Aug 17 12:22:36 2022 +0100 btrfs: update stale comment for log_new_dir_dentries() The comment refers to the function log_dir_items() in order to check why the inodes of new directory entries need to be logged, but the relevant comments are no longer at log_dir_items(), they were moved to the function process_dir_items_leaf() in commit eb10d85ee77f09 ("btrfs: factor out the copying loop of dir items from log_dir_items()"). So update it with the current function name. Also remove references with i_mutex to "VFS lock", since the inode lock is no longer a mutex since 2016 (it's now a rw semaphore). Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 8786a6d7403faed2ea1a43eb7978c5695cb5ebde Author: Filipe Manana Date: Wed Aug 17 12:22:35 2022 +0100 btrfs: remove the root argument from log_new_dir_dentries() There's no point in passing a root argument to log_new_dir_dentries() because it always corresponds to the root of the given inode. So remove it and extract the root from the given inode. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 04fc7d5123f2182e67426addd8bed490253acde0 Author: Filipe Manana Date: Wed Aug 17 12:22:34 2022 +0100 btrfs: don't drop dir index range items when logging a directory When logging a directory that was previously logged in the current transaction, we drop all the range items (BTRFS_DIR_LOG_INDEX_KEY key type). This is because we will process all leaves in the subvolume's tree that were changed in the current transaction and then add range items for covering new dir index items and deleted dir index items, which could cover now a larger range than before. We used to fail if we tried to insert a range item key that already exists, so we dropped all range items to avoid failing. However nowadays, since commit 750ee454908e90 ("btrfs: fix assertion failure when logging directory key range item"), we simply update any range item that already exists, increasing its range's last dir index if needed. Since the range covered by a range item can never decrease, due to the fact that dir index values come from a monotonically increasing counter and are never reused, we can stop dropping all range items before we start logging a directory. By not dropping the items we can avoid having occasional tree rebalance operations. This will also be needed for an incoming change where we start logging delayed items directly, without flushing them first. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 786672e9e1a39a231806313e3c445c236588ceef Author: Qu Wenruo Date: Mon Aug 8 13:45:43 2022 +0800 btrfs: scrub: use larger block size for data extent scrub [PROBLEM] The existing scrub code for data extents always limit the block size to sectorsize. This causes quite some extra scrub_block being allocated: (there is a data extent at logical bytenr 298844160, length 64KiB) alloc_scrub_block: new block: logical=298844160 physical=298844160 mirror=1 alloc_scrub_block: new block: logical=298848256 physical=298848256 mirror=1 alloc_scrub_block: new block: logical=298852352 physical=298852352 mirror=1 alloc_scrub_block: new block: logical=298856448 physical=298856448 mirror=1 alloc_scrub_block: new block: logical=298860544 physical=298860544 mirror=1 alloc_scrub_block: new block: logical=298864640 physical=298864640 mirror=1 alloc_scrub_block: new block: logical=298868736 physical=298868736 mirror=1 alloc_scrub_block: new block: logical=298872832 physical=298872832 mirror=1 alloc_scrub_block: new block: logical=298876928 physical=298876928 mirror=1 alloc_scrub_block: new block: logical=298881024 physical=298881024 mirror=1 alloc_scrub_block: new block: logical=298885120 physical=298885120 mirror=1 alloc_scrub_block: new block: logical=298889216 physical=298889216 mirror=1 alloc_scrub_block: new block: logical=298893312 physical=298893312 mirror=1 alloc_scrub_block: new block: logical=298897408 physical=298897408 mirror=1 alloc_scrub_block: new block: logical=298901504 physical=298901504 mirror=1 alloc_scrub_block: new block: logical=298905600 physical=298905600 mirror=1 ... scrub_block_put: free block: logical=298844160 physical=298844160 len=4096 mirror=1 scrub_block_put: free block: logical=298848256 physical=298848256 len=4096 mirror=1 scrub_block_put: free block: logical=298852352 physical=298852352 len=4096 mirror=1 scrub_block_put: free block: logical=298856448 physical=298856448 len=4096 mirror=1 scrub_block_put: free block: logical=298860544 physical=298860544 len=4096 mirror=1 scrub_block_put: free block: logical=298864640 physical=298864640 len=4096 mirror=1 scrub_block_put: free block: logical=298868736 physical=298868736 len=4096 mirror=1 scrub_block_put: free block: logical=298872832 physical=298872832 len=4096 mirror=1 scrub_block_put: free block: logical=298876928 physical=298876928 len=4096 mirror=1 scrub_block_put: free block: logical=298881024 physical=298881024 len=4096 mirror=1 scrub_block_put: free block: logical=298885120 physical=298885120 len=4096 mirror=1 scrub_block_put: free block: logical=298889216 physical=298889216 len=4096 mirror=1 scrub_block_put: free block: logical=298893312 physical=298893312 len=4096 mirror=1 scrub_block_put: free block: logical=298897408 physical=298897408 len=4096 mirror=1 scrub_block_put: free block: logical=298901504 physical=298901504 len=4096 mirror=1 scrub_block_put: free block: logical=298905600 physical=298905600 len=4096 mirror=1 This behavior will waste a lot of memory, especially after we have moved quite some members from scrub_sector to scrub_block. [FIX] To reduce the allocation of scrub_block, and to reduce memory usage, use BTRFS_STRIPE_LEN instead of sectorsize as the block size to scrub data extents. This results only one scrub_block to be allocated for above data extent: alloc_scrub_block: new block: logical=298844160 physical=298844160 mirror=1 scrub_block_put: free block: logical=298844160 physical=298844160 len=65536 mirror=1 This would greatly reduce the memory usage (even it's just transient) for larger data extents scrub. For above example, the memory usage would be: Old: num_sectors * (sizeof(scrub_block) + sizeof(scrub_sector)) 16 * (408 + 96) = 8065 New: sizeof(scrub_block) + num_sectors * sizeof(scrub_sector) 408 + 16 * 96 = 1944 A good reduction of 75.9%. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 8686c40e67e4fe3b2c439d63f33b6e91881db1d5 Author: Qu Wenruo Date: Mon Aug 8 13:45:42 2022 +0800 btrfs: scrub: move logical/physical/dev/mirror_num from scrub_sector to scrub_block Currently we store the following members in scrub_sector: - logical - physical - physical_for_dev_replace - dev - mirror_num However the current scrub code has ensured that scrub_blocks never cross stripe boundary. This is caused by the entry functions (scrub_simple_mirror, scrub_simple_stripe), thus every scrub_block will not cross stripe boundary. Thus this makes it possible to move those members into scrub_block other than putting them into scrub_sector. This should save quite some memory, as a scrub_block can be as large as 64 sectors, even for metadata it's 16 sectors byte default. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit eb2fad300550825457bf11d7dd751d9175add39e Author: Qu Wenruo Date: Mon Aug 8 13:45:41 2022 +0800 btrfs: scrub: remove scrub_sector::page and use scrub_block::pages instead Although scrub currently works for subpage (PAGE_SIZE > sectorsize) cases, it will allocate one page for each scrub_sector, which can cause extra unnecessary memory usage. Utilize scrub_block::pages[] instead of allocating page for each scrub_sector, this allows us to integrate larger extents while using less memory. For example, if our page size is 64K, sectorsize is 4K, and we got an 32K sized extent. We will only allocate one page for scrub_block, and all 8 scrub sectors will point to that page. To do that properly, here we introduce several small helpers: - scrub_page_get_logical() Get the logical bytenr of a page. We store the logical bytenr of the page range into page::private. But for 32bit systems, their (void *) is not large enough to contain a u64, so in that case we will need to allocate extra memory for it. For 64bit systems, we can use page::private directly. - scrub_block_get_logical() Just get the logical bytenr of the first page. - scrub_sector_get_page() Return the page which the scrub_sector points to. - scrub_sector_get_page_offset() Return the offset inside the page which the scrub_sector points to. - scrub_sector_get_kaddr() Return the address which the scrub_sector points to. Just a wrapper using scrub_sector_get_page() and scrub_sector_get_page_offset() - bio_add_scrub_sector() Please note that, even with this patch, we're still allocating one page for one sector for data extents. This is because in scrub_extent() we split the data extent using sectorsize. The memory usage reduction will need extra work to make scrub to work like data read to only use the correct sector(s). Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit f3e01e0e3c1f929d2ac39c335b024054b55e445a Author: Qu Wenruo Date: Mon Aug 8 13:45:40 2022 +0800 btrfs: scrub: introduce scrub_block::pages for more efficient memory usage for subpage [BACKGROUND] Currently for scrub, we allocate one page for one sector, this is fine for PAGE_SIZE == sectorsize support, but can waste extra memory for subpage support. [CODE CHANGE] Make scrub_block contain all the pages, so if we're scrubbing an extent sized 64K, and our page size is also 64K, we only need to allocate one page. [LIFESPAN CHANGE] Since now scrub_sector no longer holds a page, but is using scrub_block::pages[] instead, we have to ensure scrub_block has a longer lifespan for write bio. The lifespan for read bio is already large enough. Now scrub_block will only be released after the write bio finished. [COMING NEXT] Currently we only added scrub_block::pages[] for this purpose, but scrub_sector is still utilizing the old scrub_sector::page. The switch will happen in the next patch. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 5dd3d8e4680be763bdb34300d507a55cca0ec86e Author: Qu Wenruo Date: Mon Aug 8 13:45:39 2022 +0800 btrfs: scrub: factor out allocation and initialization of scrub_sector into helper The allocation and initialization is shared by 3 call sites, and we're going to change the initialization of some members in the upcoming patches. So factor out the allocation and initialization of scrub_sector into a helper, alloc_scrub_sector(), which will do the following work: - Allocate the memory for scrub_sector - Allocate a page for scrub_sector::page - Initialize scrub_sector::refs to 1 - Attach the allocated scrub_sector to scrub_block The attachment is bidirectional, which means scrub_block::sectorv[] will be updated and scrub_sector::sblock will also be updated. - Update scrub_block::sector_count and do extra sanity check on it Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 15b88f6d24f29fb6b24e8b92875a0ee7ba00b80e Author: Qu Wenruo Date: Mon Aug 8 13:45:38 2022 +0800 btrfs: scrub: factor out initialization of scrub_block into helper Although there are only two callers, we are going to add some members for scrub_block in the incoming patches. Factoring out the initialization code will make later expansion easier. One thing to note is, even scrub_handle_errored_block() doesn't utilize scrub_block::refs, we still use alloc_scrub_block() to initialize sblock::ref, allowing us to use scrub_block_put() to do cleanup. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 1dfa500511d07ae2327780e467b56f389f3e38a1 Author: Qu Wenruo Date: Mon Aug 8 13:45:37 2022 +0800 btrfs: scrub: use pointer array to replace sblocks_for_recheck In function scrub_handle_errored_block(), we use @sblocks_for_recheck pointer to hold one scrub_block for each mirror, and uses kcalloc() to allocate an array. But this one pointer for an array is not readable due to the member offsets done by addition and not []. Change this pointer to struct scrub_block *[BTRFS_MAX_MIRRORS], this will slightly increase the stack memory usage. Since function scrub_handle_errored_block() won't get iterative calls, this extra cost would completely be acceptable. And since we're here, also set sblock->refs and use scrub_block_put() to clean them up, as later we will add extra members in scrub_block, which needs scrub_block_put() to clean them up. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 38622010a6de3a62cc72688348548854ed82dcf5 Author: Boris Burkov Date: Mon Aug 15 13:54:28 2022 -0700 btrfs: send: add support for fs-verity Preserve the fs-verity status of a btrfs file across send/recv. There is no facility for installing the Merkle tree contents directly on the receiving filesystem, so we package up the parameters used to enable verity found in the verity descriptor. This gives the receive side enough information to properly enable verity again. Note that this means that receive will have to re-compute the whole Merkle tree, similar to how compression worked before encoded_write. Since the file becomes read-only after verity is enabled, it is important that verity is added to the send stream after any file writes. Therefore, when we process a verity item, merely note that it happened, then actually create the command in the send stream during 'finish_inode_if_needed'. This also creates V3 of the send stream format, without any format changes besides adding the new commands and attributes. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit e5677f056010298d3a8d43f710f8b445dd73462d Author: Uros Bizjak Date: Tue Aug 9 18:36:33 2022 +0200 btrfs: use atomic_try_cmpxchg in free_extent_buffer Use `atomic_try_cmpxchg(ptr, &old, new)` instead of `atomic_cmpxchg(ptr, old, new) == old` in free_extent_buffer. This has two benefits: - The x86 cmpxchg instruction returns success in the ZF flag, so this change saves a compare after cmpxchg, as well as a related move instruction in the front of cmpxchg. - atomic_try_cmpxchg implicitly assigns the *ptr value to &old when cmpxchg fails, enabling further code simplifications. This patch has no functional change. Reviewed-by: Boris Burkov Signed-off-by: Uros Bizjak Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc65bb53180cc13ea646c150316b219d4579ebe3 Author: Qu Wenruo Date: Wed Aug 10 13:58:57 2022 +0800 btrfs: scrub: remove impossible sanity checks There are several sanity checks which are no longer possible to trigger inside btrfs_scrub_dev(). Since we have mount time check against super block nodesize/sectorsize, and our fixed macro is hardcoded to handle even the worst combination. Thus those sanity checks are no longer needed, can be easily removed. But this patch still uses some ASSERT()s as a safe net just in case we change some features in the future to trigger those impossible combinations. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 527c490f44f6f13df30980203822a913c39c8192 Author: Josef Bacik Date: Fri Jul 15 15:45:29 2022 -0400 btrfs: delete btrfs_wait_space_cache_v1_finished We used to use this in a few spots, but now we only use it directly inside of block-group.c, so remove the helper and just open code where we were using it. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 588a486835b0bcf3fd457423f68204546220b6a7 Author: Josef Bacik Date: Fri Jul 15 15:45:28 2022 -0400 btrfs: remove lock protection for BLOCK_GROUP_FLAG_RELOCATING_REPAIR Before when this was modifying the bit field we had to protect it with the bg->lock, however now we're using bit helpers so we can stop using the bg->lock. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7b9c293b050f92e3441150f34f1dd801a0040e94 Author: Josef Bacik Date: Fri Jul 15 15:45:27 2022 -0400 btrfs: remove BLOCK_GROUP_FLAG_HAS_CACHING_CTL This is used mostly to determine if we need to look at the caching ctl list and clean up any references to this block group. However we never clear this flag, specifically because we need to know if we have to remove a caching ctl we have for this block group still. This is in the remove block group path which isn't a fast path, so the optimization doesn't really matter, simplify this logic and remove the flag. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 50c31eaa4ccf6923cd19d79033f8d7584de9077e Author: Josef Bacik Date: Fri Jul 15 15:45:26 2022 -0400 btrfs: simplify block group traversal in btrfs_put_block_group_cache We're breaking out and re-searching for the next block group while evicting any of the block group cache inodes. This is not needed, the block groups aren't disappearing here, we can simply loop through the block groups like normal and iput any inode that we find. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9283b9e09a6d4c0150c33b5674d5071234218c99 Author: Josef Bacik Date: Fri Jul 15 15:45:25 2022 -0400 btrfs: remove lock protection for BLOCK_GROUP_FLAG_TO_COPY We use this during device replace for zoned devices, we were simply taking the lock because it was in a bit field and we needed the lock to be safe with other modifications in the bitfield. With the bit helpers we no longer require that locking. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3349b57fd47b5de10936bd8928db546b20c9fb91 Author: Josef Bacik Date: Fri Jul 15 15:45:24 2022 -0400 btrfs: convert block group bit field to use bit helpers We use a bit field in the btrfs_block_group for different flags, however this is awkward because we have to hold the block_group->lock for any modification of any of these fields, and makes the code clunky for a few of these flags. Convert these to a properly flags setup so we can utilize the bit helpers. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 723de71d41f50709eaf2eef1b08aa409687a3c97 Author: Josef Bacik Date: Fri Jul 15 15:45:23 2022 -0400 btrfs: handle space_info setting of bg in btrfs_add_bg_to_space_info We previously had the pattern of btrfs_update_space_info(all, the, bg, fields, &space_info); link_block_group(bg); bg->space_info = space_info; Now that we're passing the bg into btrfs_add_bg_to_space_info we can do the linking in that function, transforming this to simply btrfs_add_bg_to_space_info(fs_info, bg); and put the link_block_group() and bg->space_info assignment directly in btrfs_add_bg_to_space_info. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9d4b0a129a0d081821f21edccad154f8e2a1b747 Author: Josef Bacik Date: Fri Jul 15 15:45:22 2022 -0400 btrfs: simplify arguments of btrfs_update_space_info and rename This function has grown a bunch of new arguments, and it just boils down to passing in all the block group fields as arguments. Simplify this by passing in the block group itself and updating the space_info fields based on the block group fields directly. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2f12741f81af638dfb682dc2f24e6cbb67a37a2e Author: Josef Bacik Date: Fri Jul 15 15:45:21 2022 -0400 btrfs: use btrfs_fs_closing for background bg work For both unused bg deletion and async balance work we'll happily run if the fs is closing. However I want to move these to their own worker thread, and they can be long running jobs, so add a check to see if we're closing and simply bail. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit d1f68ba0695a0ceba1a2ec72ee9b949fe4b92c98 Author: Omar Sandoval Date: Sat Jul 23 18:25:29 2022 -0400 btrfs: rename btrfs_insert_file_extent() to btrfs_insert_hole_extent() btrfs_insert_file_extent() is only ever used to insert holes, so rename it and remove the redundant parameters. Reviewed-by: Qu Wenruo Signed-off-by: Omar Sandoval Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7f298f224e889dece8d015ee7e3955a2adda60b8 Author: David Sterba Date: Tue Aug 2 15:46:28 2022 +0200 btrfs: sysfs: use sysfs_streq for string matching We have own string matching helper that duplicates what sysfs_streq does, with a slight difference that it skips initial whitespace. So far this is used for the drive allocation policy. The initial whitespace of written sysfs values should be rather discouraged and we should use a standard helper. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: David Sterba commit f9eab5f0bba76742af654f33d517bf62a0db8f12 Author: Qu Wenruo Date: Tue Aug 2 14:53:03 2022 +0800 btrfs: scrub: try to fix super block errors [BUG] The following script shows that, although scrub can detect super block errors, it never tries to fix it: mkfs.btrfs -f -d raid1 -m raid1 $dev1 $dev2 xfs_io -c "pwrite 67108864 4k" $dev2 mount $dev1 $mnt btrfs scrub start -B $dev2 btrfs scrub start -Br $dev2 umount $mnt The first scrub reports the super error correctly: scrub done for f3289218-abd3-41ac-a630-202f766c0859 Scrub started: Tue Aug 2 14:44:11 2022 Status: finished Duration: 0:00:00 Total to scrub: 1.26GiB Rate: 0.00B/s Error summary: super=1 Corrected: 0 Uncorrectable: 0 Unverified: 0 But the second read-only scrub still reports the same super error: Scrub started: Tue Aug 2 14:44:11 2022 Status: finished Duration: 0:00:00 Total to scrub: 1.26GiB Rate: 0.00B/s Error summary: super=1 Corrected: 0 Uncorrectable: 0 Unverified: 0 [CAUSE] The comments already shows that super block can be easily fixed by committing a transaction: /* * If we find an error in a super block, we just report it. * They will get written with the next transaction commit * anyway */ But the truth is, such assumption is not always true, and since scrub should try to repair every error it found (except for read-only scrub), we should really actively commit a transaction to fix this. [FIX] Just commit a transaction if we found any super block errors, after everything else is done. We cannot do this just after scrub_supers(), as btrfs_commit_transaction() will try to pause and wait for the running scrub, thus we can not call it with scrub_lock hold. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit e69bf81c9a339f1b2c041b112a6fbb9f60fc9340 Author: Qu Wenruo Date: Tue Aug 2 14:53:02 2022 +0800 btrfs: scrub: properly report super block errors in system log [PROBLEM] Unlike data/metadata corruption, if scrub detected some error in the super block, the only error message is from the updated device status: BTRFS info (device dm-1): scrub: started on devid 2 BTRFS error (device dm-1): bdev /dev/mapper/test-scratch2 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0 BTRFS info (device dm-1): scrub: finished on devid 2 with status: 0 This is not helpful at all. [CAUSE] Unlike data/metadata error reporting, there is no visible report in kernel dmesg to report supper block errors. In fact, return value of scrub_checksum_super() is intentionally skipped, thus scrub_handle_errored_block() will never be called for super blocks. [FIX] Make super block errors to output an error message, now the full dmesg would looks like this: BTRFS info (device dm-1): scrub: started on devid 2 BTRFS warning (device dm-1): super block error on device /dev/mapper/test-scratch2, physical 67108864 BTRFS error (device dm-1): bdev /dev/mapper/test-scratch2 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0 BTRFS info (device dm-1): scrub: finished on devid 2 with status: 0 BTRFS info (device dm-1): scrub: started on devid 2 This fix involves: - Move the super_errors reporting to scrub_handle_errored_block() This allows the device status message to show after the super block error message. But now we no longer distinguish super block corruption and generation mismatch, now all counted as corruption. - Properly check the return value from scrub_checksum_super() - Add extra super block error reporting for scrub_print_warning(). Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b0c582233a8563f3c4228df838cdc67a8807ec78 Author: Alexander Zhu Date: Tue Aug 2 13:32:46 2022 -0700 btrfs: fix alignment of VMA for memory mapped files on THP With CONFIG_READ_ONLY_THP_FOR_FS, the Linux kernel supports using THPs for read-only mmapped files, such as shared libraries. However, the kernel makes no attempt to actually align those mappings on 2MB boundaries, which makes it impossible to use those THPs most of the time. This issue applies to general file mapping THP as well as existing setups using CONFIG_READ_ONLY_THP_FOR_FS. This is easily fixed by using thp_get_unmapped_area for the unmapped_area function in btrfs, which is what ext2, ext4, fuse, and xfs all use. Initially btrfs had been left out in commit 8c07fc452ac0 ("btrfs: fix alignment of VMA for memory mapped files on THP") as btrfs does not support DAX. However, commit 1854bc6e2420 ("mm/readahead: Align file mappings for non-DAX") removed the DAX requirement. We should now be able to call thp_get_unmapped_area() for btrfs. The problem can be seen in /proc/PID/smaps where THPeligible is set to 0 on mappings to eligible shared object files as shown below. Before this patch: 7fc6a7e18000-7fc6a80cc000 r-xp 00000000 00:1e 199856 /usr/lib64/libcrypto.so.1.1.1k Size: 2768 kB THPeligible: 0 VmFlags: rd ex mr mw me With this patch the library is mapped at a 2MB aligned address: fbdfe200000-7fbdfe4b4000 r-xp 00000000 00:1e 199856 /usr/lib64/libcrypto.so.1.1.1k Size: 2768 kB THPeligible: 1 VmFlags: rd ex mr mw me This fixes the alignment of VMAs for any mmap of a file that has the rd and ex permissions and size >= 2MB. The VMA alignment and THPeligible field for anonymous memory is handled separately and is thus not effected by this change. CC: stable@vger.kernel.org # 5.18+ Signed-off-by: Alexander Zhu Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5f4403e10f9b75b081bcc763b98d73e29de8c248 Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:59 2022 -0700 btrfs: add lockdep annotations for the ordered extents wait event This wait event is very similar to the pending ordered wait event in the sense that it occurs in a different context than the condition signaling for the event. The signaling occurs in btrfs_remove_ordered_extent() while the wait event is implemented in btrfs_start_ordered_extent() in fs/btrfs/ordered-data.c However, in this case a thread must not acquire the lockdep map for the ordered extents wait event when the ordered extent is related to a free space inode. That is because lockdep creates dependencies between locks acquired both in execution paths related to normal inodes and paths related to free space inodes, thus leading to false positives. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9d7464c87b159bbf763c24faeb7a2dcaac96e4a1 Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:57 2022 -0700 btrfs: change the lockdep class of free space inode's invalidate_lock Reinitialize the class of the lockdep map for struct inode's mapping->invalidate_lock in load_free_space_cache() function in fs/btrfs/free-space-cache.c. This will prevent lockdep from producing false positives related to execution paths that make use of free space inodes and paths that make use of normal inodes. Specifically, with this change lockdep will create separate lock dependencies that include the invalidate_lock, in the case that free space inodes are used and in the case that normal inodes are used. The lockdep class for this lock was first initialized in inode_init_always() in fs/inode.c. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Signed-off-by: David Sterba commit 8b53779eaa98b55f4cccadd4d12b3233e9633140 Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:54 2022 -0700 btrfs: add lockdep annotations for pending_ordered wait event In contrast to the num_writers and num_extwriters wait events, the condition for the pending ordered wait event is signaled in a different context from the wait event itself. The condition signaling occurs in btrfs_remove_ordered_extent() in fs/btrfs/ordered-data.c while the wait event is implemented in btrfs_commit_transaction() in fs/btrfs/transaction.c Thus the thread signaling the condition has to acquire the lockdep map as a reader at the start of btrfs_remove_ordered_extent() and release it after it has signaled the condition. In this case some dependencies might be left out due to the placement of the annotation, but it is better than no annotation at all. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3e738c531aad8caa7f3d20ab878a8a0d3574e730 Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:52 2022 -0700 btrfs: add lockdep annotations for transaction states wait events Add lockdep annotations for the transaction states that have wait events; 1) TRANS_STATE_COMMIT_START 2) TRANS_STATE_UNBLOCKED 3) TRANS_STATE_SUPER_COMMITTED 4) TRANS_STATE_COMPLETED The new macros introduced here to annotate the transaction states wait events have the same effect as the generic lockdep annotation macros. With the exception of the lockdep annotation for TRANS_STATE_COMMIT_START the transaction thread has to acquire the lockdep maps for the transaction states as reader after the lockdep map for num_writers is released so that lockdep does not complain. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5a9ba6709f13313984900d635b4c73c9eb7d644e Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:50 2022 -0700 btrfs: add lockdep annotations for num_extwriters wait event Similarly to the num_writers wait event in fs/btrfs/transaction.c add a lockdep annotation for the num_extwriters wait event. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit e1489b4fe6045a79a5e9c658eed65311977e230a Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:48 2022 -0700 btrfs: add lockdep annotations for num_writers wait event Annotate the num_writers wait event in fs/btrfs/transaction.c with lockdep in order to catch deadlocks involving this wait event. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit ab9a323f9ab576000795285dd7ac6afeedf29e32 Author: Ioannis Angelakopoulos Date: Mon Jul 25 15:11:46 2022 -0700 btrfs: add macros for annotating wait events with lockdep Introduce four macros that are used to annotate wait events in btrfs code with lockdep; 1) the btrfs_lockdep_init_map 2) the btrfs_lockdep_acquire, 3) the btrfs_lockdep_release 4) the btrfs_might_wait_for_event macros. The btrfs_lockdep_init_map macro is used to initialize a lockdep map. The btrfs_lockdep_ macros are used by threads to take the lockdep map as readers (shared lock) and release it, respectively. The btrfs_might_wait_for_event macro is used by threads to take the lockdep map as writers (exclusive lock) and release it. In general, the lockdep annotation for wait events work as follows: The condition for a wait event can be modified and signaled at the same time by multiple threads. These threads hold the lockdep map as readers when they enter a context in which blocking would prevent signaling the condition. Frequently, this occurs when a thread violates a condition (lockdep map acquire), before restoring it and signaling it at a later point (lockdep map release). The threads that block on the wait event take the lockdep map as writers (exclusive lock). These threads have to block until all the threads that hold the lockdep map as readers signal the condition for the wait event and release the lockdep map. The lockdep annotation is used to warn about potential deadlock scenarios that involve the threads that modify and signal the wait event condition and threads that block on the wait event. A simple example is illustrated below: Without lockdep: TA TB cond = false lock(A) wait_event(w, cond) unlock(A) lock(A) cond = true signal(w) unlock(A) With lockdep: TA TB rwsem_acquire_read(lockdep_map) cond = false lock(A) rwsem_acquire(lockdep_map) rwsem_release(lockdep_map) wait_event(w, cond) unlock(A) lock(A) cond = true signal(w) unlock(A) rwsem_release(lockdep_map) In the second case, with the lockdep annotation, lockdep would warn about an ABBA deadlock, while the first case would just deadlock at some point. Reviewed-by: Josef Bacik Signed-off-by: Ioannis Angelakopoulos Reviewed-by: David Sterba Signed-off-by: David Sterba commit 62cd9d4474282a1eb84f945955c56cbfc42e1ffe Author: Qu Wenruo Date: Mon Aug 1 09:35:57 2022 +0800 btrfs: dump extra info if one free space cache has more bitmaps than it should There is an internal report on hitting the following ASSERT() in recalculate_thresholds(): ASSERT(ctl->total_bitmaps <= max_bitmaps); Above @max_bitmaps is calculated using the following variables: - bytes_per_bg 8 * 4096 * 4096 (128M) for x86_64/x86. - block_group->length The length of the block group. @max_bitmaps is the rounded up value of block_group->length / 128M. Normally one free space cache should not have more bitmaps than above value, but when it happens the ASSERT() can be triggered if CONFIG_BTRFS_ASSERT is also enabled. But the ASSERT() itself won't provide enough info to know which is going wrong. Is the bg too small thus it only allows one bitmap? Or is there something else wrong? So although I haven't found extra reports or crash dump to do further investigation, add the extra info to make it more helpful to debug. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d6d36cf2f8efd78455286050d6d8f9a8969d63b3 Author: Christian König Date: Fri Jul 15 10:34:13 2022 +0200 drm/ttm: add dma_resv_assert_held() calls to vmap/vunmap Let's make sure nobody is calling those functions without holding the appropriate locks. Signed-off-by: Christian König Reviewed-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220715111533.467012-2-christian.koenig@amd.com commit b2a4d007c347b4cb4c60f7512733c3f8300a129c Author: Elliot Berman Date: Tue Sep 20 12:06:58 2022 -0700 KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available() Ignore kvm-arm.mode if !is_hyp_mode_available(). Specifically, we want to avoid switching kvm_mode to KVM_MODE_PROTECTED if hypervisor mode is not available. This prevents "Protected KVM" cpu capability being reported when Linux is booting in EL1 and would not have KVM enabled. Reasonably though, we should warn if the command line is requesting a KVM mode at all if KVM isn't actually available. Allow "kvm-arm.mode=none" to skip the warning since this would disable KVM anyway. Signed-off-by: Elliot Berman Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220920190658.2880184-1-quic_eberman@quicinc.com commit 096560dd13251e351176aef54b7aee91c99920a3 Author: Gavin Shan Date: Fri Sep 23 14:54:47 2022 +0800 KVM: arm64: vgic: Remove duplicate check in update_affinity_collection() The 'coll' parameter to update_affinity_collection() is never NULL, so comparing it with 'ite->collection' is enough to cover both the NULL case and the "another collection" case. Remove the duplicate check in update_affinity_collection(). Signed-off-by: Gavin Shan [maz: repainted commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220923065447.323445-1-gshan@redhat.com commit d78c8b7131dc69abaa6d9131006ba30f9a51e41b Author: Baochen Qiang Date: Sat Sep 24 16:48:29 2022 +0300 wifi: ath11k: Fix deadlock during WoWLAN suspend We are seeing system hangs during WoWLAN suspend, and get below two stacks: Stack1: [ffffb02cc1557b20] __schedule at ffffffff8bb10860 [ffffb02cc1557ba8] schedule at ffffffff8bb10f24 [ffffb02cc1557bb8] schedule_timeout at ffffffff8bb16d88 [ffffb02cc1557c30] wait_for_completion at ffffffff8bb11778 [ffffb02cc1557c78] __flush_work at ffffffff8b0b30cd [ffffb02cc1557cf0] __cancel_work_timer at ffffffff8b0b33ad [ffffb02cc1557d60] ath11k_mac_drain_tx at ffffffffc0c1f0ca [ath11k] [ffffb02cc1557d70] ath11k_wow_op_suspend at ffffffffc0c5201e [ath11k] [ffffb02cc1557da8] __ieee80211_suspend at ffffffffc11e2bd3 [mac80211] [ffffb02cc1557dd8] wiphy_suspend at ffffffffc0f901ac [cfg80211] [ffffb02cc1557e08] dpm_run_callback at ffffffff8b75118a [ffffb02cc1557e38] __device_suspend at ffffffff8b751630 [ffffb02cc1557e70] async_suspend at ffffffff8b7519ea [ffffb02cc1557e88] async_run_entry_fn at ffffffff8b0bf4ce [ffffb02cc1557ea8] process_one_work at ffffffff8b0b1a24 [ffffb02cc1557ee0] worker_thread at ffffffff8b0b1c4a [ffffb02cc1557f18] kthread at ffffffff8b0b9cb8 [ffffb02cc1557f50] ret_from_fork at ffffffff8b001d32 Stack2: [ffffb02cc00b7d18] __schedule at ffffffff8bb10860 [ffffb02cc00b7da0] schedule at ffffffff8bb10f24 [ffffb02cc00b7db0] schedule_preempt_disabled at ffffffff8bb112b4 [ffffb02cc00b7db8] __mutex_lock at ffffffff8bb127ea [ffffb02cc00b7e38] ath11k_mgmt_over_wmi_tx_work at ffffffffc0c1aa44 [ath11k] [ffffb02cc00b7ea8] process_one_work at ffffffff8b0b1a24 [ffffb02cc00b7ee0] worker_thread at ffffffff8b0b1c4a [ffffb02cc00b7f18] kthread at ffffffff8b0b9cb8 [ffffb02cc00b7f50] ret_from_fork at ffffffff8b001d32 From the first stack, ath11k_mac_drain_tx calls cancel_work_sync(&ar->wmi_mgmt_tx_work) and waits all packets to be sent out or dropped. However, we find from Stack2 that this work item is blocked because ar->conf_mutex is already held by ath11k_wow_op_suspend. Fix this issue by moving ath11k_mac_wait_tx_complete to the start of ath11k_wow_op_suspend where ar->conf_mutex has not been acquired. And this change also makes the logic in ath11k_wow_op_suspend match the logic in ath11k_mac_op_start and ath11k_mac_op_stop. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220919021435.2459-1-quic_bqiang@quicinc.com commit d50ebec14535c4937b8b1ef2b6f7473373263a2f Author: Baochen Qiang Date: Sat Sep 24 16:48:18 2022 +0300 wifi: ath11k: Remove redundant ath11k_mac_drain_tx ath11k_mac_drain_tx is already called in ath11k_mac_wait_tx_complete, no need to call it again. So remove it. This is found in code review. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220919020259.1746-1-quic_bqiang@quicinc.com commit c92f774a95c6b0070494aa9591c854c347c5da96 Author: Tamizh Chelvam Raja Date: Sat Sep 24 16:47:12 2022 +0300 wifi: ath11k: Add spectral scan support for 160 MHz There are two types of 160 MHz spectral scan support mentioned below 1. Fragmented approach 2. Single event approach In this fragmented approach, single 160 MHz will be split as two 80 MHz buffer. First fft sample buffer will contain spectral scan result of primary 80 MHz and the second fft sample buffer will contain secondary 80 MHz and here cfreq1 and cfreq2 will be mentioned. In case of 160 MHz on 36th channel will contain cfreq1 as 5210 and cfreq2 as 5290. Chipsets which support this approach are IPQ8074/IPQ6018. Replacing freq1 with freq2 in every secondary sepctral scan event to distinguish between two different 80 MHz spectral event data. In the 2nd approach each fft sample buffer will contain spectral scan result for whole 160 MHz by mentioning cfreq1 as 5250 which is center frequency of whole 160 MHz. Chipset which support this approach is QCN9074. Host will receive spectral event from target for every 5 fft samples. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01120-QCAHKSWPL-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01120-QCAHKSWP Signed-off-by: Tamizh Chelvam Raja Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725055001.15194-1-quic_tamizhr@quicinc.com commit 710a95f955863592acdc697d4c6967285c052670 Author: Venkateswara Naralasetty Date: Sat Sep 24 16:47:12 2022 +0300 wifi: ath11k: Add support to get power save duration for each client Add support to get the following power save information through debugfs interface, * Current ps state of the peer * Time duration since the peer is in power save * Total duration of the peer spent in power save Above information is helpful in debugging the issues with power save clients. This patch also add trace log support for PS timekeeper to track the PS state change of the peers alongs with the peer MAC address and timestamp. Use the below commands to get the above power save information, To know the time_since_station_in_power_save: cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ XX:XX:XX:XX:XX:XX/current_ps_duration To know power_save_duration: cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ XX:XX:XX:XX:XX:XX/total_ps_duration To reset the power_save_duration of all stations connected to AP: echo 1 > /sys/kernel/debug/ieee80211/phyX/ath11k/reset_ps_duration To enable/disable the ps_timekeeper: echo Y > /sys/kernel/debug/ieee80211/phyX/ath11k/ps_timekeeper_enable Y = 1 to enable and Y = 0 to disable. To record PS timekeeer logs after enabling ps_timekeeper: trace-cmd record -e ath11k_ps_timekeeper Tested-on: Tested-on: IPQ8074 WLAN.HK.2.5.0.1-00991-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Tamizh Chelvam Raja Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725054601.14719-1-quic_tamizhr@quicinc.com commit 7a80bf902d2bc722b4477442ee772e8574603185 Author: Gaosheng Cui Date: Mon Sep 26 10:30:18 2022 +0800 fanotify: Remove obsoleted fanotify_event_has_path() All uses of fanotify_event_has_path() have been removed since commit 9c61f3b560f5 ("fanotify: break up fanotify_alloc_event()"), now it is useless, so remove it. Link: https://lore.kernel.org/r/20220926023018.1505270-1-cuigaosheng1@huawei.com Signed-off-by: Gaosheng Cui Signed-off-by: Jan Kara commit a8be6b6ee9595d425f304770811f3513a503e61c Author: Johan Hovold Date: Mon Aug 22 17:14:56 2022 +0200 media: flexcop-usb: use usb_endpoint_maxp() Use the usb_endpoint_maxp() helper instead of open coding. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220822151456.27178-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit fd449bb9ac44fdc334907db7bcc20ade9a4037cd Author: Johan Hovold Date: Mon Aug 22 17:14:55 2022 +0200 media: flexcop-usb: clean up URB initialisation Clean up URB initialisation somewhat by introducing a temporary variable and separating declaration and non-trivial initialisation. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220822151456.27178-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3de50478b5cc2e0c2479a5f2b967f331f7597d23 Author: Johan Hovold Date: Mon Aug 22 17:14:54 2022 +0200 media: flexcop-usb: clean up endpoint sanity checks Add a temporary variable to make the endpoint sanity checks a bit more readable. While at it, fix a typo in the usb_set_interface() comment. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220822151456.27178-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 67102bd31b4e31abb0abbc390381212a2d65db72 Merge: ad5dbfc123e6f f76349cf41451 Author: Greg Kroah-Hartman Date: Mon Sep 26 10:38:21 2022 +0200 Merge 6.0-rc7 into usb-next We need the USB fixes in here for other follow-on changes to be able to be applied successfully. Signed-off-by: Greg Kroah-Hartman commit c4c0efb06f17fa4a37ad99e7752b18a5405c76dc Author: Xuewen Yan Date: Mon Sep 26 16:34:05 2022 +0800 cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh Before update thermal pressure, the max cpufreq should be limited. Add QOS control for Lmh throttle cpufreq. Signed-off-by: Xuewen Yan Signed-off-by: Viresh Kumar commit 7589197485da6fb02f3c06cfd7465aa2193da563 Author: Martin Kaiser Date: Sun Sep 25 16:04:06 2022 +0200 staging: r8188eu: don't check for stop/removal in the blink worker The blink_work function calls either SwLedOff or SwLedOn. These two functions handle bSurpriseRemoved and bDriverStopped. There's no need to check bSurpriseRemoved and bDriverStopped again in the blink worker. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220925140406.112991-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 647085006beb2cc41bef27a24f249f4dec3c1e15 Author: Martin Kaiser Date: Sun Sep 25 16:04:05 2022 +0200 staging: r8188eu: don't check bSurpriseRemoved in SwLedOff The SwLedOff function calls rtw_read8 which in turn calls usb_read. bSurpriseRemoved is checked in usb_read. We don't have to check it again in SwLedOff. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220925140406.112991-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9d92bb1d89f5564653d7ee81d090c93f6e149da8 Author: Philipp Hortmann Date: Sun Sep 25 00:04:19 2022 +0200 staging: rtl8192e: Remove unused variables ForcedAMSDUMaxSize, ... Remove unused variables that are may just once written but never read ForcedAMSDUMaxSize, PeerBandwidth, SwBwStep, bIsPeerBcm and bAcceptAddbaReq to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0f3e63030511f72dbadc0368fd5e2dbd3ff84e07.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 53be6238f8bfcd1c960711b912ba1029dd17cf7d Author: Philipp Hortmann Date: Sun Sep 25 00:04:12 2022 +0200 staging: rtl8192e: Rename CurrentMPDU..., ForcedAMPDU... and ForcedMPDU... Rename variable CurrentMPDUDensity to current_mpdu_density, ForcedAMPDUFactor to forced_ampdu_factor and ForcedMPDUDensity to forced_mpdu_density to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4fb37ad6dab9addccf99a41a861220840c123e9b.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit be13eda50611cb7ccfe2269ebdc3e2c371f60b5e Author: Philipp Hortmann Date: Sun Sep 25 00:04:03 2022 +0200 staging: rtl8192e: Rename SelfMimoPs, CurrentOpMode and bForcedShortGI Rename variable SelfMimoPs to self_mimo_ps, CurrentOpMode to current_op_mode and bForcedShortGI to forced_short_gi to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4c59f62a95b9a77711284998b98fbc559b8db813.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c63f13358e533ea3996f32e7199a8c08e5e845a Author: Philipp Hortmann Date: Sun Sep 25 00:03:56 2022 +0200 staging: rtl8192e: Rename PeerMimoPs, IOTAction and IOTRaFunc Rename variable PeerMimoPs to peer_mimo_ps, IOTAction to iot_action and IOTRaFunc to iot_ra_func to avoid CamelCase which is not accepted by checkpatch. Added spaces around '&' as proposed by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2a8ce7bff9a00fe44c057242cedb27ca91219137.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 155c89f195360270b6139229f48b044a3f13be9c Author: Philipp Hortmann Date: Sun Sep 25 00:03:49 2022 +0200 staging: rtl8192e: Rename RxRe...WinSize, RxReorder... and RxReorderDr... Rename variable RxReorderWinSize to rx_reorder_win_size, RxReorderPendingTime to rx_reorder_pending_time and RxReorderDropCounter to rx_reorder_drop_counter to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e09ef6e2edc88e32782202589a9230204b547a9c.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 55bce0ae3689a098337ce8953a172c7ac590dcb2 Author: Philipp Hortmann Date: Sun Sep 25 00:03:42 2022 +0200 staging: rtl8192e: Rename szRT2RTAggBuffer, bRegRxRe... and bCurRxReo... Rename variable szRT2RTAggBuffer to sz_rt2rt_agg_buf, bRegRxReorderEnable to reg_rx_reorder_enable and bCurRxReorderEnable to cur_rx_reorder_enable to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/af445e0a80dc8e153a1ba81df99309f19a69d6cb.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 27dd3f00a7fd2ed391b9726d21d30d45d4066e42 Author: Philipp Hortmann Date: Sun Sep 25 00:03:31 2022 +0200 staging: rtl8192e: Rename bSwBwInPro..., bRegRT2RTAg... and bCurrentRT... Rename variable bSwBwInProgress to sw_bw_in_progress, bRegRT2RTAggregation to reg_rt2rt_aggregation and bCurrentRT2RTAggregation to current_rt2rt_aggregation to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/868f9db0e29bd170129f90bdbcc14238a750c440.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 92b2f4b851d970b4c3f82dc2ca3c3984278d524a Author: Philipp Hortmann Date: Sun Sep 25 00:03:24 2022 +0200 staging: rtl8192e: Rename dot11Cur..., bCurTxBW40MHz and bCurrentRT2... Rename variable dot11CurrentPreambleMode to dot11_current_preamble_mode, bCurTxBW40MHz to cur_tx_bw40mhz and bCurrentRT2RTLongSlotTime to current_rt2rt_long_slot_time to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/97c4f62da9a98b0ddcdaafae68182e3eb47f9a17.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b7dd95be88aac0f768191c92091a040886ec51ca Author: Philipp Hortmann Date: Sun Sep 25 00:03:16 2022 +0200 staging: rtl8192e: Rename eRfSleep, eRfPowerStateToSet and RfOffReason Rename variable eRfSleep to rf_sleep, eRfPowerStateToSet to rf_power_state_to_set and RfOffReason to rf_off_reason to avoid CamelCase which is not accepted by checkpatch. Omit the upfront "e" as no RfSleep and RfPowerStateToSet exist and it makes the variables unnecessary long. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/58e21e5cf86270edae93162db2395e6348c9c424.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec07986067a7496b437fba3ca7c987e61a54f7d4 Author: Philipp Hortmann Date: Sun Sep 25 00:03:07 2022 +0200 staging: rtl8192e: Rename eRFPowerState, eRfOff and eRfOn Rename variable eRFPowerState to rf_power_state, eRfOff to rf_off and eRfOn to rf_on to avoid CamelCase which is not accepted by checkpatch. Omit the upfront "e" as no RFPowerState, RfOff and RfOn exist and it makes the variables unnecessary long. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/52c676bbaf1f894e30971c5c409b4bcb71c8ef7e.1664055213.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit db65becab2a331863620be9a1c08eccbdd0e03a7 Author: Greg Kroah-Hartman Date: Sat Sep 24 12:58:17 2022 +0200 staging: fwserial: delete the driver. In the years since it was added (2012), no one has stepped up to maintain this properly and get it merged into the kernel tree. So remove it as it's obviously not being used. If it is being used, we can easily revert this and take the time to get it out of the staging tree. Link: https://lore.kernel.org/r/20220924105817.808385-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 877fe503e6310675830198233c326b27b74c5cec Author: Valentin Vidic Date: Sun Sep 25 14:38:10 2022 +0200 staging: rtl8192e: fix CamelCase variables Fix checkpatch warnings for variables: LinkCtrlReg, DeviceID, RevisionID, IrqLine. Tested-by: Philipp Hortmann Signed-off-by: Valentin Vidic Link: https://lore.kernel.org/r/20220925123810.2492865-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman commit 2e2cb44c03d2a1c2704ef1ce40159e06a01b09dc Author: Dragan Cvetic Date: Sat Sep 24 23:51:26 2022 +0100 staging: rtl8192e: Rename Tx_Retry_Count_Reg Rename: Current_Tx_Rate_Reg to CURRENT_TX_RATE_REG, Initial_Tx_Rate_Reg to INITIAL_TX_RATE_REG and Tx_Retry_Count_Reg to TX_RETRY_COUNT_REG to avoid CamelCase which is not accepted by checkpatch.pl. Tested-by: Philipp Hortmann Signed-off-by: Dragan Cvetic Link: https://lore.kernel.org/r/20220924225126.10527-1-dragan.m.cvetic@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4aef2085613106d0a3ce868a45f080babb4e3478 Author: ruanjinjie Date: Mon Sep 26 10:32:53 2022 +0800 drm/ast: make ast_modeset static The symbol is not used outside of the file, so mark it static. Fixes the following warning: drivers/gpu/drm/ast/ast_drv.c:42:5: warning: symbol 'ast_modeset' was not declared. Should it be static? Signed-off-by: ruanjinjie Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220926023253.739699-1-ruanjinjie@huawei.com commit 9ec105db6d13101627dc1f991904a3b07a32c998 Author: Yassine Oudjana Date: Sat Aug 13 09:33:20 2022 +0100 clk: mediatek: Use mtk_clk_register_gates_with_dev in simple probe Register gates with dev in mtk_clk_simple_probe. Signed-off-by: Yassine Oudjana Reviewed-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220813083319.45455-1-y.oudjana@protonmail.com Signed-off-by: Chen-Yu Tsai commit 5066c9acf5656fb96fed2cff646fe312e9a2962f Author: Yassine Oudjana Date: Sat Aug 13 09:32:49 2022 +0100 clk: mediatek: gate: Export mtk_clk_register_gates_with_dev This allows it to be used in drivers built as modules. Signed-off-by: Yassine Oudjana Reviewed-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220813083249.45427-1-y.oudjana@protonmail.com Signed-off-by: Chen-Yu Tsai commit 0f65caa911019561d71ceb70f0d1c7a965b3045f Merge: 4314a0b79fe18 08099ecd92162 Author: Greg Kroah-Hartman Date: Mon Sep 26 08:38:19 2022 +0200 Merge tag 'extcon-next-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: "Update extcon next for v6.1 1. Add USB Type-C support to extcon-tusb320.c - Add TYPE-C interface and expose the supported supply current, direction and connector polarity via the TYPE-C interface." * tag 'extcon-next-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: usbc-tusb320: fix kernel-doc warning extcon: usbc-tusb320: Add USB TYPE-C support extcon: usbc-tusb320: Factor out extcon into dedicated functions commit a61c7d88d38cf3b9c88cf667c4f8a389a57744d4 Author: Kai Vehmanen Date: Fri Sep 23 18:35:01 2022 +0300 ALSA: memalloc: use __GFP_RETRY_MAYFAIL for DMA mem allocs Use __GFP_RETRY_MAYFAIL instead of __GFP__NORETRY in snd_dma_dev_alloc(), snd_dma_wc_alloc() and friends, to allocate pages for device memory. The MAYFAIL flag retains the semantics of not triggering the OOM killer, but lowers the risk of alloc failure. MAYFAIL flag was added in commit dcda9b04713c3 ("mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic"). This change addresses recurring failures with SOF audio driver in test cases where a system suspend-resume stress test is run, combined with an active high memory-load use-case. The failure typically shows up as: [ 379.480229] sof-audio-pci-intel-tgl 0000:00:1f.3: booting DSP firmware [ 379.484803] sof-audio-pci-intel-tgl 0000:00:1f.3: error: memory alloc failed: -12 [ 379.484810] sof-audio-pci-intel-tgl 0000:00:1f.3: error: dma prepare for ICCMAX stream failed Multiple fixes to reduce the memory usage of DSP boot have been identified in SOF driver, but even with those fixes, debug on affected systems has shown that even a single page alloc may fail with __GFP_NORETRY. When this occurs, system is under significant load on physical memory, but a lot of reclaimable pages are available, so the system has not run out of memory. With __GFP_RETRY_MAYFAIL, the errors are not hit in these stress tests. The alloc failure is severe as audio capability is completely lost if alloc failure is hit at system resume. An alternative solution was considered where the resources for DSP boot would be kept allocated until driver is unbound. This would avoid the allocation failure, but consume memory that is only needed temporarily at probe and resume time. It seems better to not hang on to the memory, but rather work a bit harder for allocating the pages at resume. BugLink: https://github.com/thesofproject/linux/issues/3844 Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220923153501.3326041-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit b23975e60a944e1a3ef419a01838fca51a29baf3 Author: Jaroslav Kysela Date: Fri Sep 23 10:22:36 2022 +0200 ALSA: hda/hdmi: Limit the maximal count of PCM devices to 8 The current hardware has up to 4 converters. Save little space. The limit 8 is enough even for a more improved hardware. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220923082236.61024-1-perex@perex.cz Signed-off-by: Takashi Iwai commit f7968c22bd427f98bacccc44f11523ba6b498e7d Author: Xiu Jianfeng Date: Sat Sep 24 17:21:59 2022 +0800 cpufreq: Add __init annotation to module init funcs Add missing __init annotation to module init funcs. Signed-off-by: Xiu Jianfeng Signed-off-by: Viresh Kumar commit f991b117120569838676b9512f6e7d755fdfc12b Author: Yang Yingliang Date: Fri Sep 23 22:50:16 2022 +0800 cpufreq: tegra194: change tegra239_cpufreq_soc to static tegra239_cpufreq_soc is only used in tegra194-cpufreq.c now, change it to static. Fixes: 676886010707 ("cpufreq: tegra194: Add support for Tegra239") Signed-off-by: Yang Yingliang Signed-off-by: Viresh Kumar commit 3dfe6e17c97b16971619b53c2cc79185c7f8b9aa Author: Pablo Sun Date: Mon Sep 19 18:56:00 2022 +0200 clk: mediatek: add VDOSYS1 clock Add the clock gate definition for the DPI1 hardware in VDOSYS1. The parent clock "hdmi_txpll" is already defined in `mt8195.dtsi`. Signed-off-by: Pablo Sun Signed-off-by: Guillaume Ranquet Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220919-v1-2-4844816c9808@baylibre.com Signed-off-by: Chen-Yu Tsai commit 879b752b97f12b678978e17f57316641ef0f2aa0 Author: Pablo Sun Date: Mon Sep 19 18:55:59 2022 +0200 dt-bindings: clk: mediatek: Add MT8195 DPI clocks Expand dt-bindings slot for VDOSYS1 of MT8195. This clock is required by the DPI1 hardware and is a downstream of the HDMI pixel clock. Signed-off-by: Pablo Sun Signed-off-by: Guillaume Ranquet Reviewed-by: Mattijs Korpershoek Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220919-v1-1-4844816c9808@baylibre.com Signed-off-by: Chen-Yu Tsai commit 43eb33c6a1112766def8099e063763733a413329 Author: Miles Chen Date: Thu Sep 22 17:18:35 2022 +0800 clk: mediatek: mt8192: add mtk_clk_simple_remove mt8192 is already using mtk_clk_simple_probe, but not mtk_clk_simple_remove. Let's add mtk_clk_simple_remove for mt8192. Signed-off-by: Miles Chen Reviewed-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-8-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit d36d697a00f1896acc305e93501697cf2ba1da54 Author: Miles Chen Date: Thu Sep 22 17:18:34 2022 +0800 clk: mediatek: mt8183: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-7-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit a481c6c73bffc2e4ac3ffba8871d67ce2438c4b2 Author: Miles Chen Date: Thu Sep 22 17:18:33 2022 +0800 clk: mediatek: mt6797: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-6-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit dc6fdd8a1b9fa3256b035a47313ed077716fc2ff Author: Miles Chen Date: Thu Sep 22 17:18:32 2022 +0800 clk: mediatek: mt6779: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-5-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit 2b74c1f6efc6df15c7579f7e573d4cd80d6e3ba3 Author: Miles Chen Date: Thu Sep 22 17:18:31 2022 +0800 clk: mediatek: mt6765: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-4-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit f3e4e7350e2c457a63eb7efc0ea28277fa5fc990 Author: Miles Chen Date: Thu Sep 22 17:18:30 2022 +0800 clk: mediatek: mt2712: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-3-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit 973d1607d936cd319a1ec47a7d181e078150bd00 Author: Miles Chen Date: Thu Sep 22 17:18:29 2022 +0800 clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver mtk_clk_simple_probe was added by Chun-Jie to simply common flow of MediaTek clock drivers and ChenYu enhanced the error path of mtk_clk_simple_probe and added mtk_clk_simple_remove. Let's use mtk_clk_simple_probe and mtk_clk_simple_probe in other MediaTek clock drivers as well. Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922091841.4099-2-miles.chen@mediatek.com Signed-off-by: Chen-Yu Tsai commit 0d363282bb0c42dd412c9daa0c8a77e84fa32262 Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:55 2022 +0200 clk: mediatek: Add MediaTek Helio X10 MT6795 clock drivers Add the clock drivers for the entire clock tree of MediaTek Helio X10 MT6795, including system clocks (apmixedsys, infracfg, pericfg, topckgen) and multimedia clocks (mmsys, mfg, vdecsys, vencsys). Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220921091455.41327-9-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit b7520e2d4ed18af69d4da44ab3c61c62dbf84c8c Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:54 2022 +0200 clk: mediatek: clk-apmixed: Add helper function to unregister ref2usb_tx The ref2usb_tx clock was introduced a long time ago and, at that time, the MediaTek clock drivers were using CLK_OF_DECLARE, so they would never unregister. Nowadays, unregistering clock drivers is a thing, as we're registering them as platform_driver and allowing them to be kernel modules: add a helper function to cleanup the ref2usb_tx clock during error handling and upon module removal. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220921091455.41327-8-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 7cbe5cb291fa3cbd069152f8f955bff06b851923 Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:53 2022 +0200 clk: mediatek: Export required symbols to compile clk drivers as module In order to compile the clock drivers for various MediaTek SoCs as modules, it is necessary to export a few functions from the MediaTek specific clocks (and reset) libraries. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220921091455.41327-7-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 85b2181c285c9d6348704db98d6e40f5c2c93c01 Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:52 2022 +0200 clk: mediatek: clk-apmixed: Remove unneeded __init annotation Remove an unneeded __init annotation from the declaration of function mtk_clk_register_ref2usb_tx(): this avoids section mismatch warnings during modpost phase when called from functions that have no such annotation (useful when clocks are platform drivers). Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220921091455.41327-6-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit e629bf40d33cd469faace0ec57f6a55ac097f768 Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:51 2022 +0200 dt-bindings: clock: mediatek: Add clock driver bindings for MT6795 Add the bindings for the clock drivers of the MediaTek Helio X10 MT6795 SoC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220921091455.41327-5-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit f098c088f968dd159619c8447712b02f7ace178b Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:50 2022 +0200 dt-bindings: reset: Add bindings for MT6795 Helio X10 reset controllers Add the reset controller bindings for MT6795. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220921091455.41327-4-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 32ccd1ab09059c1d126f4e28fcccd7a4843f47e4 Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:49 2022 +0200 dt-bindings: clock: Add MediaTek Helio X10 MT6795 clock bindings Add the bindings for MT6795's clock controller. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220921091455.41327-3-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit d5099c95c93d63c41c9db0b1d030526b9ef11c0b Author: AngeloGioacchino Del Regno Date: Wed Sep 21 11:14:48 2022 +0200 dt-bindings: mediatek: Document MT6795 system controllers bindings Document the MediaTek Helio X10 (MT6795) bindings for the apmixedsys, infracfg, topckgen, pericfg and mmsys system controllers. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220921091455.41327-2-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai commit 1261255531088208daeca818e2b486030b5339e5 Author: Nathan Huckleberry Date: Mon Sep 26 09:31:00 2022 +0900 drm/exynos: Fix return type for mixer_mode_valid and hdmi_mode_valid The field mode_valid in exynos_drm_crtc_ops is expected to be of type enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, const struct drm_display_mode *mode); Likewise for mode_valid in drm_connector_helper_funcs. The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of mixer_mode_valid and hdmi_mode_valid should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter Link: https://protect2.fireeye.com/v1/url?k=3e644738-5fef521d-3e65cc77- 74fe485cbff6-36ad29bf912d3c9f&q=1&e=5cc06174-77dd-4abd-ab50- 155da5711aa3&u=https%3A%2F%2Fgithub.com%2FClangBuiltLinux%2Flinux%2Fissues%2F 1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Signed-off-by: Inki Dae commit 372a2eaf9bed96395699eb4c2d32e3fe48830e8c Author: hongao Date: Thu Jun 16 15:22:33 2022 +0800 drm/exynos: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Once EDID is parsed, the monitor HDMI support information is available through drm_display_info.is_hdmi. This driver calls drm_detect_hdmi_monitor() to receive the same information, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead. Signed-off-by: hongao Signed-off-by: Inki Dae commit 18011e50c497f04a57a8e00122906f04922b30b4 Author: Greg Ungerer Date: Thu Aug 25 14:36:44 2022 +1000 m68knommu: fix non-mmu classic 68000 legacy timer tick selection The family of classic 68000 parts supported when in non-mmu mode all currently use the legacy timer support. Move the selection of that config option, LEGACY_TIMER_TICK, into the core CPU configuration. This fixes compilation if no specific CPU variant is selected, since the LEGACY_TIMER_TICK option was only selected in the specific CPU variant configurations. Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit 750321ace9107e103f254bf46900629ff347eb7b Author: Greg Ungerer Date: Thu Aug 25 13:27:03 2022 +1000 m68knommu: fix non-specific 68328 choice interrupt build failure Compiling for a classic m68k non-MMU target with no specific CPU selected fails with the following error: arch/m68k/68000/ints.c: In function 'process_int': >> arch/m68k/68000/ints.c:82:30: error: 'ISR' undeclared (first use in this function) 82 | unsigned long pend = ISR; | ^~~ This interrupt handling code is specific to the 68328 family of 68000 parts. There is a couple of variants (68EZ328, 68VZ328) and the common ancestor of them the strait 68328. The code here includes a specific header for each variant type. But if none is selected then nothing is included to supply the appropriate register and bit flags defines. Rearrange the includes so that at least one type is always included. At the very least the 68328 base type should be the fallback, so make that true. Reported-by: kernel test robot Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit bb44c31cdcac107344dd2fcc3bd0504a53575c51 Author: Ronnie Sahlberg Date: Tue Sep 20 14:32:02 2022 +1000 cifs: destage dirty pages before re-reading them for cache=none This is the opposite case of kernel bugzilla 216301. If we mmap a file using cache=none and then proceed to update the mmapped area these updates are not reflected in a later pread() of that part of the file. To fix this we must first destage any dirty pages in the range before we allow the pread() to proceed. Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 09a1f9a168ae1f69f701689429871793174417d2 Author: Enzo Matsumiya Date: Fri Sep 16 20:57:05 2022 -0300 cifs: return correct error in ->calc_signature() If an error happens while getting the key or session in the ->calc_signature implementations, 0 (success) is returned. Fix it by returning a proper error code. Since it seems to be highly unlikely to happen wrap the rc check in unlikely() too. Reviewed-by: Ronnie Sahlberg Fixes: 32811d242ff6 ("cifs: Start using per session key for smb2/3 for signature generation") Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French commit d7752a6c60c2de889425e27912e3fa96ba5626b2 Author: Steve French Date: Mon Sep 19 23:08:03 2022 -0500 MAINTAINERS: Add Tom Talpey as cifs.ko reviewer He has been actively reviewing and submitting patches, especially for smbdirect (RDMA) so add him as a reviewer for cifs.ko Acked-by: Tom Talpey Signed-off-by: Steve French commit c3b6eed31f441129aee1cd8e59fd20ba2842f3c9 Author: Jiangshan Yi Date: Tue Sep 6 11:24:35 2022 +0800 cifs: misc: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Signed-off-by: Steve French commit 2d5604c822e91c3eebaa0f9d0691acb954071ef1 Author: Jonathan Cameron Date: Sun Sep 25 18:27:59 2022 +0100 hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() These new macros allow the compiler to see all the functions even if !CONFIG_PM* and remove the structures and functions if unused. This removes the need for __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Ninad Malwade Link: https://lore.kernel.org/r/20220925172759.3573439-19-jic23@kernel.org Signed-off-by: Guenter Roeck commit 655231d4b958cfe80f92ff8ae5c2d80d125b3c24 Author: Jonathan Cameron Date: Sun Sep 25 18:27:58 2022 +0100 hwmon: (w83627ehf) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-18-jic23@kernel.org Signed-off-by: Guenter Roeck commit 1efe2b254fe149d1b4ded4c3630f6a048add0269 Author: Jonathan Cameron Date: Sun Sep 25 18:27:57 2022 +0100 hwmon: (tmp108) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-17-jic23@kernel.org Signed-off-by: Guenter Roeck commit a158b4ea194a3a0232fcfac723ac5923a01bfa1a Author: Jonathan Cameron Date: Sun Sep 25 18:27:56 2022 +0100 hwmon: (tmp103) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-16-jic23@kernel.org Signed-off-by: Guenter Roeck commit 73568f92d365d55c5261dda83ef9ec9944929f2e Author: Jonathan Cameron Date: Sun Sep 25 18:27:55 2022 +0100 hwmon: (tmp102) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-15-jic23@kernel.org Signed-off-by: Guenter Roeck commit 1839391bdedb23d0e07e9030e18466172818d824 Author: Jonathan Cameron Date: Sun Sep 25 18:27:54 2022 +0100 hwmon: (pwm-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-14-jic23@kernel.org Signed-off-by: Guenter Roeck commit 8de7295c207fcf78f61b6c7e00ef45554a0ebd22 Author: Jonathan Cameron Date: Sun Sep 25 18:27:53 2022 +0100 hwmon: (nct6775) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Zoltán Kővágó Link: https://lore.kernel.org/r/20220925172759.3573439-13-jic23@kernel.org Signed-off-by: Guenter Roeck commit 77563092fe1e58fa84ed6543e0a8f99e03915f4b Author: Jonathan Cameron Date: Sun Sep 25 18:27:52 2022 +0100 hwmon: (max6639) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of #ifdef guards whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Roland Stigge Link: https://lore.kernel.org/r/20220925172759.3573439-12-jic23@kernel.org Signed-off-by: Guenter Roeck commit 5ce951abc5037f3dea54021e3368a6842c15fe7b Author: Jonathan Cameron Date: Sun Sep 25 18:27:51 2022 +0100 hwmon: (max31730) witch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Guenter Roeck Link: https://lore.kernel.org/r/20220925172759.3573439-11-jic23@kernel.org Signed-off-by: Guenter Roeck commit 80294537171703284e18ada3fc213c94b54e6b03 Author: Jonathan Cameron Date: Sun Sep 25 18:27:50 2022 +0100 hwmon: (max31722) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-10-jic23@kernel.org Signed-off-by: Guenter Roeck commit ca19f965429e8d79d688a4446fde3456f22a8c62 Author: Jonathan Cameron Date: Sun Sep 25 18:27:49 2022 +0100 hwmon: (ltc2947) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. In this case it also lets the structure itself be removed. Signed-off-by: Jonathan Cameron Cc: Nuno Sá Link: https://lore.kernel.org/r/20220925172759.3573439-9-jic23@kernel.org Signed-off-by: Guenter Roeck commit d025007daaef3e468021c998e1de3f9bf3ba3476 Author: Jonathan Cameron Date: Sun Sep 25 18:27:48 2022 +0100 hwmon: (lm90) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Guenter Roeck Link: https://lore.kernel.org/r/20220925172759.3573439-8-jic23@kernel.org Signed-off-by: Guenter Roeck commit 31b34d62081a31255e520b702cec2e44183b0acc Author: Jonathan Cameron Date: Sun Sep 25 18:27:47 2022 +0100 hwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220925172759.3573439-7-jic23@kernel.org Signed-off-by: Guenter Roeck commit 5e866400e9d5d68d52907cbd91082c1cad477355 Author: Jonathan Cameron Date: Sun Sep 25 18:27:46 2022 +0100 hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Link: https://lore.kernel.org/r/20220925172759.3573439-6-jic23@kernel.org [groeck: Drop #ifdef from struct gpio_fan_data] Signed-off-by: Guenter Roeck commit 29805956ee16b487dee57823d884df0bfe45ff69 Author: Jonathan Cameron Date: Sun Sep 25 18:27:45 2022 +0100 hwmon: (adt7x10) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220925172759.3573439-5-jic23@kernel.org Signed-off-by: Guenter Roeck commit 00f4095c967f00c5ad450569f66f0bb82cc97178 Author: Jonathan Cameron Date: Sun Sep 25 18:27:44 2022 +0100 hwmon: (acpi_power_meter) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220925172759.3573439-4-jic23@kernel.org Signed-off-by: Guenter Roeck commit e7045a14fa1459f4fd56c3b6944382a00586cc89 Author: Jonathan Cameron Date: Sun Sep 25 18:27:43 2022 +0100 hwmon: (abitguru3) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst achieving the same result. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Link: https://lore.kernel.org/r/20220925172759.3573439-3-jic23@kernel.org Signed-off-by: Guenter Roeck commit 38e776290efa5e4c32c2a71d23da7d9907086e93 Author: Jonathan Cameron Date: Sun Sep 25 18:27:42 2022 +0100 hwmon: (abitguru) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Link: https://lore.kernel.org/r/20220925172759.3573439-2-jic23@kernel.org Signed-off-by: Guenter Roeck commit df9ec2dae094225190527f9406ad3ce8983baa1f Author: Uwe Kleine-König Date: Sat Sep 24 23:28:52 2022 +0200 hwmon: (f71882fg) Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless code repetition (unless there are cyclic dependencies). Reorder some functions and variables which allows to get rid of 42 forward declarations. Signed-off-by: Uwe Kleine-König Signed-off-by: Guenter Roeck commit 984fed5686e172e9dfc405b36b7477cfb54733fe Author: Uwe Kleine-König Date: Sat Sep 24 15:57:38 2022 +0200 hwmon: (via686a) Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 4 forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220924135738.234051-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 50e52c1fc5cecfac52287a2227d8883b32963876 Author: Uwe Kleine-König Date: Sat Sep 24 15:57:37 2022 +0200 hwmon: (via686a) Introduce a #define for the driver name and use it Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of sis5595_driver.driver.name which breaks a cyclic dependency between sis5595_probe() and sis5595_driver that in the next commit allows to drop some forward declarations. For an amd64 allyesconfig this even reduces the size of the driver by 3 bytes. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220924135738.234051-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 8887516f01066375d70162a978b3fd9d73695878 Author: Li Zhong Date: Fri Sep 23 17:17:51 2022 -0700 hwmon: (adm9240) fix data race in adm9240_fan_read In adm9240_read() adm9240_fan_read() adm9240_write_fan_div(), it assumes that the caller of adm9240_write_fan_div() must hold data->update_lock. Otherwise, it may cause data races when data is updated by other threads. Signed-off-by: Li Zhong Link: https://lore.kernel.org/r/20220924001751.1726369-1-floridsleeves@gmail.com Signed-off-by: Guenter Roeck commit f9c0cf8f26de367c58e48b02b1cdb9c377626e6f Author: Jason A. Donenfeld Date: Sat Sep 24 12:11:51 2022 +0200 hwmon: (sht4x) do not overflow clamping operation on 32-bit platforms On 32-bit platforms, long is 32 bits, so (long)UINT_MAX is less than (long)SHT4X_MIN_POLL_INTERVAL, which means the clamping operation is bogus. Fix this by clamping at INT_MAX, so that the upperbound is the same on all platforms. Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220924101151.4168414-1-Jason@zx2c4.com Signed-off-by: Guenter Roeck commit 1b2f9b1e6dd36a64b84f65078322109ffc453f0c Author: Uwe Kleine-König Date: Thu Sep 22 09:49:00 2022 +0200 hwmon: (sis5595) Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 6 forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220922074900.2763331-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 847a3b04b32ee36b9049d48da23d70ee83cf6d0a Author: Uwe Kleine-König Date: Thu Sep 22 09:48:59 2022 +0200 hwmon: (sis5595) Introduce a #define for the driver name and use it Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of sis5595_driver.driver.name which breaks a cyclic dependency between sis5595_probe() and sis5595_driver that in the next commit allows to drop some forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220922074900.2763331-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 0dee25ebc7d315d9ee785ea5f457ae980979ea89 Author: Uwe Kleine-König Date: Mon Aug 8 08:06:40 2022 +0200 hwmon: Make use of devm_clk_get_enabled() Several drivers manually register a devm handler to disable their clk. Convert them to devm_clk_get_enabled(). Acked-by: Guenter Roeck Reviewed-by: Nuno Sá Acked-by: Jonathan Cameron Signed-off-by: Uwe Kleine-König Signed-off-by: Guenter Roeck commit 903882c767051a17c1535b2a820e2931ee44b8fb Author: Eliav Farber Date: Wed Sep 21 12:17:23 2022 +0000 hwmon: (mr75203) fix undefined reference to `__divdi3' Fix build error on 32-bit machines. Fixes: 94c025b6f735 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet") Signed-off-by: Eliav Farber Reported-by: kernel test robot Tested-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20220921121723.6726-1-farbere@amazon.com Signed-off-by: Guenter Roeck commit ac387b0cb34b35e098dee52ef3856fa4afe35ab2 Author: Uwe Kleine-König Date: Tue Sep 20 15:56:17 2022 +0200 hwmon: (vt8231) Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 5 forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220920135617.1046361-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 6c7c469c8074e2bb20c41592f28b81925988b1a7 Author: Uwe Kleine-König Date: Tue Sep 20 15:56:16 2022 +0200 hwmon: (vt8231) Introduce a #define for the driver name and use it Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of vt8231_driver.driver.name which breaks a cyclic dependency between vt8231_probe() and vt8231_driver that in the next commit allows to drop some forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220920135617.1046361-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 070affa898d2afc64a9633880a520ad21c8cf5cc Author: Uwe Kleine-König Date: Mon Sep 19 12:31:55 2022 +0200 hwmon: (pc87360) Reorder symbols to get rid of a few forward declarations Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 6 forward declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220919103155.795151-3-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 02e0500553890dd11bb2d20d9b865d0af7a6ec22 Author: Uwe Kleine-König Date: Mon Sep 19 12:31:54 2022 +0200 hwmon: (pc87360) Introduce a #define for the driver name and use it Make use of the cpp symbol DRIVER_NAME to set the driver's name and also as name for devm_request_region(). While at it add a module alias using the new define. This is a preparation for the next cleanup commit that removes a cyclic dependency between pc87360_driver (which references pc87360_probe in .probe) and pc87360_probe() (which used pc87360_driver.driver.name). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220919103155.795151-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit b99152d4f04b379e31db6c1a2dda6b272c92039b Author: Alexander Stein Date: Wed Sep 14 17:31:37 2022 +0200 hwmon: (pwm-fan) Switch regulator dynamically This adds the enable attribute which is used to select if zero PWM duty means to switch off regulator and PWM or to keep them enabled but at inactive PWM output level. Depending on the select enable mode, turn off the regulator and PWM if the PWM duty is zero, or keep them enabled. This is especially important for fan using inverted PWM signal polarity. Having regulator supplied and PWM disabled, some PWM controllers provide the active, rather than inactive signal. With this change the shutdown as well as suspend/resume paths require modifcations as well. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220914153137.613982-6-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck commit 9db6e7f500541b797acc207c790024f6179e2e6c Author: Alexander Stein Date: Wed Sep 14 17:31:36 2022 +0200 hwmon: (pwm-fan) split __set_pwm into locked/unlocked functions Regular calls to set_pwm don't hold the mutex, but the upcoming update_enable support needs to call set_pwm with the mutex being held. So provide the previous behavior in set_pwm (handling the lock), while adding __set_pwm which assumes the lock being held. Signed-off-by: Alexander Stein Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220914153137.613982-5-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck commit 9bf3aa60808803d56cb34bdff336e85c87c8026d Author: Alexander Stein Date: Wed Sep 14 17:31:35 2022 +0200 hwmon: (pwm-fan) Add dedicated power switch function This handles enabling/disabling the regulator in a single function, while keeping the enables/disabled balanced. This is a preparation when regulator is switched from different code paths. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220914153137.613982-4-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck commit b77f0c7680a4df2a550be5e0158204de1aa3a3ce Author: Alexander Stein Date: Wed Sep 14 17:31:34 2022 +0200 hwmon: (pwm-fan) Simplify enable/disable check Instead of comparing the current to the new pwm duty to decide whether to enable the PWM, use a dedicated flag. Also apply the new PWM duty in any case. This is a preparation to enable/disable the regulator dynamically. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220914153137.613982-3-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck commit bf10ccad068088f4e31f4d4266356d1d24cf5734 Author: Alexander Stein Date: Wed Sep 14 17:31:33 2022 +0200 hwmon: (pwm-fan) Refactor fan power on/off In preparation for dynamically switching regulator, split the power on and power off sequence into separate functions. Signed-off-by: Alexander Stein Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220914153137.613982-2-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck commit cc842bd57e779ee242f6bcc88149dec4542ea563 Author: Duke Du Date: Mon Sep 12 11:01:08 2022 +0800 hwmon: (pmbus) Add driver for the TEXAS TPS546D24 Buck Converter. Add the pmbus driver for TEXAS tps546d24 Buck Converter. The vout mode of tps546d24 supported relative data format, which is not supported by the PMBus core. Signed-off-by: Duke Du Link: https://lore.kernel.org/r/1662951668-9849-1-git-send-email-Duke.Du@quantatw.com [groeck: Add __maybe_unused to tps546d24_of_match declaration] Signed-off-by: Guenter Roeck commit 08099ecd9216219f51cc82637f06797cf81890b6 Author: Rong Chen Date: Tue Sep 6 12:04:29 2022 +0800 extcon: usbc-tusb320: fix kernel-doc warning Fix the warning: drivers/extcon/extcon-usbc-tusb320.c:19: warning: expecting prototype for drivers/extcon/extcon-tusb320.c(). Prototype was for TUSB320_REG8() instead Reported-by: kernel test robot Signed-off-by: Rong Chen Signed-off-by: Chanwoo Choi commit bf7571c00dca0a9c5af3f5125ef5a89a40b13cd5 Author: Marek Vasut Date: Sat Jul 30 20:05:00 2022 +0200 extcon: usbc-tusb320: Add USB TYPE-C support The TI TUSB320 seems like a better fit for USB TYPE-C subsystem, which can expose details collected by the TUSB320 in a far more precise way than extcon. Since there are existing users in the kernel and in DT which depend on the extcon interface, keep it for now. Add TYPE-C interface and expose the supported supply current, direction and connector polarity via the TYPE-C interface. Signed-off-by: Marek Vasut Acked-by: Heikki Krogerus Reviewed-by: Alvin Šipraga Signed-off-by: Chanwoo Choi commit 9483811a126a319ecac749f1b767ea5faecc7aed Author: Marek Vasut Date: Sat Jul 30 20:04:59 2022 +0200 extcon: usbc-tusb320: Factor out extcon into dedicated functions Move extcon code into separate functions in preparation for addition of USB TYPE-C support. No functional change. Signed-off-by: Marek Vasut Signed-off-by: Chanwoo Choi commit fb2ac84f8acccdec644d26dfc8ba6554f30cd6c0 Author: Christophe JAILLET Date: Sat Sep 10 16:15:56 2022 +0200 PM / devfreq: rockchip-dfi: Fix an error message There is a typo in the message. The clock name should be 'pclk_ddr_mon'. Fix it. While at it, switch to dev_err_probe() which is less verbose, filters -EPROBE_DEFER, and log the error code in a human readable way. Signed-off-by: Christophe JAILLET Signed-off-by: Chanwoo Choi commit e09bd5757b5227d6804b30c58d4587f7f87d1afa Author: AngeloGioacchino Del Regno Date: Wed Jul 13 13:15:11 2022 +0200 PM / devfreq: mtk-cci: Handle sram regulator probe deferral If the regulator_get_optional() call for the SRAM regulator returns a probe deferral, we must bail out and retry probing later: failing to do this will produce unstabilities on platforms requiring the handling for this regulator. Fixes: b615b00c42da ("PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Chanwoo Choi commit 57569c37f0add1b6489e1a1563c71519daf732cf Author: Mike Christie Date: Wed Sep 7 17:17:00 2022 -0500 scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername() Fix a NULL pointer crash that occurs when we are freeing the socket at the same time we access it via sysfs. The problem is that: 1. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() take the frwd_lock and do sock_hold() then drop the frwd_lock. sock_hold() does a get on the "struct sock". 2. iscsi_sw_tcp_release_conn() does sockfd_put() which does the last put on the "struct socket" and that does __sock_release() which sets the sock->ops to NULL. 3. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() then call kernel_getpeername() which accesses the NULL sock->ops. Above we do a get on the "struct sock", but we needed a get on the "struct socket". Originally, we just held the frwd_lock the entire time but in commit bcf3a2953d36 ("scsi: iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername()") we switched to refcount based because the network layer changed and started taking a mutex in that path, so we could no longer hold the frwd_lock. Instead of trying to maintain multiple refcounts, this just has us use a mutex for accessing the socket in the interface code paths. Link: https://lore.kernel.org/r/20220907221700.10302-1-michael.christie@oracle.com Fixes: bcf3a2953d36 ("scsi: iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername()") Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit c863a2dcb9b0894d9ac6030c4d1ab2e7867dabcb Author: Jules Irenge Date: Mon Sep 12 22:29:11 2022 +0100 scsi: mpi3mr: Remove unnecessary cast coccinelle reports a warning: WARNING: casting value returned by memory allocation function to (struct mpi3mr_throttle_group_info *) is useless To fix this, the unnecessary cast is removed. Link: https://lore.kernel.org/r/Yx+kp8NxHvDHs7dv@playground Signed-off-by: Jules Irenge Signed-off-by: Martin K. Petersen commit 6022f210461fef67e6e676fd8544ca02d1bcfa7a Author: Linus Torvalds Date: Fri Sep 9 08:54:47 2022 +0200 scsi: stex: Properly zero out the passthrough command structure The passthrough structure is declared off of the stack, so it needs to be set to zero before copied back to userspace to prevent any unintentional data leakage. Switch things to be statically allocated which will fill the unused fields with 0 automatically. Link: https://lore.kernel.org/r/YxrjN3OOw2HHl9tx@kroah.com Cc: stable@kernel.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Dan Carpenter Reported-by: hdthky Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Signed-off-by: Martin K. Petersen commit f616efbee9d64cbd3b7b955914fea01cbdd95710 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:42 2022 +0530 scsi: mpi3mr: Update driver version to 8.2.0.3.0 Update driver version to 8.2.0.3.0. Link: https://lore.kernel.org/r/20220912135742.11764-10-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 2e31be8697b16391d33c74c47f09fdef5015369e Author: Sreekanth Reddy Date: Mon Sep 12 19:27:41 2022 +0530 scsi: mpi3mr: Fix scheduling while atomic type bug Fix 'scheduling while atomic' type bug, which is observed when pci_irq_vector() is called from interrupt context. Link: https://lore.kernel.org/r/20220912135742.11764-9-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit f84e8b5bb57eb64391a45f95ebf0e2a179d8c566 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:40 2022 +0530 scsi: mpi3mr: Scan the devices during resume time Scan the target devices during system resume time and add or remove the target device with the SML if the corresponding target device is newly added or removed respectively. Link: https://lore.kernel.org/r/20220912135742.11764-8-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 130fc180a48141cb6fbfdb30138a114cf9be61c7 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:39 2022 +0530 scsi: mpi3mr: Free enclosure objects during driver unload Free the enclosure device objects during driver unload and before rescanning the target devices during controller reset. Link: https://lore.kernel.org/r/20220912135742.11764-7-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit bad2f28da6250120ddbd19e4b68c814b3e3aaa2d Author: Sreekanth Reddy Date: Mon Sep 12 19:27:38 2022 +0530 scsi: mpi3mr: Handle 0xF003 Fault Code Handle the 0xF003 controller fault code as a special case by marking the controller as unrecoverable with logging a message indicating the driver marks the controller as unrecoverable due to the specific fault. Link: https://lore.kernel.org/r/20220912135742.11764-6-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit f2a79d2030ad9055e58f5b617f655fa5e270a57c Author: Sreekanth Reddy Date: Mon Sep 12 19:27:37 2022 +0530 scsi: mpi3mr: Graceful handling of surprise removal of PCIe HBA Implement graceful handling of surprise or orderly removal of PCIe HBA: - Detect a hot removal of the controller at certain critical places in the driver. Early detection will help to reduce the time taken for cleaning up the hot-removed controller at the driver level. - Poll the status of the port enable issued after reset once every 5 seconds to avoid a long delay in detecting unavailable controller. Link: https://lore.kernel.org/r/20220912135742.11764-5-sreekanth.reddy@broadcom.com Reported-by: kernel test robot Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 7f9f953d537a7c8362ed6adafd25ef8deb548756 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:36 2022 +0530 scsi: mpi3mr: Schedule IRQ kthreads only on non-RT kernels In RT kernels, the IRQ handler's code is executed as a kernel thread. Modify the driver to avoid explicitly scheduling the IRQ kernel thread. Link: https://lore.kernel.org/r/20220912135742.11764-4-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 47cd930ee6aed7d63312ef133d1d46c4be42d6a9 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:35 2022 +0530 scsi: mpi3mr: Support new power management framework Switch to the new generic PCI power management framework. Also, remove unnecessary calls to the PCI helper functions (such as pci_set_power_state(), pci_enable_wake(), pci_save_state(), pci_restore_state() etc). Link: https://lore.kernel.org/r/20220912135742.11764-3-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit ee6f2d6bb2a0a3824b8f1d2cd4ceba8f8a3fb193 Author: Sreekanth Reddy Date: Mon Sep 12 19:27:34 2022 +0530 scsi: mpi3mr: Update mpi3 header files Update the mpi3 header files. Link: https://lore.kernel.org/r/20220912135742.11764-2-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit d82e68483b81768c8d19bc7529635dad741607ce Author: Damien Le Moal Date: Fri Sep 16 22:01:11 2022 +0900 scsi: mpt3sas: Revert "scsi: mpt3sas: Fix ioc->base_readl() use" This reverts commit 7ab4d2441b952977556672c2fe3f4c2a698cbb37 as it is breaking the mpt3sas driver on big-endian machines. Link: https://lore.kernel.org/r/20220916130111.168195-3-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit f920642e406cfa17ebecf03d5b83a02273ec718e Author: Damien Le Moal Date: Fri Sep 16 22:01:10 2022 +0900 scsi: mpt3sas: Revert "scsi: mpt3sas: Fix writel() use" This reverts commit b4efbec4c2a75b619fae4e8768be379e88c78687 as it is breaking the mpt3sas driver on big-endian machines. Link: https://lore.kernel.org/r/20220916130111.168195-2-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit d4a0a0f2c84ad810141e25c3490d4e314fcf4838 Author: Lukas Bulwahn Date: Tue Sep 20 13:29:21 2022 +0200 scsi: wd33c93: Remove dead code related to the long-gone config WD33C93_PIO The historical commit 5e018f7e60c9 ("Remove PC9800 support") from 2004 in linux's history.git removed the config WD33C93_PIO to tweak the scsi wd33c93 driver for the PC9800. Some dead code in drivers/scsi/wd33c93.[ch] under an ifdef WD33C93_PIO continued to remain in the repository until now. Remove this dead code. This issue was discovered with ./scripts/checkkconfigsymbols.py. Link: https://lore.kernel.org/r/20220920112921.25275-1-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Signed-off-by: Martin K. Petersen commit 48517eefb20ec2d6595ebd77ae11f34b3540cd78 Author: Wu Bo Date: Tue Sep 20 17:32:19 2022 +0800 scsi: core: Add I/O timeout count for SCSI device Currently struct scsi_device maintains counters for requests, completions, and errors but is missing a counter for timeouts. For better tracking of timeouts, add a suitable counter. Link: https://lore.kernel.org/r/1663666339-17560-1-git-send-email-wubo40@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Wu Bo Signed-off-by: Martin K. Petersen commit 592642e6b11e620e4b43189f8072752429fc8dc3 Author: Saurav Kashyap Date: Mon Sep 19 06:44:34 2022 -0700 scsi: qedf: Populate sysfs attributes for vport Few vport parameters were displayed by systool as 'Unknown' or 'NULL'. Copy speed, supported_speed, frame_size and update port_type for NPIV port. Link: https://lore.kernel.org/r/20220919134434.3513-1-njavali@marvell.com Cc: stable@vger.kernel.org Tested-by: Guangwu Zhang Reviewed-by: John Meneghini Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit fd2f045202d12c55748090885c47cc5f9a6c3c72 Author: Gustavo A. R. Silva Date: Thu Sep 22 14:30:28 2022 -0500 scsi: pm8001: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct fw_control_info. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/207 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1] Link: https://lore.kernel.org/r/Yyy31OuBza1FJCXP@work Reviewed-by: Kees Cook Acked-by: Jack Wang Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 0fb9125e2aff083f42787cd686188c944d1a11f7 Author: Gustavo A. R. Silva Date: Thu Sep 22 14:08:44 2022 -0500 scsi: 3w-xxxx: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct TAG_TW_New_Ioctl and refactor the rest of the code, accordingly. Notice that, in multiple places, the subtraction of 1 from sizeof(TW_New_Ioctl) is removed, as this operation is now implicit after the flex-array transformation. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/206 Link: https://lore.kernel.org/r/YyyyvB30jnjRaw/F@work Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit d20796627fec15e79727b147707c632b0e2ca162 Author: Gustavo A. R. Silva Date: Thu Sep 22 12:00:46 2022 -0500 scsi: hptiop: Replace one-element array with flexible-array member in struct hpt_iop_request_ioctl_command() One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct hpt_iop_request_ioctl_command. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/205 Link: https://lore.kernel.org/r/YyyUvuId7dAZadej@work Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 5b12a568cc6f69bfd9f7286d6e9c3e47392d240b Author: Gustavo A. R. Silva Date: Thu Sep 22 11:55:33 2022 -0500 scsi: hptiop: Use struct_size() helper in code related to struct hpt_iop_request_scsi_command Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. Link: https://github.com/KSPP/linux/issues/160 Link: https://lore.kernel.org/r/54e2bb1e39b21394c5a90cacbadfb6136b012788.1663865333.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit c682df71996aee74c6a50d0fe491c135a7bea1e7 Author: Gustavo A. R. Silva Date: Thu Sep 22 11:53:23 2022 -0500 scsi: hptiop: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct hpt_iop_request_scsi_command and refactor the rest of the code, accordingly. The following pieces of code suggest that the one element of array sg_list in struct hpt_iop_request_scsi_command is not taken into account when calculating the total size for both struct hpt_iop_request_scsi_command and the maximum number of elements sg_list will contain: 1047 req->header.size = cpu_to_le32( 1048 sizeof(struct hpt_iop_request_scsi_command) 1049 - sizeof(struct hpt_iopsg) 1050 + sg_count * sizeof(struct hpt_iopsg)); 1400 req_size = sizeof(struct hpt_iop_request_scsi_command) 1401 + sizeof(struct hpt_iopsg) * (hba->max_sg_descriptors - 1); So it's safe to replace the one-element array with a flexible-array member and update the code above, accordingly: now we don't need to subtract sizeof(struct hpt_iopsg) from sizeof(struct hpt_iop_request_scsi_command) because this is implicitly done by the flex-array transformation. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/205 Link: https://lore.kernel.org/r/6238ccf37798e36d783f5ce5e483e6837e98be79.1663865333.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit d8c22c4697c11ed28062afe3c2b377025be11a23 Author: John Garry Date: Thu Sep 22 21:51:04 2022 +0800 scsi: pm8001: Fix running_req for internal abort commands Disabling the remote phy for a SATA disk causes a hang: root@(none)$ more /sys/class/sas_phy/phy-0:0:8/target_port_protocols sata root@(none)$ echo 0 > sys/class/sas_phy/phy-0:0:8/enable root@(none)$ [ 67.855950] sas: ex 500e004aaaaaaa1f phy08 change count has changed [ 67.920585] sd 0:0:2:0: [sdc] Synchronizing SCSI cache [ 67.925780] sd 0:0:2:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK [ 67.935094] sd 0:0:2:0: [sdc] Stopping disk [ 67.939305] sd 0:0:2:0: [sdc] Start/Stop Unit failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK ... [ 123.998998] INFO: task kworker/u192:1:642 blocked for more than 30 seconds. [ 124.005960] Not tainted 6.0.0-rc1-205202-gf26f8f761e83 #218 [ 124.012049] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 124.019872] task:kworker/u192:1 state:D stack:0 pid: 642 ppid: 2 flags:0x00000008 [ 124.028223] Workqueue: 0000:04:00.0_event_q sas_port_event_worker [ 124.034319] Call trace: [ 124.036758] __switch_to+0x128/0x278 [ 124.040333] __schedule+0x434/0xa58 [ 124.043820] schedule+0x94/0x138 [ 124.047045] schedule_timeout+0x2fc/0x368 [ 124.051052] wait_for_completion+0xdc/0x200 [ 124.055234] __flush_workqueue+0x1a8/0x708 [ 124.059328] sas_porte_broadcast_rcvd+0xa8/0xc0 [ 124.063858] sas_port_event_worker+0x60/0x98 [ 124.068126] process_one_work+0x3f8/0x660 [ 124.072134] worker_thread+0x70/0x700 [ 124.075793] kthread+0x1a4/0x1b8 [ 124.079014] ret_from_fork+0x10/0x20 The issue is that the per-device running_req read in pm8001_dev_gone_notify() never goes to zero and we never make progress. This is caused by missing accounting for running_req for when an internal abort command completes. In commit 2cbbf489778e ("scsi: pm8001: Use libsas internal abort support") we started to send internal abort commands as a proper sas_task. In this when we deliver a sas_task to HW the per-device running_req is incremented in pm8001_queue_command(). However it is never decremented for internal abort commnds, so decrement in pm8001_mpi_task_abort_resp(). Link: https://lore.kernel.org/r/1663854664-76165-1-git-send-email-john.garry@huawei.com Fixes: 2cbbf489778e ("scsi: pm8001: Use libsas internal abort support") Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 46ba53c30666717cb06c2b3c5d896301cd00d0c0 Author: Duoming Zhou Date: Tue Sep 20 22:42:13 2022 +0800 scsi: libsas: Fix use-after-free bug in smp_execute_task_sg() When executing SMP task failed, the smp_execute_task_sg() calls del_timer() to delete "slow_task->timer". However, if the timer handler sas_task_internal_timedout() is running, the del_timer() in smp_execute_task_sg() will not stop it and a UAF will happen. The process is shown below: (thread 1) | (thread 2) smp_execute_task_sg() | sas_task_internal_timedout() ... | del_timer() | ... | ... sas_free_task(task) | kfree(task->slow_task) //FREE| | task->slow_task->... //USE Fix by calling del_timer_sync() in smp_execute_task_sg(), which makes sure the timer handler have finished before the "task->slow_task" is deallocated. Link: https://lore.kernel.org/r/20220920144213.10536-1-duoming@zju.edu.cn Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Reviewed-by: Jason Yan Signed-off-by: Duoming Zhou Signed-off-by: Martin K. Petersen commit d88a0240ff76062eb0728963e7aacf6dbe87f7c7 Author: Kees Cook Date: Wed Sep 21 13:51:55 2022 -0700 scsi: scsi_transport_fc: Adjust struct fc_nl_event flex array usage In order to help the compiler reason about the destination buffer in struct fc_nl_event, add a flexible array member for this purpose. However, since the header is UAPI, it must not change size or layout, so a union is used. The allocation size calculations are also corrected (it was potentially allocating an extra 8 bytes), and the padding is zeroed to avoid leaking kernel heap memory contents. Detected at run-time by the recently added memcpy() bounds checking: memcpy: detected field-spanning write (size 8) of single field "&event->event_data" at drivers/scsi/scsi_transport_fc.c:581 (size 4) Link: https://lore.kernel.org/linux-next/42404B5E-198B-4FD3-94D6-5E16CF579EF3@linux.ibm.com/ Link: https://lore.kernel.org/r/20220921205155.1451649-1-keescook@chromium.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Reported-by: Sachin Sant Tested-by: Sachin Sant Reviewed-by: James Smart Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 1a2433b0ec45acd71130bd0bf419394c7d7d85c0 Author: Arthur Simchaev Date: Wed Sep 21 14:58:05 2022 +0300 scsi: ufs: core: Remove redundant function definitions from ufshcd.h Remove Query-Request API function declarations from include/ufs/ufshcd.h and move them to the ufs core private header. Link: https://lore.kernel.org/r/1663761485-2532-1-git-send-email-Arthur.Simchaev@wdc.com Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Arthur Simchaev Signed-off-by: Martin K. Petersen commit 3d217b9ac532571335e69e64acf03a307b7acaf3 Author: Lukas Bulwahn Date: Mon Sep 19 08:01:12 2022 +0200 scsi: core: Make SCSI_MOD depend on BLOCK for cleaner .config files SCSI_MOD is a helper config symbol for configuring RAID_ATTRS properly, i.e., RAID_ATTRS needs to be m when SCSI=m. This helper config symbol SCSI_MOD still shows up even in kernel configurations that do not select the block subsystem and where SCSI is not even a configuration option mentioned and selectable. Make this SCSI_MOD depend on BLOCK, so that it only shows up when it is slightly relevant in the kernel configuration. Link: https://lore.kernel.org/r/20220919060112.24802-1-lukas.bulwahn@gmail.com Reviewed-by: Bart Van Assche Signed-off-by: Lukas Bulwahn Signed-off-by: Martin K. Petersen commit 1a77dd1c2bb5d4a58c16d198cf593720787c02e4 Author: Arun Easi Date: Wed Sep 7 16:33:08 2022 -0700 scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled Fix this compilation error seen when CONFIG_TRACING is not enabled: drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_init': drivers/scsi/qla2xxx/qla_os.c:2854:25: error: implicit declaration of function 'trace_array_get_by_name'; did you mean 'trace_array_set_clr_event'? [-Werror=implicit-function-declaration] 2854 | qla_trc_array = trace_array_get_by_name("qla2xxx"); | ^~~~~~~~~~~~~~~~~~~~~~~ | trace_array_set_clr_event drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_uninit': drivers/scsi/qla2xxx/qla_os.c:2869:9: error: implicit declaration of function 'trace_array_put' [-Werror=implicit-function-declaration] 2869 | trace_array_put(qla_trc_array); | ^~~~~~~~~~~~~~~ Link: https://lore.kernel.org/r/20220907233308.4153-2-aeasi@marvell.com Reported-by: kernel test robot Reviewed-by: Steven Rostedt (Google) Signed-off-by: Arun Easi Signed-off-by: Martin K. Petersen commit 631b54519e8e58758e4541756c1818dcebd2dcc9 Author: Mario Limonciello Date: Wed Sep 21 15:40:54 2022 -0500 ACPI: x86: s2idle: Add a quirk for ASUSTeK COMPUTER INC. ROG Flow X13 ASUSTeK COMPUTER INC. ROG Flow X13 has a problem with fans upon wakeup from s2idle. In examining the ASL, functions 3 and 4 are not called in the AMD codepath but only in the Microsoft codepath. Add the system to the quirk list to force Microsoft codepath. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2148 Tested-by: short-circuit Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 888ca9c7955e3969df84f5a1bda2143be9fa365a Author: Mario Limonciello Date: Wed Sep 21 15:40:53 2022 -0500 ACPI: x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7 Lenovo Slim 7 Pro 14ARH7 has a sporadically non-functional keyboard when resuming from s2idle. This is caused by some missing calls to the EC that don't occur in the AMD codepath but only in the Microsoft codepath. Add the system to the quirk list to force Microsoft codepath. Reported-by: Travis Glenn Hansen Reported-by: Sebastian S. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216473 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216438 Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit ddeea2c3cb881adee0f979bfd61a90fb057ef3e6 Author: Mario Limonciello Date: Wed Sep 21 15:40:52 2022 -0500 ACPI: x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14 ASUS ROG Zephyrus G14 is affected by the same BIOS bug as ASUS TUF Gaming A17 where important ASL is not called in the AMD code path. Use the Microsoft codepath instead. Reported-and-suggested-by: Philipp Zabel Tested-by: Philipp Zabel Tested-by: Matthew Anderson Tested-by: Marko Cekrlic Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit d0f61e89f08dd46a090da50f5d747204673f70ea Author: Mario Limonciello Date: Wed Sep 21 15:40:51 2022 -0500 ACPI: x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE ASUS TUF Gaming A17 FA707RE has problems with ACPI events after s2idle resume. It's from a missing call to an ASL method in AMD the s2idle calling path. Force the system to use the Microsoft Modern Standby calling path instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216101 Reported-and-tested-by: catalin@antebit.com Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit a0bc002393d42ab7d895b0e82e730ce7622bdbff Author: Mario Limonciello Date: Wed Sep 21 15:40:50 2022 -0500 ACPI: x86: s2idle: Add module parameter to prefer Microsoft GUID OEMs have made some mistakes in the past for the AMD GUID support and not populated the method properly. To add an escape hatch for this problem introduce a module parameter that can force using the Microsoft GUID. This is intentionally introduced to both Intel and AMD codepaths to allow using the parameter as a debugging tactic on either. Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit fd894f05cf30956296384b0c4a81892ed21ac1d9 Author: Mario Limonciello Date: Wed Sep 21 15:40:49 2022 -0500 ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt A mistake was made that only AMDI0007 was set to rev of "2", but it should have been also set for AMDI008. If an ID is missing from the _HID table, then assume it matches Rembrandt behavior. This implicitly means that if any other behavior changes happen in the future missing IDs must be added to that table. Tested-by: catalin@antebit.com Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 100a5737938049706987d06a4ab73e82b8277085 Author: Mario Limonciello Date: Wed Sep 21 15:40:48 2022 -0500 ACPI: x86: s2idle: Move _HID handling for AMD systems into structures Right now the information about which cases to use for what are in a comment, but this is error prone. Instead move all information into a dedicated structure. Tested-by: catalin@antebit.com Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 5db8a0d31cab2798f693a360628dcafaee1ecce9 Author: Jason Wang Date: Sun Sep 25 00:19:11 2022 -0700 Input: joydev - fix comment typo The double `from' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220804120800.60415-1-wangborong@cdjrlc.com Signed-off-by: Dmitry Torokhov commit 379a33786d489ab81885ff0b3935cfeb36137fea Author: Pali Rohár Date: Sat Sep 24 12:43:24 2022 +0200 serial: 8250: Fix restoring termios speed after suspend Since commit edc6afc54968 ("tty: switch to ktermios and new framework") termios speed is no longer stored only in c_cflag member but also in new additional c_ispeed and c_ospeed members. If BOTHER flag is set in c_cflag then termios speed is stored only in these new members. Since commit 027b57170bf8 ("serial: core: Fix initializing and restoring termios speed") termios speed is available also in struct console. So properly restore also c_ispeed and c_ospeed members after suspend to fix restoring termios speed which is not represented by Bnnn constant. Fixes: 4516d50aabed ("serial: 8250: Use canary to restart console after suspend") Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220924104324.4035-1-pali@kernel.org Signed-off-by: Greg Kroah-Hartman commit 7c7f9bc986e698873b489c371a08f206979d06b7 Author: Lukas Wunner Date: Thu Sep 22 18:27:33 2022 +0200 serial: Deassert Transmit Enable on probe in driver-specific way When a UART port is newly registered, uart_configure_port() seeks to deassert RS485 Transmit Enable by setting the RTS bit in port->mctrl. However a number of UART drivers interpret a set RTS bit as *assertion* instead of deassertion: Affected drivers include those using serial8250_em485_config() (except 8250_bcm2835aux.c) and some using mctrl_gpio (e.g. imx.c). Since the interpretation of the RTS bit is driver-specific, it is not suitable as a means to centrally deassert Transmit Enable in the serial core. Instead, the serial core must call on drivers to deassert it in their driver-specific way. One way to achieve that is to call ->rs485_config(). It implicitly deasserts Transmit Enable. So amend uart_configure_port() and uart_resume_port() to invoke uart_rs485_config(). That allows removing calls to uart_rs485_config() from drivers' ->probe() hooks and declaring the function static. Skip any invocation of ->set_mctrl() if RS485 is enabled. RS485 has no hardware flow control, so the modem control lines are irrelevant and need not be touched. When leaving RS485 mode, reset the modem control lines to the state stored in port->mctrl. That way, UARTs which are muxed between RS485 and RS232 transceivers drive the lines correctly when switched to RS232. (serial8250_do_startup() historically raises the OUT1 modem signal because otherwise interrupts are not signaled on ancient PC UARTs, but I believe that no longer applies to modern, RS485-capable UARTs and is thus safe to be skipped.) imx.c modifies port->mctrl whenever Transmit Enable is asserted and deasserted. Stop it from doing that so port->mctrl reflects the RS232 line state. 8250_omap.c deasserts Transmit Enable on ->runtime_resume() by calling ->set_mctrl(). Because that is now a no-op in RS485 mode, amend the function to call serial8250_em485_stop_tx(). fsl_lpuart.c retrieves and applies the RS485 device tree properties after registering the UART port. Because applying now happens on registration in uart_configure_port(), move retrieval of the properties ahead of uart_add_one_port(). Link: https://lore.kernel.org/all/20220329085050.311408-1-matthias.schiffer@ew.tq-group.com/ Link: https://lore.kernel.org/all/8f538a8903795f22f9acc94a9a31b03c9c4ccacb.camel@ginzinger.com/ Fixes: d3b3404df318 ("serial: Fix incorrect rs485 polarity on uart open") Cc: stable@vger.kernel.org # v4.14+ Reported-by: Matthias Schiffer Reported-by: Roosen Henri Tested-by: Matthias Schiffer Reviewed-by: Ilpo Järvinen Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/2de36eba3fbe11278d5002e4e501afe0ceaca039.1663863805.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit e02fbb0bcb9b6d5f83f01af87bc643dd0d78319b Author: Andy Shevchenko Date: Fri Sep 9 12:11:02 2022 +0300 serial: 8250_dma: Convert to use uart_xmit_advance() uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220909091102.58941-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 77b2d26805c9b438b5f74cf73849979d28cefeb3 Author: Andy Shevchenko Date: Fri Sep 9 12:12:58 2022 +0300 serial: 8250_omap: Convert to use uart_xmit_advance() uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220909091258.68886-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a12c689209185c1ad872723a644d0cd27e52d49c Merge: 4c8928850c9dc 7e2cd21e02b35 Author: Greg Kroah-Hartman Date: Sun Sep 25 09:22:13 2022 +0200 Merge 7e2cd21e02b3 ("Merge tag 'tty-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next We need the tty fixes and api additions in this branch. Signed-off-by: Greg Kroah-Hartman commit 4314a0b79fe18f8c734c6bdb7e994313de730d7f Merge: 3e081438b8e63 6d965885f4ea8 Author: Greg Kroah-Hartman Date: Sun Sep 25 09:09:07 2022 +0200 Merge tag 'iio-for-6.1b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: Second set of IIO new device support, features and cleanup for the 6.1 cycle. Normal mixed bag of new device support with continuing trend that most new devices are supported by extending existing drivers - a positive sign perhaps that device manufacturers have somewhat stabilized their interfaces across product generations. The BNO055 driver was however a substantial addition including several additions to the IIO core. There are a number of significant patch sets under review, so if the 6.0 cycle runs long I may send a 3rd pull request. New device support * adi,adxl313 - Support for the ADXL312 and ADXL314 accelerometers. * bosch,bmp280 - Support for the BMP380 family of pressures sensors. Included considerable refactoring and modernization of the bmp280 driver. * bosch,bno055 - New driver for this i2c/serial attached complex IMU. * lltc,ltc2497 - Support for the LTC2499 16 channel, 24bit ADC. * st,pressure - Support for the LPS22DF pressure sensor * st,lsm6dsx - Support for the LSM6DSTX (Mainly adding the ID and WAI) Features * core - to support the bosch,bno055 requirements - Support for linear acceleration channel type (effect of gravity removed) - Pitch, yaw and roll modifiers for angle channels. - Standard serialnumber attribute documentation. - Binary attributes - to allow for calibration save and restore. * adi,ad7923 - Support extended range (wider supported input voltage range). * bosch,bmp280 - Add filter controls for some supported parts. * microchip,mcp3911 - Buffered capture support for this ADC. - Data ready interrupt support, including hiz control for line. - Oversampling ratio support. * st,stm32-adc - Support ID registers on parts where they are present, providing discoverability of some features. Fixes - late breaking fixes that I judged could wait for the merge window. * adi,ad5593r - Add a missing STOP condition between address write and data read. - Check for related i2c functionality. * adi,ad7923 - Fix shift reporting for some variants supported by the driver. * infinion,dps310 - Work around a hardware issue where a chip can hang by adding a timeout and reset path. Cleanups * Continuing work to switch to new pm macros. * MAINTAINERS - Drop duplication of wild card covered entry in ADI block and add missing entries to cover ltc294x binding files. * bosch,bma400 - Fix trivial smatch warning. * bosch,bmp280 - Fix broken links to datasheets * lltc,ltc2497 - Fix missing entry for ltc2499 * mexelis,mlx90614 - Switch to get_avail() callback for _available attributes. * microchip,mcp3911 - Move to devm_ resource management for all elements of probe() * tag 'iio-for-6.1b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (57 commits) iio: adc: mcp3911: add support for oversampling ratio dt-bindings: iio: adc: mcp3911: add microchip,data-ready-hiz entry iio: adc: mcp3911: add support for interrupts iio: adc: mcp3911: add support for buffers iio: adc: mcp3911: use resource-managed version of iio_device_register iio: accel: bma400: Fix smatch warning based on use of unintialized value. iio: light: st_uvis25: Use EXPORT_NS_SIMPLE_DEV_PM_OPS() iio: accel: bmi088: Use EXPORT_NS_GPL_RUNTIME_DEV_PM_OPS() and pm_ptr() iio: proximity: srf04: Use pm_ptr() to remove unused struct dev_pm_ops iio: proximity: sx9360: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: proximity: sx9324: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: proximity: sx9310: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() docs: iio: add documentation for BNO055 driver iio: imu: add BNO055 I2C driver iio: imu: add BNO055 serdev driver dt-bindings: iio/imu: Add Bosch BNO055 iio: document "serialnumber" sysfs attribute iio: document bno055 private sysfs attributes iio: imu: add Bosch Sensortec BNO055 core driver iio: add support for binary attributes ... commit 4160f9680d7f8bb0f4e4e114869146a694347b89 Author: Luca Weiss Date: Sat Sep 17 17:57:00 2022 +0200 dt-bindings: input: qcom,pm8xxx-vib: convert to yaml Convert the PM8xxx PMIC Vibrator bindings to dt-schema. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220917155705.2284-1-luca@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 6dc0a438f91d5ece823261204248670995504139 Author: Peter Ujfalusi Date: Sat Sep 24 22:35:30 2022 -0700 Input: twl4030-vibra - drop legacy, non DT boot support Legacy or non DT boot is no longer possible on systems where the tw4030/5030 is used. Drop the support for handling legacy pdata. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220616153323.29464-1-peter.ujfalusi@gmail.com Signed-off-by: Dmitry Torokhov commit 4c081324df5608b73428662ca54d5221ea03a6bd Author: Zhang Rui Date: Sat Sep 24 13:47:36 2022 +0800 powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR dram_domain_energy_unit quirk. Fixes: 2d798d9f5967 ("powercap: intel_rapl: add support for Sapphire Rapids") Signed-off-by: Zhang Rui Tested-by: Wang Wendy Cc: 5.9+ # 5.9+ Signed-off-by: Rafael J. Wysocki commit e66332a4bc89e3219baaabc7bb549d17a2c42ce9 Author: Rafael J. Wysocki Date: Thu Sep 22 20:04:40 2022 +0200 PM: runtime: Return -EINPROGRESS from rpm_resume() in the RPM_NOWAIT case The prospective callers of rpm_resume() passing RPM_NOWAIT to it may be confused when it returns 0 without actually resuming the device which may happen if the device is suspending at the given time and it will only resume when the suspend in progress has completed. To avoid that confusion, return -EINPROGRESS from rpm_resume() in that case. Since none of the current callers passing RPM_NOWAIT to rpm_resume() check its return value, this change has no functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Reviewed-by: Douglas Anderson Reviewed-by: Ulf Hansson commit 53e41b85939547cda40a7b9748c5a1f9b1f1a865 Author: Shang XiaoJing Date: Thu Sep 22 20:31:41 2022 +0800 thermal: int340x: processor_thermal: Use module_pci_driver() macro Since PCI provides helper macro module_pci_driver(), the module_init/exit code can be replaced with it. Signed-off-by: Shang XiaoJing [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 2a5a191c67ba4513f0a6ea459218129c23734ce2 Author: Daniel Scally Date: Thu Sep 22 00:04:39 2022 +0100 platform/x86: int3472: Add board data for Surface Go2 IR camera Add the board data describing the regulators for the Microsoft Surface Go line's IR camera. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit 06a659d1f0a0ae3d104155655397e593296a65fa Author: Daniel Scally Date: Thu Sep 22 00:04:38 2022 +0100 platform/x86: int3472: Support multiple gpio lookups in board data Currently, we only support passing a single gpiod_lookup_table as part of the board data for the tps68470 driver. This carries the implicit assumption that each TPS68470 device will only support a single sensor, which does not hold true. Extend the code to support the possibility of multiple sensors each having a gpiod_lookup_table, and opportunistically add the lookup table for the Surface Go line's IR camera. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit 43cf36974d760a3d1c705a83de89ac58059e5f0b Author: Daniel Scally Date: Thu Sep 22 00:04:37 2022 +0100 platform/x86: int3472: Support multiple clock consumers At present, the tps68470.c only supports a single clock consumer when passing platform data to the clock driver. In some devices multiple sensors depend on the clock provided by a single TPS68470 and so all need to be able to acquire the clock. Support passing multiple consumers as platform data. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Reviewed-by: Stephen Boyd Acked-by: Stephen Boyd Signed-off-by: Rafael J. Wysocki commit 62c8bc0d27a784b09114d67c33e8fa83f350fa77 Author: Daniel Scally Date: Thu Sep 22 00:04:36 2022 +0100 ACPI: bus: Add iterator for dependent devices Add a helper macro to iterate over ACPI devices that are flagged as consumers of an initial supplier ACPI device. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit cca8a7efea6402f463239a1bb337d01b0cad7b2e Author: Daniel Scally Date: Thu Sep 22 00:04:35 2022 +0100 ACPI: scan: Add acpi_dev_get_next_consumer_dev() In commit b83e2b306736 ("ACPI: scan: Add function to fetch dependent of ACPI device") we added a means of fetching the first device to declare itself dependent on another ACPI device in the _DEP method. One assumption in that patch was that there would only be a single consuming device, but this has not held. Replace that function with a new function that fetches the next consumer of a supplier device. Where no "previous" consumer is passed in, it behaves identically to the original function. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Signed-off-by: Rafael J. Wysocki commit 6e5cbe7c4b41824e500acbb42411da692d1435f1 Author: Kellen Renshaw Date: Wed Sep 21 10:24:22 2022 -0700 ACPI: resource: Add ASUS model S5402ZA to quirks The Asus Vivobook S5402ZA has the same keyboard issue as Asus Vivobook K3402ZA/K3502ZA. The kernel overrides IRQ 1 to Edge_High when it should be Active_Low. This patch adds the S5402ZA model to the quirk list. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216158 Tested-by: Kellen Renshaw Signed-off-by: Kellen Renshaw Signed-off-by: Rafael J. Wysocki commit 53e7380c9338af588ddbadb4ac9d878351770de4 Author: Vijayenthiran Subramaniam Date: Wed Sep 21 20:02:44 2022 +0530 ACPI: AMBA: Add ARM DMA-330 controller to the supported list Add ACPI ID for ARM DMA-330 controller to AMBA id supported list to allow the probing of the device. Signed-off-by: Vijayenthiran Subramaniam Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 382c5fec89f3b0ce870a17f028c547a9f95b7834 Author: ye xingchen Date: Wed Sep 21 09:28:34 2022 +0000 ACPI: APEI: Remove unneeded result variables Return the erst_get_record_id_begin() and apei_exec_write_register() return values directly instead of storing them in redundant local variables. Reported-by: Zeal Robot Signed-off-by: ye xingchen [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit f23470e659964c41697e9c3e950fe80ecae143de Author: Uwe Kleine-König Date: Sat Sep 17 23:56:22 2022 +0200 ACPI: fan: Reorder symbols to get rid of a few forward declarations Having the driver struct at the end of the file isn't only more usual, it also allows to drop a few forward declarations which are just useless repetition. While at it also move the MODULE_... macros to the end of the file. Signed-off-by: Uwe Kleine-König Signed-off-by: Rafael J. Wysocki commit ae2df912d1a557a3548be83da20851ac55f42ab3 Author: Jeremy Linton Date: Mon Sep 12 15:37:22 2022 -0500 ACPI: CPPC: Disable FIE if registers in PCC regions PCC regions utilize a mailbox to set/retrieve register values used by the CPPC code. This is fine as long as the operations are infrequent. With the FIE code enabled though the overhead can range from 2-11% of system CPU overhead (ex: as measured by top) on Arm based machines. So, before enabling FIE assure none of the registers used by cppc_get_perf_ctrs() are in the PCC region. Finally, add a module parameter which can override the PCC region detection at boot or module reload. Signed-off-by: Jeremy Linton Acked-by: Viresh Kumar Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit c78c43fe7d42524c8f364aaf95ef3652e7f1186b Author: Jianmin Lv Date: Sun Sep 11 17:06:35 2022 +0800 LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA Use _DMA defined in ACPI spec for translation between DMA address and CPU address, and implement acpi_arch_dma_setup for initializing dev->dma_range_map, where acpi_dma_get_range is called for parsing _DMA. e.g. If we have two dma ranges: cpu address dma address size offset 0x200080000000 0x2080000000 0x400000000 0x1fe000000000 0x400080000000 0x4080000000 0x400000000 0x3fc000000000 _DMA for pci devices should be declared in host bridge as flowing: Name (_DMA, ResourceTemplate() { QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, 0x0, 0x4080000000, 0x447fffffff, 0x3fc000000000, 0x400000000, , , ) QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, 0x0, 0x2080000000, 0x247fffffff, 0x1fe000000000, 0x400000000, , , ) }) Acked-by: Huacai Chen Signed-off-by: Jianmin Lv Signed-off-by: Rafael J. Wysocki commit bf2ee8d0c385f883a00473768b67faf2189b2410 Author: Jianmin Lv Date: Sun Sep 11 17:06:34 2022 +0800 ACPI: scan: Support multiple DMA windows with different offsets In DT systems configurations, of_dma_get_range() returns struct bus_dma_region DMA regions; they are used to set-up devices DMA windows with different offset available for translation between DMA address and CPU address. In ACPI systems configuration, acpi_dma_get_range() does not return DMA regions yet and that precludes setting up the dev->dma_range_map pointer and therefore DMA regions with multiple offsets. Update acpi_dma_get_range() to return struct bus_dma_region DMA regions like of_dma_get_range() does. After updating acpi_dma_get_range(), acpi_arch_dma_setup() is changed for ARM64, where the original dma_addr and size are removed as these arguments are now redundant, and pass 0 and U64_MAX for dma_base and size of arch_setup_dma_ops; this is a simplification consistent with what other ACPI architectures also pass to iommu_setup_dma_ops(). Reviewed-by: Robin Murphy Signed-off-by: Jianmin Lv Reviewed-by: Lorenzo Pieralisi Signed-off-by: Rafael J. Wysocki commit f336443acc890434c7d621366d1bc5bc8f298840 Author: Hanjun Guo Date: Sat Sep 17 17:45:09 2022 +0800 ACPI: AC: Remove the leftover struct acpi_ac_bl In commit 57a183222271 ("ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper"), the usage of struct acpi_ac_bl was removed, but left the definition of the struct in the file, so remove the useless code. Signed-off-by: Hanjun Guo Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 018d6711c26e4bd26e20a819fcc7f8ab902608f3 Author: Mario Limonciello Date: Thu Sep 15 13:23:14 2022 -0500 ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable Dell Inspiron 14 2-in-1 has two ACPI nodes under GPP1 both with _ADR of 0, both without _HID. It's ambiguous which the kernel should take, but it seems to take "DEV0". Unfortunately "DEV0" is missing the device property `StorageD3Enable` which is present on "NVME". To avoid this causing problems for suspend, add a quirk for this system to behave like `StorageD3Enable` property was found. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440 Reported-and-tested-by: Luya Tshimbalanga Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 564d53b8b5909ce7a23106873aaf4c4496c3df10 Author: Gaosheng Cui Date: Wed Sep 14 09:33:17 2022 +0800 PNPBIOS: remove unused pnpid32_to_pnpid() declaration All uses of pnpid32_to_pnpid() were removed by commit 25eb846189d2 ("PNP: add pnp_eisa_id_to_string()"), so remove the declaration, too. Signed-off-by: Gaosheng Cui Reviewed-by: Bjorn Helgaas Signed-off-by: Rafael J. Wysocki commit f168420c62e7a106961f2489a89f6ade84fe3f27 Author: Liu Song Date: Wed Sep 21 11:32:03 2022 +0800 blk-mq: don't redirect completion for hctx withs only one ctx mapping High-performance NVMe devices usually support a large hw queues, which ensures a 1:1 mapping of hctx and ctx. In this case there will be no remote request, so we don't need to care about it. Signed-off-by: Liu Song Link: https://lore.kernel.org/r/1663731123-81536-1-git-send-email-liusong@linux.alibaba.com Signed-off-by: Jens Axboe commit 81c7a63abc7c0be572b4f853e913ce93a34f6e1b Author: Yu Kuai Date: Wed Sep 21 17:53:09 2022 +0800 blk-throttle: improve bypassing bios checkings "tg->has_rules" is extended to "tg->has_rules_iops/bps", thus bios that don't need to be throttled can be checked accurately. With this patch, bio will be throttled if: 1) Bio is read/write, and corresponding read/write iops limit exist. 2) If corresponding doesn't exist, corresponding bps limit exist and bio is not throttled before. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921095309.1481289-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 85496749904016f36b69332f73a1cf3ecfee828f Author: Yu Kuai Date: Wed Sep 21 17:53:08 2022 +0800 blk-throttle: remove THROTL_TG_HAS_IOPS_LIMIT Currently, "tg->has_rules" and "tg->flags & THROTL_TG_HAS_IOPS_LIMIT" both try to bypass bios that don't need to be throttled, however, they are a little redundant and both not perfect: 1) "tg->has_rules" only distinguish read and write, but not iops and bps limit. 2) "tg->flags & THROTL_TG_HAS_IOPS_LIMIT" only check if iops limit exist, read and write is not distinguished, and bps limit is not checked. tg->has_rules will extended to distinguish bps and iops in the following patch. There is no need to keep the flag. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921095309.1481289-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 50f9926da3ce6c82f2a4ab1e8b18f032349837a4 Author: Souptick Joarder (HPE) Date: Mon Jul 25 06:59:55 2022 +0530 pcmcia: Removed unused variable control. Kernel test robot throws below warning -> drivers/pcmcia/omap_cf.c:127:7: warning: variable 'control' set but not used [-Wunused-but-set-variable] Removed unused variable control. Reported-by: kernel test robot Signed-off-by: Souptick Joarder (HPE) [linux@dominikbrodowski.net: retain omap_readw() call, as it might be required] Signed-off-by: Dominik Brodowski commit d673cb6fe6c03b2be157cc6c5db40481828d282d Author: Christian Marangi Date: Thu Sep 22 10:35:14 2022 +0300 wifi: ath11k: fix peer addition/deletion error on sta band migration This patch try to fix the following error. Wed Jun 1 22:19:30 2022 kern.warn kernel: [ 119.561227] ath11k c000000.wifi: peer already added vdev id 0 req, vdev id 1 present Wed Jun 1 22:19:30 2022 kern.warn kernel: [ 119.561282] ath11k c000000.wifi: Failed to add peer: 28:c2:1f:xx:xx:xx for VDEV: 0 Wed Jun 1 22:19:30 2022 kern.warn kernel: [ 119.568053] ath11k c000000.wifi: Failed to add station: 28:c2:1f:xx:xx:xx for VDEV: 0 Wed Jun 1 22:19:31 2022 daemon.notice hostapd: wlan2: STA 28:c2:1f:xx:xx:xx IEEE 802.11: Could not add STA to kernel driver Wed Jun 1 22:19:31 2022 daemon.notice hostapd: wlan2: STA 28:c2:1f:xx:xx:xx IEEE 802.11: did not acknowledge authentication response Wed Jun 1 22:19:31 2022 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED 28:c2:1f:xx:xx:xx Wed Jun 1 22:19:31 2022 daemon.info hostapd: wlan1: STA 28:c2:1f:xx:xx:xx IEEE 802.11: disassociated due to inactivity Wed Jun 1 22:19:32 2022 daemon.info hostapd: wlan1: STA 28:c2:1f:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE) To repro this: - Have 2 Wifi with the same bssid and pass on different band (2.4 and 5GHz) - Enable 802.11r Fast Transaction with same mobility domain - FT Protocol: FT over the Air From a openwrt system issue the command (with the correct mac) ubus call hostapd.wlan1 wnm_disassoc_imminent '{"addr":"28:C2:1F:xx:xx:xx"}' Notice the log printing the errors. The cause of this error has been investigated and we found that this is related to the WiFi Fast Transaction feature. We observed that this is triggered when the router tells the device to change band. In this case the device first auth to the other band and then the disconnect path from the prev band is triggered. This is problematic with the current rhash implementation since the addrs is used as key and the logic of "adding first, delete later" conflicts with the rhash logic. In fact peer addition will fail since the peer is already added and with that fixed a peer deletion will cause unitended effect by removing the peer just added. Current solution to this is to add additional logic to the peer delete, make sure we are deleting the correct peer taken from the rhash table (and fallback to the peer list) and for the peer add logic delete the peer entry for the rhash list before adding the new one (counting as an error only when a peer with the same vlan_id is asked to be added). With this change, a sta can correctly transition from 2.4GHz and 5GHZ with no drop and no error are printed. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Fixes: 7b0c70d92a43 ("ath11k: Add peer rhash table support") Signed-off-by: Christian 'Ansuel' Marangi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220603164559.27769-1-ansuelsmth@gmail.com commit aade55c86033bee868a93e4bf3843c9c99e84526 Author: Andy Shevchenko Date: Thu Sep 22 16:54:10 2022 +0300 device property: Add const qualifier to device_get_match_data() parameter Add const qualifier to the device_get_match_data() parameter. Some of the future users may utilize this function without forcing the type. All the same, dev_fwnode() may be used with a const qualifier. Reported-by: kernel test robot Acked-by: Heikki Krogerus Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220922135410.49694-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 16deeb8e18cafd30e70d8dc2b12a753b28298d8a Author: Jim Cromie Date: Sun Sep 11 23:28:52 2022 -0600 drm_print: add _ddebug descriptor to drm_*dbg prototypes upgrade the callchain to drm_dbg() and drm_dev_dbg(); add a struct _ddebug ptr parameter to them, and supply that additional param by replacing the '_no_desc' flavor of dyndbg Factory macro currently used with the flavor that supplies the descriptor. NOTES: The descriptor gives these fns access to the decorator flags, but they do none of the dynamic-prefixing done by dynamic_emit_prefix(), which is currently static. DRM already has conventions for logging/messaging; just tossing optional decorations on top probably wouldn't help. Instead, existing flags (or new ones, perhaps 'sd' ala lspci) can be used to make current message conventions optional. This suggests a new drmdbg_prefix_emit() to handle prefixing locally. For CONFIG_DRM_USE_DYNAMIC_DEBUG=N, just pass null descriptor. desc->class_id is redundant with category parameter, but its availability is dependent on desc. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-10-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit ccc2b496324c13e917ef05f563626f4e7826bef1 Author: Jim Cromie Date: Sun Sep 11 23:28:51 2022 -0600 drm_print: prefer bare printk KERN_DEBUG on generic fn drm_print.c calls pr_debug() just once, from __drm_printfn_debug(), which is a generic/service fn. The callsite is compile-time enabled by DEBUG in both DYNAMIC_DEBUG=y/n builds. For dyndbg builds, reverting this callsite back to bare printk is correcting a few anti-features: 1- callsite is generic, serves multiple drm users. it is soft-wired on currently by #define DEBUG could accidentally: #> echo -p > /proc/dynamic_debug/control 2- optional "decorations" by dyndbg are unhelpful/misleading here, they describe only the generic site, not end users IOW, 1,2 are unhelpful at best, and possibly confusing. reverting yields a nominal data and text shrink: text data bss dec hex filename 462583 36604 54592 553779 87333 /kernel/drivers/gpu/drm/drm.ko 462515 36532 54592 553639 872a7 -dirty/kernel/drivers/gpu/drm/drm.ko Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-9-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6ce6fae8453687e39e564dc15b6142fe79d76ad5 Author: Jim Cromie Date: Sun Sep 11 23:28:50 2022 -0600 drm_print: optimize drm_debug_enabled for jump-label When CONFIG_DRM_USE_DYNAMIC_DEBUG=y, the drm.debug API (a macro stack, calling _+drm_*dbg() eventually) invokes a dyndbg Factory macro to create a descriptor for each callsite, thus making them individually >control-able. In this case, the calls to _drm_*dbg are unreachable unless the callsite is enabled. So those calls can short-circuit their early do-nothing returns. Provide and use __drm_debug_enabled(), to do this when config'd, or the _raw flags-check otherwize. And since dyndbg is in use, lets also instrument the remaining users of drm_debug_enabled, by wrapping the _raw in a macro with a: pr_debug("todo: is this frequent enough to optimize ?\n"); For CONFIG_DRM_USE_DYNAMIC_DEBUG=n, do no site instrumenting at all, since JUMP_LABEL might be off, and we don't want to make work. With drm, amdgpu, i915, nouveau loaded, heres remaining uses of drm_debug_enabled(), which costs ~1.5kb data to control the pr_debug("todo:..")s. Some of those uses might be ok to use __drm_debug_enabled() by inspection, others might warrant conversion to use dyndbg Factory macros, and that would want callrate data to estimate the savings possible. TBH, any remaining savings are probably small; drm.debug covers the vast bulk of the uses. Maybe "vblank" is the exception. :#> grep todo /proc/dynamic_debug/control | wc 21 168 2357 :#> grep todo /proc/dynamic_debug/control drivers/gpu/drm/drm_edid_load.c:178 [drm]edid_load =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/drm_vblank.c:410 [drm]drm_crtc_accurate_vblank_count =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/drm_vblank.c:787 [drm]drm_crtc_vblank_helper_get_vblank_timestamp_internal =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/drm_vblank.c:1491 [drm]drm_vblank_restore =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/drm_vblank.c:1433 [drm]drm_vblank_enable =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/drm_plane.c:2168 [drm]drm_mode_setplane =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/display/drm_dp_mst_topology.c:1359 [drm_display_helper]drm_dp_mst_wait_tx_reply =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/display/drm_dp_mst_topology.c:2864 [drm_display_helper]process_single_tx_qlock =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/display/drm_dp_mst_topology.c:2909 [drm_display_helper]drm_dp_queue_down_tx =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/display/drm_dp_mst_topology.c:1686 [drm_display_helper]drm_dp_mst_update_slots =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_dp.c:1111 [i915]intel_dp_print_rates =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_backlight.c:5434 [i915]cnp_enable_backlight =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_backlight.c:5459 [i915]intel_backlight_device_register =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_opregion.c:43 [i915]intel_opregion_notify_encoder =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_opregion.c:53 [i915]asle_set_backlight =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_bios.c:1088 [i915]intel_bios_is_dsi_present =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/display/intel_display_debugfs.c:6153 [i915]i915_drrs_ctl_set =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/intel_pcode.c:26 [i915]snb_pcode_read =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/i915/i915_getparam.c:785 [i915]i915_getparam_ioctl =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:282 [amdgpu]vcn_v2_5_process_interrupt =_ "todo: maybe avoid via dyndbg\n" drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:433 [amdgpu]vcn_v2_0_process_interrupt =_ "todo: maybe avoid via dyndbg\n" :#> Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-8-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 95a77b6331c2d2313aa843fa77ec91cd092ab0e4 Author: Jim Cromie Date: Sun Sep 11 23:28:49 2022 -0600 drm-print: add drm_dbg_driver to improve namespace symmetry drm_print defines all of these: drm_dbg_{core,kms,prime,atomic,vbl,lease,_dp,_drmres} but not drm_dbg_driver itself, since it was the original drm_dbg. To improve namespace symmetry, change the drm_dbg defn to drm_dbg_driver, and redef grandfathered name to symmetric one. This will help with nouveau, which uses its own stack of macros to construct calls to dev_info, dev_dbg, etc, for which adaptation means drm_dbg_##driver constructs. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-7-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit ee7d633f2dfb12bac90898edf2ceb5f43a4957eb Author: Jim Cromie Date: Sun Sep 11 23:28:48 2022 -0600 drm-print.h: include dyndbg header lkp robot told me: >> drivers/gpu/drm/drm_ioc32.c:989:2: error: call to undeclared function '_dynamic_func_call_cls'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] DRM_DEBUG("comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, %s\n", Since that macro is defined in drm_print.h, and under DRM_USE_DYN*=y configs, invokes dyndbg-factory macros, include dynamic_debug.h from there too, so that those configs have the definitions of all the macros in the callchain. This is done as a separate patch mostly to see how lkp sorts it. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-6-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 84ec67288c10fbf136aa050d00b0fe7a89655da0 Author: Jim Cromie Date: Sun Sep 11 23:28:47 2022 -0600 drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro For CONFIG_DRM_USE_DYNAMIC_DEBUG=y, wrap __drm_dbg() & __drm_dev_dbg() in one of dyndbg's Factory macros: _dynamic_func_call_no_desc(). This adds the callsite descriptor into the code, and an entry for each into /proc/dynamic_debug/control. #> echo class DRM_UT_ATOMIC +p > /proc/dynamic_debug/control CONFIG_DRM_USE_DYNAMIC_DEBUG=y/n is configurable because of the .data footprint cost of per-callsite control; 56 bytes/site * ~2k for i915, ~4k callsites for amdgpu. This is large enough that a kernel builder might not want it. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-5-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit e820f52577b14c63f7a15f534e17088d3c6afa6c Author: Jim Cromie Date: Sun Sep 11 23:28:46 2022 -0600 drm_print: interpose drm_*dbg with forwarding macros change drm_dev_dbg & drm_dbg to macros, which forward to the renamed functions (with __ prefix added). Those functions sit below the categorized layer of macros implementing the DRM debug.category API, and implement most of it. These are good places to insert dynamic-debug jump-label mechanics, which will allow DRM to avoid the runtime cost of drm_debug_enabled(). no functional changes. memory cost baseline: (unchanged) bash-5.1# drms_load [ 9.220389] dyndbg: 1 debug prints in module drm [ 9.224426] ACPI: bus type drm_connector registered [ 9.302192] dyndbg: 2 debug prints in module ttm [ 9.305033] dyndbg: 8 debug prints in module video [ 9.627563] dyndbg: 127 debug prints in module i915 [ 9.721505] AMD-Vi: AMD IOMMUv2 functionality not available on this system - This is not a bug. [ 10.091345] dyndbg: 2196 debug prints in module amdgpu [ 10.106589] [drm] amdgpu kernel modesetting enabled. [ 10.107270] amdgpu: CRAT table not found [ 10.107926] amdgpu: Virtual CRAT table created for CPU [ 10.108398] amdgpu: Topology: Add CPU node [ 10.168507] dyndbg: 3 debug prints in module wmi [ 10.329587] dyndbg: 3 debug prints in module nouveau Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-4-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit f158936b60a7874f29cf8de8d83191ad69119c11 Author: Jim Cromie Date: Sun Sep 11 23:28:45 2022 -0600 drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers. Use DECLARE_DYNDBG_CLASSMAP across DRM: - in .c files, since macro defines/initializes a record - in drivers, $mod_{drv,drm,param}.c ie where param setup is done, since a classmap is param related - in drm/drm_print.c since existing __drm_debug param is defined there, and we ifdef it, and provide an elaborated alternative. - in drm_*_helper modules: dp/drm_dp - 1st item in makefile target drivers/gpu/drm/drm_crtc_helper.c - random pick iirc. Since these modules all use identical CLASSMAP declarations (ie: names and .class_id's) they will all respond together to "class DRM_UT_*" query-commands: :#> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control NOTES: This changes __drm_debug from int to ulong, so BIT() is usable on it. DRM's enum drm_debug_category values need to sync with the index of their respective class-names here. Then .class_id == category, and dyndbg's class FOO mechanisms will enable drm_dbg(DRM_UT_KMS, ...). Though DRM needs consistent categories across all modules, thats not generally needed; modules X and Y could define FOO differently (ie a different NAME => class_id mapping), changes are made according to each module's private class-map. No callsites are actually selected by this patch, since none are class'd yet. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-3-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0406faf25fb12d29cb1823e641c6f3f3e2037735 Author: Jim Cromie Date: Sun Sep 11 23:28:44 2022 -0600 drm_print: condense enum drm_debug_category enum drm_debug_category has 10 categories, but is initialized with bitmasks which require 10 bits of underlying storage. By using natural enumeration, and moving the BIT(cat) into drm_debug_enabled(), the enum fits in 4 bits, allowing the category to be represented directly in pr_debug callsites, via the ddebug.class_id field. While this slightly pessimizes the bit-test in drm_debug_enabled(), using dyndbg with JUMP_LABEL will avoid the function entirely. NOTE: this change forecloses the possibility of doing: drm_dbg(DRM_UT_CORE|DRM_UT_KMS, "weird 2-cat experiment") but thats already strongly implied by the use of the enum itself; its not a normal enum if it can be 2 values simultaneously. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220912052852.1123868-2-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 19029f3f47c7f2dd796cecd001619a37034d658a Author: ChenXiaoSong Date: Fri Sep 23 18:25:54 2022 +0800 debugfs: use DEFINE_SHOW_ATTRIBUTE to define debugfs_regset32_fops Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: ChenXiaoSong Link: https://lore.kernel.org/r/20220923102554.2443452-1-chenxiaosong2@huawei.com Signed-off-by: Greg Kroah-Hartman commit d70590d53a8996acf55426ba934d49eee9f091cd Author: Yang Yingliang Date: Wed Sep 14 22:07:53 2022 +0800 driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs() Use IS_ERR_OR_NULL() helper in device_create_groups_vargs() to simplify code and improve readiblity. No functional change. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220914140753.3799982-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3e081438b8e639cc76ef1a5ce0c1bd8a154082c7 Author: Guilherme G. Piccoli Date: Fri Sep 9 17:07:55 2022 -0300 firmware: google: Test spinlock on panic path to avoid lockups Currently the gsmi driver registers a panic notifier as well as reboot and die notifiers. The callbacks registered are called in atomic and very limited context - for instance, panic disables preemption and local IRQs, also all secondary CPUs (not executing the panic path) are shutdown. With that said, taking a spinlock in this scenario is a dangerous invitation for lockup scenarios. So, fix that by checking if the spinlock is free to acquire in the panic notifier callback - if not, bail-out and avoid a potential hang. Fixes: 74c5b31c6618 ("driver: Google EFI SMI") Cc: Andrew Morton Cc: Ard Biesheuvel Cc: David Gow Cc: Greg Kroah-Hartman Cc: Julius Werner Cc: Petr Mladek Reviewed-by: Evan Green Signed-off-by: Guilherme G. Piccoli Link: https://lore.kernel.org/r/20220909200755.189679-1-gpiccoli@igalia.com Signed-off-by: Greg Kroah-Hartman commit a5ccec12acfaf3a7ebbbeb90555b35b275fce0df Author: Liu Shixin Date: Fri Sep 16 22:12:44 2022 +0800 bus: mvebu-mbus: use DEFINE_SHOW_ATTRIBUTE to simplify mvebu_{sdram/devs}_debug Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Link: https://lore.kernel.org/r/20220916141244.2174005-1-liushixin2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 711898b1d5ac37bc85a9495f3f2815f5fbd0a937 Author: Vishnu Dasa Date: Wed Sep 14 20:13:21 2022 -0700 MAINTAINERS: Add header files under VMWARE VMCI DRIVER Add include/linux/vmw_vmci* files under VMWARE VMCI DRIVER. Suggested-by: Stefano Garzarella Acked-by: Bryan Tan Acked-by: Stefano Garzarella Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220915031321.1121-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit 9ea224b119223ddacbed3d7c96a30b2823e09579 Author: Shang XiaoJing Date: Fri Sep 23 18:08:41 2022 +0800 mei: gsc: Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220923100841.17719-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 4b25cf09c69c0e48e7fb75786f29b50bddf50ebf Author: Jilin Yuan Date: Sun Sep 18 18:04:31 2022 +0800 mei: fix repeated words in comments Delete the redundant word 'from'. Acked-by: Tomas Winkler Signed-off-by: Jilin Yuan Link: https://lore.kernel.org/r/20220918100431.28381-1-yuanjilin@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 1b46c82146d732aa6dab5ef51a89ec0b53bd05b4 Author: Gaosheng Cui Date: Tue Sep 13 19:03:56 2022 +0800 drivers/misc/sgi-xp: Remove orphan declarations from drivers/misc/sgi-xp/xp.h Remove the following orphan declarations from drivers/misc/sgi-xp/xp.h: 1. xp_nofault_PIOR_target 2. xp_error_PIOR 3. xp_nofault_PIOR They have been removed since commit 9726bfcdb977 ("misc/sgi-xp: remove SGI SN2 support"), so remove them. Reviewed-by: Steve Wahl Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220913110356.764711-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 3717ca3e0cc8683f93b41d3f06ca79631eb58715 Author: Rafał Miłecki Date: Fri Sep 16 13:21:00 2022 +0100 nvmem: u-boot-env: fix crc32 casting type This fixes: drivers/nvmem/u-boot-env.c:141:17: sparse: sparse: cast to restricted __le32 Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables") Reported-by: kernel test robot Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-14-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9e8f208ad5229ddda97cd4a83ecf89c735d99592 Author: Horatiu Vultur Date: Fri Sep 16 13:20:59 2022 +0100 nvmem: lan9662-otp: add support Add support for OTP controller available on LAN9662. The OTPC controls the access to a non-volatile memory. The size of the memory is 8KB. The OTPC can access the memory based on an offset. Implement both the read and the write functionality. Signed-off-by: Horatiu Vultur Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-13-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit d1b274c4819deed7673e5edec12fea1e57110ad8 Author: Horatiu Vultur Date: Fri Sep 16 13:20:58 2022 +0100 dt-bindings: lan9662-otpc: document Lan9662 OTPC Document Lan9662 OTP controller. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Horatiu Vultur Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-12-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit d4d432670f7dee0a5432fcffcfc8699b25181ace Author: Rafał Miłecki Date: Fri Sep 16 13:20:57 2022 +0100 nvmem: u-boot-env: find Device Tree nodes for NVMEM cells DT binding allows specifying NVMEM cells as NVMEM device (provider) subnodes. Looks for such subnodes when building NVMEM cells. This allows NVMEM consumers to use U-Boot environment variables. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-11-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8f6a3a19e99cdb52b0ff0d2d3197e810258b6e46 Author: Iskren Chernev Date: Fri Sep 16 13:20:56 2022 +0100 dt-bindings: nvmem: Add SoC compatible for sm6115 Document SoC compatible for sm6115. Reviewed-by: Caleb Connolly Acked-by: Krzysztof Kozlowski Signed-off-by: Iskren Chernev Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-10-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit a06d9e5a63b7c2f622c908cd9600ce735e70f7c6 Author: Rafał Miłecki Date: Fri Sep 16 13:20:55 2022 +0100 nvmem: sort config symbols alphabetically 1. Match what most subsystems do 2. Simplify maintenance a bit 3. Reduce amount of conflicts for new drivers patches While at it unify indent level in Makefile. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-9-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 28fc7c986f01fdcfd28af648be2597624cac0e27 Author: Rafał Miłecki Date: Fri Sep 16 13:20:54 2022 +0100 nvmem: prefix all symbols with NVMEM_ This unifies all NVMEM symbols. They follow one style now. Reviewed-by: Matthias Brugger Acked-by: Arnd Bergmann Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-8-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 105ca4190dcf15903cc2b503df7ce473715c432f Author: Krzysztof Kozlowski Date: Fri Sep 16 13:20:53 2022 +0100 dt-bindings: nvmem: qfprom: add IPQ8064 and SDM630 compatibles Document compatibles for QFPROM used on IPQ8064 and SDM630. They are compatible with generic QFPROM fallback. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit d3524bb5b9a0c567b853a0024526afe87dde01ed Author: Kenneth Lee Date: Fri Sep 16 13:20:52 2022 +0100 nvmem: brcm_nvram: Use kzalloc for allocating only one element Use kzalloc(...) rather than kcalloc(1, ...) because the number of elements we are specifying in this case is 1, so kzalloc would accomplish the same thing and we can simplify. Signed-off-by: Kenneth Lee Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-6-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit ff1df1886f43365f2333770f89a7b435424897f4 Author: Johnson Wang Date: Fri Sep 16 13:20:51 2022 +0100 dt-bindings: nvmem: mediatek: efuse: Add support for MT8188 Add compatible for MT8188 SoC. Acked-by: Krzysztof Kozlowski Signed-off-by: Johnson Wang Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5544e90c81261e82e02bbf7c6015a4b9c8c825ef Author: Gaosheng Cui Date: Fri Sep 16 13:20:50 2022 +0100 nvmem: core: add error handling for dev_set_name The type of return value of dev_set_name is int, which may return wrong result, so we add error handling for it to reclaim memory of nvmem resource, and return early when an error occurs. Signed-off-by: Gaosheng Cui Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4a575865c1ea67018d96acda9b43e5d3d25b2366 Author: Rafał Miłecki Date: Fri Sep 16 13:20:49 2022 +0100 mtd: allow getting MTD device associated with a specific DT node MTD subsystem API allows interacting with MTD devices (e.g. reading, writing, handling bad blocks). So far a random driver could get MTD device only by its name (get_mtd_device_nm()). This change allows getting them also by a DT node. This API is required for drivers handling DT defined MTD partitions in a specific way (e.g. U-Boot (sub)partition with environment variables). Acked-by: Miquel Raynal Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit d5542923f200f95bddf524f36fd495f78aa28e3c Author: Rafał Miłecki Date: Fri Sep 16 13:20:48 2022 +0100 nvmem: add driver handling U-Boot environment variables U-Boot stores its setup as environment variables. It's a list of key-value pairs stored on flash device with a custom header. This commit adds an NVMEM driver that: 1. Provides NVMEM access to environment vars binary data 2. Extracts variables as NVMEM cells Current Linux's NVMEM sysfs API allows reading whole NVMEM data block. It can be used by user-space tools for reading U-Boot env vars block without the hassle of finding its location. Parsing will still need to be re-done there. Kernel-parsed NVMEM cells can be read however by Linux drivers. This may be useful for Ethernet drivers for reading device MAC address which is often stored as U-Boot env variable. Reviewed-by: Ahmad Fatoum Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 42992cf187e4e4bcfe3c58f8fc7b1832c5652d9f Author: Lin Yujun Date: Wed Sep 14 11:19:53 2022 +0800 slimbus: qcom-ngd: Add error handling in of_qcom_slim_ngd_register No error handling is performed when platform_device_add() return fails. Refer to the error handling of driver_set_override(), add error handling for platform_device_add(). Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Reviewed-by: Neil Armstrong Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220914031953.94061-1-linyujun809@huawei.com Signed-off-by: Greg Kroah-Hartman commit bd1244561fa2a4531ded40dbf09c9599084f8b29 Author: Gaosheng Cui Date: Fri Sep 16 13:04:02 2022 +0100 nvmem: core: Fix memleak in nvmem_register() dev_set_name will alloc memory for nvmem->dev.kobj.name in nvmem_register, when nvmem_validate_keepouts failed, nvmem's memory will be freed and return, but nobody will free memory for nvmem->dev.kobj.name, there will be memleak, so moving nvmem_validate_keepouts() after device_register() and let the device core deal with cleaning name in error cases. Fixes: de0534df9347 ("nvmem: core: fix error handling while validating keepout regions") Cc: stable@vger.kernel.org Signed-off-by: Gaosheng Cui Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916120402.38753-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit e291691c69776ad278cd39dec2306dd39d681a9f Author: Krzysztof Kozlowski Date: Fri Sep 16 13:29:10 2022 +0100 slimbus: qcom-ngd-ctrl: allow compile testing without QCOM_RPROC_COMMON The Qualcomm common remote-proc code (CONFIG_QCOM_RPROC_COMMON) has necessary stubs, so it is not needed for compile testing. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122910.170730-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit e7a3c8b9b1c212462332170a81353eea992762aa Author: Krzysztof Kozlowski Date: Fri Sep 16 13:29:09 2022 +0100 slimbus: qcom-ngd: simplify error paths with dev_err_probe Use dev_err_probe to skip printing of deferred probe errors and to simplify error paths. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122910.170730-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 16f14551d0df9e7cd283545d7d748829594d912f Author: Krzysztof Kozlowski Date: Fri Sep 16 13:29:08 2022 +0100 slimbus: qcom-ngd: cleanup in probe error path Add proper error path in probe() to cleanup resources previously acquired/allocated to fix warnings visible during probe deferral: notifier callback qcom_slim_ngd_ssr_notify already registered WARNING: CPU: 6 PID: 70 at kernel/notifier.c:28 notifier_chain_register+0x5c/0x90 Modules linked in: CPU: 6 PID: 70 Comm: kworker/u16:1 Not tainted 6.0.0-rc3-next-20220830 #380 Call trace: notifier_chain_register+0x5c/0x90 srcu_notifier_chain_register+0x44/0x90 qcom_register_ssr_notifier+0x38/0x4c qcom_slim_ngd_ctrl_probe+0xd8/0x400 platform_probe+0x6c/0xe0 really_probe+0xbc/0x2d4 __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x12c __device_attach_driver+0xb8/0x120 bus_for_each_drv+0x78/0xd0 __device_attach+0xa8/0x1c0 device_initial_probe+0x18/0x24 bus_probe_device+0xa0/0xac deferred_probe_work_func+0x88/0xc0 process_one_work+0x1d4/0x320 worker_thread+0x2cc/0x44c kthread+0x110/0x114 ret_from_fork+0x10/0x20 Fixes: e1ae85e1830e ("slimbus: qcom-ngd-ctrl: add Protection Domain Restart Support") Cc: Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122910.170730-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5038d21dde818fe74ba1fcb6f2cee35b8c2ebbf2 Author: Krzysztof Kozlowski Date: Fri Sep 16 13:29:07 2022 +0100 slimbus: qcom-ngd: use correct error in message of pdr_add_lookup() failure Use correct error code, instead of previous 'ret' value, when printing error from pdr_add_lookup() failure. Fixes: e1ae85e1830e ("slimbus: qcom-ngd-ctrl: add Protection Domain Restart Support") Cc: Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122910.170730-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit f3d8232331a3f4eaac1ab9a8679e5aedb2c33758 Author: Kuan-Chung Chen Date: Thu Sep 22 09:27:37 2022 +0800 wifi: rtw89: support for enable/disable MSDU aggregation To enable/disable amsdu in set_tid_config, and currently only support to configure all tids (==0xff) for AMSDU, not individual tid. The command example is: iw wlan0 set tidconf tids 0xff amsdu off iw wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0xff amsdu on Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922012737.15091-1-pkshih@realtek.com commit 8d540f9d29162e273797bef36686a010724f0f8a Author: Kuan-Chung Chen Date: Thu Sep 22 09:27:19 2022 +0800 wifi: rtw89: disable 26-tone RU HE TB PPDU transmissions Align with the spec of 802.11ax, follow the conditions for not responding with an HE TB PPDU. When there are OBSS that cannot interpret 26-tone RU transmissions, we should disable such transmissions. Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922012719.15037-1-pkshih@realtek.com commit f4a43c3b95a0c422cea5dea2e0377728e8ea4475 Author: Dian-Syuan Yang Date: Thu Sep 22 09:04:35 2022 +0800 wifi: rtw89: support for processing P2P power saving Support P2P client to process Notice of Absence (NoA) mechanism when it connects with P2P GO applying an NoA schedule. We define some action types including init, update, remove and terminate in h2c function to enable/disable NoA schedule. Signed-off-by: Dian-Syuan Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922010435.12167-6-pkshih@realtek.com commit 71392bb249d83e2d6914e3bca1c76666c0d28628 Author: Dian-Syuan Yang Date: Thu Sep 22 09:04:34 2022 +0800 wifi: rtw89: support WMM-PS in P2P GO mode To handle a connected client using WMM-PS, the P2P GO also need to enable this power save mechanism. We add WIPHY_FLAG_AP_UAPSD flag to support it and define maximum number of buffered frames the WMM GO may deliver to the WMM client. Signed-off-by: Dian-Syuan Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922010435.12167-5-pkshih@realtek.com commit 487b7b70250c06760ebbd803b9c545a2600a9a47 Author: Ping-Ke Shih Date: Thu Sep 22 09:04:33 2022 +0800 wifi: rtw89: set wifi_role of P2P Consider vif->p2p to set wifi_role to let firmware know current vif is running as GC or GO. And, allow GC to enter PS mode, but disallow to enter deep PS for now. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922010435.12167-4-pkshih@realtek.com commit 3788c599da62917bbdf79abf829276eb8e0b087c Author: Dian-Syuan Yang Date: Thu Sep 22 09:04:32 2022 +0800 wifi: rtw89: send OFDM rate only in P2P mode Check IEEE80211_TX_CTL_NO_CCK_RATE flag to avoid sending frames with CCK rates in 2GHz band. In TX flow, add IEEE80211_TX_CTL_NO_CCK_RATE flag to check and get its lowest rate without CCK rates if the TX type is mgmt frames or data frames. Besides, the decision of phy rate and retry rate in P2P mode are also be handled. In P2P GO mode, it should send beacon of no CCK rates in its frame rate. Therefore, We add a condition to decide which rate is added to beacon content. Moreover, we avoid setting a mask of rates to be used for rate control selection before and after connection in P2P mode. Signed-off-by: Dian-Syuan Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922010435.12167-3-pkshih@realtek.com commit e8ecfdd656ab6d744f79d16821ad7911ff35649e Author: Po Hao Huang Date: Thu Sep 22 09:04:31 2022 +0800 wifi: rtw89: support P2P To support P2P in driver, we set P2P interface mode to the wiphy allocated for 802.11 PHY and add a change interface function to switch the interface type to P2P. Signed-off-by: Po Hao Huang Signed-off-by: Dian-Syuan Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220922010435.12167-2-pkshih@realtek.com commit c9aada64fe6493461127f1522d7e2f01792d2424 Author: Daniel Golle Date: Sat Sep 17 21:30:09 2022 +0100 wifi: rt2x00: correctly set BBP register 86 for MT7620 Instead of 0 set the correct value for BBP register 86 for MT7620. Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/257267247ee4fa7ebc6a5d0c4948b3f8119c0d77.1663445157.git.daniel@makrotopia.org commit cbde6ed406a51092d9e8a2df058f5f8490f27443 Author: Daniel Golle Date: Sat Sep 17 21:29:55 2022 +0100 wifi: rt2x00: set SoC wmac clock register Instead of using the default value 33 (pci), set US_CYC_CNT init based on Programming guide: If available, set chipset bus clock with fallback to cpu clock/3. Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/3e275d259f476f597dab91a9c395015ef3fe3284.1663445157.git.daniel@makrotopia.org commit 0e09768c085709e10ece3b68f6ac921d3f6a9caa Author: Daniel Golle Date: Sat Sep 17 21:29:40 2022 +0100 wifi: rt2x00: set VGC gain for both chains of MT7620 Set bbp66 for all chains of the MT7620. Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/29e161397e5c9d9399da0fe87d44458aa2b90a78.1663445157.git.daniel@makrotopia.org commit eeb50acf15762b61921f9df18663f839f387c054 Author: Daniel Golle Date: Sat Sep 17 21:29:26 2022 +0100 wifi: rt2x00: set correct TX_SW_CFG1 MAC register for MT7620 Set correct TX_SW_CFG1 MAC register as it is done also in v3 of the vendor driver[1]. [1]: https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531 Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/4be38975ce600a34249e12d09a3cb758c6e71071.1663445157.git.daniel@makrotopia.org commit d5ed439cf00ac0d17b9c4fc0c3a3ddd651cc65ba Author: Daniel Golle Date: Sat Sep 17 21:29:13 2022 +0100 wifi: rt2x00: fix HT20/HT40 bandwidth switch on MT7620 Add missing configuration of the channel bandwidth filter to the channel setup function for MT7620. Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1664d89ba149f7b0bcec18b2a2abaedf49654507.1663445157.git.daniel@makrotopia.org commit 79b4c9455e0baf40cad2a4740c98a31658641284 Author: Daniel Golle Date: Sat Sep 17 21:28:58 2022 +0100 wifi: rt2x00: move helper functions up in file Move register access helper functions up to the head of the file so they can be used in all functions. Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/c27baa8efd5c29e2bcb2432925d9cdc5c913a125.1663445157.git.daniel@makrotopia.org commit dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 Author: Tomislav Požega Date: Sat Sep 17 21:28:43 2022 +0100 wifi: rt2x00: add TX LOFT calibration for MT7620 Add TX LOFT calibration from mtk driver. Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/d9295a9138a1f552b648aacb84e1419d38f5c896.1663445157.git.daniel@makrotopia.org commit d3aad83d05aec0cfd7670cf0028f2ad4b81de92e Author: Daniel Golle Date: Sat Sep 17 21:28:29 2022 +0100 wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620 The function rt2800_iq_calibrate is intended for Rt5592 only. Don't call it for MT7620 which has it's own calibration functions. Reported-by: Serge Vasilugin Signed-off-by: Daniel Golle Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/31a1c34ddbd296b82f38c18c9ae7339059215fdc.1663445157.git.daniel@makrotopia.org commit ab7b2295732f3cc79bfaa158a7134ea3fe7e03c2 Author: Tomislav Požega Date: Sat Sep 17 21:28:10 2022 +0100 wifi: rt2x00: add RXIQ calibration for MT7620 Add RXIQ calibration found in mtk driver. With old openwrt builds this gets us ~8Mbps more of RX bandwidth (test with iPA/eLNA layout). Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/033a39a697d51f6df258acea4c33608e0944fe4c.1663445157.git.daniel@makrotopia.org commit c8ce49ff0b83d561d9cb4bd5dcd9be83d2e3d26b Author: Tomislav Požega Date: Sat Sep 17 21:27:56 2022 +0100 wifi: rt2x00: add RXDCOC calibration for MT7620 Add RXDCOC calibration code from mtk driver. Signed-off-by: Tomislav Požega [fixed typo reported by Serge Vasilugin ] Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/850b30f652e88de30d79e968af4eb47aa5bc2511.1663445157.git.daniel@makrotopia.org commit bdcac97f143e19438bc534837938d311376b233a Author: Tomislav Požega Date: Sat Sep 17 21:27:41 2022 +0100 wifi: rt2x00: add r calibration for MT7620 Add r calibration code as found in mtk driver. Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e0c34f233089bec4eb73826bc4f512166ee25934.1663445157.git.daniel@makrotopia.org commit 26d76c370f692c7a73fb2229cba4e1c725b1abec Author: Tomislav Požega Date: Sat Sep 17 21:27:26 2022 +0100 wifi: rt2x00: add RF self TXDC calibration for MT7620 Add TX self calibration based on mtk driver. Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/dbb6e5a0c12d6101477bd09e83253091d21512c9.1663445157.git.daniel@makrotopia.org commit 685bcf2f9a13827f9542a0682e6368f972359d31 Author: Daniel Golle Date: Sat Sep 17 21:27:10 2022 +0100 wifi: rt2x00: move up and reuse busy wait functions Move bbp_ready and rf_ready busy wait functions up in the code so they can more easily be used. Allow specifying register mask in rf_ready function which is useful for calibration routines which will be added in follow-up commits. Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/3fdb9dc15e76a9f9c1948b4a3a1308a7a5677bb8.1663445157.git.daniel@makrotopia.org commit d7320a37716891447e81fd3a7f1ccd7dd080a507 Author: Daniel Golle Date: Sat Sep 17 21:26:55 2022 +0100 wifi: rt2x00: add support for external PA on MT7620 Implement support for external PA connected to MT7620A. Signed-off-by: Tomislav Požega [pozega.tomislav@gmail.com: use chanreg and dccal helpers.] Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/af2c68ff831816a86fc39b0c10911c129a1f03dc.1663445157.git.daniel@makrotopia.org commit 47c40fd2440e1e30f13fae3836df4658517813aa Author: David Bauer Date: Sat Sep 17 21:26:40 2022 +0100 wifi: rt2x00: add throughput LED trigger This adds a (currently missing) throughput LED trigger for the rt2x00 driver. Previously, LED triggers had to be assigned to the netdev, which was limited to a single VAP. Tested-by: Christoph Krapp Signed-off-by: David Bauer Acked-by: Stanislaw Gruszka Signed-off-by: Daniel Golle Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org commit 3fdff7e08117e376fe00da64718f97ce2fb3195c Author: Tomislav Požega Date: Sat Sep 17 21:26:27 2022 +0100 wifi: rt2x00: define RF5592 in init_eeprom routine Fix incorrect RF value encoded in EEPROM on devices with Ralink Rt5592 PCIe radio (a single chip 2T2R 802.11abgn solution). Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/d7eccb2c7b8ec4cd360fa2007796abffc35abb0d.1663445157.git.daniel@makrotopia.org commit 21760e5c3829ed093953b990681aa1ba1b86ad31 Author: наб Date: Fri Sep 16 00:40:22 2022 +0200 Documentation: ENI155_MAGIC isn't a magic number It's part of the EEPROM format Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/5f1dfa09150be7f23fb275d170c9019b5197a79f.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 82805818898ddd3c35e1171885169fd45a7fedcc Author: наб Date: Fri Sep 16 00:40:17 2022 +0200 Documentation: NBD_REPLY_MAGIC isn't a magic number It's part of the line protocol Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/a8afed8fb4d7df2c8fb95c3fa758240b2e46cdc8.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit bd5926220ffe00e1f6f09b3b27808f29fa6a8cef Author: наб Date: Fri Sep 16 00:40:12 2022 +0200 nbd: remove define-only NBD_MAGIC, previously magic number commit f4507164e779 ("nbd: rename the nbd_device variable from lo to nbd") renamed LO_MAGIC to NBD_MAGIC; commit 5ea8d10802ec ("nbd: separate out the config information") removed the last users of that Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/10a80681c5966fed1a1afc696e3db114f481514c.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 4b0ab3d522cac8934cc1d0abe0e19d29dc75e671 Author: наб Date: Fri Sep 16 00:40:08 2022 +0200 Documentation: FW_HEADER_MAGIC isn't a magic number It's a file format identifier Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/1b21808fb399931eb44f0dc26fda20a632ecc196.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 03acba12179c5359882f35bdf316e211bfbfe00d Author: наб Date: Fri Sep 16 00:40:03 2022 +0200 Documentation: EEPROM_MAGIC_VALUE isn't a magic number It's an EEPROM checksum, not a magic number per magic-number.rst Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/8881090c8bf1850e1d3597cb352a8dd1757c94f1.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 4da0cdb1a6a72c336af3b336f775247574c7bb31 Author: наб Date: Fri Sep 16 00:39:58 2022 +0200 Documentation: COW_MAGIC isn't a magic number At least not in the magic-number.rst sense: it's part of a file format Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/f24a428d82713821ca571bf477a099252d06ae14.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 6a0abf8ff9940f6f2a1c678fccadabad442a6ed6 Author: наб Date: Fri Sep 16 00:39:54 2022 +0200 Documentation: SAVEKMSG_MAGIC[12] aren't magic numbers At least not in the magic-number.rst sense: they're used as part of delineating messages dumping dmesg into Chip RAM on the Amiga with debug=ram Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/c0fe3aadb700621eeee736f0ce6d73aa9d2cf856.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 976c957c197bc909687d77e8b892a66f3875926b Author: наб Date: Fri Sep 16 00:39:50 2022 +0200 Documentation: RIEBL_MAGIC isn't a magic number At least not in the sense described in magic-number.rst: it determines whether the Atari VME Lance Ethernet card has a hardware MAC address or not, and is set thereby to indicate this Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/773e5a8fe80201bed0dff5cdb1ce6f4272b0cc92.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit ba5e03f15aebb514b04fd663946b54a0af5c6ed2 Author: наб Date: Fri Sep 16 00:39:45 2022 +0200 Documentation: FULL_DUPLEX_MAGIC isn't a magic number It's used to control a mysterious register on the DEC DE21040, see comment in drivers/net/ethernet/dec/tulip/de2104x.c Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/ff28a15f9154589788277807523aa71c45c24d28.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 60464c2d3ff088621cb18c2bdac8b69e0c3fc26d Author: наб Date: Fri Sep 16 00:39:41 2022 +0200 Documentation: CG_MAGIC isn't a magic number At least not in the sense described here: it delineates UFS cylinder groups, is never assigned, and the only macro that incorporates it (ufs_cg_chkmagic; the second one is unused) is used to detect CGs and protect from filesystem corruption Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/a508477cfeb18eca4a24c29836f809fe34f20467.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 63e79d3f7cbe78196c4360e9fb2c5ecaba779cfd Author: наб Date: Fri Sep 16 00:39:36 2022 +0200 Documentation: zh: remove stale magic numbers English and it magic-number.rsts were updated when these were removed; the zh translations weren't This equalises these lists to be the same across all translations Automated: grep MAGIC Documentation/translations/process/zh_TW/magic-number.rst | while read -r mag _; do git grep -wF "$mag" | grep -vq \ '^Documentation.*magic-number.rst:' || sed -i "/^$mag/d" \ ./Documentation/{,translations/{zh_CN,zh_TW,it_IT}/}process/magic-number.rst ; done Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/5d9fa062178c45822a600a723f6f71fdb92011f3.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 4235e896928f54fbea25088e88fb576789f78b2b Author: наб Date: Fri Sep 16 00:39:32 2022 +0200 Documentation: zh: remove references to IrDA These lines blame back to their first appearance which cites linux-2.6, and IrDA was finally fully removed in 4.17 with commit d64c2a76123f ("staging: irda: remove the irda network stack and drivers") Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/d07ce5b1bc173fd02b7e5b708beb81b9432745f8.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 82b5b4e6cc81770125f09f5f21d71436d70d7436 Author: наб Date: Fri Sep 16 00:39:24 2022 +0200 Documentation: sndmagic.h doesn't exist It was added in 2.5.5 and removed in a 2.6.9 "ALSA CVS update", pre-git, which states: Removal and replacement of magic memory allocators and casts (core part) Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/09e56999b0b323fb0add61f7dbd8c9f0a576561a.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 03b15a984dc3b6c605e5abc83cdc978a7f1a0659 Author: наб Date: Fri Sep 16 00:39:18 2022 +0200 Documentation: HFS is not a user of magic numbers In fs/hfs, the only magic is for delineating on-disk block types, of which HFS_DRVR_DESC_MAGIC HFS_MFS_SUPER_MAGIC are define-only, but they're out of scope for magic-number.rst Magic numbers as described there were all removed, along their defines, in the 2.6.4 "HFS rewrite", pre-git Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/e67cec702a7ab34a8c5f7966d930d793a097a90f.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 21c660fd7c935ad76f6851b6f233e1df1530261f Author: наб Date: Fri Sep 16 00:39:11 2022 +0200 MIPS: remove define-only GDA_MAGIC, previously magic number The last user was removed in the 2.6.4 "MIPS mega-patch", pre-git Found with grep MAGIC Documentation/process/magic-number.rst | while read -r mag _; do git grep -wF "$mag" | grep -ve '^Documentation.*magic-number.rst:' \ -qe ':#define '"$mag" || git grep -wF "$mag" | while IFS=: read -r f _; do sed -i '/\b'"$mag"'\b/d' "$f"; done ; done Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/c2e7510beebdd698e20d0704712e623fad00fc1c.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit ddbded78f78953c121d9626f5fb803b8ef0134c4 Author: наб Date: Fri Sep 16 00:39:01 2022 +0200 Bluetooth: RFCOMM: remove define-only RFCOMM_TTY_MAGIC ex-magic-number Appeared in its present state in pre-git (2.5.41), never used Found with grep MAGIC Documentation/process/magic-number.rst | while read -r mag _; do git grep -wF "$mag" | grep -ve '^Documentation.*magic-number.rst:' \ -qe ':#define '"$mag" || git grep -wF "$mag" | while IFS=: read -r f _; do sed -i '/\b'"$mag"'\b/d' "$f"; done ; done Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/f6d375201dfd99416ea03b49b3dd40af56c1537e.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 53c2bd679017277fce41101ae86ab51a234c29f7 Author: наб Date: Fri Sep 16 00:38:46 2022 +0200 a.out: remove define-only CMAGIC, previously magic number The last user was removed in 5.1 in commit 08300f4402ab ("a.out: remove core dumping support") but this is part of the UAPI headers, so this may want to either wait until a.out is removed entirely, or be removed from the magic number doc and silently remain in the header A cursory glance on DCS didn't show any user code actually using this value Found with grep MAGIC Documentation/process/magic-number.rst | while read -r mag _; do git grep -wF "$mag" | grep -ve '^Documentation.*magic-number.rst:' \ -qe ':#define '"$mag" || git grep -wF "$mag" | while IFS=: read -r f _; do sed -i '/\b'"$mag"'\b/d' "$f"; done ; done Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/9cbea062df7125ef43e2e0b2a67ede6ad1c5f27e.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 766c5a3ecb319cff62612568d05756c85a759998 Author: наб Date: Fri Sep 16 00:38:33 2022 +0200 Documentation: remove nonexistent magic numbers The entire file blames back to the start of git (minus whitespace from the RST translation and a typo fix): * there are changelog comments for March 1994 through to Linux 2.5.74 * struct tty_ldisc is two pointers nowadays, so naturally no magic * GDA_MAGIC is defined but unused, and it's been this way since start-of-git * M3_CARD_MAGIC isn't defined, because commit d56b9b9c464a ("[PATCH] The scheduled removal of some OSS drivers") removed the entire driver in 2006 * CS_CARD_MAGIC likewise since commit b5d425c97f7d ("more scheduled OSS driver removal") in 2007 * KMALLOC_MAGIC and VMALLOC_MAGIC were removed in commit e38e0cfa48ac ("[ALSA] Remove kmalloc wrappers"), six months after start of git * SLAB_C_MAGIC has never even appeared in git (removed in 2.4.0-test3pre6) magic-number.rst is a low-value historial relic at best and misleading cruft at worst, so start with cleaning out ones that only appear therein Automated: grep MAGIC Documentation/process/magic-number.rst | while read -r mag _; do git grep -wF "$mag" | grep -vq '^Documentation.*magic-number.rst:' || sed -i "/^$mag/d" \ Documentation/{,translations/{zh_CN,zh_TW,it_IT}/}process/magic-number.rst done Signed-off-by: Ahelenia Ziemiańska Link: https://lore.kernel.org/r/8389a7b85b5c660c6891b1740b5dacc53491a41b.1663280877.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 01daccf748323dfc61112f474cf2ba81015446b0 Author: Mukesh Ojha Date: Tue Sep 13 18:20:24 2022 +0530 devcoredump : Serialize devcd_del work In following scenario(diagram), when one thread X running dev_coredumpm() adds devcd device to the framework which sends uevent notification to userspace and another thread Y reads this uevent and call to devcd_data_write() which eventually try to delete the queued timer that is not initialized/queued yet. So, debug object reports some warning and in the meantime, timer is initialized and queued from X path. and from Y path, it gets reinitialized again and timer->entry.pprev=NULL and try_to_grab_pending() stucks. To fix this, introduce mutex and a boolean flag to serialize the behaviour. cpu0(X) cpu1(Y) dev_coredump() uevent sent to user space device_add() ======================> user space process Y reads the uevents writes to devcd fd which results into writes to devcd_data_write() mod_delayed_work() try_to_grab_pending() del_timer() debug_assert_init() INIT_DELAYED_WORK() schedule_delayed_work() debug_object_fixup() timer_fixup_assert_init() timer_setup() do_init_timer() /* Above call reinitializes the timer to timer->entry.pprev=NULL and this will be checked later in timer_pending() call. */ timer_pending() !hlist_unhashed_lockless(&timer->entry) !h->pprev /* del_timer() checks h->pprev and finds it to be NULL due to which try_to_grab_pending() stucks. */ Link: https://lore.kernel.org/lkml/2e1f81e2-428c-f11f-ce92-eb11048cb271@quicinc.com/ Signed-off-by: Mukesh Ojha Link: https://lore.kernel.org/r/1663073424-13663-1-git-send-email-quic_mojha@quicinc.com Signed-off-by: Greg Kroah-Hartman commit b8de524ce46ef59889600bc29019c5ed4ccd6687 Author: Brian Norris Date: Mon Sep 12 16:31:42 2022 -0700 debugfs: Only clobber mode/uid/gid on remount if asked Users may have explicitly configured their debugfs permissions; we shouldn't overwrite those just because a second mount appeared. Only clobber if the options were provided at mount time. Existing behavior: ## Pre-existing status: debugfs is 0755. # chmod 755 /sys/kernel/debug/ # stat -c '%A' /sys/kernel/debug/ drwxr-xr-x ## New mount sets kernel-default permissions: # mount -t debugfs none /mnt/foo # stat -c '%A' /mnt/foo drwx------ ## Unexpected: the original mount changed permissions: # stat -c '%A' /sys/kernel/debug drwx------ New behavior: ## Pre-existing status: debugfs is 0755. # chmod 755 /sys/kernel/debug/ # stat -c '%A' /sys/kernel/debug/ drwxr-xr-x ## New mount inherits existing permissions: # mount -t debugfs none /mnt/foo # stat -c '%A' /mnt/foo drwxr-xr-x ## Expected: old mount is unchanged: # stat -c '%A' /sys/kernel/debug drwxr-xr-x Full test cases are being submitted to LTP. Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220912163042.v3.1.Icbd40fce59f55ad74b80e5d435ea233579348a78@changeid Signed-off-by: Greg Kroah-Hartman commit 4abc99652812a2ddf932f137515d5c5a04723538 Author: Christian A. Ehrhardt Date: Tue Sep 13 14:17:23 2022 +0200 kernfs: fix use-after-free in __kernfs_remove Syzkaller managed to trigger concurrent calls to kernfs_remove_by_name_ns() for the same file resulting in a KASAN detected use-after-free. The race occurs when the root node is freed during kernfs_drain(). To prevent this acquire an additional reference for the root of the tree that is removed before calling __kernfs_remove(). Found by syzkaller with the following reproducer (slab_nomerge is required): syz_mount_image$ext4(0x0, &(0x7f0000000100)='./file0\x00', 0x100000, 0x0, 0x0, 0x0, 0x0) r0 = openat(0xffffffffffffff9c, &(0x7f0000000080)='/proc/self/exe\x00', 0x0, 0x0) close(r0) pipe2(&(0x7f0000000140)={0xffffffffffffffff, 0xffffffffffffffff}, 0x800) mount$9p_fd(0x0, &(0x7f0000000040)='./file0\x00', &(0x7f00000000c0), 0x408, &(0x7f0000000280)={'trans=fd,', {'rfdno', 0x3d, r0}, 0x2c, {'wfdno', 0x3d, r1}, 0x2c, {[{@cache_loose}, {@mmap}, {@loose}, {@loose}, {@mmap}], [{@mask={'mask', 0x3d, '^MAY_EXEC'}}, {@fsmagic={'fsmagic', 0x3d, 0x10001}}, {@dont_hash}]}}) Sample report: ================================================================== BUG: KASAN: use-after-free in kernfs_type include/linux/kernfs.h:335 [inline] BUG: KASAN: use-after-free in kernfs_leftmost_descendant fs/kernfs/dir.c:1261 [inline] BUG: KASAN: use-after-free in __kernfs_remove.part.0+0x843/0x960 fs/kernfs/dir.c:1369 Read of size 2 at addr ffff8880088807f0 by task syz-executor.2/857 CPU: 0 PID: 857 Comm: syz-executor.2 Not tainted 6.0.0-rc3-00363-g7726d4c3e60b #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x6e/0x91 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x5e/0x5e5 mm/kasan/report.c:433 kasan_report+0xa3/0x130 mm/kasan/report.c:495 kernfs_type include/linux/kernfs.h:335 [inline] kernfs_leftmost_descendant fs/kernfs/dir.c:1261 [inline] __kernfs_remove.part.0+0x843/0x960 fs/kernfs/dir.c:1369 __kernfs_remove fs/kernfs/dir.c:1356 [inline] kernfs_remove_by_name_ns+0x108/0x190 fs/kernfs/dir.c:1589 sysfs_slab_add+0x133/0x1e0 mm/slub.c:5943 __kmem_cache_create+0x3e0/0x550 mm/slub.c:4899 create_cache mm/slab_common.c:229 [inline] kmem_cache_create_usercopy+0x167/0x2a0 mm/slab_common.c:335 p9_client_create+0xd4d/0x1190 net/9p/client.c:993 v9fs_session_init+0x1e6/0x13c0 fs/9p/v9fs.c:408 v9fs_mount+0xb9/0xbd0 fs/9p/vfs_super.c:126 legacy_get_tree+0xf1/0x200 fs/fs_context.c:610 vfs_get_tree+0x85/0x2e0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x675/0x1d00 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x282/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f725f983aed Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f725f0f7028 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f725faa3f80 RCX: 00007f725f983aed RDX: 00000000200000c0 RSI: 0000000020000040 RDI: 0000000000000000 RBP: 00007f725f9f419c R08: 0000000020000280 R09: 0000000000000000 R10: 0000000000000408 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000006 R14: 00007f725faa3f80 R15: 00007f725f0d7000 Allocated by task 855: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0xbf/0x200 mm/slub.c:3268 kmem_cache_zalloc include/linux/slab.h:723 [inline] __kernfs_new_node+0xd4/0x680 fs/kernfs/dir.c:593 kernfs_new_node fs/kernfs/dir.c:655 [inline] kernfs_create_dir_ns+0x9c/0x220 fs/kernfs/dir.c:1010 sysfs_create_dir_ns+0x127/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:63 [inline] kobject_add_internal+0x24a/0x8d0 lib/kobject.c:223 kobject_add_varg lib/kobject.c:358 [inline] kobject_init_and_add+0x101/0x160 lib/kobject.c:441 sysfs_slab_add+0x156/0x1e0 mm/slub.c:5954 __kmem_cache_create+0x3e0/0x550 mm/slub.c:4899 create_cache mm/slab_common.c:229 [inline] kmem_cache_create_usercopy+0x167/0x2a0 mm/slab_common.c:335 p9_client_create+0xd4d/0x1190 net/9p/client.c:993 v9fs_session_init+0x1e6/0x13c0 fs/9p/v9fs.c:408 v9fs_mount+0xb9/0xbd0 fs/9p/vfs_super.c:126 legacy_get_tree+0xf1/0x200 fs/fs_context.c:610 vfs_get_tree+0x85/0x2e0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x675/0x1d00 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x282/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 857: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x40 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free mm/kasan/common.c:329 [inline] __kasan_slab_free+0x108/0x190 mm/kasan/common.c:375 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook mm/slub.c:1780 [inline] slab_free mm/slub.c:3534 [inline] kmem_cache_free+0x9c/0x340 mm/slub.c:3551 kernfs_put.part.0+0x2b2/0x520 fs/kernfs/dir.c:547 kernfs_put+0x42/0x50 fs/kernfs/dir.c:521 __kernfs_remove.part.0+0x72d/0x960 fs/kernfs/dir.c:1407 __kernfs_remove fs/kernfs/dir.c:1356 [inline] kernfs_remove_by_name_ns+0x108/0x190 fs/kernfs/dir.c:1589 sysfs_slab_add+0x133/0x1e0 mm/slub.c:5943 __kmem_cache_create+0x3e0/0x550 mm/slub.c:4899 create_cache mm/slab_common.c:229 [inline] kmem_cache_create_usercopy+0x167/0x2a0 mm/slab_common.c:335 p9_client_create+0xd4d/0x1190 net/9p/client.c:993 v9fs_session_init+0x1e6/0x13c0 fs/9p/v9fs.c:408 v9fs_mount+0xb9/0xbd0 fs/9p/vfs_super.c:126 legacy_get_tree+0xf1/0x200 fs/fs_context.c:610 vfs_get_tree+0x85/0x2e0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x675/0x1d00 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x282/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888008880780 which belongs to the cache kernfs_node_cache of size 128 The buggy address is located 112 bytes inside of 128-byte region [ffff888008880780, ffff888008880800) The buggy address belongs to the physical page: page:00000000732833f8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8880 flags: 0x100000000000200(slab|node=0|zone=1) raw: 0100000000000200 0000000000000000 dead000000000122 ffff888001147280 raw: 0000000000000000 0000000000150015 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888008880680: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888008880700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888008880780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888008880800: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888008880880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== Acked-by: Tejun Heo Cc: stable # -rc3 Signed-off-by: Christian A. Ehrhardt Link: https://lore.kernel.org/r/20220913121723.691454-1-lk@c--e.de Signed-off-by: Greg Kroah-Hartman commit ec9c88070debd8d87335f2468481a41d6bc2d0c6 Merge: a791dc1353258 1707c39ae309b Author: Greg Kroah-Hartman Date: Sat Sep 24 13:32:01 2022 +0200 Merge 1707c39ae309 ("Merge tag 'driver-core-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core") driver-core-next This merges the driver core changes in 6.0-rc7 into driver-core-next as they are needed here as well for testing. Signed-off-by: Greg Kroah-Hartman commit f6633de18d95545abf285c1d5c8cc8deeda5341b Author: Martin Kaiser Date: Sun Sep 18 19:57:00 2022 +0200 staging: r8188eu: remove two unused enum entries Both LED_BLINK_StartToBlink and LED_BLINK_RUNTOP in enum LED_STATE_871x are not used in the r8188eu driver. Remove them. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8f60cb9534e459d66f6888038951ffd74351ef25 Author: Martin Kaiser Date: Sun Sep 18 19:56:59 2022 +0200 staging: r8188eu: remove duplicate bSurpriseRemoved check We don't have to check bSurpriseRemoved in the SwLedOn function. SwLedOn calls rtw_read8 which in turn calls usb_read. This function checks bSurpriseRemoved for us. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bf0d687586f62db4f7000456c63a45c23b08bbb2 Author: Martin Kaiser Date: Sun Sep 18 19:56:58 2022 +0200 staging: r8188eu: remove BlinkingLedState Both bLedOn and BlinkingLedState in struct led_priv store the same information. The boolean bLedOn stores the curent led state while BlinkingLedState stores the next led state to be set during blinking, which is the inverse of the current led state. (The led is either off or blinking, it's never continuously on.) This patch removes BlinkingLedState and uses bLedOn instead. The LED_BLINK_WPS_STOP case in blink_work checked for pLed->BlinkingLedState != RTW_LED_ON. This is true if the next led blinking state is ON, i.e. if the led has just been switched off by blink_work, i.e. if (!pLed->bLedOn). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 64c82a8888a658c117e398af83446e28c1d58114 Author: Martin Kaiser Date: Sun Sep 18 19:56:57 2022 +0200 staging: r8188eu: remove bLedNoLinkBlinkInProgress Remove the bLedNoLinkBlinkInProgress state variable. Its sole purpose is to block subsequent requests for "no link" blinking when this blinking pattern is already active. It's perfectly safe to restart "no link" blinking. We can remove bLedNoLinkBlinkInProgress and the many places where it's updated. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b08d89994dbb2fd38ce5c299b6b486e2b2621a07 Author: Martin Kaiser Date: Sun Sep 18 19:56:56 2022 +0200 staging: r8188eu: update status before wps success blinking Always update the status variables in rtw_led_control when we start blinking to show that wps was successful. The if statements are not necessary. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cb2b3460133cf5f91f79abb4d63812dc9be67004 Author: Martin Kaiser Date: Sun Sep 18 19:56:55 2022 +0200 staging: r8188eu: cancel blink_work during wps stop We can always cancel blink_work during wps_stop. The blinking pattern will be updated to show that wps was successful. Another worker will be started for this. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220918175700.215170-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9512d5f8e34fb7c92be6179dc48ba5f0b9b922ac Author: Nathan Huckleberry Date: Wed Sep 14 14:16:06 2022 -0700 staging: r8188eu: Fix return type of rtw_xmit_entry The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of rtw_xmit_entry should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter Tested-by: Philipp Hortmann # Edimax N150 Reviewed-by: Nathan Chancellor Signed-off-by: Nathan Huckleberry Link: https://lore.kernel.org/r/20220914211606.423959-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman commit f44641bfc4e81fb2f37a92fb13afdc7c63c9114b Author: Xiaoke Wang Date: Tue Sep 13 21:24:05 2022 +0800 staging: r8188eu: fix potential memory leak in _rtw_init_xmit_priv() In _rtw_init_xmit_priv(), there are several error paths for allocation failures just jump to the `exit` section. However, there is no action will be performed, so the allocated resources are not properly released, which leads to various memory leaks. To properly release them, this patch unifies the error handling code and several error handling paths are added. According to the allocation sequence, if the validation fails, it will jump to its corresponding error tag to release the resources. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_DB57E4F270F4539485C32B05FDAF8394310A@qq.com Signed-off-by: Greg Kroah-Hartman commit f63ed6cf93014c7fac56d82069801a26ab8b04a6 Author: Xiaoke Wang Date: Mon Sep 12 10:50:26 2022 +0800 staging: r8188eu: add kfree() on an error path of rtw_xmit_resource_alloc() In rtw_xmit_resource_alloc(), if usb_alloc_urb() fails, then the memory `pxmitbuf->pallocated_buf` which is allocated by kzalloc() is not properly released before returning. So this patch adds kfree() on the above error path to release it in time. Tested-by: Philipp Hortmann # Edimax N150 Reviewed-by: Martin Kaiser Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_3B46EE3287288555389AD2EC3F388827B306@qq.com Signed-off-by: Greg Kroah-Hartman commit 00def639882747aad89dfd095ea95f295ad034d3 Author: Michael Straube Date: Sun Sep 11 19:49:33 2022 +0200 staging: r8188eu: remove recv_osdep.h The functions _rtw_init_recv_priv(), _rtw_free_recv_priv() and rtw_recv_entry() are defined in rtw_recv.c. Move their prototypes from recv_osdep.h to rtw_recv.h. Move the last two remaining prototypes netdev_open() and netdev_close() from recv_osdep.h to osdep_intf.h. That is a more appropriate place and we can remove recv_osdep.h. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911174933.3784-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a1974d31545c98e1fcc39c932482c45d6a331a4e Author: Michael Straube Date: Sun Sep 11 19:49:32 2022 +0200 staging: r8188eu: remove unused prototypes from recv_osdep.h The function prototypes rtw_recv_returnpacket(), rtw_init_recv_priv() and rtw_free_recv_priv() are not used. Remove them. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911174933.3784-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b067be8290734c2bdcd2d00b3a755129ff85ae54 Author: Michael Straube Date: Sun Sep 11 19:49:31 2022 +0200 staging: r8188eu: make _netdev_open() static The function _netdev_open() is only used in os_intfs.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911174933.3784-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 368eca5bcf61401d4cdd0070ff9688171996e4c0 Author: Michael Straube Date: Sun Sep 11 18:19:49 2022 +0200 staging: r8188eu: replace tabs with space in odm_query_rxpwrpercentage() In statements spaces should be used not tabs. Replace tabs withs spaces in two return statements in odm_query_rxpwrpercentage(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f7438373fa0283d5b086df238e19f3d3ded9b8e5 Author: Michael Straube Date: Sun Sep 11 18:19:48 2022 +0200 staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage() Rename the variable 'AntPower' in odm_query_rxpwrpercentage() to avoid camel case. AntPower -> antpower Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c268b6e29257295257ff71b29fe65aab3e5c736 Author: Michael Straube Date: Sun Sep 11 18:19:47 2022 +0200 staging: r8188eu: rename odm_QueryRxPwrPercentage() Rename odm_QueryRxPwrPercentage() to avoid camel case. odm_QueryRxPwrPercentage -> odm_query_rxpwrpercentage Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5440b9312262d17be614e83764e8a91196610cff Author: Michael Straube Date: Sun Sep 11 18:19:46 2022 +0200 staging: r8188eu: remove unnecessary initialization The variable 'retsig' in odm_signal_scale_mapping() is set in the function before it returns, so it is not needed to initialize it. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 971193b46a5324c4e961a35794cbb0e8f688e103 Author: Michael Straube Date: Sun Sep 11 18:19:45 2022 +0200 staging: r8188eu: clean up camel case in odm_signal_scale_mapping() Rename variables in odm_signal_scale_mapping() to avoid camel case. CurrSig -> currsig RetSig -> retsig Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d9a28d22308b46349cb5c0021fa142522e056263 Author: Michael Straube Date: Sun Sep 11 18:19:44 2022 +0200 staging: r8188eu: rename odm_SignalScaleMapping() Rename odm_SignalScaleMapping() to avoid camel case. odm_SignalScaleMapping -> odm_signal_scale_mapping Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220911161949.11293-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8a8380fff3cbd8138a4e09b4d47a8717f14463a5 Author: Martin Kaiser Date: Sun Sep 11 16:51:22 2022 +0200 staging: r8188eu: update status before link blinking Always update the status variables in rtw_led_control when we start link blinking. The if statements are not necessary. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 21cce84a7c3526ce6aa3186161ba574db7245ab6 Author: Martin Kaiser Date: Sun Sep 11 16:51:21 2022 +0200 staging: r8188eu: cancel blink_work before link blinking Cancel blink_work before we start link blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b1c17560de5446a68b047df38abd02987c045624 Author: Martin Kaiser Date: Sun Sep 11 16:51:20 2022 +0200 staging: r8188eu: simplify the code to prevent link blinking restart The blinking code to signal that a link is up has the same big if clause around it as most other blink events. Revert this if condition and exit if we're already blinking to show that the link is up. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8a42af27b4321227e8e461f02ed6d3bdf78fd556 Author: Martin Kaiser Date: Sun Sep 11 16:51:19 2022 +0200 staging: r8188eu: update status before scan blinking Always update the status variables in rtw_led_control when we start tx/rx blinking. The if statements are not necessary. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5ef21996f3fc19b6826547751b5ee27295bbb0da Author: Martin Kaiser Date: Sun Sep 11 16:51:18 2022 +0200 staging: r8188eu: cancel blink_work before tx/rx blinking Cancel blink_work before we start tx/rx blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 38eec30471303a278b914b832fdd88d766f7981a Author: Martin Kaiser Date: Sun Sep 11 16:51:17 2022 +0200 staging: r8188eu: simplify the code to prevent tx/rx blinking restart The code for tx/rx blinking is wrapped into a big if clause to prevent restarting if tx/rx blinking is already running. Revert the if condition and exit if tx/rx blinking is running. This does not change the behaviour. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 56e9ef2a7e042c84775ccb4b203e30b33c49f353 Author: Martin Kaiser Date: Sun Sep 11 16:51:16 2022 +0200 staging: r8188eu: update status before scan blinking Always update the status variables in rtw_led_control when we start scan blinking. The if statements are not necessary. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 96f8f22b5183688c6f21815b98a2dcd8519f0906 Author: Martin Kaiser Date: Sun Sep 11 16:51:15 2022 +0200 staging: r8188eu: cancel blink_work before scan blinking Cancel blink_work before we start scan blinking. Another worker will be scheduled after the state variables are updated. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5b296918f9f384d454512f17e5ae79344e326056 Author: Martin Kaiser Date: Sun Sep 11 16:51:14 2022 +0200 staging: r8188eu: simplify the code to prevent scan blinking restart The code for scan blinking is wrapped into a big if clause to prevent restarting if scan blinking is already running. Revert the if condition and exit if scan blinking is running. This does not change the behaviour. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220911145122.15444-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 06bfdb6d889f57fe9ce7bd139ce278b68f3a59de Author: Xiaoke Wang Date: Fri Sep 9 19:45:57 2022 +0800 staging: r8188eu: fix a potential memory leak in rtw_init_cmd_priv() In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated in failure, then `pcmdpriv->cmd_allocated_buf` will not be properly released. Besides, considering there are only two error paths and the first one can directly return, we do not need to implicitly jump to the `exit` tag to execute the error handling code. So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error path to release the resource and simplified the return logic of rtw_init_cmd_priv(). As there is no proper device to test with, no runtime testing was performed. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_1B6AAE10471D4556788892F8FF3E4812F306@qq.com Signed-off-by: Greg Kroah-Hartman commit b77599043f00fce9253d0f22522c5d5b521555ce Author: Nathan Huckleberry Date: Wed Sep 14 14:10:57 2022 -0700 staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of cvm_oct_xmit and cvm_oct_xmit_pow should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter Reviewed-by: Nathan Chancellor Acked-by: Arnd Bergmann Signed-off-by: Nathan Huckleberry Link: https://lore.kernel.org/r/20220914211057.423617-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman commit 9fabdbe8bcce08faaa51f618a87e3bf3ac264462 Author: Liu Shixin Date: Thu Sep 22 22:25:48 2022 +0800 staging: pi433: use DEFINE_SHOW_ATTRIBUTE to simplify pi433_debugfs_regs Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin Link: https://lore.kernel.org/r/20220922142548.3248951-1-liushixin2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 2851349ac351010a2649e0ff86a1e3d68fe5d683 Author: Nathan Huckleberry Date: Wed Sep 14 14:07:50 2022 -0700 staging: rtl8192u: Fix return type of ieee80211_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of ieee80211_xmit should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter Reviewed-by: Nathan Chancellor Signed-off-by: Nathan Huckleberry Link: https://lore.kernel.org/r/20220914210750.423048-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman commit 2a2db520e3ca5aafba7c211abfd397666c9b5f9d Author: Nam Cao Date: Mon Sep 12 19:04:31 2022 +0200 staging: vt6655: fix some erroneous memory clean-up loops In some initialization functions of this driver, memory is allocated with 'i' acting as an index variable and increasing from 0. The commit in "Fixes" introduces some clean-up codes in case of allocation failure, which free memory in reverse order with 'i' decreasing to 0. However, there are some problems: - The case i=0 is left out. Thus memory is leaked. - In case memory allocation fails right from the start, the memory freeing loops will start with i=-1 and invalid memory locations will be accessed. One of these loops has been fixed in commit c8ff91535880 ("staging: vt6655: fix potential memory leak"). Fix the remaining erroneous loops. Link: https://lore.kernel.org/linux-staging/Yx9H1zSpxmNqx6Xc@kadam/ Fixes: 5341ee0adb17 ("staging: vt6655: check for memory allocation failures") Reported-by: Dan Carpenter Tested-by: Philipp Hortmann Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20220912170429.29852-1-namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d3cdad6ea41386d149502edafb9f59687b16fdf Author: Kang Minchul Date: Thu Sep 22 21:23:10 2022 +0900 staging: rtl8723bs: Add a blank line after declarations This patch adds a blank line in order to fix checkpatch warning Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220922122310.3379711-5-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit 21df60c4ab20ae7bad526dcd3dbe6514664befd1 Author: Kang Minchul Date: Thu Sep 22 21:23:09 2022 +0900 staging: rtl8723bs: Make switch and case at the same indent This patch fixes switch and case as linux kernel coding style and amend this error generated by checkpatch: ERROR: switch and case should be at the same indent Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220922122310.3379711-4-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit 51c8299a031c19449669d9c15f52427e481c0be6 Author: Kang Minchul Date: Thu Sep 22 21:23:08 2022 +0900 staging: rtl8723bs: Relocate constant on the right side of test This patch fixes following warning generated by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220922122310.3379711-3-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit e8f5ab391c18493d158e087a37257bfd12f82262 Author: Kang Minchul Date: Thu Sep 22 21:23:07 2022 +0900 staging: rtl8723bs: replace code indent as tabs This patch removes error below generated by checkpatch ERROR: code indent should use tabs where possible Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220922122310.3379711-2-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit ea1f50427c99446e6601ee2ed1b7d19b161a9957 Author: Kang Minchul Date: Mon Sep 19 22:34:08 2022 +0900 staging: rtl8723bs: Fix coding style issue in block comment This patch removes the following warning generated by checkpatch.pl WARNING: Block comments use * on subsequent lines #206: FILE: rtw_recv.c:206: +/* +signed int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue) WARNING: Block comments use * on subsequent lines #216: FILE: rtw_recv.c:216: +/* +caller : defrag ; recvframe_chk_defrag in recv_thread (passive) Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220919133408.3271462-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit 47a54e93bf4cb8c29174b954bb92c3fd0cd57202 Author: Kang Minchul Date: Sun Sep 18 03:16:20 2022 +0900 staging: rtl8723bs: Insert blank line after declarations This patch fixes checkpatch warning as follows: WARNING: Missing a blank line after declarations Reviewed-by: Hans de Goede Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220917181620.3237192-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56fb8f051f3d3ad91c16fa52795f4ddd6bc82c0f Author: Kang Minchul Date: Wed Sep 14 01:25:10 2022 +0900 staging: rtl8723bs: remove braces in single statement blocks This commit cleans up checkpatch warning as follows: WARNING: braces {} are not necessary for single statement blocks Reviewed-by: Hans de Goede Signed-off-by: Kang Minchul Link: https://lore.kernel.org/r/20220913162510.3134430-1-tegongkang@gmail.com Signed-off-by: Greg Kroah-Hartman commit 708056fba733a73d926772ea4ce9a42d240345da Author: Xiaoke Wang Date: Fri Sep 9 19:27:21 2022 +0800 staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated in failure, then `pcmdpriv->cmd_allocated_buf` will be not properly released. Besides, considering there are only two error paths and the first one can directly return, so we do not need implicitly jump to the `exit` tag to execute the error handler. So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error path to release the resource and simplified the return logic of rtw_init_cmd_priv(). As there is no proper device to test with, no runtime testing was performed. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_2B7931B79BA38E22205C5A09EFDF11E48805@qq.com Signed-off-by: Greg Kroah-Hartman commit 5a5aa9cce621e2c0e25a1e5d72d6be1749167cc0 Author: Xiaoke Wang Date: Fri Sep 9 18:39:35 2022 +0800 staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw() In rtw_init_drv_sw(), there are various init functions are called to populate the padapter structure and some checks for their return value. However, except for the first one error path, the other five error paths do not properly release the previous allocated resources, which leads to various memory leaks. This patch fixes them and keeps the success and error separate. Note that these changes keep the form of `rtw_init_drv_sw()` in "drivers/staging/r8188eu/os_dep/os_intfs.c". As there is no proper device to test with, no runtime testing was performed. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_C3B899D2FC3F1BC827F3552E0B0734056006@qq.com Signed-off-by: Greg Kroah-Hartman commit 9bbf2f32859b52cb7870b06de7f7bea0b2d14e3b Author: Philipp Hortmann Date: Sat Sep 17 06:25:58 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in rtl819x_BAProc.c, ... Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Remove multiline macro as it is not needed anymore and not liked by kernel community. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2c41e6856cd37b4f3e5cb1108272bcc24032bf64.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 42e3a68e2e1ba333fb9898a2340ccd7d5b72a121 Author: Philipp Hortmann Date: Sat Sep 17 06:25:48 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in rtl_ps.c Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/6d942ba65f62643af2ff7104911f7947cca21790.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f7624a76e64acc65a6610b469d970d40e5006277 Author: Philipp Hortmann Date: Sat Sep 17 06:25:40 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in rtl_dm.c Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bc0e2c9551ccf78fe388b27d18576b5bb195e2f7.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7d1409dededd20664c79d34009fd29f72fbcff28 Author: Philipp Hortmann Date: Sat Sep 17 06:25:31 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in r8192E_phy.c Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7315b22f54d62c5b56e8b9284426eca4cb641f77.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0e260856b724844999d4f90eae4135fc19c69650 Author: Philipp Hortmann Date: Sat Sep 17 06:25:23 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in r8192E_dev.c Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/425e1b015c34ddb6df425bc516df64c40a70a58a.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit bbc8c3a4c4449e8f30da2287f96271f0a53ff880 Author: Philipp Hortmann Date: Sat Sep 17 06:25:07 2022 +0200 staging: rtl8192e: Remove ftrace-like logging in r8192E_firmware.c, ... Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Reviewed-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/370f47919a69f2f1717f50123c1617cabc78ceca.1663387785.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 74adc1f005e6c28f9019ae49cb5f2796e532f25e Author: Shang XiaoJing Date: Tue Sep 20 21:51:45 2022 +0800 staging: fwserial: Switch to kfree_rcu() API Instead of invoking a synchronize_rcu() to free a pointer after a grace period, we can directly make use of a new API that does the same but in a more efficient way. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220920135145.1387-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman commit fe23057cbc042073f7a05a92ed2cd1d2b3c81f28 Author: Gaosheng Cui Date: Tue Sep 20 21:07:11 2022 +0800 MIPS: IRQ: remove orphan allocate_irqno() declaration All uses of allocate_irqno() have been removed by commit 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts"), so remove the orphan declaration. Signed-off-by: Gaosheng Cui Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit c8fbf8a88fcd4464b0727d646a85793ccba49b03 Author: Gaosheng Cui Date: Tue Sep 20 21:07:10 2022 +0800 MIPS: remove orphan sb1250_time_init() declaration All uses of sb1250_time_init() have been removed by commit d527eef5b7f1 ("[MIPS] Sibyte: Finish conversion to modern time APIs."), so remove the orphan declaration. The comments about sb1250_time_init() is useless in arch_init_irq(), so remove these comments. Signed-off-by: Gaosheng Cui Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 692cb5b0f4e25b3ff504f108e55033dd20d2ef74 Author: Dmitry Torokhov Date: Thu Sep 22 21:55:40 2022 -0700 MIPS: Lantiq: switch vmmc to use gpiod API This switches vmmc to use gpiod API instead of OF-specific legacy gpio API that we want to stop exporting from gpiolib. Signed-off-by: Dmitry Torokhov Signed-off-by: Thomas Bogendoerfer commit 730320fd770d4114a2ecb6fb223dcc8c3cecdc5b Author: Aleksander Jan Bajkowski Date: Wed Sep 21 22:59:44 2022 +0200 MIPS: lantiq: enable all hardware interrupts on second VPE This patch is needed to handle interrupts by the second VPE on the Lantiq ARX100, xRX200, xRX300 and xRX330 SoCs. Switching some ICU interrupts to the second VPE results in a hang. Currently, the vsmp_init_secondary() function is responsible for enabling these interrupts. It only enables Malta-specific interrupts (SW0, SW1, HW4 and HW5). The MIPS core has 8 interrupts defined. On Lantiq SoCs, hardware interrupts are wired to an ICU instance. Each VPE has an independent instance of the ICU. The mapping of the ICU interrupts is shown below: SW0(IP0) - IPI call, SW1(IP1) - IPI resched, HW0(IP2) - ICU 0-31, HW1(IP3) - ICU 32-63, HW2(IP4) - ICU 64-95, HW3(IP5) - ICU 96-127, HW4(IP6) - ICU 128-159, HW5(IP7) - timer. This patch enables all interrupt lines on the second VPE. This problem affects multithreaded SoCs with a custom interrupt controller. SOCs with 1004Kc core and newer use the MIPS GIC. At this point, I am aware that the Realtek RTL839x and RTL930x SoCs may need a similar fix. In the future, this may be replaced with some generic solution. Tested on Lantiq xRX200. Suggested-by: Thomas Bogendoerfer Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Thomas Bogendoerfer commit 70a7ce22e9229f216c638426a854efd5bd127b24 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:12 2022 +0200 media: sun6i-csi: Move csi buffer definition to main header file The buffer structure is a top-level definition, put it in the main header to keep things tidy. No functional change intended. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7d13cf0e0023000768876c4e65c89e7714e9071f Author: Paul Kocialkowski Date: Fri Aug 26 20:32:11 2022 +0200 media: sun6i-csi: Introduce and use video helper functions Introduce some helpers for buffer and general video configuration. Signed-off-by: Paul Kocialkowski Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b11d91321cacf638cbfbbb424f9267d4146872a9 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:10 2022 +0200 media: sun6i-csi: Add media ops with link notify callback In order to keep the power use count fields balanced when link changes happen between v4l2_pipeline_pm_get/set calls (in open/close), the link_notify media operation callback needs to be registered. Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit daafbb94adc543641cd37b04dbe911244b8bf0f6 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:09 2022 +0200 media: sun6i-csi: Remove controls handler from the driver The driver does not expose controls directly and thus does not need a controls handler for its own use. Controls attached to subdevs used to be exposed that way, however this can easily lead to issue when multiple subdevs attached to the same v4l2 device expose the same controls. Subdev controls should be set through each individual subdev node instead. Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f9a6e5651efff2b3461ef8256067437a39b54e9e Author: Paul Kocialkowski Date: Fri Aug 26 20:32:08 2022 +0200 media: sun6i-csi: Register the media device after creation There is no particular need to register the media device in the subdev notify complete callback. Register it in the v4l2 code instead where it's more in-context. Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 92cc51588225d82a4e3d2358e47367ac52b1661a Author: Paul Kocialkowski Date: Fri Aug 26 20:32:07 2022 +0200 media: sun6i-csi: Pass and store csi device directly in video code The video structure is part of the main csi device structure, so pass pointers to that top-level structure directly. This makes it easier to navigate and access other elements. No functional change intended. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ab2e8d5d67fb86ff74ccb3cad9b57988fb1adfcd Author: Paul Kocialkowski Date: Fri Aug 26 20:32:06 2022 +0200 media: sun6i-csi: Tidy up video code Some code cleanups, renames, variable lowerings and moving things around for better organization. No functional change intended. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cad7f35c1ab50bad92479e64ae57628b61da8b1b Author: Paul Kocialkowski Date: Fri Aug 26 20:32:05 2022 +0200 media: sun6i-csi: Tidy up v4l2 code Various cosmetic improvements to the v4l2 registration code, with renames, lowerings, etc. The cleanup function is moved down after setup. No functional change intended. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bffb52248930d76e98fcc5deecda5bc9b3043ef5 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:04 2022 +0200 media: sun6i-csi: Tidy up Kconfig Update the option title and help, group related options together, add dependency on VIDEO_DEV since the driver uses it and update the description. Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 69b80659a728b99b868518b975d00f25ea70ec21 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:03 2022 +0200 media: sun6i-csi: Use runtime pm for clocks and reset Wrap the clock and reset preparation into runtime pm functions for better organization of the code. Also fix the clock and reset enable order to first deassert reset, as recommended in Allwinner literature. Make the driver depend on PM while at it since runtime pm is mandatory for the driver to work. Signed-off-by: Paul Kocialkowski Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bc67ec9e1348d94ead4e4704ca79e7a4bc97fac3 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:02 2022 +0200 media: sun6i-csi: Define and use variant to get module clock rate Introduce a proper variant structure with the module clock rate instead of hardcoding it with a manual check on the compatible. Signed-off-by: Paul Kocialkowski Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 740b5b3d156b6a9cb3b3d3ee2427acca0a890607 Author: Paul Kocialkowski Date: Fri Aug 26 20:32:01 2022 +0200 media: sun6i-csi: Always set exclusive module clock rate In some situations the default rate of the module clock is not the required one for operation (for example when reconfiguring the clock tree to use a different parent). As a result, always set the correct rate for the clock (and take care of cleanup). Signed-off-by: Paul Kocialkowski Reviewed-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 43e80196625cdb3133ec6fef4ac06e6a967094fd Author: Paul Kocialkowski Date: Fri Aug 26 20:32:00 2022 +0200 media: sun6i-csi: Tidy up platform code Various renames, variables lowering and other cosmetic changes in the platform-support code. No functional change intended. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0b11253f36e8d6697e3eea81a9a87a704edfcf65 Author: Paul Kocialkowski Date: Wed Sep 7 12:00:38 2022 +0200 media: sun6i-csi: Refactor main driver data structures Merge contents of structs sun6i_csi and sun6i_csi_dev into a main sun6i_csi_device structure holding a sun6i_csi_v4l2 struct for things related to v4l2, as well as the already-existing sun6i_csi_video and sun6i_csi_config which are left unchanged. This mostly simplifies accessing stuff by having a single main structure accessible to every part of the code instead of a private definition. Also solve some kerneldoc warnings by describing return codes while at it. No functional change is intended in this commit, variables are just moved around (cosmetics). Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6f4d0849be9beefc457a8ec95818ff36309d273a Author: Paul Kocialkowski Date: Fri Aug 26 20:31:58 2022 +0200 media: sun6i-csi: Define and use driver name and (reworked) description Add proper defines for driver name and description instead of MODULE_NAME and hardcoding (cosmetics). Also rework the description while at it to mention the hardware generation that the driver supports and remove the video capture mentions since it applies to the whole media device. Signed-off-by: Paul Kocialkowski Reviewed-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 26686b0da9f3fd042578c1093862c853f8e4ff1b Author: Paul Kocialkowski Date: Thu Aug 25 12:20:35 2022 +0200 media: cedrus: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b9273150b8b7f8b02ac961463057191d243f953d Author: Paul Kocialkowski Date: Thu Aug 25 12:20:34 2022 +0200 media: sun8i-rotate: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: d77182ada3d4 ("media: sun8i: Add Allwinner A83T Rotate driver") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c2a46b19f0340e6647168f4ceac4e5e4cb9197d8 Author: Paul Kocialkowski Date: Thu Aug 25 12:20:33 2022 +0200 media: sun8i-di: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 140a9b57d3a306ca77a92e903facbdc4a31ccd51 Author: Paul Kocialkowski Date: Thu Aug 25 12:20:32 2022 +0200 media: sun4i-csi: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6a720df702db764e2b3bbdaaa217e9d344efcfb2 Author: Paul Kocialkowski Date: Thu Aug 25 12:20:31 2022 +0200 media: sun6i-csi: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 398c479234894c3d3347d83869760db3c406c269 Author: Paul Kocialkowski Date: Thu Aug 25 12:20:30 2022 +0200 media: sun8i-a83t-mipi-csi2: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. Fixes: 576d196c522b ("media: sunxi: Add support for the A83T MIPI CSI-2 controller") Signed-off-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d0734dab5480325fd67548aa51ee126570d48574 Author: Paul Kocialkowski Date: Thu Aug 25 12:20:29 2022 +0200 media: sun6i-mipi-csi2: Add a Kconfig dependency on RESET_CONTROLLER The driver relies on the reset controller API to work, so add RESET_CONTROLLER as one of its Kconfig dependencies. It also selects PHY_SUN6I_MIPI_DPHY, which depends on RESET_CONTROLLER. Fixes: af54b4f4c17f ("media: sunxi: Add support for the A31 MIPI CSI-2 controller") Signed-off-by: Paul Kocialkowski Reported-by: kernel test robot Acked-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 265f2fc52f5873ae3fa653ce1f2dbc47afef6344 Author: ye xingchen Date: Tue Aug 30 10:37:53 2022 +0200 media: venus: hfi: Remove the unneeded result variable Return the value venus_hfi_create() directly instead of storing it in another redundant variable. Signed-off-by: ye xingchen Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit f5218c71098dcf51772b6509184c02ce1cef37b8 Author: Stanimir Varbanov Date: Fri Sep 2 12:01:58 2022 +0200 media: venus: venc: Set HDR10 PQ SEI property only for MAIN10 profile The HDR10 PQ SEI should be set only when the codec is HEVC and the profile is MAIN10, otherwise some artefacts could be produced on the encoded bitstream. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 61a70c9702da10296cebe4ab7d654da4bcb893b5 Author: Stanimir Varbanov Date: Fri Sep 2 12:00:31 2022 +0200 media: venus: venc_ctrls: Add default value for CLL info Add default value for CLL info when creating compound control. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 1d600444f7f811bd554c18195fa7200a9254a24f Author: Vikash Garodia Date: Mon Aug 8 11:28:34 2022 +0200 media: venus : Allow MIN/MAX settings for the v4l2 encoder controls defined range. Control MIN/MAX range defined as 0 to 1, as MIN value setting enabled for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM. error details: fail: v4l2-test-controls.cpp(516): invalid maximum range check Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 2d5dbc7ff664ba320b1b4ed622c0b4c0d3d5b472 Author: Viswanath Boma Date: Mon Aug 8 11:28:33 2022 +0200 media: venus : Remove the capture plane settings for venc_g_parm/venc_s_parm v4l2 compliance expecting settings for out buffer only and the same values will be propagated to capture buffer setting by h/w encoder . settings on cpature plane are optional , required only if offline-encoding supports. error details : fail: v4l2-test-formats.cpp(1350): !ret Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 2f2d6fe83d0346923f0247e15dd51f3257e65edd Author: Dikshita Agarwal Date: Mon Aug 8 11:28:32 2022 +0200 media: venus : Addition of support for VIDIOC_TRY_ENCODER_CMD v4l2 compliance expecting support for vidioc_try_encoder_cmd . error details : test VIDIOC_(TRY_)ENCODER_CMD: FAIL Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 70b2a5463dcdc18cd94d41f6dc170aa29cfcb922 Author: Viswanath Boma Date: Mon Aug 8 11:28:31 2022 +0200 media: venus : Addition of EOS Event support for Encoder V4l2 encoder compliance expecting End of stream Event registration support for Encoder. Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit c260bf4bd3a3f40b480a1eb1ea57ce26263c2f85 Author: Stanimir Varbanov Date: Mon Aug 8 11:28:30 2022 +0200 media: venus : CAPTURE Plane width/height alignment with OUT plane. V4l2 encoder compliance set-format test cases failing as Capture plane width/height not aligned to OUT plane . Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 096573e4c0c7eb21d5e22a9411aa2ba65ef96d96 Author: Viswanath Boma Date: Mon Aug 8 11:28:29 2022 +0200 media: venus : Addition of control support - V4L2_CID_MIN_BUFFERS_FOR_OUTPUT V4l2 encoder compliance expecting minimum buffers support for the application to allocate buffers as per the control support values. Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 014a6b274bfe051fadf8ec7e99ac5eb95653e248 Author: Stanimir Varbanov Date: Mon Aug 8 11:28:28 2022 +0200 media: venus : Add default values for the control V4l2 encoder compliance expecting default values of colorimetry for the control. Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 7f77fa9f378c528edb38dbf23ff1273c81429d49 Author: Bryan O'Donoghue Date: Tue Jul 26 04:14:55 2022 +0200 media: venus: Fix NV12 decoder buffer discovery on HFI_VERSION_1XX HFI_VERSION_1XX uses HFI_BUFFER_OUTPUT not HFI_BUFFER_OUTPUT2 for decoder buffers. venus_helper_check_format() places a constraint on an output buffer to be of type HFI_BUFFER_OUTPUT2. HFI_1XX uses HFI_BUFFER_OUTPUT though. Switching to the logic used in venus_helper_get_out_fmts() first checking for HFI_BUFFER_OUTPUT and then HFI_BUFFER_OUTPUT2 resolves on HFI_1XX. db410c before: root@linaro-alip:~# v4l2-ctl -d /dev/video0 --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar [0]: 'MPG4' (MPEG-4 Part 2 ES, compressed) [1]: 'H263' (H.263, compressed) [2]: 'H264' (H.264, compressed) [3]: 'VP80' (VP8, compressed) root@linaro-alip:~# v4l2-ctl -d /dev/video1 --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar db410c after: root@linaro-alip:~# v4l2-ctl -d /dev/video0 --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar [0]: 'MPG4' (MPEG-4 Part 2 ES, compressed) [1]: 'H263' (H.263, compressed) [2]: 'H264' (H.264, compressed) [3]: 'VP80' (VP8, compressed) root@linaro-alip:~# v4l2-ctl -d /dev/video1 --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar [0]: 'NV12' (Y/CbCr 4:2:0) Validated playback with ffplay on db410c with h264 and vp8 decoding. Fixes: 9593126dae3e ("media: venus: Add a handling of QC08C compressed format") Cc: stable@vger.kernel.org # v5.19 Signed-off-by: Bryan O'Donoghue Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 06a2da340f762addc5935bf851d95b14d4692db2 Author: Bryan O'Donoghue Date: Tue Jul 26 04:14:54 2022 +0200 media: venus: dec: Handle the case where find_format fails Debugging the decoder on msm8916 I noticed the vdec probe was crashing if the fmt pointer was NULL. A similar fix from Colin Ian King found by Coverity was implemented for the encoder. Implement the same fix on the decoder. Fixes: 7472c1c69138 ("[media] media: venus: vdec: add video decoder files") Cc: stable@vger.kernel.org # v4.13+ Signed-off-by: Bryan O'Donoghue Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 39dfd52d0f481de42a435f9fb79c98b376c68c39 Author: Daniel González Cabanelas Date: Mon Feb 7 15:51:41 2022 +0100 media: cx88: add IR remote support for NotOnlyTV LV3H The PCI hybrid card NotOnlyTV LV3H has a built-in IR receiver connected via I2C bus, currently not supported. This receiver is probably present in more Geniatech cards. It has no capability for repeating when a key is held down. Add support for this built-in IR receiver. Use the existing Total Media In Hand_02 remote keytable (Geniatech Mygica X8507) which matches exactly the LV3H remote. Signed-off-by: Daniel González Cabanelas Signed-off-by: Marek Kidawski Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 51e1440d309a74a3e4e252019a00f9d0df329945 Author: Christophe JAILLET Date: Tue Aug 23 09:42:11 2022 +0200 media: sunxi: Fix some error handling path of sun6i_mipi_csi2_probe() Release some resources in the error handling path of the probe and of sun6i_mipi_csi2_resources_setup(), as already done in the remove function. Fixes: af54b4f4c17f ("media: sunxi: Add support for the A31 MIPI CSI-2 controller") Signed-off-by: Christophe JAILLET Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 466c1e6d05003707e8baa16668e7bc287d875d5e Author: Christophe JAILLET Date: Tue Aug 23 09:42:01 2022 +0200 media: sunxi: Fix some error handling path of sun8i_a83t_mipi_csi2_probe() Release some resources in the error handling path of the probe and of sun8i_a83t_mipi_csi2_resources_setup(), as already done in the remove function. Fixes: 576d196c522b ("media: sunxi: Add support for the A83T MIPI CSI-2 controller") Signed-off-by: Christophe JAILLET Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a90bc000770c3a745fd26d62c89b1b20ebc0e145 Author: Mauro Carvalho Chehab Date: Sat Sep 24 11:10:22 2022 +0200 media: atomisp: don't store an unused sink data on a var Fixes this Werror breakage: drivers/staging/media/atomisp/pci/atomisp_ioctl.c: In function 'atomisp_streamon': drivers/staging/media/atomisp/pci/atomisp_ioctl.c:1714:44: error: variable 'sink' set but not used [-Werror=unused-but-set-variable] 1714 | struct v4l2_mbus_framefmt *sink; | ^~~~ Signed-off-by: Mauro Carvalho Chehab commit 4c8928850c9dc5c849ee37d89a79d44a283bdd87 Author: Sergiu Moga Date: Fri Sep 23 14:34:18 2022 +0300 MAINTAINERS: Solve warning regarding inexistent atmel-usart binding After the conversion to json-schema, what was previously known as `Documentation/devicetree/bindings/mfd/atmel-usart.txt` has been moved to another bindings directory and renamed to `Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml`. Thus, make `MAINTAINERS` reflect this change. Fixes: b9e947fbf008 ("dt-bindings: serial: atmel,at91-usart: convert to json-schema") Reported-by: kernel test robot Acked-by: Nicolas Ferre Signed-off-by: Sergiu Moga Link: https://lore.kernel.org/r/20220923113415.90236-1-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit df383edffd2e3af1d0f4df48f248efcb49c58f79 Author: Andy Shevchenko Date: Sat Jul 30 18:20:27 2022 +0200 media: atomisp_gmin_platform: Unexport and split camera_sensor_csi() The camera_sensor_csi() is not used outside the module, hence make it static. While at it, split it to _alloc() and _free() to clearly show the idea behind the last parameter @flag that is passed to gmin_csi_cfg(). Link: https://lore.kernel.org/r/20220730162027.1011-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Sakari Ailus Tested-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f5b657e5dbf830cfcb19b588b784b8190a5164a0 Author: Kai Ye Date: Sat Sep 17 10:03:45 2022 +0000 crypto: hisilicon/qm - fix the qos value initialization The default qos value is not initialized when sriov is repeatedly enabled and disabled. So add the vf qos value initialized in the sriov enable process. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit b21dc631222bbe61c372dfb19373fb9d83718314 Author: Liu Shixin Date: Fri Sep 16 22:13:40 2022 +0800 crypto: sun4i-ss - use DEFINE_SHOW_ATTRIBUTE to simplify sun4i_ss_debugfs Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Acked-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Herbert Xu commit c4b1ce72b5c9f7d5772b2f2d4efa25ef0e6fb576 Author: Taehee Yoo Date: Fri Sep 16 12:57:36 2022 +0000 crypto: tcrypt - add async speed test for aria cipher In order to test for the performance of aria-avx implementation, it needs an async speed test. So, it adds async speed tests to the tcrypt. Signed-off-by: Taehee Yoo Signed-off-by: Herbert Xu commit ba3579e6e45c693495a50c516278749c5e3d9977 Author: Taehee Yoo Date: Fri Sep 16 12:57:35 2022 +0000 crypto: aria-avx - add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher The implementation is based on the 32-bit implementation of the aria. Also, aria-avx process steps are the similar to the camellia-avx. 1. Byteslice(16way) 2. Add-round-key. 3. Sbox 4. Diffusion layer. Except for s-box, all steps are the same as the aria-generic implementation. s-box step is very similar to camellia and sm4 implementation. There are 2 implementations for s-box step. One is to use AES-NI and affine transformation, which is the same as Camellia, sm4, and others. Another is to use GFNI. GFNI implementation is faster than AES-NI implementation. So, it uses GFNI implementation if the running CPU supports GFNI. There are 4 s-boxes in the ARIA and the 2 s-boxes are the same as AES's s-boxes. To calculate the first sbox, it just uses the aesenclast and then inverts shift_row. No more process is needed for this job because the first s-box is the same as the AES encryption s-box. To calculate the second sbox(invert of s1), it just uses the aesdeclast and then inverts shift_row. No more process is needed for this job because the second s-box is the same as the AES decryption s-box. To calculate the third s-box, it uses the aesenclast, then affine transformation, which is combined AES inverse affine and ARIA S2. To calculate the last s-box, it uses the aesdeclast, then affine transformation, which is combined X2 and AES forward affine. The optimized third and last s-box logic and GFNI s-box logic are implemented by Jussi Kivilinna. The aria-generic implementation is based on a 32-bit implementation, not an 8-bit implementation. the aria-avx Diffusion Layer implementation is based on aria-generic implementation because 8-bit implementation is not fit for parallel implementation but 32-bit is enough to fit for this. Signed-off-by: Taehee Yoo Signed-off-by: Herbert Xu commit a9b0838dd82534c49dd4e5e2172ddea3fb2b5d39 Author: Taehee Yoo Date: Fri Sep 16 12:57:34 2022 +0000 crypto: aria - prepare generic module for optimized implementations It renames aria to aria_generic and exports some functions such as aria_set_key(), aria_encrypt(), and aria_decrypt() to be able to be used by aria-avx implementation. Signed-off-by: Taehee Yoo Signed-off-by: Herbert Xu commit 4532f1cf9caaf2588d48d1de7770a6d5d1f95e89 Author: Herbert Xu Date: Fri Sep 16 18:35:50 2022 +0800 crypto: artpec6 - Fix printk warning on size_t/%d Switch to %zu instead of %d for printing size_t. Signed-off-by: Herbert Xu Acked-by: Jesper Nilsson Signed-off-by: Herbert Xu commit 33837be33367172d66d1f2bd6964cc41448e6e7c Author: Xiu Jianfeng Date: Thu Sep 15 11:36:15 2022 +0800 crypto: add __init/__exit annotations to init/exit funcs Add missing __init/__exit annotations to init/exit funcs. Signed-off-by: Xiu Jianfeng Signed-off-by: Herbert Xu commit 1b79573de717cfabe28221a98afaa6a3ff0e7458 Author: Lukas Bulwahn Date: Wed Sep 14 10:38:27 2022 +0200 crypto: blake2s - revert unintended config addition of CRYPTO_BLAKE2S Commit 2d16803c562e ("crypto: blake2s - remove shash module") removes the config CRYPTO_BLAKE2S. Commit 3f342a23257d ("crypto: Kconfig - simplify hash entries") makes various changes to the config descriptions as part of some consolidation and clean-up, but among all those changes, it also accidently adds back CRYPTO_BLAKE2S after its removal due to the original patch being based on a state before the CRYPTO_BLAKE2S removal. See Link for the author's confirmation of this happening accidently. Fixes: 3f342a23257d ("crypto: Kconfig - simplify hash entries") Link: https://lore.kernel.org/all/MW5PR84MB18424AB8C095BFC041AE33FDAB479@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM/ Signed-off-by: Lukas Bulwahn Signed-off-by: Herbert Xu commit 611d451e4041b4be1c59e0888b64caa4ff1204ad Author: Lukas Bulwahn Date: Wed Sep 14 10:36:26 2022 +0200 crypto: arm64 - revert unintended config name change for CRYPTO_SHA1_ARM64_CE Commit 3f342a23257d ("crypto: Kconfig - simplify hash entries") makes various changes to the config descriptions as part of some consolidation and clean-up, but among all those changes, it also accidently renames CRYPTO_SHA1_ARM64_CE to CRYPTO_SHA1_ARM64. Revert this unintended config name change. See Link for the author's confirmation of this happening accidently. Fixes: 3f342a23257d ("crypto: Kconfig - simplify hash entries") Link: https://lore.kernel.org/all/MW5PR84MB18424AB8C095BFC041AE33FDAB479@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM/ Signed-off-by: Lukas Bulwahn Signed-off-by: Herbert Xu commit 320406cb60b6408d87f6a5bc729285fc44107352 Author: Peter Harliman Liem Date: Tue Sep 13 16:03:48 2022 +0800 crypto: inside-secure - Replace generic aes with libaes Commit 363a90c2d517 ("crypto: safexcel/aes - switch to library version of key expansion routine") removed CRYPTO_AES in the config. However, some portions of codes still rely on generic AES cipher (e.g. refer to safexcel_aead_gcm_cra_init(), safexcel_xcbcmac_cra_init()). This causes transform allocation failure for those algos, if CRYPTO_AES is not manually enabled. To resolve that, we replace all existing AES cipher dependent codes with their AES library counterpart. Fixes: 363a90c2d517 ("crypto: safexcel/aes - switch to library version of key expansion routine") Signed-off-by: Peter Harliman Liem Signed-off-by: Herbert Xu commit 49186a7d9e46ff132a0ed9b721ad6b6a58dba6c1 Author: Peter Harliman Liem Date: Tue Sep 13 16:03:47 2022 +0800 crypto: inside_secure - Avoid dma map if size is zero From commit d03c54419274 ("dma-mapping: disallow .map_sg operations from returning zero on error"), dma_map_sg() produces warning if size is 0. This results in visible warnings if crypto length is zero. To avoid that, we avoid calling dma_map_sg if size is zero. Signed-off-by: Peter Harliman Liem Signed-off-by: Herbert Xu commit 1e32f6ea43c44c256a3b63f60223d30d46f9d4b1 Author: Hans de Goede Date: Fri Sep 9 23:46:39 2022 +0200 media: atomisp: Remove atomisp_source_pad_to_stream_id() atomisp_source_pad_to_stream_id() returns ATOMISP_INPUT_STREAM_GENERAL unconditionally now. Drop it and directly use ATOMISP_INPUT_STREAM_GENERAL in its callers. Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit cf2e0516f040fd576b35436b316c0923c45fb468 Author: Hans de Goede Date: Sun Sep 4 18:54:36 2022 +0200 media: atomisp: Remove const/fixed camera_caps The code checks a camera_caps struct in various places, but this always points to the same const camera_caps struct. Remove the checks, keeping the code paths which would be taken with the fixed camera caps struct still in place and remove the camera_caps struct itself. Note this completely removes atomisp_pause_buffer_event() because that only ever does something if camera_caps.sensors[0].is_slave is true and that never is true. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e226e9a492a32d0789b27bedc1d0a4644fe8c118 Author: Hans de Goede Date: Sun Sep 4 15:04:36 2022 +0200 media: atomisp: Remove unused atomisp_css_get_dis_statistics() Remove the unused atomisp_css_get_dis_statistics() function. This seems to be a leftover variant / older version of atomisp_css_get_dis_stats() which is actually used. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e208848cb10e203681d6b07b96acd55d3378ede0 Author: Hans de Goede Date: Sun Sep 4 14:59:08 2022 +0200 media: atomisp: Make atomisp_set_raw_buffer_bitmap() static atomisp_set_raw_buffer_bitmap() is only used in atomisp_cmd.c, make it static. Unfortunately this still requires a forward declaration (the function cannot be moved easily). Still this will at least make it obvious to anyone reading the code that the function is not used elsewhere. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 405dac898124da8c30474b4b720405915dcf209f Author: Hans de Goede Date: Sun Sep 4 10:56:47 2022 +0200 media: atomisp: Drop unnecessary first_streamoff check Drop an unnecessary first_streamoff check from atomisp_streamoff(), above the check there is a: if (!first_streamoff) goto stop_sensor; Code block which will jump over the code with the test, so the test is only executed when first_streamoff is true and therefor the test is not necessary. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit d7306735e972a06cb788b8886bd0c070a245171d Author: Hans de Goede Date: Sun Sep 4 10:47:23 2022 +0200 media: atomisp: Remove a couple of not useful function wrappers The __atomisp_reqbufs(), __atomisp_streamoff() are 1:1 wrappers for the non __ prefixed functions now, drop these wrappers. The atomisp_s_fmt_cap() wrapper is almost a 1:1 wrapper for atomisp_set_fmt() adjust the latter to have the right function prototype and drop the wrapper. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit cf223056fb29772208e8612e631eb0ef9e2c1a3a Author: Hans de Goede Date: Fri Sep 2 23:56:48 2022 +0200 media: atomisp: Use video_dev.lock for ioctl locking Set video_dev.lock to point to isp->mutex so that the core does the locking surroundig ioctls for us and drop all the now no longer necessary (and conflicting) locking from the ioctl handling code. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b88e0ee7b081930e0e2f65a77696695c44a4a4b2 Author: Hans de Goede Date: Sat Sep 3 23:42:53 2022 +0200 media: atomisp: Drop streamoff_mutex Now that __atomisp_streamoff() no longer drops isp->mutex to cancel the watchdog timer, the streamoff_mutex is no longer necessary to avoid multiple streamoffs racing with each other. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1636369bcfa253a91a8ac7327469c6642df018fc Author: Hans de Goede Date: Sat Sep 3 23:50:42 2022 +0200 media: atomisp: Rework asd->streaming state update in __atomisp_streamoff() During the first __atomisp_streamoff() call on an asd with only one pipe streaming asd->streaming would get set twice: asd->streaming = ATOMISP_DEVICE_STREAMING_STOPPING; asd->streaming = ATOMISP_DEVICE_STREAMING_DISABLED; Rework the code a bit so that it gets set to the correct value right away instead of doing this in 2 steps. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 0ecc5236d1cb0015c00981d253bb8edee36770bb Author: Hans de Goede Date: Sat Sep 3 23:36:01 2022 +0200 media: atomisp: Move atomisp_streaming_count() check into __atomisp_css_recover() Both callers of __atomisp_css_recover() check atomisp_streaming_count() first, move the check into __atomisp_css_recover(). And __atomisp_css_recover() already calls lockdep_assert_held(&isp->mutex), so drop that from atomisp_css_flush(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 93d3fb35aa10a8417f923871c7c58c9ad81d7a08 Author: Hans de Goede Date: Sat Sep 3 23:26:27 2022 +0200 media: atomisp: Remove watchdog timer The watchdog timer code to recover from the ISP getting stuck has several major issues: 1. There is no way to do fault injection and normally the ISP does not get stuck, so is it is impossible to test it. 2. It in essence just stops all streams, resets the ISP and then brings everything back up. Userspace can easily do this itself by using a timeout on dqbuf and then closing (which causes a poweroff) + re-opening the device. Doing this in userspace (if it ever turns out to be necessary) greatly simplifies the kernel code and in general will be a more robust solution. Even just a quick look at the code finds several more issues: 3. The need to sync-cancel the timers + work on streamoff requires isp->mutex to be dropped halfway during the ioctl opening all sorts of races. 4. The atomisp code supports setting up 2 pipelines, streaming from two sensors at the same time. But there is only a single wdt_work and stopping one of the 2 streams will cancel the timers + work, stopping the wdt even though the other stream might still be running. 5. In case atomisp_css_flush() the sync cancel is done while keeping isp->mutex locked, causing a deadlock when racing with wdt_work which also takes isp->mutex. 6. Even though the watchdog is purely a software/driver thing which just checkes that new frames keep coming in, there are 2 completely different implementations for the ISP2400/ISP2401 which is not necessary at all. So all in all I believe that it is better to just remove the current watchdog implementation. Fixing all the issues with the current implementation will be so much work, that if it turns out that we do need something like this then doing a clean re-implementation from scratch will be better anyways. wdt_work was also (ab)used to reset the ISP after the firmware signalled an fw-assert error through the irq, add a new assert_recover_work to replace this. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f315c1acba84fe17cd92a05e6c1c1bf26ee6bd43 Author: Hans de Goede Date: Sat Sep 3 14:49:39 2022 +0200 media: atomisp: Add atomisp_pipe_check() helper Several of the ioctl handlers all do the same checks (isp->fatal_error and asd->streaming errors) add an atomisp_pipe_check() helper for this. Note this changes the vidioc_s_fmt_vid_cap and vidioc_s_input handlers to now reject calls made while asd->streaming==STOPPING. This fixes a possible race where one thread can make this ioctls while vidioc_streamoff is running from another thread and it has temporarily released isp->mutex to kill the watchdog timers / work. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 0d51573df3e0d944a644dbe90cdb06afefe77cc4 Author: Hans de Goede Date: Sat Sep 3 12:41:15 2022 +0200 media: atomisp: Remove asd == NULL checks from ioctl handling At probe time isp_subdev_init_entities() sets pipe->asd to a non NULL value for all four (preview/vf/capture/capture_video) pipes by calling atomisp_init_subdev_pipe() for all 4 pipes. So it can never be NULL. Remove the redundant NULL checks. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 2468083f799eb9eef7b03f48ebb9673ad5655f88 Author: Hans de Goede Date: Fri Sep 2 13:39:51 2022 +0200 media: atomisp: Fix locking around asd->streaming read/write For reading / writing the asd->streaming enum the following rules should be followed: 1. Writers of streaming must hold both isp->mutex and isp->lock. 2. Readers of streaming need to hold only one of the two locks. Not all writers where properly taking both locks this fixes this. In the case of the readers, many readers depend on their caller to hold isp->mutex, add asserts for this And in the case of atomisp_css_get_dis_stat() it is called with isp->mutex held, so there is no need to take the spinlock just for reading the streaming value. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit d33a6d321078b66b9dd0a87413827ed178dd1779 Author: Hans de Goede Date: Fri Sep 2 13:04:33 2022 +0200 media: atomisp: Remove unused lock member from struct atomisp_sub_device The spin-lock embedded in struct atomisp_sub_device is not used anywhere, remove it. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f10fc1790d5ecdaa0aabab9b61be6b162e83386c Author: Hans de Goede Date: Fri Sep 2 12:26:51 2022 +0200 media: atomisp: Use a normal mutex for the main lock There is no reason for atomisp to use a rt_mutex instead of a normal mutex, so switch over to a normal mutex. All the changes in this patch are just s/rt_mutex/mutex/. This is a preparation patch for switching the ioctl locking over to using the video_dev.lock member so that the v4l2-core takes care of the locking. Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3ad290194bb06979367622e47357462836c1d3b4 Author: Dan Carpenter Date: Thu Sep 1 07:20:09 2022 +0200 media: atomisp: prevent integer overflow in sh_css_set_black_frame() The "height" and "width" values come from the user so the "height * width" multiplication can overflow. Link: https://lore.kernel.org/r/YxBBCRnm3mmvaiuR@kili Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ba6856aab1a7edebf1a27c0b6bffaa8a6ea80de7 Author: Hans de Goede Date: Mon Aug 29 12:37:11 2022 +0200 media: atomisp: Simplify v4l2_fh_open() error handling v4l2_fh_open() can only fail with -ENOMEM and as a generic rule drivers do not log their own errors for -ENOMEM since the kernel will already have complained loudly about this before the -ENOMEM return. Remove the unnecessary error logging from atomisp_open(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5b9853ad1329be49343a608d574eb232ff1273d0 Author: Hans de Goede Date: Mon Aug 29 12:35:43 2022 +0200 media: atomisp: Fix v4l2_fh resource leak on open errors When atomisp_open() fails then it must call v4l2_fh_release() to undo the results of v4l2_fh_open(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5a93d0cacf2fe110848200554b2815b2578c679c Author: Hans de Goede Date: Mon Aug 29 12:30:08 2022 +0200 media: atomisp: Remove loading mutex Now that the registering of the /dev/* video / subdev nodes has been moved to the end of atomisp_pci_probe() the workaround with the loading mutex to delay opens until init is done is no longer necessary. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit eb81065b9322d6493a152665b4f0974819899c66 Author: Hans de Goede Date: Mon Aug 29 00:12:12 2022 +0200 media: atomisp: Register /dev/* nodes at the end of atomisp_pci_probe() Register /dev/* nodes at the end of atomisp_pci_probe(), this is a prerequisite for dropping the loading mutex + ready flag kludge for delaying open() calls on the /dev/* nodes . Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3b423e1bed3dfef5b8260b6bd622253e4f974428 Author: Hans de Goede Date: Sun Aug 28 21:41:50 2022 +0200 media: atomisp: Split subdev and video-node registration into 2 steps Split subdev and video-node registration into 2 steps, this is a preparation step for moving video-node registration to the end of probe() so that the loading() mutex can be removed. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 0d945e4d0a9c966129f4ba38f9e8297dcc271e03 Author: Hans de Goede Date: Sun Aug 28 21:15:52 2022 +0200 media: atomisp: Remove empty atomisp_css_set_cont_prev_start_time() function atomisp_css_set_cont_prev_start_time() is a no-op, remove it. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5e13ff4cb8f1d8bbc7ff455e47ae347ef26d6867 Author: Hans de Goede Date: Sun Aug 28 21:11:51 2022 +0200 media: atomisp: Remove some further ATOMISP_ACC_* related dead code Remove some more code which is no longer referenced after the removal of the ATOMISP_ACC_* custom ioctls. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit af69562a28faa50b7ffea97b8ceb8f6554a70e12 Author: Hans de Goede Date: Sun Aug 28 21:00:20 2022 +0200 media: atomisp: Remove the ACC device node The ACC /dev/video# device node uses a struct video_device embedded in an atomisp_acc_pipe struct instead of in an atomisp_video_pipe struct. Yet it uses the same file-ops and ioctl-ops even though it does not have a videobuf queue, which makes e.g. the mmap fop nonsense. Worse the only file-ops / ioctls which differentiate between the 2 types and correctly do container_of on the right type are the open/release fops and the vidioc_default handler. The mmap and poll fops and *all* other ioctl handlers unconditionally do container_of on the passed in struct video_device blindly assuming they are dealing with the one embedded in the atomisp_video_pipe struct. This makes it trivial for userspace to cause all sort of undefined behavior by calling mmap, poll or the other ioctls on the ACC device node! Presumably the use of the ACC device node was to allow making the special ioctls to load custom programs while the other /dev/video# nodes were already open, since the /dev/video# nodes can currently all be opened only once (which needs to be fixed). commit 4bbca788b6eb ("media: atomisp: remove private acceleration ioctls") has removed the custom ATOMISP_ACC_* ioctls, so there no longer is any reason to keep the ACC device node. As explained above its presence can easily cause the kernel to crash, so remove the ACC device node and the code for handling it. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 79adb947ef6d6ecb0337a8ad515459c5655300ca Author: Hans de Goede Date: Sat Aug 27 16:49:23 2022 +0200 media: atomisp: Remove never set file_input flag After the file-injection support removal the file_input flag is always false. Remove the flag and replace any code checking it with the code-path for when it is false. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5e61114e3abf221b37f2e4ab7da35dae991cfad2 Author: Hans de Goede Date: Sat Aug 27 16:39:10 2022 +0200 media: atomisp: Remove the outq videobuf queue After the file-injection support removal the outq videobuf queue is no longer used, remove it. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1ace82c7f9afee232c7e39f533fb40d636941090 Author: Hans de Goede Date: Sat Aug 27 16:28:50 2022 +0200 media: atomisp: Remove atomisp_file_fops and atomisp_file_ioctl_ops After the file-injection support removal, atomisp_video_pipe->type never is V4L2_BUF_TYPE_VIDEO_OUTPUT anymore, so the V4L2_BUF_TYPE_VIDEO_OUTPUT support path in atomisp_video_init() is never hit and this path is the only user of atomisp_file_fops and atomisp_file_ioctl_ops. Remove atomisp_file_fops and atomisp_file_ioctl_ops and all of the functions which are only referenced by these ops structs. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 48ff45dade87eb24a4d7ca28fd813ca2e2ebe745 Merge: 50c448bbc1981 1cf9a3ae3e2de Author: Steffen Klassert Date: Sat Sep 24 09:49:47 2022 +0200 Merge branch 'xfrm: add netlink extack for state creation' Sabrina Dubroca says: ============ This is the second part of my work adding extended acks to XFRM, now taking care of state creation. Policies were handled in the previous series [1]. To keep this series at a reasonable size, x->type->init_state will be handled separately. [1] https://lkml.kernel.org/r/cover.1661162395.git.sd@queasysnail.net ============ Signed-off-by: Steffen Klassert commit 29b12ac7609c0c8f0bc4a6448d984b80c8957e99 Author: Hans de Goede Date: Sat Aug 27 16:17:07 2022 +0200 media: atomisp: Remove file-injection support The file-injection support of the atomisp driver has not been tested and is not necessary for camera support, remove it. Note the main reason for removing this is because it depends on the videobuf (version 1) outq and we want to remove or replace all videobuf usage in the driver. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit a2ace25c3f0e8904abc2aadee554cc20c6c3bf6b Author: Hans de Goede Date: Sat Aug 27 15:54:27 2022 +0200 media: atomisp: Fix device_caps reporting of the registered video-devs atomisp_subdev_register_entities() had V4L2_CAP_VIDEO_CAPTURE / V4L2_CAP_VIDEO_OUT swapped. Or-ing in V4L2_CAP_VIDEO_OUT for the nodes which allow capturing from the camera and or-ing in V4L2_CAP_VIDEO_CAPTURE for the file-injection node (mem2mem use of the ISP). Things happen to still work for the capture device-nodes because the "shared" caps also included V4L2_CAP_VIDEO_CAPTURE, so those shared nodes advertised V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUT. Fix things so that only the correct caps are advertised. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 6e6c4ae0f0ba295dbf6cbd48d93bec169d6ce431 Author: Hans de Goede Date: Sun Aug 21 20:29:06 2022 +0200 media: atomisp: Ensure that USERPTR pointers are page aligned The atomisp code needs USERPTR pointers to be page aligned, otherwise bad things (scribbling over other parts of the process' RAM) happen. Add a check to ensure this and exit VIDIOC_QBUF calls with unaligned pointers with -EINVAL. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 30cf7e90f0ea7adb1f125a286f2273f9faa162fe Author: Hans de Goede Date: Sun Aug 21 20:43:57 2022 +0200 media: atomisp: hmm_bo: Drop PFN code path from alloc_user_pages() alloc_user_pages() is only ever called on qbuf for USERPTR buffers which always hits the get_user_pages_fast() path, so the pin_user_pages() path can be removed. Getting the vma then also is no longer necessary since that is only done to determine which path to use. And this also removes the only users of the mem_type struct hmm_bo member, so remove that as well. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3df52e584ed13a4451930d2d712580e3f2e63b6a Author: Hans de Goede Date: Sat Aug 13 18:06:10 2022 +0200 media: atomisp: hmm_bo: Rewrite free_private_pages() using pages_array helper funcs Rewrite free_private_pages() using pages_array helper funcs. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 2691ecc089ca934dd6d4c03a4b410a81a0d87351 Author: Hans de Goede Date: Sat Aug 13 18:00:38 2022 +0200 media: atomisp: hmm_bo: Rewrite alloc_private_pages() using pages_array helper funcs Rewrite alloc_private_pages() using pages_array helper funcs. Note alloc_pages_bulk_array() skips non NULL pages, so switch the allocating of the pages pointer array to kcalloc to ensure the pages are initially all set to NULL. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit fce48bf10141953e55bd9ffb34de22dde7fdca03 Author: Hans de Goede Date: Sat Aug 13 17:47:37 2022 +0200 media: atomisp: hmm_bo: Further simplify alloc_private_pages() Further simplify alloc_private_pages(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8519635cb292ee4e804e3f465a54b13447180366 Author: Hans de Goede Date: Sat Aug 13 17:38:45 2022 +0200 media: atomisp: hmm_bo: Simplify alloc_private_pages() Since lack_mem starts initialized to true, alloc_private_pages() will always set order to HMM_MIN_ORDER aka 0 / will always alloc 1 page at a time. So all the magic to decrease order if allocs fail is not necessary and can be removed. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e0ae3048b3db5a380a7196f58d5eeebb6770bad2 Author: Hans de Goede Date: Sat Aug 13 17:08:44 2022 +0200 media: atomisp: Make atomisp_try_fmt_cap() take padding into account atomisp_try_fmt() gives results with padding included. So when userspace asks for e.g. 1600x1200 then we should pass 1616x1216 to atomisp_try_fmt() this will then get adjusted back to 1600x1200 before returning it to userspace by the atomisp_adjust_fmt() call at the end of atomisp_try_fmt(). This fixes the resolution list in camorama showing resolutions like e.g. 1584x1184 instead of 1600x1200. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 4d3aafb9c9bba59c9b6f6df8ea6c89483bfed8d4 Author: Hans de Goede Date: Sat Aug 13 16:53:00 2022 +0200 media: atomisp: Fix VIDIOC_TRY_FMT atomisp_try_fmt() calls the sensor's try_fmt handler but it does not copy the result back to the passed in v4l2_pix_format under some circumstances. Potentially returning an unsupported resolution to userspace, which VIDIOC_TRY_FMT is not supposed to do. atomisp_set_fmt() also uses atomisp_try_fmt() and relies on this wrong behavior. The VIDIOC_TRY_FMT call passes NULL for the res_overflow argument where as the atomisp_set_fmt() call passes non NULL. Use the res_overflow argument to differentiate between the 2 callers and always propagate the sensors result in the VIDIOC_TRY_FMT case. This fixes the resolution list in camorama showing resolutions like e.g. 1584x1184 instead of 1600x1200. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e0565e23796e8260613b7aa81606cb42dcdcf68c Author: Hans de Goede Date: Sat Aug 13 11:01:13 2022 +0200 media: atomisp-notes: Add info about sensors v4l2_get_subdev_hostdata() use Add info about sensors v4l2_get_subdev_hostdata() use, to notes.txt. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit cbd5b438f8c2b5ed0af57869402320bc9891ccb5 Author: Hans de Goede Date: Sat Aug 13 11:03:23 2022 +0200 media: atomisp-ov2680: Improve ov2680_set_fmt() error handling Exit with an error on any i2c-write errors, rather then only exiting with an error when ov2680_get_intg_factor() fails. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit add7000bdd438c4195095dca7bff6877d54d06f4 Author: Yuan Can Date: Sat Sep 24 07:03:00 2022 +0000 phy: qcom-qmp-usb: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220924070300.25080-5-yuancan@huawei.com Signed-off-by: Vinod Koul commit 6d9b32fb3e432829e4f46427f334a8fc90233ef8 Author: Yuan Can Date: Sat Sep 24 07:02:59 2022 +0000 phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220924070300.25080-4-yuancan@huawei.com Signed-off-by: Vinod Koul commit 413e048a2e51bcc96667c711785b40cf742fb366 Author: Yuan Can Date: Sat Sep 24 07:02:58 2022 +0000 phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220924070300.25080-3-yuancan@huawei.com Signed-off-by: Vinod Koul commit 4c0255e7957d5a536c6da7ba08cbb46540fb5d42 Author: Yuan Can Date: Sat Sep 24 07:02:57 2022 +0000 phy: qcom-qmp-combo: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220924070300.25080-2-yuancan@huawei.com Signed-off-by: Vinod Koul commit 44a11920ac39fe7fe5191d72c0822ff2a4c3b83d Author: Hans de Goede Date: Sat Aug 13 10:30:34 2022 +0200 media: atomisp-ov2680: Don't take the input_lock for try_fmt calls. On ov2680_set_fmt() calls with format->which == V4L2_SUBDEV_FORMAT_TRY, ov2680_set_fmt() does not talk to the sensor, so there is no need to lock the dev->input_lock mutex in this case. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit adea153b4f6537f367fe77abada263fde8a1f7b6 Author: Hans de Goede Date: Sat Aug 13 10:12:39 2022 +0200 media: atomisp-ov2680: Fix ov2680_set_fmt() On sets actually store the set (closest) format inside ov2680_device.dev, so that it also properly gets returned by get_fmt. This fixes the following problem: 1. App does an VIDIOC_SET_FMT 640x480, calling ov2680_set_fmt() 2. Internal buffers (atomisp_create_pipes_stream()) get allocated at 640x480 size by atomisp_set_fmt() 3. ov2680_get_fmt() gets called later on and returns 1600x1200 since ov2680_device.dev was not updated. So things get configured to stream at 1600x1200, but the internal buffers created during atomisp_create_pipes_stream() do not get updated in size 4. streaming starts, internal buffers overflow and the entire machine freezes eventually due to memory being corrupted Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit a25a64b50e325787828007123988e09b1d2d4303 Author: Andy Shevchenko Date: Sat Jul 30 17:59:04 2022 +0200 media: atomisp_gmin_platform: Switch to use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Link: https://lore.kernel.org/r/20220730155905.90091-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Sakari Ailus Tested-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b53ad42566e0b31e295233cdc556045946929d16 Author: Krzysztof Kozlowski Date: Sun Jun 26 18:33:00 2022 +0200 media: dt-bindings: media: samsung,exynos5250-gsc: convert to dtschema Convert the Samsung Exynos SoC G-Scaler bindings to DT schema. Changes done during conversion: 1. A typical (already used) properties like clocks, iommus and power-domains. 2. Require clocks, because they are essential for the block to operate. 3. Describe the differences in clocks between the Exynos5250/5420 and the Exynos5433 G-Scalers. This includes the fifth Exynos5433 clock "gsd" (GSCL Smart Deck) which was added to the DTS, but not to the bindings and Linux driver. Similarly to Exynos5433 DECON change [1], the clock should be used. [1] https://lore.kernel.org/all/6270db2d-667d-8d6f-9289-be92da486c25@samsung.com/ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2a96b40f366abb9c07e4a5cf89434a5f45f0f1e7 Author: Krzysztof Kozlowski Date: Thu Sep 1 09:14:37 2022 +0200 media: dt-bindings: dongwoon,dw9714: convert to dtschema Convert Dongwoon Anatech DW9714 camera voice coil lens driver to DT schema and extend the bindings with vcc-supply (already used by driver) and powerdown-gpios (based on datasheet, not used by the driver). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9e3576a1ae2bb67c4d09d5e6c002fb793c300b58 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:39 2022 +0200 media: mc: convert pipeline funcs to take media_pad Now that the pipeline is stored into pads instead of entities, we can change the relevant functions to take pads instead of entities. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5b4f9a727532ff9732ffc1bceb2017260b81a0ff Author: Tomi Valkeinen Date: Wed Aug 31 16:13:38 2022 +0200 media: mc: entity: Add has_pad_interdep entity operation Add a new media entity operation, has_pad_interdep. The optional op is used to discover the pad interdependencies inside an entity during the pipeline construction. Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ae219872834a32da88408a92a4b4745c11f5a7ce Author: Laurent Pinchart Date: Wed Aug 31 16:13:37 2022 +0200 media: mc: entity: Rewrite media_pipeline_start() [Note: the code is mostly from Laurent but the patch description is from Tomi] The media_pipeline_start() and media_pipeline_stop() functions use the media graph walk API to traverse the graph and validate the pipeline. The graph walk traverses the media graph following links between the entities. Also, while the pipeline can't change between the start and stop calls, the graph is walked again from scratch at stop time, or any time a driver needs to inspect the pipeline. With the upcoming multiplexed streams support we will need a bit more intelligent pipeline construction, as e.g. two independent streams may be passing through a single entity via separate pads in which case those pads should not be part of the same pipeline. This patch essentially rewrites the media_pipeline_start/stop so that a pipeline is defined as a set of pads instead of entities and the media graph traversal considers the pad interdependencies when choosing which links to follow. Currently all the entity's pads are considered as interdependent. This means that the behavior with all the current drivers stays the same, but in the future we can define a more fine-grained pipeline construction. Additionally the media pipeline's pads are cached at media_pipeline_start() time, and re-used at media_pipeline_stop() which avoid the need to re-walk the whole graph as the previous implementation did. Also, caching pads in the pipeline can serve in the future as the foundation to provide a better API than the media graph walk to drivers to iterate over pads and entities in the pipeline. Note that the old media_pipeline_start/stop used the media graph walk API. The new version does not use the media graph walk API, but instead a new implementation. There are two reasons for not changing the graph walk: it proved to be rather difficult to change the graph walk to have the features implemented in this patch, and second, this keeps the backward compatibility of the graph walk as there are users of the graph walk API The long term plan is that all the existing code would be converted to use the new cached pipeline, thus allowing us to remove the graph walk. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit c3966ced8eb8dc53b6c8d7f97d32cc8a2107d83e Author: Dongliang Mu Date: Wed Sep 14 13:13:33 2022 +0800 phy: qualcomm: call clk_disable_unprepare in the error handling Smatch reports the following error: drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on() warn: 'uphy->cal_clk' from clk_prepare_enable() not released on lines: 58. drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on() warn: 'uphy->cal_sleep_clk' from clk_prepare_enable() not released on lines: 58. drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on() warn: 'uphy->phy_clk' from clk_prepare_enable() not released on lines: 58. Fix this by calling proper clk_disable_unprepare calls. Fixes: 0b56e9a7e835 ("phy: Group vendor specific phy drivers") Signed-off-by: Dongliang Mu Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220914051334.69282-1-dzm91@hust.edu.cn Signed-off-by: Vinod Koul commit 6eaff06ad064f5182eda361c3615a0e10c032f74 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:36 2022 +0200 media: drivers: use video_device_pipeline_alloc_start() Use video_device_pipeline_alloc_start() instead of manually allocating/managing the media pipeline storage. Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d9f4434513b499ddb8ba8617fba787b1ce98274e Author: Tomi Valkeinen Date: Wed Aug 31 16:13:35 2022 +0200 media: mc: entity: add alloc variant of pipeline_start Add new variant of media_pipeline_start(), media_pipeline_alloc_start(). media_pipeline_alloc_start() can be used by drivers that do not need to extend the media_pipeline. The function will either use the pipeline already associated with the entity, if such exists, or allocate a new pipeline. When media_pipeline_stop() is called and the pipeline's use count drops to zero, the pipeline is automatically freed. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 98d79dc34798cb5b3bdbc49cfc17ff63b3044b64 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:34 2022 +0200 media: drivers: use video_device_pipeline() Use video_device_pipeline() in the drivers instead of media_entity_pipeline(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 12cecbf9150f67b0ce7d88bc2e243e67637726c2 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:33 2022 +0200 media: drivers: use video device pipeline start/stop Convert the media drivers to use video device based pipeline start/stop where possible. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 340eba477f0e51bed997e94bd3c2b728a0c6e1ac Author: Tomi Valkeinen Date: Wed Aug 31 16:13:32 2022 +0200 media: v4l2-dev: Add videodev wrappers for media pipelines With the upcoming stream related improvements to the pipelines, the pipelines are moved from media entities to media pads. As the drivers currently use the pipelines with the entity based model, moving the pipelines to pads will cause changes to the drivers. However, most of the uses of media pipelines are related to a video device (a DMA engine) with a single pad, and thus there's never a need to support multiple pads in these use cases. We can avoid pushing the complexities of the pad based model to the drivers by adding video device wrappers for the pipeline related functions. This patch adds a number of wrappers to media_pipeline functions, all of which take a video_device as a parameter (instead of a media_entity), and verify that there's just one pad. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 72b603357ae461c0f19ca05d6624b4afd5c74b47 Author: Laurent Pinchart Date: Wed Aug 31 16:13:31 2022 +0200 media: mc: entity: Add media_entity_pipeline() to access the media pipeline Replace direct access to the pipe field in drivers with a new helper function. This will allow easier refactoring of media pipeline handling in the MC core behind the scenes without affecting drivers. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 612589a35e99fcbb7c85d8ba21b01f0249cc188d Author: Laurent Pinchart Date: Wed Aug 31 16:13:30 2022 +0200 media: mc: entity: Move media_entity_get_fwnode_pad() out of graph walk section The media_entity_get_fwnode_pad() function is unrelated to the graph traversal code that it is currently bundled with. Move it with the media_entity_remote_pad() function. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 49b38947d7841abb6e60c15968f03b2daa2d54d7 Author: Laurent Pinchart Date: Wed Aug 31 16:13:29 2022 +0200 media: mc: entity: Merge media_entity_enum_init and __media_entity_enum_init The media_entity_enum_init() function is a wrapper around __media_entity_enum_init() that turns a media_device pointer argument into the maximum entity ID in the corresponding media graph. __media_entity_enum_init() is never used outside of media_entity_enum_init(), so the two functions can be merged together. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8db465f7d6a0fb573d8f7c953d336b8470c0e831 Author: Jacopo Mondi Date: Wed Aug 31 16:13:28 2022 +0200 media: mc: entity: Add iterator helper for entity pads Add an iterator helper to easily cycle through all pads in an entity and use it in media-entity and media-device code where appropriate. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b7319e2bd7bd7740a405719727e6fc01be1363ef Author: Tomi Valkeinen Date: Wed Aug 31 16:13:27 2022 +0200 media: mc: entity: Rename streaming_count -> start_count 'streaming_count' is a bit misleading name, as the count is increased with media_pipeline_start(). Let's rename it to 'start_count' instead. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 87d36eb84d4f45657bb422af36c9eed0161cd032 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:26 2022 +0200 media: subdev: increase V4L2_FRAME_DESC_ENTRY_MAX to 8 V4L2_FRAME_DESC_ENTRY_MAX is currently set to 4. In theory it's possible to have an arbitrary amount of streams in a single pad, so preferably there should be no hardcoded maximum number. However, I believe a reasonable max is 8, which would cover a CSI-2 pad with 4 streams of pixel data and 4 streams of metadata. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit c7097c80ca684f6476a55b2e202b975cf3e36b46 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:25 2022 +0200 media: media-entity.h: add include for min() ./include/media/media-entity.h:595:34: error: implicit declaration of function ‘min’ Include minmax.h to get the definition for min(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b558ce56b434d8ca633ccc31a4acfee79a29a7a5 Author: Tomi Valkeinen Date: Wed Aug 31 16:13:24 2022 +0200 media: Documentation: mc: add definitions for stream and pipeline The doc talks about streams and pipelines, but doesn't really define them. This is an attempt to define them according to my understanding. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ac5d4d87e1eb8534c4b8148f77a0771825e780f4 Author: Sakari Ailus Date: Mon Sep 5 14:35:34 2022 +0200 media: Remove incorrect comment from struct v4l2_fwnode_endpoint struct v4l2_fwnode_endpoint was zeroed previously apart from the endpoint information itself when the endpoint properties were parsed. Now this hasn't been the case for a few years so remove the comment. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ff37bc8c7099b673e9838bfbd0de78eff740316b Author: Sakari Ailus Date: Mon Sep 5 11:52:35 2022 +0200 media: sun6i-mipi-csi2: Depend on PHY_SUN6I_MIPI_DPHY PHY_SUN6I_MIPI_DPHY is not a freely selectable option and so may not always be available. Depend on it instead. Fixes: 94d7fd9692b5 ("media: sunxi: Depend on GENERIC_PHY_MIPI_DPHY") Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 080e0b7404850406628674b07286f16cc389a892 Author: Christophe JAILLET Date: Sun Aug 7 08:43:29 2022 +0200 media: ov8865: Fix an error handling path in ov8865_probe() The commit in Fixes also introduced some new error handling which should goto the existing error handling path. Otherwise some resources leak. Fixes: 73dcffeb2ff9 ("media: i2c: Support 19.2MHz input clock in ov8865") Signed-off-by: Christophe JAILLET Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 54bb7671ca6de58929b3994468c330bedb9a3b7e Author: Sakari Ailus Date: Tue Aug 30 12:32:36 2022 +0200 media: ar0521: Fix return value check in writing initial registers The return value from register writes is ignored apart from the last value. Fix this. Reported-by: kernel test robot Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2ba3e38517f5a4ebf9c997168079dca01b7f9fc6 Author: Sakari Ailus Date: Fri Aug 26 13:53:58 2022 +0200 media: v4l: subdev: Fail graciously when getting try data for NULL state The state argument for the functions for obtaining various parts of the state is NULL if it is called by drivers for active state. Fail graciously in that case instead of dereferencing a NULL pointer. Suggested-by: Bingbu Cao Signed-off-by: Sakari Ailus Reviewed-by: Tomi Valkeinen Signed-off-by: Mauro Carvalho Chehab commit 7706630c56070f6205e8bad637472d802f883b1a Author: Yuan Can Date: Thu Sep 22 11:15:51 2022 +0000 phy: intel: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220922111551.37188-1-yuancan@huawei.com Signed-off-by: Vinod Koul commit 6177f79644a0b4434d66fcfa93568979f3778173 Author: Yuan Can Date: Thu Sep 22 09:22:43 2022 +0000 phy: tegra: xusb: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220922092243.22281-1-yuancan@huawei.com Signed-off-by: Vinod Koul commit b9eb3ab6f30bf32f7326909f17949ccb11bab514 Author: Sakari Ailus Date: Thu Aug 25 20:36:37 2022 +0200 media: ipu3-imgu: Fix NULL pointer dereference in active selection access What the IMGU driver did was that it first acquired the pointers to active and try V4L2 subdev state, and only then figured out which one to use. The problem with that approach and a later patch (see Fixes: tag) is that as sd_state argument to v4l2_subdev_get_try_crop() et al is NULL, there is now an attempt to dereference that. Fix this. Also rewrap lines a little. Fixes: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Cc: stable@vger.kernel.org # for v5.14 and later Signed-off-by: Sakari Ailus Reviewed-by: Bingbu Cao Signed-off-by: Mauro Carvalho Chehab commit 8fcccd2f37b27503694c6cd82a6c5ab911e69d73 Author: Sakari Ailus Date: Sun Aug 14 19:42:13 2022 +0200 media: ar0521: Remove redundant variable ret ret in ar0521_set_fmt is never set to values other than 0. Replace it with plain 0. Reported-by: kernel test robot Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b5f8fa876931c1adfd2c5eca5b189fd2be893238 Author: Yang Yingliang Date: Fri Jul 15 10:59:24 2022 +0200 media: ar0521: fix error return code in ar0521_power_on() Return error code if ar0521_write_regs() fails in ar0521_power_on(). Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver") Signed-off-by: Yang Yingliang Acked-by: Krzysztof Hałasa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9c6dee9ac62931987bc45add5dfe6d535a1d9f80 Author: Slark Xiao Date: Fri Jul 22 03:52:11 2022 +0200 media: i2c: mt9v111: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit bb9ea2c31fa11b789ade4c3abcdda3c5370a76ab Author: Alexander Stein Date: Fri Jul 22 09:11:31 2022 +0200 media: v4l2: Fix v4l2_i2c_subdev_set_name function documentation The doc says the I²C device's name is used if devname is NULL, but actually the I²C device driver's name is used. Fixes: 0658293012af ("media: v4l: subdev: Add a function to set an I²C sub-device's name") Signed-off-by: Alexander Stein Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 85644a9b37ec00912e2ca7bfd58ce22079dd7681 Author: Paul Elder Date: Thu Jul 21 09:41:38 2022 +0200 media: ov5640: Use runtime PM Switch to using runtime PM for power management. Make it optional, however, to support ACPI. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4b7444ff13250d2b10e940978bd72aef7a5561f2 Author: Jean-Michel Hautbois Date: Fri Jun 17 10:45:19 2022 +0200 media: staging: ipu3-imgu: Fix BNR wb gain documentation The documentation states that the BNR factor is a multiplier coded as u3.13 and with a range of (0, 8). This is not correct, as the isp is adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }. It means that a gain of 1.0 should be coded as 0. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 39434d42e87fe23bff9f39d7b7485ad7764297d1 Author: Benjamin Gaignard Date: Mon Aug 29 18:21:59 2022 +0200 media: hantro: Allows luma and chroma depth to be different Luma and chroma depth are set on different hardware registers. Even if they aren't identical the bitstream can be compliant to HEVC specifications and decoded by the hardware. With this patch TSUNEQBD_A_MAIN10_Technicolor_2 conformance test is successfully decoded. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dc39473d0340071bc04c07ba95c40f2bcf9f8ded Author: Benjamin Gaignard Date: Mon Aug 29 18:21:58 2022 +0200 media: hantro: imx8m: Enable 10bit decoding Expose 10bit pixel formats to enable 10bit decoding in IMX8M SoCs. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d040a24b5aaede6049fe27f2ea29773ada16a9e3 Author: Benjamin Gaignard Date: Mon Aug 29 18:21:57 2022 +0200 media: Hantro: HEVC: Allows 10-bit bitstream Stop limiting HEVC support to 8-bits bitstreams also accept 10-bits bitstreams. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5aa24d729999c3d80034b29fc48f9957ad61fce8 Author: Benjamin Gaignard Date: Mon Aug 29 18:21:56 2022 +0200 media: hantro: postproc: Configure output regs to support 10bit Move output format setting in postproc and make sure that 8/10bit configuration is correctly set. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f64853ad7f964b3bf7c1d63b27ca7ef972797a1c Author: Benjamin Gaignard Date: Mon Aug 29 18:21:55 2022 +0200 media: hantro: HEVC: Fix chroma offset computation The chroma offset depends of the bitstream depth. Make sure that ctx->bit_depth is used to compute it. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8a438580a09ecef78cd6c5825d628b4d5ae1c127 Author: Benjamin Gaignard Date: Mon Aug 29 18:21:54 2022 +0200 media: hantro: HEVC: Fix auxilary buffer size calculation SAO and FILTER buffers size depend of the bit depth. Make sure we have enough space for 10bit bitstreams. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4bec03301ecd81760c159402467dbb2cfd527684 Author: Benjamin Gaignard Date: Mon Aug 29 18:21:53 2022 +0200 media: hantro: Store HEVC bit depth in context Store HEVC bit depth in context. Bit depth is equal to hevc sps bit_depth_luma_minus8 + 8. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7718999356234d9cc6a11b4641bb773928f1390f Author: Hangyu Hua Date: Tue Sep 6 09:46:30 2022 +0200 media: meson: vdec: fix possible refcount leak in vdec_probe() v4l2_device_unregister need to be called to put the refcount got by v4l2_device_register when vdec_probe fails or vdec_remove is called. Signed-off-by: Hangyu Hua Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 594b6bdde2e7833a56413de5092b6e4188d33ff7 Author: Rory Liu Date: Tue Sep 6 05:30:16 2022 +0200 media: platform: cros-ec: Add Kuldax to the match table The Google Kuldax device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Rory Liu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a1f32d288224ad9cf02968819e6800f6366d0d8f Author: Lukas Bulwahn Date: Mon Sep 5 12:29:39 2022 +0200 media: MAINTAINERS: rectify entry in SAA7146 VIDEO4LINUX-2 DRIVER Commit e33fdb5a0249 ("media: saa7146: deprecate hexium_gemini/orion, mxb and ttpci") moves some media drivers to the staging subsystem, and unfortunately only partially adjusts the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. As the files matching include/media/drv-intf/saa7146* are moved to drivers/staging/media/deprecated/saa7146/common, this directory is already covered by the existing file entry drivers/staging/media/deprecated/saa7146/. Repair this file reference in SAA7146 VIDEO4LINUX-2 DRIVER. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d630f17a4efb69d9125ce66671cf87a71b8d0b69 Author: Lukas Bulwahn Date: Mon Sep 5 12:14:16 2022 +0200 media: MAINTAINERS: adjust entry to zoran driver movement Commit 2a0c28063de2 ("media: zoran: move to mainline") moves the zoran driver from the staging to the media subsystem, but does not adjust the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in ZR36067 VIDEO FOR LINUX DRIVER. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 08b91227471f85ba241707994b9cf3c006d2620e Author: ye xingchen Date: Mon Sep 5 11:02:03 2022 +0200 media: tuners: Remove the unneeded result variable Return the value xc_send_i2c_data() directly instead of storing it in another redundant variable. Signed-off-by: ye xingchen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ff464745e4576ed8670bc2fc8da27e022f0ea56c Author: Sun Ke Date: Fri Sep 2 10:58:19 2022 +0200 media: platform: mtk-mdp3: fix PM reference leak in mdp_comp_clock_on() mdp_comp_clock_on will increase runtime PM usage counter, and mdp_comp_clock_off will decrease the runtime PM usage counter. so, if mdp_comp_clock_on failed after increment runtime PM usage counter, it should decrease it before return a error code. pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. And if failed to enable clk, add pm_runtime_put() to decrease the runtime PM usage counter. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Sun Ke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dec7920e55db35ac429b002025aa1fafc0ec7d57 Author: Dan Carpenter Date: Thu Sep 1 16:47:48 2022 +0200 media: platform: mtk-mdp3: fix error code in mdp_vpu_dev_init() Return a negative error code if mdp_vpu_shared_mem_alloc() fails. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Dan Carpenter Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bf4ed9e3283b3db26089f7c265e65435af4d3e11 Author: ye xingchen Date: Thu Sep 1 09:45:07 2022 +0200 media: radio-si476x: Remove the unneeded result variable Return the value v4l2_fh_release() directly instead of storing it in another redundant variable. Signed-off-by: ye xingchen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5cd5f1344434e49a20a6e165e1cee3ead095b32e Author: Daniel Lundberg Pedersen Date: Wed Aug 31 16:54:59 2022 +0200 media: docs: libv4l-introduction.rst: Fix function signature and link v4l2_mmap returns a void*, also link to mmap instead of munmap Signed-off-by: Daniel Lundberg Pedersen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 74869a88f9d551add870412b53c2be8a192b8d12 Author: Moudy Ho Date: Wed Aug 31 10:56:04 2022 +0200 media: platform: mtk-mdp3: add pointer checks and use devm_kfree Fix two errors reported by smatch: drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c:292 mdp_probe() error: we previously assumed 'mdp' could be null drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:460 mdp_cmdq_send() error: we previously assumed 'cmd' could be null Also, avoid warnings reported by smatch: drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:872 mdp_comp_create() warn: passing devm_ allocated variable to kfree. 'comp' [hverkuil: fix devm_kfree call] Signed-off-by: Moudy Ho Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 74997c55aafc105dfc8ef62f3c9979cccbcd8dff Author: Linus Walleij Date: Tue Aug 30 23:28:06 2022 +0200 media: si4713: Use the right include The driver includes the legacy header but uses . Cc: Dinesh Ram Cc: Eduardo Valentin Signed-off-by: Linus Walleij Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f001cc8dc16e966e9f0b1e91a5e9264b7da550b4 Author: Linus Walleij Date: Tue Aug 30 23:11:10 2022 +0200 media: i2c: isl7998x: Use right include This driver is using GPIO descriptors but uses the legacy include header . Fix it by including the intended . Cc: Marek Vasut Signed-off-by: Linus Walleij Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 479747caa5bfa94b856bf47249006e6c8aa8be37 Author: Hans Verkuil Date: Tue Aug 30 12:37:24 2022 +0200 media: cec: add support for Absolute Volume Control Add support for this new CEC message. This was added in HDMI 2.1a. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 20694e96ca089ce6693c2348f8f628ee621e4e74 Author: Hans Verkuil Date: Tue Aug 30 07:59:24 2022 +0200 media: dvb-frontends/drxk: initialize err to 0 Fix a compiler warning: drivers/media/dvb-frontends/drxk_hard.c: In function 'drxk_read_ucblocks': drivers/media/dvb-frontends/drxk_hard.c:6673:21: warning: 'err' may be used uninitialized [-Wmaybe-uninitialized] 6673 | *ucblocks = (u32) err; | ^~~~~~~~~ drivers/media/dvb-frontends/drxk_hard.c:6663:13: note: 'err' was declared here 6663 | u16 err; | ^~~ Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cd75981ec93a3abf717d0182ff5d56b650873215 Author: Hans Verkuil Date: Mon Aug 29 16:05:14 2022 +0200 media: v4l2-ctrls: drop 'elems' argument from control type ops. The type ops for equal, init and validate have an elems argument, but this can be taken from struct v4l2_ctrl: ctrl->elems for equal and init, and ctrl->new_elems for validate (since you are validating a new control value). So drop this argument and update all callers. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d91d7bc85062309aae6d8064563ddf17947cb6bc Author: Ming Qian Date: Mon Aug 29 07:33:16 2022 +0200 media: amphion: release m2m ctx when releasing vpu instance release m2m ctx in the callback function that release the vpu instance, then there is no need to add lock around releasing m2m ctx. Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support") Signed-off-by: Ming Qian Reviewed-by: Tommaso Merciai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cfeacb5d46ed9c747cad7fdffc254afced50c1ef Author: Philipp Zabel Date: Thu Aug 25 12:41:49 2022 +0200 media: coda: jpeg: drop coda9_jpeg_dec_huff_setup() return value coda9_jpeg_dec_huff_setup() never returns anything but 0. Drop return value and superfluous error handling at the call site. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2d0c052c09d5a074f4806d60b20b0addd8561994 Author: Jilin Yuan Date: Wed Aug 24 15:27:42 2022 +0200 media: pci/cx18: fix repeated words in comments Delete the redundant word 'is'. Signed-off-by: Jilin Yuan Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9dcd063656a9225c8ac6341c0931b34ceebf9214 Author: Jilin Yuan Date: Wed Aug 24 15:13:50 2022 +0200 media: usb/dvb-usb-v2: fix repeated words in comments Delete the redundant word 'my'. Signed-off-by: Jilin Yuan Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 91d0092a6958640c362d0913ed6f933e514eee68 Author: Jilin Yuan Date: Wed Aug 24 15:10:16 2022 +0200 media: usb/msi2500: fix repeated words in comments Delete the redundant word 'for'. Signed-off-by: Jilin Yuan Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2dc73b48665411a08c4e5f0f823dea8510761603 Author: Hans Verkuil Date: Wed Aug 24 09:06:19 2022 +0200 media: cros-ec-cec: limit msg.len to CEC_MAX_MSG_SIZE I expect that the hardware will have limited this to 16, but just in case it hasn't, check for this corner case. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 93f65ce036863893c164ca410938e0968964b26c Author: Hans Verkuil Date: Wed Aug 24 09:02:42 2022 +0200 media: s5p_cec: limit msg.len to CEC_MAX_MSG_SIZE I expect that the hardware will have limited this to 16, but just in case it hasn't, check for this corner case. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c53e3a049f35978a150526671587fd46b1ae7ca1 Author: Laurent Pinchart Date: Tue Aug 23 17:11:36 2022 +0200 media: rkisp1: Zero v4l2_subdev_format fields in when validating links The local sd_fmt variable in rkisp1_capture_link_validate() has uninitialized fields, which causes random failures when calling the subdev .get_fmt() operation. Fix it by initializing the variable when declaring it, which zeros all other fields. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 4b07e2b8f7b53e929a483320cd6c9c1cbd76e329 Author: Laurent Pinchart Date: Wed Aug 17 01:53:57 2022 +0200 media: rkisp1: Configure LSC after enabling the ISP The ISP8000Nano v18.02 (found in the i.MX8MP) requires the ISP to be enabled (as indicated by the ISP_CTRL.ISP_ENABLE bit) to configure the lens shading table in internal RAM. The driver currently configures all ISP initial parameters before enabling the ISP, which causes the LSC RAM to not be initialized properly. To fix this, split the rkisp1_params_configure() function into a rkisp1_params_pre_configure() and a rkisp1_params_post_configure(). The former configures all ISP parameters but LSC, while the latter configures LSC. To implement this, the rkisp1_params_apply_params_cfg() function is deconstructed, with two small helpers created to deal with the parameters buffers, which are then used in rkisp1_params_isr(), rkisp1_params_pre_configure() and rkisp1_params_post_configure(). While this initialization ordering is only needed for the ISP8000Nano v18.02, it doesn't affect other ISP versions negatively, and can thus be followed unconditionally. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 4c3501f13e8e60f6e7e7308c77ac4404e1007c18 Author: Laurent Pinchart Date: Wed Aug 17 01:53:57 2022 +0200 media: rkisp1: Use correct macro for gradient registers The rkisp1_lsc_config() function incorrectly uses the RKISP1_CIF_ISP_LSC_SECT_SIZE() macro for the gradient registers. Replace it with the correct macro, and rename it from RKISP1_CIF_ISP_LSC_GRAD_SIZE() to RKISP1_CIF_ISP_LSC_SECT_GRAD() as the corresponding registers store the gradients for each sector, not a size. This doesn't cause any functional change as the two macros are defined identically (the size and gradient registers store fields in the same number of bits at the same positions). Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 10e36b2191401ffe98373e144580e0a9288e71e9 Author: Laurent Pinchart Date: Wed Aug 17 01:53:57 2022 +0200 media: rkisp1: Simplify LSC x/y size and grad register macros The LSC module x/y size and grad configuration is stored in a set of 4 indexed registers each. The rkisp1-regs.h header defines all those registers, but only the first one in each set is used, with manual calculation of addresses of subsequent registers. Simplifies this by merging all 4 register macros into one that takes the index as a parameter. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit da57dffa098c8d8e46cda4c891e106bdc849712d Author: Laurent Pinchart Date: Wed Aug 17 01:53:57 2022 +0200 media: rkisp1: Store LSC register values in u32 variables Use the u32 type instead of unsigned int to store register values in the LSC configuration code, to make the variables' size more explicit. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit cf655faff5815986bb4393c303590f6f432644bb Author: Laurent Pinchart Date: Wed Aug 17 01:53:57 2022 +0200 media: rkisp1: Clean up LSC configuration code Clean up the LSC configuration code to improve its readability by shortening lines, using extra local variables and renaming long variables. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit faab2929515224f32a3cc080e8a6d44ae6e0d4ec Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Allow setting color space on resizer sink pad The resizer doesn't deal with color spaces, so it can accept any color space on its input, and propagates it unchanged to its output. When operating with a Bayer input format (in pass-through mode) further restrict the YCbCr encoding and quantization to Rec 601 and full range respectively, as for raw data the former ought to be ignored and the latter is always full range. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 83b9296e399367862845d3b19984444fc756bd61 Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Initialize color space on resizer sink and source pads Initialize the four color space fields on the sink and source video pads of the resizer in the .init_cfg() operation. The resizer can't perform any color space conversion, so set the sink and source color spaces to the same defaults, which match the ISP source video pad default. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 668dc8afce43d4bc01feb3e929d6d5ffcb14f899 Author: Yuan Can Date: Thu Sep 22 11:12:28 2022 +0000 phy: qcom-snps: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220922111228.36355-8-yuancan@huawei.com Signed-off-by: Vinod Koul commit 72f1f6085a731efb655ba6308e1ac54b787b416f Author: Yuan Can Date: Thu Sep 22 11:12:27 2022 +0000 phy: qcom-qusb2: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220922111228.36355-7-yuancan@huawei.com Signed-off-by: Vinod Koul commit a548b6b4e4d9de38ec9603608875aad914382cb8 Author: Yuan Can Date: Thu Sep 22 11:12:24 2022 +0000 phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20220922111228.36355-4-yuancan@huawei.com Signed-off-by: Vinod Koul commit f7aa2d234377c8e69bfcc52d7384b784ab513460 Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Configure CSM based on YCbCr encoding The driver currently only implements the Rec. 601 YCbCr encoding, extend it with support for the other encodings defined by V4L2 (Rec. 709, Rec. 2020 and SMPTE240m). The coefficients have been calculated by rounding the floating point values to the nearest Q1.7 fixed-point value, adjusting the rounding to ensure that the sum of each line in the matrix is preserved to avoid overflows. At the hardware level, the RGB to YUV conversion matrix is fully configurable, custom encoding could be supported by extending the ISP parameters if desired. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Reviewed-by: Paul Elder Signed-off-by: Mauro Carvalho Chehab commit 711d91497e203b058cf0a08c0f7d41c04efbde76 Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Don't pass the quantization to rkisp1_csm_config() The rkisp1_csm_config() function takes a pointer to the rkisp1_params structure which contains the quantization value. There's no need to pass it separately to the function. Drop it from the function parameters. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Reviewed-by: Paul Elder Signed-off-by: Mauro Carvalho Chehab commit 81303962da12a1dbb7f81779c2847d055779c46b Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Configure quantization using ISP source pad The rkisp1_config_isp() function uses the format on the sink pad of the ISP to configure quantization at the output of the ISP. This is incorrect, as hinted by the src_frm variable name that stores the format. Fix it by using the source pad. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Reviewed-by: Paul Elder Signed-off-by: Mauro Carvalho Chehab commit c1ec5efba08079820b0bfc5149891f364934440d Author: Laurent Pinchart Date: Sat Aug 13 00:56:22 2022 +0200 media: rkisp1: Allow setting all color space fields on ISP source pad The ISP output color space is configured through the ISP source pad. At the moment, only the quantization can be set. Extend it to the three other color space fields: - The ycbcr_enc field will be used to configure the RGB to YUV matrix (currently hardcoded to Rec. 601). - The colorspace (which controls the color primaries) and xfer_func fields will not be used to configure the ISP, as the corresponding hardware blocks (the cross-talk RGB to RGB matrix and the tone mapping curve) are programmed directly by applications through ISP parameters. Nonetheless, those two fields should be set by applications to match the ISP configuration, in order to propagate the correct color space down the pipeline up to the capture video nodes. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit cb00f3a4421d5c7d7155bd4bded7fb2ff8eec211 Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Fix source pad format configuration The ISP converts Bayer data to YUV when operating normally, and can also operate in pass-through mode where the input and output formats must match. Converting from YUV to Bayer isn't possible. If such an invalid configuration is attempted, adjust it by copying the sink pad media bus code to the source pad. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Reviewed-by: Paul Elder Signed-off-by: Mauro Carvalho Chehab commit 6844cebbf60ac61296a96f1bf57966f98d8d2d6a Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Allow setting color space on ISP sink pad The ISP accepts different color spaces on its input: for YUV input, it doesn't set any restrictions, and for Bayer inputs, any color primaries or transfer function can be accepted (YCbCr encoding isn't applicable there, and quantization range can only be full). Allow setting a color space on the ISP sink pad, with the aforementioned restrictions. The settings don't influence hardware yet (only the YUV quantization range will, anything else has no direct effect on the ISP configuration), but can already be set to allow color space information to be coherent across the ISP sink link. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 87bfaa1a167be995d6dfacde08adb7e32f06d558 Author: Laurent Pinchart Date: Sat Aug 13 00:44:14 2022 +0200 media: rkisp1: Initialize color space on ISP sink and source pads Initialize the four color space fields on the sink and source video pads of the ISP in the .init_cfg() operation. As the main use case for the ISP is to convert Bayer data to YUV, select a raw color space on the sink pad and a limited range quantization of SYCC on the source pad by default. Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld Reviewed-by: Paul Elder Signed-off-by: Mauro Carvalho Chehab commit 8e2b7442d27ca2a56a116d44d597e77ca21dfed3 Author: Laurent Pinchart Date: Thu Jun 9 12:31:13 2022 +0200 media: rockchip: rkisp1: Define macros for DPCC configurations in UAPI Extend the UAPI rkisp1-config.h header with macros for all DPCC configuration fields. While at it, clarify of fix issues in the DPCC documentation. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 71d7b6e51ad3370d850303b61b79528fb2872f0a Author: Niklas Cassel Date: Wed Sep 21 17:57:52 2022 +0200 ata: libata-eh: avoid needless hard reset when revalidating link Performing a revalidation on a AHCI controller supporting LPM, while using a lpm mode of e.g. med_power_with_dip (hipm + dipm) or medium_power (hipm), will currently always lead to a hard reset. The expected behavior is that a hard reset is only performed when revalidate fails, because the properties of the drive has changed. A revalidate performed after e.g. a NCQ error, or such a simple thing as disabling write-caching (hdparm -W 0 /dev/sda), should succeed on the first try (and should therefore not cause the link to be reset). This unwarranted hard reset happens because ata_phys_link_offline() returns true for a link that is in deep sleep. Thus the call to ata_phys_link_offline() in ata_eh_revalidate_and_attach() will cause the revalidation to fail, which causes ata_eh_handle_dev_fail() to be called, which will set ehc->i.action |= ATA_EH_RESET, such that the link is reset before retrying revalidation. When the link is reset, the link is reestablished, so when ata_eh_revalidate_and_attach() is called the second time, directly after the link has been reset, ata_phys_link_offline() will return false, and the revalidation will succeed. Looking at "8.3.1.3 HBA Initiated" in the AHCI 1.3.1 specification, it is clear the when host software writes a new command to memory, by setting a bit in the PxCI/PxSACT HBA port registers, the HBA will automatically bring back the link before sending out the Command FIS. However, simply reading a SCR (like ata_phys_link_offline() does), will not cause the HBA to automatically bring back the link. As long as hipm is enabled, the HBA will put an idle link into deep sleep. Avoid this needless hard reset on revalidation by temporarily disabling hipm, by setting the LPM mode to ATA_LPM_MAX_POWER. After revalidation is complete, ata_eh_recover() will restore the link policy by setting the LPM mode to ap->target_lpm_policy. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit a270cc137ba942af554c18db551b9487f04f43a4 Author: Dan Carpenter Date: Thu Sep 22 14:21:07 2022 +0300 phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe() These two error paths need to call of_node_put(child_node) before returning. Fixes: edd473d4293a ("phy: ti: phy-j721e-wiz: add support for j7200-wiz-10g") Fixes: 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver") Signed-off-by: Dan Carpenter Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/YyxFI8aW23IC/21U@kili Signed-off-by: Vinod Koul commit 60d9b6aaabe827e5ed025355e7d4622f6506b91e Author: Chunfeng Yun Date: Tue Sep 20 17:00:38 2022 +0800 phy: mediatek: mipi: remove register access helpers Remove private register access helpers, use the common ones instead. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-19-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 5f88a93b5aa9bbc85831877c456a9114ba67ea4a Author: Chunfeng Yun Date: Tue Sep 20 17:00:37 2022 +0800 phy: mediatek: mipi: mt8183: use common helper to access registers Use MediaTek phy's common helper to access registers, then we can remove mipi-dsi's I/O helpers. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-18-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit d36d69a5517bb4e90a6ba07b043806bffffe19fb Author: Chunfeng Yun Date: Tue Sep 20 17:00:36 2022 +0800 phy: mediatek: mipi: mt8183: use GENMASK to generate bits mask Use GENMASK() macro to generate bits mask Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-17-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit bd4ba730ff28985c0ecb49da1c6f18488666aa4f Author: Chunfeng Yun Date: Tue Sep 20 17:00:35 2022 +0800 phy: mediatek: mipi: mt8173: use common helper to access registers Use MediaTek phy's common helper to access registers, then we can remove mipi-dsi's I/O helpers. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-16-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 993aa53ed076a987842be2943dba46b6099d8ec3 Author: Chunfeng Yun Date: Tue Sep 20 17:00:34 2022 +0800 phy: mediatek: mipi: mt8173: use FIELD_PREP to prepare bits field Use FIELD_PREP() macro to prepare bits field value, then no need define macros of bits offset. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-15-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 7bd72714327d4783f82ccce12f611b415cbee0d5 Author: Chunfeng Yun Date: Tue Sep 20 17:00:33 2022 +0800 phy: mediatek: mipi: mt8173: use GENMASK to generate bits mask Use GENMASK() macro to generate bits mask Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-14-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 299a9c72ac7a4ac54cd0482c7d7829f482a88851 Author: Chunfeng Yun Date: Tue Sep 20 17:00:32 2022 +0800 phy: mediatek: hdmi: remove register access helpers Remove private register access helpers, use the common ones instead. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-13-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 0fb5e57e67b299eed2859614f4229f40c6c19cfc Author: Chunfeng Yun Date: Tue Sep 20 17:00:31 2022 +0800 phy: mediatek: hdmi: mt8173: use common helper to access registers Use MediaTek phy's common helper to access registers, then we can remove hdmi's I/O helpers. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-12-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 309b4fec539cee6fe7a52938fbfdb6a893237cbd Author: Chunfeng Yun Date: Tue Sep 20 17:00:30 2022 +0800 phy: mediatek: hdmi: mt8173: use FIELD_PREP to prepare bits field Use FIELD_PREP() macro to prepare bits field value, then no need define macros of bits offset. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-11-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit a8a78274c6b4ce7af1616ff29551e1808ffa43bb Author: Chunfeng Yun Date: Tue Sep 20 17:00:29 2022 +0800 phy: mediatek: hdmi: mt8173: use GENMASK to generate bits mask Use GENMASK() macro to generate bits mask Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-10-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit cff81a618a53491c783bd798da304c085851361b Author: Chunfeng Yun Date: Tue Sep 20 17:00:28 2022 +0800 phy: mediatek: hdmi: mt2701: use common helper to access registers Use MediaTek phy's common helper to access registers, then we can remove hdmi's I/O helpers. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-9-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit a98d935eacc75a6e956045bdef91c7c2dad729f6 Author: Chunfeng Yun Date: Tue Sep 20 17:00:27 2022 +0800 phy: mediatek: hdmi: mt2701: use FIELD_PREP to prepare bits field Use FIELD_PREP() macro to prepare bits field value, then no need define macros of bits offset. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-8-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit b0870c0151440121e78586c7681c5599a1e4eba8 Author: Chunfeng Yun Date: Tue Sep 20 17:00:26 2022 +0800 phy: mediatek: hdmi: mt2701: use GENMASK and BIT to generate mask and bits Use GENMASK() and BIT() macros to generate mask and bits Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-7-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit d87f2b83739bdfdb5d2787886e247e5a174b4e90 Author: Chunfeng Yun Date: Tue Sep 20 17:00:25 2022 +0800 phy: mediatek: pcie: use new helper to update register bits The new helper will use FIELD_PREP() macro to prepare bits value according to mask, then we no need do it anymore. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-6-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 2b0c0043846c5c06d52f45f089f7996371359718 Author: Chunfeng Yun Date: Tue Sep 20 17:00:24 2022 +0800 phy: mediatek: ufs: use common register access helpers No need define private register access helpers, use common ones defined in phy-mtk-io.h Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220920090038.15133-5-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit c221baa355483548fb01456442615a838e66aec6 Author: Chunfeng Yun Date: Tue Sep 20 17:00:23 2022 +0800 phy: mediatek: xsphy: remove macros used to prepare bitfield value Prefer to make use of FIELD_PREP() macro to prepare bitfield value, then no need local ones anymore. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220920090038.15133-4-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 6b5ef194611e581b7da2bf0f7d3ad3950b2aaba3 Author: Chunfeng Yun Date: Tue Sep 20 17:00:22 2022 +0800 phy: mediatek: tphy: remove macros to prepare bitfield value Prefer to make use of FIELD_PREP() macro to prepare bitfield value, then no need local ones anymore. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220920090038.15133-3-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 29c07477556eb68a64f0ff53235feb0bd1cf1f63 Author: Chunfeng Yun Date: Tue Sep 20 17:00:21 2022 +0800 phy: mediatek: add a new helper to update bitfield Due to FIELD_PREP() macro can be used to prepare a bitfield value, local ones can be remove; add the new helper to make bitfield update easier. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220920090038.15133-2-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 8d9dcfff7b1c6b5c4264d91b193336c6f6df9b53 Author: Andy Shevchenko Date: Thu Sep 22 17:32:40 2022 +0300 thunderbolt: Use dev_err_probe() Unify error message format by using dev_err_probe(). While at it, use temporary variable for device in the rest of the messaging calls. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg commit 8283fb57e46246ae998c6961c89a76ef7f14c6d9 Author: Andy Shevchenko Date: Thu Sep 22 17:32:39 2022 +0300 thunderbolt: Convert to use sysfs_emit()/sysfs_emit_at() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. While at it, use Elvis operator in some cases. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg commit 9daa2b843f046de6d7113890838155f02c2e60a5 Author: Laurent Pinchart Date: Thu Jun 9 12:31:13 2022 +0200 media: rockchip: rkisp1: Mask invalid bits in DPCC parameters Restrict the DPCC configuration that can be set by userspace to valid register bits. To do so, reorganize the related register macros to define valid bitmasks, as well as bits of the DPCC mode register. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 596fa6e71896e632832804a9648aa123af4afef9 Author: Laurent Pinchart Date: Thu Jun 9 12:31:13 2022 +0200 media: rockchip: rkisp1: Set DPCC methods enable bits inside loop The rkisp1_dpcc_config() function looks over methods sets to configure them, but sets the RKISP1_CIF_ISP_DPCC_METHODS_SET_* registers outside of the loop with hand-unrolled code. Move this to the loop to simplify the code. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit 20b794ddce475ed012deb365000527c17b3e93e6 Author: Sean Young Date: Fri Sep 2 12:32:21 2022 +0200 media: mceusb: set timeout to at least timeout provided By rounding down, the actual timeout can be lower than requested. As a result, long spaces just below the requested timeout can be incorrectly reported as timeout and truncated. Fixes: 877f1a7cee3f ("media: rc: mceusb: allow the timeout to be configurable") Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 2dfe2c4f1720b6b0860d36d25107ffa57f0bbc63 Author: ye xingchen Date: Tue Aug 30 10:30:27 2022 +0200 media: imon: Remove the unneeded result variable Return the value send_packet() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 41fd1cb6151439b205ac7611883d85ae14250172 Author: Alan Stern Date: Fri Aug 26 21:31:40 2022 +0200 media: mceusb: Use new usb_control_msg_*() routines Automatic kernel fuzzing led to a WARN about invalid pipe direction in the mceusb driver: ------------[ cut here ]------------ usb 6-1: BOGUS control dir, pipe 80000380 doesn't match bRequestType 40 WARNING: CPU: 0 PID: 2465 at drivers/usb/core/urb.c:410 usb_submit_urb+0x1326/0x1820 drivers/usb/core/urb.c:410 Modules linked in: CPU: 0 PID: 2465 Comm: kworker/0:2 Not tainted 5.19.0-rc4-00208-g69cb6c6556ad #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Workqueue: usb_hub_wq hub_event RIP: 0010:usb_submit_urb+0x1326/0x1820 drivers/usb/core/urb.c:410 Code: 7c 24 40 e8 ac 23 91 fd 48 8b 7c 24 40 e8 b2 70 1b ff 45 89 e8 44 89 f1 4c 89 e2 48 89 c6 48 c7 c7 a0 30 a9 86 e8 48 07 11 02 <0f> 0b e9 1c f0 ff ff e8 7e 23 91 fd 0f b6 1d 63 22 83 05 31 ff 41 RSP: 0018:ffffc900032becf0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8881100f3058 RCX: 0000000000000000 RDX: ffffc90004961000 RSI: ffff888114c6d580 RDI: fffff52000657d90 RBP: ffff888105ad90f0 R08: ffffffff812c3638 R09: 0000000000000000 R10: 0000000000000005 R11: ffffed1023504ef1 R12: ffff888105ad9000 R13: 0000000000000040 R14: 0000000080000380 R15: ffff88810ba96500 FS: 0000000000000000(0000) GS:ffff88811a800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffe810bda58 CR3: 000000010b720000 CR4: 0000000000350ef0 Call Trace: usb_start_wait_urb+0x101/0x4c0 drivers/usb/core/message.c:58 usb_internal_control_msg drivers/usb/core/message.c:102 [inline] usb_control_msg+0x31c/0x4a0 drivers/usb/core/message.c:153 mceusb_gen1_init drivers/media/rc/mceusb.c:1431 [inline] mceusb_dev_probe+0x258e/0x33f0 drivers/media/rc/mceusb.c:1807 The reason for the warning is clear enough; the driver sends an unusual read request on endpoint 0 but does not set the USB_DIR_IN bit in the bRequestType field. More importantly, the whole situation can be avoided and the driver simplified by converting it over to the relatively new usb_control_msg_recv() and usb_control_msg_send() routines. That's what this fix does. Reported-and-tested-by: Rondreis Link: https://lore.kernel.org/all/CAB7eexLLApHJwZfMQ=X-PtRhw0BgO+5KcSMS05FNUYejJXqtSA@mail.gmail.com/ Signed-off-by: Alan Stern Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 9d943961912cdbbe33d04ca0144b27997f890d10 Author: Johan Hovold Date: Tue Sep 20 09:38:26 2022 +0200 phy: qcom-qmp-combo: drop redundant DP config flag Drop the DP_COM control block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-18-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit a73a19ea382830cf27c49b9dda5aefe84c442a08 Author: Johan Hovold Date: Tue Sep 20 09:38:25 2022 +0200 phy: qcom-qmp-usb: consolidate lane config For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose. Replace them both with a new field simply named "lanes". Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-17-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 07d386bf6d50a8a0e8e430a97c5efad616385fb0 Author: Johan Hovold Date: Tue Sep 20 09:38:24 2022 +0200 phy: qcom-qmp-ufs: consolidate lane config For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has. Replace them both with a new field simply named "lanes". Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-16-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 099155615ac2ddb457bd8462038901c162e2cb96 Author: Johan Hovold Date: Tue Sep 20 09:38:23 2022 +0200 phy: qcom-qmp-combo: consolidate lane config For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose. Replace them both with a new field simply named "lanes". Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-15-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 0d316ce5c0491410db8031a36d561f966995eea9 Author: Johan Hovold Date: Tue Sep 20 09:38:22 2022 +0200 phy: qcom-qmp-pcie-msm8996: rename nlanes config The nlanes configuration parameter is really the number of PHYs provided by this QMP block on MSM8996. Rename it accordingly. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-14-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit f02543fa5b2c96cc7196e40992e5b715aa4e6cfc Author: Johan Hovold Date: Tue Sep 20 09:38:21 2022 +0200 phy: qcom-qmp-pcie: consolidate lane config For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has. Replace them both with a new field simply named "lanes". Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-13-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit b4e9da4d961faeae3c76ecbc26057f7d00965498 Author: Johan Hovold Date: Tue Sep 20 09:38:20 2022 +0200 phy: qcom-qmp: drop unused index field Only the MSM8996 PCIe QMP driver uses the index field so drop it from the other drivers. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-12-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit a4683acfa4fb964cab6ac4f486a18095a7bb3131 Author: Johan Hovold Date: Tue Sep 20 09:38:19 2022 +0200 phy: qcom-qmp-pcie: drop unused config field Drop the unused mask_com_pcs_ready field from struct qmp_phy_cfg. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-11-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 96da759b5306f8600b44fab81f1816daaab07651 Author: Johan Hovold Date: Tue Sep 20 09:38:18 2022 +0200 phy: qcom-qmp-pcie: drop unused mode field Drop the unused mode field from struct qmp_phy. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-10-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 7dbea6093d540fa5c8320ae9d024f2eae7314d22 Author: Johan Hovold Date: Tue Sep 20 09:38:17 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused kernel doc Drop the removed mode field from the struct qmp_phy kernel doc. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-9-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ec1f303b3eeda24aa78f91a3fd2eb5b09b182783 Author: Johan Hovold Date: Tue Sep 20 09:38:16 2022 +0200 phy: qcom-qmp: drop unused forward declarations Only the combo QMP driver needs a forward declaration of struct qmp_phy. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-8-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit fe2da191f125d299835e0bb299e7b35f68aa26e6 Author: Johan Hovold Date: Tue Sep 20 09:38:15 2022 +0200 phy: qcom-qmp-usb: drop init and exit wrappers Drop the unnecessary PHY init and exit callback wrappers. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-7-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 91174e2c52ea9b5069ee04cffbdfa14837a5b761 Author: Johan Hovold Date: Tue Sep 20 09:38:14 2022 +0200 phy: qcom-qmp-pcie: drop init and exit wrappers Drop the unnecessary PHY init and exit callback wrappers. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-6-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 44d1b5ad174c56b9257b18ece93afdad78c35b05 Author: Johan Hovold Date: Tue Sep 20 09:38:13 2022 +0200 phy: qcom-qmp-usb: drop unused type from config The configuration PHY type is no longer needed since the QMP driver split so drop it from the configuration and suspend callbacks. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-5-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 877f3debb33e16f120133c00e62b3525e324e611 Author: Johan Hovold Date: Tue Sep 20 09:38:12 2022 +0200 phy: qcom-qmp-ufs: drop unused type from config The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 7a114df1f2a305d0b0b6855a029384ea628319a5 Author: Johan Hovold Date: Tue Sep 20 09:38:11 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused type from config The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 61ab46fe2a5bf0e04fb61f337c873b47ab4c9a52 Author: Johan Hovold Date: Tue Sep 20 09:38:10 2022 +0200 phy: qcom-qmp-pcie: drop unused type from config The configuration PHY type is no longer used since the QMP driver split so drop it from the configurations. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220920073826.20811-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 7d37539037c2fca70346fbedc219f655253d5cff Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 fuse: implement ->tmpfile() This is basically equivalent to the FUSE_CREATE operation which creates and opens a regular file. Add a new FUSE_TMPFILE operation, otherwise just reuse the protocol and the code for FUSE_CREATE. Acked-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 863f144f12add1f4eab80b70561a90857c524a8b Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 vfs: open inside ->tmpfile() This is in preparation for adding tmpfile support to fuse, which requires that the tmpfile creation and opening are done as a single operation. Replace the 'struct dentry *' argument of i_op->tmpfile with 'struct file *'. Call finish_open_simple() as the last thing in ->tmpfile() instances (may be omitted in the error case). Change d_tmpfile() argument to 'struct file *' as well to make callers more readable. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 9751b338656f05a0ce918befd5118fcd970c71c6 Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 vfs: move open right after ->tmpfile() Create a helper finish_open_simple() that opens the file with the original dentry. Handle the error case here as well to simplify callers. Call this helper right after ->tmpfile() is called. Next patch will change the tmpfile API and move this call into tmpfile instances. Signed-off-by: Miklos Szeredi commit 3e9d4c593558ea86f49e10e62373a54c7f5a63e4 Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 vfs: make vfs_tmpfile() static No callers outside of fs/namei.c anymore. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 2b1a77461f1602f870d6fe61fc65610bb8c8dd05 Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 ovl: use vfs_tmpfile_open() helper If tmpfile is used for copy up, then use this helper to create the tmpfile and open it at the same time. This will later allow filesystems such as fuse to do this operation atomically. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 24a81759b65fa85767739999d91523691c5e2ea5 Author: Miklos Szeredi Date: Sat Sep 24 07:00:00 2022 +0200 cachefiles: use vfs_tmpfile_open() helper Use the vfs_tmpfile_open() helper instead of doing tmpfile creation and opening separately. The only minor difference is that previously no permission checking was done, while vfs_tmpfile_open() will call may_open() with zero access mask (i.e. no access is checked). Even if this would make a difference with callers caps (don't see how it could, even in the LSM codepaths) cachfiles raises caps before performing the tmpfile creation, so this extra permission check will not result in any regression. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 08d7a6fb7e44ae0f54f7903888dc41e31dfbc9da Author: Miklos Szeredi Date: Sat Sep 24 06:59:59 2022 +0200 cachefiles: only pass inode to *mark_inode_inuse() helpers The only reason to pass dentry was because of a pr_notice() text. Move that to the two callers where it makes sense and add a WARN_ON() to the third. file_inode(file) is never NULL on an opened file. Remove check in cachefiles_unmark_inode_in_use(). Do not open code cachefiles_do_unmark_inode_in_use() in cachefiles_put_directory(). Signed-off-by: Miklos Szeredi commit 38017d44441efa695997d4f09d09d9d312f40088 Author: Miklos Szeredi Date: Sat Sep 24 06:59:59 2022 +0200 cachefiles: tmpfile error handling cleanup Separate the error labels from the success path and use 'ret' to store the error value before jumping to the error label. Signed-off-by: Miklos Szeredi commit 19ee5345f23423d5bbd84a59112433592d584b4c Author: Al Viro Date: Sat Sep 24 06:59:59 2022 +0200 hugetlbfs: cleanup mknod and tmpfile Duplicate the few lines that are shared between hugetlbfs_mknod() and hugetlbfs_tmpfile(). This is a prerequisite for sanely changing the signature of ->tmpfile(). Signed-off-by: Al Viro Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 22873deac9e7b273bbf17eee515c8170510d861a Author: Miklos Szeredi Date: Sat Sep 24 06:59:59 2022 +0200 vfs: add vfs_tmpfile_open() helper This helper unifies tmpfile creation with opening. Existing vfs_tmpfile() callers outside of fs/namei.c will be converted to using this helper. There are two such callers: cachefile and overlayfs. The cachefiles code currently uses the open_with_fake_path() helper to open the tmpfile, presumably to disable accounting of the open file. Overlayfs uses tmpfile for copy_up, which means these struct file instances will be short lived, hence it doesn't really matter if they are accounted or not. Disable accounting in this helper too, which should be okay for both callers. Add MAY_OPEN permission checking for consistency. Like for create(2) read/write permissions are not checked. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 9258b8b1be2e1e241baf8aa703aba1086069ee0f Author: Eric Dumazet Date: Thu Sep 22 09:50:36 2022 -0700 ipv6: tcp: send consistent autoflowlabel in RST packets Blamed commit added a txhash parameter to tcp_v6_send_response() but forgot to update tcp_v6_send_reset() accordingly. Fixes: aa51b80e1af4 ("ipv6: tcp: send consistent autoflowlabel in SYN_RECV state") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220922165036.1795862-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 99d01d74814153682b95127e1f25dbdfa3ebfae2 Merge: 4dfa5f05fffac 92073b1648cb6 Author: Jakub Kicinski Date: Fri Sep 23 20:56:31 2022 -0700 Merge branch 'net-ipa-another-set-of-cleanups' Alex Elder says: ==================== net: ipa: another set of cleanups This series contains another set of cleanups done in preparation for an upcoming series that reworks how IPA registers and their fields are defined. The first replaces the use of u32_replace_bits() with a simple logical AND operation in two places. The second creates a new function to encapsulate some common code, and renames another for consistency. The third restructures two other functions that do similar things to make their similarity more obvious. The fourth defines the flag bits in a register using an enumerated type. And the fifth updates "ipa_reg.h" so the values assigned to enumerated type members are aligned consistently. The last three encapsulate the code that assigns values to a few registers into separate functions. ==================== Link: https://lore.kernel.org/r/20220922222100.2543621-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 92073b1648cb64f5e62b33515d3100fa1ad10ade Author: Alex Elder Date: Thu Sep 22 17:21:00 2022 -0500 net: ipa: encapsulate updating three more registers Create a new function that encapsulates setting the BCR, TX_CFG, and CLKON_CFG register values during hardware configuration. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 1e5db0965ef5199f360138a81652fef7bc12fcb4 Author: Alex Elder Date: Thu Sep 22 17:20:59 2022 -0500 net: ipa: encapsulate updating the COUNTER_CFG register Create a new function that encapsulates setting the counter configuration register value for versions prior to IPA v4.5. Create another small function to represent configuring hardware timing regardless of version. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit b24627b1d9b25e3a4c96bd467bce7667ca119910 Author: Alex Elder Date: Thu Sep 22 17:20:58 2022 -0500 net: ipa: encapsulate setting the FILT_ROUT_HASH_EN register Create a new function that encapsulates setting the register flag that disables filter and routing table hashing for IPA v4.2. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 73e0c9efb5ede4e65d76e01467eb4c14ad9db7bf Author: Alex Elder Date: Thu Sep 22 17:20:57 2022 -0500 net: ipa: tidy up register enum definitions Update a few enumerated type definitions in "ipa_reg.h" so that the values assigned to each member align on the same column. Where a "TX" or "RX" (or both) comment is present, move that annotation into a separate comment between the member name and its value. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 21ab2078ff37ad9f81c080244ed51d80463d58d9 Author: Alex Elder Date: Thu Sep 22 17:20:56 2022 -0500 net: ipa: define BCR values using an enum The backward compatibility register (BCR) has a set of bit flags that indicate ways in which the IPA hardware should operate in a backward compatible way. The register is not supported starting with IPA v4.5, and where it is supported, defined bits all have the same numeric value. Redefine these flags using an enumerated type, with each member's value representing the bit position that encodes it in the BCR. This replaces all of the single-bit field masks previously defined. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 48395fa8e8f69267a795bab2d31b9c2f3f8fe503 Author: Alex Elder Date: Thu Sep 22 17:20:55 2022 -0500 net: ipa: rearrange functions for similarity Both aggr_time_limit_encode() and hol_block_timer_encode() figure out how to encode a millisecond time value so it can be programmed into a register. Rearranging them a bit can make their similarity more obvious, with both taking essentially the same form. To do this: - Return 0 immediately in aggr_time_limit_encode() if the microseconds value supplied is zero. - Reverse the test at top of aggr_time_limit_encode(), so we compute and return the Qtime value in the "true" block, and compute the result the old way otherwise. - Open-code (and eliminate) hol_block_timer_qtime_encode() at the top of hol_block_timer_encode() in the case we use Qtimer. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 8be440e17bdbb3ddfe3fd19216ee0d904dd24d22 Author: Alex Elder Date: Thu Sep 22 17:20:54 2022 -0500 net: ipa: introduce ipa_qtime_val() Create a new function ipa_qtime_val() which returns a value that indicates what should be encoded for a register with a time field expressed using Qtime. Use it to factor out common code in aggr_time_limit_encoded() and hol_block_timer_qtime_val(). Rename aggr_time_limit_encoded() and hol_block_timer_qtime_val() so their names are both verbs ending in "encode". Rename the "limit" argument to the former to be "milliseconds" for consistency. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit a50d37b7565e13613e2797eabcf82c2c685578d0 Author: Alex Elder Date: Thu Sep 22 17:20:53 2022 -0500 net: ipa: don't use u32p_replace_bits() In two spots we use u32_replace_bits() to replace a set of bits in a register while preserving the rest. Both of those cases just zero the bits being replaced, and this can be done more simply without using that function. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 8619e94d3be376bb5e8f20988c0e6e3309d2b09a Author: ye xingchen Date: Wed Sep 21 09:35:17 2022 +0000 cgroup: use strscpy() is more robust and safer The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: ye xingchen Signed-off-by: Tejun Heo commit b74440d89895816660236be4433f0891e37d44eb Author: Elijah Conners Date: Tue Aug 30 07:38:27 2022 -0700 iocost_monitor: reorder BlkgIterator In order to comply with PEP 8, the first parameter of a class should be __init__. Signed-off-by: Elijah Conners Signed-off-by: Tejun Heo commit 61c41711b12b808ec388b739444372430942c2e8 Author: William Dean Date: Sat Sep 17 16:40:39 2022 +0800 cgroup: simplify code in cgroup_apply_control It could directly return 'cgroup_update_dfl_csses' to simplify code. Signed-off-by: William Dean Reviewed-by: Mukesh Ojha Signed-off-by: Tejun Heo commit 230bf137e7715142b5898c6d46cc3386aab4291c Merge: dbdea9b36fb61 e310efc5ddde0 Author: Alexei Starovoitov Date: Fri Sep 23 18:14:45 2022 -0700 Merge branch 'veristat: further usability improvements' Andrii Nakryiko says: ==================== A small patch set adding few usability improvements and features making veristat a more convenient tool to be used for work on BPF verifier: - patch #2 speeds up and makes stats parsing from BPF verifier log more robust; - patch #3 makes veristat less strict about input object files; veristat will ignore non-BPF ELF files; - patch #4 adds progress log, by default, so that user doing mass-verification is aware that veristat is not stuck; - patch #5 allows to tune requested BPF verifier log level, which makes veristat a simplest way to get BPF verifier log, especially successfully verified ones. v1->v2: - don't emit progress in non-table mode, as it breaks CSV output. ==================== Signed-off-by: Alexei Starovoitov commit e310efc5ddde04c41aa0501b5a7235b134c5fc6c Author: Andrii Nakryiko Date: Fri Sep 23 10:59:13 2022 -0700 selftests/bpf: allow to adjust BPF verifier log level in veristat Add -l (--log-level) flag to override default BPF verifier log lever. This only matters in verbose mode, which is the mode in which veristat emits verifier log for each processed BPF program. This is important because for successfully verified BPF programs log_level 1 is empty, as BPF verifier truncates all the successfully verified paths. So -l2 is the only way to actually get BPF verifier log in practice. It looks sometihng like this: [vmuser@archvm bpf]$ sudo ./veristat xdp_tx.bpf.o -vl2 Processing 'xdp_tx.bpf.o'... PROCESSING xdp_tx.bpf.o/xdp_tx, DURATION US: 19, VERDICT: success, VERIFIER LOG: func#0 @0 0: R1=ctx(off=0,imm=0) R10=fp0 ; return XDP_TX; 0: (b4) w0 = 3 ; R0_w=3 1: (95) exit verification time 19 usec stack depth 0 processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 File Program Verdict Duration (us) Total insns Total states Peak states ------------ ------- ------- ------------- ----------- ------------ ----------- xdp_tx.bpf.o xdp_tx success 19 2 0 0 ------------ ------- ------- ------------- ----------- ------------ ----------- Done. Processed 1 files, 0 programs. Skipped 1 files, 0 programs. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923175913.3272430-6-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit c511d009ceb8cd980e4a823b7ca74abbdc7cdccc Author: Andrii Nakryiko Date: Fri Sep 23 10:59:12 2022 -0700 selftests/bpf: emit processing progress and add quiet mode to veristat Emit "Processing ..." for each BPF object file to be processed, to show progress. But also add -q (--quiet) flag to silence such messages. Doing something more clever (like overwriting same output line) is to cumbersome and easily breakable if there is any other console output (e.g., errors from libbpf). Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923175913.3272430-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 518fee8bfaf2c628007909c0fc5336930b9b6ee4 Author: Andrii Nakryiko Date: Fri Sep 23 10:59:11 2022 -0700 selftests/bpf: make veristat skip non-BPF and failing-to-open BPF objects Make veristat ignore non-BPF object files. This allows simpler mass-verification (e.g., `sudo ./veristat *.bpf.o` in selftests/bpf directory). Note that `sudo ./veristat *.o` would also work, but with selftests's multiple copies of BPF object files (.bpf.o and .bpf.linked{1,2,3}.o) it's 4x slower. Also, given some of BPF object files could be incomplete in the sense that they are meant to be statically linked into final BPF object file (like linked_maps, linked_funcs, linked_vars), note such instances in stderr, but proceed anyways. This seems like a better trade off between completely silently ignoring BPF object file and aborting mass-verification altogether. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923175913.3272430-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit c2488d70ceee352611e55943c25abf30117e3b67 Author: Andrii Nakryiko Date: Fri Sep 23 10:59:10 2022 -0700 selftests/bpf: make veristat's verifier log parsing faster and more robust Make sure veristat doesn't spend ridiculous amount of time parsing verifier stats from verifier log, especially for very large logs or truncated logs (e.g., when verifier returns -ENOSPC due to too small buffer). For this, parse lines from the end of the log and make sure we parse only up to 100 last lines, where stats should be, if at all. Suggested-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923175913.3272430-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 067f4f291c2063d86abe0a526ef211e03a4f1258 Author: Andrii Nakryiko Date: Fri Sep 23 10:59:09 2022 -0700 selftests/bpf: add sign-file to .gitignore Add sign-file to .gitignore to avoid accidentally checking it in. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923175913.3272430-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit c732a852b419fa057b53657e2daaf9433940391c Author: ZiyangZhang Date: Fri Sep 23 23:39:18 2022 +0800 ublk_drv: add START_USER_RECOVERY and END_USER_RECOVERY support START_USER_RECOVERY and END_USER_RECOVERY are two new control commands to support user recovery feature. After a crash, user should send START_USER_RECOVERY, it will: (1) check if (a)current ublk_device is UBLK_S_DEV_QUIESCED which was set by quiesce_work and (b)chardev is released (2) reinit all ubqs, including: (a) put the task_struct and reset ->ubq_daemon to NULL. (b) reset all ublk_io. (3) reset ub->mm to NULL. Then, user should start a new process and send FETCH_REQ on each ubq_daemon. Finally, user should send END_USER_RECOVERY, it will: (1) wait for all new ubq_daemons getting ready. (2) update ublksrv_pid (3) unquiesce the request queue and expect incoming ublk_queue_rq() (4) convert ub's state to UBLK_S_DEV_LIVE Note: we can handle STOP_DEV between START_USER_RECOVERY and END_USER_RECOVERY. This is helpful to users who cannot start new process after sending START_USER_RECOVERY ctrl-cmd. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-7-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit a0d41dc1137470fd4c5c2ef8fdc244d7565e69e6 Author: ZiyangZhang Date: Fri Sep 23 23:39:17 2022 +0800 ublk_drv: support UBLK_F_USER_RECOVERY_REISSUE UBLK_F_USER_RECOVERY_REISSUE implies that: With a dying ubq_daemon, ublk_drv let monitor_work requeues rq issued to userspace(ublksrv) before the ubq_daemon is dying. UBLK_F_USER_RECOVERY_REISSUE is designed for backends which: (1) tolerate double-write since ublk_drv may issue the same rq twice. (2) does not let frontend users get I/O error, such as read-only FS and VM backend. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-6-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit bbae8d1f526b56d04d51a5fc300d9de702e264dd Author: ZiyangZhang Date: Fri Sep 23 23:39:16 2022 +0800 ublk_drv: consider recovery feature in aborting mechanism With USER_RECOVERY feature enabled, the monitor_work schedules quiesce_work after finding a dying ubq_daemon. The monitor_work should also abort all rqs issued to userspace before the ubq_daemon is dying. The quiesce_work's job is to: (1) quiesce request queue. (2) check if there is any INFLIGHT rq. If so, we retry until all these rqs are requeued and become IDLE. These rqs should be requeued by ublk_queue_rq(), task work, io_uring fallback wq or monitor_work. (3) complete all ioucmds by calling io_uring_cmd_done(). We are safe to do so because no ioucmd can be referenced now. (5) set ub's state to UBLK_S_DEV_QUIESCED, which means we are ready for recovery. This state is exposed to userspace by GET_DEV_INFO. The driver can always handle STOP_DEV and cleanup everything no matter ub's state is LIVE or QUIESCED. After ub's state is UBLK_S_DEV_QUIESCED, user can recover with new process. Note: we do not change the default behavior with reocvery feature disabled. monitor_work still schedules stop_work and abort inflight rqs. And finally ublk_device is released. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-5-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit 42cf5fc5eece9fe650636afbb2ab2c037b77a9ab Author: ZiyangZhang Date: Fri Sep 23 23:39:15 2022 +0800 ublk_drv: requeue rqs with recovery feature enabled With recovery feature enabled, in ublk_queue_rq or task work (in exit_task_work or fallback wq), we requeue rqs instead of ending(aborting) them. Besides, No matter recovery feature is enabled or disabled, we schedule monitor_work immediately. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-4-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit 77a440e2cbb4b8688b567104f80ce1cda1afbbc4 Author: ZiyangZhang Date: Fri Sep 23 23:39:14 2022 +0800 ublk_drv: define macros for recovery feature and check them Define some macros for recovery feature. UBLK_S_DEV_QUIESCED implies that ublk_device is quiesced and is ready for recovery. This state can be observed by userspace. UBLK_F_USER_RECOVERY implies that: (1) ublk_drv enables recovery feature. It won't let monitor_work to automatically abort rqs and release the device. (2) With a dying ubq_daemon, ublk_drv ends(aborts) rqs issued to userspace(ublksrv) before crash. (3) With a dying ubq_daemon, in task work and ublk_queue_rq(), ublk_drv requeues rqs. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-3-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit ae3f719300816865489abd44c91c821859daa26f Author: ZiyangZhang Date: Fri Sep 23 23:39:13 2022 +0800 ublk_drv: check 'current' instead of 'ubq_daemon' This check is not atomic. So with recovery feature, ubq_daemon may be modified simultaneously by recovery task. Instead, check 'current' is safe here because 'current' never changes. Also add comment explaining this check, which is really important for understanding recovery feature. Signed-off-by: ZiyangZhang Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220923153919.44078-2-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe commit dbdea9b36fb61da3b9a1be0dd63542e2bfd3e5d7 Author: Andrii Nakryiko Date: Fri Sep 23 16:05:59 2022 -0700 libbpf: restore memory layout of bpf_object_open_opts When attach_prog_fd field was removed in libbpf 1.0 and replaced with `long: 0` placeholder, it actually shifted all the subsequent fields by 8 byte. This is due to `long: 0` promising to adjust next field's offset to long-aligned offset. But in this case we were already long-aligned as pin_root_path is a pointer. So `long: 0` had no effect, and thus didn't feel the gap created by removed attach_prog_fd. Non-zero bitfield should have been used instead. I validated using pahole. Originally kconfig field was at offset 40. With `long: 0` it's at offset 32, which is wrong. With this change it's back at offset 40. While technically libbpf 1.0 is allowed to break backwards compatibility and applications should have been recompiled against libbpf 1.0 headers, but given how trivial it is to preserve memory layout, let's fix this. Reported-by: Grant Seltzer Richman Fixes: 146bf811f5ac ("libbpf: remove most other deprecated high-level APIs") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220923230559.666608-1-andrii@kernel.org Signed-off-by: Martin KaFai Lau commit e588c116df6ca64a295017571151992c76d03132 Author: Wang Yufen Date: Thu Sep 22 14:28:44 2022 +0800 libbpf: Add pathname_concat() helper Move snprintf and len check to common helper pathname_concat() to make the code simpler. Signed-off-by: Wang Yufen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1663828124-10437-1-git-send-email-wangyufen@huawei.com commit d3923513edd7f4a614a169122b0eb6b9acb2c8a3 Author: Colin Ian King Date: Fri Aug 5 13:50:08 2022 +0100 EDAC/i7300: Correct the i7300_exit() function name in comment The incorrect function name is being used in the comment for function i7300_exit. Correct this. Signed-off-by: Colin Ian King Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220805125008.2346559-1-colin.i.king@gmail.com commit aa1df3a360a0c50e0f0086a785d75c2785c29967 Author: Pavel Begunkov Date: Fri Sep 23 14:53:25 2022 +0100 io_uring: fix CQE reordering Overflowing CQEs may result in reordering, which is buggy in case of links, F_MORE and so on. If we guarantee that we don't reorder for the unlikely event of a CQ ring overflow, then we can further extend this to not have to terminate multishot requests if it happens. For other operations, like zerocopy sends, we have no choice but to honor CQE ordering. Reported-by: Dylan Yudaken Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ec3bc55687b0768bbe20fb62d7d06cfced7d7e70.1663892031.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e0401dce5e28fb7118dbfd055c77d94433778a85 Author: Yosry Ahmed Date: Mon Sep 19 17:53:30 2022 +0000 selftests/bpf: Simplify cgroup_hierarchical_stats selftest The cgroup_hierarchical_stats selftest is complicated. It has to be, because it tests an entire workflow of recording, aggregating, and dumping cgroup stats. However, some of the complexity is unnecessary. The test now enables the memory controller in a cgroup hierarchy, invokes reclaim, measure reclaim time, THEN uses that reclaim time to test the stats collection and aggregation. We don't need to use such a complicated stat, as the context in which the stat is collected is orthogonal. Simplify the test by using a simple stat instead of reclaim time, the total number of times a process has ever entered a cgroup. This makes the test simpler and removes the dependency on the memory controller and the memory reclaim interface. Signed-off-by: Yosry Ahmed Signed-off-by: Andrii Nakryiko Acked-by: KP Singh Link: https://lore.kernel.org/bpf/20220919175330.890793-1-yosryahmed@google.com commit 4324796ed0d140bac7a07fc2189bc3c3c3752978 Merge: 9713a67067897 65b94b527dfcb Author: Jens Axboe Date: Fri Sep 23 14:59:01 2022 -0600 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.1/block Pull MD updates and fixes from Song: "1. Various raid5 fix and clean up, by Logan Gunthorpe and David Sloan. 2. Raid10 performance optimization, by Yu Kuai." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: Fix spelling mistake in comments of r5l_log md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d md/raid10: convert resync_lock to use seqlock md/raid10: fix improper BUG_ON() in raise_barrier() md/raid10: prevent unnecessary calls to wake_up() in fast path md/raid10: don't modify 'nr_waitng' in wait_barrier() for the case nowait md/raid10: factor out code from wait_barrier() to stop_waiting_barrier() md: Remove extra mddev_get() in md_seq_start() md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk() md/raid5: Ensure stripe_fill happens on non-read IO with journal md/raid5: Don't read ->active_stripes if it's not needed md/raid5: Cleanup prototype of raid5_get_active_stripe() md/raid5: Drop extern on function declarations in raid5.h md/raid5: Refactor raid5_get_active_stripe() md: Replace snprintf with scnprintf md/raid10: fix compile warning md/raid5: Fix spelling mistakes in comments commit a75155faef4efcb9791f77e2652e29ce8906e05a Author: Pavel Begunkov Date: Fri Sep 23 16:23:34 2022 +0100 io_uring/net: fix UAF in io_sendrecv_fail() We should not assume anything about ->free_iov just from REQ_F_ASYNC_DATA but rather rely on REQ_F_NEED_CLEANUP, as we may allocate ->async_data but failed init would leave the field in not consistent state. The easiest solution is to remove removing REQ_F_NEED_CLEANUP and so ->async_data dealloc from io_sendrecv_fail() and let io_send_zc_cleanup() do the job. The catch here is that we also need to prevent double notif flushing, just test it for NULL and zero where it's needed. BUG: KASAN: use-after-free in io_sendrecv_fail+0x3b0/0x3e0 io_uring/net.c:1221 Write of size 8 at addr ffff8880771b4080 by task syz-executor.3/30199 CPU: 1 PID: 30199 Comm: syz-executor.3 Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 io_sendrecv_fail+0x3b0/0x3e0 io_uring/net.c:1221 io_req_complete_failed+0x155/0x1b0 io_uring/io_uring.c:873 io_drain_req io_uring/io_uring.c:1648 [inline] io_queue_sqe_fallback.cold+0x29f/0x788 io_uring/io_uring.c:1931 io_submit_sqe io_uring/io_uring.c:2160 [inline] io_submit_sqes+0x1180/0x1df0 io_uring/io_uring.c:2276 __do_sys_io_uring_enter+0xac6/0x2410 io_uring/io_uring.c:3216 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: c4c0009e0b56e ("io_uring/net: combine fail handlers") Reported-by: syzbot+4c597a574a3f5a251bda@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/23ab8346e407ea50b1198a172c8a97e1cf22915b.1663945875.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4781185da411c0b51ef9b1db557c1ea28ac11de4 Author: Pavel Begunkov Date: Fri Sep 23 18:12:09 2022 +0100 selftest/net: adjust io_uring sendzc notif handling It's not currently possible but in the future we may get IORING_CQE_F_MORE and so a notification even for a failed request, i.e. when cqe->res <= 0. That's precisely what the documentation says, so adjust the test and do IORING_CQE_F_MORE checks regardless of the main completion cqe->res. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/aac948ea753a8bfe1fa3b82fe45debcb54586369.1663953085.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 87d3d1b1403ba079cf9b1541a247156863af07f0 Author: Matthias Schiffer Date: Wed Jun 8 14:48:08 2022 +0200 Input: synaptics-rmi4 - drop useless gotos in rmi_f34v7_do_reflash() Returning directly makes the code clearer. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-10-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit 7d128a8d4107084a1df548d9304b9e49153808b8 Author: Matthias Schiffer Date: Wed Jun 8 14:48:07 2022 +0200 Input: synaptics-rmi4 - simplify rmi_f34v7_start_reflash() rmi_f34v7_enter_flash_prog() already enables IRQs and checks the flash status - there's no need for rmi_f34v7_start_reflash() to do the same just before calling rmi_f34v7_enter_flash_prog(). Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-9-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit b077d523d4d91e7239864997ffe2a30ac30055c1 Author: Matthias Schiffer Date: Wed Jun 8 14:48:06 2022 +0200 Input: synaptics-rmi4 - remove unneeded struct register_offset All register offsets are fixed, and a number of places even read or write multiple registers as a block, so there is no way to support reordering them without move involved changes. Remove the unneeded level of indirection in the register access. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-8-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit d8d007f25cb6a25b25c0b6447b620638f1febcd3 Author: Matthias Schiffer Date: Wed Jun 8 14:48:05 2022 +0200 Input: synaptics-rmi4 - make rmi_f34v7_erase_all() use the "erase all" command A full erase is required to recover from error conditions like "Bad Partition Table". Various individual partition erase commands can be (and need to be) omitted, as they will fail until a new partition table has been written. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-7-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit d316e709cd7e3a84fa6a9b93d0c25754c0cb707e Author: Matthias Schiffer Date: Wed Jun 8 14:48:04 2022 +0200 Input: synaptics-rmi4 - reset after writing partition table When recovering from a bad partition table (for example after an interrupted update), a reset is necessary for the new partition table to become effective. Without this reset, writing the core code partition will fail with status 0x03 (Invalid Command). Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-6-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit 0113b49bd9634ea96cb1237a35308d41f72175af Author: Matthias Schiffer Date: Wed Jun 8 14:48:03 2022 +0200 Input: synaptics-rmi4 - rewrite partition table unconditionally Preparation for use of the "erase application" command, which is required to recover from a bad partition table error condition. Rather than adding complex fallback error paths for such errors, it seems more robust to do the full erase unconditionally. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-5-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit b4d6c6a07faa5c860421182d7599f12acfc7dfd0 Author: Matthias Schiffer Date: Wed Jun 8 14:48:02 2022 +0200 Input: synaptics-rmi4 - fix command completion check for bootloader v7/v8 The command register is reset to 0 when a command has completed. Check for this condition instead of the error status, which will not accurately reflect completion. In particular, the incorrect condition caused every command error to be reported as a timeout. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-4-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit 33fe4d976ff2c1fb6caf961b2e7bbfa66b8a9bf6 Author: Matthias Schiffer Date: Wed Jun 8 14:48:01 2022 +0200 Input: synaptics-rmi4 - introduce rmi_f34v7_check_command_status() helper Add a function that waits for the last command to complete and checks the status, and use it where appropriate. This prepares for the subsequent fix of the completion condition in rmi_f34_attention(), which would previously lead to a timeout instead of a more detailed error message whenever a command was unsuccessful with v7/v8 bootloaders. Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-3-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit 28f677e9d15181556c1f2103d93b9cc093e7b91f Author: Matthias Schiffer Date: Wed Jun 8 14:48:00 2022 +0200 Input: synaptics-rmi4 - fix firmware update operations with bootloader v8 Commit a6977d758fed ("Input: synaptics-rmi4 - support bootloader v8 in f34v7") allowed the F34v7 driver to probe with bootloader v8, but it did not update various other bootloader version checks in the F34 code. Fixes: a6977d758fed ("Input: synaptics-rmi4 - support bootloader v8 in f34v7") Signed-off-by: Matthias Schiffer Reviewed-by: Lyude Paul Link: https://lore.kernel.org/r/20220608124808.51402-2-matthias.schiffer@ew.tq-group.com Signed-off-by: Dmitry Torokhov commit 63872304bdb3decd5454f4dd210c25395278ed13 Author: Arnd Bergmann Date: Fri Sep 23 21:55:50 2022 +0200 ARM: orion: fix include path Now that CONFIG_ARCH_MULTIPLATFORM can be disabled anywhere, there is a build failure for plat-orion: arch/arm/plat-orion/irq.c:19:10: fatal error: plat/irq.h: No such file or directory Make the include path unconditional. Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit 28a679ea60d0d16c3556f687bb2040559e92e932 Author: Linus Walleij Date: Thu Sep 22 21:18:39 2022 +0200 parisc: Drop homebrewn io[read|write]64_[lo_hi|hi_lo] The parisc implements ioread64_lo_hi(), ioread64_hi_lo() iowrite64_lo_hi() and iowrite64_hi_lo() while we already have a perfectly working generic version in the generic portable assembly in . Drop the custom versions in favor for the defaults. Fixes: 77bfc8bdb5a1 ("parisc: Remove 64bit access on 32bit machines") Cc: Arnd Bergmann Acked-by: Helge Deller Reported-by: Helge Deller Reported-by: kernel test robot Signed-off-by: Linus Walleij Signed-off-by: Arnd Bergmann commit e9b0ff9336850863e608c2df0dde512adecb4a20 Merge: 5b887b4d1e21f 4245fdba89b82 Author: Mark Brown Date: Fri Sep 23 20:46:25 2022 +0100 ASoC: SOF: ipc4/Intel: Improve and enable IPC error dump Merge series from Peter Ujfalusi : On Intel platforms the registers for DSP communications are used differently, the IPC dump information is not correct since important registers are not printed and existing ones are used a bit differently for IPC4. As a last step, enable the IPC timeout 'handling' and allow the printout of the now usefull IPC dump. commit 5b887b4d1e21fcc16bbcf64ac1cac1ab9d0acca2 Merge: 179f69fa37bb4 0f47dd211938d Author: Mark Brown Date: Fri Sep 23 20:46:18 2022 +0100 ASoC: codecs: qcom add support for SM8450 and SC8280XP Merge series from Srinivas Kandagatla : This patchset adds support for SM8450 and SC8280XP SoC and also some of the fixes requried to get stable audio on X13s. Tested SmartSpeakers and Headset on SM8450 MTP and Lenovo Thinkpad X13s. commit d389059685b46861c264cda4f37a33feeab91dfc Author: Youquan Song Date: Fri Jul 22 16:33:38 2022 -0700 x86/sb_edac: Add row column translation for Broadwell The sb_edac driver lacks translation for DIMM internal address. Add memory address translation for row/column/bank/bank_group on Broadwell. Signed-off-by: Youquan Song Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220722233338.341567-1-tony.luck@intel.com commit d5f5e49953f68bb7b15afd6e32ad176b987c6525 Author: Qiuxu Zhuo Date: Fri Jul 22 16:33:37 2022 -0700 EDAC/i10nm: Print an extra register set of retry_rd_err_log Sapphire Rapids server adds an extra register set for logging more retry_rd_err_log data. So add code to print the extra register set. Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220722233338.341567-1-tony.luck@intel.com commit acd4cf68fefe70138926056e3137c9ea99ef7ebf Author: Qiuxu Zhuo Date: Fri Jul 22 16:33:36 2022 -0700 EDAC/i10nm: Retrieve and print retry_rd_err_log registers for HBM An HBM memory channel is divided into two pseudo channels. Each pseudo channel has its own retry_rd_err_log registers. Retrieve and print retry_rd_err_log registers of the HBM pseudo channel if the memory error is from HBM. Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220722233338.341567-1-tony.luck@intel.com commit 14646de48bd77947cd6a325b42eecddcec5a35c7 Author: Qiuxu Zhuo Date: Fri Jul 22 16:33:35 2022 -0700 EDAC/skx_common: Add ChipSelect ADXL component Each pseudo channel of HBM has its own retry_rd_err_log registers. The bit 0 of ChipSelect ADXL component encodes the pseudo channel number of HBM memory. So add ChipSelect ADXL component to get HBM pseudo channel number. Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220722233338.341567-1-tony.luck@intel.com commit 7aacc42f8d7d3bc9efde159b534d9199d9e2cc87 Author: Andy Shevchenko Date: Fri Sep 23 21:46:31 2022 +0300 Input: matrix_keypad - add missed header inclusion The gpiod_count() API is defined in gpio/consumer.h. Include it. Fixes: f8f7f47d576f ("Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count()") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220923184632.2157-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov commit fffa0fa4d029c10406d417dd33f630bee4b12c02 Author: Johan Jonker Date: Tue Sep 20 00:25:07 2022 +0200 dt-bindings: clock: rockchip: change SPDX-License-Identifier Change SPDX-License-Identifier to (GPL-2.0+ OR MIT) for Rockchip clock bindings. Cc: Heiko Stübner Cc: Elaine Zhang Cc: Xing Zheng Cc: Jeffy Chen Cc: Finley Xiao Cc: Andy Yan Cc: Shawn Lin Cc: Eric Engestrom Cc: Mylène Josserand Cc: Nícolas F. R. A. Prado Signed-off-by: Johan Jonker Acked-by: Eric Engestrom Acked-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20c6a502-2ff5-bdb1-fb4f-0741f3a2c19c@gmail.com [Rockchip Ack/request for dual licensing dt-bindings at https://lore.kernel.org/all/510d1180-bc8e-7820-c772-ed7f35447087@rock-chips.com/] Signed-off-by: Heiko Stuebner commit 1ee41d92f1a05a87a1c69081006a21e6c319de82 Merge: 47723de8d7555 c2ce1e7342826 Author: Arnd Bergmann Date: Fri Sep 23 20:35:30 2022 +0200 Merge tag 'renesas-arm-soc-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/soc Renesas ARM SoC updates for v6.1 - Drop superfluous selects of SOC_BUS. * tag 'renesas-arm-soc-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: Drop selecting SOC_BUS arm64: renesas: Drop selecting SOC_BUS Link: https://lore.kernel.org/r/cover.1663588781.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 7e1eb5437d3c3fdb61d45378579aab383cafc694 Author: Tejun Heo Date: Fri Sep 23 07:23:06 2022 -1000 cgroup: Make cgroup_get_from_id() prettier After merging 836ac87d ("cgroup: fix cgroup_get_from_id") into for-6.1, its combination with two commits in for-6.1 - 4534dee9 ("cgroup: cgroup: Honor caller's cgroup NS when resolving cgroup id") and fa7e439c ("cgroup: Homogenize cgroup_get_from_id() return value") - makes the gotos in the error handling path too ugly while not adding anything of value. All that the gotos are saving is one extra kernfs_put() call. Let's remove the gotos and perform error returns directly. Signed-off-by: Tejun Heo Cc: Ming Lei Cc: Michal Koutný commit a6bfc42f30d11f22d2dacb2362d6069643b15393 Author: Yang Yingliang Date: Tue Sep 20 22:22:16 2022 +0800 spi: s3c24xx: Switch to use devm_spi_alloc_master() Switch to use devm_spi_alloc_master() to simpify error path. Signed-off-by: Yang Yingliang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220920142216.3002291-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 2d0645817436ed2e527d967701ee354630d43e94 Author: Yang Yingliang Date: Tue Sep 20 19:46:15 2022 +0800 spi: xilinx: Switch to use devm_spi_alloc_master() Switch to use devm_spi_alloc_master() to simpify error path. Signed-off-by: Yang Yingliang Reviewed-by: Lukas Wunner Link: https://lore.kernel.org/r/20220920114615.2681751-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c79ce0a2824bc987ee4cd19f6a0a4e1eb493a8d8 Author: Zhang Qilong Date: Thu Sep 22 23:02:32 2022 +0800 spi: img-spfi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here. Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220922150232.115843-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 026e14a276c67c8433ecb10e557f0ba23d2b6636 Merge: c478bd8836241 df02452f3df06 Author: Tejun Heo Date: Fri Sep 23 07:19:38 2022 -1000 Merge branch 'for-6.0-fixes' into for-6.1 for-6.0 has the following fix for cgroup_get_from_id(). 836ac87d ("cgroup: fix cgroup_get_from_id") which conflicts with the following two commits in for-6.1. 4534dee9 ("cgroup: cgroup: Honor caller's cgroup NS when resolving cgroup id") fa7e439c ("cgroup: Homogenize cgroup_get_from_id() return value") While the resolution is straightforward, the code ends up pretty ugly afterwards. Let's pull for-6.0-fixes into for-6.1 so that the code can be fixed up there. Signed-off-by: Tejun Heo commit 179f69fa37bb4ba7e5e6ecd04096cdec53c2fe12 Author: Dmitry Torokhov Date: Mon Sep 19 19:58:04 2022 -0700 ASoC: ssm2518: switch to using gpiod API This patch converts the driver to newer gpiod API, so that we can stop exporting OF-specific legacy gpio API. Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220920025804.1788667-2-dmitry.torokhov@gmail.com Signed-off-by: Mark Brown commit 1e1f26635e5459db4134952369b76b8d59c50438 Author: Dmitry Torokhov Date: Mon Sep 19 19:58:03 2022 -0700 ASoC: ssm2518: drop support for platform data There are currently no users of this driver's platform data in the mainline kernel, so let's drop it. Newer devices should use DT, ACPI, or static software properties to describe the hardware. Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220920025804.1788667-1-dmitry.torokhov@gmail.com Signed-off-by: Mark Brown commit d508260e89a7d1889bbb5788fdfc52cc3eb8ddb6 Author: Yang Yingliang Date: Fri Sep 16 22:07:57 2022 +0800 ASoC: Intel: skylake: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in skl_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220916140757.681414-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit abb4e4349afe7eecdb0499582f1c777031e3a7c8 Author: Christophe JAILLET Date: Thu Sep 22 21:44:57 2022 +0200 ASoC: da7219: Fix an error handling path in da7219_register_dai_clks() If clk_hw_register() fails, the corresponding clk should not be unregistered. To handle errors from loops, clean up partial iterations before doing the goto. So add a clk_hw_unregister(). Then use a while (--i >= 0) loop in the unwind section. Fixes: 78013a1cf297 ("ASoC: da7219: Fix clock handling around codec level probe") Reported-by: Dan Carpenter Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/e4acceab57a0d9e477a8d5890a45c5309e553e7c.1663875789.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 1849a1505533501ea39ed0538c2d35eba4704baa Author: Sascha Hauer Date: Fri Sep 23 18:15:47 2022 +0800 ASoC: fsl_asrc_dma: fully initialize structs The driver uses two statically ininitialized struct dma_slave_config, but only one of them is initialized to zero. Initialize config_be to zero as well to make sure that no fields are filled with random values. Let the compiler do this instead of explicitly calling memset() which makes it easier to read. Signed-off-by: Sascha Hauer Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1663928147-10106-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee Author: Zhang Qilong Date: Thu Sep 22 22:58:46 2022 +0800 ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here. Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220922145846.114312-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown commit 086ceada2107b482df437d76f581062b547eb7f2 Author: Shengjiu Wang Date: Tue Sep 6 14:49:21 2022 +0800 ASoC: fsl_audmux: Fix amixer write errors This reverts commit 944c517b8c8388 ("ASoC: fsl_audmix: make clock and output src write only"). There is error after making clock and output src write only $amixer -c imxaudmix cset numid=1 1 amixer: Cannot read the given element from control sysdefault:3 Which is worse than before, so let's revert the change. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1662446961-20799-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 76003e4d0da8c04229023a5df8911defaff95500 Merge: 583ccffca5f4a 68fb254e9ccca Author: Mark Brown Date: Fri Sep 23 17:53:13 2022 +0100 ASoC: SOF: Intel: MTL: Fixes for suspend/resume Merge series from Ranjani Sridharan : This series includes fixes for suspend/resume and module loading/unloading for the MTL platform. commit 583ccffca5f4a6c75d8f1e437934b072d09e95c4 Merge: 0402cca4828dd 42de42c224530 Author: Mark Brown Date: Fri Sep 23 17:53:06 2022 +0100 ASoC: mediatek: Allow separate handling of headphone and headset mic jack Merge series from Nícolas F. R. A. Prado : This series allows the headphone and headset mic jack status to be handled separately by userspace on MT8192, MT8195 and MT8186. Changes based on commit d0508b4f1604 ("ASoC: rk3399_gru_sound: Add DAPM pins, kcontrols for jack detection"). Found while searching for an alternative for JackSwitch [1]. [1] https://lore.kernel.org/all/b98a8a77-7652-1995-27ba-eb7b6d30202a@gmail.com/ Nícolas F. R. A. Prado (6): ASoC: mediatek: mt8192-mt6359: Expose individual headset jack pins ASoC: mediatek: mt8195: Expose individual headset jack pins ASoC: mediatek: mt8186-da7219: Add headset widgets with switches ASoC: mediatek: mt8186-da7219: Expose individual headset jack pins ASoC: mediatek: mt8186-rt5682: Add headset widgets with switches ASoC: mediatek: mt8186-rt5682: Expose individual headset jack pins .../mt8186/mt8186-mt6366-da7219-max98357.c | 25 +++++++++++++++++-- .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 25 +++++++++++++++++-- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 17 +++++++++++-- sound/soc/mediatek/mt8195/mt8195-mt6359.c | 17 +++++++++++-- 4 files changed, 76 insertions(+), 8 deletions(-) -- 2.37.3 commit 1a8339c6bdcf7d66a83152ee5ff13c50da761295 Author: Yunlong Jia Date: Fri Sep 23 09:35:48 2022 -0700 dt-bindings: input: touchscreen: elants_i2c: Add compatible for eth3915n chip This adds a new compatible string for Elan eth3915n touchscreen controller, which is compatible with ekth3500. Signed-off-by: Yunlong Jia Suggested-by: Douglas Anderson Reviewed-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220923083657.v5.2.Ic4e8f03868f88b8027a81bc3d414bae68978e6b7@changeid Signed-off-by: Dmitry Torokhov commit 3919d905351f279593dd7ec35a23a417963f44a3 Merge: 4cb59d5069f2d 53283105cab6f Author: Arnd Bergmann Date: Fri Sep 23 18:04:29 2022 +0200 Merge tag 'tegra-for-6.1-cbb' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: cbb: Changes for v6.1-rc1 This introduces the CBB driver that is used to provide (a lot of) information about SErrors when things go wrong, instead of the kernel just crashing or hanging. * tag 'tegra-for-6.1-cbb' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: cbb: Add support for Tegra241 (Grace) soc/tegra: cbb: Add driver for Tegra234 CBB 2.0 soc/tegra: cbb: Add CBB 1.0 driver for Tegra194 soc/tegra: Set ERD bit to mask inband errors Link: https://lore.kernel.org/r/20220916101957.1635854-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 15116bf667241ddf12c4eb143c7cf81e235ce24c Merge: d1d48fd18abce 10fa117bfc0a9 Author: Arnd Bergmann Date: Fri Sep 23 17:59:27 2022 +0200 Merge tag 'qcom-defconfig-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM defconfig updates for 6.1 This enables command-db, ocmem, rpmh and rpmhpd drivers in the multi_v7_defconfig, used on SDX55, SDX65 and MSM8974. For qcom_defconfig rmtfs-mem, rpmpd, socinfo and qcom-stats are enables as they are used across MSM8974, MSM8226, MSM8916 and APQ8084. Lastly the MAINTAINERS entry is updated to include the qcom_defconfig. * tag 'qcom-defconfig-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: qcom: include defconfig in MAINTAINERS ARM: multi_v7_defconfig: enable more Qualcomm drivers ARM: qcom_defconfig: enable more Qualcomm drivers Link: https://lore.kernel.org/r/20220921153734.1314952-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit d1d48fd18abcec95383b54bbb4530367f2168f4f Merge: 075ed7b9e4087 25c7d38579503 Author: Arnd Bergmann Date: Fri Sep 23 17:58:08 2022 +0200 Merge tag 'qcom-arm64-defconfig-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM64 defconfig updates for 6.1 This enables core providers needed to boot SC8180X, sound drivers for SC7180 and SC7280, the Qualcomm EDP PHY, last-level cache controller driver, on-chip memory driver and the SPM driver. * tag 'qcom-arm64-defconfig-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Enabled SC8180x configs arm64: defconfig: enable newer Qualcomm SoC sound drivers arm64: defconfig: enable more Qualcomm drivers Link: https://lore.kernel.org/r/20220921150314.1312358-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 075ed7b9e408773ffa901856a2d4d476da649a9b Author: Mark Brown Date: Mon Sep 19 17:27:53 2022 +0100 arm64: configs: Enable all PMUs provided by Arm The selection of PMUs enabled in the defconfig is currently a bit random and does not include a number of those provided by Arm and present in a fairly wide range of SoCs. Improve coverage and defconfig utility by enabling all the Arm provided PMUs by default. Signed-off-by: Mark Brown Reviewed-by: James Clark Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220919162753.3079869-1-broonie@kernel.org' Signed-off-by: Arnd Bergmann commit e1381b13eef23c61907218ac733364f0d32da3a8 Merge: 7b04ab83762e4 561044b5d6526 Author: Arnd Bergmann Date: Fri Sep 23 17:56:08 2022 +0200 Merge tag 'sunxi-config-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/defconfig Enable devfreq cooling device driver in arm64 defconfig * tag 'sunxi-config-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: defconfig: Enable devfreq cooling device Link: https://lore.kernel.org/r/YyePcA5YHOZjdOf7@kista.localdomain Signed-off-by: Arnd Bergmann commit 7b04ab83762e4478afc8f2c5813eede85cde4fb7 Merge: 79774742bde74 747c39f0ebfae Author: Arnd Bergmann Date: Fri Sep 23 17:55:11 2022 +0200 Merge tag 'tegra-for-6.1-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfig arm64: tegra: Default configuration changes for v6.1-rc1 Enables the new MGBE driver, as well as the existing SPI and QSPI drivers on 64-bit ARM. The GPC DMA driver is now also built into the kernel by default to avoid needless probe deferrals that would slow down the boot process significantly. * tag 'tegra-for-6.1-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: defconfig: Make TEGRA186_GPC_DMA built-in arm64: tegra: Enable Tegra SPI & QSPI in deconfig arm64: defconfig: Enable Tegra MGBE driver Link: https://lore.kernel.org/r/20220916101957.1635854-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 4cb59d5069f2d29c8c5ae20602599d3db918fee3 Merge: 37d49c249cb8f 4678a2d352e05 Author: Arnd Bergmann Date: Fri Sep 23 17:52:00 2022 +0200 Merge tag 'hisi-drivers-for-6.1' of https://github.com/hisilicon/linux-hisi into arm/drivers HiSilicon driver updates for 6.1: - some small improvements to the hisi_lpc driver * tag 'hisi-drivers-for-6.1' of https://github.com/hisilicon/linux-hisi: bus: hisi_lpc: Use platform_device_register_full() bus: hisi_lpc: Don't guard ACPI IDs with ACPI_PTR() bus: hisi_lpc: Correct error code for timeout bus: hisi_lpc: Use devm_platform_ioremap_resource bus: hisi_lpc: Don't dereference fwnode handle Link: https://lore.kernel.org/r/631FE463.6070701@hisilicon.com Signed-off-by: Arnd Bergmann commit 01c65733fadbd1f48d8c1fbd366be49ce44d6471 Merge: 79a9059970f73 649acf24d8c86 Author: Arnd Bergmann Date: Fri Sep 23 17:50:01 2022 +0200 Merge tag 'mvebu-dt-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt for 6.1 (part 1) Add definitions for PCIe legacy INTx interrupts for dts using pci-mvebu.c controller driver. Add gpio-ranges for pin muxing for Armada 38x Add audio support for Armada 38x Turris-omnia (Armada 385 based) fix a pin name lsxl (kirkwood based) - Fix fix serial line - Remove first ethernet port * tag 'mvebu-dt-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: (22 commits) ARM: dts: turris-omnia: Add label for wan port ARM: dts: turris-omnia: Define S/PDIF audio card ARM: mvebu: Add spdif-pins mpp pins for Armada 38x ARM: mvebu: add audio support to Armada 385 DB ARM: mvebu: add audio I2S controller to Armada 38x Device Tree ARM: dts: armada-38x: Add gpio-ranges for pin muxing ARM: dts: dove: Add definitions for PCIe error interrupts ARM: dts: kirkwood: Add definitions for PCIe error interrupts ARM: dts: armada-39x.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-380.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-375.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-xp-mv78460.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-xp-mv78260.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-xp-mv78230.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-xp-98dx3236.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: armada-370.dtsi: Add definitions for PCIe legacy INTx interrupts ARM: dts: dove: Add definitions for PCIe legacy INTx interrupts ARM: dts: kirkwood: Add definitions for PCIe legacy INTx interrupts ARM: dts: kirkwood: lsxl: remove first ethernet port ARM: dts: kirkwood: lsxl: fix serial line ... Link: https://lore.kernel.org/r/87edw2xfle.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 79a9059970f73df1a4e418d4805d5f18f662dcc8 Merge: 141258d4301e0 8e9d75fd2ec2a Author: Arnd Bergmann Date: Fri Sep 23 17:49:07 2022 +0200 Merge tag 'omap-for-6.1/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Devicetree changes for omaps A series of changes for am335x baltos and netcom devices to update nand transfer type and configure gpio-line-names. * tag 'omap-for-6.1/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x-netcom: add GPIO names for NetCom Plus 2-port devices ARM: dts: am335x-netcom: add GPIO names for NetCom Plus 8-port devices ARM: dts: am335x-netcan: add GPIO names for NetCAN Plus device ARM: dts: am335x-baltos: add GPIO names for ir2110 device ARM: dts: am335x-baltos: add GPIO names for ir3220 and ir5221 devices ARM: dts: am335x-baltos: change nand-xfer-type Link: https://lore.kernel.org/r/pull-1663587735-853102@atomide.com Signed-off-by: Arnd Bergmann commit 141258d4301e0dd8b73e22a2b77d8a0f3e84cd76 Merge: 6972b275fedc1 2b14d382ec97c Author: Arnd Bergmann Date: Fri Sep 23 17:47:08 2022 +0200 Merge tag 'mvebu-dt64-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt64 for 6.1 (part 1) - Add UART1-3 for AC5/AC5X SoC - Improve uDPU support (Aramda 3720 based board) - Add new eDPU based on uDPU * tag 'mvebu-dt64-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: 98dx25xx: use correct property for i2c gpios arm64: dts: marvell: add support for Methode eDPU dt-bindings: marvell: armada-37xx: add Methode eDPU compatible arm64: dts: marvell: split Methode uDPU DTS arm64: dts: marvell: rename temp sensor nodes arm64: dts: marvell: uDPU: remove LED node pinctrl-names arm64: dts: marvell: uDPU: align LED-s with bindings arm64: dts: marvell: uDPU: add missing SoC compatible arm64: dts: marvell: espressobin-ultra: add generic Espressobin compatible dt-bindings: marvell: convert Armada 37xx compatibles to YAML dt-bindings: vendor-prefixes: add Methode Electronics arm64: dts: marvell: Add UART1-3 for AC5/AC5X Link: https://lore.kernel.org/r/87h70yxfmy.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 37d49c249cb8f9da6675cb23534c3ca478ffd3a4 Merge: b49aae5e9493e df646a17f103c Author: Arnd Bergmann Date: Fri Sep 23 17:40:27 2022 +0200 Merge tag 'qcom-drivers-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for 6.1 The icc-bwmon driver is expected to support measuring LLCC/DDR bandwidth on SDM845 and SC7280. The LLCC driver is extended to provide per-platform register mappings to the LLCC EDAC driver. The QMI encoder/decoder is updated to allow the passed qmi_elem_info to be const. Support for SDM845 is added to the sleep stats driver. Power-domains for the SM6375 platform is added to RPMPD and the platform is added to socinfo, together with the PM6125 pmic id. A couple of of_node reference issues are corrected in the smem state and smsm drivers. The Qualcomm SCM driver binding is converted to YAML. * tag 'qcom-drivers-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (29 commits) soc: qcom: rpmpd: Add SM6375 support dt-bindings: power: rpmpd: Add SM6375 power domains firmware: qcom: scm: remove unused __qcom_scm_init declaration dt-bindings: power: qcom,rpmpd: drop non-working codeaurora.org emails soc: qcom: icc-bwmon: force clear counter/irq registers soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON dt-bindings: interconnect: qcom,msm8998-bwmon: Add support for sc7280 BWMONs soc: qcom: llcc: Pass LLCC version based register offsets to EDAC driver soc: qcom: llcc: Rename reg_offset structs to reflect LLCC version soc: qcom: qmi: use const for struct qmi_elem_info soc: qcom: icc-bwmon: remove redundant ret variable dt-bindings: soc: qcom: stats: Document SDM845 compatible soc: qcom: stats: Add SDM845 stats config and compatible dt-bindings: firmware: document Qualcomm SM6115 SCM soc: qcom: Make QCOM_RPMPD depend on OF dt-bindings: firmware: convert Qualcomm SCM binding to the yaml soc: qcom: socinfo: Add PM6125 ID soc: qcom: socinfo: Add an ID for SM6375 soc: qcom: smem_state: Add refcounting for the 'state->of_node' soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe() ... Link: https://lore.kernel.org/r/20220921155753.1316308-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit b49aae5e9493e5eea85346dfa4294f16d396f30d Merge: 891518b717538 b404cb45990bf Author: Arnd Bergmann Date: Fri Sep 23 17:37:15 2022 +0200 Merge tag 'v6.0-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers pmic-wrapper: - add support for mt8188 SVS: - several driver cleanups power-domain: - several cleanups of the dt-bindings and driver mutex: - add support to mt6795 disp mutex - add support for mt8186 mdp3 mutex * tag 'v6.0-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: Add mmsys func to adapt to dpi output for MT8186 soc: mediatek: mutex: Add support for MT6795 Helio X10 display mutex dt-bindings: soc: mediatek: Add display mutex support for MT6795 soc: mediatek: mutex: Add mt8186 mutex mod settings for mdp3 dt-bindings: soc: mediatek: Add mdp3 mutex support for mt8186 soc: mediatek: pm-domains: Simplify some error message soc: mediatek: mtk-svs: Explicitly include bitfield header soc: mediatek: mtk-svs: Use bitfield access macros where possible soc: mediatek: mtk-svs: Commonize t-calibration-data fuse array read dt-bindings: power: mediatek: Update maintainer list dt-bindings: power: mediatek: Support naming power controller node with unit address dt-bindings: power: mediatek: Refine multiple level power domain nodes soc: mediatek: mtk-svs: Use devm variant for dev_pm_opp_of_add_table() soc: mediatek: mtk-svs: Drop of_match_ptr() for of_match_table soc: mediatek: mtk-svs: Remove hardcoded irqflags soc: mediatek: mtk-svs: Switch to platform_get_irq() dt-bindings: soc: mediatek: pwrap: add compatible for mt8188 soc: mediatek: Let PMIC Wrapper and SCPSYS depend on OF Link: https://lore.kernel.org/r/498fe3e5-a237-121a-d500-fbb0994906cb@gmail.com Signed-off-by: Arnd Bergmann commit 891518b717538a255fc08277cfc0277dd3f8f6bb Merge: b97e1e2faa3c6 1f698cb11dd48 Author: Arnd Bergmann Date: Fri Sep 23 17:36:09 2022 +0200 Merge tag 'sunxi-drivers-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/drivers sunxi SRAM driver changes: - minor code refactor - support for Allwinner D1 * tag 'sunxi-drivers-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: soc: sunxi: sram: Add support for the D1 system control soc: sunxi: sram: Export the LDO control register soc: sunxi: sram: Save a pointer to the OF match data soc: sunxi: sram: Return void from the release function soc: sunxi: sram: Fix debugfs info for A64 SRAM C soc: sunxi: sram: Fix probe function ordering issues soc: sunxi: sram: Prevent the driver from being unbound soc: sunxi: sram: Actually claim SRAM regions Link: https://lore.kernel.org/r/YyeOthH4y8wy8A8R@kista.localdomain Signed-off-by: Arnd Bergmann commit b97e1e2faa3c611a61da7a26cc2e5ee83434ded0 Merge: a30f202fdc27f e9aa77d413c90 Author: Arnd Bergmann Date: Fri Sep 23 17:34:19 2022 +0200 Merge tag 'imx-drivers-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX drivers change for 6.1: - Update i.MX8MP blk-ctrl driver to handle PCIe PHY reset bit. - Add interconnect support into i.MX8MP blk-ctrl driver, so that i.MX8MP NoC can be set up properly after related power domain is up. - Add blk-ctrl support for i.MX8MP HDMI HDCP/HRV and VPU block. - Add i.MX93 SRC power domain and MEDIA blk-ctrl driver. - Update imx8m-blk-ctrl driver to use genpd_xlate_onecell. * tag 'imx-drivers-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (26 commits) soc: imx: add i.MX93 media blk ctrl driver soc: imx: add i.MX93 SRC power domain driver soc: imx: imx8m-blk-ctrl: Use genpd_xlate_onecell soc: imx: imx8mp-blk-ctrl: handle PCIe PHY resets soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV_MWR soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl soc: imx: add icc paths for i.MX8MP media blk ctrl dt-bindings: arm: imx: update fsl.yaml for imx8dxl dt-bindings: firmware: add missing resource IDs for imx8dxl dt-bindings: arm: Add i.MX8M Mini Gateworks GW7904 board dt-bindings: soc: add i.MX93 mediamix blk ctrl dt-bindings: soc: add i.MX93 SRC dt-bindings: mfd: syscon: Add i.MX93 blk ctrl system registers dt-bindings: arm: fsl: Add MSC SM2S-IMX8PLUS SoM and SM2-MB-EP1 Carrier dt-bindings: arm: fsl: Add Kontron BL i.MX8MM OSM-S board dt-bindings: arm: fsl: Rename compatibles for Kontron i.MX8MM SoM/board dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl dt-bindings: soc: imx: add interconnect property for i.MX8MM vpu blk ctrl dt-bindings: soc: imx: drop minItems for i.MX8MM vpu blk ctrl ... Link: https://lore.kernel.org/r/20220918092806.2152700-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit a30f202fdc27f527900d095d95765c6e646a8db1 Merge: 3879b6604cf46 fa586abcfe4b4 Author: Arnd Bergmann Date: Fri Sep 23 17:33:38 2022 +0200 Merge tag 'tegra-for-6.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers firmware: tegra: Changes for v6.1-rc1 A simple cleanup for user memory usage in the BPMP debugfs support. * tag 'tegra-for-6.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Switch over to memdup_user() Link: https://lore.kernel.org/r/20220916101957.1635854-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 3879b6604cf46eb10a498b686bcfb8c4412c6b2b Merge: f5a5e83379b53 74f7f183d81c2 Author: Arnd Bergmann Date: Fri Sep 23 17:32:34 2022 +0200 Merge tag 'tegra-for-6.1-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: Changes for v6.1-rc1 This contains an assortment of small fixes and cleanups. One new feature is introduced in the form of simple wake events which are needed to wake the system from sleep on USB port events. * tag 'tegra-for-6.1-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Check device node status property soc/tegra: pmc: Use devm_clk_get_optional() soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA soc/tegra: pmc: Add USB port wake events for Tegra194 soc/tegra: pmc: Add support for simple wake events soc/tegra: pmc: Remove leading space soc/tegra: fuse: Add missing of_node_put() soc/tegra: fuse: Add missing of_node_put() in tegra_init_fuse() Link: https://lore.kernel.org/r/20220916101957.1635854-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 649acf24d8c86ab8861a05cdd6833100a5fe4e78 Author: Pali Rohár Date: Wed Sep 21 13:50:37 2022 +0200 ARM: dts: turris-omnia: Add label for wan port Device tree label property should contain label from the box/stick. Labels for other ports are already specified in DT but wan is missing. So add missing label for wan port. Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit ea31483565a1fff3bf8c41238fe0460ec691f224 Author: Pali Rohár Date: Tue Sep 20 15:26:48 2022 +0200 ARM: dts: turris-omnia: Define S/PDIF audio card Turris Omnia has GPIO51 exported on pin header U16, which works in S/PDIF output mode. So define S/PDIF audio output card for this pin. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 424175c5b4b2dc59f95a6d608fe709cfcc41a0ce Author: Pali Rohár Date: Tue Sep 20 15:26:47 2022 +0200 ARM: mvebu: Add spdif-pins mpp pins for Armada 38x S/PDIF function on Armada 38x uses only mpp51 pin. So add spdif-pins mpp pins section for it. It is needed for boards without i2s. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 18960771a172843d360f90c8cd094a5f6b855716 Author: Marcin Wojtas Date: Tue Sep 20 15:26:46 2022 +0200 ARM: mvebu: add audio support to Armada 385 DB This commit adds the necessary Device Tree information to enable audio support on the Armada 385 DB platform. In details it: * Instantiates the CS42L51 audio codec on the I2C0 bus * Adds simple-card DT binding for audio on Armada 385 DB * Adds description for both analog I2S and S/PDIF I/O * Disabled by default Signed-off-by: Marcin Wojtas Signed-off-by: Nadav Haklai Tested-by: Star_Automation Tested-by: Lior Amsalem Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 72ef30aa100a8d0e2a249112d6bc99dfdd0f70b5 Author: Marcin Wojtas Date: Tue Sep 20 15:26:45 2022 +0200 ARM: mvebu: add audio I2S controller to Armada 38x Device Tree This commit adds the description of the I2S controller to the Marvell Armada 38x SoC's Device Tree, as well as its pin configuration. Signed-off-by: Marcin Wojtas Reviewed-by: Nadav Haklai Tested-by: Nadav Haklai Tested-by: Lior Amsalem [pali: Fix i2s-pins name] Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit f7f04d198334d6f69c76c8f8675194551a3da574 Author: Masahiro Yamada Date: Fri Sep 23 20:38:35 2022 +0900 lib/sg_pool: change module_init(sg_pool_init) to subsys_initcall sg_alloc_table_chained() is called by several drivers, but if it is called before sg_pool_init(), it results in a NULL pointer dereference in sg_pool_alloc(). Since commit 9b1d6c895002 ("lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c"), we rely on module_init(sg_pool_init) is invoked before other module_init calls but this assumption is fragile. I slightly changed the link order while refactoring Kbuild, then uncovered this issue. I should keep the current link order, but depending on a specific call order among module_init is so fragile. We usually define the init order by specifying *_initcall correctly, or delay the driver probing by returning -EPROBE_DEFER. Change module_initcall() to subsys_initcall(), and also delete the pointless module_exit() because lib/sg_pool.c is always compiled as built-in. (CONFIG_SG_POOL is bool) Link: https://lore.kernel.org/all/20220921043946.GA1355561@roeck-us.net/ Link: https://lore.kernel.org/all/8e70837d-d859-dfb2-bf7f-83f8b31467bc@samsung.com/ Fixes: 9b1d6c895002 ("lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c") Reported-by: Guenter Roeck Reported-by: Marek Szyprowski Signed-off-by: Masahiro Yamada Reviewed-by: Robin Murphy Tested-by: Marek Szyprowski Signed-off-by: Christoph Hellwig commit ec5c3a359cfaf68d4db30969745db18f9928aab9 Merge: 3d7a198cfdb47 a66de5283e166 Author: Michael Ellerman Date: Sat Sep 24 00:40:14 2022 +1000 Merge branch 'fixes' into next Merge our fixes branch to bring in a few things that new feature patches rely on or conflict with. commit 6972b275fedc1996cad03e8926f7f3ea03443e6b Merge: 78559d6fb8599 3d59187efc982 Author: Arnd Bergmann Date: Fri Sep 23 16:36:42 2022 +0200 Merge tag 'qcom-arm64-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM64 DTS updates for 6.1 Support for Samsung Galaxy E5, E7 and Grand Max is added, with support for both 32-bit and 64-bit variants. The Samsung Galaxy S4 Mini Value Edition gains magnetometer support. MSM8996-based Xiaomi devices gains descriptions of the LPG-based LEDs. On SA8295P ADP problems arising from regulators being switched into low-power mode is worked around by removing this ability, for now. The onboard USB Hub on SC7180 Trogdor is finally described and a few ADC related updates are introduced. On SC7280 support for the CPU and LLC bwmon instances are introduced. Soundwire, audio codecs and sound introduced for a variety of boards. Using required-opps the USB controllers votes for a minimum corner on VDD_CX. The onboard USB Hub Herobrine is described. A new board, the Google Evoker is added, as is another revision of Herobrine Villager. On SC8280XP the USB controllers are marked as wakeup-sources, to keep them powered during suspend. The CRD has HID devices marked as wakeup-sources to enable resuming the system. In addition to these changes the alternative touchpad is introduced on the Lenovo ThinkPad X13s. SDM845 gains RPMh stats support and the LLCC BWMON is added. For SM6350 interconnect providers and GPI DMA is introduced. A description of the PM7280b PMIC is added to Fairphone FP4 on SM7225. With the multi-MSI support added in the PCIe controller, SM8250 gets all its MSI interrupts added. UFS ICE and the second SDHCI controller is introduced on SM8450. Support for the Sony Xperia 1 IV is introduced. Throughout a variety of platforms the TCSR mutex syscon is replaced with the MMIO-based binding. TCSR nodes gained proper compatibles and halt syscon nodes are split out from the mutex ranges. A range of fixes to align with DT bindings are introduced. Among these are the changes to the follow the TLMM binding and suffix pinctrl states with -state and subnodes thereof with -pins, another is a number of changes transitioning to use -gpios and introduction of proper parent clock references in various clock providers. * tag 'qcom-arm64-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (136 commits) arm64: dts: qcom: sc7280: Add required-opps for USB arm64: dts: qcom: sm8450: fix UFS PHY serdes size arm64: dts: qcom: ipq8074: fix PCIe PHY serdes size arm64: dts: qcom: sa8295p-adp: add missing gpio-ranges in PMIC GPIOs arm64: dts: qcom: sa8295p-adp: add fallback compatible to PMIC GPIOs arm64: dts: qcom: msm8996-xiaomi: align PMIC GPIO pin configuration with DT schema arm64: dts: qcom: msm8994-msft-lumia-octagon: align resin node name with bindings arm64: dts: qcom: pmi8994: add missing MPP compatible fallback dt-bindings: pci: QCOM Add missing sc7280 aggre0, aggre1 clocks arm64: dts: qcom: sc7280: Add missing aggre0, aggre1 clocks arm64: dts: qcom: sc7280-villager: Adjust LTE SKUs dt-bindings: arm: qcom: Adjust LTE SKUs for sc7280-villager arm64: dts: qcom: sc7280-herobrine: Add nodes for onboard USB hub arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub arm64: dts: qcom: align SDHCI reg-names with DT schema arm64: dts: qcom: sm8250: provide additional MSI interrupts arm64: dts: qcom: msm8996: add #clock-cells and XO clock to the HDMI PHY node arm64: dts: qcom: Use WCD9335 DT bindings arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO ... Link: https://lore.kernel.org/r/20220921234854.1343238-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 78559d6fb859970dfb6adae0c572d6bf29cac40e Merge: aa577af3de3b6 5cbd20166f0ac Author: Arnd Bergmann Date: Fri Sep 23 16:35:16 2022 +0200 Merge tag 'qcom-dts-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM DTS updates for 6.1 This adds extends the IPQ8064 support with the two variants IPQ8062 and IPQ8065. MSM8974 and APQ8084 gained RPM stats support. The Audio DSP remoteproc was added to MSM8226 and enabled for ASUS ZenWatch 2 and LG G Watch R. MSM8660 gained one I2C and one SPI bus and the APQ8060 Dragonboard got the TMA340 Touchscreen described. A wide range of improvements are done throughout the DTS files to align with bindings, fix issues and improve structure on things. * tag 'qcom-dts-for-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (35 commits) ARM: dts: qcom: apq8026-lg-lenok: Enable ADSP ARM: dts: qcom: apq8026-asus-sparrow: Enable ADSP ARM: dts: qcom: msm8226: Add ADSP node ARM: dts: qcom: ipq8064: pad addresses to 8 digit ARM: dts: qcom: ipq8064: reorganize node order and sort them ARM: dts: qcom: align SDHCI clocks with DT schema ARM: dts: qcom: align SDHCI reg-names with DT schema ARM: dts: qcom: msm8960: add clocks to the MMCC device node ARM: dts: qcom: apq8064: add clocks to the MMCC device node ARM: dts: qcom: msm8960: add clocks to the GCC device node ARM: dts: qcom: apq8064: add clocks to the GCC device node ARM: dts: qcom: msm8960: add clocks to the LCC device node ARM: dts: qcom: apq8064: add clocks to the LCC device node ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO ARM: dts: qcom: msm8660: fix node names for fixed clocks ARM: dts: qcom: msm8660: add pxo/cxo clocks to the GCC node ARM: dts: qcom: apq8060-dragonboard: Add TMA340 to APQ8060 DragonBoard ARM: dts: qcom: msm8660: Add GSBI3 I2C bus ARM: dts: qcom: msm8660: Add GSBI1 SPI bus ... Link: https://lore.kernel.org/r/20220921222619.1338380-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit aa577af3de3b6fad1d41fa424d1a9bbbe84f68c0 Merge: c328a66dfd9a9 0d0a0b4413460 Author: Arnd Bergmann Date: Fri Sep 23 16:31:28 2022 +0200 Merge tag 'ti-k3-dt-for-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/dt TI K3 device tree updates for v6.1 New Features: AM62A: * Basic support for AM62A SoC and SK Board AM62: * EPWM support AM64: * GPMC, LED, Crypto accelerator support Fixes: J7200 pinmux node update Fixes for Crypto and RNG accelerators on AM65, J721e, J7200 Cleanups: Reorder SoC compatible and pinmux macros alphabetically * tag 'ti-k3-dt-for-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: (22 commits) arm64: dts: ti: k3-j7200: fix main pinmux range arm64: dts: ti: Add support for AM62A7-SK arm64: dts: ti: Introduce AM62A7 family of SoCs dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62A dt-bindings: arm: ti: Add bindings for AM62A7 SoC dt-bindings: arm: ti: Rearrange IOPAD macros alphabetically arm64: dts: ti: k3-am625-sk: Add epwm nodes arm64: dts: ti: k3-am62-main: Add epwm nodes arm64: dts: ti: k3-am642-sk: Add DT entry for onboard LEDs arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID arm64: dts: ti: k3-am65-main: Disable RNG node arm64: dts: ti: k3-j7200-main: Add main domain watchdog entries arm64: dts: ti: k3-am64-main: Add ELM (Error Location Module) node arm64: dts: ti: k3-am64-main: Add GPMC memory controller node arm64: dts: ti: k3-j721e-main: fix RNG node clock id arm64: dts: ti: k3-am64-main: Enable crypto accelerator arm64: dts: ti: k3-am64: Add SA2UL address space to Main CBASS ranges arm64: dts: ti: k3-am64-main: Add main_cpts label ... Link: https://lore.kernel.org/r/44729b46-27f9-94a0-17ed-8868649a4a0a@ti.com Signed-off-by: Arnd Bergmann commit a70abdd994cb0e799c131d3db2821c02f85422cd Author: Sean Hong Date: Fri Sep 23 13:51:33 2022 +0800 drm/panel-edp: Add AUO B116XAK01.6 Add support for the AUO - B116XAK01.6 (HW: 1A) panel. Signed-off-by: Sean Hong Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220923055133.302740-1-sean.hong@quanta.corp-partner.google.com commit 9d6b59478cc57469f57c57a492aee732d5ef094c Author: Sean Hong Date: Fri Sep 23 13:46:14 2022 +0800 drm/panel-edp: Add BOE NT116WHM-N21 Add support for the BOE - NT116WHM-N21 (HW: V8.2) panel. Signed-off-by: Sean Hong Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220923054614.302440-1-sean.hong@quanta.corp-partner.google.com commit 43bee41415a6e70719dfabfa52a413064c3cad51 Author: Sean Hong Date: Fri Sep 23 16:50:28 2022 +0800 drm/panel-edp: Add BOE NT116WHM-N21 (HW: V8.1) Add support for the BOE - NT116WHM-N21 (HW: V8.1) panel. Signed-off-by: Sean Hong Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220923085028.306790-1-sean.hong@quanta.corp-partner.google.com commit 9f4a57148120bc9178922445409836d9fb102aea Author: Sean Hong Date: Fri Sep 23 13:37:29 2022 +0800 drm/panel-edp: Add INX N116BCN-EA1 Add support for the INX - N116BCN-EA1 (HW: C4) panel. Signed-off-by: Sean Hong Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220923053729.301626-1-sean.hong@quanta.corp-partner.google.com commit c328a66dfd9a9814a8731590b357e1793749f228 Merge: 9cc2df424a956 4ebf297b93403 Author: Arnd Bergmann Date: Fri Sep 23 16:26:47 2022 +0200 Merge tag 'renesas-arm-dt-for-v6.1-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v6.1 (take two) - Merge Renesas ARM/ARM64 maintainers entries, - CAN support for the RZ/N1 SoC and the RZN1D-DB development board, - Watchdog, pin control, I2C (EEPROM), GPIO (LEDS/switches), and Ethernet support for the R-Car V4H SoC and the White Hawk development board, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v6.1-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (26 commits) arm64: dts: renesas: Adjust whitespace around '{' arm64: dts: renesas: rzg2ul-smarc: Include SoM DTSI into board DTS arm64: dts: renesas: rzg2ul-smarc-som: Drop enabling wdt2 ARM: dts: renesas: Fix USB PHY device and child node names arm64: dts: renesas: r8a779a0: Update to R-Car Gen4 compatible values arm64: dts: renesas: white-hawk-cpu: Add missing bootargs arm64: dts: renesas: spider-cpu: Add missing bootargs arm64: dts: renesas: spider: Move aliases and chosen arm64: dts: renesas: white-hawk-cpu: Add Ethernet support arm64: dts: renesas: white-hawk: Move aliases and chosen arm64: dts: renesas: r8a779g0: Add RAVB nodes arm64: dts: renesas: white-hawk-cpu: Add push switches arm64: dts: renesas: white-hawk-cpu: Add GP LEDs arm64: dts: renesas: r8a779g0: Add GPIO nodes arm64: dts: renesas: white-hawk: Add Ethernet sub-board arm64: dts: renesas: white-hawk: Add CSI/DSI sub-board arm64: dts: renesas: white-hawk: Add I2C0 and EEPROMs arm64: dts: renesas: r8a779g0: Add I2C nodes arm64: dts: renesas: white-hawk-cpu: Add serial port pin control arm64: dts: renesas: r8a779g0: Add pinctrl device node ... Link: https://lore.kernel.org/r/cover.1663588776.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 9cc2df424a956d17bdff18976fe9b3bf6dafda79 Merge: 9d88bf08e46dc 5ebb14aa5a193 Author: Arnd Bergmann Date: Fri Sep 23 16:19:55 2022 +0200 Merge tag 'v6.0-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt mt6795: - add add system timer node mt7986a: - add wifi support mt8183: - add MDP3 and keypad mt8186: - basic support for the Evaluation Board including, i2c, usb and uart. mt8192: - add nodes to support PWM, MIPI transciever, display with GCE and DSI. mt8195: - disable nodes not used on all boards - Add support for CPU freq, clocks, power domain controller, spmi, scp. - Enable audio decoder, DSP, IOMMU, mailbox. - Add display nodes for vdosys0. - On Cherry based chromebooks, enable the system companion processor, Cross EC, Google Security Chip, secondary MMC controller, trackpad and a few regulators. * tag 'v6.0-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: (34 commits) arm64: dts: mediatek: mt6795: Add CPUX system timer node arm64: dts: mt7986: add built-in Wi-Fi device nodes arm64: dts: mediatek: cherry: Enable MT6315 regulators on SPMI bus arm64: dts: mediatek: cherry: Enable Elantech eKTH3000 i2c trackpad arm64: dts: mediatek: cherry: Enable secondary SD/MMC controller arm64: dts: mediatek: cherry: Add keyboard mapping for the top row arm64: dts: mediatek: cherry: Add Google Security Chip (GSC) TPM arm64: dts: mediatek: cherry: Wire up the ChromeOS Embedded Controller arm64: dts: mediatek: cherry: Enable the System Companion Processor arm64: dts: mediatek: Fix build warnings of mt8173 vcodec nodes arm64: dts: mediatek: Add missing xHCI clocks for mt8192 and mt8195 arm64: dts: mt8192: Add dsi node arm64: dts: mt8192: Add display nodes arm64: dts: mediatek: Add mmsys #reset-cells property for mt8192 arm64: dts: mt8192: Add mipi_tx node arm64: dts: mt8192: Add pwm node arm64: dts: Add MediaTek MT8186 dts and evaluation board and Makefile arm64: dts: mt8195: Add display node for vdosys0 arm64: dts: mt8195: Add gce node arm64: dts: mt8195: Add iommu and smi nodes ... Link: https://lore.kernel.org/r/3b915692-c8a9-c508-5a4a-0fdb49355e99@gmail.com Signed-off-by: Arnd Bergmann commit 9d88bf08e46dc2d2975ef87877445a924a04a0a7 Author: Linus Walleij Date: Mon Sep 19 11:26:08 2022 +0200 ARM: dts: integrator: Tag PCI host with device_type The DT parser is dependent on the PCI device being tagged as device_type = "pci" in order to parse memory ranges properly. Fix this up. Signed-off-by: Linus Walleij Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220919092608.813511-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 9f1fe339ef27db26017e24e90b6a1abb6279d2d4 Merge: b805cc89bd390 35bd799307b26 Author: Arnd Bergmann Date: Fri Sep 23 16:18:07 2022 +0200 Merge tag 'sunxi-dt-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/dt - Allwinner A100 DMA node - Allwinner H6 GPU devfreq scaling - sunxi sram bindings cleanup and D1 addition * tag 'sunxi-dt-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: dt-bindings: sram: sunxi-sram: Add D1 compatible string dt-bindings: sram: sunxi-sram: Clean up the compatible lists arm64: dts: allwinner: beelink-gs1: Enable GPU OPP arm64: dts: allwinner: h6: Add GPU OPP table arm64: dts: allwinner: h6: Add cooling map for GPU arm64: dts: allwinner: a100: Add I2C DMA requests arm64: dts: allwinner: a100: Add device node for DMA controller Link: https://lore.kernel.org/r/YyePKDnOeP8Tdt5n@kista.localdomain Signed-off-by: Arnd Bergmann commit b805cc89bd390850781598bd8859bd23cb42ddea Merge: 07d0db46b3d29 d4e87e4e8486c Author: Arnd Bergmann Date: Fri Sep 23 16:10:56 2022 +0200 Merge tag 'imx-dt64-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm64 device tree change for 6.1: - New board support: i.MX8DXL EVK, Kontron SL/BL i.MX8MM OSM-S, i.MX8MM Gateworks GW7904, MSC SM2S-IMX8PLUS SoM and carrier board, NXP LS2081ARDB. - Update i.MX8MQ device tree to use generic name 'dma-controller' for SDMA. - A number of i.MX8ULP device tree improvements and updates: correct parent clock of LPI2C & LPSPI, increase the clock speed of LPSPI, add PMU and mailbox device, drop undocumented CGC property, enable FEC, etc. - Add interconnect property for various i.MX8MP blk-ctrl devices. - Enable VPU PGC, blk-ctrl and PCIe support for i.MX8MP SoC. - A set of changes from Peng Fan to add various devices for i.MX93 SoC, including MU, blk-ctrl, PMU, LPI2C, LPSPI, SRC, etc. - Two set of changes to update LS1043A and LS1046A device trees on various aspects, including USB3, PCIe, DMA, mdio-mux, QSPI Flash, etc. - Board imx8mq-librem5 update: add USB role switching, add RGB PWM notification LEDs, add voice coil motor for focus control, fix MIPI_CSI description. - A series from Frieder Schrempf to improve imx8mm-kontron device trees for VSELECT switch, DDRC operating point, SPI NOR partition layout etc. - A set of display and PMIC related additions and improvements on imx8mm-verdin board. - A number of i.MX8M Plus DHCOM PDK2 device tree improvments from Marek Vasut. - A few imx8mp-venice device tree updates on USB, cpufreq and WiFi/BT. - A series from Vladimir Oltean to enable multiple switch CPU ports support. - Other small and random board specific updates. * tag 'imx-dt64-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (90 commits) arm64: dts: ls1046a-qds: Modify the qspi flash frequency arm64: dts: ls1046a-qds: add mmio based mdio-mux nodes for FPGA arm64: dts: ls1046a: add gpios based i2c recovery information arm64: dts: ls1046a: use a pseudo-bus to constrain usb and sata dma size arm64: dts: ls1046a: make dma-coherent global to the SoC arm64: dts: ls1046a: add missing dma ranges property arm64: dts: ls1046a: Add big-endian property for PCIe nodes arm64: dts: ls1046a: Add the PME interrupt and big-endian to PCIe EP nodes arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node arm64: dts: ls1043a-rdb: add pcf85263 rtc node arm64: dts: ls1043a-qds: add mmio based mdio-mux support arm64: dts: ls1043a: use a pseudo-bus to constrain usb and sata dma size arm64: dts: ls1043a: add gpio based i2c recovery information arm64: dts: ls1043a: make dma-coherent global to the SoC arm64: dts: ls1043a: add missing dma ranges property arm64: dts: ls1043a: Add big-endian property for PCIe nodes arm64: dts: ls1043a: Add SCFG phandle for PCIe nodes arm64: dts: ls1043a: use pcie aer/pme interrupts arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node arm64: dts: ls1043a: fix the wrong size of dcfg space ... Link: https://lore.kernel.org/r/20220918092806.2152700-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 4dfa5f05fffac3a8fa4f9a68a671b5b7e6d3b411 Merge: f416bdfb6aa41 6eed756408c69 Author: Jakub Kicinski Date: Fri Sep 23 07:07:54 2022 -0700 Merge tag 'linux-can-next-for-6.1-20220923' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-09-23 The first 2 patches are by Ziyang Xuan and optimize registration and the sending in the CAN BCM protocol a bit. The next 8 patches target the gs_usb driver. 7 are by me and first fix the time hardware stamping support (added during this net-next cycle), rename a variable, convert the usb_control_msg + manual kmalloc()/kfree() to usb_control_msg_{send,rev}(), clean up the error handling and add switchable termination support. The patch by Rhett Aultman and Vasanth Sadhasivan convert the driver from usb_alloc_coherent()/usb_free_coherent() to kmalloc()/URB_FREE_BUFFER. The last patch is by Shang XiaoJing and removes an unneeded call to dev_err() from the ctucanfd driver. * tag 'linux-can-next-for-6.1-20220923' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: ctucanfd: Remove redundant dev_err call can: gs_usb: remove dma allocations can: gs_usb: add switchable termination support can: gs_usb: gs_make_candev(): clean up error handling can: gs_usb: convert from usb_control_msg() to usb_control_msg_{send,recv}() can: gs_usb: gs_cmd_reset(): rename variable holding struct gs_can pointer to dev can: gs_usb: gs_can_open(): initialize time counter before starting device can: gs_usb: add missing lock to protect struct timecounter::cycle_last can: gs_usb: gs_usb_get_timestamp(): fix endpoint parameter for usb_control_msg_recv() can: bcm: check the result of can_send() in bcm_can_tx() can: bcm: registration process optimization in bcm_module_init() ==================== Link: https://lore.kernel.org/r/20220923120859.740577-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit ff1b80ec841562b374083335f68f4de0c7f46ab4 Author: Song Liu Date: Fri Sep 2 13:52:08 2022 -0700 selftests/livepatch: add sysfs test Add a test for livepatch sysfs entries. Signed-off-by: Song Liu Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220902205208.3117798-3-song@kernel.org commit bb26cfd9e77e8dadd4be2ca154017bde9326cd4b Author: Song Liu Date: Fri Sep 2 13:52:07 2022 -0700 livepatch: add sysfs entry "patched" for each klp_object Add per klp_object sysfs entry "patched". It makes it easier to debug typos in the module name. Signed-off-by: Song Liu Reviewed-by: Joe Lawrence [pmladek@suse.com: Updated kernel version when the sysfs file will be introduced] Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220902205208.3117798-2-song@kernel.org commit f416bdfb6aa41300321fbfe59db049ffebd6198b Merge: aacdecda9eb4c 99383f1298ee2 Author: Jakub Kicinski Date: Fri Sep 23 06:56:12 2022 -0700 Merge branch 'net-macsec-remove-the-preparation-phase-when-offloading-operations' Antoine Tenart says: ==================== net: macsec: remove the preparation phase when offloading operations It was reported[1] the 2-step phase offloading of MACsec operations did not fit well and device drivers were mostly ignoring the first phase (preparation). In addition the s/w fallback in case h/w rejected an operation, which could have taken advantage of this design, never was implemented and it's probably not a good idea anyway (at least unconditionnally). So let's remove this logic which only makes the code more complex for no advantage, before there are too many drivers providing MACsec offloading. This series removes the first phase (preparation) of the MACsec h/w offloading. The modifications are split per-driver and in a way that makes bissection working with logical steps; but I can squash some patches if needed. This was tested on the MSCC PHY but not on the Altantic nor mlx5e NICs. [1] https://lore.kernel.org/all/166322893264.61080.12133865599607623050@kwain/T/ ==================== Link: https://lore.kernel.org/r/20220921135118.968595-1-atenart@kernel.org Signed-off-by: Jakub Kicinski commit 99383f1298ee25901b1f6a665bdcc3344acb2382 Author: Antoine Tenart Date: Wed Sep 21 15:51:18 2022 +0200 net: macsec: remove the prepare flag from the MACsec offloading context Now that the MACsec offloading preparation phase was removed from the MACsec core implementation as well as from drivers implementing it, we can safely remove the flag representing it. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 36c2ebced3a808d6fa3cc2847a4f20ef7c5d5b5b Author: Antoine Tenart Date: Wed Sep 21 15:51:17 2022 +0200 net/mlx5e: macsec: remove checks on the prepare phase Remove checks on the prepare phase as it is now unused by the MACsec core implementation. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 27418b55f094c3c8bb125759338f6476ab70f043 Author: Antoine Tenart Date: Wed Sep 21 15:51:16 2022 +0200 net: atlantic: macsec: remove checks on the prepare phase Remove checks on the prepare phase as it is now unused by the MACsec core implementation. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 6b701f4101e0d7db1084147e1413aaf26811cda5 Author: Antoine Tenart Date: Wed Sep 21 15:51:15 2022 +0200 net: phy: mscc: macsec: remove checks on the prepare phase Remove checks on the prepare phase as it is now unused by the MACsec core implementation. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 854c9181738f4f38a406f3941e6797e44c3b42d6 Author: Antoine Tenart Date: Wed Sep 21 15:51:14 2022 +0200 net: macsec: remove the prepare phase when offloading The hardware offloading in MACsec was initially supported using 2 phases. This was proposed in the RFC as this could have allowed easier fallback to the software implementation if the hardware did not support a feature or had enough entries already. But this fallback wasn't implemented and might not be a good idea after all. In addition it turned out this logic didn't mapped well the hardware logic and device drivers were mostly ignoring the preparation phase. Let's remove this as it does not offer any advantage and is ignored by drivers. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 135435f90b94e02842dd52c2cf23b6c2b6a90930 Author: Antoine Tenart Date: Wed Sep 21 15:51:13 2022 +0200 net: atlantic: macsec: make the prepare phase a noop In preparation for removing the MACsec h/w offloading preparation phase, make it a no-op in the Atlantic driver. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 920d998e5322def988190920cfd27cd89896a2b0 Author: Antoine Tenart Date: Wed Sep 21 15:51:12 2022 +0200 net: phy: mscc: macsec: make the prepare phase a noop In preparation for removing the MACsec h/w offloading preparation phase, make it a no-op in the MSCC phy driver. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 07d0db46b3d2950c0cedb3015bb8f19f90700c4e Merge: 2b14d7da65009 b7fd68ac27200 Author: Arnd Bergmann Date: Fri Sep 23 15:53:49 2022 +0200 Merge tag 'imx-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX device tree change for 6.1 - A series from Alexander Stein to add missing properties for i.MX6 SRAM. - Drop 'interrupts' property when 'interrupts-extended' is present. This fixes a dtbs_check warning with i.MX6 DT. - Update device trees to use generic name 'dma-controller' for SDMA. - A set of changes from Krzysztof Kozlowski to align SPI, LED and gpio-keys node name with dtschema. - A series of indentation and white-space cleanups from Marcel Ziswiler to address various checkpatch warnings. - Add DDR pinmux defines to VF610 DT header. - A couple of changes from Peng Fan to update clock-names and add IPG clock for i.MX7ULP LPI2C devices. - Improve device tree structure for Kontron i.MX6UL/ULL based boards. - A series of changes from Tim Harvey to add CAN regulator for Gateworks i.MX6QDL boards. - Various small and random board specific updates. * tag 'imx-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (40 commits) ARM: dts: imx6qdl-gw54xx: add CAN regulator ARM: dts: imx6qdl-gw53xx: add CAN regulator ARM: dts: imx6qdl-gw52xx: add CAN regulator ARM: dts: imx: update sdma node name format ARM: dts: imx6: skov: migrate to resistive-adc-touch ARM: dts: imx6sx-udoo-neo: don't use multiple blank lines ARM: dts: imx6sl: use tabs for code indent ARM: dts: imx6sx: add missing properties for sram ARM: dts: imx6sll: add missing properties for sram ARM: dts: imx6sl: add missing properties for sram ARM: dts: imx6qp: add missing properties for sram ARM: dts: imx6dl: add missing properties for sram ARM: dts: imx6q: add missing properties for sram ARM: dts: imx7ulp: Add IPG clock for lpi2c ARM: dts: imx7ulp: update the LPI2C clock-names ARM: dts: vf610: ddr pinmux ARM: dts: imx6qdl-dhcom: Move IPU iomux node from PDK2 to SoM file ARM: dts: imx6ul-kontron: Add imx6ull-kontron-bl to Makefile ARM: dts: imx6ul-kontron: Simplify devicetree structure ARM: dts: vf610: align SPI node name with dtschema ... Link: https://lore.kernel.org/r/20220918092806.2152700-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 4245fdba89b82befee0d963a85f7494c70432ee9 Author: Peter Ujfalusi Date: Fri Sep 23 16:36:16 2022 +0300 ASoC: SOF: ipc4: Call snd_sof_handle_fw_exception() in case of timeout It can help debugging IPC timeout issues (like we do with IPC3) if we dump the IPC and DSP information. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 01fb69d09afb896579e00c3dbc3c1aa74613dd86 Author: Peter Ujfalusi Date: Fri Sep 23 16:36:15 2022 +0300 ASoC: SOF: Intel: hda: Only dump firmware registers for IPC3 The firmware register dump is IPC3 specific, it is not available for other IPC versions. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit d01784ee680c558938baf6c4f184bee2bc612798 Author: Peter Ujfalusi Date: Fri Sep 23 16:36:14 2022 +0300 ASoC: SOF: Intel: mtl: Print relevant register in ipc_dump The use of the IPC registers are different between IPC3 and IPC4. The ipc_dump needs to use different prints depending on the used IPC protocol. The existing code was printing registers relevant for IPC3, which is not even supported on MTL. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 6759f35b234aa94e26e122afcd402ba2a39bd9d3 Author: Peter Ujfalusi Date: Fri Sep 23 16:36:13 2022 +0300 ASoC: SOF: Intel: skl: Use the ipc4 version of the ipc_dump The use of the IPC registers are different between IPC3 and IPC4. The ipc_dump needs to use different prints depending on the used IPC protocol. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 19d4aaf640913c5a8f1b06c9ef46287c32635299 Author: Tommaso Merciai Date: Mon Jun 20 18:13:20 2022 +0200 arm64: dts: rockchip: use pin constant for reset-gpios on px30-evb Use rk gpio naming convention into reset-gpios of ov5695 camera Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20220620161321.1898840-4-tommaso.merciai@amarulasolutions.com Signed-off-by: Heiko Stuebner commit 32b97c07c2a3b7cccc0c7e9a5b23970bd9a52c5d Author: Peter Ujfalusi Date: Fri Sep 23 16:36:12 2022 +0300 ASoC: SOF: Intel: hda: Add separate ops for ipc_dump for IPC4 The use of the IPC registers are different between IPC3 and IPC4. The ipc_dump needs to use different prints depending on the used IPC protocol. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 921890cae252ed7b7e4d9f98f63515c25cc0aede Author: Tommaso Merciai Date: Mon Jun 20 18:13:19 2022 +0200 arm64: dts: rockchip: add pinctrl for mipi-pdn pin on px30-evb Add right mux for mipi-pdn. Mux this pad as gpio2 14 Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20220620161321.1898840-3-tommaso.merciai@amarulasolutions.com Signed-off-by: Heiko Stuebner commit 8cde9667137f2ca8def8aef518305a78e5f55279 Author: Tommaso Merciai Date: Mon Jun 20 18:13:18 2022 +0200 arm64: dts: rockchip: set max drive-strength for cif_clkout_m0 on px30-evb Add max drive-strength for cif_clkout_m0. This fix the issue that sometimes camera ov5695 is not probed correctly. Tested on PX30_Mini_EVB_V11_20190507 Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20220620161321.1898840-2-tommaso.merciai@amarulasolutions.com Signed-off-by: Heiko Stuebner commit a996a333ad74d1f26c3831f1edd94a5d16798a0c Author: Peter Ujfalusi Date: Fri Sep 23 16:36:11 2022 +0300 ASoC: SOF: Intel: cnl: Add separate ops for ipc_dump for IPC4 The use of the IPC registers are different between IPC3 and IPC4. The ipc_dump needs to use different prints depending on the used IPC protocol. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20220923133616.26267-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 2b14d7da65009f68c7f31a20e411c2a8d133d825 Merge: f58ec42950d66 64e61a940d961 Author: Arnd Bergmann Date: Fri Sep 23 15:50:39 2022 +0200 Merge tag 'imx-bindings-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX DT bindings for 6.1: - Add compatible for new boards: Kontron BL i.MX8MM OSM-S, MSC SM2S-IMX8PLUS SoM and SM2-MB-EP1 Carrier, i.MX8M Mini Gateworks GW7904 board, i.MX8DXL EVK Board. - Add add interconnect property for i.MX8MP various blk-ctrl devices. - Add i.MX8MP HDMI HDCP and HRV power domain DT IDs. - Add bindings for i.MX93 SRC and MEDIAMIX blk-ctrl. - A minor style fix on i.MX8MM clock binding header. * tag 'imx-bindings-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: imx: update fsl.yaml for imx8dxl dt-bindings: firmware: add missing resource IDs for imx8dxl dt-bindings: arm: Add i.MX8M Mini Gateworks GW7904 board dt-bindings: soc: add i.MX93 mediamix blk ctrl dt-bindings: soc: add i.MX93 SRC dt-bindings: mfd: syscon: Add i.MX93 blk ctrl system registers dt-bindings: arm: fsl: Add MSC SM2S-IMX8PLUS SoM and SM2-MB-EP1 Carrier dt-bindings: arm: fsl: Add Kontron BL i.MX8MM OSM-S board dt-bindings: arm: fsl: Rename compatibles for Kontron i.MX8MM SoM/board dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl dt-bindings: soc: imx: add interconnect property for i.MX8MM vpu blk ctrl dt-bindings: soc: imx: drop minItems for i.MX8MM vpu blk ctrl dt-bindings: power: imx8mp-power: add HDMI HDCP/HRV dt-bindings: arm: fsl: imx6ul-kontron: Update bindings dt-bindings: clk: imx8mm: don't use multiple blank lines dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio blk ctrl dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi blk ctrl dt-bindings: soc: imx: add interconnect property for i.MX8MP media blk ctrl Link: https://lore.kernel.org/r/20220918092806.2152700-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit b6047ba2caaca41da8706c66c55f7b34e0714e21 Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:06 2022 +0000 arm64: dts: rockchip: add avdd-0v9-supply and avdd-1v8-supply on rk3399 rock 4c and pi4 this patch adds avdd-0v9-supply and avdd-1v8-supply to hdmi node for Radxa ROCK 4 series. Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-6-naoki@radxa.com Signed-off-by: Heiko Stuebner commit 06c5b5690a578514b3fe8f11a47a3c37d3af3696 Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:05 2022 +0000 arm64: dts: rockchip: sort nodes/properties on rk3399-rock-4 sort nodes/properties alphabetically Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-5-naoki@radxa.com Signed-off-by: Heiko Stuebner commit 69448624b770aa88a71536a16900dd3cc6002919 Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:04 2022 +0000 arm64: dts: rockchip: fix regulator name on rk3399-rock-4 fix regulator name ref: https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-4-naoki@radxa.com Signed-off-by: Heiko Stuebner commit b153f26d2c557ca49b5f98d256b3e44bc37244cd Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:03 2022 +0000 arm64: dts: rockchip: sort nodes/properties on rk3399-rock-4c-plus sort nodes/properties alphabetically Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-3-naoki@radxa.com Signed-off-by: Heiko Stuebner commit a088c855acb85ab52fdbffd9b3473f6c9a3f0b35 Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:02 2022 +0000 arm64: dts: rockchip: fix regulator structure on rk3399-rock-4c-plus fix regulator name. also, add vcc_3v3 and vdd_log. ref: https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4c_plus_v12_sch_220304.pdf Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-2-naoki@radxa.com Signed-off-by: Heiko Stuebner commit 110a1f0eea148a4c444e2327483e0e765d26704e Author: FUKAUMI Naoki Date: Fri Sep 9 19:50:01 2022 +0000 arm64: dts: rockchip: connect vcca_1v8 to APIO5_VDD on rk3399-rock-4c-plus GPIO pins for LEDs on ROCK 4C+ are in APIO5 Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220909195006.127957-1-naoki@radxa.com Signed-off-by: Heiko Stuebner commit f58ec42950d66a6a70bc7212e4521c28c57fbd65 Merge: 195571f342aee 8e4428051df12 Author: Arnd Bergmann Date: Fri Sep 23 15:43:43 2022 +0200 Merge tag 'tegra-for-6.1-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt arm64: tegra: Device tree changes for v6.1-rc1 These changes enable PCI, Ethernet and HDA support on Jetson AGX Orin. DMA support is enabled for I2C on a number of SoC generations and the Google Pixel C (a.k.a. Smaug) device receives Bluetooth and Wi-Fi support. Other than that this also contains some minor cleanups and fixes. * tag 'tegra-for-6.1-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Add GPCDMA support for Tegra I2C arm64: tegra: Add iommus for HDA on Tegra234 arm64: tegra: Enable HDA node for Jetson AGX Orin arm64: tegra: Add context isolation domains on Tegra234 arm64: tegra: Fixup iommu-map property formatting arm64: dts: tegra: smaug: Add Wi-Fi node arm64: dts: tegra: smaug: Add Bluetooth node arm64: tegra: Enable MGBE on Jetson AGX Orin Developer Kit arm64: tegra: Add MGBE nodes on Tegra234 arm64: tegra: Fix up compatible for Tegra234 GPCDMA arm64: tegra: Enable PCIe slots in P3737-0000 board arm64: tegra: Add P2U and PCIe controller nodes to Tegra234 DT arm64: tegra: Add regulators required for PCIe Link: https://lore.kernel.org/r/20220916101957.1635854-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 195571f342aeec7ae9659991a37948c3a2b8478e Merge: 2fef9856dcc6d cc99f95d49b3e Author: Arnd Bergmann Date: Fri Sep 23 15:42:42 2022 +0200 Merge tag 'tegra-for-6.1-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt dt-bindings: Changes for v6.1-rc1 Adds device tree bindings for the MGBE found on Tegra234 SoCs, as well as stream IDs for the shared host1x context devices. * tag 'tegra-for-6.1-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: Add Host1x context stream IDs on Tegra234 dt-bindings: net: Add Tegra234 MGBE Link: https://lore.kernel.org/r/20220916101957.1635854-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 2305b809be930ce02e095ee7207e8b1be4a5cd75 Author: Mark Rutland Date: Thu Sep 22 16:10:53 2022 +0100 arm64: uaccess: simplify uaccess_mask_ptr() We introduced uaccess pointer masking for arm64 in commit: 4d8efc2d5ee4c9cc ("arm64: Use pointer masking to limit uaccess speculation") Which was intended to prevent speculative uaccesses to kernel memory on CPUs where access permissions were not respected under speculation. At the time, the uaccess primitives were occasionally used to access kernel memory, with the maximum permitted address held in thread_info::addr_limit. Consequently, the address masking needed to take this dynamic limit into account. Subsequently the uaccess primitives were reworked such that they are only used for user memory, and as of commit: 3d2403fd10a1dbb3 ("arm64: uaccess: remove set_fs()") ... the address limit was made a compile-time constant, but the logic was otherwise unchanged. Regardless of the configured VA size or whether TBI is in use, the address space can be divided into three ranges: * The TTBR0 VA range, for which any valid pointer has bit 55 *clear*, and any non-tag bits [63-56] must match bit 55 (i.e. must be clear). * The TTBR1 VA range, for which any valid pointer has bit 55 *set*, and any non-tag bits [63-56] must match bit 55 (i.e. must be set). * The gap between the TTBR0 and TTBR1 ranges, where bit 55 may be set or clear, but any access will result in a fault. As the uaccess primitives are now only used for user memory in the TTBR0 VA range, we can prevent generation of TTBR1 addresses by clearing bit 55, which will either result in a TTBR0 address or a faulting address between the TTBR VA ranges. This is beneficial for code generation as: * We no longer clobber the condition codes. * We no longer burn a register on (TASK_SIZE_MAX - 1). * We no longer need to consume the untagged pointer. When building a defconfig v6.0-rc3 with GCC 12.1.0, this change makes the resulting Image 64KiB smaller. Signed-off-by: Mark Rutland Cc: James Morse Cc: Robin Murphy Cc: Will Deacon Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220922151053.3520750-1-mark.rutland@arm.com [catalin.marinas@arm.com: remove csdb() as the bit clearing is unconditional] Signed-off-by: Catalin Marinas commit aacdecda9eb4c65e5ed02c088f8fa4fd50bd327d Author: Matthieu Baerts Date: Fri Sep 23 10:23:06 2022 +0200 selftests/bonding: re-add lladdr target test It looks like this test has been accidentally dropped when resolving conflicts in this Makefile. Most probably because there were 3 different patches modifying this file in parallel: commit 152e8ec77640 ("selftests/bonding: add a test for bonding lladdr target") commit bbb774d921e2 ("net: Add tests for bonding and team address list management") commit 2ffd57327ff1 ("selftests: bonding: cause oops in bond_rr_gen_slave_id") The first one was applied in 'net-next' while the two other ones were recently applied in the 'net' tree. But that's alright, easy to fix by re-adding the missing one! Fixes: 0140a7168f8b ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20220923082306.2468081-1-matthieu.baerts@tessares.net Signed-off-by: Jakub Kicinski commit 21c93a95553d0a07091ff9894f09f5bffbfd8c8a Author: Richard Acayan Date: Tue Sep 20 18:33:30 2022 -0400 regulator: qcom,rpmh: add pm660 and pm660l pmics The SDM670 uses RPMh for managing the PM660 and PM660L. Document RPMh support for the PMIC. Link: https://android.googlesource.com/kernel/msm/+/58064f13c0a436a82c35f2e3b5a122d874ae5846%5E%21/#F0 Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220920223331.150635-2-mailingradian@gmail.com Signed-off-by: Mark Brown commit 911ce7cf72d9c1066a52928bffedaa103290db9e Author: Richard Acayan Date: Tue Sep 20 18:33:31 2022 -0400 regulator: qcom-rpmh: add pm660 and pm660l pmics The SDM630 and SDM660 both use RPM (not RPMh) for managing the PM660 and PM660L. The SDM670 uses RPMh to manage them as PMIC 4s. To support the SDM670, add the PM660 and PM660L to the RPMh regulator driver. Link: https://android.googlesource.com/kernel/msm/+/58064f13c0a436a82c35f2e3b5a122d874ae5846%5E%21/#F0 Link: https://android.googlesource.com/kernel/msm/+/f676d3d24f9d802bfe63369167c4a8cc162b8950%5E%21/#F3 Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220920223331.150635-3-mailingradian@gmail.com Signed-off-by: Mark Brown commit 0f47dd211938d5646f4041407089390bf89b96e8 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:12 2022 +0100 ASoC: codecs: va-macro: add support for sm8450 and sc8280xp LPASS VA Macro now has soundwire master to deal with access to analog mic in low power island use cases. This is added after sc8280xp, add support for this. Along with this also add compatibles for sm8450 and sc8280xp. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-13-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c55b7381d7932eb303dbd97691f89c1a9c452956 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:11 2022 +0100 ASoC: codecs: va-macro: clear the frame sync counter before enabling Clear the frame sync counter before enabling it. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-12-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c0bcaa72fabab1f2900aecc8643f33212c0072cc Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:10 2022 +0100 ASoC: codecs: rx-macro: add support for sm8450 and sc8280xp Add compatible for sm8450 and sc8280xp. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-11-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 7ca36514752fa5bdf0d237436dc0042aefbf42ad Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:09 2022 +0100 ASoC: codecs: tx-macro: add support for sm8450 and sc8280xp Add compatible for sm8450 and sc8280xp. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-10-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 8d2be441ebc1078eaa9f2b7aa7c6d3880973851e Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:08 2022 +0100 ASoC: codecs: wsa-macro: add support for sm8450 and sc8280xp Add compatible for sm8450 and sc8280xp. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-9-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 473d218b56559934ef4720a6fc086c8ad0da9d38 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:07 2022 +0100 ASoC: qcom: dt-bindings: add sm8450 and sc8280xp compatibles This patch adds SM8450 and SC8280XP compatible entry for LPASS TX, RX, WSA and VA codec macros. Signed-off-by: Srinivas Kandagatla Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220906170112.1984-8-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 3e29fb7479760d6d03380125d500b60081ccb5e9 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:06 2022 +0100 ASoC: codecs: wsa883x: add clock stop support WSA883x does support clock stop, so remove code that reset the Codec during runtime pm suspend and add flag to mark clock stop support. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-7-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c1057a08af438e0cf5450c1d977a3011198ed2f8 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:05 2022 +0100 ASoC: codecs: tx-macro: fix kcontrol put tx_macro_tx_mixer_put() and tx_macro_dec_mode_put() currently returns zero eventhough it changes the value. Fix this, so that change notifications are sent correctly. Fixes: d207bdea0ca9 ("ASoC: codecs: lpass-tx-macro: add dapm widgets and route") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 1c6a7f5250ce81f11a248f9bf88fdbca8b6b0b5d Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:04 2022 +0100 ASoC: codecs: tx-macro: fix active_decimator array currently active_decimator[] is unsigned long however we store negative values when there is no decimator setup -1. This is first bug, and the second bug is that we do not check if the decimator is valid before writing to register using decimator as offset in CDC_TXn_TX_PATH_CTL() Fix these both by making active_decimator as integer array and adding check in tx_macro_digital_mute() before accessing CDC_TXn_TX_PATH_CTL() register. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit d83a7201412d32e2ac76f20439470976b2edf699 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:03 2022 +0100 ASoC: codecs: tx-macro: handle swr_reset correctly Reset soundwire block on frame sync generation clock reset. Without this we are hitting read/write timeouts randomly during runtime pm. Along with this remove a swr_reset redundant flag. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 1a4e73915a7553d7ffb4f365b8a671bb2fa1f7ef Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:02 2022 +0100 ASoC: codecs: rx-macro: handle swr_reset correctly Reset soundwire block on frame sync generation clock reset. Without this we are hitting read/write timeouts randomly during runtime pm. Along with this remove a swr_reset redundant flag. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit fdc972d4a754b32cdf05294669ae0d6036242826 Author: Srinivas Kandagatla Date: Tue Sep 6 18:01:01 2022 +0100 ASoC: codecs: wsa-macro: handle swr_reset correctly Reset soundwire block on frame sync generation clock reset. Without this we are hitting read/write timeouts randomly during runtime pm. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 857300b7d5fd5ee4549cf687cd9b46eeb1663b5b Author: Joe Lawrence Date: Thu Aug 11 17:21:38 2022 -0400 selftests/livepatch: normalize sysctl error message The livepatch kselftests rely on comparing expected and actual output from such commands as sysctl. A recent commit in procps-ng v4.0.0 [1] changed sysctl's output to emit key pathnames like: sysctl: setting key "/proc/sys/kernel/ftrace_enabled": Device or resource busy versus previous dotted output: sysctl: setting key "kernel.ftrace_enabled": Device or resource busy The modification in output was later reverted [2], but since the change has been tagged in procps-ng v4.0.0, update the livepatch kselftest to handle either case. [1] https://gitlab.com/procps-ng/procps/-/commit/6389deca5bf667f5fab5912acde78ba8e0febbc7 [2] https://gitlab.com/procps-ng/procps/-/commit/b159c198c9160a8eb13254e2b631d0035b9b542c Reported-by: Dennis(Zhuoheng) Li Signed-off-by: Joe Lawrence Reviewed-by: Kamalesh Babulal Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220811212138.182575-1-joe.lawrence@redhat.com commit 04e0456f778de550a14d222d1a9ae0625511244d Author: Shang XiaoJing Date: Fri Sep 23 18:16:32 2022 +0800 spi: aspeed: Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220923101632.19170-1-shangxiaojing@huawei.com Signed-off-by: Mark Brown commit 2f3a896b0a416bbda633c98212f6490cfcfff310 Author: Dmitry Torokhov Date: Thu Sep 22 21:51:37 2022 -0700 spi: spi-mpc52xx: switch to using gpiod API This switches the driver to use gpiod API instead of legacy gpio API, which will brings us close to removing of_get_gpio() and other OF-specific old APIs. No functional change intended beyond some differences in error messages. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/Yy07WbMAG4bPgYNd@google.com Signed-off-by: Mark Brown commit 9671847f93a5291ad85f88210fb56e1a946b757b Author: Shang XiaoJing Date: Fri Sep 23 18:17:26 2022 +0800 spi: cadence: Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220923101726.19420-1-shangxiaojing@huawei.com Signed-off-by: Mark Brown commit 0402cca4828dd9556d36ddef67710993b7063f7c Author: Nathan Chancellor Date: Thu Sep 22 08:37:52 2022 -0700 ASoC: Intel: sof_da7219_mx98360a: Access num_codecs through dai_link After commit 3989ade2d1e7 ("ASoC: soc.h: remove num_cpus/codecs"), the following build error occurs: sound/soc/intel/boards/sof_da7219_max98373.c:198:27: error: no member named 'num_codecs' in 'struct snd_soc_pcm_runtime' for (j = 0; j < runtime->num_codecs; j++) { ~~~~~~~ ^ 1 error generated. This conversion was missed by the aforementioned change. Do it now to fix the build error. Fixes: 3989ade2d1e7 ("ASoC: soc.h: remove num_cpus/codecs") Signed-off-by: Nathan Chancellor Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922153752.336193-1-nathan@kernel.org Signed-off-by: Mark Brown commit 4f865485e8ef1d04de23fc1def1fa4e39fb00b91 Author: Gaosheng Cui Date: Fri Sep 23 17:03:55 2022 +0800 ASoC: fsl: Remove unused inline function imx_pcm_dma_params_init_data() The imx_pcm_dma_params_init_data() are no longer used since commit c31da0b196f9 ("ASoC: imx-ssi: Remove unused driver"), and the function is used to initialize some members of "struct imx_dma_data", it's more readable to assign the value directly, imx_pcm_dma_params_init_data is useless, so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220923090355.507648-1-cuigaosheng1@huawei.com Signed-off-by: Mark Brown commit 14ed837b9740cc6ec25910980d67c22894b4ff56 Author: AngeloGioacchino Del Regno Date: Thu Sep 22 12:35:02 2022 +0200 ASoC: mediatek: mt8195-mt6359: Use snd_soc_pm_ops instead of custom ops It is possible to use the standard snd_soc_pm_ops for this card: remove the custom mt8195_mt6359_pm_ops. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922103502.49981-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 68fb254e9ccca9e3f832f86b707eb2551aa5b86d Author: Yong Zhi Date: Thu Sep 22 14:36:44 2022 -0700 ASoC: SOF: Intel: MTL: remove the unnecessary snd_sof_dsp_read() The return val of snd_sof_dsp_read() right before polling the same register is not used, so remove the redundant call. Signed-off-by: Yong Zhi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220922213644.666315-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 6ae87bab269b347c725893ee162a0ad03ecca97c Author: Ranjani Sridharan Date: Thu Sep 22 14:36:43 2022 -0700 ASoC: SOF: Intel: MTL: reuse the common ops for PM Now that the disabling of interrupts and powering down the DSP has been abstracted, re-use the common ops for PM for MTL as well. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922213644.666315-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 0fbd539f666a7783b55507675b6c68673db27766 Author: Ranjani Sridharan Date: Thu Sep 22 14:36:42 2022 -0700 ASoC: SOF: Intel: HDA: use IPC version-specific ops Use the IP-specific ops for disabling interrupts and powering down the DSP in hda_suspend. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922213644.666315-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 39df087f6fa9436926b540d7d4022c09d0b8fde7 Author: Ranjani Sridharan Date: Thu Sep 22 14:36:41 2022 -0700 ASoC: SOF: Intel: MTL: define and set the disable_interrupts op Disable the IPC and SDW interrupts in the disable_interrupts op. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922213644.666315-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit b2520dbcb0d3646e70fedcaab2bdfb33df1c8508 Author: Ranjani Sridharan Date: Thu Sep 22 14:36:40 2022 -0700 ASoC: SOF: Intel: define and set the disable_interrupts op for cavs platforms Disable the IPC and SDW nterrupts in the disable_interrupts op for cavs platforms. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922213644.666315-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 423693a6c351f4abb869d1dbf5df7374766aaa1a Author: Ranjani Sridharan Date: Thu Sep 22 14:36:39 2022 -0700 ASoC: SOF: Intel: Add a new op for disabling interrupts The sequence for disabling DSP interrupts varies between different IP versions. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220922213644.666315-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit e32de6402e5b51cd6a24861987b1846606beec13 Author: Fred Oh Date: Thu Sep 22 14:36:38 2022 -0700 ASoC: SOF: Intel: use power_down_dsp op in hda_dsp_remove Use power_down_dsp op to differentiate power down sequences in platforms. Signed-off-by: Fred Oh Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220922213644.666315-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 2090cb9bf57471900d5cdf11b47dd1a121f021bf Author: Fred Oh Date: Thu Sep 22 14:36:37 2022 -0700 ASoC: SOF: Intel: mtl: define and set power_down_dsp op For MTL platform, dsp cores need to go power down first then dsp subsystem also need to set power down. Signed-off-by: Fred Oh Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220922213644.666315-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit c714031f936e11ef9e5695efdb73cd1f45eedb69 Author: Fred Oh Date: Thu Sep 22 14:36:36 2022 -0700 ASoC: SOF: Intel: define and set power_down_dsp op for HDA platforms hda_power_down_dsp is set for power_down_dsp op for all HDA platforms. Signed-off-by: Fred Oh Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220922213644.666315-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit af62eaf2872bf2c381f322c61f7ff751162797f6 Author: Fred Oh Date: Thu Sep 22 14:36:35 2022 -0700 ASoC: SOF: Intel: introduce new op to handle dsp power down DSP core power down sequences are different between cavs platforms and MTL. Signed-off-by: Fred Oh Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220922213644.666315-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 42de42c22453064ffc9b72c259b2ab901dd766dc Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:51 2022 -0400 ASoC: mediatek: mt8186-rt5682: Expose individual headset jack pins The rt5682 codec is able to distinguish between two event types: headphone insertion/removal and headset microphone insertion/removal. However, currently, the mt8186-rt5682 driver exposes a single kcontrol for the headset jack, so userspace isn't able to differentiate between the two events. Add a definition for the headset jack pins, so that a separate jack kcontrol is created for each one, allowing userspace to track and handle them individually. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-7-nfraprado@collabora.com Signed-off-by: Mark Brown commit d888e7afa03f06d8091ecdd43f87d5396dfbf907 Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:50 2022 -0400 ASoC: mediatek: mt8186-rt5682: Add headset widgets with switches Add DAPM widgets for headphones and headset microphone, with matching switches, to allow toggling these paths based on the jack connection status. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-6-nfraprado@collabora.com Signed-off-by: Mark Brown commit 8e986748680629a82398c65da0c5bda4c6a01b3d Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:49 2022 -0400 ASoC: mediatek: mt8186-da7219: Expose individual headset jack pins The da7219 codec is able to distinguish between two event types: headphone insertion/removal and headset microphone insertion/removal. However, currently, the mt8186-da7219 driver exposes a single kcontrol for the headset jack, so userspace isn't able to differentiate between the two events. Add a definition for the headset jack pins, so that a separate jack kcontrol is created for each one, allowing userspace to track and handle them individually. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-5-nfraprado@collabora.com Signed-off-by: Mark Brown commit 13bee4a16ac5c5f0e3a5db868df991be57e74aa5 Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:48 2022 -0400 ASoC: mediatek: mt8186-da7219: Add headset widgets with switches Add DAPM widgets for headphones and headset microphone, with matching switches, to allow toggling these paths based on the jack connection status. Note that differently from others (mt8192, mt8195 and mt8186-rt5682), the widget here is named "Headphones" (with an 's'), since "Headphone Switch" was already registered by da7219. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-4-nfraprado@collabora.com Signed-off-by: Mark Brown commit aa51e3c127a43cf4862db5f0081da281f1aa6429 Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:47 2022 -0400 ASoC: mediatek: mt8195: Expose individual headset jack pins The rt5682 codec is able to distinguish between two event types: headphone insertion/removal and headset microphone insertion/removal. However, currently, the mt8195 ASoC driver exposes a single kcontrol for the headset jack, so userspace isn't able to differentiate between the two events. Add a definition for the headset jack pins, so that a separate jack kcontrol is created for each one, allowing userspace to track and handle them individually. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-3-nfraprado@collabora.com Signed-off-by: Mark Brown commit 194ff8db03782d1dae41b7b42ea65da5748884c2 Author: Nícolas F. R. A. Prado Date: Thu Sep 22 19:59:46 2022 -0400 ASoC: mediatek: mt8192-mt6359: Expose individual headset jack pins The rt5682 codec is able to distinguish between two event types: headphone insertion/removal and headset microphone insertion/removal. However, currently, the mt8192-mt6359 driver exposes a single kcontrol for the headset jack, so userspace isn't able to differentiate between the two events. Add a definition for the headset jack pins, so that a separate jack kcontrol is created for each one, allowing userspace to track and handle them individually. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220922235951.252532-2-nfraprado@collabora.com Signed-off-by: Mark Brown commit e96bca7eaa5747633ec638b065630ff83728982a Author: Krzysztof Kozlowski Date: Wed Sep 21 16:53:54 2022 +0200 ASoC: wcd934x: fix order of Slimbus unprepare/disable Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream. Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220921145354.1683791-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit ea8ef003aa53ad23e7705c5cab1c4e664faa6c79 Author: Krzysztof Kozlowski Date: Wed Sep 21 16:53:53 2022 +0200 ASoC: wcd9335: fix order of Slimbus unprepare/disable Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220921145354.1683791-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 13a0ac816d22aa47d6c393f14a99f39e49b960df Author: Jean Delvare Date: Fri Sep 23 14:53:14 2022 +0200 firmware: dmi: Fortify entry point length checks Ensure that the SMBIOS entry point is long enough to include all the fields we need. Otherwise it is pointless to even attempt to verify its checksum. Also fix the maximum length check, which is technically 32, not 31. It does not matter in practice as the only valid values are 31 (for SMBIOS 2.x) and 24 (for SMBIOS 3.x), but let's still have the check right in case new fields are added to either structure in the future. Signed-off-by: Jean Delvare Reported-by: Linus Torvalds Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/lkml/20220823094857.27f3d924@endymion.delvare/T/ commit f7b1843eca6fe295ba0c71fc02a3291954078f2b Author: James Morse Date: Fri Sep 2 15:48:29 2022 +0000 x86/resctrl: Make resctrl_arch_rmid_read() return values in bytes resctrl_arch_rmid_read() returns a value in chunks, as read from the hardware. This needs scaling to bytes by mon_scale, as provided by the architecture code. Now that resctrl_arch_rmid_read() performs the overflow and corrections itself, it may as well return a value in bytes directly. This allows the accesses to the architecture specific 'hw' structure to be removed. Move the mon_scale conversion into resctrl_arch_rmid_read(). mbm_bw_count() is updated to calculate bandwidth from bytes. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-22-james.morse@arm.com commit d80975e264c8f01518890f3d91ab5bada8fa7f5e Author: James Morse Date: Fri Sep 2 15:48:28 2022 +0000 x86/resctrl: Add resctrl_rmid_realloc_limit to abstract x86's boot_cpu_data resctrl_rmid_realloc_threshold can be set by user-space. The maximum value is specified by the architecture. Currently max_threshold_occ_write() reads the maximum value from boot_cpu_data.x86_cache_size, which is not portable to another architecture. Add resctrl_rmid_realloc_limit to describe the maximum size in bytes that user-space can set the threshold to. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-21-james.morse@arm.com commit ae2328b52962531c2d7c6b531022a3eb2d680f17 Author: James Morse Date: Fri Sep 2 15:48:27 2022 +0000 x86/resctrl: Rename and change the units of resctrl_cqm_threshold resctrl_cqm_threshold is stored in a hardware specific chunk size, but exposed to user-space as bytes. This means the filesystem parts of resctrl need to know how the hardware counts, to convert the user provided byte value to chunks. The interface between the architecture's resctrl code and the filesystem ought to treat everything as bytes. Change the unit of resctrl_cqm_threshold to bytes. resctrl_arch_rmid_read() still returns its value in chunks, so this needs converting to bytes. As all the users have been touched, rename the variable to resctrl_rmid_realloc_threshold, which describes what the value is for. Neither r->num_rmid nor hw_res->mon_scale are guaranteed to be a power of 2, so the existing code introduces a rounding error from resctrl's theoretical fraction of the cache usage. This behaviour is kept as it ensures the user visible value matches the value read from hardware when the rmid will be reallocated. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-20-james.morse@arm.com commit 38f72f50d6498ee60ac89deff3686e34ce0c2a32 Author: James Morse Date: Fri Sep 2 15:48:26 2022 +0000 x86/resctrl: Move get_corrected_mbm_count() into resctrl_arch_rmid_read() resctrl_arch_rmid_read() is intended as the function that an architecture agnostic resctrl filesystem driver can use to read a value in bytes from a counter. Currently the function returns the MBM values in chunks directly from hardware. When reading a bandwidth counter, get_corrected_mbm_count() must be used to correct the value read. get_corrected_mbm_count() is architecture specific, this work should be done in resctrl_arch_rmid_read(). Move the function calls. This allows the resctrl filesystems's chunks value to be removed in favour of the architecture private version. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-19-james.morse@arm.com commit 1d81d15db39c2b517bc58f63008c6255dd08aafe Author: James Morse Date: Fri Sep 2 15:48:25 2022 +0000 x86/resctrl: Move mbm_overflow_count() into resctrl_arch_rmid_read() resctrl_arch_rmid_read() is intended as the function that an architecture agnostic resctrl filesystem driver can use to read a value in bytes from a counter. Currently the function returns the MBM values in chunks directly from hardware. When reading a bandwidth counter, mbm_overflow_count() must be used to correct for any possible overflow. mbm_overflow_count() is architecture specific, its behaviour should be part of resctrl_arch_rmid_read(). Move the mbm_overflow_count() calls into resctrl_arch_rmid_read(). This allows the resctrl filesystems's prev_msr to be removed in favour of the architecture private version. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-18-james.morse@arm.com commit 8286618aca331bf17323ff3023ca831ac6e4b86f Author: James Morse Date: Fri Sep 2 15:48:24 2022 +0000 x86/resctrl: Pass the required parameters into resctrl_arch_rmid_read() resctrl_arch_rmid_read() is intended as the function that an architecture agnostic resctrl filesystem driver can use to read a value in bytes from a hardware register. Currently the function returns the MBM values in chunks directly from hardware. To convert this to bytes, some correction and overflow calculations are needed. These depend on the resource and domain structures. Overflow detection requires the old chunks value. None of this is available to resctrl_arch_rmid_read(). MPAM requires the resource and domain structures to find the MMIO device that holds the registers. Pass the resource and domain to resctrl_arch_rmid_read(). This makes rmid_dirty() too big. Instead merge it with its only caller, and the name is kept as a local variable. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-17-james.morse@arm.com commit 4d044c521a63b2cd394ea6e3547012032145e47e Author: James Morse Date: Fri Sep 2 15:48:23 2022 +0000 x86/resctrl: Abstract __rmid_read() __rmid_read() selects the specified eventid and returns the counter value from the MSR. The error handling is architecture specific, and handled by the callers, rdtgroup_mondata_show() and __mon_event_count(). Error handling should be handled by architecture specific code, as a different architecture may have different requirements. MPAM's counters can report that they are 'not ready', requiring a second read after a short delay. This should be hidden from resctrl. Make __rmid_read() the architecture specific function for reading a counter. Rename it resctrl_arch_rmid_read() and move the error handling into it. A read from a counter that hardware supports but resctrl does not now returns -EINVAL instead of -EIO from the default case in __mon_event_count(). It isn't possible for user-space to see this change as resctrl doesn't expose counters it doesn't support. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-16-james.morse@arm.com commit 6eed756408c69687613a83fd221431c8790cf0bb Author: Shang XiaoJing Date: Fri Sep 23 17:58:35 2022 +0800 can: ctucanfd: Remove redundant dev_err call devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/all/20220923095835.14647-1-shangxiaojing@huawei.com Signed-off-by: Marc Kleine-Budde commit 62f102c0d1563ff6a31082f5d83b886ad2ff7ca0 Author: Vasanth Sadhasivan Date: Tue Sep 20 11:47:24 2022 -0400 can: gs_usb: remove dma allocations DMA allocated buffers are a precious resource. If there is no need for DMA allocations, then it might be worth to use non-dma allocated buffers. After testing the gs_usb driver with and without DMA allocation, there does not seem to be a significant change in latency or CPU utilization either way. Therefore, DMA allocation is not necessary and removed. Internal buffers used within urbs were managed and freed manually. These buffers are no longer needed to be managed by the driver. The URB_FREE_BUFFER flag, allows for the buffers in question to be automatically freed. Co-developed-by: Rhett Aultman Signed-off-by: Rhett Aultman Signed-off-by: Vasanth Sadhasivan Link: https://lore.kernel.org/all/20220920154724.861093-2-rhett.aultman@samsara.com Signed-off-by: Marc Kleine-Budde commit 906e0e6886afcad6f9cd86660d4b0bdf63f4f200 Author: Marc Kleine-Budde Date: Sun Sep 18 16:41:38 2022 +0200 can: gs_usb: add switchable termination support The candleLight community is working on switchable termination support for the candleLight firmware. As the the Linux CAN framework supports switchable termination add this feature to the gs_usb driver. Devices supporting the feature should set the GS_CAN_FEATURE_TERMINATION and implement the GS_USB_BREQ_SET_TERMINATION and GS_USB_BREQ_GET_TERMINATION control messages. For now the driver assumes for activated termination the standard termination value of 120Ω. Link: https://lore.kernel.org/all/20220923074114.662045-1-mkl@pengutronix.de Link: https://github.com/candle-usb/candleLight_fw/issues/92 Link: https://github.com/candle-usb/candleLight_fw/pull/109 Link: https://github.com/candle-usb/candleLight_fw/pull/108 Cc: Daniel Trevitz Cc: Ryan Edwards Signed-off-by: Marc Kleine-Budde commit 68822f4e74f35168134b0d3ad7e536a15f42ba04 Author: Marc Kleine-Budde Date: Sun Sep 18 22:59:27 2022 +0200 can: gs_usb: gs_make_candev(): clean up error handling Introduce a label to free the allocated candev in case of an error and make use of if. Fix a memory leak if the extended bit timing cannot be read. Extend the error messages to print the number of the failing channel and the symbolic error name. Link: https://lore.kernel.org/all/20220921193902.575416-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3814ed27548a1eb9c935c56321e26b383ed8f1d7 Author: Marc Kleine-Budde Date: Sun Sep 18 22:42:59 2022 +0200 can: gs_usb: convert from usb_control_msg() to usb_control_msg_{send,recv}() Convert the driver to use usb_control_msg_{send,recv}() instead of usb_control_msg(). These functions allow the data to be placed on the stack. This makes the driver a lot easier as we don't have to deal with dynamically allocated memory. Link: https://lore.kernel.org/all/20220921193902.575416-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 00246751868888cad3f506eac2b32df916145de7 Author: Marc Kleine-Budde Date: Tue Sep 20 23:21:42 2022 +0200 can: gs_usb: gs_cmd_reset(): rename variable holding struct gs_can pointer to dev Most of the driver uses the variable "dev" to point to the struct gs_can. Use the same name in gs_cmd_reset(), too. Rename gsdev to dev. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/all/20220921193902.575416-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 103108cb9673814a1f73522dacc79ad28cfc0271 Author: Marc Kleine-Budde Date: Tue Sep 20 11:46:12 2022 +0200 can: gs_usb: gs_can_open(): initialize time counter before starting device On busy networks the CAN controller might receive CAN frames directly after starting it but before the timecounter is setup. This will lead to NULL pointer deref while converting the converting the CAN frame's timestamp with the timecounter. Close the race window by setting up the timecounter before starting the CAN controller. Fixes: 45dfa45f52e6 ("can: gs_usb: add RX and TX hardware timestamp support") Link: https://lore.kernel.org/all/20220921081329.385509-1-mkl@pengutronix.de Cc: John Whittington Signed-off-by: Marc Kleine-Budde commit 29a8c9ec9090b335ece3bd58d779af7f569b5a65 Author: Marc Kleine-Budde Date: Mon Sep 19 09:53:45 2022 +0200 can: gs_usb: add missing lock to protect struct timecounter::cycle_last The struct timecounter::cycle_last is a 64 bit variable, read by timecounter_cyc2time(), and written by timecounter_read(). On 32 bit architectures this is not atomic. Add a spinlock to protect access to struct timecounter::cycle_last. In the gs_usb_timestamp_read() callback the lock is dropped to execute a sleeping synchronous USB transfer. This is safe, as the variable we want to protect is accessed during this call. Fixes: 45dfa45f52e6 ("can: gs_usb: add RX and TX hardware timestamp support") Link: https://lore.kernel.org/all/20220920100416.959226-3-mkl@pengutronix.de Cc: John Whittington Tested-by: John Whittington Signed-off-by: Marc Kleine-Budde commit 593b5e2f5a4abff998644effe19033f440651fd6 Author: Marc Kleine-Budde Date: Tue Sep 20 11:56:57 2022 +0200 can: gs_usb: gs_usb_get_timestamp(): fix endpoint parameter for usb_control_msg_recv() The 2nd argument of usb_control_msg_recv() is the "endpoint", usb_control_msg_recv() will internally convert the endpoint into a pipe with usb_rcvctrlpipe(). In gs_usb_get_timestamp() not the endpoint "0" is passed, but the pipe. This worked by accident as endpoint is a __u8 and the lowest 8 bits of the pipe are 0. Fix this copy/paste error by using the correct endpoint of "0". Fixes: 45dfa45f52e6 ("can: gs_usb: add RX and TX hardware timestamp support") Link: https://lore.kernel.org/all/20220920100416.959226-2-mkl@pengutronix.de Cc: John Whittington Tested-by: John Whittington Signed-off-by: Marc Kleine-Budde commit 86c223ffc8ada40cfcb25bdf37c381a84fc85402 Merge: d05d9eb79d0cd 3fd7bfd28cfd6 Author: Marc Kleine-Budde Date: Fri Sep 23 13:53:58 2022 +0200 Merge patch series "can: bcm: can: bcm: random optimizations" Ziyang Xuan says: Do some small optimization for can_bcm. v1: https://lore.kernel.org/all/cover.1662606045.git.william.xuanziyang@huawei.com Link: https://lore.kernel.org/all/cover.1663206163.git.william.xuanziyang@huawei.com Signed-off-by: Marc Kleine-Budde commit 3fd7bfd28cfd68ae80a2fe92ea1615722cc2ee6e Author: Ziyang Xuan Date: Thu Sep 15 09:55:56 2022 +0800 can: bcm: check the result of can_send() in bcm_can_tx() If can_send() fail, it should not update frames_abs counter in bcm_can_tx(). Add the result check for can_send() in bcm_can_tx(). Suggested-by: Marc Kleine-Budde Suggested-by: Oliver Hartkopp Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/9851878e74d6d37aee2f1ee76d68361a46f89458.1663206163.git.william.xuanziyang@huawei.com Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit edd1a7e42f1d2d09c5f79ecef05ae19dc669bf34 Author: Ziyang Xuan Date: Thu Sep 15 09:55:55 2022 +0800 can: bcm: registration process optimization in bcm_module_init() Now, register_netdevice_notifier() and register_pernet_subsys() are both after can_proto_register(). It can create CAN_BCM socket and process socket once can_proto_register() successfully, so it is possible missing notifier event or proc node creation because notifier or bcm proc directory is not registered or created yet. Although this is a low probability scenario, it is not impossible. Move register_pernet_subsys() and register_netdevice_notifier() to the front of can_proto_register(). In addition, register_pernet_subsys() and register_netdevice_notifier() may fail, check their results are necessary. Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/823cff0ebec33fa9389eeaf8b8ded3217c32cb38.1663206163.git.william.xuanziyang@huawei.com Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 712f210a457d9c32414df246a72781550bc23ef6 Author: Kees Cook Date: Wed Sep 21 20:10:10 2022 -0700 x86/microcode/AMD: Track patch allocation size explicitly In preparation for reducing the use of ksize(), record the actual allocation size for later memcpy(). This avoids copying extra (uninitialized!) bytes into the patch buffer when the requested allocation size isn't exactly the size of a kmalloc bucket. Additionally, fix potential future issues where runtime bounds checking will notice that the buffer was allocated to a smaller value than returned by ksize(). Fixes: 757885e94a22 ("x86, microcode, amd: Early microcode patch loading support for AMD") Suggested-by: Daniel Micay Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/lkml/CA+DvKQ+bp7Y7gmaVhacjv9uF6Ar-o4tet872h4Q8RPYPJjcJQA@mail.gmail.com/ commit 3aba35bb201fd2481b3fd5794120d9d1b0734fe8 Merge: f948ac2313336 e462b2717380b Author: David S. Miller Date: Fri Sep 23 12:31:27 2022 +0100 Merge branch 'lan966x-mqprio-taprio' Horatiu Vultur says: ==================== net: lan966x: Add mqprio and taprio support Add support for offloading QoS features with tc command to lan966x. The offloaded QoS features are mqprio and taprio. v1->v2: - fix compilation warning - rename lan966x_taprio_enable/disable to lan966x_taprio_add/del ==================== Signed-off-by: David S. Miller commit e462b2717380b49c74c4a17b643cde83064a7653 Author: Horatiu Vultur Date: Wed Sep 21 14:25:38 2022 +0200 net: lan966x: Add offload support for taprio Lan966x switch supports time-based egress shaping in hardware according to IEEE 802.1Qbv. Add support for TAS configuration on egress port of lan966x switch. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2a252a0bd2e908f503989aa5b954234e2a29244e Author: Horatiu Vultur Date: Wed Sep 21 14:25:37 2022 +0200 net: lan966x: Add registers used by taprio Add registers that are used by taprio to configure the HW. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 3c83431f079546d166ef3b0490d7b81753554ca7 Author: Horatiu Vultur Date: Wed Sep 21 14:25:36 2022 +0200 net: lan966x: Add offload support for mqprio Implement mqprio qdisc support using tc command. The HW supports 8 priority queues from highest (7) to lowest (0). Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 644ffce5f1be181096098f0b8dbbf8f6a0d621c0 Author: Horatiu Vultur Date: Wed Sep 21 14:25:35 2022 +0200 net: lan966x: Add define for number of priority queues NUM_PRIO_QUEUES Add a define for the number of priority queues on lan966x. Because there will be more checks for this, so instead of using hardcoded value all over the place add a define for this. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 37a78445763a5921bb54e9bad01937d0dfa521c1 Author: Dan Carpenter Date: Mon Sep 19 09:36:30 2022 +0300 virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create() The ->ring_idx_mask variable is a u64 so static checkers, Smatch in this case, complain if the BIT() is not also a u64. drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create() warn: should '(1 << ring_idx)' be a 64 bit type? Fixes: cd7f5ca33585 ("drm/virtio: implement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/YygN7jY0GdUSQSy0@kili Signed-off-by: Gerd Hoffmann commit 461a4df2a833bc6d83139ecf117e2f844f38f655 Author: Zongmin Zhou Date: Tue Sep 20 14:50:23 2022 +0800 drm/qxl: drop set_prod_notify parameter from qxl_ring_create Since qxl_io_reset(qdev) will be called immediately after qxl_ring_create() been called, and parameter like notify_on_prod will be set to default value. So the call to qxl_ring_init_hdr() before becomes meaningless. Signed-off-by: Zongmin Zhou Suggested-by: Ming Xie Link: http://patchwork.freedesktop.org/patch/msgid/20220920065023.1633303-1-zhouzongmin@kylinos.cn Signed-off-by: Gerd Hoffmann commit f948ac2313336d059b13ee0dee4840a1fb317fe9 Author: Minghao Chi Date: Wed Sep 21 02:16:17 2022 +0000 xen-netback: use kstrdup instead of open-coding it use kstrdup instead of open-coding it. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Wei Liu Signed-off-by: David S. Miller commit e19de30d20809af3221ef8a2648b8a8a52e02d90 Author: Daniel Golle Date: Wed Sep 21 01:23:14 2022 +0100 net: dsa: mt7530: add support for in-band link status Read link status from SGMII PCS for in-band managed 2500Base-X and 1000Base-X connection on a MAC port of the MT7531. This is needed to get the SFP cage working which is connected to SGMII interface of port 5 of the MT7531 switch IC on the Bananapi BPi-R3 board. While at it also handle an_complete for both the autoneg and the non-autoneg codepath. Signed-off-by: Daniel Golle Signed-off-by: David S. Miller commit 793cc3c78e828d26723433c590cd90d20fc91011 Merge: 1a4019f4922ea 3c42563b30417 Author: David S. Miller Date: Fri Sep 23 11:56:36 2022 +0100 Merge branch 'phy-rate-matching' Sean Anderson says: ==================== net: phy: Add support for rate matching This adds support for phy rate matching: when a phy adapts between differing phy interface and link speeds. It was originally submitted as part of [1], which is considered "v1" of this series. Several past discussions [2-4] around adding rate adaptation provide some context. Although in earlier versions of this series, userspace could disable rate matching, now it is only possible to determine the current rate adaptation type. Disabling or otherwise configuring rate adaptation has been left for future work. However, because currently only RATE_MATCH_PAUSE is implemented, it is possible to disable rate adaptation by modifying the advertisement appropriately. [1] https://lore.kernel.org/netdev/20220715215954.1449214-1-sean.anderson@seco.com/T/#t [2] https://lore.kernel.org/netdev/1579701573-6609-1-git-send-email-madalin.bucur@oss.nxp.com/ [3] https://lore.kernel.org/netdev/1580137671-22081-1-git-send-email-madalin.bucur@oss.nxp.com/ [4] https://lore.kernel.org/netdev/20200116181933.32765-1-olteanv@gmail.com/ Changes in v6: - Don't announce that we've enabled pause frames for rate adaptation - Merry Christmas - Rename rate adaptation to rate matching - Reword documentation, (hopefully) taking into account feedback Changes in v5: - Break off patch "net: phy: Add 1000BASE-KX interface mode" for separate submission. - Document phy_rate_adaptation_to_str - Drop patch "Add some helpers for working with mac caps"; it has been incorperated into the autonegotiation patch. - Move phylink_cap_from_speed_duplex to this commit - Rebase onto net-next/master - Remove unnecessary comma Changes in v4: - Export phy_rate_adaptation_to_str - Remove phylink_interface_max_speed, which was accidentally added - Split off the LS1046ARDB 1G fix Changes in v3: - Add phylink_cap_from_speed_duplex to look up the mac capability corresponding to the interface's speed. - Document MAC_(A)SYM_PAUSE - Include RATE_ADAPT_CRS; it's a few lines and it doesn't hurt. - Modify link settings directly in phylink_link_up, instead of doing things more indirectly via link_*. - Move unused defines to next commit (where they will be used) - Remove "Support differing link/interface speed/duplex". It has been rendered unnecessary due to simplification of the rate adaptation patches. Thanks Russell! - Rewrite cover letter to better reflect the opinions of the developers involved Changes in v2: - Add (read-only) ethtool support for rate adaptation - Add comments clarifying the register defines - Add locking to phy_get_rate_adaptation - Always use the rate adaptation setting to determine the interface speed/duplex (instead of sometimes using the interface mode). - Determine the interface speed and max mac speed directly instead of guessing based on the caps. - Move part of commit message to cover letter, as it gives a good overview of the whole series, and allows this patch to focus more on the specifics. - Reorder variables in aqr107_read_rate - Use int/defines instead of enum to allow for use in ioctls/netlink - Use the phy's rate adaptation setting to determine whether to use its link speed/duplex or the MAC's speed/duplex with MLO_AN_INBAND. ==================== Signed-off-by: David S. Miller commit 3c42563b30417afc8855a3b4c1b38c2f36f78657 Author: Sean Anderson Date: Tue Sep 20 18:12:35 2022 -0400 net: phy: aquantia: Add support for rate matching This adds support for rate matching for phys similar to the AQR107. We assume that all phys using aqr107_read_status support rate matching. However, it could be possible to determine support based on the firmware revision if there are phys discovered which do not support rate matching. However, as rate matching is advertised in the datasheets for these phys, I suspect it is supported most boards. Despite the name, the "config" registers are updated with the current rate matching method (if any). Because they appear to be updated automatically, I don't know if these registers can be used to disable rate matching. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit cfadbb9df8c4dc917787da4458327e5ec14743d4 Author: Anup Patel Date: Mon Jul 18 14:15:53 2022 +0530 cpuidle: riscv-sbi: Fix CPU_PM_CPU_IDLE_ENTER_xyz() macro usage Currently, we are using CPU_PM_CPU_IDLE_ENTER_PARAM() for all SBI HSM suspend types so retentive suspend types are also treated non-retentive and kernel will do redundant additional work for these states. The BIT[31] of SBI HSM suspend types allows us to differentiate between retentive and non-retentive suspend types so we should use this BIT to call appropriate CPU_PM_CPU_IDLE_ENTER_xyz() macro. Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver") Signed-off-by: Anup Patel Link: https://lore.kernel.org/r/20220718084553.2056169-1-apatel@ventanamicro.com/ Reviewed-by: Andrew Jones Signed-off-by: Palmer Dabbelt commit 7de26bf144f6a72858ab60afb2bd2b43265ee0ad Author: Sean Anderson Date: Tue Sep 20 18:12:34 2022 -0400 net: phy: aquantia: Add some additional phy interfaces These are documented in the AQR115 register reference. I haven't tested them, but perhaps they'll be useful to someone. Signed-off-by: Sean Anderson Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b7e9294885b610791fcebc799bf2a9e219446fd6 Author: Sean Anderson Date: Tue Sep 20 18:12:33 2022 -0400 net: phylink: Adjust advertisement based on rate matching This adds support for adjusting the advertisement for pause-based rate matching. This may result in a lossy link, since the final link settings are not adjusted. Asymmetric pause support is necessary. It would be possible for a MAC supporting only symmetric pause to use pause-based rate adaptation, but only if pause reception was enabled as well. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit ae0e4bb2a0e0e434e9f98fb4994093ec2ee71997 Author: Sean Anderson Date: Tue Sep 20 18:12:32 2022 -0400 net: phylink: Adjust link settings based on rate matching If the phy is configured to use pause-based rate matching, ensure that the link is full duplex with pause frame reception enabled. As suggested, if pause-based rate matching is enabled by the phy, then pause reception is unconditionally enabled. The interface duplex is determined based on the rate matching type. When rate matching is enabled, so is the speed. We assume the maximum interface speed is used. This is only relevant for MLO_AN_PHY. For MLO_AN_INBAND, the MAC/PCS's view of the interface speed will be used. Although there are no RATE_ADAPT_CRS phys in-tree, it has been added for comparison (and the implementation is quite simple). Co-developed-by: Russell King Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit 0c3e10cb44232833a50cb8e3e784c432906a60c1 Author: Sean Anderson Date: Tue Sep 20 18:12:31 2022 -0400 net: phy: Add support for rate matching This adds support for rate matching (also known as rate adaptation) to the phy subsystem. The general idea is that the phy interface runs at one speed, and the MAC throttles the rate at which it sends packets to the link speed. There's a good overview of several techniques for achieving this at [1]. This patch adds support for three: pause-frame based (such as in Aquantia phys), CRS-based (such as in 10PASS-TS and 2BASE-TL), and open-loop-based (such as in 10GBASE-W). This patch makes a few assumptions and a few non assumptions about the types of rate matching available. First, it assumes that different phys may use different forms of rate matching. Second, it assumes that phys can use rate matching for any of their supported link speeds (e.g. if a phy supports 10BASE-T and XGMII, then it can adapt XGMII to 10BASE-T). Third, it does not assume that all interface modes will use the same form of rate matching. Fourth, it does not assume that all phy devices will support rate matching (even if some do). Relaxing or strengthening these (non-)assumptions could result in a different API. For example, if all interface modes were assumed to use the same form of rate matching, then a bitmask of interface modes supportting rate matching would suffice. For some better visibility into the process, the current rate matching mode is exposed as part of the ethtool ksettings. For the moment, only read access is supported. I'm not sure what userspace might want to configure yet (disable it altogether, disable just one mode, specify the mode to use, etc.). For the moment, since only pause-based rate adaptation support is added in the next few commits, rate matching can be disabled altogether by adjusting the advertisement. 802.3 calls this feature "rate adaptation" in clause 49 (10GBASE-R) and "rate matching" in clause 61 (10PASS-TL and 2BASE-TS). Aquantia also calls this feature "rate adaptation". I chose "rate matching" because it is shorter, and because Russell doesn't think "adaptation" is correct in this context. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit 3e6eab8f3ef93cd78cd4b67f497ef6035eb073ad Author: Sean Anderson Date: Tue Sep 20 18:12:30 2022 -0400 net: phylink: Generate caps and convert to linkmodes separately If we call phylink_caps_to_linkmodes directly from phylink_get_linkmodes, it is difficult to re-use this functionality in MAC drivers. This is because MAC drivers must then work with an ethtool linkmode bitmap, instead of with mac capabilities. Instead, let the caller of phylink_get_linkmodes do the conversion. To reflect this change, rename the function to phylink_get_capabilities. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit 606116529ab2d12e93bf751f74ed50a621b46846 Author: Sean Anderson Date: Tue Sep 20 18:12:29 2022 -0400 net: phylink: Export phylink_caps_to_linkmodes This function is convenient for MAC drivers. They can use it to add or remove particular link modes based on capabilities (such as if half duplex is not supported for a particular interface mode). Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit 72bc36956f73ac54f19a7ac7302fb274069bec18 Author: Sean Anderson Date: Tue Sep 20 18:12:28 2022 -0400 net: phylink: Document MAC_(A)SYM_PAUSE This documents the possible MLO_PAUSE_* settings which can result from different combinations of MAC_(A)SYM_PAUSE. Special note is paid to settings which can result from user configuration (MLO_PAUSE_AN). The autonegotiation results are more-or-less a direct consequence of IEEE 802.3 Table 28B-2. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit fea62d370d7a1ba288d71d0cae7ad47c2a02b839 Author: James Morse Date: Fri Sep 2 15:48:22 2022 +0000 x86/resctrl: Allow per-rmid arch private storage to be reset To abstract the rmid counters into a helper that returns the number of bytes counted, architecture specific per-rmid state is needed. It needs to be possible to reset this hidden state, as the values may outlive the life of an rmid, or the mount time of the filesystem. mon_event_read() is called with first = true when an rmid is first allocated in mkdir_mondata_subdir(). Add resctrl_arch_reset_rmid() and call it from __mon_event_count()'s rr->first check. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-15-james.morse@arm.com commit 635b241d93010cbbbea3855e4f274c2621df7a19 Author: wangjianli Date: Thu Sep 8 21:07:54 2022 +0800 scsi: storvsc: remove an extraneous "to" in a comment Signed-off-by: wangjianli Link: https://lore.kernel.org/r/20220908130754.34999-1-wangjianli@cdjrlc.com Signed-off-by: Wei Liu commit f7ac541e18e2a7b70ae215803e27c78e0f221d00 Author: Stanislav Kinsburskiy Date: Wed Sep 21 18:39:05 2022 +0000 Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization Waiting to 5 seconds in case of missing VMBus ACPI device is redundant as the device is either present already or won't be available at all. This patch enforces synchronous probing to make sure the bus traversal, happening upon driver registering will either find the device (if present) or not spend any additional time if device is absent. Signed-off-by: Stanislav Kinsburskiy CC: "K. Y. Srinivasan" CC: Haiyang Zhang CC: Stephen Hemminger CC: Wei Liu CC: Dexuan Cui CC: linux-hyperv@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Michael Kelley Reviewed-by: Dexuan Cui Link: https://lore.kernel.org/r/166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net Signed-off-by: Wei Liu commit 6edf2576a6cc46460c164831517a36064eb8109c Author: Feng Tang Date: Tue Sep 13 14:54:20 2022 +0800 mm/slub: enable debugging memory wasting of kmalloc kmalloc's API family is critical for mm, with one nature that it will round up the request size to a fixed one (mostly power of 2). Say when user requests memory for '2^n + 1' bytes, actually 2^(n+1) bytes could be allocated, so in worst case, there is around 50% memory space waste. The wastage is not a big issue for requests that get allocated/freed quickly, but may cause problems with objects that have longer life time. We've met a kernel boot OOM panic (v5.10), and from the dumped slab info: [ 26.062145] kmalloc-2k 814056KB 814056KB From debug we found there are huge number of 'struct iova_magazine', whose size is 1032 bytes (1024 + 8), so each allocation will waste 1016 bytes. Though the issue was solved by giving the right (bigger) size of RAM, it is still nice to optimize the size (either use a kmalloc friendly size or create a dedicated slab for it). And from lkml archive, there was another crash kernel OOM case [1] back in 2019, which seems to be related with the similar slab waste situation, as the log is similar: [ 4.332648] iommu: Adding device 0000:20:02.0 to group 16 [ 4.338946] swapper/0 invoked oom-killer: gfp_mask=0x6040c0(GFP_KERNEL|__GFP_COMP), nodemask=(null), order=0, oom_score_adj=0 ... [ 4.857565] kmalloc-2048 59164KB 59164KB The crash kernel only has 256M memory, and 59M is pretty big here. (Note: the related code has been changed and optimised in recent kernel [2], these logs are just picked to demo the problem, also a patch changing its size to 1024 bytes has been merged) So add an way to track each kmalloc's memory waste info, and leverage the existing SLUB debug framework (specifically SLUB_STORE_USER) to show its call stack of original allocation, so that user can evaluate the waste situation, identify some hot spots and optimize accordingly, for a better utilization of memory. The waste info is integrated into existing interface: '/sys/kernel/debug/slab/kmalloc-xx/alloc_traces', one example of 'kmalloc-4k' after boot is: 126 ixgbe_alloc_q_vector+0xbe/0x830 [ixgbe] waste=233856/1856 age=280763/281414/282065 pid=1330 cpus=32 nodes=1 __kmem_cache_alloc_node+0x11f/0x4e0 __kmalloc_node+0x4e/0x140 ixgbe_alloc_q_vector+0xbe/0x830 [ixgbe] ixgbe_init_interrupt_scheme+0x2ae/0xc90 [ixgbe] ixgbe_probe+0x165f/0x1d20 [ixgbe] local_pci_probe+0x78/0xc0 work_for_cpu_fn+0x26/0x40 ... which means in 'kmalloc-4k' slab, there are 126 requests of 2240 bytes which got a 4KB space (wasting 1856 bytes each and 233856 bytes in total), from ixgbe_alloc_q_vector(). And when system starts some real workload like multiple docker instances, there could are more severe waste. [1]. https://lkml.org/lkml/2019/8/12/266 [2]. https://lore.kernel.org/lkml/2920df89-9975-5785-f79b-257d3052dfaf@huawei.com/ [Thanks Hyeonggon for pointing out several bugs about sorting/format] [Thanks Vlastimil for suggesting way to reduce memory usage of orig_size and keep it only for kmalloc objects] Signed-off-by: Feng Tang Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Robin Murphy Cc: John Garry Cc: Kefeng Wang Signed-off-by: Vlastimil Babka commit e78a802a7b4febf53f2a92842f494b01062d85a8 Author: Jason A. Donenfeld Date: Fri Sep 23 02:42:51 2022 +0200 random: clamp credited irq bits to maximum mixed Since the most that's mixed into the pool is sizeof(long)*2, don't credit more than that many bytes of entropy. Fixes: e3e33fc2ea7f ("random: do not use input pool from hard IRQs") Cc: stable@vger.kernel.org Signed-off-by: Jason A. Donenfeld commit a99aaf2e3b334a0242ed3c07d39efdf6d4f530f1 Author: Easwar Hariharan Date: Mon Sep 19 15:04:44 2022 -0700 Drivers: hv: vmbus: Use PCI_VENDOR_ID_MICROSOFT for better discoverability pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number. Signed-off-by: Easwar Hariharan Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1663625084-2518-2-git-send-email-eahariha@linux.microsoft.com Signed-off-by: Wei Liu commit e1a863cddbed9cab1d768c720f598322e9a96edb Author: Jiapeng Chong Date: Mon Sep 19 14:38:15 2022 +0800 Drivers: hv: vmbus: Fix kernel-doc drivers/hv/vmbus_drv.c:1587: warning: expecting prototype for __vmbus_child_driver_register(). Prototype was for __vmbus_driver_register() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2210 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220919063815.1881-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Wei Liu commit f878a26a2a61abae9cb4d01a04a49dfac209b37c Author: Johan Jonker Date: Sun Sep 18 16:29:41 2022 +0200 dt-bindings: clock: convert rockchip,rk3128-cru.txt to YAML Convert rockchip,rk3128-cru.txt to YAML. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/4e69a06d-7b53-ab48-1e50-2b29ff3a54e6@gmail.com Signed-off-by: Heiko Stuebner commit d775335e350fc07e1322960ee291dc9079ab938e Author: Jason A. Donenfeld Date: Tue Sep 20 16:12:00 2022 +0200 random: throttle hwrng writes if no entropy is credited If a hwrng source does not provide an entropy estimate, it currently does not contribute at all to the CRNG. In order to help fix this, in case add_hwgenerator_randomness() is called with the entropy parameter set to zero, go to sleep until one reseed interval has passed. While the hwrng thread currently only runs under conditions where this is non-zero, this change is not harmful and prepares for future updates to the hwrng core. Cc: Herbert Xu Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 745558f9588551b1fef9609d165e239bce30d3e8 Author: Dominik Brodowski Date: Sun Sep 4 12:17:53 2022 +0200 random: use hwgenerator randomness more frequently at early boot Mix in randomness from hw-rng sources more frequently during early boot, approximately once for every rng reseed. Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit cd4f24ae9404fd31fc461066e57889be3b68641b Author: Jason A. Donenfeld Date: Thu Sep 8 16:14:00 2022 +0200 random: restore O_NONBLOCK support Prior to 5.6, when /dev/random was opened with O_NONBLOCK, it would return -EAGAIN if there was no entropy. When the pools were unified in 5.6, this was lost. The post 5.6 behavior of blocking until the pool is initialized, and ignoring O_NONBLOCK in the process, went unnoticed, with no reports about the regression received for two and a half years. However, eventually this indeed did break somebody's userspace. So we restore the old behavior, by returning -EAGAIN if the pool is not initialized. Unlike the old /dev/random, this can only occur during early boot, after which it never blocks again. In order to make this O_NONBLOCK behavior consistent with other expectations, also respect users reading with preadv2(RWF_NOWAIT) and similar. Fixes: 30c08efec888 ("random: make /dev/random be almost like /dev/urandom") Reported-by: Guozihua Reported-by: Zhongguohua Cc: Al Viro Cc: Theodore Ts'o Cc: Andrew Lutomirski Cc: stable@vger.kernel.org Signed-off-by: Jason A. Donenfeld commit e18d9b093006d8abd53e1ce13c0d5a8d0fcd5f64 Author: Chris Morgan Date: Mon Sep 19 11:46:16 2022 -0500 arm64: dts: rockchip: Add DSI and DSI-DPHY nodes to rk356x This adds the DSI controller nodes and DSI-DPHY controller nodes to the rk356x device tree. Signed-off-by: Chris Morgan Acked-by: Michael Riesch Link: https://lore.kernel.org/r/20220919164616.12492-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 19b5e6659eaf537ebeac90ae30c7df0296fe5ab9 Author: Saurabh Sengar Date: Fri Sep 23 10:09:50 2022 +0000 drm/hyperv: Don't overwrite dirt_needed value set by host Existing code is causing a race condition where dirt_needed value is already set by the host and gets overwritten with default value. Remove this default setting of dirt_needed, to avoid overwriting the value received in the channel callback set by vmbus_open. Removing this setting also means the default value for dirt_needed is changed to false as it's allocated by kzalloc which is similar to legacy hyperv_fb driver. Signed-off-by: Saurabh Sengar Reviewed-by: Dexuan Cui Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1662996766-19304-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 09847723c12fc2753749cec3939a02ee92dac468 Author: Adrián Larumbe Date: Tue Sep 20 23:28:42 2022 +0100 drm/meson: remove drm bridges at aggregate driver unbind time drm bridges added by meson_encoder_hdmi_init and meson_encoder_cvbs_init were not manually removed at module unload time, which caused dangling references to freed memory to remain linked in the global bridge_list. When loading the driver modules back in, the same functions would again call drm_bridge_add, and when traversing the global bridge_list, would end up peeking into freed memory. Once again KASAN revealed the problem: [ +0.000095] ============================================================= [ +0.000008] BUG: KASAN: use-after-free in __list_add_valid+0x9c/0x120 [ +0.000018] Read of size 8 at addr ffff00003da291f0 by task modprobe/2483 [ +0.000018] CPU: 3 PID: 2483 Comm: modprobe Tainted: G C O 5.19.0-rc6-lrmbkasan+ #1 [ +0.000011] Hardware name: Hardkernel ODROID-N2Plus (DT) [ +0.000008] Call trace: [ +0.000006] dump_backtrace+0x1ec/0x280 [ +0.000012] show_stack+0x24/0x80 [ +0.000008] dump_stack_lvl+0x98/0xd4 [ +0.000011] print_address_description.constprop.0+0x80/0x520 [ +0.000011] print_report+0x128/0x260 [ +0.000008] kasan_report+0xb8/0xfc [ +0.000008] __asan_report_load8_noabort+0x3c/0x50 [ +0.000009] __list_add_valid+0x9c/0x120 [ +0.000009] drm_bridge_add+0x6c/0x104 [drm] [ +0.000165] dw_hdmi_probe+0x1900/0x2360 [dw_hdmi] [ +0.000022] meson_dw_hdmi_bind+0x520/0x814 [meson_dw_hdmi] [ +0.000014] component_bind+0x174/0x520 [ +0.000012] component_bind_all+0x1a8/0x38c [ +0.000010] meson_drv_bind_master+0x5e8/0xb74 [meson_drm] [ +0.000032] meson_drv_bind+0x20/0x2c [meson_drm] [ +0.000027] try_to_bring_up_aggregate_device+0x19c/0x390 [ +0.000010] component_master_add_with_match+0x1c8/0x284 [ +0.000009] meson_drv_probe+0x274/0x280 [meson_drm] [ +0.000026] platform_probe+0xd0/0x220 [ +0.000009] really_probe+0x3ac/0xa80 [ +0.000009] __driver_probe_device+0x1f8/0x400 [ +0.000009] driver_probe_device+0x68/0x1b0 [ +0.000009] __driver_attach+0x20c/0x480 [ +0.000008] bus_for_each_dev+0x114/0x1b0 [ +0.000009] driver_attach+0x48/0x64 [ +0.000008] bus_add_driver+0x390/0x564 [ +0.000009] driver_register+0x1a8/0x3e4 [ +0.000009] __platform_driver_register+0x6c/0x94 [ +0.000008] meson_drm_platform_driver_init+0x3c/0x1000 [meson_drm] [ +0.000027] do_one_initcall+0xc4/0x2b0 [ +0.000011] do_init_module+0x154/0x570 [ +0.000011] load_module+0x1a78/0x1ea4 [ +0.000008] __do_sys_init_module+0x184/0x1cc [ +0.000009] __arm64_sys_init_module+0x78/0xb0 [ +0.000009] invoke_syscall+0x74/0x260 [ +0.000009] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000008] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000012] el0t_64_sync_handler+0x11c/0x150 [ +0.000008] el0t_64_sync+0x18c/0x190 [ +0.000016] Allocated by task 879: [ +0.000008] kasan_save_stack+0x2c/0x5c [ +0.000011] __kasan_kmalloc+0x90/0xd0 [ +0.000007] __kmalloc+0x278/0x4a0 [ +0.000011] mpi_resize+0x13c/0x1d0 [ +0.000011] mpi_powm+0xd24/0x1570 [ +0.000009] rsa_enc+0x1a4/0x30c [ +0.000009] pkcs1pad_verify+0x3f0/0x580 [ +0.000009] public_key_verify_signature+0x7a8/0xba4 [ +0.000010] public_key_verify_signature_2+0x40/0x60 [ +0.000008] verify_signature+0xb4/0x114 [ +0.000008] pkcs7_validate_trust_one.constprop.0+0x3b8/0x574 [ +0.000009] pkcs7_validate_trust+0xb8/0x15c [ +0.000008] verify_pkcs7_message_sig+0xec/0x1b0 [ +0.000012] verify_pkcs7_signature+0x78/0xac [ +0.000007] mod_verify_sig+0x110/0x190 [ +0.000009] module_sig_check+0x114/0x1e0 [ +0.000009] load_module+0xa0/0x1ea4 [ +0.000008] __do_sys_init_module+0x184/0x1cc [ +0.000008] __arm64_sys_init_module+0x78/0xb0 [ +0.000008] invoke_syscall+0x74/0x260 [ +0.000009] el0_svc_common.constprop.0+0x1a8/0x260 [ +0.000008] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000009] el0t_64_sync_handler+0x11c/0x150 [ +0.000009] el0t_64_sync+0x18c/0x190 [ +0.000013] Freed by task 2422: [ +0.000008] kasan_save_stack+0x2c/0x5c [ +0.000009] kasan_set_track+0x2c/0x40 [ +0.000007] kasan_set_free_info+0x28/0x50 [ +0.000009] ____kasan_slab_free+0x128/0x1d4 [ +0.000008] __kasan_slab_free+0x18/0x24 [ +0.000007] slab_free_freelist_hook+0x108/0x230 [ +0.000010] kfree+0x110/0x35c [ +0.000008] release_nodes+0xf0/0x16c [ +0.000009] devres_release_group+0x180/0x270 [ +0.000008] take_down_aggregate_device+0xcc/0x160 [ +0.000010] component_del+0x18c/0x360 [ +0.000009] meson_dw_hdmi_remove+0x28/0x40 [meson_dw_hdmi] [ +0.000013] platform_remove+0x64/0xb0 [ +0.000008] device_remove+0xb8/0x154 [ +0.000009] device_release_driver_internal+0x398/0x5b0 [ +0.000009] driver_detach+0xac/0x1b0 [ +0.000009] bus_remove_driver+0x158/0x29c [ +0.000008] driver_unregister+0x70/0xb0 [ +0.000009] platform_driver_unregister+0x20/0x2c [ +0.000007] meson_dw_hdmi_platform_driver_exit+0x1c/0x30 [meson_dw_hdmi] [ +0.000012] __do_sys_delete_module+0x288/0x400 [ +0.000009] __arm64_sys_delete_module+0x5c/0x80 [ +0.000009] invoke_syscall+0x74/0x260 [ +0.000008] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000008] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000008] el0t_64_sync_handler+0x11c/0x150 [ +0.000009] el0t_64_sync+0x18c/0x190 [ +0.000013] The buggy address belongs to the object at ffff00003da29000 which belongs to the cache kmalloc-1k of size 1024 [ +0.000008] The buggy address is located 496 bytes inside of 1024-byte region [ffff00003da29000, ffff00003da29400) [ +0.000015] The buggy address belongs to the physical page: [ +0.000009] page:fffffc0000f68a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3da28 [ +0.000012] head:fffffc0000f68a00 order:3 compound_mapcount:0 compound_pincount:0 [ +0.000009] flags: 0xffff00000010200(slab|head|node=0|zone=0|lastcpupid=0xffff) [ +0.000019] raw: 0ffff00000010200 fffffc0000eb5c08 fffffc0000d96608 ffff000000002a80 [ +0.000008] raw: 0000000000000000 00000000000a000a 00000001ffffffff 0000000000000000 [ +0.000008] page dumped because: kasan: bad access detected [ +0.000011] Memory state around the buggy address: [ +0.000009] ffff00003da29080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ffff00003da29100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] >ffff00003da29180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ^ [ +0.000008] ffff00003da29200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000006] ffff00003da29280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ================================================================== Fix by keeping track of which encoders were initialised in the meson_drm structure and manually removing their bridges at aggregate driver's unbind time. Signed-off-by: Adrián Larumbe Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220920222842.1053234-1-adrian.larumbe@collabora.com commit 8616f2a0589a80e08434212324250eb22f6a66ce Author: Adrián Larumbe Date: Mon Sep 19 02:09:39 2022 +0100 drm/meson: explicitly remove aggregate driver at module unload time Because component_master_del wasn't being called when unloading the meson_drm module, the aggregate device would linger forever in the global aggregate_devices list. That means when unloading and reloading the meson_dw_hdmi module, component_add would call into try_to_bring_up_aggregate_device and find the unbound meson_drm aggregate device. This would in turn dereference some of the aggregate_device's struct entries which point to memory automatically freed by the devres API when unbinding the aggregate device from meson_drv_unbind, and trigger an use-after-free bug: [ +0.000014] ============================================================= [ +0.000007] BUG: KASAN: use-after-free in find_components+0x468/0x500 [ +0.000017] Read of size 8 at addr ffff000006731688 by task modprobe/2536 [ +0.000018] CPU: 4 PID: 2536 Comm: modprobe Tainted: G C O 5.19.0-rc6-lrmbkasan+ #1 [ +0.000010] Hardware name: Hardkernel ODROID-N2Plus (DT) [ +0.000008] Call trace: [ +0.000005] dump_backtrace+0x1ec/0x280 [ +0.000011] show_stack+0x24/0x80 [ +0.000007] dump_stack_lvl+0x98/0xd4 [ +0.000010] print_address_description.constprop.0+0x80/0x520 [ +0.000011] print_report+0x128/0x260 [ +0.000007] kasan_report+0xb8/0xfc [ +0.000007] __asan_report_load8_noabort+0x3c/0x50 [ +0.000009] find_components+0x468/0x500 [ +0.000008] try_to_bring_up_aggregate_device+0x64/0x390 [ +0.000009] __component_add+0x1dc/0x49c [ +0.000009] component_add+0x20/0x30 [ +0.000008] meson_dw_hdmi_probe+0x28/0x34 [meson_dw_hdmi] [ +0.000013] platform_probe+0xd0/0x220 [ +0.000008] really_probe+0x3ac/0xa80 [ +0.000008] __driver_probe_device+0x1f8/0x400 [ +0.000008] driver_probe_device+0x68/0x1b0 [ +0.000008] __driver_attach+0x20c/0x480 [ +0.000009] bus_for_each_dev+0x114/0x1b0 [ +0.000007] driver_attach+0x48/0x64 [ +0.000009] bus_add_driver+0x390/0x564 [ +0.000007] driver_register+0x1a8/0x3e4 [ +0.000009] __platform_driver_register+0x6c/0x94 [ +0.000007] meson_dw_hdmi_platform_driver_init+0x30/0x1000 [meson_dw_hdmi] [ +0.000014] do_one_initcall+0xc4/0x2b0 [ +0.000008] do_init_module+0x154/0x570 [ +0.000010] load_module+0x1a78/0x1ea4 [ +0.000008] __do_sys_init_module+0x184/0x1cc [ +0.000008] __arm64_sys_init_module+0x78/0xb0 [ +0.000008] invoke_syscall+0x74/0x260 [ +0.000008] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000009] do_el0_svc+0x50/0x70 [ +0.000008] el0_svc+0x68/0x1a0 [ +0.000009] el0t_64_sync_handler+0x11c/0x150 [ +0.000009] el0t_64_sync+0x18c/0x190 [ +0.000014] Allocated by task 902: [ +0.000007] kasan_save_stack+0x2c/0x5c [ +0.000009] __kasan_kmalloc+0x90/0xd0 [ +0.000007] __kmalloc_node+0x240/0x580 [ +0.000010] memcg_alloc_slab_cgroups+0xa4/0x1ac [ +0.000010] memcg_slab_post_alloc_hook+0xbc/0x4c0 [ +0.000008] kmem_cache_alloc_node+0x1d0/0x490 [ +0.000009] __alloc_skb+0x1d4/0x310 [ +0.000010] alloc_skb_with_frags+0x8c/0x620 [ +0.000008] sock_alloc_send_pskb+0x5ac/0x6d0 [ +0.000010] unix_dgram_sendmsg+0x2e0/0x12f0 [ +0.000010] sock_sendmsg+0xcc/0x110 [ +0.000007] sock_write_iter+0x1d0/0x304 [ +0.000008] new_sync_write+0x364/0x460 [ +0.000007] vfs_write+0x420/0x5ac [ +0.000008] ksys_write+0x19c/0x1f0 [ +0.000008] __arm64_sys_write+0x78/0xb0 [ +0.000007] invoke_syscall+0x74/0x260 [ +0.000008] el0_svc_common.constprop.0+0x1a8/0x260 [ +0.000009] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000008] el0t_64_sync_handler+0x11c/0x150 [ +0.000008] el0t_64_sync+0x18c/0x190 [ +0.000013] Freed by task 2509: [ +0.000008] kasan_save_stack+0x2c/0x5c [ +0.000007] kasan_set_track+0x2c/0x40 [ +0.000008] kasan_set_free_info+0x28/0x50 [ +0.000008] ____kasan_slab_free+0x128/0x1d4 [ +0.000008] __kasan_slab_free+0x18/0x24 [ +0.000007] slab_free_freelist_hook+0x108/0x230 [ +0.000010] kfree+0x110/0x35c [ +0.000008] release_nodes+0xf0/0x16c [ +0.000008] devres_release_all+0xfc/0x180 [ +0.000008] device_unbind_cleanup+0x24/0x164 [ +0.000008] device_release_driver_internal+0x3e8/0x5b0 [ +0.000010] driver_detach+0xac/0x1b0 [ +0.000008] bus_remove_driver+0x158/0x29c [ +0.000008] driver_unregister+0x70/0xb0 [ +0.000009] platform_driver_unregister+0x20/0x2c [ +0.000007] 0xffff800003722d98 [ +0.000012] __do_sys_delete_module+0x288/0x400 [ +0.000009] __arm64_sys_delete_module+0x5c/0x80 [ +0.000008] invoke_syscall+0x74/0x260 [ +0.000008] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000008] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000008] el0t_64_sync_handler+0x11c/0x150 [ +0.000009] el0t_64_sync+0x18c/0x190 [ +0.000013] Last potentially related work creation: [ +0.000007] kasan_save_stack+0x2c/0x5c [ +0.000007] __kasan_record_aux_stack+0xb8/0xf0 [ +0.000009] kasan_record_aux_stack_noalloc+0x14/0x20 [ +0.000008] insert_work+0x54/0x290 [ +0.000009] __queue_work+0x48c/0xd24 [ +0.000008] queue_work_on+0x90/0x11c [ +0.000008] call_usermodehelper_exec+0x188/0x404 [ +0.000010] kobject_uevent_env+0x5a8/0x794 [ +0.000010] kobject_uevent+0x14/0x20 [ +0.000008] driver_register+0x230/0x3e4 [ +0.000009] __platform_driver_register+0x6c/0x94 [ +0.000007] gxbb_driver_init+0x28/0x34 [ +0.000010] do_one_initcall+0xc4/0x2b0 [ +0.000008] do_initcalls+0x20c/0x24c [ +0.000010] kernel_init_freeable+0x22c/0x278 [ +0.000009] kernel_init+0x3c/0x170 [ +0.000008] ret_from_fork+0x10/0x20 [ +0.000013] The buggy address belongs to the object at ffff000006731600 which belongs to the cache kmalloc-256 of size 256 [ +0.000009] The buggy address is located 136 bytes inside of 256-byte region [ffff000006731600, ffff000006731700) [ +0.000015] The buggy address belongs to the physical page: [ +0.000008] page:fffffc000019cc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff000006730a00 pfn:0x6730 [ +0.000011] head:fffffc000019cc00 order:2 compound_mapcount:0 compound_pincount:0 [ +0.000008] flags: 0xffff00000010200(slab|head|node=0|zone=0|lastcpupid=0xffff) [ +0.000016] raw: 0ffff00000010200 fffffc00000c3d08 fffffc0000ef2b08 ffff000000002680 [ +0.000009] raw: ffff000006730a00 0000000000150014 00000001ffffffff 0000000000000000 [ +0.000006] page dumped because: kasan: bad access detected [ +0.000011] Memory state around the buggy address: [ +0.000007] ffff000006731580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ +0.000007] ffff000006731600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] >ffff000006731680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ^ [ +0.000006] ffff000006731700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ +0.000007] ffff000006731780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ +0.000006] ================================================================== Fix by adding 'remove' driver callback for meson-drm, and explicitly deleting the aggregate device. Signed-off-by: Adrián Larumbe Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220919010940.419893-3-adrian.larumbe@collabora.com commit 31c519981eb141c7ec39bfd5be25d35f02edb868 Author: Adrián Larumbe Date: Mon Sep 19 02:09:38 2022 +0100 drm/meson: reorder driver deinit sequence to fix use-after-free bug Unloading the driver triggers the following KASAN warning: [ +0.006275] ============================================================= [ +0.000029] BUG: KASAN: use-after-free in __list_del_entry_valid+0xe0/0x1a0 [ +0.000026] Read of size 8 at addr ffff000020c395e0 by task rmmod/2695 [ +0.000019] CPU: 5 PID: 2695 Comm: rmmod Tainted: G C O 5.19.0-rc6-lrmbkasan+ #1 [ +0.000013] Hardware name: Hardkernel ODROID-N2Plus (DT) [ +0.000008] Call trace: [ +0.000007] dump_backtrace+0x1ec/0x280 [ +0.000013] show_stack+0x24/0x80 [ +0.000008] dump_stack_lvl+0x98/0xd4 [ +0.000011] print_address_description.constprop.0+0x80/0x520 [ +0.000011] print_report+0x128/0x260 [ +0.000007] kasan_report+0xb8/0xfc [ +0.000008] __asan_report_load8_noabort+0x3c/0x50 [ +0.000010] __list_del_entry_valid+0xe0/0x1a0 [ +0.000009] drm_atomic_private_obj_fini+0x30/0x200 [drm] [ +0.000172] drm_bridge_detach+0x94/0x260 [drm] [ +0.000145] drm_encoder_cleanup+0xa4/0x290 [drm] [ +0.000144] drm_mode_config_cleanup+0x118/0x740 [drm] [ +0.000143] drm_mode_config_init_release+0x1c/0x2c [drm] [ +0.000144] drm_managed_release+0x170/0x414 [drm] [ +0.000142] drm_dev_put.part.0+0xc0/0x124 [drm] [ +0.000143] drm_dev_put+0x20/0x30 [drm] [ +0.000142] meson_drv_unbind+0x1d8/0x2ac [meson_drm] [ +0.000028] take_down_aggregate_device+0xb0/0x160 [ +0.000016] component_del+0x18c/0x360 [ +0.000009] meson_dw_hdmi_remove+0x28/0x40 [meson_dw_hdmi] [ +0.000015] platform_remove+0x64/0xb0 [ +0.000009] device_remove+0xb8/0x154 [ +0.000009] device_release_driver_internal+0x398/0x5b0 [ +0.000009] driver_detach+0xac/0x1b0 [ +0.000009] bus_remove_driver+0x158/0x29c [ +0.000009] driver_unregister+0x70/0xb0 [ +0.000008] platform_driver_unregister+0x20/0x2c [ +0.000008] meson_dw_hdmi_platform_driver_exit+0x1c/0x30 [meson_dw_hdmi] [ +0.000012] __do_sys_delete_module+0x288/0x400 [ +0.000011] __arm64_sys_delete_module+0x5c/0x80 [ +0.000009] invoke_syscall+0x74/0x260 [ +0.000009] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000009] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000012] el0t_64_sync_handler+0x11c/0x150 [ +0.000008] el0t_64_sync+0x18c/0x190 [ +0.000018] Allocated by task 0: [ +0.000007] (stack is not available) [ +0.000011] Freed by task 2695: [ +0.000008] kasan_save_stack+0x2c/0x5c [ +0.000011] kasan_set_track+0x2c/0x40 [ +0.000008] kasan_set_free_info+0x28/0x50 [ +0.000009] ____kasan_slab_free+0x128/0x1d4 [ +0.000008] __kasan_slab_free+0x18/0x24 [ +0.000007] slab_free_freelist_hook+0x108/0x230 [ +0.000011] kfree+0x110/0x35c [ +0.000008] release_nodes+0xf0/0x16c [ +0.000009] devres_release_group+0x180/0x270 [ +0.000008] component_unbind+0x128/0x1e0 [ +0.000010] component_unbind_all+0x1b8/0x264 [ +0.000009] meson_drv_unbind+0x1a0/0x2ac [meson_drm] [ +0.000025] take_down_aggregate_device+0xb0/0x160 [ +0.000009] component_del+0x18c/0x360 [ +0.000009] meson_dw_hdmi_remove+0x28/0x40 [meson_dw_hdmi] [ +0.000012] platform_remove+0x64/0xb0 [ +0.000008] device_remove+0xb8/0x154 [ +0.000009] device_release_driver_internal+0x398/0x5b0 [ +0.000009] driver_detach+0xac/0x1b0 [ +0.000009] bus_remove_driver+0x158/0x29c [ +0.000008] driver_unregister+0x70/0xb0 [ +0.000008] platform_driver_unregister+0x20/0x2c [ +0.000008] meson_dw_hdmi_platform_driver_exit+0x1c/0x30 [meson_dw_hdmi] [ +0.000011] __do_sys_delete_module+0x288/0x400 [ +0.000010] __arm64_sys_delete_module+0x5c/0x80 [ +0.000008] invoke_syscall+0x74/0x260 [ +0.000008] el0_svc_common.constprop.0+0xcc/0x260 [ +0.000008] do_el0_svc+0x50/0x70 [ +0.000007] el0_svc+0x68/0x1a0 [ +0.000009] el0t_64_sync_handler+0x11c/0x150 [ +0.000009] el0t_64_sync+0x18c/0x190 [ +0.000014] The buggy address belongs to the object at ffff000020c39000 which belongs to the cache kmalloc-4k of size 4096 [ +0.000008] The buggy address is located 1504 bytes inside of 4096-byte region [ffff000020c39000, ffff000020c3a000) [ +0.000016] The buggy address belongs to the physical page: [ +0.000009] page:fffffc0000830e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20c38 [ +0.000013] head:fffffc0000830e00 order:3 compound_mapcount:0 compound_pincount:0 [ +0.000008] flags: 0xffff00000010200(slab|head|node=0|zone=0|lastcpupid=0xffff) [ +0.000019] raw: 0ffff00000010200 fffffc0000fd4808 fffffc0000126208 ffff000000002e80 [ +0.000009] raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 [ +0.000008] page dumped because: kasan: bad access detected [ +0.000011] Memory state around the buggy address: [ +0.000008] ffff000020c39480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ffff000020c39500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] >ffff000020c39580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ^ [ +0.000007] ffff000020c39600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000007] ffff000020c39680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ +0.000006] ================================================================== The reason this is happening is unloading meson-dw-hdmi will cause the component API to take down the aggregate device, which in turn will cause all devres-managed memory to be freed, including the struct dw_hdmi allocated in dw_hdmi_probe. This struct embeds a struct drm_bridge that is added at the end of the function, and which is later on picked up in meson_encoder_hdmi_init. However, when attaching the bridge to the encoder created in meson_encoder_hdmi_init, it's linked to the encoder's bridge chain, from where it never leaves, even after devres_release_group is called when the driver's components are unbound and the embedding structure freed. Then, when calling drm_dev_put in the aggregate driver's unbind function, drm_bridge_detach is called for every single bridge linked to the encoder, including the one whose memory had already been deallocated. Fix by calling component_unbind_all after drm_dev_put. Signed-off-by: Adrián Larumbe Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220919010940.419893-2-adrian.larumbe@collabora.com commit d99efdaba9027bf70a4f78f42c0ddc0639e0918d Author: Nicolas Frattaroli Date: Tue Sep 20 16:34:46 2022 +0200 arm64: dts: rockchip: Enable HDMI and GPU on quartz64-b This enables the GPU and HDMI output (including HDMI audio) on the PINE64 Quartz64 Model B single board computer. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20220920143446.633956-1-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit 78c65f0f3c0ca5198b454f59069a1c2e352424dd Author: Saurabh Sengar Date: Mon Jul 25 02:37:28 2022 -0700 Drivers: hv: vmbus: Optimize vmbus_on_event In the vmbus_on_event loop, 2 jiffies timer will not serve the purpose if callback_fn takes longer. For effective use move this check inside of callback functions where needed. Out of all the VMbus drivers using vmbus_on_event, only storvsc has a high packet volume, thus add this limit only in storvsc callback for now. There is no apparent benefit of loop itself because this tasklet will be scheduled anyway again if there are packets left in ring buffer. This patch removes this unnecessary loop as well. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1658741848-4210-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 1a4019f4922ea33547eb7f7a84616cd74045a4e2 Merge: d56f9ddf972dd 394c3032fe0ec Author: David S. Miller Date: Fri Sep 23 10:24:59 2022 +0100 Merge branch 'mt7621-dt' Arınç ÜNAL says: ==================== dt-bindings and mt7621 devicetree changes This patch series removes old MediaTek bindings, improves mediatek,mt7530 and mt7621 memory controller bindings and improves mt7621 DTs. v4: - Keep memory-controller node name. - Change syscon to memory-controller on mt7621.dtsi. v3: - Explain the mt7621 memory controller binding change in more details. - Remove explaining the remaining DTC warnings from the patch log as there are new schemas submitted for them. v2: - Change memory controller node name to syscon on the schema example. - Keep cpu compatible string and syscon on the memory controller node. - Add Rob and Sergio's tags. ==================== Signed-off-by: David S. Miller commit 394c3032fe0ecdbb38ce5b19441a1149466a06d3 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:56 2022 +0300 mips: dts: ralink: mt7621: add GB-PC2 LEDs Add the missing LEDs for GB-PC2. The ethblack-green, ethblue-green, power and system LEDs weren't added previously, because they don't exist on the device schematics. Tests on a GB-PC2 by me and Petr proved otherwise. The i2c bus cannot be used on GB-PC2 as its pins are wired to LEDs instead, and GB-PC1 does not use it. Therefore, do not enable it on both devices. Link: https://github.com/ngiger/GnuBee_Docs/blob/master/GB-PCx/Documents/GB-PC2_V1.1_schematic.pdf Tested-by: Petr Louda Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 247825f991b34440f9b9d4fe607502435a42ac7b Author: Arınç ÜNAL Date: Tue Sep 20 20:25:55 2022 +0300 mips: dts: ralink: mt7621: fix external phy on GB-PC2 The address of the external phy on the mdio bus is 5. Update the devicetree for GB-PC2 accordingly. Fixes: 5bc148649cf3 ("staging: mt7621-dts: fix GB-PC2 devicetree") Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 2b653a373b410d07699a632b1b064fd7d895c5c3 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:54 2022 +0300 mips: dts: ralink: mt7621: change mt7530 switch address In the case of muxing phy0 of the MT7530 switch, the switch and the phy will have the same address on the mdio bus, 0. This causes the ethernet driver to fail since devices on the mdio bus cannot share an address. Any address can be used for the switch, therefore, change the switch address to 0x1f. Suggested-by: Sungbo Eo Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 97721e84f54668a8677dbf928574956b7cf0dd4a Author: Arınç ÜNAL Date: Tue Sep 20 20:25:53 2022 +0300 mips: dts: ralink: mt7621: change phy-mode of gmac1 to rgmii Change phy-mode of gmac1 to rgmii on mt7621.dtsi. Same code path is followed for delayed rgmii and rgmii phy-mode on mtk_eth_soc.c. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 08b9eaf454eea6ff3dcd537d65d5b3784155b516 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:52 2022 +0300 mips: dts: ralink: mt7621: remove interrupt-parent from switch node The interrupt-parent property is inherited from the ethernet node as it's a parent node of the switch node. Therefore, remove the unnecessary interrupt-parent property from the switch node. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 5ae75a1ae5c9eb6765a11c8f54554a1a889f2c7f Author: Arınç ÜNAL Date: Tue Sep 20 20:25:51 2022 +0300 mips: dts: ralink: mt7621: fix some dtc warnings Fix the dtc warnings below. uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$' From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$' From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?' From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$' From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved'] From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved'] From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved'] From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml - Change "memc: syscon@5000" to "memc: memory-controller@5000". - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the aliases node. - Remove "clock-names" from the serial0 node. The property doesn't exist on the 8250.yaml schema. - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000". - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000". - Add "mediatek,mtk-xhci" as the second compatible string on the usb node. - Change "switch0: switch0@0" to "switch0: switch@0" - Change "off" to "disabled" for disabled nodes. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 862b19b7d4a1ab3dd5a7ab95af73f8ec06fdb200 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:50 2022 +0300 dt-bindings: memory: mt7621: add syscon as compatible string The syscon string was introduced because the mt7621 clock driver needs to read some registers creating a regmap from the syscon. The bindings were added before the clock driver was properly mainlined and at first the clock driver was using ralink architecture dependent operations rt_memc_* defined in 'arch/mips/include/asm/mach-ralink/ralink_regs.h'. This string is already there on the memory controller node on mt7621.dtsi. Add syscon as a constant string on the compatible property, now that memc became a syscon. Update the example accordingly. Fixes: 5278e4a181ff ("dt-bindings: memory: add binding for Mediatek's MT7621 SDRAM memory controller") Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Signed-off-by: David S. Miller commit 0fbca84eea37eba365130483f9e96b5563a84d7a Author: Arınç ÜNAL Date: Tue Sep 20 20:25:49 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: expand gpio-controller description Expand the description of the gpio-controller property to include the controllable pins of the MT7530 switch. The gpio-controller property is only used for the MT7530 switch. Therefore, invalidate it for the MT7531 switch. Signed-off-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: David S. Miller commit 3737c6aaf22dc6f515a7d4cf88dfe6e514414f88 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:48 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: change mt7530 switch address In the case of muxing phy0 of the MT7530 switch, the switch and the phy will have the same address on the mdio bus, 0. This causes the ethernet driver to fail since devices on the mdio bus cannot share an address. Any address can be used for the switch, therefore, change the switch address to 0x1f. Suggested-by: Sungbo Eo Signed-off-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: David S. Miller commit e8619b05870d509175492435d4b35b45f0e6c9c8 Author: Arınç ÜNAL Date: Tue Sep 20 20:25:47 2022 +0300 dt-bindings: net: drop old mediatek bindings Remove these old mediatek bindings which are not used. Signed-off-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: David S. Miller commit 489dd8611b64efbd84c12c6c9db470dadc34470f Author: Anand Moon Date: Thu Sep 22 19:20:48 2022 +0000 arm64: defconfig: Enable Synopsys DWC MSHC driver Enable the driver SDHCI support for the Synopsys DWC MSHC controller which can be found on Rockchip 356x SoCs. Cc: Heiko Stuebner Signed-off-by: Anand Moon Link: https://lore.kernel.org/r/20220922192050.2031-1-linux.amoon@gmail.com Signed-off-by: Heiko Stuebner commit fc44f3636a4db6544fd1532280e8adcd1ef13ba2 Author: Francesco Dolcini Date: Thu Sep 22 14:43:06 2022 +0200 drm/bridge: lt8912b: clarify lvds output status Add comments on the lt8912_write_lvds_config() config to document the current settings and to make it clear that this is a hardcoded configuration not relevant for the HDMI output (could be removed without affecting the HDMI port). No changes on the actual register writes. Signed-off-by: Francesco Dolcini Signed-off-by: Philippe Schenker Acked-by: Adrien Grassein Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-5-dev@pschenker.ch commit 2408ab5aa876cb0dd5ede23a5dadfec8132f5feb Author: Jagan Teki Date: Thu Sep 15 22:09:45 2022 +0530 clk: rockchip: Add clock controller support for RV1126 SoC Clock & Reset Unit (CRU) in RV1126 support clocks for CRU and CRU_PMU blocks. This patch is trying to add minimal Clock-Architecture Diagram's inferred from [1] authored by Finley Xiao. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/clk/rockchip/clk-rv1126.c Cc: linux-clk@vger.kernel.org Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Finley Xiao Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220915163947.1922183-5-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit d56f9ddf972dda7496fc2b78cc1e042e1051458b Merge: d05d9eb79d0cd d91a6d0490107 Author: David S. Miller Date: Fri Sep 23 09:53:11 2022 +0100 Merge branch 'sparx5-qos' Daniel Machon says: ==================== net: Add QoS offload support for sparx5 This patch series adds support for offloading QoS features with the tc command suite, to the sparx5 switch. The new offloadable QoS features introduced in this patch series are: - tc-mqprio for mapping traffic class to hardware queue. Queues are by default mapped 1:1 in hardware, as such the mqprio qdisc is used as an attachment point for qdiscs tbf and ets. $ tc qdisc add dev eth0 root handle 1:0 mqprio - tc-tbf for setting up shaping on scheduler elements of the HSCH (Hierarchical Scheduler) block. Shaping on either port output or queue output is supported. Port shaper: $ tc qdisc add dev eth0 root handle 1:0 tbf rate \ 10000000 burst 8192 limit 1m Queue shaper: $ tc qdisc replace dev eth0 parent 1:5 handle 2:0 tbf \ rate 10000000 burst 8192 limit 1m - tc-ets for setting up strict and or bandwidth-sharing bands on one through eight priority queues. Configure a mix of strict and bw-sharing bands: $ tc qdisc add dev eth0 handle 1: root ets bands 8 strict 5 \ quanta 1000 1000 1000 priomap 7 6 5 4 3 2 1 0 Patch #1 Sets up the tc hook. Patch #2 Adds support for offloading the tc-mqprio qdisc. Patch #3 Adds support for offloading the tc-tbf qdisc. Patch #4 Adds support for offloading the tc-ets qdisc. Patch #5 Updates the maintainers of the sparx5 driver. ======================================================================== v1: https://lore.kernel.org/netdev/20220919120215.3815696-1-daniel.machon@microchip.com/ v1 -> v2: - Fix compiler warning in patch #2 - Fix comment style in patch #4 ==================== Signed-off-by: David S. Miller commit d91a6d04901070d474abc7c28d02ebb3655c865c Author: Daniel Machon Date: Tue Sep 20 12:14:32 2022 +0200 maintainers: update MAINTAINERS file. Update Maintainers file. Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit 211225428d65882ceccfbde49ab6f4d832badc0c Author: Daniel Machon Date: Tue Sep 20 12:14:31 2022 +0200 net: microchip: sparx5: add support for offloading ets qdisc Add support for offloading ets qdisc to sparx5 switch. The ets qdisc makes it possible to configure a mix og strict and bandwidth-sharing bands. The ets qdisc must be attached as a root qdisc. Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit e02a5ac6bf7763edcd9590b98a14dd17f49a5248 Author: Daniel Machon Date: Tue Sep 20 12:14:30 2022 +0200 net: microchip: sparx5: add support for offloading tbf qdisc Add support for offloading tbf qdisc to sparx5 qdisc. The tbf qdisc makes it possible to attach a shaper on traffic egressing from a port or a queue. Per-port tbf qdiscs are attached as a root qdisc directly and queue tbf qdiscs are attached to one of the classes of a parent qdisc (such as mqprio). Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit ab0e493e75bde65579bf17a4e1e5a01f781146a7 Author: Daniel Machon Date: Tue Sep 20 12:14:29 2022 +0200 net: microchip: sparx5: add support for offloading mqprio qdisc Add support for offloading mqprio qdisc to sparx5 switch. The offloaded mqprio qdisc currently does nothing by itself, but serves as an attachment point for other qdiscs (tbf, ets etc.) Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit 65ec1bbe029703dc5e2a217337f30d93cf360a08 Author: Daniel Machon Date: Tue Sep 20 12:14:28 2022 +0200 net: microchip: sparx5: add tc setup hook Add tc setup hook for QoS features. Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit 5959725a4af615ba6c93c6466e1cc973f3979339 Merge: 3662c13ec62ad 1f04b07d976da Author: Vlastimil Babka Date: Fri Sep 23 10:33:45 2022 +0200 Merge branch 'slab/for-6.1/slub_validation_locking' into slab/for-next My series [1] to fix validation races for caches with enabled debugging. By decoupling the debug cache operation more from non-debug fastpaths, additional locking simplifications were possible and done afterwards. Additional cleanup of PREEMPT_RT specific code on top, by Thomas Gleixner. [1] https://lore.kernel.org/all/20220823170400.26546-1-vbabka@suse.cz/ commit 3662c13ec62ad7fcd313395040bd691b36136940 Merge: 0467ca385f406 d5eff736902d5 Author: Vlastimil Babka Date: Fri Sep 23 10:32:02 2022 +0200 Merge branch 'slab/for-6.1/common_kmalloc' into slab/for-next The "common kmalloc v4" series [1] by Hyeonggon Yoo. - Improves the mm/slab_common.c wrappers to allow deleting duplicated code between SLAB and SLUB. - Large kmalloc() allocations in SLAB are passed to page allocator like in SLUB, reducing number of kmalloc caches. - Removes the {kmem_cache_alloc,kmalloc}_node variants of tracepoints, node id parameter added to non-_node variants. - 8 files changed, 341 insertions(+), 651 deletions(-) [1] https://lore.kernel.org/all/20220817101826.236819-1-42.hyeyoo@gmail.com/ -- Merge resolves trivial conflict in mm/slub.c with commit 5373b8a09d6e ("kasan: call kasan_malloc() from __kmalloc_*track_caller()") commit 0467ca385f406e1cdfee92f86b1a26c3bcf7cdb3 Merge: e45cc288724f0 2bfbb0271a5b4 Author: Vlastimil Babka Date: Fri Sep 23 10:29:53 2022 +0200 Merge branch 'slab/for-6.1/trivial' into slab/for-next Trivial fixes and cleanups: - unneeded variable removals, by ye xingchen commit fdffc091e6f94602558bba712b51bc16f79fd6d5 Author: Yue Hu Date: Fri Sep 23 10:11:21 2022 +0800 erofs: support interlaced uncompressed data for compressed files Currently, uncompressed data is all handled in the shifted way, which means we have to shift the whole on-disk plain pcluster to get the logical data. However, since we are also using in-place I/O for uncompressed data, data copy will be reduced a lot if pcluster is recorded in the interlaced way as illustrated below: _______________________________________________________________ | | | |_ tail part |_ head part _| |<- blk0 ->| .. |<- blkn-2 ->|<- blkn-1 ->| The logical data then becomes: ________________________________________________________ |_ head part _|_ blk0 _| .. |_ blkn-2 _|_ tail part _| In addition, non-4k plain pclusters are also survived by the interlaced way, which can be used for non-4k lclusters as well. However, it's almost impossible to de-duplicate uncompressed data in the interlaced way, therefore shifted uncompressed data is still useful. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/8369112678604fdf4ef796626d59b1fdd0745a53.1663898962.git.huyue2@coolpad.com Signed-off-by: Gao Xiang commit d05d9eb79d0cd0f7a978621b4a56a1f2db444f86 Merge: 304843c7ac44b 24aeeb107f072 Author: Jakub Kicinski Date: Thu Sep 22 19:31:38 2022 -0700 Merge branch 'net-dsa-remove-unnecessary-set_drvdata' Yang Yingliang says: ==================== net: dsa: remove unnecessary set_drvdata() In this patch set, I removed all set_drvdata(NULL) functions in ->remove() in drivers/net/dsa/. The driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(), so all set_drvdata(NULL) functions in ->remove() is redundant, they can be removed. Here is the previous patch set: https://lore.kernel.org/netdev/facfc855-d082-cc1c-a0bc-027f562a2f45@huawei.com/T/ ==================== Link: https://lore.kernel.org/r/20220921140524.3831101-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 24aeeb107f0724fa15e16d5f28b39f3c3ecfc746 Author: Yang Yingliang Date: Wed Sep 21 22:05:24 2022 +0800 net: dsa: xrs700x: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 774b060debb189cb778fc195395dd24ea67bef5b Author: Yang Yingliang Date: Wed Sep 21 22:05:23 2022 +0800 net: dsa: vitesse-vsc73xx: remove unnecessary set_drvdata() Remove unnecessary set_drvdata(NULL) function in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Acked-by: Linus Walleij Signed-off-by: Jakub Kicinski commit ee08bf0d0a3aa8c4f00ae006b8068e8ea16d1cf9 Author: Yang Yingliang Date: Wed Sep 21 22:05:22 2022 +0800 net: dsa: sja1105: remove unnecessary spi_set_drvdata() Remove unnecessary spi_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 4f6ee77aebf19908db8e88491f51dab2ffbe4524 Author: Yang Yingliang Date: Wed Sep 21 22:05:21 2022 +0800 net: dsa: rzn1-a5psw: remove unnecessary platform_set_drvdata() Remove unnecessary platform_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 24d64ced1bf8d333dc4697d1cc6d2b4f64cc145d Author: Yang Yingliang Date: Wed Sep 21 22:05:20 2022 +0800 net: dsa: realtek: remove unnecessary set_drvdata() Remove unnecessary set_drvdata(NULL) function in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Acked-by: Alvin Šipraga Acked-by: Linus Walleij Signed-off-by: Jakub Kicinski commit 68c4e297e09c3b3e2012ea54e5329d03d653c977 Author: Yang Yingliang Date: Wed Sep 21 22:05:19 2022 +0800 net: dsa: qca8k: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 14b29ece30e53f9b380f146d5f4f9062131b0d65 Author: Yang Yingliang Date: Wed Sep 21 22:05:18 2022 +0800 net: dsa: ar9331: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit f66d1ecc1ad4f75cce3aa9286d4c7f9a980f5a39 Author: Yang Yingliang Date: Wed Sep 21 22:05:17 2022 +0800 net: dsa: ocelot: remove unnecessary set_drvdata() Remove unnecessary set_drvdata(NULL) function in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit b25a575c9cd08a08fbe8a9569abd81d362cbfb85 Author: Yang Yingliang Date: Wed Sep 21 22:05:16 2022 +0800 net: dsa: mv88e6xxx: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 92f529b7a3b7ec71960328a58f1a06aad75205e3 Author: Yang Yingliang Date: Wed Sep 21 22:05:15 2022 +0800 net: dsa: mv88e6060: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit ebe48922c0c45bcedd407d0fe546464694061af7 Author: Yang Yingliang Date: Wed Sep 21 22:05:14 2022 +0800 net: dsa: mt7530: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 3525ecc127d893f99671df041764aa4185c79e0b Author: Yang Yingliang Date: Wed Sep 21 22:05:13 2022 +0800 net: dsa: microchip: remove unnecessary set_drvdata() Remove unnecessary set_drvdata(NULL) function in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit f6ddabca45f684357cfdea7a61b94ddfb22cd583 Author: Yang Yingliang Date: Wed Sep 21 22:05:12 2022 +0800 net: dsa: lantiq_gswip: remove unnecessary platform_set_drvdata() Remove unnecessary platform_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 2697085007f0dd2a1c0e31375934d302ff68bca2 Author: Yang Yingliang Date: Wed Sep 21 22:05:11 2022 +0800 net: dsa: lan9303: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 8668cfc6db48aafed0cc9cd2f770dea246e02f52 Author: Yang Yingliang Date: Wed Sep 21 22:05:10 2022 +0800 net: dsa: hellcreek: remove unnecessary platform_set_drvdata() Remove unnecessary platform_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Acked-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit c1816b20141597071c67a69e8fb8d31f1b9adfad Author: Yang Yingliang Date: Wed Sep 21 22:05:09 2022 +0800 net: dsa: loop: remove unnecessary dev_set_drvdata() Remove unnecessary dev_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Acked-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 47f6aa145036b57186f1eae35d0eebb2bf3fd6b7 Author: Yang Yingliang Date: Wed Sep 21 22:05:08 2022 +0800 net: dsa: bcm_sf2: remove unnecessary platform_set_drvdata() Remove unnecessary platform_set_drvdata() in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 764a73b43c360d1c2925baa6bd76160599c76991 Author: Yang Yingliang Date: Wed Sep 21 22:05:07 2022 +0800 net: dsa: b53: remove unnecessary set_drvdata() Remove unnecessary set_drvdata(NULL) function in ->remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove(). Signed-off-by: Yang Yingliang Signed-off-by: Jakub Kicinski commit 304843c7ac44be6af5e88756496e8ead01436ebe Author: Andy Shevchenko Date: Wed Sep 21 17:10:05 2022 +0300 ptp_ocp: use device_find_any_child() instead of custom approach We have already a helper to get the first child device, use it and drop custom approach. Signed-off-by: Andy Shevchenko Acked-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20220921141005.2443-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jakub Kicinski commit 05cd823863fd32e9fcd5e8818a0a9070e54cfcc1 Author: Li Zhong Date: Wed Sep 21 11:17:16 2022 -0700 ethtool: tunnels: check the return value of nla_nest_start() Check the return value of nla_nest_start(). When starting the entry level nested attributes, if the tailroom of socket buffer is insufficient to store the attribute header and payload, the return value will be NULL. There is, however, no real bug here since if the skb is full nla_put_be16() will fail as well and we'll error out. Signed-off-by: Li Zhong Link: https://lore.kernel.org/r/20220921181716.1629541-1-floridsleeves@gmail.com Signed-off-by: Jakub Kicinski commit 1ae9470c3e14624b0f4d8741c22b5a94062c0e33 Author: Jingbo Xu Date: Thu Sep 22 14:24:14 2022 +0800 erofs: clean up .read_folio() and .readahead() in fscache mode The implementation of these two functions in fscache mode is almost the same. Extract the same part as a generic helper to remove the code duplication. Signed-off-by: Jingbo Xu Reviewed-by: Jia Zhu Link: https://lore.kernel.org/r/20220922062414.20437-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 97cfede0d1475945458fb0a91f9fbf1366dd0827 Merge: bcff1a37bafc1 eb43846b43c3b Author: Jakub Kicinski Date: Thu Sep 22 18:01:36 2022 -0700 Merge branch 'mlx5-macsec-extended-packet-number-and-replay-window-offload' Saeed Mahameed says: ==================== mlx5 MACSec Extended packet number and replay window offload This is a follow up series to the previously submitted mlx5 MACsec offload [1] earlier this release cycle. In this series we add the support for MACsec Extended packet number and replay window offloads. First patch is a simple modification (code movements) to the core macsec code to allow exposing the EPN related user properties to the offloading device driver. The rest of the patches are mlx5 specific, we start off with fixing some trivial issues with mlx5 MACsec code, and a simple refactoring to allow additional functionality in mlx5 macsec to support EPN and window replay offloads. A) Expose mkey creation functionality to MACsec B) Expose ASO object to MACsec, to allow advanced steering operations, ASO objects are used to modify MACsec steering objects in fastpath. 1) Support MACsec offload extended packet number (EPN) MACsec EPN splits the packet number (PN) into two 32-bits fields, epn_lsb (32 least significant bits (LSBs) of PN) and epn_msb (32 most significant bits (MSBs) of PN). Epn_msb bits are managed by SW and for that HW is required to send an object change event of type EPN event notifying the SW to update the epn_msb in addition, once epn_msb is updated SW update HW with the new epn_msb value for HW to perform replay protection. To prevent HW from stopping while handling the event, SW manages another bit for HW called epn_overlap, HW uses the latter to get an indication regarding how to read the epn_msb value correctly while still receiving packets. Add epn event handling that updates the epn_overlap and epn_msb for every 2^31 packets according to the following logic: if epn_lsb crosses 2^31 (half sequence number wraparound) upon HW relevant event, SW updates the esn_overlap value to OLD (value = 1). When the epn_lsb crosses 2^32 (full sequence number wraparound) upon HW relevant event, SW updates the esn_overlap to NEW (value = 0) and increment the esn_msb. When using MACsec EPN a salt and short secure channel id (ssci) needs to be provided by the user, when offloading EPN need to pass this salt and ssci to the HW to be used in the initial vector (IV) calculations. 2) Support MACsec offload replay window Support setting replay window size for MACsec offload. Currently supported window size of 32, 64, 128 and 256 bit. Other values will be returned as invalid parameter. [1] https://lore.kernel.org/netdev/20220906052129.104507-1-saeed@kernel.org/ ==================== Link: https://lore.kernel.org/r/20220921181054.40249-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit eb43846b43c3b6578703661274206202cc04c358 Author: Emeel Hakim Date: Wed Sep 21 11:10:54 2022 -0700 net/mlx5e: Support MACsec offload replay window Support setting replay window size for MACsec offload. Currently supported window size of 32, 64, 128 and 256 bit. Other values will be returned as invalid parameter. Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 4411a6c0abd3e55b4a4fb9432b3a0553f12337c2 Author: Emeel Hakim Date: Wed Sep 21 11:10:53 2022 -0700 net/mlx5e: Support MACsec offload extended packet number (EPN) MACsec EPN splits the packet number (PN) into two 32-bits fields, epn_lsb (32 least significant bits (LSBs) of PN) and epn_msb (32 most significant bits (MSBs) of PN). Epn_msb bits are managed by SW and for that HW is required to send an object change event of type EPN event notifying the SW to update the epn_msb in addition, once epn_msb is updated SW update HW with the new epn_msb value for HW to perform replay protection. To prevent HW from stopping while handling the event, SW manages another bit for HW called epn_overlap, HW uses the latter to get an indication regarding how to read the epn_msb value correctly while still receiving packets. Add epn event handling that updates the epn_overlap and epn_msb for every 2^31 packets according to the following logic: if epn_lsb crosses 2^31 (half sequence number wraparound) upon HW relevant event, SW updates the esn_overlap value to OLD (value = 1). When the epn_lsb crosses 2^32 (full sequence number wraparound) upon HW relevant event, SW updates the esn_overlap to NEW (value = 0) and increment the esn_msb. When using MACsec EPN a salt and short secure channel id (ssci) needs to be provided by the user, when offloading EPN need to pass this salt and ssci to the HW to be used in the initial vector (IV) calculations. Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Reported-by: kernel test robot Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 3fd3fb6b6b888603dd4ab605c2b51a2edf3ab7a1 Author: Emeel Hakim Date: Wed Sep 21 11:10:52 2022 -0700 net/mlx5e: Move MACsec initialization from profile init stage to profile enable stage Postpone MACsec initialization to the mlx5e profile enable stage to have user access region (UAR) pages and other resources ready before MACsec initialization to initialize advanced steering operation (ASO) hardware resources. Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 1f53da676439c52b83453c5b54b4d3d28dcc9793 Author: Emeel Hakim Date: Wed Sep 21 11:10:51 2022 -0700 net/mlx5e: Create advanced steering operation (ASO) object for MACsec Add support for ASO work queue entry (WQE) data to allow reading data upon querying the ASO work queue (WQ). Register user mode memory registration (UMR) upon ASO WQ init, de-register UMR upon ASO WQ cleanup. MACsec uses UMR to determine the cause of the event triggered by the HW since different scenarios could trigger the same event. Setup MACsec ASO object to sync HW with SW about various macsec flow stateful features like: replay window, lifetime limits e.t.c Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0e1e03c02f122a9c3be4b4297ee24661ee0b1068 Author: Emeel Hakim Date: Wed Sep 21 11:10:50 2022 -0700 net/mlx5e: Expose memory key creation (mkey) function Expose mlx5e_create_mkey function, for future patches in the macsec series to use. The above function creates a memory key which describes a region in memory that can be later used by both HW and SW. The counterpart destroy functionality is already exposed. Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 23cc83c6ca87c9a4da62b9ddf4d0fc09f3054f81 Author: Emeel Hakim Date: Wed Sep 21 11:10:49 2022 -0700 net/mlx5: Add ifc bits for MACsec extended packet number (EPN) and replay protection Add ifc bits related to advanced steering operations (ASO) and general object modify for macsec to use as part of offloading EPN and replay protection features. Reviewed-by: Raed Salem Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit cb6d3c0f1baeaa554557a4203fe40142e2d67b92 Author: Emeel Hakim Date: Wed Sep 21 11:10:48 2022 -0700 net/mlx5e: Fix MACsec initial packet number Currently when creating MACsec object, next_pn which represents the initial packet number (PN) is considered only in TX flow. The above causes mismatch between TX and RX initial PN which is reflected in packet drops. Fix by considering next_pn in RX flow too. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 6c5e0b25db3af34c4a0c7076f84a2adf0fee17a0 Author: Emeel Hakim Date: Wed Sep 21 11:10:47 2022 -0700 net/mlx5e: Fix MACsec initialization error path Currently MACsec initialization error path does not destroy sci hash table in case of failure. Fix by destroying hash table in case of failure. Fixes: 9515978eee0b ("net/mlx5e: Implement MACsec Tx data path using MACsec skb_metadata_dst") Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 21803630c4ffb433bab2951fbe0ee7b8dbcc8bcb Author: Emeel Hakim Date: Wed Sep 21 11:10:46 2022 -0700 net/mlx5: Fix fields name prefix in MACsec Fix ifc fields name to be consistent with the device spec document. Fixes: 8385c51ff5bc ("net/mlx5: Introduce MACsec Connect-X offload hardware bits and structures") Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 0a6e9b718dbbdeb6e9f56f2f79e789f6833ea804 Author: Emeel Hakim Date: Wed Sep 21 11:10:45 2022 -0700 net: macsec: Expose extended packet number (EPN) properties to macsec offload Currently macsec invokes HW offload path before reading extended packet number (EPN) related user properties i.e. salt and short secure channel identifier (ssci), hence preventing macsec EPN HW offload. Expose those by moving macsec EPN properties reading prior to HW offload path. Signed-off-by: Emeel Hakim Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit 6f65540b22afaa9c3d621bfb8b2a2958fedf6179 Author: Chia-Wei Wang Date: Tue Sep 20 10:03:33 2022 +0800 ipmi: kcs: aspeed: Update port address comments Remove AST_usrGuide_KCS.pdf as it is no longer maintained. Add more descriptions as the driver now supports the I/O address configurations for both the KCS Data and Cmd/Status interface registers. Signed-off-by: Chia-Wei Wang Message-Id: <20220920020333.601-1-chiawei_wang@aspeedtech.com> [I don't like removing documentation, but the document in question was a personal note by an employee and nothing official and not necessarily guaranteed to be accurate in the future. So go ahead and remove it.] Signed-off-by: Corey Minyard commit bcff1a37bafc144d67192f2f5e1f4b9c49b37bd6 Merge: 3f5b606dd9b95 c706df6d8f6ed Author: Jakub Kicinski Date: Thu Sep 22 17:41:31 2022 -0700 Merge branch 'cleanup-in-huawei-hinic-driver' Zhengchao Shao says: ==================== cleanup in Huawei hinic driver Do code cleanup in Huawei hinic driver. ==================== Link: https://lore.kernel.org/r/20220921123358.63442-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit c706df6d8f6ed63f096a5b4dc07817c955e881f6 Author: Zhengchao Shao Date: Wed Sep 21 20:33:58 2022 +0800 net: hinic: remove the unused input parameter prod_idx in sq_prepare_ctrl() The input parameter prod_idx is not used in sq_prepare_ctrl(), remove it. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 57ac57154d83618a1052080d6c1dc3e4f3e90d9c Author: Zhengchao Shao Date: Wed Sep 21 20:33:57 2022 +0800 net: hinic: replace magic numbers with macro Replace magic numbers with macro. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 566ad0ed6b12a16b3562cef66b835b95267ca71f Author: Zhengchao Shao Date: Wed Sep 21 20:33:56 2022 +0800 net: hinic: remove unused enumerated value remove unused enumerated value. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit dcbe72d25594e4a52b5ce29d52e57514dd305c79 Author: Zhengchao Shao Date: Wed Sep 21 20:33:55 2022 +0800 net: hinic: change hinic_deinit_vf_hw() to void When hinic_pci_sriov_disable() calls hinic_deinit_vf_hw(), it doesn't care about the return value of hinic_deinit_vf_hw(). Also hinic_deinit_vf_hw() is return 0, so change it to void. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 4f304250c39b4c6bae40521524cc9235ba8ab327 Author: Zhengchao Shao Date: Wed Sep 21 20:33:54 2022 +0800 net: hinic: simplify code logic simplify code logic in hinic_ndo_set_vf_trust() and hinic_ndo_set_vf_spoofchk(). Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 97d6a3e642bfe1671c746d6bed478eabf2c23d73 Author: Zhengchao Shao Date: Wed Sep 21 20:33:53 2022 +0800 net: hinic: remove duplicate macro definition The macro HINIC_WAIT_SRIOV_CFG_TIMEOUT is defined twice, remove one. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 2fa1cd3b4a0dd8a5c3e73db9cbb29e05bbc996a2 Author: Zhengchao Shao Date: Wed Sep 21 20:33:52 2022 +0800 net: hinic: remove unused macro remove unused macro. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 2b291ee6dd6e57e295a0717f198a2a31a6f510c0 Author: Zhengchao Shao Date: Wed Sep 21 20:33:51 2022 +0800 net: hinic: remove unused functions hinic_hwdev_max_num_qpas() and hinic_msix_attr_get() are no longer called, remove them. Also the macro HINIC_MSIX_ATTR_GET is also not called, remove it. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 73f25f16cc3c0b63f73c07ab72db3dd3e7a9572e Author: Zhengchao Shao Date: Wed Sep 21 20:33:50 2022 +0800 net: hinic: change type of function to be static Functions are called only in one file, change their type to static. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 15b209cde2632e0dd926884135fc7ec4f14a4e97 Author: Zhengchao Shao Date: Wed Sep 21 20:33:49 2022 +0800 net: hinic: modify kernel doc comments The type of cmdq_free_page() hinic_set_pf_action() and link_status_event_handler() are void, modify the comments. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 3f5b606dd9b955e7dae0ff0830c77bb1b3d3668d Merge: a2c2a4ddc27db d3f832547bb29 Author: Jakub Kicinski Date: Thu Sep 22 17:34:18 2022 -0700 Merge branch 'refactor-duplicate-codes-in-the-qdisc-class-walk-function' Zhengchao Shao says: ==================== refactor duplicate codes in the qdisc class walk function The walk implementation of most qdisc class modules is basically the same. That is, the values of count and skip are checked first. If count is greater than or equal to skip, the registered fn function is executed. Otherwise, increase the value of count. So the code can be refactored. The walk function is invoked during dump. Therefore, test cases related to the tdc filter need to be added. ==================== Link: https://lore.kernel.org/r/20220921024040.385296-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit d3f832547bb2981a96f498e007c100703398de53 Author: Zhengchao Shao Date: Wed Sep 21 10:44:25 2022 +0800 selftests/tc-testing: add show class case for red qdisc Test 290a: Show RED class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 1c15eb2a03c679d8188b22dd4f07ae1bfdb9ac1b Author: Zhengchao Shao Date: Wed Sep 21 10:44:15 2022 +0800 selftests/tc-testing: add show class case for prio qdisc Test 2410: Show prio class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit dfbadd7f9945429068f10343eee49d635adad0cd Author: Zhengchao Shao Date: Wed Sep 21 10:44:04 2022 +0800 selftests/tc-testing: add show class case for mq qdisc Test 1023: Show mq class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 5ca72fbeabede09ca5d8b703defdc8ccdfbe5892 Author: Zhengchao Shao Date: Wed Sep 21 10:43:54 2022 +0800 selftests/tc-testing: add show class case for ingress qdisc Test 0521: Show ingress class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 856359c0d067654c83b8db09b413361846737100 Author: Zhengchao Shao Date: Wed Sep 21 10:43:44 2022 +0800 selftests/tc-testing: add selftests for qfq qdisc Test 0582: Create QFQ with default setting Test c9a3: Create QFQ with class weight setting Test 8452: Create QFQ with class maxpkt setting Test d920: Create QFQ with multiple class setting Test 0548: Delete QFQ with handle Test 5901: Show QFQ class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 779f966f16db428005b533871c3b22b262b145aa Author: Zhengchao Shao Date: Wed Sep 21 10:43:33 2022 +0800 selftests/tc-testing: add selftests for netem qdisc Test cb28: Create NETEM with default setting Test a089: Create NETEM with limit flag Test 3449: Create NETEM with delay time Test 3782: Create NETEM with distribution and corrupt flag Test 2b82: Create NETEM with distribution and duplicate flag Test a932: Create NETEM with distribution and loss flag Test e01a: Create NETEM with distribution and loss state flag Test ba29: Create NETEM with loss gemodel flag Test 0492: Create NETEM with reorder flag Test 7862: Create NETEM with rate limit Test 7235: Create NETEM with multiple slot rate Test 5439: Create NETEM with multiple slot setting Test 5029: Change NETEM with loss state Test 3785: Replace NETEM with delay time Test 4502: Delete NETEM with handle Test 0785: Show NETEM class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit e4c4bcb0e4eef5f35b39f814c54787fa3bef5400 Author: Zhengchao Shao Date: Wed Sep 21 10:43:21 2022 +0800 selftests/tc-testing: add selftests for multiq qdisc Test 20ba: Add multiq Qdisc to multi-queue device (8 queues) Test 4301: List multiq Class Test 7832: Delete nonexistent multiq Qdisc Test 2891: Delete multiq Qdisc twice Test 1329: Add multiq Qdisc to single-queue device Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 8ab00f8b5e294c5c5206ab10ac2a7d94ecba9892 Author: Zhengchao Shao Date: Wed Sep 21 10:43:12 2022 +0800 selftests/tc-testing: add selftests for mqprio qdisc Test 9903: Add mqprio Qdisc to multi-queue device (8 queues) Test 453a: Delete nonexistent mqprio Qdisc Test 5292: Delete mqprio Qdisc twice Test 45a9: Add mqprio Qdisc to single-queue device Test 2ba9: Show mqprio class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 68135f6362181bd093be7ff45362acec79c2cc1b Author: Zhengchao Shao Date: Wed Sep 21 10:43:02 2022 +0800 selftests/tc-testing: add selftests for htb qdisc Test 0904: Create HTB with default setting Test 3906: Create HTB with default-N setting Test 8492: Create HTB with r2q setting Test 9502: Create HTB with direct_qlen setting Test b924: Create HTB with class rate and burst setting Test 4359: Create HTB with class mpu setting Test 9048: Create HTB with class prio setting Test 4994: Create HTB with class ceil setting Test 9523: Create HTB with class cburst setting Test 5353: Create HTB with class mtu setting Test 346a: Create HTB with class quantum setting Test 303a: Delete HTB with handle Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 265b9adcc4c6f9b5e2d0795cd8a82a5c8351e99f Author: Zhengchao Shao Date: Wed Sep 21 10:42:51 2022 +0800 selftests/tc-testing: add selftests for hfsc qdisc Test 3254: Create HFSC with default setting Test 0289: Create HFSC with class sc and ul rate setting Test 846a: Create HFSC with class sc umax and dmax setting Test 5413: Create HFSC with class rt and ls rate setting Test 9312: Create HFSC with class rt umax and dmax setting Test 6931: Delete HFSC with handle Test 8436: Show HFSC class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 965a25e3455018b380e12eea179144b564a52053 Author: Zhengchao Shao Date: Wed Sep 21 10:42:39 2022 +0800 selftests/tc-testing: add selftests for fq_codel qdisc Test 4957: Create FQ_CODEL with default setting Test 7621: Create FQ_CODEL with limit setting Test 6871: Create FQ_CODEL with memory_limit setting Test 5636: Create FQ_CODEL with target setting Test 630a: Create FQ_CODEL with interval setting Test 4324: Create FQ_CODEL with quantum setting Test b190: Create FQ_CODEL with noecn flag Test 5381: Create FQ_CODEL with ce_threshold setting Test c9d2: Create FQ_CODEL with drop_batch setting Test 523b: Create FQ_CODEL with multiple setting Test 9283: Replace FQ_CODEL with noecn setting Test 3459: Change FQ_CODEL with limit setting Test 0128: Delete FQ_CODEL with handle Test 0435: Show FQ_CODEL class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 5d93f04d681d60f6d0e3ecb2c8df97c2d9b28980 Author: Zhengchao Shao Date: Wed Sep 21 10:42:25 2022 +0800 selftests/tc-testing: add selftests for dsmark qdisc Test 6345: Create DSMARK with default setting Test 3462: Create DSMARK with default_index setting Test ca95: Create DSMARK with set_tc_index flag Test a950: Create DSMARK with multiple setting Test 4092: Delete DSMARK with handle Test 5930: Show DSMARK class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 9b1edbc1c58fb211976f6eaa8a25da04bfe59a42 Author: Zhengchao Shao Date: Wed Sep 21 10:42:15 2022 +0800 selftests/tc-testing: add selftests for drr qdisc Test 0385: Create DRR with default setting Test 2375: Delete DRR with handle Test 3092: Show DRR class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 3bec7e2910b87636c4ecf5dffab87f616bf36020 Author: Zhengchao Shao Date: Wed Sep 21 10:42:05 2022 +0800 selftests/tc-testing: add selftests for cbs qdisc Test 1820: Create CBS with default setting Test 1532: Create CBS with hicredit setting Test 2078: Create CBS with locredit setting Test 9271: Create CBS with sendslope setting Test 0482: Create CBS with idleslope setting Test e8f3: Create CBS with multiple setting Test 23c9: Replace CBS with sendslope setting Test a07a: Change CBS with idleslope setting Test 43b3: Delete CBS with handle Test 9472: Show CBS class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 6c1ef8f00f9a383e1c0a48c059d3801270495c53 Author: Zhengchao Shao Date: Wed Sep 21 10:41:55 2022 +0800 selftests/tc-testing: add selftests for cbq qdisc Test 3460: Create CBQ with default setting Test 0592: Create CBQ with mpu Test 4684: Create CBQ with valid cell num Test 4345: Create CBQ with invalid cell num Test 4525: Create CBQ with valid ewma Test 6784: Create CBQ with invalid ewma Test 5468: Delete CBQ with handle Test 492a: Show CBQ class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit b68d9c330eef9c860211ce65b86b90db32e0cef7 Author: Zhengchao Shao Date: Wed Sep 21 10:41:31 2022 +0800 selftests/tc-testing: add selftests for cake qdisc Test 1212: Create CAKE with default setting Test 3281: Create CAKE with bandwidth limit Test c940: Create CAKE with autorate-ingress flag Test 2310: Create CAKE with rtt time Test 2385: Create CAKE with besteffort flag Test a032: Create CAKE with diffserv8 flag Test 2349: Create CAKE with diffserv4 flag Test 8472: Create CAKE with flowblind flag Test 2341: Create CAKE with dsthost and nat flag Test 5134: Create CAKE with wash flag Test 2302: Create CAKE with flowblind and no-split-gso flag Test 0768: Create CAKE with dual-srchost and ack-filter flag Test 0238: Create CAKE with dual-dsthost and ack-filter-aggressive flag Test 6572: Create CAKE with memlimit and ptm flag Test 2436: Create CAKE with fwmark and atm flag Test 3984: Create CAKE with overhead and mpu Test 5421: Create CAKE with conservative and ingress flag Test 6854: Delete CAKE with conservative and ingress flag Test 2342: Replace CAKE with mpu Test 2313: Change CAKE with mpu Test 4365: Show CAKE class Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Acked-by: Toke Høiland-Jørgensen Signed-off-by: Jakub Kicinski commit e046fa895c45235095693e44244292a6ab9c3d0b Author: Zhengchao Shao Date: Wed Sep 21 10:41:18 2022 +0800 net/sched: use tc_qdisc_stats_dump() in qdisc use tc_qdisc_stats_dump() in qdisc. Signed-off-by: Zhengchao Shao Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Acked-by: Toke Høiland-Jørgensen Signed-off-by: Jakub Kicinski commit d7a68e564e29bcd1c70d76d9e2f65591e6183f46 Author: Zhengchao Shao Date: Wed Sep 21 10:41:04 2022 +0800 net/sched: sch_api: add helper for tc qdisc walker stats dump The walk implementation of most qdisc class modules is basically the same. That is, the values of count and skip are checked first. If count is greater than or equal to skip, the registered fn function is executed. Otherwise, increase the value of count. So we can reconstruct them. Signed-off-by: Zhengchao Shao Acked-by: Toke Høiland-Jørgensen Signed-off-by: Jakub Kicinski commit a2c2a4ddc27db1715be8c03280c6cb7b808dd8b7 Author: Vladimir Oltean Date: Wed Sep 21 12:56:31 2022 +0300 net/sched: taprio: remove unnecessary taprio_list_lock The 3 functions that want access to the taprio_list: taprio_dev_notifier(), taprio_destroy() and taprio_init() are all called with the rtnl_mutex held, therefore implicitly serialized with respect to each other. A spin lock serves no purpose. Signed-off-by: Vladimir Oltean Acked-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20220921095632.1379251-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 03d25cf7a0e9e83448a67cd1e3c51712f3273984 Merge: 8db3d514e9671 4960c414db358 Author: Jakub Kicinski Date: Thu Sep 22 17:27:45 2022 -0700 Merge branch 'support-256-bit-tls-keys-with-device-offload' Gal Pressman says: ==================== Support 256 bit TLS keys with device offload This series adds support for 256 bit TLS keys with device offload, and a cleanup patch to remove repeating code: - Patches #1-2 add cipher sizes descriptors which allow reducing the amount of code duplications. - Patch #3 allows 256 bit keys to be TX offloaded in the tls module (RX already supported). - Patch #4 adds 256 bit keys support to the mlx5 driver. ==================== Link: https://lore.kernel.org/r/20220920130150.3546-1-gal@nvidia.com Signed-off-by: Jakub Kicinski commit 4960c414db3582b266dce660bd8eff41157fe2f9 Author: Gal Pressman Date: Tue Sep 20 16:01:50 2022 +0300 net/mlx5e: Support 256 bit keys with kTLS device offload Add support for 256 bit TLS keys using device offload. Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Signed-off-by: Jakub Kicinski commit 56e5a6d3aa91ed7b5b231c84180d449ce2313f61 Author: Gal Pressman Date: Tue Sep 20 16:01:49 2022 +0300 net/tls: Support 256 bit keys with TX device offload Add the missing clause for 256 bit keys in tls_set_device_offload(), and the needed adjustments in tls_device_fallback.c. Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Signed-off-by: Jakub Kicinski commit ea7a9d88ba21dd9d395d7137b0ca1743c5f5d9c2 Author: Gal Pressman Date: Tue Sep 20 16:01:48 2022 +0300 net/tls: Use cipher sizes structs Use the newly introduced cipher sizes structs instead of the repeated switch cases churn. Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Signed-off-by: Jakub Kicinski commit 2d2c5ea24243eb3ed12f232b2aef43981fa15360 Author: Tariq Toukan Date: Tue Sep 20 16:01:47 2022 +0300 net/tls: Describe ciphers sizes by const structs Introduce cipher sizes descriptor. It helps reducing the amount of code duplications and repeated switch/cases that assigns the proper sizes according to the cipher type. Signed-off-by: Tariq Toukan Signed-off-by: Gal Pressman Signed-off-by: Jakub Kicinski commit ee9bb9b4459ab7e27de9c9f91773ade2909c6375 Merge: b780d1671cf93 103d002fb7d54 Author: Martin KaFai Lau Date: Thu Sep 22 16:11:35 2022 -0700 Merge branch 'Fix resource leaks in test_maps' Hou Tao says: ==================== From: Hou Tao Hi, It is just a tiny patch set aims to fix the resource leaks in test_maps after test case succeeds or is skipped. And these leaks are spotted by using address sanitizer and checking the content of /proc/$pid/fd. Please see indiviual patch for more details. Change Log: v2: * Add the missing header file unistd.h for close() (From kernel-patches/bpf) The reason Why I miss that is that -Werror is removed from Makefile when enabling clang address sanitizer. v1: * https://lore.kernel.org/bpf/20220921025855.115463-1-houtao@huaweicloud.com/T/ ==================== Signed-off-by: Martin KaFai Lau commit 103d002fb7d548fb1187e350f2b73788558128b9 Author: Hou Tao Date: Wed Sep 21 15:00:35 2022 +0800 selftests/bpf: Free the allocated resources after test case succeeds Free the created fd or allocated bpf_object after test case succeeds, else there will be resource leaks. Spotted by using address sanitizer and checking the content of /proc/$pid/fd directory. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220921070035.2016413-3-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit f5eb23b91c41a7ffc7ca7fe14f3c512360f02937 Author: Hou Tao Date: Wed Sep 21 15:00:34 2022 +0800 selftests/bpf: Destroy the skeleton when CONFIG_PREEMPT is off Destroy the created skeleton when CONFIG_PREEMPT is off, else will be resource leak. Fixes: 73b97bc78b32 ("selftests/bpf: Test concurrent updates on bpf_task_storage_busy") Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220921070035.2016413-2-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 8db3d514e96715c897fe793c4d5fc0fd86aca517 Author: Vadim Fedorenko Date: Thu Sep 22 22:10:38 2022 +0300 bnxt_en: replace reset with config timestamps Any change to the hardware timestamps configuration triggers nic restart, which breaks transmition and reception of network packets for a while. But there is no need to fully restart the device because while configuring hardware timestamps. The code for changing configuration runs after all of the initialisation, when the NIC is actually up and running. This patch changes the code that ioctl will only update configuration registers and will not trigger carrier status change, but in case of timestamps for all rx packetes it fallbacks to close()/open() sequnce because of synchronization issues in the hardware. Tested on BCM57504. Cc: Richard Cochran Signed-off-by: Vadim Fedorenko Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220922191038.29921-1-vfedorenko@novek.ru Signed-off-by: Jakub Kicinski commit cdc71fe4ecbf48f7292ae8b7e4ff4a2a8b5bdbca Author: Jason Gunthorpe Date: Thu Sep 22 16:20:26 2022 -0300 vfio: Move container code into drivers/vfio/container.c All the functions that dereference struct vfio_container are moved into container.c. Simple code motion, no functional change. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/8-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 9446162e740aefff95c324ac0887f0b68c739695 Author: Jason Gunthorpe Date: Thu Sep 22 16:20:25 2022 -0300 vfio: Split the register_device ops call into functions This is a container item. A following patch will move the vfio_container functions to their own .c file. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 1408640d578887d7860737221043d91fc6d5a723 Author: Jason Gunthorpe Date: Thu Sep 22 16:20:24 2022 -0300 vfio: Rename vfio_ioctl_check_extension() To vfio_container_ioctl_check_extension(). A following patch will turn this into a non-static function, make it clear it is related to the container. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit c41da4622e08f874ab02e12eb6b6aaa9ac21daa7 Author: Jason Gunthorpe Date: Thu Sep 22 16:20:23 2022 -0300 vfio: Split out container code from the init/cleanup functions This miscdev, noiommu driver and a couple of globals are all container items. Move this init into its own functions. A following patch will move the vfio_container functions to their own .c file. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 444d43ecd01033a758e73b8ae154ee7f3e827f7b Author: Jason Gunthorpe Date: Thu Sep 22 16:20:22 2022 -0300 vfio: Remove #ifdefs around CONFIG_VFIO_NOIOMMU This can all be accomplished using typical IS_ENABLED techniques, drop it all. Also rename the variable to vfio_noiommu so this can be made global in following patches. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 03e650f6611563c0ccbd0d769d5748fd10d8ee8e Author: Jason Gunthorpe Date: Thu Sep 22 16:20:21 2022 -0300 vfio: Split the container logic into vfio_container_attach_group() This splits up the ioctl of vfio_group_ioctl_set_container() so it determines the type of file then invokes a type specific attachment function. Future patches will add iommufd to this function as an alternative type. A following patch will move the vfio_container functions to their own .c file. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 429a781c8e01c24ebb2b9da0a63a14e6fd9e0837 Author: Jason Gunthorpe Date: Thu Sep 22 16:20:20 2022 -0300 vfio: Rename __vfio_group_unset_container() To vfio_group_detach_container(). This function is really a container function. Fold the WARN_ON() into it as a precondition assertion. A following patch will move the vfio_container functions to their own .c file. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit e3bb4de0a0380910180e758a30ccfda65f8e286e Author: Jason Gunthorpe Date: Thu Sep 22 16:20:19 2022 -0300 vfio: Add header guards and includes to drivers/vfio/vfio.h As is normal for headers. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v3-297af71838d2+b9-vfio_container_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit aa3e49b606e0796aa766ded2fb7b8c2d36d7cf2f Author: Will Deacon Date: Thu Sep 22 22:11:10 2022 +0100 arm64: asm/perf_regs.h: Avoid C++-style comment in UAPI header An arm64 'allmodconfig' build fails with GCC due to use of a C++-style comment for the new SVE vector granule 'enum perf_event_arm_regs' entry: | /usr/include/asm/perf_regs.h:42:26: error: C++ style comments are not allowed in ISO C90 Use good ol' /* */ comment syntax to keep things rosey. Link: https://lore.kernel.org/r/632cceb2.170a0220.599ec.0a3a@mx.google.com Fixes: cbb0c02caf4b ("perf: arm64: Add SVE vector granule register to user regs") Signed-off-by: Will Deacon commit b780d1671cf933caa3f67160f73261f10750f1a9 Author: Yauheni Kaliuta Date: Tue Sep 20 19:14:09 2022 +0300 selftests/bpf: Add liburandom_read.so to TEST_GEN_FILES Added urandom_read shared lib is missing from the list of installed files what makes urandom_read test after `make install` or `make gen_tar` broken. Add the library to TEST_GEN_FILES. The names in the list do not contain $(OUTPUT) since it's added by lib.mk code. Fixes: 00a0fa2d7d49 ("selftests/bpf: Add urandom_read shared lib and USDTs") Signed-off-by: Yauheni Kaliuta Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220920161409.129953-1-ykaliuta@redhat.com commit 0140a7168f8b2732f622fa2c500f1f8be212382a Merge: f8b2cce430d92 504c25cb76a9c Author: Jakub Kicinski Date: Thu Sep 22 13:02:10 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/freescale/fec.h 7b15515fc1ca ("Revert "fec: Restart PPS after link state change"") 40c79ce13b03 ("net: fec: add stop mode support for imx8 platform") https://lore.kernel.org/all/20220921105337.62b41047@canb.auug.org.au/ drivers/pinctrl/pinctrl-ocelot.c c297561bc98a ("pinctrl: ocelot: Fix interrupt controller") 181f604b33cd ("pinctrl: ocelot: add ability to be used in a non-mmio configuration") https://lore.kernel.org/all/20220921110032.7cd28114@canb.auug.org.au/ tools/testing/selftests/drivers/net/bonding/Makefile bbb774d921e2 ("net: Add tests for bonding and team address list management") 152e8ec77640 ("selftests/bonding: add a test for bonding lladdr target") https://lore.kernel.org/all/20220921110437.5b7dbd82@canb.auug.org.au/ drivers/net/can/usb/gs_usb.c 5440428b3da6 ("can: gs_usb: gs_can_open(): fix race dev->can.state condition") 45dfa45f52e6 ("can: gs_usb: add RX and TX hardware timestamp support") https://lore.kernel.org/all/84f45a7d-92b6-4dc5-d7a1-072152fab6ff@tessares.net/ Signed-off-by: Jakub Kicinski commit 33060a64901e61f09ea6faffe367551df18a54c3 Author: Mark Brown Date: Wed Sep 7 12:33:59 2022 +0100 kselftest/arm64: Fix typo in hwcap check We use a local variable hwcap to refer to the element of the hwcaps array which we are currently checking. When checking for the relevant hwcap bit being set in testing we were dereferencing hwcaps rather than hwcap in fetching the AT_HWCAP to use, which is perfectly valid C but means we were always checking the bit was set in the hwcap for whichever feature is first in the array. Remove the stray s. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220907113400.12982-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 63f534b8bad91d46d2d1fbc76b97be521d9b5e03 Author: Rafael J. Wysocki Date: Sat Sep 10 15:23:46 2022 +0200 ACPI: PCI: Rework acpi_get_pci_dev() The PCI device returned by acpi_get_pci_dev() needs to be registered, so if it corresponds to an ACPI device object, the struct acpi_device representing that object must be registered too and, moreover, it should be the ACPI companion of the given PCI device. Thus it should be sufficient to look for it in the ACPI device object's list of physical nodes associated with it. Modify the code accordingly. Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman commit f8b2cce430d92ec927915ba4bc8088fe99659dbc Author: Horatiu Vultur Date: Wed Sep 21 08:54:44 2022 +0200 net: phy: micrel: Fix double spaces inside lan8814_config_intr Inside the function lan8814_config_intr, there are double spaces when assigning the return value of phy_write to err. Suggested-by: Jakub Kicinski Signed-off-by: Horatiu Vultur Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220921065444.637067-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 18729106c26fb97d4c9ae63ba7aba9889a058dc4 Author: Huisong Li Date: Tue Sep 20 17:45:00 2022 +0800 ACPI: PCC: Fix Tx acknowledge in the PCC address space handler Currently, mbox_client_txdone() is called from the PCC address space handler and that expects the user the Tx state machine to be controlled by the client which is not the case and the below warning is thrown: | PCCT: Client can't run the TX ticker Let the controller run the state machine and the end of Tx can be acknowledge by calling mbox_chan_txdone() instead. Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype") Signed-off-by: Huisong Li Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 91cefefb699120efd0a5ba345d12626b688f86ce Author: Huisong Li Date: Tue Sep 20 17:44:59 2022 +0800 ACPI: PCC: replace wait_for_completion() Currently, the function waiting for completion of mailbox operation is 'wait_for_completion()'. The PCC method will be permanently blocked if this mailbox message fails to execute. So this patch replaces it with 'wait_for_completion_timeout()'. And set the timeout interval to an arbitrary retries on top of nominal to prevent the remote processor is slow to respond to PCC commands. Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype") Signed-off-by: Huisong Li Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit f890157e61b85ce8ae01a41ffa375e3b99853698 Author: Rafael Mendonca Date: Fri Sep 9 12:33:19 2022 -0300 ACPI: PCC: Release resources on address space setup failure path The allocated memory for the pcc_data struct doesn't get freed under an error path in pcc_mbox_request_channel() or acpi_os_ioremap(). Also, the PCC mailbox channel doesn't get freed under an error path in acpi_os_ioremap(). Fixes: 77e2a04745ff8 ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype") Signed-off-by: Rafael Mendonca Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 562163595a912cfe99f9ed79a67ccd23a11a5cc3 Author: Liu Shixin Date: Fri Sep 9 17:56:24 2022 +0800 ACPI: HMAT: Drop unused dev_fmt() and redundant 'HMAT' prefix Remove unused macro dev_pmt() and redundant 'HMAT' prefix from pr_*() calls. Signed-off-by: Liu Shixin [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 39dd0cc2e5bd0d5188dd69f27e18783cea7ff06a Author: Arunpravin Paneer Selvam Date: Thu Sep 22 08:14:47 2022 -0700 drm/amdgpu: Fix VRAM eviction issue A user reported that when he starts a game (MTGA) with wine, he observed an error msg failed to pin framebuffer with error -12. Found an issue with the VRAM mem type eviction decision condition logic. This patch will fix the if condition code error. Gitlab bug link: https://gitlab.freedesktop.org/drm/amd/-/issues/2159 Fixes: ded910f368a5 ("drm/amdgpu: Implement intersect/compatible functions") Signed-off-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20220922151447.265696-1-Arunpravin.PaneerSelvam@amd.com Reviewed-by: Christian König Signed-off-by: Christian König commit 320305923c88258ce50c75bf721e9bf2e420ab27 Merge: 849b1f33437e2 cee3e5839cedc Author: Dave Airlie Date: Fri Sep 23 03:34:08 2022 +1000 Merge tag 'du-next-20220907' of git://linuxtv.org/pinchartl/media into drm-next - Misc fixes and improvements to the R-Car DU driver - Synopsys DW HDMI bridge DT bindings update Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/YxkL+tRI8uXDCvj9@pendragon.ideasonboard.com commit 973b9e37330656dec719ede508e4dc40e5c2d80c Author: Peter Collingbourne Date: Thu Sep 15 15:20:53 2022 -0700 arm64: mte: move register initialization to C If FEAT_MTE2 is disabled via the arm64.nomte command line argument on a CPU that claims to support FEAT_MTE2, the kernel will use Tagged Normal in the MAIR. If we interpret arm64.nomte to mean that the CPU does not in fact implement FEAT_MTE2, setting the system register like this may lead to UNSPECIFIED behavior. Fix it by arranging for MAIR to be set in the C function cpu_enable_mte which is called based on the sanitized version of the system register. There is no need for the rest of the MTE-related system register initialization to happen from assembly, with the exception of TCR_EL1, which must be set to include at least TBI1 because the secondary CPUs access KASan-allocated data structures early. Therefore, make the TCR_EL1 initialization unconditional and move the rest of the initialization to cpu_enable_mte so that we no longer have a dependency on the unsanitized ID register value. Co-developed-by: Evgenii Stepanov Signed-off-by: Peter Collingbourne Signed-off-by: Evgenii Stepanov Suggested-by: Catalin Marinas Reported-by: kernel test robot Fixes: 3b714d24ef17 ("arm64: mte: CPU feature detection and initial sysreg configuration") Cc: # 5.10.x Link: https://lore.kernel.org/r/20220915222053.3484231-1-eugenis@google.com Signed-off-by: Catalin Marinas commit 9e2e6042a7ec6504fe8e366717afa2f40cf16488 Author: Andrew Bresticker Date: Thu Sep 15 15:37:02 2022 -0400 riscv: Allow PROT_WRITE-only mmap() Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout PROT_READ with the justification that a write-only PTE is considered a reserved PTE permission bit pattern in the privileged spec. This check is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is inconsistent with other architectures that don't support write-only PTEs, creating a potential software portability issue. Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures. Note that this also allows PROT_WRITE|PROT_EXEC mappings which were disallowed prior to the aforementioned commit; PROT_READ is implied in such mappings as well. Fixes: 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") Reviewed-by: Atish Patra Signed-off-by: Andrew Bresticker Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220915193702.2201018-3-abrestic@rivosinc.com/ Signed-off-by: Palmer Dabbelt commit 7ab72c597356be1e7f0f3d856e54ce78527f43c8 Author: Andrew Bresticker Date: Thu Sep 15 15:37:01 2022 -0400 riscv: Make VM_WRITE imply VM_READ RISC-V does not presently have write-only mappings as that PTE bit pattern is considered reserved in the privileged spec, so allow handling of read faults in VMAs that have VM_WRITE without VM_READ in order to be consistent with other architectures that have similar limitations. Fixes: 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") Reviewed-by: Atish Patra Signed-off-by: Andrew Bresticker Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220915193702.2201018-2-abrestic@rivosinc.com/ Signed-off-by: Palmer Dabbelt commit ec7174f637d75abe5ada8482b9947898db231cd2 Author: Xiu Jianfeng Date: Thu Sep 22 19:19:24 2022 +0800 ipmi: Add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Message-Id: <20220922111924.36044-1-xiujianfeng@huawei.com> Signed-off-by: Corey Minyard commit 48dbe31a243d5fc7c07b7f03b48e95ec4696b118 Author: James Morse Date: Fri Sep 2 15:48:21 2022 +0000 x86/resctrl: Add per-rmid arch private storage for overflow and chunks A renamed __rmid_read() is intended as the function that an architecture agnostic resctrl filesystem driver can use to read a value in bytes from a counter. Currently the function returns the MBM values in chunks directly from hardware. For bandwidth counters the resctrl filesystem uses this to calculate the number of bytes ever seen. MPAM's scaling of counters can be changed at runtime, reducing the resolution but increasing the range. When this is changed the prev_msr values need to be converted by the architecture code. Add an array for per-rmid private storage. The prev_msr and chunks values will move here to allow resctrl_arch_rmid_read() to always return the number of bytes read by this counter without assistance from the filesystem. The values are moved in later patches when the overflow and correction calls are moved into __rmid_read(). Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-14-james.morse@arm.com commit 30442571ec81fb33f7bd8cea5a14afb10b8f442a Author: James Morse Date: Fri Sep 2 15:48:20 2022 +0000 x86/resctrl: Calculate bandwidth from the previous __mon_event_count() chunks mbm_bw_count() is only called by the mbm_handle_overflow() worker once a second. It reads the hardware register, calculates the bandwidth and updates m->prev_bw_msr which is used to hold the previous hardware register value. Operating directly on hardware register values makes it difficult to make this code architecture independent, so that it can be moved to /fs/, making the mba_sc feature something resctrl supports with no additional support from the architecture. Prior to calling mbm_bw_count(), mbm_update() reads from the same hardware register using __mon_event_count(). Change mbm_bw_count() to use the current chunks value most recently saved by __mon_event_count(). This removes an extra call to __rmid_read(). Instead of using m->prev_msr to calculate the number of chunks seen, use the rr->val that was updated by __mon_event_count(). This removes an extra call to mbm_overflow_count() and get_corrected_mbm_count(). Calculating bandwidth like this means mbm_bw_count() no longer operates on hardware register values directly. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-13-james.morse@arm.com commit ff6357bb50023af2a1dc8f113930082c5252c753 Author: James Morse Date: Fri Sep 2 15:48:19 2022 +0000 x86/resctrl: Allow update_mba_bw() to update controls directly update_mba_bw() calculates a new control value for the MBA resource based on the user provided mbps_val and the current measured bandwidth. Some control values need remapping by delay_bw_map(). It does this by calling wrmsrl() directly. This needs splitting up to be done by an architecture specific helper, so that the remainder can eventually be moved to /fs/. Add resctrl_arch_update_one() to apply one configuration value to the provided resource and domain. This avoids the staging and cross-calling that is only needed with changes made by user-space. delay_bw_map() moves to be part of the arch code, to maintain the 'percentage control' view of MBA resources in resctrl. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-12-james.morse@arm.com commit 1590ac2c6615329d30e25753e03c295cdaf2ae44 Author: Shyam Sundar S K Date: Thu Sep 22 18:42:02 2022 +0530 Documentation/ABI/testing/sysfs-amd-pmf: Add ABI doc for AMD PMF AMD PMF driver provides the flexibility to turn "on" or "off" CnQF feature (introduced in the earlier patch). Add corresponding ABI documentation for the new sysfs node and also update MAINTAINERS file with this new information Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220922131202.56529-4-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 3dae5825295d7b3284fc349cd6bfa641f4033e16 Author: Shyam Sundar S K Date: Thu Sep 22 18:42:01 2022 +0530 platform/x86/amd/pmf: Add sysfs to toggle CnQF Whether to turn CnQF on/off by default upon driver load would be decided by a BIOS flag. Add a sysfs node to provide a way to the user whether to use static slider or CnQF . Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220922131202.56529-3-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 1738061c9ec854db2db76be8bb968f550d9bdddc Author: Shyam Sundar S K Date: Thu Sep 22 18:42:00 2022 +0530 platform/x86/amd/pmf: Add support for CnQF CnQF (a.k.a Cool and Quiet Framework) extends the static slider concept. PMF dynamically manages system power limits and fan policy based on system power trends which is representative of workload trend. Static slider and CnQF controls are mutually exclusive for system power budget adjustments. CnQF supports configurable number of modes which can be unique for AC and DC. Every mode is representative of a system state characterized by unique steady state and boost behavior. OEMs can configure the different modes/system states and how the transition to a mode happens. Whether to have CnQF manage system power budget dynamically in AC or DC or both is also configurable. Mode changes due to CnQF don't result in slider position change. The default OEM values are obtained after evaluating the PMF ACPI function idx 11 & 12 for AC and DC respectively. Whether to turn ON/OFF by default is guided by a "flag" passed by the OEM BIOS. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220922131202.56529-2-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 9af48b262675561eefd6edc11b4b02854e6a18ae Author: Nathan Chancellor Date: Thu Sep 22 08:31:00 2022 -0700 platform/x86/amd: pmc: Fix build without debugfs Without CONFIG_DEBUG_FS, the following build error occurs: drivers/platform/x86/amd/pmc.c:984:17: error: use of undeclared identifier 'pmc_groups'; did you mean 'set_groups'? .dev_groups = pmc_groups, ^~~~~~~~~~ set_groups ./include/linux/cred.h:65:13: note: 'set_groups' declared here extern void set_groups(struct cred *, struct group_info *); ^ drivers/platform/x86/amd/pmc.c:984:17: error: incompatible pointer types initializing 'const struct attribute_group **' with an expression of type 'void (struct cred *, struct group_info *)' [-Werror,-Wincompatible-pointer-types] .dev_groups = pmc_groups, ^~~~~~~~~~ 2 errors generated. pmc_groups was only defined inside a CONFIG_DEBUG_FS block but commit 7f1ea75d499a ("platform/x86/amd: pmc: Add sysfs files for SMU") intended for these sysfs files to be available outside of debugfs. Shuffle the necessary functions out of the CONFIG_DEBUG_FS block so that the file always builds. Fixes: 7f1ea75d499a ("platform/x86/amd: pmc: Add sysfs files for SMU") Signed-off-by: Nathan Chancellor Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20220922153100.324922-1-nathan@kernel.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b58d4eb1f199f5a26d8c756d8e74a31c48b90428 Author: James Morse Date: Fri Sep 2 15:48:18 2022 +0000 x86/resctrl: Remove architecture copy of mbps_val The resctrl arch code provides a second configuration array mbps_val[] for the MBA software controller. Since resctrl switched over to allocating and freeing its own array when needed, nothing uses the arch code version. Remove it. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-11-james.morse@arm.com commit 6ce1560d35f63a458fead11ac865bc39cea9bc46 Author: James Morse Date: Fri Sep 2 15:48:17 2022 +0000 x86/resctrl: Switch over to the resctrl mbps_val list Updates to resctrl's software controller follow the same path as other configuration updates, but they don't modify the hardware state. rdtgroup_schemata_write() uses parse_line() and the resource's parse_ctrlval() function to stage the configuration. resctrl_arch_update_domains() then updates the mbps_val[] array instead, and resctrl_arch_update_domains() skips the rdt_ctrl_update() call that would update hardware. This complicates the interface between resctrl's filesystem parts and architecture specific code. It should be possible for mba_sc to be completely implemented by the filesystem parts of resctrl. This would allow it to work on a second architecture with no additional code. resctrl_arch_update_domains() using the mbps_val[] array prevents this. Change parse_bw() to write the configuration value directly to the mbps_val[] array in the domain structure. Change rdtgroup_schemata_write() to skip the call to resctrl_arch_update_domains(), meaning all the mba_sc specific code in resctrl_arch_update_domains() can be removed. On the read-side, show_doms() and update_mba_bw() are changed to read the mbps_val[] array from the domain structure. With this, resctrl_arch_get_config() no longer needs to consider mba_sc resources. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-10-james.morse@arm.com commit 91fd38ea7589fd8276720c20eadacd980be8bbe4 Author: Lukas Bulwahn Date: Thu Sep 22 12:00:01 2022 +0200 MAINTAINERS: merge SWIOTLB SUBSYSTEM into DMA MAPPING HELPERS Commit 78013eaadf69 ("x86: remove the IOMMU table infrastructure") refactored the generic swiotlb/swiotlb-xen setup into pci-dma.c, but misses to adjust MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about broken references. As only include/linux/swiotlb.h is unique to the SWIOTLB SUBSYSTEM section and Christoph is maintainer of DMA MAPPING HELPERS and SWIOTLB SUBSYSTEM, just merge those two sections. Leave the small architecture-dependent pieces to the arch maintainers. Further, update the XEN SWIOTLB SUBSYSTEM to include all swiotlb-xen headers and replace the pattern in drivers with the specific one file that matches this pattern. Signed-off-by: Lukas Bulwahn Acked-by: Juergen Gross Signed-off-by: Christoph Hellwig commit 739e49e0fc80990a351961c99a3142094822f040 Author: Kefeng Wang Date: Tue Sep 20 09:49:51 2022 +0800 arm64: mm: handle ARM64_KERNEL_USES_PMD_MAPS in vmemmap_populate() Directly check ARM64_SWAPPER_USES_SECTION_MAPS to choose base page or PMD level huge page mapping in vmemmap_populate() to simplify code a bit. Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20220920014951.196191-1-wangkefeng.wang@huawei.com Signed-off-by: Catalin Marinas commit 781096d971dfe3c5f9401a300bdb0b148a600584 Author: James Morse Date: Fri Sep 2 15:48:16 2022 +0000 x86/resctrl: Create mba_sc configuration in the rdt_domain To support resctrl's MBA software controller, the architecture must provide a second configuration array to hold the mbps_val[] from user-space. This complicates the interface between the architecture specific code and the filesystem portions of resctrl that will move to /fs/, to allow multiple architectures to support resctrl. Make the filesystem parts of resctrl create an array for the mba_sc values. The software controller can be changed to use this, allowing the architecture code to only consider the values configured in hardware. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-9-james.morse@arm.com commit 60240bc26114543fcbfcd8a28466e67e77b20388 Author: Jalal Mostafa Date: Wed Sep 21 13:57:01 2022 +0000 xsk: Inherit need_wakeup flag for shared sockets The flag for need_wakeup is not set for xsks with `XDP_SHARED_UMEM` flag and of different queue ids and/or devices. They should inherit the flag from the first socket buffer pool since no flags can be specified once `XDP_SHARED_UMEM` is specified. Fixes: b5aea28dca134 ("xsk: Add shared umem support between queue ids") Signed-off-by: Jalal Mostafa Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220921135701.10199-1-jalal.a.mostapha@gmail.com commit 62e5d00684ef81b4be35d23e54eec92ee38db7b8 Author: Christophe JAILLET Date: Sun Sep 18 08:27:33 2022 +0200 misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe() 'aux_bus' is freed in the remove function but not in the error handling path of the probe. Use devm_kzalloc() to simplify the remove function and fix the leak in the probe. Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/17e19926669a1654e5f2495bf3b289581183d02e.1663482259.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit c8b4747569eba7e5f4835e027d294486534ed0d3 Author: Christophe JAILLET Date: Sun Sep 18 08:27:24 2022 +0200 misc: microchip: pci1xxxx: Do not disable the pci device twice in gp_aux_bus_remove() gp_aux_bus_probe() uses pcim_enable_device(), so there is no point in calling pci_disable_device() explicitly in the remove function. Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/8a3a385b3ae15ee7497469ec3250302b626a018b.1663482259.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit dc2c96a39da197da137a797f22bb408b5865514d Author: Kumaravel Thiagarajan Date: Thu Sep 15 15:17:29 2022 +0530 misc: microchip: pci1xxxx: use DEFINE_SIMPLE_DEV_PM_OPS() in place of the SIMPLE_DEV_PM_OPS() in pci1xxxx's gpio driver build errors listed below and reported by Sudip Mukherjee for the builds of riscv, s390, csky, alpha and loongarch allmodconfig are fixed in this patch. drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:311:12: error: 'pci1xxxx_gpio_resume' defined but not used [-Werror=unused-function] 311 | static int pci1xxxx_gpio_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~ drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:295:12: error: 'pci1xxxx_gpio_suspend' defined but not used [-Werror=unused-function] 295 | static int pci1xxxx_gpio_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~ Fixes: 4ec7ac90ff39 ("misc: microchip: pci1xxxx: Add power management functions - suspend & resume handlers.") Reported-by: Sudip Mukherjee Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220915094729.646185-1-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 0e8bf26c777a7da6e085ff1f0e31640a042dae5c Author: Yihao Han Date: Mon Sep 12 20:02:57 2022 -0700 misc: microchip: pci1xxxx: Remove duplicate include Remove duplicate include in mchp_pci1xxxx_gpio.c Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.") Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220913030257.22352-1-hanyihao@vivo.com Signed-off-by: Greg Kroah-Hartman commit ea9d7c790a2a279810fd2a7db6908a136c97d466 Author: Xiu Jianfeng Date: Thu Sep 22 19:23:23 2022 +0800 pcmcia: Add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Signed-off-by: Dominik Brodowski commit adafbbf6895eb0ce41a313c6ee68870ab9aa93cd Author: Lukas Wunner Date: Sun Sep 11 11:02:03 2022 +0200 serial: stm32: Deassert Transmit Enable on ->rs485_config() The STM32 USART can control RS-485 Transmit Enable in hardware. Since commit 7df5081cbf5e ("serial: stm32: Add RS485 RTS GPIO control"), it can alternatively be controlled in software. That was done to allow RS-485 even if the RTS pin is unavailable because it's pinmuxed to a different function. However the commit neglected to deassert Transmit Enable upon invocation of the ->rs485_config() callback. Fix it. Avoid forward declarations by moving stm32_usart_tx_empty(), stm32_usart_rs485_rts_enable() and stm32_usart_rs485_rts_disable() further up in the driver. Fixes: 7df5081cbf5e ("serial: stm32: Add RS485 RTS GPIO control") Cc: stable@vger.kernel.org # v5.9+ Cc: Marek Vasut Reviewed-by: Ilpo Järvinen Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/6059eab35dba394468335ef640df8b0050fd9dbd.1662886616.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 3a939433ddc1bab98be028903aaa286e5e7461d7 Author: Lukas Wunner Date: Sun Sep 11 11:12:15 2022 +0200 serial: ar933x: Deassert Transmit Enable on ->rs485_config() The ar933x_uart driver neglects to deassert Transmit Enable when ->rs485_config() is invoked. Fix it. Fixes: 9be1064fe524 ("serial: ar933x_uart: add RS485 support") Cc: stable@vger.kernel.org # v5.7+ Cc: Daniel Golle Reviewed-by: Ilpo Järvinen Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/5b36af26e57553f084334666e7d24c7fd131a01e.1662887231.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit f47551bd6bfdd9971a5e99e64e12575980d4539f Merge: cca1fd41ab286 c0c725d7350ec Author: Greg Kroah-Hartman Date: Thu Sep 22 16:38:58 2022 +0200 Merge tag 'gnss-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss into char-misc-next Johan writes: "GNSS updates for 6.1-rc1 Here are the GNSS updates for 6.1-rc1, which includes a single IDA API cleanup. Everything has been in linux-next with no reported issues." * tag 'gnss-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss: gnss: replace ida_simple API commit f73db49650a1841b038fd20329e6bfbbdcad45ae Author: Sergiu Moga Date: Thu Sep 22 14:33:47 2022 +0300 tty: serial: atmel: Use FIELD_PREP/FIELD_GET Convert all open-coded instances of bitfields retrieval/setting to FIELD_PREP/FIELD_GET where possible. Signed-off-by: Sergiu Moga Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220922113347.144383-10-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 5e3ce1f261296bfe4bb59a98c82f4959d214a4f7 Author: Sergiu Moga Date: Thu Sep 22 14:33:46 2022 +0300 tty: serial: atmel: Make the driver aware of the existence of GCLK Previously, the atmel serial driver did not take into account the possibility of using the more customizable generic clock as its baudrate generator. Unless there is a Fractional Part available to increase accuracy, there is a high chance that we may be able to generate a baudrate closer to the desired one by using the GCLK as the clock source. Now, depending on the error rate between the desired baudrate and the actual baudrate, the serial driver will fallback on the generic clock. The generic clock must be provided in the DT node of the serial that may need a more flexible clock source. Furthermore, define the bit that represents the choice of having GCLK as a baudrate source clock inside the USCLKS bitmask of the Mode Register of USART IP's. Signed-off-by: Sergiu Moga Link: https://lore.kernel.org/r/20220922113347.144383-9-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 5644bf1843d915b6fb460fd44f4b9f9ac19a3fbb Author: Sergiu Moga Date: Thu Sep 22 14:33:45 2022 +0300 tty: serial: atmel: Only divide Clock Divisor if the IP is USART Make sure that the driver only divides the clock divisor if the IP handled at that point is USART, since UART IP's do not support implicit peripheral clock division. Instead, in the case of UART, go with the highest possible clock divisor. Signed-off-by: Sergiu Moga Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220922113347.144383-8-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1a5a01a1e31e6cc3b83a2c843adba743c2f474b9 Author: Sergiu Moga Date: Thu Sep 22 14:33:44 2022 +0300 tty: serial: atmel: Separate mode clearing between UART and USART When clearing the mode of the serial IP inside the atmel_set_termios() method, make sure that the difference between the bitfields placement of the UART IP's and USART IP's is taken into account, as some of them overlap with each other. For example, ATMEL_UA_BRSRCCK overlaps with ATMEL_US_NBSTOP and ATMEL_US_USCLKS overlaps with ATMEL_UA_FILTER. Furthermore, add definitions for the Baud Rate Source Clock and the Filter bitfields of the Mode Register of UART IP's, since they were missing. Signed-off-by: Sergiu Moga Link: https://lore.kernel.org/r/20220922113347.144383-7-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 79cb50350069e080e14ea9e3fff31b31f877261d Author: Sergiu Moga Date: Thu Sep 22 14:33:43 2022 +0300 dt-bindings: serial: atmel,at91-usart: Add gclk as a possible USART clock The Devicetree nodes for FLEXCOM's USART can also have an alternative clock source for the baudrate generator (other than the peripheral clock), namely the Generick Clock. Thus make the binding aware of this clock that someone may place in the clock related properties of the USART node. Signed-off-by: Sergiu Moga Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220922113347.144383-6-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 9e1618008064e80dbd2f8aca80a0a3b17b103e70 Author: Sergiu Moga Date: Thu Sep 22 14:33:41 2022 +0300 dt-bindings: serial: atmel,at91-usart: Add SAM9260 compatibles to SAM9X60 Require SAM9260 fallback compatible for SAM9X60, because SAM9X60 is fully compatible with SAM9260 and Linux driver requires the latter. Signed-off-by: Sergiu Moga Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220922113347.144383-4-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit b9e947fbf008769ffda1028f627d604757e62265 Author: Sergiu Moga Date: Thu Sep 22 14:33:40 2022 +0300 dt-bindings: serial: atmel,at91-usart: convert to json-schema Convert at91 USART DT Binding for Atmel/Microchip SoCs to json-schema format. Furthermore, move this binding to the serial directory, since binding directories match hardware, unlike the driver subsystems which match Linux convention. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220922113347.144383-3-sergiu.moga@microchip.com Signed-off-by: Greg Kroah-Hartman commit 316ae95c175a7d770d1bfe4c011192712f57aa4a Author: Sherry Sun Date: Tue Sep 20 19:17:03 2022 +0800 tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown lpuart_dma_shutdown tears down lpuart dma, but lpuart_flush_buffer can still occur which in turn tries to access dma apis if lpuart_dma_tx_use flag is true. At this point since dma is torn down, these dma apis can abort. Set lpuart_dma_tx_use and the corresponding rx flag lpuart_dma_rx_use to false in lpuart_dma_shutdown so that dmas are not accessed after they are relinquished. Otherwise, when try to kill btattach, kernel may panic. This patch may fix this issue. root@imx8ulpevk:~# btattach -B /dev/ttyLP2 -S 115200 ^C[ 90.182296] Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP [ 90.189806] Modules linked in: moal(O) mlan(O) [ 90.194258] CPU: 0 PID: 503 Comm: btattach Tainted: G O 5.15.32-06136-g34eecdf2f9e4 #37 [ 90.203554] Hardware name: NXP i.MX8ULP 9X9 EVK (DT) [ 90.208513] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 90.215470] pc : fsl_edma3_disable_request+0x8/0x60 [ 90.220358] lr : fsl_edma3_terminate_all+0x34/0x20c [ 90.225237] sp : ffff800013f0bac0 [ 90.228548] x29: ffff800013f0bac0 x28: 0000000000000001 x27: ffff000008404800 [ 90.235681] x26: ffff000008404960 x25: ffff000008404a08 x24: ffff000008404a00 [ 90.242813] x23: ffff000008404a60 x22: 0000000000000002 x21: 0000000000000000 [ 90.249946] x20: ffff800013f0baf8 x19: ffff00000559c800 x18: 0000000000000000 [ 90.257078] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 90.264211] x14: 0000000000000003 x13: 0000000000000000 x12: 0000000000000040 [ 90.271344] x11: ffff00000600c248 x10: ffff800013f0bb10 x9 : ffff000057bcb090 [ 90.278477] x8 : fffffc0000241a08 x7 : ffff00000534ee00 x6 : ffff000008404804 [ 90.285609] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff0000055b3480 [ 90.292742] x2 : ffff8000135c0000 x1 : ffff00000534ee00 x0 : ffff00000559c800 [ 90.299876] Call trace: [ 90.302321] fsl_edma3_disable_request+0x8/0x60 [ 90.306851] lpuart_flush_buffer+0x40/0x160 [ 90.311037] uart_flush_buffer+0x88/0x120 [ 90.315050] tty_driver_flush_buffer+0x20/0x30 [ 90.319496] hci_uart_flush+0x44/0x90 [ 90.323162] +0x34/0x12c [ 90.327253] tty_ldisc_close+0x38/0x70 [ 90.331005] tty_ldisc_release+0xa8/0x190 [ 90.335018] tty_release_struct+0x24/0x8c [ 90.339022] tty_release+0x3ec/0x4c0 [ 90.342593] __fput+0x70/0x234 [ 90.345652] ____fput+0x14/0x20 [ 90.348790] task_work_run+0x84/0x17c [ 90.352455] do_exit+0x310/0x96c [ 90.355688] do_group_exit+0x3c/0xa0 [ 90.359259] __arm64_sys_exit_group+0x1c/0x20 [ 90.363609] invoke_syscall+0x48/0x114 [ 90.367362] el0_svc_common.constprop.0+0xd4/0xfc [ 90.372068] do_el0_svc+0x2c/0x94 [ 90.375379] el0_svc+0x28/0x80 [ 90.378438] el0t_64_sync_handler+0xa8/0x130 [ 90.382711] el0t_64_sync+0x1a0/0x1a4 [ 90.386376] Code: 17ffffda d503201f d503233f f9409802 (b9400041) [ 90.392467] ---[ end trace 2f60524b4a43f1f6 ]--- [ 90.397073] note: btattach[503] exited with preempt_count 1 [ 90.402636] Fixing recursive fault but reboot is needed! Fixes: 6250cc30c4c4 ("tty: serial: fsl_lpuart: Use scatter/gather DMA for Tx") Reviewed-by: Ilpo Järvinen Signed-off-by: Thara Gopinath Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220920111703.1532-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 039d4926379b1d1c17b51cf21c500a5eed86899e Author: Ilpo Järvinen Date: Thu Sep 22 10:00:05 2022 +0300 serial: 8250: Toggle IER bits on only after irq has been set up Invoking TIOCVHANGUP on 8250_mid port on Ice Lake-D and then reopening the port triggers these faults during serial8250_do_startup(): DMAR: DRHD: handling fault status reg 3 DMAR: [DMA Write NO_PASID] Request device [00:1a.0] fault addr 0x0 [fault reason 0x05] PTE Write access is not set If the IRQ hasn't been set up yet, the UART will have zeroes in its MSI address/data registers. Disabling the IRQ at the interrupt controller won't stop the UART from performing a DMA write to the address programmed in its MSI address register (zero) when it wants to signal an interrupt. The UARTs (in Ice Lake-D) implement PCI 2.1 style MSI without masking capability, so there is no way to mask the interrupt at the source PCI function level, except disabling the MSI capability entirely, but that would cause it to fall back to INTx# assertion, and the PCI specification prohibits disabling the MSI capability as a way to mask a function's interrupt service request. The MSI address register is zeroed by the hangup as the irq is freed. The interrupt is signalled during serial8250_do_startup() performing a THRE test that temporarily toggles THRI in IER. The THRE test currently occurs before UART's irq (and MSI address) is properly set up. Refactor serial8250_do_startup() such that irq is set up before the THRE test. The current irq setup code is intermixed with the timer setup code. As THRE test must be performed prior to the timer setup, extract it into own function and call it only after the THRE test. The ->setup_timer() needs to be part of the struct uart_8250_ops in order to not create circular dependency between 8250 and 8250_base modules. Fixes: 40b36daad0ac ("[PATCH] 8250 UART backup timer") Reported-by: Lennert Buytenhek Tested-by: Lennert Buytenhek Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220922070005.2965-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 46a8973c4d9d7b12e0e4dd9f589d08d420fb6c0d Author: Maciej W. Rozycki Date: Wed Sep 21 00:35:42 2022 +0100 serial: 8250: Switch UART port flags to using BIT_ULL Use BIT_ULL rather than encoding bits explicitly where applicable with UART port flags. This makes a (__force upf_t) cast redundant, but keep it for visual consistency with the flags defined in terms of userspace macros. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209210007030.41633@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 00b7a4d4ee42be1c515e56cb1e8ba0f25e271d8e Author: Maciej W. Rozycki Date: Wed Sep 21 00:35:37 2022 +0100 serial: 8250: Request full 16550A feature probing for OxSemi PCIe devices Oxford Semiconductor PCIe (Tornado) 950 serial port devices need to operate in the enhanced mode via the EFR register for the Divide-by-M N/8 baud rate generator prescaler to be used in their native UART mode. Otherwise the prescaler is fixed at 1 causing grossly incorrect baud rates to be programmed. Accessing the EFR register requires 16550A features to have been probed for, so request this to happen regardless of SERIAL_8250_16550A_VARIANTS by setting UPF_FULL_PROBE in port flags. Fixes: 366f6c955d4d ("serial: 8250: Add proper clock handling for OxSemi PCIe devices") Cc: stable@vger.kernel.org # v5.19+ Reported-by: Anders Blomdell Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209210005040.41633@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 9906890c89e4dbd900ed87ad3040080339a7f411 Author: Maciej W. Rozycki Date: Wed Sep 21 00:35:32 2022 +0100 serial: 8250: Let drivers request full 16550A feature probing A SERIAL_8250_16550A_VARIANTS configuration option has been recently defined that lets one request the 8250 driver not to probe for 16550A device features so as to reduce the driver's device startup time in virtual machines. Some actual hardware devices require these features to have been fully determined however for their driver to work correctly, so define a flag to let drivers request full 16550A feature probing on a device-by-device basis if required regardless of the SERIAL_8250_16550A_VARIANTS option setting chosen. Fixes: dc56ecb81a0a ("serial: 8250: Support disabling mdelay-filled probes of 16550A variants") Cc: stable@vger.kernel.org # v5.6+ Reported-by: Anders Blomdell Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209202357520.41633@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 105e2fdb250a00e9b9ea1e6283d973397e927bce Author: ruanjinjie Date: Wed Sep 14 11:00:45 2022 +0800 pcmcia: at91_cf: make mc static The symbol is not used outside of the file, so mark it static. Fixes the following warning: ./drivers/pcmcia/at91_cf.c:49:15: warning: symbol 'mc' was not declared. Should it be static? Signed-off-by: ruanjinjie Signed-off-by: Dominik Brodowski commit ae19e152849514fe15dfdcd1d3a37bdd5e4bdbb4 Author: Thomas Bogendoerfer Date: Fri Jul 15 15:54:31 2022 +0200 pcmcia: remove VR41XX PCMCIA driver Commit d3164e2f3b0a ("MIPS: Remove VR41xx support") removed support for MIPS VR41xx platform, so remove exclusive drivers for this platform, too. Signed-off-by: Thomas Bogendoerfer Signed-off-by: Dominik Brodowski commit 09b2c10d62ce63bc3ecaf0748d85bfd9f2bae6bb Author: Uwe Kleine-König Date: Thu Jul 14 23:45:34 2022 +0200 pcmcia: sa1100: Make sa11x0_drv_pcmcia_legacy_remove() return void sa11x0_drv_pcmcia_legacy_remove() returns zero unconditionally. Letting it return void instead makes it easier to see in the caller that there is no error to handle. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Dominik Brodowski commit 2b9977470b39e011ee5fbc01ca55411a7768fb9d Author: Alexandru Tachici Date: Thu Sep 22 09:30:49 2022 +0300 net: ethernet: adi: Fix invalid parent name length MII_BUS_ID_SIZE is larger than MAX_PHYS_ITEM_ID_LEN so we use the former here to set the parent port id. Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220922063049.10388-1-alexandru.tachici@analog.com Signed-off-by: Jakub Kicinski commit 7ef26ab6feea3459d96dff9e4f98bf8a20bfb809 Author: Jiri Slaby Date: Tue Sep 20 07:20:47 2022 +0200 tty: serial: extract serial_omap_put_char() from transmit_chars() This non-trivial code is doubled in transmit_chars(), so it deserves its own function. This will make next patches easier. Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8ca01f8f70d1e54cf033945ac3539f52b7334c34 Author: Jiri Slaby Date: Tue Sep 20 07:20:46 2022 +0200 tty: serial: switch mpc52xx_uart_int_{r,t}x_chars() to bool mpc52xx_uart_int_rx_chars() returns unsigned int. mpc52xx_uart_int_tx_chars() returns int. The both results are binary ORed to the "keepgoing" variable. Unify all three to bool as the only interesting value is whether we should keep looping (true/false). Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 2a4be3a55cd2970aa8c45f6cd1cd9dce09061093 Author: Jiri Slaby Date: Tue Sep 20 07:20:45 2022 +0200 tty: serial: extract tx_ready() from __serial_lpc32xx_tx() The condition in __serial_lpc32xx_tx()'s loop is barely readable. Extract it to a separate function. This will make the cleanup in the next patches easier too. Cc: Vladimir Zapolskiy Cc: Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0fbf36bb6a072a537478f4e1071eb13c451a16e2 Author: Jiri Slaby Date: Tue Sep 20 07:20:44 2022 +0200 tty: serial: extract lqasc_tx_ready() from lqasc_tx_chars() The condition in lqasc_tx_chars()'s loop is barely readable. Extract it to a separate function. This will make the cleanup in the next patches easier too. (Put it before lqasc_start_tx(), so that we can use it there later.) Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 3af44d9bb0539d5fa27d6159d696fda5f3747bff Author: Jiri Slaby Date: Tue Sep 20 07:20:43 2022 +0200 tty: serial: altera_uart_{r,t}x_chars() need only uart_port Both altera_uart_{r,t}x_chars() need only uart_port, not altera_uart. So pass the former from altera_uart_interrupt() directly. Apart it maybe saves a dereference, this makes the transition of altera_uart_tx_chars() easier to follow in the next patch. Cc: Tobias Klauser Reviewed-by: Ilpo Järvinen Acked-by: Tobias Klauser Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d9c128117da41cf4cb0e80ae565b5d3ac79dffac Author: Jiri Slaby Date: Tue Sep 20 07:20:42 2022 +0200 tty: serial: clean up stop-tx part in altera_uart_tx_chars() The "stop TX" path in altera_uart_tx_chars() is open-coded, so: * use uart_circ_empty() to check if the buffer is empty, and * when true, call altera_uart_stop_tx(). Cc: Tobias Klauser Reviewed-by: Ilpo Järvinen Acked-by: Tobias Klauser Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0c0bfc6b14388356ce6016b9d548ac8b874013e0 Author: Jiri Slaby Date: Tue Sep 20 07:20:41 2022 +0200 tty: serial: move and cleanup vt8500_tx_empty() Make vt8500_tx_empty() more readable by introducing a new local variable and move the function before handle_tx(). That way we can reuse it in there too. Cc: Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit eef7381d8134f249dc17138bb1794c249aff7f5a Author: наб Date: Fri Sep 16 03:55:18 2022 +0200 tty: hvc: remove HVC_IUCV_MAGIC According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches" This stretches that definition slightly, since it multiplexes it with the terminal number as a constant offset, but is equivalent Acked-by: Jiri Slaby Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Link: https://lore.kernel.org/r/8c8a2c9dfc1bfbe6ef3f3237368e483865fc1c29.1663288066.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 0e6357c3b61d6597fc799d05699cdd3cc07c08bd Author: наб Date: Fri Sep 16 03:55:14 2022 +0200 tty: synclink_gt: remove MGSL_MAGIC According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches" Acked-by: Jiri Slaby Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Link: https://lore.kernel.org/r/3d82b3c864970cdec6717c56dd906b54e78694d7.1663288066.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 14f9ed6153705016f584e0f6644a2386739dd1e3 Author: наб Date: Fri Sep 16 03:55:09 2022 +0200 tty: n_hdlc: remove HDLC_MAGIC According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches" Acked-by: Jiri Slaby Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Link: https://lore.kernel.org/r/c31d228302da3f426cebf6fcff855181a5590a66.1663288066.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 5052df99d3bc3cd281222bbcba44323b2d0937d2 Author: наб Date: Fri Sep 16 03:55:05 2022 +0200 tty: remove TTY_DRIVER_MAGIC According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches" Acked-by: Jiri Slaby Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Link: https://lore.kernel.org/r/723478a270a3858f27843cbec621df4d5d44efcc.1663288066.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 7a4e0d2c7fb8e28bb8ce0687925c9cf91d65f2a0 Author: наб Date: Fri Sep 16 03:54:59 2022 +0200 tty: remove TTY_MAGIC According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches" Acked-by: Jiri Slaby Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Link: https://lore.kernel.org/r/476d024cd6b04160a5de381ea2b9856b60088cbd.1663288066.git.nabijaczleweli@nabijaczleweli.xyz Signed-off-by: Greg Kroah-Hartman commit 1d5859ef229e381f4db38dce8ed58e4bf862006b Author: Dan Carpenter Date: Thu Sep 22 14:22:47 2022 +0300 drivers: serial: jsm: fix some leaks in probe This error path needs to unwind instead of just returning directly. Fixes: 03a8482c17dd ("drivers: serial: jsm: Enable support for Digi Classic adapters") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YyxFh1+lOeZ9WfKO@kili Signed-off-by: Greg Kroah-Hartman commit 007b20e9ec8d8f5f57cf48b3d129616cf4c0c102 Author: Johan Jonker Date: Sat Sep 10 00:01:28 2022 +0200 dt-bindings: serial: rockchip: add rockchip,rk3128-uart Add rockchip,rk3128-uart compatible string. Signed-off-by: Johan Jonker Acked-by: Jamie Iles Acked-by: Rob Herring Link: https://lore.kernel.org/r/4f283231-2ed4-202b-0c23-157bce0841ee@gmail.com Signed-off-by: Greg Kroah-Hartman commit e2752ae3cfc9a486c5af38b302615705992c3a78 Author: Lukas Wunner Date: Sun Sep 11 11:24:24 2022 +0200 serial: omap: Disallow RS-485 if rts-gpio is not specified The serial-omap driver requires an rts-gpio for RS-485 to work. Historically it has allowed enabling RS-485 even if no rts-gpio was specified in the device tree. That doesn't make any sense, so disable RS-485 on probe if rts-gpio is missing and disallow user space from enabling it. Three NULL pointer checks for up->rts_gpiod can be dropped as a result, simplifying the driver slightly. Cc: Linus Walleij Reviewed-by: Ilpo Järvinen Acked-by: Linus Walleij Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/f191dcca0d8ea03598c463fc0d3fba8941ff2275.1662888075.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit ed9f4bb39624af6461774812888847a7d3f7f8b1 Author: Gaosheng Cui Date: Sun Sep 11 17:36:54 2022 +0800 tty: serial: cpm_uart: remove unused cpm_uart_nr declaration cpm_uart_nr has been removed since commit 0b2a2e5b7747 ("cpm_uart: Remove !CONFIG_PPC_CPM_NEW_BINDING code"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220911093654.3222701-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman commit b045c215866393419fb960432ed6be69a0113ee1 Author: James Morse Date: Fri Sep 2 15:48:15 2022 +0000 x86/resctrl: Abstract and use supports_mba_mbps() To determine whether the mba_MBps option to resctrl should be supported, resctrl tests the boot CPUs' x86_vendor. This isn't portable, and needs abstracting behind a helper so this check can be part of the filesystem code that moves to /fs/. Re-use the tests set_mba_sc() does to determine if the mba_sc is supported on this system. An 'alloc_capable' test is added so that support for the controls isn't implied by the 'delay_linear' property, which is always true for MPAM. Because mbm_update() only update mba_sc if the mbm_local counters are enabled, supports_mba_mbps() checks is_mbm_local_enabled(). (instead of using is_mbm_enabled(), which checks both). Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-8-james.morse@arm.com commit c44094eee32f32f175aadc0efcac449d99b1bbf7 Author: Will Deacon Date: Tue Aug 23 13:21:11 2022 +0100 arm64: dma: Drop cache invalidation from arch_dma_prep_coherent() arch_dma_prep_coherent() is called when preparing a non-cacheable region for a consistent DMA buffer allocation. Since the buffer pages may previously have been written via a cacheable mapping and consequently allocated as dirty cachelines, the purpose of this function is to remove these dirty lines from the cache, writing them back so that the non-coherent device is able to see them. On arm64, this operation can be achieved with a clean to the point of coherency; a subsequent invalidation is not required and serves little purpose in the presence of a cacheable alias (e.g. the linear map), since clean lines can be speculatively fetched back into the cache after the invalidation operation has completed. Relax the cache maintenance in arch_dma_prep_coherent() so that only a clean, and not a clean-and-invalidate operation is performed. Cc: Mark Rutland Cc: Robin Murphy Cc: Christoph Hellwig Cc: Ard Biesheuvel Signed-off-by: Will Deacon Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220823122111.17439-1-will@kernel.org Signed-off-by: Catalin Marinas commit 1644dfe727cb042ef7f2e773015747954fd0e746 Author: James Morse Date: Fri Sep 2 15:48:14 2022 +0000 x86/resctrl: Remove set_mba_sc()s control array re-initialisation set_mba_sc() enables the 'software controller' to regulate the bandwidth based on the byte counters. This can be managed entirely in the parts of resctrl that move to /fs/, without any extra support from the architecture specific code. set_mba_sc() is called by rdt_enable_ctx() during mount and unmount. It currently resets the arch code's ctrl_val[] and mbps_val[] arrays. The ctrl_val[] was already reset when the domain was created, and by reset_all_ctrls() when the filesystem was last unmounted. Doing the work in set_mba_sc() is not necessary as the values are already at their defaults due to the creation of the domain, or were previously reset during umount(), or are about to reset during umount(). Add a reset of the mbps_val[] in reset_all_ctrls(), allowing the code in set_mba_sc() that reaches in to the architecture specific structures to be removed. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-7-james.morse@arm.com commit 1f2906d1e10ac8b63f06c10b0db4282b8b38c509 Author: James Clark Date: Thu Sep 1 14:26:58 2022 +0100 arm64/sve: Add Perf extensions documentation Document that the VG register is available in Perf samples Signed-off-by: James Clark Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220901132658.1024635-3-james.clark@arm.com Signed-off-by: Will Deacon commit cbb0c02caf4bd98b9e0cd6d7420734b8e9a35703 Author: James Clark Date: Thu Sep 1 14:26:57 2022 +0100 perf: arm64: Add SVE vector granule register to user regs Dwarf based unwinding in a function that pushes SVE registers onto the stack requires the unwinder to know the length of the SVE register to calculate the stack offsets correctly. This was added to the Arm specific Dwarf spec as the VG pseudo register[1]. Add the vector length at position 46 if it's requested by userspace and SVE is supported. If it's not supported then fail to open the event. The vector length must be on each sample because it can be changed at runtime via a prctl or ptrace call. Also by adding it as a register rather than a separate attribute, minimal changes will be required in an unwinder that already indexes into the register list. [1]: https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst Reviewed-by: Mark Brown Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220901132658.1024635-2-james.clark@arm.com Signed-off-by: Will Deacon commit c22d054f1ed6b3e990436c2dde7d3b7d6a170cff Author: Daniel Starke Date: Wed Aug 31 09:38:00 2022 +0200 tty: n_gsm: add debug bit for user payload A debug bit to output a complete transmission dump exists. Sometimes only the user frames are relevant. Add an additional bit which limits the transmission dump output to user data frames if set. Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-6-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit c07da737af4dd9a29508ae2863fa2afdec130088 Author: Daniel Starke Date: Wed Aug 31 09:37:59 2022 +0200 tty: n_gsm: name the debug bits Introduce defines to name the various debug bits used within the code to improve readability and to make its specific use clear. Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-5-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit de640bc6b8b1401792aa0ac99b6512411f18a87d Author: Daniel Starke Date: Wed Aug 31 09:37:58 2022 +0200 tty: n_gsm: introduce gsm_control_command() function Move the content of gsm_control_transmit() to a new function gsm_control_command() with a more generic signature and analog to gsm_control_reply(). Use this within gsm_control_transmit(). This is needed to simplify upcoming functional additions. Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-4-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 669609cea1d294f43efdd8d57ab65927df90e6df Author: Daniel Starke Date: Wed Aug 31 09:37:57 2022 +0200 tty: n_gsm: replace use of gsm_read_ea() with gsm_read_ea_val() Replace the use of gsm_read_ea() with gsm_read_ea_val() where applicable to improve code readability and avoid errors like in the past. See first link below for reference. Link: https://lore.kernel.org/all/20220504081733.3494-1-daniel.starke@siemens.com/ Link: https://lore.kernel.org/all/202208222147.WfFRmf1r-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 796492de01246f2c39841c7aede375cb394eacbe Author: Daniel Starke Date: Wed Aug 31 09:37:56 2022 +0200 tty: n_gsm: name gsm tty device minors Add a macro which defines the possible number of virtual devices for n_gsm to improve code readability. Reviewed-by: Jiri Slaby Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 19fb0a664f6448fe7d6a8105d25f308a28ba499d Author: Daniel Starke Date: Wed Aug 31 09:37:55 2022 +0200 tty: n_gsm: add enumeration for gsm encodings Add an enumeration for the gsm mux encoding types to improve code readability and to avoid invalid values. Only two values are defined by the standard: - basic option mode - advanced option mode (uses ISO HDLC standard transparency mechanism) Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220831073800.7459-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 401199ffa9b69baf3fd1f9ad082aa65c10910585 Author: Daniel Houldsworth Date: Thu Sep 22 12:54:59 2022 +0100 platform/x86: hp-wmi: Support touchpad on/off Add scancodes reported by the touchpad on/off button. The actual disabling and enabling is done in hardware, and this just reports that change to userspace. Signed-off-by: Daniel Houldsworth Link: https://lore.kernel.org/r/20220922115459.6511-1-dhould3@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bb95d5c540a4101024fc36512d65b2cf2663bbdb Author: Uwe Kleine-König Date: Tue Sep 20 09:01:01 2022 +0200 platform/x86: int3472/discrete: Drop a forward declaration By swapping the definition of skl_int3472_discrete_remove() and skl_int3472_discrete_probe() the forward declaration of the former can be dropped. This is a good thing as it removes code duplication. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Scally Link: https://lore.kernel.org/r/20220920070101.907596-1-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5890032523780ddbf508d4b86ddd738bff43a70c Author: Yang Yingliang Date: Tue Sep 20 16:44:34 2022 +0800 platform/x86: toshiba_acpi: change turn_on_panel_on_resume to static turn_on_panel_on_resume is only used in toshiba_acpi.c now, change it to static. Fixes: 3cb1f40dfdc3 ("drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220920084434.3739493-1-yangyingliang@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ad5dbfc123e6ffbbde194e2a4603323e09f741ee Author: sunghwan jung Date: Tue Sep 13 20:49:13 2022 +0900 Revert "usb: storage: Add quirk for Samsung Fit flash" This reverts commit 86d92f5465958752481269348d474414dccb1552, which fix the timeout issue for "Samsung Fit Flash". But the commit affects not only "Samsung Fit Flash" but also other usb storages that use the same controller and causes severe performance regression. # hdparm -t /dev/sda (without the quirk) Timing buffered disk reads: 622 MB in 3.01 seconds = 206.66 MB/sec # hdparm -t /dev/sda (with the quirk) Timing buffered disk reads: 220 MB in 3.00 seconds = 73.32 MB/sec The commit author mentioned that "Issue was reproduced after device has bad block", so this quirk should be applied when we have the timeout issue with a device that has bad blocks. We revert the commit so that we apply this quirk by adding kernel paramters using a bootloader or other ways when we really need it, without the performance regression with devices that don't have the issue. Signed-off-by: sunghwan jung Link: https://lore.kernel.org/r/20220913114913.3073-1-onenowy@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2a735e4b5580a2a6bbd6572109b4c4f163c57462 Author: Dan Carpenter Date: Thu Sep 22 14:22:08 2022 +0300 usb: dwc3: core: fix some leaks in probe The dwc3_get_properties() function calls: dwc->usb_psy = power_supply_get_by_name(usb_psy_name); so there is some additional clean up required on these error paths. Fixes: 6f0764b5adea ("usb: dwc3: add a power supply for current control") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YyxFYFnP53j9sCg+@kili Signed-off-by: Greg Kroah-Hartman commit 63d7f9810a38102cdb8cad214fac98682081e1a7 Author: Piyush Mehta Date: Tue Sep 20 10:52:35 2022 +0530 usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug When configured in HOST mode, after issuing U3/L2 exit controller fails to send proper CRC checksum in CRC5 field. Because of this behavior Transaction Error is generated, resulting in reset and re-enumeration of usb device attached. Enabling chicken bit 10 of GUCTL1 will correct this problem. When this bit is set to '1', the UTMI/ULPI opmode will be changed to "normal" along with HS terminations, term, and xcvr signals after EOR. This option is to support certain legacy UTMI/ULPI PHYs. Added "snps,resume-hs-terminations" quirk to resolved the above issue. Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220920052235.194272-3-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit 031cba1695d4d3767ba47718077e83f2b5aac944 Author: Piyush Mehta Date: Tue Sep 20 10:52:34 2022 +0530 dt-bindings: usb: snps,dwc3: Add 'snps,resume-hs-terminations' quirk Add a new 'snps,resume-hs-terminations' DT quirk to dwc3 core to resolved issue of CRC failed error. On the resume path, U3/U2 exit controller fails to send proper CRC checksum in CRC5 field. As result Transaction Error is generated. Enabling bit 10 of GUCTL1 will correct this problem. When this bit is set to '1', the UTMI/ULPI opmode will be changed to "normal" along with HS terminations and term/xcvr select signals after EOR. This option is to support certain legacy UTMI/ULPI PHYs. Acked-by: Krzysztof Kozlowski Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220920052235.194272-2-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit fc4ade55c617dc73c7e9756b57f3230b4ff24540 Author: Hannu Hartikainen Date: Mon Sep 19 20:16:10 2022 +0300 USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM NVIDIA Jetson devices in Force Recovery mode (RCM) do not support suspending, ie. flashing fails if the device has been suspended. The devices are still visible in lsusb and seem to work otherwise, making the issue hard to debug. This has been discovered in various forum posts, eg. [1]. The patch has been tested on NVIDIA Jetson AGX Xavier, but I'm adding all the Jetson models listed in [2] on the assumption that they all behave similarly. [1]: https://forums.developer.nvidia.com/t/flashing-not-working/72365 [2]: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3271/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/quick_start.html Signed-off-by: Hannu Hartikainen Cc: stable # after 6.1-rc3 Link: https://lore.kernel.org/r/20220919171610.30484-1-hannu@hrtk.in Signed-off-by: Greg Kroah-Hartman commit 5c3d5ecf48ab06c709c012bf1e8f0c91e1fcd7ad Author: Alexander Stein Date: Thu Sep 15 08:28:54 2022 +0200 arm64: dts: imx8mp: Add snps,gfladj-refclk-lpm-sel quirk to USB nodes With this set the SOF/ITP counter is based on ref_clk when 2.0 ports are suspended. snps,dis-u2-freeclk-exists-quirk can be removed as snps,gfladj-refclk-lpm-sel also clears the free running clock configuration bit. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220915062855.751881-4-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit a6fc2f1b092787e9d7dbe472d720cede81680315 Author: Alexander Stein Date: Thu Sep 15 08:28:53 2022 +0200 usb: dwc3: core: add gfladj_refclk_lpm_sel quirk This selects the SOF/ITP counter be running on ref_clk. As documented U2_FREECLK_EXISTS has to be set to 0 as well. Reviewed-by: Li Jun Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220915062855.751881-3-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit 206732f9a5d8bbae5a2b7f64a469f0a54e626e91 Author: Alexander Stein Date: Thu Sep 15 08:28:52 2022 +0200 dt-bindings: usb: dwc3: Add gfladj-refclk-lpm-sel-quirk This selects SOF/ITP to be running on ref_clk. Acked-by: Krzysztof Kozlowski Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220915062855.751881-2-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit eea4c860c3b366369eff0489d94ee4f0571d467d Author: Robin Guo Date: Tue Sep 6 10:21:19 2022 +0800 usb: musb: Fix musb_gadget.c rxstate overflow bug The usb function device call musb_gadget_queue() adds the passed request to musb_ep::req_list,If the (request->length > musb_ep->packet_sz) and (is_buffer_mapped(req) return false),the rxstate() will copy all data in fifo to request->buf which may cause request->buf out of bounds. Fix it by add the length check : fifocnt = min_t(unsigned, request->length - request->actual, fifocnt); Signed-off-by: Robin Guo Link: https://lore.kernel.org/r/20220906102119.1b071d07a8391ff115e6d1ef@inspur.com Signed-off-by: Greg Kroah-Hartman commit 93440d1fdf0a8d15857d755650fdcfc29c04e1f2 Author: Shruthi Sanil Date: Tue Sep 13 11:23:16 2022 +0530 usb: dwc3: pci: Add PCIe device ID for USB3 controller on CPU sub-system for Alder Lake P USB3 PCIe device ID's needs to be updated for the device to enumerate as a USB3 device on the host for Alder Lake P. Reviewed-by: Heikki Krogerus Signed-off-by: Shruthi Sanil Link: https://lore.kernel.org/r/20220913055316.23050-3-shruthi.sanil@intel.com Signed-off-by: Greg Kroah-Hartman commit ff2d2bee475077cb5d023e65fcc0b4f01a3ecdaf Author: Shruthi Sanil Date: Tue Sep 13 11:23:15 2022 +0530 usb: dwc3: pci: Update the macro names for USB PCIe device ID's for Alder Lake platforms The device ID 0x465e is defined for the USB3 device controller in the CPU sub-system of Alder Lake N platform. Hence updating the macro name accordingly. The device ID 0x54ee is defined for the USB2 controller on the PCH sub-system for Alder Lake N platform. Hence updating the macro name accordingly. The device ID's defined for Alder Lake P is shared between Alder Lake P, Alder Lake PS and Alder Lake M. Hence updating the macro name to ADL from ADLP to make it common and keeping it aligned with the xHCI ID's naming convention. As we have two device controllers on Alder Lake platforms i.e. one on PCH sub-system and another on CPU sub-system(USB3), appending _PCH for the USB2 device ID macro to differentiate between the 2 ID's. Reviewed-by: Heikki Krogerus Signed-off-by: Shruthi Sanil Link: https://lore.kernel.org/r/20220913055316.23050-2-shruthi.sanil@intel.com Signed-off-by: Greg Kroah-Hartman commit d6edcdc1ef06800f63519caac9b01b81274e25b7 Author: Piyush Mehta Date: Mon Sep 12 16:40:17 2022 +0530 usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure When USB is in super-speed mode and disabled as a wakeup source, observed that on the resume path, lanes have not been configured properly in the phy-zynqmp driver. As a result, after the resume, USB device detection failed on host. To resolved the above issue, added phy_init on resume and phy_exit on suspend path, to configure the GT lanes correctly. The re-initialization of phy, reset the device and re-enumerate the USB subsystem. This use-case is specific to Xilinx ZynqMP SoC. Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220912111017.901321-3-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit ec50e114385f9ec7a5995a4b9b4be3a971061af7 Author: Piyush Mehta Date: Mon Sep 12 16:40:16 2022 +0530 usb: dwc3: xilinx: add power management ops support Added system sleep and run-time power management ops support for dwc3-xilinx glue layer and update function name. Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220912111017.901321-2-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit e219a712bc06dc68ecccb3085cb91438bee2466a Author: Michael Grzeschik Date: Sat Sep 10 00:13:35 2022 +0200 usb: gadget: uvc: add v4l2 try_format api call This patch adds the uvc_v4l2_try_format api call to validate the setting of v4l2_format. It will fallback to the nearest allowed framesize. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220909221335.15033-5-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 588b9e85609bcb2f84a2be83591480aa943943b6 Author: Michael Grzeschik Date: Sat Sep 10 00:13:34 2022 +0200 usb: gadget: uvc: add v4l2 enumeration api calls This patch adds support to the v4l2 VIDIOCs for enum_format, enum_framesizes and enum_frameintervals. This way, the userspace application can use these VIDIOCS to query the via configfs exported frame capabilities. With thes callbacks the userspace doesn't have to bring its own configfs parser. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220909221335.15033-4-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6b028df7d466a5f7c0263a46256c9bdc42debd9f Author: Michael Grzeschik Date: Sat Sep 10 00:13:33 2022 +0200 media: uvcvideo: move uvc_format_desc to common header The uvc_format_desc, GUID defines and the uvc_format_by_guid helper is also useful for the uvc gadget stack. This patch moves them to a common header. Tested-by: Daniel Scally Reviewed-by: Daniel Scally Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220909221335.15033-3-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6ba8b8d45335180523df8f1b6cd1c995a3dbf560 Author: Michael Grzeschik Date: Sat Sep 10 00:13:32 2022 +0200 media: v4l: move helper functions for fractions from uvc to v4l2-common The functions uvc_simplify_fraction and uvc_fraction_to_interval are generic helpers which are also useful for other v4l2 drivers. This patch moves them to v4l2-common. Tested-by: Daniel Scally Reviewed-by: Daniel Scally Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220909221335.15033-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d225ea95e9f9be04914f51aaabab7ed04097cd4e Author: Richard Acayan Date: Wed Sep 21 22:46:56 2022 -0400 dt-bindings: usb: dwc3: add sdm670 compatible The Snapdragon 670 has DWC3 USB support. Add a compatible to reflect that. Acked-by: Krzysztof Kozlowski Signed-off-by: Richard Acayan Link: https://lore.kernel.org/r/20220922024656.178529-3-mailingradian@gmail.com Signed-off-by: Greg Kroah-Hartman commit 23b92adb53a18f1aa366511b4f8a2d0c0458e7e9 Author: Richard Acayan Date: Wed Sep 21 22:46:55 2022 -0400 dt-bindings: phy: qcom,qusb2: document sdm670 compatible The Snapdragon 670 uses the QUSB driver for USB 2.0. Document the compatible used in the device tree. Acked-by: Krzysztof Kozlowski Signed-off-by: Richard Acayan Link: https://lore.kernel.org/r/20220922024656.178529-2-mailingradian@gmail.com Signed-off-by: Greg Kroah-Hartman commit 875296ea8ff227ce906c13d703977a6e794c8b1f Author: Krzysztof Kozlowski Date: Wed Sep 21 10:46:54 2022 +0200 usb: dwc3: qcom: drop unneeded compatibles All Qualcomm SoC DWC3 USB devices have a qcom,dwc3 fallback, thus there is no need to keep the list of compatibles growing. Reviewed-by: Neil Armstrong Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921084654.118230-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 76bff31c7fba6cc21bf8f9785572484d54d31878 Author: Wesley Cheng Date: Mon Sep 19 16:12:13 2022 -0700 usb: dwc3: gadget: Do not clear ep delayed stop flag during ep disable DWC3_EP_DELAYED_STOP is utilized to defer issuing the end transfer command until the subsequent SETUP stage, in order to avoid end transfer timeouts. During cable disconnect scenarios, __dwc3_gadget_ep_disable() is responsible for ensuring endpoints have no active transfers pending. Since dwc3_remove_request() can now exit early if the EP delayed stop is set, avoid clearing all DEP flags, otherwise the transition back into the SETUP stage won't issue an endxfer command. Fixes: 2b2da6574e77 ("usb: dwc3: Avoid unmapping USB requests if endxfer is not complete") Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220919231213.21364-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit a659daf63d16aa883be42f3f34ff84235c302198 Author: Tadeusz Struk Date: Mon Sep 19 14:59:57 2022 -0700 usb: mon: make mmapped memory read only Syzbot found an issue in usbmon module, where the user space client can corrupt the monitor's internal memory, causing the usbmon module to crash the kernel with segfault, UAF, etc. The reproducer mmaps the /dev/usbmon memory to user space, and overwrites it with arbitrary data, which causes all kinds of issues. Return an -EPERM error from mon_bin_mmap() if the flag VM_WRTIE is set. Also clear VM_MAYWRITE to make it impossible to change it to writable later. Cc: "Dmitry Vyukov" Cc: stable Fixes: 6f23ee1fefdc ("USB: add binary API to usbmon") Suggested-by: PaX Team # for the VM_MAYRITE portion Link: https://syzkaller.appspot.com/bug?id=2eb1f35d6525fa4a74d75b4244971e5b1411c95a Reported-by: syzbot+23f57c5ae902429285d7@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk Link: https://lore.kernel.org/r/20220919215957.205681-1-tadeusz.struk@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5032b269203287c17064d33c72be1ebf30c04a95 Author: Johan Jonker Date: Sat Sep 10 00:02:01 2022 +0200 dt-bindings: usb: dwc2: rockchip: add rockchip,rk3128-usb Add rockchip,rk3128-usb compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/dfb657ab-85e5-ac47-810d-133c7e8dd823@gmail.com Signed-off-by: Greg Kroah-Hartman commit bb845948d93bd3b175f1d8b27aedfaab379b5638 Author: Iskren Chernev Date: Mon Sep 19 21:06:14 2022 +0300 dt-bindings: usb: qcom,dwc3: Fix SM6115 clocks, irqs SM6115 has 6 clocks and 2 interrupts. Signed-off-by: Iskren Chernev Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220919180618.1840194-5-iskren.chernev@gmail.com Signed-off-by: Greg Kroah-Hartman commit e45d7337dc0e4f7f1c2876e1b22c71a544ad12fd Author: Liang He Date: Thu Sep 15 17:22:09 2022 +0800 usb: typec: anx7411: Use of_get_child_by_name() instead of of_find_node_by_name() In anx7411_typec_switch_probe(), we should call of_get_child_by_name() instead of of_find_node_by_name() as of_find_xxx API will decrease the refcount of the 'from' argument. Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support") Acked-by: Heikki Krogerus Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220915092209.4009273-1-windhl@126.com Signed-off-by: Greg Kroah-Hartman commit 7489ec86bcb3830d3bd161365da425fd28d6382f Author: Xiu Jianfeng Date: Sat Sep 17 16:44:13 2022 +0800 usb: gadget: add _init/__exit annotations to module init/exit funcs Add missing _init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220917084413.23957-1-xiujianfeng@huawei.com Signed-off-by: Greg Kroah-Hartman commit b4e05668348edea7f39bf4dc80be0c0c4ca9ed4b Author: Christophe JAILLET Date: Sat Sep 10 07:46:21 2022 +0200 usb: dwc2: Remove redundant license text SPDX-License-Identifier have been added in commit 5fd54ace4721 ("USB: add SPDX identifiers to all remaining files in drivers/usb/") There is no point in keeping the now redundant license text. Remove it. Acked-by: Minas Harutyunyan Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/030a7e187d707f8734a492cda7a6b54d459c4bb3.1662788747.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit af870d93c706c302a8742d7c751a60a832f7bc64 Author: Kushagra Verma Date: Tue Sep 13 19:56:49 2022 +0530 usb: dwc3: Fix typos in gadget.c Fixes the following two typos: 1. reinitate -> reinitiate 2. revison -> revision Signed-off-by: Kushagra Verma Link: https://lore.kernel.org/r/HK0PR01MB280110FAB74B4B2ACE32EA5FF8479@HK0PR01MB2801.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman commit 24b7ba2f88e04800b54d462f376512e8c41b8a3c Author: Albert Briscoe Date: Sun Sep 11 15:37:55 2022 -0700 usb: gadget: function: fix dangling pnp_string in f_printer.c When opts->pnp_string is changed with configfs, new memory is allocated for the string. It does not, however, update dev->pnp_string, even though the memory is freed. When rquesting the string, the host then gets old or corrupted data rather than the new string. The ieee 1284 id string should be allowed to change while the device is connected. The bug was introduced in commit fdc01cc286be ("usb: gadget: printer: Remove pnp_string static buffer"), which changed opts->pnp_string from a char[] to a char*. This patch changes dev->pnp_string from a char* to a char** pointing to opts->pnp_string. Fixes: fdc01cc286be ("usb: gadget: printer: Remove pnp_string static buffer") Signed-off-by: Albert Briscoe Link: https://lore.kernel.org/r/20220911223753.20417-1-albertsbriscoe@gmail.com Signed-off-by: Greg Kroah-Hartman commit d2e672a67fd24d842874216911ea2d1cdb54173e Author: Mathias Nyman Date: Wed Sep 21 15:34:50 2022 +0300 xhci: remove unused lpm_failed_dev member from struct xhci_hcd xhci used to test if link power management (LPM) capable USB2 devices really could enter and exit L1 state link state. Failed devices were added to a lpm_failed_dev list. This feature was removed 9 years ago in commit de68bab4fa96 ("usb: Don't enable USB 2.0 Link PM by default.") but lpm_failed_dev member was still left. Remove it now. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 1a855a83592ed968d95ea28f15755c22f8336fba Author: Mathias Nyman Date: Wed Sep 21 15:34:49 2022 +0300 xhci: remove unused command member from struct xhci_hcd struct The u32 command was added to struct xhci_hcd over 10 years ago in commit 9777e3ce907d ("USB: xHCI: bus power management implementation") It wasn't even used back then, so remove it. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e11487f1f6a61be48b080ce2edbe3785759dfc7b Author: Mathias Nyman Date: Wed Sep 21 15:34:48 2022 +0300 xhci: show fault reason for a failed enable slot command Show the completion code of a unsuccessful "enable slot" command. Add it in a human readable form to the existing error message. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 484d6f7aa3283d082c87654b7fe7a7f725423dfb Author: Mario Limonciello Date: Wed Sep 21 15:34:47 2022 +0300 xhci: Don't show warning for reinit on known broken suspend commit 8b328f8002bc ("xhci: re-initialize the HC during resume if HCE was set") introduced a new warning message when the host controller error was set and re-initializing. This is expected behavior on some designs which already set `xhci->broken_suspend` so the new warning is alarming to some users. Modify the code to only show the warning if this was a surprising behavior to the XHCI driver. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216470 Fixes: 8b328f8002bc ("xhci: re-initialize the HC during resume if HCE was set") Reported-by: Artem S. Tashkinov Signed-off-by: Mario Limonciello Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d591b32e519603524a35b172156db71df9116902 Author: Rafael Mendonca Date: Wed Sep 21 15:34:46 2022 +0300 xhci: dbc: Fix memory leak in xhci_alloc_dbc() If DbC is already in use, then the allocated memory for the xhci_dbc struct doesn't get freed before returning NULL, which leads to a memleak. Fixes: 534675942e90 ("xhci: dbc: refactor xhci_dbc_init()") Cc: stable@vger.kernel.org Signed-off-by: Rafael Mendonca Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7e271f42a5cc3768cd2622b929ba66859ae21f97 Author: Jianglei Nie Date: Wed Sep 21 15:34:45 2022 +0300 usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info() xhci_alloc_stream_info() allocates stream context array for stream_info ->stream_ctx_array with xhci_alloc_stream_ctx(). When some error occurs, stream_info->stream_ctx_array is not released, which will lead to a memory leak. We can fix it by releasing the stream_info->stream_ctx_array with xhci_free_stream_ctx() on the error path to avoid the potential memory leak. Signed-off-by: Jianglei Nie Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220921123450.671459-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 715a654bc65c648bdc209a20513b2053d46aa5b5 Merge: 7eb2bf871454d 6b2fe3df7c0ca Author: Greg Kroah-Hartman Date: Thu Sep 22 15:51:24 2022 +0200 Merge tag 'usb-serial-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: "USB-serial updates for 6.1-rc1 Here are the USB-serial updates for 6.1-rc1, including: - a fix for a very long-standing FTDI SIO regression - a long-overdue cleanup of the FTDI type handling - support for new FTDI HP and HA devices Included are also various clean ups. All have been in linux-next with no reported issues." * tag 'usb-serial-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: ftdi_sio: clean up driver prefix USB: serial: ftdi_sio: move driver structure USB: serial: ftdi_sio: clean up attribute visibility logic USB: serial: console: move mutex_unlock() before usb_serial_put() USB: serial: ftdi_sio: convert to use dev_groups USB: serial: ftdi_sio: add support for HP and HA devices USB: serial: ftdi_sio: simplify divisor handling USB: serial: ftdi_sio: assume hi-speed type USB: serial: ftdi_sio: clean up baudrate request USB: serial: ftdi_sio: clean up attribute handling USB: serial: ftdi_sio: clean up modem-status handling USB: serial: ftdi_sio: tighten device-type detection USB: serial: ftdi_sio: rename channel index USB: serial: ftdi_sio: include FT2232D in type string USB: serial: ftdi_sio: rename chip types USB: serial: ftdi_sio: drop redundant chip type comments USB: serial: ftdi_sio: clean up chip type enum USB: serial: ftdi_sio: fix 300 bps rate for SIO commit 798fd4b9ac37fec571f55fb8592497b0dd5f7a73 Author: James Morse Date: Fri Sep 2 15:48:13 2022 +0000 x86/resctrl: Add domain offline callback for resctrl work Because domains are exposed to user-space via resctrl, the filesystem must update its state when CPU hotplug callbacks are triggered. Some of this work is common to any architecture that would support resctrl, but the work is tied up with the architecture code to free the memory. Move the monitor subdir removal and the cancelling of the mbm/limbo works into a new resctrl_offline_domain() call. These bits are not specific to the architecture. Grouping them in one function allows that code to be moved to /fs/ and re-used by another architecture. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-6-james.morse@arm.com commit 478cc2fc3dd782f7935bc0ab84c198691ea83fa3 Author: Yang Yingliang Date: Tue Sep 20 19:44:48 2022 +0800 spi: xtensa-xtfpga: Switch to use devm_spi_alloc_master() Switch to use devm_spi_alloc_master() to simpify error path. Signed-off-by: Yang Yingliang Tested-by: Max Filippov Acked-by: Max Filippov Link: https://lore.kernel.org/r/20220920114448.2681053-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 7add3af4178d9e25afc8d990a7d1000ccb22b6a0 Author: James Morse Date: Fri Sep 2 15:48:12 2022 +0000 x86/resctrl: Group struct rdt_hw_domain cleanup domain_add_cpu() and domain_remove_cpu() need to kfree() the child arrays that were allocated by domain_setup_ctrlval(). As this memory is moved around, and new arrays are created, adjusting the error handling cleanup code becomes noisier. To simplify this, move all the kfree() calls into a domain_free() helper. This depends on struct rdt_hw_domain being kzalloc()d, allowing it to unconditionally kfree() all the child arrays. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-5-james.morse@arm.com commit 3a7232cdf19e39e7f24c493117b373788b348af2 Author: James Morse Date: Fri Sep 2 15:48:11 2022 +0000 x86/resctrl: Add domain online callback for resctrl work Because domains are exposed to user-space via resctrl, the filesystem must update its state when CPU hotplug callbacks are triggered. Some of this work is common to any architecture that would support resctrl, but the work is tied up with the architecture code to allocate the memory. Move domain_setup_mon_state(), the monitor subdir creation call and the mbm/limbo workers into a new resctrl_online_domain() call. These bits are not specific to the architecture. Grouping them in one function allows that code to be moved to /fs/ and re-used by another architecture. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-4-james.morse@arm.com commit 377c17c6757ccf43e97f681a6ac5163d3735ab0a Merge: 3cae32b480d14 03a3180e5c09e Author: Paolo Abeni Date: Thu Sep 22 15:13:26 2022 +0200 Merge branch 'add-wed-support-for-mt7986-chipset' Lorenzo Bianconi says: ==================== Add WED support for MT7986 chipset Similar to MT7622, introduce Wireless Ethernet Dispatch (WED) support for MT7986 chipset in order to offload to the hw packet engine traffic received from LAN/WAN device to WLAN nic (MT7915E). ==================== Link: https://lore.kernel.org/r/cover.1663668203.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit 03a3180e5c09e1cd73867f5f561cba1e43abeeb8 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:23 2022 +0200 net: ethernet: mtk_eth_soc: introduce flow offloading support for mt7986 Introduce hw flow offload support for mt7986 chipset. PPE is not enabled yet in mt7986 since mt76 support is not available yet. Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 2b2ba3ecb2411c5e2a0d670be5e9ded2c93351e9 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:22 2022 +0200 net: ethernet: mtk_eth_wed: add axi bus support Other than pcie bus, introduce support for axi bus to mtk wed driver. Axi bus is used to connect mt7986-wmac soc chip available on mt7986 device. Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit de84a090d99a3b991bd89cd86a94b65d15bd1bbe Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:21 2022 +0200 net: ethernet: mtk_eth_wed: add wed support for mt7986 chipset Introduce Wireless Etherne Dispatcher support on transmission side for mt7986 chipset Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit cf26df8833cc94ab86aefb52a65a538dff3390d4 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:20 2022 +0200 net: ethernet: mtk_eth_wed: add mtk_wed_configure_irq and mtk_wed_dma_{enable/disable} Introduce mtk_wed_configure_irq, mtk_wed_dma_enable and mtk_wed_dma_disable utility routines. This is a preliminary patch to introduce mt7986 wed support. Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 9d8cb4c096ab02c7c93347253947b12ed087c2e6 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:19 2022 +0200 net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc Introduce foe_entry_size to mtk_eth_soc data structure since mt7986 relies on a bigger mtk_foe_entry data structure. Tested-by: Daniel Golle Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 0c1d3fb9c2b7ad3bbc2ad694b5f2fd1b45b31895 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:18 2022 +0200 net: ethernet: mtk_eth_soc: move wdma_base definitions in mtk register map This is a preliminary patch to introduce mt7986 wed support. Tested-by: Daniel Golle Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 4ff1a3fca766aa816e3497eb2b679954d268b16a Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:17 2022 +0200 net: ethernet: mtk_eth_soc: add the capability to run multiple ppe mt7986 chipset support multiple packet engines for wlan <-> eth packet forwarding. Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit ba2fc48c5e1e9e1934939f0d12ff8b985dcc6e5d Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:16 2022 +0200 net: ethernet: mtk_eth_soc: move ppe table hash offset to mtk_soc_data structure This is a preliminary patch to introduce mt7986 hw packet engine. Tested-by: Daniel Golle Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 329bce5139cfb00dba40f038ec090572b81ff2a9 Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:15 2022 +0200 net: ethernet: mtk_eth_soc: move gdma_to_ppe and ppe_base definitions in mtk register map This is a preliminary patch to introduce mt7986 hw packet engine. Tested-by: Daniel Golle Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 22ecfce11034e74504b3657c668db0d64d93c05e Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:14 2022 +0200 dt-bindings: net: mediatek: add WED binding for MT7986 eth driver Document the binding for the Wireless Ethernet Dispatch core on the MT7986 ethernet driver Reviewed-by: Rob Herring Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 00b9903996b3e1e287c748928606d738944e45de Author: Lorenzo Bianconi Date: Tue Sep 20 12:11:13 2022 +0200 arm64: dts: mediatek: mt7986: add support for Wireless Ethernet Dispatch Introduce wed0 and wed1 nodes in order to enable offloading forwarding between ethernet and wireless devices on the mt7986 chipset. Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit d813a19e7d2ec0c57477ee114f9b5e9a43cacb76 Author: Shuai Xue Date: Thu Aug 18 11:18:22 2022 +0800 MAINTAINERS: add maintainers for Alibaba' T-Head PMU driver Add maintainers for Alibaba PMU document and driver Signed-off-by: Shuai Xue Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220818031822.38415-4-xueshuai@linux.alibaba.com Signed-off-by: Will Deacon commit cf7b61073e4526caa247616f6fbb174cbd2a5366 Author: Shuai Xue Date: Thu Aug 18 11:18:21 2022 +0800 drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC Add the DDR Sub-System Driveway Performance Monitoring Unit (PMU) driver support for Alibaba T-Head Yitian 710 SoC chip. Yitian supports DDR5/4 DRAM and targets cloud computing and HPC. Each PMU is registered as a device in /sys/bus/event_source/devices, and users can select event to monitor in each sub-channel, independently. For example, ali_drw_21000 and ali_drw_21080 are two PMU devices for two sub-channels of the same channel in die 0. And the PMU device of die 1 is prefixed with ali_drw_400XXXXX, e.g. ali_drw_40021000. Due to hardware limitation, one of DDRSS Driveway PMU overflow interrupt shares the same irq number with MPAM ERR_IRQ. To register DDRSS PMU and MPAM drivers successfully, add IRQF_SHARED flag. Signed-off-by: Shuai Xue Co-developed-by: Hongbo Yao Signed-off-by: Hongbo Yao Co-developed-by: Neng Chen Signed-off-by: Neng Chen Reviewed-by: Jonathan Cameron Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220818031822.38415-3-xueshuai@linux.alibaba.com Signed-off-by: Will Deacon commit a6f92909d6bb59eafa004178983850a1b739e304 Author: Shuai Xue Date: Wed Sep 14 10:23:24 2022 +0800 docs: perf: Add description for Alibaba's T-Head PMU driver Alibaba's T-Head SoC implements uncore PMU for performance and functional debugging to facilitate system maintenance. Document it to provide guidance on how to use it. Signed-off-by: Shuai Xue Reviewed-by: Jonathan Cameron Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220914022326.88550-2-xueshuai@linux.alibaba.com Signed-off-by: Will Deacon commit bab6ee736873becc0216ba5fd159394e272d01b2 Author: James Morse Date: Fri Sep 2 15:48:10 2022 +0000 x86/resctrl: Merge mon_capable and mon_enabled mon_enabled and mon_capable are always set as a pair by rdt_get_mon_l3_config(). There is no point having two values. Merge them together. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-3-james.morse@arm.com commit 4d269ed485298e8a09485a664e7b35b370ab4ada Author: James Morse Date: Fri Sep 2 15:48:09 2022 +0000 x86/resctrl: Kill off alloc_enabled rdt_resources_all[] used to have extra entries for L2CODE/L2DATA. These were hidden from resctrl by the alloc_enabled value. Now that the L2/L2CODE/L2DATA resources have been merged together, alloc_enabled doesn't mean anything, it always has the same value as alloc_capable which indicates allocation is supported by this resource. Remove alloc_enabled and its helpers. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Jamie Iles Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Tested-by: Xin Hao Tested-by: Shaopeng Tan Tested-by: Cristian Marussi Link: https://lore.kernel.org/r/20220902154829.30399-2-james.morse@arm.com commit ef6f5494faf6a37c74990689a3bb3cee76d2544c Author: Jaroslav Kysela Date: Thu Sep 22 10:40:17 2022 +0200 ALSA: hda/hdmi: Use only dynamic PCM device allocation Per discussion on the alsa-devel mailing list [1], the legacy PIN to PCM device mapping is obsolete nowadays. The maximum number of the simultaneously usable PCM devices is equal to the HDMI codec converters. Remove the extra PCM devices (beyond the detected converters) and force the use of the dynamic PCM device allocation. The legacy code is removed. I believe that all HDMI codecs have the jack sensing feature. Move the check to the codec probe function and print a warning, if a codec without this feature is detected. [1] https://lore.kernel.org/alsa-devel/2f37e0b2-1e82-8c0b-2bbd-1e5038d6ecc6@perex.cz/ Cc: Kai Vehmanen Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220922084017.25925-1-perex@perex.cz Signed-off-by: Takashi Iwai commit af45a0d32df9c8f5abbbc7401d70ffa296c8cef6 Merge: b5eee17cf7dda c35fbea48659e Author: Takashi Iwai Date: Thu Sep 22 13:54:20 2022 +0200 Merge branch 'for-linus' into for-next commit b5eee17cf7ddaf7b29a031b2c48277038e7a171a Author: ye xingchen Date: Thu Sep 22 11:28:46 2022 +0000 ALSA: hda/ca0132 - remove the unneeded result variable Return the value dsp_allocate_ports() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220922112846.236987-1-ye.xingchen@zte.com.cn Signed-off-by: Takashi Iwai commit 077dac343b54babfd56b1a52cf1f091518118957 Author: Wei Yongjun Date: Thu Sep 22 04:08:07 2022 +0000 spi: meson-spicc: make symbol 'meson_spicc_pow2_clk_ops' static The sparse tool complains as follows: drivers/spi/spi-meson-spicc.c:570:22: warning: symbol 'meson_spicc_pow2_clk_ops' was not declared. Should it be static? This symbol is not used outside of spi-meson-spicc.c, so marks it static. Signed-off-by: Wei Yongjun Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220922040807.1409540-1-weiyongjun@huaweicloud.com Signed-off-by: Mark Brown commit 01ed230761e51f0403b3f3845c11cb67014487e2 Author: Colin Ian King Date: Thu Sep 22 09:04:45 2022 +0100 regmap: mmio: replace return 0 with break in switch statement Variable min_stride is assigned a value that is never read, fix this by replacing the return 0 with a break statement. This also makes the case statement consistent with the other cases in the switch statement. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220922080445.818020-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit e2f0b9277810685f6a67201847082ec9852853bd Author: Pierre-Louis Bossart Date: Thu Sep 22 12:02:54 2022 +0200 ASoC: SOF: pci-tgl: add missing PCI IDs for RPL Add IDs for RPL-M and RPL-PX Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220922100254.27159-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1c9a057eb7f45f8d233ae847d1e9fd64d163bd1c Author: Pierre-Louis Bossart Date: Thu Sep 22 12:02:53 2022 +0200 ASoC: SOF: Intel: pci-tgl: reorder PCI IDs No functionality change, just sort ADL PCI IDs by increasing order. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220922100254.27159-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6de0b0292b548010b09917e8cdfc337a6dcf67ce Author: Pierre-Louis Bossart Date: Thu Sep 22 11:59:12 2022 +0200 ASoC: es8316: fix register sync error in suspend/resume tests The SOF CI tests report failures with the following error thrown kernel: es8316 i2c-ESSX8336:00: Unable to sync registers 0x0-0x1. -121 ES8336 only supports I2C read/write one byte a time, so we do need to set the .use_single_read and .use_single_write flags to avoid this sync issue. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: FRED OH Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220922095912.27010-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b300729b77b0b746c4f898332705672eb50d3297 Author: Dan Carpenter Date: Thu Sep 22 14:22:35 2022 +0300 RDMA/core: Clean up a variable name in ib_create_srq_user() "&srq->pd->usecnt" and "&pd->usecnt" are different names for the same reference count. Use "&pd->usecnt" consistently for both the increment and decrement. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YyxFe3Pm0uzRuBkQ@kili Signed-off-by: Leon Romanovsky commit cca1fd41ab2862465d75443822d751e4f9a112ee Author: William Breathitt Gray Date: Thu Sep 22 07:20:57 2022 -0400 counter: Realign counter_comp comment block to 80 characters The member documentation comment lines for struct counter_comp extend past the 80-characters column boundary due to extra identation at the start of each section. This patch realigns the comment block within the 80-characters boundary by removing these superfluous indents. Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20220902120839.4260-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/8294b04153c33602e9c3dd21ac90c1e99bd0fdaf.1663844776.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3cae32b480d14442e67f3621b2966379acd48bb6 Merge: 9b17dbd97de78 0227f058aa29f Author: Paolo Abeni Date: Thu Sep 22 12:58:23 2022 +0200 Merge branch 'separate-smc-parameter-settings-from-tcp-sysctls' Wen Gu says: ==================== Separate SMC parameter settings from TCP sysctls SMC shares some sysctls with TCP, but considering the difference between these two protocols, it may not be very suitable for SMC to reuse TCP parameter settings in some cases, such as keepalive time or buffer size. So this patch set aims to introduce some SMC specific sysctls to independently and flexibly set the parameters that suit SMC. ==================== Link: https://lore.kernel.org/r/1663667542-119851-1-git-send-email-guwen@linux.alibaba.com Signed-off-by: Paolo Abeni commit 0227f058aa29f5ab6f6ec79c3a36ae41f1e03a13 Author: Tony Lu Date: Tue Sep 20 17:52:22 2022 +0800 net/smc: Unbind r/w buffer size from clcsock and make them tunable Currently, SMC uses smc->sk.sk_{rcv|snd}buf to create buffers for send buffer and RMB. And the values of buffer size are from tcp_{w|r}mem in clcsock. The buffer size from TCP socket doesn't fit SMC well. Generally, buffers are usually larger than TCP for SMC-R/-D to get higher performance, for they are different underlay devices and paths. So this patch unbinds buffer size from TCP, and introduces two sysctl knobs to tune them independently. Also, these knobs are per net namespace and work for containers. Signed-off-by: Tony Lu Signed-off-by: Paolo Abeni commit 77eee32514314209961af5c2982e871ecb364445 Author: Wen Gu Date: Tue Sep 20 17:52:21 2022 +0800 net/smc: Introduce a specific sysctl for TEST_LINK time SMC-R tests the viability of link by sending out TEST_LINK LLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time). But using tcp_keepalive_time as testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until get IB_WC_RETRY_EXC_ERR error CQEs, which takes more time than TEST_LINK timeout (SMC_LLC_WAIT_TIME) normally. So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds. [1] https://www.rfc-editor.org/rfc/rfc1122#page-101 Signed-off-by: Wen Gu Signed-off-by: Paolo Abeni commit 9b17dbd97de78796997583340b540bdb571694e6 Author: Sun Ke Date: Tue Sep 20 10:00:41 2022 +0800 net: ethernet: altera: TSE: fix error return code in altera_tse_probe() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: fef2998203e1 ("net: altera: tse: convert to phylink") Reported-by: kernel test robot Signed-off-by: Sun Ke Link: https://lore.kernel.org/r/20220920020041.2685948-1-sunke32@huawei.com Signed-off-by: Paolo Abeni commit b05398aff9ad9dc701b261183a5d756165d28b51 Author: Mikhael Goikhman Date: Wed Sep 21 11:03:07 2022 +0300 RDMA/srp: Support more than 255 rdma ports Currently ib_srp module does not support devices with more than 256 ports. Switch from u8 to u32 to fix the problem. Fixes: 1fb7f8973f51 ("RDMA: Support more than 255 rdma ports") Reviewed-by: Shay Drory Signed-off-by: Mikhael Goikhman Link: https://lore.kernel.org/r/7d80d8844f1abb3a54170b7259f0a02be38080a6.1663747327.git.leonro@nvidia.com Reviewed-by: Bart Van Assche Signed-off-by: Leon Romanovsky commit 954afc5a8fd85745a27536e064eebaa34abf9a19 Author: Daisuke Matsuda Date: Wed Sep 21 17:08:44 2022 +0900 RDMA/rxe: Use members of generic struct in rxe_mr rxe_mr and ib_mr have interchangeable members. Remove device specific members and use ones in the generic struct. Both 'iova' and 'length' are filled in ib_uverbs or ib_core layer after MR registration. Signed-off-by: Daisuke Matsuda Link: https://lore.kernel.org/r/20220921080844.1616883-2-matsuda-daisuke@fujitsu.com Signed-off-by: Leon Romanovsky commit 241f9a27e0fc0eaf23e3d52c8450f10648cd11f1 Author: Daisuke Matsuda Date: Wed Sep 21 17:08:43 2022 +0900 IB: Set IOVA/LENGTH on IB_MR in core/uverbs layers Set 'iova' and 'length' on ib_mr in ib_uverbs and ib_core layers to let all drivers have the members filled. Also, this commit removes redundancy in the respective drivers. Previously, commit 04c0a5fcfcf65 ("IB/uverbs: Set IOVA on IB MR in uverbs layer") changed to set 'iova', but seems to have missed 'length' and the ib_core layer at that time. Fixes: 04c0a5fcfcf65 ("IB/uverbs: Set IOVA on IB MR in uverbs layer") Signed-off-by: Daisuke Matsuda Link: https://lore.kernel.org/r/20220921080844.1616883-1-matsuda-daisuke@fujitsu.com Signed-off-by: Leon Romanovsky commit eb8336dbe373edd1ad6061c543e4ba6ea60f6cc9 Author: Mark Zhang Date: Thu Sep 8 13:09:03 2022 +0300 RDMA/cm: Use DLID from inbound/outbound PathRecords as the datapath DLID In inter-subnet cases, when inbound/outbound PRs are available, outbound_PR.dlid is used as the requestor's datapath DLID and inbound_PR.dlid is used as the responder's DLID. The inbound_PR.dlid is passed to responder side with the "ConnectReq.Primary_Local_Port_LID" field. With this solution the PERMISSIVE_LID is no longer used in Primary Local LID field. Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/b3f6cac685bce9dde37c610be82e2c19d9e51d9e.1662631201.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit b7d95040c13f61a4a6a859c5355faf583eff9658 Author: Mark Zhang Date: Thu Sep 8 13:09:02 2022 +0300 RDMA/cm: Use SLID in the work completion as the DLID in responder side The responder should always use WC's SLID as the dlid, to follow the IB SPEC section "13.5.4.2 COMMON RESPONSE ACTIONS": A responder always takes the following actions in constructing a response packet: - The SLID of the received packet is used as the DLID in the response packet. Fixes: ac3a949fb2ff ("IB/CM: Set appropriate slid and dlid when handling CM request") Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/cd17c240231e059d2fc07c17dfe555d548b917eb.1662631201.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit 5a3749493394276449cfc4efb417ed267edbd480 Author: Mark Zhang Date: Thu Sep 8 13:09:01 2022 +0300 RDMA/cma: Multiple path records support with netlink channel Support receiving inbound and outbound IB path records (along with GMP PathRecord) from user-space service through the RDMA netlink channel. The LIDs in these 3 PRs can be used in this way: 1. GMP PR: used as the standard local/remote LIDs; 2. DLID of outbound PR: Used as the "dlid" field for outbound traffic; 3. DLID of inbound PR: Used as the "dlid" field for outbound traffic in responder side. This is aimed to support adaptive routing. With current IB routing solution when a packet goes out it's assigned with a fixed DLID per target, meaning a fixed router will be used. The LIDs in inbound/outbound path records can be used to identify group of routers that allow communication with another subnet's entity. With them packets from an inter-subnet connection may travel through any router in the set to reach the target. As confirmed with Jason, when sending a netlink request, kernel uses LS_RESOLVE_PATH_USE_ALL so that the service knows kernel supports multiple PRs. Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/2fa2b6c93c4c16c8915bac3cfc4f27be1d60519d.1662631201.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit bf9a9928510a03e445fa4f54bdc0b8e71f4c0067 Author: Mark Zhang Date: Thu Sep 8 13:09:00 2022 +0300 RDMA/core: Rename rdma_route.num_paths field to num_pri_alt_paths This fields means the total number of primary and alternative paths, i.e.,: 0 - No primary nor alternate path is available; 1 - Only primary path is available; 2 - Both primary and alternate path are available. Rename it to avoid confusion as with follow patches primary path will support multiple path records. Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/cbe424de63a56207870d70c5edce7c68e45f429e.1662631201.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit 55b5ee3357d7bb98ee578cf9b84a652e7a1bc199 Author: Jesus Fernandez Manzano Date: Thu Sep 22 10:35:14 2022 +0300 wifi: ath11k: fix number of VHT beamformee spatial streams The number of spatial streams used when acting as a beamformee in VHT mode are reported by the firmware as 7 (8 sts - 1) both in IPQ6018 and IPQ8074 which respectively have 2 and 4 sts each. So the firmware should report 1 (2 - 1) and 3 (4 - 1). Fix this by checking that the number of VHT beamformee sts reported by the firmware is not greater than the number of receiving antennas - 1. The fix is based on the same approach used in this same function for sanitizing the number of sounding dimensions reported by the firmware. Without this change, acting as a beamformee in VHT mode is not working properly. Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Jesus Fernandez Manzano Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220616173947.21901-1-jesus.manzano@galgus.net commit 176239a9a2e3c519923d7bd8bb205838d48c7a3c Author: Jun Yu Date: Tue Sep 20 00:31:17 2022 +0000 wifi: ath11k: retrieve MAC address from system firmware if provided Devices may provide their own MAC address via system firmware (e.g., device tree), especially in the case where the device doesn't have a useful EEPROM on which to store its MAC address (e.g., for integrated ahb WCN6750). Use the generic device helper to retrieve the MAC address, and (if present) honor it above the MAC address advertised by the card. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Jun Yu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920003117.841442-1-junyuu@chromium.org commit 14ca1a4690750bb54e1049e49f3140ef48958a6e Author: Wang Kefeng Date: Fri Sep 16 12:10:49 2022 +0100 ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE MT_MEMORY_RO is introduced by commit 598f0a99fa8a ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable"), which is a readonly memory type for FDT area, but there are some different between ARM_LPAE and non-ARM_LPAE, we need to setup PMD_SECT_AP2 and L_PMD_SECT_RDONLY for MT_MEMORY_RO when ARM_LAPE enabled. non-ARM_LPAE 0xff800000-0xffa00000 2M PGD KERNEL ro NX SHD ARM_LPAE 0xff800000-0xffc00000 4M PMD RW NX SHD ARM_LPAE+fix 0xff800000-0xffc00000 4M PMD ro NX SHD Fixes: 598f0a99fa8a ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable") Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 2ccd19b3ffac07cc7e75a2bd1ed779728bb67197 Author: Wang Kefeng Date: Tue Sep 13 05:25:51 2022 +0100 ARM: 9244/1: dump: Fix wrong pg_level in walk_pmd() After ARM supports p4d page tables, the pg_level for note_page() in walk_pmd() should be 4, not 3, fix it. Fixes: 84e6ffb2c49c ("arm: add support for folded p4d page tables") Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 32844a8eecaa4a3e65841c53e43e04a9087d1ef6 Author: Bart Van Assche Date: Mon Sep 12 23:13:53 2022 +0100 ARM: 9243/1: riscpc: Unbreak the build This patch fixes the following build error: In file included from ./include/linux/io.h:13, from ./arch/arm/mach-rpc/include/mach/uncompress.h:9, from arch/arm/boot/compressed/misc.c:31: ./arch/arm/include/asm/io.h:85:22: error: conflicting types for ‘__raw_writeb’ 85 | #define __raw_writeb __raw_writeb | ^~~~~~~~~~~~ ./arch/arm/include/asm/io.h:86:20: note: in expansion of macro ‘__raw_writeb’ 86 | static inline void __raw_writeb(u8 val, volatile void __iomem *addr) | ^~~~~~~~~~~~ In file included from arch/arm/boot/compressed/misc.c:26: arch/arm/boot/compressed/misc-ep93xx.h:13:20: note: previous definition of ‘__raw_writeb’ was here 13 | static inline void __raw_writeb(unsigned char value, unsigned int ptr) | ^~~~~~~~~~~~ To: Russell King Cc: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org Fixes: 0361c7e504b1 ("ARM: ep93xx: multiplatform support") Signed-off-by: Bart Van Assche Signed-off-by: Russell King (Oracle) commit 9a2aa68afe3dd1cbb194523415410965deea6277 Author: Aditya Kumar Singh Date: Tue Sep 20 18:24:21 2022 +0300 wifi: ath11k: add get_txpower mac ops Driver does not support get_txpower mac ops because of which cfg80211 returns vif->bss_conf.txpower to user space. bss_conf.txpower gets its value from ieee80211_channel->max_reg_power. However, the final txpower is dependent on few other parameters apart from max regulatory supported power. It is the firmware which knows about all these parameters and considers the minimum for each packet transmission. All ath11k firmware reports the final tx power in firmware pdev stats which falls under fw_stats. Add get_txpower mac ops to get the tx power from firmware leveraging fw_stats and return it accordingly. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220603082814.31466-3-quic_adisi@quicinc.com commit ec8918f922b8a40a12cb86793245026f08b79812 Author: Aditya Kumar Singh Date: Tue Sep 20 18:24:12 2022 +0300 wifi: ath11k: move firmware stats out of debugfs Currently, firmware stats, comprising pdev, vdev and beacon stats are part of debugfs. In firmware pdev stats, firmware reports the final Tx power used to transmit each packet. If driver wants to know the final Tx power being used at firmware level, it can leverage from firmware pdev stats. Move firmware stats out of debugfs context in order to leverage the final Tx power reported in it even when debugfs is disabled. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220603082814.31466-2-quic_adisi@quicinc.com commit 09cffecaa7703fd4c54b25f6c21c3a93e87c2e8f Author: Zhen Lei Date: Wed Aug 3 08:44:58 2022 +0100 ARM: 9224/1: Dump the stack traces based on the parameter 'regs' of show_regs() Function show_regs() is usually called in interrupt handler or exception handler, it prints the registers specified by the parameter 'regs', then dump the stack traces. Although not explicitly documented, dump the stack traces based on'regs' seems to make the most sense. Although dump_stack() can finally dump the desired content, because 'regs' are saved by the entry of current interrupt or exception. In the following example we can see: 1) The backtrace of interrupt or exception handler is not expected, it causes confusion. 2) Something is printed repeatedly. The line with the kernel version "CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8", the registers saved in "Exception stack" which 'regs' actually point to. For example: rcu: INFO: rcu_sched self-detected stall on CPU rcu: 0-....: (499 ticks this GP) idle=379/1/0x40000002 softirq=91/91 fqs=249 (t=500 jiffies g=-911 q=13 ncpus=4) CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8 Hardware name: ARM-Versatile Express PC is at ktime_get+0x4c/0xe8 LR is at ktime_get+0x4c/0xe8 pc : 8019a474 lr : 8019a474 psr: 60000013 sp : cabd1f28 ip : 00000001 fp : 00000005 r10: 527bf1b8 r9 : 431bde82 r8 : d7b634db r7 : 0000156e r6 : 61f234f8 r5 : 00000001 r4 : 80ca86c0 r3 : ffffffff r2 : fe5bce0b r1 : 00000000 r0 : 01a431f4 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 6121406a DAC: 00000051 CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8 <-----------start---------- Hardware name: ARM-Versatile Express | unwind_backtrace from show_stack+0x10/0x14 | show_stack from dump_stack_lvl+0x40/0x4c | dump_stack_lvl from rcu_dump_cpu_stacks+0x10c/0x134 | rcu_dump_cpu_stacks from rcu_sched_clock_irq+0x780/0xaf4 | rcu_sched_clock_irq from update_process_times+0x54/0x74 | update_process_times from tick_periodic+0x3c/0xd4 | tick_periodic from tick_handle_periodic+0x20/0x80 worthless tick_handle_periodic from twd_handler+0x30/0x40 or twd_handler from handle_percpu_devid_irq+0x8c/0x1c8 duplicated handle_percpu_devid_irq from generic_handle_domain_irq+0x24/0x34 | generic_handle_domain_irq from gic_handle_irq+0x74/0x88 | gic_handle_irq from generic_handle_arch_irq+0x34/0x44 | generic_handle_arch_irq from call_with_stack+0x18/0x20 | call_with_stack from __irq_svc+0x98/0xb0 | Exception stack(0xcabd1ed8 to 0xcabd1f20) | 1ec0: 01a431f4 00000000 | 1ee0: fe5bce0b ffffffff 80ca86c0 00000001 61f234f8 0000156e d7b634db 431bde82 | 1f00: 527bf1b8 00000005 00000001 cabd1f28 8019a474 8019a474 60000013 ffffffff | __irq_svc from ktime_get+0x4c/0xe8 <---------end-------------- ktime_get from test_task+0x44/0x110 test_task from kthread+0xd8/0xf4 kthread from ret_from_fork+0x14/0x2c Exception stack(0xcabd1fb0 to 0xcabd1ff8) 1fa0: 00000000 00000000 00000000 00000000 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 After replacing dump_stack() with dump_backtrace(): rcu: INFO: rcu_sched self-detected stall on CPU rcu: 0-....: (500 ticks this GP) idle=8f7/1/0x40000002 softirq=129/129 fqs=241 (t=500 jiffies g=-915 q=13 ncpus=4) CPU: 0 PID: 69 Comm: test0 Not tainted 5.19.0+ #9 Hardware name: ARM-Versatile Express PC is at ktime_get+0x4c/0xe8 LR is at ktime_get+0x4c/0xe8 pc : 8019a494 lr : 8019a494 psr: 60000013 sp : cabddf28 ip : 00000001 fp : 00000002 r10: 0779cb48 r9 : 431bde82 r8 : d7b634db r7 : 00000a66 r6 : e835ab70 r5 : 00000001 r4 : 80ca86c0 r3 : ffffffff r2 : ff337d39 r1 : 00000000 r0 : 00cc82c6 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 611d006a DAC: 00000051 ktime_get from test_task+0x44/0x110 test_task from kthread+0xd8/0xf4 kthread from ret_from_fork+0x14/0x2c Exception stack(0xcabddfb0 to 0xcabddff8) dfa0: 00000000 00000000 00000000 00000000 dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 Signed-off-by: Zhen Lei Signed-off-by: Russell King (Oracle) commit 1035deb323910db32ca170cba24023141b35208e Author: Jilin Yuan Date: Thu Sep 15 11:08:59 2022 +0800 wifi: ath9k: fix repeated the words in a comment Delete the redundant word 'the'. Signed-off-by: Jilin Yuan Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220915030859.45384-1-yuanjilin@cdjrlc.com commit 02be97c7b2de1ca10ee01739cd76d1b8ac5cf591 Author: Jilin Yuan Date: Thu Sep 15 11:05:59 2022 +0800 wifi: ath9k: fix repeated to words in a comment Delete the redundant word 'to'. Signed-off-by: Jilin Yuan Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220915030559.42371-1-yuanjilin@cdjrlc.com commit 1e1cb8e0b73e6f39a9d4a7a15d940b1265387eb5 Author: Wen Gong Date: Tue Sep 20 18:23:54 2022 +0300 wifi: ath10k: reset pointer after memory free to avoid potential use-after-free When running suspend test, kernel crash happened in ath10k, and it is fixed by commit b72a4aff947b ("ath10k: skip ath10k_halt during suspend for driver state RESTARTING"). Currently the crash is fixed, but as a common code style, it is better to set the pointer to NULL after memory is free. This is to address the code style and it will avoid potential bug of use-after-free. Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220505092248.787-1-quic_wgong@quicinc.com commit a20ed60bb357776301c2dad7b4a4f0db97e143e9 Author: Wen Gong Date: Tue Sep 20 18:23:41 2022 +0300 wifi: ath11k: fix failed to find the peer with peer_id 0 when disconnected It has a fail log which is ath11k_dbg in ath11k_dp_rx_process_mon_status(), as below, it will not print when debug_mask is not set ATH11K_DBG_DATA. ath11k_dbg(ab, ATH11K_DBG_DATA, "failed to find the peer with peer_id %d\n", ppdu_info.peer_id); When run scan with station disconnected, the peer_id is 0 for case HAL_RX_MPDU_START in ath11k_hal_rx_parse_mon_status_tlv() which called from ath11k_dp_rx_process_mon_status(), and the peer_id of ppdu_info is reset to 0 in the while loop, so it does not match condition of the check "if (ppdu_info->peer_id == HAL_INVALID_PEERID" in the loop, and then the log "failed to find the peer with peer_id 0" print after the check in the loop, it is below call stack when debug_mask is set ATH11K_DBG_DATA. The reason is this commit 01d2f285e3e5 ("ath11k: decode HE status tlv") add "memset(ppdu_info, 0, sizeof(struct hal_rx_mon_ppdu_info))" in ath11k_dp_rx_process_mon_status(), but the commit does not initialize the peer_id to HAL_INVALID_PEERID, then lead the check mis-match. Callstack of the failed log: [12335.689072] RIP: 0010:ath11k_dp_rx_process_mon_status+0x9ea/0x1020 [ath11k] [12335.689157] Code: 89 ff e8 f9 10 00 00 be 01 00 00 00 4c 89 f7 e8 dc 4b 4e de 48 8b 85 38 ff ff ff c7 80 e4 07 00 00 01 00 00 00 e9 20 f8 ff ff <0f> 0b 41 0f b7 96 be 06 00 00 48 c7 c6 b8 50 44 c1 4c 89 ff e8 fd [12335.689180] RSP: 0018:ffffb874001a4ca0 EFLAGS: 00010246 [12335.689210] RAX: 0000000000000000 RBX: ffff995642cbd100 RCX: 0000000000000000 [12335.689229] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff99564212cd18 [12335.689248] RBP: ffffb874001a4dc0 R08: 0000000000000001 R09: 0000000000000000 [12335.689268] R10: 0000000000000220 R11: ffffb874001a48e8 R12: ffff995642473d40 [12335.689286] R13: ffff99564212c5b8 R14: ffff9956424736a0 R15: ffff995642120000 [12335.689303] FS: 0000000000000000(0000) GS:ffff995739000000(0000) knlGS:0000000000000000 [12335.689323] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [12335.689341] CR2: 00007f43c5d5e039 CR3: 000000011c012005 CR4: 00000000000606e0 [12335.689360] Call Trace: [12335.689377] [12335.689418] ? rcu_read_lock_held_common+0x12/0x50 [12335.689447] ? rcu_read_lock_sched_held+0x25/0x80 [12335.689471] ? rcu_read_lock_held_common+0x12/0x50 [12335.689504] ath11k_dp_rx_process_mon_rings+0x8d/0x4f0 [ath11k] [12335.689578] ? ath11k_dp_rx_process_mon_rings+0x8d/0x4f0 [ath11k] [12335.689653] ? lock_acquire+0xef/0x360 [12335.689681] ? rcu_read_lock_sched_held+0x25/0x80 [12335.689713] ath11k_dp_service_mon_ring+0x38/0x60 [ath11k] [12335.689784] ? ath11k_dp_rx_process_mon_rings+0x4f0/0x4f0 [ath11k] [12335.689860] call_timer_fn+0xb2/0x2f0 [12335.689897] ? ath11k_dp_rx_process_mon_rings+0x4f0/0x4f0 [ath11k] [12335.689970] run_timer_softirq+0x21f/0x540 [12335.689999] ? ktime_get+0xad/0x160 [12335.690025] ? lapic_next_deadline+0x2c/0x40 [12335.690053] ? clockevents_program_event+0x82/0x100 [12335.690093] __do_softirq+0x151/0x4a8 [12335.690135] irq_exit_rcu+0xc9/0x100 [12335.690165] sysvec_apic_timer_interrupt+0xa8/0xd0 [12335.690189] [12335.690204] [12335.690225] asm_sysvec_apic_timer_interrupt+0x12/0x20 Reset the default value to HAL_INVALID_PEERID each time after memset of ppdu_info as well as others memset which existed in function ath11k_dp_rx_process_mon_status(), then the failed log disappeared. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 01d2f285e3e5 ("ath11k: decode HE status tlv") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220518033556.31940-1-quic_wgong@quicinc.com commit 7855a6ed5cf77bf2ce4f5735103749b845489fa6 Author: Wen Gong Date: Mon Sep 19 16:06:03 2022 +0300 wifi: ath11k: change complete() to complete_all() for scan.completed Currently commit 1f682dc9fb37 ("ath11k: reduce the wait time of 11d scan and hw scan while add interface") introduced a wait_for_completion_timeout operation for ar->scan.completed, another one is existed in ath11k_scan_stop(), then ath11k has two places to wait for the ar->scan.completed and they run in different thread, thus it is possible to happend that the two thread both enter wait status. To handle this scenario, ath11k should change the complete() to complete_all() for the ar->scan.completed. This also work well when it is only one thread wait for ar->scan.completed. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220919024413.25083-1-quic_wgong@quicinc.com commit 65b94b527dfcb700b84d043c5bdf2924663724e7 Author: Zhou nan Date: Mon Sep 19 21:36:45 2022 -0400 md: Fix spelling mistake in comments of r5l_log Fix spelling of dones't in comments. Signed-off-by: Zhou nan Signed-off-by: Song Liu commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74 Author: Logan Gunthorpe Date: Wed Sep 21 10:28:37 2022 -0600 md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d A complicated deadlock exists when using the journal and an elevated group_thrtead_cnt. It was found with loop devices, but its not clear whether it can be seen with real disks. The deadlock can occur simply by writing data with an fio script. When the deadlock occurs, multiple threads will hang in different ways: 1) The group threads will hang in the blk-wbt code with bios waiting to be submitted to the block layer: io_schedule+0x70/0xb0 rq_qos_wait+0x153/0x210 wbt_wait+0x115/0x1b0 io_schedule+0x70/0xb0 rq_qos_wait+0x153/0x210 wbt_wait+0x115/0x1b0 __rq_qos_throttle+0x38/0x60 blk_mq_submit_bio+0x589/0xcd0 wbt_wait+0x115/0x1b0 __rq_qos_throttle+0x38/0x60 blk_mq_submit_bio+0x589/0xcd0 __submit_bio+0xe6/0x100 submit_bio_noacct_nocheck+0x42e/0x470 submit_bio_noacct+0x4c2/0xbb0 ops_run_io+0x46b/0x1a30 handle_stripe+0xcd3/0x36b0 handle_active_stripes.constprop.0+0x6f6/0xa60 raid5_do_work+0x177/0x330 Or: io_schedule+0x70/0xb0 rq_qos_wait+0x153/0x210 wbt_wait+0x115/0x1b0 __rq_qos_throttle+0x38/0x60 blk_mq_submit_bio+0x589/0xcd0 __submit_bio+0xe6/0x100 submit_bio_noacct_nocheck+0x42e/0x470 submit_bio_noacct+0x4c2/0xbb0 flush_deferred_bios+0x136/0x170 raid5_do_work+0x262/0x330 2) The r5l_reclaim thread will hang in the same way, submitting a bio to the block layer: io_schedule+0x70/0xb0 rq_qos_wait+0x153/0x210 wbt_wait+0x115/0x1b0 __rq_qos_throttle+0x38/0x60 blk_mq_submit_bio+0x589/0xcd0 __submit_bio+0xe6/0x100 submit_bio_noacct_nocheck+0x42e/0x470 submit_bio_noacct+0x4c2/0xbb0 submit_bio+0x3f/0xf0 md_super_write+0x12f/0x1b0 md_update_sb.part.0+0x7c6/0xff0 md_update_sb+0x30/0x60 r5l_do_reclaim+0x4f9/0x5e0 r5l_reclaim_thread+0x69/0x30b However, before hanging, the MD_SB_CHANGE_PENDING flag will be set for sb_flags in r5l_write_super_and_discard_space(). This flag will never be cleared because the submit_bio() call never returns. 3) Due to the MD_SB_CHANGE_PENDING flag being set, handle_stripe() will do no processing on any pending stripes and re-set STRIPE_HANDLE. This will cause the raid5d thread to enter an infinite loop, constantly trying to handle the same stripes stuck in the queue. The raid5d thread has a blk_plug that holds a number of bios that are also stuck waiting seeing the thread is in a loop that never schedules. These bios have been accounted for by blk-wbt thus preventing the other threads above from continuing when they try to submit bios. --Deadlock. To fix this, add the same wait_event() that is used in raid5_do_work() to raid5d() such that if MD_SB_CHANGE_PENDING is set, the thread will schedule and wait until the flag is cleared. The schedule action will flush the plug which will allow the r5l_reclaim thread to continue, thus preventing the deadlock. However, md_check_recovery() calls can also clear MD_SB_CHANGE_PENDING from the same thread and can thus deadlock if the thread is put to sleep. So avoid waiting if md_check_recovery() is being called in the loop. It's not clear when the deadlock was introduced, but the similar wait_event() call in raid5_do_work() was added in 2017 by this commit: 16d997b78b15 ("md/raid5: simplfy delaying of writes while metadata is updated.") Link: https://lore.kernel.org/r/7f3b87b6-b52a-f737-51d7-a4eec5c44112@deltatee.com Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit 74173ff458de5841d7fa4c6fcc85011daa21adf5 Merge: 3bfc3bcd787c4 b9b083f9044ab Author: Song Liu Date: Mon Sep 19 11:42:07 2022 -0700 Merge branch 'md-next-raid10-optimize' into md-next This patchset tries to avoid that two locks are held unconditionally in hot path. Test environment: Architecture: aarch64 Huawei KUNPENG 920 x86 Intel(R) Xeon(R) Platinum 8380 Raid10 initialize: mdadm --create /dev/md0 --level 10 --bitmap none --raid-devices 4 \ /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 Test cmd: (task set -c 0-15) fio -name=0 -ioengine=libaio -direct=1 -\ group_reporting=1 -randseed=2022 -rwmixread=70 -refill_buffers \ -filename=/dev/md0 -numjobs=16 -runtime=60s -bs=4k -iodepth=256 \ -rw=randread Test result: aarch64: before this patchset: 3.2 GiB/s bind node before this patchset: 6.9 Gib/s after this patchset: 7.9 Gib/s bind node after this patchset: 8.0 Gib/s x86:(bind node is not tested yet) before this patchset: 7.0 GiB/s after this patchset : 9.3 GiB/s Please noted that in the test machine, memory access latency is very bad across nodes compare to local node in aarch64, which is why bandwidth while bind node is much better. commit b9b083f9044abf89f3391fbc196ddece68ac9dba Author: Yu Kuai Date: Fri Sep 16 19:34:28 2022 +0800 md/raid10: convert resync_lock to use seqlock Currently, wait_barrier() will hold 'resync_lock' to read 'conf->barrier', and io can't be dispatched until 'barrier' is dropped. Since holding the 'barrier' is not common, convert 'resync_lock' to use seqlock so that holding lock can be avoided in fast path. Signed-off-by: Yu Kuai Reviewed-and-Tested-by: Logan Gunthorpe Signed-off-by: Song Liu commit 4f350284a7306b3dff676caeafd3faf1b5c068d5 Author: Yu Kuai Date: Fri Sep 16 19:34:27 2022 +0800 md/raid10: fix improper BUG_ON() in raise_barrier() 'conf->barrier' is protected by 'conf->resync_lock', reading 'conf->barrier' without holding the lock is wrong. Signed-off-by: Yu Kuai Reviewed-by: Logan Gunthorpe Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit 0c0be98bbe67662a7d2bf8381106bfca0e31ed72 Author: Yu Kuai Date: Fri Sep 16 19:34:26 2022 +0800 md/raid10: prevent unnecessary calls to wake_up() in fast path Currently, wake_up() is called unconditionally in fast path such as raid10_make_request(), which will cause lock contention under high concurrency: raid10_make_request wake_up __wake_up_common_lock spin_lock_irqsave Improve performance by only call wake_up() if waitqueue is not empty in allow_barrier() and raid10_make_request(). Signed-off-by: Yu Kuai Reviewed-by: Logan Gunthorpe Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit 0de57e541bb4207c0602eca271c6531c305e9c5d Author: Yu Kuai Date: Fri Sep 16 19:34:25 2022 +0800 md/raid10: don't modify 'nr_waitng' in wait_barrier() for the case nowait For the case nowait in wait_barrier(), there is no point to increase nr_waiting and then decrease it. Signed-off-by: Yu Kuai Reviewed-by: Logan Gunthorpe Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit ed2e063f92c44c891ccd883e289dde6ca870edcc Author: Yu Kuai Date: Fri Sep 16 19:34:24 2022 +0800 md/raid10: factor out code from wait_barrier() to stop_waiting_barrier() Currently the nasty condition in wait_barrier() is hard to read. This patch factors out the condition into a function. There are no functional changes. Signed-off-by: Yu Kuai Acked-by: Paul Menzel Reviewed-by: Logan Gunthorpe Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit 3bfc3bcd787c48aa31e4fde4a6dfcef4cd7ee2c2 Author: Logan Gunthorpe Date: Thu Sep 8 10:15:15 2022 -0600 md: Remove extra mddev_get() in md_seq_start() A regression is seen where mddev devices stay permanently after they are stopped due to an elevated reference count. This was tracked down to an extra mddev_get() in md_seq_start(). It only happened rarely because most of the time the md_seq_start() is called with a zero offset. The path with an extra mddev_get() only happens when it starts with a non-zero offset. The commit noted below changed an mddev_get() to check its success but inadvertently left the original call in. Remove the extra call. Fixes: 12a6caf27324 ("md: only delete entries from all_mddevs when the disk is freed") Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit c66a6f41e09ad386fd2cce22b9cded837bbbc704 Author: David Sloan Date: Thu Sep 8 10:15:14 2022 -0600 md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk() When running chunk-sized reads on disks with badblocks duplicate bio free/puts are observed: ============================================================================= BUG bio-200 (Not tainted): Object already free ----------------------------------------------------------------------------- Allocated in mempool_alloc_slab+0x17/0x20 age=3 cpu=2 pid=7504 __slab_alloc.constprop.0+0x5a/0xb0 kmem_cache_alloc+0x31e/0x330 mempool_alloc_slab+0x17/0x20 mempool_alloc+0x100/0x2b0 bio_alloc_bioset+0x181/0x460 do_mpage_readpage+0x776/0xd00 mpage_readahead+0x166/0x320 blkdev_readahead+0x15/0x20 read_pages+0x13f/0x5f0 page_cache_ra_unbounded+0x18d/0x220 force_page_cache_ra+0x181/0x1c0 page_cache_sync_ra+0x65/0xb0 filemap_get_pages+0x1df/0xaf0 filemap_read+0x1e1/0x700 blkdev_read_iter+0x1e5/0x330 vfs_read+0x42a/0x570 Freed in mempool_free_slab+0x17/0x20 age=3 cpu=2 pid=7504 kmem_cache_free+0x46d/0x490 mempool_free_slab+0x17/0x20 mempool_free+0x66/0x190 bio_free+0x78/0x90 bio_put+0x100/0x1a0 raid5_make_request+0x2259/0x2450 md_handle_request+0x402/0x600 md_submit_bio+0xd9/0x120 __submit_bio+0x11f/0x1b0 submit_bio_noacct_nocheck+0x204/0x480 submit_bio_noacct+0x32e/0xc70 submit_bio+0x98/0x1a0 mpage_readahead+0x250/0x320 blkdev_readahead+0x15/0x20 read_pages+0x13f/0x5f0 page_cache_ra_unbounded+0x18d/0x220 Slab 0xffffea000481b600 objects=21 used=0 fp=0xffff8881206d8940 flags=0x17ffffc0010201(locked|slab|head|node=0|zone=2|lastcpupid=0x1fffff) CPU: 0 PID: 34525 Comm: kworker/u24:2 Not tainted 6.0.0-rc2-localyes-265166-gf11c5343fa3f #143 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Workqueue: raid5wq raid5_do_work Call Trace: dump_stack_lvl+0x5a/0x78 dump_stack+0x10/0x16 print_trailer+0x158/0x165 object_err+0x35/0x50 free_debug_processing.cold+0xb7/0xbe __slab_free+0x1ae/0x330 kmem_cache_free+0x46d/0x490 mempool_free_slab+0x17/0x20 mempool_free+0x66/0x190 bio_free+0x78/0x90 bio_put+0x100/0x1a0 mpage_end_io+0x36/0x150 bio_endio+0x2fd/0x360 md_end_io_acct+0x7e/0x90 bio_endio+0x2fd/0x360 handle_failed_stripe+0x960/0xb80 handle_stripe+0x1348/0x3760 handle_active_stripes.constprop.0+0x72a/0xaf0 raid5_do_work+0x177/0x330 process_one_work+0x616/0xb20 worker_thread+0x2bd/0x6f0 kthread+0x179/0x1b0 ret_from_fork+0x22/0x30 The double free is caused by an unnecessary bio_put() in the if(is_badblock(...)) error path in raid5_read_one_chunk(). The error path was moved ahead of bio_alloc_clone() in c82aa1b76787c ("md/raid5: move checking badblock before clone bio in raid5_read_one_chunk"). The previous code checked and freed align_bio which required a bio_put. After the move that is no longer needed as raid_bio is returned to the control of the common io path which performs its own endio resulting in a double free on bad device blocks. Fixes: c82aa1b76787c ("md/raid5: move checking badblock before clone bio in raid5_read_one_chunk") Signed-off-by: David Sloan Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Acked-by: Guoqing Jiang Signed-off-by: Song Liu commit e2eed85bc75138a9eeb63863d20f8904ac42a577 Author: Logan Gunthorpe Date: Thu Aug 25 09:46:27 2022 -0600 md/raid5: Ensure stripe_fill happens on non-read IO with journal When doing degrade/recover tests using the journal a kernel BUG is hit at drivers/md/raid5.c:4381 in handle_parity_checks5(): BUG_ON(!test_bit(R5_UPTODATE, &dev->flags)); This was found to occur because handle_stripe_fill() was skipped for stripes in the journal due to a condition in that function. Thus blocks were not fetched and R5_UPTODATE was not set when the code reached handle_parity_checks5(). To fix this, don't skip handle_stripe_fill() unless the stripe is for read. Fixes: 07e83364845e ("md/r5cache: shift complex rmw from read path to write path") Link: https://lore.kernel.org/linux-raid/e05c4239-41a9-d2f7-3cfa-4aa9d2cea8c1@deltatee.com/ Suggested-by: Song Liu Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit f9287c3e93f00d3236c4c81bf76dae43afd903b9 Author: Logan Gunthorpe Date: Thu Aug 11 11:14:17 2022 -0600 md/raid5: Don't read ->active_stripes if it's not needed The atomic_read() is not needed in many cases so only do the read after the first checks are done. Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit 2f2d51efd83225c1eb0d7771ddfe9fddd5ccd378 Author: Logan Gunthorpe Date: Thu Aug 11 11:14:16 2022 -0600 md/raid5: Cleanup prototype of raid5_get_active_stripe() Drop the three bools in the prototype of raid5_get_active_stripe() and replace them with a flags parameter. At the same time, drop the distinction with __raid5_get_active_stripe(). Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit 9892fa993f8a8e716f39266b24d6218d8333ff89 Author: Logan Gunthorpe Date: Thu Aug 11 11:14:15 2022 -0600 md/raid5: Drop extern on function declarations in raid5.h externs should not be used in function declarations, so clean those up. Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit b6d56144fe902c2b7b9a3573aaf6aa7dc5366211 Author: Logan Gunthorpe Date: Thu Aug 11 11:14:14 2022 -0600 md/raid5: Refactor raid5_get_active_stripe() Refactor raid5_get_active_stripe() without the gotos with an explicit infinite loop and some additional nesting. Suggested-by: Christoph Hellwig Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu commit 1727fd5015d8f93474148f94e34cda5aa6ad4a43 Author: Saurabh Sengar Date: Tue Aug 23 11:51:04 2022 -0700 md: Replace snprintf with scnprintf Current code produces a warning as shown below when total characters in the constituent block device names plus the slashes exceeds 200. snprintf() returns the number of characters generated from the given input, which could cause the expression “200 – len” to wrap around to a large positive number. Fix this by using scnprintf() instead, which returns the actual number of characters written into the buffer. [ 1513.267938] ------------[ cut here ]------------ [ 1513.267943] WARNING: CPU: 15 PID: 37247 at /lib/vsprintf.c:2509 vsnprintf+0x2c8/0x510 [ 1513.267944] Modules linked in: [ 1513.267969] CPU: 15 PID: 37247 Comm: mdadm Not tainted 5.4.0-1085-azure #90~18.04.1-Ubuntu [ 1513.267969] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 05/09/2022 [ 1513.267971] RIP: 0010:vsnprintf+0x2c8/0x510 <-snip-> [ 1513.267982] Call Trace: [ 1513.267986] snprintf+0x45/0x70 [ 1513.267990] ? disk_name+0x71/0xa0 [ 1513.267993] dump_zones+0x114/0x240 [raid0] [ 1513.267996] ? _cond_resched+0x19/0x40 [ 1513.267998] raid0_run+0x19e/0x270 [raid0] [ 1513.268000] md_run+0x5e0/0xc50 [ 1513.268003] ? security_capable+0x3f/0x60 [ 1513.268005] do_md_run+0x19/0x110 [ 1513.268006] md_ioctl+0x195e/0x1f90 [ 1513.268007] blkdev_ioctl+0x91f/0x9f0 [ 1513.268010] block_ioctl+0x3d/0x50 [ 1513.268012] do_vfs_ioctl+0xa9/0x640 [ 1513.268014] ? __fput+0x162/0x260 [ 1513.268016] ksys_ioctl+0x75/0x80 [ 1513.268017] __x64_sys_ioctl+0x1a/0x20 [ 1513.268019] do_syscall_64+0x5e/0x200 [ 1513.268021] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 766038846e875 ("md/raid0: replace printk() with pr_*()") Reviewed-by: Michael Kelley Acked-by: Guoqing Jiang Signed-off-by: Saurabh Sengar Signed-off-by: Song Liu commit 62bca04bb7dd7eaa5c2daf36b1ca9ab8a1fb71a2 Author: Guoqing Jiang Date: Mon Aug 22 15:45:39 2022 +0800 md/raid10: fix compile warning With W=1, compiler complains. drivers/md/raid10.c:1983: warning: bad line: Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 12ba6676b9254bc5a555f1c52f9c0516e86392b7 Author: XU pengfei Date: Wed Aug 17 17:21:40 2022 +0800 md/raid5: Fix spelling mistakes in comments Fix spelling of 'waitting' in comments. Signed-off-by: XU pengfei Signed-off-by: Song Liu commit aa7a5f946f5baa9209e44aeb1063316a27ad29c8 Merge: 5f606b3e11250 32fed4706d9ac Author: Kalle Valo Date: Thu Sep 22 09:14:33 2022 +0300 Merge tag 'iwlwifi-next-for-kalle-2022-09-18' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next iwlwifi patches for v6.1 commit 5f606b3e11250f352d245bfa7fb16a1a0a17b7a8 Merge: 2e405cff04ecd cb74c8f8dbb10 Author: Kalle Valo Date: Thu Sep 22 09:13:17 2022 +0300 Merge tag 'mt76-for-kvalo-2022-09-15' of https://github.com/nbd168/wireless mt76 patches for 6.1 - fixes - suspend/resume improvements - tx status reporting improvements commit 2e405cff04ecd633285cc2051699383d535b3912 Author: Ching-Te Ku Date: Tue Sep 20 09:09:39 2022 +0800 wifi: rtw89: coex: update coexistence to 6.3.0 Since we maintain coexistence as shared code, so move coexistence version from chip specific attribute to a definition. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-10-pkshih@realtek.com commit 4d5468c63f354e02fb67f86b0e4c0be3938996bf Author: Ching-Te Ku Date: Tue Sep 20 09:09:38 2022 +0800 wifi: rtw89: coex: add logic to control BT scan priority Add control logic to operate Wi-Fi to BT scoreboard to control BT scan priority. And patch mechanism parameter to enhance Wi-Fi throughput while coexisting with BT profile & BT scan. Set PTA priority let Wi-Fi BT can RX at the same time. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-9-pkshih@realtek.com commit ba297a2556c57f9e0bce5e5cac0cbc6a5b32bfc1 Author: Ching-Te Ku Date: Tue Sep 20 09:09:37 2022 +0800 wifi: rtw89: coex: summarize Wi-Fi to BT scoreboard and inform BT one time a cycle If Wi-Fi driver send Wi-Fi status to BT via scoreboard too frequent in a short moment, BT will loss some of them because of hardware response time. To avoid this issue, change the code flow. Summarize the scoreboard changes and if the value have changed, send the scoreboard to BT only once in a coexistence processing cycle. It also can help to reduce driver I/O. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-8-pkshih@realtek.com commit f2fe93b387cf2713a5d1e088ebcc86617da4c8d7 Author: Ching-Te Ku Date: Tue Sep 20 09:09:36 2022 +0800 wifi: rtw89: coex: modify LNA2 setting to avoid BT destroyed Wi-Fi aggregation To prevent LNA2 change its gain during a Wi-Fi aggregation packet while GNT_BT pull high. Otherwise, changes of this gain will destroy the whole aggregation when Wi-Fi RX. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-7-pkshih@realtek.com commit 4e924c8b8ca8d83575c7ca6ae0cb3a3dde6276da Author: Ching-Te Ku Date: Tue Sep 20 09:09:35 2022 +0800 wifi: rtw89: coex: add WL_S0 hardware TX/RX mask to allow WL_S0 TX/RX during GNT_BT WiFi/BT combo module could only have two antenna, namely WL_S0 and WL_S1. WiFi can use two antenna to TX/RX 2SS data, and BT can share one of the antenna. This patch is to allow WiFi to TX/RX 1SS data like ACK/RTS/CTS to improve Wi-Fi performance while coexisting with Bluetooth. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-6-pkshih@realtek.com commit b696d42205db5be41ec18338c9e77d546b3112d1 Author: Ching-Te Ku Date: Tue Sep 20 09:09:34 2022 +0800 wifi: rtw89: coex: add v1 Wi-Fi firmware steps report This report is to record firmware call flow like notify events, and take actions. This can help to address if firmware flow is in expectation. Implement v1 parser to support 8852CE firmware report. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-5-pkshih@realtek.com commit 3f386573d4900ef5c20171797194ece9306e3e95 Author: Ching-Te Ku Date: Tue Sep 20 09:09:33 2022 +0800 wifi: rtw89: coex: add v1 summary info to parse the traffic status from firmware This debug entry is to summarize important messages to quickly address problem types, such as firmware hang, C2H/H2C stuck, or too much occupation of BT A2DP. If unexpected something is addressed, we can dig the problem via other debug messages that provide more detail information. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-4-pkshih@realtek.com commit 7d42efcaea212c5ad6b9d50d289d59d52df16be8 Author: Ching-Te Ku Date: Tue Sep 20 09:09:32 2022 +0800 wifi: rtw89: coex: translate slot ID to readable name To analyze debug log quickly, use readable name in string format instead. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-3-pkshih@realtek.com commit 0d7b3a83c034de29511069f7cd39cf9992b9be44 Author: Ching-Te Ku Date: Tue Sep 20 09:09:31 2022 +0800 wifi: rtw89: coex: add v1 cycle report to parsing Bluetooth A2DP status 'cysta' is short for statistics for cycles. That is a circular buffer to record snapshot status including beacon count, RX count, TX count etc. Since 8852CE Wi-Fi firmware report this statistics in different format, add v1 parser by this patch. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220920010939.12173-2-pkshih@realtek.com commit 4cf4cf6eb0bfceae2f61a7a724d576684f788ea6 Author: Johannes Berg Date: Sun Sep 4 21:29:07 2022 +0200 wifi: mwifiex: fix array of flexible structures warnings There are two, just change them to have a "u8 data[]" type member, and add casts where needed. No binary changes. Signed-off-by: Johannes Berg Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.2c885310ebee.If7177ea588b56c405eee6e6df595e9efccdfb99a@changeid commit c70a9d6783cf51cbd7c3241fec6a5ac24d99b79d Author: Johannes Berg Date: Sun Sep 4 21:29:04 2022 +0200 wifi: rndis_wlan: fix array of flexible structures warning Use "u8 bssid_data[]" with an appropriate cast. No binary changes. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.0e7ce5fdbcfb.I972158734def3f93b93a3858a087cbc2cca6337e@changeid commit 28255dd9a8deb0cb73498d4770d1f5242fa498c8 Author: Johannes Berg Date: Sun Sep 4 21:29:02 2022 +0200 wifi: ipw2x00: fix array of flexible structures warnings There are a number of these here, fix them by using appropriate casts. No binary changes. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.645346411660.I471e8fadce54ea262920828f25b8e84545bcd07e@changeid commit 551e4745c7f218da7070b36a06318592913676ff Author: Duoming Zhou Date: Tue Aug 23 19:21:27 2022 +0800 mwifiex: fix sleep in atomic context bugs caused by dev_coredumpv There are sleep in atomic context bugs when uploading device dump data in mwifiex. The root cause is that dev_coredumpv could not be used in atomic contexts, because it calls dev_set_name which include operations that may sleep. The call tree shows execution paths that could lead to bugs: (Interrupt context) fw_dump_timer_fn mwifiex_upload_device_dump dev_coredumpv(..., GFP_KERNEL) dev_coredumpm() kzalloc(sizeof(*devcd), gfp); //may sleep dev_set_name kobject_set_name_vargs kvasprintf_const(GFP_KERNEL, ...); //may sleep kstrdup(s, GFP_KERNEL); //may sleep The corresponding fail log is shown below: [ 135.275938] usb 1-1: == mwifiex dump information to /sys/class/devcoredump start [ 135.281029] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 ... [ 135.293613] Call Trace: [ 135.293613] [ 135.293613] dump_stack_lvl+0x57/0x7d [ 135.293613] __might_resched.cold+0x138/0x173 [ 135.293613] ? dev_coredumpm+0xca/0x2e0 [ 135.293613] kmem_cache_alloc_trace+0x189/0x1f0 [ 135.293613] ? devcd_match_failing+0x30/0x30 [ 135.293613] dev_coredumpm+0xca/0x2e0 [ 135.293613] ? devcd_freev+0x10/0x10 [ 135.293613] dev_coredumpv+0x1c/0x20 [ 135.293613] ? devcd_match_failing+0x30/0x30 [ 135.293613] mwifiex_upload_device_dump+0x65/0xb0 [ 135.293613] ? mwifiex_dnld_fw+0x1b0/0x1b0 [ 135.293613] call_timer_fn+0x122/0x3d0 [ 135.293613] ? msleep_interruptible+0xb0/0xb0 [ 135.293613] ? lock_downgrade+0x3c0/0x3c0 [ 135.293613] ? __next_timer_interrupt+0x13c/0x160 [ 135.293613] ? lockdep_hardirqs_on_prepare+0xe/0x220 [ 135.293613] ? mwifiex_dnld_fw+0x1b0/0x1b0 [ 135.293613] __run_timers.part.0+0x3f8/0x540 [ 135.293613] ? call_timer_fn+0x3d0/0x3d0 [ 135.293613] ? arch_restore_msi_irqs+0x10/0x10 [ 135.293613] ? lapic_next_event+0x31/0x40 [ 135.293613] run_timer_softirq+0x4f/0xb0 [ 135.293613] __do_softirq+0x1c2/0x651 ... [ 135.293613] RIP: 0010:default_idle+0xb/0x10 [ 135.293613] RSP: 0018:ffff888006317e68 EFLAGS: 00000246 [ 135.293613] RAX: ffffffff82ad8d10 RBX: ffff888006301cc0 RCX: ffffffff82ac90e1 [ 135.293613] RDX: ffffed100d9ff1b4 RSI: ffffffff831ad140 RDI: ffffffff82ad8f20 [ 135.293613] RBP: 0000000000000003 R08: 0000000000000000 R09: ffff88806cff8d9b [ 135.293613] R10: ffffed100d9ff1b3 R11: 0000000000000001 R12: ffffffff84593410 [ 135.293613] R13: 0000000000000000 R14: 0000000000000000 R15: 1ffff11000c62fd2 ... [ 135.389205] usb 1-1: == mwifiex dump information to /sys/class/devcoredump end This patch uses delayed work to replace timer and moves the operations that may sleep into a delayed work in order to mitigate bugs, it was tested on Marvell 88W8801 chip whose port is usb and the firmware is usb8801_uapsta.bin. The following is the result after using delayed work to replace timer. [ 134.936453] usb 1-1: == mwifiex dump information to /sys/class/devcoredump start [ 135.043344] usb 1-1: == mwifiex dump information to /sys/class/devcoredump end As we can see, there is no bug now. Fixes: f5ecd02a8b20 ("mwifiex: device dump support for usb interface") Signed-off-by: Duoming Zhou Reviewed-by: Brian Norris Acked-by: Greg Kroah-Hartman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/5cfa5c473ff6d069cb67760ffa04a2f84ef450a8.1661252818.git.duoming@zju.edu.cn commit 1cf9a3ae3e2de359471a7036f48ac59e48b15256 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:06 2022 +0200 xfrm: add extack support to xfrm_init_replay Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 741f9a1064985512567eca1552643738ecfb5cc5 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:05 2022 +0200 xfrm: add extack to __xfrm_init_state Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 2b9168266d15dbb4b083b52e775c0399db427d4c Author: Sabrina Dubroca Date: Wed Sep 14 19:04:04 2022 +0200 xfrm: add extack to attach_* Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit adb5c33e4d4c83fb848a402e2191fbf3e2bf50d1 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:03 2022 +0200 xfrm: add extack support to xfrm_dev_state_add Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 1fc8fde553917bca7c9b65fafb045a2a5c97e683 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:02 2022 +0200 xfrm: add extack to verify_one_alg, verify_auth_trunc, verify_aead Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 785b87b220859170d8ca0e95c6396c7cfadce627 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:01 2022 +0200 xfrm: add extack to verify_replay Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 6999aae17a7b66c56e6cc8e05b3cd51718c3bfe3 Author: Sabrina Dubroca Date: Wed Sep 14 19:04:00 2022 +0200 xfrm: add extack support to verify_newsa_info Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 0e91fc1e0f5c70ce575451103ec66c2ec21f1a6e Author: Christoph Hellwig Date: Thu Sep 1 12:32:08 2022 -0700 fscrypt: work on block_devices instead of request_queues request_queues are a block layer implementation detail that should not leak into file systems. Change the fscrypt inline crypto code to retrieve block devices instead of request_queues from the file system. As part of that, clean up the interaction with multi-device file systems by returning both the number of devices and the actual device array in a single method call. Signed-off-by: Christoph Hellwig [ebiggers: bug fixes and minor tweaks] Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220901193208.138056-4-ebiggers@kernel.org commit 22e9947a4b2ba255888541bd0111cf00b9b16586 Author: Eric Biggers Date: Thu Sep 1 12:32:07 2022 -0700 fscrypt: stop holding extra request_queue references Now that the fscrypt_master_key lifetime has been reworked to not be subject to the quirks of the keyrings subsystem, blk_crypto_evict_key() no longer gets called after the filesystem has already been unmounted. Therefore, there is no longer any need to hold extra references to the filesystem's request_queue(s). (And these references didn't always do their intended job anyway, as pinning a request_queue doesn't necessarily pin the corresponding blk_crypto_profile.) Stop taking these extra references. Instead, just pass the super_block to fscrypt_destroy_inline_crypt_key(), and use it to get the list of block devices the key needs to be evicted from. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220901193208.138056-3-ebiggers@kernel.org commit d7e7b9af104c7b389a0c21eb26532511bce4b510 Author: Eric Biggers Date: Thu Sep 1 12:32:06 2022 -0700 fscrypt: stop using keyrings subsystem for fscrypt_master_key The approach of fs/crypto/ internally managing the fscrypt_master_key structs as the payloads of "struct key" objects contained in a "struct key" keyring has outlived its usefulness. The original idea was to simplify the code by reusing code from the keyrings subsystem. However, several issues have arisen that can't easily be resolved: - When a master key struct is destroyed, blk_crypto_evict_key() must be called on any per-mode keys embedded in it. (This started being the case when inline encryption support was added.) Yet, the keyrings subsystem can arbitrarily delay the destruction of keys, even past the time the filesystem was unmounted. Therefore, currently there is no easy way to call blk_crypto_evict_key() when a master key is destroyed. Currently, this is worked around by holding an extra reference to the filesystem's request_queue(s). But it was overlooked that the request_queue reference is *not* guaranteed to pin the corresponding blk_crypto_profile too; for device-mapper devices that support inline crypto, it doesn't. This can cause a use-after-free. - When the last inode that was using an incompletely-removed master key is evicted, the master key removal is completed by removing the key struct from the keyring. Currently this is done via key_invalidate(). Yet, key_invalidate() takes the key semaphore. This can deadlock when called from the shrinker, since in fscrypt_ioctl_add_key(), memory is allocated with GFP_KERNEL under the same semaphore. - More generally, the fact that the keyrings subsystem can arbitrarily delay the destruction of keys (via garbage collection delay, or via random processes getting temporary key references) is undesirable, as it means we can't strictly guarantee that all secrets are ever wiped. - Doing the master key lookups via the keyrings subsystem results in the key_permission LSM hook being called. fscrypt doesn't want this, as all access control for encrypted files is designed to happen via the files themselves, like any other files. The workaround which SELinux users are using is to change their SELinux policy to grant key search access to all domains. This works, but it is an odd extra step that shouldn't really have to be done. The fix for all these issues is to change the implementation to what I should have done originally: don't use the keyrings subsystem to keep track of the filesystem's fscrypt_master_key structs. Instead, just store them in a regular kernel data structure, and rework the reference counting, locking, and lifetime accordingly. Retain support for RCU-mode key lookups by using a hash table. Replace fscrypt_sb_free() with fscrypt_sb_delete(), which releases the keys synchronously and runs a bit earlier during unmount, so that block devices are still available. A side effect of this patch is that neither the master keys themselves nor the filesystem keyrings will be listed in /proc/keys anymore. ("Master key users" and the master key users keyrings will still be listed.) However, this was mostly an implementation detail, and it was intended just for debugging purposes. I don't know of anyone using it. This patch does *not* change how "master key users" (->mk_users) works; that still uses the keyrings subsystem. That is still needed for key quotas, and changing that isn't necessary to solve the issues listed above. If we decide to change that too, it would be a separate patch. I've marked this as fixing the original commit that added the fscrypt keyring, but as noted above the most important issue that this patch fixes wasn't introduced until the addition of inline encryption support. Fixes: 22d94f493bfb ("fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl") Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220901193208.138056-2-ebiggers@kernel.org commit 1b64daf413acd86c2c13f5443f6b4ef3690c8061 Author: Kees Cook Date: Wed Sep 7 15:41:03 2022 -0700 ARM: decompressor: Include .data.rel.ro.local The .data.rel.ro.local section has the same semantics as .data.rel.ro here, so include it in the .rodata section of the decompressor. Additionally since the .printk_index section isn't usable outside of the core kernel, discard it in the decompressor. Avoids these warnings: arm-linux-gnueabi-ld: warning: orphan section `.data.rel.ro.local' from `arch/arm/boot/compressed/fdt_rw.o' being placed in section `.data.rel.ro.local' arm-linux-gnueabi-ld: warning: orphan section `.printk_index' from `arch/arm/boot/compressed/fdt_rw.o' being placed in section `.printk_index' Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202209080545.qMIVj7YM-lkp@intel.com Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook commit 020e2176b23e42c863cc06f3fb626b158ce40b74 Merge: 2d863b14fbd97 bde4a96cdcadc Author: Alexei Starovoitov Date: Wed Sep 21 19:41:37 2022 -0700 Merge branch 'veristat: CSV output, comparison mode, filtering' Andrii Nakryiko says: ==================== Add three more critical features to veristat tool, which make it sufficient for a practical work on BPF verifier: - CSV output, which allows easier programmatic post-processing of stats; - building upon CSV output, veristat now supports comparison mode, in which two previously captured CSV outputs from veristat are compared with each other in a convenient form; - flexible allow/deny filtering using globs for BPF object files and programs, allowing to narrow down target BPF programs to be verified. See individual patches for more details and examples. v1->v2: - split out double-free fix into patch #1 (Yonghong); - fixed typo in verbose flag (Quentin); - baseline and comparison stats were reversed in output table, fixed that. ==================== Signed-off-by: Alexei Starovoitov commit bde4a96cdcadc1f9c92cc2715a0022545bfb3201 Author: Andrii Nakryiko Date: Wed Sep 21 09:42:54 2022 -0700 selftests/bpf: add ability to filter programs in veristat Add -f (--filter) argument which accepts glob-based filters for narrowing down what BPF object files and programs within them should be processed by veristat. This filtering applies both to comparison and main (verification) mode. Filter can be of two forms: - file (object) filter: 'strobemeta*'; in this case all the programs within matching files are implicitly allowed (or denied, depending if it's positive or negative rule, see below); - file and prog filter: 'strobemeta*/*unroll*' will further filter programs within matching files to only allow those program names that match '*unroll*' glob. As mentioned, filters can be positive (allowlisting) and negative (denylisting). Negative filters should start with '!': '!strobemeta*' will deny any filename which basename starts with "strobemeta". Further, one extra special syntax is supported to allow more convenient use in practice. Instead of specifying rule on the command line, veristat allows to specify file that contains rules, both positive and negative, one line per one filter. This is achieved with -f @ use, where points to a text file containing rules (negative and positive rules can be mixed). For convenience empty lines and lines starting with '#' are ignored. This feature is useful to have some pre-canned list of object files and program names that are tested repeatedly, allowing to check in a list of rules and quickly specify them on the command line. As a demonstration (and a short cut for nearest future), create a small list of "interesting" BPF object files from selftests/bpf and commit it as veristat.cfg. It currently includes 73 programs, most of which are the most complex and largest BPF programs in selftests, as judged by total verified instruction count and verifier states total. If there is overlap between positive or negative filters, negative filter takes precedence (denylisting is stronger than allowlisting). If no allow filter is specified, veristat implicitly assumes '*/*' rule. If no deny rule is specified, veristat (logically) assumes no negative filters. Also note that -f (just like -e and -s) can be specified multiple times and their effect is cumulative. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220921164254.3630690-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 394169b079b558cf91a9c23ffb6b55c14cd927e1 Author: Andrii Nakryiko Date: Wed Sep 21 09:42:53 2022 -0700 selftests/bpf: add comparison mode to veristat Add ability to compare and contrast two veristat runs, previously recorded with veristat using CSV output format. When veristat is called with -C (--compare) flag, veristat expects exactly two input files specified, both should be in CSV format. Expectation is that it's output from previous veristat runs, but as long as column names and formats match, it should just work. First CSV file is designated as a "baseline" provided, and the second one is comparison (experiment) data set. Establishing baseline matters later when calculating difference percentages, see below. Veristat parses these two CSV files and "reconstructs" verifier stats (it could be just a subset of all possible stats). File and program names are mandatory as they are used as joining key (these two "stats" are designated as "key stats" in the code). Veristat currently enforces that the set of stats recorded in both CSV has to exactly match, down to exact order. This is just a simplifying condition which can be lifted with a bit of additional pre-processing to reorded stat specs internally, which I didn't bother doing, yet. For all the non-key stats, veristat will output three columns: one for baseline data, one for comparison data, and one with an absolute and relative percentage difference. If either baseline or comparison values are missing (that is, respective CSV file doesn't have a row with *exactly* matching file and program name), those values are assumed to be empty or zero. In such case relative percentages are forced to +100% or -100% output, for consistency with a typical case. Veristat's -e (--emit) and -s (--sort) specs still apply, so even if CSV contains lots of stats, user can request to compare only a subset of them (and specify desired column order as well). Similarly, both CSV and human-readable table output is honored. Note that input is currently always expected to be CSV. Here's an example shell session, recording data for biosnoop tool on two different kernels and comparing them afterwards, outputting data in table format. # on slightly older production kernel $ sudo ./veristat biosnoop_bpf.o File Program Verdict Duration (us) Total insns Total states Peak states -------------- ------------------------ ------- ------------- ----------- ------------ ----------- biosnoop_bpf.o blk_account_io_merge_bio success 37 24 1 1 biosnoop_bpf.o blk_account_io_start failure 0 0 0 0 biosnoop_bpf.o block_rq_complete success 76 104 6 6 biosnoop_bpf.o block_rq_insert success 83 85 7 7 biosnoop_bpf.o block_rq_issue success 79 85 7 7 -------------- ------------------------ ------- ------------- ----------- ------------ ----------- Done. Processed 1 object files, 5 programs. $ sudo ./veristat ~/local/tmp/fbcode-bpf-objs/biosnoop_bpf.o -o csv > baseline.csv $ cat baseline.csv file_name,prog_name,verdict,duration,total_insns,total_states,peak_states biosnoop_bpf.o,blk_account_io_merge_bio,success,36,24,1,1 biosnoop_bpf.o,blk_account_io_start,failure,0,0,0,0 biosnoop_bpf.o,block_rq_complete,success,82,104,6,6 biosnoop_bpf.o,block_rq_insert,success,78,85,7,7 biosnoop_bpf.o,block_rq_issue,success,74,85,7,7 # on latest bpf-next kernel $ sudo ./veristat biosnoop_bpf.o File Program Verdict Duration (us) Total insns Total states Peak states -------------- ------------------------ ------- ------------- ----------- ------------ ----------- biosnoop_bpf.o blk_account_io_merge_bio success 31 24 1 1 biosnoop_bpf.o blk_account_io_start failure 0 0 0 0 biosnoop_bpf.o block_rq_complete success 76 104 6 6 biosnoop_bpf.o block_rq_insert success 83 91 7 7 biosnoop_bpf.o block_rq_issue success 74 91 7 7 -------------- ------------------------ ------- ------------- ----------- ------------ ----------- Done. Processed 1 object files, 5 programs. $ sudo ./veristat biosnoop_bpf.o -o csv > comparison.csv $ cat comparison.csv file_name,prog_name,verdict,duration,total_insns,total_states,peak_states biosnoop_bpf.o,blk_account_io_merge_bio,success,71,24,1,1 biosnoop_bpf.o,blk_account_io_start,failure,0,0,0,0 biosnoop_bpf.o,block_rq_complete,success,82,104,6,6 biosnoop_bpf.o,block_rq_insert,success,83,91,7,7 biosnoop_bpf.o,block_rq_issue,success,87,91,7,7 # now let's compare with human-readable output (note that no sudo needed) # we also ignore verification duration in this case to shortned output $ ./veristat -C baseline.csv comparison.csv -e file,prog,verdict,insns File Program Verdict (A) Verdict (B) Verdict (DIFF) Total insns (A) Total insns (B) Total insns (DIFF) -------------- ------------------------ ----------- ----------- -------------- --------------- --------------- ------------------ biosnoop_bpf.o blk_account_io_merge_bio success success MATCH 24 24 +0 (+0.00%) biosnoop_bpf.o blk_account_io_start failure failure MATCH 0 0 +0 (+100.00%) biosnoop_bpf.o block_rq_complete success success MATCH 104 104 +0 (+0.00%) biosnoop_bpf.o block_rq_insert success success MATCH 91 85 -6 (-6.59%) biosnoop_bpf.o block_rq_issue success success MATCH 91 85 -6 (-6.59%) -------------- ------------------------ ----------- ----------- -------------- --------------- --------------- ------------------ While not particularly exciting example (it turned out to be kind of hard to quickly find a nice example with significant difference just because of kernel version bump), it should demonstrate main features. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220921164254.3630690-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit e5eb08d8fe469c0da8643042893a0b7481807443 Author: Andrii Nakryiko Date: Wed Sep 21 09:42:52 2022 -0700 selftests/bpf: add CSV output mode for veristat Teach veristat to output results as CSV table for easier programmatic processing. Change what was --output/-o argument to now be --emit/-e. And then use --output-format/-o to specify output format. Currently "table" and "csv" is supported, table being default. For CSV output mode veristat is using spec identifiers as column names. E.g., instead of "Total states" veristat uses "total_states" as a CSV header name. Internally veristat recognizes three formats, one of them (RESFMT_TABLE_CALCLEN) is a special format instructing veristat to calculate column widths for table output. This felt a bit cleaner and more uniform than either creating separate functions just for this. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220921164254.3630690-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit f338ac9105679df504c3809784f0716c25e87b31 Author: Andrii Nakryiko Date: Wed Sep 21 09:42:51 2022 -0700 selftests/bpf: fix double bpf_object__close() in veristate bpf_object__close(obj) is called twice for BPF object files with single BPF program in it. This causes crash. Fix this by not calling bpf_object__close() unnecessarily. Fixes: c8bc5e050976 ("selftests/bpf: Add veristat tool for mass-verifying BPF object files") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220921164254.3630690-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 2d863b14fbd9795c627074b4f344141ef3621b81 Merge: 1d8b82c613297 b06b45e82b59b Author: Alexei Starovoitov Date: Wed Sep 21 19:25:26 2022 -0700 Merge branch 'Introduce bpf_ct_set_nat_info kfunc helper' Lorenzo Bianconi says: ==================== Introduce bpf_ct_set_nat_info kfunc helper in order to set source and destination nat addresses/ports in a new allocated ct entry not inserted in the connection tracking table yet. Introduce support for per-parameter trusted args. Changes since v2: - use int instead of a pointer for port in bpf_ct_set_nat_info signature - modify KF_TRUSTED_ARGS definition in order to referenced pointer constraint just for PTR_TO_BTF_ID - drop patch 2/4 Changes since v1: - enable CONFIG_NF_NAT in tools/testing/selftests/bpf/config Kumar Kartikeya Dwivedi (1): bpf: Tweak definition of KF_TRUSTED_ARGS ==================== Signed-off-by: Alexei Starovoitov commit b06b45e82b59b69f5ac6b3916ac5dbd0294efc95 Author: Lorenzo Bianconi Date: Wed Sep 21 18:48:27 2022 +0200 selftests/bpf: add tests for bpf_ct_set_nat_info kfunc Introduce self-tests for bpf_ct_set_nat_info kfunc used to set the source or destination nat addresses/ports. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/803e33294e247744d466943105879414344d3235.1663778601.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov commit 0fabd2aa199faeb8754aee94658f2c48ccb2c8c3 Author: Lorenzo Bianconi Date: Wed Sep 21 18:48:26 2022 +0200 net: netfilter: add bpf_ct_set_nat_info kfunc helper Introduce bpf_ct_set_nat_info kfunc helper in order to set source and destination nat addresses/ports in a new allocated ct entry not inserted in the connection tracking table yet. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/9567db2fdfa5bebe7b7cc5870f7a34549418b4fc.1663778601.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov commit eed807f626101f6a4227bd53942892c5983b95a7 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 21 18:48:25 2022 +0200 bpf: Tweak definition of KF_TRUSTED_ARGS Instead of forcing all arguments to be referenced pointers with non-zero reg->ref_obj_id, tweak the definition of KF_TRUSTED_ARGS to mean that only PTR_TO_BTF_ID (and socket types translated to PTR_TO_BTF_ID) have that constraint, and require their offset to be set to 0. The rest of pointer types are also accomodated in this definition of trusted pointers, but with more relaxed rules regarding offsets. The inherent meaning of setting this flag is that all kfunc pointer arguments have a guranteed lifetime, and kernel object pointers (PTR_TO_BTF_ID, PTR_TO_CTX) are passed in their unmodified form (with offset 0). In general, this is not true for PTR_TO_BTF_ID as it can be obtained using pointer walks. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/cdede0043c47ed7a357f0a915d16f9ce06a1d589.1663778601.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov commit 9713a67067897a9e372c52124f72f8e00b2e6031 Author: Li Jinlin Date: Fri Sep 16 10:32:41 2022 +0800 block/blk-rq-qos: delete useless enmu RQ_QOS_IOPRIO Since blk-ioprio handing was converted from a rqos policy to a direct call, RQ_QOS_IOPRIO is not used anymore, just delete it. Signed-off-by: Li Jinlin Reviewed-by: Jan Kara Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220916023241.32926-1-lijinlin3@huawei.com Signed-off-by: Jens Axboe commit 8ef859995dbcc5bdc4b0707c9130e130f53c1b08 Author: Liu Shixin Date: Thu Sep 15 10:34:24 2022 +0800 block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Link: https://lore.kernel.org/r/20220915023424.3198940-1-liushixin2@huawei.com Signed-off-by: Jens Axboe commit e55e1b4831563e5766f88fa821f5bfac0d6c298c Author: Wolfram Sang Date: Thu Aug 18 22:59:57 2022 +0200 block: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Christoph Böhmwalder Acked-by: Geoff Levand Link: https://lore.kernel.org/r/20220818205958.6552-1-wsa+renesas@sang-engineering.com Signed-off-by: Jens Axboe commit 7f0c1afeacfcb4c32173b5a120ec0a362b79bd71 Author: Gaosheng Cui Date: Tue Sep 20 09:52:16 2022 +0800 block/drbd: remove useless comments in receive_DataReply() All implementations of req->collision, _req_may_be_done and drbd_fail_pending_reads have been removed, so remove the comments in receive_DataReply() that provide no useful information. Signed-off-by: Gaosheng Cui Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220920015216.782190-3-cuigaosheng1@huawei.com Signed-off-by: Jens Axboe commit a437df5f8bbc6b52231bbeaef8b4052698c9007a Author: Gaosheng Cui Date: Tue Sep 20 09:52:15 2022 +0800 drbd: remove orphan _req_may_be_done() declaration The _req_may_be_done() has been removed by commit 6870ca6d463e ("drbd: factor out master_bio completion and drbd_request destruction paths"), so remove the orphan declaration. Signed-off-by: Gaosheng Cui Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220920015216.782190-2-cuigaosheng1@huawei.com Signed-off-by: Jens Axboe commit 7a5d48c4463e6ef896ea2190a97d9e90b37c38da Merge: 393d34cb862e6 72f5c89804636 Author: Jakub Kicinski Date: Wed Sep 21 18:42:54 2022 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== netfilter patches for net-next Remove GPL license copypastry in uapi files, those have SPDX tags. From Christophe Jaillet. Remove unused variable in rpfilter, from Guillaume Nault. Rework gc resched delay computation in conntrack, from Antoine Tenart. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: rpfilter: Remove unused variable 'ret'. headers: Remove some left-over license text in include/uapi/linux/netfilter/ netfilter: conntrack: revisit the gc initial rescheduling bias netfilter: conntrack: fix the gc rescheduling delay ==================== Link: https://lore.kernel.org/r/20220921095000.29569-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit ec7fd2562f57fcfd96f15fbc8ad088f954c2dcf5 Author: Jens Axboe Date: Wed Sep 21 13:15:44 2022 -0600 io_uring: ensure local task_work marks task as running io_uring will run task_work from contexts that have been prepared for waiting, and in doing so it'll implicitly set the task running again to avoid issues with blocking conditions. The new deferred local task_work doesn't do that, which can result in spews on this being an invalid condition: 

[ 112.917576] do not call blocking ops when !TASK_RUNNING; state=1 set at [<00000000ad64af64>] prepare_to_wait_exclusive+0x3f/0xd0 [ 112.983088] WARNING: CPU: 1 PID: 190 at kernel/sched/core.c:9819 __might_sleep+0x5a/0x60 [ 112.987240] Modules linked in: [ 112.990504] CPU: 1 PID: 190 Comm: io_uring Not tainted 6.0.0-rc6+ #1617 [ 113.053136] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 [ 113.133650] RIP: 0010:__might_sleep+0x5a/0x60 [ 113.136507] Code: ee 48 89 df 5b 31 d2 5d e9 33 ff ff ff 48 8b 90 30 0b 00 00 48 c7 c7 90 de 45 82 c6 05 20 8b 79 01 01 48 89 d1 e8 3a 49 77 00 <0f> 0b eb d1 66 90 0f 1f 44 00 00 9c 58 f6 c4 02 74 35 65 8b 05 ed [ 113.223940] RSP: 0018:ffffc90000537ca0 EFLAGS: 00010286 [ 113.232903] RAX: 0000000000000000 RBX: ffffffff8246782c RCX: ffffffff8270bcc8 IOPS=133.15K, BW=520MiB/s, IOS/call=32/31 [ 113.353457] RDX: ffffc90000537b50 RSI: 00000000ffffdfff RDI: 0000000000000001 [ 113.358970] RBP: 00000000000003bc R08: 0000000000000000 R09: c0000000ffffdfff [ 113.361746] R10: 0000000000000001 R11: ffffc90000537b48 R12: ffff888103f97280 [ 113.424038] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001 [ 113.428009] FS: 00007f67ae7fc700(0000) GS:ffff88842fc80000(0000) knlGS:0000000000000000 [ 113.432794] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 113.503186] CR2: 00007f67b8b9b3b0 CR3: 0000000102b9b005 CR4: 0000000000770ee0 [ 113.507291] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 113.512669] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 113.574374] PKRU: 55555554 [ 113.576800] Call Trace: [ 113.578325] [ 113.579799] set_page_dirty_lock+0x1b/0x90 [ 113.582411] __bio_release_pages+0x141/0x160 [ 113.673078] ? set_next_entity+0xd7/0x190 [ 113.675632] blk_rq_unmap_user+0xaa/0x210 [ 113.678398] ? timerqueue_del+0x2a/0x40 [ 113.679578] nvme_uring_task_cb+0x94/0xb0 [ 113.683025] __io_run_local_work+0x8a/0x150 [ 113.743724] ? io_cqring_wait+0x33d/0x500 [ 113.746091] io_run_local_work.part.76+0x2e/0x60 [ 113.750091] io_cqring_wait+0x2e7/0x500 [ 113.752395] ? trace_event_raw_event_io_uring_req_failed+0x180/0x180 [ 113.823533] __x64_sys_io_uring_enter+0x131/0x3c0 [ 113.827382] ? switch_fpu_return+0x49/0xc0 [ 113.830753] do_syscall_64+0x34/0x80 [ 113.832620] entry_SYSCALL_64_after_hwframe+0x5e/0xc8 Ensure that we mark current as TASK_RUNNING for deferred task_work as well. Fixes: c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN") Reported-by: Stefan Roesch Reviewed-by: Dylan Yudaken Signed-off-by: Jens Axboe commit 393d34cb862e6de0c283408149da2b9093d5a5c4 Author: Uwe Kleine-König Date: Mon Sep 19 15:15:15 2022 +0200 ethernet: tundra: Drop forward declaration of static functions Usually it's not necessary to declare static functions if the symbols are in the right order. Moving the definition of tsi_eth_driver down in the compilation unit allows to drop two such declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220919131515.885361-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jakub Kicinski commit 9f87eb4246994e32a4e4ea88476b20ab3b412840 Author: Qingqing Yang Date: Mon Sep 19 15:48:08 2022 +0800 flow_dissector: Do not count vlan tags inside tunnel payload We've met the problem that when there is a vlan tag inside GRE encapsulation, the match of num_of_vlans fails. It is caused by the vlan tag inside GRE payload has been counted into num_of_vlans, which is not expected. One example packet is like this: Ethernet II, Src: Broadcom_68:56:07 (00:10:18:68:56:07) Dst: Broadcom_68:56:08 (00:10:18:68:56:08) 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 100 Internet Protocol Version 4, Src: 192.168.1.4, Dst: 192.168.1.200 Generic Routing Encapsulation (Transparent Ethernet bridging) Ethernet II, Src: Broadcom_68:58:07 (00:10:18:68:58:07) Dst: Broadcom_68:58:08 (00:10:18:68:58:08) 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 200 ... It should match the (num_of_vlans 1) rule, but it matches the (num_of_vlans 2) rule. The vlan tags inside the GRE or other tunnel encapsulated payload should not be taken into num_of_vlans. The fix is to stop counting the vlan number when the encapsulation bit is set. Fixes: 34951fcf26c5 ("flow_dissector: Add number of vlan tags dissector") Signed-off-by: Qingqing Yang Reviewed-by: Boris Sukholitko Link: https://lore.kernel.org/r/20220919074808.136640-1-qingqing.yang@broadcom.com Signed-off-by: Jakub Kicinski commit 1d14b30b5a5e52da93467af7c1dca08f124186df Author: Jamal Hadi Salim Date: Mon Sep 19 13:06:27 2022 +0000 net: sched: remove unused tcf_result extension Added by: commit e5cf1baf92cb ("act_mirred: use TC_ACT_REINSERT when possible") but no longer useful. Signed-off-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20220919130627.3551233-1-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit cdf49fff10fd4a617a4331a2911097ac65290f7a Merge: d294ad825432f fa1d90b048c20 Author: Jakub Kicinski Date: Wed Sep 21 18:29:38 2022 -0700 Merge branch 'clean-up-ocelot_reset-routine' Colin Foster says: ==================== clean up ocelot_reset() routine ocelot_reset() will soon be exported to a common library to be used by the ocelot_ext system. This will make error values from regmap calls possible, so they must be checked. Additionally, readx_poll_timeout() can be substituted for the custom loop, as a simple cleanup. I don't have hardware to verify this set directly, but there shouldn't be any functional changes. ==================== Link: https://lore.kernel.org/r/20220917175127.161504-1-colin.foster@in-advantage.com Signed-off-by: Jakub Kicinski commit fa1d90b048c2037679b389bb41b29963d5faf232 Author: Colin Foster Date: Sat Sep 17 10:51:27 2022 -0700 net: mscc: ocelot: check return values of writes during reset The ocelot_reset() function utilizes regmap_field_write() but wasn't checking return values. While this won't cause issues for the current MMIO regmaps, it could be an issue for externally controlled interfaces. Add checks for these return values. Signed-off-by: Colin Foster Signed-off-by: Jakub Kicinski commit 21bb08cd2cda0e4ac8349b9009c3ccd1f114ad6a Author: Colin Foster Date: Sat Sep 17 10:51:26 2022 -0700 net: mscc: ocelot: utilize readx_poll_timeout() for chip reset Clean up the reset code by utilizing readx_poll_timeout instead of a custom loop. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit d294ad825432f845bbd9243d1d70f15e467a823d Merge: d57aae2e0563d 7fe85bb3af4e9 Author: Jakub Kicinski Date: Wed Sep 21 18:25:22 2022 -0700 Merge branch 'net-ll_temac-cleanup-for-clearing-static-warnings' Haoyue Xu says: ==================== net: ll_temac: Cleanup for clearing static warnings Most static warnings are detected by Checkpatch.pl, mainly about: (1) #1: About the comments. (2) #2: About function name in a string. (3) #3: About the open parenthesis. (4) #4: About the else branch. (6) #6: About trailing statements. (7) #5,#7: About blank lines and spaces. ==================== Link: https://lore.kernel.org/r/20220917103843.526877-1-xuhaoyue1@hisilicon.com Signed-off-by: Jakub Kicinski commit 7fe85bb3af4e90561ff36e0fa8697b56c3108800 Author: huangjunxian Date: Sat Sep 17 18:38:43 2022 +0800 net: ll_temac: axienet: delete unnecessary blank lines and spaces Cleaning some static warnings of indent. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit a0a85097680101172928bef443aaf222e73017f8 Author: huangjunxian Date: Sat Sep 17 18:38:42 2022 +0800 net: ll_temac: move trailing statements to next line Cleaning some static warnings of trailing statements. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit a9f1ef7034b84be720321140723e7c266e538a41 Author: huangjunxian Date: Sat Sep 17 18:38:41 2022 +0800 net: ll_temac: fix the missing spaces around '=' Cleaning some static warnings of missing spaces around '='. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit 7dfd0dcc5e728ccbbdb656356cb1a1112796e4da Author: huangjunxian Date: Sat Sep 17 18:38:40 2022 +0800 net: ll_temac: delete unnecessary else branch Cleaning some static warnings of unnecessary else branch. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit 42f5d4d0e0d9bb7e4ff776412415d3894ac71ea4 Author: huangjunxian Date: Sat Sep 17 18:38:39 2022 +0800 net: ll_temac: axienet: align with open parenthesis Cleaning some static warnings of open parenthesis. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit 653de988eb585a41d28720a5d8846b699469cd6f Author: Haoyue Xu Date: Sat Sep 17 18:38:38 2022 +0800 net: ll_temac: Cleanup for function name in a string As Checkpatch.pl warns, prefer using '"%s...", __func__' to using 'temac_device_reset', this function's name, in a string. Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit 75124116520b7c94313c1e46493bee964317fa9e Author: huangjunxian Date: Sat Sep 17 18:38:37 2022 +0800 net: ll_temac: fix the format of block comments Cleaning some static warnings of block comments. Signed-off-by: huangjunxian Signed-off-by: Haoyue Xu Reviewed-by: Harini Katakam Signed-off-by: Jakub Kicinski commit d57aae2e0563d5271de11df093d50d3539e694fe Author: Xiu Jianfeng Date: Sat Sep 17 16:35:35 2022 +0800 net: macvtap: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220917083535.20040-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski commit 134a4647922290159ade41c61a6277b37b6b1f4f Author: Xiu Jianfeng Date: Sat Sep 17 16:21:18 2022 +0800 net: hns3: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220917082118.7971-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski commit 2801f30e2cef8144004ebede660e34c48f525d9b Author: William Dean Date: Sat Sep 17 14:35:56 2022 +0800 net: sched: simplify code in mall_reoffload such expression: if (err) return err; return 0; can simplify to: return err; Signed-off-by: William Dean Link: https://lore.kernel.org/r/20220917063556.2673-1-williamsukatube@163.com Signed-off-by: Jakub Kicinski commit 3342a10f5ad3115a7acf8504004f9eb1e6bbb4a8 Author: Jian Shen Date: Sat Sep 17 10:04:51 2022 +0800 net: ethernet: ti: am65-cpsw: remove unused parameter of am65_cpsw_nuss_common_open() The inptu parameter 'features' is unused now. so remove it. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Link: https://lore.kernel.org/r/20220917020451.63417-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 1d8b82c613297f24354b4d750413a7456b5cd92c Author: Hou Tao Date: Wed Sep 21 15:38:26 2022 +0800 bpf: Always use raw spinlock for hash bucket lock For a non-preallocated hash map on RT kernel, regular spinlock instead of raw spinlock is used for bucket lock. The reason is that on RT kernel memory allocation is forbidden under atomic context and regular spinlock is sleepable under RT. Now hash map has been fully converted to use bpf_map_alloc, and there will be no synchronous memory allocation for non-preallocated hash map, so it is safe to always use raw spinlock for bucket lock on RT. So removing the usage of htab_use_raw_lock() and updating the comments accordingly. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220921073826.2365800-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 05b24ff9b2cfabfcfd951daaa915a036ab53c9e1 Author: Jiri Olsa Date: Fri Sep 16 09:19:14 2022 +0200 bpf: Prevent bpf program recursion for raw tracepoint probes We got report from sysbot [1] about warnings that were caused by bpf program attached to contention_begin raw tracepoint triggering the same tracepoint by using bpf_trace_printk helper that takes trace_printk_lock lock. Call Trace: ? trace_event_raw_event_bpf_trace_printk+0x5f/0x90 bpf_trace_printk+0x2b/0xe0 bpf_prog_a9aec6167c091eef_prog+0x1f/0x24 bpf_trace_run2+0x26/0x90 native_queued_spin_lock_slowpath+0x1c6/0x2b0 _raw_spin_lock_irqsave+0x44/0x50 bpf_trace_printk+0x3f/0xe0 bpf_prog_a9aec6167c091eef_prog+0x1f/0x24 bpf_trace_run2+0x26/0x90 native_queued_spin_lock_slowpath+0x1c6/0x2b0 _raw_spin_lock_irqsave+0x44/0x50 bpf_trace_printk+0x3f/0xe0 bpf_prog_a9aec6167c091eef_prog+0x1f/0x24 bpf_trace_run2+0x26/0x90 native_queued_spin_lock_slowpath+0x1c6/0x2b0 _raw_spin_lock_irqsave+0x44/0x50 bpf_trace_printk+0x3f/0xe0 bpf_prog_a9aec6167c091eef_prog+0x1f/0x24 bpf_trace_run2+0x26/0x90 native_queued_spin_lock_slowpath+0x1c6/0x2b0 _raw_spin_lock_irqsave+0x44/0x50 __unfreeze_partials+0x5b/0x160 ... The can be reproduced by attaching bpf program as raw tracepoint on contention_begin tracepoint. The bpf prog calls bpf_trace_printk helper. Then by running perf bench the spin lock code is forced to take slow path and call contention_begin tracepoint. Fixing this by skipping execution of the bpf program if it's already running, Using bpf prog 'active' field, which is being currently used by trampoline programs for the same reason. Moving bpf_prog_inc_misses_counter to syscall.c because trampoline.c is compiled in just for CONFIG_BPF_JIT option. Reviewed-by: Stanislav Fomichev Reported-by: syzbot+2251879aa068ad9c960d@syzkaller.appspotmail.com [1] https://lore.kernel.org/bpf/YxhFe3EwqchC%2FfYf@krava/T/#t Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220916071914.7156-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 66d6a4bf94f402301ce7832072705e23d5948761 Merge: 01f2e36c959c8 b94fa9f9dcf99 Author: Alexei Starovoitov Date: Wed Sep 21 17:50:02 2022 -0700 Merge branch 'bpf: Add kfuncs for PKCS#7 signature verification' Roberto Sassu says: ==================== One of the desirable features in security is the ability to restrict import of data to a given system based on data authenticity. If data import can be restricted, it would be possible to enforce a system-wide policy based on the signing keys the system owner trusts. This feature is widely used in the kernel. For example, if the restriction is enabled, kernel modules can be plugged in only if they are signed with a key whose public part is in the primary or secondary keyring. For eBPF, it can be useful as well. For example, it might be useful to authenticate data an eBPF program makes security decisions on. After a discussion in the eBPF mailing list, it was decided that the stated goal should be accomplished by introducing four new kfuncs: bpf_lookup_user_key() and bpf_lookup_system_key(), for retrieving a keyring with keys trusted for signature verification, respectively from its serial and from a pre-determined ID; bpf_key_put(), to release the reference obtained with the former two kfuncs, bpf_verify_pkcs7_signature(), for verifying PKCS#7 signatures. Other than the key serial, bpf_lookup_user_key() also accepts key lookup flags, that influence the behavior of the lookup. bpf_lookup_system_key() accepts pre-determined IDs defined in include/linux/verification.h. bpf_key_put() accepts the new bpf_key structure, introduced to tell whether the other structure member, a key pointer, is valid or not. The reason is that verify_pkcs7_signature() also accepts invalid pointers, set with the pre-determined ID, to select a system-defined keyring. key_put() must be called only for valid key pointers. Since the two key lookup functions allocate memory and one increments a key reference count, they must be used in conjunction with bpf_key_put(). The latter must be called only if the lookup functions returned a non-NULL pointer. The verifier denies the execution of eBPF programs that don't respect this rule. The two key lookup functions should be used in alternative, depending on the use case. While bpf_lookup_user_key() provides great flexibility, it seems suboptimal in terms of security guarantees, as even if the eBPF program is assumed to be trusted, the serial used to obtain the key pointer might come from untrusted user space not choosing one that the system administrator approves to enforce a mandatory policy. bpf_lookup_system_key() instead provides much stronger guarantees, especially if the pre-determined ID is not passed by user space but is hardcoded in the eBPF program, and that program is signed. In this case, bpf_verify_pkcs7_signature() will always perform signature verification with a key that the system administrator approves, i.e. the primary, secondary or platform keyring. Nevertheless, key permission checks need to be done accurately. Since bpf_lookup_user_key() cannot determine how a key will be used by other kfuncs, it has to defer the permission check to the actual kfunc using the key. It does it by calling lookup_user_key() with KEY_DEFER_PERM_CHECK as needed permission. Later, bpf_verify_pkcs7_signature(), if called, completes the permission check by calling key_validate(). It does not need to call key_task_permission() with permission KEY_NEED_SEARCH, as it is already done elsewhere by the key subsystem. Future kfuncs using the bpf_key structure need to implement the proper checks as well. Finally, the last kfunc, bpf_verify_pkcs7_signature(), accepts the data and signature to verify as eBPF dynamic pointers, to minimize the number of kfunc parameters, and the keyring with keys for signature verification as a bpf_key structure, returned by one of the two key lookup functions. bpf_lookup_user_key() and bpf_verify_pkcs7_signature() can be called only from sleepable programs, because of memory allocation and crypto operations. For example, the lsm.s/bpf attach point is suitable, fexit/array_map_update_elem is not. The correctness of implementation of the new kfuncs and of their usage is checked with the introduced tests. The patch set includes a patch from another author (dependency) for sake of completeness. It is organized as follows. Patch 1 from KP Singh allows kfuncs to be used by LSM programs. Patch 2 exports the bpf_dynptr definition through BTF. Patch 3 splits is_dynptr_reg_valid_init() and introduces is_dynptr_type_expected(), to know more precisely the cause of a negative result of a dynamic pointer check. Patch 4 allows dynamic pointers to be used as kfunc parameters. Patch 5 exports bpf_dynptr_get_size(), to obtain the real size of data carried by a dynamic pointer. Patch 6 makes available for new eBPF kfuncs and programs some key-related definitions. Patch 7 introduces the bpf_lookup_*_key() and bpf_key_put() kfuncs. Patch 8 introduces the bpf_verify_pkcs7_signature() kfunc. Patch 9 changes the testing kernel configuration to compile everything as built-in. Finally, patches 10-13 introduce the tests. Changelog v17: - Remove unnecessary typedefs in test_verify_pkcs7_sig.c (suggested by KP) - Add patch to export bpf_dynptr through BTF (reported by KP) - Rename u{8,16,32,64} variables to __u{8,16,32,64} in the tests, for consistency with other eBPF programs (suggested by Yonghong) v16: - Remove comments in include/linux/key.h for KEY_LOOKUP_* - Change kmalloc() flag from GFP_ATOMIC to GFP_KERNEL in bpf_lookup_user_key(), as the kfunc needs anyway to be sleepable (suggested by Kumar) - Test passing a dynamic pointer with NULL data to bpf_verify_pkcs7_signature() (suggested by Kumar) v15: - Add kfunc_dynptr_param test to deny list for s390x v14: - Explain that is_dynptr_type_expected() will be useful also for BTF (suggested by Joanne) - Rename KEY_LOOKUP_FLAGS_ALL to KEY_LOOKUP_ALL (suggested by Jarkko) - Swap declaration of spi and dynptr_type in is_dynptr_type_expected() (suggested by Joanne) - Reimplement kfunc dynptr tests with a regular eBPF program instead of executing them with test_verifier (suggested by Joanne) - Make key lookup flags as enum so that they are automatically exported through BTF (suggested by Alexei) v13: - Split is_dynptr_reg_valid_init() and introduce is_dynptr_type_expected() to see if the dynamic pointer type passed as argument to a kfunc is supported (suggested by Kumar) - Add forward declaration of struct key in include/linux/bpf.h (suggested by Song) - Declare mask for key lookup flags, remove key_lookup_flags_check() (suggested by Jarkko and KP) - Allow only certain dynamic pointer types (currently, local) to be passed as argument to kfuncs (suggested by Kumar) - For each dynamic pointer parameter in kfunc, additionally check if the passed pointer is to the stack (suggested by Kumar) - Split the validity/initialization and dynamic pointer type check also in the verifier, and adjust the expected error message in the test (a test for an unexpected dynptr type passed to a helper cannot be added due to missing suitable helpers, but this case has been tested manually) - Add verifier tests to check the dynamic pointers passed as argument to kfuncs (suggested by Kumar) v12: - Put lookup_key and verify_pkcs7_sig tests in deny list for s390x (JIT does not support calling kernel function) v11: - Move stringify_struct() macro to include/linux/btf.h (suggested by Daniel) - Change kernel configuration options in tools/testing/selftests/bpf/config* from =m to =y v10: - Introduce key_lookup_flags_check() and system_keyring_id_check() inline functions to check parameters (suggested by KP) - Fix descriptions and comment of key-related kfuncs (suggested by KP) - Register kfunc set only once (suggested by Alexei) - Move needed kernel options to the architecture-independent configuration for testing v9: - Drop patch to introduce KF_SLEEPABLE kfunc flag (already merged) - Rename valid_ptr member of bpf_key to has_ref (suggested by Daniel) - Check dynamic pointers in kfunc definition with bpf_dynptr_kern struct definition instead of string, to detect structure renames (suggested by Daniel) - Explicitly say that we permit initialized dynamic pointers in kfunc definition (suggested by Daniel) - Remove noinline __weak from kfuncs definition (reported by Daniel) - Simplify key lookup flags check in bpf_lookup_user_key() (suggested by Daniel) - Explain the reason for deferring key permission check (suggested by Daniel) - Allocate memory with GFP_ATOMIC in bpf_lookup_system_key(), and remove KF_SLEEPABLE kfunc flag from kfunc declaration (suggested by Daniel) - Define only one kfunc set and remove the loop for registration (suggested by Alexei) v8: - Define the new bpf_key structure to carry the key pointer and whether that pointer is valid or not (suggested by Daniel) - Drop patch to mark a kfunc parameter with the __maybe_null suffix - Improve documentation of kfuncs - Introduce bpf_lookup_system_key() to obtain a key pointer suitable for verify_pkcs7_signature() (suggested by Daniel) - Use the new kfunc registration API - Drop patch to test the __maybe_null suffix - Add tests for bpf_lookup_system_key() v7: - Add support for using dynamic and NULL pointers in kfunc (suggested by Alexei) - Add new kfunc-related tests v6: - Switch back to key lookup helpers + signature verification (until v5), and defer permission check from bpf_lookup_user_key() to bpf_verify_pkcs7_signature() - Add additional key lookup test to illustrate the usage of the KEY_LOOKUP_CREATE flag and validate the flags (suggested by Daniel) - Make description of flags of bpf_lookup_user_key() more user-friendly (suggested by Daniel) - Fix validation of flags parameter in bpf_lookup_user_key() (reported by Daniel) - Rename bpf_verify_pkcs7_signature() keyring-related parameters to user_keyring and system_keyring to make their purpose more clear - Accept keyring-related parameters of bpf_verify_pkcs7_signature() as alternatives (suggested by KP) - Replace unsigned long type with u64 in helper declaration (suggested by Daniel) - Extend the bpf_verify_pkcs7_signature() test by calling the helper without data, by ensuring that the helper enforces the keyring-related parameters as alternatives, by ensuring that the helper rejects inaccessible and expired keyrings, and by checking all system keyrings - Move bpf_lookup_user_key() and bpf_key_put() usage tests to ref_tracking.c (suggested by John) - Call bpf_lookup_user_key() and bpf_key_put() only in sleepable programs v5: - Move KEY_LOOKUP_ to include/linux/key.h for validation of bpf_verify_pkcs7_signature() parameter - Remove bpf_lookup_user_key() and bpf_key_put() helpers, and the corresponding tests - Replace struct key parameter of bpf_verify_pkcs7_signature() with the keyring serial and lookup flags - Call lookup_user_key() and key_put() in bpf_verify_pkcs7_signature() code, to ensure that the retrieved key is used according to the permission requested at lookup time - Clarified keyring precedence in the description of bpf_verify_pkcs7_signature() (suggested by John) - Remove newline in the second argument of ASSERT_ - Fix helper prototype regular expression in bpf_doc.py v4: - Remove bpf_request_key_by_id(), don't return an invalid pointer that other helpers can use - Pass the keyring ID (without ULONG_MAX, suggested by Alexei) to bpf_verify_pkcs7_signature() - Introduce bpf_lookup_user_key() and bpf_key_put() helpers (suggested by Alexei) - Add lookup_key_norelease test, to ensure that the verifier blocks eBPF programs which don't decrement the key reference count - Parse raw PKCS#7 signature instead of module-style signature in the verify_pkcs7_signature test (suggested by Alexei) - Parse kernel module in user space and pass raw PKCS#7 signature to the eBPF program for signature verification v3: - Rename bpf_verify_signature() back to bpf_verify_pkcs7_signature() to avoid managing different parameters for each signature verification function in one helper (suggested by Daniel) - Use dynamic pointers and export bpf_dynptr_get_size() (suggested by Alexei) - Introduce bpf_request_key_by_id() to give more flexibility to the caller of bpf_verify_pkcs7_signature() to retrieve the appropriate keyring (suggested by Alexei) - Fix test by reordering the gcc command line, always compile sign-file - Improve helper support check mechanism in the test v2: - Rename bpf_verify_pkcs7_signature() to a more generic bpf_verify_signature() and pass the signature type (suggested by KP) - Move the helper and prototype declaration under #ifdef so that user space can probe for support for the helper (suggested by Daniel) - Describe better the keyring types (suggested by Daniel) - Include linux/bpf.h instead of vmlinux.h to avoid implicit or redeclaration - Make the test selfcontained (suggested by Alexei) v1: - Don't define new map flag but introduce simple wrapper of verify_pkcs7_signature() (suggested by Alexei and KP) ==================== Signed-off-by: Alexei Starovoitov commit b94fa9f9dcf99730eabd8febc4c95e44342bfb59 Author: Roberto Sassu Date: Tue Sep 20 09:59:51 2022 +0200 selftests/bpf: Add tests for dynamic pointers parameters in kfuncs Add tests to ensure that only supported dynamic pointer types are accepted, that the passed argument is actually a dynamic pointer, that the passed argument is a pointer to the stack, and that bpf_verify_pkcs7_signature() correctly handles dynamic pointers with data set to NULL. The tests are currently in the deny list for s390x (JIT does not support calling kernel function). Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-14-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit fc97590668ae60b94ad8bc4d9e85958f10cb3567 Author: Roberto Sassu Date: Tue Sep 20 09:59:50 2022 +0200 selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc Perform several tests to ensure the correct implementation of the bpf_verify_pkcs7_signature() kfunc. Do the tests with data signed with a generated testing key (by using sign-file from scripts/) and with the tcp_bic.ko kernel module if it is found in the system. The test does not fail if tcp_bic.ko is not found. First, perform an unsuccessful signature verification without data. Second, perform a successful signature verification with the session keyring and a new one created for testing. Then, ensure that permission and validation checks are done properly on the keyring provided to bpf_verify_pkcs7_signature(), despite those checks were deferred at the time the keyring was retrieved with bpf_lookup_user_key(). The tests expect to encounter an error if the Search permission is removed from the keyring, or the keyring is expired. Finally, perform a successful and unsuccessful signature verification with the keyrings with pre-determined IDs (the last test fails because the key is not in the platform keyring). The test is currently in the deny list for s390x (JIT does not support calling kernel function). Signed-off-by: Roberto Sassu Link: https://lore.kernel.org/r/20220920075951.929132-13-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit ecce368d6e6d76168be5d8d34b411c69ec367859 Author: Roberto Sassu Date: Tue Sep 20 09:59:49 2022 +0200 selftests/bpf: Add additional tests for bpf_lookup_*_key() Add a test to ensure that bpf_lookup_user_key() creates a referenced special keyring when the KEY_LOOKUP_CREATE flag is passed to this function. Ensure that the kfunc rejects invalid flags. Ensure that a keyring can be obtained from bpf_lookup_system_key() when one of the pre-determined keyring IDs is provided. The test is currently blacklisted for s390x (JIT does not support calling kernel function). Signed-off-by: Roberto Sassu Link: https://lore.kernel.org/r/20220920075951.929132-12-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 7c036ed9e0065e852fb1886d9ea97ceb35680e3f Author: Roberto Sassu Date: Tue Sep 20 09:59:48 2022 +0200 selftests/bpf: Add verifier tests for bpf_lookup_*_key() and bpf_key_put() Add verifier tests for bpf_lookup_*_key() and bpf_key_put(), to ensure that acquired key references stored in the bpf_key structure are released, that a non-NULL bpf_key pointer is passed to bpf_key_put(), and that key references are not leaked. Also, slightly modify test_verifier.c, to find the BTF ID of the attach point for the LSM program type (currently, it is done only for TRACING). Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-11-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 94fd7420faa0bc85341c0a9cbe5e5240ef4f123d Author: Roberto Sassu Date: Tue Sep 20 09:59:47 2022 +0200 selftests/bpf: Compile kernel with everything as built-in Since the eBPF CI does not support kernel modules, change the kernel config to compile everything as built-in. Signed-off-by: Roberto Sassu Acked-by: Daniel Müller Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-10-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 865b0566d8f1a0c3937e5eb4bd6ba4ef03e7e98c Author: Roberto Sassu Date: Tue Sep 20 09:59:46 2022 +0200 bpf: Add bpf_verify_pkcs7_signature() kfunc Add the bpf_verify_pkcs7_signature() kfunc, to give eBPF security modules the ability to check the validity of a signature against supplied data, by using user-provided or system-provided keys as trust anchor. The new kfunc makes it possible to enforce mandatory policies, as eBPF programs might be allowed to make security decisions only based on data sources the system administrator approves. The caller should provide the data to be verified and the signature as eBPF dynamic pointers (to minimize the number of parameters) and a bpf_key structure containing a reference to the keyring with keys trusted for signature verification, obtained from bpf_lookup_user_key() or bpf_lookup_system_key(). For bpf_key structures obtained from the former lookup function, bpf_verify_pkcs7_signature() completes the permission check deferred by that function by calling key_validate(). key_task_permission() is already called by the PKCS#7 code. Signed-off-by: Roberto Sassu Acked-by: KP Singh Acked-by: Song Liu Link: https://lore.kernel.org/r/20220920075951.929132-9-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit f3cf4134c5c6c47b9b5c7aa3cb2d67e107887a7b Author: Roberto Sassu Date: Tue Sep 20 09:59:45 2022 +0200 bpf: Add bpf_lookup_*_key() and bpf_key_put() kfuncs Add the bpf_lookup_user_key(), bpf_lookup_system_key() and bpf_key_put() kfuncs, to respectively search a key with a given key handle serial number and flags, obtain a key from a pre-determined ID defined in include/linux/verification.h, and cleanup. Introduce system_keyring_id_check() to validate the keyring ID parameter of bpf_lookup_system_key(). Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Acked-by: Song Liu Link: https://lore.kernel.org/r/20220920075951.929132-8-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 90fd8f26edd47942203639bf3a5dde8fa1931a0e Author: Roberto Sassu Date: Tue Sep 20 09:59:44 2022 +0200 KEYS: Move KEY_LOOKUP_ to include/linux/key.h and define KEY_LOOKUP_ALL In preparation for the patch that introduces the bpf_lookup_user_key() eBPF kfunc, move KEY_LOOKUP_ definitions to include/linux/key.h, to be able to validate the kfunc parameters. Add them to enum key_lookup_flag, so that all the current ones and the ones defined in the future are automatically exported through BTF and available to eBPF programs. Also, add KEY_LOOKUP_ALL to the enum, with the logical OR of currently defined flags as value, to facilitate checking whether a variable contains only those flags. Signed-off-by: Roberto Sassu Acked-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20220920075951.929132-7-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 51df4865718540f51bb5d3e552c50dc88e1333d6 Author: Roberto Sassu Date: Tue Sep 20 09:59:43 2022 +0200 bpf: Export bpf_dynptr_get_size() Export bpf_dynptr_get_size(), so that kernel code dealing with eBPF dynamic pointers can obtain the real size of data carried by this data structure. Signed-off-by: Roberto Sassu Reviewed-by: Joanne Koong Acked-by: KP Singh Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-6-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit b8d31762a0ae6861e1115302ee338560d853e317 Author: Roberto Sassu Date: Tue Sep 20 09:59:42 2022 +0200 btf: Allow dynamic pointer parameters in kfuncs Allow dynamic pointers (struct bpf_dynptr_kern *) to be specified as parameters in kfuncs. Also, ensure that dynamic pointers passed as argument are valid and initialized, are a pointer to the stack, and of the type local. More dynamic pointer types can be supported in the future. To properly detect whether a parameter is of the desired type, introduce the stringify_struct() macro to compare the returned structure name with the desired name. In addition, protect against structure renames, by halting the build with BUILD_BUG_ON(), so that developers have to revisit the code. To check if a dynamic pointer passed to the kfunc is valid and initialized, and if its type is local, export the existing functions is_dynptr_reg_valid_init() and is_dynptr_type_expected(). Cc: Joanne Koong Cc: Kumar Kartikeya Dwivedi Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-5-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit e9e315b4a5de32d0482b92f482517095d5d844e4 Author: Roberto Sassu Date: Tue Sep 20 09:59:41 2022 +0200 bpf: Move dynptr type check to is_dynptr_type_expected() Move dynptr type check to is_dynptr_type_expected() from is_dynptr_reg_valid_init(), so that callers can better determine the cause of a negative result (dynamic pointer not valid/initialized, dynamic pointer of the wrong type). It will be useful for example for BTF, to restrict which dynamic pointer types can be passed to kfuncs, as initially only the local type will be supported. Also, splitting makes the code more readable, since checking the dynamic pointer type is not necessarily related to validity and initialization. Split the validity/initialization and dynamic pointer type check also in the verifier, and adjust the expected error message in the test (a test for an unexpected dynptr type passed to a helper cannot be added due to missing suitable helpers, but this case has been tested manually). Cc: Joanne Koong Cc: Kumar Kartikeya Dwivedi Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-4-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 00f146413ccb6c84308e559281449755c83f54c5 Author: Roberto Sassu Date: Tue Sep 20 09:59:40 2022 +0200 btf: Export bpf_dynptr definition eBPF dynamic pointers is a new feature recently added to upstream. It binds together a pointer to a memory area and its size. The internal kernel structure bpf_dynptr_kern is not accessible by eBPF programs in user space. They instead see bpf_dynptr, which is then translated to the internal kernel structure by the eBPF verifier. The problem is that it is not possible to include at the same time the uapi include linux/bpf.h and the vmlinux BTF vmlinux.h, as they both contain the definition of some structures/enums. The compiler complains saying that the structures/enums are redefined. As bpf_dynptr is defined in the uapi include linux/bpf.h, this makes it impossible to include vmlinux.h. However, in some cases, e.g. when using kfuncs, vmlinux.h has to be included. The only option until now was to include vmlinux.h and add the definition of bpf_dynptr directly in the eBPF program source code from linux/bpf.h. Solve the problem by using the same approach as for bpf_timer (which also follows the same scheme with the _kern suffix for the internal kernel structure). Add the following line in one of the dynamic pointer helpers, bpf_dynptr_from_mem(): BTF_TYPE_EMIT(struct bpf_dynptr); Cc: stable@vger.kernel.org Cc: Joanne Koong Fixes: 97e03f521050c ("bpf: Add verifier support for dynptrs") Signed-off-by: Roberto Sassu Acked-by: Yonghong Song Tested-by: KP Singh Link: https://lore.kernel.org/r/20220920075951.929132-3-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit d15bf1501c7533826a616478002c601fcc7671f3 Author: KP Singh Date: Tue Sep 20 09:59:39 2022 +0200 bpf: Allow kfuncs to be used in LSM programs In preparation for the addition of new kfuncs, allow kfuncs defined in the tracing subsystem to be used in LSM programs by mapping the LSM program type to the TRACING hook. Signed-off-by: KP Singh Signed-off-by: Roberto Sassu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220920075951.929132-2-roberto.sassu@huaweicloud.com Signed-off-by: Alexei Starovoitov commit fa2aee653663114a101e0af10848141fd57bdeca Author: Uwe Kleine-König Date: Sun Sep 18 00:51:42 2022 +0200 net: fjes: Reorder symbols to get rid of a few forward declarations Quite a few of the functions and other symbols defined in this driver had forward declarations. They can all be dropped after reordering them. This saves a few lines of code and reduces code duplication. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220917225142.473770-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jakub Kicinski commit 01f2e36c959c813a532ae836db49b2ac9de46de4 Author: Tao Chen Date: Tue Sep 13 00:43:00 2022 +0800 libbpf: Support raw BTF placed in the default search path Currently, the default vmlinux files at '/boot/vmlinux-*', '/lib/modules/*/vmlinux-*' etc. are parsed with 'btf__parse_elf()' to extract BTF. It is possible that these files are actually raw BTF files similar to /sys/kernel/btf/vmlinux. So parse these files with 'btf__parse' which tries both raw format and ELF format. This might be useful in some scenarios where users put their custom BTF into known locations and don't want to specify btf_custom_path option. Signed-off-by: Tao Chen Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/3f59fb5a345d2e4f10e16fe9e35fbc4c03ecaa3e.1662999860.git.chentao.kernel@linux.alibaba.com commit 272d1f4cfa3c75d4828b62ef33ccb207da3b7350 Author: Yauheni Kaliuta Date: Thu Sep 8 15:01:46 2022 +0300 selftests: bpf: test_kmod.sh: Pass parameters to the module It's possible to specify particular tests for test_bpf.ko with module parameters. Make it possible to pass the module parameters, example: test_kmod.sh test_range=1,3 Since magnitude tests take long time it can be reasonable to skip them. Signed-off-by: Yauheni Kaliuta Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220908120146.381218-1-ykaliuta@redhat.com commit 9f2f5d7830ddfeeca147595f473e14eadbeb3db1 Author: Yonghong Song Date: Fri Sep 9 19:52:14 2022 -0700 libbpf: Improve BPF_PROG2 macro code quality and description Commit 34586d29f8df ("libbpf: Add new BPF_PROG2 macro") added BPF_PROG2 macro for trampoline based programs with struct arguments. Andrii made a few suggestions to improve code quality and description. This patch implemented these suggestions including better internal macro name, consistent usage pattern for __builtin_choose_expr(), simpler macro definition for always-inline func arguments and better macro description. Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20220910025214.1536510-1-yhs@fb.com commit c12a03766788befbb65fc2a87891c9ece8abad07 Merge: 3a74904ceff3e e5a9df51c7467 Author: Andrii Nakryiko Date: Wed Sep 21 16:24:18 2022 -0700 Merge branch 'bpf: Add user-space-publisher ring buffer map type' David Vernet says: ==================== This patch set defines a new map type, BPF_MAP_TYPE_USER_RINGBUF, which provides single-user-space-producer / single-kernel-consumer semantics over a ring buffer. Along with the new map type, a helper function called bpf_user_ringbuf_drain() is added which allows a BPF program to specify a callback with the following signature, to which samples are posted by the helper: void (struct bpf_dynptr *dynptr, void *context); The program can then use the bpf_dynptr_read() or bpf_dynptr_data() helper functions to safely read the sample from the dynptr. There are currently no helpers available to determine the size of the sample, but one could easily be added if required. On the user-space side, libbpf has been updated to export a new 'struct ring_buffer_user' type, along with the following symbols: struct ring_buffer_user * ring_buffer_user__new(int map_fd, const struct ring_buffer_user_opts *opts); void ring_buffer_user__free(struct ring_buffer_user *rb); void *ring_buffer_user__reserve(struct ring_buffer_user *rb, uint32_t size); void *ring_buffer_user__poll(struct ring_buffer_user *rb, uint32_t size, int timeout_ms); void ring_buffer_user__discard(struct ring_buffer_user *rb, void *sample); void ring_buffer_user__submit(struct ring_buffer_user *rb, void *sample); These symbols are exported for inclusion in libbpf version 1.0.0. Signed-off-by: David Vernet --- v5 -> v6: - Fixed s/BPF_MAP_TYPE_RINGBUF/BPF_MAP_TYPE_USER_RINGBUF typo in the libbpf user ringbuf doxygen header comment for ring_buffer_user__new() (Andrii). - Specify that pointer returned from ring_buffer_user__reserve() and its blocking counterpart is 8-byte aligned (Andrii). - Renamed user_ringbuf__commit() to user_ringbuf_commit(), as it's static (Andrii). - Another slight reworking of user_ring_buffer__reserve_blocking() to remove some extraneous nanosecond variables + checking (Andrii). - Add a final check of user_ring_buffer__reserve() in user_ring_buffer__reserve_blocking(). - Moved busy bit lock / unlock logic from __bpf_user_ringbuf_peek() to bpf_user_ringbuf_drain() (Andrii). - -ENOSPC -> -ENODATA for an empty ring buffer in __bpf_user_ringbuf_peek() (Andrii). - Updated BPF_RB_FORCE_WAKEUP to only force a wakeup notification to be sent if even if no sample was drained. - Changed a bit of the wording in the UAPI header for bpf_user_ringbuf_drain() to mention the BPF_RB_FORCE_WAKEUP behavior. - Remove extra space after return in ringbuf_map_poll_user() (Andrii). - Removed now-extraneous paragraph from the commit summary of patch 2/4 (Andrii). v4 -> v5: - DENYLISTed the user-ringbuf test suite on s390x. We have a number of functions in the progs/user_ringbuf_success.c prog that user-space fires by invoking a syscall. Not all of these syscalls are available on s390x. If and when we add the ability to kick the kernel from user-space, or if we end up using iterators for that per Hao's suggestion, we could re-enable this test suite on s390x. - Fixed a few more places that needed ringbuffer -> ring buffer. v3 -> v4: - Update BPF_MAX_USER_RINGBUF_SAMPLES to not specify a bit, and instead just specify a number of samples. (Andrii) - Update "ringbuffer" in comments and commit summaries to say "ring buffer". (Andrii) - Return -E2BIG from bpf_user_ringbuf_drain() both when a sample can't fit into the ring buffer, and when it can't fit into a dynptr. (Andrii) - Don't loop over samples in __bpf_user_ringbuf_peek() if a sample was discarded. Instead, return -EAGAIN so the caller can deal with it. Also updated the caller to detect -EAGAIN and skip over it when iterating. (Andrii) - Removed the heuristic for notifying user-space when a sample is drained, causing the ring buffer to no longer be full. This may be useful in the future, but is being removed now because it's strictly a heuristic. - Re-add BPF_RB_FORCE_WAKEUP flag to bpf_user_ringbuf_drain(). (Andrii) - Remove helper_allocated_dynptr tracker from verifier. (Andrii) - Add libbpf function header comments to tools/lib/bpf/libbpf.h, so that they will be included in rendered libbpf docs. (Andrii) - Add symbols to a new LIBBPF_1.1.0 section in linker version script, rather than including them in LIBBPF_1.0.0. (Andrii) - Remove libbpf_err() calls from static libbpf functions. (Andrii) - Check user_ring_buffer_opts instead of ring_buffer_opts in user_ring_buffer__new(). (Andrii) - Avoid an extra if in the hot path in user_ringbuf__commit(). (Andrii) - Use ENOSPC rather than ENODATA if no space is available in the ring buffer. (Andrii) - Don't round sample size in header to 8, but still round size that is reserved and written to 8, and validate positions are multiples of 8 (Andrii). - Use nanoseconds for most calculations in user_ring_buffer__reserve_blocking(). (Andrii) - Don't use CHECK() in testcases, instead use ASSERT_*. (Andrii) - Use SEC("?raw_tp") instead of SEC("?raw_tp/sys_nanosleep") in negative test. (Andrii) - Move test_user_ringbuf.h header to live next to BPF program instead of a directory up from both it and the user-space test program. (Andrii) - Update bpftool help message / docs to also include user_ringbuf. v2 -> v3: - Lots of formatting fixes, such as keeping things on one line if they fit within 100 characters, and removing some extraneous newlines. Applies to all diffs in the patch-set. (Andrii) - Renamed ring_buffer_user__* symbols to user_ring_buffer__*. (Andrii) - Added a missing smb_mb__before_atomic() in __bpf_user_ringbuf_sample_release(). (Hao) - Restructure how and when notification events are sent from the kernel to the user-space producers via the .map_poll() callback for the BPF_MAP_TYPE_USER_RINGBUF map. Before, we only sent a notification when the ringbuffer was fully drained. Now, we guarantee user-space that we'll send an event at least once per bpf_user_ringbuf_drain(), as long as at least one sample was drained, and BPF_RB_NO_WAKEUP was not passed. As a heuristic, we also send a notification event any time a sample being drained causes the ringbuffer to no longer be full. (Andrii) - Continuing on the above point, updated user_ring_buffer__reserve_blocking() to loop around epoll_wait() until a sufficiently large sample is found. (Andrii) - Communicate BPF_RINGBUF_BUSY_BIT and BPF_RINGBUF_DISCARD_BIT in sample headers. The ringbuffer implementation still only supports single-producer semantics, but we can now add synchronization support in user_ring_buffer__reserve(), and will automatically get multi-producer semantics. (Andrii) - Updated some commit summaries, specifically adding more details where warranted. (Andrii) - Improved function documentation for bpf_user_ringbuf_drain(), more clearly explaining all function arguments and return types, as well as the semantics for waking up user-space producers. - Add function header comments for user_ring_buffer__reserve{_blocking}(). (Andrii) - Rounding-up all samples to 8-bytes in the user-space producer, and enforcing that all samples are properly aligned in the kernel. (Andrii) - Added testcases that verify that bpf_user_ringbuf_drain() properly validates samples, and returns error conditions if any invalid samples are encountered. (Andrii) - Move atomic_t busy field out of the consumer page, and into the struct bpf_ringbuf. (Andrii) - Split ringbuf_map_{mmap, poll}_{kern, user}() into separate implementations. (Andrii) - Don't silently consume errors in bpf_user_ringbuf_drain(). (Andrii) - Remove magic number of samples (4096) from bpf_user_ringbuf_drain(), and instead use BPF_MAX_USER_RINGBUF_SAMPLES macro, which allows 128k samples. (Andrii) - Remove MEM_ALLOC modifier from PTR_TO_DYNPTR register in verifier, and instead rely solely on the register being PTR_TO_DYNPTR. (Andrii) - Move freeing of atomic_t busy bit to before we invoke irq_work_queue() in __bpf_user_ringbuf_sample_release(). (Andrii) - Only check for BPF_RB_NO_WAKEUP flag in bpf_ringbuf_drain(). - Remove libbpf function names from kernel smp_{load, store}* comments in the kernel. (Andrii) - Don't use double-underscore naming convention in libbpf functions. (Andrii) - Use proper __u32 and __u64 for types where we need to guarantee their size. (Andrii) v1 -> v2: - Following Joanne landing 883743422ced ("bpf: Fix ref_obj_id for dynptr data slices in verifier") [0], removed [PATCH 1/5] bpf: Clear callee saved regs after updating REG0 [1]. (Joanne) - Following the above adjustment, updated check_helper_call() to not store a reference for bpf_dynptr_data() if the register containing the dynptr is of type MEM_ALLOC. (Joanne) - Fixed casting issue pointed out by kernel test robot by adding a missing (uintptr_t) cast. (lkp) [0] https://lore.kernel.org/all/20220809214055.4050604-1-joannelkoong@gmail.com/ [1] https://lore.kernel.org/all/20220808155341.2479054-1-void@manifault.com/ ==================== Signed-off-by: Andrii Nakryiko commit e5a9df51c74671cfe15af1d50e5f508bd3efddab Author: David Vernet Date: Mon Sep 19 19:01:00 2022 -0500 selftests/bpf: Add selftests validating the user ringbuf This change includes selftests that validate the expected behavior and APIs of the new BPF_MAP_TYPE_USER_RINGBUF map type. Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220920000100.477320-5-void@manifault.com commit b66ccae01f1ddce47fe2c7f393a3a5c5ab3d7f06 Author: David Vernet Date: Mon Sep 19 19:00:59 2022 -0500 bpf: Add libbpf logic for user-space ring buffer Now that all of the logic is in place in the kernel to support user-space produced ring buffers, we can add the user-space logic to libbpf. This patch therefore adds the following public symbols to libbpf: struct user_ring_buffer * user_ring_buffer__new(int map_fd, const struct user_ring_buffer_opts *opts); void *user_ring_buffer__reserve(struct user_ring_buffer *rb, __u32 size); void *user_ring_buffer__reserve_blocking(struct user_ring_buffer *rb, __u32 size, int timeout_ms); void user_ring_buffer__submit(struct user_ring_buffer *rb, void *sample); void user_ring_buffer__discard(struct user_ring_buffer *rb, void user_ring_buffer__free(struct user_ring_buffer *rb); A user-space producer must first create a struct user_ring_buffer * object with user_ring_buffer__new(), and can then reserve samples in the ring buffer using one of the following two symbols: void *user_ring_buffer__reserve(struct user_ring_buffer *rb, __u32 size); void *user_ring_buffer__reserve_blocking(struct user_ring_buffer *rb, __u32 size, int timeout_ms); With user_ring_buffer__reserve(), a pointer to a 'size' region of the ring buffer will be returned if sufficient space is available in the buffer. user_ring_buffer__reserve_blocking() provides similar semantics, but will block for up to 'timeout_ms' in epoll_wait if there is insufficient space in the buffer. This function has the guarantee from the kernel that it will receive at least one event-notification per invocation to bpf_ringbuf_drain(), provided that at least one sample is drained, and the BPF program did not pass the BPF_RB_NO_WAKEUP flag to bpf_ringbuf_drain(). Once a sample is reserved, it must either be committed to the ring buffer with user_ring_buffer__submit(), or discarded with user_ring_buffer__discard(). Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220920000100.477320-4-void@manifault.com commit 20571567384428dfc9fe5cf9f2e942e1df13c2dd Author: David Vernet Date: Mon Sep 19 19:00:58 2022 -0500 bpf: Add bpf_user_ringbuf_drain() helper In a prior change, we added a new BPF_MAP_TYPE_USER_RINGBUF map type which will allow user-space applications to publish messages to a ring buffer that is consumed by a BPF program in kernel-space. In order for this map-type to be useful, it will require a BPF helper function that BPF programs can invoke to drain samples from the ring buffer, and invoke callbacks on those samples. This change adds that capability via a new BPF helper function: bpf_user_ringbuf_drain(struct bpf_map *map, void *callback_fn, void *ctx, u64 flags) BPF programs may invoke this function to run callback_fn() on a series of samples in the ring buffer. callback_fn() has the following signature: long callback_fn(struct bpf_dynptr *dynptr, void *context); Samples are provided to the callback in the form of struct bpf_dynptr *'s, which the program can read using BPF helper functions for querying struct bpf_dynptr's. In order to support bpf_ringbuf_drain(), a new PTR_TO_DYNPTR register type is added to the verifier to reflect a dynptr that was allocated by a helper function and passed to a BPF program. Unlike PTR_TO_STACK dynptrs which are allocated on the stack by a BPF program, PTR_TO_DYNPTR dynptrs need not use reference tracking, as the BPF helper is trusted to properly free the dynptr before returning. The verifier currently only supports PTR_TO_DYNPTR registers that are also DYNPTR_TYPE_LOCAL. Note that while the corresponding user-space libbpf logic will be added in a subsequent patch, this patch does contain an implementation of the .map_poll() callback for BPF_MAP_TYPE_USER_RINGBUF maps. This .map_poll() callback guarantees that an epoll-waiting user-space producer will receive at least one event notification whenever at least one sample is drained in an invocation of bpf_user_ringbuf_drain(), provided that the function is not invoked with the BPF_RB_NO_WAKEUP flag. If the BPF_RB_FORCE_WAKEUP flag is provided, a wakeup notification is sent even if no sample was drained. Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220920000100.477320-3-void@manifault.com commit 583c1f420173f7d84413a1a1fbf5109d798b4faa Author: David Vernet Date: Mon Sep 19 19:00:57 2022 -0500 bpf: Define new BPF_MAP_TYPE_USER_RINGBUF map type We want to support a ringbuf map type where samples are published from user-space, to be consumed by BPF programs. BPF currently supports a kernel -> user-space circular ring buffer via the BPF_MAP_TYPE_RINGBUF map type. We'll need to define a new map type for user-space -> kernel, as none of the helpers exported for BPF_MAP_TYPE_RINGBUF will apply to a user-space producer ring buffer, and we'll want to add one or more helper functions that would not apply for a kernel-producer ring buffer. This patch therefore adds a new BPF_MAP_TYPE_USER_RINGBUF map type definition. The map type is useless in its current form, as there is no way to access or use it for anything until we one or more BPF helpers. A follow-on patch will therefore add a new helper function that allows BPF programs to run callbacks on samples that are published to the ring buffer. Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220920000100.477320-2-void@manifault.com commit 0e32818397426a688f598f35d3bc762eca6d7592 Author: Maciej W. Rozycki Date: Wed Sep 21 20:49:16 2022 +0100 PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge When pci_assign_resource() is unable to assign resources to a BAR, it uses pci_revert_fw_address() to fall back to a firmware assignment (if any). Previously pci_revert_fw_address() assumed all addresses could reach the device, but this is not true if the device is below a bridge that only forwards addresses within its windows. This problem was observed on a Tyan Tomcat IV S1564D system where the BIOS did not assign valid addresses to several bridges and USB devices: pci 0000:00:11.0: PCI-to-PCIe bridge to [bus 01-ff] pci 0000:00:11.0: bridge window [io 0xe000-0xefff] pci 0000:01:00.0: PCIe Upstream Port to [bus 02-ff] pci 0000:01:00.0: bridge window [io 0x0000-0x0fff] # unreachable pci 0000:02:02.0: PCIe Downstream Port to [bus 05-ff] pci 0000:02:02.0: bridge window [io 0x0000-0x0fff] # unreachable pci 0000:05:00.0: PCIe-to-PCI bridge to [bus 06-ff] pci 0000:05:00.0: bridge window [io 0x0000-0x0fff] # unreachable pci 0000:06:08.0: USB UHCI 1.1 pci 0000:06:08.0: BAR 4: [io 0xfce0-0xfcff] # unreachable pci 0000:06:08.1: USB UHCI 1.1 pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] # unreachable pci 0000:06:08.0: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window pci 0000:06:08.1: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window During the first pass of assigning unassigned resources, there was not enough I/O space available, so we couldn't assign the 06:08.0 BAR and reverted to the firmware assignment (still unreachable). Reverting the 06:08.1 assignment failed because it conflicted with 06:08.0: pci 0000:00:11.0: bridge window [io 0xe000-0xefff] pci 0000:01:00.0: no space for bridge window [io size 0x2000] pci 0000:02:02.0: no space for bridge window [io size 0x1000] pci 0000:05:00.0: no space for bridge window [io size 0x1000] pci 0000:06:08.0: BAR 4: no space for [io size 0x0020] pci 0000:06:08.0: BAR 4: trying firmware assignment [io 0xfce0-0xfcff] pci 0000:06:08.1: BAR 4: no space for [io size 0x0020] pci 0000:06:08.1: BAR 4: trying firmware assignment [io 0xfce0-0xfcff] pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] conflicts with 0000:06:08.0 [io 0xfce0-0xfcff] A subsequent pass assigned valid bridge windows and a valid 06:08.1 BAR, but left the 06:08.0 BAR alone, so the UHCI device was still unusable: pci 0000:00:11.0: bridge window [io 0xe000-0xefff] released pci 0000:00:11.0: bridge window [io 0x1000-0x2fff] # reassigned pci 0000:01:00.0: bridge window [io 0x1000-0x2fff] # reassigned pci 0000:02:02.0: bridge window [io 0x2000-0x2fff] # reassigned pci 0000:05:00.0: bridge window [io 0x2000-0x2fff] # reassigned pci 0000:06:08.0: BAR 4: assigned [io 0xfce0-0xfcff] # left alone pci 0000:06:08.1: BAR 4: assigned [io 0x2000-0x201f] ... uhci_hcd 0000:06:08.0: host system error, PCI problems? uhci_hcd 0000:06:08.0: host controller process error, something bad happened! uhci_hcd 0000:06:08.0: host controller halted, very bad! uhci_hcd 0000:06:08.0: HCRESET not completed yet! uhci_hcd 0000:06:08.0: HC died; cleaning up If the address assigned by firmware is not reachable because it's not within upstream bridge windows, fail instead of assigning the unusable address from firmware. [bhelgaas: commit log, use pci_upstream_bridge()] Link: https://bugzilla.kernel.org/show_bug.cgi?id=16263 Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203012338460.46819@angie.orcam.me.uk Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209211921250.29493@angie.orcam.me.uk Fixes: 58c84eda0756 ("PCI: fall back to original BIOS BAR addresses") Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v2.6.35+ commit ed680f925aea76ac666f34d9923cb40558f4e97b Author: Luiz Augusto von Dentz Date: Mon Sep 19 11:10:17 2022 -0700 Bluetooth: hci_event: Make sure ISO events don't affect non-ISO connections ISO events (CIS/BIS) shall only be relevant for connection with link type of ISO_LINK, otherwise the controller is probably buggy or it is the result of fuzzer tools such as syzkaller. Signed-off-by: Luiz Augusto von Dentz commit 7096daba731eea262e0f7bf03453ceddcad89f70 Author: Luiz Augusto von Dentz Date: Mon Sep 19 10:57:00 2022 -0700 Bluetooth: hci_debugfs: Fix not checking conn->debugfs hci_debugfs_create_conn shall check if conn->debugfs has already been created and don't attempt to overwrite it. Signed-off-by: Luiz Augusto von Dentz commit 448a496f760664d3e2e79466aa1787e6abc922b5 Author: Luiz Augusto von Dentz Date: Mon Sep 19 10:56:59 2022 -0700 Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times device_add shall not be called multiple times as stated in its documentation: 'Do not call this routine or device_register() more than once for any device structure' Syzkaller reports a bug as follows [1]: ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:33! invalid opcode: 0000 [#1] PREEMPT SMP KASAN [...] Call Trace: __list_add include/linux/list.h:69 [inline] list_add_tail include/linux/list.h:102 [inline] kobj_kset_join lib/kobject.c:164 [inline] kobject_add_internal+0x18f/0x8f0 lib/kobject.c:214 kobject_add_varg lib/kobject.c:358 [inline] kobject_add+0x150/0x1c0 lib/kobject.c:410 device_add+0x368/0x1e90 drivers/base/core.c:3452 hci_conn_add_sysfs+0x9b/0x1b0 net/bluetooth/hci_sysfs.c:53 hci_le_cis_estabilished_evt+0x57c/0xae0 net/bluetooth/hci_event.c:6799 hci_le_meta_evt+0x2b8/0x510 net/bluetooth/hci_event.c:7110 hci_event_func net/bluetooth/hci_event.c:7440 [inline] hci_event_packet+0x63d/0xfd0 net/bluetooth/hci_event.c:7495 hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Link: https://syzkaller.appspot.com/bug?id=da3246e2d33afdb92d66bc166a0934c5b146404a Signed-off-by: Luiz Augusto von Dentz Tested-by: Hawkins Jiawei commit 6287e55cc080bab4b02b57fde51260ce8b23bd6e Merge: 6fb4825e492b0 236b8f5dc75d5 Author: Jakub Kicinski Date: Wed Sep 21 14:32:23 2022 -0700 Merge branch 'net-hns3-updates-for-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. ==================== Link: https://lore.kernel.org/r/20220916023803.23756-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 236b8f5dc75d59ce970d1c1368f2935bcc6ca224 Author: Guangbin Huang Date: Fri Sep 16 10:38:03 2022 +0800 net: hns3: add judge fd ability for sync and clear process of flow director Currently, driver will always clear user defined field of flow director in uninit process and sync flow director table in periodic task. However, if hardware does not support flow director driver should not do those processes, so add fd ability judgement. The fd ability judgement in function hclge_clear_fd_rules_in_list() is redundant, so delete it. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 09431ed8de874881e2d5d430042d718ae074d371 Author: Hao Lan Date: Fri Sep 16 10:38:02 2022 +0800 net: hns3: refactor function hclge_mbx_handler() Currently, the function hclge_mbx_handler() has too many switch-case statements, it makes this function too long. To improve code readability, refactor this function and use lookup table instead. Signed-off-by: Hao Lan Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit dfea275e06c26690b1ef27399fd84ce50372b85c Author: Guangbin Huang Date: Fri Sep 16 10:38:01 2022 +0800 net: hns3: optimize converting dscp to priority process of hns3_nic_select_queue() Currently, when function hns3_nic_select_queue() converts dscp to priority, it calls an indirect callback ae_algo->ops->get_dscp_prio to get priority. However as function hns3_nic_select_queue() is in fast path, the indirect call may cause degradation of performance. For optimization, this patch moves dscp_app_cnt and dscp_prio from struct hclge_tm_info to struct hnae3_knic_private_info, so they can be used in both hclge and hns3 layers. Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 04b6ba143521f4485b7f2c36c655b262a79dae97 Author: Yonglong Liu Date: Fri Sep 16 10:38:00 2022 +0800 net: hns3: add support for external loopback test This patch add support for external loopback test. The successful test need the link is up with duplex full. The driver do external loopback first, and then the whole offline test. Signed-off-by: Yonglong Liu Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 8addbfc7b308d591f8a5f2f6bb24d08d9d79dfbb Author: Kumar Kartikeya Dwivedi Date: Wed Sep 21 16:35:50 2022 +0200 bpf: Gate dynptr API behind CAP_BPF This has been enabled for unprivileged programs for only one kernel release, hence the expected annoyances due to this move are low. Users using ringbuf can stick to non-dynptr APIs. The actual use cases dynptr is meant to serve may not make sense in unprivileged BPF programs. Hence, gate these helpers behind CAP_BPF and limit use to privileged BPF programs. Fixes: 263ae152e962 ("bpf: Add bpf_dynptr_from_mem for local dynptrs") Fixes: bc34dee65a65 ("bpf: Dynptr support for ring buffers") Fixes: 13bbbfbea759 ("bpf: Add bpf_dynptr_read and bpf_dynptr_write") Fixes: 34d4ef5775f7 ("bpf: Add dynptr data slices") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220921143550.30247-1-memxor@gmail.com Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit 3c28a76124b25882411f005924be73795b6ef078 Author: Yi Liu Date: Wed Sep 21 18:44:01 2022 +0800 vfio: Add struct device to vfio_device and replace kref. With it a 'vfio-dev/vfioX' node is created under the sysfs path of the parent, indicating the device is bound to a vfio driver, e.g.: /sys/devices/pci0000\:6f/0000\:6f\:01.0/vfio-dev/vfio0 It is also a preparatory step toward adding cdev for supporting future device-oriented uAPI. Add Documentation/ABI/testing/sysfs-devices-vfio-dev. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-16-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 4a725b8de4cc5e88c00f7607d9ba0e97151251e5 Author: Kevin Tian Date: Wed Sep 21 18:44:00 2022 +0800 vfio: Rename vfio_device_put() and vfio_device_try_get() With the addition of vfio_put_device() now the names become confusing. vfio_put_device() is clear from object life cycle p.o.v given kref. vfio_device_put()/vfio_device_try_get() are helpers for tracking users on a registered device. Now rename them: - vfio_device_put() -> vfio_device_put_registration() - vfio_device_try_get() -> vfio_device_try_get_registration() Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20220921104401.38898-15-kevin.tian@intel.com Signed-off-by: Alex Williamson commit ebb72b765fb49685c4603d2bff47a4ab5d2580a9 Author: Kevin Tian Date: Wed Sep 21 18:43:59 2022 +0800 vfio/ccw: Use the new device life cycle helpers ccw is the only exception which cannot use vfio_alloc_device() because its private device structure is designed to serve both mdev and parent. Life cycle of the parent is managed by css_driver so vfio_ccw_private must be allocated/freed in css_driver probe/remove path instead of conforming to vfio core life cycle for mdev. Given that use a wait/completion scheme so the mdev remove path waits after vfio_put_device() until receiving a completion notification from @release. The completion indicates that all active references on vfio_device have been released. After that point although free of vfio_ccw_private is delayed to css_driver it's at least guaranteed to have no parallel reference on released vfio device part from other code paths. memset() in @probe is removed. vfio_device is either already cleared when probed for the first time or cleared in @release from last probe. The right fix is to introduce separate structures for mdev and parent, but this won't happen in short term per prior discussions. Remove vfio_init/uninit_group_dev() as no user now. Suggested-by: Jason Gunthorpe Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Farman Link: https://lore.kernel.org/r/20220921104401.38898-14-kevin.tian@intel.com Signed-off-by: Alex Williamson commit ac1237912fbd0f2503344aa268ceb43628cdffa8 Author: Kevin Tian Date: Wed Sep 21 18:43:58 2022 +0800 vfio/amba: Use the new device life cycle helpers Implement amba's own vfio_device_ops. Remove vfio_platform_probe/remove_common() given no user now. Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20220921104401.38898-13-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 5f6c7e0831a1f1faffad43bb8dbc260b49f2d3dc Author: Kevin Tian Date: Wed Sep 21 18:43:57 2022 +0800 vfio/platform: Use the new device life cycle helpers Move vfio_device_ops from platform core to platform drivers so device specific init/cleanup can be added. Introduce two new helpers vfio_platform_init/release_common() for the use in driver @init/@release. vfio_platform_probe/remove_common() will be deprecated. Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Tested-by: Eric Auger Link: https://lore.kernel.org/r/20220921104401.38898-12-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 7566692c571dced7208b7cc26c1d3b898a233487 Author: Yi Liu Date: Wed Sep 21 18:43:56 2022 +0800 vfio/fsl-mc: Use the new device life cycle helpers Also add a comment to mark that vfio core releases device_set if @init fails. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-11-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 7cb5a82eb162d268f65c7b0fbec4a5f6495bab79 Author: Yi Liu Date: Wed Sep 21 18:43:55 2022 +0800 vfio/ap: Use the new device life cycle helpers and manage available_instances inside @init/@release. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Tony Krowiak Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-10-kevin.tian@intel.com Signed-off-by: Alex Williamson commit a5ddd2a99a7a393ceb023b83d7e78fbb3284bcfd Author: Kevin Tian Date: Wed Sep 21 18:43:54 2022 +0800 drm/i915/gvt: Use the new device life cycle helpers Move vfio_device to the start of intel_vgpu as required by the new helpers. Change intel_gvt_create_vgpu() to use intel_vgpu as the first param as other vgpu helpers do. Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Zhenyu Wang Link: https://lore.kernel.org/r/20220921104401.38898-9-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 3d5d18e1f899ac3b03e108aef8560f4cb0969da1 Author: Yi Liu Date: Wed Sep 21 18:43:53 2022 +0800 vfio/mbochs: Use the new device life cycle helpers and manage avail_mbytes inside @init/@release. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-8-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 67c5a1814f4c1ad0e61f11112010057191730853 Author: Yi Liu Date: Wed Sep 21 18:43:52 2022 +0800 vfio/mtty: Use the new device life cycle helpers and manage available ports inside @init/@release. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-7-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 6d965885f4ea82f916d31f17f67b2ad771bdabac Author: Marcus Folkesson Date: Mon Aug 15 08:16:24 2022 +0200 iio: adc: mcp3911: add support for oversampling ratio The chip supports oversampling ratio, so expose it to userspace. Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220815061625.35568-9-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 603c09f2873d6e86dce636c9e5ae330e2c033940 Author: Yi Liu Date: Wed Sep 21 18:43:51 2022 +0800 vfio/mdpy: Use the new device life cycle helpers and manage mdpy_count inside @init/@release. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-6-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 1a84fa695c7385b4f5547795149cb0bdd1073be8 Author: Marcus Folkesson Date: Mon Aug 15 08:16:23 2022 +0200 dt-bindings: iio: adc: mcp3911: add microchip,data-ready-hiz entry The Data Ready Output Pin is either hard wired to work as high impedance or push-pull. Make it configurable. Signed-off-by: Marcus Folkesson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220815061625.35568-8-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 27aeb915595b87165a3004aab05b2b837d01e6ed Author: Yi Liu Date: Wed Sep 21 18:43:50 2022 +0800 vfio/hisi_acc: Use the new device life cycle helpers Tidy up @probe so all migration specific initialization logic is moved to migration specific @init callback. Remove vfio_pci_core_{un}init_device() given no user now. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220921104401.38898-5-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 08a65f61db69ae4850c3c15e8fbe6293a09a998d Author: Marcus Folkesson Date: Mon Aug 15 08:16:22 2022 +0200 iio: adc: mcp3911: add support for interrupts Make it possible to read values upon interrupts. Configure Data Ready Signal Output Pin to either HiZ or push-pull and use it as interrupt source. Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220815061625.35568-7-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit d3966e305ac4e0b5a63f784d9152fac4961554de Author: Yi Liu Date: Wed Sep 21 18:43:49 2022 +0800 vfio/mlx5: Use the new device life cycle helpers mlx5 has its own @init/@release for handling migration cap. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-4-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 5db9f38d394f1204f55934e27fe023de1064d317 Author: Marcus Folkesson Date: Mon Aug 15 08:16:21 2022 +0200 iio: adc: mcp3911: add support for buffers Add support for buffers to make the driver fit for more use cases. Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220815061625.35568-6-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 63d7c77989de98d3e92611dbb858028b74dca377 Author: Yi Liu Date: Wed Sep 21 18:43:48 2022 +0800 vfio/pci: Use the new device life cycle helpers Also introduce two pci core helpers as @init/@release for pci drivers: - vfio_pci_core_init_dev() - vfio_pci_core_release_dev() Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220921104401.38898-3-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 0e0a07adaff9718f22a55148c764a3d9dd2e1c5c Author: Marcus Folkesson Date: Mon Aug 15 08:16:20 2022 +0200 iio: adc: mcp3911: use resource-managed version of iio_device_register Keep using managed resources as much as possible. Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220815061625.35568-5-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit cb9ff3f3b84c95867856c3be42de73972feb1249 Author: Kevin Tian Date: Wed Sep 21 18:43:47 2022 +0800 vfio: Add helpers for unifying vfio_device life cycle The idea is to let vfio core manage the vfio_device life cycle instead of duplicating the logic cross drivers. This is also a preparatory step for adding struct device into vfio_device. New pair of helpers together with a kref in vfio_device: - vfio_alloc_device() - vfio_put_device() Drivers can register @init/@release callbacks to manage any private state wrapping the vfio_device. However vfio-ccw doesn't fit this model due to a life cycle mess that its private structure mixes both parent and mdev info hence must be allocated/freed outside of the life cycle of vfio device. Per prior discussions this won't be fixed in short term by IBM folks. Instead of waiting for those modifications introduce another helper vfio_init_device() so ccw can call it to initialize a pre-allocated vfio_device. Further implication of the ccw trick is that vfio_device cannot be freed uniformly in vfio core. Instead, require *EVERY* driver to implement @release and free vfio_device inside. Then ccw can choose to delay the free at its own discretion. Another trick down the road is that kvzalloc() is used to accommodate the need of gvt which uses vzalloc() while all others use kzalloc(). So drivers should call a helper vfio_free_device() to free the vfio_device instead of assuming that kfree() or vfree() is appliable. Later once the ccw mess is fixed we can remove those tricks and fully handle structure alloc/free in vfio core. Existing vfio_{un}init_group_dev() will be deprecated after all existing usages are converted to the new model. Suggested-by: Jason Gunthorpe Co-developed-by: Yi Liu Signed-off-by: Yi Liu Signed-off-by: Kevin Tian Reviewed-by: Tony Krowiak Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20220921104401.38898-2-kevin.tian@intel.com Signed-off-by: Alex Williamson commit 58e011609c4305fc50674c4610cbe8a8c26261f6 Author: Mika Westerberg Date: Mon Sep 5 11:02:32 2022 +0300 PCI: Fix typo in pci_scan_child_bus_extend() Should be 'if' not 'of'. Fix this. Link: https://lore.kernel.org/r/20220905080232.36087-7-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit 17d2d67d76e41c7fd00608fdad350e1790c5c24a Author: Mika Westerberg Date: Mon Sep 5 11:02:31 2022 +0300 PCI: Fix whitespace and indentation Drop two empty lines from pci_scan_child_bus_extend() and correct indentation in pci_bridge_distribute_available_resources() to better follow the kernel coding style. No functional impact. Link: https://lore.kernel.org/r/20220905080232.36087-6-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit e96e27fc6f7971380283768e9a734af16b1716ee Author: Mika Westerberg Date: Mon Sep 5 11:02:30 2022 +0300 PCI: Distribute available resources for root buses, too Previously we distributed spare resources only upon hot-add, so if the initial root bus scan found devices that had not been fully configured by the BIOS, we allocated only enough resources to cover what was then present. If some of those devices were hotplug bridges, we did not leave any additional resource space for future expansion. Distribute the available resources for root buses, too, to make this work the same way as the normal hotplug case. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Link: https://lore.kernel.org/r/20220905080232.36087-5-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit d1caf229c7587b5c514910fff8dc382e69fdcdf5 Author: Mika Westerberg Date: Mon Sep 5 11:02:29 2022 +0300 PCI: Move pci_assign_unassigned_root_bus_resources() We need to be able to call pci_bridge_distribute_available_resources() from this function so move it accordingly to avoid need for forward declaration. No functional impact. Link: https://lore.kernel.org/r/20220905080232.36087-4-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit 49ad31e9d78527045614c534df057cadee487773 Author: Mika Westerberg Date: Mon Sep 5 11:02:28 2022 +0300 PCI: Pass available buses even if the bridge is already configured If some part of the PCI topology is already configured (by the boot firmware) but not all, and it includes hotplug bridges, we may need to extend the bus resources of those bridges to accommodate any future hotplugs, in the same way we already do with the normal hotplug case. Pass the available buses to pci_scan_child_bus_extend() even when the bridge in question is already configured so the bus allocation code can use these available buses to extend the possible hotplug bridges below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Link: https://lore.kernel.org/r/20220905080232.36087-3-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit 435d6e6f02234ca0f2df88f4bdc2297da1529379 Author: Hawking Zhang Date: Wed Sep 21 21:55:52 2022 +0800 drm/amdgpu: add helper to init rlc fw in header v2_4 To initialize rlc firmware in header v2_4 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit a0d9084d7f6f5ae911b40d13ce33055b6c7aaddc Author: Hawking Zhang Date: Wed Sep 21 21:53:52 2022 +0800 drm/amdgpu: add helper to init rlc fw in header v2_3 To initialize rlc firmware in header v2_3 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit a97d0ec8bb7cb044d3d7d496a12704daa17dc636 Author: Hawking Zhang Date: Wed Sep 21 21:52:31 2022 +0800 drm/amdgpu: add helper to init rlc fw in header v2_2 To initialize rlc firmware in header v2_2 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit f3e6173b4bbdd9116c9a085998d237e1c2724a2e Author: Hawking Zhang Date: Wed Sep 21 21:50:33 2022 +0800 drm/amdgpu: add helper to init rlc fw in header v2_1 To initialize rlc firmware in header v2_1 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 0641dbefd4a14eb262583a595074431ff1ffd270 Author: Hawking Zhang Date: Wed Sep 21 21:48:27 2022 +0800 drm/amdgpu: add helper to init rlc fw in header v2_0 To initialize rlc firmware in header v2_0 Signed-off-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit 3e43b760c9e14fc0b7bd553efb01d9ca825cf338 Author: Philip Yang Date: Mon Sep 12 11:49:19 2022 -0400 drm/amdgpu: Fix amdgpu_vm_pt_free warning Free page table BO from vm resv unlocked context generate below warnings. Add a pt_free_work in vm to free page table BO from vm->pt_freed list. pass vm resv unlock status from page table update caller, and add vm_bo entry to vm->pt_freed list and schedule the pt_free_work if calling with vm resv unlocked. WARNING: CPU: 12 PID: 3238 at drivers/gpu/drm/ttm/ttm_bo.c:106 ttm_bo_set_bulk_move+0xa1/0xc0 Call Trace: amdgpu_vm_pt_free+0x42/0xd0 [amdgpu] amdgpu_vm_pt_free_dfs+0xb3/0xf0 [amdgpu] amdgpu_vm_ptes_update+0x52d/0x850 [amdgpu] amdgpu_vm_update_range+0x2a6/0x640 [amdgpu] svm_range_unmap_from_gpus+0x110/0x300 [amdgpu] svm_range_cpu_invalidate_pagetables+0x535/0x600 [amdgpu] __mmu_notifier_invalidate_range_start+0x1cd/0x230 unmap_vmas+0x9d/0x140 unmap_region+0xa8/0x110 Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c2dbd69e7b3a02b39ebac262c8c6c7f53df584c7 Author: Philip Yang Date: Fri Sep 16 09:30:43 2022 -0400 drm/amdgpu: Use vm status_lock to protect pt free Use vm_status_lock to protect all vm_status state transitions to allow them to happen without a reservation lock in unlocked page table updates. Signed-off-by: Philip Yang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 757eb2bedd08a1dde6dbb67abfdddef8d8a2e882 Author: Philip Yang Date: Thu Sep 15 23:21:15 2022 -0400 drm/amdgpu: Use vm status_lock to protect vm evicted list Use vm_status_lock to protect all vm_status state transitions to allow them to happen without a reservation lock in unlocked page table updates. Signed-off-by: Philip Yang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 998debbdc8f49bea4ea8bff9852faa170e996bb0 Author: Philip Yang Date: Thu Sep 15 23:08:52 2022 -0400 drm/amdgpu: Use vm status_lock to protect vm moved list Use vm_status_lock to protect all vm_status state transitions to allow them to happen without a reservation lock in unlocked page table updates. Signed-off-by: Philip Yang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c1806d78eca8df6e9c6d07652e1a0bf1c4669984 Author: Philip Yang Date: Thu Sep 15 22:54:01 2022 -0400 drm/amdgpu: Use vm status_lock to protect vm idle list Use vm_status_lock to protect all vm_status state transitions to allow them to happen without a reservation lock in unlocked page table updates. Signed-off-by: Philip Yang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b38e77cb7bebd341090f99021cefe6cf81604971 Author: Philip Yang Date: Thu Sep 15 22:47:46 2022 -0400 drm/amdgpu: Use vm status_lock to protect relocated list Use vm_status_lock to protect all vm_status state transitions to allow them to happen without a reservation lock in unlocked page table updates. Signed-off-by: Philip Yang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 0479956c94b1cfa6a1ab9206eff76072944ece8b Author: Philip Yang Date: Thu Sep 15 22:33:52 2022 -0400 drm/amdgpu: Rename vm invalidate lock to status_lock The vm status_lock will be used to protect all vm status lists. Signed-off-by: Philip Yang Reviewed-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6333cb31a711cc709b6a960d082e04546f4459ee Author: Yury Norov Date: Wed Sep 14 19:07:30 2022 -0700 tools: sync find_bit() implementation Sync find_first_bit() and find_next_bit() implementation with the mother kernel. Also, drop unused find_last_bit() and find_next_clump8(). Signed-off-by: Yury Norov commit e79864f3164c573afce09ec4b72b75ebe061c14d Author: Yury Norov Date: Wed Sep 14 19:07:29 2022 -0700 lib/find_bit: optimize find_next_bit() functions Over the past couple years, the function _find_next_bit() was extended with parameters that modify its behavior to implement and- zero- and le- flavors. The parameters are passed at compile time, but current design prevents a compiler from optimizing out the conditionals. As find_next_bit() API grows, I expect that more parameters will be added. Current design would require more conditional code in _find_next_bit(), which would bloat the helper even more and make it barely readable. This patch replaces _find_next_bit() with a macro FIND_NEXT_BIT, and adds a set of wrappers, so that the compile-time optimizations become possible. The common logic is moved to the new macro, and all flavors may be generated by providing a FETCH macro parameter, like in this example: #define FIND_NEXT_BIT(FETCH, MUNGE, size, start) ... find_next_xornot_and_bit(addr1, addr2, addr3, size, start) { return FIND_NEXT_BIT(addr1[idx] ^ ~addr2[idx] & addr3[idx], /* nop */, size, start); } The FETCH may be of any complexity, as soon as it only refers the bitmap(s) and an iterator idx. MUNGE is here to support _le code generation for BE builds. May be empty. I ran find_bit_benchmark 16 times on top of 6.0-rc2 and 16 times on top of 6.0-rc2 + this series. The results for kvm/x86_64 are: v6.0-rc2 Optimized Difference Z-score Random dense bitmap ns ns ns % find_next_bit: 787735 670546 117189 14.9 3.97 find_next_zero_bit: 777492 664208 113284 14.6 10.51 find_last_bit: 830925 687573 143352 17.3 2.35 find_first_bit: 3874366 3306635 567731 14.7 1.84 find_first_and_bit: 40677125 37739887 2937238 7.2 1.36 find_next_and_bit: 347865 304456 43409 12.5 1.35 Random sparse bitmap find_next_bit: 19816 14021 5795 29.2 6.10 find_next_zero_bit: 1318901 1223794 95107 7.2 1.41 find_last_bit: 14573 13514 1059 7.3 6.92 find_first_bit: 1313321 1249024 64297 4.9 1.53 find_first_and_bit: 8921 8098 823 9.2 4.56 find_next_and_bit: 9796 7176 2620 26.7 5.39 Where the statistics is significant (z-score > 3), the improvement is ~15%. According to the bloat-o-meter, the Image size is 10-11K less: x86_64/defconfig: add/remove: 32/14 grow/shrink: 61/782 up/down: 6344/-16521 (-10177) arm64/defconfig: add/remove: 3/2 grow/shrink: 50/714 up/down: 608/-11556 (-10948) Suggested-by: Linus Torvalds Signed-off-by: Yury Norov commit 14a99e130f2758bc826a7e7a8bdf6f7400b54f0f Author: Yury Norov Date: Wed Sep 14 19:07:28 2022 -0700 lib/find_bit: create find_first_zero_bit_le() find_first_zero_bit_le() is an alias to find_next_zero_bit_le(), despite that 'next' is known to be slower than 'first' version. Now that we have common FIND_FIRST_BIT() macro helper, it's trivial to implement find_first_zero_bit_le() as a real function. Reviewed-by: Valentin Schneider Signed-off-by: Yury Norov commit 58414bbb58a8b49af20e3accae56f6f8344b2424 Author: Yury Norov Date: Wed Sep 14 19:07:27 2022 -0700 lib/find_bit: introduce FIND_FIRST_BIT() macro Now that we have many flavors of find_first_bit(), and expect even more, it's better to have one macro that generates optimal code for all and makes maintaining of slightly different functions simpler. The logic common to all versions is moved to the new macro, and all the flavors are generated by providing an FETCH macro-parameter, like in this example: #define FIND_FIRST_BIT(FETCH, MUNGE, size) ... find_first_ornot_and_bit(addr1, addr2, addr3, size) { return FIND_FIRST_BIT(addr1[idx] | ~addr2[idx] & addr3[idx], /* nop */, size); } The FETCH may be of any complexity, as soon as it only refers the bitmap(s) and an iterator idx. MUNGE is here to support _le code generation for BE builds. May be empty. Suggested-by: Linus Torvalds Reviewed-by: Valentin Schneider Signed-off-by: Yury Norov commit 493108d95f1464ccd101d4e5cfa7e93f1fc64d47 Author: Pavel Begunkov Date: Wed Sep 21 12:17:54 2022 +0100 io_uring/net: zerocopy sendmsg Add a zerocopy version of sendmsg. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6aabc4bdfc0ec78df6ec9328137e394af9d4e7ef.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c4c0009e0b56ef9920020bcade1e45be52653bae Author: Pavel Begunkov Date: Wed Sep 21 12:17:53 2022 +0100 io_uring/net: combine fail handlers Merge io_send_zc_fail() into io_sendrecv_fail(), saves a few lines of code and some headache for following patch. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e0eba1d577413aef5602cd45f588b9230207082d.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b0e9b5517eb12fa80c72e205fe28534c2e2f39b9 Author: Pavel Begunkov Date: Wed Sep 21 12:17:52 2022 +0100 io_uring/net: rename io_sendzc() Simple renaming of io_sendzc*() functions in preparatio to adding a zerocopy sendmsg variant. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/265af46829e6076dd220011b1858dc3151969226.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 516e82f0e043a1a0e8d00800ed0ffe2137cf0e7e Author: Pavel Begunkov Date: Wed Sep 21 12:17:51 2022 +0100 io_uring/net: support non-zerocopy sendto We have normal sends, but what is missing is sendto-like requests. Add sendto() capabilities to IORING_OP_SEND by passing in addr just as we do for IORING_OP_SEND_ZC. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/69fbd8b2cb830e57d1bf9ec351e9bf95c5b77e3f.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6ae61b7aa2c758ce07347ebfa9c79b6f208098d5 Author: Pavel Begunkov Date: Wed Sep 21 12:17:50 2022 +0100 io_uring/net: refactor io_setup_async_addr Instead of passing the right address into io_setup_async_addr() only specify local on-stack storage and let the function infer where to grab it from. It optimises out one local variable we have to deal with. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6bfa9ab810d776853eb26ed59301e2536c3a5471.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5693bcce892d7b8b15a7a92b011d3d40a023b53c Author: Pavel Begunkov Date: Wed Sep 21 12:17:49 2022 +0100 io_uring/net: don't lose partial send_zc on fail Partial zc send may end up in io_req_complete_failed(), which not only would return invalid result but also mask out the notification leading to lifetime issues. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5673285b5e83e6ceca323727b4ddaa584b5cc91e.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7e6b638ed501cced4e472298d6b08dd16346f3a6 Author: Pavel Begunkov Date: Wed Sep 21 12:17:48 2022 +0100 io_uring/net: don't lose partial send/recv on fail Just as with rw, partial send/recv may end up in io_req_complete_failed() and loose the result, make sure we return the number of bytes processed. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a4ff95897b5419356fca9ea55db91ac15b2975f9.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 47b4c68660752facfa6247b1fc9ca9d722b8b601 Author: Pavel Begunkov Date: Wed Sep 21 12:17:47 2022 +0100 io_uring/rw: don't lose partial IO result on fail A partially done read/write may end up in io_req_complete_failed() and loose the result, make sure we return the number of bytes processed. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/05e0879c226bcd53b441bf92868eadd4bf04e2fc.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a47b255e90395bdb481975ab3d9e96fcf8b3165f Author: Pavel Begunkov Date: Wed Sep 21 12:17:46 2022 +0100 io_uring: add custom opcode hooks on fail Sometimes we have to do a little bit of a fixup on a request failuer in io_req_complete_failed(). Add a callback in opdef for that. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b734cff4e67cb30cca976b9face321023f37549a.1663668091.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3b8fdd1dc35e395d19efbc8391a809a5b954ecf4 Author: Jens Axboe Date: Sun Sep 11 06:40:37 2022 -0600 io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128 If we have doubly sized SQEs, then we need to shift the sq index by 1 to account for using two entries for a single request. The CQE dumping gets this right, but the SQE one does not. Improve the SQE dumping in general, the information dumped is pretty sparse and doesn't even cover the whole basic part of the SQE. Include information on the extended part of the SQE, if doubly sized SQEs are in use. A typical dump now looks like the following: [...] SQEs: 32 32: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2721, e0:0x0, e1:0xffffb8041000, e2:0x100000000000, e3:0x5500, e4:0x7, e5:0x0, e6:0x0, e7:0x0 33: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2722, e0:0x0, e1:0xffffb8043000, e2:0x100000000000, e3:0x5508, e4:0x7, e5:0x0, e6:0x0, e7:0x0 34: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2723, e0:0x0, e1:0xffffb8045000, e2:0x100000000000, e3:0x5510, e4:0x7, e5:0x0, e6:0x0, e7:0x0 [...] Fixes: ebdeb7c01d02 ("io_uring: add support for 128-byte SQEs") Signed-off-by: Jens Axboe commit 4f731705cc1f1591e15e1c3133de8ae3843c68ff Author: Jens Axboe Date: Sun Sep 11 06:36:09 2022 -0600 io_uring/fdinfo: get rid of unnecessary is_cqe32 variable We already have the cq_shift, just use that to tell if we have doubly sized CQEs or not. While in there, cleanup the CQE32 vs normal CQE size printing. Signed-off-by: Jens Axboe commit c0dc995eb2295e1be6b95b60c90c59f87b009bdb Author: Pavel Begunkov Date: Thu Sep 8 16:56:57 2022 +0100 io_uring: remove unused return from io_disarm_next We removed conditional io_commit_cqring_flush() guarding against spurious eventfd and the io_disarm_next()'s return value is not used anymore, just void it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9a441c9a32a58bcc586076fa9a7d0dc33f1fb3cb.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7924fdfeea814b4f7ff8a16de00951ad93cccf6c Author: Pavel Begunkov Date: Thu Sep 8 16:56:56 2022 +0100 io_uring: add fast path for io_run_local_work() We'll grab uring_lock and call __io_run_local_work() with several atomics inside even if there are no task works. Skip it if ->work_llist is empty. Signed-off-by: Pavel Begunkov Reviewed-by: Dylan Yudaken Link: https://lore.kernel.org/r/f6a885f372bad2d77d9cd87341b0a86a4000c0ff.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 1f8d5bbe98a10da5348b0fab2fa679ef8d033be5 Author: Pavel Begunkov Date: Thu Sep 8 16:56:55 2022 +0100 io_uring/iopoll: unify tw breaking logic Let's keep checks for whether to break the iopoll loop or not same for normal and defer tw, this includes ->cached_cq_tail checks guarding against polling more than asked for. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d2fa8a44f8114f55a4807528da438cde93815360.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 9d54bd6a3bb495f2e7e4996efdaf1bef6ad62272 Author: Pavel Begunkov Date: Thu Sep 8 16:56:54 2022 +0100 io_uring/iopoll: fix unexpected returns We may propagate a positive return value of io_run_task_work() out of io_iopoll_check(), which breaks our tests. io_run_task_work() doesn't return anything useful for us, ignore the return value. Fixes: c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN") Signed-off-by: Pavel Begunkov Reviewed-by: Dylan Yudaken Link: https://lore.kernel.org/r/c442bb87f79cea10b3f857cbd4b9a4f0a0493fa3.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6567506b68b0cae3934f1a58b35d709f38fc2e90 Author: Pavel Begunkov Date: Thu Sep 8 16:56:53 2022 +0100 io_uring: disallow defer-tw run w/ no submitters We try to restrict CQ waiters when IORING_SETUP_DEFER_TASKRUN is set, but if nothing has been submitted yet it'll allow any waiter, which violates the contract. Fixes: c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN") Signed-off-by: Pavel Begunkov Reviewed-by: Dylan Yudaken Link: https://lore.kernel.org/r/b4f0d3f14236d7059d08c5abe2661ef0b78b5528.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 76de6749d1bc1817367fedda94cd7c5d325df6c4 Author: Pavel Begunkov Date: Thu Sep 8 16:56:52 2022 +0100 io_uring: further limit non-owner defer-tw cq waiting In case of DEFER_TASK_WORK we try to restrict waiters to only one task, which is also the only submitter; however, we don't do it reliably, which might be very confusing and backfire in the future. E.g. we currently allow multiple tasks in io_iopoll_check(). Fixes: c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN") Signed-off-by: Pavel Begunkov Reviewed-by: Dylan Yudaken Link: https://lore.kernel.org/r/94c83c0a7fe468260ee2ec31bdb0095d6e874ba2.1662652536.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5514acb0dd030356e628cdd88b266efaa0a22315 Author: Serge Semin Date: Sat Sep 10 22:56:46 2022 +0300 dt-bindings: memory: snps,dw-umctl2-ddrc: Extend schema with IRQs/resets/clocks props First of all the DW uMCTL2 DDRC IP-core supports the individual IRQ lines for each standard event: ECC Corrected Error, ECC Uncorrected Error, ECC Address Protection, Scrubber-Done signal, DFI Parity/CRC Error. It's possible that the platform engineers merge them up in the IRQ controller level. So let's add both configuration support to the DT-schema. Secondly the DW uMCTL2 DDRC IP-core can have clock sources like APB reference clock, AXI-ports clock, main DDRC core reference clock and Scrubber low-power clock. In addition to that each clock domain can have a dedicated reset signal. Let's add the properties for at least the denoted clock sources and the corresponding reset controls. Note the IRQs and the phandles order is deliberately not fixed since some of the sources may be absent depending on the IP-core synthesize parameters and the particular platform setups. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910195659.11843-3-Sergey.Semin@baikalelectronics.ru commit 65c0c2367e9e695b13d0d39307ebc8818bcdbd8d Author: Zhang Rui Date: Tue Sep 20 20:58:48 2022 +0800 intel_idle: Add AlderLake-N support Similar to the other other AlderLake platforms, the C1 and C1E states on ADL-N are mutually exclusive. Only one of them can be enabled at a time. C1E is preferred on ADL-N for better energy efficiency. C6S is also supported on this platform. Its latency is far bigger than C6, but really close to C8 (PC8), thus it is not exposed as a separate state. Suggested-by: Baieswara Reddy Sagili Suggested-by: Vinay Kumar Signed-off-by: Zhang Rui [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit fc436e55a1abdac503e5b06ef57862a1bc944275 Author: Serge Semin Date: Sat Sep 10 22:56:45 2022 +0300 dt-bindings: memory: snps,dw-umctl2-ddrc: Replace opencoded numbers with macros Xilinx ZynqMP DDRC-based example contains the opencoded numerical literals in the IRQ lines definition. It doesn't seem justified since the corresponding platform has well defined ARM GIC interface. Let's replace the numbers with the corresponding macros then. Signed-off-by: Serge Semin Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910195659.11843-2-Sergey.Semin@baikalelectronics.ru commit 9f60675a0f2e72f7967cc534f1c97f6da3b47392 Author: Serge Semin Date: Sat Sep 10 22:42:33 2022 +0300 dt-bindings: memory: snps,dw-umctl2-ddrc: Use more descriptive device name The DT-schema name and the corresponding generic compatible string look inappropriate in the current DW uMCTL2 DDRC DT-bindings: 1. DT-schema name contains undefined vendor-prefix. It's supposed to be "snps", not "synopsys". 2. DT-schema name has "ecc" suffix. That is a device property, and has nothing to do with the controller actual name. 3. The controller name is different. It's DW uMCTL2 DDRC. Just DDRC doesn't identify the IP-core in subject. 4. There is no much point in using the IP-core version in the device name since it can be retrieved from the corresponding device CSR. Moreover the DW uMCTL2 DDRC driver doesn't differentiate the IP-core version at the current state. In order to fix all the inconsistencies described above we suggest to rename the DT-schema to "snps,dw-umctl2-ddrc.yaml", deprecate the compatible string "snps,ddrc-3.80a" and define a new generic device name as "snps,dw-umctl2-ddrc". Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910194237.10142-16-Sergey.Semin@baikalelectronics.ru commit c4e927da893b2d9ebe71ac206ed021df363771e4 Author: Srinivas Pandruvada Date: Tue Sep 20 04:08:02 2022 -0700 thermal: intel_powerclamp: Remove accounting for IRQ wakes There is a static variable "idle_wakeup_counter", which accounts for number of wake ups because of IRQs and take actions to compensate idle injection. This is now read and reset to 0, but never incremented. So all the usage of this counter for idle injection has no use. Also another static variable "reduce_irq", which depends on "idle_wakeup_counter", so remove usage of "reduce_irq" also. Commit feb6cd6a0f9f ("thermal/intel_powerclamp: stop sched tick in forced idle") replaced the local use of "mwait_idle_with_hints" with play_idle(). This removed possibility of updating "idle_wakeup_counter" without change in play_idle(). This change was made in Linux 4.10. Signed-off-by: Srinivas Pandruvada [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 845081313632b6a27dff576cf102b4aecb4654cf Author: Serge Semin Date: Sat Sep 10 22:42:32 2022 +0300 dt-bindings: memory: synopsys,ddrc-ecc: Detach Zynq DDRC controller support The Zynq A05 DDRC controller has nothing in common with DW uMCTL2 DDRC: the CSRs layout is absolutely different and it doesn't support IRQs unlike DW uMCTL2 DDR controller of all versions (v1.x, v2.x and v3.x). Thus there is no any reason to have these controllers described in the same bindings. Let's split the DT-schema up. Note since the synopsys,ddrc-ecc.yaml schema describes the Synopsys DW uMCTL2 DDR controller only, we need to accordingly fix the device descriptions. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910194237.10142-15-Sergey.Semin@baikalelectronics.ru commit 68b99e94a4a2db6ba9b31fe0485e057b9354a640 Author: Srinivas Pandruvada Date: Tue Sep 20 04:06:57 2022 -0700 thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash When CPU 0 is offline and intel_powerclamp is used to inject idle, it generates kernel BUG: BUG: using smp_processor_id() in preemptible [00000000] code: bash/15687 caller is debug_smp_processor_id+0x17/0x20 CPU: 4 PID: 15687 Comm: bash Not tainted 5.19.0-rc7+ #57 Call Trace: dump_stack_lvl+0x49/0x63 dump_stack+0x10/0x16 check_preemption_disabled+0xdd/0xe0 debug_smp_processor_id+0x17/0x20 powerclamp_set_cur_state+0x7f/0xf9 [intel_powerclamp] ... ... Here CPU 0 is the control CPU by default and changed to the current CPU, if CPU 0 offlined. This check has to be performed under cpus_read_lock(), hence the above warning. Use get_cpu() instead of smp_processor_id() to avoid this BUG. Suggested-by: Chen Yu Signed-off-by: Srinivas Pandruvada [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit 2d93540014387d1c73b9ccc4d7895320df66d01b Author: Chao Qin Date: Tue Sep 20 14:08:26 2022 +0800 powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue When value < time_unit, the parameter of ilog2() will be zero and the return value is -1. u64(-1) is too large for shift exponent and then will trigger shift-out-of-bounds: shift exponent 18446744073709551615 is too large for 32-bit type 'int' Call Trace: rapl_compute_time_window_core rapl_write_data_raw set_time_window store_constraint_time_window_us Signed-off-by: Chao Qin Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit d703256f53010a08c84f58adb89cb7da6002207c Merge: 83c10cc362d91 d2aa993b7d9de Author: Martin KaFai Lau Date: Wed Sep 21 10:57:13 2022 -0700 Merge branch 'Fix wrong cgroup attach flags being assigned to effective progs' Pu Lehui says: ==================== From: Pu Lehui When root-cgroup attach multi progs and sub-cgroup attach a override prog, bpftool will display incorrectly for the attach flags of the sub-cgroup’s effective progs: $ bpftool cgroup tree /sys/fs/cgroup effective CgroupPath ID AttachType AttachFlags Name /sys/fs/cgroup 6 cgroup_sysctl multi sysctl_tcp_mem 13 cgroup_sysctl multi sysctl_tcp_mem /sys/fs/cgroup/cg1 20 cgroup_sysctl override sysctl_tcp_mem 6 cgroup_sysctl override sysctl_tcp_mem <- wrong 13 cgroup_sysctl override sysctl_tcp_mem <- wrong /sys/fs/cgroup/cg1/cg2 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem For cg1, obviously, the attach flags of prog6 and prog13 can not be OVERRIDE. And for query with EFFECTIVE flags, exporting attach flags does not make sense. So let's remove the AttachFlags field and the associated logic. After these patches, the above effective cgroup tree will show as bellow: # bpftool cgroup tree /sys/fs/cgroup effective CgroupPath ID AttachType Name /sys/fs/cgroup 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem /sys/fs/cgroup/cg1 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem /sys/fs/cgroup/cg1/cg2 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem v5: - Adapt selftests for effective query uapi change. v4: https://lore.kernel.org/bpf/20220920154233.1494352-1-pulehui@huaweicloud.com - Reject prog_attach_flags array when effective query. (Martin) - Target to bpf tree. (Martin) v3: https://lore.kernel.org/bpf/20220914161742.3180731-1-pulehui@huaweicloud.com - Don't show attach flags when effective query. (John, sdf, Martin) v2: https://lore.kernel.org/bpf/20220908145304.3436139-1-pulehui@huaweicloud.com - Limit prog_cnt to avoid overflow. (John) - Add more detail message. v1: https://lore.kernel.org/bpf/20220820120234.2121044-1-pulehui@huawei.com ==================== Signed-off-by: Martin KaFai Lau commit d2aa993b7d9de6deeb1df6c9a6b9b6193c337cc6 Author: Pu Lehui Date: Wed Sep 21 10:46:04 2022 +0000 selftests/bpf: Adapt cgroup effective query uapi change The attach flags is meaningless for effective query and its value will always be set as 0 during effective query. Root cg's effective progs is always its attached progs, so we use non-effective query to get its progs count and attach flags. And we don't need the remain attach flags check. Fixes: b79c9fc9551b ("bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP") Signed-off-by: Pu Lehui Link: https://lore.kernel.org/r/20220921104604.2340580-4-pulehui@huaweicloud.com Signed-off-by: Martin KaFai Lau commit bdcee1b0b0834d031c76a12209840afe949b048a Author: Pu Lehui Date: Wed Sep 21 10:46:03 2022 +0000 bpftool: Fix wrong cgroup attach flags being assigned to effective progs When root-cgroup attach multi progs and sub-cgroup attach a override prog, bpftool will display incorrectly for the attach flags of the sub-cgroup’s effective progs: $ bpftool cgroup tree /sys/fs/cgroup effective CgroupPath ID AttachType AttachFlags Name /sys/fs/cgroup 6 cgroup_sysctl multi sysctl_tcp_mem 13 cgroup_sysctl multi sysctl_tcp_mem /sys/fs/cgroup/cg1 20 cgroup_sysctl override sysctl_tcp_mem 6 cgroup_sysctl override sysctl_tcp_mem <- wrong 13 cgroup_sysctl override sysctl_tcp_mem <- wrong /sys/fs/cgroup/cg1/cg2 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem Attach flags is only valid for attached progs of this layer cgroup, but not for effective progs. For querying with EFFECTIVE flags, exporting attach flags does not make sense. So let's remove the AttachFlags field and the associated logic. After this patch, the above effective cgroup tree will show as bellow: $ bpftool cgroup tree /sys/fs/cgroup effective CgroupPath ID AttachType Name /sys/fs/cgroup 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem /sys/fs/cgroup/cg1 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem /sys/fs/cgroup/cg1/cg2 20 cgroup_sysctl sysctl_tcp_mem 6 cgroup_sysctl sysctl_tcp_mem 13 cgroup_sysctl sysctl_tcp_mem Fixes: b79c9fc9551b ("bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP") Fixes: a98bf57391a2 ("tools: bpftool: add support for reporting the effective cgroup progs") Signed-off-by: Pu Lehui Link: https://lore.kernel.org/r/20220921104604.2340580-3-pulehui@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 0e426a3ae030a9e891899370229e117158b35de6 Author: Pu Lehui Date: Wed Sep 21 10:46:02 2022 +0000 bpf, cgroup: Reject prog_attach_flags array when effective query Attach flags is only valid for attached progs of this layer cgroup, but not for effective progs. For querying with EFFECTIVE flags, exporting attach flags does not make sense. So when effective query, we reject prog_attach_flags array and don't need to populate it. Also we limit attach_flags to output 0 during effective query. Fixes: b79c9fc9551b ("bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP") Signed-off-by: Pu Lehui Link: https://lore.kernel.org/r/20220921104604.2340580-2-pulehui@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 6ee2a7058fea5d42087045250c667ac02f1a4e20 Author: Jonathan Cameron Date: Sat Sep 17 14:14:01 2022 +0100 iio: accel: bma400: Fix smatch warning based on use of unintialized value. Only specific bits in this value are ever used and those are initialized, but that is complex to reason about in a checker. Hence, initialize the value to zero and avoid the complexity. Smatch warning: drivers/iio/accel/bma400_core.c:1287 bma400_tap_event_en() error: uninitialized symbol 'field_value'. Reported-by: Dan Carpenter Cc: Jagath Jog J Cc: Alexander Potapenko Signed-off-by: Jonathan Cameron Acked-by: Jagath Jog J Fixes: 961db2da159d ("iio: accel: bma400: Add support for single and double tap events") Link: https://lore.kernel.org/r/20220917131401.2815486-1-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 3259b99e0afc9b7b245b5aaa121a94a2b5d637ce Author: Jonathan Cameron Date: Sun Aug 7 19:56:18 2022 +0100 iio: light: st_uvis25: Use EXPORT_NS_SIMPLE_DEV_PM_OPS() Using this new macro removes the need to mark the callbacks __maybe_unused. One slightly complexity in this case is that the export will exist if CONFIG_PM is set, but only be used if CONFIG_PM_SLEEP is also set. This is harmless. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Lorenzo Bianconi Link: https://lore.kernel.org/r/20220807185618.1038812-7-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 66991b106a2c182c1b499d45d3025318d8774bd6 Author: Jonathan Cameron Date: Sun Aug 7 19:56:17 2022 +0100 iio: accel: bmi088: Use EXPORT_NS_GPL_RUNTIME_DEV_PM_OPS() and pm_ptr() These macros allow the compiler to remove unused pm ops functions without needing to mark them maybe unused. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: LI Qingwu Cc: Mike Looijmans Link: https://lore.kernel.org/r/20220807185618.1038812-6-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 1364262c8a381dd929f0973f92402c70d4e81b9f Author: Jonathan Cameron Date: Sun Aug 7 19:56:16 2022 +0100 iio: proximity: srf04: Use pm_ptr() to remove unused struct dev_pm_ops If CONFIG_PM is not set, the pm_ptr() will ensure that the struct dev_pm_ops and callbacks are removed without the need for __maybe_unused markings. In this case we can't simply use DEFINE_RUNTIME_DEV_PM_OPS() because that would provide suspend and resume functions without the checks the driver is doing before calling runtime_pm functions (whether the necessary GPIO is provided). It may be possible to clean that up in future by moving the checks into the callbacks. Signed-off-by: Jonathan Cameron Cc: Andreas Klinger Link: https://lore.kernel.org/r/20220807185618.1038812-5-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 5c682eeecf8a255974e1f8b0695e3de40cb518a6 Author: Jonathan Cameron Date: Sun Aug 7 19:56:15 2022 +0100 iio: proximity: sx9360: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These new macros avoid the need for marking the callbacks __maybe_unused whilst ensuring both callbacks and structure may be dropped by the compiler if CONFIG_PM_SLEEP is not enabled. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Gwendal Grignou Link: https://lore.kernel.org/r/20220807185618.1038812-4-jic23@kernel.org Signed-off-by: Jonathan Cameron commit d53f6cdc1e5a974d12172978a1f0f8c555d011cb Author: Jonathan Cameron Date: Sun Aug 7 19:56:14 2022 +0100 iio: proximity: sx9324: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These new macros avoid the need for marking the callbacks __maybe_unused whilst ensuring both callbacks and structure may be dropped by the compiler if CONFIG_PM_SLEEP is not enabled. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Gwendal Grignou Link: https://lore.kernel.org/r/20220807185618.1038812-3-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 93176acee936d330b600ca93b3ca6e9c40053fa9 Author: Jonathan Cameron Date: Sun Aug 7 19:56:13 2022 +0100 iio: proximity: sx9310: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() These new macros avoid the need for marking the callbacks __maybe_unused whilst ensuring both callbacks and structure may be dropped by the compiler if CONFIG_PM_SLEEP is not enabled. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Gwendal Grignou Link: https://lore.kernel.org/r/20220807185618.1038812-2-jic23@kernel.org Signed-off-by: Jonathan Cameron commit 130476acfdc1663bc402faa3f2faab5a910f696a Author: Andrea Merello Date: Wed Sep 7 15:22:05 2022 +0200 docs: iio: add documentation for BNO055 driver The bno055 driver is rather complex and have some oddities and not-obvious things that worth to document (e.g. calibration files). This patch also contains this [0] fix squashed in. [0] https://lore.kernel.org/lkml/20220704034041.15448-1-bagasdotme@gmail.com/ Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-15-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 50fe984f376abb4a00f80e13f51465ef09c2bde7 Author: Andrea Merello Date: Wed Sep 7 15:22:04 2022 +0200 iio: imu: add BNO055 I2C driver Add an I2C driver for communicating to a BNO055 IMU via I2C bus and enable the BNO055 core driver to work in this scenario. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-14-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 2eef5a9cc6439a4c8eb4c741a498e72f9335febe Author: Andrea Merello Date: Wed Sep 7 15:22:03 2022 +0200 iio: imu: add BNO055 serdev driver Add a serdev driver for communicating to a BNO055 IMU via serial bus, and enable the BNO055 core driver to work in this scenario. Signed-off-by: Andrea Merello Link: https://lore.kernel.org/r/20220907132205.28021-13-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 21f95c75e0b7e77370177173c67d0931d4020e78 Author: Andrea Merello Date: Wed Sep 7 15:22:02 2022 +0200 dt-bindings: iio/imu: Add Bosch BNO055 Introduce new documentation file for the Bosch BNO055 IMU. Signed-off-by: Andrea Merello Reviewed-by: Rob Herring Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-12-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit e4ea07cf89a1208090f596ad69976b0596e990b3 Author: Andrea Merello Date: Wed Sep 7 15:22:01 2022 +0200 iio: document "serialnumber" sysfs attribute Add ABI documentation for the new "serialnumber" sysfs attribute. The first user is the bno055 IIO driver. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-11-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 4a1728d27225c4cea6b46143fe0c7ec82ccfce54 Author: Andrea Merello Date: Wed Sep 7 15:22:00 2022 +0200 iio: document bno055 private sysfs attributes Add ABI documentation for bno055 driver private sysfs attributes. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-10-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 4aefe1c2bd0cb0223130671d459cd16efa3d3462 Author: Andrea Merello Date: Wed Sep 7 15:21:59 2022 +0200 iio: imu: add Bosch Sensortec BNO055 core driver Add the core driver for the BNO055 IMU from Bosch. This IMU can be connected via both serial and I2C busses; separate patches will add support for them. The driver supports "AMG" (Accelerometer, Magnetometer, Gyroscope) mode, that provides raw data from the said internal sensors, and a couple of "fusion" modes (i.e. the IMU also does calculations in order to provide euler angles, quaternions, linear acceleration and gravity measurements). In fusion modes the AMG data is still available (with some calibration refinements done by the IMU), but certain settings such as low pass filters cut-off frequency and sensors' ranges are fixed, while in AMG mode they can be customized; this is why AMG mode can still be interesting. Signed-off-by: Andrea Merello Link: https://lore.kernel.org/r/20220907132205.28021-9-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit e0d27ea3ba1332c81060d9d52182953dbc835b40 Author: Andrea Merello Date: Wed Sep 7 15:21:58 2022 +0200 iio: add support for binary attributes When a IIO device is registered, the IIO core creates an attribute group on its own, where it puts the channel attributes, and where it copies the attributes in indio_dev->info->attrs. Unfortunately it doesn't take care of binary attributes (i.e. it only consider indio_dev->info->attrs->attrs, and it ignores indio_dev->info->attrs->bin_attrs). Fix this by making the IIO layer take care also of the binary attributes. Note that while it is necessary to copy the non-binary attributes because the IIO layer needs more room to add the channels attribute, it should be enough to assign the bin_attrs pointer to the binary attributes pointed by indio_dev->info->attrs->bin_attrs. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-8-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit ab9d343da3a43c8e28c6341cbf7fd30b6bc42664 Author: Andrea Merello Date: Wed Sep 7 15:21:57 2022 +0200 iio: event_monitor: add pitch, yaw and roll modifiers Following the introduction of pitch, yaw and roll IIO modifiers, update the event_monitor tool accordingly. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-7-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 246d178c78685fc6ffcd8339ef0e64771024d82f Author: Andrea Merello Date: Wed Sep 7 15:21:56 2022 +0200 iio: document pitch, yaw, roll modifiers Introduce ABI documentation for new modifiers used for reporting rotations expressed as euler angles (i.e. yaw, pitch, roll). It looks like we have some unit inconsistency along various IIO modifiers: it seems that incli is in deg, angl is in radians and rot isn't documented, but at least the adis16209 driver has rot in deg. Here we use deg (so angl is the only one using radians). Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-6-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit dcedf14553810cd6bbf7227c995beb4548e0859d Author: Andrea Merello Date: Wed Sep 7 15:21:55 2022 +0200 iio: add modifers for pitch, yaw, roll Add modifiers for reporting rotations as euler angles (i.e. yaw, pitch and roll). Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-5-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 4db63c85462ed81eb3b27f805ed8571f9563dbd7 Author: Andrea Merello Date: Wed Sep 7 15:21:54 2022 +0200 iio: event_monitor: add linear acceleration modifiers Following the introduction of IIO linear acceleration modifiers, update the event_monitor tool accordingly. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-4-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 396882617d1087a0a3fb56d0a59d6dc216640680 Author: Andrea Merello Date: Wed Sep 7 15:21:53 2022 +0200 iio: document linear acceleration modifiers Introduce ABI documentation for new IIO modifiers used for reporting "linear acceleration" measures. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-3-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit bcc57a48eaee63a71983996c4c9d89ce7cbf55d9 Author: Andrea Merello Date: Wed Sep 7 15:21:52 2022 +0200 iio: add modifiers for linear acceleration Add IIO_MOD_LINEAR_X, IIO_MOD_LINEAR_Y and IIO_MOD_LINEAR_Z modifiers to te IIO core, which is preparatory for adding the Bosch BNO055 IMU driver. Bosch BNO055 IMU can report raw accelerations (among x, y and z axis) as well as the so called "linear accelerations" (again, among x, y and z axis) which is basically the acceleration after subtracting gravity and for which those new modifiers are for. Signed-off-by: Andrea Merello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220907132205.28021-2-andrea.merello@iit.it Signed-off-by: Jonathan Cameron commit 7b4ab4abcea4c0c10b25187bf2569e5a07e9a20c Author: Eddie James Date: Thu Sep 15 14:57:19 2022 -0500 iio: pressure: dps310: Reset chip after timeout The DPS310 chip has been observed to get "stuck" such that pressure and temperature measurements are never indicated as "ready" in the MEAS_CFG register. The only solution is to reset the device and try again. In order to avoid continual failures, use a boolean flag to only try the reset after timeout once if errors persist. Fixes: ba6ec48e76bc ("iio: Add driver for Infineon DPS310") Cc: Signed-off-by: Eddie James Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220915195719.136812-3-eajames@linux.ibm.com Signed-off-by: Jonathan Cameron commit c2329717bdd3fa62f8a2f3d8d85ad0bee4556bd7 Author: Eddie James Date: Thu Sep 15 14:57:18 2022 -0500 iio: pressure: dps310: Refactor startup procedure Move the startup procedure into a function, and correct a missing check on the return code for writing the PRS_CFG register. Cc: Signed-off-by: Eddie James Reviewed-by: Joel Stanley Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220915195719.136812-2-eajames@linux.ibm.com Signed-off-by: Jonathan Cameron commit 4b622a658c21d4de7f6fdb6b5e1c99bfb20b2d22 Author: Nuno Sá Date: Mon Sep 12 10:12:23 2022 +0200 dt-bindings: iio: adi,ad7923: add adi,range-double property Document the new property to enable doubling the analog input range. Signed-off-by: Nuno Sá Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220912081223.173584-4-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 096d2dac25f9947d1cb1e16a16468de8fda685e6 Author: Nuno Sá Date: Mon Sep 12 10:12:22 2022 +0200 iio: adc: ad7923: support extended range By default the driver was always setting the RANGE bit which means that the analog input goes from 0 to VREF. However, we might want to have 0 to 2xVREF. This change adds a new Firmware property to allow for the extended range while keeping the default behavior if nothing is provided. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220912081223.173584-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit f4f43f01cff2f29779343ade755191afd2581c77 Author: Nuno Sá Date: Mon Sep 12 10:12:21 2022 +0200 iio: adc: ad7923: fix channel readings for some variants Some of the supported devices have 4 or 2 LSB trailing bits that should not be taken into account. Hence we need to shift these bits out which fits perfectly on the scan type shift property. This change fixes both raw and buffered reads. Fixes: f2f7a449707e ("iio:adc:ad7923: Add support for the ad7904/ad7914/ad7924") Fixes: 851644a60d20 ("iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220912081223.173584-2-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit 548616242fe025b8c071e8d760fba6c4f71b0bc6 Author: Olivier Moysan Date: Thu Sep 15 15:54:52 2022 +0200 iio: adc: stm32-adc: add id registers support Add support of identification registers to STM32 ADC. By default the ADC hardware instance number is retrieved from the compatible configuration data. Get the available ADC number per ADC block, from hardware configuration register, when this register exists. Signed-off-by: Olivier Moysan Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220915135452.1712453-1-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron commit fd8059ec60193c11e3237bbf86dff4f51946c94e Author: Lorenzo Bianconi Date: Thu Sep 15 19:35:00 2022 +0200 dt-bindings: iio: imu: st_lsm6dsx: add lsm6dstx device bindings Add device bindings for lsm6dstx IMU sensor. Use lsm6dst as fallback device for lsm6dstx since it implements all the features currently supported by lsm6dstx. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/dadc2acf88b0b73feac9a8980ad9af1658297bc1.1663262890.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit 186b9e3845b89df945bb9b370d61ca21888dfa52 Author: Lorenzo Bianconi Date: Thu Sep 15 19:34:59 2022 +0200 iio: imu: st_lsm6dsx: add support to LSM6DSTX Add support to STM LSM6DSTX (acc + gyro) Mems sensor. The LSM6DSTX sensor can use LSM6DST as fallback device since it implements all the LSM6DSTX features currently implemented in st_lsm6dsx. Datasheet: https://www.st.com/resource/en/datasheet/lsm6dstx.pdf Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/573a232b0f320b2ec92c56fa24393cfb275183fb.1663262890.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit 1695c52a1260aee2a33e29add1adca6433d5eac7 Author: Ciprian Regus Date: Fri Sep 16 17:09:22 2022 +0300 drivers: iio: adc: ltc2497: Rename the LTC2499 iio device Set the iio device's name based on the chip used for the LTC2499 only. The most common way for IIO clients to interact with a device is to address it based on it's name. By using the dev_name() function, the name will be set based on a i2c_client's kobj name, which has the format i2c_instance-i2c_address (1-0076 for example). This is not ideal, since it makes a requirement for userspace to have knowledge about the hardware connections of the device. The name field is set to NULL for the LTC2497 and LTC2496, so that the old name can kept as it is, since changing it will result in an ABI breakage. Signed-off-by: Ciprian Regus Link: https://lore.kernel.org/r/20220916140922.2506248-6-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron commit 2187cfeb362678dae2f6235b20a6ef658836b3d4 Author: Ciprian Regus Date: Fri Sep 16 17:09:21 2022 +0300 drivers: iio: adc: ltc2497: LTC2499 support The LTC2499 is a 16-channel (eight differential), 24-bit, ADC with Easy Drive technology and a 2-wire, I2C interface. Implement support for the LTC2499 ADC by extending the LTC2497 driver. A new chip_info struct is added to differentiate between chip types and resolutions when reading data from the device. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/2499fe.pdf Signed-off-by: Ciprian Regus Link: https://lore.kernel.org/r/20220916140922.2506248-5-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron commit cc6fbf2672bba1c1042f8e5b8a61067f5d3a3214 Author: Ciprian Regus Date: Fri Sep 16 17:09:20 2022 +0300 Add MAINTAINERS entries for LTC2497 and LTC2496 Update the MAINTAINERS file to include the path for the LTC2497 and LTC2496 devicetree bindings documentation. Signed-off-by: Ciprian Regus Link: https://lore.kernel.org/r/20220916140922.2506248-4-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron commit 14446b4dc2780e86d93f20732c05a8e38eec0ff7 Author: Ciprian Regus Date: Fri Sep 16 17:09:19 2022 +0300 dt-bindings: iio: adc: Add docs for LTC2499 Update the bindings documentation for ltc2497 to include the ltc2499. Signed-off-by: Ciprian Regus Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916140922.2506248-3-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron commit bb43bfedce47c22dfd4df38c9051e930fecd6da9 Author: Ciprian Regus Date: Fri Sep 16 17:09:18 2022 +0300 MAINTAINERS: Remove duplicate matching entry Remove the specific entry for ad5758, since Documentation/devicetree/bindings/iio/*/adi,* already matches the path. Signed-off-by: Ciprian Regus Link: https://lore.kernel.org/r/20220916140922.2506248-2-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron commit 7f4f1096d5921f5d90547596f9ce80e0b924f887 Author: Uwe Kleine-König Date: Mon Aug 15 09:16:47 2022 +0000 iio: ltc2497: Fix reading conversion results After the result of the previous conversion is read the chip automatically starts a new conversion and doesn't accept new i2c transfers until this conversion is completed which makes the function return failure. So add an early return iff the programming of the new address isn't needed. Note this will not fix the problem in general, but all cases that are currently used. Once this changes we get the failure back, but this can be addressed when the need arises. Fixes: 69548b7c2c4f ("iio: adc: ltc2497: split protocol independent part in a separate module ") Reported-by: Meng Li Signed-off-by: Uwe Kleine-König Tested-by: Denys Zagorui Cc: Link: https://lore.kernel.org/r/20220815091647.1523532-1-dzagorui@cisco.com Signed-off-by: Jonathan Cameron commit 10b40ffba2f95cdeed47b731c5ad5ecc73e140e8 Author: Angel Iglesias Date: Tue Sep 13 01:54:42 2022 +0200 iio: pressure: bmp280: Add more tunable config parameters for BMP380 Allows sampling frequency and IIR filter coefficients configuration using sysfs ABI. The IIR filter coefficient is configurable using the sysfs attribute "filter_low_pass_3db_frequency". Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/876f8a2277f71672488e99aa02aae4239d530f51.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 2a332dcd68aff25b5177b5e4196b4d46403ba364 Author: Angel Iglesias Date: Tue Sep 13 01:53:50 2022 +0200 dt-bindings: iio: pressure: bmp085: Add BMP380 compatible string Add bosch,bmp380 compatible string for the new family of sensors. This family includes the BMP380, BMP384 and BMP388. The register map in this family changes substantially and introduces new features but core concepts and operations carryover from the previous iterations Signed-off-by: Angel Iglesias Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/67224da4ae308bb752fc8fdecc54345cedab6c21.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 8d329309184d5824e44c6426bf878c5f1e1156e5 Author: Angel Iglesias Date: Tue Sep 13 01:52:13 2022 +0200 iio: pressure: bmp280: Add support for BMP380 sensor family Adds compatibility with the new generation of this sensor, the BMP380. Includes basic sensor initialization to do pressure and temp measurements and allows tuning oversampling settings for each channel. The compensation algorithms are adapted from the device datasheet and the repository https://github.com/BoschSensortec/BMP3-Sensor-API. Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/f1da2a2f1bc5bb083f318335c23b4f3d9bb8e536.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 18d1bb377023cad76e01b598da3da53da9fc36b7 Author: Angel Iglesias Date: Tue Sep 13 01:50:07 2022 +0200 iio: pressure: bmp280: reorder i2c device tables declarations Change device tables declarations to forward order like in SPI codepath. Suggested-by: Andy Shevchenko Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/a3969b60e428b9bd29ea1ebc6dd69aa5bbe59da0.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 327b5c0512c18287162d0f12949aae41d64358b0 Author: Angel Iglesias Date: Tue Sep 13 01:48:21 2022 +0200 iio: pressure: bmp280: Fix alignment for DMA safety Adds DMA-safe buffers to driver data struct to store raw data from sensors The multiple buffers used thorough the driver share the same memory allocated as part of the device data instance. The union containing the buffers is aligned to allow safe usage with DMA operations, such as regmap bulk read calls. Updated measurement and calibration reading functions to use the safe DMA buffers. Suggested-by: Jonathan Cameron Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/7919793f7f63224d5ce413c66d648029683c17ac.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit b00e805a47a86fb5890a1c2451e4d89043b1761d Author: Angel Iglesias Date: Tue Sep 13 01:47:31 2022 +0200 iio: pressure: bmp280: simplify driver initialization logic Simplified common initialization logic of different sensor types unifying calibration and initial configuration recovery. Default config param values of each sensor type are stored inside chip_info structure and used to initialize sensor data struct instance. The helper functions for read each sensor type calibration are converted to a callback available on the chip_info struct. Separated bme280 specific calibration code from bmp280 function. Dropped the additional chip_id argument in bmp280 code as is not longer required. Now both bmp280/bme280 calibration function use same signature as bmp180. Suggested-by: Jonathan Cameron Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/584c90f309e4f24bf2e4aa2b15c8577d288f978d.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 83cb40beaefaf59b224efdabecaac611b783da74 Author: Angel Iglesias Date: Tue Sep 13 01:46:42 2022 +0200 iio: pressure: bmp280: Simplify bmp280 calibration data reading On bmp280 and bme280, the temperature and pressure calibration parameters are available on a contiguous memory region. Considering this arrangement, simplified the calibration reading function by using only one buffer to read in batch temperature and pressure registers. Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/96d81282c95006d857f4d836d2ff3ee0740a85a0.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 2405f8cc8485d7c06fdd7b85a0df1a3febd076d6 Author: Angel Iglesias Date: Tue Sep 13 01:45:49 2022 +0200 iio: pressure: bmp280: use FIELD_GET, FIELD_PREP and GENMASK Cleaned and simplified register values construction and extraction converting to use FIELD_PREP and FIELD_GET macros. Replaced hardcoded bit masks with GENMASK macro. Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/3cbe56f29c2a46bc5dc23c5b72e1b43c9207f44d.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 5f0c359defea73c0ca27fb47a3a891abf2f5a504 Author: Angel Iglesias Date: Tue Sep 13 01:44:52 2022 +0200 iio: pressure: bmp280: reorder local variables following reverse xmas tree Reordered definitions of local variables following the reverse christmas tree convention. Suggested-by: Andy Shevchenko Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/363a106afbfe30ce590b80b1494c8b3322870f8a.1663025017.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit f13c81a3359ccfb2cd8ea2d0609d7d7a91e3dde7 Author: Nuno Sá Date: Tue Sep 13 09:34:13 2022 +0200 iio: dac: ad5593r: add check for i2c functionality Make sure that the needed i2c functionality is supported during probe. Signed-off-by: Nuno Sá Signed-off-by: Michael Hennerich Link: https://lore.kernel.org/r/20220913073413.140475-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 558a25f903b4af6361b7fbeea08a6446a0745653 Author: Michael Hennerich Date: Tue Sep 13 09:34:12 2022 +0200 iio: dac: ad5593r: Fix i2c read protocol requirements For reliable operation across the full range of supported interface rates, the AD5593R needs a STOP condition between address write, and data read (like show in the datasheet Figure 40) so in turn i2c_smbus_read_word_swapped cannot be used. While at it, a simple helper was added to make the code simpler. Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs") Signed-off-by: Michael Hennerich Signed-off-by: Nuno Sá Cc: Link: https://lore.kernel.org/r/20220913073413.140475-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit d9d0c0725ae2798bd51f38ae26c2477f6eed40b3 Author: Crt Mori Date: Tue Sep 6 13:26:32 2022 +0200 iio: temperature: mlx90614 Refactoring available filter attributes Change/refactor to the new way of defining available attribute values. Signed-off-by: Crt Mori Link: https://lore.kernel.org/r/20220906112632.244453-1-cmo@melexis.com Signed-off-by: Jonathan Cameron commit a7a1c60bc4c9159aa3a4cb3e1814145666c3a00c Author: George Mois Date: Mon Sep 5 16:20:18 2022 +0300 drivers: iio: accel: adxl312 and adxl314 support ADXL312 and ADXL314 are small, thin, low power, 3-axis accelerometers with high resolution (13-bit) measurement up to +/-12 g and +/- 200 g respectively. Implement support for ADXL312 and ADXL314 by extending the ADXL313 driver. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL312.pdf Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL314.pdf Signed-off-by: George Mois Link: https://lore.kernel.org/r/20220905132018.364900-2-george.mois@analog.com Signed-off-by: Jonathan Cameron commit abf90541d19c17a29bf6137febe71bb2770896f3 Author: George Mois Date: Mon Sep 5 16:20:17 2022 +0300 dt-bindings: iio: accel: adxl313: Add compatibles for adxl312 and adxl314 Extend the adi,adxl313.yaml file with information regrding the ADXL312 and ADXL314 devices. Signed-off-by: George Mois Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220905132018.364900-1-george.mois@analog.com Signed-off-by: Jonathan Cameron commit 5d5129b17f8315d317db01a3f6e050e8ca23952f Author: Angel Iglesias Date: Tue Sep 13 00:26:44 2022 +0200 iio: pressure: bmp280: fix datasheet links Updated links for BMP280 and BME280 datasheets on Bosch website. Datasheet of BMP180 is no longer available on the manufacturer's website, changed the link to a copy hosted by a third party. Reported-by: Andy Shevchenko Signed-off-by: Angel Iglesias Link: https://lore.kernel.org/r/20220912222645.377874-1-ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron commit 92ba0ab945aee1f3d23b045c893290380e3e059c Author: Martyn Welch Date: Fri Sep 9 17:16:10 2022 +0100 iio: pressure: st_pressure: Add support for LPS22DF Add support for ST LPS22DF pressure sensor. Datasheet: https://www.st.com/resource/en/datasheet/lps22df.pdf Signed-off-by: Martyn Welch Link: https://lore.kernel.org/r/20220909161611.780720-2-martyn.welch@collabora.co.uk Signed-off-by: Jonathan Cameron commit b402783711bfe93e9da0e3f9eab3aee95cece29d Author: Martyn Welch Date: Fri Sep 9 17:16:09 2022 +0100 dt-bindings: iio: st,st-sensors add LPS22DF. Add support for the ST LPS22DF, an I2C/SPI pressure sensor. Signed-off-by: Martyn Welch Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909161611.780720-1-martyn.welch@collabora.co.uk Signed-off-by: Jonathan Cameron commit 3a74904ceff3ecdb9d6cc0844ed67df417968eb6 Author: William Dean Date: Sat Sep 17 16:42:48 2022 +0800 bpf: simplify code in btf_parse_hdr It could directly return 'btf_check_sec_info' to simplify code. Signed-off-by: William Dean Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20220917084248.3649-1-williamsukatube@163.com Signed-off-by: Martin KaFai Lau commit 467233a4ac29b215d492843d067a9f091e6bf0c5 Author: Shengjiu Wang Date: Wed Sep 21 09:58:43 2022 +0800 rpmsg: char: Avoid double destroy of default endpoint The rpmsg_dev_remove() in rpmsg_core is the place for releasing this default endpoint. So need to avoid destroying the default endpoint in rpmsg_chrdev_eptdev_destroy(), this should be the same as rpmsg_eptdev_release(). Otherwise there will be double destroy issue that ept->refcount report warning: refcount_t: underflow; use-after-free. Call trace: refcount_warn_saturate+0xf8/0x150 virtio_rpmsg_destroy_ept+0xd4/0xec rpmsg_dev_remove+0x60/0x70 The issue can be reproduced by stopping remoteproc before closing the /dev/rpmsgX. Fixes: bea9b79c2d10 ("rpmsg: char: Add possibility to use default endpoint of the rpmsg device") Signed-off-by: Shengjiu Wang Reviewed-by: Arnaud Pouliquen Reviewed-by: Peng Fan Cc: stable Link: https://lore.kernel.org/r/1663725523-6514-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mathieu Poirier commit 1d7b61c06dc310421911dac7c5d2d15b754c8b63 Author: Arnaud Pouliquen Date: Wed Sep 21 15:50:44 2022 +0200 remoteproc: virtio: Create platform device for the remoteproc_virtio Define a platform driver to manage the remoteproc virtio device as a platform devices. The platform device allows to pass rproc_vdev_data platform data to specify properties that are stored in the rproc_vdev structure. Such approach will allow to preserve legacy remoteproc virtio device creation but also to probe the device using device tree mechanism. remoteproc_virtio.c update: - Add rproc_virtio_driver platform driver. The probe ops replaces the rproc_rvdev_add_device function. - All reference to the rvdev->dev has been updated to rvdev-pdev->dev. - rproc_rvdev_release is removed as associated to the rvdev device. - The use of rvdev->kref counter is replaced by get/put_device on the remoteproc virtio platform device. - The vdev device no longer increments rproc device counter. increment/decrement is done in rproc_virtio_probe/rproc_virtio_remove function in charge of the vrings allocation/free. remoteproc_core.c update: Migrate from the rvdev device to the rvdev platform device. From this patch, when a vdev resource is found in the resource table the remoteproc core register a platform device. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220921135044.917140-5-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 9c31255ce5fe8ce61d947ba496a6058e22d2375b Author: Arnaud Pouliquen Date: Wed Sep 21 15:50:43 2022 +0200 remoteproc: Move rproc_vdev management to remoteproc_virtio.c Move functions related to the management of the rproc_vdev structure in the remoteproc_virtio.c. The aim is to decorrelate as possible the virtio management from the core part. Due to the strong correlation between the vrings and the resource table the rproc_alloc/parse/free_vring functions are kept in the remoteproc core. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220921135044.917140-4-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 63badba9457147b64dbd4680518a810456eeed0c Author: Arnaud Pouliquen Date: Wed Sep 21 15:50:42 2022 +0200 remoteproc: core: Introduce rproc_add_rvdev function The rproc structure contains a list of registered rproc_vdev structure. To be able to move the management of the rproc_vdev structure in remoteproc_virtio.c (i.e rproc_rvdev_add_device function), introduce the rproc_add_rvdev and rproc_remove_rvdev functions. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220921135044.917140-3-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit fd28f879e6274d477378362d848b42747ecb27eb Author: Arnaud Pouliquen Date: Wed Sep 21 15:50:41 2022 +0200 remoteproc: core: Introduce rproc_rvdev_add_device function In preparation of the migration of the management of rvdev in remoteproc_virtio.c, this patch spins off a new function to manage the remoteproc virtio device creation. The rproc_rvdev_add_device will be moved to remoteproc_virtio.c. The rproc_vdev_data structure is introduced to provide information for the rvdev creation. This structure allows to manage the rvdev and vrings allocation in the rproc_rvdev_add_device function. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220921135044.917140-2-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit ac9e5784bbe72f4f603d1af84760ec09bc0b5ccd Author: Pavel Begunkov Date: Thu Sep 8 13:20:34 2022 +0100 io_uring/net: use io_sr_msg for sendzc Reuse struct io_sr_msg for zerocopy sends, which is handy. There is only one zerocopy specific field, namely .notif, and we have enough space for it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/408c5b1b2d8869e1a12da5f5a78ed72cac112149.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0b048557db761d287777360a100e1d010760d209 Author: Pavel Begunkov Date: Thu Sep 8 13:20:33 2022 +0100 io_uring/net: refactor io_sr_msg types In preparation for using struct io_sr_msg for zerocopy sends, clean up types. First, flags can be u16 as it's provided by the userspace in u16 ioprio, as well as addr_len. This saves us 4 bytes. Also use unsigned for size and done_io, both are as well limited to u32. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/42c2639d6385b8b2181342d2af3a42d3b1c5bcd2.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cd9021e88fddf0d9fa9704564153af2bdb5dc13c Author: Pavel Begunkov Date: Thu Sep 8 13:20:32 2022 +0100 io_uring/net: add non-bvec sg chunking callback Add a sg_from_iter() for when we initiate non-bvec zerocopy sends, which helps us to remove some extra steps from io_sg_from_iter(). The only thing the new function has to do before giving control away to __zerocopy_sg_from_iter() is to check if the skb has managed frags and downgrade them if so. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/cda3dea0d36f7931f63a70f350130f085ac3f3dd.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6bf8ad25fcd42a719f24613deabcff2fd341c789 Author: Pavel Begunkov Date: Thu Sep 8 13:20:31 2022 +0100 io_uring/net: io_async_msghdr caches for sendzc We already keep io_async_msghdr caches for normal send/recv requests, use them also for zerocopy send. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/42fa615b6e0be25f47a685c35d7b5e4f1b03d348.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 858c293e5d3b7fd3037883fcc0379594517c926c Author: Pavel Begunkov Date: Thu Sep 8 13:20:30 2022 +0100 io_uring/net: use async caches for async prep send/recv have async_data caches but there are only used from within issue handlers. Extend their use also to ->prep_async, should be handy with links and IOSQE_ASYNC. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b9a2264b807582a97ed606c5bfcdc2399384e8a5.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 95eafc74be5e11f9dd6a11504c27321c515ce00f Author: Pavel Begunkov Date: Thu Sep 8 13:20:29 2022 +0100 io_uring/net: reshuffle error handling We should prioritise send/recv retry cases over failures, they're more important. Shuffle -ERESTARTSYS after we handled retries. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d9059691b30d0963b7269fa4a0c81ee7720555e6.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e9a884285484a098fd607496d565c3b4e4733f63 Author: Pavel Begunkov Date: Thu Sep 8 13:20:28 2022 +0100 io_uring: use io_cq_lock consistently There is one place when we forgot to change hand coded spin locking with io_cq_lock(), change it to be more consistent. Note, the unlock part is already __io_cq_unlock_post(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/91699b9a00a07128f7ca66136bdbbfc67a64659e.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 385c609f9bfcfcd1e1e649834fc61e48d2316381 Author: Pavel Begunkov Date: Thu Sep 8 13:20:27 2022 +0100 io_uring: kill an outdated comment Request referencing has changed a while ago and there is no notion left of submission/completion references, kill an outdated comment. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/38902e7229d68cecd62702436d627d4858b0d9d4.1662639236.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4ab9d465071beb95e30e2712d4c65b6ab781865b Author: Dylan Yudaken Date: Wed Sep 7 09:51:52 2022 -0700 io_uring: allow buffer recycling in READV In commit 934447a603b2 ("io_uring: do not recycle buffer in READV") a temporary fix was put in io_kbuf_recycle to simply never recycle READV buffers. Instead of that, rather treat READV with REQ_F_BUFFER_SELECTED the same as a READ with REQ_F_BUFFER_SELECTED. Since READV requires iov_len of 1 they are essentially the same. In order to do this inside io_prep_rw() add some validation to check that it is in fact only length 1, and also extract the length of the buffer at prep time. This allows removal of the io_iov_buffer_select codepaths as they are only used from the READV op. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220907165152.994979-1-dylany@fb.com Signed-off-by: Jens Axboe commit de97fcb30316410a2c46be102f074a454ecc6cf1 Author: Jens Axboe Date: Fri Sep 2 15:18:05 2022 -0600 fs: add batch and poll flags to the uring_cmd_iopoll() handler We need the poll_flags to know how to poll for the IO, and we should have the batch structure in preparation for supporting batched completions with iopoll. Signed-off-by: Jens Axboe commit dac6a0eae793f53c62a0f83d9f5423293a7845c4 Author: Jens Axboe Date: Sat Sep 3 09:52:01 2022 -0600 io_uring: ensure iopoll runs local task work as well Combine the two checks we have for task_work running and whether or not we need to shuffle the mutex into one, so we unify how task_work is run in the iopoll loop. This helps ensure that local task_work is run when needed, and also optimizes that path to avoid a mutex shuffle if it's not needed. Signed-off-by: Jens Axboe commit 8ac5d85a89b48269e5aefb92b640d38367670a1b Author: Jens Axboe Date: Sat Sep 3 10:09:22 2022 -0600 io_uring: add local task_work run helper that is entered locked We have a few spots that drop the mutex just to run local task_work, which immediately tries to grab it again. Add a helper that just passes in whether we're locked already. Signed-off-by: Jens Axboe commit a1119fb0711591c2aaf99be79d87ce8ebeb9d250 Author: Jens Axboe Date: Fri Sep 2 15:16:29 2022 -0600 io_uring: cleanly separate request types for iopoll After the addition of iopoll support for passthrough, there's a bit of a mixup here. Clean it up and get rid of the casting for the passthrough command type. Signed-off-by: Jens Axboe commit 585079b6e425387b5f8ec242fc38081c31ca41ee Author: Kanchan Joshi Date: Tue Aug 23 21:44:43 2022 +0530 nvme: wire up async polling for io passthrough commands Store a cookie during submission, and use that to implement completion-polling inside the ->uring_cmd_iopoll handler. This handler makes use of existing bio poll facility. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta Link: https://lore.kernel.org/r/20220823161443.49436-5-joshi.k@samsung.com Signed-off-by: Jens Axboe commit c6e99ea482e2a9e1fef2488891242f9749584225 Author: Kanchan Joshi Date: Tue Aug 23 21:44:42 2022 +0530 block: export blk_rq_is_poll This is in preparation to support iopoll for nvme passthrough. Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220823161443.49436-4-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 5756a3a7e713bcab705a5f0c810a2b1f7f4ecfaa Author: Kanchan Joshi Date: Tue Aug 23 21:44:41 2022 +0530 io_uring: add iopoll infrastructure for io_uring_cmd Put this up in the same way as iopoll is done for regular read/write IO. Make place for storing a cookie into struct io_uring_cmd on submission. Perform the completion using the ->uring_cmd_iopoll handler. Signed-off-by: Kanchan Joshi Signed-off-by: Pankaj Raghav Link: https://lore.kernel.org/r/20220823161443.49436-3-joshi.k@samsung.com Signed-off-by: Jens Axboe commit de27e18e86173b704beaa19f0ee376f3305c4794 Author: Kanchan Joshi Date: Tue Aug 23 21:44:40 2022 +0530 fs: add file_operations->uring_cmd_iopoll io_uring will invoke this to do completion polling on uring-cmd operations. Signed-off-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220823161443.49436-2-joshi.k@samsung.com Signed-off-by: Jens Axboe commit f75d5036d04cd57103fe1a50dffceb7c1040fbe7 Author: Dylan Yudaken Date: Tue Aug 30 05:50:13 2022 -0700 io_uring: trace local task work run Add tracing for io_run_local_task_work Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-8-dylany@fb.com Signed-off-by: Jens Axboe commit 21a091b970cdbcf3e8ff829234b51be6f9192766 Author: Dylan Yudaken Date: Tue Aug 30 05:50:12 2022 -0700 io_uring: signal registered eventfd to process deferred task work Some workloads rely on a registered eventfd (via io_uring_register_eventfd(3)) in order to wake up and process the io_uring. In the case of a ring setup with IORING_SETUP_DEFER_TASKRUN, that eventfd also needs to be signalled when there are tasks to run. This changes an old behaviour which assumed 1 eventfd signal implied at least 1 CQE, however only when this new flag is set (and so old users will not notice). This should be expected with the IORING_SETUP_DEFER_TASKRUN flag as it is not guaranteed that every task will result in a CQE. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-7-dylany@fb.com [axboe: fold in call_rcu() serialization fix] Signed-off-by: Jens Axboe commit d8e9214f119db5697382c63a62790a4afb5d00cd Author: Dylan Yudaken Date: Tue Aug 30 05:50:11 2022 -0700 io_uring: move io_eventfd_put Non functional change: move this function above io_eventfd_signal so it can be used from there Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-6-dylany@fb.com Signed-off-by: Jens Axboe commit c0e0d6ba25f180ab76d3c18f8b360a119dffa634 Author: Dylan Yudaken Date: Tue Aug 30 05:50:10 2022 -0700 io_uring: add IORING_SETUP_DEFER_TASKRUN Allow deferring async tasks until the user calls io_uring_enter(2) with the IORING_ENTER_GETEVENTS flag. Enable this mode with a flag at io_uring_setup time. This functionality requires that the later io_uring_enter will be called from the same submission task, and therefore restrict this flag to work only when IORING_SETUP_SINGLE_ISSUER is also set. Being able to hand pick when tasks are run prevents the problem where there is current work to be done, however task work runs anyway. For example, a common workload would obtain a batch of CQEs, and process each one. Interrupting this to additional taskwork would add latency but not gain anything. If instead task work is deferred to just before more CQEs are obtained then no additional latency is added. The way this is implemented is by trying to keep task work local to a io_ring_ctx, rather than to the submission task. This is required, as the application will want to wake up only a single io_ring_ctx at a time to process work, and so the lists of work have to be kept separate. This has some other benefits like not having to check the task continually in handle_tw_list (and potentially unlocking/locking those), and reducing locks in the submit & process completions path. There are networking cases where using this option can reduce request latency by 50%. For example a contrived example using [1] where the client sends 2k data and receives the same data back while doing some system calls (to trigger task work) shows this reduction. The reason ends up being that if sending responses is delayed by processing task work, then the client side sits idle. Whereas reordering the sends first means that the client runs it's workload in parallel with the local task work. [1]: Using https://github.com/DylanZA/netbench/tree/defer_run Client: ./netbench --client_only 1 --control_port 10000 --host --tx "epoll --threads 16 --per_thread 1 --size 2048 --resp 2048 --workload 1000" Server: ./netbench --server_only 1 --control_port 10000 --rx "io_uring --defer_taskrun 0 --workload 100" --rx "io_uring --defer_taskrun 1 --workload 100" Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-5-dylany@fb.com Signed-off-by: Jens Axboe commit 2327337b881d3f24949da4a4d34a6e657a71a79d Author: Dylan Yudaken Date: Tue Aug 30 05:50:09 2022 -0700 io_uring: do not run task work at the start of io_uring_enter This is not needed, and it is normally better to wait for task work until after submissions. This will allow greater batching if either work arrives in the meanwhile, or if the submissions cause task work to be queued up. For SQPOLL this also no longer runs task work, but this is handled inside the SQPOLL loop anyway. For IOPOLL io_iopoll_check will run task work anyway And otherwise io_cqring_wait will run task work Suggested-by: Pavel Begunkov Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-4-dylany@fb.com Signed-off-by: Jens Axboe commit b4c98d59a787eff4c8ee983bcf68266ce2199df6 Author: Dylan Yudaken Date: Tue Aug 30 05:50:08 2022 -0700 io_uring: introduce io_has_work This will be used later to know if the ring has outstanding work. Right now just if there is overflow CQEs to copy to the main CQE ring, but later will include deferred tasks Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-3-dylany@fb.com Signed-off-by: Jens Axboe commit 32d91f0590080597d5fc46c0c36d8885c241622e Author: Dylan Yudaken Date: Tue Aug 30 05:50:07 2022 -0700 io_uring: remove unnecessary variable 'running' is set once and read once, so can easily just remove it Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220830125013.570060-2-dylany@fb.com Signed-off-by: Jens Axboe commit 9f0deaa12d832f488500a5afe9b912e9b3cfc432 Author: Dylan Yudaken Date: Tue Aug 16 06:59:59 2022 -0700 eventfd: guard wake_up in eventfd fs calls as well Guard wakeups that the user can trigger, and that may end up triggering a call back into eventfd_signal. This is in addition to the current approach that only guards in eventfd_signal. Rename in_eventfd_signal -> in_eventfd at the same time to reflect this. Without this there would be a deadlock in the following code using libaio: int main() { struct io_context *ctx = NULL; struct iocb iocb; struct iocb *iocbs[] = { &iocb }; int evfd; uint64_t val = 1; evfd = eventfd(0, EFD_CLOEXEC); assert(!io_setup(2, &ctx)); io_prep_poll(&iocb, evfd, POLLIN); io_set_eventfd(&iocb, evfd); assert(1 == io_submit(ctx, 1, iocbs)); write(evfd, &val, 8); } Signed-off-by: Dylan Yudaken Reviewed-by: Jens Axboe Link: https://lore.kernel.org/r/20220816135959.1490641-1-dylany@fb.com Signed-off-by: Jens Axboe commit a921986f445ad611b441c8ee7749dc6dfc770481 Author: Chunxu Li Date: Wed Sep 21 20:02:39 2022 +0800 ASoC: SOF: mediatek: add pcm_pointer callback for mt8186 add pcm_pointer callback for mt8186 to support read host position from DSP Signed-off-by: Chunxu Li Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220921120239.31934-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 669d204469c46e91d99da24914130f78277a71d3 Author: Zhihao Cheng Date: Wed Aug 17 11:27:35 2022 +0800 ubi: fastmap: Add fastmap control support for 'UBI_IOCATT' ioctl [1] suggests that fastmap is suitable for large flash devices. Module parameter 'fm_autoconvert' is a coarse grained switch to enable all ubi devices to generate fastmap, which may turn on fastmap even for small flash devices. This patch imports a new field 'disable_fm' in struct 'ubi_attach_req' to support following situations by ioctl 'UBI_IOCATT'. [old functions] A. Disable 'fm_autoconvert': Disbable fastmap for all ubi devices B. Enable 'fm_autoconvert': Enable fastmap for all ubi devices [new function] C. Enable 'fm_autoconvert', set 'disable_fm' for given device: Don't create new fastmap and do full scan (existed fastmap will be destroyed) for the given ubi device. A simple test case in [2]. [1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_fastmap [2] https://bugzilla.kernel.org/show_bug.cgi?id=216278 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 2ddadec2206ca47a30995d22fa83be575e78f2a2 Author: Mark Brown Date: Mon Aug 29 16:49:21 2022 +0100 kselftest/arm64: Add coverage of TPIDR2_EL0 ptrace interface Extend the ptrace test support for NT_ARM_TLS to cover TPIDR2_EL0 - on systems that support SME the NT_ARM_TLS regset can be up to 2 elements long with the second element containing TPIDR2_EL0. On systems supporting SME we verify that this value can be read and written while on systems that do not support SME we verify correct truncation of reads and writes. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154921.837871-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0027d9c6c7b57b61b82f7275633ba89d0de2d2fd Author: Mark Brown Date: Mon Aug 29 16:49:20 2022 +0100 arm64/ptrace: Support access to TPIDR2_EL0 SME introduces an additional EL0 register, TPIDR2_EL0, intended for use by userspace as part of the SME. Provide ptrace access to it through the existing NT_ARM_TLS regset used for TPIDR_EL0 by expanding it to two registers with TPIDR2_EL0 being the second one. Existing programs that query the size of the register set will be able to observe the increased size of the register set. Programs that assume the register set is single register will see no change. On systems that do not support SME TPIDR2_EL0 will read as 0 and writes will be ignored, support for SME should be queried via hwcaps as normal. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154921.837871-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit f285da05c62a429f1978c5520cf069d483a7d9af Author: Mark Brown Date: Mon Aug 29 16:49:19 2022 +0100 arm64/ptrace: Document extension of NT_ARM_TLS to cover TPIDR2_EL0 In order to allow debuggers to discover lazily saved SME state we need to provide access to TPIDR2_EL0, we will extend the existing NT_ARM_TLS used for TPIDR to also include TPIDR2_EL0 as the second register in the regset. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154921.837871-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit ecaf4d3f734fe8d10aeda52193d325453e3e84ee Author: Mark Brown Date: Mon Aug 29 16:49:18 2022 +0100 kselftest/arm64: Add test coverage for NT_ARM_TLS In preparation for extending support for NT_ARM_TLS to cover additional TPIDRs add some tests for the existing interface. Do this in a generic ptrace test program to provide a place to collect additional tests in the future. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154921.837871-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 843e10b394271d5969bc36cd7ec8cccad3a857fd Merge: 61eb0add28023 6a47412d07987 Author: Mark Brown Date: Wed Sep 21 17:26:56 2022 +0100 ASoC: ts3a227e control debounce times Merge series from Astrid Rost : Add debounce support to the ts3a227e driver. commit a40c7f61d12fbd1e785e59140b9efd57127c0c33 Author: Rafael Mendonca Date: Fri Sep 16 17:47:51 2022 -0300 drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl() If the copy of the description string from userspace fails, then the page for the instance descriptor doesn't get freed before returning -EFAULT, which leads to a memleak. Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats") Signed-off-by: Rafael Mendonca Reviewed-by: Martin Krastev Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220916204751.720716-1-rafaelmendsr@gmail.com commit 61eb0add28023119773d6aab8f402e149473920c Author: Peter Ujfalusi Date: Wed Sep 21 14:27:51 2022 +0300 ASoC: SOF: ipc4-topology: Free the ida when IPC fails in sof_ipc4_widget_setup() The allocated ida needs to be freed up if the IPC message fails since next time when we try again to set up the widget we are going to try to allocate another ID and given enough tries, we are going to run out of unique IDs. Fixes: 711d0427c713 ("ASoC: SOF: ipc4-topology: move ida allocate/free to widget_setup/free") Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220921112751.9253-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 8c5035dfbb9475b67c82b3fdb7351236525bf52b Author: Yu Kuai Date: Tue Sep 13 18:57:49 2022 +0800 blk-wbt: call rq_qos_add() after wb_normal is initialized Our test found a problem that wbt inflight counter is negative, which will cause io hang(noted that this problem doesn't exist in mainline): t1: device create t2: issue io add_disk blk_register_queue wbt_enable_default wbt_init rq_qos_add // wb_normal is still 0 /* * in mainline, disk can't be opened before * bdev_add(), however, in old kernels, disk * can be opened before blk_register_queue(). */ blkdev_issue_flush // disk size is 0, however, it's not checked submit_bio_wait submit_bio blk_mq_submit_bio rq_qos_throttle wbt_wait bio_to_wbt_flags rwb_enabled // wb_normal is 0, inflight is not increased wbt_queue_depth_changed(&rwb->rqos); wbt_update_limits // wb_normal is initialized rq_qos_track wbt_track rq->wbt_flags |= bio_to_wbt_flags(rwb, bio); // wb_normal is not 0,wbt_flags will be set t3: io completion blk_mq_free_request rq_qos_done wbt_done wbt_is_tracked // return true __wbt_done wbt_rqw_done atomic_dec_return(&rqw->inflight); // inflight is decreased commit 8235b5c1e8c1 ("block: call bdev_add later in device_add_disk") can avoid this problem, however it's better to fix this problem in wbt: 1) Lower kernel can't backport this patch due to lots of refactor. 2) Root cause is that wbt call rq_qos_add() before wb_normal is initialized. Fixes: e34cbd307477 ("blk-wbt: add general throttling mechanism") Cc: Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20220913105749.3086243-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit f7de4886fe8f008ac4f7beeacd9bedb6b91241f5 Author: Christoph Hellwig Date: Fri Sep 9 15:15:09 2022 +0200 rnbd-srv: remove struct rnbd_dev Given that rnbd_srv_sess_dev already has an open_flags member, there is no need for the rnbd_dev indirection as a simple block_device pointer works just as well. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220909131509.3263924-5-hch@lst.de Signed-off-by: Jens Axboe commit 6856b194b29f066b2d6d9e10b91ca1a4c9d8fbb2 Author: Christoph Hellwig Date: Fri Sep 9 15:15:08 2022 +0200 rnbd-srv: remove rnbd_dev_{open,close} These can be trivially open coded in the callers. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220909131509.3263924-4-hch@lst.de Signed-off-by: Jens Axboe commit 2ecaa58104c7f9d58a818ddab7e14ee021e66553 Author: Christoph Hellwig Date: Fri Sep 9 15:15:07 2022 +0200 rnbd-srv: remove rnbd_endio Fold rnbd_endio into the only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220909131509.3263924-3-hch@lst.de Signed-off-by: Jens Axboe commit 9ad1532060d9bfa734cc22517e41683eb9726daa Author: Christoph Hellwig Date: Fri Sep 9 15:15:06 2022 +0200 rnbd-srv: simplify rnbd_srv_fill_msg_open_rsp Remove all the wrappers and just get the information directly from the block device, or where no such helpers exist the request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220909131509.3263924-2-hch@lst.de Signed-off-by: Jens Axboe commit b2bed51a5261f4266ecb857bba680a7f668d3ddf Author: Bart Van Assche Date: Tue Sep 20 13:06:26 2022 -0700 block: Fix the enum blk_eh_timer_return documentation The documentation of the blk_eh_timer_return enumeration values does not reflect correctly how e.g. the SCSI core uses these values. Fix the documentation. Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: Damien Le Moal Cc: Johannes Thumshirn Fixes: 88b0cfad2888 ("block: document the blk_eh_timer_return values") Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20220920200626.3422296-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit 32ff8ce08b47a5fe64ef9827443ba6cc49a659c8 Author: Stefan Haberland Date: Tue Sep 20 21:26:16 2022 +0200 s390/dasd: add device ping attribute Add a function to check if a device is accessible. This makes mostly sense for copy pair secondary devices but it will work for all devices. The sysfs attribute ping is a write only attribute and will issue a NOP CCW to the device. In case of success it will return zero. If the device is not accessible it will return an error code. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-8-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 1fca631a1185d1de9eab65ee963fec20efcc528a Author: Stefan Haberland Date: Tue Sep 20 21:26:15 2022 +0200 s390/dasd: suppress generic error messages for PPRC secondary devices Suppress generic command reject messages and dump of sense data for Peer-To-Peer-Remote-Copy (PPRC) secondary errors. If IO is issued on a PPRC secondary device, a specific error message is printed instead. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-7-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 112ff512fc654d7066936dcc06f77cc60471fdb4 Author: Stefan Haberland Date: Tue Sep 20 21:26:14 2022 +0200 s390/dasd: add ioctl to perform a swap of the drivers copy pair The newly defined ioctl BIODASDCOPYPAIRSWAP takes a structure that specifies a copy pair that should be swapped. It will call the device discipline function to perform the swap operation. The structure looks as followed: struct dasd_copypair_swap_data_t { char primary[20]; char secondary[20]; __u8 reserved[64]; }; where primary is the old primary device that will be replaced by the secondary device. The old primary will become a secondary device afterwards. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-6-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 413862caad6fe7fddec639219bccfdab60333551 Author: Stefan Haberland Date: Tue Sep 20 21:26:13 2022 +0200 s390/dasd: add copy pair swap capability In case of errors or misbehaviour of the primary device a controlled failover to one of the configured secondary devices needs to be performed. The swap processing stops I/O on the primary device, all requests are re-queued to the blocklayer queue, the entries in the copy relation are swapped and finally the link to the blockdevice is moved from primary to secondary dasd device. After this, the secondary becomes the new primary device and I/O is restarted on that device. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-5-sth@linux.ibm.com Signed-off-by: Jens Axboe commit a91ff09d39f9b6545254839ac91f1ff7bd21d39e Author: Stefan Haberland Date: Tue Sep 20 21:26:12 2022 +0200 s390/dasd: add copy pair setup A copy relation that is configured on the storage server side needs to be enabled separately in the device driver. A sysfs interface is created that allows userspace tooling to control such setup. The following sysfs entries are added to store and read copy relation information: copy_pair - Add/Delete a copy pair relation to the DASD device driver - Query all previously added copy pair relations copy_role - Query the copy pair role of the device To add a copy pair to the DASD device driver it has to be specified through the sysfs attribute copy_pair. Only one secondary device can be specified at a time together with the primary device. Both, secondary and primary can be used equally to define the copy pair. The secondary devices have to be offline when adding the copy relation. The primary device needs to be specified first followed by the comma separated secondary device. Read from the copy_pair attribute to get the current setup and write "clear" to the attribute to delete any existing setup. Example: $ echo 0.0.9700,0.0.9740 > /sys/bus/ccw/devices/0.0.9700/copy_pair $ cat /sys/bus/ccw/devices/0.0.9700/copy_pair 0.0.9700,0.0.9740 During device online processing the required data will be read from the storage server and the information will be compared to the setup requested through the copy_pair attribute. The registration of the primary and secondary device will be handled accordingly. A blockdevice is only allocated for copy relation primary devices. To query the copy role of a device read from the copy_role sysfs attribute. Possible values are primary, secondary, and none. Example: $ cat /sys/bus/ccw/devices/0.0.9700/copy_role primary Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-4-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 3f217cceb6846e7533511fc69bc774cdba37ff7d Author: Stefan Haberland Date: Tue Sep 20 21:26:11 2022 +0200 s390/dasd: add query PPRC function Add function to query the Peer-to-Peer-Remote-Copy (PPRC) state of a device by reading the related structure through a read subsystem data call. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-3-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 2b43bf061b2e1b67561cbb1f6f305421f5fc86af Author: Stefan Haberland Date: Tue Sep 20 21:26:10 2022 +0200 s390/dasd: put block allocation in separate function Put block allocation into a separate function to put some copy pair logic in it in a later patch. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220920192616.808070-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 6fb4825e492b07ba6e450e5c9add3a35aa337f54 Author: Edward Cree Date: Mon Sep 5 14:55:57 2022 +0100 docs: net: add an explanation of VF (and other) Representors There's no clear explanation of what VF Representors are for, their semantics, etc., outside of vendor docs and random conference slides. Add a document explaining Representors and defining what drivers that implement them are expected to do. Signed-off-by: Edward Cree Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220905135557.39233-1-ecree@xilinx.com Signed-off-by: Jakub Kicinski commit d322259506a429f85194f3b28754d615364ea99d Merge: 8be7dfc6a8eb5 259cee1c2422b Author: Greg Kroah-Hartman Date: Wed Sep 21 16:21:19 2022 +0200 Merge tag 'misc-habanalabs-next-2022-09-21' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-next Oded writes: "This tag contains habanalabs driver changes for v6.1: - Support new notifier event for device state change through eventfd. - Add uAPI to retrieve device attestation information for Gaudi2. - Add uAPI to retrieve the h/w status of all h/w blocks. - Add uAPI to control the running mode of the engine cores in Gaudi2. - Expose whether the device runs with secured firmware through the INFO ioctl and sysfs. - Support trace events in DMA allocations and MMU map/unmap operations. - Notify firmware when the device was acquired by a user process and when it was released. This is done as part of the RAS that the f/w performs. - Multiple bug fixes, refactors and renames. - Cleanup of error messages, moving some to debug level. - Enhance log prints in case of h/w error events for Gaudi2." * tag 'misc-habanalabs-next-2022-09-21' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (68 commits) habanalabs: eliminate aggregate use warning habanalabs/gaudi: use 8KB aligned address for TPC kernels habanalabs: remove some f/w descriptor validations habanalabs: build ASICs from new to old habanalabs/gaudi2: allow user to flush PCIE by read habanalabs: failure to open device due to reset is debug level habanalabs/gaudi2: Remove unnecessary (void*) conversions habanalabs/gaudi2: add secured attestation info uapi habanalabs/gaudi2: add handling to pmmu events in eqe handler habanalabs/gaudi: change TPC Assert to use TPC DEC instead of QMAN err habanalabs: rename error info structure habanalabs/gaudi2: get f/w reset status register dynamically habanalabs/gaudi2: increase hard-reset sleep time to 2 sec habanalabs/gaudi2: print RAZWI info upon PCIe access error habanalabs: MMU invalidation h/w is per device habanalabs: new notifier events for device state habanalabs/gaudi2: free event irq if init fails habanalabs: fix resetting the DRAM BAR habanalabs: add support for new cpucp return codes habanalabs/gaudi2: read F/W security indication after hard reset ... commit 8be7dfc6a8eb54589100d4ea15b0039c2d01422b Merge: 4ba028e41b050 5fc1531dd771c Author: Greg Kroah-Hartman Date: Wed Sep 21 16:16:03 2022 +0200 Merge tag 'coresight-next-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next Suzuki writes: "coresight: Changes for v6.1 Coresight trace subsystem updates for v6.1 includes: - Support for HiSilicon PTT trace - Coresight cleanup of sysfs accessor functions, reduced code size. - Expose coresight timestamp source for ETMv4+ - DT binding updates to include missing properties - Minor documentation, Kconfig text fixes. Signed-off-by: Suzuki K Poulose " * tag 'coresight-next-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: hwtracing: hisi_ptt: Fix up for "iommu/dma: Make header private" MAINTAINERS: Add maintainer for HiSilicon PTT driver docs: trace: Add HiSilicon PTT device driver documentation hwtracing: hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity coresight: cti-sysfs: Mark coresight_cti_reg_store() as __maybe_unused coresight: Make new csdev_access offsets unsigned coresight: cti-sysfs: Re-use same functions for similar sysfs register accessors coresight: Re-use same function for similar sysfs register accessors coresight: Simplify sysfs accessors by using csdev_access abstraction coresight: Remove unused function parameter coresight: etm4x: docs: Add documentation for 'ts_source' sysfs interface coresight: etm4x: Expose default timestamp source in sysfs dt-bindings: arm: coresight-tmc: Add 'iommu' property dt-bindings: arm: coresight: Add 'power-domains' property coresight: docs: Fix a broken reference coresight: trbe: fix Kconfig "its" grammar commit 4ba028e41b0500cc16bf1ee303be48af88b65e77 Merge: bfbb588486755 2f61ff8272967 Author: Greg Kroah-Hartman Date: Wed Sep 21 16:04:24 2022 +0200 Merge tag 'iio-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO new device support, features and cleanup for 6.1 This includes Nuno Sa's work to move the IIO core over to generic firmware properties rather than having DT specific code paths. Combined with Andy Shevchenko's long term work on drivers, this leaves IIO in a good state for handling other firmware types. New device support - liteon,ltrf216a * New driver and dt bindings to support this Light sensor. - maxim,max11205 * New driver for this 16bit single channel ADC. - memsensing,msa311 * New driver for this accelerometer. Includes a string helper for read/write. - richtek,rtq6056 * New driver and dt binding to support this current monitor used to measure power usage. - yamaha,yas530 * Support the YAS537 variant (series includes several fixes for other parts and new driver features). Staging graduation - adi,ad7746 CDC. Cleanup conducted against set of roadtest tests using the posted RFC of that framework. Features - core * Large rework to make all the core IIO code use generic firmware properties. Includes switching some drivers over as well using newly provided generic interfaces and allowing removal of DT specific ones. * Support for gesture event types for single and double tap. Used in bosch,bma400. - atmel,at91-sama5d2 * Add support for temperature sensor which uses two muxed inputs to estimate the temperature. * Handle trackx bits of EMR register to improve temp sampling accuracy. * Runtime PM support. - liteon,ltrf216a * Add a _raw channel output to allow working around an issue with differing conversions equations that breaks some user space controls. - mexelis,mlx90632 * Support regulator control. - ti,tsc2046 * External reference voltage support. Clean up and minor fixes - Tree-wide * devm_clk_get_enabled() replacements of opencoded equivalent. * Remaining IIO_DMA_MINALIGN conversions (the staging/iio drivers). * Various minor warning and similar cleanup such as missing static markings. * strlcpy() to strscpy() for cases where return value not checked. * provide units.h entries for more HZ units and use them in drivers. - dt-bindings cleanup * Drop maintainers listss where the email address is bouncing. * Switch spi devices over to using spi-peripheral.yaml * Add some missing unevaluatedProperties / additionalProperties: false entries. - ABI docs * Add some missing channel type specific sampling frequency entries. * Add parameter names for callback parameters. - MAINTAINERS * Fix wrong ADI forum links. - core * lockdep class per device, to avoid an issue with nest when one IIO device is the consumer of another. * White space tweaks. - asc,dlhl60d * Use get_unaligned_be24 to avoid some unusual data manipulation and masking. - atmel,at91-sama5d2 * Fix wrong max value. * Improve error handling when measuring pressure and touch. * Add locks to remove races on updating oversampling / sampling freq. * Add missing calls in suspend and resume path to ensure state is correctly brought up if buffered capture was in use when suspend happened. * Error out of write_raw() callback if buffered capture enabled to avoid unpredictable behavior. * Handle different versions having different oversampling ratio support and drop excess error checking. * Cleanup magic value defines where the name is just the value and hence hurts readability. * Use read_avail() callback to provide info on possible oversampling ratios. * Correctly handle variable bit depth when doing oversampling on different supported parts. Also handle higher oversampling ratios. - fsl,imx8qxp * Don't ignore errors from regulator_get_voltage() so as to avoid some very surprising scaling. - invensense,icp10100 * Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS. UNIVERSAL rarely made sense and is now deprecated. In this driver we just avoid double disabling in some paths. - maxim,max1363 * Drop consumer channel map provision by platform data. There have been better ways of doing this for years and there are no in tree users. - microchip,mcp3911 * Update status to maintained. - qcom,spmi-adc5 * Support measurement of LDO output voltage. - qcom,spmi-adc * Add missing channel available on SM6125 SoC. - st,stmpe * Drop requirement on node name in binding now that driver correctly doesn't enforce it. - stx104 * Move to more appropriate addac directory - ti,am335x * Document ti,am654-adc compatible already in use in tree. - ti,hmc5843 * Move dev_pm_ops out of header and use new pm macros to handle export. - yamaha,yas530 * Minor cleanups. * tag 'iio-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (142 commits) iio: pressure: icp10100: Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS(). iio: adc: max1363: Drop provision to provide an IIO channel map via platform data iio: accel: bma400: Add support for single and double tap events iio: Add new event type gesture and use direction for single and double tap iio: Use per-device lockdep class for mlock iio: adc: add max11205 adc driver dt-bindings: iio: adc: Add max11205 documentation file iio: magnetometer: yamaha-yas530: Use dev_err_probe() iio: magnetometer: yamaha-yas530: Make strings const in chip info iio: magnetometer: yamaha-yas530: Use pointers as driver data iio: adc: tsc2046: silent spi_device_id warning iio: adc: tsc2046: add vref support dt-bindings: iio: adc: ti,tsc2046: add vref-supply property iio: light: ltrf216a: Add raw attribute dt-bindings: iio: Add missing (unevaluated|additional)Properties on child nodes MAINTAINERS: fix Analog Devices forum links iio/accel: fix repeated words in comments dt-bindings: iio: accel: add dt-binding schema for msa311 accel driver iio: add MEMSensing MSA311 3-axis accelerometer driver dt-bindings: vendor-prefixes: add MEMSensing Microsystems Co., Ltd. ... commit bfbb588486755be6209f4ab40e6c500fd835f052 Merge: cbb9a572f94be e4e9631b2c888 Author: Greg Kroah-Hartman Date: Wed Sep 21 15:43:35 2022 +0200 Merge tag 'mhi-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next Manivannan writes: "MHI Host -------- - Print the modem name while probing the MHI host pci-generic driver. This has been exposed as a debug information so far but on a low storate embedded devices such as OpenWRT based products, this helps in identifying the attached modem without enabling the debug logs." * tag 'mhi-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi: bus: mhi: host: always print detected modem name commit cbb9a572f94be8da041e72a51a7f9968e63d837c Merge: ceecbbddbf549 562d0bf2cab80 Author: Greg Kroah-Hartman Date: Wed Sep 21 15:42:42 2022 +0200 Merge tag 'fpga-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next Xu writes: FPGA Manager changes for 6.1-rc1 DFL - Matthew's change adds new device IDs supported by DFL. - Dan's change uses array_size() for memory allocation to prevent potential overflow Microchip - Conor's change adds MODULE_AUTHOR entry for microchip-spi driver - Krzysztof's change refines dt-bindings Intel m10 bmc secure update - Russ's change adds new device ID supported by the driver All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-next branch). Signed-off-by: Xu Yilun * tag 'fpga-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: m10bmc-sec: d5005 bmc secure update driver fpga: prevent integer overflow in dfl_feature_ioctl_set_irq() dt-bindings: fpga: microchip,mpf-spi-fpga-mgr: use spi-peripheral-props.yaml fpga: microchip-spi: add missing module author entry fpga: dfl-pci: Add IDs for Intel N6000, N6001 and C6100 cards commit 01bf246a20c7664ae41cdbefd0314d0fb67d63e9 Merge: 63b7c2ebcc1d6 75ae8c284c00d Author: David S. Miller Date: Wed Sep 21 13:50:03 2022 +0100 Merge branch 'net-dev_err_probe' Yang Yingliang says: ==================== net: drivers: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. It will print error code in a human readable way and simplify the code. ==================== Signed-off-by: David S. Miller commit 75ae8c284c00dc3584b7c173f6fcf96ee15bd02c Author: Yang Yingliang Date: Thu Sep 15 19:42:14 2022 +0800 net: ll_temac: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit c222cd27dd9642da53f2c064cc2d7f88ca4f04ff Author: Yang Yingliang Date: Thu Sep 15 19:42:13 2022 +0800 net: stmmac: dwc-qos: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit b6dc230fba4b2c87a1eef55dd1562e53e92edefb Author: Yang Yingliang Date: Thu Sep 15 19:42:12 2022 +0800 net: ibm: emac: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit d02bb8bef4576d4511425270e61617b13ec4c387 Author: Yang Yingliang Date: Thu Sep 15 19:42:11 2022 +0800 net: dsa: lantiq: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2c22e42edc8d18092a5ed7b77ab1a2996948a0ee Author: Yang Yingliang Date: Thu Sep 15 19:42:10 2022 +0800 net: ethernet: ti: cpsw_new: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 102947f9bb9247ed45fb3dc9d8db96df05bc5ea0 Author: Yang Yingliang Date: Thu Sep 15 19:42:09 2022 +0800 net: ethernet: ti: cpsw: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit e2baa12608d4c5dabc6689a58ce8e2c9d1a272e8 Author: Yang Yingliang Date: Thu Sep 15 19:42:08 2022 +0800 net: ethernet: ti: am65-cpts: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 9e80f489478cba609d811431b1693bb9ff5b6739 Merge: aa8c8cd047467 e9233917a7e53 Author: Ulf Hansson Date: Wed Sep 21 14:44:41 2022 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.0rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.1. Signed-off-by: Ulf Hansson commit 50503e360eeb968a3d00234c9cc4057d774c3e9a Author: Johnothan King Date: Wed Sep 21 10:55:57 2022 +0000 HID: nintendo: check analog user calibration for plausibility Arne Wendt writes: Cheap clone controllers may (falsely) report as having a user calibration for the analog sticks in place, but return wrong/impossible values for the actual calibration data. In the present case at mine, the controller reports having a user calibration in place and successfully executes the read commands. The reported user calibration however is min = center = max = 0. This pull request addresses problems of this kind by checking the provided user calibration-data for plausibility (min < center < max) and falling back to the default values if implausible. I'll note that I was experiencing a crash because of this bug when using the GuliKit KingKong 2 controller. The crash manifests as a divide by zero error in the kernel logs: kernel: divide error: 0000 [#1] PREEMPT SMP NOPTI Link: https://github.com/nicman23/dkms-hid-nintendo/pull/25 Link: https://github.com/DanielOgorchock/linux/issues/36 Co-authored-by: Arne Wendt Signed-off-by: Johnothan King Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/gvpL2G6VwXGJPvxX5KRiu9pVjvTivgayug_jdKDY6zfuAaAqncP9BkKLosjwUXNlgVVTMfJSKfwPF1K79cKAkwGComyC21vCV3q9B3EXNkE=@protonmail.com commit e2c12540420dd32be43a61533d87050d5fb0bcdf Author: Vincenzo Frascino Date: Wed Sep 7 12:02:35 2022 +0100 arm64: Enable docker support in defconfig The arm64 defconfig does not support the docker usecase. Enable the missing configuration options. The resulting .config was validated with [1]. ... Generally Necessary: - cgroup hierarchy: properly mounted [/sys/fs/cgroup] - apparmor: enabled and tools installed - CONFIG_NAMESPACES: enabled - CONFIG_NET_NS: enabled - CONFIG_PID_NS: enabled - CONFIG_IPC_NS: enabled - CONFIG_UTS_NS: enabled - CONFIG_CGROUPS: enabled - CONFIG_CGROUP_CPUACCT: enabled - CONFIG_CGROUP_DEVICE: enabled - CONFIG_CGROUP_FREEZER: enabled - CONFIG_CGROUP_SCHED: enabled - CONFIG_CPUSETS: enabled - CONFIG_MEMCG: enabled - CONFIG_KEYS: enabled - CONFIG_VETH: enabled (as module) - CONFIG_BRIDGE: enabled (as module) - CONFIG_BRIDGE_NETFILTER: enabled (as module) - CONFIG_IP_NF_FILTER: enabled (as module) - CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module) - CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module) - CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module) - CONFIG_NETFILTER_XT_MATCH_IPVS: enabled (as module) - CONFIG_NETFILTER_XT_MARK: enabled (as module) - CONFIG_IP_NF_NAT: enabled (as module) - CONFIG_NF_NAT: enabled (as module) - CONFIG_POSIX_MQUEUE: enabled - CONFIG_CGROUP_BPF: enabled ... [1] https://github.com/moby/moby/blob/master/contrib/check-config.sh Cc: Will Deacon Cc: Arnd Bergmann Acked-by: Catalin Marinas Signed-off-by: Vincenzo Frascino Link: https://lore.kernel.org/r/20220907110235.14708-1-vincenzo.frascino@arm.com Signed-off-by: Catalin Marinas commit 31dbadcc2828ac8c4608bf2ac6b12b286943e634 Author: Kefeng Wang Date: Wed Jun 29 17:35:24 2022 +0800 arm64: defconfig: Enable memory hotplug and hotremove config Let's enable ACPI_HMAT, ACPI_HOTPLUG_MEMORY, MEMORY_HOTPLUG and MEMORY_HOTREMOVE for more test coverage, also there are useful for heterogeneous memory scene. Signed-off-by: Kefeng Wang Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220629093524.34801-1-wangkefeng.wang@huawei.com Signed-off-by: Catalin Marinas commit 120072f48f4ef0b017f65d5efd0548938cb43052 Author: Mark Brown Date: Mon Sep 19 17:27:53 2022 +0100 arm64: configs: Enable all PMUs provided by Arm The selection of PMUs enabled in the defconfig is currently a bit random and does not include a number of those provided by Arm and present in a fairly wide range of SoCs. Improve coverage and defconfig utility by enabling all the Arm provided PMUs by default. Signed-off-by: Mark Brown Reviewed-by: James Clark Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220919162753.3079869-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 63b7c2ebcc1d69bbf19e7418ef6c2496364f0ce2 Author: Ziyang Xuan Date: Thu Sep 15 09:08:35 2022 +0800 net/af_packet: registration process optimization in packet_init() Now, register_pernet_subsys() and register_netdevice_notifier() are both after sock_register(). It can create PF_PACKET socket and process socket once sock_register() successfully. It is possible PF_PACKET socket is creating but register_pernet_subsys() and register_netdevice_notifier() are not registered yet. Thus net->packet.sklist_lock and net->packet.sklist will be accessed without initialization that is done in packet_net_init(). Although this is a low probability scenario. Move register_pernet_subsys() and register_netdevice_notifier() to the front in packet_init(). Correspondingly, adjust the unregister process in packet_exit(). Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit 2a566f0148bad759ba6f3758914edda1a8a4181f Author: Jinpeng Cui Date: Tue Sep 13 16:13:26 2022 +0000 net: sched: act_ct: remove redundant variable err Return value directly from pskb_trim_rcsum() instead of getting value from redundant variable err. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: David S. Miller commit 0072dc1b53c39fb7c4cfc5c9e5d5a30622198613 Author: Mark Rutland Date: Tue Sep 20 15:00:44 2022 +0100 arm64: avoid BUILD_BUG_ON() in alternative-macros Nathan reports that the build fails when using clang and LTO: | In file included from kernel/bounds.c:10: | In file included from ./include/linux/page-flags.h:10: | In file included from ./include/linux/bug.h:5: | In file included from ./arch/arm64/include/asm/bug.h:26: | In file included from ./include/asm-generic/bug.h:5: | In file included from ./include/linux/compiler.h:248: | In file included from ./arch/arm64/include/asm/rwonce.h:11: | ./arch/arm64/include/asm/alternative-macros.h:224:2: error: call to undeclared function 'BUILD_BUG_ON'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | BUILD_BUG_ON(feature >= ARM64_NCAPS); | ^ | ./arch/arm64/include/asm/alternative-macros.h:241:2: error: call to undeclared function 'BUILD_BUG_ON'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | BUILD_BUG_ON(feature >= ARM64_NCAPS); | ^ | 2 errors generated. ... the problem being that when LTO is enabled, includes , and causes a circular include dependency through . This manifests as BUILD_BUG_ON() not being defined when used within . This patch avoids the problem and simplifies the include dependencies by using compiletime_assert() instead of BUILD_BUG_ON(). Signed-off-by: Mark Rutland Fixes: 21fb26bfb01f ("arm64: alternatives: add alternative_has_feature_*()") Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Link: http://lore.kernel.org/r/YyigTrxhE3IRPzjs@dev-arch.thelio-3990X Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220920140044.1709073-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 31fd7108302388d732973c58470d4be559d352ec Author: Marek Vasut Date: Thu Feb 17 18:43:57 2022 +0100 dt-bindings: leds: Document mmc trigger The mmc subsystem supports triggering leds on card activity, document the trigger value here. The value is a pattern in this case. Signed-off-by: Marek Vasut Cc: Jacek Anaszewski Cc: Pavel Machek Cc: Rob Herring Cc: devicetree@vger.kernel.org To: linux-leds@vger.kernel.org Signed-off-by: Pavel Machek Reviewed-by: Rob Herring commit fd6dd9584ed3ee6debf2e7f9c9e69ef09b368277 Author: Bernardo Rodrigues Date: Sun Dec 5 18:00:49 2021 -0300 leds: pca963x: fix blink with hw acceleration LEDs would behave differently depending on the blink hardware acceleration configuration. This commit will make LEDs respond exactly the same independently of the hardware acceleration status. In other words, if you had two pca963x, side by side, one with blink hardware acceleration "ON" and the other "OFF; and performed some arbitrary sequence of API calls (e.g. turn on/off, change brightness, change blink mode, etc.) you probably would end with not matching LED states. 'pca963x software blink' and 'leds-gpio' behavior were used as reference. Actual chip used to validate this change: pca9634 Some of the unmatched behaviors being fixed are (when hw blink was "ON") - Leds would stop blinking when the brightness was changed. - Leds would persist their blinking mode even after being turned off (brightness = 0). - Leds would only blink if another led was solid (pca963x will be forced out of low power) Signed-off-by: Bernardo Rodrigues Signed-off-by: Pavel Machek commit dca6344d7a77dd0501a73745f4a9fb1ee2bc9d7c Author: Jules Irenge Date: Sun Sep 18 00:41:08 2022 +0100 perf/core: Convert snprintf() to scnprintf() Coccinelle reports a warning: WARNING: use scnprintf or sprintf This LWN article explains the rationale for this change: https: //lwn.net/Articles/69419/ Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length. Adding to that, there has also been some slow migration from snprintf to scnprintf, here's the shift in usage in the past 3.5 years, in all fs/ files: v5.0 v6.0-rc6 -------------------------------------- snprintf() uses: 63 213 scnprintf() uses: 374 186 No intended change in behavior. [ mingo: Improved the changelog & reviewed the usage sites. ] Signed-off-by: Jules Irenge Signed-off-by: Ingo Molnar commit f92ff8f5dca2acfa475842c71212657b0703c3be Author: Thomas Gleixner Date: Thu Sep 15 13:10:40 2022 +0200 x86/paravirt: Ensure proper alignment The entries in the .parainstructions sections are 8 byte aligned and the corresponding C struct paravirt_patch_site makes the array offset 16 bytes. Though the pushed entries are only using 12 bytes, __parainstructions_end is therefore 4 bytes short. That works by chance because it's only used in a loop: for (p = start; p < end; p++) But this falls flat when calculating the number of elements: n = end - start That's obviously off by one. Ensure that the gap is filled and the last entry is occupying 16 bytes. [ bp: Add the proper struct and section names. ] Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220915111142.992398801@infradead.org commit 2fa22c3c755fb06a0c4507320c929616bbae1ec3 Author: Jaroslav Kysela Date: Wed Sep 21 11:33:49 2022 +0200 ALSA: hda/hdmi: ELD procfs - print the codec NIDs It is useful for the debugging to print also the used HDA codec NIDs used for the given HDMI device. With the dynamic converter assignment the converter NID is changed dynamically. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220921093349.82680-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 9bf320f0cf872bf23d9f03abefeff2130acbd6c5 Author: Jaroslav Kysela Date: Wed Sep 21 11:33:22 2022 +0200 ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() Make the code more readable. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220921093322.82609-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 38e316398e4e6338b80223fb5f74415c0513718f Author: Christian Brauner Date: Mon Sep 19 11:49:14 2022 +0200 xattr: always us is_posix_acl_xattr() helper The is_posix_acl_xattr() helper was added in 0c5fd887d2bb ("acl: move idmapped mount fixup into vfs_{g,s}etxattr()") to remove the open-coded checks for POSIX ACLs. We missed to update two locations. Switch them to use the helper. Cc: Seth Forshee (DigitalOcean) Cc: Christoph Hellwig Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) Reviewed-by: Christoph Hellwig commit 0d0a0b4413460383331088b2203ba09a6971bc3a Author: Matt Ranostay Date: Mon Sep 19 13:57:23 2022 -0700 arm64: dts: ti: k3-j7200: fix main pinmux range Range size of 0x2b4 was incorrect since there isn't 173 configurable pins for muxing. Additionally there is a non-addressable region in the mapping which requires splitting into two ranges. main_pmx0 -> 67 pins main_pmx1 -> 3 pins Fixes: d361ed88455f ("arm64: dts: ti: Add support for J7200 SoC") Signed-off-by: Matt Ranostay Signed-off-by: Vignesh Raghavendra Tested-by: Vaishnav Achath Link: https://lore.kernel.org/r/20220919205723.8342-1-mranostay@ti.com commit e7f35da21f6f8c6a8c7d262dd4e4bd32e3083f79 Author: Christophe JAILLET Date: Mon Jul 4 20:46:00 2022 +0200 ubi: fastmap: Use the bitmap API to allocate bitmaps Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit a0c51565730729f0df2ee886e34b4da6d359a10b Author: Zhihao Cheng Date: Tue Jul 19 16:00:17 2022 +0800 ubifs: Fix AA deadlock when setting xattr for encrypted file Following process: vfs_setxattr(host) ubifs_xattr_set down_write(host_ui->xattr_sem) <- lock first time create_xattr ubifs_new_inode(host) fscrypt_prepare_new_inode(host) fscrypt_policy_to_inherit(host) if (IS_ENCRYPTED(inode)) fscrypt_require_key(host) fscrypt_get_encryption_info(host) ubifs_xattr_get(host) down_read(host_ui->xattr_sem) <- AA deadlock , which may trigger an AA deadlock problem: [ 102.620871] INFO: task setfattr:1599 blocked for more than 10 seconds. [ 102.625298] Not tainted 5.19.0-rc7-00001-gb666b6823ce0-dirty #711 [ 102.628732] task:setfattr state:D stack: 0 pid: 1599 [ 102.628749] Call Trace: [ 102.628753] [ 102.628776] __schedule+0x482/0x1060 [ 102.629964] schedule+0x92/0x1a0 [ 102.629976] rwsem_down_read_slowpath+0x287/0x8c0 [ 102.629996] down_read+0x84/0x170 [ 102.630585] ubifs_xattr_get+0xd1/0x370 [ubifs] [ 102.630730] ubifs_crypt_get_context+0x1f/0x30 [ubifs] [ 102.630791] fscrypt_get_encryption_info+0x7d/0x1c0 [ 102.630810] fscrypt_policy_to_inherit+0x56/0xc0 [ 102.630817] fscrypt_prepare_new_inode+0x35/0x160 [ 102.630830] ubifs_new_inode+0xcc/0x4b0 [ubifs] [ 102.630873] ubifs_xattr_set+0x591/0x9f0 [ubifs] [ 102.630961] xattr_set+0x8c/0x3e0 [ubifs] [ 102.631003] __vfs_setxattr+0x71/0xc0 [ 102.631026] vfs_setxattr+0x105/0x270 [ 102.631034] do_setxattr+0x6d/0x110 [ 102.631041] setxattr+0xa0/0xd0 [ 102.631087] __x64_sys_setxattr+0x2f/0x40 Fetch a reproducer in [Link]. Just like ext4 does, which skips encrypting for inode with EXT4_EA_INODE_FL flag. Stop encypting xattr inode for ubifs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216260 Fixes: f4e3634a3b64222 ("ubifs: Fix races between xattr_{set|get} ...") Fixes: d475a507457b5ca ("ubifs: Add skeleton for fscrypto") Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 713346ca1db2bebd4c7c4d5ea364ed03d504f5ed Author: ZhaoLong Wang Date: Sat Jul 9 16:40:32 2022 +0800 ubifs: Fix UBIFS ro fail due to truncate in the encrypted directory The ubifs_compress() function does not compress the data When the data length is short than 128 bytes or the compressed data length is not ideal.It cause that the compressed length of the truncated data in the truncate_data_node() function may be greater than the length of the raw data read from the flash. The above two lengths are transferred to the ubifs_encrypt() function as parameters. This may lead to assertion fails and then the file system becomes read-only. This patch use the actual length of the data in the memory as the input parameter for assert comparison, which avoids the problem. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216213 Signed-off-by: ZhaoLong Wang Signed-off-by: Richard Weinberger commit 019ac05e4c97f51913318d9b0e2ffd34db917d3c Author: Jiang Jian Date: Thu Jun 23 15:19:53 2022 +0800 mtd: ubi: drop unexpected word 'a' in comments there is an unexpected word 'a' in the comments that need to be dropped file - drivers/mtd/ubi/vmt.c line - 626,779 * Returns zero if volume is all right and a a negative error code if not. changed to: * Returns zero if volume is all right and a negative error code if not. Signed-off-by: Jiang Jian Signed-off-by: Richard Weinberger commit e079be2c354aede45ce130027264611b276dcef1 Author: Julia Lawall Date: Mon Mar 14 12:53:37 2022 +0100 ubi: block: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Richard Weinberger commit b58b25280003f078f9b861656ca097074267f75a Author: Zhang Jiaming Date: Mon Jul 4 10:13:56 2022 +0800 ubi: fastmap: Fix typo in comments There are a typo(dont't) in comments. Fix it. Signed-off-by: Zhang Jiaming Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit ec1f97f501a746403990515bbefcaecd7562b042 Author: Jilin Yuan Date: Wed Aug 10 21:38:56 2022 +0800 ubi: Fix repeated words in comments Delete the redundant word 'a'. Delete the redundant word 'the'. Signed-off-by: Jilin Yuan Signed-off-by: Richard Weinberger commit e0437512081282559f5c50591f487149c31f867c Author: Dan Carpenter Date: Wed Sep 21 10:24:51 2022 +0300 spi: omap2-mcspi: Fix probe so driver works again This condition was accidentally changed from "if (status < 0)" to "if (status)". The platform_get_irq() function returns non-zero positive values on success so, unfortunately, the driver could not be used. Change the condition back to how it was. Fixes: f4ca8c88c2c7 ("spi: omap2-mcspi: Switch to use dev_err_probe() helper") Signed-off-by: Dan Carpenter Reviewed-by: Yang Yingliang Link: https://lore.kernel.org/r/Yyq8Q/kd301wVzg8@kili Signed-off-by: Mark Brown commit ee81cfb58286c1aed3263d2fc94b321e7d963f08 Author: Zeng Heng Date: Wed Sep 21 11:38:19 2022 +0800 ASoC: sunxi: fix declaration compile error Just fix compile error without any logic changes. sound/soc/sunxi/sun50i-dmic.c:62:1: error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration] 62 | const static struct dmic_rate dmic_rate_s[] = { | ^~~~~ Signed-off-by: Zeng Heng Link: https://lore.kernel.org/r/20220921033819.2188233-1-zengheng4@huawei.com Signed-off-by: Mark Brown commit 6a47412d0798735b0715d224574d216dba9e630c Author: Astrid Rost Date: Wed Sep 21 10:18:33 2022 +0200 ASoC: ti,ts3a227e: add control of debounce Add devicetree parameters to control the insertion, release and press debounce times. Signed-off-by: Astrid Rost Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220921081834.22009-3-astrid.rost@axis.com Signed-off-by: Mark Brown commit be541bd473618f64fa14138dc7f63b0643363f7b Author: Astrid Rost Date: Wed Sep 21 10:18:32 2022 +0200 ASoC: ti,ts3a227e: convert to yaml Convert from ts3a227e.txt to yaml. Signed-off-by: Astrid Rost Link: https://lore.kernel.org/r/20220921081834.22009-2-astrid.rost@axis.com Signed-off-by: Mark Brown commit d20fa87e80c363a1c9534afb31df2fa90087e51d Author: Astrid Rost Date: Wed Sep 21 10:18:34 2022 +0200 ASoC: ts3a227e: add parameters to control debounce times Add devicetree parameters to control the insert, release and press debounce times. Signed-off-by: Astrid Rost Link: https://lore.kernel.org/r/20220921081834.22009-4-astrid.rost@axis.com Signed-off-by: Mark Brown commit f7aadbb23ce4c0572b5732a731d6f30b81569bee Merge: 1dc53232a9cbe 52d7939d10f25 Author: Mark Brown Date: Wed Sep 21 10:19:15 2022 +0100 ASoC: SOF: Add SKL/KBL support for IPC4 CI tests Merge series from Pierre-Louis Bossart : This patchset was submitted earlier in April 2022 as part of the "ASoC: SOF: add INTEL_IPC4 plumbing" series. As requested the SKL/KBL support is moved to a different series. This update adds minor style fixes and the ops that were missing at the time. SKL and KBL daily tests have been running for several months and helped identify missing sequences in the SOF driver for HDaudio links, or platform differences that the driver did not account for (number of pipelines, etc). Note that this capability is not recommended for any distribution, it is ONLY for SOF IPC4 CI tests on HDaudio devices, we will not extend this SKL/KBL support for I2S devices based on ES8336 or Chromebooks which are ONLY supported by the AVS driver. commit 1dc53232a9cbefad9a84f6a8bc35c15e2f592b4b Merge: 2ca8c73b67330 40d3c041e2f87 Author: Mark Brown Date: Wed Sep 21 10:19:01 2022 +0100 ADD SOF support for rembrandt platform Merge series from V sujith kumar Reddy : This series consists of 1.Make ACP core code generic for newer SOC transition 2.Add support for Rembrandt plaform 3.Adding amd HS functionality to the sof core 4.increase SRAM inbox and outbox size to 1024 commit 2ca8c73b67330b317200253f0017acd6832bac69 Merge: 2edd66eccfeab 2232b2dd8cd4f Author: Mark Brown Date: Wed Sep 21 10:18:47 2022 +0100 Add some models into acp6x quirk list Merge series from Mario Limonciello : Another model from ASUS and Lenovo have been identified that don't include anything in ACPI tables to indicate they require the ACP6x DMIC driver to be loaded. This series adds them both to the quirk list. commit 818f9e8353c8e60dd0876bdac445e8fad346e50a Author: Jason Wang Date: Thu Aug 11 21:57:30 2022 +0800 ubi: ubi-media.h: Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 6c97bb345f163e45a8e4a14acc9391be0beaa6bb Author: Li zeming Date: Wed Aug 17 09:14:06 2022 +0800 ubi: block: Remove in vain semicolon Remove the repeated ';' from code, it is not needed. Signed-off-by: Li zeming Reviewed-by: Zhihao Cheng [rw: Massaged commit message a bit] Signed-off-by: Richard Weinberger commit 8b30fb40f8f2c5e56b7af553a398340f92d17aae Author: Icenowy Zheng Date: Fri Apr 15 18:04:32 2022 +0800 HID: nintendo: deregister home LED when it fails Some Pro Controller compatible controllers do not support home LED, and will fail when setting it. Currently this leads to probe failure. Change the code that fails probing to deregistering home LED. Signed-off-by: Icenowy Zheng Reviewed-by: Daniel J. Ogorchock Reviewed-by: Silvan Jegen [bentiss: changed "dflt" to "default"] Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220415100432.23453-1-icenowy@aosc.io commit 72f5c89804636b5b4c8599354a92d6df8cff42cc Author: Guillaume Nault Date: Thu Sep 8 19:29:23 2022 +0200 netfilter: rpfilter: Remove unused variable 'ret'. Commit 91a178258aea ("netfilter: rpfilter: Convert rpfilter_lookup_reverse to new dev helper") removed the need for the 'ret' variable. This went unnoticed because of the __maybe_unused annotation. Signed-off-by: Guillaume Nault Signed-off-by: Florian Westphal commit 7b5541a932c21f7e07f068a785afcc25986e4893 Author: Christophe JAILLET Date: Sun Sep 11 14:03:09 2022 +0200 headers: Remove some left-over license text in include/uapi/linux/netfilter/ When the SPDX-License-Identifier tag has been added, the corresponding license text has not been removed. Remove it now. Also, in xt_connmark.h, move the copyright text at the top of the file which is a much more common pattern. Signed-off-by: Christophe JAILLET Signed-off-by: Florian Westphal commit 2aa192757005f130b2dd3547dda6e462e761199f Author: Antoine Tenart Date: Fri Sep 16 11:29:41 2022 +0200 netfilter: conntrack: revisit the gc initial rescheduling bias The previous commit changed the way the rescheduling delay is computed which has a side effect: the bias is now represented as much as the other entries in the rescheduling delay which makes the logic to kick in only with very large sets, as the initial interval is very large (INT_MAX). Revisit the GC initial bias to allow more frequent GC for smaller sets while still avoiding wakeups when a machine is mostly idle. We're moving from a large initial value to pretending we have 100 entries expiring at the upper bound. This way only a few entries having a small timeout won't impact much the rescheduling delay and non-idle machines will have enough entries to lower the delay when needed. This also improves readability as the initial bias is now linked to what is computed instead of being an arbitrary large value. Fixes: 2cfadb761d3d ("netfilter: conntrack: revisit gc autotuning") Suggested-by: Florian Westphal Signed-off-by: Antoine Tenart Signed-off-by: Florian Westphal commit 95eabdd207024312876d0ebed90b4c977e050e85 Author: Antoine Tenart Date: Fri Sep 16 11:29:40 2022 +0200 netfilter: conntrack: fix the gc rescheduling delay Commit 2cfadb761d3d ("netfilter: conntrack: revisit gc autotuning") changed the eviction rescheduling to the use average expiry of scanned entries (within 1-60s) by doing: for (...) { expires = clamp(nf_ct_expires(tmp), ...); next_run += expires; next_run /= 2; } The issue is the above will make the average ('next_run' here) more dependent on the last expiration values than the firsts (for sets > 2). Depending on the expiration values used to compute the average, the result can be quite different than what's expected. To fix this we can do the following: for (...) { expires = clamp(nf_ct_expires(tmp), ...); next_run += (expires - next_run) / ++count; } Fixes: 2cfadb761d3d ("netfilter: conntrack: revisit gc autotuning") Cc: Florian Westphal Signed-off-by: Antoine Tenart Signed-off-by: Florian Westphal commit ba47a6ac4658f8fdccb2e3400927db5081eb7fb2 Author: Liang Yang Date: Wed Sep 7 16:04:05 2022 +0800 mtd: rawnand: meson: stop supporting legacy clocks meson NFC driver only uses common clock interfaces, which triggers kernel test robot errors when using legacy clocks with HAVE_LEGACY_CLK on. Reported-by: kernel test robot Reviewed-by: Neil Armstrong Signed-off-by: Liang Yang [miquel.raynal@bootlin.com: Rephrase the commit log] Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220907080405.28240-6-liang.yang@amlogic.com commit fbc00b5e746f138aa647fa8ddca5ed032195d089 Author: Liang Yang Date: Wed Sep 7 16:04:04 2022 +0800 dt-bindings: nand: meson: convert txt to yaml convert the amlogic,meson-name.txt to amlogic,meson-nand.yaml Signed-off-by: Liang Yang Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220907080405.28240-5-liang.yang@amlogic.com commit 5d53c615ab6bd3a5c67b007995bcc772c46af291 Author: Liang Yang Date: Wed Sep 7 16:04:03 2022 +0800 mtd: rawnand: meson: refine resource getting in probe simply use devm_platform_ioremap_resource_byname() instead of two steps: res = platform_get_resource(pdev, IORESOURCE_MEM, 0) and reg_base = devm_ioremap_resource(dev, res) Reviewed-by: Kevin Hilman Reviewed-by: Neil Armstrong Signed-off-by: Liang Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220907080405.28240-4-liang.yang@amlogic.com commit 1e4d3ba6688818ae932a8108ccb4319965e8041c Author: Liang Yang Date: Wed Sep 7 16:04:02 2022 +0800 mtd: rawnand: meson: fix the clock EMMC and NAND have the same clock control register named 'SD_EMMC_CLOCK' which is defined in EMMC port internally. bit0~5 of 'SD_EMMC_CLOCK' is the divider and bit6~7 is the mux for fix pll and xtal. At the beginning, a common MMC and NAND sub-clock was discussed and planed to be implemented as NFC clock provider, but now this series of patches of a common MMC and NAND sub-clock are never being accepted. the reasons for giving up are: 1. EMMC and NAND, which are mutually exclusive anyway 2. coupling the EMMC and NAND. 3. it seems that a common MMC and NAND sub-clock is over engineered. and let us see the link fot more information: https://lore.kernel.org/all/20220121074508.42168-5-liang.yang@amlogic.com so The meson nfc can't work now, let us rework the clock. Reviewed-by: Kevin Hilman Signed-off-by: Liang Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220907080405.28240-3-liang.yang@amlogic.com commit c2807b38ab96b6eb6a9e6467a088b9785f4df9aa Author: Liang Yang Date: Wed Sep 7 16:04:01 2022 +0800 dt-bindings: nand: meson: fix meson nfc clock EMMC and NAND have the same clock control register named 'SD_EMMC_CLOCK' which is defined in EMMC port internally. bit0~5 of 'SD_EMMC_CLOCK' is the divider and bit6~7 is the mux for fix pll and xtal. At the beginning, a common MMC and NAND sub-clock was discussed and planed to be implemented as NFC clock provider, but now this series of patches of a common MMC and NAND sub-clock are never being accepted and the current binding was never valid. the reasons for giving up are: 1. EMMC and NAND, which are mutually exclusive anyway 2. coupling the EMMC and NAND. 3. it seems that a common MMC and NAND sub-clock is over engineered. and let us see the link fot more information: https://lore.kernel.org/all/20220121074508.42168-5-liang.yang@amlogic.com so The meson nfc can't work now, let us rework the clock. Acked-by: Rob Herring Signed-off-by: Liang Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220907080405.28240-2-liang.yang@amlogic.com commit 36ac78cea96bab6f93ddd6fdc56b734e0c5db8cc Author: Jiangshan Yi Date: Mon Sep 5 14:32:32 2022 +0800 mtd: rawnand: bcm47xx: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220905063232.1830197-1-13667453960@163.com commit a2d0e5c67b4390614e5f82cf813d0caf9ae5dcc1 Author: Dmitry Torokhov Date: Sun Sep 4 23:30:55 2022 -0700 mtd: rawnand: stm32_fmc2: switch to using devm_fwnode_gpiod_get() I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220903-gpiod_get_from_of_node-remove-v1-3-b29adfb27a6c@gmail.com commit 4c5f69aea151dbd1977ad2cdd00ed0828e3a4888 Author: ye xingchen Date: Thu Sep 1 07:45:54 2022 +0000 mtd: rawnand: cadence: Remove an unneeded result variable Return the value cadence_nand_set_access_width16() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220901074555.313266-1-ye.xingchen@zte.com.cn commit c26ef845c04e45cebac8c21d8ce23270fa20ee3c Author: Andy Shevchenko Date: Tue Aug 30 21:33:36 2022 +0300 mtd: rawnand: Replace of_gpio_named_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Signed-off-by: Andy Shevchenko Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220830183336.49966-1-andriy.shevchenko@linux.intel.com commit 40c9ba0dec90d72590f65d4a024b4de5cdd66294 Author: Jack Wang Date: Fri Aug 19 08:07:47 2022 +0200 mtd: rawnand: marvell: Fix error handle regarding dma_map_sg dma_map_sg return 0 on error, in case of error return -EIO, also add the dma_unmap_sg as rollback on the following error. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Philipp Zabel Cc: Christophe Kerello Cc: Cai Huoqing Cc: linux-mtd@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220819060801.10443-6-jinpu.wang@ionos.com commit 43b81c2a3e6e07915151045aa13a6e8a9bd64419 Author: Jack Wang Date: Fri Aug 19 08:07:46 2022 +0200 mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check dma_map_sg return 0 on error, in case of error return -EIO. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Philipp Zabel Cc: Christophe Kerello Cc: Cai Huoqing Cc: linux-mtd@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Reviewed-by: Christophe Kerello Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220819060801.10443-5-jinpu.wang@ionos.com commit ddfa68d415c749390e6a89f760b5edfa2774ad7b Author: ChenXiaoSong Date: Fri Aug 19 10:18:46 2022 +0800 mtd: rawnand: remove misguided comment of nand_get_device() After commit 8cba323437a4 ("mtd: rawnand: protect access to rawnand devices while in suspend"), it will wait while in suspend rather than returning errors. So remove the misguided comment about return value. Signed-off-by: ChenXiaoSong Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220819021846.2924539-1-chenxiaosong2@huawei.com commit 2525a0abed6cd2d6add7714eb17347e65d278997 Author: Christophe JAILLET Date: Sun Aug 7 23:20:51 2022 +0200 mtd: rawnand: orion: Use devm_clk_get_optional() Use devm_clk_get_optional() instead of hand writing it. While at it, use dev_err_probe() to further simplify the code. This is also less verbose if clk_get() returns -EPROBE_DEFER. Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/a5bde48e3e1165dd65d1d1c1739e03ace1bef5d3.1659907229.git.christophe.jaillet@wanadoo.fr commit 79db205db52f173832e5f7d55055ae7144eb0086 Author: Colin Ian King Date: Fri Aug 5 19:01:17 2022 +0100 mtd: rawnand: cafe: Use correct function name in comment block The incorrect function name is being used in the comment for function cafe_nand_read_page. Correct it. Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220805180117.2375503-1-colin.i.king@gmail.com commit 1161703c9bd664da5e3b2eb1a3bb40c210e026ea Author: Tudor Ambarus Date: Thu Jul 28 10:40:14 2022 +0300 mtd: rawnand: atmel: Unmap streaming DMA mappings Every dma_map_single() call should have its dma_unmap_single() counterpart, because the DMA address space is a shared resource and one could render the machine unusable by consuming all DMA addresses. Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Cc: stable@vger.kernel.org Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: Tudor Ambarus Acked-by: Alexander Dahl Reported-by: Peter Rosin Tested-by: Alexander Dahl Reviewed-by: Boris Brezillon Tested-by: Peter Rosin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220728074014.145406-1-tudor.ambarus@microchip.com commit 3e4ad3212cf22687410b1e8f4e68feec50646113 Author: Dan Carpenter Date: Thu Jul 28 10:12:12 2022 +0300 mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct() The meson_nfc_ecc_correct() function accidentally does a right shift instead of a left shift so it only works for BIT(0). Also use BIT_ULL() because "correct_bitmap" is a u64 and we want to avoid shift wrapping bugs. Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Signed-off-by: Dan Carpenter Acked-by: Liang Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/YuI2zF1hP65+LE7r@kili commit 37ea9f165ed4a437d6b3302e76e2e2ab0804b86c Author: GONG, Ruiqi Date: Mon Jul 25 19:21:07 2022 +0800 mtd: rawnand: arasan: stop using 0 as NULL pointer Fix the following sparse warnings: drivers/mtd/nand/raw/arasan-nand-controller.c:918:70: warning: Using plain integer as NULL pointer drivers/mtd/nand/raw/arasan-nand-controller.c:918:73: warning: Using plain integer as NULL pointer Signed-off-by: GONG, Ruiqi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220725112108.686347-1-gongruiqi1@huawei.com commit d16da6d112367faeafa2b0d427d0ced7f1e92f36 Author: Slark Xiao Date: Fri Jul 22 15:28:50 2022 +0800 mtd: rawnand: gpmi: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220722072850.72797-1-slark_xiao@163.com commit c4c85b512d16e488e966a09ea41e3260204f857b Author: Florian Fainelli Date: Mon Jul 11 15:23:23 2022 -0700 mtd: rawnand: brcmnand: Add individual glue driver selection Allow each platform to define a dedicated Kconfig entry for its glue driver such that we can decide on a per-platfomr basis whether to build it or not. This allows for a finer grained control over the resulting kernel image or set of modules. Signed-off-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220711222323.4048197-3-f.fainelli@gmail.com commit 1dd4fd8716babe80d6c0da8d9e3d9ecba6706afc Author: Florian Fainelli Date: Mon Jul 11 15:23:22 2022 -0700 mtd: rawnand: brcmnand: Move Kconfig to driver folder In preparation for allowing each of the brcmnand stub to be built separately, move the Kconfig entry to the driver folder. Signed-off-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220711222323.4048197-2-f.fainelli@gmail.com commit 095bb6e44eb17da2cf95dbde9c83b44664a493f5 Author: Michał Kępień Date: Wed Jun 29 14:57:37 2022 +0200 mtdchar: add MEMREAD ioctl User-space applications making use of MTD devices via /dev/mtd* character devices currently have limited capabilities for reading data: - only deprecated methods of accessing OOB layout information exist, - there is no way to explicitly specify MTD operation mode to use; it is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set for the character device; in particular, this prevents using MTD_OPS_AUTO_OOB for reads, - all existing user-space interfaces which cause mtd_read() or mtd_read_oob() to be called (via mtdchar_read() and mtdchar_read_oob(), respectively) return success even when those functions return -EUCLEAN or -EBADMSG; this renders user-space applications using these interfaces unaware of any corrected bitflips or uncorrectable ECC errors detected during reads. Note that the existing MEMWRITE ioctl allows the MTD operation mode to be explicitly set, allowing user-space applications to write page data and OOB data without requiring them to know anything about the OOB layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also, the MEMWRITE ioctl does not mangle the return value of mtd_write_oob(). Add a new ioctl, MEMREAD, which addresses the above issues. It is intended to be a read-side counterpart of the existing MEMWRITE ioctl. Similarly to the latter, the read operation is performed in a loop which processes at most mtd->erasesize bytes in each iteration. This is done to prevent unbounded memory allocations caused by calling kmalloc() with the 'size' argument taken directly from the struct mtd_read_req provided by user space. However, the new ioctl is implemented so that the values it returns match those that would have been returned if just a single mtd_read_oob() call was issued to handle the entire read operation in one go. Note that while just returning -EUCLEAN or -EBADMSG to user space would already be a valid and useful indication of the ECC algorithm detecting errors during a read operation, that signal would not be granular enough to cover all use cases. For example, knowing the maximum number of bitflips detected in a single ECC step during a read operation performed on a given page may be useful when dealing with an MTD partition whose ECC layout varies across pages (e.g. a partition consisting of a bootloader area using a "custom" ECC layout followed by data pages using a "standard" ECC layout). To address that, include ECC statistics in the structure returned to user space by the new MEMREAD ioctl. Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html Suggested-by: Boris Brezillon Signed-off-by: Michał Kępień Acked-by: Richard Weinberger Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl commit 7bea6056927727f98f4efdd338f112f7517f05b5 Author: Michał Kępień Date: Wed Jun 29 14:57:36 2022 +0200 mtd: add ECC error accounting for each read request Extend struct mtd_req_stats with two new fields holding the number of corrected bitflips and uncorrectable errors detected during a read operation. This is a prerequisite for ultimately passing those counters to user space, where they can be useful to applications for making better-informed choices about moving data around. Unlike 'max_bitflips' (which is set - in a common code path - to the return value of a function called while the MTD device's mutex is held), these counters have to be maintained in each MTD driver which defines the '_read_oob' callback because the statistics need to be calculated while the MTD device's mutex is held. Suggested-by: Boris Brezillon Signed-off-by: Michał Kępień Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl commit 745df17906029cc683b8b5ac8bcb08f82860baff Author: Michał Kępień Date: Wed Jun 29 14:57:35 2022 +0200 mtd: always initialize 'stats' in struct mtd_oob_ops As the 'stats' field in struct mtd_oob_ops is used in conditional expressions, ensure it is always zero-initialized in all such structures to prevent random stack garbage from being interpreted as a pointer. Strictly speaking, this problem currently only needs to be fixed for struct mtd_oob_ops structures subsequently passed to mtd_read_oob(). However, this commit goes a step further and makes all instances of struct mtd_oob_ops in the tree zero-initialized, in hope of preventing future problems, e.g. if struct mtd_req_stats gets extended with write statistics at some point. Signed-off-by: Michał Kępień Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-3-kernel@kempniu.pl commit 65394169bdae073bfb2c6816f5bf095bd7d53e61 Author: Michał Kępień Date: Wed Jun 29 14:57:34 2022 +0200 mtd: track maximum number of bitflips for each read request mtd_read_oob() callers are currently oblivious to the details of ECC errors detected during the read operation - they only learn (through the return value) whether any corrected bitflips or uncorrectable errors occurred. More detailed ECC information can be useful to user-space applications for making better-informed choices about moving data around. Extend struct mtd_oob_ops with a pointer to a newly-introduced struct mtd_req_stats and set its 'max_bitflips' field to the maximum number of bitflips found in a single ECC step during the read operation performed by mtd_read_oob(). This is a prerequisite for ultimately passing that value back to user space. Suggested-by: Boris Brezillon Signed-off-by: Michał Kępień Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-2-kernel@kempniu.pl commit db74cd6337d2691ea932e36b84683090f0712ec1 Author: Nathan Chancellor Date: Mon Sep 19 09:09:28 2022 -0700 arm64/sysreg: Fix a few missed conversions After the conversion to automatically generating the ID_AA64DFR0_EL1 definition names, the build fails in a few different places because some of the definitions were not changed to their new names along the way. Update the names to resolve the build errors. Fixes: c0357a73fa4a ("arm64/sysreg: Align field names in ID_AA64DFR0_EL1 with architecture") Signed-off-by: Nathan Chancellor Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220919160928.3905780-1-nathan@kernel.org Signed-off-by: Catalin Marinas commit 27ef523a6653b35270296114dc50a9f630d896a9 Author: Yang Li Date: Thu Jan 13 09:36:22 2022 +0800 ubifs: Fix ubifs_check_dir_empty() kernel-doc comment Fix function name in fs/ubifs/dir.c kernel-doc comment to remove warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ubifs/dir.c:883: warning: expecting prototype for check_dir_empty(). Prototype was for ubifs_check_dir_empty() instead Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Richard Weinberger commit a3d3163fbe690cfec354fc20808adf0629adf8da Author: Dave Hansen Date: Tue Sep 20 11:54:54 2022 -0700 x86/mm/32: Fix W^X detection when page tables do not support NX The x86 MM code now actively refuses to create writable+executable mappings, and warns when there is an attempt to create one. The 0day test robot ran across a warning triggered by module unloading on 32-bit kernels. This was only seen on CPUs with NX support, but where a 32-bit kernel was built without PAE support. On those systems, there is no room for the NX bit in the page tables and _PAGE_NX is #defined to 0, breaking some of the W^X detection logic in verify_rwx(). The X86_FEATURE_NX check in there does not do any good here because the CPU itself supports NX. Fix it by checking for _PAGE_NX support directly instead of checking CPU support for NX. Note that since _PAGE_NX is actually defined to be 0 at compile-time this fix should also end up letting the compiler optimize away most of verify_rwx() on non-PAE kernels. Fixes: 652c5bf380ad ("x86/mm: Refuse W^X violations") Reported-by: kernel test robot Signed-off-by: Dave Hansen Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/fcf89147-440b-e478-40c9-228c9fe56691@intel.com/ commit 76e64c73db9542ff4bae8a60f4f32e38f3799b95 Author: Tetsuo Handa Date: Mon Sep 19 09:52:13 2022 +0900 locking/lockdep: Print more debug information - report name and key when look_up_lock_class() got confused Printing this information will be helpful: ------------[ cut here ]------------ Looking for class "l2tp_sock" with key l2tp_socket_class, but found a different class "slock-AF_INET6" with the same key WARNING: CPU: 1 PID: 14195 at kernel/locking/lockdep.c:940 look_up_lock_class+0xcc/0x140 Modules linked in: CPU: 1 PID: 14195 Comm: a.out Not tainted 6.0.0-rc6-dirty #863 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 RIP: 0010:look_up_lock_class+0xcc/0x140 Signed-off-by: Tetsuo Handa Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/bd99391e-f787-efe9-5ec6-3c6dc4c587b0@I-love.SAKURA.ne.jp commit 74656d03ac36fabb16b9df5221cf398ee3a9ca08 Merge: 0d97db026509c 521a547ced647 Author: Ingo Molnar Date: Wed Sep 21 09:58:02 2022 +0200 Merge tag 'v6.0-rc6' into locking/core, to refresh the branch Signed-off-by: Ingo Molnar commit 849b1f33437e223c0933b4aa803356542386a989 Merge: 47cd3af67de0b dacd2d2d9d800 Author: Dave Airlie Date: Wed Sep 21 17:49:38 2022 +1000 Merge tag 'amd-drm-next-6.1-2022-09-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.1-2022-09-16: amdgpu: - PCI AER fixes - BACO fix - RAS fixes - XGMI fixes - Display SubVP fixes - DCN 3.2 updates - DCN 3.1.4 updates - LLVM fixes - CS cleanup in preparation for gang submit - Add some new GC CG registers - Misc cleanups amdkfd: - Fix CRIU regression - CPU fault on COW mapping fixes - Prefault fixes - Misc cleanups radeon: - Misc cleanups Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220916153638.6501-1-alexander.deucher@amd.com commit 9bdb9350f3808bbff229167acb55cf0a3bd8f2ca Author: Cheng Xu Date: Fri Sep 9 17:38:22 2022 +0800 RDMA/erdma: Support dynamic mtu Hardware now support jumbo frame for RDMA. So we introduce a new CMDQ message to support mtu change notification. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20220909093822.33868-5-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 676886010707fc656e2b407b2849883fbb63717e Author: Sumit Gupta Date: Tue Sep 20 16:36:46 2022 +0530 cpufreq: tegra194: Add support for Tegra239 Adding support for Tegra239 SoC which has eight cores in a single cluster. Also, moving num_clusters to SoC data to avoid over allocating memory for four clusters always. Signed-off-by: Sumit Gupta Acked-by: Thierry Reding Signed-off-by: Viresh Kumar commit 91dc90fdb8b8199519a3aac9c46a433b02223c5b Author: Viresh Kumar Date: Wed Sep 21 12:30:38 2022 +0530 cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning Commit 6240aaad75e1 was supposed to drop the reference count to the OPP, instead it avoided more stuff if the OPP isn't found. This isn't entirely correct. We already have a frequency value available, we just couldn't align it with an OPP in case of IS_ERR(opp). Lets continue with updating thermal pressure, etc, even if we aren't able to find an OPP here. This fixes warning generated by the 'smatch' tool. Fixes: 6240aaad75e1 ("cpufreq: qcom-hw: fix the opp entries refcounting") Cc: v5.18+ # v5.18+ Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Neil Armstrong Signed-off-by: Viresh Kumar commit e3b1fff6c051a746679da38f970324d1617590fa Author: Niklas Cassel Date: Fri Sep 16 14:28:37 2022 +0200 ata: libata: drop superfluous ata_eh_analyze_tf() parameter The parameter can easily be derived from struct ata_queued_cmd. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit b46c760e11c8ce59166d2f9038d237dee409f37d Author: Niklas Cassel Date: Fri Sep 16 14:28:36 2022 +0200 ata: libata: drop superfluous ata_eh_request_sense() parameter The parameter can easily be derived from struct ata_queued_cmd. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 630624cb1b5826d753ac8e01a0e42de43d66dedf Author: Niklas Cassel Date: Fri Sep 16 14:28:35 2022 +0200 ata: fix ata_id_has_dipm() ACS-5 section 7.13.6.36 Word 78: Serial ATA features supported states that: If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero. (This text also exists in really old ACS standards, e.g. ACS-3.) The problem with ata_id_has_dipm() is that the while it performs a check against 0 and 0xffff, it performs the check against ATA_ID_FEATURE_SUPP (word 78), the same word where the feature bit is stored. Fix this by performing the check against ATA_ID_SATA_CAPABILITY (word 76), like required by the spec. The feature bit check itself is of course still performed against ATA_ID_FEATURE_SUPP (word 78). Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check. Fixes: ca77329fb713 ("[libata] Link power management infrastructure") Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit a5fb6bf853148974dbde092ec1bde553bea5e49f Author: Niklas Cassel Date: Fri Sep 16 14:28:34 2022 +0200 ata: fix ata_id_has_ncq_autosense() ACS-5 section 7.13.6.36 Word 78: Serial ATA features supported states that: If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero. (This text also exists in really old ACS standards, e.g. ACS-3.) Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check. Fixes: 5b01e4b9efa0 ("libata: Implement NCQ autosense") Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 9c6e09a434e1317e09b78b3b69cd384022ec9a03 Author: Niklas Cassel Date: Fri Sep 16 14:28:33 2022 +0200 ata: fix ata_id_has_devslp() ACS-5 section 7.13.6.36 Word 78: Serial ATA features supported states that: If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero. (This text also exists in really old ACS standards, e.g. ACS-3.) Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check. Fixes: 65fe1f0f66a5 ("ahci: implement aggressive SATA device sleep support") Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 690aa8c3ae308bc696ec8b1b357b995193927083 Author: Niklas Cassel Date: Fri Sep 16 14:28:32 2022 +0200 ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() ACS-5 section 7.13.6.41 Words 85..87, 120: Commands and feature sets supported or enabled states that: If bit 15 of word 86 is set to one, bit 14 of word 119 is set to one, and bit 15 of word 119 is cleared to zero, then word 119 is valid. If bit 15 of word 86 is set to one, bit 14 of word 120 is set to one, and bit 15 of word 120 is cleared to zero, then word 120 is valid. (This text also exists in really old ACS standards, e.g. ACS-3.) Currently, ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() both check bit 15 of word 86, but neither of them check that bit 14 of word 119 is set to one, or that bit 15 of word 119 is cleared to zero. Additionally, make ata_id_sense_reporting_enabled() return false if !ata_id_has_sense_reporting(), similar to how e.g. ata_id_flush_ext_enabled() returns false if !ata_id_has_flush_ext(). Fixes: e87fd28cf9a2 ("libata: Implement support for sense data reporting") Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit cb6e73aaadff73751bb1c01349e58f2c6428e0a8 Author: ye xingchen Date: Tue Sep 20 06:29:29 2022 +0000 ata: libata-eh: Remove the unneeded result variable Return the value ata_port_abort() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Damien Le Moal commit 7620bffbf72cd66a5d18e444a143b5b5989efa87 Author: Xin Liu Date: Sat Sep 17 16:48:09 2022 +0800 libbpf: Fix NULL pointer exception in API btf_dump__dump_type_data We found that function btf_dump__dump_type_data can be called by the user as an API, but in this function, the `opts` parameter may be used as a null pointer.This causes `opts->indent_str` to trigger a NULL pointer exception. Fixes: 2ce8450ef5a3 ("libbpf: add bpf_object__open_{file, mem} w/ extensible opts") Signed-off-by: Xin Liu Signed-off-by: Weibin Kong Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220917084809.30770-1-liuxin350@huawei.com commit bc069da65eec7b5113b40432930152c9c1cd7f88 Author: Rong Tao Date: Sun Sep 11 21:03:30 2022 +0800 samples/bpf: Replace blk_account_io_done() with __blk_account_io_done() Since commit be6bfe36db17 ("block: inline hot paths of blk_account_io_*()") blk_account_io_*() become inline functions. Signed-off-by: Rong Tao Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/tencent_1CC476835C219FACD84B6715F0D785517E07@qq.com commit c29b068215906d33f75378d44526edc37ad08276 Author: Ruffalo Lavoisier Date: Mon Sep 19 14:34:46 2022 +0900 liquidio: CN23XX: delete repeated words, add missing words and fix typo in comment - Delete the repeated word 'to' in the comment. - Add the missing 'use' word within the sentence. - Correct spelling on 'malformation', 'needs'. Signed-off-by: Ruffalo Lavoisier Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20220919053447.5702-1-RuffaloLavoisier@gmail.com Signed-off-by: Jakub Kicinski commit 54b9a2bb6c013a34cfdb5a6241367b003773662f Author: Ren Zhijie Date: Mon Sep 19 10:58:40 2022 +0800 octeontx2-pf: Fix unused variable build error If CONFIG_DCB is not set, make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c: In function ‘otx2_select_queue’: drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:1886:19: error: unused variable ‘pf’ [-Werror=unused-variable] struct otx2_nic *pf = netdev_priv(netdev); ^~ cc1: all warnings being treated as errors To fix this build error, put the definition of *pf under the CONFIG_DCB. Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support") Signed-off-by: Ren Zhijie Link: https://lore.kernel.org/r/20220919025840.256411-1-renzhijie2@huawei.com Signed-off-by: Jakub Kicinski commit 8066cc86b7aaaf6b4b38a81932459c6450440daa Author: Mika Westerberg Date: Mon Sep 5 11:02:27 2022 +0300 PCI: Fix used_buses calculation in pci_scan_child_bus_extend() pci_scan_bridge_extend() returns the subordinate bus number needed to cover all the buses below a bridge. pci_scan_child_bus_extend() computes the number of buses to reserve by comparing that with the current max bus number. Previously it did the subtraction in the wrong order, so 'used_buses' was nonsense. Subtract 'max' from 'cmax' as is done for the similar pci_scan_bridge_extend() call in the following block. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000 Fixes: 3374c545c27c ("PCI: Account for all bridges on bus when distributing bus numbers") Link: https://lore.kernel.org/r/20220905080232.36087-2-mika.westerberg@linux.intel.com Reported-by: Chris Chiu Tested-by: Chris Chiu Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit 1229b33973c7b89e989945a3edae7a17b6f909da Author: Karol Kolacinski Date: Fri Sep 16 13:17:28 2022 -0700 ice: Add low latency Tx timestamp read E810 products can support low latency Tx timestamp register read. This requires usage of threaded IRQ instead of kthread to reduce the kthread start latency (spikes up to 20 ms). Add a check for the device capability and use the new method if supported. Signed-off-by: Karol Kolacinski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220916201728.241510-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 6f9c07be9d020489326098801f0661f754c7c865 Author: Yury Norov Date: Mon Sep 5 16:08:20 2022 -0700 lib/cpumask: add FORCE_NR_CPUS config option The size of cpumasks is hard-limited by compile-time parameter NR_CPUS, but defined at boot-time when kernel parses ACPI/DT tables, and stored in nr_cpu_ids. In many practical cases, number of CPUs for a target is known at compile time, and can be provided with NR_CPUS. In that case, compiler may be instructed to rely on NR_CPUS as on actual number of CPUs, not an upper limit. It allows to optimize many cpumask routines and significantly shrink size of the kernel image. This patch adds FORCE_NR_CPUS option to teach the compiler to rely on NR_CPUS and enable corresponding optimizations. If FORCE_NR_CPUS=y, kernel will not set nr_cpu_ids at boot, but only check that the actual number of possible CPUs is equal to NR_CPUS, and WARN if that doesn't hold. The new option is especially useful in embedded applications because kernel configurations are unique for each SoC, the number of CPUs is constant and known well, and memory limitations are typically harder. For my 4-CPU ARM64 build with NR_CPUS=4, FORCE_NR_CPUS=y saves 46KB: add/remove: 3/4 grow/shrink: 46/729 up/down: 652/-46952 (-46300) Signed-off-by: Yury Norov commit 546a073d628111e3338af689938407e77d5dc38f Author: Yury Norov Date: Tue Sep 20 06:13:12 2022 -0700 powerpc/64: don't refer nr_cpu_ids in asm code when it's undefined generic_secondary_common_init() calls LOAD_REG_ADDR(r7, nr_cpu_ids) conditionally on CONFIG_SMP. However, if 'NR_CPUS == 1', kernel doesn't use the nr_cpu_ids, and in C code, it's just: #if NR_CPUS == 1 #define nr_cpu_ids ... This series makes declaration of nr_cpu_ids conditional on NR_CPUS == 1, and that reveals the issue, because compiler can't link the LOAD_REG_ADDR(r7, nr_cpu_ids) against nonexisting symbol. Current code looks unsafe for those who build kernel with CONFIG_SMP=y and NR_CPUS == 1. This is weird configuration, but not disallowed. Fix the linker error by replacing LOAD_REG_ADDR() with LOAD_REG_IMMEDIATE() conditionally on NR_CPUS == 1. As the following patch adds CONFIG_FORCE_NR_CPUS option that has the similar effect on nr_cpu_ids, make the generic_secondary_common_init() conditional on it too. Reported-by: Stephen Rothwell Signed-off-by: Yury Norov commit 0572b18da90033988aad44ac6edea4234df97e88 Merge: adae216f4ebc0 479aa3b0ec2e0 Author: Jakub Kicinski Date: Tue Sep 20 16:07:14 2022 -0700 Merge branch 'add-a-secondary-at-port-to-the-telit-fn990' Fabio Porcedda says: ==================== Add a secondary AT port to the Telit FN990 In order to add a secondary AT port to the Telit FN990 first add "DUN2" to mhi_wwan_ctrl.c, after that add a seconday AT port to the Telit FN990 in pci_generic.c ==================== Link: https://lore.kernel.org/r/20220916144329.243368-1-fabio.porcedda@gmail.com Signed-off-by: Jakub Kicinski commit 479aa3b0ec2e000ac99dd0661936d9685d6cac64 Author: Fabio Porcedda Date: Fri Sep 16 16:43:29 2022 +0200 bus: mhi: host: pci_generic: Add a secondary AT port to Telit FN990 Add a secondary AT port using one of OEM reserved channel. Signed-off-by: Fabio Porcedda Reviewed-by: Loic Poulain Signed-off-by: Jakub Kicinski commit 0c60d1657d3dcbb3e0301cc19ea7e1581e05baa5 Author: Fabio Porcedda Date: Fri Sep 16 16:43:28 2022 +0200 net: wwan: mhi_wwan_ctrl: Add DUN2 to have a secondary AT port In order to have a secondary AT port add "DUN2". Signed-off-by: Fabio Porcedda Reviewed-by: Loic Poulain Signed-off-by: Jakub Kicinski commit adae216f4ebc037e20b4868deaa62fb6a5c2299f Merge: e93a766da57ff 972e886112402 Author: Jakub Kicinski Date: Tue Sep 20 15:54:46 2022 -0700 Merge branch 'refactor-duplicate-codes-in-the-tc-cls-walk-function' Zhengchao Shao says: ==================== refactor duplicate codes in the tc cls walk function The walk implementation of most tc cls modules is basically the same. That is, the values of count and skip are checked first. If count is greater than or equal to skip, the registered fn function is executed. Otherwise, increase the value of count. So the code can be refactored. Then use helper function to replace the code of each cls module in alphabetical order. The walk function is invoked during dump. Therefore, test cases related to the tdc filter need to be added. ==================== Link: https://lore.kernel.org/r/20220916020251.190097-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 972e886112402b73f062f82d885928387dee4cff Author: Zhengchao Shao Date: Fri Sep 16 10:02:51 2022 +0800 selftests/tc-testings: add list case for basic filter Test 0811: Add multiple basic filter with cmp ematch u8/link layer and default action and dump them Test 5129: List basic filters Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit fa8dfba59e78a7ba2f523a1b7e5beb5451a84d44 Author: Zhengchao Shao Date: Fri Sep 16 10:02:50 2022 +0800 selftests/tc-testings: add selftests for tcindex filter Test 8293: Add tcindex filter with default action Test 7281: Add tcindex filter with hash size and pass action Test b294: Add tcindex filter with mask shift and reclassify action Test 0532: Add tcindex filter with pass_on and continue actions Test d473: Add tcindex filter with pipe action Test 2940: Add tcindex filter with miltiple actions Test 1893: List tcindex filters Test 2041: Change tcindex filter with pass action Test 9203: Replace tcindex filter with pass action Test 7957: Delete tcindex filter with drop action Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 23020350eb6abf2df9c5c6363d64f61058567a5a Author: Zhengchao Shao Date: Fri Sep 16 10:02:49 2022 +0800 selftests/tc-testings: add selftests for rsvp filter Test 2141: Add rsvp filter with tcp proto and specific IP address Test 5267: Add rsvp filter with udp proto and specific IP address Test 2819: Add rsvp filter with src ip and src port Test c967: Add rsvp filter with tunnelid and continue action Test 5463: Add rsvp filter with tunnel and pipe action Test 2332: Add rsvp filter with miltiple actions Test 8879: Add rsvp filter with tunnel and skp flag Test 8261: List rsvp filters Test 8989: Delete rsvp filter Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 67107e7fcfbeda945ba2b828cf6462361ee7771d Author: Zhengchao Shao Date: Fri Sep 16 10:02:48 2022 +0800 selftests/tc-testings: add selftests for route filter Test e122: Add route filter with from and to tag Test 6573: Add route filter with fromif and to tag Test 1362: Add route filter with to flag and reclassify action Test 4720: Add route filter with from flag and continue actions Test 2812: Add route filter with form tag and pipe action Test 7994: Add route filter with miltiple actions Test 4312: List route filters Test 2634: Delete route filter with pipe action Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 58f82b3a0b05c9cfced8ee65729fb0c6386403c7 Author: Zhengchao Shao Date: Fri Sep 16 10:02:47 2022 +0800 selftests/tc-testings: add selftests for flow filter Test 5294: Add flow filter with map key and ops Test 3514: Add flow filter with map key or ops Test 7534: Add flow filter with map key xor ops Test 4524: Add flow filter with map key rshift ops Test 0230: Add flow filter with map key addend ops Test 2344: Add flow filter with src map key Test 9304: Add flow filter with proto map key Test 9038: Add flow filter with proto-src map key Test 2a03: Add flow filter with proto-dst map key Test a073: Add flow filter with iif map key Test 3b20: Add flow filter with priority map key Test 8945: Add flow filter with mark map key Test c034: Add flow filter with nfct map key Test 0205: Add flow filter with nfct-src map key Test 5315: Add flow filter with nfct-src map key Test 7849: Add flow filter with nfct-proto-src map key Test 9902: Add flow filter with nfct-proto-dst map key Test 6742: Add flow filter with rt-classid map key Test 5432: Add flow filter with sk-uid map key Test 4134: Add flow filter with sk-gid map key Test 4522: Add flow filter with vlan-tag map key Test 4253: Add flow filter with rxhash map key Test 4452: Add flow filter with hash key list Test 4341: Add flow filter with muliple ops Test 4392: List flow filters Test 4322: Change flow filter with map key num Test 2320: Replace flow filter with map key num Test 3213: Delete flow filter with map key num Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 33c4119276152096fae44868ff5f4c71965a6905 Author: Zhengchao Shao Date: Fri Sep 16 10:02:46 2022 +0800 selftests/tc-testings: add selftests for cgroup filter Test 6273: Add cgroup filter with cmp ematch u8/link layer and drop action Test 4721: Add cgroup filter with cmp ematch u8/link layer with trans flag and pass action Test d392: Add cgroup filter with cmp ematch u16/link layer and pipe action Test 0234: Add cgroup filter with cmp ematch u32/link layer and miltiple actions Test 8499: Add cgroup filter with cmp ematch u8/network layer and pass action Test b273: Add cgroup filter with cmp ematch u8/network layer with trans flag and drop action Test 1934: Add cgroup filter with cmp ematch u16/network layer and pipe action Test 2733: Add cgroup filter with cmp ematch u32/network layer and miltiple actions Test 3271: Add cgroup filter with NOT cmp ematch rule and pass action Test 2362: Add cgroup filter with two ANDed cmp ematch rules and single action Test 9993: Add cgroup filter with two ORed cmp ematch rules and single action Test 2331: Add cgroup filter with two ANDed cmp ematch rules and one ORed ematch rule and single action Test 3645: Add cgroup filter with two ANDed cmp ematch rules and one NOT ORed ematch rule and single action Test b124: Add cgroup filter with u32 ematch u8/zero offset and drop action Test 7381: Add cgroup filter with u32 ematch u8/zero offset and invalid value >0xFF Test 2231: Add cgroup filter with u32 ematch u8/positive offset and drop action Test 1882: Add cgroup filter with u32 ematch u8/invalid mask >0xFF Test 1237: Add cgroup filter with u32 ematch u8/missing offset Test 3812: Add cgroup filter with u32 ematch u8/missing AT keyword Test 1112: Add cgroup filter with u32 ematch u8/missing value Test 3241: Add cgroup filter with u32 ematch u8/non-numeric value Test e231: Add cgroup filter with u32 ematch u8/non-numeric mask Test 4652: Add cgroup filter with u32 ematch u8/negative offset and pass Test 1331: Add cgroup filter with u32 ematch u16/zero offset and pipe action Test e354: Add cgroup filter with u32 ematch u16/zero offset and invalid value >0xFFFF Test 3538: Add cgroup filter with u32 ematch u16/positive offset and drop action Test 4576: Add cgroup filter with u32 ematch u16/invalid mask >0xFFFF Test b842: Add cgroup filter with u32 ematch u16/missing offset Test c924: Add cgroup filter with u32 ematch u16/missing AT keyword Test cc93: Add cgroup filter with u32 ematch u16/missing value Test 123c: Add cgroup filter with u32 ematch u16/non-numeric value Test 3675: Add cgroup filter with u32 ematch u16/non-numeric mask Test 1123: Add cgroup filter with u32 ematch u16/negative offset and drop action Test 4234: Add cgroup filter with u32 ematch u16/nexthdr+ offset and pass action Test e912: Add cgroup filter with u32 ematch u32/zero offset and pipe action Test 1435: Add cgroup filter with u32 ematch u32/positive offset and drop action Test 1282: Add cgroup filter with u32 ematch u32/missing offset Test 6456: Add cgroup filter with u32 ematch u32/missing AT keyword Test 4231: Add cgroup filter with u32 ematch u32/missing value Test 2131: Add cgroup filter with u32 ematch u32/non-numeric value Test f125: Add cgroup filter with u32 ematch u32/non-numeric mask Test 4316: Add cgroup filter with u32 ematch u32/negative offset and drop action Test 23ae: Add cgroup filter with u32 ematch u32/nexthdr+ offset and pipe action Test 23a1: Add cgroup filter with canid ematch and single SFF Test 324f: Add cgroup filter with canid ematch and single SFF with mask Test 2576: Add cgroup filter with canid ematch and multiple SFF Test 4839: Add cgroup filter with canid ematch and multiple SFF with masks Test 6713: Add cgroup filter with canid ematch and single EFF Test ab9d: Add cgroup filter with canid ematch and multiple EFF with masks Test 5349: Add cgroup filter with canid ematch and a combination of SFF/EFF Test c934: Add cgroup filter with canid ematch and a combination of SFF/EFF with masks Test 4319: Replace cgroup filter with diffferent match Test 4636: Delete cgroup filter Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 93f3f2eaa4c945dc733110ebf4e49b0c12a89e99 Author: Zhengchao Shao Date: Fri Sep 16 10:02:45 2022 +0800 selftests/tc-testings: add selftests for bpf filter Test 23c3: Add cBPF filter with valid bytecode Test 1563: Add cBPF filter with invalid bytecode Test 2334: Add eBPF filter with valid object-file Test 2373: Add eBPF filter with invalid object-file Test 4423: Replace cBPF bytecode Test 5122: Delete cBPF filter Test e0a9: List cBPF filters Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit 5508ff7cf3750f4a2ab1354754859bb949c0d692 Author: Zhengchao Shao Date: Fri Sep 16 10:02:44 2022 +0800 net/sched: use tc_cls_stats_dump() in filter use tc_cls_stats_dump() in filter. Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit fe0df81df51eb932a83e0c3844106ac6c0f914db Author: Zhengchao Shao Date: Fri Sep 16 10:02:43 2022 +0800 net/sched: cls_api: add helper for tc cls walker stats dump The walk implementation of most tc cls modules is basically the same. That is, the values of count and skip are checked first. If count is greater than or equal to skip, the registered fn function is executed. Otherwise, increase the value of count. So we can reconstruct them. Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski commit bb20da18ce936adda6b48aea79a8797c8eee479f Author: Yihao Han Date: Mon Sep 19 20:19:58 2022 -0700 Bluetooth: MGMT: fix zalloc-simple.cocci warnings Use zeroing allocator rather than allocator followed by memset with 0 Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci Signed-off-by: Yihao Han Signed-off-by: Luiz Augusto von Dentz commit 47cd3af67de0bef9d50e37197dc307ce83768142 Merge: 72ca70acc7658 21f0b7dabf9c3 Author: Dave Airlie Date: Wed Sep 21 07:46:54 2022 +1000 Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull #2 for v6.1: Features and functionality: - More Meteorlake platform enabling (Radhakrishna, Imre, Madhumitha) - Allow seamless M/N changes on eDP panels that support it (Ville) - Switch DSC debugfs from output bpp to input bpc (Swati) Refactoring and cleanups: - Clocking and DPLL refactoring and cleanups to support seamless M/N (Ville) - Plenty of VBT definition and parsing updates and cleanups (Ville) - Extract SKL watermark code to a separate file, and clean up (Ville) - Clean up IPC interfaces and debugfs (Jani) - Continue moving display data under drm_i915_private display sub-struct (Jani) - Display quirk handling refactoring and abstractions (Jani) - Stop using implicit dev_priv in gmbus registers (Jani) - BUG_ON() removals and conversions to drm_WARN_ON() and BUILD_BUG_ON() (Jani) - Use drm_dp_phy_name() for logging (Jani) - Use REG_BIT() macros for CDCLK registers (Stan) - Move display and media IP versions to runtime info (Radhakrishna) Fixes: - Fix DP MST suspend to avoid use-after-free (Andrzej) - Fix HPD suspend to avoid use-after-free for fbdev (Andrzej) - Fix various PSR issues regarding selective update and damage clips (Jouni) - Fix runtime pm wakerefs for driver remove and release (Mitul Golani) - Fix conditions for filtering fixed modes for panels (Ville) - Fix TV encoder clock computation (Ville) - Fix dvo mode_valid hook return type (Nathan Huckleberry) Merges: - Backmerge drm-next to sync the DP MST atomic changes (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87o7vfr064.fsf@intel.com commit 72ca70acc7658b99ec39b75971002fb1c8d48c1a Merge: d1e2d6b78ffc0 8adc718881e0a Author: Dave Airlie Date: Wed Sep 21 07:35:00 2022 +1000 Merge tag 'drm-intel-gt-next-2022-09-16' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Cross-subsystem Changes: - MEI subsystem pieces for XeHP SDV GSC support These are Acked-by Greg. Driver Changes: - Release mmaps on RPM suspend on discrete GPUs (Anshuman) - Update GuC version to 7.5 on DG1, DG2 and ADL - Revert "drm/i915/dg2: extend Wa_1409120013 to DG2" (Lucas) - MTL enabling incl. standalone media (Matt R, Lucas) - Explicitly clear BB_OFFSET for new contexts on Gen8+ (Chris) - Fix throttling / perf limit reason decoding (Ashutosh) - XeHP SDV GSC support (Vitaly, Alexander, Tomas) - Fix issues with overrding firmware file paths (John) - Invert if-else ladders to check latest version first (Lucas) - Cancel GuC engine busyness worker synchronously (Umesh) - Skip applying copy engine fuses outside PVC (Lucas) - Eliminate Gen10 frequency read function (Lucas) - Static code checker fixes (Gaosheng) - Selftest improvements (Chris) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YyQ4Jgl3cpGL1/As@jlahtine-mobl.ger.corp.intel.com commit bfa8fe95ffe8d62576cf47bf58df5c9da9214723 Merge: c31b38cb948ee fdf214978a71b Author: Martin KaFai Lau Date: Tue Sep 20 14:30:35 2022 -0700 Merge branch 'bpf: Small nf_conn cleanups' Daniel Xu says: ==================== This patchset cleans up a few small things: * Delete unused stub * Rename variable to be more descriptive * Fix some `extern` declaration warnings Past discussion: - v2: https://lore.kernel.org/bpf/cover.1663616584.git.dxu@dxuuu.xyz/ Changes since v2: - Remove unused #include's - Move #include to .c ==================== Signed-off-by: Martin KaFai Lau commit fdf214978a71b2749d26f6da2b1d51d9ac23831d Author: Daniel Xu Date: Tue Sep 20 08:15:24 2022 -0600 bpf: Move nf_conn extern declarations to filter.h We're seeing the following new warnings on netdev/build_32bit and netdev/build_allmodconfig_warn CI jobs: ../net/core/filter.c:8608:1: warning: symbol 'nf_conn_btf_access_lock' was not declared. Should it be static? ../net/core/filter.c:8611:5: warning: symbol 'nfct_bsa' was not declared. Should it be static? Fix by ensuring extern declaration is present while compiling filter.o. Fixes: 864b656f82cc ("bpf: Add support for writing to nf_conn:mark") Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/2bd2e0283df36d8a4119605878edb1838d144174.1663683114.git.dxu@dxuuu.xyz Signed-off-by: Martin KaFai Lau commit e93a766da57fff3273bcb618edf5dfca1fb86b89 Author: Rafał Miłecki Date: Thu Sep 15 15:30:13 2022 +0200 net: broadcom: bcm4908_enet: handle -EPROBE_DEFER when getting MAC Reading MAC from OF may return -EPROBE_DEFER if underlaying NVMEM device isn't ready yet. In such case pass that error code up and "wait" to be probed later. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220915133013.2243-1-zajec5@gmail.com Signed-off-by: Jakub Kicinski commit 2edd66eccfeab9734512fac352b50d17366246f5 Author: Yang Yingliang Date: Tue Sep 20 23:14:13 2022 +0800 ASoC: rt5682s: simplify the return of rt5682s_probe() After commit bfc5e8b860ad ("ASoC: rt5682s: Reduce coupling of Micbias and Vref2 settings"), the return of rt5682s_probe() can be simplified. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220920151413.3455255-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit a65eacaf98503e03b9a23ab12f836c71baaf9ead Merge: 08820902ef25d 7738211bce7ae Author: Mark Brown Date: Tue Sep 20 22:32:24 2022 +0100 ASoC: SOF: ipc4-topology: minor cleanup Merge series from Pierre-Louis Bossart : Two updates on warnings reported by cppcheck. commit 08820902ef25d8a2b7c23297d7b73da657d52da0 Merge: 899a8e7ddc44c 9862dcf70245c Author: Mark Brown Date: Tue Sep 20 22:32:16 2022 +0100 ASoC: SOF: sof-audio: fix prepare/unprepare Merge series from Pierre-Louis Bossart : 2 patches from Rander required to enable mixing usages with multiple pipelines. commit 899a8e7ddc44c23d75ed7fce7b7962f2da95dd33 Merge: e7ff7307bb9aa 3289dc026a8cf Author: Mark Brown Date: Tue Sep 20 22:32:09 2022 +0100 ASoC: soc.h: random cleanup Merge series from Kuninori Morimoto : These are random cleanup for soc.h commit 5a090aa35038e3dad1ee334e3c509c39e7599bb4 Author: Daniel Xu Date: Tue Sep 20 08:15:23 2022 -0600 bpf: Rename nfct_bsa to nfct_btf_struct_access The former name was a little hard to guess. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/73adc72385c8b162391fbfb404f0b6d4c5cc55d7.1663683114.git.dxu@dxuuu.xyz Signed-off-by: Martin KaFai Lau commit 52bdae37c92ae10d47d54bd7cd39e0a17547ebfa Author: Daniel Xu Date: Tue Sep 20 08:15:22 2022 -0600 bpf: Remove unused btf_struct_access stub This stub was not being used anywhere. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/590e7bd6172ffe0f3d7b51cd40e8ded941aaf7e8.1663683114.git.dxu@dxuuu.xyz Signed-off-by: Martin KaFai Lau commit caddb4e0d63980315772e3c6f4e92624d0dd193f Author: Lukas Bulwahn Date: Thu Sep 15 14:42:56 2022 +0200 net: make NET_(DEV|NS)_REFCNT_TRACKER depend on NET It makes little sense to ask if networking namespace or net device refcount tracking shall be enabled for debug kernel builds without network support. This is similar to the commit eb0b39efb7d9 ("net: CONFIG_DEBUG_NET depends on CONFIG_NET"). Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220915124256.32512-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit c3194a67149f491aadc6cf9da509ff64227bfbe8 Merge: 4d3c884850a14 2c08a4f898d0a Author: Jakub Kicinski Date: Tue Sep 20 13:54:39 2022 -0700 Merge branch 'small-tc-taprio-improvements' Vladimir Oltean says: ==================== Small tc-taprio improvements This series contains: - the proper protected variant of rcu_dereference() of admin and oper schedules for accesses from the slow path - a removal of an extra function pointer indirection for qdisc->dequeue() and qdisc->peek() - a removal of WARN_ON_ONCE() checks that can never trigger - the addition of netlink extack messages to some qdisc->init() failures These were split from an earlier patch set, hence the v2. ==================== Link: https://lore.kernel.org/r/20220915105046.2404072-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 2c08a4f898d0a8e08f431709a1ae728a6fddaabd Author: Vladimir Oltean Date: Thu Sep 15 13:50:46 2022 +0300 net/sched: taprio: replace safety precautions with comments The WARN_ON_ONCE() checks introduced in commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping") take a small toll on performance, but otherwise, the conditions are never expected to happen. Replace them with comments, such that the information is still conveyed to developers. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 026de64d7bc39cc77f2084c4454a562720e9c8ff Author: Vladimir Oltean Date: Thu Sep 15 13:50:45 2022 +0300 net/sched: taprio: add extack messages in taprio_init Stop contributing to the proverbial user unfriendliness of tc, and tell the user what is wrong wherever possible. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 25becba6290bc34e369a0e1a76db9ca88bad87aa Author: Vladimir Oltean Date: Thu Sep 15 13:50:44 2022 +0300 net/sched: taprio: stop going through private ops for dequeue and peek Since commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), taprio_dequeue_soft() and taprio_peek_soft() are de facto the only implementations for Qdisc_ops :: dequeue and Qdisc_ops :: peek that taprio provides. This is because in full offload mode, __dev_queue_xmit() will select a txq->qdisc which is never root taprio qdisc. So if nothing is enqueued in the root qdisc, it will never be run and nothing will get dequeued from it. Therefore, we can remove the private indirection from taprio, and always point Qdisc_ops :: dequeue to taprio_dequeue_soft (now simply named taprio_dequeue) and Qdisc_ops :: peek to taprio_peek_soft (now simply named taprio_peek). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit fa65edde5e490988bfb8945317dd8e546bd7e7ab Author: Vladimir Oltean Date: Thu Sep 15 13:50:43 2022 +0300 net/sched: taprio: remove redundant FULL_OFFLOAD_IS_ENABLED check in taprio_enqueue Since commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), __dev_queue_xmit() will select a txq->qdisc for the full offload case of taprio which isn't the root taprio qdisc, so qdisc enqueues will never pass through taprio_enqueue(). That commit already introduced one safety precaution check for FULL_OFFLOAD_IS_ENABLED(); a second one is really not needed, so simplify the conditional for entering into the GSO segmentation logic. Also reword the comment a little, to appear more natural after the code change. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 9af23657b33679b5b8d8579ca1cc0214398f576f Author: Vladimir Oltean Date: Thu Sep 15 13:50:42 2022 +0300 net/sched: taprio: use rtnl_dereference for oper and admin sched in taprio_destroy() Sparse complains that taprio_destroy() dereferences q->oper_sched and q->admin_sched without rcu_dereference(), since they are marked as __rcu in the taprio private structure. 1671:28: warning: incorrect type in argument 1 (different address spaces) 1671:28: expected struct callback_head *head 1671:28: got struct callback_head [noderef] __rcu * 1674:28: warning: incorrect type in argument 1 (different address spaces) 1674:28: expected struct callback_head *head 1674:28: got struct callback_head [noderef] __rcu * To silence that build warning, do actually use rtnl_dereference(), since we know the rtnl_mutex is held at the time of q->destroy(). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 18cdd2f0998a4967b1fff4c43ed9aef049e42c39 Author: Vladimir Oltean Date: Thu Sep 15 13:50:41 2022 +0300 net/sched: taprio: taprio_dump and taprio_change are protected by rtnl_mutex Since the writer-side lock is taken here, we do not need to open an RCU read-side critical section, instead we can use rtnl_dereference() to tell lockdep we are serialized with concurrent writes. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit c8cbe123be6de9deff5e5312af8848362a919f97 Author: Vladimir Oltean Date: Thu Sep 15 13:50:40 2022 +0300 net/sched: taprio: taprio_offload_config_changed() is protected by rtnl_mutex The locking in taprio_offload_config_changed() is wrong (but also inconsequentially so). The current_entry_lock does not serialize changes to the admin and oper schedules, only to the current entry. In fact, the rtnl_mutex does that, and that is taken at the time when taprio_change() is called. Replace the rcu_dereference_protected() method with the proper RCU annotation, and drop the unnecessary spin lock. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 2232b2dd8cd4f1e6d554b2c3f6899ce36f791b67 Author: Mario Limonciello Date: Tue Sep 20 15:14:35 2022 -0500 ASoC: amd: yc: Add Lenovo Yoga Slim 7 Pro X to quirks table Lenovo Yoga Slim 7 Pro X has an ACP DMIC that isn't specified in the ASL or existing quirk list. Add it to the quirk table to let DMIC work on these systems. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216299 Tested-by: Sebastian S Reported-and-tested-by: Travis Glenn Hansen Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220920201436.19734-3-mario.limonciello@amd.com Signed-off-by: Mark Brown commit 4df5b13dec9e1b5a12db47ee92eb3f7da5c3deb5 Author: Xiaoyan Li Date: Tue Sep 20 15:14:34 2022 -0500 ASoC: amd: yc: Add ASUS UM5302TA into DMI table ASUS Zenbook S 13 OLED (UM5302TA) needs this quirk to get the built-in microphone working properly. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216270 Signed-off-by: Xiaoyan Li Suggested-by: Mario Limonciello Reviewed-by: Mario Limonciello Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220920201436.19734-2-mario.limonciello@amd.com Signed-off-by: Mark Brown commit 4d3c884850a14a177487cc0ffa73b7f6af2500a8 Merge: 4fa37e49114c7 742b7072764af Author: Jakub Kicinski Date: Tue Sep 20 13:25:15 2022 -0700 Merge branch 'nfp-flower-police-validation-and-ct-enhancements' Simon Horman says: ==================== nfp: flower: police validation and ct enhancements this series enhances the flower hardware offload facility provided by the nfp driver. 1. Add validation of police actions created independently of flows 2. Add support offload of ct NAT action 3. Support offload of rule which has both vlan push/pop/mangle and ct action ==================== Link: https://lore.kernel.org/r/20220914160604.1740282-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 742b7072764af42207d14c60bd1c149e6b333acf Author: Hui Zhou Date: Wed Sep 14 17:06:04 2022 +0100 nfp: flower: support vlan action in pre_ct Support hardware offload of rule which has both vlan push/pop/mangle and ct action. Signed-off-by: Hui Zhou Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 5cee92c6f57ac97697e35c278b3b72c67e87cacb Author: Hui Zhou Date: Wed Sep 14 17:06:03 2022 +0100 nfp: flower: support hw offload for ct nat action support ct nat action when pre_ct merge with post_ct and nft. at the same time, add the extra checksum action and hardware stats for nft to meet the action check when do nat. Signed-off-by: Hui Zhou Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 9f1a948fd6eff607658158b4fb71e073dc8095b1 Author: Ziyang Chen Date: Wed Sep 14 17:06:02 2022 +0100 nfp: flower: add validation of for police actions which are independent of flows Validation of police actions was added to offload drivers in commit d97b4b105ce7 ("flow_offload: reject offload for all drivers with invalid police parameters") This patch extends that validation in the nfp driver to include police actions which are created independently of flows. Signed-off-by: Ziyang Chen Reviewed-by: Baowen Zheng Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 40d3c041e2f871b3d2d78c8e360224f788ac17ab Author: V sujith kumar Reddy Date: Tue Sep 13 20:13:18 2022 +0530 ASoC: SOF: amd: increase SRAM inbox and outbox size to 1024 Increase inbox and outbox mailbox size from 512 to 1024 to support thirdparty DTS integration ipc tx/rx messages communication. This is done through firmware window get info. Signed-off-by: V sujith kumar Reddy Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220913144319.1055302-5-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit ed2562c64b4f2cb434420f7d2818d0388250ac1a Author: V sujith kumar Reddy Date: Tue Sep 13 20:13:17 2022 +0530 ASoC: SOF: Adding amd HS functionality to the sof core Add I2S HS control instance to the sof core. This will help the amd topology to use the I2S HS Dai. Signed-off-by: V sujith kumar Reddy Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220913144319.1055302-4-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit 41cb85bc4b526bb228579c04857bc58213e5f9b5 Author: V sujith kumar Reddy Date: Tue Sep 13 20:13:16 2022 +0530 ASoC: SOF: amd: Add support for Rembrandt plaform. Add pci driver and platform driver to enable SOF support on ACP6x architecture based Rembrandt platform. Signed-off-by: Ajit Kumar Pandey Signed-off-by: V sujith kumar Reddy Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220913144319.1055302-3-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit 4da6b033f5454ccbac2d5795d7edfb3f2a777104 Author: Ajit Kumar Pandey Date: Tue Sep 13 20:13:15 2022 +0530 ASoC: SOF: amd: Make ACP core code generic for newer SOC transition Newer AMD SOC differs slightly in terms of few registers offset and configuration. Add offsets into chip_info struct to make core ACP code more generic and resusable on newer SOC. Signed-off-by: Ajit Kumar Pandey Signed-off-by: V sujith kumar Reddy Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220913144319.1055302-2-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit a3c278807a459e6f50afee6971cabe74cccfb490 Author: Bernard Metzler Date: Tue Sep 20 10:25:03 2022 +0200 RDMA/siw: Fix QP destroy to wait for all references dropped. Delay QP destroy completion until all siw references to QP are dropped. The calling RDMA core will free QP structure after successful return from siw_qp_destroy() call, so siw must not hold any remaining reference to the QP upon return. A use-after-free was encountered in xfstest generic/460, while testing NFSoRDMA. Here, after a TCP connection drop by peer, the triggered siw_cm_work_handler got delayed until after QP destroy call, referencing a QP which has already freed. Fixes: 303ae1cdfdf7 ("rdma/siw: application interface") Reported-by: Olga Kornievskaia Signed-off-by: Bernard Metzler Link: https://lore.kernel.org/r/20220920082503.224189-1-bmt@zurich.ibm.com Signed-off-by: Leon Romanovsky commit 754209850df8367c954ac1de7671c7430b1f342c Author: Bernard Metzler Date: Tue Sep 20 10:12:02 2022 +0200 RDMA/siw: Always consume all skbuf data in sk_data_ready() upcall. For header and trailer/padding processing, siw did not consume new skb data until minimum amount present to fill current header or trailer structure, including potential payload padding. Not consuming any data during upcall may cause a receive stall, since tcp_read_sock() is not upcalling again if no new data arrive. A NFSoRDMA client got stuck at RDMA Write reception of unaligned payload, if the current skb did contain only the expected 3 padding bytes, but not the 4 bytes CRC trailer. Expecting 4 more bytes already arrived in another skb, and not consuming those 3 bytes in the current upcall left the Write incomplete, waiting for the CRC forever. Fixes: 8b6a361b8c48 ("rdma/siw: receive path") Reported-by: Olga Kornievskaia Tested-by: Olga Kornievskaia Signed-off-by: Bernard Metzler Link: https://lore.kernel.org/r/20220920081202.223629-1-bmt@zurich.ibm.com Signed-off-by: Leon Romanovsky commit 9a737e7f8b371e97eb649904276407cee2c9cf30 Author: Takashi Iwai Date: Tue Sep 20 20:11:26 2022 +0200 ALSA: usb-audio: Properly refcounting clock rate We fixed the bug introduced by the patch for managing the shared clocks at the commit 809f44a0cc5a ("ALSA: usb-audio: Clear fixed clock rate at closing EP"), but it was merely a workaround. By this change, the clock reference rate is cleared at each EP close, hence the still remaining EP may need a re-setup of rate unnecessarily. This patch introduces the proper refcounting for the clock reference object so that the clock setup is done only when needed. Fixes: 809f44a0cc5a ("ALSA: usb-audio: Clear fixed clock rate at closing EP") Fixes: c11117b634f4 ("ALSA: usb-audio: Refcount multiple accesses on the single clock") Link: https://lore.kernel.org/r/20220920181126.4912-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2be79d58645465351af5320eb14c70a94724c5ef Author: Takashi Iwai Date: Tue Sep 20 20:11:06 2022 +0200 ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2) This is a second attempt to fix the bug appearing on Android with the recent kernel; the first try was ff878b408a03 and reverted at commit 79764ec772bc. The details taken from the v1 patch: One of the former changes for the endpoint management was the more consistent setup of endpoints at hw_params. snd_usb_endpoint_configure() is a single function that does the full setup, and it's called from both PCM hw_params and prepare callbacks. Although the EP setup at the prepare phase is usually skipped (by checking need_setup flag), it may be still effective in some cases like suspend/resume that requires the interface setup again. As it's a full and single setup, the invocation of snd_usb_endpoint_configure() includes not only the USB interface setup but also the buffer release and allocation. OTOH, doing the buffer release and re-allocation at PCM prepare phase is rather superfluous, and better to be done only in the hw_params phase. For those optimizations, this patch splits the endpoint setup to two phases: snd_usb_endpoint_set_params() and snd_usb_endpoint_prepare(), to be called from hw_params and from prepare, respectively. Note that this patch changes the driver operation slightly, effectively moving the USB interface setup again to PCM prepare stage instead of hw_params stage, while the buffer allocation and such initializations are still done at hw_params stage. And, the change of the USB interface setup timing (moving to prepare) gave an interesting "fix", too: it was reported that the recent kernels caused silent output at the beginning on playbacks on some devices on Android, and this change casually fixed the regression. It seems that those devices are picky about the sample rate change (or the interface change?), and don't follow the too immediate rate changes. Meanwhile, Android operates the PCM in the following order: - open, then hw_params with the possibly highest sample rate - close without prepare - re-open, hw_params with the normal sample rate - prepare, and start streaming This procedure ended up the hw_params twice with different rates, and because the recent kernel did set up the sample rate twice one and after, it screwed up the device. OTOH, the earlier kernels didn't set up the USB interface at hw_params, hence this problem didn't appear. Now, with this patch, the USB interface setup is again back to the prepare phase, and it works around the problem automagically. Although we should address the sample rate problem in a more solid way in future, let's keep things working as before for now. *** What's new in the take#2 patch: - The regression caused by the v1 patch (bko#216500) was due to the missing check of need_setup flag at hw_params. Now the check is added, and the snd_usb_endpoint_set_params() call is skipped when the running EP is re-opened. - There was another bug in v1 where the clock reference rate wasn't updated at hw_params phase, which may lead to a lack of the proper hw constraints when an application doesn't issue the prepare but only the hw_params call. This patch fixes it as well by tracking the clock rate change in the prepare callback with a new flag "need_update" for the clock reference object, just like others. - The configure_endpoints() are simplified and folded back into snd_usb_pcm_prepare(). Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Fixes: ff878b408a03 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare") Reported-by: chihhao chen Link: https://lore.kernel.org/r/87e6d6ae69d68dc588ac9acc8c0f24d6188375c3.camel@mediatek.com Link: https://lore.kernel.org/r/20220901124136.4984-1-tiwai@suse.de Link: https://bugzilla.kernel.org/show_bug.cgi?id=216500 Link: https://lore.kernel.org/r/20220920181106.4894-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2fe2fb4ce60be9005d7bfdd5665be03b8efb5b13 Author: Paul Moore Date: Tue Sep 20 14:11:11 2022 -0400 selinux: remove runtime disable message in the install_policy.sh script We are in the process of deprecating the runtime disable mechanism, let's not reference it in the scripts. Signed-off-by: Paul Moore commit e7ff7307bb9aaf157d6bea5807a58673dee94a61 Author: Bard Liao Date: Tue Sep 20 09:46:17 2022 +0200 ASoC: Intel: soc-acpi-intel-rpl-match: add rpl_sdca_3_in_1 support Add rpl_sdca_3_in_1 match information. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920074617.10300-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9b9def51e1a6de6cd336ae08884f580ebab7d2b2 Author: Alexander Martinz Date: Tue Sep 20 13:50:14 2022 +0200 ASoC: codecs: tfa989x: fix register access comments Fix comments regarding register access based on review feedback[1]. [1]: https://lore.kernel.org/all/YppQ7BiqlBDMNsuc@gerhold.net/ Signed-off-by: Alexander Martinz Link: https://lore.kernel.org/r/20220920115014.952062-1-amartinz@shiftphones.com Signed-off-by: Mark Brown commit c969bb8dbaf2f3628927eae73e7c579a74cf1b6e Author: Greg Kroah-Hartman Date: Tue Sep 20 19:12:52 2022 +0200 selinux: use "grep -E" instead of "egrep" The latest version of grep claims that egrep is now obsolete so the build now contains warnings that look like: egrep: warning: egrep is obsolescent; using grep -E fix this by using "grep -E" instead. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Cc: selinux@vger.kernel.org Signed-off-by: Greg Kroah-Hartman [PM: tweak to remove vdso reference, cleanup subj line] Signed-off-by: Paul Moore commit 7738211bce7ae43624121fcf121aec87b2149af1 Author: Pierre-Louis Bossart Date: Tue Sep 20 16:54:05 2022 +0200 ASoC: SOF: ipc4-topology: remove useless assignment cppcheck warning: sound/soc/sof/ipc4-topology.c:1533:12: style: Variable 'pipeline' is assigned a value that is never used. [unreadVariable] pipeline = pipe_widget->private; ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220920145405.2089147-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 80d53171f85a8e97b2aa1d50045dbc1b5dd1bc97 Author: Pierre-Louis Bossart Date: Tue Sep 20 16:54:04 2022 +0200 ASoC: SOF: ipc4-topology: clarify calculation precedence cppcheck warning: sound/soc/sof/ipc4-topology.c:334:64: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] type = fw_module->man4_module_entry.type & SOF_IPC4_MODULE_DP ? 1 : 0; ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220920145405.2089147-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9862dcf70245c2d03764012b81966d8c2ea95a48 Author: Rander Wang Date: Tue Sep 20 17:01:07 2022 +0200 ASoC: SOF: don't unprepare widget used other pipelines If multiple pipeline are mixed into one, we can't unprepare the widget used by other pipelines. This patch checks use_count to address this case. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920150107.2090695-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ce59804d26432d7e2c1a8c906245a230a2b4505c Author: Rander Wang Date: Tue Sep 20 17:01:06 2022 +0200 ASoC: SOF: clear prepare state when widget is unprepared Playback can't work after the first try sometimes. The reason is that some widgets don't have ipc_unprepare ops and driver will jump to sink_prepare so miss to set prepare state to false. Next time these widgets will not be prepared and it will result to error with different format of audio file since the last setting is not applicable. This patch makes sure that widget prepare state will be cleared to false when it is unprepared. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920150107.2090695-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 52d7939d10f25bc6635caa4d390e79a034626f79 Author: Pierre-Louis Bossart Date: Tue Sep 20 15:17:00 2022 +0200 ASoC: SOF: Intel: add ops for SKL/KBL Add ops and ops_init for SKL and KBL. Tested on Dell XPS-13-9350 and KBL NUC. Note: currently only SOF_IPC4_MTRACE_INTEL_CAVS_2 type is supported by the ipc4-mtrace driver, which is used by CAVS 2.x platforms (ICL, TGL, ADL) and ACE (MTL). Signed-off-by: Ranjani Sridharan Signed-off-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920131700.133103-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e2379d4a83da44816009971e932db31e665d41a1 Author: Pierre-Louis Bossart Date: Tue Sep 20 15:16:59 2022 +0200 ASoC: SOF: Intel: add initial SKL/KBL hardware support In preparation of the IPCv4 IPC support, this patch adds support for SkyLake and KabyLake boot and descriptors used when probing the PCI driver. The work was initially contributed in 2018 by Liam Girdwood and Zhu Yingjiang, and abandoned due to firmware signature issues. With the upcoming support of IPC v4, and hence the Intel closed-source firmware, it's time to re-add this capability. The SKL ops will be added in the next patch. Tested with the IPC4 and closed-source firmware on Dell XPS 9350 and KBL NUC with HDaudio codecs. The SSP and DMIC interfaces are not supported at this time. Co-developed-by: Ranjani Sridharan Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220920131700.133103-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c712be3427ca7b76800f335a6cfabdddab380c27 Author: Pierre-Louis Bossart Date: Tue Sep 20 15:16:58 2022 +0200 ASoC: SOF: Intel: add SKL/KBL hardware code loader This patch adds support for the SkyLake and KabyLake code loader on top of the SOF IPC4. The work was initially contributed in 2018 by Liam Girdwood and Zhu Yingjiang, and abandoned due to firmware signature issues. With the existing support of IPC v4, it's time to re-add this capability. This patch uses the newly added FSR (Firmware State Register) definitions for DSP state handling and targeting, ass well as new state definition for SKL which indicates that the firmware has been started (similar to FW_ENTERED on other platforms). Co-developed-by: Ranjani Sridharan Signed-off-by: Ranjani Sridharan Co-developed-by: Peter Ujfalusi Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220920131700.133103-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 556eb41622b01c50dbc330e03bad2b0a5a082428 Author: Pierre-Louis Bossart Date: Tue Sep 20 15:16:57 2022 +0200 ASoC: SOF: Intel: hda-dsp: expose functions for SKL support In preparation of the IPCv4 IPC support, this patch adds exposes two functions required by the SKL/KBL boot and code loader. Co-developed-by: Ranjani Sridharan Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220920131700.133103-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 23a2d0c5944896ce9123f36ab62d7ca64c8b25ff Author: Jason Wang Date: Wed Aug 3 04:19:18 2022 +0800 nvdimm/namespace: Fix comment typo The double `existing' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220802201918.8408-1-wangborong@cdjrlc.com Signed-off-by: Dan Williams commit d80ca810f096ff66f451e7a3ed2f0cd9ef1ff519 Author: Ard Biesheuvel Date: Thu Sep 15 19:00:24 2022 +0200 efi: libstub: drop pointless get_memory_map() call Currently, the non-x86 stub code calls get_memory_map() redundantly, given that the data it returns is never used anywhere. So drop the call. Cc: # v4.14+ Fixes: 24d7c494ce46 ("efi/arm-stub: Round up FDT allocation to mapping size") Signed-off-by: Ard Biesheuvel commit 7912d30fbb1a9df7e99eb7a5991582512e65927c Author: Jiapeng Chong Date: Wed Sep 14 14:12:51 2022 +0800 nvdimm: make __nvdimm_security_overwrite_query static This symbol is not used outside of security.c, so marks it static. drivers/nvdimm/security.c:411:6: warning: no previous prototype for function '__nvdimm_security_overwrite_query'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2148 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220914061251.42052-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Dan Williams commit 4fa37e49114c7e20f9a23424f004ccf4155f1b47 Merge: 17df341d35265 d1e5e6408b305 Author: Jakub Kicinski Date: Tue Sep 20 10:21:53 2022 -0700 Merge branch 'tcp-introduce-optional-per-netns-ehash' Kuniyuki Iwashima says: ==================== tcp: Introduce optional per-netns ehash. The more sockets we have in the hash table, the longer we spend looking up the socket. While running a number of small workloads on the same host, they penalise each other and cause performance degradation. The root cause might be a single workload that consumes much more resources than the others. It often happens on a cloud service where different workloads share the same computing resource. On EC2 c5.24xlarge instance (196 GiB memory and 524288 (1Mi / 2) ehash entries), after running iperf3 in different netns, creating 24Mi sockets without data transfer in the root netns causes about 10% performance regression for the iperf3's connection. thash_entries sockets length Gbps 524288 1 1 50.7 24Mi 48 45.1 It is basically related to the length of the list of each hash bucket. For testing purposes to see how performance drops along the length, I set 131072 (1Mi / 8) to thash_entries, and here's the result. thash_entries sockets length Gbps 131072 1 1 50.7 1Mi 8 49.9 2Mi 16 48.9 4Mi 32 47.3 8Mi 64 44.6 16Mi 128 40.6 24Mi 192 36.3 32Mi 256 32.5 40Mi 320 27.0 48Mi 384 25.0 To resolve the socket lookup degradation, we introduce an optional per-netns hash table for TCP, but it's just ehash, and we still share the global bhash, bhash2 and lhash2. With a smaller ehash, we can look up non-listener sockets faster and isolate such noisy neighbours. Also, we can reduce lock contention. For details, please see the last patch. patch 1 - 4: prep for per-netns ehash patch 5: small optimisation for netns dismantle without TIME_WAIT sockets patch 6: add per-netns ehash Many thanks to Eric Dumazet for reviewing and advising. ==================== Link: https://lore.kernel.org/r/20220908011022.45342-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit d1e5e6408b305ff78b825d437df8d3f77e82a4be Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:22 2022 -0700 tcp: Introduce optional per-netns ehash. The more sockets we have in the hash table, the longer we spend looking up the socket. While running a number of small workloads on the same host, they penalise each other and cause performance degradation. The root cause might be a single workload that consumes much more resources than the others. It often happens on a cloud service where different workloads share the same computing resource. On EC2 c5.24xlarge instance (196 GiB memory and 524288 (1Mi / 2) ehash entries), after running iperf3 in different netns, creating 24Mi sockets without data transfer in the root netns causes about 10% performance regression for the iperf3's connection. thash_entries sockets length Gbps 524288 1 1 50.7 24Mi 48 45.1 It is basically related to the length of the list of each hash bucket. For testing purposes to see how performance drops along the length, I set 131072 (1Mi / 8) to thash_entries, and here's the result. thash_entries sockets length Gbps 131072 1 1 50.7 1Mi 8 49.9 2Mi 16 48.9 4Mi 32 47.3 8Mi 64 44.6 16Mi 128 40.6 24Mi 192 36.3 32Mi 256 32.5 40Mi 320 27.0 48Mi 384 25.0 To resolve the socket lookup degradation, we introduce an optional per-netns hash table for TCP, but it's just ehash, and we still share the global bhash, bhash2 and lhash2. With a smaller ehash, we can look up non-listener sockets faster and isolate such noisy neighbours. In addition, we can reduce lock contention. We can control the ehash size by a new sysctl knob. However, depending on workloads, it will require very sensitive tuning, so we disable the feature by default (net.ipv4.tcp_child_ehash_entries == 0). Moreover, we can fall back to using the global ehash in case we fail to allocate enough memory for a new ehash. The maximum size is 16Mi, which is large enough that even if we have 48Mi sockets, the average list length is 3, and regression would be less than 1%. We can check the current ehash size by another read-only sysctl knob, net.ipv4.tcp_ehash_entries. A negative value means the netns shares the global ehash (per-netns ehash is disabled or failed to allocate memory). # dmesg | cut -d ' ' -f 5- | grep "established hash" TCP established hash table entries: 524288 (order: 10, 4194304 bytes, vmalloc hugepage) # sysctl net.ipv4.tcp_ehash_entries net.ipv4.tcp_ehash_entries = 524288 # can be changed by thash_entries # sysctl net.ipv4.tcp_child_ehash_entries net.ipv4.tcp_child_ehash_entries = 0 # disabled by default # ip netns add test1 # ip netns exec test1 sysctl net.ipv4.tcp_ehash_entries net.ipv4.tcp_ehash_entries = -524288 # share the global ehash # sysctl -w net.ipv4.tcp_child_ehash_entries=100 net.ipv4.tcp_child_ehash_entries = 100 # ip netns add test2 # ip netns exec test2 sysctl net.ipv4.tcp_ehash_entries net.ipv4.tcp_ehash_entries = 128 # own a per-netns ehash with 2^n buckets When more than two processes in the same netns create per-netns ehash concurrently with different sizes, we need to guarantee the size in one of the following ways: 1) Share the global ehash and create per-netns ehash First, unshare() with tcp_child_ehash_entries==0. It creates dedicated netns sysctl knobs where we can safely change tcp_child_ehash_entries and clone()/unshare() to create a per-netns ehash. 2) Control write on sysctl by BPF We can use BPF_PROG_TYPE_CGROUP_SYSCTL to allow/deny read/write on sysctl knobs. Note that the global ehash allocated at the boot time is spread over available NUMA nodes, but inet_pernet_hashinfo_alloc() will allocate pages for each per-netns ehash depending on the current process's NUMA policy. By default, the allocation is done in the local node only, so the per-netns hash table could fully reside on a random node. Thus, depending on the NUMA policy the netns is created with and the CPU the current thread is running on, we could see some performance differences for highly optimised networking applications. Note also that the default values of two sysctl knobs depend on the ehash size and should be tuned carefully: tcp_max_tw_buckets : tcp_child_ehash_entries / 2 tcp_max_syn_backlog : max(128, tcp_child_ehash_entries / 128) As a bonus, we can dismantle netns faster. Currently, while destroying netns, we call inet_twsk_purge(), which walks through the global ehash. It can be potentially big because it can have many sockets other than TIME_WAIT in all netns. Splitting ehash changes that situation, where it's only necessary for inet_twsk_purge() to clean up TIME_WAIT sockets in each netns. With regard to this, we do not free the per-netns ehash in inet_twsk_kill() to avoid UAF while iterating the per-netns ehash in inet_twsk_purge(). Instead, we do it in tcp_sk_exit_batch() after calling tcp_twsk_purge() to keep it protocol-family-independent. In the future, we could optimise ehash lookup/iteration further by removing netns comparison for the per-netns ehash. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit edc12f032a5a1633474db566878ce0012e7ca2f5 Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:21 2022 -0700 tcp: Save unnecessary inet_twsk_purge() calls. While destroying netns, we call inet_twsk_purge() in tcp_sk_exit_batch() and tcpv6_net_exit_batch() for AF_INET and AF_INET6. These commands trigger the kernel to walk through the potentially big ehash twice even though the netns has no TIME_WAIT sockets. # ip netns add test # ip netns del test or # unshare -n /bin/true >/dev/null When tw_refcount is 1, we need not call inet_twsk_purge() at least for the net. We can save such unneeded iterations if all netns in net_exit_list have no TIME_WAIT sockets. This change eliminates the tax by the additional unshare() described in the next patch to guarantee the per-netns ehash size. Tested: # mount -t debugfs none /sys/kernel/debug/ # echo cleanup_net > /sys/kernel/debug/tracing/set_ftrace_filter # echo inet_twsk_purge >> /sys/kernel/debug/tracing/set_ftrace_filter # echo function > /sys/kernel/debug/tracing/current_tracer # cat ./add_del_unshare.sh for i in `seq 1 40` do (for j in `seq 1 100` ; do unshare -n /bin/true >/dev/null ; done) & done wait; # ./add_del_unshare.sh Before the patch: # cat /sys/kernel/debug/tracing/trace_pipe kworker/u128:0-8 [031] ...1. 174.162765: cleanup_net <-process_one_work kworker/u128:0-8 [031] ...1. 174.240796: inet_twsk_purge <-cleanup_net kworker/u128:0-8 [032] ...1. 174.244759: inet_twsk_purge <-tcp_sk_exit_batch kworker/u128:0-8 [034] ...1. 174.290861: cleanup_net <-process_one_work kworker/u128:0-8 [039] ...1. 175.245027: inet_twsk_purge <-cleanup_net kworker/u128:0-8 [046] ...1. 175.290541: inet_twsk_purge <-tcp_sk_exit_batch kworker/u128:0-8 [037] ...1. 175.321046: cleanup_net <-process_one_work kworker/u128:0-8 [024] ...1. 175.941633: inet_twsk_purge <-cleanup_net kworker/u128:0-8 [025] ...1. 176.242539: inet_twsk_purge <-tcp_sk_exit_batch After: # cat /sys/kernel/debug/tracing/trace_pipe kworker/u128:0-8 [038] ...1. 428.116174: cleanup_net <-process_one_work kworker/u128:0-8 [038] ...1. 428.262532: cleanup_net <-process_one_work kworker/u128:0-8 [030] ...1. 429.292645: cleanup_net <-process_one_work Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 4461568aa4e565de2c336f4875ddf912f26da8a5 Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:20 2022 -0700 tcp: Access &tcp_hashinfo via net. We will soon introduce an optional per-netns ehash. This means we cannot use tcp_hashinfo directly in most places. Instead, access it via net->ipv4.tcp_death_row.hashinfo. The access will be valid only while initialising tcp_hashinfo itself and creating/destroying each netns. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 429e42c1c54e0d9bfe880195f7d4a8fd5a727194 Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:19 2022 -0700 tcp: Set NULL to sk->sk_prot->h.hashinfo. We will soon introduce an optional per-netns ehash. This means we cannot use the global sk->sk_prot->h.hashinfo to fetch a TCP hashinfo. Instead, set NULL to sk->sk_prot->h.hashinfo for TCP and get a proper hashinfo from net->ipv4.tcp_death_row.hashinfo. Note that we need not use sk->sk_prot->h.hashinfo if DCCP is disabled. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit e9bd0cca09d13ac2f08d25e195203e42d4ad1ce8 Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:18 2022 -0700 tcp: Don't allocate tcp_death_row outside of struct netns_ipv4. We will soon introduce an optional per-netns ehash and access hash tables via net->ipv4.tcp_death_row->hashinfo instead of &tcp_hashinfo in most places. It could harm the fast path because dereferences of two fields in net and tcp_death_row might incur two extra cache line misses. To save one dereference, let's place tcp_death_row back in netns_ipv4 and fetch hashinfo via net->ipv4.tcp_death_row"."hashinfo. Note tcp_death_row was initially placed in netns_ipv4, and commit fbb8295248e1 ("tcp: allocate tcp_death_row outside of struct netns_ipv4") changed it to a pointer so that we can fire TIME_WAIT timers after freeing net. However, we don't do so after commit 04c494e68a13 ("Revert "tcp/dccp: get rid of inet_twsk_purge()""), so we need not define tcp_death_row as a pointer. Also, we move refcount_dec_and_test(&tw_refcount) from tcp_sk_exit() to tcp_sk_exit_batch() as a debug check. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 08eaef90403110e51861d93e8008a355af467bbe Author: Kuniyuki Iwashima Date: Wed Sep 7 18:10:17 2022 -0700 tcp: Clean up some functions. This patch adds no functional change and cleans up some functions that the following patches touch around so that we make them tidy and easy to review/revert. The changes are - Keep reverse christmas tree order - Remove unnecessary init of port in inet_csk_find_open_port() - Use req_to_sk() once in reqsk_queue_unlink() - Use sock_net(sk) once in tcp_time_wait() and tcp_v[46]_connect() Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit a84b280f195df83124eea755132df072c1e15c46 Author: Jiapeng Chong Date: Mon Sep 19 14:14:28 2022 +0800 nvdimm/region: Fix kernel-doc drivers/nvdimm/region_devs.c:1103: warning: expecting prototype for nvdimm_flush(). Prototype was for generic_nvdimm_flush() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2209 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220919061428.102883-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Dan Williams commit 0227f4d0d15433c34f5dca68817c0d12ca244feb Author: Gaosheng Cui Date: Sun Sep 11 17:23:25 2022 +0800 IB/hfi1: remove rc_only_opcode and uc_only_opcode declarations rc_only_opcode and uc_only_opcode have been removed since commit b374e060cc2a ("IB/hfi1: Consolidate pio control masks into single definition"), so remove them. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220911092325.3216513-1-cuigaosheng1@huawei.com Signed-off-by: Leon Romanovsky commit 48c35c428c7feb06761dbc398139eb7e697c6608 Author: ye xingchen Date: Tue Sep 20 06:36:00 2022 +0000 drm/amd/pm: Remove unneeded result variable Return the value atomctrl_initialize_mc_reg_table_v2_2() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit fe6f695d8d03f98a04f6ce6f6e8eb8e4d0c450fc Author: ye xingchen Date: Tue Sep 20 06:35:03 2022 +0000 drm/amd/pm: Remove the unneeded result variable Return the value append_vbios_pptable() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit 4bb71fce58f30df3f251118291d6b0187ce531e6 Author: hongao Date: Tue Sep 20 17:24:53 2022 +0800 drm/amdgpu: fix initial connector audio value This got lost somewhere along the way, This fixes audio not working until set_property was called. Signed-off-by: hongao Signed-off-by: Alex Deucher commit 25ea501ed85dc3c224db73fb79d38b6109c1ad99 Author: Nathan Chancellor Date: Fri Sep 16 14:06:58 2022 -0700 drm/amd/display: Reduce number of arguments of dml314's CalculateFlipSchedule() Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer. This reduces the total amount of stack space that dml314_ModeSupportAndSystemConfigurationFull() uses by 112 bytes with LLVM 16 (1976 -> 1864), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_mode_vba_314.c:4020:6: error: stack frame size (2216) exceeds limit (2048) in 'dml314_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Link: https://github.com/ClangBuiltLinux/linux/issues/1710 Reported-by: "kernelci.org bot" Tested-by: Maíra Canal Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit ca07f4f5a98b96211a2a8fe51b35c039720be888 Author: Nathan Chancellor Date: Fri Sep 16 14:06:57 2022 -0700 drm/amd/display: Reduce number of arguments of dml314's CalculateWatermarksAndDRAMSpeedChangeSupport() Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer. This reduces the total amount of stack space that dml314_ModeSupportAndSystemConfigurationFull() uses by 240 bytes with LLVM 16 (2216 -> 1976), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_mode_vba_314.c:4020:6: error: stack frame size (2216) exceeds limit (2048) in 'dml314_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Link: https://github.com/ClangBuiltLinux/linux/issues/1710 Reported-by: "kernelci.org bot" Tested-by: Maíra Canal Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit e9127f5e8f1341cafbc288f96833eadffb570317 Author: Alex Deucher Date: Mon Sep 19 12:26:20 2022 -0400 drm/amdgpu: don't register a dirty callback for non-atomic Some asics still support non-atomic code paths. Fixes: 66f99628eb2440 ("drm/amdgpu: use dirty framebuffer helper") Reported-by: Arthur Marsh Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 6974340554d227ab6b8ecd933581857b227f632b Author: Christian König Date: Tue Sep 20 14:54:21 2022 +0200 drm/amdgpu: bump minor for gang submit Since that has now landed bump the minor to let userspace know about it. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b091fc6f8e5bb27577ffb71087f06730f33a8908 Author: Christian König Date: Tue Sep 20 14:13:33 2022 +0200 drm/amdgpu: properly initialize return value during CS The return value is no longer initialized before the loop because of moving code around. Signed-off-by: Christian König Fixes: c2b08e7a6d27 ("drm/amdgpu: move entity selection and job init earlier during CS") Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 0b844b6ee28cb99ca387880435044cb55a51d73d Author: Evan Quan Date: Fri Sep 16 13:30:44 2022 +0800 drm/amd/pm: drop the pptable related workarounds for SMU 13.0.0 The pptable in the vbios is fully ready. The related workarounds in driver are not needed any more. Signed-off-by: Evan Quan Acked-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8522b42aade9dd0a0659c94095094a41e9664309 Author: Evan Quan Date: Fri Sep 16 13:19:29 2022 +0800 drm/amd/pm: add support for 3794 pptable for SMU13.0.0 Enable 3794 pptable support for SMU13.0.0. Signed-off-by: Evan Quan Acked-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 4624459c84d71e0d5f94ea6a7b2c4eec4f1d122b Author: Christian König Date: Wed Mar 2 16:39:34 2022 +0100 drm/amdgpu: add gang submit frontend v6 Allows submitting jobs as gang which needs to run on multiple engines at the same time. All members of the gang get the same implicit, explicit and VM dependencies. So no gang member will start running until everything else is ready. The last job is considered the gang leader (usually a submission to the GFX ring) and used for signaling output dependencies. Each job is remembered individually as user of a buffer object, so there is no joining of work at the end. v2: rebase and fix review comments from Andrey and Yogesh v3: use READ instead of BOOKKEEP for now because of VM unmaps, set gang leader only when necessary v4: fix order of pushing jobs and adding fences found by Trigger. v5: fix job index calculation and adding IBs to jobs v6: fix typo found by Alex Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 68ce8b242242651eb3cb4ff29b79c44d02f752c9 Author: Christian König Date: Wed Mar 2 16:26:53 2022 +0100 drm/amdgpu: add gang submit backend v2 Allows submitting jobs as gang which needs to run on multiple engines at the same time. Basic idea is that we have a global gang submit fence representing when the gang leader is finally pushed to run on the hardware last. Jobs submitted as gang are never re-submitted in case of a GPU reset since this won't work and will just deadlock the hardware immediately again. v2: fix logic inversion, improve documentation, fix rcu Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c05d789fed948ed6a45963ae0d5d79c67b87aebf Author: Christian König Date: Thu Jul 21 11:52:35 2022 +0200 drm/amdgpu: cleanup instance limit on VCN4 v4 Similar to what we did for VCN3 use the job instead of the parser entity. Cleanup the coding style quite a bit as well. v2: merge improved application check into this patch v3: finally fix the check v4: limit to the correct engine Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 16fb4dca95daa9d8e037201166a58de8284f4268 Author: Yury Zhuravlev Date: Sun Sep 18 16:23:15 2022 +0900 drm/amdgpu: getting fan speed pwm for vega10 properly Instead of using RPM speed, we will use a function from vega20 based on PWM registers. Reviewed-by: Evan Quan Signed-off-by: Yury Zhuravlev Signed-off-by: Alex Deucher commit 17df341d35265c8e14d71a48886fc7dcf92ef8a1 Author: Christophe JAILLET Date: Sun Sep 11 13:39:01 2022 +0200 headers: Remove some left-over license text Remove a left-over from commit 2874c5fd2842 ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152") There is no need for an empty "License:". Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/0e5ff727626b748238f4b78932f81572143d8f0b.1662896317.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 152e8ec7764056bc667d0291a2dd1ef4204e216c Author: Hangbin Liu Date: Tue Sep 20 11:30:47 2022 +0800 selftests/bonding: add a test for bonding lladdr target This is a regression test for commit 592335a4164c ("bonding: accept unsolicited NA message") and commit b7f14132bf58 ("bonding: use unspecified address if no available link local address"). When the bond interface up and no available link local address, unspecified address(::) is used to send the NS message. The unsolicited NA message should also be accepted for validation. Signed-off-by: Hangbin Liu Acked-by: Jonathan Toppins Link: https://lore.kernel.org/r/20220920033047.173244-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit 74b1b10e29b1f25e1a081fa82733baea65429d53 Author: Bob Peterson Date: Tue Aug 30 13:52:13 2022 -0500 gfs2: Register fs after creating workqueues Before this patch, the gfs2 file system was registered prior to creating the three workqueues. In some cases this allowed dlm to send recovery work to a workqueue that did not yet exist because gfs2 was still initializing. This patch changes the order of gfs2's initialization routine so it only registers the file system after the work queues are created. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 4633b39183c540d45bfd692fd3155c2e7e5838d0 Author: Yang Yingliang Date: Thu Sep 15 14:50:43 2022 +0800 net: mdio: mux-multiplexer: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220915065043.665138-3-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 770aac8dc05de86d3e56d8fa5a47d74c0d9ca50f Author: Yang Yingliang Date: Thu Sep 15 14:50:42 2022 +0800 net: mdio: mux-mmioreg: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220915065043.665138-2-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit de0665c871b7cdcf5661649c6bc5b863ece94a35 Author: Yang Yingliang Date: Thu Sep 15 14:50:41 2022 +0800 net: mdio: mux-meson-g12a: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220915065043.665138-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 1089877ada8d2da5f173922f1061ccfe721ebf56 Author: Biju Das Date: Wed Sep 14 20:26:04 2022 +0100 ravb: Add RZ/G2L MII interface support EMAC IP found on RZ/G2L Gb ethernet supports MII interface. This patch adds support for selecting MII interface mode. Signed-off-by: Biju Das Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20220914192604.265859-1-biju.das.jz@bp.renesas.com Signed-off-by: Jakub Kicinski commit a4abfa627c3865c37e036bccb681619a50d3d93c Author: Phil Sutter Date: Wed Sep 14 17:06:23 2022 +0200 net: rtnetlink: Enslave device before bringing it up Unlike with bridges, one can't add an interface to a bond and set it up at the same time: | # ip link set dummy0 down | # ip link set dummy0 master bond0 up | Error: Device can not be enslaved while up. Of all drivers with ndo_add_slave callback, bond and team decline if IFF_UP flag is set, vrf cycles the interface (i.e., sets it down and immediately up again) and the others just don't care. Support the common notion of setting the interface up after enslaving it by sorting the operations accordingly. Signed-off-by: Phil Sutter Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220914150623.24152-1-phil@nwl.cc Signed-off-by: Jakub Kicinski commit 5f4e25641c7103bd37888b025a563db8a75ea9bf Merge: 53ff25170980b 32cee7818111f Author: Jakub Kicinski Date: Tue Sep 20 08:33:07 2022 -0700 Merge branch 'macb-add-zynqmp-sgmii-dynamic-configuration-support' Radhey Shyam Pandey says: ==================== macb: add zynqmp SGMII dynamic configuration support This patchset add firmware and driver support to do SD/GEM dynamic configuration. In traditional flow GEM secure space configuration is done by FSBL. However in specific usescases like dynamic designs where GEM is not enabled in base vivado design, FSBL skips GEM initialization and we need a mechanism to configure GEM secure space in linux space at runtime. ==================== Link: https://lore.kernel.org/r/1663158796-14869-1-git-send-email-radhey.shyam.pandey@amd.com Signed-off-by: Jakub Kicinski commit 32cee7818111fa350e654b121b4eb6c9a3e580c5 Author: Radhey Shyam Pandey Date: Wed Sep 14 18:03:16 2022 +0530 net: macb: Add zynqmp SGMII dynamic configuration support Add support for the dynamic configuration which takes care of configuring the GEM secure space configuration registers using EEMI APIs. High level sequence is to: - Check for the PM dynamic configuration support, if no error proceed with GEM dynamic configurations(next steps) otherwise skip the dynamic configuration. - Configure GEM Fixed configurations. - Configure GEM_CLK_CTRL (gemX_sgmii_mode). - Trigger GEM reset. Signed-off-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Tested-by: Conor Dooley (for MPFS) Reviewed-by: Claudiu Beznea Signed-off-by: Jakub Kicinski commit 256dea9134c38fcc409ec7ea6a1eb67829b563bc Author: Ronak Jain Date: Wed Sep 14 18:03:15 2022 +0530 firmware: xilinx: add support for sd/gem config Add new APIs in firmware to configure SD/GEM registers. Internally it calls PM IOCTL for below SD/GEM register configuration: - SD/EMMC select - SD slot type - SD base clock - SD 8 bit support - SD fixed config - GEM SGMII Mode - GEM fixed config Signed-off-by: Ronak Jain Signed-off-by: Radhey Shyam Pandey Reviewed-by: Claudiu Beznea Signed-off-by: Jakub Kicinski commit 811908159e7ee583e30565018a08284cf5ddae77 Author: Andy Shevchenko Date: Wed Sep 14 18:37:55 2022 +0300 HSI: nokia-modem: Replace of_gpio_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Signed-off-by: Andy Shevchenko Signed-off-by: Sebastian Reichel commit b28dbcb379e6a7f80262c2732a57681b1ee548ca Author: Jianglei Nie Date: Mon Sep 5 15:48:01 2022 +0800 HSI: ssi_protocol: fix potential resource leak in ssip_pn_open() ssip_pn_open() claims the HSI client's port with hsi_claim_port(). When hsi_register_port_event() gets some error and returns a negetive value, the HSI client's port should be released with hsi_release_port(). Fix it by calling hsi_release_port() when hsi_register_port_event() fails. Signed-off-by: Jianglei Nie Signed-off-by: Sebastian Reichel commit 53ff25170980b16059010aa28fb5e0b3407a325a Author: ruanjinjie Date: Wed Sep 14 14:43:39 2022 +0800 xen-netfront: make bounce_skb static The symbol is not used outside of the file, so mark it static. Fixes the following warning: ./drivers/net/xen-netfront.c:676:16: warning: symbol 'bounce_skb' was not declared. Should it be static? Signed-off-by: ruanjinjie Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220914064339.49841-1-ruanjinjie@huawei.com Signed-off-by: Jakub Kicinski commit c31b38cb948ee7d3317139f005fa1f90de4a06b7 Author: Hou Tao Date: Mon Sep 19 22:48:11 2022 +0800 bpf: Check whether or not node is NULL before free it in free_bulk llnode could be NULL if there are new allocations after the checking of c-free_cnt > c->high_watermark in bpf_mem_refill() and before the calling of __llist_del_first() in free_bulk (e.g. a PREEMPT_RT kernel or allocation in NMI context). And it will incur oops as shown below: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT_RT SMP CPU: 39 PID: 373 Comm: irq_work/39 Tainted: G W 6.0.0-rc6-rt9+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:bpf_mem_refill+0x66/0x130 ...... Call Trace: irq_work_single+0x24/0x60 irq_work_run_list+0x24/0x30 run_irq_workd+0x18/0x20 smpboot_thread_fn+0x13f/0x2c0 kthread+0x121/0x140 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Simply fixing it by checking whether or not llnode is NULL in free_bulk(). Fixes: 8d5a8011b35d ("bpf: Batch call_rcu callbacks instead of SLAB_TYPESAFE_BY_RCU.") Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220919144811.3570825-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit b324c6e5e099229d5f715779be1492a5480be6df Author: Horatiu Vultur Date: Tue Sep 13 16:29:26 2022 +0200 net: phy: micrel: Add interrupts support for LAN8804 PHY Add support for interrupts for LAN8804 PHY. Tested-by: Michael Walle # on kontron-kswitch-d10 Reviewed-by: Andrew Lunn Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220913142926.816746-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit c3188dbafac5ced98861421b5ef8f370bad266e0 Merge: 7f32974bdc9d2 73472c830eae5 Author: Jakub Kicinski Date: Tue Sep 20 07:54:16 2022 -0700 Merge branch 'sfp-add-support-for-halny-gpon-module' Russell King says: ==================== sfp: add support for HALNy GPON module This series adds support for the HALNy GPON SFP module. In order to do this sensibly, we need a more flexible quirk system, since we need to change the behaviour of the SFP cage driver to ignore the LOS and TX_FAULT signals after module detection. Since we move the SFP quirks into the SFP cage driver, we can use it for the MA5671A and 3FE46541AA modules as well. ==================== Link: https://lore.kernel.org/r/YyDUnvM1b0dZPmmd@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 73472c830eae5fce2107f7f086f1e6827d215caf Author: Russell King (Oracle) Date: Tue Sep 13 20:06:48 2022 +0100 net: sfp: add support for HALNy GPON SFP Add a quirk for the HALNy HL-GSFP module, which appears to have an inverted RX_LOS signal, and maybe uses TX_FAULT as a serial port transmit pin. Rather than use these hardware signals, switch to using software polling for these status signals. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 5029be761161374a3624aa7b4670174c35449bf5 Author: Russell King (Oracle) Date: Tue Sep 13 20:06:42 2022 +0100 net: sfp: move Huawei MA5671A fixup Move this module over to the new fixup mechanism. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 275416754e9a262c97a1ad6f806a4bc6e0464aa2 Author: Russell King (Oracle) Date: Tue Sep 13 20:06:37 2022 +0100 net: sfp: move Alcatel Lucent 3FE46541AA fixup Add a new fixup mechanism to the SFP quirks, and use it for this module. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 23571c7b96437483d28a990c906cc81f5f66374e Author: Russell King (Oracle) Date: Tue Sep 13 20:06:32 2022 +0100 net: sfp: move quirk handling into sfp.c We need to handle more quirks than just those which affect the link modes of the module. Move the quirk lookup into sfp.c, and pass the quirk to sfp-bus.c Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 8475c4b70b040f9d8cbc308100f2c4d865f810b3 Author: Russell King (Oracle) Date: Tue Sep 13 20:06:27 2022 +0100 net: sfp: re-implement soft state polling setup Re-implement the decision making for soft state polling. Instead of generating the soft state mask in sfp_soft_start_poll() by looking at which GPIOs are available, record their availability in sfp_sm_mod_probe() in sfp->state_hw_mask. This will then allow us to clear bits in sfp->state_hw_mask in module specific quirks when the hardware signals should not be used, thereby allowing us to switch to using the software state polling. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 7f32974bdc9d2adcc54cc20fe227f0a000972dc6 Author: Vladimir Oltean Date: Tue Sep 13 15:58:06 2022 +0300 dt-bindings: net: dsa: convert ocelot.txt to dt-schema Replace the free-form description of device tree bindings for VSC9959 and VSC9953 with a YAML formatted dt-schema description. This contains more or less the same information, but reworded to be a bit more succint. Signed-off-by: Vladimir Oltean Reviewed-by: Maxim Kochetkov Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220913125806.524314-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 93ece9a6de84d5409c7c8a75057091be7ea84b25 Merge: 01544a272bbd1 dae4af6bf2325 Author: Jakub Kicinski Date: Tue Sep 20 07:45:51 2022 -0700 Merge branch 'net-ipa-a-mix-of-cleanups' Alex Elder says: ==================== net: ipa: a mix of cleanups This series contains a set of cleanups done in preparation for a more substantitive upcoming series that reworks how IPA registers and their fields are defined. The first eliminates about half of the possible GSI register constant symbols by removing offset definitions that are not currently required. The next two mainly rearrange code for some common enumerated types. The next one fixes two spots that reuse local variable names in inner scopes when defining offsets. The next adds some additional restrictions on the value held in a register. And the last one just fixes two field mask symbol names so they adhere to the common naming convention. ==================== Link: https://lore.kernel.org/r/20220910011131.1431934-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit dae4af6bf23259ed8d815249bdfdf35d90c19e6f Author: Alex Elder Date: Fri Sep 9 20:11:31 2022 -0500 net: ipa: fix two symbol names All field mask symbols are defined with a "_FMASK" suffix, but EOT_COAL_GRANULARITY and DRBIP_ACL_ENABLE are defined without one. Fix that. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit a14d593724c44098caf7fa5298ce4850af6ab9e0 Author: Alex Elder Date: Fri Sep 9 20:11:30 2022 -0500 net: ipa: update sequencer definition constraints Starting with IPA v4.5, replication is done differently from before, and as a result the "replication" portion of the how the sequencer is specified must be zero. Add a check for the configuration data failing that requirement, and only update the sesquencer type value when it's supported. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 9eefd2fb966da7034528ce9bfc8a7fc03869f589 Author: Alex Elder Date: Fri Sep 9 20:11:29 2022 -0500 net: ipa: don't reuse variable names In ipa_endpoint_init_hdr(), as well as ipa_endpoint_init_hdr_ext(), a top-level automatic variable named "offset" is used to represent the offset of a register. However, deeper within each of those functions is *another* definition of a local variable with the same name, representing something else. Scoping rules ensure the result is what was intended, but this variable name reuse is bad practice and makes the code confusing. Fix this by naming the inner variable "off". Use "off" instead of "checksum_offset" in ipa_endpoint_init_cfg() for consistency. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 8b3cb084b23e0a8ab7ce748c7f27ba828b74cde9 Author: Alex Elder Date: Fri Sep 9 20:11:28 2022 -0500 net: ipa: move and redefine ipa_version_valid() Move the definition of ipa_version_valid(), making it a static inline function defined together with the enumerated type in "ipa_version.h". Define a new count value in the type. Rename the function to be ipa_version_supported(), and have it return true only if the IPA version supplied is explicitly supported by the driver. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit bb788de30a74facb920448bb129d345eb0294b13 Author: Alex Elder Date: Fri Sep 9 20:11:27 2022 -0500 net: ipa: move the definition of gsi_ee_id Move the definition of the gsi_ee_id enumerated type out of "gsi.h" and into "ipa_version.h". That latter header file isolates the definition of the ipa_version enumerated type, allowing it to be included in both IPA and GSI code. We have the same requirement for gsi_ee_id, and moving it here makes it easier to get only that definition without everything else defined in "gsi.h". Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 5ea4285829de7aa823d60d7338668fb821bb1753 Author: Alex Elder Date: Fri Sep 9 20:11:26 2022 -0500 net: ipa: don't define unneeded GSI register offsets Each GSI execution environment (EE) is able to access many of the GSI registers associated with the other EEs. A block of GSI registers is contained within a region of memory, and an EE's register offset can be determined by adding the register's base offset to the product of the EE ID and a fixed constant. Despite this possibility, the AP IPA code *never* accesses any GSI registers other than its own. So there's no need to define the macros that compute register offsets for other EEs. Redefine the AP access macros to compute the offset the way the more general "any EE" macro would, and get rid of the unneeded macros. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit a7609c68f7a117a77b3049c2353f555854be69e9 Author: Li zeming Date: Mon Sep 19 09:28:25 2022 +0800 blk-iocost: Remove unnecessary (void*) conversions The key pointer is void and hence does not need an explicit cast. Signed-off-by: Li zeming Link: https://lore.kernel.org/r/20220919012825.2936-1-zeming@nfschina.com Signed-off-by: Jens Axboe commit 118f3663fbc658e9ad6165e129076981c7b685c5 Author: Christoph Hellwig Date: Thu Sep 15 10:42:00 2022 +0100 block: remove PSI accounting from the bio layer PSI accounting is now done by the VM code, where it should have been since the beginning. Signed-off-by: Christoph Hellwig Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220915094200.139713-6-hch@lst.de Signed-off-by: Jens Axboe commit 99486c511f686c799bb4e60b79d79808bb9440f4 Author: Christoph Hellwig Date: Thu Sep 15 10:41:59 2022 +0100 erofs: add manual PSI accounting for the compressed address space erofs uses an additional address space for compressed data read from disk in addition to the one directly associated with the inode. Reading into the lower address space is open coded using add_to_page_cache_lru instead of using the filemap.c helper for page allocation micro-optimizations, which means it is not covered by the MM PSI annotations for ->read_folio and ->readahead, so add manual ones instead. Signed-off-by: Christoph Hellwig Acked-by: Johannes Weiner Acked-by: Gao Xiang Link: https://lore.kernel.org/r/20220915094200.139713-5-hch@lst.de Signed-off-by: Jens Axboe commit 4088a47e78f95a5fea683cf67e0be006b13831fd Author: Christoph Hellwig Date: Thu Sep 15 10:41:58 2022 +0100 btrfs: add manual PSI accounting for compressed reads btrfs compressed reads try to always read the entire compressed chunk, even if only a subset is requested. Currently this is covered by the magic PSI accounting underneath submit_bio, but that is about to go away. Instead add manual psi_memstall_{enter,leave} annotations. Note that for readahead this really should be using readahead_expand, but the additionals reads are also done for plain ->read_folio where readahead_expand can't work, so this overall logic is left as-is for now. Signed-off-by: Christoph Hellwig Acked-by: David Sterba Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220915094200.139713-4-hch@lst.de Signed-off-by: Jens Axboe commit 527eb453bbfe65e5a55a90edfb1f30b477e36b8c Author: Christoph Hellwig Date: Thu Sep 15 10:41:57 2022 +0100 sched/psi: export psi_memstall_{enter,leave} To properly account for all refaults from file system logic, file systems need to call psi_memstall_enter directly, so export it. Signed-off-by: Christoph Hellwig Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220915094200.139713-3-hch@lst.de Signed-off-by: Jens Axboe commit 176042404ee6a96ba7e9054e1bda6220360a26ad Author: Christoph Hellwig Date: Thu Sep 15 10:41:56 2022 +0100 mm: add PSI accounting around ->read_folio and ->readahead calls PSI tries to account for the cost of bringing back in pages discarded by the MM LRU management. Currently the prime place for that is hooked into the bio submission path, which is a rather bad place: - it does not actually account I/O for non-block file systems, of which we have many - it adds overhead and a layering violation to the block layer Add the accounting into the two places in the core MM code that read pages into an address space by calling into ->read_folio and ->readahead so that the entire file system operations are covered, to broaden the coverage and allow removing the accounting in the block layer going forward. As psi_memstall_enter can deal with nested calls this will not lead to double accounting even while the bio annotations are still present. Signed-off-by: Christoph Hellwig Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220915094200.139713-2-hch@lst.de Signed-off-by: Jens Axboe commit e88480871b8d5a6bd14be2817063363202d282b9 Author: Ping-Xiang Chen Date: Wed Sep 14 00:42:37 2022 -0700 block: fix comment typo in submit_bio of block-core.c. This patch fix a comment typo in block-core.c. Signed-off-by: Ping-Xiang Chen Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220914074237.31621-1-p.x.chen@uci.edu Signed-off-by: Jens Axboe commit 5768adcb35ba57459630c2009e900692cecfc78e Author: Ibrahim Tilki Date: Sat Sep 10 20:19:45 2022 +0300 MAINTAINERS: Add maintainer for hwmon/max31760 Add maintainer for hwmon/max31760 driver Signed-off-by: Ibrahim Tilki Link: https://lore.kernel.org/r/20220910171945.48088-5-Ibrahim.Tilki@analog.com Signed-off-by: Guenter Roeck commit 479d14cfe508c595fac7f95b140aaa6f6a3d8f2c Author: Ibrahim Tilki Date: Sat Sep 10 20:19:44 2022 +0300 dt-bindings: hwmon: Add bindings for max31760 Adding bindings for Analog Devices MAX31760 Fan-Speed Controller Signed-off-by: Ibrahim Tilki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910171945.48088-4-Ibrahim.Tilki@analog.com Signed-off-by: Guenter Roeck commit 5258b80e60da6d8908ae2846b234ed8d9d9d4a19 Author: Jiri Slaby Date: Tue Sep 6 09:11:23 2022 +0200 x86/dumpstack: Don't mention RIP in "Code: " Commit 238c91115cd0 ("x86/dumpstack: Fix misleading instruction pointer error message") changed the "Code:" line in bug reports when RIP is an invalid pointer. In particular, the report currently says (for example): BUG: kernel NULL pointer dereference, address: 0000000000000000 ... RIP: 0010:0x0 Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. That Unable to access opcode bytes at RIP 0xffffffffffffffd6. is quite confusing as RIP value is 0, not -42. That -42 comes from "regs->ip - PROLOGUE_SIZE", because Code is dumped with some prologue (and epilogue). So do not mention "RIP" on this line in this context. Signed-off-by: Jiri Slaby Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/b772c39f-c5ae-8f17-fe6e-6a2bc4d1f83b@kernel.org commit 8e27c2fd61bb994e28e5e1d95a84e02b14c8fdc4 Author: Ibrahim Tilki Date: Sat Sep 10 20:19:43 2022 +0300 docs: hwmon: add max31760 documentation Adding documentation for max31760 fan speed controller Signed-off-by: Ibrahim Tilki Link: https://lore.kernel.org/r/20220910171945.48088-3-Ibrahim.Tilki@analog.com Signed-off-by: Guenter Roeck commit 38b04ad02d0da956b697ff93c5c23e21cdb4cddc Author: Ibrahim Tilki Date: Sat Sep 10 20:19:42 2022 +0300 drivers: hwmon: Add max31760 fan speed controller driver MAX31760 is a precision fan speed controller with nonvolatile lookup table. Device has one internal and one external temperature sensor support. Controls two fans and measures their speeds. Generates hardware alerts when programmable max and critical temperatures are exceeded. Signed-off-by: Ibrahim Tilki Reviewed-by: Nurettin Bolucu Link: https://lore.kernel.org/r/20220910171945.48088-2-Ibrahim.Tilki@analog.com Signed-off-by: Guenter Roeck commit 361c1ca384c93013e08bd117e4fe23ca9739e3f7 Merge: 971479115444e 0ea76c401f924 Author: Bartosz Golaszewski Date: Tue Sep 20 16:00:41 2022 +0200 Merge tag 'intel-gpio-v6.1-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v6.1-1 * Add a quirk for Asus UM325UAZ to make GPIO interrupts working commit 77571ba60ea41e25ddf6b92c5a1e33149f9a3603 Merge: d2d05b88035d2 02c57a82c0081 Author: Jens Axboe Date: Tue Sep 20 07:50:14 2022 -0600 Merge tag 'nvme-6.1-2022-09-20' of git://git.infradead.org/nvme into for-6.1/block Pull NVMe updates from Christoph: "nvme updates for Linux 6.1 - handle number of queue changes in the TCP and RDMA drivers (Daniel Wagner) - allow changing the number of queues in nvmet (Daniel Wagner) - also consider host_iface when checking ip options (Daniel Wagner) - don't map pages which can't come from HIGHMEM (Fabio M. De Francesco) - avoid unnecessary flush bios in nvmet (Guixin Liu) - shrink and better pack the nvme_iod structure (Keith Busch) - add comment for unaligned "fake" nqn (Linjun Bao) - print actual source IP address through sysfs "address" attr (Martin Belanger) - various cleanups (Jackie Liu, Wolfram Sang, Genjian Zhang)" * tag 'nvme-6.1-2022-09-20' of git://git.infradead.org/nvme: nvme-tcp: print actual source IP address through sysfs "address" attr nvmet-tcp: don't map pages which can't come from HIGHMEM nvme-pci: move iod dma_len fill gaps nvme-pci: iod npages fits in s8 nvme-pci: iod's 'aborted' is a bool nvme-pci: remove nvme_queue from nvme_iod nvme: consider also host_iface when checking ip options nvme-rdma: handle number of queue changes nvme-tcp: handle number of queue changes nvmet: expose max queues to configfs nvmet: avoid unnecessary flush bio nvmet-auth: remove redundant parameters req nvmet-auth: clean up with done_kfree nvme-auth: remove the redundant req->cqe->result.u16 assignment operation nvme: move from strlcpy with unused retval to strscpy nvme: add comment for unaligned "fake" nqn commit fdb6649ab7c142e497539a471e573c2593b9c923 Author: Vincent Mailhol Date: Wed Sep 7 18:09:35 2022 +0900 x86/asm/bitops: Use __builtin_ctzl() to evaluate constant expressions If x is not 0, __ffs(x) is equivalent to: (unsigned long)__builtin_ctzl(x) And if x is not ~0UL, ffz(x) is equivalent to: (unsigned long)__builtin_ctzl(~x) Because __builting_ctzl() returns an int, a cast to (unsigned long) is necessary to avoid potential warnings on implicit casts. Concerning the edge cases, __builtin_ctzl(0) is always undefined, whereas __ffs(0) and ffz(~0UL) may or may not be defined, depending on the processor. Regardless, for both functions, developers are asked to check against 0 or ~0UL so replacing __ffs() or ffz() by __builting_ctzl() is safe. For x86_64, the current __ffs() and ffz() implementations do not produce optimized code when called with a constant expression. On the contrary, the __builtin_ctzl() folds into a single instruction. However, for non constant expressions, the __ffs() and ffz() asm versions of the kernel remains slightly better than the code produced by GCC (it produces a useless instruction to clear eax). Use __builtin_constant_p() to select between the kernel's __ffs()/ffz() and the __builtin_ctzl() depending on whether the argument is constant or not. ** Statistics ** On a allyesconfig, before...: $ objdump -d vmlinux.o | grep tzcnt | wc -l 3607 ...and after: $ objdump -d vmlinux.o | grep tzcnt | wc -l 2600 So, roughly 27.9% of the calls to either __ffs() or ffz() were using constant expressions and could be optimized out. (tests done on linux v5.18-rc5 x86_64 using GCC 11.2.1) Note: on x86_64, the BSF instruction produces TZCNT when used with the REP prefix (which explain the use of `grep tzcnt' instead of `grep bsf' in above benchmark). c.f. [1] [1] e26a44a2d618 ("x86: Use REP BSF unconditionally") [ bp: Massage commit message. ] Signed-off-by: Vincent Mailhol Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Reviewed-by: Yury Norov Link: https://lore.kernel.org/r/20220511160319.1045812-1-mailhol.vincent@wanadoo.fr commit 146034fed6ee75ec09cf8f996165e2296ceae0bb Author: Vincent Mailhol Date: Wed Sep 7 18:09:34 2022 +0900 x86/asm/bitops: Use __builtin_ffs() to evaluate constant expressions For x86_64, the current ffs() implementation does not produce optimized code when called with a constant expression. On the contrary, the __builtin_ffs() functions of both GCC and clang are able to fold the expression into a single instruction. ** Example ** Consider two dummy functions foo() and bar() as below: #include #define CONST 0x01000000 unsigned int foo(void) { return ffs(CONST); } unsigned int bar(void) { return __builtin_ffs(CONST); } GCC would produce below assembly code: 0000000000000000 : 0: ba 00 00 00 01 mov $0x1000000,%edx 5: b8 ff ff ff ff mov $0xffffffff,%eax a: 0f bc c2 bsf %edx,%eax d: 83 c0 01 add $0x1,%eax 10: c3 ret 0000000000000020 : 20: b8 19 00 00 00 mov $0x19,%eax 25: c3 ret And clang would produce: 0000000000000000 : 0: b8 ff ff ff ff mov $0xffffffff,%eax 5: 0f bc 05 00 00 00 00 bsf 0x0(%rip),%eax # c c: 83 c0 01 add $0x1,%eax f: c3 ret 0000000000000010 : 10: b8 19 00 00 00 mov $0x19,%eax 15: c3 ret Both examples clearly demonstrate the benefit of using __builtin_ffs() instead of the kernel's asm implementation for constant expressions. However, for non constant expressions, the kernel's ffs() asm version remains better for x86_64 because, contrary to GCC, it doesn't emit the CMOV assembly instruction, c.f. [1] (noticeably, clang is able optimize out the CMOV call). Use __builtin_constant_p() to select between the kernel's ffs() and the __builtin_ffs() depending on whether the argument is constant or not. As a side benefit, replacing the ffs() function declaration by a macro also removes below -Wshadow warning: ./arch/x86/include/asm/bitops.h:283:28: warning: declaration of 'ffs' shadows a built-in function [-Wshadow] 283 | static __always_inline int ffs(int x) ** Statistics ** On a allyesconfig, before...: $ objdump -d vmlinux.o | grep bsf | wc -l 1081 ...and after: $ objdump -d vmlinux.o | grep bsf | wc -l 792 So, roughly 26.7% of the calls to ffs() were using constant expressions and could be optimized out. (tests done on linux v5.18-rc5 x86_64 using GCC 11.2.1) [1] commit ca3d30cc02f7 ("x86_64, asm: Optimise fls(), ffs() and fls64()") [ bp: Massage commit message. ] Signed-off-by: Vincent Mailhol Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Reviewed-by: Yury Norov Link: https://lore.kernel.org/r/20220511160319.1045812-1-mailhol.vincent@wanadoo.fr commit 01544a272bbd1fbf1d2510e575fc494a80994948 Merge: cec9d59e89362 9fd12e869e17c Author: Paolo Abeni Date: Tue Sep 20 15:00:32 2022 +0200 Merge branch 'net-ethernet-adi-add-adin1110-support' Alexandru Tachici says: ==================== net: ethernet: adi: Add ADIN1110 support The ADIN1110 is a low power single port 10BASE-T1L MAC-PHY designed for industrial Ethernet applications. It integrates an Ethernet PHY core with a MAC and all the associated analog circuitry, input and output clock buffering. ADIN1110 MAC-PHY encapsulates the ADIN1100 PHY. The PHY registers can be accessed through the MDIO MAC registers. We are registering an MDIO bus with custom read/write in order to let the PHY to be discovered by the PAL. This will let the ADIN1100 Linux driver to probe and take control of the PHY. The ADIN2111 is a low power, low complexity, two-Ethernet ports switch with integrated 10BASE-T1L PHYs and one serial peripheral interface (SPI) port. The device is designed for industrial Ethernet applications using low power constrained nodes and is compliant with the IEEE 802.3cg-2019 Ethernet standard for long reach 10 Mbps single pair Ethernet (SPE). The switch supports various routing configurations between the two Ethernet ports and the SPI host port providing a flexible solution for line, daisy-chain, or ring network topologies. The ADIN2111 supports cable reach of up to 1700 meters with ultra low power consumption of 77 mW. The two PHY cores support the 1.0 V p-p operating mode and the 2.4 V p-p operating mode defined in the IEEE 802.3cg standard. The device integrates the switch, two Ethernet physical layer (PHY) cores with a media access control (MAC) interface and all the associated analog circuitry, and input and output clock buffering. The device also includes internal buffer queues, the SPI and subsystem registers, as well as the control logic to manage the reset and clock control and hardware pin configuration. Access to the PHYs is exposed via an internal MDIO bus. Writes/reads can be performed by reading/writing to the ADIN2111 MDIO registers via SPI. On probe, for each port, a struct net_device is allocated and registered. When both ports are added to the same bridge, the driver will enable offloading of frame forwarding at the hardware level. Driver offers STP support. Normal operation on forwarding state. Allows only frames with the 802.1d DA to be passed to the host when in any of the other states. When both ports of ADIN2111 belong to the same SW bridge a maximum of 12 FDB entries will offloaded by the hardware and are marked as such. ==================== Link: https://lore.kernel.org/r/20220913122629.124546-1-andrei.tachici@stud.acs.upb.ro Signed-off-by: Paolo Abeni commit 9fd12e869e17c126972719e65a09698ab22cdfb2 Author: Alexandru Tachici Date: Tue Sep 13 15:26:29 2022 +0300 dt-bindings: net: adin1110: Add docs Add bindings for the ADIN1110/2111 MAC-PHY/SWITCH. Reviewed-by: Rob Herring Signed-off-by: Alexandru Tachici Signed-off-by: Paolo Abeni commit bc93e19d088bb14e116756ab270deea6ee62d782 Author: Alexandru Tachici Date: Tue Sep 13 15:26:28 2022 +0300 net: ethernet: adi: Add ADIN1110 support The ADIN1110 is a low power single port 10BASE-T1L MAC-PHY designed for industrial Ethernet applications. It integrates an Ethernet PHY core with a MAC and all the associated analog circuitry, input and output clock buffering. ADIN1110 MAC-PHY encapsulates the ADIN1100 PHY. The PHY registers can be accessed through the MDIO MAC registers. We are registering an MDIO bus with custom read/write in order to let the PHY to be discovered by the PAL. This will let the ADIN1100 Linux driver to probe and take control of the PHY. The ADIN2111 is a low power, low complexity, two-Ethernet ports switch with integrated 10BASE-T1L PHYs and one serial peripheral interface (SPI) port. The device is designed for industrial Ethernet applications using low power constrained nodes and is compliant with the IEEE 802.3cg-2019 Ethernet standard for long reach 10 Mbps single pair Ethernet (SPE). The switch supports various routing configurations between the two Ethernet ports and the SPI host port providing a flexible solution for line, daisy-chain, or ring network topologies. The ADIN2111 supports cable reach of up to 1700 meters with ultra low power consumption of 77 mW. The two PHY cores support the 1.0 V p-p operating mode and the 2.4 V p-p operating mode defined in the IEEE 802.3cg standard. The device integrates the switch, two Ethernet physical layer (PHY) cores with a media access control (MAC) interface and all the associated analog circuitry, and input and output clock buffering. The device also includes internal buffer queues, the SPI and subsystem registers, as well as the control logic to manage the reset and clock control and hardware pin configuration. Access to the PHYs is exposed via an internal MDIO bus. Writes/reads can be performed by reading/writing to the ADIN2111 MDIO registers via SPI. On probe, for each port, a struct net_device is allocated and registered. When both ports are added to the same bridge, the driver will enable offloading of frame forwarding at the hardware level. Driver offers STP support. Normal operation on forwarding state. Allows only frames with the 802.1d DA to be passed to the host when in any of the other states. When both ports of ADIN2111 belong to the same SW bridge a maximum of 12 FDB entries will offloaded by the hardware and are marked as such. Co-developed-by: Lennart Franzen Signed-off-by: Lennart Franzen Signed-off-by: Alexandru Tachici Signed-off-by: Paolo Abeni commit 875b718ac380eeb84e452be6a83cdbb8452a2bcb Author: Alexandru Tachici Date: Tue Sep 13 15:26:27 2022 +0300 net: phy: adin1100: add PHY IDs of adin1110/adin2111 Add additional PHY IDs for the internal PHYs of adin1110 and adin2111. Reviewed-by: Andrew Lunn Signed-off-by: Alexandru Tachici Signed-off-by: Paolo Abeni commit 7360d55ba1993cb59267507d04b7e62c40bad424 Merge: 7aa429e8d40ed f62e3f595c5f0 Author: Georgi Djakov Date: Tue Sep 20 15:57:00 2022 +0300 Merge branch 'icc-ignore-return-val' into icc-next Today remove callbacks of platform devices return an int. This is unfortunate because the device core ignores the return value and so the platform code only emits a warning (and still removes the device). The longterm quest is to make these remove callbacks return void instead. This series is a preparation for that, with the goal to make the remove callbacks obviously always return 0. This way when the prototype of these functions is changed to return void, the change is straight forward and easy to review. Link: https://lore.kernel.org/r/20220718121409.171773-1-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 7aa429e8d40ed7e8ab3c0ff5e2836c051ab2434a Author: Huang Yiwei Date: Wed Sep 14 14:41:22 2022 +0800 interconnect: qcom: Kconfig: Make INTERCONNECT_QCOM tristate Make INTERCONNECT_QCOM tristate so that icc-common.c can be compiled as a module. Signed-off-by: Huang Yiwei Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220914064122.16222-1-quic_hyiwei@quicinc.com Signed-off-by: Georgi Djakov commit 259cee1c2422bcff7ba6bb4e8179faadb52ebdee Author: Oded Gabbay Date: Tue Sep 20 00:08:40 2022 +0300 habanalabs: eliminate aggregate use warning When doing sizeof() and giving as argument a dereference of a pointer-to-a-pointer object, clang will issue a warning. Eliminate the warning by passing struct * Signed-off-by: Oded Gabbay commit e403856468456aeaff68a5cb0a851d945c133ed9 Author: Tomer Tayar Date: Mon Sep 19 18:46:03 2022 +0300 habanalabs/gaudi: use 8KB aligned address for TPC kernels I$ prefetch is enabled when sending a TPC kernel to initialize the TPC memory, and it has a restriction that the base address will be aligned to 8KB. Currently the base address is 128 bytes from the start address of the device SRAM, so prefetching will start 128 bytes before the actual kernel memory. Modify the kernel address to be 8KB aligned. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cacdb14b1c8d3804a3a7d31773bc7569837b71a4 Author: Hyunwoo Kim Date: Sun Sep 4 12:31:15 2022 -0700 HID: roccat: Fix use-after-free in roccat_read() roccat_report_event() is responsible for registering roccat-related reports in struct roccat_device. int roccat_report_event(int minor, u8 const *data) { struct roccat_device *device; struct roccat_reader *reader; struct roccat_report *report; uint8_t *new_value; device = devices[minor]; new_value = kmemdup(data, device->report_size, GFP_ATOMIC); if (!new_value) return -ENOMEM; report = &device->cbuf[device->cbuf_end]; /* passing NULL is safe */ kfree(report->value); ... The registered report is stored in the struct roccat_device member "struct roccat_report cbuf[ROCCAT_CBUF_SIZE];". If more reports are received than the "ROCCAT_CBUF_SIZE" value, kfree() the saved report from cbuf[0] and allocates a new reprot. Since there is no lock when this kfree() is performed, kfree() can be performed even while reading the saved report. static ssize_t roccat_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct roccat_reader *reader = file->private_data; struct roccat_device *device = reader->device; struct roccat_report *report; ssize_t retval = 0, len; DECLARE_WAITQUEUE(wait, current); mutex_lock(&device->cbuf_lock); ... report = &device->cbuf[reader->cbuf_start]; /* * If report is larger than requested amount of data, rest of report * is lost! */ len = device->report_size > count ? count : device->report_size; if (copy_to_user(buffer, report->value, len)) { retval = -EFAULT; goto exit_unlock; } ... The roccat_read() function receives the device->cbuf report and delivers it to the user through copy_to_user(). If the N+ROCCAT_CBUF_SIZE th report is received while copying of the Nth report->value is in progress, the pointer that copy_to_user() is working on is kfree()ed and UAF read may occur. (race condition) Since the device node of this driver does not set separate permissions, this is not a security vulnerability, but because it is used for requesting screen display of profile or dpi settings, a user using the roccat device can apply udev to this device node or There is a possibility to use it by giving. Signed-off-by: Hyunwoo Kim Signed-off-by: Jiri Kosina commit 6b9b9e244fdd0d6c5ee21b7b9d74282d9e43733a Author: farah kassabri Date: Tue Aug 30 13:01:03 2022 +0300 habanalabs: remove some f/w descriptor validations To be forward-backward compatible with the firmware in the initial communication during preboot, we need to remove the validation of the header size. This will allow us to add more fields to the lkd_fw_comms_desc structure. Instead of the validation of the header size, we just print warning when some mismatch in descriptor has been revealed, and we calculate the CRC base on descriptor size reported by the firmware instead of calculating it ourselves. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 8412bb69ed789464adadf7f0906971c7be29e204 Author: Ohad Sharabi Date: Thu Sep 15 09:19:03 2022 +0300 habanalabs: build ASICs from new to old Newer ASICs code changes more often, has more chance to fail compilation. So, let's compile them first so errors in those files will fail compilation sooner. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit aa8c8cd047467d4573ce042a76ba74191ddda7b4 Author: ye xingchen Date: Tue Sep 20 06:46:48 2022 +0000 mmc: rtsx_usb_sdmmc: Remove the unneeded result variable Return the value rtsx_usb_send_cmd() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220920064648.215375-1-ye.xingchen@zte.com.cn Signed-off-by: Ulf Hansson commit a241d94bb532dcfb7ef3f723e6a0a0e7cf8f10ea Author: Ard Biesheuvel Date: Wed Sep 14 16:14:18 2022 +0200 efi: libstub: fix type confusion for load_options_size Even though it is unlikely to ever make a difference, let's use u32 consistently for the size of the load_options provided by the firmware (aka the command line) While at it, do some general cleanup too: use efi_char16_t, avoid using options_chars in places where it really means options_size, etc. Signed-off-by: Ard Biesheuvel commit 670f8ce56dd0632dc29a0322e188cc73ce3c6b92 Author: Andrew Price Date: Wed Aug 17 13:22:00 2022 +0100 gfs2: Check sb_bsize_shift after reading superblock Fuzzers like to scribble over sb_bsize_shift but in reality it's very unlikely that this field would be corrupted on its own. Nevertheless it should be checked to avoid the possibility of messy mount errors due to bad calculations. It's always a fixed value based on the block size so we can just check that it's the expected value. Tested with: mkfs.gfs2 -O -p lock_nolock /dev/vdb for i in 0 -1 64 65 32 33; do gfs2_edit -p sb field sb_bsize_shift $i /dev/vdb mount /dev/vdb /mnt/test && umount /mnt/test done Before this patch we get a withdraw after [ 76.413681] gfs2: fsid=loop0.0: fatal: invalid metadata block [ 76.413681] bh = 19 (type: exp=5, found=4) [ 76.413681] function = gfs2_meta_buffer, file = fs/gfs2/meta_io.c, line = 492 and with UBSAN configured we also get complaints like [ 76.373395] UBSAN: shift-out-of-bounds in fs/gfs2/ops_fstype.c:295:19 [ 76.373815] shift exponent 4294967287 is too large for 64-bit type 'long unsigned int' After the patch, these complaints don't appear, mount fails immediately and we get an explanation in dmesg. Reported-by: syzbot+dcf33a7aae997956fe06@syzkaller.appspotmail.com Signed-off-by: Andrew Price Signed-off-by: Andreas Gruenbacher commit 4b46a6079d2f8a9aa23c96227dfdb8692ac10421 Author: Hangyu Hua Date: Fri Sep 9 10:29:43 2022 +0800 RDMA/srpt: Use flex array destination for memcpy() In preparation for FORTIFY_SOURCE performing run-time destination buffer bounds checking for memcpy(), specify the destination output buffer explicitly, instead of asking memcpy() to write past the end of what looked like a fixed-size object. Notice that srp_rsp[] is a pointer to a structure that contains flexible-array member data[]: struct srp_rsp { ... __be32 sense_data_len; __be32 resp_data_len; u8 data[]; }; link: https://github.com/KSPP/linux/issues/201 Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220909022943.8896-1-hbh25y@gmail.com Reviewed-by: Bart Van Assche Reviewed-by: Gustavo A. R. Silva Signed-off-by: Leon Romanovsky commit 8e3392d340a189619aa701cd5d3b613cf0ce91f0 Merge: 01a72aefbacca 79764ec772bc1 Author: Takashi Iwai Date: Tue Sep 20 13:43:56 2022 +0200 Merge branch 'for-linus' into for-next commit 01a72aefbacca4d6e169caa776c87d3c1f6faf4a Author: Takashi Iwai Date: Tue Sep 20 13:42:43 2022 +0200 Revert "ALSA: usb-audio: Clean up endpoint setups at PCM prepare" This reverts commit 32eeeed963ad4f41b422b3e314d96ded7283b201. As the fix for endpoint configuration split is reverted at next, do another revert here for a clean patch application. Signed-off-by: Takashi Iwai commit 96ecdc718649fe01940e7f5dc4fc15dacd18cada Author: ye xingchen Date: Tue Sep 20 06:46:05 2022 +0000 ALSA: es18xx: Remove the unneeded result variable Return the value inb() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220920064605.215318-1-ye.xingchen@zte.com.cn Signed-off-by: Takashi Iwai commit 13f42e5166bc73786d21b5fae13ff89e67dcbe8b Author: Cheng Xu Date: Fri Sep 9 17:38:21 2022 +0800 RDMA/erdma: Make hardware internal opcodes invisible to driver Some opcodes are used in hardware internally, and driver does not care about them. So, we change them to reserved opcodes in driver. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20220909093822.33868-4-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 93aea72cc53c87de3bae3fe554f9836d8b4a0386 Author: Cheng Xu Date: Fri Sep 9 17:38:20 2022 +0800 RDMA/erdma: Remove redundant includes Many of erdma's includes are redundant, because they are already included indirectly by kernel headers or custom headers. So we remove all the unnecessary direct-includes. Besides, add linux/pci.h to erdma.h because it's also used in the file. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20220909093822.33868-3-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 95f911d94995861311d78c77acb91af1ad6b8cc5 Author: Cheng Xu Date: Fri Sep 9 17:38:19 2022 +0800 RDMA/erdma: Eliminate unnecessary casting for erdma_post_cmd_wait erdma_post_cmd_wait does not use the 'u64 *req' input parameter directly. So it is better to define it to 'void *req', and by this we can eliminate the casting when calling erdma_post_cmd_wait. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20220909093822.33868-2-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 9f27530a7357c69865da6177db02d3eb230c33a1 Merge: 3c193b5f530e3 ac088c31d496b Author: Mark Brown Date: Tue Sep 20 12:26:03 2022 +0100 Support for CS42L83 on Apple machines Merge series from Martin Povišer : there's a CS42L83 headphone jack codec found in Apple computers (in the recent 'Apple Silicon' ones as well as in earlier models, one example [1]). The part isn't publicly documented, but it appears almost identical to CS42L42, for which we have a driver in kernel. This series adapts the CS42L42 driver to the new part, and makes one change in anticipation of a machine driver for the Apple computers. Patch 1 adds new compatible to the cs42l42 schema. Patches 2 to 7 are taken from Richard's recent series [2] adding soundwire support to cs42l42. They are useful refactorings to build on in the later patches, and also this way our work doesn't diverge. (I fixed missing free_irq path in cs42l42_init, did s/Soundwire/SoundWire/ in changelogs, rebased.) Patch 8 exports some regmap-related symbols from cs42l42.c so they can be used to create cs42l83 regmap in cs42l83-i2c.c later. Patch 9 is the cs42l83 support proper. Patch 10 implements 'set_bclk_ratio' on the cs42l42 core. This will be called by the upcoming ASoC machine driver for 'Apple Silicon' Macs. (We have touched on this change to be made in earlier discussion, see [3] and replies.) Patch 11 brings cs42l42-i2c.c in sync with cs42l83-i2c.c on dev_err_probe() usage. commit 3c193b5f530e32dfb4aeb845678ed30aa60b67c1 Merge: 78091edc1c780 d9252772cdc81 Author: Mark Brown Date: Tue Sep 20 12:25:56 2022 +0100 ASoC: SOF: Intel: override mclk_id for ES8336 support Merge series from Pierre-Louis Bossart : This patchset solves a known issue with ES8336 platforms wrt MCLK selection. Most of the devices use the MCLK0 signal, but some devices do use the MCLK1 signal. The MCLK is defined in the topology, it would be a nightmare to generate more topology files just for one MCLK difference. With a minor extension to the intel-nhlt library, the MCLK information can be found by parsing the NHLT table, and we can override the mclk_id at boot time. The only known issues for this platform remain the detection of GPIO and microphone connections, currently only possible with manual quirks. Thanks to Eugene J. Markow for testing this patchset. commit d9252772cdc811beedabbcf21ef856d09b87d1dd Author: Pierre-Louis Bossart Date: Mon Sep 19 13:53:50 2022 +0200 ASoC: SOF: Intel: hda: override mclk_id after parsing NHLT SSP blob The NHLT is already used to determine which SSP is connected to an audio codec, we can parse the SSP blob to get the mclk_id from NHLT. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220919115350.43104-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 72176fccd5de1d9cf61e42771bb00567723f3353 Author: Pierre-Louis Bossart Date: Mon Sep 19 13:53:49 2022 +0200 ALSA: hda: intel-nhlt: add intel_nhlt_ssp_mclk_mask() SOF topologies hard-code the MCLK used for SSP connections. That was a bad idea in hindsight, this information should really come from BIOS and/or machine driver. This patch introduces a helper to scan all SSP endpoints connected to a codec, and all formats to see what MCLK is used. When BIT(0) of the mdivc offset if set in the SSP blob, MCLK0 is used, and likewise when BIT(1) is set MCLK1 is used. The case where both MCLKs are used is possible but has never been seen in practice so should be treated as an error by the caller. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20220919115350.43104-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3289dc026a8cf5d6469eb49d838bc971f4370f9d Author: Kuninori Morimoto Date: Tue Sep 20 06:32:36 2022 +0000 ASoC: soc.h: use array instead of playback/capture_widget snd_soc_pcm_runtime has playback/capture_widget for Codec2Coddec. The naming is unclear. This patch names it as c2c_widget and uses array. struct snd_soc_pcm_runtime { ... => struct snd_soc_dapm_widget *playback_widget; => struct snd_soc_dapm_widget *capture_widget; ... } Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmfqv9mk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a26ec2acb2043a52c41d2b651b30d2df475f4263 Author: Kuninori Morimoto Date: Tue Sep 20 06:32:25 2022 +0000 ASoC: soc.h: use defined number instead of direct number snd_soc_pcm_runtime has dpcm for Playback/Capture, but it is defined directly "2". It should use defined number. struct snd_soc_pcm_runtime { ... => struct snd_soc_dpcm_runtime dpcm[2]; ... } This patch fixup it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r106v9mv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3989ade2d1e7ffc900e3842dc542b9e4bb3618fe Author: Kuninori Morimoto Date: Tue Sep 20 06:32:16 2022 +0000 ASoC: soc.h: remove num_cpus/codecs Current rtd has both dai_link pointer (A) and num_cpus/codecs (B). (A) rtd->dai_link = dai_link; (B) rtd->num_cpus = dai_link->num_cpus; (B) rtd->num_codecs = dai_link->num_codecs; But, we can get num_cpus/codecs (B) via dai_link (A). This means we don't need to keep num_cpus/codecs on rtd. This patch removes these. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfkmv9n3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a109d5c45b3d6728b9430716b915afbe16eef27c Author: Harry Stern Date: Sat Sep 10 20:36:13 2022 -0400 hid: topre: Add driver fixing report descriptor The Topre REALFORCE R2 firmware incorrectly reports that interface descriptor number 1, input report descriptor 2's events are array events rather than variable events. That particular report descriptor is used to report keypresses when there are more than 6 keys held at a time. This bug prevents events from this interface from being registered properly, so only 6 keypresses (from a different interface) can be registered at once, rather than full n-key rollover. This commit fixes the bug by setting the correct value in a report_fixup function. The original bug report can be found here: Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/804 Thanks to Benjamin Tissoires for diagnosing the issue with the report descriptor. Signed-off-by: Harry Stern Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220911003614.297613-1-harry@harrystern.net commit 6dbe4a8dead84de474483910b02ec9e6a10fc1a9 Author: Bart Van Assche Date: Thu Sep 8 16:31:39 2022 -0700 RDMA/srp: Fix srp_abort() Fix the code for converting a SCSI command pointer into an SRP request pointer. Cc: Xiao Yang Fixes: ad215aaea4f9 ("RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20220908233139.3042628-1-bvanassche@acm.org Signed-off-by: Leon Romanovsky commit be6e2b5734a425941fcdcdbd2a9337be498ce2cf Author: Andri Yngvason Date: Wed Sep 7 15:01:59 2022 +0000 HID: multitouch: Add memory barriers This fixes broken atomic checks which cause a race between the release-timer and processing of hid input. I noticed that contacts were sometimes sticking, even with the "sticky fingers" quirk enabled. This fixes that problem. Cc: stable@vger.kernel.org Fixes: 9609827458c3 ("HID: multitouch: optimize the sticky fingers timer") Signed-off-by: Andri Yngvason Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220907150159.2285460-1-andri@yngvason.is commit 7eff36527195cf434dc8f9ddc7bedc0254d0d835 Author: wangjianli Date: Thu Sep 8 21:20:36 2022 +0800 RDMA/qib: fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: wangjianli Link: https://lore.kernel.org/r/20220908132036.42355-1-wangjianli@cdjrlc.com Signed-off-by: Leon Romanovsky commit 67d8f59bdcc2a34bcae2becb6e2fdd81ec18990f Author: wangjianli Date: Thu Sep 8 21:18:24 2022 +0800 RDMA/hfi1: fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: wangjianli Link: https://lore.kernel.org/r/20220908131824.41106-1-wangjianli@cdjrlc.com Signed-off-by: Leon Romanovsky commit 735e1bb1b8067e209941a6bdfde23214696ff47e Author: Benjamin Tissoires Date: Fri Sep 2 15:29:25 2022 +0200 HID: convert defines of HID class requests into a proper enum This allows to export the type in BTF and so in the automatically generated vmlinux.h. It will also add some static checks on the users when we change the ll driver API (see not below). Note that we need to also do change in the ll_driver API, but given that this will have a wider impact outside of this tree, we leave this as a TODO for the future. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220902132938.2409206-11-benjamin.tissoires@redhat.com commit ead77b65aef430d3bfe63524c243a60a29eb8d90 Author: Benjamin Tissoires Date: Fri Sep 2 15:29:24 2022 +0200 HID: export hid_report_type to uapi When we are dealing with eBPF, we need to have access to the report type. Currently our implementation differs from the USB standard, making it impossible for users to know the exact value besides hardcoding it themselves. And instead of a blank define, convert it as an enum. Note that we need to also do change in the ll_driver API, but given that this will have a wider impact outside of this tree, we leave this as a TODO for the future. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220902132938.2409206-10-benjamin.tissoires@redhat.com commit 1e839143d674603b0bbbc4c513bca35404967dbc Author: Benjamin Tissoires Date: Fri Sep 2 15:29:23 2022 +0200 HID: core: store the unique system identifier in hid_device This unique identifier is currently used only for ensuring uniqueness in sysfs. However, this could be handful for userspace to refer to a specific hid_device by this id. 2 use cases are in my mind: LEDs (and their naming convention), and HID-BPF. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220902132938.2409206-9-benjamin.tissoires@redhat.com commit acc3e34613da139643af2ce4ca7e7dadf07478d6 Author: Marcus Folkesson Date: Wed Sep 14 20:43:45 2022 +0200 HID: Add driver for PhoenixRC Flight Controller The PhoenixRC is a controller with 8 channels for use in flight simulators. Signed-off-by: Marcus Folkesson Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220914184345.270456-1-marcus.folkesson@gmail.com commit 2c5e8e61402557119a086a994d2be06a535f5f30 Author: Marcus Folkesson Date: Fri Sep 2 10:25:52 2022 +0200 HID: Add driver for VRC-2 Car Controller VRC-2 is 2-axis controller often used in car simulators. Signed-off-by: Marcus Folkesson Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220902082552.2433744-2-marcus.folkesson@gmail.com commit cec9d59e89362809f17f2d854faf52966216da13 Merge: cb628a9a7ef6f 19d6356ab3f0e Author: Paolo Abeni Date: Tue Sep 20 12:33:24 2022 +0200 Merge branch 'seg6-add-next-c-sid-support-for-srv6-end-behavior' Andrea Mayer says: ==================== seg6: add NEXT-C-SID support for SRv6 End behavior The Segment Routing (SR) architecture is based on loose source routing. A list of instructions, called segments, can be added to the packet headers to influence the forwarding and processing of the packets in an SR enabled network. In SRv6 (Segment Routing over IPv6 data plane) [1], the segment identifiers (SIDs) are IPv6 addresses (128 bits) and the segment list (SID List) is carried in the Segment Routing Header (SRH). A segment may correspond to a "behavior" that is executed by a node when the packet is received. The Linux kernel currently supports a large subset of the behaviors described in [2] (e.g., End, End.X, End.T and so on). Some SRv6 scenarios (i.e.: traffic-engineering, fast-rerouting, VPN, mobile network backhaul, etc.) may require a large number of segments (i.e. up to 15). Therefore, reducing the size of the SID List is useful to minimize the impact on MTU (Maximum Transfer Unit) and to enable SRv6 on legacy hardware devices with limited processing power that can suffer from long IPv6 headers. Draft-ietf-spring-srv6-srh-compression [3] extends the SRv6 architecture by providing different mechanisms for the efficient representation (i.e. compression) of the SID List. The NEXT-C-SID mechanism described in [3] offers the possibility of encoding several SRv6 segments within a single 128 bit SID address. Such a SID address is called a Compressed SID Container. In this way, the length of the SID List can be drastically reduced. In some cases, the SRH can be omitted, as the IPv6 Destination Address can carry the whole Segment List, using its compressed representation. The NEXT-C-SID mechanism relies on the "flavors" framework defined in [2]. The flavors represent additional operations that can modify or extend a subset of the existing behaviors. In this patchset we extend the SRv6 Subsystem in order to support the NEXT-C-SID mechanism. In details the patchset is made of: - patch 1/3: add netlink_ext_ack support in parsing SRv6 behavior attributes; - patch 2/3: add NEXT-C-SID support for SRv6 End behavior; - patch 3/3: add selftest for NEXT-C-SID in SRv6 End behavior. The corresponding iproute2 patch for supporting the NEXT-C-SID in SRv6 End behavior is provided in a separated patchset. Comments, improvements and suggestions are always appreciated. [1] - https://datatracker.ietf.org/doc/html/rfc8754 [2] - https://datatracker.ietf.org/doc/html/rfc8986 [3] - https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-srh-compression ==================== Link: https://lore.kernel.org/r/20220912171619.16943-1-andrea.mayer@uniroma2.it Signed-off-by: Paolo Abeni commit 19d6356ab3f0ee40756115fffa01244235f7f400 Author: Andrea Mayer Date: Mon Sep 12 19:16:19 2022 +0200 selftests: seg6: add selftest for NEXT-C-SID flavor in SRv6 End behavior This selftest is designed for testing the support of NEXT-C-SID flavor for SRv6 End behavior. It instantiates a virtual network composed of several nodes: hosts and SRv6 routers. Each node is realized using a network namespace that is properly interconnected to others through veth pairs. The test considers SRv6 routers implementing IPv4/IPv6 L3 VPNs leveraged by hosts for communicating with each other. Such routers i) apply different SRv6 Policies to the traffic received from connected hosts, considering the IPv4 or IPv6 protocols; ii) use the NEXT-C-SID compression mechanism for encoding several SRv6 segments within a single 128-bit SID address, referred to as a Compressed SID (C-SID) container. The NEXT-C-SID is provided as a "flavor" of the SRv6 End behavior, enabling it to properly process the C-SID containers. The correct execution of the enabled NEXT-C-SID SRv6 End behavior is verified through reachability tests carried out between hosts belonging to the same VPN. Signed-off-by: Andrea Mayer Acked-by: David Ahern Signed-off-by: Paolo Abeni commit 848f3c0d47694924536e2894cb349613201321c6 Author: Andrea Mayer Date: Mon Sep 12 19:16:18 2022 +0200 seg6: add NEXT-C-SID support for SRv6 End behavior The NEXT-C-SID mechanism described in [1] offers the possibility of encoding several SRv6 segments within a single 128 bit SID address. Such a SID address is called a Compressed SID (C-SID) container. In this way, the length of the SID List can be drastically reduced. A SID instantiated with the NEXT-C-SID flavor considers an IPv6 address logically structured in three main blocks: i) Locator-Block; ii) Locator-Node Function; iii) Argument. C-SID container +------------------------------------------------------------------+ | Locator-Block |Loc-Node| Argument | | |Function| | +------------------------------------------------------------------+ <--------- B -----------> <- NF -> <------------- A ---------------> (i) The Locator-Block can be any IPv6 prefix available to the provider; (ii) The Locator-Node Function represents the node and the function to be triggered when a packet is received on the node; (iii) The Argument carries the remaining C-SIDs in the current C-SID container. The NEXT-C-SID mechanism relies on the "flavors" framework defined in [2]. The flavors represent additional operations that can modify or extend a subset of the existing behaviors. This patch introduces the support for flavors in SRv6 End behavior implementing the NEXT-C-SID one. An SRv6 End behavior with NEXT-C-SID flavor works as an End behavior but it is capable of processing the compressed SID List encoded in C-SID containers. An SRv6 End behavior with NEXT-C-SID flavor can be configured to support user-provided Locator-Block and Locator-Node Function lengths. In this implementation, such lengths must be evenly divisible by 8 (i.e. must be byte-aligned), otherwise the kernel informs the user about invalid values with a meaningful error code and message through netlink_ext_ack. If Locator-Block and/or Locator-Node Function lengths are not provided by the user during configuration of an SRv6 End behavior instance with NEXT-C-SID flavor, the kernel will choose their default values i.e., 32-bit Locator-Block and 16-bit Locator-Node Function. [1] - https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-srh-compression [2] - https://datatracker.ietf.org/doc/html/rfc8986 Signed-off-by: Andrea Mayer Reviewed-by: David Ahern Signed-off-by: Paolo Abeni commit e2a8ecc4516508abef71096959d2e2e44184904b Author: Andrea Mayer Date: Mon Sep 12 19:16:17 2022 +0200 seg6: add netlink_ext_ack support in parsing SRv6 behavior attributes An SRv6 behavior instance can be set up using mandatory and/or optional attributes. In the setup phase, each supplied attribute is parsed and processed. If the parsing operation fails, the creation of the behavior instance stops and an error number/code is reported to the user. In many cases, it is challenging for the user to figure out exactly what happened by relying only on the error code. For this reason, we add the support for netlink_ext_ack in parsing SRv6 behavior attributes. In this way, when an SRv6 behavior attribute is parsed and an error occurs, the kernel can send a message to the userspace describing the error through a meaningful text message in addition to the classic error code. Signed-off-by: Andrea Mayer Reviewed-by: David Ahern Signed-off-by: Paolo Abeni commit 454d243a00f50c2bd5ffb69a5ae16c462929d52f Author: Shaomin Deng Date: Sun Sep 4 11:45:15 2022 -0400 HID: sony: Fix double word in comments Remove the repeated word "not" in comments. Signed-off-by: Shaomin Deng Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220904154515.25143-1-dengshaomin@cdjrlc.com commit 98d67f250472cdd0f8d083830be3ec9dbb0c65a8 Author: Hangyu Hua Date: Fri Aug 12 10:55:15 2022 +0800 hid: hid-logitech-hidpp: avoid unnecessary assignments in hidpp_connect_event hidpp->delayed_input can't be assigned to an object that already call input_free_device when input_register_device fails. Fixes: c39e3d5fc9dd ("HID: logitech-hidpp: late bind the input device on wireless connection") Signed-off-by: Hangyu Hua Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220812025515.19467-1-hbh25y@gmail.com commit 34acb833cc83bdea912a160ff99b537e62bb4cf3 Author: Shiraz Saleem Date: Wed Sep 7 14:13:24 2022 -0500 RDMA/irdma: Validate udata inlen and outlen Currently ib_copy_from_udata and ib_copy_to_udata could underfill the request and response buffer if the user-space passes an undersized value for udata->inlen or udata->outlen respectively [1] This could lead to undesirable behavior. Zero initing the buffer only goes as far as preventing using the buffer uninitialized. Validate udata->inlen and udata->outlen passed from user-space to ensure they are at least the required minimum size. [1] https://lore.kernel.org/linux-rdma/MWHPR11MB0029F37D40D9D4A993F8F549E9D79@MWHPR11MB0029.namprd11.prod.outlook.com/ Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Reported-by: Dan Carpenter Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20220907191324.1173-3-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit 7f51a961f8c6b84752a48e950074a8c4a0808d91 Author: Sindhu-Devale Date: Wed Sep 7 14:13:23 2022 -0500 RDMA/irdma: Align AE id codes to correct flush code and event A number of asynchronous event (AE) ids were not aligned to the correct flush_code and event_type. Fix these up so that the correct IBV error and event codes are returned to application. Also, add handling for new AE ids like IRDMA_AE_INVALID_REQUEST to return the correct WC error code. Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20220907191324.1173-2-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit 908d325e1665b2781085580070554cbbe5fc3c89 Author: Bastien Nocera Date: Wed Sep 14 15:21:46 2022 +0200 HID: logitech-hidpp: Detect hi-res scrolling support Rather than relying on a never-ending stream of patches for quirks. This change will detect whether HID++ 1.0 hi-res scroll, HID++ 2.0 hi-res scroll or HID++ 2.0 hi-res scroll wheel is supported, and enable the feature without the need for quirks. Tested on a Logitech M705 mouse that was unsupported before this change. [ 9.365324] logitech-hidpp-device 0003:046D:406D.0006: input,hidraw3: USB HID v1.11 Mouse [Logitech M705] on usb-0000:00:14.0-4/input2:3 [ 57.472434] logitech-hidpp-device 0003:046D:406D.0006: HID++ 4.5 device connected. [ 57.616429] logitech-hidpp-device 0003:046D:406D.0006: Detected HID++ 2.0 hi-res scroll wheel [ 57.712424] logitech-hidpp-device 0003:046D:406D.0006: wheel multiplier = 8 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216480 Signed-off-by: Bastien Nocera Reviewed-by: Harry Cutts Tested-by: Peter F. Patel-Schneider Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220914132146.6435-1-hadess@hadess.net commit c37b830fef1396f9f2ad79a65700e152ec362543 Author: Ard Biesheuvel Date: Mon May 2 01:10:03 2022 +0200 arm64: efi: enable generic EFI compressed boot Wire up the generic EFI zboot support for arm64. Signed-off-by: Ard Biesheuvel Tested-by: Jeremy Linton Acked-by: Catalin Marinas commit cb628a9a7ef6f101b37a0d1eaa689a9650c4903b Author: Richard Gobert Date: Sun Sep 11 20:48:49 2022 +0200 net-next: gro: Fix use of skb_gro_header_slow In the cited commit, the function ipv6_gro_receive was accidentally changed to use skb_gro_header_slow, without attempting the fast path. Fix it. Fixes: 35ffb6654729 ("net: gro: skb_gro_header helper function") Signed-off-by: Richard Gobert Link: https://lore.kernel.org/r/20220911184835.GA105063@debian Signed-off-by: Paolo Abeni commit 3eb123142f6d66ff7542cbae5833bbc0ec88adb0 Author: Peter Robinson Date: Fri Sep 16 12:56:02 2022 +0100 mmc: sdhci-of-aspeed: Add dependency on ARCH_ASPEED The MMC_SDHCI_OF_ASPEED is part of the Aspeed silicon so it makes sense to depend on ARCH_ASPEED and for compile testing. Signed-off-by: Peter Robinson Link: https://lore.kernel.org/r/20220916115602.370003-1-pbrobinson@gmail.com Signed-off-by: Ulf Hansson commit f7209cbf61db00faf71e8efe3af6703aa845d327 Author: AngeloGioacchino Del Regno Date: Thu Sep 15 14:09:23 2022 +0200 mmc: mtk-sd: Add support for MT6795 Helio X10 Add support for MT6795 with a new compatible string and platform data. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220915120923.86038-3-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit d4dc6ecaf7c7766a3c066a08924785fcd9507544 Author: AngeloGioacchino Del Regno Date: Thu Sep 15 14:09:22 2022 +0200 mmc: mtk-sd: Reorder of_device_id and platform data by name Both of_device_id compatible strings and platform data were partially ordered by name. Fix the ordering. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220915120923.86038-2-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit d252e9b1073a12fee68fc9a626a83035cd03cf70 Author: Wenchao Chen Date: Wed Sep 14 14:37:02 2022 +0800 mmc: sdhci-sprd: Fix the limitation of div Because the bit field size of the divider coefficient register is 1023, it is limited before returning the value. Signed-off-by: Wenchao Chen Link: https://lore.kernel.org/r/20220914063702.20283-1-wenchao.chen666@gmail.com Signed-off-by: Ulf Hansson commit 2e50e9bf328fb781c9fcd5dc6531458dd02d1626 Author: Nathan Chancellor Date: Sun Sep 11 01:57:50 2022 -0700 net/mlx5e: Ensure macsec_rule is always initiailized in macsec_fs_{r,t}x_add_rule() Clang warns: drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:539:6: error: variable 'macsec_rule' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (err) ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:598:9: note: uninitialized use occurs here return macsec_rule; ^~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:539:2: note: remove the 'if' if its condition is always false if (err) ^~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:523:38: note: initialize the variable 'macsec_rule' to silence this warning union mlx5e_macsec_rule *macsec_rule; ^ = NULL drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1131:6: error: variable 'macsec_rule' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (err) ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1215:9: note: uninitialized use occurs here return macsec_rule; ^~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1131:2: note: remove the 'if' if its condition is always false if (err) ^~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1118:38: note: initialize the variable 'macsec_rule' to silence this warning union mlx5e_macsec_rule *macsec_rule; ^ = NULL 2 errors generated. If macsec_fs_{r,t}x_ft_get() fail, macsec_rule will be uninitialized. Initialize it to NULL at the top of each function so that it cannot be used uninitialized. Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules") Fixes: 3b20949cb21b ("net/mlx5e: Add MACsec RX steering rules") Link: https://github.com/ClangBuiltLinux/linux/issues/1706 Signed-off-by: Nathan Chancellor Reviewed-by: Raed Salem Link: https://lore.kernel.org/r/20220911085748.461033-1-nathan@kernel.org Signed-off-by: Paolo Abeni commit ee6cac37368b7ec2b3f798fb7d6d4ce7a62db537 Author: Andy Shevchenko Date: Fri Sep 16 23:54:50 2022 +0300 pinctrl: cy8c95x0: Align function names in cy8c95x0_pmxops Align the function names in the cy8c95x0_pmxops() to follow the struct pinmux_ops members naming schema. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220916205450.86278-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d6afdf8826ef4c719ab78d33e932dc6ad9dedb35 Author: Andy Shevchenko Date: Fri Sep 16 23:54:49 2022 +0300 pinctrl: cy8c95x0: Drop atomicity on operations on push_pull The push_pull member is always accessed under the mutex, hence no need to use atomic operations on it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220916205450.86278-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 56e380cfcd82a228dc006902b88cf1adaf9851dc Author: Andy Shevchenko Date: Fri Sep 16 23:54:48 2022 +0300 pinctrl: cy8c95x0: Lock register accesses in cy8c95x0_set_mux() It seems that cy8c95x0_set_mux() missed serialization of IO access. And its implementation looks half-baked. Add locking to the function. Fixes: e6cbbe42944d ("pinctrl: Add Cypress cy8c95x0 support") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220916205450.86278-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 35b871f72a5a06dc5a328427a437797ad99c0696 Author: Yang Yingliang Date: Sat Sep 17 20:22:08 2022 +0800 pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and and prints the error name. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220917122208.1894769-1-yangyingliang@huawei.com Signed-off-by: Linus Walleij commit 790cf9e3da3f16d65d389d714f6e18f27cf18704 Author: Yang Yingliang Date: Sat Sep 17 20:20:15 2022 +0800 pinctrl: stm32: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220917122015.1893880-1-yangyingliang@huawei.com Signed-off-by: Linus Walleij commit 41d27f518b955ef4b75b02cc67392aef0809a78d Author: Christian Brauner Date: Fri Sep 9 11:30:19 2022 +0200 fat: port to vfs{g,u}id_t and associated helpers A while ago we introduced a dedicated vfs{g,u}id_t type in commit 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched over a good part of the VFS. Ultimately we will remove all legacy idmapped mount helpers that operate only on k{g,u}id_t in favor of the new type safe helpers that operate on vfs{g,u}id_t. Cc: Seth Forshee (Digital Ocean) Cc: Christoph Hellwig Cc: OGAWA Hirofumi Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Microsoft) Acked-by: OGAWA Hirofumi commit 110ae8a21bbe779a133c1672a1463105c9d50590 Author: Minghao Chi Date: Mon Sep 19 03:04:01 2022 +0000 drm: bridge/dw-hdmi-ahb-audio: use strscpy() is more robust and safer The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220919030401.211331-1-chi.minghao@zte.com.cn commit 27b30995b75d1e79360c164ba179bca86ab76ba6 Author: Peng Fan Date: Fri Sep 2 19:12:07 2022 +0800 clocksource/drivers/imx-sysctr: handle nxp,no-divider property The previous hardware design embedds a internal divider for base clock. New design not has that divider, so check the nxp,no-divider property, if true, directly use base clock input, otherwise divide by 3 as before. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220902111207.2902493-3-peng.fan@oss.nxp.com Signed-off-by: Daniel Lezcano commit 061f42748d0639647636b7a48d71951e8d92720a Author: Peng Fan Date: Fri Sep 2 19:12:06 2022 +0800 dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property The base clock input to system counter is internally divided by 3 in previous design, but there is change that no divider now. So add a property to indicate that. Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220902111207.2902493-2-peng.fan@oss.nxp.com Signed-off-by: Daniel Lezcano commit 789d4b1070261fa98b06384d2067f23c080dc9f1 Author: Tony Lindgren Date: Mon Aug 15 16:12:50 2022 +0300 clocksource/drivers/timer-ti-dm: Get clock in probe with devm_clk_get() We can simplify the code a bit by getting the clock in probe, and using devm_clk_get(). This will also make further changes easier as the clock is available in probe instead of prepare. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-10-tony@atomide.com Signed-off-by: Daniel Lezcano commit 664ad59da11687ef9b518fc2519af6a71a1db9f1 Author: Tony Lindgren Date: Mon Aug 15 16:12:49 2022 +0300 clocksource/drivers/timer-ti-dm: Add flag to detect omap1 Let's make it clear that some features need to be tested currently on omap1. Only omap1 still uses platform_data. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-9-tony@atomide.com Signed-off-by: Daniel Lezcano commit a6e543f61531b63bfc8d43053c6ec6f65117f627 Author: Tony Lindgren Date: Mon Aug 15 16:12:48 2022 +0300 clocksource/drivers/timer-ti-dm: Move struct omap_dm_timer fields to driver There is no longer any need to expose the elements of struct omap_dm_timer outside the driver. The pwm and remoteproc drivers just use struct omap_dm_timer as a cookie. Let's move the elements of struct omap_dm_timer into struct dmtimer that is private to the driver. To do this, we mostly rename omap_dm_timer to dmtimer in the driver. We keep omap_dm_timer only for the exposed functions in the platform_data for the pwm and remoteproc drivers. Let's also add a note about not using the exposed functions internally as those will get deprecated eventually in favor of Linux generic frameworks. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-8-tony@atomide.com Signed-off-by: Daniel Lezcano commit bd351f1aee21ca667b39658550b5f3c61e8bb77f Author: Tony Lindgren Date: Mon Aug 15 16:12:47 2022 +0300 clocksource/drivers/timer-ti-dm: Use runtime PM directly and check errors Use pm_runtime_resume_and_get() and check for a possible error returned. We want to do this as omap_dm_timer_enable() and omap_dm_timer_disable() are exposed to the pwm and remoteproc drivers, and in the following patch we turn struct omap_dm_timer into a cookie used by the exposed functions only. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-7-tony@atomide.com Signed-off-by: Daniel Lezcano commit 1d513f439d7930363adce4588030af7c8fa71cc9 Author: Tony Lindgren Date: Mon Aug 15 16:12:46 2022 +0300 clocksource/drivers/timer-ti-dm: Move private defines to the driver These defines are only used by timer-ti-dm driver. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-6-tony@atomide.com Signed-off-by: Daniel Lezcano commit f32bdac10cb5f461f8c71c3b9703617c42322d2f Author: Tony Lindgren Date: Mon Aug 15 16:12:45 2022 +0300 clocksource/drivers/timer-ti-dm: Simplify register access further Let's unify register access and use dmtimer_read() and dmtimer_write() also for the timer revision specific registers like we now do for the shread registers. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-5-tony@atomide.com Signed-off-by: Daniel Lezcano commit 49cd16bb573e43dc2ee64d734b9b545475dbb35f Author: Tony Lindgren Date: Mon Aug 15 16:12:44 2022 +0300 clocksource/drivers/timer-ti-dm: Simplify register writes with dmtimer_write() We can simplify register write access by checking for the register write posted mode in the write function. This way we can combine the functions for __omap_dm_timer_write() and omap_dm_timer_write_reg() into a single function dmtimer_write(). We update the shared register access first, the timer revision specific register access will be updated in a later patch. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-4-tony@atomide.com Signed-off-by: Daniel Lezcano commit 90c9aada19606ae78259cef78a46646a97ec8f67 Author: Tony Lindgren Date: Mon Aug 15 16:12:43 2022 +0300 clocksource/drivers/timer-ti-dm: Simplify register reads with dmtimer_read() We can simplify register read access by checking for the register write posted mode in the read function. This way we can combine the functions for __omap_dm_timer_read() and omap_dm_timer_read_reg() into a single function dmtimer_read(). We update the shared register access first, the timer revision specific register access will be updated in a later patch. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-3-tony@atomide.com Signed-off-by: Daniel Lezcano commit caa590067efd659d8811ad8904489536912ebc53 Author: Tony Lindgren Date: Mon Aug 15 16:12:42 2022 +0300 clocksource/drivers/timer-ti-dm: Drop unused functions We still have some unused functions left, let's drop them. Signed-off-by: Tony Lindgren Reviewed-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220815131250.34603-2-tony@atomide.com Signed-off-by: Daniel Lezcano commit 0e2c8e6d769bcdc4f6634a02c545356282275e68 Author: Lin Yujun Date: Wed Sep 14 11:30:18 2022 +0800 clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe Add platform_device_put() to make sure to free the platform device in the event platform_device_add() fails. Fixes: 5184f4bf151b ("clocksource/drivers/timer-gxp: Add HPE GXP Timer") Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220914033018.97484-1-linyujun809@huawei.com Signed-off-by: Daniel Lezcano commit 6c3b62d93e195f78c1437c8fa7581e9b2f00886e Author: Kunkun Jiang Date: Wed Sep 14 14:14:24 2022 +0800 clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921 The commit a38b71b0833e ("clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL") moves the programming of the timers from the countdown timer (TVAL) over to the comparator (CVAL). This makes it necessary to read the counter when programming next event. However, the workaround of Cortex-A73 erratum 858921 does not set the corresponding set_next_event_phys and set_next_event_virt. Add the appropriate hooks to apply the erratum mitigation when programming the next timer event. Fixes: a38b71b0833e ("clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL") Signed-off-by: Kunkun Jiang Acked-by: Marc Zyngier Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20220914061424.1260-1-jiangkunkun@huawei.com Signed-off-by: Daniel Lezcano commit 55ccdab79524ce9a46965af6e1908b90fa92b303 Author: Vincent Whitchurch Date: Thu Jun 9 13:27:38 2022 +0200 clocksource/drivers/exynos_mct: Enable building on ARTPEC This timer block is used on ARTPEC-8. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220609112738.359385-5-vincent.whitchurch@axis.com Signed-off-by: Daniel Lezcano commit 47dbe4eb9822208be2b7ec901c7e0c15536f9c92 Author: Vincent Whitchurch Date: Thu Jun 9 13:27:37 2022 +0200 clocksource/drivers/exynos_mct: Support local-timers property If the device tree indicates that the hardware requires that the processor only use certain local timers, respect that. Signed-off-by: Vincent Whitchurch Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220609112738.359385-4-vincent.whitchurch@axis.com Signed-off-by: Daniel Lezcano commit e8550f0e7bde9bd31697e3c534d386f7f3b5787b Author: Vincent Whitchurch Date: Thu Jun 9 13:27:36 2022 +0200 clocksource/drivers/exynos_mct: Support frc-shared property When the FRC is shared with another main processor, the other processor is assumed to have started it and this processor should not write to the global registers. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220609112738.359385-3-vincent.whitchurch@axis.com Signed-off-by: Daniel Lezcano commit 99b701fd2758d046d9e6ecdef1a3320d29b8b1d9 Author: Vincent Whitchurch Date: Thu Jun 9 13:27:35 2022 +0200 dt-bindings: timer: exynos4210-mct: Add ARTPEC-8 MCT support The ARTPEC-8 has an MCT with 4 global and 8 local timer interrupts. The SoC has a quad-core Cortex-A53 and a single-core Cortex-A5 which share one MCT with one global and eight local timers. The Cortex-A53 and Cortex-A5 do not have cache-coherency between them, and therefore run two separate kernels. The Cortex-A53 boots first and starts the global free-running counter and also registers a clock events device using the global timer. (This global timer clock events is usually replaced by arch timer clock events for each of the cores.) When the A5 boots (via the A53), it should not use the global timer interrupts or write to the global timer registers. This is because even if there are four global comparators, the control bits for all four are in the same registers, and we would need to synchronize between the cpus. Instead, the global timer FRC (already started by the A53) should be used as the clock source, and one of the local timers which are not used by the A53 can be used for clock events on the A5. To support this hardware, add a compatible for the MCT as well as two new properties to describe the hardware-mandated sharing of the FRC and dedicating local timers to specific processors. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220609112738.359385-2-vincent.whitchurch@axis.com Signed-off-by: Daniel Lezcano commit 4364044c326cbf2ad09e9fa99a9a28a342fecce6 Author: Victor Hassan Date: Tue Sep 6 13:20:56 2022 +0800 clocksource/drivers/sun4i: Add definition of clear interrupt To prevent misunderstanding, use TIMER_IRQ_CLEAR instead of TIMER_IRQ_EN in function sun4i_timer_clear_interrupt. Signed-off-by: Victor Hassan Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220906052056.43404-1-victor@allwinnertech.com Signed-off-by: Daniel Lezcano commit 9ee67182309290aee8135b2b464d0240afe63a28 Author: wangjianli Date: Thu Sep 8 20:22:29 2022 +0800 mtd: fix repeated word in comment Delete the redundant word 'in'. Signed-off-by: wangjianli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220908122229.10814-1-wangjianli@cdjrlc.com commit e8b9f0da92f3560d6596d8306f08cd28e50eba85 Merge: 42e53b447cf89 eca70102cfb19 Author: Paolo Abeni Date: Tue Sep 20 10:32:38 2022 +0200 Merge branch 'dsa-changes-for-multiple-cpu-ports-part-4' Vladimir Oltean says: ==================== DSA changes for multiple CPU ports (part 4) Those who have been following part 1: https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/ part 2: https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/ and part 3: https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/ will know that I am trying to enable the second internal port pair from the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q". This series represents the final part of that effort. We have: - the introduction of new UAPI in the form of IFLA_DSA_MASTER, the iproute2 patch for which is here: https://patchwork.kernel.org/project/netdevbpf/patch/20220904190025.813574-1-vladimir.oltean@nxp.com/ - preparation for LAG DSA masters in terms of suppressing some operations for masters in the DSA core that simply don't make sense when those masters are a bonding/team interface - handling all the net device events that occur between DSA and a LAG DSA master, including migration to a different DSA master when the current master joins a LAG, or the LAG gets destroyed - updating documentation - adding an implementation for NXP LS1028A, where things are insanely complicated due to hardware limitations. We have 2 tagging protocols: * the native "ocelot" protocol (NPI port mode). This does not support CPU ports in a LAG, and supports a single DSA master. The DSA master can be changed between eno2 (2.5G) and eno3 (1G), but all ports must be down during the changing process, and user ports assigned to the old DSA master will refuse to come up if the user requests that during a "transient" state. * the "ocelot-8021q" software-defined protocol, where the Ethernet ports connected to the CPU are not actually "god mode" ports as far as the hardware is concerned. So here, static assignment between user and CPU ports is possible by editing the PGID_SRC masks for the port-based forwarding matrix, and "CPU ports in a LAG" simply means "a LAG like any other". The series was regression-tested on LS1028A using the local_termination.sh kselftest, in most of the possible operating modes and tagging protocols. I have not done a detailed performance evaluation yet, but using LAG, is possible to exceed the termination bandwidth of a single CPU port in an iperf3 test with multiple senders and multiple receivers. v1 at: https://patchwork.kernel.org/project/netdevbpf/cover/20220830195932.683432-1-vladimir.oltean@nxp.com/ Previous (older) RFC at: https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/ ==================== Link: https://lore.kernel.org/r/20220911010706.2137967-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit eca70102cfb19d783d30d3e9b13713d58581eb67 Author: Vladimir Oltean Date: Sun Sep 11 04:07:06 2022 +0300 net: dsa: felix: add support for changing DSA master Changing the DSA master means different things depending on the tagging protocol in use. For NPI mode ("ocelot" and "seville"), there is a single port which can be configured as NPI, but DSA only permits changing the CPU port affinity of user ports one by one. So changing a user port to a different NPI port globally changes what the NPI port is, and breaks the user ports still using the old one. To address this while still permitting the change of the NPI port, require that the user ports which are still affine to the old NPI port are down, and cannot be brought up until they are all affine to the same NPI port. The tag_8021q mode ("ocelot-8021q") is more flexible, in that each user port can be freely assigned to one CPU port or to the other. This works by filtering host addresses towards both tag_8021q CPU ports, and then restricting the forwarding from a certain user port only to one of the two tag_8021q CPU ports. Additionally, the 2 tag_8021q CPU ports can be placed in a LAG. This works by enabling forwarding via PGID_SRC from a certain user port towards the logical port ID containing both tag_8021q CPU ports, but then restricting forwarding per packet, via the LAG hash codes in PGID_AGGR, to either one or the other. When we change the DSA master to a LAG device, DSA guarantees us that the LAG has at least one lower interface as a physical DSA master. But DSA masters can come and go as lowers of that LAG, and ds->ops->port_change_master() will not get called, because the DSA master is still the same (the LAG). So we need to hook into the ds->ops->port_lag_{join,leave} calls on the CPU ports and update the logical port ID of the LAG that user ports are assigned to. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 0773e3a851c8afd46cefb0cbf8d0977d454d899e Author: Vladimir Oltean Date: Sun Sep 11 04:07:05 2022 +0300 docs: net: dsa: update information about multiple CPU ports DSA now supports multiple CPU ports, explain the use cases that are covered, the new UAPI, the permitted degrees of freedom, the driver API, and remove some old "hanging fruits". Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit acc43b7bf52a015221d989164c2600c1e1f28790 Author: Vladimir Oltean Date: Sun Sep 11 04:07:04 2022 +0300 net: dsa: allow masters to join a LAG There are 2 ways in which a DSA user port may become handled by 2 CPU ports in a LAG: (1) its current DSA master joins a LAG ip link del bond0 && ip link add bond0 type bond mode 802.3ad ip link set eno2 master bond0 When this happens, all user ports with "eno2" as DSA master get automatically migrated to "bond0" as DSA master. (2) it is explicitly configured as such by the user # Before, the DSA master was eno3 ip link set swp0 type dsa master bond0 The design of this configuration is that the LAG device dynamically becomes a DSA master through dsa_master_setup() when the first physical DSA master becomes a LAG slave, and stops being so through dsa_master_teardown() when the last physical DSA master leaves. A LAG interface is considered as a valid DSA master only if it contains existing DSA masters, and no other lower interfaces. Therefore, we mainly rely on method (1) to enter this configuration. Each physical DSA master (LAG slave) retains its dev->dsa_ptr for when it becomes a standalone DSA master again. But the LAG master also has a dev->dsa_ptr, and this is actually duplicated from one of the physical LAG slaves, and therefore needs to be balanced when LAG slaves come and go. To the switch driver, putting DSA masters in a LAG is seen as putting their associated CPU ports in a LAG. We need to prepare cross-chip host FDB notifiers for CPU ports in a LAG, by calling the driver's ->lag_fdb_add method rather than ->port_fdb_add. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 2e359b00a11715c7a89d7448e6e4cb4d84543520 Author: Vladimir Oltean Date: Sun Sep 11 04:07:03 2022 +0300 net: dsa: propagate extack to port_lag_join Drivers could refuse to offload a LAG configuration for a variety of reasons, mainly having to do with its TX type. Additionally, since DSA masters may now also be LAG interfaces, and this will translate into a call to port_lag_join on the CPU ports, there may be extra restrictions there. Propagate the netlink extack to this DSA method in order for drivers to give a meaningful error message back to the user. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 13eccc1bbb2e98df5d616398cd9215d9edab522f Author: Vladimir Oltean Date: Sun Sep 11 04:07:02 2022 +0300 net: dsa: suppress device links to LAG DSA masters These don't work (print a harmless error about the operation failing) and make little sense to have anyway, because when a LAG DSA master goes away, we will introduce logic to move our CPU port back to the first physical DSA master. So suppress these device links in preparation for adding support for LAG DSA masters. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit cfeb84a52fcbdb12c7364c2cab4529c5c5558c35 Author: Vladimir Oltean Date: Sun Sep 11 04:07:01 2022 +0300 net: dsa: suppress appending ethtool stats to LAG DSA masters Similar to the discussion about tracking the admin/oper state of LAG DSA masters, we have the problem here that struct dsa_port *cpu_dp caches a single pair of orig_ethtool_ops and netdev_ops pointers. So if we call dsa_master_setup(bond0, cpu_dp) where cpu_dp is also the dev->dsa_ptr of one of the physical DSA masters, we'd effectively overwrite what we cached from that physical netdev with what replaced from the bonding interface. We don't need DSA ethtool stats on the bonding interface when used as DSA master, it's good enough to have them just on the physical DSA masters, so suppress this logic. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 6e61b55c6d7f20f5619e831fa171f65bfbcf03c7 Author: Vladimir Oltean Date: Sun Sep 11 04:07:00 2022 +0300 net: dsa: don't keep track of admin/oper state on LAG DSA masters We store information about the DSA master's state in cpu_dp->master_admin_up and cpu_dp->master_oper_up, and this assumes a bijective association between a CPU port and a DSA master. However, when we have CPU ports in a LAG (and DSA masters in a LAG too), the way in which we set up things is that the physical DSA masters still have dev->dsa_ptr pointing to our cpu_dp, but the bonding/team device itself also has its dev->dsa_ptr pointing towards one of the CPU port structures (the first one). So logically speaking, that first cpu_dp can't keep track of both the physical master's admin/oper state, and of the bonding master's state. This isn't even needed; the reason why we keep track of the DSA master's state is to know when it is available for Ethernet-based register access. For that use case, we don't even need LAG; we just need to decide upon one of the physical DSA masters (if there is more than 1 available) and use that. This change suppresses dsa_tree_master_{admin,oper}_state_change() calls on LAG DSA masters (which will be supported in a future change), to allow the tracking of just physical DSA masters. Link: https://lore.kernel.org/netdev/628cc94d.1c69fb81.15b0d.422d@mx.google.com/ Suggested-by: Christian Marangi Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 95f510d0b792f308d3d748242fe960c35bdc2c62 Author: Vladimir Oltean Date: Sun Sep 11 04:06:59 2022 +0300 net: dsa: allow the DSA master to be seen and changed through rtnetlink Some DSA switches have multiple CPU ports, which can be used to improve CPU termination throughput, but DSA, through dsa_tree_setup_cpu_ports(), sets up only the first one, leading to suboptimal use of hardware. The desire is to not change the default configuration but to permit the user to create a dynamic mapping between individual user ports and the CPU port that they are served by, configurable through rtnetlink. It is also intended to permit load balancing between CPU ports, and in that case, the foreseen model is for the DSA master to be a bonding interface whose lowers are the physical DSA masters. To that end, we create a struct rtnl_link_ops for DSA user ports with the "dsa" kind. We expose the IFLA_DSA_MASTER link attribute that contains the ifindex of the newly desired DSA master. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62 Author: Vladimir Oltean Date: Sun Sep 11 04:06:58 2022 +0300 net: dsa: introduce dsa_port_get_master() There is a desire to support for DSA masters in a LAG. That configuration is intended to work by simply enslaving the master to a bonding/team device. But the physical DSA master (the LAG slave) still has a dev->dsa_ptr, and that cpu_dp still corresponds to the physical CPU port. However, we would like to be able to retrieve the LAG that's the upper of the physical DSA master. In preparation for that, introduce a helper called dsa_port_get_master() that replaces all occurrences of the dp->cpu_dp->master pattern. The distinction between LAG and non-LAG will be made later within the helper itself. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit db01868bf2e919a10551066d54cf4bef5dd5a01e Author: Vladimir Oltean Date: Sun Sep 11 04:06:57 2022 +0300 net: introduce iterators over synced hw addresses Some network drivers use __dev_mc_sync()/__dev_uc_sync() and therefore program the hardware only with addresses with a non-zero sync_cnt. Some of the above drivers also need to save/restore the address filtering lists when certain events happen, and they need to walk through the struct net_device :: uc and struct net_device :: mc lists. But these lists contain unsynced addresses too. To keep the appearance of an elementary form of data encapsulation, provide iterators through these lists that only look at entries with a non-zero sync_cnt, instead of filtering entries out from device drivers. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit d6cbe630f3e9a5b11ba4082ff980ccc094224610 Author: Jammy Huang Date: Fri Sep 16 17:17:06 2022 +0800 drm/ast: Fix video broken in some resolutions on ast2600 Some cases are not handled well for ast2600. Signed-off-by: Jammy Huang Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220916091706.4559-1-jammy_huang@aspeedtech.com commit 71dee0361bd04f31c37525e69817654c6e23c97a Author: Jammy Huang Date: Fri Sep 16 16:50:58 2022 +0800 drm/ast: Add resolution support for 1152x864@75 Add 1152x864 into support list. Signed-off-by: Jammy Huang Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220916085058.3386-1-jammy_huang@aspeedtech.com commit 049e43b9fd8fd2966940485da163d67e96ee3fea Author: Pali Rohár Date: Thu Jul 7 20:43:28 2022 +0200 mtd: rawnand: fsl_elbc: Fix none ECC mode Commit f6424c22aa36 ("mtd: rawnand: fsl_elbc: Make SW ECC work") added support for specifying ECC mode via DTS and skipping autodetection. But it broke explicit specification of HW ECC mode in DTS as correct settings for HW ECC mode are applied only when NONE mode or nothing was specified in DTS file. Also it started aliasing NONE mode to be same as when ECC mode was not specified and disallowed usage of ON_DIE mode. Fix all these issues. Use autodetection of ECC mode only in case when mode was really not specified in DTS file by checking that ecc value is invalid. Set HW ECC settings either when HW ECC was specified in DTS or it was autodetected. And do not fail when ON_DIE mode is set. Fixes: f6424c22aa36 ("mtd: rawnand: fsl_elbc: Make SW ECC work") Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Reviewed-by: Marek Behún Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220707184328.3845-1-pali@kernel.org commit 054c6b58fc6ca7321dc53d7b64f8422919355cd9 Author: Christophe JAILLET Date: Sun Jul 3 18:09:45 2022 +0200 mtd: nand: bbt: Use the bitmap API to allocate bitmaps Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/b18c2b6711b8930f0dfb8318b5d19ef6e41f0f9a.1656864573.git.christophe.jaillet@wanadoo.fr commit 7471a53ddce54cee9b7a340dc930eb35b02c9eed Author: Martin Blumenstingl Date: Sun Jul 3 01:12:27 2022 +0200 mtd: rawnand: intel: Use devm_platform_ioremap_resource_byname() Switch from open-coded platform_get_resource_byname() and devm_ioremap_resource() to devm_platform_ioremap_resource_byname() where possible to simplify the code. Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-9-martin.blumenstingl@googlemail.com commit 1b9bdc213cf8a917ad7eeedb39909dd928bd6678 Author: Martin Blumenstingl Date: Sun Jul 3 01:12:26 2022 +0200 mtd: rawnand: intel: Remove unused clk_rate member from struct ebu_nand The clk_rate member from struct ebu_nand is only written but never read. Remove this unused and unneeded member. Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-8-martin.blumenstingl@googlemail.com commit dbe5f7880fb020f1984f72105189e877bd2c808c Author: Martin Blumenstingl Date: Sun Jul 3 01:12:25 2022 +0200 mtd: rawnand: intel: Remove unused nand_pa member from ebu_nand_cs The nand_pa member from struct ebu_nand_cs is only written but never read. Remove this unused and unneeded member. Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-7-martin.blumenstingl@googlemail.com commit ebe0cd60fcffd499f8020fde9b3b74acba9c22af Author: Martin Blumenstingl Date: Sun Jul 3 01:12:24 2022 +0200 mtd: rawnand: intel: Don't re-define NAND_DATA_IFACE_CHECK_ONLY NAND_DATA_IFACE_CHECK_ONLY is already defined in include/linux/mtd/rawnand.h which is also included by the driver. Drop the re-definition from the intel-nand-controller driver. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-6-martin.blumenstingl@googlemail.com commit 68c02ebaa34d41063ccbbc789a352537ddc3cd8a Author: Martin Blumenstingl Date: Sun Jul 3 01:12:23 2022 +0200 mtd: rawnand: intel: Remove undocumented compatible string The "intel,nand-controller" compatible string is not part of the dt-bindings. Remove it from the driver as it's not supposed to be used without any documentation for it. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-5-martin.blumenstingl@googlemail.com commit bfc618fcc3f167ad082053e81e9d664e724c6288 Author: Martin Blumenstingl Date: Sun Jul 3 01:12:22 2022 +0200 mtd: rawnand: intel: Read the chip-select line from the correct OF node The chip select has to be read from the flash node which is a child node of the NAND controller. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-4-martin.blumenstingl@googlemail.com commit 9fac2a193e4553d6ce093a626ef5920c362d0753 Author: Martin Blumenstingl Date: Sun Jul 3 01:12:21 2022 +0200 dt-bindings: mtd: intel: lgm-nand: Fix maximum chip select value The Intel LGM NAND IP only supports two chip selects: There's only two CS and ADDR_SEL register sets. Fix the maximum allowed chip select value according to the dt-bindings. Fixes: 2f9cea8eae44f5 ("dt-bindings: mtd: Add Nand Flash Controller support for Intel LGM SoC") Acked-by: Rob Herring Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-3-martin.blumenstingl@googlemail.com commit c6d7ce0a7e0562846431dc3c7c390dde7d0c0c42 Author: Martin Blumenstingl Date: Sun Jul 3 01:12:20 2022 +0200 dt-bindings: mtd: intel: lgm-nand: Fix compatible string The driver which was added at the same time as the dt-bindings uses the compatible string "intel,lgm-ebunand". Use the same compatible string also in the dt-bindings and rename the bindings file accordingly. Fixes: 2f9cea8eae44f5 ("dt-bindings: mtd: Add Nand Flash Controller support for Intel LGM SoC") Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-2-martin.blumenstingl@googlemail.com commit c5d5cba795e29ad659271a7ed2dbc87ce1104f7c Author: Ard Biesheuvel Date: Mon Aug 22 14:39:49 2022 +0200 loongarch: efi: enable generic EFI compressed boot Wire up the generic EFI zboot support for LoongArch64 Signed-off-by: Ard Biesheuvel commit f55793403c53ffaaaca43948498ed2b8896d9615 Author: Ard Biesheuvel Date: Mon May 2 17:40:34 2022 +0200 riscv: efi: enable generic EFI compressed boot Wire up the generic EFI zboot support for RISC-V. Signed-off-by: Ard Biesheuvel Acked-by: Palmer Dabbelt Tested-by: Conor Dooley commit a050910972bb25152b42ad2e544652117c5ad915 Author: Ard Biesheuvel Date: Mon May 2 01:08:16 2022 +0200 efi/libstub: implement generic EFI zboot Implement a minimal EFI app that decompresses the real kernel image and launches it using the firmware's LoadImage and StartImage boot services. This removes the need for any arch-specific hacks. Note that on systems that have UEFI secure boot policies enabled, LoadImage/StartImage require images to be signed, or their hashes known a priori, in order to be permitted to boot. There are various possible strategies to work around this requirement, but they all rely either on overriding internal PI/DXE protocols (which are not part of the EFI spec) or omitting the firmware provided LoadImage() and StartImage() boot services, which is also undesirable, given that they encapsulate platform specific policies related to secure boot and measured boot, but also related to memory permissions (whether or not and which types of heap allocations have both write and execute permissions.) The only generic and truly portable way around this is to simply sign both the inner and the outer image with the same key/cert pair, so this is what is implemented here. Signed-off-by: Ard Biesheuvel commit 6b2fe3df7c0ca3cf9ee9cea4470462fa708baf87 Author: Johan Hovold Date: Mon Sep 19 15:24:56 2022 +0200 USB: serial: ftdi_sio: clean up driver prefix Drop the "sio" infix from the few remaining definitions and symbol names that still had it. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit a8619505a7780e30db259e01a643eca621e963d3 Author: Johan Hovold Date: Mon Sep 19 15:24:55 2022 +0200 USB: serial: ftdi_sio: move driver structure Move the definition of the USB serial driver structure to the end of the file where it is used and drop the now redundant forward declarations. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit c142bdc5c7207018efa1928317b1e708eda05e09 Author: Johan Hovold Date: Mon Sep 19 15:24:54 2022 +0200 USB: serial: ftdi_sio: clean up attribute visibility logic Clean up the attribute visibility logic by defaulting to attributes being visible and explicitly listing the exceptions. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 02d6f9a13ef3316da5c64540c5a376f07781c853 Author: Thomas Zimmermann Date: Fri Sep 9 12:59:47 2022 +0200 drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro Provide DRM_PLANE_NON_ATOMIC_FUNCS, which initializes plane functions of non-atomic drivers to default values. The macro is not supposed to be used in new code, but helps with documenting and finding existing users. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Laurent Pinchart Reviewed-by: Lyude Paul # nouveau Link: https://patchwork.freedesktop.org/patch/msgid/20220909105947.6487-5-tzimmermann@suse.de commit fa0706e9775c10a9028e0b8d74c274cd4a179fda Author: Thomas Zimmermann Date: Fri Sep 9 12:59:46 2022 +0200 drm/plane-helper: Warn if atomic drivers call non-atomic helpers The plane update and disable helpers are only useful for non-atomic drivers. Print a warning if an atomic driver calls them. Suggested-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220909105947.6487-4-tzimmermann@suse.de commit e71def057252c0b5189618ecbc7141b56db4a74b Author: Thomas Zimmermann Date: Fri Sep 9 12:59:45 2022 +0200 drm/plane: Allocate planes with drm_universal_plane_alloc() Provide drm_univeral_plane_alloc() to allocate and initialize a plane. Code for non-atomic drivers uses this pattern. Convert them to the new function. The modeset helpers contain a quirk for handling their color formats differently. Set the flag outside plane allocation. The new function is already deprecated to some extend. Drivers should rather use drmm_univeral_plane_alloc() or drm_universal_plane_init(). v2: * kerneldoc fixes (Javier) * grammar fixes in commit message Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Lyude Paul # nouveau Link: https://patchwork.freedesktop.org/patch/msgid/20220909105947.6487-3-tzimmermann@suse.de commit 7221941c4f3249f6e67090820c827326e2e4459f Author: Thomas Zimmermann Date: Fri Sep 9 12:59:44 2022 +0200 drm/plane: Remove drm_plane_init() Open-code drm_plane_init() and remove the function from DRM. The implementation of drm_plane_init() is a simple wrapper around a call to drm_universal_plane_init(), so drivers can just use that instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Laurent Pinchart Reviewed-by: Lyude Paul # nouveau Acked-by: Jyri Sarha Link: https://patchwork.freedesktop.org/patch/msgid/20220909105947.6487-2-tzimmermann@suse.de commit ee34b77f681e9656d229b1df48ea67f019bb6335 Author: Jiapeng Chong Date: Mon Sep 19 18:30:58 2022 +0800 drm/atomic-helper: Fix kernel-doc drivers/gpu/drm/drm_atomic_helper.c:802: warning: expecting prototype for drm_atomic_helper_check_wb_connector_state(). Prototype was for drm_atomic_helper_check_wb_encoder_state() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2216 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220919103058.25561-1-jiapeng.chong@linux.alibaba.com commit 42e53b447cf890b10b4872c967e9f81fd2b06067 Merge: ed48cfedf1e22 cd63454902d06 Author: Paolo Abeni Date: Tue Sep 20 09:13:44 2022 +0200 Merge branch 'ice-l2tpv3-offload-support' Tony Nguyen says: ==================== ice: L2TPv3 offload support Wojciech Drewek says: Add support for dissecting L2TPv3 session id in flow dissector. Add support for this field in tc-flower and support offloading L2TPv3. Finally, add support for hardware offload of L2TPv3 packets based on session id in switchdev mode in ice driver. Example filter: # tc filter add dev $PF1 ingress prio 1 protocol ip \ flower \ ip_proto l2tp \ l2tpv3_sid 1234 \ skip_sw \ action mirred egress redirect dev $VF1_PR Changes in iproute2 are required to use the new fields. ICE COMMS DDP package is required to create a filter in ice. COMMS DDP package contains profiles of more advanced protocols. Without COMMS DDP package hw offload will not work, however sw offload will still work. ==================== Link: https://lore.kernel.org/r/20220908171644.1282191-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit cd63454902d067b27453823aa471949a7cc7390a Author: Marcin Szycik Date: Thu Sep 8 10:16:44 2022 -0700 ice: Add L2TPv3 hardware offload support Add support for offloading packets based on L2TPv3 session id in switchdev mode. Example filter: tc filter add dev $PF1 ingress prio 1 protocol ip flower ip_proto l2tp \ l2tpv3_sid 1234 skip_sw action mirred egress redirect dev $VF1_PR Changes in iproute2 are required to be able to specify l2tpv3_sid. ICE COMMS DDP package is required to create a filter as it contains L2TPv3 profiles. Reviewed-by: Michal Swiatkowski Signed-off-by: Marcin Szycik Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 2c1befaced504a125d1ab7479684a9208879d350 Author: Wojciech Drewek Date: Thu Sep 8 10:16:43 2022 -0700 flow_offload: Introduce flow_match_l2tpv3 Allow to offload L2TPv3 filters by adding flow_rule_match_l2tpv3. Drivers can extract L2TPv3 specific fields from now on. Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 8b189ea08c334f25dbb3d076f8adb8b80491d01d Author: Wojciech Drewek Date: Thu Sep 8 10:16:42 2022 -0700 net/sched: flower: Add L2TPv3 filter Add support for matching on L2TPv3 session ID. Session ID can be specified only when ip proto was set to IPPROTO_L2TP. Example filter: # tc filter add dev $PF1 ingress prio 1 protocol ip \ flower \ ip_proto l2tp \ l2tpv3_sid 1234 \ skip_sw \ action mirred egress redirect dev $VF1_PR Acked-by: Guillaume Nault Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit dda2fa08a13c688bed320ef2e4ba541abb4d6c17 Author: Wojciech Drewek Date: Thu Sep 8 10:16:41 2022 -0700 flow_dissector: Add L2TPv3 dissectors Allow to dissect L2TPv3 specific field which is: - session ID (32 bits) L2TPv3 might be transported over IP or over UDP, this implementation is only about L2TPv3 over IP. IP protocol carries L2TPv3 when ip_proto is IPPROTO_L2TP (115). Acked-by: Guillaume Nault Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 65b32f801bfbc54dc98144a6ec26082b59d131ee Author: Wojciech Drewek Date: Thu Sep 8 10:16:40 2022 -0700 uapi: move IPPROTO_L2TP to in.h IPPROTO_L2TP is currently defined in l2tp.h, but most of ip protocols are defined in in.h file. Move it there in order to keep code clean. Acked-by: Guillaume Nault Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 971479115444e9f575226e76d5443e6e90954e78 Author: Uwe Kleine-König Date: Sat Sep 17 23:37:29 2022 +0200 gpio: twl4030: Reorder functions which allows to drop a forward declaraion There is no cyclic dependency between gpio_twl4030_probe() and gpio_twl4030_remove(), so by moving the latter before the former the forward declaration can be dropped. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 1fbef61beaad9d54f977947cecc9e9d4b34b3dfd Author: Matt Ranostay Date: Fri Sep 9 13:00:26 2022 -0700 phy: ti: phy-j721e-wiz: stop name conflict if multiple serdes are initialized When multiple serdes instances are initialized the first will succeed but additional will conflict over clocks names and probing fails. Signed-off-by: Matt Ranostay Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220909200026.3422-1-mranostay@ti.com Signed-off-by: Vinod Koul commit 639205ed206f98fcfa826933946f0844615784ea Author: Robin Murphy Date: Wed Sep 7 14:38:33 2022 +0100 swiotlb: don't panic! The panics in swiotlb are relics of a bygone era, some of them inadvertently inherited from a memblock refactor, and all of them unnecessary since they are in places that may also fail gracefully anyway. Convert the panics in swiotlb_init_remap() into non-fatal warnings more consistent with the other bail-out paths there and in swiotlb_init_late() (but don't bother trying to roll anything back, since if anything does actually fail that early, the aim is merely to keep going as far as possible to get more diagnostic information out of the inevitably-dying kernel). It's not for SWIOTLB to decide that the system is terminally compromised just because there *might* turn out to be one or more 32-bit devices that might want to make streaming DMA mappings, especially since we already handle the no-buffer case later if it turns out someone did want it. Similarly though, downgrade that panic in swiotlb_tbl_map_single(), since even if we do get to that point it's an overly extreme reaction. It makes little difference to the DMA API caller whether a mapping fails because the buffer is full or because there is no buffer, and once again it's not for SWIOTLB to presume that any particular DMA mapping is so fundamental to the operation of the system that it must be terminal if it could never succeed. Even if the caller handles failure by futilely retrying forever, a single stuck thread is considerably less impactful to the user than a needless panic. Signed-off-by: Robin Murphy Signed-off-by: Christoph Hellwig commit 1d61261bfe8ae34764aa5a9d68af4ab15237719e Author: Fabio M. De Francesco Date: Thu Sep 1 15:29:06 2022 +0200 swiotlb: replace kmap_atomic() with memcpy_{from,to}_page() The use of kmap_atomic() is being deprecated in favor of kmap_local_page(), which can also be used in atomic context (including interrupts). Replace kmap_atomic() with kmap_local_page(). Instead of open coding mapping, memcpy(), and un-mapping, use the memcpy_{from,to}_page() helper. Suggested-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Signed-off-by: Christoph Hellwig commit 8b10ca2f7551e024b60ab5e27d3e3630c029000a Author: Michael Walle Date: Fri Sep 16 13:01:18 2022 +0200 gpiolib: fix OOB access in quirk callbacks Commit a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") introduced an array of quirk functions which get iterated over. But a sentinal value is missing. Add it. Fixes: a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") Signed-off-by: Michael Walle Reviewed-by: Linus Walleij Tested-by: Conor Dooley Reviewed-by: Dmitry Torokhov Tested-by: Marek Szyprowski Tested-by: Biju Das Signed-off-by: Bartosz Golaszewski commit 931c05a8cb1be029ef2fbc1e4af313d4cb297c47 Author: Chunfeng Yun Date: Wed Sep 14 14:07:46 2022 +0800 phy: phy-mtk-tphy: fix the phy type setting issue The PHY type is not set if the index is non zero, prepare type value according to the index, like as mask value. Fixes: 39099a443358 ("phy: phy-mtk-tphy: support type switch by pericfg") Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220914060746.10004-7-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 1e77f026eb094cac123e701f97a8c042c82b32a3 Author: Chunfeng Yun Date: Wed Sep 14 14:07:45 2022 +0800 phy: phy-mtk-tphy: set utmi 0 register in init() ops No need repeat to clear utmi 0 register in ->power_on() and ->power_off(), just do it in ->init() Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220914060746.10004-6-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 3fbbb75c40e6c51bff67dd17959d855fb497c901 Author: Chunfeng Yun Date: Wed Sep 14 14:07:44 2022 +0800 phy: phy-mtk-tphy: disable gpio mode for all usb2 phys Disable DP/DM's GPIO mode for all usb2 phy, not only for the first usb2 phy which usually supports dual-role mode. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220914060746.10004-5-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 8da71ebad8455cde05bb6c148c84f3954b788497 Author: Chunfeng Yun Date: Wed Sep 14 14:07:43 2022 +0800 phy: phy-mtk-tphy: disable hardware efuse when set INTR INTR's value is able autoload from hardware efuse by default, when software tries to update its value, should disable hardware efuse firstly. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220914060746.10004-4-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 930981b425d94fc09e7597779cda870b1838bc99 Author: Chunfeng Yun Date: Wed Sep 14 14:07:42 2022 +0800 phy: phy-mtk-tphy: add property to set pre-emphasis Add a property to set usb2 phy's pre-emphasis, it's disabled by default on some SoCs. Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220914060746.10004-3-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 54511f207ca7b3e63c1fbfed949c8ef7a3faaf2b Author: Chunfeng Yun Date: Wed Sep 14 14:07:41 2022 +0800 dt-bindings: phy: mediatek,tphy: add property to set pre-emphasis Add a property to set usb2 phy's pre-emphasis, which used to widen eye opening and boost eye swing. Acked-by: Krzysztof Kozlowski Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220914060746.10004-2-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 0d14f4912606c4858fbe923ac4991c2030f3b9aa Author: Chunfeng Yun Date: Wed Sep 14 14:07:40 2022 +0800 dt-bindings: phy: mediatek,tphy: add support type of SGMII Add support ethernet SGMII, forgot to update type supported. Fixes: c01608b3b46b ("dt-bindings: phy: mediatek: tphy: support type switch by pericfg") Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220914060746.10004-1-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 8b8934ac6de5da734ebe1b693cc475d11515888f Author: Yang Yingliang Date: Wed Sep 14 21:37:28 2022 +0800 phy: rockchip-snps-pcie3: Use devm_platform_get_and_ioremap_resource() Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220914133728.3781160-1-yangyingliang@huawei.com Signed-off-by: Vinod Koul commit c4c349be07aeec5f397a349046dc5fc0f2657691 Author: Liang He Date: Thu Sep 15 17:35:06 2022 +0800 phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent() As the of_get_parent() will increase the refcount of the node->parent and the reference will be discarded, so we should hold the reference with which we can decrease the refcount when done. Fixes: 8eff8b4e22d9 ("phy: amlogic: phy-meson-axg-mipi-pcie-analog: add support for MIPI DSI analog") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220915093506.4009456-1-windhl@126.com Signed-off-by: Vinod Koul commit 92086b884caf6ff02fda75084a331e70b0e26f81 Author: Geert Uytterhoeven Date: Wed Sep 14 16:17:37 2022 +0200 dt-bindings: phy: renesas,rcar-gen2-usb-phy: Convert to json-schema Convert the Renesas R-Car Gen2 USB PHY Device Tree binding documentation to json-schema. Add missing properties. Rename the device node from "usb-phy" to "usb-phy-controller", as it does not represent a USB PHY itself, and thus does not have a "#phy-cells" property. Rename the child nodes from "usb-channel" to "usb-phy", as these do represent USB PHYs. Drop the second example, as it doesn't add any value. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/dbdcffd009302734fe2fb895ce04b72fa1ea4355.1663165000.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit f5d6b5d613e9135e78cd91632a6ed4d04c4e5e49 Author: Johan Hovold Date: Mon Sep 19 11:57:00 2022 +0200 phy: qcom-qmp-combo: fix sc8280xp PCS_USB offset The PCS_USB register block lives at an offset of 0x300 from the PCS region on SC8280XP so add the missing offset to avoid corrupting unrelated registers on runtime suspend. Note that this region should probably be described separately in the binding. Fixes: a2e927b0e50d ("phy: qcom-qmp-combo: Add sc8280xp USB/DP combo phys") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220919095700.2228-1-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit b8ecfbaf2e7268d4f934678d00a3849eda0cf7c9 Author: Chris Morgan Date: Mon Sep 19 11:46:15 2022 -0500 phy: rockchip: inno-dsidphy: Add support for rk3568 Add support for the Rockchip RK3568 DSI-DPHY. Registers were taken from the BSP kernel driver and wherever possible cross referenced with the TRM. Refactor the code to allow the different compatible strings to set either a max 1GHz timing table (all existing hardware) or a max 2.5GHz timing table (the new RK356x). This works (for me) on both an RK3326 (PX30) and a new RK3566 device. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20220919164616.12492-3-macroalpha82@gmail.com Signed-off-by: Vinod Koul commit 4b507195a4c3afa0b4365a34555fd6735ae7e8bc Author: Chris Morgan Date: Mon Sep 19 11:46:14 2022 -0500 dt-bindings: phy-rockchip-inno-dsidphy: add compatible for rk3568 Add a compatible string for the rk3568 dsi-dphy. Signed-off-by: Chris Morgan Acked-by: Rob Herring Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220919164616.12492-2-macroalpha82@gmail.com Signed-off-by: Vinod Koul commit c6fe6be65aeaa03c7cdfc807b47c1e59b9c9ea71 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:41 2022 +0200 ALSA: hda: ext: remove always-true conditions on host and link release By construction a host and link DMA are always decoupled. This decoupling happens in the assign() phase. There's no point in checking if the two parts are decoupled, this is by-design always-true. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit ac3467ad7f8734a21b65fa1852316a9b1b8c1fad Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:40 2022 +0200 ALSA: hda: ext: fix locking in stream_release The snd_hdac_ext_stream_release() routine uses the bus reg_lock, but releases it before calling snd_hdac_stream_release() where the bus reg_lock is taken again. This creates a timing window where the link stream release could test an invalid 'opened' boolean status and fail to recouple the host and link parts. Fix by exposing a locked version of snd_hdac_stream_release() and use it without releasing the spinlock. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 53f4f6b4e56d5fb6ef95a7e14c10ec244a79b996 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:39 2022 +0200 ALSA: hda: ext: simplify logic for stream assignment The logic is needlessly complicated, the basic rule is: The host streams can be found by checking the 'opened' boolean. The link streams can be found by checking the 'link_locked' boolean. Once a stream is found, it can be unconditionally decoupled. The snd_hdac_ext_stream_decouple_locked() routine will make sure the register status is modified as needed and the 'decoupled' boolean set. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 24ad3835a6db4f8857975effa6bf47730371a5ff Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:38 2022 +0200 ALSA: hda: add snd_hdac_stop_streams() helper Minor code reuse, no functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 0839a04eff9778c3dc37d3a1bb8014a3386dece7 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:37 2022 +0200 ALSA: hda: Use hdac_ext prefix in snd_hdac_stream_free_all() for clarity Make sure there's no ambiguity on layering with the appropriate prefix added. Pure rename, no functionality changed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 791d132a070a8358227b008c0ddda5f4d6f32cc2 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:36 2022 +0200 ALSA: hda: ext: make snd_hdac_ext_stream_init() static There are no external users of this helper, move to static and remove sympol export. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit ea2ddd2559dc6d1c4b66ccd49314add35ece9062 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:35 2022 +0200 ALSA: hda: document state machine for hdac_streams The code in this library is far from self-explanatory, hopefully this state diagram reverse-engineered from the code will help others understand the expected transitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 2ea13c83bf7bb3471e33b2d902b101af977ef2d4 Author: Pierre-Louis Bossart Date: Mon Sep 19 14:10:34 2022 +0200 ALSA: hda: make snd_hdac_stream_clear() static This helper has no users outside of hdac_stream.c. External users should only use snd_hdac_stream_start() and snd_hdac_stream_stop(). No functional change beyond making the function static and removing the symbol export. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919121041.43463-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit be7038238bd0f5a7c1aa10fb53b34383c91e4f8c Author: Iskren Chernev Date: Mon Sep 19 21:06:15 2022 +0300 dt-bindings: phy: qcom,qmp-ufs: Fix SM6115 clocks, regs The Sm6115 UFS PHY has 2 clocks and 3 regs. Signed-off-by: Iskren Chernev Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220919180618.1840194-6-iskren.chernev@gmail.com Signed-off-by: Vinod Koul commit 264dac74e7a31a726bd0bee3d1403faa1e2ae529 Author: Johan Hovold Date: Fri Sep 16 12:23:40 2022 +0200 phy: qcom-qmp-usb: drop legacy DT workaround Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy" and they had been added to the binding less than six months before the binding was fixed. Presumably no one is using four-year old SDM845 dtbs with mainline anymore so drop the workaround for malformed devicetrees. In the unlikely event that anyone complains, we can consider reverting. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-12-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 638255587418a31eadc5b24105c3cee288ae1d0f Author: Johan Hovold Date: Fri Sep 16 12:23:39 2022 +0200 phy: qcom-qmp-ufs: drop legacy DT workaround Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy" and they had been added to the binding less than six months before the binding was fixed. Presumably no one is using four-year old SDM845 dtbs with mainline anymore so drop the workaround for malformed devicetrees. In the unlikely event that anyone complains, we can consider reverting. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-11-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 064bbdba4f8d30f9ecd0b96c3bcca5535d8811e7 Author: Johan Hovold Date: Fri Sep 16 12:23:38 2022 +0200 phy: qcom-qmp-combo: drop unused legacy DT workaround Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy", neither of which is a combo PHY. Drop the workaround for malformed devicetrees, which should no longer be needed since the QMP driver split. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-10-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 69c90cb51661290e2f49e3d4c18cbbbe56749337 Author: Johan Hovold Date: Fri Sep 16 12:23:37 2022 +0200 phy: qcom-qmp-pcie: drop unused legacy DT workaround Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy", neither of which is a PCIe PHY. Drop the workaround for malformed devicetrees, which should no longer be needed since the QMP driver split. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-9-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 79a03925f79e4cfada997db7af1fcd3e958c1a2a Author: Johan Hovold Date: Fri Sep 16 12:23:36 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling The MSM8996 QMP PHY driver does not use the PCS_MISC IO region (and neither do the DT binding specify it) so remove the corresponding code from the driver. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-8-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit a5d6b1ac56cbd6b5850a3a54e35f1cb71e8e8cdd Author: Johan Hovold Date: Fri Sep 16 12:23:35 2022 +0200 phy: qcom-qmp-usb: fix memleak on probe deferral Switch to using the device-managed of_iomap helper to avoid leaking memory on probe deferral and driver unbind. Note that this helper checks for already reserved regions and may fail if there are multiple devices claiming the same memory. Two bindings currently rely on overlapping mappings for the PCS region so fallback to non-exclusive mappings for those for now. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-7-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ef74a97f0df8758efe4476b4645961286aa86f0d Author: Johan Hovold Date: Fri Sep 16 12:23:34 2022 +0200 phy: qcom-qmp-ufs: fix memleak on probe deferral Switch to using the device-managed of_iomap helper to avoid leaking memory on probe deferral and driver unbind. Note that this helper checks for already reserved regions and may fail if there are multiple devices claiming the same memory. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-6-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 2de8a325b1084330ae500380cc27edc39f488c30 Author: Johan Hovold Date: Fri Sep 16 12:23:33 2022 +0200 phy: qcom-qmp-combo: fix memleak on probe deferral Switch to using the device-managed of_iomap helper to avoid leaking memory on probe deferral and driver unbind. Note that this helper checks for already reserved regions and may fail if there are multiple devices claiming the same memory. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-5-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 1f69ededf8e80c42352e7f1c165a003614de9cc2 Author: Johan Hovold Date: Fri Sep 16 12:23:32 2022 +0200 phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral Switch to using the device-managed of_iomap helper to avoid leaking memory on probe deferral and driver unbind. Note that this helper checks for already reserved regions and may fail if there are multiple devices claiming the same memory. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4be26f695ffa458b065b7942dbff9393bf0836ea Author: Johan Hovold Date: Fri Sep 16 12:23:31 2022 +0200 phy: qcom-qmp-pcie: fix memleak on probe deferral Switch to using the device-managed of_iomap helper to avoid leaking memory on probe deferral and driver unbind. Note that this helper checks for already reserved regions and may fail if there are multiple devices claiming the same memory. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ecd5507e72ea03659dc2cc3e4393fbf8f4e2e02a Author: Johan Hovold Date: Fri Sep 16 12:23:30 2022 +0200 phy: qcom-qmp-pcie: add pcs_misc sanity check Make sure that the (otherwise) optional pcs_misc IO region has been provided in case the configuration specifies a corresponding initialisation table to avoid crashing with malformed device trees. Note that the related debug message is now superfluous as the region is only used when the configuration has a pcs_misc table. Fixes: 421c9a0e9731 ("phy: qcom: qmp: Add SDM845 PCIe QMP PHY support") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit b767dedc05ec92a11e99bd9e4ec18ce6abe02388 Author: Johan Hovold Date: Wed Sep 7 13:07:28 2022 +0200 phy: qcom-qmp-usb: shorten function prefixes The driver function prefix has gotten unnecessarily long and hurts readability. Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm Multi PHY" or similar anyway). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-17-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4412817b12da6bb99e0590ab1c9cd3e894fc93d5 Author: Johan Hovold Date: Wed Sep 7 13:07:27 2022 +0200 phy: qcom-qmp-ufs: shorten function prefixes The driver function prefix has gotten unnecessarily long and hurts readability. Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm Multi PHY" or similar anyway). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-16-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit c577468c77f9f43a5e2f09de21573f97aaea6bd6 Author: Johan Hovold Date: Wed Sep 7 13:07:26 2022 +0200 phy: qcom-qmp-pcie-msm8996: shorten function prefixes The driver function prefix has gotten unnecessarily long and hurts readability. Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm Multi PHY" or similar anyway). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-15-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit d0eec88b38a4302113508a41366efc7ce9446cae Author: Johan Hovold Date: Wed Sep 7 13:07:25 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused secondary init tables Drop the secondary register initialisation tables which aren't used by this driver. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-14-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit e5cedefa7203c787ccadaa3e2400d0b8e252a0c1 Author: Johan Hovold Date: Wed Sep 7 13:07:24 2022 +0200 phy: qcom-qmp-combo: shorten function prefixes The driver function prefix has gotten unnecessarily long and hurts readability. Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm Multi PHY" or similar anyway). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-13-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit d44c3e1a1e02cb12496bfc7e03c7957c32f9de4c Author: Johan Hovold Date: Wed Sep 7 13:07:23 2022 +0200 phy: qcom-qmp: silence noisy probe Drivers should in general not log anything during unless there are errors. Drop the pointless registration info message from the QMP drivers. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-12-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 613b30244b87d791b4da8c0a6cb06a3ca9935272 Author: Johan Hovold Date: Wed Sep 7 13:07:22 2022 +0200 phy: qcom-qmp-usb: drop unused defines Drop defines and enums that are unused since the QMP driver split. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220907110728.19092-11-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit e57655e66806750785f9121c98a962404d02395b Author: Johan Hovold Date: Wed Sep 7 13:07:21 2022 +0200 phy: qcom-qmp-usb: disable runtime PM on unbind Make sure to disable runtime PM also on driver unbind. Fixes: ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-10-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 6d07bd6f46017aca6648fe387884916b36243096 Author: Johan Hovold Date: Wed Sep 7 13:07:20 2022 +0200 phy: qcom-qmp-ufs: drop unused defines Drop defines and enums that are unused since the QMP driver split. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220907110728.19092-9-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit b3a467d9c6d1a1b6e93104bf5c093b16f2fa3c9e Author: Johan Hovold Date: Wed Sep 7 13:07:19 2022 +0200 phy: qcom-qmp-ufs: drop unused runtime PM implementation Drop the unused and incomplete runtime PM implementation, which was only used by USB PHYs before splitting the QMP driver. Note that the runtime PM was never disabled (and state restored) on driver unbind. This effectively reverts commit ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-8-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 7936e5f32fd0ef6b123ed9e7390f3f4047c24770 Author: Johan Hovold Date: Wed Sep 7 13:07:18 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused defines Drop defines and enums that are unused since the QMP driver split. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220907110728.19092-7-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit cec61c070d408703c40446022f579ecb2aa050dc Author: Johan Hovold Date: Wed Sep 7 13:07:17 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop unused runtime PM implementation Drop the unused and incomplete runtime PM implementation, which was only used by USB PHYs before splitting the QMP driver. Note that the runtime PM was never disabled (and state restored) on driver unbind. This effectively reverts commit ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-6-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 52d8d441a8546b836a91619a0c21cc7c4103cad4 Author: Johan Hovold Date: Wed Sep 7 13:07:16 2022 +0200 phy: qcom-qmp-pcie: drop unused defines Drop defines and enums that are unused since the QMP driver split. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-5-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 9062e92a241b2c2ef9ba11403d73c812347e725b Author: Johan Hovold Date: Wed Sep 7 13:07:15 2022 +0200 phy: qcom-qmp-pcie: drop unused runtime PM implementation Drop the unused and incomplete runtime PM implementation, which was only used by USB PHYs before splitting the QMP driver. Note that the runtime PM was never disabled (and state restored) on driver unbind. This effectively reverts commit ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit beee6ed1d63f28284b3d2d9bc01c56436d4e9311 Author: Johan Hovold Date: Wed Sep 7 13:07:14 2022 +0200 phy: qcom-qmp-combo: drop unused defines Drop defines and enums that are unused since the QMP driver split. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4382d518d1887e62234560ea08a0203d11d28cc1 Author: Johan Hovold Date: Wed Sep 7 13:07:13 2022 +0200 phy: qcom-qmp-combo: disable runtime PM on unbind Make sure to disable runtime PM also on driver unbind. Fixes: ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220907110728.19092-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit fc6f923ecfa2fafd0600f1b7e2de09baf29865e2 Author: Jaroslav Kysela Date: Mon Sep 19 15:54:44 2022 +0200 ALSA: hda/hdmi: Fix the converter allocation for the silent stream Track the converters handling the silent stream using a new variable to avoid mixing of the open/close and silent stream use. This change ensures the proper allocation of the converters. Fixes: 5f80d6bd2b01 ("ALSA: hda/hdmi: Fix the converter reuse for the silent stream") Signed-off-by: Jaroslav Kysela Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220919135444.3554982-1-perex@perex.cz Signed-off-by: Takashi Iwai commit bfbbfb269398ba6f7467a487828c263afe04dcb3 Merge: 7883017bbcc55 496322302bf1e Author: Takashi Iwai Date: Tue Sep 20 07:56:53 2022 +0200 Merge branch 'for-linus' into for-next commit 503ae285944a5e99ad3e0c36852ffe2680288418 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:21 2022 +0800 soundwire: intel: add helper to stop bus We have three nearly identical sequences to stop the clock, let's introduce a helper to reuse the same code. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-12-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 8d875da7319de6c6b89d2644cd1e36b8d5ac5eb5 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:20 2022 +0800 soundwire: intel: introduce helpers to start bus There are 3 different sequences to start the bus, let's move the functionality to helpers. There should be no functionality change, except in error cases where the flow is improved with more consistent disabling of interrupts and powering down. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 0f3c54c22ae19c1ad86afb138c45424645213a44 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:19 2022 +0800 soundwire: intel: introduce intel_shim_check_wake() helper Add new helper before code partitioning in order to avoid direct read from specific register. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-10-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 0b59d4c9475893fa1fa435502c0e0cc6df879ac9 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:18 2022 +0800 soundwire: intel: simplify read ops assignment We can assign the right callback directly in the ops structure. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-9-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit b81bcdb424d05a18b4e928e2f9f6c25d90c5c35d Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:17 2022 +0800 soundwire: intel: remove intel_init() wrapper We can directly call intel_link_power_up and do power_up+shim_init in the same function. This simplifies the code with a better symmetry between power_up and power_down operations. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-8-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit bc8729476a537ff372c33588189c6ef5b39ce081 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:16 2022 +0800 soundwire: intel: move shim initialization before power up/down Move code around before additional simplification. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-7-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit a658fd8d2b60f040ea042fd79bbd9c58e5f2b911 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:15 2022 +0800 soundwire: intel: remove clock_stop parameter in intel_shim_init() Simplify signature before further code reshuffling. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 30cbae662ba989ada383cf3db2a4c6400b9ae1fc Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:14 2022 +0800 soundwire: intel: move all PDI initialization under intel_register_dai() Start regrouping functionality in high-level functions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-5-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit aa425707c3c8aacfbc37b88a68d89b909b6291c3 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:13 2022 +0800 soundwire: intel: move DAI registration and debugfs init earlier These two steps can and should be done before starting up the clock and the bus operation. This is a first step before re-grouping functionality in well-defined callbacks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 54f391dd1b9fc34b37fc1824f9bd24430167f683 Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:12 2022 +0800 soundwire: intel: simplify flow and use devm_ for DAI registration We already use devm_ for memory allocation but not for component/DAI registration. The resource management can be based on devm_ in all cases. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit c6867cda906aadbce5e71efde9c78a26108b2bad Author: Pierre-Louis Bossart Date: Tue Sep 20 01:57:11 2022 +0800 soundwire: intel: fix error handling on dai registration issues The call to intel_register_dai() may fail because of memory allocation issues or problems reported by the ASoC core. In all cases, when a error is thrown the component is not registered, it's invalid to unregister it. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit bafb1eacfbd98c6cdbca7e1723ef933ad371cd51 Author: Richard Fitzgerald Date: Sat Sep 17 16:48:22 2022 +0100 soundwire: cadence: Simplify error paths in cdns_xfer_msg() There's no need to goto an exit label to return from cdns_xfer_msg(). It doesn't do any cleanup, only a return statement. Replace the gotos with returns. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220917154822.690472-2-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 7f6bad4dfde0ec1d479fdcbbb62bccdbf3a93bb4 Author: Richard Fitzgerald Date: Sat Sep 17 16:48:21 2022 +0100 soundwire: cadence: Fix error check in cdns_xfer_msg() _cdns_xfer_msg() returns an sdw_command_response value, not a negative error code. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220917154822.690472-1-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 3ed96fb4a6d8426f766687ff02fc5fb5f91575fd Author: Richard Fitzgerald Date: Sat Sep 17 13:35:17 2022 +0100 soundwire: cadence: Write to correct address for each FIFO chunk _cdns_xfer_msg() must add the fragment offset to msg->addr to get the base target address of each FIFO chunk. Otherwise every chunk will be written to the first 32 register addresses. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220917123517.229153-1-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 560458df5f144fb3547a9fde8e0b7b2143ef0711 Author: Richard Fitzgerald Date: Sat Sep 17 15:02:56 2022 +0100 soundwire: bus: Fix wrong port number in sdw_handle_slave_alerts() for_each_set_bit() gives the bit-number counting from 0 (LSbit==0). When processing INTSTAT2, bit 0 is DP4 so the port number is (bit + 4). Likewise for INTSTAT3 bit 0 is DP11 so port number is (bit + 11). Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220917140256.689678-1-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit ed8d07acec73c34cbebd209ff7a37051424de60c Author: Srinivas Kandagatla Date: Fri Sep 16 14:53:52 2022 +0100 soundwire: qcom: do not send status of device 0 during alert Device0 can not be in alert status. And for consistency reasons do not send status of device0 to core. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916135352.19114-2-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 8039b6f3e5c777e41df34f8e996af18555a4f303 Author: Srinivas Kandagatla Date: Fri Sep 16 14:53:51 2022 +0100 soundwire: qcom: update status from device id 1 By default autoenumeration is enabled on QCom SoundWire controller which means the core should not be dealing with device 0 w.r.t enumeration. During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and start programming the device id, however reading DEVID registers return zeros which does not match to any of the slaves in the list and the core attempts to park this device to Group 13. This results in adding SoundWire device with enumeration address 0:0:0:0 Fix this by not passing device 0 status to SoundWire core. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916135352.19114-1-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit ba05b39d265bdd16913f7684600d9d41e2796745 Author: Richard Fitzgerald Date: Fri Sep 16 11:35:05 2022 +0100 soundwire: cadence: Don't overwrite msg->buf during write commands The buf passed in struct sdw_msg must only be written for a READ, in that case the RDATA part of the response is the data value of the register. For a write command there is no RDATA, and buf should be assumed to be const and unmodifable. The original caller should not expect its data buffer to be corrupted by an sdw_nwrite(). Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916103505.1562210-1-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 72124f07f0fab446caeea1f545d8c58b7549a899 Author: Richard Fitzgerald Date: Wed Sep 14 17:02:48 2022 +0100 soundwire: bus: Don't exit early if no device IDs were programmed Only exit sdw_handle_slave_status() right after calling sdw_program_device_num() if it actually programmed an ID into at least one device. sdw_handle_slave_status() should protect itself against phantom device #0 ATTACHED indications. In that case there is no actual device still on #0. The early exit relies on there being a status change to ATTACHED on the reprogrammed device to trigger another call to sdw_handle_slave_status() which will then handle the status of all peripherals. If no device was actually programmed with an ID there won't be a new ATTACHED indication. This can lead to the status of other peripherals not being handled. The status passed to sdw_handle_slave_status() is obviously always from a point of time in the past, and may indicate accumulated unhandled events (depending how the bus manager operates). It's possible that a device ID is reprogrammed but the last PING status captured state just before that, when it was still reporting on ID #0. Then sdw_handle_slave_status() is called with this PING info, just before a new PING status is available showing it now on its new ID. So sdw_handle_slave_status() will receive a phantom report of a device on #0, but it will not find one. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220914160248.1047627-6-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 0c5e99c41504b74dcfa9f3643f55cacab5c1e41f Author: Richard Fitzgerald Date: Wed Sep 14 17:02:47 2022 +0100 soundwire: cadence: Fix lost ATTACHED interrupts when enumerating The correct way to handle interrupts is to clear the bits we are about to handle _before_ handling them. Thus if the condition then re-asserts during the handling we won't lose it. This patch changes cdns_update_slave_status_work() to do this. The previous code cleared the interrupts after handling them. The problem with this is that when handling enumeration of devices the ATTACH statuses can be accidentally cleared and so some or all of the devices never complete their enumeration. Thus we can have a situation like this: - one or more devices are reverting to ID #0 - accumulated status bits indicate some devices attached and some on ID #0. (Remember: status bits are sticky until they are handled) - Because of device on #0 sdw_handle_slave_status() programs the device ID and exits without handling the other status, expecting to get an ATTACHED from this reprogrammed device. - The device immediately starts reporting ATTACHED in PINGs, which will assert its CDNS_MCP_SLAVE_INTSTAT_ATTACHED bit. - cdns_update_slave_status_work() clears INTSTAT0/1. If the initial status had CDNS_MCP_SLAVE_INTSTAT_ATTACHED bit set it will be cleared. - The ATTACHED change for the device has now been lost. - cdns_update_slave_status_work() clears CDNS_MCP_INT_SLAVE_MASK so if the new ATTACHED state had set it, it will be cleared without ever having been handled. Unless there is some other state change from another device to cause a new interrupt, the ATTACHED state of the reprogrammed device will never cause an interrupt so its enumeration will not be completed. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220914160248.1047627-5-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 7297f8fa9a4312701c5066cd0d22e1a252cbb2d7 Author: Richard Fitzgerald Date: Wed Sep 14 17:02:46 2022 +0100 soundwire: bus: Don't re-enumerate before status is UNATTACHED Don't re-enumerate a peripheral on #0 until we have seen and handled an UNATTACHED notification for that peripheral. Without this, it is possible for the UNATTACHED status to be missed and so the slave->status remains at ATTACHED. If slave->status never changes to UNATTACHED the child driver will never be notified of the UNATTACH, and the code in sdw_handle_slave_status() will skip the second part of enumeration because the slave->status has not changed. This scenario can happen because PINGs are handled in a workqueue function which is working from a snapshot of an old PING, and there is no guarantee when this function will run. A peripheral could report attached in the PING being handled by sdw_handle_slave_status(), but has since reverted to device #0 and is then found in the loop in sdw_program_device_num(). Previously the code would not have updated slave->status to UNATTACHED because it had not yet handled a PING where that peripheral had UNATTACHED. This situation happens fairly frequently with multiple peripherals on a bus that are intentionally reset (for example after downloading firmware). Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220914160248.1047627-4-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit f605f32e59d8021a032746c2ca73b1adc46873d7 Author: Richard Fitzgerald Date: Wed Sep 14 17:02:45 2022 +0100 soundwire: bus: Don't lose unattach notifications Ensure that if sdw_handle_slave_status() sees a peripheral has dropped off the bus it reports it to the client driver. If there are any devices reporting on address 0 it bails out after programming the device IDs. So it never reaches the second loop that calls sdw_update_slave_status(). If the missing device is one that is now showing as unenumerated it has been given a device ID so will report as attached next time sdw_handle_slave_status() runs. With the previous code the client driver would only see another ATTACHED notification because the UNATTACHED state was lost when sdw_handle_slave_status() bailed out after programming the device ID. This shows up most when the peripheral has to be reset after downloading updated firmware and there are multiple of these peripherals on the bus. They will all return to unenumerated state after the reset, and then there is a mix of unattached, attached and unenumerated PING states from the peripherals, as each is reset and they reboot. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220914160248.1047627-3-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit fbbc73a20f38dcadf8a250bc761962588cd91f7e Author: Simon Trimmer Date: Wed Sep 14 17:02:44 2022 +0100 soundwire: cadence: fix updating slave status when a bus has multiple peripherals The cadence IP explicitly reports slave status changes with bits for each possible change. The function cdns_update_slave_status() attempts to translate this into the current status of each of the slaves. However when there are multiple peripherals on a bus any slave that did not have a status change when the work function ran would not have it's status updated - the array is initialised to a value that equates to UNATTACHED and this can cause spurious reports that slaves had dropped off the bus. In the case where a slave has no status change or has multiple status changes the value from the last PING command is used. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220914160248.1047627-2-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit ed48cfedf1e2250c856d0f894310d081adde5040 Author: Jules Irenge Date: Mon Sep 12 23:03:27 2022 +0100 octeon_ep: Remove useless casting value returned by vzalloc to structure coccinelle reports a warning WARNING: casting value returned by memory allocation function to (struct octep_rx_buffer *) is useless. To fix this the useless cast is removed. Signed-off-by: Jules Irenge Link: https://lore.kernel.org/r/Yx+sr9o0uylXVcOl@playground Signed-off-by: Jakub Kicinski commit 8bb7c4f8c9276eb61f7f39cc107f67a0e81de610 Author: Nathan Huckleberry Date: Tue Sep 13 16:07:38 2022 -0700 openvswitch: Change the return type for vport_ops.send function hook to int All usages of the vport_ops struct have the .send field set to dev_queue_xmit or internal_dev_recv. Since most usages are set to dev_queue_xmit, the function hook should match the signature of dev_queue_xmit. The only call to vport_ops->send() is in net/openvswitch/vport.c and it throws away the return value. This mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/20220913230739.228313-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 73c99e26036529e633a0f2d628ad7ddff6594668 Author: Nathan Huckleberry Date: Mon Sep 12 14:45:10 2022 -0700 net: wwan: t7xx: Fix return type of t7xx_ccmni_start_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of t7xx_ccmni_start_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Acked-by: Sergey Ryazanov Link: https://lore.kernel.org/r/20220912214510.929070-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 0c9441c430104dcf2cd066aae74dbeefb9f9e1bf Author: Nathan Huckleberry Date: Mon Sep 12 14:44:55 2022 -0700 net: wwan: iosm: Fix return type of ipc_wwan_link_transmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of ipc_wwan_link_transmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Acked-by: Sergey Ryazanov Link: https://lore.kernel.org/r/20220912214455.929028-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 106c67ce46f3c82dd276e983668a91d6ed631173 Author: Nathan Huckleberry Date: Mon Sep 12 14:43:40 2022 -0700 net: korina: Fix return type of korina_send_packet The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of korina_send_packet should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220912214344.928925-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 40662333dd7c64664247a6138bc33f3974e3a331 Author: Nathan Huckleberry Date: Mon Sep 12 12:53:07 2022 -0700 net: ethernet: litex: Fix return type of liteeth_start_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of liteeth_start_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Acked-by: Gabriel Somlo Link: https://lore.kernel.org/r/20220912195307.812229-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 5972ca946098487c5155fe13654743f9010f5ed5 Author: Nathan Huckleberry Date: Mon Sep 12 12:50:19 2022 -0700 net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of emac_dev_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220912195023.810319-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 0191580b000d50089a0b351f7cdbec4866e3d0d2 Author: Nathan Huckleberry Date: Mon Sep 12 12:47:19 2022 -0700 net: davicom: Fix return type of dm9000_start_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of dm9000_start_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220912194722.809525-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit fcb7c210a24209ea8f6f32593580b57f52382ec2 Author: Nathan Huckleberry Date: Mon Sep 12 12:40:30 2022 -0700 net: ax88796c: Fix return type of ax88796c_start_xmit The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of ax88796c_start_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Acked-by: Lukasz Stelmach Link: https://lore.kernel.org/r/20220912194031.808425-1-nhuck@google.com Signed-off-by: Jakub Kicinski commit 4dccf41d79dd533d91891e4acdc091e5143d0792 Merge: 4e2309625f5b2 76af7483b3c7c Author: Jakub Kicinski Date: Mon Sep 19 18:16:03 2022 -0700 Merge tag 'batadv-next-pullrequest-20220916' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - drop unused headers in trace.h, by Sven Eckelmann - drop initialization of flexible ethtool_link_ksettings, by Sven Eckelmann - remove unused struct definitions, by Marek Lindner * tag 'batadv-next-pullrequest-20220916' of git://git.open-mesh.org/linux-merge: batman-adv: remove unused struct definitions batman-adv: Drop initialization of flexible ethtool_link_ksettings batman-adv: Drop unused headers in trace.h batman-adv: Start new development cycle ==================== Link: https://lore.kernel.org/r/20220916161454.1413154-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit 4e2309625f5b25da01b7cd437567fccce1bc74c7 Merge: 2dc81a0e7658d 72981ef2d196d Author: Jakub Kicinski Date: Mon Sep 19 18:08:02 2022 -0700 Merge branch 'mlxsw-adjust-qos-tests-for-spectrum-4-testing' Petr Machata says: ==================== mlxsw: Adjust QOS tests for Spectrum-4 testing Amit writes: Quality Of Service tests create congestion and verify the switch behavior. To create congestion, they need to have more traffic than the port can handle, so some of them force 1Gbps speed. The tests assume that 1Gbps speed is supported. Spectrum-4 ASIC will not support this speed in all ports, so to be able to run QOS tests there, some adjustments are required. Patch set overview: Patch #1 adjusts qos_ets_strict, qos_mc_aware and sch_ets tests. Patch #2 adjusts RED tests. Patch #3 extends devlink_lib to support querying maximum pool size. Patch #4 adds a test which can be used instead of qos_burst and do not assume that 1Gbps speed is supported. Patch #5 removes qos_burst test. ==================== Link: https://lore.kernel.org/r/cover.1663152826.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 72981ef2d196d03ebab2bf9e4578a4c17e8078dd Author: Amit Cohen Date: Wed Sep 14 13:21:52 2022 +0200 selftests: mlxsw: Remove qos_burst test The previous patch added a test which can be used instead of qos_burst.sh. Remove this test. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 5ab0cf142bb7242b37ab678b09886a2aa65e8bfb Author: Amit Cohen Date: Wed Sep 14 13:21:51 2022 +0200 selftests: mlxsw: Add QOS test for maximum use of descriptors Add an equivalent test to qos_burst, the test's purpose is same, but the new test uses simpler topology and does not require forcing low speed. In addition, it can be run Spectrum-2 and not only Spectrum-3+. The idea is to use a shaper in order to limit the traffic and create congestion. qos_burst test uses small pool, sends many small packets, and verify that packets are not dropped, which means that many descriptors can be handled. This test should check the change that commit c864769add96 ("mlxsw: Configure descriptor buffers") pushed. Instead, the new test tries to use more than 85% of maximum supported descriptors. The idea is to use big pool (as much as the ASIC supports), such that the pool size does not limit the traffic, then send many small packets, which means that many descriptors are used, and check how many packets the switch can handle. The usage of shaper allows to run the test in all ASICs, regardless of the CPU abilities, as it is able to create the congestion with low rate of packets. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit bd3f7850720c2f1086718546034742783dc3a371 Author: Amit Cohen Date: Wed Sep 14 13:21:50 2022 +0200 selftests: devlink_lib: Add function for querying maximum pool size The maximum pool size is exposed via 'devlink sb' command. The next patch will add a test which increases some pools to the maximum size. Add a function to query the value. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 61a00b196aaf5ba3d6ffb94e93c5d57bed449a32 Author: Amit Cohen Date: Wed Sep 14 13:21:49 2022 +0200 selftests: mlxsw: Use shapers in QOS RED tests instead of forcing speed QOS tests create congestion and verify the switch behavior. To create congestion, they need to have more traffic than the port can handle, so some of them force 1Gbps speed. The tests assume that 1Gbps speed is supported, otherwise, they will fail. Spectrum-4 ASIC will not support this speed in all ports, so to be able to run the tests there, some adjustments are required. Use shapers to limit the traffic instead of forcing speed. Note that for several ports, the speed configuration is just for autoneg issues, so shaper is not needed instead. The tests already use ETS qdisc as a root and RED qdiscs as children. Add a new TBF shaper to limit the rate of traffic, and use it as a root qdisc, then save the previous hierarchy of qdiscs under the new TBF root. In some ASICs, the shapers do not limit the traffic as accurately as forcing speed. To make the tests stable, allow the backlog size to be up to +-10% of the threshold. The aim of the tests is to make sure that with backlog << threshold, there are no drops, and that packets are dropped somewhere in vicinity of the configured threshold. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 9e7aaa7c65f170039501c4d4b24d99640e2d519a Author: Amit Cohen Date: Wed Sep 14 13:21:48 2022 +0200 selftests: mlxsw: Use shapers in QOS tests instead of forcing speed QOS tests create congestion and verify the switch behavior. To create congestion, they need to have more traffic than the port can handle, so some of them force 1Gbps speed. The tests assume that 1Gbps speed is supported, otherwise, they will fail. Spectrum-4 ASIC will not support this speed in all ports, so to be able to run QOS tests there, some adjustments are required. Use shapers to limit the traffic instead of forcing speed. Note that for several ports, the speed configuration is just for autoneg issues, so shaper is not needed instead. In tests that already use shapers, set the existing shaper to be a child of a new TBF shaper which is added as a root qdisc and acts as a port shaper. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 2dc81a0e7658d986c4d7acce6ac2d1060ff424b7 Merge: f0bd32c833826 9cc115d8d6f73 Author: Jakub Kicinski Date: Mon Sep 19 17:59:55 2022 -0700 Merge branch 'remove-label-cpu-from-dsa-dt-bindings' Vladimir Oltean says: ==================== Remove label = "cpu" from DSA dt-bindings As explained in more detail in patch 1/3, label = "cpu" is not part of DSA's device tree bindings, yet we have some checks in the dt-schema for mt7530 which are written as if it was. Reformulate those checks, and remove all occurrences of this seemingly used, but actually unused, property from the binding examples. ==================== Link: https://lore.kernel.org/r/20220912175058.280386-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 9cc115d8d6f73dd260de1609182f3645844d6907 Author: Vladimir Oltean Date: Mon Sep 12 20:50:58 2022 +0300 dt-bindings: net: dsa: remove label = "cpu" from examples This is not used by the DSA dt-binding, so remove it from all examples. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit cdd3e486d705b1efc368a06abd2d08e34ce749dd Author: Vladimir Oltean Date: Mon Sep 12 20:50:57 2022 +0300 dt-bindings: net: dsa: mt7530: stop requiring phy-mode on CPU ports The common dsa-port.yaml does this (and more) since commit 2ec2fb8331af ("dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports"). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit 3f301a2800786dd57174a0f3f010c8449f5f6c37 Author: Vladimir Oltean Date: Mon Sep 12 20:50:56 2022 +0300 dt-bindings: net: dsa: mt7530: replace label = "cpu" with proper checks The fact that some DSA device trees use 'label = "cpu"' for the CPU port is nothing but blind cargo cult copying. The 'label' property was never part of the DSA DT bindings for anything except the user ports, where it provided a hint as to what name the created netdevs should use. DSA does use the "cpu" port label to identify a CPU port in dsa_port_parse(), but this is only for non-OF code paths (platform data). The proper way to identify a CPU port is to look at whether the 'ethernet' phandle is present. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit f0bd32c833826ba666c30af0bae78fc5ca598138 Author: Xiu Jianfeng Date: Fri Sep 9 17:18:40 2022 +0800 net: rds: add missing __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220909091840.247946-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski commit 9621e74f39f26ec984fa8cdc91567cdb9b771e2c Author: Gaosheng Cui Date: Fri Sep 9 14:40:42 2022 +0800 rxrpc: remove rxrpc_max_call_lifetime declaration rxrpc_max_call_lifetime has been removed since commit a158bdd3247b ("rxrpc: Fix call timeouts"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220909064042.1149404-1-cuigaosheng1@huawei.com Signed-off-by: Jakub Kicinski commit 13c76227cd8a14c5aa092387575cc3cab8eba5b4 Author: Yang Yingliang Date: Wed Sep 14 22:01:00 2022 +0800 net/mlx5e: Switch to kmemdup() when allocate dev_addr Use kmemdup() helper instead of open-coding to simplify the code when allocate dev_addr. Signed-off-by: Yang Yingliang Acked-by: Saeed Mahameed Link: https://lore.kernel.org/r/20220914140100.3795545-2-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 46ff47bc81b4f2eaddaf5e6744f88f86c9eb7946 Author: Yang Yingliang Date: Wed Sep 14 22:00:59 2022 +0800 net/mlx5e: add missing error code in error path Add missing error code when mlx5e_macsec_fs_add_rule() or mlx5e_macsec_fs_init() fails. mlx5e_macsec_fs_init() don't return ERR_PTR(), so replace IS_ERR_OR_NULL() check with NULL pointer check. Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules") Signed-off-by: Yang Yingliang Acked-by: Saeed Mahameed Link: https://lore.kernel.org/r/20220914140100.3795545-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit f3dcb3ed8e4d011287c309f8028a1129ea6d1c86 Merge: 949f252a8594a 38b922c912278 Author: Jakub Kicinski Date: Mon Sep 19 17:58:27 2022 -0700 Merge branch 'standardized-ethtool-counters-for-nxp-enetc' Vladimir Oltean says: ==================== Standardized ethtool counters for NXP ENETC This is another preparation patch for the introduction of MAC Merge Layer statistics, this time for the enetc driver (endpoint ports on the NXP LS1028A). The same set of stats groups is supported as in the case of the Felix DSA switch. ==================== Link: https://lore.kernel.org/r/20220909113800.55225-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 38b922c9122789ce7f5dcb39a8f6bcaee10aa1cd Author: Vladimir Oltean Date: Fri Sep 9 14:38:00 2022 +0300 net: enetc: expose some standardized ethtool counters Structure the code in such a way that it can be reused later for the pMAC statistics, by just changing the "mac" argument to 1. Usage: ethtool --include-statistics --show-pause eno2 ethtool -S eno0 --groups eth-mac ethtool -S eno0 --groups eth-ctrl ethtool -S eno0 --groups rmon Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Signed-off-by: Jakub Kicinski commit e2bd065c3b22343083850b240425d300577fa531 Author: Vladimir Oltean Date: Fri Sep 9 14:37:59 2022 +0300 net: enetc: parameterize port MAC stats to also cover the pMAC The ENETC has counters for the eMAC and for the pMAC exactly 0x1000 apart from each other. The driver only contains definitions for PM0, the eMAC. Rather than duplicating everything for PM1, modify the register definitions such that they take the MAC as argument. Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Signed-off-by: Jakub Kicinski commit 949f252a8594a860007e7035a0cb1c19a4e218b0 Author: Geert Uytterhoeven Date: Fri Sep 9 12:10:11 2022 +0200 net: ravb: Add R-Car Gen4 support Add support for the Renesas Ethernet AVB (EtherAVB-IF) blocks on R-Car Gen4 SoCs (e.g. R-Car V4H) by matching on a family-specific compatible value. These are treated the same as EtherAVB on R-Car Gen3. Signed-off-by: Geert Uytterhoeven Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/2ee968890feba777e627d781128b074b2c43cddb.1662718171.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit e05016590e75c0988ddc4d3d5197c1053ae2a09c Merge: 21b688dabecb6 231c4f0bcdb2d Author: Jakub Kicinski Date: Mon Sep 19 17:57:56 2022 -0700 Merge branch 'dt-bindings-net-renesas-etheravb-r-car-gen4-updates' Geert Uytterhoeven says: ==================== dt-bindings: net: renesas,etheravb: R-Car Gen4 updates This patch series contains two updates for the Renesas Ethernet AVB Device Tree bindings. ==================== Link: https://lore.kernel.org/r/cover.1662714607.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit 231c4f0bcdb2d0fa37857bb3d4600c9ba0e1319b Author: Geert Uytterhoeven Date: Fri Sep 9 11:13:23 2022 +0200 dt-bindings: net: renesas,etheravb: Add r8a779g0 support Document support for the Renesas Ethernet AVB (EtherAVB-IF) block in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Reviewed-by: Sergey Shtylyov Signed-off-by: Jakub Kicinski commit 1bd81d785dfc6b8d2e4911acc527c181a88a51d0 Author: Geert Uytterhoeven Date: Fri Sep 9 11:13:22 2022 +0200 dt-bindings: net: renesas,etheravb: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Reviewed-by: Sergey Shtylyov Signed-off-by: Jakub Kicinski commit 21b688dabecb6a949f998d92579ae1b800a96e7f Author: Divya Koppera Date: Fri Sep 9 14:01:23 2022 +0530 net: phy: micrel: Cable Diag feature for lan8814 phy Support for Cable Diagnostics in lan8814 phy Signed-off-by: Divya Koppera Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220909083123.30134-1-Divya.Koppera@microchip.com Signed-off-by: Jakub Kicinski commit 517ff3ceb38317a8e8a88b3e4ed68b21ceb31d2b Merge: 2bd178c5ea73a 167d5fe0f6c95 Author: Jakub Kicinski Date: Mon Sep 19 17:57:29 2022 -0700 Merge branch 'add-fec-support-on-s32v234-platform' Wei Fang says: ==================== Add FEC support on s32v234 platform This series patches are to add FEC support on s32v234 platfom. 1. Add compatible string and quirks for fsl,s32v234 2. Update Kconfig to also check for ARCH_S32. ==================== Link: https://lore.kernel.org/r/20220907095649.3101484-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski commit 167d5fe0f6c95b4a7da506f0485b500c4f533eb1 Author: Wei Fang Date: Wed Sep 7 17:56:49 2022 +0800 net: fec: Add initial s32v234 support Update Kconfig to also check for ARCH_S32. Add compatible string and quirks for fsl,s32v234 Signed-off-by: Wei Fang Signed-off-by: Jakub Kicinski commit 00f5303c17ee41433d98b8b4f02d1b417c9edf47 Author: Wei Fang Date: Wed Sep 7 17:56:48 2022 +0800 dt-bindings: net: fec: add fsl,s32v234-fec to compatible property Add fsl,s32v234-fec to compatible property to support s32v234 platform. Signed-off-by: Wei Fang Acked-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit aa47a7c215e79a2ade6916f163c5a17b561bce4f Author: Yury Norov Date: Mon Sep 5 16:08:19 2022 -0700 lib/cpumask: deprecate nr_cpumask_bits Cpumask code is written in assumption that when CONFIG_CPUMASK_OFFSTACK is enabled, all cpumasks have boot-time defined size, otherwise the size is always NR_CPUS. The latter is wrong because the number of possible cpus is always calculated on boot, and it may be less than NR_CPUS. On my 4-cpu arm64 VM the nr_cpu_ids is 4, as expected, and nr_cpumask_bits is 256, which corresponds to NR_CPUS. This not only leads to useless traversing of cpumask bits greater than 4, this also makes some cpumask routines fail. For example, cpumask_full(0b1111000..000) would erroneously return false in the example above because tail bits in the mask are all unset. This patch deprecates nr_cpumask_bits and wires it to nr_cpu_ids unconditionally, so that cpumask routines will not waste time traversing unused part of cpu masks. It also fixes cpumask_full() and similar routines. As a side effect, because now a length of cpumasks is defined at run-time even if CPUMASK_OFFSTACK is disabled, compiler can't optimize corresponding functions. It increases kernel size by ~2.5KB if OFFSTACK is off. This is addressed in the following patch. Signed-off-by: Yury Norov commit 7102b3bb070fdf4580a05cbfc5ad3c0691dc4bf9 Author: Yury Norov Date: Mon Sep 5 16:08:18 2022 -0700 lib/cpumask: delete misleading comment The comment says that HOTPLUG config option enables all cpus in cpu_possible_mask up to NR_CPUs. This is wrong. Even if HOTPLUG is enabled, the mask is populated on boot with respect to ACPI/DT records. Signed-off-by: Yury Norov commit 38bef8e57f2149acd2c910a98f57dd6291d2e0ec Author: Yury Norov Date: Mon Sep 5 16:08:17 2022 -0700 smp: add set_nr_cpu_ids() In preparation to support compile-time nr_cpu_ids, add a setter for the variable. This is a no-op for all arches. Signed-off-by: Yury Norov commit 53fc190cc6771c5494d782210334d4ebb50c7103 Author: Yury Norov Date: Mon Sep 5 16:08:16 2022 -0700 smp: don't declare nr_cpu_ids if NR_CPUS == 1 SMP and NR_CPUS are independent options, hence nr_cpu_ids may be declared even if NR_CPUS == 1, which is useless. Signed-off-by: Yury Norov commit 2ef164414123fcf574aff7a0be5f71f7e60a3fec Author: Jia Zhu Date: Sun Sep 18 12:34:56 2022 +0800 erofs: introduce 'domain_id' mount option Introduce 'domain_id' mount option to enable shared domain sementics. In which case, the related cookie is shared if two mountpoints in the same domain have the same data blob. Users could specify the name of domain by this mount option. Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918043456.147-7-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit 7d41963759feb3cfa4c1164b8b9db5d1f055932d Author: Jia Zhu Date: Sun Sep 18 19:01:50 2022 +0800 erofs: Support sharing cookies in the same domain Several erofs filesystems can belong to one domain, and data blobs can be shared among these erofs filesystems of same domain. Users could specify domain_id mount option to create or join into a domain. Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918110150.6338-1-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit a9849560c55e9e4ab9c53d073363dd6e19ec06ef Author: Jia Zhu Date: Sun Sep 18 12:34:54 2022 +0800 erofs: introduce a pseudo mnt to manage shared cookies Use a pseudo mnt to manage shared cookies. Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918043456.147-5-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit 8b7adf1dff3d5baf687acda936f193f80b7e0179 Author: Jia Zhu Date: Sun Sep 18 12:34:53 2022 +0800 erofs: introduce fscache-based domain A new fscache-based shared domain mode is going to be introduced for erofs. In which case, same data blobs in same domain will be shared and reused to reduce on-disk space usage. The implementation of sharing blobs will be introduced in subsequent patches. Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918043456.147-4-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit e1de2da0b7ac2dc0120c2ba8c7044788611933ea Author: Jia Zhu Date: Sun Sep 18 12:34:52 2022 +0800 erofs: code clean up for fscache Some cleanups. No logic changes. Suggested-by: Jingbo Xu Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918043456.147-3-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit 1015c1016c231b26d4e2c9b3da65b6c043eb97a3 Author: Jia Zhu Date: Sun Sep 18 12:34:51 2022 +0800 erofs: use kill_anon_super() to kill super in fscache mode Use kill_anon_super() instead of generic_shutdown_super() since the mount() in erofs fscache mode uses get_tree_nodev() and associated anon bdev needs to be freed. Fixes: 9c0cc9c729657 ("erofs: add 'fsid' mount option") Suggested-by: Jingbo Xu Signed-off-by: Jia Zhu Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20220918043456.147-2-zhujia.zj@bytedance.com Signed-off-by: Gao Xiang commit 1dd73601a1cba37a0ed5f89a8662c90191df5873 Author: Gao Xiang Date: Fri Sep 9 10:39:48 2022 +0800 erofs: fix order >= MAX_ORDER warning due to crafted negative i_size As syzbot reported [1], the root cause is that i_size field is a signed type, and negative i_size is also less than EROFS_BLKSIZ. As a consequence, it's handled as fast symlink unexpectedly. Let's fall back to the generic path to deal with such unusual i_size. [1] https://lore.kernel.org/r/000000000000ac8efa05e7feaa1f@google.com Reported-by: syzbot+f966c13b1b4fc0403b19@syzkaller.appspotmail.com Fixes: 431339ba9042 ("staging: erofs: add inode operations") Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20220909023948.28925-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang commit ecf8322f464d62759d838ea62cdeff6966a60134 Author: Damien Le Moal Date: Tue Sep 20 08:52:02 2022 +0900 ata: ahci_st: Enable compile test Enable compiling the ahci_st driver when COMPILE_TEST is enabled. Signed-off-by: Damien Le Moal commit 2d29dd108c787e039593f76c588d8f6d3541eb1c Author: Damien Le Moal Date: Tue Sep 20 08:43:07 2022 +0900 ata: ahci_st: Fix compilation warning Remove the unused variable dev in st_ahci_probe() to avoid compilation warning and build failures where CONFIG_WERROR is enabled. Fixes: 3f74cd046fbe ("ata: libahci_platform: Parse ports-implemented property in resources getter") Signed-off-by: Damien Le Moal commit 78091edc1c7806846049e1d480f6a8051507ed94 Author: Chunxu Li Date: Sat Sep 17 10:26:10 2022 +0800 ASoC: SOF: mediatek: add pcm_hw_params callback for mt8186 add pcm_hw_params callback for mt8186 to support continue update dma host position Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220917022610.594-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 5ba3522cf8b9f3a9f6cbbde1d1e9217e518e0e0a Merge: 717a8ff20f327 794cd3bd69315 Author: Mark Brown Date: Tue Sep 20 00:07:42 2022 +0100 ASoC: SOF: start using tracing instead of dev_dbg Merge series from Pierre-Louis Bossart : Multiple maintainers have told us to start using the tracing subsystem. Wish granted, this patchset suggested by Noah Klayman removes a number of verbose and arguably useless dev_dbg or dev_vdbg logs. Beyond higher efficiency and less intrusive instrumentation, the use of bpftrace scripts bring new functionality and helps gather statistics on usage count on a running system, see how we can get information on suspend/resume times with [1] [1] https://github.com/thesofproject/sof-test/blob/main/kernel_tracing/bpftrace_scripts/suspend_resume_time.bt commit 7d7f8fe4e399519cc9ac68a475fec6d3a996341b Author: Dan Carpenter Date: Thu Sep 15 17:11:44 2022 +0300 remoteproc: Harden rproc_handle_vdev() against integer overflow The struct_size() macro protects against integer overflows but adding "+ rsc->config_len" introduces the risk of integer overflows again. Use size_add() to be safe. Fixes: c87846571587 ("remoteproc: use struct_size() helper") Signed-off-by: Dan Carpenter Reviewed-by: Gustavo A. R. Silva Reviewed-by: Mukesh Ojha Link: https://lore.kernel.org/r/YyMyoPoGOJUcEpZT@kili Signed-off-by: Mathieu Poirier commit fa25b944174a6a25a14a2bb1c52cf74d5ad95140 Author: Dmitry Torokhov Date: Tue Sep 6 14:08:33 2022 -0700 remoteproc/keystone: Switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. Note that there is a behavior change in the driver: previously the driver did not actually request GPIO, it simply parsed GPIO number out of device tree and poked at it. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/Yxe20ehiOnitDGus@google.com Signed-off-by: Mathieu Poirier commit 698ae3d76bcbc622d2882f03477ad1dd8179739f Author: wangjianli Date: Thu Sep 8 20:32:37 2022 +0800 drivers/remoteproc: Fix repeated words in comments Delete the redundant word 'in'. Signed-off-by: wangjianli Reviewed-by: Mukesh Ojha Link: https://lore.kernel.org/r/20220908123237.16911-1-wangjianli@cdjrlc.com Signed-off-by: Mathieu Poirier commit 2bd178c5ea73ab66ac8496960c4a4d9acdef5c24 Merge: 2f8a786f47244 f3e893626abea Author: Jakub Kicinski Date: Mon Sep 19 14:21:53 2022 -0700 Merge tag 'ib-mfd-net-pinctrl-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Lee Jones says: ==================== Immutable branch between MFD, Net and Pinctrl due for the v6.0 merge window * tag 'ib-mfd-net-pinctrl-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: mfd: ocelot: Add support for the vsc7512 chip via spi dt-bindings: mfd: ocelot: Add bindings for VSC7512 resource: add define macro for register address resources pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration pinctrl: microchip-sgpio: allow sgpio driver to be used as a module pinctrl: ocelot: add ability to be used in a non-mmio configuration net: mdio: mscc-miim: add ability to be used in a non-mmio configuration mfd: ocelot: Add helper to get regmap from a resource ==================== Link: https://lore.kernel.org/r/YxrjyHcceLOFlT/c@google.com Signed-off-by: Jakub Kicinski commit 2f8a786f472445d66348859af8795aa6ffd9ff8c Author: Sun Ke Date: Thu Sep 8 12:02:26 2022 +0800 net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register() This node pointer is returned by of_find_compatible_node() with refcount incremented in this function. of_node_put() on it before exitting this function. Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link") Signed-off-by: Sun Ke Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220908040226.871690-1-sunke32@huawei.com Signed-off-by: Jakub Kicinski commit 42666b2c452ce87894786aae05e3fad3cfc6cb59 Author: Heiner Kallweit Date: Fri Sep 9 08:00:22 2022 +0200 r8169: disable detection of chip version 36 I found no evidence that this chip version ever made it to the mass market. Therefore disable detection. Like in similar cases before: If nobody complains, we'll remove support for this chip version after few months. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/ac622d4a-ae0a-3817-710f-849db4015c78@gmail.com Signed-off-by: Jakub Kicinski commit 193cb8372424184dde28088a4230a5fed0afb0ad Author: Shaomin Deng Date: Sat Aug 27 12:26:31 2022 -0400 uml: Remove the initialization of statics to 0 It is always unnecessary to initialise statics to 0. Signed-off-by: Shaomin Deng Signed-off-by: Richard Weinberger commit 4dc5a328315a6acbb60e772fb4826d87626a793d Author: Xin Gao Date: Thu Jul 21 03:24:51 2022 +0800 um: Do not initialise statics to 0. do not initialise statics to 0. Signed-off-by: Xin Gao Signed-off-by: Richard Weinberger commit feceb24ed79a09c3c597f189d5076065164119b5 Author: Gaosheng Cui Date: Fri Sep 9 14:29:59 2022 +0800 net: ethernet: remove fs_mii_disconnect and fs_mii_connect declarations fs_mii_disconnect and fs_mii_connect have been removed since commit 5b4b8454344a ("[PATCH] FS_ENET: use PAL for mii management"), so remove them. Signed-off-by: Gaosheng Cui Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220909062959.1144493-1-cuigaosheng1@huawei.com Signed-off-by: Jakub Kicinski commit 3848d470cb881b7954a4a563bf73ffeb9cf4f30e Author: Jason Wang Date: Fri Jul 15 12:29:38 2022 +0800 um: Fix comment typo The double `in' is duplicated in line 172, remove one. Signed-off-by: Jason Wang Signed-off-by: Richard Weinberger commit 758dfdb9185cf94160f20e85bbe05583e3cd4ff4 Author: Guilherme G. Piccoli Date: Fri Aug 19 19:17:24 2022 -0300 um: Improve panic notifiers consistency and ordering Currently the panic notifiers from user mode linux don't follow the convention for most of the other notifiers present in the kernel (indentation, priority setting, numeric return). More important, the priorities could be improved, since it's a special case (userspace), hence we could run the notifiers earlier; user mode linux shouldn't care much with other panic notifiers but the ordering among the mconsole and arch notifier is important, given that the arch one effectively triggers a core dump. Fix that by running the mconsole notifier as the first panic notifier, followed by the architecture one (that coredumps). Cc: Anton Ivanov Cc: Johannes Berg Cc: Richard Weinberger Signed-off-by: Guilherme G. Piccoli V3: - No changes. V2: - Kept the notifier header to avoid implicit usage - thanks Johannes for the suggestion! Signed-off-by: Richard Weinberger commit c8b2c268b0b77cb6aad676bf215f49212d903b2a Author: Gaosheng Cui Date: Wed Sep 14 15:30:27 2022 +0800 um: remove unused reactivate_chan() declaration All uses of reactivate_chan() were removed by commit 940b241d9050 ("um: Remove obsolete reenable_XX calls"), so remove the declaration, too. Signed-off-by: Gaosheng Cui Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 7c5c8faeab4db1eecc181e01ccc7c16b1ec24b99 Author: Xiu Jianfeng Date: Sun Sep 11 10:52:38 2022 +0800 um: mmaper: add __exit annotations to module exit funcs Add missing __exit annotations to module exit funcs. Signed-off-by: Xiu Jianfeng Signed-off-by: Richard Weinberger commit 98639412fee2fda3c9da184825b469e5ac874829 Author: Xiu Jianfeng Date: Sun Sep 11 10:51:40 2022 +0800 um: virt-pci: add __init/__exit annotations to module init/exit funcs Add missing __init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng Signed-off-by: Richard Weinberger commit b7f28a37a59fb0ae35dc087b9cdfa77d089b996b Author: Wolfram Sang Date: Thu Aug 18 23:01:17 2022 +0200 hostfs: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Richard Weinberger commit e6e4d33f380fbfd85b909d16c9b639299e5c37a6 Author: Wolfram Sang Date: Thu Aug 18 22:59:51 2022 +0200 um: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Richard Weinberger commit 0d644e918532f7eba2b02e0eaf60ee1a1b20a856 Author: Christian Lamparter Date: Sat Aug 6 21:52:23 2022 +0200 um: increase default virtual physical memory to 64 MiB The current 32 MiB of RAM causes OOMs to appear shortly after booting in a minimal OpenWrt 22.03 configuration with a 5.10.134 kernel. Of course, passing a "mem=64M" (from the --help text) parameter works too, but it produces the following (info) message: | [ 0.000000] Unknown kernel command line parameters "mem=64M", will be passed to user space. That's why, I think it would be nicer, if this is working out of the box again :). Signed-off-by: Christian Lamparter Signed-off-by: Richard Weinberger commit 16c546e148fa6d14a019431436a6f7b4087dbccd Author: Huacai Chen Date: Tue Jul 12 15:52:55 2022 +0800 UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, cpu_max_bits_warn() generates a runtime warning similar as below while we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit) instead of NR_CPUS to iterate CPUs. [ 3.052463] ------------[ cut here ]------------ [ 3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0 [ 3.070072] Modules linked in: efivarfs autofs4 [ 3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052 [ 3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000 [ 3.109127] 9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430 [ 3.118774] 90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff [ 3.128412] 0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890 [ 3.138056] 0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa [ 3.147711] ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000 [ 3.157364] 900000000101c998 0000000000000004 9000000000ef7430 0000000000000000 [ 3.167012] 0000000000000009 000000000000006c 0000000000000000 0000000000000000 [ 3.176641] 9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286 [ 3.186260] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c [ 3.195868] ... [ 3.199917] Call Trace: [ 3.203941] [<90000000002086d8>] show_stack+0x38/0x14c [ 3.210666] [<9000000000cf846c>] dump_stack_lvl+0x60/0x88 [ 3.217625] [<900000000023d268>] __warn+0xd0/0x100 [ 3.223958] [<9000000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc [ 3.231150] [<9000000000210220>] show_cpuinfo+0x5e8/0x5f0 [ 3.238080] [<90000000004f578c>] seq_read_iter+0x354/0x4b4 [ 3.245098] [<90000000004c2e90>] new_sync_read+0x17c/0x1c4 [ 3.252114] [<90000000004c5174>] vfs_read+0x138/0x1d0 [ 3.258694] [<90000000004c55f8>] ksys_read+0x70/0x100 [ 3.265265] [<9000000000cfde9c>] do_syscall+0x7c/0x94 [ 3.271820] [<9000000000202fe4>] handle_syscall+0xc4/0x160 [ 3.281824] ---[ end trace 8b484262b4b8c24c ]--- Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen Signed-off-by: Richard Weinberger commit 714e76347a4e0bbd39730ddbb2c7e56971ba7caa Author: Benjamin Beichler Date: Tue Jun 7 11:27:14 2022 +0000 um: read multiple msg from virtio slave request fd If VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS is activated, the user mode linux virtio irq handler only read one msg from the corresponding socket. This creates issues, when the device emulation creates multiple call requests (e.g. for multiple virtqueues), as the socket buffer tend to fill up and the call requests are delayed. This creates a deadlock situation, when the device simulation blocks, because of sending a msg and the kernel side blocks because of synchronously waiting for an acknowledge of kick request. Actually inband notifications are meant to be used in combination with the time travel protocol, but it is not required, therefore this corner case needs to be handled. Anyways, in general it seems to be more natural to consume always all messages from a socket, instead of only a single one. Fixes: 2cd097ba8c05 ("um: virtio: Implement VHOST_USER_PROTOCOL_F_SLAVE_REQ") Signed-off-by: Benjamin Beichler Reviewed-by: Johannes Berg Signed-off-by: Richard Weinberger commit d4423feeb7d316f1a31a5865a21b195940d4d7e9 Author: Christian König Date: Wed Jul 13 18:22:18 2022 +0200 drm/amdgpu: revert "fix limiting AV1 to the first instance on VCN3" v3 This reverts commit 250195ff744f260c169f5427422b6f39c58cb883. The job should now be initialized when we reach the parser functions. v2: merge improved application check into this patch v3: back to the original test, but use the right ring Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c2b08e7a6d270d25e8041510adf82b4a657142d4 Author: Christian König Date: Mon Sep 5 09:22:29 2022 +0200 drm/amdgpu: move entity selection and job init earlier during CS Initialize the entity for the CS and scheduler job much earlier. v2: fix job initialisation order and use correct scheduler instance Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4953b6b22ab9d7f64706631a027b1ed1130ce4c8 Author: Christian König Date: Tue Sep 13 09:52:13 2022 +0200 drm/amdgpu: cleanup error handling in amdgpu_cs_parser_bos Return early on success and so remove all those "if (r)" in the error path. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f4b92fcd740d7c90eb7b011f22deab6192ffe44c Author: Christian König Date: Thu Feb 24 10:22:16 2022 +0100 drm/amdgpu: cleanup CS pass2 v6 Cleanup the coding style and function names to represent the data they process for pass2 as well. Go over the chunks only twice now instead of multiple times. v2: fix job initialisation order and use correct scheduler instance v3: try to move all functional changes into a separate patch. v4: separate reordering, pass1 and pass2 change v5: fix va_start calculation v6: fix user fence check Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a6ad27cec585fe715b95fcc930cbc460c678080f Author: YiPeng Chai Date: Thu Sep 8 09:48:11 2022 +0800 drm/amd/pm: Remove redundant check condition V3: [Why]: Since ASICs using smu v13_0_2 have called smu .suspend before calling amdgpu_pm_sysfs_fini, pm.dpm_enabled was already set to 0 when smu .suspend was called. This makes it impossible to delete all pm sys nodes. [How]: Since all functions in amdgpu_pm_sysfs_fini have their own condition checks, so the first conditional check in amdgpu_pm_sysfs_fini can be removed. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 83d29a5f8a5a8ac76fdf8b8ccca65899345e6a9e Author: YiPeng Chai Date: Thu Sep 8 09:44:36 2022 +0800 drm/amdgpu: Fixed psp fence and memory issues when removing amdgpu device V3: Fixed psp fence and memory issues for the asic using smu v13_0_2 when removing amdgpu device. [Why]: 1. psp_suspend->psp_free_shared_bufs-> psp_ta_free_shared_buf-> amdgpu_bo_free_kernel-> ...->amdgpu_bo_release_notify-> amdgpu_fill_buffer psp will free vram memory used by psp when psp_suspend is called. But for the asic using smu v13_0_2, because psp_suspend is called before adev->shutdown is set to true when removing the first hive device, amdgpu fill_buffer will be called, which will cause fence issues when evicting all vram resources in amdgpu vram mgr_fini. 2. Since psp_hw_fini is not called after calling psp_suspend and psp_suspend only calls psp_ring_stop, the psp ring memory will not be released when amdgpu device is removed. [How]: 1. Set shutdown to true before calling amdgpu_device_gpu_recover, then amdgpu_fill_buffer will not be called when psp_suspend is called. 2. Free psp ring memory in psp_sw_fini. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f5c7e7797060255dbc8160734ccc5ad6183c5e04 Author: YiPeng Chai Date: Wed Sep 7 16:07:42 2022 +0800 drm/amdgpu: Adjust removal control flow for smu v13_0_2 Adjust removal control flow for smu v13_0_2: During amdgpu uninstallation, when removing the first device, the kernel needs to first send a mode1reset message to all gpu devices. Otherwise, smu initialization will fail the next time amdgpu is installed. V2: 1. Update commit comments. 2. Remove the global variable amdgpu_device_remove_cnt and add a variable to the structure amdgpu_hive_info. 3. Use hive to detect the first removed device instead of a global variable. V3: 1. Update commit comments. 2. Split a patch into multiple patches. 3. The current patch does: a. Add a work mode of AMDGPU_RESET_FOR_DEVICE_REMOVE into the existing gpu recover path, which make all devices in hive list only have HW reset but no resume (except the base IP). b. Call AMDGPU_RESET_FOR_DEVICE_REMOVE and AMDGPU_NEED_FULL_RESET mode of amdgpu_device_gpu_recover in amdgpu_pci_remove when removing the first device in hive list. c. When removing the first device, the IP blocks keyword function call sequence is as follows: .suspend->mode1reset->.resume(basic ip)->.hw_fini->.early_fini->.sw_fini. ^ | |-<----------<---------<----| The first three sequences are because of a call to amdgpu_device_gpu_recover. The three sequences will be executed in a loop until all devices in the hive list are iterated. The sequences starting from .hw_fini only apply to the first device. Since .suspend has been called before, except the resumed phase1 basic ip blocks, all other ip blocks .hw_fini of current device will do nothing. d. When removing other devices, the calling sequences is the same as legacy: .hw_fini -> .early_fini -> .sw_fini. Since .suspend has been called when removing the first device, except the resumed phase1 basic ip blocks, all of other ip blocks .hw_fini of current device will do nothing. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e4cf73fdfa420eb73507cf95c165d5d538d70d76 Author: Aric Cyr Date: Sun Sep 11 23:59:13 2022 -0400 drm/amd/display: 3.2.204 This version brings along following fixes: - Fix urgent latency override for DCN32/DCN321 - Correct hostvm flag in DCN31 - Added new Asic Id for DCN301 - Adjust to 2 phys in DCN301 - Update dummy P-state search to use DCN32 DML - Increase dcn315 pstate change latency - Disable OTG WA for the plane_state NULL case on DCN314 - Update dccg based on HW delta - Correct num_dsc for DCN314 - Fix DP DSC compliance failure with DCN314 - Refactor edp power sequencer codes - update gamut remap if plane has changed - Skip audio setup when audio stream is enabled - Display distortion after hotplug LG Ultrafine 5K tiled display - Fix DP MST timeslot issue when fallback happened - Uncomment SubVP pipe split assignment in driver - Enable committing subvp config - Do second pass through DML for DET calculation - Don't allocate DET for phantom pipes - Modify DML to adjust Vstartup Position - Ignore k1/k2 values for virtual signal to avoid assert - Fix failures of disabling primary planes - Do not compare integers of different widths - Fix empty slot problem of EDID management - Revise Sink device string ID width in dmub psr - Log vertical interrupt 1 for debug Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c09a9bee6459eb6976b6db3f33d2776243760d3f Author: Charlene Liu Date: Sat Sep 10 15:08:51 2022 -0400 drm/amd/display: correct num_dsc based on HW cap [why] num_dsc is 3 for dcn314 based on HW capablity. Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 41da5fd2d93fa44946cd7d202178f982cdb587d0 Author: Wenjing Liu Date: Fri Sep 9 12:19:52 2022 -0400 drm/amd/display: solve regression in update phy state refactor [Why] There is a coding error when moving dp disable link phy to hw sequencer, where the receiver power control is missed during this refactor. [how] 1. Add back missing receiver power control in disable link phy. 2. minor modifications to ensure there is no undesired sequence changes in dp link enable/disable. Reviewed-by: Charlene Liu Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8434f8180216a9c6ad498c5f50e05a2cdbf81e03 Author: Charlene Liu Date: Thu Sep 8 21:12:45 2022 -0400 drm/amd/display: update dccg based on HW delta [why] update hw dccg based on HW delta, and reuse common src code Reviewed-by: Nicholas Kazlauskas Reviewed-by: Dmytro Laktyushkin Acked-by: Wayne Lin Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 66990450e3a0b6dc7baeea8f69684aa5d3ec2ba2 Author: Alvin Lee Date: Fri Sep 9 16:09:57 2022 -0400 drm/amd/display: Do second pass through DML for DET calculation [Why & How] If we find that DML requires pipe split, run through DML again because the DET allocation per pipe must be re-assigned. Reviewed-by: Dmytro Laktyushkin Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4aecd050a825c1bace2a35326b4c8faacc9ecadd Author: Josip Pavic Date: Fri Sep 9 14:18:31 2022 -0400 drm/amd/display: log vertical interrupt 1 for debug [Why & How] Extend existing OTG state collection function to include the vertical interrupt 1 state. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8bc14183988849e99046595785ceadbe0b88f7a7 Author: Robin Chen Date: Thu Sep 8 21:42:10 2022 +0800 drm/amd/display: Revise Sink device string ID [Why] The Sink device string ID1/ID2 use 5 bytes instead of 6 bytes, so the driver should compare the first 5 bytes only. Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: Robin Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9680810f91f2591b16b76f73d1e0d49af874be0a Author: muansari Date: Thu Sep 1 13:21:52 2022 -0400 drm/amd/display: Modify DML to adjust Vstartup Position [WHY] The Vstartup position should be as late as possible to maximize power saving with the current. Calculation of Vstartup in DML does not take into account as SDP signal. [HOW] Made necessary changes to calculate the correct Vstartup position in DML to account for AS SDP * Overriding the VBlankNom value in certain cases otherwise it will use the default value * Bypassing the condition for adjust_sync_Vstartup * Overriding vblank_nom_input with VBlankNom that is set in the SW Layer Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: muansari Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d1a4ae582448a4afe38b7f117523fa2ac2e96599 Author: Nicholas Kazlauskas Date: Tue Sep 6 09:47:24 2022 -0400 drm/amd/display: Disable OTG WA for the plane_state NULL case on DCN314 [Why] This shouldn't trigger during tiled display hotplug/unplug but it does because one of the tiles can end up with a NULL plane state. This also doesn't guard against the hang that it was originally trying to resolve, and can instead cause DIO corruption due to OTG sync being lost. [How] This was reverted at one point out of DCN31 so revert it here too. Reviewed-by: Dmytro Laktyushkin Acked-by: Wayne Lin Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e294bf36bd9b000defa9f80f054ae355a4914b0b Author: Daniel Miess Date: Fri Sep 9 11:32:55 2022 -0400 drm/amd/display: Add shift and mask for ICH_RESET_AT_END_OF_LINE [Why] DP DSC compliance failing for dcn314 due to ICH_RESET_AT_END_OF_LINE shift and mask being missing [How] Add in shift and mask for ICH_RESET_AT_END_OF_LINE Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6e602264b9a8adb3133faafdd06ba0f70716a2c2 Author: Aurabindo Pillai Date: Thu Sep 8 11:11:50 2022 -0400 drm/amd/display: Enable committing subvp config [Why and How] Enable committing subvp config through DMCUB for DCN32 Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit deed8ec482a6e7e84dd5bcaac5f77c75bd8093b3 Author: Jaehyun Chung Date: Thu Sep 8 19:11:31 2022 -0400 drm/amd/display: Assume connectors are on single slot [Why] v1_5 display object table has no way for connectors to indicate which slot they are a part of, resulting in additional empty slots to appear in EDID management UI. [How] Assume that all connectors belong to the same slot. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Jaehyun Chung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ca86bbdd9b47464d78ae6af565a6e78c6e4e2fbd Author: Josip Pavic Date: Thu Sep 8 12:01:41 2022 -0400 drm/amd/display: do not compare integers of different widths [Why & How] Increase width of some variables to avoid comparing integers of different widths Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 63423cf109d8308faf5d5946b1f57f5b0d6ae8f6 Author: Dmytro Laktyushkin Date: Wed Jul 27 13:02:44 2022 -0400 drm/amd/display: increase dcn315 pstate change latency [Why & How] Update after new measurment came in Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ed2770038bbc67abc60aea0108b698be3bc93e65 Author: Rodrigo Siqueira Date: Tue Sep 6 16:36:41 2022 -0400 drm/amd/display: Ignore k1/k2 values for virtual signal [Why and How] We are hitting k1/k2 assert when we are using a virtual signal in the test; as a result, we are failing some automated tests with a false positive. This commit addresses this issue by ignoring the assert condition if we use SIGNAL_TYPE_VIRTUAL. Reviewed-by: Aurabindo Pillai Acked-by: Wayne Lin Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2447ba5bee91527d3d49c5271b6c34a84fc67bdc Author: Alvin Lee Date: Thu Sep 8 11:08:25 2022 -0400 drm/amd/display: Don't allocate DET for phantom pipes [Why & How] We should not allocate any DET for the phantom pipes. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c1143ca2d523dee0f6012638068abd202a50a42b Author: Cruise Hung Date: Thu Sep 8 22:04:09 2022 +0800 drm/amd/display: Fix DP MST timeslot issue when fallback happened [Why] When USB4 DP link training failed and fell back to lower link rate, the time slot calculation uses the verified_link_cap. And the verified_link_cap was not updated to the new one. It caused the wrong VC payload time-slot was allocated. [How] Updated verified_link_cap with the new one from cur_link_settings after the LT completes successfully. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Cruise Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit abffd871d4862f9e77979708d1df45152becf8b4 Author: Meenakshikumar Somasundaram Date: Wed Aug 31 13:27:07 2022 -0400 drm/amd/display: Display distortion after hotplug 5K tiled display [Why] During hot plug of specific 5K tiled display, sometimes both the tiles are not synchronized resulting in distortion. The reason is that otgs of both the tiles goes out of sync when otg workaround (dcnxxx_disable_otg_wa) is applied for bandwidth optimization. The otg workaround reenables otg but otg synchronization context is not reset and hence dc_trigger_sync() does not resynchronize otg again. [How] Implement reset_sync_context_for_pipe() to reset the otg synchronization context for the disabled pipe and its slave pipes when otg workaround is applied. Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Meenakshikumar Somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f57da8c04f183f90cd450a5d5142109fba340417 Author: George Shen Date: Thu Sep 1 18:30:37 2022 -0400 drm/amd/display: Update dummy P-state search to use DCN32 DML [Why] Current DCN3.2 logic for finding the dummy P-state index uses the DCN3.0 DML validation function instead of DCN3.2 DML. This can result in either unexpected DML VBA values, or unexpected dummy P-state index to be used. [How] Update the dummy P-state logic to use DCN3.2 DML validation function. Reviewed-by: Alvin Lee Reviewed-by: Nevenko Stupar Acked-by: Wayne Lin Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0c41021cb812d1492b426fe8d0435cd529771ebf Author: Charlene Liu Date: Wed Sep 7 14:49:41 2022 -0400 drm/amd/display: Expose few dchubbub functions [why] Expose few dchubbun functions in dcn31 and dcn32 to leverage. Reviewed-by: Dmytro Laktyushkin Acked-by: Wayne Lin Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fb579c4229d10b0d98c37ebfc5087863574a2524 Author: Pavle Kotarac Date: Thu Sep 1 15:24:09 2022 -0400 drm/amd/display: Removing 2 phys [WHY] New dcn301 has 2 less phys Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit db25e5d51f58add0740b17d8ea5cfd4cb051e3ce Author: Pavle Kotarac Date: Thu Sep 1 15:15:37 2022 -0400 drm/amd/display: Added new DCN301 Asic Id [WHY] Adding new asic id for dcn301 Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 796d6a37ff5ffaf9f2dc0f3f4bf9f4a1034c00de Author: Sherry Wang Date: Wed Sep 7 00:12:44 2022 +0800 drm/amd/display: correct hostvm flag [Why] Hostvm should be enabled/disabled accordding to the status of riommu_active, but hostvm always be disabled on DCN31 which causes underflow [How] Set correct hostvm flag on DCN31 Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Sherry Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e7f2f4cd67443ce308480ca461806fcc3456e0ba Author: George Shen Date: Thu Sep 1 15:03:50 2022 -0400 drm/amd/display: Fix urgent latency override for DCN32/DCN321 [Why] The urgent latency override is useful when debugging issues relating to underflow. Current overridden variable is not correct and has no effect on DCN3.2 and DCN3.21 DML calculations. [How] For DCN3.2 and DCN3.21, override the correct urgent latency variable when bounding box override is present. Reviewed-by: Alvin Lee Reviewed-by: Nevenko Stupar Acked-by: Wayne Lin Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5fb78600ec1504d30a7af7b0fdf2f2e6870ddea7 Author: Alvin Lee Date: Tue Sep 6 19:25:13 2022 -0400 drm/amd/display: Uncomment SubVP pipe split assignment in driver [Why & How] Uncomment SubVP pipe split assignment in driver since FW headers are now promoted Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c4c3d87be5cbab46039633731d8c5fb203c7a95e Author: zhikzhai Date: Fri Aug 26 19:44:50 2022 +0800 drm/amd/display: skip audio setup when audio stream is enabled [why] We have minimal pipe split transition method to avoid pipe allocation outage.However, this method will invoke audio setup which cause audio output stuck once pipe reallocate. [how] skip audio setup for pipelines which audio stream has been enabled Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: zhikzhai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 441595baa55ac7b60fc9a344228faafa275f3354 Author: Hugo Hu Date: Thu Sep 1 10:08:35 2022 +0800 drm/amd/display: update gamut remap if plane has changed [Why] The desktop plane and full-screen game plane may have different gamut remap coefficients, if switching between desktop and full-screen game without updating the gamut remap will cause incorrect color. [How] Update gamut remap if planes change. Reviewed-by: Dmytro Laktyushkin Acked-by: Wayne Lin Signed-off-by: Hugo Hu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit eccff6cdde6f47dcd88fca8c638e0d651f0e09f8 Author: Ian Chen Date: Tue Aug 30 14:50:24 2022 +0800 drm/amd/display: Refactor edp panel power sequencer(PPS) codes [Why & How] Move extra panel power sequencer settings into panel_cofig struct. Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ba5c07129896faa2a261d57ea2176841fcff8723 Author: Aric Cyr Date: Sun Sep 4 22:02:04 2022 -0400 drm/amd/display: 3.2.203 This version brings along following fixes: - Port DCN30 420 logic to DCN32 - Remove some unused definitions from DCN32/321 - Remove dp dig pixle rate div policy from dcn314 - Fix dcn315 reading of memory channel count and width - Fix SubVP and ODM relevant issues - Fix pipe split, MPO and ODM relevant issues - Support proper mst payload removal when link is not in mst mode in dc - Assume an LTTPR is always present on fixed_vs links - Rework recent update PHY state commit - Add debug option and logs Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1591a6478fbc61a0b30765a3c2b222fc50db849e Author: Anthony Koo Date: Sat Sep 3 21:31:04 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.134.0 - Handle pipe split case for SubVP: Pass in pipe split index for main and phantom pipes Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b81fafb9360f8577f660eb996602a7a58106bb7e Author: Alvin Lee Date: Fri Sep 2 15:39:12 2022 -0400 drm/amd/display: Fix SubVP way calculation [Why and How] - Don't skip bottom and next odm pipe when calculating num ways for subvp - Don't need to double cache lines for DCC (divide by 256) Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b0f5b1004ef8fbdd7cb314fe0bbbc115beae057a Author: Alvin Lee Date: Thu Sep 1 19:03:31 2022 -0400 drm/amd/display: Disable SubVP on driver disable [Why and How] - For driver disable cases in current implementation, if P-State is unsupported or still supported by firmware, we force it supported by DCN. - SubVP now needs to be included in this case along with FPO. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b0d6de32e30c635aac22e52357b090982d94df52 Author: Alvin Lee Date: Thu Sep 1 18:54:22 2022 -0400 drm/amd/display: SubVP pipe split case [Why and How] For SubVP pipe split case, pass in split index for main and phantom pipes to ensure that the P-State sequence will force P-State for all required pipes. Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6eef37460584269b240f45aa47ebb61aae848082 Author: Alvin Lee Date: Thu Sep 1 18:43:39 2022 -0400 drm/amd/display: Add debug option for allocating extra way for cursor [Why and How] - Add a debug option for allocating extra way for cursor - Remove usage of cache_cursor_addr since it's not gaurenteed to be populated - Include cursor size in MALL calculation if it exceeds the DCN cursor buffer size (and don't need extra way for cursor) Reviewed-by: Aurabindo Pillai Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6349c73859cba2fabd77494230306ae8a7e45b33 Author: Alvin Lee Date: Thu Sep 1 18:40:32 2022 -0400 drm/amd/display: For ODM seamless transition require AUTO mode [Why & How] ODM seamless transitions require DIV_MODE_AUTO. However, DIV_MODE_AUTO only works when all the horizontal timing params are divisible by the ODM combine factor. Therefore, disable the ODM 2:1 policy when the horizontal timing params are not divisible by 2. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cc67aae1e3a330e18ead512b525b8721a3b05a6c Author: Wenjing Liu Date: Wed Aug 31 15:22:56 2022 -0400 drm/amd/display: support proper mst payload removal when link is not in mst mode in dc [why] When user unplugs mst hubs, the current code will forcefully zero entire mst payload allocation table structure stored in link before we deallocate actual payload when disabling stream. During the first disable stream sequence, we will use current mst payload allocation table to determine if link should be turned off. Because we zero out it before we are disabling stream, the payload allocation table stored in link doesn't represent the actual allocation status, so we turn off link at the first disable stream without waiting until all streams' payloads have been deallocated. This avoilates the designed deallocation sequence and caused system hang in DP2 scenario. [how] Remove payload during deallocation and never zero payload allocation structure without actually deallocating payload. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9c75891feef0f9f67cf1c8f8038371006e25d23f Author: Wenjing Liu Date: Wed Aug 31 14:56:46 2022 -0400 drm/amd/display: rework recent update PHY state commit [why] Original change 594b237b9a07 ("drm/amd/display: Add interface to track PHY state") was implemented by assuming stream's dpms off is equivalent to PHY power off. This assumption doesn't hold in following situations: 1. MST multiple stream scenario, where multiple streams are sharing the same PHY output. Toggle dpms off for one of the stream doesn't power off the PHY due to the presence of other streams. 2. enable stream failure scenario, where enable stream fails due to failure of link training. This will cause DPMS off is set to false, while the actual PHY power state is off in certain cases. Due to the problematic assumption, the logic will skip disabling other streams for MST multiple stream scenario, therefore PHY is not actually powered off. [how] 1. Rework this refactor by moving PHY state update down to hardware level, where we update PHY state in place when hardware sequencer is actually changing the power state of the PHY hardware. 2. Reimplement symclk on TX off workaround in place when we are actually calling transmitter control to power off PHY in dcn32. Note the workaround is added due to the lack of proper software interface to set TX while keeping symclk on. We plan to address this interface problem so we can set TX off only without affecting symclk in future dcn versions. Fixes: 594b237b9a07 ("drm/amd/display: Add interface to track PHY state") Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 10faf07871b257c46baea0d39df585bade6e9266 Author: Yifan Zhang Date: Thu Sep 15 17:03:44 2022 +0800 drm/amdgpu: add MES and MES-KIQ version in debugfs This patch addes MES and MES-KIQ version in debugfs. Signed-off-by: Yifan Zhang Reviewed-by: Tim Huang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 47c2790ad69d1f072e7e26dc16bb91e99dd4c946 Author: Michael Strauss Date: Wed Aug 31 15:10:43 2022 -0400 drm/amd/display: Assume an LTTPR is always present on fixed_vs links [WHY] LTTPRs can in very rare instsances fail to increment DPCD LTTPR count. This results in aux-i LTTPR requests to be sent to the wrong DPCD address, which causes link training failure. [HOW] Override internal repeater count if fixed_vs flag is set for a given link Reviewed-by: George Shen Acked-by: Wayne Lin Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 62f0576c42993a442ae722fe2e67a140e4669945 Author: Dmytro Laktyushkin Date: Tue Aug 30 15:16:40 2022 -0400 drm/amd/display: fix dcn315 memory channel count and width read [Why & How] Correctly set ddr5 channel width to 8 bytes Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 22c42b0ec225c92db33e4b3045ad15baf1427cff Author: Leo Li Date: Tue Aug 30 16:38:16 2022 -0400 drm/amd/display: Fix double cursor on non-video RGB MPO [Why] DC makes use of layer_index (zpos) when picking the HW plane to enable HW cursor on. However, some compositors will not attach zpos information to each DRM plane. Consequently, in amdgpu, we default layer_index to 0 and do not update it. This causes said DC logic to enable HW cursor on all planes of the same layer_index, which manifests as a double cursor issue if one of the planes is scaled (and hence scaling the cursor as well). [How] Use DRM core helpers to calculate a normalized_zpos value for each drm_plane_state under each crtc, within the atomic state. This helper will first consider existing zpos values, and if identical/unset, fallback to plane ID ordering. The normalized_zpos is then passed to dc_plane_info during atomic check for later use by the cursor logic. Reviewed-by: Bhawanpreet Lakha Acked-by: Wayne Lin Signed-off-by: Leo Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 82bf0f18ce99edfae2e5b4f753e6b2e774ee6226 Author: Alvin Lee Date: Wed Aug 31 10:53:27 2022 -0400 drm/amd/display: Only consider pixle rate div policy for DCN32+ [Why and How] - Only consider pixel rate div policy for DCN32+ Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7ef414375fcc001b6d0745d2931d91c9c736e18d Author: Leo Chen Date: Mon Aug 29 15:42:27 2022 -0400 drm/amd/display: Various logs added [Why & How] Added logs for panel delays, spread_spectrum_percentage, and gpuclk_ss_percentage to facilitate debugging. Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fcd3e58f09952d836d2f491444292be2d8bcf7c5 Author: Charlene Liu Date: Mon Aug 29 17:32:37 2022 -0400 drm/amd/display: add debug option for dramclk_change_latency in apu [Why & How] Support dramclk change latency change via debug option and add some code isolation. Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 064841347d75e094fa2bcb5b997639ec9e5f9a5a Author: Alvin Lee Date: Mon Aug 29 10:33:21 2022 -0400 drm/amd/display: Fix pipe split prediction [Why & How] - Pipe split prediction previously only took into account MPC split. We must also consider when ODM combine is required, and when we apply ODM combine by policy. - Also re-work DET allocation function as it wasn't properly splitting the DET per stream, per plane. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 710080a3794bed269533093f5d2d9e37908962f0 Author: Aurabindo Pillai Date: Tue Sep 6 11:11:26 2022 -0400 drm/amd/display: Remove some unused definitions from DCN32/321 [Why&How] After reg offset initialization was switched to runtime rather than compile time, some of the defintions are not needed anymore and can be removed. Acked-by: Wayne Lin Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 16e5859d9faee7b839531e7cb8f4e98954108c75 Author: Chris Park Date: Mon Sep 12 22:36:49 2022 +0800 drm/amd/display: Port DCN30 420 logic to DCN32 [Why] 420 modes are limited by FMT buffer width of 4096 which requires multi-pipe support in form of ODM combine. If 420 modes have greater HActive than 4096, the DML logic should accomodate whether it should be rejected, or ODM combine 2:1 or 4:1 is triggered accordingly. [How] FMT Buffer limit of 4096 in DCN32. Force ODM combine depending on HActive and FMT Buffer limit. Reject modes if TMDS 420 and above 4096. Acked-by: Wayne Lin Signed-off-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit db62b2b7893f724e5032229443b03e0494856aef Author: Yang Li Date: Thu Sep 15 09:58:02 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2182 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 822a9778289b9be9f29b02ccaae81d36c979f40b Author: Yang Li Date: Thu Sep 15 09:58:01 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2181 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 40e0110a85674ea93614a5863b852d5b3bb6e445 Author: Yang Li Date: Thu Sep 15 09:58:00 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2180 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 8886200073ee037027d727c2828d881257e28e04 Author: Yang Li Date: Thu Sep 15 09:57:59 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2179 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 7f89f9973cbe7c11338f69bcf134de157747d20f Author: Yang Li Date: Thu Sep 15 09:57:58 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2178 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 6ad045856f7d7d538dd4904a10470989c8f6081f Author: Yang Li Date: Thu Sep 15 09:57:57 2022 +0800 drm/amd/display: clean up some inconsistent indentings clean up some inconsistent indentings Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2177 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit e6a7746ef9a6e11c271935292e381acdad607c9a Author: Colin Ian King Date: Wed Sep 14 18:15:05 2022 +0100 drm/amdkfd: Fix spelling mistake "detroyed" -> "destroyed" There is a spelling mistake in a pr_debug message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 670c6edfbb73fa94026650691ba23842ef282a6b Author: Hawking Zhang Date: Wed Sep 14 10:46:37 2022 +0800 drm/amdgpu: add rlcv/rlcp version info to debugfs amdgpu_firmware_info debugfs will show rlcv/rlcp ucode version info Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 2f9d510f810cad1042c6857a516177295eb3b42a Author: Hawking Zhang Date: Tue Sep 13 19:37:14 2022 +0800 drm/amdgpu: add two new subquery ids To support query rlcp and rlcv firmware version from existing AMDGPU_INFO_FW_VERSION interface Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit d5c6ad72966aff6df9d969095b95478efebaa770 Author: Hawking Zhang Date: Tue Sep 13 19:19:55 2022 +0800 drm/amdgpu: support print rlc v2_x ucode hdr add rlc v2_x support to print_rlc_hdr helper Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit ed2eee42d36267bf9e084d7a13fe5c0100d1c64b Author: Hawking Zhang Date: Tue Sep 13 19:18:25 2022 +0800 drm/amdgpu: save rlcv/rlcp ucode version in amdgpu_gfx cache rlcv/rlcvp ucode version info in amdgpu_gfx structure Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit b98451dc7a0fc4cf235dc09483d7cece362d9ac8 Author: Shiwu Zhang Date: Wed Sep 7 11:03:22 2022 +0800 drm/amdkfd: Use the consolidated MQD manager functions for GFX11 To remove duplication for GFX11 as well, use the common MQD manager functions defined in kfd_mqd_manager.c for all version of managers Signed-off-by: Shiwu Zhang Acked-by: Felix Kuehling Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit 876552e5d50178cabaad015a464f116c1944739f Author: Mukul Joshi Date: Wed Sep 7 10:46:58 2022 -0400 drm/amdgpu: Update PTE flags with TF enabled This patch updates the PTE flags when translate further (TF) is enabled: - With translate_further enabled, invalid PTEs can be 0. Reading consecutive invalid PTEs as 0 is considered a fault. To prevent this, ensure invalid PTEs have at least 1 bit set. - The current invalid PTE flags settings to translate a retry fault into a no-retry fault, doesn't work with TF enabled. As a result, update invalid PTE flags settings which works for both TF enabled and disabled case. Fixes: 352e683b72e79d ("drm/amdgpu: Enable translate_further to extend UTCL2 reach") Reviewed-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Mukul Joshi Signed-off-by: Alex Deucher commit 3913f0179ba366f7d7d160c506ce00de1602bbc4 Author: Philip Yang Date: Tue Sep 13 15:46:30 2022 -0400 drm/amdgpu: SDMA update use unlocked iterator SDMA update page table may be called from unlocked context, this generate below warning. Use unlocked iterator to handle this case. WARNING: CPU: 0 PID: 1475 at drivers/dma-buf/dma-resv.c:483 dma_resv_iter_next Call Trace: dma_resv_iter_first+0x43/0xa0 amdgpu_vm_sdma_update+0x69/0x2d0 [amdgpu] amdgpu_vm_ptes_update+0x29c/0x870 [amdgpu] amdgpu_vm_update_range+0x2f6/0x6c0 [amdgpu] svm_range_unmap_from_gpus+0x115/0x300 [amdgpu] svm_range_cpu_invalidate_pagetables+0x510/0x5e0 [amdgpu] __mmu_notifier_invalidate_range_start+0x1d3/0x230 unmap_vmas+0x140/0x150 unmap_region+0xa8/0x110 Signed-off-by: Philip Yang Suggested-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 3cc3dd73c420dc70cd366f91a680035ef47edf4f Author: Christian König Date: Mon Sep 19 14:00:33 2022 +0200 dma-buf: fix dma_fence_default_wait() signaling check That check must now come after grabing the spinlock, not before. Signed-off-by: Christian König Fixes: b96fb1e724ae ("dma-buf: dma_fence_wait must enable signaling") Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220919120618.113332-1-christian.koenig@amd.com commit e01bae16a7d68931f0450cb079479c4a8f56d3e3 Author: Yang Yingliang Date: Fri Sep 16 22:03:29 2022 +0800 PCI/P2PDMA: Use for_each_pci_dev() helper Use for_each_pci_dev() instead of open-coding it. No functional change. Link: https://lore.kernel.org/r/20220916140329.679633-1-yangyingliang@huawei.com Signed-off-by: Yang Yingliang Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit a7e85406bdbd0c376f3997e571f7073b9527272e Author: Hou Tao Date: Mon Sep 19 11:57:14 2022 +0800 selftests/bpf: Add test result messages for test_task_storage_map_stress_lookup Add test result message when test_task_storage_map_stress_lookup() succeeds or is skipped. The test case can be skipped due to the choose of preemption model in kernel config, so export skips in test_maps.c and increase it when needed. The following is the output of test_maps when the test case succeeds or is skipped: test_task_storage_map_stress_lookup:PASS test_maps: OK, 0 SKIPPED test_task_storage_map_stress_lookup SKIP (no CONFIG_PREEMPT) test_maps: OK, 1 SKIPPED Fixes: 73b97bc78b32 ("selftests/bpf: Test concurrent updates on bpf_task_storage_busy") Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220919035714.2195144-1-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 3124d320c22f3f4388d9ac5c8f37eaad0cefd6b1 Author: Tetsuo Handa Date: Mon Aug 29 23:58:12 2022 +0900 Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure syzbot is reporting NULL pointer dereference at hci_uart_tty_close() [1], for rcu_sync_enter() is called without rcu_sync_init() due to hci_uart_tty_open() ignoring percpu_init_rwsem() failure. While we are at it, fix that hci_uart_register_device() ignores percpu_init_rwsem() failure and hci_uart_unregister_device() does not call percpu_free_rwsem(). Link: https://syzkaller.appspot.com/bug?extid=576dfca25381fb6fbc5f [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 67d2f8781b9f00d1 ("Bluetooth: hci_ldisc: Allow sleeping while proto locks are held.") Fixes: d73e172816652772 ("Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops") Signed-off-by: Luiz Augusto von Dentz commit deee93d13d385103205879a8a0915036ecd83261 Author: Tetsuo Handa Date: Fri Sep 2 20:23:48 2022 +0900 Bluetooth: use hdev->workqueue when queuing hdev->{cmd,ncmd}_timer works syzbot is reporting attempt to schedule hdev->cmd_work work from system_wq WQ into hdev->workqueue WQ which is under draining operation [1], for commit c8efcc2589464ac7 ("workqueue: allow chained queueing during destruction") does not allow such operation. The check introduced by commit 877afadad2dce8aa ("Bluetooth: When HCI work queue is drained, only queue chained work") was incomplete. Use hdev->workqueue WQ when queuing hdev->{cmd,ncmd}_timer works because hci_{cmd,ncmd}_timeout() calls queue_work(hdev->workqueue). Also, protect the queuing operation with RCU read lock in order to avoid calling queue_delayed_work() after cancel_delayed_work() completed. Link: https://syzkaller.appspot.com/bug?extid=243b7d89777f90f7613b [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 877afadad2dce8aa ("Bluetooth: When HCI work queue is drained, only queue chained work") Signed-off-by: Luiz Augusto von Dentz commit d2d05b88035d2d51a5bb6c5afec88a0880c73df4 Author: Coly Li Date: Tue Sep 20 00:16:47 2022 +0800 bcache: fix set_at_max_writeback_rate() for multiple attached devices Inside set_at_max_writeback_rate() the calculation in following if() check is wrong, if (atomic_inc_return(&c->idle_counter) < atomic_read(&c->attached_dev_nr) * 6) Because each attached backing device has its own writeback thread running and increasing c->idle_counter, the counter increates much faster than expected. The correct calculation should be, (counter / dev_nr) < dev_nr * 6 which equals to, counter < dev_nr * dev_nr * 6 This patch fixes the above mistake with correct calculation, and helper routine idle_counter_exceeded() is added to make code be more clear. Reported-by: Mingzhe Zou Signed-off-by: Coly Li Acked-by: Mingzhe Zou Link: https://lore.kernel.org/r/20220919161647.81238-6-colyli@suse.de Signed-off-by: Jens Axboe commit 6dd3be6923eec2c49860e7292e4e2783c74a9dff Author: Jilin Yuan Date: Tue Sep 20 00:16:46 2022 +0800 bcache:: fix repeated words in comments Delete the redundant word 'we'. Signed-off-by: Jilin Yuan Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220919161647.81238-5-colyli@suse.de Signed-off-by: Jens Axboe commit 11e529ccea33f24af6b54fe10bb3be9c1c48eddb Author: Jules Maselbas Date: Tue Sep 20 00:16:45 2022 +0800 bcache: bset: Fix comment typos Remove the redundant word `by`, correct the typo `creaated`. CC: Kent Overstreet CC: linux-bcache@vger.kernel.org Signed-off-by: Jules Maselbas Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220919161647.81238-4-colyli@suse.de Signed-off-by: Jens Axboe commit d86b4e6dc88826f2b5cfa90c4ebbccb19a88bc39 Author: Lin Feng Date: Tue Sep 20 00:16:44 2022 +0800 bcache: remove unused bch_mark_cache_readahead function def in stats.h This is a cleanup for commit 1616a4c2ab1a ("bcache: remove bcache device self-defined readahead")', currently no user for bch_mark_cache_readahead() since that commit. Signed-off-by: Lin Feng Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220919161647.81238-3-colyli@suse.de Signed-off-by: Jens Axboe commit 97d26ae764a43bfaf870312761a0a0f9b49b6351 Author: Li Lei Date: Tue Sep 20 00:16:43 2022 +0800 bcache: remove unnecessary flush_workqueue All pending works will be drained by destroy_workqueue(), no need to call flush_workqueue() explicitly. Signed-off-by: Li Lei Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220919161647.81238-2-colyli@suse.de Signed-off-by: Jens Axboe commit d136949dd8e2e309dc2f186507486b71cbe9acdb Author: Pierre-Louis Bossart Date: Mon Sep 19 13:53:48 2022 +0200 ASoC: SOF: add quirk to override topology mclk_id Some Intel-based platforms rely on a topology file that hard-codes the use of MCLK0. This is incorrect in 10% of the cases. Rather than generating yet another set of topology files, this patch adds a kernel module parameter to override the topology value. In hindsight, we should never have allowed mclks to be specified in topology, this is a hardware-level information that should not have been visible in the topology. Future patches will try to set this value automagically, e.g. by parsing the NHLT content. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220919115350.43104-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9ccbc2e12e01b39b804774c3207d2474dd992d95 Author: Pierre-Louis Bossart Date: Mon Sep 19 13:53:47 2022 +0200 ASoC: SOF: Intel: hda: refine SSP count support The SSP count is incorrect for TGL and MTL devices, the SSP count is limited to 3 (I2SPC parameter in the Integration HAS). Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220919115350.43104-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ac088c31d496b885d8268bd1c9746c3c76bf7078 Author: Martin Povišer Date: Thu Sep 15 11:44:44 2022 +0200 ASoC: cs42l42: Switch to dev_err_probe() helper Replace dev_err() with dev_err_probe() in the probe path for consistency with cs42l83-i2c.c. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-12-povik+lin@cutebit.org Signed-off-by: Mark Brown commit ab2940a72dfa823af09abf593512459afe3da460 Author: Martin Povišer Date: Thu Sep 15 11:44:43 2022 +0200 ASoC: cs42l42: Implement 'set_bclk_ratio' The driver wants to know the bit rate on the serial bus and takes that to be the value set by 'set_sysclk'. The 'set_bclk_ratio' op is a better fit for figuring out the clocking parameters of the serial bus, so implement that and give it precedence over the prior methods. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-11-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 94d5f62a91aab6ac9c3f4abfd048cbe5f77153ac Author: Martin Povišer Date: Thu Sep 15 11:44:42 2022 +0200 ASoC: cs42l83: Extend CS42L42 support to new part The CS42L83 part is a headphone jack codec found in recent Apple machines. It is a publicly undocumented part but as far as can be told it is identical to CS42L42 except for two points: * The chip ID is different. * Of those registers for which we have a default value in the existing CS42L42 kernel driver, one register (MCLK_CTL) differs in its reset value on CS42L83. To address those two points (and only those), add to the CS42L42 driver a separate CS42L83 front. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-10-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 30b679e2cb058c3dcf6d3ebdf10999f0a7a1644d Author: Martin Povišer Date: Thu Sep 15 11:44:41 2022 +0200 ASoC: cs42l42: Export regmap elements to core namespace Export the regmap callbacks for indicating readable/volatile registers, also the range structure, to the CS42L42 core namespace. This is in advance of reusing these bits in a CS42L83 driver frontend. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-9-povik+lin@cutebit.org Signed-off-by: Mark Brown commit ae9f5e607da47104bc3d02e5c0ed237749f5db51 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:40 2022 +0200 ASoC: cs42l42: Split I2C identity into separate module Split the I2C bus driver definition and probe()/remove() into a separate module so that a SoundWire build of CS42L42 support does not have a spurious dependency on I2C. Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-8-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 52c2e370df07092437d1515e773d28a5f53fc810 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:39 2022 +0200 ASoC: cs42l42: Pass component and dai defs into common probe Pass pointers to snd_soc_component_driver and snd_soc_dai_driver objects into cs42l42_common_probe(). This is in preparation for adding SoundWire support. Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-7-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 56746683c2560ba5604bb212f73eb01f5edfd312 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:38 2022 +0200 ASoC: cs42l42: Split cs42l42_resume into two functions On SoundWire the system resume cannot restore registers until the host controller has re-enumerated the peripheral. This patch splits cs42l42_resume() into two functions, one to power up and the other to restore registers, ready for adding SoundWire support. Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-6-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 0285042feda799edca63b35cea0cda32ed0c47c2 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:37 2022 +0200 ASoC: cs42l42: Split probe() and remove() into stages To prepare for adding SoundWire the probe must be split into three parts: 1) The bus-specific probe 2) Common bus-agnostic probe steps 3) Initialization of the peripheral registers Step (3) must be separate because on SoundWire devices the probe must enable power supplies and release reset so that the peripheral can be enumerated by the bus, but it isn't possible to access registers until enumeration has completed. The call to devm_snd_soc_register_component() must be done at stage (2) so that it can EPROBE_DEFER if necessary. In SoundWire systems stage (3) is not a probe event so a deferral at this stage would not result in re-probing dependencies. A new init_done flag indicates that the chip has been identified and initialized. This is used to prevent cs42l42_remove(), cs42l42_suspend(), cs42l42_restore() and cs42l42_irq_thread() from attempting register accesses if the chip was not successfully initialized. Although this cannot happen on I2C, because the entire probe would fail, it is possible on SoundWire if probe succeeds but the cs42l42 is never enumerated. Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-5-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 2feab7e7d8c01b67d9ffbfb902d1591c08e9d564 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:36 2022 +0200 ASoC: cs42l42: Use cs42l42->dev instead of &i2c_client->dev In preparation for splitting cs42l42_i2c_probe() into multiple functions replace use of &i2c_client->dev with cs42l42->dev. This reduces diff clutter in the patch that splits the function. Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-4-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 7e178946c3e4e64cebda4e60d0b7e5c02a502d13 Author: Richard Fitzgerald Date: Thu Sep 15 11:44:35 2022 +0200 ASoC: cs42l42: Add bitclock frequency argument to cs42l42_pll_config() Clean up the handling of bitclock frequency by keeping all the logic in cs42l42_pcm_hw_params(), which then simply passes the frequency as an argument to cs42l42_pll_config(). The previous code had become clunky as a legacy of earlier versions of the clock handling. The logic was split across cs42l42_pcm_hw_params() and cs42l42_pll_config(), with the params-derived bclk stashed in struct cs42l42_private only to pass it to cs42l42_pll_config(). Signed-off-by: Richard Fitzgerald Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 23162672ff85c24afc19293309500d3a63134ef8 Author: Martin Povišer Date: Thu Sep 15 11:44:34 2022 +0200 ASoC: dt-bindings: cs42l42: Add 'cs42l83' compatible CS42L83 is a publicly undocumented part found in Apple machines, similar (almost identical) to CS42L42. Share the binding schema of CS42L42 for it. Acked-by: Krzysztof Kozlowski Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220915094444.11434-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 2d2cb3066f2c90cd8ca540b36ba7a55e7f2406e0 Author: Tetsuo Handa Date: Sun Sep 4 00:32:56 2022 +0900 Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() syzbot is reporting cancel_delayed_work() without INIT_DELAYED_WORK() at l2cap_chan_del() [1], for CONF_NOT_COMPLETE flag (which meant to prevent l2cap_chan_del() from calling cancel_delayed_work()) is cleared by timer which fires before l2cap_chan_del() is called by closing file descriptor created by socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_L2CAP). l2cap_bredr_sig_cmd(L2CAP_CONF_REQ) and l2cap_bredr_sig_cmd(L2CAP_CONF_RSP) are calling l2cap_ertm_init(chan), and they call l2cap_chan_ready() (which clears CONF_NOT_COMPLETE flag) only when l2cap_ertm_init(chan) succeeded. l2cap_sock_init() does not call l2cap_ertm_init(chan), and it instead sets CONF_NOT_COMPLETE flag by calling l2cap_chan_set_defaults(). However, when connect() is requested, "command 0x0409 tx timeout" happens after 2 seconds from connect() request, and CONF_NOT_COMPLETE flag is cleared after 4 seconds from connect() request, for l2cap_conn_start() from l2cap_info_timeout() callback scheduled by schedule_delayed_work(&conn->info_timer, L2CAP_INFO_TIMEOUT); in l2cap_connect() is calling l2cap_chan_ready(). Fix this problem by initializing delayed works used by L2CAP_MODE_ERTM mode as soon as l2cap_chan_create() allocates a channel, like I did in commit be8597239379f0f5 ("Bluetooth: initialize skb_queue_head at l2cap_chan_create()"). Link: https://syzkaller.appspot.com/bug?extid=83672956c7aa6af698b3 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Signed-off-by: Luiz Augusto von Dentz commit 717a8ff20f32792d6a94f2883e771482c37d844b Author: Mikhail Rudenko Date: Wed Sep 14 00:22:55 2022 +0300 ASoC: sunxi: sun4i-codec: set debugfs_prefix for CPU DAI component At present, succesfull probing of H3 Codec results in an error debugfs: Directory '1c22c00.codec' with parent 'H3 Audio Codec' already present! This is caused by a directory name conflict between codec components. Fix it by setting debugfs_prefix for the CPU DAI component. Signed-off-by: Mikhail Rudenko Link: https://lore.kernel.org/r/20220913212256.151799-2-mike.rudenko@gmail.com Signed-off-by: Mark Brown commit 54a0511067217e7039045623942e4e021ef1db84 Author: ye xingchen Date: Fri Sep 16 06:26:30 2022 +0000 ASoC: Intel: sof_rt5682: use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062630.154277-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit 3d47637719c312cfb49d3ba063dc3976535c0e9f Author: Derek Fang Date: Tue Sep 13 10:56:58 2022 +0800 ASoC: rt5682s: Reduce coupling of PLLB setting Some parts of rt5682s CCF function are implemented by 'PLLB' dapm widget. The coupling risk exists, so this patch fixes it. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20220913025658.5005-3-derek.fang@realtek.com Signed-off-by: Mark Brown commit 6ea304a402322ed4449156805b0a79fa1e326ca7 Author: Derek Fang Date: Tue Sep 13 10:56:57 2022 +0800 ASoC: rt5682s: Reduce coupling of I2S1 setting Some parts of rt5682s CCF function are implemented by 'I2S1' dapm widget. The coupling risk exists, so this patch fixes it. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20220913025658.5005-2-derek.fang@realtek.com Signed-off-by: Mark Brown commit bfc5e8b860ad2a87269975a6043aa6bb245d44bb Author: Derek Fang Date: Tue Sep 13 10:56:56 2022 +0800 ASoC: rt5682s: Reduce coupling of Micbias and Vref2 settings Some parts of rt5682s CCF function are implemented by 'MICBIAS' and 'Vref2' dapm widgets. There is a risk of causing not expected behavior if we mix using dapm and CCF operations in machine specific code. This patch reduces the coupling. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20220913025658.5005-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit 9fc2c8ed923d8ec8a49cf5b5076c84867126ca69 Author: Ban Tao Date: Sun Sep 11 23:45:33 2022 -0700 ASoC: sunxi: Add Allwinner H6 Digital MIC driver The Allwinner H6 and later SoCs have an DMIC block which is capable of capture. Signed-off-by: Ban Tao Tested-by: Samuel Holland Link: https://lore.kernel.org/r/1662965133-9232-1-git-send-email-fengzheng923@gmail.com Signed-off-by: Mark Brown commit 59f84d2dd76ad6e681b5135db6e6cc8c8238cd89 Author: ye xingchen Date: Fri Sep 16 06:24:15 2022 +0000 ASoC: Intel: sof_es8336: use function devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062415.153659-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit c1c1fc8103f794a10c5c15e3c17879caf4f42c8f Author: Jairaj Arava Date: Mon Sep 19 13:44:29 2022 +0200 ASoC: SOF: pci: Change DMI match info to support all Chrome platforms In some Chrome platforms if OEM's use their own string as SYS_VENDOR than "Google", it leads to firmware load failure from intel/sof/community path. Hence, changing SYS_VENDOR to PRODUCT_FAMILY in which "Google" is used as common prefix and is supported in all Chrome platforms. Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Reviewed-by: Curtis Malainey Signed-off-by: Jairaj Arava Signed-off-by: Curtis Malainey Signed-off-by: Sathyanarayana Nujella Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919114429.42700-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9db1c9fa214ef41d098633ff40a87284ca6e1870 Author: Muralidhar Reddy Date: Mon Sep 19 13:45:48 2022 +0200 ALSA: intel-dspconfig: add ES8336 support for AlderLake-PS added quirks for ESS8336 for AlderLake-PS Reviewed-by: Ranjani Sridharan Signed-off-by: Muralidhar Reddy Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919114548.42769-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5cf934e84659ca2f03db6254978d56f053745366 Author: Ban Tao Date: Mon Sep 12 00:05:33 2022 -0700 ASoC: sun50i-dmic: dt-bindings: add DT bindings for DMIC controller DT binding documentation for this new ASoC driver. Signed-off-by: Ban Tao Reviewed-by: Rob Herring Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/1662966333-18000-1-git-send-email-fengzheng923@gmail.com Signed-off-by: Mark Brown commit c403dcd8b0c4dc01974329e38dc3f82859fd6f99 Author: Kuninori Morimoto Date: Fri Sep 9 01:19:18 2022 +0000 ASoC: soc-core.c: setup rtd->pmdown_time at soc_new_pcm_runtime() Almost all default rtd->xxx are setup at soc_new_pcm_runtime() which is sub-function of snd_soc_add_pcm_runtime() (A). But "rtd->pmdown_time" is setup at soc_init_pcm_runtime() (B). It is very random timing setup. This patch setup it at (A), same as other rtd->xxx. static int snd_soc_bind_card(...) { ... for_each_card_prelinks(...) { (A) ret = snd_soc_add_pcm_runtime(...); ... } ... for_each_card_rtds(...) { (B) ret = soc_init_pcm_runtime(...); ... } ... } One note is that current topology/intel are directly calling snd_soc_add_pcm_runtime() (A) without calling soc_init_pcm_runtime() (B). This means, its "rtd->pmdown_time settings" was 0, but will have default value by this patch. "rtd->pmdown_time settings" will be used at snd_soc_runtime_ignore_pmdown_time(). This patch adds "ignore_pmdown_time" to these driver to keep compatibility. bool snd_soc_runtime_ignore_pmdown_time(...) { ... => if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) return true; ... } Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/875yhxmjjd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e31a4a9320f1ccf75a690fe7f759896f285bb62e Author: Robert Rosengren Date: Mon Sep 12 12:54:07 2022 +0200 ASoC: fsl_spdif: add ALSA event on dpll locked Add an ALSA event on the RX Sample Rate controller upon the dpll locked interrupt, making it possible for audio applications to monitor changes in the hardware. Signed-off-by: Robert Rosengren Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220912105407.3157868-1-robert.rosengren@axis.com Signed-off-by: Mark Brown commit f047199e6f3115896fee25ac8809e1a9a8c948fc Author: ye xingchen Date: Fri Sep 16 06:20:27 2022 +0000 ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit 09dea5acbe352481beed7d7114295171f5073dff Author: ye xingchen Date: Fri Sep 16 06:25:49 2022 +0000 ASoC: Intel: sof_ssp_amp: use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062549.154114-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit ce6be534a615a361bf4877bd321639993dd74dfe Author: ye xingchen Date: Fri Sep 16 06:22:34 2022 +0000 ASoC: Intel: sof_cs42l42: use function devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062234.153275-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit 8e34d743f97f151824a2dc0803695752de80bf7d Author: ye xingchen Date: Fri Sep 16 06:19:06 2022 +0000 ASoC: amd: acp: use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220916061906.152434-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit 7b88552c26971ccbc6ff35e9d544f7fac94ffef1 Author: ye xingchen Date: Fri Sep 16 06:25:11 2022 +0000 ASOC: SOF: use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062511.153962-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit b60200d760cfcf49c260a47fc28956cef116674f Author: ye xingchen Date: Fri Sep 16 06:23:20 2022 +0000 ASoC: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062320.153456-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit d3cfe45f5f59f33137ce2a009c475f34dfd7f830 Merge: 9dd28b467c35e 295aeea6646ad Author: Mark Brown Date: Mon Sep 19 17:51:29 2022 +0100 ASoC: qcom: add support for sc8280xp machine Merge series from Srinivas Kandagatla : This patchset adds support for SC8280XP SoC machine driver. First patch moves some of the commonly used code to common from sm8250 machine driver and the follow on code adds minimal support for sc8280xp. Currently this driver is only tested with SmartSpeakers and Headset on Lenovo Thinkpad X13s. Support for sm8450 is tested and I will post the patches soon. commit 7fc90e8617095742ec0d948bfee10231c7a09be5 Author: Andy Shevchenko Date: Tue Sep 13 19:31:47 2022 +0300 efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Reviewed-by: Ard Biesheuvel Signed-off-by: Rafael J. Wysocki commit 2990f3a87e94b19b66c3faa16f9dd1d649b93d12 Author: Andy Shevchenko Date: Tue Sep 13 19:31:46 2022 +0300 spi: pxa2xx: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Acked-by: Mark Brown Signed-off-by: Rafael J. Wysocki commit 9cde62517f2eba00afb19f096dd783974896b9d9 Author: Andy Shevchenko Date: Tue Sep 13 19:31:45 2022 +0300 perf: qcom_l2_pmu: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 3ddaf13982a06d57347052f1fc386f70ef5b086f Author: Andy Shevchenko Date: Tue Sep 13 19:31:44 2022 +0300 i2c: mlxbf: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Acked-by: Wolfram Sang Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit f4c6752df92af2d4d67bcbdb259b4b387109477c Author: Andy Shevchenko Date: Tue Sep 13 19:31:43 2022 +0300 i2c: amd-mp2-plat: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Acked-by: Wolfram Sang Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 197a5aeaf6cd475720ca2f6ff1e4ed720da8657f Author: Andy Shevchenko Date: Tue Sep 13 19:31:42 2022 +0300 ACPI: x86: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 2a036e489eb1571810126d6fa47bd8af1e237c08 Author: Andy Shevchenko Date: Tue Sep 13 19:31:41 2022 +0300 ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer() ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 5db72fdb74983a1e81331aadf99ae2305f277562 Author: Andy Shevchenko Date: Tue Sep 13 19:31:40 2022 +0300 ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as integer Some users interpret _UID only as integer and for them it's easier to have an integer representation of _UID. Add respective helper for that. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 80b7e928635168c3699e0fe85dac8ea75dca5806 Author: Wolfram Sang Date: Thu Aug 18 23:00:33 2022 +0200 mtd: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220818210033.7084-1-wsa+renesas@sang-engineering.com commit bf3e6b8f837afdf01d31cdc86028660f3f342bbe Author: Gaosheng Cui Date: Tue Aug 16 21:59:10 2022 +0800 mtd: ftl: use container_of() rather than cast The container_of() is much more readable and also safer. Signed-off-by: Gaosheng Cui Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220816135910.268016-1-cuigaosheng1@huawei.com commit 8d704c4e1ead92b6185d6aedeb08ac6a85c4a42a Author: Christophe JAILLET Date: Sat Aug 6 22:07:22 2022 +0200 mtd: Fix a typo in a comment o and t are swapped. s/mtdpsotre/mtdpstore/ Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/de1b1134f056ea7563bb0a9bb2f66ede1475728d.1659816434.git.christophe.jaillet@wanadoo.fr commit f535ca406f5400be33b9498ea8a07ffa9e744133 Author: Colin Ian King Date: Fri Aug 5 18:54:23 2022 +0100 mtd: devices: docg3: Use correct function names in comment blocks The incorrect function name is being used in the comment for functions doc_set_reliable_mode, doc_read_seek and docg3_probe. Correct these comments. Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220805175423.2374939-1-colin.i.king@gmail.com commit 8b740c08eb8202817562c358e8d867db0f7d6565 Author: Zeng Jingxiang Date: Wed Jul 27 14:03:02 2022 +0800 mtd: physmap-core: Fix NULL pointer dereferencing in of_select_probe_type() Coverity complains of a possible NULL dereference: in of_select_probe_type(): 1. returned_null: of_match_device() returns NULL. 2. var_assigned: match = NULL return value from of_match_device() 309 match = of_match_device(of_flash_match, &dev->dev); 3.dereference: Dereferencing the NULL pointer match. 310 probe_type = match->data; Signed-off-by: Zeng Jingxiang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220727060302.1560325-1-zengjx95@gmail.com commit 26e784433e6c65735cd6d93a8db52531970d9a60 Author: William Dean Date: Fri Jul 22 17:16:44 2022 +0800 mtd: devices: docg3: check the return value of devm_ioremap() in the probe The function devm_ioremap() in docg3_probe() can fail, so its return value should be checked. Fixes: 82402aeb8c81e ("mtd: docg3: Use devm_*() functions") Reported-by: Hacash Robot Signed-off-by: William Dean Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220722091644.2937953-1-williamsukatube@163.com commit 002181f5b150e60c77f21de7ad4dd10e4614cd91 Author: Rafał Miłecki Date: Mon Jul 11 17:30:41 2022 +0200 mtd: parsers: add Broadcom's U-Boot parser Broadcom stores environment variables blocks inside U-Boot partition itself. This driver finds & registers them. Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220711153041.6036-2-zajec5@gmail.com commit 27bfb201b2c03c8a033b60e5ad80cbf3aaa52b94 Author: Rafał Miłecki Date: Mon Jul 11 17:30:40 2022 +0200 dt-bindings: mtd: partitions: add binding for U-Boot bootloader Right now there is no (known) real reason for a custom binding for standard U-Boot partitions. Broadcom's U-Boot however requires extra handling - looking for environment variables subblocks. This commit adds Broadcom specific binding. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220711153041.6036-1-zajec5@gmail.com commit 02c57a82c0081141abc19150beab48ef47f97f18 Author: Martin Belanger Date: Wed Sep 7 08:27:37 2022 -0400 nvme-tcp: print actual source IP address through sysfs "address" attr TCP transport relies on the routing table to determine which source address and interface to use when making a connection. Currently, there is no way to tell from userspace where a connection was made. This patch exposes the actual source address using a new field named "src_addr=" in the "address" attribute. This is needed to diagnose and identify connectivity issues. With the source address we can infer the interface associated with each connection. This was tested with nvme-cli 2.0 to verify it does not have any adverse effect. The new "src_addr=" field will simply be displayed in the output of the "list-subsys" or "list -v" commands as shown here. $ nvme list-subsys nvme-subsys0 - NQN=nqn.2014-08.org.nvmexpress.discovery \ +- nvme0 tcp traddr=192.168.56.1,trsvcid=8009,src_addr=192.168.56.101 live Signed-off-by: Martin Belanger Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 5bfaba275ae6486700194cad962574e3eb7ae60d Author: Fabio M. De Francesco Date: Wed Aug 31 00:05:33 2022 +0200 nvmet-tcp: don't map pages which can't come from HIGHMEM kmap() is being deprecated in favor of kmap_local_page().[1] There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. The pages which will be mapped are allocated in nvmet_tcp_map_data(), using the GFP_KERNEL flag. This assures that they cannot come from HIGHMEM. This imply that a straight page_address() can replace the kmap() of sg_page(sg) in nvmet_tcp_map_pdu_iovec(). As a side effect, we might also delete the field "nr_mapped" from struct "nvmet_tcp_cmd" because, after removing the kmap() calls, there would be no longer any need of it. In addition, there is no reason to use a kvec for the command receive data buffers iovec, use a bio_vec instead and let iov_iter handle the buffer mapping and data copy. Test with blktests on a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. [1] "[PATCH] checkpatch: Add kmap and kmap_atomic to the deprecated list" https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/ Cc: Chaitanya Kulkarni Cc: Keith Busch Suggested-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Suggested-by: Christoph Hellwig Suggested-by: Al Viro [sagi: added bio_vec plus minor naming changes] Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit c4c22c52081385f026b430f35776f80073a22076 Author: Keith Busch Date: Wed Sep 7 08:42:07 2022 +0200 nvme-pci: move iod dma_len fill gaps The 32-bit field, dma_len, packs better in the iod struct above the dma_addr_t on 64-bit systems. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit c372cdd1efdf2b8e51fdde36a2a05c263ab5ebb7 Author: Keith Busch Date: Tue Sep 6 09:07:37 2022 -0700 nvme-pci: iod npages fits in s8 The largest allowed transfer is 4MB, which can use at most 1025 PRPs. Each PRP is 8 bytes, so the maximum number of 4k nvme pages needed for the iod_list is 3, which fits in an 's8' type. While modifying this field, change the name to "nr_allocations" to better represent that this is referring to the number of units allocated from a dma_pool. Also introduce a BUILD_BUG_ON to ensure we never accidently increase the largest transfer limit beyond 127 chained prp lists. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 52da4f3f5cbd42815946c0544774167241f9f45f Author: Keith Busch Date: Tue Sep 6 09:07:36 2022 -0700 nvme-pci: iod's 'aborted' is a bool It's only true or false, so make this a bool to reflect that and save some space in nvme_iod. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit a53232cb3abef51524f06ee9d8fbc3364ad95794 Author: Keith Busch Date: Tue Sep 6 09:07:35 2022 -0700 nvme-pci: remove nvme_queue from nvme_iod We can get the nvme_queue from the req just as easily, so remove the duplicate path to the same structure to save some space. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 4cde03d82e2d0056d20fd5af6a264c7f5e6a3e76 Author: Daniel Wagner Date: Fri Jul 29 16:26:30 2022 +0200 nvme: consider also host_iface when checking ip options It's perfectly fine to use the same traddr and trsvcid more than once as long we use different host interface. This is used in setups where the host has more than one interface but the target exposes only one traddr/trsvcid combination. Use the same acceptance rules for host_iface as we have for host_traddr. Signed-off-by: Daniel Wagner Reviewed-by: Chao Leng Signed-off-by: Christoph Hellwig commit 1c467e259599864ec925d5b85066a0960320fb3c Author: Daniel Wagner Date: Mon Aug 29 11:28:41 2022 +0200 nvme-rdma: handle number of queue changes On reconnect, the number of queues might have changed. In the case where we have more queues available than previously we try to access queues which are not initialized yet. The other case where we have less queues than previously, the connection attempt will fail because the target doesn't support the old number of queues and we end up in a reconnect loop. Thus, only start queues which are currently present in the tagset limited by the number of available queues. Then we update the tagset and we can start any new queue. Signed-off-by: Daniel Wagner Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 09035f86496d8dea7a05a07f6dcb8083c0a3d885 Author: Daniel Wagner Date: Mon Aug 29 11:28:40 2022 +0200 nvme-tcp: handle number of queue changes On reconnect, the number of queues might have changed. In the case where we have more queues available than previously we try to access queues which are not initialized yet. The other case where we have less queues than previously, the connection attempt will fail because the target doesn't support the old number of queues and we end up in a reconnect loop. Thus, only start queues which are currently present in the tagset limited by the number of available queues. Then we update the tagset and we can start any new queue. Signed-off-by: Daniel Wagner Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 3e980f5995e0bb4d86fef873a9c9ad66721580d0 Author: Daniel Wagner Date: Mon Aug 29 11:28:39 2022 +0200 nvmet: expose max queues to configfs Allow to set the max queues the target supports. This is useful for testing the reconnect attempt of the host with changing numbers of supported queues. Signed-off-by: Daniel Wagner Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 0dedcf6e3301836eb70cfa649052e7ce4fcd13ba Author: Kees Cook Date: Wed Sep 7 16:05:56 2022 -0700 MIPS: BCM47XX: Cast memcmp() of function to (void *) Clang is especially sensitive about argument type matching when using __overloaded functions (like memcmp(), etc). Help it see that function pointers are just "void *". Avoids this error: arch/mips/bcm47xx/prom.c:89:8: error: no matching function for call to 'memcmp' if (!memcmp(prom_init, prom_init + mem, 32)) ^~~~~~ include/linux/string.h:156:12: note: candidate function not viable: no known conversion from 'void (void)' to 'const void *' for 1st argument extern int memcmp(const void *,const void *,__kernel_size_t); Cc: Hauke Mehrtens Cc: "Rafał Miłecki" Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: llvm@lists.linux.dev Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202209080652.sz2d68e5-lkp@intel.com Signed-off-by: Kees Cook Signed-off-by: Thomas Bogendoerfer commit b85ad8a54e0a446b3daa7f526e4996ddb6d4373f Author: Vincent Whitchurch Date: Fri Sep 16 13:39:48 2022 +0200 spi: spi-loopback-test: Add test to trigger DMA/PIO mixing Add a test where a small and a large transfer in a message hit the same cache line. This test currently fails on spi-s3c64xx on in DMA mode since it ends up mixing DMA and PIO without proper cache maintenance. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220916113951.228398-2-vincent.whitchurch@axis.com Signed-off-by: Mark Brown commit f4ca8c88c2c7ea3ea17c6fdfcc1af4b007403833 Author: Yang Yingliang Date: Sat Sep 17 20:25:04 2022 +0800 spi: omap2-mcspi: Switch to use dev_err_probe() helper In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220917122504.1896302-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 7ec12d153998616d9f9fd0e603d56b5e122fc768 Author: Jiapeng Chong Date: Mon Sep 19 10:48:30 2022 +0800 regulator: of: Fix kernel-doc drivers/regulator/ti-abb-regulator.c:161: warning: expecting prototype for ti_abb_wait_tranx(). Prototype was for ti_abb_wait_txdone() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2206 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220919024830.111874-2-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown commit a8c31d3507fbf4e5e6d4a47225294a4d2f09d0b2 Author: Jiapeng Chong Date: Mon Sep 19 10:48:29 2022 +0800 regulator: of: Fix kernel-doc drivers/regulator/of_regulator.c:689: warning: expecting prototype for of_parse_coupled regulator(). Prototype was for of_parse_coupled_regulator() instead. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2205#c0 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220919024830.111874-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown commit 295aeea6646ad6cf26c24f5c493ddb60b8f5a0f4 Author: Srinivas Kandagatla Date: Fri Sep 16 14:24:27 2022 +0100 ASoC: qcom: add machine driver for sc8280xp Add machine driver for sc8280xp SoC. This intial supports only includes WSA883x Speakers and WCD938x based headset. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916132427.1845-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 3bd975f3ae0a245e4b851c2b0c97b0a71e5359d6 Author: Srinivas Kandagatla Date: Fri Sep 16 14:24:26 2022 +0100 ASoC: qcom: sm8250: move some code to common SM8450 machine driver code can be reused across multiple Qualcomm SoCs, At least another 2 of them for now (SM8450 and SC8250XP). Move some of the common SoundWire stream specific code to common file so that other drivers can use it instead of duplication. This patch is to prepare the common driver to be able to add new SoCs support with less dupication. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916132427.1845-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit f19097cc5adfd29bf2aecd8e0137331fab36946b Author: Srinivas Kandagatla Date: Fri Sep 16 14:24:25 2022 +0100 ASoC: dt-bindings: qcom,sm8250: add compatibles for sm8450 and sm8250 Add compatibles for sm8450 and sm8250xp based soundcards. Signed-off-by: Srinivas Kandagatla Acked-by: Rob Herring Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916132427.1845-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit e4f10cc23cefe16ed69987cb2648f5111e6eacb4 Author: Srinivas Kandagatla Date: Fri Sep 16 14:24:24 2022 +0100 ASoC: dt-bindings: qcom: sort compatible strings Sort compatible strings for consistency reasons. Signed-off-by: Srinivas Kandagatla Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916132427.1845-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit a25f4e2cdd5d64408b0fa56115ebebd8cc5cb6c0 Author: Srinivas Kandagatla Date: Fri Sep 16 14:24:23 2022 +0100 ASoC: qcom: common: use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL qcom_snd_parse_of depends on ASoC EXPORT_SYMBOL_GPL functions, so make qcom_snd_parse_of and EXPORT_SYMBOL_GPL. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220916132427.1845-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 794cd3bd69315f724532e35fbc1c45dfad9a79e6 Author: Noah Klayman Date: Mon Sep 19 14:21:08 2022 +0200 ASoC: SOF: replace ipc4-loader dev_vdbg with tracepoints This patch replaces dev_vdbg with tracepoints in new ipc4-loader code. Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bcd2cc350ded769963970c4b0074b38bc9240a64 Author: Noah Klayman Date: Mon Sep 19 14:21:07 2022 +0200 ASoC: SOF: replace dev_vdbg with tracepoints This patch removes unneeded dev_vdbg calls and replaces remaining ones with tracepoints to reduce overhead and enable use of trace collection and analysis tools. Signed-off-by: Noah Klayman Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220919122108.43764-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d272b65704bbbb9c054093c8c7dffb7b1793539f Author: Bard Liao Date: Mon Sep 19 14:21:06 2022 +0200 ASoC: SOF: Intel: replace dev_vdbg with tracepoints This patch replaces all dev_vdbg calls with tracepoints to reduce overhead and enable use of trace collection and analysis tools. Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 4a232cc910b943947a52da363bce1265911555f7 Author: Noah Klayman Date: Mon Sep 19 14:21:05 2022 +0200 ASoC: SOF: remove unneeded dev_vdbg This patch removes some unneeded dev_vdbg calls. Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 032e7c68bb4f4d977d2dd7f7629771973131f15e Author: Noah Klayman Date: Mon Sep 19 14:21:04 2022 +0200 ASoC: SOF: Intel: remove unneeded dev_vdbg This patch removes an unneeded dev_vdbg call in hda-stream. Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit baedc6300b3d52c71a06f4bddd426488ec243c2b Author: Noah Klayman Date: Mon Sep 19 14:21:03 2022 +0200 ASoC: SOF: Intel: add HDA interrupt source tracing The Intel HDaudio controller relies on a single interrupt line which wire-ORs multiple interrupt sources, such as stream, IPC, SoundWire and wakes. This patch adds the ability to trace each event occurrence. Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fa6e73d69193d0ba3b794f7c303beae498732f40 Author: Bard Liao Date: Mon Sep 19 14:21:02 2022 +0200 ASoC: SOF: add widget setup/free tracing Enables tracking of use_count during widget setup and free routines. Useful for debugging unbalanced use_counts during suspend/resume. Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 53f9cd5c16a57076ba1ef01c62299fa899bd83b3 Author: Liu Shixin Date: Tue Sep 13 18:10:38 2022 +0800 mips: ralink: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Signed-off-by: Thomas Bogendoerfer commit 27a43a85bcfe5cd9ee0fa561d7ec9aead462166d Author: Liu Shixin Date: Tue Sep 13 18:10:37 2022 +0800 mips: kernel: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Signed-off-by: Thomas Bogendoerfer commit 6f674034b467dc231c99ea34abf4a3f6434ff766 Author: Liu Shixin Date: Tue Sep 13 18:10:36 2022 +0800 mips: cavium: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin Signed-off-by: Thomas Bogendoerfer commit 5c5a4682e96a424c7d6b071b5832b5068ce29107 Author: Gaosheng Cui Date: Thu Sep 15 21:21:57 2022 +0800 MIPS: AR7: remove orphan declarations from arch/mips/include/asm/mach-ar7/ar7.h All uses of ar7_cpu_clock, ar7_bus_clock and ar7_dsp_clock were removed by commit 780019ddf02f ("MIPS: AR7: Implement clock API"), so remove the orphan declarations, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit b7dc37fcf67b6191da5049938c8a1c881b4992df Author: Gaosheng Cui Date: Thu Sep 15 21:21:56 2022 +0800 MIPS: remove orphan sni_cpu_time_init() declaration All uses of sni_cpu_time_init() were removed by commit 4b550488f894 ("[MIPS] Deforest the function pointer jungle in the time code."), so remove the orphan declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit 0b8b94c384e7eb2363cd90f4d438c41ce93ae530 Author: Gaosheng Cui Date: Thu Sep 15 21:21:55 2022 +0800 MIPS: IRQ: remove orphan declarations from arch/mips/include/asm/irq.h All uses of free_irqno() and alloc_legacy_irqno() were removed by commit 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts"), so remove the orphan declarations, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit 2af06ba7ee2fb80e1ededade7cda85cc04c51109 Author: Gaosheng Cui Date: Thu Sep 15 21:21:54 2022 +0800 MIPS: Octeon: remove orphan octeon_hal_setup_reserved32() declaration All uses of octeon_hal_setup_reserved32() were removed by commit 1ef2887030db ("MIPS: Octeon: Remove vestiges of CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB"), so remove the orphan declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit c5f60e1cbb7a4f37bd158f4046f9c049ee235230 Author: Gaosheng Cui Date: Thu Sep 15 21:21:53 2022 +0800 MIPS: Octeon: remove orphan cvmx_fpa_setup_pool() declaration All uses of cvmx_fpa_setup_pool() were removed by commit a03822ea5df6 ("MIPS: OCTEON: Remove some unused files."), so remove the orphan declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit df1a727fa2f67369115574b02a01c140440c5a72 Author: Gaosheng Cui Date: Thu Sep 15 21:21:52 2022 +0800 MIPS: Octeon: remove orphan octeon_swiotlb declaration All uses of octeon_swiotlb were removed by commit f39f8d0eb081 ("MIPS/octeon: use swiotlb_init instead of open coding it"), so remove the orphan declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit aaec03d331303494227dc1e208eb212682fe925d Author: Gaosheng Cui Date: Thu Sep 15 21:21:51 2022 +0800 MIPS: Loongson2ef: remove orphan sbx00_acpi_init() declaration All uses of sbx00_acpi_init() in the "pci.c" file were removed by commit 5831fdb099dd ("MIPS: Loongson2ef: clean up loongson64 related code"), so remove the orphan declaration, too. Signed-off-by: Gaosheng Cui Signed-off-by: Thomas Bogendoerfer commit b971612cc193b524b554fe53821f4dbb2a774c01 Author: Rafał Miłecki Date: Wed Sep 14 11:10:45 2022 +0200 mips: bmips: bcm63268: add TWD block binding TWD is an MFD block that contains timers, watchdog & some clocks / reset controller. Signed-off-by: Rafał Miłecki Signed-off-by: Thomas Bogendoerfer commit 11bec9cba4de06b3c0e9e4041453c2caaa1cbec1 Author: Lin Yujun Date: Wed Sep 14 11:29:17 2022 +0800 MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create() In error case in bridge_platform_create after calling platform_device_add()/platform_device_add_data()/ platform_device_add_resources(), release the failed 'pdev' or it will be leak, call platform_device_put() to fix this problem. Besides, 'pdev' is divided into 'pdev_wd' and 'pdev_bd', use platform_device_unregister() to release sgi_w1 resources when xtalk-bridge registration fails. Fixes: 5dc76a96e95a ("MIPS: PCI: use information from 1-wire PROM for IOC3 detection") Signed-off-by: Lin Yujun Signed-off-by: Thomas Bogendoerfer commit 1e6d11fe72e311c1989991ee318d239f650fa318 Author: Lin Yujun Date: Wed Sep 14 11:28:07 2022 +0800 MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create() In error case in bridge_platform_create after calling platform_device_add()/platform_device_add_data()/ platform_device_add_resources(), release the failed 'pdev' or it will be leak, call platform_device_put() to fix this problem. Besides, 'pdev' is divided into 'pdev_wd' and 'pdev_bd', use platform_device_unregister() to release sgi_w1 resources when xtalk-bridge registration fails. Fixes: fd27234f24ae ("MIPS: add support for SGI Octane (IP30)") Signed-off-by: Lin Yujun Signed-off-by: Thomas Bogendoerfer commit 9dd28b467c35eef320a2974f6b1f209343ad8704 Author: Peter Ujfalusi Date: Fri Sep 16 14:13:49 2022 +0300 ASoC: max98390: Fix dsm calibration reading With the change introduced by 6ac246105b4f, the calibration can only be done after the codec probe (but questionable if it is working since 203A_AMP_EN is 0) or when the codec is powered up for audio use, in other cases "AMP is not ready to run calibration" is printed. This changes how this worked before the patch: the codec was force powered on for the duration of the calibration readout, then shut down. So, if a calibration was asked when the codec was active, it would have powered it down? To correct the calibration logic: check if the codec is powered on and if it is not then enable it, do the readout and put it back to disabled. Do this while keeping the dapm locked to avoid interfering with normal operation via DAPM. Fixes: 6ac246105b4f ("ASoC: max98390: Remove unnecessary amp on/off conrtol") Reported-by: Fred Oh Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220916111349.4433-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 61dfa797c731754642d1ac500a6ac42f9b47f920 Author: Liang He Date: Mon Sep 19 18:48:24 2022 +0800 USB: serial: console: move mutex_unlock() before usb_serial_put() While in current version there is no use-after-free as USB serial core holds another reference when the console is registered, we should better unlock before dropping the reference in usb_console_setup(). Fixes: 7bd032dc2793 ("USB serial: update the console driver") Signed-off-by: Liang He Signed-off-by: Johan Hovold commit 0cb15e8ae0f8e7f00f2da726541bfa44718fb955 Author: Eliav Farber Date: Thu Sep 8 15:24:49 2022 +0000 hwmon: (mr75203) fix coding style space errors Fix: "ERROR: space required before the open parenthesis '('" All of the errors were introduced before this series of patches. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-22-farbere@amazon.com Signed-off-by: Guenter Roeck commit a4dd0b80b461a4cf2238013a43ff1bd6077c8056 Author: Eliav Farber Date: Thu Sep 8 15:24:48 2022 +0000 hwmon: (mr75203) add debugfs to read and write temperature coefficients This change adds debugfs to read and write temperature sensor coefficients - g, h, j and cal5. The coefficients can vary between product and product, so it can be very useful to be able to modify them on the fly during the calibration process. e.g.: cat /sys/kernel/debug/940f23d0000.pvt/ts_coeff_cal5 4096 echo 83000 > sys/kernel/debug/940f23d0000.pvt/ts_coeff_g Signed-off-by: Eliav Farber Link: https://lore.kernel.org/r/20220908152449.35457-21-farbere@amazon.com Signed-off-by: Guenter Roeck commit 27937d6f8eda4ec8179384764fc5a658d4a6060c Author: Eliav Farber Date: Thu Sep 8 15:24:47 2022 +0000 hwmon: (mr75203) parse temperature coefficients from device-tree Use thermal coefficients from the device tree if they exist. Otherwise, use default values according to the series (5 or 6). All coefficients can be used or only part of them. The coefficients shall be used for fine tuning the default values since coefficients can vary between product and product. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-20-farbere@amazon.com Signed-off-by: Guenter Roeck commit bf1fdafdbc61c5fcfb12e481fc40b345fbc26814 Author: Eliav Farber Date: Thu Sep 8 15:24:46 2022 +0000 dt-bindings: hwmon: (mr75203) add coefficient properties for the thermal equation Add optional temperature coefficient properties: *) moortec,ts-coeff-g *) moortec,ts-coeff-h *) moortec,ts-coeff-cal5 *) moortec,ts-coeff-j If defined they shall be used instead of defaults. The coefficients were added to device tree on top of the series property (which can be used to select between series 5 and series 6), because coefficients can vary between product and product, and code defaults might not be accurate enough. Signed-off-by: Eliav Farber Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-19-farbere@amazon.com Signed-off-by: Guenter Roeck commit 3b12ca798e022192fb451e9e5ef1bb147f21c413 Author: Eliav Farber Date: Thu Sep 8 15:24:45 2022 +0000 hwmon: (mr75203) add support for series 6 temperature equation The current equation used in code is aligned to series 5: T = G + H * (n / cal5 - 0.5) + J * F Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz Series 6 has a slightly different equation: T = G + H * (n / cal5 - 0.5) and a different set of coefficients: G = 57.4, H = 249.4, cal5 = 4096 This change supports equation and coefficients for both series. (for series 6, J is set to 0). The series is determined according to “moortec,ts-series” property in the device tree. If absent, series 5 is assumed to be the default. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-18-farbere@amazon.com Signed-off-by: Guenter Roeck commit 34339c858ca1ed955cfe6f78a656882e66310920 Author: Eliav Farber Date: Thu Sep 8 15:24:44 2022 +0000 dt-bindings: hwmon: (mr75203) add "moortec,ts-series" property Add optional "moortec,ts-series" property to define the temperature equation and coefficients that shall be used to convert the digital output to value in milli-Celsius. Supported series: 5 (default) and 6. Series 5: T = G + H * (n / cal5 - 0.5) + J * F Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz Series 6: T = G + H * (n / cal5 - 0.5) Where: G = 57.4, H = 249.4, cal5 = 4096 Signed-off-by: Eliav Farber Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-17-farbere@amazon.com Signed-off-by: Guenter Roeck commit 331ed050c11faf6a0beb065a79a1ac52e2fd0467 Author: Peter Robinson Date: Fri Sep 16 13:09:36 2022 +0100 hwmon: (aspeed-pwm-tacho) Add dependency on ARCH_ASPEED The SENSORS_ASPEED is part of the Aspeed silicon so it makes sense to depend on ARCH_ASPEED and for compile testing. Signed-off-by: Peter Robinson Link: https://lore.kernel.org/r/20220916120936.372591-1-pbrobinson@gmail.com Signed-off-by: Guenter Roeck commit 94c025b6f735b895285a74f2de263c773a08982b Author: Eliav Farber Date: Thu Sep 8 15:24:43 2022 +0000 hwmon: (mr75203) modify the temperature equation according to series 5 datasheet Modify the equation and coefficients used to convert the digital output to temperature according to series 5 of the Moortec Embedded Temperature Sensor (METS) datasheet: T = G + H * (n / cal5 - 0.5) + J * F Where: *) G = 60, H = 200, cal5 = 4094, J = -0.1. *) F = frequency clock in MHz. *) n is the digital output. In code, the G, H and J coefficients are multiplied by a factor of 1000 to get the temperature in milli-Celsius. Final result is clamped in case it exceeds min/max thresholds. Change is done since it is unclear where the current equation and coefficients came from. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-16-farbere@amazon.com Signed-off-by: Guenter Roeck commit 430c0d7ff56b7e324eb36c490d513c0ef9c99860 Author: Eliav Farber Date: Thu Sep 8 15:24:42 2022 +0000 hwmon: (mr75203) add VM pre-scaler x2 support Add support for mr76006 pre-scaler which provides divide-by-2 scaling of the input voltage, so that it can be presented to the VM for measurement within its range (the VM input range is limited from -0.1V to 1V). The driver reads from the device-tree all the channels that use the mr76006 pre-scaler and multiplies the voltage result by a factor of 2, to represent to the user with the actual voltage input source. Channels that are not in the device-tree are multiplied by a factor of 1. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-15-farbere@amazon.com [groeck: Addressed conflicts against commit d59eacaac953] Signed-off-by: Guenter Roeck commit 64a2486c392506fc14db843bbc5998d567f22c6f Author: Eliav Farber Date: Thu Sep 8 15:24:41 2022 +0000 dt-bindings: hwmon: (mr75203) add "moortec,vm-pre-scaler-x2" property Add support for mr76006 pre-scaler which provides divide-by-2 scaling of the input voltage, so that it can be presented to the VM for measurement within its range (the VM input range is limited to -0.1V to 1V). The new "moortec,vm-pre-scaler-x2" property lists the channels that use the mr76006 pre-scaler. The driver will use this list to multiply the voltage result by 2, to present to the user with the actual voltage input source. Signed-off-by: Eliav Farber Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-14-farbere@amazon.com Signed-off-by: Guenter Roeck commit b7f5ac92fe18cd920b8d3f7e56a83ae16f7ecfbc Author: Eliav Farber Date: Thu Sep 8 15:24:40 2022 +0000 hwmon: (mr75203) add VM active channel support Add active channel support per voltage monitor. The number of active channels is read from the device-tree. When absent in device-tree, all channels are assumed to be used. This shall be useful to expose sysfs only for inputs that are connected to a voltage source. Setting number of active channels to 0, means that entire VM sensor is not used. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-13-farbere@amazon.com Signed-off-by: Guenter Roeck commit 09288b8fe1bd0d5336be4aa5d2eb3ba9ec76cca7 Author: Eliav Farber Date: Thu Sep 8 15:24:39 2022 +0000 dt-bindings: hwmon: (mr75203) add "moortec,vm-active-channels" property Add optional "moortec,vm-active-channels" property to define the number of active channels per VM. This shall be useful to avoid exposing sysfs for reading inputs that are not connected to any voltage source. Signed-off-by: Eliav Farber Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-12-farbere@amazon.com Signed-off-by: Guenter Roeck commit 0ecba6ae806921f57b445772a1400395d708a362 Author: Eliav Farber Date: Thu Sep 8 15:24:38 2022 +0000 dt-bindings: vendor-prefixes: add vendor prefix for Moortec Add device-tree vendor prefix for Moortec Semiconductor Ltd. Website: https://moortec.com/ Moortec were acquired by Synopsys so link above leads to: https://www.synopsys.com/solutions/silicon-lifecycle-management.html Signed-off-by: Eliav Farber Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-11-farbere@amazon.com Signed-off-by: Guenter Roeck commit 887b22ec07e56c680c7e5c4b6e2f47b7b28a48fc Author: Aleksandr Mezin Date: Sun Sep 18 17:55:06 2022 +0600 hwmon: (nzxt-smart2) add another USB ID No known differences from already supported devices. Signed-off-by: Aleksandr Mezin Link: https://lore.kernel.org/r/20220918115506.61870-1-mezin.alexander@gmail.com Signed-off-by: Guenter Roeck commit a31d53598c036480fe7df3220742b1bf480278a5 Author: Guenter Roeck Date: Wed Sep 14 03:20:56 2022 -0700 hwmon: (emc2305) Remove unnecessary range check Static analyzers report: drivers/hwmon/emc2305.c:194 emc2305_set_cur_state() warn: impossible condition '(val > 255) => (0-255 > 255)' 'val' is u8 and thus can never be larger than 255. In theory the operation calculating 'val' could result in a value larger than 255, but this won't happen because its parameter has already been range checked and it is guaranteed that the result never exceeds 255. Remove the unnecessary value check. Cc: Michael Shych Signed-off-by: Guenter Roeck commit 493372f5d3df9905087a2ce9f8b5a2dca5af889f Author: Eliav Farber Date: Thu Sep 8 15:24:37 2022 +0000 hwmon: (mr75203) skip reset-control deassert for SOCs that don't support it Don't fail the probe function and don't deassert the reset controller if a "reset" property doesn't exist in the device tree. Change is done for SOCs that don't support a reset controller. Signed-off-by: Eliav Farber Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908152449.35457-10-farbere@amazon.com Signed-off-by: Guenter Roeck commit 5b5e91652e0ac7a03faa6611019a4eb183ccb509 Author: Eliav Farber Date: Thu Sep 8 15:24:36 2022 +0000 dt-bindings: hwmon: (mr75203) change "resets" property to be optional Change "resets" property to be optional instead of required, for SOCs that don't support a reset controller. Signed-off-by: Eliav Farber Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-9-farbere@amazon.com Signed-off-by: Guenter Roeck commit a658b4d3894a4a836c607d4775edec73ea833288 Author: Eliav Farber Date: Thu Sep 8 15:24:35 2022 +0000 dt-bindings: hwmon: (mr75203) add description for Moortec's PVT controller This changes adds a detailed description for the mr75203 controller and for some of the analog IPs controlled by it. Signed-off-by: Eliav Farber Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220908152449.35457-8-farbere@amazon.com Signed-off-by: Guenter Roeck commit aed80bb91de89d1d484f659056d740047c54e065 Author: Aleksa Savic Date: Wed Sep 7 12:07:39 2022 +0200 hwmon: (aquacomputer_d5next) Add support for Aquacomputer High Flow Next Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer High Flow Next flow sensor, which communicates through a proprietary USB HID protocol. The High Flow Next exposes +5V voltages, water quality, conductivity and flow readings. A temperature sensor can be connected to it, in which case it provides its reading and an estimation of the dissipated/absorbed power in the liquid cooling loop. Additionally, serial number and firmware version are exposed through debugfs. Registry offsets were discovered and tested by users on Github [1] [2]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/8 [2] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/34 Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20220907100739.806571-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit 856361b397439157f7f60fd21efb522bb11f537a Author: Alexandru Gagniuc Date: Tue Sep 6 20:54:05 2022 -0500 hwmon: (tps23861) create unique debugfs directory per device On systems with more than one tps23861, creating the debugfs directory for additional devices fails with debugfs: Directory 'tps23861' with parent '/' already present! To resolve this, include the hwmon device name in the directory name. Since the name is unique, this guarantees that the debugfs directory is unique. Signed-off-by: Alexandru Gagniuc Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220907015405.16547-2-mr.nuke.me@gmail.com Signed-off-by: Guenter Roeck commit 0fed840c7562d9dcc5bf8a91744b079e952683d1 Author: Alexandru Gagniuc Date: Tue Sep 6 20:54:04 2022 -0500 hwmon: (tps23861) reduce count of i2c transactions for port_status When reading the 'port_status' debugfs entry, some I2C registers were read more than once. This looks inefficient in an I2C trace. To reduce I2C traffic, update tps23861_port_status_show() to only read each register once. Indexing the port number from 0 instead of 1 also allows simplifying things a bit. Signed-off-by: Alexandru Gagniuc Link: https://lore.kernel.org/r/20220907015405.16547-1-mr.nuke.me@gmail.com Signed-off-by: Guenter Roeck commit 4444a06981af66a49cf0cd08fec9759e8dd0a0fc Author: Jiapeng Chong Date: Thu Sep 1 10:23:32 2022 +0800 hwmon: (emc2305) Remove unused including ./drivers/hwmon/emc2305.c: 14 linux/version.h not needed. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2024 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220901022332.40248-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Guenter Roeck commit 005cc9b4f1118309301f5af6c6ee7e74a5b1f46c Author: Michael Shych Date: Wed Aug 10 20:15:52 2022 +0300 docs: hwmon: add emc2305.rst to docs Add description of emc2305 driver. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220810171552.56417-4-michaelsh@nvidia.com [groeck: Fixed htmldocs warnings] Signed-off-by: Guenter Roeck commit 0d8400c5a2ce1595f31b2f99e3139cf5bc5f35fd Author: Michael Shych Date: Wed Aug 10 20:15:51 2022 +0300 hwmon: (emc2305) add support for EMC2301/2/3/5 RPM-based PWM Fan Speed Controller. Add driver for Microchip EMC2301/2/3/5 RPM-based PWM Fan Speed Controller. Modify Makefile and Kconfig to support Microchip EMC2305 RPM-based PWM Fan Speed Controller. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220810171552.56417-3-michaelsh@nvidia.com [groeck: Drop unnecessary () around DIV_ROUND_CLOSEST()] Signed-off-by: Guenter Roeck commit 41929b72eb5dab26280dfc1e7c1523f0f4853dde Author: Michael Shych Date: Wed Aug 10 20:15:50 2022 +0300 platform_data/emc2305: define platform data for EMC2305 driver Introduce platform data structure for EM2305 driver to allow configuration device PWMs and thermal zones by passing required platform data to the driver. If no platform data is provided, the driver is supposed to work with default settings. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220810171552.56417-2-michaelsh@nvidia.com Signed-off-by: Guenter Roeck commit 5b38279e1a3f10c8046761b9732dccbfed78d614 Author: Justin Ledford Date: Mon Aug 29 19:59:30 2022 +0000 hwmon: (max31790) add fanN_enable The MAX31790 has a tach input enable bit in each fan's configuration register. This is only enabled by the driver if RPM mode is selected, but the driver doesn't provide a way to independently enable tachometer input regardless of the regulator mode. By adding the fanN_enable sysfs files, we can decouple the tach input from the regulator mode. Also update the documentation. Signed-off-by: Justin Ledford Link: https://lore.kernel.org/r/20220829195930.2521755-1-justinledford@google.com Signed-off-by: Guenter Roeck commit b5ae0ad56455dfb277b165b9270382f0e1c1d943 Author: Andy Shevchenko Date: Fri Aug 26 20:26:42 2022 +0300 pwm: core: Make of_pwm_get() static There are no users outside of PWM core of the of_pwm_get(). Make it static. Signed-off-by: Andy Shevchenko Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220826172642.16404-3-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck commit b88c48bfdd85820b19f0c0295a88d1596876e7c8 Author: Andy Shevchenko Date: Fri Aug 26 20:26:41 2022 +0300 pwm: core: Get rid of unused devm_of_pwm_get() The devm_of_pwm_get() has recently lost its single user, drop the dead API as well. Note, the new code should use either plain pwm_get() or managed devm_pwm_get() or devm_fwnode_pwm_get() APIs. Signed-off-by: Andy Shevchenko Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220826172642.16404-2-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck commit 2e2aa25cf5b0de2a2eb7da124c42184fc76d7afe Author: Andy Shevchenko Date: Fri Aug 26 20:26:40 2022 +0300 hwmon: (pwm-fan) Replace OF specific call to PWM by plain one There is no need to call OF specific devm_of_pwm_get() since the device node parameter duplicates in the device parameter. Hence we may safely replace it by plain devm_pwm_get() call. This allows to drop devm_of_pwm_get() as no more users will be. Signed-off-by: Andy Shevchenko Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220826172642.16404-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck commit 907f2e4f1731d2b97ba3aa9f0590379768ba71e8 Author: Christophe JAILLET Date: Wed Aug 24 12:25:13 2022 +0200 hwmon: (sparx5) Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 2419 1472 0 3891 f33 drivers/hwmon/sparx5-temp.o down to: 2155 1472 0 3627 e2b drivers/hwmon/sparx5-temp.o Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/cfe4c965074b5ecbe03830b05e038b4594c7b970.1661336689.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck commit 6ebab74e0973cb4c5bb60c8ce7c5d76943e180c5 Author: Armin Wolf Date: Mon Aug 22 19:40:53 2022 +0200 hwmon: (dell-smm) Improve warning messages When dell-smm-hwmon is loaded on a machine with a buggy BIOS with the option "force" being enabled, it wrongly prints that the buggy features where disabled. This may cause users to wrongly assume that the driver still protects them from these BIOS bugs even with "force" being enabled. Replace the messages with two messages each which are depending on the value of the "force" parameter. The messages which are being printed when "force" is not set use dev_notice() instead of dev_warn() since they only serve as a notice. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220822174053.8750-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit b7b568c2525b3a59a49eaf81ad4f283f0c25b5b6 Author: Andy Shevchenko Date: Fri Aug 26 20:37:00 2022 +0300 hwmon: (iio_hwmon) Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220826173700.17395-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck commit 9be5223afc7b0a88ba1d6352eab86ca18528efa3 Author: Juerg Haefliger Date: Fri Aug 19 05:51:09 2022 +0000 MAINTAINERS: Update Juerg Haefliger's email address Use my main @proton.me email address. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220819055039.840221-1-juergh@proton.me Signed-off-by: Guenter Roeck commit f2f394db4b5eb1d3e609c93ad85bb4d2d0490121 Author: Wolfram Sang Date: Thu Aug 18 23:00:11 2022 +0200 hwmon: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck commit eb12f54876bb5b7789339610692b70f7f9c925a5 Author: Wilken Gottwalt Date: Thu Aug 11 08:26:37 2022 +0000 hwmon: (corsair-psu) add reporting of rail mode via debugfs Add reporting if the PSU is running in single or multi rail mode via ocpmode debugfs entry. Also update the documentation and driver comments accordingly. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/YvS9PZKr0xqFqJny@monster.localdomain Signed-off-by: Guenter Roeck commit e2769f5e7f9f40b7c489e5183b86f89afce32528 Author: Aleksa Savic Date: Wed Aug 17 14:14:41 2022 +0200 hwmon: (aquacomputer_d5next) Add support for reading virtual temp sensors Add support for reading virtual temperature sensors for the D5 Next, Octo, Quadro and Farbwerk 360. Virtual temperature sensors are written to the device by the user, pulling from an arbitrary value source. Writing to them is not yet reverse engineered, so the only way to set them for now is to use the official software. Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20220817121441.112198-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit 1bce56b25a004b12b5d97b9b8452f451c8a76677 Author: Eugene Shalygin Date: Wed Jul 20 09:20:16 2022 +0200 hwmon: (asus_wmi_ec_sensors) remove driver This driver utilises a WMI interface found in AMD 500 series ASUS boards, to read EC registers. But it turned out that ASUS abandoned the interface, as it disappeared from Intel 600 series boards. Additionally, the WMI interface was incredibly slow. Therefore this driver was deprecated in favor of the asus_ec_sensors driver, which supports more boards, more sensors, and is faster. Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220720072016.102086-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 5e901cecc6fa1c555d22734c65bbcf11cc0c00cb Author: Robert Marko Date: Tue Aug 9 13:22:08 2022 +0200 dt-bindings: hwmon: sparx5: use correct clock SparX-5 temperature sensor uses system reference clock and not the AHB bus clock as indicated by the register information [1]. So, correct the clock description as well the included example. [1] https://microchip-ung.github.io/sparx-5_reginfo/reginfo_sparx-5.html?select=hsiowrap,temp_sensor,temp_sensor_cfg,clk_cycles_1us Fixes: f5520753c16f ("dt-bindings: hwmon: Add Sparx5 temperature sensor") Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809112209.241045-1-robert.marko@sartura.hr Signed-off-by: Guenter Roeck commit ed712d30a9d0b8a59d6ed001cc7711d7b9c5ce54 Author: Robert Foss Date: Mon Sep 19 12:20:09 2022 +0200 Revert "drm/bridge: chrontel-ch7033: Add byteswap order setting" Revert this patch since it depends on devicetree functionality that previously has been reverted in the below commit. commit e798ba3374a1 ("Revert "dt-bindings: Add byteswap order to chrontel ch7033"") This reverts commit ce9564cfc9aea65e68eb343c599317633bc2321a. Signed-off-by: Robert Foss Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220919102009.150503-3-robert.foss@linaro.org commit 7f62cf781e6567d59c8935dc8c6068ce2bb904b7 Author: Liang He Date: Fri Sep 16 23:47:08 2022 +0800 hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument. Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support") Signed-off-by: Liang He Co-developed-by: Mengda Chen Signed-off-by: Mengda Chen Link: https://lore.kernel.org/r/20220916154708.3084515-1-chenmengda2009@163.com Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck commit f47f537cbaa48427039f61256f68ce08986d8eb4 Author: Robert Foss Date: Mon Sep 19 12:20:08 2022 +0200 Revert "Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP"" This commit was accidentally reverted instead of another commit, and therefore needs to be reinstated. This reverts commit 8c9c40ec83445b188fb6b59e119bf5c2de81b02d. Fixes: 8c9c40ec8344 ("Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP"") Signed-off-by: Robert Foss Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220919102009.150503-2-robert.foss@linaro.org commit b7f3e9650f12d1e06b94a0257bcb90279f691bf5 Author: Aleksa Savic Date: Wed Sep 14 13:43:27 2022 +0200 hwmon: (aquacomputer_d5next) Fix Quadro fan speed offsets The offsets for setting speeds of fans connected to Quadro are off by one. Set them to their correct values. The offsets as shown point to registers for setting the fan control mode, which will be explored in future patches, but slipped in here. When setting fan speeds, the resulting values were overlapping, which made the fans still run in my initial testing. Fixes: cdbe34da01e3 ("hwmon: (aquacomputer_d5next) Add support for Aquacomputer Quadro fan controller") Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20220914114327.6941-1-savicaleksa83@gmail.com Cc: stable@vger.kenrel.org Signed-off-by: Guenter Roeck commit 94ec234a16cf3acdb319f05917b1efec9642222e Author: Sebastian Andrzej Siewior Date: Mon Sep 19 14:46:16 2022 +0200 bcma: gpio: Use generic_handle_irq_safe() On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force threaded and runs with interrupts enabled. The invocation of generic_handle_irq() with interrupts enabled triggers a lockdep warning due to a non-irq safe lock acquisition. Instead of disabling interrupts on the driver level, use generic_handle_domain_irq_safe(). [ tglx: Split out from combo patch ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de commit 118c3ba24d04f084eadd9d4a0ab7830f495e9106 Author: Sebastian Andrzej Siewior Date: Mon Sep 19 14:45:18 2022 +0200 gpio: mlxbf2: Use generic_handle_irq_safe() On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force threaded and runs with interrupts enabled. The invocation of generic_handle_irq() with interrupts enabled triggers a lockdep warning due to a non-irq safe lock acquisition. Instead of disabling interrupts on the driver level, use generic_handle_domain_irq_safe(). [ tglx: Split out from combo patch ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de commit c6a91405ac5cd5baa03fea061e11b05788223160 Author: Sebastian Andrzej Siewior Date: Mon Sep 19 14:44:28 2022 +0200 platform/x86: intel_int0002_vgpio: Use generic_handle_irq_safe() On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force threaded and runs with interrupts enabled. The invocation of generic_handle_irq() with interrupts enabled triggers a lockdep warning due to a non-irq safe lock acquisition. Instead of disabling interrupts on the driver level, use generic_handle_domain_irq_safe(). [ tglx: Split out from combo patch ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de commit f285de79569f9e674816a67308316206e4eb30ee Author: Sebastian Andrzej Siewior Date: Mon Sep 19 14:43:46 2022 +0200 ssb: gpio: Use generic_handle_irq_safe() On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force threaded and runs with interrupts enabled. The invocation of generic_handle_domain_irq() with interrupts enabled triggers a lockdep warning due to a non-irq safe lock acquisition. Instead of disabling interrupts on the driver level, use generic_handle_domain_irq_safe(). [ tglx: Split out from combo patch ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de commit f460c70125bcb1b753f152d9d0c9cee3ddbc2d91 Author: Sebastian Andrzej Siewior Date: Mon Sep 19 14:42:54 2022 +0200 pinctrl: amd: Use generic_handle_irq_safe() On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force threaded and runs with interrupts enabled. The invocation of generic_handle_domain_irq() with interrupts enabled triggers a lockdep warning due to a non-irq safe lock acquisition. Instead of disabling interrupts on the driver level, use generic_handle_domain_irq_safe(). [ tglx: Split out from combo patch ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de Link: https://bugzilla.kernel.org/show_bug.cgi?id=215954 commit 6a164c646999847b843e651f71c53dfaceb2c2b4 Author: Sebastian Andrzej Siewior Date: Mon May 9 16:04:08 2022 +0200 genirq: Provide generic_handle_domain_irq_safe(). commit 509853f9e1e7b ("genirq: Provide generic_handle_irq_safe()") addressed the problem of demultiplexing interrupt handlers which are force threaded on PREEMPT_RT enabled kernels which means that the demultiplexed handler is invoked with interrupts enabled which triggers a lockdep warning due to a non-irq safe lock acquisition. The same problem exists for the irq domain based interrupt handling via generic_handle_domain_irq() which has been reported against the AMD pin-ctrl driver. Provide generic_handle_domain_irq_safe() which can used from any context. [ tglx: Split the usage sites out and massaged changelog ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de Link: https://bugzilla.kernel.org/show_bug.cgi?id=215954 commit 0f6632e2e8beb6a1e0895c1309dd0b84b805c202 Author: Jiasheng Jiang Date: Wed Sep 14 15:13:34 2022 +0800 USB: serial: ftdi_sio: convert to use dev_groups The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Signed-off-by: Jiasheng Jiang [ johan: rebase on type rework, make groups static, clean up, amend commit message ] Signed-off-by: Johan Hovold commit 69ccee619a38f223308d5da43f0926ac9ca10182 Author: Manikanta Pubbisetty Date: Mon Sep 19 15:47:14 2022 +0300 wifi: ath11k: Add WoW support for WCN6750 Add support for WoW on WCN6750 chipset. Unlike other chips where WoW exit happens after sending WoW wakeup WMI command, exit from WoW suspend in the case of WCN6750 happens upon sending a WoW exit SMP2P (Shared memory point to point) message to the firmware. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220902112520.24804-3-quic_mpubbise@quicinc.com commit 957f60273af89b6311045bdf7aaee66da154549a Author: Manikanta Pubbisetty Date: Mon Sep 19 15:47:13 2022 +0300 dt: bindings: net: add bindings to add WoW support on WCN6750 Add required bindings to support WoW (Wake on Wireless) on WCN6750 which is based on ath11k driver. Signed-off-by: Manikanta Pubbisetty Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220902112520.24804-2-quic_mpubbise@quicinc.com commit c710765a4742337e40199403acde2fdd3189183d Author: Uwe Kleine-König Date: Mon Sep 19 14:22:13 2022 +0200 platform/x86: wmi: Drop forward declaration of static functions Usually it's not necessary to declare static functions if the symbols are in the right order. Moving the definition of acpi_wmi_driver down in the compilation unit allows to drop two such declarations. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220919122213.852322-1-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8755e675a88680e15cfcc447b8d2de41e7fe8071 Author: Yihao Han Date: Mon Sep 19 04:15:18 2022 -0700 platform/x86: toshiba_acpi: Remove duplicate include Remove duplicate include in toshiba_acpi.c. Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220919111519.19491-1-hanyihao@vivo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 2a2565272a3628e45d61625e36ef17af7af4e3de Author: Hans de Goede Date: Sat Sep 17 23:04:07 2022 +0200 platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading On a MSI S270 with Fedora 37 x86_64 / systemd-251.4 the module does not properly autoload. This is likely caused by issues with how systemd-udevd handles the single quote char (') which is part of the sys_vendor / chassis_vendor strings on this laptop. As a workaround remove the single quote char + everything behind it from the sys_vendor + chassis_vendor matches. This fixes the module not autoloading. Link: https://github.com/systemd/systemd/issues/24715 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220917210407.647432-1-hdegoede@redhat.com commit 91809918730f9596acc1ea4ce2e8419543653b87 Author: Luke D. Jones Date: Fri Sep 16 12:46:23 2022 +1200 platform/x86: asus-wmi: Expand support of GPU fan to read RPM and label The previously added patch to add support for pwm change for TUF laptops also is usuable for more than TUF. The same method `0x00110014` is used to read the fan RPM. Add two extra attributes for reading fan2 plus fan2 label. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220916004623.10992-1-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b7b6f86149a7e06269d61a7a5206360f5b642f80 Author: Baochen Qiang Date: Tue Sep 13 12:43:58 2022 +0800 wifi: ath11k: Include STA_KEEPALIVE_ARP_RESPONSE TLV header by default In current code STA_KEEPALIVE_ARP_RESPONSE TLV header is included only when ARP method is used, this causes firmware always to crash when wowlan is enabled because firmware needs it to be present no matter ARP method is used or not. Fix this issue by including STA_KEEPALIVE_ARP_RESPONSE TLV header by default. Also fix below typo: s/WMI_TAG_STA_KEEPALVE_ARP_RESPONSE/WMI_TAG_STA_KEEPALIVE_ARP_RESPONSE/ Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 0f84a156aa3b ("ath11k: Handle keepalive during WoWLAN suspend and resume") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913044358.2037-1-quic_bqiang@quicinc.com commit be327016a313084a4611c5e85a29b7d7bfec05da Author: Jilin Yuan Date: Thu Sep 15 11:04:28 2022 +0800 wifi: wcn36xx: fix repeated words in comments Delete the redundant word 'that'. Signed-off-by: Jilin Yuan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220915030428.38510-1-yuanjilin@cdjrlc.com commit e1a6b5d3a9719dc9d4d8b55fe85dace7c4ffcc32 Author: Bryan O'Donoghue Date: Thu Sep 15 01:41:17 2022 +0100 wifi: wcn36xx: Add RX frame SNR as a source of system entropy The signal-to-noise-ratio SNR is returned by the wcn36xx firmware for each received frame. SNR represents all of the unwanted interference signal after filtering out the fundamental frequency and harmonics of the frequency. Noise can come from various electromagnetic sources, from temperature affecting the performance hardware components or quantization effects converting from analog to digital domains. The SNR value returned by the WiFi firmware then is a good source of entropy. Other WiFi drivers offer up the noise component of the FFT as an entropy source for the random pool e.g. commit 2aa56cca3571 ("ath9k: Mix the received FFT bins to the random pool") I attended Jason's talk on sources of randomness at Plumbers and it occurred to me that SNR is a reasonable candidate to add. Cc: Jason A. Donenfeld Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220915004117.1562703-2-bryan.odonoghue@linaro.org commit 44b0c2957adc62b86fcd51adeaf8e993171bc319 Author: Thomas Gleixner Date: Thu Aug 25 18:41:31 2022 +0200 u64_stats: Streamline the implementation The u64 stats code handles 3 different cases: - 32bit UP - 32bit SMP - 64bit with an unreadable #ifdef maze, which was recently expanded with PREEMPT_RT conditionals. Reduce it to two cases (32bit and 64bit) and drop the optimization for 32bit UP as suggested by Linus. Use the new preempt_disable/enable_nested() helpers to get rid of the CONFIG_PREEMPT_RT conditionals. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220825164131.402717-9-bigeasy@linutronix.de commit 9458e0a78c45bc6537ce11eb9f03489eab92f9c2 Author: Sebastian Andrzej Siewior Date: Thu Aug 25 18:41:30 2022 +0200 flex_proportions: Disable preemption entering the write section. The seqcount fprop_global::sequence is not associated with a lock. The write section (fprop_new_period()) is invoked from a timer and since the softirq is preemptible on PREEMPT_RT it is possible to preempt the write section which is not desited. Disable preemption around the write section on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220825164131.402717-8-bigeasy@linutronix.de commit c7e0b3d088717d148707cd6fcb12f97c6fd961c1 Author: Thomas Gleixner Date: Thu Aug 25 18:41:29 2022 +0200 mm/compaction: Get rid of RT ifdeffery Move the RT dependency for the initial value of sysctl_compact_unevictable_allowed into Kconfig. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220825164131.402717-7-bigeasy@linutronix.de commit e575d401583273a7ac5dfb27520e41c821e81816 Author: Thomas Gleixner Date: Thu Aug 25 18:41:28 2022 +0200 mm/memcontrol: Replace the PREEMPT_RT conditionals Use VM_WARN_ON_IRQS_ENABLED() and preempt_disable/enable_nested() to replace the CONFIG_PREEMPT_RT #ifdeffery. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Reviewed-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Peter Zijlstra (Intel) Acked-by: Michal Hocko Link: https://lore.kernel.org/r/20220825164131.402717-6-bigeasy@linutronix.de commit a738e9bad6030d4fd33bfd7db3399a250b7e94d8 Author: Thomas Gleixner Date: Thu Aug 25 18:41:27 2022 +0200 mm/debug: Provide VM_WARN_ON_IRQS_ENABLED() Some places in the VM code expect interrupts disabled, which is a valid expectation on non-PREEMPT_RT kernels, but does not hold on RT kernels in some places because the RT spinlock substitution does not disable interrupts. To avoid sprinkling CONFIG_PREEMPT_RT conditionals into those places, provide VM_WARN_ON_IRQS_ENABLED() which is only enabled when VM_DEBUG=y and PREEMPT_RT=n. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Michal Hocko Link: https://lore.kernel.org/r/20220825164131.402717-5-bigeasy@linutronix.de commit 7a025e91abd23effe869a05d037b26770ffa0309 Author: Thomas Gleixner Date: Thu Aug 25 18:41:26 2022 +0200 mm/vmstat: Use preempt_[dis|en]able_nested() Replace the open coded CONFIG_PREEMPT_RT conditional preempt_enable/disable() pairs with the new helper functions which hide the underlying implementation details. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Michal Hocko Link: https://lore.kernel.org/r/20220825164131.402717-4-bigeasy@linutronix.de commit 93f6d4e1893657f07ba3c9e2bfa74b355a0b32f9 Author: Thomas Gleixner Date: Thu Aug 25 18:41:25 2022 +0200 dentry: Use preempt_[dis|en]able_nested() Replace the open coded CONFIG_PREEMPT_RT conditional preempt_disable/enable() with the new helper. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220825164131.402717-3-bigeasy@linutronix.de commit 555bb4ccd1dd78d0263eae31629fe1fdd65c1fb5 Author: Thomas Gleixner Date: Thu Aug 25 18:41:24 2022 +0200 preempt: Provide preempt_[dis|en]able_nested() On PREEMPT_RT enabled kernels, spinlocks and rwlocks are neither disabling preemption nor interrupts. Though there are a few places which depend on the implicit preemption/interrupt disable of those locks, e.g. seqcount write sections, per CPU statistics updates etc. To avoid sprinkling CONFIG_PREEMPT_RT conditionals all over the place, add preempt_disable_nested() and preempt_enable_nested() which should be descriptive enough. Add a lockdep assertion for the !PREEMPT_RT case to catch callers which do not have preemption disabled. Suggested-by: Linus Torvalds Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220825164131.402717-2-bigeasy@linutronix.de commit bb677d527e14184d89012ce332128f3767fa9925 Author: Ofir Bitton Date: Thu Sep 15 11:10:56 2022 +0300 habanalabs/gaudi2: allow user to flush PCIE by read In order for the user to flush PCIE he needs to read some register from PCIE block. The chosen register is SPECIAL_GLBL_SPARE_0 and hence needs to be unsecured. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 4f3ce5e0d0f85d6be0a2bc3a2aa75ba3b649c7c6 Author: Oded Gabbay Date: Mon Sep 19 11:30:03 2022 +0300 habanalabs: failure to open device due to reset is debug level If the user wants to open the device, and the device is currently in reset, the user will get an error from the open(). We don't need to display an error in the dmesg for that as it is not a real error and we can spam the kernel log with this message. Signed-off-by: Oded Gabbay commit 006fd8cb659bb02789dc1ec48836fff5f348ba8d Author: Li zeming Date: Mon Sep 19 10:20:54 2022 +0800 habanalabs/gaudi2: Remove unnecessary (void*) conversions The void pointer object can be directly assigned to different structure objects, it does not need to be cast. Signed-off-by: Li zeming Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0c88760f8f5e13e32f624a1da71144b240b05125 Author: Dani Liberman Date: Mon Aug 1 15:23:44 2022 +0300 habanalabs/gaudi2: add secured attestation info uapi User will provide a nonce via the ioctl, and will retrieve secured attestation data of the boot, generated using given nonce. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 43657dadfeffbec63b9ed358e6f82e9c64ff334c Author: Dani Liberman Date: Thu Sep 8 18:24:41 2022 +0300 habanalabs/gaudi2: add handling to pmmu events in eqe handler In order to get the error cause and the captured address in case of page fault, added pmmu events to eqe handler. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ff13b900b0b2b28486b714f615b1f919973275c2 Author: Tal Cohen Date: Wed Aug 17 12:46:07 2022 +0300 habanalabs/gaudi: change TPC Assert to use TPC DEC instead of QMAN err This change is done while there is a problem to use QMAN error for TPC assert async. The problem involves security limitation that exists to generate the assert via QMAN error. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 97a78e3d8e176de80323b7a01cd6b26f0b6dcdc1 Author: Dani Liberman Date: Wed Sep 7 16:15:39 2022 +0300 habanalabs: rename error info structure As a preparation for adding more errors to it, change to more suitable name. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 04d53cd2a6fb9936c938b624d99320cf2f842758 Author: farah kassabri Date: Mon Aug 29 16:56:28 2022 +0300 habanalabs/gaudi2: get f/w reset status register dynamically Get the firmware reset status address from the dynamic registers we read from the firmware instead of using a define. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f0b6d3cc29b709089f7a0de6a3d64a73ed0d67bd Author: Tomer Tayar Date: Tue Sep 6 16:37:14 2022 +0300 habanalabs/gaudi2: increase hard-reset sleep time to 2 sec The access to the device registers is blocked during hard reset, until preboot runs and allows the access to specific registers, including the PSOC BTM_FSM register which is used to know when the reset is done. Between the reset request and until this register is polled there is a small delay of 500 msec which is not enough for F/W to process the reset and for preboot to run, so the register might be accessed while it is blocked. To avoid it, increase the delay to 2 sec. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cecde184ca32ae862c5494a7875d03592c893ab9 Author: Tomer Tayar Date: Mon Sep 5 16:24:21 2022 +0300 habanalabs/gaudi2: print RAZWI info upon PCIe access error Add the dump of the RAZWI information when a PCIe access is blocked by RR. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 82736b063fde67ea2a9b16ef5acf3d5db03e2deb Author: Oded Gabbay Date: Mon Sep 5 17:14:45 2022 +0300 habanalabs: MMU invalidation h/w is per device The code used the mmu mutex to protect access to the context's page tables and invalidation of the MMU cache. Because pgt are per context, the mmu mutex was a member of the context object. The problem is that the device has a single MMU invalidation h/w (per MMU). Therefore, the mmu mutex should not be a property of the context but a property of the device. Signed-off-by: Oded Gabbay commit 6f0818c9fc9b81d8a303a8d3fb1826d71777f7ed Author: Tal Cohen Date: Thu Aug 18 12:54:23 2022 +0300 habanalabs: new notifier events for device state Add new notifier events that inform several device states. General H/W error raised on device general H/W error occurs. User engine error is raised when a device engine informs of an error. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0 Author: Oded Gabbay Date: Sun Sep 4 10:39:27 2022 +0300 habanalabs/gaudi2: free event irq if init fails In case initialization fails after event irq was requested, we need to release that irq. Signed-off-by: Oded Gabbay commit 76925f55c9ba46faaf4054a8192dc5814bc2e0ab Author: Ohad Sharabi Date: Thu Sep 1 16:37:08 2022 +0300 habanalabs: fix resetting the DRAM BAR Current code does not takes into account the new DRAM region base and so calculated address is wrong and can lead to crush. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0626fa1a4d311b55b5f20a90380915f1bc135607 Author: Ofir Bitton Date: Tue Aug 23 16:58:38 2022 +0300 habanalabs: add support for new cpucp return codes Firmware now responds with a more detailed cpucp return codes. Driver can now distinguish between error and debug return codes. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a0fc8688c003172455f99b6b7e185b167ed964a0 Author: Tomer Tayar Date: Thu Sep 1 14:12:56 2022 +0300 habanalabs/gaudi2: read F/W security indication after hard reset F/W security status might change after every reset. Add the reading of the preboot status to the hard reset sequence, which among others reads this security indication. As this preboot status reading includes the waiting for the preboot to be ready, it can be removed from the CPU init which is done in a later stage. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit aee3fd74fe579b6de5d8661dac559df91ab36b12 Author: Ofir Bitton Date: Tue Aug 30 15:07:51 2022 +0300 habanalabs/gaudi: rename mme cfg error response print Current description is misleading hence we rename it to a more suitable error description. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 62adba0a55a7dc522f179b8ff8e0b3b7250c440f Author: farah kassabri Date: Tue Aug 23 14:32:42 2022 +0300 habanalabs: fix possible hole in device va cb_map_mem() uses gen_pool_alloc() to get virtual address for mapping a CB. The mapping is done in chunks of page size, so if the CB size is larger, it is possible that the allocated virtual addresses won't be consecutive. User retrieves this device VA which returns the virtual address in the first va_block. If there is a "hole" in the virtual addresses, user can configure a HW block with a bad device VA. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f5ec364c9ecd1113492e15ceaafd4447f5836528 Author: Ofir Bitton Date: Sun Aug 28 12:46:27 2022 +0300 habanalabs: send device activity in a proper context 'Device activity open packet' should be sent outside of mutex as there is no real necessity for a lock. In addition 'device activity close packet' should be sent upon an actual release of the device. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 4745b2f0d0d4b291ec69619c815f53fd8a968d9a Author: farah kassabri Date: Wed Aug 17 17:43:43 2022 +0300 habanalabs: send device active message to f/w As part of the RAS that is done by the f/w, we should send a message to the f/w when a user either acquires or releases the device. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0855bf8b17374fef702844664af70454fa6951ef Author: Ofir Bitton Date: Sun Aug 21 13:50:51 2022 +0300 habanalabs/gaudi2: dump detailed information upon RAZWI In order to improve debuggability, we add all available information when a RAZWI event occur. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 096575db0b76defc357ac8db9404d2ddb92792a6 Merge: 7f1ea75d499a5 97ec890d07015 Author: Hans de Goede Date: Mon Sep 19 13:53:53 2022 +0200 Merge remote-tracking branch 'intel-sst/intel-sst' into review-hans commit 4ebf297b93403897668ee003427a9b780023c298 Author: Lad Prabhakar Date: Fri Sep 16 11:02:51 2022 +0100 arm64: dts: renesas: Adjust whitespace around '{' Drop extra space around the '{' sign. No functional changes (same DTB). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220916100251.20329-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 53072ba67e534ddd208697d3465004738f1d4d61 Author: Lad Prabhakar Date: Thu Sep 15 17:52:55 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Include SoM DTSI into board DTS Move including the rzg2ul-smarc-som.dtsi from the carrier board rzg2ul-smarc.dtsi to the actual RZ/G2UL SMARC EVK board dts r9a07g043u11-smarc.dts. Also move the SW_SW0_DEV_SEL and SW_ET0_EN_N macros to board dts as they are used by SoM and carrier board DTS/I. This is in preparation of re-using the SoM and carrier board DTSIs for RZ/Five SMARC EVK. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220915165256.352843-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1ca318459c026eaaf7984edcf6e79eaf0aaea185 Author: Lad Prabhakar Date: Wed Sep 14 14:42:11 2022 +0100 arm64: dts: renesas: rzg2ul-smarc-som: Drop enabling wdt2 WDT CH2 is specifically to check the operation of Cortex-M33 CPU so don't enable WDT2 by default. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220914134211.199631-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 422797652877f55e7dccb8362fdd2ce399489cdc Author: Geert Uytterhoeven Date: Wed Sep 14 16:21:54 2022 +0200 ARM: dts: renesas: Fix USB PHY device and child node names make dtbs_check: usb-phy@e6590100: '#phy-cells' is a required property From schema: dtschema/schemas/phy/phy-provider.yaml The R-Car Gen2 USB PHY device nodes do not represent USB PHYs theirselves, and thus do not have "#phy-cells" properties. Fix the warning by renaming them from "usb-phy" to "usb-phy-controller". Rename their child nodes from "usb-channel" to "usb-phy", as these do represent USB PHYs. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/6442b4042e26537abc8632c4772f8201685f1f1f.1663165098.git.geert+renesas@glider.be commit 167720e4bcc83bfc72c717abdfd5d5cd4dc80b61 Author: Geert Uytterhoeven Date: Wed Sep 14 16:15:14 2022 +0200 arm64: dts: renesas: r8a779a0: Update to R-Car Gen4 compatible values Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence update the compatible properties in various device nodes to include family-specific compatible values for R-Car Gen4 instead of R-Car Gen3: - CMT, - SDHI. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/f14fde21270bf8269a61a75fc6e50af2765f2a42.1663164707.git.geert+renesas@glider.be commit f4b7dffdc8bdaed2546491c50db6f98286f32738 Author: Kuninori Morimoto Date: Tue Sep 13 02:07:13 2022 +0000 arm64: dts: renesas: white-hawk-cpu: Add missing bootargs This patch adds missing bootargs for R-Car V4H White Hawk board. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87k06858oe.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 567934a8c3cc8a53bb1ebbbc28ffcedf88f0a864 Author: Kuninori Morimoto Date: Tue Sep 13 02:06:55 2022 +0000 arm64: dts: renesas: spider-cpu: Add missing bootargs This patch adds missing bootargs for R-Car S4 Spider board. One note is that current Spider board doesn't have Ethernet support yet, but this patch adds standard settings for it, too. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87leqo58ox.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 5c2b5a284960e2c90325131627413c67423f41ad Author: Geert Uytterhoeven Date: Wed Sep 14 17:01:29 2022 +0200 arm64: dts: renesas: spider: Move aliases and chosen The serial console and serial debug ports on Spider are located on the CPU board. Hence move the aliases and chosen nodes containing serial port configuration from the main Spider DTS file to the DTS file that describes the CPU board. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/c03500bb10eae10caeb3f4f97bc979eeee6cce75.1663167551.git.geert+renesas@glider.be commit 96f7071d2b757b58e67592ea8d81f226b085feed Author: Geert Uytterhoeven Date: Fri Sep 9 11:54:01 2022 +0200 arm64: dts: renesas: white-hawk-cpu: Add Ethernet support Describe the wiring of the first Ethernet AVB instance to the Micrel KSZ9031RNXVB PHY. Based on a larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/50a31bc8267ab4c90bff27ef3aca1169f8ebc7ae.1662715538.git.geert+renesas@glider.be commit 7bb9e424357b707ff5a58c99ae10f37a3cf5dbbd Author: Geert Uytterhoeven Date: Fri Sep 9 11:54:00 2022 +0200 arm64: dts: renesas: white-hawk: Move aliases and chosen The serial console port on White Hawk is located on the CPU board. Hence move the aliases and chosen nodes containing serial console configuration from the main White Hawk DTS file to the DTS file that describes the CPU board. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b03b74f4b5ee3c3e828e753beb334ec43162c132.1662715538.git.geert+renesas@glider.be commit 848c82db56923a8b0b0218da55e3478df4908186 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:59 2022 +0200 arm64: dts: renesas: r8a779g0: Add RAVB nodes Add device nodes for the Renesas Ethernet AVB (EtherAVB-IF) blocks on the Renesas R-Car V4H (R8A779G0) SoC. Based on a larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/980e7a62d8dc3a1e2387a2d93a6296625b105506.1662715538.git.geert+renesas@glider.be commit 6672f84001dc7c79253e0de891a2bd72e1ae1acc Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:58 2022 +0200 arm64: dts: renesas: white-hawk-cpu: Add push switches Describe the three Push Switches on the White Hawk CPU board, so they can be used for user input. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e18d0d5087a514db611295f5d1e13c950cf7dae7.1662715538.git.geert+renesas@glider.be commit 60dc0e87fb450da93bce6324e31f5326b04d4185 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:57 2022 +0200 arm64: dts: renesas: white-hawk-cpu: Add GP LEDs Describe the three General Purpose LEDs on the White Hawk CPU board, so they can be used as indicator LEDs. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/007acd941ef925057f1f9b925ed4e339dbd29a74.1662715538.git.geert+renesas@glider.be commit 120c7a58388f499b4d165c002fd645fbf501735c Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:56 2022 +0200 arm64: dts: renesas: r8a779g0: Add GPIO nodes Add device nodes for the General Purpose Input/Output (GPIO) blocks on the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/81176a5e12a5828cdcdd4b107d0b2e5970232c31.1662715538.git.geert+renesas@glider.be commit a72be048b71c10475d169d3951c49fb8a6a803e3 Author: Anjelique Melendez Date: Mon Sep 12 14:06:29 2022 -0700 dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings Update the Qualcomm Technologies, Inc. PMIC GPIO binding documentation to include compatible strings for PM7250B and PM8450 PMICs. Signed-off-by: Anjelique Melendez Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220912210624.4527-5-quic_amelende@quicinc.com Signed-off-by: Linus Walleij commit 3d46ff83df39a62a6b40b55479bfea23838add26 Author: Jishnu Prakash Date: Mon Sep 12 14:06:27 2022 -0700 pinctrl: qcom: spmi-gpio: Add compatible for PM7250B Add support for qcom,pm7250b-gpio variant. Signed-off-by: Jishnu Prakash Signed-off-by: David Collins Signed-off-by: Anjelique Melendez Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220912210624.4527-4-quic_amelende@quicinc.com Signed-off-by: Linus Walleij commit 723e8462a4fe7138bacac528dcdc7d4484c690fd Author: Anjelique Melendez Date: Mon Sep 12 14:06:25 2022 -0700 pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping The SPMI based PMICs have the HIGH and LOW GPIO output strength mappings interchanged, fix them. Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220912210624.4527-3-quic_amelende@quicinc.com Signed-off-by: Linus Walleij commit 4af95d0937144d6df1b4f262d311cf2e0ace569a Author: David Collins Date: Mon Sep 12 14:06:23 2022 -0700 pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes Add support for SPMI PMIC GPIO subtypes GPIO_LV_VIN2 and GPIO_MV_VIN3. GPIO_LV_VIN2 GPIOs support two input reference voltages: VIN0 and VIN1. These are typically connected to 1.8 V and 1.2 V supplies respectively. GPIO_MV_VIN3 GPIOs support three input reference voltages: VIN0, VIN1, and VIN2. These are typically connected to Vph, 1.8 V, and 1.2 V supplies respectively. Signed-off-by: David Collins Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220912210624.4527-2-quic_amelende@quicinc.com Signed-off-by: Linus Walleij commit 7f1ea75d499a5e3a6f593da0a87096f584752750 Author: Mario Limonciello Date: Wed Sep 14 09:18:50 2022 -0500 platform/x86/amd: pmc: Add sysfs files for SMU The CPU/APU SMU FW version and program is currently discoverable by turning on dynamic debugging or examining debugfs for the amdgpu driver. To make this more discoverable, create a dedicated sysfs file for it that userspace can parse without debugging enabled. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220914141850.259-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 00b1829294b7c88ecba92c661fbe6fe347b364d2 Author: Jorge Lopez Date: Mon Sep 12 14:26:03 2022 -0500 platform/x86: hp-wmi: Setting thermal profile fails with 0x06 Error 0x06 (invalid command parameter) is reported by hp-wmi module when reading the current thermal profile and then proceed to set it back. The failing condition occurs in Linux NixOS after user configures the thermal profile to ‘quiet mode’ in Windows. Quiet Fan Mode is supported in Windows but was not supported in hp-wmi module. This fix adds support for PLATFORM_PROFILE_QUIET in hp-wmi module for HP notebooks other than HP Omen series. Quiet thermal profile is not supported in HP Omen series notebooks. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220912192603.4001-1-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 4c3140f4cea66b06e4a982e0c2f7b7d113040b26 Author: Dan Carpenter Date: Thu Sep 15 17:13:34 2022 +0300 wifi: rtw89: uninitialized variable on error in rtw89_early_fw_feature_recognize() If request_partial_firmware_into_buf() fails then "firmware" is not initialized and the release_firmware(firmware) will crash. Fixes: deebea35d699 ("wifi: rtw89: early recognize FW feature to decide if chanctx") Signed-off-by: Dan Carpenter Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YyMzDtX/3fUBnonC@kili commit f2c6e7ca3ee6ebb0a9562f3c0f6d09f15eaed4ed Author: Hans de Goede Date: Thu Sep 8 19:36:18 2022 +0200 wifi: rt2x00: Fix "Error - Attempt to send packet over invalid queue 2" Even though ieee80211_hw.queues is set to 2, the ralink rt2x00 driver is seeing tx skbs submitted to it with the queue-id set to 2 / set to IEEE80211_AC_BE on a rt2500 card when associating with an access-point. This causes rt2x00queue_get_tx_queue() to return NULL and the following error to be logged: "ieee80211 phy0: rt2x00mac_tx: Error - Attempt to send packet over invalid queue 2", after which association with the AP fails. This patch works around this by mapping QID_AC_BE and QID_AC_BK to QID_AC_VI when there are only 2 tx_queues. Signed-off-by: Hans de Goede Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908173618.155291-2-hdegoede@redhat.com commit 67e16ac1fec475e64dcb8238f471c6fd154ef806 Author: Peng Fan Date: Tue Aug 30 11:31:37 2022 +0800 clk: imx93: add SAI IPG clk The clk topology is as below: bus_aon_root------>\ /--->SAI IPG -->SAI LPCG gate--> sai[x]_clk_root--->/ \--->SAI MCLK So use shared count as i.MX93 MU_B gate. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-9-peng.fan@oss.nxp.com commit 92d1496fe8644f6612b7adff7581a31002dc8dd0 Author: Peng Fan Date: Tue Aug 30 11:31:36 2022 +0800 clk: imx93: add MU1/2 clock The clk tree should be as: bus_aon_root------>\ /--->MU1_B IP -->MU_B gate--> bus_wakeup_root--->/ \--->MU2_B IP bus_aon_root------>\ /--->MU1_A IP -->MU_A gate--> bus_wakeup_root--->/ \--->MU2_A IP So need use shared count gate. And linux use MU_B, so set MU_A clk as CLK_IGNORE_UNUSED. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-8-peng.fan@oss.nxp.com commit d91012fa0058a7bb189c9f20f497ef825f348197 Author: Peng Fan Date: Tue Aug 30 11:31:35 2022 +0800 clk: imx93: switch to use new clk gate API Use i.MX93 specific clk gate API Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-7-peng.fan@oss.nxp.com commit 0836c8604a0bfaed2396d7e2aecb4146f8c07cca Author: Peng Fan Date: Tue Aug 30 11:31:34 2022 +0800 clk: imx: add i.MX93 clk gate i.MX93 LPCG is different from i.MX8M CCGR. Although imx_clk_hw_gate4_flags is used here, it not strictly match i.MX93. i.MX93 has such design: - LPCG_DIRECT use BIT0 as on/off gate when LPCG_AUTHEN CPU_LPM is 0 - LPCG_LPM_CUR use BIT[2:0] as on/off gate when LPCG_AUTHEN CPU_LPM is 1 The current implementation suppose CPU_LPM is 0, and use LPCG_DIRECT BIT[1:0] as on/off gate. Although BIT1 is touched, actually BIT1 is reserved. And imx_clk_hw_gate4_flags use mask 0x3 to determine whether the clk is enabled or not, but i.MX93 LPCG only use BIT0 to control when CPU_LPM is 0. So clk disabled unused during kernel boot not able to gate off the unused clocks. To match i.MX93 LPCG, introduce imx93_clk_gate. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-6-peng.fan@oss.nxp.com commit 2b66f02e2de174c2a9bdf60160a1d9963dc7ca2c Author: Peng Fan Date: Tue Aug 30 11:31:33 2022 +0800 clk: imx: clk-composite-93: check white_list The CCM ROOT AUTHEN register WHITE_LIST indicate: Each bit in this field represent for one domain. Bit16~Bit31 represent for DOMAIN0~DOMAIN15 respectively. Only corresponding bit of the domains is set to 1 can change the registers of this Clock Root. i.MX93 DID is 3, so if BIT(3 + WHITE_LIST_SHIFT) is 0, the clk should be set to read only. To make the imx93_clk_composite_flags be reusable, add a new parameter named did(domain id); Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-5-peng.fan@oss.nxp.com commit 4a3de5aa7743d1def6fba783c072e41df6b851c5 Author: Peng Fan Date: Tue Aug 30 11:31:32 2022 +0800 clk: imx: clk-composite-93: check slice busy i.MX93 CCM ROOT STAT register has a SLICE_BUSY bit: indication for clock generation logic is applying new setting. 0b - Clock generation logic is not busy. 1b - Clock generation logic is applying new setting. So when set parent/rate/gate, need check this bit. Introduce specific ops to do the work. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-4-peng.fan@oss.nxp.com commit 90e58072b9d89f85283e05131d650d196b3ecfef Author: Peng Fan Date: Tue Aug 30 11:31:30 2022 +0800 dt-bindings: clock: imx93-clock: add more MU/SAI clocks Add MU[1,2]_[A,B] clock entries. Add SAI IPG clock entries. Acked-by: Rob Herring Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220830033137.4149542-2-peng.fan@oss.nxp.com commit 59dc69d7c373e2e2c2c2d9ffe5edecfa6bb683d7 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:45 2022 +0200 dt-bindings: clock: imx8mm: don't use multiple blank lines Avoid the following checkpatch warning: include/dt-bindings/clock/imx8mm-clock.h:284: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220722215445.3548530-13-marcel@ziswiler.com commit 43aeb945eb0325c003e02ace3cd3676d4c81a368 Author: Po-Hao Huang Date: Fri Sep 16 11:38:11 2022 +0800 wifi: rtw89: 8852c: add multi-port ID to TX descriptor Update tx descriptor settings so broadcast packets on other ports can be issued properly when DTIM count is 0. Before this, all broadcast packets are sent via port 0 and won't be transmitted correctly. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-8-pkshih@realtek.com commit 812825c2b204c491f1a5586c602e4ac75060493a Author: Po-Hao Huang Date: Fri Sep 16 11:38:10 2022 +0800 wifi: rtw89: fix rx filter after scan In monitor mode we should be able to received all packets even if it's not destined to us. But after scan, the configuration was wrongly set, so we fix it. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-7-pkshih@realtek.com commit eae672f386049146058b9e5d3d33e9e4af9dca1d Author: Po-Hao Huang Date: Fri Sep 16 11:38:09 2022 +0800 wifi: rtw89: free unused skb to prevent memory leak This avoid potential memory leak under power saving mode. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-6-pkshih@realtek.com commit a63ae6736d92095d3ba9d8dabdda629b05797822 Author: Ping-Ke Shih Date: Fri Sep 16 11:38:08 2022 +0800 wifi: rtw89: reset halt registers before turn on wifi CPU Reset these registers to prevent firmware get false alarm after wifi CPU is running. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-5-pkshih@realtek.com commit 1b32e34536d5945e0b042332d1e766e8146b5309 Author: Ping-Ke Shih Date: Fri Sep 16 11:38:07 2022 +0800 wifi: rtw89: pci: update LTR settings Modify PCI LTR control flow and LTR idle latency to improve power save efficiency. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-4-pkshih@realtek.com commit c060dc51cc15c01e1af157b22bf39ed0831fb3a9 Author: Ping-Ke Shih Date: Fri Sep 16 11:38:06 2022 +0800 wifi: rtw89: mac: set NAV upper to 25ms NAV upper register is to limit the maximum NAV value to prevent unexpected NAV, but the old setting is too small to reflect NAV from AP transmiting big MPDU at once. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-3-pkshih@realtek.com commit a0d99ebb3ecd3cc39d1680e6edb4757013f535fd Author: Ping-Ke Shih Date: Fri Sep 16 11:38:05 2022 +0800 wifi: rtw89: initialize DMA of CMAC 8852C needs this to change CMAC dma to full mode to keep receiving packets after RX full event being resolved. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-2-pkshih@realtek.com commit 8a1f6c88462120ea472b9b7f09afa84104b43391 Author: Zong-Zhe Yang Date: Wed Sep 14 11:50:34 2022 +0800 wifi: rtw89: support SER L1 simulation SER (system error recovery) can deal with different crash types by different levels of processes. Previous FW crash simulation triggers a CPU exception which is one kind of SER L2 type. It can verify SER L2 flow which includes HW/FW restart. Now, we want to increase crash simulation types. A debug function is added to trigger control error in purpose for SER L1 simulation/verification. And, debugfs fw_crash is extended to accept different parameters. echo 1 > fw_crash: simulate CPU exception as before (keep 1 for compatibility with previous) It will be catched and handled by SER L2. (this requires HW/FW restart) echo 2 > fw_crash: simulate control error It will be catched and handled by SER L1. (driver and FW cooperate to recover this) Besides, in order to apply to the above two cases, rename RTW89_FLAG_RESTART_TRIGGER to RTW89_FLAG_CRASH_SIMULATING and adjust where SER flow clears this bit for both L1 and L2. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220914035034.14521-5-pkshih@realtek.com commit e77d3f8b1b9e3971a9577e0e1b3ca7da8655ca2f Author: Zong-Zhe Yang Date: Wed Sep 14 11:50:33 2022 +0800 wifi: rtw89: 8852c: support fw crash simulation With FW >= v0.27.40.0, 8852C FW has feature to handle crash simulation. Besides, use RTW89_WCPU_BASE_MASK to replace use of RTW89_WCPU_BASE_ADDR and work for both 8852A and 8852C. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220914035034.14521-4-pkshih@realtek.com commit 9a785583f00127b46d8cf4c312919a4a05b2c9b2 Author: Zong-Zhe Yang Date: Wed Sep 14 11:50:32 2022 +0800 wifi: rtw89: introudce functions to drop packets Introudce a H2C feature to drop packets according to given parameters. And, we implement instances to drop packets from BE, BK, VI, VO queues by vif or sta. Then, we refine our callback of ieee80211_ops::flush to deal with the case of drop=true via this feature. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220914035034.14521-3-pkshih@realtek.com commit 8b0f4b5d8bb0dcba9bb01947baed5f0700ff6584 Author: Ping-Ke Shih Date: Wed Sep 14 11:50:31 2022 +0800 wifi: rtw89: unify use of rtw89_h2c_tx() Seaprate calling of rtw89_h2c_tx() out of if-expression, and bypass the return value to upper caller. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220914035034.14521-2-pkshih@realtek.com commit 5280e4813a3d828ff20ed129238f3f11134fdb38 Author: Chin-Yen Lee Date: Mon Sep 12 15:17:06 2022 +0800 wifi: rtw89: pci: concentrate control function of TX DMA channel Different chips use different register and mask for tx dma channels, so concentrate them. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912071706.13619-4-pkshih@realtek.com commit 52f127054bf09a9df991b9150d3306188706965e Author: Chin-Yen Lee Date: Mon Sep 12 15:17:05 2022 +0800 wifi: rtw89: correct enable functions of HCI/PCI DMA Some PCI and MAC registers are changed for different chips and correct them accordingly. And HCI MAD functions belongs to MAC core, so move it to mac.h/.c. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912071706.13619-3-pkshih@realtek.com commit 6ff178792907198d7c800fe1cc447ba212a778df Author: Zong-Zhe Yang Date: Mon Sep 12 15:17:04 2022 +0800 wifi: rtw89: 8852c: L1 DMA reset has offloaded to FW For 8852C, rtw89_pci_lv1rst_stop_dma() and rtw89_pci_lv1rst_start_dma() are offloaded to FW L1 reset flow. So, driver no longer needs to do them. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912071706.13619-2-pkshih@realtek.com commit 3004a0a44559bf2008a29e8a033e79a868d4943a Author: Kuan-Chung Chen Date: Mon Sep 12 15:00:14 2022 +0800 wifi: rtw89: support for setting TID specific configuration Add ops set_tid_config to support TID specific configuration. We currently only support ampdu setting. The command example is: iw wlan0 set tidconf tids 0x3 ampdu off iw wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0x2 ampdu on Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912070014.10018-3-pkshih@realtek.com commit 0891b366cef4d3d229d5737928e8312838d8a792 Author: Kuan-Chung Chen Date: Mon Sep 12 15:00:13 2022 +0800 wifi: rtw89: support for setting HE GI and LTF Support setting HE GI and LTF values to the kernel via nl80211. We currently only support some GI and LTF values settings. The command example is: iw wlan0 set bitrates he-gi-2.4 0.8 he-ltf-2.4 2 Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912070014.10018-2-pkshih@realtek.com commit bc012b16c15f77f378ce362f7808c94156f2dcd9 Author: Ping-Ke Shih Date: Mon Sep 12 10:10:09 2022 +0800 wifi: rtw89: coex: show connecting state in debug message The variable cnt_connecting is to indicate if we are connecting to an AP. This is an important clue for coexistence to assign more time slot to WiFi side in this situation to ensure WiFi can establish connection. Without this patch, compiler warns: drivers/net/wireless/realtek/rtw89/coex.c:3244:25: warning: variable 'cnt_connecting' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220912021009.6011-1-pkshih@realtek.com commit 435f87d088e5b921018fb8b909ba01f298bb42b3 Author: Ching-Te Ku Date: Tue Sep 13 17:25:46 2022 +0800 wifi: rtw89: coex: Combine set grant WL/BT and correct the debug log To reduce register IO, combine set_gnt_wl/set_gnt_bt to set the same register one time. Because RTL8852C use different register to control antenna path, so make correction of path control related debug logs. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-8-pkshih@realtek.com commit c918f5f49fcd45250959f6eb71bd95cb1695951a Author: Ching-Te Ku Date: Tue Sep 13 17:25:45 2022 +0800 wifi: rtw89: coex: Remove trace_step at COEX-MECH control structure for RTL8852C RTL8852C don't need to send the data trace_step which used to tell firmware how many TDMA steps should record. Remove the member. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-7-pkshih@realtek.com commit eacc3f53bdc2e94cb4996955565d7bfc23b8af3d Author: Ching-Te Ku Date: Tue Sep 13 17:25:44 2022 +0800 wifi: rtw89: coex: Parsing Wi-Fi firmware TDMA info from reports Show TDMA information containing TDMA policy and time slot of Wi-Fi/BT in debug message to check things are in expected. The v1 format contains additional header, and remaining part is the same as original. So 8852CE selects v1 version, and then everything like original. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-6-pkshih@realtek.com commit 287657e77b218c33401445ff28d3f218b98ab5f3 Author: Ching-Te Ku Date: Tue Sep 13 17:25:43 2022 +0800 wifi: rtw89: coex: Parsing Wi-Fi firmware error message from reports Parsing firmware error message from original version and v1 reports to show up exception counter of commands from firmware in debug message. Then, we can make sure exchange commands are correct totally. In the later version Wi-Fi firmware(v1), the report format was changed. With this update, we can yield correct report from proper struct. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-5-pkshih@realtek.com commit 8468446a62779f101a1462ff761c9936ac4a4486 Author: Ching-Te Ku Date: Tue Sep 13 17:25:42 2022 +0800 wifi: rtw89: coex: Move coexistence firmware buffer size parameter to chip info Because RTL8852A/RTL8852C use different firmware buffer size to send C2H packet, it's necessary to use different size to parse C2H report. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-4-pkshih@realtek.com commit 1bb2d4f1551bf6bd211a80af793d3fc8ef924dd6 Author: Ching-Te Ku Date: Tue Sep 13 17:25:41 2022 +0800 wifi: rtw89: coex: Add v1 Wi-Fi firmware power-saving null data report The later version Wi-Fi firmware will report null data TX times, so the structure is different from before. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-3-pkshih@realtek.com commit 8d8fe46cd36b9052e84a94c46aa23b33ca979e30 Author: Ping-Ke Shih Date: Tue Sep 13 17:25:40 2022 +0800 wifi: rtw89: coex: use void pointer as temporal type to copy report With void pointer, we don't need to cast to 'u8 *' by one by. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220913092546.43722-2-pkshih@realtek.com commit 4302b3fba12aebc48bd3f659591dfdb50c9c5dbb Author: Hector Martin Date: Fri Sep 16 17:03:22 2022 +0100 arm64: dts: apple: Add WiFi module and antenna properties Add the new module-instance/antenna-sku properties required to select WiFi firmwares properly to all board device trees. Signed-off-by: Hector Martin Reviewed-by: Mark Kettenis Acked-by: Hector Martin Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDoI-0077b3-Dd@rmk-PC.armlinux.org.uk commit e8b80bf2fbd749301d80fd064066f301102425d2 Author: Hector Martin Date: Fri Sep 16 17:03:17 2022 +0100 wifi: brcmfmac: pcie: Add IDs/properties for BCM4378 This chip is present on Apple M1 (t8103) platforms: * atlantisb (apple,j274): Mac mini (M1, 2020) * honshu (apple,j293): MacBook Pro (13-inch, M1, 2020) * shikoku (apple,j313): MacBook Air (M1, 2020) * capri (apple,j456): iMac (24-inch, 4x USB-C, M1, 2020) * santorini (apple,j457): iMac (24-inch, 2x USB-C, M1, 2020) Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDoD-0077ax-AI@rmk-PC.armlinux.org.uk commit e01d7a546981c68ca00964f0c7e6411e9da0e137 Author: Hector Martin Date: Fri Sep 16 17:03:12 2022 +0100 wifi: brcmfmac: pcie: Support PCIe core revisions >= 64 These newer PCIe core revisions include new sets of registers that must be used instead of the legacy ones. Introduce a brcmf_pcie_reginfo to hold the specific register offsets and values to use for a given platform, and change all the register accesses to indirect through it. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDo8-0077aq-6I@rmk-PC.armlinux.org.uk commit f48476780ce33ffbbe4fb1fd9e07881c8cf69294 Author: Hector Martin Date: Fri Sep 16 17:03:07 2022 +0100 wifi: brcmfmac: msgbuf: Increase RX ring sizes to 1024 Newer chips used on Apple platforms have a max_rxbufpost greater than 512, which causes warnings when brcmf_msgbuf_rxbuf_data_fill tries to put more entries in the ring than will fit. Increase the ring sizes to 1024. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDo3-0077ak-2h@rmk-PC.armlinux.org.uk commit 687f767d6fab448e4e80011cf5230cd021135bfb Author: Hector Martin Date: Fri Sep 16 17:03:01 2022 +0100 wifi: brcmfmac: firmware: Allow platform to override macaddr On Device Tree platforms, it is customary to be able to set the MAC address via the Device Tree, as it is often stored in system firmware. This is particularly relevant for Apple ARM64 platforms, where this information comes from system configuration and passed through by the bootloader into the DT. Implement support for this by fetching the platform MAC address and adding or replacing the macaddr= property in nvram. This becomes the dongle's default MAC address. On platforms with an SROM MAC address, this overrides it. On platforms without one, such as Apple ARM64 devices, this is required for the firmware to boot (it will fail if it does not have a valid MAC at all). Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnx-0077ae-VK@rmk-PC.armlinux.org.uk commit 6bad3eeab6d3d051465d776da35ae37e1f72af34 Author: Hector Martin Date: Fri Sep 16 17:02:56 2022 +0100 wifi: brcmfmac: pcie: Perform firmware selection for Apple platforms On Apple platforms, firmware selection uses the following elements: Property Example Source ============== ======= ======================== * Chip name 4378 Device ID * Chip revision B1 OTP * Platform shikoku DT (ARM64) or ACPI (x86) * Module type RASP OTP * Module vendor m OTP * Module version 6.11 OTP * Antenna SKU X3 DT (ARM64) or ACPI (x86) In macOS, these firmwares are stored using filenames in this format under /usr/share/firmware/wifi: C-4378__s-B1/P-shikoku-X3_M-RASP_V-m__m-6.11.txt To prepare firmwares for Linux, we rename these to a scheme following the existing brcmfmac convention: brcmfmac-pcie.apple,--\ --.txt The NVRAM uses all the components, while the firmware and CLM blob only use the chip/revision/platform/antenna_sku: brcmfmac-pcie.apple,-.bin e.g. brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-m-6.11-X3.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-X3.bin In addition, since there are over 1000 files in total, many of which are symlinks or outright duplicates, we deduplicate and prune the firmware tree to reduce firmware filenames to fewer dimensions. For example, the shikoku platform (MacBook Air M1 2020) simplifies to just 4 files: brcm/brcmfmac4378b1-pcie.apple,shikoku.clm_blob brcm/brcmfmac4378b1-pcie.apple,shikoku.bin brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-m.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-u.txt This reduces the total file count to around 170, of which 75 are symlinks and 95 are regular files: 7 firmware blobs, 27 CLM blobs, and 61 NVRAM config files. We also slightly process NVRAM files to correct some formatting issues. To handle this, the driver must try the following path formats when looking for firmware files: brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-m-6.11-X3.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-m-6.11.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP-m.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-RASP.txt brcm/brcmfmac4378b1-pcie.apple,shikoku-X3.txt * brcm/brcmfmac4378b1-pcie.apple,shikoku.txt * Not relevant for NVRAM, only for firmware/CLM. The chip revision nominally comes from OTP on Apple platforms, but it can be mapped to the PCI revision number, so we ignore the OTP revision and continue to use the existing PCI revision mechanism to identify chip revisions, as the driver already does for other chips. Unfortunately, the mapping is not consistent between different chip types, so this has to be determined experimentally. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDns-0077aY-Qn@rmk-PC.armlinux.org.uk commit 7682de8b3351b824a9632b137f17f10951212b53 Author: Hector Martin Date: Fri Sep 16 17:02:51 2022 +0100 wifi: brcmfmac: of: Fetch Apple properties On Apple ARM64 platforms, firmware selection requires two properties that come from system firmware: the module-instance (aka "island", a codename representing a given hardware platform) and the antenna-sku. We map Apple's module codenames to board_types in the form "apple,". The mapped board_type is added to the DTS file in that form, while the antenna-sku is forwarded by our bootloader from the Apple Device Tree into the FDT. Grab them from the DT so firmware selection can use them. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnn-0077aS-NA@rmk-PC.armlinux.org.uk commit e63efbcaba7d6f6846b1c2ec5cf259249b9ed88f Author: Hector Martin Date: Fri Sep 16 17:02:46 2022 +0100 wifi: brcmfmac: pcie: Read Apple OTP information On Apple platforms, the One Time Programmable ROM in the Broadcom chips contains information about the specific board design (module, vendor, version) that is required to select the correct NVRAM file. Parse this OTP ROM and extract the required strings. Note that the user OTP offset/size is per-chip. This patch does not add any chips yet. Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDni-0077aM-I6@rmk-PC.armlinux.org.uk commit 7cb46e7214179db6d8de21c1b395a9d42efa735e Author: Hector Martin Date: Fri Sep 16 17:02:41 2022 +0100 wifi: brcmfmac: firmware: Support passing in multiple board_types Apple platforms have firmware and config files identified with multiple dimensions. We want to be able to find the most specific firmware available for any given platform, progressively trying more general firmwares. To do this, first add support for passing in multiple board_types, which will be tried in sequence. Since this will cause more log spam due to missing firmwares, also switch the secondary firmware fecthes to use the _nowarn variant, which will not log if the firmware is not found. Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnd-0077aG-Dk@rmk-PC.armlinux.org.uk commit a1b5a902243640fdf31bc715b88bbb118935de64 Author: Hector Martin Date: Fri Sep 16 17:02:36 2022 +0100 wifi: brcmfmac: pcie/sdio/usb: Get CLM blob via standard firmware mechanism Now that the firmware fetcher can handle per-board CLM files, load the CLM blob alongside the other firmware files and change the bus API to just return the existing blob, instead of fetching the filename. This enables per-board CLM blobs, which are required on Apple platforms. Acked-by: Linus Walleij Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnY-0077aA-8f@rmk-PC.armlinux.org.uk commit e263d722941148add195371998ae0f94d79f28af Author: Hector Martin Date: Fri Sep 16 17:02:31 2022 +0100 wifi: brcmfmac: firmware: Handle per-board clm_blob files Teach brcm_alt_fw_paths to correctly split off variable length extensions, and enable alt firmware lookups for the CLM blob firmware requests. Apple platforms have per-board CLM blob files. Acked-by: Linus Walleij Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnT-0077a4-4k@rmk-PC.armlinux.org.uk commit e2e37224e8b3a5194e4fc4797ef7309a78841673 Author: Hector Martin Date: Fri Sep 16 17:02:26 2022 +0100 dt-bindings: net: bcm4329-fmac: Add Apple properties & chips This binding is currently used for SDIO devices, but these chips are also used as PCIe devices on DT platforms and may be represented in the DT. Re-use the existing binding and add chip compatibles used by Apple T2 and M1 platforms (the T2 ones are not known to be used in DT platforms, but we might as well document them). Then, add properties required for firmware selection and calibration on M1 machines. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Mark Kettenis Reviewed-by: Rob Herring Reviewed-by: Alvin Šipraga Signed-off-by: Russell King (Oracle) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/E1oZDnO-0077Zy-18@rmk-PC.armlinux.org.uk commit bb0cca240a16dd9721c6ee1d55865465a3fb7211 Merge: b04b3315021a5 b18e4d4aebddd Author: Marc Zyngier Date: Mon Sep 19 10:59:29 2022 +0100 Merge branch kvm-arm64/single-step-async-exception into kvmarm-master/next * kvm-arm64/single-step-async-exception: : . : Single-step fixes from Reiji Watanabe: : : "This series fixes two bugs of single-step execution enabled by : userspace, and add a test case for KVM_GUESTDBG_SINGLESTEP to : the debug-exception test to verify the single-step behavior." : . KVM: arm64: selftests: Add a test case for KVM_GUESTDBG_SINGLESTEP KVM: arm64: selftests: Refactor debug-exceptions to make it amenable to new test cases KVM: arm64: Clear PSTATE.SS when the Software Step state was Active-pending KVM: arm64: Preserve PSTATE.SS for the guest while single-step is enabled Signed-off-by: Marc Zyngier commit b18e4d4aebdddd05810ceb2f73d7f72afcd11b41 Author: Reiji Watanabe Date: Fri Sep 16 18:06:00 2022 -0700 KVM: arm64: selftests: Add a test case for KVM_GUESTDBG_SINGLESTEP Add a test case for KVM_GUESTDBG_SINGLESTEP to the debug-exceptions test. The test enables single-step execution from userspace, and check if the exit to userspace occurs for each instruction that is stepped. Set the default number of the test iterations to a number of iterations sufficient to always reproduce the problem that the previous patch fixes on an Ampere Altra machine. Signed-off-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917010600.532642-5-reijiw@google.com commit ff00e737090e0f015059e59829aaa58565b16321 Author: Reiji Watanabe Date: Fri Sep 16 18:05:59 2022 -0700 KVM: arm64: selftests: Refactor debug-exceptions to make it amenable to new test cases Split up the current test into a helper, but leave the debug version checking in main(), to make it convenient to add a new debug exception test case in a subsequent patch. Signed-off-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917010600.532642-4-reijiw@google.com commit 370531d1e95be57c62fdf065fb04fd8db7ade8f9 Author: Reiji Watanabe Date: Fri Sep 16 18:05:58 2022 -0700 KVM: arm64: Clear PSTATE.SS when the Software Step state was Active-pending While userspace enables single-step, if the Software Step state at the last guest exit was "Active-pending", clear PSTATE.SS on guest entry to restore the state. Currently, KVM sets PSTATE.SS to 1 on every guest entry while userspace enables single-step for the vCPU (with KVM_GUESTDBG_SINGLESTEP). It means KVM always makes the vCPU's Software Step state "Active-not-pending" on the guest entry, which lets the VCPU perform single-step (then Software Step exception is taken). This could cause extra single-step (without returning to userspace) if the Software Step state at the last guest exit was "Active-pending" (i.e. the last exit was triggered by an asynchronous exception after the single-step is performed, but before the Software Step exception is taken. See "Figure D2-3 Software step state machine" and "D2.12.7 Behavior in the active-pending state" in ARM DDI 0487I.a for more info about this behavior). Fix this by clearing PSTATE.SS on guest entry if the Software Step state at the last exit was "Active-pending" so that KVM restore the state (and the exception is taken before further single-step is performed). Fixes: 337b99bf7edf ("KVM: arm64: guest debug, add support for single-step") Signed-off-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917010600.532642-3-reijiw@google.com commit 34fbdee086cfcc20fe889d2b83afddfbe2ac3096 Author: Reiji Watanabe Date: Fri Sep 16 18:05:57 2022 -0700 KVM: arm64: Preserve PSTATE.SS for the guest while single-step is enabled Preserve the PSTATE.SS value for the guest while userspace enables single-step (i.e. while KVM manipulates the PSTATE.SS) for the vCPU. Currently, while userspace enables single-step for the vCPU (with KVM_GUESTDBG_SINGLESTEP), KVM sets PSTATE.SS to 1 on every guest entry, not saving its original value. When userspace disables single-step, KVM doesn't restore the original value for the subsequent guest entry (use the current value instead). Exception return instructions copy PSTATE.SS from SPSR_ELx.SS only in certain cases when single-step is enabled (and set it to 0 in other cases). So, the value matters only when the guest enables single-step (and when the guest's Software step state isn't affected by single-step enabled by userspace, practically), though. Fix this by preserving the original PSTATE.SS value while userspace enables single-step, and restoring the value once it is disabled. This fix modifies the behavior of GET_ONE_REG/SET_ONE_REG for the PSTATE.SS while single-step is enabled by userspace. Presently, GET_ONE_REG/SET_ONE_REG gets/sets the current PSTATE.SS value, which KVM will override on the next guest entry (i.e. the value userspace gets/sets is not used for the next guest entry). With this patch, GET_ONE_REG/SET_ONE_REG will get/set the guest's preserved value, which KVM will preserve and try to restore after single-step is disabled. Fixes: 337b99bf7edf ("KVM: arm64: guest debug, add support for single-step") Signed-off-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917010600.532642-2-reijiw@google.com commit d416800776b530ad629b2959909062287339defd Author: Guixin Liu Date: Fri Jul 29 11:53:05 2022 +0800 nvmet: avoid unnecessary flush bio For no volatile write cache block device backend, sending flush bio is unnecessary, avoid to do that. Signed-off-by: Guixin Liu Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit e09523ad132d754f04474430e92835d24912cf29 Author: Yang Yingliang Date: Tue Sep 13 21:49:29 2022 +0800 drm/mediatek: dp: change mtk_dp_driver to static mtk_dp_driver is only used in mtk_dp.c now, change it to static. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: Yang Yingliang Reviewed-by: Dmitry Osipenko Acked-by: Chun-Kuang Hu Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220913134929.1970187-1-yangyingliang@huawei.com commit c46724cb8947697d4cfa5db44763d7c63b93a02b Author: Genjian Zhang Date: Tue Aug 23 10:14:41 2022 +0800 nvmet-auth: remove redundant parameters req The parameter is not used in this function, so remove it. Signed-off-by: Genjian Zhang Signed-off-by: Christoph Hellwig commit 42147981561c3344d2c6781fe7029e5900daa9fb Author: Jackie Liu Date: Fri Aug 12 11:12:30 2022 +0800 nvmet-auth: clean up with done_kfree Jump directly to done_kfree to release d, which is consistent with the code style behind. Reported-by: Genjian Zhang Signed-off-by: Jackie Liu Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 6e6fee569d4733f028f306036aaa12669c25b362 Author: Jackie Liu Date: Fri Aug 12 11:12:31 2022 +0800 nvme-auth: remove the redundant req->cqe->result.u16 assignment operation req->cqe->result.u16 has already been assigned in the previous line, no need to do it again. Signed-off-by: Jackie Liu Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit a8817cc09d8e6140c8561a81dded7b3f68e15a1b Author: Wolfram Sang Date: Thu Aug 18 23:00:52 2022 +0200 nvme: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Christoph Hellwig commit 1abc696174f1ba27c9563c722029373e1a692933 Author: Linjun Bao Date: Thu Aug 11 15:40:24 2022 +0800 nvme: add comment for unaligned "fake" nqn Current "fake" nqn field is "nqn.2014.08.org.nvmexpress:", it is not aligned with the canonical version for history reasons. Signed-off-by: Linjun Bao Signed-off-by: Christoph Hellwig commit 1637c315282e97efcb95cc7dfafbb15efa9fa27f Author: Bo-Chen Chen Date: Fri Sep 16 21:38:21 2022 +0800 drm/mediatek: dp: Fix compiler warning in mtk_dp_video_mute() Fix debug message formatting by using %s instead of 0x%x. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Reported-by: Chun-Kuang Hu Signed-off-by: Bo-Chen Chen Reviewed-by: Matthias Brugger Acked-by: Chun-Kuang Hu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220916133821.27980-4-rex-bc.chen@mediatek.com commit 514377d8a7da608ce618cdbeb5a2110a5a5178fc Author: Ard Biesheuvel Date: Fri May 6 11:37:50 2022 +0200 efi/libstub: move efi_system_table global var into separate object To avoid pulling in the wrong object when using the libstub static library to build the decompressor, define efi_system_table in a separate compilation unit. Signed-off-by: Ard Biesheuvel commit 4b93c6ea4e56c923e86bddffbc862c1bf3597cea Author: Arvid Norlander Date: Sun Sep 11 21:31:06 2022 +0200 platform/x86: toshiba_acpi: Set correct parent for input device. This solves the input device showing up as a virtual device. Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220911193106.555938-1-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 821ddae7e4c06f529040f93c22624c956db7431d Author: Bo-Chen Chen Date: Fri Sep 16 21:38:20 2022 +0800 drm/mediatek: dp: Remove unused register definitions Some definitions in mtk_dp_reg.h are not used, so remove these redundant codes. Signed-off-by: Bo-Chen Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Chun-Kuang Hu Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220916133821.27980-3-rex-bc.chen@mediatek.com commit 6e4c96884cdfa0e8bb53e977aa89cd1a830acb95 Author: Bo-Chen Chen Date: Fri Sep 16 21:38:19 2022 +0800 drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() In order to improve human readability, reduce the indentation by returning early if the dp/edp cable is not plugged in. Signed-off-by: Bo-Chen Chen Acked-by: Chun-Kuang Hu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220916133821.27980-2-rex-bc.chen@mediatek.com commit b04b3315021a524d5eecdb6de0d24cf7371d4abf Merge: c317c6d2d2c63 10453bf149c95 Author: Marc Zyngier Date: Mon Sep 19 09:45:00 2022 +0100 Merge remote-tracking branch 'arm64/for-next/sysreg' into kvmarm-master/next Merge arm64/for-next/sysreg in order to avoid upstream conflicts due to the never ending sysreg repainting... Signed-off-by: Marc Zyngier commit 15f9042311b0ab9c2904d50428f304a6229d6a02 Author: Geert Uytterhoeven Date: Mon Aug 29 12:00:39 2022 +0200 m68k: defconfig: Update defconfigs for v6.0-rc2 - Drop CONFIG_NF_CONNTRACK_PROCFS=n (no longer auto-enabled since commit aa5762c34213aba7 ("netfilter: conntrack: NF_CONNTRACK_PROCFS should no longer default to y")), - Enable modular build of the new HCTR2 and ARIA crypto algorithms, - Drop CONFIG_CRYPTO_BLAKE2S=m (removed in commit 2d16803c562ecc64 ("crypto blake2s - remove shash module")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/01a6abf7bc23a478d6a6c6801c6812ae96714620.1660559393.git.geert@linux-m68k.org Link: https://lore.kernel.org/r/1fbe623e5d69bdce0352445c06e1b2c9fb8d123e.1661767119.git.geert@linux-m68k.org commit d355a08e28691cc057f851a3cf9bf016bdfb3c39 Author: Greg Ungerer Date: Wed Aug 31 11:25:39 2022 +1000 m68k: Allow kexec on M68KCLASSIC with MMU enabled only None of the no-MMU CPU types (classic or ColdFire) or ColdFire with MMU enabled have support for kexec yet, so the configuration as it stands is not quite right, and it will fail to compile on them. Make CONFIG_KEXEC depend on both CONFIG_M68KCLASSIC and CONFIG_MMU. Signed-off-by: Greg Ungerer Link: https://lore.kernel.org/r/20220831012539.3416470-1-gerg@linux-m68k.org Signed-off-by: Geert Uytterhoeven commit c01b5a33bf0614e61e8074a51976134f62a64201 Author: Wolfram Sang Date: Thu Aug 18 22:59:41 2022 +0200 m68k: Move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818205941.6240-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 1c2eb18ef6739c89d13a9b36d19c68b84ab37625 Author: Lukas Bulwahn Date: Mon Sep 19 08:54:35 2022 +0200 pinctrl: nomadik: remove dead code after DB8540 pinctrl removal Commit b6d09f780761 ("pinctrl: nomadik: Drop U8540/9540 support") removes the DB8540 pin controller driver and its config PINCTRL_DB8540. There is some code left-over in the generic nomadik pinctrl driver, i.e., drivers/pinctrl/nomadik/pinctrl-nomadik.{ch}, that is still around for the removed DB8540 pin controller driver. Remove this remaining dead code. This issue was discovered with ./scripts/checkkconfigsymbols.py. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220919065435.27747-1-lukas.bulwahn@gmail.com Signed-off-by: Linus Walleij commit 42da71add478b5a6f82520181a4010a3823bced0 Author: Linus Walleij Date: Sat Sep 17 22:30:36 2022 +0200 pinctrl: nomadik: Make gpio irqchip immutable This makes the Nomadik GPIO irqchip immutable. Tested on the Samsung Galaxy SIII mini GT-I8190. Cc: Marc Zyngier Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917203036.167607-2-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit e5ec1f9da84324d01b7b8ec3a8bf50e8430b99a7 Author: Linus Walleij Date: Sat Sep 17 22:30:35 2022 +0200 pinctrl: nomadik: Dereference gpio_chip properly The irq data passed to irc_chip handlers i the struct gpio_chip and nothing else. We are just lucky that the nomadik chip pointer is first in the struct. Use the proper dereferencing and helpers. Reported-by: Marc Zyngier Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220917203036.167607-1-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit 8edd2752b0aa498b3a61f3caee8f79f7e0567fad Author: Jameson Thies Date: Tue Sep 13 20:49:54 2022 +0000 platform/chrome: cros_ec: Notify the PM of wake events during resume cros_ec_handle_event in the cros_ec driver can notify the PM of wake events. When a device is suspended, cros_ec_handle_event will not check MKBP events. Instead, received MKBP events are checked during resume by cros_ec_report_events_during_suspend. But cros_ec_report_events_during_suspend cannot notify the PM if received events are wake events, causing wake events to not be reported if received while the device is suspended. Update cros_ec_report_events_during_suspend to notify the PM of wake events during resume by calling pm_wakeup_event. Signed-off-by: Jameson Thies Reviewed-by: Prashant Malani Reviewed-by: Benson Leung Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220913204954.2931042-1-jthies@google.com commit 35bd799307b26798033a387cd3235114f894e205 Author: Samuel Holland Date: Sun Aug 14 23:12:39 2022 -0500 dt-bindings: sram: sunxi-sram: Add D1 compatible string D1 needs to export a register for managing some LDO regulators, so it needs a unique compatible. Signed-off-by: Samuel Holland Acked-by: Krzysztof Kozlowski Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220815041248.53268-3-samuel@sholland.org Signed-off-by: Jernej Skrabec commit 938070f585b3c480defefd035ed32d76a1c1451b Author: Samuel Holland Date: Sun Aug 14 23:12:38 2022 -0500 dt-bindings: sram: sunxi-sram: Clean up the compatible lists Use enumerations where appropriate to combine "const" choices and deduplicate fallback compatible strings. Suggested-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland Reviewed-by: Krzysztof Kozlowski Reviewed-by: Heiko Stuebner Reviewed-by: Andre Przywara Link: https://lore.kernel.org/r/20220815041248.53268-2-samuel@sholland.org Signed-off-by: Jernej Skrabec commit dc256418235a8355fbdf83b90048d8704b8d1654 Author: Zhiqiang Liu Date: Mon Sep 19 06:55:14 2022 +1000 xfs: do not need to check return value of xlog_kvmalloc() In xfs_attri_log_nameval_alloc(), xlog_kvmalloc() is called to alloc memory, which will always return successfully, so we donot need to check return value. Reviewed-by: Eric Sandeen Signed-off-by: Zhiqiang Liu Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 1f698cb11dd48ec5c430886f794953878e1ff016 Author: Samuel Holland Date: Sun Aug 14 23:12:47 2022 -0500 soc: sunxi: sram: Add support for the D1 system control D1 has a single EMAC and some LDOs that need to be exported. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220815041248.53268-11-samuel@sholland.org Signed-off-by: Jernej Skrabec commit dd2ae2ecb0b98c7b196fc44ad07010093b7cd3cc Author: Samuel Holland Date: Sun Aug 14 23:12:46 2022 -0500 soc: sunxi: sram: Export the LDO control register Some newer Allwinner SoCs contain internal LDOs managed by a register in the system control MMIO space. Export this from the regmap in addtion to the EMAC register. Use generic names now that the regmap is no longer EMAC-specific. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220815041248.53268-10-samuel@sholland.org Signed-off-by: Jernej Skrabec commit ee07b9056e3e7cac6d13e0177b6c8cd9ce8a9c5f Author: Samuel Holland Date: Sun Aug 14 23:12:45 2022 -0500 soc: sunxi: sram: Save a pointer to the OF match data It is inefficient to match the compatible string every time the regmap is accessed. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220815041248.53268-9-samuel@sholland.org Signed-off-by: Jernej Skrabec commit 42b7cc11023d0aa19dbf4d60bb3b8f7423d24a24 Author: Christian Brauner Date: Mon Sep 19 06:54:14 2022 +1000 xfs: port to vfs{g,u}id_t and associated helpers A while ago we introduced a dedicated vfs{g,u}id_t type in commit 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched over a good part of the VFS. Ultimately we will remove all legacy idmapped mount helpers that operate only on k{g,u}id_t in favor of the new type safe helpers that operate on vfs{g,u}id_t. Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 460d9cb62f7fe82cc835d6b3924a8d06fd2d510a Author: Samuel Holland Date: Sun Aug 14 23:12:44 2022 -0500 soc: sunxi: sram: Return void from the release function There is no point in returning an error here, as the caller can do nothing about it. In fact, all callers already ignore the return value. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220815041248.53268-8-samuel@sholland.org Signed-off-by: Jernej Skrabec commit b0463b9dd7030a766133ad2f1571f97f204d7bdf Author: Gaosheng Cui Date: Mon Sep 19 06:53:14 2022 +1000 xfs: remove xfs_setattr_time() declaration xfs_setattr_time() has been removed since commit e014f37db1a2 ("xfs: use setattr_copy to set vfs inode attributes"), so remove it. Signed-off-by: Gaosheng Cui Reviewed-by: Carlos Maiolino Signed-off-by: Dave Chinner commit abda5271f8ec6e9a84ae8129ddc59226c89def7a Author: ye xingchen Date: Mon Sep 19 06:52:14 2022 +1000 xfs: Remove the unneeded result variable Return the value xfs_dir_cilookup_result() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 8838dafed5d93b3e8a403e57838a43fb09dd6e61 Author: Zeng Heng Date: Mon Sep 19 06:51:14 2022 +1000 xfs: missing space in xfs trace log Add space between arguments would help someone to locate the key words they want, so break quoted strings at a space character. Such as below: [Before] kworker/1:0-280 [001] ..... 600.782135: xfs_bunmap: dev 7:0 ino 0x85 disize 0x0 fileoff 0x0 fsbcount 0x400000001fffffflags ATTRFORK ... [After] kworker/1:2-564 [001] ..... 23817.906160: xfs_bunmap: dev 7:0 ino 0x85 disize 0x0 fileoff 0x0 fsbcount 0x400000001fffff flags ATTRFORK ... Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit a0ebf8c46d64ba96b413784f88af0a4dca95b6bc Author: Zeng Heng Date: Mon Sep 19 06:50:14 2022 +1000 xfs: simplify if-else condition in xfs_reflink_trim_around_shared "else" is not generally useful after a return, so remove it for clean code. There is no logical changes. Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit de94a2e151bed6884b4f21aa518a100ac9e83af2 Author: Zeng Heng Date: Mon Sep 19 06:49:14 2022 +1000 xfs: simplify if-else condition in xfs_validate_new_dalign "else" is not generally useful after a return, so remove them which makes if condition a bit more clear. There is no logical changes. Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 92b40768c1a4e01e776cb13ab5357a8b5c78e965 Author: Zeng Heng Date: Mon Sep 19 06:48:14 2022 +1000 xfs: replace unnecessary seq_printf with seq_puts Replace seq_printf with seq_puts when const string in reference, which would avoid to deal with unnecessary string format. Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 78b0f58bdfef45aa9f3c7fbbd9b4d41abad6d85f Author: Zeng Heng Date: Mon Sep 19 06:47:14 2022 +1000 xfs: clean up "%Ld/%Lu" which doesn't meet C standard The "%Ld" specifier, which represents long long unsigned, doesn't meet C language standard, and even more, it makes people easily mistake with "%ld", which represent long unsigned. So replace "%Ld" with "lld". Do the same with "%Lu". Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 5617104003ae11a1ab383dbd63228b7645c26207 Author: Zeng Heng Date: Mon Sep 19 06:46:14 2022 +1000 xfs: remove redundant else for clean code "else" is not generally useful after a return, so remove it for clean code. There is no logical changes. Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 460281cf269b02f2caa88ade79c1e7eed29bfe15 Author: Zeng Heng Date: Mon Sep 19 06:45:14 2022 +1000 xfs: remove the redundant word in comment Just remove the redundant word "being" in comment. Signed-off-by: Zeng Heng Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit c989a62484ad75e0a06f2ffe67886e7cb6d41659 Author: Hans de Goede Date: Sat Sep 17 22:59:20 2022 +0200 drm/gma500: Call acpi_video_register_backlight() On machines without an Intel video opregion the acpi_video driver immediately probes the ACPI video bus and used to also immediately register acpi_video# backlight devices when supported. Once the drm/kms driver then loaded later and possibly registered a native backlight device then the drivers/acpi/video_detect.c code unregistered the acpi_video0 device to avoid there being 2 backlight devices (when acpi_video_get_backlight_type()==native). This means that userspace used to briefly see 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this the ACPI video code has been modified to make backlight class device registration a separate step, relying on the drm/kms driver to ask for the acpi_video backlight registration after it is done setting up its native backlight device. Add a call to the new acpi_video_register_backlight() function after setting up the gma500's native backlight, so that the acpi_video backlight device gets registered on systems where the gma500's native backlight device is not registered. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-6-hdegoede@redhat.com commit a7b98d4dfe68654641d56cdc7eace2c36be93a2d Author: Hans de Goede Date: Sat Sep 17 22:59:19 2022 +0200 drm/gma500: Don't register backlight when another backlight should be used Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-5-hdegoede@redhat.com commit fbf3093466d05461e3f307ffe6b1150daa4b065b Author: Hans de Goede Date: Sat Sep 17 22:59:18 2022 +0200 drm/gma500: Use backlight_get_brightness() to get the brightness Use backlight_get_brightness() instead of directly referencing bd->props.brightness. This will take backlight_is_blank() into account, properly setting brightness to 0 when screen-blanking has been requested through the backlight sysfs interface. Suggested-by: Sam Ravnborg Acked-by: Sam Ravnborg Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-4-hdegoede@redhat.com commit dec4ddbe1d4a4414092309611cc97e6b9dc7ec3f Author: Hans de Goede Date: Sat Sep 17 22:59:17 2022 +0200 drm/gma500: Change registered backlight device type to raw/native Change the type for the registered backlight class device from platform to raw/native. The poulsbo/cedarview/oaktrail backlight support is using native GPU backlight control and as such the type should be raw (aka native) as is done by all the other native GPU backlight driver code. Note this will not change much from userspace's point of view. poulsbo/cedarview laptops typically offer both an ACPI-video backlight interface as well as the native GPU backlight interface. The /sys/class/backlight/acpi_video0 has a type of firmware and userspace typically looks for firmware devices before looking for platform devices. The typical standard lookup order is: firmware -> platform -> raw This means that both before and after this change typical userspace backlight consumers (sich as e.g. GNOME) will prefer the firmware acpi_video0 backlight device. This has been tested on a Packard Bell Dot SC (Intel Atom N2600, cedarview) and a Sony Vaio vpc-x11s1e (Intel N540, poulsbo) laptop. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-3-hdegoede@redhat.com commit 1f90b1232773249d924868bec3c31525a69fd482 Author: Hans de Goede Date: Sat Sep 17 22:59:16 2022 +0200 drm/gma500: Refactor backlight support (v2) Refactor backlight support so that the gma_backlight_enable() / gma_backlight_disable() / gma_backlight_set() functions used by the Opregion handle will also work if no backlight_device gets registered. This is a preparation patch for not registering the gma500's own backlight device when acpi_video should be used, since registering 2 backlight devices for a single display really is undesirable. Since the acpi-video interface often uses the OpRegion we need to keep the OpRegion functional even when dev_priv->backlight_device is NULL. As a result of this refactor the actual backlight_device_register() call is moved to the shared backlight.c code and all #ifdefs related to CONFIG_BACKLIGHT_CLASS_DEVICE are now also limited to backlight.c . No functional changes intended. This has been tested on a Packard Bell Dot SC (Intel Atom N2600, cedarview) and a Sony Vaio vpc-x11s1e (Intel N540, poulsbo) laptop. Changes in v2: - Fix unused variable warnings when CONFIG_BACKLIGHT is not selected by marking the 2 variables as __maybe_unused. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-2-hdegoede@redhat.com commit d5e4eeea0c20b7467458cf3f3d887f59075db93e Author: Uwe Kleine-König Date: Sun Sep 18 01:20:13 2022 +0200 EDAC/ppc_4xx: Reorder symbols to get rid of a few forward declarations When moving the definition of ppc4xx_edac_driver further down, the forward declarations can just be dropped. Do this to reduce needless line repetition. Signed-off-by: Uwe Kleine-König Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220917232013.489931-1-u.kleine-koenig@pengutronix.de commit e8b595f7b058c7909e410f3e0736d95e8f909d01 Author: Dmitry Baryshkov Date: Mon Jul 4 19:11:47 2022 +0300 drm/msm/hdmi: make hdmi_phy_8996 OF clk provider On MSM8996 the HDMI PHY provides the PLL clock to the MMCC. As we are preparing to convert the MSM8996 to use DT clocks properties (rather than global clock names), register the OF clock provider. While we are at it, also change the driver to use clk_parent_data rather parent_names to setup a link to the XO clock. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/492318/ Link: https://lore.kernel.org/r/20220704161148.814510-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit e3ea01f4187461d0685b5b97915f86d6d6a0425c Author: Dmitry Baryshkov Date: Mon Jul 4 19:11:46 2022 +0300 dt-bindings: phy: qcom, hdmi-phy-qmp: add clock-cells and XO clock As the QMP HDMI PHY is a clock provider, add constant #clock-cells property. For the compatibility with older DTs the property is not marked as required. Also add the XO clock to the list of the clocks used by the driver. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Acked-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/492316/ Link: https://lore.kernel.org/r/20220704161148.814510-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 682493e401a2c5f7a5f6d851939f7c03536970ba Author: Nathan Chancellor Date: Mon Aug 29 09:54:50 2022 -0700 drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt() Clang warns: drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized] of_node_put(device_node); ^~~~~~~~~~~ drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning struct device_node *endpoint, *device_node; ^ = NULL 1 error generated. device_node's assignment was removed but not all of its uses. Remove the call to of_node_put() and the variable declaration to clean up the warning. Fixes: 36246dd50225 ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE") Link: https://github.com/ClangBuiltLinux/linux/issues/1700 Signed-off-by: Nathan Chancellor Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/500182/ Link: https://lore.kernel.org/r/20220829165450.217628-1-nathan@kernel.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 007ac0262b0dbb5523e99f03c6f3f44e09b15f66 Author: Dmitry Baryshkov Date: Tue Jul 12 16:22:58 2022 +0300 drm/msm/dsi: switch to DRM_PANEL_BRIDGE Currently the DSI driver has two separate paths: one if the next device in a chain is a bridge and another one if the panel is connected directly to the DSI host. Simplify the code path by using panel-bridge driver (already selected in Kconfig) and dropping support for handling the panel directly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/493608/ Link: https://lore.kernel.org/r/20220712132258.671263-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 549eae27743116da08a7846e09f1e910992af655 Author: Dmitry Baryshkov Date: Mon Jul 11 12:43:19 2022 +0300 drm/panel: drop DSC pps pointer Complete the move of DSC data pointer from struct drm_panel to struct mipi_dsi_device. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/493309/ Link: https://lore.kernel.org/r/20220711094320.368062-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 574922e617f305404ecb0f6d62da2dcd222102bc Author: Dmitry Baryshkov Date: Mon Jul 11 12:43:18 2022 +0300 drm/msm/dsi: fetch DSC pps payload from struct mipi_dsi_device Now that struct mipi_dsi_device provides DSC data, fetch it from the mentioned struct rather than from the struct drm_panel itself. This would allow supporting MIPI DSI bridges handling DSC on their input side. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/493307/ Link: https://lore.kernel.org/r/20220711094320.368062-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 02c830b3719280be4c43fe78f24fbf5db4192f91 Author: Dmitry Baryshkov Date: Mon Jul 11 12:43:17 2022 +0300 drm/mipi-dsi: pass DSC data through the struct mipi_dsi_device The commit 0f40ba48de3b ("drm/msm/dsi: Pass DSC params to drm_panel") added a pointer to the DSC data to the struct drm_panel. However DSC support is not limited to the DSI panels. MIPI DSI bridges can also consume DSC command streams. Thus add struct drm_dsc_config pointer to the struct mipi_dsi_device. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/493306/ Link: https://lore.kernel.org/r/20220711094320.368062-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b29200959e7b1806ef9299dd38a245c0dd533316 Author: ye xingchen Date: Fri Aug 26 07:28:21 2022 +0000 drm/msm/dsi: Remove the unneeded result variable Return the value msm_dsi_phy_enable() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/499621/ Link: https://lore.kernel.org/r/20220826072821.253150-1-ye.xingchen@zte.com.cn Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit ac229a22f2fef6e9fdde6f38d49ea3f58abdb07b Author: Dmitry Baryshkov Date: Mon Aug 22 20:44:17 2022 +0300 drm/msm/dsi: drop the hpd worker It makes no sense to have the HPD worker in the MSM DSI driver anymore. It is only queued from the dsi_host_attach/detach() callbacks, where it plays no useful role. Either way the panel or next bridge will be present and will report it's status directly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/498740/ Link: https://lore.kernel.org/r/20220822174417.292926-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit d175d6e0bb10e276cb074fb952cf859c37956567 Author: Douglas Anderson Date: Thu Aug 4 07:38:53 2022 -0700 drm/msm/dsi: Improve dsi_phy_driver_probe() probe error handling The dsi_phy_driver_probe() function has a "goto fail" for no reason. Change it to just always return directly when it sees an error. Make this simpler by leveraging dev_err_probe() which is designed to make code like this shorter / simpler. NOTE: as part of this, we now pass through error codes directly from msm_ioremap_size() rather than translating to -ENOMEM. This changed mostly because it's much more convenient when using dev_err_probe() and also it's usually encouraged not to hide error codes like the old code was doing unless there is a good reason. I can't see any reason why we'd need to return -ENOMEM instead of -EINVAL from the probe function. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496324/ Link: https://lore.kernel.org/r/20220804073608.v4.6.I969118a35934a0e5007fe4f80e3e28e9c0b7602a@changeid Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit d8810a66924482fc3977cebe3404629ad2647743 Author: Douglas Anderson Date: Thu Aug 4 07:38:52 2022 -0700 drm/msm/dsi: Take advantage of devm_regulator_bulk_get_const() As of the commit 1de452a0edda ("regulator: core: Allow drivers to define their init data as const") we no longer need to do copying of regulator bulk data from initdata to something dynamic. Let's take advantage of that. In addition to saving some code, this also moves us to using ARRAY_SIZE() to specify how many regulators we have which is less error prone. This gets rid of some layers of wrappers which makes it obvious that we can get rid of an extra error print. devm_regulator_bulk_get_const() prints errors for you so you don't need an extra layer of printing. In all cases here I have preserved the old settings without any investigation about whether the loads being set are sensible. In the cases of some of the PHYs if several PHYs in the same file used exactly the same settings I had them point to the same data structure. NOTE: Though I haven't done the math, this is likely an overall savings in terms of "static const" data. We previously always allocated space for 8 supplies. Each of these supplies took up 36 bytes of data (32 for name, 4 for an int). Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496325/ Link: https://lore.kernel.org/r/20220804073608.v4.5.I55a9e65cb1c22221316629e98768ff473f47a067@changeid Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 15cde7ea0778fe1f92fbb00be4564ec239d84d3c Author: Douglas Anderson Date: Thu Aug 4 07:38:51 2022 -0700 drm/msm/dsi: Use the new regulator bulk feature to specify the load As of commit 6eabfc018e8d ("regulator: core: Allow specifying an initial load w/ the bulk API") we can now specify the initial load in the bulk data rather than having to manually call regulator_set_load() on each regulator. Let's use it. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496319/ Link: https://lore.kernel.org/r/20220804073608.v4.4.I7b3c72949883846badb073cfeae985c55239da1d@changeid Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0587e9aa0493980dd39602ac78ee9b25406f06e7 Author: Douglas Anderson Date: Thu Aug 4 07:38:50 2022 -0700 drm/msm/dsi: Don't set a load before disabling a regulator As of commit 5451781dadf8 ("regulator: core: Only count load for enabled consumers"), a load isn't counted for a disabled regulator. That means all the code in the DSI driver to specify and set loads before disabling a regulator is not actually doing anything useful. Let's remove it. It should be noted that all of the loads set that were being specified were pointless noise anyway. The only use for this number is to pick between low power and high power modes of regulators. Regulators appear to do this changeover at loads on the order of 10000 uA. You would need a lot of clients of the same rail for that 100 uA number to count for anything. Note that now that we get rid of the setting of the load at disable time, we can just set the load once when we first get the regulator and then forget it. It should also be noted that the regulator functions regulator_bulk_enable() and regulator_set_load() already print error messages when they encounter problems so while moving things around we get rid of some extra error prints. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496320/ Link: https://lore.kernel.org/r/20220804073608.v4.3.If1f94fbbdb7c1d0fb3961de61483a851ad1971a7@changeid Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fa374ddba2997f4a0506612d9e18fea3c0d009b3 Author: Marijn Suijten Date: Thu Jun 30 00:53:31 2022 +0200 drm/msm/dsi_phy_7nm: Replace parent names with clk_hw pointers parent_hw pointers are easier to manage and cheaper to use than repeatedly formatting the parent name and subsequently leaving the clk framework to perform lookups based on that name. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491927/ Link: https://lore.kernel.org/r/20220629225331.357308-12-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 12fc7b1a758b3f7a640b225ce80545ff8cbb3e4b Author: Marijn Suijten Date: Thu Jun 30 00:53:30 2022 +0200 drm/msm/dsi_phy_10nm: Replace parent names with clk_hw pointers parent_hw pointers are easier to manage and cheaper to use than repeatedly formatting the parent name and subsequently leaving the clk framework to perform lookups based on that name. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491923/ Link: https://lore.kernel.org/r/20220629225331.357308-11-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 9fcb91201a23f8b8c861d9a29c8487dddddef234 Author: Marijn Suijten Date: Thu Jun 30 00:53:29 2022 +0200 drm/msm/dsi_phy_14nm: Replace parent names with clk_hw pointers parent_hw pointers are easier to manage and cheaper to use than repeatedly formatting the parent name and subsequently leaving the clk framework to perform lookups based on that name. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491921/ Link: https://lore.kernel.org/r/20220629225331.357308-10-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 09186dd9da124b09cfe6573cd808c91d2865f65c Author: Marijn Suijten Date: Thu Jun 30 00:53:28 2022 +0200 drm/msm/dsi_phy_28nm: Replace parent names with clk_hw pointers parent_hw pointers are easier to manage and cheaper to use than repeatedly formatting the parent name and subsequently leaving the clk framework to perform lookups based on that name. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491925/ Link: https://lore.kernel.org/r/20220629225331.357308-9-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 2db57ba10656b1eb97104da9fd48d9fd7a387d62 Author: Marijn Suijten Date: Thu Jun 30 00:53:27 2022 +0200 drm/msm/dsi_phy_28nm_8960: Replace parent names with clk_hw pointers parent_hw pointers are easier to manage and cheaper to use than repeatedly formatting the parent name and subsequently leaving the clk framework to perform lookups based on that name. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491929/ Link: https://lore.kernel.org/r/20220629225331.357308-8-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit e139dfa008365ec6255cd8ae56e1e5d7511f92f7 Author: Marijn Suijten Date: Thu Jun 30 00:53:26 2022 +0200 drm/msm/dsi/phy: Replace hardcoded char-array length with sizeof() Now that the last DSI PHY PLL driver (dsi_phy_28nm_8960) has been converted to use a simple stack-local char-array instead of a devm_kzalloc heap allocation we can safely call sizeof() on every string variable (that's now a sized array instead of a pointer) passed into snprintf instead of hardcoding the size. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491920/ Link: https://lore.kernel.org/r/20220629225331.357308-7-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 158ce9cb945b34c78ebd49dbb2c7401ca728c809 Author: Marijn Suijten Date: Thu Jun 30 00:53:25 2022 +0200 drm/msm/dsi_phy_28nm_8960: Use stack memory for temporary clock names The clock names formatted into the hw_clk's init structure are only used for the duration of the registration function where they are kstrdup'ed, making it unnecessary to keep the allocations alive for the duration of the device (through devm). Just like the other DSI PHY PLL clock trees, use a stack-local char array and save on memory outside of the pll_28nm_register function. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491917/ Link: https://lore.kernel.org/r/20220629225331.357308-6-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit dcfde8f6b16535124f48f3ee60cb9714401d7c5b Author: Marijn Suijten Date: Thu Jun 30 00:53:24 2022 +0200 drm/msm/dsi/phy: Reindent and reflow multiline function calls The commit 613cbd1da3c9 ("drm/msm/dsi: use devm_clk_*register to registe DSI PHY clocks") introduced the devm_ prefix to clk_hw registration calls, without updating the indentation of the arguments on the following lines. Similarly commit e55b3fbbbbc8 ("drm/msm/dsi: drop PLL accessor functions") moved from pll_write to dsi_phy_write without updating the indentation of followup arguments either. Preparing for a series that heavily touches the clk calls, reflow and reindent function calls that are adhering to an 80-char column limit by spanning multiple lines. Where function names are very long the arguments are indented with a fixed number of two tab characters instead of aligning with the opening parenthesis of the function call. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491931/ Link: https://lore.kernel.org/r/20220629225331.357308-5-marijn.suijten@somainline.org [DB: adjusted commit message to make checkpatch happy] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit aa0bff10af1c4b92e6b56e3e1b7f81c660d3ba78 Author: Kuogee Hsieh Date: Wed Aug 24 13:15:50 2022 -0700 drm/msm/dp: correct 1.62G link rate at dp_catalog_ctrl_config_msa() At current implementation there is an extra 0 at 1.62G link rate which cause no correct pixel_div selected for 1.62G link rate to calculate mvid and nvid. This patch delete the extra 0 to have mvid and nvid be calculated correctly. Changes in v2: -- fix Fixes tag's text Changes in v3: -- fix misspelling of "Reviewed-by" Fixes: 937f941ca06f ("drm/msm/dp: Use qmp phy for DP PLL and PHY") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/499328/ Link: https://lore.kernel.org/r/1661372150-3764-1-git-send-email-quic_khsieh@quicinc.com [DB: rewrapped commit message] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit e40261156829d66ec4644243bc31e1831733638f Author: Stephen Boyd Date: Tue Aug 23 14:23:02 2022 -0700 drm/msm/dp: Silence inconsistent indent warning Build robots complain smatch warnings: drivers/gpu/drm/msm/dp/dp_link.c:969 dp_link_process_link_status_update() warn: inconsistent indenting Fix it along with a trailing space from the same commit. Cc: Kuogee Hsieh Fixes: ea530388e64b ("drm/msm/dp: skip checking LINK_STATUS_UPDATED bit") Reported-by: kernel test robot Signed-off-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/498954/ Link: https://lore.kernel.org/r/20220823212302.1744145-1-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 122b17f32e35b9e7cae8feca258658d6ed5de4c3 Author: Dmitry Baryshkov Date: Mon Aug 22 21:49:00 2022 +0300 dt-bindings: msm/dp: handle DP vs eDP difference The #sound-dai-cells property should be used only for DP controllers. It doesn't make sense for eDP, there is no support for audio output. The aux-bus should not be used for DP controllers. Also p1 MMIO region should be used only for DP controllers. Take care of these differences. Reviewed-by: Rob Herring Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/498751/ Link: https://lore.kernel.org/r/20220822184900.307160-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 33468f4d64bcba854b554ea4628c618aa28b7335 Author: Dmitry Baryshkov Date: Mon Aug 22 21:48:59 2022 +0300 dt-bindings: msm/dp: add missing properties Document missing definitions for opp-table (DP controller OPPs), aux-bus (DP AUX BUS) and data-lanes (DP/eDP lanes mapping) properties. Reviewed-by: Stephen Boyd Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/498750/ Link: https://lore.kernel.org/r/20220822184900.307160-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fd713be04095dec8c13acd41c70e640571015bba Author: Dmitry Baryshkov Date: Mon Aug 22 21:48:58 2022 +0300 dt-bindings: msm/dp: mark vdda supplies as deprecated The commit 85936d4f3815 ("phy: qcom-qmp: add regulator_set_load to dp phy") moved setting regulator load to the DP PHY driver (QMP). Then, the commit 7516351bebc1 ("drm/msm/dp: delete vdda regulator related functions from eDP/DP controller") removed support for VDDA supplies from the DP controller driver. Mark these properties as deprecated and drop them from the example. Acked-by: Rob Herring Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/498748/ Link: https://lore.kernel.org/r/20220822184900.307160-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 62b060e06e2af9c00fe59445fdf78b3fc7525650 Author: Stephen Boyd Date: Wed Jun 22 17:25:40 2022 -0700 drm/msm/dp: Get rid of dp_ctrl_on_stream_phy_test_report() This API isn't really more than a couple lines now that we don't store the pixel_rate to the struct member. Inline it into the caller. Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/490775/ Link: https://lore.kernel.org/r/20220623002540.871994-4-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 64d6058233b7e4234fd543639f9d006740531a54 Author: Stephen Boyd Date: Wed Jun 22 17:25:39 2022 -0700 drm/msm/dp: Remove pixel_rate from struct dp_ctrl This struct member is stored to in the function that calls the function which uses it. That's possible with a function argument instead of storing to a struct member. Pass the pixel_rate as an argument instead to simplify the code. Note that dp_ctrl_link_maintenance() was storing the pixel_rate but never using it so we just remove the assignment from there. Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/490772/ Link: https://lore.kernel.org/r/20220623002540.871994-3-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit c24df3fa039fabfafe251cbdd446e0f0e88d2512 Author: Stephen Boyd Date: Wed Jun 22 17:25:38 2022 -0700 drm/msm/dp: Reorganize code to avoid forward declaration Let's move these functions around to avoid having to forward declare dp_ctrl_on_stream_phy_test_report(). Also remove dp_ctrl_reinitialize_mainlink() forward declaration because we're doing that sort of task. Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/490771/ Link: https://lore.kernel.org/r/20220623002540.871994-2-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 3cde792a5583fbb4592f21f9447669aa099d1103 Author: Dmitry Baryshkov Date: Wed Feb 9 20:25:03 2022 +0300 drm/msm/dpu: get rid of cached flush_mask Instead of querying the CTL for the flush mask (for SSPP, LM or DSPP), storing the mask in the mixer configuration and then pushing the mask to the CTL, tell CTL to cache the flush in place. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473159/ Link: https://lore.kernel.org/r/20220209172520.3719906-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 30da01af0d9a7f602925c1dac9414b630ae41f71 Author: Dmitry Baryshkov Date: Wed Feb 9 20:25:01 2022 +0300 drm/msm/dpu: inline dpu_plane_get_ctl_flush There is no need to keep a separate function for calling into the ctl if we already know all the details. Inline this function in the dpu_crtc.c Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473152/ Link: https://lore.kernel.org/r/20220209172520.3719906-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit e64ad2d224a805d0448c027fcfded00cb0a6f056 Author: Dmitry Baryshkov Date: Wed Feb 9 20:24:57 2022 +0300 drm/msm/dpu: do not limit the zpos property Stop limiting zpos property values, we use normalized_zpos anyway. And nothing stops userspace from assigning several planes to a single zpos (it is a userspace bug, but the kernel is forgiving about it). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473147/ Link: https://lore.kernel.org/r/20220209172520.3719906-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit aabf9220dfefdffb1f8d9126606f6a525405ba7b Author: Dmitry Baryshkov Date: Wed Feb 9 20:24:56 2022 +0300 drm/msm/dpu: rip out master planes support Master/virtual planes were used for multirect support. In preparation to reworking DPU planes, drop support for master planes (which was not used anyway). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473146/ Link: https://lore.kernel.org/r/20220209172520.3719906-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4bca876458caf7c105ab2ae9d80ff2cc9c60388d Author: Dmitry Baryshkov Date: Mon Aug 22 20:22:04 2022 +0300 drm/msm/dpu: drop unused variable from dpu_kms_mdp_snapshot() Follow up the merge of address fields and drop the variable that became unused after the commit 9403f9a42c88 ("drm/msm/dpu: merge base_off with blk_off in struct dpu_hw_blk_reg_map"). Fixes: 9403f9a42c88 ("drm/msm/dpu: merge base_off with blk_off in struct dpu_hw_blk_reg_map") Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/498736/ Link: https://lore.kernel.org/r/20220822172204.281045-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 89d529e393199502a951819a51454ddd64e62681 Author: Javier Martinez Canillas Date: Tue Aug 16 15:46:12 2022 +0200 drm/msm: Make .remove and .shutdown HW shutdown consistent Drivers' .remove and .shutdown callbacks are executed on different code paths. The former is called when a device is removed from the bus, while the latter is called at system shutdown time to quiesce the device. This means that some overlap exists between the two, because both have to take care of properly shutting down the hardware. But currently the logic used in these two callbacks isn't consistent in msm drivers, which could lead to kernel panic. For example, on .remove the component is deleted and its .unbind callback leads to the hardware being shutdown but only if the DRM device has been marked as registered. That check doesn't exist in the .shutdown logic and this can lead to the driver calling drm_atomic_helper_shutdown() for a DRM device that hasn't been properly initialized. A situation like this can happen if drivers for expected sub-devices fail to probe, since the .bind callback will never be executed. If that is the case, drm_atomic_helper_shutdown() will attempt to take mutexes that are only initialized if drm_mode_config_init() is called during a device bind. This bug was attempted to be fixed in commit 623f279c7781 ("drm/msm: fix shutdown hook in case GPU components failed to bind"), but unfortunately it still happens in some cases as the one mentioned above, i.e: systemd-shutdown[1]: Powering off. kvm: exiting hardware virtualization platform wifi-firmware.0: Removing from iommu group 12 platform video-firmware.0: Removing from iommu group 10 ------------[ cut here ]------------ WARNING: CPU: 6 PID: 1 at drivers/gpu/drm/drm_modeset_lock.c:317 drm_modeset_lock_all_ctx+0x3c4/0x3d0 ... Hardware name: Google CoachZ (rev3+) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_modeset_lock_all_ctx+0x3c4/0x3d0 lr : drm_modeset_lock_all_ctx+0x48/0x3d0 sp : ffff80000805bb80 x29: ffff80000805bb80 x28: ffff327c00128000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000001 x24: ffffc95d820ec030 x23: ffff327c00bbd090 x22: ffffc95d8215eca0 x21: ffff327c039c5800 x20: ffff327c039c5988 x19: ffff80000805bbe8 x18: 0000000000000034 x17: 000000040044ffff x16: ffffc95d80cac920 x15: 0000000000000000 x14: 0000000000000315 x13: 0000000000000315 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff80000805bc28 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff327c00128000 x1 : 0000000000000000 x0 : ffff327c039c59b0 Call trace: drm_modeset_lock_all_ctx+0x3c4/0x3d0 drm_atomic_helper_shutdown+0x70/0x134 msm_drv_shutdown+0x30/0x40 platform_shutdown+0x28/0x40 device_shutdown+0x148/0x350 kernel_power_off+0x38/0x80 __do_sys_reboot+0x288/0x2c0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x2c/0xc0 el0_svc+0x2c/0x84 el0t_64_sync_handler+0x11c/0x150 el0t_64_sync+0x18c/0x190 ---[ end trace 0000000000000000 ]--- Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=000000010eab1000 [0000000000000018] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP ... Hardware name: Google CoachZ (rev3+) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ww_mutex_lock+0x28/0x32c lr : drm_modeset_lock_all_ctx+0x1b0/0x3d0 sp : ffff80000805bb50 x29: ffff80000805bb50 x28: ffff327c00128000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000001 x24: 0000000000000018 x23: ffff80000805bc10 x22: ffff327c039c5ad8 x21: ffff327c039c5800 x20: ffff80000805bbe8 x19: 0000000000000018 x18: 0000000000000034 x17: 000000040044ffff x16: ffffc95d80cac920 x15: 0000000000000000 x14: 0000000000000315 x13: 0000000000000315 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff80000805bc28 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff327c00128000 x1 : 0000000000000000 x0 : 0000000000000018 Call trace: ww_mutex_lock+0x28/0x32c drm_modeset_lock_all_ctx+0x1b0/0x3d0 drm_atomic_helper_shutdown+0x70/0x134 msm_drv_shutdown+0x30/0x40 platform_shutdown+0x28/0x40 device_shutdown+0x148/0x350 kernel_power_off+0x38/0x80 __do_sys_reboot+0x288/0x2c0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x2c/0xc0 el0_svc+0x2c/0x84 el0t_64_sync_handler+0x11c/0x150 el0t_64_sync+0x18c/0x190 Code: aa0103f4 d503201f d2800001 aa0103e3 (c8e37c02) ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Kernel Offset: 0x495d77c00000 from 0xffff800008000000 PHYS_OFFSET: 0xffffcd8500000000 CPU features: 0x800,00c2a015,19801c82 Memory Limit: none ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--- Fixes: 9d5cbf5fe46e ("drm/msm: add shutdown support for display platform_driver") Signed-off-by: Javier Martinez Canillas Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/497842/ Link: https://lore.kernel.org/r/20220816134612.916527-1-javierm@redhat.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fa91ed0c555b0789c24dfa26c169d3f965db656e Author: Jason Wang Date: Mon Jul 25 04:42:42 2022 +0800 drm/msm/dpu: Fix comment typo The double `be' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497853/ Link: https://lore.kernel.org/r/20220724204242.4107-1-wangborong@cdjrlc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 1364a4ee9a99f10ebf490aa9be2bb2920989e886 Author: Dmitry Baryshkov Date: Mon Aug 22 20:24:55 2022 +0300 drm/msm/dpu: drop unused memory allocation Drop the dpu_cfg variable and corresponding kzalloc, which became unused after changing hw catalog to static configuration. Fixes: de7d480f5e8c ("drm/msm/dpu: make dpu hardware catalog static const") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/498738/ Link: https://lore.kernel.org/r/20220822172455.282923-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 606f015bdb8d0d172143f589320302d2d922f2f6 Author: Dmitry Baryshkov Date: Wed Jun 15 15:57:03 2022 +0300 drm/msm/dpu: drop VBIF indices We do not expect to have other VBIFs. Drop VBIF_n indices and always use VBIF_RT and VBIF_NRT. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/489571/ Link: https://lore.kernel.org/r/20220615125703.24647-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit bc778bb9841a6527d7fdd23062515e6d4a1b2874 Author: Dmitry Baryshkov Date: Wed Jun 15 15:57:02 2022 +0300 drm/msm/dpu: fix error handling around dpu_hw_vbif_init Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If the value is NULL, then the function will return 0 instead of a proper return code. Moreover dpu_hw_vbif_init() function can not return NULL. So, replace corresponding IS_ERR_OR_NULL() call with IS_ERR(). Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/489570/ Link: https://lore.kernel.org/r/20220615125703.24647-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 7538f80ae0d98bf51eb89eee5344aec219902d42 Author: Dmitry Baryshkov Date: Wed Jun 15 15:57:01 2022 +0300 drm/msm/dpu: index dpu_kms->hw_vbif using vbif_idx Remove loops over hw_vbif. Instead always VBIF's idx as an index in the array. This fixes an error in dpu_kms_hw_init(), where we fill dpu_kms->hw_vbif[i], but check for an error pointer at dpu_kms->hw_vbif[vbif_idx]. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/489569/ Link: https://lore.kernel.org/r/20220615125703.24647-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5ccdcecaf8f732f593e359ebfb65de96b11bae66 Author: Dmitry Baryshkov Date: Fri Aug 5 14:56:30 2022 +0300 drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices The commit 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") changed the MDP5 driver to look for the interconnect paths in the MDSS device rather than in the MDP5 device itself. This was left unnoticed since on my testing devices the interconnects probably didn't reach the sync state. Rather than just using the MDP5 device for ICC path lookups for the MDP5 devices, introduce an additional helper to check both MDP5/DPU and MDSS nodes. This will be helpful for the MDP5->DPU conversion, since the driver will have to check both nodes. Fixes: 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") Reported-by: Marijn Suijten Reported-by: Yassine Oudjana Signed-off-by: Dmitry Baryshkov Tested-by: Marijn Suijten # On sdm630 Tested-by: Yassine Oudjana # msm8996 Patchwork: https://patchwork.freedesktop.org/patch/496488/ Link: https://lore.kernel.org/r/20220805115630.506391-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit feda34d14adf295a6311ffe00e9b89104bcda61b Author: Krzysztof Kozlowski Date: Wed Aug 17 09:20:59 2022 +0300 dt-bindings: display/msm: dpu-sdm845: add missing DPU opp-table The 'display-controller' child (DPU) of Display SubSystem (MDSS) uses opp-table, so reference it which allows restricting DPU schema to fixed list of properties. Fixes: 3d7a0dd8f39b ("dt-bindings: msm: disp: add yaml schemas for DPU bindings") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/499212/ Link: https://lore.kernel.org/r/20220817062059.18640-6-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit c5a7f04c0257659e1df1d4a166cfcc17c70c7fdc Author: Krzysztof Kozlowski Date: Wed Aug 17 09:20:58 2022 +0300 dt-bindings: display/msm: dpu-sc7280: add missing DPU opp-table The 'display-controller' child (DPU) of Display SubSystem (MDSS) uses opp-table, so reference it which allows restricting DPU schema to fixed list of properties. Fixes: 57fd4f34ddac ("dt-bindings: msm: add DT bindings for sc7280") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497898/ Link: https://lore.kernel.org/r/20220817062059.18640-5-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 5621478dbc0a537a81d887cdbc86d4d12d51bd8f Author: Krzysztof Kozlowski Date: Wed Aug 17 09:20:57 2022 +0300 dt-bindings: display/msm: dpu-sc7180: add missing DPU opp-table The 'display-controller' child (DPU) of Display SubSystem (MDSS) uses opp-table, so reference it which allows restricting DPU schema to fixed list of properties. Fixes: 3d7a0dd8f39b ("dt-bindings: msm: disp: add yaml schemas for DPU bindings") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497894/ Link: https://lore.kernel.org/r/20220817062059.18640-4-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 1c1385b33217e24201778c7f454d640db1bb4e21 Author: Krzysztof Kozlowski Date: Wed Aug 17 09:20:56 2022 +0300 dt-bindings: display/msm: dpu-qcm2290: add missing DPU opp-table The 'display-controller' child (DPU) of Display SubSystem (MDSS) uses opp-table, so reference it which allows restricting DPU schema to fixed list of properties. Fixes: 164f69d9d45a ("dt-bindings: msm: disp: add yaml schemas for QCM2290 DPU bindings") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497893/ Link: https://lore.kernel.org/r/20220817062059.18640-3-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fc951a415e57dc7332099c2436bbc45067d2e679 Author: Krzysztof Kozlowski Date: Wed Aug 17 09:20:55 2022 +0300 dt-bindings: display/msm: dpu-msm8998: add missing DPU opp-table The 'display-controller' child (DPU) of Display SubSystem (MDSS) uses opp-table, so reference it which allows restricting DPU schema to fixed list of properties. Fixes: 6e986a8f1cf1 ("dt-bindings: display: msm: Add binding for msm8998 dpu") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497896/ Link: https://lore.kernel.org/r/20220817062059.18640-2-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4dd1be2f8fc2305f0821643324f3e06ddf08fde5 Author: Dmitry Baryshkov Date: Wed Jul 6 17:52:22 2022 +0300 dt-bindings: display/msm/mdp4: require 4 IOMMUs APQ8064, the only supported mdp4 platform, uses 4 IOMMUs for the MDP4 device. Update schema accordingly. When we have other MDP4 platforms, this spec can be updated accordingly. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Patchwork: https://patchwork.freedesktop.org/patch/492541/ Link: https://lore.kernel.org/r/20220706145222.1565238-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 47531e478514caea0940e641c22ce9f6dab3401f Author: Dmitry Baryshkov Date: Wed Jul 6 17:52:21 2022 +0300 dt-bindings: display/msm/gmu: account for different GMU variants Make display/msm/gmu.yaml describe all existing GMU variants rather than just the 630.2 (SDM845) version of it. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Patchwork: https://patchwork.freedesktop.org/patch/492539/ Link: https://lore.kernel.org/r/20220706145222.1565238-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit a5e96a572d59ce45da51a27310f8a376bc69a868 Author: Dmitry Baryshkov Date: Wed Jul 6 17:52:19 2022 +0300 dt-bindings: display/msm/gpu: allow specifying several IOMMU nodes Different platforms require different amounts of IOMMUs. The APQ8064 uses 64 IOMMU instances for GPU, adjust the schema accordingly. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Patchwork: https://patchwork.freedesktop.org/patch/492536/ Link: https://lore.kernel.org/r/20220706145222.1565238-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4b2b1b3674f80ed786e73d8e24c19e7129257ad8 Author: Dmitry Baryshkov Date: Mon Jul 11 13:04:32 2022 +0300 drm/msm/dsi: use drm_dsc_config instead of msm_display_dsc_config There is no need to use the struct msm_display_dsc_config wrapper inside the dsi driver, use the struct drm_dsc_config directly to pass pps data. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/493341/ Link: https://lore.kernel.org/r/20220711100432.455268-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 46dd0c0658ff5783acce37dcfe437e2a79a9934e Author: Dmitry Baryshkov Date: Mon Jul 11 13:04:31 2022 +0300 drm/msm/dpu: use drm_dsc_config instead of msm_display_dsc_config There is no need to use the struct msm_display_dsc_config wrapper inside the dpu driver, use the struct drm_dsc_config directly to pass pps data. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/493340/ Link: https://lore.kernel.org/r/20220711100432.455268-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 323894610ba027dddc86e8a5c6e7982588d845dd Author: Rob Clark Date: Sun Aug 7 09:09:01 2022 -0700 drm/msm/rd: Fix FIFO-full deadlock If the previous thing cat'ing $debugfs/rd left the FIFO full, then subsequent open could deadlock in rd_write() (because open is blocked, not giving a chance for read() to consume any data in the FIFO). Also it is generally a good idea to clear out old data from the FIFO. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496706/ Link: https://lore.kernel.org/r/20220807160901.2353471-2-robdclark@gmail.com Signed-off-by: Rob Clark commit e93e45b1aa4909926b5c2e195eadbed1899e9e50 Author: Bjorn Andersson Date: Fri Jul 8 09:26:32 2022 -0700 drm/msm/gpu: Drop qos request if devm_devfreq_add_device() fails In the event that devm_devfreq_add_device() fails the device's qos freq list is left referencing df->idle_freq and df->boost_freq. Attempting to initialize devfreq again after a probe deferral will then cause invalid memory accesses in dev_pm_qos_add_request(). Fix this by dropping the requests in the error path. Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") Signed-off-by: Bjorn Andersson Reviewed-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/493001/ Link: https://lore.kernel.org/r/20220708162632.3529864-1-bjorn.andersson@linaro.org Signed-off-by: Rob Clark commit 479d431519631f678151a1076cf31f00e145ce9c Author: Douglas Anderson Date: Thu Aug 4 07:38:49 2022 -0700 drm/msm/dsi: Fix number of regulators for SDM660 1 regulator is listed but the number 2 is specified. This presumably means we try to get a regulator with no name. Fix it. Fixes: 462f7017a691 ("drm/msm/dsi: Fix DSI and DSI PHY regulator config from SDM660") Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496323/ Link: https://lore.kernel.org/r/20220804073608.v4.2.I94b3c3e412b7c208061349f05659e126483171b1@changeid Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit b59c619aec0079621abb6e6a47607e947238909f Author: Douglas Anderson Date: Thu Aug 4 07:38:48 2022 -0700 drm/msm/dsi: Fix number of regulators for msm8996_dsi_cfg 3 regulators are listed but the number 2 is specified. Fix it. Fixes: 3a3ff88a0fc1 ("drm/msm/dsi: Add 8x96 info in dsi_cfg") Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/496318/ Link: https://lore.kernel.org/r/20220804073608.v4.1.I1056ee3f77f71287f333279efe4c85f88d403f65@changeid Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit 3487896b26269f5430596711490a7c48d2941d9d Author: Kuogee Hsieh Date: Thu Aug 11 15:57:50 2022 -0700 drm/msm/dp: delete DP_RECOVERED_CLOCK_OUT_EN to fix tps4 Data Symbols scrambled is required for tps4 at link training 2. Therefore SCRAMBLING_DISABLE bit should not be set for tps4 to work. RECOVERED_CLOCK_OUT_EN is for enable simple EYE test for jitter measurement with minimal equipment for embedded applications purpose and is not required to be set during normal operation. Current implementation always have RECOVERED_CLOCK_OUT_EN bit set which cause SCRAMBLING_DISABLE bit wrongly set at tps4 which prevent tps4 from working. This patch delete setting RECOVERED_CLOCK_OUT_EN to fix SCRAMBLING_DISABLE be wrongly set at tps4. Changes in v2: -- fix Fixes tag Changes in v3: -- revise commit text Changes in v4: -- fix commit text newline Changes in v5: -- fix commit text line over 75 chars Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Kuogee Hsieh Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/497194/ Link: https://lore.kernel.org/r/1660258670-4200-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit 9811913a6dd05c0bda3bf507006f1fef903a369e Author: Abhinav Kumar Date: Fri Jul 15 12:14:28 2022 -0700 drm/msm/dpu: populate wb or intf before reset_intf_cfg dpu_encoder_helper_phys_cleanup() was not populating neither wb or intf to the intf_cfg before calling the reset_intf_cfg(). This causes the reset of the active bits of wb/intf to be skipped which is incorrect. Fix this by populating the relevant wb or intf indices correctly. Fixes: ae4d721ce100 ("drm/msm/dpu: add an API to reset the encoder related hw blocks") Signed-off-by: Abhinav Kumar Reviewed-by: Jessica Zhang Tested-by: Jessica Zhang # Trogdor (SC8170) Patchwork: https://patchwork.freedesktop.org/patch/494298/ Link: https://lore.kernel.org/r/1657912468-17254-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Rob Clark commit 40395b5c112925d8bd08da9d355a2b35949e61c9 Author: sunliming Date: Tue Jul 19 09:56:22 2022 +0800 drm/msm/dsi: fix the inconsistent indenting Fix the inconsistent indenting in function msm_dsi_dphy_timing_calc_v3(). Fix the following smatch warnings: drivers/gpu/drm/msm/dsi/phy/dsi_phy.c:350 msm_dsi_dphy_timing_calc_v3() warn: inconsistent indenting Fixes: f1fa7ff44056 ("drm/msm/dsi: implement auto PHY timing calculator for 10nm PHY") Reported-by: kernel test robot Signed-off-by: sunliming Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/494662/ Link: https://lore.kernel.org/r/20220719015622.646718-1-sunliming@kylinos.cn Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit c51720a6d0b402ed418c904500f78ce1897a93bc Author: Kuogee Hsieh Date: Wed Jul 6 12:32:08 2022 -0700 drm/msm/dp: make eDP panel as the first connected connector Some userspace presumes that the first connected connector is the main display, where it's supposed to display e.g. the login screen. For laptops, this should be the main panel. This patch call drm_helper_move_panel_connectors_to_head() after drm_bridge_connector_init() to make sure eDP stay at head of connected connector list. This fixes unexpected corruption happen at eDP panel if eDP is not placed at head of connected connector list. Changes in v2: -- move drm_helper_move_panel_connectors_to_head() to dpu_kms_drm_obj_init() Changes in v4: -- move drm_helper_move_panel_connectors_to_head() to msm_drm_init() Signed-off-by: Kuogee Hsieh Reviewed-by: Abhinav Kumar Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Fixes: ef7837ff091c ("drm/msm/dp: Add DP controllers for sc7280") Patchwork: https://patchwork.freedesktop.org/patch/492581/ Link: https://lore.kernel.org/r/1657135928-31195-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit 9c1277a25fe538595ddc27d214f2cd64c306fdf5 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:55 2022 +0200 arm64: dts: renesas: white-hawk: Add Ethernet sub-board Add a DTS file for the R-Car V4H White Hawk RAVB/Ethernet(1000Base-T1) sub-board (RTP8A779G0ASKB0SE0SA000), and include it from the main r8a779g0-white-hawk.dts. For now its contents are limited to the Board ID EEPROM. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/991600919513dd05a9a7d9c170c6924baf14d1a2.1662715538.git.geert+renesas@glider.be commit 78c84f468084e844e03ffb13da09ce7decd1659c Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:54 2022 +0200 arm64: dts: renesas: white-hawk: Add CSI/DSI sub-board Add a DTS file for the R-Car V4H White Hawk CSI/DSI sub-board (RTP8A779G0ASKB0SC0SA000), and include it from the main r8a779g0-white-hawk.dts. For now its contents are limited to the Board ID EEPROM. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/265f7782743c539c57906e8207785f8b0d80d5d0.1662715538.git.geert+renesas@glider.be commit 77643815b019d3e78b2ca028d701f95df58e7cf3 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:53 2022 +0200 arm64: dts: renesas: white-hawk: Add I2C0 and EEPROMs Enable the I2C0 bus on the White Hawk CPU board, and describe the I2C EEPROMs present on the White Hawk CPU and BreakOut boards. Based on a larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d01cada6f2d3e44dd6cb26cfa8e4ce6382f1fbff.1662715538.git.geert+renesas@glider.be commit ff77ba0514855c106f8683b56a9a79b7464509c3 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:52 2022 +0200 arm64: dts: renesas: r8a779g0: Add I2C nodes Add device nodes for the I2C Bus Interfaces on the Renesas R-Car V4H (R8A779G0) SoC. Extracted from a larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/272fd18fed2d7addfbdb7945ae2134988a7c3a7e.1662715538.git.geert+renesas@glider.be commit 7a8d590de81328537dc43ceebe4ad29cde3dc08b Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:51 2022 +0200 arm64: dts: renesas: white-hawk-cpu: Add serial port pin control Complete the description of the serial console and the external serial clock by adding pin control. Based on larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/74c862ef6e46b4af398d9b371ff38fae17b3db05.1662715538.git.geert+renesas@glider.be commit 4cebce2577239fc02fd396327b01db97b2f6e257 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:50 2022 +0200 arm64: dts: renesas: r8a779g0: Add pinctrl device node Add a device node for the Pin Function Controller on the Renesas R-Car V4H (R8A779G0) SoC. Based on a larger patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ecddcadd2fad46b1cf4c9be3ec750f360b9730e4.1662715538.git.geert+renesas@glider.be commit 495e36c3a3134b0f3b89f64cd90d3ed722ac0586 Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:49 2022 +0200 arm64: dts: renesas: white-hawk-cpu: Enable watchdog timer Enable the watchdog timer on the White Hawk CPU board. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/77a0e29d965032115de1f07ceecb2d5d07db74eb.1662715538.git.geert+renesas@glider.be commit a43306faeea860a6e36b1f0e23881ab4bb75943e Author: Geert Uytterhoeven Date: Fri Sep 9 11:53:48 2022 +0200 arm64: dts: renesas: r8a779g0: Add RWDT node Add a device node for the RCLK Watchdog Timer (RWDT) on the Renesas R-Car V4H (R8A779G0) SoC. Based on a patch in the BSP by Thanh Quan. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/187904c279be6654ea3deb11b7250b64dd18c3b5.1662715538.git.geert+renesas@glider.be commit c2ce1e734282662c0b3117e4f26b831d30370bcb Author: Lad Prabhakar Date: Fri Sep 16 00:38:52 2022 +0100 ARM: shmobile: Drop selecting SOC_BUS Don't automatically select the SOC_BUS config option as we already have automatically selected it as part of the SOC_RENESAS config option [0] as renesas-soc.c [1] uses the APIs provided by SOC_BUS config option. [0] drivers/soc/renesas/Kconfig [1] drivers/soc/renesas/renesas-soc.c Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220915233852.415407-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit bb81684d2d99234ff7a5807554315fb89a933959 Author: Lad Prabhakar Date: Fri Sep 16 00:36:40 2022 +0100 arm64: renesas: Drop selecting SOC_BUS Don't automatically select the SOC_BUS config option as we already have automatically selected it as part of the SOC_RENESAS config option [0] as renesas-soc.c [1] uses the APIs provided by SOC_BUS config option. [0] drivers/soc/renesas/Kconfig [1] drivers/soc/renesas/renesas-soc.c Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220915233640.415305-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e46a1a9943c0e84f439b971d6ce03f87e3d67441 Author: Geert Uytterhoeven Date: Fri Sep 9 11:25:15 2022 +0200 clk: renesas: r8a779g0: Add EtherAVB clocks Add the module clocks used by the Ethernet AVB (EtherAVB-IF) blocks on the Renesas R-Car V4H (R8A779G0) SoC. Based on a larger patch in the BSP by Kazuya Mizuguchi. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e9382b0d9acc84acc2357a6921a1459f3a32240e.1662714852.git.geert+renesas@glider.be commit 36ff366033f0dde1e70d5ab96397803eb0399ddf Author: Geert Uytterhoeven Date: Fri Sep 9 11:25:14 2022 +0200 clk: renesas: r8a779g0: Add PFC/GPIO clocks Add the module clocks used by the Pin Function Controller (PFC) and General Purpose Input/Output (GPIO) blocks on the Renesas R-Car V4H (R8A779G0) SoC. Extracted from a larger patch in the BSP by Kazuya Mizuguchi. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/cc6a22f0ad49643e17b9921b27aa9cf0a3b8d57a.1662714852.git.geert+renesas@glider.be commit e90eba2ecb828ae23718523c66aadf4126a67dbb Author: Geert Uytterhoeven Date: Fri Sep 9 11:25:13 2022 +0200 clk: renesas: r8a779g0: Add I2C clocks Add the module clocks used by the I2C Bus Interfaces on the Renesas R-Car V4H (R8A779G0) SoC. Extracted from a larger patch in the BSP by Kazuya Mizuguchi. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f4b94f37950f6e976b68d0b32c324fb026d8b696.1662714852.git.geert+renesas@glider.be commit a4f8a6e60cd54073d27c857cd0c659c5c79cebe2 Author: Geert Uytterhoeven Date: Fri Sep 9 11:25:12 2022 +0200 clk: renesas: r8a779g0: Add watchdog clock Add the module clock used by the RCLK Watchdog Timer on the Renesas R-Car V4H (R8A779G0) SoC. Extracted from a larger patch in the BSP by Kazuya Mizuguchi. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a012e4449b976efbeaabebb983fa6cfc1b9329d3.1662714852.git.geert+renesas@glider.be commit 32fed4706d9aca31c9d575c1efa4a3624a9d5543 Author: Naftali Goldstein Date: Tue Sep 6 16:42:19 2022 +0300 wifi: iwlwifi: mvm: d3: parse keys from wowlan info notification This notification replaces the WOWLAN_GET_STATUSES command-and-response, so it's required to parse all the keys in the notification just like what happened when that command was used. Move around a few required static functions in order to avoid forward declarations. Signed-off-by: Naftali Goldstein Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.ca3fb23cab81.I0a9fe7729af4567b98813bc51bad13ee5512a0ae@changeid Signed-off-by: Gregory Greenman commit 4a0e642228379e6329e36b932749c59497109ade Author: Yedidya Benshimol Date: Tue Sep 6 16:42:18 2022 +0300 wifi: iwlwifi: mvm: iterate over interfaces after an assert in d3 In recent patches notifications based d3 resume flow was added, and the resume flow was changed. Currently, when resuming from d3 during which an assert was thrown, the resume flow skips the iteration over active interfaces preventing the sta to reconnect to the ap. Perform the iteration in case an assert was thrown to fix it. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.ad888cc6cd91.Ib56e416fce17df089edf76d22896430df5ebe080@changeid Signed-off-by: Gregory Greenman commit b75dac847c9453d017d463a97e253416abf93d36 Author: Haim, Dreyfuss Date: Tue Sep 6 16:42:17 2022 +0300 wifi: iwlwifi: mvm: trigger resume flow before wait for notifications We have recently enabled resume flow based on notifications. These notifications are sent by the FW when completing the resume flow. From IWL_DEVICE_FAMILY_AX210 the resume flow is triggered by the transport layer on iwl_trans_d3_resume. On IWL_DEVICE_FAMILY_22000 and earlier we trigger the resume flow by sending the D0I3 command. Currently, we are waiting for the notifications before sending the command, the notifications won't be sent by the FW since there is no resume trigger to piggyback on. Send the command before starting the wait flow to fix it. Signed-off-by: Haim, Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.5f0f251edf9c.Ia49ab73105af6f52aa7d318f4984edecd3b0671a@changeid Signed-off-by: Gregory Greenman commit 5ac54afd4d97ad8d94fe250c83b1924eb6d2268c Author: Ilan Peer Date: Tue Sep 6 16:42:16 2022 +0300 wifi: iwlwifi: mvm: Add handling for scan offload match info notification To support FW versions that send the scan match information as an asynchronous notification. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.bbc5602d0b6f.I1329c231f82e7bf18f7dba0ccbd9f2d4080cbfc1@changeid Signed-off-by: Gregory Greenman commit 319756ad11ca0f696eef5513fdfaa18e24c7af59 Author: Haim Dreyfuss Date: Tue Sep 6 16:42:15 2022 +0300 wifi: iwlwifi: mvm: enable resume based on notifications We have recently added support for resume based on notifications. Enable it. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.a6344ba23df5.I09fce8cf5aac1d46b40ae81b1abcf7a0e54af196@changeid Signed-off-by: Gregory Greenman commit c39e718a28d8e48f9b41b9ad3bed031188a07bd9 Author: Haim Dreyfuss Date: Tue Sep 6 16:42:14 2022 +0300 wifi: iwlwifi: mvm: Add support for d3 end notification Due to IMR, when host returns from hibernate, commands cannot be sent as part of the resume flow, and so after ending d3 the FW needs to send notifications instead of responses. This notification indicates whether a fw reset is required. Signed-off-by: Yedidya Benshimol Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.898ecba881b2.I13eb69bb5af08b9ac33043647eaed6b8d50e8659@changeid Signed-off-by: Gregory Greenman commit 219ed58feda9829a3df595aad65bdaacb005512d Author: Haim Dreyfuss Date: Tue Sep 6 16:42:13 2022 +0300 wifi: iwlwifi: mvm: Add support for wowlan wake packet notification The wowlan info notification is quite big. (~750 bytes without the wake packet itself). The max FW notification size is ~2K. There might be cases where the wake packet gets truncated because of this limit. Separating the wake packet from the wowlan info notification allows us to get more data without trimming it. Note: we currently limit the wake packet to 1600 bytes. Signed-off-by: Yedidya Benshimol Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.06d1e6aecf10.Ib3d6a46ffe71d10cbc69bdb5654e6b14c28df245@changeid Signed-off-by: Gregory Greenman commit 4da46a06d4430a18fddaa43b88dc1fcefdb8cf04 Author: Haim Dreyfuss Date: Tue Sep 6 16:42:12 2022 +0300 wifi: iwlwifi: mvm: Add support for wowlan info notification IMR (Isolated Memory Regions) is a mechanism to protect memory regions from unwarranted access by agents in the system that should not have access to that memory. When IMR is enabled, pages in the DRAM will be located within the IMR memory space, accessible only by the device. As a side effect, during S4 (a.k.a hibernate) the IMR memory space is not retained. While the DRAM is saved to the disk and restored by the OS upon resume, the IMR, which is hidden from the OS neither saved upon suspend nor restored upon resume. As a consequence of the above, it turned out that commands cannot be sent as part of the resume flow, and so after ending d3 the FW needs to use notifications instead of cmd-resp. The resume flow becomes asynchronous, with a series of notifications, starting with wowlan_info_notif, through wowlan_pkt_notif and complete the resume flow by d3_end_notif. This patch adds the support for wowlan info notification. The wake packet has been removed from the wowlan info struct and will be handled in a dedicated notification. Signed-off-by: Yedidya Benshimol Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.3ce8deefd929.Ieba8610e8bb4bec788076371ae38becb4a3d20d5@changeid Signed-off-by: Gregory Greenman commit 731d5aa91cf58fe7a082c0165f33ec8433d792cc Author: Haim Dreyfuss Date: Tue Sep 6 16:42:11 2022 +0300 wifi: iwlwifi: mvm: don't check D0I3 version This code is dead, even old FW versions don't use it. The IWL_D0I3_RESET_REQUIRE flag will be sent by the FW via a notification, instead of command, the notification handler will be introduced later in the series. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.87c82482229a.I70456c38ed8f7beb7d62dd618f58e7dc0a7d33b2@changeid Signed-off-by: Gregory Greenman commit fab6f4904e2f722fbf8126f9ee229b46c2044627 Author: Johannes Berg Date: Tue Sep 6 16:42:10 2022 +0300 wifi: iwlwifi: cfg: remove IWL_DEVICE_BZ_COMMON macro We only have a single use of this inside the IWL_DEVICE_BZ macro, so just combine the contents here. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.23d6c92e9a11.I4a11928a6d698079dc742e3ba3d3ce6fd7a878d1@changeid Signed-off-by: Gregory Greenman commit 7138763e02d1585659a5e82d517f096459985704 Author: Johannes Berg Date: Tue Sep 6 16:42:09 2022 +0300 wifi: iwlwifi: mvm: refactor iwl_mvm_set_sta_rate() a bit Use a switch statement over the rate type instead of the if chain, to simplify. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.623e32931b67.Id743a7879e84ae37a849179e536c58b1bf55380f@changeid Signed-off-by: Gregory Greenman commit 3d579204e069d99eb9b31f4624b8e7a47cb17f56 Author: Johannes Berg Date: Tue Sep 6 16:42:08 2022 +0300 wifi: iwlwifi: mvm: rxmq: further unify some VHT/HE code There's some duplication here, unify it so that adding EHT becomes easier. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.d1e8673b9443.I6d81fc9dd0856d75e3a799c23f0f8d212b077fca@changeid Signed-off-by: Gregory Greenman commit f1490546bec933e816843b7a95310b825b38dfeb Author: Johannes Berg Date: Tue Sep 6 16:42:07 2022 +0300 wifi: iwlwifi: mvm: rxmq: refactor mac80211 rx_status setting There's a bunch of duplicated code in the normal data RX and the no-data RX paths, refactor that. Note that we're evidently not implementing the 6 GHz band in the no-data path correctly, need to fix that in firmware first. Also, we were setting the NSS differently, keep doing that, but just override the previous values. Note also that we used to drop frames with bad rate data, to simplify that just report rate 0 and continue. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.a81580d5e769.I3ee7a1fe1adf8684c48713dbbdc2cbc60bd24cd1@changeid Signed-off-by: Gregory Greenman commit eab9ebfb7e83686bdef9a43dc43dd4f2b714f0a3 Author: Johannes Berg Date: Tue Sep 6 16:42:06 2022 +0300 wifi: iwlwifi: mvm: fix typo in struct iwl_rx_no_data API The version 2 is also for RX, of course, that's just a typo. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.80f7eda56163.Ib783512104f0c135695b4d59b637f3eef3e8f537@changeid Signed-off-by: Gregory Greenman commit bcc58c83ee852f89396f69f2694680a837297500 Author: Yaara Baruch Date: Tue Sep 6 16:42:05 2022 +0300 wifi: iwlwifi: pcie: add support for BZ devices Add support in BZ-FM and BZ-GL devices. Adjust current structs steps to differ between the new devices. Signed-off-by: Yaara Baruch Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220906161827.0b7fc8487039.I984dcb58272e2f38c835e7aaa7e1ac646bc2f65e@changeid Signed-off-by: Gregory Greenman commit 988262ef2fb9b43719ce40af1efe9bfbc62b461c Author: farah kassabri Date: Tue Aug 23 17:41:52 2022 +0300 habanalabs/gaudi2: log critical events with no rate limit When we have a storm of errors of HBM ECC SERR we can reach a situation where driver start hard reset flow without logging the error cause that caused the hard reset due to logs rate limiting. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d155df4f628a5312a485235aa8cc5ba78e11ea65 Author: Ofir Bitton Date: Tue Aug 23 16:23:56 2022 +0300 habanalabs: ignore EEPROM errors during boot EEPROM errors reported by firmware are basically warnings and should not fail the boot process. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c38f72370b615d48c7eb44389b229105f07a70e2 Author: Ofir Bitton Date: Mon Aug 22 10:59:34 2022 +0300 habanalabs: perform context switch flow only if needed Except Goya, none of our ASICs require context switch flow, hence we enable this flow only where it is needed. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 262042af1397099f88386830152770bcfd0de122 Author: Dafna Hirschfeld Date: Mon May 23 08:59:19 2022 +0300 habanalabs: set command buffer host VA dynamically Set the addresses for userspace command buffer dynamically instead of hard-coded. There is no reason for it to be hard-coded. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0263256791094180ab8749b224ef7bfe0bfd67bb Author: Ohad Sharabi Date: Sun Jun 12 15:00:29 2022 +0300 habanalabs: trace DMA allocations This patch add tracepoints in the code for DMA allocation. The main purpose is to be able to cross data with the map operations and determine whether memory violation occurred, for example free DMA allocation before unmapping it from device memory. To achieve this the DMA alloc/free code flows were refactored so that a single DMA tracepoint will catch many flows. To get better understanding of what happened in the DMA allocations the real allocating function is added to the trace as well. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Reviewed-by: Steven Rostedt (Google) Signed-off-by: Oded Gabbay commit 4eb87df3d04aa725e752fe2df0df3e83f204d247 Author: Ohad Sharabi Date: Wed Jun 8 10:27:59 2022 +0300 habanalabs: trace MMU map/unmap page This patch utilize the defined tracepoint to trace the MMU's pages map/unmap operations. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Reviewed-by: Steven Rostedt (Google) Signed-off-by: Oded Gabbay commit 191a4443c39b278fbb0898590530bef122b26b7e Author: Ohad Sharabi Date: Wed Jun 8 09:58:59 2022 +0300 habanalabs: define trace events This patch adds trace events for habanalabs driver to gain all the benefits such an infrastructure can supply. The following events were added: - MMU map/unmap: to be able to track driver's memory allocations - DMA alloc/free: to track our DMA allocation the above trace points in conjunction will help us map the device memory usage as well as to be able to track memory violations. Signed-off-by: Ohad Sharabi Acked-by: Oded Gabbay Reviewed-by: Steven Rostedt (Google) Signed-off-by: Oded Gabbay commit 7b5d13c9cae72b9baac88009401d5518cd86bb0d Author: Rajarama Manjukody Bhat Date: Fri Aug 12 09:28:20 2022 +0300 habanalabs/gaudi2: assigning PQFs for ARC f/w in PDMA Assigning 3 PQFs in PDMA1 and 2 PQFs in PDMA0 for ARC firmware usage. Signed-off-by: Rajarama Manjukody Bhat Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fb855768d33fe7ec1c0e5b9ed21a72478a81f77e Author: Tomer Tayar Date: Mon Aug 15 20:13:30 2022 +0300 habanalabs: fix calculation of DRAM base address in PCIe BAR The calculation of the device DRAM base address before setting the relevant PCIe BAR to point at it, has an assumption that this BAR is used to access only the DRAM, and thus the covered DRAM size is a power of 2. In future ASICs it is not necessarily true, so need to update the calculation to support also a non-power-of-2 size. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 46e49f434fcaafe3c62232aaa0358f03b462141d Author: Dafna Hirschfeld Date: Mon Aug 15 11:40:55 2022 +0300 habanalabs: if map page fails don't try to unmap it The original code tried to unmap a page that was not mapped as part of the map page error path. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 6173572f29a4f9f27b9655666e55cee20b0b8cf5 Author: Oded Gabbay Date: Mon Aug 15 13:59:14 2022 +0300 habanalabs: select FW_LOADER in Kconfig The driver is loading firmware to the device and we use the firmware loading functions from the FW_LOADER module. Signed-off-by: Oded Gabbay commit 273190d4204ef44b14b97e571ed7b4e42504189f Author: Omer Shpigelman Date: Thu Aug 4 17:32:30 2022 +0300 habanalabs: add cdev index data member Instead of recalculating the cdev index, store it in a dedicated data member. This data member is intended to be passed to other drivers using the auxiliary bus infra and hence this new data member is necessary in case that the calculation is changed in the future. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 78da23cb103336be27a5fa5f3d16ff7b08f7b4b9 Author: Oded Gabbay Date: Wed Aug 10 15:39:20 2022 +0300 habanalabs: fix missing info in sysfs documentation The kernel version field wasn't updated when a few entries were upstreamed. Signed-off-by: Oded Gabbay commit 75bc3986fc768912715d4898d5f4aac3fadbc155 Author: Dafna Hirschfeld Date: Mon Aug 8 14:03:44 2022 +0300 habanalabs: fix bug when setting va block size the size of a block is always 'block->end - block->start + 1' Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 38a4358009456bfd7e4893c4f98ee401efce26eb Author: Ofir Bitton Date: Wed Aug 3 17:25:33 2022 +0300 habanalabs: expose device security status using info ioctl In order for the user to know if he is running on a secured device or not, we add it also to the hw_ip info ioctl. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 6457271f64a2b6674b11aebb2888427eb4558c22 Author: Ofir Bitton Date: Wed Aug 3 17:16:56 2022 +0300 habanalabs: expose device security status through sysfs In order for the user to know if he is running on a secured device or not, a sysfs node is added. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 107a5bcc0b34c0f4f6c8b771321bf3a4e095335d Author: Ofir Bitton Date: Wed Aug 3 11:59:19 2022 +0300 habanalabs: remove secured PCI IDs Secured PCI ID will not be supported in new asics because the security status can always be read from the f/w. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 65d3c635137e24625740801dc21d885f66193299 Author: Tomer Tayar Date: Wed Aug 3 16:36:02 2022 +0300 habanalabs: fix H/W block handling for partial unmappings Several munmap() calls can be done or a mapped H/W block that has a larger size than a page size. Releasing the object should be done only when all mapped range is unmapped. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 07ecaa0d85decb73a2907a4b419cfa7739517d5e Author: Dani Liberman Date: Mon Jun 27 22:06:51 2022 +0300 habanalabs: unify hwmon resources clean up Since hwmon fini code is common for all asics, unified it to common function. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 194e515c79462f1ad09ebcc9e01a3acb84a98d82 Author: Tal Cohen Date: Thu Jul 7 18:42:47 2022 +0300 habanalabs/gaudi2: new API to control engine cores running mode The current flow of halting the engine cores is implemented by command buffers built by the user space and sent towards the Driver. This current flow is broken since the user space does not know when the cores actually halt as sending a workload is async op. Therefore the application can not free the memory that is mapped to the engine cores. This new API allows the user space to control the running mode. The API call is sync (returns after the cores are set to the requested mode). Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 07056f58e43319902cd1072c00df2846b31e14b8 Author: Oded Gabbay Date: Sun Aug 7 16:36:30 2022 +0300 habanalabs: remove left-over code from bring-up There is some left-over code from the gaudi2 bring-up that wasn't removed so far. Signed-off-by: Oded Gabbay commit 6419b5232efacb59b227c7088d1c00b98bdb82de Author: farah kassabri Date: Wed Jul 20 13:53:37 2022 +0300 habanalabs/gaudi2: change device f/w security check On Gaudi2 the f/w always configures the PCIe iATU and allows access to scratchpad registers. Therefore, we can know if the f/w is secured by reading a status bit from the f/w registers. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ab6c08f0d597408ce7ab4a0f92088cf7cefd2915 Author: Oded Gabbay Date: Sun Jul 31 09:10:24 2022 +0300 habanalabs: move common function out of debugfs.c A common function that is called from multiple places can't be located in degugfs.c because that file is only compiled if debugfs is enabled in the kernel config file. This can lead to undefined symbol compilation error. Reported-by: kernel test robot Signed-off-by: Oded Gabbay commit 7ca9022bd776d5a1c694ec0973e3d2e8671013c2 Author: Oded Gabbay Date: Sun Jul 31 08:27:36 2022 +0300 habanalabs/uapi: move defines to better place inside file Cosmetic change to move the eventfd events defines to a better location in the file, closer to other INFO IOCTL defines. Signed-off-by: Oded Gabbay commit f0d4944c20819edf4de2c5c17963491d23e213da Author: Tomer Tayar Date: Tue Jul 19 09:01:53 2022 +0300 habanalabs: add a missing lock for in_reset indication Add a missing lock in hl_device_resume() when it assigns a value to the 'in_reset' indication. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5f46217221dfdda94244d88ac6c1354293fc681b Author: Tomer Tayar Date: Fri Jul 29 16:30:48 2022 +0300 habanalabs: fix vma fields assignments order in hl_hw_block_mmap() In hl_hw_block_mmap(), the vma's 'vm_private_data' and 'vm_ops' fields are assigned before filling the content of the private data. In between there is a call to the ASIC hw_block_mmap() function, and if it fails, the vma close function will be called with a bad private data value. Fix the order of assignments to avoid this issue. In hl_hw_block_mmap() the vma's 'vm_private_data and vm_ops are assigned before setting the Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7fa6c0fe8b2154f84162b8aacbe581df722a6f0c Author: Tomer Tayar Date: Wed Jul 27 09:04:13 2022 +0300 habanalabs: avoid returning a valid handle if map_block() fails map_block() sets the block id handle even if get_hw_block_id() fails, and in this case it uses block id 0 which might be a valid id. Modify it to set the handle only if get_hw_block_id() succeeds. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0c876b47a54a5ae1331a99da9cc115f8f5c90990 Author: Tal Cohen Date: Sun Jul 24 17:40:23 2022 +0300 habanalabs: fix command submission sanity check When a CS is submitted, the ioctl handler checks the CS flags and performs a sanity check, according to its value. As new CS flags are added, the sanity check needs to be updated according to the new flags. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 68c82ba9a96f47dac9963c9f22b8c6bf4af00e02 Author: Ohad Sharabi Date: Sun Jul 24 10:23:05 2022 +0300 habanalabs/gaudi: read div_sel value from firmware Even when running with unsecured f/w, we should read the PLL div_sel value from the f/w as this register is always privileged. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d6501ecfb6233197b5b7dbd6aa5256636f3931f3 Author: Ohad Sharabi Date: Sun Jul 24 08:45:34 2022 +0300 habanalabs/gaudi: fix print format for div_sel Print format was for int (%d) while variable is u32. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 21fc79336b9587fcc251e77246b68b6e20340146 Author: Tomer Tayar Date: Wed Jul 20 20:02:20 2022 +0300 habanalabs/gaudi2: mark PCIE access error as fatal F/W events are enabled in a late phase of the device init, so an event for a PCIE access error during the init, can be received after the init is already done and considered as successful. A resulting device reset, which does the same H/W init, can end similarly with this event right after the reset is done and considered as successful, and a loop of this sequence can continue. To avoid it mark the PCIE access error as a fatal event, so after 2 consecutive events no more resets will be done. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f018c54e3de6619c46e33ab1c613761e9fba21d0 Author: Dani Liberman Date: Sat Jul 9 12:34:17 2022 +0300 habanalabs: add uapi to retrieve engines status Currently, to get engines status, user needed to read debugfs file with root permissions. This new uapi allows user apace apps retrieve status, so for example, in case of failure, status can be retrieved immediately by the application itself which runs without root permissions. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5f92c1e2961912e2a7a10d8e7b998b7cd9dd1d0e Author: Oded Gabbay Date: Tue Jul 19 12:16:01 2022 +0300 habanalabs: remove all kdma locks We don't use KDMA concurrently in the driver. The only use is through debugfs and we don't protect concurrent access through it. Reported-by: Dan Carpenter Signed-off-by: Oded Gabbay commit 0c819c9a04413facd3b167ec1e6f5928e909fcb2 Author: Ohad Sharabi Date: Mon Jul 18 22:02:13 2022 +0300 habanalabs: wrap macro arg with parentheses The macro argument is cast-ed to u32 in some of the places. Because this arg can be some arithmetic computation (e.g. address + offset) the cast should be on the whole expression. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f25a72b8b9f4885ea30263a02d1083e283c9e718 Author: Bharat Jauhari Date: Wed Jun 1 15:18:47 2022 +0300 habanalabs: fix spelling mistakes Cosmetic commit, no logical changes. It just fixes the spelling mistakes. Signed-off-by: Bharat Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ae937492ecc7e561ace4f01c6c0c14e868744d58 Author: Ofir Bitton Date: Mon Jul 18 21:02:34 2022 +0300 habanalabs/gaudi2: remove old interrupt mappings Interrupt enumration has changed some time ago but the old mapping was accidentally left in the driver. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cd6b0cea89862a5b3411246a2410881a988d5b0f Author: Oded Gabbay Date: Wed Apr 6 12:07:19 2022 +0300 habanalabs/gaudi: increase default cs timeout to 10 minutes In order to improve scalability and reduce host overhead, it is better to increase the default TDR timeout of Gaudi1 from 30 seconds to 10 minutes. This will allow the DL Framework (e.g. PyTorch, TensorFlow) to remove the host sync they are using now and improve overall performance on scaleout training. Note that one can always set the timeout to a custom value via a kernel module parameter given during driver load. Signed-off-by: Oded Gabbay commit 913bd4179b82adfeece29243711ccaf4330772b6 Author: Ohad Sharabi Date: Wed Jul 13 13:47:23 2022 +0300 habanalabs: add return code field to module iterator Up until now the module iterator called void callback functions and so caller activating callback that may fail suffered from 2 issues: 1. The need to "plant" return called in the private data. This is a drawback since the iterator itself should not be aware of the private data of the caller. 2. Due to 1 even in a failure the iterator would keep iterating instead of break upon error. To overcome this an optional rc field added to the iterator context. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 28742772a0bb798f67a774e91172e06a18cd9855 Author: Tomer Tayar Date: Tue Jul 12 18:19:11 2022 +0300 habanalabs/gaudi2: enable all MMU SPI/SEI interrupts Currently only part of the MMU SPI/SEI interrupts are enabled, although there is no real reason to not enable all. The only exception is "burst_fifo_full" which is expected for PMMU because it has a 2 entries FIFO, and thus is it not enabled for it. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bc9b271e6c92b5f3bfe25f73b11e8e878f386075 Author: Ofir Bitton Date: Wed Jul 13 15:08:09 2022 +0300 habanalabs: rename non_hard_reset to compute_reset In order to be more explicit we should use the term compute_reset for describing the reset in which only the compute engines gets reset. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e4507995da974e2758621982941f9ff2ea18134b Author: Colin Ian King Date: Thu Jul 14 11:31:19 2022 +0100 habanalabs: Fix spelling mistake "Scrubing" -> "Scrubbing" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2d4c09e3f93a8496bcb03270a104640ef1ecd39c Author: Yang Li Date: Thu Jul 14 09:29:08 2022 +0800 habanalabs: Simplify bool conversion Fix the following coccicheck warning: ./drivers/misc/habanalabs/gaudi2/gaudi2.c:9727:48-53: WARNING: conversion to bool not needed here Signed-off-by: Yang Li Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 71386e11f262f5fc66000c0d83b4fd8cbbaf9d38 Author: Dani Liberman Date: Sun Jul 3 17:40:57 2022 +0300 habanalabs: removed seq_file parameter from is_idle asic functions Change is_idle functions so it would be more usable outside debugfs. Do this by replacing seq_file parameter with regular string. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3e4519b7afc2f9d99f9303468ee0b23f88399c8d Author: Rebecca Mckeever Date: Tue Sep 13 00:21:12 2022 -0500 memblock tests: add generic NUMA tests for memblock_alloc_try_nid* Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw() where the simulated physical memory is set up with multiple NUMA nodes. Additionally, two of these tests set nid != NUMA_NO_NODE. All tests are run for both top-down and bottom-up allocation directions. The tested scenarios are: Range unrestricted: - region cannot be allocated: + none of the nodes have enough memory to allocate the region Range restricted: - region can be allocated in the specific node requested without dropping min_addr: + the range fully overlaps with the node, and there are adjacent reserved regions - region cannot be allocated: + nid is set to NUMA_NO_NODE and the total range can fit the region, but the range is split between two nodes and everything else is reserved Acked-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/4b2c7e6e5f3a9837939e99293c77e0e6fc3ae4f9.1663046060.git.remckee0@gmail.com commit 4b41046e7c6bd999c1519a8bf2771573bcecf52b Author: Rebecca Mckeever Date: Tue Sep 13 00:21:11 2022 -0500 memblock tests: add bottom-up NUMA tests for memblock_alloc_try_nid* Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw() where the simulated physical memory is set up with multiple NUMA nodes. Additionally, all of these tests set nid != NUMA_NO_NODE. These tests are run with a bottom-up allocation direction. The tested scenarios are: Range unrestricted: - region can be allocated in the specific node requested: + there are no previously reserved regions + the requested node is partially reserved but has enough space - the specific node requested cannot accommodate the request, but the region can be allocated in a different node: + there are no previously reserved regions, but node is too small + the requested node is fully reserved + the requested node is partially reserved and does not have enough space Range restricted: - region can be allocated in the specific node requested after dropping min_addr: + range partially overlaps with two different nodes, where the first node is the requested node + range partially overlaps with two different nodes, where the requested node ends before min_addr - region cannot be allocated in the specific node requested, but it can be allocated in the requested range: + range overlaps with multiple nodes along node boundaries, and the requested node ends before min_addr + range overlaps with multiple nodes along node boundaries, and the requested node starts after max_addr - region cannot be allocated in the specific node requested, but it can be allocated after dropping min_addr: + range partially overlaps with two different nodes, where the second node is the requested node Acked-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/00c4810daaf5d050abc71915b24ed7419bb16b51.1663046060.git.remckee0@gmail.com commit 50c80241f15890a64b9302187faaeb7cfe78b4b8 Author: Rebecca Mckeever Date: Tue Sep 13 00:21:10 2022 -0500 memblock tests: add top-down NUMA tests for memblock_alloc_try_nid* Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw() where the simulated physical memory is set up with multiple NUMA nodes. Additionally, all of these tests set nid != NUMA_NO_NODE. These tests are run with a top-down allocation direction. The tested scenarios are: Range unrestricted: - region can be allocated in the specific node requested: + there are no previously reserved regions + the requested node is partially reserved but has enough space - the specific node requested cannot accommodate the request, but the region can be allocated in a different node: + there are no previously reserved regions, but node is too small + the requested node is fully reserved + the requested node is partially reserved and does not have enough space Range restricted: - region can be allocated in the specific node requested after dropping min_addr: + range partially overlaps with two different nodes, where the first node is the requested node + range partially overlaps with two different nodes, where the requested node ends before min_addr - region cannot be allocated in the specific node requested, but it can be allocated in the requested range: + range overlaps with multiple nodes along node boundaries, and the requested node ends before min_addr + range overlaps with multiple nodes along node boundaries, and the requested node starts after max_addr - region cannot be allocated in the specific node requested, but it can be allocated after dropping min_addr: + range partially overlaps with two different nodes, where the second node is the requested node Acked-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/84009c5b3969337ccf89df850db56d364f8c228b.1663046060.git.remckee0@gmail.com commit b338bde5a3a9c4ccf6c83e0a20c8de3ad281ef02 Author: Rebecca Mckeever Date: Tue Sep 13 00:21:09 2022 -0500 memblock tests: add simulation of physical memory with multiple NUMA nodes Add function setup_numa_memblock() for setting up a memory layout with multiple NUMA nodes in a previously allocated dummy physical memory. This function can be used in place of setup_memblock() in tests that need to simulate a NUMA system. setup_numa_memblock(): - allows for setting up a memory layout by specifying the fraction of MEM_SIZE in each node Set CONFIG_NODES_SHIFT to 4 when building with NUMA=1 to allow for up to 16 NUMA nodes. Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/4566d816a85f009268d4858d1ef06c7571a960f9.1663046060.git.remckee0@gmail.com commit 44a8535fb87c5503ce01121278ac3058eef701ec Merge: 5947b7f794ca5 85a5f9638313a Author: David S. Miller Date: Sat Sep 17 20:13:41 2022 +0100 Merge branch 'octeontx2-cn10k-ptp' From: Naveen Mamindlapalli To: , , , , , , , , Cc: Naveen Mamindlapalli Subject: [net-next PATCH 0/4] Add PTP support for CN10K silicon Date: Sat, 10 Sep 2022 13:24:12 +0530 [thread overview] Message-ID: <20220910075416.22887-1-naveenm@marvell.com> (raw) This patchset adds PTP support for CN10K silicon, specifically to workaround few hardware issues and to add 1-step mode. Patchset overview: Patch #1 returns correct ptp timestamp in nanoseconds captured when external timestamp event occurs. Patch #2 adds 1-step mode support. Patch #3 implements software workaround to generate PPS output properly. Patch #4 provides a software workaround for the rollover register default value, which causes ptp to return the wrong timestamp. ==================== Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 85a5f9638313a1df7e84e9ea66ecd216133215c2 Author: Naveen Mamindlapalli Date: Sat Sep 10 13:24:16 2022 +0530 octeontx2-af: Initialize PTP_SEC_ROLLOVER register properly Since the reset value of PTP_SEC_ROLLOVER is incorrect on CNF10KB silicon, the ptp timestamps are inaccurate. This patch initializes the PTP_SEC_ROLLOVER register properly for the CNF10KB silicon. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 2ef4e45d99b19fb16834616f47d21a9b76b0e5f4 Author: Naveen Mamindlapalli Date: Sat Sep 10 13:24:15 2022 +0530 octeontx2-af: Add PTP PPS Errata workaround on CN10K silicon Errata: The ptp_clock_hi rollsover to zero one clock cycle before it reaches one second boundary. As a result, the pps threshold comparison fails after one second and the pps output signal won't toggle further. This patch workarounds the issue by programming the pps_lo_incr register to 500msec minus one clock cycle period, ensuring that the pps threshold comparison succeeds at one second rollover boundary and pps edge toggles. After that point, the driver will have enough time (~500msec) to reset the pps threshold value. After each one second boundary, hrtimer is invoked which resets the pps threshold value. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Rakesh Babu Saladi Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 2958d17a898416c6193431676f6130b68a2cb9fc Author: Hariprasad Kelam Date: Sat Sep 10 13:24:14 2022 +0530 octeontx2-pf: Add support for ptp 1-step mode on CN10K silicon Add support for ptp 1-step mode using timecounter. The seconds and nanoseconds to be updated in PTP header are calculated by adding the timecounter offset to the free running PTP clock counter time. The PF driver periodically gets the PTP clock time using AF mbox. The 1-step support uses HW feature to update correction field rather than OriginTimestamp field in PTP header. Signed-off-by: Hariprasad Kelam Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit a8025e7946a2b18c4ac17b36fde528d2f6262bdd Author: Naveen Mamindlapalli Date: Sat Sep 10 13:24:13 2022 +0530 octeontx2-af: return correct ptp timestamp for CN10K silicon The MIO_PTP_TIMESTAMP format has been changed in CN10K silicon family. The upper 32-bits represents seconds and lower 32-bits represents nanoseconds. This patch returns nanosecond timestamp to NIX PF driver. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 2dec3a7a7beb23ec11b23986e0e331913d621ff1 Author: Uwe Kleine-König Date: Fri Sep 16 11:08:02 2022 +0200 macintosh/ams: Adapt declaration of ams_i2c_remove() to earlier change Commit ed5c2f5fd10d ("i2c: Make remove callback return void") changed the prototype of ams_i2c_remove() but failed to adapt the declaration. Catch up and fix the declaration accordingly. Fixes: ed5c2f5fd10d ("i2c: Make remove callback return void") Reported-by: kernel test robot Signed-off-by: Uwe Kleine-König Acked-by: Michael Ellerman (powerpc) Signed-off-by: Wolfram Sang commit e05e47088ef12ce69b5c40605e95d01c11807a22 Author: Lad Prabhakar Date: Tue Sep 13 18:01:21 2022 +0100 i2c: riic: Use devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Lad Prabhakar Signed-off-by: Wolfram Sang commit 92be2c122e495f0249090c0048f4fd05fe1efa9e Author: Asmaa Mnebhi Date: Thu Sep 8 13:35:37 2022 -0400 i2c: mlxbf: remove IRQF_ONESHOT IRQF_ONESHOT is not needed so remove it. Reviewed-by: Khalil Blaiech Signed-off-by: Asmaa Mnebhi Signed-off-by: Wolfram Sang commit 2fef9856dcc6d1e1e7f5b38624d1533f8bda238d Merge: 32c3d47fd7fc9 0b2eafe1167e7 Author: Arnd Bergmann Date: Sat Sep 17 20:02:30 2022 +0200 Merge tag 'at91-dt-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 DT for v6.1 #2 It contains: - new SAMA5D3 based board, namely SAMA5D3-EDS - adjustments to pass the DT binding validations - disable AES on some LAN966 based boards as they are reserverd by secure OS * tag 'at91-dt-6.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: spi: dt-bindings: atmel,at91rm9200-spi: Add DMA related properties ARM: dts: at91: Add `atmel,usart-mode` required property to serial nodes ARM: dts: at91: sam9x60ek: Add DBGU compatibles to uart1 ARM: dts: at91: sama7g5: Swap rx and tx for spi11 dts: arm: at91: Add SAMA5D3-EDS Board dt-bindings: arm: at91: Add info on SAMA5D3-EDS ARM: dts: lan966x: disable aes Link: https://lore.kernel.org/r/20220916105407.1287452-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit e10ea7b9b90219da305a16b3c1252169715a807b Author: Maya Matuszczyk Date: Thu Aug 25 21:19:47 2022 +0200 drm: panel-orientation-quirks: Add quirk for Aya Neo Air Yet another x86 gaming handheld. This one has many SKUs with quite a few of DMI strings, so let's just use a catchall, just as with Aya Neo Next. Signed-off-by: Maya Matuszczyk Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20220825191946.1678798-1-maccraft123mc@gmail.com commit f5a5e83379b537f6252526bb4d285b771f6f0b89 Author: Hector Martin Date: Wed Sep 14 09:34:31 2022 +0100 soc: apple: rtkit: Add apple_rtkit_poll This allows a client to receive messages in atomic context, by polling. Signed-off-by: Hector Martin Signed-off-by: Russell King (Oracle) Reviewed-by: Sven Peter Reviewed-by: Eric Curtin Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit a1f65e64c6a3aa920b059aba5c97598cc0d17978 Author: Jagan Teki Date: Thu Sep 15 22:09:44 2022 +0530 dt-bindings: clock: rockchip: Document RV1126 CRU Document dt-bindings for Rockchip RV1126 clock controller. Cc: linux-clk@vger.kernel.org Cc: Michael Turquette Cc: Stephen Boyd Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220915163947.1922183-4-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 0424d967812d3449a85e1d10e7d2d7049efa000e Merge: 30d8b7d43c840 bc35a430dfde1 Author: Heiko Stuebner Date: Sat Sep 17 16:28:30 2022 +0200 Merge branch 'v6.1-shared/clkids' into v6.1-clock/next commit bc35a430dfde16462feb4428bc9b42c0647b5b84 Author: Jagan Teki Date: Thu Sep 15 22:09:43 2022 +0530 clk: rockchip: Add dt-binding header for RV1126 Add the dt-bindings header for the Rockchip RV1126, that gets shared between the clock controller and the clock references in the dts. Acked-by: Rob Herring Signed-off-by: Finley Xiao Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220915163947.1922183-3-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 74f481f187ce8b37ec5143cee19147da5243009c Author: Hans de Goede Date: Fri Sep 9 13:56:46 2022 +0200 drm/gma500: Remove unnecessary suspend/resume wrappers The psb_runtime_suspend/resume/thaw/freeze/restore functions are all just 1:1 wrappers around gma_power_suspend/_resume. Drop these wrappers and use the DEFINE_RUNTIME_DEV_PM_OPS() macro to define the dev_pm_ops struct. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-7-hdegoede@redhat.com commit 672c473576ca5c9f5a40ac848c938e6898a5aac8 Author: Hans de Goede Date: Fri Sep 9 13:56:45 2022 +0200 drm/gma500: Rewrite power management code Rewrite the power.c code. For some reason this was doing locking + refcounting + state (suspended or not) bookkeeping all by itself. But there is no reason for this, this is all taken care of by the runtime-pm core, through pm_runtime_get()/_put(). Besides this not being necessary the DIY code is also quite weird/ buggy in some places. E.g. power_begin() would manually do a resume when not resumed already and force_on=true, followed by a pm_runtime_get(), which will cause a call to gma_power_resume() to get scheduled which would redo the entire resume again. Which can all be replaced by a single pm_runtime_get_sync() call. Note that this is just a cleanup, this does not actually fix the (disabled through #if 0) runtime-pm support. It does now call pm_runtime_enable(), but only after doing a pm_runtime_get() at probe-time, so the device is never runtime suspended. Doing this permanent get() + enable() instead of not calling enable() at all is necessary for the pm_runtime_get_if_in_use() call in gma_power_begin() to work properly. Note this also removes the gma_power_is_on() call a check like this without actually holding a reference is always racy, so it is a bad idea (and therefor has no pm_runtime_foo() equivalent). The 2 code paths which were using gma_power_is_on() are actually both guaranteed to only run when the device is powered-on so the 2 checks can simply be dropped. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-6-hdegoede@redhat.com commit d35a4bf66079b92e232ac85b08f19312be9b7eca Author: Hans de Goede Date: Fri Sep 9 13:56:44 2022 +0200 drm/gma500: Remove a couple of not useful function wrappers The gma_crtc_set_config() and psb_unlocked_ioctl() functions are 1:1 wrappers for drm_helpers. Drop these wrappers. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-5-hdegoede@redhat.com commit f3b173e9094f5b02fb92d641e3e71fee0bcda73a Author: Hans de Goede Date: Fri Sep 9 13:56:43 2022 +0200 drm/gma500: Remove never set dev_priv->rpm_enabled flag The rpm_enabled flag is never set, remove it. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-4-hdegoede@redhat.com commit 49da26d7b418cfc99ad2473a2e3dee2e08c5ba4a Author: Hans de Goede Date: Fri Sep 9 13:56:42 2022 +0200 drm/gma500: Remove runtime_allowed dead code in psb_unlocked_ioctl() runtime_allowed is initialized to 0, so the runtime_allowed == 1 condition is never true making this dead code. Remove it. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-3-hdegoede@redhat.com commit 9b6a16575ebf23a98a9ff84aedde9f3b25731714 Author: Hans de Goede Date: Tue Sep 6 22:38:52 2022 +0200 drm/gma500: Fix (vblank) IRQs not working after suspend/resume Fix gnome-shell (and other page-flip users) hanging after suspend/resume because of the gma500's IRQs not working. This fixes 2 problems with the IRQ handling: 1. gma_power_off() calls gma_irq_uninstall() which does a free_irq(), but gma_power_on() called gma_irq_preinstall() + gma_irq_postinstall() which do not call request_irq. Replace the pre- + post-install calls with gma_irq_install() which does prep + request + post. 2. After fixing 1. IRQs still do not work on a Packard Bell Dot SC (Intel Atom N2600, cedarview) netbook. Cederview uses MSI interrupts and it seems that the BIOS re-configures things back to normal APIC based interrupts during S3 suspend. There is some MSI PCI-config registers save/restore code which tries to deal with this, but on the Packard Bell Dot SC this is not sufficient to restore MSI IRQ functionality after a suspend/resume. Replace the PCI-config registers save/restore with pci_disable_msi() on suspend + pci_enable_msi() on resume. Fixing e.g. gnome-shell hanging. Signed-off-by: Hans de Goede Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220906203852.527663-4-hdegoede@redhat.com (cherry picked from commit 235fdbc32d559db21e580f85035c59372704f09e) commit c82ceb440b886cc0f3945b6db979c49c48a4af29 Author: Ard Biesheuvel Date: Tue Aug 9 16:45:17 2022 +0200 efi/libstub: use EFI provided memcpy/memset routines The stub is used in different execution environments, but on arm64, RISC-V and LoongArch, we still use the core kernel's implementation of memcpy and memset, as they are just a branch instruction away, and can generally be reused even from code such as the EFI stub that runs in a completely different address space. KAsan complicates this slightly, resulting in the need for some hacks to expose the uninstrumented, __ prefixed versions as the normal ones, as the latter are instrumented to include the KAsan checks, which only work in the core kernel. Unfortunately, #define'ing memcpy to __memcpy when building C code does not guarantee that no explicit memcpy() calls will be emitted. And with the upcoming zboot support, which consists of a separate binary which therefore needs its own implementation of memcpy/memset anyway, it's better to provide one explicitly instead of linking to the existing one. Given that EFI exposes implementations of memmove() and memset() via the boot services table, let's wire those up in the appropriate way, and drop the references to the core kernel ones. Signed-off-by: Ard Biesheuvel commit c7007d9f19527b47992ff78a088e8697a9e9d5f5 Author: Ard Biesheuvel Date: Mon May 2 00:55:49 2022 +0200 efi/libstub: add some missing EFI prototypes Define the correct prototypes for the load_image, start_image and unload_image boot service pointers so we can call them from the EFI zboot code. Also add some prototypes related to installation and deinstallation of protocols in to the EFI protocol database, including some definitions related to device paths. Signed-off-by: Ard Biesheuvel commit 2830ca9e5b98bee82f1d1e284ce23fe7fb244ea8 Author: Jilin Yuan Date: Wed Aug 24 21:02:26 2022 +0800 drm/vboxvideo: fix repeated words in comments Delete the redundant word 'the'. Signed-off-by: Jilin Yuan Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20220824130226.33980-1-yuanjilin@cdjrlc.com commit 770e19076065e079a32f33eb11be2057c87f1cde Author: Maya Matuszczyk Date: Wed Aug 3 20:24:03 2022 +0200 drm: panel-orientation-quirks: Add quirk for Anbernic Win600 This device is another x86 gaming handheld, and as (hopefully) there is only one set of DMI IDs it's using DMI_EXACT_MATCH Signed-off-by: Maya Matuszczyk Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20220803182402.1217293-1-maccraft123mc@gmail.com commit 0978c7c41fe2a3735f8776dc27cf1641bd916773 Author: Deming Wang Date: Wed Sep 14 21:48:30 2022 -0400 acl: fix the comments of posix_acl_xattr_set remove the double world of 'in'. Signed-off-by: Deming Wang Signed-off-by: Christian Brauner (Microsoft) commit d4e87e4e8486ce255e46e4b866e84416cc0d2a89 Author: Pankaj Bansal Date: Thu Sep 15 18:34:32 2022 -0500 arm64: dts: ls1046a-qds: Modify the qspi flash frequency The qspi flash in ls1046a QDS board can operate at 50MHz frequency. Therefore, update the maximum supported freq in dts file. Signed-off-by: Pankaj Bansal Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 63c396414bfcbbe396cda023894c463ec0953570 Author: Li Yang Date: Thu Sep 15 18:34:31 2022 -0500 arm64: dts: ls1046a-qds: add mmio based mdio-mux nodes for FPGA There is mmio based mdio mux function in the FPGA device on ls1046a-qds board. Add the mmio based mdio-mux nodes to ls1043a-qds boards and add simple-mfd as a compatbile for the FPGA node to reflect the multi-function nature of it. Signed-off-by: Camelia Groza Signed-off-by: Pankaj Bansal Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 0f62994a559acdae1ac420b62329cd6517b4ef72 Author: Li Yang Date: Thu Sep 15 18:34:30 2022 -0500 arm64: dts: ls1046a: add gpios based i2c recovery information Add scl-gpios property for i2c recovery and add SoC specific compatible string for SoC specific fixup. Signed-off-by: Zhang Ying Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit f8179c89d7b1b3acb92460594b9adf1fbdf5a424 Author: Laurentiu Tudor Date: Thu Sep 15 18:34:29 2022 -0500 arm64: dts: ls1046a: use a pseudo-bus to constrain usb and sata dma size Wrap the usb and sata controllers in an intermediate simple-bus and use it to constrain the dma address size of these usb controllers to the 40 bits that they generate toward the interconnect. This is required because the SoC uses 48 bits address sizes and this mismatch would lead to smmu context faults because the usb generates 40-bit addresses while the smmu page tables are populated with 48-bit wide addresses. Suggested-by: Robin Murphy Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 136975c33894e7b48a6007af0f4c25f423bbd1de Author: Li Yang Date: Thu Sep 15 18:34:28 2022 -0500 arm64: dts: ls1046a: make dma-coherent global to the SoC These SoCs are really completely dma coherent in their entirety so add the dma-coherent property at the soc level in the device tree and drop the instances where it's specifically added to a few select devices. Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 0d3990796fba84d4141333b8e78ea61a21fb5524 Author: Laurentiu Tudor Date: Thu Sep 15 18:34:27 2022 -0500 arm64: dts: ls1046a: add missing dma ranges property These chips have a 48-bit address size so make sure that the dma-ranges reflects this. Otherwise the linux kernel's dma sub-system will set the default dma masks to full 64-bit, badly breaking dmas. Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit b236df8982456206d8dd85f1113b6b2eb8cca89c Author: Hou Zhiqiang Date: Thu Sep 15 18:34:26 2022 -0500 arm64: dts: ls1046a: Add big-endian property for PCIe nodes Add the big-endian property for LS1046A PCIe RC nodes. Signed-off-by: Hou Zhiqiang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 163608619b71a3739d295599c10384c7b9986358 Author: Xiaowei Bao Date: Thu Sep 15 18:34:25 2022 -0500 arm64: dts: ls1046a: Add the PME interrupt and big-endian to PCIe EP nodes Add the PME interrupt porperty and big-endian property in PCIe EP nodes. Signed-off-by: Xiaowei Bao Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 6f3e8922e51c9be4c6bd45b298477fc2c722b52e Author: Li Yang Date: Thu Sep 15 18:34:24 2022 -0500 arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node Enable USB3 HW LPM feature for ls1046a. Signed-off-by: Ran Wang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit a81e12d2ac5f4b4867760b95dc5398db76b26016 Author: Li Yang Date: Wed Sep 14 16:47:03 2022 -0500 arm64: dts: ls1043a-rdb: add pcf85263 rtc node Add the missing node for rtc device under i2c and fix style problems at the same time. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit ab9d8032dbd03a23993d2913db07aac9c47385bb Author: Li Yang Date: Wed Sep 14 16:47:02 2022 -0500 arm64: dts: ls1043a-qds: add mmio based mdio-mux support There is mmio based mdio mux function in the FPGA device on ls1043a-qds board. Add the mmio based mdio-mux nodes to ls1043a-qds boards and add simple-mfd as a compatbile for the FPGA node to reflect the multi-function nature of it. Also connect the ethernet interfaces to these phy interfaces. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 2a2ab4d5206d25875e30a8a8153f0b4f3c951ee4 Author: Laurentiu Tudor Date: Wed Sep 14 16:47:01 2022 -0500 arm64: dts: ls1043a: use a pseudo-bus to constrain usb and sata dma size Wrap the usb and sata controllers in an intermediate simple-bus and use it to constrain the dma address size of these usb controllers to the 40 bits that they generate toward the interconnect. This is required because the SoC uses 48 bits address sizes and this mismatch would lead to smmu context faults because the usb generates 40-bit addresses while the smmu page tables are populated with 48-bit wide addresses. Suggested-by: Robin Murphy Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 4b211ebb887f42ff42d72d7766f3b52399004417 Author: Li Yang Date: Wed Sep 14 16:47:00 2022 -0500 arm64: dts: ls1043a: add gpio based i2c recovery information Add scl-gpios property for i2c recovery and add SoC specific compatible string for SoC specific fixup. Signed-off-by: Zhang Ying Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit f0560158da0bfb808d318a279f80565035fd619a Author: Li Yang Date: Wed Sep 14 16:46:59 2022 -0500 arm64: dts: ls1043a: make dma-coherent global to the SoC ls1043a is really completely dma coherent in their entirety so add the dma-coherent property at the soc level in the device tree and drop the instances where it's specifically added to a few select devices. Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 21d5096f840b32ac97f0f0ee6fec30a802afa526 Author: Laurentiu Tudor Date: Wed Sep 14 16:46:58 2022 -0500 arm64: dts: ls1043a: add missing dma ranges property ls1043a has a 48-bit address size so make sure that the dma-ranges reflects this. Otherwise the linux kernel's dma sub-system will set the default dma masks to full 64-bit, badly breaking dmas. Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 5c4820af65315cafc69f6a45436027ea70009fd1 Author: Hou Zhiqiang Date: Wed Sep 14 16:46:57 2022 -0500 arm64: dts: ls1043a: Add big-endian property for PCIe nodes Add the big-endian property for LS1043A PCIe nodes for accessing PEX_LUT and PF register block. Signed-off-by: Hou Zhiqiang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 8580b6aa02acc8a2094d01a291a06774ef6ded2e Author: Hou Zhiqiang Date: Wed Sep 14 16:46:56 2022 -0500 arm64: dts: ls1043a: Add SCFG phandle for PCIe nodes The LS1043A PCIe controller has some control registers in SCFG block, so add the SCFG phandle for each PCIe controller node. Signed-off-by: Hou Zhiqiang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit ee00c1a6314d5cebbe4f84ddd046dbbbd7788cf6 Author: Li Yang Date: Wed Sep 14 16:46:55 2022 -0500 arm64: dts: ls1043a: use pcie aer/pme interrupts After the binding has been updated to include more specific interrupt definition, update the dts to use the more specific interrupt names. Signed-off-by: Po Liu Signed-off-by: Hou Zhiqiang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit d7b01cca020ac66f917800b63e1f41fc1ff927f6 Author: Li Yang Date: Wed Sep 14 16:46:54 2022 -0500 arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node Enable USB3 HW LPM feature for ls1043a. Signed-off-by: Ran Wang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 9b6408f02708c4e6e388e9b3474d8c62b525d909 Author: Li Yang Date: Wed Sep 14 16:46:53 2022 -0500 arm64: dts: ls1043a: fix the wrong size of dcfg space The size of the block should be 0x1000 instead of 0x10000. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 4dede987d9aabf6da081e5d84f06dde6823d806f Author: Pankaj Bansal Date: Wed Sep 14 16:15:38 2022 -0500 arm64: dts: ls208x: remove NXP Erratum A008585 from LS2088A. NXP Erratum A008585 affects A57 core cluster used in LS2085 rev1. However this problem has been fixed in A72 core cluster used in LS2088. Therefore remove the erratum from LS2088A. Keeping it only in LS2085. Signed-off-by: Pankaj Bansal Reviewed-by: Sandeep Malik Acked-by: Priyanka Jain Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 822f91d512abfe70349fce7b79cbdee8d0d016e9 Author: Biwen Li Date: Wed Sep 14 16:15:37 2022 -0500 arm64: dts: ls208xa-rdb: fix errata E-00013 Specify a channel zero in idle state to avoid enterring tri-stated state for PCA9547. Some information about E-00013: - Description: I2C1 and I2C3 buses are missing pull-up. - Impact: When the PCA954x device is tri-stated, the I2C bus will float. This makes the I2C bus and its associated downstream devices inaccessible. - Hardware fix: Populate resistors R189 and R190 for I2C1 and resistors R228 and R229 for I2C3. - Software fix: Remove the tri-state option from the PCA954x driver(PCA954x always on enable status, specify a channel zero in dts to fix the errata E-00013). Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit ad5b6611e1574356efc214e94249fefd055dd202 Author: Priyanka Jain Date: Wed Sep 14 16:15:36 2022 -0500 arm64: dts: ls2081a-rdb: Add DTS for NXP LS2081ARDB This patch adds support for NXP LS2081ARDB board which has LS2081A SoC. LS2081A SoC is 40-pin derivative of LS2088A SoC. From functional perspective both are same. Hence, LS2088a SoC dtsi file is included from LS2081ARDB dts. Signed-off-by: Priyanka Jain Signed-off-by: Santan Kumar Signed-off-by: Tao Yang Signed-off-by: Yogesh Gaur Signed-off-by: Abhimanyu Saini Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 6f4ce5b8f33109eda83e3be4412757446bcac430 Author: Ioana Radulescu Date: Wed Sep 14 16:15:35 2022 -0500 arm64: dts: ls2080a-rdb: add phy nodes Define PHY nodes on the board. Signed-off-by: Ioana Radulescu Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 61759b114616a18c9ec0accaea35c0c2e25b5dd5 Author: Li Yang Date: Wed Sep 14 16:15:34 2022 -0500 arm64: dts: ls208xa-qds: add mdio mux nodes from on-board FPGA Update the cpld node name to be generic board-contrl and add mmio mdio mux nodes from the on-board FPGA. Signed-off-by: Ioana Radulescu Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 9e1afe14d9c1ed988ec1f8885af4adab49c1c279 Author: Tim Harvey Date: Thu Sep 8 08:49:03 2022 -0700 arm64: dts: imx8mp-venice-gw74xx: add PCIe support Add PCIe support on the Gateworks GW74xx board. While at it, fix the related gpio line names from the previous incorrect values. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 8dd495d12374b263caba758942764bf10324348e Author: Shenwei Wang Date: Wed Sep 14 08:58:48 2022 -0500 arm64: dts: freescale: add support for i.MX8DXL EVK board This is to support the EVK (Evaluation Kit Board) for the i.MX8DXL. The patch has enabled the serial console, SD/EMMC interface, and the eqos and fec ethernet network. Signed-off-by: Shenwei Wang Signed-off-by: Shawn Guo commit f537ee7f1e76990ef9ba0e6d32fd9cc51eb12e43 Author: Shenwei Wang Date: Wed Sep 14 08:58:47 2022 -0500 arm64: dts: freescale: add i.MX8DXL SoC support i.MX8DXL is a device targeting the automotive and industrial market segments. The chip is designed to achieve both high performance and low power consumption. It has a dual (2x) Cortex-A35 processor. This patch adds the basic support for i.MX8DXL SoC. Signed-off-by: Shenwei Wang Signed-off-by: Shawn Guo commit 41d5ceff6052ec269293e13b6bb2a69b82b02438 Author: Shenwei Wang Date: Wed Sep 14 08:58:46 2022 -0500 arm64: dts: imx8: add a node label to ddr-pmu The ddr-pmu on i.mx8dxl has a different interrupt number. Add a node label to ddr-pmu so that it could be referred and changed in i.mx8dxl dts. Signed-off-by: Shenwei Wang Signed-off-by: Shawn Guo commit b999bdaf0597c38cf68679b1788aa00cab4fc801 Author: Tim Harvey Date: Mon Sep 12 11:18:19 2022 -0700 arm64: dts: imx: Add i.mx8mm Gateworks gw7904 dts support The GW7904 is based on the i.MX 8M Mini SoC featuring: - LPDDR4 DRAM - eMMC FLASH - microSD connector with UHS support - LIS2DE12 3-axis accelerometer - Gateworks System Controller - IMX8M FEC - 2x RS232 off-board connectors - PMIC - 10x bi-color LED's - 1x miniPCIe socket with PCIe and USB2.0 - 802.3at Class 4 PoE - 10-30VDC input via barrel-jack Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 870f645b396bbb65de2dc39423f68c7e8293e849 Author: Tim Harvey Date: Mon Sep 12 11:08:36 2022 -0700 arm64: dts: imx8mp-venice-gw74xx: add WiFi/BT module support The GW74xx supports an on-board Laird Connectivity Sterling LWB5+ module which uses a Cypress CYW4373W chip to provide 1x1 802.11 a/b/g/n/ac + Bluetooth 5.2. Add the proper device-tree nodes for it. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 07ce211afa5af60561a0c59049ed1d9d0df1b3ed Author: Tim Harvey Date: Mon Sep 12 11:08:35 2022 -0700 arm64: dts: imx8mp-venice-gw74xx: add cpu-supply node for cpufreq Add regulator config for cpu-supply in order to support cpufreq. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 21e24d257fe23ff53f6db3b4af2f06c07766396e Author: Tim Harvey Date: Thu Sep 8 08:42:27 2022 -0700 arm64: dts: imx8mp-venice-gw74xx: add USB DR support Add support for USB DR on USB1 interface. Host/Device detection is done using the usb-role-switch connector with a GPIO as USB1_OTG_ID is not connected internally. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit a90a37bbeab4518cc3bf5c4d1eb088cf8993fcf9 Author: Peng Fan Date: Mon Sep 12 18:02:34 2022 +0800 arm64: dts: imx93: add mediamix blk ctrl node Add i.MX93 mediamix blk ctrl node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit e85d3458a804266d15dce47618b1af081899aff4 Author: Peng Fan Date: Tue Sep 6 11:28:16 2022 +0800 arm64: dts: imx93: add src node Add i.MX93 SRC node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 5dfc7922ba02206c72a8844ac6b6bf0d7170a38f Author: Vladimir Oltean Date: Tue Sep 6 00:24:58 2022 +0300 arm64: dts: ls1028a-rdb: add more ethernet aliases Commit "arm64: dts: ls1028a: enable swp5 and eno3 for all boards" which Shawn declared as applied, but for which I can't find a sha1sum, has enabled a new Ethernet port on the LS1028A-RDB (&enetc_port3), but U-Boot, which passes a MAC address to Linux' device tree through the /aliases node, fails to do this for this newly enabled port. Fix that by adding more ethernet aliases in the only backwards-compatible way possible: at the end of the current list. And since it is possible to very easily convert either swp4 or swp5 to DSA user ports now (which have a MAC address of their own), using these U-Boot commands: => fdt addr $fdt_addr_r => fdt rm /soc/pcie@1f0000000/ethernet-switch@0,5/ports/port@4 ethernet it would be good if those DSA user ports (swp4, swp5) gained a valid MAC address from U-Boot as well. In order for that to work properly, provision two more ethernet aliases for &mscc_felix_port{4,5} as well. The resulting ordering is slightly unusual, but to me looks more natural than eno0, eno2, swp0, swp1, swp2, swp3, eno3, swp4, swp5. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit d314fd245d24a2ec5e6389817dd29cd3b907504a Author: Joy Zou Date: Mon Sep 5 16:39:23 2022 +0800 arm64: dts: imx8mq: update sdma node name format Node names should be generic, so change the sdma node name format 'sdma' into 'dma-controller'. Signed-off-by: Joy Zou Signed-off-by: Shawn Guo commit aff77421f13f28bff9a1900a1fdedb21a02149e5 Author: Peng Fan Date: Mon Sep 5 13:59:15 2022 +0800 arm64: dts: imx93: add lpspi nodes Add i.MX93 lpspi nodes Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 1225396fefea1b6e23e721779a590885f1fe9452 Author: Peng Fan Date: Mon Sep 5 13:59:14 2022 +0800 arm64: dts: imx93: add lpi2c nodes Add i.MX93 lpi2c nodes Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit b4aa33b3e51b4357e4c9728ad3a4a37b2e34ff83 Author: Peng Fan Date: Mon Sep 5 13:59:13 2022 +0800 arm64: dts: imx93: add a55 pmu Add A55 PMU node for perf usage Reviewed-by: Ye Li Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 000aed86e4039a273abfe9552beb2e83910ecb5a Author: Peng Fan Date: Mon Sep 5 13:59:12 2022 +0800 arm64: dts: imx93: add blk ctrl node Add i.MX93 BLK CTRL MIX node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 0dfb380d2492b498166bc06c29618b0e5c81a0f2 Author: Peng Fan Date: Mon Sep 5 13:59:11 2022 +0800 arm64: dts: imx93: add s4 mu node Add s4 mu node for sentinel communication Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit e41ba695713996444c224cdac869a2f36a8514c4 Author: Peng Fan Date: Mon Sep 5 13:59:10 2022 +0800 arm64: dts: imx93: add gpio clk Add the GPIO clk, otherwise GPIO may not work if clk driver disable the GPIO clk during kernel boot. Reviewed-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit f2484a9470bf04a56c14c5b1ce62a3e886d385c0 Author: Peng Fan Date: Mon Sep 5 13:59:09 2022 +0800 arm64: dts: imx93: correct SDHC clk entry DUMMY clk only works with clk_ignore_unused and bootloader enables those clks that required for SDHC work properly. Correct SDHC clk entry with real clk. Signed-off-by: Haibo Chen Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit fb4f0b69565eef4a13cf3b8534dbc0b8b5505c52 Author: Alexander Stein Date: Mon Sep 5 09:37:30 2022 +0200 arm64: dts: tqma8mpql: add USB DR support Add support for USB DR on USB1 interface. Host/Device detection is done using the usb-role-switch connector. Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Reviewed-by: Li Jun Signed-off-by: Shawn Guo commit 63a71a901021c137a1b9c23f3ac4e8882d044a39 Author: Philippe Schenker Date: Thu Sep 1 12:01:50 2022 +0200 arm64: dts: verdin-imx8mm: introduce hdmi-connector The Lontium LT8912B driver needs a HDMI connector to be connected to port 1. Introduce this connector to be enabled in a device tree overlay. Signed-off-by: Philippe Schenker Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit ac2ac9ff2dff35d0a119d4887859027813a76c2f Author: Marcel Ziswiler Date: Thu Sep 1 12:01:49 2022 +0200 arm64: dts: verdin-imx8mm: add lvds panel node Add an LVDS panel node to be extended by a device tree overlay. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 8728c63c1072869a638d9963d3621f08ad6d7874 Author: Marcel Ziswiler Date: Thu Sep 1 12:01:48 2022 +0200 arm64: dts: verdin-imx8mm: rename sn65dsi83 to sn65dsi84 Rename sn65dsi83 to sn65dsi84 as that is the exact chip used on the Verdin DSI to LVDS Adapter. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 0acd1b1cf3454d59b811313efe04a3fe9fca662c Author: Clark Wang Date: Wed Aug 31 22:25:52 2022 +0800 arm64: dts: imx8ulp: increase the clock speed of LPSPI LPSPI transfer max speed is half of the root clock. Increase the root clock speed to support faster data transmission. And update the parent clock of all i2c/spi with IMX8ULP_CLK_FROSC_DIV2 which could produce accurate clock for i2c/spi usage. Reviewed-by: Haibo Chen Reviewed-by: Jun Li Signed-off-by: Clark Wang Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit d2209e658468330152982832c1c665abf2aae810 Author: Peng Fan Date: Wed Aug 31 22:25:51 2022 +0800 arm64: dts: imx8ulp: add mailbox node Add Sentinel Message Unit(MU), Generic MU nodes. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit ed4b58fa5ae715548e9898b475709decc0e1af7b Author: Peng Fan Date: Wed Aug 31 22:25:50 2022 +0800 arm64: dts: imx8ulp: add pmu node Add i.MX8ULP pmu node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit b2ca63697b0d9b42d9121a57ebe2c07c314f3aeb Author: Peng Fan Date: Wed Aug 31 22:25:48 2022 +0800 arm64: dts: imx8ulp: correct the scmi sram node name Follow sram/sram.yaml to update the sram node name. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 7e2c9e5146b2fd66bfd6049ece0eee3db3647593 Author: Peng Fan Date: Wed Aug 31 22:25:47 2022 +0800 arm64: dts: imx8ulp: drop undocumented property in cgc The clocks and clocks-names are not documented in binding doc, and the clk-imx8ulp driver not use the undocumented property, so drop them. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 79d38f6b08eea95212b909b2dc12c8b4cb936202 Author: Martin Kepplinger Date: Fri Sep 2 10:42:16 2022 +0200 arm64: dts: imx8mq-librem5: fix mipi_csi description Properties are not documented so lead to the following error: '#address-cells', '#size-cells', 'interrupts' do not match any of the regexes: 'pinctrl-[0-9]+' Fix this by removing unneeded properties. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 2d43092e324357f41ed1988b246909fc76b4fe0e Author: Angus Ainslie Date: Fri Sep 2 10:42:15 2022 +0200 arm64: dts: imx8mq-librem5: add usb-role-switch property to dwc3 In order to enable (PD and data) role switching on the Librem 5 phone, add the usb-role-switch property to imx8mq's dwc3 node. Signed-off-by: Angus Ainslie Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 6ba73ecff00a5d49e7eaf3dcf659cadfe05c81ff Author: Angus Ainslie Date: Fri Sep 2 10:42:14 2022 +0200 arm64: dts: imx8mq-librem5: add USB type-c properties for role switching Add the connector properties to the USB type-c stanza to enable (PD) role-switching on the Librem 5 phone. Signed-off-by: Angus Ainslie Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 6effe295e1a87408033c29dbcea9d5a5c8b937d5 Author: Sebastian Krzyszkowiak Date: Fri Sep 2 10:42:13 2022 +0200 arm64: dts: imx8mq-librem5: Add bq25895 as max17055's power supply This allows the userspace to notice that there's not enough current provided to charge the battery, and also fixes issues with 0% SOC values being considered invalid. Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit c504745d821e1e74157a5e942888ad9b14248042 Author: Guido Günther Date: Fri Sep 2 10:42:12 2022 +0200 arm64: dts: imx8mq-librem5: add RGB pwm notification leds Describe the RGB notification leds on the Librem 5 phone. Use the common defines so we're sure to adhere to the common patterns, use predefined led colors and functions so we're being warned in case of deprecations. Signed-off-by: Guido Günther Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit f00df2bdb5122265fc535ac05fa0add3f5fa18b8 Author: Martin Kepplinger Date: Fri Sep 2 10:42:11 2022 +0200 arm64: dts: imx8mq-librem5: describe the voice coil motor for focus control Describe the focus motor that will be used for the rear camera - even though the rear camera sensor driver is not yet in the mainline. The focus motor is a separate device and can be controlled already. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 68ad0821fc7c95983e46d6c9fa5ff1ff689c9b6c Author: Vladimir Oltean Date: Wed Aug 31 19:01:24 2022 +0300 arm64: dts: ls1028a: enable swp5 and eno3 for all boards In order for the LS1028A based boards to benefit from support for multiple CPU ports, the second DSA master and its associated CPU port must be enabled in the device trees. This does not change the default CPU port from the current port 4. Signed-off-by: Vladimir Oltean Acked-by: Michael Walle Signed-off-by: Shawn Guo commit d72e3b4e76db2a4f2f8d16d953e1cc715d82346a Author: Vladimir Oltean Date: Wed Aug 31 19:01:23 2022 +0300 arm64: dts: ls1028a: mark enetc port 3 as a DSA master too The LS1028A switch has 2 internal links to the ENETC controller. With DSA's ability to support multiple CPU ports, we should mark both ENETC ports as DSA masters. Signed-off-by: Vladimir Oltean Reviewed-by: Michael Walle Signed-off-by: Shawn Guo commit b340ee0263f44fd598d112ca644a0e2e8f16631b Author: Vladimir Oltean Date: Wed Aug 31 19:01:22 2022 +0300 arm64: dts: ls1028a: move DSA CPU port property to the common SoC dtsi Since the CPU port 4 of the switch is hardwired inside the SoC to go to the enetc port 2, this shouldn't be something that the board files need to set (but whether that CPU port is used or not is another discussion). So move the DSA "ethernet" property to the common dtsi. Signed-off-by: Vladimir Oltean Acked-by: Michael Walle Signed-off-by: Shawn Guo commit d5065050006461f1e859aec7853bd62ac8739af5 Author: Richard Zhu Date: Fri Sep 2 16:58:02 2022 +0800 arm64: dts: imx8mp-evk: Add PCIe support Add PCIe support on i.MX8MP EVK board. Signed-off-by: Richard Zhu Tested-by: Marek Vasut Tested-by: Richard Leitner Tested-by: Alexander Stein Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 9e65987b9584de3e3d15ec0c6b0267107c603e6b Author: Richard Zhu Date: Fri Sep 2 16:58:01 2022 +0800 arm64: dts: imx8mp: Add iMX8MP PCIe support Add i.MX8MP PCIe support. Signed-off-by: Richard Zhu Tested-by: Marek Vasut Tested-by: Richard Leitner Tested-by: Alexander Stein Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 7db9905d48e1b9a97a28224c5a201262ebce7489 Author: Marcel Ziswiler Date: Fri Aug 26 21:22:50 2022 +0200 arm64: dts: imx8ulp: no executable source file permission This fixes the following error: arch/arm64/boot/dts/freescale/imx8ulp-pinfunc.h: error: do not set execute permissions for source files Signed-off-by: Marcel Ziswiler Acked-by: Peng Fan Signed-off-by: Shawn Guo commit 4dcb6c0fef5daf0127652ededde7391a4b07e58f Author: Marek Vasut Date: Tue Aug 23 18:56:02 2022 +0200 arm64: dts: imx8mp: Add SNVS LPGPR Add SNVS LPGPR bindings to MX8M Plus, the LPGPR is used to store e.g. boot counter. Signed-off-by: Marek Vasut Reviewed-by: Fabio Estevam Reviewed-by: Alexander Stein Signed-off-by: Shawn Guo commit f703b6026d0a7c3d8a23ad5e219048f7a59bffea Author: Martyn Welch Date: Tue Aug 23 15:01:22 2022 +0100 arm64: dts: imx8mp-msc-sm2s: Add device trees for MSC SM2S-IMX8PLUS SoM and carrier board Add device trees for one of a number of MSC's (parent company, Avnet) variants of the SM2S-IMX8PLUS system on module along with the compatible SM2S-SK-AL-EP1 carrier board. As the name suggests, this family of SoMs use the NXP i.MX8MP SoC and provide the SMARC module interface. Signed-off-by: Martyn Welch Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 4d50d2bf0e418f9000e242d4df6cc292509a568e Author: Jagan Teki Date: Tue Aug 23 18:23:25 2022 +0530 arm64: dts: imx8mm: Fix typo in license text for Engicam boards Fix the Amarula Solutions typo mistake in license text for Engicam i.MX8M boards add in below commits. commit <60ac35268f85b> ("arm64: dts: imx8mm: Add Engicam i.Core MX8M Mini SoM") commit ("arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit") commit ("arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM") Signed-off-by: Jagan Teki Signed-off-by: Shawn Guo commit b57f7d214189a2a6c0ff8a8883d5d178796b69fd Author: Peng Fan Date: Tue Aug 23 11:02:13 2022 +0800 arm64: dts: imx8-ss-dma: add IPG clock for i2c i.MX8 LPI2C requires both PER and IPG clock, so add the missed IPG clk. Reviewed-by: Dong Aisheng Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit de9618e84f763a0236679d2eb5c9a6207ec2eb92 Author: Frieder Schrempf Date: Mon Aug 22 10:03:54 2022 +0200 arm64: dts: Add support for Kontron SL/BL i.MX8MM OSM-S This adds support for the Kontron Electronics SL i.MX8MM OSM-S SoM and the matching baseboard BL i.MX8MM OSM-S. The SoM hardware complies to the Open Standard Module (OSM) 1.0 specification, size S (https://sget.org/standards/osm). Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit b63791966edff822297f6690c67dbba3f032be73 Author: Frieder Schrempf Date: Mon Aug 22 10:03:53 2022 +0200 arm64: dts: imx8mm-kontron: Add SPI NOR partition layout This is the layout used by the bootloader. Add it to the kernel devicetree to make the same layout available in Linux and have the devicetrees synced. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 9cb41873f8e1e91422ec591910124ea6094ede3f Author: Frieder Schrempf Date: Mon Aug 22 10:03:52 2022 +0200 arm64: dts: imx8mm-kontron: Use voltage rail names from schematic for PMIC regulator-names Improve the naming of the regulators to contain the voltage rail names from the schematic. Suggested-by: Heiko Thiery Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 3e44946da2273d84107823838f6a40588dc2b2a7 Author: Frieder Schrempf Date: Mon Aug 22 10:03:51 2022 +0200 arm64: dts: imx8mm-kontron: Remove low DDRC operating point For some reason there is a problem with finding a DDR configuration that works on all operating points and all LPDDR4 types used on the SoM. Therefore the bootloader currently doesn't configure the lowest of the three operating points. Let's also skip this in the kernel devicetree to make sure it isn't used. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit eef2c0217e02b6c7ed5b10b82ea944127145e113 Author: Frieder Schrempf Date: Mon Aug 22 10:03:50 2022 +0200 arm64: dts: imx8mm-kontron: Use the VSELECT signal to switch SD card IO voltage It turns out that it is not necessary to declare the VSELECT signal as GPIO and let the PMIC driver set it to a fixed high level. This switches the voltage between 3.3V and 1.8V by setting the PMIC register for LDO5 accordingly. Instead we can do it like other boards already do and simply mux the VSELECT signal of the USDHC interface to the pin. This makes sure that the correct voltage is selected by setting the PMIC's SD_VSEL input to high or low accordingly. Reported-by: Heiko Thiery Signed-off-by: Frieder Schrempf Reviewed-by: Heiko Thiery Signed-off-by: Shawn Guo commit 587c1fed72b314003c9f0346a6466158fa20563f Author: Frieder Schrempf Date: Mon Aug 22 10:03:49 2022 +0200 arm64: dts: imx8mm-kontron: Adjust compatibles, file names and model strings The official naming includes "SL" (SoM-Line) or "BL" (Board-Line). By updating we make sure, that we can maintain this more easily in future and make sure that the proper devicetree can be selected for the hardware. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit a763d0cf290a117a133b7cace5da7afebc009b9b Author: Peng Fan Date: Mon Aug 22 14:45:36 2022 +0800 arm64: dts: imx8mp: add VPU blk ctrl node Add i.MX8MP VPU blk ctrl node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit df680992dd62d809e0e8397e8e3c41a609b58eb1 Author: Peng Fan Date: Mon Aug 22 14:45:35 2022 +0800 arm64: dts: imx8mp: add vpu pgc nodes Add i.MX8MP PGC nodes for vpu, which are used to supply power for VPU. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 310dde60ddde8ff0e7ef7b164025dc9b9a4a1445 Author: Max Krummenacher Date: Mon Aug 22 09:53:42 2022 +0200 arm64: dts: imx8mp-verdin: add cpu-supply Add the cpu-supply property to all CPU nodes to enable the cpufreq driver. Signed-off-by: Max Krummenacher Reviewed-by: Laurent Pinchart Signed-off-by: Shawn Guo commit 8130fa71089a1a30a0686e84b0c0fa1af10723c4 Author: Tim Harvey Date: Fri Aug 12 10:23:34 2022 -0700 arm64: dts: imx8mm-venice-gw7903: add digital I/O ctl gpios The GW7903-C revision introduced two additional GPIO's for controlling the digital I/O direction. Add them. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 37bbb8b2f919ed4ea9e0f2529950aa4b8b31d5e0 Author: Fabio Estevam Date: Thu Aug 4 14:59:43 2022 -0300 arm64: dts: imx8mm/n-venice-gw7902: Remove invalid property The 'oscillator-frequency' property is not documented and it is not used anywhere. Remove it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit dcc80ddbc3a602731464c1baa8f22403ec62e915 Author: Marek Vasut Date: Sun Jul 24 22:47:41 2022 +0200 arm64: dts: imx8mp: Add SoM compatible to i.MX8M Plus DHCOM PDK2 Add SoM compatible string into i.MX8MP DHCOM PDK2 compatible strings. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 6007e21018f6d4fbd55743e19615505b4a65247f Author: Marek Vasut Date: Sun Jul 24 22:47:01 2022 +0200 arm64: dts: imx8mp: Drop Atheros PHY header from i.MX8M Plus DHCOM PDK2 This PHY is not used on PDK2, the header was added due to copy-paste error, drop it. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit ceefe3d5f11f24d4a34369739d82c79c626abdc4 Author: Marek Vasut Date: Sun Jul 24 22:46:36 2022 +0200 arm64: dts: imx8mp: Add HW variant details to i.MX8M Plus DHCOM PDK2 Add information about which exact SoM variant is used on which PDK2 variant. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 7e819a2d921ea2e6513bdb1e8fff3e98abf44681 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:44 2022 +0200 arm64: dts: mnt-reform2: don't use multiple blank lines Avoid the following checkpatch warning: arch/arm/boot/dts/imx8mq-mnt-reform2.dts:213: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Acked-by: Lucas Stach Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 6fd44214f5f975e210b2911625b8dd1c1d7bcde5 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:43 2022 +0200 arm64: dts: imx8mp-verdin: don't use multiple blank lines Avoid the following checkpatch warning: arch/arm/boot/dts/imx8mp-verdin.dtsi:281: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Reviewed-by: Laurent Pinchart Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7e431a93e86cc16f1723f2d5b342a4b127e46d9d Author: Marcel Ziswiler Date: Fri Jul 22 23:54:42 2022 +0200 arm64: dts: imx8mm-venice-gw72xx-0x: blank line at end of file Avoid the following checkpatch warning: Found possible blank line(s) at end of file 'arch/arm/boot/dts/imx8mm-venice-gw72xx-0x.dts' Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1170826e1a3de7ae3e1f6b2016d54ea4787ef1d4 Author: Wei Fang Date: Wed Jul 27 00:38:53 2022 +1000 arm64: dts: imx8ulp-evk: Add the fec support Enable the fec on i.MX8ULP EVK board. Signed-off-by: Wei Fang Signed-off-by: Shawn Guo commit 683d7ffb7daaab1d48344cc17bdea17007dddd8c Author: Wei Fang Date: Wed Jul 27 00:38:52 2022 +1000 arm64: dts: imx8ulp: Add the fec support Add the fec support on i.MX8ULP platforms. Signed-off-by: Wei Fang Reviewed-by: Ahmad Fatoum Signed-off-by: Shawn Guo commit 31da63e1326c40cd141791ac069381998ae3e92d Author: Peng Fan Date: Fri Jul 8 16:56:32 2022 +0800 arm64: dts: imx8mp: add interconnect for hsio blk ctrl Add interconnect property for hsio blk ctrl Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 3175c70686c4162a5e087eba16595bae8c19b04d Author: Peng Fan Date: Fri Jul 8 16:56:31 2022 +0800 arm64: dts: imx8mp: add interconnects for media blk ctrl Add interconnect property for media blk ctrl Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit e9aa77d413c903ba4cf7da3fe0b419cae5b97a81 Author: Peng Fan Date: Tue Sep 6 11:28:15 2022 +0800 soc: imx: add i.MX93 media blk ctrl driver Add i.MX93 mediamix blk ctrl support. i.MX93 mediamix blk ctrl has registers to set QoS(priority) value. It support default QoS value and cfg QoS value. Set an initial value from i.MX design team. If LCDIF/ISI/PXP wanna a different QoS value in future, they could use interconnect to request bandwidth. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 0a0f7cc25d4a525a71260cbd453a848c5c8e61c3 Author: Peng Fan Date: Tue Sep 6 11:28:14 2022 +0800 soc: imx: add i.MX93 SRC power domain driver Support controlling power domain managed by System Reset Controller(SRC). Current supported power domain is mediamix power domain. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit df5a69653586da355b9a88e7851752dc62daa5fd Author: Peng Fan Date: Tue Sep 6 11:39:43 2022 +0800 soc: imx: imx8m-blk-ctrl: Use genpd_xlate_onecell Simplify driver by using genpd_xlate_onecell instead of driver specific xlate function. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 5506018d3dec41e6678efb92b836586e9ee1d628 Author: Lucas Stach Date: Fri Sep 2 16:58:04 2022 +0800 soc: imx: imx8mp-blk-ctrl: handle PCIe PHY resets Dessert the PHY reset when powering up the domain and put it back into reset when the domain is powered down. Signed-off-by: Lucas Stach Signed-off-by: Richard Zhu Signed-off-by: Shawn Guo commit a1a5f15f7f6cb5c291f072af843305638c935be6 Author: Peng Fan Date: Mon Aug 22 14:45:34 2022 +0800 soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl i.MX8MP has a VPU blk ctrl module that could supply clk and reset to VPU, so add support for it. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 77b0ddb42add47748c661f714e6f4b116a6e8759 Author: Peng Fan Date: Mon Aug 22 14:45:33 2022 +0800 soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV_MWR i.MX8MP HDMI supports HDCP and HRV_MWR(HDMI RX Video Memory Write Master for RXRX validation), so add them. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 50299fa1f8a05fa8b545e3d64e183b525737fabb Author: Peng Fan Date: Fri Jul 8 16:56:30 2022 +0800 soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl Add interconnect paths for i.MX8MP hsio/hdmi blk ctrl Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit c553ca9245f4ee7db54dc48c5892be787f8458a4 Author: Peng Fan Date: Fri Jul 8 16:56:29 2022 +0800 soc: imx: add icc paths for i.MX8MP media blk ctrl Add interconnect paths for i.MX8MP media blk ctrl Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 64e61a940d96184d294f431848a28765f44525fa Author: Shenwei Wang Date: Wed Sep 14 08:58:45 2022 -0500 dt-bindings: arm: imx: update fsl.yaml for imx8dxl i.MX8DXL is a device targeting the automotive and industrial market segments. The chip is designed to achieve both high performance and low power consumption. It has a dual (2x) Cortex-A35 processor. Signed-off-by: Shenwei Wang Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit c09cc6e528c30aee0637d68249b23e74299b9b55 Author: Shenwei Wang Date: Wed Sep 14 08:58:44 2022 -0500 dt-bindings: firmware: add missing resource IDs for imx8dxl Add the missing resource IDs for imx8dxl. Signed-off-by: Shenwei Wang Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 6128972adba6c61e98fa17c7335a4188b46ef19e Author: Tim Harvey Date: Mon Sep 12 11:18:18 2022 -0700 dt-bindings: arm: Add i.MX8M Mini Gateworks GW7904 board Add DT compatible string for i.MX8M Mini based Gateworks GW7904 board. Signed-off-by: Tim Harvey Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 121494030c533a9e390ba82b370619d1e0bad7a1 Author: Peng Fan Date: Tue Sep 6 11:28:13 2022 +0800 dt-bindings: soc: add i.MX93 mediamix blk ctrl Add DT bindings for i.MX93 MEDIAMIX BLK CTRL. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 4fed4d20c59b338d9f5ce3dd11820d09ed4e8546 Author: Peng Fan Date: Tue Sep 6 11:28:12 2022 +0800 dt-bindings: soc: add i.MX93 SRC Add bindings for i.MX93 System Reset Controller(SRC). SRC supports resets and power gating for mixes. Reviewed-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 7a8a4471633a8f644e06cfe0672df672cd299305 Author: Peng Fan Date: Mon Sep 5 13:59:08 2022 +0800 dt-bindings: mfd: syscon: Add i.MX93 blk ctrl system registers Document i.MX93 BLK CTRL system registers. Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit b08047d63ca0da493f6d83a3d6af99e2223aea1c Author: Martyn Welch Date: Tue Aug 23 15:01:21 2022 +0100 dt-bindings: arm: fsl: Add MSC SM2S-IMX8PLUS SoM and SM2-MB-EP1 Carrier Add DT compatible strings for a combination of the 14N0600E variant of the Avnet (MSC branded) SM2S-IMX8PLUS SoM on it's own and in combination with the SM2-MB-EP1 carrier board. Signed-off-by: Martyn Welch Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 25b189646787271116a856840700efbf31f14551 Author: Frieder Schrempf Date: Mon Aug 22 10:03:48 2022 +0200 dt-bindings: arm: fsl: Add Kontron BL i.MX8MM OSM-S board Add bindings for the Kontron BL i.MX8MM OSM-S board. Signed-off-by: Frieder Schrempf Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 9d820e6581a87060eb6269acebc608ccdf5aa8b3 Author: Frieder Schrempf Date: Mon Aug 22 10:03:47 2022 +0200 dt-bindings: arm: fsl: Rename compatibles for Kontron i.MX8MM SoM/board This updates the bindings in order to use names for the boards that follow the latest convention used by Kontron marketing. By updating we make sure, that we can maintain this more easily in future and make sure that the proper devicetree can be selected for the hardware. Signed-off-by: Frieder Schrempf Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit c7ebd54158d36a5b451743afac2376bdd0b2ba61 Author: Peng Fan Date: Mon Aug 22 14:45:32 2022 +0800 dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse the i.MX8MM VPU blk ctrl yaml file. And add description for the items. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 2345fc8dc2ecf1643ea369e00af7a1b97add879d Author: Peng Fan Date: Mon Aug 22 14:45:31 2022 +0800 dt-bindings: soc: imx: add interconnect property for i.MX8MM vpu blk ctrl i.MX8MM VPU support NoC QoS setting, so add interconnect property for i.MX8MM VPU blk ctrl Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit c1d9381ce430eacd41c0b71fab75b44bf1a55dfe Author: Peng Fan Date: Mon Aug 22 14:45:30 2022 +0800 dt-bindings: soc: imx: drop minItems for i.MX8MM vpu blk ctrl minItems and maxItems are set as the same value. In such case minItems is not necessary. So drop it. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 69e43d9e83dd8695d2dc39ce910f61dfb676f4bf Author: Peng Fan Date: Mon Aug 22 14:45:29 2022 +0800 dt-bindings: power: imx8mp-power: add HDMI HDCP/HRV Add i.MX8MP HDMI HDCP and HRV entries. Acked-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 3627a8139da7584f4227d475963de558a842a31f Author: Frieder Schrempf Date: Mon Aug 15 10:28:10 2022 +0200 dt-bindings: arm: fsl: imx6ul-kontron: Update bindings This updates the bindings in order to simplify the devicetree structure and to add names for the boards that follow the latest convention used by Kontron marketing. It also gets rid of the N6xxx notation in the compatibles and file names, as they are not really used anymore and often result in confusion. This is a breaking change, but the impact shouldn't be too big and it makes usage and maintenance easier in the future. Signed-off-by: Frieder Schrempf Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 402de4bfb3d0c4819aad7bd487b3bc9319148eeb Author: Marcel Ziswiler Date: Fri Jul 22 23:54:45 2022 +0200 dt-bindings: clk: imx8mm: don't use multiple blank lines Avoid the following checkpatch warning: include/dt-bindings/clock/imx8mm-clock.h:284: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7883017bbcc55fcb1888add3dc825e112d7ae336 Author: Yang Yingliang Date: Fri Sep 16 22:11:08 2022 +0800 ALSA: ppc: Switch to use for_each_child_of_node() macro Use for_each_child_of_node() macro instead of open coding it. No functional change. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220916141108.683080-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai commit b7fd68ac27200b917ce4494c591858194e584634 Author: Tim Harvey Date: Fri Sep 16 08:31:07 2022 -0700 ARM: dts: imx6qdl-gw54xx: add CAN regulator The GW54xx has a transceiver with a STBY pin connected to an IMX6 GPIO. Configure this as a regulator to drive it low when CAN is in use. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit ad928a743db8ccfae0939e2483cf65addca4a593 Author: Tim Harvey Date: Fri Sep 16 08:30:02 2022 -0700 ARM: dts: imx6qdl-gw53xx: add CAN regulator The GW53xx has a transceiver with a STBY pin connected to an IMX6 GPIO. Configure this as a regulator to drive it low when CAN is in use. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 2069c5265bb369c155b92c4ddf50ae7cc7e592c3 Author: Tim Harvey Date: Fri Sep 16 08:28:36 2022 -0700 ARM: dts: imx6qdl-gw52xx: add CAN regulator The GW52xx has a transceiver with a STBY pin connected to an IMX6 GPIO. Configure this as a regulator to drive it low when CAN is in use. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 571f9738bfb3d4b42253c1d0ad26da9fede85f36 Author: Peilin Ye Date: Fri Sep 16 13:28:00 2022 -0700 bpf/btf: Use btf_type_str() whenever possible We have btf_type_str(). Use it whenever possible in btf.c, instead of "btf_kind_str[BTF_INFO_KIND(t->info)]". Signed-off-by: Peilin Ye Link: https://lore.kernel.org/r/20220916202800.31421-1-yepeilin.cs@gmail.com Signed-off-by: Martin KaFai Lau commit 1f04b07d976da0666dbc2b170634c5531974dfa1 Author: Thomas Gleixner Date: Thu Aug 25 09:51:36 2022 +0200 slub: Make PREEMPT_RT support less convoluted The slub code already has a few helpers depending on PREEMPT_RT. Add a few more and get rid of the CONFIG_PREEMPT_RT conditionals all over the place. No functional change. Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: Christoph Lameter Cc: David Rientjes Cc: Joonsoo Kim Cc: Pekka Enberg Cc: Vlastimil Babka Cc: linux-mm@kvack.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 5875e59828a026e47f37c5e343f4fe8e0ba023b9 Author: Vlastimil Babka Date: Tue Aug 23 19:04:00 2022 +0200 mm/slub: simplify __cmpxchg_double_slab() and slab_[un]lock() The PREEMPT_RT specific disabling of irqs in __cmpxchg_double_slab() (through slab_[un]lock()) is unnecessary as bit_spin_lock() disables preemption and that's sufficient on PREEMPT_RT where no allocation/free operation is performed in hardirq context and so can't interrupt the current operation. That means we no longer need the slab_[un]lock() wrappers, so delete them and rename the current __slab_[un]lock() to slab_[un]lock(). Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Sebastian Andrzej Siewior commit 4ef3f5a32051def596b2d445462a1dccda7af600 Author: Vlastimil Babka Date: Tue Aug 23 19:03:59 2022 +0200 mm/slub: convert object_map_lock to non-raw spinlock The only remaining user of object_map_lock is list_slab_objects(). Obtaining the lock there used to happen under slab_lock() which implied disabling irqs on PREEMPT_RT, thus it's a raw_spinlock. With the slab_lock() removed, we can convert it to a normal spinlock. Also remove the get_map()/put_map() wrappers as list_slab_objects() became their only remaining user. Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Sebastian Andrzej Siewior commit 41bec7c33f37aaae6e3737615e2dfa17a30ea985 Author: Vlastimil Babka Date: Tue Aug 23 19:03:58 2022 +0200 mm/slub: remove slab_lock() usage for debug operations All alloc and free operations on debug caches are now serialized by n->list_lock, so we can remove slab_lock() usage in validate_slab() and list_slab_objects() as those also happen under n->list_lock. Note the usage in list_slab_objects() could happen even on non-debug caches, but only during cache shutdown time, so there should not be any parallel freeing activity anymore. Except for buggy slab users, but in that case the slab_lock() would not help against the common cmpxchg based fast paths (in non-debug caches) anyway. Also adjust documentation comments accordingly. Suggested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes commit c7323a5ad0786371f61dca49fc26f7ab3a68e0da Author: Vlastimil Babka Date: Tue Aug 23 19:03:57 2022 +0200 mm/slub: restrict sysfs validation to debug caches and make it safe Rongwei Wang reports [1] that cache validation triggered by writing to /sys/kernel/slab//validate is racy against normal cache operations (e.g. freeing) in a way that can cause false positive inconsistency reports for caches with debugging enabled. The problem is that debugging actions that mark object free or active and actual freelist operations are not atomic, and the validation can see an inconsistent state. For caches that do or don't have debugging enabled, additional races involving n->nr_slabs are possible that result in false reports of wrong slab counts. This patch attempts to solve these issues while not adding overhead to normal (especially fastpath) operations for caches that do not have debugging enabled. Such overhead would not be justified to make possible userspace-triggered validation safe. Instead, disable the validation for caches that don't have debugging enabled and make their sysfs validate handler return -EINVAL. For caches that do have debugging enabled, we can instead extend the existing approach of not using percpu freelists to force all alloc/free operations to the slow paths where debugging flags is checked and acted upon. There can adjust the debug-specific paths to increase n->list_lock coverage against concurrent validation as necessary. The processing on free in free_debug_processing() already happens under n->list_lock so we can extend it to actually do the freeing as well and thus make it atomic against concurrent validation. As observed by Hyeonggon Yoo, we do not really need to take slab_lock() anymore here because all paths we could race with are protected by n->list_lock under the new scheme, so drop its usage here. The processing on alloc in alloc_debug_processing() currently doesn't take any locks, but we have to first allocate the object from a slab on the partial list (as debugging caches have no percpu slabs) and thus take the n->list_lock anyway. Add a function alloc_single_from_partial() that grabs just the allocated object instead of the whole freelist, and does the debug processing. The n->list_lock coverage again makes it atomic against validation and it is also ultimately more efficient than the current grabbing of freelist immediately followed by slab deactivation. To prevent races on n->nr_slabs updates, make sure that for caches with debugging enabled, inc_slabs_node() or dec_slabs_node() is called under n->list_lock. When allocating a new slab for a debug cache, handle the allocation by a new function alloc_single_from_new_slab() instead of the current forced deactivation path. Neither of these changes affect the fast paths at all. The changes in slow paths are negligible for non-debug caches. [1] https://lore.kernel.org/all/20220529081535.69275-1-rongwei.wang@linux.alibaba.com/ Reported-by: Rongwei Wang Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 8401bd361f5991ccfe9377e502fa37203ad70320 Author: Javier Martinez Canillas Date: Tue Sep 13 18:23:07 2022 +0200 drm/plane-helper: Add a drm_plane_helper_atomic_check() helper Provides a default plane state check handler for primary planes that are a fullscreen scanout buffer and whose state scale and position can't change. There are some drivers that duplicate this logic in their helpers, such as simpledrm and ssd130x. Factor out this common code into a plane helper and make drivers use it. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220913162307.121503-1-javierm@redhat.com commit 5947b7f794ca5b96fa097d8d73259aaf18878c31 Merge: 2c119d9982b1a c337f103f7781 Author: David S. Miller Date: Fri Sep 16 21:56:27 2022 +0100 Merge tag 'linux-can-next-for-6.1-20220915' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== Sept. 15, 2022, 8:19 a.m. UTC Hello Jakub, hello David, this is a pull request of 23 patches for net-next/master. the first 2 patches are by me and fix a typo in the rx-offload helper and the flexcan driver. Christophe JAILLET's patch cleans up the error handling in rcar_canfd driver's probe function. Kenneth Lee's patch converts the kvaser_usb driver from kcalloc() to kzalloc(). Biju Das contributes 2 patches to the sja1000 driver which update the DT bindings and support for the RZ/N1 SJA1000 CAN controller. Jinpeng Cui provides 2 patches that remove redundant variables from the sja1000 and kvaser_pciefd driver. 2 patches by John Whittington and me add hardware timestamp support to the gs_usb driver. Gustavo A. R. Silva's patch converts the etas_es58x driver to make use of DECLARE_FLEX_ARRAY(). Krzysztof Kozlowski's patch cleans up the sja1000 DT bindings. Dario Binacchi fixes his invalid email in the flexcan driver documentation. Ziyang Xuan contributes 2 patches that clean up the CAN RAW protocol. Yang Yingliang's patch switches the flexcan driver to dev_err_probe(). The last 7 patches are by Oliver Hartkopp and add support for the next generation of the CAN protocol: CAN with eXtended data Length (CAN XL). ==================== Signed-off-by: David S. Miller commit dc567045f1590f6460d3e9a6ea6ad5e600b58b84 Author: Xin Liu Date: Tue Sep 13 15:36:43 2022 +0800 libbpf: Clean up legacy bpf maps declaration in bpf_helpers Legacy BPF map declarations are no longer supported in libbpf v1.0 [0]. Only BTF-defined maps are supported starting from v1.0, so it is time to remove the definition of bpf_map_def in bpf_helpers.h. [0] https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0 Signed-off-by: Xin Liu Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220913073643.19960-1-liuxin350@huawei.com commit 2c119d9982b1aba54a2eca59c2455cd09f3bc749 Author: Arun Ramadoss Date: Wed Sep 7 12:50:39 2022 +0530 net: dsa: microchip: add the support for set_ageing_time KSZ9477 has the 11 bit ageing count value which is split across the two registers. And LAN937x has the 20 bit ageing count which is also split into two registers. Each count in the registers represents 1 second. This patch add the support for ageing time for KSZ9477 and LAN937x series of switch. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit c8bc5e0509767e51b35ae2f4af6ff90fa6a5f27f Author: Andrii Nakryiko Date: Fri Sep 9 12:30:53 2022 -0700 selftests/bpf: Add veristat tool for mass-verifying BPF object files Add a small tool, veristat, that allows mass-verification of a set of *libbpf-compatible* BPF ELF object files. For each such object file, veristat will attempt to verify each BPF program *individually*. Regardless of success or failure, it parses BPF verifier stats and outputs them in human-readable table format. In the future we can also add CSV and JSON output for more scriptable post-processing, if necessary. veristat allows to specify a set of stats that should be output and ordering between multiple objects and files (e.g., so that one can easily order by total instructions processed, instead of default file name, prog name, verdict, total instructions order). This tool should be useful for validating various BPF verifier changes or even validating different kernel versions for regressions. Here's an example for some of the heaviest selftests/bpf BPF object files: $ sudo ./veristat -s insns,file,prog {pyperf,loop,test_verif_scale,strobemeta,test_cls_redirect,profiler}*.linked3.o File Program Verdict Duration, us Total insns Total states Peak states ------------------------------------ ------------------------------------ ------- ------------ ----------- ------------ ----------- loop3.linked3.o while_true failure 350990 1000001 9663 9663 test_verif_scale3.linked3.o balancer_ingress success 115244 845499 8636 2141 test_verif_scale2.linked3.o balancer_ingress success 77688 773445 3048 788 pyperf600.linked3.o on_event success 2079872 624585 30335 30241 pyperf600_nounroll.linked3.o on_event success 353972 568128 37101 2115 strobemeta.linked3.o on_event success 455230 557149 15915 13537 test_verif_scale1.linked3.o balancer_ingress success 89880 554754 8636 2141 strobemeta_nounroll2.linked3.o on_event success 433906 501725 17087 1912 loop6.linked3.o trace_virtqueue_add_sgs success 282205 398057 8717 919 loop1.linked3.o nested_loops success 125630 361349 5504 5504 pyperf180.linked3.o on_event success 2511740 160398 11470 11446 pyperf100.linked3.o on_event success 744329 87681 6213 6191 test_cls_redirect.linked3.o cls_redirect success 54087 78925 4782 903 strobemeta_subprogs.linked3.o on_event success 57898 65420 1954 403 test_cls_redirect_subprogs.linked3.o cls_redirect success 54522 64965 4619 958 strobemeta_nounroll1.linked3.o on_event success 43313 57240 1757 382 pyperf50.linked3.o on_event success 194355 46378 3263 3241 profiler2.linked3.o tracepoint__syscalls__sys_enter_kill success 23869 43372 1423 542 pyperf_subprogs.linked3.o on_event success 29179 36358 2499 2499 profiler1.linked3.o tracepoint__syscalls__sys_enter_kill success 13052 27036 1946 936 profiler3.linked3.o tracepoint__syscalls__sys_enter_kill success 21023 26016 2186 915 profiler2.linked3.o kprobe__vfs_link success 5255 13896 303 271 profiler1.linked3.o kprobe__vfs_link success 7792 12687 1042 1041 profiler3.linked3.o kprobe__vfs_link success 7332 10601 865 865 profiler2.linked3.o kprobe_ret__do_filp_open success 3417 8900 216 199 profiler2.linked3.o kprobe__vfs_symlink success 3548 8775 203 186 pyperf_global.linked3.o on_event success 10007 7563 520 520 profiler3.linked3.o kprobe_ret__do_filp_open success 4708 6464 532 532 profiler1.linked3.o kprobe_ret__do_filp_open success 3090 6445 508 508 profiler3.linked3.o kprobe__vfs_symlink success 4477 6358 521 521 profiler1.linked3.o kprobe__vfs_symlink success 3381 6347 507 507 profiler2.linked3.o raw_tracepoint__sched_process_exec success 2464 5874 292 189 profiler3.linked3.o raw_tracepoint__sched_process_exec success 2677 4363 397 283 profiler2.linked3.o kprobe__proc_sys_write success 1800 4355 143 138 profiler1.linked3.o raw_tracepoint__sched_process_exec success 1649 4019 333 240 pyperf600_bpf_loop.linked3.o on_event success 2711 3966 306 306 profiler2.linked3.o raw_tracepoint__sched_process_exit success 1234 3138 83 66 profiler3.linked3.o kprobe__proc_sys_write success 1755 2623 223 223 profiler1.linked3.o kprobe__proc_sys_write success 1222 2456 193 193 loop2.linked3.o while_true success 608 1783 57 30 profiler3.linked3.o raw_tracepoint__sched_process_exit success 789 1680 146 146 profiler1.linked3.o raw_tracepoint__sched_process_exit success 592 1526 133 133 strobemeta_bpf_loop.linked3.o on_event success 1015 1512 106 106 loop4.linked3.o combinations success 165 524 18 17 profiler3.linked3.o raw_tracepoint__sched_process_fork success 196 299 25 25 profiler1.linked3.o raw_tracepoint__sched_process_fork success 109 265 19 19 profiler2.linked3.o raw_tracepoint__sched_process_fork success 111 265 19 19 loop5.linked3.o while_true success 47 84 9 9 ------------------------------------ ------------------------------------ ------- ------------ ----------- ------------ ----------- Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220909193053.577111-4-andrii@kernel.org commit 749c202cb6ea40f4d7ac95c4a1217a7b506f43a8 Author: Andrii Nakryiko Date: Fri Sep 9 12:30:52 2022 -0700 libbpf: Fix crash if SEC("freplace") programs don't have attach_prog_fd set Fix SIGSEGV caused by libbpf trying to find attach type in vmlinux BTF for freplace programs. It's wrong to search in vmlinux BTF and libbpf doesn't even mark vmlinux BTF as required for freplace programs. So trying to search anything in obj->vmlinux_btf might cause NULL dereference if nothing else in BPF object requires vmlinux BTF. Instead, error out if freplace (EXT) program doesn't specify attach_prog_fd during at the load time. Fixes: 91abb4a6d79d ("libbpf: Support attachment of BPF tracing programs to kernel modules") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220909193053.577111-3-andrii@kernel.org commit cf060c2c399fa457569123bb9806b455ff53e64c Author: Andrii Nakryiko Date: Fri Sep 9 12:30:51 2022 -0700 selftests/bpf: Fix test_verif_scale{1,3} SEC() annotations Use proper SEC("tc") for test_verif_scale{1,3} programs. It's not a problem for selftests right now because we manually set type programmatically, but not having correct SEC() definitions makes it harded to generically load BPF object files. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220909193053.577111-2-andrii@kernel.org commit 233cb8a47d65715643f7608e7130b417df115d9f Author: ChiaEn Wu Date: Thu Sep 15 17:47:35 2022 +0800 power: supply: mt6370: Add MediaTek MT6370 charger driver MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight driver, display bias voltage supply, one general purpose LDO, and the USB Type-C & PD controller complies with the latest USB Type-C and PD standards. Add support for the MediaTek MT6370 Charger driver. The charger module of MT6370 supports High-Accuracy Voltage/Current Regulation, Average Input Current Regulation, Battery Temperature Sensing, Over-Temperature Protection, DPDM Detection for BC1.2. Reviewed-by: Andy Shevchenko Signed-off-by: ChiaEn Wu Signed-off-by: Sebastian Reichel commit 689af5da8543d4378aed8f74696bad59a15d5a78 Author: ChiaEn Wu Date: Thu Sep 15 17:47:29 2022 +0800 dt-bindings: power: supply: Add MediaTek MT6370 Charger Add MediaTek MT6370 Charger binding documentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: ChiaEn Wu Signed-off-by: Sebastian Reichel commit 3d568b4f4b1880b57605305f59afe644c1f383a6 Merge: 55cafd4ba42cf c2f2e2c3aecdb Author: Sebastian Reichel Date: Fri Sep 16 22:34:19 2022 +0200 Merge tag 'psy-linear-range-for-v6.1-signed' into psy-next Immutable branch between linear range and power-supply for driver changes in MT6370. Signed-off-by: Sebastian Reichel commit c2f2e2c3aecdbabf822272a4b6e7d91537633cd9 Author: ChiaEn Wu Date: Thu Sep 15 17:47:32 2022 +0800 lib: add linear range index macro Add linear_range_idx macro for declaring the linear_range struct simply. Reviewed-by: Matti Vaittinen Signed-off-by: ChiaEn Wu Signed-off-by: Sebastian Reichel commit ceea991a019c57a1fb0edd12a5f836a0fa431aee Author: Jiri Olsa Date: Sat Sep 3 15:11:54 2022 +0200 bpf: Move bpf_dispatcher function out of ftrace locations The dispatcher function is attached/detached to trampoline by dispatcher update function. At the same time it's available as ftrace attachable function. After discussion [1] the proposed solution is to use compiler attributes to alter bpf_dispatcher_##name##_func function: - remove it from being instrumented with __no_instrument_function__ attribute, so ftrace has no track of it - but still generate 5 nop instructions with patchable_function_entry(5) attribute, which are expected by bpf_arch_text_poke used by dispatcher update function Enabling HAVE_DYNAMIC_FTRACE_NO_PATCHABLE option for x86, so __patchable_function_entries functions are not part of ftrace/mcount locations. Adding attributes to bpf_dispatcher_XXX function on x86_64 so it's kept out of ftrace locations and has 5 byte nop generated at entry. These attributes need to be arch specific as pointed out by Ilya Leoshkevic in here [2]. The dispatcher image is generated only for x86_64 arch, so the code can stay as is for other archs. [1] https://lore.kernel.org/bpf/20220722110811.124515-1-jolsa@kernel.org/ [2] https://lore.kernel.org/bpf/969a14281a7791c334d476825863ee449964dd0c.camel@linux.ibm.com/ Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/bpf/20220903131154.420467-3-jolsa@kernel.org commit 9440155ccb948f8e3ce5308907a2e7378799be60 Author: Peter Zijlstra (Intel) Date: Sat Sep 3 15:11:53 2022 +0200 ftrace: Add HAVE_DYNAMIC_FTRACE_NO_PATCHABLE x86 will shortly start using -fpatchable-function-entry for purposes other than ftrace, make sure the __patchable_function_entry section isn't merged in the mcount_loc section. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220903131154.420467-2-jolsa@kernel.org commit bfeb7e399bacae4ee46ad978f5fce3e47f0978d6 Author: Yauheni Kaliuta Date: Mon Sep 5 12:01:49 2022 +0300 bpf: Use bpf_capable() instead of CAP_SYS_ADMIN for blinding decision The full CAP_SYS_ADMIN requirement for blinding looks too strict nowadays. These days given unprivileged BPF is disabled by default, the main users for constant blinding coming from unprivileged in particular via cBPF -> eBPF migration (e.g. old-style socket filters). Signed-off-by: Yauheni Kaliuta Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220831090655.156434-1-ykaliuta@redhat.com Link: https://lore.kernel.org/bpf/20220905090149.61221-1-ykaliuta@redhat.com commit ada378f374ad035b65c9bc68b153a11c83c21d54 Author: Johan Jonker Date: Sat Sep 10 00:02:30 2022 +0200 dt-bindings: i2c: rockchip: add rockchip,rk3128-i2c Add rockchip,rk3128-i2c compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit a46579194215c3676445fbfa3a48225e01f42f2b Author: Geert Uytterhoeven Date: Fri Sep 9 11:09:02 2022 +0200 dt-bindings: i2c: renesas,rcar-i2c: Add r8a779g0 support Document support for the I2C Bus Interfaces in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit 47723de8d7555edf774aad543f92f930736d204f Author: Arnd Bergmann Date: Fri Sep 16 21:53:09 2022 +0200 ARM: disallow PCI with MMU=n again My cleanup patch allowed enabling PCI on MMU-less builds, which breaks for at least one driver and is never required: In file included from include/linux/irqchip/arm-gic-v3.h:604, from drivers/pci/controller/pcie-iproc.c:17: arch/arm/include/asm/arch_gicv3.h: In function 'write_ICC_EOIR1_EL1': arch/arm/include/asm/arch_gicv3.h:44:9: error: implicit declaration of function 'write_sysreg' [-Werror=implicit-function-declaration] Fixes: 6fd09c9afa49 ("ARM: Kconfig: clean up platform selection") Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit 48cb6356fae1259fee41b2fb441f669ee330b7c4 Author: Akhil R Date: Tue Sep 6 20:17:14 2022 +0530 i2c: tegra: Add GPCDMA support Enable support for GPCDMA, which is used in I2C controllers in Tegra 186 and above. The chips before that used APB DMA. This change works under the presumption that all chips apart from those supporting APB DMA is using GPCDMA. Signed-off-by: Akhil R Reviewed-by: Dmitry Osipenko Signed-off-by: Wolfram Sang commit 03d4287add6ef992636f49627a8f8788faa6a66e Author: Andy Shevchenko Date: Tue Sep 6 18:55:07 2022 +0300 i2c: scmi: Convert to be a platform driver ACPI core in conjunction with platform driver core provides an infrastructure to enumerate ACPI devices. Use it in order to remove a lot of boilerplate code. Signed-off-by: Andy Shevchenko Tested-by: Josef Johansson Signed-off-by: Wolfram Sang commit d819524d3144f4703f45f473fdc85ad7579ae94c Merge: 859d64685d6c8 80e78fcce86de Author: Wolfram Sang Date: Fri Sep 16 20:42:18 2022 +0100 Merge tag 'v6.0-rc5' into i2c/for-mergewindow Linux 6.0-rc5 commit 260a4ca8ff12d79282cf17f7f121af5c7ba376f9 Author: Geert Uytterhoeven Date: Wed Sep 14 16:33:22 2022 +0200 dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema Convert the NXP TDA998x HDMI transmitter Device Tree binding documentation to json-schema. Add missing "#sound-dai-cells" property. Add ports hierarchy, as an alternative to port. Drop pinctrl properties, as they do not belong here. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1224e757ec958f8b29ec66e783a7ee805c339d84.1663165552.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 859d64685d6c868db62b86064769b053db8bf834 Author: Jagan Teki Date: Thu Sep 15 22:09:42 2022 +0530 i2c: rk3x: Add rv1126 support Add i2c support for Rockchip RV1126 SoC. Reviewed-by: Heiko Stuebner Signed-off-by: David Wu Signed-off-by: Jagan Teki Signed-off-by: Wolfram Sang commit 25c7d38579503c72d283d229f92b30b237c67370 Author: Vinod Koul Date: Fri Sep 16 18:12:14 2022 +0530 arm64: defconfig: Enabled SC8180x configs Enable sc8180x global clock controller, tlmm, interconnect and edp phy drivers which are required for sc8180x like Lenovo Flex 5G laptop to boot. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220916124214.3881948-1-vkoul@kernel.org commit 3d59187efc982bf20309ae2fb8514007f9bf2b4e Author: Rajendra Nayak Date: Fri Sep 16 16:01:24 2022 +0530 arm64: dts: qcom: sc7280: Add required-opps for USB USB has a requirement to put a performance state vote on 'cx' while active. Use 'required-opps' to pass this information from device tree, and since all the GDSCs in GCC (including USB) are sub-domains of cx, we also add cx as a power-domain for GCC. Now when any of the consumers of the GDSCs (in this case USB) votes on a perforamance state, genpd framework can identify that the GDSC itself does not support a performance state and it then propogates the vote to the parent, which in this case is cx. This change would also mean that any GDSC in GCC thats left enabled during low power state (perhaps because its marked with a ALWAYS_ON flag) can prevent the system from entering low power since that would prevent cx from transitioning to low power. Ideally any consumers that would need to have their devices (partially) powered to support wakeups should look at making the resp. GDSCs transtion to a Retention (PWRSTS_RET) state instead of leaving them ALWAYS_ON. Signed-off-by: Rajendra Nayak Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220916103124.30581-1-quic_rjendra@quicinc.com commit a02c118ee9e898612cbae42121b9e8663455b515 Author: Wang Yufen Date: Tue Sep 13 16:40:33 2022 +0800 bpf: use kvmemdup_bpfptr helper Use kvmemdup_bpfptr helper instead of open-coding to simplify the code. Signed-off-by: Wang Yufen Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/1663058433-14089-1-git-send-email-wangyufen@huawei.com Signed-off-by: Martin KaFai Lau commit e7840a9aae6f791d8fef47c892821b1915d20747 Author: Serge Semin Date: Fri Sep 9 22:36:21 2022 +0300 MAINTAINERS: Add maintainers for DWC AHCI SATA driver Add myself as a maintainer of the new DWC AHCI SATA driver and its DT-bindings schema. Signed-off-by: Serge Semin Signed-off-by: Damien Le Moal commit 9628711aa649e0134f567505290537460326ddc1 Author: Serge Semin Date: Fri Sep 9 22:36:20 2022 +0300 ata: ahci-dwc: Add Baikal-T1 AHCI SATA interface support It's almost fully compatible DWC AHCI SATA IP-core derivative except the reference clocks source, which need to be very carefully selected. In particular the DWC AHCI SATA PHY can be clocked either from the pads ref_pad_clk_{m,p} or from the internal wires ref_alt_clk_{m,n}. In the later case the clock signal is generated from the Baikal-T1 CCU SATA PLL. The clocks source is selected by means of the ref_use_pad wire connected to the CCU SATA reference clock CSR. In normal situation it would be much more handy to use the internal reference clock source, but alas we haven't managed to make the AHCI controller working well with it so far. So it's preferable to have the controller clocked from the external clock generator and fallback to the internal clock source only as a last resort. Other than that the controller is full compatible with the DWC AHCI SATA IP-core. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit bc7af9100fa8a671298139f87a29f4254c207786 Author: Serge Semin Date: Fri Sep 9 22:36:19 2022 +0300 ata: ahci-dwc: Add platform-specific quirks support Some DWC AHCI SATA IP-core derivatives require to perform small platform or IP-core specific setups. They are too small to be placed in a dedicated driver. It's just much easier to have a set of quirks for them right in the DWC AHCI driver code. Since we are about to add such platform support, as a pre-requisite we introduce a platform-data based DWC AHCI quirks API. The platform data can be used to define the flags passed to the ahci_platform_get_resources() method, additional AHCI host-flags and a set of callbacks to initialize, re-initialize and clear the platform settings. Signed-off-by: Serge Semin Signed-off-by: Damien Le Moal commit 064f14e9df4e7a49940742b8a9af43b48fb4cf00 Author: Serge Semin Date: Fri Sep 9 22:36:18 2022 +0300 dt-bindings: ata: ahci: Add Baikal-T1 AHCI SATA controller DT schema Baikal-T1 AHCI controller is based on the DWC AHCI SATA IP-core v4.10a with the next specific settings: two SATA ports, cascaded CSR access based on two clock domains (APB and AXI), selectable source of the reference clock (though stable work is currently available from the external source only), two reset lanes for the application and SATA ports domains. Other than that the device is fully compatible with the generic DWC AHCI SATA bindings. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 33629d35090f5ce2b1b4ce78aa39954c603536d5 Author: Serge Semin Date: Fri Sep 9 22:36:17 2022 +0300 ata: ahci: Add DWC AHCI SATA controller support Synopsys AHCI SATA controller can work pretty under with the generic AHCI-platform driver control. But there are vendor-specific peculiarities which can tune the device performance up and which may need to be fixed up for proper device functioning. In addition some DWC AHCI-based controllers may require small platform-specific fixups, so adding them in the generic AHCI driver would have ruined the code simplicity. Shortly speaking in order to keep the generic AHCI-platform code clean and have DWC AHCI SATA-specific features supported we suggest to add a dedicated DWC AHCI SATA device driver. Aside with the standard AHCI-platform resources getting, enabling/disabling and the controller registration the new driver performs the next actions. First of all there is a way to verify whether the HBA/ports capabilities activated in OF are correct. Almost all features availability is reflected in the vendor-specific parameters registers. So the DWC AHCI driver does the capabilities sanity check based on the corresponding fields state. Secondly if either the Command Completion Coalescing or the Device Sleep feature is enabled the DWC AHCI-specific internal 1ms timer must be fixed in accordance with the application clock signal frequency. In particular the timer value must be set to be Fapp * 1000. Normally the SoC designers pre-configure the TIMER1MS register to contain a correct value by default. But the platforms can support the application clock rate change. If that happens the 1ms timer value must be accordingly updated otherwise the dependent features won't work as expected. In the DWC AHCI driver we suggest to rely on the "aclk" reference clock rate to set the timer interval up. That clock source is supposed to be the AHCI SATA application clock in accordance with the DT bindings. Finally DWC AHCI SATA controller AXI/AHB bus DMA-engine can be tuned up to transfer up to 1024 * FIFO words at a time by setting the Tx/Rx transaction size in the DMA control register. The maximum value depends on the DMA data bus and AXI/AHB bus maximum burst length. In most of the cases it's better to set the maximum possible value to reach the best AHCI SATA controller performance. But sometimes in order to improve the system interconnect responsiveness, transferring in smaller data chunks may be more preferable. For such cases and for the case when the default value doesn't provide the best DMA bus performance we suggest to use the new HBA-port specific DT-properties "snps,{tx,rx}-ts-max" to tune the DMA transactions size up. After all the settings denoted above are handled the DWC AHCI SATA driver proceeds further with the standard AHCI-platform host initializations. Note since DWC AHCI controller is now have a dedicated driver we can discard the corresponding compatible string from the ahci-platform.c module. The same concerns "snps,spear-ahci" compatible string, which is also based on the DWC AHCI IP-core. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 6ce73f3a6fc0ad6af56ba4c14ab7a410876f8286 Author: Serge Semin Date: Fri Sep 9 22:36:16 2022 +0300 ata: libahci_platform: Add function returning a clock-handle by id Since all the clocks are retrieved by the method ahci_platform_get_resources() there is no need for the LLD (glue) drivers to be looking for some particular of them in the kernel clocks table again. Instead we suggest to add a simple method returning a device-specific clock with passed connection ID if it is managed to be found. Otherwise the function will return NULL. Thus the glue-drivers won't need to either manually touching the hpriv->clks array or calling clk_get()-friends. The AHCI platform drivers will be able to use the new function right after the ahci_platform_get_resources() method invocation and up to the device removal. Note the method is left unused here, but will be utilized in the framework of the DWC AHCI SATA driver being added in the next commit. Signed-off-by: Serge Semin Signed-off-by: Damien Le Moal commit 5c640beccb3465c0dc941f3e7d21fb72e3a5f5f3 Author: Serge Semin Date: Fri Sep 9 22:36:15 2022 +0300 dt-bindings: ata: ahci: Add DWC AHCI SATA controller DT schema Synopsys AHCI SATA controller is mainly compatible with the generic AHCI SATA controller except a few peculiarities and the platform environment requirements. In particular it can have at least two reference clocks to feed up its AHB/AXI interface and SATA PHYs domain and at least one reset control for the application clock domain. In addition to that the DMA interface of each port can be tuned up to work with the predefined maximum data chunk size. Note unlike generic AHCI controller DWC AHCI can't have more than 8 ports. All of that is reflected in the new DWC AHCI SATA device DT binding. Note the DWC AHCI SATA controller DT-schema has been created in a way so to be reused for the vendor-specific DT-schemas (see for example the "snps,dwc-ahci" compatible string binding). One of which we are about to introduce. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 18ee7c49f75b642beb6f8d7efdae3a47068d4aa3 Author: Serge Semin Date: Fri Sep 9 22:36:14 2022 +0300 ata: ahci: Introduce firmware-specific caps initialization There are systems with no BIOS or comprehensive embedded firmware which could be able to properly initialize the SATA AHCI controller platform-specific capabilities. In that case a good alternative to having a clever bootloader is to create a device tree node with the properties well describing all the AHCI-related platform specifics. All the settings which are normally detected and marked as available in the HBA and its ports capabilities fields [1] could be defined in the platform DTB by means of a set of the dedicated properties. Such approach perfectly fits to the DTB-philosophy - to provide hardware/platform description. So here we suggest to extend the SATA AHCI device tree bindings with two additional DT-properties: 1) "hba-cap" - HBA platform generic capabilities like: - SSS - Staggered Spin-up support. - SMPS - Mechanical Presence Switch support. 2) "hba-port-cap" - HBA platform port capabilities like: - HPCP - Hot Plug Capable Port. - MPSP - Mechanical Presence Switch Attached to Port. - CPD - Cold Presence Detection. - ESP - External SATA Port. - FBSCP - FIS-based Switching Capable Port. All of these capabilities require to have a corresponding hardware configuration. Thus it's ok to have them defined in DTB. Even though the driver currently takes into account the state of the ESP and FBSCP flags state only, there is nothing wrong with having all of them supported by the generic AHCI library in order to have a complete OF-based platform-capabilities initialization procedure. These properties will be parsed in the ahci_platform_get_resources() method and their values will be stored in the saved_* fields of the ahci_host_priv structure, which in its turn then will be used to restore the H.CAP, H.PI and P#.CMD capability fields on device init and after HBA reset. Please note this modification concerns the HW-init HBA and its ports flags only, which are by specification [1] are supposed to be initialized by the BIOS/platform firmware/expansion ROM and which are normally declared in the one-time-writable-after-reset register fields. Even though these flags aren't supposed to be cleared after HBA reset some AHCI instances may violate that rule so we still need to perform the fields resetting after each reset. Luckily the corresponding functionality has already been partly implemented in the framework of the ahci_save_initial_config() and ahci_restore_initial_config() methods. [1] Serial ATA AHCI 1.3.1 Specification, p. 103 Signed-off-by: Serge Semin Signed-off-by: Damien Le Moal commit 7cbbfbe01a7284f8003f7a013abb9ece01cb6393 Author: Serge Semin Date: Fri Sep 9 22:36:13 2022 +0300 ata: ahci: Convert __ahci_port_base to accepting hpriv as arguments The port base address may be required even before the ata_host instance is initialized and activated, for instance in the ahci_save_initial_config() method which we are about to update (consider this modification as a preparation for that one). Seeing the __ahci_port_base() function isn't used much it's the best candidate to provide the required functionality. So let's convert it to accepting the ahci_host_priv structure pointer. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit fad64dc06579ac1cc05d5ab73bdaa62ee6435ed8 Author: Serge Semin Date: Fri Sep 9 22:36:12 2022 +0300 ata: libahci: Don't read AHCI version twice in the save-config method There is no point in reading the AHCI version all over in the tail of the ahci_save_initial_config() method. That register is RO and doesn't change its value even after reset. So just reuse the data, which has already been read from there earlier in the head of the function. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 88589772e80cec5dc2058d7d84a1a97a31674195 Author: Serge Semin Date: Fri Sep 9 22:36:11 2022 +0300 ata: libahci: Discard redundant force_port_map parameter Currently there are four port-map-related fields declared in the ahci_host_priv structure and used to setup the HBA ports mapping. First the ports-mapping is read from the PI register and immediately stored in the saved_port_map field. If forced_port_map is initialized with non-zero value then its value will have greater priority over the value read from PI, thus it will override the saved_port_map field. That value will be then masked by a non-zero mask_port_map field and after some sanity checks it will be stored in the ahci_host_priv.port_map field as a final port mapping. As you can see the logic is a bit too complicated for such a simple task. We can freely get rid from at least one of the fields with no change to the implemented semantic. The force_port_map field can be replaced with taking non-zero saved_port_map value into account. So if saved_port_map is pre-initialized by the low level drivers (platform drivers) then it will have greater priority over the value read from PI register and will be used as actual HBA ports mapping later on. Thus the ports map forcing task will be just transferred from force_port_map to the saved_port_map field. This modification will perfectly fit into the feature of having OF-based initialization of the HW-init HBA CSR fields we are about to introduce in the next commit. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit eb7cae0b6afda3932d3011285a246b3c6bf26c44 Author: Serge Semin Date: Fri Sep 9 22:36:10 2022 +0300 ata: libahci: Extend port-cmd flags set with port capabilities Currently not all of the Port-specific capabilities listed in the PORT_CMD-enumeration. Let's extend that set with the Cold Presence Detection and Mechanical Presence Switch attached to the Port flags [1] so to closeup the set of the platform-specific port-capabilities flags. Note these flags are supposed to be set by the platform firmware if there is one. Alternatively as we are about to do they can be set by means of the OF properties. While at it replace PORT_IRQ_DEV_ILCK with PORT_IRQ_DMPS and fix the comment there. In accordance with [2] that IRQ flag is supposed to indicate the state of the signal coming from the Mechanical Presence Switch. [1] Serial ATA AHCI 1.3.1 Specification, p.27 [2] Serial ATA AHCI 1.3.1 Specification, p.24, p.88 Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 03f1076fbe9fd0edd92011f1c97bf6daad83d01b Author: Serge Semin Date: Fri Sep 9 22:36:09 2022 +0300 dt-bindings: ata: ahci: Add platform capability properties In case if the platform doesn't have BIOS or a comprehensive firmware installed then the HBA capability flags will be left uninitialized. As a good alternative we suggest to define the DT-properties with the AHCI platform capabilities describing all the HW-init flags of the corresponding capability register. Luckily there aren't too many of them. SSS - Staggered Spin-up support and MPS - Mechanical Presence Switch support determine the corresponding feature availability for the whole HBA by means of the "hba-cap" property. Each port can have the "hba-port-cap" property initialized indicating that the port supports some of the next functionalities: HPCP - HotPlug capable port, MPSP - Mechanical Presence Switch attached to a port, CPD - Cold Plug detection, ESP - External SATA Port (eSATA), FBSCP - FIS-based switching capable port. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit f67f12ff57bcfcd7d64280f748787793217faeaf Author: Serge Semin Date: Fri Sep 9 22:36:08 2022 +0300 ata: libahci_platform: Introduce reset assertion/deassertion methods Currently the ACHI-platform library supports only the assert and deassert reset signals and ignores the platforms with self-deasserting reset lines. That prone to having the platforms with self-deasserting reset method misbehaviour when it comes to resuming from sleep state after the clocks have been fully disabled. For such cases the controller needs to be fully reset all over after the reference clocks are enabled and stable, otherwise the controller state machine might be in an undetermined state. The best solution would be to auto-detect which reset method is supported by the particular platform and use it implicitly in the framework of the ahci_platform_enable_resources()/ahci_platform_disable_resources() methods. Alas it can't be implemented due to the AHCI-platform library already supporting the shared reset control lines. As [1] says in such case we have to use only one of the next methods: + reset_control_assert()/reset_control_deassert(); + reset_control_reset()/reset_control_rearm(). If the driver had an exclusive control over the reset lines we could have been able to manipulate the lines with no much limitation and just used the combination of the methods above to cover all the possible reset-control cases. Since the shared reset control has already been advertised and couldn't be changed with no risk to breaking the platforms relying on it, we have no choice but to make the platform drivers to determine which reset methods the platform reset system supports. In order to implement both types of reset control support we suggest to introduce the new AHCI-platform flag: AHCI_PLATFORM_RST_TRIGGER, which when passed to the ahci_platform_get_resources() method together with the AHCI_PLATFORM_GET_RESETS flag will indicate that the reset lines are self-deasserting thus the reset_control_reset()/reset_control_rearm() will be used to control the reset state. Otherwise the reset_control_deassert()/reset_control_assert() methods will be utilized. [1] Documentation/driver-api/reset.rst Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 3f74cd046fbed349be977606f938e6429155e7b5 Author: Serge Semin Date: Fri Sep 9 22:36:07 2022 +0300 ata: libahci_platform: Parse ports-implemented property in resources getter The ports-implemented property is mainly used on the OF-based platforms with no ports mapping initialized by a bootloader/BIOS firmware. Seeing the same of_property_read_u32()-based pattern has already been implemented in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI drivers let's move the property read procedure to the generic ahci_platform_get_resources() method. Thus we'll have the forced ports mapping feature supported for each OF-based platform which requires that, and stop re-implementing the same pattern in there a bit simplifying the code. Signed-off-by: Serge Semin Signed-off-by: Damien Le Moal commit 3c132ea6508b34956e5ed88d04936983ec230601 Author: Serge Semin Date: Fri Sep 9 22:36:06 2022 +0300 ata: libahci_platform: Sanity check the DT child nodes number Having greater than AHCI_MAX_PORTS (32) ports detected isn't that critical from the further AHCI-platform initialization point of view since exceeding the ports upper limit will cause allocating more resources than will be used afterwards. But detecting too many child DT-nodes doesn't seem right since it's very unlikely to have it on an ordinary platform. In accordance with the AHCI specification there can't be more than 32 ports implemented at least due to having the CAP.NP field of 5 bits wide and the PI register of dword size. Thus if such situation is found the DTB must have been corrupted and the data read from it shouldn't be reliable. Let's consider that as an erroneous situation and halt further resources allocation. Note it's logically more correct to have the nports set only after the initialization value is checked for being sane. So while at it let's make sure nports is assigned with a correct value. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit e28b3abf8020a884bd3b7758ea8915365af8fadf Author: Serge Semin Date: Fri Sep 9 22:36:05 2022 +0300 ata: libahci_platform: Convert to using devm bulk clocks API In order to simplify the clock-related code there is a way to convert the current fixed clocks array into using the common bulk clocks kernel API with dynamic set of the clock handlers and device-managed clock-resource tracking. It's a bit tricky due to the complication coming from the requirement to support the platforms (da850, spear13xx) with the non-OF-based clock source, but still doable. Before this modification there are two methods have been used to get the clocks connected to an AHCI device: clk_get() - to get the very first clock in the list and of_clk_get() - to get the rest of them. Basically the platforms with non-OF-based clocks definition could specify only a single reference clock source. The platforms with OF-hw clocks have been luckier and could setup up to AHCI_MAX_CLKS clocks. Such semantic can be retained with using devm_clk_bulk_get_all() to retrieve the clocks defined via the DT firmware and devm_clk_get_optional() otherwise. In both cases using the device-managed version of the methods will cause the automatic resources deallocation on the AHCI device removal event. The only complicated part in the suggested approach is the explicit allocation and initialization of the clk_bulk_data structure instance for the non-OF reference clocks. It's required in order to use the Bulk Clocks API for the both denoted cases of the clocks definition. Note aside with the clock-related code reduction and natural simplification, there are several bonuses the suggested modification provides. First of all the limitation of having no greater than AHCI_MAX_CLKS clocks is now removed, since the devm_clk_bulk_get_all() method will allocate as many reference clocks data descriptors as there are clocks specified for the device. Secondly the clock names are auto-detected. So the LLDD (glue) drivers can make sure that the required clocks are specified just by checking the clock IDs in the clk_bulk_data array. Thirdly using the handy Bulk Clocks kernel API improves the clocks-handling code readability. And the last but not least this modification implements a true optional clocks support to the ahci_platform_get_resources() method. Indeed the previous clocks getting procedure just stopped getting the clocks on any errors (aside from non-critical -EPROBE_DEFER) in a way so the callee wasn't even informed about abnormal loop termination. The new implementation lacks of such problem. The ahci_platform_get_resources() will return an error code if the corresponding clocks getting method ends execution abnormally. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 82d437e6dcb10e07e1a109d74924e30b9ec6ea56 Author: Serge Semin Date: Fri Sep 9 22:36:04 2022 +0300 ata: libahci_platform: Convert to using platform devm-ioremap methods Currently the IOMEM AHCI registers space is mapped by means of the two functions invocation: platform_get_resource() is used to get the very first memory resource and devm_ioremap_resource() is called to remap that resource. Device-managed kernel API provides a handy wrapper to perform the same in single function call: devm_platform_ioremap_resource(). While at it seeing many AHCI platform drivers rely on having the AHCI CSR space marked with "ahci" name let's first try to find and remap the CSR IO-mem with that name and only if it fails fallback to getting the very first registers space platform resource. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 2ea4d52ad11a9234eb7252377ba873c311896997 Author: Serge Semin Date: Fri Sep 9 22:36:03 2022 +0300 dt-bindings: ata: sata-brcm: Apply common AHCI schema The Broadcom SATA controller is obviously based on the AHCI standard. The device driver uses the kernel AHCI library to work with it. Therefore we can be have a more thorough DT-bindings evaluation by referring to the AHCI-common schema instead of using the more relaxed SATA-common one. Signed-off-by: Serge Semin Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 388f08ecdc199f6fae2e94f792bffbabcba294f9 Author: Serge Semin Date: Fri Sep 9 22:36:02 2022 +0300 dt-bindings: ata: sata: Extend number of SATA ports The denoted in the description upper limit only concerns the Port Multipliers, but not the actual SATA ports. It's an external device attached to a SATA port in order to access more than one SATA-drive. So when it's attached to a SATA port it just extends the port capability while the number of actual SATA ports stays the same. For instance on AHCI controllers the number of actual ports is determined by the CAP.NP field and the PI (Ports Implemented) register. AFAICS in general the maximum number of SATA ports depends on the particular controller implementation. Generic AHCI controller can't have more than 32 ports (since CAP.NP is of 5 bits wide and PI register is 32-bits size), while DWC AHCI SATA controller can't be configured with more than 8 ports activated. So let's discard the SATA ports reg-property restrictions and just make sure that it consists of a single reg-item. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 9bd2407064680ad544d5edcea688cc45843f23ae Author: Serge Semin Date: Fri Sep 9 22:36:01 2022 +0300 dt-bindings: ata: ahci-platform: Clarify common AHCI props constraints Indeed in accordance with what is implemented in the AHCI platform driver and the way the AHCI DT nodes are defined in the DT files we can add the next AHCI DT properties constraints: AHCI CSR ID is fixed to 'ahci', PHY name is fixed to 'sata-phy', AHCI controller can't have more than 32 ports by design, AHCI controller can have up to 32 IRQ lines. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 0f3680ed1f4ca682e7a44aade35234632fe94505 Author: Serge Semin Date: Fri Sep 9 22:36:00 2022 +0300 dt-bindings: ata: ahci-platform: Detach common AHCI bindings In order to create a more sophisticated AHCI controller DT bindings let's divide the already available generic AHCI platform YAML schema into the platform part and a set of the common AHCI properties. The former part will be used to evaluate the AHCI DT nodes mainly compatible with the generic AHCI controller while the later schema will be used for more thorough AHCI DT nodes description. For instance such YAML schemas design will be useful for our DW AHCI SATA controller derivative with four clock sources, two reset lines, one system controller reference and specific max Rx/Tx DMA xfers size constraints. Note the phys and target-supply property requirement is preserved in the generic AHCI platform bindings because some platforms can lack of the explicitly specified PHYs or target device power regulators. Also note the SATA/AHCI ports properties have been moved to the $defs-paragraph of the schemas. It's done in order to create the extendable properties hierarchy such that particular AHCI-controller could add vendor-specific port properties. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 6f997d4bb98becdc5d23affe207b3b0e854bcc3b Author: Serge Semin Date: Fri Sep 9 22:35:59 2022 +0300 dt-bindings: ata: ahci-platform: Move dma-coherent to sata-common.yaml Seeing doubtfully any SATA device working without embedded DMA engine let's permit the device nodes being equipped with the dma-coherent property in case if the platform is capable of cache-coherent DMAs. As a side-effect we can drop the explicit dma-coherent property definition from the particular device schemas. Currently it concerns the Broadcom SATA AHCI controller only. Signed-off-by: Serge Semin Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit c432fefe8e6262bf3d288ab82d006cfafa78a139 Author: Thomas Richter Date: Thu Jun 30 11:53:48 2022 +0200 s390/pai: Add support for PAI Extension 1 NNPA counters PMU device driver perf_paiext supports Processor Activity Instrumentation Extension (PAIE1), available with IBM z16: - maps a 512 byte block to lowcore address 0x1508 called PAIE1 control block. - maps a 1024 byte block at PAIE1 control block entry with index 2. - uses control register bit 14 to enable PAIE1 control block lookup. - turn PAIE1 nnpa counting on and off by setting bit 63 in PAIE1 control block entry with index 2. - creates a sample with raw data on each context switch out when at context switch some mapped counters have a value of nonzero. This device driver only supports CPU wide context, no task context is allowed. Support for counting: - one or more counters can be specified using perf stat -e pai_ext/xxx/ where xxx stands for the counter event name. Multiple invocation of this command is possible. The counter names are listed in /sys/devices/pai_ext/events directory. - one special counters can be specified using perf stat -e pai_ext/NNPA_ALL/ which returns the sum of all incremented nnpa counters. - multiple counting events can run in parallel. Support for Sampling: - one event pai_ext/NNPA_ALL/ is reserved for sampling. The event collects data at context switch out and saves them in the ring buffer. - no multiple invocations are possible. The PAIE1 nnpa counter events are system wide. No task context is supported. Therefore some restrictions documented in function paiext_busy() apply. Extend qpaci assembly instruction to query supported memory mapped nnpa counters. It returns the number of counters (no holes allowed in that range). PAIE1 nnpa counter events can not be created when a CPU hot plug add is processed. This means a CPU hot plug add does not get the necessary PAIE1 event to record PAIE1 nnpa counter increments on the newly added CPU. CPU hot plug remove removes the event and terminates the counting of PAIE1 counters immediately. Signed-off-by: Thomas Richter Reviewed-by: Sumanth Korikkar Reviewed-by: Sven Schnelle Signed-off-by: Vasily Gorbik commit 9267bdd8194f8166ddfddd3d5577b6ba1632a165 Author: Alexander Gordeev Date: Fri Sep 16 11:08:20 2022 +0200 s390/mm: fix no previous prototype warnings in maccess.c Fix -Wmissing-prototypes warnings caused by missing maccess.h include. Reported-by: kernel test robot Fixes: 2f0e8aae26a2 ("s390/mm: rework memcpy_real() to avoid DAT-off mode") Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit d926079f17bf8aa47485b6a55be1fc0175dbd1db Author: Mark Rutland Date: Mon Sep 12 17:22:10 2022 +0100 arm64: alternatives: add shared NOP callback For each instance of an alternative, the compiler outputs a distinct copy of the alternative instructions into a subsection. As the compiler doesn't have special knowledge of alternatives, it cannot coalesce these to save space. In a defconfig kernel built with GCC 12.1.0, there are approximately 10,000 instances of alternative_has_feature_likely(), where the replacement instruction is always a NOP. As NOPs are position-independent, we don't need a unique copy per alternative sequence. This patch adds a callback to patch an alternative sequence with NOPs, and make use of this in alternative_has_feature_likely(). So that this can be used for other sites in future, this is written to patch multiple instructions up to the original sequence length. For NVHE, an alias is added to image-vars.h. For modules, the callback is exported. Note that as modules are loaded within 2GiB of the kernel, an alt_instr entry in a module can always refer directly to the callback, and no special handling is necessary. When building with GCC 12.1.0, the vmlinux is ~158KiB smaller, though the resulting Image size is unchanged due to alignment constraints and padding: | % ls -al vmlinux-* | -rwxr-xr-x 1 mark mark 134644592 Sep 1 14:52 vmlinux-after | -rwxr-xr-x 1 mark mark 134486232 Sep 1 14:50 vmlinux-before | % ls -al Image-* | -rw-r--r-- 1 mark mark 37108224 Sep 1 14:52 Image-after | -rw-r--r-- 1 mark mark 37108224 Sep 1 14:50 Image-before Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-9-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 21fb26bfb01ffe0d9a9a967ffe061092128bbffe Author: Mark Rutland Date: Mon Sep 12 17:22:09 2022 +0100 arm64: alternatives: add alternative_has_feature_*() Currrently we use a mixture of alternative sequences and static branches to handle features detected at boot time. For ease of maintenance we generally prefer to use static branches in C code, but this has a few downsides: * Each static branch has metadata in the __jump_table section, which is not discarded after features are finalized. This wastes some space, and slows down the patching of other static branches. * The static branches are patched at a different point in time from the alternatives, so changes are not atomic. This leaves a transient period where there could be a mismatch between the behaviour of alternatives and static branches, which could be problematic for some features (e.g. pseudo-NMI). * More (instrumentable) kernel code is executed to patch each static branch, which can be risky when patching certain features (e.g. irqflags management for pseudo-NMI). * When CONFIG_JUMP_LABEL=n, static branches are turned into a load of a flag and a conditional branch. This means it isn't safe to use such static branches in an alternative address space (e.g. the NVHE/PKVM hyp code), where the generated address isn't safe to acccess. To deal with these issues, this patch introduces new alternative_has_feature_*() helpers, which work like static branches but are patched using alternatives. This ensures the patching is performed at the same time as other alternative patching, allows the metadata to be freed after patching, and is safe for use in alternative address spaces. Note that all supported toolchains have asm goto support, and since commit: a0a12c3ed057af57 ("asm goto: eradicate CC_HAS_ASM_GOTO)" ... the CC_HAS_ASM_GOTO Kconfig symbol has been removed, so no feature check is necessary, and we can always make use of asm goto. Additionally, note that: * This has no impact on cpus_have_cap(), which is a dynamic check. * This has no functional impact on cpus_have_const_cap(). The branches are patched slightly later than before this patch, but these branches are not reachable until caps have been finalised. * It is now invalid to use cpus_have_final_cap() in the window between feature detection and patching. All existing uses are only expected after patching anyway, so this should not be a problem. * The LSE atomics will now be enabled during alternatives patching rather than immediately before. As the LL/SC an LSE atomics are functionally equivalent this should not be problematic. When building defconfig with GCC 12.1.0, the resulting Image is 64KiB smaller: | % ls -al Image-* | -rw-r--r-- 1 mark mark 37108224 Aug 23 09:56 Image-after | -rw-r--r-- 1 mark mark 37173760 Aug 23 09:54 Image-before According to bloat-o-meter.pl: | add/remove: 44/34 grow/shrink: 602/1294 up/down: 39692/-61108 (-21416) | Function old new delta | [...] | Total: Before=16618336, After=16596920, chg -0.13% | add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-1296 (-1296) | Data old new delta | arm64_const_caps_ready 16 - -16 | cpu_hwcap_keys 1280 - -1280 | Total: Before=8987120, After=8985824, chg -0.01% | add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) | RO Data old new delta | Total: Before=18408, After=18408, chg +0.00% Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-8-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 4c0bd995d73ed8897650095c7892b132a0bd66a4 Author: Mark Rutland Date: Mon Sep 12 17:22:08 2022 +0100 arm64: alternatives: have callbacks take a cap Today, callback alternatives are special-cased within __apply_alternatives(), and are applied alongside patching for system capabilities as ARM64_NCAPS is not part of the boot_capabilities feature mask. This special-casing is less than ideal. Giving special meaning to ARM64_NCAPS for this requires some structures and loops to use ARM64_NCAPS + 1 (AKA ARM64_NPATCHABLE), while others use ARM64_NCAPS. It's also not immediately clear callback alternatives are only applied when applying alternatives for system-wide features. To make this a bit clearer, changes the way that callback alternatives are identified to remove the special-casing of ARM64_NCAPS, and to allow callback alternatives to be associated with a cpucap as with all other alternatives. New cpucaps, ARM64_ALWAYS_BOOT and ARM64_ALWAYS_SYSTEM are added which are always detected alongside boot cpu capabilities and system capabilities respectively. All existing callback alternatives are made to use ARM64_ALWAYS_SYSTEM, and so will be patched at the same point during the boot flow as before. Subsequent patches will make more use of these new cpucaps. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit b723edf3a12a2604cdc0dfcd7cc93d210a815e0c Author: Mark Rutland Date: Mon Sep 12 17:22:07 2022 +0100 arm64: alternatives: make alt_region const We never alter a struct alt_region after creation, and we open-code the bounds of the kernel alternatives region in two functions. The duplication is a bit unfortunate for clarity (and in future we're likely to have more functions altering alternative regions), and to avoid accidents it would be good to make the structure const. This patch adds a shared struct `kernel_alternatives` alt_region for the main kernel image, and marks the alt_regions as const to prevent unintentional modification. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit c5ba03260c7afad6977654d6bc7fcabbcd35c379 Author: Mark Rutland Date: Mon Sep 12 17:22:06 2022 +0100 arm64: alternatives: hoist print out of __apply_alternatives() Printing in the middle of __apply_alternatives() is potentially unsafe and not all that helpful given these days we practically always patch *something*. Hoist the print out of __apply_alternatives(), and add separate prints to __apply_alternatives() and apply_alternatives_all(), which will make it easier to spot if either patching call goes wrong. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 747ad8d557645b8c9adb83334a620426e4c9d60f Author: Mark Rutland Date: Mon Sep 12 17:22:05 2022 +0100 arm64: alternatives: proton-pack: prepare for cap changes The spectre patching callbacks use cpus_have_final_cap(), and subsequent patches will make it invalid to call cpus_have_final_cap() before alternatives patching has completed. In preparation for said change, this patch modifies the spectre patching callbacks use cpus_have_cap(). This is not subject to patching, and will dynamically check the cpu_hwcaps array, which is functionally equivalent to the existing behaviour. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Joey Gouly Cc: Ard Biesheuvel Cc: James Morse Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 34bbfdfb146be3ad485cbe526b2a1e9ce220649c Author: Mark Rutland Date: Mon Sep 12 17:22:04 2022 +0100 arm64: alternatives: kvm: prepare for cap changes The KVM patching callbacks use cpus_have_final_cap() internally within has_vhe(), and subsequent patches will make it invalid to call cpus_have_final_cap() before alternatives patching has completed, and will mean that cpus_have_const_cap() will always fall back to dynamic checks prior to alternatives patching. In preparation for said change, this patch modifies the KVM patching callbacks to use cpus_have_cap() directly. This is not subject to patching, and will dynamically check the cpu_hwcaps array, which is functionally equivalent to the existing behaviour. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 92b4b5619f12770d455ae639ed4e773bdf01aff6 Author: Mark Rutland Date: Mon Sep 12 17:22:03 2022 +0100 arm64: cpufeature: make cpus_have_cap() noinstr-safe Currently it isn't safe to use cpus_have_cap() from noinstr code as test_bit() is explicitly instrumented, and were cpus_have_cap() placed out-of-line, cpus_have_cap() itself could be instrumented. Make cpus_have_cap() noinstr safe by marking it __always_inline and using arch_test_bit(). Aside from the prevention of instrumentation, there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Joey Gouly Cc: Marc Zyngier Cc: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220912162210.3626215-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 83c10cc362d91c0d8d25e60779ee52fdbbf3894d Author: Lee Jones Date: Mon Sep 12 14:38:55 2022 +0100 bpf: Ensure correct locking around vulnerable function find_vpid() The documentation for find_vpid() clearly states: "Must be called with the tasklist_lock or rcu_read_lock() held." Presently we do neither for find_vpid() instance in bpf_task_fd_query(). Add proper rcu_read_lock/unlock() to fix the issue. Fixes: 41bdc4b40ed6f ("bpf: introduce bpf subcommand BPF_TASK_FD_QUERY") Signed-off-by: Lee Jones Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220912133855.1218900-1-lee@kernel.org commit d3243965f24ab002b2d8c48a91eb7ce027d3f11a Author: Lukas Bulwahn Date: Wed Sep 14 16:27:13 2022 +0200 ata: make PATA_PLATFORM selectable only for suitable architectures It is currently possible to select "Generic platform device PATA support" in two situations: - architecture allows the generic platform device PATA support and indicates that with "select HAVE_PATA_PLATFORM". - if the user claims to be an EXPERT by setting CONFIG_EXPERT to yes However, there is no use case to have Generic platform device PATA support in a kernel build if the architecture definition, i.e., the selection of configs by an architecture, does not support it. If the architecture definition is wrong, i.e., it just misses a 'select HAVE_PATA_PLATFORM', then even an expert that configures the kernel build should not just fix that by overruling the claimed support by an architecture. If the architecture definition is wrong, the expert should just provide a patch to correct the architecture definition instead---in the end, if the user is an expert, sending a quick one-line patch should not be an issue. In other words, I do not see the deeper why an expert can overrule the architecture definition in this case, as the expert may not overrule the config selections defined by the architecture in the large majority ---or probably all other (modulo some mistakes)---of similar cases. Signed-off-by: Lukas Bulwahn Reviewed-by: Arnd Bergmann Signed-off-by: Damien Le Moal commit 3ebe59a54111ccc9d4044d73681e93599b5f51fa Author: Lukas Bulwahn Date: Wed Sep 14 16:27:12 2022 +0200 ata: clean up how architectures enable PATA_PLATFORM and PATA_OF_PLATFORM There are two options for platform device PATA support: PATA_PLATFORM: Generic platform device PATA support PATA_OF_PLATFORM: OpenFirmware platform device PATA support If an architecture allows the generic platform device PATA support, it shall select HAVE_PATA_PLATFORM. Then, Generic platform device PATA support is available and can be selected. If an architecture has OpenFirmware support, which it indicates by selecting OF, OpenFirmware platform device PATA support is available and can be selected. If OpenFirmware platform device PATA support is selected, then the functionality (code files) from Generic platform device PATA support needs to be integrated in the kernel build for the OpenFirmware platform device PATA support to work. Select PATA_PLATFORM in PATA_OF_PLATFORM to make sure the needed files are added in the build. So, architectures with OpenFirmware support, do not need to additionally select HAVE_PATA_PLATFORM. It is only needed by architecture that want the non-OF pata-platform module. Reflect this way of intended use of config symbols in the ata Kconfig and adjust all architecture definitions. This follows the suggestion from Arnd Bergmann (see Link). Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/all/4b33bffc-2b6d-46b4-9f1d-d18e55975a5a@www.fastmail.com/ Signed-off-by: Lukas Bulwahn Reviewed-by: Arnd Bergmann Signed-off-by: Damien Le Moal commit 55d5ba550535c970c03cd0d0008ad1d61b238be4 Author: Li Zhong Date: Sat Sep 3 16:10:39 2022 -0700 ata: libata-core: Check errors in sata_print_link_status() sata_scr_read() could return negative error code on failure. Check the return value when reading the control register. Signed-off-by: Li Zhong Signed-off-by: Damien Le Moal commit 03070458d700242f1caf6ede4225a728145ccd77 Author: Shaomin Deng Date: Tue Aug 30 03:50:24 2022 -0400 ata: libata-sff: Fix double word in comments Remove the repeated word "Transfer" in comments. Signed-off-by: Shaomin Deng Signed-off-by: Damien Le Moal commit 0b2436d3d25fe77573669a946aa26f3087918a75 Author: Shaomin Deng Date: Thu Aug 25 10:52:15 2022 -0400 ata: pata_macio: Remove unneeded word in comments There is unneeded word "to" in line 669, so remove it. Signed-off-by: Shaomin Deng Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 024811a2da45a79d58ba61b524441722510d5dc5 Author: Damien Le Moal Date: Fri Aug 26 07:43:30 2022 +0900 ata: libata-core: Simplify ata_dev_set_xfermode() The err_mask variable is not useful. Remove it. Signed-off-by: Damien Le Moal commit 1bdb0fbb2e27c51a6f311867726462c983a1d9ee Author: James Morse Date: Fri Sep 9 17:59:38 2022 +0100 arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510 Cortex-A510's erratum #2658417 causes two BF16 instructions to return the wrong result in rare circumstances when a pair of A510 CPUs are using shared neon hardware. The two instructions affected are BFMMLA and VMMLA, support for these is indicated by the BF16 HWCAP. Remove it on affected platforms. Signed-off-by: James Morse Link: https://lore.kernel.org/r/20220909165938.3931307-4-james.morse@arm.com [catalin.marinas@arm.com: add revision to the Kconfig help; remove .type] Signed-off-by: Catalin Marinas commit 445c953e4a84b2942bdb5c0b5aff571c903680fe Author: James Morse Date: Fri Sep 9 17:59:37 2022 +0100 arm64: cpufeature: Expose get_arm64_ftr_reg() outside cpufeature.c get_arm64_ftr_reg() returns the properties of a system register based on its instruction encoding. This is needed by erratum workaround in cpu_errata.c to modify the user-space visible view of id registers. Signed-off-by: James Morse Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220909165938.3931307-3-james.morse@arm.com Signed-off-by: Catalin Marinas commit 237405ebef580a7352a52129b2465c117145eafa Author: James Morse Date: Fri Sep 9 17:59:36 2022 +0100 arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space arm64 advertises hardware features to user-space via HWCAPs, and by emulating access to the CPUs id registers. The cpufeature code has a sanitised system-wide view of an id register, and a sanitised user-space view of an id register, where some features use their 'safe' value instead of the hardware value. It is currently possible for a HWCAP to be advertised where the user-space view of the id register does not show the feature as supported. Erratum workaround need to remove both the HWCAP, and the feature from the user-space view of the id register. This involves duplicating the code, and spreading it over cpufeature.c and cpu_errata.c. Make the HWCAP code use the user-space view of id registers. This ensures the values never diverge, and allows erratum workaround to remove HWCAP by modifying the user-space view of the id register. Signed-off-by: James Morse Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220909165938.3931307-2-james.morse@arm.com Signed-off-by: Catalin Marinas commit e4dc45b1848bc6bcac31eb1b4ccdd7f6718b3c86 Author: Arvind Yadav Date: Wed Sep 14 22:13:20 2022 +0530 drm/sched: Use parent fence instead of finished Using the parent fence instead of the finished fence to get the job status. This change is to avoid GPU scheduler timeout error which can cause GPU reset. Signed-off-by: Arvind Yadav Reviewed-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220914164321.2156-6-Arvind.Yadav@amd.com Signed-off-by: Christian König commit b96fb1e724ae6839d5bffcf42dd3503db7cc7df5 Author: Arvind Yadav Date: Wed Sep 14 22:13:19 2022 +0530 dma-buf: dma_fence_wait must enable signaling dma_fence_wait() should always enable signaling even when the fence is already signaled. Signed-off-by: Arvind Yadav Link: https://patchwork.freedesktop.org/patch/msgid/20220914164321.2156-5-Arvind.Yadav@amd.com Signed-off-by: Christian König commit d62c43a953ce02d54521ec06217d0c2ed6d489af Author: Arvind Yadav Date: Wed Sep 14 22:13:18 2022 +0530 dma-buf: Enable signaling on fence for selftests Here's enabling software signaling on fence for selftest. Signed-off-by: Arvind Yadav Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220914164321.2156-4-Arvind.Yadav@amd.com Signed-off-by: Christian König commit c85d00d4fd8b98ea4d16817f397a4de5e177afd6 Author: Arvind Yadav Date: Wed Sep 14 22:13:17 2022 +0530 dma-buf: set signaling bit for the stub fence Here's setting software signaling bit for the stub fence which is always signaled. If this fence signaling bit is not set then the AMD GPU scheduler will cause a GPU reset due to a GPU scheduler cleanup activity timeout. Signed-off-by: Arvind Yadav Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220914164321.2156-3-Arvind.Yadav@amd.com Signed-off-by: Christian König commit 6ad9aa476ce23be45de9dcb03edcdbfdf6117c25 Author: Arvind Yadav Date: Wed Sep 14 22:13:16 2022 +0530 dma-buf: Remove the signaled bit status check Remove the signaled bit status check because it is returning early when the fence is already signaled and __dma_fence_enable_signaling is checking the status of signaled bit again. Signed-off-by: Arvind Yadav Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220914164321.2156-2-Arvind.Yadav@amd.com Signed-off-by: Christian König commit 437d49b051e8ca80d2ffa8f3fd98ce58755c2758 Author: Dmitry Torokhov Date: Wed Sep 14 07:14:28 2022 -0700 dt-bindings: input: auo-pixcir-ts: fix gpio and interrupt properties Add proper interrupt trigger and gpio polarity data to the binding example. Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220914141428.2201784-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 770a71b23c29c28ed467af488821b4b144ef6953 Author: Dmitry Torokhov Date: Wed Sep 14 07:14:27 2022 -0700 Input: auo-pixcir-ts - switch to using generic device properties Let's use generic device properties API instead of OF-specific one. Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220914141428.2201784-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 60b7a6d0fdf310f31bc4b9027e3271891b428b0a Author: Dmitry Torokhov Date: Wed Sep 14 07:14:26 2022 -0700 Input: auo-pixcir-ts - do not force rising edge interrupt trigger Instead of hard-coding rising edge as the interrupt trigger, let's rely on the platform (ACPI, DT) to configure the interrupt properly. Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220914141428.2201784-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit a750e24a2f2203d5024a905ce6ea8fcd7a9fd8e2 Author: Dmitry Torokhov Date: Wed Sep 14 07:14:25 2022 -0700 Input: auo-pixcir-ts - switch to using gpiod API This switches the driver to gpiod API and drops uses of of_get_gpio() API. Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220914141428.2201784-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 882597aff2d442a52ca173c293939232c2e1ebea Author: Dmitry Torokhov Date: Wed Sep 14 07:14:24 2022 -0700 Input: auo-pixcir-ts - drop support for platform data Currently there are no users of auo_pixcir_ts_platdata in the mainline, and having it (with legacy gpio numbers) prevents us from converting the driver to gpiod API, so let's drop it. If, in the future, someone wants to use this driver on non-device tree, non-ACPI system, they should use static device properties instead of platform data. Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220914141428.2201784-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 862deb68c1bc19783ab7a98ba17a441aa76eba52 Merge: 030eed86cbe10 eed791d3ca951 Author: David S. Miller Date: Fri Sep 16 14:25:17 2022 +0100 Merge branch 'net-tc-testing-new-tests' Zhengchao Shao says: ==================== net: add tc-testing test cases For this patchset, test cases of the ctinfo, gate, and xt action modules are added to the tc-testing test suite. Also add deleting test for connmark, ife, nat, sample and tunnel_key action modules. After a test case is added locally, the test result is as follows: ./tdc.py -c action ctinfo considering category action considering category ctinfo Test c826: Add ctinfo action with default setting Test 0286: Add ctinfo action with dscp Test 4938: Add ctinfo action with valid cpmark and zone Test 7593: Add ctinfo action with drop control Test 2961: Replace ctinfo action zone and action control Test e567: Delete ctinfo action with valid index Test 6a91: Delete ctinfo action with invalid index Test 5232: List ctinfo actions Test 7702: Flush ctinfo actions Test 3201: Add ctinfo action with duplicate index Test 8295: Add ctinfo action with invalid index Test 3964: Replace ctinfo action with invalid goto_chain control All test results: 1..12 ok 1 c826 - Add ctinfo action with default setting ok 2 0286 - Add ctinfo action with dscp ok 3 4938 - Add ctinfo action with valid cpmark and zone ok 4 7593 - Add ctinfo action with drop control ok 5 2961 - Replace ctinfo action zone and action control ok 6 e567 - Delete ctinfo action with valid index ok 7 6a91 - Delete ctinfo action with invalid index ok 8 5232 - List ctinfo actions ok 9 7702 - Flush ctinfo actions ok 10 3201 - Add ctinfo action with duplicate index ok 11 8295 - Add ctinfo action with invalid index ok 12 3964 - Replace ctinfo action with invalid goto_chain control ./tdc.py -c action gate considering category gate considering category action Test 5153: Add gate action with priority and sched-entry Test 7189: Add gate action with base-time Test a721: Add gate action with cycle-time Test c029: Add gate action with cycle-time-ext Test 3719: Replace gate base-time action Test d821: Delete gate action with valid index Test 3128: Delete gate action with invalid index Test 7837: List gate actions Test 9273: Flush gate actions Test c829: Add gate action with duplicate index Test 3043: Add gate action with invalid index Test 2930: Add gate action with cookie All test results: 1..12 ok 1 5153 - Add gate action with priority and sched-entry ok 2 7189 - Add gate action with base-time ok 3 a721 - Add gate action with cycle-time ok 4 c029 - Add gate action with cycle-time-ext ok 5 3719 - Replace gate base-time action ok 6 d821 - Delete gate action with valid index ok 7 3128 - Delete gate action with invalid index ok 8 7837 - List gate actions ok 9 9273 - Flush gate actions ok 10 c829 - Add gate action with duplicate index ok 11 3043 - Add gate action with invalid index ok 12 2930 - Add gate action with cookie ./tdc.py -c action xt considering category xt considering category action Test 2029: Add xt action with log-prefix Test 3562: Replace xt action log-prefix Test 8291: Delete xt action with valid index Test 5169: Delete xt action with invalid index Test 7284: List xt actions Test 5010: Flush xt actions Test 8437: Add xt action with duplicate index Test 2837: Add xt action with invalid index All test results: 1..8 ok 1 2029 - Add xt action with log-prefix ok 2 3562 - Replace xt action log-prefix ok 3 8291 - Delete xt action with valid index ok 4 5169 - Delete xt action with invalid index ok 5 7284 - List xt actions ok 6 5010 - Flush xt actions ok 7 8437 - Add xt action with duplicate index ok 8 2837 - Add xt action with invalid index ./tdc.py -c action connmark considering category action considering category connmark Test 2002: Add valid connmark action with defaults Test 56a5: Add valid connmark action with control pass Test 7c66: Add valid connmark action with control drop Test a913: Add valid connmark action with control pipe Test bdd8: Add valid connmark action with control reclassify Test b8be: Add valid connmark action with control continue Test d8a6: Add valid connmark action with control jump Test aae8: Add valid connmark action with zone argument Test 2f0b: Add valid connmark action with invalid zone argument Test 9305: Add connmark action with unsupported argument Test 71ca: Add valid connmark action and replace it Test 5f8f: Add valid connmark action with cookie Test c506: Replace connmark with invalid goto chain control Test 6571: Delete connmark action with valid index Test 3426: Delete connmark action with invalid index All test results: 1..15 ok 1 2002 - Add valid connmark action with defaults ok 2 56a5 - Add valid connmark action with control pass ok 3 7c66 - Add valid connmark action with control drop ok 4 a913 - Add valid connmark action with control pipe ok 5 bdd8 - Add valid connmark action with control reclassify ok 6 b8be - Add valid connmark action with control continue ok 7 d8a6 - Add valid connmark action with control jump ok 8 aae8 - Add valid connmark action with zone argument ok 9 2f0b - Add valid connmark action with invalid zone argument ok 10 9305 - Add connmark action with unsupported argument ok 11 71ca - Add valid connmark action and replace it ok 12 5f8f - Add valid connmark action with cookie ok 13 c506 - Replace connmark with invalid goto chain control ok 14 6571 - Delete connmark action with valid index ok 15 3426 - Delete connmark action with invalid index ./tdc.py -c action ife considering category action considering category ife Test 7682: Create valid ife encode action with mark and pass control Test ef47: Create valid ife encode action with mark and pipe control Test df43: Create valid ife encode action with mark and continue control Test e4cf: Create valid ife encode action with mark and drop control Test ccba: Create valid ife encode action with mark and reclassify control Test a1cf: Create valid ife encode action with mark and jump control Test cb3d: Create valid ife encode action with mark value at 32-bit maximum Test 1efb: Create ife encode action with mark value exceeding 32-bit maximum Test 95ed: Create valid ife encode action with prio and pass control Test aa17: Create valid ife encode action with prio and pipe control Test 74c7: Create valid ife encode action with prio and continue control Test 7a97: Create valid ife encode action with prio and drop control Test f66b: Create valid ife encode action with prio and reclassify control Test 3056: Create valid ife encode action with prio and jump control Test 7dd3: Create valid ife encode action with prio value at 32-bit maximum Test 2ca1: Create ife encode action with prio value exceeding 32-bit maximum Test 05bb: Create valid ife encode action with tcindex and pass control Test ce65: Create valid ife encode action with tcindex and pipe control Test 09cd: Create valid ife encode action with tcindex and continue control Test 8eb5: Create valid ife encode action with tcindex and continue control Test 451a: Create valid ife encode action with tcindex and drop control Test d76c: Create valid ife encode action with tcindex and reclassify control Test e731: Create valid ife encode action with tcindex and jump control Test b7b8: Create valid ife encode action with tcindex value at 16-bit maximum Test d0d8: Create ife encode action with tcindex value exceeding 16-bit maximum Test 2a9c: Create valid ife encode action with mac src parameter Test cf5c: Create valid ife encode action with mac dst parameter Test 2353: Create valid ife encode action with mac src and mac dst parameters Test 552c: Create valid ife encode action with mark and type parameters Test 0421: Create valid ife encode action with prio and type parameters Test 4017: Create valid ife encode action with tcindex and type parameters Test fac3: Create valid ife encode action with index at 32-bit maximum Test 7c25: Create valid ife decode action with pass control Test dccb: Create valid ife decode action with pipe control Test 7bb9: Create valid ife decode action with continue control Test d9ad: Create valid ife decode action with drop control Test 219f: Create valid ife decode action with reclassify control Test 8f44: Create valid ife decode action with jump control Test 56cf: Create ife encode action with index exceeding 32-bit maximum Test ee94: Create ife encode action with invalid control Test b330: Create ife encode action with cookie Test bbc0: Create ife encode action with invalid argument Test d54a: Create ife encode action with invalid type argument Test 7ee0: Create ife encode action with invalid mac src argument Test 0a7d: Create ife encode action with invalid mac dst argument Test a0e2: Replace ife encode action with invalid goto chain control Test a972: Delete ife encode action with valid index Test 1272: Delete ife encode action with invalid index All test results: 1..48 ok 1 7682 - Create valid ife encode action with mark and pass control ok 2 ef47 - Create valid ife encode action with mark and pipe control ok 3 df43 - Create valid ife encode action with mark and continue control ok 4 e4cf - Create valid ife encode action with mark and drop control ok 5 ccba - Create valid ife encode action with mark and reclassify control ok 6 a1cf - Create valid ife encode action with mark and jump control ok 7 cb3d - Create valid ife encode action with mark value at 32-bit maximum ok 8 1efb - Create ife encode action with mark value exceeding 32-bit maximum ok 9 95ed - Create valid ife encode action with prio and pass control ok 10 aa17 - Create valid ife encode action with prio and pipe control ok 11 74c7 - Create valid ife encode action with prio and continue control ok 12 7a97 - Create valid ife encode action with prio and drop control ok 13 f66b - Create valid ife encode action with prio and reclassify control ok 14 3056 - Create valid ife encode action with prio and jump control ok 15 7dd3 - Create valid ife encode action with prio value at 32-bit maximum ok 16 2ca1 - Create ife encode action with prio value exceeding 32-bit maximum ok 17 05bb - Create valid ife encode action with tcindex and pass control ok 18 ce65 - Create valid ife encode action with tcindex and pipe control ok 19 09cd - Create valid ife encode action with tcindex and continue control ok 20 8eb5 - Create valid ife encode action with tcindex and continue control ok 21 451a - Create valid ife encode action with tcindex and drop control ok 22 d76c - Create valid ife encode action with tcindex and reclassify control ok 23 e731 - Create valid ife encode action with tcindex and jump control ok 24 b7b8 - Create valid ife encode action with tcindex value at 16-bit maximum ok 25 d0d8 - Create ife encode action with tcindex value exceeding 16-bit maximum ok 26 2a9c - Create valid ife encode action with mac src parameter ok 27 cf5c - Create valid ife encode action with mac dst parameter ok 28 2353 - Create valid ife encode action with mac src and mac dst parameters ok 29 552c - Create valid ife encode action with mark and type parameters ok 30 0421 - Create valid ife encode action with prio and type parameters ok 31 4017 - Create valid ife encode action with tcindex and type parameters ok 32 fac3 - Create valid ife encode action with index at 32-bit maximum ok 33 7c25 - Create valid ife decode action with pass control ok 34 dccb - Create valid ife decode action with pipe control ok 35 7bb9 - Create valid ife decode action with continue control ok 36 d9ad - Create valid ife decode action with drop control ok 37 219f - Create valid ife decode action with reclassify control ok 38 8f44 - Create valid ife decode action with jump control ok 39 56cf - Create ife encode action with index exceeding 32-bit maximum ok 40 ee94 - Create ife encode action with invalid control ok 41 b330 - Create ife encode action with cookie ok 42 bbc0 - Create ife encode action with invalid argument ok 43 d54a - Create ife encode action with invalid type argument ok 44 7ee0 - Create ife encode action with invalid mac src argument ok 45 0a7d - Create ife encode action with invalid mac dst argument ok 46 a0e2 - Replace ife encode action with invalid goto chain control ok 47 a972 - Delete ife encode action with valid index ok 48 1272 - Delete ife encode action with invalid index ./tdc.py -c action nat considering category action considering category nat Test 7565: Add nat action on ingress with default control action Test fd79: Add nat action on ingress with pipe control action Test eab9: Add nat action on ingress with continue control action Test c53a: Add nat action on ingress with reclassify control action Test 76c9: Add nat action on ingress with jump control action Test 24c6: Add nat action on ingress with drop control action Test 2120: Add nat action on ingress with maximum index value Test 3e9d: Add nat action on ingress with invalid index value Test f6c9: Add nat action on ingress with invalid IP address Test be25: Add nat action on ingress with invalid argument Test a7bd: Add nat action on ingress with DEFAULT IP address Test ee1e: Add nat action on ingress with ANY IP address Test 1de8: Add nat action on ingress with ALL IP address Test 8dba: Add nat action on egress with default control action Test 19a7: Add nat action on egress with pipe control action Test f1d9: Add nat action on egress with continue control action Test 6d4a: Add nat action on egress with reclassify control action Test b313: Add nat action on egress with jump control action Test d9fc: Add nat action on egress with drop control action Test a895: Add nat action on egress with DEFAULT IP address Test 2572: Add nat action on egress with ANY IP address Test 37f3: Add nat action on egress with ALL IP address Test 6054: Add nat action on egress with cookie Test 79d6: Add nat action on ingress with cookie Test 4b12: Replace nat action with invalid goto chain control Test b811: Delete nat action with valid index Test a521: Delete nat action with invalid index All test results: 1..27 ok 1 7565 - Add nat action on ingress with default control action ok 2 fd79 - Add nat action on ingress with pipe control action ok 3 eab9 - Add nat action on ingress with continue control action ok 4 c53a - Add nat action on ingress with reclassify control action ok 5 76c9 - Add nat action on ingress with jump control action ok 6 24c6 - Add nat action on ingress with drop control action ok 7 2120 - Add nat action on ingress with maximum index value ok 8 3e9d - Add nat action on ingress with invalid index value ok 9 f6c9 - Add nat action on ingress with invalid IP address ok 10 be25 - Add nat action on ingress with invalid argument ok 11 a7bd - Add nat action on ingress with DEFAULT IP address ok 12 ee1e - Add nat action on ingress with ANY IP address ok 13 1de8 - Add nat action on ingress with ALL IP address ok 14 8dba - Add nat action on egress with default control action ok 15 19a7 - Add nat action on egress with pipe control action ok 16 f1d9 - Add nat action on egress with continue control action ok 17 6d4a - Add nat action on egress with reclassify control action ok 18 b313 - Add nat action on egress with jump control action ok 19 d9fc - Add nat action on egress with drop control action ok 20 a895 - Add nat action on egress with DEFAULT IP address ok 21 2572 - Add nat action on egress with ANY IP address ok 22 37f3 - Add nat action on egress with ALL IP address ok 23 6054 - Add nat action on egress with cookie ok 24 79d6 - Add nat action on ingress with cookie ok 25 4b12 - Replace nat action with invalid goto chain control ok 26 b811 - Delete nat action with valid index ok 27 a521 - Delete nat action with invalid index ./tdc.py -c action sample considering category action considering category sample Test 9784: Add valid sample action with mandatory arguments Test 5c91: Add valid sample action with mandatory arguments and continue control action Test 334b: Add valid sample action with mandatory arguments and drop control action Test da69: Add valid sample action with mandatory arguments and reclassify control action Test 13ce: Add valid sample action with mandatory arguments and pipe control action Test 1886: Add valid sample action with mandatory arguments and jump control action Test 7571: Add sample action with invalid rate Test b6d4: Add sample action with mandatory arguments and invalid control action Test a874: Add invalid sample action without mandatory arguments Test ac01: Add invalid sample action without mandatory argument rate Test 4203: Add invalid sample action without mandatory argument group Test 14a7: Add invalid sample action without mandatory argument group Test 8f2e: Add valid sample action with trunc argument Test 45f8: Add sample action with maximum rate argument Test ad0c: Add sample action with maximum trunc argument Test 83a9: Add sample action with maximum group argument Test ed27: Add sample action with invalid rate argument Test 2eae: Add sample action with invalid group argument Test 6ff3: Add sample action with invalid trunc size Test 2b2a: Add sample action with invalid index Test dee2: Add sample action with maximum allowed index Test 560e: Add sample action with cookie Test 704a: Replace existing sample action with new rate argument Test 60eb: Replace existing sample action with new group argument Test 2cce: Replace existing sample action with new trunc argument Test 59d1: Replace existing sample action with new control argument Test 0a6e: Replace sample action with invalid goto chain control Test 3872: Delete sample action with valid index Test a394: Delete sample action with invalid index All test results: 1..29 ok 1 9784 - Add valid sample action with mandatory arguments ok 2 5c91 - Add valid sample action with mandatory arguments and continue control action ok 3 334b - Add valid sample action with mandatory arguments and drop control action ok 4 da69 - Add valid sample action with mandatory arguments and reclassify control action ok 5 13ce - Add valid sample action with mandatory arguments and pipe control action ok 6 1886 - Add valid sample action with mandatory arguments and jump control action ok 7 7571 - Add sample action with invalid rate ok 8 b6d4 - Add sample action with mandatory arguments and invalid control action ok 9 a874 - Add invalid sample action without mandatory arguments ok 10 ac01 - Add invalid sample action without mandatory argument rate ok 11 4203 - Add invalid sample action without mandatory argument group ok 12 14a7 - Add invalid sample action without mandatory argument group ok 13 8f2e - Add valid sample action with trunc argument ok 14 45f8 - Add sample action with maximum rate argument ok 15 ad0c - Add sample action with maximum trunc argument ok 16 83a9 - Add sample action with maximum group argument ok 17 ed27 - Add sample action with invalid rate argument ok 18 2eae - Add sample action with invalid group argument ok 19 6ff3 - Add sample action with invalid trunc size ok 20 2b2a - Add sample action with invalid index ok 21 dee2 - Add sample action with maximum allowed index ok 22 560e - Add sample action with cookie ok 23 704a - Replace existing sample action with new rate argument ok 24 60eb - Replace existing sample action with new group argument ok 25 2cce - Replace existing sample action with new trunc argument ok 26 59d1 - Replace existing sample action with new control argument ok 27 0a6e - Replace sample action with invalid goto chain control ok 28 3872 - Delete sample action with valid index ok 29 a394 - Delete sample action with invalid index ./tdc.py -c action tunnel_key considering category tunnel_key considering category action Test 2b11: Add tunnel_key set action with mandatory parameters Test dc6b: Add tunnel_key set action with missing mandatory src_ip parameter Test 7f25: Add tunnel_key set action with missing mandatory dst_ip parameter Test a5e0: Add tunnel_key set action with invalid src_ip parameter Test eaa8: Add tunnel_key set action with invalid dst_ip parameter Test 3b09: Add tunnel_key set action with invalid id parameter Test 9625: Add tunnel_key set action with invalid dst_port parameter Test 05af: Add tunnel_key set action with optional dst_port parameter Test da80: Add tunnel_key set action with index at 32-bit maximum Test d407: Add tunnel_key set action with index exceeding 32-bit maximum Test 5cba: Add tunnel_key set action with id value at 32-bit maximum Test e84a: Add tunnel_key set action with id value exceeding 32-bit maximum Test 9c19: Add tunnel_key set action with dst_port value at 16-bit maximum Test 3bd9: Add tunnel_key set action with dst_port value exceeding 16-bit maximum Test 68e2: Add tunnel_key unset action Test 6192: Add tunnel_key unset continue action Test 061d: Add tunnel_key set continue action with cookie Test 8acb: Add tunnel_key set continue action with invalid cookie Test a07e: Add tunnel_key action with no set/unset command specified Test b227: Add tunnel_key action with csum option Test 58a7: Add tunnel_key action with nocsum option Test 2575: Add tunnel_key action with not-supported parameter Test 7a88: Add tunnel_key action with cookie parameter Test 4f20: Add tunnel_key action with a single geneve option parameter Test e33d: Add tunnel_key action with multiple geneve options parameter Test 0778: Add tunnel_key action with invalid class geneve option parameter Test 4ae8: Add tunnel_key action with invalid type geneve option parameter Test 4039: Add tunnel_key action with short data length geneve option parameter Test 26a6: Add tunnel_key action with non-multiple of 4 data length geneve option parameter Test f44d: Add tunnel_key action with incomplete geneve options parameter Test 7afc: Replace tunnel_key set action with all parameters Test 364d: Replace tunnel_key set action with all parameters and cookie Test 937c: Fetch all existing tunnel_key actions Test 6783: Flush all existing tunnel_key actions Test 8242: Replace tunnel_key set action with invalid goto chain Test 0cd2: Add tunnel_key set action with no_percpu flag Test 3671: Delete tunnel_key set action with valid index Test 8597: Delete tunnel_key set action with invalid index All test results: 1..38 ok 1 2b11 - Add tunnel_key set action with mandatory parameters ok 2 dc6b - Add tunnel_key set action with missing mandatory src_ip parameter ok 3 7f25 - Add tunnel_key set action with missing mandatory dst_ip parameter ok 4 a5e0 - Add tunnel_key set action with invalid src_ip parameter ok 5 eaa8 - Add tunnel_key set action with invalid dst_ip parameter ok 6 3b09 - Add tunnel_key set action with invalid id parameter ok 7 9625 - Add tunnel_key set action with invalid dst_port parameter ok 8 05af - Add tunnel_key set action with optional dst_port parameter ok 9 da80 - Add tunnel_key set action with index at 32-bit maximum ok 10 d407 - Add tunnel_key set action with index exceeding 32-bit maximum ok 11 5cba - Add tunnel_key set action with id value at 32-bit maximum ok 12 e84a - Add tunnel_key set action with id value exceeding 32-bit maximum ok 13 9c19 - Add tunnel_key set action with dst_port value at 16-bit maximum ok 14 3bd9 - Add tunnel_key set action with dst_port value exceeding 16-bit maximum ok 15 68e2 - Add tunnel_key unset action ok 16 6192 - Add tunnel_key unset continue action ok 17 061d - Add tunnel_key set continue action with cookie ok 18 8acb - Add tunnel_key set continue action with invalid cookie ok 19 a07e - Add tunnel_key action with no set/unset command specified ok 20 b227 - Add tunnel_key action with csum option ok 21 58a7 - Add tunnel_key action with nocsum option ok 22 2575 - Add tunnel_key action with not-supported parameter ok 23 7a88 - Add tunnel_key action with cookie parameter ok 24 4f20 - Add tunnel_key action with a single geneve option parameter ok 25 e33d - Add tunnel_key action with multiple geneve options parameter ok 26 0778 - Add tunnel_key action with invalid class geneve option parameter ok 27 4ae8 - Add tunnel_key action with invalid type geneve option parameter ok 28 4039 - Add tunnel_key action with short data length geneve option parameter ok 29 26a6 - Add tunnel_key action with non-multiple of 4 data length geneve option parameter ok 30 f44d - Add tunnel_key action with incomplete geneve options parameter ok 31 7afc - Replace tunnel_key set action with all parameters ok 32 364d - Replace tunnel_key set action with all parameters and cookie ok 33 937c - Fetch all existing tunnel_key actions ok 34 6783 - Flush all existing tunnel_key actions ok 35 8242 - Replace tunnel_key set action with invalid goto chain ok 36 0cd2 - Add tunnel_key set action with no_percpu flag ok 37 3671 - Delete tunnel_key set action with valid index ok 38 8597 - Delete tunnel_key set action with invalid index ==================== Reviewed-by: Victor Nogueira Tested-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit eed791d3ca9514656421d8b657031d80433eeda4 Author: Zhengchao Shao Date: Fri Sep 9 09:29:36 2022 +0800 selftests/tc-testings: add tunnel_key action deleting test case Test 3671: Delete tunnel_key set action with valid index Test 8597: Delete tunnel_key set action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit a32a4fa447f58edda2ee2eb1be9ce1260cfd6a40 Author: Zhengchao Shao Date: Fri Sep 9 09:29:35 2022 +0800 selftests/tc-testings: add sample action deleting test case Test 3872: Delete sample action with valid index Test a394: Delete sample action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 043b16435f3d9b32e26df528c0528052b053869e Author: Zhengchao Shao Date: Fri Sep 9 09:29:34 2022 +0800 selftests/tc-testings: add nat action deleting test case Test b811: Delete nat action with valid index Test a521: Delete nat action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit af649e7a6a53fe5f2e21d930d1d1cc3b19310f11 Author: Zhengchao Shao Date: Fri Sep 9 09:29:33 2022 +0800 selftests/tc-testings: add ife action deleting test case Test a972: Delete ife encode action with valid index Test 1272: Delete ife encode action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 0fc8674663f6327fdeddc40f9f1abe26726341ab Author: Zhengchao Shao Date: Fri Sep 9 09:29:32 2022 +0800 selftests/tc-testings: add connmark action deleting test case Test 6571: Delete connmark action with valid index Test 3426: Delete connmark action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 910d504bc1879f2f89ac54b288924b0af1664287 Author: Zhengchao Shao Date: Fri Sep 9 09:29:31 2022 +0800 selftests/tc-testings: add selftests for xt action Test 2029: Add xt action with log-prefix Test 3562: Replace xt action log-prefix Test 8291: Delete xt action with valid index Test 5169: Delete xt action with invalid index Test 7284: List xt actions Test 5010: Flush xt actions Test 8437: Add xt action with duplicate index Test 2837: Add xt action with invalid index Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 4a1db5251cfac32290fa006afb7415222b8ff8f3 Author: Zhengchao Shao Date: Fri Sep 9 09:29:30 2022 +0800 selftests/tc-testings: add selftests for gate action Test 5153: Add gate action with priority and sched-entry Test 7189: Add gate action with base-time Test a721: Add gate action with cycle-time Test c029: Add gate action with cycle-time-ext Test 3719: Replace gate base-time action Test d821: Delete gate action with valid index Test 3128: Delete gate action with invalid index Test 7837: List gate actions Test 9273: Flush gate actions Test c829: Add gate action with duplicate index Test 3043: Add gate action with invalid index Test 2930: Add gate action with cookie Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 77cba3879f1bc9259b3683ea5862b5ca5ff98f43 Author: Zhengchao Shao Date: Fri Sep 9 09:29:29 2022 +0800 selftests/tc-testings: add selftests for ctinfo action Test c826: Add ctinfo action with default setting Test 0286: Add ctinfo action with dscp Test 4938: Add ctinfo action with valid cpmark and zone Test 7593: Add ctinfo action with drop control Test 2961: Replace ctinfo action zone and action control Test e567: Delete ctinfo action with valid index Test 6a91: Delete ctinfo action with invalid index Test 5232: List ctinfo actions Test 7702: Flush ctinfo actions Test 3201: Add ctinfo action with duplicate index Test 8295: Add ctinfo action with invalid index Test 3964: Replace ctinfo action with invalid goto_chain control Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit a080f9ad604598a4d32ea36fbf96437c92ccacb4 Author: Pali Rohár Date: Tue Jul 12 00:59:15 2022 +0200 PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge Register with Subsystem Device/Vendor ID is at offset 0x2c. Export it via the emulated bridge to enable support for the Subsystem Device/Vendor ID - by reading it in the PCI controller config space and storing it in the emulated bridge control structures, so that it is exposed in the respective PCI capability. After this change Subsystem ID is visible in lspci output at line: Capabilities: [40] Subsystem Link: https://lore.kernel.org/r/20220711225915.13896-1-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit ef939f30510b43e90f1fba30477b678107faeae7 Author: Mark Brown Date: Tue Sep 13 15:11:01 2022 +0100 kselftest/arm64: Add hwcap test for RNG Validate the RNG hwcap and make sure we don't generate a SIGILL reading RNDR when it is reported. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220913141101.151400-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 859a9d51a268f176b6b42b2c0fba997967a198ed Author: Mark Brown Date: Tue Sep 13 15:11:00 2022 +0100 kselftest/arm64: Add SVE 2 to the tested hwcaps Include SVE 2 and the various subfeatures it adds in the set of hwcaps we check for. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220913141101.151400-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 78d2b1976b515a9f24a9784c8415b285a092dd3c Author: Mark Brown Date: Tue Sep 13 15:10:59 2022 +0100 kselftest/arm64: Add missing newline in hwcap output Clean up the output of the test by adding a missing newline, the fix had been done locally but didn't make it into the applied version. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220913141101.151400-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 10453bf149c9539c446574932f00ea50438cede5 Author: Mark Brown Date: Sat Sep 10 17:33:54 2022 +0100 arm64/sysreg: Convert ID_AA64AFRn_EL1 to automatic generation Convert ID_AA64AFRn_EL1 to automatic generation as per DDI0487I.a, no functional changes. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit c65c617806ed490cf0ed09a151c627e41ce6e0c6 Author: Mark Brown Date: Sat Sep 10 17:33:53 2022 +0100 arm64/sysreg: Convert ID_AA64DFR1_EL1 to automatic generation Convert ID_AA64FDR1_EL1 to automatic generation as per DDI0487I.a, no functional changes. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit e62a2d2610f0e6cf803027e3803c822140a2a407 Author: Mark Brown Date: Sat Sep 10 17:33:52 2022 +0100 arm64/sysreg: Convert ID_AA64FDR0_EL1 to automatic generation Convert ID_AA64DFR0_EL1 to automatic generation as per DDI0487I.a, no functional changes. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 121a8fc088f13c64d9f3c9b3e7faa4c246e0a32c Author: Mark Brown Date: Sat Sep 10 17:33:51 2022 +0100 arm64/sysreg: Use feature numbering for PMU and SPE revisions Currently the kernel refers to the versions of the PMU and SPE features by the version of the architecture where those features were updated but the ARM refers to them using the FEAT_ names for the features. To improve consistency and help with updating for newer features and since v9 will make our current naming scheme a bit more confusing update the macros identfying features to use the FEAT_ based scheme. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit fcf37b38ff2282ef3dc6ba1966c83b29e5734edd Author: Mark Brown Date: Sat Sep 10 17:33:50 2022 +0100 arm64/sysreg: Add _EL1 into ID_AA64DFR0_EL1 definition names Normally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64DFR0_EL1 to follow the convention. No functional changes. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit c0357a73fa4a96d8ed9ee46e9927d9fcbc9d0828 Author: Mark Brown Date: Sat Sep 10 17:33:49 2022 +0100 arm64/sysreg: Align field names in ID_AA64DFR0_EL1 with architecture The naming scheme the architecture uses for the fields in ID_AA64DFR0_EL1 does not align well with kernel conventions, using as it does a lot of MixedCase in various arrangements. In preparation for automatically generating the defines for this register rename the defines used to match what is in the architecture. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220910163354.860255-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 830a2a4d853f2c4a1e4606aa03341b7f273b0e9b Author: Mark Rutland Date: Tue Sep 13 11:17:32 2022 +0100 arm64: rework BTI exception handling If a BTI exception is taken from EL1, the entry code will treat this as an unhandled exception and will panic() the kernel. This is inconsistent with the way we handle FPAC exceptions, which have a dedicated handler and only necessarily kill the thread from which the exception was taken from, and we don't log all the information that could be relevant to debug the issue. The code in do_bti() has: BUG_ON(!user_mode(regs)); ... and it seems like the intent was to call this for EL1 BTI exceptions, as with FPAC, but this was omitted due to an oversight. This patch adds separate EL0 and EL1 BTI exception handlers, with the latter calling die() directly to report the original context the BTI exception was taken from. This matches our handling of FPAC exceptions. Prior to this patch, a BTI failure is reported as: | Unhandled 64-bit el1h sync exception on CPU0, ESR 0x0000000034000002 -- BTI | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc3-00131-g7d937ff0221d-dirty #9 | Hardware name: linux,dummy-virt (DT) | pstate: 20400809 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=-c) | pc : test_bti_callee+0x4/0x10 | lr : test_bti_caller+0x1c/0x28 | sp : ffff80000800bdf0 | x29: ffff80000800bdf0 x28: 0000000000000000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: ffff80000a2b8000 x22: 0000000000000000 x21: 0000000000000000 | x20: ffff8000099fa5b0 x19: ffff800009ff7000 x18: fffffbfffda37000 | x17: 3120676e696d7573 x16: 7361202c6e6f6974 x15: 0000000041a90000 | x14: 0040000000000041 x13: 0040000000000001 x12: ffff000001a90000 | x11: fffffbfffda37480 x10: 0068000000000703 x9 : 0001000040000000 | x8 : 0000000000090000 x7 : 0068000000000f03 x6 : 0060000000000f83 | x5 : ffff80000a2b6000 x4 : ffff0000028d0000 x3 : ffff800009f78378 | x2 : 0000000000000000 x1 : 0000000040210000 x0 : ffff8000080257e4 | Kernel panic - not syncing: Unhandled exception | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc3-00131-g7d937ff0221d-dirty #9 | Hardware name: linux,dummy-virt (DT) | Call trace: | dump_backtrace.part.0+0xcc/0xe0 | show_stack+0x18/0x5c | dump_stack_lvl+0x64/0x80 | dump_stack+0x18/0x34 | panic+0x170/0x360 | arm64_exit_nmi.isra.0+0x0/0x80 | el1h_64_sync_handler+0x64/0xd0 | el1h_64_sync+0x64/0x68 | test_bti_callee+0x4/0x10 | smp_cpus_done+0xb0/0xbc | smp_init+0x7c/0x8c | kernel_init_freeable+0x128/0x28c | kernel_init+0x28/0x13c | ret_from_fork+0x10/0x20 With this patch applied, a BTI failure is reported as: | Internal error: Oops - BTI: 0000000034000002 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc3-00132-g0ad98265d582-dirty #8 | Hardware name: linux,dummy-virt (DT) | pstate: 20400809 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=-c) | pc : test_bti_callee+0x4/0x10 | lr : test_bti_caller+0x1c/0x28 | sp : ffff80000800bdf0 | x29: ffff80000800bdf0 x28: 0000000000000000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: ffff80000a2b8000 x22: 0000000000000000 x21: 0000000000000000 | x20: ffff8000099fa5b0 x19: ffff800009ff7000 x18: fffffbfffda37000 | x17: 3120676e696d7573 x16: 7361202c6e6f6974 x15: 0000000041a90000 | x14: 0040000000000041 x13: 0040000000000001 x12: ffff000001a90000 | x11: fffffbfffda37480 x10: 0068000000000703 x9 : 0001000040000000 | x8 : 0000000000090000 x7 : 0068000000000f03 x6 : 0060000000000f83 | x5 : ffff80000a2b6000 x4 : ffff0000028d0000 x3 : ffff800009f78378 | x2 : 0000000000000000 x1 : 0000000040210000 x0 : ffff800008025804 | Call trace: | test_bti_callee+0x4/0x10 | smp_cpus_done+0xb0/0xbc | smp_init+0x7c/0x8c | kernel_init_freeable+0x128/0x28c | kernel_init+0x28/0x13c | ret_from_fork+0x10/0x20 | Code: d50323bf d53cd040 d65f03c0 d503233f (d50323bf) Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Anshuman Khandual Cc: Alexandru Elisei Cc: Amit Daniel Kachhap Cc: James Morse Cc: Will Deacon Link: https://lore.kernel.org/r/20220913101732.3925290-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit a1fafa3b24a70461bbf3e5c0770893feb0a49292 Author: Mark Rutland Date: Tue Sep 13 11:17:31 2022 +0100 arm64: rework FPAC exception handling If an FPAC exception is taken from EL1, the entry code will call do_ptrauth_fault(), where due to: BUG_ON(!user_mode(regs)) ... the kernel will report a problem within do_ptrauth_fault() rather than reporting the original context the FPAC exception was taken from. The pt_regs and ESR value reported will be from within do_ptrauth_fault() and the code dump will be for the BRK in BUG_ON(), which isn't sufficient to debug the cause of the original exception. This patch makes the reporting better by having separate EL0 and EL1 FPAC exception handlers, with the latter calling die() directly to report the original context the FPAC exception was taken from. Note that we only need to prevent kprobes of the EL1 FPAC handler, since the EL0 FPAC handler cannot be called recursively. For consistency with do_el0_svc*(), I've named the split functions do_el{0,1}_fpac() rather than do_el{0,1}_ptrauth_fault(). I've also clarified the comment to not imply there are casues other than FPAC exceptions. Prior to this patch FPAC exceptions are reported as: | kernel BUG at arch/arm64/kernel/traps.c:517! | Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc3-00130-g9c8a180a1cdf-dirty #12 | Hardware name: FVP Base RevC (DT) | pstate: 00400009 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : do_ptrauth_fault+0x3c/0x40 | lr : el1_fpac+0x34/0x54 | sp : ffff80000a3bbc80 | x29: ffff80000a3bbc80 x28: ffff0008001d8000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: 0000000020400009 x22: ffff800008f70fa4 x21: ffff80000a3bbe00 | x20: 0000000072000000 x19: ffff80000a3bbcb0 x18: fffffbfffda37000 | x17: 3120676e696d7573 x16: 7361202c6e6f6974 x15: 0000000081a90000 | x14: 0040000000000041 x13: 0040000000000001 x12: ffff000001a90000 | x11: fffffbfffda37480 x10: 0068000000000703 x9 : 0001000080000000 | x8 : 0000000000090000 x7 : 0068000000000f03 x6 : 0060000000000783 | x5 : ffff80000a3bbcb0 x4 : ffff0008001d8000 x3 : 0000000072000000 | x2 : 0000000000000000 x1 : 0000000020400009 x0 : ffff80000a3bbcb0 | Call trace: | do_ptrauth_fault+0x3c/0x40 | el1h_64_sync_handler+0xc4/0xd0 | el1h_64_sync+0x64/0x68 | test_pac+0x8/0x10 | smp_init+0x7c/0x8c | kernel_init_freeable+0x128/0x28c | kernel_init+0x28/0x13c | ret_from_fork+0x10/0x20 | Code: 97fffe5e a8c17bfd d50323bf d65f03c0 (d4210000) With this patch applied FPAC exceptions are reported as: | Internal error: Oops - FPAC: 0000000072000000 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc3-00132-g78846e1c4757-dirty #11 | Hardware name: FVP Base RevC (DT) | pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : test_pac+0x8/0x10 | lr : 0x0 | sp : ffff80000a3bbe00 | x29: ffff80000a3bbe00 x28: 0000000000000000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: ffff80000a2c8000 x22: 0000000000000000 x21: 0000000000000000 | x20: ffff8000099fa5b0 x19: ffff80000a007000 x18: fffffbfffda37000 | x17: 3120676e696d7573 x16: 7361202c6e6f6974 x15: 0000000081a90000 | x14: 0040000000000041 x13: 0040000000000001 x12: ffff000001a90000 | x11: fffffbfffda37480 x10: 0068000000000703 x9 : 0001000080000000 | x8 : 0000000000090000 x7 : 0068000000000f03 x6 : 0060000000000783 | x5 : ffff80000a2c6000 x4 : ffff0008001d8000 x3 : ffff800009f88378 | x2 : 0000000000000000 x1 : 0000000080210000 x0 : ffff000001a90000 | Call trace: | test_pac+0x8/0x10 | smp_init+0x7c/0x8c | kernel_init_freeable+0x128/0x28c | kernel_init+0x28/0x13c | ret_from_fork+0x10/0x20 | Code: d50323bf d65f03c0 d503233f aa1f03fe (d50323bf) Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Anshuman Khandual Cc: Alexandru Elisei Cc: Amit Daniel Kachhap Cc: James Morse Cc: Will Deacon Link: https://lore.kernel.org/r/20220913101732.3925290-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 0f2cb928a1547ae8f89e80a4b8df2c6c02ae5f96 Author: Mark Rutland Date: Tue Sep 13 11:17:30 2022 +0100 arm64: consistently pass ESR_ELx to die() Currently, bug_handler() and kasan_handler() call die() with '0' as the 'err' value, whereas die_kernel_fault() passes the ESR_ELx value. For consistency, this patch ensures we always pass the ESR_ELx value to die(). As this is only called for exceptions taken from kernel mode, there should be no user-visible change as a result of this patch. For UNDEFINED exceptions, I've had to modify do_undefinstr() and its callers to pass the ESR_ELx value. In all cases the ESR_ELx value had already been read and was available. Signed-off-by: Mark Rutland Cc: Mark Brown Cc: Alexandru Elisei Cc: Amit Daniel Kachhap Cc: James Morse Cc: Will Deacon Reviewed-by: Anshuman Khandual Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220913101732.3925290-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 18906ff9af6517c20763ed63dab602a4150794f7 Author: Mark Rutland Date: Tue Sep 13 11:17:29 2022 +0100 arm64: die(): pass 'err' as long Recently, we reworked a lot of code to consistentlt pass ESR_ELx as a 64-bit quantity. However, we missed that this can be passed into die() and __die() as the 'err' parameter where it is truncated to a 32-bit int. As notify_die() already takes 'err' as a long, this patch changes die() and __die() to also take 'err' as a long, ensuring that the full value of ESR_ELx is retained. At the same time, die() is updated to consistently log 'err' as a zero-padded 64-bit quantity. Subsequent patches will pass the ESR_ELx value to die() for a number of exceptions. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Anshuman Khandual Cc: Alexandru Elisei Cc: Amit Daniel Kachhap Cc: James Morse Cc: Will Deacon Link: https://lore.kernel.org/r/20220913101732.3925290-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit b502c87d2a26c349acbc231ff2acd6f17147926b Author: Mark Rutland Date: Tue Sep 13 11:17:28 2022 +0100 arm64: report EL1 UNDEFs better If an UNDEFINED exception is taken from EL1, and do_undefinstr() doesn't find any suitable undef_hook, it will call: BUG_ON(!user_mode(regs)) ... and the kernel will report a failure witin do_undefinstr() rather than reporting the original context that the UNDEFINED exception was taken from. The pt_regs and ESR value reported within the BUG() handler will be from within do_undefinstr() and the code dump will be for the BRK in BUG_ON(), which isn't sufficient to debug the cause of the original exception. This patch makes the reporting better by having do_undefinstr() call die() directly in this case to report the original context from which the UNDEFINED exception was taken. Prior to this patch, an undefined instruction is reported as: | kernel BUG at arch/arm64/kernel/traps.c:497! | Internal error: Oops - BUG: 0 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 0 Comm: swapper Not tainted 5.19.0-rc3-00127-geff044f1b04e-dirty #3 | Hardware name: linux,dummy-virt (DT) | pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : do_undefinstr+0x28c/0x2ac | lr : do_undefinstr+0x298/0x2ac | sp : ffff800009f63bc0 | x29: ffff800009f63bc0 x28: ffff800009f73c00 x27: ffff800009644a70 | x26: ffff8000096778a8 x25: 0000000000000040 x24: 0000000000000000 | x23: 00000000800000c5 x22: ffff800009894060 x21: ffff800009f63d90 | x20: 0000000000000000 x19: ffff800009f63c40 x18: 0000000000000006 | x17: 0000000000403000 x16: 00000000bfbfd000 x15: ffff800009f63830 | x14: ffffffffffffffff x13: 0000000000000000 x12: 0000000000000019 | x11: 0101010101010101 x10: 0000000000161b98 x9 : 0000000000000000 | x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 | x5 : ffff800009f761d0 x4 : 0000000000000000 x3 : ffff80000a2b80f8 | x2 : 0000000000000000 x1 : ffff800009f73c00 x0 : 00000000800000c5 | Call trace: | do_undefinstr+0x28c/0x2ac | el1_undef+0x2c/0x4c | el1h_64_sync_handler+0x84/0xd0 | el1h_64_sync+0x64/0x68 | setup_arch+0x550/0x598 | start_kernel+0x88/0x6ac | __primary_switched+0xb8/0xc0 | Code: 17ffff95 a9425bf5 17ffffb8 a9025bf5 (d4210000) With this patch applied, an undefined instruction is reported as: | Internal error: Oops - Undefined instruction: 0 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 0 Comm: swapper Not tainted 5.19.0-rc3-00128-gf27cfcc80e52-dirty #5 | Hardware name: linux,dummy-virt (DT) | pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : setup_arch+0x550/0x598 | lr : setup_arch+0x50c/0x598 | sp : ffff800009f63d90 | x29: ffff800009f63d90 x28: 0000000081000200 x27: ffff800009644a70 | x26: ffff8000096778c8 x25: 0000000000000040 x24: 0000000000000000 | x23: 0000000000000100 x22: ffff800009f69a58 x21: ffff80000a2b80b8 | x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000006 | x17: 0000000000403000 x16: 00000000bfbfd000 x15: ffff800009f63830 | x14: ffffffffffffffff x13: 0000000000000000 x12: 0000000000000019 | x11: 0101010101010101 x10: 0000000000161b98 x9 : 0000000000000000 | x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 | x5 : 0000000000000008 x4 : 0000000000000010 x3 : 0000000000000000 | x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 | Call trace: | setup_arch+0x550/0x598 | start_kernel+0x88/0x6ac | __primary_switched+0xb8/0xc0 | Code: b4000080 90ffed80 912ac000 97db745f (00000000) Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Alexandru Elisei Cc: Amit Daniel Kachhap Cc: James Morse Cc: Will Deacon Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220913101732.3925290-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 030eed86cbe10a9e2ce7c3b081d4465d378fda25 Merge: ec3f06b542a96 2c5e5abf1c427 Author: David S. Miller Date: Fri Sep 16 12:15:15 2022 +0100 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-09-08 (e1000e, igc) This series contains updates to e1000e and igc drivers. Li Zhong adds checking and handling for failed PHY register reads for e1000e. Sasha removes an unused define for igc. ==================== Signed-off-by: David S. Miller commit ec3f06b542a960806a81345042e4eee3f8c5dec4 Author: Zheng Yongjun Date: Thu Sep 8 13:55:13 2022 +0000 net: fs_enet: Fix wrong check in do_pd_setup Should check of_iomap return value 'fep->fec.fecp' instead of 'fep->fcc.fccp' Fixes: 976de6a8c304 ("fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.") Signed-off-by: Zheng Yongjun Reviewed-by: Christophe Leroy Signed-off-by: David S. Miller commit fd573b2bf2d2cf61e835ea68bbaa34c71d4a70d7 Author: Tianling Shen Date: Thu Sep 15 10:25:11 2022 +0800 arm64: dts: rockchip: Add RK3399 NanoPi R4S Enterprise Edition The only diffrence against the standrard edition is that the enterprise one has a built-in EEPROM chip which stores a globally unique MAC address. Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20220915022511.4267-2-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 3503c0eb4d1058b7eda87bf4e432463813c43759 Author: Tianling Shen Date: Thu Sep 15 10:25:10 2022 +0800 dt-bindings: Add doc for FriendlyARM NanoPi R4S Enterprise Edition Add devicetree binding documentation for the FriendlyARM NanoPi R4S Enterprise Edition. Signed-off-by: Tianling Shen Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220915022511.4267-1-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 27c92c60d1e6d37e2c34fc18e1e36186fade2186 Author: Quentin Schulz Date: Fri Sep 16 11:17:46 2022 +0200 arm64: dts: rockchip: add i2s0 I2S/PDM/TDM 8ch controller to px30 The Rockchip PX30 SoC has three I2S controllers, i2s1 and i2s2 are 2-channel I2S/PCM controllers handled by the same controller driver, and i2s0 a 8-channel I2S/PCM/TDM controller handled by another controller driver. This adds the device tree node required to enable I2S0 on PX30. This was tested in a 2-channel I2S with TX BCLK/LRCK for both TX and RX (rockchip,trcm-sync-tx-only) setup on a soon-to-be-released board. Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220916091746.35108-1-foss+kernel@0leil.net Signed-off-by: Heiko Stuebner commit 072d36eefd6fde17928d214df64fdac32f60b4f4 Author: Damian Muszynski Date: Fri Sep 9 11:49:14 2022 +0100 crypto: qat - use reference to structure in dma_map_single() When mapping the input and output parameters, the implementations of RSA and DH pass to the function dma_map_single() a pointer to the first member of the structure they want to map instead of a pointer to the actual structure. This results in set of warnings reported by the static analyser Smatch: drivers/crypto/qat/qat_common/qat_asym_algs.c:335 qat_dh_compute_value() error: dma_map_single_attrs() '&qat_req->in.dh.in.b' too small (8 vs 64) drivers/crypto/qat/qat_common/qat_asym_algs.c:341 qat_dh_compute_value() error: dma_map_single_attrs() '&qat_req->out.dh.r' too small (8 vs 64) drivers/crypto/qat/qat_common/qat_asym_algs.c:732 qat_rsa_enc() error: dma_map_single_attrs() '&qat_req->in.rsa.enc.m' too small (8 vs 64) drivers/crypto/qat/qat_common/qat_asym_algs.c:738 qat_rsa_enc() error: dma_map_single_attrs() '&qat_req->out.rsa.enc.c' too small (8 vs 64) drivers/crypto/qat/qat_common/qat_asym_algs.c:878 qat_rsa_dec() error: dma_map_single_attrs() '&qat_req->in.rsa.dec.c' too small (8 vs 64) drivers/crypto/qat/qat_common/qat_asym_algs.c:884 qat_rsa_dec() error: dma_map_single_attrs() '&qat_req->out.rsa.dec.m' too small (8 vs 64) Where the address of the first element of a structure is used as an input for the function dma_map_single(), replace it with the address of the structure. This fix does not introduce any functional change as the addresses are the same. Signed-off-by: Damian Muszynski Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit 9c5f21b198d259bfe1191b1fedf08e2eab15b33b Author: Giovanni Cabiddu Date: Fri Sep 9 11:49:13 2022 +0100 Revert "crypto: qat - reduce size of mapped region" This reverts commit e48767c17718067ba21fb2ef461779ec2506f845. In an attempt to resolve a set of warnings reported by the static analyzer Smatch, the reverted commit improperly reduced the sizes of the DMA mappings used for the input and output parameters for both RSA and DH creating a mismatch (map size=8 bytes, unmap size=64 bytes). This issue is reported when CONFIG_DMA_API_DEBUG is selected, when the crypto self test is run. The function dma_unmap_single() reports a warning similar to the one below, saying that the `device driver frees DMA memory with different size`. DMA-API: 4xxx 0000:06:00.0: device driver frees DMA memory with different size [device address=0x0000000123206c80] [map size=8 bytes] [unmap size=64 bytes] WARNING: CPU: 0 PID: 0 at kernel/dma/debug.c:973 check_unmap+0x3d0/0x8c0\ ... Call Trace: debug_dma_unmap_page+0x5c/0x60 qat_dh_cb+0xd7/0x110 [intel_qat] qat_alg_asym_callback+0x1a/0x30 [intel_qat] adf_response_handler+0xbd/0x1a0 [intel_qat] tasklet_action_common.constprop.0+0xcd/0xe0 __do_softirq+0xf8/0x30c __irq_exit_rcu+0xbf/0x140 common_interrupt+0xb9/0xd0 The original commit was correct. Cc: Reported-by: Herbert Xu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit cf5bb835b7c8a5fee7f26455099cca7feb57f5e9 Author: Damian Muszynski Date: Fri Sep 9 11:49:12 2022 +0100 crypto: qat - fix DMA transfer direction When CONFIG_DMA_API_DEBUG is selected, while running the crypto self test on the QAT crypto algorithms, the function add_dma_entry() reports a warning similar to the one below, saying that overlapping mappings are not supported. This occurs in tests where the input and the output scatter list point to the same buffers (i.e. two different scatter lists which point to the same chunks of memory). The logic that implements the mapping uses the flag DMA_BIDIRECTIONAL for both the input and the output scatter lists which leads to overlapped write mappings. These are not supported by the DMA layer. Fix by specifying the correct DMA transfer directions when mapping buffers. For in-place operations where the input scatter list matches the output scatter list, buffers are mapped once with DMA_BIDIRECTIONAL, otherwise input buffers are mapped using the flag DMA_TO_DEVICE and output buffers are mapped with DMA_FROM_DEVICE. Overlapping a read mapping with a write mapping is a valid case in dma-coherent devices like QAT. The function that frees and unmaps the buffers, qat_alg_free_bufl() has been changed accordingly to the changes to the mapping function. DMA-API: 4xxx 0000:06:00.0: cacheline tracking EEXIST, overlapping mappings aren't supported WARNING: CPU: 53 PID: 4362 at kernel/dma/debug.c:570 add_dma_entry+0x1e9/0x270 ... Call Trace: dma_map_page_attrs+0x82/0x2d0 ? preempt_count_add+0x6a/0xa0 qat_alg_sgl_to_bufl+0x45b/0x990 [intel_qat] qat_alg_aead_dec+0x71/0x250 [intel_qat] crypto_aead_decrypt+0x3d/0x70 test_aead_vec_cfg+0x649/0x810 ? number+0x310/0x3a0 ? vsnprintf+0x2a3/0x550 ? scnprintf+0x42/0x70 ? valid_sg_divisions.constprop.0+0x86/0xa0 ? test_aead_vec+0xdf/0x120 test_aead_vec+0xdf/0x120 alg_test_aead+0x185/0x400 alg_test+0x3d8/0x500 ? crypto_acomp_scomp_free_ctx+0x30/0x30 ? __schedule+0x32a/0x12a0 ? ttwu_queue_wakelist+0xbf/0x110 ? _raw_spin_unlock_irqrestore+0x23/0x40 ? try_to_wake_up+0x83/0x570 ? _raw_spin_unlock_irqrestore+0x23/0x40 ? __set_cpus_allowed_ptr_locked+0xea/0x1b0 ? crypto_acomp_scomp_free_ctx+0x30/0x30 cryptomgr_test+0x27/0x50 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Fixes: d370cec ("crypto: qat - Intel(R) QAT crypto interface") Link: https://lore.kernel.org/linux-crypto/20220223080400.139367-1-gilad@benyossef.com/ Signed-off-by: Damian Muszynski Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit d310dc2554a5296a338f974d2b4e4f9af2687558 Author: Zhiqi Song Date: Fri Sep 9 17:47:04 2022 +0800 crypto: hisilicon - support get algs by the capability register The value of qm algorithm can change dynamically according to the value of the capability register. Add xxx_set_qm_algs() function to obtain the algs that the hardware device supported from the capability register and set them into usr mode attribute files. Signed-off-by: Zhiqi Song Signed-off-by: Wenkai Lin Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 921715b6b7827157bba6e8153d7a09774b0d034f Author: Wenkai Lin Date: Fri Sep 9 17:47:03 2022 +0800 crypto: hisilicon/sec - get algorithm bitmap from registers Add function 'sec_get_alg_bitmap' to get hardware algorithm bitmap before register algorithm to crypto, instead of determining whether to register an algorithm based on hardware platform's version. Signed-off-by: Wenkai Lin Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit db700974b69d2c12a8fe84c45820892416a1e265 Author: Weili Qian Date: Fri Sep 9 17:47:02 2022 +0800 crypto: hisilicon/zip - support zip capability Add function 'hisi_zip_alg_support' to get device configuration information from capability registers, instead of determining whether to register an algorithm based on hardware platform's version. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit b1be70a8c983a5bd12d88181b75d0f550086cb44 Author: Zhiqi Song Date: Fri Sep 9 17:47:01 2022 +0800 crypto: hisilicon/hpre - optimize registration of ecdh Use table to store the different ecdh curve configuration, making the registration of ecdh clearer and expansion more convenient. Signed-off-by: Zhiqi Song Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit f214d59a0603543cfa7c6c1cf2eb130ac77480c3 Author: Zhiqi Song Date: Fri Sep 9 17:47:00 2022 +0800 crypto: hisilicon/hpre - support hpre capability Read some hpre device configuration info from capability register, instead of fixed macros. Signed-off-by: Zhiqi Song Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 3536cc55cadaf2a03241915f9cfdaf6cd073e4fe Author: Weili Qian Date: Fri Sep 9 17:46:59 2022 +0800 crypto: hisilicon/qm - support get device irq information from hardware registers Support get device irq information from hardware registers instead of fixed macros. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit d90fab0deb8e580aa001f6876e4436c21e944f27 Author: Weili Qian Date: Fri Sep 9 17:46:58 2022 +0800 crypto: hisilicon/qm - get error type from hardware registers Hardware V3 and later versions support get error type from registers. To be compatible with later hardware versions, get error type from registers instead of fixed marco. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit c832da79cbf9448e7ece097c3a93996b4c74a83e Author: Weili Qian Date: Fri Sep 9 17:46:57 2022 +0800 crypto: hisilicon/qm - add UACCE_CMD_QM_SET_QP_INFO support To be compatible with accelerator devices of different versions, 'UACCE_CMD_QM_SET_QP_INFO' ioctl is added to obtain queue information in userspace, including queue depth and buffer description size. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 129a9f340172b4f3857260a7a7bb9d7b3496ba50 Author: Weili Qian Date: Fri Sep 9 17:46:56 2022 +0800 crypto: hisilicon/qm - get qp num and depth from hardware registers Hardware V3 and later versions can obtain qp num and depth supported by the hardware from registers. To be compatible with later hardware versions, get qp num and depth from registers instead of fixed marcos. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 82f00b24f532557fb0e15a6a2747859e4b70c4bd Author: Weili Qian Date: Fri Sep 9 17:46:55 2022 +0800 crypto: hisilicon/qm - get hardware features from hardware registers Before hardware V3, hardwares do not provide the feature registers, driver resolves hardware differences based on the hardware version. As a result, the driver does not support the new hardware. Hardware V3 and later versions support to obtain hardware features, such as power-gating management and doorbell isolation, through the hardware registers. To be compatible with later hardware versions, the features of the current device is obtained by reading the hardware registers instead of the hardware version. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 0413623c27a380d0da7240717f9435d24776b985 Author: Kai Ye Date: Fri Sep 9 06:28:11 2022 +0000 crypto: hisilicon/sec - delete redundant blank lines Some coding style fixes in sec crypto file. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 664593407e936b6438fbfaaf98876910fd31cf9a Author: Peter Harliman Liem Date: Tue Sep 6 10:51:28 2022 +0800 crypto: inside-secure - Change swab to swab32 The use of swab() is causing failures in 64-bit arch, as it translates to __swab64() instead of the intended __swab32(). It eventually causes wrong results in xcbcmac & cmac algo. Fixes: 78cf1c8bfcb8 ("crypto: inside-secure - Move ipad/opad into safexcel_context") Signed-off-by: Peter Harliman Liem Acked-by: Antoine Tenart Signed-off-by: Herbert Xu commit a292c25607ea3f259afb318f03e05b84108348bf Author: wangjianli Date: Thu Sep 8 20:43:50 2022 +0800 mellanox/mlxsw: fix repeated words in comments Delete the redundant word 'in'. Signed-off-by: wangjianli Signed-off-by: David S. Miller commit 7187440dd7c45fd8b6dd4f3ff56b03ca4aa1bbd2 Author: Dan Carpenter Date: Thu Sep 8 15:20:23 2022 +0300 iov_iter: use "maxpages" parameter This was intended to be "maxpages" instead of INT_MAX. There is only one caller and it passes INT_MAX so this does not affect runtime. Fixes: b93235e68921 ("tls: cap the output scatter list to something reasonable") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 3b63ef7baa26da9f7421af2689bd849f74cac373 Merge: 454e7b138436a 78923e8ae4279 Author: David S. Miller Date: Fri Sep 16 10:27:47 2022 +0100 Merge branch 'net-amd-static-checker-warnings' Haoyue Xu says: ==================== net: amd: Cleanup for clearing static warnings Most static warnings are detected by tools, mainly about: (1) #1: About the if stament. (2) #2: About the spelling. (2) #3: About the indent. ==================== Signed-off-by: David S. Miller commit 78923e8ae4279a90138d09743d9710d4b04b19c5 Author: Guofeng Yue Date: Wed Sep 7 14:28:12 2022 +0800 net: amd: Switch and case should be at the same indent Cleaning some static warnings of indent. Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: David S. Miller commit 7c13f4426b0efe44a2af2037e4fc26802469ee21 Author: Guofeng Yue Date: Wed Sep 7 14:28:11 2022 +0800 net: amd: Correct spelling errors Find some spelling errors: interupts --> interrupts lenth --> length stoped --> stopped contoller --> controller Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: David S. Miller commit b0b815a356aa4f3352563b3350a7b2354c0f2c5c Author: Guofeng Yue Date: Wed Sep 7 14:28:10 2022 +0800 net: amd: Unified the comparison between pointers and NULL to the same writing Using the unified way to compare pointers and NULL, which cleans the static warning. eg: if (skb == NULL) --> if (!skb) if (skb != NULL) --> if (skb) Signed-off-by: Guofeng Yue Signed-off-by: Haoyue Xu Signed-off-by: David S. Miller commit 3f505a30ea6b0fdfa4bf214b5383e8d4e6a2832e Author: Jeff Johnson Date: Fri Sep 9 08:12:46 2022 -0700 wifi: ath11k: Fix kernel-doc issues Fix documentation issues reported by kernel-doc: - Incorrect use of /** for non-kernel-doc comments - Mismatch between documented and actual identifiers - Incorrect identifier syntax Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220909151246.22961-1-quic_jjohnson@quicinc.com commit 3fecca0e7de885c71cf28065015832b78023aa6f Author: Jeff Johnson Date: Fri Sep 9 07:55:35 2022 -0700 wifi: ath11k: Fix miscellaneous spelling errors Fix misspellings flagged by 'codespell'. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220909145535.20437-1-quic_jjohnson@quicinc.com commit b8a71b953653dfd6b005356bff8463503dd0f965 Author: Jeff Johnson Date: Fri Sep 9 07:53:00 2022 -0700 wifi: ath10k: Fix miscellaneous spelling errors Fix misspellings flagged by 'codespell'. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220909145300.19223-1-quic_jjohnson@quicinc.com commit e92072237e6c8497cad5e9d2f2e3c44bb9d26aef Author: Kefeng Wang Date: Sun Sep 11 12:44:23 2022 +0800 arm64: support huge vmalloc mappings As commit 559089e0a93d ("vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP"), the use of hugepage mappings for vmalloc is an opt-in strategy, so it is saftly to support huge vmalloc mappings on arm64, for now, it is used in kvmalloc() and alloc_large_system_hash(). Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20220911044423.139229-1-wangkefeng.wang@huawei.com Signed-off-by: Catalin Marinas commit 454e7b138436a31a17753de58f2178c3e955886c Author: Jilin Yuan Date: Wed Sep 7 12:01:31 2022 +0800 vsock/vmci: fix repeated words in comments Delete the redundant word 'that'. Signed-off-by: Jilin Yuan Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit c317c6d2d2c63461f6860dc322ae4521cbfe3447 Merge: b90cb10531903 797b84517c190 Author: Marc Zyngier Date: Fri Sep 16 09:29:56 2022 +0100 Merge branch kvm-arm64/aarch32-raz-idregs into kvmarm-master/next * kvm-arm64/aarch32-raz-idregs: : . : Rework AArch32 ID registers exposed by KVM on AArch64-only : systems by treating them as RAZ/WI instead as UNKOWN as : architected, which allows them to be trivially migrated : between different systems. : : Patches courtesy of Oliver Upton. : . KVM: selftests: Add test for AArch32 ID registers KVM: arm64: Treat 32bit ID registers as RAZ/WI on 64bit-only system KVM: arm64: Add a visibility bit to ignore user writes KVM: arm64: Spin off helper for calling visibility hook KVM: arm64: Drop raz parameter from read_id_reg() KVM: arm64: Remove internal accessor helpers for id regs KVM: arm64: Use visibility hook to treat ID regs as RAZ Signed-off-by: Marc Zyngier commit 7e6e1b57162ed6a2d32d2f0929c27d79482ff706 Author: Nicolas Dichtel Date: Tue Sep 6 11:55:58 2022 +0200 rtnetlink: advertise allmulti counter Like what was done with IFLA_PROMISCUITY, add IFLA_ALLMULTI to advertise the allmulti counter. The flag IFF_ALLMULTI is advertised only if it was directly set by a userland app. Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller commit da970726ea872269dc311b6dd87af8cf457b8fe9 Author: Wei Fang Date: Tue Sep 6 16:39:23 2022 +0800 net: fec: add pm runtime force suspend and resume support Force mii bus into runtime pm suspend state during device suspends, since phydev state is already PHY_HALTED, and there is no need to access mii bus during device suspend state. Then force mii bus into runtime pm resume state when device resumes. Signed-off-by: Wei Fang Signed-off-by: David S. Miller commit e4e9631b2c8886be172f99bd29f326ee56adc2d2 Author: Koen Vandeputte Date: Wed Aug 31 12:03:49 2022 +0200 bus: mhi: host: always print detected modem name This harmless print provides a very easy way of knowing if the modem is detected properly during probing. Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it. The rationale here is that: On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues. Signed-off-by: Koen Vandeputte Reviewed-by: Manivannan Sadhasivam Reviewed-by: Loic Poulain Link: https://lore.kernel.org/r/20220831100349.1488762-1-koen.vandeputte@citymesh.com [mani: added missing review tags] Signed-off-by: Manivannan Sadhasivam commit 0b2eafe1167e756935f293aa7212626d8f89952f Author: Sergiu Moga Date: Tue Sep 13 17:21:56 2022 +0300 spi: dt-bindings: atmel,at91rm9200-spi: Add DMA related properties The DT nodes of the SPI IP's may contain DMA related properties so make sure that the binding is able to properly validate those as well by making it aware of these optional properties. Signed-off-by: Sergiu Moga Acked-by: Mark Brown Acked-by: Krzysztof Kozlowski Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220913142205.162399-5-sergiu.moga@microchip.com commit f9e1d0767fde8c2d7f06248232e98d38fd70e307 Author: Sergiu Moga Date: Tue Sep 13 17:21:55 2022 +0300 ARM: dts: at91: Add `atmel,usart-mode` required property to serial nodes Add the missing required DT property `atmel,usart-mode` to the serial nodes of Atmel/Microchip DT files. Signed-off-by: Sergiu Moga Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220913142205.162399-4-sergiu.moga@microchip.com commit 7fca501460f6a6e97e15176eb6a648d02c90800c Author: Sergiu Moga Date: Tue Sep 13 17:21:54 2022 +0300 ARM: dts: at91: sam9x60ek: Add DBGU compatibles to uart1 Maintain consistency among the compatibles of the serial nodes of sam9x60ek and highlight the incremental characteristic of its serial IP's by making sure that all serial nodes contain both the sam9x60 and sam9260 usart/dbgu compatibles. Signed-off-by: Sergiu Moga Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220913142205.162399-3-sergiu.moga@microchip.com commit 944ec7d1a39eb9a9127148395105a970ce32b61e Author: Sergiu Moga Date: Tue Sep 13 17:21:53 2022 +0300 ARM: dts: at91: sama7g5: Swap rx and tx for spi11 Swap the rx and tx of the DMA related DT properties of the spi11 node in order to maintain consistency across Microchip/Atmel SoC files. Signed-off-by: Sergiu Moga Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220913142205.162399-2-sergiu.moga@microchip.com commit 7f615c1b5986ff08a725ee489e838c90f8197bcd Author: Martin Wilck Date: Fri Sep 2 15:15:19 2022 +0200 scsi: scsi_transport_fc: Use %u for dev_loss_tmo dev_loss_tmo is an unsigned value. Using "%d" as output format causes irritating negative values to be shown in sysfs. Link: https://lore.kernel.org/r/20220902131519.16513-1-mwilck@suse.com Reviewed-by: Steffen Maier Signed-off-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 9acb9f0efb930de37f65718e35e09ddd20c80961 Author: Xuezhi Zhang Date: Thu Sep 1 09:51:30 2022 +0800 scsi: csiostor: Convert sysfs snprintf() to sysfs_emit() Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Link: https://lore.kernel.org/r/20220901015130.419307-1-zhangxuezhi3@gmail.com Reviewed-by: Damien Le Moal Signed-off-by: Xuezhi Zhang Signed-off-by: Martin K. Petersen commit 68a97feb4b501025540bc60c3d0824d66a508002 Author: Xuezhi Zhang Date: Wed Aug 31 22:03:25 2022 +0800 scsi: megaraid: Convert sysfs snprintf() to sysfs_emit() Fix up sysfs show entries to use sysfs_emit() Link: https://lore.kernel.org/r/20220831140325.396295-1-zhangxuezhi3@gmail.com Reviewed-by: Damien Le Moal Signed-off-by: Xuezhi Zhang Signed-off-by: Martin K. Petersen commit 59f4e39d3565f1cac62fe13f133f34705bb61e0f Author: wangjianli Date: Thu Sep 8 21:09:10 2022 +0800 scsi: ibmvscsi_tgt: Fix repeated words in comment Delete the redundant word 'to'. Link: https://lore.kernel.org/r/20220908130910.35680-1-wangjianli@cdjrlc.com Reviewed-by: Chaitanya Kulkarni Signed-off-by: wangjianli Signed-off-by: Martin K. Petersen commit 7170cb1a85e65d31b8b5b96fa7b502e559304946 Author: James Smart Date: Sun Sep 11 15:15:05 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.7 Update lpfc version to 14.2.0.7 Link: https://lore.kernel.org/r/20220911221505.117655-14-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a4de8356b68e54149ebdbe6e748e2726152b650c Author: James Smart Date: Sun Sep 11 15:15:04 2022 -0700 scsi: lpfc: Fix various issues reported by tools This patch fixes below Smatch reported issues: 1. lpfc_hbadisc.c:3020 lpfc_mbx_cmpl_fcf_rr_read_fcf_rec() error: uninitialized symbol 'vlan_id'. 2. lpfc_hbadisc.c:3121 lpfc_mbx_cmpl_read_fcf_rec() error: uninitialized symbol 'vlan_id'. 3. lpfc_init.c:335 lpfc_dump_wakeup_param_cmpl() warn: always true condition '(prg->dist < 4) => (0-3 < 4)' 4. lpfc_init.c:2419 lpfc_parse_vpd() warn: inconsistent indenting. 5. lpfc_init.c:13248 lpfc_sli4_enable_msi() warn: 'phba->pcidev->irq' 2147483648 can't fit into 65535 'eqhdl->irq' 6. lpfc_debugfs.c:5300 lpfc_idiag_extacc_avail_get() error: uninitialized symbol 'ext_cnt' 7. lpfc_debugfs.c:5300 lpfc_idiag_extacc_avail_get() error: uninitialized symbol 'ext_size' 8. lpfc_vmid.c:248 lpfc_vmid_get_appid() warn: sleeping in atomic context. 9. lpfc_init.c:8342 lpfc_sli4_driver_resource_setup() warn: missing error code 'rc'. 10. lpfc_init.c:13573 lpfc_sli4_hba_unset() warn: variable dereferenced before check 'phba->pport' (see line 13546) 11. lpfc_auth.c:1923 lpfc_auth_handle_dhchap_reply() error: double free of 'hash_value' Fixes: 1. Initialize vlan_id to LPFC_FCOE_NULL_VID. 2. Initialize vlan_id to LPFC_FCOE_NULL_VID. 3. prg->dist is a 2 bit field. Its value can only be between 0-3. Remove redundent check 'if (prg->dist < 4)'. 4. Fix inconsistent indenting. Moved logic into helper function lpfc_fill_vpd(). 5. Define 'eqhdl->irq' as int value as pci_irq_vector() returns int. Also, check for return value of pci_irq_vector() and log message in case of failure. 6. Initialize 'ext_cnt' to 0. 7. Initialize 'ext_size' to 0. 8. Use alloc_percpu_gfp() with GFP_ATOMIC flag. 9. 'rc' was not updated when dma_pool_create() fails. Update 'rc = -ENOMEM' when dma_pool_create() fails before calling goto statement. 10. Add check for 'phba->pport' in lpfc_cpuhp_remove(). 11. Initialize 'hash_value' to NULL, same like 'aug_chal' variable. Link: https://lore.kernel.org/r/20220911221505.117655-13-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit dbb1e2ff87a63b665e93ffee54b46076e9c73d5f Author: James Smart Date: Sun Sep 11 15:15:03 2022 -0700 scsi: lpfc: Add reporting capability for Link Degrade Signaling Firmware reports link degrade signaling via ACQES. Handlers and new additions to the SET_FEATURES mbox command are implemented so that link degrade parameters for 64GB capable links are reported through EDC ELS frames. Link: https://lore.kernel.org/r/20220911221505.117655-12-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 045c58c87560b2f9e44fe84e62ce68625a937fa7 Author: James Smart Date: Sun Sep 11 15:15:02 2022 -0700 scsi: lpfc: Rework FDMI attribute registration for unintential padding Removed the lpfc_fdmi_attr_entry and lpfc_fdmi_attr_def structures that had a union causing unintentional zero padding, which required the usage of __packed. They are replaced with explicit lpfc_fdmi_attr_u32, lpfc_fdmi_attr_wwn, lpfc_fdmi_attr_fc4types, and lpfc_fdmi_attr_string structure defines instead of living in a union. This rids of ambiguous compiler zero padding, and entailed cleaning up bitwise endian declarations. As such, all FDMI attribute registration routines are replaced with generic void *arg and handlers for each of the newly defined attribute structure types. Link: https://lore.kernel.org/r/20220911221505.117655-11-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2649809cd1b432e5623d9841dc69a4b8d26e2365 Author: James Smart Date: Sun Sep 11 15:15:01 2022 -0700 scsi: lpfc: Rework lpfc_fdmi_cmd() routine for cleanup and consistency Switch case logics are reworked so they appear more similar and consistent. This eliminates compiler errors indicating unaligned pointer values and packed members. Added comments to explain previous size offset accumulations. Link: https://lore.kernel.org/r/20220911221505.117655-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d8cdd33a66dc8cc8d7f83b743bbdcef30a5624c0 Author: James Smart Date: Sun Sep 11 15:15:00 2022 -0700 scsi: lpfc: Rename mp/bmp dma buffers to rq/rsp in lpfc_fdmi_cmd Clarify naming of the mp/bmp dma buffers: - Rename mp to rq as it is the request buffer - Rename bmp to rsp as it is the response buffer This reduces confusion about what the buffer content is based on their name. Link: https://lore.kernel.org/r/20220911221505.117655-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 21828e3c9169e9664c916c61eb592db8b8830bd6 Author: James Smart Date: Sun Sep 11 15:14:59 2022 -0700 scsi: lpfc: Update congestion mode logging for Emulex SAN Manager application If there is a congestion or automated congestion response mode change, then log the reported change to kmsg. Link: https://lore.kernel.org/r/20220911221505.117655-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6e5c5d246e6c16127327eeecf61ef2cf21a94ce5 Author: James Smart Date: Sun Sep 11 15:14:58 2022 -0700 scsi: lpfc: Move scsi_host_template outside dynamically allocated/freed phba On a PCI hotplug capable system, it is possible for scsi_device_put() to happen after lpfc_pci_remove_one() is called. As a result, the sdev->host->hostt->module dereference is for a previously freed memory location because the phba structure containing the hostt template was already freed when lpfc_pci_remove_one() returned. Since the lpfc module is still loaded during power slot disable, all scsi_host_templates should be declared as part of the global data segment instead of inside the heap allocated phba structure. This way the sdev->host->hostt memory area is always valid as long as the module is loaded regardless if PCI hotplug dynamically allocates or frees phba structures. Move all scsi_host_templates in the phba structure to global variables. Create a small helper routine to determine appropriate sg_tablesize during shost allocation. Link: https://lore.kernel.org/r/20220911221505.117655-7-jsmart2021@gmail.com Co-developed-by: Dwip N. Banerjee Signed-off-by: Dwip N. Banerjee Co-developed-by: Daniel Wagner Signed-off-by: Daniel Wagner Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 845363516bb75bc35089b4093d1fae139f2fffc6 Author: James Smart Date: Sun Sep 11 15:14:57 2022 -0700 scsi: lpfc: Fix multiple NVMe remoteport registration calls for the same NPort ID When a target makes the mistake of registering a FC4 type with the fabric, but then rejects a PRLI of that type, the lpfc driver incorrectly retries the PRLI causing multiple registrations with the transport. The driver needs to detect the reject reason data and stop any retry. Rework the PRLI reject scenarios. Link: https://lore.kernel.org/r/20220911221505.117655-6-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 0630a1f7ea14452124392b883302713de31da3d0 Author: James Smart Date: Sun Sep 11 15:14:56 2022 -0700 scsi: lpfc: Add missing free iocb and nlp kref put for early return VMID cases Sometimes VMID targets are not getting rediscovered after a port reset. The iocb is not freed in lpfc_cmpl_ct_cmd_vmid(), which is the completion function for the appid CT commands. So after a port reset, the count of sges is less than the expected count of 250. This causes post reset operation logic to fail and keep the port offline. Fix by freeing the iocb and kref put for the lpfc_cmpl_ct_cmd_vmid() early return cases. Link: https://lore.kernel.org/r/20220911221505.117655-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b873d1037283b5082863b97443dd25e592c40684 Author: James Smart Date: Sun Sep 11 15:14:55 2022 -0700 scsi: lpfc: Fix mbuf pool resource detected as busy at driver unload In a situation where the node state changes while a REG_LOGIN is in progress, the LPFC_MBOXQ_t structure is cleared and reused for an UNREG_LOGIN command to release RPI resources without first freeing the mbuf pool resource allocated for REG_LOGIN. Release mbuf pool resource prior to repurposing of the mailbox command structure from REG_LOGIN to UNREG_LOGIN. Link: https://lore.kernel.org/r/20220911221505.117655-4-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 11d6583d811fb044597d366349f0dda0278dda3f Author: James Smart Date: Sun Sep 11 15:14:54 2022 -0700 scsi: lpfc: Fix FLOGI ACC with wrong SID in PT2PT topology When a FLOGI is received before we have issued our FLOGI, the ACC response to the received FLOGI is issued with SID 2 instead of the expected fabric controller SID. Certain target vendors ignore the malformed ACC with SID 2 and wait for a properly filled ACC with a fabric controller SID. The lpfc_sli_prep_wqe() routine depends on the FC_PT2PT flag to fill in the fabric controller SID when in PT2PT mode, but due to a previous commit the flag was getting cleared. Fix by adding a check for the defer_flogi_acc flag to know whether or not to clear the FC_PT2PT flag on link up. Link: https://lore.kernel.org/r/20220911221505.117655-3-jsmart2021@gmail.com Fixes: 439b93293ff2 ("scsi: lpfc: Fix unsolicited FLOGI receive handling during PT2PT discovery") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 16ece56986638b8de22f47d009e9b0feec53c031 Author: James Smart Date: Sun Sep 11 15:14:53 2022 -0700 scsi: lpfc: Fix prli_fc4_req checks in PRLI handling The if statment check (prli_fc4_req & PRLI_NVME_TYPE) evaluates to true when receiving a PRLI request for bogus FC4 type codes that happen to have the 3rd or 5th bit set because PRLI_NVME_TYPE is 0x28. This leads to sending a PRLI_NVME_ACC even for bogus FC4 type codes. Change the bitwise & check to an exact == type code check to ensure we send PRLI_NVME_ACC only for NVME type coded PRLI requests. Link: https://lore.kernel.org/r/20220911221505.117655-2-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5ba207e55e7fdfa5f30737d2b234bf5b70fa3bfe Author: Dan Carpenter Date: Thu Sep 15 14:11:04 2022 +0300 scsi: mpi3mr: Fix error code in mpi3mr_transport_smp_handler() The error code from mpi3mr_post_transport_req() is supposed to be passed to bsg_job_done(job, rc, reslen), but it isn't. Link: https://lore.kernel.org/r/YyMISJzVDARpVwrr@kili Fixes: 176d4aa69c6e ("scsi: mpi3mr: Support SAS transport class callbacks") Acked-by: Sathya Prakash Veerichetty Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit a113c02f57388fc4d179ac5580303d97a000ede7 Author: Dan Carpenter Date: Thu Sep 15 14:10:30 2022 +0300 scsi: mpi3mr: Fix error codes in mpi3mr_report_manufacture() There are three error paths which return success: 1) Propagate the error code from mpi3mr_post_transport_req() if it fails. 2) Return -EINVAL if "ioc_status != MPI3_IOCSTATUS_SUCCESS". 3) Return -EINVAL if "le16_to_cpu(mpi_reply.response_data_length) != sizeof(struct rep_manu_reply)" Link: https://lore.kernel.org/r/YyMIJh1HU2Qz9+Rs@kili Fixes: 2bd37e284914 ("scsi: mpi3mr: Add framework to issue MPT transport cmds") Acked-by: Sathya Prakash Veerichetty Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 32e7e06f60e78bca28fc6bb7f9dd54177750c331 Author: Kees Cook Date: Wed Sep 14 04:59:53 2022 -0700 scsi: aic79xx: Use __ro_after_init explicitly ahd_linux_setup_iocell_info() intentionally writes to the const-marked aic79xx_iocell_info array, but is called during __init, so the location is actually writable at this point on most architectures. Annotate this explicitly with __ro_after_init to avoid static analysis confusion. Link: https://lpc.events/event/16/contributions/1175/attachments/1109/2128/2022-LPC-analyzer-talk.pdf Link: https://lore.kernel.org/r/20220914115953.3854029-1-keescook@chromium.org Cc: Hannes Reinecke Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Reported-by: David Malcolm Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 4663509304a7cf8a9b4a98a7312a43ccfdc4fa2b Author: Gaosheng Cui Date: Tue Sep 13 10:37:22 2022 +0800 scsi: target: Remove unused se_tmr_req_cache declaration se_tmr_req_cache has been removed since commit c8e31f26feeb ("target: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cache"). Remove extern. Link: https://lore.kernel.org/r/20220913023722.547249-3-cuigaosheng1@huawei.com Signed-off-by: Gaosheng Cui Signed-off-by: Martin K. Petersen commit 1b80addaae099dc33e683d971aba90eeeaf887a3 Author: Gaosheng Cui Date: Tue Sep 13 10:37:21 2022 +0800 scsi: qla2xxx: Remove unused declarations for qla2xxx qla2x00_get_fw_version_str() has been removed since commit abbd8870b9cb ("[SCSI] qla2xxx: Factor-out ISP specific functions to method-based call tables."). qla2x00_release_nvram_protection() has been removed since commit 459c537807bd ("[SCSI] qla2xxx: Add ISP24xx flash-manipulation routines."). qla82xx_rdmem() and qla82xx_wrmem() have been removed since commit 3711333dfbee ("[SCSI] qla2xxx: Updates for ISP82xx."). qla25xx_rd_req_reg(), qla24xx_rd_req_reg(), qla25xx_wrt_rsp_reg(), qla24xx_wrt_rsp_reg(), qla25xx_wrt_req_reg() and qla24xx_wrt_req_reg() have been removed since commit 08029990b25b ("[SCSI] qla2xxx: Refactor request/response-queue register handling."). qla2x00_async_login_done() has been removed since commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery"). qlt_24xx_process_response_error() has been removed since commit c5419e2618b9 ("scsi: qla2xxx: Combine Active command arrays."). Remove the declarations for them from header file. Link: https://lore.kernel.org/r/20220913023722.547249-2-cuigaosheng1@huawei.com Signed-off-by: Gaosheng Cui Signed-off-by: Martin K. Petersen commit 8adc718881e0a70127f8843dd70e69a80de39352 Author: John Harrison Date: Wed Sep 14 16:46:05 2022 -0700 drm/i915/uc: Update to latest GuC and use new-format GuC/HuC names Going forwards, the intention is for GuC firmware files to be named for their major version only and HuC firmware files to have no version number in the name at all. This patch adds those entries for all platforms that are officially GuC/HuC enabled. Also, update the expected GuC version numbers to the latest firmware release for those platforms. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220914234605.622342-2-John.C.Harrison@Intel.com commit f04e47e770e5717b1a08639293d189d43af866c7 Author: Dmitry Bogdanov Date: Tue Sep 13 00:45:49 2022 +0300 scsi: target: alua: Do not report emtpy port group The default target port group is always returned in the list of port groups, even if the behaviour is unwanted, i.e. it has no members and non-default port groups are primary port groups. That violates SPC-4 "6.37 REPORT TARGET PORT GROUPS command": Every target port group shall contain at least one target port. The target port group descriptor shall include one target port descriptor for each target port in the target port group. This patch hides port groups with no ports in REPORT TARGET PORT GROUPS response. Link: https://lore.kernel.org/r/20220912214549.27882-1-d.bogdanov@yadro.com Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit 5bdd4a8e5cb96236a2aa9ad38df73381b4161404 Author: Dmitry Bogdanov Date: Mon Sep 12 15:54:57 2022 +0300 scsi: target: core: Set MULTIP bit for se_device with multiple ports SAM-5 4.8.3 (SCSI target device with multiple SCSI ports structure) obligates to set MULTIP bit when there's multiple SCSI target ports: Each device server shall indicate the presence of multiple SCSI target ports by setting the MULTIP bit to one in its standard INQUIRY data (see SPC-4). Set MULTIP bit automatically to indicate the presence of multiple SCSI target ports within standard inquiry response data if there are multiple target ports in all target port groups of the se_device. Link: https://lore.kernel.org/r/20220912125457.22573-2-d.bogdanov@yadro.com Reviewed-by: Mike Christie Co-developed-by: Roman Bolshakov Signed-off-by: Roman Bolshakov Signed-off-by: Dmitry Bogdanov Signed-off-by: Martin K. Petersen commit b404cb45990bf24d41c29fe856aafb0746a7b81f Author: Xinlei Lee Date: Wed Sep 14 21:21:00 2022 +0800 soc: mediatek: Add mmsys func to adapt to dpi output for MT8186 Add mmsys func to manipulate dpi output format config for MT8186. Co-developed-by: Jitao Shi Signed-off-by: Jitao Shi Signed-off-by: Xinlei Lee Reviewed-by: Nís F. R. A. Prado Link: https://lore.kernel.org/all/1663161662-1598-2-git-send-email-xinlei.lee@mediatek.com/ Signed-off-by: Matthias Brugger commit 812e92b824c1db16c9519f8624d48a9901a0d38f Author: Luiz Augusto von Dentz Date: Tue Sep 13 16:08:13 2022 -0700 Bluetooth: RFCOMM: Fix possible deadlock on socket shutdown/release Due to change to switch to use lock_sock inside rfcomm_sk_state_change the socket shutdown/release procedure can cause a deadlock: rfcomm_sock_shutdown(): lock_sock(); __rfcomm_sock_close(): rfcomm_dlc_close(): __rfcomm_dlc_close(): rfcomm_dlc_lock(); rfcomm_sk_state_change(): lock_sock(); To fix this when the call __rfcomm_sock_close is now done without holding the lock_sock since rfcomm_dlc_lock exists to protect the dlc data there is no need to use lock_sock in that code path. Link: https://lore.kernel.org/all/CAD+dNTsbuU4w+Y_P7o+VEN7BYCAbZuwZx2+tH+OTzCdcZF82YA@mail.gmail.com/ Fixes: b7ce436a5d79 ("Bluetooth: switch to lock_sock in RFCOMM") Signed-off-by: Luiz Augusto von Dentz commit 8774d335446a11f514a98aaa1c0e8a7cfab33637 Merge: 0d9787fa27432 84fc863606239 Author: Arnd Bergmann Date: Thu Sep 15 22:20:59 2022 +0200 Merge branch 'arm-multiplatform-cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/soc Now that everything except StrongARM is unified under CONFIG_ARCH_MULTIPLATFORM, the option is rather meaningless in its current form. Rework the Kconfig logic to make this useful again, similar to the way that RISC-V has CONFIG_NONPORTABLE (with the opposite polarity), this now controls the visibility of options that get in the way of building generic kernels, while allowing custom kernels. One side-effect is that 'randconfig' builds now rarely hit strongarm machines, rather than testing them three quarters of the time. * 'arm-multiplatform-cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: make ARCH_MULTIPLATFORM user-visible ARM: fix XIP_KERNEL dependencies ARM: Kconfig: clean up platform selection ARM: simplify machdirs/platdirs handling ARM: remove obsolete Makefile.boot infrastructure commit 0d9787fa274324ddbbe211c99ea44e86a3f55847 Merge: 8a6660465a96e be7f3f901c619 Author: Arnd Bergmann Date: Thu Sep 15 22:10:23 2022 +0200 Merge branch 'footbridge/cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/soc A cleanup for the footbridge platform that came out of inspecting the platforms during the multiplatform conversion as well as the dma address patches. * 'footbridge/cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: footbridge: remove custom DMA address handling ARM: footbridge: move isa-dma support into footbridge ARM: footbridge: remove leftover from personal-server ARM: footbridge: remove addin mode commit 8a6660465a96e1247f2e9cc58596f29b4eaa7198 Merge: 566e373fe047f 01bf00c52e9ea Author: Arnd Bergmann Date: Thu Sep 15 22:09:42 2022 +0200 Merge tag 'arm-soc/for-6.1/maintainers' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains Broadcom SoC MAINTAINERS file update for 6.1, please pull the following: - William merges the ARCH_BCM4908 with ARCH_BCMBCA entry * tag 'arm-soc/for-6.1/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Add BCM4908 maintainer to BCMBCA entry Link: https://lore.kernel.org/r/20220915023044.2350782-5-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 387969b7ab014ca71582473a4950fa711efe204b Merge: 34fdb46f0fe2a 5b0c6328e47dc Author: Arnd Bergmann Date: Thu Sep 15 22:07:06 2022 +0200 Merge tag 'ffa-updates-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers Arm FF-A firmware driver updates for v6.1 Small set of changes in preparation to add support for FF-A v1.1 specification later. It mainly contains: 1. Splitting up ffa_ops into different categories namely information, message and memory. It helps to make info and memory operations independent from ffa_device so thata generic memory management module can use it without specific ffa_dev. 2. Adds support for querying FF-A features and use the same to detect the support for 64-bit operations. 3. Adds v1.1 get_partition_info support and use the same to set up 32-bit execution mode flag automatically. 4. Adds pointer to the ffa_dev_ops in struct ffa_dev and drop ffa_dev_ops_get() which enables to drop ffa_ops in optee_ffa structure using ffa_dev->ops directly. Additionally ffa_dev_ops is renamed as ffa_ops. * tag 'ffa-updates-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Split up ffa_ops into info, message and memory operations firmware: arm_ffa: Set up 32bit execution mode flag using partiion property firmware: arm_ffa: Add v1.1 get_partition_info support firmware: arm_ffa: Rename ffa_dev_ops as ffa_ops firmware: arm_ffa: Make memory apis ffa_device independent firmware: arm_ffa: Use FFA_FEATURES to detect if native versions are supported firmware: arm_ffa: Add support for querying FF-A features firmware: arm_ffa: Remove ffa_dev_ops_get() tee: optee: Drop ffa_ops in optee_ffa structure using ffa_dev->ops directly firmware: arm_ffa: Add pointer to the ffa_dev_ops in struct ffa_dev Link: https://lore.kernel.org/r/20220913100612.2924643-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 34fdb46f0fe2aac3ef2096a1df15ef4a66608c5c Merge: d6ce6d14316e1 7bb49d774f481 Author: Arnd Bergmann Date: Thu Sep 15 22:04:41 2022 +0200 Merge tag 'arm-soc/for-6.1/drivers' of https://github.com/Broadcom/stblinux into arm/drivers This pull request contains Broadcom ARM/ARM64 SoC drivers updates for 6.1, please pull the following: - Guilherme adds a comment to the panic notifier, part of his big panic notifier rework series - William migrates all of ARCH_BCM4908 dependencies to ARCH_BCMBCA * tag 'arm-soc/for-6.1/drivers' of https://github.com/Broadcom/stblinux: arm64: bcmbca: Make BCM4908 drivers depend on ARCH_BCMBCA soc: bcm: brcmstb: Document panic notifier action and remove useless header Link: https://lore.kernel.org/r/20220915023044.2350782-4-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 32c3d47fd7fc92f0649c387bd7efd15f0c242213 Merge: e33060879cd3f 3bcae3396e986 Author: Arnd Bergmann Date: Thu Sep 15 22:03:43 2022 +0200 Merge tag 'arm-soc/for-6.1/devicetree-arm64' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM64-based SoC changes for 6.1, please pull the following: - Rafal adds the BCM4908 LED controller node and describes all 32 LED pins, he also adds support for the Asus GC-AC5300 LEDs * tag 'arm-soc/for-6.1/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: bcm4908: add Asus GT-AC5300 LEDs arm64: dts: broadcom: bcm4908: add LEDs controller block arm64: dts: broadcom: bcm4908: add remaining LED pins Link: https://lore.kernel.org/r/20220915023044.2350782-3-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit e33060879cd3fd8506353974beb51446daf83eff Merge: 2c12f88cef398 dd5c672d7ca92 Author: Arnd Bergmann Date: Thu Sep 15 22:00:12 2022 +0200 Merge tag 'arm-soc/for-6.1/devicetree' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM-based SoC Device Tree updates for 6.1, please pull the following: - Rafal improves the BCM5301X PCIe DT nodes schema validation by flagging the PCIe controller with a missing "device_type" property - William merges BCM4908 within BCMBCA since this chip is part of the Broadcom Broadband Carrier Access group and follows the architecture of those chips * tag 'arm-soc/for-6.1/devicetree' of https://github.com/Broadcom/stblinux: arm64: bcmbca: Merge ARCH_BCM4908 to ARCH_BCMBCA arm64: dts: Add BCM4908 generic board dts arm64: dts: Move BCM4908 dts to bcmbca folder arm64: dts: bcmbca: update BCM4908 board dts files dt-bindings: arm64: bcmbca: Update BCM4908 description dt-bindings: arm64: bcmbca: Merge BCM4908 into BCMBCA ARM: dts: BCM5301X: Add basic PCI controller properties Link: https://lore.kernel.org/r/20220915023044.2350782-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 79774742bde749af0a0ef09663709b739aa07e67 Merge: 5a4ca019f6276 d30b361310f80 Author: Arnd Bergmann Date: Thu Sep 15 21:57:56 2022 +0200 Merge tag 'arm-soc/for-6.1/defconfig-arm64' of https://github.com/Broadcom/stblinux into arm/defconfig This pull request contains Broadcom ARM64 defconfig changes for 6.1, please pull the following: - William completes the removal of ARCH_BCM4908 by removing that Kconfig entry from the defconfig since it is being deleted after having been transitional through 6.0 * tag 'arm-soc/for-6.1/defconfig-arm64' of https://github.com/Broadcom/stblinux: arm64: defconfig: remove BCM4908 Link: https://lore.kernel.org/r/20220915023044.2350782-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 8e4428051df12f3574b5d7927821c6fb75098d9a Author: Akhil R Date: Tue Sep 6 20:17:15 2022 +0530 arm64: tegra: Add GPCDMA support for Tegra I2C Add dma properties to support GPCDMA for I2C in Tegra 186 and later chips Signed-off-by: Akhil R Signed-off-by: Thierry Reding commit af4c27738c921bb1c346ba62e2672b48525fb213 Author: Mohan Kumar Date: Tue Aug 30 10:57:36 2022 +0530 arm64: tegra: Add iommus for HDA on Tegra234 Add the iommus property to the HDA node on Tegra234. Signed-off-by: Mohan Kumar Signed-off-by: Thierry Reding commit 0a4fa2504217f84411c3007dee0d954ae9579994 Author: Mohan Kumar Date: Thu Sep 1 10:03:05 2022 +0530 arm64: tegra: Enable HDA node for Jetson AGX Orin Enable HDA node for the Jetson AGX Orin platform. Signed-off-by: Mohan Kumar Signed-off-by: Thierry Reding commit b35f5b53a87b8415db242d332e517e145bf804be Author: Mikko Perttunen Date: Wed Sep 7 11:38:44 2022 +0300 arm64: tegra: Add context isolation domains on Tegra234 Add Host1x context isolation domains on Tegra234. On Tegra234 we have two IOMMUs that are connected to Host1x-channel programmed engines, so we have to include domains for each of them. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit b0c1a994f66050034c970a8187d88d4e1283f9d9 Author: Thierry Reding Date: Fri Sep 2 17:05:29 2022 +0200 arm64: tegra: Fixup iommu-map property formatting Make sure that each phandle-array is enclosed in a set of angular brackets and properly indent each entry. Signed-off-by: Thierry Reding commit a1e3de6ea5193b5a50d0af6095234a6fe278b2c2 Author: Diogo Ivo Date: Wed Sep 14 12:12:21 2022 +0100 arm64: dts: tegra: smaug: Add Wi-Fi node The Google Pixel C contains a BRCM4354 Wi-Fi + BT module. Add a DT node for its Wi-Fi functionality. Tested on Pixel C. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit a63c0cd83720c48c9f510aa5a48f2517abc206bd Author: Diogo Ivo Date: Wed Sep 14 12:12:20 2022 +0100 arm64: dts: tegra: smaug: Add Bluetooth node The Google Pixel C contains a BRCM4354 Wi-Fi + BT module. Add a DT node for its BT functionality. Tested on Pixel C. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 8aec2c17b95ed807f426bf5d7a2c9deeda482274 Author: Thierry Reding Date: Thu Jul 7 09:48:16 2022 +0200 arm64: tegra: Enable MGBE on Jetson AGX Orin Developer Kit A Multi-Gigabit Ethernet (MGBE) instance drives the primary Ethernet port on the Jetson AGX Orin Developer Kit. Enable it. Signed-off-by: Bhadram Varka Signed-off-by: Thierry Reding commit 610cdf3186bc604961bf04851e300deefd318038 Author: Thierry Reding Date: Thu Jul 7 09:48:15 2022 +0200 arm64: tegra: Add MGBE nodes on Tegra234 Add device tree nodes for the four instances of the Multi-Gigabit Ethernet (MGBE) IP found on NVIDIA Tegra234 SoCs. Signed-off-by: Bhadram Varka Signed-off-by: Thierry Reding commit 4f41e9d542758690be9fb665400b891f83233a08 Author: Thierry Reding Date: Wed Sep 7 18:19:43 2022 +0200 arm64: tegra: Fix up compatible for Tegra234 GPCDMA There is no need to list the Tegra194-specific compatible for Tegra234 because the backwards-compatibility goes back all the way to Tegra186. Signed-off-by: Thierry Reding commit 1d61cbb79058a21be94b0ab7c1c3dca190b139ee Author: Vidya Sagar Date: Thu Jul 21 19:50:42 2022 +0530 arm64: tegra: Enable PCIe slots in P3737-0000 board Enable PCIe controller nodes to enable respective PCIe slots on P3737-0000 board. Following is the ownership of slots by different PCIe controllers. Controller-1 : On-board Broadcom WiFi controller Controller-4 : M.2 Key-M slot Controller-5 : CEM form-factor x8 slot Signed-off-by: Vidya Sagar Signed-off-by: Thierry Reding commit ec142c44b0261ee7569371e49b2bdb0809366b39 Author: Vidya Sagar Date: Thu Jul 21 19:50:41 2022 +0530 arm64: tegra: Add P2U and PCIe controller nodes to Tegra234 DT Add P2U (PIPE to UPHY) and PCIe controller nodes to device tree. The Tegra234 SoC contains 10 PCIe controllers and 24 P2U instances grouped into three different PHY bricks namely High-Speed IO (HSIO-8 P2Us) NVIDIA High Speed (NVHS-8 P2Us) and Gigabit Ethernet (GBE-8 P2Us) respectively. Signed-off-by: Vidya Sagar Signed-off-by: Thierry Reding commit cd42b26a527f233827bb67231a04a2a9e40eae10 Author: Vidya Sagar Date: Thu Jul 21 19:50:40 2022 +0530 arm64: tegra: Add regulators required for PCIe Add regulator supplies required for PCIe functionality. The supplies include 1.8V, 3.3V and 12V. Signed-off-by: Vidya Sagar Signed-off-by: Thierry Reding commit 5b6b207ca55385cb6cd32316411eb55a48eab730 Merge: 568035b01cfb1 cc99f95d49b3e Author: Thierry Reding Date: Thu Sep 15 21:30:18 2022 +0200 Merge branch 'for-6.1/dt-bindings' into for-6.1/arm64/dt commit 677920072e9d757ae158d66b8fdb695992bb3f1a Author: Johan Hovold Date: Thu Sep 15 16:34:31 2022 +0200 arm64: dts: qcom: sm8450: fix UFS PHY serdes size The size of the UFS PHY serdes register region is 0x1c4 and the corresponding 'reg' property should specifically not include the adjacent regions that are defined in the child node (e.g. tx and rx). Fixes: 07fa917a335e ("arm64: dts: qcom: sm8450: add ufs nodes") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220915143431.19842-2-johan+linaro@kernel.org commit 5cbd20166f0ac7ae0272d25401b6ec5472482a19 Author: Luca Weiss Date: Sat Apr 23 17:50:59 2022 +0200 ARM: dts: qcom: apq8026-lg-lenok: Enable ADSP Configure the reserved memory for ADSP and enable it. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423155059.660387-5-luca@z3ntu.xyz commit 268c661c172d783540f34a132290e78342bae3c5 Author: Luca Weiss Date: Sat Apr 23 17:50:58 2022 +0200 ARM: dts: qcom: apq8026-asus-sparrow: Enable ADSP The customized reserved memory for ADSP is already configured, so we just need to enable the node. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423155059.660387-4-luca@z3ntu.xyz commit 25ba74dd60022f2fa1630405d6eba7c37f45b13a Author: Luca Weiss Date: Sat Apr 23 17:50:57 2022 +0200 ARM: dts: qcom: msm8226: Add ADSP node Add a node for the adsp found on msm8226. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423155059.660387-3-luca@z3ntu.xyz commit 97ec890d070158f15fe8ef2419a5ff677bdbbc20 Author: Srinivas Pandruvada Date: Thu Sep 15 10:43:44 2022 -0700 tools/power/x86/intel-speed-select: Release v1.13 Update version number. This version includes fixes for: - fix build failure when using gcc options -Wl,--as-needed - Fix warning for perf_cap.cpu may be uninitialized - Fix off by one check for MAX_DIE_PER_PACKAGE - Fix issue with use of get_physical_die_id instead of get_physical_die_id Optimizations: - Removed unused interfaces and functions - Better handle package, die, cpu combination by defining a struct and set at one place instead at each user level. New functional change: - Warn if turbo is disabled and SST turbo-freq feature is requested Signed-off-by: Srinivas Pandruvada commit 921604b409cc52d7f5196721ae07b54275e5ebe2 Author: Zhang Rui Date: Sat Aug 20 23:58:27 2022 +0800 tools/power/x86/intel-speed-select: Optimize CPU initialization Optimize CPU initialization. Do cpu related initialization in one function, including setting the cpu present_cpumask, target_cpumask, and cpu_map and core_count arrays. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit ca56725d78c5241f65cc565e5a865f45d943dc04 Author: Zhang Rui Date: Sat Aug 20 23:58:26 2022 +0800 tools/power/x86/intel-speed-select: Utilize cpu_map to get physical id cpu_map already has the cpu package id, die id information. Thus there is no need to re-evaluating sysfs attributes or stored data file to get the package id and die id of a given CPU each time. In order to unitlize this, cpu_map needs to be created unconditionally. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit a05b925ace3ea977fdadb32c969c22ef51029ee7 Author: Zhang Rui Date: Sat Aug 20 23:58:25 2022 +0800 tools/power/x86/intel-speed-select: Remove unused struct clos_config fields pkg_id/die_id can be retrieved from struct isst_id, remove the redundant clos_config->pkg_id/die_id fields. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 3ba6a27566a53030b3013f9f841ba5889a344cb8 Author: Zhang Rui Date: Sat Aug 20 23:58:24 2022 +0800 tools/power/x86/intel-speed-select: Enforce isst_id value Enforce the pkg/die value in struct isst_id are either -1 or a valid value. This helps avoid inconsistent or redundant checks. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit e616059ee6830242ffc68adc91a5486ac957dc1b Author: Zhang Rui Date: Sat Aug 20 23:58:23 2022 +0800 tools/power/x86/intel-speed-select: Do not export get_physical_id Now, all the get_physical_pkg/die/core_id() users are inside isst-config.c, so no need to export these APIs. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 00bb07db5a42c91f4a74e836c6ae70fff20f7f8a Author: Zhang Rui Date: Sat Aug 20 23:58:22 2022 +0800 tools/power/x86/intel-speed-select: Introduce is_cpu_in_power_domain helper struct isst_id contains cpu, package and die info, and it can represent a specific SST power domain. Introduce is_cpu_in_power_domain() helper to identify if a cpu is in a specified power_domain. And cleanup the code to use the new helper. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 56d6469291f8b1e1ab2f78e401c564163d3ee0f0 Author: Zhang Rui Date: Sat Aug 20 23:58:21 2022 +0800 tools/power/x86/intel-speed-select: Cleanup get_physical_id usage struct isst_id already contains package and die id information, thus there is no need to get the package and die id information, when struct isst_id is already available. Remove unneeded get_physical_package_id/get_physical_die_id usage. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 30e0600e2f849434e9a86824e2eced6a6c534723 Author: Zhang Rui Date: Sat Aug 20 23:58:20 2022 +0800 tools/power/x86/intel-speed-select: Convert more function to use isst_id With pkg and die info added into struct isst_id, more functions can be converted to use struct isst_id as parameter. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 32d6ab45511c65e64202bc0b436301fc8ee83ad8 Author: Zhang Rui Date: Sat Aug 20 23:58:19 2022 +0800 tools/power/x86/intel-speed-select: Add pkg and die in isst_id Code uses pkg_id and die_id to refer to a specific power domain. The pkg/die information is already settled at start time. Adding package id and die id information into struct isst_id so that code does not need to retrieve them at runtime. More code cleanups can be done with the package/die info available. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 850337ec7b2c0f510772eeeef9c12c658b3f3603 Author: Zhang Rui Date: Sat Aug 20 23:58:18 2022 +0800 tools/power/x86/intel-speed-select: Introduce struct isst_id SST control is power-domain based rather than cpu based, on all the systems including Sapphire Rapids and ealier. SST core APIs uses cpu id as parameter, and use the underlying pkg_id and die_id information to find a power domain, this is not straight forward and introduces obscure logics in the code. Introduce struct isst_id to represent a SST Power Domain. All core APIs are converted to use struct isst_id as parameter instead of using cpu id. Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit e278336912423834614191e32e9fbd239e320090 Author: Zhang Rui Date: Sat Aug 20 23:58:17 2022 +0800 tools/power/x86/intel-speed-select: Remove unused core_mask array Remove unused core_mask array. Reviewed-by: Ira Weiny Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 190ba96541a3f8f5caa3af41df63af756e43424d Author: Zhang Rui Date: Sat Aug 20 23:58:16 2022 +0800 tools/power/x86/intel-speed-select: Remove dead code Remove dead code. Not functional change in this patch Signed-off-by: Zhang Rui Signed-off-by: Srinivas Pandruvada commit 68584e380ef54fb1e7d97710a0fdd7e31212fd65 Author: Hector Martin Date: Wed Sep 14 09:34:26 2022 +0100 mailbox: apple: Implement poll_data() operation This allows clients running in atomic context to poll for messages to arrive. Signed-off-by: Hector Martin Signed-off-by: Russell King (Oracle) Signed-off-by: Jassi Brar commit 38ed8c888e94f10e3a74a931760e77c0ab9d2e48 Author: Hector Martin Date: Wed Sep 14 09:34:21 2022 +0100 mailbox: apple: Implement flush() operation This allows clients to use the atomic-safe mailbox API style. Signed-off-by: Hector Martin Signed-off-by: Russell King (Oracle) Signed-off-by: Jassi Brar commit 09db040339847c39a64bce6c06351c1f4a571cc2 Author: Zhang Rui Date: Sat Aug 20 23:58:15 2022 +0800 tools/power/x86/intel-speed-select: Fix cpu count for TDP level display In the function isst_ctdp_display_information(), call to the function get_cpu_count() is using get_physical_die_id() instead of get_physical_package_id(). This will result in wrong display of CPU count in that level. Signed-off-by: Zhang Rui [ Srinivas Pandruvada: fixed subject and change log ] Signed-off-by: Srinivas Pandruvada commit 433fb8a611ca2a32112668225beabda2302c9634 Author: Maxime Ripard Date: Tue Aug 16 13:25:30 2022 +0200 clk: tests: Add missing test case for ranges Let's add a test on the rate range after a reparenting. This fails for now, but it's worth having it to document the corner cases we don't support yet. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-26-maxime@cerno.tech Tested-by: Naresh Kamboju Tested-by: Linux Kernel Functional Testing Signed-off-by: Stephen Boyd commit af1e62f2ffe2b7fa90653f273efced0e0eabf7cc Author: Maxime Ripard Date: Tue Aug 16 13:25:29 2022 +0200 clk: qcom: clk-rcg2: Take clock boundaries into consideration for gfx3d The gfx3d clock is hand-crafting its own clk_rate_request in clk_gfx3d_determine_rate to pass to the parent of that clock. However, since the clk_rate_request is zero'd at creation, it will have a max_rate of 0 which will break any code depending on the clock boundaries. That includes the recent commit 948fb0969eae ("clk: Always clamp the rounded rate") which will clamp the rate given to clk_round_rate() to the current clock boundaries. For the gfx3d clock, it means that since both the min_rate and max_rate fields are set at zero, clk_round_rate() now always return 0. Let's initialize the min_rate and max_rate fields properly for that clock. Fixes: 948fb0969eae ("clk: Always clamp the rounded rate") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-25-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 253993253466ba7187730b196174146d5247e97b Author: Maxime Ripard Date: Tue Aug 16 13:25:28 2022 +0200 clk: Introduce the clk_hw_get_rate_range function Some clock providers are hand-crafting their clk_rate_request, and need to figure out the current boundaries of their clk_hw to fill it properly. Let's create such a function for clock providers. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-24-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit b46fd8dbe8ad3fe6dcd44dcdf01a736c50d90a68 Author: Maxime Ripard Date: Tue Aug 16 13:25:27 2022 +0200 clk: Zero the clk_rate_request structure In order to make sure we don't carry anything over from an already existing clk_rate_request pointer we would pass to clk_core_init_rate_req(), let's zero the entire structure before initializing it. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-23-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 262ca38f4b6eb418b20b8e1d6d8495c6a98727c1 Author: Maxime Ripard Date: Tue Aug 16 13:25:26 2022 +0200 clk: Stop forwarding clk_rate_requests to the parent If the clock cannot modify its rate and has CLK_SET_RATE_PARENT, clk_mux_determine_rate_flags(), clk_core_round_rate_nolock() and a number of drivers will forward the clk_rate_request to the parent clock. clk_core_round_rate_nolock() will pass the pointer directly, which means that we pass a clk_rate_request to the parent that has the rate, min_rate and max_rate of the child, and the best_parent_rate and best_parent_hw fields will be relative to the child as well, so will point to our current clock and its rate. The most common case for CLK_SET_RATE_PARENT is that the child and parent clock rates will be equal, so the rate field isn't a worry, but the other fields are. Similarly, if the parent clock driver ever modifies the best_parent_rate or best_parent_hw, this will be applied to the child once the call to clk_core_round_rate_nolock() is done. best_parent_hw is probably not going to be a valid parent, and best_parent_rate might lead to a parent rate change different to the one that was initially computed. clk_mux_determine_rate_flags() and the affected drivers will copy the request before forwarding it to the parents, so they won't be affected by the latter issue, but the former is still going to be there and will lead to erroneous data and context being passed to the various clock drivers in the same sub-tree. Let's create two new functions, clk_core_forward_rate_req() and clk_hw_forward_rate_request() for the framework and the clock providers that will copy a request from a child clock and update the context to match the parent's. We also update the relevant call sites in the framework and drivers to use that new function. Let's also add a test to make sure we avoid regressions there. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-22-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 22fb0e284fbc3c1b85d24c5a1df8ea3ac82ab1d1 Author: Maxime Ripard Date: Tue Aug 16 13:25:25 2022 +0200 clk: Constify clk_has_parent() clk_has_parent() doesn't modify the clocks being passed, so let's make it const. Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-21-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 1234a2c40b8cf16041fb9acd730160e6c5b4ba13 Author: Maxime Ripard Date: Tue Aug 16 13:25:24 2022 +0200 clk: Introduce clk_core_has_parent() We will need to know if a clk_core pointer has a given parent in other functions, so let's create a clk_core_has_parent() function that clk_has_parent() will call into. For good measure, let's add some unit tests as well to make sure it works properly. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-20-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju [sboyd@kernel.org: Move tmp declaration, fix conditional to check for current parent] Signed-off-by: Stephen Boyd commit 666650b25ac43700a1cce96e51a32fc89c973d28 Author: Maxime Ripard Date: Tue Aug 16 13:25:23 2022 +0200 clk: Switch from __clk_determine_rate to clk_core_round_rate_nolock clk_mux_determine_rate_flags() will call into __clk_determine_rate() with a clk_hw pointer, while it has access to the clk_core pointer already. This leads to back and forth between clk_hw and clk_core, while __clk_determine_rate will only call clk_core_round_rate_nolock() with the clk_core pointer it retrieved from the clk_hw. Let's simplify things a bit by calling into clk_core_round_rate_nolock directly. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-19-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 11c84a38fcff30197f6e8af29e65531a5734ee05 Author: Maxime Ripard Date: Tue Aug 16 13:25:22 2022 +0200 clk: Add our request boundaries in clk_core_init_rate_req The expectation is that a new clk_rate_request is initialized through a call to clk_core_init_rate_req(). However, at the moment it only fills the parent rate and clk_hw pointer, but omits the other fields such as the clock rate boundaries. Some users of that function will update them after calling it, but most don't. As we are passed the clk_core pointer, we have access to those boundaries in clk_core_init_rate_req() however, so let's just fill it there and remove it from the few callers that do it right. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-18-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit c35e84b0977617f96fb1dbef3fb8d71a861325c0 Author: Maxime Ripard Date: Tue Aug 16 13:25:21 2022 +0200 clk: Introduce clk_hw_init_rate_request() clk-divider instantiates clk_rate_request internally for its round_rate implementations to share the code with its determine_rate implementations. However, it's missing a few fields (min_rate, max_rate) that would be initialized properly if it was using clk_core_init_rate_req(). Let's create the clk_hw_init_rate_request() function for clock providers to be able to share the code to instation clk_rate_requests with the framework. This will also be useful for some tests introduced in later patches. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-17-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 8cd9c39dce5b54494f967235f7eeac7c30c08b97 Author: Maxime Ripard Date: Tue Aug 16 13:25:20 2022 +0200 clk: Move clk_core_init_rate_req() from clk_core_round_rate_nolock() to its caller The clk_rate_request structure is used internally as an argument for the clk_core_determine_round_nolock() and clk_core_round_rate_nolock(). In both cases, the clk_core_init_rate_req() function is used to initialize the clk_rate_request structure. However, the expectation on who gets to call that function is inconsistent between those two functions. Indeed, clk_core_determine_round_nolock() will assume the structure is properly initialized and will just use it. On the other hand, clk_core_round_rate_nolock() will call clk_core_init_rate_req() itself, expecting the caller to have filled only a minimal set of parameters (rate, min_rate and max_rate). If we ignore the calling convention inconsistency, this leads to a second inconsistency for drivers: * If they get called by the framework through clk_core_round_rate_nolock(), the rate, min_rate and max_rate fields will be filled by the caller, and the best_parent_rate and best_parent_hw fields will get filled by clk_core_init_rate_req(). * If they get called by a driver through __clk_determine_rate (and thus clk_core_round_rate_nolock), only best_parent_rate and best_parent_hw are being explicitly set by the framework. Even though we can reasonably expect rate to be set, only one of the 6 in-tree users explicitly set min_rate and max_rate. * If they get called by the framework through clk_core_determine_round_nolock(), then we have two callpaths. Either it will be called by clk_core_round_rate_nolock() itself, or it will be called by clk_calc_new_rates(), which will properly initialize rate, min_rate, max_rate itself, and best_parent_rate and best_parent_hw through clk_core_init_rate_req(). Even though the first and third case seems equivalent, they aren't when the clock has CLK_SET_RATE_PARENT. Indeed, in such a case clk_core_round_rate_nolock() will call itself on the current parent clock with the same clk_rate_request structure. The clk_core_init_rate_req() function will then be called on the parent clock, with the child clk_rate_request pointer and will fill the best_parent_rate and best_parent_hw fields with the parent context. When the whole recursion stops and the call returns, the initial caller will end up with a clk_rate_request structure with some information of the child clock (rate, min_rate, max_rate) and some others of the last clock up the tree whose child had CLK_SET_RATE_PARENT (best_parent_hw, best_parent_rate). In the most common case, best_parent_rate is going to be equal on all the parent clocks so it's not a big deal. However, best_parent_hw is going to point to a clock that never has been a valid parent for that clock which is definitely confusing. In order to fix the calling inconsistency, let's move the clk_core_init_rate_req() calls to the callers, which will also help a bit with the clk_core_round_rate_nolock() recursion. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-16-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 718af795d3fd786928506cd5251597fbe29c7fda Author: Maxime Ripard Date: Tue Aug 16 13:25:19 2022 +0200 clk: Change clk_core_init_rate_req prototype The expectation is that a clk_rate_request structure is supposed to be initialized using clk_core_init_rate_req(), yet the rate we want to request still needs to be set by hand. Let's just pass the rate as a function argument so that callers don't have any extra work to do. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-15-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit cb1b1dd96241f37ea41d241946d5153c48141cd5 Author: Maxime Ripard Date: Tue Aug 16 13:25:18 2022 +0200 clk: Set req_rate on reparenting If a non-rate clock started by default with a parent that never registered, core->req_rate will be 0. The expectation is that whenever the parent will be registered, req_rate will be updated with the new value that has just been computed. However, if that clock is a mux, clk_set_parent() can also make that clock no longer orphan. In this case however, we never update req_rate. The natural solution to this would be to update core->rate and core->req_rate in clk_reparent() by calling clk_recalc(). However, this doesn't work in all cases. Indeed, clk_recalc() is called by __clk_set_parent_before(), __clk_set_parent() and clk_core_reparent(). Both __clk_set_parent_before() and __clk_set_parent will call clk_recalc() with the enable_lock taken through a call to clk_enable_lock(), the underlying locking primitive being a spinlock. clk_recalc() calls the backing driver .recalc_rate hook, and that implementation might sleep if the underlying device uses a bus with accesses that might sleep, such as i2c. In such a situation, we would end up sleeping while holding a spinlock, and thus in an atomic section. In order to work around this, we can move the core->rate and core->req_rate update to the clk_recalc() calling sites, after the enable_lock has been released if it was taken. The only situation that could still be problematic is the clk_core_reparent() -> clk_reparent() case that doesn't have any locking. clk_core_reparent() is itself called by clk_hw_reparent(), which is then called by 4 drivers: * clk-stm32mp1.c, stm32/clk-stm32-core.c and tegra/clk-tegra210-emc.c use it in their set_parent implementation. The set_parent hook is only called by __clk_set_parent() and clk_change_rate(), both of them calling it without the enable_lock taken. * clk/tegra/clk-tegra124-emc.c calls it as part of its set_rate implementation. set_rate is only called by clk_change_rate(), again without the enable_lock taken. In both cases we can't end up in a situation where the clk_hw_reparent() caller would hold a spinlock, so it seems like this is a good workaround. Let's also add some unit tests to make sure we cover the original bug. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-14-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 3afb07231d603d51dca6a5d5e16d9d8f422f9b5f Author: Maxime Ripard Date: Tue Aug 16 13:25:17 2022 +0200 clk: Take into account uncached clocks in clk_set_rate_range() clk_set_rate_range() will use the last requested rate for the clock when it calls into the driver set_rate hook. However, if CLK_GET_RATE_NOCACHE is set on that clock, the last requested rate might not be matching the current rate of the clock. In such a case, let's read out the rate from the hardware and use that in our set_rate instead. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-13-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 2e9cad1abc7149c5e6aeee7e76a6c363d392da8b Author: Maxime Ripard Date: Tue Aug 16 13:25:16 2022 +0200 clk: tests: Add some tests for orphan with multiple parents Let's leverage the dummy mux with multiple parents we have to create a mux whose default parent will never be registered, and thus will always be orphan by default. We can then create some tests to make sure that the clock API behaves properly in such a case, and that the transition to a non-orphan clock when we change the parent is done properly. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-12-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 74933ef22c1c3d3d1456c2f949f1910ce2aab1f1 Author: Maxime Ripard Date: Tue Aug 16 13:25:15 2022 +0200 clk: tests: Add tests for mux with multiple parents We'll need to test a few corner cases that occur when we have a mux clock whose default parent is missing. For now, let's create the context structure and the trivial ops, along with a test suite that just tests trivial things for now, without considering the orphan case. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-11-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 02cdeace1e1ed210eb9fc2ce562d93580b1dcfe5 Author: Maxime Ripard Date: Tue Aug 16 13:25:14 2022 +0200 clk: tests: Add tests for single parent mux We have a few tests for a mux with a single parent, testing the case where it used to be orphan. Let's leverage most of the code but register the clock properly to test a few trivial things. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-10-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 350575abec48ef5363abd832386cb5a33861cb10 Author: Maxime Ripard Date: Tue Aug 16 13:25:13 2022 +0200 clk: tests: Add tests for uncached clock The clock framework supports clocks that can have their rate changed without the kernel knowing about it using the CLK_GET_RATE_NOCACHE flag. As its name suggests, this flag turns off the rate caching in the clock framework, reading out the rate from the hardware any time we need to read it. Let's add a couple of tests to make sure it works as intended. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-9-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 7d79c26b60e623a9a089d771f81c5997bda577cd Author: Maxime Ripard Date: Tue Aug 16 13:25:12 2022 +0200 clk: tests: Add reference to the orphan mux bug report Some more context might be useful for unit-tests covering a previously reported bug, so let's add a link to the discussion for that bug. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-8-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 090962b6a90a2bf81142f6d5da9492380d5fba08 Author: Maxime Ripard Date: Tue Aug 16 13:25:11 2022 +0200 clk: tests: Add test suites description We start to have a few test suites, and we'll add more, so it will get pretty confusing to figure out what is supposed to be tested in what suite. Let's add some comments to explain what setup they create, and what we should be testing in every suite. Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-7-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit bde8870cd8c3a3913ddbc19f8422a21828e14d99 Author: Maxime Ripard Date: Tue Aug 16 13:25:10 2022 +0200 clk: Clarify clk_get_rate() expectations As shown by a number of clock users already, clk_get_rate() can be called whether or not the clock is enabled. Similarly, a number of clock drivers will return a rate of 0 whenever the rate cannot be figured out. Since it was a bit ambiguous before, let's make it clear in the clk_get_rate() documentation. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-6-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit f24a0b1c22c2e90abb4ee1f7a3b0f0d8fc2ede5f Author: Maxime Ripard Date: Tue Aug 16 13:25:09 2022 +0200 clk: Mention that .recalc_rate can return 0 on error Multiple platforms (amlogic, imx8) return 0 when the clock rate cannot be determined properly by the recalc_rate hook. Mention in the documentation that the framework is ok with that. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-5-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit facf949b2e6934d381050417bf4e34b20c93be09 Author: Maxime Ripard Date: Tue Aug 16 13:25:08 2022 +0200 clk: Skip clamping when rounding if there's no boundaries Commit 948fb0969eae ("clk: Always clamp the rounded rate") recently started to clamp the request rate in the clk_rate_request passed as an argument of clk_core_determine_round_nolock() with the min_rate and max_rate fields of that same request. While the clk_rate_requests created by the framework itself always have those fields set, some drivers will create it themselves and don't always fill min_rate and max_rate. In such a case, we end up clamping the rate with a minimum and maximum of 0, thus always rounding the rate to 0. Let's skip the clamping if both min_rate and max_rate are set to 0 and complain so that it gets fixed. Fixes: 948fb0969eae ("clk: Always clamp the rounded rate") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-4-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit d77388223240884b918b8d85f88f132916afbf06 Author: Maxime Ripard Date: Tue Aug 16 13:25:07 2022 +0200 clk: Drop the rate range on clk_put() When clk_put() is called we don't make another clk_set_rate() call to re-evaluate the rate boundaries. This is unlike clk_set_rate_range() that evaluates the rate again each time it is called. However, clk_put() is essentially equivalent to clk_set_rate_range() since after clk_put() completes the consumer's boundaries shouldn't be enforced anymore. Let's add a call to clk_set_rate_range() in clk_put() to make sure those rate boundaries are dropped and the clock provider drivers can react. In order to be as non-intrusive as possible, we'll just make that call if the clock had non-default boundaries. Also add a few tests to make sure this case is covered. Fixes: c80ac50cbb37 ("clk: Always set the rate on clk_set_range_rate") Tested-by: Alexander Stein # imx8mp Tested-by: Marek Szyprowski # exynos4210, meson g12b Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-3-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit aac00c7fa1149fd5b5a5110096ffa78dcb120b79 Author: Maxime Ripard Date: Tue Aug 16 13:25:06 2022 +0200 clk: test: Switch to clk_hw_get_clk Following the clk_hw->clk pointer is equivalent to calling clk_hw_get_clk(), but will make the job harder if we need to rework that part in the future. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220816112530.1837489-2-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Signed-off-by: Stephen Boyd commit 5ebb14aa5a193b3a6a5c359bdd4d3573cb14bdf1 Author: AngeloGioacchino Del Regno Date: Fri Jul 29 11:35:36 2022 +0200 arm64: dts: mediatek: mt6795: Add CPUX system timer node Add a node for mt6795-systimer: this is necessary to start the System Timer(s) for all cores, finally making CNTVCT_EL0 usable. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220729093536.27623-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 1b8501505f57757c393aa20da36fe2d8c29694d0 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 16:01:21 2022 +0200 soc: mediatek: mutex: Add support for MT6795 Helio X10 display mutex MT6795 has the same mutex mod/sof register layout as MT2712 and MT8173, but supports only four SOF, as it has two DSI and one DPI. Support is added by reusing most of the MT8173 data, with the addition of a mt6795-specific SOF array (and devicetree compatible, of course). Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220913140121.403637-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit f3894f969cf5dda43ba8c5fb329872860920c6d1 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 16:01:20 2022 +0200 dt-bindings: soc: mediatek: Add display mutex support for MT6795 Add compatible for MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220913140121.403637-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit ed22cc93abae68f9d3fc4957c20a1d902cf28882 Author: Johan Hovold Date: Thu Sep 15 16:34:30 2022 +0200 arm64: dts: qcom: ipq8074: fix PCIe PHY serdes size The size of the PCIe PHY serdes register region is 0x1c4 and the corresponding 'reg' property should specifically not include the adjacent regions that are defined in the child node (e.g. tx and rx). Fixes: 33057e1672fe ("ARM: dts: ipq8074: Add pcie nodes") Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220915143431.19842-1-johan+linaro@kernel.org commit 0d97db026509c1a13f732b22670ab1f0ac9d8d87 Author: Namhyung Kim Date: Thu Sep 8 17:08:03 2022 -0700 locking: Add __sched to semaphore functions The internal functions are marked with __sched already, let's do the same for external functions too so that we can skip them in the stack trace. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220909000803.4181857-1-namhyung@kernel.org commit 48dfb5d2560d36fb16c7d430c229d1604ea7d185 Author: Gokul krishna Krishnakumar Date: Thu Sep 8 23:54:27 2022 +0530 locking/rwsem: Disable preemption while trying for rwsem lock Make the region inside the rwsem_write_trylock non preemptible. We observe RT task is hogging CPU when trying to acquire rwsem lock which was acquired by a kworker task but before the rwsem owner was set. Here is the scenario: 1. CFS task (affined to a particular CPU) takes rwsem lock. 2. CFS task gets preempted by a RT task before setting owner. 3. RT task (FIFO) is trying to acquire the lock, but spinning until RT throttling happens for the lock as the lock was taken by CFS task. This patch attempts to fix the above issue by disabling preemption until owner is set for the lock. While at it also fix the issues at the places where rwsem_{set,clear}_owner() are called. This also adds lockdep annotation of preemption disable in rwsem_{set,clear}_owner() on Peter Z. suggestion. Signed-off-by: Gokul krishna Krishnakumar Signed-off-by: Mukesh Ojha Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Link: https://lore.kernel.org/r/1662661467-24203-1-git-send-email-quic_mojha@quicinc.com commit 2747b93ebbede2af2d7bb088b9ddae3193ceede8 Author: Sebastian Andrzej Siewior Date: Thu Aug 25 18:08:56 2022 +0200 locking: Detect includes rwlock.h outside of spinlock.h From: Michael S. Tsirkin The check for __LINUX_SPINLOCK_H within rwlock.h (and other files) detects the direct include of the header file if it is at the very beginning of the include section. If it is listed later then chances are high that spinlock.h was already included (including rwlock.h) and the additional listing of rwlock.h will not cause any failure. On PREEMPT_RT this additional rwlock.h will lead to compile failures since it uses a different rwlock implementation. Add __LINUX_INSIDE_SPINLOCK_H to spinlock.h and check for this instead of __LINUX_SPINLOCK_H to detect wrong includes. This will help detect direct includes of rwlock.h with without PREEMPT_RT enabled. [ bigeasy: add remaining __LINUX_SPINLOCK_H user and rewrite commit description. ] Signed-off-by: Michael S. Tsirkin Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YweemHxJx7O8rjBx@linutronix.de commit 7a7621dfa417aa3715d2a3bd1bdd6cf5018274d0 Author: Peter Zijlstra Date: Wed Sep 7 11:01:20 2022 +0200 objtool,x86: Teach decode about LOOP* instructions When 'discussing' control flow Masami mentioned the LOOP* instructions and I realized objtool doesn't decode them properly. As it turns out, these instructions are somewhat inefficient and as such unlikely to be emitted by the compiler (a few vmlinux.o checks can't find a single one) so this isn't critical, but still, best to decode them properly. Reported-by: Masami Hiramatsu (Google) Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Yxhd4EMKyoFoH9y4@hirez.programming.kicks-ass.net commit 8c03af3e090e9d57d90f482d344563dd4bae1e66 Author: Peter Zijlstra Date: Thu Sep 8 12:04:50 2022 +0200 x86,retpoline: Be sure to emit INT3 after JMP *%\reg Both AMD and Intel recommend using INT3 after an indirect JMP. Make sure to emit one when rewriting the retpoline JMP irrespective of compiler SLS options or even CONFIG_SLS. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Alexei Starovoitov Link: https://lkml.kernel.org/r/Yxm+QkFPOhrVSH6q@hirez.programming.kicks-ass.net commit 7e9518baed4cef76dbfa07cbffbae1e6dbc87be6 Author: Vincent Guittot Date: Thu Aug 25 14:27:25 2022 +0200 sched/fair: Move call to list_last_entry() in detach_tasks Move the call to list_last_entry() in detach_tasks() after testing loop_max and loop_break. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220825122726.20819-4-vincent.guittot@linaro.org commit c59862f8265f8060b6650ee1dc12159fe5c89779 Author: Vincent Guittot Date: Thu Aug 25 14:27:24 2022 +0200 sched/fair: Cleanup loop_max and loop_break sched_nr_migrate_break is set to a fix value and never changes so we can replace it by a define SCHED_NR_MIGRATE_BREAK. Also, we adjust SCHED_NR_MIGRATE_BREAK to be aligned with the init value of sysctl_sched_nr_migrate which can be init to different values. Then, use SCHED_NR_MIGRATE_BREAK to init sysctl_sched_nr_migrate. The behavior stays unchanged unless you modify sysctl_sched_nr_migrate trough debugfs. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220825122726.20819-3-vincent.guittot@linaro.org commit b0defa7ae03ecf91b8bfd10ede430cff12fcbd06 Author: Vincent Guittot Date: Thu Aug 25 14:27:23 2022 +0200 sched/fair: Make sure to try to detach at least one movable task During load balance, we try at most env->loop_max time to move a task. But it can happen that the loop_max LRU tasks (ie tail of the cfs_tasks list) can't be moved to dst_cpu because of affinity. In this case, loop in the list until we found at least one. The maximum of detached tasks remained the same as before. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220825122726.20819-2-vincent.guittot@linaro.org commit be7f3f901c619e24c93b8044c074306feedd8ee9 Author: Arnd Bergmann Date: Thu Aug 25 10:51:42 2022 +0200 ARM: footbridge: remove custom DMA address handling Footbridge is the last Arm platform that has its own __virt_to_bus()/__bus_to_virt()/phys_to_dma()/dma_to_phys() abstraction, but this is just a simple offset now. For PCI devices, the offset that is programmed into the PCI bridge must also be set in each device using dma_direct_set_offset(). As Arm does not have a pcibios_bus_add_device() helper yet, just use a bus notifier for this. For the ISA DMA, drivers now pass a non-translated physical address into set_dma_addr(), so they have to be converted back with the corresponding isa_bus_to_virt() function and then into the correct bus address with the offset using the isa_dma_dev. Tested-by: Marc Zyngier Signed-off-by: Arnd Bergmann commit 747c39f0ebfaee9cf699dd3c35ac6462db847667 Author: Akhil R Date: Tue Sep 6 20:17:16 2022 +0530 arm64: defconfig: Make TEGRA186_GPC_DMA built-in Make TEGRA186_GPC_DMA driver as built-in since the clients using the DMA (like I2C_TEGRA etc) are built-in. This would avoid the potential long delay probe deferral can cause. Signed-off-by: Akhil R Signed-off-by: Thierry Reding commit 1c33f8508b625e8c792b396155f6ef7cbc8f4212 Author: Markus Reichl Date: Thu Sep 15 13:11:36 2022 +0200 arm64: dts: rockchip: Add HDMI supplies on rk3399-roc-pc Add avdd-0v9-supply and avdd-1v8-supply to hdmi node for rk3399-roc-pc to silence dmesg warning and match the name of the 1v8 supply to the circuit sheet. Signed-off-by: Markus Reichl Link: https://lore.kernel.org/r/20220915111138.1108-1-m.reichl@fivetechno.de Signed-off-by: Heiko Stuebner commit 578980728868fcd99bbb5af12e50b38d2e66f5aa Author: Brian Norris Date: Wed Aug 17 12:33:56 2022 -0700 arm64: dts: rockchip: Support gru-scarlet sku{2,4} variants The Gru-Scarlet family includes a variety of SKU identifiers, using parts of a 3-bit space {0..7}. SKU2 and SKU4 devices (under a few different manufacturer names) also use the Innolux display. Without this, a SKU2 device may non-deterministically (depending on the matching order of DTBs and bootloader behavior) select either one of the INX DTBs (rk3399-gru-scarlet-dumo.dtb or rk3399-gru-scarlet-inx.dtb) or the KingDisplay DTB (rk3399-gru-scarlet-kd.dtb), to ill effect. For reference, the original vendor tree source: CHROMIUM: arm64: dts: rockchip: add sku{0,2,4} compatibility https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f6ed665c9e2eb37fb2680debbb36ec9fb0e8fb97 CHROMIUM: arm64: dts: rockchip: scarlet: add SKU0 device tree https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9987c8776f4b087d135d761e59f7fa6cc83fc7fc Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220817123350.2.I5f4fd0808a927b08e267c189712fb4a85931fd3b@changeid Signed-off-by: Heiko Stuebner commit b360cfbf86a918b835e673b9da5faf972a9bf146 Author: Brian Norris Date: Wed Aug 17 12:33:55 2022 -0700 dt-bindings: arm: rockchip: Add gru-scarlet sku{2,4} variants The Gru-Scarlet family includes a variety of SKU identifiers, using parts of a 3-bit space {0..7}. SKU2 and SKU4 devices (under a few different manufacturer names) also use the Innolux display. For reference, the original vendor tree source: CHROMIUM: arm64: dts: rockchip: add sku{0,2,4} compatibility https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f6ed665c9e2eb37fb2680debbb36ec9fb0e8fb97 CHROMIUM: arm64: dts: rockchip: scarlet: add SKU0 device tree https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9987c8776f4b087d135d761e59f7fa6cc83fc7fc Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220817123350.1.Ibb15bab32dbfa0d89f86321c4eae7adbc8d7ad4a@changeid Signed-off-by: Heiko Stuebner commit 98a65e6d498c46b0beec7a40aac4b3e404642993 Author: Tom Rix Date: Sat May 21 15:07:16 2022 -0400 drm/rockchip: remove vop_writel from vop1 driver cppcheck reports [drivers/gpu/drm/rockchip/rockchip_drm_vop.c:186]: (style) The function 'vop_writel' is never used. vop_writel is static function that is not used, so remove it. Signed-off-by: Tom Rix Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220521190716.1936193-1-trix@redhat.com commit 7ae7a6211fe7251543796d5af971acb8c9e2da9e Author: Hugh Cole-Baker Date: Tue Oct 19 22:58:42 2021 +0100 drm/rockchip: support gamma control on RK3399 The RK3399 has a 1024-entry gamma LUT with 10 bits per component on its "big" VOP and a 256-entry, 8 bit per component LUT on the "little" VOP. Compared to the RK3288, it no longer requires disabling gamma while updating the LUT. On the RK3399, the LUT can be updated at any time as the hardware has two LUT buffers, one can be written while the other is in use. A swap of the buffers is triggered by writing 1 to the update_gamma_lut register. Signed-off-by: Hugh Cole-Baker Tested-by: "Milan P. Stanić" Tested-by: Linus Heckemann Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20211019215843.42718-3-sigmaris@gmail.com commit 3ba000d6ae999b99f29afd64814877a5c4406786 Author: Hugh Cole-Baker Date: Tue Oct 19 22:58:41 2021 +0100 drm/rockchip: define gamma registers for RK3399 The VOP on RK3399 has a different approach from previous versions for setting a gamma lookup table, using an update_gamma_lut register. As this differs from RK3288, give RK3399 its own set of "common" register definitions. Signed-off-by: Hugh Cole-Baker Tested-by: "Milan P. Stanić" Tested-by: Linus Heckemann Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20211019215843.42718-2-sigmaris@gmail.com commit 3d7a198cfdb47405cfb4a3ea523876569fe341e6 Author: Gaosheng Cui Date: Tue Sep 13 15:50:29 2022 +0800 KVM: PPC: remove orphan declarations from kvm_ppc.h Remove the following orphan declarations from kvm_ppc.h: 1. kvmppc_mmu_priv_switch() has been removed since commit dd9ebf1f9435 ("KVM: PPC: e500: Add shadow PID support"). 2. kvmppc_core_destroy_mmu() has been removed since commit ecc0981ff07c ("KVM: ppc: cosmetic changes to mmu hook names"). 3. kvmppc_prepare_vrma() has been removed since commit aa04b4cc5be6 ("KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests"). So remove the declarations for them from header file. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-10-cuigaosheng1@huawei.com commit b47f0024f990803f36e6a06f82e9d0dbe8424c26 Author: Gaosheng Cui Date: Tue Sep 13 15:50:28 2022 +0800 powerpc/ps3: remove orphan declarations from ps3av.h Remove the following orphan declarations from ps3av.h: 1. ps3av_dev_open() 2. ps3av_dev_close() They have been removed since commit 13a5e30cf740 ("[POWERPC] PS3: Rework AV settings driver"), so remove them. Signed-off-by: Gaosheng Cui Acked-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-9-cuigaosheng1@huawei.com commit 3abed8acfe95046b27117f48d52dccd2ea82a322 Author: Gaosheng Cui Date: Tue Sep 13 15:50:27 2022 +0800 powerpc/sysdev: remove unused xics_ipi_dispatch() declaration xics_ipi_dispatch() has been removed since commit 23d72bfd8f9f ("powerpc: Consolidate ipi message mux and demux"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-8-cuigaosheng1@huawei.com commit 77d30535816e90ff6a4466210c403a6b8b42a0a5 Author: Gaosheng Cui Date: Tue Sep 13 15:50:26 2022 +0800 powerpc/powernv: remove orphan declarations from opal.h Remove the following orphan declarations from opal.h: 1. opal_notifier_register() 2. opal_notifier_unregister() 3. opal_notifier_update_evt() 4. opal_notifier_enable() 5. opal_notifier_disable() They have been removed since commit 81f2f7ce4c5b ("opal: Remove events notifier"), so remove them. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-7-cuigaosheng1@huawei.com commit d24b8f01fe7b848f88ff0a3204a674a092f365d0 Author: Gaosheng Cui Date: Tue Sep 13 15:50:25 2022 +0800 powerpc/mm: remove orphan declarations from mmu_context.h Remove the following orphan declarations from mmu_context.h: 1. switch_cop() and drop_cop() have been removed since commit 6ff4d3e96652 ("powerpc: Remove old unused icswx based coprocessor support"). 2. mm_iommu_cleanup() has been removed since commit 4b6fad7097f8 ("powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown"). So remove the declarations for them from header file. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-6-cuigaosheng1@huawei.com commit b5a472ad81ba23327ef11ca5b4ba9fd8ed38e45e Author: Gaosheng Cui Date: Tue Sep 13 15:50:24 2022 +0800 powerpc: remove unused udbg_init_debug_beat() declaration udbg_init_debug_beat() has been removed since commit bf4981a00636 ("powerpc: Remove the celleb support"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-5-cuigaosheng1@huawei.com commit 29e1eb9169a9c73985ed15361520900ce1cef1d4 Author: Gaosheng Cui Date: Tue Sep 13 15:50:23 2022 +0800 powerpc: remove unused chrp_event_scan() declaration chrp_event_scan() has been removed since commit 3d541c4b7f6e ("powerpc/chrp: Use the same RTAS daemon as pSeries"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-4-cuigaosheng1@huawei.com commit cf78ddd3a1040a84bf882eecea44626dbad450c4 Author: Gaosheng Cui Date: Tue Sep 13 15:50:22 2022 +0800 powerpc/spufs: remove orphan declarations from spufs.h Remove the following orphan declarations from spufs.h: 1. spufs_coredump_calls has been removed since commit 48cad41f7ee7 ("[POWERPC] spufs: Combine spufs_coredump_calls with spufs_calls"). 2. spufs_coredump_num_notes has been removed since commit 936d5bf1d7dc ("[POWERPC] spufs: Get rid of spufs_coredump_num_notes, it's not needed if we NULL terminate"). Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-3-cuigaosheng1@huawei.com commit edd100634a5eb99cf97868c419bdf44d44355c4f Author: Gaosheng Cui Date: Tue Sep 13 15:50:21 2022 +0800 powerpc/xmon: remove unused ppc_parse_cpu() declaration ppc_parse_cpu() has been removed since commit 5b102782c7f4 ("powerpc/xmon: Enable disassembly files (compilation changes)"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220913075029.682327-2-cuigaosheng1@huawei.com commit d1e2d6b78ffc0317b41e1465b47e325e2765e5e0 Merge: 213cb76ddc8b8 917bda9ab1550 Author: Dave Airlie Date: Thu Sep 15 22:38:12 2022 +1000 Merge tag 'drm-intel-next-2022-08-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull for v6.1: Features and functionality: - Early Meteorlake (MTL) enabling (José, Radhakrishna, Clint, Imre, Vandita, Ville, Jani) - Support more HDMI pixel clock frequencies on DG2 (Clint) - Sanity check PCI BARs (Piotr Piórkowski) - Enable DC5 on DG2 (Anusha) - DG2 DMC firmware version bump to v2.07 (Madhumitha) - New ADL-S PCI ID (José) Refactoring and cleanups: - Add display sub-struct to struct drm_i915_private (Jani) - Add initial runtime info to device info (Jani) - Split out HDCP and backlight registers to separate files (Jani) Fixes: - Skip wm/ddb readout for disabled pipes (Ville) - HDMI port timing quirk for GLK ECS Liva Q2 (Diego Santa Cruz) - Fix bw init null pointer dereference (Łukasz Bartosik) - Disable PPS power hook for DP AUX backlight (Jouni) - Avoid warnings on registering multiple backlight devices (Arun) - Fix dual-link DSI backlight and CABC ports for display 11+ (Jani) - Fix Type-C PHY ownership programming in HDMI legacy mode (Imre) - Fix unclaimed register access while loading PIPEDMC-C/D (Imre) - Bump up CDCLK for DG2 (Stan) - Prune modes that require HDMI 2.1 FRL (Ankit) - Disable FBC when PSR1 is enabled in display 12-13 (Matt) - Fix TGL+ HDMI transcoder clock and DDI BUF disable order (Imre) - Disable PSR before disable pipe (José) - Disable DMC handlers during firmware loading/disabling on display 12+ (Imre) - Disable clock gating for PIPEDMC-A/B as a workaround (Imre) Merges: - Two drm-next backmerges (Rodrigo, Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87k06rfaku.fsf@intel.com commit 74f7f183d81c26a53c2b1708364069d391b1b4d6 Author: Petlozu Pravareshwar Date: Tue Sep 6 13:51:17 2022 +0000 soc/tegra: pmc: Check device node status property In early_initcall, check if PMC device is available for use and avoid accessing PMC resources if the device node status property is set to disabled. Signed-off-by: Manish Bhardwaj Signed-off-by: Petlozu Pravareshwar Signed-off-by: Thierry Reding commit cc99f95d49b3ee4617bb4154e32ae7ac14755fe2 Author: Mikko Perttunen Date: Wed Sep 7 11:38:43 2022 +0300 dt-bindings: Add Host1x context stream IDs on Tegra234 Add defines for stream IDs used for Host1x context isolation on Tegra234. The same stream IDs are used for both NISO0 and NISO1 SMMUs since Host1x's stream ID protection tables don't make a distinction between the two. Signed-off-by: Mikko Perttunen Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 0ddf10a319f14ed626dab3a2d390e5059e20cea5 Author: Krishna Yarlagadda Date: Tue Sep 13 09:40:12 2022 +0530 arm64: tegra: Enable Tegra SPI & QSPI in deconfig Jetson AGX board has flash device on QSPI controller and SPI instance on 40-pin expander. Enable Tegra SPI & QSPI drivers in defconfig as modules. Signed-off-by: Krishna Yarlagadda Signed-off-by: Thierry Reding commit cb74c8f8dbb10c0c8dc42c8693e238fd0ab98517 Author: Deren Wu Date: Thu Sep 15 16:36:04 2022 +0800 wifi: mt76: mt7921s: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. The new macros allow suspend and resume functions to be automatically dropped without any #ifdef guards. Tested-by: YN Chen Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit fb47c1547b358d199fde1ff2ebc0a3d786f10808 Author: Deren Wu Date: Thu Sep 15 16:35:52 2022 +0800 wifi: mt76: mt7663s: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. The new macros allow suspend and resume functions to be automatically dropped without any #ifdef guards. Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 29e247ece5d3edfa71495768a9ab5fc7bba76bd4 Author: Deren Wu Date: Mon Sep 12 16:45:52 2022 +0800 wifi: mt76: mt7921e: fix random fw download fail In case of PCIe interoperability problem shows up, the firmware payload may be corrupted in download stage. Turn off L0s to keep fw download process accurately. [ 1093.528363] mt7921e 0000:3b:00.0: Message 00000007 (seq 7) timeout [ 1093.528414] mt7921e 0000:3b:00.0: Failed to start patch [ 1096.600156] mt7921e 0000:3b:00.0: Message 00000010 (seq 8) timeout [ 1096.600207] mt7921e 0000:3b:00.0: Failed to release patch semaphore [ 1097.699031] mt7921e 0000:3b:00.0: Timeout for driver own [ 1098.758427] mt7921e 0000:3b:00.0: Timeout for driver own [ 1099.834408] mt7921e 0000:3b:00.0: Timeout for driver own [ 1100.915264] mt7921e 0000:3b:00.0: Timeout for driver own [ 1101.990625] mt7921e 0000:3b:00.0: Timeout for driver own [ 1103.077587] mt7921e 0000:3b:00.0: Timeout for driver own [ 1104.173258] mt7921e 0000:3b:00.0: Timeout for driver own [ 1105.248466] mt7921e 0000:3b:00.0: Timeout for driver own [ 1106.336969] mt7921e 0000:3b:00.0: Timeout for driver own [ 1106.397542] mt7921e 0000:3b:00.0: hardware init failed Cc: stable@vger.kernel.org Fixes: bf3747ae2e25 ("mt76: mt7921: enable aspm by default") Signed-off-by: Deren Wu Tested-by: AngeloGioacchino Del Regno Signed-off-by: Felix Fietkau commit 23bdc5d8cadfc941e7782d0cb8afb2d9ae73b125 Author: Ming Yen Hsieh Date: Wed Sep 7 19:19:15 2022 +0800 wifi: mt76: mt7921: introduce Country Location Control support Country Location Control (CLC) is an additional control for country rules in firmware. We introduce this new feature to make sure mt7921 series working properly in all region. The addtional policies would be put into firmware based on differnt regions. mt76 driver should be in charge of submitting per region policy. Reviewed-by: Sean Wang Tested-by: YN Chen Co-developed-by: Deren Wu Signed-off-by: Deren Wu Signed-off-by: Ming Yen Hsieh Signed-off-by: Felix Fietkau commit b5a62d612b7baf6e09884e4de94decb6391d6a9d Author: Deren Wu Date: Tue Sep 6 20:39:43 2022 +0800 wifi: mt76: mt7921e: fix rmmod crash in driver reload test In insmod/rmmod stress test, the following crash dump shows up immediately. The problem is caused by missing mt76_dev in mt7921_pci_remove(). We should make sure the drvdata is ready before probe() finished. [168.862789] ================================================================== [168.862797] BUG: KASAN: user-memory-access in try_to_grab_pending+0x59/0x480 [168.862805] Write of size 8 at addr 0000000000006df0 by task rmmod/5361 [168.862812] CPU: 7 PID: 5361 Comm: rmmod Tainted: G OE 5.19.0-rc6 #1 [168.862816] Hardware name: Intel(R) Client Systems NUC8i7BEH/NUC8BEB, 05/04/2020 [168.862820] Call Trace: [168.862822] [168.862825] dump_stack_lvl+0x49/0x63 [168.862832] print_report.cold+0x493/0x6b7 [168.862845] kasan_report+0xa7/0x120 [168.862857] kasan_check_range+0x163/0x200 [168.862861] __kasan_check_write+0x14/0x20 [168.862866] try_to_grab_pending+0x59/0x480 [168.862870] __cancel_work_timer+0xbb/0x340 [168.862898] cancel_work_sync+0x10/0x20 [168.862902] mt7921_pci_remove+0x61/0x1c0 [mt7921e] [168.862909] pci_device_remove+0xa3/0x1d0 [168.862914] device_remove+0xc4/0x170 [168.862920] device_release_driver_internal+0x163/0x300 [168.862925] driver_detach+0xc7/0x1a0 [168.862930] bus_remove_driver+0xeb/0x2d0 [168.862935] driver_unregister+0x71/0xb0 [168.862939] pci_unregister_driver+0x30/0x230 [168.862944] mt7921_pci_driver_exit+0x10/0x1b [mt7921e] [168.862949] __x64_sys_delete_module+0x2f9/0x4b0 [168.862968] do_syscall_64+0x38/0x90 [168.862973] entry_SYSCALL_64_after_hwframe+0x63/0xcd Test steps: 1. insmode 2. do not ifup 3. rmmod quickly (within 1 second) Fixes: 1c71e03afe4b ("mt76: mt7921: move mt7921_init_hw in a dedicated work") Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 1bf66dc31032ff5292f4d5b76436653f269fcfbd Author: Sean Wang Date: Tue Aug 30 06:57:44 2022 +0800 wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value We should reset mstat->airtime_ac along with clear up the entries in the hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the value msta->airtime_ac - [tx, rx]_last may be a negative and that is not the actual airtime the device took in the last run. Reported-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit d2b5bb6dfab29fe32bedefaade88dcd182c03a00 Author: Howard Hsu Date: Thu Aug 18 10:44:07 2022 +0800 wifi: mt76: mt7915: do not check state before configuring implicit beamform Do not need to check running state before configuring implicit Tx beamform. It is okay to configure implicit Tx beamform in run time. Noted that the existing connected stations will be applied for new configuration only if they reconnected to the interface. Fixes: 6d6dc980e07d ("mt76: mt7915: add implicit Tx beamforming support") Signed-off-by: Howard Hsu Signed-off-by: Felix Fietkau commit 9be57ad73984545d594ed359dac19457bcb9fc27 Author: Lorenzo Bianconi Date: Tue Aug 16 12:32:12 2022 +0200 wifi: mt76: fix uninitialized pointer in mt7921_mac_fill_rx Initialize msta pointer to NULL in mt7921_mac_fill_rx() in order to not dereference a uninitialized pointer. Fixes: 0880d40871d1d ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit c6d3e16ad4362502e804a6ca01e955612f3b8222 Author: Howard Hsu Date: Mon Aug 15 11:29:31 2022 +0800 wifi: mt76: mt7915: fix mcs value in ht mode Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode. Fixes: 70fd1333cd32 ("mt76: mt7915: rework .set_bitrate_mask() to support more options") Signed-off-by: Howard Hsu Signed-off-by: Felix Fietkau commit c18f3524422dd28d2049f9ad3822a70e918a340d Author: Christophe JAILLET Date: Sun Aug 7 22:55:59 2022 +0200 soc/tegra: pmc: Use devm_clk_get_optional() Use devm_clk_get_optional() instead of hand writing it. While at it, use dev_err_probe() to further simplify the code. This is also less verbose if clk_get() returns -EPROBE_DEFER. Signed-off-by: Christophe JAILLET Signed-off-by: Thierry Reding commit b78f67bf59baaf22a90481dabbf3ee29dd96c970 Author: Sean Wang Date: Mon Aug 15 07:37:14 2022 +0800 wifi: mt76: mt7921: get rid of the false positive reset False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset. Signed-off-by: Sean Wang Acked-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5473bdb40c5398e7917ec2bb27d8467acf8d9331 Author: Ruffalo Lavoisier Date: Thu Aug 11 07:04:44 2022 +0900 wifi: mt76: connac: fix in comment Correct spelling on 'transmitted' in comment Signed-off-by: Ruffalo Lavoisier Signed-off-by: Felix Fietkau commit 43eaa3689507a9545a6a8b3af1459fa386780a31 Author: Ryder Lee Date: Thu Aug 11 00:40:44 2022 +0800 wifi: mt76: add PPDU based TxS support for WED device Given that there's no data coming from network stack for binding flows, hence driver counts and reports station's statistics directly through NL80211_STA_INFO_* based on active PPDU based TxS for offloading data. Apart from that, WA firmware and its offloading engine (SDO) have hardcoded "2" as PID, so we introduce MT_PACKET_ID_WED to differentiate WED reporting. Note that PPDU format TxS is mutually exclusive with MT_TXD5_TX_STATUS_HOST. Co-developed-by: Yi-Chia Hsieh Signed-off-by: Yi-Chia Hsieh Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit dc877523e6c45073f306aa91fb52e84b365a276b Author: Ryder Lee Date: Thu Aug 11 00:40:43 2022 +0800 wifi: mt76: move move mt76_sta_stats to mt76_wcid This is a preliminary patch for WED's TxS support. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 00be84d6dfc8319ed1864d3ca8658569d36a1882 Author: Sean Wang Date: Mon Aug 1 06:45:51 2022 +0800 wifi: mt76: mt7921: fix the firmware version report Fix the regression of the firmware version report since 'b9ec27102ac0 ('mt76: connac: move mt76_connac2_load_ram in connac module')'. Fixes: b9ec27102ac0 ("mt76: connac: move mt76_connac2_load_ram in connac module") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 59c20b91786d5f140ee7be2f24c242b5f8986046 Author: Sean Wang Date: Fri Jul 29 22:44:57 2022 +0800 wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 24299fc869f7 ("mt76: mt7921: enable rx header traslation offload") Tested-by: AngeloGioacchino Del Regno Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 52b44015f031f629f1ce1d73415a2017593c7ade Author: Sean Wang Date: Fri Jul 29 22:44:56 2022 +0800 wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_ap Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 9d958b60ebc2 ("mt76: mt7921: fix command timeout in AP stop period") Tested-by: AngeloGioacchino Del Regno Signed-off-by: Sean Wang Acked-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 028a47cf60d5ba1a9184a1eeeb9992aec86dfc4d Author: Gergo Koteles Date: Fri Jul 29 10:45:09 2022 +0200 wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related code Simplify mt76x02u_multiple_mcu_reads routine since burst is always false. Signed-off-by: Gergo Koteles Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit deb0f90d9dc6a73c8eae1882550c1bb40d55976a Author: Lorenzo Bianconi Date: Thu Jul 28 17:54:13 2022 +0200 wifi: mt76: mt7663s: add rx_check callback Introduce rx_check callback support for mt7663s driver. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 0a4860f627f1f2b2b777f54f993de1638a79da9f Author: Lorenzo Bianconi Date: Mon Jul 25 16:12:06 2022 +0200 wifi: mt76: connac: fix possible unaligned access in mt76_connac_mcu_add_nested_tlv Fix possible unaligned pointer in mt76_connac_mcu_add_nested_tlv routine. Reported-by: kernel test robot Fixes: 25702d9c55dc5 ("mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 3d9aa54355d863e5412a7e08180f50a8f1827b7f Author: Lorenzo Bianconi Date: Mon Jul 25 11:50:03 2022 +0200 wifi: mt76: mt7915: fix possible unaligned access in mt7915_mac_add_twt_setup Fix possible unaligned pointer in mt7915_mac_add_twt_setup routine. Reported-by: kernel test robot Fixes: 3782b69d03e71 ("mt76: mt7915: introduce mt7915_mac_add_twt_setup routine") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 765c69d477a44c088e5d19e7758dfa4db418e3ba Author: Lorenzo Bianconi Date: Mon Jul 25 10:26:40 2022 +0200 wifi: mt76: mt7615: add mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload Similar to mt7921 driver, introduce mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload in order to avoid sending mcu commands while the device is in low-power state. Fixes: d4b98c63d7a77 ("mt76: mt7615: add support for rx decapsulation offload") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 250b1827205846ff346a76044955cb79d4963f70 Author: YN Chen Date: Sat Jul 23 05:59:23 2022 +0800 wifi: mt76: sdio: fix transmitting packet hangs Fix transmitting packets hangs with continuing to pull the pending packet from mac80211 queues when receiving Tx status notification from the device. Fixes: aac5104bf631 ("mt76: sdio: do not run mt76_txq_schedule directly") Acked-by: Sean Wang Signed-off-by: YN Chen Signed-off-by: Felix Fietkau commit 35e37a2b5b6e1a7b9a7bae4253e707107de12072 Author: Lorenzo Bianconi Date: Fri Jul 22 09:32:36 2022 +0200 wifi: mt76: sdio: add rx_check callback for sdio devices Introduce rx_check callback support for mt7921s driver. Tested-by: Sean Wang Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit dc218cd6e945ed4e4fb547c6b776c3044b70050e Author: Dan Carpenter Date: Fri Jul 22 09:38:40 2022 +0300 wifi: mt76: mt7921: delete stray if statement This if statement is never true. It was supposed to have been deleted as part of commit 454b768f9ba6 ("mt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr()") but was missed. Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau commit e7de4b4979bd8d313ec837931dde936653ca82ea Author: Dan Carpenter Date: Fri Jul 22 09:37:07 2022 +0300 wifi: mt76: mt7921: fix use after free in mt7921_acpi_read() Don't dereference "sar_root" after it has been freed. Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support") Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau commit b5ee771c84082b4e54cc39d9d9a2dd239e4f6b86 Author: Dan Carpenter Date: Fri Jul 22 09:34:55 2022 +0300 wifi: mt76: mt7915: fix an uninitialized variable bug Smatch complains that: drivers/net/wireless/mediatek/mt76/mt7915/mac.c:428 mt7915_mac_fill_rx() error: uninitialized symbol 'msta'. It looks like this was supposed to be initialized to NULL. Fixes: 0880d40871d1 ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau commit a323e5f041dd11af5e3de19ed7ea95a97d588c11 Author: Sean Wang Date: Fri Jul 22 06:39:36 2022 +0800 wifi: mt76: sdio: poll sta stat when device transmits data It is not meaningful to poll sta stat when there is no data traffic. So polling sta stat when the device has transmitted data instead to save CPU power. That implies that it is unallowed the stat_work to work while MCU is being initialized in the really early stage to fix the possible time to time MCU initialization failure. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit e5d78fd998be94fb459a3d625df7367849b997b8 Author: Sean Wang Date: Fri Jul 22 06:39:35 2022 +0800 wifi: mt76: sdio: fix the deadlock caused by sdio->stat_work Because wake_work and sdio->stat_work share the same workqueue mt76->wq, if sdio->stat_work cannot acquire the mutex lock such as that was possibly held up by [mt7615, mt7921]_mutex_acquire. Additionally, if [mt7615, mt7921]_mutex_acquire was called by sdio->stat_work self, the wake would be blocked by itself. Thus, we move the stat_work into ieee80211_workqueue instead to break the deadlock. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 0af1ad955919a7a289a15e844d980bcaeda7d7a6 Author: Lorenzo Bianconi Date: Thu Jul 21 12:26:07 2022 +0200 wifi: mt76: mt7921: move mt7921_rx_check and mt7921_queue_rx_skb in mac.c Since both mt7921_rx_check and mt7921_queue_rx_skb routines are used by all chipsets (mmio, usb and sdio), move them in mac.c and remove duplicated code. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 51fd13b78e868fcec4ea0edf6422793a6334e3e3 Author: Sean Wang Date: Thu Jul 21 06:25:40 2022 +0800 wifi: mt76: mt7921u: remove unnecessary MT76_STATE_SUSPEND remove unnecessary MT76_STATE_SUSPEND manipulation to be consistent with the mt7921[e, s] driver. Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 86f15d043ba7f13211d5c3e41961c3381fb12880 Author: Sean Wang Date: Thu Jul 21 06:25:39 2022 +0800 wifi: mt76: mt7921u: fix race issue between reset and suspend/resume It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: df3e4143ba8a ("mt76: mt7921u: add suspend/resume support") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit e86f10e6809add9132ecc2c6b3184ed59db7ca71 Author: Sean Wang Date: Thu Jul 21 06:25:38 2022 +0800 wifi: mt76: mt7921s: fix race issue between reset and suspend/resume It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: ca74b9b907f9 ("mt76: mt7921s: add reset support") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit ff6c4a6449793e9718ef2e9ad46864b63022648e Author: Sean Wang Date: Thu Jul 21 06:25:37 2022 +0800 wifi: mt76: mt7921e: fix race issue between reset and suspend/resume It is unexpected that the reset work is running simultaneously with the suspend or resume context and it is possible that reset work is still running even after mt7921 is suspended if we don't fix the race issue. Thus, the suspend procedure should be waiting until the reset is completed at the beginning and ignore the subsequent the reset requests. In case there is an error that happens during either suspend or resume handler, we will schedule a reset task to recover the error before returning the error code to ensure we can immediately fix the error there. Fixes: 0c1ce9884607 ("mt76: mt7921: add wifi reset support") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 12d7440e3bf94c87c7cf518c11577a532a9be350 Author: Lorenzo Bianconi Date: Wed Jul 20 18:56:37 2022 +0200 wifi: mt76: add rx_check callback for usb devices Introduce rx_check callback support for mt7663u and mt7921u drivers. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 60c45a78c35dec6eedd48a6bd43c4e4271501b33 Author: Shayne Chen Date: Mon Jul 11 22:19:10 2022 +0800 wifi: mt76: testmode: use random payload for tx packets Compared to fixed payload packets, random payload packets have better measured EVM under the same txpower. Our tests show EVM becomes at least 2-3 dB better in test cases with high rate and long tx length, which also aligns the testing results to proprietary driver. Suggested-by: Jm Chen Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit e351f4f0465484115a64eebab238445b4a21b219 Author: Lorenzo Bianconi Date: Fri Jun 24 23:14:33 2022 +0200 wifi: mt76: connac: introduce mt76_connac_reg_map structure Introduce mt76_connac_reg_map structure in mt76-connac module since it is used by all connac2 chipset. Align structure definitions. This is a preliminary patch to add mt7990 chipset support. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 2254182807fc09ba9dec9a42ef239e373796f1b2 Author: Dmitry Osipenko Date: Wed Sep 23 03:34:21 2020 +0300 soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA The DMA subsystem could be entirely disabled in Kconfig and then the TEGRA20_APB_DMA option isn't available too. Hence kernel configuration fails if DMADEVICES Kconfig option is disabled due to the unsatisfiable dependency. The FUSE driver isn't a critical driver and currently it only provides NVMEM interface to userspace which isn't known to be widely used, and thus, it's fine if FUSE driver fails to load. Let's remove the erroneous Kconfig dependency and let the FUSE driver to fail the probing if DMA is unavailable. Fixes: 19d41e5e9c68 ("soc/tegra: fuse: Add APB DMA dependency for Tegra20") Reported-by: Necip Fazil Yildiran Link: https://bugzilla.kernel.org/show_bug.cgi?id=209301 Signed-off-by: Dmitry Osipenko commit fa586abcfe4b43e170d72586b6f11bcc48f6766c Author: Qing Wang Date: Mon Oct 18 04:31:52 2021 -0700 firmware: tegra: Switch over to memdup_user() This patch fixes the following Coccinelle warning: drivers/firmware/tegra/bpmp-debugfs.c:379: WARNING opportunity for memdup_user Use memdup_user() rather than duplicating its implementation. This is a little bit restricted to reduce false positives. Signed-off-by: Qing Wang Signed-off-by: Thierry Reding commit 8a26a9dee5e3679637edc6f8caf4beb5f3100dde Merge: 9724343e4907e ce6ce91769754 Author: Paolo Abeni Date: Thu Sep 15 12:41:42 2022 +0200 Merge branch 'net-ftgmac100-support-fixed-link' Tao Ren says: ==================== net: ftgmac100: support fixed link The patch series adds fixed link support to ftgmac100 driver. Patch #1 adds fixed link logic into ftgmac100 driver. Patch #2 enables mac3 controller in Elbert dts: Elbert mac3 is connected to the onboard switch BCM53134P's IMP_RGMII port directly (no PHY between BMC MAC and BCM53134P). ==================== Link: https://lore.kernel.org/r/20220907054453.20016-1-rentao.bupt@gmail.com Signed-off-by: Paolo Abeni commit ce6ce91769754593b871a98b4c61bc65833e7563 Author: Tao Ren Date: Tue Sep 6 22:44:53 2022 -0700 ARM: dts: aspeed: elbert: Enable mac3 controller Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the BCM53134P onboard switch's IMP_RGMII port directly (fixed link, no PHY between BMC MAC and BCM53134P). Note: BMC's mdio0 controller is connected to BCM53134P's MDIO interface, and the MDIO channel will be enabled later, when BCM53134 is added to "bcm53xx" DSA driver. Signed-off-by: Tao Ren Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 38561ded50d0c21b829f262c13c4b91529348e27 Author: Tao Ren Date: Tue Sep 6 22:44:52 2022 -0700 net: ftgmac100: support fixed link Support fixed link in ftgmac100 driver. Fixed link is used on several Meta OpenBMC platforms, such as Elbert (AST2620) and Wedge400 (AST2520). Signed-off-by: Tao Ren Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 53283105cab6f408968b7546826303ad329e9983 Author: Sumit Gupta Date: Thu May 12 01:46:51 2022 +0530 soc/tegra: cbb: Add support for Tegra241 (Grace) Adding support for Tegra241 (Grace) which uses fabrics based on the CBB 2.0 architecture. Since Tegra241 requires ACPI, implement ACPI-based probe support. Fabrics reporting errors in Tegra241 are "CBB" and "BPMP". The CBB fabric connects various other CBB 2.0 based fabrics and also services the Initiators and Targets which are connected to itself. The BPMP fabric is present in the BPMP cluster. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit fc2f151d23145f68a6748c4684a81b70823a489d Author: Sumit Gupta Date: Thu May 12 01:46:50 2022 +0530 soc/tegra: cbb: Add driver for Tegra234 CBB 2.0 Adding driver to handle errors from CBB version 2.0 which is used in Tegra234 SoC. The driver prints debug information about failed transaction on receiving interrupt from the error notifier. The error notifier collates the interrupts from various error monitor blocks and presents a single interrupt to the SoC interrupt controller. For timeout errors, the driver also does the lookup to find timed out clients and prints their client ID. Drivers for hardware that needs to be reset on timeout will have to call BPMP from the client IP's driver. BPMP firmware will also clear the timeout bit after resetting the IP so that next transactions are send to them after reset. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit b7134422146692e096e807751656fc58ee1a717d Author: Sumit Gupta Date: Thu May 12 01:46:47 2022 +0530 soc/tegra: cbb: Add CBB 1.0 driver for Tegra194 Adding driver to handle errors from Control Backbone (CBB) which are generated due to illegal accesses. CBB 1.0 is used in Tegra194 SoCs. When an error is reported from a NOC within CBB, the driver prints debug information about failed transaction like Error Code, Error Description, Master, Address, AXI ID, Cache, Protection, Security Group etc. It then causes system crash using BUG_ON() or call WARN() based on whether the error type is fatal or not. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit a28dc5f17da52e4bff08c9deac29f97dd4d3819a Author: Thierry Reding Date: Mon Jul 11 17:40:31 2022 +0200 soc/tegra: pmc: Add USB port wake events for Tegra194 Tegra194 supports waking up from suspend when activity is detected on any of the USB ports. Add these wake events so that the system can be woken on such activity. Signed-off-by: Thierry Reding commit 72ccc1f564918c1087a8e37e82422f79d3255a7b Author: Thierry Reding Date: Mon Jul 11 17:40:30 2022 +0200 soc/tegra: pmc: Add support for simple wake events Simple wake events are neither mapped to GIC interrupts nor have an associated GPIO line. They are close to GPIO-backed wake events in that the IRQ hierarchy processing needs to stop at the PMC level, but since there is no dedicated GPIO line for them, let's turn them into a separate type. Signed-off-by: Thierry Reding commit 1623566fc43ecfcbcb5f39aee294262b9b187c9a Author: Thierry Reding Date: Mon Jul 11 17:40:29 2022 +0200 soc/tegra: pmc: Remove leading space Remove a leading space from a line that is otherwise indented by tabs. Signed-off-by: Thierry Reding commit 0a3c2dbec425b82d9af7aeb5dc9b18da398992a7 Author: Liang He Date: Wed Jun 15 20:32:32 2022 +0800 soc/tegra: fuse: Add missing of_node_put() In tegra_init_apbmisc(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() in each failure path or when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thierry Reding commit e941712cccab8a96f03b5d3274159c1ed338efee Author: Liang He Date: Thu Jun 16 09:46:36 2022 +0800 soc/tegra: fuse: Add missing of_node_put() in tegra_init_fuse() In this function, of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when the "np" pointer is not used anymore. Signed-off-by: Liang He Signed-off-by: Thierry Reding commit 96765cc47546fe6724825600afa8ba170671da61 Author: Sumit Gupta Date: Thu May 12 01:46:43 2022 +0530 soc/tegra: Set ERD bit to mask inband errors Add a function to set the ERD (Error Response Disable) bit in the MISCREG_CCROC_ERR_CONFIG register from the Control Backbone (CBB) error handler driver. ERD bit allows masking of SError due to inband errors which are caused by illegal register accesses through CBB. When the bit is set, interrupt is used for reporting errors and magic code '0xdead2003' is returned. This change is only required for Tegra194 SoC as the config is moved to CBB register space for future SoC's. Also, remove unmapping the apbmisc_base as it's required to get the base address for accessing the misc register. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit 9724343e4907ea1c0280b90ee2f4939f5f1de01e Merge: 006534ec28049 3eb9a6b6503cd Author: Paolo Abeni Date: Thu Sep 15 12:01:04 2022 +0200 Merge branch 'mptcp-allow-privileged-operations-from-user-ns-cleanup' Matthieu Baerts says: ==================== mptcp: allow privileged operations from user ns & cleanup This series allows privileged Netlink operations from user namespaces. When a non-root user configures MPTCP endpoints, the memory allocation is now accounted to this user. See patches 4 and 5. Apart from that, there are some cleanup: - Patch 1 adds a macro to improve code readability - Patch 2 regroups similar checks all together - Patch 3 uses an explicit boolean instead of a counter to do one more check ==================== Link: https://lore.kernel.org/r/20220906205545.1623193-1-matthieu.baerts@tessares.net Signed-off-by: Paolo Abeni commit 3eb9a6b6503cdf228314fd6185df337d1ce11bc0 Author: Thomas Haller Date: Tue Sep 6 22:55:43 2022 +0200 mptcp: account memory allocation in mptcp_nl_cmd_add_addr() to user Now that non-root users can configure MPTCP endpoints, account the memory allocation to the user. Signed-off-by: Thomas Haller Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni commit d156971854045120e1eab74b9e9ec2ac516ba91f Author: Thomas Haller Date: Tue Sep 6 22:55:42 2022 +0200 mptcp: allow privileged operations from user namespaces GENL_ADMIN_PERM checks that the user has CAP_NET_ADMIN in the initial namespace by calling netlink_capable(). Instead, use GENL_UNS_ADMIN_PERM which uses netlink_ns_capable(). This checks that the caller has CAP_NET_ADMIN in the current user namespace. See also commit 4a92602aa1cd ("openvswitch: allow management from inside user namespaces") which introduced this mechanism. See also commit 5617c6cd6f84 ("nl80211: Allow privileged operations from user namespaces") which introduced this for nl80211. Signed-off-by: Thomas Haller Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni commit 0522b424c4c2a1f7d79d62b7723c07d3415d94e5 Author: Geliang Tang Date: Tue Sep 6 22:55:41 2022 +0200 mptcp: add do_check_data_fin to replace copied This patch adds a new bool variable 'do_check_data_fin' to replace the original int variable 'copied' in __mptcp_push_pending(), check it to determine whether to call __mptcp_check_send_data_fin(). Suggested-by: Mat Martineau Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni commit a1c3bdd9c5dfcba3b4550a28890724f519434e15 Author: Geliang Tang Date: Tue Sep 6 22:55:40 2022 +0200 selftests: mptcp: move prefix tests of addr_nr_ns2 together Move the fullmesh prefix test of addr_nr_ns2 together with its other prefix tests. Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni commit 5efbf6f7f076c67d733a09410180cc63a7f4d7bf Author: Matthieu Baerts Date: Tue Sep 6 22:55:39 2022 +0200 mptcp: add mptcp_for_each_subflow_safe helper Similar to mptcp_for_each_subflow(): this is clearer now that the _safe version is used in multiple places. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni commit 47e34cb74d376ddfeaef94abb1d6dfb3c905ee51 Author: Dave Marchevsky Date: Mon Sep 12 08:45:44 2022 -0700 bpf: Add verifier check for BPF_PTR_POISON retval and arg BPF_PTR_POISON was added in commit c0a5a21c25f37 ("bpf: Allow storing referenced kptr in map") to denote a bpf_func_proto btf_id which the verifier will replace with a dynamically-determined btf_id at verification time. This patch adds verifier 'poison' functionality to BPF_PTR_POISON in order to prepare for expanded use of the value to poison ret- and arg-btf_id in ongoing work, namely rbtree and linked list patchsets [0, 1]. Specifically, when the verifier checks helper calls, it assumes that BPF_PTR_POISON'ed ret type will be replaced with a valid type before - or in lieu of - the default ret_btf_id logic. Similarly for arg btf_id. If poisoned btf_id reaches default handling block for either, consider this a verifier internal error and fail verification. Otherwise a helper w/ poisoned btf_id but no verifier logic replacing the type will cause a crash as the invalid pointer is dereferenced. Also move BPF_PTR_POISON to existing include/linux/posion.h header and remove unnecessary shift. [0]: lore.kernel.org/bpf/20220830172759.4069786-1-davemarchevsky@fb.com [1]: lore.kernel.org/bpf/20220904204145.3089-1-memxor@gmail.com Signed-off-by: Dave Marchevsky Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220912154544.1398199-1-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit 006534ec280495f6679701ae118713d923a98c55 Author: Dmitry Torokhov Date: Tue Sep 6 13:49:22 2022 -0700 net: phy: spi_ks8895: switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220906204922.3789922-3-dmitry.torokhov@gmail.com Signed-off-by: Paolo Abeni commit 7b77bb5c8130625dd4dac70e1968269a010adf6d Author: Dmitry Torokhov Date: Tue Sep 6 13:49:21 2022 -0700 net: ks8851: switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220906204922.3789922-2-dmitry.torokhov@gmail.com Signed-off-by: Paolo Abeni commit db49ca38579d44db7c246c5b74824b6406319b40 Author: Dmitry Torokhov Date: Tue Sep 6 13:49:20 2022 -0700 net: davicom: dm9000: switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220906204922.3789922-1-dmitry.torokhov@gmail.com Signed-off-by: Paolo Abeni commit 12e51866c79fe37faed276442f4b0dfd9f2dc174 Merge: a6b0be65123e1 b2d7616e13c4e Author: Mark Brown Date: Thu Sep 15 10:29:01 2022 +0100 ASoC/qcom/arm64: Qualcomm ADSP DTS and binding fixes Merge series from Krzysztof Kozlowski : Hi, Dependencies/merging ==================== 1. The DTS patches are independent. 2. The binding patches should come together, because of context changes. Could be one of: Qualcomm SoC, ASoC or DT tree. Changes since v3 ================ 1. Patch 9-10: re-order, so first apr.yaml is corrected and then we convert to DT schema. This makes patchset fully bisectable in expense of changing the same lines twice. 2. Patch 11: New patch. Changes since v2 ================ 1. Patch 9: rename and extend commit msg. 2. Add Rb tags. Changes since v1 ================ 1. Patch 9: New patch. 2. Patch 10: Correct also sound/qcom,q6apm-dai.yaml (Rob). 2. Patch 13: New patch. 3. Add Rb/Tb tags. Best regards, Krzysztof Krzysztof Kozlowski (15): arm64: dts: qcom: sdm630: align APR services node names with dtschema arm64: dts: qcom: sdm845: align APR services node names with dtschema arm64: dts: qcom: sm8250: align APR services node names with dtschema arm64: dts: qcom: msm8996: fix APR services nodes arm64: dts: qcom: sdm845: align dai node names with dtschema arm64: dts: qcom: msm8996: align dai node names with dtschema arm64: dts: qcom: qrb5165-rb5: align dai node names with dtschema arm64: dts: qcom: sm8250: use generic name for LPASS clock controller dt-bindings: soc: qcom: apr: correct service children ASoC: dt-bindings: qcom,q6asm: convert to dtschema ASoC: dt-bindings: qcom,q6adm: convert to dtschema ASoC: dt-bindings: qcom,q6dsp-lpass-ports: cleanup example ASoC: dt-bindings: qcom,q6dsp-lpass-clocks: cleanup example ASoC: dt-bindings: qcom,q6apm-dai: adjust indentation in example dt-bindings: soc: qcom: apr: add missing properties .../bindings/soc/qcom/qcom,apr.yaml | 112 ++++++++++++++++-- .../bindings/sound/qcom,q6adm-routing.yaml | 52 ++++++++ .../devicetree/bindings/sound/qcom,q6adm.txt | 39 ------ .../bindings/sound/qcom,q6apm-dai.yaml | 21 ++-- .../bindings/sound/qcom,q6asm-dais.yaml | 112 ++++++++++++++++++ .../devicetree/bindings/sound/qcom,q6asm.txt | 70 ----------- .../sound/qcom,q6dsp-lpass-clocks.yaml | 36 +++--- .../sound/qcom,q6dsp-lpass-ports.yaml | 64 +++++----- arch/arm64/boot/dts/qcom/msm8996.dtsi | 10 +- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 4 +- arch/arm64/boot/dts/qcom/sdm630.dtsi | 8 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- .../boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 2 +- .../boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 10 +- 16 files changed, 346 insertions(+), 208 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6adm-routing.yaml delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6adm.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm-dais.yaml delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt -- 2.34.1 commit 39efc9c8a973ddff5918191525d1679d0fb368ea Author: Takashi Iwai Date: Thu Sep 15 10:59:47 2022 +0200 ALSA: usb-audio: Fix last interface check for registration The recent fix in commit 6392dcd1d0c7 ("ALSA: usb-audio: Register card at the last interface") tried to delay the card registration until the last found interface is probed. It assumed that the probe callback gets called for those later interfaces, but it's not always true; as the driver loops over the descriptor and probes the matching ones, it's not separately called via multiple probe calls. This results in the missing card registration, i.e. no sound device. For addressing this problem, replace the check whether the last interface is processed with usb_interface_claimed() instead of the comparison with the probe interface number. Fixes: 6392dcd1d0c7 ("ALSA: usb-audio: Register card at the last interface") Link: https://lore.kernel.org/r/20220915085947.7922-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit d9e7f0e320516c660d6f33e6c16a3d99970eb14e Author: Dmitry Torokhov Date: Wed Sep 7 22:39:49 2022 -0700 gpiolib: of: factor out conversion from OF flags There are several places where we need to convert from OF flags to "normal" GPIO_* flags, so let's introduce a helper and use it. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit a2b5e207cade33b4d2dfd920f783f13b1f173e78 Author: Dmitry Torokhov Date: Wed Sep 7 22:39:48 2022 -0700 gpiolib: rework quirk handling in of_find_gpio() Instead of having a string of "if" statements let's put all quirks into an array and iterate over them. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 984914ec4f4bfa9ee8f067b06293bc12bef20137 Author: Dmitry Torokhov Date: Wed Sep 7 22:39:47 2022 -0700 gpiolib: of: make Freescale SPI quirk similar to all others There is no need for of_find_spi_cs_gpio() to be different from other quirks: the only variant of property actually used in DTS is "gpios" (plural) so we can use of_get_named_gpiod_flags() instead of recursing into of_find_gpio() again. This will allow us consolidate quirk handling down the road. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 98c3c940ea5c3957056717e8b77a91c7d94536ad Author: Dmitry Torokhov Date: Wed Sep 7 22:39:46 2022 -0700 gpiolib: of: do not ignore requested index when applying quirks We should not ignore index passed into of_find_gpio() when handling quirks. While in practice this change will not have any effect, it will allow consolidate quirk handling. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit c95671a3e77ca6f1ed42e891d1fef2ef166a7fdc Author: William Breathitt Gray Date: Thu Aug 18 12:28:15 2022 -0400 gpio: ws16c48: Ensure number of irq matches number of base The ws16c48 module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit c6074f3fcf8b67acf8e3bdf678ace1f9c18dfb9e Author: William Breathitt Gray Date: Thu Aug 18 12:28:14 2022 -0400 gpio: 104-idio-16: Ensure number of irq matches number of base The 104-idio-16 module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit 99c3ac85cb7e7b9251f2fcff725fa2c4f4e33a67 Author: William Breathitt Gray Date: Thu Aug 18 12:28:13 2022 -0400 gpio: 104-idi-48: Ensure number of irq matches number of base The 104-idi-48 module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit 443ad0f730172f05fd78c9e9e68c3dfa5555b061 Author: William Breathitt Gray Date: Thu Aug 18 12:28:12 2022 -0400 gpio: 104-dio-48e: Ensure number of irq matches number of base The 104-dio-48e module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit 0c83a280dc11238f69d9fe2e15186a4aeb1adfe3 Author: William Breathitt Gray Date: Thu Aug 18 12:28:11 2022 -0400 counter: 104-quad-8: Ensure number of irq matches number of base The 104-quad-8 module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray Acked-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit 85ebe0afd3f8377a9b506321314f4b8344caa8ec Author: William Breathitt Gray Date: Thu Aug 18 12:28:10 2022 -0400 isa: Introduce the module_isa_driver_with_irq helper macro Several ISA drivers feature IRQ support that can configured via an "irq" array module parameter. This array typically matches directly with the respective "base" array module parameter. To reduce code repetition, a module_isa_driver_with_irq helper macro is introduced to provide a check ensuring that the number of "irq" passed to the module matches with the respective number of "base". Signed-off-by: William Breathitt Gray Acked-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski commit 13c5d4ce806026a3d06efa2fcc1e5a0cb875df29 Author: Martyn Welch Date: Wed Sep 14 16:15:57 2022 +0100 gpio: pca953x: Add support for PCAL6534 Add support for the NXP PCAL6534. This device is broadly a 34-bit version of the PCAL6524. However, whilst the registers are broadly what you'd expect for a 34-bit version of the PCAL6524, the spacing of the registers has been compacted. This has the unfortunate effect of breaking the bit shift based mechanism that is employed to work out register locations used by the other chips supported by this driver. To accommodate ths, callback functions have been added to allow alterate implementations of pca953x_recalc_addr() and pca953x_check_register() for the PCAL6534. Datasheet: https://www.nxp.com/docs/en/data-sheet/PCAL6534.pdf Datasheet: https://www.diodes.com/assets/Datasheets/PI4IOE5V6534Q.pdf Signed-off-by: Martyn Welch Signed-off-by: Bartosz Golaszewski commit 5faf9801d4be7a079062b2ece493ae6e9e38c828 Author: Martyn Welch Date: Wed Sep 14 16:15:56 2022 +0100 gpio: pca953x: Swap if statements to save later complexity A later patch in the series adds support for a further chip type that shares some similarity with the PCA953X_TYPE. In order to keep the logic simple, swap over the if and else portions where checks are made against PCA953X_TYPE and instead check for PCA957X_TYPE. Signed-off-by: Martyn Welch Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit b122624ab91705d30354f0397b1eea931c6b1933 Author: Martyn Welch Date: Wed Sep 14 16:15:55 2022 +0100 gpio: pca953x: Fix pca953x_gpio_set_pull_up_down() A previous fix, commit dc87f6dd058a ("gpio: pca953x: Fix pca953x_gpio_set_config"), identified that pinconf_to_config_param() needed to be used to isolate the config_param from the pinconf in pca953x_gpio_set_config(). This fix however did not consider that this would also be needed in pca953x_gpio_set_pull_up_down() to which it passes this config. Perform a similar call in pca953x_gpio_set_pull_up_down() to isolate the configuration parameter there as well, rather than passing it from pca953x_gpio_set_config() as the configuration argument may also be needed in pca953x_gpio_set_pull_up_down() at a later date. Signed-off-by: Martyn Welch Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 9f7fed73072e34b123f8c856ae21a2154c0e9781 Author: Martyn Welch Date: Wed Sep 14 16:15:54 2022 +0100 dt-bindings: gpio: pca95xx: add entry for pcal6534 and PI4IOE5V6534Q The NXP PCAL6534 is a 34-bit I2C I/O expander similar to the PCAL6524. The Diodes PI4IOE5V6534Q is a functionally identical chip provided by Diodes Inc. Signed-off-by: Martyn Welch Reviewed-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 935edf0c145596c26e7c6825918acde27ff94ff6 Author: Sergiu Moga Date: Tue Sep 13 17:22:05 2022 +0300 clk: at91: sama5d2: Add Generic Clocks for UART/USART Add the generic clocks for UART/USART in the sama5d2 driver to allow them to be registered in the Common Clock Framework. Signed-off-by: Sergiu Moga Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220913142205.162399-14-sergiu.moga@microchip.com commit ce0cb8fb967ec62ff000826fd469511ee2d3fcb2 Author: Martyn Welch Date: Wed Sep 14 16:15:53 2022 +0100 dt-bindings: vendor-prefixes: add Diodes Diodes Incorporated is a manufacturer of application specific standard products within the discrete, logic, analog, and mixed-signal semiconductor markets. https://www.diodes.com/ Signed-off-by: Martyn Welch Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 21f0b7dabf9c358e75a539b5554c0375bf1abe0a Author: Nathan Huckleberry Date: Tue Sep 13 13:55:27 2022 -0700 drm/i915: Fix return type of mode_valid function hook All of the functions used for intel_dvo_dev_ops.mode_valid have a return type of enum drm_mode_status, but the mode_valid field in the struct definition has a return type of int. The mismatched return type breaks forward edge kCFI since the underlying function definitions do not match the function hook definition. The return type of the mode_valid field should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Reviewed-by: Andrzej Hajda Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220913205531.155046-1-nhuck@google.com commit c337f103f7781bc8223c650e94492bf08df71482 Merge: 1c679f917397f 626332696d750 Author: Marc Kleine-Budde Date: Thu Sep 15 09:13:31 2022 +0200 Merge patch series "can: support CAN XL" Oliver Hartkopp says: The CAN with eXtended data Length (CAN XL) is a new CAN protocol with a 10Mbit/s data transfer with a new physical layer transceiver (for this data section). CAN XL allows up to 2048 byte of payload and shares the arbitration principle (11 bit priority) known from Classical CAN and CAN FD. RTR and 29 bit identifiers are not implemented in CAN XL. A short introduction to CAN XL can be found here: https://www.can-cia.org/can-knowledge/can/can-xl/ https://github.com/linux-can/can-doc/blob/master/presentations/CAN-XL-Intro.pdf V1: https://lore.kernel.org/all/20220711183426.96446-1-socketcan@hartkopp.net V2: Major rework after discussion and feedback on Linux-CAN ML https://lore.kernel.org/all/20220714160541.2071-1-socketcan@hartkopp.net - rework of struct canxl_frame - CANXL_XLF flag is now the switch between CAN XL and CAN/CANFD - variable length in r/w operations for CAN XL frames - write CAN XL frame to raw socket enforces size <-> canxl_frame.len sync V3: Fix length for CAN XL frames inside the sk_buff https://lore.kernel.org/all/20220717132730.30295-1-socketcan@hartkopp.net - extend the CAN_RAW sockopt to handle fixed/truncated read/write operations V4: Fix patch 5 (can: raw: add CAN XL support) https://lore.kernel.org/all/20220719054204.29061-1-socketcan@hartkopp.net - fix return value (move 'err = -EINVAL' in raw_sendmsg()) - add CAN XL frame handling in can_rcv() - change comment for CAN_RAW_XL_[RT]X_DYN definition (allow -> enable) V5: Remove CAN_RAW_XL_[RT]X_DYN definition again https://lore.kernel.org/all/20220719112748.3281-1-socketcan@hartkopp.net - CAN_RAW_XL_[RT]X_DYN (truncated data) feature is now enabled by default - use CANXL_MIN_DLEN instead of '1' in canxl_frame definition - add missing 'err = -EINVAL' initialization in raw_sendmsg()) V6: https://lore.kernel.org/all/20220724074402.117394-1-socketcan@hartkopp.net - rework an separate skb identification and length helpers - add CANFD_FDF flag in all CAN FD frame structures - simplify patches for infrastructure and raw sockets - add vxcan support in virtual CAN interface patch V7: https://lore.kernel.org/all/20220729154107.1875-1-socketcan@hartkopp.net - fixed indention as remarked by Marc - set CANFD_FDF flag when detecting CAN FD frames generated by PF_PACKET - Allow to use variable CAN XL MTU sizes to enforce real time requirements on CAN XL segments (e.g. to support of CAN CiA segmentation concept) V8: https://lore.kernel.org/all/20220801190010.3344-1-socketcan@hartkopp.net - fixed typo as remarked by Vincent - rebased to latest can-next/net-next tree V9: https://lore.kernel.org/all/20220912170725.120748-1-socketcan@hartkopp.net - rebased to latest can-next/net-next tree - updated and extended public available CAN XL documenatation in cover letter - renamed struct canxl_frame variable cfx to cxl as suggested by Vincent - Added Acked-by: Vincent Mailhol tag Link: https://lore.kernel.org/all/20220912170725.120748-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 626332696d7506e8f844a564277bdba2dc78fcb5 Author: Oliver Hartkopp Date: Mon Sep 12 19:07:25 2022 +0200 can: raw: add CAN XL support Enable CAN_RAW sockets to read and write CAN XL frames analogue to the CAN FD extension (new CAN_RAW_XL_FRAMES sockopt). A CAN XL network interface is capable to handle Classical CAN, CAN FD and CAN XL frames. When CAN_RAW_XL_FRAMES is enabled, the CAN_RAW socket checks whether the addressed CAN network interface is capable to handle the provided CAN frame. In opposite to the fixed number of bytes for - CAN frames (CAN_MTU = sizeof(struct can_frame)) - CAN FD frames (CANFD_MTU = sizeof(struct can_frame)) the number of bytes when reading/writing CAN XL frames depends on the number of data bytes. For efficiency reasons the length of the struct canxl_frame is truncated to the needed size for read/write operations. This leads to a calculated size of CANXL_HDR_SIZE + canxl_frame::len which is enforced on write() operations and guaranteed on read() operations. NB: Valid length values are 1 .. 2048 (CANXL_MIN_DLEN .. CANXL_MAX_DLEN). Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-8-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit ebf87fc728502244550eaf8819fc785e2014b2ad Author: Oliver Hartkopp Date: Mon Sep 12 19:07:24 2022 +0200 can: dev: add CAN XL support to virtual CAN Make use of new can_skb_get_data_len() helper. Add support for variable CANXL MTU using the new can_is_canxl_dev_mtu(). Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-7-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit fb08cba12b52cba4366e858932307649dc5304e2 Author: Oliver Hartkopp Date: Mon Sep 12 19:07:23 2022 +0200 can: canxl: update CAN infrastructure for CAN XL frames - add new ETH_P_CANXL ethernet protocol type - update skb checks for CAN XL - add alloc_canxl_skb() which now needs a data length parameter - introduce init_can_skb_reserve() to reduce code duplication Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-6-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 1a3e3034c049503ec6992a4a7d573e7fff31fac4 Author: Oliver Hartkopp Date: Mon Sep 12 19:07:22 2022 +0200 can: canxl: introduce CAN XL data structure This patch adds defines for data structures and length information for CAN XL (CAN with eXtended data Length) which can transfer up to 2048 byte inside a single frame. Notable changes from CAN FD: - the 11 bit arbitration field is now named 'priority' instead of 'can_id' (there are no 29 bit identifiers nor RTR frames anymore) - the data length needs a uint16 value to cover up to 2048 byte (the length element position is different to struct can[fd]_frame) - new fields (SDT, AF) and a SEC bit have been introduced - the virtual CAN interface identifier is not part if the CAN XL frame struct as this VCID value is stored in struct skbuff (analog to vlan id) Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-5-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 061834624c87282c6d9d8c5395aaff4380e5e1fc Author: Oliver Hartkopp Date: Mon Sep 12 19:07:21 2022 +0200 can: set CANFD_FDF flag in all CAN FD frame structures To simplify the testing in user space all struct canfd_frame's provided by the CAN subsystem of the Linux kernel now have the CANFD_FDF flag set in canfd_frame::flags. NB: Handcrafted ETH_P_CANFD frames introduced via PF_PACKET socket might not set this bit correctly. During the check for sufficient headroom in PF_PACKET sk_buffs the uninitialized CAN sk_buff data structures are filled. In the case of a CAN FD frame the CANFD_FDF flag is set accordingly. As the CAN frame content is already zero initialized in alloc_canfd_skb() the obsolete initialization of cf->flags in the CTU CAN FD driver has been removed as it would overwrite the already set CANFD_FDF flag. Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-4-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 467ef4c7b9d1c22ee64342804bf92549d765df14 Author: Oliver Hartkopp Date: Mon Sep 12 19:07:20 2022 +0200 can: skb: add skb CAN frame data length helpers Add two helpers to retrieve the data length from CAN sk_buffs and prepare the length information to be a uint16 value for the CAN XL support. Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-3-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 96a7457a14d9cf98cf58de1e26c03180e0f28141 Author: Oliver Hartkopp Date: Mon Sep 12 19:07:19 2022 +0200 can: skb: unify skb CAN frame identification helpers Replace open coded checks for sk_buffs containing Classical CAN and CAN FD frame structures as a preparation for CAN XL support. With the added length check the unintended processing of CAN XL frames having the CANXL_XLF bit set can be suppressed even when the skb->len fits to non CAN XL frames. The CAN_RAW socket needs a rework to use these helpers. Therefore the use of these helpers is postponed to the CAN_RAW CAN XL integration. The J1939 protocol gets a check for Classical CAN frames too. Acked-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20220912170725.120748-2-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 76af7483b3c7c42571aae767b553ef7d436305e9 Author: Marek Lindner Date: Wed Sep 14 20:37:11 2022 +0200 batman-adv: remove unused struct definitions Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit cfebcd53e65ec6f932f202fc9769da9e13fa0792 Author: Amireddy mallikarjuna reddy Date: Sun Sep 11 16:02:16 2022 +0200 USB: serial: ftdi_sio: add support for HP and HA devices Add the product IDs for the USB-to-Serial devices FT2233HP, FT2232HP, FT4233HP, FT4232HP, FT233HP, FT232HP, and FT4232HA. Also include BCD values so that the chip type can be determined. Signed-off-by: Amireddy mallikarjuna reddy Link: https://lore.kernel.org/r/ac28f2c5eba23a645b3b9299c224f2755a233eef.1658385786.git.mallikarjuna.reddy@ftdichip.com [ johan: rebase on type-handling rework, drop "Q" from automotive type name ] Signed-off-by: Johan Hovold commit 1a0398915d2243fc14be6506a6d226e0593a1c33 Author: Johan Hovold Date: Sun Sep 11 16:02:15 2022 +0200 USB: serial: ftdi_sio: simplify divisor handling In preparation for adding further Hi-Speed types, assume the device type is Hi-Speed unless it's an explicitly listed legacy type when determining divisors. Signed-off-by: Johan Hovold commit 4d50f4fc67d6e903266ff3769d655729a070d490 Author: Johan Hovold Date: Sun Sep 11 16:02:14 2022 +0200 USB: serial: ftdi_sio: assume hi-speed type In preparation for adding further Hi-Speed types, assume a 120 MHz clock and set the channel index by default and instead override these values as needed for legacy types. Signed-off-by: Johan Hovold commit a146cc4d4671e938bbfee414c29f589d4a148cbe Author: Johan Hovold Date: Sun Sep 11 16:02:13 2022 +0200 USB: serial: ftdi_sio: clean up baudrate request Multi-channel devices need to encode the channel selector in their control requests and newer single-channel chip types use the same request format. Set the channel index also for these single-channel types so that the index can be used to determine the baudrate request format instead of listing types explicitly. Note that FT232H and FTX accept either 0 or 1 as selector for their single channel, presumably for backward compatibility reasons. Signed-off-by: Johan Hovold commit 4d045b98fb7460026ac7aefe5418fff3b9d04f14 Author: Johan Hovold Date: Sun Sep 11 16:02:12 2022 +0200 USB: serial: ftdi_sio: clean up attribute handling The driver exposes two attributes for all chip types but FT232A, which doesn't have a configurable latency timer, and SIO, which (probably) doesn't support the event-char mechanism either. Explicitly test for the exceptions rather than list each and every supported device type in the attribute helpers. Signed-off-by: Johan Hovold commit 6fbd91425746f1df97145da31fb2177f7915479b Author: Johan Hovold Date: Sun Sep 11 16:02:11 2022 +0200 USB: serial: ftdi_sio: clean up modem-status handling All chip types but the original SIO (FT8U100AX) return a two-byte modem status and there's no need to explicitly list every other type in the handler. Signed-off-by: Johan Hovold commit f353c0d43006a485b999035b7cb387f76bdd7291 Author: Johan Hovold Date: Sun Sep 11 16:02:10 2022 +0200 USB: serial: ftdi_sio: tighten device-type detection Clean up and tighten the device-type detection, which is based on bcdDevice. Don't make assumptions about unknown (future) types (currently assumed to be either FT2232C or FT-X depending on bNumInterfaces) and instead log an error and refuse to bind so that we can add proper support when needed. Note that the bcdDevice values have been provided by FTDI. Signed-off-by: Johan Hovold commit 027bf37dbe82bb6ce8aa7845f5c7653a869695cd Author: Johan Hovold Date: Sun Sep 11 16:02:09 2022 +0200 USB: serial: ftdi_sio: rename channel index Multi-channel devices require a channel selector to be included in control requests. Replace "interface" with the less ambiguous "channel", which is the terminology used for newer devices, in the corresponding defines and variables. Signed-off-by: Johan Hovold commit 64b12fdac0ed4e3bfadef39c8f8795417bb13d9f Author: Johan Hovold Date: Sun Sep 11 16:02:08 2022 +0200 USB: serial: ftdi_sio: include FT2232D in type string Include the updated D-version in the type string for the FT2232C type. Signed-off-by: Johan Hovold commit 01aeb31f3cdaa90d4827edf0b20069c5c368b371 Author: Johan Hovold Date: Sun Sep 11 16:02:07 2022 +0200 USB: serial: ftdi_sio: rename chip types Shorten the chip type enum and string representation for A, B and R chip types so that they don't include the IC package type in the name. Signed-off-by: Johan Hovold commit 25eb948601dfd7128d136a8c191f6bb7a253880c Author: Johan Hovold Date: Sun Sep 11 16:02:06 2022 +0200 USB: serial: ftdi_sio: drop redundant chip type comments Drop redundant chip type comments. Signed-off-by: Johan Hovold commit 366e89aafe200d654d6fca788cb837906c82159d Author: Johan Hovold Date: Sun Sep 11 16:02:05 2022 +0200 USB: serial: ftdi_sio: clean up chip type enum Clean up the chip type enum by dropping the explicit values and moving the definition to the implementation to make it easier to add further types. Signed-off-by: Johan Hovold commit 7bd7ad3c310cd6766f170927381eea0aa6f46c69 Author: Johan Hovold Date: Tue Sep 13 16:53:12 2022 +0200 USB: serial: ftdi_sio: fix 300 bps rate for SIO The 300 bps rate of SIO devices has been mapped to 9600 bps since 2003... Let's fix the regression. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit aa510b0c1fa34338babbde366b2c98b9b39aa282 Author: Krzysztof Kozlowski Date: Thu Sep 8 10:10:50 2022 +0200 arm64: dts: qcom: sa8295p-adp: add missing gpio-ranges in PMIC GPIOs The Qualcomm PMIC GPIO bindings require gpio-ranges property: qcom/sa8295p-adp.dtb: pmic@8: gpio@c000: 'gpio-ranges' is a required property Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908081050.29751-5-krzysztof.kozlowski@linaro.org commit afa774bc17e607ef98cc660657cf5208a39591a2 Author: Krzysztof Kozlowski Date: Thu Sep 8 10:10:49 2022 +0200 arm64: dts: qcom: sa8295p-adp: add fallback compatible to PMIC GPIOs Bindings require all PMIC GPIO nodes to have two compatibles - specific followed by SPMI or SSBI fallback: qcom/sa8295p-adp.dtb: pmic@8: gpio@c000:compatible: ['qcom,pm8150-gpio'] is too short Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908081050.29751-4-krzysztof.kozlowski@linaro.org commit b94d7c1fc7c6ac4e2ce83e9fc6a84fc3034b631c Author: Krzysztof Kozlowski Date: Thu Sep 8 10:10:48 2022 +0200 arm64: dts: qcom: msm8996-xiaomi: align PMIC GPIO pin configuration with DT schema Bindings expect PMIC GPIO pin configuration nodes to be named with '-state' suffix: qcom/msm8996-xiaomi-scorpio.dtb: pmic@0: gpio@c000: 'irled-default', 'keypad-default' do not match any of the regexes: '-state$', 'pinctrl-[0-9]+' Drop also additional indentation via "pinconf" to make the code a bit smaller. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908081050.29751-3-krzysztof.kozlowski@linaro.org commit 308ff92e77aa2febec9b81b6917ebb0f38da8cb5 Author: Krzysztof Kozlowski Date: Thu Sep 8 10:10:47 2022 +0200 arm64: dts: qcom: msm8994-msft-lumia-octagon: align resin node name with bindings Bindings expect resin node to be named "resin": qcom/msm8992-msft-lumia-octagon-talkman.dtb: pmic@0: pon@800: Unevaluated properties are not allowed ('volwnkey' was unexpected) Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908081050.29751-2-krzysztof.kozlowski@linaro.org commit 8cd012f75178c4dffe8df692aa991e829286a8d4 Author: Krzysztof Kozlowski Date: Thu Sep 8 10:10:46 2022 +0200 arm64: dts: qcom: pmi8994: add missing MPP compatible fallback Bindings require usage of generic MPP fallback in compatible: qcom/apq8094-sony-xperia-kitakami-karin_windy.dtb: pmic@2: mpps@a000:compatible: ['qcom,pmi8994-mpp'] is too short Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908081050.29751-1-krzysztof.kozlowski@linaro.org commit a672a9f4a6bba31f8dfb3a77714468ddb985ecf7 Author: Krishna chaitanya chundru Date: Thu Sep 8 14:16:16 2022 +0530 dt-bindings: pci: QCOM Add missing sc7280 aggre0, aggre1 clocks Add missing aggre0 and aggre1 clocks. Signed-off-by: Krishna chaitanya chundru Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662626776-19636-3-git-send-email-quic_krichai@quicinc.com commit aaf85b46aa4145f5ec7aa0a9bdf4a93b23474524 Author: Krishna chaitanya chundru Date: Thu Sep 8 14:16:15 2022 +0530 arm64: dts: qcom: sc7280: Add missing aggre0, aggre1 clocks Add missing aggre0, aggre1 clocks. Signed-off-by: Krishna chaitanya chundru Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662626776-19636-2-git-send-email-quic_krichai@quicinc.com commit 9385eb46e319ecb7632acba59dac3458a544bd98 Author: Krzysztof Kozlowski Date: Fri Sep 9 12:51:36 2022 +0200 arm64: defconfig: enable newer Qualcomm SoC sound drivers Enable sound support: 1. machine drivers for Qualcomm SC7180 and SC7280 SoCs, 2. Qualcomm ADSP Peripheral Image Loader used already on SC7280. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.421877-1-krzysztof.kozlowski@linaro.org commit 542110f21d811f0fbc661bcc9365e45e23e8d422 Author: Lucas De Marchi Date: Tue Sep 13 14:09:58 2022 -0700 drm/i915: Invert if/else ladder for stolen init Continue converting the driver to the convention of last version first, extending it to the future platforms. Now, any GRAPHICS_VER >= 11 will be handled by the first branch. Reviewed-by: Gustavo Sousa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220908-if-ladder-v2-3-7a7b15545c93@intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20220912-copy-engine-v1-1-ef92fd81758d@intel.com commit 1416b5473d34d89a85c02889b724f32b56ef12ea Author: Lucas De Marchi Date: Tue Sep 13 14:09:57 2022 -0700 drm/i915/gt: Extract per-platform function for frequency read Instead of calling read_clock_frequency() to walk the if/else ladder per platform, move the ladder to intel_gt_init_clock_frequency() and use one function per branch. With the new logic, it's now clear the call to gen9_get_crystal_clock_freq() was just dead code, as gen9 is handled by another function and there is no version 10. Remove that function and the caller. v2: Correctly handle intel_gt_check_clock_frequency() that also calls the function to read clock frequency (Gustavo) Cc: Ville Syrjälä Cc: Gustavo Sousa Signed-off-by: Lucas De Marchi Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20220908-if-ladder-v2-2-7a7b15545c93@intel.com commit 29a051bd468cba31c227af579a7c57f250570cfa Author: Lucas De Marchi Date: Tue Sep 13 14:09:56 2022 -0700 drm/i915: Invert if/else ladder for frequency read Continue converting the driver to the convention of last version first, extending it to the future platforms. Now, any GRAPHICS_VER >= 11 will be handled by the first branch. With the new ranges it's easier to see what platform a branch started to be taken. Besides the >= 11 change, the branch taken for GRAPHICS_VER == 10 is also different, but currently there is no such platform in i915. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220908-if-ladder-v2-1-7a7b15545c93@intel.com commit 5d53f4c22d367b214f6f737db5cbe6f4a86db747 Author: John Harrison Date: Tue Sep 13 17:58:21 2022 -0700 drm/i915/uc: Fix issues with overriding firmware files The earlier update to support reduced versioning of firmware files introduced an issue with the firmware override module parameter. A self test would specify an invalid file name (invalid meaning not in the table) both with and without setting the override flag. The *non-override* case would cause an infinite loop. I.e. a situation that is impossible to hit outside of the selftest because either the file name has come from the table in first place or it came from an override. However, the override case was also broken in that it would bypass some of the later processing. The first fix is to update the scanning loop code so that if an invalid file is passed in, it will exit rather than loop forever. So if the impossible situation did somehow occur in the future, it wouldn't be such a big problem. The second flips the logic on the override early exit to be negative rather than positive. That way if an explicit override has been set, then it won't try to scan for backup options (because there is no point anyway - the user wanted X and if X is not available, that's their problem). It also means that it won't skip code that still needs to be run once a valid firmware file has been selected. v2: Also remove ANSI colour codes that accidentally got left in an error message in the original patch. Fixes: 665ae9c9ca79 ("drm/i915/uc: Support for version reduced and multiple firmware files") Cc: Daniele Ceraolo Spurio Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Matthew Brost Cc: Umesh Nerlige Ramappa Cc: Matthew Auld Cc: Alan Previn Cc: Matt Roper Cc: Lucas De Marchi Cc: Vinay Belgaumkar Cc: "Thomas Hellström" Cc: Venkata Sandeep Dhanalakota Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220914005821.3702446-2-John.C.Harrison@Intel.com commit 4aaa1a98331c9f9fd31f4b80b913c8f0c556c90a Author: Madhumitha Tolakanahalli Pradeep Date: Tue Sep 13 11:33:41 2022 -0700 drm/i915/mtl: Update CHICKEN_TRANS* register addresses In Display version 14, Transcoder Chicken Registers have updated address. This patch performs checks to use the right register when required. v2: Omit display version check in i915_reg.h(Jani) v3: - Remove extra whitespace introduced - Fix reg definitions for MTL_CHICKEN_TRANS(MattR) Bspec: 34387, 50054 Cc: Jani Nikula Cc: Matt Roper Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220913183341.908028-6-radhakrishna.sripada@intel.com commit 851d635a0bf2a741d0e57889b5defcdf9ebfc70e Author: Radhakrishna Sripada Date: Tue Sep 13 11:33:40 2022 -0700 drm/i915/mtl: Update MBUS_DBOX credits Display version 14 platforms have different credits values compared to ADL-P. Update the credits based on pipe usage. v2: Simplify DBOX BW Credit definition(MattR) v3: - Simplify only pipe per dbuf bank check(MattR) - Skip modeset check to handle the case when a new pipe within dbuf bank gets added/removed.(MattR) Bspec: 49213 Cc: Jose Roberto de Souza Cc: Matt Roper Original Author: Caz Yokoyama Signed-off-by: José Roberto de Souza Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220913183341.908028-5-radhakrishna.sripada@intel.com commit b2d7616e13c4eb766f5e2f6568c2e746e76b7b53 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:28 2022 +0200 dt-bindings: soc: qcom: apr: add missing properties The APR bindings were not describing all properties already used in DTS: 1. Add qcom,glink-channels, qcom,smd-channels and qcom,intents (widely used). 2. Add power-domains for MSM8996. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-16-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 5f170e21fe96fbd1f81ace9ec6e6b695e1098733 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:27 2022 +0200 ASoC: dt-bindings: qcom,q6apm-dai: adjust indentation in example Cleanup the example DTS by fixing indentation to 4-spaces and adding blank lines for readability. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-15-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 7af18f4efd85c2e85458e3f504e129a97f6baaf2 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:26 2022 +0200 ASoC: dt-bindings: qcom,q6dsp-lpass-clocks: cleanup example Cleanup the example DTS by adding APR and service compatibles, adding typical properties, using proper device node names for services and fixing indentation to 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-14-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 0630efc3b849f65ef3bad803b84bc0819591dac9 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:25 2022 +0200 ASoC: dt-bindings: qcom,q6dsp-lpass-ports: cleanup example Cleanup the example DTS by adding APR and service compatibles, adding typical properties, using proper device node names for services and fixing indentation to 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-13-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 301628d805019999f1ae9764aadfcface9c4e309 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:24 2022 +0200 ASoC: dt-bindings: qcom,q6adm: convert to dtschema Convert Qualcomm Audio Device Manager (Q6ADM) bindings to DT schema. The original bindings documented: 1. APR service node with compatibles: "qcom,q6adm" and "qcom,q6adm-v.", 2. Routing child node with compatible "qcom,q6adm-routing". The conversion entirely drops (1) because the compatible is already documented in bindings/soc/qcom/qcom,apr.yaml. The "qcom,q6adm-v." on the other hand is not used at all - neither in existing DTS, nor in downstream sources - so versions seems to be fully auto-detectable. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-12-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 7b0ad4629d1fb719ae71a8f2968e8c6268ab1709 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:23 2022 +0200 ASoC: dt-bindings: qcom,q6asm: convert to dtschema Convert Qualcomm Audio Stream Manager (Q6ASM) bindings to DT schema. The original bindings documented: 1. APR service node with compatibles: "qcom,q6asm" and "qcom,q6asm-v.", 2. actual DAIs child node with compatible "qcom,q6asm-dais". The conversion entirely drops (1) because the compatible is already documented in bindings/soc/qcom/qcom,apr.yaml. The "qcom,q6asm-v." on the other hand is not used at all - neither in existing DTS, nor in downstream sources - so versions seems to be fully auto-detectable. Another change done in conversion is adding "iommus" property, which is already used in DTS and Linux driver. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220910091428.50418-11-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit b2496de1dfdddfceb87e7a7b791c3a249c860682 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:14:22 2022 +0200 dt-bindings: soc: qcom: apr: correct service children The APR bindings were not describing properly children nodes for DAIs. None of the DTSes use unit addresses for the children, so correct the nodes and reference their schema: clock-controller, dais and routing. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220910091428.50418-10-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 9afc675edeeb34d281675f1d5a217d27c5a1a3db Author: Zhengping Jiang Date: Tue Sep 13 16:37:15 2022 -0700 Bluetooth: hci_sync: allow advertise when scan without RPA Address resolution will be paused during active scan to allow any advertising reports reach the host. If LL privacy is enabled, advertising will rely on the controller to generate new RPA. If host is not using RPA, there is no need to stop advertising during active scan because there is no need to generate RPA in the controller. Signed-off-by: Zhengping Jiang Signed-off-by: Luiz Augusto von Dentz commit be55622ce673f9692cc15d26d77a050cda42a3d3 Author: Daniel Golle Date: Fri Sep 9 21:00:30 2022 +0100 Bluetooth: btusb: Add a new VID/PID 0e8d/0608 for MT7921 Add a new PID/VID 0e8d/0608 for MT7921K chip found on AMD RZ608 module. From /sys/kernel/debug/usb/devices: T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0e8d ProdID=0608 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us Signed-off-by: Daniel Golle Signed-off-by: Luiz Augusto von Dentz commit f0ad26ee822b197f2421462df9c358a5687fddfd Author: Sean Wang Date: Wed Aug 31 12:53:28 2022 +0800 Bluetooth: btusb: Add a new PID/VID 13d3/3583 for MT7921 Add VID 13D3 & PID 3583 for MediaTek MT7921 USB Bluetooth chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=03 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3583 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Signed-off-by: Sean Wang Signed-off-by: Luiz Augusto von Dentz commit f74ca25d6d6629ffd4fd80a1a73037253b57d06b Author: Tetsuo Handa Date: Mon Sep 12 01:21:42 2022 +0900 Bluetooth: avoid hci_dev_test_and_set_flag() in mgmt_init_hdev() syzbot is again reporting attempt to cancel uninitialized work at mgmt_index_removed() [1], for setting of HCI_MGMT flag from mgmt_init_hdev() from hci_mgmt_cmd() from hci_sock_sendmsg() can race with testing of HCI_MGMT flag from mgmt_index_removed() from hci_sock_bind() due to lack of serialization via hci_dev_lock(). Since mgmt_init_hdev() is called with mgmt_chan_list_lock held, we can safely split hci_dev_test_and_set_flag() into hci_dev_test_flag() and hci_dev_set_flag(). Thus, in order to close this race, set HCI_MGMT flag after INIT_DELAYED_WORK() completed. This is a local fix based on mgmt_chan_list_lock. Lack of serialization via hci_dev_lock() might be causing different race conditions somewhere else. But a global fix based on hci_dev_lock() should deserve a future patch. Link: https://syzkaller.appspot.com/bug?extid=844c7bf1b1aa4119c5de Reported-by: syzbot+844c7bf1b1aa4119c5de@syzkaller.appspotmail.com Signed-off-by: Tetsuo Handa Fixes: 3f2893d3c142986a ("Bluetooth: don't try to cancel uninitialized works at mgmt_index_removed()") Signed-off-by: Luiz Augusto von Dentz commit 60a884da670119cd5492fe2774a9a3b9d119e045 Author: AngeloGioacchino Del Regno Date: Wed Sep 14 12:30:21 2022 +0200 dt-bindings: input: mediatek,pmic-keys: Add compatible for MT6331 keys Add a compatible for the keys found on MT6331 PMIC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220914103021.43593-3-angelogioacchino.delregno@collabora.com Signed-off-by: Dmitry Torokhov commit 612a0f0b93c8c8d3f0ab610c69e0b6678362643b Author: AngeloGioacchino Del Regno Date: Wed Sep 14 12:30:20 2022 +0200 dt-bindings: input: Convert mtk-pmic-keys to DT schema Convert the mtk-pmic-keys to DT schema format. The old binding was missing documentation for key press/release interrupts, even though it was supported in hardware and driver, so support for the same was added during the conversion. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Mattijs Korpershoek Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220914103021.43593-2-angelogioacchino.delregno@collabora.com Signed-off-by: Dmitry Torokhov commit a0c4b120431172490793fb21d43c908b35fd3e50 Author: Andy Shevchenko Date: Wed Sep 14 18:33:33 2022 +0300 spi: mpc52xx: Replace of_gpio_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220914153333.37701-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 64ca1a034f00bf6366701df0af9194a6425d5406 Author: Christophe Leroy Date: Thu Aug 18 15:38:37 2022 +0200 spi: fsl_spi: Convert to transfer_one Let the core handle all the chipselect bakery and replace transfer_one_message() by transfer_one() and prepare_message(). At the time being, there is fsl_spi_cs_control() to handle chipselects. That function handles both GPIO and non-GPIO chipselects. The GPIO chipselects will now be handled by the core directly, so only handle non-GPIO chipselects and hook it to ->set_cs Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/753266abafe81722d86c3ddb8bac8ef1cb00fe8c.1660829841.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown commit 961bcdf956a4645745407a5d919be8757549b062 Author: Maíra Canal Date: Sun Sep 11 16:17:56 2022 -0300 drm/tests: Change "igt_" prefix to "drm_test_" With the introduction of KUnit, IGT is no longer the only option to run the DRM unit tests, as the tests can be run through kunit-tool or on real hardware with CONFIG_KUNIT. Therefore, remove the "igt_" prefix from the tests and replace it with the "drm_test_" prefix, making the tests' names independent from the tool used. Signed-off-by: Maíra Canal Acked-by: David Gow Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220911191756.203118-2-mairacanal@riseup.net commit b167259a12f2c49e82cbd077499df85117177a39 Author: Maíra Canal Date: Sun Sep 11 16:17:55 2022 -0300 drm/tests: Split drm_framebuffer_create_test into parameterized tests The igt_check_drm_framebuffer_create is based on a loop that executes tests for all createbuffer_tests test cases. This could be better represented by parameterized tests, provided by KUnit. So, convert the igt_check_drm_framebuffer_create into parameterized tests. Signed-off-by: Maíra Canal Reviewed-by: Michał Winiarski Reviewed-by: David Gow Link: https://patchwork.freedesktop.org/patch/msgid/20220911191756.203118-1-mairacanal@riseup.net commit dacd2d2d9d800b7ab2ee2734578112532cba8105 Author: Yihao Han Date: Wed Sep 14 00:47:49 2022 -0700 drm/amd/display: fix boolconv.cocci warning ./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c:729:63-68: WARNING: conversion to bool not needed here Generated by: scripts/coccinelle/misc/boolconv.cocci Signed-off-by: Yihao Han Signed-off-by: Alex Deucher commit 04206ff06a849834e1feb21b51735fe673a3e484 Author: Jiapeng Chong Date: Wed Sep 14 13:27:42 2022 +0800 drm/amd/display: make optc32_phantom_crtc_post_enable, optc32_setup_manual_trigger and optc32_set_drr static These three functions are not used outside the function dcn32_optc.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_optc.c:159:6: warning: no previous prototype for function 'optc32_phantom_crtc_post_enable'. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_optc.c:218:6: warning: no previous prototype for ‘optc32_set_drr’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_optc.c:193:6: warning: no previous prototype for ‘optc32_setup_manual_trigger’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2140 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 73258e916a4e7e8adc9402da68ad9bc40dd38686 Author: Jiapeng Chong Date: Wed Sep 14 13:27:41 2022 +0800 drm/amd/display: make some functions static These functions are not used outside the file dcn32_dccg.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dccg.c:257:6: warning: no previous prototype for ‘dccg32_otg_drop_pixel’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dccg.c:248:6: warning: no previous prototype for ‘dccg32_otg_add_pixel’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dccg.c:211:6: warning: no previous prototype for ‘dccg32_set_dpstreamclk’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dccg.c:136:6: warning: no previous prototype for ‘dccg32_set_dtbclk_dto’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2142 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit c1e48e36c120df7e3a3cb39d17d64c753485f225 Author: Jiapeng Chong Date: Wed Sep 14 13:27:40 2022 +0800 drm/amd/display: make some functions static These functions are not used outside the file dcn32_hubbub.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hubbub.c:912:6: warning: no previous prototype for ‘hubbub32_force_wm_propagate_to_pipes’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hubbub.c:823:6: warning: no previous prototype for ‘hubbub32_wm_read_state’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hubbub.c:772:6: warning: no previous prototype for ‘hubbub32_init_watermarks’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hubbub.c:712:6: warning: no previous prototype for ‘hubbub32_force_usr_retraining_allow’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2141 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 9e33e951ecafea581a5d346c56cbdd00f58814ca Author: Jiapeng Chong Date: Wed Sep 14 13:27:39 2022 +0800 drm/amd/display: make mmhubbub32_config_mcif_buf static This symbol is not used outside of dcn32_mmhubbub.c, so marks it static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_mmhubbub.c:103:6: warning: no previous prototype for ‘mmhubbub32_config_mcif_buf’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2145 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit b70cfd91a980fb423299d1c48f4127d4b7fe79c4 Author: Jiapeng Chong Date: Wed Sep 14 13:27:38 2022 +0800 drm/amd/display: make some functions static These functions are not used outside the file dcn32_hubbub.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:223:6: warning: no previous prototype for ‘dccg314_set_valid_pixel_rate’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:184:6: warning: no previous prototype for ‘dccg314_set_dpstreamclk’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:140:6: warning: no previous prototype for ‘dccg314_set_dtbclk_dto’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2144 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit d67927e4483811a23bca1a5508de53d289df3209 Author: Jiapeng Chong Date: Wed Sep 14 13:27:37 2022 +0800 drm/amd/display: make optc314_phantom_crtc_post_enable static This symbol is not used outside of dcn314_optc.c, so marks it static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_optc.c:153:6: warning: no previous prototype for ‘optc314_phantom_crtc_post_enable’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2147 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 668562f49dc67a16e3649432cef341d1649c1109 Author: Jiapeng Chong Date: Wed Sep 14 13:27:36 2022 +0800 drm/amd/display: make enc314_stream_encoder_dvi_set_stream_attribute static This symbol is not used outside of dcn314_dio_stream_encoder.c, so marks it static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dio_stream_encoder.c:84:6: warning: no previous prototype for ‘enc314_stream_encoder_dvi_set_stream_attribute’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2146 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit e0f1d483b85bd35ed10985e7d3e64386e4e14e50 Author: Jiapeng Chong Date: Wed Sep 14 13:27:35 2022 +0800 drm/amd/display: make some functions static These functions are not used outside the file dcn30_resource.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_resource.c:1949:6: warning: no previous prototype for ‘is_refresh_rate_support_mclk_switch_using_fw_based_vblank_stretch’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_resource.c:1919:5: warning: no previous prototype for ‘get_frame_rate_at_max_stretch_100hz’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2143 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit c1c39032a0748be08f6bc33a8dad70b83ef311a6 Author: Alex Deucher Date: Tue Aug 30 10:59:49 2022 -0400 drm/amdgpu: make sure to init common IP before gmc Move common IP init before GMC init so that HDP gets remapped before GMC init which uses it. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Acked-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 59c43748c7c82de9fb537fe790cbfc71734333ad Author: Alex Deucher Date: Fri Sep 9 11:53:27 2022 -0400 drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega This mirrors what we do for other asics and this way we are sure the sdma doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. However, the statement says that it applies to multimedia as well, but the VCN code currently initializes doorbells after GFX and there are no known issues there. In my testing at least I don't see any problems on SDMA. This is a prerequisite for fixing the Unsupported Request error reported through AER during driver load. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Acked-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit db10109793bbd20c47d9cd324b27e1466dc236fb Author: Alex Deucher Date: Fri Sep 9 11:47:20 2022 -0400 drm/amdgpu: move nbio ih_doorbell_range() into ih code for vega This mirrors what we do for other asics and this way we are sure the ih doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. In this case IH is initialized before GFX, so there should be no issue. This is a prerequisite for fixing the Unsupported Request error reported through AER during driver load. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Acked-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0d6516efff2cf275591c57faadce249257d58980 Author: Li Ma Date: Mon Sep 5 17:20:58 2022 +0800 drm/amd/pm:add new gpu_metrics_v2_3 to acquire average temperature info Add new gpu_metrics_v2_3 to acquire average temperature info from SMU metrics. To acquire average temp info from gpu_metrics interface, but gpu_metrics_v2_2 only has members to show current temp info. --- v1: Only add average_temperature_gfx in gpu_metrics_v2_3. v2: Add average temp members for soc, core and l3 in gpu_metrics_v2_3 and put these new members at the end of gpu_metrics_v2_3. Add operation to read average temp info from metrics table. v3: Merge v1 and v2 and rename the patch. v4: Merge v3. Add firmware version judgment in vangogh_common_get_gpu_metrics to maintain backward compatibility and rename the patch. "return ret" on error scenario in smu_cmn_get_smc_version. Signed-off-by: Li Ma Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit a6b9ede1f3dfa5477791ad92d11f60f50998b689 Author: Dmitry Torokhov Date: Mon Sep 5 19:15:23 2022 -0700 PCI: apple: Do not leak reset GPIO on unbind/unload/error The driver allocates reset GPIO in apple_pcie_setup_port() but neither releases the resource, nor uses devm API to have it released automatically. Let's fix this by switching to devm API. While at it let's use generic devm_fwnode_gpiod_get() instead of OF-specific gpiod_get_from_of_node() - this will allow us top stop exporting the latter down the road. Link: https://lore.kernel.org/r/YxatO5OaI2RpxQ2M@google.com Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") Signed-off-by: Dmitry Torokhov Signed-off-by: Lorenzo Pieralisi Reviewed-by: Hector Martin Acked-by: Marc Zyngier commit fba07cd4dd8fb4833015801a83f945b2d65a5c4b Author: Alexander Gordeev Date: Thu Sep 8 14:23:02 2022 +0200 s390/mm: uninline copy_oldmem_kernel() function Uninline copy_oldmem_kernel() function and make it consistent with a very similar memcpy_real() implementation, by moving to code to crash_dump.c, where it actually belongs. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit c0ceb94403880840effeb1990a19357a1232578f Author: Alexander Gordeev Date: Sun Sep 4 10:32:32 2022 +0200 s390/mm,ptdump: add real memory copy page markers Add "Real Memory Copy Area Start" and "Real Memory Copy Area End" markers that fence the page used for real memory copying. Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 2f0e8aae26a27fe73d033788f8e92188e7584f41 Author: Alexander Gordeev Date: Sun Jul 24 15:02:16 2022 +0200 s390/mm: rework memcpy_real() to avoid DAT-off mode Function memcpy_real() is an univeral data mover that does not require DAT mode to be able reading from a physical address. Its advantage is an ability to read from any address, even those for which no kernel virtual mapping exists. Although memcpy_real() is interrupt-safe, there are no handlers that make use of this function. The compiler instrumentation have to be disabled and separate no-DAT stack used to allow execution of the function once DAT mode is disabled. Rework memcpy_real() to overcome these shortcomings. As result, data copying (which is primarily reading out a crashed system memory by a user process) is executed on a regular stack with enabled interrupts. Also, use of memcpy_real_buf swap buffer becomes unnecessary and the swapping is eliminated. The above is achieved by using a fixed virtual address range that spans a single page and remaps that page repeatedly when memcpy_real() is called for a particular physical address. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 14a3a2624285d36624966935ec12f228d876c028 Author: Alexander Gordeev Date: Fri Sep 2 10:05:08 2022 +0200 s390/dump: save IPL CPU registers once DAT is available Function smp_save_dump_cpus() collects CPU state of a crashed system for secondary CPUs and for the IPL CPU very differently. The Signal Processor stop-and-store-status orders are used for the former while Hardware System Area requests and memcpy_real() routine are called for the latter. In addition a system reset is triggered, which pins smp_save_dump_cpus() function call before CPU and device initialization. Move the collection of IPL CPU state to a later stage when DAT becomes available. That is needed to allow a follow-up rework of memcpy_real() routine. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 2187582c361fcd33a6ab5e9e6fef5b774c3b8cda Author: Niklas Schnelle Date: Wed Sep 7 11:38:30 2022 +0200 s390/pci: convert high_memory to physical address We use high_memory as a measure for amount of memory available in determining the required minimum size of our IOVA space with the assumption that one rarely maps more than the available memory for DMA. In special cases like mapping significant amounts of memory more than once this can still be tuned with the s390_iommu_apterture kernel parameter. In this use case high_memory is treated as a physical address. As high_memory is a virtual address however this means we need to convert it using virt_to_phys() before use Note that at the moment physical and virtual addresses are identical so this mismatch does not currently cause trouble. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik commit 50787755317ddf8c9bb3419a15b87c42237000cb Author: Alexander Gordeev Date: Wed Jul 20 08:32:13 2022 +0200 s390/smp,ptdump: add absolute lowcore markers Add "Lowcore Area Start" and "Lowcore Area End" markers that fence pages where absolute lowcore resides. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 4df29d2b9024d6ababc6342cf5f721cbaff517b5 Author: Alexander Gordeev Date: Wed Jul 20 08:22:01 2022 +0200 s390/smp: rework absolute lowcore access Temporary unsetting of the prefix page in memcpy_absolute() routine poses a risk of executing code path with unexpectedly disabled prefix page. This rework avoids the prefix page uninstalling and disabling of normal and machine check interrupts when accessing the absolute zero memory. Although memcpy_absolute() routine can access the whole memory, it is only used to update the absolute zero lowcore. This rework therefore introduces a new mechanism for the absolute zero lowcore access and scraps memcpy_absolute() routine for good. Instead, an area is reserved in the virtual memory that is used for the absolute lowcore access only. That area holds an array of 8KB virtual mappings - one per CPU. Whenever a CPU is brought online, the corresponding item is mapped to the real address of the previously installed prefix page. The absolute zero lowcore access works like this: a CPU calls the new primitive get_abs_lowcore() to obtain its 8KB mapping as a pointer to the struct lowcore. Virtual address references to that pointer get translated to the real addresses of the prefix page, which in turn gets swapped with the absolute zero memory addresses due to prefixing. Once the pointer is not needed it must be released with put_abs_lowcore() primitive: struct lowcore *abs_lc; unsigned long flags; abs_lc = get_abs_lowcore(&flags); abs_lc->... = ...; put_abs_lowcore(abs_lc, flags); To ensure the described mechanism works large segment- and region- table entries must be avoided for the 8KB mappings. Failure to do so results in usage of Region-Frame Absolute Address (RFAA) or Segment-Frame Absolute Address (SFAA) large page fields. In that case absolute addresses would be used to address the prefix page instead of the real ones and the prefixing would get bypassed. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 6cbd7cc2ebbe074522246f50628cbae34915bb95 Author: Alexander Gordeev Date: Thu Sep 1 10:33:51 2022 +0200 s390/smp: call smp_reinit_ipl_cpu() before scheduler is available Currently smp_reinit_ipl_cpu() is a pre-SMP early initcall. That ensures no CPU is running in parallel, but still not enough to assume the code is exclusive, since the scheduling is already available. Move the function call to arch_call_rest_init() callback to ensure no thread could be preempted and allow lockless allocation of the kernel page tables. That is needed to allow a follow-up rework of the absolute lowcore access mechanism. Suggested-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit d61bb30e434db7df2a5f1ad5d773ed3a876dee03 Merge: edcfc9c71bfd4 8d96bba75a43b Author: Vasily Gorbik Date: Wed Sep 14 16:41:21 2022 +0200 Merge branch 'fixes' into features * fixes: s390/smp: enforce lowcore protection on CPU restart s390/boot: fix absolute zero lowcore corruption on boot s390/hugetlb: fix prepare_hugepage_range() check for 2 GB hugepages s390: update defconfigs s390: fix nospec table alignments s390/mm: remove useless hugepage address alignment Signed-off-by: Vasily Gorbik commit 300218b0503d40f3efc69363ca70b7f75c3ba81f Author: Peter Chiu Date: Thu Sep 1 21:05:52 2022 +0800 arm64: dts: mt7986: add built-in Wi-Fi device nodes This enables built-in 802.11ax Wi-Fi support. Reviewed-by: Sam Shih Reviewed-by: Ryder Lee Signed-off-by: Peter Chiu Link: https://lore.kernel.org/r/20220901130552.26234-1-chui-hao.chiu@mediatek.com Signed-off-by: Matthias Brugger commit a6b0be65123e1dfbcce6653a82394f989d3372ff Author: Yang Yingliang Date: Wed Sep 14 21:33:55 2022 +0800 ASoC: soc-dapm: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220914133355.3779364-3-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 28a3fb26e83e013c929a2e1185743ece7e8173ff Author: Yang Yingliang Date: Wed Sep 14 21:33:54 2022 +0800 ASoC: cs42l42: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220914133355.3779364-2-yangyingliang@huawei.com Signed-off-by: Mark Brown commit b407589583da08405a19f4b0139d128e1ae41658 Author: Yang Yingliang Date: Wed Sep 14 21:33:53 2022 +0800 ASoC: bcm2835-i2s: Switch to use dev_err_probe() helper dev_err/dev_dbg() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220914133355.3779364-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit bfb735a3ceff0bab6473bac275da96f9b2a06dec Author: Liang He Date: Wed Sep 14 21:43:54 2022 +0800 ASoC: eureka-tlv320: Hold reference returned from of_find_xxx API In eukrea_tlv320_probe(), we need to hold the reference returned from of_find_compatible_node() which has increased the refcount and then call of_node_put() with it when done. Fixes: 66f232908de2 ("ASoC: eukrea-tlv320: Add DT support.") Co-authored-by: Kelin Wang Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220914134354.3995587-1-windhl@126.com Signed-off-by: Mark Brown commit 06c1c49d0cd1d6cec5b78963109ba728e49e0063 Author: Kees Cook Date: Tue Sep 13 10:28:56 2022 -0700 fortify: Adjust KUnit test for modular build A much better "unknown size" string pointer is available directly from struct test, so use that instead of a global that isn't shared with modules. Reported-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/YyCOHOchVuE/E7vS@dev-arch.thelio-3990X Fixes: 875bfd5276f3 ("fortify: Add KUnit test for FORTIFY_SOURCE internals") Cc: linux-hardening@vger.kernel.org Build-tested-by: Nathan Chancellor Reviewed-by: David Gow Signed-off-by: Kees Cook commit 68aa834823e09a540a23374129326a51efe877a3 Author: Douglas Anderson Date: Mon Aug 29 08:48:24 2022 -0700 arm64: dts: qcom: sc7280-villager: Adjust LTE SKUs There have been a few changes since the patch ("arm64: dts: qcom: Add LTE SKUs for sc7280-villager family") * New firmware reports LTE boards as "SKU 512" now. Old firmware will still report "SKU 0", but that's all pre-production and everyone will update. * It's been relaized that no "-rev0" boards were ever built that were WiFi-only. Thus we don't two entries for -rev0. Adjust the organization a bit. Signed-off-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829084732.2.I22e256d1ebac577a91fac44d1d12919be7111cd4@changeid commit ff0ea86a538e80879243364bcf1a42e2d0eb6254 Author: Douglas Anderson Date: Mon Aug 29 08:48:23 2022 -0700 dt-bindings: arm: qcom: Adjust LTE SKUs for sc7280-villager There have been a few changes since the patch ("dt-bindings: arm: qcom: document sc7280 and villager board"). * New firmware reports LTE boards as "SKU 512" now. Old firmware will still report "SKU 0", but that's all pre-production and everyone will update. * It's been relaized that no "-rev0" boards were ever built that were WiFi-only. Thus we don't two entries for -rev0. Signed-off-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829084732.1.I9ef7f8b909a7afbef9ff2251a98c67033f37b516@changeid commit 1c679f917397f85bda93f7f9b20fb722d4b8b18d Author: Yang Yingliang Date: Wed Sep 14 21:40:30 2022 +0800 can: flexcan: Switch to use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/all/20220914134030.3782754-1-yangyingliang@huawei.com Signed-off-by: Marc Kleine-Budde commit 92858eb6cb64cfafdc2b35c942d1812275f4205a Author: Peter Chiu Date: Mon Sep 12 17:24:40 2022 +0800 dt-bindings: pinctrl: update bindings for MT7986 SoC Add wifi pins in the description and set 'maxItems' for groups and pins. Reviewed-by: Sam Shih Signed-off-by: Peter Chiu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220912092440.21011-1-chui-hao.chiu@mediatek.com Signed-off-by: Linus Walleij commit ad74457a6b5a967641c80798aceb71503dc2bfd2 Author: Anshuman Gupta Date: Tue Sep 13 20:57:14 2022 +0530 drm/i915/dgfx: Release mmap on rpm suspend Release all mmap mapping for all lmem objects which are associated with userfault such that, while pcie function in D3hot, any access to memory mappings will raise a userfault. Runtime resume the dgpu(when gem object lies in lmem). This will transition the dgpu graphics function to D0 state if it was in D3 in order to access the mmap memory mappings. v2: - Squashes the patches. [Matt Auld] - Add adequate locking for lmem_userfault_list addition. [Matt Auld] - Reused obj->userfault_count to avoid double addition. [Matt Auld] - Added i915_gem_object_lock to check i915_gem_object_is_lmem. [Matt Auld] v3: - Use i915_ttm_cpu_maps_iomem. [Matt Auld] - Fix 'ret == 0 to ret == VM_FAULT_NOPAGE'. [Matt Auld] - Reuse obj->userfault_count as a bool 0 or 1. [Matt Auld] - Delete the mmaped obj from lmem_userfault_list in obj destruction path. [Matt Auld] - Get a wakeref for object destruction patch. [Matt Auld] - Use intel_wakeref_auto to delay runtime PM. [Matt Auld] v4: - Avoid using mmo offset to get the vma_node. [Matt Auld] - Added comment to use the lmem_userfault_lock. [Matt Auld] - Get lmem_userfault_lock in i915_gem_object_release_mmap_offset. [Matt Auld] - Fixed kernel test robot generated warning. v5: - Addressed the cosmetics comments. [Andi] - Changed i915_gem_runtime_pm_object_release_mmap_offset() name to i915_gem_object_runtime_pm_release_mmap_offset() to be rhythmic. PCIe Specs 5.3.1.4.1 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6331 Cc: Matthew Auld Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20220913152714.16541-3-anshuman.gupta@intel.com commit f5e92d23f51ced4f366b3193822f705a08beb3b1 Author: Anshuman Gupta Date: Tue Sep 13 20:57:13 2022 +0530 drm/i915: Refactor userfault_wakeref to re-use Refactor userfault_wakeref to re-use for discrete lmem mmap mapping as well, as on discrete GTT mmap are not supported. Moving userfault_wakeref from ggtt to gt structure. Signed-off-by: Anshuman Gupta Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20220913152714.16541-2-anshuman.gupta@intel.com commit f88aabad33ea22be2ce1c60d8901942e4e2a9edb Author: Nathan Lynch Date: Wed Sep 7 17:01:11 2022 -0500 Revert "powerpc/rtas: Implement reentrant rtas call" At the time this was submitted by Leonardo, I confirmed -- or thought I had confirmed -- with PowerVM partition firmware development that the following RTAS functions: - ibm,get-xive - ibm,int-off - ibm,int-on - ibm,set-xive were safe to call on multiple CPUs simultaneously, not only with respect to themselves as indicated by PAPR, but with arbitrary other RTAS calls: https://lore.kernel.org/linuxppc-dev/875zcy2v8o.fsf@linux.ibm.com/ Recent discussion with firmware development makes it clear that this is not true, and that the code in commit b664db8e3f97 ("powerpc/rtas: Implement reentrant rtas call") is unsafe, likely explaining several strange bugs we've seen in internal testing involving DLPAR and LPM. These scenarios use ibm,configure-connector, whose internal state can be corrupted by the concurrent use of the "reentrant" functions, leading to symptoms like endless busy statuses from RTAS. Fixes: b664db8e3f97 ("powerpc/rtas: Implement reentrant rtas call") Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Nathan Lynch Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220907220111.223267-1-nathanl@linux.ibm.com commit 7984b43542070f5888546d95b48003c4a8af7c0f Author: Lyude Paul Date: Wed Sep 14 05:34:49 2022 -0700 Input: synaptics - enable InterTouch for the ThinkPad P1 G3 Noticed this while trying to debug some unrelated issues: this laptop has the ability to use rmi4 but doesn't by default. So let's fix that. Tested locally, including mouse buttons, on my ThinkPad P1 G3. This might also enable the X1 Extreme G3, but I don't have such a system to test locally (presumably Mark can chime in if that's the case). Signed-off-by: Lyude Paul Link: https://lore.kernel.org/r/20220909202127.141761-1-lyude@redhat.com Signed-off-by: Dmitry Torokhov commit 94bc967b8d3b9cc7e69094aa7fc99dbb9036d727 Merge: 3f668365bcd8d 9d9292576810d Author: Linus Walleij Date: Wed Sep 14 14:28:47 2022 +0200 Merge tag 'samsung-pinctrl-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v6.1 1. Minor fix in order of initializing pinctrl driver - GPIOs should be configured before registering gpiolib. 2. Final steps to deprecated bindings headers with register constants. The constants were moved to include files in DTS directories, because these are not suitable for bindings. Remove final references and mark binding header as deprecated to warn any users. commit 3f668365bcd8d17b4bcd0fdb62e5c748753196ec Author: Colin Foster Date: Fri Sep 9 08:38:02 2022 -0700 pinctrl: ocelot: add help and description information to ocelot pinctrl kconfig Add missed help information and module export name to the Microsemi Ocelot and Jaguar2 SoC. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20220909153802.3370088-1-colin.foster@in-advantage.com Signed-off-by: Linus Walleij commit f7d619e9ab851eb89ab50c9265504ed732d5bee2 Author: Sergio Paracuellos Date: Tue Sep 13 18:46:39 2022 +0200 gpio: mt7621: Switch to use platform_get_irq() function Mt7621 SoC GPIO driver is a platform driver so we can directly use 'platform_get_irq' instead of 'irq_of_parse_and_map'. Tested-by: Arınç ÜNAL Signed-off-by: Sergio Paracuellos Signed-off-by: Bartosz Golaszewski commit 6d50b79051edc298aba7f60184d9b2fb673f0628 Author: Nate Drude Date: Tue Sep 13 13:24:36 2022 -0500 gpio: pca953x: introduce support for nxp,pcal6408 The NXP PCAL6408 is the 8-bit version of PCAL6416. Signed-off-by: Nate Drude Signed-off-by: Bartosz Golaszewski commit 7bbf66e1b7b76d2487ceed51522669ab64057c06 Author: Nate Drude Date: Tue Sep 13 13:24:35 2022 -0500 dt-bindings: gpio: pca95xx: add entry for pcal6408 The NXP PCAL6408 is the 8-bit version of PCAL6416. Signed-off-by: Nate Drude Signed-off-by: Bartosz Golaszewski commit 09b71adab09570fcc715ff31a6835d0e445e4a54 Author: Xu Panda Date: Mon Sep 12 09:17:19 2022 +0000 selinux: remove the unneeded result variable Return the value avc_has_perm() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Xu Panda [PM: subject line tweak] Signed-off-by: Paul Moore commit 1e7d8bcbe37d3c63babe628443f13f77970dd06b Author: Nathan Lynch Date: Thu Sep 8 17:02:22 2022 -0500 lockdown: ratelimit denial messages User space can flood the log with lockdown denial messages: [ 662.555584] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 [ 662.563237] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 [ 662.571134] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 [ 662.578668] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 [ 662.586021] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 [ 662.593398] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7 Ratelimiting these shouldn't meaningfully degrade the quality of the information logged. Signed-off-by: Nathan Lynch Signed-off-by: Paul Moore commit 3f1a3a28e9e00a84705b62f0fdc5e31d0f935615 Merge: a108772d03d8b 4f96b1bc156e7 Author: Maxime Ripard Date: Wed Sep 14 12:27:09 2022 +0100 Merge tag 'backlight-detect-refactor-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into drm-misc-next Immutable backlight-detect-refactor branch between acpi, drm-* and pdx86 Tag (immutable branch) with v6.0-rc1 + the (acpi/x86) backlight detect refactor work. For merging into the acpi, drm-* and pdx86 subsystems. Signed-off-by: Maxime Ripard # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmMVsogUHGhkZWdvZWRl # QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9yy6wgAlig+7hkq940L62lTpj0g2gNQv8zc # HCsMpnU7dnJcZYaEvIjouZhf33ZbN52c0fQq2JWjt7fFX04LLyIiyrJ26Lc293JR # ++yXpJcVoewRGqApy/P3Z05TKUCLll5bexvK4t8isnhOtEXD/nDPWKTLIV2Kd1DK # nLY4KgRznXZ85RhYheUEdidZ7Lwlzt1JVBMq7tpnzu3nVdDExyZmqlqCUITcLynu # ysuASQGr0D2i+1vb9eifHIA3xsQO0S37Bv62aBMBKxB6B8Fz1DYr8VA2YvoT82Hv # IFT0hzCCZ/63Ljga05O78TwraxAQX0RvZWqjqGgnZg6fIBh2hxUiqeQY6g== # =SA1R # -----END PGP SIGNATURE----- # gpg: Signature made Mon 05 Sep 2022 09:25:44 AM IST # gpg: using RSA key BAF03B5D2718411A5E9E177E92EC4779440327DC # gpg: issuer "hdegoede@redhat.com" # gpg: Can't check signature: No public key From: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/261afe3d-7790-e945-adf6-a2c96c9b1eff@redhat.com commit a108772d03d8bdb43258218b00bfe43bbe1e8800 Merge: 75cebd664d57a 213cb76ddc8b8 Author: Maxime Ripard Date: Wed Sep 14 12:22:18 2022 +0100 Merge drm/drm-next into drm-misc-next We need 6.0-rc1 to merge the backlight rework PR. Signed-off-by: Maxime Ripard commit 42b2bdc8c478a705a9642c85d8b3802f5516447d Author: Chris Wilson Date: Tue Sep 13 17:21:51 2022 +0200 drm/i915/selftest: Clear the output buffers before GPU writes When testing whether we can get the GPU to leak information about non-privileged state, we first need to ensure that the output buffer is set to a known value as the HW may opt to skip the write into memory for a non-privileged read of a sensitive register. We chose POISON_INUSE (0x5a) so that is both non-zero and distinct from the poison values used during the test. v2: Use i915_gem_object_pin_map_unlocked Reported-by: CQ Tang Signed-off-by: Chris Wilson Cc: CQ Tang cc: Joonas Lahtinen Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Signed-off-by: Karolina Drobnik Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/5cebab02d182c171cf40cb5b73d6c3eeb7619360.1663081418.git.karolina.drobnik@intel.com commit 25e4b26672a0908078e10733eb20efa20800e534 Author: Chris Wilson Date: Tue Sep 13 17:21:50 2022 +0200 drm/i915/selftest: Always cancel semaphore on error Ensure that we always signal the semaphore when timing out, so that if it happens to be stuck waiting for the semaphore we will quickly recover without having to wait for a reset. Reported-by: CQ Tang Signed-off-by: Chris Wilson Cc: CQ Tang cc: Joonas Lahtinen Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Signed-off-by: Karolina Drobnik Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/8b7781f7dbaf2791156491b76d5faa7852e5cbbb.1663081418.git.karolina.drobnik@intel.com commit a062b8cf811d49b7ba7203d0ec5bd9fe0b61c66e Author: Chris Wilson Date: Tue Sep 13 17:21:49 2022 +0200 drm/i915/selftests: Check for incomplete LRI from the context image In order to keep the context image parser simple, we assume that all commands follow a similar format. A few, especially not MI commands on the render engines, have fixed lengths not encoded in a length field. This caused us to incorrectly skip over 3D state commands, and start interpreting context data as instructions. Eventually, as Daniele discovered, this would lead us to find addition LRI as part of the data and mistakenly add invalid LRI commands to the context probes. Stop parsing after we see the first !MI command, as we know we will have seen all the context registers by that point. (Mostly true for all gen so far, though the render context does have LRI after the first page that we have been ignoring so far. It would be useful to extract those as well so that we have the full list of user accessible registers.) Similarly, emit a warning if we do try to emit an invalid zero-length LRI. Testcase: igt@i915_selftest@live@gt_lrc Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6580 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6670 Reported-by: Daniele Ceraolo Spurio Signed-off-by: Chris Wilson Cc: Daniele Ceraolo Spurio Signed-off-by: Ramalingam C Acked-by: Thomas Hellstrom Signed-off-by: Karolina Drobnik Reviewed-by: Gwan-gyeong Mun Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/7377cb3b371a983dce02be69f6611fcf85c822bb.1663081418.git.karolina.drobnik@intel.com commit c9424fa1f856eaf09e09a3381fe998dd6f905bfc Author: Chris Wilson Date: Tue Sep 13 17:21:48 2022 +0200 drm/i915/gt: Explicitly clear BB_OFFSET for new contexts Even though the initial protocontext we load onto HW has the register cleared, by the time we save it into the default image, BB_OFFSET has had the enable bit set. Reclear BB_OFFSET for each new context. Testcase: igt/i915_selftests/gt_lrc v2: Extend it for gen8. v3: BB_OFFSET is recorded per engine from Gen9 onwards Signed-off-by: Chris Wilson Cc: Mika Kuoppala Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Signed-off-by: Karolina Drobnik Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/37c67abb3303852f06a570a4360addf52bf941c1.1663081418.git.karolina.drobnik@intel.com commit 627a78b2dec669c4efa216d827341c948eb3f42d Merge: a7c9986880b00 35ca91d1338ae Author: Ulf Hansson Date: Wed Sep 14 12:51:04 2022 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.0rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.1. Signed-off-by: Ulf Hansson commit 797b84517c190053597e3f7e03ead15da872e04d Author: Oliver Upton Date: Tue Sep 13 09:44:40 2022 +0000 KVM: selftests: Add test for AArch32 ID registers Add a test to assert that KVM handles the AArch64 views of the AArch32 ID registers as RAZ/WI (writable only from userspace). For registers that were already hidden or unallocated, expect RAZ + invariant behavior. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-8-oliver.upton@linux.dev commit d5efec7ed826b3b29c6847bf59383d8d07347a4e Author: Oliver Upton Date: Tue Sep 13 09:44:39 2022 +0000 KVM: arm64: Treat 32bit ID registers as RAZ/WI on 64bit-only system One of the oddities of the architecture is that the AArch64 views of the AArch32 ID registers are UNKNOWN if AArch32 isn't implemented at any EL. Nonetheless, KVM exposes these registers to userspace for the sake of save/restore. It is possible that the UNKNOWN value could differ between systems, leading to a rejected write from userspace. Avoid the issue altogether by handling the AArch32 ID registers as RAZ/WI when on an AArch64-only system. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-7-oliver.upton@linux.dev commit 4de06e4c1dc949c35c16e4423b4ccd735264b0a9 Author: Oliver Upton Date: Tue Sep 13 09:44:38 2022 +0000 KVM: arm64: Add a visibility bit to ignore user writes We're about to ignore writes to AArch32 ID registers on AArch64-only systems. Add a bit to indicate a register is handled as write ignore when accessed from userspace. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-6-oliver.upton@linux.dev commit 5d9a718b64e428a40939806873ecf16f072008b3 Author: Oliver Upton Date: Tue Sep 13 09:44:37 2022 +0000 KVM: arm64: Spin off helper for calling visibility hook No functional change intended. Reviewed-by: Reiji Watanabe Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-5-oliver.upton@linux.dev commit cdd5036d048ca96ef5212fb37f4f56db40cb1bc2 Author: Oliver Upton Date: Tue Sep 13 09:44:36 2022 +0000 KVM: arm64: Drop raz parameter from read_id_reg() There is no longer a need for caller-specified RAZ visibility. Hoist the call to sysreg_visible_as_raz() into read_id_reg() and drop the parameter. No functional change intended. Suggested-by: Reiji Watanabe Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-4-oliver.upton@linux.dev commit 4782ccc8ef50fabb70bab9fa73186285dba6d91d Author: Oliver Upton Date: Tue Sep 13 09:44:35 2022 +0000 KVM: arm64: Remove internal accessor helpers for id regs The internal accessors are only ever called once. Dump out their contents in the caller. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-3-oliver.upton@linux.dev commit 34b4d20399e6fad2e3379b11e68dff1d1549274e Author: Oliver Upton Date: Tue Sep 13 09:44:34 2022 +0000 KVM: arm64: Use visibility hook to treat ID regs as RAZ The generic id reg accessors already handle RAZ registers by way of the visibility hook. Add a visibility hook that returns REG_RAZ unconditionally and throw out the RAZ specific accessors. Reviewed-by: Reiji Watanabe Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220913094441.3957645-2-oliver.upton@linux.dev commit 95589cec1cbfe260ab03281c310e4c3a5947c84d Author: Swati Sharma Date: Sat Sep 3 00:36:58 2022 +0530 drm/i915/dsc: convert dsc debugfs entry from output_bpp to input_bpc Convert dsc debugfs entry from output_bpp to input_bpc. The rationale is to validate different input bpc across various platforms. v2: -improved commit message (Jani N) -styling fixes (Jani N) Signed-off-by: Swati Sharma Reviewed-by: Manasi Navare Acked-by: Jani Nikula Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220902190658.9459-2-swati2.sharma@intel.com commit ee83ef13dc405f6b55ad8d931cd0df9dee3a8ae8 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:39 2022 +0200 dt-bindings: pinctrl: qcom,sc8280xp-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-34-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 3fb7fe5d3a3ee76416f862ea25c275357820b294 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:38 2022 +0200 dt-bindings: pinctrl: qcom,sc8280xp-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-33-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 22b4fb602283e6f8807225d84a7918fd2961bff5 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:37 2022 +0200 dt-bindings: pinctrl: qcom,sc8280xp-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-32-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 31fb6fc82f6a63df9543f247743e894ac453ac0c Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:36 2022 +0200 dt-bindings: pinctrl: qcom,sc8180x-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-31-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit c21692d5f81dd7153244f82c1bd127603e59c24d Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:35 2022 +0200 dt-bindings: pinctrl: qcom,sc8180x-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-30-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 985ea2c8d8bc33eca2ba8455f64e83148c3693e8 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:34 2022 +0200 dt-bindings: pinctrl: qcom,sc8180x-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-29-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 44208c8238ea49c1ff827780a08c142a82517190 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:33 2022 +0200 dt-bindings: pinctrl: qcom,sc7280-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-28-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 94a0cf14d7d52cb5889a6058bb98d541209effd1 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:32 2022 +0200 dt-bindings: pinctrl: qcom,sc7280-pinctrl: reference tlmm schema Qualcomm TLMM pin controller bindings should reference generic TLMM schema (which also pulls generic pinctrl schema). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-27-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 2f23ae0f24f7ced01195d263a1db731a754b6f00 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:31 2022 +0200 dt-bindings: pinctrl: qcom,sc7280-pinctrl: add gpio-line-names Add common gpio-line-names property (used on SC7280 Herobrine boards). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-26-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit c35edcef53f8ca7a07bc4bbe95f756e55a74feb0 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:30 2022 +0200 dt-bindings: pinctrl: qcom,sc7280-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-25-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit b76881c1288eca49c1579ed5f2bf8e6bedf25a2b Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:29 2022 +0200 dt-bindings: pinctrl: qcom,sc7280-pinctrl: correct number of GPIOs There are 182 GPIOs on SC7280. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-24-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 9779ed30f92c47604e40dcd8f20615712f63cbca Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:28 2022 +0200 dt-bindings: pinctrl: qcom,sm8450-pinctrl: add gpio-line-names Add common gpio-line-names property and restrict gpio-reserved-ranges to fixed size. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-23-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 3cf5e17b26593db8a0293704614dd30d938b9a04 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:27 2022 +0200 dt-bindings: pinctrl: qcom,sm8450-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-22-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit fde270ebb7eddf5aeae3e6235afdc92390d4d8f0 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:26 2022 +0200 dt-bindings: pinctrl: qcom,sm8450-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-21-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit d4ac2a2b7c6265156b2df6b4841e7f1117638d2b Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:25 2022 +0200 dt-bindings: pinctrl: qcom,sm8450-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: qcom/sm4250-oneplus-billie2.dtb: pinctrl@500000: sdc1-on-state: 'oneOf' conditional failed, one must be fixed: 'pins' is a required property 'clk', 'cmd', 'data', 'rclk' do not match any of the regexes: 'pinctrl-[0-9]+' [[26]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-20-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 34b88934e60e182d78b4e5f22ea8f702dff49f55 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:24 2022 +0200 dt-bindings: pinctrl: qcom,sm8350-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-19-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 2d4e77a71f031928b95c8ab97b8ace0e46c6cc5f Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:23 2022 +0200 dt-bindings: pinctrl: qcom,sm8350-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-18-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit e9668427de337c67b1e18e9e1979180514631440 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:22 2022 +0200 dt-bindings: pinctrl: qcom,sm8350-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: sm8350-hdk.dtb: pinctrl@f100000: qup-uart3-default-state: 'oneOf' conditional failed, one must be fixed: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-17-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit d70f858f82374021f1d5379a49cb74022a216120 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:21 2022 +0200 dt-bindings: pinctrl: qcom,sm8250-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-16-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 2723c2530c20406425e6e44a29b9e36443e07e42 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:20 2022 +0200 dt-bindings: pinctrl: qcom,sm8250-pinctrl: reference tlmm common pins Each subnode configuring pins (so the final -pins or pinconf) should reference common TLMM pin definition. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-15-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 6e6e1ef6b59d70c289f899d46049ab54bcf3f9c4 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:19 2022 +0200 dt-bindings: pinctrl: qcom,sm8250-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-14-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit e3c2e3840742800131a9530d07e30a809d36dd65 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:18 2022 +0200 dt-bindings: pinctrl: qcom,sm6375-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-13-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit c8441085e2c0e17ef0610ba4ba2da100677ddf41 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:17 2022 +0200 dt-bindings: pinctrl: qcom,sm6375-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-12-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 51af3784f15facb4a011d59721a54a8b4ae2a3ed Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:16 2022 +0200 dt-bindings: pinctrl: qcom,sm6375-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-11-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit dc246ef73f5990b839d30b00d01066d95293aa85 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:15 2022 +0200 dt-bindings: pinctrl: qcom,sm6350-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-10-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 5f3332e9450d2c48c2cfc9d70e96693a890af373 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:14 2022 +0200 dt-bindings: pinctrl: qcom,sm6350-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-9-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 7c291167877809723f990b989a05367565672586 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:13 2022 +0200 dt-bindings: pinctrl: qcom,sm6350-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-8-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 15239930127566a21294df41f9b73ddb5e4011f6 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:12 2022 +0200 dt-bindings: pinctrl: qcom,sm6125-pinctrl: extend example Extend example with children for pin configuration and indent it with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-7-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit d1fc02d47bc4ba291ea85b85031cfa548da65724 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:11 2022 +0200 dt-bindings: pinctrl: qcom,sm6125-pinctrl: do not require function on non-GPIOs Certain pins, like SDcard related, do not have functions and such should not be required: sdc1-clk-pins: 'function' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-6-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 5d66124f619dafc1ca2c5b7b90b3fa355d995fa0 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:10 2022 +0200 dt-bindings: pinctrl: qcom,sm6125-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-5-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 495ffc067c6719f3a1722632455eb6fea9914f70 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:09 2022 +0200 dt-bindings: pinctrl: qcom,sm6115-pinctrl: fix indentation in example Bindings example should be indented with 4-spaces. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Iskren Chernev Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-4-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit b17cf20dfc188f48f2746e1178cfde910cfa3be2 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:08 2022 +0200 dt-bindings: pinctrl: qcom,sm6115-pinctrl: require function on GPIOs Require function on GPIOs (so not on SD card pins). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Iskren Chernev Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-3-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit a21599cf1213ca0bdb002adeb4fa5eade71d106e Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:07 2022 +0200 dt-bindings: pinctrl: qcom,sm6115-pinctrl: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: 'pins' is a required property 'function' is a required property 'rx', 'tx' do not match any of the regexes: 'pinctrl-[0-9]+' [[59]] is not of type 'object' Make the schema stricter and expect such nodes to be followed with a '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Iskren Chernev Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-2-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit d56111ed58482de0045e1e1201122e6e71516945 Author: Jeff LaBundy Date: Thu Sep 8 14:24:35 2022 -0700 Input: iqs7222 - set all ULP entry masks by default Some devices expose an ultra-low-power (ULP) mode entry mask for each channel. If the mask is set, the device cannot enter ULP so long as the corresponding channel remains in an active state. The vendor has advised setting the mask for any disabled channel. To accommodate this suggestion, initially set all masks and then clear them only if specified in the device tree. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220908131548.48120-8-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 514c13b1faed74e9bc19061b6d7c78d53a3402ba Author: Jeff LaBundy Date: Thu Sep 8 14:24:24 2022 -0700 Input: iqs7222 - avoid sending empty SYN_REPORT events Add a check to prevent sending undefined events, which ultimately map to SYN_REPORT. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220908131548.48120-7-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 10e629d31aacb2348a1e9110c31a29e98b31ce38 Author: Jeff LaBundy Date: Thu Sep 8 14:22:46 2022 -0700 Input: iqs7222 - trim force communication command According to the datasheets, writing only 0xFF is sufficient to elicit a communication window. Remove the superfluous 0x00 from the force communication command. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220908131548.48120-6-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 55cafd4ba42cf495268f955dd38e277fc4b4381e Author: Nathan Chancellor Date: Mon Sep 12 07:15:53 2022 -0700 power: supply: bq25890: Fix enum conversion in bq25890_power_supply_set_property() Clang warns: drivers/power/supply/bq25890_charger.c:625:40: error: implicit conversion from enumeration type 'enum bq25890_fields' to different enumeration type 'enum bq25890_table_ids' [-Werror,-Wenum-conversion] lval = bq25890_find_idx(val->intval, F_IINLIM); ~~~~~~~~~~~~~~~~ ^~~~~~~~ 1 error generated. Use the proper value from the right enumerated type, TBL_IINLIM, so there is no more implcit conversion. The numerical values of F_IINLIM and TBL_IINLIM happen to be the same so there is no change in behavior. Fixes: 4a4748f28b0b ("power: supply: bq25890: Add support for setting IINLIM") Link: https://github.com/ClangBuiltLinux/linux/issues/1707 Signed-off-by: Nathan Chancellor Reviewed-by: Marek Vasut Signed-off-by: Sebastian Reichel commit a7c9986880b00d7088bf115439273f856a681f60 Author: Iskren Chernev Date: Sat Sep 10 17:32:09 2022 +0300 dt-bindings: mmc: sdhci-msm: Add pinctrl-1 property Most mmc blocks contain two pinctrls, default and sleep. But then dt-schema complains about pinctrl-1 not being defined. Signed-off-by: Iskren Chernev Acked-by: Krzysztof Kozlowski Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220910143213.477261-6-iskren.chernev@gmail.com Signed-off-by: Ulf Hansson commit bef828700337b55e407afb1fffb9da6cc7753896 Author: Johan Jonker Date: Sat Sep 10 00:02:14 2022 +0200 dt-bindings: mmc: rockchip: add rockchip,rk3128-dw-mshc Add rockchip,rk3128-dw-mshc compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/f2cb42c8-3664-a2d5-074d-5c9a10c693e8@gmail.com Signed-off-by: Ulf Hansson commit 1de7307270f5f203c511d4b69da1ae4eba412463 Author: Lad Prabhakar Date: Wed Aug 31 22:43:14 2022 +0100 dt-bindings: mmc: renesas,sdhi: Add iommus property The SDHI blocks on Renesas R-Car and RZ/G2 SoCs make use of IOMMU. This patch fixes the below dtbs_check warnings: arch/arm64/boot/dts/renesas/r8a774e1-hihope-rzg2h-ex-idk-1110wr.dtb: mmc@ee100000: Unevaluated properties are not allowed ('iommus' was unexpected) From schema: Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220831214314.7794-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Ulf Hansson commit c0470f430bf8fa8ac1954241757e83f3f0809d06 Author: ye xingchen Date: Tue Aug 30 08:33:49 2022 +0000 mmc: sdhci_am654: Remove the unneeded result variable Return the value cqhci_init() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220830083349.276709-1-ye.xingchen@zte.com.cn Signed-off-by: Ulf Hansson commit 066ecde6d826b443f492570e080cba3f2212280d Author: Heiner Kallweit Date: Thu Aug 25 21:56:19 2022 +0200 mmc: meson-gx: add SDIO interrupt support Add SDIO interrupt support. Successfully tested on a S905X4-based system (V3 register layout) with a BRCM4334 SDIO wifi module (brcmfmac driver). Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/27bffe3c-e579-3581-95e8-2587733487d2@gmail.com Signed-off-by: Ulf Hansson commit 6f6fac8af6be0fe8af147ab09b81d7e9d84722ce Author: Heiner Kallweit Date: Thu Aug 25 21:53:42 2022 +0200 mmc: meson-gx: adjust and re-use constant IRQ_EN_MASK Constant IRQ_EN_MASK has no user currently. In preparation of adding SDIO interrupt support, revive it and adjust it to our needs. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/8056622f-2adf-4763-7423-9ccdf4ca78e1@gmail.com Signed-off-by: Ulf Hansson commit 8827f85e3010a26b18ab7401e535c80b0d023ce0 Author: Jack Wang Date: Thu Aug 25 09:40:08 2022 +0200 mmc: jz4740_mmc: Fix error check for dma_map_sg dma_map_sg return 0 on error. Signed-off-by: Jack Wang Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/20220825074008.33349-3-jinpu.wang@ionos.com Signed-off-by: Ulf Hansson commit f7865ad8b4003ec75faf4a69363a804851b68c7d Author: Jack Wang Date: Thu Aug 25 09:40:07 2022 +0200 mmc: meson-mx-sdhc: Fix error check for dma_map_sg dma_map_sg return 0 on error, also change the type for dma_len from int to unsigned int. Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Signed-off-by: Jack Wang Link: https://lore.kernel.org/r/20220825074008.33349-2-jinpu.wang@ionos.com Signed-off-by: Ulf Hansson commit 5cbedf52608cc3cbc1c2a9a861fb671620427a20 Author: Christophe JAILLET Date: Thu Aug 25 09:33:57 2022 +0200 mmc: au1xmmc: Fix an error handling path in au1xmmc_probe() If clk_prepare_enable() fails, there is no point in calling clk_disable_unprepare() in the error handling path. Move the out_clk label at the right place. Fixes: b6507596dfd6 ("MIPS: Alchemy: au1xmmc: use clk framework") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/21d99886d07fa7fcbec74992657dabad98c935c4.1661412818.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit af51ef51a8df42de64d643c50cf7d5925fb76df0 Author: Apurva Nandan Date: Sat Aug 20 00:37:28 2022 +0530 dt-bindings: mmc: Fix 'dma-coherent' was unexpected dma-coherent is mentioned in almost all TI K3 platform mmc nodes. Fix warning generated due to its missing match in yaml schema. Signed-off-by: Apurva Nandan Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220819190729.32358-3-a-nandan@ti.com Signed-off-by: Ulf Hansson commit 1dd611a9c55f6657328429b988e302323691c3dc Author: Heiner Kallweit Date: Fri Aug 19 23:26:17 2022 +0200 mmc: core: Switch to basic workqueue API for sdio_irq_work The delay parameter isn't set by any user, therefore simplify the code and switch to the basic workqueue API w/o delay support. This also reduces the size of struct mmc_host. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/13d8200a-e2a8-d907-38ce-a16fc5ce14aa@gmail.com Signed-off-by: Ulf Hansson commit 896691f010149e05ea3c5a0c361cbdb250617859 Author: Adam Skladowski Date: Mon Aug 15 12:09:41 2022 +0200 dt-bindings: mmc: sdhci-msm: Document the SM6115 compatible Document the compatible for SDHCI on SM6115. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220815100952.23795-4-a39.skl@gmail.com Signed-off-by: Ulf Hansson commit 95cfadfd001a3ab60c43291f30a8c4a0de4f6b41 Author: Adrian Hunter Date: Mon Aug 15 13:59:05 2022 +0300 mmc: sdhci: Update MAINTAINERS Maintained -> Supported Currently, status is "Supported" not "Maintained" for SDHCI and CQHCI. Amend MAINTAINERS accordingly. Signed-off-by: Adrian Hunter Link: https://lore.kernel.org/r/20220815105905.65188-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 3ea35076b9039c73ab53385c069512fd82b75933 Author: Conor Dooley Date: Thu Aug 11 21:40:24 2022 +0100 dt-bindings: mmc: cdns: remove Piotr Sroka as a maintainer Mails to Piotr bounce with a :550 5.1.1 User Unknown and the last mention of him on lore is the orphaning of Cadence NFC drivers. Remove him from the binding too. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220811204024.182453-1-mail@conchuod.ie Signed-off-by: Ulf Hansson commit 55e7dceee83ca6584a08bd876ed0ec38de5b13ce Author: AngeloGioacchino Del Regno Date: Fri Jul 29 12:44:34 2022 +0200 dt-bindings: mmc: Add compatible for MT6795 Helio X10 SoC Add a compatible string for the MT6795 SoC's mtk-sd mmc controllers. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220729104441.39177-3-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit 5f818d411cf31c6f015b0cb1248f75ffa438e149 Author: Krzysztof Kozlowski Date: Wed Jul 27 18:42:02 2022 +0200 dt-bindings: mmc: mmc-spi-slot: drop unneeded spi-max-frequency spi-max-frequency comes from spi-peripheral-props.yaml. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220727164202.385531-1-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson commit 50aecccc3e6557b29e7a5d9a28f013fc68ebfb99 Author: Chevron Li Date: Fri Jul 29 03:05:24 2022 -0700 mmc: sdhci-pci-o2micro: fix some SD cards compatibility issue at DDR50 mode Bayhub chips have better compatibility support for SDR50 than DDR50 and both mode have the same R/W performance when clock frequency >= 100MHz. Disable DDR50 mode and use SDR50 instead. Signed-off-by: Chevron Li Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220729100524.387-1-chevron.li@bayhubtech.com Signed-off-by: Ulf Hansson commit 524836095d91da8e89e3204dd7419a341fea79f9 Author: Bhupesh Sharma Date: Tue Jul 26 14:15:20 2022 +0530 dt-bindings: mmc: Set maximum documented operating frequency as 384MHz As Ulf noted in [1], the maximum operating frequency documented in the mmc-controller device-tree bindings should be updated to the maximum frequency supported by the mmc controller(s). Without this fix in place, the 'make dtbs_check' reports issues with 'max-frequency' value for ipq8074 sdhci node: arch/arm64/boot/dts/qcom/ipq8074-hk01.dtb: mmc@7824900: max-frequency:0:0: 384000000 is greater than the maximum of 200000000 [1]. https://www.spinics.net/lists/kernel/msg4442049.html Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220726084520.2895454-1-bhupesh.sharma@linaro.org Signed-off-by: Ulf Hansson commit fbb0ec656ee5ee43b4b3022fd8290707265c52df Author: Judy Hsiao Date: Wed Sep 14 03:12:34 2022 +0000 ASoC: rockchip: i2s: use regmap_read_poll_timeout to poll I2S_CLR Use regmap_read_poll_timeout to poll I2S_CLR. It also fixes the 'rockchip-i2s ff070000.i2s; fail to clear' when the read of I2S_CLR exceeds the retry limit. Fixes: 0ff9f8b9f592 ("ASoC: rockchip: i2s: Fix error code when fail to read I2S_CLR") Signed-off-by: Judy Hsiao Reviewed-by: Brian Norris Link: https://lore.kernel.org/r/20220914031234.2250298-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 3e9a838634b181b5775d3459f05c2055d24d080a Author: Fabio Estevam Date: Tue Sep 13 20:17:06 2022 -0300 ASoC: tas2562: Propagate the error in tas2562_dac_event() Since commit 2848d34c3ba1 ("ASoC: tas2562: Fix mute/unmute") the following build warning is seen: sound/soc/codecs/tas2562.c:442:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Fix the warning by returning the 'ret' variable. Fixes: 2848d34c3ba1 ("ASoC: tas2562: Fix mute/unmute") Signed-off-by: Fabio Estevam Reviewed-by: Martin Povišer Link: https://lore.kernel.org/r/20220913231706.516849-1-festevam@gmail.com Signed-off-by: Mark Brown commit 3a5247120668041c8e9eb190497296656b66bf9a Author: Hugh Cole-Baker Date: Tue Oct 19 22:58:43 2021 +0100 arm64: dts: rockchip: enable gamma control on RK3399 Define the memory region on RK3399 VOPs containing the gamma LUT at base+0x2000. Signed-off-by: Hugh Cole-Baker Tested-by: Linus Heckemann Link: https://lore.kernel.org/r/20211019215843.42718-4-sigmaris@gmail.com Signed-off-by: Heiko Stuebner commit 0209861877531ae0744552f3fd0531303d665b52 Author: Furkan Kardame Date: Mon Jun 27 23:22:08 2022 +0300 arm64: dts: rockchip: Enable video output on rk3566-roc-pc Add the device tree nodes to enable video output on the Station M2. Enable the GPU and HDMI nodes and fix the GPU regulator range. Signed-off-by: Furkan Kardame Link: https://lore.kernel.org/r/20220627202208.45770-1-f.kardame@manjaro.org Signed-off-by: Heiko Stuebner commit adc4f190260a6c004f950992d8c9ee3aec8da38b Author: Johan Jonker Date: Sat Sep 10 00:01:39 2022 +0200 dt-bindings: soc: rockchip: grf: add rockchip,rk3128-grf Add rockchip,rk3128-grf compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/fddc23ff-0c87-4998-1bdf-4dbfa4c74046@gmail.com Signed-off-by: Heiko Stuebner commit 9c2f4521344f3b14fa0be050100ef726edc36cbc Author: Johan Jonker Date: Sat Sep 10 00:01:52 2022 +0200 dt-bindings: arm: rockchip: pmu: add rockchip,rk3128-pmu Add rockchip,rk3128-pmu compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/faf2b30e-1a1a-0dc1-04ce-f40e5d758718@gmail.com Signed-off-by: Heiko Stuebner commit d39fb172760e426e0628f16b785c85e16d17bd5e Author: Conor Dooley Date: Thu Sep 8 15:36:51 2022 +0100 clk: microchip: add PolarFire SoC fabric clock support Add a driver to support the PLLs in PolarFire SoC's Clock Conditioning Circuitry, an instance of which is located in each ordinal corner of the FPGA. Only get_rate() is supported as these clocks are intended to be statically configured by the FPGA design. Currently, the DLLs are not supported by this driver. For more information on the hardware, see "PolarFire SoC FPGA Clocking Resources" in the link below. Link: https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE7773ED1931-en-US-1/index.html Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220908143651.1252601-5-conor.dooley@microchip.com commit b4b025246c0fbb8611a26bab121596f47f0bf116 Author: Conor Dooley Date: Thu Sep 8 15:36:50 2022 +0100 dt-bindings: clk: add PolarFire SoC fabric clock ids Each Clock Conditioning Circuitry block contains 2 PLLs and 2 DLLs. The PLLs have 4 outputs each and the DLLs 2. Add 16 new IDs covering these clocks. For more information on the CCC hardware, see the "PolarFire SoC FPGA Clocking Resources" document at the link below. Link: https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE7773ED1931-en-US-1/index.html Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220908143651.1252601-4-conor.dooley@microchip.com commit 3ffb5ad24d0064f923ed30ad37e33e56eee31f2b Author: Conor Dooley Date: Thu Sep 8 15:36:49 2022 +0100 dt-bindings: clk: document PolarFire SoC fabric clocks On PolarFire SoC there are 4 PLL/DLL blocks, located in each of the ordinal corners of the chip, which our documentation refers to as "Clock Conditioning Circuitry". PolarFire SoC is an FPGA, these are highly configurable & many of the input clocks are optional. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220908143651.1252601-3-conor.dooley@microchip.com commit 803307a452e787af92789db16a156c35e60f8aaf Author: Conor Dooley Date: Thu Sep 8 15:36:48 2022 +0100 dt-bindings: clk: rename mpfs-clkcfg binding The filename for a binding is supposed to match the first compatible, but the mpfs-clkcfg file did not follow this policy. Rename it to match so that when other mpfs clock bindings are added things make more sense. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220908143651.1252601-2-conor.dooley@microchip.com commit d325268b4f8c791cabf08b03d96a2cfc0e3c5d69 Author: Conor Dooley Date: Fri Sep 9 13:31:23 2022 +0100 clk: microchip: mpfs: update module authorship & licencing Padmarao wrote the driver in its original, pre upstream form. Daire & myself have been responsible for getting it upstreamable and subsequent development. Move Daire out of the blurb & into a MODULE_AUTHOR entry & add entries for myself and Padmarao. While we are at it, convert the MODULE_LICENSE field to its preferred form of "GPL". Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-15-conor.dooley@microchip.com commit d815569783e6546f55159a1c9dd9685a11888fad Author: Conor Dooley Date: Fri Sep 9 13:31:22 2022 +0100 clk: microchip: mpfs: convert periph_clk to clk_gate With the reset code moved to the recently added reset controller, there is no need for custom ops any longer. Remove the custom ops and the custom struct by converting to a clk_gate. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-14-conor.dooley@microchip.com commit 4da2404bb003f248b161b00b308929f0509fb420 Author: Conor Dooley Date: Fri Sep 9 13:31:21 2022 +0100 clk: microchip: mpfs: convert cfg_clk to clk_divider The cfg_clk struct is now just a redefinition of the clk_divider struct with custom implentations of the ops, that implement an extra level of redirection. Remove the custom struct and replace it with clk_divider. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-13-conor.dooley@microchip.com commit e7df7ba08c647d1d3aba1d33d12db64a25e0a5b4 Author: Conor Dooley Date: Fri Sep 9 13:31:20 2022 +0100 clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo() The register functions are now comprised of only a single operation each and no longer add anything to the driver. Delete them. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-12-conor.dooley@microchip.com commit 5fa27b77a14041d709edcd4497d419b78aa00849 Author: Conor Dooley Date: Fri Sep 9 13:31:19 2022 +0100 clk: microchip: mpfs: simplify control reg access The control reg addresses are known when the clocks are registered, so we can, instead of assigning a base pointer to the structs, assign the control reg addresses directly. Accordingly, remove the interim variables used during reads/writes to those registers. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-11-conor.dooley@microchip.com commit 52fe6b5293073be8a9c9c0b45424b596d11e4c6e Author: Conor Dooley Date: Fri Sep 9 13:31:18 2022 +0100 clk: microchip: mpfs: move id & offset out of clock structs The id and offset are the only thing differentiating the clock structs from "regular" clock structures. On the pretext of converting to more normal structures, move the id and offset out of the clock structs and into the hw structs instead. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-10-conor.dooley@microchip.com commit 14016e4aafc5f157c10fb1a386fa3b3bd9c30e9a Author: Conor Dooley Date: Fri Sep 9 13:31:17 2022 +0100 clk: microchip: mpfs: add MSS pll's set & round rate The MSS pll is not a fixed frequency clock, so add set() & round_rate() support. Control is limited to a 7 bit output divider as other devices on the FPGA occupy the other three outputs of the PLL & prevent changing the multiplier. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-9-conor.dooley@microchip.com commit 356a5048e413241f9b4719254d7556f32cad845d Author: Conor Dooley Date: Fri Sep 9 13:31:15 2022 +0100 MAINTAINERS: add polarfire soc reset controller Add the newly added reset controller for the PolarFire SoC (MPFS) to the existing MAINTAINERS entry. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-7-conor.dooley@microchip.com commit 05f9e36370c1517c8e03325f38910fd7ad30b177 Author: Conor Dooley Date: Fri Sep 9 13:31:14 2022 +0100 reset: add polarfire soc reset support Add support for the resets on Microchip's PolarFire SoC (MPFS). Reset control is a single register, wedged in between registers for clock control. To fit with existed DT etc, the reset controller is created using the aux device framework & set up in the clock driver. Reviewed-by: Philipp Zabel Acked-by: Philipp Zabel Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-6-conor.dooley@microchip.com commit b56bae2dd6fda6baf3bb74af3812676eebdd52f2 Author: Conor Dooley Date: Fri Sep 9 13:31:13 2022 +0100 clk: microchip: mpfs: add reset controller Add a reset controller to PolarFire SoC's clock driver. This reset controller is registered as an aux device and read/write functions exported to the drivers namespace so that the reset controller can access the peripheral device reset register. Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-5-conor.dooley@microchip.com commit 89b16523d949b04c30b91e65bb6f91cac888e062 Author: Conor Dooley Date: Fri Sep 9 13:31:12 2022 +0100 dt-bindings: clk: microchip: mpfs: add reset controller support The "peripheral" devices on PolarFire SoC can be put into reset, so update the device tree binding to reflect the presence of a reset controller. Reviewed-by: Rob Herring Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909123123.2699583-4-conor.dooley@microchip.com commit 7ea519de7186d30d2147dcc11bc249c0a3ce86ff Author: Jerry Ray Date: Fri Sep 9 11:30:22 2022 -0500 dts: arm: at91: Add SAMA5D3-EDS Board The SAMA5D3-EDS board is an Ethernet Development Platform allowing for evaluating many Microchip ethernet switch and PHY products. Various daughter cards can connect via an RGMII connector or an RMII connector. The EDS board is not intended for stand-alone use and has no ethernet capabilities when no daughter board is connected. As such, this device tree is intended to be used with a DT overlay defining the add-on board. To better ensure consistency, some items are defined here as a form of documentation so that all add-on overlays will use the same terms. Link: https://www.microchip.com/en-us/development-tool/SAMA5D3-ETHERNET-DEVELOPMENT-SYSTEM Signed-off-by: Jerry Ray [claudiu.beznea: s/gpio-inputs/gpio-keys in at91-sama5d3_eds.dts] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909163022.13022-2-jerry.ray@microchip.com commit af2a5ea3ff8eff40aaa3d8b51f82c6f69a470efd Author: Jerry Ray Date: Fri Sep 9 11:30:21 2022 -0500 dt-bindings: arm: at91: Add info on SAMA5D3-EDS Adding the SAMA5D3-EDS board from Microchip into the atmel AT91 board description yaml file. Signed-off-by: Jerry Ray Acked-by: Krzysztof Kozlowski Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220909163022.13022-1-jerry.ray@microchip.com commit b716f7981e288e1367376903bc948bd9cf404440 Author: Horatiu Vultur Date: Thu Sep 8 09:04:51 2022 +0200 ARM: dts: lan966x: disable aes Disable AES node on lan966x pcb8290, pcb891 and pcb8309 because these boards have lan966x that uses secure OS which reserves the AES block. Therefore it can't be exposed to non-secure world. Signed-off-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220908070451.3730608-1-horatiu.vultur@microchip.com commit dc94156c6694e0ecee32870df94ed8fae07327ca Author: Matthias Kaehlcke Date: Fri Jul 22 09:32:45 2022 -0700 arm64: dts: qcom: sc7280-herobrine: Add nodes for onboard USB hub Add nodes for the onboard USB hub on herobrine devices. Remove the 'always-on' property from the hub regulator, since the regulator is now managed by the onboard_usb_hub driver. This requires "CONFIG_USB_ONBOARD_HUB=y". Signed-off-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220722093238.v24.2.I18481b296484eec47bdc292a31fa46fa8c655ca9@changeid commit a73dd03bb2e0287497f8fe9e221c332369e05fca Author: Matthias Kaehlcke Date: Fri Jul 22 09:32:44 2022 -0700 arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub Add nodes for the onboard USB hub on trogdor devices. Remove the 'always-on' property from the hub regulator, since the regulator is now managed by the onboard_usb_hub driver. For anyone using trogdor-based devices on Linux, it should be noted that this requires "CONFIG_USB_ONBOARD_HUB=y". Signed-off-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220722093238.v24.1.I7a1a6448d50bdd38e6082204a9818c59cc7a9bfd@changeid commit cc02fed341d5f5ea1af531ced213c41a836a3678 Author: Christian Marangi Date: Mon Jul 18 17:38:15 2022 +0200 ARM: dts: qcom: ipq8064: pad addresses to 8 digit Pad reg addresses to 8 digit to make sorting easier. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220718153815.29414-2-ansuelsmth@gmail.com commit ee1e278a84e7578e4aa20820852b7f73b4929c63 Author: Christian Marangi Date: Mon Jul 18 17:38:14 2022 +0200 ARM: dts: qcom: ipq8064: reorganize node order and sort them Reorganize node order and sort them by address. Signed-off-by: Christian Marangi Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220718153815.29414-1-ansuelsmth@gmail.com commit df646a17f103c6f18ab85c5e3773763d18dc528b Author: Konrad Dybcio Date: Sat Jul 16 21:32:01 2022 +0200 soc: qcom: rpmpd: Add SM6375 support Add support for RPMPDs on SM6375. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220716193201.455728-2-konrad.dybcio@somainline.org commit 2d48e6ea3080ef7b2424dabfb500e29b030129d6 Author: Konrad Dybcio Date: Sat Jul 16 21:32:00 2022 +0200 dt-bindings: power: rpmpd: Add SM6375 power domains Add the bindings for SM6375 RPMPDs. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220716193201.455728-1-konrad.dybcio@somainline.org commit 49c19337d0aca2e7f362d3c1a1c6f09c2dcfdae9 Author: Krzysztof Kozlowski Date: Tue Jul 12 16:42:45 2022 +0200 ARM: dts: qcom: align SDHCI clocks with DT schema The DT schema expects clocks iface-core order. No functional change. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220712144245.17417-6-krzysztof.kozlowski@linaro.org commit 5eb82ddb7273bd34a36c05df271f34919eeea675 Author: Krzysztof Kozlowski Date: Tue Jul 12 16:42:44 2022 +0200 ARM: dts: qcom: align SDHCI reg-names with DT schema DT schema requires SDHCI reg names to be hc/core without "_mem" suffix, just like TXT bindings were expecting before the conversion. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220712144245.17417-5-krzysztof.kozlowski@linaro.org commit eddc917dbb7a3ce66ca3154cfa17cd4bdd18c17b Author: Krzysztof Kozlowski Date: Tue Jul 12 16:42:43 2022 +0200 arm64: dts: qcom: align SDHCI reg-names with DT schema DT schema requires SDHCI reg names to be hc/core without "_mem" suffix, just like TXT bindings were expecting before the conversion. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220712144245.17417-4-krzysztof.kozlowski@linaro.org commit f2819650aab5b037e5e730c88abcd971e96a1637 Author: Dmitry Baryshkov Date: Thu Jul 7 16:47:33 2022 +0300 arm64: dts: qcom: sm8250: provide additional MSI interrupts On SM8250 each group of MSI interrupts is mapped to the separate host interrupt. Describe each of interrupts in the device tree for PCIe0 host. Tested on Qualcomm RB5 platform with first group of MSI interrupts being used by the PME and attached ath11k WiFi chip using second group of MSI interrupts. Reviewed-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220707134733.2436629-7-dmitry.baryshkov@linaro.org commit 94a70c873d56e8bb7bce52cfb68d004be174dfff Author: Stephan Gerhold Date: Wed Jul 6 15:41:32 2022 +0200 clk: qcom: smd-rpm: Add clocks for MSM8909 MSM8909 has mostly the same as clocks in RPM as MSM8916, but additionally the QPIC clock for the NAND flash controller. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-7-stephan.gerhold@kernkonzept.com commit 1727a402c1fcf2594923be47ed03fab2db0eacfb Author: Stephan Gerhold Date: Wed Jul 6 15:41:31 2022 +0200 dt-bindings: clock: qcom,rpmcc: Add MSM8909 Document the "qcom,rpmcc-msm8909" compatible for the clocks available via the RPM on the MSM8909 SoC. Signed-off-by: Stephan Gerhold Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-6-stephan.gerhold@kernkonzept.com commit dcc6c9fb712875bf1897eaeb0c9d4e4237861723 Author: Stephan Gerhold Date: Wed Jul 6 15:41:30 2022 +0200 clk: qcom: gcc-msm8909: Increase delay for USB PHY reset The USB PHY on MSM8909 works with the driver used on MSM8916 (phy-qcom-usb-hs.c). When turning the PHY on/off it is first reset using the standard reset controller API. On MSM8916 the reset is provided by the USB driver (ci_hdrc_msm_por_reset() in ci_hdrc_msm.c). While this seems to work on MSM8909 as well, the Qualcomm Linux sources suggest that the PHY should be reset using the GCC_USB2_HS_PHY_ONLY_BCR register instead. In general this is easy to set up in the device tree, thanks to the standard reset controller API. However, to conform to the specifications of the PHY the reset signal should be asserted for at least 10 us. This is handled correctly on MSM8916 in ci_hdrc_msm_por_reset(), but not within the GCC driver. Fix this by making use of the new "udelay" field of qcom_reset_map and set a delay of ~15 us between the assertion/deassertion of the USB PHY reset signal. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-5-stephan.gerhold@kernkonzept.com commit 2cb8a39b6781ea23accd1fa93b3ad000d0948aec Author: Stephan Gerhold Date: Wed Jul 6 15:41:29 2022 +0200 clk: qcom: reset: Allow specifying custom reset delay The amount of time required between asserting and deasserting the reset signal can vary depending on the involved hardware component. Sometimes 1 us might not be enough and a larger delay is necessary to conform to the specifications. Usually this is worked around in the consuming drivers, by replacing reset_control_reset() with a sequence of reset_control_assert(), waiting for a custom delay, followed by reset_control_deassert(). However, in some cases the driver making use of the reset is generic and can be used with different reset controllers. In this case the reset time requirement is better handled directly by the reset controller driver. Make this possible by adding an "udelay" field to the qcom_reset_map that allows setting a different reset delay (in microseconds). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-4-stephan.gerhold@kernkonzept.com commit bf37a05744ebc6a488e3cfd3ec6d502d626740cc Author: Stephan Gerhold Date: Wed Jul 6 15:41:28 2022 +0200 clk: qcom: Add driver for MSM8909 GCC The Global Clock Controller (GCC) in the MSM8909 SoC provides clocks, resets and power domains for the various hardware blocks in the SoC. Add a driver for it to make it possible to enable additional functionality for the SoC. Work on this driver was originally started independently by Dominik, I picked it up and added missing clocks/resets, as well as various cleanup to bring it into shape for mainline. Co-developed-by: Dominik Kobinski Signed-off-by: Dominik Kobinski Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-3-stephan.gerhold@kernkonzept.com commit c40668048f236da6f7725998f93f0d6180003da3 Author: Stephan Gerhold Date: Wed Jul 6 15:41:27 2022 +0200 dt-bindings: clock: Add schema for MSM8909 GCC The Global Clock Controller (GCC) in the MSM8909 SoC provides clocks, resets and power domains for the various hardware blocks in the SoC. Add a DT schema to describe it, similar to other Qualcomm SoCs. Signed-off-by: Stephan Gerhold Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-2-stephan.gerhold@kernkonzept.com commit 157b615066288f84e1812964a439603cfe8c1a19 Author: Dmitry Baryshkov Date: Mon Jul 4 19:11:48 2022 +0300 arm64: dts: qcom: msm8996: add #clock-cells and XO clock to the HDMI PHY node Add #clock-cells property to the HDMI PHY device node to let other nodes resolve the hdmipll clock. While we are at it, also add the XO clock to the device node. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704161148.814510-4-dmitry.baryshkov@linaro.org commit 2e312b3429244eae1b105cb942550f2e5282f887 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:18 2022 +0300 ARM: dts: qcom: msm8960: add clocks to the MMCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the MMCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-16-dmitry.baryshkov@linaro.org commit f79742da254e47d38ea934813fb44a91aa834ee9 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:17 2022 +0300 ARM: dts: qcom: apq8064: add clocks to the MMCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the MMCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-15-dmitry.baryshkov@linaro.org commit 80787e417f3058c6ea59af726e803ca307b67867 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:16 2022 +0300 ARM: dts: qcom: msm8960: add clocks to the GCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the GCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-14-dmitry.baryshkov@linaro.org commit 85ddc865219b04ea7930a8107943fe3c2e3af886 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:15 2022 +0300 ARM: dts: qcom: apq8064: add clocks to the GCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the GCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-13-dmitry.baryshkov@linaro.org commit 6e9b4595609adf4ee97970a84a6eaeb1610aacb3 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:14 2022 +0300 ARM: dts: qcom: msm8960: add clocks to the LCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the LCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-12-dmitry.baryshkov@linaro.org commit 30f17249c171c9ac50e9f6d51c0bb5db1f5b2403 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:13 2022 +0300 ARM: dts: qcom: apq8064: add clocks to the LCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the LCC device tree node. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-11-dmitry.baryshkov@linaro.org commit c3ddc1848c91116aa53197f59e5f503eb6030095 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:12 2022 +0300 clk: qcom: mmcc-msm8960: use parent_hws/_data instead of parent_names Convert the clock driver to specify parent data rather than parent names, to actually bind using 'clock-names' specified in the DTS rather than global clock names. Use parent_hws where possible to refer parent clocks directly, skipping the lookup. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-10-dmitry.baryshkov@linaro.org commit d226c5f07f0adc5dd8eb978d6141cf84b07e6f63 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:11 2022 +0300 clk: qcom: mmcc-msm8960: move clock parent tables down Move clock parent tables down, after the PLL declrataions, so that we can use pll hw clock fields in the next commit. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-9-dmitry.baryshkov@linaro.org commit 53e1409c181db6a0f532ee7d6b4a3be37e51476d Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:10 2022 +0300 clk: qcom: mmcc-msm8960: use ARRAY_SIZE instead of specifying num_parents Use ARRAY_SIZE() instead of manually specifying num_parents. This makes adding/removing entries to/from parent_data easy and errorproof. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-8-dmitry.baryshkov@linaro.org commit a6976f85269063e47e5155e5dcfe826b0a3ac8e7 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:09 2022 +0300 clk: qcom: lcc-msm8960: use parent_hws/_data instead of parent_names Convert the clock driver to specify parent data rather than parent names, to actually bind using 'clock-names' specified in the DTS rather than global clock names. Use parent_hws where possible to refer parent clocks directly, skipping the lookup. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-7-dmitry.baryshkov@linaro.org commit 7026af10aa9196fd08d51eeea81af3de6440c72b Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:08 2022 +0300 clk: qcom: lcc-msm8960: use macros to implement mi2s clocks Split and extend existing CLK_AIF_OSR_DIV macro to implement mi2s clocks. This simplifies the driver and removes extra code duplication. The clock mi2s_div_clk used .enable_reg/.enable_bit, however these fields are not used with by the clk_regmap_div_ops, thus they are silently dropped. Clock enablement is handled in the mi2s_bit_div_clk clock. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-6-dmitry.baryshkov@linaro.org commit e38fc8f036a0b2908721aee9b75864acb8445be4 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:07 2022 +0300 clk: qcom: gcc-msm8960: use parent_hws/_data instead of parent_names Convert the clock driver to specify parent data rather than parent names, to actually bind using 'clock-names' specified in the DTS rather than global clock names. Use parent_hws where possible to refer parent clocks directly, skipping the lookup. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-5-dmitry.baryshkov@linaro.org commit d247abe67bd1a819b87f08fe673081ce5f1fd529 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:06 2022 +0300 clk: qcom: gcc-msm8960: use ARRAY_SIZE instead of specifying num_parents Use ARRAY_SIZE() instead of manually specifying num_parents. This makes adding/removing entries to/from parent_data easy and errorproof. Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-4-dmitry.baryshkov@linaro.org commit 861466d4fbdaa7d5256a116ee2756422a764c938 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:05 2022 +0300 dt-bindings: clocks: qcom,mmcc: define clocks/clock-names for MSM8960 Define clock/clock-names properties of the MMCC device node to be used on MSM8960/APQ8064 platform. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-3-dmitry.baryshkov@linaro.org commit e18e181ca542ecd56a1415fdff7d4609d400b756 Author: Dmitry Baryshkov Date: Thu Jun 23 15:04:04 2022 +0300 dt-bindings: clocks: qcom,gcc-apq8064: define clocks/-names properties Define clock/clock-names properties of the GCC device node to be used on MSM8960/APQ8064 platforms. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Tested-by: David Heidelberg # tested on Nexus 7 (2013) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220623120418.250589-2-dmitry.baryshkov@linaro.org commit b504af6c9912502efa9af162b50cd589351b6894 Author: Yassine Oudjana Date: Wed Jun 22 20:13:22 2022 +0400 arm64: dts: qcom: Use WCD9335 DT bindings Replace DAI indices in codec nodes with definitions from the WCD9335 DT bindings for devices that use WCD9335. Signed-off-by: Yassine Oudjana Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220622161322.168017-4-y.oudjana@protonmail.com commit 171ee3abf30c2ec97516895b12acbd16d4b8f237 Author: Li Zhengyu Date: Mon Jun 13 14:33:27 2022 +0800 clk: qcom: clk-rpmh: Remove redundant if statement By the clk framework already reference counts prepare/unprepare, this if statement should be never true. Signed-off-by: Li Zhengyu Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20220613063327.89320-1-lizhengyu3@huawei.com Signed-off-by: Bjorn Andersson commit ae66b1fe48e2dd91229f2b8f25295bce629382d0 Author: Richard Acayan Date: Tue Sep 13 21:39:22 2022 -0400 clk: qcom: gcc-sdm845: add sdm670 global clock data The Snapdragon 670 adds and removes some clocks, adds new frequencies, and adds a new GPLL (Global Phase-Locked Loop) in reference to SDM845, while also removing some GDSCs. Despite these differences, there are many similarities with SDM670. Add data for SDM670 in the driver for SDM845 to reuse the most of the clock data. Advantages and disadvantages of this approach: + maintenance applies to both sdm670 and sdm845 by default + less duplicate code (clocks) means smaller distro/pre-built kernels with all drivers enabled - clocks for both SoC's must be compiled if the user wants clocks for one specific SoC (both or none) - additional testing needed for sdm845 devices Link: https://android.googlesource.com/kernel/msm/+/443bd8d6e2cf54698234c752e6de97b4b8a528bd%5E%21/#F10 Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220914013922.198778-4-mailingradian@gmail.com commit 8e90216d2db99f0b883be3b40d5b581437dc4a5d Author: Richard Acayan Date: Tue Sep 13 21:39:21 2022 -0400 clk: qcom: gcc-sdm845: use device tree match data This driver will support more than one SoC's set of clocks, and set of GDSCs. This behavior would be unclean with hard-coded static variables. Support it by grabbing clocks, GDSCs, and BCRs in the match data. Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220914013922.198778-3-mailingradian@gmail.com commit 657e9326658c1c570eb1e8fd122a4a7936433673 Author: Richard Acayan Date: Tue Sep 13 21:39:20 2022 -0400 dt-bindings: clock: gcc-sdm845: add sdm670 global clocks The Snapdragon 670 clocks will be added into the sdm845 gcc driver. Most of the new clocks, GDSCs, and resets already have reserved IDs but there are some resources that don't. Add the new clock from Snapdragon 670 and document the differences between the SoC parent clocks. Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220914013922.198778-2-mailingradian@gmail.com commit e3ddb8bbe0f8cc994748c81e17acc58fda6f8abe Author: Max Filippov Date: Fri Jun 3 11:31:14 2022 -0700 xtensa: add FDPIC and static PIE support for noMMU Define ELFOSABI_XTENSA_FDPIC and use it as an OSABI tag in the ELF header to distinguish FDPIC ELF files from regular ELF files. Define ELF_FDPIC_PLAT_INIT and put executable map, interpreter map and executable dynamic section addresses into registers a4..a6. Update start_thread macro to preserve register values in the current register window. Add definitions for PTRACE_GETFDPIC, PTRACE_GETFDPIC_EXEC and PTRACE_GETFDPIC_INTERP. Signed-off-by: Max Filippov commit ccd2d9df6e21581dfed3e6dffb3b6f1b7efd1a26 Author: Max Filippov Date: Fri Jun 3 20:44:06 2022 -0700 xtensa: clean up ELF_PLAT_INIT macro Wrap _r in parentheses in the macro body. Signed-off-by: Max Filippov commit 18a4af7a598445af54e1e16a66b7f31669578701 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:35 2022 +0200 ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom-msm8226-samsung-s3ve3g.dtb: hwlock: 'reg' is a required property qcom-msm8226-samsung-s3ve3g.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-16-krzysztof.kozlowski@linaro.org commit 16ae4e557b2fa9fc7372b4503247aca80a476272 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:34 2022 +0200 ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom-apq8084-mtp.dtb: hwlock: 'reg' is a required property qcom-apq8084-mtp.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-15-krzysztof.kozlowski@linaro.org commit 9e826e05061c61d84217bbe436b4ef0bedbfe458 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:32 2022 +0200 arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/msm8994-sony-xperia-kitakami-suzuran.dtb: hwlock: 'reg' is a required property qcom/msm8994-sony-xperia-kitakami-suzuran.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-13-krzysztof.kozlowski@linaro.org commit f5e303aefc06b7508d7a490f9a2d80e4dc134c70 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:31 2022 +0200 arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/ipq6018-cp01-c1.dtb: hwlock: 'reg' is a required property qcom/ipq6018-cp01-c1.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-12-krzysztof.kozlowski@linaro.org commit 8a99e0fc8bd3fa9c8be1fc115a2e38f4fd51ccda Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:28 2022 +0200 arm64: dts: qcom: msm8996: add missing TCSR syscon compatible TCSR syscon node should come with dedicated compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-9-krzysztof.kozlowski@linaro.org commit 98460385091fc2e86a296f9643105d8a8777ccc2 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:27 2022 +0200 arm64: dts: qcom: qcs404: add missing TCSR syscon compatible TCSR syscon node should come with dedicated compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-8-krzysztof.kozlowski@linaro.org commit d07ac9d93ced0f8203230bf1de49b7cc605e1547 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:26 2022 +0200 arm64: dts: qcom: msm8953: add missing TCSR syscon compatible TCSR syscon node should come with dedicated compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-7-krzysztof.kozlowski@linaro.org commit d30bcfa4408596e8dd3714dfdd90334d2bdc9856 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:25 2022 +0200 arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible TCSR syscon node should come with dedicated compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-6-krzysztof.kozlowski@linaro.org commit 69a3738ba57f4837a7632064b2f8c567282e03b3 Author: Lucas De Marchi Date: Mon Sep 12 09:19:38 2022 -0700 drm/i915: Skip applying copy engine fuses Support for reading the fuses to check what are the Link Copy engines was added in commit ad5f74f34201 ("drm/i915/pvc: read fuses for link copy engines"). However they were added unconditionally because the FUSE3 register is present since graphics version 10. However the bitfield with meml3 fuses only exists since graphics version 12. Moreover, Link Copy engines are currently only available in PVC. Tying additional copy engines to the meml3 fuses is not correct for other platforms. Make sure there is a check for `12.60 <= ver < 12.70`. Later platforms may extend this function later if it's needed to fuse off copy engines. Currently it's harmless as the Link Copy engines are still not exported: info->engine_mask only has BCS0 set and the register is only read for platforms that do have it. Signed-off-by: Lucas De Marchi Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20220912-copy-engine-v1-1-ef92fd81758d@intel.com commit 5d4753f741d824e04e7ba46f46ec016be120f383 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:24 2022 +0200 hwspinlock: qcom: add support for MMIO on older SoCs Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead of 0x1000. Add dedicated compatibles and regmap for such case. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-5-krzysztof.kozlowski@linaro.org commit 90cb380f9ceb811059340d06ff5fd0c0e93ecbe1 Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:23 2022 +0200 hwspinlock: qcom: correct MMIO max register for newer SoCs Newer ARMv8 Qualcomm SoCs using 0x1000 register stride have maximum register 0x20000 (32 mutexes * 0x1000). Fixes: 7a1e6fb1c606 ("hwspinlock: qcom: Allow mmio usage in addition to syscon") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-4-krzysztof.kozlowski@linaro.org commit 276a4f1a5fb118bfd6980d42732d530e43f2916a Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:22 2022 +0200 dt-bindings: hwlock: qcom-hwspinlock: correct example indentation Use some consistent indentation (4-space) for DTS example. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-3-krzysztof.kozlowski@linaro.org commit 6ca53a75c425cb1cb0929ce07f58d9e41094500c Author: Krzysztof Kozlowski Date: Fri Sep 9 11:20:21 2022 +0200 dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead of 0x1000. Add dedicated compatibles for such case. Unfortunately the binding started using a generic "qcom,tcsr-mutex" compatible without specifying the SoC part, thus it looks now quite inconsistent. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909092035.223915-2-krzysztof.kozlowski@linaro.org commit 867bc3269ee430f5c822967e7b5a37a0ca959443 Author: Dmitry Baryshkov Date: Fri Sep 9 13:31:37 2022 +0300 clk: qcom: a53-pll: convert to use parent_data rather than parent_names Change a53-pll driver to use clk_parent_data rather than always looking up the xo clock in the system clock list. Note, this change also switches the a53-pll from the global `xo' clock to the `xo_board', the clock that is specified as the `xo' clock in the DT file. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909103137.3727830-1-dmitry.baryshkov@linaro.org commit baecbda529331e146c7460e2aea8b54c20dcdea7 Author: Dmitry Baryshkov Date: Fri Sep 9 13:51:36 2022 +0300 ARM: dts: qcom: msm8660: fix node names for fixed clocks Fix node names for three fixed clocks to follow the no-underscores-in-name rule. To remain compatible with the drivers expecting to find the old clock names, add clock-output-names properties. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.3733919-6-dmitry.baryshkov@linaro.org commit 6244e7da53dcdf0a5905f6ac2a2b643dd439a19c Author: Dmitry Baryshkov Date: Fri Sep 9 13:51:35 2022 +0300 ARM: dts: qcom: msm8660: add pxo/cxo clocks to the GCC node Add pxo/cxo clocks to the GCC device tree node. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.3733919-5-dmitry.baryshkov@linaro.org commit 4409ef7d3c59050d42903b48ec318d35a79312cd Author: Dmitry Baryshkov Date: Fri Sep 9 13:51:34 2022 +0300 clk: qcom: gcc-msm8660: use parent_hws/_data instead of parent_names Convert the clock driver to specify parent data rather than parent names, to actually bind using 'clock-names' specified in the DTS rather than global clock names. Use parent_hws where possible to refer parent clocks directly, skipping the lookup. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.3733919-4-dmitry.baryshkov@linaro.org commit 41872e9f4dde57854fbb9cf0facc75293a8b92d7 Author: Dmitry Baryshkov Date: Fri Sep 9 13:51:33 2022 +0300 clk: qcom: gcc-msm8660: use ARRAY_SIZE instead of specifying num_parents Use ARRAY_SIZE() instead of manually specifying num_parents. This makes adding/removing entries to/from parent_data easy and errorproof. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.3733919-3-dmitry.baryshkov@linaro.org commit c027fa892b02cf43ed239bac0ccf0e1edbcead7b Author: Dmitry Baryshkov Date: Fri Sep 9 13:51:32 2022 +0300 dt-bindings: clock: qcom,gcc-msm8660: separate GCC bindings for MSM8660 Create a separate DT bindings for Global Clock Controller on MSM8660 platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220909105136.3733919-2-dmitry.baryshkov@linaro.org commit 50ee65dc512b9b5c4de354cf3b4dded34f46c571 Author: Dang Huynh Date: Sun Sep 11 00:02:07 2022 +0700 clk: qcom: sm6115: Select QCOM_GDSC While working on the Fxtec Pro1X device, this error shows up with my own minimal configuration: gcc-sm6115: probe of 1400000.clock-controller failed with error -38 The clock driver depends on CONFIG_QCOM_GDSC and after enabling that, the driver probes successfully. Signed-off-by: Dang Huynh Fixes: cbe63bfdc54f ("clk: qcom: Add Global Clock controller (GCC) Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220910170207.1592220-1-danct12@riseup.net commit e66fee7519ad5eb82de2fe03682e056757216a0c Author: Gaosheng Cui Date: Sun Sep 11 17:29:12 2022 +0800 firmware: qcom: scm: remove unused __qcom_scm_init declaration __qcom_scm_init has been removed since commit 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions"), so remove it. Signed-off-by: Gaosheng Cui Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220911092912.3219132-1-cuigaosheng1@huawei.com commit bcd8868b1d84d91409b0c8a3daa3d04dc1733b37 Author: Krzysztof Kozlowski Date: Sun Sep 11 13:25:08 2022 +0200 dt-bindings: power: qcom,rpmpd: drop non-working codeaurora.org emails Emails to codeaurora.org bounce ("Recipient address rejected: undeliverable address: No such user here."). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220911112508.202995-1-krzysztof.kozlowski@linaro.org commit e0eeb08522c94860c3528816f612c335a6d6552c Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:46 2022 +0200 arm64: dts: qcom: sc7280-herobrine: correct TLMM gpio-line-names There are 174 GPIOs in SC7280. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-41-krzysztof.kozlowski@linaro.org commit d801357a0573105ff5db9fbfde80c3572369a261 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:45 2022 +0200 arm64: dts: qcom: sc7280: align TLMM pin configuration with DT schema DT schema expects TLMM pin configuration nodes to be named with '-state' suffix and their optional children with '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-40-krzysztof.kozlowski@linaro.org commit a73747528867fabea8e285a1b604594181091507 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:44 2022 +0200 arm64: dts: qcom: sm8450: align TLMM pin configuration with DT schema DT schema expects TLMM pin configuration nodes to be named with '-state' suffix and their optional children with '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-39-krzysztof.kozlowski@linaro.org commit e227fa2970fd259fa65f97c4defb0b85dffc62d7 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:43 2022 +0200 arm64: dts: qcom: sm8350: align TLMM pin configuration with DT schema DT schema expects TLMM pin configuration nodes to be named with '-state' suffix and their optional children with '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-38-krzysztof.kozlowski@linaro.org commit c9c53d1f4329564f98ed0decfe3c377c6639ec5d Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:42 2022 +0200 arm64: dts: qcom: sm8350-sagami: correct TS pin property The pin configuration is selected with "pins", not "pin" property. Fixes: 1209e9246632 ("arm64: dts: qcom: sm8350-sagami: Enable and populate I2C/SPI nodes") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-37-krzysztof.kozlowski@linaro.org commit 448f5a002fedb2ff2d19e5a563d3af1ea5e123e1 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:41 2022 +0200 arm64: dts: qcom: sm6350: align TLMM pin configuration with DT schema DT schema expects TLMM pin configuration nodes to be named with '-state' suffix and their optional children with '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-36-krzysztof.kozlowski@linaro.org commit be24fd19b1b42e0b38e77e0d6a379282bafb6aa6 Author: Krzysztof Kozlowski Date: Mon Sep 12 08:17:40 2022 +0200 arm64: dts: qcom: sm6125: align TLMM pin configuration with DT schema DT schema expects TLMM pin configuration nodes to be named with '-state' suffix and their optional children with '-pins' suffix. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220912061746.6311-35-krzysztof.kozlowski@linaro.org commit 75cebd664d57a78af3e46c14bd2659df0a08847b Author: Gaosheng Cui Date: Tue Sep 13 10:48:46 2022 +0800 drm/amd/pm: remove unused declarations in hardwaremanager.h phm_is_hw_access_blocked() and phm_block_hw_access() has been removed since commit 698f88e697cc ("drm/amd/powerplay: delete dead code in powerplay"), so remove them. Acked-by: Christian König Signed-off-by: Gaosheng Cui Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-6-cuigaosheng1@huawei.com commit 04e6fcc1b374c28e53c1b3f8b60b935a056c369f Author: Gaosheng Cui Date: Tue Sep 13 10:48:45 2022 +0800 drm/gma500: remove unused declarations in psb_intel_drv.h psb_intel_sdvo_supports_hotplug(), psb_intel_sdvo_set_hotplug() and psb_intel_sdvo_find() have been removed since commit 871c60156dbe ("drm/gma500: Remove dead code"), so remove them. Acked-by: Christian König Signed-off-by: Gaosheng Cui Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-5-cuigaosheng1@huawei.com commit 2b61e16a3c875f65e341c3769ef2c80b87cf45be Author: Gaosheng Cui Date: Tue Sep 13 10:48:44 2022 +0800 drm/radeon: remove unused declarations for radeon radeon_combios_get_ext_tmds_info() has been removed since commit fcec570b27a4 ("drm/radeon/kms: add support for external tmds on legacy boards"). radeon_mst has been removed since commit 01ad1d9c2888 ("drm/radeon: Drop legacy MST support"). r600_hdmi_acr() has been removed since commit 64424d6e45ae ("radeon/audio: consolidate update_acr() functions (v2)"). So remove the declarations for them from header file. Acked-by: Christian König Signed-off-by: Gaosheng Cui Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-4-cuigaosheng1@huawei.com commit b779e4b973b7001555efc9120a7f07e4ae554d9e Author: Gaosheng Cui Date: Tue Sep 13 10:48:43 2022 +0800 drm/radeon/r600_cs: remove r600_cs_legacy_get_tiling_conf() declaration r600_cs_legacy_get_tiling_conf() has been removed since commit 8333f607a631 ("drm/radeon: remove UMS support"), so remove it. Acked-by: Christian König Signed-off-by: Gaosheng Cui Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-3-cuigaosheng1@huawei.com commit a2224f2d458a093486ede49e319a32f02d99ef16 Author: Gaosheng Cui Date: Tue Sep 13 10:48:42 2022 +0800 drm/vmwgfx: remove unused vmw_bo_is_vmw_bo() declaration vmw_bo_is_vmw_bo() has been removed since commit 298799a28264 ("drm/vmwgfx: Fix gem refcounting and memory evictions"), so remove it. Acked-by: Christian König Signed-off-by: Gaosheng Cui Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-2-cuigaosheng1@huawei.com commit ee10818362d81ca1796cacdfb8a6c6f857cdb34a Author: Xu Panda Date: Mon Sep 12 03:22:42 2022 +0000 drm/amd/display/amdgpu_dm: remove duplicate included header files soc15_common.h is included more than once. Reported-by: Zeal Robot Signed-off-by: Xu Panda Signed-off-by: Alex Deucher commit bd7352332b60a5d2fff625332acfa2ad96e0ca1c Author: Jiapeng Chong Date: Tue Sep 13 16:38:05 2022 +0800 drm/amd/display: Remove the unused function copy_stream_update_to_stream() The function copy_stream_update_to_stream() is defined in the notif.c file, but not called elsewhere, so delete this unused function. drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2852:6: warning: no previous prototype for ‘dc_reset_state’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2113 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 0cdbffd55f11ab39e5f8902860cc48ae967cd1b9 Author: Jiapeng Chong Date: Tue Sep 13 16:38:04 2022 +0800 drm/amd/display: make mpc32_program_shaper and mpc32_program_3dlut static These two functions are not used outside the function dcn32_mpc.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_mpc.c:704:6: warning: no previous prototype for ‘mpc32_program_shaper’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_mpc.c:900:6: warning: no previous prototype for ‘mpc32_program_3dlut’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2115 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 7f0eac6564dc0967fcd430e0b729068afb70d60e Author: Jiapeng Chong Date: Tue Sep 13 16:38:03 2022 +0800 drm/amd/display: make dcn32_link_encoder_is_in_alt_mode and dcn32_link_encoder_get_max_link_cap static These two functions are not used outside the function dcn32_dio_link_encoder.c, so the modification is defined as static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dio_link_encoder.c:121:6: warning: no previous prototype for ‘dcn32_link_encoder_is_in_alt_mode’. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dio_link_encoder.c:136:6: warning: no previous prototype for ‘dcn32_link_encoder_get_max_link_cap’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2117 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 1a468dd88a13b39dace8b5eb87a274782a56cece Author: Jiapeng Chong Date: Tue Sep 13 16:38:02 2022 +0800 drm/amd/display: make dscl32_calc_lb_num_partitions static This symbol is not used outside of dcn32_dpp.c, so marks it static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dpp.c:34:6: warning: no previous prototype for ‘dscl32_calc_lb_num_partitions’. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2118 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 1e0301e127cfc708c852278539e0bbd4c77ccb09 Author: Jiapeng Chong Date: Tue Sep 13 16:38:01 2022 +0800 drm/amd/display: make enc32_stream_encoder_dvi_set_stream_attribute static This symbol is not used outside of dcn32_dio_stream_encoder.c, so marks it static. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_dio_stream_encoder.c:63:6: warning: no previous prototype for ‘enc32_stream_encoder_dvi_set_stream_attribute’. Link:https://bugzilla.openanolis.cn/show_bug.cgi?id=2119 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 7136f956c73c4ba50bfeb61653dfd6a9669ea915 Author: Rafael Mendonca Date: Mon Sep 12 19:34:32 2022 -0300 drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue() If construction of the array of work queues to handle hpd_rx_irq offload work fails, we need to unwind. Destroy all the created workqueues and the allocated memory for the hpd_rx_irq_offload_work_queue struct array. Fixes: 8e794421bc98 ("drm/amd/display: Fork thread to offload work of hpd_rx_irq") Signed-off-by: Rafael Mendonca Signed-off-by: Alex Deucher commit 221bb3a9c34f8004c10ebcd0eda9d74354d519d1 Author: Alex Deucher Date: Fri Sep 9 17:36:26 2022 -0400 drm/amdgpu: fix warning about missing imu prototype for imu_v11_0_3_program_rlc_ram(). Include imu_v11_0_3.h in imu_v11_0_3.c. Reviewed-by: Hawking Zhang Reported-by: kernel test robot Signed-off-by: Alex Deucher commit d4e8ad908b2095388a300b19d76b78c170052a8a Author: Christian König Date: Thu Sep 8 08:43:15 2022 +0200 drm/amdgpu: reorder CS code Sort the functions in the order they are called Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 88c98d54b220dfec0b8e4a4400f6822aea5a383d Author: Christian König Date: Wed Sep 7 11:37:06 2022 +0200 drm/amdgpu: cleanup CS init/fini and pass1 Cleanup the coding style and function names to represent the data they process. Only initialize and cleanup the CS structure in init/fini. Check the size of the IB chunk in pass1. v2: fix job initialisation order and use correct scheduler instance v3: try to move all functional changes into a separate patch. v4: move reordering and pass2 out of this patch as well Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4247084057cffcd8f9897110d8d827d550858dc6 Author: Christian König Date: Tue Apr 5 10:35:31 2022 +0200 drm/amdgpu: use DMA_RESV_USAGE_BOOKKEEP v2 Use DMA_RESV_USAGE_BOOKKEEP for VM page table updates and KFD preemption fence. v2: actually update all usages for KFD Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit dd80d9c8eecac8c516da5b240d01a35660ba6cb6 Author: Christian König Date: Thu Jul 14 10:23:38 2022 +0200 drm/amdgpu: revert "partial revert "remove ctx->lock" v2" This reverts commit 94f4c4965e5513ba624488f4b601d6b385635aec. We found that the bo_list is missing a protection for its list entries. Since that is fixed now this workaround can be removed again. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 736ec9fadd7a1fde8480df7e5cfac465c07ff6f3 Author: Christian König Date: Tue Mar 1 10:59:14 2022 +0100 drm/amdgpu: move setting the job resources Move setting the job resources into amdgpu_job.c Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Reviewed-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9b94c609cc1757d5cd4621dc15ba73faa492b99e Author: Christian König Date: Mon Feb 28 20:46:57 2022 +0100 drm/amdgpu: remove SRIOV and MCBP dependencies from the CS We should not have any different CS constrains based on the execution environment. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b0f4b23fc3dbd8c5398e9ea9cf1f16a00d9006a2 Author: Nathan Chancellor Date: Tue Aug 30 13:34:09 2022 -0700 drm/amd/display: Mark dml30's UseMinimumDCFCLK() as noinline for stack usage This function consumes a lot of stack space and it blows up the size of dml30_ModeSupportAndSystemConfigurationFull() with clang: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_mode_vba_30.c:3542:6: error: stack frame size (2200) exceeds limit (2048) in 'dml30_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Commit a0f7e7f759cf ("drm/amd/display: fix i386 frame size warning") aimed to address this for i386 but it did not help x86_64. To reduce the amount of stack space that dml30_ModeSupportAndSystemConfigurationFull() uses, mark UseMinimumDCFCLK() as noinline, using the _for_stack variant for documentation. While this will increase the total amount of stack usage between the two functions (1632 and 1304 bytes respectively), it will make sure both stay below the limit of 2048 bytes for these files. The aforementioned change does help reduce UseMinimumDCFCLK()'s stack usage so it should not be reverted in favor of this change. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: Maíra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1dbec5b4b0ef319d6961d3ecb7384b4f9ef9d358 Author: Nathan Chancellor Date: Tue Aug 30 13:34:08 2022 -0700 drm/amd/display: Reduce number of arguments of dml31's CalculateFlipSchedule() Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer. This reduces the total amount of stack space that dml31_ModeSupportAndSystemConfigurationFull() uses by 112 bytes with LLVM 16 (1976 -> 1864), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:3908:6: error: stack frame size (2216) exceeds limit (2048) in 'dml31_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: Maíra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit ab2ac59c32dbec068954de30eda741d012be3c74 Author: Nathan Chancellor Date: Tue Aug 30 13:34:07 2022 -0700 drm/amd/display: Reduce number of arguments of dml31's CalculateWatermarksAndDRAMSpeedChangeSupport() Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer. This reduces the total amount of stack space that dml31_ModeSupportAndSystemConfigurationFull() uses by 240 bytes with LLVM 16 (2216 -> 1976), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:3908:6: error: stack frame size (2216) exceeds limit (2048) in 'dml31_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: Maíra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 3b4e83a232244e2fe911bd39b322e0dc19b22434 Author: Nathan Chancellor Date: Tue Aug 30 13:34:06 2022 -0700 drm/amd/display: Reduce number of arguments of dml32_CalculatePrefetchSchedule() Several of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer. This reduces the total amount of stack space that dml32_ModeSupportAndSystemConfigurationFull() uses by 208 bytes with LLVM 16 (1936 -> 1728), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1721:6: error: stack frame size (2152) exceeds limit (2048) in 'dml32_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Additionally, while modifying the arguments to dml32_CalculatePrefetchSchedule(), use 'v' consistently, instead of 'v' mixed with 'mode_lib->vba'. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: Maíra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1df7e569522486e58307929a726ec8f303c5abf4 Author: Nathan Chancellor Date: Tue Aug 30 13:34:05 2022 -0700 drm/amd/display: Reduce number of arguments of dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport() Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer created at the top of dml32_ModeSupportAndSystemConfigurationFull(). This reduces the total amount of stack space that dml32_ModeSupportAndSystemConfigurationFull() uses by 216 bytes with LLVM 16 (2152 -> 1936), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1721:6: error: stack frame size (2152) exceeds limit (2048) in 'dml32_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Additionally, while modifying the arguments to dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(), use 'v' consistently, instead of 'v' mixed with 'mode_lib->vba'. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: Maíra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 419c14521e0b090e82353556008833d58c2efde1 Author: Aric Cyr Date: Sat Aug 27 15:08:49 2022 -0400 drm/amd/display: 3.2.202 This version brings along following fixes: *Fixed register definitions for DCN32/321 *Adding log for spread_spectrum_info *Reverted DSC programming sequence change *Correct I2C register offset *Updated DCN30 header files, viewport position for phantom pipes *Enable dlg and vba compilation for dcn314 Tested-by: Daniel Wheeler Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 70c04ad8441a60ee65ca2e1c40fac04882ba09f8 Author: Aurabindo Pillai Date: Thu Sep 1 15:27:36 2022 -0400 drm/amd/display: Fix register definitions for DCN32/321 [Why & How] Fix the instatiation sequence for MPC registers and add a few other missing register definitions that were ommited erroneously when copying them over to enable runtime initialization of reigster offsets for DCN32/321 Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 410e747401a3121cffba6ecb932f5df596799550 Author: Alvin Lee Date: Sat Aug 6 01:58:00 2022 +0800 drm/amd/display: Refactor SubVP calculation to remove FPU Refactor calculation to remove floating point operations from dmub_srv. To ensure that 32-bit compilation works well, we use the div64 family of macros to do integer division for SubVP-related timing parameters. Cc: Maíra Canal Cc: Alex Deucher Cc: Isabella Basso Cc: Magali Lemes Tested-by: Daniel Wheeler Reviewed-by: Samson Tam Acked-by: Tom Chung Signed-off-by: Alvin Lee Co-developed-by: Aurabindo Pillai Signed-off-by: Aurabindo Pillai Co-developed-by: Rodrigo Siqueira Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b04fa59a51e80eae9883a419e41b1bf8179e5a42 Author: JeromeHong Date: Thu Aug 25 15:52:11 2022 +0800 drm/amd/display: Avoid force minimal transaction in case of surface_count equal to 0 [why] Call commit_minimal_transition_state wrongly in case of surface_count equal to 0. [how] Add a condition to filter case of surface_count equal to 0. Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Pavle Kotarac Signed-off-by: JeromeHong Signed-off-by: Alex Deucher commit 34955a1e797d074e72d0ac6a514d934d8fe80da1 Author: Aric Cyr Date: Fri Aug 26 17:53:34 2022 -0400 drm/amd/display: Don't adjust VRR unnecessarily [why] Do not need to spend time reprogramming DRR if there were no updates to the parameters. [how] Compare the current stream state to the requested one to determine if an update is required. In amdgpu_dm the timing_changed flag is set but never used so can remove it. Similarly, the stream update for VRR is done after dc_commit and should not update its adjust field until after the update is completed. The adjust field is managed by dc_stream_adjust_vmin_vmax and should not be manually updated in amdgpu_dm. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 4bd09d7481047500fcad389251e13946c083b9fb Author: Leo Chen Date: Fri Aug 26 11:29:23 2022 -0400 drm/amd/display: Adding log for spread_spectrum_info [Why & How] Enable logging for spread_spectrum_percentage in spread_spectrum_info to facilitate debugging for audio compliance issues Tested-by: Daniel Wheeler Co-authored-by: Leo Chen Reviewed-by: Charlene Liu Acked-by: Pavle Kotarac Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit 61e4de65b99c616d5e074a9e2a4a1a9f821a964b Author: Yao Wang1 Date: Mon Aug 22 18:30:31 2022 +0800 drm/amd/display: Limit user regamma to a valid value [Why] For HDR mode, we get total 512 tf_point and after switching to SDR mode we actually get 400 tf_point and the rest of points(401~512) still use dirty value from HDR mode. We should limit the rest of the points to max value. [How] Limit the value when coordinates_x.x > 1, just like what we do in translate_from_linear_space for other re-gamma build paths. Tested-by: Daniel Wheeler Reviewed-by: Krunoslav Kovac Reviewed-by: Aric Cyr Acked-by: Pavle Kotarac Signed-off-by: Yao Wang1 Signed-off-by: Alex Deucher commit 3b304bced035fa4e1144d657b4687238be931806 Author: Aurabindo Pillai Date: Thu Aug 25 15:05:58 2022 -0400 drm/amd/display: add workaround for subvp cursor corruption for DCN32/321 [Why&How] Kernel does not have a means to tell the userspace to use software cursor. Due to lack of this functionality, reducing the max cursor size is the only way to ensure that power savings of Subview port feature is utilized for asics that support it. The workaround could be removed after cursor caching is fixed while a subviewport config is active. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Pavle Kotarac Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 5c1a431aaf52bbba8b6e2c4e9b4037a09509c0e3 Author: Lee, Alvin Date: Thu Aug 25 16:05:03 2022 -0400 drm/amd/display: Added debug option for forcing subvp num ways [Description] Regkey option for forcing num ways for subvp for debug purposes Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 43080c9b7536c5cbc53c5d8c74027c92c7e0110a Author: Alvin Lee Date: Thu Aug 25 16:04:29 2022 -0400 drm/amd/display: Update viewport position for phantom pipes [Description] In some cases the viewport position of the main pipes can change without triggering a full update. In this case the subvp phantom viewports must be updated accordingly. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 39fc82b7e031dbf5145de485d66f4a23ef711786 Author: Taimur Hassan Date: Thu Aug 25 12:33:12 2022 -0400 drm/amd/display: Round cursor width up for MALL allocation [Why & How] When calculating cursor size for MALL allocation, the cursor width should be the actual width rounded up to 64 alignment. Additionally, the bit depth should vary depending on color format. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Pavle Kotarac Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit 247a94a627dbd9fed370b575288b874ef4a01991 Author: Duncan Ma Date: Wed Aug 24 14:35:03 2022 -0400 drm/amd/display: Correct dram channel width for dcn314 [Why] The interpretation of the number of memory channels differ by memory type, and this affects channel width for the DML input. [How] Set dram channel width according to memory type for dcn314. Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Duncan Ma Signed-off-by: Alex Deucher commit e7dbdfa226ce621931a84f60e885d42c232fb990 Author: Nicholas Kazlauskas Date: Wed Aug 24 10:51:21 2022 -0400 drm/amd/display: Relax swizzle checks for video non-RGB formats on DCN314 [Why] HW can support the display swizzle modes for video, and those are preferable over standard or linear for decode use. [How] Remove the check for DCN314. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit d56e38d51cbc902a27f8b2ba244bb6a8950e8a7c Author: Nicholas Kazlauskas Date: Wed Aug 24 09:24:18 2022 -0400 drm/amd/display: Hook up DCN314 specific dml implementation [Why & How] Add support for the DML314 functions and hook up DCN314 to use them. This has some necessary additions for calculating Max VSTARTUP for future features, but there's also some changes that we have to make for pixel format/swizzle support. That will come in a following patch to make this transition easier to bisect. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit b8e13105b7fe9a0adf1dc7dd3d5d0647962adfc0 Author: Rodrigo Siqueira Date: Thu Sep 1 16:07:19 2022 -0400 drm/amd/display: Enable dlg and vba compilation for dcn314 We were not using the VBA and DLG files for DCN314, but the next sequence of changes for DCN314 will require those files. This commit adds the necessary files to the Makefile. Cc: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 34e205112ec078ed1b24e30d90af81e43bc12f4e Author: Rodrigo Siqueira Date: Thu Sep 1 16:00:52 2022 -0400 drm/amd/display: Fix compilation errors on DCN314 We have some compilation errors in some DML files from DCN314 that we never noticed because we were not compiling some of the DML files. This commit fixes those syntax errors before we enable the compilation. Cc: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 827e3c9caa77d358a824c3f302032ad6c9d2ba46 Author: Aric Cyr Date: Wed Aug 24 16:34:53 2022 -0400 drm/amd/display: Fix divide by zero in DML [why] Incorrectly using MicroTileWidth instead of MacroTileWidth for calculations. [how] Remove all unused references to MicroTile and change them to MacroTile. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 94caa423e2b5658626382ba9d98f989a47bd2b8a Author: Leo Chen Date: Wed Aug 24 15:34:24 2022 -0400 drm/amd/display: Fixing DIG FIFO Error [Why & How] DIG_FIFO_READ_START_LEVEL should only be set to default value (7) by software. Removed all instances of resetting the register to 0 Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit fe77d95f7a7f2f567205ce747124efa465fb01be Author: Alvin Lee Date: Wed Aug 24 11:53:50 2022 -0400 drm/amd/display: SW cursor fallback for SubVP [Description] Leverage SW cursor fall back for SubVP when the cursor is too big. We want to take advantage of being able to fallback to SW cursor when possible because it's not worth it to disable MCLK switching because the cursor is slightly too big. Tested-by: Daniel Wheeler Reviewed-by: Aurabindo Pillai Acked-by: Pavle Kotarac Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit d3d4211050665442ce50c7b5e837b9031ee85b33 Author: JinZe.Xu Date: Tue Aug 23 22:18:06 2022 -0700 drm/amd/display: Assign link type before check dsc workaround. [Why] link type is not assigned before check dpia_mst_dsc_always_on conditions. Tested-by: Daniel Wheeler Reviewed-by: Wenjing Liu Acked-by: Pavle Kotarac Signed-off-by: JinZe.Xu Signed-off-by: Alex Deucher commit c7783a6ed4fcfad9acd353a087384d31d4cf42b2 Author: Nagulendran, Iswara Date: Tue Aug 23 12:01:56 2022 -0400 drm/amd/display: Reverted DSC programming sequence change [HOW&WHY] Revert a previous commit by moving DSC programming back to before link enablement. Tested-by: Daniel Wheeler Reviewed-by: Jayendran Ramani Acked-by: Pavle Kotarac Signed-off-by: Nagulendran, Iswara Signed-off-by: Alex Deucher commit 41c81dcf599918c53e08933a0b0a522508eb6019 Author: Alvin Lee Date: Tue Aug 23 17:14:03 2022 -0400 drm/amd/display: Update MBLK calculation for SubVP [Description] Update MBLK calculation according to hardware doc. For DCC case we were not allocation enough MALL due to an inaccurate MBLK calculation. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 615268d4935082ea64729fcc8a35af394ff90e7c Author: Aurabindo Pillai Date: Thu Aug 11 16:42:12 2022 -0400 drm/amd/display: Revert "Fallback to SW cursor if SubVP + cursor too big" This reverts commit a4f1b04216023ff0f4cd89328b59ee6890248130 since returning false in case of SubVP results in no cursor being visible on desktop as there is no sw cursor fallback path on all platforms. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Pavle Kotarac Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 4f76da231826190658d19ec8d89ea8cd46fdfb7d Author: Chris Park Date: Tue Aug 23 12:21:52 2022 -0400 drm/amd/display: Correct I2C register offset [Why] I2C register name starts with 1, unlike other registers that start with 0. This creates a problem with the new register macro refactoring when I2C HW objects are created in an array. [How] Correct I2C register offset by making a new macro to account for array offset. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Pavle Kotarac Signed-off-by: Chris Park Signed-off-by: Alex Deucher commit 17529ea2acfa3e2118f5a9ee911e0daf2d88c13f Author: Aric Cyr Date: Sat Aug 20 17:20:30 2022 -0400 drm/amd/display: Optimizations for DML math [why] Conditionals in the DML basic math functions significantly impact mode enumeration. [how] Remove conditionals for floor/ceil operations which are used frequently in DML and add an assertion for invalid callers using zero granuality. Fix existing callers that rely on 0 granularity. Tested-by: Daniel Wheeler Reviewed-by: Nevenko Stupar Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 6da15a236c8c80d9f87e4c5216e00ad8f1cace2d Author: Candice Li Date: Wed Sep 7 15:52:04 2022 +0800 drm/amdgpu: Skip reset error status for psp v13_0_0 No need to reset error status since only umc ras supported on psp v13_0_0. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 158225294683310566445f8477336e747b74f03f Author: Candice Li Date: Wed Sep 7 15:54:25 2022 +0800 drm/amdgpu: Add EEPROM I2C address for smu v13_0_0 Set correct EEPROM I2C address for smu v13_0_0. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c3db1b9065d08dac7dd602301c42641dbbe89990 Author: John Clements Date: Sat Jul 30 06:08:36 2022 +0800 drm/amdgpu: added support for ras driver loading copy ras driver to psp if present Signed-off-by: John Clements Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7a87040ca6a1dbbcf1cbddddf74e82c95c99667a Author: Alex Deucher Date: Tue Aug 30 11:08:09 2022 -0400 drm/amdgpu: add HDP remap functionality to nbio 7.7 Was missing before and would have resulted in a write to a non-existant register. Normally APUs don't use HDP, but other asics could use this code and APUs do use the HDP when used in passthrough. Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 49791b988ac78531ece312043d0113ad1ff9cf0f Author: Jingyu Wang Date: Sat Sep 10 03:53:30 2022 +0800 drm/amdgpu/display: remove unneeded "default n" options Remove "default n" options. If the "default" line is removed, it defaults to 'n'. Signed-off-by: Jingyu Wang Signed-off-by: Alex Deucher commit 65529fa32c60ea15514e99b6ea12304aea732b67 Author: Jilin Yuan Date: Wed Sep 7 12:10:58 2022 +0800 drm/amd/display: fix repeated words in comments Delete the redundant word 'in'. Signed-off-by: Jilin Yuan Signed-off-by: Alex Deucher commit e7c94bfb747fcec57528f89e53a1461b48ab06dc Author: Jingyu Wang Date: Mon Sep 5 16:38:25 2022 +0800 drm/amdgpu: cleanup coding style in amdgpu_amdkfd_gpuvm.c Fix everything checkpatch.pl complained about in amdgpu_amdkfd_gpuvm.c Reviewed-by: Felix Kuehling Signed-off-by: Jingyu Wang Signed-off-by: Alex Deucher commit 2f4ca1ba6c9e7a4c2eea2ed8a378817ec1946f4f Author: Jingyu Wang Date: Mon Sep 5 15:56:24 2022 +0800 drm/amdgpu: cleanup coding style in amdgpu_amdkfd.c Fix everything checkpatch.pl complained about in amdgpu_amdkfd.c Signed-off-by: Jingyu Wang Signed-off-by: Alex Deucher commit 826f03b8ac7a9c4660de9b65a81e8926c60b3b97 Author: Jingyu Wang Date: Mon Sep 5 02:33:07 2022 +0800 drm/amdgpu: cleanup coding style in amdgpu_sync.c file This is a patch to the amdgpu_sync.c file that fixes some warnings found by the checkpatch.pl tool Signed-off-by: Jingyu Wang Signed-off-by: Alex Deucher commit 556bdae320b2b6db124738eb97f2624e92cceff7 Author: Jingyu Wang Date: Mon Sep 5 09:14:31 2022 +0800 drm/amdgpu: cleanup coding style in amdgpu_acpi.c Fix everything checkpatch.pl complained about in amdgpu_acpi.c Signed-off-by: Jingyu Wang Signed-off-by: Alex Deucher commit 79c0d7ddcbb84b2a714620a2abc5016529fcc38c Author: zhang songyi Date: Fri Sep 2 08:04:01 2022 +0000 drm/amdgpu: Remove the unneeded result variable Return the sdma_v6_0_start() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: zhang songyi Signed-off-by: Alex Deucher commit d4242216dd792b2af6f3e6738dfa71cd50bcd791 Author: ye xingchen Date: Fri Sep 2 07:33:20 2022 +0000 drm/radeon: Remove the unneeded result variable Return the value radeon_drm_ioctl() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit 8a948b1b2f2bef2444c403a2884134d46100ec26 Author: ye xingchen Date: Fri Sep 2 07:31:48 2022 +0000 drm/radeon/ci_dpm: Remove the unneeded result variable Return the value ci_load_smc_ucode() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit a92bfda8783729ac684a0f005a1680602ed1096d Author: Yang Li Date: Thu Sep 1 16:34:38 2022 +0800 drm/amd/display: remove possible condition with no effect (if == else) Conditional statements have no effect to next process.So remove it. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2028 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 02bcbd6bfc5932d4300b017dcd2ba7e7bbbffe79 Author: Yang Li Date: Thu Sep 1 16:11:31 2022 +0800 drm/amd/display: Simplify bool conversion The result of relational operation is Boolean, and the question mark expression is redundant. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2027 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit fc0cd4cd1f7fbe6b0cbe651a8b6db6ec5476c949 Author: Yang Li Date: Thu Sep 1 15:56:55 2022 +0800 drm/amd/display: clean up some inconsistent indentings This if statement is the content of the for statement above it. It should be indented. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2026 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 2efc30f0161b064f6918316ecd486a8e3feee10e Author: Vignesh Chander Date: Fri Sep 9 09:28:46 2022 -0400 drm/amdgpu: Fix hive reference count leak both get_xgmi_hive and put_xgmi_hive can be skipped since the reset domain is not necessary for VF Signed-off-by: Vignesh Chander Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit 3a876060892ba52dd67d197c78b955e62657d906 Author: Philip Yang Date: Thu Sep 8 17:56:09 2022 -0400 drm/amdkfd: Migrate in CPU page fault use current mm migrate_vma_setup shows below warning because we don't hold another process mm mmap_lock. We should use current vmf->vma->vm_mm instead, the caller already hold current mmap lock inside CPU page fault handler. WARNING: CPU: 10 PID: 3054 at include/linux/mmap_lock.h:155 find_vma Call Trace: walk_page_range+0x76/0x150 migrate_vma_setup+0x18a/0x640 svm_migrate_vram_to_ram+0x245/0xa10 [amdgpu] svm_migrate_to_ram+0x36f/0x470 [amdgpu] do_swap_page+0xcfe/0xec0 __handle_mm_fault+0x96b/0x15e0 handle_mm_fault+0x13f/0x3e0 do_user_addr_fault+0x1e7/0x690 Fixes: e1f84eef313f ("drm/amdkfd: handle CPU fault on COW mapping") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a607a850ba1fa966cbb035544c1588e24a6307df Author: Rafał Miłecki Date: Sun Jul 3 10:48:43 2022 +0200 dt-bindings: nvmem: u-boot,env: add basic NVMEM cells U-Boot doesn't have cells at hardcoded addresses. They are stored in internal format. It's still important to define relevant cells in DT so NVMEM consumers can reference them. Update binding to allow including basic cells as NVMEM device subnodes. Signed-off-by: Rafał Miłecki Reviewed-by: Tom Rini Link: https://lore.kernel.org/r/20220703084843.21922-1-zajec5@gmail.com Signed-off-by: Rob Herring commit af96579dc31761a5f5bcb207d046764f1183069a Author: Siddharth Vadapalli Date: Mon Sep 12 14:26:50 2022 +0530 phy: ti: gmii-sel: Add support for CPSW5G GMII SEL in J7200 Each of the CPSW5G ports in J7200 support additional modes like QSGMII. Add a new compatible for J7200 to support the additional modes. In TI's J7200, each of the CPSW5G ethernet interfaces can act as a QSGMII or QSGMII-SUB port. The QSGMII interface is responsible for performing auto-negotiation between the MAC and the PHY while the rest of the interfaces are designated as QSGMII-SUB interfaces, indicating that they will not be taking part in the auto-negotiation process. To indicate the interface which will serve as the main QSGMII interface, add a property "ti,qsgmii-main-ports", whose value indicates the port number of the interface which shall serve as the main QSGMII interface. The rest of the interfaces are then assigned QSGMII-SUB mode by default. The property "ti,qsgmii-main-ports" is used to configure the CTRLMMR_ENETx_CTRL register. Depending on the device, it is possible for more than one QSGMII main port to exist. Thus, the property "ti,qsgmii-main-ports" is defined as an array of values in order to reuse the property for other devices. Signed-off-by: Siddharth Vadapalli Link: https://lore.kernel.org/r/20220912085650.83263-4-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit bd76037833244e4bf234130f1fa418ff54fd5779 Author: Siddharth Vadapalli Date: Mon Sep 12 14:26:49 2022 +0530 dt-bindings: phy: ti: phy-gmii-sel: Add bindings for J7200 TI's J7200 SoC supports additional PHY modes like QSGMII and SGMII that are not supported on earlier SoCs. Add a compatible for it. Signed-off-by: Siddharth Vadapalli Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220912085650.83263-3-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 117c80fd0509e542268692b2dd9e1123877a95ab Author: Siddharth Vadapalli Date: Mon Sep 12 14:26:48 2022 +0530 dt-bindings: phy: ti: phy-gmii-sel: Cleanup example Change node name in example from "phy-gmii-sel" to "phy", following the device-tree convention of using generic node names. Signed-off-by: Siddharth Vadapalli Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220912085650.83263-2-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 0c89abb25d682f34582ddc766e7e3629dc8e168c Author: Gaosheng Cui Date: Tue Sep 13 10:48:47 2022 +0800 drm/i915: remove unused i915_gem_lmem_obj_ops declaration i915_gem_lmem_obj_ops has been removed since commit 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend"), so remove it. Signed-off-by: Gaosheng Cui Acked-by: Christian König Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220913024847.552254-7-cuigaosheng1@huawei.com commit c5783af354688b24abd359f7086c282ec74de993 Author: Kees Cook Date: Wed Sep 7 16:40:44 2022 -0700 sh: machvec: Use char[] for section boundaries As done for other sections, define the extern as a character array, which relaxes many of the compiler-time object size checks, which would otherwise assume it's a single long. Solves the following build error: arch/sh/kernel/machvec.c: error: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Werror=array-bounds]: => 105:33 Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Reported-by: Geert Uytterhoeven Link: https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2209050944290.964530@ramsan.of.borg/ Fixes: 9655ad03af2d ("sh: Fixup machvec support.") Reviewed-by: Geert Uytterhoeven Reviewed-by: Gustavo A. R. Silva Acked-by: Rich Felker Signed-off-by: Kees Cook commit 260c04d425eb8424626b64e164faebeb63c67625 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:56 2022 +0200 arm64: dts: mediatek: cherry: Enable MT6315 regulators on SPMI bus All machines in the Cherry platform use MT6315 over SPMI: add the two instances, providing Vbcpu and Vgpu regulators. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220902081156.38526-8-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit b53f37249cfa4e2e0caacdc72f4a8dfdb8574419 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:55 2022 +0200 arm64: dts: mediatek: cherry: Enable Elantech eKTH3000 i2c trackpad The Cherry platform uses an Elantech touchpad/trackpad: enable probing it at address 0x15 on I2C1. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220902081156.38526-7-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 07984e82ae3b8cf09a8d3d78b6a691f275d38036 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:54 2022 +0200 arm64: dts: mediatek: cherry: Enable secondary SD/MMC controller As of now, all of the boards based on the cherry platform have a usable secondary SD/MMC controller, usually for SD cards: enable it to allow both booting from it and generally accessing external storage. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220902081156.38526-6-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 824fae69f53b914b30fb279ae73d04dd35df432a Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:53 2022 +0200 arm64: dts: mediatek: cherry: Add keyboard mapping for the top row Chromebooks' embedded keyboards differ from standard layouts for the top row, as this one doesn't have the standard function keys but shortcuts instead: map these keys to achieve the functionality that is pictured on the printouts. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220902081156.38526-5-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 63ce81b224dd8033fd5f629fb4581a26eedd5797 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:52 2022 +0200 arm64: dts: mediatek: cherry: Add Google Security Chip (GSC) TPM Add support for the Cr50 Google Security Chip (GSC) found on this platform on I2C3 to support TPM and to also use it as an entropy source for the kernel. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220902081156.38526-4-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit e775cc1a9b4fb9b7b62edc480642ebd21e3b81e1 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:51 2022 +0200 arm64: dts: mediatek: cherry: Wire up the ChromeOS Embedded Controller Wire up the ChromeOS Embedded Controller on SPI0 and its communication channel via SCP RPMSG along with all of the offered functionality, including Keyboard, Smart Battery Metrics (SBS), keyboard backlight, I2C tunnel, regulators and Type-C connector management. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220902081156.38526-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit d86a1c69bd9a4d6859293cd0ecebfa692f6a3150 Author: AngeloGioacchino Del Regno Date: Fri Sep 2 10:11:50 2022 +0200 arm64: dts: mediatek: cherry: Enable the System Companion Processor MT8195 features a SCP like some other older SoCs, and Cherry uses it for various tasks. Add the required pin configuration and DMA pool and enable the node. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220902081156.38526-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit cd3a49af58c23dd5ffa1d4d5a120ee2354d2e8d8 Author: Yang Wang Date: Fri Sep 9 11:06:50 2022 +0800 drm/amdgpu: change the alignment size of TMR BO to 1M align TMR BO size TO tmr size is not necessary, modify the size to 1M to avoid re-create BO fail when serious VRAM fragmentation. v2: add new macro PSP_TMR_ALIGNMENT for TMR BO alignment size Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 34dfca890835ca9f4a59c8a2ff6be8c0513637c7 Author: Candice Li Date: Wed Sep 7 15:58:59 2022 +0800 drm/amdgpu: Enable full reset when RAS is supported on gc v11_0_0 Enable full reset for RAS supported configuration on gc v11_0_0. v2: simplify the code. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d27ec594b48d9d2842af9e3fdf3159bfdac1b1f8 Author: Candice Li Date: Wed Sep 7 15:56:27 2022 +0800 drm/amdgpu: Rely on MCUMC_STATUS for umc v8_10 correctable error counter only Only check MCUMC_STATUS for CE counter for umc v8_10. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9dea5dd0e9dc65c9f5fd9390062381b17ef242b2 Author: Charlene Liu Date: Tue Aug 23 09:39:56 2022 -0400 drm/amd/display: update header files [why] update header files, and remove not used register access marco Reviewed-by: Hansen Dsouza Acked-by: Pavle Kotarac Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit c73cdd12de96ac4ae175b5095b5bdab6af96fcf4 Author: Jani Nikula Date: Mon Sep 12 14:45:16 2022 +0300 drm/i915/ipc: use intel_uncore_rmw() to enable/disable Don't duplicate the rmw function. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/113a17cd18401b0e4c83396575b67aa6efb07346.1662983005.git.jani.nikula@intel.com commit 70296670f672e470a5b42f72468a9fe631264070 Author: Jani Nikula Date: Mon Sep 12 14:45:15 2022 +0300 drm/i915/display: move IPC under display wm sub-struct Move display IPC related member under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/04ccaaceee9293e5a6c75761ba9d36792c36f095.1662983005.git.jani.nikula@intel.com commit 62a21a7c6a1cb7030eab8d64427d93b97cdeedec Author: Jani Nikula Date: Mon Sep 12 14:45:14 2022 +0300 drm/i915/ipc: register debugfs only if IPC available It looks like trying to enable IPC via debugfs on platforms that don't have IPC resulted in dmesg info message about IPC being enabled, which is clearly not possible and would not happen. Seems sensible to register IPC debugfs only on platforms that have IPC. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/b18edb4f96c9d2ec728ef04e6f99d161fe5641d1.1662983005.git.jani.nikula@intel.com commit dde01ed5b07808be13d4469f90e578ff83774c25 Author: Jani Nikula Date: Mon Sep 12 14:45:13 2022 +0300 drm/i915/ipc: move IPC debugfs to skl_watermark.c Follow the new direction for debugfs files, moving the details where the implementation is. It seems quite natural skl_watermark.c is the place that controls IPC details, even for debugfs, not intel_display_debugfs.c. Rename the functions and convert dev_priv->i915 while at it. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/9d59b18f5dc06e86a48c1ce0f40d625f51e3e85a.1662983005.git.jani.nikula@intel.com commit 23fbdb07d6a729dd6a1df8e0cdd5772a5935c053 Author: Jani Nikula Date: Mon Sep 12 14:45:12 2022 +0300 drm/i915/ipc: refactor and rename IPC functions Rename the IPC functions to have skl_watermark_ipc_ prefix, rename enable to update to reflect what the function actually does, and add enabled function to abstract direct ->ipc_enabled access for state query. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/536237d5bc919e8c97a96796f235f5bb264ceff2.1662983005.git.jani.nikula@intel.com commit c969c5fd21fd700b126aa139ec57875697946474 Author: Philip Yang Date: Tue Jul 26 15:13:30 2022 -0400 drm/amdkfd: Remove prefault before migrating to VRAM Prefaulting potentially allocates system memory pages before a migration. This adds unnecessary overhead. Instead we can skip unallocated pages in the migration and just point migrate->dst to a 0-initialized VRAM page directly. Then the VRAM page will be inserted to the PTE. A subsequent CPU page fault will migrate the page back to system memory. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e1f84eef313f4820cca068a238c645d0a38c6a9b Author: Philip Yang Date: Wed Sep 7 12:30:12 2022 -0400 drm/amdkfd: handle CPU fault on COW mapping If CPU page fault in a page with zone_device_data svm_bo from another process, that means it is COW mapping in the child process and the range is migrated to VRAM by parent process. Migrate the parent process range back to system memory to recover the CPU page fault. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7a3f8b7c4cdb9d678d6311ca93e6b793e8957295 Author: wangjianli Date: Thu Sep 8 21:17:12 2022 +0800 amd/amdkfd: fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: wangjianli Signed-off-by: Felix Kuehling Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 46c676600c715f833b066581247cd5a461e03441 Author: shaoyunl Date: Tue Sep 6 23:05:11 2022 -0400 drm/amdgpu: Use per device reset_domain for XGMI on sriov configuration For SRIOV configuration, host driver control the reset method(either FLR or heavier chain reset). The host will notify the guest individually with FLR message if individual GPU within the hive need to be reset. So for guest side, no need to use hive->reset_domain to replace the original per device reset_domain Signed-off-by: shaoyunl Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1ed1f6be6eb3daa8097d6419dde516c9854a8790 Author: Tom St Denis Date: Thu Sep 8 09:36:18 2022 -0400 drm/amd/amdgpu: update GC 10.3.0 pwrdec The 10.3 GC headers were missing most of the pwrdec block. This patch adds the registers and bits present in the 10.1 header but based on the contents of the 10.3 specs. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a4a3798f0077a1584491574027b0067c13396d12 Author: Rajneesh Bhardwaj Date: Wed Sep 7 14:13:54 2022 -0400 drm/amdkfd: Fix CRIU restore op due to doorbell offset Recently introduced change to allocate doorbells only when the first queue is created or mapped for CPU / GPU access, did not consider Checkpoint Restore scenario completely. This fix allows the CRIU restore operation by extending the doorbell optimization to CRIU restore scenario. Fixes: 16f0013157bf ("drm/amdkfd: Allocate doorbells only when needed") Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 542ab4917338d735e2dde6c8f4e042ac18ff5152 Author: Hamza Mahfooz Date: Tue Sep 6 15:01:49 2022 -0400 drm/amdgpu: use dirty framebuffer helper Currently, we aren't handling DRM_IOCTL_MODE_DIRTYFB. So, use drm_atomic_helper_dirtyfb() as the dirty callback in the amdgpu_fb_funcs struct. Signed-off-by: Hamza Mahfooz Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit dd6aeb4e5f59984078275169986ff601f5d16385 Author: Lijo Lazar Date: Thu Sep 8 08:28:57 2022 +0530 drm/amdgpu: Don't enable LTR if not supported As per PCIE Base Spec r4.0 Section 6.18 'Software must not enable LTR in an Endpoint unless the Root Complex and all intermediate Switches indicate support for LTR.' This fixes the Unsupported Request error reported through AER during ASPM enablement. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216455 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Reported-by: Gustaw Smolarczyk Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher commit 7bb91228291aa95bfee3b9d5710887673711c74c Author: Guchun Chen Date: Wed Sep 7 20:31:36 2022 +0800 drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards To avoid hardware intermittent failures. Signed-off-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit cd01569b040e3f496b74e4b78c2e79fc10979b28 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 09:48:11 2022 -0700 Input: mtk-pmic-keys - add support for MT6331 PMIC keys Add support for PMIC Keys of the MT6331 PMIC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220913123941.385349-1-angelogioacchino.delregno@collabora.com Signed-off-by: Dmitry Torokhov commit ca9b8f0486b577ab179664d4a279090645e9244f Merge: 69a673c9e54d9 1cc5a52e873a4 Author: Mark Brown Date: Tue Sep 13 17:43:23 2022 +0100 MediaTek Helio X10 MT6795 - MT6331/6332 Regulators Merge series from AngeloGioacchino Del Regno : In an effort to give some love to the apparently forgotten MT6795 SoC, I am upstreaming more components that are necessary to support platforms powered by this one apart from a simple boot to serial console. This series adds support for the regulators found in MT6331 and MT6332 main/companion PMICs. Adding support to each driver in each subsystem is done in different patch series as to avoid spamming uninteresting patches to maintainers. Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone. commit 11683cecf97f48879adced752c20ec4bd8432d15 Author: Johan Jonker Date: Sat Sep 10 00:01:45 2022 +0200 dt-bindings: phy: phy-rockchip-inno-usb2: add rockchip,rk3128-usb2phy Add rockchip,rk3128-usb2phy compatible string. Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/d477a077-a68f-e752-5192-807db80a9e68@gmail.com Signed-off-by: Vinod Koul commit a525f380a3b98de5ba11417b35e3819142ca2b97 Author: Colin Foster Date: Sun Sep 11 09:37:15 2022 -0700 dt-bindings: phy: ocelot-serdes: convert to YAML Convert the phy-ocelot-serdes device tree binding to the new YAML format. Additionally, add the file to MAINTAINERS since the original file didn't exist. Signed-off-by: Colin Foster Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220911163715.4036144-2-colin.foster@in-advantage.com Signed-off-by: Vinod Koul commit 40a57d4b2d82fe4a10bc41aa79532ee33ffdb051 Author: David Lin Date: Tue Sep 13 20:06:43 2022 +0800 ASoC: dt-bindings: nau8825: Add ADCOUT IO drive strength control Add a property to control the driving of ADCOUT. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20220913120641.792502-2-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit ed8570726ab005da0aa62cc24046ef83fa342e89 Author: David Lin Date: Tue Sep 13 20:06:41 2022 +0800 ASoC: nau8825: Add ADCOUT IO drive strength control Add a property to control the driving of ADCOUT. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20220913120641.792502-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit 515626a33a194c4caaf2879dbf9e00e882582af0 Author: Gaosheng Cui Date: Mon Aug 22 11:51:33 2022 +0800 ASoC: Intel: fix unused-variable warning in probe_codec In configurations with CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=n, gcc warns about an unused variable: sound/soc/intel/skylake/skl.c: In function ‘probe_codec’: sound/soc/intel/skylake/skl.c:729:18: error: unused variable ‘skl’ [-Werror=unused-variable] struct skl_dev *skl = bus_to_skl(bus); ^~~ cc1: all warnings being treated as errors Fixes: 3fd63658caed9 ("ASoC: Intel: Drop hdac_ext usage for codec device creation") Signed-off-by: Gaosheng Cui Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220822035133.2147381-1-cuigaosheng1@huawei.com Signed-off-by: Mark Brown commit 30248f618d30cf1ad9d5a72126799f2f0239860c Author: Mikhail Rudenko Date: Sun Sep 11 17:57:11 2022 +0300 ASoC: sunxi: sun4i-codec: silence misleading error in probe In the case when a codec device is probed before codec analog controls, snd_soc_register_card() returns -EPROBE_DEFER, resulting in a misleading error message sun4i-codec 1c22c00.codec: Failed to register our card even if the device is probed successfully later. Use dev_err_probe() to demote the above error to a debug message. Signed-off-by: Mikhail Rudenko Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220911145713.55199-1-mike.rudenko@gmail.com Signed-off-by: Mark Brown commit 1c2d23fc6134fa72b040a36ae953e1a6614844f4 Author: Krzysztof Kozlowski Date: Sat Sep 10 11:08:56 2022 +0200 ASoC: dt-bindings: qcom,q6afe: remove binding qcom,q6afe is already documented in soc/qcom/qcom,apr.yaml. The version-based compatibles ("qcom,q6afe-v.") are not used (neither in upstream nor in downstream DTS). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220910090856.49271-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 596247a42125267163d147b290e2ec4d4e2c2491 Author: Mark Brown Date: Tue Sep 13 17:10:58 2022 +0100 ASoC: Drop mistakenly applied DTS patch This reverts commit b3821f7839c2ec3229 ("arm64: dts: mediatek: kukui: Remove i2s-share properties") which was mistakenly applied to the ASoC tree. Signed-off-by: Mark Brown commit 677c577e1762afaaee452ababe1c070c24c647c0 Author: Wei Yongjun Date: Fri Sep 9 09:47:09 2022 +0000 phy: usb: sunplus: Fix return value check in update_disc_vol() In case of error, the function nvmem_cell_read() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220909094709.1790970-1-weiyongjun@huaweicloud.com Signed-off-by: Vinod Koul commit 68ded02cb2c23f1aebf026196a793959bd0463dc Author: Maxime Ripard Date: Mon Aug 29 15:47:31 2022 +0200 drm/scdc: Document hotplug gotchas There's some interactions between the SCDC setup and the disconnection / reconnection of displays. Let's document it and a solution. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-9-maxime@cerno.tech commit 6bed2ea3cb3856edf37cca20753e689ee8774793 Author: Maxime Ripard Date: Mon Aug 29 15:47:30 2022 +0200 drm/vc4: hdmi: Reset link on hotplug During a hotplug cycle (such as a TV going out of suspend, or when the cable is disconnected and reconnected), the expectation is that the same state used before the disconnection is reused until the next commit. However, the HDMI scrambling requires that some flags are set in the monitor, and those flags are very likely to be reset when the cable has been disconnected. This will thus result in a blank display, even if the display pipeline configuration hasn't been modified or is in the exact same state. The solution we've had so far is to enable the scrambling-related bits again on reconnection, but the HDMI 2.0 specification (Section 6.1.3.1 - Scrambling Control) requires that the scrambling enable bit is set before sending any scrambled video signal. Using that solution thus breaks that expectation. The solution used by i915 is to do a full modeset on the connector so that we disable the video signal, enable the scrambling bit, and enable the video signal again. As such, we took that code and plugged it into vc4. It probably could have been turned into an helper, but it proved to be difficult for several reasons: * i915 has fairly different structures than simpler KMS drivers such as vc4, so doing some code that works with both proved to be difficult; * Other simpler drivers could reuse some of it (tegra, dw-hdmi), but it would still require to move some parameters currently stored in private structure that are needed to compute whether the scrambling is needed or not, and then inform the driver that it needs to be enabled. Some of those parameters are already in core structures (drm_display_mode, drm_display_info, bpc), but the output format isnt't. Adding it is fairly challenging since unlike the TMDS char rate or mode, there's no consensus on what format to pick in drivers, so it's not possible to write some generic code that can depend on it. For these reasons, we chose to duplicate the code for now, until someone else really needs it as well, in which case we will be able to convert it into a generic helper. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-8-maxime@cerno.tech commit d0133e7da26c5548f7e376149a6a225b4274dcb1 Author: Maxime Ripard Date: Mon Aug 29 15:47:29 2022 +0200 drm/vc4: hdmi: Move vc4_hdmi_supports_scrambling() around We'll need it earlier in the driver, so let's move it next to the other scrambling-related helpers. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-7-maxime@cerno.tech commit 165ba1aad164b7d5d5bc327fa511f6ef693b207b Author: Maxime Ripard Date: Mon Aug 29 15:47:28 2022 +0200 drm/vc4: hdmi: Switch to detect_ctx We'll need the locking context in future patch, so let's convert .detect to .detect_ctx. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-6-maxime@cerno.tech commit c0895f80272cd4100a26129f4fb91a85bf6663a1 Author: Maxime Ripard Date: Mon Aug 29 15:47:27 2022 +0200 drm/vc4: hdmi: Simplify the hotplug handling Our detect callback has a bunch of operations to perform depending on the current and last status of the connector, such a setting the CEC physical address or enabling the scrambling again. This is currently dealt with a bunch of if / else statetements that make it fairly difficult to read and extend. Let's move all that logic to a function of its own. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-5-maxime@cerno.tech commit a74bfc9eaa497951effddefbcb18f1c7ab56fb35 Author: Gaosheng Cui Date: Mon Aug 22 11:51:33 2022 +0800 ASoC: Intel: fix unused-variable warning in probe_codec In configurations with CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=n, gcc warns about an unused variable: sound/soc/intel/skylake/skl.c: In function ‘probe_codec’: sound/soc/intel/skylake/skl.c:729:18: error: unused variable ‘skl’ [-Werror=unused-variable] struct skl_dev *skl = bus_to_skl(bus); ^~~ cc1: all warnings being treated as errors Fixes: 3fd63658caed9 ("ASoC: Intel: Drop hdac_ext usage for codec device creation") Signed-off-by: Gaosheng Cui Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220822035133.2147381-1-cuigaosheng1@huawei.com Signed-off-by: Takashi Iwai commit da94e9c64c19a7fb2caa896628cb501a06cc3e96 Author: Maxime Ripard Date: Mon Aug 29 15:47:26 2022 +0200 drm/vc4: hdmi: Remove mutex in detect We recently introduced a new mutex to protect concurrent execution of ALSA and KMS hooks, and the concurrent access to some of vc4_hdmi fields. However, using it in the detect hook was creating a reentrency issue with CEC code. Indeed, calling cec_s_phys_addr_from_edid from detect might call the CEC adap_enable hook with the lock held, eventually resulting in a deadlock. Since we didn't really need to protect anything at the moment in the CEC code, the decision was made to ignore the mutex in those CEC hooks, working around the issue. However, we can have the same thing happening if we end up triggering a mode set from the detect callback, for example using drm_atomic_helper_connector_hdmi_reset_link(). Since we don't really need to protect anything in detect either, let's just drop the lock in detect, and add it again in CEC. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-4-maxime@cerno.tech commit d098a31fe0f867cb7c00a4206740e768b00d8550 Author: Maxime Ripard Date: Mon Aug 29 15:47:25 2022 +0200 drm/vc4: hdmi: Remove unused argument in vc4_hdmi_supports_scrambling Even though vc4_hdmi_supports_scrambling takes a mode as an argument, it never uses it. Let's remove it. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-3-maxime@cerno.tech commit 58009c256b1134a5257407f60fd37396dc99cbca Author: Maxime Ripard Date: Mon Aug 29 15:47:24 2022 +0200 drm/vc4: hdmi: Constify drm_display_mode We don't modify the drm_display_mode pointer we have in the driver in most places, so let's make them const. Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220829134731.213478-2-maxime@cerno.tech commit 2aac1179717d2bf7ed2747a823c104c918d37a80 Author: Linus Walleij Date: Tue Sep 13 15:28:46 2022 +0200 ARM: dts: qcom: apq8060-dragonboard: Add TMA340 to APQ8060 DragonBoard This adds the CY8CTMA340 Touchscreen to the APQ8060 DragonBoard. Tested without display by issuing cat /dev/input/input/event3 which produces appropriate noise and interrupts on the dedicated GPIO line. Signed-off-by: Linus Walleij Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220913132846.305716-3-linus.walleij@linaro.org commit 77012a11c36e4609f2c0e0ff0bf215a8448d9033 Author: Linus Walleij Date: Tue Sep 13 15:28:45 2022 +0200 ARM: dts: qcom: msm8660: Add GSBI3 I2C bus GSBI3 can be used to enable an external I2C bus on e.g. the APQ8060. On the DragonBoard APQ8060 this I2C bus is used to talk to the Cypress CY8CTMA340 CYTTSP touchscreen. Signed-off-by: Linus Walleij Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220913132846.305716-2-linus.walleij@linaro.org commit affa747d36aa81b2285fe0221e2624b0afaa3482 Author: Linus Walleij Date: Tue Sep 13 15:28:44 2022 +0200 ARM: dts: qcom: msm8660: Add GSBI1 SPI bus GSBI1 can be used to enable an external SPI bus on e.g. the APQ8060. On the DragonBoard APQ8060 this SPI bus is used to talk to the LCD display. Signed-off-by: Linus Walleij [bjorn: Moved status properties last] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220913132846.305716-1-linus.walleij@linaro.org commit df2217ff17a8207295e77ec12a858545633bf4cb Author: Krishna Kurapati Date: Tue Sep 6 21:45:32 2022 +0530 phy: qcom-snps: Add support for overriding phy tuning parameters Add support for overriding electrical signal tuning parameters for SNPS HS Phy. Signed-off-by: Krishna Kurapati Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662480933-12326-3-git-send-email-quic_kriskura@quicinc.com Signed-off-by: Vinod Koul commit ba136ce380222e04774d431a106cd677d30026ec Author: Sandeep Maheswaram Date: Tue Sep 6 21:45:31 2022 +0530 dt-bindings: phy: qcom,usb-snps-femto-v2: Add phy override params bindings Add device tree bindings for SNPS phy tuning parameters. Signed-off-by: Sandeep Maheswaram Signed-off-by: Krishna Kurapati Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1662480933-12326-2-git-send-email-quic_kriskura@quicinc.com Signed-off-by: Vinod Koul commit 61a301ca83736afeeeb307b931c59f107067da3c Author: Judy Hsiao Date: Fri Aug 26 06:56:21 2022 +0000 arm64: dts: qcom: sc7280: Fix Dmic no sound on villager-r1 Fix the DMIC no sound issue of villager-r1 by using "PP1800_L2C" as the DMIC power source to match the hardware schematic. This patch: 1. set vdd-micb-supply to PP1800_L2C as the MIC Bias voltage regulator. 2. In audio-routing, set VA DMIC01~VA DMIC03 to use the vdd-micb-supply setting. Co-developed-by: Srinivasa Rao Mandadapu Signed-off-by: Srinivasa Rao Mandadapu Signed-off-by: Judy Hsiao Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220826065621.2255795-1-judyhsiao@chromium.org commit 29e0b604f040ef794cd36d43b97bd9c040ed99e6 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:53:04 2022 +0530 arm64: dts: qcom: sc7280: Add sound node for CRD 3.0/3.1 Add dt nodes for sound card support on rev5+ (aka CRD 3.0/3.1) boards, which is using WCD9385 headset playback, capture, I2S speaker playback and DMICs via VA macro. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-13-git-send-email-quic_srivasam@quicinc.com commit ece7d81f2447f4fd4f5d5345e921036871babf2b Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:53:03 2022 +0530 arm64: dts: qcom: sc7280: Add sound node for CRD 1.0/2.0 and IDP boards Add dt nodes for sound card support on revision 3, 4 (aka CRD 1.0 and 2.0) and IDP boards, which is using WCD9385 headset playback, capture, I2S speaker playback and DMICs via VA macro. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-12-git-send-email-quic_srivasam@quicinc.com commit f10c73ac6e90ca2343fc4f06b61ce8c1824c9bfd Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:53:02 2022 +0530 arm64: dts: qcom: sc7280: Enable lpass cpu node for CRD 3.0/3.1 Enable lpass cpu node and add pin control and dai-links for audio on sc7280 based platforms of rev5+ (aka CRD 3.0/3.1) boards. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-11-git-send-email-quic_srivasam@quicinc.com commit 8cf4133bc1fbb6fbc695e4398b940caf3ec59ba5 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:53:01 2022 +0530 arm64: dts: qcom: sc7280: Enable lpass cpu node for CRD 1.0/2.0 and IDP boards. Enable lpass cpu node and add pin control and dai-links for audio on sc7280 based platforms of revision 3, 4 (aka CRD 1.0 and 2.0) and IDP boards. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-10-git-send-email-quic_srivasam@quicinc.com commit aee6873edb93a3919706f70884e55880d8c727a5 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:53:00 2022 +0530 arm64: dts: qcom: sc7280: Add lpass cpu node Add lpass cpu node for audio on sc7280 based platforms. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-9-git-send-email-quic_srivasam@quicinc.com commit 14afeaf917375967bb84b4347cd8e4156b84c470 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:59 2022 +0530 arm64: dts: qcom: sc7280: herobrine: Add max98360a codec node Add max98360a codec node for audio use case on all herobrine boards. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-8-git-send-email-quic_srivasam@quicinc.com commit d6c006f510d9f29ff78761bb3ef50f14ebc05b7b Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:58 2022 +0530 arm64: dts: qcom: sc7280: Add max98360a codec for CRD 1.0/2.0 and IDP boards Add max98360a codec node for audio use case on revision 3, 4 (aka CRD 1.0 and 2.0) and IDP boards. Add amp_en node for max98360a codec pin control. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-7-git-send-email-quic_srivasam@quicinc.com commit 0a3a56a93fd96cb3e3d42778f275e91750c242a7 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:57 2022 +0530 arm64: dts: qcom: sc7280: Add wcd9385 codec node for CRD 3.0/3.1 Add wcd9385 codec node for audio use case on CRD rev5+ (aka CRD 3.0/3.1) boards. Add tlmm gpio property for switching CTIA/OMTP Headset. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-6-git-send-email-quic_srivasam@quicinc.com commit f8b4eb64f2003e0a1fa5011009955d46f90af285 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:56 2022 +0530 arm64: dts: qcom: sc7280: Add wcd9385 codec node for CRD 1.0/2.0 and IDP boards Add wcd9385 codec node for audio use case on sc7280 based platforms of revision 3, 4 (aka CRD 1.0 and 2.0) and IDP boards. Add tlmm gpio property for switching CTIA/OMTP Headset. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-5-git-send-email-quic_srivasam@quicinc.com commit d5a959f96be1b27c81d6197d66624cd6cc146fe6 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:55 2022 +0530 arm64: dts: qcom: sc7280: Enable digital codecs and soundwire for CRD 3.0/3.1 Enable rx, tx and va macro codecs and soundwire nodes for CRD rev5+ (aka CRD 3.0/3.1) boards. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-4-git-send-email-quic_srivasam@quicinc.com commit d3219de8bcebe4057696a2f99ce90c8812114c78 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:54 2022 +0530 arm64: dts: qcom: sc7280: Enable digital codecs and soundwire for CRD 1.0/2.0 and IDP boards Enable rx, tx and va macro codecs and soundwire nodes on revision 3, 4 (aka CRD 1.0 and 2.0) and IDP boards. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-3-git-send-email-quic_srivasam@quicinc.com commit 12ef689f09abb50f0862c8e08138dd45cbf27233 Author: Srinivasa Rao Mandadapu Date: Thu Jul 7 18:52:53 2022 +0530 arm64: dts: qcom: sc7280: Add nodes for soundwire and va tx rx digital macro codecs SC7280 has VA, TX and RX macros with SoundWire Controllers to attach with external codecs using soundwire masters. Add these nodes for sc7280 based platforms audio use case. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1657200184-29565-2-git-send-email-quic_srivasam@quicinc.com commit c9a406b42f5cce0695ee33b2ae1751fdb36911ee Author: Taniya Das Date: Thu Sep 1 09:47:25 2022 +0530 dt-bindings: clock: Add support for external MCLKs for LPASS on SC7280 Support external mclk to interface external MI2S clocks for SC7280. Fixes: 4185b27b3bef ("dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280") Acked-by: Rob Herring Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-5-git-send-email-quic_c_skakit@quicinc.com commit 42801e6185290d63691bd39cf8a3bba6cd5fe520 Author: Taniya Das Date: Thu Sep 1 09:47:24 2022 +0530 dt-bindings: clock: Add resets for LPASS audio clock controller for SC7280 Add support for LPASS audio clock gating for RX/TX/SWA core bus clocks for SC7280. Update reg property min/max items in YAML schema. Fixes: 4185b27b3bef ("dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280") Acked-by: Rob Herring Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-4-git-send-email-quic_c_skakit@quicinc.com commit 05c23128898b2f0bb87c7d31ef5e6ada51cb0b17 Author: Taniya Das Date: Thu Sep 1 09:47:22 2022 +0530 dt-bindings: clock: Add "qcom,adsp-pil-mode" property When this property is set, the remoteproc is used to boot the LPASS and therefore lpass_q6ss_ahbm_clk and lpass_q6ss_ahbs_clk clocks would be used to bring LPASS out of reset and the rest of the lpass clocks would be controlled directly by the remoteproc. This is a cleanup done to handle overlap of regmap of lpasscc and lpass_aon blocks. Signed-off-by: Taniya Das Signed-off-by: Satya Priya Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-2-git-send-email-quic_c_skakit@quicinc.com commit d42fae738f3ac58cb8ba1fcd48510a40b57a3155 Author: Jimmy Chen Date: Tue Jul 26 17:45:49 2022 +0800 arm64: dts: qcom: Add LTE SKUs for sc7280-villager family This adds LTE skus for villager device tree files. Signed-off-by: Jimmy Chen Reviewed-by: Douglas Anderson Reviewed-by: Sibi Sankar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/SG2PR03MB5006B0C3E57803E3B1E0EDBCCC949@SG2PR03MB5006.apcprd03.prod.outlook.com commit ac439ce88edf68b468e8d472e09ee2b1a2be929f Author: Johan Hovold Date: Tue Sep 6 09:45:50 2022 +0200 phy: qcom-qmp: drop dual-lane comments Drop the obsolete and misleading dual-lane comments which gave the impression that only combo PHYs have a second lane. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220906074550.4383-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 278786153b908f225e1f6ac88b6bbd3fee7253d1 Author: Johan Hovold Date: Tue Sep 6 09:45:49 2022 +0200 phy: qcom-qmp-pcie: shorten function prefixes The driver function prefix has gotten unnecessarily long and hurts readability. Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm Multi PHY" or similar anyway). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220906074550.4383-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 95153de6b92818a132b9a2f7361ecd6e191f6aad Author: Dmitry Baryshkov Date: Tue Sep 6 09:45:48 2022 +0200 phy: qcom-qmp-pcie: drop if (table) conditions Drop unused if (table) conditions, since the function qcom_qmp_phy_pcie_configure_lane() has this check anyway. Signed-off-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220906074550.4383-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 7c6a6641c24d30ab6f5456d19e15e64bea971b82 Author: Taniya Das Date: Thu Sep 1 09:47:26 2022 +0530 clk: qcom: lpass: Add support for resets & external mclk for SC7280 The clock gating control for TX/RX/WSA core bus clocks would be required to be reset(moved from hardware control) from audio core driver. Thus add the support for the reset clocks. Update the lpass_aon_cc_main_rcg_clk_src ops to park the RCG at XO after disable as this clock signal is used by hardware to turn ON memories in LPASS. Also add the external mclk to interface external MI2S. Fixes: a9dd26639d05 ("clk: qcom: lpass: Add support for LPASS clock controller for SC7280") Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-6-git-send-email-quic_c_skakit@quicinc.com commit 0cbcfbe50cbff331c775982a53bc4fa66c875b36 Author: Taniya Das Date: Thu Sep 1 09:47:23 2022 +0530 clk: qcom: lpass: Handle the regmap overlap of lpasscc and lpass_aon Move registration of lpass_q6ss_ahbm_clk and lpass_q6ss_ahbs_clk to lpass_aon_cc_sc7280_probe and register them only if "qcom,adsp-pil-mode" is enabled in the lpass_aon DT node. Signed-off-by: Taniya Das Signed-off-by: Satya Priya Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-3-git-send-email-quic_c_skakit@quicinc.com commit adb12f06366651e36ef677347699345e227be919 Merge: 6956c18f4ad92 1c3f9df77a506 Author: Bjorn Andersson Date: Tue Sep 13 09:48:16 2022 -0500 Merge branch '1662005846-4838-1-git-send-email-quic_c_skakit@quicinc.com' into clk-for-6.1 commit 1c3f9df77a506355b3c7761039b53e55ce746f17 Author: Taniya Das Date: Thu Sep 1 09:47:25 2022 +0530 dt-bindings: clock: Add support for external MCLKs for LPASS on SC7280 Support external mclk to interface external MI2S clocks for SC7280. Fixes: 4185b27b3bef ("dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280") Acked-by: Rob Herring Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-5-git-send-email-quic_c_skakit@quicinc.com commit be9439df235352a41605bf2cc8ba10aa0fc40d29 Author: Taniya Das Date: Thu Sep 1 09:47:24 2022 +0530 dt-bindings: clock: Add resets for LPASS audio clock controller for SC7280 Add support for LPASS audio clock gating for RX/TX/SWA core bus clocks for SC7280. Update reg property min/max items in YAML schema. Fixes: 4185b27b3bef ("dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280") Acked-by: Rob Herring Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-4-git-send-email-quic_c_skakit@quicinc.com commit 7afdf3afff6f434a2c0b5d55e03ae14d7992d48c Author: Taniya Das Date: Thu Sep 1 09:47:22 2022 +0530 dt-bindings: clock: Add "qcom,adsp-pil-mode" property When this property is set, the remoteproc is used to boot the LPASS and therefore lpass_q6ss_ahbm_clk and lpass_q6ss_ahbs_clk clocks would be used to bring LPASS out of reset and the rest of the lpass clocks would be controlled directly by the remoteproc. This is a cleanup done to handle overlap of regmap of lpasscc and lpass_aon blocks. Signed-off-by: Taniya Das Signed-off-by: Satya Priya Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1662005846-4838-2-git-send-email-quic_c_skakit@quicinc.com commit 3accba70e2389a47f42ffb5e900d01b7960dea9e Author: Jimmy Chen Date: Tue Jul 26 17:45:48 2022 +0800 arm64: dts: qcom: sc7280: Add herobrine-villager-r1 This adds sc7280-herobrine-villager-r1.dts for villager device tree files. Herobrine-r1 is exactly the same as -r0 except that it uses a different audio solution (it uses the same one as the CRD). Signed-off-by: Jimmy Chen Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/SG2PR03MB500667CFE3F5F59585F8BA77CC949@SG2PR03MB5006.apcprd03.prod.outlook.com commit 593ad9132fd854f5916f68855204fb3b487cb408 Author: Jimmy Chen Date: Tue Jul 26 17:45:47 2022 +0800 dt-bindings: arm: qcom: document sc7280 and villager board This adds a LTE skus for Chromebook Villager to the yaml. Signed-off-by: Jimmy Chen Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/SG2PR03MB5006CE1EB9BFD95511133CA6CC949@SG2PR03MB5006.apcprd03.prod.outlook.com commit 02887b045bfcbaf5de44e05bc7da893026b441e1 Author: Johan Hovold Date: Fri Sep 2 10:07:05 2022 +0200 dt-bindings: phy: qcom,qmp-usb3-dp: add missing power-domains property At least the "qcom,sc8280xp-qmp-usb43dp-phy" binding requires a power domain to be specified. Fixes: aa27597e594c ("dt-bindings: phy: qcom,qmp: Add compatible for SC8280XP USB phys") Signed-off-by: Johan Hovold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220902080705.12050-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 3876ed2b45759b805ba71e9356cb7d56c8183cdd Author: Johan Hovold Date: Fri Sep 2 10:07:04 2022 +0200 dt-bindings: phy: qcom,qmp-usb: add missing power-domains property At least the "sc8280xp-qmp-usb3-uni-phy" binding requires a power domain to be specified. Fixes: aa27597e594c ("dt-bindings: phy: qcom,qmp: Add compatible for SC8280XP USB phys") Signed-off-by: Johan Hovold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220902080705.12050-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit da995e22fa7193b067f2545e63d726ffe36ba174 Author: Shengjiu Wang Date: Tue Sep 13 16:26:34 2022 +0800 ASoC: ak4458: Add ak4458_reset in device probe and remove This patch fixup this warning when CONFIG_PM not defined linux/sound/soc/codecs/ak4458.c:631:13: error: 'ak4458_reset' defined but\ not used [-Werror=unused-function] 631 | static void ak4458_reset(struct ak4458_priv *ak4458, bool active) | ^~~~~~~~~~~~ cc1: all warnings being treated as errors Fixes: e9e7df88996d64 ("ASoC: ak4458: Remove component probe() and remove()") Reported-by: Kuninori Morimoto Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1663057594-29141-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit e2741d99420f2d961884649c1de6e19c9dace61f Merge: 26cc239f9e016 7e18e42e4b280 Author: Mark Brown Date: Tue Sep 13 15:05:38 2022 +0100 ASoC: Merge tag 'v6.0-rc4' into asoc-6.1 Linux 6.0-rc4 so we can test on BeagleBone again. commit 1cc5a52e873a4f9725eafe5aa9cd213b7b58e29e Author: AngeloGioacchino Del Regno Date: Tue Sep 13 14:34:56 2022 +0200 regulator: Add driver for MT6332 PMIC regulators Add a driver for the regulators found in the MT6332 PMICs, including six buck and four LDO regulators. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220913123456.384513-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit e22943e32e1fc314b8e2b095ae3495d1bfa9aca5 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 14:34:55 2022 +0200 regulator: Add bindings for MT6332 regulator Add devicetree bindings for the regulators found in the MT6332 PMIC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220913123456.384513-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 6f7a71f804287a7566314ab1a73d8ca2c18ca0d7 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 14:34:54 2022 +0200 regulator: Add driver for MT6331 PMIC regulators Add a driver for the regulators found in the MT6331 PMIC. This PMIC features six buck and 21 Low DropOut (LDO) regulators. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220913123456.384513-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 6385e21692bbb0b35eca8120d576b3c1ba1ad9d3 Author: AngeloGioacchino Del Regno Date: Tue Sep 13 14:34:53 2022 +0200 regulator: Add bindings for MT6331 regulator Add the bindings for the regulators found in the MT6331 PMIC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220913123456.384513-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit b0131107335d21d0b25019ce18d82e93b13b9559 Author: Horatiu Vultur Date: Thu Sep 1 14:14:55 2022 +0200 phy: Add RGMII support on lan966x The serdes driver contains also a mux to decide which interface type to use. Currently the driver supports GMII/SGMII/QSGMII and partially RGMII. As it doesn't support all the other RGMII interfaces like RGMII_TXID/RXID/ID and it could run only at 1G. Therefore extend this for all the other speeds(10/100) and also allow the other interfaces. Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220901121455.245103-1-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit b4e12b2d70fd9eccdb3cef8015dc1788ca38e3fd Author: Namhyung Kim Date: Thu Sep 8 14:41:04 2022 -0700 perf: Kill __PERF_SAMPLE_CALLCHAIN_EARLY There's no in-tree user anymore. Let's get rid of it. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220908214104.3851807-3-namhyung@kernel.org commit 16817ad7e8b31728b44ff9f17d8d894ed8a450d0 Author: Namhyung Kim Date: Thu Sep 8 14:41:03 2022 -0700 perf/bpf: Always use perf callchains if exist If the perf_event has PERF_SAMPLE_CALLCHAIN, BPF can use it for stack trace. The problematic cases like PEBS and IBS already handled in the PMU driver and they filled the callchain info in the sample data. For others, we can call perf_callchain() before the BPF handler. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220908214104.3851807-2-namhyung@kernel.org commit 3749d33e510c3dc695b3a5886b706310890d7ebd Author: Namhyung Kim Date: Thu Sep 8 14:41:02 2022 -0700 perf: Use sample_flags for callchain So that it can call perf_callchain() only if needed. Historically it used __PERF_SAMPLE_CALLCHAIN_EARLY but we can do that with sample_flags in the struct perf_sample_data. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220908214104.3851807-1-namhyung@kernel.org commit b78e5d830f0db8e6d998cdc5a2b7b807cf463f99 Author: Jouni Högander Date: Tue Aug 23 14:29:20 2022 +0300 drm/tests: Set also mock plane src_x, src_y, src_w and src_h We need to set also src_x, src_y, src_w and src_h for the mock plane. After fix for drm_atomic_helper_damage_iter_init we are using these when iterating damage_clips. Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220823112920.352563-5-jouni.hogander@intel.com Reviewed-by: Mika Kahola Tested-by: Maíra Canal commit dd9b18e76f0434e47ee8f5243727c79a66a85243 Author: Jouni Högander Date: Tue Aug 23 14:29:17 2022 +0300 drm: Use original src rect while initializing damage iterator drm_plane_state->src might be modified by the driver. This is done e.g. in i915 driver when there is bigger framebuffer than the plane and there is some offset within framebuffer. I915 driver calculates separate offset and adjusts src rect coords to be relative to this offset. Damage clips are still relative to original src coords provided by user-space. This patch ensures original coordinates provided by user-space are used when initiliazing damage iterator. Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220823112920.352563-2-jouni.hogander@intel.com Reviewed-by: Mika Kahola commit 4ff0856db045e1b18074127cc7222c481a99657e Author: Jouni Högander Date: Tue Aug 23 14:29:19 2022 +0300 drm/i915/display: Use drm helper instead of own loop for damage clips Use existing drm_atomic_helper_damage_merged from generic drm code instead of implementing own loop to iterate over damage_clips. Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220823112920.352563-4-jouni.hogander@intel.com Reviewed-by: Mika Kahola commit f4a2f273033e059de2266aa10b6459bd36b92223 Author: Jouni Högander Date: Tue Aug 23 14:29:18 2022 +0300 drm/i915/display: Use original src in psr2 sel fetch area calculation drm_plane_state->src is modified when offset is calculated: before calculation: src.x1 = 8192, src.y1 = 8192 after calculation (pitch = 65536, cpp = 4, alignment = 262144) src.x1 = 8192, src.y1 = 0, offset = 0x20000000 Damage clips are relative to original coodrdinates provided by user-space. To compare these against src coordinates we need to use original coordinates as provided by user-space. These can be obtained by using drm_plane_state_src. Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220823112920.352563-3-jouni.hogander@intel.com Reviewed-by: Mika Kahola commit 38c4a08c820cd2483750a68f2bf84c3665fe6137 Author: Vignesh Raghavendra Date: Thu Sep 1 19:43:28 2022 +0530 arm64: dts: ti: Add support for AM62A7-SK AM62A StarterKit (SK) board is a low cost, small form factor board designed for TI’s AM62A7 SoC. It supports the following interfaces: * 2 GB LPDDR4 RAM * x1 Gigabit Ethernet interface * x1 HDMI Port with audio * x1 Headphone Jack * x1 USB2.0 Hub with two Type A host and x1 USB Type-C DRP Port * x1 UHS-1 capable µSD card slot * M.2 SDIO Wifi + UART slot * 1Gb OSPI NAND flash * x4 UART through UART-USB bridge * XDS110 for onboard JTAG debug using USB * Temperature sensors, user push buttons and LEDs * 40-pin User Expansion Connector * 24-pin header for peripherals in MCU island (I2C, UART, SPI, IO) * 20-pin header for Programmable Realtime Unit (PRU) IO pins * 40-pin CSI header Add basic support for AM62A7-SK. Schematics: https://www.ti.com/lit/zip/sprr459 Co-developed-by: Bryan Brattlof Signed-off-by: Bryan Brattlof Signed-off-by: Vignesh Raghavendra Tested-by: Devarsh Thakkar Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220901141328.899100-6-vigneshr@ti.com commit 5fc6b1b62639c764e6e7e261f384d2fb47eff39b Author: Vignesh Raghavendra Date: Thu Sep 1 19:43:27 2022 +0530 arm64: dts: ti: Introduce AM62A7 family of SoCs The AM62A SoC belongs to the K3 Multicore SoC architecture platform that can run edge AI applications with Video/Vision processing. This provides advanced system integration with high security support to enable a broad set of applications in industrial/automotive markets such as, driver monitoring, machine vision, smart camera, eMirror, front camera, robotics, and building automation. Some highlights of AM62A SoC are: * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster. Dual/Single core variants are provided in the same package to allow HW compatible designs. * One Device manager Cortex-R5F for system power and resource management, and one Cortex-R5F for Functional Safety or general-purpose usage. * One AI accelerator (up to 2 TOPS), using one C7x256V DSP w/Matrix Multiplier accelerator (MMA) for Deep Learning usage. * VPAC3L(Vision Pre-processing Accelerator), providing 12-bit ISP up to 315MPixel/s RGB+IR support, and Noise Filter for improved integrated imaging and vision image processing. * H.264/H.265 Video Encode/Decode. + Motion JPEG encode * Display support, providing 24-bit RBG parallel interface up to 200MHz pixel clock support for 2K display resolution. * Integrated Giga-bit Ethernet switch supporting up to a total of two external ports (TSN capable). * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for NAND/FPGA connection, OSPI memory controller, 3x McASP for audio, 1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals. * Dedicated Centralized Hardware Security Module with support for secure boot, debug security and crypto acceleration and trusted execution environment * One 32 bit DDR Subsystem that supports LPDDR4, DDR4 memory types. * Multiple low power modes support, ex: Deep sleep, Standby, MCU-only, enabling battery powered system design. More details about the SoCs can be found in the Technical Reference Manual: https://www.ti.com/lit/zip/spruj16 Co-developed-by: Bryan Brattlof Signed-off-by: Bryan Brattlof Signed-off-by: Vignesh Raghavendra Tested-by: Devarsh Thakkar Link: https://lore.kernel.org/r/20220901141328.899100-5-vigneshr@ti.com commit 1607e6f9289cdb4c982a223e80ff3c5e827b7cd4 Author: Vignesh Raghavendra Date: Thu Sep 1 19:43:26 2022 +0530 dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62A Add pinctrl macros for AM62AX SoCs. These macro definitions are similar to that of previous platforms, but adding new definitions to avoid any naming confusions in the SoC dts files. checkpatch insists the following error exists: ERROR: Macros with complex values should be enclosed in parentheses However, we do not need parentheses enclosing the values for this macro as we do intend it to generate two separate values as has been done for other similar platforms. Signed-off-by: Vignesh Raghavendra Tested-by: Devarsh Thakkar Acked-by: Krzysztof Kozlowski Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20220901141328.899100-4-vigneshr@ti.com commit cad20a8de86f37d2500963b1a424f9d658d8e54a Author: Vignesh Raghavendra Date: Thu Sep 1 19:43:25 2022 +0530 dt-bindings: arm: ti: Add bindings for AM62A7 SoC This adds bindings for TI's AM62A7 family of devices. Signed-off-by: Vignesh Raghavendra Tested-by: Devarsh Thakkar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220901141328.899100-3-vigneshr@ti.com commit a3c52977419beabc5cb4d6f0b062fd4cb460e54d Author: Vignesh Raghavendra Date: Thu Sep 1 19:43:24 2022 +0530 dt-bindings: arm: ti: Rearrange IOPAD macros alphabetically Rearrange SOC specific IOPAD macros alphabetically, so that its easier to read. No functional change intended. Signed-off-by: Vignesh Raghavendra Tested-by: Devarsh Thakkar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220901141328.899100-2-vigneshr@ti.com commit 30d8b7d43c840f5907c0e688d41093f176ba8ac1 Author: Elaine Zhang Date: Wed Sep 7 21:31:56 2022 +0530 clk: rockchip: Add MUXTBL variant Add a clock branch consisting of a mux with non-standard select values. The parent in Mux table is sorted by priority. Use clk_register_mux_table() to register such a mux-clock. Cc: linux-clk@vger.kernel.org Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Elaine Zhang Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220907160207.3845791-3-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 614ce48b63c80ddfb627c21f936675a702498528 Author: Jagan Teki Date: Wed Sep 7 21:32:01 2022 +0530 dt-bindings: soc: rockchip: Document RV1126 pmugrf Document compatible string for Rockchip RV1126 pmugrf. Acked-by: Rob Herring Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220907160207.3845791-8-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 26d8b279392ca93d9b725a3a05f6058db514b244 Author: Jagan Teki Date: Wed Sep 7 21:32:00 2022 +0530 dt-bindings: soc: rockchip: Document RV1126 grf Document compatible string for Rockchip RV1126 grf. Acked-by: Rob Herring Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220907160207.3845791-7-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit cae5cb0cabc4847781fb359d98f7e1d9c7a7909e Author: Jouni Högander Date: Mon Sep 5 13:23:55 2022 +0300 drm/i915/psr: Disable PSR2 when SDP is sent on prior line Selective update doesn't work if SU start address is 0 and start/end SDP is configured to be sent prior to SU start/end lines. PSR2 has to be disabled in this case for Alder Lake. HSDES: 22012279113 Cc: Mika Kahola Cc: José Roberto de Souza Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220905102355.176622-3-jouni.hogander@intel.com Reviewed-by: Mika Kahola commit eccfba1785b52887d0aa4d2940a396afd53f0054 Author: Jouni Högander Date: Mon Sep 5 13:23:54 2022 +0300 drm/i915/psr: Equation changed for sending start/stop on prior line Equation for sending start/end SDP prior to the SU region start/end has changed. Update used formula. Bspec: 49274 Cc: Mika Kahola Cc: José Roberto de Souza Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220905102355.176622-2-jouni.hogander@intel.com Reviewed-by: Mika Kahola commit 1bba5543e4fe7f60480fee370eb260618ee98282 Author: Ville Syrjälä Date: Fri Sep 9 23:59:32 2022 +0300 drm/i915: Fix TV encoder clock computation The TV encoder has its own special clocking strategy, which means we can't just use intel_crtc_dotclock() to figure out what the resulting dotclock will be given the actual DPLL port_clock. Additionally the DPLL can't always generate exactly the frequency we initially asked for. This results in us computing a bogus dotclock/etc., and it won't match the readout which is handled by the encoder itself properly. Naturally the state checker becomes unhappy with the mismatch. To do this sanely we'll need to move the DPLL computation into encoder->compute_config() so that all the derived state gets correctly computed based on the actual DPLL output frequency. Start doing that just for the TV encoder initally as intel_crtc_dotclock() should be able to handle other encoder types well enough. Though eventually this should be done for all encoder types rather than doing it from intel_crtc_compute_config(). With this we actually do some of the DPLL state computation twice, but we can skip the second actual .find_dpll() search by flagging .clock_set=true after we've done it once. We also still need to avoid clobbering the correct adjusted_mode.crtc_clock set up by encoder->compute_config() when called a second time from intel_crtc_compute_config(). Fixes: 665a7b04092c ("drm/i915: Feed the DPLL output freq back into crtc_state") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220909205932.32537-1-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit 758b018aa28342b5c54646987f8f6ce675cd7bae Author: Ville Syrjälä Date: Wed Sep 7 12:35:34 2022 +0300 drm/i915/bios: Add the "Disable compression for the Display Port/HDMI external display" bit The child device block has gained a new bit for disabling compression for external displays. Seems stupid, but there it is. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907093534.29004-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ab30464cf0616d0aee00df899115e19051471281 Author: Ville Syrjälä Date: Wed Sep 7 12:35:33 2022 +0300 drm/i915/bios: Fix VBT ACPI DPMS bit polarity We have the ACPI vs. not ACPI DPMS bit polarity the wrong way around. Fix it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907093534.29004-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit c9ae520ac3faf2f272b5705b085b3778c7997ec8 Author: Heiner Kallweit Date: Tue Sep 6 20:24:57 2022 +0200 r8169: remove rtl_wol_shutdown_quirk() Since f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled") it has been redundant to disable PCI bus mastering in rtl_wol_shutdown_quirk(). And since 120068481405 ("r8169: fix failing WoL") CmdRxEnb is still enabled when we get here. So we can remove the function. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/2391ada0-eac5-ac43-f061-a7a44b0e7f33@gmail.com Signed-off-by: Paolo Abeni commit 4053a41282f8aae290d3fe7b8daef4c8c53a4ab8 Author: Jaroslav Kysela Date: Tue Sep 13 09:03:07 2022 +0200 ALSA: hda/hdmi: change type for the 'assigned' variable This change converts the assigned value from int type to the bool type to retain consistency with other structure members like 'setup', 'non_pcm' etc. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220913070307.3234038-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 41e3b0722f6c7c756702f50d194b0d6caa0fba26 Author: Pieter Jansen van Vuuren Date: Tue Sep 6 11:56:20 2022 +0100 sfc: introduce shutdown entry point in efx pci driver Make the device inactive when the system shutdown callback has been invoked. This is achieved by freezing the driver and disabling the PCI bus mastering. Co-developed-by: Martin Habets Signed-off-by: Martin Habets Signed-off-by: Pieter Jansen van Vuuren Acked-by: Edward Cree Link: https://lore.kernel.org/r/20220906105620.26179-1-pieter.jansen-van-vuuren@amd.com Signed-off-by: Paolo Abeni commit 7573e6577f7744fa6c5f48e5f521b780c97991ef Author: Jani Nikula Date: Mon Sep 12 16:23:13 2022 +0300 drm/i915/dp: use drm_dp_phy_name() for logging Drop the local intel_dp_phy_name() function, and replace with drm_dp_phy_name(). This lets us drop a number of local buffers. v2: Rebase Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Reviewed-by: Andrzej Hajda Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220912132313.2774603-1-jani.nikula@intel.com commit 8140654e781de334601b260b493ff13e14379ff8 Author: Zhang Qilong Date: Tue Aug 23 19:20:22 2022 +0800 f2fs: simplify code in f2fs_prepare_decomp_mem It could return directly after init_decompress_ctx. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ddd3b16c8cc54ce776bf117bde0c4d588706ea49 Author: Zhang Qilong Date: Mon Aug 29 21:31:20 2022 +0800 f2fs: replace logical value "true" with a int number The "true" is not match the parametera type "int", and we modify it. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit da35fe96d12d15779f3cb74929b7ed03941cf983 Author: Jaegeuk Kim Date: Tue Aug 23 10:18:42 2022 -0700 f2fs: increase the limit for reserve_root This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation. Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it. Cc: stable@vger.kernel.org Reported-by: Aran Dalton Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4f99484d27961cb194cebcd917176fa038a5025f Author: Jaegeuk Kim Date: Thu Aug 18 22:40:09 2022 -0700 f2fs: complete checkpoints during remount Otherwise, pending checkpoints can contribute a race condition to give a quota warning. - Thread - checkpoint thread add checkpoints to the list do_remount() down_write(&sb->s_umount); f2fs_remount() block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Or, do_remount() down_write(&sb->s_umount); f2fs_remount() create a ckpt thread f2fs_enable_checkpoint() adds checkpoints wait for f2fs_sync_fs() trigger another pending checkpoint block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Cc: stable@vger.kernel.org Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c7b58576370147833999fd4cc874d0f918bdf9ca Author: Jaegeuk Kim Date: Fri Aug 19 15:52:02 2022 -0700 f2fs: flush pending checkpoints when freezing super This avoids -EINVAL when trying to freeze f2fs. Cc: stable@vger.kernel.org Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f4209f692e3437c313e83bd057e6dc0c7f952549 Merge: 446bc11f86144 cbcdf8c4d35cd Author: Takashi Iwai Date: Tue Sep 13 07:55:54 2022 +0200 Merge branch 'for-linus' into for-next commit 825477e779121342d12e3c871a5e7487530b5a5d Author: Radhakrishna Sripada Date: Thu Sep 1 23:03:39 2022 -0700 drm/i915/mtl: Obtain SAGV values from MMIO instead of GT pcode mailbox From Meteorlake, Latency Level, SAGV bloack time are read from LATENCY_SAGV register instead of the GT driver pcode mailbox. DDR type and QGV information are also to be read from Mem SS registers. v2: - Simplify MTL_MEM_SS_INFO_QGV_POINT macro(MattR) - Nit: Rearrange the bit def's from higher to lower(MattR) - Restore platform definition for ADL-P(MattR) - Move back intel_qgv_point def to intel_bw.c(Jani) v3: - Rebase Bspec: 64636, 64608 Cc: Jani Nikula Reviewed-by: Matt Roper Original Author: Caz Yokoyama Signed-off-by: José Roberto de Souza Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220902060342.151824-9-radhakrishna.sripada@intel.com commit 85d53200507916955be64b1e2cbca713b8ebe3bc Author: Imre Deak Date: Thu Sep 1 23:03:38 2022 -0700 drm/i915/mtl: Add DP AUX support on TypeC ports On MTL TypeC ports the AUX_CH_CTL and AUX_CH_DATA addresses have changed wrt. previous platforms, adjust the code accordingly. Signed-off-by: Imre Deak Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220902060342.151824-8-radhakrishna.sripada@intel.com commit 40151be79668232187b1ba7e00983be76a7f5845 Author: Imre Deak Date: Thu Sep 1 23:03:37 2022 -0700 drm/i915/mtl: Add display power wells Add support for display power wells on MTL. The differences from XE_LPD: - The AUX HW block is moved to the PICA block, where the registers are on an always-on power well and the functionality needs to be powered on/off via the AUX_CH_CTL register: [1], [2] - The DDI IO power on/off programming sequence is moved to the PHY PLL enable/disable sequence. [3], [4], [5] Bspec: [1] 49233, [2] 65247, [3] 64568, [4] 65451, [5] 65450 v2: - Update the comment in aux power well enable - Reuse the noop sync fn for aux sync. - Use REG_BIT for new register bit definitions Signed-off-by: Imre Deak Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220902060342.151824-7-radhakrishna.sripada@intel.com commit e5d464d02f0681c4677c0bb5f6c0a70c8be78ab6 Author: Radhakrishna Sripada Date: Thu Sep 1 23:03:36 2022 -0700 drm/i915/mtl: Add gmbus and gpio support Add tables to map the GMBUS pin pairs to GPIO registers and port to DDC. From spec we have registers GPIO_CTL[1-5] mapped to native display phys and GPIO_CTL[9-12] are mapped to TC ports. v2: - Drop unused GPIO pins(MattR) BSpec: 49306 Cc: Matt Roper Original Author: Brian J Lovin Signed-off-by: Radhakrishna Sripada Reviewed-by: Balasubramani Vivekanandan Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220902060342.151824-6-radhakrishna.sripada@intel.com commit f9e932a83ac0bb18ff71014d912af9c8e4d8eab0 Author: Radhakrishna Sripada Date: Fri Sep 2 15:10:54 2022 -0700 drm/i915: Move display and media IP version to runtime info Future platforms can read the IP version from a register and the IP version numbers need not be hard coded in device info. Move the ip version for media and display to runtime info. On platforms where hard coding of IP version is required, update the IP version in __runtime under device_info. v2: - Avoid name collision for ip versions(Jani) v4.1: - Fix build error in mock_gem_device.c v4.2: - Use ip instead of version for ip_vesion member.(MattR) Suggested-by: Jani Nikula Cc: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220902221054.173524-1-radhakrishna.sripada@intel.com commit 4c00cba122f3f3ae54aa5a3a1aec3afc7a2e6f94 Author: Rajvi Jingar Date: Tue Aug 30 03:49:12 2022 -0700 PCI/PM: Simplify pci_pm_suspend_noirq() We always want to save the device state unless the driver has already done it. Rearrange the checking in pci_pm_suspend_noirq() to make this more clear. No functional change intended. [bhelgaas: commit log, rewrap comment] Link: https://lore.kernel.org/r/20220830104913.1620539-1-rajvi.jingar@linux.intel.com Signed-off-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki commit c01163dbd1b8aa016c163ff4bf3a2e90311504f1 Author: Bjorn Helgaas Date: Fri Sep 9 15:25:05 2022 -0500 PCI/PM: Always disable PTM for all devices during suspend We want to disable PTM on Root Ports because that allows some chips, e.g., Intel mobile chips since Coffee Lake, to enter a lower-power PM state. That means we also have to disable PTM on downstream devices. PCIe r6.0, sec 2.2.8, recommends that functions support generation of messages in non-D0 states, so we have to assume Switch Upstream Ports or Endpoints may send PTM Requests while in D1, D2, and D3hot. A PTM message received by a Downstream Port (including a Root Port) with PTM disabled must be treated as an Unsupported Request (sec 6.21.3). PTM was previously disabled only for Root Ports, and it was disabled in pci_prepare_to_sleep(), which is not called at all if a driver supports legacy PM or does its own state saving. Instead, disable PTM early in pci_pm_suspend() and pci_pm_runtime_suspend() so we do it in all cases. Previously PTM was disabled *after* saving device state, so the state restore on resume automatically re-enabled it. Since we now disable PTM *before* saving state, we must explicitly re-enable it in pci_pm_resume() and pci_pm_runtime_resume(). Here's a sample of errors that occur when PTM is disabled only on the Root Port. With this topology: 0000:00:1d.0 Root Port to [bus 08-71] 0000:08:00.0 Switch Upstream Port to [bus 09-71] Kai-Heng reported errors like this: pcieport 0000:00:1d.0: [20] UnsupReq (First) pcieport 0000:00:1d.0: AER: TLP Header: 34000000 08000052 00000000 00000000 Decoding TLP header 0x34...... (0011 0100b) and 0x08000052: Fmt 001b 4 DW header, no data Type 1 0100b Msg (Local - Terminate at Receiver) Requester ID 0x0800 Bus 08 Devfn 00.0 Message Code 0x52 0101 0010b PTM Request The 00:1d.0 Root Port logged an Unsupported Request error when it received a PTM Request with Requester ID 08:00.0. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215453 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216210 Fixes: a697f072f5da ("PCI: Disable PTM during suspend to save power") Link: https://lore.kernel.org/r/20220909202505.314195-10-helgaas@kernel.org Reported-by: Kai-Heng Feng Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit d736d292bba2c5225cb76cd4e04d0e9d00f22498 Author: Bjorn Helgaas Date: Fri Sep 9 15:25:04 2022 -0500 PCI/PTM: Consolidate PTM interface declarations Consolidate all the PTM-related declarations in drivers/pci/pci.h. No functional change intended. Link: https://lore.kernel.org/r/20220909202505.314195-9-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 8b367e75ac482486bbfd1ca832734bec64498f73 Author: Bjorn Helgaas Date: Fri Sep 9 15:25:03 2022 -0500 PCI/PTM: Reorder functions in logical order pci_enable_ptm() and pci_disable_ptm() were separated. pci_save_ptm_state() and pci_restore_ptm_state() dangled at the top. Move them to logical places. No functional change intended. Link: https://lore.kernel.org/r/20220909202505.314195-8-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 2b89c22f2434b931b3cf22298ac5f5ec089e9ad1 Author: Bjorn Helgaas Date: Fri Sep 9 15:25:02 2022 -0500 PCI/PTM: Preserve RsvdP bits in PTM Control register Even though only the low 16 bits of PTM Control are currently defined, the register is 32 bits wide and the unused bits are RsvdP ("Reserved and Preserved"), so software must preserve the values of those bits when writing the register. Update PTM Control reads and writes to use 32-bit accesses and preserve the reserved bits on writes. Link: https://lore.kernel.org/r/20220909202505.314195-7-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Mika Westerberg commit 91b12b2a100e977274d3c277a4ff2df0b7439e7d Author: Bjorn Helgaas Date: Fri Sep 9 15:25:01 2022 -0500 PCI/PTM: Move pci_ptm_info() body into its only caller pci_ptm_info() is simple and is only called by pci_enable_ptm(). Move the entire body there. No functional change intended. Link: https://lore.kernel.org/r/20220909202505.314195-6-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Mika Westerberg commit e8bdc5ea481638e0a4fd5639050d2b170417f493 Author: Bjorn Helgaas Date: Fri Sep 9 15:25:00 2022 -0500 PCI/PTM: Add pci_suspend_ptm() and pci_resume_ptm() We disable PTM during suspend because that allows some Root Ports to enter lower-power PM states, which means we also need to disable PTM for all downstream devices. Add pci_suspend_ptm() and pci_resume_ptm() for this purpose. pci_enable_ptm() and pci_disable_ptm() are for drivers to use to enable or disable PTM. They use dev->ptm_enabled to keep track of whether PTM should be enabled. pci_suspend_ptm() and pci_resume_ptm() are PCI core-internal functions to temporarily disable PTM during suspend and (depending on dev->ptm_enabled) re-enable PTM during resume. Enable/disable/suspend/resume all use internal __pci_enable_ptm() and __pci_disable_ptm() functions that only update the PTM Control register. Outline: pci_enable_ptm(struct pci_dev *dev) { __pci_enable_ptm(dev); dev->ptm_enabled = 1; pci_ptm_info(dev); } pci_disable_ptm(struct pci_dev *dev) { if (dev->ptm_enabled) { __pci_disable_ptm(dev); dev->ptm_enabled = 0; } } pci_suspend_ptm(struct pci_dev *dev) { if (dev->ptm_enabled) __pci_disable_ptm(dev); } pci_resume_ptm(struct pci_dev *dev) { if (dev->ptm_enabled) __pci_enable_ptm(dev); } Nothing currently calls pci_resume_ptm(); the suspend path saves the PTM state before disabling PTM, so the PTM state restore in the resume path implicitly re-enables it. A future change will use pci_resume_ptm() to fix some problems with this approach. Link: https://lore.kernel.org/r/20220909202505.314195-5-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 118b9dfdc18b68abf736a71330e3ad1f5af7e47e Author: Bjorn Helgaas Date: Fri Sep 9 15:24:59 2022 -0500 PCI/PTM: Separate configuration and enable PTM configuration and enabling were previously mixed together: pci_ptm_init() collected granularity info and enabled PTM for Root Ports and Switch Upstream Ports; pci_enable_ptm() did the same for Endpoints. Move everything related to the PTM Capability register to pci_ptm_init() for all devices, and everything related to the PTM Control register to pci_enable_ptm(). Link: https://lore.kernel.org/r/20220909202505.314195-4-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit e243c173c015d62b2bca9b030777ceba13311033 Author: Bjorn Helgaas Date: Fri Sep 9 15:24:58 2022 -0500 PCI/PTM: Add pci_upstream_ptm() helper PTM requires an unbroken path of PTM-supporting devices between the PTM Root and the ultimate PTM Requester, but if a Switch supports PTM, only the Upstream Port can have a PTM Capability; the Downstream Ports do not. Previously we copied the PTM configuration from the Switch Upstream Port to the Downstream Ports so dev->ptm_enabled for any device implied that all the upstream devices support PTM. Instead of making it look like Downstream Ports have their own PTM config, add pci_upstream_ptm(), which returns the upstream device that has a PTM Capability (either a Root Port or a Switch Upstream Port). Link: https://lore.kernel.org/r/20220909202505.314195-3-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Mika Westerberg commit b7be1c4eaf329aeb9dad1e5cac5482d0e28c1737 Author: Krzysztof Kozlowski Date: Tue Sep 6 14:13:58 2022 +0200 dt-bindings: remoteproc: qcom,adsp: enforce smd-edge schema The smd-edge child node references respective schema which allows additional properties, so the ADSP needs to further restrict them. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906121358.302894-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit a47126ec29f538e1197862919f94d3b6668144a4 Author: Bjorn Helgaas Date: Fri Sep 9 15:24:57 2022 -0500 PCI/PTM: Cache PTM Capability offset Cache the PTM Capability offset instead of searching for it every time we enable/disable PTM or save/restore PTM state. No functional change intended. Link: https://lore.kernel.org/r/20220909202505.314195-2-helgaas@kernel.org Tested-by: Rajvi Jingar Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Mika Westerberg commit 7470d2bf417600be13a4ba7d1c1390bac2abd13a Author: Rob Herring Date: Tue Aug 23 09:56:41 2022 -0500 dt-bindings: remoteproc: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-10-robh@kernel.org commit fdc5bebfb66bf0d261818c2df2b01c2a005791fe Author: Arnd Bergmann Date: Mon Sep 12 21:27:19 2022 +0200 parisc: hide ioread64 declaration on 32-bit The definition of ioread64 etc is hidden on 32-bit, but the declaration remained by accident, which led to the generic definition getting left out: ERROR: modpost: "ioread64" [drivers/pci/switch/switchtec.ko] undefined! Hide the declaration and #define under the same #ifdef. Reported-by: kernel test robot Fixes: 77bfc8bdb5a1 ("parisc: Remove 64bit access on 32bit machines") Signed-off-by: Arnd Bergmann commit 90afe3a18bcd16106014ba103d1cdb742b6e8505 Author: Krzysztof Kozlowski Date: Wed Aug 17 17:22:45 2022 +0300 dt-bindings: remoteproc: qcom,pil-info: add missing imem compatible syscon and simple-mfd cannot be used without device specific compatible. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817142246.828762-4-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 65c4764941bb230ef00164771fba0cdad0bfd3e4 Author: Krzysztof Kozlowski Date: Wed Aug 17 17:22:44 2022 +0300 dt-bindings: phy: hisilicon,hi3670-usb3: simplify example syscon and simple-mfd cannot be used without device specific compatible, so simplify the example to fix this. Signed-off-by: Krzysztof Kozlowski Acked-by: Mauro Carvalho Chehab Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220817142246.828762-3-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 70d012e9e93a2493676729d8b8724fcb10f150dc Author: Krzysztof Kozlowski Date: Wed Aug 17 17:22:43 2022 +0300 dt-bindings: phy: hisilicon,hi3660-usb3: simplify example syscon and simple-mfd cannot be used without device specific compatible, so simplify the example to fix this. Signed-off-by: Krzysztof Kozlowski Acked-By: Vinod Koul Acked-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/20220817142246.828762-2-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 01bf00c52e9ea76862e8a12a0838006be1f2cb8f Author: William Zhang Date: Wed Aug 3 10:54:54 2022 -0700 MAINTAINERS: Add BCM4908 maintainer to BCMBCA entry Since BCM4908 SoC support is merged into ARCH_BCMBCA, add BCM4908 maintainer Rafal to bcmbca maintainer list. Signed-off-by: William Zhang Link: https://lore.kernel.org/r/20220803175455.47638-9-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 68df591380d9b4947c0bb1626d66b7c7848fb136 Author: Abel Vesa Date: Fri Sep 9 16:39:31 2022 +0300 dt-bindings: misc: fastrpc: Document memory-region property Add memory-region property to the list of optional properties, specify the value type and a definition. This property is used to specify the memory region which should be used for remote heap CMA. Signed-off-by: Abel Vesa Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909133938.3518520-4-abel.vesa@linaro.org Signed-off-by: Rob Herring commit 5fc1531dd771cd1481116a66f992a190e01efce6 Author: Stephen Rothwell Date: Mon Sep 12 10:03:59 2022 -0600 hwtracing: hisi_ptt: Fix up for "iommu/dma: Make header private" drivers/hwtracing/ptt/hisi_ptt.c:13:10: fatal error: linux/dma-iommu.h: No such file or directory 13 | #include | ^~~~~~~~~~~~~~~~~~~ Caused by: commit ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device") interacting with: commit f2042ed21da7 ("iommu/dma: Make header private") from the iommu tree. Signed-off-by: Stephen Rothwell Acked-by: Robin Murphy Acked-by: Yicong Yang [Fixed subject line and added changelog text] Signed-off-by: Mathieu Poirier commit 0b3ed50eee5df65e3200c89db7f32f31c6210333 Author: Lucas De Marchi Date: Fri Sep 9 16:18:16 2022 -0700 drm/i915/gt: Extract function to apply media fuses Just like is done for compute and copy engines, extract a function to handle media engines. While at it, be consistent on using or not the uncore/gt/info variable aliases. Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220909-media-v2-2-6f20f322b4ef@intel.com commit ff21ed39ca68257aebf42b23afcbc2db66dfecde Author: Lucas De Marchi Date: Fri Sep 9 16:18:15 2022 -0700 drm/i915/gt: Use MEDIA_VER() when handling media fuses Check for media IP version instead of graphics since this is figuring out the media engines' configuration. Currently the only platform with non-matching graphics/media version is Meteor Lake: update the check in gen11_vdbox_has_sfc() so it considers not only version 12, but also any later version which then includes that platform. Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220909-media-v2-1-6f20f322b4ef@intel.com commit 2c12f88cef398ebf63db96906cae086b727745c0 Merge: 6d243f8981818 dfce69c852059 Author: Arnd Bergmann Date: Mon Sep 12 17:19:56 2022 +0200 Merge tag 'samsung-dt64-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM64 changes for v6.0 1. Add binding headers for several Exynos850 and ExynosAutov9 clocks. 2. ExynosAutov9: Add FSYS clock controller nodes. 3. ExynosAutov9: Document serial compatible (used in DTS). 4. Exynos850: Add Audio, IS, MFC clock controllers. Add IOMMU nodes. * tag 'samsung-dt64-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: serial: samsung: add exynosautov9-uart compatible arm64: dts: exynos: Add SysMMU nodes for Exynos850 arm64: dts: exynos: Add CMU_AUD, CMU_IS and CMU_MFCMSCL for Exynos850 arm64: dts: exynosautov9: add fsys0/1 clock DT nodes dt-bindings: clock: exynos850: Add Exynos850 CMU_MFCMSCL dt-bindings: clock: exynos850: Add Exynos850 CMU_IS dt-bindings: clock: exynos850: Add Exynos850 CMU_AUD dt-bindings: clock: exynosautov9: add schema for cmu_fsys0/1 dt-bindings: clock: exynosautov9: add fsys1 clock definitions dt-bindings: clock: exynosautov9: add fys0 clock definitions dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1 Link: https://lore.kernel.org/r/20220909150849.820523-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit d6ce6d14316e15f7831dfa447b4690093e949aac Merge: c3fe295c2ee5c 6212d2d9bbde6 Author: Arnd Bergmann Date: Mon Sep 12 17:14:23 2022 +0200 Merge tag 'samsung-drivers-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers Samsung SoC drivers changes for v6.1 1. Convert Samsung Exynos G-Scaler bindings to DT schema. 2. Maintainers update (drop Bartlomiej Zolnierkiewicz). * tag 'samsung-drivers-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: MAINTAINERS: Drop Bartlomiej Zolnierkiewicz MAINTAINERS: pwm-fan: Drop Bartlomiej Zolnierkiewicz dt-bindings: media: samsung,exynos5250-gsc: convert to dtschema Link: https://lore.kernel.org/r/20220909150849.820523-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 5a4ca019f6276429945d4b15691552d522c9a3ac Author: Linus Walleij Date: Sun Sep 11 23:40:42 2022 +0200 ARM: config: ixp4xx: Disable legacy EEPROM driver This disables the legacy EEPROM driver, we only need the new AT24 driver. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220911214042.1857352-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit c3fe295c2ee5cc3c5747620960607785abf0a003 Merge: c457d9a580fbb 6541b424ce1dd Author: Arnd Bergmann Date: Mon Sep 12 17:08:53 2022 +0200 Merge tag 'v6.1-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/drivers Powerdomain drivers for rv1126 and rk3588 socs, keep current state of power-domains instead of always enabling when adding them, add rv1126 io domains and add binding for another "general register files" syscon. * tag 'v6.1-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc: rockchip: power-domain: add power domain support for rk3588 soc: rockchip: power-domain: do not enable domain when adding it dt-bindings: power: rockchip: Add bindings for rk3588 dt-bindings: arm: rockchip: add rk5388 compatible string to pmu.yaml dt-bindings: power: add power-domain header for rk3588 soc: rockchip: io-domain: Add RV1126 IO domains dt-bindings: power: rockchip: Document RV1126 PMU IO domains soc: rockchip: power-domain: Add RV1126 power domains dt-bindings: power: rockchip: Document RV1126 power-controller dt-bindings: power: Add power-domain header for RV1126 dt-bindings: soc: grf: add pcie30-{phy,pipe}-grf Link: https://lore.kernel.org/r/2252399.ElGaqSPkdT@phil Signed-off-by: Arnd Bergmann commit c457d9a580fbb106e82afb81e2b4177f80c0221d Merge: 4da90678a6862 673e71df5ccfa Author: Arnd Bergmann Date: Mon Sep 12 17:04:14 2022 +0200 Merge tag 'memory-controller-drv-mediatek-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v6.1 - MediaTek Add support for the mt8188 SMI memory controller. * tag 'memory-controller-drv-mediatek-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: mtk-smi: mt8188: Add SMI Support memory: mtk-smi: Add enable IOMMU SMC command for MM master memory: mtk-smi: Add return value for configure port function dt-bindings: memory: mediatek: Add mt8188 smi binding Link: https://lore.kernel.org/r/20220909153037.824092-4-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 4da90678a6862442c049b2827bf11fd563f1e66f Merge: d551bdf349baa a4be90ff7a7d2 Author: Arnd Bergmann Date: Mon Sep 12 17:03:17 2022 +0200 Merge tag 'memory-controller-drv-brcm-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v6.1 - Broadcom Add support for the Broadcom STB memory controller (BRCMSTB_MEMC). * tag 'memory-controller-drv-brcm-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: brcmstb_memc: Add Broadcom STB memory controller driver Documentation: sysfs: Document Broadcom STB memc sysfs knobs dt-bindings: memory-controller: Document Broadcom STB MEMC Link: https://lore.kernel.org/r/20220909153037.824092-3-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit a791dc135325862fdf491ac088f54993710e2515 Merge: d11b1e908e9a1 80e78fcce86de Author: Greg Kroah-Hartman Date: Mon Sep 12 16:51:22 2022 +0200 Merge 6.0-rc5 into driver-core-next We need the driver core and debugfs changes in this branch. Signed-off-by: Greg Kroah-Hartman commit d551bdf349baafde321c08f4f2d05b08f726354f Merge: 3e3dcb464c0ac 9f8fb8032febf Author: Arnd Bergmann Date: Mon Sep 12 16:41:21 2022 +0200 Merge tag 'memory-controller-drv-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v6.1 1. Fix OF node refcount leaks in pl353-smc and generic of_memory code. 2. Add support for FPGA DFL EMIF revision 1. 3. Update bindings for Mediatek SMI mt8195. * tag 'memory-controller-drv-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: dt-bindings: memory: mediatek,smi: Update condition for mt8195 smi node memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings() memory: of: Fix refcount leak bug in of_get_ddr_timings() memory: dfl-emif: Update the dfl emif driver support revision 1 memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe() Link: https://lore.kernel.org/r/20220909153037.824092-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 6d243f89818185396acf89c98f86599acb363239 Merge: b68ec1163c3cf 04c26c5a2da85 Author: Arnd Bergmann Date: Mon Sep 12 16:35:47 2022 +0200 Merge tag 'stm32-dt-for-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/dt STM32 DT for v6.1, round 1 Highlights: ---------- - MPU: - General: - Add I2C support (5 instances) on STM32MP13. - Add SPI support (5 instabces) on STM32MP13. - Add timer interrupts support on STM32MP15. - ST boards: - Enable I2C1 and I2C5 on stm32mp135f-dk board. - Add SPI5 on stm32mp135f-dk board but disabled as only available on the GPIO expansion connector. - ARGON: - Remove spidev node as not used by the code. * tag 'stm32-dt-for-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: dts: stm32: argon: remove spidev node ARM: dts: stm32: Create separate pinmux for qspi cs pin in stm32mp15-pinctrl.dtsi ARM: dts: stm32: Fix typo in license text for Engicam boards ARM: dts: stm32: Add timer interrupts on stm32mp15 ARM: dts: stm32: add pinctrl and disabled spi5 node in stm32mp135f-dk ARM: dts: stm32: add spi nodes into stm32mp131.dtsi ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Link: https://lore.kernel.org/r/d80afc20-2745-24a2-ab70-a5a03439bd50@foss.st.com Signed-off-by: Arnd Bergmann commit b68ec1163c3cfc9274e3877de50c2783cc071310 Merge: b5a88262223b6 1dabb74971b38 Author: Arnd Bergmann Date: Mon Sep 12 16:13:36 2022 +0200 Merge tag 'v6.1-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt Adapt emac nodes to make them conform to the newly yaml-converted binding. * tag 'v6.1-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: restyle emac nodes ARM: dts: rockchip: fix rk3036 emac node compatible string Link: https://lore.kernel.org/r/4766760.31r3eYUQgx@phil Signed-off-by: Arnd Bergmann commit b5a88262223b6d3770bd699927dc639c61f259c9 Merge: 0cb66809b805c 91419ae0420f0 Author: Arnd Bergmann Date: Mon Sep 12 16:10:12 2022 +0200 Merge tag 'v6.1-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt New boards the Anberic RG353P and RG503, Radxa Rock4c+ (variant with different display outputs), Pine64 Pinephone Pro, Open AI Lab EAIDK-610. New components of the rk356x (Video encoder/decoder, pcie, CSI dphy). New board-peripherals for rock3a (pcie, i2c, regulators, rtc), quartz64-b (pcie, analog audio) and BPI-R2-Pro (pcie), ROCK Pi (leds), Odroid Go (charger) Usage of the new-ish bclk special handling for audio on rk3399. * tag 'v6.1-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (29 commits) arm64: dts: rockchip: use BCLK to GPIO switch on rk3399 arm64: dts: rockchip: Add Hantro encoder node to rk356x arm64: dts: rockchip: Add VPU support for RK3568/RK3566 arm64: dts: rockchip: Enable PCIe controller on rock3a arm64: dts: rockchip: add rtc to rock3a arm64: dts: rockchip: Add PCIe 2 nodes to quartz64-b arm64: dts: rockchip: add Anbernic RG353P and RG503 dt-bindings: arm: rockchip: Add Anbernic RG353P and RG503 dt-bindings: vendor-prefixes: add Anbernic arm64: dts: rockchip: Add regulator suffix to BPI-R2-Pro arm64: dts: rockchip: add LEDs for ROCK 4C+ arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ arm64: dts: rockchip: add rk817 chg to Odroid Go Advance arm64: dts: rockchip: Fix SD card controller probe on Pinephone Pro arm64: dts: rockchip: rk3399: Radxa ROCK 4C+ arm64: dts: rockchip: Add RK3399-T OPP table dt-bindings: arm: rockchip: Document Radxa ROCK 4C+ arm64: dts: rockchip: Add initial support for Pine64 PinePhone Pro dt-bindings: arm: rockchip: Add PinePhone Pro bindings arm64: dts: rockchip: Add dts for a rk3399 based board EAIDK-610 ... Link: https://lore.kernel.org/r/5600929.DvuYhMxLoT@phil Signed-off-by: Arnd Bergmann commit 97c318bfbe84efded246e80428054f300042f110 Author: Randy Dunlap Date: Sat Sep 10 18:26:16 2022 -0700 ia64: export memory_add_physaddr_to_nid to fix cxl build error cxl_pmem.ko uses memory_add_physaddr_to_nid() but ia64 does not export it, so this causes a build error: ERROR: modpost: "memory_add_physaddr_to_nid" [drivers/cxl/cxl_pmem.ko] undefined! Fix this by exporting that function. Fixes: 8c2676a5870a ("hot-add-mem x86_64: memory_add_physaddr_to_nid node fixup") Reported-by: kernel test robot Signed-off-by: Randy Dunlap Cc: Dan Williams Cc: Ben Widawsky Cc: Jonathan Cameron Cc: linux-ia64@vger.kernel.org Cc: Arnd Bergmann Cc: Keith Mannthey Cc: Andrew Morton Signed-off-by: Arnd Bergmann commit 0153682e9e6accd1796dd6bbe9df792d03d88b1f Author: Aleksander Jan Bajkowski Date: Mon Aug 29 20:37:17 2022 +0200 MIPS: dts: lantiq: rename dts files with soc name being the prefix Rename lantiq dts files with soc name being the prefix, so that the board dts file can be located easily by soc name, and we also gain the consistency of naming. This patch is a preparation for the addition of dts for newer SoCs (Lantiq ARX100, VRX200 and xRX330). Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Thomas Bogendoerfer commit 050a3f1db5b968ce838724f1c92787483770335d Author: Shaomin Deng Date: Sat Aug 27 11:46:40 2022 -0400 MIPS: Fix comments typo Remove the repeated word "as" in comments. Signed-off-by: Shaomin Deng Signed-off-by: Thomas Bogendoerfer commit a343ca9bd728ed070b209d1ec40fe38dad7e516c Author: Randy Dunlap Date: Mon Aug 22 19:54:41 2022 -0700 MIPS: ath25: clean up non-kernel-doc comment warning Don't use "/**" kernel-doc notation for comments that are not in kernel-doc format. Eliminates one warning: arch/mips/pci/pci-ar2315.c:6: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Both AR2315 and AR2316 chips have PCI interface unit, which supports DMA Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Aditya Srivastava Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Cc: Sergey Ryazanov Acked-by: Sergey Ryazanov Signed-off-by: Thomas Bogendoerfer commit 877336c1856ea4277994ba7cdd8aede416e75a4e Author: Wolfram Sang Date: Thu Aug 18 22:59:43 2022 +0200 MIPS: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Thomas Bogendoerfer commit edeed42402cebd9147b484d6df9964869bdc0681 Author: Jason Wang Date: Thu Aug 11 20:14:50 2022 +0800 MIPS: Fix comment typo The double `it' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Thomas Bogendoerfer commit 04c26c5a2da8591fe7e37146592d907ef37492bd Author: Wolfram Sang Date: Wed Aug 24 10:21:28 2022 +0200 ARM: dts: stm32: argon: remove spidev node Commit 956b200a846e ("spi: spidev: Warn loudly if instantiated from DT as "spidev"") states that there should not be spidev nodes in DTs. Remove this non-HW description. There won't be a regression because it won't bind since 2015 anyhow. Fixes: 16e3e44c5b87 ("ARM: dts: stm32: Add support for the emtrion emSBC-Argon") Cc: Reinhold Mueller Signed-off-by: Wolfram Sang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexandre Torgue commit ea99a5a02ebca63b00a1676f1dd4f75b899fd51e Author: Patrice Chotard Date: Tue Aug 23 09:58:49 2022 +0200 ARM: dts: stm32: Create separate pinmux for qspi cs pin in stm32mp15-pinctrl.dtsi Create a separate pinmux for qspi chip select in stm32mp15-pinctrl.dtsi. In the case we want to use transfer_one() API to communicate with a SPI device, chip select signal must be driven individually. Signed-off-by: Patrice Chotard Signed-off-by: Alexandre Torgue commit a118ba387595ee7082f6da08fabbd22ac5b0957d Author: Jagan Teki Date: Tue Aug 23 18:25:17 2022 +0530 ARM: dts: stm32: Fix typo in license text for Engicam boards Fix the Amarula Solutions typo mistake in license text added in below commits. commit <3ff0810ffc479> ("ARM: dts: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0 10.1" OF") commit <6ca2898df59f7> ("ARM: dts: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0") commit ("ARM: dts: stm32: Add Engicam i.Core STM32MP1 EDIMM2.2 Starter Kit") commit <30f9a9da4ee13> ("ARM: dts: stm32: Add Engicam i.Core STM32MP1 SoM") commit <1d278204cbaa1> ("ARM: dts: stm32: Add Engicam MicroGEA STM32MP1 MicroDev 2.0 7" OF") commit ("ARM: dts: stm32: Add Engicam MicroGEA STM32MP1 MicroDev 2.0 board") commit <0be81dfaeaf89> ("ARM: dts: stm32: Add Engicam MicroGEA STM32MP1 SoM") Signed-off-by: Jagan Teki Signed-off-by: Alexandre Torgue commit a9b70102253ce58b4aaf35a3898c075133120272 Author: Uwe Kleine-König Date: Thu May 19 18:28:38 2022 +0200 ARM: dts: stm32: Add timer interrupts on stm32mp15 The timer units in the stm32mp15x CPUs have interrupts, depending on the timer flavour either one "global" or four dedicated ones. Add the irqs to the timer units on stm32mp15x. Signed-off-by: Uwe Kleine-König Signed-off-by: Alexandre Torgue commit 15f72e0da4daf843e631f3c7d55dd57252fa1259 Author: Alain Volmat Date: Mon Jul 25 09:52:55 2022 +0200 ARM: dts: stm32: add pinctrl and disabled spi5 node in stm32mp135f-dk Add pinctrl information and a disabled spi5 node within stm32mp135f-dk.dts in order to use the spi5 bus which is available via the GPIO expansion pins of the STM32MP135 Discovery board. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 8539ebb435a519b7cb8888cdd1c464b3c32a8a69 Author: Alain Volmat Date: Mon Jul 25 09:52:54 2022 +0200 ARM: dts: stm32: add spi nodes into stm32mp131.dtsi Add the 5 instances of spi busses supported by the stm32mp131. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit f5a058023239374031644f1e6db9bf8b7b40895a Author: Alain Volmat Date: Thu Jul 21 17:29:33 2022 +0200 ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts Enable the two i2c busses i2c1 and i2c5 available on the stm32mp135f-dk Discovery board. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 446d5be806541e69cd9548407ce6976861d0b855 Author: Alain Volmat Date: Thu Jul 21 17:29:32 2022 +0200 ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Add the 5 instances of i2c busses supported by the stm32mp131. Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 8c9c40ec83445b188fb6b59e119bf5c2de81b02d Author: Robert Foss Date: Mon Sep 12 13:38:59 2022 +0200 Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP" As reported by Laurent in response to this commit[1], this functionality should not be implemented using the devicetree, because of this let's revert this series for now. This reverts commit c312b0df3b13e4c533743bb2c37fd1bc237368e5. [1] https://lore.kernel.org/all/20220902153906.31000-2-macroalpha82@gmail.com/ Signed-off-by: Robert Foss Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220912113856.817188-3-robert.foss@linaro.org commit e798ba3374a139ee83253245656d5aa201552534 Author: Robert Foss Date: Mon Sep 12 13:38:57 2022 +0200 Revert "dt-bindings: Add byteswap order to chrontel ch7033" As reported by Laurent in response to this commit[1], this functionality should not be implemented using the devicetree, because of this let's revert this series for now. This reverts commit a4be71430c76eca43679e8485085c230afa84460. [1] https://lore.kernel.org/all/20220902153906.31000-2-macroalpha82@gmail.com/ Signed-off-by: Robert Foss Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220912113856.817188-2-robert.foss@linaro.org commit 51aec8bf16338e5d7f34ebc33b173b0b9ce20973 Author: Matt Roper Date: Tue Sep 6 16:49:34 2022 -0700 drm/i915/mtl: Hook up interrupts for standalone media Top-level handling of standalone media interrupts will be processed as part of the primary GT's interrupt handler (since primary and media GTs share an MMIO space, unlike remote tile setups). When we get down to the point of handling engine interrupts, we need to take care to lookup VCS and VECS engines in the media GT rather than the primary. There are also a couple of additional "other" instance bits that correspond to the media GT's GuC and media GT's power management interrupts; we need to direct those to the media GT instance as well. Bspec: 45605 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-15-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 03d2c54d30901916addd50abb0a2cf871965b8e3 Author: Matt Roper Date: Tue Sep 6 16:49:33 2022 -0700 drm/i915/mtl: Use primary GT's irq lock for media GT When we hook up interrupts (in the next patch), interrupts for the media GT are still processed as part of the primary GT's interrupt flow. As such, we should share the same IRQ lock with the primary GT. Let's convert gt->irq_lock into a pointer and just point the media GT's instance at the same lock the primary GT is using. v2: - Point media's gt->irq_lock at the primary GT lock properly. (Daniele) - Fix jump target for intel_root_gt_init_early errors. (Daniele) Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-14-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit f0e2f00c49db0cba1feff7ce5a5f163d2152056f Author: Matt Roper Date: Tue Sep 6 16:49:32 2022 -0700 drm/i915/xelpmp: Expose media as another GT Xe_LPM+ platforms have "standalone media." I.e., the media unit is designed as an additional GT with its own engine list, GuC, forcewake, etc. Let's allow platforms to include media GTs in their device info. v2: - Simplify GSI register handling and split it out to a separate patch for ease of review. (Daniele) Cc: Aravind Iddamsetty Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Aravind Iddamsetty Acked-by: Aravind Iddamsetty Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-13-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 29063c6a6a57b8e6ea932ad50728b382ec1ddb59 Author: Matt Roper Date: Tue Sep 6 16:49:31 2022 -0700 drm/i915/mtl: Add gsi_offset when emitting aux table invalidation The aux table invalidation registers are a bit unique --- they're engine-centric registers that reside in the GSI register space rather than within the engines' regular MMIO ranges. That means that when issuing invalidation on engines in the standalone media GT, the GSI offset must be added to the regular MMIO offset for the invalidation registers. Cc: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Aravind Iddamsetty Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-12-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit eefac38ac4a38ad93f136126227dbcd35dd3225a Author: Matt Roper Date: Thu Sep 8 15:45:50 2022 -0700 drm/i915/uncore: Add GSI offset to uncore GT non-engine registers (referred to as "GSI" registers by the spec) have the same relative offsets on standalone media as they do on the primary GT, just with an additional "GSI offset" added to their MMIO address. If we store this GSI offset in the standalone media's intel_uncore structure, it can be automatically applied to all GSI reg reads/writes that happen on that GT, allowing us to re-use our existing GT code with minimal changes. Forcewake and shadowed register tables for the media GT (which will be added in a future patch) are listed as final addresses that already include the GSI offset, so we also need to add the GSI offset before doing lookups of registers in one of those tables. v2: - Add comment on raw_reg_*() macros explaining why we don't bother with GSI offsets in them. (Daniele) Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220908224550.821257-1-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 1c66a12ab431cda82a1dc53fc0bcd54370014755 Author: Matt Roper Date: Tue Sep 6 16:49:29 2022 -0700 drm/i915: Handle each GT on init/release and suspend/resume In preparation for enabling a second GT, there are a number of GT/uncore operations that happen during initialization or suspend flows that need to be performed on each GT, not just the primary, Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-10-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit cfb0fa4241257b73f2a074f2563af9a8704b1b08 Author: Matt Roper Date: Tue Sep 6 16:49:28 2022 -0700 drm/i915: Initialize MMIO access for each GT In a multi-GT system we need to initialize MMIO access for each GT, not just the primary GT. Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-9-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 6438452de4412785636e803aff58fa2e857dc6f2 Author: Matt Roper Date: Tue Sep 6 16:49:27 2022 -0700 drm/i915: Use a DRM-managed action to release the PCI bridge device As we start supporting multiple uncore structures in future patches, the MMIO cleanup (which may also get called mid-init if there's a failure) will become more complicated. Moving to DRM-managed actions will help keep things simple. Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-8-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 4ecd56fdad5681c7c89483c26b5130977ace9fa2 Author: Matt Roper Date: Tue Sep 6 16:49:26 2022 -0700 drm/i915: Rename and expose common GT early init routine The common early GT init is needed for initialization of all GT types (root/primary, remote tile, standalone media). Since standalone media (coming in a future patch) will be implemented in a separate file, rename and expose the function for use. Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-7-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 70fff19a570d4c9f73ccf0ca8c8b261b467d2491 Author: Matt Roper Date: Tue Sep 6 16:49:25 2022 -0700 drm/i915: Prepare more multi-GT initialization We're going to introduce an additional intel_gt for MTL's media unit soon. Let's provide a bit more multi-GT initialization framework in preparation for that. The initialization will pull the list of GTs for a platform from the device info structure. Although necessary for the immediate MTL media enabling, this same framework will also be used farther down the road when we enable remote tiles on xehpsdv and pvc. v2: - Re-add missing test for !HAS_EXTRA_GT_LIST in intel_gt_probe_all(). v3: - Move intel_gt_definition struct to intel_gt_types.h. (Jani) - Drop gtdef->setup(). For now we'll just use a switch() based on GT type since we don't have too many different handlers for the foreseeable future. (Jani) Cc: Aravind Iddamsetty Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Reviewed-by: Aravind Iddamsetty Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-6-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 9ebb80e80e471fa314b9bbf0a031b3bbc7b511b8 Author: Matt Roper Date: Tue Sep 6 16:49:24 2022 -0700 drm/i915: Drop intel_gt_tile_cleanup() Unmapping of the MMIO range can be done as a DRM-managed action, which will take care of the unmapping on device teardown and error paths. This will also ensure proper ordering with respect to other DRM-managed actions that we'll be using to clean up non-primary GTs in upcoming patches. We have not yet enabled any non-root GTs in the driver yet, so the kfree() of the GT structure is effectively dead code. When we do start enabling non-root GTs in upcoming patches, those are going to be using DRM-managed allocations tied to the device lifetime, so we don't need to explicitly free them (and kfree would be incorrect anyway). Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-5-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 45474ca4814f0e8d70a390b47afd607cd682b976 Author: Matt Roper Date: Tue Sep 6 16:49:23 2022 -0700 drm/i915: Use managed allocations for extra uncore objects We're slowly transitioning the init-time kzalloc's of the driver over to DRM-managed allocations; let's make sure the uncore objects allocated for non-root GTs are thus allocated. Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-4-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 639e30ee3950dd77606d91719ba85df27b882f0e Author: Matt Roper Date: Tue Sep 6 16:49:22 2022 -0700 drm/i915: Only hook up uncore->debug for primary uncore The original intent of intel_uncore_mmio_debug as described in commit 0a9b26306d6a ("drm/i915: split out uncore_mmio_debug") was to be a singleton structure that could be shared between multiple GTs' uncore objects in a multi-tile system. Somehow we went off track and started allocating separate instances of this structure for each GT, which defeats that original goal. But in reality, there isn't even a need to share the mmio_debug between multiple GTs; on all modern platforms (i.e., everything after gen7) unclaimed register accesses are something that can only be detected for display registers. There's no point in grabbing the debug spinlock and checking for unclaimed accesses on an uncore used by an xehpsdv or pvc remote tile GT, or the uncore used by a mtl standalone media GT since all of the display accesses go through the primary intel_uncore. The simplest solution is to simply leave uncore->debug NULL on all intel_uncore instances except for the primary one. This will allow us to avoid the pointless debug spinlock acquisition we've been doing on MMIO accesses coming in through these intel_uncores. Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-3-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit f16bfc1d5de082f50ecf87eaa98c357226ea06f1 Author: Matt Roper Date: Tue Sep 6 16:49:21 2022 -0700 drm/i915: Move locking and unclaimed check into mmio_debug_{suspend, resume} Moving the locking for MMIO debug (and the final check for unclaimed accesses when resuming debug after a userspace-initiated forcewake) will make it simpler to completely skip MMIO debug handling on uncores that don't support it in future patches. Signed-off-by: Matt Roper Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220906234934.3655440-2-matthew.d.roper@intel.com Signed-off-by: Joonas Lahtinen commit 60017f34fc334d1bb25476b0b0996b4073e76c90 Author: Ashutosh Dixit Date: Thu Sep 8 08:58:21 2022 -0700 drm/i915/gt: Fix perf limit reasons bit positions Perf limit reasons bit positions were off by one. Fixes: fa68bff7cf27 ("drm/i915/gt: Add sysfs throttle frequency interfaces") Cc: stable@vger.kernel.org # v5.18+ Signed-off-by: Ashutosh Dixit Acked-by: Andi Shyti Reviewed-by: Sujaritha Sundaresan Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220908155821.1662110-1-ashutosh.dixit@intel.com Signed-off-by: Joonas Lahtinen commit 68d46e52092d9a94370d44cf23db58cfdcc4fbaf Author: Lucas De Marchi Date: Wed Sep 7 16:25:42 2022 -0700 Revert "drm/i915/dg2: extend Wa_1409120013 to DG2" This reverts commit 487970e8bb776c989013bb59d6cbb22e45b9afc6. Updated bspec and workaround database note Wa_1409120013 is not needed for DG2 (or any Xe_LPD) platform. Simply check by display version 12. v2: Simplify condition check to display version (Matt Roper) Cc: Matt Atwood Cc: Clint Taylor Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220907232541.1720966-1-lucas.demarchi@intel.com Signed-off-by: Joonas Lahtinen commit 31335aa8e08be3fe10c50aecd2f11aba77544a78 Author: Umesh Nerlige Ramappa Date: Sat Aug 27 00:21:35 2022 +0000 drm/i915/guc: Cancel GuC engine busyness worker synchronously The worker is canceled in gt_park path, but earlier it was assumed that gt_park path cannot sleep and the cancel is asynchronous. This caused a race with suspend flow where the worker runs after suspend and causes an unclaimed register access warning. Cancel the worker synchronously since the gt_park is indeed allowed to sleep. v2: Fix author name and sign-off mismatch Signed-off-by: Umesh Nerlige Ramappa Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4419 Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220827002135.139349-1-umesh.nerlige.ramappa@intel.com Signed-off-by: Joonas Lahtinen commit b5917a109f1630379e83a37bbfa55a9198d50c66 Author: Tomas Winkler Date: Thu Sep 8 00:51:12 2022 +0300 drm/i915/gsc: allocate extended operational memory in LMEM GSC requires more operational memory than available on chip. Reserve 4M of LMEM for GSC operation. The memory is provided to the GSC as struct resource to the auxiliary data of the child device. Cc: Alan Previn Cc: Matthew Auld Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Alan Previn Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-16-tomas.winkler@intel.com Signed-off-by: Joonas Lahtinen commit 57e4f15506262dbd431c5f72ebd5b21ebb426119 Author: Tomas Winkler Date: Thu Sep 8 00:51:11 2022 +0300 mei: debugfs: add pxp mode to devstate in debugfs Add pxp mode devstate to debugfs to monitor pxp state machine progress. This is useful to debug issues in scenarios in which the pxp state needs to be re-initialized, like during power transitions such as suspend/resume. With this debugfs the state could be monitored to ensure that pxp is in the ready state. CC: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-15-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 267cb87001651ffbb8501be3fe970f32d5858afe Author: Alexander Usyskin Date: Thu Sep 8 00:51:10 2022 +0300 mei: drop ready bits check after start The check that hardware and host ready bits are set after start is redundant and may fail and disable driver if there is back-to-back link reset issued right after start. This happens during pxp mode transitions when firmware undergo reset. Remove these checks to eliminate such failures. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-14-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit bc9abe0ef1bdd47b6770f4c6e6ac7ca68a7d8997 Author: Vitaly Lubart Date: Thu Sep 8 00:51:09 2022 +0300 mei: gsc: add transition to PXP mode in resume flow Added transition to PXP mode in resume flow. CC: Daniele Ceraolo Spurio Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-13-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 342e4c7e2d38e421f99898b629b5d82e5ae90323 Author: Tomas Winkler Date: Thu Sep 8 00:51:08 2022 +0300 mei: gsc: setup gsc extended operational memory 1. Retrieve extended operational memory physical pointers from the auxiliary device info. 2. Setup memory registers. 3. Notify firmware that the memory is ready by sending the memory ready command. 4. Disable PXP device if GSC is not in PXP mode. CC: Daniele Ceraolo Spurio Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-12-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit fa313ede703115c9ebb31ce36a946aae23c14d61 Author: Tomas Winkler Date: Thu Sep 8 00:51:07 2022 +0300 mei: mkhi: add memory ready command Add GSC memory ready command. The command indicates to the firmware that extend operation memory was setup and the firmware may enter PXP mode. CC: Daniele Ceraolo Spurio Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-11-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 7d88a25819ad2400aa4377c3b9fe72b66d3c5c90 Author: Vitaly Lubart Date: Thu Sep 8 00:51:06 2022 +0300 mei: bus: export common mkhi definitions into a separate header Exported common mkhi definitions from bus-fixup.c into a separate header file mkhi.h for other driver usage. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-10-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 95953618519632953402d0b26c73f89fb8a8543f Author: Alexander Usyskin Date: Thu Sep 8 00:51:05 2022 +0300 mei: extend timeouts on slow devices Parametrize operational timeouts in order to support slow firmware on some graphics devices. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-9-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 9b2e03e2a102f816e5f098f7ae3ecf295855ae76 Author: Alexander Usyskin Date: Thu Sep 8 00:51:04 2022 +0300 mei: gsc: wait for reset thread on stop Wait for reset work to complete before initiating stop reset flow sequence. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-8-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 5b063995de950d45edecf25a3eac5d8a44bd0ab9 Author: Tomas Winkler Date: Thu Sep 8 00:51:03 2022 +0300 mei: gsc: use polling instead of interrupts A work-around for a HW issue in XEHPSDV that manifests itself when SW reads a gsc register when gsc is sending an interrupt. The work-around is to disable interrupts and to use polling instead. Cc: James Ausmus Signed-off-by: Vitaly Lubart Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-7-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 2d427248aac4e4c8daeb1a4e021f9e22eb0c8e6f Author: Alexander Usyskin Date: Thu Sep 8 00:51:02 2022 +0300 drm/i915/gsc: add GSC XeHP SDV platform definition Define GSC on XeHP SDV (Intel(R) dGPU without display) XeHP SDV uses the same hardware settings as DG1, but uses polling instead of interrupts and runs the firmware in slow pace due to hardware limitations. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-6-tomas.winkler@intel.com Signed-off-by: Joonas Lahtinen commit d67287769e93da7fd4b0ea1a5ef14f68c2cf527c Author: Alexander Usyskin Date: Thu Sep 8 00:51:01 2022 +0300 drm/i915/gsc: add slow_firmware flag to the gsc device definition Add slow_firmware flag to the gsc device definition and pass it to mei auxiliary device, this instructs the driver to use longer operation timeouts. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-5-tomas.winkler@intel.com Signed-off-by: Joonas Lahtinen commit ed57967ab64f1dcdb9efb78a3f4a950dfdccf544 Author: Tomas Winkler Date: Thu Sep 8 00:51:00 2022 +0300 mei: add slow_firmware flag to the mei auxiliary device Add slow_firmware flag to the mei auxiliary device info to inform the mei driver about slow underlying firmware. Such firmware will require to use larger operation timeouts. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-4-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit fd72cb1bb5c71d2738a17cbdee6280365a451706 Author: Tomas Winkler Date: Thu Sep 8 00:50:59 2022 +0300 mei: add kdoc for struct mei_aux_device struct mei_aux_device is an interface structure requires proper documenation. Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-3-tomas.winkler@intel.com Acked-by: Greg Kroah-Hartman Signed-off-by: Joonas Lahtinen commit 5c4d2536cfe105694b7045a8d7581631f44f391d Author: Vitaly Lubart Date: Thu Sep 8 00:50:58 2022 +0300 drm/i915/gsc: skip irq initialization if using polling Some platforms require the host to poll on the GSC registers instead of relaying on the interrupts. For those platforms, irq initialization should be skipped Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-2-tomas.winkler@intel.com Signed-off-by: Joonas Lahtinen commit d5350756c03cdf18696295c6b11d7acc4dbf825c Author: Bitterblue Smith Date: Fri Sep 2 16:15:30 2022 +0300 wifi: rtl8xxxu: Remove copy-paste leftover in gen2_update_rate_mask It looks like a leftover from copying rtl8xxxu_update_rate_mask, which is used with the gen1 chips. It wasn't causing any problems for my RTL8188FU test device, but it's clearly a mistake, so remove it. Fixes: f653e69009c6 ("rtl8xxxu: Implement basic 8723b specific update_rate_mask() function") Signed-off-by: Bitterblue Smith Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/d5544fe8-9798-28f1-54bd-6839a1974b10@gmail.com commit e963a19c64ac0d2f8785d36a27391abd91ac77aa Author: Bitterblue Smith Date: Fri Sep 2 14:48:32 2022 +0300 wifi: rtl8xxxu: gen2: Fix mistake in path B IQ calibration Found by comparing with the vendor driver. Currently this affects only the RTL8192EU, which is the only gen2 chip with 2 TX paths supported by this driver. It's unclear what kind of effect the mistake had in practice, since I don't have any RTL8192EU devices to test it. Fixes: e1547c535ede ("rtl8xxxu: First stab at adding IQK calibration for 8723bu parts") Signed-off-by: Bitterblue Smith Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/30a59f3a-cfa9-8379-7af0-78a8f4c77cfd@gmail.com commit bd1056d48a2b3093e42cdb721004e5dc2c3a993f Author: Po-Hao Huang Date: Thu Sep 8 13:12:57 2022 +0800 wifi: rtw89: split scan including lots of channels The size limit of H2C commands is 2048. With regulatory that enables U-NII-6 ~ UNII-8 channels, channel list length combining with channel info length will exceed that. Split the channel list to parts and do scan multiple times to workaround that. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-10-pkshih@realtek.com commit 3a1e7cb16d83d1a5f09487826ac2895aaef5d590 Author: Po-Hao Huang Date: Thu Sep 8 13:12:56 2022 +0800 wifi: rtw89: 8852c: support hw_scan This enables hw_scan function for 52c. The mechanism is similar to 52a except that it adds modifications required for 6G channels and extends the command length to make driver compatible to both newer and existing firmware. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-9-pkshih@realtek.com commit 5abbb68acad130d6891619b55ad7ce5c690689ab Author: Chin-Yen Lee Date: Thu Sep 8 13:12:55 2022 +0800 wifi: rtw89: call tx_wake notify for 8852c in deep ps mode 8852c transmits packets with slow response in deep ps mode, and lead to low throughput. We need to call tx_wake for each pakcet to trigger firmware wake earlier to avoid it. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-8-pkshih@realtek.com commit 183c8eff5a67256ccae00850664538e5f1f8dc49 Author: Chin-Yen Lee Date: Thu Sep 8 13:12:54 2022 +0800 wifi: rtw89: support deep ps mode for rtw8852c rtw8852c could support deep ps mode if the firmware version is greater than 0.17.34. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-7-pkshih@realtek.com commit 9ef9edb9e830336da50c75cd2eb1a61cfe129510 Author: Chia-Yuan Li Date: Thu Sep 8 13:12:53 2022 +0800 wifi: rtw89: set response rate selection With suitable response rate, it can acknowledge peer packets are received. Otherwise, peer could re-transmit again due to missing of ACK frames. To achieve this, refer to RX rate and CMAC table to choose the smaller as initial response rate. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-6-pkshih@realtek.com commit 755fda37b9d7e0f3b3a34dc25231a153e1b93a0c Author: Yi-Tang Chiu Date: Thu Sep 8 13:12:52 2022 +0800 wifi: rtw89: 8852c: set TX to single path TX on path B in 6GHz band With one path TX for 1SS rate, it can transmit higher power in 6GHz band to yield better performance in high attenuation circumstance. Signed-off-by: Yi-Tang Chiu Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-5-pkshih@realtek.com commit 2449ca713e6766b1caaf40c709272c0b392bf190 Author: Ping-Ke Shih Date: Thu Sep 8 13:12:51 2022 +0800 wifi: rtw89: 8852c: enlarge polling timeout of RX DCK The range of calibration time of RX DCK is quite wide from ~40us to ~1300us by experiments, and probability is about 0.1% for the cases larger than 1000us. Though it can retry calibration and get positive result, it will spend more time. Therefore, enlarge it to avoid warning and duplicate calibration. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-4-pkshih@realtek.com commit ef16380b69b85ff42e03900f6f7014fb413b42a8 Author: Ping-Ke Shih Date: Thu Sep 8 13:12:50 2022 +0800 wifi: rtw89: 8852c: enable the interference cancellation of MU-MIMO on 6GHz Enable MU-MIMO interference cancellation (MUIC) to yield expected performance of receiving MU-MIMO packets on 6GHz. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-3-pkshih@realtek.com commit 87deaad9c9e93b0a9d6b026dd29d7dc9b7d067c9 Author: Eric Huang Date: Thu Sep 8 13:12:49 2022 +0800 wifi: rtw89: add DIG register struct to share common algorithm Since control register address for DIG are different per IC, add a new struct rtw89_dig_regs in chip info for each IC to define their own address. Signed-off-by: Eric Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908051257.25353-2-pkshih@realtek.com commit 7dbdf65525b365261904d427978009fe22f937b3 Author: Ping-Ke Shih Date: Thu Sep 8 15:41:40 2022 +0800 wifi: rtw89: support TX diversity for 1T2R chipset Check RSSI strength to decide which path is better, and then set TX path accordingly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908074140.39776-6-pkshih@realtek.com commit 6ce472d6516ce1ff0d5ae3f54578d118d93f6c16 Author: Ping-Ke Shih Date: Thu Sep 8 15:41:39 2022 +0800 wifi: rtw89: record signal strength per RF path Originally, we show average signal strength. To support TX diversity, this patch prepares strength per path, then we can decide TX path. RSSI: -54 dBm (raw=112, prev=110) [-57, -52] Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908074140.39776-5-pkshih@realtek.com commit 5a8e06e49aac8c71ac5f141a10bc9a7fbb886575 Author: Ping-Ke Shih Date: Thu Sep 8 15:41:38 2022 +0800 wifi: rtw89: configure TX path via H2C command In order to support TX diversity, add a function to control TX path. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908074140.39776-4-pkshih@realtek.com commit dc229d944e3f85110f751031032ee964b6341f9b Author: Ping-Ke Shih Date: Thu Sep 8 15:41:37 2022 +0800 wifi: rtw89: parse phycap of TX/RX antenna number Two fields, TX/RX ANT NUM, are introduced to address variant TX/RX antenna number of hardware. For example, a 1x1 chip with TX diversity, TX NSS = 1 and TX/RX ANT NUM = 2. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908074140.39776-3-pkshih@realtek.com commit c7ad08c60163a338e0fb59bbfe51a127fe00dd69 Author: Ping-Ke Shih Date: Thu Sep 8 15:41:36 2022 +0800 wifi: rtw89: use u32_get_bits to access C2H content of PHY capability The definitions of bit fields in structure will be wrong in big-endian platform, so use u32_get_bits() to access them. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220908074140.39776-2-pkshih@realtek.com commit e3d8d54cd6c5b29f3437f1f00b393267b84d650e Author: Hamza Mahfooz Date: Sat Sep 10 18:48:16 2022 -0400 drm/bridge: it6505: use drm_debug_enabled() in it6505_debug_print() As made mention of in commit 9f0ac028410f ("drm/print: rename drm_debug to __drm_debug to discourage use"), we shouldn't explicitly refer to __drm_debug in this context. So, use drm_debug_enabled() instead. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Hamza Mahfooz Reviewed-by: Jani Nikula Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220910224816.15058-1-someguy@effective-light.com commit 213cb76ddc8b875e772f9f4d173feefa122716af Merge: 47519d8224bab 04f7eb3d4582a Author: Dave Airlie Date: Mon Sep 12 21:12:22 2022 +1000 Merge tag 'drm-intel-gt-next-2022-09-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - Revert "drm/i915/dg2: Add preemption changes for Wa_14015141709" The intent of Wa_14015141709 was to inform us that userspace can no longer control object-level preemption as it has on past platforms (i.e., by twiddling register bit CS_CHICKEN1[0]). The description of the workaround in the spec wasn't terribly well-written, and when we requested clarification from the hardware teams we were told that on the kernel side we should also probably stop setting FF_SLICE_CS_CHICKEN1[14], which is the register bit that directs the hardware to honor the settings in per-context register CS_CHICKEN1. It turns out that this guidance about FF_SLICE_CS_CHICKEN1[14] was a mistake; even though CS_CHICKEN1[0] is non-operational and useless to userspace, there are other bits in the register that do still work and might need to be adjusted by userspace in the future (e.g., to implement other workarounds that show up). If we don't set FF_SLICE_CS_CHICKEN1[14] in i915, then those future workarounds would not take effect. Even more details at: https://lists.freedesktop.org/archives/intel-gfx/2022-September/305478.html Driver Changes: - Align GuC/HuC firmware versioning scheme to kernel practices (John) - Fix #6639: h264 hardware video decoding broken in 5.19 on Intel(R) Celeron(R) N3060 (Nirmoy) - Meteorlake (MTL) enabling (Matt R) - GuC SLPC improvements (Vinay, Rodrigo) - Add thread execution tuning setting for ATS-M (Matt R) - Don't start PXP without mei_pxp bind (Juston) - Remove leftover verbose debug logging from GuC error capture (John) - Abort suspend on low system memory conditions (Nirmoy, Matt A, Chris) - Add DG2 Wa_16014892111 (Matt R) - Rename ggtt_view as gtt_view (Niranjana) - Consider HAS_FLAT_CCS() in needs_ccs_pages (Matt A) - Don't try to disable host RPS when this was never enabled. (Rodrigo) - Clear stalled GuC CT request after a reset (Daniele) - Remove runtime info printing from GuC time stamp logging (Jani) - Skip Bit12 fw domain reset for gen12+ (Sushma, Radhakrishna) - Make GuC log sizes runtime configurable (John) - Selftest improvements (Daniele, Matt B, Andrzej) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YxshfqUN+vDe92Zn@jlahtine-mobl.ger.corp.intel.com commit 6c78973da0b11255d2668518ac1baba4c581811a Author: Jan Kara Date: Mon Sep 12 12:25:29 2022 +0200 udf: Support splicing to file Add explicit support for splicing from pipe to file through iter_file_splice_write(). Commit 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") removed the default .splice_write operation which effectively removed UDF support for splicing from pipe. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202209081443.593ab12-yujie.liu@intel.com Signed-off-by: Jan Kara commit 6769089ecb5073b0896addffe72c89a4d80258c9 Author: Joy Zou Date: Mon Sep 5 16:36:15 2022 +0800 ARM: dts: imx: update sdma node name format Node names should be generic, so change the sdma node name format 'sdma' into 'dma-controller'. Acked-by: Fabio Estevam Signed-off-by: Joy Zou Signed-off-by: Shawn Guo commit 47519d8224babc9dee489ea96dfeac726fe544cc Merge: 89b03aeaef16f 780244a2fe8a8 Author: Dave Airlie Date: Mon Sep 12 19:17:40 2022 +1000 Merge tag 'amd-drm-next-6.1-2022-09-08' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.1-2022-09-08: amdgpu: - Mode2 reset for RDNA2 - Lots of new DC documentation - Add documentation about different asic families - DSC improvements - Aldebaran fixes - Misc spelling and grammar fixes - GFXOFF stats support for vangogh - DC frame size fixes - NBIO 7.7 updates - DCN 3.2 updates - DCN 3.1.4 Updates - SMU 13.x updates - Misc bug fixes - Rework DC register offset handling - GC 11.x updates - PSP 13.x updates - SDMA 6.x updates - GMC 11.x updates - SR-IOV updates - PSP fixes for TA unloading - DSC passthrough support - Misc code cleanups amdkfd: - ISA fixes for some GC 10.3 IPs - Misc code cleanups radeon: - Delayed work flush fix - Use time_after for some jiffies calculations drm: - DSC passthrough aux support Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220908155202.57862-1-alexander.deucher@amd.com commit 6f3562b3bca078b40aa198db8fdc68439b7b0399 Merge: 3fecf93c86087 89b03aeaef16f Author: Jani Nikula Date: Mon Sep 12 11:11:02 2022 +0300 Merge drm/drm-next into drm-intel-next Backmerge to sync the DP MST atomic changes to drm-intel-next. Signed-off-by: Jani Nikula commit 446bc11f8614449782feac1d5ff270b3f98bcdf3 Author: YJ Lee Date: Mon Sep 12 15:29:45 2022 +0800 ALSA: dummy: Add customizable volume min/max. Add module parameters to support customized min/max volume leveling, which will be useful to test devices with different volume granularity. Signed-off-by: YJ Lee Link: https://lore.kernel.org/r/20220912072945.760949-1-yunjunlee@chromium.org Signed-off-by: Takashi Iwai commit 91418cc4fd8f8e2e21b409eb8983d074359c8be6 Author: Gaosheng Cui Date: Sun Sep 11 17:26:45 2022 +0800 block/drbd: remove unused w_start_resync declaration w_start_resync has been removed since commit ac0acb9e39ac ("drbd: use drbd_device_post_work() in more places"), so remove it. Signed-off-by: Gaosheng Cui Acked-by: Christoph Böhmwalder Signed-off-by: Jens Axboe commit 7ae22bdf49d513b0555d25df4d361379fc8ad166 Author: YJ Lee Date: Mon Sep 12 15:28:54 2022 +0800 ALSA: dummy: Fix trailing whitespaces. Fix checkpatch.pl ERROR: trailing whitespaces. Signed-off-by: YJ Lee Link: https://lore.kernel.org/r/20220912072854.760824-1-yunjunlee@chromium.org Signed-off-by: Takashi Iwai commit f2912237eb922bf2d4ebf13f3f5f1b25070f1e52 Author: Thierry Reding Date: Mon Sep 5 18:22:41 2022 +0200 drm/aperture: Fix some kerneldoc comments Reword some kerneldoc comments for the DRM aperture handling code. Signed-off-by: Thierry Reding Signed-off-by: Thomas Zimmermann Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220905162241.391226-1-thierry.reding@gmail.com commit 4a85b0b51e211fba03c081e1e47f8871e4b3088f Author: Thomas Zimmermann Date: Mon Sep 5 16:16:48 2022 +0200 drm/format-helper: Add drm_fb_build_fourcc_list() helper Add drm_fb_build_fourcc_list() function that builds a list of supported formats from native and emulated ones. Helpful for all drivers that do format conversion as part of their plane updates. Update current caller. v3: * improve warnings on ignored formats (Sam) v2: * use u32 instead of uint32_t (Sam) * print a warning if output array is too small (Sam) * comment fixes (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220905141648.22013-5-tzimmermann@suse.de commit 385d1bba890f9b94322ca7fdfa778311f1ea0813 Author: Thomas Zimmermann Date: Mon Sep 5 16:16:47 2022 +0200 drm/modes: Add initializer macro DRM_MODE_INIT() The macro DRM_MODE_INIT() initializes an instance of struct drm_display_mode with typical parameters. Convert simpledrm and also update the macro DRM_SIMPLE_MODE(). v3: * fix DRM_MODE_INIT() docs (kernel test robot) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220905141648.22013-4-tzimmermann@suse.de commit 216b9bbaeaea96b7f05c220f61855d174be972d8 Author: Thomas Zimmermann Date: Mon Sep 5 16:16:46 2022 +0200 drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() Add drm_crtc_helper_mode_valid_fixed(), which validates a given mode against a display hardware's mode. Convert simpledrm and use it in a few other drivers with static modes. v4: * remove empty line after opening brace v2: * rename 'static' and 'hw' to 'fixed' everywhere Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220905141648.22013-3-tzimmermann@suse.de commit d25654b3fad9906ca80912701fd4bd6e2419f54d Author: Thomas Zimmermann Date: Mon Sep 5 16:16:45 2022 +0200 drm/probe-helper: Add drm_connector_helper_get_modes_fixed() Add drm_connector_helper_get_modes_fixed(), which duplicates a single display mode for a connector. Convert drivers. v2: * rename 'static' and 'hw' to 'fixed' everywhere * fix typo 'there' to 'their' (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220905141648.22013-2-tzimmermann@suse.de commit c013710e1a7eba8e33da9380a068fe1cec017226 Author: Yu Kuai Date: Sat Aug 27 18:16:37 2022 +0800 blk-throttle: cleanup tg_update_disptime() tg_update_disptime() only need to adjust postion for 'tg' in 'parent_sq', there is no need to call throtl_enqueue/dequeue_tg(), since they will set/clear flag THROTL_TG_PENDING and increase/decrease nr_pending, which is useless. By the way, clear the flag/decrease nr_pending while there are still throttled bios is not good for debugging. There are no functional changes. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220827101637.1775111-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 8c25ed0cb9d2e349ebebfeacf7ce1ae015afe54d Author: Yu Kuai Date: Sat Aug 27 18:16:36 2022 +0800 blk-throttle: calling throtl_dequeue/enqueue_tg in pairs It's a little weird to call throtl_dequeue_tg() unconditionally in throtl_select_dispatch(), since it will be called in tg_update_disptime() again if some bio is still throttled. Thus call it later if there are no throttled bio. There are no functional changes. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220827101637.1775111-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 7e9c5c54d440bd6402ffdba4dc4f3df5bfe64ea4 Author: Yu Kuai Date: Sat Aug 27 18:16:35 2022 +0800 blk-throttle: use 'READ/WRITE' instead of '0/1' Make the code easier to read, like everywhere else. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220827101637.1775111-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit a880ae93e5b5bb5d8d5500077a391e3f5ec7715c Author: Yu Kuai Date: Mon Aug 29 10:22:40 2022 +0800 blk-throttle: fix io hung due to configuration updates If new configuration is submitted while a bio is throttled, then new waiting time is recalculated regardless that the bio might already wait for some time: tg_conf_updated throtl_start_new_slice tg_update_disptime throtl_schedule_next_dispatch Then io hung can be triggered by always submmiting new configuration before the throttled bio is dispatched. Fix the problem by respecting the time that throttled bio already waited. In order to do that, add new fields to record how many bytes/io are waited, and use it to calculate wait time for throttled bio under new configuration. Some simple test: 1) cd /sys/fs/cgroup/blkio/ echo $$ > cgroup.procs echo "8:0 2048" > blkio.throttle.write_bps_device { sleep 2 echo "8:0 1024" > blkio.throttle.write_bps_device } & dd if=/dev/zero of=/dev/sda bs=8k count=1 oflag=direct 2) cd /sys/fs/cgroup/blkio/ echo $$ > cgroup.procs echo "8:0 1024" > blkio.throttle.write_bps_device { sleep 4 echo "8:0 2048" > blkio.throttle.write_bps_device } & dd if=/dev/zero of=/dev/sda bs=8k count=1 oflag=direct test results: io finish time before this patch with this patch 1) 10s 6s 2) 8s 6s Signed-off-by: Yu Kuai Reviewed-by: Michal Koutný Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220829022240.3348319-5-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 681cd46fff8cd81e387747c7850f2e730d3e0b74 Author: Yu Kuai Date: Mon Aug 29 10:22:39 2022 +0800 blk-throttle: factor out code to calculate ios/bytes_allowed No functional changes, new apis will be used in later patches to calculate wait time for throttled bios when new configuration is submitted. Noted this patch also rename tg_with_in_iops/bps_limit() to tg_within_iops/bps_limit(). Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220829022240.3348319-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 8d6bbaada2e0a65f9012ac4c2506460160e7237a Author: Yu Kuai Date: Mon Aug 29 10:22:38 2022 +0800 blk-throttle: prevent overflow while calculating wait time There is a problem found by code review in tg_with_in_bps_limit() that 'bps_limit * jiffy_elapsed_rnd' might overflow. Fix the problem by calling mul_u64_u64_div_u64() instead. Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220829022240.3348319-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 320fb0f91e55ba248d4bad106b408e59099cfa89 Author: Yu Kuai Date: Mon Aug 29 10:22:37 2022 +0800 blk-throttle: fix that io throttle can only work for single bio Test scripts: cd /sys/fs/cgroup/blkio/ echo "8:0 1024" > blkio.throttle.write_bps_device echo $$ > cgroup.procs dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct & dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct & Test result: 10240 bytes (10 kB, 10 KiB) copied, 10.0134 s, 1.0 kB/s 10240 bytes (10 kB, 10 KiB) copied, 10.0135 s, 1.0 kB/s The problem is that the second bio is finished after 10s instead of 20s. Root cause: 1) second bio will be flagged: __blk_throtl_bio while (true) { ... if (sq->nr_queued[rw]) -> some bio is throttled already break }; bio_set_flag(bio, BIO_THROTTLED); -> flag the bio 2) flagged bio will be dispatched without waiting: throtl_dispatch_tg tg_may_dispatch tg_with_in_bps_limit if (bps_limit == U64_MAX || bio_flagged(bio, BIO_THROTTLED)) *wait = 0; -> wait time is zero return true; commit 9f5ede3c01f9 ("block: throttle split bio in case of iops limit") support to count split bios for iops limit, thus it adds flagged bio checking in tg_with_in_bps_limit() so that split bios will only count once for bps limit, however, it introduce a new problem that io throttle won't work if multiple bios are throttled. In order to fix the problem, handle iops/bps limit in different ways: 1) for iops limit, there is no flag to record if the bio is throttled, and iops is always applied. 2) for bps limit, original bio will be flagged with BIO_BPS_THROTTLED, and io throttle will ignore bio with the flag. Noted this patch also remove the code to set flag in __bio_clone(), it's introduced in commit 111be8839817 ("block-throttle: avoid double charge"), and author thinks split bio can be resubmited and throttled again, which is wrong because split bio will continue to dispatch from caller. Fixes: 9f5ede3c01f9 ("block: throttle split bio in case of iops limit") Cc: Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220829022240.3348319-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 4acb83417cadfdcbe64215f9d0ddcf3132af808e Author: Keith Busch Date: Fri Sep 9 11:40:22 2022 -0700 sbitmap: fix batched wait_cnt accounting Batched completions can clear multiple bits, but we're only decrementing the wait_cnt by one each time. This can cause waiters to never be woken, stalling IO. Use the batched count instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215679 Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220909184022.1709476-1-kbusch@fb.com Signed-off-by: Jens Axboe commit b814751175470b00969a317bf3192260750f9455 Author: wuchi Date: Sat Sep 3 21:52:33 2022 +0800 latencytop: use the last element of latency_record of system In account_global_scheduler_latency(), when we don't find the matching latency_record we try to select one which is unused in latency_record[MAXLR], but the condition will skip the last one. if (i >= MAXLR-1) Fix that. Link: https://lkml.kernel.org/r/20220903135233.5225-1-wuchi.zero@gmail.com Signed-off-by: wuchi Reviewed-by: Andrew Morton Cc: Alexander Viro Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit bfca3dd3d0680fc2fc7f659a152234afbac26e4d Author: Petr Vorel Date: Thu Sep 1 21:44:03 2022 +0200 kernel/utsname_sysctl.c: print kernel arch Print the machine hardware name (UTS_MACHINE) in /proc/sys/kernel/arch. This helps people who debug kernel with initramfs with minimal environment (i.e. without coreutils or even busybox) or allow to open sysfs file instead of run 'uname -m' in high level languages. Link: https://lkml.kernel.org/r/20220901194403.3819-1-pvorel@suse.cz Signed-off-by: Petr Vorel Acked-by: Greg Kroah-Hartman Cc: David Sterba Cc: "Eric W . Biederman" Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 8ea0114eda0c1c85f8f01922ac8fc1e489a61129 Author: Mickaël Salaün Date: Fri Sep 2 13:19:23 2022 +0200 checkpatch: handle FILE pointer type When using a "FILE *" type, checkpatch considers this an error: ERROR: need consistent spacing around '*' (ctx:WxV) #32: FILE: f.c:8: +static void a(FILE *const b) ^ Fix this by explicitly defining "FILE" as a common type. This is useful for user space patches. With this patch, we now get: <_>WS( ) <_>IDENT(static) <_>WS( ) <_>DECLARE(void ) <_>FUNC(a) PAREN('(') <_>DECLARE(FILE *const ) <_>IDENT(b) <_>PAREN(')') -> V <_>WS( ) 32 > . static void a(FILE *const b) 32 > EEVVVVVVVTTTTTVNTTTTTTTTTTTTVVV 32 > ______________________________ Link: https://lkml.kernel.org/r/20220902111923.1488671-1-mic@digikod.net Link: https://lore.kernel.org/r/20220902111923.1488671-1-mic@digikod.net Signed-off-by: Mickaël Salaün Acked-by: Joe Perches Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton commit 7b9e664beb237d90bc600f117668227af5ce53ae Author: Andy Shevchenko Date: Tue Aug 30 20:27:13 2022 +0300 asm-generic: make parameter types consistent in _unaligned_be48() There is a convention to use internal kernel types, so replace __u8 by u8. Link: https://lkml.kernel.org/r/20220830172713.43686-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Keith Busch Cc: Arnd Bergmann Signed-off-by: Andrew Morton commit 35783ccbe519b33f6652b2d7aafcfc82f10b1a1b Author: wuchi Date: Thu Sep 1 08:31:21 2022 +0800 kernel/profile.c: simplify duplicated code in profile_setup() The code to parse option string "schedule/sleep/kvm" of cmdline in function profile_setup is redundant, so simplify that. Link: https://lkml.kernel.org/r/20220901003121.53597-1-wuchi.zero@gmail.com Signed-off-by: wuchi Reviewed-by: Andrew Morton Cc: Christoph Hellwig Signed-off-by: Andrew Morton commit 63095f4f3af59322bea984a6ae44337439348fe0 Author: Hawkins Jiawei Date: Thu Sep 1 00:09:38 2022 +0800 ntfs: check overflow when iterating ATTR_RECORDs Kernel iterates over ATTR_RECORDs in mft record in ntfs_attr_find(). Because the ATTR_RECORDs are next to each other, kernel can get the next ATTR_RECORD from end address of current ATTR_RECORD, through current ATTR_RECORD length field. The problem is that during iteration, when kernel calculates the end address of current ATTR_RECORD, kernel may trigger an integer overflow bug in executing `a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))`. This may wrap, leading to a forever iteration on 32bit systems. This patch solves it by adding some checks on calculating end address of current ATTR_RECORD during iteration. Link: https://lkml.kernel.org/r/20220831160935.3409-4-yin31149@gmail.com Link: https://lore.kernel.org/all/20220827105842.GM2030@kadam/ Signed-off-by: Hawkins Jiawei Suggested-by: Dan Carpenter Cc: Anton Altaparmakov Cc: chenxiaosong (A) Cc: syzkaller-bugs Signed-off-by: Andrew Morton commit 36a4d82dddbbd421d2b8e79e1cab68c8126d5075 Author: Hawkins Jiawei Date: Thu Sep 1 00:09:36 2022 +0800 ntfs: fix out-of-bounds read in ntfs_attr_find() Kernel iterates over ATTR_RECORDs in mft record in ntfs_attr_find(). To ensure access on these ATTR_RECORDs are within bounds, kernel will do some checking during iteration. The problem is that during checking whether ATTR_RECORD's name is within bounds, kernel will dereferences the ATTR_RECORD name_offset field, before checking this ATTR_RECORD strcture is within bounds. This problem may result out-of-bounds read in ntfs_attr_find(), reported by Syzkaller: ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597 Read of size 2 at addr ffff88807e352009 by task syz-executor153/3607 [...] Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597 ntfs_attr_lookup+0x1056/0x2070 fs/ntfs/attrib.c:1193 ntfs_read_inode_mount+0x89a/0x2580 fs/ntfs/inode.c:1845 ntfs_fill_super+0x1799/0x9320 fs/ntfs/super.c:2854 mount_bdev+0x34d/0x410 fs/super.c:1400 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] The buggy address belongs to the physical page: page:ffffea0001f8d400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e350 head:ffffea0001f8d400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88807e351f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e351f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807e352000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807e352080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e352100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== This patch solves it by moving the ATTR_RECORD strcture's bounds checking earlier, then checking whether ATTR_RECORD's name is within bounds. What's more, this patch also add some comments to improve its maintainability. Link: https://lkml.kernel.org/r/20220831160935.3409-3-yin31149@gmail.com Link: https://lore.kernel.org/all/1636796c-c85e-7f47-e96f-e074fee3c7d3@huawei.com/ Link: https://groups.google.com/g/syzkaller-bugs/c/t_XdeKPGTR4/m/LECAuIGcBgAJ Signed-off-by: chenxiaosong (A) Signed-off-by: Dan Carpenter Signed-off-by: Hawkins Jiawei Reported-by: syzbot+5f8dcabe4a3b2c51c607@syzkaller.appspotmail.com Tested-by: syzbot+5f8dcabe4a3b2c51c607@syzkaller.appspotmail.com Cc: Anton Altaparmakov Cc: syzkaller-bugs Signed-off-by: Andrew Morton commit d85a1bec8e8d552ab13163ca1874dcd82f3d1550 Author: Hawkins Jiawei Date: Thu Sep 1 00:09:34 2022 +0800 ntfs: fix use-after-free in ntfs_attr_find() Patch series "ntfs: fix bugs about Attribute", v2. This patchset fixes three bugs relative to Attribute in record: Patch 1 adds a sanity check to ensure that, attrs_offset field in first mft record loading from disk is within bounds. Patch 2 moves the ATTR_RECORD's bounds checking earlier, to avoid dereferencing ATTR_RECORD before checking this ATTR_RECORD is within bounds. Patch 3 adds an overflow checking to avoid possible forever loop in ntfs_attr_find(). Without patch 1 and patch 2, the kernel triggersa KASAN use-after-free detection as reported by Syzkaller. Although one of patch 1 or patch 2 can fix this, we still need both of them. Because patch 1 fixes the root cause, and patch 2 not only fixes the direct cause, but also fixes the potential out-of-bounds bug. This patch (of 3): Syzkaller reported use-after-free read as follows: ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597 Read of size 2 at addr ffff88807e352009 by task syz-executor153/3607 [...] Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597 ntfs_attr_lookup+0x1056/0x2070 fs/ntfs/attrib.c:1193 ntfs_read_inode_mount+0x89a/0x2580 fs/ntfs/inode.c:1845 ntfs_fill_super+0x1799/0x9320 fs/ntfs/super.c:2854 mount_bdev+0x34d/0x410 fs/super.c:1400 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] The buggy address belongs to the physical page: page:ffffea0001f8d400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e350 head:ffffea0001f8d400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88807e351f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e351f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807e352000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807e352080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e352100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Kernel will loads $MFT/$DATA's first mft record in ntfs_read_inode_mount(). Yet the problem is that after loading, kernel doesn't check whether attrs_offset field is a valid value. To be more specific, if attrs_offset field is larger than bytes_allocated field, then it may trigger the out-of-bounds read bug(reported as use-after-free bug) in ntfs_attr_find(), when kernel tries to access the corresponding mft record's attribute. This patch solves it by adding the sanity check between attrs_offset field and bytes_allocated field, after loading the first mft record. Link: https://lkml.kernel.org/r/20220831160935.3409-1-yin31149@gmail.com Link: https://lkml.kernel.org/r/20220831160935.3409-2-yin31149@gmail.com Signed-off-by: Hawkins Jiawei Cc: Anton Altaparmakov Cc: ChenXiaoSong Cc: syzkaller-bugs Cc: Dan Carpenter Signed-off-by: Andrew Morton commit 199cda13534f4c676d7e4601665e971f4f0582c4 Author: wuchi Date: Sat Aug 27 15:11:16 2022 +0800 initramfs: mark my_inptr as __initdata As my_inptr is only used in __init function unpack_to_rootfs(), mark it as __initdata to allow it be freed after boot. Link: https://lkml.kernel.org/r/20220827071116.83078-1-wuchi.zero@gmail.com Signed-off-by: wuchi Reviewed-by: David Disseldorp Cc: Alexander Viro Cc: Martin Wilck Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit d2e85432a2e0a6f31bd9489800f443228f020ed6 Author: Yang Yingliang Date: Fri Aug 26 15:33:37 2022 +0800 fail_function: fix wrong use of fei_attr_remove() If register_kprobe() fails, the new attr is not added to the list yet, so it should call fei_attr_free() intstead. Link: https://lkml.kernel.org/r/20220826073337.2085798-3-yangyingliang@huawei.com Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework") Signed-off-by: Yang Yingliang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit cef9f5f866ad45a2dd64fed6e6b657043c2c6f17 Author: Yang Yingliang Date: Fri Aug 26 15:33:36 2022 +0800 fail_function: refactor code of checking return value of register_kprobe() Refactor the error handling of register_kprobe() to improve readability. No functional change. Link: https://lkml.kernel.org/r/20220826073337.2085798-2-yangyingliang@huawei.com Signed-off-by: Yang Yingliang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit f81259c6dbcefb255fa473090cd975f3827bca89 Author: Yang Yingliang Date: Fri Aug 26 15:33:35 2022 +0800 fail_function: switch to memdup_user_nul() helper Use memdup_user_nul() helper instead of open-coding to simplify the code. Link: https://lkml.kernel.org/r/20220826073337.2085798-1-yangyingliang@huawei.com Signed-off-by: Yang Yingliang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit 9a15193e23b780d1da77e3db18698beb0637897d Author: Uros Bizjak Date: Thu Aug 25 16:56:03 2022 +0200 smpboot: use atomic_try_cmpxchg in cpu_wait_death and cpu_report_death Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old in cpu_wait_death and cpu_report_death. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, atomic_try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. No functional change intended. Link: https://lkml.kernel.org/r/20220825145603.5811-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 5fdfa161b2043001f82cbce49e87e8e9f581d510 Author: Uros Bizjak Date: Tue Aug 23 17:26:32 2022 +0200 task_work: use try_cmpxchg in task_work_add, task_work_cancel_match and task_work_run Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in task_work_add, task_work_cancel_match and task_work_run. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, atomic_try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. The patch avoids extra memory read in case cmpxchg fails. Link: https://lkml.kernel.org/r/20220823152632.4517-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 977bbf4385fc64986f22b024858071a35c481a8a Author: Wolfram Sang Date: Thu Aug 18 23:02:03 2022 +0200 lib: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818210203.8251-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Signed-off-by: Andrew Morton commit a1d3a6d9f243797d1bcaa0ca14c03396bc302ca6 Author: Wolfram Sang Date: Thu Aug 18 23:01:59 2022 +0200 init: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818210200.8203-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Signed-off-by: Andrew Morton commit 512cb7e4c110133e49da9f69885df3ed41aa284f Author: Wolfram Sang Date: Thu Aug 18 23:01:53 2022 +0200 reiserfs: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818210153.8095-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Cc: Jan Kara Signed-off-by: Andrew Morton commit c97e21fe91ed1d59eb36cac1728bcb9a82167c7a Author: Wolfram Sang Date: Thu Aug 18 23:01:13 2022 +0200 ocfs2: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818210123.7637-4-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit 216e71f13c13a7b3df352742554445907011a3a5 Author: Wolfram Sang Date: Thu Aug 18 22:59:39 2022 +0200 ia64: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818205940.6216-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Signed-off-by: Andrew Morton commit 88040e67b9533003cfd1a2d61ebd17593435322c Author: Wolfram Sang Date: Thu Aug 18 22:59:36 2022 +0200 alpha: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220818205936.6144-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Signed-off-by: Andrew Morton commit e1d7c7609ae0933b59840390c1b207ac0a925c8b Author: Uros Bizjak Date: Mon Aug 22 16:38:51 2022 +0200 bitops: use try_cmpxchg in set_mask_bits and bit_clear_unless Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in set_mask_bits and bit_clear_unless. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. Link: https://lkml.kernel.org/r/20220822143851.3290-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 21490eff121555b123f7088b935e40ee43d2c642 Author: Fabio M. De Francesco Date: Sun Aug 21 20:04:00 2022 +0200 hfs: replace kmap() with kmap_local_page() in btree.c kmap() is being deprecated in favor of kmap_local_page(). Two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in btree.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in btree.c. Where possible, use the suited standard helpers (memzero_page(), memcpy_page()) instead of open coding kmap_local_page() plus memset() or memcpy(). Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220821180400.8198-4-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Arnd Bergmann Cc: Chaitanya Kulkarni Cc: Christian Brauner (Microsoft) Cc: Damien Le Moal Cc: Jeff Layton Cc: Jens Axboe Cc: Kees Cook Cc: Martin K. Petersen Cc: Matthew Wilcox Cc: Muchun Song Cc: Roman Gushchin Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit ca0ac8dfd35b218b3c95d3b38c695fbff35d94ca Author: Fabio M. De Francesco Date: Sun Aug 21 20:03:59 2022 +0200 hfs: replace kmap() with kmap_local_page() in bnode.c kmap() is being deprecated in favor of kmap_local_page(). Two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in bnode.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in bnode.c. Where possible, use the suited standard helpers (memzero_page(), memcpy_page()) instead of open coding kmap_local_page() plus memset() or memcpy(). Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220821180400.8198-3-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Arnd Bergmann Cc: Chaitanya Kulkarni Cc: Christian Brauner (Microsoft) Cc: Damien Le Moal Cc: Jeff Layton Cc: Jens Axboe Cc: Kees Cook Cc: Martin K. Petersen Cc: Matthew Wilcox Cc: Muchun Song Cc: Roman Gushchin Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit d75e9a4bccf4e19928534dec797935e650f85b09 Author: Fabio M. De Francesco Date: Sun Aug 21 20:03:58 2022 +0200 hfs: unmap the page in the "fail_page" label Patch series "hfs: Replace kmap() with kmap_local_page()". kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmaps pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in fs/hfs is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in fs/hfs. Where possible, use the suited standard helpers (memzero_page(), memcpy_page()) instead of open coding kmap_local_page() plus memset() or memcpy(). Fix a bug due to a page being not unmapped if the code jumps to the "fail_page" label (1/3). Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. This patch (of 3): Several paths within hfs_btree_open() jump to the "fail_page" label where put_page() is called while the page is still mapped. Call kunmap() to unmap the page soon before put_page(). Link: https://lkml.kernel.org/r/20220821180400.8198-1-fmdefrancesco@gmail.com Link: https://lkml.kernel.org/r/20220821180400.8198-2-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Arnd Bergmann Cc: Chaitanya Kulkarni Cc: Christian Brauner (Microsoft) Cc: Damien Le Moal Cc: Matthew Wilcox ] Cc: Jeff Layton Cc: Jens Axboe Cc: Kees Cook Cc: Martin K. Petersen Cc: Muchun Song Cc: Roman Gushchin Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit 948084f0f6959f602f89f679522b706a72da0285 Author: Fabio M. De Francesco Date: Sun Aug 21 20:25:19 2022 +0200 kexec: replace kmap() with kmap_local_page() kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid. Since its use in kexec_core.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in kexec_core.c. Tested on a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220821182519.9483-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Ira Weiny Acked-by: Baoquan He Signed-off-by: Andrew Morton commit da3f52ba359590d8eb465ae0d8b6e11d6fd9432f Author: Uros Bizjak Date: Sun Aug 21 21:30:11 2022 +0200 iversion: use atomic64_try_cmpxchg) Use atomic64_try_cmpxchg instead of atomic64_cmpxchg (*ptr, old, new) == old in inode_set_max_iversion_raw, inode_maybe_inc_version and inode_query_iversion. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. The loop in inode_maybe_inc_iversion improves from: 5563: 48 89 ca mov %rcx,%rdx 5566: 48 89 c8 mov %rcx,%rax 5569: 48 83 e2 fe and $0xfffffffffffffffe,%rdx 556d: 48 83 c2 02 add $0x2,%rdx 5571: f0 48 0f b1 16 lock cmpxchg %rdx,(%rsi) 5576: 48 39 c1 cmp %rax,%rcx 5579: 0f 84 85 fc ff ff je 5204 <...> 557f: 48 89 c1 mov %rax,%rcx 5582: eb df jmp 5563 <...> to: 5563: 48 89 c2 mov %rax,%rdx 5566: 48 83 e2 fe and $0xfffffffffffffffe,%rdx 556a: 48 83 c2 02 add $0x2,%rdx 556e: f0 48 0f b1 11 lock cmpxchg %rdx,(%rcx) 5573: 0f 84 8b fc ff ff je 5204 <...> 5579: eb e8 jmp 5563 <...> Link: https://lkml.kernel.org/r/20220821193011.88208-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 38ace0d513d9d2556beca4d07102d25e9a73c53c Author: Uros Bizjak Date: Thu Jul 14 18:48:51 2022 +0200 aio: use atomic_try_cmpxchg in __get_reqs_available Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old in __get_reqs_available. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, atomic_try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. No functional change intended. Link: https://lkml.kernel.org/r/20220714164851.3055-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Cc: Benjamin LaHaise Cc: Alexander Viro Signed-off-by: Andrew Morton commit b0192296b45232872720d969366449c001ab1f4a Author: Uros Bizjak Date: Thu Jul 14 19:16:53 2022 +0200 buffer: use try_cmpxchg in discard_buffer Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in discard_buffer. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. Note that the value from *ptr should be read using READ_ONCE to prevent the compiler from merging, refetching or reordering the read. No functional change intended. Link: https://lkml.kernel.org/r/20220714171653.12128-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Cc: Alexander Viro Signed-off-by: Andrew Morton commit 693fc06e98514c2d5951ead4aca40cf8b21100b1 Author: Uros Bizjak Date: Thu Jul 14 19:32:55 2022 +0200 epoll: use try_cmpxchg in list_add_tail_lockless Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in list_add_tail_lockless. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). No functional change intended. Link: https://lkml.kernel.org/r/20220714173255.12987-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Cc: Alexander Viro Signed-off-by: Andrew Morton commit aa06a9bd853306c239f759018fb227d7e8f4e203 Author: Sergei Trofimovich Date: Sat Aug 20 19:18:13 2022 +0100 ia64: fix clock_getres(CLOCK_MONOTONIC) to report ITC frequency clock_gettime(CLOCK_MONOTONIC, &tp) is very precise on ia64 as it uses ITC (similar to rdtsc on x86). It's not quite a hrtimer as it is a few times slower than 1ns. Usually 2-3ns. clock_getres(CLOCK_MONOTONIC, &res) never reflected that fact and reported 0.04s precision (1/HZ value). In https://bugs.gentoo.org/596382 gstreamer's test suite failed loudly when it noticed precision discrepancy. Before the change: clock_getres(CLOCK_MONOTONIC, &res) reported 250Hz precision. After the change: clock_getres(CLOCK_MONOTONIC, &res) reports ITC (400Mhz) precision. The patch is based on matoro's fix. I added a bit of explanation why we need to special-case arch-specific clock_getres(). [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/20220820181813.2275195-1-slyich@gmail.com Signed-off-by: Sergei Trofimovich Cc: matoro Cc: Émeric Maschino Signed-off-by: Andrew Morton commit cba7543e1515e79a85d37df85a0eb2cf0f07d115 Author: Minghao Chi Date: Fri Aug 19 08:18:19 2022 +0000 fs/qnx6: delete unnecessary checks before brelse() brelse() tests whether its argument is NULL and then returns immediately. Thus remove the tests which are not needed around the shown calls. Link: https://lkml.kernel.org/r/20220819081819.96347-1-chi.minghao@zte.com.cn Signed-off-by: Minghao Chi Reported-by: Zeal Robot Cc: CGEL ZTE Cc: Matthew Wilcox Cc: Minghao Chi Cc: Muchun Song Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit 2be9880dc87342dc7ae459c9ea5c9ee2a45b33d8 Author: Kefeng Wang Date: Fri Aug 19 09:44:06 2022 +0800 kernel: exit: cleanup release_thread() Only x86 has own release_thread(), introduce a new weak release_thread() function to clean empty definitions in other ARCHs. Link: https://lkml.kernel.org/r/20220819014406.32266-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Guo Ren [csky] Acked-by: Russell King (Oracle) Acked-by: Geert Uytterhoeven Acked-by: Brian Cain Acked-by: Michael Ellerman [powerpc] Acked-by: Stafford Horne [openrisc] Acked-by: Catalin Marinas [arm64] Acked-by: Huacai Chen [LoongArch] Cc: Alexander Gordeev Cc: Anton Ivanov Cc: Borislav Petkov Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Chris Zankel Cc: Dave Hansen Cc: "David S. Miller" Cc: Dinh Nguyen Cc: Guo Ren [csky] Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Johannes Berg Cc: Jonas Bonn Cc: Matt Turner Cc: Max Filippov Cc: Michal Simek Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Richard Weinberger Cc: Rich Felker Cc: Stefan Kristiansson Cc: Sven Schnelle Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vineet Gupta Cc: Will Deacon Cc: Xuerui Wang Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit f4068af3a6383da3487c07de85db7732de851734 Author: Brian Foster Date: Mon Aug 15 12:50:04 2022 +0300 proc: save LOC in vsyscall test Do one fork in vsyscall detection code and let SIGSEGV handler exit and carry information to the parent saving LOC. [adobriyan@gmail.com: redo original patch, delete unnecessary variables, minimise code changes] Link: https://lkml.kernel.org/r/YvoWzAn5dlhF75xa@localhost.localdomain Signed-off-by: Alexey Dobriyan Signed-off-by: Brian Foster Reviewed-by: Brian Foster Tested-by: Brian Foster Signed-off-by: Andrew Morton commit 4f1d2a030db09af4d21695983674a18633cd0ffb Author: Uros Bizjak Date: Tue Jul 12 16:49:17 2022 +0200 llist: use try_cmpxchg in llist_add_batch and llist_del_first Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in llist_add_batch and llist_del_first. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg. Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. No functional change intended. Link: https://lkml.kernel.org/r/20220712144917.4497-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 05c6257433b7212f07a7e53479a8ab038fc1666a Author: Valentin Schneider Date: Thu Jun 30 23:32:58 2022 +0100 panic, kexec: make __crash_kexec() NMI safe Attempting to get a crash dump out of a debug PREEMPT_RT kernel via an NMI panic() doesn't work. The cause of that lies in the PREEMPT_RT definition of mutex_trylock(): if (IS_ENABLED(CONFIG_DEBUG_RT_MUTEXES) && WARN_ON_ONCE(!in_task())) return 0; This prevents an nmi_panic() from executing the main body of __crash_kexec() which does the actual kexec into the kdump kernel. The warning and return are explained by: 6ce47fd961fa ("rtmutex: Warn if trylock is called from hard/softirq context") [...] The reasons for this are: 1) There is a potential deadlock in the slowpath 2) Another cpu which blocks on the rtmutex will boost the task which allegedly locked the rtmutex, but that cannot work because the hard/softirq context borrows the task context. Furthermore, grabbing the lock isn't NMI safe, so do away with kexec_mutex and replace it with an atomic variable. This is somewhat overzealous as *some* callsites could keep using a mutex (e.g. the sysfs-facing ones like crash_shrink_memory()), but this has the benefit of involving a single unified lock and preventing any future NMI-related surprises. Tested by triggering NMI panics via: $ echo 1 > /proc/sys/kernel/panic_on_unrecovered_nmi $ echo 1 > /proc/sys/kernel/unknown_nmi_panic $ echo 1 > /proc/sys/kernel/panic $ ipmitool power diag Link: https://lkml.kernel.org/r/20220630223258.4144112-3-vschneid@redhat.com Fixes: 6ce47fd961fa ("rtmutex: Warn if trylock is called from hard/softirq context") Signed-off-by: Valentin Schneider Cc: Arnd Bergmann Cc: Baoquan He Cc: "Eric W . Biederman" Cc: Juri Lelli Cc: Luis Claudio R. Goncalves Cc: Miaohe Lin Cc: Petr Mladek Cc: Sebastian Andrzej Siewior Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 7bb5da0d490b2d836c5218f5186ee588d2145310 Author: Valentin Schneider Date: Thu Jun 30 23:32:57 2022 +0100 kexec: turn all kexec_mutex acquisitions into trylocks Patch series "kexec, panic: Making crash_kexec() NMI safe", v4. This patch (of 2): Most acquistions of kexec_mutex are done via mutex_trylock() - those were a direct "translation" from: 8c5a1cf0ad3a ("kexec: use a mutex for locking rather than xchg()") there have however been two additions since then that use mutex_lock(): crash_get_memory_size() and crash_shrink_memory(). A later commit will replace said mutex with an atomic variable, and locking operations will become atomic_cmpxchg(). Rather than having those mutex_lock() become while (atomic_cmpxchg(&lock, 0, 1)), turn them into trylocks that can return -EBUSY on acquisition failure. This does halve the printable size of the crash kernel, but that's still neighbouring 2G for 32bit kernels which should be ample enough. Link: https://lkml.kernel.org/r/20220630223258.4144112-1-vschneid@redhat.com Link: https://lkml.kernel.org/r/20220630223258.4144112-2-vschneid@redhat.com Signed-off-by: Valentin Schneider Cc: Arnd Bergmann Cc: "Eric W . Biederman" Cc: Juri Lelli Cc: Luis Claudio R. Goncalves Cc: Miaohe Lin Cc: Petr Mladek Cc: Sebastian Andrzej Siewior Cc: Thomas Gleixner Cc: Baoquan He Signed-off-by: Andrew Morton commit 9847f21225c4eb0b843cb2b72ed83b32edb1e6f2 Author: Neel Natu Date: Thu Jul 28 16:24:34 2022 -0700 lib/cmdline: avoid page fault in next_arg An argument list like "arg=val arg2 \"" can trigger a page fault if the page pointed by 'args[0xffffffff]' is not mapped and potential memory corruption otherwise (unlikely but possible if the bogus address is mapped and contents happen to match the ascii value of the quote character). The fix is to ensure that we load 'args[i-1]' only when (i > 0). Prior to this commit the following command would trigger an unhandled page fault in the kernel: root@(none):/linus/fs/fat# insmod ./fat.ko "foo=bar \"" [ 33.870507] BUG: unable to handle page fault for address: ffff888204252608 [ 33.872180] #PF: supervisor read access in kernel mode [ 33.873414] #PF: error_code(0x0000) - not-present page [ 33.874650] PGD 4401067 P4D 4401067 PUD 0 [ 33.875321] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC PTI [ 33.876113] CPU: 16 PID: 399 Comm: insmod Not tainted 5.19.0-dbg-DEV #4 [ 33.877193] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 [ 33.878739] RIP: 0010:next_arg+0xd1/0x110 [ 33.879399] Code: 22 75 1d 41 c6 04 01 00 41 80 f8 22 74 18 eb 35 4c 89 0e 45 31 d2 4c 89 cf 48 c7 02 00 00 00 00 41 80 f8 22 75 1f 41 8d 42 ff <41> 80 3c 01 22 75 14 41 c6 04 01 00 eb 0d 48 c7 02 00 00 00 00 41 [ 33.882338] RSP: 0018:ffffc90001253d08 EFLAGS: 00010246 [ 33.883174] RAX: 00000000ffffffff RBX: ffff888104252608 RCX: 0fc317bba1c1dd00 [ 33.884311] RDX: ffffc90001253d40 RSI: ffffc90001253d48 RDI: ffff888104252609 [ 33.885450] RBP: ffffc90001253d10 R08: 0000000000000022 R09: ffff888104252609 [ 33.886595] R10: 0000000000000000 R11: ffffffff82c7ff20 R12: 0000000000000282 [ 33.887748] R13: 00000000ffff8000 R14: 0000000000000000 R15: 0000000000007fff [ 33.888887] FS: 00007f04ec7432c0(0000) GS:ffff88813d300000(0000) knlGS:0000000000000000 [ 33.890183] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 33.891111] CR2: ffff888204252608 CR3: 0000000100f36005 CR4: 0000000000170ee0 [ 33.892241] Call Trace: [ 33.892641] [ 33.892989] parse_args+0x8f/0x220 [ 33.893538] load_module+0x138b/0x15a0 [ 33.894149] ? prepare_coming_module+0x50/0x50 [ 33.894879] ? kernel_read_file_from_fd+0x5f/0x90 [ 33.895639] __se_sys_finit_module+0xce/0x130 [ 33.896342] __x64_sys_finit_module+0x1d/0x20 [ 33.897042] do_syscall_64+0x44/0xa0 [ 33.897622] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 33.898434] RIP: 0033:0x7f04ec85ef79 [ 33.899009] Code: 48 8d 3d da db 0d 00 0f 05 eb a5 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c7 9e 0d 00 f7 d8 64 89 01 48 [ 33.901912] RSP: 002b:00007fffae81bfe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 33.903081] RAX: ffffffffffffffda RBX: 0000559c5f1d2640 RCX: 00007f04ec85ef79 [ 33.904191] RDX: 0000000000000000 RSI: 0000559c5f1d12a0 RDI: 0000000000000003 [ 33.905304] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 [ 33.906421] R10: 0000000000000003 R11: 0000000000000246 R12: 0000559c5f1d12a0 [ 33.907526] R13: 0000000000000000 R14: 0000559c5f1d25f0 R15: 0000559c5f1d12a0 [ 33.908631] [ 33.908986] Modules linked in: fat(+) [last unloaded: fat] [ 33.909843] CR2: ffff888204252608 [ 33.910375] ---[ end trace 0000000000000000 ]--- [ 33.911172] RIP: 0010:next_arg+0xd1/0x110 [ 33.911796] Code: 22 75 1d 41 c6 04 01 00 41 80 f8 22 74 18 eb 35 4c 89 0e 45 31 d2 4c 89 cf 48 c7 02 00 00 00 00 41 80 f8 22 75 1f 41 8d 42 ff <41> 80 3c 01 22 75 14 41 c6 04 01 00 eb 0d 48 c7 02 00 00 00 00 41 [ 33.914643] RSP: 0018:ffffc90001253d08 EFLAGS: 00010246 [ 33.915446] RAX: 00000000ffffffff RBX: ffff888104252608 RCX: 0fc317bba1c1dd00 [ 33.916544] RDX: ffffc90001253d40 RSI: ffffc90001253d48 RDI: ffff888104252609 [ 33.917636] RBP: ffffc90001253d10 R08: 0000000000000022 R09: ffff888104252609 [ 33.918727] R10: 0000000000000000 R11: ffffffff82c7ff20 R12: 0000000000000282 [ 33.919821] R13: 00000000ffff8000 R14: 0000000000000000 R15: 0000000000007fff [ 33.920908] FS: 00007f04ec7432c0(0000) GS:ffff88813d300000(0000) knlGS:0000000000000000 [ 33.922125] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 33.923017] CR2: ffff888204252608 CR3: 0000000100f36005 CR4: 0000000000170ee0 [ 33.924098] Kernel panic - not syncing: Fatal exception [ 33.925776] Kernel Offset: disabled [ 33.926347] Rebooting in 10 seconds.. Link: https://lkml.kernel.org/r/20220728232434.1666488-1-neelnatu@google.com Signed-off-by: Neel Natu Reviewed-by: Eric Dumazet Signed-off-by: Andrew Morton commit defdaff15a84c68521c5f02b157fc8541e0356f3 Author: Ira Weiny Date: Sat Aug 13 15:00:34 2022 -0700 checkpatch: add kmap and kmap_atomic to the deprecated list kmap() and kmap_atomic() are being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. kmap_local_page() is safe from any context and is therefore redundant with kmap_atomic() with the exception of any pagefault or preemption disable requirements. However, using kmap_atomic() for these side effects makes the code less clear. So any requirement for pagefault or preemption disable should be made explicitly. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored. Link: https://lkml.kernel.org/r/20220813220034.806698-1-ira.weiny@intel.com Signed-off-by: Ira Weiny Suggested-by: Thomas Gleixner Suggested-by: Fabio M. De Francesco Reviewed-by: Chaitanya Kulkarni Cc: Joe Perches Signed-off-by: Andrew Morton commit 5bb6ce3aeb02497668a4e8971268b041aa61de8d Author: Fabio M. De Francesco Date: Mon Aug 1 14:27:09 2022 +0200 fs/isofs: replace kmap() with kmap_local_page() The use of kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). Tasks can be preempted and, when scheduled to run again, the kernel virtual addresses are restored and still valid. It is faster than kmap() in kernels with HIGHMEM enabled. Since kmap_local_page() can be safely used in compress.c, it should be called everywhere instead of kmap(). Therefore, replace kmap() with kmap_local_page() in compress.c. Where it is needed, use memzero_page() instead of open coding kmap_local_page() plus memset() to fill the pages with zeros. Delete the redundant flush_dcache_page() in the two call sites of memzero_page(). Tested with mkisofs on a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220801122709.8164-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Jan Kara Cc: Matthew Wilcox (Oracle) Cc: Roman Gushchin Cc: Pali Rohár Cc: Muchun Song Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit 64367f2e4f11cfdd983c637d219fb364ab85558c Author: Arnd Bergmann Date: Thu Aug 11 13:44:34 2022 +0200 treewide: defconfig: address renamed CONFIG_DEBUG_INFO=y CONFIG_DEBUG_INFO is now implicitly selected if one picks one of the explicit options that could be DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT, DEBUG_INFO_DWARF4, DEBUG_INFO_DWARF5. This was actually not what I had in mind when I suggested making it a 'choice' statement, but it's too late to change again now, and the Kconfig logic is more sensible in the new form. Change any defconfig file that had CONFIG_DEBUG_INFO enabled but did not pick DWARF4 or DWARF5 explicitly to now pick the toolchain default. Link: https://lkml.kernel.org/r/20220811114609.2097335-1-arnd@kernel.org Fixes: f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable from a choice") Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Vineet Gupta Cc: Michal Simek Cc: Thomas Bogendoerfer Cc: Dinh Nguyen Cc: Yoshinori Sato Cc: Rich Felker Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Chris Zankel Cc: Max Filippov Cc: Arnd Bergmann Signed-off-by: Andrew Morton commit 58b5c203360799e181325f3f8ce212de80ebf304 Author: Manfred Spraul Date: Fri Aug 5 13:57:33 2022 +0200 ipc/util.c: cleanup and improve sysvipc_find_ipc() sysvipc_find_ipc() can be simplified further: - It uses a for() loop to locate the next entry in the idr. This can be replaced with idr_get_next(). - It receives two parameters (pos - which is actually an idr index and not a position, and new_pos, which is really a position). One parameter is sufficient. Link: https://lore.kernel.org/all/20210903052020.3265-3-manfred@colorfullife.com/ Link: https://lkml.kernel.org/r/20220805115733.104763-1-manfred@colorfullife.com Signed-off-by: Manfred Spraul Acked-by: Davidlohr Bueso Acked-by: Waiman Long Cc: "Eric W . Biederman" Cc: <1vier1@web.de> Signed-off-by: Andrew Morton commit 765f2bf04fdaced4e7d7e94cfc3f743048629f31 Author: Borislav Petkov Date: Mon Aug 8 10:59:28 2022 +0200 scripts/decodecode: improve faulting line determination There are cases where the IP pointer in a Code: line in an oops doesn't point at the beginning of an instruction: Code: 0f bd c2 e9 a0 cd b5 e4 48 0f bd c2 e9 97 cd b5 e4 0f 1f 80 00 00 00 00 \ e9 8b cd b5 e4 0f 1f 00 66 0f a3 d0 e9 7f cd b5 e4 0f 1f <80> 00 00 00 \ 00 0f a3 d0 e9 70 cd b5 e4 48 0f a3 d0 e9 67 cd b5 e9 7f cd b5 e4 jmp 0xffffffffe4b5cda8 0f 1f 80 00 00 00 00 nopl 0x0(%rax) ^^ and the current way of determining the faulting instruction line doesn't work because disassembled instructions are counted from the IP byte to the end and when that thing points in the middle, the trailing bytes can be interpreted as different insns: Code starting with the faulting instruction =========================================== 0: 80 00 00 addb $0x0,(%rax) 3: 00 00 add %al,(%rax) whereas, this is part of 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 5: 0f a3 d0 bt %edx,%eax ... leading to: 1d: 0f 1f 00 nopl (%rax) 20: 66 0f a3 d0 bt %dx,%ax 24:* e9 7f cd b5 e4 jmp 0xffffffffe4b5cda8 <-- trapping instruction 29: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 30: 0f a3 d0 bt %edx,%eax which is the wrong faulting instruction. Change the way the faulting line number is determined by matching the opcode bytes from the beginning, leading to correct output: 1d: 0f 1f 00 nopl (%rax) 20: 66 0f a3 d0 bt %dx,%ax 24: e9 7f cd b5 e4 jmp 0xffffffffe4b5cda8 29:* 0f 1f 80 00 00 00 00 nopl 0x0(%rax) <-- trapping instruction 30: 0f a3 d0 bt %edx,%eax While at it, make decodecode use bash as the interpreter - that thing should be present on everything by now. It simplifies the code a lot too. Link: https://lkml.kernel.org/r/20220808085928.29840-1-bp@alien8.de Signed-off-by: Borislav Petkov Cc: Marc Zyngier Cc: Will Deacon Signed-off-by: Andrew Morton commit 9f25f357c557bfea39a2d6a629a6317d2b3dfc64 Author: Fabio M. De Francesco Date: Tue Aug 9 22:31:05 2022 +0200 hfsplus: convert kmap() to kmap_local_page() in btree.c kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid. Since its use in btree.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in btree.c. Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220809203105.26183-5-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Bart Van Assche Cc: Jens Axboe Cc: Kees Cook Cc: Matthew Wilcox Cc: Muchun Song Signed-off-by: Andrew Morton commit f9ef3b95a305874de0b36b7294f6cc8a0e07951e Author: Fabio M. De Francesco Date: Tue Aug 9 22:31:04 2022 +0200 hfsplus: convert kmap() to kmap_local_page() in bitmap.c kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid. Since its use in bitmap.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in bitmap.c. Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220809203105.26183-4-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Bart Van Assche Cc: Jens Axboe Cc: Kees Cook Cc: Matthew Wilcox Cc: Muchun Song Signed-off-by: Andrew Morton commit 6c3014a67a44f11dc1020c8b47a1d1d626f007a9 Author: Fabio M. De Francesco Date: Tue Aug 9 22:31:03 2022 +0200 hfsplus: convert kmap() to kmap_local_page() in bnode.c kmap() is being deprecated in favor of kmap_local_page(). Two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in bnode.c is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in bnode.c. Where possible, use the suited standard helpers (memzero_page(), memcpy_page()) instead of open coding kmap_local_page() plus memset() or memcpy(). Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Link: https://lkml.kernel.org/r/20220809203105.26183-3-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Bart Van Assche Cc: Jens Axboe Cc: Kees Cook Cc: Matthew Wilcox Cc: Muchun Song Signed-off-by: Andrew Morton commit f5b23d6704e478b5a97dbba5df9dea96a9cbf847 Author: Fabio M. De Francesco Date: Tue Aug 9 22:31:02 2022 +0200 hfsplus: unmap the page in the "fail_page" label Patch series "hfsplus: Replace kmap() with kmap_local_page()". kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in fs/hfsplus is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in fs/hfsplus. Where possible, use the suited standard helpers (memzero_page(), memcpy_page()) instead of open coding kmap_local_page() plus memset() or memcpy(). Fix a bug due to a page being not unmapped if the code jumps to the "fail_page" label (1/4). Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. This patch (of 4): Several paths within hfs_btree_open() jump to the "fail_page" label where put_page() is called while the page is still mapped. Call kunmap() to unmap the page soon before put_page(). Link: https://lkml.kernel.org/r/20220809203105.26183-1-fmdefrancesco@gmail.com Link: https://lkml.kernel.org/r/20220809203105.26183-2-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny Reviewed-by: Viacheslav Dubeyko Cc: Matthew Wilcox Cc: Fabio M. De Francesco Cc: Jens Axboe Cc: Bart Van Assche Cc: Kees Cook Cc: Muchun Song Signed-off-by: Andrew Morton commit 088b8aa537c2c767765f1c19b555f21ffe555786 Author: David Hildenbrand Date: Thu Sep 1 10:35:59 2022 +0200 mm: fix PageAnonExclusive clearing racing with concurrent RCU GUP-fast commit 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") made sure that when PageAnonExclusive() has to be cleared during temporary unmapping of a page, that the PTE is cleared/invalidated and that the TLB is flushed. What we want to achieve in all cases is that we cannot end up with a pin on an anonymous page that may be shared, because such pins would be unreliable and could result in memory corruptions when the mapped page and the pin go out of sync due to a write fault. That TLB flush handling was inspired by an outdated comment in mm/ksm.c:write_protect_page(), which similarly required the TLB flush in the past to synchronize with GUP-fast. However, ever since general RCU GUP fast was introduced in commit 2667f50e8b81 ("mm: introduce a general RCU get_user_pages_fast()"), a TLB flush is no longer sufficient to handle concurrent GUP-fast in all cases -- it only handles traditional IPI-based GUP-fast correctly. Peter Xu (thankfully) questioned whether that TLB flush is really required. On architectures that send an IPI broadcast on TLB flush, it works as expected. To synchronize with RCU GUP-fast properly, we're conceptually fine, however, we have to enforce a certain memory order and are missing memory barriers. Let's document that, avoid the TLB flush where possible and use proper explicit memory barriers where required. We shouldn't really care about the additional memory barriers here, as we're not on extremely hot paths -- and we're getting rid of some TLB flushes. We use a smp_mb() pair for handling concurrent pinning and a smp_rmb()/smp_wmb() pair for handling the corner case of only temporary PTE changes but permanent PageAnonExclusive changes. One extreme example, whereby GUP-fast takes a R/O pin and KSM wants to convert an exclusive anonymous page to a KSM page, and that page is already mapped write-protected (-> no PTE change) would be: Thread 0 (KSM) Thread 1 (GUP-fast) (B1) Read the PTE # (B2) skipped without FOLL_WRITE (A1) Clear PTE smp_mb() (A2) Check pinned (B3) Pin the mapped page smp_mb() (A3) Clear PageAnonExclusive smp_wmb() (A4) Restore PTE (B4) Check if the PTE changed smp_rmb() (B5) Check PageAnonExclusive Thread 1 will properly detect that PageAnonExclusive was cleared and back off. Note that we don't need a memory barrier between checking if the page is pinned and clearing PageAnonExclusive, because stores are not speculated. The possible issues due to reordering are of theoretical nature so far and attempts to reproduce the race failed. Especially the "no PTE change" case isn't the common case, because we'd need an exclusive anonymous page that's mapped R/O and the PTE is clean in KSM code -- and using KSM with page pinning isn't extremely common. Further, the clear+TLB flush we used for now implies a memory barrier. So the problematic missing part should be the missing memory barrier after pinning but before checking if the PTE changed. Link: https://lkml.kernel.org/r/20220901083559.67446-1-david@redhat.com Fixes: 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") Signed-off-by: David Hildenbrand Cc: Jason Gunthorpe Cc: John Hubbard Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Peter Xu Cc: Alistair Popple Cc: Nadav Amit Cc: Yang Shi Cc: Vlastimil Babka Cc: Michal Hocko Cc: Mike Kravetz Cc: Andrea Parri Cc: Will Deacon Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Christoph von Recklinghausen Cc: Don Dutile Signed-off-by: Andrew Morton commit e7b72c48d677c244aae5aee1a72bc57b84fd495c Author: Christophe JAILLET Date: Fri Sep 2 18:39:52 2022 +0200 mm/mremap_pages: save a few cycles in get_dev_pagemap() Use 'percpu_ref_tryget_live_rcu()' instead of 'percpu_ref_tryget_live()' to save a few cycles when it is known that the rcu lock is already taken/released. Link: https://lkml.kernel.org/r/9ef1562a1975371360f3e263856e9f1c5749b656.1662136782.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 9a157dd8fe5ac32304eff8a7722e30352acaa7f0 Author: Kefeng Wang Date: Thu Sep 1 09:50:43 2022 +0800 mm: remove BUG_ON() in __isolate_free_page() Drop unneed comment and blank, adjust the variable, and the most important is to delete BUG_ON(). The page passed is always buddy page into __isolate_free_page() from compaction, page_isolation and page_reporting, and the caller also check the return, BUG_ON() is a too drastic measure, remove it. Link: https://lkml.kernel.org/r/20220901015043.189276-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Signed-off-by: Andrew Morton commit b955aa70a3ac9f1dd5e26d4c7673ec3c28a8c2af Author: Liu Shixin Date: Thu Sep 1 10:30:07 2022 +0800 mm/kmemleak: make create_object return void No caller cares about the return value of create_object(), so make it return void. Link: https://lkml.kernel.org/r/20220901023007.3471887-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Kefeng Wang Signed-off-by: Andrew Morton commit 50717ed380ed3d7a5ddfa33aad864e20e7b7b453 Author: Tarun Sahu Date: Thu Sep 1 14:53:15 2022 +0530 selftest: vm: remove deleted local_config.* from .gitignore Commit d2d6cba5d6623 ("selftest: vm: remove orphaned references to local_config.{h,mk}") took care of removing orphaned references. This commit removes local_config from .gitignore. Parent patch commit 69007f156ba ("Kselftests: remove support of libhugetlbfs from kselftests") Link: https://lkml.kernel.org/r/20220901092315.33619-1-tsahu@linux.ibm.com Signed-off-by: Tarun Sahu Reviewed-by: Axel Rasmussen Signed-off-by: Andrew Morton commit f8142cf94d4737ea0c3baffb3b9bad8addcb9b6b Author: Miaohe Lin Date: Thu Sep 1 20:00:30 2022 +0800 hugetlb: make hugetlb depends on SYSFS or SYSCTL If CONFIG_SYSFS and CONFIG_SYSCTL are both undefined, hugetlb doesn't work now as there's no way to set max huge pages. Make sure at least one of the above configs is defined to make hugetlb works as expected. Link: https://lkml.kernel.org/r/20220901120030.63318-11-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 5e6b1bf1b5c3c8b72fa2eea9d8731d5c59773945 Author: Miaohe Lin Date: Thu Sep 1 20:00:29 2022 +0800 hugetlb: remove meaningless BUG_ON(huge_pte_none()) When code reaches here, invalid page would have been accessed if huge pte is none. So this BUG_ON(huge_pte_none()) is meaningless. Remove it. Link: https://lkml.kernel.org/r/20220901120030.63318-10-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit a9e1eab241bdaadd56b6cfdc481cff6a24c4799b Author: Miaohe Lin Date: Thu Sep 1 20:00:28 2022 +0800 hugetlb: add comment for subtle SetHPageVmemmapOptimized() The SetHPageVmemmapOptimized() called here seems unnecessary as it's assumed to be set when calling this function. But it's indeed cleared by above set_page_private(page, 0). Add a comment to avoid possible future confusion. Link: https://lkml.kernel.org/r/20220901120030.63318-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 29be84265fe0023cff8b5aa4fa670b55453c3afc Author: Miaohe Lin Date: Thu Sep 1 20:00:27 2022 +0800 hugetlb: kill hugetlbfs_pagecache_page() Fold hugetlbfs_pagecache_page() into its sole caller to remove some duplicated code. No functional change intended. Link: https://lkml.kernel.org/r/20220901120030.63318-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 12658abfc59ddf2ed176fce461e83f392ff18e5b Author: Miaohe Lin Date: Thu Sep 1 20:00:26 2022 +0800 hugetlb: pass NULL to kobj_to_hstate() if nid is unused We can pass NULL to kobj_to_hstate() directly when nid is unused to simplify the code. No functional change intended. Link: https://lkml.kernel.org/r/20220901120030.63318-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit bcc665436fe4648550ed4fd3345c7106b5da35b0 Author: Miaohe Lin Date: Thu Sep 1 20:00:25 2022 +0800 hugetlb: use helper {huge_pte|pmd}_lock() Use helper huge_pte_lock and pmd_lock to simplify the code. No functional change intended. Link: https://lkml.kernel.org/r/20220901120030.63318-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 103956805c250ccef3d2a54a0a2e3354291cdd85 Author: Miaohe Lin Date: Thu Sep 1 20:00:24 2022 +0800 hugetlb: use sizeof() to get the array size It's better to use sizeof() to get the array size instead of manual calculation. Minor readability improvement. Link: https://lkml.kernel.org/r/20220901120030.63318-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 3466534131b28e1ee1e7cfd5c77d981ea41b20aa Author: Miaohe Lin Date: Thu Sep 1 20:00:23 2022 +0800 hugetlb: use LIST_HEAD() to define a list head Use LIST_HEAD() directly to define a list head to simplify the code. No functional change intended. Link: https://lkml.kernel.org/r/20220901120030.63318-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit c2c3a60a857bfeb154a97ee7e430fc8609c57979 Author: Miaohe Lin Date: Thu Sep 1 20:00:22 2022 +0800 hugetlb: Use helper macro SZ_1K Use helper macro SZ_1K to do the size conversion to make code more consistent in this file. Minor readability improvement. Link: https://lkml.kernel.org/r/20220901120030.63318-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 263b899802fc43cd0e6979f819271dfbb93c94af Author: Miaohe Lin Date: Thu Sep 1 20:00:21 2022 +0800 hugetlb: make hugetlb_cma_check() static Patch series "A few cleanup patches for hugetlb", v2. This series contains a few cleanup patches to use helper functions to simplify the codes, remove unneeded nid parameter and so on. More details can be found in the respective changelogs. This patch (of 10): Make hugetlb_cma_check() static as it's only used inside mm/hugetlb.c. Link: https://lkml.kernel.org/r/20220901120030.63318-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220901120030.63318-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 454552d0145486cf82572e73cca266ab6a56e86b Author: Zhang Yi Date: Thu Sep 1 21:35:05 2022 +0800 fs/buffer: remove bh_submit_read() helper bh_submit_read() has no user anymore, just remove it. Link: https://lkml.kernel.org/r/20220901133505.2510834-15-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 28cf75591008eef5e1649de31c4ddee5bf20081d Author: Zhang Yi Date: Thu Sep 1 21:35:04 2022 +0800 ext2: replace bh_submit_read() helper with bh_read() bh_submit_read() and the uptodate check logic in bh_uptodate_or_lock() has been integrated in bh_read() helper, so switch to use it directly. Link: https://lkml.kernel.org/r/20220901133505.2510834-14-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 79f5978420691fb84593f98557ea56f8b32228f2 Author: Zhang Yi Date: Thu Sep 1 21:35:03 2022 +0800 fs/buffer: remove ll_rw_block() helper Now that all ll_rw_block() users has been replaced to new safe helpers, we just remove it here. Link: https://lkml.kernel.org/r/20220901133505.2510834-13-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 6799b6983170c6dfdb2fcea8c97058557ea7b5b6 Author: Zhang Yi Date: Thu Sep 1 21:35:02 2022 +0800 ufs: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block() in ufs. Link: https://lkml.kernel.org/r/20220901133505.2510834-12-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 59a16786fa7a77dd383a62271e0102f1455bccea Author: Zhang Yi Date: Thu Sep 1 21:35:01 2022 +0800 udf: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block(). We also switch to new bh_readahead_batch() helper for the buffer array readahead path. Link: https://lkml.kernel.org/r/20220901133505.2510834-11-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit d554822e82cc99db53b845f3e60dc13e56ad4575 Author: Zhang Yi Date: Thu Sep 1 21:35:00 2022 +0800 reiserfs: replace ll_rw_block() ll_rw_block() is not safe for the sync read/write path because it cannot guarantee that submitting read/write IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() in read path if the buffer has been locked by others. So stop using ll_rw_block() in reiserfs. We also switch to new bh_readahead_batch() helper for the buffer array readahead path. Link: https://lkml.kernel.org/r/20220901133505.2510834-10-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 54d9171d38d904f5afde76e51bed416aaf144975 Author: Zhang Yi Date: Thu Sep 1 21:34:59 2022 +0800 ocfs2: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block() in ocfs2. Link: https://lkml.kernel.org/r/20220901133505.2510834-9-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 6bf414a00ae7688fac1e03f63431a355068a1d79 Author: Zhang Yi Date: Thu Sep 1 21:34:58 2022 +0800 ntfs3: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block() in ntfs_get_block_vbo(). Link: https://lkml.kernel.org/r/20220901133505.2510834-8-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 8c004d1fc1497d9a6d92ea968bd58230af59a492 Author: Zhang Yi Date: Thu Sep 1 21:34:57 2022 +0800 jbd2: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block() in journal_get_superblock(). We also switch to new bh_readahead_batch() for the buffer array readahead path. Link: https://lkml.kernel.org/r/20220901133505.2510834-7-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Theodore Ts'o Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 0ed48061887f603b33b7dcb9075cbfaaa8d02723 Author: Zhang Yi Date: Thu Sep 1 21:34:56 2022 +0800 isofs: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO return from zisofs_uncompress_block() if he buffer has been locked by others. So stop using ll_rw_block(), switch to sync helper instead. Link: https://lkml.kernel.org/r/20220901133505.2510834-6-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 86a020cc7232c3defad370852415876bbe4576dc Author: Zhang Yi Date: Thu Sep 1 21:34:55 2022 +0800 gfs2: replace ll_rw_block() ll_rw_block() is not safe for the sync read path because it cannot guarantee that always submitting read IO if the buffer has been locked, so stop using it. We also switch to new bh_readahead() helper for the readahead path. Link: https://lkml.kernel.org/r/20220901133505.2510834-5-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit e7ea1129afab0e63af2c2d0e6e9fb7651f0982b3 Author: Zhang Yi Date: Thu Sep 1 21:34:54 2022 +0800 fs/buffer: replace ll_rw_block() ll_rw_block() is not safe for the sync IO path because it skip buffers which has been locked by others, it could lead to false positive EIO when submitting read IO. So stop using ll_rw_block(), switch to use new helpers which could guarantee buffer locked and submit IO if needed. Link: https://lkml.kernel.org/r/20220901133505.2510834-4-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit fdee117ee86479fd2644bcd9ac2b2469e55722d1 Author: Zhang Yi Date: Thu Sep 1 21:34:53 2022 +0800 fs/buffer: add some new buffer read helpers Current ll_rw_block() helper is fragile because it assumes that locked buffer means it's under IO which is submitted by some other who holds the lock, it skip buffer if it failed to get the lock, so it's only safe on the readahead path. Unfortunately, now that most filesystems still use this helper mistakenly on the sync metadata read path. There is no guarantee that the one who holds the buffer lock always submit IO (e.g. buffer_migrate_folio_norefs() after commit 88dbcbb3a484 ("blkdev: avoid migration stalls for blkdev pages"), it could lead to false positive -EIO when submitting reading IO. This patch add some friendly buffer read helpers to prepare replacing ll_rw_block() and similar calls. We can only call bh_readahead_[] helpers for the readahead paths. Link: https://lkml.kernel.org/r/20220901133505.2510834-3-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 214f8796907b8015b778badf4710a4701472779a Author: Zhang Yi Date: Thu Sep 1 21:34:52 2022 +0800 fs/buffer: remove __breadahead_gfp() Patch series "fs/buffer: remove ll_rw_block()", v2. ll_rw_block() will skip locked buffer before submitting IO, it assumes that locked buffer means it is under IO. This assumption is not always true because we cannot guarantee every buffer lock path would submit IO. After commit 88dbcbb3a484 ("blkdev: avoid migration stalls for blkdev pages"), buffer_migrate_folio_norefs() becomes one exceptional case, and there may be others. So ll_rw_block() is not safe on the sync read path, we could get false positive EIO return value when filesystem reading metadata. It seems that it could be only used on the readahead path. Unfortunately, many filesystem misuse the ll_rw_block() on the sync read path. This patch set just remove ll_rw_block() and add new friendly helpers, which could prevent false positive EIO on the read metadata path. Thanks for the suggestion from Jan, the original discussion is at [1]. patch 1: remove unused helpers in fs/buffer.c patch 2: add new bh_read_[*] helpers patch 3-11: remove all ll_rw_block() calls in filesystems patch 12-14: do some leftover cleanups. [1]. https://lore.kernel.org/linux-mm/20220825080146.2021641-1-chengzhihao1@huawei.com/ This patch (of 14): No one use __breadahead_gfp() and sb_breadahead_unmovable() any more, remove them. Link: https://lkml.kernel.org/r/20220901133505.2510834-1-yi.zhang@huawei.com Link: https://lkml.kernel.org/r/20220901133505.2510834-2-yi.zhang@huawei.com Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Cc: Alexander Viro Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Evgeniy Dushistov Cc: Heming Zhao Cc: Jens Axboe Cc: Konstantin Komarov Cc: Mark Fasheh Cc: Theodore Ts'o Cc: Yu Kuai Cc: Zhihao Cheng Signed-off-by: Andrew Morton commit bd1264c37c15a75a3164852740ad0c9529907d83 Author: Song Liu Date: Tue Aug 30 22:27:34 2022 -0700 mm/vmalloc: extend find_vmap_lowest_match_check with extra arguments find_vmap_lowest_match() is now able to handle different roots. With DEBUG_AUGMENT_LOWEST_MATCH_CHECK enabled as: : --- a/mm/vmalloc.c : +++ b/mm/vmalloc.c : @@ -713,7 +713,7 @@ EXPORT_SYMBOL(vmalloc_to_pfn); : /*** Global kva allocator ***/ : : -#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 0 : +#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 1 compilation failed as: mm/vmalloc.c: In function 'find_vmap_lowest_match_check': mm/vmalloc.c:1328:32: warning: passing argument 1 of 'find_vmap_lowest_match' makes pointer from integer without a cast [-Wint-conversion] 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false); | ^~~~ | | | long unsigned int mm/vmalloc.c:1236:40: note: expected 'struct rb_root *' but argument is of type 'long unsigned int' 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size, | ~~~~~~~~~~~~~~~~^~~~ mm/vmalloc.c:1328:9: error: too few arguments to function 'find_vmap_lowest_match' 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false); | ^~~~~~~~~~~~~~~~~~~~~~ mm/vmalloc.c:1236:1: note: declared here 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size, | ^~~~~~~~~~~~~~~~~~~~~~ Extend find_vmap_lowest_match_check() and find_vmap_lowest_linear_match() with extra arguments to fix this. Link: https://lkml.kernel.org/r/20220906060548.1127396-1-song@kernel.org Link: https://lkml.kernel.org/r/20220831052734.3423079-1-song@kernel.org Fixes: f9863be49312 ("mm/vmalloc: extend __alloc_vmap_area() with extra arguments") Signed-off-by: Song Liu Reviewed-by: Baoquan He Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton commit 0742e49026121371c7ce1f640628c68c7da175d6 Author: Alistair Popple Date: Tue Aug 30 12:01:38 2022 +1000 mm/migrate_device.c: fix a misleading and outdated comment Commit ab09243aa95a ("mm/migrate.c: remove MIGRATE_PFN_LOCKED") changed the way trylock_page() in migrate_vma_collect_pmd() works without updating the comment. Reword the comment to be less misleading and a better reflection of what happens. Link: https://lkml.kernel.org/r/20220830020138.497063-1-apopple@nvidia.com Fixes: ab09243aa95a ("mm/migrate.c: remove MIGRATE_PFN_LOCKED") Signed-off-by: Alistair Popple Reported-by: Peter Xu Acked-by: Peter Xu Signed-off-by: Andrew Morton commit 663d0cfd2e77aa3ed170df76d441c8f07efa3cf6 Author: zezuo Date: Wed Aug 31 01:34:04 2022 +0000 mm/page_alloc.c: delete a redundant parameter of rmqueue_pcplist The gfp_flags parameter is not used in rmqueue_pcplist, so directly delete this parameter. Link: https://lkml.kernel.org/r/20220831013404.3360714-1-zuoze1@huawei.com Signed-off-by: zezuo Cc: Kefeng Wang Signed-off-by: Andrew Morton commit 8eabc77c38d8b7345bc0b234b7d26695c29a0822 Author: Kaixu Xia Date: Mon Aug 29 17:46:06 2022 +0800 mm/damon: get the hotness from damon_hot_score() in damon_pageout_score() We can get the hotness value from damon_hot_score() directly in damon_pageout_score() function and improve the code readability. Link: https://lkml.kernel.org/r/1661766366-20998-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit bcd0dea5f4fb3d098b03ef3064fe6c8201d7c515 Author: Liu Shixin Date: Mon Aug 29 17:51:25 2022 +0800 mm/thp: remove redundant CONFIG_TRANSPARENT_HUGEPAGE Simplify code by removing redundant CONFIG_TRANSPARENT_HUGEPAGE judgment. No functional change. Link: https://lkml.kernel.org/r/20220829095125.3284567-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Cc: Kefeng Wang Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit a38c94ed59fc312b51a33d867444ce73c6805ff6 Author: Liu Shixin Date: Mon Aug 29 17:57:09 2022 +0800 mm/thp: simplify has_transparent_hugepage by using IS_BUILTIN Simplify code of has_transparent_hugepage define by using IS_BUILTIN. No functional change. Link: https://lkml.kernel.org/r/20220829095709.3287462-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Reviewed-by: David Hildenbrand Cc: Hugh Dickins Cc: Kefeng Wang Signed-off-by: Andrew Morton commit 95cd2522669243a1804ba8e9583ed10b3b4f51ef Author: Kaixu Xia Date: Sat Aug 27 17:02:51 2022 +0800 mm/damon/vaddr: remove comparison between mm and last_mm when checking region accesses The damon regions that belong to the same damon target have the same 'struct mm_struct *mm', so it's unnecessary to compare the mm and last_mm objects among the damon regions in one damon target when checking accesses. But the check is necessary when the target changed in '__damon_va_check_accesses()', so we can simplify the whole operation by using the bool 'same_target' to indicate whether the target changed. Link: https://lkml.kernel.org/r/1661590971-20893-3-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 09876ae73945ca69550ce2cbe0538de11997fd94 Author: Kaixu Xia Date: Sat Aug 27 17:02:50 2022 +0800 mm/damon: simplify the parameter passing for 'check_accesses' Patch series "mm/damon: Simplify the damon regions access check", v2. This patchset simplifies the operations when checking the damon regions accesses. This patch (of 2): The parameter 'struct damon_ctx *ctx' isn't used in the functions __damon_{p,v}a_check_access(), so we can remove it and simplify the parameter passing. Link: https://lkml.kernel.org/r/1661590971-20893-1-git-send-email-kaixuxia@tencent.com Link: https://lkml.kernel.org/r/1661590971-20893-2-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit b4a0215e11dcfe23a48c65c6d6c82c0c2c551a48 Author: Kefeng Wang Date: Sat Aug 27 19:19:59 2022 +0800 mm: fix null-ptr-deref in kswapd_is_running() kswapd_run/stop() will set pgdat->kswapd to NULL, which could race with kswapd_is_running() in kcompactd(), kswapd_run/stop() kcompactd() kswapd_is_running() pgdat->kswapd // error or nomal ptr verify pgdat->kswapd // load non-NULL pgdat->kswapd pgdat->kswapd = NULL task_is_running(pgdat->kswapd) // Null pointer derefence KASAN reports the null-ptr-deref shown below, vmscan: Failed to start kswapd on node 0 ... BUG: KASAN: null-ptr-deref in kcompactd+0x440/0x504 Read of size 8 at addr 0000000000000024 by task kcompactd0/37 CPU: 0 PID: 37 Comm: kcompactd0 Kdump: loaded Tainted: G OE 5.10.60 #1 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 Call trace: dump_backtrace+0x0/0x394 show_stack+0x34/0x4c dump_stack+0x158/0x1e4 __kasan_report+0x138/0x140 kasan_report+0x44/0xdc __asan_load8+0x94/0xd0 kcompactd+0x440/0x504 kthread+0x1a4/0x1f0 ret_from_fork+0x10/0x18 At present kswapd/kcompactd_run() and kswapd/kcompactd_stop() are protected by mem_hotplug_begin/done(), but without kcompactd(). There is no need to involve memory hotplug lock in kcompactd(), so let's add a new mutex to protect pgdat->kswapd accesses. Also, because the kcompactd task will check the state of kswapd task, it's better to call kcompactd_stop() before kswapd_stop() to reduce lock conflicts. [akpm@linux-foundation.org: add comments] Link: https://lkml.kernel.org/r/20220827111959.186838-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Muchun Song Signed-off-by: Andrew Morton commit 639118d1571f70b1157b4bb5ac574b0ab0f38099 Author: Kefeng Wang Date: Sat Aug 27 19:20:43 2022 +0800 mm: kill is_memblock_offlined() Directly check state of struct memory_block, no need a single function. Link: https://lkml.kernel.org/r/20220827112043.187028-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton commit 48658d8509d2db3391c95aa74308a2b1fc8e8461 Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:23 2022 -0700 filemap: remove find_get_pages_contig() All callers of find_get_pages_contig() have been removed, so it is no longer needed. Link: https://lkml.kernel.org/r/20220824004023.77310-8-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 60aac486daa48d9caa9370d480d890f2a1f71742 Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:22 2022 -0700 ramfs: convert ramfs_nommu_get_unmapped_area() to use filemap_get_folios_contig() Convert to use folios throughout. This is in preparation for the removal for find_get_pages_contig(). Now also supports large folios. The initial version of this function set the page_address to be returned after finishing all the checks. Since folio_batches have a maximum of 15 folios, the function had to be modified to support getting and checking up to lpages, 15 pages at a time while still returning the initial page address. Now the function sets ret as soon as the first batch arrives, and updates it only if a check fails. The physical adjacency check utilizes the page frame numbers. The page frame number of each folio must be nr_pages away from the first folio. Link: https://lkml.kernel.org/r/20220824004023.77310-7-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 24a1efb4a91283c853a31fa4775d5c10c09129a4 Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:21 2022 -0700 nilfs2: convert nilfs_find_uncommited_extent() to use filemap_get_folios_contig() Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_contig(). Now also supports large folios. Also clean up an unnecessary if statement - pvec.pages[0]->index > index will always evaluate to false, and filemap_get_folios_contig() returns 0 if there is no folio found at index. Link: https://lkml.kernel.org/r/20220824004023.77310-6-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 47d55419951312d723de1b6ad53ee92948b8eace Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:20 2022 -0700 btrfs: convert process_page_range() to use filemap_get_folios_contig() Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_contig(). Now also supports large folios. Since we may receive more than nr_pages pages, nr_pages may underflow. Since nr_pages > 0 is equivalent to index <= end_index, we replaced it with this check instead. Also minor comment renaming for consistency in subpage. Link: https://lkml.kernel.org/r/20220824004023.77310-5-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit a75b81c3f63b3f467d5f54942c661bb79fe07505 Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:19 2022 -0700 btrfs: convert end_compressed_writeback() to use filemap_get_folios() Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_contig(). Now also supports large folios. Since we may receive more than nr_pages pages, nr_pages may underflow. Since nr_pages > 0 is equivalent to index <= end_index, we replaced it with this check instead. Also this function does not care about the pages being contiguous so we can just use filemap_get_folios() to be more efficient. Link: https://lkml.kernel.org/r/20220824004023.77310-4-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 04c6b79ae4f0bcbd96afd7cea5e1a8848162438e Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:18 2022 -0700 btrfs: convert __process_pages_contig() to use filemap_get_folios_contig() Convert to use folios throughout. This is in preparation for the removal of find_get_pages_contig(). Now also supports large folios. Since we may receive more than nr_pages pages, nr_pages may underflow. Since nr_pages > 0 is equivalent to index <= end_index, we replaced it with this check instead. Link: https://lkml.kernel.org/r/20220824004023.77310-3-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba Cc: Al Viro Cc: Chris Mason Cc: David Sterba Cc: Josef Bacik Cc: Matthew Wilcox Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 35b471467f88b8d8b52ba5b006a29b9d057d09bf Author: Vishal Moola (Oracle) Date: Tue Aug 23 17:40:17 2022 -0700 filemap: add filemap_get_folios_contig() Patch series "Convert to filemap_get_folios_contig()", v3. This patch series replaces find_get_pages_contig() with filemap_get_folios_contig(). This patch (of 7): This function is meant to replace find_get_pages_contig(). Unlike find_get_pages_contig(), filemap_get_folios_contig() no longer takes in a target number of pages to find - It returns up to 15 contiguous folios. To be more consistent with filemap_get_folios(), filemap_get_folios_contig() now also updates the start index passed in, and takes an end index. Link: https://lkml.kernel.org/r/20220824004023.77310-1-vishal.moola@gmail.com Link: https://lkml.kernel.org/r/20220824004023.77310-2-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: Ryusuke Konishi Cc: Al Viro Cc: Matthew Wilcox Cc: David Sterba Signed-off-by: Andrew Morton commit 641608f36244eb01028c2b30a961c7242144d96a Author: Alexey Romanov Date: Wed Aug 24 14:31:17 2022 +0300 zram: don't retry compress incompressible page It doesn't make sense for us to retry to compress an uncompressible page (comp_len == PAGE_SIZE) in zsmalloc slowpath, because we will be storing it uncompressed anyway. We can avoid wasting time on another compression attempt. It is enough to take lock (zcomp_stream_get) and execute the code below. Link: https://lkml.kernel.org/r/20220824113117.78849-1-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Signed-off-by: Dmitry Rokosov Reviewed-by: Sergey Senozhatsky Cc: Alexey Romanov Cc: Dmitry Rokosov Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 3083da7bcf56a4922b996ea3551847488a43a8b6 Author: ye xingchen Date: Fri Aug 26 07:19:06 2022 +0000 mm: backing-dev: Remove the unneeded result variable Return the value cgwb_bdi_init() directly instead of storing it in another redundant variable. Link: https://lkml.kernel.org/r/20220826071906.252419-1-ye.xingchen@zte.com.cn Signed-off-by: ye xingchen Reported-by: Zeal Robot Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit c4f20f1479c456d9dd1c1e6d8bf956a25de742dc Author: Li Zhe Date: Thu Aug 25 18:27:14 2022 +0800 page_ext: introduce boot parameter 'early_page_ext' In commit 2f1ee0913ce5 ("Revert "mm: use early_pfn_to_nid in page_ext_init""), we call page_ext_init() after page_alloc_init_late() to avoid some panic problem. It seems that we cannot track early page allocations in current kernel even if page structure has been initialized early. This patch introduces a new boot parameter 'early_page_ext' to resolve this problem. If we pass it to the kernel, page_ext_init() will be moved up and the feature 'deferred initialization of struct pages' will be disabled to initialize the page allocator early and prevent the panic problem above. It can help us to catch early page allocations. This is useful especially when we find that the free memory value is not the same right after different kernel booting. [akpm@linux-foundation.org: fix section issue by removing __meminitdata] Link: https://lkml.kernel.org/r/20220825102714.669-1-lizhe.67@bytedance.com Signed-off-by: Li Zhe Suggested-by: Michal Hocko Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Jason A. Donenfeld Cc: Jonathan Corbet Cc: Kees Cook Cc: Mark-PK Tsai Cc: Masami Hiramatsu (Google) Cc: Steven Rostedt Signed-off-by: Andrew Morton commit 1a6baaa0db733c0dca2e170ca1df2b09834f47ce Author: Gerald Schaefer Date: Sun Sep 11 20:26:01 2022 -0700 s390/hugetlb: switch to generic version of follow_huge_pud() When pud-sized hugepages were introduced for s390, the generic version of follow_huge_pud() was using pte_page() instead of pud_page(). This would be wrong for s390, see also commit 97534127012f ("mm/hugetlb: use pmd_page() in follow_huge_pmd()"). Therefore, and probably because not all archs were supporting pud_page() at that time, a private version of follow_huge_pud() was added for s390, correctly using pud_page(). Since commit 3a194f3f8ad01 ("mm/hugetlb: make pud_huge() and follow_huge_pud() aware of non-present pud entry"), the generic version of follow_huge_pud() is now also using pud_page(), and in general behaves similar to follow_huge_pmd(). Therefore we can now switch to the generic version and get rid of the s390-specific follow_huge_pud(). Link: https://lkml.kernel.org/r/20220818135717.609eef8a@thinkpad Signed-off-by: Gerald Schaefer Cc: Haiyue Wang Cc: Miaohe Lin Cc: "Huang, Ying" Cc: Baolin Wang Cc: David Hildenbrand Cc: Muchun Song Signed-off-by: Andrew Morton commit 1813e51eece0ad6f4aacaeb738e7cced46feb470 Author: Shakeel Butt Date: Thu Aug 25 00:05:06 2022 +0000 memcg: increase MEMCG_CHARGE_BATCH to 64 For several years, MEMCG_CHARGE_BATCH was kept at 32 but with bigger machines and the network intensive workloads requiring througput in Gbps, 32 is too small and makes the memcg charging path a bottleneck. For now, increase it to 64 for easy acceptance to 6.0. We will need to revisit this in future for ever increasing demand of higher performance. Please note that the memcg charge path drain the per-cpu memcg charge stock, so there should not be any oom behavior change. Though it does have impact on rstat flushing and high limit reclaim backoff. To evaluate the impact of this optimization, on a 72 CPUs machine, we ran the following workload in a three level of cgroup hierarchy. $ netserver -6 # 36 instances of netperf with following params $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K Results (average throughput of netperf): Without (6.0-rc1) 10482.7 Mbps With patch 17064.7 Mbps (62.7% improvement) With the patch, the throughput improved by 62.7%. Link: https://lkml.kernel.org/r/20220825000506.239406-4-shakeelb@google.com Signed-off-by: Shakeel Butt Reported-by: kernel test robot Acked-by: Soheil Hassas Yeganeh Reviewed-by: Feng Tang Acked-by: Roman Gushchin Acked-by: Muchun Song Acked-by: Michal Hocko Cc: Eric Dumazet Cc: Johannes Weiner Cc: "Michal Koutný" Signed-off-by: Andrew Morton commit 408587baee39753304dd572dacf374f75545d25a Author: Shakeel Butt Date: Thu Aug 25 00:05:05 2022 +0000 mm: page_counter: rearrange struct page_counter fields With memcg v2 enabled, memcg->memory.usage is a very hot member for the workloads doing memcg charging on multiple CPUs concurrently. Particularly the network intensive workloads. In addition, there is a false cache sharing between memory.usage and memory.high on the charge path. This patch moves the usage into a separate cacheline and move all the read most fields into separate cacheline. To evaluate the impact of this optimization, on a 72 CPUs machine, we ran the following workload in a three level of cgroup hierarchy. $ netserver -6 # 36 instances of netperf with following params $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K Results (average throughput of netperf): Without (6.0-rc1) 10482.7 Mbps With patch 12413.7 Mbps (18.4% improvement) With the patch, the throughput improved by 18.4%. One side-effect of this patch is the increase in the size of struct mem_cgroup. For example with this patch on 64 bit build, the size of struct mem_cgroup increased from 4032 bytes to 4416 bytes. However for the performance improvement, this additional size is worth it. In addition there are opportunities to reduce the size of struct mem_cgroup like deprecation of kmem and tcpmem page counters and better packing. Link: https://lkml.kernel.org/r/20220825000506.239406-3-shakeelb@google.com Signed-off-by: Shakeel Butt Reported-by: kernel test robot Reviewed-by: Feng Tang Acked-by: Soheil Hassas Yeganeh Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Eric Dumazet Cc: Johannes Weiner Cc: "Michal Koutný" Cc: Muchun Song Signed-off-by: Andrew Morton commit cfdab60bfa66b2dc0391c9e405b8af6039924cd4 Author: Shakeel Butt Date: Thu Aug 25 00:05:04 2022 +0000 mm: page_counter: remove unneeded atomic ops for low/min Patch series "memcg: optimize charge codepath", v2. Recently Linux networking stack has moved from a very old per socket pre-charge caching to per-cpu caching to avoid pre-charge fragmentation and unwarranted OOMs. One impact of this change is that for network traffic workloads, memcg charging codepath can become a bottleneck. The kernel test robot has also reported this regression[1]. This patch series tries to improve the memcg charging for such workloads. This patch series implement three optimizations: (A) Reduce atomic ops in page counter update path. (B) Change layout of struct page_counter to eliminate false sharing between usage and high. (C) Increase the memcg charge batch to 64. To evaluate the impact of these optimizations, on a 72 CPUs machine, we ran the following workload in root memcg and then compared with scenario where the workload is run in a three level of cgroup hierarchy with top level having min and low setup appropriately. $ netserver -6 # 36 instances of netperf with following params $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K Results (average throughput of netperf): 1. root memcg 21694.8 Mbps 2. 6.0-rc1 10482.7 Mbps (-51.6%) 3. 6.0-rc1 + (A) 14542.5 Mbps (-32.9%) 4. 6.0-rc1 + (B) 12413.7 Mbps (-42.7%) 5. 6.0-rc1 + (C) 17063.7 Mbps (-21.3%) 6. 6.0-rc1 + (A+B+C) 20120.3 Mbps (-7.2%) With all three optimizations, the memcg overhead of this workload has been reduced from 51.6% to just 7.2%. [1] https://lore.kernel.org/linux-mm/20220619150456.GB34471@xsang-OptiPlex-9020/ This patch (of 3): For cgroups using low or min protections, the function propagate_protected_usage() was doing an atomic xchg() operation irrespectively. We can optimize out this atomic operation for one specific scenario where the workload is using the protection (i.e. min > 0) and the usage is above the protection (i.e. usage > min). This scenario is actually very common where the users want a part of their workload to be protected against the external reclaim. Though this optimization does introduce a race when the usage is around the protection and concurrent charges and uncharged trip it over or under the protection. In such cases, we might see lower effective protection but the subsequent charge/uncharge will correct it. To evaluate the impact of this optimization, on a 72 CPUs machine, we ran the following workload in a three level of cgroup hierarchy with top level having min and low setup appropriately to see if this optimization is effective for the mentioned case. $ netserver -6 # 36 instances of netperf with following params $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K Results (average throughput of netperf): Without (6.0-rc1) 10482.7 Mbps With patch 14542.5 Mbps (38.7% improvement) With the patch, the throughput improved by 38.7% Link: https://lkml.kernel.org/r/20220825000506.239406-1-shakeelb@google.com Link: https://lkml.kernel.org/r/20220825000506.239406-2-shakeelb@google.com Signed-off-by: Shakeel Butt Reported-by: kernel test robot Acked-by: Soheil Hassas Yeganeh Reviewed-by: Feng Tang Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Eric Dumazet Cc: Johannes Weiner Cc: "Michal Koutný" Cc: Muchun Song Cc: Oliver Sang Cc: Soheil Hassas Yeganeh Signed-off-by: Andrew Morton commit fcab9b441d2d0e08f55654a4adf2d51cd4680469 Author: David Heidelberg Date: Tue Aug 23 17:20:33 2022 +0200 mm: remove EXPERIMENTAL flag for zswap zswap has been with us since 2013, and it's widely used in many products. Link: https://lkml.kernel.org/r/20220823152033.66682-1-david@ixit.cz Signed-off-by: David Heidelberg Cc: Dan Carpenter Cc: Vitaly Wool Cc: Dan Streetman Cc: Barry Song Cc: Seth Jennings Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton commit 6d2453c3dbc5f70eafc1c866289a90a1fc57ce18 Author: Sergey Senozhatsky Date: Wed Aug 24 12:51:00 2022 +0900 drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset We do all reset operations under write lock, so we don't need to save ->disksize and ->comp to stack variables. Another thing is that ->comp is freed during zram reset, but comp pointer is not NULL-ed, so zram keeps the freed pointer value. Link: https://lkml.kernel.org/r/20220824035100.971816-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 67e139b02d99496c03bf3b51abad685ab3b49138 Author: Alistair Popple Date: Wed Aug 24 15:09:52 2022 +1000 mm/gup.c: refactor check_and_migrate_movable_pages() When pinning pages with FOLL_LONGTERM check_and_migrate_movable_pages() is called to migrate pages out of zones which should not contain any longterm pinned pages. When migration succeeds all pages will have been unpinned so pinning needs to be retried. Migration can also fail, in which case the pages will also have been unpinned but the operation should not be retried. If all pages are in the correct zone nothing will be unpinned and no retry is required. The logic in check_and_migrate_movable_pages() tracks unnecessary state and the return codes for each case are difficult to follow. Refactor the code to clean this up. No behaviour change is intended. [akpm@linux-foundation.org: fix unused var warning] Link: https://lkml.kernel.org/r/19583d1df07fdcb99cfa05c265588a3fa58d1902.1661317396.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Reviewed-by: John Hubbard Cc: Alex Sierra Cc: Dan Williams Cc: David Hildenbrand Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Logan Gunthorpe Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Muchun Song Cc: Ralph Campbell Cc: Shigeru Yoshida Signed-off-by: Andrew Morton commit f6d299ec39d8ebb62fc047022d4904575c99a28c Author: Alistair Popple Date: Wed Aug 24 15:09:51 2022 +1000 mm/gup.c: don't pass gup_flags to check_and_migrate_movable_pages() gup_flags is passed to check_and_migrate_movable_pages() so that it can call either put_page() or unpin_user_page() to drop the page reference. However check_and_migrate_movable_pages() is only called for FOLL_LONGTERM, which implies FOLL_PIN so there is no need to pass gup_flags. Link: https://lkml.kernel.org/r/d611c65a9008ff55887307df457c6c2220ad6163.1661317396.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple Reviewed-by: David Hildenbrand Reviewed-by: John Hubbard Cc: Alex Sierra Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Logan Gunthorpe Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Muchun Song Cc: Ralph Campbell Cc: Shigeru Yoshida Signed-off-by: Andrew Morton commit 32d772708009eb90f8eeed6ec8f76e06f07e41e9 Author: Bui Quang Minh Date: Sun Aug 21 22:40:55 2022 +0700 mm: skip retry when new limit is not below old one in page_counter_set_max In page_counter_set_max, we want to make sure the new limit is not below the concurrently-changing counter value. We read the counter and check that the limit is not below the counter before the swap. After the swap, we read the counter again and retry in case the counter is incremented as this may violate the requirement. Even though the page_counter_try_charge can see the old limit, it is guaranteed that the counter is not above the old limit after the increment. So in case the new limit is not below the old limit, the counter is guaranteed to be not above the new limit too. We can skip the retry in this case to optimize a little bit. Link: https://lkml.kernel.org/r/20220821154055.109635-1-minhquangbui99@gmail.com Signed-off-by: Bui Quang Minh Signed-off-by: Andrew Morton commit 8bd3873d1bff1d7b761949deaccc3b527bffa1e3 Author: Rolf Eike Beer Date: Mon Aug 22 15:02:36 2022 +0200 mm: pagewalk: add api documentation for walk_page_range_novma() Link: https://lkml.kernel.org/r/8991525.CDJkKcVGEf@devpool047 Signed-off-by: Rolf Eike Beer Signed-off-by: Andrew Morton commit e2f8f44b7686bf65747f485ac7c9c43de8b8de09 Author: Rolf Eike Beer Date: Mon Aug 22 15:01:32 2022 +0200 mm: pagewalk: fix documentation of PTE hole handling Empty PTEs are passed to the pte_entry callback, not to pte_hole. Link: https://lkml.kernel.org/r/3695521.kQq0lBPeGt@devpool047 Signed-off-by: Rolf Eike Beer Signed-off-by: Andrew Morton commit e09b0b61fbbf28e0f528ca17af5c3e445109f147 Author: Yang Shi Date: Tue Aug 16 11:58:01 2022 -0700 mm: memcg: export workingset refault stats for cgroup v1 Workingset refault stats are important and useful metrics to measure how well reclaimer and swapping work and how healthy the services are, but they are just available for cgroup v2. There are still plenty users with cgroup v1, export the stats for cgroup v1. Link: https://lkml.kernel.org/r/20220816185801.651091-1-shy828301@gmail.com Signed-off-by: Yang Shi Acked-by: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 8f0efa81dfbc6abf86bf410549e61a2636753c86 Author: Kassey Li Date: Thu Aug 18 10:24:25 2022 +0800 mm/page_owner.c: add llseek for page_owner It is too slow to dump all the pages, in some usage we just want to dump a given start pfn, for example: a CMA range or a single page. To speed up and save time, this change allows specifying of a start pfn by adding llseek for page_owner. Link: https://lkml.kernel.org/r/20220818022425.31056-1-quic_yingangl@quicinc.com Signed-off-by: Kassey Li Suggested-by: Vlastimil Babka Acked-by: Vlastimil Babka Cc: Joonsoo Kim Cc: Minchan Kim Signed-off-by: Andrew Morton commit 72c33ef4c02e32e2884e7688ec878a486913fe9c Author: Baolin Wang Date: Thu Aug 18 15:37:44 2022 +0800 mm/damon: replace pmd_huge() with pmd_trans_huge() for THP pmd_huge() is usually used to indicate a pmd level hugetlb. However a pmd mapped huge page can only be THP in damon_mkold_pmd_entry() or damon_young_pmd_entry(), so replace pmd_huge() with pmd_trans_huge() in this case to make the code more readable according to the discussion [1]. [1] https://lore.kernel.org/all/098c1480-416d-bca9-cedb-ca495df69b64@linux.alibaba.com/ Link: https://lkml.kernel.org/r/a9e010ca5d299e18d740c7c52290ecb6a014dde6.1660805030.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: SeongJae Park Cc: Mike Kravetz Signed-off-by: Andrew Morton commit c8b9aff419303e4d4219b5ff64b1c7e062dee48e Author: Baolin Wang Date: Thu Aug 18 15:37:43 2022 +0800 mm/damon: validate if the pmd entry is present before accessing pmd_huge() is used to validate if the pmd entry is mapped by a huge page, also including the case of non-present (migration or hwpoisoned) pmd entry on arm64 or x86 architectures. This means that pmd_pfn() can not get the correct pfn number for a non-present pmd entry, which will cause damon_get_page() to get an incorrect page struct (also may be NULL by pfn_to_online_page()), making the access statistics incorrect. This means that the DAMON may make incorrect decision according to the incorrect statistics, for example, DAMON may can not reclaim cold page in time due to this cold page was regarded as accessed mistakenly if DAMOS_PAGEOUT operation is specified. Moreover it does not make sense that we still waste time to get the page of the non-present entry. Just treat it as not-accessed and skip it, which maintains consistency with non-present pte level entries. So add pmd entry present validation to fix the above issues. Link: https://lkml.kernel.org/r/58b1d1f5fbda7db49ca886d9ef6783e3dcbbbc98.1660805030.git.baolin.wang@linux.alibaba.com Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces") Signed-off-by: Baolin Wang Reviewed-by: SeongJae Park Reviewed-by: Muchun Song Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton commit 6a3edd29395631a010d6760792824a44986e57fe Author: Yin Fengwei Date: Wed Aug 10 14:49:07 2022 +0800 mm: release private data before split THP If there is private data attached to a THP, the refcount of THP will be increased and will prevent the THP from being split. Attempt to release any private data attached to the THP before attempting the split to increase the chance of splitting successfully. There was a memory failure issue hit during HW error injection testing with 5.18 kernel + xfs as rootfs. The test was killed and a system reboot was required to re-run the test. The issue was tracked down to a THP split failure caused by the memory failure not being handled. The page dump showed: [ 1785.433075] page:0000000025f9530b refcount:18 mapcount:0 mapping:000000008162eea7 index:0xa10 pfn:0x2f0200 [ 1785.443954] head:0000000025f9530b order:4 compound_mapcount:0 compound_pincount:0 [ 1785.452408] memcg:ff4247f2d28e9000 [ 1785.456304] aops:xfs_address_space_operations ino:8555182 dentry name:"baseos-filenames.solvx" [ 1785.466612] flags: 0x1000000000012036(referenced|uptodate|lru|active|private|head|node=0|zone=2) [ 1785.476514] raw: 1000000000012036 ffb9460f8bc07c08 ffb9460f8bc08408 ff4247f22e6299f8 [ 1785.485268] raw: 0000000000000a10 ff4247f194ade900 00000012ffffffff ff4247f2d28e9000 It was like the error was injected to a large folio for xfs with private data attached. With private data released before splitting the THP, the test case could be run successfully many times without rebooting the system. Link: https://lkml.kernel.org/r/20220810064907.582899-1-fengwei.yin@intel.com Co-developed-by: Qiuxu Zhuo Signed-off-by: Qiuxu Zhuo Signed-off-by: Yin Fengwei Suggested-by: Matthew Wilcox Reviewed-by: Yang Shi Reviewed-by: Miaohe Lin Reviewed-by: Aaron Lu Signed-off-by: Andrew Morton commit c8bb41631bc2ecc6434e93232c031c7a218ebe81 Author: Qi Zheng Date: Thu Aug 18 16:27:48 2022 +0800 mm: thp: remove redundant pgtable check in set_huge_zero_page() When the pgtable is NULL in the set_huge_zero_page(), we should not increment the count of PTE page table pages by calling mm_inc_nr_ptes(). Otherwise we may receive the following warning when the mm exits: BUG: non-zero pgtables_bytes on freeing mm Now we can't observe the above warning since only do_huge_pmd_anonymous_page() invokes set_huge_zero_page() and the pgtable can not be NULL. Therefore, instead of moving mm_inc_nr_ptes() to the non-NULL branch of pgtable, it is better to remove the redundant pgtable check directly. Link: https://lkml.kernel.org/r/20220818082748.40021-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 48309e1f6f7b15b041b39b7f15e7adc1c7e2de95 Author: Kefeng Wang Date: Fri Aug 19 11:34:02 2022 +0800 mm: memory-failure: kill __soft_offline_page() Squash the __soft_offline_page() into soft_offline_in_use_page() and kill __soft_offline_page(). [wangkefeng.wang@huawei.com: update hpage when try_to_split_thp_page() succeeds] Link: https://lkml.kernel.org/r/20220830104654.28234-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20220819033402.156519-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Miaohe Lin Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton commit 7adb45887c8af88985c335b53d253654e9d2dd16 Author: Kefeng Wang Date: Fri Aug 19 11:34:01 2022 +0800 mm: memory-failure: kill soft_offline_free_page() Open-code the page_handle_poison() into soft_offline_page() and kill unneeded soft_offline_free_page(). Link: https://lkml.kernel.org/r/20220819033402.156519-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 33febb519d673b9f574903764f13f47e65328ca5 Author: Muchun Song Date: Fri Aug 19 11:55:32 2022 +0800 mm: hugetlb_vmemmap: simplify reset_struct_pages() We can choose to copy three contiguous tail pages' content to the first three pages instead of copying one by one to simplify the code and reduce code size from 229 bytes to 63 bytes. The BUILD_BUG_ON() aims to avoid out-of-bounds accesses. Link: https://lkml.kernel.org/r/20220819035532.6189-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Miaohe Lin Cc: Mike Kravetz Signed-off-by: Andrew Morton commit e9ff3ba7ff10490a92792faf1d3573a24fc6e5c9 Author: Miaohe Lin Date: Thu Aug 18 21:00:16 2022 +0800 mm, hwpoison: avoid trying to unpoison reserved page For reserved pages, HWPoison flag will be set without increasing the page refcnt. So we shouldn't even try to unpoison these pages and thus decrease the page refcnt unexpectly. Add a PageReserved() check to filter this case out and remove the below unneeded zero page (zero page is reserved) check. Link: https://lkml.kernel.org/r/20220818130016.45313-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Cc: "Aneesh Kumar K.V" Signed-off-by: Andrew Morton commit 0792a4a6195a6d67a4ead2554da393cbd8dcdf5a Author: Miaohe Lin Date: Thu Aug 18 21:00:15 2022 +0800 mm, hwpoison: kill procs if unmap fails If try_to_unmap() fails, the hwpoisoned page still resides in the address space of some processes. We should kill these processes or the hwpoisoned page might be consumed later. collect_procs() is always called to collect relevant processes now so they can be killed later if unmap fails. [linmiaohe@huawei.com: v2] Link: https://lkml.kernel.org/r/20220823032346.4260-6-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220818130016.45313-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 54f9555d4031d4aeb10651aa9dcb5335f6a05865 Author: Miaohe Lin Date: Tue Aug 23 11:23:44 2022 +0800 mm, hwpoison: fix possible use-after-free in mf_dax_kill_procs() After kill_procs(), tk will be freed without being removed from the to_kill list. In the next iteration, the freed list entry in the to_kill list will be accessed, thus leading to use-after-free issue. Adding list_del() in kill_procs() to fix the issue. Link: https://lkml.kernel.org/r/20220823032346.4260-5-linmiaohe@huawei.com Fixes: c36e20249571 ("mm: introduce mf_dax_kill_procs() for fsdax case") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 12f1dbcf8f144c0b8dde7a62fea766f88cb79fc8 Author: Miaohe Lin Date: Thu Aug 18 21:00:13 2022 +0800 mm, hwpoison: fix extra put_page() in soft_offline_page() When hwpoison_filter() refuses to soft offline a page, the page refcnt incremented previously by MF_COUNT_INCREASED would have been consumed via get_hwpoison_page() if ret <= 0. So the put_ref_page() here will put the extra one. Remove it to fix the issue. Link: https://lkml.kernel.org/r/20220818130016.45313-4-linmiaohe@huawei.com Fixes: 9113eaf331bf ("mm/memory-failure.c: add hwpoison_filter for soft offline") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 6bbabd041dfd4823c752940286656d404621bf38 Author: Miaohe Lin Date: Thu Aug 18 21:00:12 2022 +0800 mm, hwpoison: fix page refcnt leaking in unpoison_memory() When free_raw_hwp_pages() fails its work, the refcnt of the hugetlb page would have been incremented if ret > 0. Using put_page() to fix refcnt leaking in this case. Link: https://lkml.kernel.org/r/20220818130016.45313-3-linmiaohe@huawei.com Fixes: debb6b9c3fdd ("mm, hwpoison: make unpoison aware of raw error info in hwpoisoned hugepage") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit f36a5543a74883c21a59b8082b403a13c7654769 Author: Miaohe Lin Date: Thu Aug 18 21:00:11 2022 +0800 mm, hwpoison: fix page refcnt leaking in try_memory_failure_hugetlb() Patch series "A few fixup patches for memory-failure", v2. This series contains a few fixup patches to fix incorrect update of page refcnt, fix possible use-after-free issue and so on. More details can be found in the respective changelogs. This patch (of 6): When hwpoison_filter() refuses to hwpoison a hugetlb page, the refcnt of the page would have been incremented if res == 1. Using put_page() to fix the refcnt leaking in this case. Link: https://lkml.kernel.org/r/20220823032346.4260-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220818130016.45313-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220818130016.45313-2-linmiaohe@huawei.com Fixes: 405ce051236c ("mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb()") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit b1d5488a252dc9c0d9574100d0b8d807bf154603 Author: Charan Teja Kalla Date: Thu Aug 18 19:20:00 2022 +0530 mm: fix use-after free of page_ext after race with memory-offline The below is one path where race between page_ext and offline of the respective memory blocks will cause use-after-free on the access of page_ext structure. process1 process2 --------- --------- a)doing /proc/page_owner doing memory offline through offline_pages. b) PageBuddy check is failed thus proceed to get the page_owner information through page_ext access. page_ext = lookup_page_ext(page); migrate_pages(); ................. Since all pages are successfully migrated as part of the offline operation,send MEM_OFFLINE notification where for page_ext it calls: offline_page_ext()--> __free_page_ext()--> free_page_ext()--> vfree(ms->page_ext) mem_section->page_ext = NULL c) Check for the PAGE_EXT flags in the page_ext->flags access results into the use-after-free (leading to the translation faults). As mentioned above, there is really no synchronization between page_ext access and its freeing in the memory_offline. The memory offline steps(roughly) on a memory block is as below: 1) Isolate all the pages 2) while(1) try free the pages to buddy.(->free_list[MIGRATE_ISOLATE]) 3) delete the pages from this buddy list. 4) Then free page_ext.(Note: The struct page is still alive as it is freed only during hot remove of the memory which frees the memmap, which steps the user might not perform). This design leads to the state where struct page is alive but the struct page_ext is freed, where the later is ideally part of the former which just representing the page_flags (check [3] for why this design is chosen). The abovementioned race is just one example __but the problem persists in the other paths too involving page_ext->flags access(eg: page_is_idle())__. Fix all the paths where offline races with page_ext access by maintaining synchronization with rcu lock and is achieved in 3 steps: 1) Invalidate all the page_ext's of the sections of a memory block by storing a flag in the LSB of mem_section->page_ext. 2) Wait until all the existing readers to finish working with the ->page_ext's with synchronize_rcu(). Any parallel process that starts after this call will not get page_ext, through lookup_page_ext(), for the block parallel offline operation is being performed. 3) Now safely free all sections ->page_ext's of the block on which offline operation is being performed. Note: If synchronize_rcu() takes time then optimizations can be done in this path through call_rcu()[2]. Thanks to David Hildenbrand for his views/suggestions on the initial discussion[1] and Pavan kondeti for various inputs on this patch. [1] https://lore.kernel.org/linux-mm/59edde13-4167-8550-86f0-11fc67882107@quicinc.com/ [2] https://lore.kernel.org/all/a26ce299-aed1-b8ad-711e-a49e82bdd180@quicinc.com/T/#u [3] https://lore.kernel.org/all/6fa6b7aa-731e-891c-3efb-a03d6a700efa@redhat.com/ [quic_charante@quicinc.com: rename label `loop' to `ext_put_continue' per David] Link: https://lkml.kernel.org/r/1661496993-11473-1-git-send-email-quic_charante@quicinc.com Link: https://lkml.kernel.org/r/1660830600-9068-1-git-send-email-quic_charante@quicinc.com Signed-off-by: Charan Teja Kalla Suggested-by: David Hildenbrand Suggested-by: Michal Hocko Acked-by: Michal Hocko Acked-by: David Hildenbrand Cc: Fernand Sieber Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavan Kondeti Cc: SeongJae Park Cc: Shakeel Butt Cc: Vlastimil Babka Cc: William Kucharski Signed-off-by: Andrew Morton commit 08262ac50a7e4d70ee92b34746ea54a0ba51739a Author: Matthew Wilcox Date: Thu Aug 18 22:07:41 2022 +0100 mm/vmalloc.c: support HIGHMEM pages in vmap_pages_range_noflush() If the pages being mapped are in HIGHMEM, page_address() returns NULL. This probably wasn't noticed before because there aren't currently any architectures with HAVE_ARCH_HUGE_VMALLOC and HIGHMEM, but it's simpler to call page_to_phys() and futureproofs us against such configurations existing. Link: https://lkml.kernel.org/r/Yv6qHc6e+m7TMWhi@casper.infradead.org Fixes: 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Christoph Hellwig Cc: Uladzislau Rezki Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit b8dd3ee9cacc2398700e5227931988931871e020 Author: xupanda Date: Mon Aug 15 06:51:04 2022 +0000 mm: memcontrol: fix a typo in comment Fix a spelling mistake in comment. Link: https://lkml.kernel.org/r/20220815065102.74347-1-xu.panda@zte.com.cn Reported-by: Zeal Robot Signed-off-by: xupanda Signed-off-by: CGEL ZTE Reviewed-by: Mukesh Ojha Signed-off-by: Andrew Morton commit fb70c4878d6b3001ef40fa39432a38d8cabdcbf7 Author: Kefeng Wang Date: Mon Aug 15 19:10:17 2022 +0800 mm: kill find_min_pfn_with_active_regions() find_min_pfn_with_active_regions() is only called from free_area_init(). Open-code the PHYS_PFN(memblock_start_of_DRAM()) into free_area_init(), and kill find_min_pfn_with_active_regions(). Link: https://lkml.kernel.org/r/20220815111017.39341-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Signed-off-by: Andrew Morton commit 0192445cb2f7ed1cd7a95a0fc8c7645480baba25 Author: Zi Yan Date: Mon Aug 15 10:39:59 2022 -0400 arch: mm: rename FORCE_MAX_ZONEORDER to ARCH_FORCE_MAX_ORDER This Kconfig option is used by individual arch to set its desired MAX_ORDER. Rename it to reflect its actual use. Link: https://lkml.kernel.org/r/20220815143959.1511278-1-zi.yan@sent.com Acked-by: Mike Rapoport Signed-off-by: Zi Yan Acked-by: Guo Ren [csky] Acked-by: Arnd Bergmann Acked-by: Catalin Marinas [arm64] Acked-by: Huacai Chen [LoongArch] Acked-by: Michael Ellerman [powerpc] Cc: Vineet Gupta Cc: Taichi Sugaya Cc: Neil Armstrong Cc: Qin Jian Cc: Guo Ren Cc: Geert Uytterhoeven Cc: Thomas Bogendoerfer Cc: Dinh Nguyen Cc: Christophe Leroy Cc: Yoshinori Sato Cc: "David S. Miller" Cc: Chris Zankel Cc: Ley Foon Tan Signed-off-by: Andrew Morton commit 46e871529aa9b9311009897a18e5903e74611c1e Author: Alexey Romanov Date: Mon Aug 15 17:48:25 2022 +0300 zsmalloc: zs_object_copy: replace email link to doc Emails are not documentation. [akpm@linux-foundation.org: fix whitespace damage, repair doc reference] [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/20220815144825.39001-1-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 3aa4ed8040e1535d95c03cef8b52cf11bf0d8546 Author: Miaohe Lin Date: Tue Aug 16 21:05:53 2022 +0800 mm/hugetlb: make detecting shared pte more reliable If the pagetables are shared, we shouldn't copy or take references. Since src could have unshared and dst shares with another vma, huge_pte_none() is thus used to determine whether dst_pte is shared. But this check isn't reliable. A shared pte could have pte none in pagetable in fact. The page count of ptep page should be checked here in order to reliably determine whether pte is shared. [lukas.bulwahn@gmail.com: remove unused local variable dst_entry in copy_hugetlb_page_range()] Link: https://lkml.kernel.org/r/20220822082525.26071-1-lukas.bulwahn@gmail.com Link: https://lkml.kernel.org/r/20220816130553.31406-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Lukas Bulwahn Reviewed-by: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 01088a603660dfa240ba3331f0a49a3e9797cad1 Author: Miaohe Lin Date: Tue Aug 16 21:05:52 2022 +0800 mm/hugetlb: fix sysfs group leak in hugetlb_unregister_node() The sysfs group per_node_hstate_attr_group and hstate_demote_attr_group when h->demote_order != 0 are created in hugetlb_register_node(). But these sysfs groups are not removed when unregister the node, thus sysfs group is leaked. Using sysfs_remove_group() to fix this issue. Link: https://lkml.kernel.org/r/20220816130553.31406-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Fengwei Yin Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 939de63d35dde45dbc10bd21f174f86629fbe78d Author: Miaohe Lin Date: Tue Aug 16 21:05:51 2022 +0800 mm: hugetlb_vmemmap: add missing smp_wmb() before set_pte_at() The memory barrier smp_wmb() is needed to make sure that preceding stores to the page contents become visible before the below set_pte_at() write. Link: https://lkml.kernel.org/r/20220816130553.31406-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Yin Fengwei Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 3a5497a2dae381cb1b201fb20847fb32a059da25 Author: Miaohe Lin Date: Tue Aug 16 21:05:50 2022 +0800 mm/hugetlb: fix missing call to restore_reserve_on_error() When huge_add_to_page_cache() fails, the page is freed directly without calling restore_reserve_on_error() to restore reserve for newly allocated pages not in page cache. Fix this by calling restore_reserve_on_error() when huge_add_to_page_cache fails. [linmiaohe@huawei.com: remove err == -EEXIST check and retry logic] Link: https://lkml.kernel.org/r/20220823030209.57434-4-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220816130553.31406-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 3a6bdda0b58bab883da8dc3a0503e2a13b9d7456 Author: Miaohe Lin Date: Tue Aug 16 21:05:49 2022 +0800 mm/hugetlb: fix WARN_ON(!kobj) in sysfs_create_group() If sysfs_create_group() fails with hstate_attr_group, hstate_kobjs[hi] will be set to NULL. Then it will be passed to sysfs_create_group() if h->demote_order != 0 thus triggering WARN_ON(!kobj) check. Fix this by making sure hstate_kobjs[hi] != NULL when calling sysfs_create_group. Link: https://lkml.kernel.org/r/20220816130553.31406-3-linmiaohe@huawei.com Fixes: 79dfc695525f ("hugetlb: add demote hugetlb page sysfs interfaces") Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit a43a83c79b4fd36e297f97b7468be28fdf771d78 Author: Miaohe Lin Date: Tue Aug 16 21:05:48 2022 +0800 mm/hugetlb: fix incorrect update of max_huge_pages Patch series "A few fixup patches for hugetlb". This series contains a few fixup patches to fix incorrect update of max_huge_pages, fix WARN_ON(!kobj) in sysfs_create_group() and so on. More details can be found in the respective changelogs. This patch (of 6): There should be pages_per_huge_page(h) / pages_per_huge_page(target_hstate) pages incremented for target_hstate->max_huge_pages when page is demoted. Update max_huge_pages accordingly for consistency. Link: https://lkml.kernel.org/r/20220816130553.31406-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220816130553.31406-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton commit c959924b0dc53bf6252793f41480bc01b9792570 Author: Huang Ying Date: Wed Jul 13 16:39:53 2022 +0800 memory tiering: adjust hot threshold automatically The promotion hot threshold is workload and system configuration dependent. So in this patch, a method to adjust the hot threshold automatically is implemented. The basic idea is to control the number of the candidate promotion pages to match the promotion rate limit. If the hint page fault latency of a page is less than the hot threshold, we will try to promote the page, and the page is called the candidate promotion page. If the number of the candidate promotion pages in the statistics interval is much more than the promotion rate limit, the hot threshold will be decreased to reduce the number of the candidate promotion pages. Otherwise, the hot threshold will be increased to increase the number of the candidate promotion pages. To make the above method works, in each statistics interval, the total number of the pages to check (on which the hint page faults occur) and the hot/cold distribution need to be stable. Because the page tables are scanned linearly in NUMA balancing, but the hot/cold distribution isn't uniform along the address usually, the statistics interval should be larger than the NUMA balancing scan period. So in the patch, the max scan period is used as statistics interval and it works well in our tests. Link: https://lkml.kernel.org/r/20220713083954.34196-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Tested-by: Baolin Wang Cc: Dave Hansen Cc: Johannes Weiner Cc: Mel Gorman Cc: Michal Hocko Cc: osalvador Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Wei Xu Cc: Yang Shi Cc: Zhong Jiang Cc: Zi Yan Signed-off-by: Andrew Morton commit c6833e10008f976a173dd5abdf992e492cbc3bcf Author: Huang Ying Date: Wed Jul 13 16:39:52 2022 +0800 memory tiering: rate limit NUMA migration throughput In NUMA balancing memory tiering mode, if there are hot pages in slow memory node and cold pages in fast memory node, we need to promote/demote hot/cold pages between the fast and cold memory nodes. A choice is to promote/demote as fast as possible. But the CPU cycles and memory bandwidth consumed by the high promoting/demoting throughput will hurt the latency of some workload because of accessing inflating and slow memory bandwidth contention. A way to resolve this issue is to restrict the max promoting/demoting throughput. It will take longer to finish the promoting/demoting. But the workload latency will be better. This is implemented in this patch as the page promotion rate limit mechanism. The number of the candidate pages to be promoted to the fast memory node via NUMA balancing is counted, if the count exceeds the limit specified by the users, the NUMA balancing promotion will be stopped until the next second. A new sysctl knob kernel.numa_balancing_promote_rate_limit_MBps is added for the users to specify the limit. Link: https://lkml.kernel.org/r/20220713083954.34196-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Tested-by: Baolin Wang Cc: Dave Hansen Cc: Johannes Weiner Cc: Mel Gorman Cc: Michal Hocko Cc: osalvador Cc: Peter Zijlstra Cc: Rik van Riel Cc: Shakeel Butt Cc: Wei Xu Cc: Yang Shi Cc: Zhong Jiang Cc: Zi Yan Signed-off-by: Andrew Morton commit 33024536bafd9129f1d16ade0974671c648700ac Author: Huang Ying Date: Wed Jul 13 16:39:51 2022 +0800 memory tiering: hot page selection with hint page fault latency Patch series "memory tiering: hot page selection", v4. To optimize page placement in a memory tiering system with NUMA balancing, the hot pages in the slow memory nodes need to be identified. Essentially, the original NUMA balancing implementation selects the mostly recently accessed (MRU) pages to promote. But this isn't a perfect algorithm to identify the hot pages. Because the pages with quite low access frequency may be accessed eventually given the NUMA balancing page table scanning period could be quite long (e.g. 60 seconds). So in this patchset, we implement a new hot page identification algorithm based on the latency between NUMA balancing page table scanning and hint page fault. Which is a kind of mostly frequently accessed (MFU) algorithm. In NUMA balancing memory tiering mode, if there are hot pages in slow memory node and cold pages in fast memory node, we need to promote/demote hot/cold pages between the fast and cold memory nodes. A choice is to promote/demote as fast as possible. But the CPU cycles and memory bandwidth consumed by the high promoting/demoting throughput will hurt the latency of some workload because of accessing inflating and slow memory bandwidth contention. A way to resolve this issue is to restrict the max promoting/demoting throughput. It will take longer to finish the promoting/demoting. But the workload latency will be better. This is implemented in this patchset as the page promotion rate limit mechanism. The promotion hot threshold is workload and system configuration dependent. So in this patchset, a method to adjust the hot threshold automatically is implemented. The basic idea is to control the number of the candidate promotion pages to match the promotion rate limit. We used the pmbench memory accessing benchmark tested the patchset on a 2-socket server system with DRAM and PMEM installed. The test results are as follows, pmbench score promote rate (accesses/s) MB/s ------------- ------------ base 146887704.1 725.6 hot selection 165695601.2 544.0 rate limit 162814569.8 165.2 auto adjustment 170495294.0 136.9 From the results above, With hot page selection patch [1/3], the pmbench score increases about 12.8%, and promote rate (overhead) decreases about 25.0%, compared with base kernel. With rate limit patch [2/3], pmbench score decreases about 1.7%, and promote rate decreases about 69.6%, compared with hot page selection patch. With threshold auto adjustment patch [3/3], pmbench score increases about 4.7%, and promote rate decrease about 17.1%, compared with rate limit patch. Baolin helped to test the patchset with MySQL on a machine which contains 1 DRAM node (30G) and 1 PMEM node (126G). sysbench /usr/share/sysbench/oltp_read_write.lua \ ...... --tables=200 \ --table-size=1000000 \ --report-interval=10 \ --threads=16 \ --time=120 The tps can be improved about 5%. This patch (of 3): To optimize page placement in a memory tiering system with NUMA balancing, the hot pages in the slow memory node need to be identified. Essentially, the original NUMA balancing implementation selects the mostly recently accessed (MRU) pages to promote. But this isn't a perfect algorithm to identify the hot pages. Because the pages with quite low access frequency may be accessed eventually given the NUMA balancing page table scanning period could be quite long (e.g. 60 seconds). The most frequently accessed (MFU) algorithm is better. So, in this patch we implemented a better hot page selection algorithm. Which is based on NUMA balancing page table scanning and hint page fault as follows, - When the page tables of the processes are scanned to change PTE/PMD to be PROT_NONE, the current time is recorded in struct page as scan time. - When the page is accessed, hint page fault will occur. The scan time is gotten from the struct page. And The hint page fault latency is defined as hint page fault time - scan time The shorter the hint page fault latency of a page is, the higher the probability of their access frequency to be higher. So the hint page fault latency is a better estimation of the page hot/cold. It's hard to find some extra space in struct page to hold the scan time. Fortunately, we can reuse some bits used by the original NUMA balancing. NUMA balancing uses some bits in struct page to store the page accessing CPU and PID (referring to page_cpupid_xchg_last()). Which is used by the multi-stage node selection algorithm to avoid to migrate pages shared accessed by the NUMA nodes back and forth. But for pages in the slow memory node, even if they are shared accessed by multiple NUMA nodes, as long as the pages are hot, they need to be promoted to the fast memory node. So the accessing CPU and PID information are unnecessary for the slow memory pages. We can reuse these bits in struct page to record the scan time. For the fast memory pages, these bits are used as before. For the hot threshold, the default value is 1 second, which works well in our performance test. All pages with hint page fault latency < hot threshold will be considered hot. It's hard for users to determine the hot threshold. So we don't provide a kernel ABI to set it, just provide a debugfs interface for advanced users to experiment. We will continue to work on a hot threshold automatic adjustment mechanism. The downside of the above method is that the response time to the workload hot spot changing may be much longer. For example, - A previous cold memory area becomes hot - The hint page fault will be triggered. But the hint page fault latency isn't shorter than the hot threshold. So the pages will not be promoted. - When the memory area is scanned again, maybe after a scan period, the hint page fault latency measured will be shorter than the hot threshold and the pages will be promoted. To mitigate this, if there are enough free space in the fast memory node, the hot threshold will not be used, all pages will be promoted upon the hint page fault for fast response. Thanks Zhong Jiang reported and tested the fix for a bug when disabling memory tiering mode dynamically. Link: https://lkml.kernel.org/r/20220713083954.34196-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20220713083954.34196-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Tested-by: Baolin Wang Cc: Johannes Weiner Cc: Michal Hocko Cc: Rik van Riel Cc: Mel Gorman Cc: Peter Zijlstra Cc: Dave Hansen Cc: Yang Shi Cc: Zi Yan Cc: Wei Xu Cc: osalvador Cc: Shakeel Butt Cc: Zhong Jiang Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 44b414c8715c5dcf53288ce9005d7b24cc90eaf5 Author: Kefeng Wang Date: Tue Jul 26 22:54:28 2022 +0800 mm/util.c: add warning if __vm_enough_memory fails If a process has not enough memory to allocate a new virtual mapping, we may meet verious kinds of error, eg, fork cannot allocate memory, SIGBUS error in shmem, but it is difficult to confirm them, let's add some debug information to easily to check this scenario if __vm_enough_memory fails. Link: https://lkml.kernel.org/r/20220726145428.8030-1-wangkefeng.wang@huawei.com Reported-by: Yongqiang Liu Signed-off-by: Kefeng Wang Acked-by: David Hildenbrand Signed-off-by: Andrew Morton commit 4d86d4f7227c6f2acfbbbe0623d49865aa71b756 Author: Peter Collingbourne Date: Tue Jul 26 16:02:41 2022 -0700 mm: add more BUILD_BUG_ONs to gfp_migratetype() gfp_migratetype() also expects GFP_RECLAIMABLE and GFP_MOVABLE|GFP_RECLAIMABLE to be shiftable into MIGRATE_* enum values, so add some more BUILD_BUG_ONs to reflect this assumption. Link: https://linux-review.googlesource.com/id/Iae64e2182f75c3aca776a486b71a72571d66d83e Link: https://lkml.kernel.org/r/20220726230241.3770532-1-pcc@google.com Signed-off-by: Peter Collingbourne Signed-off-by: Andrew Morton commit 24a95998e9baba5e3236d9127d2d302a1a2ad2ab Author: Alistair Popple Date: Fri Jul 29 12:46:45 2022 +1000 mm/gup.c: simplify and fix check_and_migrate_movable_pages() return codes When pinning pages with FOLL_LONGTERM check_and_migrate_movable_pages() is called to migrate pages out of zones which should not contain any longterm pinned pages. When migration succeeds all pages will have been unpinned so pinning needs to be retried. This is indicated by returning zero. When all pages are in the correct zone the number of pinned pages is returned. However migration can also fail, in which case pages are unpinned and -ENOMEM is returned. However if the failure was due to not being unable to isolate a page zero is returned. This leads to indefinite looping in __gup_longterm_locked(). Fix this by simplifying the return codes such that zero indicates all pages were successfully pinned in the correct zone while errors indicate either pages were migrated and pinning should be retried or that migration has failed and therefore the pinning operation should fail. [syoshida@redhat.com: fix return value for __gup_longterm_locked()] Link: https://lkml.kernel.org/r/20220821183547.950370-1-syoshida@redhat.com [akpm@linux-foundation.org: fix code layout, per John] [yshigeru@gmail.com: fix uninitialized return value on __gup_longterm_locked()] Link: https://lkml.kernel.org/r/20220827230037.78876-1-syoshida@redhat.com Link: https://lkml.kernel.org/r/20220729024645.764366-1-apopple@nvidia.com Signed-off-by: Alistair Popple Signed-off-by: Shigeru Yoshida Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: Alistair Popple Cc: John Hubbard Cc: Minchan Kim Cc: Pasha Tatashin Signed-off-by: Andrew Morton commit c37213c5eaaf4c9a6249b14b39426285a4ea89c5 Author: Miaohe Lin Date: Fri Jul 29 16:01:06 2022 +0800 hugetlb_cgroup: use helper for_each_hstate and hstate_index Use helper for_each_hstate and hstate_index to iterate the hstate and get the hstate index. Minor readability improvement. Link: https://lkml.kernel.org/r/20220729080106.12752-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 99249387cf0d1e4525887c2292c4249edf0d8eea Author: Miaohe Lin Date: Fri Jul 29 16:01:05 2022 +0800 hugetlb_cgroup: use helper macro NUMA_NO_NODE It's better to use NUMA_NO_NODE instead of magic number -1. Minor readability improvement. Link: https://lkml.kernel.org/r/20220729080106.12752-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 736a8ccce99c633b2457996bb9bf2cefff0db43d Author: Miaohe Lin Date: Fri Jul 29 16:01:04 2022 +0800 hugetlb_cgroup: remove unneeded return value The return value of set_hugetlb_cgroup and set_hugetlb_cgroup_rsvd are always ignored. Remove them to clean up the code. Link: https://lkml.kernel.org/r/20220729080106.12752-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Mina Almasry Signed-off-by: Andrew Morton commit abfb09e2c8569139e8430e3d57e6b1b294c8d34a Author: Miaohe Lin Date: Fri Jul 29 16:01:03 2022 +0800 hugetlb_cgroup: hugetlbfs: use helper macro SZ_1{K,M,G} Use helper macro SZ_1K, SZ_1M and SZ_1G to do the size conversion. Minor readability improvement. Link: https://lkml.kernel.org/r/20220729080106.12752-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 862f7f6581a353ee320beb2921f5e70b6afda5f2 Author: Miaohe Lin Date: Fri Jul 29 16:01:02 2022 +0800 hugetlb_cgroup: remove unneeded nr_pages > 0 check Patch series "A few cleanup patches for hugetlb_cgroup", v2. This series contains a few cleaup patches to remove unneeded check, use helper macro, remove unneeded return value and so on. More details can be found in the respective changelogs. This patch (of 5): When code reaches here, nr_pages must be > 0. Remove unneeded nr_pages > 0 check to simplify the code. Link: https://lkml.kernel.org/r/20220729080106.12752-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220729080106.12752-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 6f83d6c74ea5a5b267be85206822da280cae110a Author: Tarun Sahu Date: Mon Aug 1 12:32:31 2022 +0530 Kselftests: remove support of libhugetlbfs from kselftests libhugetlbfs, the user side utitlity to work with hugepages, does not have any active support. There are only 2 selftests which are part of in vm/hmm_test.c that depends on libhugetlbfs. This patch modifies the tests so that they will not require libhugetlb library. [axelrasmussen@google.com: : remove orphaned references to local_config.{h,mk}] Link: https://lkml.kernel.org/r/20220831211526.2743216-1-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220801070231.13831-1-tsahu@linux.ibm.com Signed-off-by: Tarun Sahu Signed-off-by: Axel Rasmussen Tested-by: Zach O'Keefe Cc: "Aneesh Kumar K.V" Cc: Jerome Glisse Cc: Shivaprasad G Bhat Cc: Shuah Khan Cc: Vaibhav Jain Cc: Axel Rasmussen Signed-off-by: Andrew Morton commit b84e04f1baeebe6872b22a027cfc558621e842d4 Author: Imran Khan Date: Mon Aug 15 05:53:53 2022 +1000 kfence: add sysfs interface to disable kfence for selected slabs. By default kfence allocation can happen for any slab object, whose size is up to PAGE_SIZE, as long as that allocation is the first allocation after expiration of kfence sample interval. But in certain debugging scenarios we may be interested in debugging corruptions involving some specific slub objects like dentry or ext4_* etc. In such cases limiting kfence for allocations involving only specific slub objects will increase the probablity of catching the issue since kfence pool will not be consumed by other slab objects. This patch introduces a sysfs interface '/sys/kernel/slab//skip_kfence' to disable kfence for specific slabs. Having the interface work in this way does not impact current/default behavior of kfence and allows us to use kfence for specific slabs (when needed) as well. The decision to skip/use kfence is taken depending on whether kmem_cache.flags has (newly introduced) SLAB_SKIP_KFENCE flag set or not. Link: https://lkml.kernel.org/r/20220814195353.2540848-1-imran.f.khan@oracle.com Signed-off-by: Imran Khan Reviewed-by: Vlastimil Babka Reviewed-by: Marco Elver Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Roman Gushchin Signed-off-by: Andrew Morton commit 831568214883e0a9940f776771343420306d2341 Author: Haiyue Wang Date: Fri Aug 12 16:49:21 2022 +0800 mm: migration: fix the FOLL_GET failure on following huge page Not all huge page APIs support FOLL_GET option, so move_pages() syscall will fail to get the page node information for some huge pages. Like x86 on linux 5.19 with 1GB huge page API follow_huge_pud(), it will return NULL page for FOLL_GET when calling move_pages() syscall with the NULL 'nodes' parameter, the 'status' parameter has '-2' error in array. Note: follow_huge_pud() now supports FOLL_GET in linux 6.0. Link: https://lore.kernel.org/all/20220714042420.1847125-3-naoya.horiguchi@linux.dev But these huge page APIs don't support FOLL_GET: 1. follow_huge_pud() in arch/s390/mm/hugetlbpage.c 2. follow_huge_addr() in arch/ia64/mm/hugetlbpage.c It will cause WARN_ON_ONCE for FOLL_GET. 3. follow_huge_pgd() in mm/hugetlb.c This is an temporary solution to mitigate the side effect of the race condition fix by calling follow_page() with FOLL_GET set for huge pages. After supporting follow huge page by FOLL_GET is done, this fix can be reverted safely. Link: https://lkml.kernel.org/r/20220823135841.934465-2-haiyue.wang@intel.com Link: https://lkml.kernel.org/r/20220812084921.409142-1-haiyue.wang@intel.com Fixes: 4cd614841c06 ("mm: migration: fix possible do_pages_stat_array racing with memory offline") Signed-off-by: Haiyue Wang Reviewed-by: Miaohe Lin Reviewed-by: "Huang, Ying" Reviewed-by: Baolin Wang Cc: David Hildenbrand Cc: Muchun Song Signed-off-by: Andrew Morton commit d3629af59f41a108d6c552f1dcba31281fb8e6bf Author: Yang Yang Date: Sat Aug 13 08:07:58 2022 +0000 mm/vmscan: make the annotations of refaults code at the right place After patch "mm/workingset: prepare the workingset detection infrastructure for anon LRU", we can handle the refaults of anonymous pages too. So the annotations of refaults should cover both of anonymous pages and file pages. Link: https://lkml.kernel.org/r/20220813080757.59131-1-yang.yang29@zte.com.cn Fixes: 170b04b7ae4963 ("mm/workingset: prepare the workingset detection infrastructure for anon LRU") Signed-off-by: Yang Yang Signed-off-by: CGEL ZTE Cc: Joonsoo Kim Cc: Johannes Weiner Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4ed9824346c071c949968b16ec3e99eaf967c23c Author: Kaixu Xia Date: Sat Aug 13 23:19:03 2022 +0800 mm/damon/core: simplify the parameter passing for region split operation The parameter 'struct damon_ctx *ctx' is unnecessary in damon region split operation, so we can remove it. Link: https://lkml.kernel.org/r/1660403943-29124-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 57eb60c04d2c7b0de91eac2bc5d0331f8fe72fd7 Author: Yixuan Cao Date: Fri Aug 12 23:55:15 2022 +0800 tools/vm/page_owner_sort: fix -f option The -f option is to filter out the information of blocks whose memory has not been released, I noticed some blocks should not be filtered out. Commit 9cc7e96aa846 ("mm/page_owner: record timestamp and pid") records the allocation timestamp (ts_nsec) of all pages. Commit 866b48526217 ("mm/page_owner: record the timestamp of all pages during free") records the free timestamp (free_ts_nsec) of all pages. When the page is allocated for the first time, the initial value of free_ts_nsec is 0, and the corresponding time will be obtained when the page is released. But during reallocation the free_ts_nsec will not reset to 0 again. In particular, when page migration occurs, these two timestamps will be the same. Now page_owner_sort removes all text blocks whose free_ts_nsec is not 0 when using -f option. However, this way can only select pages allocated for the first time. If a freed page is reallocated, free_ts_nsec will be less than ts_nsec; if page migration occurs, the two timestamps will be equal. These cases should be considered as pages are not released. So I fix the function is_need() to keep text blocks that meet the above two conditions when using -f option. Link: https://lkml.kernel.org/r/20220812155515.30846-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Chongxi Zhao Cc: Jiajian Ye Cc: Yuhong Feng Cc: Liam Mark Cc: Georgi Djakov Cc: Vlastimil Babka Cc: Joonsoo Kim Signed-off-by: Andrew Morton commit 2fd86a07c9ac50dfbc5eef3c69ef6e5d370f3b28 Author: Kairui Song Date: Tue Aug 2 01:31:55 2022 +0800 mm/util: reduce stack usage of folio_mapcount folio_test_hugetlb() will call PageHeadHuge which is a function call, and blocks the compiler from recognizing this redundant load. After rearranging the code, stack usage is dropped from 32 to 24, and the function size is smaller (tested on GCC 12): Before: Stack usage: mm/util.c:845:5:folio_mapcount 32 static Size: 0000000000000ea0 00000000000000c7 T folio_mapcount After: Stack usage: mm/util.c:845:5:folio_mapcount 24 static Size: 0000000000000ea0 00000000000000b0 T folio_mapcount Link: https://lkml.kernel.org/r/20220801173155.92008-1-ryncsn@gmail.com Signed-off-by: Kairui Song Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit e933dc4a07b36b835f8ad7085e17cc21ed869051 Author: Abel Wu Date: Wed Aug 3 10:51:21 2022 +0800 mm/page_alloc: only search higher order when fallback It seems unnecessary to search pages with order < alloc_order in fallback allocation. This can currently happen with ALLOC_NOFRAGMENT and alloc_order > pageblock_order, so add a test to prevent it. [vbabka@suse.cz: changelog addition] Link: https://lkml.kernel.org/r/20220803025121.47018-1-wuyun.abel@bytedance.com Signed-off-by: Abel Wu Acked-by: Vlastimil Babka Acked-by: Mel Gorman Reviewed-by: Muchun Song Cc: Michal Hocko Signed-off-by: Andrew Morton commit 97bab178e8e4035e0f3a8b1362eec3e86fdcb9ce Author: Li kunyu Date: Wed Aug 3 14:41:18 2022 +0800 page_alloc: remove inactive initialization The allocation address of the table pointer variable is first performed in the function, no initialization assignment is required, and no invalid pointer will appear. Link: https://lkml.kernel.org/r/20220803064118.3664-1-kunyu@nfschina.com Signed-off-by: Li kunyu Signed-off-by: Andrew Morton commit d2226ebd5484afcf9f9b71b394ec1567a7730eb1 Author: Feng Tang Date: Fri Aug 5 08:59:03 2022 +0800 mm/hugetlb: add dedicated func to get 'allowed' nodemask for current process Muchun Song found that after MPOL_PREFERRED_MANY policy was introduced in commit b27abaccf8e8 ("mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes"), the policy_nodemask_current()'s semantics for this new policy has been changed, which returns 'preferred' nodes instead of 'allowed' nodes. With the changed semantic of policy_nodemask_current, a task with MPOL_PREFERRED_MANY policy could fail to get its reservation even though it can fall back to other nodes (either defined by cpusets or all online nodes) for that reservation failing mmap calles unnecessarily early. The fix is to not consider MPOL_PREFERRED_MANY for reservations at all because they, unlike MPOL_MBIND, do not pose any actual hard constrain. Michal suggested the policy_nodemask_current() is only used by hugetlb, and could be moved to hugetlb code with more explicit name to enforce the 'allowed' semantics for which only MPOL_BIND policy matters. apply_policy_zone() is made extern to be called in hugetlb code and its return value is changed to bool. [1]. https://lore.kernel.org/lkml/20220801084207.39086-1-songmuchun@bytedance.com/t/ Link: https://lkml.kernel.org/r/20220805005903.95563-1-feng.tang@intel.com Fixes: b27abaccf8e8 ("mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes") Signed-off-by: Feng Tang Reported-by: Muchun Song Suggested-by: Michal Hocko Acked-by: Michal Hocko Reviewed-by: Muchun Song Cc: Mike Kravetz Cc: Dave Hansen Cc: Ben Widawsky Signed-off-by: Andrew Morton commit 12c1dc8e7441773c74dc62fab76553c24015f6e1 Author: Abel Wu Date: Thu Aug 11 20:41:57 2022 +0800 mm/mempolicy: fix lock contention on mems_allowed The mems_allowed field can be modified by other tasks, so it isn't safe to access it with alloc_lock unlocked even in the current process context. Say there are two tasks: A from cpusetA is performing set_mempolicy(2), and B is changing cpusetA's cpuset.mems: A (set_mempolicy) B (echo xx > cpuset.mems) ------------------------------------------------------- pol = mpol_new(); update_tasks_nodemask(cpusetA) { foreach t in cpusetA { cpuset_change_task_nodemask(t) { mpol_set_nodemask(pol) { task_lock(t); // t could be A new = f(A->mems_allowed); update t->mems_allowed; pol.create(pol, new); task_unlock(t); } } } } task_lock(A); A->mempolicy = pol; task_unlock(A); In this case A's pol->nodes is computed by old mems_allowed, and could be inconsistent with A's new mems_allowed. While it is different when replacing vmas' policy: the pol->nodes is gone wild only when current_cpuset_is_being_rebound(): A (mbind) B (echo xx > cpuset.mems) ------------------------------------------------------- pol = mpol_new(); mmap_write_lock(A->mm); cpuset_being_rebound = cpusetA; update_tasks_nodemask(cpusetA) { foreach t in cpusetA { cpuset_change_task_nodemask(t) { mpol_set_nodemask(pol) { task_lock(t); // t could be A mask = f(A->mems_allowed); update t->mems_allowed; pol.create(pol, mask); task_unlock(t); } } foreach v in A->mm { if (cpuset_being_rebound == cpusetA) pol.rebind(pol, cpuset.mems); v->vma_policy = pol; } mmap_write_unlock(A->mm); mmap_write_lock(t->mm); mpol_rebind_mm(t->mm); mmap_write_unlock(t->mm); } } cpuset_being_rebound = NULL; In this case, the cpuset.mems, which has already done updating, is finally used for calculating pol->nodes, rather than A->mems_allowed. So it is OK to call mpol_set_nodemask() with alloc_lock unlocked when doing mbind(2). Link: https://lkml.kernel.org/r/20220811124157.74888-1-wuyun.abel@bytedance.com Fixes: 78b132e9bae9 ("mm/mempolicy: remove or narrow the lock on current") Signed-off-by: Abel Wu Acked-by: Michal Hocko Reviewed-by: Wei Yang Reviewed-by: Muchun Song Cc: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit 9a79443ddc3b9c3e1c4766209b86770585b5f7cc Author: Charan Teja Kalla Date: Thu Aug 11 18:45:29 2022 +0530 mm/cma_debug: show complete cma name in debugfs directories Currently only 12 characters of the cma name is being used as the debug directories where as the cma name can be of length CMA_MAX_NAME(=64) characters. One side problem with this is having 2 cma's with first common 12 characters would end up in trying to create directories with same name and fails with -EEXIST thus can limit cma debug functionality. The 'cma-' prefix is used initially where cma areas don't have any names and are represented by simple integer values. Since now each cma would be having its own name, drop 'cma-' prefix for the cma debug directories as they are clearly evident that they are for cma debug through creating them in /sys/kernel/debug/cma/ path. Link: https://lkml.kernel.org/r/1660223729-22461-1-git-send-email-quic_charante@quicinc.com Signed-off-by: Charan Teja Kalla Cc: David Hildenbrand Cc: Vlastimil Babka Cc: Pavan Kondeti Cc: Minchan Kim Signed-off-by: Andrew Morton commit cf1e3fe4975c4bd6a6a14428700c5a2c36528a7b Author: Christoph Hellwig Date: Thu Aug 11 16:17:41 2022 +0200 mm/swap: remove the end_write_func argument to __swap_writepage The argument is always set to end_swap_bio_write, so remove the argument and mark end_swap_bio_write static. Link: https://lkml.kernel.org/r/20220811141741.660214-1-hch@lst.de Signed-off-by: Christoph Hellwig Cc: Seth Jennings Cc: Dan Streetman Cc: Vitaly Wool Signed-off-by: Andrew Morton commit f24263a5a076dae41f3718f368df4fd8bf35888b Author: Alexey Romanov Date: Thu Aug 11 18:37:55 2022 +0300 zsmalloc: remove unnecessary size_class NULL check pool->size_class array elements can't be NULL, so this check is not needed. In the whole code, we assign pool->size_class[i] values that are not NULL. Releasing memory for these values occurs in the zs_destroy_pool() function, which also releases and destroys the pool. In addition, in the zs_stats_size_show() and async_free_zspage(), with similar iterations over the array, we don't check it for NULL pointer. Link: https://lkml.kernel.org/r/20220811153755.16102-3-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton commit 050a388b7f05b13dbcc5b6f14a4c7565a69a5020 Author: Alexey Romanov Date: Thu Aug 11 18:37:54 2022 +0300 zsmalloc: zs_object_copy: add clarifying comment Patch series "tidy up zsmalloc implementation" This patchset remove some unnecessary checks and adds a clarifying comment. While analysing zs_object_copy() function code, I spent some time to understand what the call kunmap_atomic(d_addr) is for. It seems that this point is not trivial and it is worth adding a comment. This patch (of 2): It's not obvious why kunmap_atomic(d_addr) call is needed. [akpm@linux-foundation.org: tweak comment layout] Link: https://lkml.kernel.org/r/20220811153755.16102-1-avromanov@sberdevices.ru Link: https://lkml.kernel.org/r/20220811153755.16102-2-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Cc: Minchan Kim Cc: Sergey Senozhatsky Cc: Nitin Gupta Signed-off-by: Andrew Morton commit e9c2dbc8bf71a5039604a1dc45b10f24a2098f3b Author: Yang Yang Date: Mon Aug 8 00:56:45 2022 +0000 mm/vmscan: define macros for refaults in struct lruvec The magic number 0 and 1 are used in several places in vmscan.c. Define macros for them to improve code readability. Link: https://lkml.kernel.org/r/20220808005644.1721066-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 4a7e922587d2ea19278a6355dcb52043e47adbac Author: Axel Rasmussen Date: Mon Aug 8 10:56:14 2022 -0700 selftests: vm: add /dev/userfaultfd test cases to run_vmtests.sh This new mode was recently added to the userfaultfd selftest. We want to exercise both userfaultfd(2) as well as /dev/userfaultfd, so add both test cases to the script. Link: https://lkml.kernel.org/r/20220808175614.3885028-6-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Reviewed-by: Shuah Khan Acked-by: Peter Xu Cc: Al Viro Cc: Dave Hansen Cc: Dmitry V. Levin Cc: Gleb Fotengauer-Malinovskiy Cc: Hugh Dickins Cc: Jan Kara Cc: Jonathan Corbet Cc: Mel Gorman Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zhang Yi Cc: Mike Rapoport Signed-off-by: Andrew Morton commit 816284a3d0e27828b5cc35f3cf539b0711939ce3 Author: Axel Rasmussen Date: Mon Aug 8 10:56:13 2022 -0700 userfaultfd: update documentation to describe /dev/userfaultfd Explain the different ways to create a new userfaultfd, and how access control works for each way. [axelrasmussen@google.com: improve wording in documentation, per Mike] Link: https://lkml.kernel.org/r/20220819205201.658693-5-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220808175614.3885028-5-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Acked-by: Peter Xu Reviewed-by: Shuah Khan Cc: Al Viro Cc: Dave Hansen Cc: Dmitry V. Levin Cc: Gleb Fotengauer-Malinovskiy Cc: Hugh Dickins Cc: Jan Kara Cc: Jonathan Corbet Cc: Mel Gorman Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zhang Yi Cc: Mike Rapoport Signed-off-by: Andrew Morton commit 77c07f7cca9fc7c99aa26058e4674980e0cbb186 Author: Axel Rasmussen Date: Mon Aug 8 10:56:12 2022 -0700 userfaultfd: selftests: modify selftest to use /dev/userfaultfd We clearly want to ensure both userfaultfd(2) and /dev/userfaultfd keep working into the future, so just run the test twice, using each interface. Instead of always testing both userfaultfd(2) and /dev/userfaultfd, let the user choose which to test. As with other test features, change the behavior based on a new command line flag. Introduce the idea of "test mods", which are generic (not specific to a test type) modifications to the behavior of the test. This is sort of borrowed from this RFC patch series [1], but simplified a bit. The benefit is, in "typical" configurations this test is somewhat slow (say, 30sec or something). Testing both clearly doubles it, so it may not always be desirable, as users are likely to use one or the other, but never both, in the "real world". [1]: https://patchwork.kernel.org/project/linux-mm/patch/20201129004548.1619714-14-namit@vmware.com/ [axelrasmussen@google.com: modify selftest to exit with KSFT_SKIP *only* when features are unsupported, per Mike] Link: https://lkml.kernel.org/r/20220819205201.658693-4-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220808175614.3885028-4-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Acked-by: Peter Xu Acked-by: Mike Rapoport Cc: Al Viro Cc: Dave Hansen Cc: Dmitry V. Levin Cc: Gleb Fotengauer-Malinovskiy Cc: Hugh Dickins Cc: Jan Kara Cc: Jonathan Corbet Cc: Mel Gorman Cc: Mike Kravetz Cc: Shuah Khan Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zhang Yi Cc: Mike Rapoport Signed-off-by: Andrew Morton commit 2d5de004e009add27db76c5cdc9f1f7f7dc087e7 Author: Axel Rasmussen Date: Mon Aug 8 10:56:11 2022 -0700 userfaultfd: add /dev/userfaultfd for fine grained access control Historically, it has been shown that intercepting kernel faults with userfaultfd (thereby forcing the kernel to wait for an arbitrary amount of time) can be exploited, or at least can make some kinds of exploits easier. So, in 37cd0575b8 "userfaultfd: add UFFD_USER_MODE_ONLY" we changed things so, in order for kernel faults to be handled by userfaultfd, either the process needs CAP_SYS_PTRACE, or this sysctl must be configured so that any unprivileged user can do it. In a typical implementation of a hypervisor with live migration (take QEMU/KVM as one such example), we do indeed need to be able to handle kernel faults. But, both options above are less than ideal: - Toggling the sysctl increases attack surface by allowing any unprivileged user to do it. - Granting the live migration process CAP_SYS_PTRACE gives it this ability, but *also* the ability to "observe and control the execution of another process [...], and examine and change [its] memory and registers" (from ptrace(2)). This isn't something we need or want to be able to do, so granting this permission violates the "principle of least privilege". This is all a long winded way to say: we want a more fine-grained way to grant access to userfaultfd, without granting other additional permissions at the same time. To achieve this, add a /dev/userfaultfd misc device. This device provides an alternative to the userfaultfd(2) syscall for the creation of new userfaultfds. The idea is, any userfaultfds created this way will be able to handle kernel faults, without the caller having any special capabilities. Access to this mechanism is instead restricted using e.g. standard filesystem permissions. [axelrasmussen@google.com: Handle misc_register() failure properly] Link: https://lkml.kernel.org/r/20220819205201.658693-3-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220808175614.3885028-3-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Acked-by: Nadav Amit Acked-by: Peter Xu Acked-by: Mike Rapoport Cc: Al Viro Cc: Dave Hansen Cc: Dmitry V. Levin Cc: Gleb Fotengauer-Malinovskiy Cc: Hugh Dickins Cc: Jan Kara Cc: Jonathan Corbet Cc: Mel Gorman Cc: Mike Kravetz Cc: Shuah Khan Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zhang Yi Cc: Mike Rapoport Signed-off-by: Andrew Morton commit a722d70508d64e4800dbf7e9fbf132d186a6484a Author: Axel Rasmussen Date: Mon Aug 8 10:56:10 2022 -0700 selftests: vm: add hugetlb_shared userfaultfd test to run_vmtests.sh Patch series "userfaultfd: add /dev/userfaultfd for fine grained access control", v7. Why not ...? ============ - Why not /proc/[pid]/userfaultfd? Two main points (additional discussion [1]): - /proc/[pid]/* files are all owned by the user/group of the process, and they don't really support chmod/chown. So, without extending procfs it doesn't solve the problem this series is trying to solve. - The main argument *for* this was to support creating UFFDs for remote processes. But, that use case clearly calls for CAP_SYS_PTRACE, so to support this we could just use the UFFD syscall as-is. - Why not use a syscall? Access to syscalls is generally controlled by capabilities. We don't have a capability which is used for userfaultfd access without also granting more / other permissions as well, and adding a new capability was rejected [2]. - It's possible a LSM could be used to control access instead, but I have some concerns. I don't think this approach would be as easy to use, particularly if we were to try to solve this with something heavyweight like SELinux. Maybe we could pursue adding a new LSM specifically for this user case, but it may be too narrow of a case to justify that. [1]: https://patchwork.kernel.org/project/linux-mm/cover/20220719195628.3415852-1-axelrasmussen@google.com/ [2]: https://lore.kernel.org/lkml/686276b9-4530-2045-6bd8-170e5943abe4@schaufler-ca.com/T/ This patch (of 5): This not being included was just a simple oversight. There are certain features (like minor fault support) which are only enabled on shared mappings, so without including hugetlb_shared we actually lose a significant amount of test coverage. Link: https://lkml.kernel.org/r/20220808175614.3885028-1-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220808175614.3885028-2-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Reviewed-by: Shuah Khan Reviewed-by: Peter Xu Cc: Al Viro Cc: Dave Hansen Cc: Dmitry V. Levin Cc: Gleb Fotengauer-Malinovskiy Cc: Hugh Dickins Cc: Jan Kara Cc: Jonathan Corbet Cc: Mel Gorman Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zhang Yi Cc: Mike Rapoport Signed-off-by: Andrew Morton commit b2d4c646d5a15c1854e09898a374983167e53e0e Author: Kenneth Lee Date: Mon Aug 8 15:00:19 2022 -0700 mm/damon/dbgfs: use kmalloc for allocating only one element Use kmalloc(...) rather than kmalloc_array(1, ...) because the number of elements we are specifying in this case is 1, kmalloc would accomplish the same thing and we can simplify. Link: https://lkml.kernel.org/r/20220808220019.1680469-1-klee33@uw.edu Signed-off-by: Kenneth Lee Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 223ce4910bac6434060c018ba247b6b40a399b49 Author: Shaoqin Huang Date: Tue Aug 9 10:32:56 2022 +0800 mm/filemap.c: convert page_endio() to use a folio Replace three calls to compound_head() with one. Link: https://lkml.kernel.org/r/20220809023256.178194-1-shaoqin.huang@intel.com Signed-off-by: Shaoqin Huang Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 2ace36f0f55777be8a871c370832527e1cd54b15 Author: Kefeng Wang Date: Tue Aug 9 19:18:13 2022 +0800 mm: memory-failure: cleanup try_to_split_thp_page() Since commit 5d1fd5dc877b ("mm,hwpoison: introduce MF_MSG_UNSPLIT_THP"), the action_result(,MF_MSG_UNSPLIT_THP,) called to show memory error event in memory_failure(), so the pr_info() in try_to_split_thp_page() is only needed in soft_offline_in_use_page(). Meanwhile this could also fix the unexpected prefix for "thp split failed" due to commit 96f96763de26 ("mm: memory-failure: convert to pr_fmt()"). Link: https://lkml.kernel.org/r/20220809111813.139690-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Naoya Horiguchi Cc: Miaohe Lin Signed-off-by: Andrew Morton commit f35b5d7d676e59e401690b678cd3cfec5e785c23 Author: Rik van Riel Date: Tue Aug 9 14:24:57 2022 -0400 mm: align larger anonymous mappings on THP boundaries Align larger anonymous memory mappings on THP boundaries by going through thp_get_unmapped_area if THPs are enabled for the current process. With this patch, larger anonymous mappings are now THP aligned. When a malloc library allocates a 2MB or larger arena, that arena can now be mapped with THPs right from the start, which can result in better TLB hit rates and execution time. Link: https://lkml.kernel.org/r/20220809142457.4751229f@imladris.surriel.com Signed-off-by: Rik van Riel Reviewed-by: Yang Shi Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 7b5a0b664ebe2625965a0fdba2614c88c4b9bbc6 Author: Charan Teja Kalla Date: Mon Aug 1 10:36:37 2022 +0530 mm/page_ext: remove unused variable in offline_page_ext Remove unused variable 'nid' in offline_page_ext(). This is not used since the page_ext code inception. Link: https://lkml.kernel.org/r/1659330397-11817-1-git-send-email-quic_charante@quicinc.com Signed-off-by: Charan Teja Kalla Acked-by: Michal Hocko Reviewed-by: Anshuman Khandual Cc: Roman Gushchin Cc: Johannes Weiner Cc: Shakeel Butt Cc: Muchun Song Cc: Pavan Kondeti Signed-off-by: Andrew Morton commit 9d0d946840075e0268f4f77fe39ba0f53e84c7c4 Author: Zach O'Keefe Date: Wed Jul 6 16:59:36 2022 -0700 selftests/vm: add selftest to verify multi THP collapse Add support to allocate and verify collapse of multiple hugepage-sized regions into multiple THPs. Add "nr" argument to check_huge() that instructs check_huge() to check for exactly "nr_hpages" THPs. This has the added benefit of now being able to check for exactly 0 THPs, and so callsites that previously checked the negation of exactly 1 THP are now more correct. ->collapse struct collapse_context hook has been expanded with a "nr_hpages" argument to collapse "nr_hpages" hugepages. The collapse_full() test has been repurposed to collapse 4 THPs at once. It is expected more tests will want to test multi THP collapse (e.g. file/shmem). This is of particular benefit to madvise collapse context given that it may do many THP collapses during a single syscall. Link: https://lkml.kernel.org/r/20220706235936.2197195-19-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 1370a21fe4708b3bfa748d355146e4fbadf52f90 Author: Zach O'Keefe Date: Wed Jul 6 16:59:35 2022 -0700 selftests/vm: add selftest to verify recollapse of THPs Add selftest specific to madvise collapse context that tests MADV_COLLAPSE is "successful" if a hugepage-aligned/sized region is already pmd-mapped. This test also verifies that MADV_COLLAPSE can collapse memory into THPs even in "madvise" THP mode and the memory isn't marked VM_HUGEPAGE. Link: https://lkml.kernel.org/r/20220706235936.2197195-18-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 9330694de59f17e110a58be486a2c64d32bab42f Author: Zach O'Keefe Date: Wed Jul 6 16:59:34 2022 -0700 selftests/vm: add MADV_COLLAPSE collapse context to selftests Add madvise collapse context to hugepage collapse selftests. This context is tested with /sys/kernel/mm/transparent_hugepage/enabled set to "never" in order to avoid unwanted interaction with khugepaged during testing. Also, refactor updates to sysfs THP settings using a stack so that the THP settings from nested callers can be restored. Link: https://lkml.kernel.org/r/20220706235936.2197195-17-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit be6667b0db97e10b2a6d57a906c2c8fd2b985e5e Author: Zach O'Keefe Date: Wed Jul 6 16:59:33 2022 -0700 selftests/vm: dedup hugepage allocation logic The code p = alloc_mapping(); printf("Allocate huge page..."); madvise(p, hpage_pmd_size, MADV_HUGEPAGE); fill_memory(p, 0, hpage_pmd_size); if (check_huge(p)) success("OK"); else fail("Fail"); Is repeated many times in different tests. Add a helper, alloc_hpage() to handle this. Link: https://lkml.kernel.org/r/20220706235936.2197195-16-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 61c2c6764e6fcc95507dcf672d15f33b0af300f2 Author: Zach O'Keefe Date: Wed Jul 6 16:59:32 2022 -0700 selftests/vm: modularize collapse selftests Modularize the collapse action of khugepaged collapse selftests by introducing a struct collapse_context which specifies how to collapse a given memory range and the expected semantics of the collapse. This can be reused later to test other collapse contexts. Additionally, all tests have logic that checks if a collapse occurred via reading /proc/self/smaps, and report if this is different than expected. Move this logic into the per-context ->collapse() hook instead of repeating it in every test. Link: https://lkml.kernel.org/r/20220706235936.2197195-15-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 876b4a1896646cc85ec6b1fc1c9270928b7e0831 Author: Zach O'Keefe Date: Wed Jul 6 16:59:30 2022 -0700 mm/madvise: add MADV_COLLAPSE to process_madvise() Allow MADV_COLLAPSE behavior for process_madvise(2) if caller has CAP_SYS_ADMIN or is requesting collapse of it's own memory. This is useful for the development of userspace agents that seek to optimize THP utilization system-wide by using userspace signals to prioritize what memory is most deserving of being THP-backed. [zokeefe@google.com: remove CAP_SYS_ADMIN requirement for process_madvise(MADV_COLLAPSE)] Link: https://lkml.kernel.org/r/20220801210946.3069083-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220706235936.2197195-13-zokeefe@google.com Signed-off-by: Zach O'Keefe Acked-by: David Rientjes Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 7d2c4385c3417cab8c08ac4c86a3852b9a851980 Author: Zach O'Keefe Date: Wed Jul 6 16:59:28 2022 -0700 mm/khugepaged: rename prefix of shared collapse functions The following functions are shared between khugepaged and madvise collapse contexts. Replace the "khugepaged_" prefix with generic "hpage_collapse_" prefix in such cases: khugepaged_test_exit() -> hpage_collapse_test_exit() khugepaged_scan_abort() -> hpage_collapse_scan_abort() khugepaged_scan_pmd() -> hpage_collapse_scan_pmd() khugepaged_find_target_node() -> hpage_collapse_find_target_node() khugepaged_alloc_page() -> hpage_collapse_alloc_page() The kerenel ABI (e.g. huge_memory:mm_khugepaged_scan_pmd tracepoint) is unaltered. Link: https://lkml.kernel.org/r/20220706235936.2197195-11-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 7d8faaf155454f8798ec56404faca29a82689c77 Author: Zach O'Keefe Date: Wed Jul 6 16:59:27 2022 -0700 mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse This idea was introduced by David Rientjes[1]. Introduce a new madvise mode, MADV_COLLAPSE, that allows users to request a synchronous collapse of memory at their own expense. The benefits of this approach are: * CPU is charged to the process that wants to spend the cycles for the THP * Avoid unpredictable timing of khugepaged collapse Semantics This call is independent of the system-wide THP sysfs settings, but will fail for memory marked VM_NOHUGEPAGE. If the ranges provided span multiple VMAs, the semantics of the collapse over each VMA is independent from the others. This implies a hugepage cannot cross a VMA boundary. If collapse of a given hugepage-aligned/sized region fails, the operation may continue to attempt collapsing the remainder of memory specified. The memory ranges provided must be page-aligned, but are not required to be hugepage-aligned. If the memory ranges are not hugepage-aligned, the start/end of the range will be clamped to the first/last hugepage-aligned address covered by said range. The memory ranges must span at least one hugepage-sized region. All non-resident pages covered by the range will first be swapped/faulted-in, before being internally copied onto a freshly allocated hugepage. Unmapped pages will have their data directly initialized to 0 in the new hugepage. However, for every eligible hugepage aligned/sized region to-be collapsed, at least one page must currently be backed by memory (a PMD covering the address range must already exist). Allocation for the new hugepage may enter direct reclaim and/or compaction, regardless of VMA flags. When the system has multiple NUMA nodes, the hugepage will be allocated from the node providing the most native pages. This operation operates on the current state of the specified process and makes no persistent changes or guarantees on how pages will be mapped, constructed, or faulted in the future Return Value If all hugepage-sized/aligned regions covered by the provided range were either successfully collapsed, or were already PMD-mapped THPs, this operation will be deemed successful. On success, process_madvise(2) returns the number of bytes advised, and madvise(2) returns 0. Else, -1 is returned and errno is set to indicate the error for the most-recently attempted hugepage collapse. Note that many failures might have occurred, since the operation may continue to collapse in the event a single hugepage-sized/aligned region fails. ENOMEM Memory allocation failed or VMA not found EBUSY Memcg charging failed EAGAIN Required resource temporarily unavailable. Try again might succeed. EINVAL Other error: No PMD found, subpage doesn't have Present bit set, "Special" page no backed by struct page, VMA incorrectly sized, address not page-aligned, ... Most notable here is ENOMEM and EBUSY (new to madvise) which are intended to provide the caller with actionable feedback so they may take an appropriate fallback measure. Use Cases An immediate user of this new functionality are malloc() implementations that manage memory in hugepage-sized chunks, but sometimes subrelease memory back to the system in native-sized chunks via MADV_DONTNEED; zapping the pmd. Later, when the memory is hot, the implementation could madvise(MADV_COLLAPSE) to re-back the memory by THPs to regain hugepage coverage and dTLB performance. TCMalloc is such an implementation that could benefit from this[2]. Only privately-mapped anon memory is supported for now, but additional support for file, shmem, and HugeTLB high-granularity mappings[2] is expected. File and tmpfs/shmem support would permit: * Backing executable text by THPs. Current support provided by CONFIG_READ_ONLY_THP_FOR_FS may take a long time on a large system which might impair services from serving at their full rated load after (re)starting. Tricks like mremap(2)'ing text onto anonymous memory to immediately realize iTLB performance prevents page sharing and demand paging, both of which increase steady state memory footprint. With MADV_COLLAPSE, we get the best of both worlds: Peak upfront performance and lower RAM footprints. * Backing guest memory by hugapages after the memory contents have been migrated in native-page-sized chunks to a new host, in a userfaultfd-based live-migration stack. [1] https://lore.kernel.org/linux-mm/d098c392-273a-36a4-1a29-59731cdf5d3d@google.com/ [2] https://github.com/google/tcmalloc/tree/master/tcmalloc [jrdr.linux@gmail.com: avoid possible memory leak in failure path] Link: https://lkml.kernel.org/r/20220713024109.62810-1-jrdr.linux@gmail.com [zokeefe@google.com add missing kfree() to madvise_collapse()] Link: https://lore.kernel.org/linux-mm/20220713024109.62810-1-jrdr.linux@gmail.com/ Link: https://lkml.kernel.org/r/20220713161851.1879439-1-zokeefe@google.com [zokeefe@google.com: delay computation of hpage boundaries until use]] Link: https://lkml.kernel.org/r/20220720140603.1958773-4-zokeefe@google.com Link: https://lkml.kernel.org/r/20220706235936.2197195-10-zokeefe@google.com Signed-off-by: Zach O'Keefe Signed-off-by: "Souptick Joarder (HPE)" Suggested-by: David Rientjes Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Signed-off-by: Andrew Morton commit 50722804423680488b8063f6cc9a451333bf6f9b Author: Zach O'Keefe Date: Wed Jul 6 16:59:26 2022 -0700 mm/khugepaged: record SCAN_PMD_MAPPED when scan_pmd() finds hugepage When scanning an anon pmd to see if it's eligible for collapse, return SCAN_PMD_MAPPED if the pmd already maps a hugepage. Note that SCAN_PMD_MAPPED is different from SCAN_PAGE_COMPOUND used in the file-collapse path, since the latter might identify pte-mapped compound pages. This is required by MADV_COLLAPSE which necessarily needs to know what hugepage-aligned/sized regions are already pmd-mapped. In order to determine if a pmd already maps a hugepage, refactor mm_find_pmd(): Return mm_find_pmd() to it's pre-commit f72e7dcdd252 ("mm: let mm_find_pmd fix buggy race with THP fault") behavior. ksm was the only caller that explicitly wanted a pte-mapping pmd, so open code the pte-mapping logic there (pmd_present() and pmd_trans_huge() checks). Undo revert change in commit f72e7dcdd252 ("mm: let mm_find_pmd fix buggy race with THP fault") that open-coded split_huge_pmd_address() pmd lookup and use mm_find_pmd() instead. Link: https://lkml.kernel.org/r/20220706235936.2197195-9-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit a7f4e6e4c47c41869fe5bea17e013b5557c57ed3 Author: Zach O'Keefe Date: Wed Jul 6 16:59:25 2022 -0700 mm/thp: add flag to enforce sysfs THP in hugepage_vma_check() MADV_COLLAPSE is not coupled to the kernel-oriented sysfs THP settings[1]. hugepage_vma_check() is the authority on determining if a VMA is eligible for THP allocation/collapse, and currently enforces the sysfs THP settings. Add a flag to disable these checks. For now, only apply this arg to anon and file, which use /sys/kernel/transparent_hugepage/enabled. We can expand this to shmem, which uses /sys/kernel/transparent_hugepage/shmem_enabled, later. Use this flag in collapse_pte_mapped_thp() where previously the VMA flags passed to hugepage_vma_check() were OR'd with VM_HUGEPAGE to elide the VM_HUGEPAGE check in "madvise" THP mode. Prior to "mm: khugepaged: check THP flag in hugepage_vma_check()", this check also didn't check "never" THP mode. As such, this restores the previous behavior of collapse_pte_mapped_thp() where sysfs THP settings are ignored. See comment in code for justification why this is OK. [1] https://lore.kernel.org/linux-mm/CAAa6QmQxay1_=Pmt8oCX2-Va18t44FV-Vs-WsQt_6+qBks4nZA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220706235936.2197195-8-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit d8ea7cc8547ca3f4962cfd114e4db11128587003 Author: Zach O'Keefe Date: Wed Jul 6 16:59:24 2022 -0700 mm/khugepaged: add flag to predicate khugepaged-only behavior Add .is_khugepaged flag to struct collapse_control so khugepaged-specific behavior can be elided by MADV_COLLAPSE context. Start by protecting khugepaged-specific heuristics by this flag. In MADV_COLLAPSE, the user presumably has reason to believe the collapse will be beneficial and khugepaged heuristics shouldn't prevent the user from doing so: 1) sysfs-controlled knobs khugepaged_max_ptes_[none|swap|shared] 2) requirement that some pages in region being collapsed be young or referenced [zokeefe@google.com: consistently order cc->is_khugepaged and pte_* checks] Link: https://lkml.kernel.org/r/20220720140603.1958773-3-zokeefe@google.com Link: https://lore.kernel.org/linux-mm/Ys2qJm6FaOQcxkha@google.com/ Link: https://lkml.kernel.org/r/20220706235936.2197195-7-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 50ad2f24b3b48c7123e0d61a467baf35875a9ba5 Author: Zach O'Keefe Date: Wed Jul 6 16:59:23 2022 -0700 mm/khugepaged: propagate enum scan_result codes back to callers Propagate enum scan_result codes back through return values of functions downstream of khugepaged_scan_file() and khugepaged_scan_pmd() to inform callers if the operation was successful, and if not, why. Since khugepaged_scan_pmd()'s return value already has a specific meaning (whether mmap_lock was unlocked or not), add a bool* argument to khugepaged_scan_pmd() to retrieve this information. Change khugepaged to take action based on the return values of khugepaged_scan_file() and khugepaged_scan_pmd() instead of acting deep within the collapsing functions themselves. hugepage_vma_revalidate() now returns SCAN_SUCCEED on success to be more consistent with enum scan_result propagation. Remove dependency on error pointers to communicate to khugepaged that allocation failed and it should sleep; instead just use the result of the scan (SCAN_ALLOC_HUGE_PAGE_FAIL if allocation fails). Link: https://lkml.kernel.org/r/20220706235936.2197195-6-zokeefe@google.com Signed-off-by: Zach O'Keefe Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 9710a78ab2aed09690edf34a5c82f5107f448946 Author: Zach O'Keefe Date: Wed Jul 6 16:59:22 2022 -0700 mm/khugepaged: dedup and simplify hugepage alloc and charging The following code is duplicated in collapse_huge_page() and collapse_file(): gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE; new_page = khugepaged_alloc_page(hpage, gfp, node); if (!new_page) { result = SCAN_ALLOC_HUGE_PAGE_FAIL; goto out; } if (unlikely(mem_cgroup_charge(page_folio(new_page), mm, gfp))) { result = SCAN_CGROUP_CHARGE_FAIL; goto out; } count_memcg_page_event(new_page, THP_COLLAPSE_ALLOC); Also, "node" is passed as an argument to both collapse_huge_page() and collapse_file() and obtained the same way, via khugepaged_find_target_node(). Move all this into a new helper, alloc_charge_hpage(), and remove the duplicate code from collapse_huge_page() and collapse_file(). Also, simplify khugepaged_alloc_page() by returning a bool indicating allocation success instead of a copy of the allocated struct page *. Link: https://lkml.kernel.org/r/20220706235936.2197195-5-zokeefe@google.com Signed-off-by: Zach O'Keefe Suggested-by: Peter Xu Acked-by: David Rientjes Reviewed-by: Yang Shi Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 34d6b470ab9cf3a038f9bcd0f8cf09016a2e6fbe Author: Zach O'Keefe Date: Wed Jul 6 16:59:21 2022 -0700 mm/khugepaged: add struct collapse_control Modularize hugepage collapse by introducing struct collapse_control. This structure serves to describe the properties of the requested collapse, as well as serve as a local scratch pad to use during the collapse itself. Start by moving global per-node khugepaged statistics into this new structure. Note that this structure is still statically allocated since CONFIG_NODES_SHIFT might be arbitrary large, and stack-allocating a MAX_NUMNODES-sized array could cause -Wframe-large-than= errors. [zokeefe@google.com: use minimal bits to store num page < HPAGE_PMD_NR] Link: https://lkml.kernel.org/r/20220720140603.1958773-2-zokeefe@google.com Link: https://lore.kernel.org/linux-mm/Ys2CeIm%2FQmQwWh9a@google.com/ [sfr@canb.auug.org.au: fix build] Link: https://lkml.kernel.org/r/20220721195508.15f1e07a@canb.auug.org.au [zokeefe@google.com: fix struct collapse_control load_node definition] Link: https://lore.kernel.org/linux-mm/202209021349.F73i5d6X-lkp@intel.com/ Link: https://lkml.kernel.org/r/20220903021221.1130021-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220706235936.2197195-4-zokeefe@google.com Signed-off-by: Zach O'Keefe Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Hugh Dickins Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Peter Xu Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Yang Shi Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit c6a7f445a2727a66fe68a7097f42698d8b31ea2c Author: Yang Shi Date: Wed Jul 6 16:59:20 2022 -0700 mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA Patch series "mm: userspace hugepage collapse", v7. Introduction -------------------------------- This series provides a mechanism for userspace to induce a collapse of eligible ranges of memory into transparent hugepages in process context, thus permitting users to more tightly control their own hugepage utilization policy at their own expense. This idea was introduced by David Rientjes[5]. Interface -------------------------------- The proposed interface adds a new madvise(2) mode, MADV_COLLAPSE, and leverages the new process_madvise(2) call. process_madvise(2) Performs a synchronous collapse of the native pages mapped by the list of iovecs into transparent hugepages. This operation is independent of the system THP sysfs settings, but attempts to collapse VMAs marked VM_NOHUGEPAGE will still fail. THP allocation may enter direct reclaim and/or compaction. When a range spans multiple VMAs, the semantics of the collapse over of each VMA is independent from the others. Caller must have CAP_SYS_ADMIN if not acting on self. Return value follows existing process_madvise(2) conventions. A “success” indicates that all hugepage-sized/aligned regions covered by the provided range were either successfully collapsed, or were already pmd-mapped THPs. madvise(2) Equivalent to process_madvise(2) on self, with 0 returned on “success”. Current Use-Cases -------------------------------- (1) Immediately back executable text by THPs. Current support provided by CONFIG_READ_ONLY_THP_FOR_FS may take a long time on a large system which might impair services from serving at their full rated load after (re)starting. Tricks like mremap(2)'ing text onto anonymous memory to immediately realize iTLB performance prevents page sharing and demand paging, both of which increase steady state memory footprint. With MADV_COLLAPSE, we get the best of both worlds: Peak upfront performance and lower RAM footprints. Note that subsequent support for file-backed memory is required here. (2) malloc() implementations that manage memory in hugepage-sized chunks, but sometimes subrelease memory back to the system in native-sized chunks via MADV_DONTNEED; zapping the pmd. Later, when the memory is hot, the implementation could madvise(MADV_COLLAPSE) to re-back the memory by THPs to regain hugepage coverage and dTLB performance. TCMalloc is such an implementation that could benefit from this[6]. A prior study of Google internal workloads during evaluation of Temeraire, a hugepage-aware enhancement to TCMalloc, showed that nearly 20% of all cpu cycles were spent in dTLB stalls, and that increasing hugepage coverage by even small amount can help with that[7]. (3) userfaultfd-based live migration of virtual machines satisfy UFFD faults by fetching native-sized pages over the network (to avoid latency of transferring an entire hugepage). However, after guest memory has been fully copied to the new host, MADV_COLLAPSE can be used to immediately increase guest performance. Note that subsequent support for file/shmem-backed memory is required here. (4) HugeTLB high-granularity mapping allows HugeTLB a HugeTLB page to be mapped at different levels in the page tables[8]. As it's not "transparent" like THP, HugeTLB high-granularity mappings require an explicit user API. It is intended that MADV_COLLAPSE be co-opted for this use case[9]. Note that subsequent support for HugeTLB memory is required here. Future work -------------------------------- Only private anonymous memory is supported by this series. File and shmem memory support will be added later. One possible user of this functionality is a userspace agent that attempts to optimize THP utilization system-wide by allocating THPs based on, for example, task priority, task performance requirements, or heatmaps. For the latter, one idea that has already surfaced is using DAMON to identify hot regions, and driving THP collapse through a new DAMOS_COLLAPSE scheme[10]. This patch (of 17): The khugepaged has optimization to reduce huge page allocation calls for !CONFIG_NUMA by carrying the allocated but failed to collapse huge page to the next loop. CONFIG_NUMA doesn't do so since the next loop may try to collapse huge page from a different node, so it doesn't make too much sense to carry it. But when NUMA=n, the huge page is allocated by khugepaged_prealloc_page() before scanning the address space, so it means huge page may be allocated even though there is no suitable range for collapsing. Then the page would be just freed if khugepaged already made enough progress. This could make NUMA=n run have 5 times as much thp_collapse_alloc as NUMA=y run. This problem actually makes things worse due to the way more pointless THP allocations and makes the optimization pointless. This could be fixed by carrying the huge page across scans, but it will complicate the code further and the huge page may be carried indefinitely. But if we take one step back, the optimization itself seems not worth keeping nowadays since: * Not too many users build NUMA=n kernel nowadays even though the kernel is actually running on a non-NUMA machine. Some small devices may run NUMA=n kernel, but I don't think they actually use THP. * Since commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists"), THP could be cached by pcp. This actually somehow does the job done by the optimization. Link: https://lkml.kernel.org/r/20220706235936.2197195-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220706235936.2197195-3-zokeefe@google.com Signed-off-by: Yang Shi Signed-off-by: Zach O'Keefe Co-developed-by: Peter Xu Signed-off-by: Peter Xu Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton commit 61a223df421f698c253143014cfd384255b3cf1e Author: Eric Biggers Date: Fri Aug 26 23:58:51 2022 -0700 xfs: support STATX_DIOALIGN Add support for STATX_DIOALIGN to xfs, so that direct I/O alignment restrictions are exposed to userspace in a generic way. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220827065851.135710-9-ebiggers@kernel.org commit c8c02272a9f74bcba4a930a496b2a0c661873c35 Author: Eric Biggers Date: Fri Aug 26 23:58:50 2022 -0700 f2fs: support STATX_DIOALIGN Add support for STATX_DIOALIGN to f2fs, so that direct I/O alignment restrictions are exposed to userspace in a generic way. Signed-off-by: Eric Biggers Acked-by: Jaegeuk Kim Link: https://lore.kernel.org/r/20220827065851.135710-8-ebiggers@kernel.org commit bd3673293175288d71bce48e46e58e3bcc19829e Author: Eric Biggers Date: Fri Aug 26 23:58:49 2022 -0700 f2fs: simplify f2fs_force_buffered_io() f2fs only allows direct I/O that is aligned to the filesystem block size. Given that fact, simplify f2fs_force_buffered_io() by removing the redundant call to block_unaligned_IO(). This makes it easier to reuse this code for STATX_DIOALIGN. Signed-off-by: Eric Biggers Acked-by: Jaegeuk Kim Link: https://lore.kernel.org/r/20220827065851.135710-7-ebiggers@kernel.org commit 2db0487faa2114729d3ae7a423febbba919fee8a Author: Eric Biggers Date: Fri Aug 26 23:58:48 2022 -0700 f2fs: move f2fs_force_buffered_io() into file.c f2fs_force_buffered_io() is only used in file.c, so move it into there. No behavior change. This makes it easier to review later patches. Signed-off-by: Eric Biggers Acked-by: Jaegeuk Kim Link: https://lore.kernel.org/r/20220827065851.135710-6-ebiggers@kernel.org commit 8434ef1d8aafc523443525bbc6237a07d7ec5606 Author: Eric Biggers Date: Fri Aug 26 23:58:47 2022 -0700 ext4: support STATX_DIOALIGN Add support for STATX_DIOALIGN to ext4, so that direct I/O alignment restrictions are exposed to userspace in a generic way. Acked-by: Theodore Ts'o Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220827065851.135710-5-ebiggers@kernel.org commit 53dd3f802a6e269868cb599609287a841e65a996 Author: Eric Biggers Date: Fri Aug 26 23:58:46 2022 -0700 fscrypt: change fscrypt_dio_supported() to prepare for STATX_DIOALIGN To prepare for STATX_DIOALIGN support, make two changes to fscrypt_dio_supported(). First, remove the filesystem-block-alignment check and make the filesystems handle it instead. It previously made sense to have it in fs/crypto/; however, to support STATX_DIOALIGN the alignment restriction would have to be returned to filesystems. It ends up being simpler if filesystems handle this part themselves, especially for f2fs which only allows fs-block-aligned DIO in the first place. Second, make fscrypt_dio_supported() work on inodes whose encryption key hasn't been set up yet, by making it set up the key if needed. This is required for statx(), since statx() doesn't require a file descriptor. Reviewed-by: Christoph Hellwig Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220827065851.135710-4-ebiggers@kernel.org commit 2d985f8c6b91b5007a16e640bb9c038c5fb2839b Author: Eric Biggers Date: Fri Aug 26 23:58:45 2022 -0700 vfs: support STATX_DIOALIGN on block devices Add support for STATX_DIOALIGN to block devices, so that direct I/O alignment restrictions are exposed to userspace in a generic way. Note that this breaks the tradition of stat operating only on the block device node, not the block device itself. However, it was felt that doing this is preferable, in order to make the interface useful and avoid needing separate interfaces for regular files and block devices. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220827065851.135710-3-ebiggers@kernel.org commit 825cf206ed510c4a1758bef8957e2b039253e2e3 Author: Eric Biggers Date: Fri Aug 26 23:58:44 2022 -0700 statx: add direct I/O alignment information Traditionally, the conditions for when DIO (direct I/O) is supported were fairly simple. For both block devices and regular files, DIO had to be aligned to the logical block size of the block device. However, due to filesystem features that have been added over time (e.g. multi-device support, data journalling, inline data, encryption, verity, compression, checkpoint disabling, log-structured mode), the conditions for when DIO is allowed on a regular file have gotten increasingly complex. Whether a particular regular file supports DIO, and with what alignment, can depend on various file attributes and filesystem mount options, as well as which block device(s) the file's data is located on. Moreover, the general rule of DIO needing to be aligned to the block device's logical block size was recently relaxed to allow user buffers (but not file offsets) aligned to the DMA alignment instead. See commit bf8d08532bc1 ("iomap: add support for dma aligned direct-io"). XFS has an ioctl XFS_IOC_DIOINFO that exposes DIO alignment information. Uplifting this to the VFS is one possibility. However, as discussed (https://lore.kernel.org/linux-fsdevel/20220120071215.123274-1-ebiggers@kernel.org/T/#u), this ioctl is rarely used and not known to be used outside of XFS-specific code. It was also never intended to indicate when a file doesn't support DIO at all, nor was it intended for block devices. Therefore, let's expose this information via statx(). Add the STATX_DIOALIGN flag and two new statx fields associated with it: * stx_dio_mem_align: the alignment (in bytes) required for user memory buffers for DIO, or 0 if DIO is not supported on the file. * stx_dio_offset_align: the alignment (in bytes) required for file offsets and I/O segment lengths for DIO, or 0 if DIO is not supported on the file. This will only be nonzero if stx_dio_mem_align is nonzero, and vice versa. Note that as with other statx() extensions, if STATX_DIOALIGN isn't set in the returned statx struct, then these new fields won't be filled in. This will happen if the file is neither a regular file nor a block device, or if the file is a regular file and the filesystem doesn't support STATX_DIOALIGN. It might also happen if the caller didn't include STATX_DIOALIGN in the request mask, since statx() isn't required to return unrequested information. This commit only adds the VFS-level plumbing for STATX_DIOALIGN. For regular files, individual filesystems will still need to add code to support it. For block devices, a separate commit will wire it up too. Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Martin K. Petersen Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220827065851.135710-2-ebiggers@kernel.org commit 83e5335bf58b090b1fc0b30cb1a1fedf07f0c217 Author: Johan Jonker Date: Sun Sep 11 19:58:39 2022 +0200 spi: rockchip: add power-domains property The Rockchip rk3399 TRM mentions that pd_sdioaudio includes sdio, spi, i2s and spdif. Add a power-domains property to to match reality with spi-rockchip.yaml. Signed-off-by: Johan Jonker Acked-by: Heiko Stuebner Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/12af4fe6-4d35-cb4a-f5f6-06e3aba990cb@gmail.com Signed-off-by: Mark Brown commit f52c4d5f0bb486bc515b5f8a56130aea69fb29db Author: Ben Dooks Date: Thu Jul 21 22:01:20 2022 +0100 power: supply: bq27xxx: fix NULL vs 0 warnings The driver has a lot of sparse warnings for using 0 as a NULL pointer when NULL would be appropriate. Change the 0 values to NULL to fix the warnings, some of which are shown here: drivers/power/supply/bq27xxx_battery.c:984:23: warning: Using plain integer as NULL pointer drivers/power/supply/bq27xxx_battery.c:985:23: warning: Using plain integer as NULL pointer drivers/power/supply/bq27xxx_battery.c:986:23: warning: Using plain integer as NULL pointer drivers/power/supply/bq27xxx_battery.c:987:23: warning: Using plain integer as NULL pointer drivers/power/supply/bq27xxx_battery.c:988:23: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks Signed-off-by: Sebastian Reichel commit 569581a21ff57f43dbe900b2f578c0ec3b0018ba Author: Ben Dooks Date: Thu Jul 21 22:07:35 2022 +0100 power: supply: bq27xxx: fix __be16 warnings The bq27xxx_dm_reg_ptr() should return a __be16 as the result is being passed to be16_to_cpup() to convert to the proper cpu endian value. Move to using __be16 as appropriate to fix the following sparse warnings: drivers/power/supply/bq27xxx_battery.c:1293:26: warning: incorrect type in argument 1 (different base types) drivers/power/supply/bq27xxx_battery.c:1293:26: expected restricted __be16 const [usertype] *p drivers/power/supply/bq27xxx_battery.c:1293:26: got unsigned short [usertype] *prev drivers/power/supply/bq27xxx_battery.c:1304:17: warning: incorrect type in argument 1 (different base types) drivers/power/supply/bq27xxx_battery.c:1304:17: expected restricted __be16 const [usertype] *p drivers/power/supply/bq27xxx_battery.c:1304:17: got unsigned short [usertype] *prev drivers/power/supply/bq27xxx_battery.c:1316:15: warning: incorrect type in assignment (different base types) drivers/power/supply/bq27xxx_battery.c:1316:15: expected unsigned short [usertype] drivers/power/supply/bq27xxx_battery.c:1316:15: got restricted __be16 [usertype] Signed-off-by: Ben Dooks Signed-off-by: Sebastian Reichel commit 4a4748f28b0b2547de745ed929e929a9b45563f1 Author: Marek Vasut Date: Mon Aug 1 04:57:27 2022 +0200 power: supply: bq25890: Add support for setting IINLIM Let user set input current limit via sysfs. This is useful in case there are multiple chargers connected to the device, each of which with its own arbitrary maximum current which it can provide, some of which may provide more than the default 500mA. In that case, userspace can listen for plug events generated by each charger and adjust the current limit accordingly, e.g. to permit battery to charge faster. Note that the IINLIM is reset every time the bq25890 is disconnected from a charger, so the userspace must adjust the limit repeatly on every plug event. Signed-off-by: Marek Vasut Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 04f7c7df96de7a2e9a72e53e8082754b13495813 Author: Hans de Goede Date: Sun Jul 31 12:02:28 2022 +0200 power: supply: bq25890: Disable PUMPX_EN on errors When bq25890_pump_express_work encounters an errors disable the PUMPX_EN flag, just like the work does on a successful exit. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 89b03aeaef16f8ab48c10c399f97c836bdbae838 Author: Melissa Wen Date: Sat Sep 10 18:03:03 2022 -0100 drm/vkms: fix 32bit compilation error by replacing macros Replace vkms_formats macro for fixed-point operations with functions from drm/drm_fixed.h to do the same job and fix 32-bit compilation errors. v2: - don't cast results to s32 (Igor) - add missing drm_fixp2int conversion (Igor) Fixes: a19c2ac9858 ("drm: vkms: Add support to the RGB565 format") Tested-by: Sudip Mukherjee (v1) Reviewed-by: Alex Deucher (v1) Reported-by: Sudip Mukherjee Reported-by: kernel test robot Signed-off-by: Melissa Wen Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20220910190303.682897-1-mwen@igalia.com commit 5ae6134ef380e4cbb50ab8d606a10b880a61c5c5 Author: Jules Maselbas Date: Fri Aug 26 12:00:45 2022 +0200 power: supply: Fix repeated word in comments Remove redundant word `the`. Signed-off-by: Jules Maselbas Signed-off-by: Sebastian Reichel commit fb34d8a04e5876552cd0d4f9e14400ee13f116fb Merge: 8284bae723f02 5d832b6694e09 Author: Dave Airlie Date: Sun Sep 11 21:46:57 2022 +1000 Merge tag 'drm-misc-next-2022-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.1-rc1: [airlied - fix sun4i_tv build] UAPI Changes: - Hide unregistered connectors from GETCONNECTOR ioctl. - drm/virtio no longer advertises LINEAR modifier, as it doesn't work. - Cross-subsystem Changes: - Fix GPF in udmabuf failure path. Core Changes: - Rework TTM placement to use intersect/compatible functions. - Drop legacy DP-MST support. - More DP-MST related fixes, and move all state into atomic. - Make DRM_MIPI_DBI select DRM_KMS_HELPER. - Add audio_infoframe packing for DP. - Add logging when some atomic check functions fail. - Assorted documentation updates and fixes. Driver Changes: - Assorted cleanups and fixes in msm, lcdif, nouveau, virtio, panel/ilitek, bridge/icn6211, tve200, gma500, bridge/*, panfrost, via, bochs, qxl, sun4i. - Add add AUO B133UAN02.1, IVO M133NW4J-R3, Innolux N120ACA-EA1 eDP panels. - Improve DP-MST modeset state handling in amdgpu, nouveau, i915. - Drop DP-MST from radeon driver, it was broken and only user of legacy DP-MST. - Handle unplugging better in vc4. - Simplify drm cmdparser tests. - Add DP support to ti-sn65dsi86. - Add MT8195 DP support to mediatek. - Support RGB565, XRGB64, and ARGB64 formats in vkms. - Convert sun4i tv support to atomic. - Refactor vc4/vec TV Modesetting, and fix timings. - Use atomic helpers instead of simple display helpers in ssd130x. Maintainer changes: - Add Douglas Anderson as reviewer for panel-edp. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/a489485b-3ebc-c734-0f80-aed963d89efe@linux.intel.com commit 9634b371b66a270821ed8d4d224ef19e9b842507 Author: Gaosheng Cui Date: Sun Sep 11 17:42:55 2022 +0800 staging: wlan-ng: remove unused p80211wext_handler_def declaration p80211wext_handler_def has been removed since commit cb3126e60ffc ("Staging: wlan-ng: Switch from wext to cfg80211"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220911094255.3225461-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 4dd8298f9fcf4861cc147f95456231bff294f7bc Author: Philipp Hortmann Date: Sun Sep 11 12:47:29 2022 +0200 staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx Rename function MACvSetCurrAC0DescAddrEx to vt6655_mac_set_curr_ac_0... to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/dc3f83dfa8b83a02ed95da3cfb71c0139ba8b674.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 29b74e707595d4d8254ff2ad046bc3440290c344 Author: Philipp Hortmann Date: Sun Sep 11 12:47:22 2022 +0200 staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx Rename function MACvSetCurrTx0DescAddrEx to vt6655_mac_set_curr_tx_0_... to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4337deed83e1443ebf93c5591e17f5c6dfe0cf55.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8bd2a9f16f6f3891c7e9c1affdd98aff4bfd6a2b Author: Philipp Hortmann Date: Sun Sep 11 12:47:15 2022 +0200 staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr Rename function MACvSetCurrTXDescAddr to vt6655_mac_set_curr_tx_desc_addr and iTxType to tx_type to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/88dcbac76f6bad8b4eb68a3cb37cd4f9684294a0.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b5e0bd41a0876478b13a05e2cb6ac7195770dbff Author: Philipp Hortmann Date: Sun Sep 11 12:47:07 2022 +0200 staging: vt6655: Rename function MACvSetCurrRx1DescAddr Rename function MACvSetCurrRx1DescAddr to vt6655_mac_set_curr_rx_1_desc... to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0d11f588d4746988478521d323ab49e6a0b7f8b0.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 253fa9b5051b87be4ecec2e4fdd4efc08fb5fb61 Author: Philipp Hortmann Date: Sun Sep 11 12:46:57 2022 +0200 staging: vt6655: Rename function MACvSetCurrRx0DescAddr Rename function MACvSetCurrRx0DescAddr to vt6655_mac_set_curr_rx_0_desc... to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/14f7f2b06ba9f8656d91d4cb84c363e190095049.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1870c16146cbb382cd5a726e4bebc92dd9ccbfd7 Author: Philipp Hortmann Date: Sun Sep 11 12:46:35 2022 +0200 staging: vt6655: Rename function MACbSafeStop Rename function MACbSafeStop to vt6655_mac_safe_stop to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5c91b281dfab75e5ccf13413232ec993a8056af8.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 481602794cfa26058cffb602e90c0304dcd6c647 Author: Philipp Hortmann Date: Sun Sep 11 12:46:23 2022 +0200 staging: vt6655: Rename function MACbSafeTxOff Rename function MACbSafeTxOff to vt6655_mac_safe_tx_off to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/50211bbdd866be93fe9ea912a433e56460bf7f28.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit de8a86a1ff9b64510bf59c3c1608740633762bba Author: Philipp Hortmann Date: Sun Sep 11 12:46:15 2022 +0200 staging: vt6655: Rename function MACbSafeRxOff Rename function MACbSafeRxOff to vt6655_mac_safe_rx_off to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0cbcc7205e943393e2873839116d5ffcfb9d3d00.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0c59cbbb598418c3cff41432a70450b58b1c7794 Author: Philipp Hortmann Date: Sun Sep 11 12:46:04 2022 +0200 staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Rename function MACbSafeSoftwareReset to vt6655_mac_save_soft_reset and abyTmpRegData to tmp_reg_data to avoid CamelCase which is not accepted by checkpatch.pl. Remove return value bRetVal as it is unused by the calling functions. Remove unnecessary declaration of function and make function static. Change declaration of tmp_reg_data to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/540a684266610f7618b3ef6000d4699d065c8e6f.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4ecaa734c5e926afc597121459cda6f68526dffb Author: Philipp Hortmann Date: Sun Sep 11 12:45:53 2022 +0200 staging: vt6655: Cleanup and rename function MACvRestoreContext Rename function MACvRestoreContext to vt6655_mac_restore_context to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Change declaration of cxt_buf to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3d215bbf1675fd093c9b31fbf3b29ce09432ab27.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e134ca308f8955b00c1c0bd699f6dd7ea50f571 Author: Philipp Hortmann Date: Sun Sep 11 12:45:42 2022 +0200 staging: vt6655: Cleanup and rename function MACvSaveContext Rename function MACvSaveContext to vt6655_mac_save_context to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and make function static. Change declaration of cxt_buf to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f514711695f1eafde9996edcc246da2adcd5f9c5.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit aef69630f2c71de6079db4b91fdf7bc100824f63 Author: Philipp Hortmann Date: Sun Sep 11 12:45:29 2022 +0200 staging: vt6655: Cleanup and rename function MACvSetLoopbackMode Rename function MACvSetLoopbackMode to vt6655_mac_set_loopback_mode and byLoopbackMode to loopback_mode to avoid CamelCase which is not accepted by checkpatch.pl. Remove unnecessary declaration of function and made function static. Change declaration of loopback_mode to shorten code and remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/02ce61620e13eb7fd24833e59a288f52bf5b9730.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 98bbc153131c7621b26a82b65a9a48a06b8013bd Author: Philipp Hortmann Date: Fri Sep 9 21:22:14 2022 +0200 staging: rtl8192e: Rename CurSlotTime Rename variable CurSlotTime to cur_slot_time to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/1b71366d87b2b178fcd8f182127a51c7a7507936.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 007314000c8adeb8e12b4d554534f9664459c5f5 Author: Philipp Hortmann Date: Fri Sep 9 21:22:05 2022 +0200 staging: rtl8192e: Rename bHwRadioOff Rename variable bHwRadioOff to hw_radio_off to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bb977791e835310e51e9c38cc5c547e0b8a35e0c.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 43c64c0655e082633829aa9ead27f33e8ca94c82 Author: Philipp Hortmann Date: Fri Sep 9 21:21:56 2022 +0200 staging: rtl8192e: Rename RFChangeInProgress Rename variable RFChangeInProgress to rf_change_in_progress to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/29739986e76750395941ddaa6c4f0ffab6eb26a9.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit e13a47bef29a843147b50e417a2782a3c5ebf90c Author: Philipp Hortmann Date: Fri Sep 9 21:21:46 2022 +0200 staging: rtl8192e: Rename RFWaitCounter Rename variable RFWaitCounter to rf_wait_counter to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/11acf28a0b9f56dde4fa4fbd74a085cf2fa1c20d.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fa8916e245a2ec322f9fd1195c197b26a484387 Author: Philipp Hortmann Date: Fri Sep 9 21:21:35 2022 +0200 staging: rtl8192e: Rename rtState Rename variable rtState to rt_state to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e888fa7e6edaa68e741236ea012f8230f6817882.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 142509f66bfabb234ccceecd99c2efac0349b91e Author: Philipp Hortmann Date: Fri Sep 9 21:21:20 2022 +0200 staging: rtl8192e: Rename bConnectBySSID Rename variable bConnectBySSID to connect_by_ssid to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2b193be93598348994b1f890b6dc5c2ffb84a9b6.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a2574a32c343d3accf1c65abaeb8928e1ae241a6 Author: Philipp Hortmann Date: Fri Sep 9 21:21:11 2022 +0200 staging: rtl8192e: Rename bActionAllowed Rename variable bActionAllowed to action_allowed to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e8b617ab58c360bb485cb51d080a8ef81cd47869.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 45b90cb0402e9a7ce7b1b89a51de145fcf2ab5af Author: Philipp Hortmann Date: Fri Sep 9 21:21:03 2022 +0200 staging: rtl8192e: Rename ChangeSource Rename variable ChangeSource to change_source to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0d934bb707510692ccd161ea6034b69133aac14c.1662402870.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2cf4038500e9a9a217050cfc02e4be4618e0d783 Author: Martin Kaiser Date: Sat Sep 10 20:02:36 2022 +0200 staging: r8188eu: rtw_is_scan_deny is always false The rtw_is_scan_deny macro returns false. Remove the macro and resulting dead code. Tested-by: Philipp Hortmann # Edimax N150 Acked-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220910180236.489808-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit dd7801b11bbb00c5e700c737b915f768aa7e8c47 Author: Martin Kaiser Date: Sat Sep 10 20:02:35 2022 +0200 staging: r8188eu: remove rtw_clear_scan_deny The rtw_clear_scan_deny macro is empty. Remove it. Tested-by: Philipp Hortmann # Edimax N150 Acked-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220910180236.489808-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 10c279e1af1e668311dd9e7e4b5420697de79f30 Author: Martin Kaiser Date: Sat Sep 10 20:02:34 2022 +0200 staging: r8188eu: remove rtw_set_scan_deny_timer_hdl Remove the rtw_set_scan_deny_timer_hdl macro, it's not used. Tested-by: Philipp Hortmann # Edimax N150 Acked-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220910180236.489808-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f38bc0416f6bf45321d045d7412f06571ba39473 Author: Martin Kaiser Date: Sat Sep 10 20:02:33 2022 +0200 staging: r8188eu: remove empty rtw_set_scan_deny macro The rtw_set_scan_deny macro does nothing. Remove it. Tested-by: Philipp Hortmann # Edimax N150 Acked-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220910180236.489808-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c8ff91535880d41b49699b3829fb6151942de29e Author: Nam Cao Date: Fri Sep 9 16:13:39 2022 +0200 staging: vt6655: fix potential memory leak In function device_init_td0_ring, memory is allocated for member td_info of priv->apTD0Rings[i], with i increasing from 0. In case of allocation failure, the memory is freed in reversed order, with i decreasing to 0. However, the case i=0 is left out and thus memory is leaked. Modify the memory freeing loop to include the case i=0. Tested-by: Philipp Hortmann Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20220909141338.19343-1-namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit dfa71c493fa12a5099fae687b767108360a93b3e Author: Michael Straube Date: Fri Sep 9 12:02:32 2022 +0200 staging: r8188eu: make c2h_evt_read() static The function c2h_evt_read() is only used in rtw_cmd.c. Make it static. This addresses the TODO item: * Remove the HAL layer and migrate its functionality into the relevant parts of the driver. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220909100232.8305-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9ca57c63fa0600b1bfdcc4996f2b5795339da7ce Author: Nam Cao Date: Fri Sep 9 12:06:51 2022 +0200 staging: vt6655: remove unnecessary null check Remove null check for priv->tx0_bufs, because it can never be null at this point. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20220909100650.44609-1-namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit d42d6f5a5fcd734669e75867c632e724f1dc3552 Author: Gaosheng Cui Date: Sun Sep 11 17:40:38 2022 +0800 EDAC: Remove obsolete declarations in edac_module.h Commit 4de78c6877ec ("drivers/edac: mod PCI poll names"), renamed the respective variables and accessors but left the old accessor declarations edac_get_log_ce(), edac_get_log_ue(), edac_get_poll_msec() and edac_get_panic_on_ue() in place. Remove them. [ bp: Masssage commit message. ] Signed-off-by: Gaosheng Cui Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220911094038.3224365-1-cuigaosheng1@huawei.com commit e568252d722d70bcb3e903477e46f5024138f8ca Author: Wei Yongjun Date: Sat Aug 27 07:32:24 2022 +0000 power: supply: adp5061: show unknown capacity_level as text adp5061_get_battery_status() only defined show chg_status <= 4, others will be show as '-1731902199' from /sys/class/power_supply/xx/capacity_level. switch to show them as 'Unknown'. Signed-off-by: Wei Yongjun Acked-by: Michael Hennerich Signed-off-by: Sebastian Reichel commit 9d47e01b9d807808224347935562f7043a358054 Author: Wei Yongjun Date: Sat Aug 27 07:32:23 2022 +0000 power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type() ADP5061_CHG_STATUS_1_CHG_STATUS is masked with 0x07, which means a length of 8, but adp5061_chg_type array size is 4, may end up reading 4 elements beyond the end of the adp5061_chg_type[] array. Signed-off-by: Wei Yongjun Acked-by: Michael Hennerich Signed-off-by: Sebastian Reichel commit 3eb7508d0bad13c2c4272fe30adfb02190294290 Author: Shaomin Deng Date: Wed Aug 31 11:49:05 2022 -0400 power: supply: tps65217: Fix comments typo Delete the unneeded word "the" in comments. Signed-off-by: Shaomin Deng Signed-off-by: Sebastian Reichel commit 955d095a72f0ff55f6e74c8b42fa64611b0ac6cd Author: Anjelique Melendez Date: Fri Sep 9 13:42:10 2022 -0700 power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string Add support for the new "qcom,pmk8350-pon" comptaible string. Signed-off-by: Anjelique Melendez Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 03fccdc76dce9674d100797387d73b7af6d5e64f Author: David Collins Date: Fri Sep 9 13:42:09 2022 -0700 dt-bindings: power: reset: qcom-pon: Add new compatible "qcom,pmk8350-pon" Add a new compatible string "qcom,pmk8350-pon" for GEN3 PMIC PON peripherals and update "reg" property. Also, Add an optional "reg-names" property to differentiate between GEN1/GEN2 and GEN3 peripherals. GEN1/GEN2 peripherals only need one register address to be specified (e.g. "pon") whereas GEN3 peripherals can have two register addresses specified ("hlos", "pbs"). Signed-off-by: David Collins Signed-off-by: Anjelique Melendez Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 0cb172a4918e0b180400c3e1b2894641703eab6d Author: Zheyu Ma Date: Sun Jul 17 10:58:20 2022 +0800 power: supply: cw2015: Use device managed API to simplify the code Use devm_delayed_work_autocancel() instead of the INIT_DELAYED_WORK() to remove the cw_bat_remove() function. And power_supply_put_battery_info() can also be removed because the power_supply_get_battery_info() uses device managed memory allocation. Signed-off-by: Zheyu Ma Signed-off-by: Sebastian Reichel commit da7dc6a7a95ef00ff38e7c1873efa79bfec93de4 Author: wangjianli Date: Sun Aug 21 22:49:42 2022 +0800 power: supply: cpcap-charger: fix repeated words in comments Delete the redundant word 'on'. Signed-off-by: wangjianli Signed-off-by: Sebastian Reichel commit a1c7c1a40478db4edef8ad0a0c6975c8921088b7 Author: Linus Walleij Date: Tue Jul 19 13:41:31 2022 +0200 power: supply: Explain maintenance charging In order for everyone to understand clearly why we want to use maintenance charging for batteries, expand the description with two diagrams and some text. Signed-off-by: Linus Walleij Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel commit 562d0bf2cab80810fa50a1f109a6bdb61c25efc2 Author: Russ Weight Date: Fri Sep 2 09:57:06 2022 -0700 fpga: m10bmc-sec: d5005 bmc secure update driver Add a driver name for the D5005 BMC secure update driver. Different driver names are used for the N3000 and D5005 devices because future changes will add conditional code based on the device type (N3000 vs D5005). This change enables D5005 secure updates of BCM images, BMC firmware, static-region images, etc. Signed-off-by: Russ Weight Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20220902165706.518074-3-russell.h.weight@intel.com Signed-off-by: Xu Yilun commit 1bfe26fb082724be453e4d7fd9bb358e3ba669b2 Author: Dave Marchevsky Date: Thu Sep 8 16:07:16 2022 -0700 bpf: Add verifier support for custom callback return range Verifier logic to confirm that a callback function returns 0 or 1 was added in commit 69c087ba6225b ("bpf: Add bpf_for_each_map_elem() helper"). At the time, callback return value was only used to continue or stop iteration. In order to support callbacks with a broader return value range, such as those added in rbtree series[0] and others, add a callback_ret_range to bpf_func_state. Verifier's helpers which set in_callback_fn will also set the new field, which the verifier will later use to check return value bounds. Default to tnum_range(0, 0) instead of using tnum_unknown as a sentinel value as the latter would prevent the valid range (0, U64_MAX) being used. Previous global default tnum_range(0, 1) is explicitly set for extant callback helpers. The change to global default was made after discussion around this patch in rbtree series [1], goal here is to make it more obvious that callback_ret_range should be explicitly set. [0]: lore.kernel.org/bpf/20220830172759.4069786-1-davemarchevsky@fb.com/ [1]: lore.kernel.org/bpf/20220830172759.4069786-2-davemarchevsky@fb.com/ Signed-off-by: Dave Marchevsky Reviewed-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20220908230716.2751723-1-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit a37a32583e282d8d815e22add29bc1e91e19951a Author: Lorenz Bauer Date: Sat Sep 10 11:01:20 2022 +0000 bpf: btf: fix truncated last_member_type_id in btf_struct_resolve When trying to finish resolving a struct member, btf_struct_resolve saves the member type id in a u16 temporary variable. This truncates the 32 bit type id value if it exceeds UINT16_MAX. As a result, structs that have members with type ids > UINT16_MAX and which need resolution will fail with a message like this: [67414] STRUCT ff_device size=120 vlen=12 effect_owners type_id=67434 bits_offset=960 Member exceeds struct_size Fix this by changing the type of last_member_type_id to u32. Fixes: a0791f0df7d2 ("bpf: fix BTF limits") Reviewed-by: Stanislav Fomichev Signed-off-by: Lorenz Bauer Link: https://lore.kernel.org/r/20220910110120.339242-1-oss@lmb.io Signed-off-by: Alexei Starovoitov commit f7c946f288e32fd8b5fd69825683420d473672bd Author: Lorenzo Bianconi Date: Thu Sep 8 10:06:12 2022 +0200 selftests/bpf: fix ct status check in bpf_nf selftests Check properly the connection tracking entry status configured running bpf_ct_change_status kfunc. Remove unnecessary IPS_CONFIRMED status configuration since it is already done during entry allocation. Fixes: 6eb7fba007a7 ("selftests/bpf: Add tests for new nf_conntrack kfuncs") Signed-off-by: Lorenzo Bianconi Acked-by: Song Liu Link: https://lore.kernel.org/r/813a5161a71911378dfac8770ec890428e4998aa.1662623574.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov commit b8c62fe2025af081ea738a615c58d79d815f260f Merge: 57c92f11a2157 e2d75e954c0a2 Author: Alexei Starovoitov Date: Sat Sep 10 17:27:33 2022 -0700 Merge branch 'Support direct writes to nf_conn:mark' Daniel Xu says: ==================== Support direct writes to nf_conn:mark from TC and XDP prog types. This is useful when applications want to store per-connection metadata. This is also particularly useful for applications that run both bpf and iptables/nftables because the latter can trivially access this metadata. One example use case would be if a bpf prog is responsible for advanced packet classification and iptables/nftables is later used for routing due to pre-existing/legacy code. Past discussion: - v4: https://lore.kernel.org/bpf/cover.1661192455.git.dxu@dxuuu.xyz/ - v3: https://lore.kernel.org/bpf/cover.1660951028.git.dxu@dxuuu.xyz/ - v2: https://lore.kernel.org/bpf/CAP01T74Sgn354dXGiFWFryu4vg+o8b9s9La1d9zEbC4LGvH4qg@mail.gmail.com/T/ - v1: https://lore.kernel.org/bpf/cover.1660592020.git.dxu@dxuuu.xyz/ Changes since v4: - Use exported function pointer + mutex to handle CONFIG_NF_CONNTRACK=m case Changes since v3: - Use a mutex to protect module load/unload critical section Changes since v2: - Remove use of NOT_INIT for btf_struct_access write path - Disallow nf_conn writing when nf_conntrack module not loaded - Support writing to nf_conn___init:mark Changes since v1: - Add unimplemented stub for when !CONFIG_BPF_SYSCALL ==================== Signed-off-by: Alexei Starovoitov commit e2d75e954c0a277b8fa0ddf666ddd4f9b73195f7 Author: Daniel Xu Date: Wed Sep 7 10:40:41 2022 -0600 selftests/bpf: Add tests for writing to nf_conn:mark Add a simple extension to the existing selftest to write to nf_conn:mark. Also add a failure test for writing to unsupported field. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/f78966b81b9349d2b8ebb4cee2caf15cb6b38ee2.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit 864b656f82ccd433d3e38149c3673d295ad64bf6 Author: Daniel Xu Date: Wed Sep 7 10:40:40 2022 -0600 bpf: Add support for writing to nf_conn:mark Support direct writes to nf_conn:mark from TC and XDP prog types. This is useful when applications want to store per-connection metadata. This is also particularly useful for applications that run both bpf and iptables/nftables because the latter can trivially access this metadata. One example use case would be if a bpf prog is responsible for advanced packet classification and iptables/nftables is later used for routing due to pre-existing/legacy code. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/ebca06dea366e3e7e861c12f375a548cc4c61108.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit 84c6ac417ceacd086efc330afece8922969610b7 Author: Daniel Xu Date: Wed Sep 7 10:40:39 2022 -0600 bpf: Export btf_type_by_id() and bpf_log() These symbols will be used in nf_conntrack.ko to support direct writes to `nf_conn`. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/3c98c19dc50d3b18ea5eca135b4fc3a5db036060.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit 896f07c07da01aa7cee820a23c2bce1d8e9fe1e6 Author: Daniel Xu Date: Wed Sep 7 10:40:38 2022 -0600 bpf: Use 0 instead of NOT_INIT for btf_struct_access() writes Returning a bpf_reg_type only makes sense in the context of a BPF_READ. For writes, prefer to explicitly return 0 for clarity. Note that is non-functional change as it just so happened that NOT_INIT == 0. Signed-off-by: Daniel Xu Link: https://lore.kernel.org/r/01772bc1455ae16600796ac78c6cc9fff34f95ff.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit d4f7bdb2ed7bf320a8772258fdc257655d225afb Author: Daniel Xu Date: Wed Sep 7 10:40:37 2022 -0600 bpf: Add stub for btf_struct_access() Add corresponding unimplemented stub for when CONFIG_BPF_SYSCALL=n Signed-off-by: Daniel Xu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/4021398e884433b1fef57a4d28361bb9fcf1bd05.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit 65269888c695cf4643c6fdb989ea28bf1623685d Author: Daniel Xu Date: Wed Sep 7 10:40:36 2022 -0600 bpf: Remove duplicate PTR_TO_BTF_ID RO check Since commit 27ae7997a661 ("bpf: Introduce BPF_PROG_TYPE_STRUCT_OPS") there has existed bpf_verifier_ops:btf_struct_access. When btf_struct_access is _unset_ for a prog type, the verifier runs the default implementation, which is to enforce read only: if (env->ops->btf_struct_access) { [...] } else { if (atype != BPF_READ) { verbose(env, "only read is supported\n"); return -EACCES; } [...] } When btf_struct_access is _set_, the expectation is that btf_struct_access has full control over accesses, including if writes are allowed. Rather than carve out an exception for each prog type that may write to BTF ptrs, delete the redundant check and give full control to btf_struct_access. Signed-off-by: Daniel Xu Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/962da2bff1238746589e332ff1aecc49403cd7ce.1662568410.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov commit 57c92f11a215717bf90880828b7a23c736c3c0d9 Author: Punit Agrawal Date: Wed Sep 7 16:57:46 2022 +0100 bpf: Simplify code by using for_each_cpu_wrap() In the percpu freelist code, it is a common pattern to iterate over the possible CPUs mask starting with the current CPU. The pattern is implemented using a hand rolled while loop with the loop variable increment being open-coded. Simplify the code by using for_each_cpu_wrap() helper to iterate over the possible cpus starting with the current CPU. As a result, some of the special-casing in the loop also gets simplified. No functional change intended. Signed-off-by: Punit Agrawal Acked-by: Song Liu Link: https://lore.kernel.org/r/20220907155746.1750329-1-punit.agrawal@bytedance.com Signed-off-by: Alexei Starovoitov commit cf7de6a53600ea554a8358e44fbcf47b449235f9 Author: Tetsuo Handa Date: Sun Sep 11 00:07:11 2022 +0900 bpf: add missing percpu_counter_destroy() in htab_map_alloc() syzbot is reporting ODEBUG bug in htab_map_alloc() [1], for commit 86fe28f7692d96d2 ("bpf: Optimize element count in non-preallocated hash map.") added percpu_counter_init() to htab_map_alloc() but forgot to add percpu_counter_destroy() to the error path. Link: https://syzkaller.appspot.com/bug?extid=5d1da78b375c3b5e6c2b [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 86fe28f7692d96d2 ("bpf: Optimize element count in non-preallocated hash map.") Reviewed-by: Stanislav Fomichev Link: https://lore.kernel.org/r/e2e4cc0e-9d36-4ca1-9bfa-ce23e6f8310b@I-love.SAKURA.ne.jp Signed-off-by: Alexei Starovoitov commit aaa65520280e96dc47fa5065b74bddff30279abe Author: Harshit Mogalapalli Date: Thu Sep 8 03:56:23 2022 -0700 drm/vkms: fix variable dereferenced before check warning Smatch warns: drivers/gpu/drm/vkms/vkms_plane.c:110 vkms_plane_atomic_update() warn: variable dereferenced before check 'fb' (see line 108) Fix the warning by moving the dereference after the NULL check. Fixes: 8ba1648567e2 ("drm: vkms: Refactor the plane composer to accept new formats") Signed-off-by: Harshit Mogalapalli Reviewed-by: Melissa Wen Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220908105623.72777-1-harshit.m.mogalapalli@oracle.com commit fa47573b04a35078953be5f81a78f22c96358817 Author: Takashi Iwai Date: Thu Sep 8 11:51:15 2022 +0200 drm/udl: Sync pending URBs at the end of suspend It's better to perform the sync at the very last of the suspend instead of the pipe-disable function, so that we can catch all pending URBs (if any). While we're at it, drop the error code from udl_sync_pending_urb() since we basically ignore it; instead, give a clear error message indicating a problem. Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-13-tiwai@suse.de commit 2c2705bd09730dba6017b26897a2bcd3c5d21557 Author: Takashi Iwai Date: Thu Sep 8 11:51:14 2022 +0200 drm/udl: Don't re-initialize stuff at retrying the URB list allocation udl_alloc_urb_list() retires the allocation if there is no enough room left, and it reinitializes the stuff unnecessarily such as the linked list head and the waitqueue, which could be harmful. Those should be outside the retry loop. Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-12-tiwai@suse.de commit c5c354a3a4728045e1342166394c615d75d45377 Author: Takashi Iwai Date: Thu Sep 8 11:51:13 2022 +0200 drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list() In the current design, udl_get_urb() may be called asynchronously during the driver freeing its URL list via udl_free_urb_list(). The problem is that the sync is determined by comparing the urbs.count and urbs.available fields, while we clear urbs.count field only once after udl_free_urb_list() finishes, i.e. during udl_free_urb_list(), the state becomes inconsistent. For fixing this inconsistency and also for hardening the locking scheme, this patch does a slight refactoring of the code around udl_get_urb() and udl_free_urb_list(). Now urbs.count is updated in the same spinlock at extracting a URB from the list in udl_free_url_list(). Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-11-tiwai@suse.de commit 046f4f0af7fd1fad06793d863d288c6b2cd84e99 Author: Takashi Iwai Date: Thu Sep 8 11:51:12 2022 +0200 drm/udl: Fix potential URB leaks A couple of error handlings forgot to process the URB completion. Those are both with WARN_ON() so should be visible, but we must fix them in anyway. Fixes: 7350b2a3fbc6 ("drm/udl: Replace BUG_ON() with WARN_ON()") Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-10-tiwai@suse.de commit b13fa27a4b72caebe99bd483092479c3767453be Author: Takashi Iwai Date: Thu Sep 8 14:54:51 2022 +0200 drm/udl: Pass rectangle directly to udl_handle_damage() Just for some code simplification. Suggested-by: Thomas Zimmermann Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/87tu5iauw4.wl-tiwai@suse.de commit aeb76f97fcf5bf6c094c62ac5cc22a1949751236 Author: Takashi Iwai Date: Thu Sep 8 11:51:10 2022 +0200 drm/udl: Drop unneeded alignment The alignment of damaged area was needed for the original udlfb driver that tried to trim the superfluous copies between front and backend buffers and handle data in long int. It's not the case for udl DRM driver, hence we can omit the whole unneeded alignment, as well as the dead code. Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-8-tiwai@suse.de commit 2a07a5ddb135e4bd15bf6468b7d2daa4deeaf07d Author: Takashi Iwai Date: Thu Sep 8 11:51:09 2022 +0200 drm/udl: Increase the default URB list size to 20 It seems that the current size (4) for the URB list is too small on some devices, and it resulted in the occasional stalls. Increase the default URB list size to 20 for working around it. Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-7-tiwai@suse.de commit 53593515ec1a4a5afaaa88fd4522bc4c2d7f5d9b Author: Takashi Iwai Date: Thu Sep 8 11:51:08 2022 +0200 drm/udl: Suppress error print for -EPROTO at URB completion The driver may receive -EPROTO at the URB completion when the device gets disconnected, and it's a normal situation. Suppress the error print for that, too. Signed-off-by: Takashi Iwai Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-6-tiwai@suse.de commit ed9605a66b62f27513aba1d95f7d470c4abda29f Author: Takashi Iwai Date: Thu Sep 8 11:51:07 2022 +0200 Revert "drm/udl: Kill pending URBs at suspend and disconnect" This reverts the recent fix commit e25d5954264d ("drm/udl: Kill pending URBs at suspend and disconnect") as it turned out to lead to potential hangup at a disconnection, and it doesn't help much for suspend/resume problem, either. Acked-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-5-tiwai@suse.de commit 0a80005d3c5fea0a21fa6553724c171495ece9b5 Author: Thomas Zimmermann Date: Thu Sep 8 11:51:06 2022 +0200 drm/udl: Enable damage clipping Call drm_plane_enable_fb_damage_clips() and give userspace a chance of minimizing the updated display area. Signed-off-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-4-tiwai@suse.de commit 1ceef996c99f1e8a44df8714fcf12822353ac488 Author: Thomas Zimmermann Date: Thu Sep 8 11:51:05 2022 +0200 drm/udl: Add reset_resume Implement the reset_resume callback of struct usb_driver. Set the standard channel when called. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Signed-off-by: Takashi Iwai Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-3-tiwai@suse.de commit 6d6e732835db92e66c28dbcf258a7e3d3c71420d Author: Takashi Iwai Date: Thu Sep 8 11:51:04 2022 +0200 drm/udl: Restore display mode on resume Restore the display mode whne resuming from suspend. Currently, the display remains dark. On resume, the CRTC's mode does not change, but the 'active' flag changes to 'true'. Taking this into account when considering a mode switch restores the display mode. The bug is reproducable by using Gnome with udl and observing the adapter's suspend/resume behavior. Actually, the whole check added in udl_simple_display_pipe_enable() about the crtc_state->mode_changed was bogus. We should drop the whole check and always apply the mode change in this function. [ tiwai -- Drop the mode_changed check entirely instead, per Daniel's suggestion ] Fixes: 997d33c35618 ("drm/udl: Inline DPMS code into CRTC enable and disable functions") Cc: Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-2-tiwai@suse.de commit 71bb5c82aaaea007167f3ba68d3a669c74d7d55d Author: Doug Smythies Date: Tue Sep 6 13:28:57 2022 -0700 cpufreq: intel_pstate: Add Tigerlake support in no-HWP mode Users may disable HWP in firmware, in which case intel_pstate wouldn't load unless the CPU model is explicitly supported. Add TIGERLAKE to the list of CPUs that can register intel_pstate while not advertising the HWP capability. Without this change, an TIGERLAKE in no-HWP mode could only use the acpi_cpufreq frequency scaling driver. See also commits: d8de7a44e11f: cpufreq: intel_pstate: Add Skylake servers support fbdc21e9b038: cpufreq: intel_pstate: Add Icelake servers support in no-HWP mode 706c5328851d: cpufreq: intel_pstate: Add Cometlake support in no-HWP mode Reported by: M. Cargi Ari Signed-off-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit 1538dc8c1561f0de4ba57a69e2a421a1a3951618 Author: Heikki Krogerus Date: Wed Sep 7 13:30:07 2022 +0300 usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit e12dee3736731e24b1e7367f87d66ac0fcd73ce7 Author: Tamim Khan Date: Sun Aug 28 23:04:19 2022 -0400 ACPI: resource: Skip IRQ override on Asus Vivobook K3402ZA/K3502ZA In the ACPI DSDT table for Asus VivoBook K3402ZA/K3502ZA IRQ 1 is described as ActiveLow; however, the kernel overrides it to Edge_High. This prevents the internal keyboard from working on these laptops. In order to fix this add these laptops to the skip_override_table so that the kernel does not override IRQ 1 to Edge_High. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216158 Reviewed-by: Hui Wang Tested-by: Tamim Khan Tested-by: Sunand Signed-off-by: Tamim Khan Signed-off-by: Rafael J. Wysocki commit 840baca4c44130e9e1954d7b1807f3280c804bc2 Author: Heikki Krogerus Date: Tue Aug 16 13:16:28 2022 +0300 ACPI: LPSS: Use the helper acpi_dev_get_memory_resources() It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 064d42d90e412936434fae7d49204d8055e5b0e5 Author: Heikki Krogerus Date: Tue Aug 16 13:16:27 2022 +0300 ACPI: APD: Use the helper acpi_dev_get_memory_resources() It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 6bb057bfd9d509755349cd2a6ca5e5e6e6071304 Author: Heikki Krogerus Date: Tue Aug 16 13:16:26 2022 +0300 ACPI: resource: Add helper function acpi_dev_get_memory_resources() Wrapper function that finds all memory type resources by using acpi_dev_get_resources(). It removes the need for the drivers to check the resource data type separately. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 6d2b5a1cf4dd943909a927133664ad1627783d95 Author: Heikki Krogerus Date: Tue Aug 16 13:16:25 2022 +0300 ACPI: resource: Filter out the non memory resources in is_memory() This will generalise the function so it should become useful in more places. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 211391bf04b3c74e250c566eeff9cf808156c693 Author: Hans de Goede Date: Mon Sep 5 14:34:12 2022 +0200 ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address On a Packard Bell Dot SC (Intel Atom N2600 model) there is a FPDT table which contains invalid physical addresses, with high bits set which fall outside the range of the CPU-s supported physical address range. Calling acpi_os_map_memory() on such an invalid phys address leads to the below WARN_ON in ioremap triggering resulting in an oops/stacktrace. Add code to verify the physical address before calling acpi_os_map_memory() to fix / avoid the oops. [ 1.226900] ioremap: invalid physical address 3001000000000000 [ 1.226949] ------------[ cut here ]------------ [ 1.226962] WARNING: CPU: 1 PID: 1 at arch/x86/mm/ioremap.c:200 __ioremap_caller.cold+0x43/0x5f [ 1.226996] Modules linked in: [ 1.227016] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.0.0-rc3+ #490 [ 1.227029] Hardware name: Packard Bell dot s/SJE01_CT, BIOS V1.10 07/23/2013 [ 1.227038] RIP: 0010:__ioremap_caller.cold+0x43/0x5f [ 1.227054] Code: 96 00 00 e9 f8 af 24 ff 89 c6 48 c7 c7 d8 0c 84 99 e8 6a 96 00 00 e9 76 af 24 ff 48 89 fe 48 c7 c7 a8 0c 84 99 e8 56 96 00 00 <0f> 0b e9 60 af 24 ff 48 8b 34 24 48 c7 c7 40 0d 84 99 e8 3f 96 00 [ 1.227067] RSP: 0000:ffffb18c40033d60 EFLAGS: 00010286 [ 1.227084] RAX: 0000000000000032 RBX: 3001000000000000 RCX: 0000000000000000 [ 1.227095] RDX: 0000000000000001 RSI: 00000000ffffdfff RDI: 00000000ffffffff [ 1.227105] RBP: 3001000000000000 R08: 0000000000000000 R09: ffffb18c40033c18 [ 1.227115] R10: 0000000000000003 R11: ffffffff99d62fe8 R12: 0000000000000008 [ 1.227124] R13: 0003001000000000 R14: 0000000000001000 R15: 3001000000000000 [ 1.227135] FS: 0000000000000000(0000) GS:ffff913a3c080000(0000) knlGS:0000000000000000 [ 1.227146] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.227156] CR2: 0000000000000000 CR3: 0000000018c26000 CR4: 00000000000006e0 [ 1.227167] Call Trace: [ 1.227176] [ 1.227185] ? acpi_os_map_iomem+0x1c9/0x1e0 [ 1.227215] ? kmem_cache_alloc_trace+0x187/0x370 [ 1.227254] acpi_os_map_iomem+0x1c9/0x1e0 [ 1.227288] acpi_init_fpdt+0xa8/0x253 [ 1.227308] ? acpi_debugfs_init+0x1f/0x1f [ 1.227339] do_one_initcall+0x5a/0x300 [ 1.227406] ? rcu_read_lock_sched_held+0x3f/0x80 [ 1.227442] kernel_init_freeable+0x28b/0x2cc [ 1.227512] ? rest_init+0x170/0x170 [ 1.227538] kernel_init+0x16/0x140 [ 1.227552] ret_from_fork+0x1f/0x30 [ 1.227639] [ 1.227647] irq event stamp: 186819 [ 1.227656] hardirqs last enabled at (186825): [] __up_console_sem+0x5e/0x70 [ 1.227672] hardirqs last disabled at (186830): [] __up_console_sem+0x43/0x70 [ 1.227686] softirqs last enabled at (186576): [] __irq_exit_rcu+0xed/0x160 [ 1.227701] softirqs last disabled at (186569): [] __irq_exit_rcu+0xed/0x160 [ 1.227715] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit b04c2a19d66323624ca2fffa3a6703d7cec33a60 Author: Johan Jonker Date: Sat Sep 10 00:02:07 2022 +0200 rockchip: add rockchip,rk3128-spi Add rockchip,rk3128-spi compatible string. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/c05fb9a3-ebf7-adec-e8ca-bd137d157f50@gmail.com Signed-off-by: Mark Brown commit 824723ccf53fc53ecf896753c562b00a5d6307eb Merge: 86432b7f8f92b 7e18e42e4b280 Author: Mark Brown Date: Sat Sep 10 16:39:51 2022 +0100 spi: Merge tag 'v6.0-rc4' into spi-6.1 Linux 6.0-rc4 so we can test on BeagleBone again. commit 8902437ce3e748cb4f6f036dcd45d7030fd5badb Author: Hans de Goede Date: Sat Sep 10 10:58:36 2022 +0200 leds: simatic-ipc-leds-gpio: Make simatic_ipc_led_gpio_table static simatic_ipc_led_gpio_table is only used inside simatic-ipc-leds-gpio.c, make it static. Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220910085836.84962-1-hdegoede@redhat.com commit 7318b613204942ccfd0973cd7f6e534baa86ff5e Author: Hans de Goede Date: Fri Sep 9 23:09:50 2022 +0200 platform/x86: asus-wmi: Make kbd_rgb_mode_groups static kbd_rgb_mode_groups is only used inside asus-wmi.c, make it static. Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220909210950.385398-1-hdegoede@redhat.com commit 773428ffd867d1ef116c041cdbc4890bee112854 Author: Christophe Leroy Date: Thu Sep 8 11:12:24 2022 +0200 asm-generic: Remove empty #ifdef SA_RESTORER There was a #ifdef SA_RESTORER to guard the sa_restorer field in struct sigaction. Commit 8a1ab3155c2a ("UAPI: (Scripted) Disintegrate include/asm-generic") moved that struct into uapi/asm-generic/signal.h but the #ifdef SA_RESTORER remained. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Arnd Bergmann commit 437b6b35362b206fdf881fe6dea76720eedb6d25 Author: Linus Walleij Date: Sun Sep 4 01:02:34 2022 +0200 parisc: Use the generic IO helpers This enables the parisc to use to fill in the missing (undefined) [read|write]sq I/O accessor functions. This is needed if parisc[64] ever wants to uses CONFIG_REGMAP_MMIO which has been patches to use accelerated _noinc accessors such as readsq/writesq that parisc64, while being a 64bit platform, as of now not yet provide. This comes with the requirement that everything the architecture already provides needs to be defined, rather than just being, say, static inline functions. Bite the bullet and just provide the definitions and make it work. Compile-tested on parisc32 and parisc64. Drop some of the __raw functions that now get implemented in . Reported-by: kernel test robot Signed-off-by: Linus Walleij Reviewed-by: Arnd Bergmann Cc: James E.J. Bottomley Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: Mark Brown Cc: John David Anglin Link: https://lore.kernel.org/linux-arm-kernel/62fcc351.hAyADB%2FY8JTxz+kh%25lkp@intel.com/ Signed-off-by: Arnd Bergmann commit 77bfc8bdb5a1cdbcea21daccdf1686e1bfea3db6 Author: Linus Walleij Date: Sun Sep 4 00:45:25 2022 +0200 parisc: Remove 64bit access on 32bit machines The parisc was using some readq/writeq accessors without special considerations as to what will happen on 32bit CPUs if you do this. Maybe we have been lucky that it "just worked" on 32bit due to the compiler behaviour, or the code paths were never executed. Fix the two offending code sites like this: arch/parisc/lib/iomap.c: - Put ifdefs around the 64bit accessors and make sure that ioread64, ioread64be, iowrite64 and iowrite64be are not available on 32bit builds. - Also fold in a bug fix where 64bit access was by mistake using 32bit writel() accessors rather than 64bit writeq(). drivers/parisc/sba_iommu.c: - Access any 64bit registers using _lo_hi-semantics by way of the readq and writeq operations provided by Signed-off-by: Linus Walleij Reviewed-by: Arnd Bergmann Cc: James E.J. Bottomley Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: Arnd Bergmann Cc: John David Anglin Signed-off-by: Arnd Bergmann commit 97c9e37c7a7d7845b09035569da9b0eea196b1e1 Author: Manikanta Pubbisetty Date: Wed Sep 7 11:36:56 2022 +0300 wifi: ath11k: Increase TCL data ring size for WCN6750 Increase TCL data ring size to 2048 for WCN6750. This is needed to meet 160 MHz TX throughput. Add a new hw_param to indicate the TX ring size for individual devices. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220905071805.31625-4-quic_mpubbise@quicinc.com commit 7636c9a6e7d7996ca0b7f31f61f0e55ef5ff89d5 Author: Manikanta Pubbisetty Date: Wed Sep 7 11:36:49 2022 +0300 wifi: ath11k: Add multi TX ring support for WCN6750 Currently in the case of WCN6750, only one TCL ring is used for TX, this is limiting the TX throughput in 160 MHz case, enabling multiple TCL rings on WCN6750 has shown an improvement of nearly 300 Mbps in the case of TCP TX, therefore add the support of multi TX ring for WCN6750. Currently TCL ring is selected based on CPU ID, this logic cannot be applied for WCN6750 as there is chance of out of order TX of packets and to avoid this, choose TCL ring based on flow hash so that packets of the same flow will end up on same TCL ring. For the same reason, TCL ring retry logic is also not applicable for WCN6750. Also the mapping of TCL, WBM & RBM IDs for WCN6750 is different from existing devices. Create a new TCM/WBM/RBM mapping for WCN6750. Change does not impact existing ath11k devices. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220905071805.31625-3-quic_mpubbise@quicinc.com commit 13aa2fb692d3717767303817f35b3e650109add3 Author: Manikanta Pubbisetty Date: Mon Sep 5 12:48:03 2022 +0530 wifi: ath11k: Enable threaded NAPI Enable threaded NAPI on all ath11k targets. Unlike traditional NAPI poll which runs in softirq context and on the core which scheduled the NAPI, threaded NAPI makes use of kernel threads which are under direct control of the scheduler and helps in balancing the NAPI processing load across multiple CPUs thereby improving throughput. In the case of WCN6750, enabling threaded NAPI has improved 160 MHz RX throughput by nearly 400 Mbps. Similar gains can be expected on other ath11k devices as well. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220905071805.31625-2-quic_mpubbise@quicinc.com commit 43e7c3505ec70db3d3c6458824d5fa40f62e3e7b Author: Jianglei Nie Date: Wed Sep 7 15:37:04 2022 +0800 wifi: ath11k: mhi: fix potential memory leak in ath11k_mhi_register() mhi_alloc_controller() allocates a memory space for mhi_ctrl. When gets some error, mhi_ctrl should be freed with mhi_free_controller(). But when ath11k_mhi_read_addr_from_dt() fails, the function returns without calling mhi_free_controller(), which will lead to a memory leak. We can fix it by calling mhi_free_controller() when ath11k_mhi_read_addr_from_dt() fails. Signed-off-by: Jianglei Nie Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220907073704.58806-1-niejianglei2021@163.com commit 876eb84882a8b2fc4036e735a2de52141aebb6a5 Author: Baochen Qiang Date: Wed Sep 7 11:31:13 2022 +0300 wifi: ath11k: implement SRAM dump debugfs interface On-board SRAM contains valuable information for firmware debugging so add a new file named "sram" to debugfs with which we can dump SRAM content using following the following: cp /sys/kernel/debug/ath11k/wcn6855\ hw2.0/sram /tmp/sram Currently this feature is enabled for QCA6390 and WCN6855. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220802075533.1744-3-quic_bqiang@quicinc.com commit 90aad48eb56f9191e2b30e27f74e2ac97ad93012 Author: Baochen Qiang Date: Wed Sep 7 11:31:13 2022 +0300 wifi: ath11k: Split PCI write/read functions ath11k_pcic_write32/read32 tries to do wake up before doing actual write/read work, which means each time a u32 is written/read, wake up is performed. This is not necessary in case where we do a large amount of write/read, because only one time of wake up is needed. So split each one into two parts, the first part does wake up and release, and the second one does actual write/read work. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220802075533.1744-2-quic_bqiang@quicinc.com commit 80d98a33008cbfd9ed0271b0e253ff88b51f96ac Author: Corey Minyard Date: Fri Sep 9 20:31:39 2022 -0500 ipmi:ipmb: Don't call ipmi_unregister_smi() on a register failure The data structure won't be set up to be unregistered, and it can result in crashes if the register fails. Signed-off-by: Corey Minyard commit 91419ae0420f0c91a326655d687b740826d0a3f9 Author: Judy Hsiao Date: Fri Jul 8 08:07:26 2022 +0000 arm64: dts: rockchip: use BCLK to GPIO switch on rk3399 We discoverd that the state of BCLK on, LRCLK off and SD_MODE on may cause the speaker melting issue. Removing LRCLK while BCLK is present can cause unexpected output behavior including a large DC output voltage as described in the Max98357a datasheet. In order to: 1. prevent BCLK from turning on by other component. 2. keep BCLK and LRCLK being present at the same time This patch adjusts the device tree to allow BCLK to switch to GPIO func before LRCLK output, and switch back during LRCLK is output. Signed-off-by: Judy Hsiao Reviewed-by: Brian Norris Link: https://lore.kernel.org/r/20220708080726.4170711-1-judyhsiao@chromium.org Signed-off-by: Heiko Stuebner commit 03d86fb5a56919ccf47e1cc5861bb5452017ab93 Author: Nicolas Frattaroli Date: Sun Jun 12 17:53:46 2022 +0200 arm64: dts: rockchip: Add Hantro encoder node to rk356x The RK3566 and RK3568 come with a dedicated Hantro instance solely for encoding. This patch adds a node for this to the device tree, along with a node for its MMU. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20220612155346.16288-4-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit 944be6fba401639e5bf2a8bc9f5e781e6cc4b4d4 Author: Piotr Oniszczuk Date: Mon Feb 14 22:29:54 2022 +0100 arm64: dts: rockchip: Add VPU support for RK3568/RK3566 RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP8 video formats. This patch enables RK356x video decoder in RK356x device-tree include. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk Reviewed-by: Ezequiel Garcia Link: https://lore.kernel.org/r/20220214212955.1178947-2-piotr.oniszczuk@gmail.com Signed-off-by: Heiko Stuebner commit 0fbbfb0b00d17ae6b6c4f04e325203de9e37837a Author: Chukun Pan Date: Tue Jul 26 10:35:16 2022 +0800 arm64: dts: rockchip: Enable PCIe controller on rock3a Add the nodes to enable the PCIe controller on the Radxa ROCK3 Model A board. Run test with the MT7921 pcie wireless card. Signed-off-by: Chukun Pan Link: https://lore.kernel.org/r/20220726023516.6487-1-amadeus@jmu.edu.cn Signed-off-by: Heiko Stuebner commit 1b8d4233f51632cb3134b373b5727e26ab7e0a49 Author: Chukun Pan Date: Tue Jul 26 10:30:46 2022 +0800 arm64: dts: rockchip: add rtc to rock3a Add devicetree node for hym8563 rtc to Radxa ROCK3 Model A board. Signed-off-by: Chukun Pan Link: https://lore.kernel.org/r/20220726023046.5876-1-amadeus@jmu.edu.cn Signed-off-by: Heiko Stuebner commit cd4e5f30f51f1066170a7c5f267cba6f062213e7 Author: Nicolas Frattaroli Date: Mon Jul 18 05:31:45 2022 +0200 arm64: dts: rockchip: Add PCIe 2 nodes to quartz64-b This adds the regulator node to the quartz64-b device tree, and enables the PCIe 2 controller and combphy for it. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20220718033145.792657-1-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit 1dabb74971b38d966ecef566bafddc4a34f4db9d Author: Johan Jonker Date: Fri Jun 3 18:35:39 2022 +0200 ARM: dts: rockchip: restyle emac nodes The emac_rockchip.txt file is converted to YAML. Phy nodes are now a subnode of mdio, so restyle the emac nodes of rk3036/rk3066/rk3188. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220603163539.537-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit d28b680a34948d7634b824b1fc7546e9dc8422fb Author: Johan Jonker Date: Fri Jun 3 18:35:38 2022 +0200 ARM: dts: rockchip: fix rk3036 emac node compatible string The Linux kernel has no logic to decide which driver to probe first. To prevent race conditions remove the rk3036 emac node fall back compatible string. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220603163539.537-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 26cc239f9e0167d710d2eb009aaa979c4c7a0859 Merge: d2de3f5ead84e 62da80c6a124d Author: Mark Brown Date: Fri Sep 9 23:45:15 2022 +0100 ASoC: mediatek: Set i2s clock sharing from machine drivers Merge series from Nícolas F. R. A. Prado : The i2s ports on MediaTek SoCs only support a single data lane. In order to achieve full-duplex operation thus two i2s ports, one for input and one for output, need to be used together and sharing a single clock from one of the ports. This clock sharing setting was previously read by the sound platform driver from the devicetree, but given that the input/output pairing is closely related to which codecs are connected to which ports, the machine sound driver can infer and set it, so that no DT property is required. At this point only mt8183-kukui was using the DT property, but given that this property was never documented, and that the API introduced in this series makes it obsolete, the undocumented DT property can safely be removed. This series adds a function to allow setting the i2s shared clocks, makes use of it in the machine drivers as required, and removes the no longer required DT properties and support for them in the drivers, for all of mt8192, mt8183 and mt8186. Nícolas F. R. A. Prado (10): ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8 ASoC: mediatek: mt8192: Remove clock share parsing from DT ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver ASoC: mediatek: mt8183: Configure shared clocks ASoC: mediatek: mt8183: Remove clock share parsing from DT arm64: dts: mediatek: kukui: Remove i2s-share properties ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver ASoC: mediatek: mt8186: Configure shared clocks ASoC: mediatek: mt8186: Remove clock share parsing from DT .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 5 -- sound/soc/mediatek/mt8183/mt8183-afe-common.h | 3 ++ .../mediatek/mt8183/mt8183-da7219-max98357.c | 33 +++++++++++++ sound/soc/mediatek/mt8183/mt8183-dai-i2s.c | 45 ++++++++--------- .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 33 +++++++++++++ sound/soc/mediatek/mt8186/mt8186-afe-common.h | 3 ++ sound/soc/mediatek/mt8186/mt8186-dai-i2s.c | 44 ++++++++--------- .../mt8186/mt8186-mt6366-da7219-max98357.c | 18 +++++++ .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 18 +++++++ sound/soc/mediatek/mt8192/mt8192-afe-common.h | 3 ++ sound/soc/mediatek/mt8192/mt8192-dai-i2s.c | 49 ++++++++----------- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 9 ++++ 12 files changed, 180 insertions(+), 83 deletions(-) -- 2.37.3 commit 69a673c9e54d952cf404f80169d3100b7a9645bb Author: Axel Lin Date: Sun Aug 28 20:01:53 2022 +0800 regulator: tps65219: Fix .bypass_val_on setting The .bypass_val_on setting does not match the .bypass_mask setting, so the .bypass_mask bit will never get set. Fix it by removing .bypass_val_on setting, the regulator_set_bypass_regmap and regulator_get_bypass_regmap helpers will use rdev->desc->bypass_mask as val_on if the val_on is 0. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20220828120153.1512508-1-axel.lin@ingics.com Signed-off-by: Mark Brown commit 8478ed5844588703a1a4c96a004b1525fbdbdd5e Author: Linus Walleij Date: Fri Sep 9 13:25:29 2022 +0200 regulator: qcom_rpm: Fix circular deferral regression On recent kernels, the PM8058 L16 (or any other PM8058 LDO-regulator) does not come up if they are supplied by an SMPS-regulator. This is not very strange since the regulators are registered in a long array and the L-regulators are registered before the S-regulators, and if an L-regulator defers, it will never get around to registering the S-regulator that it needs. See arch/arm/boot/dts/qcom-apq8060-dragonboard.dts: pm8058-regulators { (...) vdd_l13_l16-supply = <&pm8058_s4>; (...) Ooops. Fix this by moving the PM8058 S-regulators first in the array. Do the same for the PM8901 S-regulators (though this is currently not causing any problems with out device trees) so that the pattern of registration order is the same on all PMnnnn chips. Fixes: 087a1b5cdd55 ("regulator: qcom: Rework to single platform device") Cc: stable@vger.kernel.org Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220909112529.239143-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit 8d8e16592022c9650df8aedfe6552ed478d7135b Author: Patrick Rudolph Date: Fri Sep 9 14:59:53 2022 +0200 regulator: core: Prevent integer underflow By using a ratio of delay to poll_enabled_time that is not integer time_remaining underflows and does not exit the loop as expected. As delay could be derived from DT and poll_enabled_time is defined in the driver this can easily happen. Use a signed iterator to make sure that the loop exits once the remaining time is negative. Signed-off-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220909125954.577669-1-patrick.rudolph@9elements.com Signed-off-by: Mark Brown commit d2de3f5ead84e230f4651cddf7658ab74ce1a70c Author: Shengjiu Wang Date: Fri Sep 9 11:44:58 2022 +0800 ASoC: fsl_asrc: Add initialization finishing check in runtime resume If the initialization is not finished, then filling input data to the FIFO may fail. So it is better to add initialization finishing check in the runtime resume for suspend & resume case. And consider the case of three instances working in parallel, increase the retry times to 50 for more initialization time. Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/1662695098-24602-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 985f03ba6f4bc37bdacd2e78906e6b731e03ab32 Author: Kuninori Morimoto Date: Fri Sep 9 01:20:48 2022 +0000 ASoC: hdmi-codec.c: use devm_kzalloc() for DMA data hdmi-codec.c is using kzalloc(), but we can replace it to devm_kzalloc() and then, we can remove .remove callback. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/874jxhmjgw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 072aba58c9a4fa5edbfa1db92f78951cbb65d9b9 Author: Vadim Pasternak Date: Sun Sep 4 17:11:13 2022 +0300 platform/mellanox: mlxreg-lc: Make error handling flow consistent Use 'goto' statement in error flow of mlxreg_lc_event_handler() at all places for consistency. This follow-up patch implementing comments from https://www.spinics.net/lists/platform-driver-x86/msg34587.html Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220904141113.49048-1-vadimp@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c5b94f5b7819348c59f9949b2b75c341a114cdd4 Author: Hans de Goede Date: Mon Aug 29 15:39:23 2022 +0200 ACPI: video: Change disable_backlight_sysfs_if quirks to acpi_backlight=native Some Toshibas have a broken acpi-video interface for brightness control and need a special firmware call on resume to turn the panel back on. So far these have been using the disable_backlight_sysfs_if workaround to deal with this. The recent x86/acpi backlight refactoring has broken this workaround: 1. This workaround relies on acpi_video_get_backlight_type() returning acpi_video so that the acpi_video code actually runs; and 2. this relies on the actual native GPU driver to offer the sysfs backlight interface to userspace. After the refactor this breaks since the native driver will no longer register its backlight-device if acpi_video_get_backlight_type() does not return native and making it return native breaks 1. Keeping the acpi_video backlight handling on resume active, while not using it to set the brightness, is necessary because it does a _BCM call on resume which is necessary to turn the panel back on on resume. Looking at the DSDT shows that this _BCM call results in a Toshiba HCI_SET HCI_LCD_BRIGHTNESS call, which turns the panel back on. This kind of special vendor specific handling really belongs in the vendor specific acpi driver. An earlier patch in this series modifies toshiba_acpi to make the necessary HCI_SET call on resume on affected models. With toshiba_acpi taking care of the HCI_SET call on resume, the acpi_video code no longer needs to call _BCM on resume. So instead of using the (now broken) disable_backlight_sysfs_if workaround, simply setting acpi_backlight=native to disable the broken apci-video interface is sufficient fix things now. After this there are no more users of the disable_backlight_sysfs_if flag and as discussed above the flag also no longer works as intended, so remove the disable_backlight_sysfs_if flag entirely. Acked-by: Rafael J. Wysocki Tested-by: Arvid Norlander Signed-off-by: Hans de Goede commit 3cb1f40dfdc3b9f5449076c96b4e2523139f5cd0 Author: Hans de Goede Date: Mon Aug 29 15:17:03 2022 +0200 drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models Some Toshibas have a broken acpi-video interface for brightness control, so far these have been using a special workaround in drivers/acpi/acpi_video.c which gets activated by the disable_backlight_sysfs_if module-param/quirks. The recent x86/acpi backlight refactoring has broken this workaround: 1. This workaround relies on acpi_video_get_backlight_type() returning acpi_video so that the acpi_video code actually runs; and 2. this relies on the actual native GPU driver to offer the sysfs backlight interface to userspace. After the refactor this breaks since the native driver will no longer register its backlight-device if acpi_video_get_backlight_type() does not return native and making it return native breaks 1. Keeping the acpi_video backlight handling on resume active, while not using it to set the brightness, is necessary because it does a _BCM call on resume which is necessary to turn the panel back on on resume. Looking at the DSDT shows that this _BCM call results in a Toshiba HCI_SET HCI_LCD_BRIGHTNESS call, which turns the panel back on. This commit makes toshiba_acpi do a HCI_SET HCI_PANEL_POWER_ON call on resume on the affected models, so that the (now broken) acpi_video disable_backlight_sysfs_if workaround will no longer be necessary. Note this uses HCI_PANEL_POWER_ON instead of HCI_LCD_BRIGHTNESS to avoid changing the configured brightness level. Tested-by: Arvid Norlander Signed-off-by: Hans de Goede commit 18ef1bb093ab1e0a74d146cbf4a9d132d01374d8 Author: Arvid Norlander Date: Fri Sep 2 20:00:37 2022 +0200 docs: ABI: charge_control_end_threshold may not support all values Some laptops (for example Toshiba Satellite Z830) only supports some fixed values. Allow for this and document the expected behaviour in such cases. Acked-by: Sebastian Reichel Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220902180037.1728546-4-lkml@vorpal.se Signed-off-by: Hans de Goede commit 8ef5db9eb084f6212345a7b09355c78ce05f71e2 Author: Arvid Norlander Date: Fri Sep 2 20:00:36 2022 +0200 platform/x86: Battery charge mode in toshiba_acpi (sysfs) This commit adds the ACPI battery hook which in turns adds the sysfs entries. Because the Toshiba laptops only support two modes (eco or normal), which in testing correspond to 80% and 100% we simply round to the nearest possible level when set. It is possible that Toshiba laptops other than the Z830 has different set points for the charging. If so, a quirk table could be introduced in the future for this. For now, assume that all laptops that support this feature work the same way. Tested on a Toshiba Satellite Z830. Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220902180037.1728546-3-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 89655fbb396aff20bd5247fa6b13a689e2f10f9c Author: Arvid Norlander Date: Fri Sep 2 20:00:35 2022 +0200 platform/x86: Battery charge mode in toshiba_acpi (internals) This commit adds the internal functions to control the Toshiba laptop. Unlike for example ThinkPads where this control is granular here it is just off/on. When off it charges to 100%. When on it charges to about 80%. Controlling this setting is done via HCI register 0x00ba. Setting to value 1 will result in limiting the charing to 80% of the battery capacity, while setting it to 0 will allow charging to 100%. Reading the current state is a bit weird, and needs a 1 set in the last position of the query for whatever reason. In addition, the read may return 0x8d20 (Data not available) rarely, so a retry mechanism is needed. According to the Windows program used to control the feature the setting will not take effect until the battery has been discharged to around 50%. However, in my testing it takes effect as soon as the charge drops below 80%. On Windows Toshiba branded this feature as "Eco charging". Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220902180037.1728546-2-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c727ba4cd95a12d8e43b02963d3ba4daddbd100c Author: Arvid Norlander Date: Fri Sep 2 19:40:18 2022 +0200 platform/x86: toshiba_acpi: Add fan RPM reading (hwmon interface) This expands on the previous commit, exporting the fan RPM via hwmon. This will look something like the following when using the "sensors" command from lm_sensors: toshiba_acpi_sensors-acpi-0 Adapter: ACPI interface fan1: 0 RPM Signed-off-by: Arvid Norlander Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220902174018.1720029-3-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit dd0a1794f4334ddbf9b7c5e7d642aaffff38c69b Author: Kiran K Date: Wed Sep 7 12:49:45 2022 +0530 Bluetooth: btintel: Mark Intel controller to support LE_STATES quirk HarrrisonPeak, CyclonePeak, SnowFieldPeak and SandyPeak controllers are marked to support HCI_QUIRK_LE_STATES. Signed-off-by: Kiran K Signed-off-by: Chethan T N Signed-off-by: Luiz Augusto von Dentz commit b43331b42e4453fe8b210d372d602e2025276419 Author: Kiran K Date: Fri Aug 19 13:18:15 2022 +0530 Bluetooth: btintel: Add support for Magnetor Hardware variant for Magnetor core (CNVi) is added. Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz commit a614ee94a8497c43015b3de662020def93295ddd Author: Chris Lu Date: Tue Aug 30 06:55:58 2022 +0800 Bluetooth: btusb: Add a new PID/VID 13d3/3578 for MT7921 Add VID 13D3 & PID 3578 for MediaTek MT7921 USB Bluetooth chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=03 Lev=01 Prnt=01 Port=07 Cnt=03 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3578 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Chris Lu Signed-off-by: Luiz Augusto von Dentz commit 0173ce114dc4df73e0ee3e1eafea156b7b26e719 Author: Michał Winiarski Date: Wed Aug 31 23:56:08 2022 +0200 drm/format: Split into more granular test cases While we have multiple test cases, most of them check multiple conditions, calling the function that is tested multiple times with different arguments (with comments that indicate test case boundary). This usually means that it can be easily converted into multiple test cases. Passing output: ============================================================ ================= drm_format (18 subtests) ================= [PASSED] drm_format_block_width_invalid [PASSED] drm_format_block_width_one_plane [PASSED] drm_format_block_width_two_plane [PASSED] drm_format_block_width_three_plane [PASSED] drm_format_block_width_tiled [PASSED] drm_format_block_height_invalid [PASSED] drm_format_block_height_one_plane [PASSED] drm_format_block_height_two_plane [PASSED] drm_format_block_height_three_plane [PASSED] drm_format_block_height_tiled [PASSED] drm_format_min_pitch_invalid [PASSED] drm_format_min_pitch_one_plane_8bpp [PASSED] drm_format_min_pitch_one_plane_16bpp [PASSED] drm_format_min_pitch_one_plane_24bpp [PASSED] drm_format_min_pitch_one_plane_32bpp [PASSED] drm_format_min_pitch_two_plane [PASSED] drm_format_min_pitch_three_plane_8bpp [PASSED] drm_format_min_pitch_tiled =================== [PASSED] drm_format ==================== ============================================================ Testing complete. Ran 18 tests: passed: 18 Signed-off-by: Michał Winiarski Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20220831215608.349269-2-michal.winiarski@intel.com commit 6da75526fc9edf940c12a785cc2fdeaf22101cad Author: Michał Winiarski Date: Wed Aug 31 23:56:07 2022 +0200 drm/format: Use appropriate types in expect/assert drm_format_info_* functions don't return bool, and the info variable is a pointer. Expecting non-NULL info will cause the test to crash if it is NULL in checks that follow (which dereference it). Use appropriate KUNIT_EXPECT/KUNIT_ASSERT variants. Signed-off-by: Michał Winiarski Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20220831215608.349269-1-michal.winiarski@intel.com commit 877ace9eab7de032f954533afd5d1ecd0cf62eaf Author: Liu Song Date: Fri Aug 26 19:40:50 2022 +0800 arm64: spectre: increase parameters that can be used to turn off bhb mitigation individually In our environment, it was found that the mitigation BHB has a great impact on the benchmark performance. For example, in the lmbench test, the "process fork && exit" test performance drops by 20%. So it is necessary to have the ability to turn off the mitigation individually through cmdline, thus avoiding having to compile the kernel by adjusting the config. Signed-off-by: Liu Song Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1661514050-22263-1-git-send-email-liusong@linux.alibaba.com Signed-off-by: Catalin Marinas commit 8eb858c44b98e0326bb32fca34ae671995cd73bb Author: Qi Zheng Date: Mon Aug 15 20:47:39 2022 +0800 arm64: run softirqs on the per-CPU IRQ stack Currently arm64 supports per-CPU IRQ stack, but softirqs are still handled in the task context. Since any call to local_bh_enable() at any level in the task's call stack may trigger a softirq processing run, which could potentially cause a task stack overflow if the combined stack footprints exceed the stack's size, let's run these softirqs on the IRQ stack as well. Signed-off-by: Qi Zheng Reviewed-by: Arnd Bergmann Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220815124739.15948-1-zhengqi.arch@bytedance.com Signed-off-by: Catalin Marinas commit 62da80c6a124dd68b12c4d2197ecc74b79823571 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:54 2022 -0400 ASoC: mediatek: mt8186: Remove clock share parsing from DT Now that the clock sharing for i2s ports can be configured from the sound machine driver, remove the logic that was used to parse the properties from the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-11-nfraprado@collabora.com Signed-off-by: Mark Brown commit 9986bdaee4776c5d595933cace9d54c6bc084e91 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:53 2022 -0400 ASoC: mediatek: mt8186: Configure shared clocks i2s0 and i2s1 are paired input/output connected to the same codec and should share the same clock. Likewise for i2s2 and i2s3. Set the clock sharing for each pair during the codec's initialization. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-10-nfraprado@collabora.com Signed-off-by: Mark Brown commit 4132a778e806f77c2bd01a9a34b07edc9dd99d76 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:52 2022 -0400 ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver Add a new function to configure the shared clock between two i2s ports, and export it. This will allow the clock sharing to be set from the machine driver instead of the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-9-nfraprado@collabora.com Signed-off-by: Mark Brown commit b3821f7839c2ec322926d16557aff29f4be1f4dc Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:51 2022 -0400 arm64: dts: mediatek: kukui: Remove i2s-share properties The i2sN-share properties were never documented in the dt-binding and thus shouldn't be used. Now that the ASoC machine drivers are setting the I2S clock sharing internally, these properties are no longer needed, so remove them. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-8-nfraprado@collabora.com Signed-off-by: Mark Brown commit cbebe67859a0e8d51e578fdd9f927f8ef2504ba4 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:50 2022 -0400 ASoC: mediatek: mt8183: Remove clock share parsing from DT Now that the clock sharing for i2s ports can be configured from the sound machine driver, remove the logic that was used to parse the properties from the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-7-nfraprado@collabora.com Signed-off-by: Mark Brown commit 4583392a135cc30409f5a6ceebb8374e550b03e0 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:49 2022 -0400 ASoC: mediatek: mt8183: Configure shared clocks i2s0 and i2s5 are paired input/output connected to the same codec and should share the same clock. Likewise for i2s2 and i2s3. Set the clock sharing for each pair during the DAI initialization. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-6-nfraprado@collabora.com Signed-off-by: Mark Brown commit fea84890e5c1fb65ae8e25b2f9b86363af1f45f2 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:48 2022 -0400 ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver Add a new function to configure the shared clock between two i2s ports, and export it. This will allow the clock sharing to be set from the machine driver instead of the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-5-nfraprado@collabora.com Signed-off-by: Mark Brown commit 9ccd51ce396a46d9d4d0c87aa6a82dd26a2f281a Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:47 2022 -0400 ASoC: mediatek: mt8192: Remove clock share parsing from DT Now that the clock sharing for i2s ports can be configured from the sound machine driver, remove the logic that was used to parse the properties from the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-4-nfraprado@collabora.com Signed-off-by: Mark Brown commit 3ffb9fa3963964a730c34f48e502ac0625efc145 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:46 2022 -0400 ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8 Both i2s8 and i2s9 are connected to the rt5682 codec and should share the same clock to work in a full-duplex manner. Set the clock sharing during the initialization for rt5682. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-3-nfraprado@collabora.com Signed-off-by: Mark Brown commit 8ae4fcfd5b11b5c33154732fcad99ad0f5843ce2 Author: Nícolas F. R. A. Prado Date: Thu Sep 8 12:11:45 2022 -0400 ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver Add a new function to configure the shared clock between two i2s ports, and export it. This will allow the clock sharing to be set from the machine driver instead of the devicetree. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220908161154.648557-2-nfraprado@collabora.com Signed-off-by: Mark Brown commit cc4a3a19b986aa13a488c8f319e413e85308f403 Author: Peter Ujfalusi Date: Fri Sep 9 14:43:32 2022 +0300 ASoC: SOF: Intel: Add mtrace type information for IPC4 Set the mtrace type for platforms supported by IPC4. Note: currently only SOF_IPC4_MTRACE_INTEL_CAVS_2 type is supported by the ipc4-mtrace driver, which is used by CAVS 2.x platforms (ICL, TGL, ADL) and ACE (MTL). Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9ee71a31602fe72111b7a2d188ff84f7ead4cf92 Author: Peter Ujfalusi Date: Fri Sep 9 14:43:31 2022 +0300 ASoC: SOF: Intel: icl: Set IPC4-specific DSP ops Add implementation of low level, platform dependent IPC4 message handling and set the DSP ops for IPC4 for ICL platform. Suggested-by: Rander Wang Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit f4ea22f7aa7536560097d765be56445933d07e0d Author: Peter Ujfalusi Date: Fri Sep 9 14:43:30 2022 +0300 ASoC: SOF: ipc4: Add support for mtrace log extraction One of the debugging/logging features for an IPC4 based firmware is the use of the debug window to deliver log messages to host via the shared SRAM. The initial implementation of the mtrace supports only TGL/MTL style of logging, but can be extended to support other types, like APL, SKL, CNL, etc. The window is split into 16 'slots' where the first slot contains the descriptors for the remaining 15 slots. Each DSP core logs to a separate slot and the slot allocation is not fixed, we can not assume that the first slot is always used by core0 for example. The firmware sends LOG_BUFFER_STATUS message when new log batch is available from one of the cores (after it updated the write_ptr in the given slot). Host should update the read_ptr in the same slot when it has taken out log data. The patch also updates the sof_ipc4_fw_data struct with parameters needed for the mtrace to be enabled and used safely. Co-developed-by: Rander Wang Signed-off-by: Rander Wang Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a5d0147ac9f8ea6c08d00b28f0468c9cb3fdfde8 Author: Peter Ujfalusi Date: Fri Sep 9 14:43:29 2022 +0300 ASoC: SOF: ipc4: Configure the debug box offset The debug window for IPC4 compatible firmware is always window #2, set the debug_box.offset accordingly. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b59f1532e0b17f22965e327f86d04292f496ccaf Author: Peter Ujfalusi Date: Fri Sep 9 14:43:28 2022 +0300 ASoC: SOF: ipc4: Add define for the outbox window index Instead of using the index number directly, add a define for the outbox window index. It is always window 1 with IPC4. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit e9bcfea156b4d8563109c17c033fa496f0ec4995 Author: Peter Ujfalusi Date: Fri Sep 9 14:43:27 2022 +0300 ASoC: SOF: ipc4: Add macro to get core ID from log buffer status message The LOG_BUFFER_STATUS message includes the ID of the core which updated its log buffer. With IPC4 each core logs to a different slot in the debug window. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 621a3f772be5cfcd472880aa12ccb10d4c7afae3 Author: Peter Ujfalusi Date: Fri Sep 9 14:43:26 2022 +0300 ASoC: SOF: ipc4: Only print LOG BUFFER update message info if requested Do not print messages when the SOF_DBG_PRINT_DMA_POSITION_UPDATE_LOGS flag is not set to reduce the amount of prints when the tracing is used. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220909114332.31393-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 2fae67716bb99a956a4c4a47c0e2ece52a2a15ca Merge: 665f5d3577ef4 58c449a969469 Author: Martin KaFai Lau Date: Fri Sep 9 10:40:45 2022 -0700 Merge branch 'cgroup/connect{4,6} programs for unprivileged ICMP ping' YiFei Zhu says: ==================== Usually when a TCP/UDP connection is initiated, we can bind the socket to a specific IP attached to an interface in a cgroup/connect hook. But for pings, this is impossible, as the hook is not being called. This series adds the invocation for cgroup/connect{4,6} programs to unprivileged ICMP ping (i.e. ping sockets created with SOCK_DGRAM IPPROTO_ICMP(V6) as opposed to SOCK_RAW). This also adds a test to verify that the hooks are being called and invoking bpf_bind() from within the hook actually binds the socket. Patch 1 adds the invocation of the hook. Patch 2 deduplicates write_sysctl in BPF test_progs. Patch 3 adds the tests for this hook. v1 -> v2: * Added static to bindaddr_v6 in prog_tests/connect_ping.c * Deduplicated much of the test logic in prog_tests/connect_ping.c * Deduplicated write_sysctl() to test_progs.c v2 -> v3: * Renamed variable "obj" to "skel" for the BPF skeleton object in prog_tests/connect_ping.c v3 -> v4: * Fixed error path to destroy skel in prog_tests/connect_ping.c ==================== Signed-off-by: Martin KaFai Lau commit 58c449a96946929467b537589c8a23f11e04af39 Author: YiFei Zhu Date: Fri Sep 9 00:49:41 2022 +0000 selftests/bpf: Ensure cgroup/connect{4,6} programs can bind unpriv ICMP ping This tests that when an unprivileged ICMP ping socket connects, the hooks are actually invoked. We also ensure that if the hook does not call bpf_bind(), the bound address is unmodified, and if the hook calls bpf_bind(), the bound address is exactly what we provided to the helper. A new netns is used to enable ping_group_range in the test without affecting ouside of the test, because by default, not even root is permitted to use unprivileged ICMP ping... Signed-off-by: YiFei Zhu Link: https://lore.kernel.org/r/086b227c1b97f4e94193e58aae7576d0261b68a4.1662682323.git.zhuyifei@google.com Signed-off-by: Martin KaFai Lau commit e42921c3c346b1b49068af3f3881322081e1dddd Author: YiFei Zhu Date: Fri Sep 9 00:49:40 2022 +0000 selftests/bpf: Deduplicate write_sysctl() to test_progs.c This helper is needed in multiple tests. Instead of copying it over and over, better to deduplicate this helper to test_progs.c. test_progs.c is chosen over testing_helpers.c because of this helper's use of CHECK / ASSERT_*, and the CHECK was modified to use ASSERT_* so it does not rely on a duration variable. Suggested-by: Martin KaFai Lau Signed-off-by: YiFei Zhu Link: https://lore.kernel.org/r/9b4fc9a27bd52f771b657b4c4090fc8d61f3a6b5.1662682323.git.zhuyifei@google.com Signed-off-by: Martin KaFai Lau commit 0ffe2412531e95a309d7f0bfe985fc4ca4d39de8 Author: YiFei Zhu Date: Fri Sep 9 00:49:39 2022 +0000 bpf: Invoke cgroup/connect{4,6} programs for unprivileged ICMP ping Usually when a TCP/UDP connection is initiated, we can bind the socket to a specific IP attached to an interface in a cgroup/connect hook. But for pings, this is impossible, as the hook is not being called. This adds the hook invocation to unprivileged ICMP ping (i.e. ping sockets created with SOCK_DGRAM IPPROTO_ICMP(V6) as opposed to SOCK_RAW. Logic is mirrored from UDP sockets where the hook is invoked during pre_connect, after a check for suficiently sized addr_len. Signed-off-by: YiFei Zhu Link: https://lore.kernel.org/r/5764914c252fad4cd134fb6664c6ede95f409412.1662682323.git.zhuyifei@google.com Signed-off-by: Martin KaFai Lau commit 523adb553573db46593724fd1cd617339f2e9009 Author: Chris Morgan Date: Tue Sep 6 16:03:24 2022 -0500 arm64: dts: rockchip: add Anbernic RG353P and RG503 Anbernic RG353P and RG503 are both RK3566 based handheld gaming devices from Anbernic. Both devices have: - 2 SDMMC slots. - A Realtek rtl8821cs WiFi/Bluetooth adapter. - A mini HDMI port. - A USB C host port and a USB C otg port (currently only working as device). - Multiple GPIO buttons and a single ADC button. - Dual analog joysticks controlled via a GPIO mux. - A headphone jack with amplified stereo speakers via a SGM4865 amp. - A PWM based vibrator for force feedback. The RG353P has: - 2GB LPDDR4 RAM. - A 32GB eMMC. - A 3.5 inch 640x480 4-lane DSI panel of unknown origin with an i2c controlled touchscreen (touchscreen is a Hynitron CST340). The RG503 has: - 1GB LPDDR4 RAM. - A 5 inch 960x544 AMOLED 2-lane DSI/DBI panel manufactured by Samsung with part number ams495qa04. Data for this panel is provided via the DSI interface, however commands are sent via a 9-bit 3-wire SPI interface. The MISO pin of SPI3 of the SOC is wired to the input of the panel, so it must be bitbanged. This devicetree enables the following hardware: - HDMI (plus audio). - Analog audio, including speakers. - All buttons. - All SDMMC/eMMC/SDIO controllers. - The ADC joysticks (note a pending patch is required to use them). - WiFi/Bluetooth (note out of tree drivers are required). - The PWM based vibrator motor. The following hardware is not enabled: - The display panels (drivers are being written and there are issues with the upstream DSI and VOP2 subsystems). - Battery (driver pending). - Touchscreen on the RG353P (note the i2c2 bus is enabled for it). Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20220906210324.28986-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 22eed92492e4a390da87196d55b1da0af4154595 Author: Chris Morgan Date: Tue Sep 6 16:03:23 2022 -0500 dt-bindings: arm: rockchip: Add Anbernic RG353P and RG503 Add entry for the Anbernic RG353P and RG503 handheld devices. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906210324.28986-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit fff05e5af2247205f2ae4f93d1943d0938d8b2c3 Author: Chris Morgan Date: Tue Sep 6 16:03:22 2022 -0500 dt-bindings: vendor-prefixes: add Anbernic Anbernic designs and manufactures portable gaming systems. https://anbernic.com/ Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906210324.28986-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit bc17f2b9608fe2fdccd4fef95ef8b407f5c33174 Author: Frank Wunderlich Date: Tue Sep 6 18:42:12 2022 +0200 arm64: dts: rockchip: Add regulator suffix to BPI-R2-Pro Add -regulator suffix to regulator names on Banana Pi R2 Pro board as discussed on Mailinglist Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906164212.84835-1-linux@fw-web.de Signed-off-by: Heiko Stuebner commit 6cbd76752791552554e5587f34781408215d1e5b Author: FUKAUMI Naoki Date: Thu Sep 8 03:17:26 2022 +0000 arm64: dts: rockchip: add LEDs for ROCK 4C+ add support for user LEDs on Radxa ROCK 4C+ board. Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220908031726.1307105-2-naoki@radxa.com Signed-off-by: Heiko Stuebner commit 7ebfd4f6b52a60820e8d03577fdb082176cd8e79 Author: FUKAUMI Naoki Date: Thu Sep 8 03:17:25 2022 +0000 arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ only user_led2 (blue) is supported. user_led1 (green) is not connected to any gpio so it cannot be controlled. Signed-off-by: FUKAUMI Naoki Link: https://lore.kernel.org/r/20220908031726.1307105-1-naoki@radxa.com Signed-off-by: Heiko Stuebner commit a5d5e515ed89709de8ad2537cd9d611b95e1928b Author: Chris Morgan Date: Fri Aug 26 21:16:23 2022 -0500 arm64: dts: rockchip: add rk817 chg to Odroid Go Advance Add the new rk817 charger driver to the Odroid Go Advance. Create a monitored battery node as well for the charger to use. All values from monitored battery are gathered from the BSP kernel for the Odroid Go Advance provided by HardKernel. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk Link: https://lore.kernel.org/r/20220827021623.23829-5-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 6541b424ce1dda616d3946e839f015c984df7a99 Author: Finley Xiao Date: Tue Sep 6 16:38:25 2022 +0200 soc: rockchip: power-domain: add power domain support for rk3588 This driver is modified to support RK3588 SoCs. Signed-off-by: Finley Xiao [port of downstream code incl. merging in fixes] Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220906143825.199089-7-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 47bceb7cda6a78b3735694790e70f5cdc254058e Author: Elaine Zhang Date: Tue Sep 6 16:38:24 2022 +0200 soc: rockchip: power-domain: do not enable domain when adding it It's not need to power on all pd when add pm domain. Instead use PD's real status in pm_genpd_init(). Signed-off-by: Elaine Zhang Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220906143825.199089-6-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 167bbadee8c2aa53d56a2466bddd98c8c0aaf846 Author: Sebastian Reichel Date: Tue Sep 6 16:38:22 2022 +0200 dt-bindings: power: rockchip: Add bindings for rk3588 Add the compatible string for RK3588 SoC. Acked-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220906143825.199089-4-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit aa8414fffd9892a81de76d4bb91c70149a005769 Author: Sebastian Reichel Date: Tue Sep 6 16:38:20 2022 +0200 dt-bindings: arm: rockchip: add rk5388 compatible string to pmu.yaml Add the compatible for the pmu mfd on rk3588. Acked-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220906143825.199089-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 91b1a7ff70a5b33645ac618446bff97c36ae150d Merge: 570ed4e5b0d9e 67944950c2d0b Author: Heiko Stuebner Date: Fri Sep 9 19:02:14 2022 +0200 Merge branch 'v6.1-shared/powerdomain' into v6.1-armsoc/drivers commit 67944950c2d0bdb7cfc8855f1d9b44fc4ef51510 Author: Finley Xiao Date: Tue Sep 6 16:38:21 2022 +0200 dt-bindings: power: add power-domain header for rk3588 Add all the power domains listed in the RK3588 TRM. Signed-off-by: Finley Xiao Signed-off-by: Sebastian Reichel Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906143825.199089-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 547bed8140ccfe290f5a633dfeb0b65fd4e8f54c Author: Krzysztof Kozlowski Date: Fri Sep 9 14:54:03 2022 +0200 dt-bindings: remoteproc: qcom,smd-edge: define children SMD edge contains subnodes representing devices related to the remote processor. With limietd number of remote processors, there is a limited set of such devices. List all of them in smd-edge bindings so schema can strictly check for subnodes. Additional benefit is requirement of "qcom,smd-channels" for such subnodes, because their schema cannot enforce it (few devices like APR or FastRPC can be part of either SMD or GLINK edge). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-8-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 6dae25e4df11aed2dbe3b81b81b43c78dce5103f Author: Krzysztof Kozlowski Date: Fri Sep 9 14:54:02 2022 +0200 dt-bindings: soc: qcom: smd: restrict child name to smd-edge Child node of SMD must be either smd-edge or rpm, so the pattern can be narrowed. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-7-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit df870fefd96f958ca9c38386c2d2a0fd84c8d9fc Author: Krzysztof Kozlowski Date: Fri Sep 9 14:54:01 2022 +0200 dt-bindings: remoteproc: qcom,glink-edge: require channels in children GLINK edge contains subnodes representing devices related to the remote processor. Each of such device (e.g. APR or FastRPC) must have a "qcom,glink-channels" property. However the APR or FastRPC device can be also part of other communication - SMD - thus their schema does not require "qcom,glink-channels". To make the GLINK edge bindings strict, require "qcom,glink-channels" for its children. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-6-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit af82840328f9e44d06a98fb2ddf2b24dd728b05e Author: Krzysztof Kozlowski Date: Fri Sep 9 14:54:00 2022 +0200 dt-bindings: misc: qcom,fastrpc: correct example for GLINK edge The parent of FastRPC node is GLINK edge, so the properties should be matching GLINK, not SMD. Correct the example and extend it based on SM8350. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-5-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 94f1f366ca645686e1a85a06b851dbe5fbaba959 Author: Krzysztof Kozlowski Date: Fri Sep 9 14:53:59 2022 +0200 dt-bindings: misc: qcom,fastrpc: restrict channel names The Qualcomm FastRPC is expected to in GLINK or SMD edge node and its channel name is always the same. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-4-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 6eada2efd4c7c37953386f2995ff1cb65f715d5d Author: Krzysztof Kozlowski Date: Fri Sep 9 14:53:58 2022 +0200 dt-bindings: misc: qcom,fastrpc: add compute iommus The children of FastRPC have either one or two IOMMUs in existing DTS (SM8150, SM8450 and others). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-3-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit a44b80926be892b41fe2a7e12297b5b29a1c871d Author: Krzysztof Kozlowski Date: Fri Sep 9 14:53:57 2022 +0200 dt-bindings: misc: qcom,fastrpc: correct qcom,nsessions name The property in old TXT bindings, in Linux driver and in DTS is qcom,nsessions. Fixes: ed18a9b140bc ("dt-bindings: misc: fastrpc convert bindings to yaml") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220909125403.803158-2-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit dd193dcdc9c02ee28ca0490d737d7a0636332569 Author: Arvid Norlander Date: Fri Sep 2 19:40:17 2022 +0200 platform/x86: toshiba_acpi: Add fan RPM reading (internals) This add the internal feature detection and reading function for fan RPM. The approach is based on tracing ACPI calls using AMLI (a tracer/debugger built into ACPI.sys) while using the Windows cooling self-test software. The call used is {HCI_GET, 0x45, 0, 1, 0, 0} which returns: {0x0, 0x45, fan_rpm, probably_max_rpm, 0x0, 0x0} What is probably the max RPM is not currently used. Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220902174018.1720029-2-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit db55fb8a06f241e168a4f275970f2701d52040c6 Author: Mario Limonciello Date: Mon Aug 29 11:29:52 2022 -0500 platform/x86/amd: pmc: Add an extra STB message for checking s2idle entry The `check` callback is run right before the cores are put into HLT. This will allow checking synchronization problems with other software that writes into the STB. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220829162953.5947-5-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 90bec2855c566b6d07cc3e2bb47befb6266cf1ec Author: Mario Limonciello Date: Mon Aug 29 11:29:51 2022 -0500 platform/x86/amd: pmc: Always write to the STB The kernel parameter `enable_stb` currently gates the access to the STB from debugfs and also controls whether the kernel writes events to the STB. Even if not accessing STB data from the kernel it's useful to have this data stored to review the STB. So in suspend/resume always write it. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220829162953.5947-4-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e24faabf5f368c031ad50f0d915a01e1b591f536 Author: Mario Limonciello Date: Mon Aug 29 11:29:50 2022 -0500 platform/x86/amd: pmc: Add defines for STB events Currently `amd-pmc` has two events, but just adds one to the first to distinguish the second. Add a clear definition what these events mean. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220829162953.5947-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 811d59fdf56a17c66742578fe8be8a6a841af448 Author: Mario Limonciello Date: Mon Aug 29 11:29:49 2022 -0500 ACPI: s2idle: Add a new ->check() callback for platform_s2idle_ops On some platforms it is found that Linux more aggressively enters s2idle than Windows enters Modern Standby and this uncovers some synchronization issues for the platform. To aid in debugging this class of problems in the future, add support for an extra optional callback intended for drivers to emit extra debugging. Signed-off-by: Mario Limonciello Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220829162953.5947-2-mario.limonciello@amd.com Signed-off-by: Hans de Goede commit e7536617baec3b4717a37795cec306df9d655d07 Author: Arnd Bergmann Date: Fri Jul 1 11:44:52 2022 +0200 ARM: footbridge: move isa-dma support into footbridge The dma-isa.c was shared between footbridge and shark a long time ago, but as shark was removed, it can be made footbridge specific again. The fb_dma bits in turn are not used at all and can be removed. All the ISA related files are now built into the platform regardless of CONFIG_ISA, as they just refer to on-chip devices rather than actual ISA cards. Reviewed-by: Christoph Hellwig Tested-by: Marc Zyngier Signed-off-by: Arnd Bergmann commit b6dd828445aa3db9503e95863b6dad7483a963a3 Author: Arnd Bergmann Date: Fri Jul 1 11:41:34 2022 +0200 ARM: footbridge: remove leftover from personal-server The machine was removed a while ago, and the checks are now useless. Reviewed-by: Christoph Hellwig Tested-by: Marc Zyngier Signed-off-by: Arnd Bergmann commit b519c9c7e68d5e2e9d5aaff3843fda09342c79d7 Author: Arnd Bergmann Date: Thu Aug 18 17:18:12 2022 +0200 ARM: footbridge: remove addin mode This does not appear to have been used in many years, we can kill off some of the uglier code. Among other things, it avoids a randconfig issue when both modes are disabled: arch/arm/mach-footbridge/common.c:149:24: error: 'ebsa285_host_io_desc' defined but not used [-Werror=unused-variable] 149 | static struct map_desc ebsa285_host_io_desc[] __initdata = { | ^~~~~~~~~~~~~~~~~~~~ arch/arm/mach-footbridge/common.c:136:24: error: 'fb_common_io_desc' defined but not used [-Werror=unused-variable] 136 | static struct map_desc fb_common_io_desc[] __initdata = { | ^~~~~~~~~~~~~~~~~ The recently added phys_to_dma() functions are now trivial and could probably be removed again as a follow-up, if anyone knows how. Cc: Christoph Hellwig Tested-by: Marc Zyngier Signed-off-by: Arnd Bergmann commit f3aaa6125b6f1532d3276d705b1a3791f18a872a Author: Chris Morgan Date: Tue Sep 6 12:48:21 2022 -0500 drm/rockchip: dsi: add rk3568 support Add the compatible and GRF definitions for the RK3568 soc. Signed-off-by: Chris Morgan Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220906174823.28561-4-macroalpha82@gmail.com commit 1c3b502e4327e8e24e617a6f922df72870c0cb5f Author: Chris Morgan Date: Tue Sep 6 12:48:19 2022 -0500 dt-bindings: display: rockchip-dsi: add rk3568 compatible The rk3568 uses the same dw-mipi-dsi controller as previous Rockchip SOCs, so add a compatible string for it. Signed-off-by: Chris Morgan Acked-by: Rob Herring Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220906174823.28561-2-macroalpha82@gmail.com commit 6212d2d9bbde60171d0c534e5f43932f84a06d5e Author: Krzysztof Kozlowski Date: Mon Aug 8 13:15:24 2022 +0300 MAINTAINERS: Drop Bartlomiej Zolnierkiewicz Bartlomiej's Samsung email address is not working since around last year and there was no follow up patch take over of the drivers, so drop the email from maintainers. Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808101526.46556-1-krzysztof.kozlowski@linaro.org commit b9be19eef35587b15da0a5d887d6e04c0c6cefab Author: Phil Auld Date: Tue Sep 6 16:35:42 2022 -0400 drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES As PAGE_SIZE is unsigned long, -1 > PAGE_SIZE when NR_CPUS <= 3. This leads to very large file sizes: topology$ ls -l total 0 -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 core_cpus -r--r--r-- 1 root root 4096 Sep 5 11:59 core_cpus_list -r--r--r-- 1 root root 4096 Sep 5 10:58 core_id -r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 core_siblings -r--r--r-- 1 root root 4096 Sep 5 11:59 core_siblings_list -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 die_cpus -r--r--r-- 1 root root 4096 Sep 5 11:59 die_cpus_list -r--r--r-- 1 root root 4096 Sep 5 11:59 die_id -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 package_cpus -r--r--r-- 1 root root 4096 Sep 5 11:59 package_cpus_list -r--r--r-- 1 root root 4096 Sep 5 10:58 physical_package_id -r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 thread_siblings -r--r--r-- 1 root root 4096 Sep 5 11:59 thread_siblings_list Adjust the inequality to catch the case when NR_CPUS is configured to a small value. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Yury Norov Cc: stable@vger.kernel.org Cc: feng xiangjun Fixes: 7ee951acd31a ("drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist") Reported-by: feng xiangjun Signed-off-by: Phil Auld Signed-off-by: Yury Norov commit 13ef76d89d62809258d04807c9667c875e209690 Author: Luca Weiss Date: Mon Jan 3 08:43:48 2022 +0100 dt-bindings: qcom,pdc: convert to YAML Convert the PDC interrupt controller bindings to YAML. Signed-off-by: Luca Weiss Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220103074348.6039-1-luca.weiss@fairphone.com Signed-off-by: Rob Herring commit 665f5d3577ef43e929d59cf39683037887c351bf Author: Daniel Borkmann Date: Fri Sep 9 16:15:11 2022 +0200 libbpf: Remove gcc support for bpf_tail_call_static for now This reverts commit 14e5ce79943a ("libbpf: Add GCC support for bpf_tail_call_static"). Reason is that gcc invented their own BPF asm which is not conform with LLVM one, and going forward this would be more painful to maintain here and in other areas of the library. Thus remove it; ask to gcc folks is to align with LLVM one to use exact same syntax. Fixes: 14e5ce79943a ("libbpf: Add GCC support for bpf_tail_call_static") Signed-off-by: Daniel Borkmann Cc: James Hilliard Cc: Jose E. Marchesi commit acf3fdc88665a26abfe22827993a2dabf182a513 Author: Georgi Vlaev Date: Tue May 31 23:52:29 2022 +0300 arm64: dts: ti: k3-am625-sk: Add epwm nodes Add epwm nodes and mark them disabled, as they're not currently in use. Signed-off-by: Georgi Vlaev Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220531205229.198011-3-g-vlaev@ti.com commit ab1ad455cf33de6dc1f6cbf0d0d1d49dbe3d9e4f Author: Georgi Vlaev Date: Tue May 31 23:52:28 2022 +0300 arm64: dts: ti: k3-am62-main: Add epwm nodes Add the compatible DT nodes for all EPWM instances present in AM62 SoC. There is a total of 3 EPWM modules available, sharing the same K3 IP as in AM64 SoC. This also adds a required "ti,am62-epwm-tbclk" clock provider node for the EPWM time-base clock. Signed-off-by: Georgi Vlaev Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220531205229.198011-2-g-vlaev@ti.com commit fe53d167129e19ce01c056d85262427146cacf88 Author: wangjianli Date: Thu Sep 8 20:36:16 2022 +0800 drm/rockchip: vop: fix repeated words in comment Delete the redundant word 'in'. Signed-off-by: wangjianli Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220908123616.19195-1-wangjianli@cdjrlc.com commit 3fecf93c86087d1e1a9db28d3423db276639e776 Author: Ville Syrjälä Date: Thu Sep 8 22:16:46 2022 +0300 drm/i915: Use REG_FIELD_GET() to extract skl+ wm latencies Replace the hand rolled stuff with REG_FIELD_GET() for reading out the skl+ watermark latencies. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220908191646.20239-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 42a0d256496f4526046b9779ea6e49018b58f779 Author: Ville Syrjälä Date: Thu Sep 8 22:16:45 2022 +0300 drm/i915: Extract skl_watermark.c Pull all the skl+ watermark code (and the dbuf/sagv/ipc code since it's all sort of intertwined and I'm too lazy to think of a finer grained split right now) into its own file from the catch-all intel_pm.c. Also sneak in the s/dev_priv/i915/ rename while at it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220908191646.20239-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 55544b2811a6c2cac9a823b1bfda53344322dda2 Author: Ville Syrjälä Date: Thu Sep 8 22:16:44 2022 +0300 drm/i915: Split intel_read_wm_latency() into per-platform versions No reaon to have this humongous if ladder in intel_read_wm_latency(). Just split it into nicer per-platforms functions. Also do the s/dev_priv/i915/ while touching all of this code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220908191646.20239-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 51865139511ea9e5193248d7ab686f206399adfc Author: Jilin Yuan Date: Wed Aug 24 21:04:50 2022 +0800 drm/tidss: fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: Jilin Yuan Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220824130450.41703-1-yuanjilin@cdjrlc.com commit a99509ba6d1a406c2af2666b5f896898c54878b6 Author: ye xingchen Date: Wed Aug 10 06:27:38 2022 +0000 drm/omap: dmm_tiler:Remove the print function dev_err() From the coccinelle check: ./drivers/gpu/drm/omapdrm/omap_dmm_tiler.c Error:line 817 is redundant because platform_get_irq() already prints an error So,remove the unnecessary print function dev_err() Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220810062738.13554-1-ye.xingchen@zte.com.cn commit 8b42057e62120813ebe9274f508fa785b7cab33a Author: Liang He Date: Fri Jul 22 22:43:48 2022 +0800 drm/omap: dss: Fix refcount leak bugs In dss_init_ports() and __dss_uninit_ports(), we should call of_node_put() for the reference returned by of_graph_get_port_by_id() in fail path or when it is not used anymore. Fixes: 09bffa6e5192 ("drm: omap: use common OF graph helpers") Signed-off-by: Liang He Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220722144348.1306569-1-windhl@126.com commit e8523f53bf09d274da04e64e24841b4f83f98bca Author: Guo Zhengkui Date: Tue May 17 13:02:06 2022 +0800 drm: omapdrm: dss: replace ternary operator with max() Fix the following coccicheck warning: drivers/gpu/drm/omapdrm/dss/dispc.c:2454:21-22: WARNING opportunity for max() Signed-off-by: Guo Zhengkui Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220517050208.121488-1-guozhengkui@vivo.com commit d5e3050c0feb8bf7b9a75482fafcc31b90257926 Author: Marek Bykowski Date: Fri Sep 9 02:33:57 2022 +0000 of/fdt: Don't calculate initrd size from DT if start > end If the properties 'linux,initrd-start' and 'linux,initrd-end' of the chosen node populated from the bootloader, eg. U-Boot, are so that start > end, then the phys_initrd_size calculated from end - start is negative that subsequently gets converted to a high positive value for being unsigned long long. Then, the memory region with the (invalid) size is added to the bootmem and attempted being paged in paging_init() that results in the kernel fault. For example, on the FVP ARM64 system I'm running, the U-Boot populates the 'linux,initrd-start' with 8800_0000 and 'linux,initrd-end' with 0. The phys_initrd_size calculated is then ffff_ffff_7800_0000 (= 0 - 8800_0000 = -8800_0000 + ULLONG_MAX + 1). paging_init() then attempts to map the address 8800_0000 + ffff_ffff_7800_0000 and oops'es as below. It should be stressed, it is generally a fault of the bootloader's with the kernel relying on it, however we should not allow the bootloader's misconfiguration to lead to the kernel oops. Not only the kernel should be bullet proof against it but also finding the root cause of the paging fault spanning over the bootloader, DT, and kernel may happen is not so easy. Unable to handle kernel paging request at virtual address fffffffefe43c000 Mem abort info: ESR = 0x96000007 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000007 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000080e3d000 [fffffffefe43c000] pgd=0000000080de9003, pud=0000000080de9003 Unable to handle kernel paging request at virtual address ffffff8000de9f90 Mem abort info: ESR = 0x96000005 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000005 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000080e3d000 [ffffff8000de9f90] pgd=0000000000000000, pud=0000000000000000 Internal error: Oops: 96000005 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.51-yocto-standard #1 Hardware name: FVP Base (DT) pstate: 60000085 (nZCv daIf -PAN -UAO) pc : show_pte+0x12c/0x1b4 lr : show_pte+0x100/0x1b4 sp : ffffffc010ce3b30 x29: ffffffc010ce3b30 x28: ffffffc010ceed80 x27: fffffffefe43c000 x26: fffffffefe43a028 x25: 0000000080bf0000 x24: 0000000000000025 x23: ffffffc010b8d000 x22: ffffffc010e3d000 x23: ffffffc010b8d000 x22: ffffffc010e3d000 x21: 0000000080de9000 x20: ffffff7f80000f90 x19: fffffffefe43c000 x18: 0000000000000030 x17: 0000000000001400 x16: 0000000000001c00 x15: ffffffc010cef1b8 x14: ffffffffffffffff x13: ffffffc010df1f40 x12: ffffffc010df1b70 x11: ffffffc010ce3b30 x10: ffffffc010ce3b30 x9 : 00000000ffffffc8 x8 : 0000000000000000 x7 : 000000000000000f x6 : ffffffc010df16e8 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000ffffffff x2 : 0000000000000000 x1 : 0000008080000000 x0 : ffffffc010af1d68 Call trace: show_pte+0x12c/0x1b4 die_kernel_fault+0x54/0x78 __do_kernel_fault+0x11c/0x128 do_translation_fault+0x58/0xac do_mem_abort+0x50/0xb0 el1_da+0x1c/0x90 __create_pgd_mapping+0x348/0x598 paging_init+0x3f0/0x70d0 setup_arch+0x2c0/0x5d4 start_kernel+0x94/0x49c Code: 92748eb5 900052a0 9135a000 cb010294 (f8756a96)  Signed-off-by: Marek Bykowski Link: https://lore.kernel.org/r/20220909023358.76881-1-marek.bykowski@gmail.com Signed-off-by: Rob Herring commit 3af20d2723be5f70e1ce818504a4c093a81b21f5 Author: Geert Uytterhoeven Date: Fri Sep 9 11:09:53 2022 +0200 dt-bindings: gpio: renesas,rcar-gpio: Add r8a779g0 support Document support for the GPIO controller blocks in the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 78f6f5c994ed22a35ce1cd3ec9aeda8e2fa328e6 Author: Mark Rutland Date: Wed Aug 17 16:59:14 2022 +0100 arm64: atomic: always inline the assembly The __lse_*() and __ll_sc_*() atomic implementations are marked as inline rather than __always_inline, permitting a compiler to generate out-of-line versions, which may be instrumented. We marked the atomic wrappers as __always_inline in commit: c35a824c31834d94 ("arm64: make atomic helpers __always_inline") ... but did not think to do the same for the underlying implementations. If the compiler were to out-of-line an LSE or LL/SC atomic, this could break noinstr code. Ensure this doesn't happen by marking the underlying implementations as __always_inline. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Link: https://lore.kernel.org/r/20220817155914.3975112-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit b2c3ccbd0011bb3b51d0fec24cb3a5812b1ec8ea Author: Mark Rutland Date: Wed Aug 17 16:59:13 2022 +0100 arm64: atomics: remove LL/SC trampolines When CONFIG_ARM64_LSE_ATOMICS=y, each use of an LL/SC atomic results in a fragment of code being generated in a subsection without a clear association with its caller. A trampoline in the caller branches to the LL/SC atomic with with a direct branch, and the atomic directly branches back into its trampoline. This breaks backtracing, as any PC within the out-of-line fragment will be symbolized as an offset from the nearest prior symbol (which may not be the function using the atomic), and since the atomic returns with a direct branch, the caller's PC may be missing from the backtrace. For example, with secondary_start_kernel() hacked to contain atomic_inc(NULL), the resulting exception can be reported as being taken from cpus_are_stuck_in_kernel(): | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 | Mem abort info: | ESR = 0x0000000096000004 | EC = 0x25: DABT (current EL), IL = 32 bits | SET = 0, FnV = 0 | EA = 0, S1PTW = 0 | FSC = 0x04: level 0 translation fault | Data abort info: | ISV = 0, ISS = 0x00000004 | CM = 0, WnR = 0 | [0000000000000000] user address but active_mm is swapper | Internal error: Oops: 96000004 [#1] PREEMPT SMP | Modules linked in: | CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.19.0-11219-geb555cb5b794-dirty #3 | Hardware name: linux,dummy-virt (DT) | pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : cpus_are_stuck_in_kernel+0xa4/0x120 | lr : secondary_start_kernel+0x164/0x170 | sp : ffff80000a4cbe90 | x29: ffff80000a4cbe90 x28: 0000000000000000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000000 | x20: 0000000000000001 x19: 0000000000000001 x18: 0000000000000008 | x17: 3030383832343030 x16: 3030303030307830 x15: ffff80000a4cbab0 | x14: 0000000000000001 x13: 5d31666130663133 x12: 3478305b20313030 | x11: 3030303030303078 x10: 3020726f73736563 x9 : 726f737365636f72 | x8 : ffff800009ff2ef0 x7 : 0000000000000003 x6 : 0000000000000000 | x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000100 | x2 : 0000000000000000 x1 : ffff0000029bd880 x0 : 0000000000000000 | Call trace: | cpus_are_stuck_in_kernel+0xa4/0x120 | __secondary_switched+0xb0/0xb4 | Code: 35ffffa3 17fffc6c d53cd040 f9800011 (885f7c01) | ---[ end trace 0000000000000000 ]--- This is confusing and hinders debugging, and will be problematic for CONFIG_LIVEPATCH as these cases cannot be unwound reliably. This is very similar to recent issues with out-of-line exception fixups, which were removed in commits: 35d67794b8828333 ("arm64: lib: __arch_clear_user(): fold fixups into body") 4012e0e22739eef9 ("arm64: lib: __arch_copy_from_user(): fold fixups into body") 139f9ab73d60cf76 ("arm64: lib: __arch_copy_to_user(): fold fixups into body") When the trampolines were introduced in commit: addfc38672c73efd ("arm64: atomics: avoid out-of-line ll/sc atomics") The rationale was to improve icache performance by grouping the LL/SC atomics together. This has never been measured, and this theoretical benefit is outweighed by other factors: * As the subsections are collapsed into sections at object file granularity, these are spread out throughout the kernel and can share cachelines with unrelated code regardless. * GCC 12.1.0 has been observed to place the trampoline out-of-line in specialised __ll_sc_*() functions, introducing more branching than was intended. * Removing the trampolines has been observed to shrink a defconfig kernel Image by 64KiB when building with GCC 12.1.0. This patch removes the LL/SC trampolines, meaning that the LL/SC atomics will be inlined into their callers (or placed in out-of line functions using regular BL/RET pairs). When CONFIG_ARM64_LSE_ATOMICS=y, the LL/SC atomics are always called in an unlikely branch, and will be placed in a cold portion of the function, so this should have minimal impact to the hot paths. Other than the improved backtracing, there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Link: https://lore.kernel.org/r/20220817155914.3975112-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 4b5e694e25ca2cbb5c97694a7d2a473f35099829 Author: Mark Rutland Date: Thu Sep 1 14:06:46 2022 +0100 arm64: stacktrace: track hyp stacks in unwinder's address space Currently unwind_next_frame_record() has an optional callback to convert the address space of the FP. This is necessary for the NVHE unwinder, which tracks the stacks in the hyp VA space, but accesses the frame records in the kernel VA space. This is a bit unfortunate since it clutters unwind_next_frame_record(), which will get in the way of future rework. Instead, this patch changes the NVHE unwinder to track the stacks in the kernel's VA space and translate to FP prior to calling unwind_next_frame_record(). This removes the need for the translate_fp() callback, as all unwinders consistently track stacks in the native address space of the unwinder. At the same time, this patch consolidates the generation of the stack addresses behind the stackinfo_get_*() helpers. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-10-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 8df137300d1964c3810991aa2fe17a105348b647 Author: Mark Rutland Date: Thu Sep 1 14:06:45 2022 +0100 arm64: stacktrace: track all stack boundaries explicitly Currently we call an on_accessible_stack() callback for each step of the unwinder, requiring redundant work to be performed in the core of the unwind loop (e.g. disabling preemption around accesses to per-cpu variables containing stack boundaries). To prevent unwind loops which go through a stack multiple times, we have to track the set of unwound stacks, requiring a stack_type enum which needs to cater for all the stacks of all possible callees. To prevent loops within a stack, we must track the prior FP values. This patch reworks the unwinder to minimize the work in the core of the unwinder, and to remove the need for the stack_type enum. The set of accessible stacks (and their boundaries) are determined at the start of the unwind, and the current stack is tracked during the unwind, with completed stacks removed from the set of accessible stacks. This makes the boundary checks more accurate (e.g. detecting overlapped frame records), and removes the need for separate tracking of the prior FP and visited stacks. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-9-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit bd8abd68836b5c2b668afc4fb46d85d687779dec Author: Mark Rutland Date: Thu Sep 1 14:06:44 2022 +0100 arm64: stacktrace: remove stack type from fp translator In subsequent patches we'll remove the stack_type enum, and move the FP translation logic out of the raw FP unwind code. In preparation for doing so, this patch removes the type parameter from the FP translation callback, and modifies kvm_nvhe_stack_kern_va() to determine the relevant stack directly. So that kvm_nvhe_stack_kern_va() can use the stackinfo_*() helpers, these are moved earlier in the file, but are not modified in any way. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-8-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit d1f684e46bbd43eac5c6fb00906c57425d7022a6 Author: Mark Rutland Date: Thu Sep 1 14:06:43 2022 +0100 arm64: stacktrace: rework stack boundary discovery In subsequent patches we'll want to acquire the stack boundaries ahead-of-time, and we'll need to be able to acquire the relevant stack_info regardless of whether we have an object the happens to be on the stack. This patch replaces the on_XXX_stack() helpers with stackinfo_get_XXX() helpers, with the caller being responsible for the checking whether an object is on a relevant stack. For the moment this is moved into the on_accessible_stack() functions, making these slightly larger; subsequent patches will remove the on_accessible_stack() functions and simplify the logic. The on_irq_stack() and on_task_stack() helpers are kept as these are used by IRQ entry sequences and stackleak respectively. As they're only used as predicates, the stack_info pointer parameter is removed in both cases. As the on_accessible_stack() functions are always passed a non-NULL info pointer, these now update info unconditionally. When updating the type to STACK_TYPE_UNKNOWN, the low/high bounds are also modified, but as these will not be consumed this should have no adverse affect. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 36f9a8793c16da01dffe0718b66c884933b06b98 Author: Mark Rutland Date: Thu Sep 1 14:06:42 2022 +0100 arm64: stacktrace: add stackinfo_on_stack() helper Factor the core predicate out of on_stack() into a helper which can be used on a pre-populated stack_info. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 75758d511432c129db39b50dd3c108e65dd1a2b1 Author: Mark Rutland Date: Thu Sep 1 14:06:41 2022 +0100 arm64: stacktrace: move SDEI stack helpers to stacktrace code For clarity and ease of maintenance, it would be helpful for all the stack helpers to be in the same place. Move the SDEI stack helpers into the stacktrace code where all the other stack helpers live. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: James Morse Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit b532ab5f23389e2141d8b586608f6435f83d5ecd Author: Mark Rutland Date: Thu Sep 1 14:06:40 2022 +0100 arm64: stacktrace: rename unwind_next_common() -> unwind_next_frame_record() The unwind_next_common() function unwinds a single frame record. There are other unwind steps (e.g. unwinding through trampolines) which are handled in the regular kernel unwinder, and in future there may be other common unwind helpers. Clarify the purpose of unwind_next_common() by renaming it to unwind_next_frame_record(). At the same time, add commentary, and delete the redundant comment at the top of asm/stacktrace/common.h. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit bc8d75212d735ac9624c1d3532ad371ec9e570ae Author: Mark Rutland Date: Thu Sep 1 14:06:39 2022 +0100 arm64: stacktrace: simplify unwind_next_common() Currently unwind_next_common() takes a pointer to a stack_info which is only ever used within unwind_next_common(). Make it a local variable and simplify callers. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 16283c54a6c79b589001763421738db96de3ae4e Author: Mark Rutland Date: Thu Sep 1 14:06:38 2022 +0100 arm64: stacktrace: fix kerneldoc comments Many of the comment blocks in the arm64 stacktrace code are *almost* kerneldoc, but not quite. Convert them to kerneldoc, as was presumably originally intended. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Cc: Fuad Tabba Cc: Kalesh Singh Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20220901130646.1316937-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 9025cebf12d1763de36d5e09e2b0a1e4f9b13b28 Author: Joey Gouly Date: Tue Aug 30 11:48:33 2022 +0100 arm64: vdso: use SYS_CNTVCTSS_EL0 for gettimeofday If FEAT_ECV is implemented, the self-synchronized counter CNTVCTSS_EL0 can be used, removing the need for an ISB. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Vincenzo Frascino Cc: Mark Rutland Cc: Andre Przywara Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220830104833.34636-4-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 4e3bca8f7cdd3b658ee7ad700fdce95b5e13a441 Author: Joey Gouly Date: Tue Aug 30 11:48:32 2022 +0100 arm64: alternative: patch alternatives in the vDSO Make it possible to use alternatives in the vDSO, so that better implementations can be used if possible. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Vincenzo Frascino Cc: Mark Rutland Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220830104833.34636-3-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit b3adc3844e1dedd05fa8d09633eaa8ddc5ddcece Author: Joey Gouly Date: Tue Aug 30 11:48:31 2022 +0100 arm64: module: move find_section to header Move it to the header so that the implementation can be shared by the alternatives code. Signed-off-by: Joey Gouly Cc: Will Deacon Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220830104833.34636-2-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 169ccf0e40825d9e465863e4707d8e8546d3c3cb Author: Jilin Yuan Date: Wed Sep 7 12:03:46 2022 +0800 net: openvswitch: fix repeated words in comments Delete the redundant word 'is'. Signed-off-by: Jilin Yuan Signed-off-by: David S. Miller commit 6988c1d37787427b86b05ae8142861a0e8d3e396 Merge: 6fff926141416 019e37eaef97d Author: David S. Miller Date: Fri Sep 9 11:45:25 2022 +0100 Merge branch 'net-ipa-next' Alex Elder says: ==================== net: ipa: don't use lists for transaction state This is the last series of patches to convert the IPA code so integer IDs are used rather than lists to track the state of transactions. A first series of patches added ID fields to track the state of transactions: https://lore.kernel.org/netdev/20220831224017.377745-1-elder@linaro.org The second series started transitioning code to use these IDs rather than lists to manage state: https://lore.kernel.org/netdev/20220902210218.745873-1-elder@linaro.org This final series finishes the transition, to always use IDs instead of the lists to manage transaction state. As a result, the list fields, links, and a spinlock to protect updates are no longer needed, so they are removed. This permits a few other improvements to be implemented. ==================== Signed-off-by: David S. Miller commit 019e37eaef97d99285390b6eb42410a54a5d6412 Author: Alex Elder Date: Tue Sep 6 12:19:42 2022 -0500 net: ipa: don't have gsi_channel_update() return a value If it finds no completed transactions, gsi_channel_trans_complete() calls gsi_channel_update() to check hardware. If new transactions have completed, gsi_channel_update() records that, then calls gsi_channel_trans_complete() to return the first of those found. This recursion won't go any further, but can be avoided if we have gsi_channel_update() only be responsible for updating state after accessing hardware. Change gsi_channel_update() so it simply checks for and handles new completions, without returning a value. If it needs to call that function, have gsi_channel_trans_complete() determine whether there are new transactions available after the update. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit e0e3406c60d7e5b004cc3059dea6c7574d26ca66 Author: Alex Elder Date: Tue Sep 6 12:19:41 2022 -0500 net: ipa: update channel in gsi_channel_trans_complete() Have gsi_channel_trans_complete() update the known state from hardware rather than doing so in gsi_channel_poll_one(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit d338ae28d8a866c57fcac38f3d77bcc1d1702d19 Author: Alex Elder Date: Tue Sep 6 12:19:40 2022 -0500 net: ipa: kill all other transaction lists None of the transaction lists are actually needed any more, because transaction IDs (which have been shown to be equivalent) are used instead. So we can remove all of them, as well as the spinlock that protects updates to them. Not requiring a lock simplifies gsi_trans_free() as well; we only need to check the reference count once to decide whether we've hit the last reference. This makes the links field in the gsi_trans structure unused, so get rid of that as well. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 11902b41f2fa3960280b3a3b17474caa22b54cba Author: Alex Elder Date: Tue Sep 6 12:19:39 2022 -0500 net: ipa: kill the allocated transaction list The only place the trans_info->alloc list is used is when initializing it, when adding a transaction to it when allocation finishes, and when moving a transaction from that list to the committed list. We can just skip putting a transaction on the allocated list, and add it (rather than move it) to the committed list when it is committed. On additional caveat is that an allocated transaction that's committed without any TREs added will be immediately freed. Because we aren't adding allocated transactions to a list any more, the list links need to be initialized to ensure they're valid at the time list_del() is called for the transaction. Then we can safely eliminate the allocated transaction list. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 0c126ec3ddcc81448315e73d196a5a2f42cfd6b4 Author: Alex Elder Date: Tue Sep 6 12:19:38 2022 -0500 net: ipa: always use transaction IDs instead of lists In gsi_channel_trans_complete(), use the completed and pending IDs to determine whether there are any transactions in completed state. Similarly, in gsi_channel_trans_cancel_pending(), use the pending and committed IDs to mark pending transactions cancelled. Rearrange the logic a bit there for a simpler result. This removes the only user of list_last_entry_or_null(), so get rid of that macro. Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 5b8adc815b80eb66d1a028ec7ce0d56ce6c7a81a Author: Biju Das Date: Fri Sep 2 07:27:52 2022 +0100 ARM: dts: r9a06g032-rzn1d400-db: Enable CAN1 The CN10/CN11 on RZ/N1-EB board are headers to add jumpers to select which CAN interface to route to the real CAN connector J16. For a normal use case either we need to wire CAN1 or CAN2, but not both. This patch enables CAN1 and disables CAN2 by default assuming CN10/CN11 is wired for CAN1. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220902062752.56841-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8419e21affa77048a3b5ab27968d2b729cdf9289 Author: Biju Das Date: Tue Aug 30 17:45:17 2022 +0100 ARM: dts: r9a06g032: Add CAN{0,1} nodes Add CAN{0,1} nodes to R9A06G032 (RZ/N1) SoC DTSI. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220830164518.1381632-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e357955558e2f958f1efece874f4b5ad4526d042 Author: Geert Uytterhoeven Date: Fri Aug 19 10:36:22 2022 +0200 MAINTAINERS: Merge ARM/Renesas ARM64 and ARM/SH-Mobile ARM architectures There is not much point in having separate entries for the ARM/Renesas ARM64 and ARM/SH-Mobile ARM architectures, as they have the same maintainers, use the same development collaboration infrastructure, and share many files. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/a869b8afdc47aa637ebeefcc1ca7bc61244f34b9.1660898008.git.geert+renesas@glider.be commit 46ddb8e9e7405281b5f1bb19211632132645666c Merge: 6f67580ca9edb ab2866f12ca18 Author: Geert Uytterhoeven Date: Fri Sep 9 12:13:39 2022 +0200 Merge tag 'renesas-fixes-for-v6.0-tag1' into renesas-arm-dt-for-v6.1 Renesas fixes for v6.0 - Fix the serial console on the Renesas White Hawk development board. commit 6fff926141416a971fcdf7fb71fff404ee53ad47 Merge: 34df6a8a50aa7 4d1d157fb6a49 Author: David S. Miller Date: Fri Sep 9 10:59:13 2022 +0100 Merge branch 'felix-dsa-ethtool-stats' Vladimir Oltean says: ==================== Standardized ethtool counters for Felix DSA driver The main purpose of this change set is to add reporting of structured ethtool statistics counters to the felix DSA driver (see patch 11/14 for details), as a prerequisite for extending these counters to the eMAC/pMAC defined by the IEEE MAC Merge layer. Along the way, the main purpose has diverged into multiple sub-purposes which are also tackled: - A bug fix patch submitted to "net" has made ocelot->stats_lock a spin lock, which is not an issue currently (all Ocelot switches are MMIO), but will be an issue for Colin Foster who is working on a SPI controlled Ocelot switch. We restore the hardware access to port stats to be sleepable. - PSFP (tc-gate, tc-police) tc-flower stats on Felix use a non-converged procedure to access the hardware counters, although the interface is very similar to what is used for the port counters. Benefit from the logic used for the port counters, which gains us 64-bit tc-flower stats that are resistant to overflows. - Also export the ndo_get_stats64 method used by the ocelot switchdev driver to Felix, so that ifconfig sees something hardware-based as well (but not 100% up to date). - Create a new ocelot_stats.c file which groups everything stats-related together. Along with this, also move some other topic-specific code, like FDB and PTP, out of the main ocelot.c. - Minimize the lines of code for the stats layout definitions. These changes alone cause the patch set to have an overall reduction of lines of code in the driver, even though we are adding new functionality as well. Tested the port counters with lockdep and friends, with some garden-variety traffic (ping, iperf3) and the PSFP counters with tools/testing/selftests/drivers/net/ocelot/psfp.sh. ==================== Signed-off-by: David S. Miller commit 4d1d157fb6a49f6720a3fb3135299e475d5bc844 Author: Vladimir Oltean Date: Thu Sep 8 19:48:16 2022 +0300 net: mscc: ocelot: share the common stat definitions between all drivers All switch families supported by the ocelot lib (ocelot, felix, seville) export the same registers so far. But for example felix also has TSN counters, while the others don't. To reduce the bloat even further, create an OCELOT_COMMON_STATS() macro which just lists all stats that are common between switches. The array elements are still replicated among all of vsc9959_stats_layout, vsc9953_stats_layout and ocelot_stats_layout. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b69cf1c675723b1417e018971faf2bcb1620ee7a Author: Vladimir Oltean Date: Thu Sep 8 19:48:15 2022 +0300 net: mscc: ocelot: minimize definitions for stats The current definition of struct ocelot_stat_layout is long-winded (4 lines per entry, and we have hundreds of entries), so we could make an effort to use the C preprocessor and reduce the line count. Create an implicit correspondence between enum ocelot_reg, which tells us the register address (SYS_COUNT_RX_OCTETS etc) and enum ocelot_stat which allows us to index the ocelot->stats array (OCELOT_STAT_RX_OCTETS etc), and don't require us to specify both when we define what stats each switch family has. Create an OCELOT_STAT() macro that pairs only an enum ocelot_stat to an enum ocelot_reg, and an OCELOT_STAT_ETHTOOL() macro which also contains a name exported to the unstructured ethtool -S stringset API. For now, we define all counters as having the OCELOT_STAT_ETHTOOL() kind, but we will add more counters in the future which are not exported to the unstructured ethtool -S. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit be5c13f262050f90b56a4290645bf7a14055d3cd Author: Vladimir Oltean Date: Thu Sep 8 19:48:14 2022 +0300 net: mscc: ocelot: harmonize names of SYS_COUNT_TX_AGING and OCELOT_STAT_TX_AGED The hardware counter is called C_TX_AGED, so rename SYS_COUNT_TX_AGING to SYS_COUNT_TX_AGED. This will become important since we want to minimize the way in which we declare struct ocelot_stat_layout elements, using the C preprocessor. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e32036e1ae7bb71b64559313f9ea8790a0acaa51 Author: Vladimir Oltean Date: Thu Sep 8 19:48:13 2022 +0300 net: mscc: ocelot: add support for all sorts of standardized counters present in DSA DSA is integrated with the new standardized ethtool -S --groups option, but the felix driver only exports unstructured statistics. Reuse the array of 64-bit statistics collected by ocelot_check_stats_work(), but just export select values from it. Since ocelot_check_stats_work() runs periodically to avoid 32-bit overflow, and the ethtool calling context is sleepable, we update the 64-bit stats one more time, to provide up-to-date values. The locking scheme with a mutex followed by a spinlock is a bit hard to digest, so we create and use a ocelot_port_stats_run() helper with a callback that populates the ethool stats group the caller is interested in. The exported stats are: ethtool -S swp0 --groups eth-phy ethtool -S swp0 --groups eth-mac ethtool -S swp0 --groups eth-ctrl ethtool -S swp0 --groups rmon ethtool --include-statistics --show-pause swp0 Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d3e75f1665f37cd7294355dd01bbc72f057a841d Author: Vladimir Oltean Date: Thu Sep 8 19:48:12 2022 +0300 net: mscc: ocelot: exclude stats from bulk regions based on reg, not name We want to introduce elements kept in ocelot->stats that aren't exposed to the unstructured ethtool -S (so they won't have their name populated), but are otherwise checked for 32-bit wraparounds by ocelot_port_update_stats(). This isn't possible today because ocelot_prepare_stats_regions() skips over ocelot_stat_layout elements with no name. Now that we've changed struct ocelot_stat_layout to keep the absolute register address rather than the offset relative to SYS_CNT, we can make use of the unpopulated "reg" value of 0 to mean that the counter isn't present on the current switch revision, and skip it from the preparation of bulk regions. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 776b71e553841f9cde87c21078ce2d9772e6da7a Author: Vladimir Oltean Date: Thu Sep 8 19:48:11 2022 +0300 net: dsa: felix: use ocelot's ndo_get_stats64 method Move the logic from the ocelot switchdev driver's ocelot_get_stats64() method to the common switch lib and reuse it for the DSA driver. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d50e41bf023454cd3441f969f18b259a90b6aa7c Author: Vladimir Oltean Date: Thu Sep 8 19:48:10 2022 +0300 net: mscc: ocelot: move more PTP code from the lib to ocelot_ptp.c Decongest ocelot.c a bit more by moving all PTP related logic (including timestamp processing and PTP packet traps) to ocelot_ptp.c. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 97076c3cc9fed862acb7d4ac0bb846b1bdeede85 Author: Vladimir Oltean Date: Thu Sep 8 19:48:09 2022 +0300 net: mscc: ocelot: unexport ocelot_port_fdb_do_dump from the common lib ocelot_port_fdb_do_dump() is only used by ocelot_net.c, so move it there. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit fe90104cd6048364db821c06bcb2246074919c04 Author: Vladimir Oltean Date: Thu Sep 8 19:48:08 2022 +0300 net: mscc: ocelot: move stats code to ocelot_stats.c The main C file of the ocelot switch lib, ocelot.c, is getting larger and larger, and there are plans to add more logic related to stats. So it seems like an appropriate moment to split the statistics code to a new file. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 28c8df8d478580edd3fa82b60b341930905b7431 Author: Vladimir Oltean Date: Thu Sep 8 19:48:07 2022 +0300 net: mscc: ocelot: sort Makefile files alphabetically Create a clear ordering of the files used to compile the switch lib and the switchdev driver. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit cc160fc29a264726b2bfbc2f551081430db3df03 Author: Vladimir Oltean Date: Thu Sep 8 19:48:06 2022 +0300 net: mscc: ocelot: report FIFO drop counters through stats->rx_dropped if_link.h says: * @rx_dropped: Number of packets received but not processed, * e.g. due to lack of resources or unsupported protocol. * For hardware interfaces this counter may include packets discarded * due to L2 address filtering but should not include packets dropped * by the device due to buffer exhaustion which are counted separately in * @rx_missed_errors (since procfs folds those two counters together). Currently we report "stats->rx_dropped = dev->stats.rx_dropped", the latter being incremented by various entities in the stack. This is not wrong, but we'd like to move ocelot_get_stats64() in the common ocelot switch lib which is independent of struct net_device. To do that, report the hardware RX drop counters instead. These drops are due to policer action, or due to no destinations. When we have no memory in the queue system, report this through rx_missed_errors, as instructed. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 25027c8409b4541611d0060077607d8ca70740df Author: Vladimir Oltean Date: Thu Sep 8 19:48:05 2022 +0300 net: dsa: felix: check the 32-bit PSFP stats against overflow The Felix PSFP counters suffer from the same problem as the ocelot ndo_get_stats64 ones - they are 32-bit, so they can easily overflow and this can easily go undetected. Add a custom hook in ocelot_check_stats_work() through which driver specific actions can be taken, and update the stats for the existing PSFP filters from that hook. Previously, vsc9959_psfp_filter_add() and vsc9959_psfp_filter_del() were serialized with respect to each other via rtnl_lock(). However, with the new entry point into &psfp->sfi_list coming from the periodic worker, we now need an explicit mutex to serialize access to these lists. We used to keep a struct felix_stream_filter_counters on stack, through which vsc9959_psfp_stats_get() - a FLOW_CLS_STATS callback - would retrieve data from vsc9959_psfp_counters_get(). We need to become smarter about that in 3 ways: - we need to keep a persistent set of counters for each stream instead of keeping them on stack - we need to promote those counters from u32 to u64, and create a procedure that properly keeps 64-bit counters. Since we clear the hardware counters anyway, and we poll every 2 seconds, a simple increment of a u64 counter with a u32 value will perfectly do the job. - FLOW_CLS_STATS also expect incremental counters, so we also need to zeroize our u64 counters every time sch_flower calls us Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 96980ff7c2caa5baef0c684e719547a53762e82c Author: Vladimir Oltean Date: Thu Sep 8 19:48:04 2022 +0300 net: mscc: ocelot: make access to STAT_VIEW sleepable again To support SPI-controlled switches in the future, access to SYS_STAT_CFG_STAT_VIEW needs to be done outside of any spinlock protected region, but it still needs to be serialized (by a mutex). Split the ocelot->stats_lock spinlock into a mutex that serializes indirect access to hardware registers (ocelot->stat_view_lock) and a spinlock that serializes access to the u64 ocelot->stats array. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0a2360c59687e4caec363565c166e8a2b3e30677 Author: Vladimir Oltean Date: Thu Sep 8 19:48:03 2022 +0300 net: dsa: felix: add definitions for the stream filter counters TSN stream (802.1Qci, 802.1CB) filters are also accessed through STAT_VIEW, just like the port registers, but these counters are per stream, rather than per port. So we don't keep them in ocelot_port_update_stats(). What we can do, however, is we can create register definitions for them just like we have for the port counters, and delete the last remaining user of the SYS_CNT register + a group index (read_gix). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3e9ae1ce508b8d69762abd1b8b9d9f97d6715b9b Author: Mark Brown Date: Mon Sep 5 23:54:25 2022 +0100 arm64/sysreg: Add defintion for ALLINT The FEAT_NMI extension adds a new system register ALLINT for controlling NMI related interrupt masking, add a definition of this register as per DDI0487H.a. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-29-broonie@kernel.org Signed-off-by: Catalin Marinas commit b1179b75e9a83cfa80accb402dd15ffa6b352080 Author: Mark Brown Date: Mon Sep 5 23:54:24 2022 +0100 arm64/sysreg: Convert SCXTNUM_EL1 to automatic generation Convert SCXTNUM_EL1 to automatic generation as per DDI0487H.a, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-28-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0a45f3980db0446febd21ae6dff475060fd39a39 Author: Mark Brown Date: Mon Sep 5 23:54:23 2022 +0100 arm64/sysreg: Convert TIPDR_EL1 to automatic generation Convert TPIDR_EL1 to automatic generation as per DDI0487H.a, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-27-broonie@kernel.org Signed-off-by: Catalin Marinas commit ef4ba5a635bfbd98c0893430ddfc9baf9fbccee6 Author: Mark Brown Date: Mon Sep 5 23:54:22 2022 +0100 arm64/sysreg: Convert ID_AA64PFR1_EL1 to automatic generation Convert ID_AA64PFR1_EL1 to be automatically generated as per DDI04187H.a, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-26-broonie@kernel.org Signed-off-by: Catalin Marinas commit cea08f2bf406416c9f54366e1328f2ce329bf4fd Author: Mark Brown Date: Mon Sep 5 23:54:21 2022 +0100 arm64/sysreg: Convert ID_AA64PFR0_EL1 to automatic generation Automatically generate the constants for ID_AA64PFR0_EL1 as per DDI0487I.a, no functional changes. The generic defines for the ELx fields are left in place as they remain useful. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-25-broonie@kernel.org Signed-off-by: Catalin Marinas commit cfa3a6c55b61a062afa1ccd8bca45fd270dd3d0f Author: Mark Brown Date: Mon Sep 5 23:54:20 2022 +0100 arm64/sysreg: Convert ID_AA64MMFR2_EL1 to automatic generation Convert ID_AA64MMFR2_EL1 defines to automatic generation as per DDI0487H.a, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-24-broonie@kernel.org Signed-off-by: Catalin Marinas commit 7d751b313dd9b4cb3a33812cf827decb48352d0b Author: Kristina Martsenko Date: Mon Sep 5 23:54:19 2022 +0100 arm64/sysreg: Convert ID_AA64MMFR1_EL1 to automatic generation Convert ID_AA64MMFR1_EL1 to be automatically generated as per DDI0487H.a plus ECBHB which was RES0 in DDI0487H.a but has been subsequently defined and is already present in mainline. No functional changes. Signed-off-by: Kristina Martsenko Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-23-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0b7ed4d8f59c252c7b0339947f69da6770979c0a Author: Mark Brown Date: Mon Sep 5 23:54:18 2022 +0100 arm64/sysreg: Convert ID_AA64MMFR0_EL1 to automatic generation Automatically generate most of the defines for ID_AA64MMFR0_EL1 mostly as per DDI0487H.a. Due to the large amount of MixedCase in this register which isn't really consistent with either the kernel style or the majority of the architecture the use of upper case is preserved. We also leave in place a number of min/max/default value definitions which don't flow from the architecture definitions. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-22-broonie@kernel.org Signed-off-by: Catalin Marinas commit cfaa32108aeaf2f4137e4eb01c82e6d37a732b07 Author: Mark Brown Date: Mon Sep 5 23:54:17 2022 +0100 arm64/sysreg: Convert HCRX_EL2 to automatic generation Convert HCRX_EL2 to be automatically generated as per DDI04187H.a, n functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-21-broonie@kernel.org Signed-off-by: Catalin Marinas commit ed9075201c5a8e89afa969e2bbe947a5ea9c4620 Author: Mark Brown Date: Mon Sep 5 23:54:16 2022 +0100 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 SME enumeration In preparation for automatic generation of constants update the define for SME being implemented to the convention we are using, no functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-20-broonie@kernel.org Signed-off-by: Catalin Marinas commit 514e9b2aed04e86c93363b69318e23b19fb9ef78 Author: Mark Brown Date: Mon Sep 5 23:54:15 2022 +0100 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 BTI enumeration In preparation for automatic generation of constants update the define for BTI being implemented to the convention we are using, no functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-19-broonie@kernel.org Signed-off-by: Catalin Marinas commit cf7fdbbe83a765e8ad2e0a556ec2c4e675bc3893 Author: Mark Brown Date: Mon Sep 5 23:54:14 2022 +0100 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 fractional version fields The naming for fractional versions fields in ID_AA64PFR1_EL1 does not align with that in the architecture, lacking underscores and using upper case where the architecture uses lower case. In preparation for automatic generation of defines bring the code in sync with the architecture, no functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-18-broonie@kernel.org Signed-off-by: Catalin Marinas commit 2e75b393ff2e45a32e9621e1b27cd7854122c1c8 Author: Mark Brown Date: Mon Sep 5 23:54:13 2022 +0100 arm64/sysreg: Standardise naming for MTE feature enumeration In preparation for conversion to automatic generation refresh the names given to the items in the MTE feture enumeration to reflect our standard pattern for naming, corresponding to the architecture feature names they reflect. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-17-broonie@kernel.org Signed-off-by: Catalin Marinas commit 53275da8dccc8f8140f24e2634c5d61e3206307d Author: Mark Brown Date: Mon Sep 5 23:54:12 2022 +0100 arm64/sysreg: Standardise naming for SSBS feature enumeration In preparation for conversion to automatic generation refresh the names given to the items in the SSBS feature enumeration to reflect our standard pattern for naming, corresponding to the architecture feature names they reflect. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-16-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5620b4b0371569b9ba65b756cd6d5fc6af47ddd6 Author: Mark Brown Date: Mon Sep 5 23:54:11 2022 +0100 arm64/sysreg: Standardise naming for ID_AA64PFR0_EL1.AdvSIMD constants The architecture refers to the register field identifying advanced SIMD as AdvSIMD but the kernel refers to it as ASIMD. Use the architecture's naming. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-15-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4f8456c3199dab2436dab1f8ec17cba853fa1060 Author: Mark Brown Date: Mon Sep 5 23:54:10 2022 +0100 arm64/sysreg: Standardise naming for ID_AA64PFR0_EL1 constants We generally refer to the baseline feature implemented as _IMP so in preparation for automatic generation of register defines update those for ID_AA64PFR0_EL1 to reflect this. In the case of ASIMD we don't actually use the define so just remove it. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-14-broonie@kernel.org Signed-off-by: Catalin Marinas commit ca951862ad3e6fa33d8ba8220b80f3fdc496821c Author: Mark Brown Date: Mon Sep 5 23:54:09 2022 +0100 arm64/sysreg: Standardise naming for ID_AA64MMFR2_EL1.CnP The kernel refers to ID_AA64MMFR2_EL1.CnP as CNP. In preparation for automatic generation of defines for the system registers bring the naming used by the kernel in sync with that of DDI0487H.a. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-13-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8f40baded4a14ef56da0b73e028117b146ca4584 Author: Mark Brown Date: Mon Sep 5 23:54:08 2022 +0100 arm64/sysreg: Standardise naming for ID_AA64MMFR2_EL1.VARange The kernel refers to ID_AA64MMFR2_EL1.VARange as LVA. In preparation for automatic generation of defines for the system registers bring the naming used by the kernel in sync with that of DDI0487H.a. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-12-broonie@kernel.org Signed-off-by: Catalin Marinas commit 6fcd019359028f3c6477508b329d69e27f41d895 Author: Kristina Martsenko Date: Mon Sep 5 23:54:07 2022 +0100 arm64/sysreg: Standardise naming for ID_AA64MMFR1_EL1 fields In preparation for converting the ID_AA64MMFR1_EL1 system register defines to automatic generation, rename them to follow the conventions used by other automatically generated registers: * Add _EL1 in the register name. * Rename fields to match the names in the ARM ARM: * LOR -> LO * HPD -> HPDS * VHE -> VH * HADBS -> HAFDBS * SPECSEI -> SpecSEI * VMIDBITS -> VMIDBits There should be no functional change as a result of this patch. Signed-off-by: Kristina Martsenko Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-11-broonie@kernel.org Signed-off-by: Catalin Marinas commit 07d7d848b96b57eccafeafad023d02c7f627d494 Author: Mark Brown Date: Mon Sep 5 23:54:06 2022 +0100 arm64/sysreg: Standardise naming of ID_AA64MMFR0_EL1.ASIDBits For some reason we refer to ID_AA64MMFR0_EL1.ASIDBits as ASID. Add BITS into the name, bringing the naming into sync with DDI0487H.a. Due to the large amount of MixedCase in this register which isn't really consistent with either the kernel style or the majority of the architecture the use of upper case is preserved. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-10-broonie@kernel.org Signed-off-by: Catalin Marinas commit ed7c138d6f82a9e75f27c9ff43262ba8158533b0 Author: Mark Brown Date: Mon Sep 5 23:54:05 2022 +0100 arm64/sysreg: Standardise naming of ID_AA64MMFR0_EL1.BigEnd For some reason we refer to ID_AA64MMFR0_EL1.BigEnd as BIGENDEL. Remove the EL from the name, bringing the naming into sync with DDI0487H.a. Due to the large amount of MixedCase in this register which isn't really consistent with either the kernel style or the majority of the architecture the use of upper case is preserved. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-9-broonie@kernel.org Signed-off-by: Catalin Marinas commit 6ca2b9ca459a598b78265477d288fdec8a0fdd6d Author: Mark Brown Date: Mon Sep 5 23:54:04 2022 +0100 arm64/sysreg: Add _EL1 into ID_AA64PFR1_EL1 constant names Our standard is to include the _EL1 in the constant names for registers but we did not do that for ID_AA64PFR1_EL1, update to do so in preparation for conversion to automatic generation. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-8-broonie@kernel.org Signed-off-by: Catalin Marinas commit 55adc08d7e6433357f2b3b4fee248ae9da1fe2fa Author: Mark Brown Date: Mon Sep 5 23:54:03 2022 +0100 arm64/sysreg: Add _EL1 into ID_AA64PFR0_EL1 definition names Normally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64PFR0_EL1 to follow the convention. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit a957c6be2b88564ed413a03a6009f11b1e5d5806 Author: Mark Brown Date: Mon Sep 5 23:54:02 2022 +0100 arm64/sysreg: Add _EL1 into ID_AA64MMFR2_EL1 definition names Normally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64MMFR2_EL1 to follow the convention. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit 2d987e64e8c756ffcbace4a598444297df28b8a1 Author: Mark Brown Date: Mon Sep 5 23:54:01 2022 +0100 arm64/sysreg: Add _EL1 into ID_AA64MMFR0_EL1 definition names Normally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64MMFR0_EL1 to follow the convention. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit d9b230f644196b2986501ecc45c2b2a41075040d Author: Kristina Martsenko Date: Mon Sep 5 23:54:00 2022 +0100 arm64: cache: Remove unused CTR_CACHE_MINLINE_MASK A recent change renamed CTR_DMINLINE_SHIFT to CTR_EL0_DminLine_SHIFT but didn't fully update CTR_CACHE_MINLINE_MASK. As CTR_CACHE_MINLINE_MASK is not used anywhere anyway, just remove it. Signed-off-by: Kristina Martsenko Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4c8b18af25be2e87b7b62bec397de2cf160555fa Author: Mark Brown Date: Mon Sep 5 23:53:59 2022 +0100 arm64/sysreg: Describe ID_AA64SMFR0_EL1.SMEVer as an enumeration As with the corresponding SVE field ID_AA64ZFR0_EL1.SVEVer and other ID register fields the SMEVer field should be identified as an enumeration but it is currently described as a plain field (most likely due to there presently being only one possible value). Update it to be an enumeration as one would expect. No functional change. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit a04054362e4a9f48a51a742215c2ae1b8bfd04b5 Author: Mark Brown Date: Mon Sep 5 23:53:58 2022 +0100 arm64/sysreg: Remove stray SMIDR_EL1 defines SMIDR_EL1 was converted to automatic generation but some of the constants for fields in it were mistakenly left, remove them. Signed-off-by: Mark Brown Reviewed-by: Kristina Martsenko Link: https://lore.kernel.org/r/20220905225425.1871461-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit e73f57b70a214ab730ac9c7910b85ad372841673 Author: Maxime Ripard Date: Fri Sep 9 11:31:16 2022 +0200 drm/sun4i: tv: Include drm_atomic.h Commit ec491291dc94 ("drm/sun4i: tv: Merge mode_set into atomic_enable") has introduced a call to drm_atomic_get_new_crtc_state(), but didn't include drm_atomic.h. On CONFIG_OF systems, this is fine because drm_atomic.h is included by drm_of.h through drm_bridge.h. However, whenever CONFIG_OF isn't set, we end up with a compilation error. Fixes: ec491291dc94 ("drm/sun4i: tv: Merge mode_set into atomic_enable") Reported-by: kernel test robot Reported-by: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220909093116.4141982-1-maxime@cerno.tech commit f847c74d6e89f10926db58649a05b99237258691 Author: Gaosheng Cui Date: Fri Sep 9 11:38:28 2022 +0800 fsnotify: remove unused declaration fsnotify_alloc_event_holder() and fsnotify_destroy_event_holder() has been removed since commit 7053aee26a35 ("fsnotify: do not share events between notification groups"), so remove it. Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Gaosheng Cui Signed-off-by: Jan Kara commit 34f26a15611afb03c33df6819359d36f5b382589 Author: Chengming Zhou Date: Wed Sep 7 17:03:32 2022 +0800 sched/psi: Per-cgroup PSI accounting disable/re-enable interface PSI accounts stalls for each cgroup separately and aggregates it at each level of the hierarchy. This may cause non-negligible overhead for some workloads when under deep level of the hierarchy. commit 3958e2d0c34e ("cgroup: make per-cgroup pressure stall tracking configurable") make PSI to skip per-cgroup stall accounting, only account system-wide to avoid this each level overhead. But for our use case, we also want leaf cgroup PSI stats accounted for userspace adjustment on that cgroup, apart from only system-wide adjustment. So this patch introduce a per-cgroup PSI accounting disable/re-enable interface "cgroup.pressure", which is a read-write single value file that allowed values are "0" and "1", the defaults is "1" so per-cgroup PSI stats is enabled by default. Implementation details: It should be relatively straight-forward to disable and re-enable state aggregation, time tracking, averaging on a per-cgroup level, if we can live with losing history from while it was disabled. I.e. the avgs will restart from 0, total= will have gaps. But it's hard or complex to stop/restart groupc->tasks[] updates, which is not implemented in this patch. So we always update groupc->tasks[] and PSI_ONCPU bit in psi_group_change() even when the cgroup PSI stats is disabled. Suggested-by: Johannes Weiner Suggested-by: Tejun Heo Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lkml.kernel.org/r/20220907090332.2078-1-zhouchengming@bytedance.com commit dc86aba751e2867244411adda1562f6664747019 Author: Chengming Zhou Date: Fri Aug 26 00:41:10 2022 +0800 sched/psi: Cache parent psi_group to speed up group iteration We use iterate_groups() to iterate each level psi_group to update PSI stats, which is a very hot path. In current code, iterate_groups() have to use multiple branches and cgroup_parent() to get parent psi_group for each level, which is not very efficient. This patch cache parent psi_group in struct psi_group, only need to get psi_group of task itself first, then just use group->parent to iterate. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-10-zhouchengming@bytedance.com commit 57899a6610e67ba26fa3251ebbef4a5ed21efc5d Author: Chengming Zhou Date: Fri Aug 26 00:41:09 2022 +0800 sched/psi: Consolidate cgroup_psi() cgroup_psi() can't return psi_group for root cgroup, so we have many open code "psi = cgroup_ino(cgrp) == 1 ? &psi_system : cgrp->psi". This patch move cgroup_psi() definition to , in which we can return psi_system for root cgroup, so can handle all cgroups. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-9-zhouchengming@bytedance.com commit 52b1364ba0b105122d6de0e719b36db705011ac1 Author: Chengming Zhou Date: Fri Aug 26 00:41:08 2022 +0800 sched/psi: Add PSI_IRQ to track IRQ/SOFTIRQ pressure Now PSI already tracked workload pressure stall information for CPU, memory and IO. Apart from these, IRQ/SOFTIRQ could have obvious impact on some workload productivity, such as web service workload. When CONFIG_IRQ_TIME_ACCOUNTING, we can get IRQ/SOFTIRQ delta time from update_rq_clock_task(), in which we can record that delta to CPU curr task's cgroups as PSI_IRQ_FULL status. Note we don't use PSI_IRQ_SOME since IRQ/SOFTIRQ always happen in the current task on the CPU, make nothing productive could run even if it were runnable, so we only use PSI_IRQ_FULL. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-8-zhouchengming@bytedance.com commit 71dbdde7914d32e86f01ac1f6e54e964c9dfdbd9 Author: Johannes Weiner Date: Fri Aug 26 00:41:07 2022 +0800 sched/psi: Remove NR_ONCPU task accounting We put all fields updated by the scheduler in the first cacheline of struct psi_group_cpu for performance. Since we want add another PSI_IRQ_FULL to track IRQ/SOFTIRQ pressure, we need to reclaim space first. This patch remove NR_ONCPU task accounting in struct psi_group_cpu, use one bit in state_mask to track instead. Signed-off-by: Johannes Weiner Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Chengming Zhou Tested-by: Chengming Zhou Link: https://lore.kernel.org/r/20220825164111.29534-7-zhouchengming@bytedance.com commit 65176f59a18d888684525658a1d0b8bf749d24f3 Author: Chengming Zhou Date: Fri Aug 26 00:41:06 2022 +0800 sched/psi: Optimize task switch inside shared cgroups again Way back when PSI_MEM_FULL was accounted from the timer tick, task switching could simply iterate next and prev to the common ancestor to update TSK_ONCPU and be done. Then memstall ticks were replaced with checking curr->in_memstall directly in psi_group_change(). That meant that now if the task switch was between a memstall and a !memstall task, we had to iterate through the common ancestors at least ONCE to fix up their state_masks. We added the identical_state filter to make sure the common ancestor elimination was skipped in that case. It seems that was always a little too eager, because it caused us to walk the common ancestors *twice* instead of the required once: the iteration for next could have stopped at the common ancestor; prev could have updated TSK_ONCPU up to the common ancestor, then finish to the root without changing any flags, just to get the new curr->in_memstall into the state_masks. This patch recognizes this and makes it so that we walk to the root exactly once if state_mask needs updating, which is simply catching up on a missed optimization that could have been done in commit 7fae6c8171d2 ("psi: Use ONCPU state tracking machinery to detect reclaim") directly. Apart from this, it's also necessary for the next patch "sched/psi: remove NR_ONCPU task accounting". Suppose we walk the common ancestors twice: (1) psi_group_change(.clear = 0, .set = TSK_ONCPU) (2) psi_group_change(.clear = TSK_ONCPU, .set = 0) We previously used tasks[NR_ONCPU] to record TSK_ONCPU, tasks[NR_ONCPU]++ in (1) then tasks[NR_ONCPU]-- in (2), so tasks[NR_ONCPU] still be correct. The next patch change to use one bit in state mask to record TSK_ONCPU, PSI_ONCPU bit will be set in (1), but then be cleared in (2), which cause the psi_group_cpu has task running on CPU but without PSI_ONCPU bit set! With this patch, we will never walk the common ancestors twice, so won't have above problem. Suggested-by: Johannes Weiner Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-6-zhouchengming@bytedance.com commit d79ddb069c5257a924456eb99b53fc1ea715c0a3 Author: Chengming Zhou Date: Fri Aug 26 00:41:05 2022 +0800 sched/psi: Move private helpers to sched/stats.h This patch move psi_task_change/psi_task_switch declarations out of PSI public header, since they are only needed for implementing the PSI stats tracking in sched/stats.h psi_task_switch is obvious, psi_task_change can't be public helper since it doesn't check psi_disabled static key. And there is no any user now, so put it in sched/stats.h too. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-5-zhouchengming@bytedance.com commit e2ad8ab04c5cdfc8dc2f382c45d248ab01dee991 Author: Chengming Zhou Date: Fri Aug 26 00:41:04 2022 +0800 sched/psi: Save percpu memory when !psi_cgroups_enabled We won't use cgroup psi_group when !psi_cgroups_enabled, so don't bother to alloc percpu memory and init for it. Also don't need to migrate task PSI stats between cgroups in cgroup_move_task(). Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-4-zhouchengming@bytedance.com commit 58d8c2586cedb8a67f6f0dffa5eaed0f89135b39 Author: Chengming Zhou Date: Fri Aug 26 00:41:03 2022 +0800 sched/psi: Don't create cgroup PSI files when psi_disabled commit 3958e2d0c34e ("cgroup: make per-cgroup pressure stall tracking configurable") make PSI can be configured to skip per-cgroup stall accounting. And doesn't expose PSI files in cgroup hierarchy. This patch do the same thing when psi_disabled. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-3-zhouchengming@bytedance.com commit c530a3c716b963625e43aa915e0de6b4d1ce8ad9 Author: Chengming Zhou Date: Fri Aug 26 00:41:02 2022 +0800 sched/psi: Fix periodic aggregation shut off We don't want to wake periodic aggregation work back up if the task change is the aggregation worker itself going to sleep, or we'll ping-pong forever. Previously, we would use psi_task_change() in psi_dequeue() when task going to sleep, so this check was put in psi_task_change(). But commit 4117cebf1a9f ("psi: Optimize task switch inside shared cgroups") defer task sleep handling to psi_task_switch(), won't go through psi_task_change() anymore. So this patch move this check to psi_task_switch(). Fixes: 4117cebf1a9f ("psi: Optimize task switch inside shared cgroups") Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220825164111.29534-2-zhouchengming@bytedance.com commit 0fb7b6f9d367965a8c2497c4d437dd225193b0f6 Merge: 7e18e42e4b280 61742a7cd5b19 Author: Peter Zijlstra Date: Fri Sep 9 11:08:30 2022 +0200 Merge branch 'driver-core/driver-core-next' Pull in dependent cgroup patches Signed-off-by: Peter Zijlstra commit d11b1e908e9a1301e43cefc37fc17dd2b1257b77 Author: Gaosheng Cui Date: Fri Sep 9 14:33:37 2022 +0800 driver core: remove make_class_name declaration make_class_name has been removed since commit 39aba963d937 ("driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220909063337.1146151-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 2122c0d0f5a13ee91a051e3c93e458a24c161944 Author: Shuah Khan Date: Thu Sep 1 15:23:19 2022 -0600 docs: update mediator information in CoC docs Update mediator information in the CoC interpretation document. Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220901212319.56644-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit bdbb0bbcf858adb26dfcd27f26f91cbf33338d4c Author: Salvatore Bonaccorso Date: Thu Sep 1 20:43:28 2022 +0200 Documentation: stable: Document alternative for referring upstream commit hash Additionally to the "commit upstream." variant, "[ Upstream commit ]" is used as well as alternative to refer to the upstream commit hash. Signed-off-by: Salvatore Bonaccorso Link: https://lore.kernel.org/r/20220901184328.4075701-1-carnil@debian.org Signed-off-by: Greg Kroah-Hartman commit ccf3a570410af607124534396cfc0e9a0986b5e8 Author: Al Viro Date: Fri Sep 2 06:32:14 2022 +0100 termios: kill uapi termios.h that are identical to generic one mandatory-y will have the generic picked for architectures that don't have uapi/asm/termios.h of their own. ia64, parisc and s390 ones are identical to generic, so... Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxGVXpS2dWoTwoa0@ZenIV Signed-off-by: Greg Kroah-Hartman commit 89bbeb7e3199e1514729aa6de8057289e6375fe6 Author: Al Viro Date: Tue Aug 9 19:41:40 2022 -0400 termios: get rid of non-UAPI asm/termios.h All non-UAPI asm/termios.h consist of include of UAPI counterpart and, possibly, include of linux/uaccess.h The latter can't be simply removed, even though nothing in linux/termios.h doesn't depend upon it anymore - there are several places that rely upon that indirect chain of includes to pull linux/uaccess.h. So the include needs to be lifted out of there - we lift into tty_driver.h, serdev.h and places that pull asm/termios.h, but none of * linux/uaccess.h (obvious) * net/sock.h (pulls uaccess.h) * linux/{tty,tty_driver,serdev}.h (tty.h pulls tty_driver.h) That leaves us just with the include of UAPI asm/termios.h, which is what will resolve to if we simply remove non-UAPI header. Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDnKvYCHn/ogBUv@ZenIV Signed-off-by: Greg Kroah-Hartman commit e7b4c812b9685e22753d6355e53fdeaaa22862dd Author: Al Viro Date: Tue Aug 9 19:41:40 2022 -0400 termios: convert the last (sparc) INIT_C_CC to array Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDnDCR2VRTA3Etp@ZenIV Signed-off-by: Greg Kroah-Hartman commit d04f9915fa44b52d7a91080677381a082238e9c4 Author: Al Viro Date: Sun Sep 9 17:57:42 2018 -0400 make generic INIT_C_CC a bit more generic turn it into an array initializer; then alpha, mips and powerpc variants fold into it. Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDm7M6M91gC2RPL@ZenIV Signed-off-by: Greg Kroah-Hartman commit 38fc315a73f7a1b2d19eb32dd55de089b78b2a54 Author: Al Viro Date: Tue Aug 9 17:17:04 2022 -0400 termios: consolidate values for VDISCARD in INIT_C_CC On old systems it used to be ^O. Linux had never actually used the value, but INIT_C_CC (on i386) did initialize it to ^O; unfortunately, it had a typo in the comment claiming that to be ^U. Most of the architectures copied the (correct) definition along with mistaken comment. alpha, powerpc and sparc tried to make the definition match comment. However, util-linux still resets it to ^O on any architecture, ^O is the historical value, kernel ignores it anyway and finally, Linus said "Just change everybody to do the same, nobody cares about VDISCARD". Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmy//MKzs3ye7l@ZenIV Signed-off-by: Greg Kroah-Hartman commit c9874d3ffeaf8ee215187692ed918b3031d996d1 Author: Al Viro Date: Thu Aug 16 11:47:53 2018 -0400 termios: start unifying non-UAPI parts of asm/termios.h * new header (linut/termios_internal.h), pulled by the users of those suckers * defaults for INIT_C_CC and externs for conversion helpers moved over there * remove termios-base.h (empty now) Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmptU7dNGZ+/Hn@ZenIV Signed-off-by: Greg Kroah-Hartman commit 1d5d66825610bb7be23e2229731261c8e99eaa28 Author: Al Viro Date: Sat Aug 20 19:36:09 2022 -0400 termios: uninline conversion helpers default go into drivers/tty/tty_ioctl.c, unusual - into arch/*/kernel/termios.c (only alpha and sparc have those). Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmeUBHo0s/Ew8b@ZenIV Signed-off-by: Greg Kroah-Hartman commit ceecbbddbf549fe0b7ffa3804a6e255b3360030f Author: Xuezhi Zhang Date: Thu Sep 1 09:34:23 2022 +0800 comedi: convert sysfs snprintf to sysfs_emit Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Xuezhi Zhang Link: https://lore.kernel.org/r/20220901013423.418464-1-zhangxuezhi3@gmail.com Signed-off-by: Greg Kroah-Hartman commit a90044ef5605bc0961356548526c44964bc819a7 Author: GUO Zihua Date: Fri Sep 9 16:20:48 2022 +0800 staging: rtl8723bs: Fix return type for implementation of ndo_start_xmit CFI (Control Flow Integrity) is a safety feature allowing the system to detect and react should a potential control flow hijacking occurs. In particular, the Forward-Edge CFI protects indirect function calls by ensuring the prototype of function that is actually called matches the definition of the function hook. Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this would get cought out by CFI and cause a panic. Use enums from netdev_tx_t as return value instead. Then change return type to netdev_tx_t. Fixes: cf68fffb66d6 ("add support for Clang CFI") Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220909082048.14486-3-guozihua@huawei.com Signed-off-by: Greg Kroah-Hartman commit 5bf83bef3bdc3e8e8285660713d4df086ce45aba Author: GUO Zihua Date: Fri Sep 9 16:20:47 2022 +0800 staging: rtl8723bs: Delete un-necessary return for _rtw_xmit_entry() As _rtw_xmit_entry() would always return 0, we are save to delete the return value for it. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220909082048.14486-2-guozihua@huawei.com Signed-off-by: Greg Kroah-Hartman commit 8e30538eca016de8e252bef174beadecd64239f0 Author: Shunsuke Mie Date: Wed Sep 7 11:01:00 2022 +0900 misc: pci_endpoint_test: Fix pci_endpoint_test_{copy,write,read}() panic The dma_map_single() doesn't permit zero length mapping. It causes a follow panic. A panic was reported on arm64: [ 60.137988] ------------[ cut here ]------------ [ 60.142630] kernel BUG at kernel/dma/swiotlb.c:624! [ 60.147508] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 60.152992] Modules linked in: dw_hdmi_cec crct10dif_ce simple_bridge rcar_fdp1 vsp1 rcar_vin videobuf2_vmalloc rcar_csi2 v4l 2_mem2mem videobuf2_dma_contig videobuf2_memops pci_endpoint_test videobuf2_v4l2 videobuf2_common rcar_fcp v4l2_fwnode v4l2_asyn c videodev mc gpio_bd9571mwv max9611 pwm_rcar ccree at24 authenc libdes phy_rcar_gen3_usb3 usb_dmac display_connector pwm_bl [ 60.186252] CPU: 0 PID: 508 Comm: pcitest Not tainted 6.0.0-rc1rpci-dev+ #237 [ 60.193387] Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT) [ 60.201302] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 60.208263] pc : swiotlb_tbl_map_single+0x2c0/0x590 [ 60.213149] lr : swiotlb_map+0x88/0x1f0 [ 60.216982] sp : ffff80000a883bc0 [ 60.220292] x29: ffff80000a883bc0 x28: 0000000000000000 x27: 0000000000000000 [ 60.227430] x26: 0000000000000000 x25: ffff0004c0da20d0 x24: ffff80000a1f77c0 [ 60.234567] x23: 0000000000000002 x22: 0001000040000010 x21: 000000007a000000 [ 60.241703] x20: 0000000000200000 x19: 0000000000000000 x18: 0000000000000000 [ 60.248840] x17: 0000000000000000 x16: 0000000000000000 x15: ffff0006ff7b9180 [ 60.255977] x14: ffff0006ff7b9180 x13: 0000000000000000 x12: 0000000000000000 [ 60.263113] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 [ 60.270249] x8 : 0001000000000010 x7 : ffff0004c6754b20 x6 : 0000000000000000 [ 60.277385] x5 : ffff0004c0da2090 x4 : 0000000000000000 x3 : 0000000000000001 [ 60.284521] x2 : 0000000040000000 x1 : 0000000000000000 x0 : 0000000040000010 [ 60.291658] Call trace: [ 60.294100] swiotlb_tbl_map_single+0x2c0/0x590 [ 60.298629] swiotlb_map+0x88/0x1f0 [ 60.302115] dma_map_page_attrs+0x188/0x230 [ 60.306299] pci_endpoint_test_ioctl+0x5e4/0xd90 [pci_endpoint_test] [ 60.312660] __arm64_sys_ioctl+0xa8/0xf0 [ 60.316583] invoke_syscall+0x44/0x108 [ 60.320334] el0_svc_common.constprop.0+0xcc/0xf0 [ 60.325038] do_el0_svc+0x2c/0xb8 [ 60.328351] el0_svc+0x2c/0x88 [ 60.331406] el0t_64_sync_handler+0xb8/0xc0 [ 60.335587] el0t_64_sync+0x18c/0x190 [ 60.339251] Code: 52800013 d2e00414 35fff45c d503201f (d4210000) [ 60.345344] ---[ end trace 0000000000000000 ]--- To fix it, this patch adds a checking the payload length if it is zero. Fixes: 343dc693f7b7 ("misc: pci_endpoint_test: Prevent some integer overflows") Cc: stable Signed-off-by: Shunsuke Mie Link: https://lore.kernel.org/r/20220907020100.122588-2-mie@igel.co.jp Signed-off-by: Greg Kroah-Hartman commit 3e42deaac06567c7e86d287c305ccda24db4ae3d Author: Shunsuke Mie Date: Wed Sep 7 11:00:59 2022 +0900 misc: pci_endpoint_test: Aggregate params checking for xfer Each transfer test functions have same parameter checking code. This patch unites those to an introduced function. Signed-off-by: Shunsuke Mie Cc: stable Link: https://lore.kernel.org/r/20220907020100.122588-1-mie@igel.co.jp Signed-off-by: Greg Kroah-Hartman commit eb3b3c93afc4a4244590f7d1e715e8b6749585a9 Author: Fabio M. De Francesco Date: Thu Sep 1 17:44:08 2022 +0200 misc/xilinx_sdfec: Replace kmap() with kmap_local_page() kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as the mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in xilinx_sdfec.c is safe, replace kmap()i / kunmap() with kmap_local_page() / kunmap_local(). Cc: "Venkataramanan, Anirudh" Suggested-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220901154408.23984-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit e01b08d7f6d36f20533b7510ea3af90756125f35 Author: Fabio M. De Francesco Date: Thu Sep 1 17:44:07 2022 +0200 misc/xilinx_sdfec: Call kunmap() on pages mapped with kmap() Pages in an array are mapped in a loop but, after the code is done with the virtual addresses, these pages are never unmapped. Therefore, call kunmap() to unmap pages[i]. Cc: "Venkataramanan, Anirudh" Cc: Ira Weiny Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220901154408.23984-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit dd8dc442c1e3b1798fad61211f3b090523dd926d Author: Fabio M. De Francesco Date: Thu Sep 1 15:57:14 2022 +0200 misc/vmw_vmci: Use kmap_local_page() in vmci_queue_pair.c kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as the mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in vmci_queue_pair.c is safe everywhere, replace kmap() with kmap_local_page(). Cc: "Venkataramanan, Anirudh" Suggested-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220901135714.16481-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2699e6e9e9481884c4a006f1c62dd6ed59ca38d5 Author: Jiasheng Jiang Date: Thu Sep 1 22:46:19 2022 +0800 virt: vbox: Remove unproper information When drivers are working properly, they are quiet. Therefore, the vbg_info() should be removed. Suggested-by: Greg Kroah-Hartman Reviewed-by: Hans de Goede Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220901144619.3550352-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit d4d2c58bdb9190baa1d5e1719c1339fcb2c17642 Author: Jiasheng Jiang Date: Thu Sep 1 22:46:10 2022 +0800 virt: vbox: convert to use dev_groups The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Moreover, it can guarantee the success of creation. Therefore, it should be better to convert to use dev_groups. Fixes: 0ba002bc4393 ("virt: Add vboxguest driver for Virtual Box Guest integration") Reviewed-by: Hans de Goede Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220901144610.3550300-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit 96d3e6f05f5b7ec1cadb6a26c05093efcf062432 Author: ye xingchen Date: Fri Sep 2 07:30:55 2022 +0000 crypto: nx - Remove the unneeded result variable Return the value set_msg_len() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Reviewed-by: Breno Leitao Signed-off-by: Herbert Xu commit 68dbe80f5b510c66c800b9e8055235c5b07e37d1 Author: Koba Ko Date: Thu Sep 1 22:47:12 2022 +0800 crypto: ccp - Release dma channels before dmaengine unrgister A warning is shown during shutdown, __dma_async_device_channel_unregister called while 2 clients hold a reference WARNING: CPU: 15 PID: 1 at drivers/dma/dmaengine.c:1110 __dma_async_device_channel_unregister+0xb7/0xc0 Call dma_release_channel for occupied channles before dma_async_device_unregister. Fixes: 54cce8ecb925 ("crypto: ccp - ccp_dmaengine_unregister release dma channels") Reported-by: kernel test robot Signed-off-by: Koba Ko Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 24ddd4e1dbfcf530b89c3d994789cc2e57cbe713 Author: ye xingchen Date: Thu Sep 1 07:43:48 2022 +0000 crypto: octeontx - Remove the unneeded result variable Return the value cptvf_send_msg_to_pf_timeout() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Herbert Xu commit bc155c6c188c2f0c5749993b1405673d25a80389 Author: Ignat Korchagin Date: Wed Aug 31 19:37:06 2022 +0100 crypto: akcipher - default implementation for setting a private key Changes from v1: * removed the default implementation from set_pub_key: it is assumed that an implementation must always have this callback defined as there are no use case for an algorithm, which doesn't need a public key Many akcipher implementations (like ECDSA) support only signature verifications, so they don't have all callbacks defined. Commit 78a0324f4a53 ("crypto: akcipher - default implementations for request callbacks") introduced default callbacks for sign/verify operations, which just return an error code. However, these are not enough, because before calling sign the caller would likely call set_priv_key first on the instantiated transform (as the in-kernel testmgr does). This function does not have a default stub, so the kernel crashes, when trying to set a private key on an akcipher, which doesn't support signature generation. I've noticed this, when trying to add a KAT vector for ECDSA signature to the testmgr. With this patch the testmgr returns an error in dmesg (as it should) instead of crashing the kernel NULL ptr dereference. Fixes: 78a0324f4a53 ("crypto: akcipher - default implementations for request callbacks") Signed-off-by: Ignat Korchagin Signed-off-by: Herbert Xu commit dc377e013bec20dfedaec5d1f6327e4d57da359b Author: Sun Ke Date: Tue Aug 30 11:13:47 2022 +0800 crypto: aspeed - fix return value check in aspeed_hace_probe() In case of error, the function devm_ioremap_resource() returns ERR_PTR() not NULL. The NULL test in the return value check must be replaced with IS_ERR(). Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver") Signed-off-by: Sun Ke Reviewed-by: Neal Liu Signed-off-by: Herbert Xu commit c5144241d28cfbca11d75ad334bbacabad0becaf Author: Wei Yongjun Date: Wed Sep 7 14:58:08 2022 +0000 misc: microchip: pci1xxxx: use module_auxiliary_driver Use the module_auxiliary_driver() macro to make the code simpler by eliminating module_init and module_exit calls. Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.") Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220907145808.1789249-5-weiyongjun@huaweicloud.com Signed-off-by: Greg Kroah-Hartman commit e102ef816f08f4745c4d68ec0560bdd072a568d4 Author: Wei Yongjun Date: Wed Sep 7 14:58:07 2022 +0000 misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.") Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220907145808.1789249-4-weiyongjun@huaweicloud.com Signed-off-by: Greg Kroah-Hartman commit 6b9a8679c2d76c592aca335b5981fde5753546eb Author: Wei Yongjun Date: Wed Sep 7 14:58:06 2022 +0000 misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static The sparse tool complains as follows: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:409:34: warning: symbol 'pci1xxxx_gpio_auxiliary_id_table' was not declared. Should it be static? This symbol is not used outside of mchp_pci1xxxx_gpio.c, so marks it static. Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.") Reported-by: kernel test robot Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220907145808.1789249-3-weiyongjun@huaweicloud.com Signed-off-by: Greg Kroah-Hartman commit 8c297fbdc3a412f6874afade72540470b6ab34ee Author: Wei Yongjun Date: Wed Sep 7 14:58:05 2022 +0000 misc: microchip: pci1xxxx: Fix missing spin_lock_init() The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.") Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220907145808.1789249-2-weiyongjun@huaweicloud.com Signed-off-by: Greg Kroah-Hartman commit c15d7e11ae4de6e592c69b7f30312238571a7c78 Author: Wei Yongjun Date: Wed Sep 7 14:58:04 2022 +0000 misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() In some error handling path, resoures alloced may not released. This patch fix them. Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") Reviewed-by: Kumaravel Thiagarajan Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220907145808.1789249-1-weiyongjun@huaweicloud.com Signed-off-by: Greg Kroah-Hartman commit e662d349ab6601ffaadd3403bca2775c8ffc050d Author: Andy Shevchenko Date: Thu Sep 8 17:21:34 2022 +0300 pinctrl: cy8c95x0: Use 'default' in all switch-cases (part 2) Move the default values to the 'default' case in the switches. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908142134.59068-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 513d9a61156d79dd0979c4ad400c8587f52cbb9d Author: GUO Zihua Date: Mon Sep 5 21:00:53 2022 +0800 staging: rtl8192e: Fix return type for implementation of ndo_start_xmit CFI (Control Flow Integrity) is a safety feature allowing the system to detect and react should a potential control flow hijacking occurs. In particular, the Forward-Edge CFI protects indirect function calls by ensuring the prototype of function that is actually called matches the definition of the function hook. Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this would get cought out by CFI and cause a panic. Use enums from netdev_tx_t as return value instead, then change return type to netdev_tx_t. Note that rtllib_xmit_inter() would return 1 only on allocation failure and the queue is stopped if that happens, meeting the documented requirement if NETDEV_TX_BUSY should be returned by ndo_start_xmit. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220905130053.10731-1-guozihua@huawei.com Signed-off-by: Greg Kroah-Hartman commit 307d343620e1fc7a6a2b7a1cdadb705532c9b6a5 Author: GUO Zihua Date: Mon Sep 5 21:02:30 2022 +0800 staging: rtl8712: Fix return type for implementation of ndo_start_xmit CFI (Control Flow Integrity) is a safety feature allowing the system to detect and react should a potential control flow hijacking occurs. In particular, the Forward-Edge CFI protects indirect function calls by ensuring the prototype of function that is actually called matches the definition of the function hook. Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this would get cought out by CFI and cause a panic. Use enums from netdev_tx_t as return value instead, then change return type to netdev_tx_t. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220905130230.11230-1-guozihua@huawei.com Signed-off-by: Greg Kroah-Hartman commit b863ce8cf619ed2c836998fcae06d9ca0c792946 Author: Asif Khan Date: Mon Sep 5 00:54:00 2022 +0530 staging: rtl8712: fix camelcase in UserPriority Replace camelcase variable UserPriority with snake case variable user_priority. Signed-off-by: Asif Khan Link: https://lore.kernel.org/r/20220904192400.8309-1-asif.kgauri@gmail.com Signed-off-by: Greg Kroah-Hartman commit d517cdeb904ddc0cbebcc959d43596426cac40b0 Author: Greg Kroah-Hartman Date: Fri Sep 2 16:37:15 2022 +0200 staging: greybus: audio_helper: remove unused and wrong debugfs usage In the greybus audio_helper code, the debugfs file for the dapm has the potential to be removed and memory will be leaked. There is also the very real potential for this code to remove ALL debugfs entries from the system, and it seems like this is what will really happen if this code ever runs. This all is very wrong as the greybus audio driver did not create this debugfs file, the sound core did and controls the lifespan of it. So remove all of the debugfs logic from the audio_helper code as there's no way it could be correct. If this really is needed, it can come back with a fixup for the incorrect usage of the debugfs_lookup() call which is what caused this to be noticed at all. Cc: Johan Hovold Cc: Alex Elder Cc: Greg Kroah-Hartman Cc: stable Link: https://lore.kernel.org/r/20220902143715.320500-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 3827974ecae1008417451a371cfbd7faa040ca4b Author: Michael Straube Date: Thu Sep 8 15:09:15 2022 +0200 staging: r8188eu: remove unnecessary return labels. Remove the RETURN labels in rtw_alloc_etherdev_with_old_priv() and rtw_alloc_etherdev() and return directly to clean up the code and improve readability. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220908130915.8406-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4cf393aeaf5f130ed84957f23cf8edbb21ab0392 Author: Michael Straube Date: Thu Sep 8 15:09:14 2022 +0200 staging: r8188eu: make two functions static The functions UpdateBrateTbl() and UpdateBrateTblForSoftAP() are only used in rtw_mlme_ext.c. Make them static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220908130915.8406-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0dd1eb711e8bfe22e1dffb054e6d7e1856b69d96 Author: Michael Straube Date: Thu Sep 8 15:09:13 2022 +0200 staging: r8188eu: remove unused parameter from UpdateBrateTbl() The parameter 'Adapter' of UpdateBrateTbl() is unused. Remove it. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220908130915.8406-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fcd5936bd881df1365d54352e2e535dff977463 Author: Michael Straube Date: Thu Sep 8 15:09:12 2022 +0200 staging: r8188eu: remove unused parameters from _BeaconFunctionEnable() The parameters 'Enable' and 'Linked' of _BeaconFunctionEnable() are unused. Remove them. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220908130915.8406-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e2e8e82e03f9636a13f6b7e4d81f0a665aae3728 Author: Michael Straube Date: Thu Sep 8 09:28:15 2022 +0200 staging: r8188eu: remove some unused enums Remove some unused enums to clean up the driver code. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220908072815.31002-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bbec514624f1e62d026253c566b67e4e79d9b681 Author: Martin Kaiser Date: Mon Sep 5 22:01:46 2022 +0200 staging: r8188eu: do not "scan blink" if we have a link Do not blink the led to indicate that we're scanning if we are already connected to a wireless network. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 96b3043412e06babdc5d43ea832b204b4e5ebaa6 Author: Martin Kaiser Date: Mon Sep 5 22:01:45 2022 +0200 staging: r8188eu: reset blink state when WPS fails When WPS fails, WPS blinking is no longer in progress. The if statement can be removed. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9b34e23b1fff0d70a9939c5a29aa3c629716c305 Author: Martin Kaiser Date: Mon Sep 5 22:01:44 2022 +0200 staging: r8188eu: always cancel blink_work when WPS failed Cancel blink_work if WPS fails. Another worker will be scheduled after the state variables are updated. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit de9c3e9ea926f8164b77383bfbc9fcac01b95af2 Author: Martin Kaiser Date: Mon Sep 5 22:01:43 2022 +0200 staging: r8188eu: always update status before WPS blinking Always update the status variables in rtw_led_control when we start WPS blinking. The code is easier to understand without the if conditions. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5221e12b717f718caa7fa1f178a7b3a941d0747a Author: Martin Kaiser Date: Mon Sep 5 22:01:42 2022 +0200 staging: r8188eu: always cancel blink_work before WPS blinking In rtw_led_control, we can always cancel a running blink worker when we start WPS blinking. The worker will be scheduled again and there's no point in having more than one pending blink worker. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a5f01428bb1ab5af21b72d5811f25f2a6944af01 Author: Martin Kaiser Date: Mon Sep 5 22:01:41 2022 +0200 staging: r8188eu: don't restart WPS blinking unnecessarily Simplify one of the cases in rtw_led_control. If we're already blinking during WPS, we don't have to restart this blinking when the caller requests it again. We can simply return and keep on blinking. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d25cb8382a042ec21d725e3d819c259de20666d4 Author: Martin Kaiser Date: Mon Sep 5 22:01:40 2022 +0200 staging: r8188eu: simplify the LED_CTL_POWER_OFF case When a caller of rtw_led_control requests that the led be switched off, we should cancel the blink worker and set all blinking state variables to false. This does not depend on the current blinking state. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905200146.82259-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cbdeb787905d76d91c932cc69302c1be5d2306d9 Author: Martin Kaiser Date: Mon Sep 5 21:56:12 2022 +0200 staging: r8188eu: remove channel parameters from rtw_sitesurvey_cmd The rtw_sitesurvey_cmd function may receive an array of channels in the ch and ch_num parameters. All of the callers set ch = NULL and ch_num = 0. Remove the two parameters from rtw_sitesurvey_cmd and the code to process them. Tested-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220905195612.81945-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3a09f934df4eb5a01777416fc4f317293b37e563 Author: Michael Straube Date: Thu Sep 1 19:21:20 2022 +0200 staging: r8188eu: remove mlme_osdep.h The function indicate_wx_scan_complete_event() is declared multiple times. That is not needed. Remove redundant declarations to clean up the driver code and remove the now empty header mlme_osdep.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220901172120.8485-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 721740f8b8c203e36c0e6d6fd47e7063a7bfb29e Author: Nam Cao Date: Fri Sep 2 11:52:00 2022 +0200 staging: rtl8723bs: remove rtw_is_wps_ie Remove function rtw_is_wps_ie because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/69f128559008c94e29eab511a92964810688288e.1662111799.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d0cb6588d6d18f635f91403d4e82d360f843d17 Author: Nam Cao Date: Fri Sep 2 11:51:59 2022 +0200 staging: rtl8723bs: remove IsHexDigit Remove function IsHexDigit because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/8c70ecd9bea1dff2cb8f69e12bbef6aa4ee39977.1662111799.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 54b1d117d51ab4462e1fc3a1f77ebbbad6996c0b Author: Nam Cao Date: Fri Sep 2 11:51:58 2022 +0200 staging: rtl8723bs: remove rtw_hal_is_disable_sw_channel_plan Remove function rtw_hal_is_disable_sw_channel_plan because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/4398fec06b0f8defaa7da9d6abbc155cbb7ae630.1662111799.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 23c3b6bd0f16e05e306bedb8de7b875008bfb6ad Author: Nam Cao Date: Fri Sep 2 11:51:57 2022 +0200 staging: rtl8723bs: remove hal_btcoex_SetManualControl Remove function hal_btcoex_SetManualControl because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/ae83ad941013d7a6c47d06f70c0f43087fe2c84f.1662111799.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 34ac858138e16c15abcbe0c290120a276f5b500b Author: Nam Cao Date: Fri Sep 2 11:51:56 2022 +0200 staging: rtl8723bs: remove GetHexValueFromString Remove function GetHexValueFromString because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/74c77a5d86570065a5fe96446063595b649f76b0.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 00d08fd0df2efd7a2980560474636c516846eba7 Author: Nam Cao Date: Fri Sep 2 11:51:55 2022 +0200 staging: rtl8723bs: remove odm_PauseDIG Remove function odm_PauseDIG because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/274e8338398d915327d353f713b2d47e48f92ba9.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3baa5b32a75379b6edfe05f84f91fbe130048ef7 Author: Nam Cao Date: Fri Sep 2 11:51:54 2022 +0200 staging: rtl8723bs: delete rtw_odm.c and rtw_odm.h Remove rtw_odm.c and rtw_odm.h because the content of these files is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/6870109ce0c51b4ab91ec370d8b2285dc635e5fe.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit b1e2d1a256d471a929ef845184e53d7680438db3 Author: Nam Cao Date: Fri Sep 2 11:51:53 2022 +0200 staging: rtl8723bs: remove rtw_change_ifname Delete function rtw_change_ifname because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/975cd771e5b6573b84b31690895d140cbdaeb5e2.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6066a281d82479c9b39dda57200ccfd80886e775 Author: Nam Cao Date: Fri Sep 2 11:51:52 2022 +0200 staging: rtl8723bs: delete function rtw_set_chplan_cmd The function rtw_set_chplan_cmd is not used. Remove it. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/b5a1fe5bc7bc8eb154247ee8eafafe6af266dab9.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4cee30a3fb751e3f231016f2a93a3bcf0d430527 Author: Nam Cao Date: Fri Sep 2 11:51:51 2022 +0200 staging: rtl8723bs: delete rtw_setdatarate_cmd Remove function rtw_setdatarate_cmd because it is not used. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/bfc4c5c9aec8b026fd3cf092354d508881d790fc.1662111798.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7eb2bf871454d3b35c2e988477aab4c0e12aa7c4 Author: Dongliang Mu Date: Thu Sep 8 13:59:00 2022 +0800 usb: misc: usb3503: call clk_disable_unprepare in the error handling Smatch reports the following warning: drivers/usb/misc/usb3503.c:267 usb3503_probe() warn: 'hub->clk' from clk_prepare_enable() not released on lines: 240,246,252 Fix this by adding a flag to indicate if hub->clk is prepared or not and invoke clk_disable_unprepare in the error handling. Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20220908055903.3550723-1-dzm91@hust.edu.cn Signed-off-by: Greg Kroah-Hartman commit 9b91a65230784a9ef644b8bdbb82a79ba4ae9456 Author: Michael Grzeschik Date: Wed Sep 7 23:58:18 2022 +0200 usb: gadget: uvc: increase worker prio to WQ_HIGHPRI This patch is changing the simple workqueue in the gadget driver to be allocated as async_wq with a higher priority. The pump worker, that is filling the usb requests, will have a higher priority and will not be scheduled away so often while the video stream is handled. This will lead to fewer streaming underruns. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220907215818.2670097-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit c7883f8d2b0ab4b8e4df8cf37861523ad9ad1407 Author: Joerg Roedel Date: Wed Sep 7 17:11:54 2022 +0200 iommu/virtio: Fix compile error with viommu_capable() A recent fix introduced viommu_capable() but other changes from Robin change the function signature of the call-back it is used for. When both changes are merged a compile error will happen because the function pointer types mismatch. Fix that by updating the viommu_capable() signature after the merge. Cc: Jean-Philippe Brucker Cc: Robin Murphy Signed-off-by: Joerg Roedel Acked-by: Robin Murphy Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20220907151154.21911-1-joro@8bytes.org commit 7f34891b151187c95511f2830a3994c8a54cabc1 Merge: 189cb8fec14ac 91c98fe794149 Author: Joerg Roedel Date: Fri Sep 9 09:27:09 2022 +0200 Merge branch 'iommu/fixes' into core commit 189cb8fec14acf4dee59eb2011519e86d389cd3e Author: John Garry Date: Wed Sep 7 21:34:41 2022 +0800 iova: Remove iovad->rcaches check in iova_rcache_get() The iovad->rcaches check in iova_rcache_get() is pretty much useless without the same check in iova_rcache_insert(). Instead of adding this symmetric check to fastpath iova_rcache_insert(), drop the check in iova_rcache_get() in favour of making the IOVA domain rcache init more robust to failure in future. Signed-off-by: John Garry Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/1662557681-145906-4-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit 8b2818c7be7bc49133c50f384247e9164a225e3f Author: John Garry Date: Wed Sep 7 21:34:40 2022 +0800 iova: Remove magazine BUG_ON() checks Two of the magazine helpers have BUG_ON() checks, as follows: - iova_magazine_pop() - here we ensure that the mag is not empty. However we already ensure that in the only caller, __iova_rcache_get(). - iova_magazine_push() - here we ensure that the mag is not full. However we already ensure that in the only caller, __iova_rcache_insert(). As described, the two bug checks are pointless so drop them. Signed-off-by: John Garry Acked-by: Robin Murphy Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/1662557681-145906-3-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit a390bde7075451bf419777a94fc7a5106e6e7feb Author: John Garry Date: Wed Sep 7 21:34:39 2022 +0800 iova: Remove some magazine pointer NULL checks Since commit 32e92d9f6f87 ("iommu/iova: Separate out rcache init") it has not been possible to have NULL CPU rcache "loaded" or "prev" magazine pointers once the IOVA domain has been properly initialized. Previously it was only possible to have NULL pointers from failure to allocate the magazines in the IOVA domain initialization. The only other two functions to modify these pointers - __iova_rcache_{get, insert}() - would already ensure that these pointers were non-NULL if initially non-NULL. As such, the mag NULL pointer checks in iova_magazine_full(), iova_magazine_empty(), and iova_magazine_free_pfns() may be dropped. Signed-off-by: John Garry Reviewed-by: Robin Murphy Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/1662557681-145906-2-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit f2042ed21da7f8886c93efefff61f93e6d57e9bd Author: Robin Murphy Date: Tue Aug 16 18:28:05 2022 +0100 iommu/dma: Make header private Now that dma-iommu.h only contains internal interfaces, make it private to the IOMMU subsytem. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b237e06c56a101f77af142a54b629b27aa179d22.1660668998.git.robin.murphy@arm.com [ joro : re-add stub for iommu_dma_get_resv_regions ] Signed-off-by: Joerg Roedel commit 34df6a8a50aa72c4ac4fd65033a2798fc321adf8 Merge: dd14043af7b86 6d13a65d2a674 Author: David S. Miller Date: Fri Sep 9 08:24:43 2022 +0100 Merge branch 'tc_action_ops-refactor' Zhengchao Shao says: ==================== net: refactor the walk and lookup hook functions in tc_action_ops The implementation logic of the walk/lookup hook function in each action module is the same. Therefore, the two functions can be reconstructed. When registering tc_action_ops of each action module, the corresponding net_id is saved to tc_action_ops. In this way, the net_id of the corresponding module can be directly obtained in act_api without executing the specific walk and lookup hook functions. Then, generic functions can be added to replace the walk and lookup hook functions of each action module. Last, modify each action module in alphabetical order. Reserve the walk and lookup interfaces and delete them when they are no longer used. This patchset has been tested by using TDC, and I will add selftest in other patchset. Last, thanks to Jamal Hadi Salim and Cong Wang for their advice. --- v3: remove hole from the structure tc_action_ops v2: save the net_id of each TC action module to the tc_action_ops structure ==================== Signed-off-by: David S. Miller commit 6d13a65d2a674c1cf4e70863394c01e4d07372e8 Author: Zhengchao Shao Date: Thu Sep 8 12:14:54 2022 +0800 net: sched: act_vlan: get rid of tcf_vlan_walker and tcf_vlan_search tcf_vlan_walker() and tcf_vlan_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit f6ffa368f0617368f1a47ca17a56c8842c41c0e1 Author: Zhengchao Shao Date: Thu Sep 8 12:14:53 2022 +0800 net: sched: act_tunnel_key: get rid of tunnel_key_walker and tunnel_key_search tunnel_key_walker() and tunnel_key_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 8a35c5df28aa326092ad09ef9a5301a6418bcdfa Author: Zhengchao Shao Date: Thu Sep 8 12:14:52 2022 +0800 net: sched: act_skbmod: get rid of tcf_skbmod_walker and tcf_skbmod_search tcf_skbmod_walker() and tcf_skbmod_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 038725f9eed61a0516ab9d2db1d42d5d6dfed5f8 Author: Zhengchao Shao Date: Thu Sep 8 12:14:51 2022 +0800 net: sched: act_skbedit: get rid of tcf_skbedit_walker and tcf_skbedit_search tcf_skbedit_walker() and tcf_skbedit_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 5d6e9cb5c916ac727cfa22260b91b531b7601bd1 Author: Zhengchao Shao Date: Thu Sep 8 12:14:50 2022 +0800 net: sched: act_simple: get rid of tcf_simp_walker and tcf_simp_search tcf_simp_walker() and tcf_simp_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 400d66332cd4d6eace52144ca690d231217b3862 Author: Zhengchao Shao Date: Thu Sep 8 12:14:49 2022 +0800 net: sched: act_sample: get rid of tcf_sample_walker and tcf_sample_search tcf_sample_walker() and tcf_sample_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 0abf7f8f82bb6c957add8a781281f28ee3f16e15 Author: Zhengchao Shao Date: Thu Sep 8 12:14:48 2022 +0800 net: sched: act_police: get rid of tcf_police_walker and tcf_police_search tcf_police_walker() and tcf_police_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit b915d86981fe1fd7501fe44459ed70d2b9c3ca59 Author: Zhengchao Shao Date: Thu Sep 8 12:14:47 2022 +0800 net: sched: act_pedit: get rid of tcf_pedit_walker and tcf_pedit_search tcf_pedit_walker() and tcf_pedit_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 586fab138659408aa6c95d491775cb64570c7598 Author: Zhengchao Shao Date: Thu Sep 8 12:14:46 2022 +0800 net: sched: act_nat: get rid of tcf_nat_walker and tcf_nat_search tcf_nat_walker() and tcf_nat_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 7fadae53aa86d83c713a38547ec542084a04fe21 Author: Zhengchao Shao Date: Thu Sep 8 12:14:45 2022 +0800 net: sched: act_mpls: get rid of tcf_mpls_walker and tcf_mpls_search tcf_mpls_walker() and tcf_mpls_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit d58efc6ecce88e2a4d0b88e6e8f5ec191155f310 Author: Zhengchao Shao Date: Thu Sep 8 12:14:44 2022 +0800 net: sched: act_mirred: get rid of tcf_mirred_walker and tcf_mirred_search tcf_mirred_walker() and tcf_mirred_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 0a4c06f20d76dce967785b5549d51f65bc6661eb Author: Zhengchao Shao Date: Thu Sep 8 12:14:43 2022 +0800 net: sched: act_ipt: get rid of tcf_ipt_walker/tcf_xt_walker and tcf_ipt_search/tcf_xt_search tcf_ipt_walker()/tcf_xt_walker() and tcf_ipt_search()/tcf_xt_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit ad0cd0a85cd78ffe69f0327386e4fb1d4e59f15d Author: Zhengchao Shao Date: Thu Sep 8 12:14:42 2022 +0800 net: sched: act_ife: get rid of tcf_ife_walker and tcf_ife_search tcf_ife_walker() and tcf_ife_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit ae3f9fc308d50ad87b59dde8c39262db41ec5882 Author: Zhengchao Shao Date: Thu Sep 8 12:14:41 2022 +0800 net: sched: act_gate: get rid of tcf_gate_walker and tcf_gate_search tcf_gate_walker() and tcf_gate_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit eeb3f43e05c0fda851ce75a4fab2d5037b2e87c5 Author: Zhengchao Shao Date: Thu Sep 8 12:14:40 2022 +0800 net: sched: act_gact: get rid of tcf_gact_walker and tcf_gact_search tcf_gact_walker() and tcf_gact_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit d51145dafd5047f36b90bfd040f537fa09b9e534 Author: Zhengchao Shao Date: Thu Sep 8 12:14:39 2022 +0800 net: sched: act_ctinfo: get rid of tcf_ctinfo_walker and tcf_ctinfo_search tcf_ctinfo_walker() and tcf_ctinfo_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit cb967ace0accfcccb9ae343296649e759b3cff27 Author: Zhengchao Shao Date: Thu Sep 8 12:14:38 2022 +0800 net: sched: act_ct: get rid of tcf_ct_walker and tcf_ct_search tcf_ct_walker() and tcf_ct_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit d2388df33b369146c6fdf7cc7077ae52d87ca679 Author: Zhengchao Shao Date: Thu Sep 8 12:14:37 2022 +0800 net: sched: act_csum: get rid of tcf_csum_walker and tcf_csum_search tcf_csum_walker() and tcf_csum_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit c4d2497032ae31d234425648bf2720dfb1688796 Author: Zhengchao Shao Date: Thu Sep 8 12:14:36 2022 +0800 net: sched: act_connmark: get rid of tcf_connmark_walker and tcf_connmark_search tcf_connmark_walker() and tcf_connmark_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit aa0a92f7458c594dd5964f42c18be97644fa9b4c Author: Zhengchao Shao Date: Thu Sep 8 12:14:35 2022 +0800 net: sched: act_bpf: get rid of tcf_bpf_walker and tcf_bpf_search tcf_bpf_walker() and tcf_bpf_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit fae52d9323384c32283777e893bf85293588ce62 Author: Zhengchao Shao Date: Thu Sep 8 12:14:34 2022 +0800 net: sched: act_api: implement generic walker and search for tc action Being able to get tc_action_net by using net_id stored in tc_action_ops and execute the generic walk/search function, add __tcf_generic_walker() and __tcf_idr_search() helpers. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit acd0a7ab6334f35c3720120d53f79eb8e9b3ac2e Author: Zhengchao Shao Date: Thu Sep 8 12:14:33 2022 +0800 net: sched: act: move global static variable net_id to tc_action_ops Each tc action module has a corresponding net_id, so put net_id directly into the structure tc_action_ops. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit dd14043af7b86238a4dc3280acf635eb43ea9851 Merge: ceef59b54980d cd6910501cfd9 Author: David S. Miller Date: Fri Sep 9 08:20:58 2022 +0100 Merge branch 'lan743x-next' Raju Lakkaraju says: ==================== net: lan743x: Fix to use multiqueue start/stop APIs This patch series address the fix to use multiqueue start/stop APIs and Add Rx IP and TCP checksum offload Changes: ======== V1 -> V2: - Fix the sparse warnings V0 -> V1: - Remove chip SKU check conditionals - Update the changes description ==================== Signed-off-by: David S. Miller commit cd6910501cfd9a3bdff2f5fc33c9f3cf165ca54a Author: Raju Lakkaraju Date: Thu Sep 8 13:58:34 2022 +0530 net: lan743x: Add support for Rx IP & TCP checksum offload Add Rx IP and TCP checksum offload Signed-off-by: Raju Lakkaraju Reported-by: kernel test robot Signed-off-by: David S. Miller commit 721f80c4d550668d3ee1160603ff2250dc33169b Author: Raju Lakkaraju Date: Thu Sep 8 13:58:33 2022 +0530 net: lan743x: Fix to use multiqueue start/stop APIs - Fix to use multiqueue start/stop APIs - Change to return NETDEV_TX_BUSY instead of holding the TX skb when busy - Increase Tx ring size to 128 to address performance issues in some platforms - Use NAPI_POLL_WEIGHT for Tx Napi handler instead of ring dependent value - Use multiqueue to register 4 Rx channels Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller commit e2a5c05de6753781d69245da871f58fcae6d0bb0 Author: Jani Nikula Date: Thu Sep 8 19:57:02 2022 +0300 drm/i915/dsb: hide struct intel_dsb better struct intel_dsb can be an opaque type, hidden in intel_dsb.c. Make it so. Reduce related includes while at it. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220908165702.973854-1-jani.nikula@intel.com commit 5b4fc3956bfda2da22a6f7f25b157ad24ba1cd95 Author: Gaosheng Cui Date: Fri Sep 9 14:11:26 2022 +0800 sound: oss: dmasound: remove software_input_volume declaration expand_read_bal has been removed since commit fc37449f7959 ("The next round of scheduled OSS code removal"). software_input_volume has been removed since commit 0a1b42db4bf9 ("sound: sound/oss/dmasound/: cleanups"). so remove the declare for them from header file. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220909061126.1129585-1-cuigaosheng1@huawei.com Signed-off-by: Takashi Iwai commit 5a55b51a3dea50c8b700cdde0aeb75e0a388486b Author: Gaosheng Cui Date: Fri Sep 9 11:54:43 2022 +0800 ALSA: memalloc: remove snd_dma_sg_ops declaration snd_dma_sg_ops has been removed since commit 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220909035443.1065737-3-cuigaosheng1@huawei.com Signed-off-by: Takashi Iwai commit a0e3a293bc001f5aba8a252b6191030ad5911c82 Author: Gaosheng Cui Date: Fri Sep 9 11:54:42 2022 +0800 ALSA: line6: remove line6_set_raw declaration line6_set_raw has been removed since commit 9f673d7a6022 ("staging: line6: drop CONFIG_LINE6_USB_RAW"), so remove it. Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20220909035443.1065737-2-cuigaosheng1@huawei.com Signed-off-by: Takashi Iwai commit ceef59b54980d0827ecbf6a7666362c8c0d2c7bb Merge: 9f8f1933dce55 adda60cc2bb0f Author: David S. Miller Date: Fri Sep 9 08:08:51 2022 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== The following set contains changes for your *net-next* tree: - make conntrack ignore packets that are delayed (containing data already acked). The current behaviour to flag them as INVALID causes more harm than good, let them pass so peer can send an immediate ACK for the most recent sequence number. - make conntrack recognize when both peers have sent 'invalid' FINs: This helps cleaning out stale connections faster for those cases where conntrack is no longer in sync with the actual connection state. - Now that DECNET is gone, we don't need to reserve space for DECNET related information. - compact common 'find a free port number for the new inbound connection' code and move it to a helper, then cap number of tries the new helper will make until it gives up. - replace various instances of strlcpy with strscpy, from Wolfram Sang. ==================== Signed-off-by: David S. Miller commit f3e893626abeac3cdd9ba41d3395dc6c1b7d5ad6 Author: Colin Foster Date: Mon Sep 5 09:21:32 2022 -0700 mfd: ocelot: Add support for the vsc7512 chip via spi The VSC7512 is a networking chip that contains several peripherals. Many of these peripherals are currently supported by the VSC7513 and VSC7514 chips, but those run on an internal CPU. The VSC7512 lacks this CPU, and must be controlled externally. Utilize the existing drivers by referencing the chip as an MFD. Add support for the two MDIO buses, the internal phys, pinctrl, and serial GPIO. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-9-colin.foster@in-advantage.com commit e5abb90a590f34c97ed7eb619033cbdea824ec12 Author: Colin Foster Date: Mon Sep 5 09:21:31 2022 -0700 dt-bindings: mfd: ocelot: Add bindings for VSC7512 Add devicetree bindings for SPI-controlled Ocelot chips, specifically the VSC7512. Signed-off-by: Colin Foster Reviewed-by: Rob Herring Reviewed-by: Vladimir Oltean Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-8-colin.foster@in-advantage.com commit 39f7d0832c28a6a31abb5b7363e7b1ba0714fe18 Author: Colin Foster Date: Mon Sep 5 09:21:30 2022 -0700 resource: add define macro for register address resources DEFINE_RES_ macros have been created for the commonly used resource types, but not IORESOURCE_REG. Add the macro so it can be used in a similar manner to all other resource types. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-7-colin.foster@in-advantage.com commit 68c873363a788b604914c01269f8eac9779d9dd4 Author: Colin Foster Date: Mon Sep 5 09:21:29 2022 -0700 pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration There are a few Ocelot chips that can contain SGPIO logic, but can be controlled externally. Specifically the VSC7511, 7512, 7513, and 7514. In the externally controlled configurations these registers are not memory-mapped. Add support for these non-memory-mapped configurations. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-6-colin.foster@in-advantage.com commit 2f65923c5032c9de0d898636d4cd25da5d58e9a7 Author: Colin Foster Date: Mon Sep 5 09:21:28 2022 -0700 pinctrl: microchip-sgpio: allow sgpio driver to be used as a module As the commit message suggests, this simply adds the ability to select SGPIO pinctrl as a module. This becomes more practical when the SGPIO hardware exists on an external chip, controlled indirectly by I2C or SPI. This commit enables that level of control. Signed-off-by: Colin Foster Reviewed-by: Linus Walleij Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-5-colin.foster@in-advantage.com commit 181f604b33cd8fce06b2497178c71548db1e1934 Author: Colin Foster Date: Mon Sep 5 09:21:27 2022 -0700 pinctrl: ocelot: add ability to be used in a non-mmio configuration There are a few Ocelot chips that contain pinctrl logic, but can be controlled externally. Specifically the VSC7511, 7512, 7513 and 7514. In the externally controlled configurations these registers are not memory-mapped. Add support for these non-memory-mapped configurations. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-4-colin.foster@in-advantage.com commit 43a108c6492232cd2e85fbd4874c0500158b8c8b Author: Colin Foster Date: Mon Sep 5 09:21:26 2022 -0700 net: mdio: mscc-miim: add ability to be used in a non-mmio configuration There are a few Ocelot chips that contain the logic for this bus, but are controlled externally. Specifically the VSC7511, 7512, 7513, and 7514. In the externally controlled configurations these registers are not memory-mapped. Add support for these non-memory-mapped configurations. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Acked-by: Jakub Kicinski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-3-colin.foster@in-advantage.com commit bb5721f063ba63cd54cc5916881a706c21e6abc6 Author: Colin Foster Date: Mon Sep 5 09:21:25 2022 -0700 mfd: ocelot: Add helper to get regmap from a resource Several ocelot-related modules are designed for MMIO / regmaps. As such, they often use a combination of devm_platform_get_and_ioremap_resource() and devm_regmap_init_mmio(). Operating in an MFD might be different, in that it could be memory mapped, or it could be SPI, I2C... In these cases a fallback to use IORESOURCE_REG instead of IORESOURCE_MEM becomes necessary. When this happens, there's redundant logic that needs to be implemented in every driver. In order to avoid this redundancy, utilize a single function that, if the MFD scenario is enabled, will perform this fallback logic. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-2-colin.foster@in-advantage.com commit 366317eae983a0d96aeed78ad219b9c4ed2a719a Author: Yicong Yang Date: Tue Aug 16 19:44:14 2022 +0800 MAINTAINERS: Add maintainer for HiSilicon PTT driver Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220816114414.4092-6-yangyicong@huawei.com Signed-off-by: Mathieu Poirier commit a7112b747c324dda8937d4f47b14dc0af0b465d1 Author: Yicong Yang Date: Tue Aug 16 19:44:13 2022 +0800 docs: trace: Add HiSilicon PTT device driver documentation Document the introduction and usage of HiSilicon PTT device driver as well as the sysfs attributes description provided by the driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron Reviewed-by: Bagas Sanjaya [Fixed month and kernel version] Link: https://lore.kernel.org/r/20220816114414.4092-5-yangyicong@huawei.com Signed-off-by: Mathieu Poirier commit 77d6354bd422c8a451ef7d2235322dbf33e7427b Author: David Disseldorp Date: Tue Sep 6 10:03:18 2022 +0200 module/decompress: generate sysfs string at compile time compression_show() before (with noinline): 0xffffffff810b5ff0 <+0>: mov %rdx,%rdi 0xffffffff810b5ff3 <+3>: mov $0xffffffff81b55629,%rsi 0xffffffff810b5ffa <+10>: mov $0xffffffff81b0cde2,%rdx 0xffffffff810b6001 <+17>: call 0xffffffff811b8fd0 0xffffffff810b6006 <+22>: cltq 0xffffffff810b6008 <+24>: ret After: 0xffffffff810b5ff0 <+0>: mov $0xffffffff81b0cde2,%rsi 0xffffffff810b5ff7 <+7>: mov %rdx,%rdi 0xffffffff810b5ffa <+10>: call 0xffffffff811b8fd0 0xffffffff810b5fff <+15>: cltq 0xffffffff810b6001 <+17>: ret Signed-off-by: David Disseldorp Reviewed-by: Aaron Tomlin Reviewed-by: Dmitry Torokhov Signed-off-by: Luis Chamberlain commit c06a17fe056b84f5784b2f13753870eb65edc9ed Author: Liu Shixin Date: Thu Sep 8 16:29:47 2022 +0800 kernel/sysctl-test: use SYSCTL_{ZERO/ONE_HUNDRED} instead of i_{zero/one_hundred} It is better to use SYSCTL_ZERO and SYSCTL_ONE_HUNDRED instead of &i_zero and &i_one_hundred, and then we can remove these two local variable. No functional change. Signed-off-by: Liu Shixin Signed-off-by: Luis Chamberlain commit b13bc7cbb931727b1b0a63594cd734bfd979e985 Author: Liu Shixin Date: Thu Sep 8 16:29:46 2022 +0800 kernel/sysctl.c: move sysctl_vals and sysctl_long_vals to sysctl.c sysctl_vals and sysctl_long_vals are declared even if sysctl is disabled. Move its definition to sysctl.c to make sure their integrity in any case. Signed-off-by: Liu Shixin Signed-off-by: Luis Chamberlain commit feb2bd010aec77a1cf981d2649183c64cd4870a0 Author: Liu Shixin Date: Mon Sep 5 20:47:24 2022 +0800 sysctl: remove max_extfrag_threshold Remove max_extfrag_threshold and replace by SYSCTL_ONE_THOUSAND. No functional change. Signed-off-by: Liu Shixin Signed-off-by: Luis Chamberlain commit beef988c2085e197ea5f36144dc753aff5b2e7af Author: Aaron Tomlin Date: Thu Sep 1 16:24:54 2022 +0100 module: Add debugfs interface to view unloaded tainted modules This patch provides debug/modules/unloaded_tainted file to see a record of unloaded tainted modules. Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 8ebc4123c1445ef11a9989d9bc676691a1d43302 Author: Dong Chuanjian Date: Mon Aug 22 14:30:49 2022 +0800 kernel/sysctl.c: remove unnecessary (void*) conversions remove unnecessary void* type casting Signed-off-by: Dong Chuanjian Signed-off-by: Luis Chamberlain commit 9a5213593caa2ba7e13a24c86b55b04698d61d14 Author: Li zeming Date: Mon Aug 1 16:51:17 2022 +0800 proc: remove initialization assignment The allocation address of the core_parent pointer variable is first executed in the function, no initialization assignment is required. Signed-off-by: Li zeming Signed-off-by: Luis Chamberlain commit 00d92171ee142200000a984dd1e3cfe599252ec3 Author: Bhupesh Sharma Date: Thu Sep 8 02:11:53 2022 +0530 arm64: dts: qcom: sa8155p-adp: Remove unused properties from eth node The 'snps,ptp-ref-clk-rate' and 'snps,ptp-req-clk-rate' properties are not supported by the stmmac driver currently, so remove them from the sa8155p-adp ethernet node as well. Cc: Bjorn Andersson Cc: Rob Herring Cc: Vinod Koul Cc: David Miller Signed-off-by: Bhupesh Sharma Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220907204153.2039776-1-bhupesh.sharma@linaro.org commit b626ac159e5e2ca3eac4079622b9f4105814768f Author: Krzysztof Kozlowski Date: Thu Sep 8 10:58:30 2022 +0200 arm64: dts: qcom: sc7280: correct CPU BWMON unit address Correct CPU BWMON unit address to match the "reg" property. Reported-by: Stephen Boyd Fixes: b2f3eac1b77c ("arm64: dts: qcom: sc7280: Add cpu and llcc BWMON") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220908085830.39141-1-krzysztof.kozlowski@linaro.org commit 5ca57b03d8c5de4c59234cc11fe9dd9f13d57f48 Author: Yicong Yang Date: Tue Aug 16 19:44:12 2022 +0800 hwtracing: hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Acked-by: Mathieu Poirier Reviewed-by: Jonathan Cameron Reviewed-by: John Garry Signed-off-by: Yicong Yang Link: https://lore.kernel.org/r/20220816114414.4092-4-yangyicong@huawei.com Signed-off-by: Mathieu Poirier commit ff0de066b4632ccb2b2e50f90c0c5be7f4689de7 Author: Yicong Yang Date: Tue Aug 16 19:44:11 2022 +0800 hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace function and support the following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the direction of traced TLP headers - format: select the data format of the traced TLP headers This patch initially add basic trace support of PTT device. Acked-by: Mathieu Poirier Reviewed-by: Jonathan Cameron Reviewed-by: John Garry Signed-off-by: Yicong Yang Link: https://lore.kernel.org/r/20220816114414.4092-3-yangyicong@huawei.com Signed-off-by: Mathieu Poirier commit 24b6c7798a0122012ca848ea0d25e973334266b0 Author: Yicong Yang Date: Tue Aug 16 19:44:10 2022 +0800 iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Acked-by: Will Deacon Signed-off-by: Yicong Yang Reviewed-by: John Garry Link: https://lore.kernel.org/r/20220816114414.4092-2-yangyicong@huawei.com Signed-off-by: Mathieu Poirier commit 2a40f883781d6cbbf547ed13b0cec2f9808d839d Author: Luiz Augusto von Dentz Date: Thu Sep 8 13:57:50 2022 -0700 Bluetooth: Fix HCIGETDEVINFO regression Recent changes breaks HCIGETDEVINFO since it changes the size of hci_dev_info. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Reported-by: Marek Szyprowski Signed-off-by: Luiz Augusto von Dentz commit e7ed42a44c36351cd064797613d6ae34c0140424 Author: wangjianli Date: Thu Sep 8 12:37:09 2022 -0700 Input: hgpk - fix repeated word in a comment Delete the redundant word 'to'. Signed-off-by: wangjianli Link: https://lore.kernel.org/r/20220908131043.37099-1-wangjianli@cdjrlc.com Signed-off-by: Dmitry Torokhov commit 096b52fd2bb4996fd68d22b3b7ad21a1296db9d3 Author: Sergey Matyukevich Date: Tue Aug 30 18:53:06 2022 +0300 perf: RISC-V: throttle perf events Call perf_sample_event_took() to report time spent in overflow interrupts. Perf core uses these measurements to throttle perf events properly. Signed-off-by: Sergey Matyukevich Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20220830155306.301714-4-geomatsi@gmail.com Signed-off-by: Palmer Dabbelt commit 1537bf26e212ffcf007d0590958025f6bfdd4ac8 Author: Sergey Matyukevich Date: Tue Aug 30 18:53:05 2022 +0300 perf: RISC-V: exclude invalid pmu counters from SBI calls SBI firmware may not provide information for some counters in response to SBI_EXT_PMU_COUNTER_GET_INFO call. Exclude such counters from the subsequent SBI requests. For this purpose use global mask to keep track of fully specified counters. Signed-off-by: Sergey Matyukevich Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20220830155306.301714-3-geomatsi@gmail.com Signed-off-by: Palmer Dabbelt commit 561044b5d6526a2a7925ccb18a073ad909ad06a1 Author: Clément Péron Date: Tue Sep 6 17:30:30 2022 +0200 arm64: defconfig: Enable devfreq cooling device Devfreq cooling device framework is used in Panfrost to throttle GPU in order to regulate its temperature. Enable this driver for ARM64 SoC. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220906153034.153321-2-peron.clem@gmail.com commit a684aa3830f547bb698c524b11c89e3f24433c1f Author: Clément Péron Date: Tue Sep 6 17:30:34 2022 +0200 arm64: dts: allwinner: beelink-gs1: Enable GPU OPP Enable GPU OPP table for Beelink GS1. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220906153034.153321-6-peron.clem@gmail.com commit 116745dd557b85e32adc9e1aa8b7d5c5079aba1b Author: Clément Péron Date: Tue Sep 6 17:30:32 2022 +0200 arm64: dts: allwinner: h6: Add GPU OPP table Add an Operating Performance Points table for the GPU to enable Dynamic Voltage & Frequency Scaling on the H6. The voltage range is set with minimal voltage set to the target and the maximal voltage set to 1.2V. This allow DVFS framework to work properly on board with fixed regulator. Signed-off-by: Clément Péron Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220906153034.153321-4-peron.clem@gmail.com commit a067916d20bd52bd7c13af02bda1eb4f93e68539 Author: Clément Péron Date: Tue Sep 6 17:30:31 2022 +0200 arm64: dts: allwinner: h6: Add cooling map for GPU Add a simple cooling map for the GPU. This cooling map come from the vendor kernel 4.9 with a 2°C hysteresis added. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220906153034.153321-3-peron.clem@gmail.com commit 5db5663cdf369b3575dae464cdcda0233ab19f44 Author: Samuel Holland Date: Mon Aug 29 21:08:24 2022 -0500 arm64: dts: allwinner: a100: Add I2C DMA requests The I2C controllers in the A100 SoC are all connected to the DMA engine. Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220830020824.62288-4-samuel@sholland.org commit 7072784d97b2b140a9e5507a29fcbc9b70dfc343 Author: Yangtao Li Date: Mon Aug 29 21:08:23 2022 -0500 arm64: dts: allwinner: a100: Add device node for DMA controller The A100 SoC has a DMA controller that supports 8 DMA channels to and from various peripherals. Add a device node for it. Signed-off-by: Yangtao Li Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220830020824.62288-3-samuel@sholland.org commit 6a6434482fc6184e8fc73092aea755253205ec5b Author: Yang Yingliang Date: Sat Aug 27 17:41:51 2022 +0800 clk: sunxi-ng: ccu-sun9i-a80-usb: Use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220827094151.3323450-3-yangyingliang@huawei.com commit 655489854f0abacb7afe2e4824bdec11108f9fcb Author: Yang Yingliang Date: Sat Aug 27 17:41:50 2022 +0800 clk: sunxi-ng: ccu-sun9i-a80-de: Use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220827094151.3323450-2-yangyingliang@huawei.com commit 5c05a33ea20ac84c179f93eb2ec8006b8025736c Author: Yang Yingliang Date: Sat Aug 27 17:41:49 2022 +0800 clk: sunxi-ng: sun8i-de2: Use dev_err_probe() helper dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220827094151.3323450-1-yangyingliang@huawei.com commit f39856aacb078c1c93acef011a37121b17d54fe0 Author: Yishai Hadas Date: Thu Sep 8 21:34:48 2022 +0300 vfio/mlx5: Set the driver DMA logging callbacks Now that everything is ready set the driver DMA logging callbacks if supported by the device. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-11-yishaih@nvidia.com Signed-off-by: Alex Williamson commit e295738756ebd0726f1ed51e02f343a37233437b Author: Yishai Hadas Date: Thu Sep 8 21:34:47 2022 +0300 vfio/mlx5: Manage error scenarios on tracker Handle async error events and health/recovery flow to safely stop the tracker upon error scenarios. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-10-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 1047797e8ed4bb8c20d1b5b843cf870d00bb0ff7 Author: Yishai Hadas Date: Thu Sep 8 21:34:46 2022 +0300 vfio/mlx5: Report dirty pages from tracker Report dirty pages from tracker. It includes: Querying for dirty pages in a given IOVA range, this is done by modifying the tracker into the reporting state and supplying the required range. Using the CQ event completion mechanism to be notified once data is ready on the CQ/QP to be processed. Once data is available turn on the corresponding bits in the bit map. This functionality will be used as part of the 'log_read_and_clear' driver callback in the next patches. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-9-yishaih@nvidia.com Signed-off-by: Alex Williamson commit c1d050b0d169fd60c8acef157db53bd4e3141799 Author: Yishai Hadas Date: Thu Sep 8 21:34:45 2022 +0300 vfio/mlx5: Create and destroy page tracker object Add support for creating and destroying page tracker object. This object is used to control/report the device dirty pages. As part of creating the tracker need to consider the device capabilities for max ranges and adapt/combine ranges accordingly. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-8-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 79c3cf279926f8db0a606a479944a131e27a39ea Author: Yishai Hadas Date: Thu Sep 8 21:34:44 2022 +0300 vfio/mlx5: Init QP based resources for dirty tracking Init QP based resources for dirty tracking to be used upon start logging. It includes: Creating the host and firmware RC QPs, move each of them to its expected state based on the device specification, etc. Creating the relevant resources which are needed by both QPs as of UAR, PD, etc. Creating the host receive side resources as of MKEY, CQ, receive WQEs, etc. The above resources are cleaned-up upon stop logging. The tracker object that will be introduced by next patches will use those resources. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-7-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 80c4b92a2dc48cce82a0348add48533db7e07314 Author: Yishai Hadas Date: Thu Sep 8 21:34:43 2022 +0300 vfio: Introduce the DMA logging feature support Introduce the DMA logging feature support in the vfio core layer. It includes the processing of the device start/stop/report DMA logging UAPIs and calling the relevant driver 'op' to do the work. Specifically, Upon start, the core translates the given input ranges into an interval tree, checks for unexpected overlapping, non aligned ranges and then pass the translated input to the driver for start tracking the given ranges. Upon report, the core translates the given input user space bitmap and page size into an IOVA kernel bitmap iterator. Then it iterates it and call the driver to set the corresponding bits for the dirtied pages in a specific IOVA range. Upon stop, the driver is called to stop the previous started tracking. The next patches from the series will introduce the mlx5 driver implementation for the logging ops. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-6-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 58ccf0190d19d9a8a41f8a02b9e06742b58df4a1 Author: Joao Martins Date: Thu Sep 8 21:34:42 2022 +0300 vfio: Add an IOVA bitmap support The new facility adds a bunch of wrappers that abstract how an IOVA range is represented in a bitmap that is granulated by a given page_size. So it translates all the lifting of dealing with user pointers into its corresponding kernel addresses backing said user memory into doing finally the (non-atomic) bitmap ops to change various bits. The formula for the bitmap is: data[(iova / page_size) / 64] & (1ULL << (iova % 64)) Where 64 is the number of bits in a unsigned long (depending on arch) It introduces an IOVA iterator that uses a windowing scheme to minimize the pinning overhead, as opposed to pinning it on demand 4K at a time. Assuming a 4K kernel page and 4K requested page size, we can use a single kernel page to hold 512 page pointers, mapping 2M of bitmap, representing 64G of IOVA space. An example usage of these helpers for a given @base_iova, @page_size, @length and __user @data: bitmap = iova_bitmap_alloc(base_iova, page_size, length, data); if (IS_ERR(bitmap)) return -ENOMEM; ret = iova_bitmap_for_each(bitmap, arg, dirty_reporter_fn); iova_bitmap_free(bitmap); Each iteration of the @dirty_reporter_fn is called with a unique @iova and @length argument, indicating the current range available through the iova_bitmap. The @dirty_reporter_fn uses iova_bitmap_set() to mark dirty areas (@iova_length) within that provided range, as following: iova_bitmap_set(bitmap, iova, iova_length); The facility is intended to be used for user bitmaps representing dirtied IOVAs by IOMMU (via IOMMUFD) and PCI Devices (via vfio-pci). Signed-off-by: Joao Martins Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220908183448.195262-5-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 42ee53f9bfd3e4cf58ae7656e0d11075f5fe8489 Author: Yishai Hadas Date: Thu Sep 8 21:34:41 2022 +0300 vfio: Introduce DMA logging uAPIs DMA logging allows a device to internally record what DMAs the device is initiating and report them back to userspace. It is part of the VFIO migration infrastructure that allows implementing dirty page tracking during the pre copy phase of live migration. Only DMA WRITEs are logged, and this API is not connected to VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE. This patch introduces the DMA logging involved uAPIs. It uses the FEATURE ioctl with its GET/SET/PROBE options as of below. It exposes a PROBE option to detect if the device supports DMA logging. It exposes a SET option to start device DMA logging in given IOVAs ranges. It exposes a SET option to stop device DMA logging that was previously started. It exposes a GET option to read back and clear the device DMA log. Extra details exist as part of vfio.h per a specific option. Signed-off-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220908183448.195262-4-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 2738c69a8813453b35549465867ae591f8598eb0 Author: Youquan Song Date: Thu Sep 1 12:43:10 2022 -0700 EDAC/i10nm: Add driver decoder for Ice Lake and Tremont CPUs Current i10nm_edac only supports firmware decoder (ACPI DSM methods). MCA bank registers of Ice Lake or Tremont CPUs contain the information to decode DDR memory errors. To get better decoding performance, add the driver decoder (decoding DDR memory errors via extracting error information from MCA bank registers) for Ice Lake and Tremont CPUs. Co-developed-by: Qiuxu Zhuo Signed-off-by: Qiuxu Zhuo Signed-off-by: Youquan Song Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220901194310.115427-1-tony.luck@intel.com/ commit 627d551a9e75ef81525822ba2a0d9d5a64791d89 Author: Qiuxu Zhuo Date: Thu Sep 1 12:43:09 2022 -0700 EDAC/skx_common: Make output format similar The decoded output format of driver decoder is different from the output format of firmware decoder. Make output format similar regardless of decode function (Align driver decoder's to firmware decoder's). Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220901194310.115427-1-tony.luck@intel.com/ commit fe32f366931a950889e8d72be86fafc867dab777 Author: Qiuxu Zhuo Date: Thu Sep 1 12:43:08 2022 -0700 EDAC/skx_common: Use driver decoder first The performance of driver decoder[1] is better than the performance of firmware decoder[2], especially on frequent correctable errors. So use the driver decoder first, fall back to firmware decoder if the driver decoder is unavailable. Also rename the function pointer skx_decode to driver_decode (better name to contrast with adxl_decode). [1] Decode errors by extracting error information from registers of memory controllers and/or MCA bank registers. [2] Decode errors by calling ACPI DSM methods. Co-developed-by: Youquan Song Signed-off-by: Youquan Song Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Link: https://lore.kernel.org/all/20220901194310.115427-1-tony.luck@intel.com/ commit 472d7b9e8141729ec1e3fe6821b88563f6379533 Author: Olliver Schinagl Date: Tue Aug 30 15:46:13 2022 +0200 dt-bindings: leds: Expand LED_COLOR_ID definitions In commit 853a78a7d6c7 (dt-bindings: leds: Add LED_COLOR_ID definitions, Sun Jun 9 20:19:04 2019 +0200) the most basic color definitions where added. However, there's a little more very common LED colors. While the documentation states 'add what is missing', engineers tend to be lazy and will just use what currently exists. So this patch will take (a) list from online retailers [0], [1], [2] and use the common LED colors from there, this being reasonable as this is what is currently available to purchase. Note, that LIME seems to be the modern take to 'Yellow-green' or 'Yellowish-green' from some older datasheets. [0]: https://www.digikey.com/en/products/filter/led-lighting-color/125 [1]: https://eu.mouser.com/c/optoelectronics/led-lighting/led-emitters/standard-leds-smd [2]: https://nl.farnell.com/en-NL/c/optoelectronics-displays/led-products/standard-single-colour-leds-under-75ma Signed-off-by: Olliver Schinagl Acked-by: Krzysztof Kozlowski Acked-by: Alexander Dahl Acked-by: Jacek Anaszewski Link: https://lore.kernel.org/r/20220830134613.1564059-1-oliver@schinagl.nl Signed-off-by: Rob Herring commit 2c5e5abf1c4278d5768a79b6bfc7d54cdc96e8df Author: Sasha Neftin Date: Mon Aug 8 13:24:21 2022 +0300 igc: Remove IGC_MDIC_INT_EN definition IGC_MDIC_INT_EN definition is not used. This patch comes to tidy up the driver code. Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 71aef261e0be0f7139fa5c05bc15e58385640f93 Merge: eab60bbc05a93 939838632b911 Author: Alex Williamson Date: Thu Sep 8 10:44:34 2022 -0600 Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next Merge net/mlx5 depedencies for device DMA logging and mlx5 variant driver suppport. Signed-off-by: Alex Williamson commit eab60bbc05a9375145e7b793ca37a1b6ec262887 Author: Christophe JAILLET Date: Fri Sep 2 18:07:54 2022 +0200 vfio/fsl-mc: Fix a typo in a message L and S are swapped in the message. s/VFIO_FLS_MC/VFIO_FSL_MC/ Also use 'ret' instead of 'WARN_ON(ret)' to avoid a duplicated message. Signed-off-by: Christophe JAILLET Reviewed-by: Diana Craciun Acked-by: Cornelia Huck Link: https://lore.kernel.org/r/a7c1394346725b7435792628c8d4c06a0a745e0b.1662134821.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alex Williamson commit 5d832b6694e094b176627ed9918a1b21c56fb742 Author: Imre Deak Date: Wed Sep 7 17:25:42 2022 +0300 drm/dp_mst: Avoid deleting payloads for connectors staying enabled When an MST connector stays enabled during a commit the connector's MST state needs to be added to the atomic state, but the corresponding MST payload allocation shouldn't be set for deletion; fix such modesets by ensuring the above even if the connector was already enabled before the modeset. The issue led to the following: [ 761.992923] i915 0000:00:02.0: drm_WARN_ON(payload->delete) [ 761.992949] WARNING: CPU: 6 PID: 1401 at drivers/gpu/drm/display/drm_dp_mst_topology.c:4221 drm_dp_atomic_find_time_slots+0x236/0x280 [drm_display_helper] [ 761.992955] Modules linked in: snd_hda_intel i915 drm_buddy drm_display_helper drm_kms_helper ttm drm snd_hda_codec_hdmi snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm prime_numbers i2c_algo_bit syscopyarea sysfillrect sysimgblt fb_sys_fops x86_pkg_temp_thermal cdc_ether coretemp crct10dif_pclmul usbnet crc32_pclmul mii ghash_clmulni_intel e1000e mei_me ptp i2c_i801 pps_core mei i2c_smbus intel_lpss_pci fuse [last unloaded: drm] [ 761.992986] CPU: 6 PID: 1401 Comm: testdisplay Tainted: G U 6.0.0-rc4-imre+ #565 [ 761.992989] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS ADLPFWI1.R00.3135.A00.2203251419 03/25/2022 [ 761.992990] RIP: 0010:drm_dp_atomic_find_time_slots+0x236/0x280 [drm_display_helper] [ 761.992994] Code: 4c 8b 67 50 4d 85 e4 75 03 4c 8b 27 e8 03 28 4e e1 48 c7 c1 8b 26 2c a0 4c 89 e2 48 c7 c7 a8 26 2c a0 48 89 c6 e8 31 d5 88 e1 <0f> 0b 49 8b 85 d0 00 00 00 4c 89 fa 48 c7 c6 a0 41 2c a0 48 8b 78 [ 761.992995] RSP: 0018:ffffc9000177ba60 EFLAGS: 00010286 [ 761.992998] RAX: 0000000000000000 RBX: ffff88810d2f1540 RCX: 0000000000000000 [ 761.992999] RDX: 0000000000000001 RSI: ffffffff82368a25 RDI: 00000000ffffffff [ 761.993000] RBP: ffff888142299d80 R08: ffff8884adbfdfe8 R09: 00000000ffefffff [ 761.993001] R10: ffff8884a6bfe000 R11: ffff8884ac443c30 R12: ffff888102972f90 [ 761.993002] R13: ffff8881163e2cf0 R14: 00000000000003ac R15: ffff88810c501000 [ 761.993003] FS: 00007f81e4c459c0(0000) GS:ffff888496500000(0000) knlGS:0000000000000000 [ 761.993004] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 761.993005] CR2: 0000555dac962a98 CR3: 0000000123a34006 CR4: 0000000000770ee0 [ 761.993006] PKRU: 55555554 [ 761.993007] Call Trace: [ 761.993009] [ 761.993012] intel_dp_mst_compute_config+0x19a/0x350 [i915] [ 761.993090] intel_atomic_check+0xf37/0x3180 [i915] [ 761.993168] drm_atomic_check_only+0x5d3/0xa60 [drm] [ 761.993182] drm_atomic_commit+0x56/0xc0 [drm] [ 761.993192] ? drm_plane_get_damage_clips.cold+0x1c/0x1c [drm] [ 761.993204] drm_atomic_helper_set_config+0x78/0xc0 [drm_kms_helper] [ 761.993214] drm_mode_setcrtc+0x1ed/0x750 [drm] [ 761.993232] ? drm_mode_getcrtc+0x180/0x180 [drm] [ 761.993241] drm_ioctl_kernel+0xb5/0x150 [drm] [ 761.993252] drm_ioctl+0x203/0x3d0 [drm] [ 761.993261] ? drm_mode_getcrtc+0x180/0x180 [drm] [ 761.993276] __x64_sys_ioctl+0x8a/0xb0 [ 761.993281] do_syscall_64+0x38/0x90 [ 761.993285] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 761.993287] RIP: 0033:0x7f81e551aaff [ 761.993288] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00 [ 761.993290] RSP: 002b:00007fff4304af10 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 761.993292] RAX: ffffffffffffffda RBX: 00007fff4304afa0 RCX: 00007f81e551aaff [ 761.993293] RDX: 00007fff4304afa0 RSI: 00000000c06864a2 RDI: 0000000000000004 [ 761.993294] RBP: 00000000c06864a2 R08: 0000000000000000 R09: 0000555dac8a9c68 [ 761.993294] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000008c4 [ 761.993295] R13: 0000000000000004 R14: 0000555dac8a9c68 R15: 00007fff4304b098 [ 761.993301] Fixes: 083351e96386 ("drm/display/dp_mst: Fix modeset tracking in drm_dp_atomic_release_vcpi_slots()") Testcase: igt@testdisplay Cc: Lyude Paul Signed-off-by: Imre Deak Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220907142542.1681994-1-imre.deak@intel.com commit 9f8f1933dce555d3c246f447f54fca8de8889da9 Merge: 75554fe00f941 26b1224903b3f Author: Paolo Abeni Date: Thu Sep 8 18:34:54 2022 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/freescale/fec.h 7d650df99d52 ("net: fec: add pm_qos support on imx6q platform") 40c79ce13b03 ("net: fec: add stop mode support for imx8 platform") Signed-off-by: Paolo Abeni commit f7ec3f62d7736ed14050716943a9562879155fcc Author: Lukas Bulwahn Date: Thu Sep 8 12:43:34 2022 +0200 media: remove reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER The config EMBEDDED selects EXPERT, i.e., when EMBEDDED is enabled, EXPERT is usually also enabled. Hence, it sufficient to have the option MEDIA_SUPPORT_FILTER set to y if !EXPERT. This way, MEDIA_SUPPORT_FILTER does not refer to CONFIG_EMBEDDED anymore and allows us to remove CONFIG_EMBEDDED in the close future. Remove the reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER. Link: https://lore.kernel.org/linux-media/20220908104337.11940-4-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab commit 758d7b3483b6eae4e0d52dc18ed6b4ed8fc1330e Author: Chen-Yu Tsai Date: Thu Sep 8 16:54:54 2022 +0800 drm/panel-edp: Add Innolux N120ACA-EA1 panel entry This panel has the same delay timing as N116BCA-EA1 from the same company, which is also the same as delay_200_500_e80_d50. Add an entry for it. Signed-off-by: Chen-Yu Tsai Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220908085454.1024167-2-wenst@chromium.org commit fb1752c7df4d7bac05ae7b879415d0506b2067d9 Author: Li Zhong Date: Tue Aug 30 00:15:49 2022 -0700 drivers/net/ethernet/e1000e: check return value of e1e_rphy() e1e_rphy() could return error value when reading PHY register, which needs to be checked. Signed-off-by: Li Zhong Acked-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit c35227d4e8cbc70a6622cc7cc5f8c3bff513f1fa Author: Uros Bizjak Date: Thu Sep 8 17:12:00 2022 +0200 sbitmap: Use atomic_long_try_cmpxchg in __sbitmap_queue_get_batch Use atomic_long_try_cmpxchg instead of atomic_long_cmpxchg (*ptr, old, new) == old in __sbitmap_queue_get_batch. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, atomic_long_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications, e.g. an extra memory read can be avoided in the loop. No functional change intended. Cc: Jens Axboe Signed-off-by: Uros Bizjak Link: https://lore.kernel.org/r/20220908151200.9993-1-ubizjak@gmail.com Signed-off-by: Jens Axboe commit 08865c2150392f67769a9d6e0b02800be226a990 Author: Andrew Halaney Date: Wed Sep 7 15:49:24 2022 -0500 regulator: dt-bindings: qcom,rpmh: Indicate regulator-allow-set-load dependencies For RPMH regulators it doesn't make sense to indicate regulator-allow-set-load without saying what modes you can switch to, so be sure to indicate a dependency on regulator-allowed-modes. In general this is true for any regulators that are setting modes instead of setting a load directly, for example RPMH regulators. A counter example would be RPM based regulators, which set a load change directly instead of a mode change. In the RPM case regulator-allow-set-load alone is sufficient to describe the regulator (the regulator can change its output current, here's the new load), but in the RPMH case what valid operating modes exist must also be stated to properly describe the regulator (the new load is this, what is the optimum mode for this regulator with that load, let's change to that mode now). With this in place devicetree validation can catch issues like this: /mnt/extrassd/git/linux-next/arch/arm64/boot/dts/qcom/sm8350-hdk.dtb: pm8350-rpmh-regulators: ldo5: 'regulator-allowed-modes' is a dependency of 'regulator-allow-set-load' From schema: /mnt/extrassd/git/linux-next/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml Where the RPMH regulator hardware is described as being settable, but there are no modes described to set it to! Suggested-by: Johan Hovold Reviewed-by: Johan Hovold Reviewed-by: Douglas Anderson Signed-off-by: Andrew Halaney Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220907204924.173030-1-ahalaney@redhat.com Signed-off-by: Mark Brown commit 2c230431e1e809270178905974f57cf3878939f5 Author: Linus Walleij Date: Wed Aug 31 21:55:53 2022 +0200 sparc: Fix the generic IO helpers This enables the Sparc to use to fill in the missing (undefined) [read|write]sq I/O accessor functions. This is needed if Sparc[64] ever wants to uses CONFIG_REGMAP_MMIO which has been patches to use accelerated _noinc accessors such as readsq/writesq that Sparc64, while being a 64bit platform, as of now not yet provide. This comes with the requirement that everything the architecture already provides needs to be defined, rather than just being, say, static inline functions. Bite the bullet and just provide the definitions and make it work. Compile-tested on sparc32 and sparc64. Reported-by: kernel test robot Signed-off-by: Linus Walleij Cc: David S. Miller Cc: sparclinux@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: Mark Brown Cc: Arnd Bergmann Link: https://lore.kernel.org/linux-arm-kernel/202208201639.HXye3ke4-lkp@intel.com/ Signed-off-by: Arnd Bergmann commit 7e772dad9913992d0351df760dbe72cc32d479f2 Author: Linus Walleij Date: Tue Sep 6 20:59:39 2022 +0200 alpha: Use generic This enables the alpha to use to fill in the missing (undefined) I/O accessor functions. This is needed if Alpha ever wants to uses CONFIG_REGMAP_MMIO which has been patches to use accelerated _noinc accessors such as readsq/writesq that Alpha, while being a 64bit platform, as of now not yet provide. readq/writeq is however provided so the machine can do 64bit I/O. This comes with the requirement that everything the architecture already provides needs to be defined, rather than just being, say, static inline functions. Bite the bullet and just provide the definitions and make it work. Some defines need to be piled right before the inclusion of due to the fact that alpha is including without selecting GENERIC_IOMAP. Reported-by: kernel test robot Signed-off-by: Linus Walleij Cc: Mark Brown Cc: Arnd Bergmann Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-arch@vger.kernel.org Cc: linux-alpha@vger.kernel.org Link: https://lore.kernel.org/linux-mm/202208181447.G9FLcMkI-lkp@intel.com/ Signed-off-by: Arnd Bergmann commit 1de7c3cf48fc41cd95adb12bd1ea9033a917798a Author: Shigeru Yoshida Date: Thu Sep 8 01:35:02 2022 +0900 nbd: Fix hung when signal interrupts nbd_start_device_ioctl() syzbot reported hung task [1]. The following program is a simplified version of the reproducer: int main(void) { int sv[2], fd; if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) < 0) return 1; if ((fd = open("/dev/nbd0", 0)) < 0) return 1; if (ioctl(fd, NBD_SET_SIZE_BLOCKS, 0x81) < 0) return 1; if (ioctl(fd, NBD_SET_SOCK, sv[0]) < 0) return 1; if (ioctl(fd, NBD_DO_IT) < 0) return 1; return 0; } When signal interrupt nbd_start_device_ioctl() waiting the condition atomic_read(&config->recv_threads) == 0, the task can hung because it waits the completion of the inflight IOs. This patch fixes the issue by clearing queue, not just shutdown, when signal interrupt nbd_start_device_ioctl(). Link: https://syzkaller.appspot.com/bug?id=7d89a3ffacd2b83fdd39549bc4d8e0a89ef21239 [1] Reported-by: syzbot+38e6c55d4969a14c1534@syzkaller.appspotmail.com Signed-off-by: Shigeru Yoshida Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220907163502.577561-1-syoshida@redhat.com Signed-off-by: Jens Axboe commit 48c033314f372478548203c583529f53080fd078 Author: Jan Kara Date: Thu Sep 8 15:09:37 2022 +0200 sbitmap: Avoid leaving waitqueue in invalid state in __sbq_wake_up() When __sbq_wake_up() decrements wait_cnt to 0 but races with someone else waking the waiter on the waitqueue (so the waitqueue becomes empty), it exits without reseting wait_cnt to wake_batch number. Once wait_cnt is 0, nobody will ever reset the wait_cnt or wake the new waiters resulting in possible deadlocks or busyloops. Fix the problem by making sure we reset wait_cnt even if we didn't wake up anybody in the end. Fixes: 040b83fcecfb ("sbitmap: fix possible io hung due to lost wakeup") Reported-by: Keith Busch Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220908130937.2795-1-jack@suse.cz Signed-off-by: Jens Axboe commit 86432b7f8f92b784c2e4af5b02766fb44052abf7 Author: Andy Shevchenko Date: Thu Sep 8 16:05:18 2022 +0300 spi: Group cs_change and cs_off flags together in struct spi_transfer The commit 5e0531f6b90a ("spi: Add capability to perform some transfer with chipselect off") added a new flag but squeezed it into a wrong group of struct spi_transfer members (note that SPI_NBITS_* are macros for easier interpretation of the tx_nbits and rx_nbits bitfields). Group cs_change and cs_off flags together and their doc strings. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908130518.32186-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 0fd64e61d2e388f61c97016e2a46e9dbe64147e8 Author: Michael Walle Date: Wed Sep 7 09:06:26 2022 +0200 arm64: defconfig: enable ARCH_NXP Commit 566e373fe047 ("arm64: Kconfig.platforms: Group NXP platforms together") introduced a new symbol ARCH_NXP and made ARCH_LAYERSCAPE (among others) depend on it, but didn't enable it in the defconfig. Thus, now the defconfig doesn't include support for any NXP architectures anymore. Fix it. Fixes: 566e373fe047 ("arm64: Kconfig.platforms: Group NXP platforms together") Signed-off-by: Michael Walle Acked-by: Florian Fainelli Signed-off-by: Arnd Bergmann commit 7e21f077b1f1f482ca9a59a00d6c12e7a1fc5d7e Author: Florian Fainelli Date: Mon Sep 5 20:39:56 2022 -0700 arm64: defconfig: enable ARCH_BCM Commit 96796c914b84 ("arm64: Kconfig.platforms: Re-organized Broadcom menu") introduced a new symbol ARCH_BCM and made all of the Broadcom SoCs Kconfig depend on it, but did not enable it in the defconfig. Thus, now the defconfig doesn't include support for any Broadcom architectures anymore. Fix it. Fixes: 96796c914b84 ("arm64: Kconfig.platforms: Re-organized Broadcom menu") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220906033957.4377-1-f.fainelli@gmail.com' Signed-off-by: Arnd Bergmann commit 3e3dcb464c0acb1b2a3b78e41c14b8f315f332b2 Merge: c9a2577d417cd 9491cff16a499 Author: Arnd Bergmann Date: Thu Sep 8 16:04:10 2022 +0200 Merge tag 'amlogic-drivers-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/drivers Amlogic Drivers changes for v6.1: - Hold reference returned by of_get_parent() in meson_pwrc * tag 'amlogic-drivers-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: soc: amlogic: meson-pwrc: Hold reference returned by of_get_parent() Link: https://lore.kernel.org/r/ea093c00-a4bb-fb80-3430-71916b2853f8@baylibre.com Signed-off-by: Arnd Bergmann commit ec491291dc94914cf962dcd399c3e9b43b00a770 Author: Maxime Ripard Date: Mon Aug 29 15:11:50 2022 +0200 drm/sun4i: tv: Merge mode_set into atomic_enable Our mode_set implementation can be merged into our atomic_enable implementation to simplify things, so let's do this. Acked-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-36-459522d653a7@cerno.tech commit 88d60d7d94bfab00abef3596fbf54b460c2a45ec Author: Andy Shevchenko Date: Thu Sep 8 12:43:23 2022 +0300 pinctrl: pistachio: Correct the fwnode_irq_get() return value check fwnode_irq_get() may return all possible signed values, such as Linux error code or 0. Fix the code to handle this properly. Fixes: 1074e1d23a5c ("pinctrl: pistachio: Switch to use fwnode instead of") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220908094323.31965-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 75554fe00f941c3c3d9344e88708093a14d2b4b8 Author: Casper Andersson Date: Tue Sep 6 08:58:15 2022 +0200 net: sparx5: fix function return type to match actual type Function returns error integer, not bool. Does not have any impact on functionality. Reported-by: Dan Carpenter Signed-off-by: Casper Andersson Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220906065815.3856323-1-casper.casan@gmail.com Signed-off-by: Paolo Abeni commit 36acf80fc0c4b5ebe6fa010b524d442ee7f08fd3 Author: Neil Armstrong Date: Thu Sep 8 14:18:03 2022 +0200 spi: meson-spicc: do not rely on busy flag in pow2 clk ops Since [1], controller's busy flag isn't set anymore when the __spi_transfer_message_noqueue() is used instead of the __spi_pump_transfer_message() logic for spi_sync transfers. Since the pow2 clock ops were limited to only be available when a transfer is ongoing (between prepare_transfer_hardware and unprepare_transfer_hardware callbacks), the only way to track this down is to check for the controller cur_msg. [1] ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync") Fixes: 09992025dacd ("spi: meson-spicc: add local pow2 clock ops to preserve rate between messages") Fixes: ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync") Reported-by: Markus Schneider-Pargmann Signed-off-by: Neil Armstrong Tested-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20220908121803.919943-1-narmstrong@baylibre.com Signed-off-by: Mark Brown commit 523820002ea725b37f67e82e8584543b5f7baa32 Merge: e9e7df88996d6 59a1063dcaa5c Author: Mark Brown Date: Thu Sep 8 13:31:27 2022 +0100 ASoC: soc-dapm.c: random cleanup retry Merge series from Kuninori Morimoto : These are remains of my previous cleanup patch-set. commit 1a41d1e5c8e5c5850a15abf3d18f610e9310b8ef Author: Manivannan Sadhasivam Date: Tue Aug 30 14:52:32 2022 +0530 pinctrl: qcom: spmi-gpio: Make irqchip immutable The irqchip implementation used inside the gpiochips are not supposed to be changed during runtime. So let's make the one inside the spmi-gpio gpiochip immutable. This fixes the below warning during boot: gpio gpiochip0: (c440000.spmi:pmic@0:gpio@c000): not an immutable chip, please consider fixing it! Acked-by: Marc Zyngier Signed-off-by: Manivannan Sadhasivam Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20220830092232.168561-1-manivannan.sadhasivam@linaro.org [switched two lines as indicated by Johan] Signed-off-by: Linus Walleij commit d818320ea200b02f2fea693b2be204f1990bb7e9 Author: Lukas Bulwahn Date: Thu Sep 8 12:43:35 2022 +0200 usb: chipidea: make configs for glue drivers visible with EXPERT Commit 6a108a14fa35 ("kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT") introduces CONFIG_EXPERT to carry the previous intent of CONFIG_EMBEDDED and just gives that intent a much better name. That has been clearly a good and long overdue renaming, and it is clearly an improvement to the kernel build configuration that has shown to help managing the kernel build configuration in the last decade. However, rather than bravely and radically just deleting CONFIG_EMBEDDED, this commit gives CONFIG_EMBEDDED a new intended semantics, but keeps it open for future contributors to implement that intended semantics: A new CONFIG_EMBEDDED option is added that automatically selects CONFIG_EXPERT when enabled and can be used in the future to isolate options that should only be considered for embedded systems (RISC architectures, SLOB, etc). Since then, this CONFIG_EMBEDDED implicitly had two purposes: - It can make even more options visible beyond what CONFIG_EXPERT makes visible. In other words, it may introduce another level of enabling the visibility of configuration options: always visible, visible with CONFIG_EXPERT and visible with CONFIG_EMBEDDED. - Set certain default values of some configurations differently, following the assumption that configuring a kernel build for an embedded system generally starts with a different set of default values compared to kernel builds for all other kind of systems. Considering the first purpose, at the point in time where CONFIG_EMBEDDED was renamed to CONFIG_EXPERT, CONFIG_EXPERT already made 130 more options become visible throughout all different menus for the kernel configuration. Over the last decade, this has gradually increased, so that currently, with CONFIG_EXPERT, roughly 170 more options become visible throughout all different menus for the kernel configuration. In comparison, currently with CONFIG_EMBEDDED enabled, just seven more options are visible, one in x86, one in arm, and five for the ChipIdea Highspeed Dual Role Controller. As the numbers suggest, these two levels of enabling the visibility of even more configuration options---beyond what CONFIG_EXPERT enables---never evolved to a good solution in the last decade. In other words, this additional level of visibility of configuration option with CONFIG_EMBEDDED compared to CONFIG_EXPERT has since its introduction never become really valuable. It requires quite some investigation to actually understand what is additionally visible and it does not differ significantly in complexity compared to just enabling CONFIG_EXPERT. This CONFIG_EMBEDDED---or any other config to show more detailed options beyond CONFIG_EXPERT---is unlikely to be valuable unless somebody puts significant effort in identifying how such visibility options can be properly split and creating clear criteria, when some config option is visible with CONFIG_EXPERT and when some config option is visible only with some further option enabled beyond CONFIG_EXPERT, such as CONFIG_EMBEDDED attempted to do. For now, it is much more reasonable to simply make those additional seven options that visible with CONFIG_EMBEDDED, visible with CONFIG_EXPERT, and then remove CONFIG_EMBEDDED. If anyone spends significant effort in structuring the visibility of config options, they may re-introduce suitable new config options simply as they see fit. Make the configs for usb chipidea glue drivers visible when CONFIG_EXPERT is enabled. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220908104337.11940-5-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit f2c9df101095bfef7682caec8a5fa7d4f3b29182 Author: Ville Syrjälä Date: Wed Sep 7 12:10:57 2022 +0300 drm/i915: Round TMDS clock to nearest Use round-to-nearest behavour when calculating the TMDS clock. Matches what we do for most other clock related things. Acked-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-18-ville.syrjala@linux.intel.com commit c46af5621adc766cf1a7cac300d577a39849862f Author: Ville Syrjälä Date: Wed Sep 7 12:10:56 2022 +0300 drm/i915: Use a fixed N value always Windows/BIOS always uses fixed N values. Let's match that behaviour. Allows us to also get rid of that constant_n quirk stuff. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-17-ville.syrjala@linux.intel.com commit e6f29923c0489b6fec1ac000f2c045df43ec081c Author: Ville Syrjälä Date: Wed Sep 7 12:10:55 2022 +0300 drm/i915: Allow M/N change during fastset on bdw+ On BDW+ M/N are double buffered and so we can easily reprogram them during a fastset. So for eDP panels that support seamless DRRS we can just change these without a full modeset. For earlier platforms we'd need to play tricks with M1/N1 vs. M2/N2 during the fastset to make sure we do the switch atomically. Not sure the added complexity is worth the hassle, so leave it alone for now. The slight downside is that we have to keep the link running at a link rate capable of supporting the highest refresh rate we want to use. For the moment we just pick the highest mode the panel reports and calculate the link based on that. This might need further refinement (eg. if we run into bandwidth restrictions)... v2: Only use the high link rate if the platform really supports the seamless M/N change uring fastset (ie. bdw+) v3: Rebase due to HAS_DOUBLE_BUFFERED_M_N() Reviewed-by: Mika Kahola Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-16-ville.syrjala@linux.intel.com commit 74d6f31fa427b87616bc65987a8aff460da1e670 Author: Ville Syrjälä Date: Wed Sep 7 12:10:54 2022 +0300 drm/i915: Add intel_panel_highest_mode() Add a function to get the fixed_mode with the highest clock. The plan is to use this for the link bw calculation on seamless DRRS panels so that we alwasy end up with the same link params regardless of the requested refresh rate. This will allow fastset to do seamless refresh rate changes based on userspace request instead of having to go for a full modeset. TODO: the function name isn't great Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-15-ville.syrjala@linux.intel.com commit 3917c9d3b2171dc838b486f7be6869525c6eee02 Author: Ville Syrjälä Date: Wed Sep 7 12:10:53 2022 +0300 drm/i915: Skip intel_modeset_pipe_config_late() if the pipe is not enabled No sense in calling intel_modeset_pipe_config_late() for a disabled pipe. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-14-ville.syrjala@linux.intel.com commit f7ba838cf75b348a3a8b0d11d347c964fdf870f3 Author: Ville Syrjälä Date: Wed Sep 7 12:10:52 2022 +0300 drm/i915: Nuke fastet state copy hacks Now that we no longer do the fuzzy clock and M/N checks we can get rid of the fastset state copy hacks. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-13-ville.syrjala@linux.intel.com commit daf195faa5a13972493d3a434e4d2e86ece722a5 Author: Ville Syrjälä Date: Wed Sep 7 12:10:51 2022 +0300 drm/i915: Set active dpll early for icl+ To make the fastboot checks at least somewhat sensible let's mark the expected DPLL as the active one right after we finished the state computation. Otherwise intel_pipe_config_compare() will always be comparing things against NULL/0. TODO: This is still not really right. If the previous commit had to fall back to the other PLL then the comparisong will now fail. I guess intel_pipe_config_compare() should rather be comparing port_dplls[] instead. But to do that we really should just unify every platform to use the port_dplls[] approach whether they have any need for PLL fallbacks or not. Acked-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-12-ville.syrjala@linux.intel.com commit 5a72df3a3290137f6fdf34f23ac617ca35262c76 Author: Ville Syrjälä Date: Wed Sep 7 12:10:50 2022 +0300 drm/i915: Make all clock checks non-fuzzy Now that we backfeed the actual DPLL frequency into the compute crtc state all our clocks should come out exact. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-11-ville.syrjala@linux.intel.com commit 27d06077d6e064ab5c02988d14bca4748045d002 Author: Ville Syrjälä Date: Wed Sep 7 12:10:49 2022 +0300 drm/i915: Make M/N checks non-fuzzy Now that we no longer fuzz M/N during fastset these should match exctly. In order to get a match with what the BIOS does we need to round M/N down. And we do the opposite rounding when doing the readback. That gets us pretty much the same thing back. There can still be slight rounding differences between FDI M/N vs. the DPLL output so we allow for tiny deviation in intel_pipe_config_sanity_check(). v2: Tweak rounding/sanity check stuff a bit Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-10-ville.syrjala@linux.intel.com commit 0ff0e219d9b8db047d3e800553f238136ed53ed7 Author: Ville Syrjälä Date: Wed Sep 7 12:10:48 2022 +0300 drm/i915: Compute clocks earlier Do the DPLL computation before fastset checks. This should allow us to get rid of all that horrible fuzzy clock handling for fastsets. Who knows how many bugs there are caused by our state not actually matching what the hardware will generate. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-9-ville.syrjala@linux.intel.com commit 665a7b04092c5671f3a6c34302aa1538948b4666 Author: Ville Syrjälä Date: Wed Sep 7 12:10:47 2022 +0300 drm/i915: Feed the DPLL output freq back into crtc_state Fill port_clock and hw.adjusted_mode.crtc_clock with the actual frequency we're going to be getting from the hardware. This will let us accurately compute all derived state that depends on those. v2: Reintroduce iCLKIP WARN v3: Try to deal with VLV/BXT DSI PLL as well Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-8-ville.syrjala@linux.intel.com commit e95132ef5d458b3e9d75acfbf4770e8b34de5315 Author: Ville Syrjälä Date: Wed Sep 7 12:10:46 2022 +0300 drm/i915: Reassign DPLLs only for crtcs going throug .compute_config() Only reassign the pipe's DPLL if it's going through a full .compute_config() cycle. If OTOH it's just getting modeset eg. in order to change cdclk there doesn't seem much point in picking a new DPLL for it. This should also prevent .get_dplls() from seeing a funky port_clock for DP even in cases where the readout produces a non-standard clock and we (for some reason) have decided to not fully recompute the state to remedy the situation. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-7-ville.syrjala@linux.intel.com commit b000abd3b3d2f06e9cc60c19dd4c893cb3531d76 Author: Ville Syrjälä Date: Wed Sep 7 12:10:45 2022 +0300 drm/i915: Do .crtc_compute_clock() earlier Currently we calculate a lot of things (pixel rate, watermarks, cdclk) trusting that the DPLL can generate the exact frequency we ask it. In practice that is not true and there can be certain amount of rounding involved. To allow us to eventually get accurate numbers for all our DPLL clock derived state we need to move the DPLL calculation to hapen much earlier. To that end we hoist it up to the just after the fastset checks. For now we just do the easy code motion, and the actual back feeding of the final DPLL clock into the state will come later. A slight change here is that now .crtc_compute_clock() can get called while the shared_dpll is still assigned. But since .crtc_compute_clock() no longer assignes new shared_dplls this is perfectly fine. TODO: I'd actually like to do this before the fastset check so that if the DPLL state should change we actually do the modeset. Which I think is what the video aficionados want, but it might not be what the fans of fastboot want. Not yet sure how to reconcile those conflicting requirements... v2: s/return/goto/ in error handling Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-6-ville.syrjala@linux.intel.com commit e66d6586843e7f34e25db0c20599a8ef3d816218 Author: Heiner Kallweit Date: Mon Sep 5 21:23:12 2022 +0200 r8169: merge support for chip versions 10, 13, 16 These chip versions are closely related and all of them have no chip-specific MAC/PHY initialization. Therefore merge support for the three chip versions. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/469d27e0-1d06-9b15-6c96-6098b3a52e35@gmail.com Signed-off-by: Paolo Abeni commit 014eac3e93515ef37a794b1880340efd616d5768 Author: ye xingchen Date: Thu Sep 8 01:04:29 2022 +0000 spi: lpspi: Remove the unneeded result variable Return the value pm_runtime_force_suspend() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220908010429.342875-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit e9e7df88996d64544178f48b0299dfe736c6aa22 Author: Shengjiu Wang Date: Thu Sep 8 15:31:56 2022 +0800 ASoC: ak4458: Remove component probe() and remove() Most function in ak4458_probe() and ak4458_remove() are duplicate with dai ops, so remove them and move dsd_path setting to dai ops. Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/1662622316-23426-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit b075f21e533aa51c2bda87d86ddfb6a3c0e38a92 Author: ye xingchen Date: Thu Sep 8 01:03:04 2022 +0000 ASoC: sti-sas: Remove the unneeded result variable Return the value regmap_write() and sti_sas_init_sas_registers() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220908010304.342760-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit 6ac246105b4fd737ed51b8ac3ef031f837686dee Author: Steve Lee Date: Thu Sep 8 15:03:59 2022 +0900 ASoC: max98390: Remove unnecessary amp on/off conrtol The Amp is already control in userspace before trigger calibrate function. Remove unnecessary control in calibrate function and add condition to check calibration is ready. Signed-off-by: Steve Lee Link: https://lore.kernel.org/r/20220908060359.13606-1-steve.lee.analog@gmail.com Signed-off-by: Mark Brown commit 59a1063dcaa5c9450dc1d221679418747bf086fc Author: Kuninori Morimoto Date: Thu Sep 8 02:45:27 2022 +0000 ASoC: soc-dapm.c: tidyup snd_soc_dai_link_event_pre_pmu() snd_soc_dai_link_event_pre_pmu() is using if/else for config->formats check, but "else" case is for just error. Unnecessary if/else is not good for readable code. this patch checks if config->formats was zero as error case. Moreover, we don't need to indicate config->formats value in error message, because it is zero. This patch tidyup it, too. => if (config->formats) { ... } else { dev_warn(w->dapm->dev, "ASoC: Invalid format %llx specified\n", => config->formats); ... } Link: https://lore.kernel.org/all/YxiDkDOwRsbXeZ17@sirena.org.uk/ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/877d2ebn3t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 6ef8443fb1ced148417d830894240a097ba79a03 Author: Kuninori Morimoto Date: Thu Sep 8 02:45:12 2022 +0000 ASoC: soc-dapm.c: add comment for kzalloc()/kfree() on snd_soc_dai_link_event_pre_pmu() snd_soc_dai_link_event_pre_pmu() is using kzalloc()/kfree() for params. It looks we don't need to use these, but are necessary. But, it is difficult to know why it is necessary without any comments. This patch adds the reasons via comment. Link: https://lore.kernel.org/all/Yxc2wzbZsSVZNf8Y@sirena.org.uk/ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/878rmubn47.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5b0c6328e47dccf552996ca711005ca3f44034e9 Author: Sudeep Holla Date: Wed Sep 7 15:52:40 2022 +0100 firmware: arm_ffa: Split up ffa_ops into info, message and memory operations In preparation to make memory operations accessible for a non ffa_driver/device, it is better to split the ffa_ops into different categories of operations: info, message and memory. The info and memory are ffa_device independent and can be used without any associated ffa_device from a non ffa_driver. However, we don't export these info and memory APIs yet without the user. The first users of these APIs can export them. Link: https://lore.kernel.org/r/20220907145240.1683088-11-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 106b11b1ccd5a43432d9517f4a26629a1658cfe6 Author: Sudeep Holla Date: Wed Sep 7 15:52:39 2022 +0100 firmware: arm_ffa: Set up 32bit execution mode flag using partiion property FF-A v1.1 adds a flag in the partition properties to indicate if the partition runs in the AArch32 or AArch64 execution state. Use the same to set-up the 32-bit execution flag mode in the ffa_dev automatically if the detected firmware version is above v1.0 and ignore any requests to do the same from the ffa_driver. Link: https://lore.kernel.org/r/20220907145240.1683088-10-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit bb1be749850055d88d839eff0962e5915788f228 Author: Sudeep Holla Date: Wed Sep 7 15:52:38 2022 +0100 firmware: arm_ffa: Add v1.1 get_partition_info support FF-A v1.1 adds support to discovery the UUIDs of the partitions that was missing in v1.0 and which the driver workarounds by using UUIDs supplied by the ffa_drivers. Add the v1.1 get_partition_info support and disable the workaround if the detected FF-A version is greater than v1.0. Link: https://lore.kernel.org/r/20220907145240.1683088-9-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 7aa7a97989557011f762a4b7c2e4e3b061b638e4 Author: Sudeep Holla Date: Wed Sep 7 15:52:37 2022 +0100 firmware: arm_ffa: Rename ffa_dev_ops as ffa_ops Except the message APIs, all other APIs are ffa_device independent and can be used without any associated ffa_device from a non ffa_driver. In order to reflect the same, just rename ffa_dev_ops as ffa_ops to avoid any confusion or to keep it simple. Link: https://lore.kernel.org/r/20220907145240.1683088-8-sudeep.holla@arm.com Suggested-by: Sumit Garg Reviewed-by: Sumit Garg Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 8c3812c8f74f050278d734ec4b90149d84bdbefb Author: Sudeep Holla Date: Wed Sep 7 15:52:36 2022 +0100 firmware: arm_ffa: Make memory apis ffa_device independent There is a requirement to make memory APIs independent of the ffa_device. One of the use-case is to have a common memory driver that manages the memory for all the ffa_devices. That common memory driver won't be a ffa_driver or won't have any ffa_device associated with it. So having these memory APIs accessible without a ffa_device is needed and should be possible as most of these are handled by the partition manager(SPM or hypervisor). Drop the ffa_device argument to the memory APIs and make them ffa_device independent. Link: https://lore.kernel.org/r/20220907145240.1683088-7-sudeep.holla@arm.com Acked-by: Jens Wiklander Signed-off-by: Sudeep Holla commit e57fba9105fac60d81a7ff2ce70d347d7ae95943 Author: Sudeep Holla Date: Wed Sep 7 15:52:35 2022 +0100 firmware: arm_ffa: Use FFA_FEATURES to detect if native versions are supported Currently, the ffa_dev->mode_32bit is use to detect if the native 64-bit or 32-bit versions of FF-A ABI needs to be used. However for the FF-A memory ABIs, it is not dependent on the ffa_device(i.e. the partition) itself, but the partition manager(SPM). So, the FFA_FEATURES can be use to detect if the native 64bit ABIs are supported or not and appropriate calls can be made based on that. Use FFA_FEATURES to detect if native versions of MEM_LEND or MEM_SHARE are implemented and make of the same to use native memory ABIs later on. Link: https://lore.kernel.org/r/20220907145240.1683088-6-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit cb1f4c2c15bb708b1ec8c70926c43ab6b6c93ecb Author: Sudeep Holla Date: Wed Sep 7 15:52:34 2022 +0100 firmware: arm_ffa: Add support for querying FF-A features Add support for FFA_FEATURES to discover properties supported at the FF-A interface. This interface can be used to query: - If an FF-A interface is implemented by the component at the higher EL, - If an implemented FF-A interface also implements any optional features described in its interface definition, and - Any implementation details exported by an implemented FF-A interface as described in its interface definition. Link: https://lore.kernel.org/r/20220907145240.1683088-5-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 55bf84fd0a76894ae29c69b3552e073fa37818be Author: Sudeep Holla Date: Wed Sep 7 15:52:33 2022 +0100 firmware: arm_ffa: Remove ffa_dev_ops_get() The only user of this exported ffa_dev_ops_get() was OPTEE driver which now uses ffa_dev->ops directly, there are no other users for this. Also, since any ffa driver can use ffa_dev->ops directly, there will be no need for ffa_dev_ops_get(), so just remove ffa_dev_ops_get(). Link: https://lore.kernel.org/r/20220907145240.1683088-4-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 320c3fa38c514eb71aa188da3495e13da9a30542 Author: Sudeep Holla Date: Wed Sep 7 15:52:32 2022 +0100 tee: optee: Drop ffa_ops in optee_ffa structure using ffa_dev->ops directly Now that the ffa_device structure holds the pointer to ffa_dev_ops, there is no need to obtain the same through ffa_dev_ops_get(). Just use the ffa_dev->ops directly. Since the ffa_device itself carries ffa_dev_ops now, there is no need to keep a copy in optee_ffa structure. Drop ffa_ops in the optee_ffa structure as it is not needed anymore. Link: https://lore.kernel.org/r/20220907145240.1683088-3-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Reviewed-by: Sumit Garg Signed-off-by: Sudeep Holla commit d01387fc16421cbbf95d1fda8fe1258195396c64 Author: Sudeep Holla Date: Wed Sep 7 15:52:31 2022 +0100 firmware: arm_ffa: Add pointer to the ffa_dev_ops in struct ffa_dev Currently ffa_dev_ops_get() is the way to fetch the ffa_dev_ops pointer. It checks if the ffa_dev structure pointer is valid before returning the ffa_dev_ops pointer. Instead, the pointer can be made part of the ffa_dev structure and since the core driver is incharge of creating ffa_device for each identified partition, there is no need to check for the validity explicitly if the pointer is embedded in the structure. Add the pointer to the ffa_dev_ops in the ffa_dev structure itself and initialise the same as part of creation of the device. Link: https://lore.kernel.org/r/20220907145240.1683088-2-sudeep.holla@arm.com Reviewed-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 04f7eb3d4582a0a4da67c86e55fda7de2df86d91 Author: Nirmoy Das Date: Wed Sep 7 19:26:41 2022 +0200 drm/i915: Set correct domains values at _i915_vma_move_to_active Fix regression introduced by commit: "drm/i915: Individualize fences before adding to dma_resv obj" which sets obj->read_domains to 0 for both read and write paths. Also set obj->write_domain to 0 on read path which was removed by the commit. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6639 Fixes: 420a07b841d0 ("drm/i915: Individualize fences before adding to dma_resv obj") Signed-off-by: Nirmoy Das Cc: # v5.16+ Cc: Matthew Auld Cc: Andrzej Hajda Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220907172641.12555-1-nirmoy.das@intel.com commit 3bb6a44251b4d066d73faf43dc17bad05963ae16 Author: Niranjana Vishwanathapura Date: Thu Sep 1 11:38:54 2022 -0700 drm/i915: Rename ggtt_view as gtt_view So far, different views (normal, partial, rotated and remapped) into the same object are only supported for GGTT mappings. But with the upcoming VM_BIND feature, PPGTT will also use the partial view mapping. Hence rename ggtt_view to more generic gtt_view. Signed-off-by: Niranjana Vishwanathapura Acked-by: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220901183854.3446-1-niranjana.vishwanathapura@intel.com commit e866025b3b1557f9bf6ab1770f297fe6d90e0417 Author: Daisuke Matsuda Date: Thu Sep 8 17:30:58 2022 +0900 RDMA/mlx5: Remove duplicate assignment in umr_rereg_pas() The same value is assigned to 'mr->ibmr.length'. Remove redundant one. Signed-off-by: Daisuke Matsuda Link: https://lore.kernel.org/r/20220908083058.3993700-1-matsuda-daisuke@fujitsu.com Signed-off-by: Leon Romanovsky commit 622113b9f11fdaeff2cc17f684fb7e4968fd8a4e Author: Javier Martinez Canillas Date: Tue Sep 6 00:27:59 2022 +0200 drm/ssd130x: Replace simple display helpers with the atomic helpers The simple display pipeline is a set of helpers that can be used by DRM drivers to avoid dealing with all the needed components and just define a few functions to operate a simple display device with one full-screen scanout buffer feeding a single output. But it is arguable that this provides the correct level of abstraction for simple drivers, and recently some have been ported from using these simple display helpers to use the regular atomic helpers instead. The rationale for this is that the simple display pipeline helpers don't hide that much of the DRM complexity, while adding an indirection layer that conflates the concepts of CRTCs and planes. This makes the helpers less flexible and harder to be reused among different graphics drivers. Also, for simple drivers, using the full atomic helpers doesn't require a lot of additional code. So adding a simple display pipeline layer may not be worth it. For these reasons, let's follow that trend and make ssd130x a plain DRM driver that creates its own primary plane, CRTC, enconder and connector. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220905222759.2597186-1-javierm@redhat.com commit 827eb27ec2e508e1ef5dc36d29db73cbae1ccb40 Author: Andy Shevchenko Date: Mon Sep 5 21:00:34 2022 +0300 pinctrl: meson: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220905180034.73132-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 6323f916686d4e9d299a53114b28ecaf833422cd Author: Andy Shevchenko Date: Tue Sep 6 14:50:21 2022 +0300 pinctrl: microchip-sgpio: Correct the fwnode_irq_get() return value check fwnode_irq_get() may return all possible signed values, such as Linux error code. Fix the code to handle this properly. Fixes: be2dc859abd4 ("pinctrl: pinctrl-microchip-sgpio: Add irq support (for sparx5)") Signed-off-by: Andy Shevchenko Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220906115021.8661-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0cb66809b805c68dcbb30284a73cb8e57d7ac7ee Merge: 71772aa7dd2b8 5b3a87a5c4f20 Author: Arnd Bergmann Date: Thu Sep 8 10:34:15 2022 +0200 Merge tag 'amlogic-arm64-dt-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM64 DT changes for v6.1: - add Bindings & DT for Beelink GT1 Ultimate - Remove invalid 'enable-active-low' on SM1 & G12A boards - add Bindings & DT for the new JetHub D1p * tag 'amlogic-arm64-dt-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson: add support for Beelink GT1 Ultimate dt-bindings: arm: amlogic: add Beelink GT1 Ultimate binding arm64: dts: meson-sm1-sei610: Remove 'enable-active-low' arm64: dts: meson-g12a: Remove 'enable-active-low' dt-bindings: arm: amlogic: add bindings for Jethub D1p (j110) arm64: dts: meson-axg: add support for JetHub D1p (j110) Link: https://lore.kernel.org/r/d0079686-40ae-58b2-e58b-c8dc6361d7f0@baylibre.com Signed-off-by: Arnd Bergmann commit 929d43421ee526c5a3c4d6f7e2bb1b98b2cb1b1f Author: Kurt Kanzenbach Date: Mon Sep 5 15:01:55 2022 +0200 net: stmmac: Disable automatic FCS/Pad stripping The stmmac has the possibility to automatically strip the padding/FCS for IEEE 802.3 type frames. This feature is enabled conditionally. Therefore, the stmmac receive path has to have a determination logic whether the FCS has to be stripped in software or not. In fact, for DSA this ACS feature is disabled and the determination logic doesn't check for it properly. For instance, when using DSA in combination with an older stmmac (pre version 4), the FCS is not stripped by hardware or software which is problematic. So either add another check for DSA to the fast path or simply disable ACS feature completely. The latter approach has been chosen, because most of the time the FCS is stripped in software anyway and it removes conditionals from the receive fast path. Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/87v8q8jjgh.fsf@kurt/ Link: https://lore.kernel.org/r/20220905130155.193640-1-kurt@linutronix.de Signed-off-by: Paolo Abeni commit 8c943137c00a773ece8d324862910d53832a97a1 Author: Andy Shevchenko Date: Mon Sep 5 21:51:02 2022 +0300 pinctrl: ingenic: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220905185102.74056-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f1509dad5dbf480e3f19fbd99e586d919adf55fe Author: Iskren Chernev Date: Sat Sep 3 20:41:45 2022 +0300 dt-bindings: pinctrl: qcom: sm6115: Add reserved ranges Ideally this and similar common properties will be inherited so you won't need to paste them in every pinctrl binding. Signed-off-by: Iskren Chernev Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20220903174150.3566935-5-iskren.chernev@gmail.com Signed-off-by: Linus Walleij commit 71e268e3426d2a1a4fcf3d88079d1d977fd034e0 Author: Francesco Dolcini Date: Tue Sep 6 00:44:08 2022 +0200 pinctrl: imx8m: kconfig: Fix build error on test compile PINCTRL_IMX depends on OF, however the dependency is missed when selected by PINCTRL_IMX8M* (it does not follow the indirect 'select' statements), select it explicitly. Cc: Arnd Bergmann Cc: Linus Walleij Reported-by: kernel test robot Link: https://lore.kernel.org/all/202209050605.fezJUgFH-lkp@intel.com/ Fixes: 87c2a29a6bf1 ("pinctrl: imx8m: kconfig: Depends on SOC_IMX8M") Signed-off-by: Francesco Dolcini Reviewed-by: Jacky Bai Link: https://lore.kernel.org/r/20220905224408.346425-1-francesco.dolcini@toradex.com Signed-off-by: Linus Walleij commit 63e23304488f25f7193d5868b6cef02cf3a05e66 Author: Andy Shevchenko Date: Fri Sep 2 21:26:50 2022 +0300 pinctrl: cy8c95x0: Correct comment style In a few comments the style is not aligned with the rest. Correct them. While at it, drop unneeded blank lines and deduplicate 'Author'. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-17-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 9540a8360673350526615e1dfe4993ba06de0f15 Author: Andy Shevchenko Date: Fri Sep 2 21:26:49 2022 +0300 pinctrl: cy8c95x0: use bits.h macros for all masks Make use of the GENMASK() (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-16-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 785b1bd8546eb0d9e70bd4d859583c33aaceeb9b Author: Andy Shevchenko Date: Fri Sep 2 21:26:48 2022 +0300 pinctrl: cy8c95x0: Override IRQ for one of the expanders on Galileo Gen 1 ACPI table on Intel Galileo Gen 1 has wrong pin number for IRQ resource of the I²C GPIO expander. Since we know what that number is and luckily have GPIO bases fixed for SoC's controllers, we may use a simple DMI quirk to match the platform and retrieve GpioInt() pin on it for the expander in question. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-15-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 618a43ff1f37603164ac82cfa0734a39c079a3e9 Author: Andy Shevchenko Date: Fri Sep 2 21:26:47 2022 +0300 pinctrl: cy8c95x0: support ACPI device found on Galileo Gen1 Add support of the expander found on Intel Galileo Gen1 board. The platform information comes from ACPI. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-14-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 8586466e4f11a5879a7c0df5d25da6c6a7d7c672 Author: Andy Shevchenko Date: Fri Sep 2 21:26:46 2022 +0300 pinctrl: cy8c95x0: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-13-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f12352f334c28a85e738f9caa31a0c5b07febd20 Author: Andy Shevchenko Date: Fri Sep 2 21:26:45 2022 +0300 pinctrl: cy8c95x0: Implement ->pin_dbg_show() The introduced callback ->pin_dbg_show() is useful for debugging. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-12-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit c3e4095287afbc8954928ae79849766194d364ac Author: Andy Shevchenko Date: Fri Sep 2 21:26:44 2022 +0300 pinctrl: cy8c95x0: Use 'default' in all switch-cases Move the default values to the 'default' case in the switches. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-11-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 1fa3df901f2c80d6a597abe462725e5a374b2795 Author: Andy Shevchenko Date: Fri Sep 2 21:26:43 2022 +0300 pinctrl: cy8c95x0: Remove custom ->set_config() Since we have pin configuration getter and setter provided, there is no need to duplicate that in the custom ->set_config(). Instead, switch to gpiochip_generic_config(). Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-10-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit a416bfb7d595b423cf50af58f1ea9263f233fbd5 Author: Andy Shevchenko Date: Fri Sep 2 21:26:42 2022 +0300 pinctrl: cy8c95x0: Remove useless conditionals The pin control framework checks pin boundaries before calling the respective driver's callbacks. Hence no need to check for pin boundaries, the respective conditionals won't be ever true. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-9-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 44c2533366d2259ce861d5e3adfb0237a844ffa4 Author: Andy Shevchenko Date: Fri Sep 2 21:26:41 2022 +0300 pinctrl: cy8c95x0: Remove device initialization The Cypress CY8C95x0 chips have an internal EEPROM that defines initial configuration. It might be that bootloader or other entity wrote the platform related setup into it. Don't override it in the driver. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-8-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d86e0344852eb65688c31227ee5a1e081f49e1bd Author: Andy Shevchenko Date: Fri Sep 2 21:26:40 2022 +0300 pinctrl: cy8c95x0: Enable GPIO range Since it's a pin control, GPIO counterpart needs to know the mapping between pin numbering and GPIO numbering. Enable this by calling gpiochip_add_pin_range() at the chip addition time. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-7-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 28ce127238f4bd3aaf5b6666f48f8e2a34b81579 Author: Andy Shevchenko Date: Fri Sep 2 21:26:39 2022 +0300 pinctrl: cy8c95x0: Drop unneeded npins assignment The npins field is assigned twice. Remove the first occurrence. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-6-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 641d6cc65dd4b783dd73ecfbface5e7a961c2f11 Author: Andy Shevchenko Date: Fri Sep 2 21:26:38 2022 +0300 pinctrl: cy8c95x0: Fix pin control name to enable more than one The Cypress GPIO expander is an I²C discrete component. Hence the platform may contain more than one of a such. Currently this has limitations in the driver due to same name used for all chips of a type. Replace this with device instance specific name. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 43dcf873d48d363d73fda0834c63d02ad177827e Author: Andy Shevchenko Date: Fri Sep 2 21:26:37 2022 +0300 pinctrl: cy8c95x0: Fix return value in cy8c95x0_detect() It's an obvious typo in never tested piece of code that successful detection shouldn't fail. Fix that. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-4-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit ad3d55aab4c08cdfc127753c5c5db78218cff4b2 Author: Andy Shevchenko Date: Fri Sep 2 21:26:35 2022 +0300 pinctrl: cy8c95x0: Allow IRQ chip core to handle numbering No need to assign first line number for IRQ chip. Let IRQ core to decide. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f5d620254c978746020a5be09f7b2a84dd9daa48 Author: Andy Shevchenko Date: Fri Sep 2 21:26:34 2022 +0300 pinctrl: cy8c95x0: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko Tested-by: Patrick Rudolph Link: https://lore.kernel.org/r/20220902182650.83098-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 415a04844aff46384c4264ad687f15579fac8f7e Author: Li Zhijian Date: Wed Sep 7 02:48:21 2022 +0000 RDMA/rxe: convert pr_warn to pr_debug They could be triggered by user APIs with invalid parameters. Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/1662518901-2-2-git-send-email-lizhijian@fujitsu.com Signed-off-by: Leon Romanovsky commit e2edba67fcd514f92401e073a624fbdeb37ce0db Author: Li Zhijian Date: Wed Sep 7 02:48:20 2022 +0000 RDMA/rxe: use %u to print u32 variables struct ib_qp_cap { u32 max_send_wr; u32 max_recv_wr; u32 max_send_sge; u32 max_recv_sge; u32 max_inline_data; ... To avoid getting a negative value from dmesg: [410580.579965] rdma_rxe: invalid send sge = 65535 > 32 [410580.583818] rdma_rxe: invalid send wr = -1 > 1048576 [410582.771323] rdma_rxe: invalid recv sge = 65535 > 32 [410582.775310] rdma_rxe: invalid recv wr = -1 > 1048576 Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/1662518901-2-1-git-send-email-lizhijian@fujitsu.com Signed-off-by: Leon Romanovsky commit e7647de058cba3c05b0d4753d84cbc042d02956a Author: ChiaEn Wu Date: Tue Aug 30 11:40:42 2022 +0800 video: backlight: mt6370: Add MediaTek MT6370 support MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight driver, display bias voltage supply, one general purpose LDO, and the USB Type-C & PD controller complies with the latest USB Type-C and PD standards. Add support for the MediaTek MT6370 backlight driver. It controls 4 channels of 8 series WLEDs in 2048 (only for MT6370/MT6371) / 16384 (only for MT6372) current steps (30 mA) in exponential or linear mapping curves. Reviewed-by: Daniel Thompson Signed-off-by: ChiaEn Wu Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220830034042.9354-11-peterwu.pub@gmail.com commit 16813ec5e03bd3ce424d7800984f2ea95c06dcc6 Author: ChiYuan Huang Date: Tue Aug 30 11:40:36 2022 +0800 dt-bindings: backlight: Add MediaTek MT6370 backlight Add MT6370 backlight binding documentation. Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Reviewed-by: Rob Herring Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220830034042.9354-5-peterwu.pub@gmail.com commit 408e532e80997be64caf8cdf45f2ff53c2279725 Author: Vijaya Krishna Nivarthi Date: Wed Sep 7 21:01:42 2022 +0530 tty: serial: qcom-geni-serial: Replace hardcoded icc flags with macros. In suspend/resume routines, icc flags are hardcoded. Replace the hardcodes with macros available from header. Reviewed-by: Stephen Boyd Signed-off-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/1662564702-7253-1-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 71a92e99c47900cc164620948b3863382cec4f1a Author: Zheng Yongjun Date: Tue Sep 6 14:17:03 2022 +0000 powerpc/powernv: add missing of_node_put() in opal_export_attrs() After using 'np' returned by of_find_node_by_path(), of_node_put() need be called to decrease the refcount. Fixes: 11fe909d2362 ("powerpc/powernv: Add OPAL exports attributes to sysfs") Signed-off-by: Zheng Yongjun Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220906141703.118192-1-zhengyongjun3@huawei.com commit 780244a2fe8a82424c85f4cb15e45d0bbeec8f26 Author: Tom St Denis Date: Wed Sep 7 10:18:01 2022 -0400 drm/amd/amdgpu: Add missing CGTS*TCC_DISABLE to 10.3 headers The TCC_DISABLE registers were not included in the 10.3 headers and instead just placed directly in the gfx_v10_0.c source. This patch adds them to the headers so tools like umr can scan them and support them. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 096e33f8ce4f4c82035edb532e8cb0883831e14b Author: Guchun Chen Date: Fri Sep 2 14:08:55 2022 +0800 drm/amdgpu: prevent toc firmware memory leak It's missed in psp fini. Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e00debc283893dff628bb420a10bd5f2e48c1866 Author: Yifan Zhang Date: Tue Sep 6 13:09:20 2022 +0800 drm/amdgpu: correct doorbell range/size value for CSDMA_DOORBELL_RANGE current function mixes CSDMA_DOORBELL_RANGE and SDMA0_DOORBELL_RANGE range/size manipulation, while these 2 registers have difference size field mask. Remove range/size manipulation for SDMA0_DOORBELL_RANGE. Signed-off-by: Yifan Zhang Reviewed-by: Xiaojian Du Signed-off-by: Alex Deucher commit fb0a0625f8516345f888d67bcbb96ade19a8f20f Author: Yifan Zhang Date: Sun Sep 4 15:53:27 2022 +0800 drm/amdkfd: print address in hex format rather than decimal Addresses should be printed in hex format. Signed-off-by: Yifan Zhang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 17048d89913c1713f0549aa47d63f2a4940545e8 Author: zhang songyi Date: Fri Sep 2 07:54:50 2022 +0000 drm/amd/display: Remove the unneeded result variable Return the enable_link_dp() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Reviewed-by: Rodrigo Siqueira Signed-off-by: zhang songyi Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b73ac0ecd4683878a335510fd100c1081e6c87fb Author: Greg Kroah-Hartman Date: Fri Sep 2 15:01:05 2022 +0200 drm/amd/display: fix memory leak when using debugfs_lookup() When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput(). Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Wayne Lin Cc: hersen wu Cc: Wenjing Liu Cc: Patrik Jakobsson Cc: Thelford Williams Cc: Fangzhi Zuo Cc: Yongzhi Liu Cc: Mikita Lipski Cc: Jiapeng Chong Cc: Bhanuprakash Modem Cc: Sean Paul Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org Reviewed-by: Rodrigo Siqueira Signed-off-by: Greg Kroah-Hartman Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 4678a2d352e055a186dd02613d54e30785810fb0 Author: John Garry Date: Mon Sep 5 16:23:06 2022 +0800 bus: hisi_lpc: Use platform_device_register_full() The code to create the child platform device is essentially the same as what platform_device_register_full() does, so change over to use that same function to reduce duplication. Signed-off-by: John Garry Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Wei Xu commit e8cd65061fac64d6d0b5c3f5c3059c326b1492f0 Author: Andy Shevchenko Date: Mon Sep 5 16:23:05 2022 +0800 bus: hisi_lpc: Don't guard ACPI IDs with ACPI_PTR() The OF ID table is not guarded, and the ACPI table does not needs it either. The IDs do not depend on the configuration. Hence drop ACPI_PTR() from the code and move ID table closer to its user. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry Signed-off-by: Wei Xu commit 5e3e70b8e1ae98358d1534e27b0a8259ce3efee8 Author: Andy Shevchenko Date: Mon Sep 5 16:23:04 2022 +0800 bus: hisi_lpc: Correct error code for timeout The usual error code is -ETIMEDOUT, the currently used -ETIME is specific for timers. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry Signed-off-by: Wei Xu commit 23bea44cd00c618dca7877366cf8a5340ac110e9 Author: Andy Shevchenko Date: Mon Sep 5 16:23:03 2022 +0800 bus: hisi_lpc: Use devm_platform_ioremap_resource The struct resource is not used for anything else, so we can simplify the code a bit by using the helper function. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry Signed-off-by: Wei Xu commit 947f11d153f20f87828a15e829d69890db71bcf7 Author: Andy Shevchenko Date: Mon Sep 5 16:23:02 2022 +0800 bus: hisi_lpc: Don't dereference fwnode handle Use dev_fwnode() and acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, which is a better coding practice. While at it, reuse fwnode instead of ACPI_COMPANION(). Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry Signed-off-by: Wei Xu commit 6d9b523dac1491a87bb3f15375e153de34a481d2 Author: Evan Quan Date: Thu Sep 1 13:48:58 2022 +0800 drm/amd/pm: add missing SetMGpuFanBoostLimitRpm mapping for SMU 13.0.7 Missing SetMGpuFanBoostLimitRpm mapping leads to loading failure for SMU 13.0.7. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ba6d29e885e856f2d9222861e61c370e25f0d2fe Author: Chengming Gui Date: Tue Sep 6 09:26:37 2022 +0800 drm/amd/amdgpu: add rlc_firmware_header_v2_4 to amdgpu_firmware_header Add missing structure to avoid incorrect size and version check. Signed-off-by: Chengming Gui Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit fac53471d0ea9693d314aa2df08d62b2e7e3a0f8 Author: YiPeng Chai Date: Thu Aug 18 16:46:59 2022 +0800 drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled V1: The psp_cmd_submit_buf function is called by psp_hw_fini to send TA unload messages to psp to terminate ras, asd and tmr. But when amdgpu is uninstalled, drm_dev_unplug is called earlier than psp_hw_fini in amdgpu_pci_remove, the calling order as follows: static void amdgpu_pci_remove(struct pci_dev *pdev) { drm_dev_unplug ...... amdgpu_driver_unload_kms->amdgpu_device_fini_hw->... ->.hw_fini->psp_hw_fini->... ->psp_ta_unload->psp_cmd_submit_buf ...... } The program will return when calling drm_dev_enter in psp_cmd_submit_buf. So the call to drm_dev_enter in psp_cmd_submit_buf should be removed, so that the TA unload messages can be sent to the psp when amdgpu is uninstalled. V2: 1. Restore psp_cmd_submit_buf to its original code. 2. Move drm_dev_unplug call after amdgpu_driver_unload_kms in amdgpu_pci_remove. 3. Since amdgpu_device_fini_hw is called by amdgpu_driver_unload_kms, remove the unplug check to release device mmio resource in amdgpu_device_fini_hw before calling drm_dev_unplug. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d4d944ff68cb1f896d3f3b1af0bc656949dc626a Author: Gustavo A. R. Silva Date: Tue Sep 6 22:32:13 2022 +0100 powerpc/85xx: Fix fall-through warning for Clang Fix the following fallthrough warning: arch/powerpc/platforms/85xx/mpc85xx_cds.c:161:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] Reported-by: kernel test robot Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://github.com/KSPP/linux/issues/198 Link: https://lore.kernel.org/lkml/202209061224.KxORRGVg-lkp@intel.com/ Link: https://lore.kernel.org/r/Yxe8XTY5C9qJLd0Z@work commit b11931e9adc1a439eab75c97ca4b9f15754cdcb1 Author: Nicholas Piggin Date: Thu Sep 1 21:03:34 2022 +1000 powerpc/64s: add pte_needs_flush and huge_pmd_needs_flush Allow PTE changes to avoid flushing the TLB when access permissions are being relaxed, the dirty bit is being set, and the accessed bit is being changed. Relaxing access permissions and setting dirty and accessed bits do not require a flush because the MMU will re-load the PTE and notice the updates (it may also cause a spurious fault). Clearing the accessed bit does not require a flush because of the imprecise PTE accessed bit accounting that is already performed, as documented in ptep_clear_flush_young(). This reduces TLB flushing for some mprotect(2) calls. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20220901110334.1618913-1-npiggin@gmail.com commit 78c73c80fd860d5b3471d8eaa2778a105a56f6ab Author: Christophe Leroy Date: Wed Sep 7 08:12:54 2022 +0200 powerpc/math-emu: Inhibit W=1 warnings When building with W=1 you get: arch/powerpc/math-emu/fre.c:6:5: error: no previous prototype for 'fre' [-Werror=missing-prototypes] arch/powerpc/math-emu/fsqrt.c:11:1: error: no previous prototype for 'fsqrt' [-Werror=missing-prototypes] arch/powerpc/math-emu/fsqrts.c:12:1: error: no previous prototype for 'fsqrts' [-Werror=missing-prototypes] arch/powerpc/math-emu/frsqrtes.c:6:5: error: no previous prototype for 'frsqrtes' [-Werror=missing-prototypes] arch/powerpc/math-emu/mtfsf.c:10:1: error: no previous prototype for 'mtfsf' [-Werror=missing-prototypes] arch/powerpc/math-emu/mtfsfi.c:10:1: error: no previous prototype for 'mtfsfi' [-Werror=missing-prototypes] arch/powerpc/math-emu/fabs.c:7:1: error: no previous prototype for 'fabs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fadd.c:11:1: error: no previous prototype for 'fadd' [-Werror=missing-prototypes] arch/powerpc/math-emu/fadds.c:12:1: error: no previous prototype for 'fadds' [-Werror=missing-prototypes] arch/powerpc/math-emu/fcmpo.c:11:1: error: no previous prototype for 'fcmpo' [-Werror=missing-prototypes] arch/powerpc/math-emu/fcmpu.c:11:1: error: no previous prototype for 'fcmpu' [-Werror=missing-prototypes] arch/powerpc/math-emu/fcmpu.c:14:19: error: variable 'B_c' set but not used [-Werror=unused-but-set-variable] arch/powerpc/math-emu/fcmpu.c:13:19: error: variable 'A_c' set but not used [-Werror=unused-but-set-variable] arch/powerpc/math-emu/fctiw.c:11:1: error: no previous prototype for 'fctiw' [-Werror=missing-prototypes] arch/powerpc/math-emu/fctiwz.c:11:1: error: no previous prototype for 'fctiwz' [-Werror=missing-prototypes] arch/powerpc/math-emu/fdiv.c:11:1: error: no previous prototype for 'fdiv' [-Werror=missing-prototypes] arch/powerpc/math-emu/fdivs.c:12:1: error: no previous prototype for 'fdivs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmadd.c:11:1: error: no previous prototype for 'fmadd' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmadds.c:12:1: error: no previous prototype for 'fmadds' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmsub.c:11:1: error: no previous prototype for 'fmsub' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmsubs.c:12:1: error: no previous prototype for 'fmsubs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmul.c:11:1: error: no previous prototype for 'fmul' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmuls.c:12:1: error: no previous prototype for 'fmuls' [-Werror=missing-prototypes] arch/powerpc/math-emu/fnabs.c:7:1: error: no previous prototype for 'fnabs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fneg.c:7:1: error: no previous prototype for 'fneg' [-Werror=missing-prototypes] arch/powerpc/math-emu/fnmadd.c:11:1: error: no previous prototype for 'fnmadd' [-Werror=missing-prototypes] arch/powerpc/math-emu/fnmadds.c:12:1: error: no previous prototype for 'fnmadds' [-Werror=missing-prototypes] arch/powerpc/math-emu/fnmsub.c:11:1: error: no previous prototype for 'fnmsub' [-Werror=missing-prototypes] arch/powerpc/math-emu/fnmsubs.c:12:1: error: no previous prototype for 'fnmsubs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fres.c:7:1: error: no previous prototype for 'fres' [-Werror=missing-prototypes] arch/powerpc/math-emu/frsp.c:12:1: error: no previous prototype for 'frsp' [-Werror=missing-prototypes] arch/powerpc/math-emu/fsel.c:11:1: error: no previous prototype for 'fsel' [-Werror=missing-prototypes] arch/powerpc/math-emu/lfs.c:12:1: error: no previous prototype for 'lfs' [-Werror=missing-prototypes] arch/powerpc/math-emu/frsqrte.c:7:1: error: no previous prototype for 'frsqrte' [-Werror=missing-prototypes] arch/powerpc/math-emu/fsub.c:11:1: error: no previous prototype for 'fsub' [-Werror=missing-prototypes] arch/powerpc/math-emu/fsubs.c:12:1: error: no previous prototype for 'fsubs' [-Werror=missing-prototypes] arch/powerpc/math-emu/mcrfs.c:10:1: error: no previous prototype for 'mcrfs' [-Werror=missing-prototypes] arch/powerpc/math-emu/mffs.c:10:1: error: no previous prototype for 'mffs' [-Werror=missing-prototypes] arch/powerpc/math-emu/mtfsb0.c:10:1: error: no previous prototype for 'mtfsb0' [-Werror=missing-prototypes] arch/powerpc/math-emu/mtfsb1.c:10:1: error: no previous prototype for 'mtfsb1' [-Werror=missing-prototypes] arch/powerpc/math-emu/stfiwx.c:7:1: error: no previous prototype for 'stfiwx' [-Werror=missing-prototypes] arch/powerpc/math-emu/stfs.c:12:1: error: no previous prototype for 'stfs' [-Werror=missing-prototypes] arch/powerpc/math-emu/fmr.c:7:1: error: no previous prototype for 'fmr' [-Werror=missing-prototypes] arch/powerpc/math-emu/lfd.c:10:1: error: no previous prototype for 'lfd' [-Werror=missing-prototypes] arch/powerpc/math-emu/stfd.c:7:1: error: no previous prototype for 'stfd' [-Werror=missing-prototypes] arch/powerpc/math-emu/math_efp.c:177:5: error: no previous prototype for 'do_spe_mathemu' [-Werror=missing-prototypes] arch/powerpc/math-emu/math_efp.c:726:5: error: no previous prototype for 'speround_handler' [-Werror=missing-prototypes] arch/powerpc/math-emu/math_efp.c:893:12: error: no previous prototype for 'spe_mathemu_init' [-Werror=missing-prototypes] Fix the warnings in math_efp.c by adding prototypes of do_spe_mathemu() and speround_handler() to asm/processor.h and declare spe_mathemu_init() static. The other warnings are benign and not worth the churn of fixing them, expecially the 'unused-but-set-variable' which would impact the core part of 'math-emu'. So silence them by adding -Wno-missing-prototypes -Wno-unused-but-set-variable. But then you get: arch/powerpc/math-emu/fre.c:6:5: error: no previous declaration for 'fre' [-Werror=missing-declarations] arch/powerpc/math-emu/fsqrt.c:11:1: error: no previous declaration for 'fsqrt' [-Werror=missing-declarations] arch/powerpc/math-emu/fsqrts.c:12:1: error: no previous declaration for 'fsqrts' [-Werror=missing-declarations] arch/powerpc/math-emu/frsqrtes.c:6:5: error: no previous declaration for 'frsqrtes' [-Werror=missing-declarations] arch/powerpc/math-emu/mtfsf.c:10:1: error: no previous declaration for 'mtfsf' [-Werror=missing-declarations] arch/powerpc/math-emu/mtfsfi.c:10:1: error: no previous declaration for 'mtfsfi' [-Werror=missing-declarations] arch/powerpc/math-emu/fabs.c:7:1: error: no previous declaration for 'fabs' [-Werror=missing-declarations] arch/powerpc/math-emu/fadd.c:11:1: error: no previous declaration for 'fadd' [-Werror=missing-declarations] arch/powerpc/math-emu/fadds.c:12:1: error: no previous declaration for 'fadds' [-Werror=missing-declarations] arch/powerpc/math-emu/fcmpo.c:11:1: error: no previous declaration for 'fcmpo' [-Werror=missing-declarations] arch/powerpc/math-emu/fcmpu.c:11:1: error: no previous declaration for 'fcmpu' [-Werror=missing-declarations] arch/powerpc/math-emu/fctiw.c:11:1: error: no previous declaration for 'fctiw' [-Werror=missing-declarations] arch/powerpc/math-emu/fctiwz.c:11:1: error: no previous declaration for 'fctiwz' [-Werror=missing-declarations] arch/powerpc/math-emu/fdiv.c:11:1: error: no previous declaration for 'fdiv' [-Werror=missing-declarations] arch/powerpc/math-emu/fdivs.c:12:1: error: no previous declaration for 'fdivs' [-Werror=missing-declarations] arch/powerpc/math-emu/fmadd.c:11:1: error: no previous declaration for 'fmadd' [-Werror=missing-declarations] arch/powerpc/math-emu/fmadds.c:12:1: error: no previous declaration for 'fmadds' [-Werror=missing-declarations] arch/powerpc/math-emu/fmsub.c:11:1: error: no previous declaration for 'fmsub' [-Werror=missing-declarations] arch/powerpc/math-emu/fmsubs.c:12:1: error: no previous declaration for 'fmsubs' [-Werror=missing-declarations] arch/powerpc/math-emu/fmul.c:11:1: error: no previous declaration for 'fmul' [-Werror=missing-declarations] arch/powerpc/math-emu/fmuls.c:12:1: error: no previous declaration for 'fmuls' [-Werror=missing-declarations] arch/powerpc/math-emu/fnabs.c:7:1: error: no previous declaration for 'fnabs' [-Werror=missing-declarations] arch/powerpc/math-emu/fneg.c:7:1: error: no previous declaration for 'fneg' [-Werror=missing-declarations] arch/powerpc/math-emu/fnmadd.c:11:1: error: no previous declaration for 'fnmadd' [-Werror=missing-declarations] arch/powerpc/math-emu/fnmadds.c:12:1: error: no previous declaration for 'fnmadds' [-Werror=missing-declarations] arch/powerpc/math-emu/fnmsub.c:11:1: error: no previous declaration for 'fnmsub' [-Werror=missing-declarations] arch/powerpc/math-emu/fnmsubs.c:12:1: error: no previous declaration for 'fnmsubs' [-Werror=missing-declarations] arch/powerpc/math-emu/fres.c:7:1: error: no previous declaration for 'fres' [-Werror=missing-declarations] arch/powerpc/math-emu/frsp.c:12:1: error: no previous declaration for 'frsp' [-Werror=missing-declarations] arch/powerpc/math-emu/fsel.c:11:1: error: no previous declaration for 'fsel' [-Werror=missing-declarations] arch/powerpc/math-emu/lfs.c:12:1: error: no previous declaration for 'lfs' [-Werror=missing-declarations] arch/powerpc/math-emu/frsqrte.c:7:1: error: no previous declaration for 'frsqrte' [-Werror=missing-declarations] arch/powerpc/math-emu/fsub.c:11:1: error: no previous declaration for 'fsub' [-Werror=missing-declarations] arch/powerpc/math-emu/fsubs.c:12:1: error: no previous declaration for 'fsubs' [-Werror=missing-declarations] arch/powerpc/math-emu/mcrfs.c:10:1: error: no previous declaration for 'mcrfs' [-Werror=missing-declarations] arch/powerpc/math-emu/mffs.c:10:1: error: no previous declaration for 'mffs' [-Werror=missing-declarations] arch/powerpc/math-emu/mtfsb0.c:10:1: error: no previous declaration for 'mtfsb0' [-Werror=missing-declarations] arch/powerpc/math-emu/mtfsb1.c:10:1: error: no previous declaration for 'mtfsb1' [-Werror=missing-declarations] arch/powerpc/math-emu/stfiwx.c:7:1: error: no previous declaration for 'stfiwx' [-Werror=missing-declarations] arch/powerpc/math-emu/stfs.c:12:1: error: no previous declaration for 'stfs' [-Werror=missing-declarations] arch/powerpc/math-emu/fmr.c:7:1: error: no previous declaration for 'fmr' [-Werror=missing-declarations] arch/powerpc/math-emu/lfd.c:10:1: error: no previous declaration for 'lfd' [-Werror=missing-declarations] arch/powerpc/math-emu/stfd.c:7:1: error: no previous declaration for 'stfd' [-Werror=missing-declarations] So also add -Wno-missing-declarations. Reported-by: kernel test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/688084b40b5ac88f2905cb207d5dad947d8d34dc.1662531153.git.christophe.leroy@csgroup.eu commit b239da34203f49c40b5d656220c39647c3ff0b3c Author: Kumar Kartikeya Dwivedi Date: Sun Sep 4 22:41:28 2022 +0200 bpf: Add helper macro bpf_for_each_reg_in_vstate For a lot of use cases in future patches, we will want to modify the state of registers part of some same 'group' (e.g. same ref_obj_id). It won't just be limited to releasing reference state, but setting a type flag dynamically based on certain actions, etc. Hence, we need a way to easily pass a callback to the function that iterates over all registers in current bpf_verifier_state in all frames upto (and including) the curframe. While in C++ we would be able to easily use a lambda to pass state and the callback together, sadly we aren't using C++ in the kernel. The next best thing to avoid defining a function for each case seems like statement expressions in GNU C. The kernel already uses them heavily, hence they can passed to the macro in the style of a lambda. The statement expression will then be substituted in the for loop bodies. Variables __state and __reg are set to current bpf_func_state and reg for each invocation of the expression inside the passed in verifier state. Then, convert mark_ptr_or_null_regs, clear_all_pkt_pointers, release_reference, find_good_pkt_pointers, find_equal_scalars to use bpf_for_each_reg_in_vstate. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220904204145.3089-16-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit e72df53dcb01ec58e0410da353551adf94c8d0f1 Author: Ankit Nautiyal Date: Fri Sep 2 16:02:19 2022 +0530 drm/i915/vdsc: Set VDSC PIC_HEIGHT before using for DP DSC Currently, pic_height of vdsc_cfg structure is being used to calculate slice_height, before it is set for DP. So taking out the lines to set pic_height from the helper intel_dp_dsc_compute_params() to individual encoders, and setting pic_height, before it is used to calculate slice_height for DP. Fixes: 5a6d866f8e1b ("drm/i915: Get slice height before computing rc params") Cc: Manasi Navare Cc: Vandita Kulkarni Cc: Matt Roper Signed-off-by: Ankit Nautiyal Reviewed-by: Vandita Kulkarni Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220902103219.1168781-1-ankit.k.nautiyal@intel.com commit 66cb2a36a96f6facbcb4ef1db967b8e9ea6910fe Author: Kees Cook Date: Wed Sep 7 16:27:06 2022 -0700 kunit/memcpy: Avoid pathological compile-time string size The memcpy() KUnit tests are trying to sanity-check run-time behaviors, but tripped compile-time warnings about a pathological condition of a too-small buffer being used for input. Avoid this by explicitly resizing the buffer, but leaving the string short. Avoid the following warning: lib/memcpy_kunit.c: In function 'strtomem_test': include/linux/string.h:303:42: warning: 'strnlen' specified bound 4 exceeds source size 3 [-Wstringop-overread] 303 | memcpy(dest, src, min(_dest_len, strnlen(src, _dest_len))); \ include/linux/minmax.h:32:39: note: in definition of macro '__cmp_once' 32 | typeof(y) unique_y = (y); \ | ^ include/linux/minmax.h:45:25: note: in expansion of macro '__careful_cmp' 45 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ include/linux/string.h:303:27: note: in expansion of macro 'min' 303 | memcpy(dest, src, min(_dest_len, strnlen(src, _dest_len))); \ | ^~~ lib/memcpy_kunit.c:290:9: note: in expansion of macro 'strtomem' 290 | strtomem(wrap.output, input); | ^~~~~~~~ lib/memcpy_kunit.c:275:27: note: source object allocated here 275 | static const char input[] = "hi"; | ^~~~~ Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202209070728.o3stvgVt-lkp@intel.com Fixes: dfbafa70bde2 ("string: Introduce strtomem() and strtomem_pad()") Signed-off-by: Kees Cook commit 98388bda6a99d76309f81584f2bc0d773bdf8b35 Author: Bart Van Assche Date: Wed Sep 7 11:03:29 2022 -0700 lib: Improve the is_signed_type() kunit test Since the definition of is_signed_type() has been moved from to , include the latter header file instead of the former. Additionally, add a test for the type 'char'. Cc: Isabella Basso Cc: Rasmus Villemoes Signed-off-by: Bart Van Assche Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220907180329.3825417-1-bvanassche@acm.org commit 6e42aec7c75947e0d6b38400628f171364eb8231 Author: Matthias Kaehlcke Date: Tue Sep 6 18:18:12 2022 -0700 LoadPin: Require file with verity root digests to have a header LoadPin expects the file with trusted verity root digests to be an ASCII file with one digest (hex value) per line. A pinned root could contain files that meet these format requirements, even though the hex values don't represent trusted root digests. Add a new requirement to the file format which consists in the first line containing a fixed string. This prevents attackers from feeding files with an otherwise valid format to LoadPin. Suggested-by: Sarthak Kukreti Signed-off-by: Matthias Kaehlcke Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220906181725.1.I3f51d1bb0014e5a5951be4ad3c5ad7c7ca1dfc32@changeid commit 916ef6232cc4b84db7082b4c3d3cf1753d9462ba Author: Matthias Kaehlcke Date: Wed Sep 7 13:30:58 2022 -0700 dm: verity-loadpin: Only trust verity targets with enforcement Verity targets can be configured to ignore corrupted data blocks. LoadPin must only trust verity targets that are configured to perform some kind of enforcement when data corruption is detected, like returning an error, restarting the system or triggering a panic. Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin") Reported-by: Sarthak Kukreti Signed-off-by: Matthias Kaehlcke Reviewed-by: Sarthak Kukreti Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220907133055.1.Ic8a1dafe960dc0f8302e189642bc88ebb785d274@changeid commit aafc203bbad4bf6cf394a34ea698c2b0b8affae0 Author: Matthias Kaehlcke Date: Mon Aug 29 17:46:10 2022 -0700 LoadPin: Fix Kconfig doc about format of file with verity digests The doc for CONFIG_SECURITY_LOADPIN_VERITY says that the file with verity digests must contain a comma separated list of digests. That was the case at some stage of the development, but was changed during the review process to one digest per line. Update the Kconfig doc accordingly. Reported-by: Jae Hoon Kim Signed-off-by: Matthias Kaehlcke Fixes: 3f805f8cc23b ("LoadPin: Enable loading from trusted dm-verity devices") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220829174557.1.I5d202d1344212a3800d9828f936df6511eb2d0d1@changeid commit ba38961a069b0d8d03b53218a6c29d737577d448 Author: Kees Cook Date: Wed Feb 9 16:32:24 2022 -0800 um: Enable FORTIFY_SOURCE Enable FORTIFY_SOURCE so running Kunit tests can test fortified functions. Signed-off-by: Kees Cook Tested-by: David Gow Link: https://lore.kernel.org/r/20220210003224.773957-1-keescook@chromium.org commit 325bf6d84bad3fc641b94fad6e69c70e960fdf2e Author: Kees Cook Date: Wed Aug 31 23:05:01 2022 -0700 lkdtm: Update tests for memcpy() run-time warnings Clarify the LKDTM FORTIFY tests, and add tests for the mem*() family of functions, now that run-time checking is distinct. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook commit 54d9469bc515dc5fcbc20eecbe19cea868b70d68 Author: Kees Cook Date: Thu Jun 24 15:39:26 2021 -0700 fortify: Add run-time WARN for cross-field memcpy() Enable run-time checking of dynamic memcpy() and memmove() lengths, issuing a WARN when a write would exceed the size of the target struct member, when built with CONFIG_FORTIFY_SOURCE=y. This would have caught all of the memcpy()-based buffer overflows in the last 3 years, specifically covering all the cases where the destination buffer size is known at compile time. This change ONLY adds a run-time warning. As false positives are currently still expected, this will not block the overflow. The new warnings will look like this: memcpy: detected field-spanning write (size N) of single field "var->dest" (size M) WARNING: CPU: n PID: pppp at source/file/path.c:nr function+0xXX/0xXX [module] There may be false positives in the kernel where intentional field-spanning writes are happening. These need to be addressed similarly to how the compile-time cases were addressed: add a struct_group(), split the memcpy(), or some other refactoring. In order to make counting/investigating instances of added runtime checks easier, each instance includes the destination variable name as a WARN argument, prefixed with 'field "'. Therefore, on an x86_64 defconfig build, it is trivial to inspect the build artifacts to find instances. For example on an x86_64 defconfig build, there are 78 new run-time memcpy() bounds checks added: $ for i in vmlinux $(find . -name '*.ko'); do \ strings "$i" | grep '^field "'; done | wc -l 78 Simple cases where a destination buffer is known to be a dynamic size do not generate a WARN. For example: struct normal_flex_array { void *a; int b; u32 c; size_t array_size; u8 flex_array[]; }; struct normal_flex_array *instance; ... /* These will be ignored for run-time bounds checking. */ memcpy(instance, src, len); memcpy(instance->flex_array, src, len); However, one of the dynamic-sized destination cases is irritatingly unable to be detected by the compiler: when using memcpy() to target a composite struct member which contains a trailing flexible array struct. For example: struct wrapper { int foo; char bar; struct normal_flex_array embedded; }; struct wrapper *instance; ... /* This will incorrectly WARN when len > sizeof(instance->embedded) */ memcpy(&instance->embedded, src, len); These cases end up appearing to the compiler to be sized as if the flexible array had 0 elements. :( For more details see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101832 https://godbolt.org/z/vW6x8vh4P These "composite flexible array structure destination" cases will be need to be flushed out and addressed on a case-by-case basis. Regardless, for the general case of using memcpy() on flexible array destinations, future APIs will be created to handle common cases. Those can be used to migrate away from open-coded memcpy() so that proper error handling (instead of trapping) can be used. As mentioned, none of these bounds checks block any overflows currently. For users that have tested their workloads, do not encounter any warnings, and wish to make these checks stop any overflows, they can use a big hammer and set the sysctl panic_on_warn=1. Signed-off-by: Kees Cook commit 311fb40aa0569abacc430b0d66ee41470803111f Author: Kees Cook Date: Fri Sep 2 13:23:06 2022 -0700 fortify: Use SIZE_MAX instead of (size_t)-1 Clean up uses of "(size_t)-1" in favor of SIZE_MAX. Cc: linux-hardening@vger.kernel.org Suggested-by: Nick Desaulniers Signed-off-by: Kees Cook commit 875bfd5276f31d09e811d31fca638b9f4d1205e8 Author: Kees Cook Date: Fri Sep 2 13:02:26 2022 -0700 fortify: Add KUnit test for FORTIFY_SOURCE internals Add lib/fortify_kunit.c KUnit test for checking the expected behavioral characteristics of FORTIFY_SOURCE internals. Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Tom Rix Cc: Andrew Morton Cc: Vlastimil Babka Cc: "Steven Rostedt (Google)" Cc: Yury Norov Cc: Masami Hiramatsu Cc: Sander Vanheule Cc: linux-hardening@vger.kernel.org Cc: llvm@lists.linux.dev Reviewed-by: David Gow Signed-off-by: Kees Cook commit d07c0acb4f41cc42a0d97530946965b3e4fa68c1 Author: Kees Cook Date: Fri Sep 2 13:02:26 2022 -0700 fortify: Fix __compiletime_strlen() under UBSAN_BOUNDS_LOCAL With CONFIG_FORTIFY=y and CONFIG_UBSAN_LOCAL_BOUNDS=y enabled, we observe a runtime panic while running Android's Compatibility Test Suite's (CTS) android.hardware.input.cts.tests. This is stemming from a strlen() call in hidinput_allocate(). __compiletime_strlen() is implemented in terms of __builtin_object_size(), then does an array access to check for NUL-termination. A quirk of __builtin_object_size() is that for strings whose values are runtime dependent, __builtin_object_size(str, 1 or 0) returns the maximum size of possible values when those sizes are determinable at compile time. Example: static const char *v = "FOO BAR"; static const char *y = "FOO BA"; unsigned long x (int z) { // Returns 8, which is: // max(__builtin_object_size(v, 1), __builtin_object_size(y, 1)) return __builtin_object_size(z ? v : y, 1); } So when FORTIFY_SOURCE is enabled, the current implementation of __compiletime_strlen() will try to access beyond the end of y at runtime using the size of v. Mixed with UBSAN_LOCAL_BOUNDS we get a fault. hidinput_allocate() has a local C string whose value is control flow dependent on a switch statement, so __builtin_object_size(str, 1) evaluates to the maximum string length, making all other cases fault on the last character check. hidinput_allocate() could be cleaned up to avoid runtime calls to strlen() since the local variable can only have literal values, so there's no benefit to trying to fortify the strlen call site there. Perform a __builtin_constant_p() check against index 0 earlier in the macro to filter out the control-flow-dependant case. Add a KUnit test for checking the expected behavioral characteristics of FORTIFY_SOURCE internals. Cc: Nathan Chancellor Cc: Tom Rix Cc: Andrew Morton Cc: Vlastimil Babka Cc: "Steven Rostedt (Google)" Cc: David Gow Cc: Yury Norov Cc: Masami Hiramatsu Cc: Sander Vanheule Cc: linux-hardening@vger.kernel.org Cc: llvm@lists.linux.dev Reviewed-by: Nick Desaulniers Tested-by: Android Treehugger Robot Link: https://android-review.googlesource.com/c/kernel/common/+/2206839 Co-developed-by: Nick Desaulniers Signed-off-by: Nick Desaulniers Signed-off-by: Kees Cook commit dfbafa70bde26c40615f8c538ce68dac82a64fb4 Author: Kees Cook Date: Fri Aug 26 11:04:43 2022 -0700 string: Introduce strtomem() and strtomem_pad() One of the "legitimate" uses of strncpy() is copying a NUL-terminated string into a fixed-size non-NUL-terminated character array. To avoid the weaknesses and ambiguity of intent when using strncpy(), provide replacement functions that explicitly distinguish between trailing padding and not, and require the destination buffer size be discoverable by the compiler. For example: struct obj { int foo; char small[4] __nonstring; char big[8] __nonstring; int bar; }; struct obj p; /* This will truncate to 4 chars with no trailing NUL */ strncpy(p.small, "hello", sizeof(p.small)); /* p.small contains 'h', 'e', 'l', 'l' */ /* This will NUL pad to 8 chars. */ strncpy(p.big, "hello", sizeof(p.big)); /* p.big contains 'h', 'e', 'l', 'l', 'o', '\0', '\0', '\0' */ When the "__nonstring" attributes are missing, the intent of the programmer becomes ambiguous for whether the lack of a trailing NUL in the p.small copy is a bug. Additionally, it's not clear whether the trailing padding in the p.big copy is _needed_. Both cases become unambiguous with: strtomem(p.small, "hello"); strtomem_pad(p.big, "hello", 0); See also https://github.com/KSPP/linux/issues/90 Expand the memcpy KUnit tests to include these functions. Cc: Wolfram Sang Cc: Nick Desaulniers Cc: Geert Uytterhoeven Cc: Guenter Roeck Signed-off-by: Kees Cook commit 779742255cb464e9e833fed2a8d352eb12936dae Author: Kees Cook Date: Wed Aug 31 11:09:13 2022 -0700 overflow: Split up kunit tests for smaller stack frames Under some pathological 32-bit configs, the shift overflow KUnit tests create huge stack frames. Split up the function to avoid this, separating by rough shift overflow cases. Cc: Rasmus Villemoes Cc: Daniel Latypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: Nick Desaulniers Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202208301850.iuv9VwA8-lkp@intel.com Acked-by: Daniel Latypov Signed-off-by: Kees Cook commit d219d2a9a92e39aa92799efe8f2aa21259b6dd82 Author: Kees Cook Date: Mon Aug 29 13:37:17 2022 -0700 overflow: Allow mixed type arguments When the check_[op]_overflow() helpers were introduced, all arguments were required to be the same type to make the fallback macros simpler. However, now that the fallback macros have been removed[1], it is fine to allow mixed types, which makes using the helpers much more useful, as they can be used to test for type-based overflows (e.g. adding two large ints but storing into a u8), as would be handy in the drm core[2]. Remove the restriction, and add additional self-tests that exercise some of the mixed-type overflow cases, and double-check for accidental macro side-effects. [1] https://git.kernel.org/linus/4eb6bd55cfb22ffc20652732340c4962f3ac9a91 [2] https://lore.kernel.org/lkml/20220824084514.2261614-2-gwan-gyeong.mun@intel.com Cc: Rasmus Villemoes Cc: Gwan-gyeong Mun Cc: "Gustavo A. R. Silva" Cc: Nick Desaulniers Cc: linux-hardening@vger.kernel.org Reviewed-by: Andrzej Hajda Reviewed-by: Gwan-gyeong Mun Tested-by: Gwan-gyeong Mun Signed-off-by: Kees Cook commit a060848b988347e5a4c48cbf99a6f50cd1410d98 Author: Li Yang Date: Wed Aug 17 15:56:22 2022 -0500 dt-bindings: i2c: imx: add SoC specific compatible strings for layerscape Add chip specific compatible strings for layerscape platforms to make it possible to do SoC specific fix-ups in the driver. Signed-off-by: Li Yang Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit cee3e5839cedcc71be755580dc9c0b87fd129116 Author: Lad Prabhakar Date: Wed Aug 31 22:35:36 2022 +0100 dt-bindings: display: bridge: renesas,dw-hdmi: Add resets property The DWC HDMI blocks on R-Car and RZ/G2 SoC's use resets, so to complete the bindings include resets property. This also fixes the below warning when running dtbs_check: arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n-rev2-ex-idk-1110wr.dtb: hdmi@fead0000: Unevaluated properties are not allowed ('resets' was unexpected) From schema: Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.yaml While at it mark resets property as required as all the DT sources in the kernel specify resets and update the example node. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart Acked-by: Krzysztof Kozlowski Signed-off-by: Laurent Pinchart commit 603c8e130d06fc70e84c9704d74c69f098975453 Author: Tomi Valkeinen Date: Wed Aug 24 15:47:26 2022 +0300 drm: rcar-du: dsi: Fix VCLKSET write rcar_mipi_dsi_startup() writes correct values to VCLKSET, but as it uses or-operation to add the new values to the current value in the register, it should first make sure the fields are cleared. Do this by using rcar_mipi_dsi_write() to write the VCLKSET register with a variable that has all the unused bits zeroed. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 957fe62d7d15f43d49e8cbacafaff8ede7d6cb30 Author: Tomi Valkeinen Date: Wed Aug 24 15:47:25 2022 +0300 drm: rcar-du: Fix DSI enable & disable sequence The rcar crtc depends on the clock provided from the rcar DSI bridge. When the DSI bridge is disabled, the clock is stopped, which causes the crtc disable to timeout. Also, while I have no issue with the enable, the documentation suggests to enable the DSI before the crtc so that the crtc has its clock enabled at enable time. This is also not done by the current driver. To fix this, we need to keep the DSI bridge enabled until the crtc has disabled itself, and enable the DSI bridge before crtc enables itself. Add functions rcar_mipi_dsi_pclk_enable and rcar_mipi_dsi_pclk_disable to the rcar DSI bridge driver which the rcar driver can use to enable/disable the DSI clock when needed. This is similar to what is already done with the rcar LVDS bridge. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 222abba69c620875c60b20cf77356f260d360ac8 Author: Tomi Valkeinen Date: Wed Aug 24 15:47:24 2022 +0300 drm: rcar-du: dsi: Improve DSI shutdown Improve the DSI shutdown procedure by clearing various bits that were set while enabling the DSI output. There has been no clear issues caused by these, but it's safer to ensure that the features are disabled at the start of the next DSI enable. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit dbf88d033183cb31a901f602c704408a009a40f6 Author: Tomi Valkeinen Date: Wed Aug 24 15:47:23 2022 +0300 drm: rcar-du: dsi: Properly stop video mode TX The driver does not explicitly stop the video mode transmission when disabling the output. While this doesn't seem to be causing any issues, lets follow the steps described in the documentation and add a rcar_mipi_dsi_stop_video() which stop the video mode transmission. This function will also be used in later patches to stop the video transmission even if the DSI IP is not shut down. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit cb90d90ca74b5c91d7b624a0805ddb5041bf4dfc Author: Tomi Valkeinen Date: Wed Aug 24 15:47:22 2022 +0300 drm: rcar-du: lvds: Rename pclk enable/disable functions The DU driver uses the rcar_lvds_clk_enable() and rcar_lvds_clk_disable() functions enable or disable the pixel clock generated by the LVDS encoder, as it requires that clock for proper DU operation. Rename the functions by replacing "clk" with "pclk" to make it clearer that they related to the pixel clock. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit ef5be86cbfd5250c053c649a56e05faa8b08084d Author: Biju Das Date: Thu Aug 25 11:39:05 2022 +0100 drm: rcar-du: Use %p4cc to print 4CC format Use the %p4cc format specifier to print 4CCs, which will provide a more readable message than the raw hex value. Reported-by: Geert Uytterhoeven Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit c218dd98d754c2d7129e63e0ee9c327ae599d0b3 Author: Biju Das Date: Thu Aug 25 11:39:04 2022 +0100 drm: rcar-du: Drop unused encoder header files Drop unused header files from rcar_du_encoder.c Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit b3c0b3105d9f5cd0632faac1af4da1201eb15d82 Author: Laurent Pinchart Date: Sat Aug 27 03:10:37 2022 +0300 drm: rcar-du: Drop leftovers variables from Makefile Commit 841281fe52a7 ("drm: rcar-du: Drop LVDS device tree backward compatibility") has removed device tree overlay sources used for backward compatibility with old bindings, but forgot to remove related variables from the Makefile. Fix it. Fixes: 841281fe52a7 ("drm: rcar-du: Drop LVDS device tree backward compatibility") Signed-off-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham commit 6d8277cfda96c7dd17a43f645858d2d39a7a4a20 Author: Tomi Valkeinen Date: Wed Aug 17 16:28:02 2022 +0300 drm: rcar-du: Fix r8a779a0 color issue The rcar DU driver on r8a779a0 has a bug causing some specific colors getting converted to transparent colors, which then (usually) show as black pixels on the screen. The reason seems to be that the driver sets PnMR_SPIM_ALP bit in PnMR.SPIM field, which is an illegal setting on r8a779a0. The PnMR_SPIM_EOR bit also illegal. Add a new feature flag for this (lack of a) feature and make sure the bits are zero on r8a779a0. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 48d43c4f3f55f4599c294007644184fdce44dafe Author: Tomi Valkeinen Date: Wed Aug 17 16:28:01 2022 +0300 drm: rcar-du: Remove unnecessary include rcar_du_regs.h is not needed by rcar_du_drv.c so drop the include. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 0a58c9b11b7958a1c9a2d804c5b45f9ab33609e4 Author: Takanari Hayama Date: Wed Aug 10 17:37:11 2022 +0900 drm: rcar-du: Add DRM_MODE_BLEND_PIXEL_NONE support DRM_MODE_BLEND_PIXEL_NONE ignores an alpha channel. Rcar-du driver supports only 3 formats with an alpha channel (DRM_FORMAT_ARGB1555, DRM_FORMAT_ARGB8888 and DRM_FORMAT_ARGB4444). We simply override the format passed to VSP1 for blending with the pixel format without alpha channel. Suggested-by: Laurent Pinchart Signed-off-by: Takanari Hayama Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit b07f5a4d4457a047104315190930a06fc5f26391 Author: Takanari Hayama Date: Wed Aug 10 17:37:10 2022 +0900 drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support R-Car DU driver implicitly supports DRM_MODE_BLEND_COVERAGE only. This adds a support for DRM_MODE_BLEND_PREMULTI. As a consequence, DRM_MODE_BLEND_PREMULTI becomes the default. If DRM_MODE_BLEND_COVERAGE is desired, it should be set explicitly. This behavior comes from how DRM blend mode is supported. drm_plane_create_blend_mode_property() creates the blend mode property with the default value of DRM_MODE_BLEND_PREMULTI. This default value cannot be modified from the atomic driver. Signed-off-by: Takanari Hayama Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit 0efb6fd36644a4ba743e26ea7ac532a9d539a3ee Author: Takanari Hayama Date: Wed Aug 10 17:37:09 2022 +0900 media: vsp1: Add premultiplied alpha support To support DRM blend mode in R-Car DU driver, we must be able to pass a plane with the premultiplied alpha. Adding a new property to vsp1_du_atomic_config allows the R-Car DU driver to pass the premultiplied alpha plane. Signed-off-by: Takanari Hayama Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Reviewed-by: Mauro Carvalho Chehab commit d7e8c4101647104cab1372028fa8515bf2ee1865 Author: Andrew Davis Date: Thu Sep 1 12:10:41 2022 -0500 dt-bindings: rng: omap_rng: Drop requirement for clocks For K3 devices the clock fed into the RNG module is shared with the rest of the Crypto module, it is not dedicated to the RNG module and cannot be controlled by the RNG driver. The driver does not require this clock to always be defined and the DT binding should not force it either. Remove this so we can start dropping out the clock properties as needed. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20220901171041.32056-1-afd@ti.com Signed-off-by: Rob Herring commit 0799617f3809d9f096fa18942391ef98ebb023b7 Author: Bastien Nocera Date: Tue Aug 30 15:25:49 2022 +0200 HID: logitech-hidpp: Remove hard-coded "Sw. Id." for HID++ 2.0 commands Some HID++ 2.0 commands had correctly set a non-zero software identifier directly as part of their function identifiers, but it's more correct to define the function identifier and the software identifier separately before combined them when the command is sent. As this is now done in the previous commit, remove the hard-coded 0x1 software identifiers in the function definitions. Signed-off-by: Bastien Nocera Signed-off-by: Jiri Kosina commit f7b7393cc3b04e288de85790b1c8e62af99799c2 Author: Bastien Nocera Date: Tue Aug 30 15:25:48 2022 +0200 HID: logitech-hidpp: Fix "Sw. Id." for HID++ 2.0 commands Always set a non-zero "Sw. Id." in the lower nibble of the Function/ASE and Software Identifier byte in HID++ 2.0 commands. As per the "Protocol HID++2.0 essential features" section in https://lekensteyn.nl/files/logitech/logitech_hidpp_2.0_specification_draft_2012-06-04.pdf " Software identifier (4 bits, unsigned) A number uniquely defining the software that sends a request. The firmware must copy the software identifier in the response but does not use it in any other ways. 0 Do not use (allows to distinguish a notification from a response). " Link: https://bugzilla.kernel.org/show_bug.cgi?id=215699 Signed-off-by: Bastien Nocera Signed-off-by: Jiri Kosina commit 8544c812e43ab7bdf40458411b83987b8cba924d Author: Bastien Nocera Date: Tue Aug 30 15:25:47 2022 +0200 HID: logitech-hidpp: Remove special-casing of Bluetooth devices Now that all the Logitech Bluetooth devices are probed for HID++ support, remove the handling of those 2 devices without any quirks, as they're duplicates. Signed-off-by: Bastien Nocera Signed-off-by: Jiri Kosina commit 532223c8ac57605a10e46dc0ab23dcf01c9acb43 Author: Bastien Nocera Date: Tue Aug 30 15:25:46 2022 +0200 HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices Probe for HID++ support over Bluetooth for all the Logitech Bluetooth devices. As Logitech doesn't have a list of Bluetooth devices that support HID++ over Bluetooth, probe every device. The HID++ driver will fall back to plain HID if the device does not support HID++, or to a another device-specific driver if it is part of the unhandled_hidpp_devices array, used in the match function. Note that this change might cause upower to export 2 batteries for certain Bluetooth LE devices which export their battery information through the Bluetooth BATT profile. This particular bug is tracked at: https://gitlab.freedesktop.org/upower/upower/-/issues/166 Tested with a Logitech Signature M650 mouse, over Bluetooth Signed-off-by: Bastien Nocera Signed-off-by: Jiri Kosina commit 80305f97c3a46f8e01c9974b8efc7619a422251c Author: Bastien Nocera Date: Tue Aug 30 15:25:45 2022 +0200 HID: core: Export hid_match_id() Export hid_match_id() so it can be used in device-specific drivers to implement their own matching with open-coding a match function. Signed-off-by: Bastien Nocera Signed-off-by: Jiri Kosina commit d2601193056ad9bc0dad1770b9cc492769d02777 Author: Samuel Holland Date: Mon Aug 29 21:08:22 2022 -0500 dt-bindings: i2c: mv64xxx: Document DMA properties Allwinner's I2C offload engine includes bidirectional DMA support. Add the properties for describing this in the devicetree. "dmas" is optional because not all instances of the controller have their DRQs hooked up. For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned. Signed-off-by: Samuel Holland Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit e46a1c553223f04c2c19951ba58beddc596ce154 Author: Krzysztof Kozlowski Date: Thu Sep 1 10:42:18 2022 +0300 dt-bindings: i2c: qcom,i2c-cci: specify SM8450 CCI clocks Document clocks for SM8450 Camera Control Interface I2C controller. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Vladimir Zapolskiy Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit fae9ebde9696385fa2e993e752cf68d9781f3ea0 Author: Kan Liang Date: Thu Aug 4 07:07:29 2022 -0700 perf/x86/intel: Optimize FIXED_CTR_CTRL access All the fixed counters share a fixed control register. The current perf reads and re-writes the fixed control register for each fixed counter disable/enable, which is unnecessary. When changing the fixed control register, the entire PMU must be disabled via the global control register. The changing cannot be taken effect until the entire PMU is re-enabled. Only updating the fixed control register once right before the entire PMU re-enabling is enough. The read of the fixed control register is not necessary either. The value can be cached in the per CPU cpu_hw_events. Test results: Counting all the fixed counters with the perf bench sched pipe as below on a SPR machine. $perf stat -e cycles,instructions,ref-cycles,slots --no-inherit -- taskset -c 1 perf bench sched pipe The Total elapsed time reduces from 5.36s (without the patch) to 4.99s (with the patch), which is ~6.9% improvement. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220804140729.2951259-1-kan.liang@linux.intel.com commit dbf4e792beadafc684ef455453c613ff182c7723 Author: Peter Zijlstra Date: Fri May 20 15:38:43 2022 +0200 perf/x86/p4: Remove perfctr_second_write quirk Now that we have a x86_pmu::set_period() method, use it to remove the perfctr_second_write quirk from the generic code. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.839502514@infradead.org commit 1acab2e01c9c5df00f2fddf3473014dea89dcb5f Author: Peter Zijlstra Date: Wed May 11 17:02:05 2022 +0200 perf/x86/intel: Remove x86_pmu::update_topdown_event Now that it is all internal to the intel driver, remove x86_pmu::update_topdown_event. Assumes that is_topdown_count(event) can only be true when the hardware has topdown stuff and the function is set. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.771635301@infradead.org commit 2368516731901c391826f7cf23516173193652fa Author: Peter Zijlstra Date: Wed May 11 16:41:25 2022 +0200 perf/x86/intel: Remove x86_pmu::set_topdown_event_period Now that it is all internal to the intel driver, remove x86_pmu::set_topdown_event_period. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.706354189@infradead.org commit 08b3068fab207e3c7d79799d434e1d648524cac6 Author: Peter Zijlstra Date: Tue May 10 21:28:18 2022 +0200 perf/x86: Add a x86_pmu::limit_period static_call Avoid a branch and indirect call. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.640658334@infradead.org commit 28f0f3c44b5c35be657a4f922dcdfb48285f4373 Author: Peter Zijlstra Date: Tue May 10 21:28:25 2022 +0200 perf/x86: Change x86_pmu::limit_period signature In preparation for making it a static_call, change the signature. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.573713839@infradead.org commit e577bb17a1eaa35b86ee873a786e603be768d668 Author: Peter Zijlstra Date: Tue May 10 21:28:06 2022 +0200 perf/x86/intel: Move the topdown stuff into the intel driver Use the new x86_pmu::{set_period,update}() methods to push the topdown stuff into the Intel driver, where it belongs. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.505933457@infradead.org commit 73759c346341d39dfde39701476c0376dea0a98b Author: Peter Zijlstra Date: Tue May 10 21:27:22 2022 +0200 perf/x86: Add two more x86_pmu methods In order to clean up x86_perf_event_{set_period,update)() start by adding them as x86_pmu methods. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220829101321.440196408@infradead.org commit f3c0eba287049237b23d1300376768293eb89e69 Author: Peter Zijlstra Date: Fri Sep 2 18:48:55 2022 +0200 perf: Add a few assertions While auditing 6b959ba22d34 ("perf/core: Fix reentry problem in perf_output_read_group()") a few spots were found that wanted assertions. Notable for_each_sibling_event() relies on exclusion from modification. This would normally be holding either ctx->lock or ctx->mutex, however due to how things are constructed disabling IRQs is a valid and sufficient substitute for ctx->lock. Another possible site to add assertions would be the various pmu::{add,del,read,..}() methods, but that's not trivially expressable in C -- the best option is wrappers, but those are easy enough to forget. Signed-off-by: Peter Zijlstra (Intel) commit 88081cfb699ce2568e5309c145eb9f9e9497b53f Author: Anshuman Khandual Date: Wed Sep 7 14:49:24 2022 +0530 x86/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220907091924.439193-5-anshuman.khandual@arm.com commit 91207f62616f9f51b52436364e6d064f002e9112 Author: Anshuman Khandual Date: Wed Sep 7 14:49:23 2022 +0530 arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220907091924.439193-4-anshuman.khandual@arm.com commit f67dd218fafd9de9a13d095e775b621db76a058f Author: Anshuman Khandual Date: Wed Sep 7 14:49:22 2022 +0530 perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags This just ensures that PERF_EVENT_FLAG_ARCH does not overlap with generic hardware event flags. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220907091924.439193-3-anshuman.khandual@arm.com commit 7517f08b9a5eef0fa683b976c97d6178d00e6a3d Author: Anshuman Khandual Date: Wed Sep 7 14:49:21 2022 +0530 perf/core: Expand PERF_EVENT_FLAG_ARCH Two hardware event flags on x86 platform has overshot PERF_EVENT_FLAG_ARCH (0x0000ffff). These flags are PERF_X86_EVENT_PEBS_LAT_HYBRID (0x20000) and PERF_X86_EVENT_AMD_BRS (0x10000). Lets expand PERF_EVENT_FLAG_ARCH mask to accommodate those flags, and also create room for two more in the future. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220907091924.439193-2-anshuman.khandual@arm.com commit 03b02db93be407103c385814033633364674a6f6 Author: Anshuman Khandual Date: Tue Sep 6 14:14:14 2022 +0530 perf: Consolidate branch sample filter helpers Besides the branch type filtering requests, 'event.attr.branch_sample_type' also contains various flags indicating which additional information should be captured, along with the base branch record. These flags help configure the underlying hardware, and capture the branch records appropriately when required e.g after PMU interrupt. But first, this moves an existing helper perf_sample_save_hw_index() into the header before adding some more helpers for other branch sample filter flags. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220906084414.396220-1-anshuman.khandual@arm.com commit fb04563d1cae6f361892b4a339ad92100b1eb0d0 Author: Peter Zijlstra Date: Tue Sep 6 13:27:32 2022 +0200 sched: Show PF_flag holes Put placeholders in PF_flag so we can see how holey it is. Suggested-by: Ingo Molnar Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ingo Molnar Link: https://lkml.kernel.org/r/YxctoffFFPXONESt@hirez.programming.kicks-ass.net commit f5d39b020809146cc28e6e73369bf8065e0310aa Author: Peter Zijlstra Date: Mon Aug 22 13:18:22 2022 +0200 freezer,sched: Rewrite core freezer logic Rewrite the core freezer to behave better wrt thawing and be simpler in general. By replacing PF_FROZEN with TASK_FROZEN, a special block state, it is ensured frozen tasks stay frozen until thawed and don't randomly wake up early, as is currently possible. As such, it does away with PF_FROZEN and PF_FREEZER_SKIP, freeing up two PF_flags (yay!). Specifically; the current scheme works a little like: freezer_do_not_count(); schedule(); freezer_count(); And either the task is blocked, or it lands in try_to_freezer() through freezer_count(). Now, when it is blocked, the freezer considers it frozen and continues. However, on thawing, once pm_freezing is cleared, freezer_count() stops working, and any random/spurious wakeup will let a task run before its time. That is, thawing tries to thaw things in explicit order; kernel threads and workqueues before doing bringing SMP back before userspace etc.. However due to the above mentioned races it is entirely possible for userspace tasks to thaw (by accident) before SMP is back. This can be a fatal problem in asymmetric ISA architectures (eg ARMv9) where the userspace task requires a special CPU to run. As said; replace this with a special task state TASK_FROZEN and add the following state transitions: TASK_FREEZABLE -> TASK_FROZEN __TASK_STOPPED -> TASK_FROZEN __TASK_TRACED -> TASK_FROZEN The new TASK_FREEZABLE can be set on any state part of TASK_NORMAL (IOW. TASK_INTERRUPTIBLE and TASK_UNINTERRUPTIBLE) -- any such state is already required to deal with spurious wakeups and the freezer causes one such when thawing the task (since the original state is lost). The special __TASK_{STOPPED,TRACED} states *can* be restored since their canonical state is in ->jobctl. With this, frozen tasks need an explicit TASK_FROZEN wakeup and are free of undue (early / spurious) wakeups. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ingo Molnar Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220822114649.055452969@infradead.org commit 9963e444f71e671bcbc30d61cf23a2c686ac7d05 Author: Peter Zijlstra Date: Tue Sep 6 13:11:38 2022 +0200 sched: Widen TAKS_state literals In preparation of adding more states, add a few 0s to the literals as we've just about ran out. Suggested-by: Ingo Molnar Signed-off-by: Peter Zijlstra (Intel) commit 3f884a10ab41efe2d495bf8ec8d443d70c500a60 Author: Peter Zijlstra Date: Mon Aug 22 13:18:21 2022 +0200 sched/wait: Add wait_event_state() Allows waiting with a custom @state. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ingo Molnar Link: https://lore.kernel.org/r/20220822114648.989212021@infradead.org commit 929659acea03db6411a32de9037abab9f856f586 Author: Peter Zijlstra Date: Mon Aug 22 13:18:20 2022 +0200 sched/completion: Add wait_for_completion_state() Allows waiting with a custom @state. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ingo Molnar Link: https://lore.kernel.org/r/20220822114648.922711674@infradead.org commit f9fc8cad9728124cefe8844fb53d1814c92c6bfc Author: Peter Zijlstra Date: Tue Sep 6 12:39:55 2022 +0200 sched: Add TASK_ANY for wait_task_inactive() Now that wait_task_inactive()'s @match_state argument is a mask (like ttwu()) it is possible to replace the special !match_state case with an 'all-states' value such that any blocked state will match. Suggested-by: Ingo Molnar (mingo@kernel.org> Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YxhkzfuFTvRnpUaH@hirez.programming.kicks-ass.net commit 9204a97f7ae862fc8a3330ec8335917534c3fb63 Author: Peter Zijlstra Date: Mon Aug 22 13:18:19 2022 +0200 sched: Change wait_task_inactive()s match_state Make wait_task_inactive()'s @match_state work like ttwu()'s @state. That is, instead of an equal comparison, use it as a mask. This allows matching multiple block conditions. (removes the unlikely; it doesn't make sense how it's only part of the condition) Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220822114648.856734578@infradead.org commit 1fbcaa923ce2d7e6de17abd74fa076dc1e0be1a2 Author: Peter Zijlstra Date: Mon Aug 22 13:18:18 2022 +0200 freezer,umh: Clean up freezer/initrd interaction handle_initrd() marks itself as PF_FREEZER_SKIP in order to ensure that the UMH, which is going to freeze the system, doesn't indefinitely wait for it's caller. Rework things by adding UMH_FREEZABLE to indicate the completion is freezable. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220822114648.791019324@infradead.org commit 5950e5d574c636a07dd21a872c2f8b41f6d20c55 Author: Peter Zijlstra Date: Mon Aug 22 13:18:17 2022 +0200 freezer: Have {,un}lock_system_sleep() save/restore flags Rafael explained that the reason for having both PF_NOFREEZE and PF_FREEZER_SKIP is that {,un}lock_system_sleep() is callable from kthread context that has previously called set_freezable(). In preparation of merging the flags, have {,un}lock_system_slee() save and restore current->flags. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220822114648.725003428@infradead.org commit 0b9d46fc5ef7a457cc635b30b010081228cb81ac Author: Peter Zijlstra Date: Tue Sep 6 12:33:04 2022 +0200 sched: Rename task_running() to task_on_cpu() There is some ambiguity about task_running() in that it is unrelated to TASK_RUNNING but instead tests ->on_cpu. As such, rename the thing task_on_cpu(). Suggested-by: Ingo Molnar Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Yxhkhn55uHZx+NGl@hirez.programming.kicks-ass.net commit 96c1c0cfe493a7ed549169a6f044bbb83e490fb5 Author: Abel Wu Date: Wed Sep 7 19:20:00 2022 +0800 sched/fair: Cleanup for SIS_PROP The sched-domain of this cpu is only used for some heuristics when SIS_PROP is enabled, and it should be irrelevant whether the local sd_llc is valid or not, since all we care about is target sd_llc if !SIS_PROP. Access the local domain only when there is a need. Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20220907112000.1854-6-wuyun.abel@bytedance.com commit 398ba2b0cc0a43964fe3d2dd19cb2a478f1f220b Author: Abel Wu Date: Wed Sep 7 19:19:59 2022 +0800 sched/fair: Default to false in test_idle_cores() It's uncertain whether idle cores exist or not if shared sched- domains are not ready, so returning "no idle cores" usually makes sense. While __update_idle_core() is an exception, it checks status of this core and set hint to shared sched-domain if necessary. So the whole logic of this function depends on the existence of shared sched-domain, and can certainly bail out early if it is not available. It's somehow a little tricky, and as Josh suggested that it should be transient while the domain isn't ready. So remove the self-defined default value to make things more clearer. Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Don Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20220907112000.1854-5-wuyun.abel@bytedance.com commit 8eeeed9c4a791f0d1f2ea830eb75a4246c117ae2 Author: Abel Wu Date: Wed Sep 7 19:19:58 2022 +0800 sched/fair: Remove useless check in select_idle_core() The function select_idle_core() only gets called when has_idle_cores is true which can be possible only when sched_smt_present is enabled. This change also aligns select_idle_core() with select_idle_smt() in the way that the caller do the check if necessary. Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20220907112000.1854-4-wuyun.abel@bytedance.com commit b9bae70440d21e106fbc098803b5a190df65f2e0 Author: Abel Wu Date: Wed Sep 7 19:19:57 2022 +0800 sched/fair: Avoid double search on same cpu The prev cpu is checked at the beginning of SIS, and it's unlikely to be idle before the second check in select_idle_smt(). So we'd better focus on its SMT siblings. Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Don Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20220907112000.1854-3-wuyun.abel@bytedance.com commit 3e6efe87cd5ccabf0f1d4e3ef25881ca0fd337e7 Author: Abel Wu Date: Wed Sep 7 19:19:56 2022 +0800 sched/fair: Remove redundant check in select_idle_smt() If two cpus share LLC cache, then the two cores they belong to are also in the same LLC domain. Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Don Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20220907112000.1854-2-wuyun.abel@bytedance.com commit 14b9397240980a223d469f8c9bca92d45c78cdc5 Author: Sudarshan Ravula Date: Wed Sep 7 21:39:20 2022 +0530 i2c: designware: Add support to get I2C related timing parameters from firmware. Similar to I2C designware platform driver add i2c_parse_fw_timings() in PCI driver, to get I2C related timing parameters from firmware. Signed-off-by: Sudarshan Ravula Acked-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit cc48755808c646666436745b35629c3f0d05e165 Author: Kumar Kartikeya Dwivedi Date: Sun Sep 4 22:41:16 2022 +0200 bpf: Add zero_map_value to zero map value with special fields We need this helper to skip over special fields (bpf_spin_lock, bpf_timer, kptrs) while zeroing a map value. Use the same logic as copy_map_value but memset instead of memcpy. Currently, the code zeroing map value memory does not have to deal with special fields, hence this is a prerequisite for introducing such support. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220904204145.3089-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 6df4ea1ff0ff70798ff1e7eed79f98ccb7b5b0a2 Author: Kumar Kartikeya Dwivedi Date: Sun Sep 4 22:41:15 2022 +0200 bpf: Support kptrs in percpu arraymap Enable support for kptrs in percpu BPF arraymap by wiring up the freeing of these kptrs from percpu map elements. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220904204145.3089-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 448325199f574d33824dbf9121efb03558412966 Author: Kumar Kartikeya Dwivedi Date: Sun Sep 4 22:41:14 2022 +0200 bpf: Add copy_map_value_long to copy to remote percpu memory bpf_long_memcpy is used while copying to remote percpu regions from BPF syscall and helpers, so that the copy is atomic at word size granularity. This might not be possible when you copy from map value hosting kptrs from or to percpu maps, as the alignment or size in disjoint regions may not be multiple of word size. Hence, to avoid complicating the copy loop, we only use bpf_long_memcpy when special fields are not present, otherwise use normal memcpy to copy the disjoint regions. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220904204145.3089-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 9fad7fe5b29803584c7f17a2abe6c2936fec6828 Author: Jules Irenge Date: Wed Sep 7 16:24:20 2022 +0100 bpf: Fix resetting logic for unreferenced kptrs Sparse reported a warning at bpf_map_free_kptrs() "warning: Using plain integer as NULL pointer" During the process of fixing this warning, it was discovered that the current code erroneously writes to the pointer variable instead of deferencing and writing to the actual kptr. Hence, Sparse tool accidentally helped to uncover this problem. Fix this by doing WRITE_ONCE(*p, 0) instead of WRITE_ONCE(p, 0). Note that the effect of this bug is that unreferenced kptrs will not be cleared during check_and_free_fields. It is not a problem if the clearing is not done during map_free stage, as there is nothing to free for them. Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr") Signed-off-by: Jules Irenge Link: https://lore.kernel.org/r/Yxi3pJaK6UDjVJSy@playground Signed-off-by: Alexei Starovoitov commit e06f1c6022673245a68b22f72ba40250aaa7255e Author: Ville Syrjälä Date: Wed Sep 7 12:10:44 2022 +0300 drm/i915/dsi: Extract {vlv,bxt}_get_pclk() Extract the state->freq computation for VLV/BXT DSI PLL into small helpers. We want to use these during the state computation as well. Reviewed-by: Mika Kahola Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-5-ville.syrjala@linux.intel.com commit 9988db59b1d000c6ac7e91144f550603626593a4 Author: Ville Syrjälä Date: Wed Sep 7 12:10:43 2022 +0300 drm/i915: Extract HAS_DOUBLE_BUFFERED_M_N() We have a couple of places that want to make distinction between double buffered M/N registers vs. the split M1/N1+M2/N2 registers. Add a helper for that. v2: Turn into a HAS_ macro (Jani) Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-4-ville.syrjala@linux.intel.com commit c61ede87b08c56cead5814ef92f0d5eda9759f0c Author: Ville Syrjälä Date: Wed Sep 7 12:10:42 2022 +0300 drm/i915: Shuffle some PLL code around Shuffle some PLL functions around a bit to avoid ugle forward declarations later on. No functional changes. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-3-ville.syrjala@linux.intel.com commit 340b515c1b172e43ea47d5f823f876307854b46a Author: Ville Syrjälä Date: Wed Sep 7 12:10:41 2022 +0300 drm/i915: Relocate intel_crtc_dotclock() intel_crtc_dotclock() is a bit misplaced. In lieu of a better place let's just move it next to its friends in intel_display.c. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-2-ville.syrjala@linux.intel.com commit 53e80a39ff9fc61651e0d3f7614af5d47c5bd1fe Merge: 028a9642217e0 22ed8d5a46520 Author: Alexei Starovoitov Date: Wed Sep 7 10:57:29 2022 -0700 Merge branch 'bpf-core changes for preparation of HID-bpf' Benjamin Tissoires says: ==================== Hi, well, given that the HID changes haven't moved a lot in the past revisions and that I am cc-ing a bunch of people, I have dropped them while we focus on the last 2 requirements in bpf-core changes. I'll submit a HID targeted series when we get these in tree, which would make things a lore more independent. For reference, the whole reasons for these 2 main changes are at https://lore.kernel.org/bpf/20220902132938.2409206-1-benjamin.tissoires@redhat.com/ Compared to v10 (in addition of dropping the HID changes), I have changed the selftests so we can test both light skeletons and libbbpf calls. Cheers, Benjamin ==================== Signed-off-by: Alexei Starovoitov commit 22ed8d5a46520ef0f060e7c0ee91f1cc6f684400 Author: Benjamin Tissoires Date: Tue Sep 6 17:13:03 2022 +0200 selftests/bpf: Add tests for kfunc returning a memory pointer We add 2 new kfuncs that are following the RET_PTR_TO_MEM capability from the previous commit. Then we test them in selftests: the first tests are testing valid case, and are not failing, and the later ones are actually preventing the program to be loaded because they are wrong. To work around that, we mark the failing ones as not autoloaded (with SEC("?tc")), and we manually enable them one by one, ensuring the verifier rejects them. Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220906151303.2780789-8-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit eb1f7f71c126c8fd50ea81af98f97c4b581ea4ae Author: Benjamin Tissoires Date: Tue Sep 6 17:13:02 2022 +0200 bpf/verifier: allow kfunc to return an allocated mem For drivers (outside of network), the incoming data is not statically defined in a struct. Most of the time the data buffer is kzalloc-ed and thus we can not rely on eBPF and BTF to explore the data. This commit allows to return an arbitrary memory, previously allocated by the driver. An interesting extra point is that the kfunc can mark the exported memory region as read only or read/write. So, when a kfunc is not returning a pointer to a struct but to a plain type, we can consider it is a valid allocated memory assuming that: - one of the arguments is either called rdonly_buf_size or rdwr_buf_size - and this argument is a const from the caller point of view We can then use this parameter as the size of the allocated memory. The memory is either read-only or read-write based on the name of the size parameter. Acked-by: Kumar Kartikeya Dwivedi Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220906151303.2780789-7-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit f9b348185f4d684cc19e6bd9b87904823d5aa5ed Author: Benjamin Tissoires Date: Tue Sep 6 17:13:01 2022 +0200 bpf/btf: bump BTF_KFUNC_SET_MAX_CNT net/bpf/test_run.c is already presenting 20 kfuncs. net/netfilter/nf_conntrack_bpf.c is also presenting an extra 10 kfuncs. Given that all the kfuncs are regrouped into one unique set, having only 2 space left prevent us to add more selftests. Bump it to 256. Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220906151303.2780789-6-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit fb66223a244f252273995557b23e0fa53092e92c Author: Benjamin Tissoires Date: Tue Sep 6 17:13:00 2022 +0200 selftests/bpf: add test for accessing ctx from syscall program type We need to also export the kfunc set to the syscall program type, and then add a couple of eBPF programs that are testing those calls. The first one checks for valid access, and the second one is OK from a static analysis point of view but fails at run time because we are trying to access outside of the allocated memory. Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220906151303.2780789-5-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit 15baa55ff5b00b81bcd9874b89cb8e0b0daaa13d Author: Benjamin Tissoires Date: Tue Sep 6 17:12:59 2022 +0200 bpf/verifier: allow all functions to read user provided context When a function was trying to access data from context in a syscall eBPF program, the verifier was rejecting the call unless it was accessing the first element. This is because the syscall context is not known at compile time, and so we need to check this when actually accessing it. Check for the valid memory access if there is no convert_ctx callback, and allow such situation to happen. Acked-by: Kumar Kartikeya Dwivedi Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220906151303.2780789-4-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit 348a2e8c93d3ca622cf1b293cd2f597c9db74d9d Author: Prashant Malani Date: Tue Aug 30 20:20:18 2022 +0000 platform/chrome: cros_ec_typec: Register partner PDOs The ChromeOS EC exports partner source/sink cap PDOs (Power Data Objects) to the application processor (AP). Use this information to register USB PD (Power Delivery) capabilities with the USB Type-C Power Delivery device class. Cc: Heikki Krogerus Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220830202018.1884851-1-pmalani@chromium.org [pmalani: Remove extra newline nit from original patch] commit 95f2f26f3cac06cfc046d2b29e60719d7848ea54 Author: Benjamin Tissoires Date: Tue Sep 6 17:12:58 2022 +0200 bpf: split btf_check_subprog_arg_match in two btf_check_subprog_arg_match() was used twice in verifier.c: - when checking for the type mismatches between a (sub)prog declaration and BTF - when checking the call of a subprog to see if the provided arguments are correct and valid This is problematic when we check if the first argument of a program (pointer to ctx) is correctly accessed: To be able to ensure we access a valid memory in the ctx, the verifier assumes the pointer to context is not null. This has the side effect of marking the program accessing the entire context, even if the context is never dereferenced. For example, by checking the context access with the current code, the following eBPF program would fail with -EINVAL if the ctx is set to null from the userspace: ``` SEC("syscall") int prog(struct my_ctx *args) { return 0; } ``` In that particular case, we do not want to actually check that the memory is correct while checking for the BTF validity, but we just want to ensure that the (sub)prog definition matches the BTF we have. So split btf_check_subprog_arg_match() in two so we can actually check for the memory used when in a call, and ignore that part when not. Note that a further patch is in preparation to disentangled btf_check_func_arg_match() from these two purposes, and so right now we just add a new hack around that by adding a boolean to this function. Signed-off-by: Benjamin Tissoires Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220906151303.2780789-3-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit 012ba1156e4a7b38062d109b818cb479a68c87ba Author: Benjamin Tissoires Date: Tue Sep 6 17:12:57 2022 +0200 selftests/bpf: regroup and declare similar kfuncs selftests in an array Similar to tools/testing/selftests/bpf/prog_tests/dynptr.c: we declare an array of tests that we run one by one in a for loop. Followup patches will add more similar-ish tests, so avoid a lot of copy paste by grouping the declaration in an array. For light skeletons, we have to rely on the offsetof() macro so we can statically declare which program we are using. In the libbpf case, we can rely on bpf_object__find_program_by_name(). So also change the Makefile to generate both light skeletons and normal ones. Signed-off-by: Benjamin Tissoires Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220906151303.2780789-2-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit 537addee1e8e843a00f6cb0f656af19655b13107 Author: Colin Ian King Date: Wed Sep 7 18:09:02 2022 +0100 kselftest/arm64: Fix spelling misakes of signal names There are a couple of spelling mistakes of signame names. Fix them. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220907170902.687340-1-colin.i.king@gmail.com Signed-off-by: Catalin Marinas commit 65332a5b9fbd5c72c0db009b17ef4304d4c242dd Author: John Harrison Date: Tue Sep 6 16:01:47 2022 -0700 drm/i915/uc: Add patch level version number support With the move to un-versioned filenames, it becomes more difficult to know exactly what version of a given firmware is being used. So add the patch level version number to the debugfs output. Also, support matching by patch level when selecting code paths for firmware compatibility. While a patch level change cannot be backwards breaking, it is potentially possible that a new feature only works from a given patch level onwards (even though it was theoretically added in an earlier version that bumped the major or minor version). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906230147.479945-2-daniele.ceraolospurio@intel.com commit 665ae9c9ca79bdfc83def0981e015e181ea463b7 Author: John Harrison Date: Tue Sep 6 16:01:46 2022 -0700 drm/i915/uc: Support for version reduced and multiple firmware files There was a misunderstanding in how firmware file compatibility should be managed within i915. This has been clarified as: i915 must support all existing firmware releases forever new minor firmware releases should replace prior versions only backwards compatibility breaking releases should be a new file This patch cleans up the single fallback file support that was added as a quick fix emergency effort. That is now removed in preference to supporting arbitrary numbers of firmware files per platform. The patch also adds support for having GuC firmware files that are named by major version only (because the major version indicates backwards breaking changes that affect the KMD) and for having HuC firmware files with no version number at all (because the KMD has no interface requirements with the HuC). For GuC, the driver will report via dmesg if the found file is older than expected. For HuC, the KMD will no longer require updating for any new HuC release so will not be able to report what the latest expected version is. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220906230147.479945-1-daniele.ceraolospurio@intel.com commit 4cac4de4b05f0a1d5920d12278bf8787011661d3 Author: Bhadram Varka Date: Thu Jul 7 09:48:17 2022 +0200 arm64: defconfig: Enable Tegra MGBE driver Enable the driver for the Multi-Gigabit Ethernet (MGBE) controller which can be found on NVIDIA Tegra234 SoCs. Signed-off-by: Bhadram Varka Signed-off-by: Thierry Reding commit 189c2e5c7669f0a4b81623cfdb11ea68c62cce0d Author: Bhadram Varka Date: Thu Jul 7 09:48:14 2022 +0200 dt-bindings: net: Add Tegra234 MGBE Add device-tree binding documentation for the Multi-Gigabit Ethernet (MGBE) controller found on NVIDIA Tegra234 SoCs. Signed-off-by: Jon Hunter Signed-off-by: Bhadram Varka Signed-off-by: Thierry Reding Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 27244cbda82787c9283ce79f5e7bea8ecaa58dff Author: Alexander Sverdlin Date: Wed Sep 7 14:16:29 2022 +0200 of: irq: Report individual failures in of_irq_init() New pr_err(), a copy of preceeding pr_debug(), faciliates debugging. This change was inspired by a long lasting debugging of the octeon_irq_init_ciu() which fails completely silently and leaves the interrupt controller half-way configured which in turn had very non-obvious effects. Signed-off-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20220907121629.54330-1-alexander.sverdlin@nokia.com Signed-off-by: Rob Herring commit ed18a9b140bc2e3728be9c18b97df07cdd0fe33a Author: Abel Vesa Date: Wed Sep 7 10:43:01 2022 +0300 dt-bindings: misc: fastrpc convert bindings to yaml Convert Qualcomm FastRPC bindings to yaml format, so that we could validate dt-entries correctly and any future additions can go into yaml format. Use compute-cb@ subnodes instead of just cb@. Add qcom,glink-channels and qcom,smd-channels missing properties to make sure dtbs_check doesn't fail right off the bat. Correct the name of the parent node in the example from smd-edge to glink-edge. Since now the qcom,fastrpc bindings document is yaml, update the reference to it in qcom,glink-edge and also use $ref. Also update the MAINTAINERS file to point to the yaml version. Co-developed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla Co-developed-by: David Heidelberg Signed-off-by: David Heidelberg Signed-off-by: Abel Vesa Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220907074301.3996021-1-abel.vesa@linaro.org Signed-off-by: Rob Herring commit c478bd88362418bd2a1c230215fde184f5642e44 Author: Jiapeng Chong Date: Wed Sep 7 12:01:12 2022 +0800 cgroup/cpuset: remove unreachable code The function sched_partition_show cannot execute seq_puts, delete the invalid code. kernel/cgroup/cpuset.c:2849 sched_partition_show() warn: ignoring unreachable code. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2087 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Tejun Heo commit 934f70d9d498a7fffd611edf48356698f1d72e91 Author: Xiu Jianfeng Date: Tue Sep 6 21:25:08 2022 +0800 audit: remove selinux_audit_rule_update() declaration selinux_audit_rule_update() has been renamed to audit_update_lsm_rules() since commit d7a96f3a1ae2 ("Audit: internally use the new LSM audit hooks"), so remove it. Signed-off-by: Xiu Jianfeng Signed-off-by: Paul Moore commit 418b0866ccdc302e8b46e7d3f6a788e8fe77a660 Merge: 2018b22a759e2 0f032f93c4ee9 Author: David S. Miller Date: Wed Sep 7 16:20:15 2022 +0100 Merge branch 'hns3-new-features' Guangbin Huang says: ==================== hns3: add some new features This series adds some new features for the HNS3 ethernet driver. Patches #1~#3 support configuring dscp map to tc. Patch 4# supports querying FEC statistics by command "ethtool -I --show-fec eth0". Patch 5# supports querying and setting Serdes lane number. Change logs: V1 -> V2: - fix build error of patch 1# reported by robot lkp@intel.com. ==================== Signed-off-by: David S. Miller commit 0f032f93c4ee9ff667b493db7b21c94cff31edc6 Author: Hao Chen Date: Tue Sep 6 17:12:23 2022 +0800 net: hns3: add support to query and set lane number by ethtool When serdes lane support setting 25Gb/s or 50Gb/s speed and user wants to set port speed as 50Gb/s, it can be setted as one 50Gb/s serdes lane or two 25Gb/s serdes lanes. So, this patch adds support to query and set lane number by ethtool to satisfy this scenario. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2cb343b9d3e59db0836045ff1dd67dfd15066697 Author: Hao Lan Date: Tue Sep 6 17:12:22 2022 +0800 net: hns3: add querying fec statistics FEC statistics can be used to check the transmission quality of links. This patch implements the get_fec_stats callback of ethtool_ops to support querying FEC statistics by command "ethtool -I --show-fec eth0". Signed-off-by: Hao Lan Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit fddc02eb583ada2b2d8f35ef41630da5959e8d4b Author: Guangbin Huang Date: Tue Sep 6 17:12:21 2022 +0800 net: hns3: debugfs add dump dscp map info This patch add dump the map relation for dscp, priority and TC, and the current tc map mode. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit f6e32724ca135239f404f2ed3cd2170dc4bd9b29 Author: Guangbin Huang Date: Tue Sep 6 17:12:20 2022 +0800 net: hns3: support ndo_select_queue() To support tx packets to select queue according to its dscp field after setting dscp and tc map relationship, this patch implements ndo_select_queue() to set skb->priority according to the user's setting dscp and priority map relationship. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0ba22bcb222d2761feccb46d0ee4eb9db1f53a7d Author: Guangbin Huang Date: Tue Sep 6 17:12:19 2022 +0800 net: hns3: add support config dscp map to tc This patch add support config dscp map to tc by implementing ieee_setapp and ieee_delapp of struct dcbnl_rtnl_ops. Driver will convert mapping relationship from dscp-prio to dscp-tc. Signed-off-by: Guangbin Huang Reported-by: kernel test robot Signed-off-by: David S. Miller commit 6ea3bf466ac6ad6c0ee1ad4e80d77d62e5e11c7a Author: Jim Cromie Date: Sun Sep 4 15:40:58 2022 -0600 dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes Demonstrate use of DECLARE_DYNDBG_CLASSMAP macro, and expose them as sysfs-nodes for testing. For each of the 4 class-map-types: - declare a class-map of that type, - declare the enum corresponding to those class-names - share _base across 0..30 range - add a __pr_debug_cls() call for each class-name - declare 2 sysnodes for each class-map for 'p' flag, and future 'T' flag These declarations create the following sysfs parameter interface: :#> pwd /sys/module/test_dynamic_debug/parameters :#> ls T_disjoint_bits T_disjoint_names T_level_names T_level_num do_prints p_disjoint_bits p_disjoint_names p_level_names p_level_num NOTES: The local wrapper macro is an api candidate, but there are already too many parameters. OTOH, maybe related enum should be in there too, since it has _base inter-dependencies. The T_* params control the (future) T flag on the same class'd pr_debug callsites as their p* counterparts. Using them will fail, until the dyndbg-trace patches are added in. :#> echo 1 > T_disjoint [ 28.792489] dyndbg: disjoint: 0x1 > test_dynamic_debug.T_D2 [ 28.793848] dyndbg: query 0: "class D2_CORE +T" mod:* [ 28.795086] dyndbg: split into words: "class" "D2_CORE" "+T" [ 28.796467] dyndbg: op='+' [ 28.797148] dyndbg: unknown flag 'T' [ 28.798021] dyndbg: flags parse failed [ 28.798947] dyndbg: processed 1 queries, with 0 matches, 1 errs [ 28.800378] dyndbg: bit_0: -22 matches on class: D2_CORE -> 0x1 [ 28.801959] dyndbg: test_dynamic_debug.T_D2: updated 0x0 -> 0x1 [ 28.803974] dyndbg: total matches: -22 Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-22-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit b9400852c0801aebee4fc8b62e6b7cc69c7fcbda Author: Jim Cromie Date: Sun Sep 4 15:40:57 2022 -0600 dyndbg: add drm.debug style (drm/parameters/debug) bitmap support Add kernel_param_ops and callbacks to use a class-map to validate and apply input to a sysfs-node, which allows users to control classes defined in that class-map. This supports uses like: echo 0x3 > /sys/module/drm/parameters/debug IE add these: - int param_set_dyndbg_classes() - int param_get_dyndbg_classes() - struct kernel_param_ops param_ops_dyndbg_classes Following the model of kernel/params.c STANDARD_PARAM_DEFS, these are non-static and exported. This might be unnecessary here. get/set use an augmented kernel_param; the arg refs a new struct ddebug_class_param, which contains: - A ptr to user's state-store; a union of &ulong for drm.debug, &int for nouveau level debug. By ref'g the client's bit-state _var, code coordinates with existing code (like drm_debug_enabled) which uses it, so existing/remaining calls can work unchanged. Changing drm.debug to a ulong allows use of BIT() etc. - FLAGS: dyndbg.flags toggled by changes to bitmap. Usually just "p". - MAP: a pointer to struct ddebug_classes_map, which maps those class-names to .class_ids 0..N that the module is using. This class-map is declared & initialized by DECLARE_DYNDBG_CLASSMAP. - map-type: 4 enums DD_CLASS_TYPE_* select 2 input forms and 2 meanings. numeric input: DD_CLASS_TYPE_DISJOINT_BITS integer input, independent bits. ie: drm.debug DD_CLASS_TYPE_LEVEL_NUM integer input, 0..N levels classnames-list (comma separated) input: DD_CLASS_TYPE_DISJOINT_NAMES each name affects a bit, others preserved DD_CLASS_TYPE_LEVEL_NAMES names have level meanings, like kern_levels.h _NAMES - comma-separated classnames (with optional +-) _NUM - numeric input, 0-N expected _BITS - numeric input, 0x1F bitmap form expected _DISJOINT - bits are independent _LEVEL - (x /sys/module/drm/parameters/debug_catnames A naive _LEVEL_NAMES use, with one class, that sets all in the class-map according to (x /sys/module/test_dynamic_debug/parameters/p_level_names : problem solved echo -L1 > /sys/module/test_dynamic_debug/parameters/p_level_names Note this artifact: : this is same as prev cmd (due to +/-) echo L0 > /sys/module/test_dynamic_debug/parameters/p_level_names : this is "even-more" off, but same wo __pr_debug_class(L0, ".."). echo -L0 > /sys/module/test_dynamic_debug/parameters/p_level_names A stress-test/make-work usage (kid toggling a light switch): echo +L7,L0,L7,L0,L7,L0,L7,L0,L7,L0,L7,L0,L7 \ > /sys/module/test_dynamic_debug/parameters/p_level_names ddebug_apply_class_bitmap(): inside-fn, works on bitmaps, receives new-bits, finds diffs vs client-bitvector holding "current" state, and issues exec_query to commit the adjustment. param_set_dyndbg_classes(): interface fn, sends _NAMES to param_set_dyndbg_classnames() and returns, falls thru to handle _BITS, _NUM internally, and calls ddebug_apply_class_bitmap(). Finishes by updating state. param_set_dyndbg_classnames(): handles classnames-list in loop, calls ddebug_apply_class_bitmap for each, then updates state. NOTES: _LEVEL_ is overlay on _DISJOINT_; inputs are converted to a bitmask, by the callbacks. IOW this is possible, and possibly confusing: echo class V3 +p > control echo class V1 -p > control IMO thats ok, relative verbosity is an interface property. _LEVEL_NUM maps still need class-names, even though the names are not usable at the sysfs interface (unlike with _NAMES style). The names are the only way to >control the classes. - It must have a "V0" name, something below "V1" to turn "V1" off. __pr_debug_cls(V0,..) is printk, don't do that. - "class names" is required at the >control interface. - relative levels are not enforced at >control _LEVEL_NAMES bear +/- signs, which alters the on-bit-pos by 1. IOW, +L2 means L0,L1,L2, and -L2 means just L0,L1. This kinda spoils the readback fidelity, since the L0 bit gets turned on by any use of any L*, except "-L0". All the interface uncertainty here pertains to the _NAMES features. Nobody has actually asked for this, so its practical (if a little tedious) to split it out. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-21-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit ace7c4bbb240d076a9e2079027252420d920d0d0 Author: Jim Cromie Date: Sun Sep 4 15:40:56 2022 -0600 doc-dyndbg: edit dynamic-debug-howto for brevity, audience Rework/modernize docs: - use /proc/dynamic_debug/control in examples its *always* there (when dyndbg is config'd), even when is not. drop talk, its a distraction here. - alias ddcmd='echo $* > /proc/dynamic_debug/control focus on args: declutter, hide boilerplate, make pwd independent. - swap sections: Viewing before Controlling. control file as Catalog. - focus on use by a system administrator add an alias to make examples more readable drop grep-101 lessons, admins know this. - use init/main.c as 1st example, thread it thru doc where useful. everybodys kernel boots, runs these. - add *prdbg* api section to the bottom of the file, its for developers more than admins. move list of api functions there. - simplify - drop extra words, phrases, sentences. - add "decorator" flags line to unify "prefix", trim fmlt descriptions CC: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-20-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 753914ed85ac396977116f5807af809083c7806a Author: Jim Cromie Date: Sun Sep 4 15:40:55 2022 -0600 doc-dyndbg: describe "class CLASS_NAME" query support Add an explanation of the new "class CLASS_NAME" syntax and meaning, noting that the module determines if CLASS_NAME applies to it. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-19-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4a2a427413e350bd01505f1f698b80545e1be58 Author: Jim Cromie Date: Sun Sep 4 15:40:54 2022 -0600 dyndbg: validate class FOO by checking with module Add module-to-class validation: #> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control If a query has "class FOO", then ddebug_find_valid_class(), called from ddebug_change(), requires that FOO is known to module X, otherwize the query is skipped entirely for X. This protects each module's class-space, other than the default:31. The authors' choice of FOO is highly selective, giving isolation and/or coordinated sharing of FOOs. For example, only DRM modules should know and respond to DRM_UT_KMS. So this, combined with module's opt-in declaration of known classes, effectively privatizes the .class_id space for each module (or coordinated set of modules). Notes: For all "class FOO" queries, ddebug_find_valid_class() is called, it returns the map matching the query, and sets valid_class via an *outvar). If no "class FOO" is supplied, valid_class = _CLASS_DFLT. This insures that legacy queries do not trample on new class'd callsites, as they get added. Also add a new column to control-file output, displaying non-default class-name (when found) or the "unknown _id:", if it has not been (correctly) declared with one of the declarator macros. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-18-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit c45f67ace832e4f66482bffa5808c94f815723e8 Author: Jim Cromie Date: Sun Sep 4 15:40:53 2022 -0600 dyndbg: add ddebug_attach_module_classes Add ddebug_attach_module_classes(), call it from ddebug_add_module(). It scans the classes/section its given, finds records where the module-name matches the module being added, and adds them to the module's maps list. No locking here, since the record isn't yet linked into the ddebug_tables list. It is called indirectly from 2 sources: - from load_module(), where it scans the module's __dyndbg_classes section, which contains DYNAMIC_DEBUG_CLASSES definitions from just the module. - from dynamic_debug_init(), where all DYNAMIC_DEBUG_CLASSES definitions of each builtin module have been packed together. This is why ddebug_attach_module_classes() checks module-name. NOTES Its (highly) likely that builtin classes will be ordered by module name (just like prdbg descriptors are in the __dyndbg section). So the list can be replaced by a vector (ptr + length), which will work for loaded modules too. This would imitate whats currently done for the _ddebug descriptors. That said, converting to vector,len is close to pointless; a small minority of modules will ever define a class-map, and almost all of them will have only 1 or 2 class-maps, so theres only a couple dozen pointers to save. TODO: re-evaluate for lines removable. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-17-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 66f4006b6ace1a1a1a1dca4225972f79a298e251 Author: Jim Cromie Date: Sun Sep 4 15:40:52 2022 -0600 kernel/module: add __dyndbg_classes section Add __dyndbg_classes section, using __dyndbg as a model. Use it: vmlinux.lds.h: KEEP the new section, which also silences orphan section warning on loadable modules. Add (__start_/__stop_)__dyndbg_classes linker symbols for the c externs (below). kernel/module/main.c: - fill new fields in find_module_sections(), using section_objs() - extend callchain prototypes to pass classes, length load_module(): pass new info to dynamic_debug_setup() dynamic_debug_setup(): new params, pass through to ddebug_add_module() dynamic_debug.c: - add externs to the linker symbols. ddebug_add_module(): - It currently builds a debug_table, and *will* find and attach classes. dynamic_debug_init(): - add class fields to the _ddebug_info cursor var: di. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-16-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit aad0214f30264c19044a77fc4776def349b76fc4 Author: Jim Cromie Date: Sun Sep 4 15:40:51 2022 -0600 dyndbg: add DECLARE_DYNDBG_CLASSMAP macro Using DECLARE_DYNDBG_CLASSMAP, modules can declare up to 31 classnames. By doing so, they authorize dyndbg to manipulate class'd prdbgs (ie: __pr_debug_cls, and soon drm_*dbg), ala:: :#> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control The macro declares and initializes a static struct ddebug_class_map:: - maps approved class-names to class_ids used in module, by array order. forex: DRM_UT_* - class-name vals allow validation of "class FOO" queries using macro is opt-in - enum class_map_type - determines interface, behavior Each module has its own class-type and class_id space, and only known class-names will be authorized for a manipulation. Only DRM modules should know and respont to this: :#> echo class DRM_UT_CORE +p > control # across all modules pr_debugs (with default class_id) are still controllable as before. DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, classes...) is:: _var: name of the static struct var. user passes to module_param_cb() if they want a sysfs node. _maptype: this is hard-coded to DD_CLASS_TYPE_DISJOINT_BITS for now. _base: usually 0, it allows splitting 31 classes into subranges, so that multiple classes / sysfs-nodes can share the module's class-id space. classes: list of class_name strings, these are mapped to class-ids starting at _base. This class-names list must have a corresponding ENUM, with SYMBOLS that match the literals, and 1st enum val = _base. enum class_map_type has 4 values, on 2 factors:: - classes are disjoint/independent vs relative/xcontrol interface doesn't enforce the LEVELS relationship, so you could confusingly have V3 enabled, but V1 disabled. OTOH, the control iface already allows infinite tweaking of the underlying callsites; sysfs node readback can only tell the user what they previously wrote. 2. All dyndbg >control reduces to a query/command, includes +/-, which is at-root a kernel patching operation with +/- semantics. And the _NAMES handling exposes it to the user, making it API-adjacent. And its not just >control where +/- gets used (which is settled), the new place is with sysfs-nodes exposing _*_NAMES classes, and here its subtly different. _DISJOINT_NAMES: is simple, independent _LEVEL_NAMES: masks-on bits 0 .. N-1, N..max off # turn on L3,L2,L1 others off echo +L3 > /sys/module/test_dynamic_debug/parameters/p_level_names # turn on L2,L1 others off echo -L3 > /sys/module/test_dynamic_debug/parameters/p_level_names IOW, the - changes the threshold-on bitpos by 1. Alternatively, we could treat the +/- as half-duplex, where -L3 turns off L>2 (and ignores L1), and +L2 would turn on L<=2 (and ignore others). Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-15-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3fc95d80a536e49e38ba4f79ca60cb4e64f99b3b Author: Jim Cromie Date: Sun Sep 4 15:40:50 2022 -0600 dyndbg: add __pr_debug_cls for testing For selftest purposes, add __pr_debug_cls(class, fmt, ...) I didn't think we'd need to define this, since DRM effectively has it already in drm_dbg, drm_devdbg. But test_dynamic_debug needs it in order to demonstrate all the moving parts. Note the __ prefix; its not intended for general use, at least until a need emerges. ISTM the drm.debug model (macro wrappers inserting enum const 1st arg) is the baseline approach. That said, nouveau might want it for easy use in its debug macros. TBD. NB: it does require a builtin-constant class, __pr_debug_cls(i++, ...) is disallowed by compiler. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-14-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit ca90fca7f7b51830dfb95bf655210a1c84588f15 Author: Jim Cromie Date: Sun Sep 4 15:40:49 2022 -0600 dyndbg: add class_id to pr_debug callsites DRM issues ~10 exclusive categories of debug messages; to represent this directly in dyndbg, add a new 6-bit field: struct _ddebug.class_id. This gives us 64 classes, which should be more than enough. #> echo 0x012345678 > /sys/module/drm/parameters/debug All existing callsites are initialized with _DPRINTK_CLASS_DFLT, which is 2^6-1. This reserves 0-62 for use in new categorized/class'd pr_debugs, which fits perfectly with natural enums (ints: 0..N). Thats done by extending the init macro: DEFINE_DYNAMIC_DEBUG_METADATA() with _CLS(cls, ...) suffix, and redefing old name using extended name. Then extend the factory macro callchain with _cls() versions to provide the callsite.class_id, with old-names passing _DPRINTK_CLASS_DFLT. This sets us up to create class'd prdebug callsites (class'd callsites are those with .class_id != _DPRINTK_CLASS_DFLT). No behavior change. cc: Rasmus Villemoes Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-13-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit b7b4eebdba7b6aea6b34dc29691b71c39d1dbd6a Author: Jim Cromie Date: Sun Sep 4 15:40:48 2022 -0600 dyndbg: gather __dyndbg[] state into struct _ddebug_info This new struct composes the linker provided (vector,len) section, and provides a place to add other __dyndbg[] state-data later: descs - the vector of descriptors in __dyndbg section. num_descs - length of the data/section. Use it, in several different ways, as follows: In lib/dynamic_debug.c: ddebug_add_module(): Alter params-list, replacing 2 args (array,index) with a struct _ddebug_info * containing them both, with room for expansion. This helps future-proof the function prototype against the looming addition of class-map info into the dyndbg-state, by providing a place to add more member fields later. NB: later add static struct _ddebug_info builtins_state declaration, not needed yet. ddebug_add_module() is called in 2 contexts: In dynamic_debug_init(), declare, init a struct _ddebug_info di auto-var to use as a cursor. Then iterate over the prdbg blocks of the builtin modules, and update the di cursor before calling _add_module for each. Its called from kernel/module/main.c:load_info() for each loaded module: In internal.h, alter struct load_info, replacing the dyndbg array,len fields with an embedded _ddebug_info containing them both; and populate its members in find_module_sections(). The 2 calling contexts differ in that _init deals with contiguous subranges of __dyndbgs[] section, packed together, while loadable modules are added one at a time. So rename ddebug_add_module() into outer/__inner fns, call __inner from _init, and provide the offset into the builtin __dyndbgs[] where the module's prdbgs reside. The cursor provides start, len of the subrange for each. The offset will be used later to pack the results of builtin __dyndbg_sites[] de-duplication, and is 0 and unneeded for loadable modules, Note: kernel/module/main.c includes for struct _ddeubg_info. This might be prone to include loops, since its also included by printk.h. Nothing has broken in robot-land on this. cc: Luis Chamberlain Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-12-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit aa86a154539e3e06bd7e91323bfea50ef26f1090 Author: Jim Cromie Date: Sun Sep 4 15:40:47 2022 -0600 dyndbg: cleanup auto vars in dynamic_debug_init rework var-names for clarity, regularity rename variables - n to mod_sites - it counts sites-per-module - entries to i - display only - iter_start to iter_mod_start - marks start of each module's subrange - modct to mod_ct - stylistic new iterator var: - site - cursor parallel to iter 1st step towards 'demotion' of iter->site, for removal later treat vars as iters: - drop init at top init just above for-loop, in a textual block Acked-by: Jason Baron Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-11-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit e26ef3af964acfea311403126acee8c56c89e26b Author: Jim Cromie Date: Sun Sep 4 15:40:46 2022 -0600 dyndbg: drop EXPORTed dynamic_debug_exec_queries This exported fn is unused, and will not be needed. Lets dump it. The export was added to let drm control pr_debugs, as part of using them to avoid drm_debug_enabled overheads. But its better to just implement the drm.debug bitmap interface, then its available for everyone. Fixes: a2d375eda771 ("dyndbg: refine export, rename to dynamic_debug_exec_queries()") Fixes: 4c0d77828d4f ("dyndbg: export ddebug_exec_queries") Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-10-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 683263a5e075aca81915a5abc0006a5435d3d54d Author: Jim Cromie Date: Sun Sep 4 15:40:45 2022 -0600 dyndbg: add test_dynamic_debug module Provide a simple module to allow testing DYNAMIC_DEBUG behavior. It calls do_prints() from module-init, and with a sysfs-node. dmesg -C dmesg -w & modprobe test_dynamic_debug dyndbg=+p echo 1 > /sys/module/dynamic_debug/parameters/verbose cat /sys/module/test_dynamic_debug/parameters/do_prints echo module test_dynamic_debug +mftl > /proc/dynamic_debug/control echo junk > /sys/module/test_dynamic_debug/parameters/do_prints Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-9-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit e75ef56f74965f426dd819a41336b640ffdd8fbc Author: Jim Cromie Date: Sun Sep 4 15:40:44 2022 -0600 dyndbg: let query-modname override actual module name dyndbg's control-parser: ddebug_parse_query(), requires that search terms: module, func, file, lineno, are used only once in a query; a thing cannot be named both foo and bar. The cited commit added an overriding module modname, taken from the module loader, which is authoritative. So it set query.module 1st, which disallowed its use in the query-string. But now, its useful to allow a module-load to enable classes across a whole (or part of) a subsystem at once. # enable (dynamic-debug in) drm only modprobe drm dyndbg="class DRM_UT_CORE +p" # get drm_helper too modprobe drm dyndbg="class DRM_UT_CORE module drm* +p" # get everything that knows DRM_UT_CORE modprobe drm dyndbg="class DRM_UT_CORE module * +p" # also for boot-args: drm.dyndbg="class DRM_UT_CORE module * +p" So convert the override into a default, by filling it only when/after the query-string omitted the module. NB: the query class FOO handling is forthcoming. Fixes: 8e59b5cfb9a6 dynamic_debug: add modname arg to exec_query callchain Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-8-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 47ea6f99d06e5a76afffc7f97009081158a9929d Author: Jim Cromie Date: Sun Sep 4 15:40:43 2022 -0600 dyndbg: use ESCAPE_SPACE for cat control `cat control` currently does octal escape, so '\n' becomes "\012". Change this to display as "\n" instead, which reads much cleaner. :#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format init/main.c:1179 [main]initcall_blacklist =_ "blacklisting initcall %s\n" init/main.c:1218 [main]initcall_blacklisted =_ "initcall %s blacklisted\n" init/main.c:1424 [main]run_init_process =_ " with arguments:\n" init/main.c:1426 [main]run_init_process =_ " %s\n" init/main.c:1427 [main]run_init_process =_ " with environment:\n" init/main.c:1429 [main]run_init_process =_ " %s\n" Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-7-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 773beabbb8e8ba84c4c288821405f5042c84447f Author: Jim Cromie Date: Sun Sep 4 15:40:42 2022 -0600 dyndbg: reverse module.callsite walk in cat control Walk the module's vector of callsites backwards; ie N..0. This "corrects" the backwards appearance of a module's prdbg vector when walked 0..N. I think this is due to linker mechanics, which I'm inclined to treat as immutable, and the order is fixable in display. No functional changes. Combined with previous commit, which reversed tables-list, we get: :#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format init/main.c:1179 [main]initcall_blacklist =_ "blacklisting initcall %s\012" init/main.c:1218 [main]initcall_blacklisted =_ "initcall %s blacklisted\012" init/main.c:1424 [main]run_init_process =_ " with arguments:\012" init/main.c:1426 [main]run_init_process =_ " %s\012" init/main.c:1427 [main]run_init_process =_ " with environment:\012" init/main.c:1429 [main]run_init_process =_ " %s\012" Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-6-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2ad556f700430fe5b0ea5481c24bf3287e226897 Author: Jim Cromie Date: Sun Sep 4 15:40:41 2022 -0600 dyndbg: reverse module walk in cat control /proc/dynamic_debug/control walks the prdbg catalog in "reverse", fix this by adding new ddebug_tables to tail of list. This puts init/main.c entries 1st, which looks more than coincidental. no functional changes. Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-5-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit bfa3ca448e81645fc8d4af8265524ae781a2cd2d Author: Jim Cromie Date: Sun Sep 4 15:40:40 2022 -0600 dyndbg: show both old and new in change-info print "old => new" flag values to the info("change") message. no functional change. Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-4-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 85d6b66d31c35158364058ee98fb69ab5bb6a6b1 Author: Jim Cromie Date: Sun Sep 4 15:40:39 2022 -0600 dyndbg: fix module.dyndbg handling For CONFIG_DYNAMIC_DEBUG=N, the ddebug_dyndbg_module_param_cb() stub-fn is too permissive: bash-5.1# modprobe drm JUNKdyndbg bash-5.1# modprobe drm dyndbgJUNK [ 42.933220] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds [ 42.937484] ACPI: bus type drm_connector registered This caused no ill effects, because unknown parameters are either ignored by default with an "unknown parameter" warning, or ignored because dyndbg allows its no-effect use on non-dyndbg builds. But since the code has an explicit feedback message, it should be issued accurately. Fix with strcmp for exact param-name match. Fixes: b48420c1d301 dynamic_debug: make dynamic-debug work for module initialization Reported-by: Rasmus Villemoes Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-3-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit ee879be38bc87f8cedc79ae2742958db6533ca59 Author: Jim Cromie Date: Sun Sep 4 15:40:38 2022 -0600 dyndbg: fix static_branch manipulation In https://lore.kernel.org/lkml/20211209150910.GA23668@axis.com/ Vincent's patch commented on, and worked around, a bug toggling static_branch's, when a 2nd PRINTK-ish flag was added. The bug results in a premature static_branch_disable when the 1st of 2 flags was disabled. The cited commit computed newflags, but then in the JUMP_LABEL block, failed to use that result, instead using just one of the terms in it. Using newflags instead made the code work properly. This is Vincents test-case, reduced. It needs the 2nd flag to demonstrate the bug, but it's explanatory here. pt_test() { echo 5 > /sys/module/dynamic_debug/verbose site="module tcp" # just one callsite echo " $site =_ " > /proc/dynamic_debug/control # clear it # A B ~A ~B for flg in +T +p "-T #broke here" -p; do echo " $site $flg " > /proc/dynamic_debug/control done; # A B ~B ~A for flg in +T +p "-p #broke here" -T; do echo " $site $flg " > /proc/dynamic_debug/control done } pt_test Fixes: 84da83a6ffc0 dyndbg: combine flags & mask into a struct, simplify with it CC: vincent.whitchurch@axis.com Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-2-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2018b22a759e26a4c7e3ac6c60c283cfbd2c9c93 Merge: 29796143f70ec 11c12adcbc159 Author: David S. Miller Date: Wed Sep 7 15:57:48 2022 +0100 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-09-06 (i40e, iavf) This series contains updates to i40e and iavf drivers. Stanislaw adds support for new device id for i40e. Jaroslaw tidies up some code around MSI-X configuration by adding/ reworking comments and introducing a couple of macros for i40e. Michal resolves some races around reset and close by deferring and deleting some pending AdminQ operations and reworking filter additions and deletions during these operations for iavf. ==================== Signed-off-by: David S. Miller commit 29796143f70eca1cf9e87f3a023bf79790c2f31a Merge: 53fc01a0a8cbf 04cbaa6c08e39 Author: David S. Miller Date: Wed Sep 7 15:56:21 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-09-06 (ice) This series contains updates to ice driver only. Tony reduces device MSI-X request/usage when entire request can't be fulfilled. Michal adds check for reset when waiting for PTP offsets. Paul refactors firmware version checks to use a common helper. Christophe Jaillet changes a couple of local memory allocation to not use the devm variant. ==================== Signed-off-by: David S. Miller commit adda60cc2bb0fa46bed004070f29f90db96afbb3 Author: Florian Westphal Date: Tue Sep 6 17:20:36 2022 +0200 netfilter: nat: avoid long-running port range loop Looping a large port range takes too long. Instead select a random offset within [ntohs(exp->saved_proto.tcp.port), 65535] and try 128 ports. This is a rehash of an erlier patch to do the same, but generalized to handle other helpers as well. Link: https://patchwork.ozlabs.org/project/netfilter-devel/patch/20210920204439.13179-2-Cole.Dishington@alliedtelesis.co.nz/ Signed-off-by: Florian Westphal commit c92c27171040554cfda7a3fc925e9dbcb5b4a698 Author: Florian Westphal Date: Tue Sep 6 17:20:35 2022 +0200 netfilter: nat: move repetitive nat port reserve loop to a helper Almost all nat helpers reserve an expecation port the same way: Try the port inidcated by the peer, then move to next port if that port is already in use. We can squash this into a helper. Suggested-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 8556bceb9c409946eebd2303d2f19e87844195ae Author: Wolfram Sang Date: Thu Aug 18 23:02:24 2022 +0200 netfilter: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Florian Westphal commit a0a4de4d897f5ce672e086cb6b9f91a306af6953 Author: Florian Westphal Date: Mon Aug 22 16:41:21 2022 +0200 netfilter: remove NFPROTO_DECNET Decnet has been removed. so no need to reserve space in arrays for it. Signed-off-by: Florian Westphal commit 628d694344a02a428846643791e8b26071b76328 Author: Florian Westphal Date: Fri Aug 26 15:32:27 2022 +0200 netfilter: conntrack: reduce timeout when receiving out-of-window fin or rst In case the endpoints and conntrack go out-of-sync, i.e. there is disagreement wrt. validy of sequence/ack numbers between conntracks internal state and those of the endpoints, connections can hang for a long time (until ESTABLISHED timeout). This adds a check to detect a fin/fin exchange even if those are invalid. The timeout is then lowered to UNACKED (default 300s). Signed-off-by: Florian Westphal commit 09a59001b0d6417214c86b69263f6b8981c7c2db Author: Florian Westphal Date: Fri Aug 26 15:32:26 2022 +0200 netfilter: conntrack: remove unneeded indent level After previous patch, the conditional branch is obsolete, reformat it. gcc generates same code as before this change. Signed-off-by: Florian Westphal commit 53fc01a0a8cbf0b9945355a2e632ca00570a4465 Author: Liu Shixin Date: Mon Sep 5 20:50:42 2022 +0800 net: sysctl: remove unused variable long_max The variable long_max is replaced by bpf_jit_limit_max and no longer be used. So remove it. No functional change. Signed-off-by: Liu Shixin Signed-off-by: David S. Miller commit c9daab322313087afde8c46f41df3c628410ae20 Author: Lorenzo Bianconi Date: Mon Sep 5 14:46:01 2022 +0200 net: ethernet: mtk_eth_soc: remove mtk_foe_entry_timestamp Get rid of mtk_foe_entry_timestamp routine since it is no longer used. Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit e0d38f88e977e7fb6a8aa4d4f31720b1c9b7817e Merge: 5b16f2677b9c0 8a7d5d85ed216 Author: Mark Brown Date: Wed Sep 7 15:28:51 2022 +0100 ASoC: Fixes for MT8195 SOF support Merge series from AngeloGioacchino Del Regno : This series fixes Sound Open Firmware support for MT8195 by making sure that the sound card driver is actually able to probe and IPC can finally happen. It is now possible to get DSP support for audio. Tested on MT8195 Tomato - Acer Chromebook Spin 513 CP513-2H (Pipewire). commit 8422b769fa46bd429dc0f324012629a4691f0dd9 Author: Wesley Cheng Date: Thu Sep 1 12:36:25 2022 -0700 usb: dwc3: gadget: Submit endxfer command if delayed during disconnect During a cable disconnect sequence, if ep0state is not in the SETUP phase, then nothing will trigger any pending end transfer commands. Force stopping of any pending SETUP transaction, and move back to the SETUP phase. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220901193625.8727-6-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit b353eb6dc285a0775a447f53e5b2a50bf3f9684f Author: Wesley Cheng Date: Thu Sep 1 12:36:24 2022 -0700 usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer For endxfer commands that do not require an endpoint complete interrupt, avoid having to wait for the command active bit to clear. This allows for EP0 events to continue to be handled, which allows for the controller to complete it. Otherwise, it is known that the endxfer command will fail if there is a pending SETUP token that needs to be read. Suggested-by: Thinh Nguyen Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220901193625.8727-5-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 461ee467507cb98a348fa91ff8460908bb0ea423 Author: Wesley Cheng Date: Thu Sep 1 12:36:23 2022 -0700 usb: dwc3: Increase DWC3 controller halt timeout Since EP0 transactions need to be completed before the controller halt sequence is finished, this may take some time depending on the host and the enabled functions. Increase the controller halt timeout, so that we give the controller sufficient time to handle EP0 transfers. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220901193625.8727-4-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 5265397f94424eaea596026fd34dc7acf474dcec Author: Wesley Cheng Date: Thu Sep 1 12:36:22 2022 -0700 usb: dwc3: Remove DWC3 locking during gadget suspend/resume Remove the need for making dwc3_gadget_suspend() and dwc3_gadget_resume() to be called in a spinlock, as dwc3_gadget_run_stop() could potentially take some time to complete. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220901193625.8727-3-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 2b2da6574e77ebf83c0df6d8b838bc37764c4bfa Author: Wesley Cheng Date: Thu Sep 1 12:36:21 2022 -0700 usb: dwc3: Avoid unmapping USB requests if endxfer is not complete If DWC3_EP_DELAYED_STOP is set during stop active transfers, then do not continue attempting to unmap request buffers during dwc3_remove_requests(). This can lead to SMMU faults, as the controller has not stopped the processing of the TRB. Defer this sequence to the EP0 out start, which ensures that there are no pending SETUP transactions before issuing the endxfer. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220901193625.8727-2-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 787f51f210ebe5d7d5e4c8101b148f0018e9c409 Author: Linus Walleij Date: Thu Sep 1 10:16:49 2022 +0200 USB/ARM: Switch S3C2410 UDC to GPIO descriptors This converts the S3C2410 UDC USB device controller to use GPIO descriptor tables and modern GPIO. Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Acked-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220901081649.564348-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit a8113da51cf822f90e93436442db5095e20ff6d9 Author: Dongliang Mu Date: Sat Sep 3 18:00:01 2022 +0800 usb: misc: uss720: fix uninitialized variable rlen Smatch reports the following error: uninitialized symbol 'rlen' drivers/usb/misc/uss720.c:514 parport_uss720_epp_write_data() error drivers/usb/misc/uss720.c:575 parport_uss720_ecp_write_data() error drivers/usb/misc/uss720.c:593 parport_uss720_ecp_read_data() error drivers/usb/misc/uss720.c:626 parport_uss720_write_compat() error The root cause is, the failure of usb_bulk_msg leads to the uninitialized variable rlen in printk function. Fix this by initializing rlen with zero. Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20220903100004.2874741-1-dzm91@hust.edu.cn Signed-off-by: Greg Kroah-Hartman commit f57004b9d96755cd6a243b51c267be4016b4563c Author: Dan Carpenter Date: Thu Sep 1 17:59:42 2022 +0300 usb: gadget: f_fs: stricter integer overflow checks This from static analysis. The vla_item() takes a size and adds it to the total. It has a built in integer overflow check so if it encounters an integer overflow anywhere then it records the total as SIZE_MAX. However there is an issue here because the "lang_count*(needed_count+1)" multiplication can overflow. Technically the "lang_count + 1" addition could overflow too, but that would be detected and is harmless. Fix both using the new size_add() and size_mul() functions. Fixes: e6f3862fa1ec ("usb: gadget: FunctionFS: Remove VLAIS usage from gadget code") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YxDI3lMYomE7WCjn@kili Signed-off-by: Greg Kroah-Hartman commit 5e0531f6b90ac096fedaf5bd0eae0bb4e5a39da5 Author: Christophe Leroy Date: Wed Sep 7 16:11:25 2022 +0200 spi: Add capability to perform some transfer with chipselect off Some components require a few clock cycles with chipselect off before or/and after the data transfer done with CS on. Typically IDT 801034 QUAD PCM CODEC datasheet states "Note *: CCLK should have one cycle before CS goes low, and two cycles after CS goes high". The cycles "before" are implicitely provided by all previous activity on the SPI bus. But the cycles "after" must be provided in order to terminate the SPI transfer. In order to use that kind of component, add a cs_off flag to spi_transfer struct. When this flag is set, the transfer is performed with chipselect off. This allows consummer to add a dummy transfer at the end of the transfer list which is performed with chipselect OFF, providing the required additional clock cycles. Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/434165c46f06d802690208a11e7ea2500e8da4c7.1662558898.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown commit d799a183da39ac4988b62da8978950efa177ba9f Author: Vasant Hegde Date: Thu Aug 25 06:39:39 2022 +0000 iommu/amd: Add command-line option to enable different page table Enhance amd_iommu command line option to specify v1 or v2 page table. By default system will boot in V1 page table mode. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-10-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 4db6c41f09469ab8ca5d30f5d4731f299d25ff1c Author: Suravee Suthikulpanit Date: Thu Aug 25 06:39:38 2022 +0000 iommu/amd: Add support for using AMD IOMMU v2 page table for DMA-API Introduce init function for setting up DMA domain for DMA-API with the IOMMU v2 page table. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220825063939.8360-9-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 643feb0072d5aad9bf5f38eca3fb78c2f8d9f140 Author: Suravee Suthikulpanit Date: Thu Aug 25 06:39:37 2022 +0000 iommu/amd: Add support for Guest IO protection AMD IOMMU introduces support for Guest I/O protection where the request from the I/O device without a PASID are treated as if they have PASID 0. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220825063939.8360-8-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit aaac38f614871df252aa7459647bf68d42f7c3e7 Author: Vasant Hegde Date: Thu Aug 25 06:39:36 2022 +0000 iommu/amd: Initial support for AMD IOMMU v2 page table Introduce IO page table framework support for AMD IOMMU v2 page table. This patch implements 4 level page table within iommu amd driver and supports 4K/2M/1G page sizes. Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-7-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit be1af02b277417be735d8513195e5ba1bc3c3a3d Author: Suravee Suthikulpanit Date: Thu Aug 25 06:39:35 2022 +0000 iommu/amd: Update sanity check when enable PRI/ATS for IOMMU v1 table Currently, PPR/ATS can be enabled only if the domain is type identity mapping. However, when allowing the IOMMU v2 page table to be used for DMA-API, the check is no longer valid. Update the sanity check to only apply for when using AMD_IOMMU_V1 page table mode. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-6-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 43312b710b11a085ec81eb7d1878f8858045ae2b Author: Suravee Suthikulpanit Date: Thu Aug 25 06:39:34 2022 +0000 iommu/amd: Refactor amd_iommu_domain_enable_v2 to remove locking The current function to enable IOMMU v2 also lock the domain. In order to reuse the same code in different code path, in which the domain has already been locked, refactor the function to separate the locking from the enabling logic. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220825063939.8360-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 6b080c4e815ceba3c08ffa980c858595c07e786a Author: Vasant Hegde Date: Thu Aug 25 06:39:33 2022 +0000 iommu/amd: Add map/unmap_pages() iommu_domain_ops callback support Implement the map_pages() and unmap_pages() callback for the AMD IOMMU driver to allow calls from iommu core to map and unmap multiple pages. Also deprecate map/unmap callbacks. Finally gatherer is not updated by iommu_v1_unmap_pages(). Hence pass NULL instead of gather to iommu_v1_unmap_pages. Suggested-by: Robin Murphy Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 251c4db699ca7b966db7e59e8663a231c96ba454 Author: Vasant Hegde Date: Thu Aug 25 06:39:32 2022 +0000 iommu/amd/io-pgtable: Implement unmap_pages io_pgtable_ops callback Implement the io_pgtable_ops->unmap_pages() callback for AMD driver and deprecate io_pgtable_ops->unmap callback. Also if fetch_pte() returns NULL then return from unmap_mapages() instead of trying to continue to unmap remaining pages. Suggested-by: Robin Murphy Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 8cc233dec3137a2d243e6996e425c32032672c88 Author: Vasant Hegde Date: Thu Aug 25 06:39:31 2022 +0000 iommu/amd/io-pgtable: Implement map_pages io_pgtable_ops callback Implement the io_pgtable_ops->map_pages() callback for AMD driver. Also deprecate io_pgtable->map callback. Suggested-by: Robin Murphy Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220825063939.8360-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 6e250dcbff1d3ce347b8294e4ec6da96a2cecdb5 Author: Florian Westphal Date: Fri Aug 26 15:32:25 2022 +0200 netfilter: conntrack: ignore overly delayed tcp packets If 'nf_conntrack_tcp_loose' is off (the default), tcp packets that are outside of the current window are marked as INVALID. nf/iptables rulesets often drop such packets via 'ct state invalid' or similar checks. For overly delayed acks, this can be a nuisance if such 'invalid' packets are also logged. Since they are not invalid in a strict sense, just ignore them, i.e. conntrack won't extend timeout or change state so that they do not match invalid state rules anymore. This also avoids unwantend connection stalls in case conntrack considers retransmission (of data that did not reach the peer) as too old. The else branch of the conditional becomes obsolete. Next patch will reformant the now always-true if condition. The existing workaround for data that exceeds the calculated receive window is adjusted to use the 'ignore' state so that these packets do not refresh the timeout or change state other than updating ->td_end. Signed-off-by: Florian Westphal commit d9a6f0d0df1899ff9086a57abc600e414f4b8cdd Author: Florian Westphal Date: Fri Aug 26 15:32:24 2022 +0200 netfilter: conntrack: prepare tcp_in_window for ternary return value tcp_in_window returns true if the packet is in window and false if it is not. If its outside of window, packet will be treated as INVALID. There are corner cases where the packet should still be tracked, because rulesets may drop or log such packets, even though they can occur during normal operation, such as overly delayed acks. In extreme cases, connection may hang forever because conntrack state differs from real state. There is no retransmission for ACKs. In case of ACK loss after conntrack processing, its possible that a connection can be stuck because the actual retransmits are considered stale ("SEQ is under the lower bound (already ACKed data retransmitted)". The problem is made worse by carrier-grade-nat which can also result in stale packets from old connections to get treated as 'recent' packets in conntrack (it doesn't support tcp timestamps at this time). Prepare tcp_in_window() to return an enum that tells the desired action (in-window/accept, bogus/drop). A third action (accept the packet as in-window, but do not change state) is added in a followup patch. Signed-off-by: Florian Westphal commit 5b16f2677b9c0b06d4d1107a541d5d4e7a4da404 Merge: e9d967679e803 3caac759681ee Author: Mark Brown Date: Wed Sep 7 14:37:12 2022 +0100 ASoC: soc-dapm.c: random cleanup Merge series from Kuninori Morimoto : These are cleanup patches for soc-dapm.c. Each patches are not related, very random cleanup. commit af3ce550a6590551a88383382983301c431e3153 Author: Mark Brown Date: Mon Aug 29 17:25:02 2022 +0100 kselftest/arm64: Enforce actual ABI for SVE syscalls Currently syscall-abi permits the bits in Z registers not shared with the V registers as well as all of the predicate registers to be preserved on syscall but the actual implementation has always cleared them and our documentation has now been updated to make that the documented ABI so update the syscall-abi test to match. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220829162502.886816-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit bb7852c168fe02fddbbc5cf26dc6fb779e6aad38 Author: Mark Brown Date: Mon Aug 29 17:25:00 2022 +0100 kselftest/arm64: Correct buffer allocation for SVE Z registers The buffer used for verifying SVE Z registers allocated enough space for 16 maximally sized registers rather than 32 due to using the macro for the number of P registers. In practice this didn't matter since for historical reasons the maximum VQ defined in the ABI is greater the architectural maximum so we will always allocate more space than is needed even with emulated platforms implementing the architectural maximum. Still, we should use the right define. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220829162502.886816-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 31ba63426b328f99323ba44ae0f123417e80340e Author: Mark Brown Date: Mon Aug 29 17:07:03 2022 +0100 kselftest/arm64: Include larger SVE and SME VLs in signal tests Now that the core utilities for signal testing support handling data in EXTRA_CONTEXT blocks we can test larger SVE and SME VLs which spill over the limits in the base signal context. This is done by defining storage for the context as a union with a ucontext_t and a buffer together with some helpers for getting relevant sizes and offsets like we do for fake_sigframe, this isn't the most lovely code ever but is fairly straightforward to implement and much less invasive to the somewhat unclear and indistinct layers of abstraction in the signal handling test code. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-11-broonie@kernel.org Signed-off-by: Catalin Marinas commit 38150a6204c731a4846786682e500d132571fd82 Author: Mark Brown Date: Mon Aug 29 17:07:02 2022 +0100 kselftest/arm64: Allow larger buffers in get_signal_context() In order to allow testing of signal contexts that overflow the base signal frame allow callers to pass the buffer size for the user context into get_signal_context(). No functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-10-broonie@kernel.org Signed-off-by: Catalin Marinas commit 2fa1116bb491edd30814daa0cd0c9d3a76ba4f4d Author: Mark Brown Date: Mon Aug 29 17:07:01 2022 +0100 kselftest/arm64: Preserve any EXTRA_CONTEXT in handle_signal_copyctx() When preserving the signal context for later verification by testcases check for and include any EXTRA_CONTEXT block if enough space has been provided. Since the EXTRA_CONTEXT block includes a pointer to the start of the additional data block we need to do at least some fixup on the copied data. For simplicity in users we do this by extending the length of the EXTRA_CONTEXT to include the following termination record, this will cause users to see the extra data as part of the linked list of contexts without needing any special handling. Care will be needed if any specific tests for EXTRA_CONTEXT are added beyond the validation done in ASSERT_GOOD_CONTEXT. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-9-broonie@kernel.org Signed-off-by: Catalin Marinas commit ff89a81903d3c206ed90cfe60dce900f3b7be65b Author: Mark Brown Date: Mon Aug 29 17:07:00 2022 +0100 kselftest/arm64: Validate contents of EXTRA_CONTEXT blocks Currently in validate_reserved() we check the basic form and contents of an EXTRA_CONTEXT block but do not actually validate anything inside the data block it provides. Extend the validation to do so, when we get to the terminator for the main data block reset and start walking the extra data block instead. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-8-broonie@kernel.org Signed-off-by: Catalin Marinas commit 1998c823c535643c59135a48242d1f933c379d5b Author: Mark Brown Date: Mon Aug 29 17:06:59 2022 +0100 kselftest/arm64: Only validate each signal context once Currently for the more complex signal context types we validate the context specific details the end of the parsing loop validate_reserved() if we've ever seen a context of that type. This is currently merely a bit inefficient but will get a bit awkward when we start parsing extra_context, at which point we will need to reset the head to advance into the extra space that extra_context provides. Instead only do the more detailed checks on each context type the first time we see that context type. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit 2384cd2b7e68890fcff8598ead37b3eff40aaaa1 Author: Mark Brown Date: Mon Aug 29 17:06:58 2022 +0100 kselftest/arm64: Remove unneeded protype for validate_extra_context() Nothing outside testcases.c should need to use validate_extra_context(), remove the prototype to ensure nothing does. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit b721c8237fe39a0e3b653f47add3156f7cdccef2 Author: Mark Brown Date: Mon Aug 29 17:06:57 2022 +0100 kselftest/arm64: Fix validation of EXTRA_CONTEXT signal context location Currently in validate_extra_context() we assert both that the extra data pointed to by the EXTRA_CONTEXT is 16 byte aligned and that it immediately follows the struct _aarch64_ctx providing the terminator for the linked list of contexts in the signal frame. Since struct _aarch64_ctx is an 8 byte structure which must be 16 byte aligned these cannot both be true. As documented in sigcontext.h and implemented by the kernel the extra data should be at the next 16 byte aligned address after the terminator so fix the validation to match. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5c152c2f66f9368394b89ac90dc7483476ef7b88 Author: Mark Brown Date: Mon Aug 29 17:06:56 2022 +0100 kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT When arm64 signal context data overflows the base struct sigcontext it gets placed in an extra buffer pointed to by a record of type EXTRA_CONTEXT in the base struct sigcontext which is required to be the last record in the base struct sigframe. The current validation code attempts to check this by using GET_RESV_NEXT_HEAD() to step forward from the current record to the next but that is a macro which assumes it is being provided with a struct _aarch64_ctx and uses the size there to skip forward to the next record. Instead validate_extra_context() passes it a struct extra_context which has a separate size field. This compiles but results in us trying to validate a termination record in completely the wrong place, at best failing validation and at worst just segfaulting. Fix this by passing the struct _aarch64_ctx we meant to into the macro. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit e40422c94e6a3b64d1092dcdbe1aeb4011ac3d69 Author: Mark Brown Date: Mon Aug 29 17:06:55 2022 +0100 kselftest/arm64: Validate signal ucontext in place In handle_input_signal_copyctx() we use ASSERT_GOOD_CONTEXT() to validate that the context we are saving meets expectations however we do this on the saved copy rather than on the actual signal context passed in. This breaks validation of EXTRA_CONTEXT since we attempt to validate the ABI requirement that the additional space supplied is immediately after the termination record in the standard context which will not be the case after it has been copied to another location. Fix this by doing the validation before we copy. Note that nothing actually looks inside the EXTRA_CONTEXT at present. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 647d0933809a3e894a9cf989bc32e28244cb2c5d Author: Mark Brown Date: Mon Aug 29 17:06:54 2022 +0100 kselftest/arm64: Enumerate SME rather than SVE vector lengths for za_regs The za_regs signal test was enumerating the SVE vector lengths rather than the SME vector lengths through cut'n'paste error when determining what to test. Enumerate the SME vector lengths instead. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829160703.874492-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0f40caf7ebfe3d4773fc37bc842690233d03c7c9 Author: Mark Brown Date: Mon Aug 29 16:57:28 2022 +0100 kselftest/arm64: Add a test for signal frames with ZA disabled When ZA is disabled there should be no register data in the ZA signal frame, add a test case which confirms that this is the case. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829155728.854947-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit b95b07d1c4d48e462a6d2e7b1b11f03f8626bf11 Author: Mark Brown Date: Mon Aug 29 16:57:27 2022 +0100 kselftest/arm64: Tighten up validation of ZA signal context Currently we accept any size for the ZA signal context that the shared code will accept which means we don't verify that any data is present. Since we have enabled ZA we know that there must be data so strengthen the check to only accept a signal frame with data, and while we're at it since we enabled ZA but did not set any data we know that ZA must contain zeros, confirm that. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829155728.854947-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit fd5c2c6f08b10a5f5c85261f580075bc8aa08d4d Author: Mark Brown Date: Mon Aug 29 16:44:52 2022 +0100 kselftest/arm64: kselftest harness for FP stress tests Currently the stress test programs for floating point context switching are run by hand, there are extremely simplistic harnesses which run some copies of each test individually but they are not integrated into kselftest and with SVE and SME they only run with whatever vector length the process has by default. This is hassle when running the tests and means that they're not being run at all by CI systems picking up kselftest. In order to improve our coverage and provide a more convenient interface provide a harness program which starts enough stress test programs up to cause context switching and runs them for a set period. If only FPSIMD is available in the system we start two copies of the FPSIMD stress test per CPU, otherwise we start one copy of the FPSIMD and then start the SVE, streaming SVE and ZA tests once per CPU for each available VL they have to run on. We then run for a set period monitoring for any errors reported by the test programs before cleanly terminating them. In order to provide additional coverage of signal handling and some extra noise in the scheduling we send a SIGUSR2 to the stress tests once a second, the tests will count the number of signals they get. Since kselftest is generally expected to run quickly we by default only run for ten seconds. This is enough to show if there is anything cripplingly wrong but not exactly a thorough soak test, for interactive and more focused use a command line option -t N is provided which overrides the length of time to run for (specified in seconds) and if 0 is specified then there is no timeout and the test must be manually terminated. The timeout is counted in seconds with no output, this is done to account for the potentially slow startup time for the test programs on virtual platforms which tend to struggle during startup as they are both slow and tend to support a wide range of vector lengths. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154452.824870-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit d47d8a5e21fc7f83bccc94156dfe6192e3f57724 Author: Mark Brown Date: Tue Sep 6 23:00:56 2022 +0100 kselftest/arm64: Install signal handlers before output in FP stress tests To interface more robustly with other processes install the signal handers in the floating point stress tests before we produce any output, this means that a parent process can know that if it has seen any output from the test then the test is ready to handle incoming signals. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220906220056.820295-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 016eb59012b576f5a7b7b415d757717dc8cb3c6b Merge: da7d8e65b3fce 99d4dc66c8237 Author: David S. Miller Date: Wed Sep 7 14:02:09 2022 +0100 Merge branch 'macsec-offload-mlx5' Saeed Mahameed says: ==================== Introduce MACsec skb_metadata_dst and mlx5 macsec offload v1->v2: - attach mlx5 implementation patches. This patchset introduces MACsec skb_metadata_dst to lay the ground for MACsec HW offload. MACsec is an IEEE standard (IEEE 802.1AE) for MAC security. It defines a way to establish a protocol independent connection between two hosts with data confidentiality, authenticity and/or integrity, using GCM-AES. MACsec operates on the Ethernet layer and as such is a layer 2 protocol, which means it’s designed to secure traffic within a layer 2 network, including DHCP or ARP requests. Linux has a software implementation of the MACsec standard and HW offloading support. The offloading is re-using the logic, netlink API and data structures of the existing MACsec software implementation. For Tx: In the current MACsec offload implementation, MACsec interfaces shares the same MAC address by default. Therefore, HW can't distinguish from which MACsec interface the traffic originated from. MACsec stack will use skb_metadata_dst to store the SCI value, which is unique per MACsec interface, skb_metadat_dst will be used later by the offloading device driver to associate the SKB with the corresponding offloaded interface (SCI) to facilitate HW MACsec offload. For Rx: Like in the Tx changes, if there are more than one MACsec device with the same MAC address as in the packet's destination MAC, the packet will be forward only to one of the devices and not neccessarly to the desired one. Offloading device driver sets the MACsec skb_metadata_dst sci field with the appropriaate Rx SCI for each SKB so the MACsec rx handler will know to which port to divert those skbs, instead of wrongly solely relaying on dst MAC address comparison. 1) patch 1,2, Add support to skb_metadata_dst in MACsec code: net/macsec: Add MACsec skb_metadata_dst Tx Data path support net/macsec: Add MACsec skb_metadata_dst Rx Data path support 2) patch 3, Move some MACsec driver code for sharing with various drivers that implements offload: net/macsec: Move some code for sharing with various drivers that implements offload 3) The rest of the patches introduce mlx5 implementation for macsec offloads TX and RX via steering tables. a) TX, intercept skbs with macsec offlad mark in skb_metadata_dst and mark the descriptor for offload. b) RX, intercept offloaded frames and prepare the proper skb_metadata_dst to mark offloaded rx frames. ==================== Signed-off-by: David S. Miller commit 99d4dc66c82379b1e077f4e139b2048b207ff07c Author: Lior Nahmanson Date: Mon Sep 5 22:21:29 2022 -0700 net/mlx5e: Add support to configure more than one macsec offload device Add the ability to add up to 16 MACsec offload interfaces over the same physical interface Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 807a1b765b4f4292329dba3a57217e2eae486448 Author: Lior Nahmanson Date: Mon Sep 5 22:21:28 2022 -0700 net/mlx5e: Add MACsec stats support for Rx/Tx flows Add the following statistics: RX successfully decrypted MACsec packets: macsec_rx_pkts : Number of packets decrypted successfully macsec_rx_bytes : Number of bytes decrypted successfully Rx dropped MACsec packets: macsec_rx_pkts_drop : Number of MACsec packets dropped macsec_rx_bytes_drop : Number of MACsec bytes dropped TX successfully encrypted MACsec packets: macsec_tx_pkts : Number of packets encrypted/authenticated successfully macsec_tx_bytes : Number of bytes encrypted/authenticated successfully Tx dropped MACsec packets: macsec_tx_pkts_drop : Number of MACsec packets dropped macsec_tx_bytes_drop : Number of MACsec bytes dropped The above can be seen using: ethtool -S |grep macsec Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 5a39816a75e5ac4a1c6be31d7d5af46a2813aece Author: Lior Nahmanson Date: Mon Sep 5 22:21:27 2022 -0700 net/mlx5e: Add MACsec offload SecY support Add offload support for MACsec SecY callbacks - add/update/delete. add_secy is called when need to create a new MACsec interface. upd_secy is called when source MAC address or tx SC was changed. del_secy is called when need to destroy the MACsec interface. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit b7c9400cbc48c3713190b3bce4e0c87e924e4104 Author: Lior Nahmanson Date: Mon Sep 5 22:21:26 2022 -0700 net/mlx5e: Implement MACsec Rx data path using MACsec skb_metadata_dst MACsec driver need to distinguish to which offload device the MACsec is target to, in order to handle them correctly. This can be done by attaching a metadata_dst to a SKB with a SCI, when there is a match on MACsec rule. To achieve that, there is a map between fs_id to SCI, so for each RX SC, there is a unique fs_id allocated when creating RX SC. fs_id passed to device driver as metadata for packets that passed Rx MACsec offload to aid the driver to retrieve the matching SCI. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 3b20949cb21bac26d50cdcc58896802a890cfe15 Author: Lior Nahmanson Date: Mon Sep 5 22:21:25 2022 -0700 net/mlx5e: Add MACsec RX steering rules Rx flow steering consists of two flow tables (FTs). The first FT (crypto table) have one default miss rule so non MACsec offloaded packets bypass the MACSec tables. All others flow table entries (FTEs) are divided to two equal groups size, both of them are for MACsec packets: The first group is for MACsec packets which contains SCI field in the SecTAG header. The second group is for MACsec packets which doesn't contain SCI, where need to match on the source MAC address (only if the SCI is built from default MACsec port). Destination MAC address, ethertype and some of SecTAG fields are also matched for both groups. In case of match, invoke decrypt action on the packet. For each MACsec Rx offloaded SA two rules are created: one with SCI and one without SCI. The second FT (check table) has two fixed rules: One rule is for verifying that the previous offload actions were finished successfully. In this case, need to decap the SecTAG header and forward the packet for further processing. Another default rule for dropping packets that failed in the previous decrypt actions. The MACsec FTs are created on demand when the first MACsec rule is added and destroyed when the last MACsec rule is deleted. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 15d187e285b3d5f4fe0328c09566355c1e387ff6 Author: Lior Nahmanson Date: Mon Sep 5 22:21:24 2022 -0700 net/mlx5: Add MACsec Rx tables support to fs_core Add new namespace for MACsec RX flows. Encrypted MACsec packets should be first decrypted and stripped from MACsec header and then continues with the kernel's steering pipeline. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit aae3454e4d4cd78d143d6af1347b385796539fd8 Author: Lior Nahmanson Date: Mon Sep 5 22:21:23 2022 -0700 net/mlx5e: Add MACsec offload Rx command support Add a support for Connect-X MACsec offload Rx SA & SC commands: add, update and delete. SCs are created on demend and aren't limited by number and unique by SCI. Each Rx SA must be associated with Rx SC according to SCI. Follow-up patches will implement the Rx steering. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 9515978eee0b933e37947637d138f1942b3e4b0c Author: Lior Nahmanson Date: Mon Sep 5 22:21:22 2022 -0700 net/mlx5e: Implement MACsec Tx data path using MACsec skb_metadata_dst MACsec driver marks Tx packets for device offload using a dedicated skb_metadata_dst which holds a 64 bits SCI number. A previously set rule will match on this number so the correct SA is used for the MACsec operation. As device driver can only provide 32 bits of metadata to flow tables, need to used a mapping from 64 bit to 32 bits marker or id, which is can be achieved by provide a 32 bit unique flow id in the control path, and used a hash table to map 64 bit to the unique id in the datapath. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit e467b283ffd50cf15b84c73eef68787e257eaed5 Author: Lior Nahmanson Date: Mon Sep 5 22:21:21 2022 -0700 net/mlx5e: Add MACsec TX steering rules Tx flow steering consists of two flow tables (FTs). The first FT (crypto table) has two fixed rules: One default miss rule so non MACsec offloaded packets bypass the MACSec tables, another rule to make sure that MACsec key exchange (MKE) traffic passes unencrypted as expected (matched of ethertype). On each new MACsec offload flow, a new MACsec rule is added. This rule is matched on metadata_reg_a (which contains the id of the flow) and invokes the MACsec offload action on match. The second FT (check table) has two fixed rules: One rule for verifying that the previous offload actions were finished successfully and packet need to be transmitted. Another default rule for dropping packets that were failed in the offload actions. The MACsec FTs should be created on demand when the first MACsec rule is added and destroyed when the last MACsec rule is deleted. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit ee534d7f81ba9cec028580f91429b3dc29b90c7f Author: Lior Nahmanson Date: Mon Sep 5 22:21:20 2022 -0700 net/mlx5: Add MACsec Tx tables support to fs_core Changed EGRESS_KERNEL namespace to EGRESS_IPSEC and add new namespace for MACsec TX. This namespace should be the last namespace for transmitted packets. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 8ff0ac5be1446920d71bdce5547f0d8476e280ff Author: Lior Nahmanson Date: Mon Sep 5 22:21:19 2022 -0700 net/mlx5: Add MACsec offload Tx command support This patch adds support for Connect-X MACsec offload Tx SA commands: add, update and delete. In Connect-X MACsec, a Security Association (SA) is added or deleted via allocating a HW context of an encryption/decryption key and a HW context of a matching SA (MACsec object). When new SA is added: - Use a separate crypto key HW context. - Create a separate MACsec context in HW to include the SA properties. Introduce a new compilation flag MLX5_EN_MACSEC for it. Follow-up patches will implement the Tx steering. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 8385c51ff5bceb92f7401138e16b0a617ca2ab02 Author: Lior Nahmanson Date: Mon Sep 5 22:21:18 2022 -0700 net/mlx5: Introduce MACsec Connect-X offload hardware bits and structures Add MACsec offload related IFC structs, layouts and enumerations. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit e227ee990bf974f655ec3132b496409990f6634b Author: Lior Nahmanson Date: Mon Sep 5 22:21:17 2022 -0700 net/mlx5: Generalize Flow Context for new crypto fields In order to support MACsec offload (and maybe some other crypto features in the future), generalize flow action parameters / defines to be used by crypto offlaods other than IPsec. The following changes made: ipsec_obj_id field at flow action context was changed to crypto_obj_id, intreduced a new crypto_type field where IPsec is the default zero type for backward compatibility. Action ipsec_decrypt was changed to crypto_decrypt. Action ipsec_encrypt was changed to crypto_encrypt. IPsec offload code was updated accordingly for backward compatibility. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit d1b2234b7fbf94348901bed4ea8d015c8a819d02 Author: Lior Nahmanson Date: Mon Sep 5 22:21:16 2022 -0700 net/mlx5: Removed esp_id from struct mlx5_flow_act esp_id is no longer in used Signed-off-by: Lior Nahmanson Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit b1671253c6015841f6cabd39730fa42fb6d3d407 Author: Lior Nahmanson Date: Mon Sep 5 22:21:15 2022 -0700 net/macsec: Move some code for sharing with various drivers that implements offload Move some MACsec infrastructure like defines and functions, in order to avoid code duplication for future drivers which implements MACsec offload. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Reviewed-by: Jiri Pirko Reviewed-by: Ben Ben-Ishay Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 860ead89b8517c57d34e5d0658443b461d628ab4 Author: Lior Nahmanson Date: Mon Sep 5 22:21:14 2022 -0700 net/macsec: Add MACsec skb_metadata_dst Rx Data path support Like in the Tx changes, if there are more than one MACsec device with the same MAC address as in the packet's destination MAC, the packet will be forward only to this device and not neccessarly to the desired one. Offloading device drivers will mark offloaded MACsec SKBs with the corresponding SCI in the skb_metadata_dst so the macsec rx handler will know to which port to divert those skbs, instead of wrongly solely relaying on dst MAC address comparison. Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 0a28bfd4971fd570d1f3e4653b21415becefc92c Author: Lior Nahmanson Date: Mon Sep 5 22:21:13 2022 -0700 net/macsec: Add MACsec skb_metadata_dst Tx Data path support In the current MACsec offload implementation, MACsec interfaces shares the same MAC address by default. Therefore, HW can't distinguish from which MACsec interface the traffic originated from. MACsec stack will use skb_metadata_dst to store the SCI value, which is unique per Macsec interface, skb_metadat_dst will be used by the offloading device driver to associate the SKB with the corresponding offloaded interface (SCI). Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit fa49364cd5e65797014688cba623541083b3e5b0 Author: Robin Murphy Date: Tue Aug 16 18:28:04 2022 +0100 iommu/dma: Move public interfaces to linux/iommu.h The iommu-dma layer is now mostly encapsulated by iommu_dma_ops, with only a couple more public interfaces left pertaining to MSI integration. Since these depend on the main IOMMU API header anyway, move their declarations there, taking the opportunity to update the half-baked comments to proper kerneldoc along the way. Signed-off-by: Robin Murphy Acked-by: Catalin Marinas Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/9cd99738f52094e6bed44bfee03fa4f288d20695.1660668998.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit de9f8a91eb32bb79149c4fc790df3b54ae710d18 Author: Robin Murphy Date: Tue Aug 16 18:28:03 2022 +0100 iommu/dma: Clean up Kconfig Although iommu-dma is a per-architecture chonce, that is currently implemented in a rather haphazard way. Selecting from the arch Kconfig was the original logical approach, but is complicated by having to manage dependencies; conversely, selecting from drivers ends up hiding the architecture dependency *too* well. Instead, let's just have it enable itself automatically when IOMMU API support is enabled for the relevant architectures. It can't get much clearer than that. Signed-off-by: Robin Murphy Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/2e33c8bc2b1bb478157b7964bfed976cb7466139.1660668998.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 29e932295bfaba792d29e66e8be0637ff3994724 Author: Robin Murphy Date: Mon Aug 15 17:20:17 2022 +0100 iommu: Clean up bus_set_iommu() Clean up the remaining trivial bus_set_iommu() callsites along with the implementation. Now drivers only have to know and care about iommu_device instances, phew! Reviewed-by: Kevin Tian Tested-by: Matthew Rosato # s390 Tested-by: Niklas Schnelle # s390 Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/ea383d5f4d74ffe200ab61248e5de6e95846180a.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 19d3607c74bc0332f0ee3a2d54ead6e792c0dce9 Author: Robin Murphy Date: Mon Aug 15 17:20:16 2022 +0100 iommu/virtio: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure path accordingly. Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/0ff6f9166081724510e6772e43d45b317cab8c58.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 48a7c5080a28ab5a5a454008965cdd19790c69ae Author: Robin Murphy Date: Mon Aug 15 17:20:15 2022 +0100 iommu/tegra-smmu: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure path accordingly. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/13bb6baa6c4d74e95a12529e4eb1ddfb3885c3b5.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit a24090860e7dfaef096c69cc791db6b281246e88 Author: Robin Murphy Date: Mon Aug 15 17:20:14 2022 +0100 iommu/omap: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the init failure path accordingly. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b578af8e2bf8afeccb2c2ce87c1aa38b36f01331.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 7341c365c3fb80f078e7d87f5f874b83a29e0e74 Author: Robin Murphy Date: Mon Aug 15 17:20:13 2022 +0100 iommu/mtk: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure paths accordingly. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9134322ecd24030eebeac73f37ca579094cc7df0.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit b87d6d7fa405e23478f1e1dff6d66b5a533a5433 Author: Robin Murphy Date: Mon Aug 15 17:20:12 2022 +0100 iommu/ipmmu-vmsa: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary. This also leaves the custom initcall effectively doing nothing but register the driver, which no longer needs to happen early either, so convert it to builtin_platform_driver(). Signed-off-by: Robin Murphy Reported-by: kernel test robot Link: https://lore.kernel.org/r/14377566e449950c19367f75ec1b09724bf0889f.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 2bba80c2bf521f56acabda2689dd4d89d8d70882 Author: Robin Murphy Date: Mon Aug 15 17:20:11 2022 +0100 iommu/exynos: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the init failure path accordingly. Tested-by: Marek Szyprowski Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d7477ef546479300217ca7bccb44da8b02715a07.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 006abbe36acdac4155a3422439935839bbf76c38 Author: Robin Murphy Date: Mon Aug 15 17:20:10 2022 +0100 iommu/dart: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure path accordingly. Tested-by: Sven Peter Reviewed-by: Sven Peter Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/afe138964196907d58147a686c1dcd6a12f9e210.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 2efbd29bb1105d46e3eb64c00db6d9a0aee232ff Author: Robin Murphy Date: Mon Aug 15 17:20:09 2022 +0100 iommu/arm-smmu-v3: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure path accordingly. Acked-by: Will Deacon Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/6235f07df013776656a61bb642023ecce07f46cc.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 3c34d1c2d7960e0af3204dc5c3d37324438bbcb2 Author: Robin Murphy Date: Mon Aug 15 17:20:08 2022 +0100 iommu/arm-smmu: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary. With device probes now replayed for every IOMMU instance registration, the whole sorry ordering workaround for legacy DT bindings goes too, hooray! Acked-by: Will Deacon Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/f7aaad3e479a78623a6942ed46937249168b55bd.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 31ee890a01fd2bb90f95e44ba441cccc47660f18 Author: Robin Murphy Date: Mon Aug 15 17:20:07 2022 +0100 iommu/amd: Clean up bus_set_iommu() Stop calling bus_set_iommu() since it's now unnecessary, and garbage-collect the last remnants of amd_iommu_init_api(). Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/6bcc367e8802ae5a2b2840cbe4e9661ee024e80e.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 57365a04c92126525a58bf7a1599ddfa832415e9 Author: Robin Murphy Date: Mon Aug 15 17:20:06 2022 +0100 iommu: Move bus setup to IOMMU device registration Move the bus setup to iommu_device_register(). This should allow bus_iommu_probe() to be correctly replayed for multiple IOMMU instances, and leaves bus_set_iommu() as a glorified no-op to be cleaned up next. At this point we can also handle cleanup better than just rolling back the most-recently-touched bus upon failure - which may release devices owned by other already-registered instances, and still leave devices on other buses with dangling pointers to the failed instance. Now it's easy to clean up the exact footprint of a given instance, no more, no less. Tested-by: Marek Szyprowski Reviewed-by: Krishna Reddy Reviewed-by: Kevin Tian Tested-by: Matthew Rosato # s390 Tested-by: Niklas Schnelle # s390 Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d342b6f27efb5ef3e93aacaa3012d25386d74866.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 580c00e64f121ad2d99e6f43796a49ea2cb4439d Author: Jilin Yuan Date: Wed Sep 7 19:39:27 2022 +0800 drm/gma500: fix repeated words in comments Delete the redundant word 'for'. Signed-off-by: Jilin Yuan Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220907113927.35305-1-yuanjilin@cdjrlc.com commit c13dbc1e24854908376c40ccaeb7a3a3c111e3af Author: Robin Murphy Date: Mon Aug 15 17:20:05 2022 +0100 iommu: Always register bus notifiers The number of bus types that the IOMMU subsystem deals with is small and manageable, so pull that list into core code as a first step towards cleaning up all the boilerplate bus-awareness from drivers. Calling iommu_probe_device() before bus->iommu_ops is set will simply return -ENODEV and not break the notifier call chain, so there should be no harm in proactively registering all our bus notifiers at init time. Tested-by: Marek Szyprowski Tested-by: Matthew Rosato # s390 Tested-by: Niklas Schnelle # s390 Signed-off-by: Robin Murphy Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/7462347bf938bd6eedb629a3a318434f6516e712.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 927a5fdd949a03a244c1f5b3e6103aaadd547542 Author: Matthew Rosato Date: Mon Aug 15 17:20:04 2022 +0100 iommu/s390: Fail probe for non-PCI devices s390-iommu only supports pci_bus_type today. Tested-by: Niklas Schnelle Signed-off-by: Matthew Rosato Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/8cb71ea1b24bd2622c1937bd9cfffe73b126eb56.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit cbc040081fdf7d73ef60112b24caa785b3f293f3 Author: Robin Murphy Date: Mon Aug 15 17:20:03 2022 +0100 iommu/amd: Handle race between registration and device probe As for the Intel driver, make sure the AMD driver can cope with seeing .probe_device calls without having to wait for all known instances to register first. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/a8d8ebe12b411d28972f1ab928c6db92e8913cf5.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit c919739ce4721ecf7b96b99253b032df30fcf19b Author: Robin Murphy Date: Mon Aug 15 17:20:02 2022 +0100 iommu/vt-d: Handle race between registration and device probe Currently we rely on registering all our instances before initially allowing any .probe_device calls via bus_set_iommu(). In preparation for phasing out the latter, make sure we won't inadvertently return success for a device associated with a known but not yet registered instance, otherwise we'll run straight into iommu_group_get_for_dev() trying to use NULL ops. That also highlights an issue with intel_iommu_get_resv_regions() taking dmar_global_lock from within a section where intel_iommu_init() already holds it, which already exists via probe_acpi_namespace_devices() when an ANDD device is probed, but gets more obvious with the upcoming change to iommu_device_register(). Since they are both read locks it manages not to deadlock in practice, and a more in-depth rework of this locking is underway, so no attempt is made to address it here. Reviewed-by: Kevin Tian Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/579f2692291bcbfc3ac64f7456fcff0d629af131.1660572783.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ca25ec247aadbff98083e92c5e79c198a16cd2db Author: Robin Murphy Date: Mon Aug 15 17:15:55 2022 +0100 iommu/io-pgtable-arm: Remove iommu_dev==NULL special case The special case to allow iommu_dev==NULL in __arm_lpae_alloc_pages() is confusing to static checkers (and possibly readers in general), since it's not obvious that that is only intended for the selftests. However it only serves to get around the dev_to_node() call, and we can easily fake up enough to make that work anyway, so let's simply remove this consideration from the normal flow and punt the responsibility over to the test harness itself. Reported-by: Rustam Subkhankulov Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e2095eeda305071cb56c2cb8ac8a82dc3bd4dcab.1660580155.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit df198b37e72c18c771d93ffbaf2176c0270505f3 Author: Robin Murphy Date: Mon Aug 15 16:26:50 2022 +0100 iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY better Assuming that any SMMU can enforce coherency for any device is clearly nonsense. Although technically even a single SMMU instance can be wired up to only be capable of emitting coherent traffic for some of the devices it translates, it's a fairly realistic approximation that if the SMMU's pagetable walker is wired up to a coherent interconnect then all its translation units probably are too, and conversely that lack of coherent table walks implies a non-coherent system in general. Either way it's still less inaccurate than what we've been claiming so far. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/106c9741415f0b6358c72d53ae9c78c553a2b45c.1660574547.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 359ad15763762c713a51300134e784a72eb9cb80 Author: Robin Murphy Date: Mon Aug 15 16:26:49 2022 +0100 iommu: Retire iommu_capable() With all callers now converted to the device-specific version, retire the old bus-based interface, and give drivers the chance to indicate accurate per-instance capabilities. Signed-off-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/d8bd8777d06929ad8f49df7fc80e1b9af32a41b5.1660574547.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit edcfc9c71bfd491e36ae93a3ea633fb55678f51f Author: Heiko Carstens Date: Mon Sep 5 14:36:19 2022 +0200 s390/ptdump: add missing amode31 markers Add amode31 markers which makes a ro mapping in the middle of nowhere in the kernel_page_tables output less magic. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit b193d2d4d01ecf211c935bcb7409a69768851c6e Author: Heiko Carstens Date: Mon Sep 5 14:18:27 2022 +0200 s390/mm: split lowcore pages with set_memory_4k() Use set_memory_4k() to split lowcore pages within the kernel mapping instead of using the quite subtle !addr check within modify_pmd_table() and modify_pud_table() to prevent large pages for address zero. With this lowcore might be mapped with 1MB / 2GB frames and only later will be split. This way this mapping is handled like every other. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 1f88d1e5f9e5d965c2208edc2c757eaff8960bca Author: Krzysztof Kozlowski Date: Mon Aug 8 13:15:25 2022 +0300 MAINTAINERS: pwm-fan: Drop Bartlomiej Zolnierkiewicz Bartlomiej's Samsung email address is not working since around last year and there was no follow up patch take over of the drivers, so drop the email from maintainers. Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808101526.46556-2-krzysztof.kozlowski@linaro.org commit 1d27e716805c6d8784122ab3d4ea4fc591c340e4 Author: Krzysztof Kozlowski Date: Tue Aug 30 21:09:27 2022 +0300 dt-bindings: media: samsung,exynos5250-gsc: convert to dtschema Convert the Samsung Exynos SoC G-Scaler bindings to DT schema. Changes done during conversion: 1. A typical (already used) properties like clocks, iommus and power-domains. 2. Require clocks, because they are essential for the block to operate. 3. Describe the differences in clocks between the Exynos5250/5420 and the Exynos5433 G-Scalers. This includes the fifth Exynos5433 clock "gsd" (GSCL Smart Deck) which was added to the DTS, but not to the bindings and Linux driver. Similarly to Exynos5433 DECON change [1], the clock should be used. [1] https://lore.kernel.org/all/6270db2d-667d-8d6f-9289-be92da486c25@samsung.com/ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220830180927.16686-1-krzysztof.kozlowski@linaro.org commit 4b9ef436383e8aa910b71927b3f25ede9b190707 Author: Andy Shevchenko Date: Tue Sep 6 19:10:48 2022 +0300 spi: nxp-fspi: Do not dereference fwnode in struct device In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific dev_fwnode() API for that. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220906161048.39953-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 3caac759681eeb31ac80e3cc14b972680c8bde54 Author: Kuninori Morimoto Date: Mon Sep 5 23:17:57 2022 +0000 ASoC: soc-dapm.c: fixup snd_soc_dapm_new_control_unlocked() error handling Current snd_soc_dapm_new_control_unlocked() error handling is wrong. It is using "goto request_failed" (A), but error message is using "w->name" (B) which is not yet created in such timing. snd_soc_dapm_new_control_unlocked(xxx) { ... switch (w->id) { case xxx: ... if (IS_ERR(...)) { ret = PTR_ERR(...); (A) goto request_failed; } ... } prefix = soc_dapm_prefix(...); if (prefix) (B) w->name = kasprintf(...); else (B) w->name = kstrdup_const(...); ... (A) request_failed: if (ret != -EPROBE_DEFER) (B) dev_err(..., w->name, ...); return ...; } we can create "w->name" at beginning of this function. In such case, we need to call kfree_const(w->name) at error case. This patch do these. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wnah8l7e.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 427de091a7112aa8eaf2f689e95c0dbca5ea6543 Author: Kuninori Morimoto Date: Mon Sep 5 23:17:43 2022 +0000 ASoC: soc-dapm.c: don't use WARN_ON() at snd_soc_dai_link_event_pre_pmu() Current snd_soc_dai_link_event_pre_pmu() is checking "config". It is using dev_err() (A) if it was NULL, so we don't need to use WARN_ON() (B) to check it, it is over-kill. This patch removes it. (B) if (WARN_ON(!config)) { (A) dev_err(...); ... } Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zgfd8l7s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 26cc2a788a1903da3ccff97061099f091255ecaf Author: Andy Shevchenko Date: Thu Sep 1 00:27:44 2022 +0300 regmap: spi-avmm: Use swabXX_array() helpers Since we have a few helpers to swab elements of a given size in an array use them instead of open coded variants. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220831212744.56435-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 400dceb6f8b56472b36c5c2c8c3e0cbb7557d019 Author: Andy Shevchenko Date: Thu Sep 1 00:27:43 2022 +0300 regmap: mmio: Use swabXX_array() helpers Since we have a few helpers to swab elements of a given size in an array use them instead of open coded variants. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220831212744.56435-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 2d4697375dea514be202abf563a9419e74489c25 Author: Andy Shevchenko Date: Thu Sep 1 00:27:42 2022 +0300 swab: Add array operations For now, some simple array operations to swab. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220831212744.56435-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit e9d967679e803e7472f06642156f0bb029e26655 Author: Krzysztof Kozlowski Date: Tue Sep 6 14:11:10 2022 +0200 ASoC: dt-bindings: qcom,q6core: remove binding qcom,q6core is already described in soc/qcom/qcom,apr.yaml. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220906121110.301900-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 355beeed9319cf3ceea56c7dec874a8a9c443771 Author: Dmitry Torokhov Date: Tue Sep 6 12:06:09 2022 -0700 ASoC: simple-card-utils: switch to using gpiod API This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/YxeaITtlJexygQo9@google.com Signed-off-by: Mark Brown commit 8a7d5d85ed2161869452ddb9ec45345dad665f52 Author: AngeloGioacchino Del Regno Date: Tue Sep 6 11:27:27 2022 +0200 ASoC: SOF: mediatek: mt8195: Add devicetree support to select topologies Support devicetree by adding a snd_soc_of_mach array, specifying SOF topologies for a generic MT8195 machine and for Google Tomato Chromebooks. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220906092727.37324-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit cf84edeeb95ee8e76f12bb02a7444876d031bea7 Author: AngeloGioacchino Del Regno Date: Tue Sep 6 11:27:26 2022 +0200 ASoC: SOF: mediatek: mt8195: Add generic pcm_{open,close} callbacks Use the generic sof_stream_pcm_{open,close}() functions for the pcm_{open,close} callbacks. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220906092727.37324-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit c2186a9b3a98f1ff814996aa52a019158bfad9c9 Author: AngeloGioacchino Del Regno Date: Tue Sep 6 11:27:25 2022 +0200 ASoC: SOF: mediatek: mt8195: Add mailbox generic callbacks for IPC Add the .mailbox_{read,write} generic callbacks for SOF IPC and, while at it, also change the ipc_msg_data callback to use the SOF API sof_ipc_msg_data() instead of the custom function mt8195_ipc_msg_data(). Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220906092727.37324-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 404bec4c8f6c38ae5fa208344f1086d38026e93d Author: AngeloGioacchino Del Regno Date: Tue Sep 6 11:27:24 2022 +0200 ASoC: SOF: mediatek: mt8195: Import namespace SND_SOC_SOF_MTK_COMMON Here we're using function mtk_adsp_dump() from mtk-adsp-common: explicitly import its namespace. Fixes: 3a054f90e955 ("ASoC: SOF: mediatek: Add mt8195 debug dump") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220906092727.37324-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 64ec924c781ee846bd469be8d1d6bbed78c0f439 Author: AngeloGioacchino Del Regno Date: Tue Sep 6 11:27:23 2022 +0200 ASoC: mediatek: mt8195-mt6359: Properly register sound card for SOF Adding a probe callback on this snd_soc_card is required when Sound Open Firmware support is desired, as we need to appropriately populate the stream_name for SOF to be able to bind widgets. Failing to do so will produce errors when applying the SOF topology leading to card registration failure (so, no sound). While at it, also make sure to fill the topology_shortname as required. Fixes: 0caf1120c583 ("ASoC: mediatek: mt8195: extract SOF common code") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220906092727.37324-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit da7d8e65b3fcebce0a2f606669cabce64fca0475 Merge: 98ba81081b429 e7af210e6dd0d Author: David S. Miller Date: Wed Sep 7 12:33:44 2022 +0100 Merge branch 'netlink-be-policy' Signed-off-by: David S. Miller commit e7af210e6dd0de633d3f4850383310cf57473bc8 Author: Florian Westphal Date: Mon Sep 5 12:09:37 2022 +0200 netfilter: nft_payload: reject out-of-range attributes via policy Now that nla_policy allows range checks for bigendian data make use of this to reject such attributes. At this time, reject happens later from the init or select_ops callbacks, but its prone to errors. In the future, new attributes can be handled via NLA_POLICY_MAX_BE and exiting ones can be converted one by one. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 08724ef69907214ce622344fe4945412e38368f0 Author: Florian Westphal Date: Mon Sep 5 12:09:36 2022 +0200 netlink: introduce NLA_POLICY_MAX_BE netlink allows to specify allowed ranges for integer types. Unfortunately, nfnetlink passes integers in big endian, so the existing NLA_POLICY_MAX() cannot be used. At the moment, nfnetlink users, such as nf_tables, need to resort to programmatic checking via helpers such as nft_parse_u32_check(). This is both cumbersome and error prone. This adds NLA_POLICY_MAX_BE which adds range check support for BE16, BE32 and BE64 integers. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 98ba81081b429d147c0230f59a999aa80d0b9d33 Merge: 13248b9750382 e4616f64726bf Author: David S. Miller Date: Wed Sep 7 12:23:25 2022 +0100 Merge branch 'sfc-ptp' Edward Cree says: ==================== sfc: add support for PTP over IPv6 and 802.3 Most recent cards (8000 series and newer) had enough hardware support for this, but it was not enabled in the driver. The transmission of PTP packets over these protocols was already added in commit bd4a2697e5e2 ("sfc: use hardware tx timestamps for more than PTP"), but receiving them was already unsupported so synchronization didn't happen. These patches add support for timestamping received packets over IPv6/UPD and IEEE802.3. v2: fixed weird indentation in efx_ptp_init_filter v3: fixed bug caused by usage of htons in PTP_EVENT_PORT definition. It was used in more places, where htons was used too, so using it 2 times leave it again in host order. I didn't detected it in my tests because it only affected if timestamping through the MC, but the model I used do it through the MAC. Detected by kernel test robot v4: removed `inline` specifiers from 2 local functions v5: restored deleted comment with useful explanation about packets reordering. Deleted useless whitespaces. ==================== Reviewed-by: Edward Cree Signed-off-by: David S. Miller commit e4616f64726bfe3362712b403b70f9d3bcde166a Author: Íñigo Huguet Date: Mon Sep 5 10:23:23 2022 +0200 sfc: support PTP over Ethernet The previous patch add support for PTP over IPv6/UDP (only for 8000 series and newer) and this one add support for PTP over 802.3. Tested: sync as master and as slave is correct with ptp4l. PTP over IPv4 and IPv6 still works fine. Suggested-by: Edward Cree Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 621918c45fdc6554981c01f5517d5b0dc33de4ae Author: Íñigo Huguet Date: Mon Sep 5 10:23:22 2022 +0200 sfc: support PTP over IPv6/UDP commit bd4a2697e5e2 ("sfc: use hardware tx timestamps for more than PTP") added support for hardware timestamping on TX for cards of the 8000 series and newer, in an effort to provide support for other transports other than IPv4/UDP. However, timestamping was still not working on RX for these other transports. This patch add support for PTP over IPv6/UDP. Tested: sync as master and as slave is correct using ptp4l from linuxptp package, both with IPv4 and IPv6. Suggested-by: Edward Cree Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 313aa13a071761f3652194ee8e97cde3b22f7c3a Author: Íñigo Huguet Date: Mon Sep 5 10:23:21 2022 +0200 sfc: allow more flexible way of adding filters for PTP In preparation for the support of PTP over IPv6/UDP and Ethernet in next patches, allow a more flexible way of adding and removing RX filters for PTP. Right now, only 2 filters are allowed, which are the ones needed for PTP over IPv4/UDP. Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 4da7aad41c8f6fcccb37e2c95a07c84835effd7d Author: Zongmin Zhou Date: Wed Sep 7 17:44:23 2022 +0800 drm/qxl: fix the suspend/resume issue on qxl device Details: Currently, when trying to suspend and resume with qxl device, there are some error messages after resuming, eventually caused to black screen and can't be recovered. The first error message: [ 64.668577][ C3] [drm] driver is in bug mode This error is due to guest qxl driver will call qxl_reinit_memslots(qdev) during system resume, but didn't call qxl_io_reset(qdev) before this, Then will cause the QXL_IO_MEMSLOT_ADD operation to fail on QEMU, qxl->guest_bug flag will be set,As a result, the QXL device can't communicate with guest qxl driver through the IO port. after fix the first error,can success to resume and login to desktop, but shortly after that will observe the second error message : [ 353.095343][ T863] qxl 0000:00:02.0: object_init failed for (262144, 0x00000001) [ 353.096660][ T863] [drm:qxl_gem_object_create [qxl]] *ERROR* Failed to allocate GEM object (260852, 1, 4096, -12) [ 353.097277][ T863] [drm:qxl_alloc_ioctl [qxl]] *ERROR* qxl_alloc_ioctl: failed to create gem ret=-12 [ 368.197538][ T863] qxl 0000:00:02.0: object_init failed for (3149824, 0x00000001) [ 368.197541][ T863] [drm:qxl_alloc_bo_reserved [qxl]] *ERROR* failed to allocate VRAM BO The problem is caused by calling qxl_ring_init_hdr(qdev->release_ring) in qxl_drm_resume() function. When do QXL_IO_RESET,QEMU will call init_qxl_ram(), so params like prod,cons,notify_on_cons and notify_on_prod will be set to default value. Ring push/pop actions for release_ring can be performed normally. But call qxl_ring_init_hdr(qdev->release_ring) will eventually set notify_on_prod to number of QXL_RELEASE_RING_SIZE, affect the value of notify in qxl_push_free_res() function always be false, QEMU will no longer send events of QXL_INTERRUPT_DISPLAY to the guest qxl driver,so qxl_ring_pop() will never been called anymore, and can't do dma_fence_signal(),result to ttm_bo_wait_ctx(bo, ctx) always return EBUSY,fail to call qxl_bo_create(). Test scenario: 1) start virtual machine with qemu command "-device qxl-vga" 2) click suspend botton to enter suspend mode 3) resume and observe the error message in kernel logs,screen will be black Let's fix this by reset io and remove the qxl_ring_init_hdr calling. Signed-off-by: Zongmin Zhou Suggested-by: Ming Xie Link: http://patchwork.freedesktop.org/patch/msgid/20220907094423.93581-1-min_halo@163.com Signed-off-by: Gerd Hoffmann commit e740ceb53e4579a7a4063712cebecac3c343b189 Author: Gerd Hoffmann Date: Tue Sep 6 16:29:57 2022 +0200 drm/bochs: fix blanking VGA_IS1_RC is the color mode register (VGA_IS1_RM the one for monochrome mode, note C vs. M at the end). So when using VGA_IS1_RC make sure the vga device is actually in color mode and set the corresponding bit in the misc register. Reproducible when booting VMs in UEFI mode with some edk2 versions (edk2 fix is on the way too). Doesn't happen in BIOS mode because in that case the vgabios already flips the bit. Fixes: 250e743915d4 ("drm/bochs: Add screen blanking support") Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann Link: http://patchwork.freedesktop.org/patch/msgid/20220906142957.2763577-1-kraxel@redhat.com commit 85faca8ca0f659263b5fb2385e4c231cc075bd84 Author: Chia-I Wu Date: Wed Aug 31 12:06:01 2022 -0700 drm/virtio: set fb_modifiers_not_supported Without this, the drm core advertises LINEAR modifier which is incorrect. Also userspace virgl does not support modifiers. For example, it causes chrome on ozone/drm to fail with "Failed to create scanout buffer". Fixes: 2af104290da5 ("drm: introduce fb_modifiers_not_supported flag in mode_config") Suggested-by: Shao-Chuan Lee Signed-off-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/20220831190601.1295129-1-olvaffe@gmail.com Signed-off-by: Gerd Hoffmann commit 13248b975038241be329388a9a707dd12fdd5466 Author: Jerry Ray Date: Fri Sep 2 16:30:21 2022 -0500 net: dsa: LAN9303: Add basic support for LAN9354 Adding support for the LAN9354 device by allowing it to use the LAN9303 DSA driver. These devices have the same underlying access and control methods and from a feature set point of view the LAN9354 is a superset of the LAN9303. The MDIO access method has been tested on a SAMA5D3-EDS board with a LAN9354 RMII daughter card. While the SPI access method should also be the same, it has not been tested and as such is not included at this time. Signed-off-by: Jerry Ray Signed-off-by: David S. Miller commit 732f374e23a9ae05dbc13825e4b02b3abce9f9aa Author: Jerry Ray Date: Fri Sep 2 16:30:20 2022 -0500 net: dsa: LAN9303: Add early read to sync Add initial BYTE_ORDER read to sync the 32-bit accesses over the 16-bit mdio bus to improve driver robustness. The lan9303 expects two mdio read transactions back-to-back to read a 32-bit register. The first read transaction causes the other half of the 32-bit register to get latched. The subsequent read returns the latched second half of the 32-bit read. The BYTE_ORDER register is an exception to this rule. As it is a constant value, there is no need to latch the second half. We read this register first in case there were reads during the boot loader process that might have occurred prior to this driver taking over ownership of accessing this device. This patch has been tested on the SAMA5D3-EDS with a LAN9303 RMII daughter card. Signed-off-by: Jerry Ray Signed-off-by: David S. Miller commit 6674e7fd3beaf745b2e9d281a66f925a13de8ea7 Author: Romain Naour Date: Fri Sep 2 12:16:10 2022 +0200 net: dsa: microchip: add regmap_range for KSZ9896 chip Add register validation for KSZ9896. Signed-off-by: Romain Naour Signed-off-by: David S. Miller commit 3a8b8ea6c7c298482e54c6abee006c400b7aa568 Author: Romain Naour Date: Fri Sep 2 12:16:09 2022 +0200 net: dsa: microchip: ksz9477: remove 0x033C and 0x033D addresses from regmap_access_tables According to the KSZ9477S datasheet, there is no global register at 0x033C and 0x033D addresses. Signed-off-by: Romain Naour Cc: Oleksij Rempel Tested-by: Oleksij Rempel Signed-off-by: David S. Miller commit 13767525929db1693b24555c07878d8cb3a274be Author: Romain Naour Date: Fri Sep 2 12:16:08 2022 +0200 net: dsa: microchip: add KSZ9896 to KSZ9477 I2C driver Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the ksz9477 driver. The KSZ9896 supports both SPI (already in) and I2C. Signed-off-by: Romain Naour Signed-off-by: David S. Miller commit 2eb3ff3c09082bb4792f2149cf6582e2626a5e30 Author: Romain Naour Date: Fri Sep 2 12:16:07 2022 +0200 net: dsa: microchip: add KSZ9896 switch support Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the ksz9477 driver. Although the KSZ9896 is already listed in the device tree binding documentation since a1c0ed24fe9b (dt-bindings: net: dsa: document additional Microchip KSZ9477 family switches) the chip id (0x00989600) is not recognized by ksz_switch_detect() and rejected by the driver. The KSZ9896 is similar to KSZ9897 but has only one configurable MII/RMII/RGMII/GMII cpu port. Signed-off-by: Romain Naour Signed-off-by: David S. Miller commit 939838632b9119614128028eaea3b1d7bf29f16f Author: Yishai Hadas Date: Mon Sep 5 13:58:44 2022 +0300 net/mlx5: Query ADV_VIRTUALIZATION capabilities Query ADV_VIRTUALIZATION capabilities which provide information for advanced virtualization related features. Current capabilities refer to the page tracker object which is used for tracking the pages that are dirtied by the device. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220905105852.26398-3-yishaih@nvidia.com Signed-off-by: Leon Romanovsky commit a1be74c5384c4a47d91ab4af2ed854d3b7eaf763 Author: Yishai Hadas Date: Mon Sep 5 13:58:43 2022 +0300 net/mlx5: Introduce ifc bits for page tracker Introduce ifc related stuff to enable using page tracker. A page tracker is a dirty page tracking object used by the device to report the tracking log. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20220905105852.26398-2-yishaih@nvidia.com Signed-off-by: Leon Romanovsky commit bf75eb44e11bcdb1edda3305dc7292b605c25172 Author: Yuan Can Date: Mon Aug 15 03:14:23 2022 +0000 iommu: Remove duplicate ida_free in iommu_group_alloc In the iommu_group_alloc, when the kobject_init_and_add failed, the group->kobj is associate with iommu_group_ktype, thus its release function iommu_group_release will be called by the following kobject_put. The iommu_group_release calls ida_free with the group->id, so we do not need to do it before kobject_put. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220815031423.94548-1-yuancan@huawei.com Signed-off-by: Joerg Roedel commit 283945017cbf685546ba7d065f254ad77eb888b1 Author: Yuan Can Date: Mon Aug 15 01:33:39 2022 +0000 iommu: Remove comment of dev_has_feat in struct doc dev_has_feat has been removed from iommu_ops in commit 309c56e84602 ("iommu: remove the unused dev_has_feat method"), remove its description in the struct doc. Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20220815013339.2552-1-yuancan@huawei.com Signed-off-by: Joerg Roedel commit 184233a5202786b20220acd2d04ddf909ef18f29 Author: Dan Carpenter Date: Thu Aug 4 17:32:39 2022 +0300 iommu/omap: Fix buffer overflow in debugfs There are two issues here: 1) The "len" variable needs to be checked before the very first write. Otherwise if omap2_iommu_dump_ctx() with "bytes" less than 32 it is a buffer overflow. 2) The snprintf() function returns the number of bytes that *would* have been copied if there were enough space. But we want to know the number of bytes which were *actually* copied so use scnprintf() instead. Fixes: bd4396f09a4a ("iommu/omap: Consolidate OMAP IOMMU modules") Signed-off-by: Dan Carpenter Reviewed-by: Robin Murphy Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/YuvYh1JbE3v+abd5@kili Signed-off-by: Joerg Roedel commit 0c9ccaf24efa5b8f728445272ebc84754da2a512 Author: Andy Shevchenko Date: Mon Aug 1 19:51:42 2022 +0300 iommu/virtio: Do not dereference fwnode in struct device In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific device_match_fwnode() API for that. Signed-off-by: Andy Shevchenko Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20220801165142.20898-1-andriy.shevchenko@linux.intel.com Signed-off-by: Joerg Roedel commit 927d8f272e4f2ff20acbf3d4c21119b0e9d17cc2 Author: Andy Shevchenko Date: Mon Aug 1 19:47:58 2022 +0300 iommu: Do not dereference fwnode in struct device In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific dev_fwnode() API for that. Signed-off-by: Andy Shevchenko Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220801164758.20664-1-andriy.shevchenko@linux.intel.com Signed-off-by: Joerg Roedel commit fad08d6248f88c9420eff5471ad34978a5c6c805 Author: Maxime Ripard Date: Mon Aug 29 15:11:54 2022 +0200 drm/sun4i: tv: Add missing reset assertion The reset line is deasserted at bind, and asserted if we ever encounter an error there. However, it's never asserted in unbind which will lead to a resource unbalance. Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-40-459522d653a7@cerno.tech commit 7c4180b151fca559d2bf1bf321f35ac8509fdc8c Author: Maxime Ripard Date: Mon Aug 29 15:11:53 2022 +0200 drm/sun4i: tv: Rename error label The other error labels in sun4i_tv_bind() are named after the task they perform (err_disable_clk to call clk_disable_unprepare for example). However, the err_cleanup_connector is named after the calling site (drm_connector_init failing) and will actually cleanup the encoder. Let's rename it to err_cleanup_encoder to be consistent. Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-39-459522d653a7@cerno.tech commit 18294b74db2fee99142f4ae027cf0c88eb544654 Author: Maxime Ripard Date: Mon Aug 29 15:11:52 2022 +0200 drm/sun4i: tv: Remove useless destroy function Our destroy implementation is just calling the generic helper, so let's just remove our function and directly use the helper. Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-38-459522d653a7@cerno.tech commit dcc22148673dbc02e33c220d9d6446005c9497c7 Author: Maxime Ripard Date: Mon Aug 29 15:11:51 2022 +0200 drm/sun4i: tv: Remove useless function The drm_connector_to_sun4i_tv() function isn't used anywhere in the driver, so let's remove it. Acked-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-37-459522d653a7@cerno.tech commit 5233860da01038e0b4ce20bc68d871cb9caa7109 Author: Maxime Ripard Date: Mon Aug 29 15:11:49 2022 +0200 drm/sun4i: tv: Convert to atomic hooks The sun4i TV driver still uses legacy enable and disable hook implementation. Let's convert to the atomic variants. Acked-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-35-459522d653a7@cerno.tech commit fcb9229b72866f1af4630773d878dd67b3947f89 Author: Maxime Ripard Date: Mon Aug 29 15:11:48 2022 +0200 drm/sun4i: tv: Remove unused mode_valid The mode_valid implementation is pretty much a nop, let's remove it. Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-34-459522d653a7@cerno.tech commit 30d7565be96b3946c18a1ce3fd538f7946839092 Author: Mateusz Kwiatkowski Date: Mon Aug 29 15:11:42 2022 +0200 drm/vc4: vec: Fix timings for VEC modes This commit fixes vertical timings of the VEC (composite output) modes to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R standards. Previous timings were actually defined as 502 and 601 lines, resulting in non-standard 62.69 Hz and 52 Hz signals being generated, respectively. Signed-off-by: Mateusz Kwiatkowski Acked-by: Noralf Trønnes Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-28-459522d653a7@cerno.tech commit 296674b936b12837f94590812cfabc5aa4a9a950 Author: Mateusz Kwiatkowski Date: Mon Aug 29 15:11:41 2022 +0200 drm/vc4: vec: Remove redundant atomic_mode_set Let's remove the superfluous tv_mode field, which was redundant with the mode field in struct drm_tv_connector_state. Signed-off-by: Mateusz Kwiatkowski Reviewed-by: Noralf Trønnes Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-27-459522d653a7@cerno.tech commit 36893e45b1922f1c3ad91301724fafc4798f1e5f Author: Manikanta Pubbisetty Date: Thu Sep 1 13:36:56 2022 +0530 ath11k: Enable remain-on-channel support on WCN6750 Enable remain on channel support on WCN6750 as it is needed for GAS, Passpoint. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220901080656.3450-1-quic_mpubbise@quicinc.com commit 38baec94ca584b7370c78b0fc445ef5def269ac6 Author: Mateusz Kwiatkowski Date: Mon Aug 29 15:11:40 2022 +0200 drm/vc4: vec: Refactor VEC TV mode setting Change the mode_set function pointer logic to declarative config0, config1 and custom_freq fields, to make TV mode setting logic more concise and uniform. Signed-off-by: Mateusz Kwiatkowski Reviewed-by: Noralf Trønnes [Maxime: Fixed != 0 check, added tv_mode variable] Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-26-459522d653a7@cerno.tech commit eaa1a955094b20ca4b1c5064200d140b27f8d96f Author: Lad Prabhakar Date: Wed Sep 7 09:00:56 2022 +0100 clocksource/drivers/renesas-ostm: Add support for RZ/V2L SoC The OSTM block is identical on Renesas RZ/G2L and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G044 and ARCH_R9A07G054. With the above change OSTM will be enabled on RZ/V2L SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220907080056.3460-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit 336f29e0f8564e317e42b9eef6e2c17e838944f4 Author: Maxime Ripard Date: Mon Aug 29 15:11:39 2022 +0200 drm/vc4: vec: Convert to atomic helpers The VC4 VEC driver still uses legacy enable and disable hook implementation. Let's convert to the atomic variants. Reviewed-by: Noralf Trønnes Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-25-459522d653a7@cerno.tech commit 857dbf2431ba8abcd6f0f1335ea637580ebe5507 Author: Maxime Ripard Date: Mon Aug 29 15:11:38 2022 +0200 drm/vc4: vec: Remove empty mode_fixup The mode_fixup hooks are deprecated, and the behaviour we implement is the default one anyway. Let's remove it. Reviewed-by: Noralf Trønnes Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-24-459522d653a7@cerno.tech commit 8f15a8d6786c031b230e46077acbe1e07fabb5ce Author: Johannes Berg Date: Sun Sep 4 21:29:12 2022 +0200 wifi: b43: remove empty switch statement There's a TODO here, just move the dependency on phy->rev into the comment. Not that this driver is likely to get any updates. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.ea00a892e41b.I709217fc307125f8670c7f6a9093111b46194131@changeid commit 53b17c121f29d6bf8547f8823650a8d134e7afb6 Author: Johannes Berg Date: Sun Sep 4 21:29:11 2022 +0200 wifi: cw1200: use get_unaligned_le64() Instead of the code here that copies into a variable first and then flips endianness, which confuses sparse, just directly use get_unaligned_le64(). Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.a5c9ea122f0f.If786a66f8fd9d45659cd5a2532cf395e21334453@changeid commit df8e1af22cee900826112e8e4612cbeb2b168929 Author: Johannes Berg Date: Sun Sep 4 21:29:10 2022 +0200 wifi: cw1200: remove RCU STA pointer handling in TX We can call this in one of two ways: through mac80211, where we're already in an RCU read-side critical section, or from some other code in the driver where this pointer can only be NULL. In any case, we get a 'free' already protected pointer to the sta through info->control.sta, so we can use it on the stack without any further protection. Remove the rcu_dereference() and critical section. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.e5bc20dd17bf.Ib570ff7fde33c2b6eddef493a3541fa04eb47181@changeid commit fbe7e18581ef55114258843358727c0cfeaa2860 Author: Johannes Berg Date: Sun Sep 4 21:29:09 2022 +0200 wifi: mwifiex: fix endian annotations in casts These cause sparse warnings, and since the device generally works in little endian we can assume the code is correct, so just fix the casts accordingly. No binary changes on x86. Signed-off-by: Johannes Berg Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.3f72609a3825.If4048592701bf04981be1dab18eaaa339b2ea382@changeid commit e1ff3b48996a2db47579b1817113736f66b18b1c Author: Johannes Berg Date: Sun Sep 4 21:29:08 2022 +0200 wifi: mwifiex: fix endian conversion Clearly the value should be converted and then compared, not the result of the comparison be converted. No binary changes on x86. Signed-off-by: Johannes Berg Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.a32e45adb2b2.I8c966b07c0bf7be4485967b044d9dad3f4772a27@changeid commit 3208ae450248f2f61f272a2c0e85c303663b0912 Author: Johannes Berg Date: Sun Sep 4 21:29:06 2022 +0200 wifi: mwifiex: mark a variable unused We need to read a value from the device to wake it, but if it succeeds we don't really care about it. Mark the variable to avoid a compiler warning. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.5d67f55178a1.If0789ab326935896e5886fa06dbb9ef0da6c0b41@changeid commit 9d5b665775d6fdfca5ec4ccadcbfda614e2e0a9c Author: Johannes Berg Date: Sun Sep 4 21:29:05 2022 +0200 wifi: wl18xx: add some missing endian conversions This caused sparse warnings, and clearly is needed per how other firmware interfaces behave. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.2b5cb713cf4b.Ibabba2deb7bb22863d3a134e7a3333422d7eff17@changeid commit a08e3518bf45eec8eceff4704a04911057cbe39d Author: Johannes Berg Date: Sun Sep 4 21:29:03 2022 +0200 wifi: libertas: fix a couple of sparse warnings - endian swapping is required in one place, use the already swapped 'bsssize' local - lbs_disablemesh need not be exported and can be static Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.76c34b2ae7a0.Ieb97c72b6d26f9d695cc4ab10fa7af5c3509612b@changeid commit 76a8c54c53d8f928e720f3c6de6bfe4d1a7792f0 Author: Johannes Berg Date: Sun Sep 4 21:29:01 2022 +0200 wifi: ipw2100: fix warnings about non-kernel-doc Just remove the extra asterisk to make it not be kernel-doc formatted. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220904212910.8169e8c9090c.I0357e80cc86be2d4ac6205d1f53568444dcf7c9b@changeid commit edd5747aa12ed61a5ecbfa58d3908623fddbf1e8 Author: Bitterblue Smith Date: Wed Aug 31 19:12:36 2022 +0300 wifi: rtl8xxxu: Fix skb misuse in TX queue selection rtl8xxxu_queue_select() selects the wrong TX queues because it's reading memory from the wrong address. It expects to find ieee80211_hdr at skb->data, but that's not the case after skb_push(). Move the call to rtl8xxxu_queue_select() before the call to skb_push(). Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7fa4819a-4f20-b2af-b7a6-8ee01ac49295@gmail.com commit e56a770883b2f5eaf2d99620e5574dc0d2d6f11e Author: Jinpeng Cui Date: Wed Aug 31 13:22:54 2022 +0000 wifi: brcmfmac: remove redundant variable err Return value from brcmf_fil_iovar_data_set() and brcmf_config_ap_mgmt_ie() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220831132254.303697-1-cui.jinpeng2@zte.com.cn commit be376df724aa3b7abdf79390eaab60c58a92f4f0 Author: Marek Vasut Date: Sat Aug 27 04:49:03 2022 +0200 wifi: brcmfmac: add 43439 SDIO ids and initialization Add HW and SDIO ids for use with the muRata 1YN (Cypress CYW43439). Add the firmware mapping structures for the CYW43439 chipset. The 43439 needs some things setup similar to the 43430 chipset. Signed-off-by: Marek Vasut Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220827024903.617294-1-marex@denx.de commit 98d3f063be78ca71b578bc3fcf71033a335273db Author: Zheyu Ma Date: Thu Aug 18 15:33:52 2022 +0800 wifi: rtl8xxxu: Simplify the error handling code Since the logic of the driver's error handling code has changed, the previous dead store and checks are not needed. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Zheyu Ma Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220818073352.3156288-1-zheyuma97@gmail.com commit 5db68fd319583ed3a2b54e4d452b53a66b9d498c Author: Shaomin Deng Date: Thu Aug 11 11:20:43 2022 -0400 bcma: Fix typo in comments Remove the repeated word "registers" in comments. Signed-off-by: Shaomin Deng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220811152043.11446-1-dengshaomin@cdjrlc.com commit 3d784bade0fd0023d10dc51f2227f2c7cbb369dc Author: Jason Wang Date: Thu Aug 11 20:03:40 2022 +0800 wifi: p54: Fix comment typo The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220811120340.12968-1-wangborong@cdjrlc.com commit ed03a2af74d2adc1b09f725e79807ee49e5525d6 Author: Jason Wang Date: Thu Aug 11 20:02:01 2022 +0800 wifi: mwifiex: Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220811120201.10824-1-wangborong@cdjrlc.com commit 7d6e30dfcc723b8fe86e5413640ac229a37310ab Author: Hans de Goede Date: Wed Aug 10 16:23:33 2022 +0200 wifi: brcmfmac: Add DMI nvram filename quirk for Chuwi Hi8 Pro tablet The Chuwi Hi8 Pro tablet contains quite generic names in the sys_vendor and product_name DMI strings, without this patch brcmfmac will try to load: "brcmfmac43430a0-sdio.Default string-Default string.txt" as nvram file which is way too generic. The Chuwi Hi8 Pro uses the same Ampak AP6212 module as the Chuwi Vi8 Plus and the nvram for the Vi8 Plus is already in linux-firmware, so point the new DMI nvram filename quirk to the Vi8 Plus nvram file. Signed-off-by: Hans de Goede Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220810142333.141044-1-hdegoede@redhat.com commit d173d0207bda8173b27a38cae439a2f904d4f7c8 Author: Hans de Goede Date: Wed Aug 10 16:23:28 2022 +0200 wifi: brcmfmac: Use ISO3166 country code and rev 0 as fallback on 43430 Many devices ship with a nvram ccode value of X2/XT/XU/XV/ALL which are all special world-wide compatibility ccode-s. Most of these world-wide ccode-s allow passive scan mode only for 2.4GHz channels 12-14, only enabling them when an AP is seen on them. Since linux-firmware has moved to the new cyfmac43430-sdio.bin + cyfmac43430-sdio.clm_blob firmware files this no longer works and 43430 devices using e.g. an X2 ccode fail to connect to an AP on channel 13. Add the 43430 chip-id to the list of chips for which to use the ISO3166 country code + rev 0 as fallback in brcmf_translate_country_code() to fix this. Signed-off-by: Hans de Goede Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220810142328.141030-1-hdegoede@redhat.com commit 3f42faf6db431e04bf942d2ebe3ae88975723478 Author: Alexander Coffin Date: Mon Aug 8 10:49:26 2022 -0700 wifi: brcmfmac: fix use-after-free bug in brcmf_netdev_start_xmit() > ret = brcmf_proto_tx_queue_data(drvr, ifp->ifidx, skb); may be schedule, and then complete before the line > ndev->stats.tx_bytes += skb->len; [ 46.912801] ================================================================== [ 46.920552] BUG: KASAN: use-after-free in brcmf_netdev_start_xmit+0x718/0x8c8 [brcmfmac] [ 46.928673] Read of size 4 at addr ffffff803f5882e8 by task systemd-resolve/328 [ 46.935991] [ 46.937514] CPU: 1 PID: 328 Comm: systemd-resolve Tainted: G O 5.4.199-[REDACTED] #1 [ 46.947255] Hardware name: [REDACTED] [ 46.954568] Call trace: [ 46.957037] dump_backtrace+0x0/0x2b8 [ 46.960719] show_stack+0x24/0x30 [ 46.964052] dump_stack+0x128/0x194 [ 46.967557] print_address_description.isra.0+0x64/0x380 [ 46.972877] __kasan_report+0x1d4/0x240 [ 46.976723] kasan_report+0xc/0x18 [ 46.980138] __asan_report_load4_noabort+0x18/0x20 [ 46.985027] brcmf_netdev_start_xmit+0x718/0x8c8 [brcmfmac] [ 46.990613] dev_hard_start_xmit+0x1bc/0xda0 [ 46.994894] sch_direct_xmit+0x198/0xd08 [ 46.998827] __qdisc_run+0x37c/0x1dc0 [ 47.002500] __dev_queue_xmit+0x1528/0x21f8 [ 47.006692] dev_queue_xmit+0x24/0x30 [ 47.010366] neigh_resolve_output+0x37c/0x678 [ 47.014734] ip_finish_output2+0x598/0x2458 [ 47.018927] __ip_finish_output+0x300/0x730 [ 47.023118] ip_output+0x2e0/0x430 [ 47.026530] ip_local_out+0x90/0x140 [ 47.030117] igmpv3_sendpack+0x14c/0x228 [ 47.034049] igmpv3_send_cr+0x384/0x6b8 [ 47.037895] igmp_ifc_timer_expire+0x4c/0x118 [ 47.042262] call_timer_fn+0x1cc/0xbe8 [ 47.046021] __run_timers+0x4d8/0xb28 [ 47.049693] run_timer_softirq+0x24/0x40 [ 47.053626] __do_softirq+0x2c0/0x117c [ 47.057387] irq_exit+0x2dc/0x388 [ 47.060715] __handle_domain_irq+0xb4/0x158 [ 47.064908] gic_handle_irq+0x58/0xb0 [ 47.068581] el0_irq_naked+0x50/0x5c [ 47.072162] [ 47.073665] Allocated by task 328: [ 47.077083] save_stack+0x24/0xb0 [ 47.080410] __kasan_kmalloc.isra.0+0xc0/0xe0 [ 47.084776] kasan_slab_alloc+0x14/0x20 [ 47.088622] kmem_cache_alloc+0x15c/0x468 [ 47.092643] __alloc_skb+0xa4/0x498 [ 47.096142] igmpv3_newpack+0x158/0xd78 [ 47.099987] add_grhead+0x210/0x288 [ 47.103485] add_grec+0x6b0/0xb70 [ 47.106811] igmpv3_send_cr+0x2e0/0x6b8 [ 47.110657] igmp_ifc_timer_expire+0x4c/0x118 [ 47.115027] call_timer_fn+0x1cc/0xbe8 [ 47.118785] __run_timers+0x4d8/0xb28 [ 47.122457] run_timer_softirq+0x24/0x40 [ 47.126389] __do_softirq+0x2c0/0x117c [ 47.130142] [ 47.131643] Freed by task 180: [ 47.134712] save_stack+0x24/0xb0 [ 47.138041] __kasan_slab_free+0x108/0x180 [ 47.142146] kasan_slab_free+0x10/0x18 [ 47.145904] slab_free_freelist_hook+0xa4/0x1b0 [ 47.150444] kmem_cache_free+0x8c/0x528 [ 47.154292] kfree_skbmem+0x94/0x108 [ 47.157880] consume_skb+0x10c/0x5a8 [ 47.161466] __dev_kfree_skb_any+0x88/0xa0 [ 47.165598] brcmu_pkt_buf_free_skb+0x44/0x68 [brcmutil] [ 47.171023] brcmf_txfinalize+0xec/0x190 [brcmfmac] [ 47.176016] brcmf_proto_bcdc_txcomplete+0x1c0/0x210 [brcmfmac] [ 47.182056] brcmf_sdio_sendfromq+0x8dc/0x1e80 [brcmfmac] [ 47.187568] brcmf_sdio_dpc+0xb48/0x2108 [brcmfmac] [ 47.192529] brcmf_sdio_dataworker+0xc8/0x238 [brcmfmac] [ 47.197859] process_one_work+0x7fc/0x1a80 [ 47.201965] worker_thread+0x31c/0xc40 [ 47.205726] kthread+0x2d8/0x370 [ 47.208967] ret_from_fork+0x10/0x18 [ 47.212546] [ 47.214051] The buggy address belongs to the object at ffffff803f588280 [ 47.214051] which belongs to the cache skbuff_head_cache of size 208 [ 47.227086] The buggy address is located 104 bytes inside of [ 47.227086] 208-byte region [ffffff803f588280, ffffff803f588350) [ 47.238814] The buggy address belongs to the page: [ 47.243618] page:ffffffff00dd6200 refcount:1 mapcount:0 mapping:ffffff804b6bf800 index:0xffffff803f589900 compound_mapcount: 0 [ 47.255007] flags: 0x10200(slab|head) [ 47.258689] raw: 0000000000010200 ffffffff00dfa980 0000000200000002 ffffff804b6bf800 [ 47.266439] raw: ffffff803f589900 0000000080190018 00000001ffffffff 0000000000000000 [ 47.274180] page dumped because: kasan: bad access detected [ 47.279752] [ 47.281251] Memory state around the buggy address: [ 47.286051] ffffff803f588180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.293277] ffffff803f588200: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 47.300502] >ffffff803f588280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.307723] ^ [ 47.314343] ffffff803f588300: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc [ 47.321569] ffffff803f588380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 47.328789] ================================================================== Signed-off-by: Alexander Coffin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220808174925.3922558-1-alex.coffin@matician.com commit d3afabf94ad383303026647db4ec802754ac06ba Author: Vishnu Dasa Date: Tue Sep 6 10:27:22 2022 -0700 MAINTAINERS: Add a new entry for VMWARE VSOCK VMCI TRANSPORT DRIVER Add a new entry for VMWARE VSOCK VMCI TRANSPORT DRIVER in the MAINTAINERS file. Acked-by: Stefano Garzarella Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220906172722.19862-4-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit 0f174bc27137f6b6d1eb63e92934ad0b1b404658 Author: Vishnu Dasa Date: Tue Sep 6 10:27:21 2022 -0700 MAINTAINERS: Change status of some VMware drivers Change the status from 'Maintained' to 'Supported' for VMWARE BALLOON DRIVER, VMWARE PVRDMA DRIVER, VMWARE PVSCSI driver, VMWARE VMCI DRIVER, VMWARE VMMOUSE SUBDRIVER and VMWARE VMXNET3 ETHERNET DRIVER. This needs to be done to conform to the guidelines in [1]. Maintainers for these drivers are VMware employees. [1] https://docs.kernel.org/process/maintainers.html Acked-by: Nadav Amit Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220906172722.19862-3-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit a6d0ca93abe3c19aa5b79fd11a832116b6caca26 Author: Vishnu Dasa Date: Tue Sep 6 10:27:20 2022 -0700 MAINTAINERS: Change VMware PVSCSI driver entry to upper case Change 'VMware PVSCSI driver' entry to upper case. This is a trivial change being done for uniformity. Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220906172722.19862-2-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit e6643298aac0d9d77696513722c85d7808e4c84a Author: Li zeming Date: Wed Sep 7 11:29:34 2022 +0800 drm/ttm: Remove unnecessary '0' values from ret The variable ret is assigned in the judgment branch statement, he does not need to initialize the assignment. Signed-off-by: Li zeming Link: https://patchwork.freedesktop.org/patch/msgid/20220907032934.4490-1-zeming@nfschina.com Reviewed-by: Christian König Signed-off-by: Christian König commit 0d24201f47c4270043314705fcc13e1d7c675527 Author: Kees Cook Date: Thu Sep 1 13:45:58 2022 -0700 wifi: iwlwifi: calib: Refactor iwl_calib_result usage for clarity In preparation for FORTIFY_SOURCE performing run-time destination buffer bounds checking for memcpy(), refactor the use of struct iwl_calib_result: - Have struct iwl_calib_result contain struct iwl_calib_cmd since functions expect to operate on the "data" flex array in "cmd", which follows the "hdr" member. - Switch argument passing around to use struct iwl_calib_cmd instead of struct iwl_calib_hdr to prepare functions to see the "data" member. - Change iwl_calib_set()'s "len" argument to a size_t since it is always unsigned and is normally receiving the output of sizeof(). - Add an explicit length sanity check in iwl_calib_set(). - Adjust the memcpy() to avoid copying across the now visible composite flex array structure. This avoids the future run-time warning: memcpy: detected field-spanning write (size 8) of single field "&res->hdr" (size 4) Cc: Luca Coelho Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Lee Jones Cc: Johannes Berg Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Reported-by: Andy Lavr Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220901204558.2256458-1-keescook@chromium.org commit efc96d43ec38381dacbd51679c2d01438511371d Author: Herbert Xu Date: Tue Sep 6 13:05:35 2022 +0800 crypto: aspeed - Fix sparse warnings This patch fixes a bunch of bit endianness warnings and two missing static modifiers. Signed-off-by: Herbert Xu Reviewed-by: Neal Liu Signed-off-by: Herbert Xu commit aa450316c662f599189e0910444cf064c4f31602 Author: Neal Liu Date: Wed Sep 7 11:34:31 2022 +0800 crypto: aspeed: fix format unexpected build warning This fixes the following similar build warning when enabling compile test: aspeed-hace-hash.c:188:9: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] Reported-by: kernel test robot Signed-off-by: Neal Liu Acked-by: Randy Dunlap Signed-off-by: Herbert Xu commit 387a42cfcf92eac21b2dec2cdadd207ddae0ec78 Author: Colin Ian King Date: Tue Sep 6 15:05:52 2022 +0100 thunderbolt: Fix spelling mistake "simultaneusly" -> "simultaneously" There are spelling mistakes in the thunderbolt sysfs documentation. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Mika Westerberg commit 706d73836481ccee5c3ce039bd09fb5bfc9cc031 Author: Colin Ian King Date: Tue Sep 6 15:03:14 2022 +0100 thunderbolt: debugfs: Fix spelling mistakes in seq_puts text There are a handful of spelling mistakes in seq_puts text. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Mika Westerberg commit a52958321bbb4e8b2b4ab5849b8cbb0202b1029d Author: Szuying Chen Date: Sun Sep 4 14:18:00 2022 +0300 thunderbolt: Add support for ASMedia NVM image format Add support for ASMedia specific NVM image format. This makes it possible to upgrade the NVM firmware of ASMedia routers in addition to Intel ones. Signed-off-by: Szuying Chen Signed-off-by: Mika Westerberg commit aef9c693e7e550954fc526b919342cc7d8047ed1 Author: Szuying Chen Date: Fri Sep 2 17:40:08 2022 +0800 thunderbolt: Move vendor specific NVM handling into nvm.c As there will be more USB4 devices that support NVM firmware upgrade from various vendors, it makes sense to split out the Intel specific NVM image handling from the generic code. This moves the Intel specific NVM handling into a new structure that will be matched by the device type and the vendor ID. Do this for both routers and retimers. This makes it easier to extend the NVM support to cover new vendors and NVM image formats in the future. Signed-off-by: Szuying Chen Signed-off-by: Mika Westerberg commit 8b02b2da77c89d9b9031f522e50af9eb2270585a Author: Mika Westerberg Date: Sat Sep 3 10:43:25 2022 +0300 thunderbolt: Provide tb_retimer_nvm_read() analogous to tb_switch_nvm_read() As we are moving the NVM vendor specifics into nvm.c we need to deal witht he retimer NVM formats too. For this reason provide retimer specific function that can be used to read the contents of the NVM and rename the internal ones accordingly analogous to what we do with routers. Signed-off-by: Mika Westerberg commit 7bfafaa5185be3088e57f046956d6db0155ddc17 Author: Szuying Chen Date: Sat Sep 3 10:39:18 2022 +0300 thunderbolt: Rename and make nvm_read() available for other files In order to support non-Intel NVM formats the vendor specific NVM validation code that will live in nvm.c needs to be able to read various parts of the NVM so make the function available outside of switch.c and rename it accordingly. Signed-off-by: Szuying Chen Signed-off-by: Mika Westerberg commit 5424e1bf16f96bd681c780f5fd12e33588c7ade3 Author: Szuying Chen Date: Fri Sep 2 17:40:09 2022 +0800 thunderbolt: Extend NVM version fields to 32-bits In order to support non-Intel NVM image formats extend the NVM major and minor version to 32-bits to better accommondate different versioning schemes. No functional impact. Signed-off-by: Szuying Chen Signed-off-by: Mika Westerberg commit 5172eb9a16437af35f86ab66c8e6b55cc9a9cf78 Author: Szuying Chen Date: Sun Sep 4 13:40:23 2022 +0300 thunderbolt: Allow NVM upgrade of USB4 host routers Intel pre-USB4 host routers required the firmware connection manager to be active in order to perform NVM firmware upgrade and for this reason it was disabled when software connection manager is active. However, this is not necessary for USB4 host routers as this functionality is part of router operations that the router implements if it wants to support this. Signed-off-by: Szuying Chen Signed-off-by: Mika Westerberg commit 8e9d75fd2ec2ad6c7b19dbafe1be966fd13e0f1d Author: Yegor Yefremov Date: Tue Jul 26 10:34:44 2022 +0200 ARM: dts: am335x-netcom: add GPIO names for NetCom Plus 2-port devices Add GPIO names for SoC lines. Signed-off-by: Yegor Yefremov Message-Id: <20220726083444.10159-5-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit f5d044bdb8e7ca11448faaef45032d98665c9c0b Author: Yegor Yefremov Date: Tue Jul 26 10:34:43 2022 +0200 ARM: dts: am335x-netcom: add GPIO names for NetCom Plus 8-port devices Add GPIO names for both SoC and TCA6416 lines. Signed-off-by: Yegor Yefremov Message-Id: <20220726083444.10159-4-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit f8eb856723625cd618dc0ce29528890395718d9b Author: Yegor Yefremov Date: Tue Jul 26 10:34:42 2022 +0200 ARM: dts: am335x-netcan: add GPIO names for NetCAN Plus device Add GPIO names for SoC lines. Signed-off-by: Yegor Yefremov Message-Id: <20220726083444.10159-3-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit 523717d8d8d529087f36be617b49a98876045bb5 Author: Yegor Yefremov Date: Tue Jul 26 10:34:41 2022 +0200 ARM: dts: am335x-baltos: add GPIO names for ir2110 device Add GPIO names for SoC lines. Signed-off-by: Yegor Yefremov Message-Id: <20220726083444.10159-2-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit 2cf0cc032db609ff1975bd20ce7af03a2818a589 Author: Yegor Yefremov Date: Tue Jul 26 10:34:40 2022 +0200 ARM: dts: am335x-baltos: add GPIO names for ir3220 and ir5221 devices Add GPIO names for both SoC and TCA6416 lines. Signed-off-by: Yegor Yefremov Message-Id: <20220726083444.10159-1-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit aa8dfaf50b2e122f51ce0c8083d4b861d9553c55 Author: Yegor Yefremov Date: Tue Jul 5 14:23:55 2022 +0200 ARM: dts: am335x-baltos: change nand-xfer-type Use "prefetch-dma" instead of "polled". Signed-off-by: Yegor Yefremov Message-Id: <20220705122355.14854-1-yegorslists@googlemail.com> Acked-by: Roger Quadros Signed-off-by: Tony Lindgren commit 5e1bfb277d3b87bc580735564eb487c0be3848b3 Author: Alisa Khabibrakhmanova Date: Fri Jul 29 12:06:43 2022 +0300 drm/via: Add new condition to via_dma_cleanup() Pointer dev_priv->mmio, which was checked for NULL at via_do_init_map(), is passed to via_do_cleanup_map() and is dereferenced there without check. The patch adds the condition in via_dma_cleanup() which prevents potential NULL pointer dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 22f579c621e2 ("drm: Add via unichrome support") Signed-off-by: Alisa Khabibrakhmanova Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220729090643.240778-1-khabibrakhmanova@ispras.ru commit 028a9642217e0ae094fc8b3d764a9339fea6c9ee Merge: 1e660f7ebe0ff ae63c10fc241a Author: Alexei Starovoitov Date: Tue Sep 6 19:52:12 2022 -0700 Merge branch 'bpf: Support struct argument for trampoline base progs' Yonghong Song says: ==================== Currently struct arguments are not supported for trampoline based progs. One of major reason is that struct argument may pass by value which may use more than one registers. This breaks trampoline progs where each argument is assumed to take one register. bcc community reported the issue ([1]) where struct argument is not supported for fentry program. typedef struct { uid_t val; } kuid_t; typedef struct { gid_t val; } kgid_t; int security_path_chown(struct path *path, kuid_t uid, kgid_t gid); Inside Meta, we also have a use case to attach to tcp_setsockopt() typedef struct { union { void *kernel; void __user *user; }; bool is_kernel : 1; } sockptr_t; int tcp_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, unsigned int optlen); This patch added struct value support for bpf tracing programs which uses trampoline. Only <= 16 byte struct size is supported for now which covers use cases in the above. For x86/arm64/bpf, <= 16 struct value will be passed in registers instead of by reference. Only x86_64 is supported in this patch. arm64 support can be added later. [1] https://github.com/iovisor/bcc/issues/3657 Changelog: v3 -> v4: - fix a test failure where no casting for bpf_get_func_arg() value as the value type is 'int'. - add tracing_struct test in DENYLIST.s390x - simplify macro BPF_REG_CNT for BPF_PROG2. v2 -> v3: - previously struct arguments (<= 16 bytes) are passed by reference for bpf programs. Suggested by Alexei, it is passed by value now. - in order to support passing <= 16 struct value, a new macro BPF_PROG2 is invented. rfc v1 -> v2: - changed bpf_func_model struct info fields to arg_flags[] to make it easy to iterate arguments in arch specific {save|restore}_regs() functions. - added fexit tests to test return values with struct arguments. ==================== Signed-off-by: Alexei Starovoitov commit ae63c10fc241a94bb916da96d40c8810f9ad7f18 Author: Yonghong Song Date: Wed Aug 31 08:27:23 2022 -0700 selftests/bpf: Add tracing_struct test in DENYLIST.s390x Add tracing_struct test in DENYLIST.s390x since s390x does not support trampoline now. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152723.2081551-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit a7c2ca3a2f697044094475055b3fba3929b234e4 Author: Yonghong Song Date: Wed Aug 31 08:27:18 2022 -0700 selftests/bpf: Use BPF_PROG2 for some fentry programs without struct arguments Use BPF_PROG2 instead of BPF_PROG for programs in progs/timer.c to test BPF_PROG2 for cases without struct arguments. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152718.2081091-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 1642a3945e223a922312fab2401ecdf58b3825b9 Author: Yonghong Song Date: Wed Aug 31 08:27:13 2022 -0700 selftests/bpf: Add struct argument tests with fentry/fexit programs. Add various struct argument tests with fentry/fexit programs. Also add one test with a kernel func which does not have any argument to test BPF_PROG2 macro in such situation. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152713.2080039-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 34586d29f8dfc4ae30642c5b9a4db8a4a7af6869 Author: Yonghong Song Date: Wed Aug 31 08:27:07 2022 -0700 libbpf: Add new BPF_PROG2 macro To support struct arguments in trampoline based programs, existing BPF_PROG doesn't work any more since the type size is needed to find whether a parameter takes one or two registers. So this patch added a new BPF_PROG2 macro to support such trampoline programs. The idea is suggested by Andrii. For example, if the to-be-traced function has signature like typedef struct { void *x; int t; } sockptr; int blah(sockptr x, char y); In the new BPF_PROG2 macro, the argument can be represented as __bpf_prog_call( ({ union { struct { __u64 x, y; } ___z; sockptr x; } ___tmp = { .___z = { ctx[0], ctx[1] }}; ___tmp.x; }), ({ union { struct { __u8 x; } ___z; char y; } ___tmp = { .___z = { ctx[2] }}; ___tmp.y; })); In the above, the values stored on the stack are properly assigned to the actual argument type value by using 'union' magic. Note that the macro also works even if no arguments are with struct types. Note that new BPF_PROG2 works for both llvm16 and pre-llvm16 compilers where llvm16 supports bpf target passing value with struct up to 16 byte size and pre-llvm16 will pass by reference by storing values on the stack. With static functions with struct argument as always inline, the compiler is able to optimize and remove additional stack saving of struct values. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152707.2079473-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit eb707dde264af5eb0271156d7fbd59133fa02cac Author: Yonghong Song Date: Wed Aug 31 08:27:02 2022 -0700 bpf: arm64: No support of struct argument in trampoline programs ARM64 does not support struct argument for trampoline based bpf programs yet. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152702.2079066-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 27ed9353aec9de4277b3389c9f2b04beb6ab7622 Author: Yonghong Song Date: Wed Aug 31 08:26:57 2022 -0700 bpf: Update descriptions for helpers bpf_get_func_arg[_cnt]() Now instead of the number of arguments, the number of registers holding argument values are stored in trampoline. Update the description of bpf_get_func_arg[_cnt]() helpers. Previous programs without struct arguments should continue to work as usual. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152657.2078805-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit a9c5ad31fbdc4dec6d266fe22e51de1ad6d1bcf2 Author: Yonghong Song Date: Wed Aug 31 08:26:52 2022 -0700 bpf: x86: Support in-register struct arguments in trampoline programs In C, struct value can be passed as a function argument. For small structs, struct value may be passed in one or more registers. For trampoline based bpf programs, this would cause complication since one-to-one mapping between function argument and arch argument register is not valid any more. The latest llvm16 added bpf support to pass by values for struct up to 16 bytes ([1]). This is also true for x86_64 architecture where two registers will hold the struct value if the struct size is >8 and <= 16. This may not be true if one of struct member is 'double' type but in current linux source code we don't have such instance yet, so we assume all >8 && <= 16 struct holds two general purpose argument registers. Also change on-stack nr_args value to the number of registers holding the arguments. This will permit bpf_get_func_arg() helper to get all argument values. [1] https://reviews.llvm.org/D132144 Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152652.2078600-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 720e6a435194fb5237833a4a7ec6aa60a78964a8 Author: Yonghong Song Date: Wed Aug 31 08:26:46 2022 -0700 bpf: Allow struct argument in trampoline based programs Allow struct argument in trampoline based programs where the struct size should be <= 16 bytes. In such cases, the argument will be put into up to 2 registers for bpf, x86_64 and arm64 architectures. To support arch-specific trampoline manipulation, add arg_flags for additional struct information about arguments in btf_func_model. Such information will be used in arch specific function arch_prepare_bpf_trampoline() to prepare argument access properly in trampoline. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220831152646.2078089-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 1e660f7ebe0ff6ac65ee0000280392d878630a67 Author: Alexei Starovoitov Date: Tue Sep 6 19:38:53 2022 -0700 bpf: Replace __ksize with ksize. __ksize() was made private. Use ksize() instead. Reported-by: Stephen Rothwell Signed-off-by: Alexei Starovoitov commit efca52749564601de2045eb71dbe756b7bade4e8 Author: Colin Ian King Date: Tue Sep 6 15:00:10 2022 +0100 scsi: qla2xxx: Fix spelling mistake "definiton" -> "definition" There is a spelling mistake in a MODULE_PARM_DESC description. Fix it. Link: https://lore.kernel.org/r/20220906140010.194273-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit f5f2a2716055ad8c0c4ff83e51d667646c6c5d8a Author: John Garry Date: Mon Sep 5 19:48:49 2022 +0800 scsi: hisi_sas: Don't send bcast events from HW during nexus HA reset Remote devices may go missing from the per-device nexus reset part of the HA nexus, i.e after the controller reset. This is because libsas may find the devices to be gone as the phy may be temporarily down when processing the bcast event generated from the nexus reset. Filter out bcast events during this time to stop the devices being lost. Link: https://lore.kernel.org/r/1662378529-101489-6-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit e9b6bada980957e0ada6613a749875e133a0327d Author: John Garry Date: Mon Sep 5 19:48:48 2022 +0800 scsi: hisi_sas: Add helper to process bcast events Add a helper for bcast processing to reduce duplication. Link: https://lore.kernel.org/r/1662378529-101489-5-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 11ff0c98fca35df16c84d4eee52008faecaf10a6 Author: John Garry Date: Mon Sep 5 19:48:47 2022 +0800 scsi: hisi_sas: Drain bcast events in hisi_sas_rescan_topology() In resetting the controller, SATA devices may be lost. The issue is that when we insert the bcast events to rescan the topology in hisi_sas_rescan_topology(), when we subsequently nexus reset the SATA devices in hisi_sas_async_I_T_nexus_reset(), there is a small timing window in which the remote phy is down and we process the bcast event (meaning that libsas judges that the disk is lost). Ensure that all bcast events are processed prior to the nexus reset to close this window. Link: https://lore.kernel.org/r/1662378529-101489-4-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit bc5551157a747d463247a54b611e5a8464677c6f Author: John Garry Date: Mon Sep 5 19:48:46 2022 +0800 scsi: hisi_sas: Clear HISI_SAS_HW_FAULT_BIT earlier Once the controller HW has been reset then we can unset flag HISI_SAS_HW_FAULT_BIT. In clearing this flag earlier we can now successfully execute commands in hisi_sas_controller_reset_done(), like bcast processing. Link: https://lore.kernel.org/r/1662378529-101489-3-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 245050af5d15a4f518c130e896cb597a263a070b Author: John Garry Date: Mon Sep 5 19:48:45 2022 +0800 scsi: hisi_sas: Revert change to limit max hw sectors for v3 HW Now that libsas and the SCSI core code limits the default sectors from commit 4cbfca5f7750 ("scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit") and commit 608128d391fa ("scsi: sd: allow max_sectors be capped at DMA optimal size limit"), there is no need for the hack to limit the max HW sectors. Link: https://lore.kernel.org/r/1662378529-101489-2-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1ce871de4f86432be4b40b7a19bd205aedc654bf Author: Kees Cook Date: Thu Sep 1 13:57:29 2022 -0700 scsi: esas2r: Use flex array destination for memcpy() In preparation for FORTIFY_SOURCE performing run-time destination buffer bounds checking for memcpy(), specify the destination output buffer explicitly, instead of asking memcpy() to write past the end of what looked like a fixed-size object. Silences future run-time warning: memcpy: detected field-spanning write (size 80) of single field "trc + 1" (size 64) There is no binary code output differences from this change. Link: https://lore.kernel.org/r/20220901205729.2260982-1-keescook@chromium.org Cc: Bradley Grove Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 7eff437b5ee1309b34667844361c6bbb5c97df05 Author: Letu Ren Date: Mon Aug 29 19:01:15 2022 +0800 scsi: 3w-9xxx: Avoid disabling device if failing to enable it The original code will "goto out_disable_device" and call pci_disable_device() if pci_enable_device() fails. The kernel will generate a warning message like "3w-9xxx 0000:00:05.0: disabling already-disabled device". We shouldn't disable a device that failed to be enabled. A simple return is fine. Link: https://lore.kernel.org/r/20220829110115.38789-1-fantasquex@gmail.com Reported-by: Zheyu Ma Signed-off-by: Letu Ren Signed-off-by: Martin K. Petersen commit 2286ade07d74498a62c0ad067a79ca8dcc04016f Author: Daniil Lunev Date: Mon Aug 29 08:18:58 2022 +1000 scsi: ufs: core: Print UFSHCD capabilities in controller's sysfs node Userspace may want to manually control when the data should go into WriteBooster buffer. The control happens via "wb_on" node, but presently, there is no simple way to check if WriteBooster is supported and enabled. Expose the Write Booster and Clock Scaling capabilities to be able to determine if the Write Booster is available and if its manual control is blocked by Clock Scaling mechanism. Link: https://lore.kernel.org/r/20220829081845.v8.1.Ibf9efc9be50783eeee55befa2270b7d38552354c@changeid Reviewed-by: Bart Van Assche Signed-off-by: Daniil Lunev Signed-off-by: Martin K. Petersen commit 9806d1b895f42c919620539b8e7621d73ea6d60d Author: Jack Wang Date: Fri Aug 26 12:14:35 2022 +0200 scsi: qlogicpti: Fix dma_map_sg() check Add missing error check for dma_map_sg(). Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20220826101435.79170-1-jinpu.wang@ionos.com Signed-off-by: Jack Wang Signed-off-by: Martin K. Petersen commit 68a3a9102a6891635fa7595ce78808e57b66fc6f Author: Mike Christie Date: Thu Aug 11 20:00:27 2022 -0500 scsi: core: Remove useless host error codes The host codes that were supposed to only be used for internal use are now not used, so remove them. Link: https://lore.kernel.org/r/20220812010027.8251-11-michael.christie@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 7dfaae6ac1b0267d5a064970ba794a916c33b823 Author: Mike Christie Date: Thu Aug 11 20:00:26 2022 -0500 scsi: core: Convert scsi_decide_disposition() to use SCSIML_STAT Don't use: - DID_TARGET_FAILURE - DID_NEXUS_FAILURE - DID_ALLOC_FAILURE - DID_MEDIUM_ERROR Instead use the SCSI midlayer internal values. Link: https://lore.kernel.org/r/20220812010027.8251-10-michael.christie@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 36ebf1e2aa148bdcf03c413bddfc605c54b57669 Author: Mike Christie Date: Thu Aug 11 20:00:25 2022 -0500 scsi: core: Add error codes for internal SCSI midlayer use If a driver returns: - DID_TARGET_FAILURE - DID_NEXUS_FAILURE - DID_ALLOC_FAILURE - DID_MEDIUM_ERROR we hit a couple bugs: 1. The SCSI error handler runs because scsi_decide_disposition() has no case statements for them and we return FAILED. 2. For SG IO the userspace app gets a success status instead of failed, because scsi_result_to_blk_status() clears those errors. This patch adds a new internal error code byte for use by the SCSI midlayer. This will be used instead of the above error codes, so we don't have to play that clearing the host code game in scsi_result_to_blk_status() and drivers cannot accidentally use them. A subsequent commit will then remove the internal users of the above codes and convert us to use the new ones. Link: https://lore.kernel.org/r/20220812010027.8251-9-michael.christie@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit ebb54b201c9378f08053b461898d15c019aaf4ba Author: Mike Christie Date: Thu Aug 11 20:00:24 2022 -0500 scsi: cxlflash: Drop DID_ALLOC_FAILURE use DID_ALLOC_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in entering SCSI error handling. By the code comment, it looks like the driver wanted a retryable error code, so this has it use DID_ERROR. Link: https://lore.kernel.org/r/20220812010027.8251-8-michael.christie@oracle.com Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit a965d35c8741724eb69050948024f35d268645ab Author: Mike Christie Date: Thu Aug 11 20:00:23 2022 -0500 scsi: qla2xxx: Drop DID_TARGET_FAILURE use DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in entering SCSI error handling. This has qla2xxx use DID_NO_CONNECT because it looks like we hit this error when we can't find a port. It will give us the same hard error behavior and it seems to match the error where we can't find the endpoint. Link: https://lore.kernel.org/r/20220812010027.8251-7-michael.christie@oracle.com Reviewed-by: Himanshu Madhani Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 377a7b0b1e5fd157547904874c84331b32df1109 Author: Mike Christie Date: Thu Aug 11 20:00:22 2022 -0500 scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use DID_NEXUS_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in entering SCSI error handling. virtio_scsi gets this when something like qemu returns VIRTIO_SCSI_S_NEXUS_FAILURE. It looks like qemu returns that error code if host OS returns DID_NEXUS_FAILURE (qemu's internal SCSI_HOST_RESERVATION_ERROR maps to DID_NEXUS_FAILURE). This shouldn't happen for Linux since we don't propagate that error code to userspace. This has us convert VIRTIO_SCSI_S_NEXUS_FAILURE to a SAM_STAT_RESERVATION_CONFLICT in case some other virt layer is returning it. In that case we will still get the reservation confict failure we expect. Link: https://lore.kernel.org/r/20220812010027.8251-6-michael.christie@oracle.com Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit beb4dac8d23546c14c77fce724a214348523d503 Author: Mike Christie Date: Thu Aug 11 20:00:21 2022 -0500 scsi: virtio_scsi: Drop DID_TARGET_FAILURE use DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in entering SCSI error handling. virtio_scsi gets this when something like qemu returns VIRTIO_SCSI_S_TARGET_FAILURE. It looks like qemu returns that error code if a host OS returns it, but this shouldn't happen for Linux since we never propagate that error to userspace. This has us use DID_BAD_TARGET in case some other virt layer is returning it. In that case we will still get a hard error like before and it conveys something unexpected happened. Link: https://lore.kernel.org/r/20220812010027.8251-5-michael.christie@oracle.com Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit f1d0d5c9fe37d45e5f3004e54a4e596220bae930 Author: Mike Christie Date: Thu Aug 11 20:00:20 2022 -0500 scsi: uas: Drop DID_TARGET_FAILURE use DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in entering SCSI error handling. It looks like the driver wanted a hard failure so this swaps it with DID_BAD_TARGET which gives us that behavior. The error looks like it's for a case where the target did not support a TMF we wanted to use (maybe not a bad target but disappointing so close enough). Link: https://lore.kernel.org/r/20220812010027.8251-4-michael.christie@oracle.com Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit a6cb5462500f3cb4b0f81dca9d01fe464a92a163 Author: Mike Christie Date: Thu Aug 11 20:00:19 2022 -0500 scsi: storvsc: Drop DID_TARGET_FAILURE use DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for it in scsi_decide_disposition() so it results in the SCSI error handling running. It looks like the driver wanted a hard failure so swap it with DID_BAD_TARGET. Link: https://lore.kernel.org/r/20220812010027.8251-3-michael.christie@oracle.com Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 00903af94d8a1359584fdd6284be87d29f5a022d Author: Mike Christie Date: Thu Aug 11 20:00:18 2022 -0500 scsi: xen: Drop use of internal host codes The error codes: - DID_TARGET_FAILURE - DID_NEXUS_FAILURE - DID_ALLOC_FAILURE - DID_MEDIUM_ERROR are internal to the SCSI layer. Drivers must not use them because: 1. They are not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. xen-scsiback will never see this error and should not try to send it. 2. There is no handling for them in scsi_decide_disposition() so if xen-scsifront were to return the error to the SCSI midlayer then it kicks off the error handler which is definitely not what we want. Remove the use from xen-scsifront/back. Link: https://lore.kernel.org/r/20220812010027.8251-2-michael.christie@oracle.com Reviewed-by: Juergen Gross Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 07d50b8222d0d6fcbb281393048e36e797334ac6 Author: Douglas Anderson Date: Wed Jul 20 16:23:21 2022 -0700 drm/panel-edp: Fix typo in kerneldoc comment (appers=>appears) Ever since I got the spell-check working in my editor this one has been bugging me. Fix it. Signed-off-by: Douglas Anderson Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720162314.1.Ieef5bc3848df40b71605b70bb571d6429e8978de@changeid commit 14db0b3c7b837f4edeb7c1794290c2f345c7f627 Author: Eric Biggers Date: Mon Aug 15 16:50:51 2022 -0700 fscrypt: stop using PG_error to track error status As a step towards freeing the PG_error flag for other uses, change ext4 and f2fs to stop using PG_error to track decryption errors. Instead, if a decryption error occurs, just mark the whole bio as failed. The coarser granularity isn't really a problem since it isn't any worse than what the block layer provides, and errors from a multi-page readahead aren't reported to applications unless a single-page read fails too. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu # for f2fs part Link: https://lore.kernel.org/r/20220815235052.86545-2-ebiggers@kernel.org commit 2786bcff28bd88955fc61adf9cb7370fbc182bad Merge: 03fdb11da92fd 274052a2b0ab9 Author: Paolo Abeni Date: Tue Sep 6 23:21:14 2022 +0200 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-09-05 The following pull-request contains BPF updates for your *net-next* tree. We've added 106 non-merge commits during the last 18 day(s) which contain a total of 159 files changed, 5225 insertions(+), 1358 deletions(-). There are two small merge conflicts, resolve them as follows: 1) tools/testing/selftests/bpf/DENYLIST.s390x Commit 27e23836ce22 ("selftests/bpf: Add lru_bug to s390x deny list") in bpf tree was needed to get BPF CI green on s390x, but it conflicted with newly added tests on bpf-next. Resolve by adding both hunks, result: [...] lru_bug # prog 'printk': failed to auto-attach: -524 setget_sockopt # attach unexpected error: -524 (trampoline) cb_refs # expected error message unexpected error: -524 (trampoline) cgroup_hierarchical_stats # JIT does not support calling kernel function (kfunc) htab_update # failed to attach: ERROR: strerror_r(-524)=22 (trampoline) [...] 2) net/core/filter.c Commit 1227c1771dd2 ("net: Fix data-races around sysctl_[rw]mem_(max|default).") from net tree conflicts with commit 29003875bd5b ("bpf: Change bpf_setsockopt(SOL_SOCKET) to reuse sk_setsockopt()") from bpf-next tree. Take the code as it is from bpf-next tree, result: [...] if (getopt) { if (optname == SO_BINDTODEVICE) return -EINVAL; return sk_getsockopt(sk, SOL_SOCKET, optname, KERNEL_SOCKPTR(optval), KERNEL_SOCKPTR(optlen)); } return sk_setsockopt(sk, SOL_SOCKET, optname, KERNEL_SOCKPTR(optval), *optlen); [...] The main changes are: 1) Add any-context BPF specific memory allocator which is useful in particular for BPF tracing with bonus of performance equal to full prealloc, from Alexei Starovoitov. 2) Big batch to remove duplicated code from bpf_{get,set}sockopt() helpers as an effort to reuse the existing core socket code as much as possible, from Martin KaFai Lau. 3) Extend BPF flow dissector for BPF programs to just augment the in-kernel dissector with custom logic. In other words, allow for partial replacement, from Shmulik Ladkani. 4) Add a new cgroup iterator to BPF with different traversal options, from Hao Luo. 5) Support for BPF to collect hierarchical cgroup statistics efficiently through BPF integration with the rstat framework, from Yosry Ahmed. 6) Support bpf_{g,s}et_retval() under more BPF cgroup hooks, from Stanislav Fomichev. 7) BPF hash table and local storages fixes under fully preemptible kernel, from Hou Tao. 8) Add various improvements to BPF selftests and libbpf for compilation with gcc BPF backend, from James Hilliard. 9) Fix verifier helper permissions and reference state management for synchronous callbacks, from Kumar Kartikeya Dwivedi. 10) Add support for BPF selftest's xskxceiver to also be used against real devices that support MAC loopback, from Maciej Fijalkowski. 11) Various fixes to the bpf-helpers(7) man page generation script, from Quentin Monnet. 12) Document BPF verifier's tnum_in(tnum_range(), ...) gotchas, from Shung-Hsi Yu. 13) Various minor misc improvements all over the place. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (106 commits) bpf: Optimize rcu_barrier usage between hash map and bpf_mem_alloc. bpf: Remove usage of kmem_cache from bpf_mem_cache. bpf: Remove prealloc-only restriction for sleepable bpf programs. bpf: Prepare bpf_mem_alloc to be used by sleepable bpf programs. bpf: Remove tracing program restriction on map types bpf: Convert percpu hash map to per-cpu bpf_mem_alloc. bpf: Add percpu allocation support to bpf_mem_alloc. bpf: Batch call_rcu callbacks instead of SLAB_TYPESAFE_BY_RCU. bpf: Adjust low/high watermarks in bpf_mem_cache bpf: Optimize call_rcu in non-preallocated hash map. bpf: Optimize element count in non-preallocated hash map. bpf: Relax the requirement to use preallocated hash maps in tracing progs. samples/bpf: Reduce syscall overhead in map_perf_test. selftests/bpf: Improve test coverage of test_maps bpf: Convert hash map to bpf_mem_alloc. bpf: Introduce any context BPF specific memory allocator. selftest/bpf: Add test for bpf_getsockopt() bpf: Change bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt() bpf: Change bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt() bpf: Change bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt() ... ==================== Link: https://lore.kernel.org/r/20220905161136.9150-1-daniel@iogearbox.net Signed-off-by: Paolo Abeni commit 11c12adcbc1598d91e73ab6ddfa41d25a01478ed Author: Michal Jaron Date: Thu Aug 18 13:32:33 2022 +0200 iavf: Fix race between iavf_close and iavf_reset_task During stress tests with adding VF to namespace and changing vf's trust there was a race between iavf_reset_task and iavf_close. Sometimes when IAVF_FLAG_AQ_DISABLE_QUEUES from iavf_close was sent to PF after reset and before IAVF_AQ_GET_CONFIG was sent then PF returns error IAVF_NOT_SUPPORTED to disable queues request and following requests. There is need to get_config before other aq_required will be send but iavf_close clears all flags, if get_config was not sent before iavf_close, then it will not be send at all. In case when IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS was sent before IAVF_FLAG_AQ_DISABLE_QUEUES then there was rtnl_lock deadlock between iavf_close and iavf_adminq_task until iavf_close timeouts and disable queues was sent after iavf_close ends. There was also a problem with sending delete/add filters. Sometimes when filters was not yet added to PF and in iavf_close all filters was set to remove there might be a try to remove nonexistent filters on PF. Add aq_required_tmp to save aq_required flags and send them after disable_queues will be handled. Clear flags given to iavf_down different than IAVF_FLAG_AQ_GET_CONFIG as this flag is necessary to sent other aq_required. Remove some flags that we don't want to send as we are in iavf_close and we want to disable interface. Remove filters which was not yet sent and send del filters flags only when there are filters to remove. Signed-off-by: Michal Jaron Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 04cbaa6c08e3974760c7ac5a70256d736444f6f0 Author: Christophe JAILLET Date: Sun Sep 4 16:22:46 2022 +0200 ice: Simplify memory allocation in ice_sched_init_port() 'buf' is locale to the ice_sched_init_port() function. There is no point in using devm_kzalloc()/devm_kfree(). use kzalloc()/kfree() instead. Signed-off-by: Christophe JAILLET Signed-off-by: Tony Nguyen commit 1b9e740dd733d1db4e790e94a4e5021ad17d92f7 Author: Christophe JAILLET Date: Sun Sep 4 16:18:02 2022 +0200 ice: switch: Simplify memory allocation 'rbuf' is locale to the ice_get_initial_sw_cfg() function. There is no point in using devm_kzalloc()/devm_kfree(). use kzalloc()/kfree() instead. Signed-off-by: Christophe JAILLET Reviewed-by: Michal Swiatkowski Signed-off-by: Tony Nguyen commit 1bd50f2deb19c13834f9f6b2f3c3263e38a47e1a Author: Paul Greenwalt Date: Wed Aug 24 13:28:40 2022 -0700 ice: add helper function to check FW API version Several functions in ice_common.c check the firmware API version to see if the current API version meets some minimum requirement. Improve the readability of these checks by introducing ice_is_fw_api_min_ver, a helper function to perform that check. Signed-off-by: Paul Greenwalt Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 0b57e0d44299113a59697fc66714d5b3f14615b7 Author: Michal Michalik Date: Tue Aug 23 13:56:26 2022 +0200 ice: Check if reset in progress while waiting for offsets Occasionally while waiting to valid offsets from hardware we get reset. Add check for reset before proceeding to execute scheduled work. Co-developed-by: Karol Kolacinski Signed-off-by: Karol Kolacinski Signed-off-by: Michal Michalik Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit ce4626131112e1d0066a890371e14d8091323f99 Author: Tony Nguyen Date: Mon Aug 22 11:56:54 2022 -0700 ice: Allow operation with reduced device MSI-X The driver currently takes an all or nothing approach for device MSI-X vectors. Meaning if it does not get its full allocation, it will fail and not load. There is no reason it can't work with a reduced number of MSI-X vectors. Take a similar approach as commit 741106f7bd8d ("ice: Improve MSI-X fallback logic") and, instead, adjust the MSI-X request to make use of what is available. Signed-off-by: Tony Nguyen Tested-by: Petr Oros Tested-by: Gurucharan (A Contingent worker at Intel) commit 50067bd0fc9835dba3e08726460daaf3bcfe39d4 Author: Jaroslaw Gawin Date: Tue Aug 23 10:28:03 2022 +0200 i40e: add description and modify interrupts configuration procedure Add description for values written into registers QINT_XXXX and small cosmetic changes for MSI/LEGACY interrupts configuration in the same way as for MSI-X. Descriptions confirm the code is written correctly and make the code clear. Small cosmetic changes for MSI/LEGACY interrupts make code clear in the same manner as for MSI-X interrupts. Signed-off-by: Jaroslaw Gawin Signed-off-by: Andrii Staikov Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 68eb42b3f3b30df1a335b3139b21c32187c0efaa Author: Rodrigo Vivi Date: Fri Sep 2 05:51:25 2022 -0400 drm/i915: Don't try to disable host RPS when this was never enabled. Specially in GT reset case this could be triggered and try to disable things that had never been enabled. Let's add some protection here. Cc: Ashutosh Dixit Signed-off-by: Rodrigo Vivi Reviewed-by: Ashutosh Dixit Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220902095126.373036-1-rodrigo.vivi@intel.com commit c1631dbc00c1e432713396aaa10d8bd825822db0 Author: Luiz Augusto von Dentz Date: Thu Sep 1 17:24:13 2022 -0700 Bluetooth: hci_sync: Fix hci_read_buffer_size_sync hci_read_buffer_size_sync shall not use HCI_OP_LE_READ_BUFFER_SIZE_V2 sinze that is LE specific, instead it is hci_le_read_buffer_size_sync version that shall use it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216382 Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Luiz Augusto von Dentz commit af6bcc1921ff0b644d2d750c0e3a88623b7211f5 Author: Brian Gix Date: Thu Sep 1 12:19:14 2022 -0700 Bluetooth: Add experimental wrapper for MGMT based mesh This introduces a "Mesh UUID" and an Experimental Feature bit to the hdev mask, and depending all underlying Mesh functionality on it. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit b338d91703fae6f6afd67f3f75caa3b8f36ddef3 Author: Brian Gix Date: Thu Sep 1 12:19:13 2022 -0700 Bluetooth: Implement support for Mesh The patch adds state bits, storage and HCI command chains for sending and receiving Bluetooth Mesh advertising packets, and delivery to requesting user space processes. It specifically creates 4 new MGMT commands and 2 new MGMT events: MGMT_OP_SET_MESH_RECEIVER - Sets passive scan parameters and a list of AD Types which will trigger Mesh Packet Received events MGMT_OP_MESH_READ_FEATURES - Returns information on how many outbound Mesh packets can be simultaneously queued, and what the currently queued handles are. MGMT_OP_MESH_SEND - Command to queue a specific outbound Mesh packet, with the number of times it should be sent, and the BD Addr to use. Discrete advertisments are added to the ADV Instance list. MGMT_OP_MESH_SEND_CANCEL - Command to cancel a prior outbound message request. MGMT_EV_MESH_DEVICE_FOUND - Event to deliver entire received Mesh Advertisement packet, along with timing information. MGMT_EV_MESH_PACKET_CMPLT - Event to indicate that an outbound packet is no longer queued for delivery. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 269e633dad16c951449c99cc3bfce46110f5029e Author: Nathan Chancellor Date: Thu Sep 1 12:50:55 2022 -0700 coresight: cti-sysfs: Mark coresight_cti_reg_store() as __maybe_unused When building without CONFIG_CORESIGHT_CTI_INTEGRATION_REGS, there is a warning about coresight_cti_reg_store() being unused in the file: drivers/hwtracing/coresight/coresight-cti-sysfs.c:184:16: warning: 'coresight_cti_reg_store' defined but not used [-Wunused-function] 184 | static ssize_t coresight_cti_reg_store(struct device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~ This is expected as coresight_cti_reg_store() is only used in the coresight_cti_reg_rw macro, which is only used in a block guarded by CONFIG_CORESIGHT_CTI_INTEGRATION_REGS. Mark coresight_cti_reg_store() as __maybe_unused to clearly indicate that the function may be unused depending on the configuration. Fixes: fbca79e55429 ("coresight: cti-sysfs: Re-use same functions for similar sysfs register accessors") Signed-off-by: Nathan Chancellor Reviewed-by: James Clark Link: https://lore.kernel.org/r/20220901195055.1932340-1-nathan@kernel.org Signed-off-by: Mathieu Poirier commit f8ad757e40c9c776a13eaa56d73e8e62381517b6 Author: Randy Dunlap Date: Mon Apr 4 14:30:40 2022 -0700 drm/scheduler: quieten kernel-doc warnings Fix kernel-doc warnings in gpu_scheduler.h and sched_main.c. Quashes these warnings: include/drm/gpu_scheduler.h:332: warning: missing initial short description on line: * struct drm_sched_backend_ops include/drm/gpu_scheduler.h:412: warning: missing initial short description on line: * struct drm_gpu_scheduler include/drm/gpu_scheduler.h:461: warning: Function parameter or member 'dev' not described in 'drm_gpu_scheduler' drivers/gpu/drm/scheduler/sched_main.c:201: warning: missing initial short description on line: * drm_sched_dependency_optimized drivers/gpu/drm/scheduler/sched_main.c:995: warning: Function parameter or member 'dev' not described in 'drm_sched_init' Fixes: 2d33948e4e00 ("drm/scheduler: add documentation") Fixes: 8ab62eda177b ("drm/sched: Add device pointer to drm_gpu_scheduler") Fixes: 542cff7893a3 ("drm/sched: Avoid lockdep spalt on killing a processes") Signed-off-by: Randy Dunlap Cc: David Airlie Cc: Daniel Vetter Cc: Andrey Grodzovsky Cc: Nayan Deshmukh Cc: Alex Deucher Cc: Christian König Cc: Jiawei Gu Cc: dri-devel@lists.freedesktop.org Acked-by: Christian König Signed-off-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220404213040.12912-1-rdunlap@infradead.org commit 6617be3c154c7e9b2c1eefee9ab49d30e1b8eb1a Author: Stanislaw Grzeszczak Date: Mon Aug 29 13:59:46 2022 +0200 i40e: Add basic support for I710 devices Intel introduces a new line of 1G ethernet adapters with Device ID 0x0DD2 Signed-off-by: Stanislaw Grzeszczak Signed-off-by: Mateusz Palczewski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 8a693f7766f9e27c390c5fec8a5db1f9d1d8177e Author: Tejun Heo Date: Tue Sep 6 09:38:55 2022 -1000 cgroup: Remove CFTYPE_PRESSURE CFTYPE_PRESSURE is used to flag PSI related files so that they are not created if PSI is disabled during boot. It's a bit weird to use a generic flag to mark a specific file type. Let's instead move the PSI files into its own cftypes array and add/rm them conditionally. This is a bit more code but cleaner. No userland visible changes. Signed-off-by: Tejun Heo Cc: Johannes Weiner commit 0083d27b21dd2a598df8275b98f89ced532e2e53 Author: Tejun Heo Date: Tue Sep 6 09:38:42 2022 -1000 cgroup: Improve cftype add/rm error handling Let's track whether a cftype is currently added or not using a new flag __CFTYPE_ADDED so that duplicate operations can be failed safely and consistently allow using empty cftypes. Signed-off-by: Tejun Heo commit e23c69e3324892f7420686b3aaa0403df6cf152c Author: Christopher Crockett Date: Thu Aug 18 17:44:11 2022 +0200 Input: xpad - add support for XBOX One Elite paddles An effort has been made to support every official model and firmware version I could track down info on. The following controllers _should_ have working paddles with this PR: - Xbox Elite (**untested**) - Xbox Elite Series 2 on early firmwares (**untested**) - Xbox Elite Series 2 on v4 firmwares (Tested v4.8.1908.0) - Xbox Elite Series 2 on v5 pre-BLE firmwares (**untested**) - Xbox Elite Series 2 on v5 post-BLE firmwares (Tested v5.13.3143.0) This patch also introduces correct handling for the Elite 1 controller and properly suppresses paddle inputs when using a custom profile slot. Starting with firmware v5.11, certain inputs for the Elite 2 were moved to an extra packet that is not enabled by default. We must first manually enable this extra packet in order to correctly process paddle input data with these later firmwares. Signed-off-by: Christopher Crockett Signed-off-by: Pavel Rojtberg Tested-by: Bastien Nocera Link: https://lore.kernel.org/r/20220818154411.510308-5-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit da7e2128b869a1315b8919ded42b799076279cda Author: Santosh De Massari Date: Thu Aug 18 17:44:10 2022 +0200 Input: xpad - Poweroff XBOX360W on mode button long press Newer gamepads turn themselves off when the mode button is held down. For XBOX360W gamepads we must do this in the driver. Do not use BIT() macro for consistency within the file. Signed-off-by: Santosh De Massari Signed-off-by: Pavel Rojtberg Link: https://lore.kernel.org/r/20220818154411.510308-4-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit a17b9841152e7f4621619902b347e2cc39c32996 Author: Cameron Gutman Date: Thu Aug 18 17:44:09 2022 +0200 Input: xpad - fix wireless 360 controller breaking after suspend Suspending and resuming the system can sometimes cause the out URB to get hung after a reset_resume. This causes LED setting and force feedback to break on resume. To avoid this, just drop the reset_resume callback so the USB core rebinds xpad to the wireless pads on resume if a reset happened. A nice side effect of this change is the LED ring on wireless controllers is now set correctly on system resume. Cc: stable@vger.kernel.org Fixes: 4220f7db1e42 ("Input: xpad - workaround dead irq_out after suspend/ resume") Signed-off-by: Cameron Gutman Signed-off-by: Pavel Rojtberg Link: https://lore.kernel.org/r/20220818154411.510308-3-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit b382c5e37344883dc97525d05f1f6b788f549985 Author: Pavel Rojtberg Date: Thu Aug 18 17:44:08 2022 +0200 Input: xpad - add supported devices as contributed on github This is based on multiple commits at https://github.com/paroj/xpad Cc: stable@vger.kernel.org Signed-off-by: Jasper Poppe Signed-off-by: Jeremy Palmer Signed-off-by: Ruineka Signed-off-by: Cleber de Mattos Casali Signed-off-by: Kyle Gospodnetich Signed-off-by: Pavel Rojtberg Link: https://lore.kernel.org/r/20220818154411.510308-2-rojtberg@gmail.com Signed-off-by: Dmitry Torokhov commit 81ff692ad924da2233381bedff90c5c1f5c31368 Author: Mark Brown Date: Mon Aug 29 16:48:15 2022 +0100 arm64/sysreg: Add hwcap for SVE EBF16 SVE has a separate identification register indicating support for BFloat16 operations. Add a hwcap identifying support for EBF16 in this register, mirroring what we did for the non-SVE case. While there is currently an architectural requirement for BF16 support to be the same in SVE and non-SVE contexts there are separate identification registers this separate hwcap helps avoid issues if that requirement were to be relaxed in the future, we have already chosen to have a separate capability for base BF16 support. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154815.832347-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit d09ee410a3c30345af87f46dafd2ae308b17c0af Author: Mark Brown Date: Mon Aug 29 17:25:01 2022 +0100 arm64/sve: Document our actual ABI for clearing registers on syscall Currently our ABI documentation says that the state of the bits in the Z registers not shared with the V registers becomes undefined on syscall but our actual implementation unconditionally clears these bits. Taking advantage of the flexibility of our documented ABI would be a change in the observable ABI so there is concern around doing so, instead document the actual behaviour so that it is more discoverable for userspace programmers who might be able to take advantage of it and to record our decision about not changing the kernel ABI. This makes qemu's user mode implementation buggy since it does not clear these bits. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220829162502.886816-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 05a5980f7ff50e6c18a9f38ca49521180a333fdf Author: Mark Brown Date: Mon Aug 29 16:44:50 2022 +0100 kselftest/arm64: Count SIGUSR2 deliveries in FP stress tests Currently the floating point stress tests mostly support testing that the data they are checking can be disrupted from a signal handler triggered by SIGUSR1. This is not properly implemented for all the tests and in testing is frequently modified to just handle the signal without corrupting data in order to ensure that signal handling does not corrupt data. Directly support this usage by installing a SIGUSR2 handler which simply counts the signal delivery. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154452.824870-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9e40e6272353ea0fde654b548c96e8bbab2fed9f Author: Mark Brown Date: Mon Aug 29 16:44:49 2022 +0100 kselftest/arm64: Always encourage preemption for za-test Since we now have an explicit test for the syscall ABI there is no need for za-test to cover getpid() so just unconditionally do sched_yield() like we do in fpsimd-test. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154452.824870-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 7a9bcaaad5f17cc5c4cf882a25cd3efb2b3b8b6c Author: Mark Brown Date: Mon Aug 29 16:46:02 2022 +0100 kselftest/arm64: Add simple hwcap validation Add some trivial hwcap validation which checks that /proc/cpuinfo and AT_HWCAP agree with each other and can verify that for extensions that can generate a SIGILL due to adding new instructions one appears or doesn't appear as expected. I've added SVE and SME, other capabilities can be added later if this gets merged. This isn't super exciting but on the other hand took very little time to write and should be handy when verifying that you wired up AT_HWCAP properly. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220829154602.827275-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 78c67d5fc371c82f890f5de7a20d7451735bde41 Author: Jani Nikula Date: Tue Sep 6 18:10:32 2022 +0300 Revert "drm: Add missing DP DSC extended capability definitions." This reverts commit 797e2c3f2762c356aadcdb53dd6bb8b8d966f7b5. Part of a series where patches were modified while applying to resolve conflicts, leading to further conflicts between drm-misc-next and drm-intel-next, resulting in build failures in drm-tip. To be applied again on a baseline with drm-misc-next and drm-intel-next in sync. Acked-by: Rodrigo Vivi Signed-off-by: Jani Nikula commit 7fe194b2d1bdb9d17eabf1c5e485518a82c7aeab Author: Jani Nikula Date: Tue Sep 6 18:10:31 2022 +0300 Revert "drm/i915: Fix intel_dp_mst_compute_link_config" This reverts commit c6266862de1665b8c8006f58612db2dea66a29f6. Part of a series where patches were modified while applying to resolve conflicts, leading to further conflicts between drm-misc-next and drm-intel-next, resulting in build failures in drm-tip. To be applied again on a baseline with drm-misc-next and drm-intel-next in sync. Acked-by: Rodrigo Vivi Signed-off-by: Jani Nikula commit 831a277ef0010e6599af6b300140ca61a97afff9 Author: Jani Nikula Date: Tue Sep 6 18:10:30 2022 +0300 Revert "drm/i915: Extract drm_dp_atomic_find_vcpi_slots cycle to separate function" This reverts commit 7ae5ab441402b8165de4658ba9398d8378f7dd1e. Part of a series where patches were modified while applying to resolve conflicts, leading to further conflicts between drm-misc-next and drm-intel-next, resulting in build failures in drm-tip. To be applied again on a baseline with drm-misc-next and drm-intel-next in sync. Acked-by: Rodrigo Vivi Signed-off-by: Jani Nikula commit cc6b2ba27506781acc0890ac1ce3bb2be154a21a Author: Jani Nikula Date: Tue Sep 6 18:10:27 2022 +0300 Revert "drm/i915: Add DSC support to MST path" This reverts commit e1a84ba850128b3984973786829e610ae4ee0e2e. Part of a series where patches were modified while applying to resolve conflicts, leading to further conflicts between drm-misc-next and drm-intel-next, resulting in build failures in drm-tip. To be applied again on a baseline with drm-misc-next and drm-intel-next in sync. Acked-by: Rodrigo Vivi Signed-off-by: Jani Nikula commit 7b0dbd94076567170f89172e0f07583915010ac6 Author: Carlos Llamas Date: Tue Sep 6 13:59:47 2022 +0000 binder: fix binder_alloc kernel-doc warnings Update the kernel-doc section of struct binder_alloc to fix the following warnings reported by ./scripts/kernel-doc: warning: Function parameter or member 'mutex' not described in 'binder_alloc' warning: Function parameter or member 'vma_addr' not described in 'binder_alloc' No functional changes in this patch. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220906135948.3048225-4-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit d6d04d71daae9377129b13641f97ba2a961b2b26 Author: Carlos Llamas Date: Tue Sep 6 13:59:46 2022 +0000 binder: remove binder_alloc_set_vma() The mmap_locked asserts here are not needed since this is only called back from the mmap stack in ->mmap() and ->close() which always acquire the lock first. Remove these asserts along with binder_alloc_set_vma() altogether since it's trivial enough to be consumed by callers. Cc: Liam R. Howlett Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220906135948.3048225-3-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit e66b77e50522845d494a4a61ea2ad8f0d046a56f Author: Carlos Llamas Date: Tue Sep 6 13:59:45 2022 +0000 binder: rename alloc->vma_vm_mm to alloc->mm Rename ->vma_vm_mm to ->mm to reflect the fact that we no longer cache this reference from vma->vm_mm but from current->mm instead. No functional changes in this patch. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220906135948.3048225-2-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 3ae82f22ed7a746a8a9e89ea840401c46deddbb3 Author: Jakob Hauser Date: Sun Sep 4 23:49:35 2022 +0200 arm64: dts: qcom: msm8916-samsung-serranove: Add magnetometer Add magnetometer Yamaha YAS537 to the DeviceTree of samsung-serranove. The YAS537 variant was recently added to the Yamaha YAS magnetometers driver [1]. In the DeviceTree of samsung-serranove for the Android kernel, there is unfortunately no information on interrupts or pinctrl [2]. In the Android kernel driver for magnetometer Yamaha YAS537, there is a device-specific matrix to correct an ellipsoid shape of the measure values into a sphere shape [3]. This could be converted and applied to a mount-matrix. However, the current state of the mainline Yamaha YAS537 driver needs post-process calibration in userspace anyway, as it lacks a formula to center the measure values around zero. The correction of the ellipsoid into a sphere can be done in the post-process calibration as well. A mount-matrix is needed nonetheless. When putting samsung-serranove flat on a table in portrait orientation heading north, the Yamaha YAS537 magnetometer axes natively point X+ to north, Y+ to east and Z+ into the ground, which corresponds to a common way to define the Earth's magnetic field coordinate system [4]. According to the IIO definition, it should be Y+ to north, X+ to east and Z+ upwards [5], which corresponds to a common device coordinate system and eases sensor fusing. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/iio/magnetometer/yamaha-yas530.c?id=65f79b501030678393eae0ae03d60a8151fbef55 [2] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/arch/arm/boot/dts/samsung/msm8916/msm8916-sec-serranovelte-eur-r03.dtsi#L318-L321 [3] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas537.c#L105-L106 [4] https://en.wikipedia.org/wiki/Earth%27s_magnetic_field#Characteristics [5] https://github.com/torvalds/linux/blob/v5.19/Documentation/devicetree/bindings/iio/mount-matrix.txt#L93-L126 Cc: Stephan Gerhold Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220904214935.31032-1-jahau@rocketmail.com commit 7dac7991408f77b0b33ee5e6b729baa683889277 Author: Bhupesh Sharma Date: Mon Sep 5 12:32:40 2022 +0530 arm64: dts: qcom: sc8280xp-pmics: Remove reg entry & use correct node name for pmc8280c_lpg node Commit eeca7d46217c ("arm64: dts: qcom: pm8350c: Drop PWM reg declaration") dropped PWM reg declaration for pm8350c pwm(s), but there is a leftover 'reg' entry inside the lpg/pwm node in sc8280xp dts file. Remove the same. While at it, also remove the unused unit address in the node label. Also, since dt-bindings expect LPG/PWM node name to be "pwm", use correct node name as well, to fix the following error reported by 'make dtbs_check': 'lpg' does not match any of the regexes Fixes: eeca7d46217c ("arm64: dts: qcom: pm8350c: Drop PWM reg declaration") Cc: Krzysztof Kozlowski Cc: Bryan O'Donoghue Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Reviewed-by: Bryan O'Donoghue Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220905070240.1634997-1-bhupesh.sharma@linaro.org commit 80f63766e52d040726ff38b46e5f569a9fecaf5f Author: Luca Weiss Date: Fri Sep 2 13:10:55 2022 +0200 arm64: dts: qcom: sm7225-fairphone-fp4: Add pm7250b PMIC The PM7250B is primarily used for charger and fuel gauge on Fairphone 4 but also has some thermal zones that we can configure already. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902111055.106814-3-luca.weiss@fairphone.com commit 11975b9b813576686653cf76e768d08484a2ddba Author: Luca Weiss Date: Fri Sep 2 13:10:54 2022 +0200 arm64: dts: qcom: Add pm7250b PMIC PM7250B is a PMIC primarily used for charging and fuel gauge but also has some of the standard functionality like temp-alarm, adc, etc. Add the .dtsi with some of the functionality added. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20220902111055.106814-2-luca.weiss@fairphone.com commit e3c9b0ddfd144663e4d21d6d95e9c76a45c49e3f Author: Kumaravel Thiagarajan Date: Tue Sep 6 18:19:51 2022 +0530 misc: microchip: pci1xxxx: fix dependency issues in building the pci1xxxx's aux bus driver. build errors and warnings listed below and reported by kernel test robot on the char-misc-next branch are fixed in this add-on patch. errors: ERROR: modpost: "auxiliary_device_init" [drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.ko] undefined! ERROR: modpost: "__auxiliary_device_add" [drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.ko] undefined! ERROR: modpost: "auxiliary_driver_unregister" [drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.ko] undefined! ERROR: modpost: "__auxiliary_driver_register" [drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.ko] undefined! ia64-linux-ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.o: in function `gp_aux_bus_probe.part.0': mchp_pci1xxxx_gp.c:(.text+0x342): undefined reference to `auxiliary_device_init' ia64-linux-ld: mchp_pci1xxxx_gp.c:(.text+0x392): undefined reference to `__auxiliary_device_add' ia64-linux-ld: mchp_pci1xxxx_gp.c:(.text+0x5c2): undefined reference to `auxiliary_device_init' ia64-linux-ld: mchp_pci1xxxx_gp.c:(.text+0x612): undefined reference to `__auxiliary_device_add' ia64-linux-ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.o: in function `pci1xxxx_gpio_driver_init': mchp_pci1xxxx_gpio.c:(.init.text+0x42): undefined reference to `__auxiliary_driver_register' warnings: unmet direct dependencies detected for GPIOLIB_IRQCHIP when selected by GP_PCI1XXXX Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") Reported-by: kernel test robot Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220906124951.696776-1-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 5fd5cc73e449286bc54209a4cdc7db888fb022e1 Author: Jani Nikula Date: Mon Sep 5 18:00:53 2022 +0300 drm/i915: split out i915_gem.c declarations to i915_gem.h Declutter i915_drv.h by splitting out the declarations for i915_gem.[ch]. Add a fixme comment about the rest of the stuff in i915_gem.h that doesn't really belong there. Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/82a353c5c4b52df2354f9413b547c7619a45d92d.1662390010.git.jani.nikula@intel.com commit 5aea37bf4112896437176704049db2559efcb8a9 Author: Jani Nikula Date: Mon Sep 5 18:00:52 2022 +0300 drm/i915: un-inline i915_gem_drain_freed_objects() I can't idenfity a single hot path that would require i915_gem_drain_freed_objects() to be inline. Un-inline it. Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/6c289c55afee0d9a3067122db63277b8d60cf74f.1662390010.git.jani.nikula@intel.com commit 230bb131a6143b19a78031c64fb8f3b9320dc122 Author: Jani Nikula Date: Mon Sep 5 18:00:51 2022 +0300 drm/i915: un-inline i915_gem_drain_workqueue() i915_gem_drain_workqueue() is not used on any hot paths. Un-unline it. Replace the do-while with a for loop while at it. Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/2c89e7e0a3528caf7ba9ffa29b2bb9f13f2357d1.1662390010.git.jani.nikula@intel.com commit c1bdf4aabc093f7741f6fc6f1a6e942b946283b2 Author: Jani Nikula Date: Mon Sep 5 18:00:50 2022 +0300 drm/i915: remove unused i915_gem_set_global_seqno() declaration The function was removed four years ago in commit 6faf5916e6be ("drm/i915: Remove HW semaphores for gen7 inter-engine synchronisation"). Finish the job. Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/0f88380416c1bd457af58bb31aeb297749a6fb9e.1662390010.git.jani.nikula@intel.com commit 90f9617ab86063a5d7da628137f0b19826648cfd Author: Jani Nikula Date: Mon Sep 5 18:00:49 2022 +0300 drm/i915: remove unused macro I915_GTT_OFFSET_NONE Apparently the last user of the macro was removed in commit 9c4ce97d8025 ("drm/i915/display: Be explicit in handling the preallocated vma"). Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/b28b183457cf8871b1b070cbbbc3473bd5288210.1662390010.git.jani.nikula@intel.com commit 8e3d857c70dd317cb71301d9b49f0506ce409a1e Author: Xin Ji Date: Sat Sep 3 21:08:33 2022 +0800 drm/bridge: anx7625: Set HPD irq detect window to 2ms Some panels trigger HPD irq due to noise, the HPD debounce may be 1.8ms, exceeding the default irq detect window, ~1.4ms. This patch set HPD irq detection window to 2ms to tolerate the HPD noise. Signed-off-by: Xin Ji Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220903130833.541463-1-xji@analogixsemi.com commit 7269734abbf5960d0be9050ba3991c0af1d9f574 Author: Andy Shevchenko Date: Mon Sep 5 19:58:26 2022 +0300 ALSA: hda: cs35l41: Utilize acpi_get_subsystem_id() Replace open coded variant of recently introduced acpi_get_subsystem_id(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220905165826.35979-2-andriy.shevchenko@linux.intel.com Signed-off-by: Takashi Iwai commit aca289f7cd233b3c983b43b59cdaa0d934ea3da7 Author: Andy Shevchenko Date: Mon Sep 5 19:58:25 2022 +0300 ALSA: hda: cs35l41: Call put_device() in the scope of get_device() When put_device() is called in another function it's hard to realize that and easy to "fix" the code in a wrong way. Instead, move put_device() to be in the same scope as get_device(), so we prevent appearance of any attempts to "fix" the code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220905165826.35979-1-andriy.shevchenko@linux.intel.com Signed-off-by: Takashi Iwai commit db77d84cfe3608eac938302f8f7178e44415bcba Author: Guoqing Jiang Date: Sat Sep 3 12:02:52 2022 +0800 RDMA/rtrs-clt: Kill xchg_paths Let's call try_cmpxchg directly for the same purpose. Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20220903040252.29397-1-guoqing.jiang@linux.dev Signed-off-by: Leon Romanovsky commit 57eb9382370e768fc13e9f3bbdca5579f14ffe83 Author: Guoqing Jiang Date: Fri Sep 2 18:19:21 2022 +0800 RDMA/rtrs-clt: Break the loop once one path is connected No need to iterate all paths after find one connected path. Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20220902101922.26273-3-guoqing.jiang@linux.dev Signed-off-by: Leon Romanovsky commit 2aa9e4a2c3db065672fe530fb594a8e31f5672f6 Author: Guoqing Jiang Date: Fri Sep 2 18:19:20 2022 +0800 RDMA/rtrs: Update comments for MAX_SESS_QUEUE_DEPTH The maximum queue_depth should be 65535 per check_module_params, also update other relevant comments. Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20220902101922.26273-2-guoqing.jiang@linux.dev Signed-off-by: Leon Romanovsky commit 4bf23298820093992beac22cc1532414ae189acd Merge: 6c3a9c9ae02a1 ead384d956345 Author: Ard Biesheuvel Date: Tue Sep 6 11:50:16 2022 +0200 Merge tag 'efi-loongarch-for-v6.1' into efi/next EFI boot support for loongarch commit ee9db0e14b0575aa827579dc2471a29ec5fc6877 Author: Kan Liang Date: Thu Sep 1 06:09:59 2022 -0700 perf: Use sample_flags for txn Use the new sample_flags to indicate whether the txn field is filled by the PMU driver. Remove the txn field from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-7-kan.liang@linux.intel.com commit e16fd7f2cb1a65555cfe76f983eaefb1eab7471f Author: Kan Liang Date: Thu Sep 1 06:09:58 2022 -0700 perf: Use sample_flags for data_src Use the new sample_flags to indicate whether the data_src field is filled by the PMU driver. Remove the data_src field from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-6-kan.liang@linux.intel.com commit 2abe681da0a192ab850a5271d838a7817b469fca Author: Kan Liang Date: Thu Sep 1 06:09:57 2022 -0700 perf: Use sample_flags for weight Use the new sample_flags to indicate whether the weight field is filled by the PMU driver. Remove the weight field from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-5-kan.liang@linux.intel.com commit a9a931e2666878343782c82d7d55cc173ddeb3e9 Author: Kan Liang Date: Thu Sep 1 06:09:56 2022 -0700 perf: Use sample_flags for branch stack Use the new sample_flags to indicate whether the branch stack is filled by the PMU driver. Remove the br_stack from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-4-kan.liang@linux.intel.com commit 47a3aeb39e8dc099ae431cd8b46bdf218f5511b2 Author: Kan Liang Date: Thu Sep 1 06:09:55 2022 -0700 perf/x86/intel/pebs: Fix PEBS timestamps overwritten The PEBS TSC-based timestamps do not appear correctly in the final perf.data output file from perf record. The data->time field setup by PEBS in the setup_pebs_fixed_sample_data() is later overwritten by perf_events generic code in perf_prepare_sample(). There is an ordering problem. Set the sample flags when the data->time is updated by PEBS. The data->time field will not be overwritten anymore. Reported-by: Andreas Kogler Reported-by: Stephane Eranian Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-3-kan.liang@linux.intel.com commit 3aac580d5cc3001ca1627725b3b61edb529f341d Author: Kan Liang Date: Thu Sep 1 06:09:54 2022 -0700 perf: Add sample_flags to indicate the PMU-filled sample data On some platforms, some data e.g., timestamps, can be retrieved from the PMU driver. Usually, the data from the PMU driver is more accurate. The current perf kernel should output the PMU-filled sample data if it's available. To check the availability of the PMU-filled sample data, the current perf kernel initializes the related fields in the perf_sample_data_init(). When outputting a sample, the perf checks whether the field is updated by the PMU driver. If yes, the updated value will be output. If not, the perf uses an SW way to calculate the value or just outputs the initialized value if an SW way is unavailable either. With more and more data being provided by the PMU driver, more fields has to be initialized in the perf_sample_data_init(). That will increase the number of cache lines touched in perf_sample_data_init() and be harmful to the performance. Add new "sample_flags" to indicate the PMU-filled sample data. The PMU driver should set the corresponding PERF_SAMPLE_ flag when the field is updated. The initialization of the corresponding field is not required anymore. The following patches will make use of it and remove the corresponding fields from the perf_sample_data_init(), which will further minimize the number of cache lines touched. Only clear the sample flags that have already been done by the PMU driver in the perf_prepare_sample() for the PERF_RECORD_SAMPLE. For the other PERF_RECORD_ event type, the sample data is not available. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220901130959.1285717-2-kan.liang@linux.intel.com commit 4c8d695cb9bc5f6fd298a586602947b2fc099a64 Author: Takashi Iwai Date: Tue Sep 6 11:23:06 2022 +0200 ALSA: hda: beep: Simplify keep-power-at-enable behavior The recent fix for IDT codecs to keep the power up while the beep is enabled can be better integrated into the beep helper code. This patch cleans up the code with refactoring. Fixes: 414d38ba8710 ("ALSA: hda/sigmatel: Keep power up while beep is enabled") Link: https://lore.kernel.org/r/20220906092306.26183-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ead384d956345681e1ddf97890d5e15ded015f07 Author: Huacai Chen Date: Fri Aug 19 18:20:37 2022 +0800 efi/loongarch: Add efistub booting support This patch adds efistub booting support, which is the standard UEFI boot protocol for LoongArch to use. We use generic efistub, which means we can pass boot information (i.e., system table, memory map, kernel command line, initrd) via a light FDT and drop a lot of non-standard code. We use a flat mapping to map the efi runtime in the kernel's address space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result, flat mapping is not identity mapping, SetVirtualAddressMap() is still needed for the efi runtime. Tested-by: Xi Ruoyao Signed-off-by: Huacai Chen [ardb: change fpic to fpie as suggested by Xi Ruoyao] Signed-off-by: Ard Biesheuvel commit 6392dcd1d0c7034ccf630ec55fc9e5810ecadf3b Author: Takashi Iwai Date: Sun Sep 4 18:12:47 2022 +0200 ALSA: usb-audio: Register card at the last interface The USB-audio driver matches per interface, and as default, it registers the card instance at the very first instance. This can be a problem for the devices that have multiple interfaces to be probed, as the udev rule isn't applied properly for the later appearing interfaces. Although we introduced the delayed_register option and the quirks for covering those shortcomings, it's nothing but a workaround for specific devices. This patch is an another attempt to fix the problem in a more generic way. Now the driver checks the whole USB device descriptor at the very first time when an interface is attached to a sound card. It looks at each matching interface in the descriptor and remembers the last matching one. The snd_card_register() is invoked only when this last interface is probed. After this change, the quirks for the delayed registration become superfluous, hence they are removed along with the patch. OTOH, the delayed_register option is still kept, as it might be useful for some corner cases (e.g. a special driver overtakes the interface probe from the standard driver, and the last interface probe may miss). Link: https://lore.kernel.org/r/20220904161247.16461-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 16c5cde20e304cd900371b140cd53ecafe8d3de5 Merge: 32eeeed963ad4 37137ec26c2c0 Author: Takashi Iwai Date: Tue Sep 6 11:04:03 2022 +0200 Merge branch 'for-linus' into for-next Once again back-merge the 6.0-rc devel branch for further USB-audio and HD-audio developments. Signed-off-by: Takashi Iwai commit 8284bae723f025cb6a8431566757a3854a3c53eb Merge: 2c2d7a67defa1 8869fa666a9e6 Author: Daniel Vetter Date: Tue Sep 6 10:56:03 2022 +0200 Merge tag 'drm-misc-next-2022-08-20-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.1: UAPI Changes: Cross-subsystem Changes: - DMA-buf: documentation updates. - Assorted small fixes to vga16fb - Fix fbdev drivers to use the aperture helpers. - Make removal of conflicting drivers work correctly without fbdev enabled. Core Changes: - bridge, scheduler, dp-mst: Assorted small fixes. - Add more format helpers to fourcc, and use it to replace the cpp usage. - Add DRM_FORMAT_Cxx, DRM_FORMAT_Rxx (single channel), and DRM_FORMAT_Dxx ("darkness", inverted single channel) - Add packed AYUV8888 and XYUV8888 formats. - Assorted documentation updates. - Rename ttm_bo_init to ttm_bo_init_validate. - Allow TTM bo's to exist without backing store. - Convert drm selftests to kunit. - Add managed init functions for (panel) bridge, crtc, encoder and connector. - Fix endianness handling in various format conversion helpers. - Make tests pass on big-endian platforms, and add test for rgb888 -> rgb565 - Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers and rename, so drm_plane_helper is no longer needed in most drivers. - Use idr_init_base instead of idr_init. - Rename FB and GEM CMA helpers to DMA helpers. - Rework XRGB8888 related conversion helpers, and add drm_fb_blit() that takes a iosys_map. Make drm_fb_memcpy take an iosys_map too. - Move edid luminance calculation to core, and use it in i915. Driver Changes: - bridge/{adv7511,ti-sn65dsi86,parade-ps8640}, panel/{simple,nt35510,tc358767}, nouveau, sun4i, mipi-dsi, mgag200, bochs, arm, komeda, vmwgfx, pl111: Assorted small fixes and doc updates. - vc4: Rework hdmi power up, and depend on PM. - panel/simple: Add Samsung LTL101AL01. - ingenic: Add JZ4760(B) support, avoid a modeset when sharpness property is unchanged, and use the new PM ops. - Revert some amdgpu commits that cause garbaged graphics when starting X, and reapply them with the real problem fixed. - Completely rework vc4 init to use managed helpers. - Rename via_drv to via_dri1, and move all stuff there only used by the dri1 implementation in preperation for atomic modeset. - Use regmap bulk write in ssd130x. - Power sequence and clock updates to it6505. - Split panel-sitrox-st7701 init sequence and rework mode programming code. - virtio: Improve error and edge conditions handling, and convert to use managed helpers. - Add Samsung LTL101AL01, B120XAN01.0, R140NWF5 RH, DMT028VGHMCMI-1A T, panels. - Add generic fbdev support to komeda. - Split mgag200 modeset handling to make it more model-specific. - Convert simpledrm to use atomic helpers. - Improve udl suspend/disconnect handling. Signed-off-by: Daniel Vetter From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/f0c71766-61e8-19b7-763a-5fbcdefc633d@linux.intel.com commit 873fef8833ea794526b7f4179088e565078fe0e8 Author: Matthew Auld Date: Mon Sep 5 11:53:29 2022 +0100 drm/i915: consider HAS_FLAT_CCS() in needs_ccs_pages Just move the HAS_FLAT_CCS() check into needs_ccs_pages. This also then fixes i915_ttm_memcpy_allowed() which was incorrectly reporting true on DG1, even though it doesn't have small-BAR or flat-CCS. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6605 Fixes: efeb3caf4341 ("drm/i915/ttm: disallow CPU fallback mode for ccs pages") Signed-off-by: Matthew Auld Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220905105329.41455-1-matthew.auld@intel.com commit 3fc24ef32d3b9368f4c103dcd21d6a3f959b4870 Author: Ard Biesheuvel Date: Fri Jul 1 15:53:22 2022 +0200 arm64: compat: Implement misalignment fixups for multiword loads The 32-bit ARM kernel implements fixups on behalf of user space when using LDM/STM or LDRD/STRD instructions on addresses that are not 32-bit aligned. This is not something that is supported by the architecture, but was done anyway to increase compatibility with user space software, which mostly targeted x86 at the time and did not care about aligned accesses. This feature is one of the remaining impediments to being able to switch to 64-bit kernels on 64-bit capable hardware running 32-bit user space, so let's implement it for the arm64 compat layer as well. Note that the intent is to implement the exact same handling of misaligned multi-word loads and stores as the 32-bit kernel does, including what appears to be missing support for user space programs that rely on SETEND to switch to a different byte order and back. Also, like the 32-bit ARM version, we rely on the faulting address reported by the CPU to infer the memory address, instead of decoding the instruction fully to obtain this information. This implementation is taken from the 32-bit ARM tree, with all pieces removed that deal with instructions other than LDRD/STRD and LDM/STM, or that deal with alignment exceptions taken in kernel mode. Cc: debian-arm@lists.debian.org Cc: Vagrant Cascadian Cc: Riku Voipio Cc: Steve McIntyre Signed-off-by: Ard Biesheuvel Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220701135322.3025321-1-ardb@kernel.org [catalin.marinas@arm.com: change the option to 'default n'] Signed-off-by: Catalin Marinas commit b008f4a195af92052f69a10869a06e9c403efe63 Author: Johannes Berg Date: Tue Sep 6 10:33:44 2022 +0200 wifi: rsi: fix kernel-doc warning One of my previous patches here changed the function prototype, but since it was (half?) automated, I didn't update the docs. Fix that now. Fixes: b3e2130bf5f6 ("wifi: mac80211: change QoS settings API to take link into account") Signed-off-by: Johannes Berg commit 03fdb11da92fde0bdc0b6e9c1c642b7414d49e8d Author: Sergei Antonov Date: Fri Sep 2 15:50:37 2022 +0300 net: moxa: fix endianness-related issues from 'sparse' Sparse checker found two endianness-related issues: .../moxart_ether.c:34:15: warning: incorrect type in assignment (different base types) .../moxart_ether.c:34:15: expected unsigned int [usertype] .../moxart_ether.c:34:15: got restricted __le32 [usertype] .../moxart_ether.c:39:16: warning: cast to restricted __le32 Fix them by using __le32 type instead of u32. Signed-off-by: Sergei Antonov Link: https://lore.kernel.org/r/20220902125037.1480268-1-saproj@gmail.com Signed-off-by: Paolo Abeni commit 9df696b3b3a4c96c3219eb87c7bf03fb50e490b8 Author: Sergei Antonov Date: Fri Sep 2 14:37:49 2022 +0300 net: ftmac100: fix endianness-related issues from 'sparse' Sparse found a number of endianness-related issues of these kinds: .../ftmac100.c:192:32: warning: restricted __le32 degrades to integer .../ftmac100.c:208:23: warning: incorrect type in assignment (different base types) .../ftmac100.c:208:23: expected unsigned int rxdes0 .../ftmac100.c:208:23: got restricted __le32 [usertype] .../ftmac100.c:249:23: warning: invalid assignment: &= .../ftmac100.c:249:23: left side has type unsigned int .../ftmac100.c:249:23: right side has type restricted __le32 .../ftmac100.c:527:16: warning: cast to restricted __le32 Change type of some fields from 'unsigned int' to '__le32' to fix it. Signed-off-by: Sergei Antonov Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220902113749.1408562-1-saproj@gmail.com Signed-off-by: Paolo Abeni commit 8fb7e2ef4bab89a7a266ff9ea4d284d0552f4b0d Author: Johannes Berg Date: Fri Sep 2 16:12:57 2022 +0200 wifi: mac80211_hwsim: always activate all links By default, even in client mode, hwsim always had all links active, where it then uses them in a round-robin fashion. Re-enable that by activating all valid links work right after the connection is authorized. Signed-off-by: Johannes Berg commit 3d901102922723eedce6ef10ebd03315a7abb8a5 Author: Johannes Berg Date: Fri Sep 2 16:12:56 2022 +0200 wifi: mac80211: implement link switching Implement an API function and debugfs file to switch active links. Also provide an async version of the API so drivers can call it in arbitrary contexts, e.g. while in the authorized callback. Signed-off-by: Johannes Berg commit 4c51541ddb78cef2da9c4c30006c0d9d06ea9a77 Author: Benjamin Berg Date: Fri Sep 2 16:12:54 2022 +0200 wifi: mac80211: keep A-MSDU data in sta and per-link The A-MSDU data needs to be stored per-link and aggregated into a single value for the station. Add a new struct ieee_80211_sta_aggregates in order to store this data and a new function ieee80211_sta_recalc_aggregates to update the current data for the STA. Note that in the non MLO case the pointer in ieee80211_sta will directly reference the data in deflink.agg, which means that recalculation may be skipped in that case. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg commit 189a0c52f3104d93ac40c3d5b2dcb96cf283d4fd Author: Johannes Berg Date: Fri Sep 2 16:12:53 2022 +0200 wifi: mac80211: set up beacon timing config on links On secondary MLO links, I forgot to set the beacon interval and DTIM period, fix that. Signed-off-by: Johannes Berg commit 65fd846cb3f94ae63134fbd0f32564cf82539eaa Author: Johannes Berg Date: Fri Sep 2 16:12:52 2022 +0200 wifi: mac80211: add vif/sta link RCU dereference macros Add macros (and an exported function) to allow checking some link RCU protected accesses that are happening in callbacks from mac80211 and are thus under the correct lock. Signed-off-by: Johannes Berg commit 5fc8cea93e125686369efd478ff7670d0ddc13b6 Author: Johannes Berg Date: Fri Sep 2 16:12:48 2022 +0200 wifi: mac80211_hwsim: send NDP for link (de)activation In hwsim we now track when we receive NDP (or other frames carrying a PM bit) to see if a link should be active, but then of course we also need to transmit NDPs to at least set a link to inactive when we deacivate it. Implement that as well as sending an NDP when we activate a link, which allows receiving frames before transmitting any. Signed-off-by: Johannes Berg commit 0ab26380d98655f0aab720704debfa2ac522cefd Author: Johannes Berg Date: Fri Sep 2 16:12:47 2022 +0200 wifi: mac80211: extend ieee80211_nullfunc_get() for MLO Add a link_id parameter to ieee80211_nullfunc_get() to be able to obtain a correctly addressed frame. Signed-off-by: Johannes Berg commit e229f978293ef83b7412189610117ee9ac18a3ab Author: Johannes Berg Date: Fri Sep 2 16:12:45 2022 +0200 wifi: mac80211_hwsim: track active STA links Track the powersave bit on frames where we can look up the STA by link addresses and set the links active or inactive accordingly, and use this information to TX only on links that are actually active in the peer. Note that this doesn't implement powersave fully so if no link is active things will not work right. Signed-off-by: Johannes Berg commit 6521ee74636d11cc895ccc2ba845de7969a30221 Author: Johannes Berg Date: Fri Sep 2 16:12:44 2022 +0200 wifi: mac80211_hwsim: skip inactive links on TX With the link activation handling in mac80211, skip any inactive links on TX. Signed-off-by: Johannes Berg commit ffa9598ecb93630a45564b95ae17362b819b38de Author: Johannes Berg Date: Fri Sep 2 16:12:43 2022 +0200 wifi: mac80211: add ieee80211_find_sta_by_link_addrs API Add a new API function ieee80211_find_sta_by_link_addrs() that looks up the STA and link ID based on interface and station link addresses. We're going to use it for mac80211-hwsim to track on the AP side which links are active. Signed-off-by: Johannes Berg commit efe9c2bfd1a82894e455514a68dc794556fbd463 Author: Johannes Berg Date: Fri Sep 2 16:12:42 2022 +0200 wifi: mac80211: isolate driver from inactive links In order to let the driver select active links and properly make multi-link connections, as a first step isolate the driver from inactive links, and set the active links to be only the association link for client-side interfaces. For AP side nothing changes since APs always have to have all their links active. To simplify things, update the for_each_sta_active_link() API to include the appropriate vif pointer. This also implies not allocating a chanctx for an inactive link, which requires a few more changes. Since we now no longer try to program multiple links to the driver, remove the check in the MLME code. Signed-off-by: Johannes Berg commit 261ce8879578f42bc1ff3385ff1be8e31d6fb160 Author: Benjamin Berg Date: Fri Sep 2 16:12:41 2022 +0200 wifi: mac80211: make smps_mode per-link The SMPS power save mode needs to be per-link rather than being shared for all links. As such, move it into struct ieee80211_link_sta. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg commit b320d6c456ff2aa43491654407d448bcfa58ac9f Author: Benjamin Berg Date: Fri Sep 2 16:12:40 2022 +0200 wifi: mac80211: use correct rx link_sta instead of default Use rx->link_sta everywhere instead of accessing the default link. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg commit e95a7f3ddc1b47838e5c131f77eb9525724c3e73 Author: Johannes Berg Date: Tue Sep 6 10:08:37 2022 +0200 wifi: mac80211: set link_sta in reorder timeout Now that we have a link_sta pointer in the rx struct we also need to fill it in all the cases. It didn't matter so much until now as we weren't using it, but the code should really be able to assume that if the rx.sta is set, so is rx.link_sta. Fixes: ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling") Signed-off-by: Johannes Berg commit b38d15294ffe9b87b092d310f321e2d0a9d2b3b2 Merge: 9837ec955b46b 2aec909912da5 Author: Johannes Berg Date: Tue Sep 6 10:05:29 2022 +0200 Merge remote-tracking branch 'wireless/main' into wireless-next Merge wireless/main to get the rx.link fix, which is needed for further work in this area. Signed-off-by: Johannes Berg commit d5edc797ef0341ae2c8d4afaad9363edbf487a3a Author: Horatiu Vultur Date: Fri Sep 2 13:15:48 2022 +0200 net: lan966x: Extend lan966x with RGMII support Extend lan966x with RGMII support. The MAC supports all RGMII_* modes. Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220902111548.614525-1-horatiu.vultur@microchip.com Signed-off-by: Paolo Abeni commit e1a84ba850128b3984973786829e610ae4ee0e2e Author: Stanislav Lisovskiy Date: Mon Sep 5 11:57:44 2022 +0300 drm/i915: Add DSC support to MST path Whenever we are not able to get enough timeslots for required PBN, let's try to allocate those using DSC, just same way as we do for SST. v2: Removed intel_dp_mst_dsc_compute_config and refactored intel_dp_dsc_compute_config to support timeslots as a parameter(Ville Syrjälä) v3: - Rebased - Added a debug to see that we at least try reserving VCPI slots using DSC, because currently its not visible from the logs, thus making debugging more tricky. - Moved timeslots to numerator, where it should be. v4: - Call drm_dp_mst_atomic_check already during link config computation, because we need to know already by this moment if uncompressed amount of VCPI slots needed can fit, otherwise we need to use DSC. (thanks to Vinod Govindapillai for pointing this out) v5: - Put pipe_config->bigjoiner_pipes back to original condition in intel_dp_dsc_compute_config (don't remember when I lost it) v6: - Removed unnecessary drm_dp_mst_atomic_check as it is now always called in a newly introduced intel_dp_mst_find_vcpi_slots_for_bpp function (Vinod Govindapillai) Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220905085744.29637-5-stanislav.lisovskiy@intel.com commit 7ae5ab441402b8165de4658ba9398d8378f7dd1e Author: Stanislav Lisovskiy Date: Mon Sep 5 11:57:43 2022 +0300 drm/i915: Extract drm_dp_atomic_find_vcpi_slots cycle to separate function We would be using almost same code to loop through bpps while calling drm_dp_atomic_find_vcpi_slots - lets remove this duplication by introducing a new function intel_dp_mst_find_vcpi_slots_for_bpp v2: Fix pbn_div calculation - shouldn't matter if its DSC or not. Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220905085744.29637-4-stanislav.lisovskiy@intel.com commit c6266862de1665b8c8006f58612db2dea66a29f6 Author: Stanislav Lisovskiy Date: Mon Sep 5 11:57:42 2022 +0300 drm/i915: Fix intel_dp_mst_compute_link_config We currently always exit that bpp loop because drm_dp_atomic_find_vcpi_slots doesn't care if we actually can fit those or not. I think that wasn't the initial intention here, especially when we keep trying with lower bpps, we are supposed to keep trying until we actually find some _working_ configuration, which isn't the case here. So added that drm_dp_mst_check here, so that we can make sure that try all the bpps before we fail. Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220905085744.29637-3-stanislav.lisovskiy@intel.com commit 797e2c3f2762c356aadcdb53dd6bb8b8d966f7b5 Author: Stanislav Lisovskiy Date: Mon Sep 5 11:57:41 2022 +0300 drm: Add missing DP DSC extended capability definitions. Adding DP DSC register definitions, we might need for further DSC implementation, supporting MST and DP branch pass-through mode. v2: - Fixed checkpatch comment warning v3: - Removed function which is not yet used(Jani Nikula) Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220905085744.29637-2-stanislav.lisovskiy@intel.com commit bcedce7cf49da06d43bbd0eb47f9f4bcbbb6de12 Merge: 318d8235bcb8e 170277c532780 Author: Marc Kleine-Budde Date: Tue Sep 6 08:41:15 2022 +0200 Merge patch series "can: raw: random optimizations" Ziyang Xuan says: Do some small optimizations for can_raw. Link: https://lore.kernel.org/all/cover.1661584485.git.william.xuanziyang@huawei.com Signed-off-by: Marc Kleine-Budde commit 170277c532780392051fee48260896ed280cfbef Author: Ziyang Xuan Date: Sat Aug 27 15:20:11 2022 +0800 can: raw: use guard clause to optimize nesting in raw_rcv() We can use guard clause to optimize nesting codes like if (condition) { ... } else { return; } in raw_rcv(); Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/0170ad1f07dbe838965df4274fce950980fa9d1f.1661584485.git.william.xuanziyang@huawei.com Signed-off-by: Marc Kleine-Budde commit c28b3bffe49e713ce67f0e36de13b8f9f0776837 Author: Ziyang Xuan Date: Sat Aug 27 15:20:10 2022 +0800 can: raw: process optimization in raw_init() Now, register notifier after register proto successfully. It can create raw socket and set socket options once register proto successfully, so it is possible missing notifier event before register notifier successfully although this is a low probability scenario. Move notifier registration to the front of proto registration like done in j1939. In addition, register_netdevice_notifier() may fail, check its result is necessary. Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/7af9401f0d2d9fed36c1667b5ac9b8df8f8b87ee.1661584485.git.william.xuanziyang@huawei.com Signed-off-by: Marc Kleine-Budde commit 318d8235bcb8e9b6a42ce4a1190c23e577ed0833 Author: Dario Binacchi Date: Sun Aug 28 15:44:42 2022 +0200 docs: networking: device drivers: flexcan: fix invalid email The Amarula contact info email address is wrong, so fix it up to use the correct one. Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/all/20220828134442.794990-1-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde commit 2a50db2656e028ddead3558021722de59cdb1072 Author: Krzysztof Kozlowski Date: Tue Aug 23 13:10:11 2022 +0300 dt-bindings: net: can: nxp,sja1000: drop ref from reg-io-width reg-io-width is a standard property, so no need for defining its type Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/all/20220823101011.386970-1-krzysztof.kozlowski@linaro.org Signed-off-by: Marc Kleine-Budde commit 6fc5d84e6d85dcb3af6ba32c45fc65304946f134 Author: Gustavo A. R. Silva Date: Mon Aug 29 16:50:59 2022 -0500 can: etas_es58x: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length array declaration in union es58x_urb_cmd with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for a flexible-array member in a union. Link: https://github.com/KSPP/linux/issues/193 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Acked-by: Vincent Mailhol Reviewed-by: Kees Cook Link: https://lore.kernel.org/all/Yw00w6XRcq7B6ub6@work Signed-off-by: Marc Kleine-Budde commit 26f6a2aefd3167a06ac0e9de1fb09b8900878eea Merge: 7912fc9905fff 45dfa45f52e66 Author: Marc Kleine-Budde Date: Tue Sep 6 08:23:43 2022 +0200 Merge patch series "can: gs_usb: hardware timestamp support" Marc Kleine-Budde says: after noticing that the gs_usb firmware sends timestamps on the TX, too, I updated the driver and squashed the 2nd patch. Also added proper endianness handling to gs_usb_get_timestamp(). I allowed to add myself as Co-developed-by. Changes since v2: https://lore.kernel.org/all/20220827092545.2971240-1-mkl@pengutronix.de - new patch 1/2: use common spelling of GS_USB in macros - squashed both old patches into now 2/2 - use GS_USB instead of GSUSB in macros - gs_usb_get_timestamp(): renamed from gs_usb_get_sof_timestamp() - gs_usb_get_timestamp(): take care of endianness - gs_usb_skb_set_timestamp(): renamed from gs_usb_set_timestamp() - gs_usb_set_timestamp(): add new function to add timestamp to skb from struct gs_host_frame - add support for TX timestamps - gs_can_eth_ioctl(): return -EOPNOTSUPP if device doesn't support GS_CAN_FEATURE_HW_TIMESTAMP - gs_usb_get_ts_info(): renamed from gs_usb_get_ts_info_hwts() - gs_usb_get_ts_info(): call can_ethtool_op_get_ts_info_hwts() if device supports GS_CAN_FEATURE_HW_TIMESTAMP, call ethtool_op_get_ts_info() otherwise Changes since v1: https://lore.kernel.org/all/20220826104629.2837024-1-mkl@pengutronix.de - add new includes sorted - adjust multi line comment style - don't use 1e6, but 1 * HZ_PER_MHZ, to fix sparse warning - use __le32 instead of u32 in struct classic_can_ts and canfd_ts - place _ts in front of _quirk in union in struct gs_host_frame - gs_usb_get_sof_timestamp(): pass "const struct gs_can *dev" as 1st argument, not struct net_device *netdev, simplify return handling - gs_usb_timestamp_init(), gs_usb_timestamp_stop(), gs_usb_get_ts_info_hwts(): make static - gs_usb_timestamp_init(): increase cc->shift to maximize precision - fix long lines, remove braces {} for single statement blocks - gs_can_open(): move check for GS_CAN_FEATURE_HW_TIMESTAMP after all ctrlmode checks - gs_can_open(): move start polling sof timestamp after kfree(dm) - gs_can_close(): move stop polling sof timestamp to be symmetric with respect to gs_can_open() - gs_usb_probe(): make calculation of dev->hf_size_rx more robust Link: https://lore.kernel.org/all/20220827221548.3291393-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 45dfa45f52e66f8eee30a64b16550a9c47915044 Author: John Whittington Date: Mon Aug 22 12:01:10 2022 +0200 can: gs_usb: add RX and TX hardware timestamp support Add support for hardware timestamps, if the firmware includes it as a feature via the GS_CAN_FEATURE_HW_TIMESTAMP flag. Check for this feature during probe, extend the RX expected length if it is and enable it during open. The struct classic_can_ts and struct canfd_ts are extended to include the µs timestamp following data as defined in the firmware. The timestamp is then captured and set using skb_hwtstamps() on each RX and TX. The frame µs timestamp is provided from a 32 bit 1 MHz timer which rolls over every 4294 seconds, so a cyclecounter, timecounter, and delayed worker are used to convert the timer into a proper ns timestamp - same implementation as commit efd8d98dfb900 ("can: mcp251xfd: add HW timestamp infrastructure"). Hardware timestamps are added to capabilities as commit b1f6b93e678f ("can: mcp251xfd: advertise timestamping capabilities and add ioctl support"). Signed-off-by: John Whittington Link: https://github.com/candle-usb/candleLight_fw/issues/100 Link: https://lore.kernel.org/all/20220827221548.3291393-3-mkl@pengutronix.de Co-developed-by: Marc Kleine-Budde Signed-off-by: Marc Kleine-Budde commit 49c007b9ecead37a7c703aac7d161c9c5bc25527 Author: Marc Kleine-Budde Date: Sat Aug 27 19:03:25 2022 +0200 can: gs_usb: use common spelling of GS_USB in macros There are a few macros in the driver which use GSUSB in the name of the macro, while the majority uses GS_USB. Convert all macros to GS_USB. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Fixes: b00ca070e022 ("can: gs_usb: activate quirks for CANtact Pro unconditionally") Link: https://lore.kernel.org/all/20220827221548.3291393-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2be570849efc4e1ceda6a8384184f493f558f188 Author: Neal Liu Date: Mon Sep 5 10:54:33 2022 +0800 crypto: aspeed - fix build module error If CONFIG_MODULES=y and CONFIG_CRYPTO_DEV_ASPEED=m, build modpost would be failed. Error messages: ERROR: modpost: "aspeed_register_hace_hash_algs" [drivers/crypto/aspeed/aspeed_crypto.ko] undefined! ERROR: modpost: "aspeed_unregister_hace_hash_algs" [drivers/crypto/aspeed/aspeed_crypto.ko] undefined! Change build sequence to fix this. Reported-by: kernel test robot Signed-off-by: Neal Liu Tested-by: Sudip Mukherjee Signed-off-by: Herbert Xu commit 94b22e125175e0c57d044c18d122ad5991348ca3 Author: Francesco Dolcini Date: Mon Sep 5 20:15:17 2022 -0700 dt-bindings: input: touchscreen: stmpe: Remove node name requirement STMPE driver does not require a specific node name anymore, only the compatible is checked, update binding according to this. Signed-off-by: Francesco Dolcini Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220712163345.445811-6-francesco.dolcini@toradex.com Signed-off-by: Dmitry Torokhov commit d0909bf4fa0fd79f59813952d868d0ad2fab656a Author: Johan Hovold Date: Mon Sep 5 11:16:02 2022 +0200 arm64: dts: qcom: fix syscon node names Some recent changes that added new syscon nodes used misspelled node names. Fixes: 86d7c9460e2c arm64: dts: qcom: sm8150: split TCSR halt regs out of mutex Fixes: 0da603387225 arm64: dts: qcom: sdm630: split TCSR halt regs out of mutex Fixes: 8a8531e69b2d arm64: dts: qcom: sdm845: split TCSR halt regs out of mutex Fixes: d9a2214d6ba5 arm64: dts: qcom: sc7280: split TCSR halt regs out of mutex Fixes: ce1ac53c7faa arm64: dts: qcom: sc7180: split TCSR halt regs out of mutex Fixes: fc10cfa38580 arm64: dts: qcom: msm8998: split TCSR halt regs out of mutex Fixes: 100ce2205924 arm64: dts: qcom: msm8996: split TCSR halt regs out of mutex Signed-off-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220905091602.20364-1-johan+linaro@kernel.org commit ae240fbffbad6b2f1fc7f2d2f0bb8cf300c489a5 Author: Johan Hovold Date: Fri Sep 2 10:16:52 2022 +0200 arm64: dts: qcom: sc8280xp: mark USB controllers as wakeup-sources The primary and secondary USB controllers can be used to wake the system from suspend so mark them accordingly. Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio Tested-by: Steev Klimaszewski #Lenovo Thinkpad X13s Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902081652.12631-1-johan+linaro@kernel.org commit 2abf6b6b94290e10974bdd5f42e5ed73975f4452 Author: Sheng-Liang Pan Date: Fri Sep 2 16:09:11 2022 +0800 arm64: dts: qcom: sc7280: Add device tree for herobrine evoker Add a basic device tree for the herobrine evoker board. Signed-off-by: Sheng-Liang Pan Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902160845.v5.2.I7dd7a79c4cc5fe91c3feb004473feb3b34b7b2d8@changeid commit 8336a4e7611950cbde287a65e91eadcf0803bc1e Author: Sheng-Liang Pan Date: Fri Sep 2 16:09:10 2022 +0800 dt-bindings: arm: qcom: document sc7280 and evoker board This adds Chromebook Evoker to the yaml. Signed-off-by: Sheng-Liang Pan Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902160845.v5.1.Ief93544cd0cbfa412092f5de92de10d59a2a5b3a@changeid commit b2f3eac1b77c6feba4daff83de9436fcf728a5e5 Author: Rajendra Nayak Date: Fri Sep 2 10:05:11 2022 +0530 arm64: dts: qcom: sc7280: Add cpu and llcc BWMON Add cpu and llcc BWMON nodes and their corresponding OPP tables for sc7280 SoC. Signed-off-by: Rajendra Nayak Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902043511.17130-5-quic_rjendra@quicinc.com commit cdad59c2d8698505c328c19832fbd2781e79adac Author: Rajendra Nayak Date: Fri Sep 2 10:05:10 2022 +0530 soc: qcom: icc-bwmon: force clear counter/irq registers In some SoCs we have to force clear the counter/irq clear registers as they are not self clearing after they are written into. sc7280 seems to be one such SoC, handle this with a quirk flag. Signed-off-by: Rajendra Nayak Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902043511.17130-4-quic_rjendra@quicinc.com commit 1335fc5b24d3fd51bdae0747b153433f2969edfc Author: Rajendra Nayak Date: Fri Sep 2 10:05:09 2022 +0530 soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON Add support for sc7280 BWMON instance measuring traffic between LLCC and memory with the v5 register layout. Signed-off-by: Rajendra Nayak Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902043511.17130-3-quic_rjendra@quicinc.com commit b7c84ae757c2e5421f5172d78b76307ace5cde67 Author: Rajendra Nayak Date: Fri Sep 2 10:05:08 2022 +0530 dt-bindings: interconnect: qcom,msm8998-bwmon: Add support for sc7280 BWMONs Add a compatible for the cpu BWMON (version 4) instance and one for the llcc BWMON (version 5) found in sc7280 SoC. Signed-off-by: Rajendra Nayak Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220902043511.17130-2-quic_rjendra@quicinc.com commit c28c2d4abdf95655001992c4f52dc243ba00cac3 Author: Michael Ellerman Date: Mon Sep 5 14:56:37 2022 +1000 powerpc/pasemi: Use of_root in pas_pci_init() Currently in pas_pci_init() a reference to the root node is leaked due to a missing of_node_put(). Instead just use of_root directly. Note that converting to of_find_compatible_node(NULL, ...) would not be entirely equivalent, because that would check the compatible property of the root node, whereas using of_root skips checking the root node and start the search at the first child of the root. Reported-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220906010313.1296714-1-mpe@ellerman.id.au commit 245685495bff35062a394f5cdbd32b237dc596a5 Author: Russell Currey Date: Sat Aug 27 16:39:46 2022 +1000 powerpc/pasemi: Use strscpy instead of strlcpy find_i2c_driver() contained the last usage of strlcpy() in arch/powerpc. The return value was used to check if strlen(src) >= n, for which strscpy() returns -E2BIG. Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220827063946.9073-1-ruscur@russell.cc commit 9b135eef0787813ad073aaeb9ff80ab57bc63e69 Author: Jilin Yuan Date: Wed Aug 31 08:47:06 2022 +0800 powerpc/xive: fix repeated words in comments Delete the redundant word 'set'. Signed-off-by: Jilin Yuan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220831004706.35280-1-yuanjilin@cdjrlc.com commit 0d4bb5e45aa698f2f357b1424b842bebe13b1c8b Author: Jilin Yuan Date: Wed Aug 31 08:49:14 2022 +0800 powerpc/vas: fix repeated words in comments Delete the redundant word 'the'. Signed-off-by: Jilin Yuan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220831004914.37055-1-yuanjilin@cdjrlc.com commit 4c73cadcdc64b53248bca85baa8a19e7384701ec Author: Jilin Yuan Date: Wed Aug 31 08:51:09 2022 +0800 powerpc/mobility: fix repeated words in comments Delete the redundant word 'the'. Signed-off-by: Jilin Yuan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220831005109.38314-1-yuanjilin@cdjrlc.com commit 024744964ef6c0a65e348afafd4e1feae08eba5e Author: Ondrej Jirman Date: Mon Sep 5 01:36:47 2022 +0200 arm64: dts: rockchip: Fix SD card controller probe on Pinephone Pro Voltage constraints on vccio_sd are invalid. They don't match the voltages that LDO9 can generate, and this causes rk808-regulator driver to fail to probe with -EINVAL when it tries to apply the constraints during boot. Fix the constraints to something that LDO9 can be actually configured for. Fixes: 78a21c7d5952 ("arm64: dts: rockchip: Add initial support for Pine64 PinePhone Pro") Signed-off-by: Ondrej Jirman Reviewed-by: Caleb Connolly Reviewed-by: Tom Fitzhenry Tested-by: Tom Fitzhenry Link: https://lore.kernel.org/r/20220904233652.3197885-1-megi@xff.cz Signed-off-by: Heiko Stuebner commit 396369d6754993e40f1c84b2e22e40e92dfa4c49 Author: Igor Torrente Date: Mon Sep 5 16:08:11 2022 -0300 drm: vkms: Add support to the RGB565 format This commit also adds new helper macros to deal with fixed-point arithmetic. It was done to improve the precision of the conversion to ARGB16161616 since the "conversion ratio" is not an integer. V3: Adapt the handlers to the new format introduced in patch 7 V3. V5: Minor improvements V6: Minor improvements (Pekka Paalanen) Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-10-igormtorrente@gmail.com commit 3675d8a1726337bd1e839a185e0a7ce0bc459b6b Author: Igor Torrente Date: Mon Sep 5 16:08:10 2022 -0300 drm: vkms: Adds XRGB_16161616 and ARGB_1616161616 formats This will be useful to write tests that depends on these formats. ARGB and XRGB follows the a similar implementation of the former formats. Just adjusting for 16 bits per channel. V3: Adapt the handlers to the new format introduced in patch 7 V3. V5: Minor improvements Added le16_to_cpu/cpu_to_le16 to the 16 bits color read/writes. Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-9-igormtorrente@gmail.com commit bc0d7fdefec62e0cb83c1bcd3c7bd033f5e826e0 Author: Igor Torrente Date: Mon Sep 5 16:08:09 2022 -0300 drm: vkms: Supports to the case where primary plane doesn't match the CRTC We will remove the current assumption that the primary plane has the same size and position as CRTC and that the primary plane is the bottom-most in zpos order, or is even enabled. At least as far as the blending machinery is concerned. For that we will add CRTC dimension information to `vkms_crtc_state` and add a opaque black backgound color. Because now we need to fill the background, we had a loss in performance with this change. Results running the IGT[1] test `igt@kms_cursor_crc@pipe-a-cursor-512x512-onscreen` ten times: | Frametime | |:--------------------------------------------:| | Implementation | Previous | This commit | |:---------------:|:---------:|:--------------:| | frametime range | 5~18 ms | 10~22 ms | | Average | 8.47 ms | 12.32 ms | [1] IGT commit id: bc3f6833a12221a46659535dac06ebb312490eb4 V6: Improve the commit description (Pekka Paalanen). Update some comments (Pekka Paalanen). Remove some fields from `vkms_crtc_state` and move where some variables are set (Pekka Paalanen). Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-8-igormtorrente@gmail.com commit 8ba1648567e289c90fa4f65b4204d0f160e22ac3 Author: Igor Torrente Date: Mon Sep 5 16:08:08 2022 -0300 drm: vkms: Refactor the plane composer to accept new formats Currently the blend function only accepts XRGB_8888 and ARGB_8888 as a color input. This patch refactors all the functions related to the plane composition to overcome this limitation. The pixels blend is done using the new internal format. And new handlers are being added to convert a specific format to/from this internal format. So the blend operation depends on these handlers to convert to this common format. The blended result, if necessary, is converted to the writeback buffer format. This patch introduces three major differences to the blend function. 1 - All the planes are blended at once. 2 - The blend calculus is done as per line instead of per pixel. 3 - It is responsible to calculates the CRC and writing the writeback buffer(if necessary). These changes allow us to allocate way less memory in the intermediate buffer to compute these operations. Because now we don't need to have the entire intermediate image lines at once, just one line is enough. | Memory consumption (output dimensions) | |:--------------------------------------:| | Current | This patch | |:------------------:|:-----------------:| | Width * Heigth | 2 * Width | Beyond memory, we also have a minor performance benefit from all these changes. Results running the IGT[1] test `igt@kms_cursor_crc@pipe-a-cursor-512x512-onscreen` ten times: | Frametime | |:------------------------------------------:| | Implementation | Current | This commit | |:---------------:|:---------:|:------------:| | frametime range | 9~22 ms | 5~17 ms | | Average | 11.4 ms | 7.8 ms | [1] IGT commit id: bc3f6833a12221a46659535dac06ebb312490eb4 V2: Improves the performance drastically, by performing the operations per-line and not per-pixel(Pekka Paalanen). Minor improvements(Pekka Paalanen). V3: Changes the code to blend the planes all at once. This improves performance, memory consumption, and removes much of the weirdness of the V2(Pekka Paalanen and me). Minor improvements(Pekka Paalanen and me). V4: Rebase the code and adapt it to the new NUM_OVERLAY_PLANES constant. V5: Minor checkpatch fixes and the removal of TO-DO item(Melissa Wen). Several security/robustness improvents(Pekka Paalanen). Removes check_planes_x_bounds function and allows partial partly off-screen(Pekka Paalanen). V6: Fix a mismatch of some variable sizes (Pekka Paalanen). Several minor improvements (Pekka Paalanen). Reviewed-by: Melissa Wen Reported-by: kernel test robot Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-7-igormtorrente@gmail.com commit bbdf7b2a0b0e69e4e18b5722341dfa6266d19390 Author: Igor Torrente Date: Mon Sep 5 16:08:07 2022 -0300 drm: vkms: Add fb information to `vkms_writeback_job` This commit is the groundwork to introduce new formats to the planes and writeback buffer. As part of it, a new buffer metadata field is added to `vkms_writeback_job`, this metadata is represented by the `vkms_frame_info` struct. Also adds two new function pointers (`line_to_frame_func` and `frame_to_line_func`) are defined to handle format conversion from/to internal format. A new internal format(`struct pixel_argb_u16`) is introduced to deal with all possible inputs. It consists of 16 bits fields that represent each of the channels. These things will allow us, in the future, to have different compositing and wb format types. V2: Change the code to get the drm_framebuffer reference and not copy its contents (Thomas Zimmermann). V3: Drop the refcount in the wb code (Thomas Zimmermann). V5: Add {wb,plane}_format_transform_func to vkms_writeback_job and vkms_plane_state (Pekka Paalanen) V6: Improvements to some struct/struct members names (Pekka Paalanen). Splits this patch in two (Pekka Paalanen). V7: Replace line_to_frame_func and frame_to_line_func typedefs with the function signature and void* (Melissa Wen). Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-6-igormtorrente@gmail.com commit 2eef1ef6e22b241f26d7bf0f1554a9863277e526 Author: Igor Torrente Date: Mon Sep 5 16:08:06 2022 -0300 drm: vkms: get the reference to `drm_framebuffer` instead if coping it Instead of coping `drm_framebuffer` - which can cause problems - we just get the reference and add the ref count. Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-5-igormtorrente@gmail.com commit 254fe9c106ed69245fbe0beac582054c98a91482 Author: Igor Torrente Date: Mon Sep 5 16:08:05 2022 -0300 drm: drm_atomic_helper: Add a new helper to deal with the writeback connector validation Add a helper function to validate the connector configuration received in the encoder atomic_check by the drivers. So the drivers don't need to do these common validations themselves. V2: Move the format verification to a new helper at the drm_atomic_helper.c (Thomas Zimmermann). V3: Format check improvements (Leandro Ribeiro). Minor improvements(Thomas Zimmermann). V5: Fix some grammar issues in the commit message (André Almeida). Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-4-igormtorrente@gmail.com commit 1645e7b9667f14a37f9ac8c49568b8f979227d20 Author: Igor Torrente Date: Mon Sep 5 16:08:04 2022 -0300 drm: vkms: Rename `vkms_composer` to `vkms_frame_info` Changes the name of this struct to a more meaningful name. A name that represents better what this struct is about. Composer is the code that do the compositing of the planes. This struct contains information on the frame used in the output composition. Thus, vkms_frame_info is a better name to represent this. V5: Fix a commit message typo(Melissa Wen). V6: Fix wrong iosys_map_is_null verification at compose_plane (Melissa Wen). Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-3-igormtorrente@gmail.com commit 2a37630d0ddb8a0612b700635cf4827aeafe4142 Author: Igor Torrente Date: Mon Sep 5 16:08:03 2022 -0300 drm: vkms: Replace hardcoded value of `vkms_composer.map` to DRM_FORMAT_MAX_PLANES The `map` vector at `vkms_composer` uses a hardcoded value to define its size. If someday the maximum number of planes increases, this hardcoded value can be a problem. This value is being replaced with the DRM_FORMAT_MAX_PLANES macro. Acked-by: Thomas Zimmermann Reviewed-by: Melissa Wen Signed-off-by: Igor Torrente Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-2-igormtorrente@gmail.com commit 7912fc9905ffff7e33cd169ddb96ac2ba7d3d126 Author: Jinpeng Cui Date: Wed Aug 31 15:08:05 2022 +0000 can: kvaser_pciefd: remove redundant variable ret Return value directly from readl_poll_timeout() instead of getting value from redundant variable ret. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Link: https://lore.kernel.org/all/20220831150805.305106-1-cui.jinpeng2@zte.com.cn Signed-off-by: Marc Kleine-Budde commit 3a71eba64c9cb30d457bf1b0fa32f1c34a841e07 Author: Jinpeng Cui Date: Wed Aug 31 16:18:35 2022 +0000 can: sja1000: remove redundant variable ret Return value directly from register_candev() instead of getting value from redundant variable ret. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Link: https://lore.kernel.org/all/20220831161835.306079-1-cui.jinpeng2@zte.com.cn Signed-off-by: Marc Kleine-Budde commit 0838921bb4094ca3c88f3cc01a700f35da2bed96 Author: Biju Das Date: Sun Jul 10 12:52:48 2022 +0100 can: sja1000: Add support for RZ/N1 SJA1000 CAN Controller The SJA1000 CAN controller on RZ/N1 SoC has no clock divider register (CDR) support compared to others. This patch adds support for RZ/N1 SJA1000 CAN Controller, by adding SoC specific compatible to handle this difference as well as using clk framework to retrieve the CAN clock frequency. Signed-off-by: Biju Das Link: https://lore.kernel.org/all/20220710115248.190280-7-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde commit f4dda24432d7aed7a98ffe9b76e4c20b5fe6b9c1 Author: Biju Das Date: Tue Aug 30 17:45:16 2022 +0100 dt-bindings: can: nxp,sja1000: Document RZ/N1 power-domains support Document RZ/N1 power-domains support. Also update the example with power-domains property. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/all/20220830164518.1381632-2-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde commit 00784da3e6b8c1f0e58d813272503d014de8f64b Author: Kenneth Lee Date: Sat Aug 6 22:16:56 2022 -0700 can: kvaser_usb: kvaser_usb_hydra: Use kzalloc for allocating only one element Use kzalloc(...) rather than kcalloc(1, ...) since because the number of elements we are specifying in this case is 1, kzalloc would accomplish the same thing and we can simplify. Also refactor how we calculate the sizeof() as checkstyle for kzalloc() prefers using the variable we are assigning to versus the type of that variable for calculating the size to allocate. Signed-off-by: Kenneth Lee Link: https://lore.kernel.org/all/20220807051656.1991446-1-klee33@uw.edu Signed-off-by: Marc Kleine-Budde commit ddbbed25309f1cd0079e5b099748568842a5ec2b Author: Christophe JAILLET Date: Sun Aug 7 09:52:11 2022 +0200 can: rcar_canfd: Use dev_err_probe() to simplify code and better handle -EPROBE_DEFER devm_clk_get() can return -EPROBE_DEFER, so use dev_err_probe() instead of dev_err() in order to be less verbose in the log. This also saves a few LoC. While at it, turn a "goto fail_dev;" at the beginning of the function into a direct return in order to avoid mixing goto and return, which looks spurious. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/all/f5bf0b8f757bd3bc9b391094ece3548cc2f96456.1659858686.git.christophe.jaillet@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit d945346db1ef41e91ae4b9239cf37e2210368dd1 Author: Marc Kleine-Budde Date: Thu Aug 11 09:52:10 2022 +0200 can: flexcan: fix typo: FLEXCAN_QUIRK_SUPPPORT_* -> FLEXCAN_QUIRK_SUPPORT_* Fix typo "FLEXCAN_QUIRK_SUPPPORT_*" -> "FLEXCAN_QUIRK_SUPPORT_". Link: https://lore.kernel.org/all/20220811093617.1861938-3-mkl@pengutronix.de Fixes: f04aefd4659b ("can: flexcan: mark RX via mailboxes as supported on MCF5441X") Fixes: c5c88591040e ("can: flexcan: add more quirks to describe RX path capabilities") Signed-off-by: Marc Kleine-Budde commit 766108d91246530d31b42765046f7ec2d1e42581 Author: Marc Kleine-Budde Date: Wed Aug 10 21:38:00 2022 +0200 can: rx-offload: can_rx_offload_init_queue(): fix typo Fix typo "rounted" -> "rounded". Link: https://lore.kernel.org/all/20220811093617.1861938-2-mkl@pengutronix.de Fixes: d254586c3453 ("can: rx-offload: Add support for HW fifo based irq offloading") Reported-by: Uwe Kleine-König Signed-off-by: Marc Kleine-Budde commit 8807707df7ef09d679df2b21894d49a06fd8ba7e Author: Guoqing Jiang Date: Fri Sep 2 18:00:55 2022 +0800 rnbd-srv: remove redundant setting of blk_open_flags It is not necessary since it is set later just before function return success. Signed-off-by: Guoqing Jiang Reviewed-by: Chaitanya Kulkarni Acked-by: Md Haris Iqbal Link: https://lore.kernel.org/r/20220902100055.25724-4-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit be2b2f6b62b55bbb30eb611c1730cd9056dbf7bd Author: Guoqing Jiang Date: Fri Sep 2 18:00:54 2022 +0800 rnbd-srv: make process_msg_close returns void Change the return type to void given it always returns 0. Signed-off-by: Guoqing Jiang Reviewed-by: Chaitanya Kulkarni Acked-by: Md Haris Iqbal Link: https://lore.kernel.org/r/20220902100055.25724-3-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit 095134fbc2d4126d0575485e52139967f0771e30 Author: Guoqing Jiang Date: Fri Sep 2 18:00:53 2022 +0800 rnbd-srv: add comment in rnbd_srv_rdma_ev Let's add some explanations here given the err handling is not obvious. Signed-off-by: Guoqing Jiang Acked-by: Md Haris Iqbal Link: https://lore.kernel.org/r/20220902100055.25724-2-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit bdb7d420c6f6d2618d4c907cd7742c3195c425e2 Author: Miaohe Lin Date: Mon Sep 5 18:27:54 2022 +0800 block: remove unneeded return value of bio_check_ro() bio_check_ro() always return false now. Remove this unneeded return value and cleanup the sole caller. No functional change intended. Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220905102754.1942-1-linmiaohe@huawei.com Signed-off-by: Jens Axboe commit 6d5e8d21e8997b0efa409e46db22a27b5cbba6aa Author: Miaohe Lin Date: Mon Sep 5 18:19:50 2022 +0800 blk-mq: remove unneeded needs_restart check If code reaches here, needs_restart must be true. Remove this unneeded needs_restart check. No functional change intended. Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220905101950.4606-1-linmiaohe@huawei.com Signed-off-by: Jens Axboe commit 91e5adda5cf4e3bf21c46eaa2ae7ee2cb6058126 Author: Jiapeng Chong Date: Mon Sep 5 14:32:53 2022 +0800 block/blk-map: Remove set but unused variable 'added' The variable added is not effectively used in the function, so delete it. block/blk-map.c:273:16: warning: variable 'added' set but not used. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2049 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220905063253.120082-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jens Axboe commit 2f61ff8272967c9bdcba810aa978170814b08f7c Author: Jonathan Cameron Date: Sun Aug 7 20:04:13 2022 +0100 iio: pressure: icp10100: Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS(). The suspend and resume callbacks in this driver appear to be safe to call repeatedly, but why do so when we can use the DEFINE_RUNTIME_DEV_PM_OPS() macro to supply callbacks that check if we are already runtime suspended before doing unnecessary work. Signed-off-by: Jonathan Cameron Cc: Jean-Baptiste Maneyrol Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20220807190414.1039028-2-jic23@kernel.org commit c13219cececed248df6feacb0d33326266234b7b Author: Jonathan Cameron Date: Sun Aug 21 17:10:58 2022 +0100 iio: adc: max1363: Drop provision to provide an IIO channel map via platform data Back in the days of board files, platform data was used to provide information on the mapping from ADC channel to an analog signal from another device. We've long since moved to doing this via device tree. Hence drop the support from the max1363 driver which is the only driver still providing this. Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220821161058.2207185-1-jic23@kernel.org commit 961db2da159d5191d2a1d9a7cf5ddf1672621a2b Author: Jagath Jog J Date: Wed Aug 31 12:01:17 2022 +0530 iio: accel: bma400: Add support for single and double tap events Add support for single and double tap events based on the tap threshold value, minimum quiet time before and after the tap and minimum time between the taps in the double tap. The INT1 pin is used to interrupt and the event is pushed to userspace. Signed-off-by: Jagath Jog J Link: https://lore.kernel.org/r/20220831063117.4141-3-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron commit 835e699ef82adfc85ac4cc3f1f237c1adfdefd20 Author: Jagath Jog J Date: Wed Aug 31 12:01:16 2022 +0530 iio: Add new event type gesture and use direction for single and double tap Add new event type for tap called gesture and the direction can be used to differentiate single and double tap. This may be used by accelerometer sensors to express single and double tap events. For directional tap, modifiers like IIO_MOD_(X/Y/Z) can be used along with singletap and doubletap direction. Signed-off-by: Jagath Jog J Link: https://lore.kernel.org/r/20220831063117.4141-2-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron commit 2bc9cd66eb25d0fefbb081421d6586495e25840e Author: Vincent Whitchurch Date: Mon Aug 29 11:18:40 2022 +0200 iio: Use per-device lockdep class for mlock If an IIO driver uses callbacks from another IIO driver and calls iio_channel_start_all_cb() from one of its buffer setup ops, then lockdep complains due to the lock nesting, as in the below example with lmp91000. Since the locks are being taken on different IIO devices, there is no actual deadlock. Fix the warning by telling lockdep to use a different class for each iio_device. ============================================ WARNING: possible recursive locking detected -------------------------------------------- python3/23 is trying to acquire lock: (&indio_dev->mlock){+.+.}-{3:3}, at: iio_update_buffers but task is already holding lock: (&indio_dev->mlock){+.+.}-{3:3}, at: enable_store other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&indio_dev->mlock); lock(&indio_dev->mlock); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by python3/23: #0: (sb_writers#5){.+.+}-{0:0}, at: ksys_write #1: (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter #2: (kn->active#14){.+.+}-{0:0}, at: kernfs_fop_write_iter #3: (&indio_dev->mlock){+.+.}-{3:3}, at: enable_store #4: (&iio_dev_opaque->info_exist_lock){+.+.}-{3:3}, at: iio_update_buffers Call Trace: __mutex_lock iio_update_buffers iio_channel_start_all_cb lmp91000_buffer_postenable __iio_update_buffers enable_store Fixes: 67e17300dc1d76 ("iio: potentiostat: add LMP91000 support") Signed-off-by: Vincent Whitchurch Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829091840.2791846-1-vincent.whitchurch@axis.com Signed-off-by: Jonathan Cameron commit 0fea1007f0e68764aa18822bb6fa83d3809739e8 Author: Ramona Bolboaca Date: Wed Aug 31 16:30:21 2022 +0300 iio: adc: add max11205 adc driver Adding support for max11205 16-bit single-channel ultra-low power delta-sigma adc. The MAX11205 is compatible with the 2-wire interface and uses SCLK and RDY/DOUT for serial communications. In this mode, all controls are implemented by timing the high or low phase of the SCLK. The 2-wire serial interface only allows for data to be read out through the RDY/DOUT output. Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX11205.pdf Signed-off-by: Ramona Bolboaca Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220831133021.215625-2-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron commit d2a411f810a0db055f02cc18e5cfa833bb2c9ccc Merge: cdcdb00855267 b9163e9b5f14d Author: Mark Brown Date: Mon Sep 5 16:49:32 2022 +0100 lib/string_helpers: Introduce parse_int_array_user() Merge series from Cezary Rojewski : Continuation of recent upstream discussion [1] regarding user string tokenization. First, parse_int_array_user() is introduced to allow for splitting specified user string into a sequence of integers. Makes use of get_options() internally so the parsing logic is not duplicated. With that done, redundant parts of the sound driver are removed. Originally similar functionality was added for the SOF sound driver. As more users are on the horizon, it is desirable to update existing string_helpers code and provide a unified solution. commit cdcdb008552670abd6f60a1777d3723e6ca2716b Merge: 5176ee6443753 2848d34c3ba1f Author: Mark Brown Date: Mon Sep 5 16:27:19 2022 +0100 Untested TAS2562 power setting fixes Merge series from Martin Povišer : The tas2562 driver does the same thing with the setting of PWR_CTRL field as the tas2764/tas2770 drivers were doing. Link: https://lore.kernel.org/alsa-devel/20220808141246.5749-1-povik+lin@cutebit.org/T/#t Link: https://lore.kernel.org/alsa-devel/20220825140241.53963-1-povik+lin@cutebit.org/T/#t These are blindly written patches without testing since I don't have the hardware. (I even tried TI's formal sample request program but was refused there. CCing @ti.com addresses I found on other series recently submitted.) commit 5176ee64437538dbbdf17f867cff86ecfb391610 Merge: 4ec8179c212fb 6932b20d4f41d Author: Mark Brown Date: Mon Sep 5 16:27:13 2022 +0100 ASoC: soc-pcm.c: random cleanup Merge series from Kuninori Morimoto : These are not related, but random cleanup patches for soc-pcm.c commit aa7f46b326e7d85fffcec16769ff3152d79c5fac Author: Arnaud Pouliquen Date: Fri Aug 26 14:54:00 2022 +0200 arm64: defconfig: Config that had RPMSG_CHAR now gets RPMSG_CTRL In the commit 617d32938d1b ("rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl"), we split the rpmsg_char driver in two. By default give everyone who had the old driver enabled the rpmsg_ctrl driver too. Signed-off-by: Arnaud Pouliquen Reviewed-by: Mathieu Poirier Signed-off-by: Arnd Bergmann commit 26b6e7edcf2949c9636124697da6119db85e924f Author: Arnaud Pouliquen Date: Fri Aug 26 15:04:02 2022 +0200 arm: configs: Configs that had RPMSG_CHAR now get RPMSG_CTRL In the commit 617d32938d1b ("rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl"), we split the rpmsg_char driver in two. By default give everyone who had the old driver enabled the rpmsg_ctrl driver too. Signed-off-by: Arnaud Pouliquen Reviewed-by: Mathieu Poirier Reviewed-by: Mukesh Ojha Signed-off-by: Arnd Bergmann commit b9163e9b5f14d690752010ee843b2d788c3536f1 Author: Cezary Rojewski Date: Sun Sep 4 12:28:40 2022 +0200 ASoC: SOF: Remove strsplit_u32() and tokenize_input() Make use of global integer-array parsing helper instead of the internal one as both serve same purpose. With that, both strsplit_u32() and tokenize_input() become unused so remove them. Reviewed-by: Andy Shevchenko Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220904102840.862395-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit f0b933236ec97de5ee49c60aae57a9c5c4dadc87 Author: Cezary Rojewski Date: Sun Sep 4 12:28:39 2022 +0200 lib/string_helpers: Introduce parse_int_array_user() Add new helper function to allow for splitting specified user string into a sequence of integers. Internally it makes use of get_options() so the returned sequence contains the integers extracted plus an additional element that begins the sequence and specifies the integers count. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220904102840.862395-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 96efd6d01461be234bfc4ca1048a3d5febf0c425 Author: Heiner Kallweit Date: Sat Sep 3 13:15:13 2022 +0200 r8169: remove not needed net_ratelimit() check We're not in a hot path and don't want to miss this message, therefore remove the net_ratelimit() check. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 710d21fdff9a98d621cd4e64167f3ef8af4e2fd1 Author: Kees Cook Date: Fri Sep 2 21:37:49 2022 -0700 netlink: Bounds-check struct nlmsgerr creation In preparation for FORTIFY_SOURCE doing bounds-check on memcpy(), switch from __nlmsg_put to nlmsg_put(), and explain the bounds check for dealing with the memcpy() across a composite flexible array struct. Avoids this future run-time warning: memcpy: detected field-spanning write (size 32) of single field "&errmsg->msg" at net/netlink/af_netlink.c:2447 (size 16) Cc: Jakub Kicinski Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: syzbot Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220901071336.1418572-1-keescook@chromium.org Signed-off-by: David S. Miller commit 274052a2b0ab9f380ce22b19ff80a99b99ecb198 Merge: 0b20a133c0944 9f2c6e96c65e6 Author: Daniel Borkmann Date: Mon Sep 5 15:33:07 2022 +0200 Merge branch 'bpf-allocator' Alexei Starovoitov says: ==================== Introduce any context BPF specific memory allocator. Tracing BPF programs can attach to kprobe and fentry. Hence they run in unknown context where calling plain kmalloc() might not be safe. Front-end kmalloc() with per-cpu cache of free elements. Refill this cache asynchronously from irq_work. Major achievements enabled by bpf_mem_alloc: - Dynamically allocated hash maps used to be 10 times slower than fully preallocated. With bpf_mem_alloc and subsequent optimizations the speed of dynamic maps is equal to full prealloc. - Tracing bpf programs can use dynamically allocated hash maps. Potentially saving lots of memory. Typical hash map is sparsely populated. - Sleepable bpf programs can used dynamically allocated hash maps. Future work: - Expose bpf_mem_alloc as uapi FD to be used in dynptr_alloc, kptr_alloc - Convert lru map to bpf_mem_alloc - Further cleanup htab code. Example: htab_use_raw_lock can be removed. Changelog: v5->v6: - Debugged the reason for selftests/bpf/test_maps ooming in a small VM that BPF CI is using. Added patch 16 that optimizes the usage of rcu_barrier-s between bpf_mem_alloc and hash map. It drastically improved the speed of htab destruction. v4->v5: - Fixed missing migrate_disable in hash tab free path (Daniel) - Replaced impossible "memory leak" with WARN_ON_ONCE (Martin) - Dropped sysctl kernel.bpf_force_dyn_alloc patch (Daniel) - Added Andrii's ack - Added new patch 15 that removes kmem_cache usage from bpf_mem_alloc. It saves memory, speeds up map create/destroy operations while maintains hash map update/delete performance. v3->v4: - fix build issue due to missing local.h on 32-bit arch - add Kumar's ack - proposal for next steps from Delyan: https://lore.kernel.org/bpf/d3f76b27f4e55ec9e400ae8dcaecbb702a4932e8.camel@fb.com/ v2->v3: - Rewrote the free_list algorithm based on discussions with Kumar. Patch 1. - Allowed sleepable bpf progs use dynamically allocated maps. Patches 13 and 14. - Added sysctl to force bpf_mem_alloc in hash map even if pre-alloc is requested to reduce memory consumption. Patch 15. - Fix: zero-fill percpu allocation - Single rcu_barrier at the end instead of each cpu during bpf_mem_alloc destruction v2 thread: https://lore.kernel.org/bpf/20220817210419.95560-1-alexei.starovoitov@gmail.com/ v1->v2: - Moved unsafe direct call_rcu() from hash map into safe place inside bpf_mem_alloc. Patches 7 and 9. - Optimized atomic_inc/dec in hash map with percpu_counter. Patch 6. - Tuned watermarks per allocation size. Patch 8 - Adopted this approach to per-cpu allocation. Patch 10. - Fully converted hash map to bpf_mem_alloc. Patch 11. - Removed tracing prog restriction on map types. Combination of all patches and final patch 12. v1 thread: https://lore.kernel.org/bpf/20220623003230.37497-1-alexei.starovoitov@gmail.com/ LWN article: https://lwn.net/Articles/899274/ ==================== Link: https://lore.kernel.org/r/ Signed-off-by: Daniel Borkmann commit 9f2c6e96c65e6fa1aebef546be0c30a5895fcb37 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:58 2022 -0700 bpf: Optimize rcu_barrier usage between hash map and bpf_mem_alloc. User space might be creating and destroying a lot of hash maps. Synchronous rcu_barrier-s in a destruction path of hash map delay freeing of hash buckets and other map memory and may cause artificial OOM situation under stress. Optimize rcu_barrier usage between bpf hash map and bpf_mem_alloc: - remove rcu_barrier from hash map, since htab doesn't use call_rcu directly and there are no callback to wait for. - bpf_mem_alloc has call_rcu_in_progress flag that indicates pending callbacks. Use it to avoid barriers in fast path. - When barriers are needed copy bpf_mem_alloc into temp structure and wait for rcu barrier-s in the worker to let the rest of hash map freeing to proceed. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220902211058.60789-17-alexei.starovoitov@gmail.com commit bfc03c15bebf5e0028e21ca5fc0fe4a60a6b6681 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:57 2022 -0700 bpf: Remove usage of kmem_cache from bpf_mem_cache. For bpf_mem_cache based hash maps the following stress test: for (i = 1; i <= 512; i <<= 1) for (j = 1; j <= 1 << 18; j <<= 1) fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, i, j, 2, 0); creates many kmem_cache-s that are not mergeable in debug kernels and consume unnecessary amount of memory. Turned out bpf_mem_cache's free_list logic does batching well, so usage of kmem_cache for fixes size allocations doesn't bring any performance benefits vs normal kmalloc. Hence get rid of kmem_cache in bpf_mem_cache. That saves memory, speeds up map create/destroy operations, while maintains hash map update/delete performance. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220902211058.60789-16-alexei.starovoitov@gmail.com commit 02cc5aa29e8cef4c1d710accd423546ab63f4eda Author: Alexei Starovoitov Date: Fri Sep 2 14:10:56 2022 -0700 bpf: Remove prealloc-only restriction for sleepable bpf programs. Since hash map is now converted to bpf_mem_alloc and it's waiting for rcu and rcu_tasks_trace GPs before freeing elements into global memory slabs it's safe to use dynamically allocated hash maps in sleepable bpf programs. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-15-alexei.starovoitov@gmail.com commit dccb4a9013a68ddcb8303cd60f2fca1742014f3f Author: Alexei Starovoitov Date: Fri Sep 2 14:10:55 2022 -0700 bpf: Prepare bpf_mem_alloc to be used by sleepable bpf programs. Use call_rcu_tasks_trace() to wait for sleepable progs to finish. Then use call_rcu() to wait for normal progs to finish and finally do free_one() on each element when freeing objects into global memory pool. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-14-alexei.starovoitov@gmail.com commit 96da3f7d489d11b43e7c1af90d876b9a2492cca8 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:54 2022 -0700 bpf: Remove tracing program restriction on map types The hash map is now fully converted to bpf_mem_alloc. Its implementation is not allocating synchronously and not calling call_rcu() directly. It's now safe to use non-preallocated hash maps in all types of tracing programs including BPF_PROG_TYPE_PERF_EVENT that runs out of NMI context. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-13-alexei.starovoitov@gmail.com commit ee4ed53c5eb62f49f23560cc2642353547e46c32 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:53 2022 -0700 bpf: Convert percpu hash map to per-cpu bpf_mem_alloc. Convert dynamic allocations in percpu hash map from alloc_percpu() to bpf_mem_cache_alloc() from per-cpu bpf_mem_alloc. Since bpf_mem_alloc frees objects after RCU gp the call_rcu() is removed. pcpu_init_value() now needs to zero-fill per-cpu allocations, since dynamically allocated map elements are now similar to full prealloc, since alloc_percpu() is not called inline and the elements are reused in the freelist. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-12-alexei.starovoitov@gmail.com commit 4ab67149f3c6e97c5c506a726f0ebdec38241679 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:52 2022 -0700 bpf: Add percpu allocation support to bpf_mem_alloc. Extend bpf_mem_alloc to cache free list of fixed size per-cpu allocations. Once such cache is created bpf_mem_cache_alloc() will return per-cpu objects. bpf_mem_cache_free() will free them back into global per-cpu pool after observing RCU grace period. per-cpu flavor of bpf_mem_alloc is going to be used by per-cpu hash maps. The free list cache consists of tuples { llist_node, per-cpu pointer } Unlike alloc_percpu() that returns per-cpu pointer the bpf_mem_cache_alloc() returns a pointer to per-cpu pointer and bpf_mem_cache_free() expects to receive it back. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-11-alexei.starovoitov@gmail.com commit 8d5a8011b35d387c490a5c977b1d9eb4798aa071 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:51 2022 -0700 bpf: Batch call_rcu callbacks instead of SLAB_TYPESAFE_BY_RCU. SLAB_TYPESAFE_BY_RCU makes kmem_caches non mergeable and slows down kmem_cache_destroy. All bpf_mem_cache are safe to share across different maps and programs. Convert SLAB_TYPESAFE_BY_RCU to batched call_rcu. This change solves the memory consumption issue, avoids kmem_cache_destroy latency and keeps bpf hash map performance the same. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-10-alexei.starovoitov@gmail.com commit 7c266178aa51dd2d4fda1312c5990a8a82c83d70 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:50 2022 -0700 bpf: Adjust low/high watermarks in bpf_mem_cache The same low/high watermarks for every bucket in bpf_mem_cache consume significant amount of memory. Preallocating 64 elements of 4096 bytes each in the free list is not efficient. Make low/high watermarks and batching value dependent on element size. This change brings significant memory savings. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-9-alexei.starovoitov@gmail.com commit 0fd7c5d43339b783ee3301a05f925d1e52ac87c9 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:49 2022 -0700 bpf: Optimize call_rcu in non-preallocated hash map. Doing call_rcu() million times a second becomes a bottle neck. Convert non-preallocated hash map from call_rcu to SLAB_TYPESAFE_BY_RCU. The rcu critical section is no longer observed for one htab element which makes non-preallocated hash map behave just like preallocated hash map. The map elements are released back to kernel memory after observing rcu critical section. This improves 'map_perf_test 4' performance from 100k events per second to 250k events per second. bpf_mem_alloc + percpu_counter + typesafe_by_rcu provide 10x performance boost to non-preallocated hash map and make it within few % of preallocated map while consuming fraction of memory. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-8-alexei.starovoitov@gmail.com commit 86fe28f7692d96d20232af0fc6d7632d5cc89a01 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:48 2022 -0700 bpf: Optimize element count in non-preallocated hash map. The atomic_inc/dec might cause extreme cache line bouncing when multiple cpus access the same bpf map. Based on specified max_entries for the hash map calculate when percpu_counter becomes faster than atomic_t and use it for such maps. For example samples/bpf/map_perf_test is using hash map with max_entries 1000. On a system with 16 cpus the 'map_perf_test 4' shows 14k events per second using atomic_t. On a system with 15 cpus it shows 100k events per second using percpu. map_perf_test is an extreme case where all cpus colliding on atomic_t which causes extreme cache bouncing. Note that the slow path of percpu_counter is 5k events per secound vs 14k for atomic, so the heuristic is necessary. See comment in the code why the heuristic is based on num_online_cpus(). Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-7-alexei.starovoitov@gmail.com commit 34dd3bad1a6f1dc7d18ee8dd53f1d31bffd2aee8 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:47 2022 -0700 bpf: Relax the requirement to use preallocated hash maps in tracing progs. Since bpf hash map was converted to use bpf_mem_alloc it is safe to use from tracing programs and in RT kernels. But per-cpu hash map is still using dynamic allocation for per-cpu map values, hence keep the warning for this map type. In the future alloc_percpu_gfp can be front-end-ed with bpf_mem_cache and this restriction will be completely lifted. perf_event (NMI) bpf programs have to use preallocated hash maps, because free_htab_elem() is using call_rcu which might crash if re-entered. Sleepable bpf programs have to use preallocated hash maps, because life time of the map elements is not protected by rcu_read_lock/unlock. This restriction can be lifted in the future as well. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-6-alexei.starovoitov@gmail.com commit 89dc8d0c38e0df27e580876a1681a55c686a51ff Author: Alexei Starovoitov Date: Fri Sep 2 14:10:46 2022 -0700 samples/bpf: Reduce syscall overhead in map_perf_test. Make map_perf_test for preallocated and non-preallocated hash map spend more time inside bpf program to focus performance analysis on the speed of update/lookup/delete operations performed by bpf program. It makes 'perf report' of bpf_mem_alloc look like: 11.76% map_perf_test [k] _raw_spin_lock_irqsave 11.26% map_perf_test [k] htab_map_update_elem 9.70% map_perf_test [k] _raw_spin_lock 9.47% map_perf_test [k] htab_map_delete_elem 8.57% map_perf_test [k] memcpy_erms 5.58% map_perf_test [k] alloc_htab_elem 4.09% map_perf_test [k] __htab_map_lookup_elem 3.44% map_perf_test [k] syscall_exit_to_user_mode 3.13% map_perf_test [k] lookup_nulls_elem_raw 3.05% map_perf_test [k] migrate_enable 3.04% map_perf_test [k] memcmp 2.67% map_perf_test [k] unit_free 2.39% map_perf_test [k] lookup_elem_raw Reduce default iteration count as well to make 'map_perf_test' quick enough even on debug kernels. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-5-alexei.starovoitov@gmail.com commit 37521bffdd2d1efcb1dbdfd3ee89584c8943421c Author: Alexei Starovoitov Date: Fri Sep 2 14:10:45 2022 -0700 selftests/bpf: Improve test coverage of test_maps Make test_maps more stressful with more parallelism in update/delete/lookup/walk including different value sizes. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-4-alexei.starovoitov@gmail.com commit fba1a1c6c912b383f86bf5d4aea732dcad3ec420 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:44 2022 -0700 bpf: Convert hash map to bpf_mem_alloc. Convert bpf hash map to use bpf memory allocator. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-3-alexei.starovoitov@gmail.com commit 7c8199e24fa09d2344ae0204527d55d7803e8409 Author: Alexei Starovoitov Date: Fri Sep 2 14:10:43 2022 -0700 bpf: Introduce any context BPF specific memory allocator. Tracing BPF programs can attach to kprobe and fentry. Hence they run in unknown context where calling plain kmalloc() might not be safe. Front-end kmalloc() with minimal per-cpu cache of free elements. Refill this cache asynchronously from irq_work. BPF programs always run with migration disabled. It's safe to allocate from cache of the current cpu with irqs disabled. Free-ing is always done into bucket of the current cpu as well. irq_work trims extra free elements from buckets with kfree and refills them with kmalloc, so global kmalloc logic takes care of freeing objects allocated by one cpu and freed on another. struct bpf_mem_alloc supports two modes: - When size != 0 create kmem_cache and bpf_mem_cache for each cpu. This is typical bpf hash map use case when all elements have equal size. - When size == 0 allocate 11 bpf_mem_cache-s for each cpu, then rely on kmalloc/kfree. Max allocation size is 4096 in this case. This is bpf_dynptr and bpf_kptr use case. bpf_mem_alloc/bpf_mem_free are bpf specific 'wrappers' of kmalloc/kfree. bpf_mem_cache_alloc/bpf_mem_cache_free are 'wrappers' of kmem_cache_alloc/kmem_cache_free. The allocators are NMI-safe from bpf programs only. They are not NMI-safe in general. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220902211058.60789-2-alexei.starovoitov@gmail.com commit 05ad5d4581c3c1cc724fe50d4652833fb9f3037b Author: Sean Anderson Date: Fri Sep 2 18:02:39 2022 -0400 net: phy: Add 1000BASE-KX interface mode Add 1000BASE-KX interface mode. This 1G backplane ethernet as described in clause 70. Clause 73 autonegotiation is mandatory, and only full duplex operation is supported. Although at the PMA level this interface mode is identical to 1000BASE-X, it uses a different form of in-band autonegation. This justifies a separate interface mode, since the interface mode (along with the MLO_AN_* autonegotiation mode) sets the type of autonegotiation which will be used on a link. This results in more than just electrical differences between the link modes. With regard to 1000BASE-X, 1000BASE-KX holds a similar position to SGMII: same signaling, but different autonegotiation. PCS drivers (which typically handle in-band autonegotiation) may only support 1000BASE-X, and not 1000BASE-KX. Similarly, the phy mode is used to configure serdes phys with phy_set_mode_ext. Due to the different electrical standards (SFI or XFI vs Clause 70), they will likely want to use different configuration. Adding a phy interface mode for 1000BASE-KX helps simplify configuration in these areas. Signed-off-by: Sean Anderson Signed-off-by: David S. Miller commit ab526eaa84b90963a54f4f22891a11ef7288196c Merge: 36f9b47457f0c ef2a8d5478b9a Author: David S. Miller Date: Mon Sep 5 14:27:40 2022 +0100 Merge branch 'dpaa-cleanups' Sean Anderson says: ==================== net: dpaa: Cleanups in preparation for phylink conversion (part 2) This series contains several cleanup patches for dpaa/fman. While they are intended to prepare for a phylink conversion, they stand on their own. This series was originally submitted as part of [1]. [1] https://lore.kernel.org/netdev/20220715215954.1449214-1-sean.anderson@seco.com Changes in v5: - Reduce line length of tgec_config - Reduce line length of qman_update_cgr_safe - Rebase onto net-next/master Changes in v4: - weer -> were - tricy -> tricky - Use mac_dev for calling change_addr - qman_cgr_create -> qman_create_cgr Changes in v2: - Fix prototype for dtsec_initialization - Fix warning if sizeof(void *) != sizeof(resource_size_t) - Specify type of mac_dev for exception_cb - Add helper for sanity checking cgr ops - Add CGR update function - Adjust queue depth on rate change ==================== Signed-off-by: David S. Miller commit ef2a8d5478b9ad653c318bdbb4f6e7f46c90f90b Author: Sean Anderson Date: Fri Sep 2 17:57:36 2022 -0400 net: dpaa: Adjust queue depth on rate change Instead of setting the queue depth once during probe, adjust it on the fly whenever we configure the link. This is a bit unusal, since usually the DPAA driver calls into the FMAN driver, but here we do the opposite. We need to add a netdev to struct mac_device for this, but it will soon live in the phylink config. I haven't tested this extensively, but it doesn't seem to break anything. We could possibly optimize this a bit by keeping track of the last rate, but for now we just update every time. 10GEC probably doesn't need to call into this at all, but I've added it for consistency. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 914f8b228ede709274b8c80514b352248ec9da00 Author: Sean Anderson Date: Fri Sep 2 17:57:35 2022 -0400 soc: fsl: qbman: Add CGR update function This adds a function to update a CGR with new parameters. qman_create_cgr can almost be used for this (with flags=0), but it's not suitable because it also registers the callback function. The _safe variant was modeled off of qman_cgr_delete_safe. However, we handle multiple arguments and a return value. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit d0e17a4653cebc2c8a20251c837dd1fcec5014d9 Author: Sean Anderson Date: Fri Sep 2 17:57:34 2022 -0400 soc: fsl: qbman: Add helper for sanity checking cgr ops This breaks out/combines get_affine_portal and the cgr sanity check in preparation for the next commit. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit fca4804f68cfa5516159ff9579a2f702363ea93a Author: Sean Anderson Date: Fri Sep 2 17:57:33 2022 -0400 net: dpaa: Use mac_dev variable in dpaa_netdev_init There are several references to mac_dev in dpaa_netdev_init. Make things a bit more concise by adding a local variable for it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 901bdff2f529d8a33d9a2b88caa7bfb9fad14c52 Author: Sean Anderson Date: Fri Sep 2 17:57:32 2022 -0400 net: fman: Change return type of disable to void When disabling, there is nothing we can do about errors. In fact, the only error which can occur is misuse of the API. Just warn in the mac driver instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit aedbeb4e597e9f6202d36e249f1027138a764a67 Author: Sean Anderson Date: Fri Sep 2 17:57:31 2022 -0400 net: fman: Clean up error handling This removes the _return label, since something like err = -EFOO; goto _return; can be replaced by the briefer return -EFOO; Additionally, this skips going to _return_of_node_put when dev_node has already been put (preventing a double put). Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 5b6acb554065e9e0a8e93f17573afeae1e121844 Author: Sean Anderson Date: Fri Sep 2 17:57:30 2022 -0400 net: fman: Specify type of mac_dev for exception_cb Instead of using a void pointer for mac_dev, specify its type explicitly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 19c788b144e2751a221fd64c6db6ce1b98506c0d Author: Sean Anderson Date: Fri Sep 2 17:57:29 2022 -0400 net: fman: Use mac_dev for some params Some params are already present in mac_dev. Use them directly instead of passing them through params. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit c6b7b1b515080aaa1e1e72328c758478dc32d82a Author: Sean Anderson Date: Fri Sep 2 17:57:28 2022 -0400 net: fman: Pass params directly to mac init Instead of having the mac init functions call back into the fman core to get their params, just pass them directly to the init functions. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 262f2b782e255b7959b6b8fdfd9347558a7003a2 Author: Sean Anderson Date: Fri Sep 2 17:57:27 2022 -0400 net: fman: Map the base address once We don't need to remap the base address from the resource twice (once in mac_probe() and again in set_fman_mac_params()). We still need the resource to get the end address, but we can use a single function call to get both at once. While we're at it, use platform_get_mem_or_io and devm_request_resource to map the resource. I think this is the more "correct" way to do things here, since we use the pdev resource, instead of creating a new one. It's still a bit tricky, since we need to ensure that the resource is a child of the fman region when it gets requested. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 45fa34bfaa52737b3d1c77ad31044c8fd4f4698a Author: Sean Anderson Date: Fri Sep 2 17:57:26 2022 -0400 net: fman: Remove internal_phy_node from params This member was used to pass the phy node between mac_probe and the mac-specific initialization function. But now that the phy node is gotten in the initialization function, this parameter does not serve a purpose. Remove it, and do the grabbing of the node/grabbing of the phy in the same place. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 4498862710972f4012e1ed7967df517f28ddaff6 Author: Sean Anderson Date: Fri Sep 2 17:57:25 2022 -0400 net: fman: Inline several functions into initialization There are several small functions which were only necessary because the initialization functions didn't have access to the mac private data. Now that they do, just do things directly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 1257c9623deba19493fc0e8f76ad6da31ff4471a Author: Sean Anderson Date: Fri Sep 2 17:57:24 2022 -0400 net: fman: Mark mac methods static These methods are no longer accessed outside of the driver file, so mark them as static. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 302376feec1d4e351faf31df17fdb22db685961a Author: Sean Anderson Date: Fri Sep 2 17:57:23 2022 -0400 net: fman: Move initialization to mac-specific files This moves mac-specific initialization to mac-specific files. This will make it easier to work with individual macs. It will also make it easier to refactor the initialization to simplify the control flow. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller commit 36f9b47457f0cad290502c56664df76a2859c9b4 Author: Heiner Kallweit Date: Fri Sep 2 23:16:52 2022 +0200 r8169: remove useless PCI region size check Let's trust the hardware here and remove this useless check. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f1ee74afc1e303e69f4485ae677686e95a8bcbe5 Author: Andrzej Hajda Date: Fri Aug 26 16:19:29 2022 +0200 drm/i915/fbdev: do not create fbdev if HPD is suspended In case of deferred FB setup core can try to create new framebuffer. Disallow it if hpd_suspended flag is set. Signed-off-by: Andrzej Hajda Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220826141929.189681-4-andrzej.hajda@intel.com commit f8cc091e05305231c8f747ca253a90ff0cea60b9 Author: Andrzej Hajda Date: Fri Aug 26 16:19:28 2022 +0200 drm/i915/fbdev: suspend HPD before fbdev unregistration HPD event after fbdev unregistration can cause registration of deferred fbdev which will not be unregistered later, causing use-after-free. To avoid it HPD handling should be suspended before fbdev unregistration. It should fix following GPF: [272.634530] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP NOPTI [272.634536] CPU: 0 PID: 6030 Comm: i915_selftest Tainted: G U 5.18.0-rc5-CI_DRM_11603-g12dccf4f5eef+ #1 [272.634541] Hardware name: Intel Corporation Raptor Lake Client Platform/RPL-S ADP-S DDR5 UDIMM CRB, BIOS RPLSFWI1.R00.2397.A01.2109300731 09/30/2021 [272.634545] RIP: 0010:fb_do_apertures_overlap.part.14+0x26/0x60 ... [272.634582] Call Trace: [272.634583] [272.634585] do_remove_conflicting_framebuffers+0x59/0xa0 [272.634589] remove_conflicting_framebuffers+0x2d/0xc0 [272.634592] remove_conflicting_pci_framebuffers+0xc8/0x110 [272.634595] drm_aperture_remove_conflicting_pci_framebuffers+0x52/0x70 [272.634604] i915_driver_probe+0x63a/0xdd0 [i915] Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5329 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5510 Signed-off-by: Andrzej Hajda Reviewed-by: Arun R Murthy Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220826141929.189681-3-andrzej.hajda@intel.com commit 22055eddd4fb33ef475f2daf700fbc7dd0f42389 Author: Andrzej Hajda Date: Fri Aug 26 16:19:27 2022 +0200 drm/i915/hpd: suspend MST at the end of intel_modeset_driver_remove i915->hotplug.dig_port_work can be queued from intel_hpd_irq_handler called by IRQ handler or by intel_hpd_trigger_irq called from dp_mst. Since dp_mst is suspended after irq handler uninstall, a cleaner approach is to cancel hpd work after intel_dp_mst_suspend, otherwise we risk use-after-free. It should fix following WARNINGS: [283.405824] cpu_latency_qos_update_request called for unknown object [283.405866] WARNING: CPU: 2 PID: 240 at kernel/power/qos.c:296 cpu_latency_qos_update_request+0x2d/0x100 [283.405912] CPU: 2 PID: 240 Comm: kworker/u64:9 Not tainted 5.18.0-rc6-Patchwork_103738v3-g1672d1c43e43+ #1 [283.405915] Hardware name: Intel Corporation Raptor Lake Client Platform/RPL-S ADP-S DDR5 UDIMM CRB, BIOS RPLSFWI1.R00.2397.A01.2109300731 09/30/2021 [283.405916] Workqueue: i915-dp i915_digport_work_func [i915] [283.406020] RIP: 0010:cpu_latency_qos_update_request+0x2d/0x100 ... [283.406040] Call Trace: [283.406041] [283.406044] intel_dp_aux_xfer+0x60e/0x8e0 [i915] [283.406131] ? finish_swait+0x80/0x80 [283.406139] intel_dp_aux_transfer+0xc5/0x2b0 [i915] [283.406218] drm_dp_dpcd_access+0x79/0x130 [drm_display_helper] [283.406227] drm_dp_dpcd_read+0xe2/0xf0 [drm_display_helper] [283.406233] intel_dp_hpd_pulse+0x134/0x570 [i915] [283.406308] ? __down_killable+0x70/0x140 [283.406313] i915_digport_work_func+0xba/0x150 [i915] Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4586 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5558 Signed-off-by: Andrzej Hajda Reviewed-by: Arun R Murthy Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220826141929.189681-2-andrzej.hajda@intel.com commit 4182a311fbd83f17b276d94c44539aa97d381959 Author: Ville Syrjälä Date: Fri Jul 15 23:20:44 2022 +0300 drm/i915: Parse DP/eDP max lane count from VBT Limit the DP lane count based on the new VBT DP/eDP max lane count field. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-13-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ac7af83ae08b2789a828add74c01ed2e7b78e21f Author: Ville Syrjälä Date: Fri Jul 15 23:20:42 2022 +0300 drm/i915: Rename some VBT bits The allow vs. block display switch bits are named rather inconsistently. Fix it up. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5a856cc22841d6f3202aa91fa5d4ad07e3c0a9db Author: Ville Syrjälä Date: Fri Jul 15 23:20:41 2022 +0300 drm/i915: Define all possible VBT device handles We already have LFP1 and LFP2 device handles define. Just add all the rest as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 3064d01976cc88f9ab0625bb4f729ba5e5986584 Author: Ville Syrjälä Date: Fri Jul 15 23:20:40 2022 +0300 drm/i915: Define more VBT driver features block bits Define some additional bits in the driver features VBT block. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 490d95c70e9d2debd2be0f7bda524c28fc009da1 Author: Ville Syrjälä Date: Fri Jul 15 23:20:39 2022 +0300 drm/i915: Document the sets of bits in the driver features block Add a few comment documenting the sets of bits in the driver features block. Might make it a bit easier to check against the spec. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5fe9eea5eda09a5b02398671def156e16162eeb4 Author: Ville Syrjälä Date: Fri Jul 15 23:20:38 2022 +0300 drm/i915: Define VBT max HDMI FRL rate bits The VBT gained some bits to inidicate the max FRL rate for HDMI 2.1, define them. These just outright replaced the slave_port bits for ganged eDP. Apparently that feature was never actually used so someone decided that reusing the bits is fine. Although the actual ganged eDP enable bit was still left defined elsewhere for some reason. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ed1b4369fc550416b54de7ed78ee39ba8b64f88e Author: Ville Syrjälä Date: Fri Jul 15 23:20:37 2022 +0300 drm/i915: Add the VBT LTTPR transparent vs. non-transparent bits VBT gained a bit to indicate whether LTTPRs should use transparent or non-transparent mode. Dunno if we should actually look at this... Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d48596f3ef2c0aa2ce7a106dd5ed99045d4ae377 Author: Ville Syrjälä Date: Fri Jul 15 23:20:36 2022 +0300 drm/i915: Define VBT eDP/DP max lane count bits Since version 244 the VBT can llimt the eDP/DP max lane count. Add the bits. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f04b1d91aeec5f981b3a8f10b7321fed544d68d6 Author: Ville Syrjälä Date: Fri Jul 15 23:20:35 2022 +0300 drm/i915: Properly define the DP redriver VBT bits Split the DP redriver bytes into bitfields. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e58f889e293e6bd13ae2b48208a4d0d15592bf5a Author: ye xingchen Date: Thu Sep 1 07:42:09 2022 +0000 RDMA/hfi1: Remove the unneeded result variable Return the value set_link_state() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220901074209.313004-1-ye.xingchen@zte.com.cn Signed-off-by: Leon Romanovsky commit 46d4eedab5a1fbadfd5dfc915a92cd13fb3bf325 Author: Ville Syrjälä Date: Fri Jul 15 23:20:34 2022 +0300 drm/i915: Add some more VBT version number comments Document the VBT version dependency of several other fields. v2: s/165/155/ for custom_vbt_version (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4a13796aeb84c94e1883d4f93904a94284f8e5ea Author: Jiangshan Yi Date: Mon Sep 5 15:13:00 2022 +0800 pinctrl: berlin: fix spelling typo in comment Fix spelling typo in comment. Reported-by: k2ci Signed-off-by: Jiangshan Yi Link: https://lore.kernel.org/r/20220905071300.1832105-1-13667453960@163.com Signed-off-by: Linus Walleij commit d324a46be33ed0c1730ed8194345fce83eeba0e8 Merge: b021d82e2503e 8a2dd123f12f6 Author: Leon Romanovsky Date: Mon Sep 5 15:09:55 2022 +0300 Merge branch 'mlx5-next' into wip/leon-for-next Perform merge of Mellanox shared branch. * mlx5-next: RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib commit 494a22765ce479c9f8ad181c5d24cffda9f534bb Author: Xu Qiang Date: Thu Aug 25 06:53:24 2022 +0000 spi: qup: add missing clk_disable_unprepare on error in spi_qup_pm_resume_runtime() Add the missing clk_disable_unprepare() before return from spi_qup_pm_resume_runtime() in the error handling case. Fixes: dae1a7700b34 (“spi: qup: Handle clocks in pm_runtime suspend and resume”) Signed-off-by: Xu Qiang Link: https://lore.kernel.org/r/20220825065324.68446-2-xuqiang36@huawei.com Signed-off-by: Mark Brown commit 70034320fdc597b8f58b4a43bb547f17c4c5557a Author: Xu Qiang Date: Thu Aug 25 06:53:23 2022 +0000 spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Add the missing clk_disable_unprepare() before return from spi_qup_resume() in the error handling case. Fixes: 64ff247a978f (“spi: Add Qualcomm QUP SPI controller support”) Signed-off-by: Xu Qiang Link: https://lore.kernel.org/r/20220825065324.68446-1-xuqiang36@huawei.com Signed-off-by: Mark Brown commit 587bfe3f7a270f0a4076e624d318292324bdead8 Author: Dmitry Torokhov Date: Sun Sep 4 23:31:01 2022 -0700 regulator: bd9576: switch to using devm_fwnode_gpiod_get() I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. While at it switch the rest of the calls to read properties in bd957x_probe() to the generic device property API as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Reviewed-by: Matti Vaittinen Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com Signed-off-by: Mark Brown commit 97c9278ec624a0d5d7c56aa20e16afc8aaa96557 Author: Dmitry Torokhov Date: Sun Sep 4 23:31:00 2022 -0700 regulator: bd71815: switch to using devm_fwnode_gpiod_get() I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Reviewed-by: Matti Vaittinen Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-8-b29adfb27a6c@gmail.com Signed-off-by: Mark Brown commit 6ed406ef9f74372282c3b515e64986120823f769 Author: Andy Shevchenko Date: Thu Sep 1 16:23:36 2022 +0300 regmap: trace: Remove unneeded blank lines There is a few unneeded blank lines in some of event definitions, remove them in order to make those definitions consistent with the rest. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220901132336.33234-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit d10268a50bdbc03ebb6d340d63bf78c44d7c66a8 Author: Andy Shevchenko Date: Thu Sep 1 16:23:35 2022 +0300 regmap: trace: Remove explicit castings There is no need to have explicit castings to the same type the variables are of. Remove the explicit castings. Signed-off-by: Andy Shevchenko Reviewed-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20220901132336.33234-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit f78d5e1168e08429bc948d09b6dc11fec5e019f7 Author: Andy Shevchenko Date: Thu Sep 1 16:23:34 2022 +0300 regmap: trace: Remove useless check for NULL for bulk ops If the buffer pointer is NULL we already are in troubles since regmap bulk API expects caller to provide valid parameters, it dereferences that without any checks before we call for traces. Moreover, the current code will print garbage in the case of buffer is NULL and length is not 0. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220901132336.33234-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 4ec8179c212fb1530df4a1df6db75756c06da5f6 Author: Martin Povišer Date: Mon Sep 5 09:40:30 2022 +0200 ASoC: apple: mca: Postpone requesting of DMA channels Move the requesting of DMA channels further down from 'probe' to 'pcm_new'. This is to spare the allocated DMA channel resources as we typically only ever use one or two of the clusters for PCM streaming. Before we would request DMA channels for all clusters. (This is prompted by a change in the Audio DMA Controller driver, which will now be allocating cache SRAM to channels.) Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220905074030.1293-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 354f6008b730a217a3e6ad982eda42e90e6f7473 Author: Chunxu Li Date: Sat Sep 3 11:21:51 2022 +0800 ASoC: SOF: Introduce function sof_of_machine_select From current design in sof_machine_check the SOF can only support ACPI type machine. In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine. So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv. Signed-off-by: Chunxu Li Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220903032151.13664-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 35c8ae25c4fdeabf490e005692795a3be17ca5f6 Author: Cristian Ciocaltea Date: Fri Aug 26 01:05:30 2022 +0300 ASoC: wm_adsp: Handle optional legacy support The tracing capabilities for the speaker protection fw enabled via commit c55b3e46cb99 ("ASoC: wm_adsp: Add trace caps to speaker protection FW") are not be available on all platforms, such as the Valve's Steam Deck which is based on the Halo Core DSP. As a consequence, whenever the firmware is loaded, a rather misleading 'Failed to parse legacy: -19' error message is written to the kernel ring buffer: [ 288.977412] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Firmware version: 3 [ 288.978002] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: cs35l41-dsp1-spk-prot.wmfw: Fri 02 Apr 2021 21:03:50 W. Europe Daylight Time [ 289.094065] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Firmware: 400a4 vendor: 0x2 v0.33.0, 2 algorithms [ 289.095073] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: 0: ID cd v29.53.0 XM@94 YM@e [ 289.095665] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: 1: ID f20b v0.0.1 XM@170 YM@0 [ 289.096275] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Protection: C:\Users\ocanavan\Desktop\cirrusTune_july2021.bin [ 291.172383] steamdeck kernel: cs35l41 spi-VLV1776:01: DSP1: Failed to parse legacy: -19 Update wm_adsp_buffer_init() to print a more descriptive info message when wm_adsp_buffer_parse_legacy() returns -ENODEV. Fixes: c55b3e46cb99 ("ASoC: wm_adsp: Add trace caps to speaker protection FW") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220825220530.1205141-1-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 2848d34c3ba1fc6f1ece0736a4faa16c6277f4d3 Author: Martin Povišer Date: Thu Aug 25 16:22:26 2022 +0200 ASoC: tas2562: Fix mute/unmute Because the PWR_CTRL field is modeled as the power state of the DAC widget, and at the same time it is used to implement mute/unmute, we need some additional book-keeping to have the right end result no matter the sequence of calls. Without this fix, one permanently mutes an ongoing stream by toggling the associated speaker pin control. (This mirrors commit 1e5907bcb3a3 ("ASoC: tas2770: Fix handling of mute/unmute") which was a fix to the tas2770 driver.) Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825142226.80929-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit b6b55b232564ade5cd91e9b9e2228b49f230d67f Author: Martin Povišer Date: Thu Aug 25 16:22:25 2022 +0200 ASoC: tas2562: Drop conflicting set_bias_level power setting The driver is setting the PWR_CTRL field in both the set_bias_level callback and on DAPM events of the DAC widget (and also in the mute_stream method). Drop the set_bias_level callback altogether as the power setting it does is in conflict with the other code paths. (This mirrors commit c8a6ae3fe1c8 ("ASoC: tas2770: Drop conflicting set_bias_level power setting") which was a fix to the tas2770 driver.) Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825142226.80929-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 6932b20d4f41dc01dc58c0afb335e688575c7d54 Author: Kuninori Morimoto Date: Tue Aug 30 03:17:19 2022 +0000 ASoC: soc-pcm.c: check fe condition at out of loop Current dpcm_add_paths() is checking fe condition in loop (= A), but fe condition (X) is not related to the loop (B). (X) static int dpcm_add_paths(fe, stream, ...) { ... (B) for_each_dapm_widgets(list, i, widget) { ... (A) if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue; ... } ... } This patch checks fe condition at out of loop Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmgi4dz4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 041107289c5cebb0693a55c432ab50862a450476 Author: Kuninori Morimoto Date: Tue Aug 30 03:17:12 2022 +0000 ASoC: soc-pcm.c: add soc_pcm_ret() Current soc-pcm.c has many similar code for error case. This patch adds soc_pcm_ret() and share the code and error message. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r10y4dzb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 10d5d8cbf6268e612bacac29c0beef489d3c1398 Author: Kuninori Morimoto Date: Tue Aug 30 03:17:03 2022 +0000 ASoC: soc-pcm.c: remove unnecessary codec2codec_close_delayed_work() commit 4bf2e385aa59c2fae ("ASoC: core: Init pcm runtime work early to avoid warnings") has added generic close_delayed_work() which checks close_delayed_work_func static void close_delayed_work(...) { ... => if (rtd->close_delayed_work_func) rtd->close_delayed_work_func(rtd); } So, we don't need to have NULL function for Codec2Codec. => static void codec2codec_close_delayed_work() { /* * Currently nothing to do for c2c links * Since c2c links are internal nodes in the DAPM graph and * don't interface with the outside world or application layer * we don't have to do any special handling on close. */ } int soc_new_pcm(...) { ... if (rtd->dai_link->params) => rtd->close_delayed_work_func = codec2codec_close_delayed_work; else rtd->close_delayed_work_func = snd_soc_close_delayed_work; ... } Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sfle4dzk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8a2dd123f12f69e5373d3103da2c97fc36223e0c Author: Chris Mi Date: Mon Aug 29 12:06:04 2022 +0300 RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib This patch doesn't change any functionality, but move one function to mlx5_ib because it is not used by mlx5_core. The actual fix is in the next patch. Reviewed-by: Roi Dayan Signed-off-by: Chris Mi Link: https://lore.kernel.org/r/fd47b9138412bd94ed30f838026cbb4cf3878150.1661763871.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit 5f3c5193479e5b9d51b201245febab6fbda4c477 Merge: 6630edabd8082 c9cd961c0d43a Author: David S. Miller Date: Mon Sep 5 13:06:40 2022 +0100 Merge branch 'lan937x-phy-link-interrupt' Arun Ramadoss says: ==================== net: dsa: microchip: lan937x: enable interrupt for internal phy link detection This patch series enables the internal phy link detection for lan937x using the interrupt method. lan937x acts as the interrupt controller for the internal ports and phy, the irq_domain is registered for the individual ports and in turn for the individual port interrupts. RFC v3 -> Patch v1 - Removed the RFC v3 1/3 from the series - changing exit from reset - Changed the variable name in ksz_port from irq to pirq - Added the check for return value of irq_find_mapping during phy irq registeration. - Moved the clearing of POR_READY_INT from girq_thread_fn to lan937x_reset_switch RFC v2 -> v3 - Used the interrupt controller implementation of phy link Changes in RFC v2 - fixed the compilation issue ==================== Signed-off-by: David S. Miller commit c9cd961c0d43a22eb704aa92e1f8fb33e3d286e8 Author: Arun Ramadoss Date: Fri Sep 2 16:02:10 2022 +0530 net: dsa: microchip: lan937x: add interrupt support for port phy link This patch enables the interrupts for internal phy link detection for LAN937x. The interrupt enable bits are active low. There is global interrupt mask for each port. And each port has the individual interrupt mask for TAS. QCI, SGMII, PTP, PHY and ACL. The first level of interrupt domain is registered for global port interrupt and second level of interrupt domain for the individual port interrupts. The phy interrupt is enabled in the lan937x_mdio_register function. Interrupt from which port is raised will be detected based on the interrupt host data. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit f313936261ac18a2527fc0752cf988950587d0ce Author: Arun Ramadoss Date: Fri Sep 2 16:02:09 2022 +0530 net: dsa: microchip: lan937x: clear the POR_READY_INT status bit In the lan937x_reset_switch(), it masks all the switch and port registers. In the Global_Int_status register, POR ready bit is write 1 to clear bit and all other bits are read only. So, this patch clear the por_ready_int status bit by writing 1. Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f3c165459c5189b7b469e3b86107ee8819c93774 Author: Arun Ramadoss Date: Fri Sep 2 16:02:08 2022 +0530 net: dsa: microchip: add reference to ksz_device inside the ksz_port struct ksz_port doesn't have reference to ksz_device as of now. In order to find out from which port interrupt has triggered, we need to pass the struct ksz_port as a host data. When the interrupt is triggered, we can get the port from which interrupt triggered, but to identify it is phy interrupt we have to read status register. The regmap structure for accessing the device register is present in the ksz_device struct. To access the ksz_device from the ksz_port, the reference is added to it with port number as well. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5a1ae03fe5b7905b2913ada57629a2ef255629f5 Author: Ville Syrjälä Date: Fri Jul 15 23:20:33 2022 +0300 drm/i915: Unify VBT version number comments Use a more standard form for the VT version number comments. One slight oddball case is the dp_max_link_rate that had two version numbers (216/230) and a platform name (GLK). The story goes that the field was introduced in the spec in version 216, along with a note that it's used on CNL+. Later in version 230 the definition of the bit was changed in bacakwards incompatible ways and the CNL note disappeard. For us the original CNL+ note in the header got changed to to GLK+ when all CNL support was dropped from the codebase. We do still need (and have) handling for both the 216+ and the 230+ defintions (parse_bdb_216_dp_max_link_rate() vs. parse_bdb_230_dp_max_link_rate()). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220715202044.11153-2-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit b021d82e2503e3704672221bfa3028f30e749cc5 Author: Bodong Wang Date: Mon Aug 29 12:04:12 2022 +0300 IB/mlx5: Support querying eswitch functions from DEVX Query eswitch functions returns information of the external host PF(if it exists). It can be used to check if DEVX is running on ECPF. Reviewed-by: Erez Shitrit Reviewed-by: Saeed Mahameed Signed-off-by: Bodong Wang Link: https://lore.kernel.org/r/4265925178ab3224dc1d3e3784bb312d808edca5.1661763785.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky commit 6630edabd80823cc6f7c874d52a4cac6381b9051 Merge: 599566c1c3692 8672bab7eb947 Author: David S. Miller Date: Mon Sep 5 12:47:02 2022 +0100 Merge branch 'ipa-transaction-IDs' Alex Elder says: ==================== net: ipa: start using transaction IDs A previous group of patches added ID fields to track the state of transactions: https://lore.kernel.org/netdev/20220831224017.377745-1-elder@linaro.org This series starts using those IDs instead of the lists used previously. Most of this series involves reworking the function that determines which transaction is the "last", which determines when a channel has been quiesed. The last patch is mainly used to prove that the new index method of tracking transaction state is equivalent to the previous use of lists. ==================== Signed-off-by: David S. Miller commit 8672bab7eb947222609bec8ed8a423bc72bccdbe Author: Alex Elder Date: Fri Sep 2 16:02:18 2022 -0500 net: ipa: verify a few more IDs The completed transaction list is used in gsi_channel_trans_complete() to return the next transaction in completed state. Add some temporary checks to verify the transaction indicated by the completed ID matches the one first in this list. Similarly, we use the pending and completed transaction lists when cancelling pending transactions in gsi_channel_trans_cancel_pending(). Add temporary checks there to verify the transactions indicated by IDs match those tracked by these lists. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4601e75596cb7a4d538e7b9cf0b599b364acbae8 Author: Alex Elder Date: Fri Sep 2 16:02:17 2022 -0500 net: ipa: further simplify gsi_channel_trans_last() Do a little more refactoring in gsi_channel_trans_last() to simplify it further. The resulting code should behave exactly as before. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit e68d1d1591fd70de0651e1af66db69540f556e73 Author: Alex Elder Date: Fri Sep 2 16:02:16 2022 -0500 net: ipa: simplify gsi_channel_trans_last() Using a little logic we can simplify gsi_channel_trans_last(). The first condition in that function looks like this: if (trans_info->allocated_id != trans_info->free_id) And if that's false, we proceed to the next one: if (trans_info->committed_id != trans_info->allocated_id) Failure of the first test implies: trans_info->allocated_id == trans_info->free_id And therefore, the second one can be rewritten this way: if (trans_info->committed_id != trans_info->free_id) Substituting free_id for allocated_id and committed_id can also be done in the code blocks executed when these conditions yield true. The net result is that all three blocks for TX endpoints can be consolidated into just one. The two blocks of code at the end of that function (used for both TX and RX channels) can be similarly consolidated into a single block. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 897c0ce665d619227e19f59934115c1b7719621f Author: Alex Elder Date: Fri Sep 2 16:02:15 2022 -0500 net: ipa: use IDs exclusively for last transaction Always use transaction IDs when finding the "last" transaction to await when quiescing a channel. This basically extends what was done in the previous patch to all other transaction state IDs. As a result we are no longer updating any transaction lists inside gsi_channel_trans_last(), so there's no need to take the spinlock. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c30623ea0b3a9d766f34f75a326b8c610ca3105e Author: Alex Elder Date: Fri Sep 2 16:02:14 2022 -0500 net: ipa: use IDs for last allocated transaction Use the allocated and free transaction IDs to determine whether the "last" transaction used for quiescing a channel is in allocated state. The last allocated transaction that has not been committed (if any) immediately precedes the first free transaction in the transaction array. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit b2abe33d23cfaea6cd3f8335a1ee08c480512c6f Author: Alex Elder Date: Fri Sep 2 16:02:13 2022 -0500 net: ipa: rework last transaction determination When quiescing a channel, we find the "last" transaction, which is the latest one to have been allocated. (New transaction allocation will have been prevented by the time this is called.) Currently we do this by looking for the first non-empty transaction list in each state, then return the last entry from that last. Instead, determine the last entry in each list (if any) and return that entry if found. Temporarily (locally) introduce list_last_entry_or_null() as a helper for this, mirroring list_first_entry_or_null(). This macro definition will be removed by an upcoming patch. Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 599566c1c369205286b1a22e1b3c2e9dea0e3744 Author: Heiner Kallweit Date: Fri Sep 2 22:52:34 2022 +0200 r8169: use devm_clk_get_optional_enabled() to simplify the code Now that we have devm_clk_get_optional_enabled(), we don't have to open-code it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit baa71622cf67519c79a9968e202a35de45cc330b Author: Heiner Kallweit Date: Fri Sep 2 22:21:57 2022 +0200 r8169: remove comment about apparently non-existing chip versions It's not clear where these entries came from, and as I wrote in the comment: Not even Realtek's r8101 driver knows these chip id's. So remove the comment. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7e04a111cde2c94d449ca80f80d2c28648fec8f1 Author: Heiner Kallweit Date: Fri Sep 2 22:10:53 2022 +0200 r8169: merge handling of chip versions 12 and 17 (RTL8168B) It's not clear why XID's 380 and 381..387 ever got different chip version id's. VER_12 and VER_17 are handled exactly the same. Therefore merge handling under the VER_17 umbrella. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 6690986da1e21f3bebe1aaa54a70c636f40343b5 Author: Ard Biesheuvel Date: Mon Sep 5 13:17:40 2022 +0200 usb: clean up after dropping driver registration log spam Drop another couple of pointless pr_info() calls, and drop a number of instances of hcd_name variables that are no longer referenced now that they are no longer printed to the log at driver registration time. Fixes: 10174220f55a ("usb: reduce kernel log spam on driver registration") Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220905111740.352348-1-ardb@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9e2bb70349fed75b15b9170bb1bff147a761fece Author: Dmitry Torokhov Date: Sun Sep 4 23:30:57 2022 -0700 usb: gadget: udc: at91: switch to using fwnode_gpiod_get_index() I would like to stop exporting OF-specific gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-5-b29adfb27a6c@gmail.com Signed-off-by: Greg Kroah-Hartman commit 255930b953fb1b8bec2c0aa8cc532e377e5fada2 Author: Dmitry Torokhov Date: Sun Sep 4 23:30:56 2022 -0700 usb: phy: tegra: switch to using devm_gpiod_get() I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic device property API. I believe that the only reason the driver, instead of the standard devm_gpiod_get(), used devm_gpiod_get_from_of_node() is because it wanted to set up a pretty consumer name for the GPIO, and we now have a special API for that. Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-4-b29adfb27a6c@gmail.com Signed-off-by: Greg Kroah-Hartman commit d017aeaf844db21e8e7b22d79de229b746359f3b Author: Greg Kroah-Hartman Date: Thu Sep 1 15:47:44 2022 +0200 USB: xhci: make xhci_get_endpoint_address static This is only called in the xhci.c file, so make the symbol static. Cc: Mathias Nyman Link: https://lore.kernel.org/r/20220901134744.2039891-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit f3d478858bec4f5dbba410f9b1db1b2505344188 Author: Yinbo Zhu Date: Fri Sep 2 14:36:39 2022 +0800 usb: ohci-platform: fix usb disconnect issue after s4 The ohci retaining bogus hardware states cause usb disconnect devices connected before hibernation(s4), this issue occur when ohci-platform driver build as a module and the built-in ohci-platform driver will re probe and re enumerate the devices, so there will be no such problem. Avoid retaining bogus hardware states during resume-from-hibernation. Previously we had reset the hardware as part of preparing to reinstate the snapshot image. But we can do better now with the new PM framework, since we know exactly which resume operations are from hibernation. According to the commit 'cd1965db054e ("USB: ohci: move ohci_pci_{ suspend,resume} to ohci-hcd.c")' and commit '6ec4beb5c701 ("USB: new flag for resume-from-hibernation")', the flag "hibernated" is for resume-from-hibernation and it should be true when usb resume from disk. When this flag "hibernated" is set, the drivers will reset the hardware to get rid of any existing state and make sure resume from hibernation re-enumerates everything for ohci. Acked-by: Alan Stern Signed-off-by: Yinbo Zhu Link: https://lore.kernel.org/r/20220902063639.17875-1-zhuyinbo@loongson.cn Signed-off-by: Greg Kroah-Hartman commit 8fe444eb326869823f3788a4b4da5dca03339d10 Author: Simon Ser Date: Mon Aug 29 15:15:03 2022 +0000 drm/atomic-helper: log EINVAL cause in drm_atomic_helper_async_check() This can help figure out why the kernel returns EINVAL from user-space. v2: add missing newlines Signed-off-by: Simon Ser Cc: Daniel Vetter Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220829151451.152114-2-contact@emersion.fr commit 0aedc880025ffed5be6736bca61ace31f591b92d Author: Simon Ser Date: Mon Aug 29 15:14:56 2022 +0000 drm/atomic-helper: print message on driver connector check failure Sometimes drivers are missing logs when they return EINVAL. Printing the failure here in common code can help understand where EINVAL is coming from. All other atomic_check() calls in this file already have similar logging. v2: add missing newlines Signed-off-by: Simon Ser Cc: Daniel Vetter Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220829151451.152114-1-contact@emersion.fr commit 981f09295687f856d5345e19c7084aca481c1395 Author: Simon Ser Date: Mon Aug 1 13:38:02 2022 +0000 drm: hide unregistered connectors from GETCONNECTOR IOCTL When registering a connector, the kernel sends a hotplug uevent in drm_connector_register(). When unregistering a connector, drivers are expected to send a uevent as well. However, user-space has no way to figure out that the connector isn't registered anymore: it'll still be reported in GETCONNECTOR IOCTLs. The documentation for DRM_CONNECTOR_UNREGISTERED states: > The connector […] has since been unregistered and removed from > userspace, or the connector was unregistered before it had a chance > to be exposed to userspace Signed-off-by: Simon Ser Cc: Daniel Vetter Cc: Ville Syrjälä Cc: Jani Nikula Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220801133754.461037-1-contact@emersion.fr commit 0ea76c401f9245ac209f1b1ce03a7e1fb9de36e5 Author: Mario Limonciello Date: Tue Aug 2 23:25:00 2022 -0500 gpiolib: acpi: Add a quirk for Asus UM325UAZ Asus UM325UAZ has GPIO 18 programmed as both an interrupt and a wake source, but confirmed with internal team on this design this pin is floating and shouldn't have been programmed. This causes lots of spurious IRQs on the system and horrendous battery life. Add a quirk to ignore attempts to program this pin on this system. Reported-by: Pavel Krc Link: https://bugzilla.kernel.org/show_bug.cgi?id=216208 Reviewed-by: Hans de Goede Signed-off-by: Mario Limonciello Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 6b6af7bd5718f4e45a9b930533aec1158387d552 Author: Mario Limonciello Date: Tue Aug 2 23:24:59 2022 -0500 gpiolib: acpi: Add support to ignore programming an interrupt gpiolib-acpi already had support for ignoring a pin for wakeup, but if an OEM configures a floating pin as an interrupt source then stopping it from being a wakeup won't do much good to stop the interrupt storm. Add support for a module parameter and quirk infrastructure to ignore interrupts as well. Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 246450344dad087a121befbed1aba776dba3d377 Author: Jagan Teki Date: Fri Sep 2 12:20:57 2022 +0530 arm64: dts: rockchip: rk3399: Radxa ROCK 4C+ Add support for Radxa ROCK 4C+ SBC. Key differences of 4C+ compared to previous ROCK Pi 4. - Rockchip RK3399-T SoC - DP from 4C replaced with micro HDMI 2K@60fps - 4-lane MIPI DSI with 1920*1080 - RK817 Audio codec Also, an official naming convention from Radxa mention to remove Pi from board name, so this 4C+ is named as Radxa ROCK 4C+ not Radxa ROCK Pi 4C+. Signed-off-by: Stephen Chen Signed-off-by: Manoj Sai Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220902065057.97425-3-jagan@amarulasolutions.com Signed-off-by: Heiko Stuebner commit 9176ba910ba0309dd025b55381601da5f414b36e Author: Jagan Teki Date: Fri Sep 2 12:20:56 2022 +0530 arm64: dts: rockchip: Add RK3399-T OPP table RK3399-T is down-clocked version of RK3399 SoC operated at 1.5GHz. Add CPU operating points table for it. Signed-off-by: FUKAUMI Naoki Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220902065057.97425-2-jagan@amarulasolutions.com Signed-off-by: Heiko Stuebner commit 638b8eb43b2a143f151045e66e695ba91b4a1a7c Author: Jagan Teki Date: Fri Sep 2 12:20:55 2022 +0530 dt-bindings: arm: rockchip: Document Radxa ROCK 4C+ Document the dt-bindings for Radxa ROCK 4C+ SBC. Key differences of 4C+ compared to previous ROCK Pi 4. - Rockchip RK3399-T SoC - DP from 4C replaced with micro HDMI 2K@60fps - 4-lane MIPI DSI with 1920*1080 - RK817 Audio codec Also, an official naming convention from Radxa mention to remove Pi from board name, so this 4C+ is named as Radxa ROCK 4C+ not Radxa ROCK Pi 4C+. Acked-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220902065057.97425-1-jagan@amarulasolutions.com Signed-off-by: Heiko Stuebner commit 570ed4e5b0d9e784f51a52bede2326391afa8c3f Author: Jianqun Xu Date: Thu Aug 18 18:11:18 2022 +0530 soc: rockchip: io-domain: Add RV1126 IO domains Add IO domains support for RV1126 SoC. Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Jianqun Xu Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-6-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 593e860fdff9add7f7eba504cf111b59a728fda5 Author: Jagan Teki Date: Thu Aug 18 18:11:17 2022 +0530 dt-bindings: power: rockchip: Document RV1126 PMU IO domains Document dt-bindings for RV1126 PMU IO domains. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-5-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 66296e0a318e12ef1ca04013e1e893539e715c5a Author: Jagan Teki Date: Thu Aug 18 18:11:16 2022 +0530 soc: rockchip: power-domain: Add RV1126 power domains Add power domains support for RV1126 SoC. Cypto, VO and NPU domains will add it future patches. Signed-off-by: Elaine Zhang Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-4-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 2f3484b27598427ae582a37520b67c011597d706 Author: Jagan Teki Date: Thu Aug 18 18:11:15 2022 +0530 dt-bindings: power: rockchip: Document RV1126 power-controller Document dt-bindings for RV1126 power-controller. Acked-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-3-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit aa247e4e9736480a926d3cf32ca170a2c4f75dfb Merge: 4e441643b3224 daf7dc86513ff Author: Heiko Stuebner Date: Mon Sep 5 11:52:57 2022 +0200 Merge branch 'v6.1-shared/powerdomain' into v6.1-armsoc/drivers commit daf7dc86513ffc9d9b2eef0378d97361609490ca Author: Jagan Teki Date: Thu Aug 18 18:11:14 2022 +0530 dt-bindings: power: Add power-domain header for RV1126 Add power-domain header for RV1126 SoC from description in TRM. Signed-off-by: Elaine Zhang Signed-off-by: Jagan Teki Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220818124132.125304-2-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit c2a6502f36248e9e17806d1342e4617d895960b0 Author: Nirmoy Das Date: Thu Sep 1 19:22:17 2022 +0200 drm/i915/ttm: Abort suspend on i915_ttm_backup failure On system suspend when system memory is low then i915_gem_obj_copy_ttm() could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough, suspend shouldn't continue if i915_ttm_backup() throws an error. v2: Keep the fdo issue till we have a igt test(Matt). v3: Use %pe(Andrzej) References: https://gitlab.freedesktop.org/drm/intel/-/issues/6529 Reviewed-by: Matthew Auld Reviewed-by: Andrzej Hajda Suggested-by: Chris P Wilson Signed-off-by: Nirmoy Das Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220901172217.18392-1-nirmoy.das@intel.com commit 7752422f500a290c607795ab8db16754b8fd1d4c Merge: 9837ec955b46b 565f02fc1e5dc Author: David S. Miller Date: Mon Sep 5 10:16:53 2022 +0100 Merge branch 'altera-tse-phylink' Maxime Chevallier says: ==================== net: altera: tse: phylink conversion This is V4 of a series converting the Altera TSE driver to phylink, introducing a new PCS driver along the way. The Altera TSE can be built with a SGMII/1000BaseX PCS, allowing to use SFP ports with this MAC, which is the end goal of adding phylink support and a proper PCS driver. The PCS itself can either be mapped in the MAC's register space, in that case, it's accessed through 32 bits registers, with the higher 16 bits always 0. Alternatively, it can sit on its own register space, exposing 16 bits registers, some of which ressemble the standard PHY registers. To tackle that rework, several things needs updating, starting by the DT binding, since we add support for a new register range for the PCS. Hence, the first patch of the series is a conversion to YAML of the existing binding. Then, patch 2 does a bit of simple cleanup to the TSE driver, using nice reverse xmas tree definitions. Patch 3 adds the actual PCS driver, as a standalone driver. Some future series will then reuse that PCS driver from the dwmac-socfpga driver, which implements support for this exact PCS too, allowing to share the code nicely. Patch 4 is then a phylink conversion of the altera_tse driver, to use this new PCS driver. Finally, patch 5 updates the newly converted DT binding to support the pcs register range. This series contains bits and pieces for this conversion, please tell me if you want me to send it as individual patches. V4 Changes: - Add missing MODULE_* macros to the TSE PCS driver V3 Changes: - YAML binding conversion changes and PCS addition changes thanks to Krzysztof's reviews V2 Changes : - Fixed the binding after the YAML conversion - Added a pcs_validate() callback - Introduced a comment to justify a soft reset for the PCS ==================== Signed-off-by: David S. Miller commit 565f02fc1e5dc18a577545aaef3c1191cd011849 Author: Maxime Chevallier Date: Fri Sep 2 10:32:05 2022 +0200 dt-bindings: net: altera: tse: add an optional pcs register range Some implementations of the TSE have their PCS as an external bloc, exposed at its own register range. Document this, and add a new example showing a case using the pcs and the new phylink conversion to connect an sfp port to a TSE mac. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit fef2998203e17e4298843afb2056fbed44611734 Author: Maxime Chevallier Date: Fri Sep 2 10:32:04 2022 +0200 net: altera: tse: convert to phylink Convert the Altera Triple Speed Ethernet Controller to phylink. This controller supports MII, GMII and RGMII with its MAC, and SGMII + 1000BaseX through a small embedded PCS. The PCS itself has a register set very similar to what is found in a typical 802.3 ethernet PHY, but this register set memory-mapped instead of lying on an mdio bus. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 4a502cf4d77e12119e7061a05d5789cd3129d185 Author: Maxime Chevallier Date: Fri Sep 2 10:32:03 2022 +0200 net: pcs: add new PCS driver for altera TSE PCS The Altera Triple Speed Ethernet has a SGMII/1000BaseC PCS that can be integrated in several ways. It can either be part of the TSE MAC's address space, accessed through 32 bits accesses on the mapped mdio device 0, or through a dedicated 16 bits register set. This driver allows using the TSE PCS outside of altera TSE's driver, since it can be used standalone by other MACs. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 5adb0ed04535fdf827960ddcaddaeb88aa32ab3b Author: Maxime Chevallier Date: Fri Sep 2 10:32:02 2022 +0200 net: altera: tse: cosmetic change to use reverse xmas tree ordering Make the driver code cleaner through a strictly cosmetic change, using he reverse xmas tree variable declaration ordering. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit b0155d9096903743a41ec11e287d1caab1510fdf Author: Maxime Chevallier Date: Fri Sep 2 10:32:01 2022 +0200 dt-bindings: net: Convert Altera TSE bindings to yaml Convert the bindings for the Altera Triple-Speed Ethernet to yaml. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 76fba1221e3045570478381c3436c8c2a2656376 Merge: f98d67ac427d4 4f96b1bc156e7 Author: Hans de Goede Date: Mon Sep 5 11:01:56 2022 +0200 Merge tag 'backlight-detect-refactor-1' into review-hans Immutable backlight-detect-refactor branch between acpi, drm-* and pdx86 Tag (immutable branch) with v6.0-rc1 + the (acpi/x86) backlight detect refactor work. For merging into the acpi, drm-* and pdx86 subsystems. commit f9feb882744f8dd3d7b52c3548bb6471ef3adea6 Author: Stanislav Lisovskiy Date: Tue Aug 23 11:25:14 2022 +0300 drm/i915: Start using REG_BIT* macros with CDCLK registers Lets start to use REG_BIT* macros, when working with CDCLK registers, such as CDCLK_CTL, instead of (x << 0) like expressions. Link: https://patchwork.freedesktop.org/patch/msgid/20220901113011.12080-1-stanislav.lisovskiy@intel.com Reviewed-by: Jani Nikula Signed-off-by: Stanislav Lisovskiy commit 2378bf144b841df548161af49bf1ff393dc60d44 Author: Liang He Date: Sat Jul 16 15:43:44 2022 +0800 powerpc/powermac/udbg_scc: Add missing of_node_put()s in udbg_scc_init() During the iteration of for_each_child_of_node(), we need to call of_node_put() for the old references stored in to 'ch_def' and 'ch_a' as their refcounters have been increased in last iteration. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220716074344.540049-1-windhl@126.com commit 11373c933db20f8b6fd2cad27712e683ac9785f0 Author: Liang He Date: Sat Jul 16 15:31:11 2022 +0800 powerpc/powermac/pfunc_base: Add missing of_node_put() in macio_gpio_init_one() Call of_node_put() for the reference 'gparent' escaped out of the previous for_each_child_of_node() as it has increased the refcount. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220716073111.539739-1-windhl@126.com commit b3d6637bcc5d17caec56a76f6e430dcf444ef80e Author: Liang He Date: Sat Jul 16 15:07:58 2022 +0800 powerpc/powermac/low_i2c: Add missing of_node_put() in kw_i2c_probe() Call of_node_put() for the reference 'parent' returned by of_get_parent() which has increased the refcount. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220716070758.539434-1-windhl@126.com commit d36337ce950ce8c57a8e4f61593f923cceaf0dd7 Author: Liang He Date: Sat Jul 16 14:54:12 2022 +0800 powerpc/powermac/feature: Add missing of_node_put() In probe_one_macio(), call of_node_put() for the refernece 'node' escaped out of the for_each_node_by_name() which has increased its refcount. While the 'node' will finally escaped into a global reference, we should still call of_node_put() in fail path which will stop global reference creation. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220716065412.539153-1-windhl@126.com commit ce63c44b63cdae892107717ba10fdb6fb4fc6cdb Author: Liang He Date: Sat Jul 2 10:29:36 2022 +0800 powerpc/pci-common: Fix refcount bug for 'phb->dn' In pcibios_alloc_controller(), 'phb' is allocated and escaped into global 'hose_list'. So we should call of_node_get() when a new reference created into 'phb->dn'. And when phb is freed, we should call of_node_put() on it. NOTE: This function is called in the iteration of for_each_xx in chrp_find_bridges() and pSeries_discover_phbs(). If there is no of_node_get(), the object may be prematurely freed. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220702022936.266146-1-windhl@126.com commit 605c27f3802038e4623b6fd1bbfa021e1f65b5c4 Author: Liang He Date: Mon Jun 20 21:25:53 2022 +0800 powerpc/powernv: Add missing of_node_put()s In these driver init functions, there are two kinds of errors: (1) missing of_put_node() for of_find_compatible_node()'s returned pointer (refcount incremented) in fail path or when it is not used anymore. (2) missing of_put_node() for 'for_each_xxx' loop's break Signed-off-by: Liang He [mpe: Use out_put_xxx goto label naming] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220620132553.4073863-1-windhl@126.com commit afa6a472a3d2a8dd477b285eeb67b3593546647b Author: Liang He Date: Wed Jul 20 20:45:57 2022 +0800 powerpc/fsl_pci: Remove of_node_put() when reference escaped out In fsl_pci_assign_primary(), we should remove the of_node_put() when breaking out of the for_each_matching_node() as the 'np' is escaped out by global 'fsl_pci_primary'. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220720124557.1256243-1-windhl@126.com commit a8b89c10e6052027061a447ff7436642310c8f20 Author: Liang He Date: Fri Jul 1 22:01:19 2022 +0800 powerpc/85xx: Add missing of_node_get/put() in ge_imp3a_pci_assign_primary() for_each_node_by_type() will automatically increase and decrease the refcount during the iteration. However, there is a reference escaped into global 'fsl_pci_primary' and we need to handle it. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220701140119.245435-1-windhl@126.com commit 9d86f0919544d8e422be2a1d562de1dbbbb6052d Author: Liang He Date: Fri Jul 1 21:31:26 2022 +0800 powerpc/44x: Add of_node_put() when break out from for_each In ppc47x_init_irq(), we need to call of_node_put() when there is a break during the iteration of for_each_node_with_property() which will automatically increase and decrease the refcount. Signed-off-by: Liang He [mpe: mpic_alloc() takes its own reference] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220701133126.243102-1-windhl@126.com commit 110a1fcb6c4d55144d8179983a475f17a1d6f832 Author: Liang He Date: Fri Jul 1 21:17:50 2022 +0800 powerpc/pci_dn: Add missing of_node_put() In pci_add_device_node_info(), use of_node_put() to drop the reference to 'parent' returned by of_get_parent() to keep refcount balance. Fixes: cca87d303c85 ("powerpc/pci: Refactor pci_dn") Co-authored-by: Miaoqian Lin Signed-off-by: Liang He Signed-off-by: Michael Ellerman Reviewed-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20220701131750.240170-1-windhl@126.com commit 6ec4836fa15a0ff02e3a382ad6b1920c728a8c95 Author: Liang He Date: Tue Jun 21 19:17:01 2022 +0800 powerpc/pseries: Add missing of_node_put()s in hotplug-cpu.c In pseries_cpuhp_cache_use_count() and pseries_cpuhp_detach_nodes(), we need carefully hold the reference returned by of_find_next_cache_node() and use it to call of_node_put() to keep refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220621111701.4082889-1-windhl@126.com commit d208d8c2cde513b94ae3b8b97663656079004555 Author: Liang He Date: Wed Jun 22 14:16:52 2022 +0800 macintosh: Add missing of_node_get() in do_attach() We need a of_node_get() for of_find_compatible_node() to keep refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220622061652.4095330-1-windhl@126.com commit 24156df00dbbc673d9b2d31a336c3aba537d2c60 Author: Liang He Date: Tue Jun 21 16:09:32 2022 +0800 powerpc/83xx: Add missing of_node_put() in mpc832x_spi_init() In mpc832x_spi_init(), hold the reference returned by of_find_compatible_node() and use it to call of_node_put() for refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220621080932.4081935-1-windhl@126.com commit cc0dd82c18559184e009bef8d0353d008013a813 Author: Liang He Date: Tue Jun 21 16:03:49 2022 +0800 powerpc/512x: Add missing of_node_put() in clock-commonclk.c In mpc5121_clk_provide_migration_support(), hold the reference returned by of_find_compatible_node() and use it to call of_node_put() for refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220621080349.4081689-1-windhl@126.com commit a3a4c10aef88a80ba1b230a7bf63ea381cc5116e Author: Liang He Date: Mon Jun 20 23:05:18 2022 +0800 powerpc/powermac: Add missing of_node_put() in smp_core99_setup() In smp_core99_setup(), add of_node_put() to drop the reference once it's no longer needed. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220620150518.4074910-1-windhl@126.com commit def435c04ee984a5f9ed2711b2bfe946936c6a21 Author: Liang He Date: Mon Jul 4 22:52:33 2022 +0800 powerpc/sysdev/fsl_msi: Add missing of_node_put() In fsl_setup_msi_irqs(), use of_node_put() to drop the reference returned by of_parse_phandle(). Fixes: 895d603f945ba ("powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes") Co-authored-by: Miaoqian Lin Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220704145233.278539-1-windhl@126.com commit 3d31adc47edb6d0cef122a41fba1b639db5d1c37 Author: Liang He Date: Mon Jun 20 21:02:21 2022 +0800 powerpc/sysdev: Add missing of_node_put()s Add of_node_put() in various paths to drop references once they are no longer needed. Signed-off-by: Liang He [mpe: Rewrite change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220620130221.4073228-1-windhl@126.com commit cd772e659da0ad67f19f022f65449e14ebcf1284 Author: Liang He Date: Mon Jun 20 14:59:04 2022 +0800 powerpc/embedded6xx/ls_uart: Add missing of_node_put() In ls_uarts_init(), add an of_node_put() to keep refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220620065904.4071787-1-windhl@126.com commit 1c754b49c002a965004b6a96d158f7ce554eb977 Author: Liang He Date: Sun Jun 19 15:40:16 2022 +0800 powerpc/pseries: Add missing of_node_put() in ibmebus In ibmebus_match_path(), use of_node_put() to drop the reference returned by of_find_node_by_path() before testing for equality of the pointers. Signed-off-by: Liang He [mpe: Rewrite change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220619074016.4068105-1-windhl@126.com commit f4f8320b01677b467c768c43c1e1d10383a0e30d Author: Liang He Date: Fri Jul 1 22:49:49 2022 +0800 powerpc/cell: Add missing of_node_put() in iommu.c In cell_iommu_init_disabled(), hold the reference returned by of_find_node_by_name() and use it to call of_node_put() for reference balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220701144949.252364-2-windhl@126.com commit ad4b323693abd221798a6479105d22c79605aa0f Author: Liang He Date: Fri Jul 1 22:49:48 2022 +0800 powerpc/cell: Add missing of_node_put()s in cbe_regs.c There are several bugs as following: (1) In cbe_get_be_node(), hold the reference returned by of_find_xxx and of_get_xxx OF APIs and use it to call of_node_put(). (2) In cbe_fill_regs_map(), same as above. (3) In cbe_regs_init(), during the iteration of for_each_node_by_type(), the refcount of 'cpu' will be automatically increased and decreased. However, there is a reference escaped out into 'map->cpu_node' and it should be properly handled. Signed-off-by: Liang He [mpe: Drop references before pointer equality test in cbe_get_be_node()] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220701144949.252364-1-windhl@126.com commit d9e1c6104d87d4027133b28f5ccab8f999830acd Author: Liang He Date: Sun Jun 19 15:23:35 2022 +0800 powerpc/cell: Add missing of_node_put()s Use of_node_put() for of_find_node_by_path() and of_find_node_by_phandle() to keep refcount balance. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220619072335.4067728-1-windhl@126.com commit d1aabbbb2564f23b66ded10d870e7859e92075a3 Author: Liang He Date: Sun Jun 19 15:08:11 2022 +0800 powerpc/kernel: Add missing of_node_put() in legacy_serial.c In find_legacy_serial_ports(), of_find_node_by_path() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220619070811.4067215-1-windhl@126.com commit 0dd8d2c8066e672244975c171816fdd9dae87721 Author: Liang He Date: Sat Jun 18 15:13:53 2022 +0800 powerpc/perf: Add missing of_node_put()s in imc-pmu.c In update_events_in_group(), of_find_node_by_phandle() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() in the failure path or when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Reviewed-by: Athira Rajeev Link: https://lore.kernel.org/r/20220618071353.4059000-1-windhl@126.com commit 6b2d17d514b105ecf486bdf011c444978e633085 Author: Liang He Date: Sat Jun 18 12:10:42 2022 +0800 powerpc/embedded6xx: Add missing of_node_put()s Add missing of_node_put()s in various paths. Signed-off-by: Liang He [mpe: Rewrite change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220618041042.4058066-1-windhl@126.com commit edc17890ae8ee475b566079bea2e9ba83fec021d Author: Liang He Date: Sat Jun 18 10:49:30 2022 +0800 powerpc/8xx: Add missing of_node_put() in tqm8xx_setup.c In init_ioports(), of_find_node_by_name() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220618024930.4056825-1-windhl@126.com commit 23b1481898ee8704394cead67eae2634003f7ca8 Author: Liang He Date: Fri Jun 17 20:40:45 2022 +0800 powerpc/maple: Add missing of_node_put() in time.c In maple_get_boot_time(), of_find_compatible_node() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220617124045.4048757-1-windhl@126.com commit 14b9e26c6c9a845c005087b9653459623a7d029b Author: Liang He Date: Fri Jun 17 18:50:11 2022 +0800 powerpc/85xx: Add missing of_node_put() in sgy_cst1000 In gpio_halt_probe(), of_find_matching_node() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() in the failure path. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220617105011.4041123-1-windhl@126.com commit 593d7b89c6a2bf7aea2324c94f10ef3c21308418 Author: Liang He Date: Thu Jun 16 22:40:07 2022 +0800 powerpc/52xx: Add missing of_node_put() in media5200.c In media5200_init_irq(), of_find_compatible_node() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() in the failure path or when it is not used anymore. Don't worry about 'fpga_np == NULL' as of_node_put() can correctly handle that. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220616144007.3987743-1-windhl@126.com commit 64e696af167f612cd1ecba89edfeb2353ca59947 Author: Liang He Date: Thu Jun 16 21:29:22 2022 +0800 powerpc/85xx: Add missing of_node_put() in ksi8560.c In ksi8560_setup_arch(), of_find_compatible_node() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220616132922.3987053-1-windhl@126.com commit 06f48f5cb5df2299f5e4b42e9dda1858bf172bcb Author: Liang He Date: Wed Jun 15 22:37:03 2022 +0800 powerpc/512x: Add missing of_node_put() in mpc5121_clk_init() In mpc5121_clk_init(), of_find_compatible_node() will return a node pointer with refcount incremented. The reference should be dropped with of_node_put() when it is not used anymore. Signed-off-by: Liang He [mpe: of_clk_add_provider() will take its own reference.] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220615143703.3968898-1-windhl@126.com commit 1d53c0192b15f42129a3dbbbfa05637bcf781a3e Author: Christophe Leroy Date: Fri Sep 2 17:25:24 2022 +0200 powerpc/vdso: link with -z noexecstack With recent binutils, the following warning appears: VDSO32L arch/powerpc/kernel/vdso/vdso32.so.dbg /opt/gcc-12.2.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/12.2.0/../../../../powerpc64-linux/bin/ld: warning: arch/powerpc/kernel/vdso/getcpu-32.o: missing .note.GNU-stack section implies executable stack /opt/gcc-12.2.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/12.2.0/../../../../powerpc64-linux/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker To avoid that, explicitly tell the linker we don't want executable stack. For more explanations, see commit ffcf9c5700e4 ("x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b95f2e3216a574837dd61208444e9515c3423da4.1662132312.git.christophe.leroy@csgroup.eu commit 7245fc5bb7a966852d5bd7779d1f5855530b461a Author: Christophe Leroy Date: Fri Sep 2 18:00:09 2022 +0200 powerpc/math-emu: Remove -w build flag and fix warnings As reported by Nathan, the module_init() macro was not taken into account because the header was missing. That means spe_mathemu_init() was never called. This should have been detected by gcc at build time, but due to '-w' flag it went undetected. Removing that flag leads to many warnings hence errors. Fix those warnings then remove the -w flag. Reported-by: Nathan Chancellor Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/2663961738a46073713786d4efeb53100ca156e7.1662134272.git.christophe.leroy@csgroup.eu commit cfe0d370e0788625ce0df3239aad07a2506c1796 Author: Nathan Chancellor Date: Fri Sep 2 18:00:08 2022 +0200 powerpc/math_emu/efp: Include module.h When building with a recent version of clang, there are a couple of errors around the call to module_init(): arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] module_init(spe_mathemu_init); ^ int arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition module_init(spe_mathemu_init); ^ 2 errors generated. module_init() is a macro, which is not getting expanded because module.h is not included in this file. Add the include so that the macro can expand properly, clearing up the build failure. Fixes: ac6f120369ff ("powerpc/85xx: Workaroudn e500 CPU erratum A005") [chleroy: added fixes tag] Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/8403854a4c187459b2f4da3537f51227b70b9223.1662134272.git.christophe.leroy@csgroup.eu commit 5b3a87a5c4f20da682d50dbaf8c4aa357cfd0d2d Author: Christian Hewitt Date: Thu Jul 7 09:39:54 2022 +0000 arm64: dts: meson: add support for Beelink GT1 Ultimate The Beelink GT1 Ultimate is based on the Amlogic S912 (Q200) reference design with the following specifications: - 3GB DDR3 RAM - 32GB eMMC - HDMI 2.1 video - S/PDIF optical output - 10/100/1000 Ethernet - AP6356S Wireless (802.11 a/b/g/n, BT 4.2) - 3x USB 2.0 ports - IR receiver - 1x micro SD card slot - 1x Power LED (white) - 1x Reset button (internal) Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220707093954.21716-2-christianshewitt@gmail.com commit 70bff3a65d4b974434b7f576f52a269fa4f0dd04 Author: Christian Hewitt Date: Thu Jul 7 09:39:53 2022 +0000 dt-bindings: arm: amlogic: add Beelink GT1 Ultimate binding Add the board binding for the Shenzen AZW (Beelink) GT1 Ultimate Android Set-Top Box device. Signed-off-by: Christian Hewitt Acked-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220707093954.21716-1-christianshewitt@gmail.com commit 9491cff16a4996aee578adf9f41acfb1bc483df9 Author: Liang He Date: Tue Jul 26 15:38:41 2022 +0800 soc: amlogic: meson-pwrc: Hold reference returned by of_get_parent() We should hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Signed-off-by: Liang He Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220726073841.1320509-1-windhl@126.com commit 84dd3b2b95ef8a33a0c2d7c2c21d4d5edb9f7f08 Author: Jean Delvare Date: Wed Aug 3 22:34:48 2022 +0200 dmaengine: dw-axi-dmac: Drop obsolete dependency on COMPILE_TEST Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare Cc: Eugeniy Paltsev Cc: Vinod Koul Link: https://lore.kernel.org/r/20220803223448.6f08095b@endymion.delvare Signed-off-by: Vinod Koul commit 64787536ccfc072dca9b2c7c06c84dcc3f139b10 Author: Tudor Ambarus Date: Tue Aug 2 17:06:30 2022 +0300 dmaengine: at_xdmac: Replace two if statements with only one with two conditions Add a cosmetic change and replace two if statements with a single if statement with two conditions. In case the optional txstate parameter is NULL, we return the dma_cookie_status, which is fine, no functional change required. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20220802140630.243550-1-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit c0c269becf1f5b649b66a7f3eb60ff7e9aa8976d Author: Harini Katakam Date: Tue Aug 2 15:52:32 2022 +0530 dmaengine: pl330: Remove unused flags txd.flags is unused and need not be updated. Signed-off-by: Harini Katakam Link: https://lore.kernel.org/r/20220802102232.17653-1-harini.katakam@amd.com Signed-off-by: Vinod Koul commit 8c79fd35e1e793361ed30eaa79b3c5752e6c69fb Author: Christophe JAILLET Date: Sat Jul 30 22:07:45 2022 +0200 dmaengine: stm32-dmamux: Simplify code and save a few bytes of memory STM32_DMAMUX_MAX_DMA_REQUESTS is small (i.e. 32) and when the 'dma_inuse' bitmap is allocated, there is already a check that 'dma_req' is <= this limit. So, there is no good reason to dynamically allocate this bitmap. This just waste some memory and some cycles. Use DECLARE_BITMAP with the maximum bitmap size instead. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/2d8c24359b2daa32ce0597a2949b7b2bebaf23de.1659211633.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit e1c9832b0964327399d43dc481a8c85285b23ad5 Author: Jason Wang Date: Thu Aug 11 20:09:59 2022 +0800 dmaengine: stm32-dmamux: Fix comment typo The double `end' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220811120959.18752-1-wangborong@cdjrlc.com Signed-off-by: Vinod Koul commit 7d81afd2690400f8fb7d9bec0532624562634766 Author: ye xingchen Date: Wed Aug 10 06:25:32 2022 +0000 dmaengine: sf-pdma:Remove the print function dev_err() >From the coccinelle check: ./drivers/dma/sf-pdma/sf-pdma.c Error:line 409 is redundant because platform_get_irq() already prints an error ./drivers/dma/sf-pdma/sf-pdma.c Error:line 424 is redundant because platform_get_irq() already prints an error So,remove the unnecessary print function dev_err() Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220810062532.13425-1-ye.xingchen@zte.com.cn Signed-off-by: Vinod Koul commit 7c94dcfa8fcff2dba53915f1dabfee49a3df8b88 Author: Vaishnav Achath Date: Tue Aug 2 11:18:35 2022 +0530 dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow UDMA_CHAN_RT_*BCNT_REG stores the real-time channel bytecount statistics. These registers are 32-bit hardware counters and the driver uses these counters to monitor the operational progress status for a channel, when transferring more than 4GB of data it was observed that these counters overflow and completion calculation of a operation gets affected and the transfer hangs indefinitely. This commit adds changes to decrease the byte count for every complete transaction so that these registers never overflow and the proper byte count statistics is maintained for ongoing transaction by the RT counters. Earlier uc->bcnt used to maintain a count of the completed bytes at driver side, since the RT counters maintain the statistics of current transaction now, the maintenance of uc->bcnt is not necessary. Signed-off-by: Vaishnav Achath Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220802054835.19482-1-vaishnav.a@ti.com Signed-off-by: Vinod Koul commit a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21 Merge: 4e55e22d3d9aa 7e18e42e4b280 Author: Greg Kroah-Hartman Date: Mon Sep 5 08:03:23 2022 +0200 Merge 6.0-rc4 into usb-next We need the USB fixes in here and this resolves the merge issue in: drivers/usb/dwc3/gadget.c Reported-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman commit d0f1e0c2a6990922818d6616a48d3d92bb7ddac1 Author: Mika Westerberg Date: Tue Feb 22 19:31:47 2022 +0200 thunderbolt: Add support for receiver lane margining USB4 spec defines standard set of registers to be used for receiver lane margining. This is useful for I/O interface quality and electrical robustness validation during manufacturing. Expose receiver lane margining through new debugfs directory "margining" that is added under each connected USB4 port. Users can then run the margining by writing to the exposed attributes under that directory. Signed-off-by: Mika Westerberg commit b12d2955e732866dd8c73154992332a01e7224ed Author: Mika Westerberg Date: Mon Aug 15 19:59:43 2022 +0300 thunderbolt: Add helper to check if CL states are enabled on port We will need this when enabling lane margining support. Signed-off-by: Mika Westerberg commit 3846d011403b57190b6b3e917cc8b3ab810fa293 Author: Mika Westerberg Date: Tue Aug 30 12:12:40 2022 +0300 thunderbolt: Pass CL state bitmask to tb_port_clx_supported() Instead of testing just a single CL state we can pass a bitmask of states to check. This makes it simpler for callers of the function. We also add a check for CL2 even though not fully supported by the driver yet. Suggested-by: Lukas Wunner Signed-off-by: Mika Westerberg commit 95f8f1cbc87bfd361286d8e0129108d2112e653e Author: Mika Westerberg Date: Mon Aug 15 19:55:42 2022 +0300 thunderbolt: Move port CL state functions into correct place in switch.c They should be close to other functions dealing with USB4 ports. No functional impact. Signed-off-by: Mika Westerberg commit 7f333ace0257840c0597cdf7b63789584ca95d1c Author: Mika Westerberg Date: Tue Feb 22 19:29:43 2022 +0200 thunderbolt: Move tb_xdomain_parent() to tb.h We are going to need this for lane margining support so make it available outside of xdomain.c. Signed-off-by: Mika Westerberg commit 35f2e3c267f07a42bc1bf08081e963b3a33e6d7c Merge: e4cdd25cafac3 7e18e42e4b280 Author: Greg Kroah-Hartman Date: Mon Sep 5 07:59:28 2022 +0200 Merge 6.0-rc4 into tty-next We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 28a2a54901f66a45ab339e944fdfc69667e639c1 Merge: 7bd581f3c2635 7e18e42e4b280 Author: Greg Kroah-Hartman Date: Mon Sep 5 07:57:37 2022 +0200 Merge 6.0-rc4 into staging-next Resolves the merge issue with: drivers/staging/r8188eu/os_dep/os_intfs.c Signed-off-by: Greg Kroah-Hartman commit 50e177c5bfd9abc3828cb57e14e6169170f6764a Merge: 4ec7ac90ff399 7e18e42e4b280 Author: Greg Kroah-Hartman Date: Mon Sep 5 07:53:56 2022 +0200 Merge 6.0-rc4 into char-misc-next We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 6ba5aa541aaa079c0ca888f7fe564b2035d5ca0a Author: Nicholas Piggin Date: Fri Sep 2 18:53:16 2022 +1000 powerpc/pseries: Move dtl scanning and steal time accounting to pseries platform dtl is the PAPR Dispatch Trace Log, which is entirely a pseries feature. The pseries platform alrady has a file dealing with the dtl, so move scanning for stolen time accounting there from kernel/time.c. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220902085316.2071519-5-npiggin@gmail.com commit 02382aff72357727f9eee5107fd32c6cd070f1d6 Author: Nicholas Piggin Date: Fri Sep 2 18:53:15 2022 +1000 powerpc/64: Remove PPC64 special case for cputime accounting default Distro kernels tend to be moving to VIRT_CPU_ACCOUNTING_GEN, and there is not much reason why PPC64 should be special here. Remove the special case and make the ppc64 and pseries defconfigs use GEN accounting (others will use TICK, as-per Kconfig defaults). VIRT_CPU_ACCOUNTING_NATIVE does provide scaled vtime and stolen time apportioned between system and user time, and vtime accounting is not unconditionally enabled, and possibly other things. But it would be better at this point to extend GEN to cover important missing features rather than directing users back to a less used option. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220902085316.2071519-4-npiggin@gmail.com commit 0e8a63132800dd8ae5fcb19113f79bea43ea18d9 Author: Nicholas Piggin Date: Fri Sep 2 18:53:14 2022 +1000 powerpc/pseries: Implement CONFIG_PARAVIRT_TIME_ACCOUNTING CONFIG_VIRT_CPU_ACCOUNTING_GEN under pseries does not provide stolen time accounting unless CONFIG_PARAVIRT_TIME_ACCOUNTING is enabled. Implement this using the VPA accumulated wait counters. Note this will not work on current KVM hosts because KVM does not implement the VPA dispatch counters (yet). It could be implemented with the dispatch trace log as it is for VIRT_CPU_ACCOUNTING_NATIVE, but that is not necessary for the more limited accounting provided by PARAVIRT_TIME_ACCOUNTING, and it is more expensive, complex, and has downsides like potential log wrap. From Shrikanth: [...] it was tested on Power10 [PowerVM] Shared LPAR. system has two LPAR. we will call first one LPAR1 and second one as LPAR2. Test was carried out in SMT=1. Similar observation was seen in SMT=8 as well. LPAR config header from each LPAR is below. LPAR1 is twice as big as LPAR2. Since Both are sharing the same underlying hardware, work stealing will happen when both the LPAR's are contending for the same resource. LPAR1: type=Shared mode=Uncapped smt=Off lcpu=40 cpus=40 ent=20.00 LPAR2: type=Shared mode=Uncapped smt=Off lcpu=20 cpus=40 ent=10.00 mpstat was used to check for the utilization. stress-ng has been used as the workload. Few cases are tested. when the both LPAR are idle there is no steal time. when LPAR1 starts running at 100% which consumes all of the physical resource, steal time starts to get accounted. With LPAR1 running at 100% and LPAR2 starts running, steal time starts increasing. This is as expected. When the LPAR2 Load is increased further, steal time increases further. Case 1: 0% LPAR1; 0% LPAR2 %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 0.00 0.00 0.05 0.00 0.00 0.00 0.00 0.00 0.00 99.95 Case 2: 100% LPAR1; 0% LPAR2 %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 97.68 0.00 0.00 0.00 0.00 0.00 2.32 0.00 0.00 0.00 Case 3: 100% LPAR1; 50% LPAR2 %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 86.34 0.00 0.10 0.00 0.00 0.03 13.54 0.00 0.00 0.00 Case 4: 100% LPAR1; 100% LPAR2 %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 78.54 0.00 0.07 0.00 0.00 0.02 21.36 0.00 0.00 0.00 Case 5: 50% LPAR1; 100% LPAR2 %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 49.37 0.00 0.00 0.00 0.00 0.00 1.17 0.00 0.00 49.47 Patch is accounting for the steal time and basic tests are holding good. Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde [mpe: Add SPDX tag to new paravirt_api_clock.h] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220902085316.2071519-3-npiggin@gmail.com commit 179141ca7c71184f6b96787c9a08018ca8a6ea63 Author: Oleksij Rempel Date: Tue Aug 30 13:21:21 2022 +0200 ARM: dts: imx6: skov: migrate to resistive-adc-touch Start to use more generic resistive-adc-touch node. ti,tsc2046 is an ADC controller used for resistive touchscreen. So, define it as ADC and attach resistive-adc-touch to it. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit fd2dd7077c7498765e7326c1b7f34bde85f1a975 Author: Marcel Ziswiler Date: Fri Aug 26 21:22:49 2022 +0200 ARM: dts: imx6sx-udoo-neo: don't use multiple blank lines This fixes the following warning: arch/arm/boot/dts/imx6sx-udoo-neo.dtsi:309: check: Please don't use multiple blank lines While at it, use tabs indent for some pinctrl entries. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 218db824a7519856d0eaaeb5c41ca504ed550210 Author: Marcel Ziswiler Date: Fri Aug 26 21:22:48 2022 +0200 ARM: dts: imx6sl: use tabs for code indent This fixes the following error: arch/arm/boot/dts/imx6sl.dtsi:714: error: code indent should use tabs where possible Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 415432c008b2bce8138841356ba444631cabaa50 Author: Alexander Stein Date: Fri Aug 26 07:53:36 2022 +0200 ARM: dts: imx6sx: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 7492a83ed9b7a151e2dd11d64b06da7a7f0fa7f9 Author: Alexander Stein Date: Fri Aug 26 07:53:35 2022 +0200 ARM: dts: imx6sll: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 60c9213a1d9941a8b33db570796c3f9be8984974 Author: Alexander Stein Date: Fri Aug 26 07:53:34 2022 +0200 ARM: dts: imx6sl: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 088fe5237435ee2f7ed4450519b2ef58b94c832f Author: Alexander Stein Date: Fri Aug 26 07:53:33 2022 +0200 ARM: dts: imx6qp: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@940000: '#address-cells' is a required property sram@940000: '#size-cells' is a required property sram@940000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit f5848b95633d598bacf0500e0108dc5961af88c0 Author: Alexander Stein Date: Fri Aug 26 07:53:32 2022 +0200 ARM: dts: imx6dl: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit b11d083c5dcec7c42fe982c854706d404ddd3a5f Author: Alexander Stein Date: Fri Aug 26 07:53:31 2022 +0200 ARM: dts: imx6q: add missing properties for sram All 3 properties are required by sram.yaml. Fixes the dtbs_check warning: sram@900000: '#address-cells' is a required property sram@900000: '#size-cells' is a required property sram@900000: 'ranges' is a required property Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit a8c52eba880a6e8c07fc2130604f8e386b90b763 Author: Waiman Long Date: Thu Sep 1 16:57:45 2022 -0400 kselftest/cgroup: Add cpuset v2 partition root state test Add a test script test_cpuset_prs.sh with a helper program wait_inotify for exercising the cpuset v2 partition root state code. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 8cbfdc24fc55a6f9fb1a1f9ed0d33614d7ae7ce0 Author: Waiman Long Date: Thu Sep 1 16:57:44 2022 -0400 cgroup/cpuset: Update description of cpuset.cpus.partition in cgroup-v2.rst Update Documentation/admin-guide/cgroup-v2.rst on the newly introduced "isolated" cpuset partition type as well as other changes made in other cpuset patches. Signed-off-by: Waiman Long Reported-by: kernel test robot Signed-off-by: Tejun Heo commit d7c8142d5a5534c3c7de214e35a40a493a32b98e Author: Waiman Long Date: Thu Sep 1 16:57:43 2022 -0400 cgroup/cpuset: Make partition invalid if cpumask change violates exclusivity rule Currently, changes in "cpust.cpus" of a partition root is not allowed if it violates the sibling cpu exclusivity rule when the check is done in the validate_change() function. That is inconsistent with the other cpuset changes that are always allowed but may make a partition invalid. Update the cpuset code to allow cpumask change even if it violates the sibling cpu exclusivity rule, but invalidate the partition instead just like the other changes. However, other sibling partitions with conflicting cpumask will also be invalidated in order to not violating the exclusivity rule. This behavior is specific to this partition rule violation. Note that a previous commit has made sibling cpu exclusivity rule check the last check of validate_change(). So if -EINVAL is returned, we can be sure that sibling cpu exclusivity rule violation is the only rule that is broken. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 74027a6535fdabef69c57234359d9fbdb4597398 Author: Waiman Long Date: Thu Sep 1 16:57:42 2022 -0400 cgroup/cpuset: Relocate a code block in validate_change() This patch moves down the exclusive cpu and memory check in validate_change(). There is no functional change. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 7476a636d3100120330145d6dc408cd279a31039 Author: Waiman Long Date: Thu Sep 1 16:57:41 2022 -0400 cgroup/cpuset: Show invalid partition reason string There are a number of different reasons which can cause a partition to become invalid. A user seeing an invalid partition may not know exactly why. To help user to get a better understanding of the underlying reason, The cpuset.cpus.partition control file, when read, will now report the reason why a partition become invalid. When a partition does become invalid, reading the control file will show "root invalid ()" where is a string that describes why the partition is invalid. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit f28e22441f353aa2c954a1b1e29144f8841f1e8a Author: Waiman Long Date: Thu Sep 1 16:57:40 2022 -0400 cgroup/cpuset: Add a new isolated cpus.partition type Cpuset v1 uses the sched_load_balance control file to determine if load balancing should be enabled. Cpuset v2 gets rid of sched_load_balance as its use may require disabling load balancing at cgroup root. For workloads that require very low latency like DPDK, the latency jitters caused by periodic load balancing may exceed the desired latency limit. When cpuset v2 is in use, the only way to avoid this latency cost is to use the "isolcpus=" kernel boot option to isolate a set of CPUs. After the kernel boot, however, there is no way to add or remove CPUs from this isolated set. For workloads that are more dynamic in nature, that means users have to provision enough CPUs for the worst case situation resulting in excess idle CPUs. To address this issue for cpuset v2, a new cpuset.cpus.partition type "isolated" is added which allows the creation of a cpuset partition without load balancing. This will allow system administrators to dynamically adjust the size of isolated partition to the current need of the workload without rebooting the system. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit f0af1bfc27b52a4d42510051154c61bd176a8f06 Author: Waiman Long Date: Thu Sep 1 16:57:39 2022 -0400 cgroup/cpuset: Relax constraints to partition & cpus changes Currently, enabling a partition root is only allowed if all the constraints of a valid partition are satisfied. Even changes to "cpuset.cpus" may not be allowed in some cases. Moreover, there are limits to changes made to a parent cpuset if it is a valid partition root. This is contrary to the general cgroup v2 philosophy. This patch relaxes the constraints of changing the state of "cpuset.cpus" and "cpuset.cpus.partition". Now all valid changes ("member" or "root") to "cpuset.cpus.partition" are allowed even if there are child cpusets underneath it. Trying to make a cpuset a partition root, however, will cause its state to become invalid if the following constraints of a valid partition root are not satisfied. 1) The "cpuset.cpus" is non-empty and exclusive. 2) The parent cpuset is a valid partition root. 3) The "cpuset.cpus" overlaps parent's "cpuset.cpus". Similarly, almost all changes to "cpuset.cpus" are allowed with the exception that if the underlying CS_CPU_EXCLUSIVE flag is set, the exclusivity rule will still apply. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit e2d59900d936e1c0fe091216c342cc95c4b32e97 Author: Waiman Long Date: Thu Sep 1 16:57:38 2022 -0400 cgroup/cpuset: Allow no-task partition to have empty cpuset.cpus.effective Currently, a partition root cannot have empty "cpuset.cpus.effective". As a result, a parent partition root cannot distribute out all its CPUs to child partitions with no CPUs left. However in most cases, there shouldn't be any tasks associated with intermediate nodes of the default hierarchy. So the current rule is too restrictive and can waste valuable CPU resource. To address this issue, we are now allowing a partition to have empty "cpuset.cpus.effective" as long as it has no task. Since cpuset is threaded, no-internal-process rule does not apply. So it is possible to have tasks in a partition root with child sub-partitions even though that should be uncommon. A parent partition with no task can now have all its CPUs distributed out to its child partitions. The top cpuset always have some house-keeping tasks running and so its list of effective cpu can't be empty. Once a partition with empty "cpuset.cpus.effective" is formed, no new task can be moved into it until "cpuset.cpus.effective" becomes non-empty. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 18065ebe9b3359b163324f3fb36f7edeb73503e2 Author: Waiman Long Date: Thu Sep 1 16:57:37 2022 -0400 cgroup/cpuset: Miscellaneous cleanups & add helper functions The partition root state (PRS) macro names do not currently match the external names. Change them to match the external names and add helper functions to read or change the state. Shorten the cpuset argument of update_parent_subparts_cpumask() to cs to match other cpuset functions. Remove the new_prs argument from notify_partition_change() as the cs->partition_root_state has already been set to new_prs before it is called. There is no functional change. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit ec5fbdfb99d18482619ac42605cb80fbb56068ee Author: Waiman Long Date: Thu Sep 1 16:57:36 2022 -0400 cgroup/cpuset: Enable update_tasks_cpumask() on top_cpuset Previously, update_tasks_cpumask() is not supposed to be called with top cpuset. With cpuset partition that takes CPUs away from the top cpuset, adjusting the cpus_mask of the tasks in the top cpuset is necessary. Percpu kthreads, however, are ignored. Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 2d8f7a3b9fb31d2566b24fd94d5a533f9322c53c Author: Yu Kuai Date: Sat Sep 3 14:28:26 2022 +0800 blk-throttle: clean up codes that can't be reached While doing code coverage testing while CONFIG_BLK_DEV_THROTTLING_LOW is disabled, we found that there are many codes can never be reached. This patch move such codes inside "#ifdef CONFIG_BLK_DEV_THROTTLING_LOW". Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220903062826.1099085-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 5134272f9f3f71d4e1f3aa15cb09321af49b3646 Author: Qingtao Cao Date: Fri Sep 2 16:14:34 2022 +1000 gpio: exar: access MPIO registers on cascaded chips When EXAR xr17v35x chips are cascaded in order to access the MPIO registers (part of the Device Configuration Registers) of the secondary chips, an offset needs to be applied based on the number of primary chip's UART channels. Signed-off-by: Qingtao Cao Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 0eadd36d9123745f70e233a9d93951d05ca1916a Author: Dmitry Torokhov Date: Sat Sep 3 23:18:47 2022 -0700 gpiolib: make fwnode_get_named_gpiod() static There are no external users of fwnode_get_named_gpiod() anymore, so let's stop exporting it and mark it as static. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 5251c6c436edf81e5f27de31ca34bcdc12fc94e1 Author: Josh Don Date: Wed Aug 31 15:49:03 2022 -0700 cgroup: add pids.peak interface for pids controller pids.peak tracks the high watermark of usage for number of pids. This helps give a better baseline on which to set pids.max. Polling pids.current isn't really feasible, since it would potentially miss short-lived spikes. This interface is analogous to memory.peak. Signed-off-by: Josh Don Signed-off-by: Tejun Heo commit dc79ec1b232ad2c165d381d3dd2626df4ef9b5a4 Author: Tejun Heo Date: Sun Sep 4 09:16:19 2022 -1000 cgroup: Remove data-race around cgrp_dfl_visible There's a seemingly harmless data-race around cgrp_dfl_visible detected by kernel concurrency sanitizer. Let's remove it by throwing WRITE/READ_ONCE at it. Signed-off-by: Tejun Heo Reported-by: Abhishek Shah Cc: Gabriel Ryan Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/netdev/20220819072256.fn7ctciefy4fc4cu@wittgenstein/ commit 493c1141f791a0a8af5d1745bdf9f159f564ca3f Author: AngeloGioacchino Del Regno Date: Fri Jul 29 12:44:33 2022 +0200 dt-bindings: dma: mediatek,uart-dma: Add binding for MT6795 SoC Add mediatek,mt6795-uart-dma to the compatibles list to support the MT6795 Helio X10 SoC's UART APDMA. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220729104441.39177-2-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul commit 9c06002682ae0cdd01caf011899224acbc6582b2 Author: Andy Shevchenko Date: Wed Jul 13 20:22:35 2022 +0300 dmaengine: hsu: Include headers we are direct user of For the sake of integrity, include headers we are direct user of. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220713172235.22611-4-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 2c40c787d4cac0fab33ac2ee879ae2305c2d8ded Author: Andy Shevchenko Date: Wed Jul 13 20:22:34 2022 +0300 dmaengine: hsu: Use GENMASK() consistently For the masks replace chain of BIT() macros by GENMASK(). While at it, explicitly include bits.h. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220713172235.22611-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit d6b76a45d5ae241af61cabd03496a376bd63207d Author: Andy Shevchenko Date: Wed Jul 13 20:22:33 2022 +0300 dmaengine: hsu: using for_each_set_bit to simplify the code It's more cleanly to use for_each_set_bit() instead of opencoding it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220713172235.22611-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit d5988dcc760ca5cf683867163c7c78454fb2ec31 Author: Andy Shevchenko Date: Wed Jul 13 20:22:32 2022 +0300 dmaengine: hsu: Finish conversion to managed resources With help of devm_add_action_or_reset() we may finish conversion the driver to use managed resources. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220713172235.22611-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul commit 69687432277132c3740bee3a9ae3d375cf6e86db Author: Amelie Delaunay Date: Mon Aug 29 17:46:46 2022 +0200 dmaengine: stm32-mdma: add support to be triggered by STM32 DMA STM32 MDMA can be triggered by STM32 DMA channels transfer complete. In case of non-null struct dma_slave_config .peripheral_size, it means the DMA client wants the DMA to trigger the MDMA. stm32-mdma driver gets the request id, the mask_addr, and the mask_data in struct stm32_mdma_dma_config passed by DMA with struct dma_slave_config .peripheral_config/.peripheral_size. Then, as DMA is configured in Double-Buffer mode, and MDMA channel will transfer data from/to SRAM to/from DDR, then bursts are optimized. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-7-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 723795173ce1113fb478c18dc57e788b3eba3524 Author: Amelie Delaunay Date: Mon Aug 29 17:46:45 2022 +0200 dmaengine: stm32-dma: add support to trigger STM32 MDMA STM32 MDMA can be triggered by STM32 DMA channels transfer complete. The "request line number" triggering STM32 MDMA is the STM32 DMAMUX channel id set by stm32-dmamux driver in dma_spec->args[3]. stm32-dma driver fills the struct stm32_dma_mdma_config used to configure the MDMA with struct dma_slave_config .peripheral_config/.peripheral_size. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-6-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit b9a22954f08074b2d0126e45636eb77b66395ac5 Author: Amelie Delaunay Date: Mon Aug 29 17:46:44 2022 +0200 dmaengine: stm32-dmamux: set dmamux channel id in dma features bitfield STM32 DMAMUX is used with STM32 DMA1 and DMA2: - DMAMUX channels 0 to 7 are connected to DMA1 channels 0 to 7 - DMAMUX channels 8 to 15 are connected to DMA2 channels 0 to 7 STM32 MDMA can be triggered by DMA1 and DMA2 channels transfer complete, and the "request line number" is the DMAMUX channel id (e.g. DMA2 channel 0 triggers MDMA with request line 8). To well configure MDMA, set DMAMUX channel id in DMA features bitfield, so that DMA can update struct dma_slave_config peripheral_config properly. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-5-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit c6c1a365d6115f159572106b0bfd9796b0bffd27 Author: Amelie Delaunay Date: Mon Aug 29 17:46:43 2022 +0200 docs: arm: stm32: introduce STM32 DMA-MDMA chaining feature STM32 DMA-MDMA chaining feature is available on STM32 SoCs which embed STM32 DMAMUX, DMA and MDMA controllers. It is the case on STM32MP1 SoCs but also on STM32H7 SoCs. But focus is on STM32MP1 SoCs, using DDR. This documentation aims to explain how to use STM32 DMA-MDMA chaining feature in drivers of STM32 peripheral having request lines on STM32 DMA. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-4-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 1c32d6c37cc2a037e447e73f919d57e89ef4b571 Author: Amelie Delaunay Date: Mon Aug 29 17:46:42 2022 +0200 dmaengine: stm32-dma: use bitfield helpers Use the FIELD_{GET,PREP}() helpers, instead of defining custom macros implementing the same operations. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-3-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 4dc36a53b8b9135eed90766df49c0ec48d1550dd Author: Amelie Delaunay Date: Mon Aug 29 17:46:41 2022 +0200 dmaengine: stm32-dma: introduce 3 helpers to address channel flags Channels 0 to 3 flags are described in DMA_LISR and DMA_LIFCR (L as Low). Channels 4 to 7 flags are described in DMA_HISR and DMA_HIFCR (H as High). Macro STM32_DMA_ISR(n) returns the interrupt status register offset for the channel id (n). Macro STM32_DMA_IFCR(n) returns the interrupt flag clear register offset for the channel id (n). If chan->id % 4 = 2 or 3, then its flags are left-shifted by 16 bits. If chan->id % 4 = 1 or 3, then its flags are additionally left-shifted by 6 bits. If chan->id % 4 = 0, then its flags are not shifted. Macro STM32_DMA_FLAGS_SHIFT(n) returns the required shift to get or set the channel flags mask. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220829154646.29867-2-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 9e08d2138f132257322b04bf7a8274c59be334e8 Author: Jie Hai Date: Tue Aug 30 14:22:51 2022 +0800 MAINTAINERS: Add myself as maintainer for hisi_dma Add myself as a maintainer for hisi_dma. Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-8-haijie1@huawei.com Signed-off-by: Vinod Koul commit 5dda7a62aa1ca99ffd4a9737283fac1ac07b819b Author: Jie Hai Date: Tue Aug 30 14:22:50 2022 +0800 dmaengine: hisilicon: Dump regs to debugfs This patch adds dump of registers with debugfs for HIP08 and HIP09 DMA driver. Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-7-haijie1@huawei.com Signed-off-by: Vinod Koul commit fd5273fa0816ce3df10538686ea76c0d70b6d623 Author: Jie Hai Date: Tue Aug 30 14:22:49 2022 +0800 dmaengine: hisilicon: Adapt DMA driver to HiSilicon IP09 The HiSilicon IP08 and HiSilicon IP09 are DMA iEPs, they have the same pci device id but different pci revision. Unfortunately, they have different register layouts, so the origin driver cannot run on HiSilicon IP09 correctly. This patch enables the driver to adapt to HiSilicon IP09. HiSilicon IP09 offers 4 channels, each channel has a send queue, a complete queue and an interrupt to help to do tasks. This DMA engine can do memory copy between memory blocks. Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-6-haijie1@huawei.com Signed-off-by: Vinod Koul commit 4aa69cf7ed44590e8702eb970ff6951e33dcdabf Author: Jie Hai Date: Tue Aug 30 14:22:48 2022 +0800 dmaengine: hisilicon: Use macros instead of magic number readl_relaxed_poll_timeout() uses magic numbers 10 and 1000, which indicate maximum time to sleep between reads in us and timeout in us, respectively. Use macros HISI_DMA_POLL_Q_STS_DELAY_US and HISI_DMA_POLL_Q_STS_TIME_OUT_US instead of these two numbers. Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-5-haijie1@huawei.com Signed-off-by: Vinod Koul commit 2cbb95883c990d0002a77e13d3278913ab26ad79 Author: Jie Hai Date: Tue Aug 30 14:22:47 2022 +0800 dmaengine: hisilicon: Add multi-thread support for a DMA channel When we get a DMA channel and try to use it in multiple threads it will cause oops and hanging the system. % echo 100 > /sys/module/dmatest/parameters/threads_per_chan % echo 100 > /sys/module/dmatest/parameters/iterations % echo 1 > /sys/module/dmatest/parameters/run [383493.327077] Unable to handle kernel paging request at virtual address dead000000000108 [383493.335103] Mem abort info: [383493.335103] ESR = 0x96000044 [383493.335105] EC = 0x25: DABT (current EL), IL = 32 bits [383493.335107] SET = 0, FnV = 0 [383493.335108] EA = 0, S1PTW = 0 [383493.335109] FSC = 0x04: level 0 translation fault [383493.335110] Data abort info: [383493.335111] ISV = 0, ISS = 0x00000044 [383493.364739] CM = 0, WnR = 1 [383493.367793] [dead000000000108] address between user and kernel address ranges [383493.375021] Internal error: Oops: 96000044 [#1] PREEMPT SMP [383493.437574] CPU: 63 PID: 27895 Comm: dma0chan0-copy2 Kdump: loaded Tainted: GO 5.17.0-rc4+ #2 [383493.457851] pstate: 204000c9 (nzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [383493.465331] pc : vchan_tx_submit+0x64/0xa0 [383493.469957] lr : vchan_tx_submit+0x34/0xa0 This occurs because the transmission timed out, and that's due to data race. Each thread rewrite channels's descriptor as soon as device_issue_pending is called. It leads to the situation that the driver thinks that it uses the right descriptor in interrupt handler while channels's descriptor has been changed by other thread. The descriptor which in fact reported interrupt will not be handled any more, as well as its tx->callback. That's why timeout reports. With current fixes channels' descriptor changes it's value only when it has been used. A new descriptor is acquired from vc->desc_issued queue that is already filled with descriptors that are ready to be sent. Threads have no direct access to DMA channel descriptor. In case of channel's descriptor is busy, try to submit to HW again when a descriptor is completed. In this case, vc->desc_issued may be empty when hisi_dma_start_transfer is called, so delete error reporting on this. Now it is just possible to queue a descriptor for further processing. Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-4-haijie1@huawei.com Signed-off-by: Vinod Koul commit 94477a79cf80e8ab55b68f14bc579a12ddea1e0b Author: Jie Hai Date: Tue Aug 30 14:22:46 2022 +0800 dmaengine: hisilicon: Fix CQ head update After completion of data transfer of one or multiple descriptors, the completion status and the current head pointer to submission queue are written into the CQ and interrupt can be generated to inform the software. In interrupt process CQ is read and cq_head is updated. hisi_dma_irq updates cq_head only when the completion status is success. When an abnormal interrupt reports, cq_head will not update which will cause subsequent interrupt processes read the error CQ and never report the correct status. This patch updates cq_head whenever CQ is accessed. Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-3-haijie1@huawei.com Signed-off-by: Vinod Koul commit e3bdaa04ada31f46d0586df83a2789b8913053c5 Author: Jie Hai Date: Tue Aug 30 14:22:45 2022 +0800 dmaengine: hisilicon: Disable channels when unregister hisi_dma When hisi_dma is unloaded or unbinded, all of channels should be disabled. This patch disables DMA channels when driver is unloaded or unbinded. Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220830062251.52993-2-haijie1@huawei.com Signed-off-by: Vinod Koul commit ba5829c6543fbcf0b31854cc6970b9012ff71279 Author: Corey Minyard Date: Sun Sep 4 11:43:14 2022 -0500 ipmi:ipmb: Fix a vague comment and a typo Sending an IPMI response message gets a reponse to the response, but the comment saying that just said "response response", which is hard to understand. Also fix an obvious typo. Reported-by: Shaomin Deng Signed-off-by: Corey Minyard commit 407171717a4f4d2d80825584643374a2dfdb0540 Author: Jerry Snitselaar Date: Tue Aug 23 09:37:09 2022 -0700 dmaengine: idxd: avoid deadlock in process_misc_interrupts() idxd_device_clear_state() now grabs the idxd->dev_lock itself, so don't grab the lock prior to calling it. This was seen in testing after dmar fault occurred on system, resulting in lockup stack traces. Cc: Fenghua Yu Cc: Dave Jiang Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Fixes: cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal") Signed-off-by: Jerry Snitselaar Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20220823163709.2102468-1-jsnitsel@redhat.com Signed-off-by: Vinod Koul commit 78a21c7d59520e72ebea667fe8745a4371d9fe86 Author: Martijn Braam Date: Mon Aug 29 15:00:40 2022 +1000 arm64: dts: rockchip: Add initial support for Pine64 PinePhone Pro This is a basic DT containing regulators and UART, intended to be a base that myself and others can add additional nodes in future patches. Tested to work: booting from eMMC/SD, output over UART. https://wiki.pine64.org/wiki/PinePhone_Pro This is derived from the community pine64-org repo[0] with fixes from https://megous.com/git/linux. 0. https://gitlab.com/pine64-org/linux/-/commit/261d3b5f8ac503f97da810986d1d6422430c8531 Signed-off-by: Martijn Braam Co-developed-by: Kamil Trzciński [no SoB, but Kamil is happy for this patch to be submitted] Co-developed-by: Ondrej Jirman Signed-off-by: Ondrej Jirman Co-developed-by: Tom Fitzhenry Signed-off-by: Tom Fitzhenry Reviewed-by: Caleb Connolly Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220829050040.17330-2-tom@tom-fitzhenry.me.uk Signed-off-by: Heiko Stuebner commit 23c5f10981474b44ce1726e3753cbb7ac20d6548 Author: Tom Fitzhenry Date: Mon Aug 15 22:30:03 2022 +1000 dt-bindings: arm: rockchip: Add PinePhone Pro bindings Document board compatible names for Pine64 PinePhonePro. https://wiki.pine64.org/wiki/PinePhone_Pro Signed-off-by: Tom Fitzhenry Reviewed-by: Caleb Connolly Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220815123004.252014-2-tom@tom-fitzhenry.me.uk Signed-off-by: Heiko Stuebner commit 5abef9d713629d7201b1a3dd1fe6a8baa869da68 Author: Luca Weiss Date: Fri Aug 12 10:27:20 2022 +0200 dmaengine: qcom: gpi: Add SM6350 support The Qualcomm SM6350 platform does, like the SM8450, provide a set of GPI controllers with an ee-offset of 0x10000. Add this to the driver. Signed-off-by: Luca Weiss Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812082721.1125759-3-luca.weiss@fairphone.com Signed-off-by: Vinod Koul commit abd7bb690bcf662afc8abe74fd3c10f7ad1c5b19 Author: Luca Weiss Date: Fri Aug 12 10:27:19 2022 +0200 dt-bindings: dmaengine: qcom: gpi: add compatible for SM6350 Document the compatible for GPI DMA controller on SM6350 SoC. Signed-off-by: Luca Weiss Reviewed-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812082721.1125759-2-luca.weiss@fairphone.com Signed-off-by: Vinod Koul commit 904f983256fdd24bde974bf2f38fbacd3edbcd80 Author: Andy Yan Date: Sat Jul 9 18:30:16 2022 +0800 arm64: dts: rockchip: Add dts for a rk3399 based board EAIDK-610 EAIDK-610 is from OPEN AI LAB and popularly used by university students. Specification: - Rockchip RK3399 - LPDDR3 4GB - TF sd scard slot - eMMC - AP6255 for WiFi + BT - Gigabit ethernet - HDMI out - 40 pin header - USB 2.0 x 2 - USB 3.0 x 1 - USB 3.0 Type-C x 1 - 12V DC Power supply This patch is test on Armbain and Glodroid with HDMI/GPU/USB HOST/Type-C ADB/WIFI/BT. Signed-off-by: Andy Yan Link: https://lore.kernel.org/r/20220709103016.2754044-1-andyshrk@163.com Signed-off-by: Heiko Stuebner commit a15ca48b6451b7af27323749f35d0f9929f83f73 Author: Andy Yan Date: Sat Jul 9 18:30:01 2022 +0800 dt-bindings: arm: rockchip: Add EAIDK-610 EAIDK-610 is a rk3399 based board from OPEN AI LAB and popularly used by university students. Specification: - Rockchip RK3399 - LPDDR3 4GB - TF sd scard slot - eMMC - AP6255 for WiFi + BT - Gigabit ethernet - HDMI out - 40 pin header - USB 2.0 x 2 - USB 3.0 x 1 - USB 3.0 Type-C x 1 - 12V DC Power supply Signed-off-by: Andy Yan Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220709103001.2753992-1-andyshrk@163.com Signed-off-by: Heiko Stuebner commit 467dcf345613a779efc3af1dce88a576079666e6 Author: Andy Yan Date: Sat Jul 9 18:29:42 2022 +0800 dt-bindings: vendor-prefixes: Add OPEN AI LAB Add vendor prefixes for OPEN AI LAB. Signed-off-by: Andy Yan Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220709102942.2753939-1-andyshrk@163.com Signed-off-by: Heiko Stuebner commit 249d2e6f597b72769e158bfa0f64051de645ce3d Author: Rob Herring Date: Mon Aug 1 15:02:37 2022 -0600 dt-bindings: dma: arm,pl330: Add missing 'iommus' property The pl330 can be behind an IOMMU which is the case for Arm Juno board. Add the 'iommus' property allowing for 1 IOMMU entry per channel for writes and 1 IOMMU entry for reads. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220801210237.1501488-1-robh@kernel.org Signed-off-by: Vinod Koul commit b6c228401b2565b7bd59ad7418074145cdaa316a Author: Michael Riesch Date: Wed Jul 20 11:15:27 2022 +0200 arm64: dts: rockchip: add csi dphy node to rk356x Add the MIPI CSI DPHY node to the RK356x device tree. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220720091527.1270365-4-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 5a80c2572f5e40fc106fe9f372964935798dc637 Author: Ramona Bolboaca Date: Wed Aug 31 16:30:20 2022 +0300 dt-bindings: iio: adc: Add max11205 documentation file Add bindings documentation file and MAINTAINERS entry for MAX11205. Signed-off-by: Ramona Bolboaca Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220831133021.215625-1-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron commit d05d73779145f6d1addc10b516f589f803fcdb56 Author: Andy Shevchenko Date: Wed Aug 31 17:15:30 2022 +0300 iio: magnetometer: yamaha-yas530: Use dev_err_probe() Unify error message format by using dev_err_probe(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220831141530.80572-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit ff1c17e9a7623f73aa44c605a5e6a4396df46a5e Author: Andy Shevchenko Date: Wed Aug 31 17:15:29 2022 +0300 iio: magnetometer: yamaha-yas530: Make strings const in chip info For better compiler coverage mark strings consts in the chip info. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220831141530.80572-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 741d1e3783d9486d76534f2f08442e1f0eb108a1 Author: Andy Shevchenko Date: Wed Aug 31 17:15:28 2022 +0300 iio: magnetometer: yamaha-yas530: Use pointers as driver data Unify ID tables to use pointers for driver data. It will allow to simplify the driver later on. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220831141530.80572-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 86973ae0355bc302d5e4c10fa382f6801feb4b90 Author: Frank Wunderlich Date: Thu Aug 25 21:38:36 2022 +0200 arm64: dts: rockchip: Add PCIe v3 nodes to BPI-R2-Pro Add Nodes to Bananapi-R2-Pro board to support PCIe v3 and set PCIe related regulators to always on. Suggested-by: Peter Geis Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220825193836.54262-6-linux@fw-web.de Signed-off-by: Heiko Stuebner commit faedfa5b40f095d09040c3a040e2f8dee4a36b4b Author: Frank Wunderlich Date: Thu Aug 25 21:38:35 2022 +0200 arm64: dts: rockchip: Add PCIe v3 nodes to rk3568 Add nodes to rk356x devicetree to support PCIe v3. Signed-off-by: Peter Geis Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220825193836.54262-5-linux@fw-web.de Signed-off-by: Heiko Stuebner commit 4e441643b32249b4dac89be063255957f3d2938c Author: Frank Wunderlich Date: Thu Aug 25 21:38:33 2022 +0200 dt-bindings: soc: grf: add pcie30-{phy,pipe}-grf Add compatibles for PCIe v3 General Register Files. Signed-off-by: Frank Wunderlich Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220825193836.54262-3-linux@fw-web.de Signed-off-by: Heiko Stuebner commit f340ed8664a55a467850ec1689996e63d9ee971a Author: Peter Geis Date: Fri Sep 2 14:45:42 2022 -0400 phy: rockchip-inno-usb2: Return zero after otg sync The otg sync state patch reuses the ret variable, but fails to set it to zero after use. This leads to a situation when the otg port is in peripheral mode where the otg phy aborts halfway through setup. It also fails to account for a failure to register the extcon notifier. Fix this by using our own variable and skipping otg sync in case of failure. Fixes: 8dc60f8da22f ("phy: rockchip-inno-usb2: Sync initial otg state") Reported-by: Markus Reichl Reported-by: Michael Riesch Signed-off-by: Peter Geis Tested-by: Michael Riesch Tested-by: Markus Reichl Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220902184543.1234835-1-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit 766ab0ded4c2cca84ac80c036ea38686ff43765b Author: Heiner Kallweit Date: Tue Aug 30 19:16:07 2022 +0200 phy: amlogic: use devm_clk_get_enabled() to simplify the code Simplify the code by using devm_clk_get_enabled(). Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/9308a2a3-e828-bd9d-ab83-a68376aab5c3@gmail.com Signed-off-by: Vinod Koul commit 2e9bffc4f713db465177238f6033f7d367d6f151 Author: Shawn Lin Date: Thu Aug 25 21:38:34 2022 +0200 phy: rockchip: Support PCIe v3 RK3568 supports PCIe v3 using not Combphy like PCIe v2 on rk3566. It use a dedicated PCIe-phy. Add support for this. Initial support by Shawn Lin, modifications by Peter Geis and Frank Wunderlich. Add data-lanes property for splitting pcie-lanes across controllers. The data-lanes is an array where x=0 means lane is disabled and x > 0 means controller x is assigned to phy lane. Signed-off-by: Shawn Lin Suggested-by: Peter Geis Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220825193836.54262-4-linux@fw-web.de Signed-off-by: Vinod Koul commit 75be98eee8d8914e469f540e12f6078f42252acc Author: Frank Wunderlich Date: Thu Aug 25 21:38:32 2022 +0200 dt-bindings: phy: rockchip: add PCIe v3 phy Add a new binding file for Rockchip PCIe v3 phy driver. Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220825193836.54262-2-linux@fw-web.de Signed-off-by: Vinod Koul commit 3f8dd0a7dc16514d365253568bd32b8fe86c2e94 Author: Oleksij Rempel Date: Sun Sep 4 12:02:03 2022 +0200 iio: adc: tsc2046: silent spi_device_id warning Add spi_device_id to silent following kernel runtime warning: "SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc". Signed-off-by: Oleksij Rempel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220904100203.3614502-3-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron commit a616a6a1ff164d1502b28c1b1f5d481bfb26d879 Author: Oleksij Rempel Date: Sun Sep 4 12:02:02 2022 +0200 iio: adc: tsc2046: add vref support If VREF pin is attached, we should use external VREF source instead of the internal. Otherwise we will get wrong measurements on some of the channel types. Signed-off-by: Oleksij Rempel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220904100203.3614502-2-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron commit 6cda6aa83c0b548471bc30cc2083fe5fd255591b Author: Oleksij Rempel Date: Sun Sep 4 12:02:01 2022 +0200 dt-bindings: iio: adc: ti,tsc2046: add vref-supply property Add property for the voltage reference supply. Signed-off-by: Oleksij Rempel Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220904100203.3614502-1-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron commit a8933c8d55c37f4d5eb617b4bdb72b8888b88681 Author: Nicholas Piggin Date: Fri Sep 2 18:53:13 2022 +1000 powerpc/pseries: Add wait interval counter definitions to struct lppaca The hypervisor exposes accumulated partition scheduling interval times in the VPA (lppaca). These can be used to implement a simple stolen time in the guest without complex and costly dtl scanning. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20220902085316.2071519-2-npiggin@gmail.com commit 501fe299826ead2cfa2046b5c244e36de254ec6a Author: Michael Ellerman Date: Thu Sep 1 12:02:15 2022 +1000 selftests/powerpc: Skip 4PB test on 4K PAGE_SIZE systems Systems using the hash MMU with a 4K page size don't support 4PB address space, so skip the test because the bug it tests for can't be triggered. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220901020215.254097-1-mpe@ellerman.id.au commit aa398d88aea4ec863bd7aea35d5035a37096dc59 Author: Michael Ellerman Date: Thu Sep 1 11:42:53 2022 +1000 powerpc/configs: Properly enable PAPR_SCM in pseries_defconfig My commit to add PAPR_SCM to pseries_defconfig failed to add the required dependencies, meaning the driver doesn't get built. Add the required LIBNVDIMM=m. Fixes: d6481a7195df ("powerpc/configs: Add PAPR_SCM to pseries_defconfig") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220901014253.252927-1-mpe@ellerman.id.au commit bce1b56c73826fec8caf6187f0c922ede397a5a8 Author: Jens Axboe Date: Sun Sep 4 06:39:25 2022 -0600 Revert "sbitmap: fix batched wait_cnt accounting" This reverts commit 16ede66973c84f890c03584f79158dd5b2d725f5. This is causing issues with CPU stalls on my test box, revert it for now until we understand what is going on. It looks like infinite looping off sbitmap_queue_wake_up(), but hard to tell with a lot of CPUs hitting this issue and the console scrolling infinitely. Link: https://lore.kernel.org/linux-block/e742813b-ce5c-0d58-205b-1626f639b1bd@kernel.dk/ Signed-off-by: Jens Axboe commit e71a8ebbe086c3d80189726ef46bcf718cbe194d Author: Guillaume Ranquet Date: Thu Sep 1 12:41:49 2022 +0800 drm/mediatek: dp: Audio support for MT8195 This patch adds audio support to the DP driver for MT8195 with up to 8 channels. Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-11-rex-bc.chen@mediatek.com commit 4652e95e7ea609426f9196b328abedd564be7275 Author: Jitao Shi Date: Thu Sep 1 12:41:48 2022 +0800 drm/mediatek: dp: Add hpd debounce From the DP spec 1.4a chapter 3.3, upstream devices should implement HPD signal de-bouncing on an external connection. A period of 100ms should be used to detect an HPD connect event. To cover these cases, HPD de-bounce should be implemented only after HPD low has been detected for at least 100ms. Therefore, 1. If HPD is low (which means plugging out) for longer than 100ms: we need to do de-bouncing (which means we need to wait for 100ms). 2. If HPD low is for less than 100ms: we don't need to care about the de-bouncing. In this patch, we start a 100ms timer and use a need_debounce boolean to implement the feature. Two cases when HPD is high: 1. If the timer is expired (>100ms): - need_debounce is true. - When HPD high (plugging event comes), need_debounce will be true and then we need to do de-bouncing (wait for 100ms). 2. If the timer is not expired (<100ms): - need_debounce is false. - When HPD high (plugging event comes), need_debounce will be false and no need to do de-bouncing. HPD_______ __________________ | |<- 100ms -> |____________| <- 100ms -> Without HPD de-bouncing, USB-C to HDMI Adapaters will not be detected. The change has been successfully tested with the following devices: - Dell Adapter - USB-C to HDMI - Acer 1in1 HDMI dongle - Ugreen 1in1 HDMI dongle - innowatt HDMI + USB3 hub - Acer 2in1 HDMI dongle - Apple 3in1 HDMI dongle (A2119) - J5Create 3in1 HDMI dongle (JAC379) Tested-by: Rex-BC Chen Reviewed-by: Rex-BC Chen Signed-off-by: Jitao Shi Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-10-rex-bc.chen@mediatek.com commit d9e6ea02fc3f873a33709c3030034e9536230498 Author: Guillaume Ranquet Date: Thu Sep 1 12:41:47 2022 +0800 drm/mediatek: dp: Add MT8195 External DisplayPort support Add External DisplayPort support to the MT8195 eDP driver. Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-9-rex-bc.chen@mediatek.com commit 86e77a1f0ae83381796d6b83f5cb33d9c6dcf6e7 Author: Bo-Chen Chen Date: Thu Sep 1 12:41:46 2022 +0800 drm/mediatek: dp: Determine device of next_bridge It's not necessary to have a next_bridge for DP device, so we add this patch to judge this. Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-8-rex-bc.chen@mediatek.com commit 16075ed148833d7c4feb13bb295bbcb87a7f321e Author: Bo-Chen Chen Date: Thu Sep 1 12:41:45 2022 +0800 drm/mediatek: dp: Add multiple calibration data formats support The calibration data formats of eDP and DP are different. We add "const struct mtk_dp_efuse_fmt *efuse_fmt" to the device data to define them. Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-7-rex-bc.chen@mediatek.com commit 42dbe4a0a988fe7fd971c5b4bba0dfffc748fbfa Author: Bo-Chen Chen Date: Thu Sep 1 12:41:44 2022 +0800 drm/mediatek: dp: Add multiple smc commands support The smc commands of eDP and DP are different. We add smc_cmd to the device data to define them. Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-6-rex-bc.chen@mediatek.com commit 17881ea4c45335a2401f56e8909fedd392e5f2b4 Author: Bo-Chen Chen Date: Thu Sep 1 12:41:43 2022 +0800 drm/mediatek: dp: Add multiple bridge types support The bridge types of eDP and DP are different. We add device data to this driver and add bridge_type to the device data to define them. Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-5-rex-bc.chen@mediatek.com commit f70ac097a2cf5d4b67b2c1bbb73196c573ffcb7b Author: Markus Schneider-Pargmann Date: Thu Sep 1 12:41:42 2022 +0800 drm/mediatek: Add MT8195 Embedded DisplayPort driver This patch adds a embedded displayport driver for the MediaTek mt8195 SoC. It supports the MT8195, the embedded DisplayPort units. It offers DisplayPort 1.4 with up to 4 lanes. The driver creates a child device for the phy. The child device will never exist without the parent being active. As they are sharing a register range, the parent passes a regmap pointer to the child so that both can work with the same register range. The phy driver sets device data that is read by the parent to get the phy device that can be used to control the phy properties. This driver is based on an initial version by Jitao shi Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Reviewed-by: CK Hu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-4-rex-bc.chen@mediatek.com commit f89aa0b6db18dea3c3c8ef266cc6c9fd8dff2d72 Author: Markus Schneider-Pargmann Date: Thu Sep 1 12:41:41 2022 +0800 video/hdmi: Add audio_infoframe packing for DP Similar to HDMI, DP uses audio infoframes as well which are structured very similar to the HDMI ones. This patch adds a helper function to pack the HDMI audio infoframe for DP, called hdmi_audio_infoframe_pack_for_dp(). hdmi_audio_infoframe_pack_only() is split into two parts. One of them packs the payload only and can be used for HDMI and DP. Also constify the frame parameter in hdmi_audio_infoframe_check() as it is passed to hdmi_audio_infoframe_check_only() which expects a const. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-3-rex-bc.chen@mediatek.com commit a2ce58e8f9e4cef389a04077d052f8135f380c5c Author: Markus Schneider-Pargmann Date: Thu Sep 1 12:41:40 2022 +0800 dt-bindings: mediatek,dp: Add Display Port binding This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added. The controller can have two forms, as a normal display port and as an embedded display port. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Guillaume Ranquet Signed-off-by: Bo-Chen Chen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-2-rex-bc.chen@mediatek.com commit 42c3ba86581896be8dd7fb88ed075b600fd57fa1 Author: Rebecca Mckeever Date: Sat Sep 3 23:24:06 2022 -0500 memblock_tests: move variable declarations to single block Move variable declarations to a single block at the beginning of each testing function. Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/e61431e73977f305fdd027bca99d1dc119e96d84.1662264355.git.remckee0@gmail.com commit 35e49953c31d85d5d942af611d5b9090b0dc8cfa Author: Rebecca Mckeever Date: Sat Sep 3 23:23:37 2022 -0500 memblock tests: remove 'cleared' from comment blocks The tests in alloc_nid_api can now run either memblock_alloc_try_nid() or memblock_alloc_try_nid_raw(). The comment blocks for these tests should not refer to a 'cleared' region since that only applies to memblock_alloc_try_nid(). Remove 'cleared' from the comment blocks so that the comments are accurate for either memblock function. Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/e8be24137e54e9f81a06af969ded82b319114d7a.1662264347.git.remckee0@gmail.com commit 9837ec955b46b62d1dd2d00311461a950c50a791 Merge: aa3fab0110580 c087f9fcd0fb5 Author: David S. Miller Date: Sun Sep 4 11:24:34 2022 +0100 Merge tag 'wireless-next-2022-09-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Johannes Berg says: ==================== drivers - rtw89: large update across the map, e.g. coex, pci(e), etc. - ath9k: uninit memory read fix - ath10k: small peer map fix and a WCN3990 device fix - wfx: underflow stack - the "change MAC address while IFF_UP" change from James we discussed - more MLO work, including a set of fixes for the previous code, now that we have more code we can exercise it more - prevent some features with MLO that aren't ready yet (AP_VLAN and 4-address connections) ==================== Signed-off-by: David S. Miller commit f4e7a254299bcdfe7bced700a7d96690b1b9a6f2 Author: Dmitry Torokhov Date: Fri Sep 2 22:11:19 2022 -0700 Input: aiptek - switch to using dev_groups for driver-specific attributes The driver core now has the ability to handle the creation and removal of device-specific sysfs files, let's use it instead of registering and unregistering attributes by hand. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220903051119.1332808-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit fd30a4ba81f94e7297a3fb3c0d83879a4e4b2591 Author: Dmitry Torokhov Date: Fri Sep 2 22:11:18 2022 -0700 Input: psmouse - switch to using dev_groups for driver-specific attributes The driver core now has the ability to handle the creation and removal of device-specific sysfs files, let's use it instead of registering and unregistering attributes by hand. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220903051119.1332808-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit c99e3ac632f9dfa4e363cf370dea7467ebb0f367 Author: Dmitry Torokhov Date: Fri Sep 2 22:11:17 2022 -0700 Input: atkbd - switch to using dev_groups for driver-specific attributes The driver core now has the ability to handle the creation and removal of device-specific sysfs files, let's use it instead of registering and unregistering attributes by hand. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220903051119.1332808-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit a1cf1fd62ae71b585b35f78f8bcf6b1bc9de2c40 Author: Lukas Wunner Date: Fri Sep 2 04:15:55 2022 +0200 ACPI: property: Silence missing-declarations warning in apple.c Silence an annoying message emitted for W=1 builds: drivers/acpi/x86/apple.c:30:6: warning: no previous declaration for 'acpi_extract_apple_properties' [-Wmissing-declarations] Reported-by: kernel test robot Signed-off-by: Lukas Wunner Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 2814108cbf54cd4737cd13e17291b21590472dca Author: John Garry Date: Thu Sep 1 18:04:11 2022 +0800 ACPI: platform: Use PLATFORM_DEVID_NONE in acpi_create_platform_device() Instead of hardcoding the value for the id, use PLATFORM_DEVID_NONE. Signed-off-by: John Garry Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 1902d158bc86370c29bbb7d5f0e4b9a86a6c6c48 Author: Andy Shevchenko Date: Wed Aug 31 17:03:27 2022 +0300 ACPI: platform: Sort forbidden_id_list[] in ascending order For easier maintenance, sort the forbidden_id_list[] table rows in ascending order with respect to the device ID field. While at it, use an empty row as the list terminator, which is more usual in the kernel. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 895a4d6ce17b377316ebe7e7090efc1ce9ffd1fe Author: Andy Shevchenko Date: Wed Aug 31 17:03:26 2022 +0300 ACPI: platform: Use sizeof(*pointer) instead of sizeof(type) It is preferred to use sizeof(*pointer) instead of sizeof(type). The type of the variable can change and one needs not change the former (unlike the latter). No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 1d190148cc22495a01668417243121ad0ad5df01 Author: Andy Shevchenko Date: Wed Aug 31 17:03:25 2022 +0300 ACPI: platform: Remove redundant print on -ENOMEM We rely on somebody else to print enough information on memory allocation failures. So remove the log in the acpi_create_platform_device() when return -ENOMEM. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit f3bc9ca5285de3b3a149f18c60c05ab57b0a0a4e Author: Andy Shevchenko Date: Wed Aug 31 17:03:24 2022 +0300 ACPI: platform: Get rid of redundant 'else' In the snippets like the following if (...) return / goto / break / continue ...; else ... the 'else' is redundant. Get rid of it. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 98378956a407392109817278c6edd464252c7a83 Author: Rafael J. Wysocki Date: Mon Aug 29 18:12:33 2022 +0200 ACPI: property: Use acpi_dev_parent() After introducing acpi_dev_parent() in commit 62fcb99bdf10 ("ACPI: Drop parent field from struct acpi_device"), it is better to use it instead of accessing the dev.parent field in struct acpi_device directly. Modify acpi_node_get_parent() accordingly. Suggested-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko commit fe79e392cf08a38ca0e25ffadbe35e45d5651989 Author: Andy Shevchenko Date: Fri Aug 26 20:16:35 2022 +0300 ACPI: bus: Refactor ACPI matching functions for better readability With temporary variables for OF and ACPI IDs, it's easier to read the code. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 1cd43acf0b61fc93aaede45cdc7d61b5ddcb54a4 Author: Andy Shevchenko Date: Fri Aug 26 20:16:34 2022 +0300 ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() The description for acpi_bus_notify() is quite far from what kernel doc expects. It complains about this: Function parameter or member 'handle' not described in 'acpi_bus_notify' Function parameter or member 'type' not described in 'acpi_bus_notify' Function parameter or member 'data' not described in 'acpi_bus_notify' Fix this by dropping kernel doc annotation. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit e6e8c6c2380d88606c991b5855881769297b5653 Author: Jean Delvare Date: Fri Aug 26 15:14:57 2022 +0200 ACPI: docs: enumeration: Fix a few typos and wording mistakes "sturct" -> "struct" "similar than with" -> "similar to" Missing comma, "it" and "to" Signed-off-by: Jean Delvare Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 40083734d9f94713cedf2c386e4a668dfc6774a9 Author: Shi junming Date: Thu Aug 25 17:03:47 2022 +0800 ACPI: tools: pfrut: Do not initialize ret in main() The initialization is unnecessary, because ret is always assigned a new value before reading it. Signed-off-by: Shi junming [ rjw: Subject edits, new changelog ] Signed-off-by: Rafael J. Wysocki commit b3c0e38bdb52abd581da70d7048a173f8cf8d327 Author: ye xingchen Date: Thu Aug 25 07:27:44 2022 +0000 ACPI: EC: Drop unneeded result variable from ec_write() Return the acpi_ec_write() return value directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 574160b8548deff8b80b174f03201e94ab8431e2 Author: Arvid Norlander Date: Wed Aug 24 20:49:50 2022 +0200 ACPI: video: Add Toshiba Satellite/Portege Z830 quirk Toshiba Satellite Z830 needs the quirk video_disable_backlight_sysfs_if for proper backlight control after suspend/resume cycles. Toshiba Portege Z830 is simply the same laptop rebranded for certain markets (I looked through the manual to other language sections to confirm this) and thus also needs this quirk. Thanks to Hans de Goede for suggesting this fix. Link: https://www.spinics.net/lists/platform-driver-x86/msg34394.html Suggested-by: Hans de Goede Signed-off-by: Arvid Norlander Reviewed-by: Hans de Goede Tested-by: Arvid Norlander Signed-off-by: Rafael J. Wysocki commit 37096428962d125591144876db6ae037096e39ed Author: Dmitry Monakhov Date: Wed Aug 24 16:01:13 2022 +0300 ACPI: APEI: Add BERT error log footer Print total number of records found during BERT log parsing. This also simplify dmesg parser implementation for BERT events. Signed-off-by: Dmitry Monakhov Acked-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit e9a7c526c29b0ae60c888b335bd6cf6e2ee80154 Author: Rafael J. Wysocki Date: Tue Aug 30 20:33:37 2022 +0200 thermal: int340x_thermal: Consolidate priv->data_vault checks It is sufficient to check priv->data_vault once in the error code path of int3400_thermal_probe(), so do that. Signed-off-by: Rafael J. Wysocki commit 0d7a23b5f8e162bf2c5caab06f5df4aee2619073 Author: Zhang Rui Date: Tue Aug 30 11:01:34 2022 +0800 powercap: intel_rapl: Add support for RAPTORLAKE_S Add intel_rapl support for RAPTORLAKE_S platform, which behaves the same as RAPTORLAKE and RAPTORLAKE_P platforms. Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit bedadcfb011fef55273bd686e8893fdd8911dcdb Author: Perry Yuan Date: Tue Aug 30 09:56:00 2022 +0800 cpufreq: amd-pstate: Fix initial highest_perf value To avoid some new AMD processors use wrong highest perf when amd pstate driver loaded, this fix will query the highest perf from MSR register MSR_AMD_CPPC_CAP1 and cppc_acpi interface firstly, then compare with the highest perf value got by calling amd_get_highest_perf() function. The lower value will be the correct highest perf we need to use. Otherwise the CPU max MHz will be incorrect if the amd_get_highest_perf() did not cover the new process family and model ID. Like this lscpu info, the max frequency is incorrect. Vendor ID: AuthenticAMD Socket(s): 1 Stepping: 2 CPU max MHz: 5410.0000 CPU min MHz: 400.0000 BogoMIPS: 5600.54 Fixes: 3743d55b289c2 (x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations) Acked-by: Huang Rui Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 06f7c08751939f33d79712590c2b21d02aba61b6 Author: Yu Liao Date: Mon Aug 29 09:15:34 2022 +0800 cpuidle: Remove redundant check in cpuidle_switch_governor() gov has already been NULL checked at the beginning of cpuidle_switch_governor, so remove redundant check. While at it, use pr_info() instead printk() to address the following checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: Yu Liao [ rjw: Subject and changelog edits, added empty line after if () ] Signed-off-by: Rafael J. Wysocki commit cff895277c8558221ba180aefe26799dcb4eec86 Author: Xuewen Yan Date: Thu Aug 25 19:40:17 2022 +0800 thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register() Since the policy needs to be accessed first when obtaining cpu devices, first check whether the policy is legal before this. Fixes: 5130802ddbb1 ("thermal: cpu_cooling: Switch to QoS requests for freq limits") Signed-off-by: Xuewen Yan Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit cb3e7d624c3ff34a300587929c82af7364cf5c09 Author: Mario Limonciello Date: Wed Aug 24 20:36:30 2022 -0500 PM: wakeup: Add extra debugging statement for multiple active IRQs Since commit cb1f65c1e1424 ("PM: s2idle: ACPI: Fix wakeup interrupts handling") was introduced the kernel can now handle multiple simultaneous interrupts during wakeup. Ths uncovered some existing subtle firmware bugs where multiple IRQs are unintentionally active. To help with fixing those bugs add an extra message when PM debugging is enabled that can show the individual IRQs triggered as if a variety are fired they'll potentially be lost as /sys/power/pm_wakeup_irq only contains the first one that triggered the wakeup after resume is complete but all may be needed to demonstrate the whole picture. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215770 Signed-off-by: Mario Limonciello [ rjw: Added empty line after if () ] Signed-off-by: Rafael J. Wysocki commit 96f1c52992e5a91207aabf6cf8d1b0f3e6479a97 Author: Jilin Yuan Date: Mon Aug 22 20:32:39 2022 +0800 thermal: Drop duplicate words from comments Drop duplicate words from two kerneldoc comments in the thermal subsystem. Signed-off-by: Jilin Yuan [ rjw: Subject edits and changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit 939bc5453b8cbdde9f1e5110ce8309aedb1b501a Author: Dan Carpenter Date: Thu Sep 1 08:18:45 2022 +0300 fpga: prevent integer overflow in dfl_feature_ioctl_set_irq() The "hdr.count * sizeof(s32)" multiplication can overflow on 32 bit systems leading to memory corruption. Use array_size() to fix that. Fixes: 322b598be4d9 ("fpga: dfl: introduce interrupt trigger setting API") Signed-off-by: Dan Carpenter Acked-by: Xu Yilun Link: https://lore.kernel.org/r/YxBAtYCM38dM7yzI@kili Signed-off-by: Xu Yilun commit c087f9fcd0fb53422a9a6c865dbf7dc89b6aecdb Author: Johannes Berg Date: Fri Sep 2 16:12:49 2022 +0200 wifi: mac80211_hwsim: fix multi-channel handling in netlink RX In netlink RX, now that we can actually have multiple channel contexts for MLO, things don't work well as we only keep a single pointer, and then on link switching we might NULL it, and hit the return if the channel is NULL. However, we already use mac80211_hwsim_tx_iter() which deals with all this, so remove the test and adjust the remaining code a bit. This then means we no longer use the chanctx pointer, so remove it as well. Signed-off-by: Johannes Berg commit 48c5d82aba65c91cbc8eff308037bf58bc012eb1 Author: Johannes Berg Date: Fri Sep 2 16:12:51 2022 +0200 wifi: mac80211: call drv_sta_state() under sdata_lock() in reconfig Currently, other paths calling drv_sta_state() hold the mutex and therefore drivers can assume that, and look at links with that protection. Fix that for the reconfig path as well; to do it more easily use ieee80211_reconfig_stations() for the AP/AP_VLAN station reconfig as well. Signed-off-by: Johannes Berg commit 6522047c65764c9aaec8009e73daa8c0b138c701 Author: Johannes Berg Date: Fri Sep 2 16:12:50 2022 +0200 wifi: nl80211: add MLD address to assoc BSS entries Add an MLD address attribute to BSS entries that the interface is currently associated with to help userspace figure out what's going on. Signed-off-by: Johannes Berg commit 7e415d0c8c1234932940ed762d073dbf26080883 Author: Johannes Berg Date: Fri Sep 2 16:12:46 2022 +0200 wifi: mac80211: mlme: refactor QoS settings code Refactor the code to apply QoS settings to the driver so we can call it on link switch. Signed-off-by: Johannes Berg commit 419bd7a7aa4972b0c761707bf36c4021ddc34c4f Author: Johannes Berg Date: Fri Sep 2 16:12:39 2022 +0200 wifi: mac80211_hwsim: warn on invalid link address Catch the bugs fixed in mac80211 by the previous commits and warn if an invalid address is added (or removed). Signed-off-by: Johannes Berg commit a033afca2dc9d225cec1227a0554ad97ac00879d Author: Johannes Berg Date: Fri Sep 2 16:12:55 2022 +0200 wifi: mac80211: fix double SW scan stop When we stop a not-yet-started scan, we erroneously call into the driver, causing a sequence of sw_scan_start() followed by sw_scan_complete() twice. This will cause a warning in hwsim with next in line commit that validates the address passed to wmediumd/virtio. Fix this by doing the calls only if we were actually scanning. Signed-off-by: Johannes Berg commit acdc3e47881d86dc1cb89d4603e3fed90ab150db Author: Johannes Berg Date: Fri Sep 2 16:12:38 2022 +0200 wifi: mac80211: mlme: assign link address correctly Right now, we assign the link address only after we add the link to the driver, which is quite obviously wrong. It happens to work in many cases because it gets updated immediately, and then link_conf updates may update it, but it's clearly not really right. Set the link address during ieee80211_mgd_setup_link() so it's set before telling the driver about the link. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Johannes Berg commit e73b5e51a05d41c82a384c2c40e7ecd1bae4bbc3 Author: Johannes Berg Date: Fri Sep 2 16:12:37 2022 +0200 wifi: mac80211: move link code to a new file We probably should've done that originally, we already have about 300 lines of code there, and will add more. Move all the link code we wrote to a new file. Signed-off-by: Johannes Berg commit b1622adaa55541fa9a48c487e1377d3571445da9 Author: Johannes Berg Date: Fri Sep 2 16:12:36 2022 +0200 wifi: mac80211_hwsim: refactor RX a bit Refactor some common RX functionality between the netlink and non-netlink paths, adding the special hwsim TLV (if compiled) also in the netlink path. Signed-off-by: Johannes Berg commit b2c4aa35ebcc5c7e941a46e7b5c07587bd01b4e2 Author: Johannes Berg Date: Fri Sep 2 16:12:35 2022 +0200 wifi: mac80211_hwsim: check STA magic in change_sta_links Just as an additional check that mac80211 isn't doing anything strange, add a check of the STA magic (which gets assigned when the station is added, and cleared when the station is removed). Signed-off-by: Johannes Berg commit 774e00c20c4cb16c0edaafcf3e863a41092158d7 Author: Johannes Berg Date: Fri Sep 2 16:12:34 2022 +0200 wifi: mac80211: remove unused arg to ieee80211_chandef_eht_oper We don't need the sdata argument, and it doesn't make any sense for a direct conversion from one value to another, so just remove the argument Signed-off-by: Johannes Berg commit 86e74a08fecb59985bb2d5fe3e96dc108822a420 Author: Johannes Berg Date: Fri Sep 2 16:12:33 2022 +0200 wifi: mac80211_hwsim: remove multicast workaround Now that we have proper multicast TX in mac80211, there's no longer a need to fake something here. Signed-off-by: Johannes Berg commit a21cd7d63be70f55b3c66d00dfa8d0138446c8ff Author: Jinpeng Cui Date: Mon Aug 29 11:29:53 2022 +0000 wifi: nl80211: remove redundant err variable Return value from rdev_set_mcast_rate() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Johannes Berg commit 3c06e91b40db6db48c4886b0292983f404d31958 Author: James Prestwood Date: Fri Aug 26 10:00:32 2022 -0700 wifi: mac80211: Support POWERED_ADDR_CHANGE feature Adds support in mac80211 for NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE. The motivation behind this functionality is to fix limitations of address randomization on frequencies which are disallowed in world roaming. The way things work now, if a client wants to randomize their address per-connection it must power down the device, change the MAC, and power back up. Here lies a problem since powering down the device may result in frequencies being disabled (until the regdom is set). If the desired BSS is on one such frequency the client is unable to connect once the phy is powered again. For mac80211 based devices changing the MAC while powered is possible but currently disallowed (-EBUSY). This patch adds some logic to allow a MAC change while powered by removing the interface, changing the MAC, and adding it again. mac80211 will advertise support for this feature so userspace can determine the best course of action e.g. disallow address randomization on certain frequencies if not supported. There are certain limitations put on this which simplify the logic: - No active connection - No offchannel work, including scanning. Signed-off-by: James Prestwood Signed-off-by: Johannes Berg commit a36c421690b3e5dee38fc12abfcabda742f00064 Author: James Prestwood Date: Fri Aug 26 10:00:31 2022 -0700 wifi: nl80211: Add POWERED_ADDR_CHANGE feature Add a new extended feature bit signifying that the wireless hardware supports changing the MAC address while the underlying net_device is powered. Note that this has a different meaning from IFF_LIVE_ADDR_CHANGE as additional restrictions might be imposed by the hardware, such as: - No connection is active on this interface, carrier is off - No scan is in progress - No offchannel operations are in progress Signed-off-by: James Prestwood Signed-off-by: Johannes Berg commit 90703ba9bbc904c17828b84dd59b624bc9aef6cb Author: Johannes Berg Date: Fri Sep 2 16:12:58 2022 +0200 wifi: mac80211: prevent 4-addr use on MLDs We haven't tried this yet, and it's not very likely to work well right now, so for now disable 4-addr use on interfaces that are MLDs. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220902161143.f2e4cc2efaa1.I5924e8fb44a2d098b676f5711b36bbc1b1bd68e2@changeid Signed-off-by: Johannes Berg commit ae960ee90bb1c171c2e4c8d2107bb1c693a835dc Author: Johannes Berg Date: Fri Sep 2 16:12:59 2022 +0200 wifi: mac80211: prevent VLANs on MLDs Do not allow VLANs to be added to AP interfaces that are MLDs, this isn't going to work because the link structs aren't propagated to the VLAN interfaces yet. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220902161144.8c88531146e9.If2ef9a3b138d4f16ed2fda91c852da156bdf5e4d@changeid Signed-off-by: Johannes Berg commit f98d67ac427d416d46da5b82be92a2bed0c60be2 Author: Andy Shevchenko Date: Thu Sep 1 14:34:06 2022 +0300 platform/x86: p2sb: Fix UAF when caller uses resource name We have to copy only selected fields from the original resource. Because a PCI device will be removed immediately after getting its resources, we may not use any allocated data, hence we may not copy any pointers. Consider the following scenario: 1/ a caller of p2sb_bar() gets the resource; 2/ the resource has been copied by platform_device_add_data() in order to create a platform device; 3/ the platform device creation will call for the device driver's ->probe() as soon as a match found; 4/ the ->probe() takes given resources (see 2/) and tries to access one of its field, i.e. 'name', in the __devm_ioremap_resource() to create a pretty looking output; 5/ but the 'name' is a dangling pointer because p2sb_bar() removed a PCI device, which 'name' had been copied to the caller's memory. 6/ UAF (Use-After-Free) as a result. Kudos to Mika for the initial analisys of the issue. Fixes: 9745fb07474f ("platform/x86/intel: Add Primary to Sideband (P2SB) bridge support") Reported-by: kernel test robot Suggested-by: Mika Westerberg Link: https://lore.kernel.org/linux-i2c/YvPCbnKqDiL2XEKp@xsang-OptiPlex-9020/ Link: https://lore.kernel.org/linux-i2c/YtjAswDKfiuDfWYs@xsang-OptiPlex-9020/ Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220901113406.65876-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 134038b075cb1dae21623499d765973d286ac94a Author: Mario Limonciello Date: Mon Aug 29 15:14:59 2022 -0500 platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver The WMI subsystem in the kernel currently tracks WMI devices by a GUID string not by ACPI device. The GUID used by the `wmi-bmof` module however is available from many devices on nearly every machine. This originally was thought to be a bug, but as it happens on most machines it is a design mistake. It has been fixed by tying an ACPI device to the driver with struct wmi_driver. So drivers that have moved over to struct wmi_driver can actually support multiple instantiations of a GUID without any problem. Add an allow list into wmi.c for GUIDs that the drivers that are known to use struct wmi_driver. The list is populated with `wmi-bmof` right now. The additional instances of that in sysfs with be suffixed with -%d Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220829201500.6341-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 483e3d87a37e804588ac8224aadd20a84593cafd Author: Ville Syrjälä Date: Fri Sep 2 10:03:19 2022 +0300 Revert "drm/i915/display: Re-add check for low voltage sku for max dp source rate" This reverts commit d5929835080a60f9119d024fa42f315913942f76. With the Parade PS8461E MUX workaround (WaEdpLinkRateDataReload) implemented we can get finally rid of the is_low_voltage_sku() check that incorrectly prevents many machines from using the 8.1Gpbs link rate. Cc: Jason A. Donenfeld Cc: Ankit Nautiyal Cc: Jani Nikula Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5272 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6323 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6205 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220902070319.15395-2-ville.syrjala@linux.intel.com Tested-by: Aaron Ma Tested-by: Jason A. Donenfeld Reviewed-by: Jani Nikula commit 4f96b1bc156e7076f6efedc2a76a8c7e897c7977 Author: Hans de Goede Date: Mon Jul 11 13:49:34 2022 +0200 drm/todo: Add entry about dealing with brightness control on devices with > 1 panel Add an entry summarizing the discussion about dealing with brightness control on devices with more then 1 internal panel. The original discussion can be found here: https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede commit c2d6920e9877c8298502ec6163a93ab0db1dd761 Author: Hans de Goede Date: Sat Jun 18 19:19:51 2022 +0200 ACPI: video: Fix indentation of video_detect_dmi_table[] entries The video_detect_dmi_table[] uses an unusual indentation for before the ".name = ..." named struct initializers. Instead of being indented with an extra tab compared to the previous line's '{' these are indented to with only a single space to allow for long DMI_MATCH() lines without wrapping. But over time some entries did not event have the single space indent in front of the ".name = ..." lines. Make things consistent by using a single space indent for these lines everywhere. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 10212754a0d2c4b4ae951c04f154a82dd2a1f9c4 Author: Hans de Goede Date: Sat Jun 18 19:15:22 2022 +0200 ACPI: video: Drop NL5x?U, PF4NU1F and PF5?U?? acpi_backlight=native quirks acpi_backlight=native is the default for these, but as the comment explains the quirk was still necessary because even briefly registering the acpi_video0 backlight; and then unregistering it once the native driver showed up, was leading to issues. After the "ACPI: video: Make backlight class device registration a separate step" patch from earlier in this patch-series, we no longer briefly register the acpi_video0 backlight on systems where the native driver should be used. So this is no longer an issue an the quirks are no longer needed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215683 Tested-by: Werner Sembach Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit de6f3121dc6b2226b85a91b1fe2ac2d08a8b5248 Author: Hans de Goede Date: Sat Jun 18 19:06:51 2022 +0200 ACPI: video: Drop "Samsung X360" acpi_backlight=native quirk acpi_backlight=native is the default for the "Samsung X360", but as the comment explains the quirk was still necessary because even briefly registering the acpi_video0 backlight; and then unregistering it once the native driver showed up, was leading to issues. After the "ACPI: video: Make backlight class device registration a separate step" patch from earlier in this patch-series, we no longer briefly register the acpi_video0 backlight on systems where the native driver should be used. So this is no longer an issue an the quirk is no longer needed. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 77ab9d4d44cd235322d2f30b1c4026302c3ce8c6 Author: Hans de Goede Date: Mon Jun 20 11:49:57 2022 +0200 ACPI: video: Remove acpi_video_set_dmi_backlight_type() acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. In case of the acpi_video backlight, acpi_video_set_dmi_backlight_type() actually calls acpi_video_unregister_backlight() since that is often probed earlier, leading to userspace seeing the acpi_video0 class device being briefly available, leading to races in userspace where udev probe-rules try to access the device and it is already gone. All callers have been fixed to no longer call it, so remove acpi_video_set_dmi_backlight_type() now. This means we now also no longer need acpi_video_unregister_backlight() for the remove acpi_video backlight after it was wrongly registered hack, so remove that too. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 8991d7d9add0d9a711db692458d950050b38307b Author: Hans de Goede Date: Sat Jun 18 19:01:05 2022 +0200 platform/x86: samsung-laptop: Move acpi_backlight=[vendor|native] quirks to ACPI video_detect.c acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. Move all the acpi_backlight=[vendor|native] quirks from samsung-laptop to drivers/acpi/video_detect.c . Note the X360 -> acpi_backlight=native quirk is not moved because that already was present in drivers/acpi/video_detect.c . Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 1e3344d6f2b329ca064b3016bc33d7f33ed7ba0e Author: Hans de Goede Date: Sat Jun 18 17:44:58 2022 +0200 platform/x86: asus-wmi: Move acpi_backlight=native quirks to ACPI video_detect.c Remove the asus-wmi quirk_entry.wmi_backlight_native quirk-flag, which called acpi_video_set_dmi_backlight_type(acpi_backlight_native) and replace it with acpi/video_detect.c video_detect_dmi_table[] entries using the video_detect_force_native callback. acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 52796b304a517b002300bbb67074b38a6003fd7a Author: Hans de Goede Date: Sat Jun 18 17:15:24 2022 +0200 platform/x86: asus-wmi: Move acpi_backlight=vendor quirks to ACPI video_detect.c Remove the asus-wmi quirk_entry.wmi_backlight_power quirk-flag, which called acpi_video_set_dmi_backlight_type(acpi_backlight_vendor) and replace it with acpi/video_detect.c video_detect_dmi_table[] entries using the video_detect_force_vendor callback. acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. Note no entries are dropped from the dmi_system_id table in asus-nb-wmi.c. This is because the entries using the removed wmi_backlight_power flag also use other model specific quirks from the asus-wmi quirk_entry struct. So the quirk_asus_x55u struct and the entries pointing to it cannot be dropped. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 2603c681e0f63581b2c7821728d5be2cdee8cb9f Author: Hans de Goede Date: Sun Jun 5 17:26:54 2022 +0200 platform/x86: asus-wmi: Drop DMI chassis-type check from backlight handling Remove this check from the asus-wmi backlight handling: /* Some Asus desktop boards export an acpi-video backlight interface, stop this from showing up */ chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); if (chassis_type && !strcmp(chassis_type, "3")) acpi_video_set_dmi_backlight_type(acpi_backlight_vendor); This acpi_video_set_dmi_backlight_type(acpi_backlight_vendor) call must be removed because other changes in this series change the native backlight drivers to no longer unconditionally register their backlight. Instead these drivers now do this check: if (acpi_video_get_backlight_type(false) != acpi_backlight_native) return 0; /* bail */ So leaving this in place can break things on laptops with a broken DMI chassis-type, which would have GPU native brightness control before the addition of the acpi_video_get_backlight_type() != native check. Removing this should be ok now, since the ACPI video code has improved heuristics for this itself now (which includes a chassis-type check). Signed-off-by: Hans de Goede commit 0172df18dc4309a7052cbb37a6939f7a8b0735d5 Author: Hans de Goede Date: Sat Jun 4 18:28:52 2022 +0200 platform/x86: acer-wmi: Move backlight DMI quirks to acpi/video_detect.c Move the backlight DMI quirks to acpi/video_detect.c, so that the driver no longer needs to call acpi_video_set_dmi_backlight_type(). acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. Note that even though the DMI quirk table name was video_vendor_dmi_table, 5/6 quirks were actually quirks to use the GPU native backlight. These 5 quirks also had a callback in their dmi_system_id entry which disabled the acer-wmi vendor driver; and any DMI match resulted in: acpi_video_set_dmi_backlight_type(acpi_backlight_vendor); which disabled the acpi_video driver, so only the native driver was left. The new entries for these 5/6 devices correctly marks these as needing the native backlight driver. Also note that other changes in this series change the native backlight drivers to no longer unconditionally register their backlight. Instead these drivers now do this check: if (acpi_video_get_backlight_type(false) != acpi_backlight_native) return 0; /* bail */ which without this patch would have broken these 5/6 "special" quirks. Since I had to look at all the commits adding the quirks anyways, to make sure that I understood the code correctly, I've also added links to the various original bugzillas for these quirks to the new entries. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit a2ed70d0ecb11b7eb3ff14ed897cd0995c86651d Author: Hans de Goede Date: Sat Jun 4 16:18:05 2022 +0200 platform/x86: toshiba_acpi: Stop using acpi_video_set_dmi_backlight_type() acpi_video_set_dmi_backlight_type() is troublesome because it may end up getting called after other backlight drivers have already called acpi_video_get_backlight_type() resulting in the other drivers already being registered even though they should not. In case of the acpi_video backlight, acpi_video_set_dmi_backlight_type() actually calls acpi_video_unregister_backlight() since that is often probed earlier, leading to userspace seeing the acpi_video0 class device being briefly available, leading to races in userspace where udev probe-rules try to access the device and it is already gone. In case of toshiba_acpi there are no DMI quirks to move to acpi/video_detect.c, but it also (ab)uses it for transflective displays. Adding transflective display support to video_detect.c would be quite involved. But luckily there are only 2 known models with a transflective display, so we can just add DMI quirks for those. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 4f04c7dc83fd4339b00421174edc8556b6bac2b1 Author: Hans de Goede Date: Sat Jun 4 15:25:39 2022 +0200 platform/x86: apple-gmux: Stop calling acpi/video.h functions Now that acpi_video_get_backlight_type() has apple-gmux detection (using apple_gmux_present()), it is no longer necessary for the apple-gmux code to manually remove possibly conflicting drivers. So remove the handling for this from the apple-gmux driver. Signed-off-by: Hans de Goede commit 8d0ca287fd8cdc8110f5e441ec14874158f32a0f Author: Hans de Goede Date: Wed Aug 17 14:37:21 2022 +0200 platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type() Add an acpi_video_get_backlight_type() == acpi_backlight_nvidia_wmi_ec check. This will make nvidia-wmi-ec-backlight properly honor the user selecting a different backlight driver through the acpi_backlight=... kernel commandline option. Since the auto-detect code check for nvidia-wmi-ec-backlight in drivers/acpi/video_detect.c already checks that the WMI advertised brightness-source is the embedded controller, this new check makes it unnecessary for nvidia_wmi_ec_backlight_probe() to check this itself. Suggested-by: Daniel Dadap Reviewed-by: Daniel Dadap Signed-off-by: Hans de Goede commit 21245df307cbee9e04d5b4aac3fd04334f6b45dc Author: Hans de Goede Date: Sat Jun 4 15:21:51 2022 +0200 ACPI: video: Add Apple GMUX brightness control detection On Apple laptops with an Apple GMUX using this for brightness control, should take precedence of any other brightness control methods. Add apple-gmux detection to acpi_video_get_backlight_type() using the already existing apple_gmux_present() helper function. This will allow removig the (ab)use of: acpi_video_set_dmi_backlight_type(acpi_backlight_vendor); Inside the apple-gmux driver. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit fe7aebb40d42bf8e830019d6f57c47cf7d85aa61 Author: Hans de Goede Date: Sat Jun 4 14:06:18 2022 +0200 ACPI: video: Add Nvidia WMI EC brightness control detection (v3) On some new laptop designs a new Nvidia specific WMI interface is present which gives info about panel brightness control and may allow controlling the brightness through this interface when the embedded controller is used for brightness control. When this WMI interface is present and indicates that the EC is used, then this interface should be used for brightness control. Changes in v2: - Use the new shared nvidia-wmi-ec-backlight.h header for the WMI firmware API definitions - ACPI_VIDEO can now be enabled on non X86 too, adjust the Kconfig changes to match this. Changes in v3: - Use WMI_BRIGHTNESS_GUID define Acked-by: Rafael J. Wysocki Reviewed-by: Daniel Dadap Signed-off-by: Hans de Goede commit b39be9f441f9d7320e6020bdf8ec1522d6c81d1e Author: Hans de Goede Date: Sat Jun 4 14:38:24 2022 +0200 ACPI: video: Refactor acpi_video_get_backlight_type() a bit Refactor acpi_video_get_backlight_type() so that the heuristics / detection steps are stricly in order of descending precedence. Also move the comments describing the steps to when the various steps are actually done, to avoid the comments getting out of sync with the code. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 3db2aeb121b9c54f52c399b8905c2bbbf201b7b5 Author: Hans de Goede Date: Wed Aug 17 14:03:32 2022 +0200 platform/x86: nvidia-wmi-ec-backlight: Move fw interface definitions to a header (v2) Move the WMI interface definitions to a header, so that the definitions can be shared with drivers/acpi/video_detect.c . Changes in v2: - Add missing Nvidia copyright header - Move WMI_BRIGHTNESS_GUID to nvidia-wmi-ec-backlight.h as well Suggested-by: Daniel Dadap Reviewed-by: Daniel Dadap Signed-off-by: Hans de Goede commit 5e0e33f92ea5d891ea37fbc5119031024c154805 Author: Hans de Goede Date: Mon May 16 16:04:17 2022 +0200 drm/radeon: Register ACPI video backlight when skipping radeon backlight registration Typically the acpi_video driver will initialize before radeon, which used to cause /sys/class/backlight/acpi_video0 to get registered and then radeon would register its own radeon_bl# device later. After which the drivers/acpi/video_detect.c code unregistered the acpi_video0 device to avoid there being 2 backlight devices. This means that userspace used to briefly see 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this the ACPI video code has been modified to make backlight class device registration a separate step, relying on the drm/kms driver to ask for the acpi_video backlight registration after it is done setting up its native backlight device. Add a call to the new acpi_video_register_backlight() when radeon skips registering its own backlight device because of e.g. the firmware_flags or the acpi_video_get_backlight_type() return value. This ensures that if the acpi_video backlight device should be used, it will be available before the radeon drm_device gets registered with userspace. Acked-by: Alex Deucher Signed-off-by: Hans de Goede commit c0f50c5de93b8afb2281009a33c124e82973e457 Author: Hans de Goede Date: Mon May 16 11:32:33 2022 +0200 drm/amdgpu: Register ACPI video backlight when skipping amdgpu backlight registration Typically the acpi_video driver will initialize before amdgpu, which used to cause /sys/class/backlight/acpi_video0 to get registered and then amdgpu would register its own amdgpu_bl# device later. After which the drivers/acpi/video_detect.c code unregistered the acpi_video0 device to avoid there being 2 backlight devices. This means that userspace used to briefly see 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this the ACPI video code has been modified to make backlight class device registration a separate step, relying on the drm/kms driver to ask for the acpi_video backlight registration after it is done setting up its native backlight device. Add a call to the new acpi_video_register_backlight() when amdgpu skips registering its own backlight device because of either the firmware_flags or the acpi_video_get_backlight_type() return value. This ensures that if the acpi_video backlight device should be used, it will be available before the amdgpu drm_device gets registered with userspace. Acked-by: Alex Deucher Signed-off-by: Hans de Goede commit c053383813fd17296db99cea78e058ed4d53019c Author: Hans de Goede Date: Sat Apr 30 14:29:00 2022 +0200 drm/nouveau: Register ACPI video backlight when nv_backlight registration fails (v2) Typically the acpi_video driver will initialize before nouveau, which used to cause /sys/class/backlight/acpi_video0 to get registered and then nouveau would register its own nv_backlight device later. After which the drivers/acpi/video_detect.c code unregistered the acpi_video0 device to avoid there being 2 backlight devices. This means that userspace used to briefly see 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this the ACPI video code has been modified to make backlight class device registration a separate step, relying on the drm/kms driver to ask for the acpi_video backlight registration after it is done setting up its native backlight device. Add a call to the new acpi_video_register_backlight() when native backlight device registration has failed / was skipped to ensure that there is a backlight device available before the drm_device gets registered with userspace. Changes in v2: - Add nouveau_acpi_video_register_backlight() wrapper to avoid unresolved symbol errors on non X86 Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede commit 3c8b6a399e0eaa6ab839bba2ce9a2bc57e6708d6 Author: Hans de Goede Date: Sat Apr 30 15:54:36 2022 +0200 drm/i915: Call acpi_video_register_backlight() (v3) On machins without an i915 opregion the acpi_video driver immediately probes the ACPI video bus and used to also immediately register acpi_video# backlight devices when supported. Once the drm/kms driver then loaded later and possibly registered a native backlight device then the drivers/acpi/video_detect.c code unregistered the acpi_video0 device to avoid there being 2 backlight devices (when acpi_video_get_backlight_type()==native). This means that userspace used to briefly see 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this the ACPI video code has been modified to make backlight class device registration a separate step, relying on the drm/kms driver to ask for the acpi_video backlight registration after it is done setting up its native backlight device. Add a call to the new acpi_video_register_backlight() after the i915 calls acpi_video_register() (after setting up the i915 opregion) so that the acpi_video backlight devices get registered on systems where the i915 native backlight device is not registered. Changes in v2: -Only call acpi_video_register_backlight() when a panel is detected Changes in v3: -Add a new intel_acpi_video_register() helper which checks if a panel is present and then calls acpi_video_register_backlight() Reviewed-by: Jani Nikula Signed-off-by: Hans de Goede commit 25899c590cb5ba9b9f284c6ca8e7e9086793d641 Author: Ville Syrjälä Date: Fri Sep 2 10:03:18 2022 +0300 drm/i915: Implement WaEdpLinkRateDataReload A lot of modern laptops use the Parade PS8461E MUX for eDP switching. The MUX can operate in jitter cleaning mode or redriver mode, the first one resulting in higher link quality. The jitter cleaning mode needs to know the link rate used and the MUX achieves this by snooping the LINK_BW_SET, LINK_RATE_SELECT and SUPPORTED_LINK_RATES DPCD accesses. When the MUX is powered down (seems this can happen whenever the display is turned off) it loses track of the snooped link rates so when we do the LINK_RATE_SELECT write it no longer knowns which link rate we're selecting, and thus it falls back to the lower quality redriver mode. This results in unstable high link rates (eg. usually 8.1Gbps link rate no longer works correctly). In order to avoid all that let's re-snoop SUPPORTED_LINK_RATES from the sink at the start of every link training. Unfortunately we don't have a way to detect the presence of the MUX. It looks like the set of laptops equipped with this MUX is fairly large and contains devices from multiple manufacturers. It may also still be growing with new models. So a quirk doesn't seem like a very easily maintainable option, thus we shall attempt to do this unconditionally on all machines that use LINK_RATE_SELECT. Hopefully this extra DPCD read doesn't cause issues for any unaffected machine. If that turns out to be the case we'll need to convert this into a quirk in the future. Cc: stable@vger.kernel.org Cc: Jason A. Donenfeld Cc: Ankit Nautiyal Cc: Jani Nikula Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6205 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220902070319.15395-1-ville.syrjala@linux.intel.com Tested-by: Aaron Ma Tested-by: Jason A. Donenfeld Reviewed-by: Jani Nikula commit aa3fab0110580aaeb9422e73b031822990651552 Merge: 40c79ce13b035 d59f4e1d1fe78 Author: David S. Miller Date: Sat Sep 3 10:40:40 2022 +0100 Merge branch 'net_sched-redundant-resource-cleanups' Zhengchao Shao says: ==================== net: sched: remove redundant resource cleanup when init() fails qdisc_create() calls .init() to initialize qdisc. If the initialization fails, qdisc_create() will call .destroy() to release resources. ==================== Signed-off-by: David S. Miller commit d59f4e1d1fe785e85c33f62136d93c8ea429442f Author: Zhengchao Shao Date: Fri Sep 2 16:34:30 2022 +0800 net: sched: htb: remove redundant resource cleanup in htb_init() If htb_init() fails, qdisc_create() invokes htb_destroy() to clear resources. Therefore, remove redundant resource cleanup in htb_init(). Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 494f5063b86cd6e972cb41a27e083c9a3664319d Author: Zhengchao Shao Date: Fri Sep 2 16:34:29 2022 +0800 net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init() If fq_codel_init() fails, qdisc_create() invokes fq_codel_destroy() to clear resources. Therefore, remove redundant resource cleanup in fq_codel_init(). Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 40c79ce13b035b0dbe177b9095a1a3df0cb5297b Author: Wei Fang Date: Fri Sep 2 10:30:01 2022 +0800 net: fec: add stop mode support for imx8 platform The current driver support stop mode by calling machine api. The patch add dts support to set GPR register for stop request. imx8mq enter stop/exit stop mode by setting GPR bit, which can be accessed by A core. imx8qm enter stop/exit stop mode by calling IMX_SC ipc APIs that communicate with M core ipc service, and the M core set the related GPR bit at last. Signed-off-by: Wei Fang Signed-off-by: David S. Miller commit e26c258434b8b85705884dd838cae89b5c1af2be Author: André Apitzsch Date: Thu Sep 1 19:00:13 2022 +0200 r8152: Add MAC passthrough support for Lenovo Travel Hub The Lenovo USB-C Travel Hub supports MAC passthrough. Signed-off-by: André Apitzsch Signed-off-by: David S. Miller commit 5854a09b49574da5a77a0f36ad7b021a2661321d Author: Gustavo A. R. Silva Date: Wed Aug 31 14:12:42 2022 -0500 net/ipv4: Use __DECLARE_FLEX_ARRAY() helper We now have a cleaner way to keep compatibility with user-space (a.k.a. not breaking it) when we need to keep in place a one-element array (for its use in user-space) together with a flexible-array member (for its use in kernel-space) without making it hard to read at the source level. This is through the use of the new __DECLARE_FLEX_ARRAY() helper macro. The size and memory layout of the structure is preserved after the changes. See below. Before changes: $ pahole -C ip_msfilter net/ipv4/igmp.o struct ip_msfilter { union { struct { __be32 imsf_multiaddr_aux; /* 0 4 */ __be32 imsf_interface_aux; /* 4 4 */ __u32 imsf_fmode_aux; /* 8 4 */ __u32 imsf_numsrc_aux; /* 12 4 */ __be32 imsf_slist[1]; /* 16 4 */ }; /* 0 20 */ struct { __be32 imsf_multiaddr; /* 0 4 */ __be32 imsf_interface; /* 4 4 */ __u32 imsf_fmode; /* 8 4 */ __u32 imsf_numsrc; /* 12 4 */ __be32 imsf_slist_flex[0]; /* 16 0 */ }; /* 0 16 */ }; /* 0 20 */ /* size: 20, cachelines: 1, members: 1 */ /* last cacheline: 20 bytes */ }; After changes: $ pahole -C ip_msfilter net/ipv4/igmp.o struct ip_msfilter { __be32 imsf_multiaddr; /* 0 4 */ __be32 imsf_interface; /* 4 4 */ __u32 imsf_fmode; /* 8 4 */ __u32 imsf_numsrc; /* 12 4 */ union { __be32 imsf_slist[1]; /* 16 4 */ struct { struct { } __empty_imsf_slist_flex; /* 16 0 */ __be32 imsf_slist_flex[0]; /* 16 0 */ }; /* 16 0 */ }; /* 16 4 */ /* size: 20, cachelines: 1, members: 5 */ /* last cacheline: 20 bytes */ }; In the past, we had to duplicate the whole original structure within a union, and update the names of all the members. Now, we just need to declare the flexible-array member to be used in kernel-space through the __DECLARE_FLEX_ARRAY() helper together with the one-element array, within a union. This makes the source code more clean and easier to read. Link: https://github.com/KSPP/linux/issues/193 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 2e5fb3223261366d1673c3827190c85a74b1aa56 Author: Zhengchao Shao Date: Thu Sep 1 09:16:17 2022 +0800 net/sched: cls_api: remove redundant 0 check in tcf_qevent_init() tcf_qevent_parse_block_index() never returns a zero block_index. Therefore, it is unnecessary to check the value of block_index in tcf_qevent_init(). Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220901011617.14105-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit c8ef3c94bda0e21123202d057d4a299698fa0ed9 Author: GUO Zihua Date: Fri Sep 2 16:15:21 2022 +0800 net: lantiq_etop: Fix return type for implementation of ndo_start_xmit Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic. ltq_etop_tx() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220902081521.59867-1-guozihua@huawei.com Signed-off-by: Jakub Kicinski commit 7b620e156097028e4c9b6481a84ec1e1e72877ca Author: GUO Zihua Date: Fri Sep 2 16:15:50 2022 +0800 net: sunplus: Fix return type for implementation of ndo_start_xmit Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic. spl2sw_ethernet_start_xmit() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220902081550.60095-1-guozihua@huawei.com Signed-off-by: Jakub Kicinski commit 0dbaf0fa62329d9fe452d9041a707a33f6274f1f Author: GUO Zihua Date: Fri Sep 2 16:16:12 2022 +0800 net: xscale: Fix return type for implementation of ndo_start_xmit Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic. eth_xmit() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly. Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20220902081612.60405-1-guozihua@huawei.com Signed-off-by: Jakub Kicinski commit 12f7bd252221d4f9e000e20530e50129241e3a67 Author: GUO Zihua Date: Fri Sep 2 15:54:07 2022 +0800 net: broadcom: Fix return type for implementation of Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic. bcm4908_enet_start_xmit() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly. Signed-off-by: GUO Zihua Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220902075407.52358-1-guozihua@huawei.com Signed-off-by: Jakub Kicinski commit 6497c72e5cc43e04399c0c25150f5278fa44ce0f Author: Peng Fan Date: Tue Aug 23 11:02:14 2022 +0800 ARM: dts: imx7ulp: Add IPG clock for lpi2c LPI2C requires two clocks, add the missed IPG clock. Reviewed-by: Dong Aisheng Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 0d7d8861029a98d25c076092ffee3d7f00cbe5f9 Author: Peng Fan Date: Tue Aug 23 11:02:09 2022 +0800 ARM: dts: imx7ulp: update the LPI2C clock-names The clock name should be per clock, not ipg clock. Reviewed-by: Dong Aisheng Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 0b20a133c0944c1f9ca97404b7805cb9c9cf32e0 Merge: af515a5587b8f f649f992deeea Author: Alexei Starovoitov Date: Fri Sep 2 20:34:32 2022 -0700 Merge branch 'bpf: net: Remove duplicated code from bpf_getsockopt()' Martin KaFai Lau says: ==================== From: Martin KaFai Lau The earlier commits [0] removed duplicated code from bpf_setsockopt(). This series is to remove duplicated code from bpf_getsockopt(). Unlike the setsockopt() which had already changed to take the sockptr_t argument, the same has not been done to getsockopt(). This is the extra step being done in this series. [0]: https://lore.kernel.org/all/20220817061704.4174272-1-kafai@fb.com/ v2: - The previous v2 did not reach the list. It is a resend. - Add comments on bpf_getsockopt() should not free the saved_syn (Stanislav) - Explicitly null-terminate the tcp-cc name (Stanislav) ==================== Reviewed-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov commit f649f992deeeab020257b886e054cc407154cbfc Author: Martin KaFai Lau Date: Thu Sep 1 17:29:37 2022 -0700 selftest/bpf: Add test for bpf_getsockopt() This patch removes the __bpf_getsockopt() which directly reads the sk by using PTR_TO_BTF_ID. Instead, the test now directly uses the kernel bpf helper bpf_getsockopt() which supports all the required optname now. TCP_SAVE[D]_SYN and TCP_MAXSEG are not tested in a loop for all the hooks and sock_ops's cb. TCP_SAVE[D]_SYN only works in passive connection. TCP_MAXSEG only works when it is setsockopt before the connection is established and the getsockopt return value can only be tested after the connection is established. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002937.2896904-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 38566ec06f52250c4abaa7447aae676e0b881c46 Author: Martin KaFai Lau Date: Thu Sep 1 17:29:31 2022 -0700 bpf: Change bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt() This patch changes bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt(). It removes the duplicated code from bpf_getsockopt(SOL_IPV6). This also makes bpf_getsockopt(SOL_IPV6) supporting the same set of optnames as in bpf_setsockopt(SOL_IPV6). In particular, this adds IPV6_AUTOFLOWLABEL support to bpf_getsockopt(SOL_IPV6). ipv6 could be compiled as a module. Like how other code solved it with stubs in ipv6_stubs.h, this patch adds the do_ipv6_getsockopt to the ipv6_bpf_stub. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002931.2896218-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit fd969f25fe24be515278d28cbf86dde39be8a495 Author: Martin KaFai Lau Date: Thu Sep 1 17:29:25 2022 -0700 bpf: Change bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt() This patch changes bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt() and remove the duplicated code. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002925.2895416-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 273b7f0fb44847c41814a59901977be284daa447 Author: Martin KaFai Lau Date: Thu Sep 1 17:29:18 2022 -0700 bpf: Change bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt() This patch changes bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt(). It removes the duplicated code from bpf_getsockopt(SOL_TCP). Before this patch, there were some optnames available to bpf_setsockopt(SOL_TCP) but missing in bpf_getsockopt(SOL_TCP). For example, TCP_NODELAY, TCP_MAXSEG, TCP_KEEPIDLE, TCP_KEEPINTVL, and a few more. It surprises users from time to time. This patch automatically closes this gap without duplicating more code. bpf_getsockopt(TCP_SAVED_SYN) does not free the saved_syn, so it stays in sol_tcp_sockopt(). For string name value like TCP_CONGESTION, bpf expects it is always null terminated, so sol_tcp_sockopt() decrements optlen by one before calling do_tcp_getsockopt() and the 'if (optlen < saved_optlen) memset(..,0,..);' in __bpf_getsockopt() will always do a null termination. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002918.2894511-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 65ddc82d3b96be5555a36de4e2b4547433a00532 Author: Martin KaFai Lau Date: Thu Sep 1 17:29:12 2022 -0700 bpf: Change bpf_getsockopt(SOL_SOCKET) to reuse sk_getsockopt() This patch changes bpf_getsockopt(SOL_SOCKET) to reuse sk_getsockopt(). It removes all duplicated code from bpf_getsockopt(SOL_SOCKET). Before this patch, there were some optnames available to bpf_setsockopt(SOL_SOCKET) but missing in bpf_getsockopt(SOL_SOCKET). It surprises users from time to time. For example, SO_REUSEADDR, SO_KEEPALIVE, SO_RCVLOWAT, and SO_MAX_PACING_RATE. This patch automatically closes this gap without duplicating more code. The only exception is SO_BINDTODEVICE because it needs to acquire a blocking lock. Thus, SO_BINDTODEVICE is not supported. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002912.2894040-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit c2b063ca34586758dcfd76e12696a71a1df849a0 Author: Martin KaFai Lau Date: Thu Sep 1 17:29:06 2022 -0700 bpf: Embed kernel CONFIG check into the if statement in bpf_getsockopt This patch moves the "#ifdef CONFIG_XXX" check into the "if/else" statement itself. The change is done for the bpf_getsockopt() function only. It will make the latter patches easier to follow without the surrounding ifdef macro. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002906.2893572-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 0f95f7d42611882a9a6250923dd493951a94961a Author: Martin KaFai Lau Date: Thu Sep 1 17:28:59 2022 -0700 bpf: net: Avoid do_ipv6_getsockopt() taking sk lock when called from bpf Similar to the earlier patch that changes sk_getsockopt() to use sockopt_{lock,release}_sock() such that it can avoid taking the lock when called from bpf. This patch also changes do_ipv6_getsockopt() to use sockopt_{lock,release}_sock() such that bpf_getsockopt(SOL_IPV6) can reuse do_ipv6_getsockopt(). Although bpf_getsockopt(SOL_IPV6) currently does not support optname that requires lock_sock(), using sockopt_{lock,release}_sock() consistently across *_getsockopt() will make future optname addition harder to miss the sockopt_{lock,release}_sock() usage. eg. when adding new optname that requires a lock and the new optname is needed in bpf_getsockopt() also. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002859.2893064-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 6dadbe4bac68309eb46ab0f30e8ff47a789df49a Author: Martin KaFai Lau Date: Thu Sep 1 17:28:53 2022 -0700 bpf: net: Change do_ipv6_getsockopt() to take the sockptr_t argument Similar to the earlier patch that changes sk_getsockopt() to take the sockptr_t argument . This patch also changes do_ipv6_getsockopt() to take the sockptr_t argument such that a latter patch can make bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt(). Note on the change in ip6_mc_msfget(). This function is to return an array of sockaddr_storage in optval. This function is shared between ipv6_get_msfilter() and compat_ipv6_get_msfilter(). However, the sockaddr_storage is stored at different offset of the optval because of the difference between group_filter and compat_group_filter. Thus, a new 'ss_offset' argument is added to ip6_mc_msfget(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002853.2892532-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 9c3f9707decd67e48fc600f6e4adcdab3fe0878d Author: Martin KaFai Lau Date: Thu Sep 1 17:28:46 2022 -0700 net: Add a len argument to compat_ipv6_get_msfilter() Pass the len to the compat_ipv6_get_msfilter() instead of compat_ipv6_get_msfilter() getting it again from optlen. Its counter part ipv6_get_msfilter() is also taking the len from do_ipv6_getsockopt(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002846.2892091-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 75f23979888a8cd9aff9ac41e517f7798a95306d Author: Martin KaFai Lau Date: Thu Sep 1 17:28:40 2022 -0700 net: Remove unused flags argument from do_ipv6_getsockopt The 'unsigned int flags' argument is always 0, so it can be removed. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002840.2891763-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 1985320c54dd51ea45641af0c69087347965ff25 Author: Martin KaFai Lau Date: Thu Sep 1 17:28:34 2022 -0700 bpf: net: Avoid do_ip_getsockopt() taking sk lock when called from bpf Similar to the earlier commit that changed sk_setsockopt() to use sockopt_{lock,release}_sock() such that it can avoid taking lock when called from bpf. This patch also changes do_ip_getsockopt() to use sockopt_{lock,release}_sock() such that a latter patch can make bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002834.2891514-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 728f064cd7ebea8c182e99e6f152c8b4a0a6b071 Author: Martin KaFai Lau Date: Thu Sep 1 17:28:28 2022 -0700 bpf: net: Change do_ip_getsockopt() to take the sockptr_t argument Similar to the earlier patch that changes sk_getsockopt() to take the sockptr_t argument. This patch also changes do_ip_getsockopt() to take the sockptr_t argument such that a latter patch can make bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt(). Note on the change in ip_mc_gsfget(). This function is to return an array of sockaddr_storage in optval. This function is shared between ip_get_mcast_msfilter() and compat_ip_get_mcast_msfilter(). However, the sockaddr_storage is stored at different offset of the optval because of the difference between group_filter and compat_group_filter. Thus, a new 'ss_offset' argument is added to ip_mc_gsfget(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002828.2890585-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit d51bbff2aba7880c669e3ed1b4a5a64fed684bf0 Author: Martin KaFai Lau Date: Thu Sep 1 17:28:21 2022 -0700 bpf: net: Avoid do_tcp_getsockopt() taking sk lock when called from bpf Similar to the earlier commit that changed sk_setsockopt() to use sockopt_{lock,release}_sock() such that it can avoid taking lock when called from bpf. This patch also changes do_tcp_getsockopt() to use sockopt_{lock,release}_sock() such that a latter patch can make bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002821.2889765-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 34704ef024ae6167c7ae9e67f671eb6bc1962c90 Author: Martin KaFai Lau Date: Thu Sep 1 17:28:15 2022 -0700 bpf: net: Change do_tcp_getsockopt() to take the sockptr_t argument Similar to the earlier patch that changes sk_getsockopt() to take the sockptr_t argument . This patch also changes do_tcp_getsockopt() to take the sockptr_t argument such that a latter patch can make bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt(). Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002815.2889332-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 2c5b6bf5cda048af896bb0e12a956783f7d6c835 Author: Martin KaFai Lau Date: Thu Sep 1 17:28:09 2022 -0700 bpf: net: Avoid sk_getsockopt() taking sk lock when called from bpf Similar to the earlier commit that changed sk_setsockopt() to use sockopt_{lock,release}_sock() such that it can avoid taking lock when called from bpf. This patch also changes sk_getsockopt() to use sockopt_{lock,release}_sock() such that a latter patch can make bpf_getsockopt(SOL_SOCKET) to reuse sk_getsockopt(). Only sk_get_filter() requires this change and it is used by the optname SO_GET_FILTER. The '.getname' implementations in sock->ops->getname() is not changed also since bpf does not always have the sk->sk_socket pointer and cannot support SO_PEERNAME. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002809.2888981-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 4ff09db1b79b98b4a2a7511571c640b76cab3beb Author: Martin KaFai Lau Date: Thu Sep 1 17:28:02 2022 -0700 bpf: net: Change sk_getsockopt() to take the sockptr_t argument This patch changes sk_getsockopt() to take the sockptr_t argument such that it can be used by bpf_getsockopt(SOL_SOCKET) in a latter patch. security_socket_getpeersec_stream() is not changed. It stays with the __user ptr (optval.user and optlen.user) to avoid changes to other security hooks. bpf_getsockopt(SOL_SOCKET) also does not support SO_PEERSEC. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002802.2888419-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit ba74a7608dc12fbbd8ea36e660087f08a81ef26a Author: Martin KaFai Lau Date: Thu Sep 1 17:27:56 2022 -0700 net: Change sock_getsockopt() to take the sk ptr instead of the sock ptr A latter patch refactors bpf_getsockopt(SOL_SOCKET) with the sock_getsockopt() to avoid code duplication and code drift between the two duplicates. The current sock_getsockopt() takes sock ptr as the argument. The very first thing of this function is to get back the sk ptr by 'sk = sock->sk'. bpf_getsockopt() could be called when the sk does not have the sock ptr created. Meaning sk->sk_socket is NULL. For example, when a passive tcp connection has just been established but has yet been accept()-ed. Thus, it cannot use the sock_getsockopt(sk->sk_socket) or else it will pass a NULL ptr. This patch moves all sock_getsockopt implementation to the newly added sk_getsockopt(). The new sk_getsockopt() takes a sk ptr and immediately gets the sock ptr by 'sock = sk->sk_socket' The existing sock_getsockopt(sock) is changed to call sk_getsockopt(sock->sk). All existing callers have both sock->sk and sk->sk_socket pointer. The latter patch will make bpf_getsockopt(SOL_SOCKET) call sk_getsockopt(sk) directly. The bpf_getsockopt(SOL_SOCKET) does not use the optnames that require sk->sk_socket, so it will be safe. Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220902002756.2887884-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 8254393663f9b8cb8b84cdce1abb118833c22a54 Author: Gal Pressman Date: Thu Sep 1 20:06:20 2022 -0700 net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled, NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation error: net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'? 2503 | .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | NL802154_CMD_SET_CCA_ED_LEVEL Unhide the experimental commands, having them defined in an enum makes no difference. Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes") Signed-off-by: Gal Pressman Acked-by: Stefan Schmidt Tested-by: Sudip Mukherjee Link: https://lore.kernel.org/r/20220902030620.2737091-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit efa80587f29f12cd3198651aa9772d68497ff5c7 Author: Marcel Ziswiler Date: Fri Aug 19 11:43:54 2022 +0200 ARM: dts: vf610: ddr pinmux Add DDR pinmux which may be used in U-Boot after synchronising all them device trees (and includes) from Linux. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 1074e1d23a5c201b6558878a09f1d2b7c9506835 Author: Andy Shevchenko Date: Wed Aug 31 16:55:12 2022 +0300 pinctrl: pistachio: Switch to use fwnode instead of GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220831135512.78407-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 42eae17d56079591f945e409a4159e750ccc57df Author: Claudiu Beznea Date: Wed Aug 31 16:56:36 2022 +0300 pinctrl: at91: use dev_dbg() instead of printk() Use dev_dbg() instead of printk(KERN_DEBUG) to avoid the following checkpatch.pl warning: "Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...". Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220831135636.3176406-4-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij commit a575207583676298f3999d41d86d81f7172fe950 Author: Claudiu Beznea Date: Wed Aug 31 16:56:35 2022 +0300 pinctrl: at91: move gpio suspend/resume calls to driver's context Move gpio suspend/resume execution local to driver and let it execute as close as possible to the moment the machine specific PM code is executed (by setting it to .noirq member of dev_pm_ops). With this the at91_pinctrl_gpio_suspend()/at91_pinctrl_gpio_resume() calls were removed from arch/arm/mach-at91/pm.c and also a header has been removed. The patch has been checked on sama5d3_xplained, sam9x60ek, sama5d2_xplained, sama7g5ek boards. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220831135636.3176406-3-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij commit 7fec8c9ceeedbe29be64c1b0a0610d40de39fcf8 Author: Claudiu Beznea Date: Wed Aug 31 16:56:34 2022 +0300 pinctrl: at91: use kernel-doc style for documentation of at91_gpio_chip Use kernel-doc style for documentation of struct at91_gpio_chip. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220831135636.3176406-2-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij commit f23b373f30fc9a8e77dec82d2a3d583c1eef155e Author: Andy Shevchenko Date: Tue Aug 30 20:58:50 2022 +0300 pinctrl: mcp23s08: Drop assignment of default number of OF cells The GPIO library code will assign default value for number of OF cells, no need to repeat this in the driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220830175850.44770-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 4cfb310bcd8fdbe4fce1366f9d558a141e6635cb Merge: 87c2a29a6bf1a 96355be8f0a2a Author: Linus Walleij Date: Sat Sep 3 00:09:42 2022 +0200 Merge tag 'renesas-pinctrl-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.1 - Document pin control support for the RZ/Five SoC. commit 06564be4c03ff0e0b88c5a4a14a6527fcb070ffd Author: ye xingchen Date: Fri Aug 26 07:19:54 2022 +0000 rpmsg: char: Remove the unneeded result variable Return the value rpmsg_chrdev_eptdev_add() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220826071954.252485-1-ye.xingchen@zte.com.cn Signed-off-by: Mathieu Poirier commit 12c5b70c1897288ee6c841b5cc3ff4d27d511bd1 Author: Jens Axboe Date: Fri Sep 2 10:40:11 2022 -0600 block: enable per-cpu bio caching for the fs bio set This is useful for polled IO on a file, or for polled IO with the io_uring passthrough mechanism. If bio allocations are done with REQ_POLLED for those cases, then initializing the bio set with BIOSET_PERCPU_CACHE enables the local per-cpu cache which eliminates allocations (and frees) of bio structs when possible. Reviewed-by: Kanchan Joshi Signed-off-by: Jens Axboe commit c68cd258a67730c24566b9688d7c134e67459ac6 Author: Peng Fan Date: Mon Aug 15 09:34:28 2022 +0800 clk: imx8mp: tune the order of enet_qos_root_clk The enet_qos_root_clk takes sim_enet_root_clk as parent. When registering enet_qos_root_clk, it will be put into clk orphan list, because sim_enet_root_clk is not ready. When sim_enet_root_clk is ready, clk_core_reparent_orphans_nolock will set enet_qos_root_clk parent to sim_enet_root_clk. Because CLK_OPS_PARENT_ENABLE is set, sim_enet_root_clk will be enabled and disabled during the enet_qos_root_clk reparent phase. All the above are correct. But with M7 booted early and using enet, M7 enet feature will be broken, because clk driver probe phase disable the needed clks, in case M7 firmware not configure sim_enet_root_clk. And tune the order would also save cpu cycles. Reviewed-by: Ye Li Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220815013428.476015-1-peng.fan@oss.nxp.com commit 29c99fb085ad53e6d5504d1f8d32e6673b9b3a2c Author: Michael Riesch Date: Wed Jul 20 11:15:26 2022 +0200 phy: rockchip: add support for the rk356x variant to rockchip-inno-csidphy This adds support for variant found in Rockchip RK356x SoCs. Note that only the basic operating mode is supported, in which all four CSI lines are controlled by the Rockchip ISP. Signed-off-by: Michael Riesch Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220720091527.1270365-3-michael.riesch@wolfvision.net Signed-off-by: Vinod Koul commit 22c8e0a69b7f1920cdac06bd8432bf5807176f2d Author: Michael Riesch Date: Wed Jul 20 11:15:25 2022 +0200 dt-bindings: phy: add compatible for rk356x to rockchip-inno-csi-dphy The driver for the Innosilicon MIPI CSI DPHY is compatible with the variant in the Rockchip RK356x SoCs. Add the compatible string to the binding. Signed-off-by: Michael Riesch Reviewed-by: Heiko Stuebner Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220720091527.1270365-2-michael.riesch@wolfvision.net Signed-off-by: Vinod Koul commit 9f38c76e7487721acd58ade4781fae59b5f5b673 Author: Krzysztof Kozlowski Date: Tue Aug 16 16:21:31 2022 +0300 dt-bindings: phy: Update Pratyush Yadav's email Emails to Pratyush Yadav bounce ("550 Invalid recipient"), so update to match one in commit 92714596cdbe ("MAINTAINERS: Use my kernel.org email"). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220816132131.75591-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit f2e35c75893c28ebc12f8efbc1d13b8530d19263 Author: Bjorn Andersson Date: Fri Aug 5 08:44:32 2022 -0700 phy: qcom: edp: Postpone clk_set_rate until the PLL is up When the platform was booted with the involved clocks enabled the clk_set_rate() of the link and pixel clocks will perculate to the children, which will fail to update because the PHY driver has just shut down the PLL. Postpone the clock rate updates until the PLL is back online to avoid reconfiguring the clocks while the PLL is not ticking. Fixes: f199223cb490 ("phy: qcom: Introduce new eDP PHY driver") Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805154432.546740-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit ce9564cfc9aea65e68eb343c599317633bc2321a Author: Chris Morgan Date: Fri Sep 2 10:39:06 2022 -0500 drm/bridge: chrontel-ch7033: Add byteswap order setting Add the option to set the byteswap order in the devicetree. For the official HDMI DIP for the NTC CHIP the byteswap order needs to be RGB, however the driver sets it as BGR. With this patch the driver will remain at BGR unless manually specified via devicetree. Signed-off-by: Chris Morgan Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220902153906.31000-3-macroalpha82@gmail.com commit a4be71430c76eca43679e8485085c230afa84460 Author: Chris Morgan Date: Fri Sep 2 10:39:05 2022 -0500 dt-bindings: Add byteswap order to chrontel ch7033 Update dt-binding documentation to add support for setting byteswap of chrontel ch7033. New property name of chrontel,byteswap added to set the byteswap order. This property is optional. Signed-off-by: Chris Morgan Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220902153906.31000-2-macroalpha82@gmail.com commit c312b0df3b13e4c533743bb2c37fd1bc237368e5 Author: Laurent Pinchart Date: Wed Aug 31 11:26:53 2022 +0300 drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP Implement the bridge connector-related .get_edid() and .detect() operations for full DP mode, and report the related bridge capabilities and type. Signed-off-by: Laurent Pinchart Signed-off-by: Kieran Bingham Signed-off-by: Tomi Valkeinen Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220831082653.20449-4-tomi.valkeinen@ideasonboard.com commit e43d5864f36ab32f831b1af7bc2171031e58e2ac Author: Laurent Pinchart Date: Wed Aug 31 11:26:52 2022 +0300 drm/bridge: ti-sn65dsi86: Support DisplayPort (non-eDP) mode Despite the SN65DSI86 being an eDP bridge, on some systems its output is routed to a DisplayPort connector. Enable DisplayPort mode when the next component in the display pipeline is detected as a DisplayPort connector, and disable eDP features in that case. Signed-off-by: Laurent Pinchart Reworked to set bridge type based on the next bridge/connector. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Douglas Anderson Signed-off-by: Tomi Valkeinen -- Changes since v1/RFC: - Rebased on top of "drm/bridge: ti-sn65dsi86: switch to devm_drm_of_get_bridge" - eDP/DP mode determined from the next bridge connector type. Changes since v2: - Remove setting of Standard DP Scrambler Seed. (It's read-only). - Prevent setting DP_EDP_CONFIGURATION_SET in ti_sn_bridge_atomic_enable() - Use Doug's suggested text for disabling ASSR on DP mode. Changes since v3: - Remove ASSR_CONTROL definition Changes since v4: - Refactor code to configure the DP/eDP scrambler in one place. Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220831082653.20449-3-tomi.valkeinen@ideasonboard.com commit 3fc307dcec8b9aeecae8c1bf2c97f770805daf4e Author: Tomi Valkeinen Date: Wed Aug 31 11:26:51 2022 +0300 drm/bridge: ti-sn65dsi86: Reject modes with too large blanking The front and back porch registers are 8 bits, and pulse width registers are 15 bits, so reject any modes with larger periods. Signed-off-by: Tomi Valkeinen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220831082653.20449-2-tomi.valkeinen@ideasonboard.com commit 2b14d382ec97ca5b420239ee6e16da390fab476c Author: Chris Packham Date: Thu Sep 1 14:28:08 2022 +1200 arm64: dts: marvell: 98dx25xx: use correct property for i2c gpios Use the correct names for scl-gpios and sda-gpios so that the generic i2c recovery code will find them. While we're here set the GPIO_OPEN_DRAIN flag on the gpios. Fixes: b795fadfc46b ("arm64: dts: marvell: Add Armada 98DX2530 SoC and RD-AC5X board") Signed-off-by: Chris Packham Signed-off-by: Gregory CLEMENT commit 1a9f9785a9abe3f55e874a47cb0c483c99b55e83 Author: Robert Marko Date: Mon May 16 14:48:28 2022 +0200 arm64: dts: marvell: add support for Methode eDPU Methode eDPU is an Armada 3720 powered board based on the Methode uDPU. They feature the same CPU, RAM, and storage as well as the form factor. However, eDPU only has one SFP slot plus a copper G.hn port. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 28175c6c1be262caca2d6803aca0327d944f73ab Author: Robert Marko Date: Mon May 16 14:48:27 2022 +0200 dt-bindings: marvell: armada-37xx: add Methode eDPU compatible Document compatible for the Methode eDPU Armada 3720 based board. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit ff5d694b03407c539895cd877f86512942a08307 Author: Robert Marko Date: Mon May 16 14:48:26 2022 +0200 arm64: dts: marvell: split Methode uDPU DTS Split the Methode uDPU DTS into a common DTSI as preparation for adding support for Methode eDPU which is based on the uDPU to avoid duplication. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 0caffb268dcdc4eb41288164101b80ec6960155d Author: Vincent Shih Date: Mon Jul 25 10:44:12 2022 +0800 dt-bindings: phy: Add bindings doc for Sunplus USB2 PHY driver Add bindings doc for Sunplus USB2 PHY driver Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Shih Link: https://lore.kernel.org/r/1658717052-26142-3-git-send-email-vincent.sunplus@gmail.com Signed-off-by: Vinod Koul commit 99d9ccd97385208b78b3d88e756451f4b70119fc Author: Vincent Shih Date: Mon Jul 25 10:44:11 2022 +0800 phy: usb: Add USB2.0 phy driver for Sunplus SP7021 Add USB2.0 phy driver for Sunplus SP7021 Signed-off-by: Vincent Shih Link: https://lore.kernel.org/r/1658717052-26142-2-git-send-email-vincent.sunplus@gmail.com [vkoul: remove trailing line in driver file] Signed-off-by: Vinod Koul commit 467b43a944b3c7810b600a0adc409be74ee1b8d0 Author: Pali Rohár Date: Wed Jul 27 15:16:19 2022 +0200 ARM: dts: armada-38x: Add gpio-ranges for pin muxing GPIOs are configured by pinmux driver, so add corresponding references. Fixes: 0d3d96ab0059 ("ARM: mvebu: add Device Tree description of the Armada 380/385 SoCs") Signed-off-by: Pali Rohár Signed-off-by: Gregory CLEMENT commit 565a6cf07d786598cfa52d91630d70f4ffc2a9e5 Author: Robert Marko Date: Mon May 16 14:48:25 2022 +0200 arm64: dts: marvell: rename temp sensor nodes Rename the temperature sensor nodes to use "temp-sensor" which matches their device class instead of IC specific naming. Remove the status = "okay" which is not required as its default anyway. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit c269d4207c85acafb0216427d1f3f7af61f00353 Author: Robert Marko Date: Mon May 16 14:48:24 2022 +0200 arm64: dts: marvell: uDPU: remove LED node pinctrl-names Using pinctrl-names requires the appropriate pinctrl-0 property, otherwise it is not utilized at all. Since its not required, just remove it. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit f035bbde57ad467285f89754a990a1067a0ecc36 Author: Robert Marko Date: Mon May 16 14:48:23 2022 +0200 arm64: dts: marvell: uDPU: align LED-s with bindings According to bindings they LED-s should be prefixed with "led" in this use case, so fix accordingly. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 380c94660642c11e968cb66be47a336e9829d018 Author: Robert Marko Date: Mon May 16 14:48:22 2022 +0200 arm64: dts: marvell: uDPU: add missing SoC compatible According to the bindings, all boards using Armada 37xx SoC-s must have "marvell,armada3710" compatible while 3720 based ones should also have "marvell,armada3720" before it. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 172f5fbd25a1710d23b9c066fdc23def338f5dc2 Author: Robert Marko Date: Mon May 16 14:48:21 2022 +0200 arm64: dts: marvell: espressobin-ultra: add generic Espressobin compatible Espressobin Ultra is part of the Espressobin family and shares the basic design, so add the generic "globalscale,espressobin" compatible to it as well. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 888d6ffa1b82c2329f2936f8d8eb90ee825d9d80 Author: Robert Marko Date: Mon May 16 14:48:20 2022 +0200 dt-bindings: marvell: convert Armada 37xx compatibles to YAML Convert the Armada 37xx SoC compatibles to YAML. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit ed276353a94033cf02a94c452ccdaf9f9c5c9846 Author: Robert Marko Date: Mon May 16 14:48:19 2022 +0200 dt-bindings: vendor-prefixes: add Methode Electronics Add vendor prefix for Methode Electronics, Inc. (https://www.methode.com) Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 39319cac50a28ea8801710148024186472d2cf08 Author: Pali Rohár Date: Thu Aug 18 01:00:36 2022 +0200 ARM: dts: dove: Add definitions for PCIe error interrupts First PCIe controller on Dove SoC reports error interrupt via IRQ 15 and second PCIe controller via IRQ 17. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit b332ce1b7acb7a6777096ad3aa33b7178dd504a6 Author: Pali Rohár Date: Thu Aug 18 01:00:35 2022 +0200 ARM: dts: kirkwood: Add definitions for PCIe error interrupts First PCIe controller on Kirkwood SoC reports error interrupt via IRQ 44 and second PCIe controller via IRQ 45. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 89074c2d28117909616e3349e4b9657541270472 Author: Pali Rohár Date: Tue Jul 12 18:41:08 2022 +0200 ARM: dts: armada-39x.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 5568352e716b7a41101e37c5f8465bf131af18f6 Author: Pali Rohár Date: Tue Jul 12 18:41:07 2022 +0200 ARM: dts: armada-380.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 2fa6afbaafda29c514f898e353fce05260b925f1 Author: Pali Rohár Date: Tue Jul 12 18:41:06 2022 +0200 ARM: dts: armada-375.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 1ba90924c37004006c03942514faf1bc6f80aed7 Author: Pali Rohár Date: Tue Jul 12 18:41:05 2022 +0200 ARM: dts: armada-xp-mv78460.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 2561806f3cd850ab2573f977408991263b2c4e11 Author: Pali Rohár Date: Tue Jul 12 18:41:04 2022 +0200 ARM: dts: armada-xp-mv78260.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit b4371d2978c2090c4f196b5bcdca1dec437d25eb Author: Pali Rohár Date: Tue Jul 12 18:41:03 2022 +0200 ARM: dts: armada-xp-mv78230.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 9271e56b033b8cc2108fe92dc47491ebd6526284 Author: Pali Rohár Date: Tue Jul 12 18:41:02 2022 +0200 ARM: dts: armada-xp-98dx3236.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 09cec023217663f01e8340da6e350c7851b2a76f Author: Pali Rohár Date: Tue Jul 12 18:41:01 2022 +0200 ARM: dts: armada-370.dtsi: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 5a203517db415045bf93d230bc19af52656c3692 Author: Pali Rohár Date: Tue Jul 12 18:41:00 2022 +0200 ARM: dts: dove: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 217dc618d5e87ac16389ecd6ab12ad54c0e5afde Author: Pali Rohár Date: Tue Jul 12 18:40:59 2022 +0200 ARM: dts: kirkwood: Add definitions for PCIe legacy INTx interrupts Add definitions for PCIe legacy INTx interrupts. This is required for example in a scenario where a driver requests only one of the legacy interrupts (INTA). Without this, the driver would be notified on events on all 4 (INTA, INTB, INTC, INTD), even if it requested only one of them. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit d3a7051841f0a4bcb1ee26a1b721c6150cc4c2b1 Author: Ville Syrjälä Date: Thu Aug 18 22:22:23 2022 +0300 drm/i915/bios: Use hardcoded fp_timing size for generating LFP data pointers The current scheme for generating the LFP data table pointers (when the block including them is missing from the VBT) expects the 0xffff sequence to only appear in the fp_timing terminator entries. However some VBTs also have extra 0xffff sequences elsewhere in the LFP data. When looking for the terminators we may end up finding those extra sequeneces insted, which means we deduce the wrong size for the fp_timing table. The code then notices the inconsistent looking values and gives up on the generated data table pointers, preventing us from parsing the LFP data table entirely. Let's give up on the "search for the terminators" approach and instead just hardcode the expected size for the fp_timing table. We have enough sanity checks in place to make sure we shouldn't end up parsing total garbage even if that size should change in the future (although that seems unlikely as the fp_timing and dvo_timing tables have been declared obsolete as of VBT version 229). Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6592 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220818192223.29881-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4e78d6023c15c6acce8fbe42e13027c460395522 Author: Ville Syrjälä Date: Thu Aug 18 22:22:22 2022 +0300 drm/i915/bios: Validate fp_timing terminator presence Validate the LFP data block a bit hardwer by making sure the fp_timing terminators (0xffff) are where we expect them to be. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220818192223.29881-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 2d528eda7c96ce5c70f895854ecd5684bd5d80b9 Author: Michael Walle Date: Tue Aug 16 02:10:25 2022 +0200 ARM: dts: kirkwood: lsxl: remove first ethernet port Both the Linkstation LS-CHLv2 and the LS-XHL have only one ethernet port. This has always been wrong, i.e. the board code used to set up both ports, but the driver will play nice and return -ENODEV if the assiciated PHY is not found. Nevertheless, it is wrong. Remove it. Fixes: 876e23333511 ("ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 04eabc6ac10fda9424606d9a7ab6ab9a5d95350a Author: Michael Walle Date: Tue Aug 16 02:10:24 2022 +0200 ARM: dts: kirkwood: lsxl: fix serial line Commit 327e15428977 ("ARM: dts: kirkwood: consolidate common pinctrl settings") unknowingly broke the serial output on this board. Before this commit, the pinmux was still configured by the bootloader and the kernel didn't reconfigured it again. This was an oversight by the initial board support where the pinmux for the serial line was never configured by the kernel. But with this commit, the serial line will be reconfigured to the wrong pins. This is especially confusing, because the output still works, but the input doesn't. Presumingly, the input is reconfigured to MPP10, but the output is connected to both MPP11 and MPP5. Override the pinmux in the board device tree. Fixes: 327e15428977 ("ARM: dts: kirkwood: consolidate common pinctrl settings") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 54d8a6b7f0e858ee5acc05a6ed0ac78ed0d562f1 Author: Krzysztof Kozlowski Date: Wed Aug 10 14:11:22 2022 +0300 ARM: dts: armada-xp: align SPI node name with dtschema The node names should be generic and DT schema expects certain pattern. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 31be791e26cf928695dba1477d62bbf55854931f Author: Chris Packham Date: Wed Aug 3 13:16:23 2022 +1200 arm64: dts: marvell: Add UART1-3 for AC5/AC5X The AC5/AC5X SoC has 4 UART blocks. Add the additional UART1-3 blocks to the base dtsi file. Signed-off-by: Chris Packham Signed-off-by: Gregory CLEMENT commit 49e93898f0dc177e645c22d0664813567fd9ec00 Author: Marek Behún Date: Wed Jul 27 14:56:10 2022 +0200 ARM: dts: turris-omnia: Fix mpp26 pin name and comment There is a bug in Turris Omnia's schematics, whereupon the MPP[26] pin, which is routed to CN11 pin header, is documented as SPI CS1, but MPP[26] pin does not support this function. Instead it controls chip select 2 if in "spi0" mode. Fix the name of the pin node in pinctrl node and fix the comment in SPI node. Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit af515a5587b8f45f19e11657746e0c89411b0380 Author: Ian Rogers Date: Thu Sep 1 13:26:45 2022 -0700 selftests/xsk: Avoid use-after-free on ctx The put lowers the reference count to 0 and frees ctx, reading it afterwards is invalid. Move the put after the uses and determine the last use by the reference count being 1. Fixes: 39e940d4abfa ("selftests/xsk: Destroy BPF resources only when ctx refcount drops to 0") Signed-off-by: Ian Rogers Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901202645.1463552-1-irogers@google.com commit afef88e65554c3e8691513b8350d6445e292560e Author: Daniel Müller Date: Thu Sep 1 22:22:53 2022 +0000 selftests/bpf: Store BPF object files with .bpf.o extension BPF object files are, in a way, the final artifact produced as part of the ahead-of-time compilation process. That makes them somewhat special compared to "regular" object files, which are a intermediate build artifacts that can typically be removed safely. As such, it can make sense to name them differently to make it easier to spot this difference at a glance. Among others, libbpf-bootstrap [0] has established the extension .bpf.o for BPF object files. It seems reasonable to follow this example and establish the same denomination for selftest build artifacts. To that end, this change adjusts the corresponding part of the build system and the test programs loading BPF object files to work with .bpf.o files. [0] https://github.com/libbpf/libbpf-bootstrap Suggested-by: Andrii Nakryiko Signed-off-by: Daniel Müller Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220901222253.1199242-1-deso@posteo.net commit fe2ad08e1e1df77b6941916b87d4871d751b88b6 Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:13 2022 +0200 selftests/xsk: Add support for zero copy testing Introduce new mode to xdpxceiver responsible for testing AF_XDP zero copy support of driver that serves underlying physical device. When setting up test suite, determine whether driver has ZC support or not by trying to bind XSK ZC socket to the interface. If it succeeded, interpret it as ZC support being in place and do softirq and busy poll tests for zero copy mode. Note that Rx dropped tests are skipped since ZC path is not touching rx_dropped stat at all. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-7-maciej.fijalkowski@intel.com commit c29fe883defcbc6cd16176787a2084b8e05dabf0 Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:12 2022 +0200 selftests/xsk: Make sure single threaded test terminates For single threaded poll tests call pthread_kill() from main thread so that we are sure worker thread has finished its job and it is possible to proceed with next test types from test suite. It was observed that on some platforms it takes a bit longer for worker thread to exit and next test case sees device as busy in this case. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-6-maciej.fijalkowski@intel.com commit a693ff3ed5610a07b1b0dd831d10f516e13cf6c6 Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:11 2022 +0200 selftests/xsk: Add support for executing tests on physical device Currently, architecture of xdpxceiver is designed strictly for conducting veth based tests. Veth pair is created together with a network namespace and one of the veth interfaces is moved to the mentioned netns. Then, separate threads for Tx and Rx are spawned which will utilize described setup. Infrastructure described in the paragraph above can not be used for testing AF_XDP support on physical devices. That testing will be conducted on a single network interface and same queue. Xskxceiver needs to be extended to distinguish between veth tests and physical interface tests. Since same iface/queue id pair will be used by both Tx/Rx threads for physical device testing, Tx thread, which happen to run after the Rx thread, is going to create XSK socket with shared umem flag. In order to track this setting throughout the lifetime of spawned threads, introduce 'shared_umem' boolean variable to struct ifobject and set it to true when xdpxceiver is run against physical device. In such case, UMEM size needs to be doubled, so half of it will be used by Rx thread and other half by Tx thread. For two step based test types, value of XSKMAP element under key 0 has to be updated as there is now another socket for the second step. Also, to avoid race conditions when destroying XSK resources, move this activity to the main thread after spawned Rx and Tx threads have finished its job. This way it is possible to gracefully remove shared umem without introducing synchronization mechanisms. To run xsk selftests suite on physical device, append "-i $IFACE" when invoking test_xsk.sh. For veth based tests, simply skip it. When "-i $IFACE" is in place, under the hood test_xsk.sh will use $IFACE for both interfaces supplied to xdpxceiver, which in turn will interpret that this execution of test suite is for a physical device. Note that currently this makes it possible only to test SKB and DRV mode (in case underlying device has native XDP support). ZC testing support is added in a later patch. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-5-maciej.fijalkowski@intel.com commit 24037ba7c47b1a50ceb70079d08fc9c135f7df4b Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:10 2022 +0200 selftests/xsk: Increase chars for interface name to 16 So that "enp240s0f0" or such name can be used against xskxceiver. While at it, also extend character count for netns name. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-4-maciej.fijalkowski@intel.com commit 1adef0643b7df1069a53f6f5b7bc66c8234db899 Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:09 2022 +0200 selftests/xsk: Introduce default Rx pkt stream In order to prepare xdpxceiver for physical device testing, let us introduce default Rx pkt stream. Reason for doing it is that physical device testing will use a UMEM with a doubled size where half of it will be used by Tx and other half by Rx. This means that pkt addresses will differ for Tx and Rx streams. Rx thread will initialize the xsk_umem_info::base_addr that is added here so that pkt_set(), when working on Rx UMEM will add this offset and second half of UMEM space will be used. Note that currently base_addr is 0 on both sides. Future commit will do the mentioned initialization. Previously, veth based testing worked on separate UMEMs, so single default stream was fine. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-3-maciej.fijalkowski@intel.com commit 0d68e6fe12ada8fbaf35f0978aaf18dfb8d2dbb5 Author: Maciej Fijalkowski Date: Thu Sep 1 13:48:08 2022 +0200 selftests/xsk: Query for native XDP support Currently, xdpxceiver assumes that underlying device supports XDP in native mode - it is fine by now since tests can run only on a veth pair. Future commit is going to allow running test suite against physical devices, so let us query the device if it is capable of running XDP programs in native mode. This way xdpxceiver will not try to run TEST_MODE_DRV if device being tested is not supporting it. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220901114813.16275-2-maciej.fijalkowski@intel.com commit e06a46087d8bbde7ca31361789edfe026b08fdce Author: Imre Deak Date: Thu Sep 1 19:19:33 2022 +0300 drm/i915/dp_mst: Fix mst_mgr lookup during atomic check If an MST connector was disabled in the old state during a commit, the connector's best_encoder will be NULL, so we can't look up mst_mgr via it. Do the lookup instead via intel_connector->mst_port which always points to the primary encoder. This fixes the following: [ 58.922866] BUG: kernel NULL pointer dereference, address: 0000000000000170 [ 58.922867] #PF: supervisor read access in kernel mode [ 58.922868] #PF: error_code(0x0000) - not-present page [ 58.922869] PGD 0 P4D 0 [ 58.922870] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 58.922872] CPU: 0 PID: 133 Comm: kworker/0:2 Tainted: G U 6.0.0-rc3-imre+ #560 [ 58.922874] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS ADLPFWI1.R00.3135.A00.2203251419 03/25/2022 [ 58.922874] Workqueue: events output_poll_execute [drm_kms_helper] [ 58.922879] RIP: 0010:intel_dp_mst_atomic_check+0xbb/0x1c0 [i915] [ 58.922955] Code: 5b 7b f6 ff 84 c0 75 41 48 8b 44 24 18 65 48 2b 04 25 28 00 00 00 0f 85 ff 00 00 00 48 8b 45 10 48 8b 93 10 07 00 00 4c 89 e7 <48> 8b b0 70 01 00 00 48 83 c4 20 5b 5d 48 81 c6 f0 0c 00 00 41 5c [ 58.922956] RSP: 0018:ffffc90000633a88 EFLAGS: 00010246 [ 58.922957] RAX: 0000000000000000 RBX: ffff888117d19000 RCX: ffff888101893308 [ 58.922958] RDX: ffff888122981000 RSI: ffffffff82309ecc RDI: ffff888114da6800 [ 58.922959] RBP: ffff8881094bab48 R08: 0000000081917436 R09: 0000000068191743 [ 58.922960] R10: 0000000000000001 R11: 0000000000000001 R12: ffff888114da6800 [ 58.922960] R13: ffff8881143f8000 R14: 0000000000000000 R15: ffff888119bf2000 [ 58.922961] FS: 0000000000000000(0000) GS:ffff888496200000(0000) knlGS:0000000000000000 [ 58.922962] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 58.922962] CR2: 0000000000000170 CR3: 0000000005612004 CR4: 0000000000770ef0 [ 58.922963] PKRU: 55555554 [ 58.922963] Call Trace: [ 58.922964] [ 58.922966] drm_atomic_helper_check_modeset+0x3f8/0xc70 [drm_kms_helper] [ 58.922972] intel_atomic_check+0xb1/0x3180 [i915] [ 58.923059] ? find_held_lock+0x2b/0x80 [ 58.923064] drm_atomic_check_only+0x5d3/0xa60 [drm] [ 58.923082] drm_atomic_commit+0x56/0xc0 [drm] [ 58.923097] ? drm_plane_get_damage_clips.cold+0x1c/0x1c [drm] [ 58.923114] drm_client_modeset_commit_atomic+0x235/0x280 [drm] [ 58.923132] drm_client_modeset_commit_locked+0x5b/0x190 [drm] [ 58.923148] drm_client_modeset_commit+0x24/0x50 [drm] [ 58.923164] drm_fb_helper_set_par+0xae/0xe0 [drm_kms_helper] [ 58.923171] drm_fb_helper_hotplug_event+0xd5/0xf0 [drm_kms_helper] [ 58.923178] output_poll_execute+0xac/0x200 [drm_kms_helper] [ 58.923187] process_one_work+0x268/0x580 [ 58.923190] ? process_one_work+0x580/0x580 [ 58.923191] worker_thread+0x52/0x3b0 [ 58.923193] ? process_one_work+0x580/0x580 [ 58.923195] kthread+0xf0/0x120 [ 58.923196] ? kthread_complete_and_exit+0x20/0x20 [ 58.923198] ret_from_fork+0x1f/0x30 [ 58.923202] Fixes: ffac9721939d ("drm/display/dp_mst: Don't open code modeset checks for releasing time slots") Cc: Lyude Paul Signed-off-by: Imre Deak Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220901161933.1004778-1-imre.deak@intel.com commit 8cc61b7a6416541261d56bcdd93a711407f711ba Author: Shmulik Ladkani Date: Wed Aug 31 17:40:10 2022 +0300 selftests/bpf: Amend test_tunnel to exercise BPF_F_TUNINFO_FLAGS Get the tunnel flags in {ipv6}vxlan_get_tunnel_src and ensure they are aligned with tunnel params set at {ipv6}vxlan_set_tunnel_dst. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220831144010.174110-2-shmulik.ladkani@gmail.com commit 44c51472bef83bb70b43e2f4b7a592096f32a855 Author: Shmulik Ladkani Date: Wed Aug 31 17:40:09 2022 +0300 bpf: Support getting tunnel flags Existing 'bpf_skb_get_tunnel_key' extracts various tunnel parameters (id, ttl, tos, local and remote) but does not expose ip_tunnel_info's tun_flags to the BPF program. It makes sense to expose tun_flags to the BPF program. Assume for example multiple GRE tunnels maintained on a single GRE interface in collect_md mode. The program expects origins to initiate over GRE, however different origins use different GRE characteristics (e.g. some prefer to use GRE checksum, some do not; some pass a GRE key, some do not, etc..). A BPF program getting tun_flags can therefore remember the relevant flags (e.g. TUNNEL_CSUM, TUNNEL_SEQ...) for each initiating remote. In the reply path, the program can use 'bpf_skb_set_tunnel_key' in order to correctly reply to the remote, using similar characteristics, based on the stored tunnel flags. Introduce BPF_F_TUNINFO_FLAGS flag for bpf_skb_get_tunnel_key. If specified, 'bpf_tunnel_key->tunnel_flags' is set with the tun_flags. Decided to use the existing unused 'tunnel_ext' as the storage for the 'tunnel_flags' in order to avoid changing bpf_tunnel_key's layout. Also, the following has been considered during the design: 1. Convert the "interesting" internal TUNNEL_xxx flags back to BPF_F_yyy and place into the new 'tunnel_flags' field. This has 2 drawbacks: - The BPF_F_yyy flags are from *set_tunnel_key* enumeration space, e.g. BPF_F_ZERO_CSUM_TX. It is awkward that it is "returned" into tunnel_flags from a *get_tunnel_key* call. - Not all "interesting" TUNNEL_xxx flags can be mapped to existing BPF_F_yyy flags, and it doesn't make sense to create new BPF_F_yyy flags just for purposes of the returned tunnel_flags. 2. Place key.tun_flags into 'tunnel_flags' but mask them, keeping only "interesting" flags. That's ok, but the drawback is that what's "interesting" for my usecase might be limiting for other usecases. Therefore I decided to expose what's in key.tun_flags *as is*, which seems most flexible. The BPF user can just choose to ignore bits he's not interested in. The TUNNEL_xxx are also UAPI, so no harm exposing them back in the get_tunnel_key call. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220831144010.174110-1-shmulik.ladkani@gmail.com commit 4ec7ac90ff399b7d9af81cc8afd430a22786c61b Author: Kumaravel Thiagarajan Date: Thu Aug 25 01:30:47 2022 +0530 misc: microchip: pci1xxxx: Add power management functions - suspend & resume handlers. Power event handlers suspend and resume are invoked by the operating system to notify the driver about the power events. Wakeup is enabled before entering suspend and disabled after resuming. Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220824200047.150308-6-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1f4d8ae231f47c7d890198cd847055a96482a443 Author: Kumaravel Thiagarajan Date: Thu Aug 25 01:30:46 2022 +0530 misc: microchip: pci1xxxx: Add gpio irq handler and irq helper functions irq_ack, irq_mask, irq_unmask and irq_set_type of irq_chip. The helper functions irq_set_type, irq_mask, irq_unmask and irq_ack configure the interrupt type, mask, unmask and acknowledge the interrupts. Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220824200047.150308-5-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 9b91a368a4de0559c8fde4e69cdab797cb3d9876 Author: Kumaravel Thiagarajan Date: Thu Aug 25 01:30:45 2022 +0530 misc: microchip: pci1xxxx: Add functions to configure gpio pins as input / output, get status, handle I/O for gpio pins. direction_input and direction_output functions configures a gpio pin as input and output respectively. get_direction function returns if a gpio pin is output or input. get function returns the value of a gpio pin whereas set function assigns output value for a gpio pin. Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220824200047.150308-4-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 7d3e4d807df2a216b9aa2944372f2b3f6ef3f205 Author: Kumaravel Thiagarajan Date: Thu Aug 25 01:30:44 2022 +0530 misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver. PIO function's auxiliary bus driver enumerates separate child devices for GPIO controller and OTP/EEPROM interface. This gpio driver implemented based on the gpio framework is loaded for the gpio auxiliary device. Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220824200047.150308-3-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit 393fc2f5948fd340d016a9557eea6e1ac2f6c60c Author: Kumaravel Thiagarajan Date: Thu Aug 25 01:30:43 2022 +0530 misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device. pci1xxxx is a PCIe switch with a multi-function endpoint on one of its downstream ports. PIO function is one of the functions in the multi-function endpoint. PIO function combines a GPIO controller and also an interface to program pci1xxxx's OTP & EEPROM. This auxiliary bus driver is loaded for the PIO function and separate child devices are enumerated for GPIO controller and OTP/EEPROM interface. Signed-off-by: Kumaravel Thiagarajan Link: https://lore.kernel.org/r/20220824200047.150308-2-kumaravel.thiagarajan@microchip.com Signed-off-by: Greg Kroah-Hartman commit dc84dbbcc97bfb47e0f2b175d816e601b2890c91 Author: Shung-Hsi Yu Date: Wed Aug 31 11:19:06 2022 +0800 bpf, tnums: Warn against the usage of tnum_in(tnum_range(), ...) Commit a657182a5c51 ("bpf: Don't use tnum_range on array range checking for poke descriptors") has shown that using tnum_range() as argument to tnum_in() can lead to misleading code that looks like tight bound check when in fact the actual allowed range is much wider. Document such behavior to warn against its usage in general, and suggest some scenario where result can be trusted. Signed-off-by: Shung-Hsi Yu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/984b37f9fdf7ac36831d2137415a4a915744c1b6.1661462653.git.daniel@iogearbox.net Link: https://www.openwall.com/lists/oss-security/2022/08/26/1 Link: https://lore.kernel.org/bpf/20220831031907.16133-3-shung-hsi.yu@suse.com Link: https://lore.kernel.org/bpf/20220831031907.16133-2-shung-hsi.yu@suse.com commit 7d992bd4615c5b1ac4a92f691967d886e2bfec35 Author: Manikanta Pubbisetty Date: Thu Sep 1 19:21:25 2022 +0300 wifi: ath11k: Add support to connect to non-transmit MBSSID profiles Add support to connect to a non-transmit MBSSID AP profile. Non-transmit MBSSID profile parameters are passed to the firmware via WMI VDEV UP command and this helps firmware to track MBSSID profile within the multi-BSS beacon and report beacon loss if any. WCN6750, QCA6390 & WCN6855 firmwares have the support and hence enable the support on these hardwares. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220901080616.29414-1-quic_mpubbise@quicinc.com commit 376be51caf8871419bbcbb755e1e615d30dc3153 Author: Jiasheng Jiang Date: Fri Sep 2 09:30:30 2022 +0800 ASoC: rsnd: Add check for rsnd_mod_power_on As rsnd_mod_power_on() can return negative numbers, it should be better to check the return value and deal with the exception. Fixes: e7d850dd10f4 ("ASoC: rsnd: use mod base common method on SSI-parent") Signed-off-by: Jiasheng Jiang Acked-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20220902013030.3691266-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit 607c467eac7d6da6be8127b9cc1893eae3ffb7f4 Author: Manikanta Pubbisetty Date: Thu Sep 1 19:21:25 2022 +0300 wifi: ath11k: Fix hardware restart failure due to twt debugfs failure Currently, creation of debugfs entries for TWT is failing during hardware restart because of the residual TWT files which were created during add_interface(). Since, struct arvif{} is memset to zero upon add_interface() invocation, when the hardware restart is triggered, arvif is memset to 0 and TWT files are attempted to create again which will fail because of the residual TWT files already in place, this leads to hardware restart failure. Also, it is not a good idea to return error from add_interface() because of debugfs file creation failures. Moreover, debugfs framework can very well handle the errors in it's create file & remove file APIs and the errors returned by these APIs are not checked in most usecases. Fix the HW restart failure by ignoring the errors returned from the debugfs APIs. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Fixes: fe98a6137d03 ("ath11k: add debugfs for TWT debug calls") Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220720135150.22193-3-quic_mpubbise@quicinc.com commit 9e2747c31e5a65e92173bc98a1b72f6a7c86d8e1 Author: Manikanta Pubbisetty Date: Thu Sep 1 19:21:24 2022 +0300 wifi: ath11k: Add TWT debugfs support for STA interface Currently TWT debugfs files required for manually testing the TWT feature are created only for the AP interfaces; these debugfs hooks are also required for the station interfaces in order to test the TWT feature manually, therefore create these debugfs hooks for station iftype as well. In the case of station interfaces, TWT is entirely handled in the firmware based on input parameters passed to it during association via TWT enable WMI command. In order to manually test this feature, firmware expects to first disable the TWT feature and then send the enable command with sta_cong_timer_ms parameter set to 0. This is true for WCN6750, QCA6390 & WCN6855 hardwares. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220720135150.22193-2-quic_mpubbise@quicinc.com commit c3f760ef128789252e7c4f10d3c1721422dceba9 Author: Jakub Kicinski Date: Wed Aug 31 17:00:58 2022 -0700 net: remove netif_tx_napi_add() All callers are now gone. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 977f1aa5e4d1942bc8012bf3f0e695008979ff4e Author: Eric Dumazet Date: Wed Aug 31 18:44:27 2022 +0000 net: bql: add more documentation Add some documentation for netdev_tx_sent_queue() and netdev_tx_completed_queue() Stating that netdev_tx_completed_queue() must be called once per TX completion round is apparently not obvious for everybody. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 25de4a0b7b1aceedf0d3764b718974e7c5c3c71e Merge: a01105f1748e8 fd3bd0398a0df Author: David S. Miller Date: Fri Sep 2 12:08:44 2022 +0100 Merge branch 'net-ipa-transaction-state-IDs' Alex Elder says: ==================== net: ipa: use IDs to track transaction state This series is the first of three groups of changes that simplify the way the IPA driver tracks the state of its transactions. Each GSI channel has a fixed number of transactions allocated at initialization time. The number allocated matches the number of TREs in the transfer ring associated with the channel. This is because the transfer ring limits the number of transfers that can ever be underway, and in the worst case, each transaction represents a single TRE. Transactions go through various states during their lifetime. Currently a set of lists keeps track of which transactions are in each state. Initially, all transactions are free. An allocated transaction is placed on the allocated list. Once an allocated transaction is committed, it is moved from the allocated to the committed list. When a committed transaction is sent to hardware (via a doorbell) it is moved to the pending list. When hardware signals that some work has completed, transactions are moved to the completed list. Finally, when a completed transaction is polled it's moved to the polled list before being removed when it becomes free. Changing a transaction's state thus normally involves manipulating two lists, and to prevent corruption a spinlock is held while the lists are updated. Transactions move through their states in a well-defined sequence though, and they do so strictly in order. So transaction 0 is always allocated before transaction 1; transaction 0 is always committed before transaction 1; and so on, through completion, polling, and becoming free. Because of this, it's sufficient to just keep track of which transaction is the first in each state. The rest of the transactions in a given state can be derived from the first transaction in an "adjacent" state. As a result, we can track the state of all transactions with a set of indexes, and can update these without the need for a spinlock. This first group of patches just defines the set of indexes that will be used for this new way of tracking transaction state. Two more groups of patches will follow. I've broken the 17 patches into these three groups to facilitate review. ==================== Signed-off-by: David S. Miller commit fd3bd0398a0dfc7fc30bc9281bd1ae879527f96c Author: Alex Elder Date: Wed Aug 31 17:40:17 2022 -0500 net: ipa: track polled transactions with an ID Add a transaction ID to track the first element in the transaction array that has been polled. Advance the ID when we are releasing a transaction. Temporarily add warnings that verify that the first polled transaction tracked by the ID matches the first element on the polled list, both when polling and freeing. Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 949cd0b5c296914fac2373f460d67cf6f2f8c6e8 Author: Alex Elder Date: Wed Aug 31 17:40:16 2022 -0500 net: ipa: track completed transactions with an ID Add a transaction ID field to track the first element in the transaction array that has completed but has not yet been polled. Advance the ID when we are processing a transaction in the NAPI polling loop (where completed transactions become polled). Temporarily add warnings that verify that the first completed transaction tracked by the ID matches the first element on the completed list, both when pending and completing. Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit eeff7c14e08c00cf15c89954cac719e26dcaf475 Author: Alex Elder Date: Wed Aug 31 17:40:15 2022 -0500 net: ipa: track pending transactions with an ID Add a transaction ID field to track the first element in the transaction array that is pending (sent to hardware) but not yet complete. Advance the ID when a completion event for a channel indicates that transactions have completed. Temporarily add warnings that verify that the first pending transaction tracked by the ID matches the first element on the pending list, both when pending and completing, as well as when resetting the channel. Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit fc95d958e27df51fdf128098ce26f2727f8c7b06 Author: Alex Elder Date: Wed Aug 31 17:40:14 2022 -0500 net: ipa: track committed transactions with an ID Add a transaction ID field to track the first element in a channel's transaction array that has been committed, but not yet passed to the hardware. Advance the ID when the hardware is notified via doorbell that TREs from a transaction are ready for consumption. Temporarily add warnings that verify that the first committed transaction tracked by the ID matches the first element on the committed list, both when committing and pending (at doorbell). Remove the temporary warnings added by the previous commit. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 41e2a2c054b884abaa4e3c6de628ba32beccfc9b Author: Alex Elder Date: Wed Aug 31 17:40:13 2022 -0500 net: ipa: track allocated transactions with an ID Transactions for a channel are now managed in an array, with a free transaction ID indicating which is the next one free. Add another transaction ID field to track the first element in the array that has been allocated. Advance it when a transaction is committed (because that is when that transaction leaves allocated state). Temporarily add warnings that verify that the first allocated transaction tracked by the ID matches the first element on the allocated list, both when allocating and committing a transaction. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 12382d11670e893f976ae19087fde2f83ed4813d Author: Alex Elder Date: Wed Aug 31 17:40:12 2022 -0500 net: ipa: use an array for transactions Transactions are always allocated one at a time. The maximum number of them we could ever need occurs if each TRE is assigned to a transaction. So a channel requires no more transactions than the number of TREs in its transfer ring. That number is known to be a power-of-2 less than 65536. The transaction pool abstraction is used for other things, but for transactions we can use a simple array of transaction structures, and use a free index to indicate which entry in the array is the next one free for allocation. By having the number of elements in the array be a power-of-2, we can use an ever-incrementing 16-bit free index, and use it modulo the array size. Distinguish a "trans_id" (whose value can exceed the number of entries in the transaction array) from a "trans_index" (which is less than the number of entries). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 566e373fe047f35be58d8a97061275be4dcb4132 Author: Florian Fainelli Date: Mon Aug 29 10:38:29 2022 -0700 arm64: Kconfig.platforms: Group NXP platforms together Group the three NXP platforms under an ARCH_NXP menuconfig symbol to make make selection of similar vendor SoCs visually nicer. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220829173830.3567047-3-f.fainelli@gmail.com' Signed-off-by: Arnd Bergmann commit 96796c914b841a7658e9617b1325175b4d02c574 Author: Florian Fainelli Date: Mon Aug 29 10:38:28 2022 -0700 arm64: Kconfig.platforms: Re-organized Broadcom menu There are now multiple Broadcom SoCs supported so group them under their own menu such that the selection is visually more appealing and we can easily add new platforms there in the future. This allows us to move ARCH_BRCMSTB back to its siblings. No functional changes introduced. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220829173830.3567047-2-f.fainelli@gmail.com' Signed-off-by: Arnd Bergmann commit c9a2577d417cdbabc67dbae39b3aa5136ad1c9ac Merge: b90cb10531903 ebd0e06f3063c Author: Arnd Bergmann Date: Fri Sep 2 12:48:36 2022 +0200 Merge tag 'renesas-drivers-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v6.1 - Auto-enable the RZ/G2L external and GPIO interrupt controller driver when needed, - Identify the R-Car H3Ne-1.7G and RZ/Five SoCs. * tag 'renesas-drivers-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Identify RZ/Five SoC soc: renesas: Identify R-Car H3Ne-1.7G soc: renesas: Kconfig: Enable IRQC driver for RZ/G2L SoC Link: https://lore.kernel.org/r/cover.1662111135.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 71772aa7dd2b8a96310fa2f0ce1e907592b5cf5a Merge: 73bf60ba7c184 fddccbcb4de7a Author: Arnd Bergmann Date: Fri Sep 2 12:41:20 2022 +0200 Merge tag 'renesas-dt-bindings-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v6.1 - Document support for the R-Car H3Ne-1.7G SoC on the Salvator-XS and ULCB development boards, - Document system controller support for the RZ/Five SoC, - Document support for the R-Car V3H2 SoC and the Condor-I development board. * tag 'renesas-dt-bindings-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: arm: renesas: Document Renesas R-Car V3H2 SoC and board dt-bindings: soc: renesas: renesas,rzg2l-sysc: Document RZ/Five SoC dt-bindings: arm: renesas: Document R-Car H3Ne-1.7G SoC and boards Link: https://lore.kernel.org/r/cover.1662111137.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit fa2bf6e35091e66fc83af1aebea06a78a5a2fde4 Author: Weili Qian Date: Sat Aug 27 18:27:56 2022 +0800 crypto: hisilicon/qm - return failure if vfs_num exceeds total VFs The accelerator drivers supports users to enable VFs through the module parameter 'vfs_num'. If the number of VFs to be enabled exceeds the total VFs, all VFs are enabled. Change it to the same as enabling VF through the 'sriov_numvfs' file. Returns -ERANGE if the number of VFs to be enabled exceeds total VFs. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 5afc904f443de2afd31c4e0686ba178beede86fe Author: Weili Qian Date: Sat Aug 27 18:27:37 2022 +0800 crypto: hisilicon/qm - fix missing put dfx access In function qm_cmd_write(), if function returns from branch 'atomic_read(&qm->status.flags) == QM_STOP', the got dfx access is forgotten to put. Fixes: 607c191b371d ("crypto: hisilicon - support runtime PM for accelerator device") Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 95b66bc4e789c5698b973e92235c2e901c7546e0 Author: Weili Qian Date: Sat Aug 27 18:26:57 2022 +0800 crypto: hisilicon/qm - check mailbox operation result After the mailbox operation is complete, the result may be unsuccessful. It needs to check the status bits of the mailbox register, if it fails, -EIO is returned. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 31b39755e32568b43c80814c5e13d7b1ab796d73 Author: Herbert Xu Date: Fri Aug 26 19:05:31 2022 +0800 crypto: aspeed - Enable compile testing This driver compile tests just fine. Signed-off-by: Herbert Xu Reviewed-by: Neal Liu Signed-off-by: Herbert Xu commit cc40b04c08400d86d2d6ea0159e0617e717f729c Author: Lucas Segarra Fernandez Date: Thu Aug 25 12:32:16 2022 +0200 crypto: qat - fix default value of WDT timer The QAT HW supports an hardware mechanism to detect an accelerator hang. The reporting of a hang occurs after a watchdog timer (WDT) expires. The value of the WDT set previously was too small and was causing false positives. Change the default value of the WDT to 0x7000000ULL to avoid this. Fixes: 1c4d9d5bbb5a ("crypto: qat - enable detection of accelerators hang") Reviewed-by: Giovanni Cabiddu Signed-off-by: Lucas Segarra Fernandez Signed-off-by: Herbert Xu commit 442f06067f155aeb35696cf59f4f458ee7da83a8 Author: Lucas Segarra Fernandez Date: Thu Aug 25 12:24:51 2022 +0200 crypto: testmgr - fix indentation for test_acomp() args Set right indentation for test_acomp(). Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 0e831f3d2fd973d5f6645ef3911c594af9ddd485 Author: wangjianli Date: Tue Aug 23 21:57:30 2022 +0800 crypto: bcm - fix repeated words in comments Delete the redundant word 'in'. Signed-off-by: wangjianli Signed-off-by: Herbert Xu commit a01105f1748e8151ef43c300659b99d471f5f61d Merge: aa51b80e1af47 f4c1f51cea4e1 Author: David S. Miller Date: Fri Sep 2 11:37:27 2022 +0100 Merge branch 'lan966x-make-reset-optional' Michael Walle says: ==================== net: lan966x: make reset optional This is the remaining part of the reset rework on the LAN966x targetting the netdev tree. The former series can be found at: https://lore.kernel.org/lkml/20220826115607.1148489-1-michael@walle.cc/ ==================== Signed-off-by: David S. Miller commit f4c1f51cea4e145995076d5dae98486934e8f281 Author: Michael Walle Date: Wed Aug 31 13:18:55 2022 +0200 net: lan966x: make reset optional There is no dedicated reset for just the switch core. The reset which is used up until now, is more of a global reset, resetting almost the whole SoC and cause spurious errors by doing so. Make it possible to handle the reset elsewhere and make the reset optional. Signed-off-by: Michael Walle Signed-off-by: David S. Miller commit baa6a9b5907098c4b43da91968220b81b8d78a91 Author: Michael Walle Date: Wed Aug 31 13:18:54 2022 +0200 dt-bindings: net: sparx5: don't require a reset line Make the reset line optional. It turns out, there is no dedicated reset for the switch. Instead, the reset which was used up until now, was kind of a global reset. This is now handled elsewhere, thus don't require a reset. Signed-off-by: Michael Walle Acked-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 8e971e06b00bf995dd5f2c6fa9c068bc23cb5e56 Author: wangjianli Date: Tue Aug 23 21:53:53 2022 +0800 crypto: marvell/octeontx - fix repeated words in comments Delete the redundant word 'is'. Signed-off-by: wangjianli Signed-off-by: Herbert Xu commit 8c8e5b6ae43a55d0f6098606c311123f1a39d112 Author: wangjianli Date: Tue Aug 23 21:52:23 2022 +0800 crypto: n2 - fix repeated words in comments Delete the redundant word 'to'. Signed-off-by: wangjianli Signed-off-by: Herbert Xu commit 10a2199caf437e893d9027d97700b3c6010048b7 Author: Kshitiz Varshney Date: Mon Aug 22 13:19:03 2022 +0200 hwrng: imx-rngc - Moving IRQ handler registering after imx_rngc_irq_mask_clear() Issue: While servicing interrupt, if the IRQ happens to be because of a SEED_DONE due to a previous boot stage, you end up completing the completion prematurely, hence causing kernel to crash while booting. Fix: Moving IRQ handler registering after imx_rngc_irq_mask_clear() Fixes: 1d5449445bd0 (hwrng: mx-rngc - add a driver for Freescale RNGC) Signed-off-by: Kshitiz Varshney Signed-off-by: Herbert Xu commit 73bf60ba7c184eaafc0b3a6dcae55150db817b69 Merge: 70fed748cdc03 6f67580ca9edb Author: Arnd Bergmann Date: Fri Sep 2 12:22:49 2022 +0200 Merge tag 'renesas-arm-dt-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v6.1 - SDHI and eMMC support for the R-Car S4-8 SoC and the Spider development board, - Timer (CMT and TMU) and SPI (MSIOF) support for the R-Car S4-8 SoC, - External and GPIO interrupt support for the RZ/G2L and RZ/V2L SoCs, - Initial support for the R-Car H3Ne-1.7G (R8A779MB) SoC, - SPI DMA support for the RZ/G2UL, RZ/G2L, and RZ/V2L SoCs, - Pin control and I2C support for the RZ/V2M SoC and the RZ/V2M Evaluation Kit, - initial support for the R-Car V3H2 (R8A77980A) SoC and the Condor-I development board, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (33 commits) arm64: dts: renesas: Add V3H2 Condor-I board support arm64: dts: renesas: Add r8a77980a.dtsi arm64: dts: renesas: Add condor-common.dtsi arm64: dts: renesas: Drop clock-names property from RPC node arm64: dts: renesas: r8a779f0: Add MSIOF nodes arm64: dts: renesas: r8a774a1: Put I2C aliases to board files arm64: dts: renesas: r8a774e1: Rename i2c_dvfs to iic_pmic arm64: dts: renesas: r8a779a0: Put I2C aliases to board files arm64: dts: renesas: r8a77990: Put I2C aliases to board files arm64: dts: renesas: r8a77980: Put I2C aliases to board files arm64: dts: renesas: r8a77970: Put I2C aliases to board files arm64: dts: renesas: r8a779{51|60|65}: Put I2C aliases to board files arm64: dts: renesas: rzv2m evk: Enable i2c arm64: dts: renesas: r9a09g011: Add i2c nodes arm64: dts: renesas: r9a09g011: Add pinctrl node arm64: dts: renesas: r9a07g043: Fix SCI{Rx,Tx} interrupt types arm64: dts: renesas: r9a07g054: Fix SCI{Rx,Tx} interrupt types arm64: dts: renesas: r9a07g044: Fix SCI{Rx,Tx} interrupt types arm64: dts: renesas: r9a07g043: Fix audio clk node names arm64: dts: renesas: r9a07g054: Add DMA support to RSPI ... Link: https://lore.kernel.org/r/cover.1662111128.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 2ad548ebb85cc416587ba68c0e530a2f00b2273a Author: Herbert Xu Date: Fri Sep 2 18:19:27 2022 +0800 Revert "crypto: allwinner - Fix dma_map_sg error check" This reverts commit 2b02187bdb0bb75000850bd0309e70eb8664159e. The original code was correct and arguably more robust than the patched version. Signed-off-by: Herbert Xu commit fb1e1257b0cb93328f2909755b0fa2dc582cc508 Author: Herbert Xu Date: Fri Sep 2 18:15:53 2022 +0800 Revert "crypto: gemini - Fix error check for dma_map_sg" This reverts commit 545665ad1e84eb8f047018a2f607e78cef29c7fa. The original code was correct and arguably more robust than the patched version. Signed-off-by: Herbert Xu commit 853ca4bb741cbd8c55e0183255fa90ab34f85d15 Merge: 853ff6c321507 eb970f3eb909a Author: Arnd Bergmann Date: Fri Sep 2 12:06:16 2022 +0200 Merge tag 'renesas-arm-defconfig-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v6.1 - Refresh shmobile_defconfig for v6.0-rc1, - Enable additional support for Renesas platforms in the arm64 defconfig. * tag 'renesas-arm-defconfig-for-v6.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable additional support for Renesas platforms ARM: shmobile: defconfig: Refresh for v6.0-rc1 Link: https://lore.kernel.org/r/cover.1662111126.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 0627f3df95e1609693f89e7ceb4156ac5db6e358 Author: Ping Cheng Date: Fri Aug 26 14:34:02 2022 -0700 HID: wacom: Add new Intuos Pro Small (PTH-460) device IDs Add the new PIDs to wacom_wac.c to support the new model in the Intuos Pro series. Signed-off-by: Ping Cheng Tested-by: Aaron Armstrong Skomra Signed-off-by: Jiri Kosina commit 70fed748cdc034887dd1f9851022bff17a6d0d8f Merge: 1db560169211e 0b7baa1a307fc Author: Arnd Bergmann Date: Fri Sep 2 11:31:33 2022 +0200 Merge tag 'at91-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 DT for v6.1 It contains: - one new LAN966X based board, namely lan966x-pcb8290 - gpio leds support for lan966x-pcb8291 and lan966x-pcb8309 - a cleanup for sam9x60ek to avoid DT compilation warning due to regulators * tag 'at91-dt-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: lan966x: add led configuration ARM: dts: at91: sam9x60ek: remove simple-bus for regulators ARM: dts: lan966x: add support for pcb8290 Link: https://lore.kernel.org/r/20220902085845.4193579-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit e312ae92077f90d6ccdca05fb6d640bd9624c37c Author: Lad Prabhakar Date: Tue Jul 26 18:45:25 2022 +0100 dt-bindings: clock: renesas,rzg2l: Document RZ/Five SoC The CPG block on the RZ/Five SoC is almost identical to one found on the RZ/G2UL SoC. "renesas,r9a07g043-cpg" compatible string will be used on the RZ/Five SoC so to make this clear, update the comment to include RZ/Five SoC. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220726174525.620-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit bf99f11df4de45fcba6f6c441b411a16bccaccf6 Author: Wolfram Sang Date: Tue Aug 30 22:14:53 2022 +0200 wifi: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220830201457.7984-2-wsa+renesas@sang-engineering.com commit 1dc13236ef9171a00168452d93ca70682c45ad30 Author: Jinpeng Cui Date: Tue Aug 30 10:55:05 2022 +0000 wifi: wilc1000: remove redundant ret variable Return value from cfg80211_rx_mgmt() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220830105505.287564-1-cui.jinpeng2@zte.com.cn commit b0ea758b30bbdf7c4323c78b7c50c05d2e1224d5 Author: Yang Yingliang Date: Fri Aug 26 10:38:17 2022 +0800 wifi: rtw88: add missing destroy_workqueue() on error path in rtw_core_init() Add the missing destroy_workqueue() before return from rtw_core_init() in error path. Fixes: fe101716c7c9 ("rtw88: replace tx tasklet with work queue") Signed-off-by: Yang Yingliang Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220826023817.3908255-1-yangyingliang@huawei.com commit 6f67580ca9edb33a95897d8c0056b961cbd2aeac Author: Kuninori Morimoto Date: Mon Aug 29 23:49:59 2022 +0000 arm64: dts: renesas: Add V3H2 Condor-I board support This patch adds r8a77980A V3H2 (= r8a77980 ES2) Condor-I board basic support. Signed-off-by: Andrey Dolnikov Signed-off-by: Valentine Barshak Signed-off-by: Koji Matsuoka Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y1v64nko.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 6f06a74d7d8913288771839e86c3f7f3542768cf Author: Kuninori Morimoto Date: Mon Aug 29 23:49:52 2022 +0000 arm64: dts: renesas: Add r8a77980a.dtsi This patch adds r8a77980A V3H2 (= r8a77980 ES2) basic SoC support. It is using r8a77980 (= V3H) setting as-is for now. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zgfm4nkw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 33eef075290215989b0c5430d8f696e21af29e0f Author: Kuninori Morimoto Date: Mon Aug 29 23:49:41 2022 +0000 arm64: dts: renesas: Add condor-common.dtsi We have V3H Condor board, and will have V3H2 Condor-I board. This patch adds condor-common.dtsi to share the common settings between these boards. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871qsy625m.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit c77543ae7b168eab0686579c7dc9e7bd21298de2 Author: Lad Prabhakar Date: Mon Aug 29 22:51:28 2022 +0100 arm64: dts: renesas: Drop clock-names property from RPC node With 'unevaluatedProperties' support implemented, there are a number of warnings when running dtbs_check: arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n-rev2-ex-idk-1110wr.dtb: spi@ee200000: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml The main problem is that the DT bindings do not allow clock-names. So just drop the clock-names properties from the SoC DTSI files. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220829215128.5983-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f97c81f5b7f8047810b0d79a8f759a83951210a0 Author: Dan Carpenter Date: Fri Aug 19 08:23:43 2022 +0300 wifi: wfx: prevent underflow in wfx_send_pds() This does a "chunk_len - 4" subtraction later when it calls: ret = wfx_hif_configuration(wdev, buf + 4, chunk_len - 4); so check for "chunk_len" is less than 4. Fixes: dcbecb497908 ("staging: wfx: allow new PDS format") Signed-off-by: Dan Carpenter Reviewed-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/Yv8eX7Xv2ubUOvW7@kili commit 620d5eaeb9059636864bda83ca1c68c20ede34a5 Author: Dan Carpenter Date: Fri Aug 19 08:22:32 2022 +0300 wifi: rtl8xxxu: tighten bounds checking in rtl8xxxu_read_efuse() There some bounds checking to ensure that "map_addr" is not out of bounds before the start of the loop. But the checking needs to be done as we iterate through the loop because "map_addr" gets larger as we iterate. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Dan Carpenter Acked-by: Jes Sorensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/Yv8eGLdBslLAk3Ct@kili commit c0d2e63d4c618185cdd92faae10bdde33a00c25d Author: Ingo Molnar Date: Fri Sep 2 10:41:42 2022 +0200 x86/defconfig: Enable CONFIG_DEBUG_WX=y 7 years after it got introduced it's time to make this the default, at least in the x86 defconfigs. Signed-off-by: Ingo Molnar commit 81290934eafd19ad1799526ed63ce9d92df6294c Author: Ingo Molnar Date: Fri Sep 2 10:37:53 2022 +0200 x86/defconfig: Refresh the defconfigs Just go through a 'make savedefconfig' cycle to pick up fresh Kconfig details, no change in settings, just reordering of some entries. ( This makes followup changes generated via 'make savedefconfig' contain less noise. ) Signed-off-by: Ingo Molnar commit fec11dee177a4ed4a8447efa7cbecba4065eddc3 Author: Ping-Ke Shih Date: Fri Aug 26 14:10:11 2022 +0800 wifi: rtw89: declare to support beamformee above bandwidth 80MHz Declare this to tell AP we can support beamformee over bandwidth 160M, and then yield better performance in field. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220826061011.9037-3-pkshih@realtek.com commit ad275d0a82cb1772aadf30ff920ad4843d7b1211 Author: Ping-Ke Shih Date: Fri Aug 26 14:10:10 2022 +0800 wifi: rtw89: correct polling address of address CAM Writing address to kick hardware to initialize address CAM, and then poll ready bit to determine completed. Old wrong code poll wrong register address, so it can lead error and fail to bring up interface. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220826061011.9037-2-pkshih@realtek.com commit 0d466f05262a941afc0431ae3bd007a78e7b74f6 Author: Ping-Ke Shih Date: Fri Aug 26 14:10:09 2022 +0800 wifi: rtw89: no HTC field if TX rate might fallback to legacy Packets containing HTC field with legacy rate could be dropped by AP. If TX rate of report is lower than MCS2, hardware might fall back rate to legacy. Therefore, add a checking rule to avoid HTC field in this situation. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220826061011.9037-1-pkshih@realtek.com commit 4a29213cd775cabcbe395229d175903accedbb9d Author: Ping-Ke Shih Date: Wed Aug 24 14:33:12 2022 +0800 wifi: rtw89: pci: correct TX resource checking in low power mode Number of TX resource must be minimum of TX_BD and TX_WD. Only considering TX_BD could drop TX packets pulled from mac80211 if TX_WD is unavailable. Fixes: 52edbb9fb78a ("rtw89: ps: access TX/RX rings via another registers in low power mode") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220824063312.15784-2-pkshih@realtek.com commit b7e715d3dcd2e9fa3a689ba0dd7ab85f8aaf6e9a Author: Ping-Ke Shih Date: Wed Aug 24 14:33:11 2022 +0800 wifi: rtw89: pci: fix interrupt stuck after leaving low power mode We turn off interrupt in ISR, and re-enable interrupt in threadfn or napi_poll according to the mode it stays. If we are turning off interrupt, rtwpci->running flag is unset and interrupt handler stop processing even if it was called, so disallow to re-enable interrupt in this situation. Or, wifi chip doesn't trigger interrupt events anymore because interrupt status (ISR) isn't clear by interrupt handler anymore. Fixes: c83dcd0508e2 ("rtw89: pci: add a separate interrupt handler for low power mode") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220824063312.15784-1-pkshih@realtek.com commit 9bea5761750caafceb88771babdbf87367ad3908 Author: Cheng-Chieh Hsieh Date: Wed Aug 24 14:14:25 2022 +0800 wifi: rtw89: enlarge the CFO tracking boundary The calibration value of XTAL offset may be too large in some wifi modules, that the CFO tracking mechanism under the existing tracking boundary can not adjust the CFO to the tolerable range. So we enlarge it. Signed-off-by: Cheng-Chieh Hsieh Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220824061425.13764-1-pkshih@realtek.com commit 9e3d242fd3b4d6d2cea703021249bbcc0ebcd0d4 Author: Chin-Yen Lee Date: Fri Aug 19 14:48:11 2022 +0800 wifi: rtw89: pci: correct suspend/resume setting for variant chips We find that suspend/resume tests cause 8852CE lost, because some pci registers are changed for 8852CE. So, correct them accordingly. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220819064811.37700-6-pkshih@realtek.com commit 843059d8193c1d28bed9b80c331088e775cf0151 Author: Chin-Yen Lee Date: Fri Aug 19 14:48:10 2022 +0800 wifi: rtw89: pci: enable CLK_REQ, ASPM, L1 and L1ss for 8852c 8852CE controls CLKREQ, ASPM L1, L1ss via wifi registers instead, so change them accordingly. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220819064811.37700-5-pkshih@realtek.com commit 8f308ae3342c57dca02bea97ec7a894417d13a0a Author: Chia-Yuan Li Date: Fri Aug 19 14:48:09 2022 +0800 wifi: rtw89: pci: fix PCI PHY auto adaption by using software restore There is chance that PCI PHY auto adaption fail. When first time boot up, software restore the right adaption value and close PHY auto adaption mechanism. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220819064811.37700-4-pkshih@realtek.com commit 704052f55ffeb217634075b201785b13ebaa131e Author: Chia-Yuan Li Date: Fri Aug 19 14:48:08 2022 +0800 wifi: rtw89: 8852c: set TBTT shift configuration It is found that 8852ce loses some beacon after enabling deep ps mode. We set TBTT shift to wake up firmware early to open RF/BB for receiving beacon in time. Signed-off-by: Chia-Yuan Li Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220819064811.37700-3-pkshih@realtek.com commit 48c0e34755a1fca1513ac4128ee179a7856d3ba4 Author: Chin-Yen Lee Date: Fri Aug 19 14:48:07 2022 +0800 wifi: rtw89: add retry to change power_mode state When starting to send heavy traffic in low power mode, driver will call multiple tx wake notify to wake firmware within a short time. In this situation, firmware may miss power mode change request from driver and leads to status error. So we change driver to call power_mode_change at most three times to make sure firmware could get the request. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220819064811.37700-2-pkshih@realtek.com commit 08aa80777be9d5d4c9f93b0f727d304d9c9e8150 Author: Ping-Ke Shih Date: Tue Aug 16 09:32:47 2022 +0800 wifi: rtw89: correct BA CAM allocation BA CAM entries are global resource of hardware, so move the bitmap and instances to rtw89_cam_info, and then use link list from rtw89_sta to these instances. To check the allocation, add ba_cam to debugfs: map: mac_id: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 addr_cam: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bssid_cam: 01 00 00 00 00 00 00 00 sec_cam: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ba_cam: 03 00 00 00 00 00 00 00 VIF [0] 94:08:53:8e:ef:21 bssid_cam_idx=0 addr_cam_idx=0 -> bssid_cam_idx=0 sec_cam_bitmap=00 00 00 00 00 00 00 00 STA [0] 38:78:62:8b:cb:c6 addr_cam_idx=0 -> bssid_cam_idx=0 sec_cam_bitmap=00 00 00 00 00 00 00 00 ba_cam tid[6]=0, tid[1]=1 Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220816013247.6243-4-pkshih@realtek.com commit 8b1b4730b0259a517b4a6f8e4dfd60c9fe8da0a3 Author: Ping-Ke Shih Date: Tue Aug 16 09:32:46 2022 +0800 wifi: rtw89: 8852c: initialize and correct BA CAM content The bacam_v1 must do additional initialization, and H2C content of BA CAM is also different. So, correct them accordingly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220816013247.6243-3-pkshih@realtek.com commit 2def73563318582fd8e6ab8d33ec381cb01f6332 Author: Ping-Ke Shih Date: Tue Aug 16 09:32:45 2022 +0800 wifi: rtw89: 8852c: declare correct BA CAM number 8852A has 2 BA CAM entries, but 8852C has 8 entries. Add a field to discriminate their differences. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220816013247.6243-2-pkshih@realtek.com commit 07732caa51745f1f2340477aaa1c40017e74dda9 Author: Zong-Zhe Yang Date: Fri Aug 12 17:31:16 2022 +0800 wifi: rtw89: 8852c: update TX power tables to R49 TX power byrate: doesn't change TX power limit: configure values for KCC and UK refine a bit configuration vales TX power limit_ru: configure values for KCC and UK refine a bit configuration values change 6GHz to follow indoor setting configure 6GHz values for ETSI TX power shape: change with TX power limit/limit_ru Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220812093116.56791-4-pkshih@realtek.com commit 39ac0c27d0c871dfc53cb501ba84c96b3676b497 Author: Ping-Ke Shih Date: Fri Aug 12 17:31:15 2022 +0800 wifi: rtw89: 8852c: update RF radio A/B parameters to R49 Update 8852c radio A/B parameters from internal HALRF_027_00_071 R49. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220812093116.56791-3-pkshih@realtek.com commit 7f700c2566b8eccedeb2fa50327a0ed3466f2d15 Author: Zong-Zhe Yang Date: Fri Aug 12 17:31:14 2022 +0800 wifi: rtw89: TX power limit/limit_ru consider negative Some chips' RF TX power limit/limit_ru tables start to configure some negative values. Fix the setting logic to prevent negative values from polluting fields of others. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220812093116.56791-2-pkshih@realtek.com commit 1043897681808118c0f7e70b210774000fe06621 Merge: 652c5bf380ad0 42e66b1cc3a07 Author: Ingo Molnar Date: Fri Sep 2 10:31:58 2022 +0200 Merge branch 'linus' into x86/mm, to refresh the branch This branch is ~14k commits behind upstream, and has an old merge base from early into the merge window, refresh it to v6.0-rc3+fixes before queueing up new commits. Signed-off-by: Ingo Molnar commit 3832a542490249b30693e33575d10415d72d12d2 Author: Ching-Te Ku Date: Mon Jul 25 10:35:09 2022 +0800 rtw89: coex: Update Wi-Fi driver/firmware TDMA cycle report for RTL8852c Because RTL8852c firmware handshake use different structure definition with RTL8852a, so it's necessary to update a version for RTL8852c. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-10-pkshih@realtek.com commit 747dc30e64cf0731e2680304658aa65b11f8a9eb Author: Ching-Te Ku Date: Mon Jul 25 10:35:08 2022 +0800 rtw89: coex: Add v1 Wi-Fi SCC coexistence policy Because the later firmware had patched some new feature, it can control the Wi-Fi/BT slots more efficiently. This patch enhance it for better Wi-Fi SCC mode performance. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-9-pkshih@realtek.com commit a8a0b1f70780ce4853b30c9a33f951a9c97b08ab Author: Ching-Te Ku Date: Mon Jul 25 10:35:07 2022 +0800 rtw89: coex: Move _set_policy to chip_ops Due to the difference of Wi-Fi firmware supported feature, RTL8852C need to defined more policy to enable the features. (Ex: DBCC, Wi-Fi multi-role, TDMA instant and so on) Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-8-pkshih@realtek.com commit e390cf2ebdee007f4de990103cfea4ab7116f084 Author: Ching-Te Ku Date: Mon Jul 25 10:35:06 2022 +0800 rtw89: coex: update WL role info v1 for RTL8852C branch using The H2C format and support feature are different. The newer Wi-Fi firmware and driver branch need to handshake more information like DBCC or P2P connection info. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-7-pkshih@realtek.com commit ce986f3dc4fc694734e921b618f2a2dcd014b535 Author: Ching-Te Ku Date: Mon Jul 25 10:35:05 2022 +0800 rtw89: coex: Add v1 version TDMA format and parameters RTL8852C use a later version Wi-Fi firmware, there are some parameters need to be defined. These new parameter can avoid some unexpected TDMA mode while Wi-Fi enter/leave lps. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-6-pkshih@realtek.com commit 3893959cd8c7458a1ccdb7cea509c1dc2f34ef96 Author: Ching-Te Ku Date: Mon Jul 25 10:35:04 2022 +0800 rtw89: coex: Define BT B1 slot length It is for setting up BT slot max length at BT auto slot mechanism. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-5-pkshih@realtek.com commit 1162584c799db3f63ebc7105c146fe4e495e01f5 Author: Ching-Te Ku Date: Mon Jul 25 10:35:03 2022 +0800 rtw89: coex: Add logic to parsing rtl8852c firmware type ctrl report Add a part of logic to parse type of ctrl report from firmware, and remove Bluetooth packet counter count from driver, the feature was moved to firmware at rtl8852c. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-4-pkshih@realtek.com commit ba787c07ca1beef090b97368d80ceff117e86f4d Author: Ching-Te Ku Date: Mon Jul 25 10:35:02 2022 +0800 rtw89: coex: Move Wi-Fi firmware coexistence matching version to chip To configure the different chips with different coexistence version, separated the firmware feature version matching number is necessary. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-3-pkshih@realtek.com commit 38ede035a21b849be102d549dd368fd793600abf Author: Ching-Te Ku Date: Mon Jul 25 10:35:01 2022 +0800 rtw89: coex: update radio state for RTL8852A/RTL8852C Update scoreboard setting to let Bluetooth know Wi-Fi power save state. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220725023509.43114-2-pkshih@realtek.com commit ee5469046474e2de82ef9992ce241224d944fe2b Author: Chia-Yuan Li Date: Mon Jul 4 10:34:53 2022 +0800 rtw89: 8852c: adjust mactxen delay of mac/phy interface mac_txen time is to inform TMAC tx after rx air end. Modify 8852c value to meet TB SIFS time. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-7-pkshih@realtek.com commit 60b2ede9dd385f8191f5ef54c6ba87b0e35f501b Author: Chia-Yuan Li Date: Mon Jul 4 10:34:52 2022 +0800 rtw89: 8852c: modify PCIE prebkf time Prebkf time is to inform generating tx command if remaining backoff time less than this setting value. It might cause SER if generating tx command early in security mode. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-6-pkshih@realtek.com commit 8676031bae1c91037d06341214f4150b33707c68 Author: Zong-Zhe Yang Date: Mon Jul 4 10:34:51 2022 +0800 rtw89: ser: leave lps with mutex Calling rtw89_leave_lps() should hold rtwdev::mutex. So, fix it. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-5-pkshih@realtek.com commit 917606d779107f6e44c878185fb23a1c6d5b00d6 Author: Ping-Ke Shih Date: Mon Jul 4 10:34:50 2022 +0800 rtw89: declare support HE HTC always Correct ability of HE HTC that both STA and AP mode can support. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-4-pkshih@realtek.com commit 22e2f847c526f28e7c9fdb75ac00e9a3019a8b1c Author: Zong-Zhe Yang Date: Mon Jul 4 10:34:49 2022 +0800 rtw89: 8852a: update HW setting on BB Sometimes, BB might encounter RX problem on OFDM 6M. It's not quite easy to happen, but if it happens, we will keep getting stuck on RX. And, since we cannot properly receive layer 2 ACK, it also casues TX problem, e.g. constantly retrying TX. Eventually, after some time, we would get disconnected due to abnormal behavior. Update break setting and phy status parsing time to make BB get out of stuck state faster. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-3-pkshih@realtek.com commit 0e91d191cf4b55119c215de42db523b25375f878 Author: Po-Hao Huang Date: Mon Jul 4 10:34:48 2022 +0800 rtw89: 8852c: disable dma during mac init Without this patch, our hardware attempts to perform dma while device cpu restarts, and leads to iommu page faults caused by invalid requests. Some platforms show warning messages as below: rtw89_8852ce 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x10000000004 flags=0x0030] Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220704023453.19935-2-pkshih@realtek.com commit deebea35d6999e12d335febe9ea45334b8010902 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:52 2022 +0800 wifi: rtw89: early recognize FW feature to decide if chanctx In current flow, FW is asynchronously loaded after alloc_hw(). It defers the decision on FW feature map. It makes things difficult for us to decide whether to hook chanctx ops, which should be decided while alloc_hw() is calling. Still, asynchronous gets its advantages. So, we want to resolve this without dropping them. Based on multi-FW flag, RTW89_MFW_SIG, we can determine runtime FW is multi-FW (MFW) or single FW (SFW). Both of them have a quite small chunk for header at the head. The difference is that MFW doesn't describe version code in its header while SFW does. So, we plan to extend MFW header for version code. After that, in both cases, we can determine FW feature map by just FW header. And, according to the map, we can decide chanctx. So, we call request_partial_firmware_into_buf() to request a quite small chunk before alloc_hw() to get a early FW feature map without affecting things much and only use early map to decide whether to hook chanctx ops. It means that if non-extended MFW is used at runtime, driver just acts without chanctx as before. If extended MFW or SFW, which supports required FW features, is used at runtime, driver can hook chanctx ops to mac80211 if chip has configured support_chanctx_num > 0. Besides, key point for now to support single one chanctx is whether HW scan is supported at runtime. So, we configure all chip's support_chanctx_num to 1, and check if HW scan is supported at runtime via early FW feature map. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-14-pkshih@realtek.com commit 7fc06a071cd5f5e60ed799f6ab37e8901bd91f82 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:51 2022 +0800 wifi: rtw89: declare support for mac80211 chanctx ops by chip Some HW features are required if we hook chanctx ops to mac80211. With it, mac80211 would expect the HW-supported variant ops exists on some behavior, e.g. HW scan. But, HW features may depend on chip's FW or its development. Besides, how many chanctx can be supported also depends on chip design. We can neither decide whether to generally support chanctx ops nor how many chanctx can be supported. So, support_chanctx_num is added under chip info to deal with this by chip. For now, all chip configure support_chanctx_num as 0. We haven't really hook chanctx ops yet. So, chip can run without mac80211 chanctx as before. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-13-pkshih@realtek.com commit 84b50f4187fcd71efb4ad8ad337d30055f1c996b Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:50 2022 +0800 wifi: rtw89: add skeleton of mac80211 chanctx ops support Support mac80211 chanctx series ops. Still, currently support single channel. Based on this premise, things should be similar to before. So, we haven't dealt with relationship between vif and chanctx in depth. Instead, we leave both ::assign_vif() and ::unassign_vif() as noops for now. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-12-pkshih@realtek.com commit 7cf674ffc8527aa683d0b6b2551e028b84756ae6 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:49 2022 +0800 wifi: rtw89: introduce entity mode and its recalculated prototype After supporting more than one channel, we need entity mode to decide how to set current channel(s) on the sub-entities. This decision may happen on set_channel() and rtw89_core_set_chip_txpwr(). For now, we support single one channel and use only first HW entry, i.e. RTW89_SUB_ENTITY_0, RTW89_MAC_0, RTW89_PHY_0. Without something unexpected, the entity mode should always be RTW89_ENT_MODE_SCC after recalcated, where SCC means single channel concurrency. So, an assert is added in set_channel() and rtw89_core_set_chip_txpwr(). Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-11-pkshih@realtek.com commit a88b6cc483ab035d7c9d6f9a0ba29194f2e08df0 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:48 2022 +0800 wifi: rtw89: initialize entity and configure default chandef While idle, we need a default chandef to set channel for things, such as scan. Before support of mac80211 chanctx, mac80211 would configure a default one on ieee80211_hw::conf::chandef. And we just queried it whenever we did set channel. However, after support of mac80211 chanctx, the flow won't work like before. Besides, we don't now query chandef from ieee80211_hw::conf::chandef either. So, similar to mac80211 without using chanctx, we configure the default chandef with ieee80211_channel of index 0 in 2GHz. Although we have not added the support of mac80211 chanctx here, this configuration should be compatible before that. So, we commit this ahead. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-10-pkshih@realtek.com commit 494399b2130c598f48bdc117eea4a6379e64ce31 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:47 2022 +0800 wifi: rtw89: concentrate chandef setting to stack callback Originally, we didn't support mac80211 chanctx, so it's expected that ieee80211_hw::conf::chandef would be filled by mac80211. And then, we could just query it whenever we need the current chandef. However, we are planing to support mac80211 chanctx. After that, the above assumption would be broken. So, we adjust a bit ahead to reduce future works about mac80211 chanctx. After this, we don't query ieee80211_hw::conf::chandef directly, and we add a map, entity_map, to HAL to indicate which chandef came from stack. And it will later be used to recalcate entity mode. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-9-pkshih@realtek.com commit ce57e55c0b70d0c976fd65681f07193889fad6de Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:46 2022 +0800 wifi: rtw89: concentrate parameter control for setting channel callback For future support on multiple channels by multiple sub-entities, we need to manage parameters of each channel instance like rtw89_chan, rtw89_mac_idx, rtw89_phy_idx. So, we adjust related channel callback functions and centrally conrtol these parameters in set_channel(). Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-8-pkshih@realtek.com commit 010d0051f7ec6bf4582e76c7ed6fa60f52362daa Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:45 2022 +0800 wifi: rtw89: rfk: concentrate parameter control while set_channel() For future support on multiple channels, there will be settings of multiple sub-entities that we need to control. We don't want such settings to be scattered all over the place. So, we centrally manage controls of rtw89_phy_idx for RFK in set_channel(). Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-7-pkshih@realtek.com commit 07ef5f2fa3f350e911710e6b4102601bd974e817 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:44 2022 +0800 wifi: rtw89: txpwr: concentrate channel related control to top For future support on multiple channels, it would be disturbing if we still allow scattered leaf functions of TX power to query and manage channel related control by themselves. So, query rtw89_chan only on top functions. Then, pass it via functions to make sure that the values coming from the same struct rtw89_chan. Besides, fix rtw8852a_set_txpwr_offset() from rtw8852a_set_txpwr_ctrl() to rtw8852a_set_txpwr(). TX power offset should consider current band, so move it to chip_ops::set_txpwr() which will be called every time that channel is set. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-6-pkshih@realtek.com commit bb8152b386c36a3fe742a50b782da502f03b98cb Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:43 2022 +0800 wifi: rtw89: create rtw89_chan centrally to avoid breakage Sometimes we need to write current rtw89_chan outside set_channel(), e.g. during HW scan, we adjust it to align FW process through C2H. However, we don't have full parameters to fill entire rtw89_chan. And it will breakage if we update only part of current rtw89_chan. That is what we don't want to see because most flows throughout driver treat rtw89_chan as a whole. So, we divide struct rtw89_chan to basic part and derived part. The basic part contains the parameters which we are always able to know. And the derived part will be calculated by the basic part. Then, a central function, rtw89_chan_create(), is added to deal with this. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-5-pkshih@realtek.com commit cbb145b98b63e1c479e2e23d3bc1f15bfe0e2b3a Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:42 2022 +0800 wifi: rtw89: re-arrange channel related stuffs under HAL We are planning to support mac80211 chanctx. To reduce future works, the driver architecture is adjusted first to isolate related things. According to chip, our HW may have multiple sub-entities to support multiple mac80211 chanctx. Struct rtw89_chan has been introduced for things about channel/band/subband/... Now introduce struct rtw89_chan_rcd to record difference after assigning new one of struct rtw89_chan. We will implement and support chanctx with single channel first, i.e. only use entry in RTW89_SUB_ENTITY_0, before handling dual channels. Our hierarchy in planning will become as the following. DEV -> HAL ---> entity (manage status across sub-entities) -----> sub-entity[*] (support mac80211 chanctx) where each sub-entity contains one struct rtw89_chan. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-4-pkshih@realtek.com commit 3e5831cac1e66f2e545b550424173d51ad9a3736 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:41 2022 +0800 wifi: rtw89: introduce rtw89_chan for channel stuffs Introduce struct rtw89_chan ahead to encapsulate stuffs from struct rtw89_channel_params. These stuffs have a clone in HAL and are used throughout driver. After multiple channels support, it's expected that each channel instance has a configuration of them. So, we refine them with struct rtw89_chan by precise type first, and will re-arrange HAL by struct rtw89_chan in the following as well. (No logic has changed.) Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-3-pkshih@realtek.com commit 967439c7a2a60923f9b4c8ac925d368af16fb165 Author: Zong-Zhe Yang Date: Tue Aug 9 18:49:40 2022 +0800 wifi: rtw89: rewrite decision on channel by entity state We need to invoke the callback of the changed band at the first set_channel() after every power-off. Originally, we forced the channel to be 0 when doing power-off, and then determined things by comparing channel with 0. However, deciding on such things by channel might be confusing. It's also confusing to use this kind of decision when we consider multiple channels in the follow-up patches. So, another flag, entity_active, is added ahead to HAL to deal with this. Besides, we also need to check if entity is active when we set TX power. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809104952.61355-2-pkshih@realtek.com commit 6cb634d0dc850cc1ae54868de7815df53e64a465 Author: Hans de Goede Date: Fri Apr 29 13:00:15 2022 +0200 ACPI: video: Remove code to unregister acpi_video backlight when a native backlight registers Remove the code to unregister acpi_video backlight devices when a native backlight device gets registered later. Now that the acpi_video backlight device registration is a separate step which runs later, after the drm/kms driver is done setting up its own native backlight device, it is no longer necessary to monitor for a native (BACKLIGHT_RAW) device showing up later and to then unregister the acpi_video backlight device(s). Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 3dbc80a3e4c55c4a5b89ef207bed7b7de36157b4 Author: Hans de Goede Date: Thu Apr 28 17:41:46 2022 +0200 ACPI: video: Make backlight class device registration a separate step (v2) On x86/ACPI boards the acpi_video driver will usually initialize before the kms driver (except i915). This causes /sys/class/backlight/acpi_video0 to show up and then the kms driver registers its own native backlight device after which the drivers/acpi/video_detect.c code unregisters the acpi_video0 device (when acpi_video_get_backlight_type()==native). This means that userspace briefly sees 2 devices and the disappearing of acpi_video0 after a brief time confuses the systemd backlight level save/restore code, see e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 To fix this make backlight class device registration a separate step done by a new acpi_video_register_backlight() function. The intend is for this to be called by the drm/kms driver *after* it is done setting up its own native backlight device. So that acpi_video_get_backlight_type() knows if a native backlight will be available or not at acpi_video backlight registration time, avoiding the add + remove dance. Note the new acpi_video_register_backlight() function is also called from a delayed work to ensure that the acpi_video backlight devices does get registered if necessary even if there is no drm/kms driver or when it is disabled. Changes in v2: - Make register_backlight_delay a module parameter, mainly so that it can be disabled by Nvidia binary driver users Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 038a8191ae7a636586a4415b001cece831ab7019 Author: Hans de Goede Date: Fri Apr 29 13:29:31 2022 +0200 ACPI: video: Simplify acpi_video_unregister_backlight() When acpi_video_register() has not run yet the video_bus_head will be empty, so there is no need to check the register_count flag first. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit c1af8bec569dd6b8d874c14455ab02398c3d34cd Author: Hans de Goede Date: Thu Apr 28 17:53:51 2022 +0200 ACPI: video: Remove acpi_video_bus from list before tearing it down Move the list_del removing an acpi_video_bus from video_bus_head on teardown to before the teardown is done, to avoid code iterating over the video_bus_head list seeing acpi_video_bus objects on there which are (partly) torn down already. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit a2fc3c899bb091ec69cd74d4d69d71f8b2acdc11 Author: Hans de Goede Date: Thu Apr 28 14:45:35 2022 +0200 ACPI: video: Drop backlight_device_get_by_type() call from acpi_video_get_backlight_type() All x86/ACPI kms drivers which register native/BACKLIGHT_RAW type backlight devices call acpi_video_backlight_use_native() now. This sets __acpi_video_get_backlight_type()'s internal static native_available flag. This makes the backlight_device_get_by_type(BACKLIGHT_RAW) check unnecessary. Relying on the cached native_available value not only is simpler, it will also work correctly in cases where then native backlight registration was skipped because of acpi_video_backlight_use_native() returning false. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 7f908d332dc48a12436725ae326d6143a1a02c1c Author: Hans de Goede Date: Fri Apr 15 22:25:01 2022 +0200 drm/nouveau: Don't register backlight when another backlight should be used (v2) Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Changes in v2: - Add nouveau_acpi_video_backlight_use_native() wrapper to avoid unresolved symbol errors on non X86 Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede commit 0b7baa1a307fcc66f66d7ca34244ee7a3899f92d Author: Horatiu Vultur Date: Fri Sep 2 08:24:47 2022 +0200 ARM: dts: lan966x: add led configuration Add led configuration for pcb8291 and pcb8309. Both pcbs have 4 leds which are connected to the sgpio controller. Signed-off-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220902062447.443846-1-horatiu.vultur@microchip.com commit 7fce8d6eccbc31a561d07c79f359ad09f0424347 Author: Ashok Raj Date: Mon Aug 29 18:10:30 2022 +0000 x86/microcode: Print previous version of microcode after reload Print both old and new versions of microcode after a reload is complete because knowing the previous microcode version is sometimes important from a debugging perspective. [ bp: Massage commit message. ] Signed-off-by: Ashok Raj Signed-off-by: Borislav Petkov Acked-by: Tony Luck Link: https://lore.kernel.org/r/20220829181030.722891-1-ashok.raj@intel.com commit aa51b80e1af47b3781abb1fb1666445a7616f0cd Author: Eric Dumazet Date: Wed Aug 31 13:37:29 2022 -0700 ipv6: tcp: send consistent autoflowlabel in SYN_RECV state This is a followup of commit c67b85558ff2 ("ipv6: tcp: send consistent autoflowlabel in TIME_WAIT state"), but for SYN_RECV state. In some cases, TCP sends a challenge ACK on behalf of a SYN_RECV request. WHen this happens, we want to use the flow label that was used when the prior SYNACK packet was sent, instead of another one. After his patch, following packetdrill passes: 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1) = 0 +.2 < S 0:0(0) win 32792 +0 > (flowlabel 0x11) S. 0:0(0) ack 1 <...> // Test if a challenge ack is properly sent (same flowlabel than prior SYNACK) +.01 < . 4000000000:4000000000(0) ack 1 win 320 +0 > (flowlabel 0x11) . 1:1(0) ack 1 Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220831203729.458000-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 1ab3d4175775378106965ce32a07248675680c2c Author: Vladimir Oltean Date: Wed Aug 31 20:08:39 2022 +0300 selftests: net: dsa: symlink the tc_actions.sh test This has been validated on the Ocelot/Felix switch family (NXP LS1028A) and should be relevant to any switch driver that offloads the tc-flower and/or tc-matchall actions trap, drop, accept, mirred, for which DSA has operations. TEST: gact drop and ok (skip_hw) [ OK ] TEST: mirred egress flower redirect (skip_hw) [ OK ] TEST: mirred egress flower mirror (skip_hw) [ OK ] TEST: mirred egress matchall mirror (skip_hw) [ OK ] TEST: mirred_egress_to_ingress (skip_hw) [ OK ] TEST: gact drop and ok (skip_sw) [ OK ] TEST: mirred egress flower redirect (skip_sw) [ OK ] TEST: mirred egress flower mirror (skip_sw) [ OK ] TEST: mirred egress matchall mirror (skip_sw) [ OK ] TEST: trap (skip_sw) [ OK ] TEST: mirred_egress_to_ingress (skip_sw) [ OK ] Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220831170839.931184-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 5603072e0b3733c076529e49ee3150cbb3a7a5cc Author: Jinpeng Cui Date: Wed Aug 31 15:43:29 2022 +0000 netdevsim: remove redundant variable ret Return value directly from nsim_dev_reload_create() instead of getting value from redundant variable ret. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Link: https://lore.kernel.org/r/20220831154329.305372-1-cui.jinpeng2@zte.com.cn Signed-off-by: Jakub Kicinski commit abbc79280abc5e57fc52a7671d1388f1f54c946f Author: Juhee Kang Date: Wed Aug 31 21:58:45 2022 +0900 net: rtnetlink: use netif_oper_up instead of open code The open code is defined as a new helper function(netif_oper_up) on netdev.h, the code is dev->operstate == IF_OPER_UP || dev->operstate == IF_OPER_UNKNOWN. Thus, replace the open code to netif_oper_up. This patch doesn't change logic. Signed-off-by: Juhee Kang Link: https://lore.kernel.org/r/20220831125845.1333-1-claudiajkang@gmail.com Signed-off-by: Jakub Kicinski commit 75aad41ac3cf3d8d1d2bdbcaf0f662402c1e6c02 Author: Zhengchao Shao Date: Wed Aug 31 17:29:19 2022 +0800 net: sched: etf: remove true check in etf_enable_offload() etf_enable_offload() is only called when q->offload is false in etf_init(). So remove true check in etf_enable_offload(). Signed-off-by: Zhengchao Shao Acked-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20220831092919.146149-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit ef331a8d4c0061ea4d353cd0db1c9b33fd45f0f2 Author: Hou Tao Date: Thu Sep 1 14:51:26 2022 +0800 bpf: Only add BTF IDs for socket security hooks when CONFIG_SECURITY_NETWORK is on When CONFIG_SECURITY_NETWORK is disabled, there will be build warnings from resolve_btfids: WARN: resolve_btfids: unresolved symbol bpf_lsm_socket_socketpair ...... WARN: resolve_btfids: unresolved symbol bpf_lsm_inet_conn_established Fixing it by wrapping these BTF ID definitions by CONFIG_SECURITY_NETWORK. Fixes: 69fd337a975c ("bpf: per-cgroup lsm flavor") Fixes: 9113d7e48e91 ("bpf: expose bpf_{g,s}etsockopt to lsm cgroup") Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220901065126.3856297-1-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit fd3f106677bac70437dc12e76c827294ed495a44 Author: Sean Wang Date: Thu Aug 11 08:49:07 2022 +0800 Bluetooth: btusb: mediatek: fix WMT failure during runtime suspend WMT cmd/event doesn't follow up the generic HCI cmd/event handling, it needs constantly polling control pipe until the host received the WMT event, thus, we should require to specifically acquire PM counter on the USB to prevent the interface from entering auto suspended while WMT cmd/event in progress. Fixes: a1c49c434e15 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices") Co-developed-by: Jing Cai Signed-off-by: Jing Cai Signed-off-by: Sean Wang Signed-off-by: Luiz Augusto von Dentz commit 4094d98e3375833737b467998219338ffd46a68b Author: Al Viro Date: Sat Aug 20 13:14:38 2022 -0400 orangefs: use ->f_mapping ... and don't check for impossible conditions - file_inode() is never NULL in anything seen by ->release() and neither is its ->i_mapping. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 265a04b076077b3f5a169231e290ad106d3aa2ca Author: Al Viro Date: Sat Aug 20 13:12:02 2022 -0400 _nfs42_proc_copy(): use ->f_mapping instead of file_inode()->i_mapping Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit ff58105a47ede2e9f3fe6f45e9b1185dcfde7762 Author: Al Viro Date: Sat Aug 20 13:10:13 2022 -0400 dma_buf: no need to bother with file_inode()->i_mapping ->f_mapping will do just fine Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 1f24cd31c28178415158366b676c2e18be812940 Author: Al Viro Date: Sat Aug 20 11:47:03 2022 -0400 nfs_finish_open(): don't open-code file_inode() Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit e6ae43812460450bdb42f14c5813ac42d6bc9067 Author: Al Viro Date: Sat Aug 20 11:46:10 2022 -0400 bprm_fill_uid(): don't open-code file_inode() Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 235185b8ed77fd930c252b415973d9a4d50a8700 Author: Al Viro Date: Sat Aug 20 11:44:05 2022 -0400 sgx: use ->f_mapping... Reviewed-by: Jarkko Sakkinen Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 703e3e9a9cb1221e59a088745482c02f863d7999 Author: Al Viro Date: Wed Aug 3 21:27:11 2022 -0400 exfat_iterate(): don't open-code file_inode(file) and it's file, not filp... Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 8789c172e55db6e545789450a293d05c619268b2 Author: Al Viro Date: Wed Aug 3 21:24:41 2022 -0400 ibmvmc: don't open-code file_inode() badly, at that... Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 88569546e8a13a0c1ccf119dac72376784b0ea42 Author: Al Viro Date: Thu Aug 4 13:24:00 2022 -0400 ecryptfs: constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 20f45ad50d654d4788af9abd840b227d6429329d Author: Al Viro Date: Thu Aug 4 13:21:17 2022 -0400 spufs: constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit ea4af4aa03c3966c63231b4191da94497de8f034 Author: Al Viro Date: Thu Aug 4 13:19:18 2022 -0400 nd_jump_link(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit bf2e1ae41731f940f9b977820e4c68454a639909 Author: Al Viro Date: Thu Aug 4 13:15:52 2022 -0400 audit_init_parent(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit e81f574da024f662cf39fc4ff60f464ec6364ac6 Author: Al Viro Date: Thu Aug 4 13:13:35 2022 -0400 __io_setxattr(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 5b09c9fec0868e72dfafa5302caef5bf6933f4dd Author: Al Viro Date: Thu Aug 4 13:11:42 2022 -0400 do_proc_readlink(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 2d3430875a3a9761fcbd10aed4396b464ed5078c Author: Al Viro Date: Thu Aug 4 13:11:15 2022 -0400 overlayfs: constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit d5bf88895f24686641c39420ee6df716dc1d95d8 Author: Al Viro Date: Thu Aug 4 12:57:38 2022 -0400 fs/notify: constify path Reviewed-by: Matthew Bobrowski Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 8996682b10ff4de4f6f36fc81211f0a1c0437495 Author: Al Viro Date: Thu Aug 4 12:53:46 2022 -0400 may_linkat(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 6ccaaf59c335a8af742bdf5922a49fc11b422e8b Author: Al Viro Date: Thu Aug 4 12:46:18 2022 -0400 do_sys_name_to_handle(): constify path Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit c8e477c649b40c1a073b7a843d89e51dc0037db7 Author: Al Viro Date: Sun Jan 30 19:57:52 2022 -0500 ->getprocattr(): attribute name is const char *, TYVM... cast of ->d_name.name to char * is completely wrong - nothing is allowed to modify its contents. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Paul Moore Acked-by: Casey Schaufler Signed-off-by: Al Viro commit 2e488f13755ffbb60f307e991b27024716a33b29 Author: Dongliang Mu Date: Tue Aug 16 12:08:58 2022 +0800 fs: fix UAF/GPF bug in nilfs_mdt_destroy In alloc_inode, inode_init_always() could return -ENOMEM if security_inode_alloc() fails, which causes inode->i_private uninitialized. Then nilfs_is_metadata_file_inode() returns true and nilfs_free_inode() wrongly calls nilfs_mdt_destroy(), which frees the uninitialized inode->i_private and leads to crashes(e.g., UAF/GPF). Fix this by moving security_inode_alloc just prior to this_cpu_inc(nr_inodes) Link: https://lkml.kernel.org/r/CAFcO6XOcf1Jj2SeGt=jJV59wmhESeSKpfR0omdFRq+J9nD1vfQ@mail.gmail.com Reported-by: butt3rflyh4ck Reported-by: Hao Sun Reported-by: Jiacheng Xu Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Dongliang Mu Cc: Al Viro Cc: stable@vger.kernel.org Signed-off-by: Al Viro commit 245898eb9275ce31942cff95d0bdc7412ad3d589 Author: Shameer Kolothum Date: Wed Aug 31 09:59:43 2022 +0100 hisi_acc_vfio_pci: Correct the function prefix for hssi_acc_drvdata() Commit 91be0bd6c6cf("vfio/pci: Have all VFIO PCI drivers store the vfio_pci_core_device in drvdata") introduced a helper function to retrieve the drvdata but used "hssi" instead of "hisi" for the function prefix. Correct that and also while at it, moved the function a bit down so that it's close to other hisi_ prefixed functions. No functional changes. Signed-off-by: Shameer Kolothum Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220831085943.993-1-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson commit 21c13829bc3b786bc5336470df023ae54e41d230 Author: Jason Gunthorpe Date: Tue Aug 16 16:13:04 2022 -0300 vfio: Remove vfio_group dev_counter This counts the number of devices attached to a vfio_group, ie the number of items in the group->device_list. It is only read in vfio_pin_pages(), as some kind of protection against limitations in type1. However, with all the code cleanups in this area, now that vfio_pin_pages() accepts a vfio_device directly it is redundant. All drivers are already calling vfio_register_emulated_iommu_dev() which directly creates a group specifically for the device and thus it is guaranteed that there is a singleton group. Leave a note in the comment about this requirement and remove the logic. Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/0-v2-d4374a7bf0c9+c4-vfio_dev_counter_jgg@nvidia.com Signed-off-by: Alex Williamson commit 453e6c98fd2bdae0df9adbc86af8d8bf1164edd5 Author: Abhishek Sahu Date: Mon Aug 29 17:18:50 2022 +0530 vfio/pci: Implement VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP This patch implements VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP device feature. In the VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY, if there is any access for the VFIO device on the host side, then the device will be moved out of the low power state without the user's guest driver involvement. Once the device access has been finished, then the host can move the device again into low power state. With the low power entry happened through VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP, the device will not be moved back into the low power state and a notification will be sent to the user by triggering wakeup eventfd. vfio_pci_core_pm_entry() will be called for both the variants of low power feature entry so add an extra argument for wakeup eventfd context and store locally in 'struct vfio_pci_core_device'. For the entry happened without wakeup eventfd, all the exit related handling will be done by the LOW_POWER_EXIT device feature only. When the LOW_POWER_EXIT will be called, then the vfio core layer vfio_device_pm_runtime_get() will increment the usage count and will resume the device. In the driver runtime_resume callback, the 'pm_wake_eventfd_ctx' will be NULL. Then vfio_pci_core_pm_exit() will call vfio_pci_runtime_pm_exit() and all the exit related handling will be done. For the entry happened with wakeup eventfd, in the driver resume callback, eventfd will be triggered and all the exit related handling will be done. When vfio_pci_runtime_pm_exit() will be called by vfio_pci_core_pm_exit(), then it will return early. But if the runtime suspend has not happened on the host side, then all the exit related handling will be done in vfio_pci_core_pm_exit() only. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220829114850.4341-6-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit cc2742fe3660cc6500021d3da8f937d326392dbd Author: Abhishek Sahu Date: Mon Aug 29 17:18:49 2022 +0530 vfio/pci: Implement VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY/EXIT Currently, if the runtime power management is enabled for vfio-pci based devices in the guest OS, then the guest OS will do the register write for PCI_PM_CTRL register. This write request will be handled in vfio_pm_config_write() where it will do the actual register write of PCI_PM_CTRL register. With this, the maximum D3hot state can be achieved for low power. If we can use the runtime PM framework, then we can achieve the D3cold state (on the supported systems) which will help in saving maximum power. 1. D3cold state can't be achieved by writing PCI standard PM config registers. This patch implements the following newly added low power related device features: - VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY - VFIO_DEVICE_FEATURE_LOW_POWER_EXIT The VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY feature will allow the device to make use of low power platform states on the host while the VFIO_DEVICE_FEATURE_LOW_POWER_EXIT will prevent further use of those power states. 2. The vfio-pci driver uses runtime PM framework for low power entry and exit. On the platforms where D3cold state is supported, the runtime PM framework will put the device into D3cold otherwise, D3hot or some other power state will be used. There are various cases where the device will not go into the runtime suspended state. For example, - The runtime power management is disabled on the host side for the device. - The user keeps the device busy after calling LOW_POWER_ENTRY. - There are dependent devices that are still in runtime active state. For these cases, the device will be in the same power state that has been configured by the user through PCI_PM_CTRL register. 3. The hypervisors can implement virtual ACPI methods. For example, in guest linux OS if PCI device ACPI node has _PR3 and _PR0 power resources with _ON/_OFF method, then guest linux OS invokes the _OFF method during D3cold transition and then _ON during D0 transition. The hypervisor can tap these virtual ACPI calls and then call the low power device feature IOCTL. 4. The 'pm_runtime_engaged' flag tracks the entry and exit to runtime PM. This flag is protected with 'memory_lock' semaphore. 5. All the config and other region access are wrapped under pm_runtime_resume_and_get() and pm_runtime_put(). So, if any device access happens while the device is in the runtime suspended state, then the device will be resumed first before access. Once the access has been finished, then the device will again go into the runtime suspended state. 6. The memory region access through mmap will not be allowed in the low power state. Since __vfio_pci_memory_enabled() is a common function, so check for 'pm_runtime_engaged' has been added explicitly in vfio_pci_mmap_fault() to block only mmap'ed access. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220829114850.4341-5-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 4813724c4b76b62f8e6b60dd5655633d0db1c9a8 Author: Abhishek Sahu Date: Mon Aug 29 17:18:48 2022 +0530 vfio/pci: Mask INTx during runtime suspend This patch adds INTx handling during runtime suspend/resume. All the suspend/resume related code for the user to put the device into the low power state will be added in subsequent patches. The INTx lines may be shared among devices. Whenever any INTx interrupt comes for the VFIO devices, then vfio_intx_handler() will be called for each device sharing the interrupt. Inside vfio_intx_handler(), it calls pci_check_and_mask_intx() and checks if the interrupt has been generated for the current device. Now, if the device is already in the D3cold state, then the config space can not be read. Attempt to read config space in D3cold state can cause system unresponsiveness in a few systems. To prevent this, mask INTx in runtime suspend callback, and unmask the same in runtime resume callback. If INTx has been already masked, then no handling is needed in runtime suspend/resume callbacks. 'pm_intx_masked' tracks this, and vfio_pci_intx_mask() has been updated to return true if the INTx vfio_pci_irq_ctx.masked value is changed inside this function. For the runtime suspend which is triggered for the no user of VFIO device, the 'irq_type' will be VFIO_PCI_NUM_IRQS and these callbacks won't do anything. The MSI/MSI-X are not shared so similar handling should not be needed for MSI/MSI-X. vfio_msihandler() triggers eventfd_signal() without doing any device-specific config access. When the user performs any config access or IOCTL after receiving the eventfd notification, then the device will be moved to the D0 state first before servicing any request. Another option was to check this flag 'pm_intx_masked' inside vfio_intx_handler() instead of masking the interrupts. This flag is being set inside the runtime_suspend callback but the device can be in non-D3cold state (for example, if the user has disabled D3cold explicitly by sysfs, the D3cold is not supported in the platform, etc.). Also, in D3cold supported case, the device will be in D0 till the PCI core moves the device into D3cold. In this case, there is a possibility that the device can generate an interrupt. Adding check in the IRQ handler will not clear the IRQ status and the interrupt line will still be asserted. This can cause interrupt flooding. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220829114850.4341-4-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 8e5c6995113d201addd651dc2db8e11c93ce639f Author: Abhishek Sahu Date: Mon Aug 29 17:18:47 2022 +0530 vfio: Increment the runtime PM usage count during IOCTL call The vfio-pci based drivers will have runtime power management support where the user can put the device into the low power state and then PCI devices can go into the D3cold state. If the device is in the low power state and the user issues any IOCTL, then the device should be moved out of the low power state first. Once the IOCTL is serviced, then it can go into the low power state again. The runtime PM framework manages this with help of usage count. One option was to add the runtime PM related API's inside vfio-pci driver but some IOCTL (like VFIO_DEVICE_FEATURE) can follow a different path and more IOCTL can be added in the future. Also, the runtime PM will be added for vfio-pci based drivers variant currently, but the other VFIO based drivers can use the same in the future. So, this patch adds the runtime calls runtime-related API in the top-level IOCTL function itself. For the VFIO drivers which do not have runtime power management support currently, the runtime PM API's won't be invoked. Only for vfio-pci based drivers currently, the runtime PM API's will be invoked to increment and decrement the usage count. In the vfio-pci drivers also, the variant drivers can opt-out by incrementing the usage count during device-open. The pm_runtime_resume_and_get() checks the device current status and will return early if the device is already in the ACTIVE state. Taking this usage count incremented while servicing IOCTL will make sure that the user won't put the device into the low power state when any other IOCTL is being serviced in parallel. Let's consider the following scenario: 1. Some other IOCTL is called. 2. The user has opened another device instance and called the IOCTL for low power entry. 3. The low power entry IOCTL moves the device into the low power state. 4. The other IOCTL finishes. If we don't keep the usage count incremented then the device access will happen between step 3 and 4 while the device has already gone into the low power state. The pm_runtime_resume_and_get() will be the first call so its error should not be propagated to user space directly. For example, if pm_runtime_resume_and_get() can return -EINVAL for the cases where the user has passed the correct argument. So the pm_runtime_resume_and_get() errors have been masked behind -EIO. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220829114850.4341-3-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 385ecfdfb5d5ad0ff37e20381c70e18af8cf1bdb Author: Abhishek Sahu Date: Mon Aug 29 17:18:46 2022 +0530 vfio: Add the device features for the low power entry and exit This patch adds the following new device features for the low power entry and exit in the header file. The implementation for the same will be added in the subsequent patches. - VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY - VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP - VFIO_DEVICE_FEATURE_LOW_POWER_EXIT For vfio-pci based devices, with the standard PCI PM registers, all power states cannot be achieved. The platform-based power management needs to be involved to go into the lowest power state. For doing low power entry and exit with platform-based power management, these device features can be used. The entry device feature has two variants. These two variants are mainly to support the different behaviour for the low power entry. If there is any access for the VFIO device on the host side, then the device will be moved out of the low power state without the user's guest driver involvement. Some devices (for example NVIDIA VGA or 3D controller) require the user's guest driver involvement for each low-power entry. In the first variant, the host can return the device to low power automatically. The device will continue to attempt to reach low power until the low power exit feature is called. In the second variant, if the device exits low power due to an access, the host kernel will signal the user via the provided eventfd and will not return the device to low power without a subsequent call to one of the low power entry features. A call to the low power exit feature is optional if the user provided eventfd is signaled. These device features only support VFIO_DEVICE_FEATURE_SET and VFIO_DEVICE_FEATURE_PROBE operations. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220829114850.4341-2-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 99a27c088b9c76d9e0f2a36152ffaf9891b224d3 Author: Jason Gunthorpe Date: Wed Aug 31 17:16:03 2022 -0300 vfio: Split VFIO_GROUP_GET_STATUS into a function This is the last sizable implementation in vfio_group_fops_unl_ioctl(), move it to a function so vfio_group_fops_unl_ioctl() is emptied out. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/8-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit b3b43590fa276aef824a300b911fe5fb9083dbf5 Author: Jason Gunthorpe Date: Wed Aug 31 17:16:02 2022 -0300 vfio: Follow the naming pattern for vfio_group_ioctl_unset_container() Make it clear that this is the body of the ioctl. Fold the locking into the function so it is self contained like the other ioctls. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/7-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 67671f153e6b5a379623b57881a6cf99b4a6f977 Author: Jason Gunthorpe Date: Wed Aug 31 17:16:01 2022 -0300 vfio: Fold VFIO_GROUP_SET_CONTAINER into vfio_group_set_container() No reason to split it up like this, just have one function to process the ioctl. Move the lock into the function as well to avoid having a lockdep annotation. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 150ee2f9cd9411a3fdbc55cef2fb01349216dbd7 Author: Jason Gunthorpe Date: Wed Aug 31 17:16:00 2022 -0300 vfio: Fold VFIO_GROUP_GET_DEVICE_FD into vfio_group_get_device_fd() No reason to split it up like this, just have one function to process the ioctl. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 663eab456e072bbcd02c2516d54b53f7ecd57dd3 Author: Jason Gunthorpe Date: Wed Aug 31 17:15:59 2022 -0300 vfio-pci: Replace 'void __user *' with proper types in the ioctl functions This makes the code clearer and replaces a few places trying to access a flex array with an actual flex array. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit ea3fc04d4fad2d31adb8a25115d4bd53b214bfc4 Author: Jason Gunthorpe Date: Wed Aug 31 17:15:58 2022 -0300 vfio-pci: Re-indent what was vfio_pci_core_ioctl() Done mechanically with: $ git clang-format-14 -i --lines 675:1210 drivers/vfio/pci/vfio_pci_core.c And manually reflow the multi-line comments clang-format doesn't fix. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 2ecf3b58ed7bc52ad58e02bb1596130fa6e6da53 Author: Jason Gunthorpe Date: Wed Aug 31 17:15:57 2022 -0300 vfio-pci: Break up vfio_pci_core_ioctl() into one function per ioctl 500 lines is a bit long for a single function, move the bodies of each ioctl into separate functions and leave behind a switch statement to dispatch them. This patch just adds the function declarations and does not fix the indenting. The next patch will restore the indenting. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit 16f4cbd9e156193312db19a68fe37c09854f77a8 Author: Jason Gunthorpe Date: Wed Aug 31 17:15:56 2022 -0300 vfio-pci: Fix vfio_pci_ioeventfd() to return int This only returns 0 or -ERRNO, it should return int like all the other ioctl dispatch functions. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com Signed-off-by: Alex Williamson commit c462a8c5d98877b76cf229d3d605d2a865aa9c9e Author: Jason Gunthorpe Date: Fri Aug 26 16:34:03 2022 -0300 vfio/pci: Simplify the is_intx/msi/msix/etc defines Only three of these are actually used, simplify to three inline functions, and open code the if statement in vfio_pci_config.c. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/3-v2-1bd95d72f298+e0e-vfio_pci_priv_jgg@nvidia.com Signed-off-by: Alex Williamson commit 1e979ef5df8b7b604a625343a179b812a7984068 Author: Jason Gunthorpe Date: Fri Aug 26 16:34:02 2022 -0300 vfio/pci: Rename vfio_pci_register_dev_region() As this is part of the vfio_pci_core component it should be called vfio_pci_core_register_dev_region() like everything else exported from this module. Suggested-by: Kevin Tian Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/2-v2-1bd95d72f298+e0e-vfio_pci_priv_jgg@nvidia.com Signed-off-by: Alex Williamson commit e34a0425b8ef524355811e7408dc1d53d08dc538 Author: Jason Gunthorpe Date: Fri Aug 26 16:34:01 2022 -0300 vfio/pci: Split linux/vfio_pci_core.h The header in include/linux should have only the exported interface for other vfio_pci modules to use. Internal definitions for vfio_pci.ko should be in a "priv" header along side the .c files. Move the internal declarations out of vfio_pci_core.h. They either move to vfio_pci_priv.h or to the C file that is the only user. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/1-v2-1bd95d72f298+e0e-vfio_pci_priv_jgg@nvidia.com Signed-off-by: Alex Williamson commit ccf365eac0c7705591dee0158ae5c198d9e8f858 Author: Jiapeng Chong Date: Wed Aug 31 10:16:18 2022 +0800 bpf: Remove useless else if The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it and add a comment to make the code here readable. ./kernel/bpf/cgroup_iter.c:81:6-8: WARNING: possible condition with no effect (if == else). Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2016 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220831021618.86770-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Martin KaFai Lau commit 60ad1100d525699bce83690757ff3077c6ab83ab Merge: 4bf8594a8036f 42e66b1cc3a07 Author: Jakub Kicinski Date: Thu Sep 1 12:58:02 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net tools/testing/selftests/net/.gitignore sort the net-next version and use it Signed-off-by: Jakub Kicinski commit 23d86c8e02e55e511cd37e7ef2280a0030750954 Merge: c9ae8c966f05c 73b97bc78b32e Author: Martin KaFai Lau Date: Thu Sep 1 12:11:45 2022 -0700 Merge branch 'Use this_cpu_xxx for preemption-safety' Hou Tao says: ==================== From: Hou Tao Hi, The patchset aims to make the update of per-cpu prog->active and per-cpu bpf_task_storage_busy being preemption-safe. The problem is on same architectures (e.g. arm64), __this_cpu_{inc|dec|inc_return} are neither preemption-safe nor IRQ-safe, so under fully preemptible kernel the concurrent updates on these per-cpu variables may be interleaved and the final values of these variables may be not zero. Patch 1 & 2 use the preemption-safe per-cpu helpers to manipulate prog->active and bpf_task_storage_busy. Patch 3 & 4 add a test case in map_tests to show the concurrent updates on the per-cpu bpf_task_storage_busy by using __this_cpu_{inc|dec} are not atomic. Comments are always welcome. Regards, Tao Change Log: v2: * Patch 1: update commit message to indicate the problem is only possible for fully preemptible kernel * Patch 2: a new patch which fixes the problem for prog->active * Patch 3 & 4: move it to test_maps and make it depend on CONFIG_PREEMPT v1: https://lore.kernel.org/bpf/20220829142752.330094-1-houtao@huaweicloud.com/ ==================== Signed-off-by: Martin KaFai Lau commit 73b97bc78b32eb739a7dd3394fa3981e8021c0ef Author: Hou Tao Date: Thu Sep 1 14:19:38 2022 +0800 selftests/bpf: Test concurrent updates on bpf_task_storage_busy Under full preemptible kernel, task local storage lookup operations on the same CPU may update per-cpu bpf_task_storage_busy concurrently. If the update of bpf_task_storage_busy is not preemption safe, the final value of bpf_task_storage_busy may become not-zero forever and bpf_task_storage_trylock() will always fail. So add a test case to ensure the update of bpf_task_storage_busy is preemption safe. Will skip the test case when CONFIG_PREEMPT is disabled, and it can only reproduce the problem probabilistically. By increasing TASK_STORAGE_MAP_NR_LOOP and running it under ARM64 VM with 4-cpus, it takes about four rounds to reproduce: > test_maps is modified to only run test_task_storage_map_stress_lookup() $ export TASK_STORAGE_MAP_NR_THREAD=256 $ export TASK_STORAGE_MAP_NR_LOOP=81920 $ export TASK_STORAGE_MAP_PIN_CPU=1 $ time ./test_maps test_task_storage_map_stress_lookup(135):FAIL:bad bpf_task_storage_busy got -2 real 0m24.743s user 0m6.772s sys 0m17.966s Signed-off-by: Hou Tao Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20220901061938.3789460-5-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit c710136e87747f1cc8e24948b3046ee57a1fe2eb Author: Hou Tao Date: Thu Sep 1 14:19:37 2022 +0800 selftests/bpf: Move sys_pidfd_open() into task_local_storage_helpers.h sys_pidfd_open() is defined twice in both test_bprm_opts.c and test_local_storage.c, so move it to a common header file. And it will be used in map_tests as well. Signed-off-by: Hou Tao Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20220901061938.3789460-4-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit c89e843a11f1075d27684f6b42256213e4592383 Author: Hou Tao Date: Thu Sep 1 14:19:36 2022 +0800 bpf: Use this_cpu_{inc_return|dec} for prog->active Both __this_cpu_inc_return() and __this_cpu_dec() are not preemption safe and now migrate_disable() doesn't disable preemption, so the update of prog-active is not atomic and in theory under fully preemptible kernel recurisve prevention may do not work. Fixing by using the preemption-safe and IRQ-safe variants. Fixes: ca06f55b9002 ("bpf: Add per-program recursion prevention mechanism") Signed-off-by: Hou Tao Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20220901061938.3789460-3-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 197827a05e13808c60f52632e9887eede63f1c16 Author: Hou Tao Date: Thu Sep 1 14:19:35 2022 +0800 bpf: Use this_cpu_{inc|dec|inc_return} for bpf_task_storage_busy Now migrate_disable() does not disable preemption and under some architectures (e.g. arm64) __this_cpu_{inc|dec|inc_return} are neither preemption-safe nor IRQ-safe, so for fully preemptible kernel concurrent lookups or updates on the same task local storage and on the same CPU may make bpf_task_storage_busy be imbalanced, and bpf_task_storage_trylock() on the specific cpu will always fail. Fixing it by using this_cpu_{inc|dec|inc_return} when manipulating bpf_task_storage_busy. Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]") Signed-off-by: Hou Tao Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20220901061938.3789460-2-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 32d1ffcd3979b75b6d7271a3028f4df2ef181a88 Author: Hamza Mahfooz Date: Thu Sep 1 10:15:10 2022 -0400 drm/amd/display: fix indentation in commit_planes_for_stream() Address the following warning: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3508:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 3508 | if (update_type != UPDATE_TYPE_FAST) | ^~ drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3510:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 3510 | if (update_type != UPDATE_TYPE_FAST) | ^~ Acked-by: Alex Deucher Reviewed-by: Rodrigo Siqueira Signed-off-by: Hamza Mahfooz Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 922710a82d267b785fbc892081c01e68148afe3b Author: Asher Song Date: Wed Aug 31 13:47:33 2022 +0800 drm/amd/display: remove a duplicated declaration There are duplicated declarations of i, remove one of those. Signed-off-by: Asher Song Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 63127922e15565861a0868561c1479c2e490b8e2 Author: Jane Jian Date: Mon Aug 22 15:21:04 2022 +0800 drm/amdgpu/vcn: Add MMSCH v4_0 support for sriov These structures are basically ported from MMSCH v3_0, besides, added RB and RB4 enablement flag to support unified queue Acked-by: Christian König Signed-off-by: Jane Jian Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit aa44beb5f0155d13a24edc0ae94fc8ad1196132b Author: Jane Jian Date: Mon Aug 22 15:20:24 2022 +0800 drm/amdgpu/vcn: Add sriov VCN v4_0 unified queue support Enable unified queue support for sriov, abandon all previous multi-queue settings Acked-by: Christian König Signed-off-by: Jane Jian Reviewed-by: Ruijing Dong Signed-off-by: Alex Deucher commit 60e9c7ee3fec7e4f40b1bb8e4e58be03a12c9eb1 Author: Jane Jian Date: Mon Aug 22 15:19:11 2022 +0800 drm/amdgpu/vcn: Add vcn/vcn1 in white list to load its firmware under sriov Previously since vcn0/vcn1 are not enabled, loading firmware is skipped. Now add firmware loading back since vcn0/vcn1 has already been enabled on sriov Acked-by: Christian König Signed-off-by: Jane Jian Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c322b422ab0f7b3b15c0cdd3f2c534094eaefcef Author: Jane Jian Date: Mon Aug 22 15:15:32 2022 +0800 drm/amdgpu/vcn: Disable CG/PG for SRIOV For sriov, CG and MG are controlled from hypervisor side, no need to manage them again in ip init Acked-by: Christian König Signed-off-by: Jane Jian Reviewed-by: Sonny Jiang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 72be7316587835e0c76dad472569453e902b562e Author: Yifan Zha Date: Tue Aug 23 13:54:57 2022 +0800 drm/amd: Skip smu_v13 register irq on SRIOV VF [Why] VF do not need to handle SMU IRQ state. L1 Policy will block VF access THM_THERMAL_INT_CTRL and MP1_SMN_IH_SW_INT/CNTL. [How] Skip smu_v13 init register_irq_handler under SRIOV VF. And add irq_src check in enable/disable thermal alert to avoid thermal alert enable/disable fail. Acked-by: Christian König Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 828418259254863e0af5805bd712284e2bd88e3b Author: Yifan Zha Date: Fri Aug 19 11:02:19 2022 +0800 drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF [Why] There is no CG(Clock Gating)/PG(Power Gating) requirement on SRIOV VF. For multi VF, VF should not enable any CG/PG features. For one VF, PF will program CG/PG related registers. [How] Do not set any cg/pg flag bit at early init under sriov. Acked-by: Christian König Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bbb860d46fcbde5881c93ed549445a85f2434a64 Author: Yifan Zha Date: Wed Aug 17 17:25:15 2022 +0800 drm/amdgpu: Use RLCG to program GRBM_GFX_CNTL during full access time [Why] KIQ register init requires GRBM_GFX_CNTL to select KIQ. [How] As RLCG accessing registers will save the data of GRBM_GFX_CNTL and restore it. Use RLCG indirect accessing register method to select grbm instead of mmio directly access. Acked-by: Christian König Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 08c8442c4a032194d6956a266810bf109cdfc138 Author: Yifan Zha Date: Wed Aug 17 18:44:14 2022 +0800 drm/amdgpu: Skip program SDMA0_SEM_WAIT_FAIL_TIMER_CNTL under SRIOV VF [Why] As SDMA0_SEM_WAIT_FAIL_TIMER_CNTL is a PF-only register, L1 would block this register for VF access. [How] VF do not program it. Acked-by: Christian König Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 40ad3e545b3da75f107450d32bcad8346fce5dcc Author: Yifan Zha Date: Wed Jul 27 14:43:32 2022 +0800 drm/amdgpu: Skip the VRAM base offset on SRIOV [Why] As VF cannot read MMMC_VM_FB_OFFSET with L1 Policy(read 0xffffffff). It leads to driver get the incorrect vram base offset. [How] Since SR-IOV is dGPU only, skip reading this register and set the fb_offest to 0. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5818eae501c57e003de9e4f52a6001827e123a88 Author: Yifan Zha Date: Mon Aug 1 11:11:20 2022 +0800 drm/amdgpu: skip "Issue additional private vm invalidation to MMHUB" on SRIOV [Why] vm_l2_bank_select_reserved_cid2 is a PF_only register that cannot be programmed by VF. This feature is only support HDP using GPUVM page tables to access FB memory which should be disabled on SRIOV. [How] Disable the feature on VF. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c1026c6f319724dc88fc08d9d9d35bcbdf492b42 Author: Yifan Zha Date: Wed Jul 27 13:43:50 2022 +0800 drm/amdgpu: Skip the program of MMMC_VM_AGP_* in SRIOV on MMHUB v3_0_0 [Why] VF should not program these registers, the value were defined in the host. [How] Skip writing them in SRIOV environment and program them on host side. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 425fede6e849df5676a41a520e0064fadc98a6b9 Author: Yifan Zha Date: Wed Jul 27 10:50:55 2022 +0800 drm/amdgpu: Use PSP program IH_RB_CNTL registers under SRIOV [Why] With L1 Policy applied, IH_RB_CNTL/RING cannot be accessed by VF. [How] Use PSP program IH_RB_CNTL in VF. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f8bd73213a13b695594fac76cae67105bcfc7706 Author: Horace Chen Date: Fri Jul 29 13:44:43 2022 +0800 drm/amdgpu: Support PSP 13.0.10 on SR-IOV Add support for PSP 13.0.10 for SR-IOV VF Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dc5f3829a752bb579f709c604fa2f362959ca2b4 Author: Horace Chen Date: Thu Jul 21 16:25:17 2022 +0800 drm/amdgpu: sriov remove vcn_4_0 and jpeg_4_0 SRIOV needs to initialize mmsch instead of multimedia engines directly. So currently remove them for SR-IOV until the code and firmwares are ready. Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d9d86d085fbc104ea73a7f6da0b1a6c4086b709a Author: Horace Chen Date: Thu Jul 21 14:42:30 2022 +0800 drm/amdgpu: refine virtualization psp fw skip check SR-IOV may need to load different firmwares for different ASIC inside VF. So create a new function in amdgpu_virt to check whether FW load needs to be skipped. Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit afb50906cf029a40b713c60d8800d3ee25ebe03d Author: Horace Chen Date: Thu Jul 21 12:18:18 2022 +0800 drm/amdgpu: enable WPTR_POLL_ENABLE for sriov on sdma_v6_0 [Why] Under SR-IOV, if VF is switched out then its doorbell will be disabled, SDMA rely on WPTR_POLL to get doorbells which was sent during VF switched-out time. [How] For SR-IOV, set SDMA WPTR_POLL_ENABLE to 1. Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ca4ba3394e2aebcee123055a1275980940f21598 Author: Horace Chen Date: Thu Jul 21 12:11:33 2022 +0800 drm/amdgpu: add a compute pipe reset for RS64 [Why] Under SR-IOV, we are not sure whether pipe status is good or not when doing initialization. The compute engine maybe fail to bringup if pipe status is bad. [How] Do an RS64 pipe reset for MEC before we do initialization. Also apply to bare-metal. Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 119dc6c50eb9974e9dc0e6a17d8207592309c940 Author: Horace Chen Date: Thu Jul 21 11:57:44 2022 +0800 drm/amdgpu: add sriov nbio callback structure [Why] under SR-IOV, the nbio doorbell range will be defined by PF. So VF nbio doorbell range registers will be blocked. It will cause violation if VF access those registers directly. [How] create an nbio_v4_3_sriov_funcs for sriov nbio_v4_3 initialization to skip the setting for the doorbell range registers. Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 09872b1c24220985c17e2d46737e1bb300f49ba0 Author: Horace Chen Date: Thu Jul 21 16:56:21 2022 +0800 drm/amdgpu: add CHIP_IP_DISCOVERY support for virtualization For further chips we will use CHIP_IP_DISCOVERY, so add this support for virtualization Acked-by: Christian König Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 75efc459ea3127dc902bc129526babd6135c494b Author: Yifan Zhang Date: Tue Aug 30 23:18:47 2022 +0800 drm/amdgpu/mes: zero the sdma_hqd_mask of 2nd SDMA engine for SDMA 6.0.1 there is only one SDMA engine in SDMA 6.0.1, the sdma_hqd_mask has to be zeroed for the 2nd engine, otherwise MES scheduler will consider 2nd engine exists and map/unmap SDMA queues to the non-existent engine. Signed-off-by: Yifan Zhang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 41ee1f18ef52390518ed14b8be98640955d8f767 Author: Alex Deucher Date: Tue Aug 30 17:57:52 2022 -0400 drm/amd/display: fix documentation for amdgpu_dm_update_freesync_caps() Document missing parameter. Cc: Rodrigo Siqueira Cc: Harry Wentland Fixes: 8889a13f99e5 ("drm/amd/display: Add some extra kernel doc to amdgpu_dm") Reported-by: Stephen Rothwell Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 6c49df92faa2931ed7269e23a4c2740d3b8687e4 Author: Rodrigo Siqueira Date: Thu Aug 11 11:48:19 2022 -0400 Documentation/gpu: Add Multiplane Overlay doc Multiple plane overlay is a feature supported by AMD hardware, but it has specific details that deserve proper documentation. This commit introduces a documentation that describes some of the features, limitations, and use cases for this feature. Part of this documentation came from some discussion in the public upstream [1][2]. [1]. https://lore.kernel.org/amd-gfx/3qY-QeukF_Q_MJeIXAuBjO4szbS4jRtqkTifXnbnN3bp88SxVodFQRpah3mIIVJq24DUkF6g0rOGdCmSqTvVxx9LCGEItmzLw8uWU44jtXE=@emersion.fr/ [2]. https://lore.kernel.org/amd-gfx/864e45d0-c14b-3b12-0f5b-9d26a9cb41bd@amd.com/ Cc: Harry Wentland Cc: Nicholas Kazlauskas Cc: Bhawanpreet Lakha Cc: Hersen Wu Cc: Alex Hung Cc: Pierre-Eric Pelloux-Prayer Cc: Simon Ser Cc: Pekka Paalanen Cc: Sean Paul Cc: Mark Yacoub Cc: Leo Li Cc: Pierre-Loup Cc: Michel Dänzer Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 330d6da3d03cca592d2101d0f25f01a611c4405b Author: Rodrigo Siqueira Date: Thu Aug 11 11:48:18 2022 -0400 Documentation/gpu: Add an explanation about the DCN pipeline In the DCN code, we constantly talk about hardware pipeline, pipeline, or even just pipes, which is a concept that is not obvious to everyone. For this reason, this commit expands the DCN overview explanation by adding a new section that describes what a pipeline is from the DCN perspective. Changes since V1: - Rewrite the first paragraph that describes AMD hardware pipeline. Cc: Harry Wentland Cc: Nicholas Kazlauskas Cc: Bhawanpreet Lakha Cc: Hersen Wu Cc: Alex Hung Cc: Pierre-Eric Pelloux-Prayer Cc: Leo Li Cc: Simon Ser Cc: Pekka Paalanen Cc: Sean Paul Cc: Mark Yacoub Cc: Pierre-Loup Cc: Michel Dänzer Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 9d9b217d52b41f6d99279211b83c26b2484a142b Author: Rodrigo Siqueira Date: Thu Aug 11 11:48:17 2022 -0400 Documentation/gpu: Add info table for ASICs Amdgpu driver is used in an extensive range of devices, and each ASIC has some specific configuration. As a result of this variety, sometimes it is hard to identify the correct block that might cause the issue. This commit expands the amdgpu kernel-doc to alleviate this issue by introducing one ASIC table that describes dGPU and another one that shares the APU info. Cc: Harry Wentland Cc: Nicholas Kazlauskas Cc: Bhawanpreet Lakha Cc: Hersen Wu Cc: Alex Hung Cc: Pierre-Eric Pelloux-Prayer Cc: Leo Li Cc: Simon Ser Cc: Pekka Paalanen Cc: Sean Paul Cc: Mark Yacoub Cc: Pierre-Loup Cc: Michel Dänzer Cc: Kent Russell Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 68fb37bc2c8ad05be55c1aedccd6cf0778b1442c Author: Chengming Gui Date: Tue Aug 30 16:33:01 2022 +0800 drm/amd/amdgpu: skip ucode loading if ucode_size == 0 Restrict the ucode loading check to avoid frontdoor loading error. Signed-off-by: Chengming Gui Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 018a7bdbb090b9155a6509a0d1a684db4afaa5b1 Author: Rodrigo Vivi Date: Wed Aug 31 17:45:38 2022 -0400 drm/i915/slpc: Let's fix the PCODE min freq table setup for SLPC We need to inform PCODE of a desired ring frequencies so PCODE update the memory frequencies to us. rps->min_freq and rps->max_freq are the frequencies used in that request. However they were unset when SLPC was enabled and PCODE never updated the memory freq. v2 (as Suggested by Ashutosh): if SLPC is in use, let's pick the right frequencies from the get_ia_constants instead of the fake init of rps' min and max. v3: don't forget the max <= min return v4: Move all the freq conversion to intel_rps.c. And the max <= min check to where it belongs. v5: (Ashutosh) Fix old comment s/50 HZ/50 MHz and add a doc explaining the "raw format" Fixes: 7ba79a671568 ("drm/i915/guc/slpc: Gate Host RPS when SLPC is enabled") Cc: # v5.15+ Cc: Ashutosh Dixit Tested-by: Sushma Venkatesh Reddy Signed-off-by: Rodrigo Vivi Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20220831214538.143950-1-rodrigo.vivi@intel.com commit 652c5bf380ad018e15006a7f8349800245ddbbad Author: Peter Zijlstra Date: Mon Aug 29 12:18:03 2022 +0200 x86/mm: Refuse W^X violations x86 has STRICT_*_RWX, but not even a warning when someone violates it. Add this warning and fully refuse the transition. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/YwySW3ROc21hN7g9@hirez.programming.kicks-ass.net commit 5c0ec4900497f7c9cc12f393c329a52e67bc6b8b Merge: ef32aee9aa062 48297a22a39ad 51824b780b719 638dce227a415 967c298d650e2 5fe89191e43fb 528262f502740 Author: Paul E. McKenney Date: Thu Sep 1 10:55:57 2022 -0700 Merge branches 'doc.2022.08.31b', 'fixes.2022.08.31b', 'kvfree.2022.08.31b', 'nocb.2022.09.01a', 'poll.2022.08.31b', 'poll-srcu.2022.08.31b' and 'tasks.2022.08.31b' into HEAD doc.2022.08.31b: Documentation updates fixes.2022.08.31b: Miscellaneous fixes kvfree.2022.08.31b: kvfree_rcu() updates nocb.2022.09.01a: NOCB CPU updates poll.2022.08.31b: Full-oldstate RCU polling grace-period API poll-srcu.2022.08.31b: Polled SRCU grace-period updates tasks.2022.08.31b: Tasks RCU updates commit 48297a22a39adcde7a3ba52b913c5aaa9a990364 Author: Zqiang Date: Sun Jul 31 18:53:56 2022 +0800 rcutorture: Use the barrier operation specified by cur_ops The rcutorture_oom_notify() function unconditionally invokes rcu_barrier(), which is OK when the rcutorture.torture_type value is "rcu", but unhelpful otherwise. The purpose of these barrier calls is to wait for all outstanding callback-flooding callbacks to be invoked before cleaning up their data. Using the wrong barrier function therefore risks arbitrary memory corruption. Thus, this commit changes these rcu_barrier() calls into cur_ops->cb_barrier() to make things work when torturing non-vanilla flavors of RCU. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 16ede66973c84f890c03584f79158dd5b2d725f5 Author: Keith Busch Date: Thu Aug 25 07:53:12 2022 -0700 sbitmap: fix batched wait_cnt accounting Batched completions can clear multiple bits, but we're only decrementing the wait_cnt by one each time. This can cause waiters to never be woken, stalling IO. Use the batched count instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215679 Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220825145312.1217900-1-kbusch@fb.com Signed-off-by: Jens Axboe commit a68108c8370a7210626413e5aaf2327de3aeab94 Author: Lukas Bulwahn Date: Thu Aug 25 17:20:29 2022 +0200 MAINTAINERS: add spdxexclude to LICENSES and SPDX stuff Commit 0509b270a358 ("scripts/spdxcheck: Put excluded files and directories into a separate file") moved excluded files to the new file scripts/spdxexclude, but did not adjust the MAINTAINERS section. The file scripts/spdxexclude clearly belongs to LICENSES and SPDX stuff. Add a corresponding file entry. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220825152029.12660-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c6d194f40a97ecab85af8c4af33ec934ea75716 Author: Vishnu Dasa Date: Mon Jul 25 09:32:46 2022 -0700 VMCI: Update maintainers for VMCI Remove Rajesh as a maintainer for the VMCI driver. Acked-by: Bryan Tan Acked-by: Rajesh Jalisatgi Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220725163246.38486-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit 61742a7cd5b194d2cc52d78de8ec6967634a4cd6 Author: Christophe JAILLET Date: Wed Jul 20 23:26:36 2022 +0200 devres: Slightly optimize alloc_dr() If the gfp flag used for the memory allocation already has __GFP_ZERO, then there is no need to explicitly clear the "struct devres_node". It is already zeroed. This saves a few cycles when using devm_zalloc() and co. In the case of devres_alloc() (which calls __devres_alloc_node()), the compiler could remove the test and the memset() because it should be able to see that the __GFP_ZERO flag is set. So this would make the code both faster and smaller. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/d255bd871484e63cdd628e819f929e2df59afb02.1658352383.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 6bb7ea3afd3eaae95eda6ef5589c3087f2cd70d8 Author: Brian Norris Date: Wed Aug 24 16:52:16 2022 -0700 drivers: base: Print error code on synthetic uevent failure If we're going to log the failure, we might as well log the return code too. Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220824165213.1.Ifdb98af3d0c23708a11d8d5ae5697bdb7e96a3cc@changeid Signed-off-by: Greg Kroah-Hartman commit e9628e015fe205f10766f031f17e217f85650570 Author: Yang Yingliang Date: Mon Aug 22 14:19:22 2022 +0800 class: use IS_ERR_OR_NULL() helper in class_unregister() Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220822061922.3884113-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 07b7b883be5ba0b4bd9ebf8d72c236ef36ae2676 Author: Wolfram Sang Date: Thu Aug 18 22:59:56 2022 +0200 driver_core: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818205956.6528-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit 6fe62a8cec51c756159c71be35a16b2cc8cbd4c0 Author: Manikanta Pubbisetty Date: Wed Aug 31 09:04:20 2022 +0300 wifi: ath11k: Add cold boot calibration support on WCN6750 Add cold boot calibration support on WCN6750. Unlike other chipsets where firmware(FW) is restarted after cold boot calibration is completed, it is recommended not to restart the firmware for WCN6750. For WCN6750, FW sends both CAL_DONE & FW_READY QMI indication to the driver after cold boot calibration is completed. QMI message flow for WCN6750 with cold boot support: FW_INIT_DONE to HOST -> CALIBRATION Mode to FW -> CAL_DONE to Host -> FW_READY to Host -> MODE_ON to FW QMI message flow for other chipsets with cold boot support: FW_INIT_DONE to Host -> CALIBRATION Mode to FW -> FW_READY to Host -> Trigger FW restart -> FW_INIT_DONE to HOST -> MODE_ON to FW QMI message flow for chipsets without cold boot support: FW_INIT_DONE to Host -> MODE_ON to FW Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220720134909.15626-3-quic_mpubbise@quicinc.com commit b3ca32308e46b6384fdcb7e64b3fca4f61aff14b Author: Manikanta Pubbisetty Date: Wed Aug 31 09:04:19 2022 +0300 wifi: ath11k: Fix incorrect QMI message ID mappings QMI message IDs for some of the QMI messages were incorrectly defined in the original implementation. These have to be corrected to enable cold boot support on WCN6750. These corrections are applicable for all chipsets and will not impact them. Refactor the code accordingly. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220720134909.15626-2-quic_mpubbise@quicinc.com commit ac41c2b642b136a1e633379fcb87a9db0ee07f5b Author: Manikanta Pubbisetty Date: Wed Aug 31 09:04:19 2022 +0300 wifi: ath11k: Register shutdown handler for WCN6750 When the system shuts down, SMMU driver will be stopped and will not assist in IOVA translations. SMMU driver expects all of its consumers to shutdown before shutting down itself. WCN6750 being one of the consumer device should not perform any DMA operations after the SMMU has shutdown which will otherwise result in SMMU faults. SMMU driver will call the shutdown() callback of all its consumer devices and the consumers shall stop further DMA activity after the invocation of their respective shutdown() callbacks. Register the shutdown() callback to the platform core for WCN6750. Change will not impact other AHB ath11k devices. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220720134710.15523-1-quic_mpubbise@quicinc.com commit e2691f6b44ed2135bfd005ad5fbabac4f433a7a1 Author: Tejun Heo Date: Sat Aug 27 19:04:40 2022 -1000 cgroup: Implement cgroup_file_show() Add cgroup_file_show() which allows toggling visibility of a cgroup file using the new kernfs_show(). This will be used to hide psi interface files on cgroups where it's disabled. Cc: Chengming Zhou Cc: Johannes Weiner Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-10-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit 783bd07d095b722108725af11113795ee046ed0e Author: Tejun Heo Date: Sat Aug 27 19:04:39 2022 -1000 kernfs: Implement kernfs_show() Currently, kernfs nodes can be created hidden and activated later by calling kernfs_activate() to allow creation of multiple nodes to succeed or fail as a unit. This is an one-way one-time-only transition. This patch introduces kernfs_show() which can toggle visibility dynamically. As the currently proposed use - toggling the cgroup pressure files - only requires operating on leaf nodes, for the sake of simplicity, restrict it as such for now. Hiding uses the same mechanism as deactivation and likewise guarantees that there are no in-flight operations on completion. KERNFS_ACTIVATED and KERNFS_HIDDEN are used to manage the interactions between activations and show/hide operations. A node is visible iff both activated & !hidden. Cc: Chengming Zhou Cc: Johannes Weiner Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-9-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit f8eb145eb946d543e8c8df3d2db39fcd5c80dacb Author: Tejun Heo Date: Sat Aug 27 19:04:38 2022 -1000 kernfs: Factor out kernfs_activate_one() Factor out kernfs_activate_one() from kernfs_activate() and reorder operations so that KERNFS_ACTIVATED now simply indicates whether activation was attempted on the node ignoring whether activation took place. As the flag doesn't have a reader, the refactoring and reordering shouldn't cause any behavior difference. Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-8-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit c25491747b21536bd56dccb82a109754bbc8d52c Author: Tejun Heo Date: Sat Aug 27 19:04:37 2022 -1000 kernfs: Add KERNFS_REMOVING flags KERNFS_ACTIVATED tracks whether a given node has ever been activated. As a node was only deactivated on removal, this was used for 1. Drain optimization (removed by the previous patch). 2. To hide !activated nodes 3. To avoid double activations 4. Reject adding children to a node being removed 5. Skip activaing a node which is being removed. We want to decouple deactivation from removal so that nodes can be deactivated and hidden dynamically, which makes KERNFS_ACTIVATED useless for all of the above purposes. #1 is already gone. #2 and #3 can instead test whether the node is currently active. A new flag KERNFS_REMOVING is added to explicitly mark nodes which are being removed for #4 and #5. While this leaves KERNFS_ACTIVATED with no users, leave it be as it will be used in a following patch. Cc: Chengming Zhou Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-7-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit 2d7f9f8c1815707e9ddb454648a523efc67a04d3 Author: Tejun Heo Date: Sat Aug 27 19:04:36 2022 -1000 kernfs: Improve kernfs_drain() and always call on removal __kernfs_remove() was skipping draining based on KERNFS_ACTIVATED - whether the node has ever been activated since creation. Instead, update it to always call kernfs_drain() which now drains or skips based on the precise drain conditions. This ensures that the nodes will be deactivated and drained regardless of their states. This doesn't make meaningful difference now but will enable deactivating and draining nodes dynamically by making removals safe when racing those operations. While at it, drop / update comments. v2: Fix the inverted test on kernfs_should_drain_open_files() noted by Chengming. This was fixed by the next unrelated patch in the previous posting. Cc: Chengming Zhou Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-6-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit bdb2fd7fc56e197a63c0b0e7e07d25d5e20e7c72 Author: Tejun Heo Date: Sat Aug 27 19:04:35 2022 -1000 kernfs: Skip kernfs_drain_open_files() more aggressively Track the number of mmapped files and files that need to be released and skip kernfs_drain_open_file() if both are zero, which are the precise conditions which require draining open_files. The early exit test is factored into kernfs_should_drain_open_files() which is now tested by kernfs_drain_open_files()'s caller - kernfs_drain(). This isn't a meaningful optimization on its own but will enable future stand-alone kernfs_deactivate() implementation. v2: Chengming noticed that on->nr_to_release was leaking after ->open() failure. Fix it by telling kernfs_unlink_open_file() that it's called from the ->open() fail path and should dec the counter. Use kzalloc() to allocate kernfs_open_node so that the tracking fields are correctly initialized. Cc: Chengming Zhou Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-5-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit cf2dc9db93704c24f3d6d87d3bd09ae970446d1f Author: Tejun Heo Date: Sat Aug 27 19:04:34 2022 -1000 kernfs: Refactor kernfs_get_open_node() Factor out commont part. This is cleaner and should help with future changes. No functional changes. Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-4-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit b52c2379c38ffa49cbf10e30abc9dc4f9c051d41 Author: Tejun Heo Date: Sat Aug 27 19:04:33 2022 -1000 kernfs: Drop unnecessary "mutex" local variable initialization These are unnecessary and unconventional. Remove them. Also move variable declaration into the block that it's used. No functional changes. Cc: Imran Khan Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-3-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3db48aca879db475844182a24d1760ee3d230627 Author: Tejun Heo Date: Sat Aug 27 19:04:32 2022 -1000 kernfs: Simply by replacing kernfs_deref_open_node() with of_on() kernfs_node->attr.open is an RCU pointer to kernfs_open_node. However, RCU dereference is currently only used in kernfs_notify(). Everywhere else, either we're holding the lock which protects it or know that the kernfs_open_node is pinned becaused we have a pointer to a kernfs_open_file which is hanging off of it. kernfs_deref_open_node() is used for the latter case - accessing kernfs_open_node from kernfs_open_file. The lifetime and visibility rules are simple and clear here. To someone who can access a kernfs_open_file, its kernfs_open_node is pinned and visible through of->kn->attr.open. Replace kernfs_deref_open_node() which simpler of_on(). The former takes both @kn and @of and RCU deref @kn->attr.open while sanity checking with @of. The latter takes @of and uses protected deref on of->kn->attr.open. As the return value can't be NULL, remove the error handling in the callers too. This shouldn't cause any functional changes. Cc: Imran Khan Tested-by: Chengming Zhou Reviewed-by: Chengming Zhou Signed-off-by: Tejun Heo Link: https://lore.kernel.org/r/20220828050440.734579-2-tj@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3954cf4338becb1f140bb6fa4f5e9a42f2529b86 Author: Christoph Hellwig Date: Mon Aug 22 08:14:24 2022 +0200 devres: remove devm_ioremap_np devm_ioremap_np has never been used anywhere since it was added in early 2021, so remove it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220822061424.151819-1-hch@lst.de Signed-off-by: Greg Kroah-Hartman commit e4cdd25cafac3f61c74c146db5de7a5c9bd7b6d0 Author: Colin Ian King Date: Sat Jul 30 14:09:25 2022 +0100 tty: mxser: remove redundant assignment to hwid The variable hwid is assigned a value but it is never read. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/tty/mxser.c:401:7: warning: Although the value stored to 'hwid' is used in the enclosing expression, the value is never actually read from 'hwid' [deadcode.DeadStores] Acked-by: Jiri Slaby Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220730130925.150018-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 74b2c563c2a7b031a7717ccab07be385e4f8f7d8 Author: Kewei Xu Date: Tue Aug 9 16:44:57 2022 +0800 dt-binding: serial: mediatek,uart: update bingding for MT8188 Add a DT binding documentation for the MT8188 soc. Reviewed-by: Matthias Brugger Acked-by: Rob Herring Signed-off-by: Kewei Xu Link: https://lore.kernel.org/r/20220809084457.31381-1-kewei.xu@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 6e08c43dffd46f0571686917eeda4284ed220079 Author: Alexander Baehr Date: Sat Aug 6 13:31:25 2022 +0200 parport: add support for Netmos device 9900 The Netmos parallel port 9901 was already supported but the device 9900 was not. This patch adds the required settings for it and was successfully tested with the Netmos device 9900. Signed-off-by: Alexander Baehr Link: https://lore.kernel.org/r/20220806113334.264598686@osadl.org Signed-off-by: Greg Kroah-Hartman commit 22c053900095f4c71f7c6adc9b83d657d6529447 Author: Dan Carpenter Date: Wed Aug 10 12:18:08 2022 +0300 get_maintainer: Add Alan to .get_maintainer.ignore Alan asked to be added to the .get_maintainer.ignore list. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YvN30KhO9aD5Sza9@kili Signed-off-by: Greg Kroah-Hartman commit 7bd581f3c26354f5d5dc6536fcfbbe14f4f5b2b7 Author: Michael Straube Date: Wed Aug 31 07:36:39 2022 +0200 staging: r8188eu: remove os_dep/mlme_linux.c The function rtw_init_mlme_timer() is only used in core/rtw_mlme.c. Move rtw_init_mlme_timer(), including the static functions it calls, to core/rtw_mlme.c and make it static. Remove the now empty file os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220831053639.8559-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit cd544c3c1499e743d1817b398628c033fab283e3 Author: Michael Straube Date: Wed Aug 31 07:36:38 2022 +0200 staging: r8188eu: make two functions static The functions rtw_join_timeout_handler() and _rtw_scan_timeout_handler() are only used in os_dep/mlme_linux.c. Make them static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220831053639.8559-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6ae8e1d0d5e5de922315830aea975c63e8c70b2f Merge: 0e056f414e5b1 8f5c9858c5db1 Author: Bartosz Golaszewski Date: Thu Sep 1 17:19:15 2022 +0200 Merge tag 'platform-drivers-x86-simatec-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into gpio/for-next Tag (immutable branch) for: v6.0-rc1 + "[PATCH v6 0/7] add support for another simatic board" series for merging into the gpio, leds and pdx86 subsystems. commit d6463fd4e97545ef4f7069d13a5fa3ac0924dae2 Author: Akhil P Oommen Date: Fri Aug 19 01:52:15 2022 +0530 drm/msm/a6xx: Handle GMU prepare-slumber hfi failure When prepare-slumber hfi fails, we should follow a6xx_gmu_force_off() sequence. Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498401/ Link: https://lore.kernel.org/r/20220819015030.v5.7.I54815c7c36b80d4725cd054e536365250454452f@changeid Signed-off-by: Rob Clark commit d82a7aed83bacaee08cf77503e3d0e6e667f8526 Author: Peter Colberg Date: Wed Aug 31 16:48:51 2022 -0400 uio: dfl: add IOPLL user-clock feature id Add a Device Feature List (DFL) feature id [1] for the configurable IOPLL user clock source, which can be used to configure the clock speeds that are used for RTL logic that is programmed into the Partial Reconfiguration (PR) region of an FPGA. The IOPLL user-space driver [2] contains frequency tables [3] with the specific user clock frequencies for an implementation. For each desired frequency, the table values are produced by calling the quartus tool, the same tool that generates the IOPLL RTL logic. The quartus tool allows the RTL designer to select different options which can affect the table values. The table-driven, user-space driver allows for supporting future, modified implementations and provides users the ability to modify the IOPLL implementation. [1] https://github.com/OPAE/dfl-feature-id [2] https://github.com/OPAE/opae-sdk/blob/a494f54a9f0356d0425edbff228f0254a4c70303/libraries/plugins/xfpga/usrclk/fpga_user_clk.c [3] https://github.com/OPAE/opae-sdk/blob/a494f54a9f0356d0425edbff228f0254a4c70303/libraries/plugins/xfpga/usrclk/fpga_user_clk_freq.h Acked-by: Xu Yilun Signed-off-by: Russ Weight Signed-off-by: Peter Colberg Link: https://lore.kernel.org/r/20220831204851.4683-1-peter.colberg@intel.com Signed-off-by: Greg Kroah-Hartman commit 116769d385a81f874f9d407ae92c09b1af44023b Author: Samuel Thibault Date: Mon Aug 29 22:36:25 2022 +0200 speakup_soft: Add direct module parameter For non-english speech synthesis, it is often desirable to make speakup_soft pass text directly. Adding a direct parameter to the speakup_soft module allows to easily set that at boot, rather than setting the sys variable after boot. Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20220829203625.6s6x57miowu4p664@begin Signed-off-by: Greg Kroah-Hartman commit 3f132e02d289f9fa208970928a8a8d2d7b1b2b1d Author: Samuel Thibault Date: Wed Aug 24 00:25:03 2022 +0200 speakup: Notify synthesizers of the punctuation level change Even if speakup does the filtering itself, it does not filter out A_PUNC characters (because these are needed e.g. for prosody), so we have to tell synthesizers whether they should filter them out or not. Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20220823222515.412752202@ens-lyon.org Signed-off-by: Greg Kroah-Hartman commit 73392920f0e4bb8b04e9debf90cfe75a15fda9e7 Author: Samuel Thibault Date: Wed Aug 24 00:25:02 2022 +0200 speakup-dummy: Add support for PUNCT variable This allows to debug the update of the punctuation level. Signed-off-by: Samuel Thibault =================================================================== Link: https://lore.kernel.org/r/20220823222514.929670068@ens-lyon.org Signed-off-by: Greg Kroah-Hartman commit a2bdf10ce96efbccabdad7216db5587c1213996c Author: Luke D. Jones Date: Sun Aug 28 19:46:38 2022 +1200 platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32 Fix for TUF laptops returning with an -ENOSPC on calling asus_wmi_evaluate_method_buf() when fetching default curves. The TUF method requires at least 32 bytes space. This also moves and changes the pr_debug() in fan_curve_check_present() to pr_warn() in fan_curve_get_factory_default() so that there is at least some indication in logs of why it fails. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220828074638.5473-1-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b74dbbe19b2551418509b04a5095d65b494e6e28 Author: Daniel Vetter Date: Tue Aug 30 16:49:45 2022 +0200 tty/vt: Add console_lock check to vt_console_print() I'm scratching my head why we have this printing_lock. Digging through historical git trees shows that: - Added in 1.1.73, and I found absolutely no reason why. - Converted to atomic bitops in 2.1.125pre2, I guess as part of SMP enabling/bugfixes. - Converted to a proper spinlock in b0940003f25d ("vt: bitlock fix") because the hand-rolled atomic version lacked necessary memory barriers. Digging around in lore for that time period did also not shed further light. The only reason I think this might still be relevant today is that (to my understanding at least, ymmv) during an oops we might be printing without console_lock held. See console_flush_on_panic() and the comments in there - we flush out the console buffers irrespective of whether we managed to acquire the right locks. The strange thing is that this reason is fairly recent, because the console flushing was historically done without oops_in_progress set. This only changed in c7c3f05e341a ("panic: avoid deadlocks in re-entrant console drivers"), which removed the call to bust_spinlocks(0) (which decrements oops_in_progress again) before flushing out the console (which back then was open coded as a console_trylock/unlock pair). Note that this entire mess should be properly fixed in the printk/console layer, and not inflicted on each implementation. For now just document what's going on and check that in all other cases callers obey the locking rules. v2: WARN_CONSOLE_UNLOCKED already checks for oops_in_progress (something else that should be fixed I guess), hence remove the open-coded check I've had. Signed-off-by: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: "Ilpo Järvinen" Cc: Daniel Vetter Cc: Xuezhi Zhang Cc: Yangxi Xiang Cc: Tetsuo Handa Cc: nick black Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: John Ogness Reviewed-by: Sam Ravnborg Link: https://lore.kernel.org/r/20220830144945.430528-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman commit 0a64ce6e5442bbd96cbe9057d9ba1edab244f25b Author: Daniel Vetter Date: Tue Aug 30 16:50:04 2022 +0200 kernel/panic: Drop unblank_screen call console_unblank() does this too (called in both places right after), and with a lot more confidence inspiring approach to locking. Reconstructing this story is very strange: In b61312d353da ("oops handling: ensure that any oops is flushed to the mtdoops console") it is claimed that a printk(" "); flushed out the console buffer, which was removed in e3e8a75d2acf ("[PATCH] Extract and use wake_up_klogd()"). In todays kernels this is done way earlier in console_flush_on_panic with some really nasty tricks. I didn't bother to fully reconstruct this all, least because the call to bust_spinlock(0); gets moved every few years, depending upon how the wind blows (or well, who screamed loudest about the various issue each call site caused). Before that commit the only calls to console_unblank() where in s390 arch code. The other side here is the console->unblank callback, which was introduced in 2.1.31 for the vt driver. Which predates the console_unblank() function by a lot, which was added (without users) in 2.4.14.3. So pretty much impossible to guess at any motivation here. Also afaict the vt driver is the only (and always was the only) console driver implementing the unblank callback, so no idea why a call to console_unblank() was added for the mtdooops driver - the action actually flushing out the console buffers is done from console_unlock() only. Note that as prep for the s390 users the locking was adjusted in 2.5.22 (I couldn't figure out how to properly reference the BK commit from the historical git trees) from a normal semaphore to a trylock. Note that a copy of the direct unblank_screen() call was added to panic() in c7c3f05e341a ("panic: avoid deadlocks in re-entrant console drivers"), which partially inlined the bust_spinlocks(0); call. Long story short, I have no idea why the direct call to unblank_screen survived for so long (the infrastructure to do it properly existed for years), nor why it wasn't removed when the console_unblank() call was finally added. But it makes a ton more sense to finally do that than not - it's just better encapsulation to go through the console functions instead of doing a direct call, so let's dare. Plus it really does not make much sense to call the only unblank implementation there is twice, once without, and once with appropriate locking. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Daniel Vetter Cc: "Ilpo Järvinen" Cc: Tetsuo Handa Cc: Xuezhi Zhang Cc: Yangxi Xiang Cc: nick black Cc: Petr Mladek Cc: Andrew Morton Cc: Luis Chamberlain Cc: "Guilherme G. Piccoli" Cc: Marco Elver Cc: John Ogness Cc: Sebastian Andrzej Siewior Cc: David Gow Cc: tangmeng Cc: Tiezhu Yang Cc: Chris Wilson Reviewed-by: Petr Mladek Acked-by: Sebastian Andrzej Siewior Signed-off-by: Daniel Vetter Signed-off-by: Andrew Morton Link: https://lore.kernel.org/r/20220830145004.430545-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman commit 6dd9eb95cb6d895be2827b40fd965d9ec2a0747b Author: Pali Rohár Date: Sat Aug 27 15:30:40 2022 +0200 platform/x86: dell-wmi: Add WMI event 0x0012 0x0003 to the list It looks like that on Dell Latitude E6440 is WMI event 0x0012 0x0003 sent when display changes brightness. When it happens kernel prints "dell_wmi: Unknown WMI event type 0x12" message into dmesg. So ignore it for now to not spam dmesg. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220827133040.15932-1-pali@kernel.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3e891e93094cb06ceb40dd20ca2239df7700add8 Merge: f81fead027ecb 8f5c9858c5db1 Author: Hans de Goede Date: Thu Sep 1 16:53:38 2022 +0200 Merge tag 'platform-drivers-x86-simatec-1' into review-hans Tag (immutable branch) for: v6.0-rc1 + "[PATCH v6 0/7] add support for another simatic board" series for merging into the gpio, leds and pdx86 subsystems. commit 621d5d6a83bc92a93c6653fd8a424a63c95269b0 Author: Bo Liu Date: Fri Aug 5 05:10:57 2022 -0400 ipack: Check dev_set_name() return value It's possible that dev_set_name() returns -ENOMEM, catch and handle this. Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Bo Liu Link: https://lore.kernel.org/r/20220805091057.19951-1-liubo03@inspur.com Signed-off-by: Greg Kroah-Hartman commit b216dc1a41f787620636376bf2be666f08c031d0 Author: Aparna M Date: Tue Aug 30 18:02:54 2022 +0530 arm64: dts: ti: k3-am642-sk: Add DT entry for onboard LEDs AM642 SK has 8 leds connected to tpic2810 onboard. Add support for these gpio leds. Signed-off-by: Aparna M Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220830123254.522222-1-vigneshr@ti.com commit d683a73980a61cc5d8abea7f3f996028e64e9144 Author: Andrew Davis Date: Mon Aug 22 19:11:36 2022 -0500 arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node J7200 has an instance of SA2UL in the MCU domain. Add DT node for the same. The device is marked TI_SCI_PD_SHARED as parts of this IP are also shared with the security co-processor and OP-TEE. The RNG node is added but marked disabled as it is firewalled off for exclusive use by OP-TEE. Any access to this device from Linux will result in firewall errors. We add the node for completeness of the hardware description. Signed-off-by: Andrew Davis Signed-off-by: Vignesh Raghavendra Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20220823001136.10944-4-afd@ti.com commit 49611f43e035f30be685fcf7468f23e85ce2ee06 Author: Andrew Davis Date: Mon Aug 22 19:11:35 2022 -0500 arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL The SA2UL hardware is also used by SYSFW and OP-TEE. It should be requested using the shared TI-SCI flags instead of the exclusive flags or the request will fail. Signed-off-by: Andrew Davis Signed-off-by: Vignesh Raghavendra Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20220823001136.10944-3-afd@ti.com commit 530eaa573a33fdd86725fdd2b979cbbbc539d47c Author: Andrew Davis Date: Mon Aug 22 19:11:34 2022 -0500 arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID The first TX and first two RX PSI-L threads for SA2UL are used by SYSFW on High Security(HS) devices. Use the next available threads to prevent resource allocation conflicts. Signed-off-by: Andrew Davis Signed-off-by: Vignesh Raghavendra Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20220823001136.10944-2-afd@ti.com commit 1ad4669b4bbe6b72784acdb5b24f72b22ad8f1d1 Author: Andrew Davis Date: Mon Aug 22 19:11:33 2022 -0500 arm64: dts: ti: k3-am65-main: Disable RNG node The hardware random number generator is used by OP-TEE and is access is denied to other users with SoC level bus firewalls. Any access to this device from Linux will result in firewall errors. We could remove this node, but it is still valid device description, and it is possible it could be re-enabled in the bootloader if OP-TEE is not used. So only disable this node for now. Signed-off-by: Andrew Davis Signed-off-by: Vignesh Raghavendra Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20220823001136.10944-1-afd@ti.com commit c3b69ba5114c860d730870c03ab4ee45276e5e35 Author: Hangyu Hua Date: Wed Aug 24 16:26:00 2022 +0800 misc: ocxl: fix possible refcount leak in afu_ioctl() eventfd_ctx_put need to be called to put the refcount that gotten by eventfd_ctx_fdget when ocxl_irq_set_handler fails. Fixes: 060146614643 ("ocxl: move event_fd handling to frontend") Acked-by: Frederic Barrat Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220824082600.36159-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman commit d8baf6ca8c19ea2053be81750dd4adf8e6e3b4c3 Author: Wolfram Sang Date: Thu Aug 18 23:01:20 2022 +0200 virt: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Reviewed-by: Hans de Goede Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210120.7565-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit 5192e395c5cfa6f3d23165db38365ec7f8c5ee7a Author: Wolfram Sang Date: Thu Aug 18 23:00:31 2022 +0200 misc: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210031.7036-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit f667f56b2f55881a705e5a67d30d71e5fb75dbe3 Author: Abel Vesa Date: Tue Aug 16 13:55:28 2022 +0300 misc: fastrpc: Use USER_PD define in fastrpc_get_info_from_dsp There are defines for each type of protection domain now. Use the USER_PD instead of magic value in fastrpc_get_info_from_dsp. Cc: Srinivas Kandagatla Cc: Amol Maheshwari Reviewed-by: Andrew Halaney Reviewed-by: Srinivas Kandagatla Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220816105528.3222763-1-abel.vesa@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5cb14f15d79a8edfb9197deb97c7061d55b819ab Author: Breno Leitao Date: Fri Aug 12 02:47:17 2022 -0700 misc: bcm_vk: Remove usage of deprecated functions ida_simple_get() and ida_simple_remove() functions are deprecated now. These functions were replaced by ida_alloc() and ida_free() respectively. This patch modernize bcm_vk to use the replacement functions. Acked-by: Scott Branden Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20220812094717.4097179-1-leitao@debian.org Signed-off-by: Greg Kroah-Hartman commit fccf202e01e0e5c9d5f1fdd00009614c04c82818 Author: Breno Leitao Date: Fri Aug 12 02:40:11 2022 -0700 misc: bcm-vk: Specify the minimum number of IRQ vecs During bcm_vk_probe(), pci_alloc_irq_vectors() is called passing the number of IRQ vectors as 1, but, later, check how many IRQ vectors it got, and fails if it is smaller than VK_MSIX_IRQ_MIN_REQ. The most appropriated way to do it is setting the 'min_vecs' param as VK_MSIX_IRQ_MIN_REQ, instead of one. pci_alloc_irq_vectors() should know the requirements when called. The test was done by just loading this module on a machine with a Valkyrie offload engine hardware. Acked-by: Scott Branden Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20220812094011.4064729-1-leitao@debian.org Signed-off-by: Greg Kroah-Hartman commit 66d8529d0f0423bc0fc249a5620c342c122981fb Author: Zhen Lei Date: Tue Aug 30 19:28:55 2022 +0800 livepatch: Add a missing newline character in klp_module_coming() The error message is not printed immediately because it does not end with a newline character. Before: root@localhost:~# insmod vmlinux.ko insmod: ERROR: could not insert module vmlinux.ko: Invalid parameters After: root@localhost:~# insmod vmlinux.ko [ 43.982558] livepatch: vmlinux.ko: invalid module name insmod: ERROR: could not insert module vmlinux.ko: Invalid parameters Fixes: dcf550e52f56 ("livepatch: Disallow vmlinux.ko") Signed-off-by: Zhen Lei Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220830112855.749-1-thunder.leizhen@huawei.com commit 9d64d2405f7d30d49818f6682acd0392348f0fdb Author: Al Viro Date: Tue Aug 23 11:53:39 2022 +0200 binderfs: rework superblock destruction So far we relied on .put_super = binderfs_put_super() to destroy info we stashed in sb->s_fs_info. This gave us the required ordering between ->evict_inode() and sb->s_fs_info destruction. But the current implementation of binderfs_fill_super() has a memory leak in the rare circumstance that d_make_root() fails because ->put_super() is only called when sb->s_root is initialized. Fix this by removing ->put_super() and simply do all that work in binderfs_kill_super(). Reported-by: Dongliang Mu Signed-off-by: Al Viro Signed-off-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220823095339.853371-1-brauner@kernel.org Signed-off-by: Greg Kroah-Hartman commit eaf271ea844b8dea5256bd3c73e642ef13ce68a2 Author: Carlos Llamas Date: Mon Aug 29 20:12:54 2022 +0000 binderfs: remove unused INTSTRLEN macro Fix the following W=1 build error: drivers/android/binderfs.c:42: error: macro "INTSTRLEN" is not used [-Werror=unused-macros] 42 | #define INTSTRLEN 21 | No functional changes in this patch. Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220829201254.1814484-8-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 22534a44cb8ca660a14d62e320e45fde962e9410 Author: Carlos Llamas Date: Mon Aug 29 20:12:52 2022 +0000 binder: remove unused binder_alloc->buffer_free The ->buffer_free member was introduced in the first revision of the driver under staging but it appears like it was never actually used according to git's history. Remove it from binder_alloc. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220829201254.1814484-6-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 76ff33468beaabbd0fe141b3ea1c6f514a8ef7d4 Author: Carlos Llamas Date: Mon Aug 29 20:12:49 2022 +0000 binder: fix trivial kernel-doc typo Correct the misspelling of 'invariant' in kernel-doc section. No functional changes in this patch. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220829201254.1814484-3-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 8f5c9858c5db129359b5de2f60f5f034bf5d56c0 Author: Henning Schild Date: Thu Aug 25 12:44:22 2022 +0200 platform/x86: simatic-ipc: add new model 427G This adds support for the Siemens Simatic IPC427G. A board which basically works like the 227G added in a previous patch. So all there is to do is to add the station_id and make it take all the 227G branches. Reviewed-by: Andy Shevchenko Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20220825104422.14156-8-henning.schild@siemens.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d948b93ccff2c4d78c6dce4c7e6dc8b90976cdb0 Author: Henning Schild Date: Thu Aug 25 12:44:21 2022 +0200 platform/x86: simatic-ipc: enable watchdog for 227G Just load the watchdog module, after having identified that machine. That watchdog module does not have any autoloading support. Reviewed-by: Andy Shevchenko Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20220825104422.14156-7-henning.schild@siemens.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a97126265dfe10d3321c0fde4708a6cea49b19ed Author: Henning Schild Date: Thu Aug 25 12:44:20 2022 +0200 leds: simatic-ipc-leds-gpio: add new model 227G This adds support of the Siemens Simatic IPC227G. Its LEDs are connected to GPIO pins provided by the gpio-f7188x module. We make sure that gets loaded, if not enabled in the kernel config no LED support will be available. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20220825104422.14156-6-henning.schild@siemens.com Signed-off-by: Hans de Goede commit 26d88a6883d556761e593c630600f00c7b0a76ab Author: Henning Schild Date: Thu Aug 25 12:44:19 2022 +0200 gpio-f7188x: use unique labels for banks/chips So that drivers building on top can find those pins with GPIO_LOOKUP helpers. Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Acked-by: Simon Guinot Signed-off-by: Henning Schild Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220825104422.14156-5-henning.schild@siemens.com Signed-off-by: Hans de Goede commit d0918a84aff0ad5036f8bb2e375c851c07381940 Author: Henning Schild Date: Thu Aug 25 12:44:18 2022 +0200 gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Add GPIO support for Nuvoton NCT6116 chip. Nuvoton SuperIO chips are very similar to the ones from Fintek. In other subsystems they also share drivers and are called a family of drivers. For the GPIO subsystem the only difference is that the direction bit is reversed and that there is only one data bit per pin. On the SuperIO level the logical device is another one. On a chip level we do not have a manufacturer ID to check and also no revision. Reviewed-by: Andy Shevchenko Acked-by: Simon Guinot Signed-off-by: Henning Schild Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220825104422.14156-4-henning.schild@siemens.com Signed-off-by: Hans de Goede commit 470308d9d2e0fc4367870e58ccd5f2e182c71d92 Author: Henning Schild Date: Thu Aug 25 12:44:17 2022 +0200 gpio-f7188x: add a prefix to macros to keep gpio namespace clean Subsequent patches will touch that file, apply some nice to have style changes before actually adding functional changes. Signed-off-by: Henning Schild Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220825104422.14156-3-henning.schild@siemens.com Signed-off-by: Hans de Goede commit 821d9e1db208c34ea3606ff0ee4698daee49b384 Author: Henning Schild Date: Thu Aug 25 12:44:16 2022 +0200 gpio-f7188x: switch over to using pr_fmt Subsequent patches will touch that file, apply some nice to have style changes before actually adding functional changes. Signed-off-by: Henning Schild Reviewed-by: Andy Shevchenko Acked-by: Simon Guinot Reviewed-by: Linus Walleij Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220825104422.14156-2-henning.schild@siemens.com Signed-off-by: Hans de Goede commit 4e55e22d3d9aa50ef1ba059bf3a53aa61109c179 Author: Heikki Krogerus Date: Wed Aug 31 15:50:52 2022 +0300 USB: hcd-pci: Drop the unused id parameter from usb_hcd_pci_probe() Since the HC driver is now passed to the function with its own parameter (it used to be picked from id->driver_data), the id parameter serves no purpose. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220831125052.71584-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a4efdb8a423b4fa3671418bd3755ae79fbdedab0 Author: Linus Walleij Date: Wed Aug 31 10:29:32 2022 +0200 USB: FHCI: Switch to GPIO descriptors This driver for the PPC Freescale SoC is using device tree accessors and imperative GPIO semantics control using the old GPIO API, switch it over to use GPIO descriptors. Cc: Li Yang Cc: linuxppc-dev@lists.ozlabs.org Cc: Zhao Qiang Cc: Guilherme Maciel Ferreira Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220831082932.488724-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit bf98ef69f75ddce0046c04d351b07f44e9b2be53 Author: Shaomin Deng Date: Wed Aug 31 12:09:34 2022 -0400 serial: Fix double word Fix double word "start start" in comments. Signed-off-by: Shaomin Deng Link: https://lore.kernel.org/r/20220831160934.7986-1-dengshaomin@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 18417b01c1e436d816b33e53b765764c3f196ee0 Author: Andy Shevchenko Date: Tue Aug 30 18:23:13 2022 +0300 serial: 8250_men_mcb: Remove duplicate UAPI:serial_core inclusion The UAPI serial_core.h is guaranteed to be included by in-kernel one (with the same name). Individual drivers do not need to include it explicitly. Remove it from the driver. Note, it's a single driver in the entire kernel that does this. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220830152313.14650-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 32eeeed963ad4f41b422b3e314d96ded7283b201 Author: Takashi Iwai Date: Thu Sep 1 15:08:31 2022 +0200 ALSA: usb-audio: Clean up endpoint setups at PCM prepare This patch cleans up the superfluous checks and calls for setting up the endpoints at PCM prepare callback: - Drop stop_endpoints() and sync_pending_stops() calls; the stream is guaranteed to have been already stopped and synced at each PCM prepare call by ALSA PCM core - Call snd_usb_endpoint_prepare() unconditionally; the check for endpoint->need_setup is done in snd_pcm_hw_endpoint_prepare() itself - Apply snd_usb_set_format_quirk() only when the endpoint is actually set up (i.e. the return code from snd_usb_endpoint_prepare() > 0) - Move a few lines back into snd_usb_pcm_prepare(); it's even easier to follow than a small useless function Link: https://lore.kernel.org/r/20220901130831.6136-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 041af76890ba66f6222dd910807fe0b170109e7d Merge: f51ba1148a810 ff878b408a03b Author: Takashi Iwai Date: Thu Sep 1 15:09:12 2022 +0200 Merge branch 'for-linus' into for-next commit 747f7a2901174c9afa805dddfb7b24db6f65e985 Author: Rik van Riel Date: Mon Aug 8 15:00:19 2022 -0400 livepatch: fix race between fork and KLP transition The KLP transition code depends on the TIF_PATCH_PENDING and the task->patch_state to stay in sync. On a normal (forward) transition, TIF_PATCH_PENDING will be set on every task in the system, while on a reverse transition (after a failed forward one) first TIF_PATCH_PENDING will be cleared from every task, followed by it being set on tasks that need to be transitioned back to the original code. However, the fork code copies over the TIF_PATCH_PENDING flag from the parent to the child early on, in dup_task_struct and setup_thread_stack. Much later, klp_copy_process will set child->patch_state to match that of the parent. However, the parent's patch_state may have been changed by KLP loading or unloading since it was initially copied over into the child. This results in the KLP code occasionally hitting this warning in klp_complete_transition: for_each_process_thread(g, task) { WARN_ON_ONCE(test_tsk_thread_flag(task, TIF_PATCH_PENDING)); task->patch_state = KLP_UNDEFINED; } Set, or clear, the TIF_PATCH_PENDING flag in the child task depending on whether or not it is needed at the time klp_copy_process is called, at a point in copy_process where the tasklist_lock is held exclusively, preventing races with the KLP code. The KLP code does have a few places where the state is changed without the tasklist_lock held, but those should not cause problems because klp_update_patch_state(current) cannot be called while the current task is in the middle of fork, klp_check_and_switch_task() which is called under the pi_lock, which prevents rescheduling, and manipulation of the patch state of idle tasks, which do not fork. This should prevent this warning from triggering again in the future, and close the race for both normal and reverse transitions. Signed-off-by: Rik van Riel Reported-by: Breno Leitao Reviewed-by: Petr Mladek Acked-by: Josh Poimboeuf Fixes: d83a7cb375ee ("livepatch: change to a per-task consistency model") Cc: stable@kernel.org Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220808150019.03d6a67b@imladris.surriel.com commit f81fead027ecbb525c29d681eb95a222e76306a3 Author: Andy Shevchenko Date: Wed Aug 24 18:21:15 2022 +0300 platform/x86: intel_cht_int33fe: Fix comment according to the code flow We don't use software_node_register_nodes() in the code, fix the comment. Fixes: 140355e5db8b ("platform/x86: intel_cht_int33fe: Convert software node array to group") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220824152115.88012-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede commit f51ba1148a810a16eead9f0b29bfa2a8f8ab3afb Author: Valentina Goncharenko Date: Thu Sep 1 13:28:14 2022 +0300 ALSA: asihpi - Remove useless code in hpi_meter_get_peak() The hpi_meter_get_peak() function contains the expression "hm.obj_index = hm.obj_index", which does not carry any semantic load. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 719f82d3987a ("ALSA: Add support of AudioScience ASI boards") Signed-off-by: Valentina Goncharenko Link: https://lore.kernel.org/r/20220901102814.131855-1-goncharenko.vp@ispras.ru Signed-off-by: Takashi Iwai commit 059209fd902f5ad4bec8124931c258e62fddf74f Author: Vadim Pasternak Date: Tue Aug 23 23:19:37 2022 +0300 platform/mellanox: Remove redundant 'NULL' check Remove 'NULL' check for 'data->hpdev.client' in error flow of mlxreg_lc_probe(). It cannot be 'NULL' at this point. Fixes: b4b830a34d80 ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity") Reported-by: Dan Carpenter Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220823201937.46855-5-vadimp@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1c8ee06b637f0b0146bbcda776d131e4822432c3 Author: Vadim Pasternak Date: Tue Aug 23 23:19:36 2022 +0300 platform/mellanox: Remove unnecessary code Remove redundant 'NULL' check for of if 'data->notifier'. Replace 'return err' by 'return 0' in mlxreg_lc_probe(). Fixes: 62f9529b8d5c87b ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices") Reported-by: Dan Carpenter Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220823201937.46855-4-vadimp@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 52e01c0b1d80b0a7e8d9970456e10b788398e633 Author: Vadim Pasternak Date: Tue Aug 23 23:19:35 2022 +0300 platform/mellanox: mlxreg-lc: Fix locking issue Fix locking issues: - mlxreg_lc_state_update() takes a lock when set or clear "MLXREG_LC_POWERED". - All the devices can be deleted before MLXREG_LC_POWERED flag is cleared. To fix it: - Add lock() / unlock() at the beginning / end of mlxreg_lc_event_handler() and remove locking from mlxreg_lc_power_on_off() and mlxreg_lc_enable_disable() - Add locked version of mlxreg_lc_state_update() - mlxreg_lc_state_update_locked() for using outside mlxreg_lc_event_handler(). (2) Remove redundant NULL check for of if 'data->notifier'. Fixes: 62f9529b8d5c87b ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices") Reported-by: Dan Carpenter Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220823201937.46855-3-vadimp@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 16b36a953bc7fc4843568abcdb7b32f92cc65457 Author: Vadim Pasternak Date: Tue Aug 23 23:19:34 2022 +0300 platform/mellanox: mlxreg-lc: Fix coverity warning Fix smatch warning: drivers/platform/mellanox/mlxreg-lc.c:866 mlxreg_lc_probe() warn: passing zero to 'PTR_ERR' by removing 'err = PTR_ERR(regmap)'. Fixes: b4b830a34d80 ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220823201937.46855-2-vadimp@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 55e2bd9c41e800638676dce3f19dcfd16b309a08 Author: Martin Povišer Date: Thu Sep 1 13:34:15 2022 +0200 MAINTAINERS: Fix file pattern for ARM/APPLE MACHINE SOUND DRIVERS This is what was meant of course. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220901113415.27449-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 7d2497b7fd3bf45706360bfe289f19d61d37f536 Author: Martin Povišer Date: Thu Sep 1 13:34:14 2022 +0200 ASoC: apple: mca: Unselect COMMON_CLK in Kconfig The MCA driver selects COMMON_CLK, which leads to misconfiguration on platforms with HAVE_LEGACY_CLK (under compile test). Kconfig catches the conflict with the following warning: WARNING: unmet direct dependencies detected for COMMON_CLK Depends on [n]: !HAVE_LEGACY_CLK [=y] Selected by [m]: - SND_SOC_APPLE_MCA [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && (ARCH_APPLE || COMPILE_TEST [=y]) Eventually the build fails with errors like: >> drivers/clk/clk.c:867:6: error: redefinition of 'clk_unprepare' 867 | void clk_unprepare(struct clk *clk) | ^~~~~~~~~~~~~ In file included from drivers/clk/clk.c:9: include/linux/clk.h:303:20: note: previous definition of 'clk_unprepare' with type 'void(struct clk *)' 303 | static inline void clk_unprepare(struct clk *clk) | ^~~~~~~~~~~~~ which appears to be because COMMON_CLK is selected but HAVE_CLK_PREPARE is not. In the end it seems we had no business selecting COMMON_CLK from an unrelated driver like that, so remove the selection. The linux/clk.h API is there anyway. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Reported-by: kernel test robot Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220901113415.27449-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 169a32b76842c10fbe532cde6cc25e89bbf54341 Author: Michał Winiarski Date: Wed Aug 17 23:12:36 2022 +0200 drm/cmdline-parser: Use assert when needed Expecting to observe a specific value, when the function responsible for setting the value has failed will lead to extra noise in test output. Use assert when the situation calls for it. Also - very small tidying up around the changed areas (whitespace). v2: Leave out the locals (drm_connector is huge) (lkp) Signed-off-by: Michał Winiarski Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20220817211236.252091-2-michal.winiarski@intel.com commit 0af02a0e52030ca0b5acc4da6d3ee3303077277c Author: Michał Winiarski Date: Wed Aug 17 23:12:35 2022 +0200 drm/cmdline-parser: Merge negative tests Negative tests can be expressed as a single parameterized test case, which highlights that we're following the same test logic (passing invalid cmdline and expecting drm_mode_parse_command_line_for_connector to fail), which improves readability. v2: s/negative/invalid to be consistent with other testcases in DRM Signed-off-by: Michał Winiarski Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20220817211236.252091-1-michal.winiarski@intel.com commit 0538fa09bb1073b19b197509c51c55496091d125 Author: Tetsuo Handa Date: Thu Jul 28 10:40:57 2022 +0900 gpu/drm/bridge/cadence: avoid flush_scheduled_work() usage Like commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue() using a macro") says, flush_scheduled_work() is dangerous and will be forbidden. We are on the way for removing all flush_scheduled_work() callers from the kernel, and this patch is for removing flush_scheduled_work() call from cadence driver. Since cdns-mhdp8546 driver uses 4 works mhdp->modeset_retry_work mhdp->hpd_work mhdp->hdcp.check_work mhdp->hdcp.prop_work I assume that flush_scheduled_work() in cdns_mhdp_remove() needs to wait for only these 4 works. Since mhdp->modeset_retry_work already uses cancel_work_sync(), I assume that flush_scheduled_work() needs to wait for only 3 works. But I came to wonder whether mhdp->hdcp.check_work should be flushed or cancelled. While flush_scheduled_work() waits for completion of works which were already queued to system_wq, mhdp->hdcp.check_work is a delayed work. That is, this work won't be queued to system_wq unless timeout expires. Current code will wait for mhdp->hdcp.check_work only if timeout already expired. If timeout is not expired yet, flush_scheduled_work() will fail to cancel mhdp->hdcp.check_work, and cdns_mhdp_hdcp_check_work() which is triggered by mhdp->hdcp.check_work will schedule hdcp->check_work, which is too late for flush_scheduled_work() to wait for completion of cdns_mhdp_hdcp_prop_work(). But since I couldn't get comments on how do we want to handle this race window [1], this patch chose "do nothing" for mhdp->hdcp.check_work and mhdp->hdcp.prop_work. That is, I assume that flush_scheduled_work() in cdns_mhdp_remove() needs to wait for only mhdp->hpd_work work. Link: https://lkml.kernel.org/r/943273cb-c2ec-24e3-5edb-64eacc6e2d30@I-love.SAKURA.ne.jp [1] Signed-off-by: Tetsuo Handa Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/216591bc-28bb-0453-10bb-59e268dff540@I-love.SAKURA.ne.jp commit 4bf8594a8036f42ca7ece1bbdaf45b7954fb09e6 Author: Zhengchao Shao Date: Wed Aug 31 12:14:52 2022 +0800 net: sched: gred: remove NULL check before free table->tab in gred_destroy() The kfree invoked by gred_destroy_vq checks whether the input parameter is empty. Therefore, gred_destroy() doesn't need to check table->tab. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220831041452.33026-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit d57f2035c0455dfd5e4d29caa0266fad6febe6d6 Author: Linus Walleij Date: Wed Aug 31 16:13:03 2022 +0200 regmap: mmio: Fix rebase error A dangling pointless "ret 0" was left in and some unneeded whitespace can go too. Fixes: 81c0386c1376 ("regmap: mmio: Support accelerared noinc operations") Reported-by: Andy Shevchenko Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220831141303.501548-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit 69e3e537ec8a2e345f72f65ff24d3486d4764d83 Author: Krzysztof Kozlowski Date: Thu Sep 1 13:14:58 2022 +0300 ASoC: codecs: rk817: drop I2C dependencies The RK817 codec uses regmap API and not directly regmap I2C. It is the parent MFD who uses and selects regmap I2C. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220901101458.365354-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 9815746c48ebbd38d32a7a1dade7fa1e3948c54d Author: Krzysztof Kozlowski Date: Thu Sep 1 13:14:57 2022 +0300 ASoC: codecs: wcd934x: add Slimbus dependency The WCD934X codec is a Slimbus driver, so it must depend on SLIMBUS, also for compile tests: ERROR: modpost: "slim_stream_prepare" [sound/soc/codecs/snd-soc-wcd934x.ko] undefined! Reported-by: kernel test robot Fixes: 5b7f4e5de61b ("ASoC: codecs: allow compile testing without MFD drivers") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220901101458.365354-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 9aa320341e9a86c684ccf8c2e75ff07486d9bf46 Author: Mitul Golani Date: Tue Aug 30 14:21:58 2022 +0530 drm/i915/display: Fix warning callstack for imbalance wakeref While executing i915_selftest, wakeref imbalance warning is seen with i915_selftest failure. Currently when Driver is suspended, while doing unregister it is taking wakeref without resuming the device. This patch is resuming the device, if driver is already suspended and doing unregister process. Signed-off-by: Mitul Golani Signed-off-by: Imre Deak Reviewed-by: Imre Deak Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20220830085158.577157-1-mitulkumar.ajitkumar.golani@intel.com commit 6038f1171162faaebbbe3acd1c6712a18a161a41 Author: Gowtham Tammana Date: Mon Aug 22 18:50:06 2022 -0500 arm64: dts: ti: k3-j7200-main: Add main domain watchdog entries Add DT entries for main domain watchdog instances. Signed-off-by: Gowtham Tammana Signed-off-by: Vignesh Raghavendra Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220822235006.7081-1-afd%40ti.com commit 3740b081795a2e03a75a1b7573291e10378bd892 Author: Robin Murphy Date: Mon Aug 22 23:01:27 2022 +0100 drm/panfrost: Update io-pgtable API Convert to io-pgtable's bulk {map,unmap}_pages() APIs, to help the old single-page interfaces eventually go away. Unmapping heap BOs still wants to be done a page at a time, but everything else can get the full benefit of the more efficient interface. Signed-off-by: Robin Murphy Acked-by: Alyssa Rosenzweig Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/daef7f8c134d989c55636a5790d8c0fcaca1bae3.1661205687.git.robin.murphy@arm.com commit c920a6caba68196f48f8ee57cc193e396f941011 Author: Roger Quadros Date: Tue Aug 2 13:44:56 2022 +0300 arm64: dts: ti: k3-am64-main: Add ELM (Error Location Module) node The ELM module is used for GPMC NAND accesses for detecting and correcting errors during reads due to NAND bitflips errors. 4-, 8-, and 16-bit error-correction levels are supported using the BCH (Bose-ChaudhurI-Hocquenghem) algorithm. Signed-off-by: Roger Quadros Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220802104456.11069-3-rogerq@kernel.org commit 5ec06904310da6441097c8f2d6e3fb196f42bca1 Author: Roger Quadros Date: Tue Aug 2 13:44:55 2022 +0300 arm64: dts: ti: k3-am64-main: Add GPMC memory controller node The GPMC is a unified memory controller dedicated for interfacing with external memory devices like - Asynchronous SRAM-like memories and ASICs - Asynchronous, synchronous, and page mode burst NOR flash - NAND flash - Pseudo-SRAM devices Signed-off-by: Roger Quadros Signed-off-by: Vignesh Raghavendra Reviewed-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220802104456.11069-2-rogerq@kernel.org commit f42f6f9e77ee6b1b86c006d0436ba303901529a9 Author: Daniel Parks Date: Mon Aug 8 13:32:00 2022 -0500 arm64: dts: ti: k3-j721e-main: fix RNG node clock id The RNG node for this platform claims pka_in_clk. Change it to claim the correct clock x1_clk. [1] [1]: https://downloads.ti.com/tisci/esd/latest/5_soc_doc/j721e/clocks.html#clocks-for-sa2-ul0-device Signed-off-by: Daniel Parks Signed-off-by: Vignesh Raghavendra Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/f29e2c65dc7310a926af8a676651592afac04b03.1659981162.git.danielrparks@ti.com commit e170ae6dd67a00f750996820d55b144c5189be66 Author: Peter Ujfalusi Date: Mon Jul 11 14:27:43 2022 +0530 arm64: dts: ti: k3-am64-main: Enable crypto accelerator Add the node for SA2UL. Signed-off-by: Peter Ujfalusi [s-anna@ti.com: drop label, minor cleanups] Signed-off-by: Suman Anna [j-choudhary@ti.com: disable rng-node, change flag to shared] Signed-off-by: Jayesh Choudhary Signed-off-by: Vignesh Raghavendra Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20220711085743.10128-3-j-choudhary@ti.com commit 2af39b9964851edeaa3ba5ea7d287ed894d5eaed Merge: 99c969a83d827 a2b77831427cb Author: Paolo Abeni Date: Thu Sep 1 11:53:17 2022 +0200 Merge branch 'rk3588-ethernet-support' Sebastian Reichel says: ==================== RK3588 Ethernet Support This adds ethernet support for the RK3588(s) SoCs. Changes since PATCHv2: * Rebased to v6.0-rc1 * Wrap DT bindings additions at 80 characters * Add Acked-by from Krzysztof Changes since PATCHv1: * Drop first patch (not required) and rebase second patch accordingly * Rename DT property rockchip,php_grf -> rockchip,php-grf ==================== Link: https://lore.kernel.org/r/20220830154559.61506-1-sebastian.reichel@collabora.com Signed-off-by: Paolo Abeni commit a2b77831427cb576cd03d4dd953dffdc509aef39 Author: Sebastian Reichel Date: Tue Aug 30 17:45:59 2022 +0200 dt-bindings: net: rockchip-dwmac: add rk3588 gmac compatible Add compatible string for RK3588 gmac, which is similar to the RK3568 one, but needs another syscon device for clock selection. Acked-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel Signed-off-by: Paolo Abeni commit 2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1 Author: David Wu Date: Tue Aug 30 17:45:58 2022 +0200 net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588 Add constants and callback functions for the dwmac on RK3588 soc. As can be seen, the base structure is the same, only registers and the bits in them moved slightly. Signed-off-by: David Wu [rebase, squash fixes] Signed-off-by: Sebastian Reichel Signed-off-by: Paolo Abeni commit d5eff736902d5565a24f1b571b5987b3e5ee9a5b Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:26 2022 +0900 mm/sl[au]b: check if large object is valid in __ksize() If address of large object is not beginning of folio or size of the folio is too small, it must be invalid. WARN() and return 0 in such cases. Cc: Marco Elver Suggested-by: Vlastimil Babka Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 8dfa9d554061873f96335730fb1d403698b2b1b4 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:25 2022 +0900 mm/slab_common: move declaration of __ksize() to mm/slab.h __ksize() is only called by KASAN. Remove export symbol and move declaration to mm/slab.h as we don't want to grow its callers. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 2c1d697fb8ba6d2d44f914d4268ae1ccdf025f1b Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:24 2022 +0900 mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using Drop kmem_alloc event class, and define kmalloc and kmem_cache_alloc using TRACE_EVENT() macro. And then this patch does: - Do not pass pointer to struct kmem_cache to trace_kmalloc. gfp flag is enough to know if it's accounted or not. - Avoid dereferencing s->object_size and s->size when not using kmem_cache_alloc event. - Avoid dereferencing s->name in when not using kmem_cache_free event. - Adjust s->size to SLOB_UNITS(s->size) * SLOB_UNIT in SLOB Cc: Vasily Averin Suggested-by: Vlastimil Babka Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 33f93525799fa3c841b2ba93a56b2bb32ab11dc9 Author: Shang XiaoJing Date: Sat Aug 27 10:09:11 2022 +0800 sched/deadline: Move __dl_clear_params out of dl_bw lock As members in sched_dl_entity are independent with dl_bw, move __dl_clear_params out of dl_bw lock. Signed-off-by: Shang XiaoJing Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20220827020911.30641-1-shangxiaojing@huawei.com commit 96458e7f7dc5ad14bd7577cbf1638e1504ad79dd Author: Shang XiaoJing Date: Fri Aug 26 18:00:37 2022 +0800 sched/deadline: Add replenish_dl_new_period helper Wrap repeated code in helper function replenish_dl_new_period, which set the deadline and runtime of input dl_se based on pi_of(dl_se). Note that setup_new_dl_entity originally set the deadline and runtime base on dl_se, which should equals to pi_of(dl_se) for non-boosted task. Signed-off-by: Shang XiaoJing Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20220826100037.12146-1-shangxiaojing@huawei.com commit 973bee493a1f75c6c0752a74fb9396cbc34f026e Author: Shang XiaoJing Date: Fri Aug 26 16:34:53 2022 +0800 sched/deadline: Add dl_task_is_earliest_deadline helper Wrap repeated code in helper function dl_task_is_earliest_deadline, which return true if there is no deadline task on the rq at all, or task's deadline earlier than the whole rq. Signed-off-by: Shang XiaoJing Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20220826083453.698-1-shangxiaojing@huawei.com commit e66e5b2d7f43d92fffb940988ed2822a1b28143b Author: Suman Anna Date: Mon Jul 11 14:27:42 2022 +0530 arm64: dts: ti: k3-am64: Add SA2UL address space to Main CBASS ranges Add the address space for the SA2UL in MAIN domain to the ranges property of the cbass_main interconnect node so that the addresses within the corresponding sram nodes and its children can be translated properly by the relevant OF address API. Signed-off-by: Suman Anna Signed-off-by: Jayesh Choudhary Signed-off-by: Vignesh Raghavendra Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20220711085743.10128-2-j-choudhary@ti.com commit 279e46bc298629b26436c90bd4b5d104cc1e0fb2 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:46 2022 +0800 soundwire: intel: cleanup WakeEnable and WakeStatus Regroup offset and bitfield definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-12-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit bc7b9595392407549158651bc760c9bda2ab8b5d Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:45 2022 +0800 soundwire: intel: cleanup AC Timing Control Regroup offset and bitfield definitions Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 3ea29d33651db069080d1e3b12aea5ef36d766d1 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:44 2022 +0800 soundwire: intel: cleanup IO control Regroup offset and bitfield definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-10-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 5c0d256201ec0e47e42ca8cafd3bee54f1c923f0 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:43 2022 +0800 soundwire: intel: cleanup PCM Stream channel map and channel count Regroup offset and bitfield definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-9-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 40f7a3ddf4e4eff8868d0b0e4ed072f41ab6a528 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:42 2022 +0800 soundwire: intel: cleanup PCM stream capabilities Regroup offset and bitfields Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-8-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit bd45a65dad8e13ba47f8fb3d6a6c68adecc96db7 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:41 2022 +0800 soundwire: intel: add comment for control stream cap/chmap add comment and newline to mark out control stream capabilities and chmap. These registers are unused by the driver, only dumped in debugfs. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-7-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit c27ce5c9dd178f7218de6fd29651ad04bd496d5c Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:40 2022 +0800 soundwire: intel: remove unused PDM capabilities We removed PDM support a long time ago but kept the definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ca33a58d12d3c75a3b28cc97037563bb6e03be7c Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:39 2022 +0800 soundwire: intel: cleanup SHIM SYNC Regroup offset and bitfields, no functionality change Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-5-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit c36b610047463a37203e1158aeaf90f0a82f45dc Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:38 2022 +0800 soundwire: intel: remove IPPTR unused definition This read-only register only defines an offset which is known already and a version which isn't used. Remove unused definition. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit feaa24aa408f117dbf074b580d38131dc819505a Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:37 2022 +0800 soundwire: intel: regroup definitions for LCTL No functionality change, just regroup offset and bitfield definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7f8170686d1733321841b21da8c2cd09ddb922b7 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:38:36 2022 +0800 soundwire: intel: cleanup definition of LCOUNT Add definition in header file rather than hidden in code. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823053846.2684635-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 11e9734bcb6a7361943f993eba4e97f5812120d8 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:23 2022 +0900 mm/slab_common: unify NUMA and UMA version of tracepoints Drop kmem_alloc event class, rename kmem_alloc_node to kmem_alloc, and remove _node postfix for NUMA version of tracepoints. This will break some tools that depend on {kmem_cache_alloc,kmalloc}_node, but at this point maintaining both kmem_alloc and kmem_alloc_node event classes does not makes sense at all. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 26a40990ba052e6f553256f9d0f112452b992a38 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:22 2022 +0900 mm/sl[au]b: cleanup kmem_cache_alloc[_node]_trace() Despite its name, kmem_cache_alloc[_node]_trace() is hook for inlined kmalloc. So rename it to kmalloc[_node]_trace(). Move its implementation to slab_common.c by using __kmem_cache_alloc_node(), but keep CONFIG_TRACING=n varients to save a function call when CONFIG_TRACING=n. Use __assume_kmalloc_alignment for kmalloc[_node]_trace instead of __assume_slab_alignement. Generally kmalloc has larger alignment requirements. Suggested-by: Vlastimil Babka Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit b14051352465a24b3c9ceaccac4e39b3521bb370 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:21 2022 +0900 mm/sl[au]b: generalize kmalloc subsystem Now everything in kmalloc subsystem can be generalized. Let's do it! Generalize __do_kmalloc_node(), __kmalloc_node_track_caller(), kfree(), __ksize(), __kmalloc(), __kmalloc_node() and move them to slab_common.c. In the meantime, rename kmalloc_large_node_notrace() to __kmalloc_large_node() and make it static as it's now only called in slab_common.c. [ feng.tang@intel.com: adjust kfence skip list to include __kmem_cache_free so that kfence kunit tests do not fail ] Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit ac5e2fb425e1121ceef2b9d1b3ffccc195d55707 Author: Takashi Iwai Date: Wed Aug 31 15:00:21 2022 +0200 ALSA: usb-audio: Drop superfluous interface setup at parsing We reset each interface that is being parsed for each stream, but this is superfluous and even can lead to spurious errors. Since the interface is set up properly at opening the endpoint for each actual stream operation, let's drop the superfluous one. Link: https://lore.kernel.org/r/20220831130021.4762-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8a04d2fc700f717104bfb95b0f6694e448a4537f Author: Khalid Masum Date: Thu Sep 1 13:12:10 2022 +0600 xfrm: Update ipcomp_scratches with NULL when freed Currently if ipcomp_alloc_scratches() fails to allocate memory ipcomp_scratches holds obsolete address. So when we try to free the percpu scratches using ipcomp_free_scratches() it tries to vfree non existent vm area. Described below: static void * __percpu *ipcomp_alloc_scratches(void) { ... scratches = alloc_percpu(void *); if (!scratches) return NULL; ipcomp_scratches does not know about this allocation failure. Therefore holding the old obsolete address. ... } So when we free, static void ipcomp_free_scratches(void) { ... scratches = ipcomp_scratches; Assigning obsolete address from ipcomp_scratches if (!scratches) return; for_each_possible_cpu(i) vfree(*per_cpu_ptr(scratches, i)); Trying to free non existent page, causing warning: trying to vfree existent vm area. ... } Fix this breakage by updating ipcomp_scrtches with NULL when scratches is freed Suggested-by: Herbert Xu Reported-by: syzbot+5ec9bb042ddfe9644773@syzkaller.appspotmail.com Tested-by: syzbot+5ec9bb042ddfe9644773@syzkaller.appspotmail.com Signed-off-by: Khalid Masum Acked-by: Herbert Xu Signed-off-by: Steffen Klassert commit 99c969a83d8275bb396f6209dff2aa4cedaeb644 Author: Suman Ghosh Date: Tue Aug 30 17:33:04 2022 +0530 octeontx2-pf: Add egress PFC support As of now all transmit queues transmit packets out of same scheduler queue hierarchy. Due to this PFC frames sent by peer are not handled properly, either all transmit queues are backpressured or none. To fix this when user enables PFC for a given priority map relavant transmit queue to a different scheduler queue hierarcy, so that backpressure is applied only to the traffic egressing out of that TXQ. Signed-off-by: Suman Ghosh Link: https://lore.kernel.org/r/20220830120304.158060-1-sumang@marvell.com Signed-off-by: Paolo Abeni commit fc5e1acf6ade49da06c6a74b0c3fa903e0c9503a Author: Tom Talpey Date: Wed Aug 31 12:30:48 2022 -0400 RDMA/siw: Add missing Kconfig selections The SoftiWARP Kconfig is missing "select" for CRYPTO and CRYPTO_CRC32C. In addition, it improperly "depends on" LIBCRC32C, this should be a "select", similar to net/sctp and others. As a dependency, SIW fails to appear in generic configurations. Link: https://lore.kernel.org/r/d366bf02-3271-754f-fc68-1a84016d0e19@talpey.com Signed-off-by: Tom Talpey Acked-by: Bernard Metzler Signed-off-by: Leon Romanovsky commit 93df19476535a4ed871bc5eae719b6d67cf3abc3 Author: Serge Semin Date: Mon Aug 22 22:07:23 2022 +0300 EDAC/mc: Drop duplicated dimm->nr_pages debug printout The duplicated edac_dbg()-based dimm->nr_pages print was introduced in 6e84d359b2be ("edac_mc: Cleanup per-dimm_info debug messages"). The duplicated line can be found even in the commit message text: [ 1011.380101] EDAC DEBUG: edac_mc_dump_dimm: dimm->nr_pages = 0x40000 [ 1011.380103] EDAC DEBUG: edac_mc_dump_dimm: dimm->grain = 8 [ 1011.380104] EDAC DEBUG: edac_mc_dump_dimm: dimm->nr_pages = 0x40000 Drop the second edac_dbg() call. [ bp: Massage commit message. ] Signed-off-by: Serge Semin Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220822190730.27277-14-Sergey.Semin@baikalelectronics.ru commit 50c448bbc19815bf02d336c70627ab9159b213ed Merge: 2c2493b9da916 08a717e480379 Author: Steffen Klassert Date: Thu Sep 1 08:14:09 2022 +0200 Merge remote-tracking branch 'xfrm: start adding netlink extack support' Sabrina Dubroca says: ============ XFRM states and policies are complex objects, and there are many reasons why the kernel can reject userspace's request to create one. This series makes it a bit clearer by providing extended ack messages for policy creation. A few other operations that reuse the same helper functions are also getting partial extack support in this series. More patches will follow to complete extack support, in particular for state creation. Note: The policy->share attribute seems to be entirely ignored in the kernel outside of checking its value in verify_newpolicy_info(). There are some (very) old comments in copy_from_user_policy and copy_to_user_policy suggesting that it should at least be copied to/from userspace. I don't know what it was intended for. ============ Signed-off-by: Steffen Klassert commit a102c8973db7f7b7b6f75d51eed145d070438a49 Author: Zhengchao Shao Date: Mon Aug 29 15:12:19 2022 +0800 net: sched: remove redundant NULL check in change hook function Currently, the change function can be called by two ways. The one way is that qdisc_change() will call it. Before calling change function, qdisc_change() ensures tca[TCA_OPTIONS] is not empty. The other way is that .init() will call it. The opt parameter is also checked before calling change function in .init(). Therefore, it's no need to check the input parameter opt in change function. Signed-off-by: Zhengchao Shao Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220829071219.208646-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 0058d4814faadf4134d5f2cd22fbe721d4c9155e Author: Christian Gmeiner Date: Mon Aug 22 11:59:43 2022 +0200 arm64: dts: ti: k3-am64-main: Add main_cpts label Makes it easier to reference the node in board dts files. Signed-off-by: Christian Gmeiner Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220822095943.18563-1-christian.gmeiner@gmail.com commit e699bb9765cd447ab477e9e888ddbab347dcf35a Author: Shaomin Deng Date: Thu Aug 11 11:39:23 2022 -0400 scsi: target: pscsi: Remove repeated word "calling" There is repeated word, remove it. Link: https://lore.kernel.org/r/20220811153923.17278-1-dengshaomin@cdjrlc.com Reviewed-by: Chaitanya Kulkarni Signed-off-by: Shaomin Deng Signed-off-by: Martin K. Petersen commit e95b305addc976f1b163d1f5af063402d530a361 Author: Christophe JAILLET Date: Wed Jul 20 20:14:02 2022 +0200 scsi: hpsa: Simplify {clear|set}_bit() parameters {clear|set}_bit() can take an almost arbitrarily large bit number, so there is no need to manually compute addresses. This is just redundant. Link: https://lore.kernel.org/r/c3429a22023f58e5e5cc65d6cd7e83fb2bd9b870.1658340442.git.christophe.jaillet@wanadoo.fr Tested-by: Don Brace Acked-by: Don Brace Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 5afdd990ce2ea178eb6cbd31b197cc3d12a675bf Author: Christophe JAILLET Date: Wed Jul 20 20:13:54 2022 +0200 scsi: hpsa: Use the bitmap API to allocate bitmaps Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Link: https://lore.kernel.org/r/5f975ef43f8b7306e4ac4e2e8ce4bcd53f6092bb.1658340441.git.christophe.jaillet@wanadoo.fr Tested-by: Don Brace Acked-by: Don Brace Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit de05e4843cce5f4b385f60acfa690eb94af923b8 Author: ye xingchen Date: Wed Aug 24 07:51:23 2022 +0000 scsi: lpfc: Remove unneeded result variable Return the value from lpfc_issue_reg_vfi() directly instead of storing it in another redundant variable. Link: https://lore.kernel.org/r/20220824075123.221316-1-ye.xingchen@zte.com.cn Reported-by: Zeal Robot Reviewed-by: James Smart Signed-off-by: ye xingchen Signed-off-by: Martin K. Petersen commit 7fd080e19cb841244fe36085e41331cd04b85515 Author: ye xingchen Date: Wed Aug 24 07:50:17 2022 +0000 scsi: lpfc: Remove the unneeded result variable Return the value from lpfc_sli4_issue_wqe() directly instead of storing it in another redundant variable. Link: https://lore.kernel.org/r/20220824075017.221244-1-ye.xingchen@zte.com.cn Reported-by: Zeal Robot Reviewed-by: James Smart Signed-off-by: ye xingchen Signed-off-by: Martin K. Petersen commit 0414441259c4040048c239c2ab96a6e993e45ef6 Author: Randy Dunlap Date: Sat Aug 27 15:17:19 2022 -0700 scsi: docs: Fix a typo Correct a typo in SCSI documentation. Link: https://lore.kernel.org/r/20220827221719.11006-1-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Signed-off-by: Randy Dunlap Signed-off-by: Martin K. Petersen commit fed842d04dad979f0e74926720474ab0b037e7e8 Author: Nilesh Javali Date: Fri Aug 26 03:25:59 2022 -0700 scsi: qla2xxx: Update version to 10.02.07.900-k Link: https://lore.kernel.org/r/20220826102559.17474-8-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 2c57d0defa22b2339c06364a275bcc9048a77255 Author: Nilesh Javali Date: Fri Aug 26 03:25:58 2022 -0700 scsi: qla2xxx: Define static symbols drivers/scsi/qla2xxx/qla_os.c:40:20: warning: symbol 'qla_trc_array' was not declared. Should it be static? drivers/scsi/qla2xxx/qla_os.c:345:5: warning: symbol 'ql2xdelay_before_pci_error_handling' was not declared. Should it be static? Define qla_trc_array and ql2xdelay_before_pci_error_handling as static to fix sparse warnings. Link: https://lore.kernel.org/r/20220826102559.17474-7-njavali@marvell.com Cc: stable@vger.kernel.org Reported-by: kernel test robot Reviewed-by: Himanshu Madhani Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 8bfc149ba24cb985d593c0b2ddcf03ce42febe0c Author: Arun Easi Date: Fri Aug 26 03:25:57 2022 -0700 scsi: qla2xxx: Enhance driver tracing with separate tunable and more Older tracing of driver messages was to: - log only debug messages to kernel main trace buffer; and - log only if extended logging bits corresponding to this message is off This has been modified and extended as follows: - Tracing is now controlled via ql2xextended_error_logging_ktrace module parameter. Bit usages same as ql2xextended_error_logging. - Tracing uses "qla2xxx" trace instance, unless instance creation have issues. - Tracing is enabled (compile time tunable). - All driver messages, include debug and log messages are now traced in kernel trace buffer. Trace messages can be viewed by looking at the qla2xxx instance at: /sys/kernel/tracing/instances/qla2xxx/trace Trace tunable that takes the same bit mask as ql2xextended_error_logging is: ql2xextended_error_logging_ktrace (default=1) Link: https://lore.kernel.org/r/20220826102559.17474-6-njavali@marvell.com Suggested-by: Daniel Wagner Suggested-by: Steven Rostedt Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Reviewed-by: Daniel Wagner Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit d9ba85efc3fc743aa3c958efa996f397719cdc2a Author: Anil Gurumurthy Date: Fri Aug 26 03:25:56 2022 -0700 scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status Add new API to obtain the NVMe Parameters region status from the Auxiliary Image Status bitmap. Link: https://lore.kernel.org/r/20220826102559.17474-5-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Anil Gurumurthy Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 389f179b868e43121c6cfccfbf5e495842a766fd Author: Arun Easi Date: Fri Aug 26 03:25:55 2022 -0700 scsi: qla2xxx: Add debugfs create/delete helpers Define a few helpful macros for creating debugfs files. Link: https://lore.kernel.org/r/20220826102559.17474-4-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit e4f8a29deb3ba30e414dfb6b09e3ae3bf6dbe74a Author: Arun Easi Date: Fri Aug 26 03:25:54 2022 -0700 scsi: qla2xxx: Fix response queue handler reading stale packets On some platforms, the current logic of relying on finding new packet solely based on signature pattern can lead to driver reading stale packets. Though this is a bug in those platforms, reduce such exposures by limiting reading packets until the IN pointer. Link: https://lore.kernel.org/r/20220826102559.17474-3-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 6dc45a7322cb9db48a5b6696597a00ef7c778ef9 Author: Arun Easi Date: Fri Aug 26 03:25:53 2022 -0700 scsi: qla2xxx: Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Reverting this commit so that a fixed up patch, without adding new module parameters, can be submitted. Link: https://lore.kernel.org/stable/166039743723771@kroah.com/ This reverts commit b1f707146923335849fb70237eec27d4d1ae7d62. Link: https://lore.kernel.org/r/20220826102559.17474-2-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit eee8bb4a2b58212843aec92dd6c8c1cc193209e0 Author: Mauricio Faria de Oliveira Date: Thu Aug 25 09:01:59 2022 -0300 scsi: qla2xxx: Log message "skipping scsi_scan_host()" as informational This message is helpful to troubleshoot missing LUNs/SAN boot errors. It'd be nice to log it by default instead of only being enabled with debug. This user had an accidental/forgotten file modprobe.d/qla2xxx.conf w/ option qlini_mode=disabled from experiments with FC target mode, and their boot LUN didn't come up, as it skips SCSI scan, of course. However, their boot log didn't provide any clues to help understand that. The issue/message could be figured out w/ ql2xextended_error_logging, but it would have been simpler (or even deflected/addressed by user) if it had been there by default. And it also would help support/triage/deflection tooling. Expected change: scsi host15: qla2xxx +qla2xxx [0000:3b:00.0]-00fb:15: skipping scsi_scan_host() for non-initiator port qla2xxx [0000:3b:00.0]-00fb:15: QLogic QLE2692 - QLE2692 Dual Port 16Gb FC to PCIe Gen3 x8 Adapter. According to: qla2x00_probe_one() ... ret = scsi_add_host(...); ... ql_log(ql_log_info, ... "skipping scsi_scan_host() for non-initiator port\n"); ... ql_log(ql_log_info, ... "QLogic %s - %s.\n", ha->model_number, ha->model_desc); Link: https://lore.kernel.org/r/20220825120159.275051-1-mfo@canonical.com Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Martin K. Petersen commit c0958d2335fe7327bdda294a1ed42debe14d0346 Author: Sreekanth Reddy Date: Thu Aug 25 13:24:57 2022 +0530 scsi: mpt3sas: Update driver version to 43.100.00.00 Update driver version to 43.100.00.00. Link: https://lore.kernel.org/r/20220825075457.16422-5-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 669b2b667e69264cb9a914e0afd056abafa2f429 Author: Sreekanth Reddy Date: Thu Aug 25 13:24:56 2022 +0530 scsi: mpt3sas: Increase cmd_per_lun to 128 With cmd_per_lun value 7, a higher number of cache lines (map_nr) are needed while allocating sdev->budget_map which is not reasonable and hence increase the cmd_per_lun value to 128. Link: https://lore.kernel.org/r/20220825075457.16422-4-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 463e683bfdc457ce0a15c2c920ed30d3145ed44e Author: Sreekanth Reddy Date: Thu Aug 25 13:24:55 2022 +0530 scsi: mpt3sas: Fix trace buffer registration failed The ExtendedType field was set to 1 in the diag buffer register command and hence MPT Endpoint firmware is failing the request with Invalid Field IOCStatus. memset the request frame to zero before framing the diag buffer register command. Link: https://lore.kernel.org/r/20220825075457.16422-3-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 9df650963bf6d6c2c3fcd325d8c44ca2b99554fe Author: Sreekanth Reddy Date: Thu Aug 25 13:24:54 2022 +0530 scsi: mpt3sas: Don't change DMA mask while reallocating pools When a pool crosses the 4GB boundary region then before reallocating pools change the coherent DMA mask to 32 bits and keep the normal DMA mask set to 63/64 bits. Link: https://lore.kernel.org/r/20220825075457.16422-2-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit ddf958f39741a1dda74020ac8a0f226cb5aa017b Author: ye xingchen Date: Wed Aug 31 03:32:13 2022 +0000 cpufreq: tegra194: Remove the unneeded result variable Return the value returned by smp_call_function_single() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen [ Viresh: Minor update to commit log ] Signed-off-by: Viresh Kumar commit e75c8ea0d73bebdbff3ceb51f55fd735cb232d86 Author: Sreekanth Reddy Date: Tue Aug 16 13:38:01 2022 +0530 scsi: mpt3sas: Prevent error handler escalation when device removed If SCSI error handling is taking place for timed out I/Os on a drive and the corresponding drive is removed, then stop escalating to higher level of reset by returning the TUR with "I_T NEXUS LOSS OCCURRED" sense key. Link: https://lore.kernel.org/r/20220816080801.13929-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 0115953dcebe8858ba3d9997ba48328ebdca593f Author: Christophe Leroy Date: Wed Aug 31 11:32:09 2022 +0200 powerpc/32: Remove wii_memory_fixups() wii_memory_fixups() is not called anymore, remove it. Also remove left-overs in mmu_decl.h which were forgotten by commit 160985f3025b ("powerpc/wii: remove wii_mmu_mapin_mem2()") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5f2091f86528b59ef92ef1daed5d3dd8c0d7bebd.1661938317.git.christophe.leroy@csgroup.eu commit b0e0d68b1c52cb2c46e513011fdd53815cffefb7 Author: Christophe Leroy Date: Wed Aug 31 11:32:08 2022 +0200 powerpc/32: Allow fragmented physical memory Since commit 9e849f231c3c ("powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks.") it is possible to map all blocks as RAM on any PPC32. Remove related restrictions. And remove call to wii_memory_fixups() which doesn't do anything else than checks since commit 160985f3025b ("powerpc/wii: remove wii_mmu_mapin_mem2()") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fc9a5b8ef49f6eb86e970d4c7ccfba9b407fd4eb.1661938317.git.christophe.leroy@csgroup.eu commit fc06755e25628ce215e9f75c1207250242dadf42 Author: Christophe Leroy Date: Wed Aug 31 11:32:07 2022 +0200 powerpc/32: Drop a stale comment about reservation of gigantic pages A comment about the reservation of gigantic pages was left in MMU_init() after commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line") Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/959d77be630b9b46a7458f0fbd41dc3a94ec811a.1661938317.git.christophe.leroy@csgroup.eu commit 8b4bb0ad00cb347f62e76a636ce08eb179c843fc Author: Christophe Leroy Date: Mon Aug 15 21:48:40 2022 +1000 powerpc/code-patching: Speed up page mapping/unmapping Since commit 591b4b268435 ("powerpc/code-patching: Pre-map patch area") the patch area is premapped so intermediate page tables are already allocated. Use __set_pte_at() directly instead of the heavy map_kernel_page(), at for unmapping just do a pte_clear() followed by a flush. __set_pte_at() can be used directly without the filters in set_pte_at() because we are mapping a normal page non executable. Make sure gcc knows text_poke_area is page aligned in order to optimise the flush. This change reduces by 66% the time needed to activate ftrace on an 8xx (588000 tb ticks instead of 1744000). Signed-off-by: Christophe Leroy [mpe: Add ptesync needed on radix to avoid spurious fault] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220815114840.1468656-1-mpe@ellerman.id.au commit 48658213202c4f48ef34b43b9b6f60af8b67fb8a Author: Gustavo A. R. Silva Date: Mon Aug 15 16:52:33 2022 -0500 scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_SEQ_NUM_SYNC Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(type-of-flex-array) * count where count is the max number of items the flexible array is supposed to have. Link: https://github.com/KSPP/linux/issues/160 Link: https://lore.kernel.org/r/b215f4760f0e8fbe5fc35be20f2487e89924424d.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 41e830269d68a07b3e9214449b9ff0be7a3cfda5 Author: Gustavo A. R. Silva Date: Mon Aug 15 16:51:36 2022 -0500 scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(type-of-flex-array) * count where count is the max number of items the flexible array is supposed to have. Link: https://github.com/KSPP/linux/issues/160 Link: https://lore.kernel.org/r/1211398fb8f7ab332a93f4f8f1a63e8168dbd002.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit ee92366a8439856136368a106e6e08ffa8306a1e Author: Gustavo A. R. Silva Date: Mon Aug 15 16:49:38 2022 -0500 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_PD_CFG_SEQ_NUM_SYNC One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct MR_PD_CFG_SEQ_NUM_SYNC and refactor the rest of the code accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays [0]. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: Link: https://reviews.llvm.org/D126864 [0] Link: https://lore.kernel.org/r/78e9261591db072b67fcf49f0216d7046a67ca6d.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit eeb3bab77244b8d91e4e9b611177cd1196900163 Author: Gustavo A. R. Silva Date: Mon Aug 15 16:46:13 2022 -0500 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_DRV_RAID_MAP One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct MR_DRV_RAID_MAP and refactor the code accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/1448f387821833726b99f0ce13069ada89164eb5.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen Enhanced-by: Kees Cook # Change in struct MR_DRV_RAID_MAP_ALL commit 204a29a169f4c80aa3b7feb41c45cbd6833aba21 Author: Gustavo A. R. Silva Date: Mon Aug 15 16:42:21 2022 -0500 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP_DYNAMIC One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct MR_FW_RAID_MAP_DYNAMIC. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/896476f8fe43cf83b491c6c13f59c9ace780d82c.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit ac23b92b27e32f1ff331350342ce9f2ee9d0ab0f Author: Gustavo A. R. Silva Date: Mon Aug 15 16:40:35 2022 -0500 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct MR_DRV_RAID_MAP and refactor the the rest of the code accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/4495ce170c8ef088a10f1abe0e7c227368f43242.1660592640.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen Enhanced-by: Kees Cook # Change in struct MR_FW_RAID_MAP_ALL commit 3cb0643a9aae7cf360102a6a9db47f5ce9fefdb1 Author: Tetsuo Handa Date: Sun Aug 21 12:59:44 2022 +0900 scsi: qla2xxx: Avoid flush_scheduled_work() usage Although qla2xxx driver is calling schedule_{,delayed}_work() from 10 locations, I assume that flush_scheduled_work() from qlt_stop_phase1() needs to flush only works scheduled by qlt_sched_sess_work(), for this loop continues while "struct qla_tgt"->sess_works_list is not empty. Link: https://lore.kernel.org/r/133c6723-90b6-5c8b-72b4-cc01eeb3a8c0@I-love.SAKURA.ne.jp Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Tetsuo Handa Signed-off-by: Martin K. Petersen commit a4345557527f7d9dab6684fc2d1dd7800e99d73a Author: Tetsuo Handa Date: Sun Aug 21 12:59:00 2022 +0900 scsi: qla2xxx: Always wait for qlt_sess_work_fn() from qlt_stop_phase1() Currently qlt_stop_phase1() may fail to call flush_scheduled_work(), for list_empty() may return true as soon as qlt_sess_work_fn() called list_del(). In order to close this race window, check list_empty() after calling flush_scheduled_work(). If this patch causes problems, please check commit c4f135d64382 ("workqueue: Wrap flush_workqueue() using a macro"). We are on the way to remove all flush_scheduled_work() calls from the kernel. Link: https://lore.kernel.org/r/7f24469d-9e39-3398-d851-329b54c0b923@I-love.SAKURA.ne.jp Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Tetsuo Handa Signed-off-by: Martin K. Petersen commit 1b2b8d45ccd6a61f88c0d5a55c9119c3b710bfa5 Author: Tetsuo Handa Date: Sun Aug 21 12:58:24 2022 +0900 scsi: qla2xxx: Remove unused qlt_tmr_work() qlt_tmr_work() is no longer used since commit fb35265b12bb ("scsi: qla2xxx: Remove session creation redundant code"). Link: https://lore.kernel.org/r/a0e53c70-b801-adf5-0549-b2b1e421a819@I-love.SAKURA.ne.jp Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Tetsuo Handa Signed-off-by: Martin K. Petersen commit e6852b41b560129bb000538490ca39a0be2b591c Author: Tetsuo Handa Date: Sun Aug 21 12:57:50 2022 +0900 scsi: qla2xxx: Remove unused del_sess_list field "struct qla_tgt"->del_sess_list is no longer used since commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery"). Link: https://lore.kernel.org/r/0c335e86-5624-b599-5137-f1377419fb0c@I-love.SAKURA.ne.jp Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Tetsuo Handa Signed-off-by: Martin K. Petersen commit 1775c2080eb177928e64b924f30db32a36027a0e Author: James Smart Date: Thu Aug 18 18:17:36 2022 -0700 scsi: lpfc: Copyright updates for 14.2.0.6 patches Update copyrights to 2022 for files modified in the 14.2.0.6 patch set. Link: https://lore.kernel.org/r/20220819011736.14141-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b5c6c88e5809a90635ddea0aadb96e1522a3dcb0 Author: James Smart Date: Thu Aug 18 18:17:35 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.6 Update lpfc version to 14.2.0.6. Link: https://lore.kernel.org/r/20220819011736.14141-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2af33e5a031f7eb13f79cb33f5ede30607f772f0 Author: James Smart Date: Thu Aug 18 18:17:34 2022 -0700 scsi: lpfc: Remove SANDiags related code The SANDiags feature is unused, and related code is removed. Link: https://lore.kernel.org/r/20220819011736.14141-6-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 71ddeeaf5bd5122713ca64601ef19ee2dba04e30 Author: James Smart Date: Thu Aug 18 18:17:33 2022 -0700 scsi: lpfc: Add warning notification period to CMF_SYNC_WQE Add capability to specify warning notification period to help firmware adjust to congestion accordingly. Link: https://lore.kernel.org/r/20220819011736.14141-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit bd269188ea94e40ab002cad7b0df8f12b8f0de54 Author: James Smart Date: Thu Aug 18 18:17:32 2022 -0700 scsi: lpfc: Rework MIB Rx Monitor debug info logic The kernel test robot reported the following sparse warning: arch/arm64/include/asm/cmpxchg.h:88:1: sparse: sparse: cast truncates bits from constant value (369 becomes 69) On arm64, atomic_xchg only works on 8-bit byte fields. Thus, the macro usage of LPFC_RXMONITOR_TABLE_IN_USE can be unintentionally truncated leading to all logic involving the LPFC_RXMONITOR_TABLE_IN_USE macro to not work properly. Replace the Rx Table atomic_t indexing logic with a new lpfc_rx_info_monitor structure that holds a circular ring buffer. For locking semantics, a spinlock_t is used. Link: https://lore.kernel.org/r/20220819011736.14141-4-jsmart2021@gmail.com Fixes: 17b27ac59224 ("scsi: lpfc: Add rx monitoring statistics") Cc: # v5.15+ Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 59b7e210a522b836a01516c71ee85d1d92c1f075 Author: James Smart Date: Thu Aug 18 18:17:31 2022 -0700 scsi: lpfc: Fix null ndlp ptr dereference in abnormal exit path for GFT_ID An error case exit from lpfc_cmpl_ct_cmd_gft_id() results in a call to lpfc_nlp_put() with a null pointer to a nodelist structure. Changed lpfc_cmpl_ct_cmd_gft_id() to initialize nodelist pointer upon entry. Link: https://lore.kernel.org/r/20220819011736.14141-3-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 439b93293ff202dae9661937a73af03374ec0ed0 Author: James Smart Date: Thu Aug 18 18:17:30 2022 -0700 scsi: lpfc: Fix unsolicited FLOGI receive handling during PT2PT discovery During a stress offline/online test in PT2PT topology, target rediscovery can fail with a specific target vendor array. When the HBA transitions to online mode it is possible to receive an unsolicited FLOGI before processing the Link Up event. The received FLOGI will set the defer_flogi_acc_flag, which instructs the driver to wait until it transmits its own FLOGI before ACKing the received FLOGI. In this failure scenario, the link up processing clears the set defer_flogi_acc_flag before we have sent out the FLOGI. As the target has the higher WWPN and is responsible for sending the PLOGI, the target is stuck waiting for its FLOGI_ACC that the driver will never send. Remove the clear of defer_flogi_acc_flag from Link Up event processing. In this stress test case, the defer_flogi_acc_flag is cleared during the Link Down event processing anyways. Link: https://lore.kernel.org/r/20220819011736.14141-2-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit f0ee639adb78753377da3d125d7d72531026bca1 Author: Colin Ian King Date: Fri Aug 5 12:56:52 2022 +0100 scsi: st: Remove redundant variable pointer stp Variable stp is assigned a value that is never read, the assignment and the variable stp are redundant and can be removed. Cleans up clang scan build warning: drivers/scsi/st.c:4253:7: warning: Although the value stored to 'stp' is used in the enclosing expression, the value is never actually read from 'stp' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220805115652.2340991-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 4e62671a9a49c0f226311cbac08cdb64e905ab47 Author: Colin Ian King Date: Fri Aug 5 12:50:42 2022 +0100 scsi: megaraid: Remove redundant assignment to variable mfiStatus The variable mfiStatus is assigned a value but it is never read. The assignment is redundant and can be removed. Also remove { } as the return statement does not need to be in its own code block. Cleans up clang scan build warning: drivers/scsi/megaraid/megaraid_sas_base.c:4026:7: warning: Although the value stored to 'mfiStatus' is used in the enclosing expression, the value is never actually read from 'mfiStatus' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220805115042.2340400-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 3fa5975b07e9d0ca949537aca24adc0a17e37bfc Author: Colin Ian King Date: Fri Aug 5 12:41:00 2022 +0100 scsi: initio: Remove redundant assignment to pointer scb The variable scb is assigned a value but it is never read. The assignment is redundant and can be removed. Also replace the != NULL check with the more usual non-null check idiom. Cleans up clang scan build warning: drivers/scsi/initio.c:1169:9: warning: Although the value stored to 'scb' is used in the enclosing expression, the value is never actually read from 'scb' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220805114100.2339637-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 231159f33436326c97fd5f05a1926cae3e5b7885 Author: Colin Ian King Date: Fri Aug 5 12:32:14 2022 +0100 scsi: message: fusion: Remove redundant variable iocnum Variable iocnum is assigned a value that is never read, the assignment and hence the variable are redundant can be removed. Also update the comment to reflect the correct name of the variable being updated. Cleans up clang-scan warning: drivers/message/fusion/mptctl.c:641:8: warning: Although the value stored to 'iocnum' is used in the enclosing expression, the value is never actually read from 'iocnum' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220805113214.2339022-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit f45fadde91ec892fdc453e3df9469e9457152526 Author: Bradley Grove Date: Fri Aug 5 13:46:09 2022 -0400 scsi: mpt3sas: Disable MPI2_FUNCTION_FW_DOWNLOAD for ATTO devices Disable firmware download for ATTO devices where it is not supported. Link: https://lore.kernel.org/r/20220805174609.14830-2-bgrove@attotech.com Co-developed-by: Rob Crispo Signed-off-by: Rob Crispo Signed-off-by: Bradley Grove Signed-off-by: Martin K. Petersen commit 91cf186aa1bfea06c7438b16eb40a612a4c3b87a Author: Bradley Grove Date: Fri Aug 5 13:46:08 2022 -0400 scsi: mpt3sas: Add support for ATTO ExpressSAS H12xx GT devices Add ATTO's PCI IDs and modify the driver to handle the unique NVRAM structure used by ATTO's devices. Link: https://lore.kernel.org/r/20220805174609.14830-1-bgrove@attotech.com Co-developed-by: Rob Crispo Signed-off-by: Rob Crispo Signed-off-by: Bradley Grove Signed-off-by: Martin K. Petersen commit 7f90bc70d1a6ab024cfe2512f5ba8e93ed45a35d Author: Sreekanth Reddy Date: Thu Aug 4 18:42:26 2022 +0530 scsi: mpi3mr: Block I/Os while refreshing target dev objects Block the I/Os on the target devices until corresponding target device's target dev objects are refreshed as part of post controller reset operation. Link: https://lore.kernel.org/r/20220804131226.16653-16-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 2745ce0e6d30e66a97bc6c236cde3356812a3496 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:25 2022 +0530 scsi: mpi3mr: Refresh SAS ports during soft reset Update the host's SAS ports if there is change in port id or phys. If the port id is changed, then the driver updates it. If some phys are enabled/disabled during reset, then driver updates them in STL. Check for the responding expander devices and update the device handle if it got changed. Register the expander with STL if it got added during reset and unregister the expander device if it got removed during reset. [mkp: include fix for zeroday warning] Link: https://lore.kernel.org/r/20220804131226.16653-15-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 9a1043d43a9ab75d28b8ec54512ea13ec33bc910 Author: Serge Semin Date: Mon Aug 22 22:07:22 2022 +0300 EDAC/mc: Replace spaces with tabs in memtype flags definition Currently, the memory type macros are partly defined with multiple spaces between the macro name and its definition. Replace the spaces with tabs as the kernel coding style requires. Signed-off-by: Serge Semin Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220822190730.27277-13-Sergey.Semin@baikalelectronics.ru commit 0e4d354762cefd3e16b4cff8988ff276e45effc4 Author: Richard Gobert Date: Mon Aug 29 13:18:51 2022 +0200 net-next: Fix IP_UNICAST_IF option behavior for connected sockets The IP_UNICAST_IF socket option is used to set the outgoing interface for outbound packets. The IP_UNICAST_IF socket option was added as it was needed by the Wine project, since no other existing option (SO_BINDTODEVICE socket option, IP_PKTINFO socket option or the bind function) provided the needed characteristics needed by the IP_UNICAST_IF socket option. [1] The IP_UNICAST_IF socket option works well for unconnected sockets, that is, the interface specified by the IP_UNICAST_IF socket option is taken into consideration in the route lookup process when a packet is being sent. However, for connected sockets, the outbound interface is chosen when connecting the socket, and in the route lookup process which is done when a packet is being sent, the interface specified by the IP_UNICAST_IF socket option is being ignored. This inconsistent behavior was reported and discussed in an issue opened on systemd's GitHub project [2]. Also, a bug report was submitted in the kernel's bugzilla [3]. To understand the problem in more detail, we can look at what happens for UDP packets over IPv4 (The same analysis was done separately in the referenced systemd issue). When a UDP packet is sent the udp_sendmsg function gets called and the following happens: 1. The oif member of the struct ipcm_cookie ipc (which stores the output interface of the packet) is initialized by the ipcm_init_sk function to inet->sk.sk_bound_dev_if (the device set by the SO_BINDTODEVICE socket option). 2. If the IP_PKTINFO socket option was set, the oif member gets overridden by the call to the ip_cmsg_send function. 3. If no output interface was selected yet, the interface specified by the IP_UNICAST_IF socket option is used. 4. If the socket is connected and no destination address is specified in the send function, the struct ipcm_cookie ipc is not taken into consideration and the cached route, that was calculated in the connect function is being used. Thus, for a connected socket, the IP_UNICAST_IF sockopt isn't taken into consideration. This patch corrects the behavior of the IP_UNICAST_IF socket option for connect()ed sockets by taking into consideration the IP_UNICAST_IF sockopt when connecting the socket. In order to avoid reconnecting the socket, this option is still ignored when applied on an already connected socket until connect() is called again by the Richard Gobert. Change the __ip4_datagram_connect function, which is called during socket connection, to take into consideration the interface set by the IP_UNICAST_IF socket option, in a similar way to what is done in the udp_sendmsg function. [1] https://lore.kernel.org/netdev/1328685717.4736.4.camel@edumazet-laptop/T/ [2] https://github.com/systemd/systemd/issues/11935#issuecomment-618691018 [3] https://bugzilla.kernel.org/show_bug.cgi?id=210255 Signed-off-by: Richard Gobert Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220829111554.GA1771@debian Signed-off-by: Jakub Kicinski commit 744ccd5c64bda0a4130b470ce2772985f20913ce Merge: cb45a8bf46939 4516c873e3b55 Author: Jakub Kicinski Date: Wed Aug 31 19:39:56 2022 -0700 Merge branch 'net-sched-remove-unused-variables' Zhengchao Shao says: ==================== net: sched: remove unused variables The variable "other" is unused, remove it. ==================== Link: https://lore.kernel.org/r/20220830092255.281330-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 4516c873e3b55856012ddd6db9d4366ce3c60c5d Author: Zhengchao Shao Date: Tue Aug 30 17:22:55 2022 +0800 net: sched: gred/red: remove unused variables in struct red_stats The variable "other" in the struct red_stats is not used. Remove it. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit 38af11717b386560f10f2891350933fc5200aeea Author: Zhengchao Shao Date: Tue Aug 30 17:22:54 2022 +0800 net: sched: choke: remove unused variables in struct choke_sched_data The variable "other" in the struct choke_sched_data is not used. Remove it. Signed-off-by: Zhengchao Shao Signed-off-by: Jakub Kicinski commit cb45a8bf4693965e89d115cd2c510f12bc127c37 Author: Robert Hancock Date: Mon Aug 29 17:39:01 2022 -0600 net: axienet: Switch to 64-bit RX/TX statistics The RX and TX byte/packet statistics in this driver could be overflowed relatively quickly on a 32-bit platform. Switch these stats to use the u64_stats infrastructure to avoid this. Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220829233901.3429419-1-robert.hancock@calian.com Signed-off-by: Jakub Kicinski commit 20dfb74783093e863228d511f7e6a8db8ee39e18 Author: Stephen Boyd Date: Tue Aug 30 15:58:31 2022 -0700 platform/chrome: cros_typec_switch: Inline DRV_NAME This macro is only used one place, let's inline it instead to save a line or two. Cc: Prashant Malani Cc: Tzung-Bi Shih Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220830225831.2362403-5-swboyd@chromium.org commit dc22a33e35859835b09cff11f445928af0197808 Author: Stephen Boyd Date: Tue Aug 30 15:58:30 2022 -0700 platform/chrome: cros_typec_switch: Use PTR_ERR_OR_ZERO() to simplify Use the standard error pointer macro to shorten the code and simplify. Cc: Prashant Malani Cc: Tzung-Bi Shih Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220830225831.2362403-4-swboyd@chromium.org commit bbb5fb85cf48757a18870aaeedf6936d5c1f1ead Author: Stephen Boyd Date: Tue Aug 30 15:58:29 2022 -0700 platform/chrome: cros_typec_switch: Remove impossible condition The type of 'index' is unsigned long long, which can't possibly be less than zero. Remove the impossible check. Cc: Prashant Malani Cc: Tzung-Bi Shih Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220830225831.2362403-3-swboyd@chromium.org commit 8dab6a5939199a5dcf0731eb2dce757837575633 Author: Stephen Boyd Date: Tue Aug 30 15:58:28 2022 -0700 platform/chrome: cros_typec_switch: Add missing newline on printk We need a newline here to ensure the next printk starts fresh. Cc: Prashant Malani Cc: Tzung-Bi Shih Fixes: affc804c44c8 ("platform/chrome: cros_typec_switch: Add switch driver") Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220830225831.2362403-2-swboyd@chromium.org commit a60511cf15204e41f4edbcdc4ee80208d528917c Author: Linus Walleij Date: Mon Aug 29 15:20:01 2022 +0200 net/rds: Pass a pointer to virt_to_page() Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). If we instead implement a proper virt_to_pfn(void *addr) function the following happens (occurred on arch/arm): net/rds/message.c:357:56: warning: passing argument 1 of 'virt_to_pfn' makes pointer from integer without a cast [-Wint-conversion] Fix this with an explicit cast. Cc: Santosh Shilimkar Cc: rds-devel@oss.oracle.com Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220829132001.114858-1-linus.walleij@linaro.org Signed-off-by: Jakub Kicinski commit 3cc53c57d0d54b7fc307879443d555c95b466510 Author: AngeloGioacchino Del Regno Date: Wed Jul 20 12:28:17 2022 +0200 clk: mediatek: mt8195: Add reset idx for USB/PCIe T-PHY Add the reset idx for the t-phy port 1, used as either USB or PCI-Express (secondary controller) PHY, depending on board-specific configuration/layout. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220720102817.237483-3-angelogioacchino.delregno@collabora.com Signed-off-by: Stephen Boyd commit 697b551e29b61a00eea46c4704220756587e13af Author: AngeloGioacchino Del Regno Date: Wed Jul 20 12:28:16 2022 +0200 dt-bindings: reset: mt8195: Add resets for USB/PCIe t-phy port 1 Add the reset index for USBSIF P1 (T-PHY port 1), used as either USB or PCI-Express PHY reset. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220720102817.237483-2-angelogioacchino.delregno@collabora.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 3f10f49cd9f8ab6471639d4ca2c6db9451121779 Author: AngeloGioacchino Del Regno Date: Tue Jul 19 11:33:16 2022 +0200 clk: mediatek: mt8195-infra_ao: Set pwrmcu clocks as critical The pwrmcu is responsible for power management and idle states in SSPM: on older SoCs this was managed in Linux drivers like sspm/mcupm/eemgpu but, at least on MT8195, this functionality was transferred to the ATF firmware. For this reason, turning off the pwrmcu related clocks from the kernel will lead to unability to resume the platform after suspend and other currently unknown PM related side-effects. Set the PWRMCU and PWRMCU_BUS_H clocks as critical to prevent the kernel from turning them off, fixing the aforementioned issue. Fixes: e2edf59dec0b ("clk: mediatek: Add MT8195 infrastructure clock support") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220719093316.37253-1-angelogioacchino.delregno@collabora.com Reviewed-by: Matthias Brugger Signed-off-by: Stephen Boyd commit c39da7d0b40265eb4d0e9e5a1ea460ebc3f3185e Author: AngeloGioacchino Del Regno Date: Wed Jun 29 12:52:05 2022 +0200 clk: mediatek: mt8195: Add reset idx for PCIe0 and PCIe1 Add the reset idx for PCIe P0, P1, located in infra_ao RST2 registers. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220629105205.173471-3-angelogioacchino.delregno@collabora.com Signed-off-by: Stephen Boyd commit 7e5073a74f60a3197773fa57b796a59ae40e6542 Author: AngeloGioacchino Del Regno Date: Wed Jun 29 12:52:04 2022 +0200 dt-bindings: reset: mt8195: Add resets for PCIE controllers Add the reset index for PCIe P0 and P1 (PCIe0, PCIe1) on MT8195. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220629105205.173471-2-angelogioacchino.delregno@collabora.com Acked-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit 12198d9179aaa53d0a4026318d8b73b146d89729 Author: Lukas Bulwahn Date: Wed Jul 20 10:29:34 2022 +0200 clk: davinci: remove PLL and PSC clocks for DaVinci DM644x and DM646x Commit 7dd33764486d ("ARM: davinci: Delete DM644x board files") and commit b4aed01de486 ("ARM: davinci: Delete DM646x board files") removes the support for DaVinci DM644x and DM646x boards. Hence, remove the PLL and PSC clock descriptions for those boards as well. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220720082934.17741-1-lukas.bulwahn@gmail.com Reviewed-by: David Lechner Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd commit a0476f6a2cac012c0aee4dc981a53e1414cea069 Author: Larry Finger Date: Tue Aug 16 16:35:22 2022 -0500 Bluetooth: btusb: Add BT device 0cb8:c549 from RTW8852AE to tables A new Bluetooth device for the Realtek RTW8852AE has been noted. This device has the following lsusb output: Bus 001 Device 003: ID 0cb8:c549 Opticis Co., Ltd Bluetooth Radio The pertinent part of /sys/kernel/debug/usb/devices is as follows: T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0cb8 ProdID=c549 Rev= 0.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Larry Finger Signed-off-by: Luiz Augusto von Dentz commit c7577014b74c5369490715015db096182f1a2a23 Author: Szabolcs Sipos Date: Fri Aug 26 00:42:08 2022 +0200 Bluetooth: btusb: Add RTL8761BUV device (Edimax BT-8500) T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=7392 ProdID=c611 Rev= 2.00 S: Manufacturer=Realtek S: Product=Edimax Bluetooth Adapter S: SerialNumber=XXXXXXXXXXXX C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Szabolcs Sipos Signed-off-by: Luiz Augusto von Dentz commit d8daa3991652a5713061f23276dc91fb846dc0c0 Author: Szabolcs Sipos Date: Fri Aug 26 00:42:07 2022 +0200 Bluetooth: btusb: RTL8761BUV consistent naming Based on photos available from the FCC, all currently supported RTL8761B series USB dongles have the same chip: RTL8761BUV. rtl8761bu is often used to refer to this chip. rtl8761b sometimes refers to this chip, and other times to its UART variant (RTL8761BTV). +----------------+---------+---------+---------------+ | Dongle | USB VID | USB PID | FCC ID | +----------------+---------+---------+---------------+ | ASUS USB-BT500 | 0x0b05 | 0x190e | MSQ-USBBTJB00 | | TP-Link UB500 | 0x2357 | 0x0604 | 2AXJ4UB500 | | EDUP EP-B3519 | | | 2AHRD-EPB3519 | | EDUP EP-B3536 | | | 2AHRDEP-B3536 | | UGREEN CM390 | | | 2AQI5-CM390 | +----------------+---------+---------+---------------+ Signed-off-by: Szabolcs Sipos Signed-off-by: Luiz Augusto von Dentz commit c4ba5800217b9efa710b27fbe638930830a95d19 Author: Max Chou Date: Mon Aug 29 19:45:07 2022 +0800 Bluetooth: btusb: Add Realtek RTL8852C support ID 0x13D3:0x3592 Add the support ID(0x13D3, 0x3592) to usb_device_id table for Realtek RTL8852C. The device info from /sys/kernel/debug/usb/devices as below. T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3592 Rev= 0.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00e04c000001 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Max Chou Signed-off-by: Luiz Augusto von Dentz commit ed3d5bd20dcdfdbe110feeabf120cba7bd329ad8 Author: ChiYuan Huang Date: Fri Aug 12 12:36:39 2022 -0700 Input: rt5120 - add power key support Add RT5120 PMIC power key support. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1660100142-32493-4-git-send-email-u0084500@gmail.com Signed-off-by: Dmitry Torokhov commit 1a942de092c0b96216864fedcb4d8822ce3fc12e Author: Brian Gix Date: Tue Aug 16 09:41:20 2022 -0700 Bluetooth: Move hci_abort_conn to hci_conn.c hci_abort_conn() is a wrapper around a number of DISCONNECT and CREATE_CONN_CANCEL commands that was being invoked from hci_request request queues, which are now deprecated. There are two versions: hci_abort_conn() which can be invoked from the hci_event thread, and hci_abort_conn_sync() which can be invoked within a hci_sync cmd chain. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 278d933e12f163369d1f18e8e3e5c49d5e77f233 Author: Brian Gix Date: Tue Aug 16 12:04:34 2022 -0700 Bluetooth: Normalize HCI_OP_READ_ENC_KEY_SIZE cmdcmplt The HCI_OP_READ_ENC_KEY_SIZE command is converted from using the deprecated hci_request mechanism to use hci_send_cmd, with an accompanying hci_cc_read_enc_key_size to handle it's return response. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 7305b78ae45f2ce19fbb9e83d7a8c45214d2cdc9 Author: Sven van Ashbrook Date: Tue Aug 30 04:59:39 2022 +0000 r8152: allow userland to disable multicast The rtl8152 driver does not disable multicasting when userspace asks it to. For example: $ ifconfig eth0 -multicast -allmulti $ tcpdump -p -i eth0 # will still capture multicast frames Fix by clearing the device multicast filter table when multicast and allmulti are both unset. Tested as follows: - Set multicast on eth0 network interface - verify that multicast packets are coming in: $ tcpdump -p -i eth0 - Clear multicast and allmulti on eth0 network interface - verify that no more multicast packets are coming in: $ tcpdump -p -i eth0 Signed-off-by: Sven van Ashbrook Acked-by: Hayes Wang Link: https://lore.kernel.org/r/20220830045923.net-next.v1.1.I4fee0ac057083d4f848caf0fa3a9fd466fc374a0@changeid Signed-off-by: Jakub Kicinski commit 7987448ffc34f41590bae5b28cd23ca0b8c93291 Author: Stephen Kitt Date: Wed Jul 13 18:08:40 2022 +0200 x86/Kconfig: Specify idle=poll instead of no-hlt Commit 27be45700021 ("x86 idle: remove 32-bit-only "no-hlt" parameter, hlt_works_ok flag") removed no-hlt, but CONFIG_APM still refers to it. Suggest "idle=poll" instead, based on the commit message: > If a user wants to avoid HLT, then "idle=poll" > is much more useful, as it avoids invocation of HLT > in idle, while "no-hlt" failed to do so. Signed-off-by: Stephen Kitt Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220713160840.1577569-1-steve@sk2.org commit b8d1d163604bd1e600b062fb00de5dc42baa355f Author: Daniel Sneddon Date: Tue Aug 16 16:19:42 2022 -0700 x86/apic: Don't disable x2APIC if locked The APIC supports two modes, legacy APIC (or xAPIC), and Extended APIC (or x2APIC). X2APIC mode is mostly compatible with legacy APIC, but it disables the memory-mapped APIC interface in favor of one that uses MSRs. The APIC mode is controlled by the EXT bit in the APIC MSR. The MMIO/xAPIC interface has some problems, most notably the APIC LEAK [1]. This bug allows an attacker to use the APIC MMIO interface to extract data from the SGX enclave. Introduce support for a new feature that will allow the BIOS to lock the APIC in x2APIC mode. If the APIC is locked in x2APIC mode and the kernel tries to disable the APIC or revert to legacy APIC mode a GP fault will occur. Introduce support for a new MSR (IA32_XAPIC_DISABLE_STATUS) and handle the new locked mode when the LEGACY_XAPIC_DISABLED bit is set by preventing the kernel from trying to disable the x2APIC. On platforms with the IA32_XAPIC_DISABLE_STATUS MSR, if SGX or TDX are enabled the LEGACY_XAPIC_DISABLED will be set by the BIOS. If legacy APIC is required, then it SGX and TDX need to be disabled in the BIOS. [1]: https://aepicleak.com/aepicleak.pdf Signed-off-by: Daniel Sneddon Signed-off-by: Dave Hansen Acked-by: Dave Hansen Tested-by: Neelima Krishnan Link: https://lkml.kernel.org/r/20220816231943.1152579-1-daniel.sneddon@linux.intel.com commit f029c781dd6d8e2f13593c927c66db7e8826ed28 Author: Wolfram Sang Date: Tue Aug 30 22:14:54 2022 +0200 net: ethernet: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: Petr Machata # For drivers/net/ethernet/mellanox/mlxsw Acked-by: Geoff Levand # For ps3_gelic_net and spider_net_ethtool Acked-by: Tom Lendacky # For drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c Acked-by: Marcin Wojtas # For drivers/net/ethernet/marvell/mvpp2 Reviewed-by: Leon Romanovsky # For drivers/net/ethernet/mellanox/mlx{4|5} Reviewed-by: Shay Agroskin # For drivers/net/ethernet/amazon/ena Acked-by: Krzysztof Hałasa # For IXP4xx Ethernet Link: https://lore.kernel.org/r/20220830201457.7984-3-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit fb3ceec187e8bca474340e361a18163a2e79c0a2 Author: Wolfram Sang Date: Tue Aug 30 22:14:52 2022 +0200 net: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Marc Kleine-Budde # for CAN Link: https://lore.kernel.org/r/20220830201457.7984-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit c9ae8c966f05c85c5928c8f1790b13b71cc5ccd5 Merge: 197072945a708 1c636b6277a2b Author: Martin KaFai Lau Date: Wed Aug 31 13:35:47 2022 -0700 Merge branch 'fixes for concurrent htab updates' Hou Tao says: ==================== From: Hou Tao Hi, The patchset aims to fix the issues found during investigating the syzkaller problem reported in [0]. It seems that the concurrent updates to the same hash-table bucket may fail as shown in patch 1. Patch 1 uses preempt_disable() to fix the problem for htab_use_raw_lock() case. For !htab_use_raw_lock() case, the problem is left to "BPF specific memory allocator" patchset [1] in which !htab_use_raw_lock() will be removed. Patch 2 fixes the out-of-bound memory read problem reported in [0]. The problem has the root cause as patch 1 and it is fixed by handling -EBUSY from htab_lock_bucket() correctly. Patch 3 add two cases for hash-table update: one for the reentrancy of bpf_map_update_elem(), and another one for concurrent updates of the same hash-table bucket. Comments are always welcome. Regards, Tao [0]: https://lore.kernel.org/bpf/CACkBjsbuxaR6cv0kXJoVnBfL9ZJXjjoUcMpw_Ogc313jSrg14A@mail.gmail.com/ [1]: https://lore.kernel.org/bpf/20220819214232.18784-1-alexei.starovoitov@gmail.com/ Change Log: v4: * rebased on bpf-next * add htab_update to DENYLIST.s390x v3: https://lore.kernel.org/bpf/20220829023709.1958204-1-houtao@huaweicloud.com/ * patch 1: update commit message and add Fixes tag * patch 2: add Fixes tag * patch 3: elaborate the description of test cases v2: https://lore.kernel.org/bpf/bd60ef93-1c6a-2db2-557d-b09b92ad22bd@huaweicloud.com/ * Note the fix is for CONFIG_PREEMPT case in commit message and add Reviewed-by tag for patch 1 * Drop patch "bpf: Allow normally concurrent map updates for !htab_use_raw_lock() case" v1: https://lore.kernel.org/bpf/20220821033223.2598791-1-houtao@huaweicloud.com/ ==================== Signed-off-by: Martin KaFai Lau commit 1c636b6277a2b2bf504df490b8dbadd2bd34ccd4 Author: Hou Tao Date: Wed Aug 31 12:26:29 2022 +0800 selftests/bpf: Add test cases for htab update One test demonstrates the reentrancy of hash map update on the same bucket should fail, and another one shows concureently updates of the same hash map bucket should succeed and not fail due to the reentrancy checking for bucket lock. There is no trampoline support on s390x, so move htab_update to denylist. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220831042629.130006-4-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 66a7a92e4d0d091e79148a4c6ec15d1da65f4280 Author: Hou Tao Date: Wed Aug 31 12:26:28 2022 +0800 bpf: Propagate error from htab_lock_bucket() to userspace In __htab_map_lookup_and_delete_batch() if htab_lock_bucket() returns -EBUSY, it will go to next bucket. Going to next bucket may not only skip the elements in current bucket silently, but also incur out-of-bound memory access or expose kernel memory to userspace if current bucket_cnt is greater than bucket_size or zero. Fixing it by stopping batch operation and returning -EBUSY when htab_lock_bucket() fails, and the application can retry or skip the busy batch as needed. Fixes: 20b6cc34ea74 ("bpf: Avoid hashtab deadlock with map_locked") Reported-by: Hao Sun Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220831042629.130006-3-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 2775da21628738ce073a3a6a806adcbaada0f091 Author: Hou Tao Date: Wed Aug 31 12:26:27 2022 +0800 bpf: Disable preemption when increasing per-cpu map_locked Per-cpu htab->map_locked is used to prohibit the concurrent accesses from both NMI and non-NMI contexts. But since commit 74d862b682f5 ("sched: Make migrate_disable/enable() independent of RT"), migrate_disable() is also preemptible under CONFIG_PREEMPT case, so now map_locked also disallows concurrent updates from normal contexts (e.g. userspace processes) unexpectedly as shown below: process A process B htab_map_update_elem() htab_lock_bucket() migrate_disable() /* return 1 */ __this_cpu_inc_return() /* preempted by B */ htab_map_update_elem() /* the same bucket as A */ htab_lock_bucket() migrate_disable() /* return 2, so lock fails */ __this_cpu_inc_return() return -EBUSY A fix that seems feasible is using in_nmi() in htab_lock_bucket() and only checking the value of map_locked for nmi context. But it will re-introduce dead-lock on bucket lock if htab_lock_bucket() is re-entered through non-tracing program (e.g. fentry program). One cannot use preempt_disable() to fix this issue as htab_use_raw_lock being false causes the bucket lock to be a spin lock which can sleep and does not work with preempt_disable(). Therefore, use migrate_disable() when using the spinlock instead of preempt_disable() and defer fixing concurrent updates to when the kernel has its own BPF memory allocator. Fixes: 74d862b682f5 ("sched: Make migrate_disable/enable() independent of RT") Reviewed-by: Hao Luo Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20220831042629.130006-2-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit d2153e4cdf7b5306baa6e98ea74573ffbb88091c Author: Rob Herring Date: Tue Aug 23 09:56:47 2022 -0500 dt-bindings: timer: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-16-robh@kernel.org commit 7b3c2046f6fc97324c58904b56f9e7a2c0f27049 Author: Rob Herring Date: Tue Aug 23 09:56:46 2022 -0500 dt-bindings: power: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20220823145649.3118479-15-robh@kernel.org commit 197072945a708d62181895409effdfcda80c7798 Author: Martin KaFai Lau Date: Tue Aug 30 16:19:53 2022 -0700 selftest/bpf: Ensure no module loading in bpf_setsockopt(TCP_CONGESTION) This patch adds a test to ensure bpf_setsockopt(TCP_CONGESTION, "not_exist") will not trigger the kernel module autoload. Before the fix: [ 40.535829] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 [...] [ 40.552134] tcp_ca_find_autoload.constprop.0+0xcb/0x200 [ 40.552689] tcp_set_congestion_control+0x99/0x7b0 [ 40.553203] do_tcp_setsockopt+0x3ed/0x2240 [...] [ 40.556041] __bpf_setsockopt+0x124/0x640 Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220830231953.792412-1-martin.lau@linux.dev commit 84e5a0f208ca341ec1ea88a97c40849a2d541faa Author: Martin KaFai Lau Date: Tue Aug 30 16:19:46 2022 -0700 bpf, net: Avoid loading module when calling bpf_setsockopt(TCP_CONGESTION) When bpf prog changes tcp-cc by calling bpf_setsockopt(TCP_CONGESTION), it should not try to load module which may be a blocking operation. This details was correct in the v1 [0] but missed by mistake in the later revision in commit cb388e7ee3a8 ("bpf: net: Change do_tcp_setsockopt() to use the sockopt's lock_sock() and capable()"). This patch fixes it by checking the has_current_bpf_ctx(). [0] https://lore.kernel.org/bpf/20220727060921.2373314-1-kafai@fb.com/ Fixes: cb388e7ee3a8 ("bpf: net: Change do_tcp_setsockopt() to use the sockopt's lock_sock() and capable()") Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220830231946.791504-1-martin.lau@linux.dev commit ff4e0cafe845110c9b7fe26eb8a6b49d60a1288c Author: Rodrigo Vivi Date: Tue Aug 30 15:35:37 2022 -0400 drm/i915/slpc: Fix inconsistent locked return Fix for intel_guc_slpc_set_min_freq() warn: inconsistent returns '&slpc->lock'. v2: Avoid with_intel_runtime_pm with the internal goto/return. (Ashutosh) Also standardize the 'ret' if this came from the efficient setup. And avoid the 'unlikely'. Fixes: 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency") Reported-by: kernel test robot Reported-by: Dan Carpenter Cc: Ashutosh Dixit Signed-off-by: Rodrigo Vivi Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20220830193537.52201-1-rodrigo.vivi@intel.com commit 0e056f414e5b1b797886a90e77f6576f121c2a09 Author: Francesco Dolcini Date: Tue Jul 12 18:33:43 2022 +0200 dt-bindings: gpio: stmpe: Remove node name requirement STMPE driver does not require a specific node name anymore, only the compatible is checked, update binding according to this. Signed-off-by: Francesco Dolcini Acked-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 21370ecddfe1ff6fb826faedb601cfbb7adcf4ff Author: Allen-KH Cheng Date: Thu Sep 1 01:21:51 2022 +0800 soc: mediatek: mutex: Add mt8186 mutex mod settings for mdp3 Add mt8186 mutex mod settings for mdp3. Co-developed-by: Xiandong Wang Signed-off-by: Xiandong Wang Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220831172151.10215-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 7c4ddc819fba0527dbf85d9a7233f376f05b6ec8 Author: Allen-KH Cheng Date: Thu Sep 1 01:21:50 2022 +0800 dt-bindings: soc: mediatek: Add mdp3 mutex support for mt8186 Add mdp3 mutex compatible for mt8186 SoC. Co-developed-by: Xiandong Wang Signed-off-by: Xiandong Wang Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220831172151.10215-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 8af1a9afe10005088f25f6c4c5b6e3eeaade6a93 Author: Heiner Kallweit Date: Sun Aug 28 19:26:55 2022 +0200 net: phy: smsc: use device-managed clock API Simplify the code by using the device-managed clock API. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/b222be68-ba7e-999d-0a07-eca0ecedf74e@gmail.com Signed-off-by: Jakub Kicinski commit bd8092def983f567800f764a5d23b2dca98f078c Author: Wolfram Sang Date: Thu Aug 18 23:01:56 2022 +0200 PM: suspend: move from strlcpy() with unused retval to strscpy() Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit 1e6c8fb8b8d3e91e140b505e8a68b05f81ac0f87 Author: Wolfram Sang Date: Thu Aug 18 23:01:11 2022 +0200 thermal: move from strlcpy() with unused retval to strscpy() Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit 0dbc0f49d6739033a4a2807726d1d6542f16b099 Author: Wolfram Sang Date: Thu Aug 18 23:00:15 2022 +0200 intel_idle: move from strlcpy() with unused retval to strscpy() Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit ccf28724604ee9b8577d21022e31c323d104cca2 Author: Wolfram Sang Date: Thu Aug 18 23:00:01 2022 +0200 cpuidle: powernv: move from strlcpy() with unused retval to strscpy() Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit ca08e46d4215e85eb3cef2481255431d98da56da Author: Perry Yuan Date: Mon Aug 15 00:35:47 2022 +0800 cpufreq: amd-pstate: update pstate frequency transition delay time Change the default transition latency to be 20ms that is more reasonable transition delay for AMD processors in non-EPP driver mode. Update transition delay time to 1ms, in the AMD CPU autonomous mode and non-autonomous mode, CPPC firmware will decide frequency at 1ms timescale based on the workload utilization. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 0e9a86386bca646d3b0fc50e5e15eedb1eb620b3 Author: Perry Yuan Date: Mon Aug 15 00:35:46 2022 +0800 cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor The patch will fix the invalid desired perf value for powersave governor. This issue is found when testing on one AMD EPYC system, the actual des_perf is smaller than the min_perf value, that is invalid value. because the min_perf is the lowest_perf system can support in idle state. Reviewed-by: Huang Rui Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit b185c5053c65b7704ead4537e4d4d9b33dc398dc Author: Perry Yuan Date: Mon Aug 15 00:35:45 2022 +0800 cpufreq: amd_pstate: fix wrong lowest perf fetch Fix the wrong lowest perf value reading which is used for new des_perf calculation by governor requested, the incorrect min_perf will get incorrect des_perf to be set , that will cause the system frequency changing unexpectedly. Reviewed-by: Huang Rui Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou Signed-off-by: Rafael J. Wysocki commit d8bee41db83ea207792889df323bb46ee4ebab24 Author: Perry Yuan Date: Mon Aug 15 00:35:44 2022 +0800 cpufreq: amd-pstate: fix white-space Remove the white space and correct mixed-up indentation Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 4f59540c3cd00a9a361b2cf2ac475edd83fd4f93 Author: Perry Yuan Date: Mon Aug 15 00:35:43 2022 +0800 cpufreq: amd-pstate: simplify cpudata pointer assignment move the cpudata assignment to cpudata declaration which will simplify the functions. No functional change intended. Reviewed-by: Huang Rui Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 1ea252ef299bbce16cc40d52d0635346fdc4b7ea Author: zhaoxiao Date: Fri Aug 12 14:39:26 2022 +0800 thermal: da9062-thermal: Drop redundant error message Since platform_get_irq() already prints an error message on failure, it is not necessary to print another one for the same purpose. Signed-off-by: zhaoxiao [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 14e5ce79943a72b9bf0fff8a5867320a9fa3e40d Author: James Hilliard Date: Mon Aug 29 15:05:46 2022 -0600 libbpf: Add GCC support for bpf_tail_call_static The bpf_tail_call_static function is currently not defined unless using clang >= 8. To support bpf_tail_call_static on GCC we can check if __clang__ is not defined to enable bpf_tail_call_static. We need to use GCC assembly syntax when the compiler does not define __clang__ as LLVM inline assembly is not fully compatible with GCC. Signed-off-by: James Hilliard Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220829210546.755377-1-james.hilliard1@gmail.com commit ea3747181dc2705ecc697dc98ada7eb135733561 Author: Jason Wang Date: Thu Aug 11 20:04:50 2022 +0800 cpuidle: coupled: Drop duplicate word from a comment The double `are' is duplicated in the comment, remove one. Signed-off-by: Jason Wang [ rjw: New subject ] Signed-off-by: Rafael J. Wysocki commit 8a7d61bdc2fac2c460a2f32a062f5c6dbd21a764 Author: Maciej Fijalkowski Date: Tue Aug 30 15:39:05 2022 +0200 selftests/xsk: Add missing close() on netns fd Commit 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") removed close on netns fd, which is not correct, so let us restore it. Fixes: 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220830133905.9945-1-maciej.fijalkowski@intel.com commit c00c4461689e15ac2cc3b9a595a54e4d8afd3d77 Author: Maciej Fijalkowski Date: Tue Aug 30 14:17:05 2022 +0200 xsk: Fix backpressure mechanism on Tx Commit d678cbd2f867 ("xsk: Fix handling of invalid descriptors in XSK TX batching API") fixed batch API usage against set of descriptors with invalid ones but introduced a problem when AF_XDP SW rings are smaller than HW ones. Mismatch of reported Tx'ed frames between HW generator and user space app was observed. It turned out that backpressure mechanism became a bottleneck when the amount of produced descriptors to CQ is lower than what we grabbed from XSK Tx ring. Say that 512 entries had been taken from XSK Tx ring but we had only 490 free entries in CQ. Then callsite (ZC driver) will produce only 490 entries onto HW Tx ring but 512 entries will be released from Tx ring and this is what will be seen by the user space. In order to fix this case, mix XSK Tx/CQ ring interractions by moving around internal functions and changing call order: * pull out xskq_prod_nb_free() from xskq_prod_reserve_addr_batch() up to xsk_tx_peek_release_desc_batch(); ** move xskq_cons_release_n() into xskq_cons_read_desc_batch() After doing so, algorithm can be described as follows: 1. lookup Tx entries 2. use value from 1. to reserve space in CQ (*) 3. Read from Tx ring as much descriptors as value from 2 3a. release descriptors from XSK Tx ring (**) 4. Finally produce addresses to CQ Fixes: d678cbd2f867 ("xsk: Fix handling of invalid descriptors in XSK TX batching API") Signed-off-by: Magnus Karlsson Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220830121705.8618-1-maciej.fijalkowski@intel.com commit b1a2c4ee8be1df1931599e3214402ed9d6f97f8e Author: Jean Delvare Date: Thu Aug 4 13:59:38 2022 +0200 thermal/drivers/thermal_mmio: Drop of_match_ptr() Now that the driver depends on OF, we know what of_match_ptr() will always resolve to, so we might as well save cpp some work. Signed-off-by: Jean Delvare Signed-off-by: Rafael J. Wysocki commit 499c8bb4693d1c8d8f3d6dd38e5bdde3ff5bd906 Author: Kohei Tarumizu Date: Wed Aug 24 09:44:10 2022 -0700 x86/resctrl: Fix to restore to original value when re-enabling hardware prefetch register The current pseudo_lock.c code overwrites the value of the MSR_MISC_FEATURE_CONTROL to 0 even if the original value is not 0. Therefore, modify it to save and restore the original values. Fixes: 018961ae5579 ("x86/intel_rdt: Pseudo-lock region creation/removal core") Fixes: 443810fe6160 ("x86/intel_rdt: Create debugfs files for pseudo-locking testing") Fixes: 8a2fc0e1bc0c ("x86/intel_rdt: More precise L2 hit/miss measurements") Signed-off-by: Kohei Tarumizu Signed-off-by: Dave Hansen Acked-by: Reinette Chatre Link: https://lkml.kernel.org/r/eb660f3c2010b79a792c573c02d01e8e841206ad.1661358182.git.reinette.chatre@intel.com commit c829dba797360d9a266cabfaac16d1cd80abfc2b Author: Shung-Hsi Yu Date: Wed Aug 31 11:40:39 2022 +0800 MAINTAINERS: Add include/linux/tnum.h to BPF CORE Maintainers of the kerne/bpf/tnum.c are also the maintainers of the corresponding header file include/linux/tnum.h. Add the file entry for include/linux/tnum.h to the appropriate section in MAINTAINERS. Signed-off-by: Shung-Hsi Yu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220831034039.17998-1-shung-hsi.yu@suse.com commit 92d23c6e94157739b997cacce151586a0d07bb8a Author: Bart Van Assche Date: Fri Aug 26 09:21:16 2022 -0700 overflow, tracing: Define the is_signed_type() macro once There are two definitions of the is_signed_type() macro: one in and a second definition in . As suggested by Linus Torvalds, move the definition of the is_signed_type() macro into the header file. Change the definition of the is_signed_type() macro to make sure that it does not trigger any sparse warnings with future versions of sparse for bitwise types. See also: https://lore.kernel.org/all/CAHk-=whjH6p+qzwUdx5SOVVHjS3WvzJQr6mDUwhEyTf6pJWzaQ@mail.gmail.com/ https://lore.kernel.org/all/CAHk-=wjQGnVfb4jehFR0XyZikdQvCZouE96xR_nnf5kqaM5qqQ@mail.gmail.com/ Cc: Andrew Morton Cc: Arnd Bergmann Cc: Dan Williams Cc: Eric Dumazet Cc: Ingo Molnar Cc: Isabella Basso Cc: "Jason A. Donenfeld" Cc: Josh Poimboeuf Cc: Luc Van Oostenryck Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Peter Zijlstra Cc: Rasmus Villemoes Cc: Sander Vanheule Cc: Steven Rostedt Cc: Vlastimil Babka Cc: Yury Norov Signed-off-by: Bart Van Assche Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220826162116.1050972-3-bvanassche@acm.org commit addbeea6f50b5ac344331652dd7f35faf760969e Author: Bart Van Assche Date: Fri Aug 26 09:21:15 2022 -0700 testing/selftests: Add tests for the is_signed_type() macro Although not documented, is_signed_type() must support the 'bool' and pointer types next to scalar and enumeration types. Add a selftest that verifies that this macro handles all supported types correctly. Cc: Andrew Morton Cc: Arnd Bergmann Cc: Dan Williams Cc: Eric Dumazet Cc: Ingo Molnar Cc: Isabella Basso Cc: "Jason A. Donenfeld" Cc: Josh Poimboeuf Cc: Luc Van Oostenryck Cc: Masami Hiramatsu Cc: Nathan Chancellor Cc: Peter Zijlstra Cc: Rasmus Villemoes Cc: Sander Vanheule Cc: Steven Rostedt Cc: Vlastimil Babka Cc: Yury Norov Signed-off-by: Bart Van Assche Tested-by: Isabella Basso Acked-by: Rasmus Villemoes Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220826162116.1050972-2-bvanassche@acm.org commit f24d71feb206631116ff9adaa6d43650c5dd8849 Author: AngeloGioacchino Del Regno Date: Tue Aug 16 15:32:56 2022 -0400 clk: mediatek: clk-mt8195-vdo1: Reparent and set rate on vdo1_dpintf's parent Like it was done for the vdo0_dp_intf0_dp_intf clock (used for eDP), add the CLK_SET_RATE_PARENT flag to CLK_VDO1_DPINTF (used for DP) and also fix its parent clock name as it has to be "top_dp" for two reasons: - This is its real parent! - Likewise to eDP/VDO0 counterpart, we need clock source selection on CLK_TOP_DP. Fixes: 269987505ba9 ("clk: mediatek: Add MT8195 vdosys1 clock support") Signed-off-by: AngeloGioacchino Del Regno Tested-by: Bo-Chen Chen Reviewed-by: Bo-Chen Chen Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220816193257.658487-3-nfraprado@collabora.com Signed-off-by: Stephen Boyd commit 3f0dadd230cc2630202a977fe52cd1dd7a7579a7 Author: AngeloGioacchino Del Regno Date: Tue Aug 16 15:32:55 2022 -0400 clk: mediatek: clk-mt8195-vdo0: Set rate on vdo0_dp_intf0_dp_intf's parent Add the CLK_SET_RATE_PARENT flag to the CLK_VDO0_DP_INTF0_DP_INTF clock: this is required to trigger clock source selection on CLK_TOP_EDP, while avoiding to manage the enablement of the former separately from the latter in the displayport driver. Fixes: 70282c90d4a2 ("clk: mediatek: Add MT8195 vdosys0 clock support") Signed-off-by: AngeloGioacchino Del Regno Tested-by: Bo-Chen Chen Reviewed-by: Bo-Chen Chen Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220816193257.658487-2-nfraprado@collabora.com Signed-off-by: Stephen Boyd commit a212f5ca5718d6f8c246d90e231aa76beb05bc23 Author: Max Krummenacher Date: Wed Aug 31 10:17:01 2022 -0700 dt-bindings: input: colibri-vf50-ts: Improve documentation Clarify properties definition, drop unused pinctrl-2 state 'gpio'. Signed-off-by: Max Krummenacher Signed-off-by: Francesco Dolcini Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220712101619.326120-3-francesco.dolcini@toradex.com Signed-off-by: Dmitry Torokhov commit 8a32cff217b7a0f1ab3b744fc9cd0626f08f7f15 Author: Max Krummenacher Date: Wed Aug 31 10:16:25 2022 -0700 Input: colibri-vf50-ts - don't depend on VF610_ADC Any IIO ADC can be used with the driver, so do not depend on VF610_ADC. Signed-off-by: Max Krummenacher Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20220712101619.326120-2-francesco.dolcini@toradex.com Signed-off-by: Dmitry Torokhov commit a5810f551d0a8c83b4817b53a446bd115e7182ce Author: Ville Syrjälä Date: Wed Aug 31 00:24:36 2022 +0300 drm/i915: Allow more varied alternate fixed modes for panels On some systems the panel reports alternate modes with different blanking periods. If the EDID reports them and VBT doesn't tell us otherwise then I can't really see why they should be rejected. So allow their use for the purposes of static DRRS. For seamless DRRS we still require a much more exact match of course. But that logic only kicks in when selecting the downclock mode (or in the future when determining whether we can do a seamless refresh rate change due to a user modeset). Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6374 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220830212436.2021-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0a98181f805058773961c5ab3172ecf1bf1ed0e1 Author: James Clark Date: Tue Aug 30 18:26:13 2022 +0100 coresight: Make new csdev_access offsets unsigned New csdev_access functions were added as part of the previous refactor. In order to make them more consistent with the existing ones, change any signed offset types to be unsigned. Now that they are unsigned, stop using hi_off = -1 to signify a single 32bit access. Instead just call the existing 32bit accessors. This is also applied to other parts of the codebase, and the coresight_{read,write}_reg_pair() functions can be deleted. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220830172614.340962-6-james.clark@arm.com Signed-off-by: Mathieu Poirier commit fbca79e55429fe0f73b2d2d190fd86bfda52c41b Author: James Clark Date: Tue Aug 30 18:26:12 2022 +0100 coresight: cti-sysfs: Re-use same functions for similar sysfs register accessors Currently each accessor macro creates an identical function which wastes space in the text area and pollutes the ftrace function name list. Change it so that the same function is used, but the register to access is passed in as parameter rather than baked into each function. Note that only the single accessor is used here and not csdev_access_relaxed_read_pair() like in the previous commit, so so a single unsigned offset value is stored instead. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220830172614.340962-5-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 08e9fa5f3663eaab20ea3430023d1dfbf60d29f5 Author: James Clark Date: Tue Aug 30 18:26:11 2022 +0100 coresight: Re-use same function for similar sysfs register accessors Currently each accessor macro creates an identical function which wastes space in the text area and pollutes the ftrace function names. Change it so that the same function is used, but the register to access is passed in as parameter rather than baked into each function. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220830172614.340962-4-james.clark@arm.com Signed-off-by: Mathieu Poirier commit b6df1cbb415e543f2908f9c59a8fb20714b86879 Author: James Clark Date: Tue Aug 30 18:26:10 2022 +0100 coresight: Simplify sysfs accessors by using csdev_access abstraction The coresight_device struct is available in the sysfs accessor, and this contains a csdev_access struct which can be used to access registers. Use this instead of passing in the type of each drvdata so that a common function can be shared between all the cs drivers. No functional changes. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220830172614.340962-3-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 3727f03e2bc63de56fd00acb8846393106318156 Author: James Clark Date: Tue Aug 30 18:26:09 2022 +0100 coresight: Remove unused function parameter The ability to use a custom function in this sysfs show function isn't used so remove it. No functional changes. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220830172614.340962-2-james.clark@arm.com Signed-off-by: Mathieu Poirier commit a06289f3f72431f3777af95ea1226b5b0abdc426 Author: Ville Syrjälä Date: Mon Aug 29 16:58:34 2022 +0300 drm/i915/bios: Copy the whole MIPI sequence block Turns out the MIPI sequence block version number and new block size fields are considered part of the block header and are not included in the reported new block size field itself. Bump up the block size appropriately so that we'll copy over the last five bytes of the block as well. For this particular machine those last five bytes included parts of the GPIO op for the backlight on sequence, causing the backlight no longer to turn back on: Sequence 6 - MIPI_SEQ_BACKLIGHT_ON Delay: 20000 us - GPIO index 0, number 0, set 0 (0x00) + GPIO index 1, number 70, set 1 (0x01) Cc: stable@vger.kernel.org Fixes: e163cfb4c96d ("drm/i915/bios: Make copies of VBT data blocks") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6652 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220829135834.8585-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 06bfa86eee805e49875a64a23f083aeeb5e39daa Author: Ville Syrjälä Date: Tue May 10 13:42:42 2022 +0300 drm/i915/bios: Dump PNPID and panel name Dump the panel PNPID and name from the VBT. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220510104242.6099-16-ville.syrjala@linux.intel.com commit 03e067bc731c7cf8fba403ecfe4e2a85b49a11c0 Author: Jani Nikula Date: Tue Aug 30 12:34:11 2022 +0300 drm/i915/fence: replace BUG_ON() with BUILD_BUG_ON() Avoid BUG_ON(). Since __i915_sw_fence_init() is always called via a wrapper macro, we can replace it with a compile time BUILD_BUG_ON(). Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-5-jani.nikula@intel.com commit 6f10c4d62377c8a0b013ba98230abdae71cd7723 Author: Jani Nikula Date: Tue Aug 30 12:34:10 2022 +0300 drm/i915/perf: replace BUG_ON() with WARN_ON() Avoid BUG_ON(). Replace with WARN_ON() and early return. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-4-jani.nikula@intel.com commit 8482af4bd28b74853bfbba9feab1a28ce868c747 Author: Jani Nikula Date: Tue Aug 30 12:34:09 2022 +0300 drm/i915/pch: replace BUG_ON() with drm_WARN_ON() Avoid BUG_ON(). Replace with drm_WARN_ON(). Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-3-jani.nikula@intel.com commit b801a98f81bf72884de2e6c8409fd3fea5cc3f67 Author: Jani Nikula Date: Tue Aug 30 12:34:08 2022 +0300 drm/i915/dpll: replace BUG_ON() with drm_WARN_ON() Avoid BUG_ON(). Actually check the dpll count and bail out loudly with drm_WARN_ON() from the loop before overflowing i915->dpll.shared_dplls[]. v2: Rebase Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-2-jani.nikula@intel.com commit 99f37216b36622343b8f1eb625921a9888054a9b Author: Jani Nikula Date: Tue Aug 30 12:34:07 2022 +0300 drm/i915/crt: remove BUG_ON() Avoid BUG_ON(). We don't have such checks on output type anywhere else either, so just remove. Suggested-by: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-1-jani.nikula@intel.com commit 0bd459ddf9e4f1af3ee3148eb319d1f8747f02ba Author: Shenwei Wang Date: Fri Aug 12 08:30:12 2022 -0500 gpio: imx-scu: add imx-scu GPIO driver The SCU firmware on i.MX8 platforms provides a set of APIs to control the GPIO PINs on the SCU domain. This patch implements the standard GPIO driver interface to access those PINs on the SCU domain over the SCU APIs. Signed-off-by: Shenwei Wang Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 3bdd1afa3e223f99bfb5fa5051da843dff7eca12 Author: Shenwei Wang Date: Fri Aug 12 08:30:11 2022 -0500 dt-bindings: firmware: imx: Add imx-scu gpio node Add the description for imx-scu gpio subnode. Signed-off-by: Shenwei Wang Acked-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2d6f58a1e9a001902a072d8f3d99c96b9c7a1454 Author: Shenwei Wang Date: Fri Aug 12 08:30:10 2022 -0500 dt-bindings: gpio: Add imx scu gpio driver bindings Add binding document for the imx scu gpio driver. Signed-off-by: Shenwei Wang Reviewed-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0514b50cf79b22decce0dd2cfccb5671322e9bf7 Author: Jani Nikula Date: Tue Aug 30 13:28:02 2022 +0300 drm/i915/gmbus: mass dev_priv -> i915 rename Now that gmbus no longer uses macros that assume dev_priv is implicitly available, mass rename dev_priv to i915 in gmbus code. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/fcf16a65f7975379a887ed57c623b25de7b344c8.1661855191.git.jani.nikula@intel.com commit 3721d4fb763ed9f580d942f95b366c252c01633c Author: Jani Nikula Date: Tue Aug 30 13:28:01 2022 +0300 drm/i915/reg: stop using implicit dev_priv in DSPCLK_GATE_D Remove the implicit dev_priv usage in DSPCLK_GATE_D register, and pass it as parameter. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/41ca83573ca2d94bea568058f8cb8c35e814f8b1.1661855191.git.jani.nikula@intel.com commit 6d737d9bff5fe98e01bedb39ab9f5be3a39b5ddf Author: Jani Nikula Date: Tue Aug 30 13:28:00 2022 +0300 drm/i915/gmbus: stop using implicit dev_priv in register definitions Since the beginning of time, we've implicitly assumed dev_priv is present as a local variable in many places. We've gone a long way in removing many of them, but the register macro definitions are the last holdout. Remove them from the gmbus macros. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/a4f482c1f523d7225420f8386f1eea6d639db843.1661855191.git.jani.nikula@intel.com commit 4567084c305154b5abd427f568132432c41f13ef Author: Jani Nikula Date: Tue Aug 30 13:27:59 2022 +0300 drm/i915/gmbus: add wrapper for gmbus mmio base Don't repeat the same thing so much. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/db360d824d47601d5ca843afa6f5d6ee17d0e514.1661855191.git.jani.nikula@intel.com commit 3047d7060e4db3b4d8f6f915db50a089662caf65 Author: Jani Nikula Date: Tue Aug 30 13:27:58 2022 +0300 drm/i915/gmbus: whitespace cleanup in reg definitions Simple whitespace cleanup and comment movement. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/50df38c9f3e53dba64429b7eaa6c0d7bfaf74078.1661855191.git.jani.nikula@intel.com commit 51b072de8e0f2d5bb562474efd81f1cef77e496e Author: Jani Nikula Date: Tue Aug 30 13:27:57 2022 +0300 drm/i915/gmbus: split out gmbus regs in a separate file Declutter i915_reg.h, and also observe very few places need the gmbus register defitions. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/820807f404e548ab365b934d44f01b306eaa28c2.1661855191.git.jani.nikula@intel.com commit 6344e66970c619a1623f457910e78819076e9104 Author: Christian Brauner Date: Mon Aug 29 14:38:45 2022 +0200 xattr: constify value argument in vfs_setxattr() Now that we don't perform translations directly in vfs_setxattr() anymore we can constify the @value argument in vfs_setxattr(). This also allows us to remove the hack to cast from a const in ovl_do_setxattr(). Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) commit 7e1401acd9f2807ff271100c5ce1fa84bf27a252 Author: Christian Brauner Date: Mon Aug 29 14:38:44 2022 +0200 ovl: use vfs_set_acl_prepare() The posix_acl_from_xattr() helper should mainly be used in i_op->get_acl() handlers. It translates from the uapi struct into the kernel internal POSIX ACL representation and doesn't care about mount idmappings. Use the vfs_set_acl_prepare() helper to generate a kernel internal POSIX ACL representation in struct posix_acl format taking care to map from the mount idmapping into the filesystem's idmapping. The returned struct posix_acl is in the correct format to be cached by the VFS or passed to the filesystem's i_op->set_acl() method to write to the backing store. Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) commit 52edb4080eb9606536c34d5d642ccd9d35ad5d08 Author: Christian Brauner Date: Mon Aug 29 14:38:43 2022 +0200 acl: move idmapping handling into posix_acl_xattr_set() The uapi POSIX ACL struct passed through the value argument during setxattr() contains {g,u}id values encoded via ACL_{GROUP,USER} entries that should actually be stored in the form of k{g,u}id_t (See [1] for a long explanation of the issue.). In 0c5fd887d2bb ("acl: move idmapped mount fixup into vfs_{g,s}etxattr()") we took the mount's idmapping into account in order to let overlayfs handle POSIX ACLs on idmapped layers correctly. The fixup is currently performed directly in vfs_setxattr() which piles on top of the earlier hackiness by handling the mount's idmapping and stuff the vfs{g,u}id_t values into the uapi struct as well. While that is all correct and works fine it's just ugly. Now that we have introduced vfs_make_posix_acl() earlier move handling idmapped mounts out of vfs_setxattr() and into the POSIX ACL handler where it belongs. Note that we also need to call vfs_make_posix_acl() for EVM which interpretes POSIX ACLs during security_inode_setxattr(). Leave them a longer comment for future reference. All filesystems that support idmapped mounts via FS_ALLOW_IDMAP use the standard POSIX ACL xattr handlers and are covered by this change. This includes overlayfs which simply calls vfs_{g,s}etxattr(). The following filesystems use custom POSIX ACL xattr handlers: 9p, cifs, ecryptfs, and ntfs3 (and overlayfs but we've covered that in the paragraph above) and none of them support idmapped mounts yet. Link: https://lore.kernel.org/all/20220801145520.1532837-1-brauner@kernel.org/ [1] Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) commit fe28c7c120d6c620283eeb6537c38b9902f850d5 Author: Jani Nikula Date: Mon Aug 29 16:18:25 2022 +0300 drm/i915: move and group properties under display.properties Move display property related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/14b14f871e322419b10166c1bd8a5a956f5430c8.1661779055.git.jani.nikula@intel.com commit a71e7d77fb03f61211d035afaf033a01dc443195 Author: Jani Nikula Date: Mon Aug 29 16:18:24 2022 +0300 drm/i915: move atomic_helper under display sub-struct Move display atomic helper related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/1d864238a92a32d52ea70c0079c910cc90955324.1661779055.git.jani.nikula@intel.com commit 6493d4a96fc3d16ae946c886f51b74ddfc58f204 Author: Jani Nikula Date: Mon Aug 29 16:18:23 2022 +0300 drm/i915: move quirks under display sub-struct Move display quirk related members under drm_i915_private display sub-struct. Prefer adding anonymous sub-structs even for single members that aren't our own structs. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/c4a1a5657023efe24a362c67daf79260f179f0eb.1661779055.git.jani.nikula@intel.com commit deb141510f6e55c6d5fe3b5b77fe3df8e57dce61 Author: Jani Nikula Date: Mon Aug 29 16:18:22 2022 +0300 drm/i915/quirks: abstract quirks further by making quirk ids an enum Turn the quirk ids to enums instead of bits, and hide the masking inside intel_quirks.c. Define the enums in intel_quirks.h to declutter i915_drv.h while at it. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/60d8a20e1f8845b0bef53c2e32d524be888e426d.1661779055.git.jani.nikula@intel.com commit 0c82118b0aaa5113e39d875c296a416fa8ac6fc1 Author: Jani Nikula Date: Mon Aug 29 16:18:21 2022 +0300 drm/i915/quirks: abstract checking for display quirks Add intel_has_quirk() for checking if a display quirk is present. Avoid accessing i915->quirks all over the place. v2: Rebase Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/74f954ca81a8068033141a15686dffd01ad9b0f9.1661779055.git.jani.nikula@intel.com commit b202ab6173af66a78c95a6acaca26f74d0c8a464 Author: Jani Nikula Date: Mon Aug 29 16:18:20 2022 +0300 drm/i915: move and group modeset_wq and flip_wq under display.wq Move display workqueue related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/f34f7fb45510e880ce0cc16cb2fbba72fbe94a1d.1661779055.git.jani.nikula@intel.com commit b7d1559038b6c949b5a4eec77db77f3a78edddc9 Author: Jani Nikula Date: Mon Aug 29 16:18:19 2022 +0300 drm/i915: move dbuf under display sub-struct Move display dbuf related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/3363a516c12bd8bfb240131e9eb9fc3a0f3057a3.1661779055.git.jani.nikula@intel.com commit 5da6d6c79297832277b34b38628991cec07bc664 Author: Jani Nikula Date: Mon Aug 29 16:18:18 2022 +0300 drm/i915: move fb_tracking under display sub-struct Move display frontbuffer tracking related members under drm_i915_private display sub-struct. Rename struct i915_frontbuffer_tracking to intel_frontbuffer_tracking while at it. FIXME: fb_tracking.lock mutex init should be moved away from i915_gem_init_early(). Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/a5444d0a373afca46da9a2f6e4db442af21b429b.1661779055.git.jani.nikula@intel.com commit 370d51c84216d1a41f125f0b04614e677ffe54e3 Author: Zhen Lei Date: Thu Aug 25 07:31:54 2022 +0100 ARM: 9232/1: Replace this_cpu_* with raw_cpu_* in handle_bad_stack() The hardware automatically disable the IRQ interrupt before jumping to the interrupt or exception vector. Therefore, the preempt_disable() operation in this_cpu_read() after macro expansion is unnecessary. In fact, function this_cpu_read() may trigger scheduling, see pseudocode below. Pseudocode of this_cpu_read(xx): preempt_disable_notrace(); raw_cpu_read(xx); if (unlikely(__preempt_count_dec_and_test())) __preempt_schedule_notrace(); Therefore, use raw_cpu_* instead of this_cpu_* to eliminate potential hazards. At the very least, it reduces a few lines of assembly code. Signed-off-by: Zhen Lei Signed-off-by: Russell King (Oracle) commit edd61fc1ca4c969c34b877f4aa9fb169138b80e3 Author: Wang Kefeng Date: Tue Aug 16 02:18:01 2022 +0100 ARM: 9228/1: vfp: kill vfp_flush/release_thread() Those functions are removed since 2006 commit d6551e884cf6 ("[ARM] Add thread_notify infrastructure"). Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 3d47ff25685e76c24565779681f652b7ff2b10f0 Author: Ben Wolsieffer Date: Fri Aug 12 22:24:25 2022 +0100 ARM: 9226/1: disable FDPIC ABI When building with an arm-*-uclinuxfdpiceabi toolchain, the FDPIC ABI is enabled by default but should not be used to build the kernel. Therefore, pass -mno-fdpic if supported by the compiler. Signed-off-by: Ben Wolsieffer Signed-off-by: Russell King (Oracle) commit 87c2a29a6bf1a078d82427d42a2480a61814f8e3 Author: Francesco Dolcini Date: Tue Aug 30 16:27:27 2022 +0200 pinctrl: imx8m: kconfig: Depends on SOC_IMX8M Change PINCTRL_IMX8M* dependency from just ARCH_MXC to SOC_IMX8M, likewise is done for other PINCTRL_IMX* kconfig. This avoid polluting the config when SOC_IMX8M is not enabled. Signed-off-by: Francesco Dolcini Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220830142727.313080-1-francesco.dolcini@toradex.com Signed-off-by: Linus Walleij commit 3160b37e5cb695e866e06c3fdbc385846b569294 Author: Basavaraj Natikar Date: Tue Aug 30 16:35:25 2022 +0530 pinctrl: amd: change dev_warn to dev_dbg for additional feature support Use dev_dbg instead of dev_warn for additional support of pinmux feature. Signed-off-by: Basavaraj Natikar Link: https://lore.kernel.org/r/20220830110525.1933198-1-Basavaraj.Natikar@amd.com Signed-off-by: Linus Walleij commit b7365658294304fac75bf33d11824d3a949122a2 Author: Nishanth Menon Date: Tue Aug 30 11:05:07 2022 -0500 dt-bindings: arm: ti: k3: Sort the SoC definitions alphabetically Use alphabetical sort to organize the SoCs Suggested-by: Krzysztof Kozlowski Signed-off-by: Nishanth Menon Signed-off-by: Vignesh Raghavendra Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220830160507.7726-3-nm@ti.com commit 5f120a4dc7a71187fdae0a11f6c65b7e2cf7a2d7 Author: Nishanth Menon Date: Tue Aug 30 11:05:06 2022 -0500 dt-bindings: arm: ti: k3: Sort the am654 board enums Use alphabetical sort to organize the am654 board names. Suggested-by: Krzysztof Kozlowski Signed-off-by: Nishanth Menon Signed-off-by: Vignesh Raghavendra Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220830160507.7726-2-nm@ti.com commit 6edd302a1c8ce82dfca2426a206ab9f37a2edb0e Merge: 39a7d7261ac0a 08aa17a0c1856 Author: David S. Miller Date: Wed Aug 31 14:10:50 2022 +0100 Merge branch 'hns3-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 08aa17a0c18562a08981e5b103105c1798fa2bfd Author: Guangbin Huang Date: Tue Aug 30 19:11:17 2022 +0800 net: hns3: net: hns3: add querying and setting fec off mode from firmware For some new devices, the FEC mode can not be set to OFF in speed 200G. In order to flexibly adapt to all types of devices, driver queries fec ability from firmware to decide whether OFF mode can be supported. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5c4f72842d1df19337b171fd4677239d2e11d047 Author: Hao Lan Date: Tue Aug 30 19:11:16 2022 +0800 net: hns3: add querying and setting fec llrs mode from firmware This patch supports llrs fec mode in speed 200G for some new devices, and suppoprts querying llrs fec ability from firmware. Signed-off-by: Hao Lan Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit eaf83ae59e18a3480afe222daf9537d58165e052 Author: Guangbin Huang Date: Tue Aug 30 19:11:15 2022 +0800 net: hns3: add querying fec ability from firmware For some new devices, driver can queries fec ability from firmware to decide which FEC mode can be supported. If devices of old version which not support querying fec ability, driver sets fixed ability according to current speed. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 507e46ae26ea526118f03ae4ae58e5d48acb79d5 Author: Guangbin Huang Date: Tue Aug 30 19:11:14 2022 +0800 net: hns3: add getting capabilities of gro offload and fd from firmware As some new devices may not support GRO offload and flow table director, to support these devices, driver needs to querying capabilities of GRO offload and flow table director from firmware. Whether the driver supports these two features depends on capabilities. For old device of version HNAE3_DEVICE_VERSION_V2, driver sets their capabilities of these two features to fixed value. Setting default features of netdev and debugfs also need to identify whether support these two features. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 385ba16dbf9edad0b898d160a40e98e379fc05c5 Author: Christophe JAILLET Date: Fri Aug 5 23:46:49 2022 +0200 soc: mediatek: pm-domains: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/e6ba80d8e27fdb2b1527c7eae6687e481960c81d.1659735996.git.christophe.jaillet@wanadoo.fr Signed-off-by: Matthias Brugger commit 39a7d7261ac0acfc4b4554958dfaa829a46540a2 Merge: 215da896df6cc e550ed4b87ad5 Author: David S. Miller Date: Wed Aug 31 14:05:12 2022 +0100 Merge branch 'thunderbolt-end-to-end-flow-control' Mika Westerberg says: ==================== thunderbolt: net: Enable full end-to-end flow control Thunderbolt/USB4 host controllers support full end-to-end flow control that prevents dropping packets if there are not enough hardware receive buffers. So far it has not been enabled for the networking driver yet but this series changes that. There is one snag though: the second generation (Intel Falcon Ridge) had a bug that needs special quirk to get it working. We had that in the early stages of the Thunderbolt/USB4 driver but it got dropped because it was not needed at the time. Now we add it back as a quirk for the host controller (NHI). The first patch of this series is a bugfix that I'm planning to push for v6.0-rc. Rest are v6.1 material. This also includes a patch that shows the XDomain link type in sysfs the same way we do for USB4 routers and updates the networking driver module description. ==================== Signed-off-by: David S. Miller commit e550ed4b87ad54597b97163bd80fb1d7a848a291 Author: Mika Westerberg Date: Tue Aug 30 18:32:50 2022 +0300 net: thunderbolt: Update module description with mention of USB4 It is Thunderbolt/USB4 now so reflect that in the module description too to avoid any confusion. No functional changes. Signed-off-by: Mika Westerberg Signed-off-by: David S. Miller commit 8bdc25cf62c798a696f9acb725bee6e71054893d Author: Mika Westerberg Date: Tue Aug 30 18:32:49 2022 +0300 net: thunderbolt: Enable full end-to-end flow control USB4NET protocol allows the networking drivers to take advantage of end-to-end flow control supported by the USB4 host interface. This should prevent the receiving side from dropping network packets. In adddition add a module parameter that can be used to turn this off just in case it causes problems. Signed-off-by: Mika Westerberg Signed-off-by: David S. Miller commit 54669e2f17cb5a4c41ade89427f074dc22cecb17 Author: Mika Westerberg Date: Tue Aug 30 18:32:48 2022 +0300 thunderbolt: Add back Intel Falcon Ridge end-to-end flow control workaround As we are now enabling full end-to-end flow control to the Thunderbolt networking driver, in order for it to work properly on second generation Thunderbolt hardware (Falcon Ridge), we need to add back the workaround that was removed with commit 53f13319d131 ("thunderbolt: Get rid of E2E workaround"). However, this time we only apply it for Falcon Ridge controllers as a form of an additional quirk. For non-Falcon Ridge this does nothing. While there fix a typo 'reqister' -> 'register' in the comment. Signed-off-by: Mika Westerberg Signed-off-by: David S. Miller commit f9cad07b840ec8a8eb54928908d694b6e262631c Author: Mika Westerberg Date: Tue Aug 30 18:32:47 2022 +0300 thunderbolt: Show link type for XDomain connections too Following what we do for routers already, extend this to XDomain connections as well. This will show in sysfs whether the link is in USB4 or Thunderbolt mode. Signed-off-by: Mika Westerberg Signed-off-by: David S. Miller commit ff7cd07f306406493f7b78890475e85b6d0811ed Author: Mika Westerberg Date: Tue Aug 30 18:32:46 2022 +0300 net: thunderbolt: Enable DMA paths only after rings are enabled If the other host starts sending packets early on it is possible that we are still in the middle of populating the initial Rx ring packets to the ring. This causes the tbnet_poll() to mess over the queue and causes list corruption. This happens specifically when connected with macOS as it seems start sending various IP discovery packets as soon as its side of the paths are configured. To prevent this we move the DMA path enabling to happen after we have primed the Rx ring. This makes sure no incoming packets can arrive before we are ready to handle them. Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable") Cc: stable@vger.kernel.org Signed-off-by: Mika Westerberg Signed-off-by: David S. Miller commit 447d63a2cd89d3a74e1214067f4c564735ea0272 Merge: ce963f84a8120 7a0431bbda8ae Author: Mark Brown Date: Wed Aug 31 13:51:56 2022 +0100 ASoC: codecs: minor cppcheck cleanups Merge series from Pierre-Louis Bossart : Small number of cleanups that were either missed in previous versions or detected by new cppcheck version. commit ce963f84a812044ebac099f9cb60359898662542 Merge: 33b7504ae08a2 1a01e19278022 Author: Mark Brown Date: Wed Aug 31 13:40:16 2022 +0100 ASoC: SOF: compress: Add support for timestamp on capture Merge series from Laurentiu Mihalcea : The purpose of this patch series is to add support for timestamping on capture direction using the compress API. This is simply done by splitting sof_compr_copy into 2 functions: sof_compr_copy_playback and sof_compr_copy_capture. Each of these functions handles one of the possible directions: capture or playback and is called in sof_compr_copy based on the stream's direction. The only difference between sof_compr_copy_playback and sof_compr_copy_capture is the fact that on playback case we need to copy data from user space and on capture we need to copy data to user space. commit f799206943434ac0484d997d17b9be5bcbf594ab Author: Conor Dooley Date: Thu Aug 25 15:35:23 2022 +0100 dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes. The SD card and eMMC on PolarFire SoC are sometimes muxed using a GPIO by the bootloader. Add a hog child property to facilitate this. Signed-off-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit b98dbd82ee319d74103510f953a1ca2cd9202614 Author: Jeffy Chen Date: Wed Aug 24 09:06:05 2022 +0800 gpio/rockchip: Convert to generic_handle_domain_irq() Follow commit dbd1c54fc820 ("gpio: Bulk conversion to generic_handle_domain_irq()"). Signed-off-by: Jeffy Chen Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 20478b88071349ad3d7340dd1e3e714fb1e9b98a Author: Jani Nikula Date: Mon Aug 29 16:18:17 2022 +0300 drm/i915: move and group fdi members under display.fdi Move display fdi related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/b66fe7cf2c6f9e5b7bbfcaff40400492ac706721.1661779055.git.jani.nikula@intel.com commit e3e8148f43fb6d4347211ea2160e7de9b8ddde81 Author: Jani Nikula Date: Mon Aug 29 16:18:16 2022 +0300 drm/i915: move and group power related members under display.power Move display power related members under drm_i915_private display sub-struct. Arguably chv_phy_control and chv_phy_assert could be placed in a phy substruct, but they are only used in the power code. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/57bfa82f6fe85a775f80c398b2a7dff77b9452b0.1661779055.git.jani.nikula@intel.com commit 80b3842f21f8af1bac5750105f557b29af854291 Author: Jani Nikula Date: Mon Aug 29 16:18:15 2022 +0300 drm/i915: move fbc to display.fbc Move display FBC related members under drm_i915_private display sub-struct. Pointers and arrays of pointers to structs that we defined are fine without a sub-struct wrapping. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/1151469ec13d392df86b72a375f490fd70a3257a.1661779055.git.jani.nikula@intel.com commit a434689c0adbf8986024e82767fd26b0e142dba6 Author: Jani Nikula Date: Mon Aug 29 16:18:14 2022 +0300 drm/i915: move vbt to display.vbt Move display VBT related members under drm_i915_private display sub-struct. v2: Rebase Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/db4b648b201ea0b79654fec2028120999a735db0.1661779055.git.jani.nikula@intel.com commit 90b87cf2430490d9aa0ba0c2a14b4db8da0c4942 Author: Jani Nikula Date: Mon Aug 29 16:18:13 2022 +0300 drm/i915: move mipi_mmio_base to display.dsi Move display DSI related members under drm_i915_private display sub-struct. Prefer adding anonymous sub-structs even for single members that aren't our own structs. Abstract mmio base member access in register definitions in a macro. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/dc7c5a871fe558a809ea943eca5c71dfff1740a8.1661779055.git.jani.nikula@intel.com commit 43cf168fa99992ee70ff041a61f866f56aa47f3b Author: Fernanda Ma'rouf Date: Wed Jul 20 05:37:45 2022 +0200 selftests/nolibc: Avoid generated files being committed After running the nolibc tests, the "git status" is not clean because the generated files are not ignored. Create a `.gitignore` inside the selftests/nolibc directory to ignore them. Cc: Ammar Faizi Cc: Fernanda Ma'rouf Signed-off-by: Fernanda Ma'rouf Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ffc297fe2259a701f2bd52a6fb8481abc89d331d Author: Willy Tarreau Date: Tue Jul 19 23:44:49 2022 +0200 selftests/nolibc: add a "help" target It presents the supported targets, and becomes the default target to save the user from having to read the makefile. The "all" target was placed after it and now points to "run" to do everything since it's no longer the default one. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit b25c5284db0a481a427c9838f32662587d947d27 Author: Willy Tarreau Date: Tue Jul 19 23:44:48 2022 +0200 selftests/nolibc: "sysroot" target installs a local copy of the sysroot It's not convenient to rely on a sysroot built in another directory, especially when running cross-compilation tests, where one has to switch back and forth between directories. Let's make it possible to install the sysroot directly in the test directory. It's not big and even benefits from being copied by arch so that it's easier to switch between archs if needed. The new "sysroot" target does this, it just calls "headers_standalone" from nolibc to install the sysroot right here. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 662ea60e373be8a6b8a925b237cdb93a2af353c1 Author: Willy Tarreau Date: Tue Jul 19 23:44:47 2022 +0200 selftests/nolibc: add a "run" target to start the kernel in QEMU The "run" target will build the kernel and start it in QEMU. The "rerun" target will not have the kernel dependency and will just try to start QEMU. The QEMU architecture used to start the kernel is derived from the configured ARCH. This might need to be improved for archs which include different variants under the same name (mips vs mipsel, +/-64, riscv32 vs riscv64). This could be tested for i386, x86, arm, arm64, mips and riscv (the later two reporting issues on some tests). It is possible to pass a test specification for nolibc-test in the TEST variable, which will be passed as-is as NOLIBC_TEST. On success, the number of successful tests is printed. On failure, failed lines are individually printed. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 5c43fd7954108bd138f7a1b4db4fb997ae1dc696 Author: Willy Tarreau Date: Tue Jul 19 23:44:46 2022 +0200 selftests/nolibc: add a "defconfig" target While most archs will work fine with "make defconfig", not all will do, and it's not always easy to remember the most suitable choice to use for a specific architecture. This adds a "defconfig" target to the Makefile so that one may easily run "make -C ... defconfig" and make sure to clean and rebuild a fresh config. This is *not* used by default because we want to preserve the user's config by default. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit d248cabff5da2f3f2ce0ab99c1f96a15e8fb98c6 Author: Willy Tarreau Date: Tue Jul 19 23:44:45 2022 +0200 selftests/nolibc: add a "kernel" target to build the kernel with the initramfs The "kernel" target rebuilds the kernel with the current config for the selected arch, with an initramfs containing the nolibc-test utility. Since image names depend on the architecture, the currently supported ones are referenced and resolved based on the architecture. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 1da02f510882cd5684dc04dc7119056e01da90bd Author: Willy Tarreau Date: Tue Jul 19 23:44:44 2022 +0200 selftests/nolibc: support glibc as well Adding support for glibc can be useful to distinguish between bugs in nolibc and bugs in the kernel when a syscall reports an unusual value. It's not that much work and should not affect the long term maintainability of the tests. The necessary changes can essentially be summed up like this: - set _GNU_SOURCE a the top to access some definitions - many includes added when we know we don't come from nolibc (missing the stdio include guard) - disable gettid() which is not exposed by glibc - disable gettimeofday's support of bad pointers since these crash in glibc - add a simple itoa() for errorname(); strerror() is too verbose (no way to get short messages). strerrorname_np() was added in modern glibc (2.32) to do exactly this but that 's too recent to be usable as the default fallback. - use the standard ioperm() definition. May be we need to implement ioperm() in nolibc if that's useful. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7172f1c6854cb424e3be3401e3df34c1c38cffc2 Author: Willy Tarreau Date: Tue Jul 19 23:44:43 2022 +0200 selftests/nolibc: condition some tests on /proc existence If /proc is not available (program run inside a chroot or without sufficient permissions), it's better to disable the associated tests. Some will be preserved like the ones which check for a failure to create some entries there since they're still supposed to fail. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 1a5454f625997049d886d8c3dae8e8de2a553125 Author: Willy Tarreau Date: Tue Jul 19 23:44:42 2022 +0200 selftests/nolibc: recreate and populate /dev and /proc if missing Most of the time the program will be run alone in an initramfs. There is no value in requiring the user to populate /dev and /proc for such tests, we can do it ourselves, and it participates to the tests at the same time. What's done here is that when called as init (getpid()==1) we check if /dev exists or create it, if /dev/console and /dev/null exists, otherwise we try to mount a devtmpfs there, and if it fails we fall back to mknod. The console is reopened if stdout was closed. Finally /proc is created and mounted if /proc/self cannot be found. This is sufficient for most tests. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit aa73a86cda26705c7f0af1afe9bb255a52accf87 Author: Willy Tarreau Date: Tue Jul 19 23:44:41 2022 +0200 selftests/nolibc: on x86, support exiting with isa-debug-exit QEMU, when started with "-device isa-debug-exit -no-reboot" will exit with status code 2N+1 when N is written to 0x501. This is particularly convenient for automated tests but this is not portable. As such we only enable this on x86_64 when pid==1. In addition, this requires an ioperm() call but in order not to have to define arch-specific syscalls we just perform the syscall by hand there. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit f49896d7d9a69b7565a59f5085c78ca1c08c7dd7 Author: Willy Tarreau Date: Tue Jul 19 23:44:40 2022 +0200 selftests/nolibc: exit with poweroff on success when getpid() == 1 The idea is to ease automated testing under qemu. If the test succeeds while running as PID 1, indicating the system was booted with init=/test, let's just power off so that qemu can exit with a successful code. In other situations it will exit and provoke a panic, which may be caught for example with CONFIG_PVPANIC. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 95bc989488eb7150949cf2fcce3f486741d1c57f Author: Willy Tarreau Date: Tue Jul 19 23:44:38 2022 +0200 selftests/nolibc: add a few tests for some libc functions The test series called "stdlib" covers some libc functions (string, stdlib etc). By default they are automatically run after "syscall" but may be requested in argument or in variable NOLIBC_TEST. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit b4844fa0bdb4075ad842e89d6c41e3d0c6124848 Author: Willy Tarreau Date: Tue Jul 19 23:44:37 2022 +0200 selftests/nolibc: implement a few tests for various syscalls This adds 63 tests covering about 34 syscalls. Both successes and failures are tested. Two tests fail when run as unprivileged user (link_dir which returns EACCESS instead of EPERM, and chroot which returns EPERM). One test (execve("/")) expects to fail on EACCESS, but needs to have valid arguments otherwise the kernel will log a message. And a few tests require /proc to be mounted. The code is not pretty since all tests are one-liners, sometimes resulting in long lines, especially when using compount statements to preset a line, but it's convenient and doesn't obfuscate the code, which is important to understand what failed. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 23da7bc923609bc90b6989c6c6a17e74c8f433ed Author: Willy Tarreau Date: Tue Jul 19 23:44:36 2022 +0200 selftests/nolibc: support a test definition format It now becomes possible to pass a string either in argv[1] or in the NOLIBC_TEST environment variable (the former having precedence), to specify which tests to run. The format is: testname[:range]*[,testname...] Where a range is either a single value or the min and max numbers of the test IDs in a sequence, delimited by a dash. Multiple ranges are possible. This should provide enough flexibility to focus on certain failing parts just by playing with the boot command line in a boot loader or in qemu depending on what is accessible. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 362aecb2d8cfad0268d6c0ae5f448e9b6eee7ffb Author: Willy Tarreau Date: Tue Jul 19 23:44:35 2022 +0200 selftests/nolibc: add basic infrastructure to ease creation of nolibc tests This creates a "nolibc" selftest that intends to test various parts of the nolibc component, both in terms of build and execution for a given architecture. The aim is for it to be as simple to run as a kernel build, by just passing the compiler (for the build) and the ARCH (for kernel and execution). It brings a basic squeleton made of a single C file that will ease testing and error reporting. The code will be arranged so that it remains easy to add basic tests for syscalls or library calls that may rely on a condition to be executed, and whose result is compared to a value or to an error with a specific errno value. Tests will just use a relative line number in switch/case statements as an index, saving the user from having to maintain arrays and complicated functions which can often just be one-liners. MAINTAINERS was updated. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 364702f7551451f2fab341f1b31adf911c888375 Author: Willy Tarreau Date: Tue Jul 19 23:44:34 2022 +0200 tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition __NR_mmap2 was used for i386 but it's also needed for other archs such as RISCV32 or ARM. Let's decide to use it based on the __NR_mmap2 definition as it's not defined on other archs. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 8b53e83b08cfdc3f430b5415cd1031d5e7e1f935 Author: Willy Tarreau Date: Tue Jul 19 23:44:33 2022 +0200 tools/nolibc: fix build warning in sys_mmap() when my_syscall6 is not defined We return -ENOSYS when there's no syscall6() operation, but we must cast it to void* to avoid a warning. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit a30d551f34df66d739949a6140b50496afa36f66 Author: Willy Tarreau Date: Tue Jul 19 23:44:32 2022 +0200 tools/nolibc: make argc 32-bit in riscv startup code The "ld a0, 0(sp)" instruction doesn't build on RISCV32 because that would load a 64-bit value into a 32-bit register. But argc 32-bit, not 64, so we ought to use "lw" here. Tested on both RISCV32 and RISCV64. Cc: Pranith Kumar Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit be94ecf7608cc11ff46442012e710bb8fb139b99 Author: Paul Heidekrüger Date: Tue Jun 14 15:48:11 2022 +0000 tools/memory-model: Clarify LKMM's limitations in litmus-tests.txt As discussed, clarify LKMM not recognizing certain kinds of orderings. In particular, highlight the fact that LKMM might deliberately make weaker guarantees than compilers and architectures. [ paulmck: Fix whitespace issue noted by checkpatch.pl. ] Link: https://lore.kernel.org/all/YpoW1deb%2FQeeszO1@ethstick13.dse.in.tum.de/T/#u Co-developed-by: Alan Stern Signed-off-by: Alan Stern Signed-off-by: Paul Heidekrüger Reviewed-by: Marco Elver Reviewed-by: Joel Fernandes (Google) Cc: Charalampos Mainas Cc: Pramod Bhatotia Cc: Soham Chakraborty Cc: Martin Fink Signed-off-by: Paul E. McKenney commit f556082dd7fc5a97326e44aae66199cc639a671c Author: Akira Yokosawa Date: Mon Jun 20 17:19:35 2022 +0900 docs/memory-barriers.txt: Fixup long lines Substitution of "data dependency barrier" with "address-dependency barrier" left quite a lot of lines exceeding 80 columns. Reflow those lines as well as a few short ones not related to the substitution. No changes in documentation text. Signed-off-by: Akira Yokosawa Cc: "Paul E. McKenney" Cc: Alan Stern Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Andrea Parri Cc: Nicholas Piggin Cc: David Howells Cc: Daniel Lustig Cc: Joel Fernandes Cc: "Michael S. Tsirkin" Cc: Jonathan Corbet Signed-off-by: Paul E. McKenney commit 203185f6b1e393cf2f4b84023d4d01d515fcfd5f Author: Akira Yokosawa Date: Mon Jun 20 17:17:49 2022 +0900 docs/memory-barriers.txt: Fix confusing name of 'data dependency barrier' The term "data dependency barrier", which has been in memory-barriers.txt ever since it was first authored by David Howells, has become confusing due to the fact that in LKMM's explanations.txt and elsewhere, "data dependency" is used mostly for load-to-store data dependency. To prevent further confusions, do the changes listed below: - substitute "data dependency barrier" with "address-dependency barrier"; - add note on the removal of kernel APIs for explicit address- dependency barriers in kernel release v5.9; - note that address-dependency barriers are not necessary for load-to-store situations; - use READ_ONCE_OLD() for pre-4.15 READ_ONCE() (no implicit address- dependency barrier); - fix count of kernel memory barrier APIs; - and a few more context adjustments. Note: Cleanups of long lines are deferred to a followup patch. Reported-by: "Michael S. Tsirkin" Link: https://lore.kernel.org/r/20211011064233-mutt-send-email-mst@kernel.org/ Signed-off-by: Akira Yokosawa Cc: "Paul E. McKenney" Cc: Alan Stern Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Andrea Parri Cc: Nicholas Piggin Cc: David Howells Cc: Daniel Lustig Cc: Joel Fernandes Cc: Jonathan Corbet Signed-off-by: Paul E. McKenney commit cf517fef601b9dde151f0afc27164d13bf1fd907 Author: Billy Tsai Date: Thu Aug 18 18:18:39 2022 +0800 pinctrl: aspeed: Force to disable the function's signal When the driver want to disable the signal of the function, it doesn't need to query the state of the mux function's signal on a pin. The condition below will miss the disable of the signal: Ball | Default | P0 Signal | P0 Expression | Other -----+---------+-----------+-----------------------------+---------- E21 GPIOG0 SD2CLK SCU4B4[16]=1 & SCU450[1]=1 GPIOG0 -----+---------+-----------+-----------------------------+---------- B22 GPIOG1 SD2CMD SCU4B4[17]=1 & SCU450[1]=1 GPIOG1 -----+---------+-----------+-----------------------------+---------- Assume the register status like below: SCU4B4[16] == 1 & SCU4B4[17] == 1 & SCU450[1]==1 After the driver set the Ball E21 to the GPIOG0: SCU4B4[16] == 0 & SCU4B4[17] == 1 & SCU450[1]==0 When the driver want to set the Ball B22 to the GPIOG1, the condition of the SD2CMD will be false causing SCU4B4[17] not to be cleared. Signed-off-by: Billy Tsai Acked-by: Andrew Jeffery Link: https://lore.kernel.org/r/20220818101839.28860-1-billy_tsai@aspeedtech.com Signed-off-by: Linus Walleij commit 528262f50274079740b53e29bcaaabf219aa7417 Author: Zqiang Date: Tue Jul 19 12:39:00 2022 +0800 rcu-tasks: Make RCU Tasks Trace check for userspace execution Userspace execution is a valid quiescent state for RCU Tasks Trace, but the scheduling-clock interrupt does not currently report such quiescent states. Of course, the scheduling-clock interrupt is not strictly speaking userspace execution. However, the only way that this code is not in a quiescent state is if something invoked rcu_read_lock_trace(), and that would be reflected in the ->trc_reader_nesting field in the task_struct structure. Furthermore, this field is checked by rcu_tasks_trace_qs(), which is invoked by rcu_tasks_qs() which is in turn invoked by rcu_note_voluntary_context_switch() in kernels building at least one of the RCU Tasks flavors. It is therefore safe to invoke rcu_tasks_trace_qs() from the rcu_sched_clock_irq(). But rcu_tasks_qs() also invokes rcu_tasks_classic_qs() for RCU Tasks, which lacks the read-side markers provided by RCU Tasks Trace. This raises the possibility that an RCU Tasks grace period could start after the interrupt from userspace execution, but before the call to rcu_sched_clock_irq(). However, it turns out that this is safe because the RCU Tasks grace period waits for an RCU grace period, which will wait for the entire scheduling-clock interrupt handler, including any RCU Tasks read-side critical section that this handler might contain. This commit therefore updates the rcu_sched_clock_irq() function's check for usermode execution and its call to rcu_tasks_classic_qs() to instead check for both usermode execution and interrupt from idle, and to instead call rcu_note_voluntary_context_switch(). This consolidates code and provides more faster RCU Tasks Trace reporting of quiescent states in kernels that do scheduling-clock interrupts for userspace execution. [ paulmck: Consolidate checks into rcu_sched_clock_irq(). ] Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit d6ad60635cafe900bcd11ad588d8accb36c36b1b Author: Paul E. McKenney Date: Mon Jul 18 10:57:26 2022 -0700 rcu-tasks: Ensure RCU Tasks Trace loops have quiescent states The RCU Tasks Trace grace-period kthread loops across all CPUs, and there can be quite a few CPUs, with some commercially available systems sporting well over a thousand of them. Some of these loops can feature IPIs, which can take some time. This commit therefore places a call to cond_resched_tasks_rcu_qs() in each such loop. Link: https://docs.google.com/document/d/1V0YnG1HTWMt9WHJjroiJL9lf-hMrud4v8Fn3fhyY0cI/edit?usp=sharing Signed-off-by: Paul E. McKenney commit fcd53c8a4dfa38bafb89efdd0b0f718f3a03f884 Author: Zqiang Date: Tue Jul 12 16:26:05 2022 +0800 rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() Kernels built with CONFIG_PROVE_RCU=y and CONFIG_DEBUG_LOCK_ALLOC=y attempt to emit a warning when the synchronize_rcu_tasks_generic() function is called during early boot while the rcu_scheduler_active variable is RCU_SCHEDULER_INACTIVE. However the warnings is not actually be printed because the debug_lockdep_rcu_enabled() returns false, exactly because the rcu_scheduler_active variable is still equal to RCU_SCHEDULER_INACTIVE. This commit therefore replaces RCU_LOCKDEP_WARN() with WARN_ONCE() to force these warnings to actually be printed. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 5fe89191e43fb37e874b8e5177fb2a5c72379b06 Author: Paul E. McKenney Date: Tue Aug 2 15:32:47 2022 -0700 srcu: Make Tiny SRCU use full-sized grace-period counters This commit makes Tiny SRCU use full-sized grace-period counters to further avoid counter-wrap issues when using polled grace-period APIs. Signed-off-by: Paul E. McKenney commit de3f2671ae563d24c679dcca36c9e0ebd9564ebd Author: Paul E. McKenney Date: Tue Aug 2 11:59:49 2022 -0700 srcu: Make Tiny SRCU poll_state_synchronize_srcu() more precise This commit applies the more-precise grace-period-state check used by rcu_seq_done_exact() to poll_state_synchronize_srcu(). This is important because Tiny SRCU uses a 16-bit counter, which can wrap quite quickly. If counter wrap continues to be a problem, then expanding ->srcu_idx and ->srcu_idx_max to 32 bits might be warranted. Signed-off-by: Paul E. McKenney commit d66e4cf974a53c1195f1f5a96387ee5dbad2bdf2 Author: Paul E. McKenney Date: Tue Aug 2 10:18:23 2022 -0700 srcu: Add GP and maximum requested GP to Tiny SRCU rcutorture output This commit adds the ->srcu_idx and ->srcu_max_idx fields to the Tiny SRCU rcutorture output for additional diagnostics. Signed-off-by: Paul E. McKenney commit 599d97e3f2236a0f02a59da05798e8af43d5ce72 Author: Paul E. McKenney Date: Wed Jul 27 16:16:41 2022 -0700 rcutorture: Make "srcud" option also test polled grace-period API This commit brings the "srcud" (dynamically allocated) SRCU test in line with the "srcu" (statically allocated) test, so that both test the full SRCU polled grace-period API. Signed-off-by: Paul E. McKenney commit 967c298d650e2a8562fb4ea488af36bdf2a71ac4 Author: Paul E. McKenney Date: Wed Aug 24 18:57:45 2022 -0700 rcutorture: Limit read-side polling-API testing RCU's polled grace-period API is reasonably lightweight, but still contains heavyweight memory barriers. This commit therefore limits testing of this API from rcutorture's readers in order to avoid the false negatives that these heavyweight operations could provoke. Signed-off-by: Paul E. McKenney commit 18538248e5486b0f0e8581083de275176674cd1f Author: Paul E. McKenney Date: Wed Aug 24 15:39:09 2022 -0700 rcu: Add functions to compare grace-period state values This commit adds same_state_synchronize_rcu() and same_state_synchronize_rcu_full() functions to compare grace-period state values, for example, those obtained from get_state_synchronize_rcu() and get_state_synchronize_rcu_full(). These functions allow small structures to omit these state values by placing them in list headers for lists containing structures with the same token value. Presumably the per-structure list pointers are the same ones used to link the structures into whatever reader-accessible data structure was used. This commit also adds both NUM_ACTIVE_RCU_POLL_OLDSTATE and NUM_ACTIVE_RCU_POLL_FULL_OLDSTATE, which define the maximum number of distinct unsigned long values and rcu_gp_oldstate values, respectively, corresponding to not-yet-completed grace periods. These values can be used to size arrays of the list headers described above. Signed-off-by: Paul E. McKenney commit 5d7801f20170a50252b791c2ce05fb982616665b Author: Paul E. McKenney Date: Tue Aug 23 12:11:12 2022 -0700 rcutorture: Expand rcu_torture_write_types() first "if" statement This commit expands the rcu_torture_write_types() function's first "if" condition and body, placing one element per line, in order to make the compiler's error messages more helpful. Signed-off-by: Paul E. McKenney commit cc8faf5b65997a994c77a0122b94240b82c95f23 Author: Paul E. McKenney Date: Mon Aug 22 10:02:56 2022 -0700 rcutorture: Use 1-suffixed variable in rcu_torture_write_types() check This commit changes the use of gp_poll_exp to gp_poll_exp1 in the first check in rcu_torture_write_types(). No functional effect, but consistency is a good thing. Signed-off-by: Paul E. McKenney commit d761de8a7dcef8e8e9e20a543f85a2c079ae3d0d Author: Paul E. McKenney Date: Fri Aug 5 15:42:25 2022 -0700 rcu: Make synchronize_rcu() fastpath update only boot-CPU counters Large systems can have hundreds of rcu_node structures, and updating counters in each of them might slow down booting. This commit therefore updates only the counters in those rcu_node structures corresponding to the boot CPU, up to and including the root rcu_node structure. The counters for the remaining rcu_node structures are updated by the rcu_scheduler_starting() function, which executes just before the first non-boot kthread is spawned. Signed-off-by: Paul E. McKenney commit b3cdd0a79c875d5e9cac9f6555485031ce5bea81 Author: Paul E. McKenney Date: Thu Aug 4 18:05:46 2022 -0700 rcutorture: Adjust rcu_poll_need_2gp() for rcu_gp_oldstate field removal Now that rcu_gp_oldstate can accurately track both normal and expedited grace periods regardless of system state, rcutorture's rcu_poll_need_2gp() function need only call for a second grace period for the old single-unsigned-long grace-period polling APIs This commit therefore adjusts rcu_poll_need_2gp() accordingly. Signed-off-by: Paul E. McKenney commit 7ecef0871dd9a879038dbe8a681ab48bd0c92988 Author: Paul E. McKenney Date: Thu Aug 4 17:54:53 2022 -0700 rcu: Remove ->rgos_polled field from rcu_gp_oldstate structure Because both normal and expedited grace periods increment their respective counters on their pre-scheduler early boot fastpaths, the rcu_gp_oldstate structure no longer needs its ->rgos_polled field. This commit therefore removes this field, shrinking this structure so that it is the same size as an rcu_head structure. Signed-off-by: Paul E. McKenney commit 43ff97cc997f5641127152f97e1fd0fc9fa060f6 Author: Paul E. McKenney Date: Thu Aug 4 17:43:53 2022 -0700 rcu: Make synchronize_rcu_expedited() fast path update .expedited_sequence This commit causes the early boot single-CPU synchronize_rcu_expedited() fastpath to update the rcu_state structure's ->expedited_sequence counter. This will allow the full-state polled grace-period APIs to detect all expedited grace periods without the need to track the special combined polling-only counter, which is another step towards removing the ->rgos_polled field from the rcu_gp_oldstate, thereby reducing its size by one third. Signed-off-by: Paul E. McKenney commit e8755d2bde7c296026fe5d47f1b75c7b19ba46fd Author: Paul E. McKenney Date: Thu Aug 4 17:34:30 2022 -0700 rcu: Remove expedited grace-period fast-path forward-progress helper Now that the expedited grace-period fast path can only happen during the pre-scheduler portion of early boot, this fast path can no longer block run-time RCU Trace grace periods. This commit therefore removes the conditional cond_resched() invocation. Signed-off-by: Paul E. McKenney commit 910e12092eac8a9f19b507ed0fdc1c21d8da9483 Author: Paul E. McKenney Date: Thu Aug 4 17:28:01 2022 -0700 rcu: Make synchronize_rcu() fast path update ->gp_seq counters This commit causes the early boot single-CPU synchronize_rcu() fastpath to update the rcu_state and rcu_node structures' ->gp_seq and ->gp_seq_needed counters. This will allow the full-state polled grace-period APIs to detect all normal grace periods without the need to track the special combined polling-only counter, which is a step towards removing the ->rgos_polled field from the rcu_gp_oldstate, thereby reducing its size by one third. Signed-off-by: Paul E. McKenney commit 5f11bad6b7228858e06729de6dd4079dfc082648 Author: Paul E. McKenney Date: Thu Aug 4 17:16:24 2022 -0700 rcu-tasks: Remove grace-period fast-path rcu-tasks helper Now that the grace-period fast path can only happen during the pre-scheduler portion of early boot, this fast path can no longer block run-time RCU Tasks and RCU Tasks Trace grace periods. This commit therefore removes the conditional cond_resched_tasks_rcu_qs() invocation. Signed-off-by: Paul E. McKenney commit a5d1b0b68a62afb1bce0b36cc9a1875acf8a6dff Author: Paul E. McKenney Date: Thu Aug 4 17:01:55 2022 -0700 rcu: Set rcu_data structures' initial ->gpwrap value to true It would be good do reduce the size of the rcu_gp_oldstate structure from three unsigned long instances to two, but this requires that the boot-time optimized grace periods update the various ->gp_seq fields. Updating these fields in the rcu_state structure and in all of the rcu_node structures is at least semi-reasonable, but updating them in all of the rcu_data structures is a bridge too far. This means that if there are too many early boot-time grace periods, the ->gp_seq field in the rcu_data structure cannot be trusted. This commit therefore sets each rcu_data structure's ->gpwrap field to provide the necessary impetus for a suitable level of distrust. Signed-off-by: Paul E. McKenney commit 258f887aba60c8fc7946a9f379f9a3889f92fc85 Author: Paul E. McKenney Date: Thu Aug 4 16:07:04 2022 -0700 rcu: Disable run-time single-CPU grace-period optimization The run-time single-CPU grace-period optimization applies only to kernels built with CONFIG_SMP=y && CONFIG_PREEMPTION=y that are running on a single-CPU system. But a kernel intended for a single-CPU system should instead be built with CONFIG_SMP=n, and in any case, single-CPU systems running Linux no longer appear to be the common case. Plus this optimization results in the rcu_gp_oldstate structure being half again larger than it needs to be. This commit therefore disables the run-time single-CPU grace-period optimization, so that this optimization applies only during the pre-scheduler portion of the boot sequence. Signed-off-by: Paul E. McKenney commit 8df13f01608ea48712956c0b1afce35bdba5a1c5 Author: Paul E. McKenney Date: Thu Aug 4 15:23:26 2022 -0700 rcu: Add full-sized polling for cond_sync_exp_full() The cond_synchronize_rcu_expedited() API compresses the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds yet another member of the full-state RCU grace-period polling API, which is the cond_synchronize_rcu_exp_full() function. This uses up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but is guaranteed not to miss grace periods. Signed-off-by: Paul E. McKenney commit b6fe4917ae4353b397079902cb024ae01f20dfb2 Author: Paul E. McKenney Date: Thu Aug 4 13:46:05 2022 -0700 rcu: Add full-sized polling for cond_sync_full() The cond_synchronize_rcu() API compresses the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds yet another member of the full-state RCU grace-period polling API, which is the cond_synchronize_rcu_full() function. This uses up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but is guaranteed not to miss grace periods. [ paulmck: Apply feedback from kernel test robot and Julia Lawall. ] Signed-off-by: Paul E. McKenney commit f21e014345e0abf11fdc2e59fb6eb6d6aa6ae4eb Author: Paul E. McKenney Date: Wed Aug 3 16:57:47 2022 -0700 rcu: Remove blank line from poll_state_synchronize_rcu() docbook header This commit removes the blank line preceding the oldstate parameter to the docbook header for the poll_state_synchronize_rcu() function and marks uses of this parameter later in that header. Signed-off-by: Paul E. McKenney commit 6c502b14ba66da0670a59e20354469fa56eab26c Author: Paul E. McKenney Date: Wed Aug 3 12:38:51 2022 -0700 rcu: Add full-sized polling for start_poll_expedited() The start_poll_synchronize_rcu_expedited() API compresses the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds yet another member of the full-state RCU grace-period polling API, which is the start_poll_synchronize_rcu_expedited_full() function. This uses up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but is guaranteed not to miss grace periods. [ paulmck: Apply feedback from kernel test robot and Julia Lawall. ] Signed-off-by: Paul E. McKenney commit 76ea364161e72b1878126edf8d507d2a62fb47b0 Author: Paul E. McKenney Date: Tue Aug 2 17:04:54 2022 -0700 rcu: Add full-sized polling for start_poll() The start_poll_synchronize_rcu() API compresses the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds the next member of the full-state RCU grace-period polling API, namely the start_poll_synchronize_rcu_full() function. This uses up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but is guaranteed not to miss grace periods. Signed-off-by: Paul E. McKenney commit f4754ad2922e5a2b08c8aecf33d1ec03d7219fb4 Author: Paul E. McKenney Date: Wed Aug 3 16:40:48 2022 -0700 rcutorture: Verify long-running reader prevents full polling from completing This commit adds full-state polling checks to accompany the old-style polling checks in the rcu_torture_one_read() function. If a polling cycle within an RCU reader completes, a WARN_ONCE() is triggered. Signed-off-by: Paul E. McKenney commit 37d6ade31cf83305495a2875ab5d283e17322032 Author: Paul E. McKenney Date: Tue Aug 2 10:22:12 2022 -0700 rcutorture: Remove redundant RTWS_DEF_FREE check This check does nothing because the state at this point in the code because the rcu_torture_writer_state value is guaranteed to instead be RTWS_REPLACE. This commit therefore removes this check. Signed-off-by: Paul E. McKenney commit d594231aa50a0f113cfb4749da5162e6a0c3fa73 Author: Paul E. McKenney Date: Mon Aug 1 17:33:24 2022 -0700 rcutorture: Verify RCU reader prevents full polling from completing This commit adds a test to rcu_torture_writer() that verifies that a ->get_gp_state_full() and ->poll_gp_state_full() polled grace-period sequence does not claim that a grace period elapsed within the confines of the corresponding read-side critical section. Signed-off-by: Paul E. McKenney commit ed7d2f1abee48a90fae5fdf5c60d71803a5a1d10 Author: Paul E. McKenney Date: Mon Aug 1 16:57:17 2022 -0700 rcutorture: Allow per-RCU-flavor polled double-GP check Only vanilla RCU needs a double grace period for its compressed polled grace-period old-state cookie. This commit therefore adds an rcu_torture_ops per-flavor function ->poll_need_2gp to allow this check to be adapted to the RCU flavor under test. A NULL pointer for this function says that doubled grace periods are never needed. Signed-off-by: Paul E. McKenney commit ccb42229fb34bc3e93f7aa081da3e78eac68cd27 Author: Paul E. McKenney Date: Fri Jul 29 22:05:17 2022 -0700 rcutorture: Abstract synchronous and polled API testing This commit abstracts a do_rtws_sync() function that does synchronous grace-period testing, but also testing the polled API 25% of the time each for the normal and full-state variants of the polled API. Signed-off-by: Paul E. McKenney commit 3fdefca9b42c8bebe3beea5c1a067c9718ca0fc7 Author: Paul E. McKenney Date: Thu Jul 28 19:58:13 2022 -0700 rcu: Add full-sized polling for get_state() The get_state_synchronize_rcu() API compresses the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds the next member of the full-state RCU grace-period polling API, namely the get_state_synchronize_rcu_full() function. This uses up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but is guaranteed not to miss grace periods. Signed-off-by: Paul E. McKenney commit 91a967fd6934abc0c7e4b0d26728e38674278707 Author: Paul E. McKenney Date: Thu Jul 28 15:37:05 2022 -0700 rcu: Add full-sized polling for get_completed*() and poll_state*() The get_completed_synchronize_rcu() and poll_state_synchronize_rcu() APIs compress the combined expedited and normal grace-period states into a single unsigned long, which conserves storage, but can miss grace periods in certain cases involving overlapping normal and expedited grace periods. Missing the occasional grace period is usually not a problem, but there are use cases that care about each and every grace period. This commit therefore adds the first members of the full-state RCU grace-period polling API, namely the get_completed_synchronize_rcu_full() and poll_state_synchronize_rcu_full() functions. These use up to three times the storage (rcu_gp_oldstate structure instead of unsigned long), but which are guaranteed not to miss grace periods, at least in situations where the single-CPU grace-period optimization does not apply. Signed-off-by: Paul E. McKenney commit 638dce227a41534bbc4fdd73280e73e0b3570048 Author: Paul E. McKenney Date: Tue Aug 2 17:39:28 2022 -0700 rcu/nocb: Add CPU number to CPU-{,de}offload failure messages Offline CPUs cannot be offloaded or deoffloaded. Any attempt to offload or deoffload an offline CPU causes a message to be printed on the console, which is good, but this message does not contain the CPU number, which is bad. Such a CPU number can be helpful when debugging, as it gives a clear indication that the CPU in question is in fact offline. This commit therefore adds the CPU number to the CPU-{,de}offload failure messages. Cc: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 5334da2af25eceb6a88ae162e69d6586b5cb9abc Author: Zqiang Date: Fri Jun 17 22:15:19 2022 +0800 rcu/nocb: Choose the right rcuog/rcuop kthreads to output The show_rcu_nocb_gp_state() function is supposed to dump out the rcuog kthread and the show_rcu_nocb_state() function is supposed to dump out the rcuo[ps] kthread. Currently, both do a mixture, which is not optimal for debugging, even though it does not affect functionality. This commit therefore adjusts these two functions to focus on their respective kthreads. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 51824b780b719c53113dc39e027fbf670dc66028 Author: Uladzislau Rezki (Sony) Date: Thu Jun 30 18:33:35 2022 +0200 rcu/kvfree: Update KFREE_DRAIN_JIFFIES interval Currently the monitor work is scheduled with a fixed interval of HZ/20, which is roughly 50 milliseconds. The drawback of this approach is low utilization of the 512 page slots in scenarios with infrequence kvfree_rcu() calls. For example on an Android system: kworker/3:3-507 [003] .... 470.286305: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d0f0dde5 nr_records=6 kworker/6:1-76 [006] .... 470.416613: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000ea0d6556 nr_records=1 kworker/6:1-76 [006] .... 470.416625: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000003e025849 nr_records=9 kworker/3:3-507 [003] .... 471.390000: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000815a8713 nr_records=48 kworker/1:1-73 [001] .... 471.725785: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000fda9bf20 nr_records=3 kworker/1:1-73 [001] .... 471.725833: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000a425b67b nr_records=76 kworker/0:4-1411 [000] .... 472.085673: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000007996be9d nr_records=1 kworker/0:4-1411 [000] .... 472.085728: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d0f0dde5 nr_records=5 kworker/6:1-76 [006] .... 472.260340: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000065630ee4 nr_records=102 In many cases, out of 512 slots, fewer than 10 were actually used. In order to improve batching and make utilization more efficient this commit sets a drain interval to a fixed 5-seconds interval. Floods are detected when a page fills quickly, and in that case, the reclaim work is re-scheduled for the next scheduling-clock tick (jiffy). After this change: kworker/7:1-371 [007] .... 5630.725708: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000005ab0ffb3 nr_records=121 kworker/7:1-371 [007] .... 5630.989702: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000060c84761 nr_records=47 kworker/7:1-371 [007] .... 5630.989714: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000000babf308 nr_records=510 kworker/7:1-371 [007] .... 5631.553790: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000bb7bd0ef nr_records=169 kworker/7:1-371 [007] .... 5631.553808: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000044c78753 nr_records=510 kworker/5:6-9428 [005] .... 5631.746102: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d98519aa nr_records=123 kworker/4:7-9434 [004] .... 5632.001758: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000526c9d44 nr_records=322 kworker/4:7-9434 [004] .... 5632.002073: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000002c6a8afa nr_records=185 kworker/7:1-371 [007] .... 5632.277515: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000007f4a962f nr_records=510 Here, all but one of the cases, more than one hundreds slots were used, representing an order-of-magnitude improvement. Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 38269096351806bf7315f971c53205b676ada259 Author: Joel Fernandes (Google) Date: Wed Jun 22 22:51:02 2022 +0000 rcu/kfree: Fix kfree_rcu_shrink_count() return value As per the comments in include/linux/shrinker.h, .count_objects callback should return the number of freeable items, but if there are no objects to free, SHRINK_EMPTY should be returned. The only time 0 is returned should be when we are unable to determine the number of objects, or the cache should be skipped for another reason. Signed-off-by: Joel Fernandes (Google) Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 093590c16b447f53e66771c8579ae66c96f6ef61 Author: Michal Hocko Date: Wed Jun 22 13:47:11 2022 +0200 rcu: Back off upon fill_page_cache_func() allocation failure The fill_page_cache_func() function allocates couple of pages to store kvfree_rcu_bulk_data structures. This is a lightweight (GFP_NORETRY) allocation which can fail under memory pressure. The function will, however keep retrying even when the previous attempt has failed. This retrying is in theory correct, but in practice the allocation is invoked from workqueue context, which means that if the memory reclaim gets stuck, these retries can hog the worker for quite some time. Although the workqueues subsystem automatically adjusts concurrency, such adjustment is not guaranteed to happen until the worker context sleeps. And the fill_page_cache_func() function's retry loop is not guaranteed to sleep (see the should_reclaim_retry() function). And we have seen this function cause workqueue lockups: kernel: BUG: workqueue lockup - pool cpus=93 node=1 flags=0x1 nice=0 stuck for 32s! [...] kernel: pool 74: cpus=37 node=0 flags=0x1 nice=0 hung=32s workers=2 manager: 2146 kernel: pwq 498: cpus=249 node=1 flags=0x1 nice=0 active=4/256 refcnt=5 kernel: in-flight: 1917:fill_page_cache_func kernel: pending: dbs_work_handler, free_work, kfree_rcu_monitor Originally, we thought that the root cause of this lockup was several retries with direct reclaim, but this is not yet confirmed. Furthermore, we have seen similar lockups without any heavy memory pressure. This suggests that there are other factors contributing to these lockups. However, it is not really clear that endless retries are desireable. So let's make the fill_page_cache_func() function back off after allocation failure. Cc: Uladzislau Rezki (Sony) Cc: "Paul E. McKenney" Cc: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel Fernandes Signed-off-by: Michal Hocko Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 7634b1eaa0cd135d5eedadb04ad3c91b1ecf28a9 Author: Paul E. McKenney Date: Wed Aug 24 14:46:56 2022 -0700 rcu: Exclude outgoing CPU when it is the last to leave The rcu_boost_kthread_setaffinity() function removes the outgoing CPU from the set_cpus_allowed() mask for the corresponding leaf rcu_node structure's rcub priority-boosting kthread. Except that if the outgoing CPU will leave that structure without any online CPUs, the mask is set to the housekeeping CPU mask from housekeeping_cpumask(). Which is fine unless the outgoing CPU happens to be a housekeeping CPU. This commit therefore removes the outgoing CPU from the housekeeping mask. This would of course be problematic if the outgoing CPU was the last online housekeeping CPU, but in that case you are in a world of hurt anyway. If someone comes up with a valid use case for a system needing all the housekeeping CPUs to be offline, further adjustments can be made. Signed-off-by: Paul E. McKenney commit 621189a1fe93cb2b34d62c5cdb9e258bca044813 Author: Zqiang Date: Mon Aug 8 10:26:26 2022 +0800 rcu: Avoid triggering strict-GP irq-work when RCU is idle Kernels built with PREEMPT_RCU=y and RCU_STRICT_GRACE_PERIOD=y trigger irq-work from rcu_read_unlock(), and the resulting irq-work handler invokes rcu_preempt_deferred_qs_handle(). The point of this triggering is to force grace periods to end quickly in order to give tools like KASAN a better chance of detecting RCU usage bugs such as leaking RCU-protected pointers out of an RCU read-side critical section. However, this irq-work triggering is unconditional. This works, but there is no point in doing this irq-work unless the current grace period is waiting on the running CPU or task, which is not the common case. After all, in the common case there are many rcu_read_unlock() calls per CPU per grace period. This commit therefore triggers the irq-work only when the current grace period is waiting on the running CPU or task. This change was tested as follows on a four-CPU system: echo rcu_preempt_deferred_qs_handler > /sys/kernel/debug/tracing/set_ftrace_filter echo 1 > /sys/kernel/debug/tracing/function_profile_enabled insmod rcutorture.ko sleep 20 rmmod rcutorture.ko echo 0 > /sys/kernel/debug/tracing/function_profile_enabled echo > /sys/kernel/debug/tracing/set_ftrace_filter This procedure produces results in this per-CPU set of files: /sys/kernel/debug/tracing/trace_stat/function* Sample output from one of these files is as follows: Function Hit Time Avg s^2 -------- --- ---- --- --- rcu_preempt_deferred_qs_handle 838746 182650.3 us 0.217 us 0.004 us The baseline sum of the "Hit" values (the number of calls to this function) was 3,319,015. With this commit, that sum was 1,140,359, for a 2.9x reduction. The worst-case variance across the CPUs was less than 25%, so this large effect size is statistically significant. The raw data is available in the Link: URL. Link: https://lore.kernel.org/all/20220808022626.12825-1-qiang1.zhang@intel.com/ Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit bc1cca97e6da6c7c34db7c5b864bb354ca5305ac Author: Zhen Lei Date: Thu Aug 4 10:34:20 2022 +0800 sched/debug: Show the registers of 'current' in dump_cpu_task() The dump_cpu_task() function does not print registers on architectures that do not support NMIs. However, registers can be useful for debugging. Fortunately, in the case where dump_cpu_task() is invoked from an interrupt handler and is dumping the current CPU's stack, the get_irq_regs() function can be used to get the registers. Therefore, this commit makes dump_cpu_task() check to see if it is being asked to dump the current CPU's stack from within an interrupt handler, and, if so, it uses the get_irq_regs() function to obtain the registers. On systems that do support NMIs, this commit has the further advantage of avoiding a self-NMI in this case. This is an example of rcu self-detected stall on arm64, which does not support NMIs: [ 27.501721] rcu: INFO: rcu_preempt self-detected stall on CPU [ 27.502238] rcu: 0-....: (1250 ticks this GP) idle=4f7/1/0x4000000000000000 softirq=2594/2594 fqs=619 [ 27.502632] (t=1251 jiffies g=2989 q=29 ncpus=4) [ 27.503845] CPU: 0 PID: 306 Comm: test0 Not tainted 5.19.0-rc7-00009-g1c1a6c29ff99-dirty #46 [ 27.504732] Hardware name: linux,dummy-virt (DT) [ 27.504947] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 27.504998] pc : arch_counter_read+0x18/0x24 [ 27.505301] lr : arch_counter_read+0x18/0x24 [ 27.505328] sp : ffff80000b29bdf0 [ 27.505345] x29: ffff80000b29bdf0 x28: 0000000000000000 x27: 0000000000000000 [ 27.505475] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 [ 27.505553] x23: 0000000000001f40 x22: ffff800009849c48 x21: 000000065f871ae0 [ 27.505627] x20: 00000000000025ec x19: ffff80000a6eb300 x18: ffffffffffffffff [ 27.505654] x17: 0000000000000001 x16: 0000000000000000 x15: ffff80000a6d0296 [ 27.505681] x14: ffffffffffffffff x13: ffff80000a29bc18 x12: 0000000000000426 [ 27.505709] x11: 0000000000000162 x10: ffff80000a2f3c18 x9 : ffff80000a29bc18 [ 27.505736] x8 : 00000000ffffefff x7 : ffff80000a2f3c18 x6 : 00000000759bd013 [ 27.505761] x5 : 01ffffffffffffff x4 : 0002dc6c00000000 x3 : 0000000000000017 [ 27.505787] x2 : 00000000000025ec x1 : ffff80000b29bdf0 x0 : 0000000075a30653 [ 27.505937] Call trace: [ 27.506002] arch_counter_read+0x18/0x24 [ 27.506171] ktime_get+0x48/0xa0 [ 27.506207] test_task+0x70/0xf0 [ 27.506227] kthread+0x10c/0x110 [ 27.506243] ret_from_fork+0x10/0x20 This is a marked improvement over the old output: [ 27.944550] rcu: INFO: rcu_preempt self-detected stall on CPU [ 27.944980] rcu: 0-....: (1249 ticks this GP) idle=cbb/1/0x4000000000000000 softirq=2610/2610 fqs=614 [ 27.945407] (t=1251 jiffies g=2681 q=28 ncpus=4) [ 27.945731] Task dump for CPU 0: [ 27.945844] task:test0 state:R running task stack: 0 pid: 306 ppid: 2 flags:0x0000000a [ 27.946073] Call trace: [ 27.946151] dump_backtrace.part.0+0xc8/0xd4 [ 27.946378] show_stack+0x18/0x70 [ 27.946405] sched_show_task+0x150/0x180 [ 27.946427] dump_cpu_task+0x44/0x54 [ 27.947193] rcu_dump_cpu_stacks+0xec/0x130 [ 27.947212] rcu_sched_clock_irq+0xb18/0xef0 [ 27.947231] update_process_times+0x68/0xac [ 27.947248] tick_sched_handle+0x34/0x60 [ 27.947266] tick_sched_timer+0x4c/0xa4 [ 27.947281] __hrtimer_run_queues+0x178/0x360 [ 27.947295] hrtimer_interrupt+0xe8/0x244 [ 27.947309] arch_timer_handler_virt+0x38/0x4c [ 27.947326] handle_percpu_devid_irq+0x88/0x230 [ 27.947342] generic_handle_domain_irq+0x2c/0x44 [ 27.947357] gic_handle_irq+0x44/0xc4 [ 27.947376] call_on_irq_stack+0x2c/0x54 [ 27.947415] do_interrupt_handler+0x80/0x94 [ 27.947431] el1_interrupt+0x34/0x70 [ 27.947447] el1h_64_irq_handler+0x18/0x24 [ 27.947462] el1h_64_irq+0x64/0x68 <--- the above backtrace is worthless [ 27.947474] arch_counter_read+0x18/0x24 [ 27.947487] ktime_get+0x48/0xa0 [ 27.947501] test_task+0x70/0xf0 [ 27.947520] kthread+0x10c/0x110 [ 27.947538] ret_from_fork+0x10/0x20 Signed-off-by: Zhen Lei Signed-off-by: Paul E. McKenney Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider commit e73dfe30930b75c98746152e7a2f6a8ab6067b51 Author: Zhen Lei Date: Thu Aug 4 10:34:19 2022 +0800 sched/debug: Try trigger_single_cpu_backtrace(cpu) in dump_cpu_task() The trigger_all_cpu_backtrace() function attempts to send an NMI to the target CPU, which usually provides much better stack traces than the dump_cpu_task() function's approach of dumping that stack from some other CPU. So much so that most calls to dump_cpu_task() only happen after a call to trigger_all_cpu_backtrace() has failed. And the exception to this rule really should attempt to use trigger_all_cpu_backtrace() first. Therefore, move the trigger_all_cpu_backtrace() invocation into dump_cpu_task(). Signed-off-by: Zhen Lei Signed-off-by: Paul E. McKenney Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider commit d8f3f5834febb74d18b5b2098f67d9db740f3e30 Author: Paul E. McKenney Date: Wed Aug 3 10:36:32 2022 -0700 rcu: Update rcu_access_pointer() header for rcu_dereference_protected() The rcu_access_pointer() docbook header correctly notes that it may be used during post-grace-period teardown. However, it is usually better to use rcu_dereference_protected() for this purpose. This commit therefore calls out this preferred usage. Reported-by: Maxim Mikityanskiy Signed-off-by: Paul E. McKenney commit 089254fd386eb6800dd7d7863f12a04ada0c35fa Author: Paul E. McKenney Date: Wed Aug 3 08:48:12 2022 -0700 rcu: Document reason for rcu_all_qs() call to preempt_disable() Given that rcu_all_qs() is in non-preemptible kernels, why on earth should it invoke preempt_disable()? This commit adds the reason, which is to work nicely with debugging enabled in CONFIG_PREEMPT_COUNT=y kernels. Reported-by: Neeraj Upadhyay Reported-by: Boqun Feng Reported-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 6ca0292ccf968e0132e64d6a699d36ba3e92cb81 Author: Zqiang Date: Fri Jul 1 10:44:04 2022 +0800 rcu: Make tiny RCU support leak callbacks for debug-object errors Currently, only Tree RCU leaks callbacks setting when it detects a duplicate call_rcu(). This commit causes Tiny RCU to also leak callbacks in this situation. Because this is Tiny RCU, kernel size is important: 1. CONFIG_TINY_RCU=y and CONFIG_DEBUG_OBJECTS_RCU_HEAD=n (Production kernel) Original: text data bss dec hex filename 26290663 20159823 15212544 61663030 3ace736 vmlinux With this commit: text data bss dec hex filename 26290663 20159823 15212544 61663030 3ace736 vmlinux 2. CONFIG_TINY_RCU=y and CONFIG_DEBUG_OBJECTS_RCU_HEAD=y (Debugging kernel) Original: text data bss dec hex filename 26291319 20160143 15212544 61664006 3aceb06 vmlinux With this commit: text data bss dec hex filename 26291319 20160431 15212544 61664294 3acec26 vmlinux These results show that the kernel size is unchanged for production kernels, as desired. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit fcb42c9a77d490ed0974e4d394519481aa06e585 Author: Zqiang Date: Tue Jul 5 12:09:51 2022 -0700 rcu: Add QS check in rcu_exp_handler() for non-preemptible kernels Kernels built with CONFIG_PREEMPTION=n and CONFIG_PREEMPT_COUNT=y maintain preempt_count() state. Because such kernels map __rcu_read_lock() and __rcu_read_unlock() to preempt_disable() and preempt_enable(), respectively, this allows the expedited grace period's !CONFIG_PREEMPT_RCU version of the rcu_exp_handler() IPI handler function to use preempt_count() to detect quiescent states. This preempt_count() usage might seem to risk failures due to use of implicit RCU readers in portions of the kernel under #ifndef CONFIG_PREEMPTION, except that rcu_core() already disallows such implicit RCU readers. The moral of this story is that you must use explicit read-side markings such as rcu_read_lock() or preempt_disable() even if the code knows that this kernel does not support preemption. This commit therefore adds a preempt_count()-based check for a quiescent state in the !CONFIG_PREEMPT_RCU version of the rcu_exp_handler() function for kernels built with CONFIG_PREEMPT_COUNT=y, reporting an immediate quiescent state when the interrupted code had both preemption and softirqs enabled. This change results in about a 2% reduction in expedited grace-period latency in kernels built with both CONFIG_PREEMPT_RCU=n and CONFIG_PREEMPT_COUNT=y. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney Link: https://lore.kernel.org/all/20220622103549.2840087-1-qiang1.zhang@intel.com/ commit bca4fa8cb0f4c096b515952f64e560fd784a0514 Author: Zqiang Date: Mon Jun 20 14:42:24 2022 +0800 rcu: Update rcu_preempt_deferred_qs() comments for !PREEMPT kernels In non-premptible kernels, tasks never do context switches within RCU read-side critical sections. Therefore, in such kernels, each leaf rcu_node structure's ->blkd_tasks list will always be empty. The comment on the non-preemptible version of rcu_preempt_deferred_qs() confuses this point, so this commit therefore fixes it. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 6d60ea03ac2d3dcf6ddee6b45aa7213d8b0461c5 Author: Zqiang Date: Thu Jun 16 21:53:47 2022 +0800 rcu: Fix rcu_read_unlock_strict() strict QS reporting Kernels built with CONFIG_PREEMPT=n and CONFIG_RCU_STRICT_GRACE_PERIOD=y report the quiescent state directly from the outermost rcu_read_unlock(). However, the current CPU's rcu_data structure's ->cpu_no_qs.b.norm might still be set, in which case rcu_report_qs_rdp() will exit early, thus failing to report quiescent state. This commit therefore causes rcu_read_unlock_strict() to clear CPU's rcu_data structure's ->cpu_no_qs.b.norm field before invoking rcu_report_qs_rdp(). Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit ef32aee9aa062bfbaab2cab36ee837be6060d0a1 Author: Shao-Tse Hung Date: Sat Aug 20 16:32:44 2022 +0800 doc/rcu: Update LWN article URLs and add 2019 article This patch adds LWN articles about RCU APIs which were released in 2019. Also, HTTP URLs are replaced by HTTPS. Signed-off-by: Shao-Tse Hung Signed-off-by: Paul E. McKenney commit 99cf092058e13f133ff9373fcbd25ae38509df03 Author: Paul E. McKenney Date: Tue Aug 9 10:24:36 2022 -0700 doc: SLAB_TYPESAFE_BY_RCU uses cannot rely on spinlocks Because the SLAB_TYPESAFE_BY_RCU code does not zero pages that are to be broken up into slabs, the memory returned by kmem_cache_alloc() must be fully initialized, including any spinlocks included in the newly allocated structure. This means that readers attempting to look up an SLAB_TYPESAFE_BY_RCU object must use a reference-counting approach. A spinlock may be acquired only after a reference is obtained, which prevents that object from being passed to kmem_struct_free(), but only while that reference continues to be held. Signed-off-by: Paul E. McKenney commit 022d1b356c8a687a58a74cbc90a92d56d3aa207d Author: Paul E. McKenney Date: Thu Aug 4 11:23:19 2022 -0700 doc: Update rcu_access_pointer() advice in rcu_dereference.rst This commit updates the rcu_access_pointer() advice, noting that its return value should not be assigned to a local variable, and also noting that there is little point in using rcu_access_pointer() within an RCU read-side critical section. Signed-off-by: Paul E. McKenney commit ca8a439e4611765b0e4bf5d4fd3fab54bab5ffe2 Author: Paul E. McKenney Date: Wed Aug 3 10:23:42 2022 -0700 doc: Fix list: rcu_access_pointer() is not lockdep-checked The rcu_access_pointer() macro does not consult lockdep by design because it is intended to be used outside of RCU read-side critical sections. This commit therefore makes a separate list for it in whatisRCU.rst. Similarly, RCU_LOCKDEP_WARN(), rcu_sleep_check(), and RCU_NONIDLE() do not do anything with pointer access. This commit therefore creates a separate utility-API list for them. Signed-off-by: Paul E. McKenney commit 1c1c1d983e75f53b3e307804a39d17d24310c5f2 Author: Paul E. McKenney Date: Thu Jul 28 12:04:00 2022 -0700 doc: Use rcu_barrier() to rate-limit RCU callbacks The checklist.rst document advises periodic synchronize_rcu() invocations to prevent callback flooding. However, rcu_barrier() is often a better choice. This commit therefore adds words to this effect. Signed-off-by: Paul E. McKenney commit ed336c6fe4c0110a56f6f237865ff9660de8c598 Author: Paul E. McKenney Date: Thu Jul 28 12:00:50 2022 -0700 doc: Call out queue_rcu_work() for blocking RCU callbacks The current checklist.rst file correctly notes that RCU callbacks execute in BH context, and cannot block. This commit adds words advising people needing callbacks to block to use workqueues, for example, by replacing call_rcu() with queue_rcu_work(). Signed-off-by: Paul E. McKenney commit 4d2f862b5b49141a1762baa67c846c598b54be27 Author: Paul E. McKenney Date: Tue Jul 5 12:15:35 2022 -0700 doc: Emphasize the need for explicit RCU read-side markers This commit updates checklist.rst to emphasize the need for explicit markers for RCU read-side critical sections. Signed-off-by: Paul E. McKenney commit 215da896df6cceccd2faea2d36971de21a3d9f19 Author: Maxime Chevallier Date: Fri Aug 26 16:17:22 2022 +0200 phy: lan966x: add support for QUSGMII Makes so that the serdes driver also takes QUSGMII in consideration. It's configured exactly as QSGMII as far as the serdes driver is concerned. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 66df18b3bd74107dd7c196e75ce00d64d7553152 Author: Linus Walleij Date: Wed Aug 31 10:47:50 2022 +0200 gpio: ucb1400: Use proper header The UCB1400 implements a GPIO driver so it needs to include the header, not the legacy header. Compile tested on pxa_defconfig. Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2fee35fc07462b900dc7730a92857d1f1350c621 Author: Jani Nikula Date: Mon Aug 29 16:18:12 2022 +0300 drm/i915: move backlight to display.backlight Move display backlight related members under drm_i915_private display sub-struct. Prefer adding anonymous sub-structs even for single members that aren't our own structs. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/026241565dad12e0024c443419fa5e0caac41b2d.1661779055.git.jani.nikula@intel.com commit d51309b4e9aa79653b8343101def9ba99ba2cb57 Author: Jani Nikula Date: Mon Aug 29 16:18:11 2022 +0300 drm/i915: move and group cdclk under display.cdclk Move display cdclk related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/7df23655be5dc70fb1a2b43ce41e1682e40395d8.1661779055.git.jani.nikula@intel.com commit 7249dfcb6fc0950eb1d7e0bfb8b642cf40f089e7 Author: Jani Nikula Date: Mon Aug 29 16:18:10 2022 +0300 drm/i915: move opregion to display.opregion Move display opregion related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/a0ceb5148835fa3e0828786ae491fcd11e2e77ff.1661779055.git.jani.nikula@intel.com commit f0acaf9d6912240cf1a27f0f75d04cf149086da9 Author: Jani Nikula Date: Mon Aug 29 16:18:09 2022 +0300 drm/i915: move and group max_bw and bw_obj under display.bw Move display bandwidth related members under drm_i915_private display sub-struct. v2: Rebase Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/c8b9e2fdc5c226ffb71759a20e561c832a774ba5.1661779055.git.jani.nikula@intel.com commit eb11eabc5f26f876c514bb294dfdb0484bad28a6 Author: Jani Nikula Date: Mon Aug 29 16:18:08 2022 +0300 drm/i915: move and group hdcp under display.hdcp Move display hdcp related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/1083f5a58cce1507bd19bf7f98bf85e9351b741e.1661779055.git.jani.nikula@intel.com commit c9448aa41ac7dd223a6bef79e71d6c168593ebb7 Author: Andy Shevchenko Date: Tue Aug 30 21:28:21 2022 +0300 spi: stm32-qspi: Refactor dual flash mode enable check in ->setup() gpiod_count() either returns positive number of the CS or negative error code. In the stm32_qspi_setup() we check that configuration has enough CS for the dual flash mode and SPI mode is not changing over the lines of the code. Taking all above into considertion, refactor dual flash mode enable check by dropping unneeded CS check and reusing local mode variable. Signed-off-by: Andy Shevchenko Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20220830182821.47919-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit eea0e7d20d6dab38522ac0a3af61fd92c53c34f6 Author: Andy Shevchenko Date: Tue Aug 30 21:28:20 2022 +0300 spi: stm32-qspi: Replace of_gpio_named_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Signed-off-by: Andy Shevchenko Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20220830182821.47919-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 33b7504ae08a20ad22f3bd867623c72bddefdd12 Author: Daniel Mack Date: Fri Aug 26 10:59:27 2022 +0200 ASoC: max98396: Make data monitor features configurable Allow the data monitor features to be enabled explicitly, and enable control over their details. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20220826085927.2336224-2-daniel@zonque.org Signed-off-by: Mark Brown commit ec2988da1a4671f31b898351daeee2e65ca508f7 Author: Daniel Mack Date: Fri Aug 26 10:59:26 2022 +0200 ASoC: dt-bindings: max98396: Document data monitor properties This device features a data monitor that puts the device in software reset upon a configurable set of events. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220826085927.2336224-1-daniel@zonque.org Signed-off-by: Mark Brown commit 7a0431bbda8ae24de56ea1dadcf1a2e56f939707 Author: Pierre-Louis Bossart Date: Mon Aug 22 20:42:39 2022 +0200 ASoC: ti: omap-mcbsp: remove useless assignment sound/soc/ti/omap-mcbsp.c:617:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20220822184239.169757-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3653a6a2a7c146f04940d572d2728c939b50cba1 Author: Pierre-Louis Bossart Date: Mon Aug 22 20:42:38 2022 +0200 ASoC: fsl: fsl-utils: remove useless assignment cppcheck warning: sound/soc/fsl/fsl_utils.c:127:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220822184239.169757-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c9a9b4dbc18f4dc609d47b9ac19545b31fb21e3f Author: Pierre-Louis Bossart Date: Mon Aug 22 20:42:37 2022 +0200 ASoC: wcd9335: remove always-true condition cppcheck warning: sound/soc/codecs/wcd9335.c:1824:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1824:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1845:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1845:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20220822184239.169757-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 43265ceeb0b9cb1f8f5fb182adaa6c2ed4941478 Author: Pierre-Louis Bossart Date: Mon Aug 22 20:42:36 2022 +0200 ASoC: wcd-mbhc-v2: remove always-true condition cppcheck warning: 'cross_conn<0' is always true [knownConditionTrueFalse] } else if (cross_conn < 0) /* Error */ ^ '!cross_conn' is not redundant } else if (!cross_conn) { /* no cross connection */ ^ is always true } else if (cross_conn < 0) /* Error */ ^ sound/soc/codecs/wcd-mbhc-v2.c:1192:26: style: Condition sound/soc/codecs/wcd-mbhc-v2.c:1188:15: note: Assuming that condition sound/soc/codecs/wcd-mbhc-v2.c:1192:26: note: Condition 'cross_conn<0' Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20220822184239.169757-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c90d6054ff9d75bc185c48b798b745aa2c05236c Author: Pierre-Louis Bossart Date: Mon Aug 22 20:42:35 2022 +0200 ASoC: hdmi-codec: remove unused definitions cppcheck warning: sound/soc/codecs/hdmi-codec.c:24:16: style: struct member 'hdmi_codec_channel_ma`p_table::map' is never used. [unusedStructMember] unsigned char map; /* ALSA API channel map position */ ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20220822184239.169757-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1a01e19278022cd2f7daa7a065ed47c5022dbad9 Author: Laurentiu Mihalcea Date: Mon Aug 22 13:15:02 2022 +0300 ASoC: SOF: compress: Add copy function for capture case Added a new copy function used to copy data to user buffer in the case of compress capture. Reviewed-by: Paul Olaru Reviewed-by: Daniel Baluta Signed-off-by: Laurentiu Mihalcea Link: https://lore.kernel.org/r/20220822101502.17644-3-laurentiu.mihalcea@nxp.com Signed-off-by: Mark Brown commit 272ff8828f35658aace17e3227624fbbd68a6bcf Author: Laurentiu Mihalcea Date: Mon Aug 22 13:15:01 2022 +0300 ASoC: SOF: compress: Move sof_compr_copy functionality Since we're preparing to add support for compress capture, we need to move the content of sof_compr_copy into a separate function which handles the playback direction just like the initial sof_compr_copy. Reviewed-by: Paul Olaru Reviewed-by: Daniel Baluta Signed-off-by: Laurentiu Mihalcea Link: https://lore.kernel.org/r/20220822101502.17644-2-laurentiu.mihalcea@nxp.com Signed-off-by: Mark Brown commit 5334bed7b2344115928cca4c1a63b32ccde1814d Author: Tinghan Shen Date: Wed Aug 31 14:51:00 2022 +0800 arm64: dts: mediatek: Fix build warnings of mt8173 vcodec nodes Correct the phandle of power domain node referenced by vcodec nodes. arch/arm64/boot/dts/mediatek/mt8173.dtsi:1450.35-1471.5: Warning (power_domains_property): /soc/vcodec@18002000: Missing property '#power-domain-cells' in node /soc/syscon@10006000 or bad phandle (referred from power-domains[0]) arch/arm64/boot/dts/mediatek/mt8173.dtsi:1502.35-1522.5: Warning (power_domains_property): /soc/vcodec@19002000: Missing property '#power-domain-cells' in node /soc/syscon@10006000 or bad phandle (referred from power-domains[0]) Fixes: d3dfd4688574 ("arm64: dts: mediatek: Update mt81xx scpsys node to align with dt-bindings") Signed-off-by: Tinghan Shen Link: https://lore.kernel.org/r/20220831065100.27722-1-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 08a717e4803798e066aa6b69ebf69da9fc8e1758 Author: Sabrina Dubroca Date: Tue Aug 30 16:23:12 2022 +0200 xfrm: add extack to verify_sec_ctx_len Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit d37bed89f082cb84cbdf1f38114cde1defc1724c Author: Sabrina Dubroca Date: Tue Aug 30 16:23:11 2022 +0200 xfrm: add extack to validate_tmpl Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit fb7deaba40cfc6b5eb91b7431102520c4b156513 Author: Sabrina Dubroca Date: Tue Aug 30 16:23:10 2022 +0200 xfrm: add extack to verify_policy_type Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 24fc544fb525a2d1cabe4e77e673938bf2e45aed Author: Sabrina Dubroca Date: Tue Aug 30 16:23:09 2022 +0200 xfrm: add extack to verify_policy_dir Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit ec2b4f01536dcd9ecaae91e99334b5fdb510c0e2 Author: Sabrina Dubroca Date: Tue Aug 30 16:23:08 2022 +0200 xfrm: add extack support to verify_newpolicy_info Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 3bec6c3e83b5c125ff35e3dae3127c8d62046a1d Author: Sabrina Dubroca Date: Tue Aug 30 16:23:07 2022 +0200 xfrm: propagate extack to all netlink doit handlers xfrm_user_rcv_msg() already handles extack, we just need to pass it down. Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 2d919d39ab58838f694620dc348a91e629208a65 Merge: 21cb860c7f314 32cbac21b9f47 Author: David S. Miller Date: Wed Aug 31 09:41:49 2022 +0100 Merge branch 'net-dsa-microchip-error-hndling-reg-access-validation' Oleksij Rempel says: ==================== net: dsa: microchip: add error handling and register access validation changes v4: - add Reviewed-by: Vladimir Oltean to all patches - fix checkpatch warnings. changes v3: - fix build error in the middle of the patch stack. changes v2: - add regmap_ranges for KSZ9477 - drop output clock devicetree in driver validation patches. DTs need some more refactoring and can be done in a separate patch set. - remove some unused variables. This patch series adds error handling for the PHY read/write path and optional register access validation. After adding regmap_ranges for KSZ8563 some bugs was detected, so critical bug fixes are sorted before ragmap_range patch. Potentially this bug fixes can be ported to stable kernels, but need to be reworked. ==================== Signed-off-by: David S. Miller commit 32cbac21b9f47c00b72d40a46d87039270daff7a Author: Oleksij Rempel Date: Fri Aug 26 12:56:34 2022 +0200 net: dsa: microchip: remove IS_9893 flag Use chip_id as other places of this code do it Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit e7f695210140ea67dd81f7c9d95c3a685966e1de Author: Oleksij Rempel Date: Fri Aug 26 12:56:33 2022 +0200 net: dsa: microchip: remove unused sgmii variable This variable is not used. So, remove it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7d39143449ea3308ed116a7cc71bc870a2d25151 Author: Oleksij Rempel Date: Fri Aug 26 12:56:32 2022 +0200 net: dsa: microchip: ksz9477: remove unused "on" variable This variable is not used on ksz9477 side. Remove it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6aaa8e7d20026652ede69ce3ff4772859752da15 Author: Oleksij Rempel Date: Fri Aug 26 12:56:31 2022 +0200 net: dsa: microchip: remove unused port phy variable This variable is unused. So, drop it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0a7fbd514edfcf1e67f9737f35c0a12b3ff1b438 Author: Oleksij Rempel Date: Fri Aug 26 12:56:30 2022 +0200 net: dsa: microchip: ksz9477: use internal_phy instead of phy_port_cnt With code refactoring was introduced new variable internal_phy. Let's use it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 74e792b5f2dd518983f401aa130094f1dbd0d74f Author: Oleksij Rempel Date: Fri Aug 26 12:56:29 2022 +0200 net: dsa: microchip: add regmap_range for KSZ9477 chip Add register validation for KSZ9477 Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5bd3ecd121e34370b4d5a02de925335655bbaa9a Author: Oleksij Rempel Date: Fri Aug 26 12:56:28 2022 +0200 net: dsa: microchip: ksz9477: remove MII_CTRL1000 check from ksz9477_w_phy() The reason why PHYlib may access MII_CTRL1000 on the chip without GBit support is only if chip provides wrong information about extended caps register. This issue is now handled by ksz9477_r_phy_quirks() With proper regmap_ranges provided for all chips we will be able to catch this kind of bugs any way. So, remove this sanity check. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 41131bac9a9adf98024d129d676c09cdf72b7de7 Author: Oleksij Rempel Date: Fri Aug 26 12:56:27 2022 +0200 net: dsa: microchip: add regmap_range for KSZ8563 chip Add register validation for KSZ8563. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit ec6ba50c65c1e30218f69055a556bdd133af6da5 Author: Oleksij Rempel Date: Fri Aug 26 12:56:26 2022 +0200 net: dsa: microchip: add support for regmap_access_tables This is complex driver with support for different chips with different layouts. To detect at least some bugs earlier, we should validate register accesses by using regmap_access_table support. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit b5708dc6539d7630b4ddbd9f72a74280630770b8 Author: Oleksij Rempel Date: Fri Aug 26 12:56:25 2022 +0200 net: dsa: microchip: KSZ9893: do not write to not supported Output Clock Control Register This issue was detected after adding regmap register access validation. KSZ9893 compatible chips do not have "Output Clock Control Register 0x0103". So, avoid writing to it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9590fc4a2af55f92142ecbb724d999adf77a07c0 Author: Oleksij Rempel Date: Fri Aug 26 12:56:24 2022 +0200 net: dsa: microchip: ksz8795: add error handling to ksz8_r/w_phy Now ksz_pread/ksz_pwrite can return error value. So, make use of it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9da975e1bbef6804145743a6ec0cae0f2f3f4c09 Author: Oleksij Rempel Date: Fri Aug 26 12:56:23 2022 +0200 net: dsa: microchip: ksz9477: add error handling to ksz9477_r/w_phy Now ksz_pread/ksz_pwrite can return error value. So, make use of it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit d38bc3b4b8a6a01170d7f79f2c48ca678d135bbb Author: Oleksij Rempel Date: Fri Aug 26 12:56:22 2022 +0200 net: dsa: microchip: forward error value on all ksz_pread/ksz_pwrite functions ksz_read*/ksz_write* are able to return errors, so forward it. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8f420456792308639fcbc15462050c521fbd127d Author: Oleksij Rempel Date: Fri Aug 26 12:56:21 2022 +0200 net: dsa: microchip: allow to pass return values for PHY read/write accesses PHY access may end with errors on different levels. So, allow to forward return values where possible. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit d7539fc2b41a126d596d1e5777e0697a4acc692c Author: Oleksij Rempel Date: Fri Aug 26 12:56:20 2022 +0200 net: dsa: microchip: don't announce extended register support on non Gbit chips This issue was detected after adding support of regmap_ranges for KSZ8563R chip. This chip is reporting extended registers support without having actual extended registers. This made PHYlib request not existing registers. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 505bf3205aaa3d736aa432ff62bd532882cec32e Author: Oleksij Rempel Date: Fri Aug 26 12:56:19 2022 +0200 net: dsa: microchip: do per-port Gbit detection instead of per-chip KSZ8563 has two 100Mbit PHYs and CPU port with RGMII support. Since 1000Mbit configuration for the RGMII capable MAC is present, we should use per port validation. As main part of migration to per-port validation we need to rework ksz9477_switch_init() function. Which is using undocumented REG_GLOBAL_OPTIONS register to detect per-chip Gbit support. So, it is related to some sort of risk for regressions. To reduce this risk I compared the code with publicly available documentations. This function will executed on following currently supported chips: struct ksz_chip_data OF compatible KSZ9477 KSZ9477 KSZ9897 KSZ9897 KSZ9893 KSZ9893, KSZ9563 KSZ8563 KSZ8563 KSZ9567 KSZ9567 Only KSZ9893, KSZ9563, KSZ8563 document existence of 0xf == REG_GLOBAL_OPTIONS register with bit field description "SKU ID": KSZ9893 0x0C KSZ9563 0x1C KSZ8563 0x3C The existence of hidden flags is not documented. KSZ9477, KSZ9897, KSZ9567 do not document this register at all. Only KSZ8563 is documented as non Gbit chip: 100Mbit PHYs and RGMII CPU port. So, this change should not introduce a regression for configurations with properly used OF compatibles. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit b449080956127410dbc94ba7497de066d68c7573 Author: Oleksij Rempel Date: Fri Aug 26 12:56:18 2022 +0200 net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip Add separate entry for the KSZ8563 chip. According to the documentation it can support Gbit only on RGMII port. So, we will need to be able to describe in the followup patch. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3177d7bbe0f256d6f6841c54fb65eaea2f3e26c1 Author: Xin Gao Date: Wed Aug 17 09:35:29 2022 +0800 core: Variable type completion 'unsigned int' is better than 'unsigned'. Signed-off-by: Xin Gao Signed-off-by: David S. Miller commit fbb6c848dd89786fe24856ee6b5e773910ded29c Author: Ezequiel Garcia Date: Mon Jul 18 23:41:21 2022 +0200 media: destage Hantro VPU driver The Hantro mainline driver has been used in production since several years and was only kept as a staging driver due the stateless CODEC controls. Now that all the stateless CODEC controls have been moved out of staging, graduate the driver as well. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 10174220f55ac2c9ea7bdf2dcebe422d24024aec Author: Ard Biesheuvel Date: Thu Aug 25 19:03:27 2022 +0200 usb: reduce kernel log spam on driver registration Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found. Let's fix that, and remove these pr_info() calls. Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: Avi Fishman Cc: Tomer Maimon Cc: Tali Perry Cc: Patrick Venture Cc: Nancy Yuen Cc: Benjamin Fair Cc: Patrice Chotard Cc: Vladimir Zapolskiy Cc: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-omap@vger.kernel.org Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Alim Akhtar Acked-by: Alan Stern Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220825170327.674446-1-ardb@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8f36b3b4e1b58dca7d05e1579019230437e55d43 Author: Shuah Khan Date: Tue Aug 23 18:24:56 2022 -0600 usbip: add USBIP_URB_* URB transfer flags USBIP driver packs URB transfer flags in network packets that are exchanged between Server (usbip_host) and Client (vhci_hcd). URB_* flags are internal to kernel and could change. Where as USBIP URB flags exchanged in network packets are USBIP user API must not change. Add USBIP_URB* flags to make this an explicit API and change the client and server to map them. Details as follows: Client tx path (USBIP_CMD_SUBMIT): - Maps URB_* to USBIP_URB_* when it sends USBIP_CMD_SUBMIT packet. Server rx path (USBIP_CMD_SUBMIT): - Maps USBIP_URB_* to URB_* when it receives USBIP_CMD_SUBMIT packet. Flags aren't included in USBIP_CMD_UNLINK and USBIP_RET_SUBMIT packets and no special handling is needed for them in the following cases: - Server rx path (USBIP_CMD_UNLINK) - Client rx path & Server tx path (USBIP_RET_SUBMIT) Update protocol documentation to reflect the change. Suggested-by: Hongren Zenithal Zheng Suggested-by: Alan Stern Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220824002456.94605-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit dff981842a0b1c05786c4c0cdea3ac80079ddd57 Author: Wesley Cheng Date: Wed Aug 17 11:23:54 2022 -0700 usb: dwc3: gadget: Continue handling EP0 xfercomplete events During soft disconnect, EP0 events are expected to be handled in order to allow the controller to successfully move into the halted state. Since __dwc3_gadget_stop() is executed before polling, EP0 has been disabled, and events are being blocked. Allow xfercomplete events to be handled, so that cached SETUP packets can be read out from the internal controller memory. Without doing so, it will lead to endxfer timeouts, which results to controller halt failures. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220817182359.13550-5-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 9711c67de7482c81e1daca3548fbc5c9603600e3 Author: Wesley Cheng Date: Wed Aug 17 11:23:53 2022 -0700 usb: dwc3: gadget: Synchronize IRQ between soft connect/disconnect Ensure that there are no pending events being handled in between soft connect/disconnect transitions. As we are keeping interrupts enabled, and EP0 events are still being serviced, this avoids any stale events from being serviced. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220817182359.13550-4-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit e1ee843488d58099a89979627ef85d5bd6c5cacd Author: Wesley Cheng Date: Wed Aug 17 11:23:52 2022 -0700 usb: dwc3: gadget: Force sending delayed status during soft disconnect If any function drivers request for a delayed status phase, this leads to a SETUP transfer timeout error, since the function may take longer to process the DATA stage. This eventually results in end transfer timeouts, as there is a pending SETUP transaction. In addition, allow the DWC3_EP_DELAY_STOP to be set for if there is a delayed status requested. Ocasionally, a host may abort the current SETUP transaction, by issuing a subsequent SETUP token. In those situations, it would result in an endxfer timeout as well. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220817182359.13550-3-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 359d5a85a758906087801d7b3d3536a984211dec Author: Wesley Cheng Date: Wed Aug 17 11:23:51 2022 -0700 usb: dwc3: Do not service EP0 and conndone events if soft disconnected There are some operations that need to be ignored if there is a soft disconnect in progress. This is to avoid having a pending EP0 transfer in progress while attempting to stop active transfers and halting the controller. There were several instances seen where a soft disconnect was able to occur during early link negotiation, i.e. bus reset/conndone, which leads to the conndone handler re-configuring EPs while attempting to halt the controller, as DEP flags are cleared as part of the soft disconnect path. ep0out: cmd 'Start New Configuration' ep0out: cmd 'Set Endpoint Transfer Resource' ep0in: cmd 'Set Endpoint Transfer Resource' ep1out: cmd 'Set Endpoint Transfer Resource' ... event (00030601): Suspend [U3] event (00000101): Reset [U0] ep0out: req ffffff87e5c9e100 length 0/0 zsI ==> 0 event (00000201): Connection Done [U0] ep0out: cmd 'Start New Configuration' ep0out: cmd 'Set Endpoint Transfer Resource' In addition, if a soft disconnect occurs, EP0 events are still allowed to process, however, it will stall/restart during the SETUP phase. The host is still able to query for the DATA phase, leading to a xfernotready(DATA) event. Since none of the SETUP transfer parameters are populated, the xfernotready is treated as a "wrong direction" error, leading to a duplicate stall/restart routine. Add the proper softconnect/connected checks in sequences that are potentially involved during soft disconnect processing. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220817182359.13550-2-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit c69400b09e471a3f1167adead55a808f0da6534a Author: Justin Chen Date: Wed Aug 10 15:27:35 2022 -0700 usb: host: xhci-plat: suspend/resume clks for brcm The xhci_plat_brcm xhci block can enter suspend with clock disabled to save power and re-enable them on resume. Make use of the XHCI_SUSPEND_RESUME_CLKS quirk to do so. Reviewed-by: Florian Fainelli Signed-off-by: Justin Chen Link: https://lore.kernel.org/r/1660170455-15781-3-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8bd954c56197caf5e3a804d989094bc3fe6329aa Author: Justin Chen Date: Wed Aug 10 15:27:34 2022 -0700 usb: host: xhci-plat: suspend and resume clocks Introduce XHCI_SUSPEND_RESUME_CLKS quirk as a means to suspend and resume clocks if the hardware is capable of doing so. We assume that clocks will be needed if the device may wake. Reviewed-by: Florian Fainelli Signed-off-by: Justin Chen Link: https://lore.kernel.org/r/1660170455-15781-2-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman commit b7feb442ee8692532a00e36447cdac0059cfd93d Author: Frank Li Date: Mon Aug 29 10:31:24 2022 -0500 usb: phy: mxs: fix MXS_PHY_TX_CAL45_MIN and MXS_PHY_TX_CAL45_MAX According to spec: 0000 +19.95% .... 1111 -21.68% 45 * (1 + 19.95%) = 53.9775 45 * (1 - 21.68%) = 35.244 Fix MXS_PHY_TX_CAL45_MIN from 30 to 35 Fix MXS_PHY_TX_CAL45_MAX from 55 to 54 Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20220829153124.2791210-2-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 37bcd16d51c8d738469efb325211a43f1eeb8baa Author: Frank Li Date: Mon Aug 29 10:31:23 2022 -0500 doc: dt-binding: mxs-usb-phy: fix fsl,tx-cal-45-dn-ohms max and min value According to spec: 0000 +19.95% .... 1111 -21.68% 45 * (1 + 19.95%) = 53.9775 45 * (1 - 21.68%) = 35.244 Chanege fsl,tx-cal-45-dn-ohms and fsl,tx-cal-45-dp-ohms range to [35-54] from [30-55] Acked-by: Krzysztof Kozlowski Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20220829153124.2791210-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 9013d8fc0ad91dc369f5b8ea708b9b068aa5d434 Author: Khalid Masum Date: Thu Aug 25 02:31:07 2022 +0600 usb: host: Initiate urb ep with udev ep0 Currently we look up for endpoint in a table and initate urb endpoint with it. This is unnecessary because the lookup will always result in endpoint 0. Suggested-by: Alan Stern Acked-by: Alan Stern Signed-off-by: Khalid Masum Link: https://lore.kernel.org/r/20220824203107.14908-1-khalid.masum.92@gmail.com Signed-off-by: Greg Kroah-Hartman commit d27c66adb4c0b16c817f71ba96e90f322e7419af Author: Khalid Masum Date: Thu Aug 25 01:38:13 2022 +0600 usb: ehci: Use endpoint in URB to get maxpacket usb_maxpacket() looks up the endpoint number in the pipe which can fail if the interface or configuration changes before the routine is called. This is unexpected and may even cause a modulo by zero afterwards. So use usb_endpoint_maxp() routine which uses the endpoint stored in URB to get the maxpacket. Suggested-by: Alan Stern Acked-by: Alan Stern Signed-off-by: Khalid Masum Addresses-Coverity: 744857 ("Division or modulo by zero") Addresses-Coverity: 1487371 ("Division or modulo by zero") Link: https://lore.kernel.org/r/20220824193813.13129-1-khalid.masum.92@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4348f2e3ab3358898bfe93387ced7f3e1e3a6186 Author: Sergey Shtylyov Date: Tue Aug 23 23:53:26 2022 +0300 usb: gadget: function: rndis: limit # of RNDIS instances to 1000 As follows from #define NAME_TEMPLATE, the procfs code in the RNDIS driver expects the # of instances to be 3-digit decimal, while the driver calls ida_simple_get() passing 0 as the 'end' argument which results in actual max instance # of INT_MAX. Limit the maximum # of RNDIS instances to 1000 which is still a lot! :-) Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/a8180973-3ded-3644-585a-169589a37642@omp.ru Signed-off-by: Greg Kroah-Hartman commit 66d1c8021e1d9c97101d58fa09c33c002d96747a Author: Piyush Mehta Date: Mon Aug 22 11:10:51 2022 +0530 usb: chipidea: Add support for VBUS control with PHY Some platforms make use of VBUS control over PHY which means controller driver has to access PHY registers to turn on/off VBUS line.This patch adds support for such platforms in chipidea. Flag 'CI_HDRC_PHY_VBUS_CONTROL' added to support VBus control feature. Acked-by: Peter Chen Signed-off-by: Piyush Mehta Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220822054051.2941282-1-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit 6b91a8e3412a13a8cb1ec610c702db96301c0da0 Author: Randy Dunlap Date: Sat Aug 27 13:32:17 2022 -0700 usb: chipidea: clarify Documentation/ABI text Fix grammar and improve readability of chipidea-usb2 text. Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Peter Chen Cc: linux-usb@vger.kernel.org Acked-by: Peter Chen Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220827203217.7837-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit f1e8a41c6cd590a4deb23c37c547932395a99053 Author: Maciej Żenczykowski Date: Sun Aug 21 07:57:45 2022 -0700 usb: gadget: f_ncm: noop - remove INIT_NDP{16,32}_OPTS macros these are only used in one place, a few lines lower Cc: Brooke Basile Cc: "Bryan O'Donoghue" Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Lorenzo Colitti Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20220821145745.122587-1-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8cbad7cd6e85a28630d81358cdf233380c2777be Author: Shaomin Deng Date: Sat Aug 27 11:33:13 2022 -0400 usb: gadget: at91_udc: Fix comments typo Delete the rebundant word "also" in comments. Signed-off-by: Shaomin Deng Link: https://lore.kernel.org/r/20220827153313.5754-1-dengshaomin@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit c962af85a36ac89384bcd5193d291798ec6750d9 Author: Shaomin Deng Date: Sat Aug 27 11:30:09 2022 -0400 usb: gadget: net2272: Remove the initialization of statics to 0 It is always unnecessary to initialise statics to 0. Signed-off-by: Shaomin Deng Link: https://lore.kernel.org/r/20220827153009.4768-1-dengshaomin@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit e372a6dbc501b09cbbe3f534d4fc26bedf71f216 Author: Rob Herring Date: Tue Aug 23 09:56:40 2022 -0500 dt-bindings: usb: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220823145649.3118479-9-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 2c02249fcbfc066bd33e2a7375c7006d4cb367f6 Author: Daisuke Matsuda Date: Mon Aug 29 16:12:18 2022 +0900 RDMA/rxe: Delete error messages triggered by incoming Read requests An incoming Read request causes multiple Read responses. If a user MR to copy data from is unavailable or responder cannot send a reply, then the error messages can be printed for each response attempt, resulting in message overflow. Link: https://lore.kernel.org/r/20220829071218.1639065-1-matsuda-daisuke@fujitsu.com Signed-off-by: Daisuke Matsuda Signed-off-by: Leon Romanovsky commit f07853582d1f6ed282f8d9a0b1209a87dd761f58 Author: Zhu Yanjun Date: Sun Aug 21 21:16:15 2022 -0400 RDMA/rxe: Remove the unused variable obj The member variable obj in struct rxe_task is not needed. So remove it to save memory. Link: https://lore.kernel.org/r/20220822011615.805603-4-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Li Zhijian Reviewed-by: Bob Pearson Signed-off-by: Leon Romanovsky commit 548ce2e66725dcba4e27d1e8ac468d5dd17fd509 Author: Zhu Yanjun Date: Sun Aug 21 21:16:14 2022 -0400 RDMA/rxe: Fix the error caused by qp->sk When sock_create_kern in the function rxe_qp_init_req fails, qp->sk is set to NULL. Then the function rxe_create_qp will call rxe_qp_do_cleanup to handle allocated resource. Before handling qp->sk, this variable should be checked. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20220822011615.805603-3-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Li Zhijian Reviewed-by: Bob Pearson Signed-off-by: Leon Romanovsky commit a625ca30eff806395175ebad3ac1399014bdb280 Author: Zhu Yanjun Date: Sun Aug 21 21:16:13 2022 -0400 RDMA/rxe: Fix "kernel NULL pointer dereference" error When rxe_queue_init in the function rxe_qp_init_req fails, both qp->req.task.func and qp->req.task.arg are not initialized. Because of creation of qp fails, the function rxe_create_qp will call rxe_qp_do_cleanup to handle allocated resource. Before calling __rxe_do_task, both qp->req.task.func and qp->req.task.arg should be checked. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20220822011615.805603-2-yanjun.zhu@linux.dev Reported-by: syzbot+ab99dc4c6e961eed8b8e@syzkaller.appspotmail.com Signed-off-by: Zhu Yanjun Reviewed-by: Li Zhijian Reviewed-by: Bob Pearson Signed-off-by: Leon Romanovsky commit 6b70fe0601adb1396ad0b85cdf05d217500b49e7 Author: Christian Brauner Date: Mon Aug 29 14:38:42 2022 +0200 acl: add vfs_set_acl_prepare() Various filesystems store POSIX ACLs on the backing store in their uapi format. Such filesystems need to translate from the uapi POSIX ACL format into the VFS format during i_op->get_acl(). The VFS provides the posix_acl_from_xattr() helper for this task. But the usage of posix_acl_from_xattr() is currently ambiguous. It is intended to transform from a uapi POSIX ACL to the VFS represenation. For example, when retrieving POSIX ACLs for permission checking during lookup or when calling getxattr() to retrieve system.posix_acl_{access,default}. Calling posix_acl_from_xattr() during i_op->get_acl() will map the raw {g,u}id values stored as ACL_{GROUP,USER} entries in the uapi POSIX ACL format into k{g,u}id_t in the filesystem's idmapping and return a struct posix_acl ready to be returned to the VFS for caching and to perform permission checks on. However, posix_acl_from_xattr() is also called during setxattr() for all filesystems that rely on VFS provides posix_acl_{access,default}_xattr_handler. The posix_acl_xattr_set() handler which is used for the ->set() method of posix_acl_{access,default}_xattr_handler uses posix_acl_from_xattr() to translate from the uapi POSIX ACL format to the VFS format so that it can be passed to the i_op->set_acl() handler of the filesystem or for direct caching in case no i_op->set_acl() handler is defined. During setxattr() the {g,u}id values stored as ACL_{GROUP,USER} entries in the uapi POSIX ACL format aren't raw {g,u}id values that need to be mapped according to the filesystem's idmapping. Instead they are {g,u}id values in the caller's idmapping which have been generated during posix_acl_fix_xattr_from_user(). In other words, they are k{g,u}id_t which are passed as raw {g,u}id values abusing the uapi POSIX ACL format (Please note that this type safety violation has existed since the introduction of k{g,u}id_t. Please see [1] for more details.). So when posix_acl_from_xattr() is called in posix_acl_xattr_set() the filesystem idmapping is completely irrelevant. Instead, we abuse the initial idmapping to recover the k{g,u}id_t base on the value stored in raw {g,u}id as ACL_{GROUP,USER} in the uapi POSIX ACL format. We need to clearly distinguish betweeen these two operations as it is really easy to confuse for filesystems as can be seen in ntfs3. In order to do this we factor out make_posix_acl() which takes callbacks allowing callers to pass dedicated methods to generate the correct k{g,u}id_t. This is just an internal static helper which is not exposed to any filesystems but it neatly encapsulates the basic logic of walking through a uapi POSIX ACL and returning an allocated VFS POSIX ACL with the correct k{g,u}id_t values. The posix_acl_from_xattr() helper can then be implemented as a simple call to make_posix_acl() with callbacks that generate the correct k{g,u}id_t from the raw {g,u}id values in ACL_{GROUP,USER} entries in the uapi POSIX ACL format as read from the backing store. For setxattr() we add a new helper vfs_set_acl_prepare() which has callbacks to map the POSIX ACLs from the uapi format with the k{g,u}id_t values stored in raw {g,u}id format in ACL_{GROUP,USER} entries into the correct k{g,u}id_t values in the filesystem idmapping. In contrast to posix_acl_from_xattr() the vfs_set_acl_prepare() helper needs to take the mount idmapping into account. The differences are explained in more detail in the kernel doc for the new functions. In follow up patches we will remove all abuses of posix_acl_from_xattr() for setxattr() operations and replace it with calls to vfs_set_acl_prepare(). The new vfs_set_acl_prepare() helper allows us to deal with the ambiguity in how the POSI ACL uapi struct stores {g,u}id values depending on whether this is a getxattr() or setxattr() operation. This also allows us to remove the posix_acl_setxattr_idmapped_mnt() helper reducing the abuse of the POSIX ACL uapi format to pass values that should be distinct types in {g,u}id values stored as ACL_{GROUP,USER} entries. The removal of posix_acl_setxattr_idmapped_mnt() in turn allows us to re-constify the value parameter of vfs_setxattr() which in turn allows us to avoid the nasty cast from a const void pointer to a non-const void pointer on ovl_do_setxattr(). Ultimately, the plan is to get rid of the type violations completely and never pass the values from k{g,u}id_t as raw {g,u}id in ACL_{GROUP,USER} entries in uapi POSIX ACL format. But that's a longer way to go and this is a preparatory step. Link: https://lore.kernel.org/all/20220801145520.1532837-1-brauner@kernel.org [1] Co-Developed-by: Seth Forshee Signed-off-by: Christian Brauner (Microsoft) commit 985a6d0b3c800265a2d5312a52c549bf09254e55 Author: Christian Brauner Date: Mon Aug 29 14:38:41 2022 +0200 acl: return EOPNOTSUPP in posix_acl_fix_xattr_common() Return EOPNOTSUPP when the POSIX ACL version doesn't match and zero if there are no entries. This will allow us to reuse the helper in posix_acl_from_xattr(). This change will have no user visible effects. Fixes: 0c5fd887d2bb ("acl: move idmapped mount fixup into vfs_{g,s}etxattr()") Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) > commit a26aa12384158116c0d80d50e0bdc7b3323551e2 Author: Christian Brauner Date: Mon Aug 29 14:38:40 2022 +0200 ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers The xattr code in ntfs3 is currently a bit confused. For example, it defines a POSIX ACL i_op->set_acl() method but instead of relying on the generic POSIX ACL VFS helpers it defines its own set of xattr helpers with the consequence that i_op->set_acl() is currently dead code. Switch ntfs3 to rely on the VFS POSIX ACL xattr handlers. Also remove i_op->{g,s}et_acl() methods from symlink inode operations. Symlinks don't support xattrs. This is a preliminary change for the following patches which move handling idmapped mounts directly in posix_acl_xattr_set(). This survives POSIX ACL xfstests. Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Signed-off-by: Christian Brauner (Microsoft) Reviewed-by: Seth Forshee (DigitalOcean) > commit 21cb860c7f314be471d2dbcbfb659af405750500 Author: Vlad Buslov Date: Mon Aug 29 14:13:24 2022 +0200 Revert "net: devlink: add RNLT lock assertion to devlink_compat_switch_id_get()" This reverts commit 6005a8aecee8afeba826295321a612ab485c230e. The assertion was intentionally removed in commit 043b8413e8c0 ("net: devlink: remove redundant rtnl lock assert") and, contrary what is described in the commit message, the comment reflects that: "Caller must hold RTNL mutex or reference to dev...". Signed-off-by: Vlad Buslov Tested-by: Leon Romanovsky Link: https://lore.kernel.org/r/20220829121324.3980376-1-vladbu@nvidia.com Signed-off-by: Jakub Kicinski commit d5ccda920ab3a61917cd19582204fdba669b221c Merge: fa8724478e64d c503d8ae48f24 Author: Jakub Kicinski Date: Tue Aug 30 23:20:55 2022 -0700 Merge branch 'mlxsw-configure-max-lag-id-for-spectrum-4' Petr Machata says: ==================== mlxsw: Configure max LAG ID for Spectrum-4 Amit Cohen writes: In the device, LAG identifiers are stored in the port group table (PGT). During initialization, firmware reserves a certain amount of entries at the beginning of this table for LAG identifiers. In Spectrum-4, the size of the PGT table did not increase, but the maximum number of LAG identifiers was doubled, leaving less room for others entries (e.g., flood entries) that also reside in the PGT. Therefore, in order to avoid a regression and as long as there is no explicit requirement to support 256 LAGs, configure the firmware to allocate the same amount of LAG entries (128) as in Spectrum-{2,3}. This can be done via the 'max_lag' field in CONFIG_PROFILE command. Patch set overview: Patch #1 edits the comment of the existing 'max_lag' field. Patch #2 adds support for configuring 'max_lag' field via CONFIG_PROFILE command. Patch #3 adds an helper function to get the actual 'max_lag' in the device. Patch #4 adjusts Spectrum-4 to configure 'max_lag' field. ==================== Link: https://lore.kernel.org/r/cover.1661527928.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit c503d8ae48f2443345ba82ef66a9dfc22389a66f Author: Amit Cohen Date: Fri Aug 26 18:06:52 2022 +0200 mlxsw: spectrum: Add a copy of 'struct mlxsw_config_profile' for Spectrum-4 Starting from Spectrum-4, the maximum number of LAG IDs can be configured by software via CONFIG_PROFILE command during driver initialization. Add a dedicated instance of 'struct mlxsw_config_profile' for Spectrum-4 and set the 'max_lag' field to 128, which is the same amount of LAG entries as in Spectrum-{2,3}. Without this configuration, firmware reserves 256 (the value of 'cap_max_lag' resource) entries at beginning of PGT table for LAG identifiers, which means that less entries in PGT will be available. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit cf735d4c9bab8398259a3635fcd698726a2f1bbe Author: Amit Cohen Date: Fri Aug 26 18:06:51 2022 +0200 mlxsw: Add a helper function for getting maximum LAG ID Currently the driver queries the maximum supported LAG ID from firmware. This will not be accurate anymore once the driver will configure 'max_lag' via CONFIG_PROFILE command. For resource query, firmware returns the maximum LAG ID which is supported by hardware. Software can configure firmware to do not allocate entries for all the supported LAGs, and to limit LAG IDs. In this case, the resource query will not return the actual maximum LAG ID. Add a helper function for getting this value. In case that 'max_lag' field was set during initialization, return the value which was used, otherwise, query firmware for the maximum supported ID. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit eb907e9779ca48e3f3fe3796ed88de017dd59414 Author: Amit Cohen Date: Fri Aug 26 18:06:50 2022 +0200 mlxsw: Support configuring 'max_lag' via CONFIG_PROFILE In the device, LAG identifiers are stored in the port group table (PGT). During initialization, firmware reserves a certain amount of entries at the beginning of this table for LAG identifiers. In Spectrum-4, the size of the PGT table did not increase, but the maximum number of LAG identifiers was doubled, leaving less room for others entries (e.g., flood entries) that also reside in the PGT. Therefore, in order to avoid a regression and as long as there is no explicit requirement to support 256 LAGs, mlxsw driver will configure the firmware to allocate the same amount of LAG entries (128) as in Spectrum-{2,3}. This configuration is done using 'max_lag' field in CONFIG_PROFILE command. Extend 'struct mlxsw_config_profile' to support 'max_lag' field and configure firmware accordingly. A next patch will adjust Spectrum-4 to configure 'max_lag' field. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 95484760f03d684da522a15682776a090db738da Author: Amit Cohen Date: Fri Aug 26 18:06:49 2022 +0200 mlxsw: cmd: Edit the comment of 'max_lag' field in CONFIG_PROFILE Starting from Spectrum-4, the maximum number of LAG IDs can be configured by software via CONFIG_PROFILE command during driver initialization. Edit the comment of 'max_lag' field to mention that this field is reserved in Spectrum-1/2/3 and describe firmware behavior. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit fa8724478e64dcf6a45de9067004dcca07244934 Author: Fernando Fernandez Mancera Date: Fri Aug 26 17:47:38 2022 +0200 Documentation: bonding: clarify supported modes for tlb_dynamic_lb tlb_dynamic_lb bonding option is compatible with balance-tlb and balance-alb modes. In order to be consistent with other option documentation, it should mention both modes not only balance-tlb. Signed-off-by: Fernando Fernandez Mancera Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20220826154738.4039-1-ffmancera@riseup.net Signed-off-by: Jakub Kicinski commit 57688eb887af3db7f1d7f43f2c1babb548b01a34 Author: Dan Carpenter Date: Fri Aug 26 18:03:30 2022 +0300 mlxsw: minimal: Return -ENOMEM on allocation failure These error paths return success but they should return -ENOMEM. Fixes: 01328e23a476 ("mlxsw: minimal: Extend module to port mapping with slot index") Signed-off-by: Dan Carpenter Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/YwjgwoJ3M7Kdq9VK@kili Signed-off-by: Jakub Kicinski commit 92f97c00f0ca538fe820c0b18b6f957a69410689 Author: Nathan Chancellor Date: Thu Aug 25 11:06:07 2022 -0700 net/mlx5e: Do not use err uninitialized in mlx5e_rep_add_meta_tunnel_rule() Clang warns: drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (IS_ERR(flow_rule)) { ^~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:489:9: note: uninitialized use occurs here return err; ^~~ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:481:2: note: remove the 'if' if its condition is always true if (IS_ERR(flow_rule)) { ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:474:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 1 error generated. There is little reason to have the 'goto + error variable' construct in this function. Get rid of it and just return the PTR_ERR value in the if statement and 0 at the end. Fixes: 430e2d5e2a98 ("net/mlx5: E-Switch, Move send to vport meta rule creation") Link: https://github.com/ClangBuiltLinux/linux/issues/1695 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20220825180607.2707947-1-nathan@kernel.org Signed-off-by: Jakub Kicinski commit 4f99de7b181f926a3f8d71fec74fd80e2ee8d9c2 Author: Jiri Pirko Date: Fri Aug 26 13:04:11 2022 +0200 funeth: remove pointless check of devlink pointer in create/destroy_netdev() flows Once devlink port is successfully registered, the devlink pointer is not NULL. Therefore, the check is going to be always true and therefore pointless. Remove it. Signed-off-by: Jiri Pirko Acked-by: Dimitris Michailidis Link: https://lore.kernel.org/r/20220826110411.1409446-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 1390d912b932557121d6e86eedae0aa89258d2cd Merge: 146ecbac1d327 cd7e2b97f6ec5 Author: Jakub Kicinski Date: Tue Aug 30 22:47:00 2022 -0700 Merge branch 'completely-rework-mediatek-mt7530-binding' Arınç ÜNAL says: ==================== completely rework mediatek,mt7530 binding This patch series brings complete rework of the mediatek,mt7530 binding. The binding is checked with "make dt_binding_check DT_SCHEMA_FILES=mediatek,mt7530.yaml". If anyone knows the GIC bit for interrupt for multi-chip module MT7530 in MT7623AI SoC, let me know. I'll add it to the examples. If anyone got a Unielec U7623 or another MT7623AI board, please reach out. ==================== Link: https://lore.kernel.org/r/20220825082301.409450-1-arinc.unal@arinc9.com Signed-off-by: Jakub Kicinski commit cd7e2b97f6ec58cb0eb95786a7dce681015d7a24 Author: Arınç ÜNAL Date: Thu Aug 25 11:23:01 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: update binding description Update the description of the binding. - Describe the switches, which SoCs they are in, or if they are standalone. - Explain the various ways of configuring MT7530's port 5. - Remove phy-mode = "rgmii-txid" from description. Same code path is followed for delayed rgmii and rgmii phy-mode on mtk_eth_soc.c. Signed-off-by: Arınç ÜNAL Acked-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 79a16c3b162ff2ac430fe6cace1fb824417ad4ba Author: Arınç ÜNAL Date: Thu Aug 25 11:23:00 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: define phy-mode per switch Define acceptable phy-mode values for the CPU ports of mt7530 and mt7531 switches. Remove relevant information from the description of the binding. Signed-off-by: Arınç ÜNAL Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit c9aece04e01c8c97a264b4d737d8070c87fd0952 Author: Arınç ÜNAL Date: Thu Aug 25 11:22:59 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: update examples Update the examples on the binding. - Add examples which include a wide variation of configurations. - Make example comments YAML comment instead of DT binding comment. - Add interrupt controller to the examples. Include header file for interrupt. - Change reset line for MT7621 examples. - Pretty formatting for the examples. - Change switch reg to 0. - Change port labels to fit the example, change port 4 label to wan. Signed-off-by: Arınç ÜNAL Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit f565c54e96b6383c9ed666766a1e88225338c29b Author: Arınç ÜNAL Date: Thu Aug 25 11:22:58 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: fix reset lines - Add description for reset-gpios. - Invalidate reset-gpios if mediatek,mcm is used. We cannot use multiple reset lines at the same time. - Invalidate mediatek,mcm if the compatible device is mediatek,mt7531. There is no multi-chip module version of mediatek,mt7531. - Require mediatek,mcm for mediatek,mt7621 as the compatible string is only used for the multi-chip module version of MT7530. Signed-off-by: Arınç ÜNAL Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit ba9476f72500b279a7ec0c41d90c0e48fc4a578e Author: Arınç ÜNAL Date: Thu Aug 25 11:22:57 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: fix description of mediatek,mcm Fix the description of mediatek,mcm. mediatek,mcm is not used on MT7623NI. Signed-off-by: Arınç ÜNAL Acked-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 214537cd8a175bd04fdbc3a4bcce1247996e1111 Author: Arınç ÜNAL Date: Thu Aug 25 11:22:56 2022 +0300 dt-bindings: net: dsa: mediatek,mt7530: make trivial changes Make trivial changes on the binding. - Update title to include MT7531 switch. - Add me as a maintainer. List maintainers in alphabetical order by first name. - Add description to compatible strings. - Stretch descriptions up to the 80 character limit. - Remove lists for single items. - Remove requiring reg as it's already required by dsa-port.yaml. - Define acceptable reg values for the CPU ports. - Remove quotes from $ref: "dsa.yaml#". Signed-off-by: Arınç ÜNAL Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 4f35adaee07d182a4a7ef6b960c614ff3c5b4090 Author: Nuno Sá Date: Tue Aug 30 21:15:03 2022 -0700 Input: adp5588-keys - use new PM macros With the new PM macros (DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()), the compiler has visibility to see that the functions are not used when !CONFIG_PM and hence, remove the dead code. As such, there's no need for '__maybe_unused'. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-11-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 73d4a5423ecee8e108056134c53f82c7a95a90d5 Author: Nuno Sá Date: Tue Aug 30 21:13:10 2022 -0700 Input: adp5588-keys - add regulator support Support feeding VCC through a regulator. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-10-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit cfacae58646462c5afedc8b42ad72a0968678e7c Author: Nuno Sá Date: Tue Aug 30 21:12:54 2022 -0700 Input: adp5588-keys - add optional reset gpio Optionally reset the device during probe. Signed-off-by: Nuno Sá Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-9-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit e22d21d31f5d0ade2fa80c44d615ee488b723063 Author: Nuno Sá Date: Tue Aug 30 21:09:54 2022 -0700 Input: adp5588-keys - fix coding style warnings Just some code cleanup regarding coding style. With the introduction of the bits.h macros changes in the code are indeed introduced. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-8-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 0063aecc61e1beec09611d830f4aae5a90a96c54 Author: Nuno Sá Date: Tue Aug 30 21:09:32 2022 -0700 Input: adp5588-keys - do not check for irq presence There's no need for an extra check for 'client-irq'. Just let it fail when calling 'request_irq()'. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-7-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 81ce5b77417ac9623d1c6270a2f75a0a3a734d0d Author: Nuno Sá Date: Tue Aug 30 21:08:18 2022 -0700 dt-bindings: input: adp5588: add bindings Add device tree bindings for the adp5588-keys driver. Signed-off-by: Nuno Sá Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220829131553.690063-6-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 6704a86283b7e79ff7ae36d388466428f6672962 Author: Nuno Sá Date: Tue Aug 30 21:00:14 2022 -0700 Input: adp5588-keys - add support for fw properties Use firmware properties (eg: OF) to get the device specific configuration. This change just replaces the platform data since there was no platform using it and so, it makes no sense having both. Special note to the PULL-UP disable setting that is now supported as part of the gpio subsystem (using 'set_config()' callback). Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-5-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit e960309ce31865713051854d38740575a6bc0a60 Author: Nuno Sá Date: Tue Aug 30 20:58:26 2022 -0700 Input: adp5588-keys - bail out on returned error Don't continue in code paths after some error is found. It makes no sense to do any other device configuration if a previous one failed. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-4-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 5ddc896088b02bcf07ec4f16ae75db43b35b0bbe Author: Nuno Sá Date: Tue Aug 30 20:55:47 2022 -0700 gpio: gpio-adp5588: drop the driver With commit 9d2b2e83ef27 ("Input: adp5588-keys - support gpi key events as 'gpio keys'") the irchip functionality is directly supported in the input driver as the main goal of these pins is to be used as gpio keys. Hence, this driver can be removed. Signed-off-by: Nuno Sá Acked-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-3-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 9d2b2e83ef277b9c7b8852e8717140daa373ccf1 Author: Nuno Sá Date: Tue Aug 30 20:54:10 2022 -0700 Input: adp5588-keys - support gpi key events as 'gpio keys' This change replaces the support for GPIs as key event generators. Instead of reporting the events directly, we add a gpio based irqchip so that these events can be consumed by keys defined in the gpio-keys driver (as it's goal is indeed for keys on GPIOs capable of generating interrupts). With this, the gpio-adp5588 driver can also be dropped. The basic idea is that all the pins that are not being used as part of the keymap matrix can be possibly requested as GPIOs by gpio-keys (it's also fine to use these pins as plain interrupts though that's not really the point). Since the gpiochip now also has irqchip capabilities, we should only remove it after we free the device interrupt (otherwise we could, in theory, be handling GPIs interrupts while the gpiochip is concurrently removed). Thus the call 'adp5588_gpio_add()' is moved and since the setup phase also needs to come before making the gpios visible, we also need to move 'adp5588_setup()'. While at it, always select GPIOLIB so that we don't need to use #ifdef guards. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220829131553.690063-2-nuno.sa@analog.com Signed-off-by: Dmitry Torokhov commit 4bafca831386bd3b4b059f583b471670c19acf6a Author: Krzysztof Kozlowski Date: Thu Aug 25 14:33:32 2022 +0300 dt-bindings: clock: drop minItems equal to maxItems minItems, if missing, are implicitly equal to maxItems, so drop redundant piece to reduce size of code. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220825113334.196908-3-krzysztof.kozlowski@linaro.org Reviewed-by: Alim Akhtar Reviewed-by: Laurent Pinchart Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 30eaf02149ecc3c5815e45d27187bf09e925071d Author: Quanyang Wang Date: Fri Aug 26 22:20:30 2022 +0800 clk: zynqmp: pll: rectify rate rounding in zynqmp_pll_round_rate The function zynqmp_pll_round_rate is used to find a most appropriate PLL frequency which the hardware can generate according to the desired frequency. For example, if the desired frequency is 297MHz, considering the limited range from PS_PLL_VCO_MIN (1.5GHz) to PS_PLL_VCO_MAX (3.0GHz) of PLL, zynqmp_pll_round_rate should return 1.872GHz (297MHz * 5). There are two problems with the current code of zynqmp_pll_round_rate: 1) When the rate is below PS_PLL_VCO_MIN, it can't find a correct rate when the parameter "rate" is an integer multiple of *prate, in other words, if "f" is zero, zynqmp_pll_round_rate won't return a valid frequency which is from PS_PLL_VCO_MIN to PS_PLL_VCO_MAX. For example, *prate is 33MHz and the rate is 660MHz, zynqmp_pll_round_rate will not boost up rate and just return 660MHz, and this will cause clk_calc_new_rates failure since zynqmp_pll_round_rate returns an invalid rate out of its boundaries. 2) Even if the rate is higher than PS_PLL_VCO_MIN, there is still a risk that zynqmp_pll_round_rate returns an invalid rate because the function DIV_ROUND_CLOSEST makes some loss in the fractional part. If the parent clock *prate is 33333333Hz and we want to set the PLL rate to 1.5GHz, this function will return 1499999985Hz by using the formula below: value = *prate * DIV_ROUND_CLOSEST(rate, *prate)). This value is also invalid since it's slightly smaller than PS_PLL_VCO_MIN. because DIV_ROUND_CLOSEST makes some loss in the fractional part. Signed-off-by: Quanyang Wang Link: https://lore.kernel.org/r/20220826142030.213805-1-quanyang.wang@windriver.com Reviewed-by: Shubhrajyoti Datta Signed-off-by: Stephen Boyd commit 37eceb69205b2a98e67c48710c1e9ad5e78f21e9 Merge: 568035b01cfb1 ef96c458888fa Author: Stephen Boyd Date: Tue Aug 30 14:36:24 2022 -0700 Merge tag 'samsung-clk-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into clk-samsung Pull Samsung clk driverd updates from Krzysztof Kozlowski: - Exynos7885: add FSYS, TREX and MFC clock controllers. - Exynos850: add IS and AUD (audio) clock controllers with bindings. - ExynosAutov9: add FSYS clock controllers with bindings. - ExynosAutov9: correct clock IDs in bindings of Peric 0 and 1 clock controllers, due to duplicated entries. This is an acceptable ABI break: recently developed/added platform so without legacies, acked by known users/developers. - ExynosAutov9: add few missing Peric 0/1 gates. - ExynosAutov9: correct register offsets of few Peric 0/1 clocks. - Minor code improvements (use of_device_get_match_data() helper, code style). - Add Krzysztof Kozlowski as co-maintainer of Samsung SoC clocks, as he already maintainers that architecture/platform. * tag 'samsung-clk-6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: clk: samsung: MAINTAINERS: add Krzysztof Kozlowski clk: samsung: exynos850: Implement CMU_MFCMSCL domain clk: samsung: exynos850: Implement CMU_IS domain clk: samsung: exynos850: Implement CMU_AUD domain clk: samsung: exynos850: Style fixes clk: samsung: exynosautov9: add fsys1 clock support clk: samsung: exynosautov9: add fsys0 clock support clk: samsung: exynosautov9: correct register offsets of peric0/c1 clk: samsung: exynosautov9: add missing gate clks for peric0/c1 dt-bindings: clock: exynos850: Add Exynos850 CMU_MFCMSCL dt-bindings: clock: exynos850: Add Exynos850 CMU_IS dt-bindings: clock: exynos850: Add Exynos850 CMU_AUD dt-bindings: clock: exynosautov9: add schema for cmu_fsys0/1 dt-bindings: clock: exynosautov9: add fsys1 clock definitions dt-bindings: clock: exynosautov9: add fys0 clock definitions clk: samsung: exynos7885: Add TREX clocks clk: samsung: exynos7885: Implement CMU_FSYS domain dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1 clk: samsung: exynos-clkout: Use of_device_get_match_data() commit f8f7f47d576f7f5d44ef9237f356bd6d42002614 Author: Andy Shevchenko Date: Tue Aug 30 14:15:18 2022 -0700 Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count() As a preparation to unexport of_gpio_named_count(), convert the driver to use gpiod_count() instead. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220830183552.50695-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov commit c5872d6a04d24b7de095fe446896c35cb7bae465 Author: Andy Shevchenko Date: Tue Aug 30 14:14:53 2022 -0700 Input: clps711x-keypad - get rid of OF_GPIO dependency There is no such dependency in the driver, but it's implicitly used to have OF property APIs available. Replace that by device property API and get rid of OF_GPIO dependency. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220830182839.47965-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov commit 6354324d8a3e31108b53ac8ac6e9b67c9485d75a Author: Christian Göttsche Date: Tue Aug 30 17:52:49 2022 +0200 selinux: declare read-only parameters const Declare ebitmap, mls_level and mls_context parameters const where they are only read from. This allows callers to supply pointers to const as arguments and increases readability. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit c3fae2b2e690ab92ee1306cc22126240ab70e371 Author: Christian Göttsche Date: Tue Aug 30 17:45:00 2022 +0200 selinux: use int arrays for boolean values Do not cast pointers of signed integers to pointers of unsigned integers and vice versa. It should currently not be an issue since they hold SELinux boolean values which should only contain either 0's or 1's, which should have the same representation. Reported by sparse: .../selinuxfs.c:1485:30: warning: incorrect type in assignment (different signedness) .../selinuxfs.c:1485:30: expected unsigned int * .../selinuxfs.c:1485:30: got int *[addressable] values .../selinuxfs.c:1402:48: warning: incorrect type in argument 3 (different signedness) .../selinuxfs.c:1402:48: expected int *values .../selinuxfs.c:1402:48: got unsigned int *bool_pending_values Signed-off-by: Christian Göttsche [PM: minor whitespace fixes, sparse output cleanup] Signed-off-by: Paul Moore commit 91a95887891f1ab791171f32de99e9d9ed34c888 Author: ye xingchen Date: Tue Aug 30 08:32:43 2022 +0000 drm/amdgpu: Remove the unneeded result variable 'r' Return the value sdma_v4_0_start() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit e7c69a27cb94a86c3ab467fd297918494605859e Author: Hawking Zhang Date: Thu Aug 25 17:04:22 2022 -0400 drm/amdgpu: add new ip block for MES 11.0.3 Add ip block support for mes v11_0_3. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit a4d002d7d0747b76c5cb8934c25aa745d91926c2 Author: Hawking Zhang Date: Thu Aug 25 17:02:47 2022 -0400 drm/amdgpu: add new ip block for GFX 11.0 Add ip block support for gfx v11_0_3. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 2b5692345fc18b959ac7bc11550eee3a6fed04f1 Author: Hawking Zhang Date: Thu Aug 25 17:05:24 2022 -0400 drm/amdgpu: Set GC family for GC 11.0.3 Set AMDGPU_FAMILY_GC_11_0_0. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit f926464e59b7029b02d731a9f8a31419ff973ed3 Author: Hawking Zhang Date: Sat Jul 2 10:20:03 2022 +0800 drm/amdgpu: enable imu_rlc_ram programming for v11_0_3 All gc v11_0_3 registers in gcvml2 range have different register offset from the ones in gc v11_0_0. v11_0_3 imu_rlc_ram programming has to be separated from v11_0_0 implementation v2: fix checkpatch errors (Alex) Signed-off-by: Hawking Zhang Signed-off-by: Yang Wang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 5ddb5fe9e5a5c7f518a29df22c2f5af62cc74826 Author: David Belanger Date: Tue Jul 26 09:54:51 2022 -0400 drm/amdkfd: Added GFX 11.0.3 Support Added missing cases for GFX 11.0.3 code in a few switch statements. Signed-off-by: David Belanger Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a3813175c4b50a0cdf3e72fba3d560f43b4c9ecc Author: Hawking Zhang Date: Tue Jun 28 00:33:14 2022 +0800 drm/amdgpu: init gfx config for gfx v11_0_3 initialize some gfx config for gfx v11_0_3 Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 701a4ad97db690395237218f30875436f2a4b461 Author: Hawking Zhang Date: Thu Aug 25 16:57:57 2022 -0400 drm/amdgpu: declare firmware for new MES 11.0.3 To support new mes ip block Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit c6329e255d06fa908321ddd5077b804b9b3275fd Author: Hawking Zhang Date: Thu Aug 25 16:56:52 2022 -0400 drm/amdgpu: declare firmware for new GC 11.0.3 To support new gfx ip block Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 94ac32338e4f5372ff0bf956f069581096717885 Author: Hawking Zhang Date: Thu Aug 25 17:01:52 2022 -0400 drm/amdgpu: add new ip block for GMC 11.0 Add ip block support for gmc v11_0_3. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit fe09f343d58333f5e761bbdf4871092c6c867ffa Author: Hawking Zhang Date: Tue Jun 28 00:35:07 2022 +0800 drm/amdgpu: initialize gmc sw config for v11_0_3 initialize gmc sw config for v11_0_3 Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 9436ac31c73526b1e070c050ee83c3870125bf82 Author: Yang Wang Date: Fri Jul 1 17:19:27 2022 +0800 drm/amdgpu: add gfxhub_v3_0_3 support add gfxhub_v3_0_3 support Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit a40a92af46113e200b9110c4040a465771d28b35 Author: Frank Min Date: Mon Jun 27 11:05:43 2022 +0800 drm/amdgpu: add gc v11_0_3 ip headers Add gc v11_0_3 register offset and shift masks header files v2: update registers (Alex) Signed-off-by: Frank Min Signed-off-by: Hawking Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d5f476edc5b58916d05a7a5b87fa8ecc9d847f71 Author: Hawking Zhang Date: Tue Aug 30 15:47:47 2022 +0800 drm/amdgpu: only init tap_delay ucode when it's included in ucode binary Not all the gfx10 variants need to integrate global tap_delay and per se tap_delay firmwares Only init tap_delay ucode when it does include in rlc ucode binary so driver doesn't send a null buffer to psp for firmware loading Signed-off-by: Hawking Zhang Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 5698f08169b905ed215fa7f45e89b42283ed0554 Author: ye xingchen Date: Tue Aug 30 08:41:24 2022 +0000 selinux: remove an unneeded variable in sel_make_class_dir_entries() Return the value sel_make_perm_files() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen [PM: subject line tweak] Signed-off-by: Paul Moore commit abec3d015fdfb7c63105c7e1c956188bf381aa55 Author: Ondrej Mosnacek Date: Fri Jul 8 11:34:51 2022 +0200 userfaultfd: open userfaultfds with O_RDONLY Since userfaultfd doesn't implement a write operation, it is more appropriate to open it read-only. When userfaultfds are opened read-write like it is now, and such fd is passed from one process to another, SELinux will check both read and write permissions for the target process, even though it can't actually do any write operation on the fd later. Inspired by the following bug report, which has hit the SELinux scenario described above: https://bugzilla.redhat.com/show_bug.cgi?id=1974559 Reported-by: Robert O'Callahan Fixes: 86039bd3b4e6 ("userfaultfd: add new syscall to provide memory externalization") Signed-off-by: Ondrej Mosnacek Acked-by: Peter Xu Acked-by: Christian Brauner (Microsoft) Signed-off-by: Paul Moore commit bf2ce3855c7d446669f89999d523d91048b0daf9 Author: Heiko Carstens Date: Mon Aug 29 14:26:56 2022 +0200 s390/mm: remove unused access parameter from do_fault_error() Remove unused access parameter from do_fault_error() which also makes the code a bit more readable since quite some callers can be simplified. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 9aa10e791c2b722cf166f46424a6a8364164fe12 Author: Heiko Carstens Date: Mon Aug 29 14:17:28 2022 +0200 s390/delay: sync comment within __delay() with reality The comment within __delay() is outdated and does not reflect anymore what the function is doing. Therefore replace the comment. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 820109fb11f24baf16ed86e232939877df3e9f0c Author: Wolfram Sang Date: Thu Aug 18 22:59:47 2022 +0200 s390: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Jakub Kicinski Acked-by: Benjamin Block Acked-by: Alexandra Winter Link: https://lore.kernel.org/r/20220818205948.6360-1-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20220818210102.7301-1-wsa+renesas@sang-engineering.com [gor@linux.ibm.com: squashed two changes linked above together] Signed-off-by: Vasily Gorbik commit 73c7a8a871dc9aa6b7876c1a30bdbe0f899eb4f6 Author: Matt Roper Date: Fri Aug 26 14:27:18 2022 -0700 drm/i915/ats-m: Add thread execution tuning setting On client DG2 platforms, optimal performance is achieved with the hardware's default "age based" thread execution setting. However on ATS-M, switching this to "round robin after dependencies" provides better performance. We'll add a new "tuning" feature flag to the ATS-M device info to enable/disable this setting. Bspec: 68331 Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20220826212718.409948-1-matthew.d.roper@intel.com commit d9927abb4594ba940b3ed1dd86fa0447faf13a7b Author: Matt Roper Date: Fri Aug 26 14:02:33 2022 -0700 Revert "drm/i915/dg2: Add preemption changes for Wa_14015141709" This reverts commit ca6920811aa5428270dd78af0a7a36b10119065a. The intent of Wa_14015141709 was to inform us that userspace can no longer control object-level preemption as it has on past platforms (i.e., by twiddling register bit CS_CHICKEN1[0]). The description of the workaround in the spec wasn't terribly well-written, and when we requested clarification from the hardware teams we were told that on the kernel side we should also probably stop setting FF_SLICE_CS_CHICKEN1[14], which is the register bit that directs the hardware to honor the settings in per-context register CS_CHICKEN1. It turns out that this guidance about FF_SLICE_CS_CHICKEN1[14] was a mistake; even though CS_CHICKEN1[0] is non-operational and useless to userspace, there are other bits in the register that do still work and might need to be adjusted by userspace in the future (e.g., to implement other workarounds that show up). If we don't set FF_SLICE_CS_CHICKEN1[14] in i915, then those future workarounds would not take effect. This miscommunication came to light because another workaround (Wa_16013994831) has now shown up that requires userspace to adjust the value of CS_CHICKEN[10] in certain circumstances. To ensure userspace's updates to this chicken bit are handled properly by the hardware, we need to make sure that FF_SLICE_CS_CHICKEN1[14] is once again set by the kernel. Signed-off-by: Matt Roper Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20220826210233.406482-1-matthew.d.roper@intel.com commit 72c976fc3a4b3ff264127f4ced7c06f35cede858 Author: Rafael J. Wysocki Date: Tue Aug 30 20:15:38 2022 +0200 thermal: gov_user_space: Do not lock thermal zone mutex Commit 670a5e356cb6 ("thermal/core: Move the thermal zone lock out of the governors") moved thermal zone locking away from governors, but it forgot about the user space one which deadlocks now. Fix this by removing the thermal zone locking from the user space governor. Fixes: 670a5e356cb6 ("thermal/core: Move the thermal zone lock out of the governors") Tested-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki commit fb43eb0a930ca9474484b1ff04c3fd532efdc8e3 Author: Sebastian Reichel Date: Tue Aug 30 14:44:52 2022 +0200 spi: spi-rockchip: Add rk3588-spi compatible This adds a compatible string for the SPI controller found in the RK3588 and RK3588s SoCs. Signed-off-by: Sebastian Reichel Acked-by: Krzysztof Kozlowski Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220830124452.33561-1-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 6f95de6d713130c953af0a40b13c1da519f91c4e Author: Hao Luo Date: Mon Aug 29 16:18:28 2022 -0700 bpftool: Add support for querying cgroup_iter link Support dumping info of a cgroup_iter link. This includes showing the cgroup's id and the order for walking the cgroup hierarchy. Example output is as follows: > bpftool link show 1: iter prog 2 target_name bpf_map 2: iter prog 3 target_name bpf_prog 3: iter prog 12 target_name cgroup cgroup_id 72 order self_only > bpftool -p link show [{ "id": 1, "type": "iter", "prog_id": 2, "target_name": "bpf_map" },{ "id": 2, "type": "iter", "prog_id": 3, "target_name": "bpf_prog" },{ "id": 3, "type": "iter", "prog_id": 12, "target_name": "cgroup", "cgroup_id": 72, "order": "self_only" } ] Signed-off-by: Hao Luo Reviewed-by: Quentin Monnet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20220829231828.1016835-1-haoluo@google.com Signed-off-by: Martin KaFai Lau commit ced579dcaaa45fe16ac6c12fe847d650734af7bb Author: Syed Saba kareem Date: Tue Aug 30 18:52:55 2022 +0530 ASoC: amd: fix spelling mistake: "i.e" -> "i.e." trivial fix to spelling mistake in Kconfig File. Reported by : Randy Dunlap Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20220830132259.7759-1-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 673e71df5ccfaefeb32bb5b3130a5d397b742194 Author: Chengci.Xu Date: Wed Aug 17 20:46:08 2022 +0800 memory: mtk-smi: mt8188: Add SMI Support Add mt8188 smi common & larb support Signed-off-by: Chengci.Xu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817124608.10062-5-chengci.xu@mediatek.com commit 4e508b259ed02f5fa608cdd83b817a7f49c22271 Author: Chengci.Xu Date: Wed Aug 17 20:46:07 2022 +0800 memory: mtk-smi: Add enable IOMMU SMC command for MM master For concerns about security, the register to enable/disable IOMMU of SMI LARB should only be configured in secure world. Thus, we add some SMC command for multimedia master to enable/disable MM IOMMU in ATF by setting the register of SMI LARB. This function is prepared for MT8188. Signed-off-by: Chengci.Xu Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817124608.10062-4-chengci.xu@mediatek.com commit 8c1561edc0692fa8e321daf2777c3c32454b5748 Author: Chengci.Xu Date: Wed Aug 17 20:46:06 2022 +0800 memory: mtk-smi: Add return value for configure port function In MT8188, the register to enable/disable IOMMU can only be configured in secure world by SMC call. We should add a return value for configure port function for preparation because SMC call may return an error result. Signed-off-by: Chengci.Xu Reviewed-by: Yong Wu Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817124608.10062-3-chengci.xu@mediatek.com commit 9d9fde47430298455544b283cffa390c40d58bfc Author: Chengci.Xu Date: Wed Aug 17 20:46:05 2022 +0800 dt-bindings: memory: mediatek: Add mt8188 smi binding Add mt8188 smi supporting in the bindings. In mt8188, there are two smi-common HW, one is for vdo(video output), the other is for vpp(video processing pipe). They connect with different smi-larbs, then some setting(bus_sel) is different. Differentiate them with the compatible string. Something like this: IOMMU(VDO) IOMMU(VPP) | | SMI_COMMON_VDO SMI_COMMON_VPP ---------------- ---------------- | | ... | | ... larb0 larb2 ... larb1 larb3 ... Signed-off-by: Chengci.Xu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220817124608.10062-2-chengci.xu@mediatek.com commit f5ffeca5086fef68765f3c1dbc9a12183833adf0 Author: Shreeya Patel Date: Fri Aug 12 15:34:24 2022 +0530 iio: light: ltrf216a: Add raw attribute Add IIO_CHAN_INFO_RAW to the mask to be able to read raw values from the light sensor. The userspace code for brightness control in steam deck uses the in_illuminance_input value through sysfs and multiplies it with a constant stored in BIOS at factory calibration time. The downstream driver for LTRF216A that we have been using has incorrect formula for LUX calculation which we corrected in the upstreamed driver. Now to be able to use the upstreamed driver, we need to add some magic in userspace so that the brightness control works like before even with the updated LUX formula. Hence, we need the raw data to calculate a constant that can be added in userspace code. Downstream driver LUX formula :- (greendata*8*LTRF216A_WIN_FAC) / (data->als_gain_fac*data->int_time_fac*10) Upstreamed driver LUX formula :- (greendata*45*LTRF216A_WIN_FAC) / (data->als_gain_fac*data->int_time_fac) greendata is the ALS_DATA which we would like to get through sysfs using the raw attribute. Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220812100424.529425-1-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit c682c96334cb790930c814e58e33d5e0df600a63 Author: Rob Herring Date: Tue Aug 23 09:56:33 2022 -0500 dt-bindings: iio: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-2-robh@kernel.org Signed-off-by: Jonathan Cameron commit 1b55d33e027478f2234ef5c4f6d07be990539928 Author: Antoniu Miclaus Date: Wed Aug 24 20:09:13 2022 +0300 MAINTAINERS: fix Analog Devices forum links Fix the links to redirect to the correct forum subsection for the latest Analog Devices drivers added. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20220824170913.13411-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 1cf507cfddd38724abeed2298c994c606aff89a9 Author: wangjianli Date: Tue Aug 23 22:00:23 2022 +0800 iio/accel: fix repeated words in comments Delete the redundant word 'in'. Signed-off-by: wangjianli Link: https://lore.kernel.org/r/20220823140023.2567-1-wangjianli@cdjrlc.com Signed-off-by: Jonathan Cameron commit 4eba8239c8ce419e53813d02251a46c27597fe73 Author: Dmitry Rokosov Date: Mon Aug 22 17:49:26 2022 +0000 dt-bindings: iio: accel: add dt-binding schema for msa311 accel driver Introduce devicetree binding json-schema for MSA311 tri-axial, low-g accelerometer driver. Signed-off-by: Dmitry Rokosov Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220822175011.2886-5-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit 1ca2cfbc0c337ed3a3c817f84f9fcf0d32203f73 Author: Dmitry Rokosov Date: Mon Aug 22 17:49:25 2022 +0000 iio: add MEMSensing MSA311 3-axis accelerometer driver MSA311 is a tri-axial, low-g accelerometer with I2C digital output for sensitivity consumer applications. It has dynamic user-selectable full scales range of +-2g/+-4g/+-8g/+-16g and allows acceleration measurements with output data rates from 1Hz to 1000Hz. This driver supports following MSA311 features: - IIO interface - Different power modes: NORMAL and SUSPEND (using pm_runtime) - ODR (Output Data Rate) selection - Scale and samp_freq selection - IIO triggered buffer, IIO reg access - NEW_DATA interrupt + trigger Below features to be done: - Motion Events: ACTIVE, TAP, ORIENT, FREEFALL - Low Power mode Datasheet: https://cdn-shop.adafruit.com/product-files/5309/MSA311-V1.1-ENG.pdf Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220822175011.2886-4-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit e6545831a17beaa724f29e79d8a12050b45da243 Author: Douglas Anderson Date: Mon Aug 22 10:53:59 2022 -0700 MAINTAINERS: Add myself as a reviewer for panel-edp.c panel-edp changes go through the drm-misc tree (as per the "DRM PANEL DRIVERS" entry in MAINTAINERS), but ever since splitting panel-edp out of panel-simple I've been trying to keep a close eye on it. Make that official by listing me as a reviewer. Signed-off-by: Douglas Anderson Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220822105340.1.I66a9a5577f9b0af66492ef13c47bc78ed85e5d6b@changeid commit 6d29e08007c520a759cab710a591aa336d010bfe Author: Philipp Hortmann Date: Sun Aug 28 08:54:52 2022 +0200 staging: vt6655: Rename function MACvSetShortRetryLimit Rename function MACvSetShortRetryLimit to vt6655_mac_set_short_retry_limit and byRetryLimit to retry_limit to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/d04b82510853607f439b4d969d4ce4b1883e9de8.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fac7007f26649c08738e4e35d91965ad08a9ac66 Author: Philipp Hortmann Date: Sun Aug 28 08:54:30 2022 +0200 staging: vt6655: Delete function MACbIsIntDisable Delete function MACbIsIntDisable as it is unused and the name is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2cf96b9b7cf576bdd9d17e54acbc765690b7900b.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0f3c86877d3f813ea7adb740bf88d4bd3aa76c7f Author: Philipp Hortmann Date: Sun Aug 28 08:54:18 2022 +0200 staging: vt6655: Rename function MACbIsRegBitsOff Remove declaration of MACbIsRegBitsOff as it is not needed. Rename function MACbIsRegBitsOff to vt6655_mac_is_reg_bits_off, rename byRegOfs to reg_offset and byTestBits to mask to avoid CamelCase which is not accepted by checkpatch.pl. Made function static to keep namespace clean. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/79530d864d4e39e29b899b80f2e2ecf0566366dc.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4f7730e02a4af3e48b465ff15e5b61a8eb057842 Author: Philipp Hortmann Date: Sun Aug 28 08:54:12 2022 +0200 staging: vt6655: Replace macro MACvSetRFLE_LatchBase Replace macro MACvSetRFLE_LatchBase with the called function as it is just used once and to avoid CamelCase which is not accepted by checkpatch.pl. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/624068fef03d5226e3fb2d31d47e9dabc5562b3c.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8809cc889eabe01315f75937cd5ed3fa626cc7ea Author: Philipp Hortmann Date: Sun Aug 28 08:54:04 2022 +0200 staging: vt6655: Rename macro MACvSelectPage1 Rename MACvSelectPage1 macro to VT6655_MAC_SELECT_PAGE1 to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8aa03e089613d49be7acedcb60a19a0133e96baa.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 54765727cfe6283061d6a1e0fad8a1f46bdbef05 Author: Philipp Hortmann Date: Sun Aug 28 08:53:55 2022 +0200 staging: vt6655: Rename macro MACvSelectPage0 Rename MACvSelectPage0 macro to VT6655_MAC_SELECT_PAGE0 to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Remove unnecessary line break. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/a656aa0e04c43654ba22b764cb00e27898efbe5f.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b1d3ecbf146e46326e96c5503fa9ce7dab45159e Author: Philipp Hortmann Date: Sun Aug 28 08:53:47 2022 +0200 staging: vt6655: Rename function MACvSetBBType Rename MACvSetBBType function to vt6655_mac_set_bb_type to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/44d0151d67e2a76e1cf3d88d254defa96990b142.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 52b735c96aab0e1753fe268f2985633608502bce Author: Philipp Hortmann Date: Sun Aug 28 08:53:29 2022 +0200 staging: vt6655: Convert macro MACvSetBBType to function Convert macro to static function. Multiline macros are not liked by kernel community. Rename variable dwOrgValue to reg_value and byTyp to mask to avoid CamelCase which is not accepted by checkpatch.pl. Change variable declaration to u32 as this improves readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bd512f940427615ed4b134dd04f14095875eec5b.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 87dec3259afb1d821db5deea6ea273ea41951af3 Author: Philipp Hortmann Date: Sun Aug 28 08:53:15 2022 +0200 staging: vt6655: Remove declaration of s_vCalculateOFDMRParameter Remove declaration of s_vCalculateOFDMRParameter as definition follows just behind. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/d2d6cd4a8888e4606255276b4f86e2c11487a3a2.1661666677.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a9289fed1d3114546b6de870f2b8613c9e693eb6 Author: Alman Khan Date: Fri Aug 26 12:35:36 2022 +0100 staging: rtl8192e: Describe each kernel config option An important thing people want to know is what each option that they select in their kernel configuration file actually does, so that they can select the right options for their system, and, once booted, make sure their hardware works as expected. Add more details describing each option in the kernel configuration for the rtl8192e (rtllib) driver so that the end-user understands what they mean, and, if necessary, enables/disables those features if they are not required. Signed-off-by: Alman Khan Link: https://lore.kernel.org/r/d053abd3e60d3f2d7724d6857c28a6a255b4f46b.camel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0b599cc63a8e09c067df4ab49af8573c2ce18673 Author: Yu Zhe Date: Fri Aug 26 10:01:51 2022 +0800 staging: r8188eu: use time_after_eq(a,b) to replace "a>=b" time_after_eq() deals with timer wrapping correctly. Signed-off-by: Yu Zhe Link: https://lore.kernel.org/r/20220826020151.10138-1-yuzhe@nfschina.com Signed-off-by: Greg Kroah-Hartman commit 700f7e2909842a9cb8e98678c2e579a43ac750fd Author: Jilin Yuan Date: Thu Aug 25 20:26:45 2022 +0800 staging/rtl8192e: fix repeated words in comments Delete the redundant word 'new'. Signed-off-by: Jilin Yuan Link: https://lore.kernel.org/r/20220825122645.27588-1-yuanjilin@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit cc3f011b6ea2abfadc73fbc6b490282ab842c916 Author: Philipp Hortmann Date: Wed Aug 24 22:14:49 2022 +0200 staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet Remove macro that replaces PHY_SetRFPowerState with rtl92e_set_rf_power_state and rename StateToSet to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ae69fd4a09900a395de40b7cfc4fd8af81e63e13.1661370978.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit e7254145551b1b5f61579ef4db2b70a82415896f Author: Philipp Hortmann Date: Wed Aug 24 22:14:43 2022 +0200 staging: rtl8192e: Remove Unnecessary ftrace-like logging Remove "Unnecessary ftrace-like logging" as requested by checkpatch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5240b86941ebf3a290d384744d117d436e7bad41.1661370978.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 254d6fca9d38f9c87751c5cd0f06249217bcd967 Author: Philipp Hortmann Date: Wed Aug 24 22:14:39 2022 +0200 staging: rtl8192e: Rename Tx... and RxCheckStuckHandler Variable name TxCheckStuckHandler and RxCheckStuckHandler is changed to avoid CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3041cec77df10cdff18d5466beb3b0616370b112.1661370978.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9ec1006146032eef31adb6599dcda6d4ac9b629 Author: Philipp Hortmann Date: Wed Aug 24 22:14:34 2022 +0200 staging: rtl8192e: Remove blank lines in rtl_core.c Remove blank lines as requested by checkpatch. Reasons are "multiple blank lines", "Blank lines aren't necessary after an open brace" and "Blank lines aren't necessary before a close brace". Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/32e831619a91f00cc37e04a2da1a9aeda2ad90a0.1661370978.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit d38ba8ccd9c22b177d50f896a1bdc2f0979b343f Author: Yosry Ahmed Date: Tue Aug 23 00:46:39 2022 +0000 KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats Count the pages used by KVM in arm64 for stage2 mmu in memory stats under secondary pagetable stats (e.g. "SecPageTables" in /proc/meminfo) to give better visibility into the memory consumption of KVM mmu in a similar way to how normal user page tables are accounted. Signed-off-by: Yosry Ahmed Reviewed-by: Oliver Upton Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220823004639.2387269-5-yosryahmed@google.com Signed-off-by: Sean Christopherson commit 43a063cab325ee7cc50349967e536b3cd4e57f03 Author: Yosry Ahmed Date: Tue Aug 23 00:46:37 2022 +0000 KVM: x86/mmu: count KVM mmu usage in secondary pagetable stats. Count the pages used by KVM mmu on x86 in memory stats under secondary pagetable stats (e.g. "SecPageTables" in /proc/meminfo) to give better visibility into the memory consumption of KVM mmu in a similar way to how normal user page tables are accounted. Add the inner helper in common KVM, ARM will also use it to count stats in a future commit. Signed-off-by: Yosry Ahmed Reviewed-by: Sean Christopherson Acked-by: Marc Zyngier # generic KVM changes Link: https://lore.kernel.org/r/20220823004639.2387269-3-yosryahmed@google.com Link: https://lore.kernel.org/r/20220823004639.2387269-4-yosryahmed@google.com [sean: squash x86 usage to workaround modpost issues] Signed-off-by: Sean Christopherson commit 61890ccaefaff89f5babd2c8412fd222c3f5fe38 Author: Moudy Ho Date: Tue Aug 23 04:38:03 2022 +0200 media: platform: mtk-mdp3: add MediaTek MDP3 driver This patch adds driver for MediaTek's Media Data Path ver.3 (MDP3). It provides the following functions: color transform, format conversion, resize, crop, rotate, flip and additional image quality enhancement. The MDP3 driver is mainly used for Google Chromebook products to import the new architecture to set the HW settings as shown below: User -> V4L2 framework -> MDP3 driver -> SCP (setting calculations) -> MDP3 driver -> CMDQ (GCE driver) -> HW Each modules' related operation control is sited in mtk-mdp3-comp.c Each modules' register table is defined in file with "mdp_reg_" prefix GCE related API, operation control sited in mtk-mdp3-cmdq.c V4L2 m2m device functions are implemented in mtk-mdp3-m2m.c Probe, power, suspend/resume, system level functions are defined in mtk-mdp3-core.c [hverkuil: add 'depends on REMOTEPROC'] Signed-off-by: Ping-Hsun Wu Signed-off-by: daoyuan huang Signed-off-by: Moudy Ho Tested-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8d40a13bc35da6c68f3beb44d7d4b21ea247366d Merge: 7c13844c3b766 b383e8abed41c Author: Kalle Valo Date: Tue Aug 30 17:23:40 2022 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.1. Only fixes this time. commit 8bbdead4dede97d8737bd4d164ff9c0a7d03a4b8 Author: Moudy Ho Date: Tue Aug 23 04:38:01 2022 +0200 media: dt-binding: mediatek: add bindings for MediaTek CCORR and WDMA This patch adds DT binding documentation for MediaTek's CCORR and WDMA components. These components exist in both MediaTek's Media Data Path 3(MDP3) and DRM, and the bindings are placed under the folder "./soc/mediatek" to prevent duplicate builds. Signed-off-by: Moudy Ho Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4ad7b39623ab04f8366fbbbbd3caea86aacf5f12 Author: Moudy Ho Date: Tue Aug 23 04:38:00 2022 +0200 media: dt-binding: mediatek: add bindings for MediaTek MDP3 components This patch adds DT binding documents for Media Data Path 3 (MDP3) a unit in multimedia system combined with several components and used for scaling and color format convert. Signed-off-by: Moudy Ho Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1c78f19c3a0ea312a8178a6bfd8934eb93e9b10a Author: Miaoqian Lin Date: Wed Jun 1 06:25:14 2022 +0200 media: xilinx: vipp: Fix refcount leak in xvip_graph_dma_init of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: df3305156f98 ("[media] v4l: xilinx: Add Xilinx Video IP core") Signed-off-by: Miaoqian Lin Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit d6a1feba5dcabb6cae9e005714baa80bb37819b1 Author: Volodymyr Kharuk Date: Thu Jul 14 10:34:44 2022 +0200 media: xilinx: video: Add 1X12 greyscale format Extend the xilinx video driver with Y12_1X12 greyscale format Signed-off-by: Volodymyr Kharuk Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 1a4f8d7d1874df483e6c6b3685fe2a1f51ed0086 Author: Volodymyr Kharuk Date: Thu Jul 14 10:34:43 2022 +0200 media: xilinx: csi2rxss: Add 1X12 greyscale format Extend the csi2rxss with Y12_1X12 greyscale format Signed-off-by: Volodymyr Kharuk Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 546fad2c35562aed7bdc6bb86f03c05e59373219 Author: Petko Manolov Date: Sat Jul 9 09:31:00 2022 +0200 media: staging: media: imx: imx7-media-csi: Increase video mem limit Some high resolution (like Sony IMX492 47Mpix) sensors requre large amount space for buffering. 64MB is far from sufficient so this patch increases the limit to 512MB. Signed-off-by: Petko Manolov Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 101418b374c94f321572d03610f0c9315caf70c7 Author: huanglei Date: Sat Aug 20 02:56:58 2022 +0200 media: uvcvideo: Limit power line control for Sonix Technology The device does not implement the power line control correctly. Add a corresponding control mapping override. Bus 003 Device 003: ID 3277:0072 Sonix Technology Co., Ltd. USB 2.0 Camera Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x3277 idProduct 0x0072 bcdDevice 1.00 iManufacturer 2 Sonix Technology Co., Ltd. iProduct 1 USB 2.0 Camera iSerial 3 REV0001 bNumConfigurations 1 Signed-off-by: huanglei Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 5f36851c36b30f713f588ed2b60aa7b4512e2c76 Author: Yunke Cao Date: Thu Jul 7 10:53:31 2022 +0200 media: uvcvideo: Use entity get_cur in uvc_ctrl_set Entity controls should get_cur using an entity-defined function instead of via a query. Fix this in uvc_ctrl_set. Fixes: 65900c581d01 ("media: uvcvideo: Allow entity-defined get_info and get_cur") Signed-off-by: Yunke Cao Reviewed-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 4c24425488731b401bc64a1ea102ffbd06ae89fd Author: Slark Xiao Date: Fri Jul 22 09:13:43 2022 +0200 media: uvcvideo: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit c58874df1051c2baee8dabb8c476c3e476923923 Author: Laurent Pinchart Date: Mon Jul 18 13:56:54 2022 +0200 media: uvcvideo: Use indexed loops in uvc_ctrl_init_ctrl() As shown by the bug introduced in commit 86f7ef773156 ("media: uvcvideo: Add support for per-device control mapping overrides"), the loop style used by uvc_ctrl_init_ctrl() is error-prone. Rewrite the loops to use indices instead. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit f0f078457f18f10696888f8d0e6aba9deb9cde92 Author: José Expósito Date: Sat Jan 8 18:04:39 2022 +0100 media: uvcvideo: Fix memory leak in uvc_gpio_parse Previously the unit buffer was allocated before checking the IRQ for privacy GPIO. In case of error, the unit buffer was leaked. Allocate the unit buffer after the IRQ to avoid it. Addresses-Coverity-ID: 1474639 ("Resource leak") Fixes: 2886477ff987 ("media: uvcvideo: Implement UVC_EXT_GPIO_UNIT") Signed-off-by: José Expósito Reviewed-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 882bda188f691320a001c6adc738c4a7ec102a8d Author: Biju Das Date: Sun Aug 28 10:13:34 2022 +0200 media: renesas: vsp1: Add support for RZ/G2L VSPD The RZ/G2L VSPD provides a single VSPD instance. It has the following sub modules MAU, CTU, RPF, DPR, LUT, BRS, WPF and LIF. The VSPD block on RZ/G2L SoCs does not have a version register, so added a new compatible string "renesas,r9a07g044-vsp2" with a data pointer containing the info structure. Also the reset line is shared with the DU module. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 4d728fd4c60e0f367321843290a618caf86b95cd Author: Biju Das Date: Sun Aug 28 10:13:33 2022 +0200 media: renesas: vsp1: Add VSP1_HAS_NON_ZERO_LBA feature bit As per HW manual V3M and RZ/G2L SoCs has nonzero LIF buffer attributes. So, introduce a feature bit for handling the same. This patch also adds separate device info structure for V3M and V3H SoCs, as both these SoCs share the same model ID, but V3H does not have VSP1_HAS_NON_ZERO_LBA feature bit. Signed-off-by: Biju Das Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 9c63902745020ca415806064ca8694b983ea436e Author: Biju Das Date: Sun Aug 28 10:13:32 2022 +0200 media: renesas: vsp1: Add support for VSP software version The VSPD block on RZ/G2L SoCs does not have a version register. This patch adds support for adding VSP software version based on device match. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 24c52aa35a00284c66eb3bfa9ff811d440fe6c14 Author: Biju Das Date: Sun Aug 28 10:13:31 2022 +0200 media: renesas: vsp1: Add support to deassert/assert reset line As the resets DT property is mandatory, and is present in all .dtsi in mainline, add support to perform deassert/assert using reference counted reset handle. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Reviewed-by: Philipp Zabel Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 17b5179ef6cd6430945c1da4174ceaf43c93cf1e Author: Biju Das Date: Sun Aug 28 10:13:30 2022 +0200 media: dt-bindings: media: renesas,vsp1: Document RZ/G2L VSPD bindings Document VSPD found in RZ/G2L SoC. VSPD block is similar to VSP2-D found on R-Car SoC's, but it does not have a version register and it has 3 clocks compared to 1 clock on vsp1 and vsp2. This patch introduces a new compatible 'renesas,r9a07g044-vsp2' to handle these differences. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Krzysztof Kozlowski Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 4029372233e13e281f8c387f279f9f064ced3810 Author: Xu Qiang Date: Thu Aug 18 08:57:53 2022 +0200 media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() Add the missing clk_disable_unprepare() before return from vdec_hevc_start() in the error handling case. Fixes: 823a7300340e (“media: meson: vdec: add common HEVC decoder support”) Signed-off-by: Xu Qiang Reviewed-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0202a665bf17fbe98fed954944aabbcb4f14a4cc Author: Ming Qian Date: Thu Aug 18 05:18:21 2022 +0200 media: amphion: fix a bug that vpu core may not resume after suspend driver will enable the vpu core when request the first instance on the core. one vpu core can only support 8 streaming instances in the same time, the instance won't be added to core's list before streamon. so the actual instance count may be greater then the number in the core's list. in pm resume callback, driver will resume the core immediately if core's list is not empty. but this check is not accurate, if suspend during one instance is requested, but not streamon, then after suspend, the core won't be resume, and led to instance failure. use the request_count instead of the core's list to check whether is the core needed to resume immediately after suspend. And it can make the pm suspend and resume callback more clear. Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c8c5d5e89ac52a462f48264863a7a32f0c76fa1d Author: Johan Hovold Date: Tue Aug 30 13:29:23 2022 +0200 phy: qcom-qmp-usb: drop pipe clock lane suffix The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name. Update driver to support the new binding where the pipe clock name has been deprecated by instead requesting the clock by index. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-31-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 5337b248ad848b5c4e5fd564afdc34d98ce2ca1d Author: Johan Hovold Date: Tue Aug 30 13:29:22 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop reset lane suffix The lane reset is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the reset name. Update driver to support the new binding where the "lane" reset name has been deprecated by instead requesting the reset by index. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-30-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 302db460333622b940cb8df1a3a140ab774445c1 Author: Johan Hovold Date: Tue Aug 30 13:29:21 2022 +0200 phy: qcom-qmp-pcie-msm8996: drop pipe clock lane suffix The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name. Update driver to support the new binding where the pipe clock name has been deprecated by instead requesting the clock by index. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-29-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 70e25cac53a0239bffa0540e26dca2917662cea9 Author: Johan Hovold Date: Tue Aug 30 13:29:20 2022 +0200 phy: qcom-qmp-combo: drop pipe clock lane suffix The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name. Update driver to support the new binding where the pipe clock name has been deprecated by instead requesting the clock by index. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-28-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 27759490cfa344ec326592015a9618ec05c2184f Author: Johan Hovold Date: Tue Aug 30 13:29:19 2022 +0200 phy: qcom-qmp-combo: drop unused lane reset Drop the unused lane reset pointer which isn't used by any combo PHY. Reviewed-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-27-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit f8432544f9779a6300262fc0747ada2c17f1a02d Author: Johan Hovold Date: Tue Aug 30 13:29:18 2022 +0200 phy: qcom-qmp-pcie: drop pipe clock lane suffix The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name. Update driver to support the new binding where the pipe clock name has been deprecated by instead requesting the clock by index. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-26-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 735441e1c45c1ef187341e02015dcf4884b19e8d Author: Johan Hovold Date: Tue Aug 30 13:29:17 2022 +0200 dt-bindings: phy: qcom,qmp-usb3-dp: deprecate USB PIPE clock name Deprecate the USB PHY node 'clock-names' property which specified that the PIPE clock name should have a bogus "lane" suffix. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-25-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit dc47bcb727cfffb40cf85d54474c57a83aee8a03 Author: Johan Hovold Date: Tue Aug 30 13:29:16 2022 +0200 dt-bindings: phy: qcom,qmp-usb3-dp: fix bogus clock-cells property The QMP PHY wrapper node is not a clock provider so drop the bogus '#clock-cells' property that was added when converting to DT schema. Fixes: 59351049ad15 ("dt-bindings: phy: qcom,qmp-usb3-dp: Add dt bindings for USB3 DP PHY") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-24-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit b6e4bc6b0f97ba3ca0dcf7112a9576b98ae0e6dd Author: Johan Hovold Date: Tue Aug 30 13:29:15 2022 +0200 dt-bindings: phy: qcom,qmp-usb: add missing qcom,sc7180-qmp-usb3-phy schema The "qcom,sc7180-qmp-usb3-phy" compatible is apparently used to describe a combo PHY where only the USB part is used. Specifically, only a single reset is used. Fixes: 4ad7d7eeed3a ("dt-bindings: phy: qcom,qmp-usb3-dp: Add support for SC7180") Fixes: 94c34600b617 ("dt-bindings: phy: qcom,qmp-usb3-dp-phy: move usb3 compatibles back to qcom,qmp-phy.yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-23-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 5acdb255c5400546deaa43e9bd1e839986463d89 Author: Johan Hovold Date: Tue Aug 30 13:29:14 2022 +0200 dt-bindings: phy: qcom,qmp-usb: deprecate PIPE clock name Deprecate the PHY node 'clock-names' property which specified that the PIPE clock name should have a bogus "lane" suffix. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-22-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ac32e3e5e536c37fcac1ed655d687cdc77642552 Author: Johan Hovold Date: Tue Aug 30 13:29:13 2022 +0200 dt-bindings: phy: qcom,qmp-usb: add missing child node schema Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-21-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ea5fc4a1ea909e530d7c89a54faabc8c8407e49a Author: Johan Hovold Date: Tue Aug 30 13:29:12 2022 +0200 dt-bindings: phy: add QMP USB PHY schema The QMP PHY DT schema is getting unwieldy. Break out the USB PHY binding in a separate file. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-20-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ec9cafa6892a2514b0dfa88a8046b2a40baca4d6 Author: Johan Hovold Date: Tue Aug 30 13:29:11 2022 +0200 dt-bindings: phy: qcom,qmp-ufs: add missing child node schema Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-19-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 9909228efbb098ac2bcdae85b90e3d658f98708f Author: Johan Hovold Date: Tue Aug 30 13:29:10 2022 +0200 dt-bindings: phy: qcom,qmp-ufs: add missing SM8150 power domain Add the missing optional power-domains property used by the SM8150 UFS QMP PHY to the binding. Fixes: fe75b0c4a691 ("arm64: dts: qcom: sm8150: Add ufs power-domain entries") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-18-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 575722c772304d2658408586ededaedecb3755a6 Author: Johan Hovold Date: Tue Aug 30 13:29:09 2022 +0200 dt-bindings: phy: qcom,qmp-ufs: add missing SM8450 clock Add the missing "qref" clock used by the SM8450 UFS QMP PHY to the binding. Note that the "qref" clock was added to sm8450.dtsi by commit 07fa917a335e ("arm64: dts: qcom: sm8450: add ufs nodes") but the binding was never updated to match. Fixes: e04121ba1b08 ("dt-bindings: phy: qcom,qmp: Add SM8450 UFS phy compatible") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-17-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit f38073d968c252c0a16e18f74219755aa8480d7c Author: Johan Hovold Date: Tue Aug 30 13:29:08 2022 +0200 dt-bindings: phy: add QMP UFS PHY schema The QMP PHY DT schema is getting unwieldy. Break out the UFS PHY binding in a separate file. Add an example node based on a cleaned up version of sc8280xp.dtsi. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-16-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 3d23213f7a4cc0b0e1f5e3b32a4de10b849bffdb Author: Johan Hovold Date: Tue Aug 30 13:29:07 2022 +0200 dt-bindings: phy: qcom,qmp-pcie: deprecate PIPE clock name Deprecate the PHY node 'clock-names' property which specified that the PIPE clock name should have a bogus "lane" suffix. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-15-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 6a9915381fa13254ac9c6137aaee394a848f50be Author: Johan Hovold Date: Tue Aug 30 13:29:06 2022 +0200 dt-bindings: phy: qcom,qmp-pcie: add missing child node schema Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-14-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 492e8786318138d8871c9fb6dec29ec406d70c0e Author: Johan Hovold Date: Tue Aug 30 13:29:05 2022 +0200 dt-bindings: phy: add QMP PCIe PHY schema The QMP PHY DT schema is getting unwieldy. Break out the PCIe PHY binding in a separate file. Add an example node based on a cleaned up version of sm8250.dtsi. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-13-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit f858940e528074c94a04b65760c0317671f2f74a Author: Johan Hovold Date: Tue Aug 30 13:29:04 2022 +0200 dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate reset names Deprecate the PHY node 'reset-names' property which specified that the reset name should have an unnecessary "lane" suffix. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-12-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit dd346f5a44184f4d29a464593b29e95fbe8e0e26 Author: Johan Hovold Date: Tue Aug 30 13:29:03 2022 +0200 dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate PIPE clock names Deprecate the PHY node 'clock-names' property which specified that the PIPE clock name should have an unnecessary "lane" suffix. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-11-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit ea18884648d483daf560a1f0c4451f7e9e0e8528 Author: Johan Hovold Date: Tue Aug 30 13:29:02 2022 +0200 dt-bindings: phy: qcom,msm8996-qmp-pcie: add missing child node schema Add the missing the description of the PHY-provider child nodes which were ignored when converting to DT schema. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-10-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4506dc8233bf7b1b5c2019fc3b36a2ed54b367f1 Author: Johan Hovold Date: Tue Aug 30 13:29:01 2022 +0200 dt-bindings: phy: add qcom,msm8996-qmp-pcie-phy schema The QMP PHY DT schema is getting unwieldy. Break out the odd-bird msm8996-qmp-pcie-phy which is the only QMP PHY that uses separate "per-lane" nodes. Add an example node based on a cleaned up version of msm8996.dtsi. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-9-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 6fcebb297b251609fdbd7aa5fae25788405a2fb1 Author: Johan Hovold Date: Tue Aug 30 13:29:00 2022 +0200 dt-bindings: phy: qcom,qmp: drop child-node comment Drop the redundant comment about child nodes being required that was copied from the old binding documentation. Acked-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-8-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 1965d56aeb9d908e41d807fcfdf268bb9d688763 Author: Johan Hovold Date: Tue Aug 30 13:28:59 2022 +0200 dt-bindings: phy: qcom,qmp: clean up example Clean up the example node somewhat by grouping consumer and provider properties in the child node. Acked-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-7-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 55fc8c419b1f2813151e6420ebc5c99367126e5e Author: Johan Hovold Date: Tue Aug 30 13:28:58 2022 +0200 dt-bindings: phy: qcom,qmp: clean up descriptions Clean up the remaining descriptions by using uppercase "PHY" consistently and dropping redundant information from the register descriptions. Acked-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-6-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 00aaca3d0704a6cc6147501efaebdfce3c43131a Author: Johan Hovold Date: Tue Aug 30 13:28:57 2022 +0200 dt-bindings: phy: qcom,qmp: fix child node description Fix the incorrect description of the child nodes which claimed that one node is required per lane rather than per PHY. Acked-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-5-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 10a872375d31d8c3649c0672c5100be314ce4a68 Author: Johan Hovold Date: Tue Aug 30 13:28:56 2022 +0200 dt-bindings: phy: qcom,qmp: drop redundant descriptions Drop the redundant supply and clock descriptions which did not add much information beyond what can be inferred from the corresponding resource names. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit a4a141657387eade1cc6c3ff23624cd01497b4be Author: Johan Hovold Date: Tue Aug 30 13:28:55 2022 +0200 dt-bindings: phy: qcom,qmp: sort compatible strings Sort the compatible strings alphabetically to make it easier to look up entries and add new ones. Acked-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 97e72ee4de7e04b31d06fbd36c637dcd085b6e42 Author: Johan Hovold Date: Tue Aug 30 13:28:54 2022 +0200 dt-bindings: phy: qcom,qmp: fix bogus clock-cells property The QMP PHY wrapper node is not a clock provider so drop the bogus '#clock-cells' property that was added when converting to DT schema. Fixes: ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220830112923.3725-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit c65c3f3a2cbf21ed429d9b9c725bdb5dc6abf4cf Author: Hangyu Hua Date: Tue Aug 16 10:58:19 2022 +0200 media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc video_unregister_device will release device internally. There is no need to call video_device_release after video_unregister_device. Signed-off-by: Hangyu Hua Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 61c2698ee60630c6a7d2e99850fa81ff6450270a Author: Ming Qian Date: Tue Jul 26 05:02:29 2022 +0200 media: amphion: don't change the colorspace reported by decoder. decoder will report the colorspace information which is parsed from the sequence header, if they are unspecified, just let application to determine it, don't change it in driver. Fixes: 6de8d628df6ef ("media: amphion: add v4l2 m2m vpu decoder stateful driver") Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 996f4e89fabe44ab9ac0aabb0697aeecbe717eca Author: Ming Qian Date: Fri Jul 15 09:38:00 2022 +0200 media: amphion: adjust the encoder's value range of gop size adjust the value range of gop size from [0, 65535] to [1, 8000]. when the gop size is set to a too large value, it may affect the encoded picture quality. so constrain it to a reasonable range. Fixes: 0401e659c1f92 ("media: amphion: add v4l2 m2m vpu encoder stateful driver") Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f7fd6c318c8a5d06bf3fe611f30763d62eaaf7f0 Author: Ming Qian Date: Fri Jul 15 09:15:49 2022 +0200 media: amphion: insert picture startcode after seek for vc1g format For format vc1, the amphion vpu requires driver to help insert some custom startcode before sequence and frame. the startcode is different for vc1l and vc1g format. But the sequence startcode is only needed at the beginning, and it's not expected after seek. driver need to treat the codec header and the first frame after seek as a normal frame, and insert picture startcode for it. In previous patch, I just fix it for vc1l format, and should fix the similar issue for vc1g too. Fixes: e670f5d672ef (media: amphion: only insert the first sequence startcode for vc1l format) Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 91db7a3fc7fe670cf1770a398a43bb4a1f776bf1 Author: Dmitry Osipenko Date: Thu Aug 18 22:33:08 2022 +0200 media: cedrus: Fix endless loop in cedrus_h265_skip_bits() The busy status bit may never de-assert if number of programmed skip bits is incorrect, resulting in a kernel hang because the bit is polled endlessly in the code. Fix it by adding timeout for the bit-polling. This problem is reproducible by setting the data_bit_offset field of the HEVC slice params to a wrong value by userspace. Cc: stable@vger.kernel.org Fixes: 7678c5462680 (media: cedrus: Fix decoding for some HEVC videos) Reported-by: Nicolas Dufresne Signed-off-by: Dmitry Osipenko Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 708938f8495147fe2e77a9a3e1015d8e6899323e Author: Dmitry Osipenko Date: Thu Aug 18 22:33:07 2022 +0200 media: cedrus: Set the platform driver data earlier The cedrus_hw_resume() crashes with NULL deference on driver probe if runtime PM is disabled because it uses platform data that hasn't been set up yet. Fix this by setting the platform data earlier during probe. Cc: stable@vger.kernel.org Fixes: 50e761516f2b (media: platform: Add Cedrus VPU decoder driver) Signed-off-by: Dmitry Osipenko Signed-off-by: Nicolas Dufresne Reviewed-by: Samuel Holland Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 13cc5123e9530c5895799b4185fb7a1a2e1b7f88 Author: Andrzej Hajda Date: Thu Aug 25 17:42:39 2022 +0200 drm/i915/selftests: allow misaligned_pin test work with unmappable memory In case of Small BAR configurations stolen local memory can be unmappable. Since the test does not touch the memory, passing I915_BO_ALLOC_GPU_ONLY flag to i915_gem_object_create_region, will prevent -ENOSPC error from _i915_gem_object_stolen_init. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565 Signed-off-by: Andrzej Hajda Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220825154239.52343-1-andrzej.hajda@intel.com commit fe8b81fde69acfcbb5af9e85328e5b9549999fdb Author: Nicolas Dufresne Date: Thu Aug 18 22:33:06 2022 +0200 media: cedrus: Fix watchdog race condition The watchdog needs to be scheduled before we trigger the decode operation, otherwise there is a risk that the decoder IRQ will be called before we have schedule the watchdog. As a side effect, the watchdog would never be cancelled and its function would be called at an inappropriate time. This was observed while running Fluster with GStreamer as a backend. Some programming error would cause the decoder IRQ to be call very quickly after the trigger. Later calls into the driver would deadlock due to the unbalanced state. Cc: stable@vger.kernel.org Fixes: 7c38a551bda1 ("media: cedrus: Add watchdog for job completion") Signed-off-by: Nicolas Dufresne Reviewed-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2801f6f30f11dfe790a7f2cd63e004e10057a952 Author: Ezequiel Garcia Date: Tue Jul 19 00:02:11 2022 +0200 media: videobuf2: Remove vb2_find_timestamp() Now that we've transitioned all users to vb2_find_buffer API, remove the unused vb2_find_timestamp(). Signed-off-by: Ezequiel Garcia Acked-by: Tomasz Figa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e21cde4016a6b8e4b8b7f56a9961554324cd33ed Author: Ezequiel Garcia Date: Tue Jul 19 00:02:10 2022 +0200 media: cedrus: Use vb2_find_buffer Use the newly introduced vb2_find_buffer API to get a vb2_buffer given a buffer timestamp. Cc: Maxime Ripard Cc: Paul Kocialkowski Cc: Jernej Skrabec Signed-off-by: Ezequiel Garcia Acked-by: Tomasz Figa Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e7bfdf0a854037e8c0597f1f44f72651869c424d Author: Hirokazu Honda Date: Tue Aug 2 06:42:42 2022 +0200 media: mediatek: vcodec: Skip non CBR bitrate mode V4L2_MPEG_VIDEO_BITRATE_MODE_CBR is the only bitrate mode supported by the mediatek driver. The other bitrates must be skipped in QUERY_MENU. Fixes: d8e8aa866ed8 ("media: mediatek: vcodec: Report supported bitrate modes") Signed-off-by: Hirokazu Honda Reviewed-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b813e39a6906908e2169574063cace9a03bd8ed6 Author: Yunfei Dong Date: Wed Jul 27 04:37:21 2022 +0200 media: mediatek: vcodec: Add mt8188 encoder's chip name Getting mt8188's chip name according to encoder compatible name. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b9b9db6a2d68b16b8473ae79a1aae255feaf1bca Author: Yunfei Dong Date: Wed Jul 27 04:37:20 2022 +0200 media: mediatek: vcodec: add decoder compatible to support mt8188 1: add mt8188's compatible name: mediatek,mt8188-vcodec-dec. 2: mt8188 is lat single core architecture, using mtk_lat_sig_core_pdata to initialize private data. 3: Getting mt8188's chip name according to decoder compatible name. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8fcfa82556322ee80e83c2eb6c049396f26781a9 Author: Yunfei Dong Date: Wed Jul 27 04:37:19 2022 +0200 media: dt-bindings: media: mediatek: vcodec: add decoder dt-bindings for mt8188 Add decoder document in dt-bindings yaml file for mt8188 platform. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 58037ad43f2d33746d0d7d16514de44d6e8f566e Author: Irui Wang Date: Wed Jul 20 10:57:31 2022 +0200 media: mediatek: vcodec: Use ctx vb2_queue mutex instead of device mutex There is only one device mutex to lock vb2_queue when running multi-instance encoding, it can be set by each encoder context. [hverkuil: fix q_mutex documentation in the header] Signed-off-by: Irui Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cd61f3c6794bea2b717fe6083ca2ad189db75418 Author: Irui Wang Date: Wed Jul 20 10:57:30 2022 +0200 media: mediatek: vcodec: Fix bitstream crop information error Usually, the real bitstream width and height will set to driver by vidioc_s_fmt, and vidioc_try_fmt() does align to get the buffer width and height, driver calculate the encoded bitstream crop information through them. The aligned resolution will be set as real resolution now if user didn't set crop info by V4L2_SEL_TGT_CROP, and the encoded bitstream may exist green line because of crop information error. Fixs: 'b6c57d313f5f8 ("media: mtk-vcodec: venc: remove redundant code")' Signed-off-by: Irui Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 223afdf9caa073114a25b79915781e09eadb23b7 Author: Irui Wang Date: Wed Jul 20 10:57:29 2022 +0200 media: mediatek: vcodec: Remove encoder driver get IRQ resource The "platform_get_resource(pdev, IORESOURCE_IRQ, 0)" is no longer used after commit a1a2b7125e107("of/platform: Drop static setup of IRQ resource from DT core"), so just remove the function in encoder driver to avoid driver probe failed. Signed-off-by: Irui Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 53ed4873a256cabf70c6698c7bfffdbdc26a2a92 Author: Irui Wang Date: Wed Jul 20 10:57:28 2022 +0200 media: mediatek: vcodec: Add mt8188 encoder driver Add mt8188's compatible "mediatek,mt8188-vcodec-enc". Add mt8188's device private data "mt8188_pdata". Signed-off-by: Irui Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e9164d272fa5a59c10d7c09118b752d02ae8429b Author: Irui Wang Date: Wed Jul 20 10:57:27 2022 +0200 media: dt-bindings: media: mediatek: vcodec: Add encoder dt-bindings for mt8188 Add encoder dt-bindings for mt8188. Signed-off-by: Irui Wang Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 34cb6947bfc9ea43dde303210b98c57e1aedcb92 Author: Irui Wang Date: Wed Jul 20 10:57:26 2022 +0200 media: mediatek: vcodec: Add encoder driver support for 34-bit iova Encoder driver got iova from IOMMU is 34-bit, for example: Here is the sample code: encoder input frame buffer dma address is: frm_buf = vb2_dma_contig_plane_dma_addr(&vb2_v4l2_buffer->vb2_buf, 0); the value of frm_buf is 0x1_ff30_0000. encoder driver got the frm_buf and send the iova to SCP firmware through SCP IPI message, then write to encoder hardware in SCP. The iova is stored in IPI message as uint32_t data type, so the value will be truncated from *0x1_ff30_0000* to *0xff30_0000*, and then *0xff30_0000* will be written to encoder hardware, but IOMMU will help to add the high *0x1_* bit back, so IOMMU can translate the iova to PA correctly, encoder hardware can access the correct memory for encoding. Another reason to do this is the encoder hardware can't access the 34-bit iova, IOMMU will help to add the remaining high bits of iova. But for mt8188, encoder hardware can access 34-bit iova directly, and encoder driver need write all 34 bits because IOMMU can't help driver do this if the hardware support access 34-bit iova. For the reasons above, this patch is added to support transfer 34-bit iova between kernel and SCP encoder driver. Use uint64_t data type to store the iova, for compatibility with old chipsets, add some new struct definitions for 34-bit. [hverkuil: initialize wb and wb_34 to NULL] Signed-off-by: Irui Wang Reported-by: kernel test robot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cac8f7194111bc841b609fee5f1b20dad8f86ded Author: Ilpo Järvinen Date: Tue Aug 30 11:49:25 2022 +0300 serial: tegra: Remove custom frame size calculation The number of bits can be calculated using tty_get_frame_size(), no need for the driver to do it on its own. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220830084925.5608-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5ec2952c6278680e8fc984e2a1912d7b1203a7ba Author: Ilpo Järvinen Date: Tue Aug 30 11:49:24 2022 +0300 serial: sunsab: Remove frame size calculation dead-code The driver features a custom frame length calculation but the result is never used. Remove it. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220830084925.5608-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d4be10c816ba58c37e2a0fee626c9ad5772555fb Author: Ilpo Järvinen Date: Tue Aug 30 11:49:23 2022 +0300 serial: fsl_lpuart: Remove custom frame size calculation The number of bits can be calculated using tty_get_frame_size(), no need for the driver to do it on its own. Change bits to unsigned and baud too since we're touching the declarations line anyway (the respective core functions are typed unsigned). Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220830084925.5608-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d9ad71a2fb6a14c4966328c362d3af801dc4ae73 Author: Ilpo Järvinen Date: Tue Aug 30 11:49:22 2022 +0300 serial: cpm_uart: Remove custom frame size calculation The number of bits can be calculated using helpers in core, no need for the driver to do it on its own. The mode register is programmed with frame bits minus 1, rearrange the comments related to that "feature" closer to the actual write. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220830084925.5608-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d4ab5c2e9ceee32aac6cf520276f9e373b508ce6 Author: Ilpo Järvinen Date: Tue Aug 30 11:49:21 2022 +0300 serial: ucc_uart: Remove custom frame size calculation The number of bits can be calculated using tty_get_frame_size(), no need for the driver to do it on its own. Also remove a comment on number of bits that doesn't match the code nor the comment on ucc_uart_pram's rx_length ("minus 1" part differs). That comment seems a verbatim copy of that in cpm_uart/cpm_uart_core.c anyway so perhaps it was just copied over w/o much thinking. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220830084925.5608-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d91105e0567dabf487f81019e8b609706334d5ed Author: Tomi Valkeinen Date: Tue Apr 26 09:06:18 2022 +0200 media: ti: cal: fix wdma irq for metadata CAL HW interrupts are inherently racy. If we get both start and end interrupts, we don't know what has happened: did the DMA for a single frame start and end, or did one frame end and a new frame start? Usually for normal pixel frames we get the interrupts separately. If we do get both, we have to guess. The assumption in the code is that the active vertical area is larger than the blanking vertical area, and thus it is more likely that we get the end of the old frame and the start of a new frame. However, for embedded data, which is only a few lines high, we always get both interrupts. Here the assumption is that we get both for the same frame. Signed-off-by: Tomi Valkeinen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 02af1db05dcce05603eb51ba3e93c6f88d6ea287 Merge: d92e600f860ba 393d0f5c2a6fd Author: Rafael J. Wysocki Date: Tue Aug 30 14:26:26 2022 +0200 Merge back thermal control material for v6.1. commit 0872dc04cf65fdfaa1d67453d535f8181982848b Author: Tomi Valkeinen Date: Tue Apr 26 09:06:17 2022 +0200 media: ti: cal: combine wdma irq handling Instead of handling the WDMA START and END interrupts separately, we need to handle both at the same time to better manage the inherent race conditions related to CAL interrupts. Change the code so that we have a single function, cal_irq_handle_wdma(), which gets two booleans, start and end, as parameters, which allows us to manage the race conditions in the following patch. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0c7833b9e86d61cdfe44c2af17dcf8a08ba0ee61 Author: Al Viro Date: Sun Aug 21 02:02:33 2022 +0100 termios: get rid of stray asm/termios.h include in n_hdlc.c that's the only one outside of include/uapi/linux/termios.h and it's not even needed there - we have linux/tty.h already pulled and that pulls linux/termios.h Normally I would not consider that a sufficient reason, but there's a plenty of linux/tty.h users, and this is the only one that follows that with asm/termios.h. The situation with termios.h is genuinely convoluted, and this complicates it for no good reason. Signed-off-by: Al Viro Link: https://lore.kernel.org/r/20220821010239.1554132-2-viro@zeniv.linux.org.uk Signed-off-by: Greg Kroah-Hartman commit 6f418aeaadb78bd820f74961df48876ab194cd7a Author: Al Viro Date: Sun Aug 21 02:02:32 2022 +0100 loongarch: remove generic-y += termios.h not really needed - UAPI mandatory-y += termios.h is sufficient... Signed-off-by: Al Viro Acked-by: Huacai Chen Link: https://lore.kernel.org/r/20220821010239.1554132-1-viro@zeniv.linux.org.uk Signed-off-by: Greg Kroah-Hartman commit e3b9b27865c45c771f95b5dcf70ee8e88b343c75 Author: Rafael J. Wysocki Date: Mon Aug 29 17:53:19 2022 +0200 ACPI: Drop redundant acpi_dev_parent() header Because acpi_dev_parent() is defined as static inline, the extra header of it in acpi_bus.h is redundant, so drop it. Fixes: 62fcb99bdf10 ("ACPI: Drop parent field from struct acpi_device") Reported-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo commit 1a9a59104646417ef2d71a7dcfc5243672c9d8e6 Author: Ilpo Järvinen Date: Tue Aug 23 17:18:39 2022 +0300 serial: pch_uart: CIRC_CNT_TO_END() is enough Testing also CIRC_CNT() with CIRC_CNT_TO_END() is unnecessary because to latter alone covers all necessary cases. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220823141839.165244-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 575ca2cb89ea1dafc4005a208e77e7cd3f3edb40 Author: Ilpo Järvinen Date: Tue Aug 23 17:18:38 2022 +0300 serial: sh-sci: tail is already on valid range There is no need to and tail with UART_XMIT_SIZE - 1 because tail is already on valid range. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220823141839.165244-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a54dc4b38186e63c30db68df42487464663ae5d0 Author: Ilpo Järvinen Date: Tue Aug 23 17:18:37 2022 +0300 serial: sh-sci: CIRC_CNT_TO_END() is enough Testing also CIRC_CNT() with CIRC_CNT_TO_END() is unnecessary because to latter alone covers all necessary cases. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220823141839.165244-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d5008ef5b5a21177d3042816542f1afd5ae36152 Author: Rafael J. Wysocki Date: Mon Aug 29 17:21:43 2022 +0200 ACPI: PM: Fix NULL argument handling in acpi_device_get/set_power() In principle, it should be valid to pass NULL as the ACPI device pointer to acpi_device_get_power() and acpi_device_set_power() and they both are expected to return -EINVAL in that case, but that has been broken recently by commit 62fcb99bdf10 ("ACPI: Drop parent field from struct acpi_device") which has caused the ACPI device pointer to be dereferenced in these functions before the NULL check. Fix that and while at it make acpi_device_set_power() only use the parent field if the target ACPI device object's ignore_parent flag in not set. Fixes: 62fcb99bdf10 ("ACPI: Drop parent field from struct acpi_device") Reported-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit a8c11c1520347be74b02312d10ef686b01b525f1 Author: Ilpo Järvinen Date: Tue Aug 16 14:57:39 2022 +0300 tty: Make ->set_termios() old ktermios const There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f6d47fe5921a6d3f5a1a3d0b9a3dd34b8e295722 Author: Ilpo Järvinen Date: Tue Aug 16 14:57:38 2022 +0300 usb: serial: Make ->set_termios() old ktermios const There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-8-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit bec5b814d46c2a704c3c8148752e62a33e9fa6dc Author: Ilpo Järvinen Date: Tue Aug 16 14:57:37 2022 +0300 serial: Make ->set_termios() old ktermios const There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8b7d2d95cf82f8ca034ac65d0f39a2b3359b680f Author: Ilpo Järvinen Date: Tue Aug 16 14:57:36 2022 +0300 tty: Make ldisc ->set_termios() old ktermios const There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d15f89d997d995c9a0bf5be5de4c1c405886f21c Author: Ilpo Järvinen Date: Tue Aug 16 14:57:35 2022 +0300 tty: Make tty_termios_copy_hw() old ktermios const There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c87391b5dd77fbd4fd0b0a96fa867a169842b0a9 Author: Ilpo Järvinen Date: Tue Aug 16 14:57:34 2022 +0300 serial: dz: Assume previous baudrate is valid Assume previously used termios has a valid baudrate and use it directly. Reviewed-by: Andy Shevchenko Acked-by: Maciej W. Rozycki Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 292e2e7a639dad2392e5af5281d1f48f05dde10d Author: Ilpo Järvinen Date: Tue Aug 16 14:57:33 2022 +0300 tty: Fix comment style in tty_termios_input_baud_rate() Add proper spacing to comment. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 87888fb9ac0c71cdc1edd0779382052475dadb84 Author: Ilpo Järvinen Date: Tue Aug 16 14:57:32 2022 +0300 tty: Remove baudrate dead code & make ktermios params const With the architectures currently in-tree, either: 1) CBAUDEX is zero 2) The earlier BOTHER if check covers cbaud < 1 case 3) All CBAUD bits are covered by the baud_table Thus, the check for cbaud being out-of-range for CBAUDEX case cannot ever be true. The ktermios parameters can now be made const. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816115739.10928-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit eb9e109d010cb79ab01d8562e851d53bcecf059b Author: Wolfram Sang Date: Thu Aug 18 23:01:12 2022 +0200 tty: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Reviewed-by: Jiri Slaby Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210113.7469-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit bf93e887e2a1358a29ed4cd3be46cede903e01e1 Author: Rob Herring Date: Tue Aug 23 09:56:32 2022 -0500 dt-bindings: serial: samsung: Add 'power-domains' property Some Samsung UARTs are in a power domain, so allow 'power-domains' property. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220823145649.3118479-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 5698782fd226a287ac5d26bf16666364165ee8fc Author: Lad Prabhakar Date: Tue Jul 26 18:49:29 2022 +0100 dt-bindings: serial: renesas,scif: Document RZ/Five SoC The SCIF block on the RZ/Five SoC is identical to one found on the RZ/G2UL SoC. "renesas,scif-r9a07g043" compatible string will be used on the RZ/Five SoC so to make this clear, update the comment to include RZ/Five SoC. Reviewed-by: Geert Uytterhoeven Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220726174929.950-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 45fa44431b336fc2aa5bff01010ed24aee438397 Merge: 6d5afdc97ea71 6ca7076fbfaec Author: Rafael J. Wysocki Date: Tue Aug 30 14:20:54 2022 +0200 Merge back cpufreq material for v6.1. commit b383e8abed41cc6ff1a3b34de75df9397fa4878c Author: Tetsuo Handa Date: Tue Aug 16 23:46:13 2022 +0900 wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg() syzbot is reporting uninit value at ath9k_htc_rx_msg() [1], for ioctl(USB_RAW_IOCTL_EP_WRITE) can call ath9k_hif_usb_rx_stream() with pkt_len = 0 but ath9k_hif_usb_rx_stream() uses __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC) based on an assumption that pkt_len is valid. As a result, ath9k_hif_usb_rx_stream() allocates skb with uninitialized memory and ath9k_htc_rx_msg() is reading from uninitialized memory. Since bytes accessed by ath9k_htc_rx_msg() is not known until ath9k_htc_rx_msg() is called, it would be difficult to check minimal valid pkt_len at "if (pkt_len > 2 * MAX_RX_BUF_SIZE) {" line in ath9k_hif_usb_rx_stream(). We have two choices. One is to workaround by adding __GFP_ZERO so that ath9k_htc_rx_msg() sees 0 if pkt_len is invalid. The other is to let ath9k_htc_rx_msg() validate pkt_len before accessing. This patch chose the latter. Note that I'm not sure threshold condition is correct, for I can't find details on possible packet length used by this protocol. Link: https://syzkaller.appspot.com/bug?extid=2ca247c2d60c7023de7f [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7acfa1be-4b5c-b2ce-de43-95b0593fb3e5@I-love.SAKURA.ne.jp commit f26fd926ccb79422dc1da2fb4a0e1d583eaf0dc2 Author: Daniel Vetter Date: Fri Aug 26 22:24:19 2022 +0200 tty/vt: Remove printable variable Every since the 0.99.7A release when console_register() was introduced it's become impossible to call vt_console_print (called console_print() back then still) directly. Which means the initialization issue this variable protected against is no more. Give it a send off with style and let it rest in peace. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: "Ilpo Järvinen" Cc: nick black Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Yangxi Xiang Cc: Xuezhi Zhang Reviewed-by: Jiri Slaby Signed-off-by: Daniel Vetter Link: https://lore.kernel.org/r/20220826202419.198535-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman commit 8b470f6ed812670143636194b24aee48f587301b Author: Krzysztof Kozlowski Date: Tue Aug 23 13:10:00 2022 +0300 dt-bindings: serial: samsung_uart: drop ref from reg-io-width reg-io-width is a standard property, so no need for defining its type Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823101000.386927-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4f1b576d700c073f1bf848dfdde44f37619cbe32 Author: Christophe JAILLET Date: Wed Aug 24 10:06:21 2022 +0200 tty: serial: meson: Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). That said, meson_uart_probe_clock() is now more or less the same as devm_clk_get_enabled(), so use this function directly instead. This also fixes an (unlikely) unchecked devm_add_action_or_reset() error. Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 16350 5016 128 21494 53f6 drivers/tty/serial/meson_uart.o down to: 15415 4784 128 20327 4f67 drivers/tty/serial/meson_uart.o Reviewed-by: Neil Armstrong Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3f18638cb3cf08ed8817addca1402ed5e3bd3602.1661328361.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 70d15f216e2919d821f75731eb57d4b7dc44f19b Author: Ilpo Järvinen Date: Fri Aug 19 14:00:02 2022 +0300 serial: 8250: Clear dma tx_err unconditionally No need to check non-zeroness first and then clear. Just set to zero unconditionally. Acked-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/3b885e7f-1372-3aa9-febd-34566ba25e3d@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a3911f6ea5542d56366a6495f2464a312d85d15b Author: Ilpo Järvinen Date: Tue Aug 16 15:07:59 2022 +0300 serial: 8250: Add helper for clearing IER A number of places want to clear IER with the same CAP_UUE trick. Create a helper for that. Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220816120759.11552-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5779a072c248db7a40cfd0f5ea958097fd1d9a30 Author: Jindong Yue Date: Tue Aug 2 18:16:13 2022 +0800 tty: serial: fsl_lpuart: adjust SERIAL_FSL_LPUART_CONSOLE config dependency Remove the limitation of SERIAL_FSL_LPUART=y, as we may need enable this console while SERIAL_FSL_LPUART=m. Signed-off-by: Jindong Yue Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220802101613.30879-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit e9c9d3bb158df0e8abab3b6650f36bf645519867 Author: Andy Shevchenko Date: Sun Aug 7 01:56:43 2022 +0300 serial: pic32_uart: Convert to use GPIO descriptors Plain global GPIO numbering schema is deprecated and is being removed from the kernel. Convert this driver to use a new GPIO descriptor based schema. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220806225643.40897-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e68d545004bd2edda8d8b60145d5dc81b2d5959e Author: Andy Shevchenko Date: Sun Aug 7 01:56:42 2022 +0300 serial: pic32_uart: Utilize uart_console_enabled() The serial core already provides a helper to check if the given port is an enabled console. Utilize it instead of open coded variant. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220806225643.40897-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 374e01fa1304e1eabd2cd16f750da3ecaeab069b Author: Jason Wang Date: Wed Aug 3 18:42:08 2022 +0800 serial: fsl_lpuart: Fix comment typo The double `as' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220803104208.4127-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 81db9e8edf7a886af0e6985d2562003976322cdf Author: Shubhrajyoti Datta Date: Fri Aug 26 17:35:59 2022 +0530 serial: pl011: Add reg-io-width parameters Some of the implementations can read only 32 bits because of the interface limitations of the port they are connected to. Add a parameter reg-io-width for supporting such platforms. Reviewed-by: Ilpo Järvinen Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220826120559.2122-3-shubhrajyoti.datta@amd.com Signed-off-by: Greg Kroah-Hartman commit 8ed030de05b35ec48c24b5a26df79d05a6d244d2 Author: Shubhrajyoti Datta Date: Fri Aug 26 17:35:58 2022 +0530 dt-bindings: serial: pl011: Add a reg-io-width parameter Some of the implementations support only 32-bit accesses. Add a parameter reg-io-width for such platforms. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220826120559.2122-2-shubhrajyoti.datta@amd.com Signed-off-by: Greg Kroah-Hartman commit a000bafa61829d8c4d8219bc7d6918d907af91e5 Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:48 2022 +0530 tty: xilinx_uartps: Check the clk_enable return value Check the clk_enable return value. If clocks are not enabled the register accesses could hang the system so error out instead. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-8-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit a17fa1216c23bf28819bb957f71f1bab914ba9a8 Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:47 2022 +0530 tty: xilinx_uartps: Add timeout waiting for loop There is a potential infinite loop while waiting for the the TXFULL to deassert. Adds the error message and timeout to avoid infinite loop if it fails to get the TX fifo not full. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-7-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit b36962896f00e164eb18093351f0b69d1b396964 Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:46 2022 +0530 tty: xilinx_uartps: Prevent writes when the controller is disabled Prevent writing to the fifo if the controller is disabled. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-6-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit b8a6c3b3d4654fba19881cc77da61eac29f57cae Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:45 2022 +0530 tty: xilinx_uartps: Fix the ignore_status Currently the ignore_status is not considered in the isr. Add a check to add the ignore_status. Fixes: 61ec9016988f ("tty/serial: add support for Xilinx PS UART") Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-5-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 03a94800b9f35d6d1ef231f50758f88d5f76bbb0 Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:44 2022 +0530 tty: xilinx_uartps: Initialise the read_status_mask Initialise the read status in probe. It will be checked in the isr so to have the default values lets initialise in probe. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-4-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 7bdd444b2d735a123678ea9afaf446d3508f21f2 Author: Michal Simek Date: Fri Jul 29 17:17:43 2022 +0530 tty: xilinx_uartps: Update copyright text to correct format Based on recommended guidance Copyright term should be also present in front of (c). That's why aligned drivers to match this pattern. It helps automated tools with source code scanning. Signed-off-by: Michal Simek Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-3-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 957e8c047bf25bd24271ab049f06dc47f382973f Author: Shubhrajyoti Datta Date: Fri Jul 29 17:17:42 2022 +0530 tty: xilinx_uartps: Check clk_enable return value If clocks are not enabled the register access may hang the system. Check for the clock enable return value and bail out if not enabled. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220729114748.18332-2-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 146ecbac1d327e7ed2153cfb3ef880166dc2b312 Author: Jiri Pirko Date: Fri Aug 26 10:27:30 2022 +0200 net: devlink: stub port params cmds for they are unused internally Follow-up the removal of unused internal api of port params made by commit 42ded61aa75e ("devlink: Delete not used port parameters APIs") and stub the commands and add extack message to tell the user what is going on. If later on port params are needed, could be easily re-introduced, but until then it is a dead code. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220826082730.1399735-1-jiri@resnulli.us Signed-off-by: Paolo Abeni commit 4b7477f0921a2dc9594b6bb0c893e79169c6e829 Author: Zhengchao Shao Date: Fri Aug 26 12:10:35 2022 +0800 net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune() Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune(). Signed-off-by: Zhengchao Shao Acked-by: Cong Wang Link: https://lore.kernel.org/r/20220826041035.80129-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit e79e40c83b9fd4e8b9b9d4fc9093d25b7a67c745 Author: Mengyuan Lou Date: Fri Aug 26 11:46:09 2022 +0800 net: ngbe: Add build support for ngbe Add build options and guidance doc. Initialize pci device access for Wangxun Gigabit Ethernet devices. Reviewed-by: Andrew Lunn Signed-off-by: Mengyuan Lou Link: https://lore.kernel.org/r/20220826034609.51854-1-mengyuanlou@net-swift.com Signed-off-by: Paolo Abeni commit 11bc150daa5f3e6428a0bb632705eb697e2969c0 Merge: 47cf88993c910 4f5059e629214 Author: Paolo Abeni Date: Tue Aug 30 12:20:47 2022 +0200 Merge branch 'netlink-support-reporting-missing-attributes' Jakub Kicinski says: ==================== netlink: support reporting missing attributes This series adds support for reporting missing attributes in a structured way. We communicate the type of the missing attribute and if it was missing inside a nest the offset of that nest. Example of (YAML-based) user space reporting ethtool header missing: Kernel error: missing attribute: .header I was tempted to integrate the check with the policy but it seems tricky without doing a full scan, and there may be a ton of attrs in the policy. So leaving that for later. ==================== Link: https://lore.kernel.org/r/20220826030935.2165661-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 9477420efc41f60f06413cefa38f5bfd71ba64d8 Author: Shreeya Patel Date: Tue Aug 30 15:06:07 2022 +0530 spi: amd: Fix speed selection If the current speed is equal to the requested speed by the device then return success. This patch fixes a bug introduced by the commit 3fe26121dc3a ("spi: amd: Configure device speed") which checks speed_hz instead of amd_spi->speed_hz. Fixes: 3fe26121dc3a ("spi: amd: Configure device speed") Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220830093607.45484-1-shreeya.patel@collabora.com Signed-off-by: Mark Brown commit 4f5059e62921479610de903857857ff82ac7e57f Author: Jakub Kicinski Date: Thu Aug 25 20:09:35 2022 -0700 ethtool: report missing header via ext_ack in the default handler The actual presence check for the header is in ethnl_parse_header_dev_get() but it's a few layers in, and already has a ton of arguments so let's just pick the low hanging fruit and check for missing header in the default request handler. Reviewed-by: Ido Schimmel Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 08d1d0e78440aa8670492a01cabea732d4beabf5 Author: Jakub Kicinski Date: Thu Aug 25 20:09:34 2022 -0700 ethtool: strset: report missing ETHTOOL_A_STRINGSET_ID via ext_ack Strset needs ETHTOOL_A_STRINGSET_ID, use it as an example of reporting attrs missing in nests. Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 1f7633b58facf399eee0b049ed6b6d89b8beeba5 Author: Jakub Kicinski Date: Thu Aug 25 20:09:33 2022 -0700 devlink: use missing attribute ext_ack Devlink with its global attr policy has a lot of attribute presence check, use the new ext ack reporting when they are missing. Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 45dca15759643806660e9285e6af8a1ba3c76c82 Author: Jakub Kicinski Date: Thu Aug 25 20:09:32 2022 -0700 netlink: add helpers for extack attr presence checking Being able to check attribute presence and set extack if not on one line is handy, add helpers. Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 690252f19f0e486abb8590b3a7a03d4e065d93d4 Author: Jakub Kicinski Date: Thu Aug 25 20:09:31 2022 -0700 netlink: add support for ext_ack missing attributes There is currently no way to report via extack in a structured way that an attribute is missing. This leads to families resorting to string messages. Add a pair of attributes - @offset and @type for machine-readable way of reporting missing attributes. The @offset points to the nest which should have contained the attribute, @type is the expected nla_type. The offset will be skipped if the attribute is missing at the message level rather than inside a nest. User space should be able to figure out which attribute enum (AKA attribute space AKA attribute set) the nest pointed to by @offset is using. Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 0c95cea24f30eb28d464c593d8fbd64cd305791b Author: Jakub Kicinski Date: Thu Aug 25 20:09:30 2022 -0700 netlink: factor out extack composition The ext_ack writing code looks very "organically grown". Move the calculation of the size and writing out to helpers. This is more idiomatic and gives us the ability to return early avoiding the long (and randomly ordered) "if" conditions. Reviewed-by: Johannes Berg Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit dcd45ad2ad784c35bfba8ae93c285574bc2a8a1e Author: Rebecca Mckeever Date: Sat Aug 27 00:42:50 2022 -0500 memblock tests: add tests for memblock_trim_memory Add tests for memblock_trim_memory() for the following scenarios: - all regions aligned - one unaligned region that is smaller than the alignment - one unaligned region that is unaligned at the base - one unaligned region that is unaligned at the end Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/0e5f55154a3b66581e04ba3717978795cbc08a5b.1661578349.git.remckee0@gmail.com commit a541c6d428f775efcfe25236062c96b59e31b57a Author: Rebecca Mckeever Date: Sat Aug 27 00:42:49 2022 -0500 memblock tests: add tests for memblock_*bottom_up functions Add simple tests for memblock_set_bottom_up() and memblock_bottom_up(). Reviewed-by: David Hildenbrand Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/b03701d2faeaf00f7184e4b72903de4e5e939437.1661578349.git.remckee0@gmail.com commit ae544fd62c14265dc663a65b3f9c6c5a6134098a Author: Rebecca Mckeever Date: Sat Aug 27 00:42:48 2022 -0500 memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw Update memblock_alloc_try_nid() tests so that they test either memblock_alloc_try_nid() or memblock_alloc_try_nid_raw() depending on the value of alloc_nid_test_flags. Run through all the existing tests in alloc_nid_api twice: once for memblock_alloc_try_nid() and once for memblock_alloc_try_nid_raw(). When the tests run memblock_alloc_try_nid(), they test that the entire memory region is zero. When the tests run memblock_alloc_try_nid_raw(), they test that the entire memory region is nonzero. The content of the memory region is initialized to nonzero, and we expect it to remain unchanged if running memblock_alloc_try_nid_raw(). Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/6fa8938f67872841c10a00afb042947d1d280a04.1661578349.git.remckee0@gmail.com commit deee033e0f8ea66a9f4acfc1eb069fdef3013bec Author: Rebecca Mckeever Date: Sat Aug 27 00:42:47 2022 -0500 memblock tests: update alloc_api to test memblock_alloc_raw Update memblock_alloc() tests so that they test either memblock_alloc() or memblock_alloc_raw() depending on the value of alloc_test_flags. Run through all the existing tests in memblock_alloc_api twice: once for memblock_alloc() and once for memblock_alloc_raw(). When the tests run memblock_alloc(), they test that the entire memory region is zero. When the tests run memblock_alloc_raw(), they test that the entire memory region is nonzero. The content of the memory region is initialized to nonzero, and we expect it to remain unchanged if running memblock_alloc_raw(). Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/5a7cfb2f807ee2cb53ee77f9f5c910107b253d6e.1661578349.git.remckee0@gmail.com commit 21a233f68afe55aafa8b79705c97f7a1d37be3e1 Author: Rebecca Mckeever Date: Sat Aug 27 00:42:46 2022 -0500 memblock tests: add additional tests for basic api and memblock_alloc Add tests for memblock_add(), memblock_reserve(), memblock_remove(), memblock_free(), and memblock_alloc() for the following test scenarios. memblock_add() and memblock_reserve(): - add/reserve a memory block in the gap between two existing memory blocks, and check that the blocks are merged into one region - try to add/reserve memblock regions that extend past PHYS_ADDR_MAX memblock_remove() and memblock_free(): - remove/free a region when it is the only available region + These tests ensure that the first region is overwritten with a "dummy" region when the last remaining region of that type is removed or freed. - remove/free() a region that overlaps with two existing regions of the relevant type - try to remove/free memblock regions that extend past PHYS_ADDR_MAX memblock_alloc(): - try to allocate a region that is larger than the total size of available memory (memblock.memory) Reviewed-by: David Hildenbrand Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/c23c0393c5b9a53fe7f676996913c629495e9727.1661578349.git.remckee0@gmail.com commit fb2e97fe853ff515df473d4acec6707816e05d87 Author: Rebecca Mckeever Date: Sat Aug 27 00:42:45 2022 -0500 memblock tests: add labels to verbose output for generic alloc tests Generic tests for memblock_alloc*() functions do not use separate functions for testing top-down and bottom-up allocation directions. Therefore, the function name that is displayed in the verbose testing output does not include the allocation direction. Add an additional prefix when running generic tests for memblock_alloc*() functions that indicates which allocation direction is set. The prefix will be displayed when the tests are run in verbose mode. Reviewed-by: David Hildenbrand Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/fb76a42253d2a196a7daea29dd8121a69904f58e.1661578349.git.remckee0@gmail.com commit 25b9defb5bc4aee8beb51ded07838e12745426f9 Author: Rebecca Mckeever Date: Sat Aug 27 00:42:44 2022 -0500 memblock tests: update zeroed memory check for memblock_alloc_* tests Update the assert in memblock_alloc_try_nid() and memblock_alloc_from() tests that checks whether the memory is cleared so that it checks the entire chunk of allocated memory instead of just the first byte. Reviewed-by: David Hildenbrand Reviewed-by: Shaoqin Huang Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/24b3271751756100142e65b75284d43b4d30c9b7.1661578349.git.remckee0@gmail.com commit ac76d803c4f6c2a32c9c7436d14467e099fd2bfa Author: Rebecca Mckeever Date: Sat Aug 27 00:42:43 2022 -0500 memblock tests: update tests to check if memblock_alloc zeroed memory Add an assert in memblock_alloc() tests where allocation is expected to occur. The assert checks whether the entire chunk of allocated memory is cleared. The current memblock_alloc() tests do not check whether the allocated memory was zeroed. memblock_alloc() should zero the allocated memory since it is a wrapper for memblock_alloc_try_nid(). Reviewed-by: Shaoqin Huang Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/83ffb941b65074f40eb14552f8bfe5b71fe50abd.1661578349.git.remckee0@gmail.com commit 61ebea2ba19826ce6dff8686b72ecbea8269f6cc Author: Rebecca Mckeever Date: Sun Aug 14 00:50:20 2022 -0500 memblock tests: update reference to obsolete build option in comments The VERBOSE build option was replaced with the --verbose runtime option, but the comments describing the ASSERT_*() macros still refer to the VERBOSE build option. Update these comments so that they refer to the --verbose runtime option. Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/5f8a4c2bde34cc029282c68d47eda982d950f421.1660451025.git.remckee0@gmail.com commit c0f1bc4e91c52be73ae1a5e6fd53371f5a7f0333 Author: Rebecca Mckeever Date: Sun Aug 14 00:50:19 2022 -0500 memblock tests: add command line help option Add a help command line option to the help message. Add the help option to the short and long options so it will be recognized as a valid option. Usage: $ ./main -h Or: $ ./main --help Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/0f3b93a79de78c0da1ca90f74fe35e9a85c7cf93.1660451025.git.remckee0@gmail.com commit fd609e8c2893772b47aa2de93ac5ebb815acb930 Merge: 5204e83654476 2a09cef652d9c Author: Mark Brown Date: Tue Aug 30 11:08:12 2022 +0100 Add Pink Sardine platform ASoC driver Merge series from Syed Saba Kareem : Pink Sardine platform is new APU series based on acp6.2 design. This patch set adds an ASoC driver for the ACP (Audio CoProcessor) block on AMD Pink Sardine APU with DMIC endpoint support. commit 09d027dbe17137dac4d91b2698e665d46b78570e Author: Peng Fan Date: Tue Aug 23 11:02:15 2022 +0800 i2c: imx-lpi2c: use bulk clk API The current driver only support one clock, however LPI2C requires two clocks: PER and IPG. To make sure old dts could work with newer kernel, use bulk clk API. Reviewed-by: Dong Aisheng Signed-off-by: Peng Fan Signed-off-by: Wolfram Sang commit 6347eee5a3ec901b105df3e4dccf9c603f929167 Author: Peng Fan Date: Tue Aug 23 11:02:12 2022 +0800 dt-bindings: i2c: i2c-imx-lpi2c: add i.MX93 Add i.MX93 LPI2C compatible string. Acked-by: Krzysztof Kozlowski Reviewed-by: Dong Aisheng Signed-off-by: Peng Fan Signed-off-by: Wolfram Sang commit 3a5ce65d4a6e95dc922937487b5eceaa19f8a9b0 Author: Peng Fan Date: Tue Aug 23 11:02:11 2022 +0800 dt-bindings: i2c: i2c-imx-lpi2c: add dmas property i.MX LPI2C has dma capability, so add dmas property Reviewed-by: Dong Aisheng Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Wolfram Sang commit c04c2819dc3d88ee744675e39f7c0f2663732eb7 Author: Peng Fan Date: Tue Aug 23 11:02:10 2022 +0800 dt-bindings: i2c: i2c-imx-lpi2c: add ipg clk i.MX LPI2C actually requires dual clock: per clock and ipg clock, so add both. Reviewed-by: Dong Aisheng Reviewed-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Wolfram Sang commit 47cf88993c910840d565631ad906abdca9168231 Author: Pavel Begunkov Date: Thu Aug 25 13:06:31 2022 +0100 net: unify alloclen calculation for paged requests Consolidate alloclen and pagedlen calculation for zerocopy and normal paged requests. The current non-zerocopy paged version can a bit overallocate and unnecessary copy a small chunk of data into the linear part. Cc: Willem de Bruijn Link: https://lore.kernel.org/netdev/CA+FuTSf0+cJ9_N_xrHmCGX_KoVCWcE0YQBdtgEkzGvcLMSv7Qw@mail.gmail.com/ Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b0e4edb7b91f171c7119891d3c61040b8c56596e.1661428921.git.asml.silence@gmail.com Signed-off-by: Paolo Abeni commit ee50036b25be62e4abbac46665f410b887b66130 Author: Baruch Siach Date: Fri Jul 29 04:40:16 2022 +0100 ARM: 9221/1: traps: print un-hashed user pc on undefined instruction When user undefined instruction debug is enabled pc value is hashed like kernel pointers for security reason. But the security benefit of this hash is very limited because the code goes on to call __show_regs() that prints the plain pointer value. pc is a user pointer anyway, so the kernel does not leak anything. The only result is confusion about the difference between the pc value on the first printed line, and the value that __show_regs() prints. Always print the plain value of pc. Signed-off-by: Baruch Siach Signed-off-by: Russell King (Oracle) commit d287532edfc2b6cec45e5eb00332a4c6fddf07a3 Merge: f97e971dbdc7c e6686745e327c Author: Paolo Abeni Date: Tue Aug 30 11:29:29 2022 +0200 Merge branch 'nfp-port-speed-and-eeprom-get-set-updates' Simon Horman says: ==================== nfp: port speed and eeprom get/set updates this short series is the initial updates for the NFP driver for the v6.1 Kernel. It covers two enhancements: 1. Patches 1/3 and 2/3: - Support cases where application firmware does not know port speeds a priori by relaying this information from the management firmware to the application firmware. This allows the existing mechanism, whereby the driver reports port speeds to user-space as provided by the application firmware, to work in this case. 2. Patch 2/3: - Add support for eeprom get and set command ==================== Link: https://lore.kernel.org/r/20220825141223.22346-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit e6686745e327ce07ea6b95fe975ce745be9908de Author: Baowen Zheng Date: Thu Aug 25 16:12:23 2022 +0200 nfp: add support for eeprom get and set command Add support for eeprom get and set operation with ethtool command. with this change, we can support commands as: #ethtool -e enp101s0np0 offset 0 length 6 Offset Values ------ ------ 0x0000: 00 15 4d 16 66 33 #ethtool -E enp101s0np0 magic 0x400019ee offset 5 length 1 value 0x88 We make this change to persist MAC change during driver reload and system reboot. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: Paolo Abeni commit 2b88354d37ca672dc8c467f8c9d14aaa18df78d4 Author: Yinjun Zhang Date: Thu Aug 25 16:12:22 2022 +0200 nfp: check if application firmware is indifferent to port speed A new tlv type is introduced to indicate if application firmware is indifferent to port speed, and inform management firmware of the result. And the result is always true for flower application firmware since it's indifferent to port speed from the start and will never change. Signed-off-by: Yinjun Zhang Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Paolo Abeni commit 62fad9e6104ceff28feabb1a34765abcec43564a Author: Yinjun Zhang Date: Thu Aug 25 16:12:21 2022 +0200 nfp: propagate port speed from management firmware In future releases the NIC application firmware may be indifferent to port speeds - not built for specific port speeds - and consequently it will not be able to report VF port speeds to the driver without first learning them. With this change, the driver will pass the speed of physical ports from management firmware to application firmware, and the latter will copy the speed of port 0 to all the active VFs. So that the driver can get VF port speed as before. The port speed of a VF may be requested from userspace using: ethtool Signed-off-by: Yinjun Zhang Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Paolo Abeni commit 84fc863606239d8b434e59e6bbbe805f457e5767 Author: Arnd Bergmann Date: Wed Jul 27 14:08:24 2022 +0200 ARM: make ARCH_MULTIPLATFORM user-visible Some options like CONFIG_DEBUG_UNCOMPRESS and CONFIG_CMDLINE_FORCE are fundamentally incompatible with portable kernels but are currently allowed in all configurations. Other options like XIP_KERNEL are essentially useless after the completion of the multiplatform conversion. Repurpose the existing CONFIG_ARCH_MULTIPLATFORM option to decide whether the resulting kernel image is meant to be portable or not, and using this to guard all of the known incompatible options. This is similar to how the RISC-V kernel handles the CONFIG_NONPORTABLE option (with the opposite polarity). A few references to CONFIG_ARCH_MULTIPLATFORM were left behind by earlier clanups and have to be removed now up. Signed-off-by: Arnd Bergmann commit 5408445b1e4d511d835ecbae2fbc9fb9976dbcb9 Author: Arnd Bergmann Date: Thu Aug 18 16:17:09 2022 +0200 ARM: fix XIP_KERNEL dependencies CONFIG_XIP_KERNEL does not work with any option that involves patching the read-only kernel .text. Since at least CONFIG_SMP_ON_UP is required in certain configurations, flip the dependency to always allow the .text patching options but make XIP_KERNEL have the dependency instead. This is a prerequisite for allowing CONFIG_ARCH_MULTIPLATFORM to be disabled. Reviewed-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit bfb3bde95479e7072839564ec90dbf5d00bfb9b1 Author: Wenpeng Liang Date: Mon Aug 29 18:50:21 2022 +0800 RDMA/hns: Remove redundant member doorbell_qpn of struct hns_roce_qp The value of doorbell_qpn is always equal to qpn on current hardware versions. So remove it. Link: https://lore.kernel.org/r/20220829105021.1427804-5-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit 637ff8ea00a20dd731110c9cdbef0e41c050607d Author: Mark Zhang Date: Fri Aug 19 12:08:59 2022 +0300 IB/cm: Refactor cm_insert_listen() and cm_find_listen() Move the device and service_id match code at the top of cm_insert_listen() and cm_find_listen() into the final else branch. Link: https://lore.kernel.org/r/20220819090859.957943-4-markzhang@nvidia.com Signed-off-by: Mark Zhang Signed-off-by: Leon Romanovsky commit a461b746c5768b9b3001045cff2d508346f5f789 Author: Mark Zhang Date: Fri Aug 19 12:08:58 2022 +0300 IB/cm: remove cm_id_priv->id.service_mask and service_mask parameter of cm_init_listen() The service_mask is always ~cpu_to_be64(0), so the result is always a NOP when it is &'d with a service_id. Remove it for simplicity. Link: https://lore.kernel.org/r/20220819090859.957943-3-markzhang@nvidia.com Signed-off-by: Mark Zhang Signed-off-by: Leon Romanovsky commit 91a3f14ec953f3224215dc867001b9a201785740 Author: Mark Zhang Date: Fri Aug 19 12:08:57 2022 +0300 IB/cm: Remove the service_mask parameter from ib_cm_listen() Remove the service_mask parameter of ib_cm_listen(), as all callers use 0. Link: https://lore.kernel.org/r/20220819090859.957943-2-markzhang@nvidia.com Signed-off-by: Mark Zhang Signed-off-by: Leon Romanovsky commit 6edd86a2d20e702f49dfd59786da14c35495c784 Author: Guoqing Jiang Date: Fri Aug 26 16:11:17 2022 +0800 RDMA/rtrs: Remove 'dir' argument from rnbd_srv_rdma_ev Since process_{read,write} already prints direction info if ctx->ops.rdma_ev fails, no need to pass 'dir'. Link: https://lore.kernel.org/r/20220826081117.21687-1-guoqing.jiang@linux.dev Signed-off-by: Guoqing Jiang Signed-off-by: Leon Romanovsky commit f4d381038700361f92d157288b0e18d87fab6c6d Author: Lad Prabhakar Date: Mon Aug 29 23:03:34 2022 +0100 spi: renesas,sh-msiof: Fix 'unevaluatedProperties' warnings With 'unevaluatedProperties' support implemented, there's a number of warnings when running dtbs_check: arch/arm64/boot/dts/renesas/r8a77951-ulcb-kf.dtb: spi@e6e90000: Unevaluated properties are not allowed ('power-domains', 'resets' were unexpected) From schema: Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml The main problem is that SoC DTSI's include power-domains and resets property, whereas the renesas,sh-msiof.yaml has 'unevaluatedProperties: false'. So just add optional power-domains and resets properties. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220829220334.6379-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 5204e836544763cb085e653c82d4da77a427591a Author: Krzysztof Kozlowski Date: Tue Aug 30 10:58:55 2022 +0300 ASoC: codecs: rk817: fix missing I2C dependency in compile test SND_SOC_RK817 uses I2C regmap so compile testing without parent MFD_RK808, requires I2C: WARNING: unmet direct dependencies detected for REGMAP_I2C Depends on [n]: I2C [=n] Selected by [y]: - SND_SOC_RK817 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (MFD_RK808 [=n] || COMPILE_TEST [=y]) Reported-by: kernel test robot Fixes: 5b7f4e5de61b ("ASoC: codecs: allow compile testing without MFD drivers") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220830075855.278046-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit ecdfb8896f2ad733097e6309d64f94db4cd1020c Author: Marco Elver Date: Mon Aug 29 14:47:19 2022 +0200 perf/hw_breakpoint: Optimize toggle_bp_slot() for CPU-independent task targets We can still see that a majority of the time is spent hashing task pointers: ... 16.98% [kernel] [k] rhashtable_jhash2 ... Doing the bookkeeping in toggle_bp_slots() is currently O(#cpus), calling task_bp_pinned() for each CPU, even if task_bp_pinned() is CPU-independent. The reason for this is to update the per-CPU 'tsk_pinned' histogram. To optimize the CPU-independent case to O(1), keep a separate CPU-independent 'tsk_pinned_all' histogram. The major source of complexity are transitions between "all CPU-independent task breakpoints" and "mixed CPU-independent and CPU-dependent task breakpoints". The code comments list all cases that require handling. After this optimization: | $> perf bench -r 100 breakpoint thread -b 4 -p 128 -t 512 | # Running 'breakpoint/thread' benchmark: | # Created/joined 100 threads with 4 breakpoints and 128 parallelism | Total time: 1.758 [sec] | | 34.336621 usecs/op | 4395.087500 usecs/op/cpu 38.08% [kernel] [k] queued_spin_lock_slowpath 10.81% [kernel] [k] smp_cfm_core_cond 3.01% [kernel] [k] update_sg_lb_stats 2.58% [kernel] [k] osq_lock 2.57% [kernel] [k] llist_reverse_order 1.45% [kernel] [k] find_next_bit 1.21% [kernel] [k] flush_tlb_func_common 1.01% [kernel] [k] arch_install_hw_breakpoint Showing that the time spent hashing keys has become insignificant. With the given benchmark parameters, that's an improvement of 12% compared with the old O(#cpus) version. And finally, using the less aggressive parameters from the preceding changes, we now observe: | $> perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 0.067 [sec] | | 35.292187 usecs/op | 2258.700000 usecs/op/cpu Which is an improvement of 12% compared to without the histogram optimizations (baseline is 40 usecs/op). This is now on par with the theoretical ideal (constraints disabled), and only 12% slower than no breakpoints at all. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-15-elver@google.com commit 9b1933b864a10e7f66b06d10c39217142baed28b Author: Marco Elver Date: Mon Aug 29 14:47:18 2022 +0200 perf/hw_breakpoint: Optimize max_bp_pinned_slots() for CPU-independent task targets Running the perf benchmark with (note: more aggressive parameters vs. preceding changes, but same 256 CPUs host): | $> perf bench -r 100 breakpoint thread -b 4 -p 128 -t 512 | # Running 'breakpoint/thread' benchmark: | # Created/joined 100 threads with 4 breakpoints and 128 parallelism | Total time: 1.989 [sec] | | 38.854160 usecs/op | 4973.332500 usecs/op/cpu 20.43% [kernel] [k] queued_spin_lock_slowpath 18.75% [kernel] [k] osq_lock 16.98% [kernel] [k] rhashtable_jhash2 8.34% [kernel] [k] task_bp_pinned 4.23% [kernel] [k] smp_cfm_core_cond 3.65% [kernel] [k] bcmp 2.83% [kernel] [k] toggle_bp_slot 1.87% [kernel] [k] find_next_bit 1.49% [kernel] [k] __reserve_bp_slot We can see that a majority of the time is now spent hashing task pointers to index into task_bps_ht in task_bp_pinned(). Obtaining the max_bp_pinned_slots() for CPU-independent task targets currently is O(#cpus), and calls task_bp_pinned() for each CPU, even if the result of task_bp_pinned() is CPU-independent. The loop in max_bp_pinned_slots() wants to compute the maximum slots across all CPUs. If task_bp_pinned() is CPU-independent, we can do so by obtaining the max slots across all CPUs and adding task_bp_pinned(). To do so in O(1), use a bp_slots_histogram for CPU-pinned slots. After this optimization: | $> perf bench -r 100 breakpoint thread -b 4 -p 128 -t 512 | # Running 'breakpoint/thread' benchmark: | # Created/joined 100 threads with 4 breakpoints and 128 parallelism | Total time: 1.930 [sec] | | 37.697832 usecs/op | 4825.322500 usecs/op/cpu 19.13% [kernel] [k] queued_spin_lock_slowpath 18.21% [kernel] [k] rhashtable_jhash2 15.46% [kernel] [k] osq_lock 6.27% [kernel] [k] toggle_bp_slot 5.91% [kernel] [k] task_bp_pinned 5.05% [kernel] [k] smp_cfm_core_cond 1.78% [kernel] [k] update_sg_lb_stats 1.36% [kernel] [k] llist_reverse_order 1.34% [kernel] [k] find_next_bit 1.19% [kernel] [k] bcmp Suggesting that time spent in task_bp_pinned() has been reduced. However, we're still hashing too much, which will be addressed in the subsequent change. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-14-elver@google.com commit 16db2839a5a59c242df77308cf57342ce0c3768e Author: Marco Elver Date: Mon Aug 29 14:47:17 2022 +0200 perf/hw_breakpoint: Introduce bp_slots_histogram Factor out the existing `atomic_t count[N]` into its own struct called 'bp_slots_histogram', to generalize and make its intent clearer in preparation of reusing elsewhere. The basic idea of bucketing "total uses of N slots" resembles a histogram, so calling it such seems most intuitive. No functional change. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-13-elver@google.com commit 0912037fec1136d4e4796a3481f4a4ee09a2c325 Author: Marco Elver Date: Mon Aug 29 14:47:16 2022 +0200 perf/hw_breakpoint: Reduce contention with large number of tasks While optimizing task_bp_pinned()'s runtime complexity to O(1) on average helps reduce time spent in the critical section, we still suffer due to serializing everything via 'nr_bp_mutex'. Indeed, a profile shows that now contention is the biggest issue: 95.93% [kernel] [k] osq_lock 0.70% [kernel] [k] mutex_spin_on_owner 0.22% [kernel] [k] smp_cfm_core_cond 0.18% [kernel] [k] task_bp_pinned 0.18% [kernel] [k] rhashtable_jhash2 0.15% [kernel] [k] queued_spin_lock_slowpath when running the breakpoint benchmark with (system with 256 CPUs): | $> perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 0.207 [sec] | | 108.267188 usecs/op | 6929.100000 usecs/op/cpu The main concern for synchronizing the breakpoint constraints data is that a consistent snapshot of the per-CPU and per-task data is observed. The access pattern is as follows: 1. If the target is a task: the task's pinned breakpoints are counted, checked for space, and then appended to; only bp_cpuinfo::cpu_pinned is used to check for conflicts with CPU-only breakpoints; bp_cpuinfo::tsk_pinned are incremented/decremented, but otherwise unused. 2. If the target is a CPU: bp_cpuinfo::cpu_pinned are counted, along with bp_cpuinfo::tsk_pinned; after a successful check, cpu_pinned is incremented. No per-task breakpoints are checked. Since rhltable safely synchronizes insertions/deletions, we can allow concurrency as follows: 1. If the target is a task: independent tasks may update and check the constraints concurrently, but same-task target calls need to be serialized; since bp_cpuinfo::tsk_pinned is only updated, but not checked, these modifications can happen concurrently by switching tsk_pinned to atomic_t. 2. If the target is a CPU: access to the per-CPU constraints needs to be serialized with other CPU-target and task-target callers (to stabilize the bp_cpuinfo::tsk_pinned snapshot). We can allow the above concurrency by introducing a per-CPU constraints data reader-writer lock (bp_cpuinfo_sem), and per-task mutexes (reuses task_struct::perf_event_mutex): 1. If the target is a task: acquires perf_event_mutex, and acquires bp_cpuinfo_sem as a reader. The choice of percpu-rwsem minimizes contention in the presence of many read-lock but few write-lock acquisitions: we assume many orders of magnitude more task target breakpoints creations/destructions than CPU target breakpoints. 2. If the target is a CPU: acquires bp_cpuinfo_sem as a writer. With these changes, contention with thousands of tasks is reduced to the point where waiting on locking no longer dominates the profile: | $> perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 0.077 [sec] | | 40.201563 usecs/op | 2572.900000 usecs/op/cpu 21.54% [kernel] [k] task_bp_pinned 20.18% [kernel] [k] rhashtable_jhash2 6.81% [kernel] [k] toggle_bp_slot 5.47% [kernel] [k] queued_spin_lock_slowpath 3.75% [kernel] [k] smp_cfm_core_cond 3.48% [kernel] [k] bcmp On this particular setup that's a speedup of 2.7x. We're also getting closer to the theoretical ideal performance through optimizations in hw_breakpoint.c -- constraints accounting disabled: | perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 0.067 [sec] | | 35.286458 usecs/op | 2258.333333 usecs/op/cpu Which means the current implementation is ~12% slower than the theoretical ideal. For reference, performance without any breakpoints: | $> bench -r 30 breakpoint thread -b 0 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 0 breakpoints and 64 parallelism | Total time: 0.060 [sec] | | 31.365625 usecs/op | 2007.400000 usecs/op/cpu On a system with 256 CPUs, the theoretical ideal is only ~12% slower than no breakpoints at all; the current implementation is ~28% slower. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-12-elver@google.com commit 01fe8a3f818e1074a9a95d624be4549ee7ea2b2b Author: Marco Elver Date: Mon Aug 29 14:47:15 2022 +0200 locking/percpu-rwsem: Add percpu_is_write_locked() and percpu_is_read_locked() Implement simple accessors to probe percpu-rwsem's locked state: percpu_is_write_locked(), percpu_is_read_locked(). Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-11-elver@google.com commit f95e5a3d59011eec1257d0e76de1e1f8969d426f Author: Marco Elver Date: Mon Aug 29 14:47:14 2022 +0200 powerpc/hw_breakpoint: Avoid relying on caller synchronization Internal data structures (cpu_bps, task_bps) of powerpc's hw_breakpoint implementation have relied on nr_bp_mutex serializing access to them. Before overhauling synchronization of kernel/events/hw_breakpoint.c, introduce 2 spinlocks to synchronize cpu_bps and task_bps respectively, thus avoiding reliance on callers synchronizing powerpc's hw_breakpoint. Reported-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-10-elver@google.com commit 9d0d887ac7e5a32834cda4f305e1875fccaf67ff Author: Nícolas F. R. A. Prado Date: Mon Aug 29 16:44:39 2022 -0400 soc: mediatek: mtk-svs: Explicitly include bitfield header Commit a92438c5a30a ("soc: mediatek: mtk-svs: Use bitfield access macros where possible") introduced the use of FIELD_GET and FIELD_PREP macros, which are defined in the bitfield header. Add an explicit include for it so we're sure to have the symbols defined independently of the config. Fixes: a92438c5a30a ("soc: mediatek: mtk-svs: Use bitfield access macros where possible") Reported-by: kernel test robot Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220829204439.3748648-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 24198ad373ad1e30b638aa147142dc21ab5757e7 Author: Marco Elver Date: Mon Aug 29 14:47:13 2022 +0200 perf/hw_breakpoint: Remove useless code related to flexible breakpoints Flexible breakpoints have never been implemented, with bp_cpuinfo::flexible always being 0. Unfortunately, they still occupy 4 bytes in each bp_cpuinfo and bp_busy_slots, as well as computing the max flexible count in fetch_bp_busy_slots(). This again causes suboptimal code generation, when we always know that `!!slots.flexible` will be 0. Just get rid of the flexible "placeholder" and remove all real code related to it. Make a note in the comment related to the constraints algorithm but don't remove them from the algorithm, so that if in future flexible breakpoints need supporting, it should be trivial to revive them (along with reverting this change). Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-9-elver@google.com commit 9caf87be118f4639537404eeb67dd444a3716e9a Author: Marco Elver Date: Mon Aug 29 14:47:12 2022 +0200 perf/hw_breakpoint: Make hw_breakpoint_weight() inlinable Due to being a __weak function, hw_breakpoint_weight() will cause the compiler to always emit a call to it. This generates unnecessarily bad code (register spills etc.) for no good reason; in fact it appears in profiles of `perf bench -r 100 breakpoint thread -b 4 -p 128 -t 512`: ... 0.70% [kernel] [k] hw_breakpoint_weight ... While a small percentage, no architecture defines its own hw_breakpoint_weight() nor are there users outside hw_breakpoint.c, which makes the fact it is currently __weak a poor choice. Change hw_breakpoint_weight()'s definition to follow a similar protocol to hw_breakpoint_slots(), such that if defines hw_breakpoint_weight(), we'll use it instead. The result is that it is inlined and no longer shows up in profiles. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-8-elver@google.com commit be3f152568cc7f5f573d21d5f86a2c4f3cc047ab Author: Marco Elver Date: Mon Aug 29 14:47:11 2022 +0200 perf/hw_breakpoint: Optimize constant number of breakpoint slots Optimize internal hw_breakpoint state if the architecture's number of breakpoint slots is constant. This avoids several kmalloc() calls and potentially unnecessary failures if the allocations fail, as well as subtly improves code generation and cache locality. The protocol is that if an architecture defines hw_breakpoint_slots via the preprocessor, it must be constant and the same for all types. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-7-elver@google.com commit db5f6f853194c5e02d8551425b5e86b7e0b81806 Author: Marco Elver Date: Mon Aug 29 14:47:10 2022 +0200 perf/hw_breakpoint: Mark data __ro_after_init Mark read-only data after initialization as __ro_after_init. While we are here, turn 'constraints_initialized' into a bool. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-6-elver@google.com commit 0370dc314df35579b751d1b77c9169f071444962 Author: Marco Elver Date: Mon Aug 29 14:47:09 2022 +0200 perf/hw_breakpoint: Optimize list of per-task breakpoints On a machine with 256 CPUs, running the recently added perf breakpoint benchmark results in: | $> perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 236.418 [sec] | | 123134.794271 usecs/op | 7880626.833333 usecs/op/cpu The benchmark tests inherited breakpoint perf events across many threads. Looking at a perf profile, we can see that the majority of the time is spent in various hw_breakpoint.c functions, which execute within the 'nr_bp_mutex' critical sections which then results in contention on that mutex as well: 37.27% [kernel] [k] osq_lock 34.92% [kernel] [k] mutex_spin_on_owner 12.15% [kernel] [k] toggle_bp_slot 11.90% [kernel] [k] __reserve_bp_slot The culprit here is task_bp_pinned(), which has a runtime complexity of O(#tasks) due to storing all task breakpoints in the same list and iterating through that list looking for a matching task. Clearly, this does not scale to thousands of tasks. Instead, make use of the "rhashtable" variant "rhltable" which stores multiple items with the same key in a list. This results in average runtime complexity of O(1) for task_bp_pinned(). With the optimization, the benchmark shows: | $> perf bench -r 30 breakpoint thread -b 4 -p 64 -t 64 | # Running 'breakpoint/thread' benchmark: | # Created/joined 30 threads with 4 breakpoints and 64 parallelism | Total time: 0.208 [sec] | | 108.422396 usecs/op | 6939.033333 usecs/op/cpu On this particular setup that's a speedup of ~1135x. While one option would be to make task_struct a breakpoint list node, this would only further bloat task_struct for infrequently used data. Furthermore, after all optimizations in this series, there's no evidence it would result in better performance: later optimizations make the time spent looking up entries in the hash table negligible (we'll reach the theoretical ideal performance i.e. no constraints). Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-5-elver@google.com commit 089cdcb0cd1c25343fa56d3eabbe878df31a7c0e Author: Marco Elver Date: Mon Aug 29 14:47:08 2022 +0200 perf/hw_breakpoint: Clean up headers Clean up headers: - Remove unused - Remove unused - Remove unused - Remove unused - Add for EXPORT_SYMBOL_GPL(). - Add for mutex. - Sort alphabetically. - Move to top to test it compiles on its own. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-4-elver@google.com commit c5b81449f915a28bb9c7725e53aebab3ba39b4a2 Author: Marco Elver Date: Mon Aug 29 14:47:07 2022 +0200 perf/hw_breakpoint: Provide hw_breakpoint_is_used() and use in test Provide hw_breakpoint_is_used() to check if breakpoints are in use on the system. Use it in the KUnit test to verify the global state before and after a test case. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-3-elver@google.com commit 724c299c6a0e412b5679d7ebb9b3f4e00bd2aa78 Author: Marco Elver Date: Mon Aug 29 14:47:06 2022 +0200 perf/hw_breakpoint: Add KUnit test for constraints accounting Add KUnit test for hw_breakpoint constraints accounting, with various interesting mixes of breakpoint targets (some care was taken to catch interesting corner cases via bug-injection). The test cannot be built as a module because it requires access to hw_breakpoint_slots(), which is not inlinable or exported on all architectures. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20220829124719.675715-2-elver@google.com commit 6210fc2e4ca2551cb09fd122ee49ebcf64487f3e Author: Nícolas F. R. A. Prado Date: Fri Jul 8 15:43:14 2022 -0400 arm64: dts: mediatek: Add missing xHCI clocks for mt8192 and mt8195 The MediaTek xHCI dt-binding expects a specific order for the clocks, but the mt8192 and mt8195 devicetrees were skipping some of the middle clocks. These clocks are wired to the controller hardware but aren't controllable. Add the missing clocks as handles to fixed clocks, so that the clock order is respected and the dtbs_check warnings are gone. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220708194314.56922-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 2baedb9f93c42d35016c3c2e3015d67fbcb058b0 Author: Dmitry Baryshkov Date: Sat Apr 30 11:47:40 2022 +0300 PCI: qcom-ep: Add MODULE_DEVICE_TABLE Add MODULE_DEVICE_TABLE to enable module autoloading for respective device. Link: https://lore.kernel.org/r/20220430084740.3769925-1-dmitry.baryshkov@linaro.org Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") Signed-off-by: Dmitry Baryshkov Signed-off-by: Lorenzo Pieralisi commit 53aa930dc4bae6aa269951bd37103083145d6691 Merge: 5531ecffa4b92 09348d75a6ce6 Author: Ingo Molnar Date: Tue Aug 30 10:27:33 2022 +0200 Merge branch 'sched/warnings' into sched/core, to pick up WARN_ON_ONCE() conversion commit Merge in the BUG_ON() => WARN_ON_ONCE() conversion commit. Signed-off-by: Ingo Molnar commit 3359d52755e5bf1268d96ce7e9d6e8c1b4700225 Author: Zhang Jianhua Date: Tue Aug 30 16:07:32 2022 +0800 cpufreq: bmips-cpufreq: Use module_init and add module_exit - Use module_init instead of device_initcall. - Add a function for module_exit to unregister driver. Signed-off-by: Zhang Jianhua Signed-off-by: Viresh Kumar commit 7c1dceaffd99247bf443606730515b54d6285969 Author: Pin-yen Lin Date: Tue Aug 30 12:57:56 2022 +0800 drm/bridge: it6505: Fix the order of DP_SET_POWER commands Send DP_SET_POWER_D3 command to the downstream before stopping DP, so the suspend process will not be interrupted by the HPD interrupt. Also modify the order in .atomic_enable callback to make the callbacks symmetric. Fixes: 46ca7da7f1e8 ("drm/bridge: it6505: Send DPCD SET_POWER to downstream") Signed-off-by: Pin-yen Lin Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220830045756.1655954-1-treapking@chromium.org commit 1ff673333d46d2c1b053ebd0c1c7c7c79e36943e Author: Zheyu Ma Date: Tue Aug 30 15:34:50 2022 +0800 drm/bridge: megachips: Fix a null pointer dereference bug When removing the module we will get the following warning: [ 31.911505] i2c-core: driver [stdp2690-ge-b850v3-fw] unregistered [ 31.912484] general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN PTI [ 31.913338] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] [ 31.915280] RIP: 0010:drm_bridge_remove+0x97/0x130 [ 31.921825] Call Trace: [ 31.922533] stdp4028_ge_b850v3_fw_remove+0x34/0x60 [megachips_stdpxxxx_ge_b850v3_fw] [ 31.923139] i2c_device_remove+0x181/0x1f0 The two bridges (stdp2690, stdp4028) do not probe at the same time, so the driver does not call ge_b850v3_resgiter() when probing, causing the driver to try to remove the object that has not been initialized. Fix this by checking whether both the bridges are probed. Fixes: 11632d4aa2b3 ("drm/bridge: megachips: Ensure both bridges are probed before registration") Signed-off-by: Zheyu Ma Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220830073450.1897020-1-zheyuma97@gmail.com commit 5b04aab6d49578eacd6d341e281c70a769f96126 Author: Jani Nikula Date: Mon Aug 15 11:58:34 2022 +0300 drm/dp: add drm_dp_phy_name() for getting DP PHY name Add a helper for getting the DP PHY name. In the interest of caller simplicity and to avoid allocations and passing in of buffers, duplicate the const strings to return. It's a minor penalty to pay for simplicity in all the call sites. v2: Rebase, add kernel-doc, ensure non-NULL always Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/b08dc12a7e621a48ec35546d6cd1ed4b1434810d.1660553850.git.jani.nikula@intel.com commit 1cc6987e501d9cb5b83c26da1f07f5e662db7c4c Author: Duc Nguyen Date: Mon Aug 29 14:41:30 2022 +0200 arm64: dts: renesas: r8a779f0: Add MSIOF nodes Add MSIOF nodes for R-Car S4-8. Signed-off-by: Duc Nguyen [thanh: added DMA] Signed-off-by: Thanh Quan [wsa: removed mso clock from clocks-property] Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220829124130.2412-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit fddccbcb4de7ae734977da1a4c6d4c04a36a8f62 Author: Kuninori Morimoto Date: Mon Aug 29 23:50:07 2022 +0000 dt-bindings: arm: renesas: Document Renesas R-Car V3H2 SoC and board This patch adds the new R-Car V3H2 SoC and the Condor-I board using it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wnaq4nkh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 71351b0e5646c8c4e758fb70942667eda096d09c Author: Wolfram Sang Date: Thu Aug 18 23:00:56 2022 +0200 phy: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220818210056.7205-1-wsa+renesas@sang-engineering.com Signed-off-by: Vinod Koul commit a2e927b0e50d1c181f602f6ab091d8349b08211c Author: Bjorn Andersson Date: Tue Aug 9 21:23:03 2022 -0700 phy: qcom-qmp-combo: Add sc8280xp USB/DP combo phys The SC8280P has two copies of an USB/DP compbo PHY, add support for this to the Qualcomm QMP PHY driver. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810042303.3583194-5-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit c0c7769cdae24467b99d45b9d1073940d7a39664 Author: Bjorn Andersson Date: Tue Aug 9 21:23:02 2022 -0700 phy: qcom-qmp: Add SC8280XP USB3 UNI phy The SC8280XP platform has two instances of the 5nm USB3 UNI phy attached to the multi-port USB controller, add definition for these. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810042303.3583194-4-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 712e5dffe9115ba3cf0dc9969b5d8f113f81ebda Author: Bjorn Andersson Date: Tue Aug 9 21:23:01 2022 -0700 phy: qcom-qmp-combo: Parameterize swing and pre_emphasis tables The swing and pre-emphasis tables differ between different PHY versions, or perhaps between different platforms. In particular in order to introduce SC8280XP these tables needs to be replaced. Make it possible to specify these tables per PHY config. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810042303.3583194-3-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit aa27597e594cb2ed1fcaa57d4bcefab34020b62b Author: Bjorn Andersson Date: Tue Aug 9 21:23:00 2022 -0700 dt-bindings: phy: qcom,qmp: Add compatible for SC8280XP USB phys The SC8280XP platform has a pair of 5nm USB3 UNI phys and a pair of 5nm USB4/3/DP combo PHYs, add a compatible for these. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220810042303.3583194-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit d88497fb6bbdd19a136a7ac1007c60e3e38bebc4 Author: Dmitry Baryshkov Date: Tue Aug 9 22:09:26 2022 -0500 phy: qualcomm: phy-qcom-qmp: add support for combo USB3+DP phy on SDM845 Define configuration to be used by combo USB3 + DisplayPort phy on SDM845 SoC family. It closely follows sc7180, however like the main USB3 phy it uses the qmp_v3_usb3phy_cfg config. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810030926.2794179-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 55174159a2a67ffc1805c9ad662b7db39bd3d5fd Author: Chanho Park Date: Mon Jul 25 09:02:49 2022 +0900 dt-bindings: phy: samsung,ufs-phy: match clock items Below error is detected from dtbs_check. exynos7-ufs-phy is required symbol clocks otherwise only PLL ref clock is required. clock-names: ['ref_clk'] is too short Reported-by: Krzysztof Kozlowski Suggested-by: Krzysztof Kozlowski Suggested-by: Alim Akhtar Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220725000249.30509-1-chanho61.park@samsung.com Signed-off-by: Vinod Koul commit 533e13305c16c63915f7cc8a36ed7ef717e15378 Author: Uwe Kleine-König Date: Sat Jul 16 16:54:03 2022 +0200 phy: tegra: xusb: Only warn once about reset problems in .remove() The single difference between returning 0 and returning an error code in a platform remove callback is that in the latter case the platform core emits a warning about the error being ignored. If reset_control_assert() fails there is already a warning, so suppress the more generic (and less helpful) by returning 0 in tegra_xusb_padctl_remove(). This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220716145403.107703-1-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit c77c1853a2ecf818cd6842b9d5907ed71d1e2c29 Author: Rob Herring Date: Tue Aug 23 09:56:45 2022 -0500 dt-bindings: phy: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-14-robh@kernel.org Signed-off-by: Vinod Koul commit 04aebe18325c0c544371e8e77a4f5de6f6486446 Author: Konrad Dybcio Date: Sat Jul 16 21:32:53 2022 +0200 dt-bindings: phy: qcom,usb-snps-femto-v2: Add SM6375 Add a compatible for the USB PHY on SM6375 Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220716193257.456023-3-konrad.dybcio@somainline.org Signed-off-by: Vinod Koul commit ebdb28a55da1248d6dfe3bcde9c9f6198f770b2d Author: Tomi Valkeinen Date: Tue Apr 26 09:06:16 2022 +0200 media: ti: cal: use CSI-2 frame number for seq number The userspace needs a way to match received metadata buffers to pixel data buffers. The obvious way to do this is to use the CSI-2 frame number, as both the metadata and the pixel data have the same frame number as they come from the same frame. However, we don't have means to convey the frame number to userspace. We do have the 'sequence' field, which with a few tricks can be used for this purpose. To achieve this, track the frame number for each virtual channel and increase the sequence for each virtual channel by frame-number - previous-frame-number, also taking into account the eventual wrap of the CSI-2 frame number. If the CSI-2 peripheral does not support frame numbers, CAL increases the frame number register by one each frame. This way we get a monotonically increasing sequence number which is common to all streams using the same virtual channel. Signed-off-by: Tomi Valkeinen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b1b93d36c385436742ce4ddf412faaa0383529a5 Author: Tomi Valkeinen Date: Tue Apr 26 09:06:15 2022 +0200 media: ti: cal: rename sd_state to state Rename 'sd_state' parameters to 'state'. There are no other states, so there is no ambiguity. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2a50e8d75abaa9f878ec424c3d0a0c8d98767d0b Author: Tomi Valkeinen Date: Tue Apr 26 09:06:14 2022 +0200 media: ti: cal: fix useless variable init 'ret' is initialized needlessly in cal_legacy_try_fmt_vid_cap(). We can also move the variable to the for block, which is the only place where it is used. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3028fb90f5b972ef9b9e68e75a8372b8f9a8e312 Author: Hans Verkuil Date: Wed Aug 24 09:00:24 2022 +0200 media: tc358743: limit msg.len to CEC_MAX_MSG_SIZE I expect that the hardware will have limited this to 16, but just in case it hasn't, check for this corner case. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 05c480f4d0ba438e6d37a1660d81cc7eb670e26b Author: Hans Verkuil Date: Wed Aug 24 08:57:26 2022 +0200 media: media/cec: use CEC_MAX_MSG_SIZE instead of hardcoded 16 Use the proper define for the maximum CEC message length instead of hardcoding it. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 107ca18cad69162fd2750c4616fa1cc02b15394d Author: Hans Verkuil Date: Wed Aug 24 08:20:46 2022 +0200 media: MAINTAINERS: change tc358743 maintainer Move maintainer from Mats to Hans. Add bindings file to the list of maintained files while we're at it. Signed-off-by: Hans Verkuil Signed-off-by: Mats Randgaard Signed-off-by: Mauro Carvalho Chehab commit 8e69714e6177d963668a45499b500c1d4de7bac8 Author: Christophe JAILLET Date: Mon Aug 22 11:40:43 2022 +0200 media: dw100: Fix an error handling path in dw100_probe() After a successful call to media_device_init() it is safer to call media_device_cleanup(). Add the missing call in the error handling path of the probe, as already done in the remove function. [hverkuil: fixed a typo in the commit log] Fixes: bd090d4d995a ("media: dw100: Add i.MX8MP dw100 dewarper driver") Signed-off-by: Christophe JAILLET Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a7985e3cecd56d0f553487ac12fe4f65962c4b34 Author: Daniel Lee Kruse Date: Fri Aug 19 05:59:18 2022 +0200 media: cx23885: reset DMA on AMD Renior/Cezanne IOMMU due to RiSC engine stall MythTv is unable to scan channels with APUs with the Renior IOMMU that is also contained in the Cezanne line of APUs. This issue was discovered on the 5.15 version the kernel. This patch adds the IOMMU PCI ID to the broken_dev_id array. This patch was developed with 5.19 of the media_tree repo. [hverkuil: cleaned up the commit log a bit] Signed-off-by: Daniel Lee Kruse Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 999b95a72d90ed7a7073eae594fa35462d71854f Author: Gustavo A. R. Silva Date: Mon Aug 29 16:52:03 2022 -0500 ALSA: hda/hdmi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length array declaration in union audio_infoframe with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for a flexible-array member in a union. Link: https://github.com/KSPP/linux/issues/193 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/Yw01A+TvF1FWQ588@work Signed-off-by: Takashi Iwai commit 17611d3fb4a11ec500c49cb952faf09e114a5a10 Author: Hans Verkuil Date: Thu Aug 18 09:51:40 2022 +0200 media: videodev2.h: drop V4L2_CAP_ASYNCIO The V4L2_CAP_ASYNCIO capability was never implemented (and in fact it isn't clear what it was supposed to do in the first place). Drop it from the capabilities list. Keep it in videodev2.h with the other defines under ifndef __KERNEL__ for backwards compatibility. This will free up a capability bit for other future uses. And having an unused and undefined I/O method is just plain confusing. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 0565b91eae14b65850f33a571d59c1cac725536c Author: Ondrej Jirman Date: Mon Aug 15 12:36:22 2022 +0200 media: rockchip: rga: Fix probe rga_parse_dt bugs rga_parse_dt is missing a error return, so if some of the resources return DEFER_PROBE, probe will succeed without these resources. Signed-off-by: Ondrej Jirman Co-developed-by: Jarrah Gosbell Signed-off-by: Jarrah Gosbell Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1c24bb3f8bec5805df4763a4327ce616fadfed65 Author: Deborah Brouwer Date: Thu Aug 11 22:37:56 2022 +0200 media: v4l2-ctrls: Fix typo in VP8 comment The comment for the VP8 loop filter flags uses the partially wrong name for the flags. Unlike the other VP8 flag names, the loop filter flag names don't have "_FLAG" in them. Change the comment so that it matches the actual flag definitions in the header. Signed-off-by: Deborah Brouwer Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 23bc5eb55f8c9607965c20d9ddcc13cb1ae59568 Author: Dongliang Mu Date: Thu Aug 11 06:57:00 2022 +0200 media: airspy: fix memory leak in airspy probe The commit ca9dc8d06ab6 ("media: airspy: respect the DMA coherency rules") moves variable buf from stack to heap, however, it only frees buf in the error handling code, missing deallocation in the success path. Fix this by freeing buf in the success path since this variable does not have any references in other code. Fixes: ca9dc8d06ab6 ("media: airspy: respect the DMA coherency rules") Reported-by: syzbot+bb25f85e5aa482864dc0@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Reviewed-by: Tommaso Merciai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3b7267dec4456314794632a94ff2ed30bc35c576 Author: Bjorn Andersson Date: Tue Aug 9 21:07:45 2022 -0700 phy: qcom: edp: Add SC8280XP eDP and DP PHYs The Qualcomm SC8280XP platform has a number of eDP and DP PHY instances, add support for these. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810040745.3582985-6-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 2300d1cb24b3290e1e04b78692446052e911c92f Author: Bjorn Andersson Date: Tue Aug 9 21:07:44 2022 -0700 phy: qcom: edp: Introduce support for DisplayPort The eDP phy can be used to drive either eDP or DP output, with some minor variations in some of the configuration and seemingly a need for implementing swing and pre_emphasis calibration. Introduce a config object, indicating if the phy is operating in eDP or DP mode and swing/pre-emphasis calibration to support this. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810040745.3582985-5-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 5894ff12c7ec0bd5960c6f1d91b64674d9ffb9bf Author: Bjorn Andersson Date: Tue Aug 9 21:07:43 2022 -0700 phy: qcom: edp: Perform lane configuration The TRANSCIEVER_BIAS_EN, HIGHZ_DRVR_EN and PHY_CFG_1 registers are used for lane configuration, with the currently hard coded configuration being a mix of 2 and 4 lane (effectively 2-lane). Properly implement lane configuration for 1, 2 and 4 lanes. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810040745.3582985-4-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 317e00bbf950b5dd83f18f6771c3e402485052ea Author: Bjorn Andersson Date: Tue Aug 9 21:07:42 2022 -0700 phy: qcom: edp: Generate unique clock names With multiple Displayport PHYs the hard coded clock names collides, generate unique clock names based on the device name instead. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810040745.3582985-3-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 6993c079cd58b6ab19b1190986d59afdf70b47aa Author: Bjorn Andersson Date: Tue Aug 9 21:07:41 2022 -0700 dt-bindings: phy: qcom-edp: Add SC8280XP PHY compatibles The Qualcomm SC8280XP platform has both eDP and DP PHYs, add compatibles for these. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220810040745.3582985-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit d682869daa23938b5e8919db45c4b5b227749712 Author: Zeng Jingxiang Date: Thu Jul 28 18:12:36 2022 +0800 media: tm6000: Fix unused value in vidioc_try_fmt_vid_cap() Coverity warns of an unused value: assigned_value: Assign the value of the variable f->fmt.pix.field to field here, but that stored value is overwritten. before it can be used. 919 field = f->fmt.pix.field; 920 value_overwrite: Overwriting previous write to field with the value of V4L2_FIELD_INTERLACED. 921 field = V4L2_FIELD_INTERLACED; Fixes: ed57256f6fe8 ("[media] tm6000: fix G/TRY_FMT") Signed-off-by: Zeng Jingxiang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2b064d91440b33fba5b452f2d1b31f13ae911d71 Author: Zheyu Ma Date: Thu Jul 28 04:23:38 2022 +0200 media: cx88: Fix a null-ptr-deref bug in buffer_prepare() When the driver calls cx88_risc_buffer() to prepare the buffer, the function call may fail, resulting in a empty buffer and null-ptr-deref later in buffer_queue(). The following log can reveal it: [ 41.822762] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI [ 41.824488] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 41.828027] RIP: 0010:buffer_queue+0xc2/0x500 [ 41.836311] Call Trace: [ 41.836945] __enqueue_in_driver+0x141/0x360 [ 41.837262] vb2_start_streaming+0x62/0x4a0 [ 41.838216] vb2_core_streamon+0x1da/0x2c0 [ 41.838516] __vb2_init_fileio+0x981/0xbc0 [ 41.839141] __vb2_perform_fileio+0xbf9/0x1120 [ 41.840072] vb2_fop_read+0x20e/0x400 [ 41.840346] v4l2_read+0x215/0x290 [ 41.840603] vfs_read+0x162/0x4c0 Fix this by checking the return value of cx88_risc_buffer() [hverkuil: fix coding style issues] Signed-off-by: Zheyu Ma Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 211f8304fa21aaedc2c247f0c9d6c7f1aaa61ad7 Author: Liang He Date: Wed Jul 20 16:30:03 2022 +0200 media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop In fimc_is_register_subdevs(), we need to call of_node_put() for the reference 'i2c_bus' when breaking out of the for_each_compatible_node() which has increased the refcount. Fixes: 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver") Signed-off-by: Liang He Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 86d11e225e3fd204d42346effba08a7c465f6a57 Author: Roger Quadros Date: Tue Jun 28 15:22:55 2022 +0300 phy: ti: phy-j721e-wiz: set PMA_CMN_REFCLK_DIG_DIV based on reflk rate For J7200-SR2.0 and AM64 we don't model Common refclock divider as a clock divider as the divisor rate is fixed based on operating reference clock frequency. We just program the recommended value into the register. This simplifies the device tree and implementation a lot. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220628122255.24265-8-rogerq@kernel.org Signed-off-by: Vinod Koul commit edd473d4293aa5a1684f4efe0d4e0c0318a92976 Author: Roger Quadros Date: Tue Jun 28 15:22:54 2022 +0300 phy: ti: phy-j721e-wiz: add support for j7200-wiz-10g j7200-wiz-10g supports 2 reference clocks. However, the control bits for these clocks is in a separate register that sits in the System Control register space. Handle that register. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220628122255.24265-7-rogerq@kernel.org Signed-off-by: Vinod Koul commit d5f2e7475f718e3ea47953baffc3e65e07b9272b Author: Roger Quadros Date: Tue Jun 28 15:22:53 2022 +0300 dt-bindings: phy: ti,phy-j721e-wiz: Add support for ti,j7200-wiz-10g ti,j7200-wiz-10g supports an additional reference clock. Add compatible and the additional clock. Cc: Rob Herring Signed-off-by: Roger Quadros Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220628122255.24265-6-rogerq@kernel.org Signed-off-by: Vinod Koul commit 1aa54982bc2d5cd7e52bb6807ac46f8018a832ee Author: Roger Quadros Date: Tue Jun 28 15:22:52 2022 +0300 dt-bindings: phy: ti,phy-j721e-wiz: deprecate clock MUX nodes Mark "pll[0|1]-refclk", "refclk-dig" and "cmn-refclk1?-dig-div" as deprecated. The clock muxes are provided by the device driver so not required in device tree. Cc: Rob Herring Signed-off-by: Roger Quadros Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220628122255.24265-5-rogerq@kernel.org Signed-off-by: Vinod Koul commit b64a85fb8f531d201cc43088a23d8b32dc729fc2 Author: Tanmay Patil Date: Tue Jun 28 15:22:51 2022 +0300 phy: ti: phy-j721e-wiz.c: Add usxgmii support in wiz driver Changes the wiz_p_mac_div_sel() and wiz_mode_select() to configure serdes for USXGMII. Adds the support to configure mac_src_sel, refclk_sel and rxfclk_sel in the LANECTL register and configures the serdes for usxgmii. [rogerq] Fix MAC_SRC_SEL to 0x3 for USXGMII as per CSL code. Signed-off-by: Tanmay Patil Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220628122255.24265-4-rogerq@kernel.org Signed-off-by: Vinod Koul commit 288440de9e5fdb4a3ff73864850f080c1250fc81 Author: Swapnil Jakhade Date: Tue Jun 28 15:22:50 2022 +0300 dt-bindings: phy: Add PHY_TYPE_USXGMII definition Add definition for USXGMII phy type. Cc: Rob Herring Signed-off-by: Swapnil Jakhade Signed-off-by: Roger Quadros Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220628122255.24265-3-rogerq@kernel.org Signed-off-by: Vinod Koul commit 27ecdd07e3e16684fd996730100637a61d9ac2ee Author: Siddharth Vadapalli Date: Tue Jun 28 15:22:49 2022 +0300 phy: ti: phy-j721e-wiz: Add SGMII support in wiz driver for J7200 Select the same mac divider for SGMII too as the one being used for QSGMII. Enable full rate divider configuration support for J721E_WIZ_10G for SGMII. Signed-off-by: Siddharth Vadapalli Signed-off-by: Vignesh Raghavendra Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220628122255.24265-2-rogerq@kernel.org Signed-off-by: Vinod Koul commit 1f2dcf3a154acf2c33c95859d8a2023fae596a04 Author: Pierre-Louis Bossart Date: Tue Aug 23 12:50:04 2022 +0800 soundwire: intel: set dev_num_ida_min The allowed values for SoundWire device numbers are between 1 and 11 (inclusive). HDaudio/iDISP codecs typically use SDI values 0..3 (inclusive). To allow for a unique peripheral SDI/dev_number across HDaudio and SoundWire buses, we set the minimum base to 4. This still allows for 8 SoundWire peripherals in the system, currently more than needed in actual products. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823045004.2670658-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit c60561014257699d81ab392eb6cb6389ad8907df Author: Pierre-Louis Bossart Date: Tue Aug 23 12:50:03 2022 +0800 soundwire: bus: allow device number to be unique at system level The SoundWire specification allows the device number to be allocated at will. When a system includes multiple SoundWire links, the device number scope is limited to the link to which the device is attached. However, for integration/debug it can be convenient to have a unique device number across the system. This patch adds a 'dev_num_ida_min' field at the bus level, which when set will be used to allocate an IDA. The allocation happens when a hardware device reports as ATTACHED. If any error happens during the enumeration, the allocated IDA is not freed - the device number will be reused if/when the device re-joins the bus. The IDA is only freed when the Linux device is unregistered. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823045004.2670658-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 88de0a8f48bc2339e8c279315320e6f406ff5f96 Author: Pierre-Louis Bossart Date: Tue Aug 23 12:50:02 2022 +0800 soundwire: bus: rename sdw_ida as sdw_bus_ida To avoid confusions with follow-up patches using a IDA mechanism for peripheral 'device number' allocation, rename sdw_ida as sdw_bus_ida. Pure rename, no functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823045004.2670658-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 265576181b4afda8c60ae85261f55a8430419884 Author: Chao Yu Date: Sat Aug 20 11:06:00 2022 +0800 f2fs: remove gc_urgent_high_limited for cleanup Remove redundant sbi->gc_urgent_high_limited. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 34a23525601a16f625b48c3bb0a67fbc795810b3 Author: Chao Yu Date: Sat Aug 20 11:04:41 2022 +0800 f2fs: iostat: support accounting compressed IO Previously, we supported to account FS_CDATA_READ_IO type IO only, in this patch, it adds to account more type IO for compressed file: - APP_BUFFERED_CDATA_IO - APP_MAPPED_CDATA_IO - FS_CDATA_IO - APP_BUFFERED_CDATA_READ_IO - APP_MAPPED_CDATA_READ_IO Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b87846bd61c7c09560617da416208a5454530d57 Author: Eric Biggers Date: Fri Aug 19 15:33:00 2022 -0700 f2fs: use memcpy_{to,from}_page() where possible This is simpler, and as a side effect it replaces several uses of kmap_atomic() with its recommended replacement kmap_local_page(). Signed-off-by: Eric Biggers Reviewed-by: Fabio M. De Francesco Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 605b0a778aa2599aa902ae639b8e9937c74b869b Author: Jaegeuk Kim Date: Fri Aug 12 22:49:50 2022 -0700 f2fs: fix wrong continue condition in GC We should decrease the frozen counter. Cc: stable@vger.kernel.org Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 80dc113aaa47c0d1dfd01f708d4d0c083022121b Author: Jaegeuk Kim Date: Thu Aug 11 15:53:34 2022 -0700 f2fs: LFS mode does not support ATGC ATGC is using SSR which violates LFS mode used by zoned device. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4bdfd92cb14d97ef58600926ea6b2788b31c719f Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:30 2022 +0300 ARM: dts: qcom: pmx55: align SPMI PMIC Power-on node name with dtschema Bindings expect Power-on node name to be "pon": 'power-on@800' do not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: David Heidelberg Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-4-krzysztof.kozlowski@linaro.org commit 7b357d3126226b7ec4810e26f4ded44b2286d197 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:29 2022 +0300 ARM: dts: qcom: pm8941: align SPMI PMIC LPG node name with dtschema Bindings expect LPG/PWM node name to be "pwm": pmic@5: 'lpg' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: David Heidelberg Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-3-krzysztof.kozlowski@linaro.org commit 662e305dfc29b96913a03dde1e89e8968da65238 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:28 2022 +0300 ARM: dts: qcom: align SPMI PMIC ADC node name with dtschema Bindings expect VADC node name to be "adc": pmic@0: 'vadc@3100' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: David Heidelberg Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-2-krzysztof.kozlowski@linaro.org commit 209a04885ab5f76722a1671d0fbf0a5b4bccacec Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:39 2022 +0300 arm64: dts: qcom: sdm845-mtp: correct ADC settle time The PMIC's VADC property for settle time is qcom,hw-settle-time, not qcom,hw-settle-time-us. The latter is used in PMIC's TM ADC. qcom/sdm845-mtp.dtb: pmic@0: adc@3100:adc-chan@4c: 'qcom,hw-settle-time-us' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: d5e12f3823ae ("arm64: dts: qcom: sdm845: mtp: Add vadc channels and thermal zones") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-13-krzysztof.kozlowski@linaro.org commit 5589ffb2da2a66988ab3a68334dad3e68b42e3a9 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:38 2022 +0300 arm64: dts: qcom: sc7280-idp: correct ADC channel node name and unit address Correct SPMI PMIC VADC channel node name: 1. Use hyphens instead of underscores, 2. Add missing unit address. This fixes `make dtbs_check` warnings like: qcom/sc7280-idp.dtb: pmic@0: adc@3100: 'pmk8350_die_temp', 'pmr735a_die_temp' do not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-12-krzysztof.kozlowski@linaro.org commit 09a19abffbd54c20809acb969ebbacc25178f720 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:37 2022 +0300 arm64: dts: qcom: align PMIC GPIO pin configuration with DT schema DT schema expects PMIC GPIO pin configuration nodes to be named with '-state' suffix: qcom/sc7280-herobrine-crd.dtb: pmic@2: gpio@8800: 'edp-bl-reg-en' does not match any of the regexes: '-state$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-11-krzysztof.kozlowski@linaro.org commit 87783dbe1c289adf0998aed0fb4bb846130ec580 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:36 2022 +0300 arm64: dts: qcom: align SPMI PMIC Power-on node name with dtschema Bindings expect Power-on node name to be "pon": 'power-on@800' do not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-10-krzysztof.kozlowski@linaro.org commit 15f50a487121f382f95975ad6cce14a2fe51baa3 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:35 2022 +0300 arm64: dts: qcom: align SPMI PMIC LPG node name with dtschema Bindings expect LPG/PWM node name to be "pwm": pmic@5: 'lpg' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-9-krzysztof.kozlowski@linaro.org commit c29ed5af6f3af7f8c74e41a97917db7a064a7984 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:34 2022 +0300 arm64: dts: qcom: align SPMI PMIC regulators node name with dtschema Bindings expect regulators node name to be "regulators": qcom/sdm630-sony-xperia-nile-voyager.dtb: pmic@3: 'pm660l-regulators' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Reviewed-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-8-krzysztof.kozlowski@linaro.org commit fe9132202a0bbbf0b3863b491e313b73783a17b6 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:33 2022 +0300 arm64: dts: qcom: align SPMI PMIC ADC node name with dtschema Bindings expect VADC node name to be "adc": pmic@0: 'vadc@3100' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-7-krzysztof.kozlowski@linaro.org commit 64a48a25aeb12a0c326255f6457c67c901279d59 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:32 2022 +0300 arm64: dts: qcom: pmk8350: drop interrupt-names from ADC The SPMI PMIC VADC and Thermal Monitoring ADC have only one interrupt line and their bindings do not allow interrupt-names. None of other variants use them, so drop it from DTSI. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-6-krzysztof.kozlowski@linaro.org commit 448d8cdea68af91112614d4da8b4056d5b7ad7f1 Author: Krzysztof Kozlowski Date: Sun Aug 28 11:43:31 2022 +0300 arm64: dts: qcom: pmk8350: drop incorrect io-channel-ranges Since commit 044b32fa5229 ("dt-bindings:iio:qcom-spmi-vadc drop incorrect io-channel-ranges from example") the io-channel-ranges are not allowed in the Qualcomm SPMI PMIC ADC and anyway they are not correct for IIO provider. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828084341.112146-5-krzysztof.kozlowski@linaro.org commit ad3b0f33fa54b472d11169c1f0ada1b1d0ca5c6f Author: Akhil P Oommen Date: Mon Aug 29 01:10:55 2022 +0530 arm64: dts: qcom: sc7280: Update gpu opp table On the lite sku where GPU Fmax is 550Mhz, voting for a slightly higher bandwidth at the highest gpu opp helps to improve "Manhattan offscreen" score by 10%. Update the gpu opp table such that this is applicable only on SKUs which has 550Mhz as GPU Fmax. Signed-off-by: Akhil P Oommen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829011035.1.Ie3564662150e038571b7e2779cac7229191cf3bf@changeid commit cab29d324a0531cf396bf0fe57868146918af245 Author: Matthias Kaehlcke Date: Mon Aug 29 09:44:38 2022 -0700 arm64: dts: qcom: sc7280-qcard: Add alias 'wifi0' Add the alias 'wifi0' for the WiFi interface on the Qcard. The alias is needed by the BIOS which patches the WiFi MAC address read from the VPD (Vital Product Data) into the device tree. Signed-off-by: Matthias Kaehlcke Reviewed-by: Konrad Dybcio Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220829094435.1.I4534cf408373478dd6e84dc8b9ddd0d4e1a3f143@changeid commit d8200483617ce8e0610f612fcb5575134511bdc1 Merge: ff6d365898d4d c13d7d261e361 Author: Bjorn Andersson Date: Mon Aug 29 21:22:46 2022 -0500 Merge tag '20220825043859.30066-3-manivannan.sadhasivam@linaro.org' into drivers-for-6.1 v6.0-rc1 + 20220825043859.30066-2-manivannan.sadhasivam@linaro.org + 20220825043859.30066-3-manivannan.sadhasivam@linaro.org Signed-off-by: Bjorn Andersson commit c13d7d261e361dbaf5adbdc216ee4a1204c48001 Author: Manivannan Sadhasivam Date: Thu Aug 25 10:08:56 2022 +0530 soc: qcom: llcc: Pass LLCC version based register offsets to EDAC driver The LLCC EDAC register offsets varies between each SoCs. Until now, the EDAC driver used the hardcoded register offsets. But this caused crash on SM8450 SoC where the register offsets has been changed. So to avoid this crash and also to make it easy to accommodate changes for new SoCs, let's pass the LLCC version specific register offsets to the EDAC driver. Currently, two set of offsets are used. One is starting from LLCC version v1.0.0 used by all SoCs other than SM8450. For SM8450, LLCC version starting from v2.1.0 is used. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Sai Prakash Ranjan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220825043859.30066-3-manivannan.sadhasivam@linaro.org commit 5365cea199c70d6abedc2e1be850c03e990f1829 Author: Manivannan Sadhasivam Date: Thu Aug 25 10:08:55 2022 +0530 soc: qcom: llcc: Rename reg_offset structs to reflect LLCC version The register offsets used by the LLCC block retains its layout for multiple versions. For instance, starting from version v1.0.0 to v2.0.1 the offsets are same. And starting from v2.1.0, the offsets changed. But the current reg_offset naming convention is confusing. So to reflect this change correctly in driver, let's encode the start version from which the offsets got changed in reg_offset struct name. This will be llcc_v1_reg_offset for v1.0.0 and llcc_v2_1_reg_offset for v2.1.0. This will allow multiple SoCs to use the same reg_offset clearly. And in the future if the offsets got changed again, then that specific version could be encoded in the struct name. Suggested-by: Sai Prakash Ranjan Signed-off-by: Manivannan Sadhasivam Reviewed-by: Sai Prakash Ranjan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220825043859.30066-2-manivannan.sadhasivam@linaro.org commit 501e4bb102ee2f380ab94abbf3d35dff9d4719a2 Author: wuchi Date: Tue Aug 30 00:26:09 2022 +0800 audit: use time_after to compare time Using time_{*} macro to compare time is better Signed-off-by: wuchi Signed-off-by: Paul Moore commit ff6d365898d4d31bd557954c7fc53f38977b491c Author: Jeff Johnson Date: Mon Aug 22 08:34:35 2022 -0700 soc: qcom: qmi: use const for struct qmi_elem_info Currently all usage of struct qmi_elem_info, which is used to define the QMI message encoding/decoding rules, does not use const. This prevents clients from registering const arrays. Since these arrays are always pre-defined, they should be const, so add the const qualifier to all places in the QMI interface where struct qmi_elem_info is used. Once this patch is in place, clients can independently update their pre-defined arrays to be const, as demonstrated in the QMI sample code. Signed-off-by: Jeff Johnson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220822153435.7856-1-quic_jjohnson@quicinc.com commit 9ea5ae629914c265c0ebb008865f93bd3480e09a Author: Dmitry Baryshkov Date: Mon Aug 22 22:11:38 2022 +0300 arm64: dts: qcom: sm8250: move DSI opp table to the dsi0 node It makes no sense to have the OPP table for the DSI controllers in the DSI1 PHY node. Move it to more logical dsi0 device node. Signed-off-by: Dmitry Baryshkov Reviewed-by: Caleb Connolly Reviewed-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220822191138.316912-1-dmitry.baryshkov@linaro.org commit 7eb89c17abd2574f627c1277a15f6ff64bec33a4 Author: Jinpeng Cui Date: Tue Aug 23 13:36:20 2022 +0000 soc: qcom: icc-bwmon: remove redundant ret variable Return value from devm_regmap_field_bulk_alloc() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220823133620.211902-1-cui.jinpeng2@zte.com.cn commit 276ee34a40c1440544f609b54b23b99ead8f2205 Author: Eric Biggers Date: Fri Aug 26 00:12:44 2022 -0700 arm64: dts: qcom: sm8450: add Inline Crypto Engine registers and clock Add the registers and clock for the Inline Crypto Engine (ICE) to the device tree node for the UFS host controller on sm8450. This makes ufs_qcom support inline encryption when CONFIG_SCSI_UFS_CRYPTO=y. The address and size of the register range, and the minimum and maximum frequency of the ICE core clock, all match the values used downstream. I've validated this on an SM8450 HDK using the 'encrypt' group of xfstests on ext4 with MOUNT_OPTIONS="-o inlinecrypt". Signed-off-by: Eric Biggers Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220826071244.185584-1-ebiggers@kernel.org commit 643d05163e3a18f224e4e1a80de09b2b74e1d249 Author: Matthias Kaehlcke Date: Fri Aug 26 08:48:27 2022 -0700 arm64: dts: qcom: sc7280-herobrine: Don't enable the USB 2.0 port The USB 2.0 port of sc7280 is currently not used by any herobrine board. Delete the device tree entries that enable it. Signed-off-by: Matthias Kaehlcke Reviewed-by: Konrad Dybcio Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220826084813.1.I8c9a771fcf4d1cfb6e8e0ef17a153143af9a644d@changeid commit 144fbd028fdec2deeb3b99d5e60dbf3167950ebe Author: Stephen Boyd Date: Fri Aug 26 17:49:00 2022 -0700 arm64: dts: qcom: sc7180-trogdor: Keep pm6150_adc enabled for TZ There's still a thermal zone using pm6150_adc in the pm6150.dtsi file, pm6150_thermal. It's not super obvious because it indirectly uses the adc through an iio channel in pm6150_temp. Let's keep this enabled on lazor and coachz so that reading the temperature of the pm6150_thermal zone continues to work. Otherwise we get -EINVAL when reading the zone, and I suspect the PMIC temperature trip doesn't work properly so we don't shutdown when the PMIC overheats. Cc: Matthias Kaehlcke Fixes: b8d1e3d33487 ("arm64: dts: qcom: sc7180-trogdor: Delete ADC config for unused thermistors") Signed-off-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220827004901.511543-1-swboyd@chromium.org commit eeca7d46217ccfe9289530e959c0fb29190af0d6 Author: Bryan O'Donoghue Date: Sun Aug 28 14:26:48 2022 +0100 arm64: dts: qcom: pm8350c: Drop PWM reg declaration The PWM is a part of the SPMI PMIC block and maps several different addresses within the SPMI block. It is not accurate to describe as pwm@reg as a result. Fixes: 5be66d2dc887 ("arm64: dts: qcom: pm8350c: Add pwm support") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220828132648.3624126-3-bryan.odonoghue@linaro.org commit 2cb88ebe44531ba18c908e627811698c9461b4cb Author: Bob Moragues Date: Thu Jul 28 14:33:21 2022 -0700 arm64: dts: qcom: sc7280: Add support for zoglin Zoglin is a Hoglin Chromebook with SPI Flash reduced from 64MB to 8MB. Zoglin is identical to Hoglin except for the SPI Flash. The actual SPI Flash is dynamically probed at and not specified in DTS. Signed-off-by: Bob Moragues Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728143215.v3.2.I7d57fb9c4806a8b3fe3501c766b64f4987c271ef@changeid commit f72a9f525b98aca1ad134e163e070d614ff60a24 Author: Bob Moragues Date: Thu Jul 28 14:33:20 2022 -0700 dt-bindings: arm: qcom: document zoglin board Zoglin is a Hoglin Chromebook with SPI Flash reduced from 64MB to 8MB. Zoglin is identical to Hoglin except for the SPI Flash. The actual SPI Flash is dynamically probed at and not specified in DTS. Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Bob Moragues Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728143215.v3.1.I5b9006878bdabd6493b866b46dbd6149968d545b@changeid commit d710fdfe484491679209ae0e11ac118da02f5d82 Author: Yassine Oudjana Date: Thu Jul 28 19:01:20 2022 +0100 arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs Add LEDs found on the Xiaomi MSM8996 devices. The devices share a status RGB LED mounted on the front, as well as a PWM-driven IR LED for remote control (sometimes known as an IR blaster). The Mi Note 2 has an additional pair of white LEDs used as backlights for the touchkeys driven by the PM8994 LPG block. Signed-off-by: Yassine Oudjana Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728180120.97968-1-y.oudjana@protonmail.com commit 36c9d012f193747d42af80b634217addd974c522 Author: Krzysztof Kozlowski Date: Tue Aug 2 17:39:45 2022 +0200 arm64: dts: qcom: use GPIO flags for tlmm Use respective GPIO_ACTIVE_LOW/HIGH flags for tlmm GPIOs. Include gpio.h header if this is first usage of that flag. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220802153947.44457-4-krzysztof.kozlowski@linaro.org commit a64f7d415281db0b727911de0035809f756b10d7 Author: Krzysztof Kozlowski Date: Tue Aug 2 17:39:44 2022 +0200 arm64: dts: qcom: sdm845-db845c: drop gpios from CCI I2C sensors The OV7251 and OV8856 camera sensor bindings do not allow property "gpios" and Linux driver does not parse it. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Robert Foss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220802153947.44457-3-krzysztof.kozlowski@linaro.org commit 62e60e35309d977eac7f9775574ac01b5c7371fc Author: Krzysztof Kozlowski Date: Tue Aug 2 17:39:43 2022 +0200 arm64: dts: qcom: sdm845-db845c: drop power-domains from CCI I2C sensors The Camera Control Interface I2C controller device node belongs to TITAN_TOP_GDSC power domain, so its children do not need to specify it again. The OV7251 and OV8856 camera sensor bindings do not allow power-domains. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220802153947.44457-2-krzysztof.kozlowski@linaro.org commit 32d6fa92c1fea834c978a83604c8413658212d2d Author: Krzysztof Kozlowski Date: Tue Aug 2 17:39:46 2022 +0200 ARM: dts: qcom: use GPIO flags for tlmm Use respective GPIO_ACTIVE_LOW/HIGH flags for tlmm GPIOs. Include gpio.h header if this is first usage of that flag. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220802153947.44457-5-krzysztof.kozlowski@linaro.org commit 2a09cef652d9c1e76229a4381e928560bec3d878 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:57 2022 +0530 ASoC: amd: enable Pink sardine platform machine driver build. This patch enables Pink Sardine platform machine driver build. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-14-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 0c8327c07b2ecc4a4443b1dae407f0d4854b5ae1 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:56 2022 +0530 ASoC: amd: add Pink Sardine machine driver using dmic Add Pink Sardine platform machine driver using dmic. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-13-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 76dd567591c89f92dea97b581988538312ae584f Author: Syed Saba Kareem Date: Sat Aug 27 22:26:55 2022 +0530 ASoC: amd: create platform device for acp6.2 machine driver Create platform device for acp6.2 machine driver. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-12-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 1e4366489e2c059cb00e453737e802d74fd9b1d1 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:54 2022 +0530 ASoC: amd: enable Pink Sardine acp6.2 drivers build Pink Sardine ACP6.2 drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-11-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 28023a78790c33f5df0147fd00ab3cf333edd24f Author: Syed Saba Kareem Date: Sat Aug 27 22:26:53 2022 +0530 ASoC: amd: add acp6.2 pdm driver pm ops Add acp6.2 pdm driver pm ops. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-10-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 3a543d56e3d3c9bb67ffe3ff9ad7ddf77e448019 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:52 2022 +0530 ASoC: amd: add acp6.2 pci driver pm ops Add acp6.2 pci driver pm ops. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-9-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 5137305662ef5cad12ff472ca4c8c3b266fd46c5 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:51 2022 +0530 ASoC: amd: add acp6.2 pdm driver dma ops This patch adds PDM driver DMA operations for Pink Sardine Platform. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-8-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 5bbeca60a57bb9a35cc98c064bbb575738d5be0d Author: Syed Saba Kareem Date: Sat Aug 27 22:26:50 2022 +0530 ASoC: amd: add acp6.2 irq handler Add ACP6.2 irq handler for handling irq events for ACP IP. Add pdm irq events handling. Whenever audio data equal to the PDM watermark level are consumed, interrupt is generated. Acknowledge the interrupt. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-7-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 33cea6bbe48896bcaa03f030f5b52e05de68bccd Author: Syed Saba Kareem Date: Sat Aug 27 22:26:49 2022 +0530 ASoC: amd: add acp6.2 pdm platform driver PDM platform driver binds to the platform device created by ACP6.2 PCI device. PDM driver registers ALSA DMA and CPU DAI components with ASoC framework. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-6-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 515ee2574aa4d6bf05dce194e342bd2712ea4bd4 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:48 2022 +0530 ASoC: amd: add platform devices for acp6.2 pdm driver and dmic driver ACP6.2 IP has PDM decoder block. Create a platform device for it, so that the PDM platform driver can be bound to this device. Pass PCI resources like MMIO to this platform device. Create a platform device for generic dmic codec driver. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-5-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 9766bb62cf315ccbfc6203372074dffe69389356 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:47 2022 +0530 ASoC: amd: add acp6.2 init/de-init functions Add Pink Sardine platform ACP6.2 PCI driver init/deinit functions. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-4-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 95e43a170bb1e91a7972610d33a26ea4841e2cdd Author: Syed Saba Kareem Date: Sat Aug 27 22:26:46 2022 +0530 ASoC: amd: add Pink Sardine ACP PCI driver ACP is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources for Pink Sardine Platform. Signed-off-by: Syed Saba Kareem Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-3-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 161bff51181f919a4b80fe2ab3504d60ac4b4316 Author: Syed Saba Kareem Date: Sat Aug 27 22:26:45 2022 +0530 ASoC: amd: add Pink Sardine platform ACP IP register header Add ACP IP Register header for Pink Sardine platform. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-2-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit b3235e8635e1dd7ac1a27a73330e9880dfe05154 Author: Yang Li Date: Mon Aug 29 16:36:27 2022 +0800 drm/amd/display: clean up some inconsistent indentings The indentation of statements in the same curly bracket should be consistent. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1892 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 33100f10e2fb847954e80e356df3ef9e5941819f Author: Yang Li Date: Mon Aug 29 16:36:26 2022 +0800 drm/amd/display: clean up some inconsistent indentings The indentation of statements in the same curly bracket should be consistent. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1890 Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1891 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 6234bf13913fb7f62bb4ce2ced42fb81c524e851 Author: Yang Li Date: Mon Aug 29 16:36:25 2022 +0800 drm/amd/display: clean up some inconsistent indentings The indentation of statements in the same curly bracket should be consistent. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1886 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit bbc9f072117efd5a81d81ca787855da63e7e7252 Author: Yang Li Date: Mon Aug 29 16:36:24 2022 +0800 drm/amd/display: clean up one inconsistent indenting 1. The indentation of statements in the same curly bracket should be consistent. 2. Variable declarations in the same function should be aligned. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1887 Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1888 Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1889 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit de2b2ae34ddb5cd4a9c840f557b175b4c3c64f65 Author: Hawking Zhang Date: Thu Aug 25 17:06:21 2022 -0400 drm/amdgpu: add new ip block for LSDMA 6.0 Add ip block support for lsdma v6_0_3. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 5bb71735668263403d560b48e8fd1dc1215bdeb6 Author: Hawking Zhang Date: Thu Aug 25 17:03:29 2022 -0400 drm/amdgpu: add new ip block for sdma 6.0 Add ip block support for sdma v6_0_3. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit f66f48471ba2f721695694c400cfcda3136ee736 Author: Hawking Zhang Date: Thu Aug 25 16:58:27 2022 -0400 drm/amdgpu: declare firmware for new SDMA 6.0.3 To support new sdma ip block Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 773562364ad9184a31e3192b268395560dbf2dca Author: John Clements Date: Wed May 11 15:24:11 2022 +0800 drm/amdgpu: enable smu block for smu 13.0.10 Force to enable smu block for SMU v13.0.10 Signed-off-by: John Clements Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d9ec10c30e65df832180159217939918383e6b5f Author: John Clements Date: Mon Jul 25 10:02:05 2022 +0800 drm/amdgpu: added supported smu 13.0.10 sw pptable added sw pptable id 6666 for smu 13.0.10 v2: fix checkpatch error (Alex) Signed-off-by: John Clements Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8e039cd176c61a9770e1956038c93738efc800f7 Author: Yang Wang Date: Fri Mar 18 20:05:32 2022 +0800 drm/amd/pm: add smu_v13_0_10 driver if version add smu_v13_0_10 driver if version Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 92f050436637099db7cfa6e9fe28018d17d9ade6 Author: Yang Wang Date: Thu Aug 25 17:13:05 2022 -0400 drm/amd/pm: add smu_v13_0_10 support add smu_v13_0_10 support. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a60d2191371b4157c56eb502bd3f8d1038a5e35c Author: Frank Min Date: Thu Aug 25 17:10:00 2022 -0400 drm/amdgpu: add new ip block for PSP 13.0 Add ip block support for psp v13_0_10. Signed-off-by: Frank Min Signed-off-by: Hawking Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 10f8927d74473a56862edd94390cbe534cb539b9 Author: John Clements Date: Wed Jul 13 22:10:16 2022 +0800 drm/amdgpu: added firmware module for psp 13.0.10 added missing firmware module Signed-off-by: John Clements Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7ab47ba22ed35e030cf67ac8756767228c591d17 Author: Frank Min Date: Thu Aug 25 17:09:08 2022 -0400 drm/amdgpu: support psp v13_0_10 ip block Add psp v13_0_10 ip block, initialize firmware and psp functions Signed-off-by: Frank Min Signed-off-by: Hawking Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fc968efdf0fc71bbd0e031b9ec071062fe469e7b Author: Hawking Zhang Date: Thu Aug 25 17:00:13 2022 -0400 drm/amdgpu: add new ip block for SOC21 Add ip block support for soc21_common. Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 0f05a2e52862107aff6f4ffe8e8926ada4432c9f Author: Sonny Jiang Date: Thu Aug 4 16:56:58 2022 -0400 drm/amdgpu: Enable pg/cg flags on GC11_0_3 for VCN This enable VCN PG, CG, DPG and JPEG PG, CG Signed-off-by: Sonny Jiang Reviewed-by: Leo Liu Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 6b46251c5067990651bdbfc3edf07c2e16850a0c Author: Hawking Zhang Date: Tue Jun 28 00:41:52 2022 +0800 drm/amdgpu: initialize common sw config for v11_0_3 init cp/pg_flags and extenal_rev_id Signed-off-by: Hawking Zhang Reviewed-by: Frank Min Signed-off-by: Alex Deucher commit 6ec128c3fffcac8b05ed187e11386afdff4bacdb Author: Hawking Zhang Date: Tue Jul 19 14:39:57 2022 +0800 drm/amdgpu: drop gc 11_0_0 golden settings driver doesn't need to program any gc 11_0_0 golden Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit f4f5e50761fd7a8b8ad8a4d6f2ac0ffe76ccd396 Author: Jinpeng Cui Date: Mon Aug 29 12:29:14 2022 +0000 drm/amdkfd: remove redundant variables err and ret Return value from kfd_wait_on_events() and io_remap_pfn_range() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Alex Deucher commit 74d834044e2849aea1a75c4b3cdaf38917ed3c5e Author: Jinpeng Cui Date: Mon Aug 29 12:13:20 2022 +0000 drm/amd/display: remove redundant vertical_line_start variable Return value from expression directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Alex Deucher commit 9d84c7ef8a872253a9e8a9865ad5efaa0f8c05d5 Author: Martin Tsai Date: Thu Aug 18 16:01:24 2022 +0800 drm/amd/display: Correct cursor position on horizontal mirror [Why] Incorrect cursor position will induce system hang on pipe split. [How] 1.Handle horizontal mirror on rotation, 2.Correct cursor set on piep split. Reviewed-by: Ariel Bernstein Acked-by: Brian Chang Signed-off-by: Martin Tsai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 67ec7195747888e2ef307010541fd07304d57ed6 Author: Vladimir Stempen Date: Fri Aug 19 18:32:01 2022 -0400 drm/amd/display: Fix black flash when switching from ODM2to1 to ODMBypass [Why] On secondary display hotplug we switch primary stream from ODM2to1 to ODMBypass mode. Current logic will trigger disabling front end for this stream. [How] We need to check if prev_odm_pipe is equal to NULL in order to disable dangling planes in this scenario. Reviewed-by: Ariel Bernstein Acked-by: Brian Chang Signed-off-by: Vladimir Stempen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 93844fe7651c1f12206ac8ed8dc7d2eca72d90b9 Author: Ethan Wellenreiter Date: Fri Aug 19 18:30:44 2022 -0400 drm/amd/display: Fix check for stream and plane [WHY] Function wasn't returning false when it had a no stream [HOW] Made it return false when it had no stream. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Ethan Wellenreiter Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e0b859cf7c099dbb6bd4b769268baf5b0a51dcfa Author: Ethan Wellenreiter Date: Mon Aug 22 14:33:23 2022 -0400 drm/amd/display: Re-initialize viewport after pipe merge [Why] Pipes get merged in preparation for SubVP but if they don't get used, and are in ODM or some other multi pipe config, it would calculate the voltage level with a viewport of just one pipe from when they were split resulting in too low of a voltage level. [How] Made it so that the viewport and other timing settings get rebuilt and re- initialized after the pipe merge, before calculating the voltage level so it would calculate it correctly. Reviewed-by: Alvin Lee Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Ethan Wellenreiter Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6420f4ca68fb9dc3f7f5c1c27eb9a60f4b751bf8 Author: Aurabindo Pillai Date: Fri Aug 19 15:11:19 2022 -0400 drm/amd/display: Use correct plane for CAB cursor size allocation [Why&How] plane and stream variables used for cursor size allocation calculation were stale from previous iteration. Redo the iteration to find the correct cursor plane for the calculation. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ab23c5b9c74d682d81b0903247817b2bb20528bb Author: Alex Sierra Date: Thu Aug 25 15:42:08 2022 -0500 drm/amdgpu: ensure no PCIe peer access for CPU XGMI iolinks [Why] Devices with CPU XGMI iolink do not support PCIe peer access. Signed-off-by: Alex Sierra Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 093fc6110c7240def7717aa466192c2227d84649 Author: Aric Cyr Date: Mon Aug 22 00:47:03 2022 -0400 drm/amd/display: 3.2.201 Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 606db591bf32a46a7dc3d107e13ba7ed2cf9079c Author: Evan Quan Date: Tue Aug 23 17:37:26 2022 +0800 drm/amd/pm: bump SMU 13.0.0 driver_if header version To suppress the warning about version mismatch with the latest 78.54.0 PMFW. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit f9a48ed7067734624c13077f5de16365d7bddac2 Author: Evan Quan Date: Tue Aug 23 16:07:18 2022 +0800 drm/amd/pm: use vbios carried pptable for all SMU13.0.7 SKUs For those SMU13.0.7 unsecure SKUs, the vbios carried pptable is ready to go. Use that one instead of hardcoded softpptable. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 64e32c91fbb88a2f3f4ab697f538fd8f3f62d99d Author: Evan Quan Date: Tue Aug 23 15:45:36 2022 +0800 drm/amd/pm: use vbios carried pptable for those supported SKUs For some SMU13.0.0 SKUs, the vbios carried pptable is ready to go. Use that one instead of hardcoded softpptable. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 94adb9933609bb3846261a688b28c2ba428f8805 Author: Leo (Hanghong) Ma Date: Tue Aug 16 16:51:33 2022 -0400 drm/amd/display: Add visual confirm color support for SubVP [Why && How] We would like to have visual confirm color support for SubVP. 1. Set visual confirm color to red: SubVP is enable on this display; 2. Set visual confirm color to green: SubVP is enable on other display and DRR is on this display; 3. Set visual confirm color to blue: SubVP is enable on other display and DRR is off on this display; Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0991f44c90f64c4e4d97982d5702ab18449c99d4 Author: Anthony Koo Date: Sat Aug 20 09:04:06 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.132.0 - Fix comment to indicate correct visual confirm option Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9f6f6be163dfc4b912ff1b20be1841cce306b621 Author: Ian Chen Date: Tue Aug 16 15:47:02 2022 +0800 drm/amd/display: Add comments. Reviewed-by: Dennis Chan Acked-by: Brian Chang Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4bfd688e6508ac6f1cdf81c1ea91e3091fa93853 Author: Aurabindo Pillai Date: Fri Aug 19 13:11:30 2022 -0400 drm/amd/display: Revert "program k1/k2 divider for virtual signal for DCN32" [Why & How] This reverts commit e6cf22ef5fae493a99e162c3f2e7233448d2b970 since it causes a SubVP related regression: "Switching between windowed video and fullscreen can intermittently cause black screen" Fixes: e6cf22ef5fae49 ("drm/amd/display: program k1/k2 divider for virtual signal for DCN32") Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4b91ac9e389d177e8f1af5d4499c6025e866c850 Author: Iswara Nagulendran Date: Fri Aug 19 14:10:08 2022 -0400 drm/amd/display: Fix primary EDP link detection [HOW&WHY] EDP link detection must be updated to support a primary EDP with a link index of greater than 0. * SWDEV-342936 - dc: DSC bringup for SAG 1.5 [WHY] SmartAccess Graphics 1.5 (a.k.a SmartMux 1.5) requires seamless switching between GPUs with DSC enabled. [HOW] Moved DSC programming to apply_single_control_ctx_to_hw before the stream enablement logic to ensure the CRC checker provides valid values for non-black frames allowing the system to come out of forced PSR on d2i. Added additional logic to both generate a black frame through setVisibility calls and keep track of the CRCs values for this black frame when coming out of forced PSR. Updating logic for DalRegKey_DisableDSC to disable DSC on EDP and all ports for systems. [CLEANED] dc: Moved DSC programming to before stream enablement [HOW&WHY] Moved DSC programming to apply_single_control_ctx_to_hw before the stream enablement logic. Co-authored-by: sregolui Reviewed-by: Jayendran Ramani Reviewed-by: Harry Vanzylldejong Acked-by: Brian Chang Signed-off-by: sregolui Signed-off-by: Iswara Nagulendran Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b1bdb5ebb06ead49456ae9f23a12c7028076f9cb Author: Charlene Liu Date: Thu Aug 18 20:24:26 2022 -0400 drm/amd/display: fix wrong register access [why] fw version check was for release branch. for staging, it has a chance to enter wrong code path. Reviewed-by: Hansen Dsouza Acked-by: Brian Chang Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a3cdb5d2c89c8005f50cd4c80c1dc75690e5fc96 Author: Aurabindo Pillai Date: Thu Aug 18 17:55:01 2022 -0400 drm/amd/display: use actual cursor size instead of max for CAB allocation [Why&How] When calculating allocation for cursor size, get the real cursor through the HUBP instead of using the maximum cursor size for more optimal allocation Reviewed-by: Alvin Lee Reviewed-by: Nicholas Kazlauskas Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f6f76233bf506d03f3567fa229c7ad2ce6a768d6 Author: Aurabindo Pillai Date: Thu Aug 18 12:34:06 2022 -0400 drm/amd/display: disable display fresh from MALL on an edge case for DCN321 [Why&How] When using a 4k monitor when cursor caching is not supported due to framebuffer being on an uncacheable address, enabling display refresh from MALL would trigger corruption if SS is enabled. Prevent entering SS if we are on the edge case and cursor caching is not possible. Do this only if cursor size larger than a 64x64@4bpp. Pull the cursor size calculation out of if condition since cursor address may not be set on all platforms Reviewed-by: Alvin Lee Reviewed-by: Nicholas Kazlauskas Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 847939e3eda39f98de6ae95a5c5e0e1f437a274c Author: Aurabindo Pillai Date: Thu Aug 18 17:25:05 2022 -0400 drm/amd/display: Fix CAB cursor size allocation for DCN32/321 For calculating cursor size allocation, surface size was used, resulting in over allocation Reviewed-by: Alvin Lee Reviewed-by: Nicholas Kazlauskas Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8606cb1e68d17e24de660110d7042eb82df7a70d Author: Leo Chen Date: Thu Aug 18 13:21:37 2022 -0400 drm/amd/display: Missing HPO instance added [Why & How] Number of encoder is set to 4 but only 3 instances are created. Reviewed-by: Charlene Liu Acked-by: Brian Chang Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c17a34e0526fafc0e1e7f707c634d7e49dd08197 Author: Ian Chen Date: Thu Aug 4 15:44:27 2022 +0800 drm/amd/display: Refactor edp dsc codes. Refactor edp dsc codes. We split out edp dsc config from "global" to "per-panel" config settings. Reviewed-by: Mike Hsieh Acked-by: Brian Chang Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7857825ba4671d053eb3724c7098bc759bf01a75 Author: Alvin Lee Date: Mon Aug 15 13:12:42 2022 -0400 drm/amd/display: SubVP missing scaling case [Description] For SubVP scaling case we have to combine the plane scaling and stream scaling. Use UCLK dummy p-state WM for FCLK WM set C [Description] For DCN32/321 program dummy UCLK P-state watermark into FCLK watermark set C register. Reviewed-by: Jun Lei Reviewed-by: Nevenko Stupar Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b09c1fff5a9350a65b16af44e74c9f9335d9ef09 Author: Leo (Hanghong) Ma Date: Fri Jul 29 11:46:13 2022 -0400 drm/amd/display: Add support for visual confirm color [Why] We want to get the visual confirm color of the bottom-most pipe for test automation. [How] Save the visual confirm color to plane_state before program to MPC; Reviewed-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 36527db318080d36138c802ca9e03a09e5a5fef2 Author: Taimur Hassan Date: Thu Aug 18 11:18:33 2022 -0400 drm/amd/display: Allow PHY state update between same states [Why & How] In some cases, there are calls to transition from TX_ON to TX_ON, such as when using MST or during resolution change. This is expected, so allow HW programming to continue. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6ccdf067206ee82a596fb89a28ace18b4e8b239d Author: Gabe Teeger Date: Wed Aug 17 22:25:01 2022 -0400 drm/amd/display: Cleanup PSR flag [Why] enable_sw_cntl_psr flag is not needed. For PSR1 and PSR2, we should be passing dirty rectangle and cursor updates to FW regardless of enable_sw_cntl_psr flag. [How] Remove enable_sw_cntl_psr flag from driver. Send cursor info and dirty rectagle status to dmub only in the case of dcn31 and above. Reviewed-by: Anthony Koo Reviewed-by: Robin Chen Acked-by: Brian Chang Signed-off-by: Gabe Teeger Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4e65878de0db0a2f6778b78e10fd3b71eda4e4a5 Author: Gabe Teeger Date: Mon Aug 15 22:52:46 2022 -0400 drm/amd/display: Cursor lag with PSR1 eDP [Why] On edp with psr1, we do not provide updates of the cursor position regularly to firmware like with PSR2. To send updates regularly, the flag enable_sw_cntl_psr has to equal 1, but cursor update should be provided regularly to FW regardless of that flag. [How] Ensure that we always send cursor updates to firmware when PSR version equals 1. Reviewed-by: Robin Chen Acked-by: Brian Chang Signed-off-by: Gabe Teeger Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 280f1884892f3825d2060df43dd1d452c585cd0e Author: Michael Strauss Date: Wed Aug 17 10:57:10 2022 -0400 drm/amd/display: Add DC debug option to force LTTPR mode [WHY] Useful for external teams debugging LTTPR issues Reviewed-by: George Shen Acked-by: Brian Chang Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 36ad2ec9802f9613f5d2a4fce10c9452f0a28492 Author: Leo Chen Date: Wed Aug 17 11:15:48 2022 -0400 drm/amd/display: add a override flag as wa for some specific dongle [Why & How] Add a override flag as wa for some specific dongle Co-authored-by: Leo Chen Reviewed-by: Charlene Liu Acked-by: Brian Chang Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2a6164cef63cae77edbd9deef844b1774886fcb7 Author: Johan Hovold Date: Wed Aug 3 14:19:42 2022 +0200 arm64: dts: qcom: sa8295p-adp: disallow regulator mode switches Do not allow the RPMh regulators to switch to low-power mode with an exception for the UFS regulators (l3c, l6c, l10c and l17c) as UFS supports an idle mode. This specifically avoids having regulators be but in low-power mode when only some consumers specify loads while the actual total load really warrants high-power mode. Fixes: 519183af39b2 ("arm64: dts: qcom: add SA8540P and ADP") Link: https://lore.kernel.org/all/YtkrDcjTGhpaU1e0@hovoldconsulting.com Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220803121942.30236-4-johan+linaro@kernel.org commit 648ec2f2ddc05346287e308fbc31a6b8117a1edd Author: Johan Hovold Date: Wed Aug 3 14:19:41 2022 +0200 arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13s: disallow regulator mode switches Do not allow the RPMh regulators to switch to low-power mode. This specifically avoids having regulators be but in low-power mode when only some consumers specify loads while the actual total load really warrants high-power mode. Fixes: 32c231385ed4 ("arm64: dts: qcom: sc8280xp: add Lenovo Thinkpad X13s devicetree") Link: https://lore.kernel.org/all/YtkrDcjTGhpaU1e0@hovoldconsulting.com Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220803121942.30236-3-johan+linaro@kernel.org commit 412737a60c846a6adb7f7571905c200da036815e Author: Johan Hovold Date: Wed Aug 3 14:19:40 2022 +0200 arm64: dts: qcom: sc8280xp-crd: disallow regulator mode switches Do not allow the RPMh regulators to switch to low-power mode with an exception for the UFS regulators (l7c and l3d) as UFS supports an idle mode. This specifically avoids having regulators be but in low-power mode when only some consumers specify loads while the actual total load really warrants high-power mode. Fixes: ccd3517faf18 ("arm64: dts: qcom: sc8280xp: Add reference device") Link: https://lore.kernel.org/all/YtkrDcjTGhpaU1e0@hovoldconsulting.com Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220803121942.30236-2-johan+linaro@kernel.org commit d9a1e922730389afc425f2250de361b7f07acdbc Author: Satya Priya Date: Wed Aug 10 10:35:09 2022 +0530 arm64: dts: qcom: sc7280: Update lpasscore node To maintain consistency with other lpass nodes(lpass_audiocc, lpass_aon and lpass_hm), update lpasscore to lpass_core. Fixes: 9499240d15f2 ("arm64: dts: qcom: sc7280: Add lpasscore & lpassaudio clock controllers") Signed-off-by: Taniya Das Signed-off-by: Satya Priya Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1660107909-27947-4-git-send-email-quic_c_skakit@quicinc.com commit e02a16c23410a118e5497601871a2f8c3ea9bfd0 Author: Taniya Das Date: Wed Aug 10 10:35:08 2022 +0530 arm64: dts: qcom: sc7280: Update lpassaudio clock controller for resets The lpass audio supports TX/RX/WSA block resets. Signed-off-by: Taniya Das Signed-off-by: Satya Priya Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1660107909-27947-3-git-send-email-quic_c_skakit@quicinc.com commit 8c7ebabd2e3f33ef24378d3cac00d3e59886cecb Author: Satya Priya Date: Wed Aug 10 10:35:07 2022 +0530 arm64: dts: qcom: sc7280: Cleanup the lpasscc node Remove "cc" regmap from lpasscc node which is overlapping with the lpass_aon regmap. Fixes: 422a295221bb ("arm64: dts: qcom: sc7280: Add clock controller nodes") Signed-off-by: Satya Priya Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1660107909-27947-2-git-send-email-quic_c_skakit@quicinc.com commit 7c7a05390b5e4f44787b6703e5a3b836c3327b0f Author: Krzysztof Kozlowski Date: Wed Aug 10 11:05:16 2022 +0300 ARM: dts: qcom: msm8660-surf: move fixed regulator out of soc Fixed regulators, like stub for SDCC Power, are not part of SoC, so they should be outside of the soc node. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810080516.166866-4-krzysztof.kozlowski@linaro.org commit 5bd858a82ab77333b41bda9049fbaf6f878c11ab Author: Krzysztof Kozlowski Date: Wed Aug 10 11:05:15 2022 +0300 ARM: dts: qcom: msm8660: override nodes by label Using node paths to extend or override a device tree node is error prone. If there was a typo error, a new node will be created instead of extending the existing node. This will lead to run-time errors that could be hard to detect. A mistyped label on the other hand, will cause a dtc compile error (during build time). This also reduces the indentation making the code easier to read. The pre/post DTBS are the same. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810080516.166866-3-krzysztof.kozlowski@linaro.org commit c77ad7f3ba7ffa05f49516732886f5feed95793b Author: Krzysztof Kozlowski Date: Wed Aug 10 11:05:14 2022 +0300 ARM: dts: qcom: msm8226: override nodes by label Using node paths to extend or override a device tree node is error prone. If there was a typo error, a new node will be created instead of extending the existing node. This will lead to run-time errors that could be hard to detect. A mistyped label on the other hand, will cause a dtc compile error (during build time). This also reduces the indentation making the code easier to read. The pre/post DTBS are the same. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810080516.166866-2-krzysztof.kozlowski@linaro.org commit cb9d7639491466d7296d30ec43045391c3a34651 Author: Krzysztof Kozlowski Date: Wed Aug 10 11:05:13 2022 +0300 ARM: dts: qcom: msm8960: override nodes by label Using node paths to extend or override a device tree node is error prone. If there was a typo error, a new node will be created instead of extending the existing node. This will lead to run-time errors that could be hard to detect. A mistyped label on the other hand, will cause a dtc compile error (during build time). This also reduces the indentation making the code easier to read. The pre/post DTBS are the same. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220810080516.166866-1-krzysztof.kozlowski@linaro.org commit e990bd60716d64d18e8c5785865e15783a90cee8 Author: Alvin Lee Date: Wed Aug 17 10:47:59 2022 -0400 drm/amd/display: Only commit SubVP state after pipe programming [Description] We only want to commit the SubVP config to DMCUB after the main and phantom pipe programming has completed. Commiting the state early can cause issues such as P-State being allowed by the HW early which causes the SubVP state machine to go into a bad state Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 55453c0914d9b81e75c5c83adb2dd9382da2c79d Author: Hsin-Yi Wang Date: Mon Aug 15 17:39:07 2022 +0800 drm/bridge: ps8640: Add double reset T4 and T5 to power-on sequence The double reset power-on sequence is a workaround for the hardware flaw in some chip that SPI Clock output glitch and cause internal MPU unable to read firmware correctly. The sequence is suggested in ps8640 application note. Signed-off-by: Hsin-Yi Wang Reviewed-by: Rock Chiu Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220815093905.134164-1-hsinyi@chromium.org commit d84f5d6562b2f068ec7011f50e702e8a60ec7932 Author: Taimur Hassan Date: Tue Aug 16 17:10:50 2022 -0400 drm/amd/display: Remove assert from PHY state update [Why & How] In some cases, there are calls to transition from TX_ON to TX_ON. This is expected, so do not assert. However, these are redundant, so return prematurely. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 29bec1c43d7de6af60a34e08205db3b7c6048cef Author: Wang Fudong Date: Wed Aug 17 17:47:50 2022 +0800 drm/amd/display: set dig fifo read start level to 7 before dig fifo reset [Why] DIG_FIFO_ERROR = 1 caused mst daisy chain 2nd monitor black. [How] We need to set dig fifo read start level = 7 before dig fifo reset during dig fifo enable according to hardware designer's suggestion. If it is zero, it will cause underflow or overflow and DIG_FIFO_ERROR = 1. Reviewed-by: Alvin Lee Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Wang Fudong Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9f0149caf0dc1c1261a612b0653d31d998f80596 Author: Luca Weiss Date: Fri Aug 12 10:27:21 2022 +0200 arm64: dts: qcom: sm6350: Add GPI DMA nodes Add nodes for the gpi_dma0 and gpi_dma1 which are (optionally) used for various i2c busses based on the qup firmware configuration. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812082721.1125759-4-luca.weiss@fairphone.com commit 2581c5d85e31c96dee352a751dbce17c1b71b417 Author: YuBiao Wang Date: Wed Aug 24 15:56:04 2022 +0800 drm/amdgpu: Fix use-after-free in amdgpu_cs_ioctl [Why] In amdgpu_cs_ioctl, amdgpu_job_free could be performed ealier if there is -ERESTARTSYS error. In this case, job->hw_fence could be not initialized yet. Putting hw_fence during amdgpu_job_free could lead to a use-after-free warning. [How] Check if drm_sched_job_init is performed before job_free by checking s_fence. v2: Check hw_fence.ops instead since it could be NULL if fence is not initialized. Reverse the condition since !=NULL check is discouraged in kernel. Signed-off-by: YuBiao Wang Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit cfa1e7f8a75927e55cce1300c8fbda2e1d1e0abe Author: Duncan Ma Date: Mon Aug 15 17:37:32 2022 -0400 drm/amd/display: Fix OTG H timing reset for dcn314 [Why] When ODM is enabled, H timing control register reset to 0. Div mode manual field get overwritten causing no display on certain modes for dcn314. [How] Use REG_UPDATE instead of REG_SET to set div_mode field. Reviewed-by: Charlene Liu Reviewed-by: Nicholas Kazlauskas Acked-by: Brian Chang Signed-off-by: Duncan Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6ebdaf20fc4dd98e7573dc2a926c81afc8ac7870 Author: Lewis Huang Date: Mon Aug 8 13:20:16 2022 +0800 drm/amd/display: Refine aux transaction before retrieve caps [Why] LTTPR caps will read fail if aux channel is not active. [How] 1.Perform 600 read upto 10 retry with 1ms delay in between. 2.If fail, return false and trigger another retry detection. 3.If pass, read LTTPR caps in retrieve link caps. Reviewed-by: Jimmy Kizito Acked-by: Brian Chang Signed-off-by: Lewis Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9af611f29034dd6c9329de06dc98232a5b89b939 Author: George Shen Date: Wed Aug 10 22:06:17 2022 -0400 drm/amd/display: Fix DCN32 DPSTREAMCLK_CNTL programming [Why] Each index in the DPSTREAMCLK_CNTL register phyiscally maps 1-to-1 with HPO stream encoder instance. On the other hand, each index in DTBCLK_P_CNTL physically maps 1-to-1 with OTG instance. Current DCN32 DPSTREAMCLK_CLK programing assumes that OTG instance always maps 1-to-1 with HPO stream encoder instance. This is not always guaranteed and can result in blackscreen. [How] Program the correct dpstreamclk instance with the correct dtbclk_p source. Reviewed-by: Ariel Bernstein Acked-by: Brian Chang Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a3c9b4c7a75a66b65b62900e2e9d140e0470cd85 Author: Alvin Lee Date: Mon Aug 15 14:58:53 2022 -0400 drm/amd/display: Don't choose SubVP display if ActiveMargin > 0 [Description] There can be SubVP scheduling issues if a SubVP display is chosen has ActiveDramClockChangeLatency > 0. Block this case for now, and enable Vactive case (later) to handle this. Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 572200db77ecbd3a178c68d469790a11cf07a20e Author: Taimur Hassan Date: Fri Aug 12 16:59:48 2022 -0400 drm/amd/display: Set ODM policy based on number of DSC slices [Why & How] Add addtional check in CalculateODMMode for cases where the ODM combine is needed due to number of DSC slices. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 62f6b0dcdf42ecbdf25205c77c9297d3977ed690 Author: Aric Cyr Date: Mon Aug 15 00:18:45 2022 -0400 drm/amd/display: 3.2.200 This version brings along following fixes: - Modify pipe split policy - Fix odm 2:1 policy in 4k144 mode - Correct HDMI ODM combine policy - Change AUX NACK behavior - Change runtime initialization for DCN32/321 - Fix cursor flicker in PSRSU - Fix k1/k2 divider for virtual signal for DCN32 - Free phantom plane after removing the context - Add interface to track PHY state - Add SubVP scaling case - Add log clock table for SMU - Fix atomic_check check - Fix SMU 13.0.0 driver_if header - Fix doorbells allocation Acked-by: Brian Chang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6b11af6d1c8f5d4135332bb932baaa06e511173d Author: Yang Yingliang Date: Fri Aug 26 16:57:54 2022 +0800 drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume() Add missing pci_disable_device() if amdgpu_device_resume() fails. Fixes: 8e4d5d43cc6c ("drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown") Signed-off-by: Yang Yingliang Signed-off-by: Alex Deucher commit 45a92f45f4578ff89da7dc5ef50bab4ef870f3b7 Author: sunliming Date: Fri Aug 26 16:41:21 2022 +0800 drm/amd/display: Fix variable dereferenced before check Fixes the following smatch warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:311 dc_dmub_srv_p_state_delegate() warn: variable dereferenced before check 'dc' (see line 309) Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: sunliming Signed-off-by: Alex Deucher commit 1d5d1947778cbbc9b469e57b9e1a56871250afa9 Author: ye xingchen Date: Fri Aug 26 07:23:57 2022 +0000 drm/amdgpu: Remove the unneeded result variable Return the value sdma_v5_2_start() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Alex Deucher commit 2aefa9a38f236481f41b117e21ffdf38f40830f6 Author: Graham Sider Date: Mon Aug 15 13:28:19 2022 -0400 drm/amdgpu: Update mes_v11_api_def.h New GFX11 MES FW adds the trap_en bit. For now hardcode to 1 (traps enabled). Signed-off-by: Graham Sider Acked-by: Felix Kuehling Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 73515bbdc45d09d2b7374ea24ec0b8b0610b179b Author: Guchun Chen Date: Wed Aug 24 23:00:02 2022 +0800 drm/amdgpu: disable FRU access on special SIENNA CICHLID card Below driver load error will be printed, not friendly to end user. amdgpu: ATOM BIOS: 113-D603GLXE-077 [drm] FRU: Failed to get size field [drm:amdgpu_fru_get_product_info [amdgpu]] *ERROR* Failed to read FRU Manufacturer, ret:-5 Signed-off-by: Guchun Chen Reviewed-by: Kent Russell Signed-off-by: Alex Deucher commit 528dc60f9e5eadcfde651b1458da2b8d008a2cf0 Author: Abel Vesa Date: Fri Aug 12 13:12:39 2022 +0300 arm64: dts: qcom: sdm845: Add the RPMh stats node SDM845 is a special case compared to the other platforms that use RPMh stats, since it only has 2 stats (aosd and cxsd), while the others have a 3rd one (ddr). So lets add the node but with a SDM845 dedicated compatible to make the driver aware of the different stats config. Signed-off-by: Abel Vesa Tested-by: Caleb Connolly Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812101240.1869605-3-abel.vesa@linaro.org commit b0f8e8a38a010999f7b07617d874e3eb594a0a3e Author: Abel Vesa Date: Fri Aug 12 13:12:37 2022 +0300 arm64: dts: qcom: sdm845: Reduce reg size for aoss_qmp Like on the other platforms that provide RPMh stats, on SDM845, the aoss_qmp reg size needs to be reduced to its actual size of 0x400, otherwise it will overlap with the RPMh stats reg base, node that will be added later on. Signed-off-by: Abel Vesa Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812101240.1869605-1-abel.vesa@linaro.org commit 010681df652878e929d46faede31acdd085dd6fd Author: Abel Vesa Date: Fri Aug 12 13:12:40 2022 +0300 dt-bindings: soc: qcom: stats: Document SDM845 compatible SDM845 is a special case compared to the other platforms that use RPMh stats, since it only has 2 stats (aosd and cxsd), while the others have a 3rd one (ddr). So in order for the driver to use the dedicated stats config, we added the SDM845 dedicated compatible, which we document here. Signed-off-by: Abel Vesa Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812101240.1869605-4-abel.vesa@linaro.org commit 0425c5c6ebb2388074ea18460199547f076cbf60 Author: Abel Vesa Date: Fri Aug 12 13:12:38 2022 +0300 soc: qcom: stats: Add SDM845 stats config and compatible SDM845 is a special case compared to the other platforms that use RPMh stats, since it only has 2 stats (aosd and cxsd), while the others have a 3rd one (ddr). So lets add dedicated stats config and compatible for SDM845 to make the driver aware of this num_records difference. Signed-off-by: Abel Vesa Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812101240.1869605-2-abel.vesa@linaro.org commit ed3163b02a2c37744566d19fc451e6687aa2205d Author: Luca Weiss Date: Fri Aug 12 13:46:15 2022 +0200 arm64: dts: qcom: pm6150l: add missing adc channels Add the missing adc channels and add pre-scaling property to die_temp channel, as per downstream dts. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220812114614.1195679-1-luca.weiss@fairphone.com commit f2567b732b0aa2160228a956e0c2007feaeb4b64 Author: Adam Skladowski Date: Mon Aug 15 12:09:45 2022 +0200 dt-bindings: firmware: document Qualcomm SM6115 SCM Document the compatible for Qualcomm SM6115 SCM. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220815100952.23795-8-a39.skl@gmail.com commit c752d491cd599b3205800678708e8b1f45844774 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:09 2022 +0300 arm64: dts: qcom: sm8150: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/sm8150-mtp.dtb: hwlock: 'reg' is a required property qcom/sm8150-mtp.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-17-krzysztof.kozlowski@linaro.org commit 86d7c9460e2c0095bec80892b247f8c9f77bec82 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:08 2022 +0300 arm64: dts: qcom: sm8150: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-16-krzysztof.kozlowski@linaro.org commit a4c82270f0f441977d8d54505fb269c1ee762234 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:07 2022 +0300 arm64: dts: qcom: sdm630: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/sdm636-sony-xperia-ganges-mermaid.dtb: hwlock: 'reg' is a required property qcom/sdm636-sony-xperia-ganges-mermaid.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-15-krzysztof.kozlowski@linaro.org commit 0da6033872256e0f25f92a6b5cc311efee529966 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:06 2022 +0300 arm64: dts: qcom: sdm630: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-14-krzysztof.kozlowski@linaro.org commit a465a9877e3a898925c1af80cb1acd88ce7816e6 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:05 2022 +0300 arm64: dts: qcom: qcs404: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/qcs404-evb-4000.dtb: hwlock: 'reg' is a required property qcom/qcs404-evb-4000.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-13-krzysztof.kozlowski@linaro.org commit 3ed99307ec842fdb63b1519a011cb74e66b8d9cd Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:04 2022 +0300 arm64: dts: qcom: sdm845: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/sdm845-shift-axolotl.dtb: hwlock: 'reg' is a required property qcom/sdm845-shift-axolotl.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-12-krzysztof.kozlowski@linaro.org commit 8a8531e69b2db1df8bfcf66c990ba36919c48e21 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:03 2022 +0300 arm64: dts: qcom: sdm845: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-11-krzysztof.kozlowski@linaro.org commit d9a2214d6ba5b68ffbfc5798f23bd3e1720f7b3d Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:02 2022 +0300 arm64: dts: qcom: sc7280: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. This also describes more accurately the devices and their IO address space, and allows to remove incorrect syscon compatible from TCSR mutex: qcom/sc7280-herobrine-crd.dtb: hwlock@1f40000: compatible: ['qcom,tcsr-mutex', 'syscon'] is too long Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-10-krzysztof.kozlowski@linaro.org commit e66e548bab5e93dfe0b958187785215c3c5d05b5 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:01 2022 +0300 arm64: dts: qcom: sc7180: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/sc7180-trogdor-wormdingler-rev1-inx.dtb: hwlock: 'reg' is a required property qcom/sc7180-trogdor-wormdingler-rev1-inx.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-9-krzysztof.kozlowski@linaro.org commit ce1ac53c7faa5b7930c3a7e30b2fad547b1efe67 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:32:00 2022 +0300 arm64: dts: qcom: sc7180: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-8-krzysztof.kozlowski@linaro.org commit b5cc3e52d9932b382b5f72f108cd7da742b64450 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:59 2022 +0300 arm64: dts: qcom: sc7180: add missing TCSR syscon compatible TCSR syscon node should come with dedicated compatible. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-7-krzysztof.kozlowski@linaro.org commit 408c4eadd5d641b899db5eeacc2221273118a287 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:58 2022 +0300 arm64: dts: qcom: msm8998: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/msm8998-asus-novago-tp370ql.dtb: hwlock: 'reg' is a required property qcom/msm8998-asus-novago-tp370ql.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-6-krzysztof.kozlowski@linaro.org commit fc10cfa38580a09d150c14f71812f86f0babec7a Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:57 2022 +0300 arm64: dts: qcom: msm8998: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-5-krzysztof.kozlowski@linaro.org commit 31df41b59b0e97bab38644903ec9111cfa2a0e53 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:56 2022 +0300 arm64: dts: qcom: msm8996: switch TCSR mutex to MMIO The TCSR mutex bindings allow device to be described only with address space (so it uses MMIO, not syscon regmap). This seems reasonable as TCSR mutex is actually a dedicated IO address space and it also fixes DT schema checks: qcom/msm8996-xiaomi-natrium.dtb: hwlock: 'reg' is a required property qcom/msm8996-xiaomi-natrium.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-4-krzysztof.kozlowski@linaro.org commit 100ce2205924a5253f73b598354d5dca97d37356 Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:55 2022 +0300 arm64: dts: qcom: msm8996: split TCSR halt regs out of mutex The TCSR halt regs are next to TCSR mutex (in one address block called TCSR_MUTEX), so before converting the TCSR mutex into device with address space, we need to split the halt regs to its own syscon device. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-3-krzysztof.kozlowski@linaro.org commit 4f2e28b2cc2e07c61028d27d964ff79705b5eb8f Author: Krzysztof Kozlowski Date: Fri Aug 19 11:31:54 2022 +0300 dt-bindings: mfd: qcom,tcsr: add several devices Document existing (MSM8996, SC7280) and new compatibles for TCSR syscon registers (QCS404, SC7180, SDM630, SDM845, SM8150, MSM8998). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220819083209.50844-2-krzysztof.kozlowski@linaro.org commit 5a0504945878b4af7534c1ce668a5678dc0201cf Author: Geert Uytterhoeven Date: Fri Aug 19 12:14:23 2022 +0200 arm64: dts: qcom: sdm845-xiaomi-polaris: Fix sde_dsi_active pinctrl "make dtbs_check" says: bias-disable: boolean property with value b'\x00\x00\x00\x00' Fix this by dropping the offending value. Fixes: be497abe19bf08fb ("arm64: dts: qcom: Add support for Xiaomi Mi Mix2s") Signed-off-by: Geert Uytterhoeven Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/629afd26008c2b1ba5822799ea7ea5b5271895e8.1660903997.git.geert+renesas@glider.be commit 0e5732e4d58437feded42fb459384904eb317e91 Author: YueHaibing Date: Sat Aug 20 19:32:02 2022 +0800 soc: qcom: Make QCOM_RPMPD depend on OF WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF Depends on [n]: PM_GENERIC_DOMAINS [=y] && OF [=n] Selected by [m]: - QCOM_RPMPD [=m] && PM [=y] && QCOM_SMD_RPM [=m] PM_GENERIC_DOMAINS_OF depends on OF, so QCOM_RPMPD also depends on it. Fixes: 7d0221fb5912 ("soc/qcom: Make QCOM_RPMPD select PM_GENERIC_DOMAINS/_OF") Signed-off-by: YueHaibing Acked-by: Randy Dunlap # build-tested Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220820113202.23940-1-yuehaibing@huawei.com commit 12e621362be39350167ede99542256e768ecbfd6 Author: Christian Marangi Date: Mon Jul 18 18:18:26 2022 +0200 ARM: dts: qcom: ipq8064: add ipq8065 variant ipq8065 SoC is based on ipq8064-v2.0 with a more clocked CPU and an increased voltage output with the smb208 regulators. Signed-off-by: Christian Marangi Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220718161826.4943-3-ansuelsmth@gmail.com commit 58907a1cae53dd5f91a7dfb17ac8de10c60c32fd Author: Christian Marangi Date: Mon Jul 18 18:18:25 2022 +0200 ARM: dts: qcom: ipq8064: add ipq8062 variant ipq8062 SoC is based on ipq8064-v2.0 with lower supported freq, lack of usb port and a reduced voltage output with the smb208 regulators. Signed-off-by: Christian Marangi Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220718161826.4943-2-ansuelsmth@gmail.com commit a9f2cd80ee4669c851d6953fbbb592a3ba44df9f Author: Christian Marangi Date: Mon Jul 18 18:18:24 2022 +0200 ARM: dts: qcom: ipq8064: add v2 dtsi variant Add ipq8064-v2.0 dtsi variant that differ from original ipq8064 SoC for some additional pcie, sata and usb configuration values, additional reserved memory and serial output. Signed-off-by: Christian Marangi Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220718161826.4943-1-ansuelsmth@gmail.com commit a01bae600a0d07038ec686a18604bf86452633d8 Author: Dmitry Baryshkov Date: Fri May 6 18:21:06 2022 +0300 ARM: dts: qcom-*: replace deprecated perst-gpio with perst-gpios Replace deprecated perst-gpio properties with up-to-date perst-gpios in the arm32 Qualcomm Snapdragon device trees. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220506152107.1527552-8-dmitry.baryshkov@linaro.org commit f9aad4f098dc81b5859c27bfcf441cff418002a4 Author: Dmitry Baryshkov Date: Fri May 6 18:21:05 2022 +0300 ARM: dts: qcom: stop using snps,dw-pcie falback Qualcomm PCIe devices are not really compatible with the snps,dw-pcie. Unlike the generic IP core, they have special requirements regarding enabling clocks, toggling resets, using the PHY, etc. This is not to mention that platform snps-dw-pcie driver expects to find two IRQs declared, while Qualcomm platforms use just one. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220506152107.1527552-7-dmitry.baryshkov@linaro.org commit d749d52e251b094322315c359cca814adf2249cf Author: Lin, Meng-Bo Date: Sun Jul 24 09:55:44 2022 +0000 arm64: dts: qcom: msm8916-samsung-a2015: Rename touchscreen analog regulator reg_vdd_tsp: regulator-vdd-tsp is actually used as an analog regulator for touchscreen on all of a2015 and e2015 devices. Rename it into reg_vdd_tsp_a: regulator-vdd-tsp-a to reduce confusion. Signed-off-by: Lin, Meng-Bo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724095438.14252-1-linmengbo0689@protonmail.com commit 90ca46731599ea364d2d8b5310341ab766fea637 Author: Lin, Meng-Bo Date: Sun Jul 24 09:55:43 2022 +0000 arm64: dts: qcom: msm8916-samsung-e2015: Add touchkey On the Samsung Galaxy E5 and E7 the touch key is supplied by a single fixed regulator (enabled via GPIO 97) that supplies both MCU and LED. Add it to the device tree. Signed-off-by: Lin, Meng-Bo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724095426.14189-1-linmengbo0689@protonmail.com commit 87c1b199e622bc2d9b16da5d870ab6b92db96154 Author: Lin, Meng-Bo Date: Sun Jul 24 09:55:37 2022 +0000 ARM: dts: qcom-msm8916-samsung-e2015: Include dts from arm64 After adding all necessary support for MSM8916 SMP/cpuidle without PSCI on ARM32, build the Samsung Galaxy E5/E7/Grand Max device trees from the arm64 tree together with the ARM32 include to allow booting this device on ARM32. The approach to include device tree files from other architectures is inspired from e.g. the Raspberry Pi (bcm2711-rpi-4-b.dts) where this is used to build the device tree for both ARM32 and ARM64. Signed-off-by: Lin, Meng-Bo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724095413.14135-1-linmengbo0689@protonmail.com commit 995d1ac509fb92f3288a8eab3342a5667183fd2f Author: Lin, Meng-Bo Date: Sun Jul 24 09:55:31 2022 +0000 arm64: dts: qcom: msm8916-samsung-e2015: Add initial common dtsi Samsung Galaxy E5, E7 and Grand Max are smartphones using the MSM8916 SoC released in 2015. e2015 and a2015 are similar, with some differences in accelerometer, MUIC and Vibrator. The common parts are shared in msm8916-samsung-a2015-common.dtsi to reduce duplication. Add a common device tree for with initial support for: - GPIO keys - GPIO LEDs for Grand Max - Regulator haptic - Hall sensor (except Grand Max) - SDHCI (internal and external storage) - USB Device Mode - UART (on USB connector via the SM5504 MUIC) - WCNSS (WiFi/BT) - Regulators - S3FWRN5 NFC (except Grand Max) The three devices (and all other variants of E5/E7/Grand Max released in 2015) are very similar, with some differences in display, touchscreen, sensors and NFC. The common parts are shared in msm8916-samsung-e2015-common.dtsi to reduce duplication. Unfortunately, some E5/E7/Grand Max were released with outdated 32-bit only firmware and never received any update from Samsung. Since the 32-bit TrustZone firmware is signed there seems to be no way currently to actually boot this device tree on arm64 Linux on those variants at the moment. However, it is possible to use this device tree by compiling an ARM32 kernel instead. The device tree can be easily built on ARM32 with an #include and it works really well there. To avoid confusion for others it is still better to add this device tree on arm64. Otherwise it's easy to forget to update this one when making some changes that affect all MSM8916 devices. Maybe someone finds a way to boot ARM64 Linux on those device at some point. In this case I expect that this device tree can be simply used as-is. Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Signed-off-by: Lin, Meng-Bo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724095400.14081-1-linmengbo0689@protonmail.com commit dc1b8ce9db8c5181b3345505a66dfe8136b83f21 Author: Lin, Meng-Bo Date: Sun Jul 24 09:55:31 2022 +0000 dt-bindings: qcom: Document bindings for new msm8916-samsung-e2015 devices Document the new samsung,e5/e7/grandmax device tree bindings used in their device trees. Signed-off-by: Lin, Meng-Bo Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220724095346.14022-1-linmengbo0689@protonmail.com commit 07603a1c17cf9eec5c963b470daba780cd7b9981 Author: Yunlong Jia Date: Thu Jul 21 03:58:43 2022 +0000 dt-bindings: arm: qcom: Document additional sku6 for sc7180 pazquel The difference between sku6 and sku4 is that there is no esim The different SKUs are: LTE with physical SIM _and_ eSIM LTE with only a physical SIM WiFi only Both sku4 and sku6 are LTE SKUs. One has the eSIM stuffed and one doesn't. There is a single shared device tree for the two. Signed-off-by: Yunlong Jia Reviewed-by: Douglas Anderson Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220721033918.v3.2.I7ecbb7eeb58c5e6a33e32a3abf4d6874e6cb725c@changeid commit 030a7bfb365fd19714e25e9547764bff690cb227 Author: Yunlong Jia Date: Thu Jul 21 03:58:42 2022 +0000 arm64: dts: qcom: Add SKU6 for sc7180-trogdor-pazquel-lte-parade SKU6 is LTE(w/o eSIM)+WIFI+Parade Signed-off-by: Yunlong Jia Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220721033918.v3.1.I10519ca1bf88233702a90e296088808d18cdc7b1@changeid commit 6956c18f4ad9200aa945f7ea37d65a05afc49d51 Author: Marijn Suijten Date: Thu Jul 14 22:38:22 2022 +0200 clk: qcom: gcc-sdm660: Use floor ops for SDCC1 clock In commit 3f905469c8ce ("clk: qcom: gcc: Use floor ops for SDCC clocks") floor ops were applied to SDCC2 only, but flooring is also required on the SDCC1 apps clock which is used by the eMMC card on Sony's Nile platform, and otherwise result in the typicial "Card appears overclocked" warnings observed on many other platforms before: mmc0: Card appears overclocked; req 52000000 Hz, actual 100000000 Hz mmc0: Card appears overclocked; req 52000000 Hz, actual 100000000 Hz mmc0: Card appears overclocked; req 104000000 Hz, actual 192000000 Hz Fixes: f2a76a2955c0 ("clk: qcom: Add Global Clock controller (GCC) driver for SDM660") Signed-off-by: Marijn Suijten Tested-by: Alexey Minnekhanov Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714203822.186448-1-marijn.suijten@somainline.org commit 0a631a36f7244d56fffcd0dd5bc473cf14571970 Author: Konrad Dybcio Date: Thu Jul 14 14:34:06 2022 +0200 arm64: dts: qcom: Add device tree for Sony Xperia 1 IV Add support for Sony Xperia 1 IV, a.k.a PDX223. This device is a part of the SoMC SM8450 Nagara platform and currently it is the only device based on that board, so no -common DTSI is created until (if?) other Nagara devices appear. This commit brings support for: * SD Card * USB (*including SuperSpeed*) * ADSP/CDSP/SLPI (modem remains untested for now) * Most regulators (some GPIO-enabled ones require PMIC GPIOs but trying to access any SPMI device crashes the device..) * Part of I2C-connected peripherals (notably no touch due to a driver bug) * PCIe0 (PCIe1 is unused) Do note display via simplefb is not supported, as the display is blanked upon exiting XBL. To create a working boot image, you need to run: cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sm8450-sony-xperia-\ nagara-pdx223.dtb > .Image.gz-dtb mkbootimg \ --kernel .Image.gz-dtb \ --ramdisk some_initrd.img \ --pagesize 4096 \ --base 0x0 \ --kernel_offset 0x8000 \ --ramdisk_offset 0x1000000 \ --tags_offset 0x100 \ --cmdline "SOME_CMDLINE" \ --dtb_offset 0x1f00000 \ --header_version 1 \ --os_version 12 \ --os_patch_level 2022-06 \ # or newer -o boot.img-sony-xperia-pdx223 Then, you need to flash it on the device and get rid of all the vendor_boot/dtbo mess: // You have to either pull vbmeta{"","_system"} from // /dev/block/bootdevice/by-name/ or build one as a part of AOSP build process fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img fastboot --disable-verity --disable-verification flash vbmeta_system \ vbmeta_system.img fastboot flash boot boot.img-sony-xperia-pdx223 fastboot erase vendor_boot fastboot erase recovery fastboot flash dtbo emptydtbo.img fastboot reboot Where emptydtbo.img is a tiny file that consists of 2 bytes (all zeroes), doing a "fastboot erase" won't cut it, the bootloader will go crazy and things will fall apart when it tries to overlay random bytes from an empty partition onto a perfectly good appended DTB. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714123406.1919836-5-konrad.dybcio@somainline.org commit 20e8f1ee8d2729589cd2c0b4a13df753667d6930 Author: Konrad Dybcio Date: Thu Jul 14 14:34:05 2022 +0200 arm64: dts: qcom: sm8450: Add SDHCI2 Add and configure the SDHCI host responsible for (mostly) SD Card and its corresponding pins' sleep states. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714123406.1919836-4-konrad.dybcio@somainline.org commit 2fb19263442dda351e8bc2f6bd71f5a355971f1a Author: Konrad Dybcio Date: Thu Jul 14 14:34:04 2022 +0200 arm64: dts: qcom: sm8450: Adjust memory map Fix up the camera region (cross-referenced different vendors' msm-5.10 drops, 9f500000 is the default location for SM8450) and reserve the second chunk occupied by xbl_sc. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714123406.1919836-3-konrad.dybcio@somainline.org commit 4277c839a1395072f4c8fd07f9ca52b4f770068e Author: Konrad Dybcio Date: Thu Jul 14 14:34:02 2022 +0200 dt-bindings: arm: qcom: Document Sony Xperia 1 IV (PDX223) Document the compatible for the PDX223 device. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714123406.1919836-1-konrad.dybcio@somainline.org commit 44eb125b9ef6e6dc68e42da8fb1b66ff656895e1 Merge: 7bb5b8268ef36 4a5cc683543f5 Author: Mark Brown Date: Mon Aug 29 21:53:30 2022 +0100 spi: mt7621: Fix an erroneous message + clean-ups Merge series from Christophe JAILLET : Patch 1 fixes an issue about an error code that is erroneously logged. Patch 2-4 are just clean-ups spotted while fixing it. Additional comments are added below --- in patches 2 and 3. commit 18f581bfe29de7c3ad33b3f2b2bd515623417494 Author: Krzysztof Kozlowski Date: Thu Jul 14 11:10:41 2022 +0200 arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible Add a MSM8998-specific SDCC compatible, because using only a generic qcom,sdhci-msm-v4 fallback is deprecated. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220714091042.22287-3-krzysztof.kozlowski@linaro.org commit 2b96ef794caa539d52f8e8c85ef907b3bc601c27 Author: Krzysztof Kozlowski Date: Tue Jul 5 15:03:00 2022 +0200 arm64: dts: qcom: msm8992-xiaomi-libra: split qcom,msm-id into tuples The qcom,msm-id is an uint32 matrix, so a list of tuples. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220705130300.100882-4-krzysztof.kozlowski@linaro.org commit 51b0a5e044a4c49bcaf96c00123d26119da105d7 Author: Dmitry Baryshkov Date: Tue Jul 5 14:27:34 2022 +0300 dt-bindings: clock: qcom,mmcc: define clocks/clock-names for MSM8996 Define clock/clock-names properties of the MMCC device node to be used on MSM8996 platform. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220705112734.1323355-3-dmitry.baryshkov@linaro.org commit 73e66ddfd9984594c1f28fb756e68010924798ed Author: Dmitry Baryshkov Date: Tue Jul 5 14:27:33 2022 +0300 dt-bindings: clock: qcom,mmcc: fix clocks/clock-names definitions Rather than defining (incorrect) global clocks and clock-names lists, define them per platform using conditionals. Also, while we are at it, mark these properties as required for all platforms for which DT files contained clocks/clock-names for the MMCC nodes from the beginning (in addition to existing MSM8998 this adds MSM8994, SDM630 and SDM660). Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220705112734.1323355-2-dmitry.baryshkov@linaro.org commit 8373f5d50095c497305162ba8d076568862e867e Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:53 2022 +0300 arm64: dts: qcom: msm8916: add clocks to the GCC device node As we are converting this platform to use DT clock bindings, add clocks and clock-names properties to the MMCC device tree node. Reviewed-by: Konrad Dybcio Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-8-dmitry.baryshkov@linaro.org commit 342470f7b48b4c1be912453da18f4858342822fc Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:52 2022 +0300 clk: qcom: gcc-msm8916: use parent_hws/_data instead of parent_names Convert the clock driver to specify parent data rather than parent names, to actually bind using 'clock-names' specified in the DTS rather than global clock names. Use parent_hws where possible to refer parent clocks directly, skipping the lookup. Reviewed-by: Marijn Suijten Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-7-dmitry.baryshkov@linaro.org commit 52a0a6cb49f73801e43dfce17d8d075625d20294 Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:51 2022 +0300 clk: qcom: gcc-msm8916: move gcc_mss_q6_bimc_axi_clk down The gcc_mss_q6_bimc_axi_clk clock depends on the bimc_ddr_clk_src clock. Move it down in the file to come after the source clock. Reviewed-by: Marijn Suijten Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-6-dmitry.baryshkov@linaro.org commit 69da4290a9ed1607f148b552ca1bd073e07d7697 Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:50 2022 +0300 clk: qcom: gcc-msm8916: move GPLL definitions up Move GPLL definitions up, before the clock parent tables, so that we can use gpll hw clock fields in the parent_data/parent_hws tables. Reviewed-by: Marijn Suijten Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-5-dmitry.baryshkov@linaro.org commit 5a6d30675d17b9a984c837e7b31ce6b269e22c32 Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:49 2022 +0300 clk: qcom: gcc-msm8916: use ARRAY_SIZE instead of specifying num_parents Use ARRAY_SIZE() instead of manually specifying num_parents. This makes adding/removing entries to/from parent_data easy and errorproof. This conversion fixes an issue present since the first version of this driver. For the gp1_clk_src, gp2_clk_src and gp3_clk_src it was impossible to select sleep_clk as a prent of the clock, since num_parents was limited to 3 rather than 4. Switching to use num_parents automatically makes sleep_clk available for selection. Fixes: 3966fab8b6ab ("clk: qcom: Add MSM8916 Global Clock Controller support") Cc: Georgi Djakov Reviewed-by: Marijn Suijten Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Acked-by: Georgi Djakov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-4-dmitry.baryshkov@linaro.org commit bdeb3cf013d0d1d09ff3bf66ba139ab259dab3a4 Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:48 2022 +0300 dt-bindings: clock: separate bindings for MSM8916 GCC device Separate bindings for GCC on Qualcomm MSM8916 platforms. This adds new clocks/clock-names properties to be used for clock links. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-3-dmitry.baryshkov@linaro.org commit 0f71ae945730f27c7a96a09eae6808a722806027 Author: Dmitry Baryshkov Date: Mon Jul 4 20:24:47 2022 +0300 dt-bindings: clk: qcom,gcc-*: use qcom,gcc.yaml Use qcom,gcc.yaml which contains a set of properties common to most Qualcomm GCC bindings. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220704172453.838303-2-dmitry.baryshkov@linaro.org commit 2eb680401df62c035ff50a7faf1296565b030df7 Author: James Hilliard Date: Mon Aug 29 09:47:09 2022 -0600 selftests/bpf: Fix connect4_prog tcp/socket header type conflict There is a potential for us to hit a type conflict when including netinet/tcp.h and sys/socket.h, we can replace both of these includes with linux/tcp.h and bpf_tcp_helpers.h to avoid this conflict. Fixes errors like the below when compiling with gcc BPF backend: In file included from /usr/include/netinet/tcp.h:91, from progs/connect4_prog.c:11: /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:34:23: error: conflicting types for 'int8_t'; have 'char' 34 | typedef __INT8_TYPE__ int8_t; | ^~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, from /usr/include/x86_64-linux-gnu/bits/socket.h:29, from /usr/include/x86_64-linux-gnu/sys/socket.h:33, from progs/connect4_prog.c:10: /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:18: note: previous declaration of 'int8_t' with type 'int8_t' {aka 'signed char'} 24 | typedef __int8_t int8_t; | ^~~~~~ /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:43:24: error: conflicting types for 'int64_t'; have 'long int' 43 | typedef __INT64_TYPE__ int64_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous declaration of 'int64_t' with type 'int64_t' {aka 'long long int'} 27 | typedef __int64_t int64_t; | ^~~~~~~ Signed-off-by: James Hilliard Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220829154710.3870139-1-james.hilliard1@gmail.com commit 520fb178212d1dd545ed0ed231df09111b30ab7e Author: Christian Kohlschütter Date: Mon Aug 29 16:55:43 2022 +0000 regulator: core: Fix regulator supply registration with sysfs In "regulator: core: Resolve supply name earlier to prevent double-init", we introduced a bug that prevented the regulator names from registering properly with sysfs. Reorder regulator_register such that supply names are properly resolved and registered. Fixes: 8a866d527ac0 ("regulator: core: Resolve supply name earlier to prevent double-init") Link: https://lore.kernel.org/all/58b92e75-f373-dae7-7031-8abd465bb874@samsung.com/ Signed-off-by: Christian Kohlschütter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220829165543.24856-1-christian@kohlschutter.com Signed-off-by: Mark Brown commit 38c5c4fe17014130dee4f85e663c5d919655801e Author: Luca Weiss Date: Wed May 25 16:44:01 2022 +0200 arm64: dts: qcom: sm6350: Add interconnect support Add all the different NoC providers that are found in SM6350 and populate different nodes that use the interconnect properties. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220525144404.200390-6-luca.weiss@fairphone.com commit f3f5fb3184ec0cd7f98267a8dc1c0538575fbb77 Author: Dmitry Baryshkov Date: Fri May 6 18:21:07 2022 +0300 arm64: dts: qcom: replace deprecated perst-gpio with perst-gpios Replace deprecated perst-gpio and wake-gpio properties with up-to-date perst-gpios and wake-gpios in the Qualcomm device trees. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220506152107.1527552-9-dmitry.baryshkov@linaro.org commit 3e4fec3bc8f8d1366cf2d8d8a054ed37e5a41cba Author: Dmitry Baryshkov Date: Fri May 6 18:21:04 2022 +0300 arm64: dts: qcom: stop using snps,dw-pcie falback Qualcomm PCIe devices are not really compatible with the snps,dw-pcie. Unlike the generic IP core, they have special requirements regarding enabling clocks, toggling resets, using the PHY, etc. This is not to mention that platform snps-dw-pcie driver expects to find two IRQs declared, while Qualcomm platforms use just one. Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220506152107.1527552-6-dmitry.baryshkov@linaro.org commit a536208da6f7d877f1adbad4ff13f63f31f59d91 Author: Jayesh Choudhary Date: Fri Aug 26 14:41:42 2022 +0530 dt-bindings: crypto: ti,sa2ul: drop dma-coherent property crypto driver itself is not dma-coherent. It is the dmaengine that moves data and the buffers are to be mapped to the dmaengine provider. So this property should be dropped. Fixes: 2ce9a7299bf6 ('dt-bindings: crypto: Add TI SA2UL crypto accelerator documentation') Signed-off-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20220826091142.262325-1-j-choudhary@ti.com Signed-off-by: Rob Herring commit fda476174e6744497e47d3fc12d902b31cfc755f Author: Krzysztof Kozlowski Date: Thu Aug 25 15:54:10 2022 +0300 dt-bindings: leds: qcom-wled: fix number of addresses On PM660L, PMI8994 and PMI8998, the WLED has two address spaces. This also fixes dtbs_check warnings like: arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dtb: leds@d800: reg: [[55296], [55552]] is too long Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220825125410.232377-3-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit e3f36b2b51583c4e0922ec124a19baae5d6e2802 Author: Krzysztof Kozlowski Date: Thu Aug 25 15:54:09 2022 +0300 dt-bindings: nvmem: qfprom: add IPQ8064 and SDM630 compatibles Document compatibles for QFPROM used on IPQ8064 and SDM630. They are compatible with generic QFPROM fallback. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220825125410.232377-2-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 1e5154de34073f0f30a16a08527b6d82a2b8105d Author: Krzysztof Kozlowski Date: Thu Aug 25 14:33:33 2022 +0300 dt-bindings: crypto: drop minItems equal to maxItems minItems, if missing, are implicitly equal to maxItems, so drop redundant piece to reduce size of code. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220825113334.196908-4-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 7d10845b72d1777898af7233897469102d1016c0 Author: Krzysztof Kozlowski Date: Thu Aug 25 14:33:31 2022 +0300 dt-bindings: ata: drop minItems equal to maxItems minItems, if missing, are implicitly equal to maxItems, so drop redundant piece to reduce size of code. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Acked-by: Damien Le Moal Link: https://lore.kernel.org/r/20220825113334.196908-2-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 414e7684d635e357384366e0b142ece09d029eb4 Author: Krzysztof Kozlowski Date: Thu Aug 25 14:33:30 2022 +0300 dt-bindings: socionext,uniphier-system-cache: drop minItems equal to maxItems minItems, if missing, are implicitly equal to maxItems, so drop redundant piece to reduce size of code. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220825113334.196908-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 9eba693c79732b1cd6856887a6fa165b0f4cdc63 Author: Rob Herring Date: Tue Aug 23 09:56:34 2022 -0500 media: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-3-robh@kernel.org commit 71667902e5386dd974a0d14deb51f92d0949b47a Author: Krzysztof Kozlowski Date: Thu Aug 25 14:33:34 2022 +0300 dt-bindings: display: drop minItems equal to maxItems minItems, if missing, are implicitly equal to maxItems, so drop redundant piece to reduce size of code. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Reviewed-by: Dmitry Baryshkov Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220825113334.196908-5-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 413ec915c00dca18db4022dfbf30284912c1abe1 Author: Krzysztof Kozlowski Date: Tue Aug 23 13:10:31 2022 +0300 dt-bindings: display: synopsys,dw-hdmi: drop ref from reg-io-width reg-io-width is a standard property, so no need for defining its type with $ref. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220823101031.387082-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit ba00706200c3a79723ad15e7144fcf7b2d9256ee Author: Rob Herring Date: Tue Aug 23 09:56:42 2022 -0500 dt-bindings: display: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Dmitry Baryshkov # msm Reviewed-by: Laurent Pinchart Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-11-robh@kernel.org commit 4a5cc683543f5f6ed586944095c65cb4da4b9273 Author: Christophe JAILLET Date: Sat Aug 27 13:42:40 2022 +0200 spi: mt7621: Remove 'clk' from 'struct mt7621_spi' The 'clk' field in 'struct mt7621_spi' is useless, remove it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/76ed0ef91479498b9a2d5ef539f80851cffdb4ea.1661599671.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 30b31b29a866d32fc381b406d4c4f5db2636e5ec Author: Christophe JAILLET Date: Sat Aug 27 13:42:29 2022 +0200 spi: mt7621: Use devm_spi_register_controller() Now that clk_disable_unprepare(clk) is handled with a managed resource, we can use devm_spi_register_controller() and axe the .remove function. The order between spi_unregister_controller() and clk_disable_unprepare() is still the same. (see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe error path") to see why it matters) Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/b7698e198acc998d99e7e7c895a2910f14f89443.1661599671.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 3d6af96814d753f34cf897466e7ddf041d0cdf3b Author: Christophe JAILLET Date: Sat Aug 27 13:42:19 2022 +0200 spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This helper is well suited for cases where the clock would be kept prepared or enabled for the whole lifetime of the driver. This simplifies the error handling a lot. The order between spi_unregister_controller() (in the remove function) and the clk_disable_unprepare() (now handle by a managed resource) is kept the same. (see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe error path") to see why it matters) Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/05a7fd22719008c8a905d6328aa9548ce40f2a7a.1661599671.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 2b2bf6b7faa9010fae10dc7de76627a3fdb525b3 Author: Christophe JAILLET Date: Sat Aug 27 13:42:07 2022 +0200 spi: mt7621: Fix an error message in mt7621_spi_probe() 'status' is known to be 0 at this point. The expected error code is PTR_ERR(clk). Switch to dev_err_probe() in order to display the expected error code (in a human readable way). This also filters -EPROBE_DEFER cases, should it happen. Fixes: 1ab7f2a43558 ("staging: mt7621-spi: add mt7621 support") Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 7bb5b8268ef36ecad2f3e2a8e39be61a44816117 Merge: 47c32b2b7fcfa b076fdd02133e Author: Mark Brown Date: Mon Aug 29 17:49:33 2022 +0100 spi: add generic R-Car Gen4 and specific r8a779f0 support Merge series from Wolfram Sang : Here are the patches to enable MSIOF on R-Car S4-8. They also introduce generic Gen4 support and move V3U to Gen4 (which it really is). commit af024a39ebda58694935f420bf396b11afb0df6b Author: Hans de Goede Date: Mon Aug 29 18:35:44 2022 +0200 platform/x86: acer-wmi: Acer Aspire One AOD270/Packard Bell Dot keymap fixes 2 keymap fixes for the Acer Aspire One AOD270 and the same hardware rebranded as Packard Bell Dot SC: 1. The F2 key is marked with a big '?' symbol on the Packard Bell Dot SC, this sends WMID_HOTKEY_EVENTs with a scancode of 0x27 add a mapping for this. 2. Scancode 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event with the "Video Bus" input device events. But on these devices the "Video Bus" does not send events for this key. Map 0x61 to KEY_UNKNOWN instead of using KE_IGNORE so that udev/hwdb can override it on these devs. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220829163544.5288-1-hdegoede@redhat.com commit 551e325bbd3fb8b5a686ac1e6cf76e5641461cf2 Author: Jack Wang Date: Fri Aug 26 12:12:27 2022 +0200 HSI: omap_ssi_port: Fix dma_map_sg error check dma_map_sg return 0 on error, in case of error return -EIO to caller. Cc: Sebastian Reichel Cc: linux-kernel@vger.kernel.org (open list) Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Jack Wang Signed-off-by: Sebastian Reichel commit 0f1a3e5f81f6309cf0d894faca128772ffc3e9a4 Author: Linus Walleij Date: Thu May 19 23:29:43 2022 +0200 HSI: cmt_speech: Pass a pointer to virt_to_page() A pointer into virtual memory is represented by a (void *) not an u32, so the compiler warns: drivers/hsi/clients/cmt_speech.c:1092:35: warning: passing argument 1 of 'virt_to_pfn' makes pointer from integer without a cast [-Wint-conversion] Fix this with an explicit cast. Cc: Kai Vehmanen Cc: Aaro Koskinen Cc: Pavel Machek Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 9a2ea132df860177b33c9fd421b26c4e9a0a9396 Author: Miaoqian Lin Date: Mon Apr 4 08:52:32 2022 +0000 HSI: omap_ssi: Fix refcount leak in ssi_probe When returning or breaking early from a for_each_available_child_of_node() loop, we need to explicitly call of_node_put() on the child node to possibly release the node. Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Miaoqian Lin Signed-off-by: Sebastian Reichel commit 77e0ccd6248272fd60ce9cce101b6e27e8d50d47 Author: Wang Qing Date: Thu Mar 31 05:07:38 2022 -0700 HSI: clients: remove duplicate assignment netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed, no need to repeat assignment. Signed-off-by: Wang Qing Signed-off-by: Sebastian Reichel commit d08a0d41ec569d1978ee47e57b08305a1022653f Merge: e0550fffd5b3d aca86ec9a02a4 Author: Mark Brown Date: Mon Aug 29 16:56:25 2022 +0100 TAS2764 fixes/extensions Merge series from Martin Povišer : First three patches are fixes analogical to those recently done to the TAS2770 driver. Link: https://lore.kernel.org/asahi/20220808141246.5749-1-povik+lin@cutebit.org/T/#t The latter two add IRQ handler to log faults and expose a new control. commit da09daf881082266e4075657fac53c7966de8e4d Author: Lucas Stach Date: Fri Aug 26 20:57:33 2022 +0200 drm: bridge: dw_hdmi: only trigger hotplug event on link change There are two events that signal a real change of the link state: HPD going high means the sink is newly connected or wants the source to re-read the EDID, RX sense going low is a indication that the link has been disconnected. Ignore the other two events that also trigger interrupts, but don't need immediate attention: HPD going low does not necessarily mean the link has been lost and should not trigger a immediate read of the status. RX sense going high also does not require a detect cycle, as HPD going high is the right point in time to read the EDID. Signed-off-by: Lucas Stach Reviewed-by: Neil Armstrong (v1) Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220826185733.3213248-1-l.stach@pengutronix.de commit 47c32b2b7fcfa97f7224df222f439fc0ccf94ffe Author: Patrice Chotard Date: Mon Aug 29 14:32:50 2022 +0200 spi: stm32-qspi: Fix pm_runtime management in stm32_qspi_transfer_one_message() ctrl->auto_runtime_pm was wrongly set to true when adding transfer_one_message() callback. As explained in commit 6e6ccb3d4cdc ("spi: stm32-qspi: Add pm_runtime support") the expected behavior is to prevent runtime suspends between each transfer. Add needed pm_runtime API calls in stm32_qspi_transfer_one_message(). Fixes: a557fca630cc ("spi: stm32_qspi: Add transfer_one_message() spi callback") Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220829123250.2170562-1-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit 81dae1f34d56b5a25659d03ffe63be69aca87352 Author: Marek Vasut Date: Mon Aug 1 14:54:19 2022 +0200 drm/bridge: lvds-codec: Fix error checking of drm_of_lvds_get_data_mapping() The drm_of_lvds_get_data_mapping() returns either negative value on error or MEDIA_BUS_FMT_* otherwise. The check for 'ret' would also catch the positive case of MEDIA_BUS_FMT_* and lead to probe failure every time 'data-mapping' DT property is specified. Fixes: 7c4dd0a266527 ("drm: of: Add drm_of_lvds_get_data_mapping") Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Sam Ravnborg To: dri-devel@lists.freedesktop.org Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220801125419.167562-1-marex@denx.de commit 3721359d3907c313833a2fd6e40c36a30179ea89 Author: James Hilliard Date: Thu Aug 25 23:29:22 2022 -0600 selftests/bpf: Fix bind{4,6} tcp/socket header type conflict There is a potential for us to hit a type conflict when including netinet/tcp.h with sys/socket.h, we can remove these as they are not actually needed. Fixes errors like the below when compiling with gcc BPF backend: In file included from /usr/include/netinet/tcp.h:91, from progs/bind4_prog.c:10: /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:34:23: error: conflicting types for 'int8_t'; have 'char' 34 | typedef __INT8_TYPE__ int8_t; | ^~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, from /usr/include/x86_64-linux-gnu/bits/socket.h:29, from /usr/include/x86_64-linux-gnu/sys/socket.h:33, from progs/bind4_prog.c:9: /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:18: note: previous declaration of 'int8_t' with type 'int8_t' {aka 'signed char'} 24 | typedef __int8_t int8_t; | ^~~~~~ /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:43:24: error: conflicting types for 'int64_t'; have 'long int' 43 | typedef __INT64_TYPE__ int64_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous declaration of 'int64_t' with type 'int64_t' {aka 'long long int'} 27 | typedef __int64_t int64_t; | ^~~~~~~ make: *** [Makefile:537: /home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_gcc/bind4_prog.o] Error 1 Signed-off-by: James Hilliard Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220826052925.980431-1-james.hilliard1@gmail.com commit d688f6b5525d5bc1b88c198959274d53a1a24204 Author: Marek Vasut Date: Mon Jul 25 00:43:17 2022 +0200 drm/bridge: tc358767: Handle bridge past DPI output Currently the driver only handles panel directly connected to the DPI output. Handle the case where a bridge is connected past DPI output of this bridge. This could be e.g. DPI to LVDS encoder chip. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220724224317.288727-1-marex@denx.de commit 3e9ad662e34eb2d42ddef5a2883abd34461dfd9a Author: Hans Verkuil Date: Thu Aug 11 11:17:49 2022 +0200 media: av7110: move to staging/media/deprecated/saa7146 The av7110 driver depends on saa7146, so move it there. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e33fdb5a02490059e2f48ced2c038c8a46c6476d Author: Hans Verkuil Date: Thu Aug 11 11:17:48 2022 +0200 media: saa7146: deprecate hexium_gemini/orion, mxb and ttpci Deprecate the hexium_gemini, hexium_orion, mxb and ttpci saa7146-based drivers: these drivers do not use the vb2 framework for video streaming, instead it uses the old videobuf framework. We want to get rid of these old drivers, so deprecated these for future removal. [hverkuil: update MAINTAINERS file] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6971757bdcccdd420583b0ed52361ebdafed2738 Author: Hans Verkuil Date: Thu Aug 11 11:17:47 2022 +0200 media: davinci: deprecate dm644x_ccdc, dm355_cddc and dm365_isif Deprecate the dm644x_ccdc, dm355_cddc and dm365_isif davinci drivers: all three depend on the vpfe_capture driver, and that driver does not use the vb2 framework for video streaming, instead it uses the old videobuf framework. We want to get rid of these old drivers, so deprecated these for future removal. Note that include/media/davinci/vpfe_capture.h can't be moved to staging since it is used in arch/arm/mach-davinci/davinci.h. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 43f2d33e2f2844dddeadee339a6e6e2e2638b8f4 Author: Hans Verkuil Date: Thu Aug 11 11:17:46 2022 +0200 media: fsl-viu: deprecate this driver Deprecate the fsl-viu driver. This driver does not use the vb2 framework for video streaming, instead it uses the old videobuf framework. We want to get rid of these old drivers, so deprecated it for future removal. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b7eeabc1cee3c031123bb4a3a7786779e1a57ac2 Author: Hans Verkuil Date: Thu Aug 11 11:17:45 2022 +0200 media: tm6000: deprecate this driver Deprecate the tm6000 driver. This driver does not use the vb2 framework for video streaming, instead it uses the old videobuf framework. We want to get rid of these old drivers, so deprecated it for future removal. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 50f0b24381665ad3233dd586e069e2c3ae7b1d9b Author: Hans Verkuil Date: Thu Aug 11 11:17:44 2022 +0200 media: zr364xx: deprecate this driver Deprecate the zr364xx driver. This driver does not use the vb2 framework for video streaming, instead it uses the old videobuf framework. We want to get rid of these old drivers, so deprecated it for future removal. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9a97cc155cc75571db72adf6992d11aa1de0c83a Author: Hans Verkuil Date: Thu Aug 11 11:17:43 2022 +0200 media: meye: deprecate this driver Deprecate the meye driver. This driver does not use the vb2 framework for video streaming, instead it implements its own version. We want to get rid of these old drivers, so deprecated it for future removal. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit be8cebc46d9d38166a1b3fda22a018ae52b0928e Author: Hans Verkuil Date: Thu Aug 11 11:17:42 2022 +0200 media: cpia2: deprecate this driver Deprecate the cpia2 driver. This driver does not use the vb2 framework for video streaming, instead it implements its own version. We want to get rid of these old drivers, so deprecated it for future removal. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0708ed7c2c63a60ee59dd50cdb50689571a234b3 Author: Allen-KH Cheng Date: Tue Jul 12 19:40:46 2022 +0800 arm64: dts: mt8192: Add dsi node Add dsi node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220712114046.15574-6-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit b4b75bac952bd5393cae4b58ad1986b569fd7231 Author: Allen-KH Cheng Date: Tue Jul 12 19:40:45 2022 +0800 arm64: dts: mt8192: Add display nodes Add display nodes and gce info for mt8192 SoC. GCE (Global Command Engine) properties to the display nodes in order to enable the usage of the CMDQ (Command Queue), which is required for operating the display. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220712114046.15574-5-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 7d3553788dd9cd51643e8071d28885e1ca13d669 Author: Allen-KH Cheng Date: Tue Jul 12 19:40:44 2022 +0800 arm64: dts: mediatek: Add mmsys #reset-cells property for mt8192 To support reset of mmsys, we include mt8192-resets.h and add property of #reset-cells in mmsys. Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220712114046.15574-4-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 85c4ec6f7cf5d1ad1939617efad9f805a326f884 Author: Allen-KH Cheng Date: Tue Jul 12 19:40:43 2022 +0800 arm64: dts: mt8192: Add mipi_tx node Add mipi_tx node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220712114046.15574-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 18222e059850f64637221de7f82fae38740b16aa Author: Allen-KH Cheng Date: Tue Jul 12 19:40:42 2022 +0800 arm64: dts: mt8192: Add pwm node Add pwm node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220712114046.15574-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 1943fb1e50d11053ccc58932bfe1217377a5bf47 Author: Hans Verkuil Date: Wed Aug 10 13:54:45 2022 +0200 media: staging/media: add a STAGING_MEDIA_DEPRECATED option Add a kernel config option to build deprecated media drivers that are scheduled for removal. Move stkwebcam to the deprecated directory to make it clear that this driver is deprecated. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f068a6cec0fbdc479a9776923eb772d76c3948cd Author: Hans Verkuil Date: Wed Aug 10 15:01:27 2022 +0200 media: avoid use of 'videobuf' The term 'videobuf' typically refers to the old videobuf version 1 framework. Avoid using this word in drivers that are converted to vb2. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 77423a62db082793f14860c938ebe2b316fe1aae Author: Hans Verkuil Date: Wed Aug 10 15:01:26 2022 +0200 media: staging/media/omap4iss/iss_video.c: videobuf -> vb2 Rename 'videobuf' to 'vb2' in the comment. This avoids confusing terminology since 'videobuf' typically refers to the old vb1 framework. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6be954808abd3342c773b3f50dcc8bb291494712 Author: Hans Verkuil Date: Wed Aug 10 15:01:25 2022 +0200 media: platform: ti: avoid using 'videobuf' or 'video-buf' These terms typically refer to the old version 1 videobuf framework. It is confusing to use them for the vb2 framework, so reword these comments. Signed-off-by: Hans Verkuil Reviewed-by: Lad Prabhakar Signed-off-by: Mauro Carvalho Chehab commit 2e78620b13509787a239c847b1ba576265a38bc4 Author: Allen-KH Cheng Date: Fri Aug 26 01:04:48 2022 +0800 arm64: dts: Add MediaTek MT8186 dts and evaluation board and Makefile MT8186 is a SoC based on 64bit ARMv8 architecture. It contains 6 CA55 and 2 CA76 cores. MT8186 share many HW IP with MT65xx series. We add basic chip support for MediaTek MT8186 on evaluation board. Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220825170448.17024-1-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit f8e1fa0fc8bd13122324da7d1e80d66641220680 Author: Xin Ji Date: Tue Jul 26 11:30:58 2022 +0800 drm/bridge: anx7625: Support HDMI_I2S audio format 1. Support HDMI_I2S audio format. 2. Return 0 if there is no sink connection in .hw_param callback. Signed-off-by: Xin Ji Acked-by: Hsin-Yi Wang Acked-by: Jiaxin Yu Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220726033058.403715-1-xji@analogixsemi.com commit a13f509b1918924aa722cb6c2caeb3f471235cf6 Author: Hans Verkuil Date: Wed Aug 10 15:01:24 2022 +0200 media: media/v4l2-mem2mem.h: rename 'videobuf' to 'vb2' It is confusing to refer to vb2 structures with 'videobuf', since that typically is used to refer to the old videobuf version 1 framework. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bbcf0f55e57841e532ab395596db9197e8d53e8d Author: Tiezhu Yang Date: Mon Aug 29 11:05:09 2022 +0800 bpf, mips: No need to use min() to get MAX_TAIL_CALL_CNT MAX_TAIL_CALL_CNT is 33, so min(MAX_TAIL_CALL_CNT, 0xffff) is always MAX_TAIL_CALL_CNT, it is better to use MAX_TAIL_CALL_CNT directly. At the same time, add BUILD_BUG_ON(MAX_TAIL_CALL_CNT > 0xffff) with a comment on why the assertion is there. Suggested-by: Daniel Borkmann Suggested-by: Johan Almbladh Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1661742309-2320-1-git-send-email-yangtiezhu@loongson.cn commit 3e947c36af524b382827f584dba6d47317394b41 Author: Hans Verkuil Date: Wed Aug 10 15:01:23 2022 +0200 media: vb2: videobuf -> videobuf2 It is confusing to use the term 'videobuf' or 'video-buf' since that usually refers to the old videobuf version 1 framework. Rename to 'videobuf2' or vb2. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b02c4a5293521f2f8c4ed1db2012d28802a42696 Author: Hans Verkuil Date: Wed Aug 10 15:01:22 2022 +0200 media: media/pci/ngene/ngene.h: remove #ifdef NGENE_V4L Remove the dead code under NGENE_V4L. Among others, this removes references to the old videobuf framework that isn't actually used by this driver. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2a0c28063de23646bb56152095ce73ea2284dc26 Author: Hans Verkuil Date: Wed Aug 10 13:54:45 2022 +0200 media: zoran: move to mainline The zoran driver can be moved back to mainline after it has been converted by Corentin Labbe to vb2. Note that the zoran driver no longer supports video output, but video capture is working fine now. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 90f6b6affd51a29df41686be3bde30b97ec94fd2 Author: Hans Verkuil Date: Wed Aug 10 13:54:44 2022 +0200 media: zoran: from VB2_READ/WRITE: read/write isn't supported The read/write file operations are not implemented, so no need to set VB2_READ and VB2_WRITE flags. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 31b83c85cf1dab673a7d1270e742ccd68e9ca6b5 Author: Hans Verkuil Date: Wed Aug 10 13:54:43 2022 +0200 media: zoran: the video device is video capture only, not M2M Set vfl_dir correctly as a capture device instead of as a M2M device. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c0a80d5c1091c83281360927aec72d8fdc79f3c6 Author: Hans Verkuil Date: Wed Aug 10 13:54:42 2022 +0200 media: zoran: fix checkpatch --strict issues Prepare for moving this driver to mainline by fixing the remaining checkpatch issues. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8847fb9b965cb5482067b5fbda17f5d2b17f532b Author: wangjianli Date: Tue Aug 23 16:42:19 2022 +0200 media: ti/omap: fix repeated words in comments Delete the redundant word 'the'. Signed-off-by: wangjianli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 13c3af0c646251edc73164a310da31e7c6156659 Author: wangjianli Date: Sun Aug 21 17:25:04 2022 +0200 media: pci/cx23885: fix repeated words in comments Delete the redundant word 'of'. Signed-off-by: wangjianli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7f2597fe945eb5b622afe1aaad2c6c4ca403ebd8 Author: wangjianli Date: Sun Aug 21 17:21:38 2022 +0200 media: pci/cx18: fix repeated words in comments Delete the redundant word 'of'. Signed-off-by: wangjianli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 08ebb1c0da84bbec6df105a60b339e40fba241c9 Author: wangjianli Date: Sun Aug 21 17:17:41 2022 +0200 media: pci/cx18: fix repeated words in comments Delete the redundant word 'of'. Signed-off-by: wangjianli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b78476917ff25f172f1388aae0eebb9c8f7c5836 Author: wangjianli Date: Sun Aug 21 17:15:52 2022 +0200 media: i2c/cx25840: fix repeated words in comments Delete the redundant word 'of'. Signed-off-by: wangjianli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 54db159d766b73307a2e5aee77f76c971cb180e3 Author: Jason Wang Date: Thu Aug 4 14:01:48 2022 +0200 media: v4l2-flash: Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 85b1dedd556e372f8f7adc47a0be61d3d9af134c Author: Jason Wang Date: Thu Aug 4 13:58:25 2022 +0200 media: technisat-usb2: Fix comment typo The double `is' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 73854b867e1316bac7670b2f37b31375119ae328 Author: Jason Wang Date: Thu Aug 4 13:51:38 2022 +0200 media: drxk: Fix comment typo The double `for' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fd3ed970044cdc6142c77522bc83071ff02007b1 Author: Slark Xiao Date: Fri Jul 22 09:18:50 2022 +0200 media: v4l2-ioctl: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. [hverkuil: the the -> that the] Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 33b96f15f277bff42c172f64b059a563a749495e Author: Slark Xiao Date: Fri Jul 22 08:41:05 2022 +0200 media: tm6000: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 031d8af19bd2ca7343f2df610004d72dfd78386f Author: Slark Xiao Date: Fri Jul 22 08:36:43 2022 +0200 media: gspca: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 565cdd279a3cf80d9d96c4a83293a342fb3429b8 Author: Slark Xiao Date: Fri Jul 22 08:33:41 2022 +0200 media: platform: ti: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9efd64972443de860811269f2a98c93b90967e93 Author: Slark Xiao Date: Fri Jul 22 04:19:18 2022 +0200 media: saa7164: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2e2b25af5e33c3771ac1b28fc0b13637679266d0 Author: Slark Xiao Date: Fri Jul 22 04:04:59 2022 +0200 media: ivtv: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3b12018d8f8c2b82200bb122d2ada021c2249726 Author: Slark Xiao Date: Fri Jul 22 03:57:07 2022 +0200 media: cx88: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bd012eaa8a38623c163e3237a9f58bb3e25d457c Author: Slark Xiao Date: Fri Jul 22 03:47:55 2022 +0200 media: dvb-frontends: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 948c752d2e27022e40fc16b9a7c611907de7e627 Author: Jason Wang Date: Sat Jul 16 06:31:02 2022 +0200 media: sun6i-csi: Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d063ddfb8a000a5079314821e84e333d7ce9d1e6 Author: Jason Wang Date: Fri Jul 15 07:16:16 2022 +0200 media: dib8000: Fix comment typo The double `this' is duplicated in line 3215, remove one. [hverkuil: while we're at it, fix the 'succedeed' typo as well] Signed-off-by: Jason Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e6433ad04b44c4b68c4de3fc06356d3ac6104e9c Author: Li zeming Date: Mon Jul 4 04:24:10 2022 +0200 media: staging/media/av7110/av7110: Fix typo in string Remove the repeated ',' from string Signed-off-by: Li zeming Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3c68cc8e35f2f6ef7faf41483702354732567b7c Author: Xavier Roumegue Date: Sat Jul 30 17:48:43 2022 +0200 media: MAINTAINERS: add entry for i.MX8MP DW100 v4l2 mem2mem driver Add myself as maintainer of the dw100 driver which offers hardware accelerated dewarping operations through a v4l2 mem2mem interface. Signed-off-by: Xavier Roumegue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cb6d000fcaa6e2ee0e01937364c686690329bf5e Author: Xavier Roumegue Date: Sat Jul 30 17:48:42 2022 +0200 media: dw100: Add i.MX8MP dw100 dewarper driver Add a V4L2 mem-to-mem driver for the Vivante DW100 Dewarp Processor IP core found on i.MX8MP SoC. The processor core applies a programmable geometrical transformation on input images to correct distorsion introduced by lenses. The transformation function is exposed as a grid map with 16x16 pixel macroblocks indexed using X, Y vertex coordinates. The dewarping map can be set from application through a dedicated v4l2 control. If not set or invalid, the driver computes an identity map prior to starting the processing engine. The driver supports scaling, cropping and pixel format conversion. Signed-off-by: Xavier Roumegue Reviewed-by: Ezequiel Garcia Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1301663c1f350cad2910da83a20cc6693ff44ee9 Author: Xavier Roumegue Date: Sat Jul 30 17:48:41 2022 +0200 media: dt-bindings: media: Add i.MX8MP DW100 binding Add DT binding documentation for the Vivante DW100 dewarper engine found on NXP i.MX8MP SoC Signed-off-by: Xavier Roumegue Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9d5c3c06980510b27e8f7ff033a21120e42c9715 Author: Xavier Roumegue Date: Sat Jul 30 17:48:40 2022 +0200 media: uapi: Add a control for DW100 driver The DW100 driver gets the dewarping mapping as a binary blob from the userspace application through a custom control. The blob format is hardware specific so create a dedicated control for this purpose. Signed-off-by: Xavier Roumegue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a41c4088cf431a9f2458f4e54fbbf3113a1bd063 Author: Xavier Roumegue Date: Sat Jul 30 17:48:39 2022 +0200 media: v4l: uapi: Add user control base for DW100 controls Add a control base for DW100 driver controls, and reserve 16 controls. Signed-off-by: Xavier Roumegue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bdbb016da6eeec16b6e9f54d759a0cdc7ebe090e Author: Xavier Roumegue Date: Sat Jul 30 17:48:38 2022 +0200 media: Documentation: dw100: Add user documentation for the DW100 driver Add user documentation for the DW100 driver. while at it, replace spaces with tab on drivers list. Signed-off-by: Xavier Roumegue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f1739ec4c778f316fd3d0909408d23679cd77ed6 Author: Xavier Roumegue Date: Sat Jul 30 17:48:37 2022 +0200 media: v4l2-ctrls: Export default v4l2_ctrl_type_ops callbacks Export the callback functions of the default v4l2 control type operations such as a driver defining its own operations could reuse some of them. Signed-off-by: Xavier Roumegue Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6b1aaa689348fecba304911e6bc89f3f5b0a4825 Author: Hans Verkuil Date: Sat Jul 30 17:48:36 2022 +0200 media: v4l2-ctrls: optimize type_ops for arrays Initializing arrays and validating or checking for equality of arrays is suboptimal since it does this per element. Change the ops to operate on the whole payload to speed up array operations. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0550fffd5b3d32118a335718d1e3ec93e6bc411 Author: Jinpeng Cui Date: Mon Aug 29 09:13:19 2022 +0000 ASoC: codecs: max98088: remove redundant ret variable Return value from devm_snd_soc_register_component() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Link: https://lore.kernel.org/r/20220829091319.266068-1-cui.jinpeng2@zte.com.cn Signed-off-by: Mark Brown commit 917bda9ab155032a02be1a57ebd4d949ae9e1528 Merge: 95086cb969b2c 2c2d7a67defa1 Author: Jani Nikula Date: Mon Aug 29 14:44:38 2022 +0300 Merge drm/drm-next into drm-intel-next Sync drm-intel-next with v6.0-rc as well as recent drm-intel-gt-next. Since drm-next does not have commit f0c70d41e4e8 ("drm/i915/guc: remove runtime info printing from time stamp logging") yet, only drm-intel-gt-next, will need to do that as part of the merge here to build. Signed-off-by: Jani Nikula commit f54e515c91806288126f64b37da0c78baa2d8c1f Author: Joonas Lahtinen Date: Fri Aug 26 12:23:43 2022 +0300 drm/i915/guc: Remove log size module parameters Remove the module parameters for configuring GuC log size. We should instead rely on tuning the defaults to be usable for reporting bugs. v2: - Use correct 1M unit Fixes: 8ad0152afb1b ("drm/i915/guc: Make GuC log sizes runtime configurable") Signed-off-by: Joonas Lahtinen Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: John Harrison Cc: Alan Previn Reviewed-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20220826092343.184568-1-joonas.lahtinen@linux.intel.com commit f97e971dbdc7c83d697fa2209fed0ea50fffa12e Merge: 9c5d03d362519 04e551d66dd88 Author: David S. Miller Date: Mon Aug 29 12:57:38 2022 +0100 Merge branch 'sparx5-mrouter' Casper Andersson says: ==================== net: sparx5: add mrouter support This series adds support for multicast router ports to SparX5. To manage mrouter ports the driver must keep track of mdb entries. When adding an mrouter port the driver has to iterate over all mdb entries and modify them accordingly. v2: - add bailout in free_mdb - re-arrange mdb struct to avoid holes - change devm_kzalloc -> kzalloc - change GFP_ATOMIC -> GFP_KERNEL - fix spelling ==================== Reviewed-by: Steen Hegelund Signed-off-by: David S. Miller commit 04e551d66dd8822d527c264f1f9f9056c1eb2478 Author: Casper Andersson Date: Thu Aug 25 11:28:37 2022 +0200 net: sparx5: add support for mrouter ports All multicast should be forwarded to mrouter ports. Mrouter ports must therefore be part of all active multicast groups, and override flooding from being disabled. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller commit c8a3ea43b5cb5a7db48130a32384f7e48b148de9 Author: Casper Andersson Date: Thu Aug 25 11:28:36 2022 +0200 net: sparx5: add list for mdb entries in driver Keep track of all mdb entries in software for easy access. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller commit e8013f8edaa30e17fd583a326daff1fa86b75c82 Author: Casper Andersson Date: Thu Aug 25 11:28:35 2022 +0200 ethernet: Add helpers to recognize addresses mapped to IP multicast IP multicast must sometimes be discriminated from non-IP multicast, e.g. when determining the forwarding behavior of a given group in the presence of multicast router ports on an offloaded bridge. Therefore, provide helpers to identify these groups. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller commit 9c5d03d362519f36cd551aec596388f895c93d2d Author: Jakub Kicinski Date: Wed Aug 24 17:18:30 2022 -0700 genetlink: start to validate reserved header bytes We had historically not checked that genlmsghdr.reserved is 0 on input which prevents us from using those precious bytes in the future. One use case would be to extend the cmd field, which is currently just 8 bits wide and 256 is not a lot of commands for some core families. To make sure that new families do the right thing by default put the onus of opting out of validation on existing families. Signed-off-by: Jakub Kicinski Acked-by: Paul Moore (NetLabel) Signed-off-by: David S. Miller commit b076fdd02133e6a31db167f8acc368edc2530cc0 Author: Wolfram Sang Date: Wed Aug 24 11:43:26 2022 +0200 spi: renesas,sh-msiof: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220824094327.33685-4-wsa+renesas@sang-engineering.com Signed-off-by: Mark Brown commit ea9d001550abaf2f4c75cf4fcd936ea19f932b84 Author: Wolfram Sang Date: Wed Aug 24 11:43:25 2022 +0200 spi: sh-msiof: add generic Gen4 binding No further changes in this generation discovered yet. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220824094327.33685-3-wsa+renesas@sang-engineering.com Signed-off-by: Mark Brown commit e1e62f05d5d9d7726349e00562299d829e478ce9 Author: Wolfram Sang Date: Wed Aug 24 11:43:24 2022 +0200 spi: renesas,sh-msiof: Add generic Gen4 and r8a779f0 support Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220824094327.33685-2-wsa+renesas@sang-engineering.com Signed-off-by: Mark Brown commit 95086cb969b2cb8abe4984457f219ec70d24052e Author: Jani Nikula Date: Wed Aug 24 16:15:59 2022 +0300 drm/i915: split gem quirks from display quirks The lone gem quirk is an outlier, not even handled by the common quirk code. Split it to a separate gem_quirks member. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/fe9c0cb1e49da0ddc31d24c996af5fd09bce3042.1661346845.git.jani.nikula@intel.com commit e9447260b4a1fb254052b60c9ea4f73c77dd0b34 Author: Claudiu Beznea Date: Fri Aug 26 11:39:27 2022 +0300 ARM: dts: at91: sam9x60ek: remove simple-bus for regulators Keep regulators as individual devices. There is no need to have them under simple bus. This will throw compilation warnings like: - unnecessary #address-cells/#size-cells without "ranges" or child "reg" property. - node has a unit name, but no reg or ranges property. While at it move it down a bit in the file to keep entries sorted alphabetically. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220826083927.3107272-10-claudiu.beznea@microchip.com commit 8f40330773cd9dcf6de43b223f0d8b3ef10e26d2 Author: Horatiu Vultur Date: Thu Aug 25 08:51:35 2022 +0200 ARM: dts: lan966x: add support for pcb8290 Add basic support for pcb8290. It has 2 lan8814 phys(each phy is a quad-port) on the external MDIO bus and no SFP ports. Signed-off-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220825065135.1075049-1-horatiu.vultur@microchip.com commit a233ea1e6268a779d5c8c427eb14a2a89f95f4f9 Author: Michael Riesch Date: Tue Jul 12 15:32:04 2022 +0200 arm64: dts: rockchip: specify pinctrl for i2c adapters on rock-3a On the Radxa ROCK3 Model A the I2C adapters related to the MIPI DSI connector and the M.2/NGFF connector use the non-default pins. Specify the correct pinctrl but leave the adapters disabled (as they are supposed to be activated by overlays that describe the external hardware). Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220712133204.2524942-3-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 7a3eabdcd0fdc344d31b18e78e4f4b5d94db8df5 Author: Michael Riesch Date: Tue Jul 12 15:32:03 2022 +0200 arm64: dts: rockchip: add vcc_mipi regulator to rock-3a The Radxa ROCK3 Model A features a voltage regulator that provides a 3V3 supply to the MIPI DSI connector. Add this regulator to the device tree of the board. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220712133204.2524942-2-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 2fd8bd005897436c5a6d2d150d7b1ae2907f8b06 Author: Michael Riesch Date: Tue Jul 12 15:32:02 2022 +0200 arm64: dts: rockchip: add vcc_cam regulator to rock-3a The Radxa ROCK3 Model A features a voltage regulator that provides a 3V3 supply to the MIPI CSI connector. Add this regulator to the device tree of the board. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220712133204.2524942-1-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit df22d67e5f3d91ce6f0b0f64ccc14d016c89d956 Author: Jani Nikula Date: Wed Aug 24 16:15:56 2022 +0300 drm/i915: move INTEL_FRONTBUFFER_* macros to intel_frontbuffer.h The macros clearly don't belong in i915_drv.h. Move to intel_frontbuffer.h. Also split the BUILD_BUG_ON()s to intel_frontbuffer_track() to avoid depending on some other macros in the header. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/c899fd1ef2220564a876cd88c03e53c4c7b0168b.1661346845.git.jani.nikula@intel.com commit 44eba1b85119a8f2d44a47bb3e8c5c608a05eba4 Author: Jani Nikula Date: Wed Aug 24 16:15:52 2022 +0300 drm/i915/vrr: drop window2_delay member from i915 The window2_delay member has been functionally unused (always set to 0) since it was added in commit bb265dbdf38d ("drm/i915/xelpd: Add VRR guardband for VRR CTL"). Replace it with a FIXME comment. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/036955dc2c4c2d2b2d89555e473d91ce1be10395.1661346845.git.jani.nikula@intel.com commit c3704f1938e76654ebf5c9de220d08cab5d437de Author: Jani Nikula Date: Wed Aug 24 16:15:44 2022 +0300 drm/i915: move and group sagv under display.sagv Move display sagv related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/d67c632f6bc75f6ce562c28f3521404d30ed48f4.1661346845.git.jani.nikula@intel.com commit 304ebaeb3fed122e99d21653eb8ee679872b3031 Author: Jani Nikula Date: Wed Aug 24 16:15:43 2022 +0300 drm/i915: move overlay to display.overlay Move display overlay related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/e019fb538536d36bab28feaafe049e0b1726f2d9.1661346845.git.jani.nikula@intel.com commit 5a4dd6f0e846541e57a58f97fce86da1f3ab3a88 Author: Jani Nikula Date: Wed Aug 24 16:15:42 2022 +0300 drm/i915: move hotplug to display.hotplug Move display hotplug related members under drm_i915_private display sub-struct. Rename struct i915_hotplug to intel_hotplug while at it. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/c1c7562a31c115e9d6a131861e4ca9c97d4f7e09.1661346845.git.jani.nikula@intel.com commit bc12b70f7d216b36bd87701349374a13e486f8eb Author: Peter Zijlstra Date: Thu Aug 25 13:36:40 2022 +0200 x86/earlyprintk: Clean up pciserial While working on a GRUB patch to support PCI-serial, a number of cleanups were suggested that apply to the code I took inspiration from. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Bjorn Helgaas # pci_ids.h Reviewed-by: Greg Kroah-Hartman Link: https://lkml.kernel.org/r/YwdeyCEtW+wa+QhH@worktop.programming.kicks-ass.net commit a30a6fe9e56c401307d534b2c224002f9b2d33ff Author: Jani Nikula Date: Wed Aug 24 16:15:40 2022 +0300 drm/i915: move wm to display.wm Move display watermark related members under drm_i915_private display sub-struct. It's a bit arbitrary when to define a named struct for grouping, but clearly intel_wm is big enough to warrant a separate definition. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/b991dd25f8f539746c475d417691e0816ff6b24a.1661346845.git.jani.nikula@intel.com commit b3d81dafdc48405ed061f3ad0bb75d7ef7d09936 Author: Jani Nikula Date: Wed Aug 24 16:15:39 2022 +0300 drm/i915: move and group fbdev under display.fbdev Move display fbdev related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/7eb563bc88623bd3f12b9a00efec85e6a78d5800.1661346845.git.jani.nikula@intel.com commit 7c13844c3b7662976270996552eee3a0849afc3f Author: Sun Ke Date: Sat Aug 27 10:24:52 2022 +0800 wifi: mac80211: fix potential deadlock in ieee80211_key_link() Add the missing unlock before return in the error handling case. Fixes: ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling") Signed-off-by: Sun Ke Link: https://lore.kernel.org/r/20220827022452.823381-1-sunke32@huawei.com Signed-off-by: Johannes Berg commit 36d225f365e737019a5c774682fba99ba7ae851a Author: Jani Nikula Date: Wed Aug 24 16:15:38 2022 +0300 drm/i915: move dpll under display.dpll Move display dpll related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/8818a2a4330edb9800f567626958b2de8872aa63.1661346845.git.jani.nikula@intel.com commit 4be1c12c880e03e6d174e7e7f9e0dc36bdaf9597 Author: Jani Nikula Date: Wed Aug 24 16:15:37 2022 +0300 drm/i915: move and split audio under display.audio and display.funcs Move display audio related members under drm_i915_private display sub-struct. Split audio funcs to display.funcs to follow the same pattern as all the other display functions. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/51c0b966963a8b47efe3a431e0ce106bdd5269c5.1661346845.git.jani.nikula@intel.com commit 6c77055aa674b6726f8ee57d1c20e950323dbadc Author: Jani Nikula Date: Wed Aug 24 16:15:36 2022 +0300 drm/i915: move dmc to display.dmc Move display dmc related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/7cb91222e099b96b82c74b5f086d50c43459d61b.1661346845.git.jani.nikula@intel.com commit 12dc50823845e3a90d137ee09598e1984c6ec3b2 Author: Jani Nikula Date: Wed Aug 24 16:15:35 2022 +0300 drm/i915: move and group pps members under display.pps Move display PPS related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/7ecc37045ab9eb22831517e5a59ca74edb31962f.1661346845.git.jani.nikula@intel.com commit 203eb5a98edbe40e64fbc794011ff7261eb55d8b Author: Jani Nikula Date: Wed Aug 24 16:15:34 2022 +0300 drm/i915: move and group gmbus members under display.gmbus Move display gmbus related members under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/9379e4d8982c1ddea215a3f602f08a4055928c7c.1661346845.git.jani.nikula@intel.com commit 1db560169211e66f12f24707e30403468847c44b Merge: b90cb10531903 f485f6d852696 Author: Arnd Bergmann Date: Mon Aug 29 11:13:46 2022 +0200 Merge tag 'gemini-dts-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt Gemini DTS updates for kernel v6.1: - Enable Gigabit ethernet on SSI1328 and NS2502 - Modify NS2502 us use RedBoot partition parsing * tag 'gemini-dts-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: Let Gemini NS2502 parse redboot partitions ARM: dts: gemini: ssi1328: permit to use gigabit ARM: dts: gemini: ns2502: permit to use gigabit Link: https://lore.kernel.org/r/CACRpkdZt58ExwG+6EicODLhuVc8NSgCGUj4uNQmtnES8Cnf5uQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit 34dc3cc5017f08df21a8afc9ddec2f622a5f04ed Author: Jani Nikula Date: Wed Aug 24 16:15:33 2022 +0300 drm/i915: move color_funcs to display.funcs Move display color functions under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/36d6e9327582c94c1962c10ebd1581c3d15a5743.1661346845.git.jani.nikula@intel.com commit 06a50913d96ed0f2e9ecd1ee3f224af72b03af6b Author: Jani Nikula Date: Wed Aug 24 16:15:32 2022 +0300 drm/i915: move fdi_funcs to display.funcs Move display fdi functions under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/16ff8df6c08411c0e5aac3356dffe7f5120fcfeb.1661346845.git.jani.nikula@intel.com commit 853ff6c3215070c38cfe2b1bedee3ccb21e29b52 Author: Sudeep Holla Date: Mon Aug 22 13:16:04 2022 +0100 arm64: defconfig: Drop ARM_CPUIDLE(generic idle driver) config Since commit 788961462f34 ("ARM: psci: cpuidle: Enable PSCI CPUidle driver") the generic ARM cpuidle driver probe no longer worked on ARM64. It was however left enabled with the driver failing to probe successfully. However the commit 51280acad855 ("cpuidle: cpuidle-arm: remove arm64 support") removed the Kconfig option so that it is no longer enabled for arm64 platforms. Drop the disabled/unavailable ARM_CPUIDLE from the defconfig. Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20220822121604.2213778-1-sudeep.holla@arm.com' Signed-off-by: Arnd Bergmann commit 103472c13f0afedab818a2c6469d78c2fb29ad8c Author: Jani Nikula Date: Wed Aug 24 16:15:31 2022 +0300 drm/i915: move wm_disp funcs to display.funcs Move display watermark functions under drm_i915_private display sub-struct. Rename struct drm_i915_wm_disp_funcs to intel_wm_funcs while at it. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/29d07c82ef7d33a59fc9c8e25ae2d2f900677a4c.1661346845.git.jani.nikula@intel.com commit 5a04eb5be8e4da3b3574fbd56b6c43fa1f749cdf Author: Jani Nikula Date: Wed Aug 24 16:15:30 2022 +0300 drm/i915: move hotplug_funcs to display.funcs Move display hotplug functions under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/1cf677f1d02b8b621ec41ff77fe5de26d4f6954a.1661346845.git.jani.nikula@intel.com commit ae611d171ec02f067b36a1658f29a2f3a9eb2a91 Author: Jani Nikula Date: Wed Aug 24 16:15:29 2022 +0300 drm/i915: move dpll_funcs to display.funcs Move display dpll functions under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/5bf7aada2c7f0500c5002fa089fb66a92019a301.1661346845.git.jani.nikula@intel.com commit 986531bd0e72e74190c217523ff212c9bafa409b Author: Jani Nikula Date: Wed Aug 24 16:15:28 2022 +0300 drm/i915: move cdclk_funcs to display.funcs Move display cdclk functions under drm_i915_private display sub-struct. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/77e12e21bb9682a3c1d54f8d59eecc5945ef16d0.1661346845.git.jani.nikula@intel.com commit 5b8e894163bedd81dacdf517a6aa49625aa98d1f Author: Stefan Hansson Date: Thu Aug 25 18:20:35 2022 +0200 ARM: configs: replace CONFIG_NO_HZ=y with CONFIG_NO_HZ_IDLE=y According to https://www.kernel.org/doc/html/latest/timers/no_hz.html, CONFIG_NO_HZ=y should be replaced by CONFIG_NO_HZ_IDLE=y for newer kernels, so let's reflect that in the 32-bit ARM defconfigs. Signed-off-by: Stefan Hansson Acked-by: Krzysztof Kozlowski # Samsung Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220825162034.5901-1-newbie13xd@gmail.com' Signed-off-by: Arnd Bergmann commit 839ddb93d5a08a6239431babfc7ca4489860ff98 Merge: b90cb10531903 8bd2b56b53dbf Author: Arnd Bergmann Date: Mon Aug 29 10:50:39 2022 +0200 Merge branch 'arm/defconfig-cleanup' into arm/defconfig I have continued the cleanup of the multi_*_defconfig files, and reordered the other files according to the 'make savedefconfig' output as before. Since a third of the defconfig files are for machines that are now marked as unused, I skipped those files. There are still a few things that get removed by 'make savedefconfig' as they now get selected by some driver: -CONFIG_SERIAL_BCM63XX=y -CONFIG_SND_AUDIO_GRAPH_CARD=m -CONFIG_NEW_LEDS=y -CONFIG_LEDS_TRIGGERS=y -CONFIG_TEGRA20_APB_DMA=y I think for those we should follow up with patches to remove the 'select' statements. * arm/defconfig-cleanup: ARM: defconfig: fix CONFIG_SND_SOC_AC97_CODEC name ARM: defconfig: drop CONFIG_MICROCHIP_PIT64B ARM: defconfig: drop CONFIG_USB_FSL_USB2 ARM: defconfig: drop CONFIG_SND_SOC_FSL_SAI ARM: defconfig: drop CONFIG_PTP_1588_CLOCK=y ARM: defconfig: drop CONFIG_DRM_RCAR_LVDS ARM: defconfig: drop CONFIG_SERIAL_OMAP references ARM: defconfig: drop CONFIG_NET_VENDOR_ASIX=y ARM: defconfig: clean up multi_v4t and multi_v5 configs ARM: defconfig: reorder defconfig files commit 8bd2b56b53dbfa87419e45614506222df1970ba5 Author: Arnd Bergmann Date: Thu Aug 11 16:51:16 2022 +0200 ARM: defconfig: fix CONFIG_SND_SOC_AC97_CODEC name The CONFIG_SND_SOC_AC97 symbol was recently enabled but does not actually exist. From the patch description, I assume that this was meant to be CONFIG_SND_SOC_AC97_CODEC, which is used in imx_v6_v7_defconfig. Fixes: 2cc1cd26e913 ("ARM: configs: Enable ASoC AC'97 glue") Signed-off-by: Arnd Bergmann commit 8a981ea176e27f793120f098072ac993af3c81c8 Author: Arnd Bergmann Date: Thu Aug 11 17:48:10 2022 +0200 ARM: defconfig: drop CONFIG_MICROCHIP_PIT64B This is now default-enabled when CONFIG_SOC_SAMA7 is used, so the defconfig entry can be dropped. Fixes: f611af4c3bfa ("ARM: at91: Kconfig: implement PIT64B selection") Acked-by: Claudiu Beznea Signed-off-by: Arnd Bergmann commit 1bc709eb315f58b5231c8f0137c73d2bdabca9cf Author: Arnd Bergmann Date: Thu Aug 11 17:33:02 2022 +0200 ARM: defconfig: drop CONFIG_USB_FSL_USB2 USB_FSL_USB2 is no longer available for Arm platforms and was replaced by the chipidea driver. Fixes: a390bef7db1f ("usb: gadget: fsl_mxc_udc: Remove the driver") Acked-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann commit d1521bcef4fc58b20ca98d06c508529459be8329 Author: Arnd Bergmann Date: Thu Aug 11 16:36:59 2022 +0200 ARM: defconfig: drop CONFIG_SND_SOC_FSL_SAI This is selected by CONFIG_SND_SOC_FSL_ASOC_CARD=m, so the extra line is redundant. Fixes: 212e3b6b8734 ("ARM: configs: Enable more audio support for i.MX") Signed-off-by: Arnd Bergmann commit 39916e7d40e8dc9eca904e0b3e190753fa945ead Author: Arnd Bergmann Date: Thu Aug 11 16:29:25 2022 +0200 ARM: defconfig: drop CONFIG_PTP_1588_CLOCK=y PTP support is now enabled by default for configurations with ethernet support, so drop the redundant entries in defconfig files. Fixes: e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies") Acked-by: Richard Cochran Signed-off-by: Arnd Bergmann commit 1441a15dd49616bd9dd4c25a018b0508cdada576 Author: Arnd Bergmann Date: Thu Aug 11 16:27:13 2022 +0200 ARM: defconfig: drop CONFIG_DRM_RCAR_LVDS This is now a hidden symbol, so just drop the defconfig line. Fixes: 42d95d1b3a9c ("drm/rcar: stop using 'imply' for dependencies") Signed-off-by: Arnd Bergmann commit 1c9cb2bbf7ceee7fbebcecfc0d3c951d938731e7 Author: Arnd Bergmann Date: Thu Aug 11 16:22:35 2022 +0200 ARM: defconfig: drop CONFIG_SERIAL_OMAP references This driver is mutually exclusive with the new 8250_OMAP driver, so 'make defconfig' turns it off already. Drop the reference now. Fixes: 077e1cde78c3 ("ARM: omap2plus_defconfig: Enable 8250_OMAP") Fixes: f98d45145e6a ("ARM: multi_v7_defconfig: Enable 8250-omap serial driver and use it by default") Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 7d40cecd0e36dcd6491a40d14c9b0d072f01e7aa Author: Arnd Bergmann Date: Thu Aug 11 16:18:56 2022 +0200 ARM: defconfig: drop CONFIG_NET_VENDOR_ASIX=y This option is 'default y' and has always been this way, the line was added in error. Fixes: dfe21dcabac0 ("ARM: defconfig: Enable ax88796c driver for Exynos boards") Signed-off-by: Arnd Bergmann commit d11277c35e1a2a3a4ace05d1a4f79eee92b76a2f Author: Arnd Bergmann Date: Thu Aug 11 16:14:13 2022 +0200 ARM: defconfig: clean up multi_v4t and multi_v5 configs Integrator now selects the regulators and versatile selects the reset driver, so the correspondig options can be dropped from the defconfig files. Fixes: d2854bbe5f5c ("ARM: integrator: Add some Kconfig selections") Fixes: 1c6e288da6cc ("ARM: versatile: move restart to the device tree") Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 2c2493b9da9166478fe072e3054f8a5741dadb02 Author: Eyal Birger Date: Fri Aug 26 14:47:00 2022 +0300 xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode Allow specifying the xfrm interface if_id and link as part of a route metadata using the lwtunnel infrastructure. This allows for example using a single xfrm interface in collect_md mode as the target of multiple routes each specifying a different if_id. With the appropriate changes to iproute2, considering an xfrm device ipsec1 in collect_md mode one can for example add a route specifying an if_id like so: ip route add dev ipsec1 encap xfrm if_id 1 In which case traffic routed to the device via this route would use if_id in the xfrm interface policy lookup. Or in the context of vrf, one can also specify the "link" property: ip route add dev ipsec1 encap xfrm if_id 1 link_dev eth15 Note: LWT_XFRM_LINK uses NLA_U32 similar to IFLA_XFRM_LINK even though internally "link" is signed. This is consistent with other _LINK attributes in other devices as well as in bpf and should not have an effect as device indexes can't be negative. Reviewed-by: Nicolas Dichtel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert commit abc340b38ba25cd6c7aa2c0bd9150d30738c82d0 Author: Eyal Birger Date: Fri Aug 26 14:46:59 2022 +0300 xfrm: interface: support collect metadata mode This commit adds support for 'collect_md' mode on xfrm interfaces. Each net can have one collect_md device, created by providing the IFLA_XFRM_COLLECT_METADATA flag at creation. This device cannot be altered and has no if_id or link device attributes. On transmit to this device, the if_id is fetched from the attached dst metadata on the skb. If exists, the link property is also fetched from the metadata. The dst metadata type used is METADATA_XFRM which holds these properties. On the receive side, xfrmi_rcv_cb() populates a dst metadata for each packet received and attaches it to the skb. The if_id used in this case is fetched from the xfrm state, and the link is fetched from the incoming device. This information can later be used by upper layers such as tc, ebpf, and ip rules. Because the skb is scrubed in xfrmi_rcv_cb(), the attachment of the dst metadata is postponed until after scrubing. Similarly, xfrm_input() is adapted to avoid dropping metadata dsts by only dropping 'valid' (skb_valid_dst(skb) == true) dsts. Policy matching on packets arriving from collect_md xfrmi devices is done by using the xfrm state existing in the skb's sec_path. The xfrm_if_cb.decode_cb() interface implemented by xfrmi_decode_session() is changed to keep the details of the if_id extraction tucked away in xfrm_interface.c. Reviewed-by: Nicolas Dichtel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert commit 3b10f8517648d6bbfbe4c3019aa2759c463e546a Author: Jani Nikula Date: Wed Aug 24 16:15:27 2022 +0300 drm/i915: add display sub-struct to drm_i915_private In another long-overdue cleanup, add a display sub-struct to drm_i915_private, and start moving display related members there. Start with display funcs that need a rename anyway to not collide with the new display member. Add a new header under display/ for defining struct intel_display. Rename struct drm_i915_display_funcs to intel_display_funcs while at it. v2: - Fix multi-line comment style (Arun) - Use display as the member name Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/d44cae096b664f7015f8c797d6dfd4964226d4f8.1661346845.git.jani.nikula@intel.com commit e92ab51026ae1616697c21bb86c2b821856c0ea3 Author: Arnd Bergmann Date: Thu Aug 11 15:56:36 2022 +0200 ARM: defconfig: reorder defconfig files The debug-info and can subystem options have moved around in the 'savedefconfig' output, so fix these up to reduce the clutter from the savedefconfig command. Reviewed-by: Claudiu Beznea Acked-by: Jernej Skrabec Signed-off-by: Arnd Bergmann commit 5182a5d48c3d1992b2db8748f96914e07eee0956 Author: Eyal Birger Date: Fri Aug 26 14:46:58 2022 +0300 net: allow storing xfrm interface metadata in metadata_dst XFRM interfaces provide the association of various XFRM transformations to a netdevice using an 'if_id' identifier common to both the XFRM data structures (polcies, states) and the interface. The if_id is configured by the controlling entity (usually the IKE daemon) and can be used by the administrator to define logical relations between different connections. For example, different connections can share the if_id identifier so that they pass through the same interface, . However, currently it is not possible for connections using a different if_id to use the same interface while retaining the logical separation between them, without using additional criteria such as skb marks or different traffic selectors. When having a large number of connections, it is useful to have a the logical separation offered by the if_id identifier but use a single network interface. Similar to the way collect_md mode is used in IP tunnels. This patch attempts to enable different configuration mechanisms - such as ebpf programs, LWT encapsulations, and TC - to attach metadata to skbs which would carry the if_id. This way a single xfrm interface in collect_md mode can demux traffic based on this configuration on tx and provide this metadata on rx. The XFRM metadata is somewhat similar to ip tunnel metadata in that it has an "id", and shares similar configuration entities (bpf, tc, ...), however, it does not necessarily represent an IP tunnel or use other ip tunnel information, and also has an optional "link" property which can be used for affecting underlying routing decisions. Additional xfrm related criteria may also be added in the future. Therefore, a new metadata type is introduced, to be used in subsequent patches in the xfrm interface and configuration entities. Reviewed-by: Nikolay Aleksandrov Reviewed-by: Nicolas Dichtel Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert commit 26dbd66eab8080be51759e48280da04015221e22 Author: Sabrina Dubroca Date: Thu Aug 25 17:16:51 2022 +0200 esp: choose the correct inner protocol for GSO on inter address family tunnels Commit 23c7f8d7989e ("net: Fix esp GSO on inter address family tunnels.") is incomplete. It passes to skb_eth_gso_segment the protocol for the outer IP version, instead of the inner IP version, so we end up calling inet_gso_segment on an inner IPv6 packet and ipv6_gso_segment on an inner IPv4 packet and the packets are dropped. This patch completes the fix by selecting the correct protocol based on the inner mode's family. Fixes: c35fe4106b92 ("xfrm: Add mode handlers for IPsec on layer 2") Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 423511ec23e2a6fa7830ed76b0283268e795d09d Author: Will McVicker Date: Thu Aug 25 23:54:02 2022 +0000 PCI: dwc: Drop dependency on ZONE_DMA32 Re-work the msi_msg DMA allocation logic to use dmam_alloc_coherent() which uses the coherent DMA mask to try to return an allocation within the DMA mask limits. With that, we now can drop the msi_page parameter in struct dw_pcie_rp. This allows kernel configurations that disable ZONE_DMA32 to continue supporting a 32-bit DMA mask. Without this patch, the PCIe host device will fail to probe when ZONE_DMA32 is disabled. Link: https://lore.kernel.org/r/20220825235404.4132818-2-willmcvicker@google.com Fixes: 35797e672ff0 ("PCI: dwc: Fix MSI msi_msg DMA mapping") Reported-by: Isaac J. Manjarres Signed-off-by: Will McVicker Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Jingoo Han commit fdfaefa831728110f591764c1dc274fb3739e5c1 Author: Fabio Estevam Date: Sat Aug 27 17:38:13 2022 -0300 arm64: dts: meson-sm1-sei610: Remove 'enable-active-low' The 'enable-active-low' property is not a valid one. Only 'enable-active-high' is valid, and when this property is absent the gpio regulator will act as active low by default. Remove the invalid 'enable-active-low' property. Signed-off-by: Fabio Estevam Reviewed-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220827203813.1742715-2-festevam@denx.de commit 6b2592f087bb7e35fd0a6616bc92d87d9af63aab Author: Fabio Estevam Date: Sat Aug 27 17:38:12 2022 -0300 arm64: dts: meson-g12a: Remove 'enable-active-low' The 'enable-active-low' property is not a valid one. Only 'enable-active-high' is valid, and when this property is absent the gpio regulator will act as active low by default. Remove the invalid 'enable-active-low' property. Signed-off-by: Fabio Estevam Reviewed-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220827203813.1742715-1-festevam@denx.de commit 291f269a49916a8494526edca92afed69270241f Author: Jason Wang Date: Thu Aug 4 19:47:51 2022 +0800 drm/gma500: Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220804114751.46714-1-wangborong@cdjrlc.com commit f4054e522531038354bea5c924f286fdd8ae77b5 Author: Anshuman Khandual Date: Wed Aug 24 10:18:18 2022 +0530 perf: Add PERF_BR_NEW_ARCH_[N] map for BRBE on arm64 platform BRBE captured branch types will overflow perf_branch_entry.type and generic branch types in perf_branch_entry.new_type. So override each available arch specific branch type in the following manner to comprehensively process all reported branch types in BRBE. PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1 PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2 PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3 PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4 PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5 Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220824044822.70230-5-anshuman.khandual@arm.com commit 5402d25aa5710d240040f73fb13d7d5c303ef071 Author: Anshuman Khandual Date: Wed Aug 24 10:18:17 2022 +0530 perf: Capture branch privilege information Platforms like arm64 could capture privilege level information for all the branch records. Hence this adds a new element in the struct branch_entry to record the privilege level information, which could be requested through a new event.attr.branch_sample_type based flag PERF_SAMPLE_BRANCH_PRIV_SAVE. This flag helps user choose whether privilege information is captured. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220824044822.70230-4-anshuman.khandual@arm.com commit b190bc4ac9e6d9763b61654c5a0c085ff77d7a09 Author: Anshuman Khandual Date: Wed Aug 24 10:18:16 2022 +0530 perf: Extend branch type classification branch_entry.type now has ran out of space to accommodate more branch types classification. This will prevent perf branch stack implementation on arm64 (via BRBE) to capture all available branch types. Extending this bit field i.e branch_entry.type [4 bits] is not an option as it will break user space ABI both for little and big endian perf tools. Extend branch classification with a new field branch_entry.new_type via a new branch type PERF_BR_EXTEND_ABI in branch_entry.type. Perf tools which could decode PERF_BR_EXTEND_ABI, will then parse branch_entry.new_type as well. branch_entry.new_type is a 4 bit field which can hold upto 16 branch types. The first three branch types will hold various generic page faults followed by five architecture specific branch types, which can be overridden by the platform for specific use cases. These architecture specific branch types gets overridden on arm64 platform for BRBE implementation. New generic branch types - PERF_BR_NEW_FAULT_ALGN - PERF_BR_NEW_FAULT_DATA - PERF_BR_NEW_FAULT_INST New arch specific branch types - PERF_BR_NEW_ARCH_1 - PERF_BR_NEW_ARCH_2 - PERF_BR_NEW_ARCH_3 - PERF_BR_NEW_ARCH_4 - PERF_BR_NEW_ARCH_5 Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220824044822.70230-3-anshuman.khandual@arm.com commit a724ec82966d57e4b5d36341d3e3dc1a3c011564 Author: Anshuman Khandual Date: Wed Aug 24 10:18:15 2022 +0530 perf: Add system error and not in transaction branch types This expands generic branch type classification by adding two more entries there in i.e system error and not in transaction. This also updates the x86 implementation to process X86_BR_NO_TX records as appropriate. This changes branch types reported to user space on x86 platform but it should not be a problem. The possible scenarios and impacts are enumerated here. -------------------------------------------------------------------------- | kernel | perf tool | Impact | -------------------------------------------------------------------------- | old | old | Works as before | -------------------------------------------------------------------------- | old | new | PERF_BR_UNKNOWN is processed | -------------------------------------------------------------------------- | new | old | PERF_BR_NO_TX is blocked via old PERF_BR_MAX | -------------------------------------------------------------------------- | new | new | PERF_BR_NO_TX is recognized | -------------------------------------------------------------------------- When PERF_BR_NO_TX is blocked via old PERF_BR_MAX (new kernel with old perf tool) the user space might throw up an warning complaining about an unrecognized branch types being reported, but it's expected. PERF_BR_SERROR & PERF_BR_NO_TX branch types will be used for BRBE implementation on arm64 platform. PERF_BR_NO_TX complements 'abort' and 'in_tx' elements in perf_branch_entry which represent other transaction states for a given branch record. Because this completes the transaction state classification. Signed-off-by: Anshuman Khandual Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220824044822.70230-2-anshuman.khandual@arm.com commit a7c7d23649f1fc3a73507d2aab3a5010a7b6745d Author: Patrik Jakobsson Date: Fri Jun 10 15:09:25 2022 +0200 drm/gma500: Fix SDVO command debug printing At some point the DRM printers started adding a newline after each print. This caused SDVO command debug printing to look weird. Fix this by using snprintf to print into a buffer which can be printed as a whole by DRM_DEBUG_KMS(). Code is heavily inspired by i915. Signed-off-by: Patrik Jakobsson Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220610130925.8650-1-patrik.r.jakobsson@gmail.com commit f9781bb18ed828e7b83b7bac4a4ad7cd497ee7d7 Author: Jane Chu Date: Fri Aug 26 17:38:51 2022 -0600 x86/mce: Retrieve poison range from hardware When memory poison consumption machine checks fire, MCE notifier handlers like nfit_handle_mce() record the impacted physical address range which is reported by the hardware in the MCi_MISC MSR. The error information includes data about blast radius, i.e. how many cachelines did the hardware determine are impacted. A recent change 7917f9cdb503 ("acpi/nfit: rely on mce->misc to determine poison granularity") updated nfit_handle_mce() to stop hard coding the blast radius value of 1 cacheline, and instead rely on the blast radius reported in 'struct mce' which can be up to 4K (64 cachelines). It turns out that apei_mce_report_mem_error() had a similar problem in that it hard coded a blast radius of 4K rather than reading the blast radius from the error information. Fix apei_mce_report_mem_error() to convey the proper poison granularity. Signed-off-by: Jane Chu Signed-off-by: Borislav Petkov Reviewed-by: Dan Williams Reviewed-by: Ingo Molnar Link: https://lore.kernel.org/r/7ed50fd8-521e-cade-77b1-738b8bfb8502@oracle.com Link: https://lore.kernel.org/r/20220826233851.1319100-1-jane.chu@oracle.com commit 644814c1070d9d165b85064e9ff1a80681b560fe Author: Wolfram Sang Date: Wed Aug 24 12:35:12 2022 +0200 clk: renesas: r8a779f0: Add MSIOF clocks Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220824103515.54931-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 425e9e04ae5d94fd140f48b1e1bd1c4e4de533e9 Author: Phil Edworthy Date: Fri Aug 19 20:39:42 2022 +0100 clk: renesas: r9a09g011: Add IIC clock and reset entries Add IIC groups clock and reset entries to CPG driver. IIC Group A consists of IIC0 and IIC1. IIC Group B consists of IIC2 and IIC3. To confuse things, IIC_PCLK0 is used by group A and IIC_PCLK1 is used by group B. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220819193944.337599-2-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 13079557ec9775ce4208d3066c415a0ab7ca170e Author: Wolfram Sang Date: Thu Aug 25 09:10:22 2022 +0200 arm64: dts: renesas: r8a774a1: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-7-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 8d580c0f5371d2fef2ad6cb57325356cb0f5a626 Author: Geert Uytterhoeven Date: Fri Aug 26 16:49:48 2022 +0200 arm64: dts: renesas: r8a774e1: Rename i2c_dvfs to iic_pmic As RZ/G2 SoCs do not support DVFS, the "iic-dvfs" module was renamed to "iic-pmic" in the RZ/G Series, 2nd Generation User’s Manual: Hardware Rev. 1.00. See also commit a636d8037ef6028a ("arm64: dts: renesas: rzg2: Rename i2c_dvfs to iic_pmic"), which apparently forgot to update RZ/G2H. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7d60653d4d63904dc025a133297a53eb885fa064.1661525361.git.geert+renesas@glider.be commit 1d35135672c9c5e883eabb3b0288822cac79ac1f Author: Wolfram Sang Date: Thu Aug 25 09:10:21 2022 +0200 arm64: dts: renesas: r8a779a0: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-6-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit fb2a16097c3cc660788cddae96dc2c44cd4502b6 Author: Wolfram Sang Date: Thu Aug 25 09:10:20 2022 +0200 arm64: dts: renesas: r8a77990: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-5-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit efab8210e015f9078001099552058b3c38b123b0 Author: Wolfram Sang Date: Thu Aug 25 09:10:19 2022 +0200 arm64: dts: renesas: r8a77980: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-4-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 8cc5dcfabab8cfe9dd5a4386b64f0562399e3139 Author: Wolfram Sang Date: Thu Aug 25 09:10:18 2022 +0200 arm64: dts: renesas: r8a77970: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 59c148535324e1fc61a0cad6d04559196dde5ed1 Author: Wolfram Sang Date: Thu Aug 25 09:10:17 2022 +0200 arm64: dts: renesas: r8a779{51|60|65}: Put I2C aliases to board files I2C aliases are not a property of a SoC. They belong to board files where they are named accordingly in the schematics. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220825071022.7864-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 39ffd3307fb85ec8a73a8b9d13b0ea923c48b72a Author: Phil Edworthy Date: Fri Aug 19 20:39:44 2022 +0100 arm64: dts: renesas: rzv2m evk: Enable i2c Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220819193944.337599-4-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 54ac6794df9db684d367662a7ea84b7f41cf9312 Author: Phil Edworthy Date: Fri Aug 19 20:39:43 2022 +0100 arm64: dts: renesas: r9a09g011: Add i2c nodes Add device nodes for the I2C controllers that are not assigned to the ISP. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220819193944.337599-3-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit eb970f3eb909a8da5f7bc1c2f83a1eac4adac838 Author: Geert Uytterhoeven Date: Mon Aug 22 12:00:13 2022 +0200 arm64: defconfig: Enable additional support for Renesas platforms Increase build and test coverage by enabling support for more hardware present on Renesas SoCs and boards: - Renesas RZ/V2M I2C, - Renesas Universal Flash Storage Controller on R-Car S4, as used on the Spider board. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/bd863fdd098be394d57b9dc15f8bb0f6b1f2d78a.1661162345.git.geert+renesas@glider.be commit 8b99550ba41fc141a7a839a6100415a70cc123cb Author: Geert Uytterhoeven Date: Mon Aug 22 11:51:49 2022 +0200 ARM: shmobile: defconfig: Refresh for v6.0-rc1 Refresh the defconfig for Renesas ARM systems: - Enable RZ/N1 A5PSW Ethernet switch support incl. dependencies (RZN1D-DB), - Move CONFIG_CAN_RCAR=y (moved in commit d7786af59860a113 ("net: Kconfig: move the CAN device menu to the "Device Drivers" section")), - Enable RZ/N1 Gigabit Ethernet MAC support (RZN1D-DB), - Enable RZ/N1 Pin control support (RZN1D-DB), - Enable RZ/N1 DMA support incl. dependencies (RZN1D-DB). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/428755447c1abbc8f1f08a63e83353d23ab22dd6.1661154821.git.geert+renesas@glider.be commit d4ecb56e86bf3bb2e5ef99e353f892d325b43174 Author: Daisuke Matsuda Date: Mon Aug 29 10:23:35 2022 +0900 RDMA/rxe: Remove an unused member from struct rxe_mr Commit 1e75550648da ("Revert "RDMA/rxe: Create duplicate mapping tables for FMRs"") brought back the member 'va' to struct rxe_mr. However, it is actually used by nobody and thus can be removed. Fixes: 1e75550648da ("Revert "RDMA/rxe: Create duplicate mapping tables for FMRs"") Link: https://lore.kernel.org/r/20220829012335.1212697-1-matsuda-daisuke@fujitsu.com Signed-off-by: Daisuke Matsuda Signed-off-by: Leon Romanovsky commit c0f2df49cf2471289d5aabf16f50ac26eb268f7d Author: Tejun Heo Date: Sun Aug 28 17:54:15 2022 -1000 cgroup: Fix build failure when CONFIG_SHRINKER_DEBUG fa7e439cf90b ("cgroup: Homogenize cgroup_get_from_id() return value") broken build when CONFIG_SHRINKER_DEBUG by trying to return an errno from mem_cgroup_get_from_ino() which returns struct mem_cgroup *. Fix by using ERR_CAST() instead. Signed-off-by: Tejun Heo Reported-by: Stephen Rothwell Cc: Michal Koutný f Fixes: fa7e439cf90b ("cgroup: Homogenize cgroup_get_from_id() return value") commit 5b7f4e5de61ba8c44317718936864da29eeba62a Author: Krzysztof Kozlowski Date: Fri Aug 26 12:36:59 2022 +0300 ASoC: codecs: allow compile testing without MFD drivers Motorola CPCAP, Lochnagar Sound, Rockchip RK817 and Qualcomm WCD9340/WCD9341 do not depend on parent MFD driver in build time and can be compile tested without respective MFD part for increased build coverage. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220826093659.1059276-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit b9320f545e2c91caf2a15f67537ef538928ca6af Author: Xiangsheng Hou Date: Mon Jul 25 20:02:05 2022 +0800 dt-bindings: mediatek: Add axi clock in mt8173 dts example For mt8173, it is needed to add the axi clock for dma mode. Signed-off-by: Xiangsheng Hou Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220725120204.10834-1-xiangsheng.hou@mediatek.com Signed-off-by: Mark Brown commit b662748ff2e8ff99daabdfbd928270f25f29a9fd Author: Yang Yingliang Date: Fri Aug 26 14:19:41 2022 +0800 regulator: tps65219: change tps65219_regulator_irq_types to static tps65219_regulator_irq_types is only used in tps65219-regulator.c now, change it to static. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220826061941.1814723-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 99a387c7818fe422fa96458f56bc74f05f263013 Author: Venkata Prasad Potturu Date: Fri Aug 26 12:12:45 2022 +0530 ASoC: amd: acp: Modify dai_id macros to be more generic Change dai_id macros to make I2S instances in order. Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20220826064250.3302260-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit c18b6c188cd9d1db93ee72513ce367e4195b1c2a Merge: 6bbabd28805f3 de3287f177a56 Author: Mark Brown Date: Sun Aug 28 21:58:57 2022 +0100 ASoC: Cleanup deprecated regmap-irq functionality Merge series from Aidan MacDonald : Update two ASoC codec drivers to remove uses of regmap-irq type registers, which have recently been deprecated by the "regmap-irq cleanups and refactoring" series in linux-next. Link: https://lore.kernel.org/lkml/20220623211420.918875-1-aidanmacdonald.0x0@gmail.com/ commit 56ec456293239b3c5dfb0e4dcf22972b1b8c571d Author: Patrice Chotard Date: Fri Aug 26 11:20:31 2022 +0200 spi: stm32-qspi: Fix stm32_qspi_transfer_one_message() error path The patch a557fca630cc: "spi: stm32_qspi: Add transfer_one_message() spi callback" from Aug 23, 2022, leads to the following Smatch static checker warning: drivers/spi/spi-stm32-qspi.c:627 stm32_qspi_transfer_one_message() error: uninitialized symbol 'ret'.Fix the following Smatch static checker warning: Fixes: a557fca630cc ("spi: stm32_qspi: Add transfer_one_message() spi callback") Reported-by: Dan Carpenter Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220826092031.1393430-1-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit de3287f177a5666409978a1a0331a33e2842d43b Author: Aidan MacDonald Date: Thu Jul 21 11:25:58 2022 +0100 ASoC: wcd938x: Remove spurious type_base from irq chip There is no reason to set type_base here: the chip doesn't set num_type_regs and none of the IRQs have type information so it's not possible for regmap-irq to configure IRQ types. Type registers are also deprecated in regmap-irq, so any IRQ type support in the future should be implemented using config registers instead. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220721102558.25457-3-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown commit 255a03bb1bb3b10d1c1ca785c596db84723f59d7 Author: Aidan MacDonald Date: Thu Jul 21 11:25:57 2022 +0100 ASoC: wcd9335: Convert irq chip to config regs Type registers in regmap-irq have been deprecated in favor of config registers, which are more general. Chips using type_base can switch over to a single config base register and a standard ->set_irq_type() callback provided by regmap-irq, which uses the type info associated with each 'struct regmap_irq' to update type registers in the same way as the old code did. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220721102558.25457-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown commit 3a9dd708b902a1a646c3725151554cbef16c2c28 Author: Akhil P Oommen Date: Fri Aug 19 01:52:14 2022 +0530 drm/msm/a6xx: Improve gpu recovery sequence We can do a few more things to improve our chance at a successful gpu recovery, especially during a hangcheck timeout: 1. Halt CP and GMU core 2. Do RBBM GBIF HALT sequence 3. Do a soft reset of GPU core Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498400/ Link: https://lore.kernel.org/r/20220819015030.v5.6.Idf2ba51078e87ae7ceb75cc77a5bd4ff2bd31eab@changeid Signed-off-by: Rob Clark commit 1f6cca404918d2d3bc476afb31b371a406009c06 Author: Akhil P Oommen Date: Fri Aug 19 01:52:13 2022 +0530 drm/msm/a6xx: Ensure CX collapse during gpu recovery Because there could be transient votes from other drivers/tz/hyp which may keep the cx gdsc enabled, we should poll until cx gdsc collapses. We can use the reset framework to poll for cx gdsc collapse from gpucc clk driver. This feature requires support from the platform's gpucc driver. Signed-off-by: Akhil P Oommen Reviewed-by: Dmitry Baryshkov Reviewed-by: Philipp Zabel Patchwork: https://patchwork.freedesktop.org/patch/498397/ Link: https://lore.kernel.org/r/20220819015030.v5.5.I176567525af2b9439a7e485d0ca130528666a55c@changeid Signed-off-by: Rob Clark commit f350bfb92b5a89f8056b0e218e05522665e8ac9a Author: Akhil P Oommen Date: Fri Aug 19 01:52:12 2022 +0530 drm/msm: Fix cx collapse issue during recovery There are some hardware logic under CX domain. For a successful recovery, we should ensure cx headswitch collapses to ensure all the stale states are cleard out. This is especially true to for a6xx family where we can GMU co-processor. Currently, cx doesn't collapse due to a devlink between gpu and its smmu. So the *struct gpu device* needs to be runtime suspended to ensure that the iommu driver removes its vote on cx gdsc. Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498398/ Link: https://lore.kernel.org/r/20220819015030.v5.4.I4ac27a0b34ea796ce0f938bb509e257516bc6f57@changeid Signed-off-by: Rob Clark commit 06097e372accb843db7174b337367c5a3f97af52 Author: Akhil P Oommen Date: Fri Aug 19 01:52:11 2022 +0530 drm/msm: Correct pm_runtime votes in recover worker In the scenario where there is one a single submit which is hung, gpu is power collapsed when it is retired. Because of this, by the time we call reover(), gpu state would be already clear. Fix this by correctly managing the pm runtime votes. Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498391/ Link: https://lore.kernel.org/r/20220819015030.v5.3.Ib07ecec3d5c17cb0e1efa6fcddaaa019ec2fb556@changeid Signed-off-by: Rob Clark commit 5b26f37d1365dc0992ecf019a5f1047f98934c34 Author: Akhil P Oommen Date: Fri Aug 19 01:52:10 2022 +0530 drm/msm: Take single rpm refcount on behalf of all submits Instead of separate refcount for each submit, take single rpm refcount on behalf of all the submits. This makes it easier to drop the rpm refcount during recovery in an upcoming patch. Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498392/ Link: https://lore.kernel.org/r/20220819015030.v5.2.Ifee853f6d8217a0fdacc459092bbc9e81a8a7ac7@changeid Signed-off-by: Rob Clark commit 125e03b2b2bec7e749a3d5695febcfebc076481c Author: Akhil P Oommen Date: Fri Aug 19 01:52:09 2022 +0530 drm/msm: Remove unnecessary pm_runtime_get/put We already enable gpu power from msm_gpu_submit(), so avoid a duplicate pm_runtime_get/put from msm_job_run(). Signed-off-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/498390/ Link: https://lore.kernel.org/r/20220819015030.v5.1.Icf1e8f0c9b3e7e9933c3b48c70477d0582f3243f@changeid Signed-off-by: Rob Clark commit 80059b87a3033543e3cb6f9abcd513e13a3f9f06 Author: Rob Clark Date: Sun Aug 21 08:54:35 2022 -0700 drm/msm: De-open-code some CP_EVENT_WRITE Replace some open coding to improve readability. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/499272/ Link: https://lore.kernel.org/r/20220821155441.1092134-1-robdclark@gmail.com commit 4905949395850e41912ae89e2d2fa88d2cd36319 Author: Dmitry Rokosov Date: Mon Aug 22 17:49:24 2022 +0000 dt-bindings: vendor-prefixes: add MEMSensing Microsystems Co., Ltd. MEMSensing Microsystems (Suzhou, China) Co., Ltd. operates as a micro electromechanical system technology company which produces micro electromechanical system microphones and sensors. MEMSensing Microsystems (Suzhou, China) Co., Ltd. applies its products in consumer electronics, industrial control, medical electronics and automotive, and other fields. Signed-off-by: Dmitry Rokosov Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220822175011.2886-3-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit 1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3 Author: Andy Shevchenko Date: Mon Aug 22 17:49:23 2022 +0000 lib/string_helpers: Add str_read_write() helper Add str_read_write() helper to return 'read' or 'write' string literal. Signed-off-by: Andy Shevchenko Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20220822175011.2886-2-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit c05c3e5d4e563ac84624c093addee644194984eb Author: Dmitry Rokosov Date: Fri Aug 12 16:52:27 2022 +0000 iio: common: scmi_sensors: use HZ macro from units.h Remove duplicated definition of UHZ_PER_HZ, because it's available in the units.h as MICROHZ_PER_HZ. Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220812165243.22177-5-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit fe49ce7abd6af8c55e58a8b33a7978c9da32ffb2 Author: Dmitry Rokosov Date: Fri Aug 12 16:52:27 2022 +0000 iio: accel: adxl345: use HZ macro from units.h Remove duplicated definition of NHZ_PER_HZ, because it's available in the units.h as NANOHZ_PER_HZ. Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220812165243.22177-4-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit d2a4cbcb8bdc0e3d1cf85bf47a670695da0bc27a Author: Dmitry Rokosov Date: Fri Aug 12 16:52:26 2022 +0000 units: complement the set of Hz units Currently, Hz units do not have milli, micro and nano Hz coefficients. Some drivers (IIO especially) use their analogues to calculate appropriate Hz values. This patch includes them to units.h definitions, so they can be used from different kernel places. Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20220812165243.22177-3-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron commit 70bccecfcaf6c506191aed487f3cf2695fc3008c Author: Rob Clark Date: Tue Aug 23 09:37:19 2022 -0700 drm/msm/iommu: optimize map/unmap Using map_pages/unmap_pages cuts down on the # of pgtable walks needed in the process of finding where to insert/remove an entry. The end result is ~5-10x faster than mapping a single page at a time. v2: Rename iommu_pgsize(), drop obsolete comments, fix error handling in msm_iommu_pagetable_map() Signed-off-by: Rob Clark Reviewed-by: Sai Prakash Ranjan Patchwork: https://patchwork.freedesktop.org/patch/498892/ Link: https://lore.kernel.org/r/20220823163719.90399-1-robdclark@gmail.com commit 6d29709de8028cfd5a827d02f93a5076ba632563 Author: Rob Clark Date: Sun Aug 7 10:28:48 2022 -0700 drm/msm: Add fault-injection support Intended as a way to trigger error paths in mesa. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/496710/ Link: https://lore.kernel.org/r/20220807172848.2432845-1-robdclark@gmail.com commit d95c196ddb6ccd2445760b003e6e8a43cd5e84ba Author: Rob Clark Date: Tue Aug 2 08:51:48 2022 -0700 drm/msm/gem: Convert to lockdep assert Utilize the power of lockdep for our GEM locking related sanity checking. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496139/ Link: https://lore.kernel.org/r/20220802155152.1727594-16-robdclark@gmail.com commit 05195dcb43504e381bf383e837fc935aac4258cc Author: Yunsheng Lin Date: Fri Aug 26 22:32:15 2022 +0800 RDMA/core: Remove 'device' argument from rdma_build_skb() 'device' argument is never used since rdma_build_skb() is introduced, so remove it. Link: https://lore.kernel.org/r/20220826143215.18111-1-linyunsheng@huawei.com Signed-off-by: Yunsheng Lin Signed-off-by: Leon Romanovsky commit b8a9c18c2f39bd84b8240b744b666114f7d62054 Author: Bart Van Assche Date: Thu Aug 25 14:39:00 2022 -0700 RDMA/srp: Use the attribute group mechanism for sysfs attributes Simplify the SRP driver by using the attribute group mechanism instead of calling device_create_file() explicitly. Link: https://lore.kernel.org/r/20220825213900.864587-5-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Leon Romanovsky commit 351e458f725da8106eba920f3cdecf39a0e31136 Author: Bart Van Assche Date: Thu Aug 25 14:38:59 2022 -0700 RDMA/srp: Handle dev_set_name() failure Instead of ignoring dev_set_name() failure, handle dev_set_name() failure. Convert a device_register() call into device_initialize() and device_add() calls. Link: https://lore.kernel.org/r/20220825213900.864587-4-bvanassche@acm.org Reported-by: Bo Liu Signed-off-by: Bart Van Assche Signed-off-by: Leon Romanovsky commit 0766fcaa1e06d5b5b04f734b788c1556022a9051 Author: Bart Van Assche Date: Thu Aug 25 14:38:58 2022 -0700 RDMA/srp: Remove the srp_host.released completion Move the kfree(host) calls into srp_release_dev(). Convert a device_unregister() call into a device_del() and a device_put() call. Remove the host->released completion object. This patch prepares for handling dev_set_name() failure in srp_add_port(). Link: https://lore.kernel.org/r/20220825213900.864587-3-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Leon Romanovsky commit c8e4c23976554fb9dda1658bd1a3914b202815cd Author: Bart Van Assche Date: Thu Aug 25 14:38:57 2022 -0700 RDMA/srp: Rework the srp_add_port() error path device_register() always calls device_initialize() so calling device_del() is safe even if device_register() fails. Implement the following advice from the comment block above device_register(): "NOTE: _Never_ directly free @dev after calling this function, even if it returned an error! Always use put_device() to give up the reference initialized in this function instead." Keep the kfree() call in the error path since srp_release_dev() does not free the host. Link: https://lore.kernel.org/r/20220825213900.864587-2-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Leon Romanovsky commit d4d7d3630d703ff19923b82534bc18e345477c6f Author: Rob Clark Date: Tue Aug 2 08:51:47 2022 -0700 drm/msm/gem: Add msm_gem_assert_locked() All use of msm_gem_is_locked() is just for WARN_ON()s, so extract out into an msm_gem_assert_locked() patch. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496136/ Link: https://lore.kernel.org/r/20220802155152.1727594-15-robdclark@gmail.com commit 025d27239a2f93b3eb415d4893266195a67d3fe5 Author: Rob Clark Date: Tue Aug 2 08:51:46 2022 -0700 drm/msm/gem: Evict active GEM objects when necessary If we are under enough memory pressure, we should stall waiting for active buffers to become idle in order to evict. v2: Check for __GFP_ATOMIC before blocking Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496135/ Link: https://lore.kernel.org/r/20220802155152.1727594-14-robdclark@gmail.com commit dd2f0d7859927e536b7316b36a9782053d3ad22c Author: Rob Clark Date: Tue Aug 2 08:51:45 2022 -0700 drm/msm/gem: Consolidate shrinker trace Combine separate trace events for purge vs evict into one. When we add support for purging/evicting active buffers we'll just add more info into this one trace event, rather than adding a bunch more events. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496133/ Link: https://lore.kernel.org/r/20220802155152.1727594-13-robdclark@gmail.com commit f371bcc0c2ac57a237849487c9aacbae394e69d1 Author: Rob Clark Date: Tue Aug 2 08:51:44 2022 -0700 drm/msm/gem: Unpin buffers earlier We've already attached the fences, so obj->resv (which shrinker checks) tells us whether they are still active. So we can unpin sooner, before we drop the queue lock. This also avoids the need to grab the obj lock in the retire path, avoiding potential for lock contention between submit and retire. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496132/ Link: https://lore.kernel.org/r/20220802155152.1727594-12-robdclark@gmail.com commit b352ba54a82072614f44c5ea352b5ea6e7f7b4c0 Author: Rob Clark Date: Tue Aug 2 08:51:43 2022 -0700 drm/msm/gem: Convert to using drm_gem_lru This converts over to use the shared GEM LRU/shrinker helpers. Note that it means we are no longer tracking purgeable or willneed buffers that are active separately. But the most recently pinned buffers should be at the tail of the various LRUs, and the shrinker is already prepared to encounter objects which are still active. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496131/ Link: https://lore.kernel.org/r/20220802155152.1727594-11-robdclark@gmail.com commit e7c2af13f811d0c23340154b7b2795876c71e4be Author: Rob Clark Date: Tue Aug 2 08:51:42 2022 -0700 drm/gem: Add LRU/shrinker helper Add a simple LRU helper to assist with driver's shrinker implementation. It handles tracking the number of backing pages associated with a given LRU, and provides a helper to implement shrinker_scan. A driver can use multiple LRU instances to track objects in various states, for example a dontneed LRU for purgeable objects, a willneed LRU for evictable objects, and an unpinned LRU for objects without backing pages. All LRUs that the object can be moved between must share a single lock. v2: lockdep_assert_held() instead of WARN_ON(!mutex_is_locked()) v3: make drm_gem_lru_move_tail_locked() static until there is a user Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Dmitry Osipenko Signed-off-by: Rob Clark Reviewed-by: Dmitry Osipenko Patchwork: https://patchwork.freedesktop.org/patch/496128/ Link: https://lore.kernel.org/r/20220802155152.1727594-10-robdclark@gmail.com commit da53d8b54647482125e29ef80dd9acbb64f2d67f Author: Rob Clark Date: Tue Aug 2 08:51:41 2022 -0700 drm/msm/gem: Remove active refcnt At this point the pinned refcnt is sufficient, and the shrinker is already prepared to encounter objects which are still active according to fences attached to the resv. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496122/ Link: https://lore.kernel.org/r/20220802155152.1727594-9-robdclark@gmail.com commit 9fd5ff7f284a8554f9fa585ce45585deacfd7761 Author: Rob Clark Date: Tue Aug 2 08:51:40 2022 -0700 drm/msm/gem: Consolidate pin/unpin paths Avoid having multiple spots where we increment/decrement pin_count (and associated LRU updating) Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496130/ Link: https://lore.kernel.org/r/20220802155152.1727594-8-robdclark@gmail.com commit e7cd5ee9aa77d9639566c721ad6dda8c25673235 Author: Rob Clark Date: Tue Aug 2 08:51:39 2022 -0700 drm/msm/gem: Rename to pin/unpin_pages Since that is what these fxns actually do.. they are getting *pinned* pages (as opposed to cases where we need pages, but don't need them pinned, like CPU mappings). Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496121/ Link: https://lore.kernel.org/r/20220802155152.1727594-7-robdclark@gmail.com commit 901df24d7ca69c38a9a100b6732cc538a6c255a2 Author: Rob Clark Date: Tue Aug 2 08:51:38 2022 -0700 drm/msm/gem: Rename update_inactive Really what this is doing is updating various LRU lists. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496115/ Link: https://lore.kernel.org/r/20220802155152.1727594-6-robdclark@gmail.com commit 01780d02634a3a99ba0c3ca52d06d0cdfdf82331 Author: Rob Clark Date: Tue Aug 2 08:51:37 2022 -0700 drm/msm/gem: Check for active in shrinker path Currently in our shrinker path we shouldn't be encountering anything that is active, but this will change in subsequent patches. So check if there are unsignaled fences. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496117/ Link: https://lore.kernel.org/r/20220802155152.1727594-5-robdclark@gmail.com commit 05ba44b3704e2115251c340fc72db609a0b97f3b Author: Rob Clark Date: Tue Aug 2 08:51:36 2022 -0700 drm/msm: Split out idr_lock Otherwise if we hit reclaim pinning objects in the submit path, we'll be blocking retire_worker trying to free a submit. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496116/ Link: https://lore.kernel.org/r/20220802155152.1727594-4-robdclark@gmail.com commit fc1dd04c3841c45e2bc811ed96af62af5fc77911 Author: Rob Clark Date: Tue Aug 2 08:51:35 2022 -0700 drm/msm: Small submit cleanup Move more initialization into submit_create(). Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496120/ Link: https://lore.kernel.org/r/20220802155152.1727594-3-robdclark@gmail.com commit f0de40a131d9bd9b722f371f9fca35e81662fc53 Author: Rob Clark Date: Tue Aug 2 08:51:34 2022 -0700 drm/msm: Reorder lock vs submit alloc This lets us drop the NORETRY. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496114/ Link: https://lore.kernel.org/r/20220802155152.1727594-2-robdclark@gmail.com commit aa75622c3be4d5819ce69c714acbcbd67bba5d65 Author: Quentin Monnet Date: Thu Aug 25 23:08:06 2022 +0100 bpf: Fix a few typos in BPF helpers documentation Address a few typos in the documentation for the BPF helper functions. They were reported by Jakub [0], who ran spell checkers on the generated man page [1]. [0] https://lore.kernel.org/linux-man/d22dcd47-023c-8f52-d369-7b5308e6c842@gmail.com/T/#mb02e7d4b7fb61d98fa914c77b581184e9a9537af [1] https://lore.kernel.org/linux-man/eb6a1e41-c48e-ac45-5154-ac57a2c76108@gmail.com/T/#m4a8d1b003616928013ffcd1450437309ab652f9f v3: Do not copy unrelated (and breaking) elements to tools/ header v2: Turn a ',' into a ';' Reported-by: Jakub Wilk Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220825220806.107143-1-quentin@isovalent.com commit b05d64efbb21ad231516b44317af34d2b586cfc4 Author: James Hilliard Date: Thu Aug 25 21:51:39 2022 -0600 selftests/bpf: Declare subprog_noise as static in tailcall_bpf2bpf4 Due to bpf_map_lookup_elem being declared static we need to also declare subprog_noise as static. Fixes the following error: progs/tailcall_bpf2bpf4.c:26:9: error: 'bpf_map_lookup_elem' is static but used in inline function 'subprog_noise' which is not static [-Werror] 26 | bpf_map_lookup_elem(&nop_table, &key); | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: James Hilliard Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220826035141.737919-1-james.hilliard1@gmail.com commit 53a406803ca5b0b1f91beffacad4321fae4fa2a7 Author: Dan Carpenter Date: Thu Aug 25 16:25:08 2022 +0300 net_sched: remove impossible conditions We no longer allow "handle" to be zero, so there is no need to check for that. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Ywd4NIoS4aiilnMv@kili Signed-off-by: Jakub Kicinski commit 931d0a8b201a46aedb7767087438ea9e4467b6cd Author: Dan Carpenter Date: Thu Aug 25 16:17:19 2022 +0300 net: fman: memac: Uninitialized variable on error path The "fixed_link" is only allocated sometimes but it's freed unconditionally in the error handling. Set it to NULL so we don't free uninitialized data. Fixes: 9ea4742a55ca ("net: fman: Configure fixed link in memac_initialization") Signed-off-by: Dan Carpenter Reviewed-by: Sean Anderson Link: https://lore.kernel.org/r/Ywd2X6gdKmTfYBxD@kili Signed-off-by: Jakub Kicinski commit 7dea06dbb097c7cbf6fd930960c32944829468a9 Merge: f7650d82e7dc5 347541e299d50 Author: Jakub Kicinski Date: Fri Aug 26 19:31:23 2022 -0700 Merge branch 'openvswitch-allow-specifying-ifindex-of-new-interfaces' Andrey Zhadchenko says: ==================== openvswitch: allow specifying ifindex of new interfaces CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it. For example, https://github.com/lxc/lxc/issues/2909 The main problem is ifindexes of newly created interfaces. We realy need to preserve them after restore. Current openvswitch API does not allow to specify ifindex. Most of the time we can just create an interface via generic netlink requests and plug it into ovs but datapaths (generally any OVS_VPORT_TYPE_INTERNAL) can only be created via openvswitch requests which do not support selecting ifindex. This patch allows to do so. For new datapaths I decided to use dp_infindex in header as infindex because it control ifindex for other requests too. For internal vports I reused OVS_VPORT_ATTR_IFINDEX. The only concern I have is that previously dp_ifindex was not used for OVS_DP_VMD_NEW requests and some software may not set it to zero. However we have been running this patch at Virtuozzo for 2 years and have not encountered this problem. Not sure if it is worth to add new ovs_datapath_attr instead. ==================== Link: https://lore.kernel.org/r/20220825020450.664147-1-andrey.zhadchenko@virtuozzo.com Signed-off-by: Jakub Kicinski commit 347541e299d50c154f69ead0fcac2917a63e4481 Author: Andrey Zhadchenko Date: Thu Aug 25 05:04:50 2022 +0300 openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests CRIU needs OVS_DP_ATTR_PER_CPU_PIDS to checkpoint/restore newest openvswitch versions. Add pids to generic datapath reply. Limit exported pids amount to nr_cpu_ids. Signed-off-by: Andrey Zhadchenko Acked-by: Christian Brauner (Microsoft) Signed-off-by: Jakub Kicinski commit 54c4ef34c4b6f9720fded620e2893894f9f2c554 Author: Andrey Zhadchenko Date: Thu Aug 25 05:04:49 2022 +0300 openvswitch: allow specifying ifindex of new interfaces CRIU is preserving ifindexes of net devices after restoration. However, current Open vSwitch API does not allow to target ifindex, so we cannot correctly restore OVS configuration. Add new OVS_DP_ATTR_IFINDEX for OVS_DP_CMD_NEW and use it as desired ifindex. Use OVS_VPORT_ATTR_IFINDEX during OVS_VPORT_CMD_NEW to specify new netdev ifindex. Signed-off-by: Andrey Zhadchenko Acked-by: Christian Brauner (Microsoft) Signed-off-by: Jakub Kicinski commit f7650d82e7dc501dfc5920c698bcc0591791a57c Author: Sergei Antonov Date: Wed Aug 24 18:17:24 2022 +0300 net: ftmac100: add an opportunity to get ethaddr from the platform This driver always generated a random ethernet address. Leave it as a fallback solution, but add a call to platform_get_ethdev_address(). Handle EPROBE_DEFER returned from platform_get_ethdev_address() to retry when EEPROM is ready. Signed-off-by: Sergei Antonov Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220824151724.2698107-1-saproj@gmail.com Signed-off-by: Jakub Kicinski commit 8532c60efcc5b7b382006129b77aee2c19c43f15 Author: Marcus Carlberg Date: Wed Aug 24 11:37:06 2022 +0200 net: dsa: mv88e6xxx: Allow external SMI if serial p0_mode set to one of the supported serial mode should not prevent configuring the external SMI interface in mv88e6xxx_g2_scratch_gpio_set_smi. The current masking of the p0_mode only checks the first 2 bits. This results in switches supporting serial mode cannot setup external SMI on certain serial modes (Ex: 1000BASE-X and SGMII). Extend the mask of the p0_mode to include the reduced modes and serial modes as allowed modes for the external SMI interface. Signed-off-by: Marcus Carlberg Link: https://lore.kernel.org/r/20220824093706.19049-1-marcus.carlberg@axis.com Signed-off-by: Jakub Kicinski commit 8f1948bdcf2fb50e9092c0950c3c9ac591382101 Author: Jiri Pirko Date: Thu Aug 25 10:19:40 2022 +0200 genetlink: hold read cb_lock during iteration of genl_fam_idr in genl_bind() In genl_bind(), currently genl_lock and write cb_lock are taken for iteration of genl_fam_idr and processing of static values stored in struct genl_family. Take just read cb_lock for this task as it is sufficient to guard the idr and the struct against concurrent genl_register/unregister_family() calls. This will allow to run genl command processing in genl_rcv() and mnl_socket_setsockopt(.., NETLINK_ADD_MEMBERSHIP, ..) in parallel. Reported-by: Vikas Gupta Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20220825081940.1283335-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 0c1f77d87d699346f8e8a4874692eb82cbcf9c65 Author: Jack Wang Date: Thu Aug 25 08:35:33 2022 +0200 net/mlx4: Fix error check for dma_map_sg dma_map_sg return 0 on error. Signed-off-by: Jack Wang Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20220825063533.21015-1-jinpu.wang@ionos.com Signed-off-by: Jakub Kicinski commit 6005a8aecee8afeba826295321a612ab485c230e Author: Jiri Pirko Date: Thu Aug 25 13:29:23 2022 +0200 net: devlink: add RNLT lock assertion to devlink_compat_switch_id_get() Similar to devlink_compat_phys_port_name_get(), make sure that devlink_compat_switch_id_get() is called with RTNL lock held. Comment already says so, so put this in code as well. Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20220825112923.1359194-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit de9d555cb8d4286a951b5b9bc824a12c739693ec Author: Jiri Pirko Date: Thu Aug 25 13:40:31 2022 +0200 mlx4: Do type_clear() for devlink ports when type_set() was called previously Whenever the type_set() is called on a devlink port, accompany it by matching type_clear() during cleanup. Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20220825114031.1361478-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 1d2577ab0f052375379fa112d1aa34dbb4ef1463 Author: Marcus Carlberg Date: Mon Aug 22 16:41:36 2022 +0200 net: dsa: mv88e6xxx: support RGMII cmode Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode. This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration. Signed-off-by: Marcus Carlberg Link: https://lore.kernel.org/r/20220822144136.16627-1-marcus.carlberg@axis.com Signed-off-by: Jakub Kicinski commit 4e477663e396f48c5cfc5f2d75d4b514f409516a Author: Prashant Malani Date: Fri Aug 19 19:08:03 2022 +0000 platform/chrome: cros_ec_typec: Correct alt mode index Alt mode indices used by USB PD (Power Delivery) start with 1, not 0. Update the alt mdoe registration code to factor this in to the alt mode descriptor. Fixes: de0f49487db3 ("platform/chrome: cros_ec_typec: Register partner altmodes") Signed-off-by: Prashant Malani Acked-by: Heikki Krogerus Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220819190807.1275937-3-pmalani@chromium.org commit 1903adae0464c1e1c36b132db474cb3aff7bc727 Author: Prashant Malani Date: Fri Aug 19 19:08:02 2022 +0000 platform/chrome: cros_ec_typec: Add bit offset for DP VDO Use the right macro while constructing the DP_PORT_VDO to ensure the Pin Assignment offsets are correct. Fixes: 1ff5d97f070c ("platform/chrome: cros_ec_typec: Register port altmodes") Signed-off-by: Prashant Malani Acked-by: Heikki Krogerus Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220819190807.1275937-2-pmalani@chromium.org commit 0bc3be5b4bfd5b75086c26d63584a6f7aaea87d5 Author: Sandipan Das Date: Thu Aug 11 18:00:01 2022 +0530 perf/x86/amd/lbr: Add LbrExtV2 branch speculation info support Provide branch speculation information captured via AMD Last Branch Record Extension Version 2 (LbrExtV2) by setting the speculation info in branch records. The info is based on the "valid" and "spec" bits in the Branch To registers. Suggested-by: Stephane Eranian Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/ddc02f6320464cad0e3ff5bdb2314531568a91bc.1660211399.git.sandipan.das@amd.com commit 93315e46b000fc80fff5d53c3f444417fb3df6de Author: Sandipan Das Date: Thu Aug 11 18:00:00 2022 +0530 perf/core: Add speculation info to branch entries Add a new "spec" bitfield to branch entries for providing speculation information. This will be populated using hints provided by branch sampling features on supported hardware. The following cases are covered: * No branch speculation information is available * Branch is speculative but taken on the wrong path * Branch is non-speculative but taken on the correct path * Branch is speculative and taken on the correct path Suggested-by: Stephane Eranian Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/834088c302faf21c7b665031dd111f424e509a64.1660211399.git.sandipan.das@amd.com commit 245268c19f701c7222dedcb6a383bc73d63925d4 Author: Sandipan Das Date: Thu Aug 11 17:59:59 2022 +0530 perf/x86/amd/lbr: Use fusion-aware branch classifier AMD Last Branch Record Extension Version 2 (LbrExtV2) can report a branch from address that points to an instruction preceding the actual branch by several bytes due to branch fusion and further optimizations in Zen4 processors. In such cases, software should move forward sequentially in the instruction stream from the reported address and the address of the first branch encountered should be used instead. Hence, use the fusion-aware branch classifier to determine the correct branch type and get the offset for adjusting the branch from address. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/c324d2d0a9c3976da30b9563d09e50bfee0f264d.1660211399.git.sandipan.das@amd.com commit df3e9612f758fb5f9c251cbe262e3c68ffe67b2c Author: Sandipan Das Date: Thu Aug 11 17:59:58 2022 +0530 perf/x86: Make branch classifier fusion-aware With branch fusion and other optimizations, branch sampling hardware in some processors can report a branch from address that points to an instruction preceding the actual branch by several bytes. In such cases, the classifier cannot determine the branch type which leads to failures such as with the recently added test from commit b55878c90ab9 ("perf test: Add test for branch stack sampling"). Branch information is also easier to consume and annotate if branch from addresses always point to branch instructions. Add a new variant of the branch classifier that can account for instruction fusion. If fusion is expected and the current branch from address does not point to a branch instruction, it attempts to find the first branch within the next (MAX_INSN_SIZE - 1) bytes and if found, additionally provides the offset between the reported branch from address and the address of the expected branch instruction. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/b6bb0abaa8a54c0b6d716344700ee11a1793d709.1660211399.git.sandipan.das@amd.com commit f9c732249b110fae9ebf4ce33db4cb3a12c6eae3 Author: Sandipan Das Date: Thu Aug 11 17:59:57 2022 +0530 perf/x86/amd/lbr: Add LbrExtV2 software branch filter support With AMD Last Branch Record Extension Version 2 (LbrExtV2), it is necessary to process the branch records further as hardware filtering is not granular enough for identifying certain types of branches. E.g. to record system calls, one should record far branches. The filter captures both far calls and far returns but the irrelevant records are filtered out based on the branch type as seen by the branch classifier. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/e51de057517f77788abd393c832e8dea616d489c.1660211399.git.sandipan.das@amd.com commit 4462fbfe6ec1bfe2196b977010f6ce7b43a32f2c Author: Sandipan Das Date: Thu Aug 11 17:59:56 2022 +0530 perf/x86: Move branch classifier Commit 3e702ff6d1ea ("perf/x86: Add LBR software filter support for Intel CPUs") introduces a software branch filter which complements the hardware branch filter and adds an x86 branch classifier. Move the branch classifier to arch/x86/events/ so that it can be utilized by other vendors for branch record filtering. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/bae5b95470d6bd49f40954bd379f414f5afcb965.1660211399.git.sandipan.das@amd.com commit f4f925dae7419fc7a10af539c073871927ce3a24 Author: Sandipan Das Date: Thu Aug 11 17:59:55 2022 +0530 perf/x86/amd/lbr: Add LbrExtV2 hardware branch filter support If AMD Last Branch Record Extension Version 2 (LbrExtV2) is detected, convert the requested branch filter (PERF_SAMPLE_BRANCH_* flags) to the corresponding hardware filter value and stash it in the event data when a branch stack is requested. The hardware filter value is also saved in per-CPU areas for use during event scheduling. Hardware filtering is provided by the LBR Branch Select register. It has bits which when set, suppress recording of the following types of branches: * CPL = 0 (Kernel only) * CPL > 0 (Userspace only) * Conditional Branches * Near Relative Calls * Near Indirect Calls * Near Returns * Near Indirect Jumps (excluding Near Indirect Calls and Near Returns) * Near Relative Jumps (excluding Near Relative Calls) * Far Branches Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/9336af5c9785b8e14c62220fc0e6cfb10ab97de3.1660211399.git.sandipan.das@amd.com commit ca5b7c0d9621702e107c83216316a6d722878b64 Author: Sandipan Das Date: Thu Aug 11 17:59:54 2022 +0530 perf/x86/amd/lbr: Add LbrExtV2 branch record support If AMD Last Branch Record Extension Version 2 (LbrExtV2) is detected, enable it alongside LBR Freeze on PMI when an event requests branch stack i.e. PERF_SAMPLE_BRANCH_STACK. Each branch record is represented by a pair of registers, LBR From and LBR To. The freeze feature prevents any updates to these registers once a PMC overflows. The contents remain unchanged until the freeze bit is cleared by the PMI handler. The branch records are read and copied to sample data before unfreezing. However, only valid entries are copied. There is no additional register to denote which of the register pairs represent the top of the stack (TOS) since internal register renaming always ensures that the first pair (i.e. index 0) is the one representing the most recent branch and so on. The LBR registers are per-thread resources and are cleared explicitly whenever a new task is scheduled in. There are no special implications on the contents of these registers when transitioning to deep C-states. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/d3b8500a3627a0d4d0259b005891ee248f248d91.1660211399.git.sandipan.das@amd.com commit 703fb765f48897214e3eb110f35dddec80682f60 Author: Sandipan Das Date: Thu Aug 11 17:59:53 2022 +0530 perf/x86/amd/lbr: Detect LbrExtV2 support AMD Last Branch Record Extension Version 2 (LbrExtV2) is driven by Core PMC overflows. It records recently taken branches up to the moment when the PMC overflow occurs. Detect the feature during PMU initialization and set the branch stack depth using CPUID leaf 0x80000022 EBX. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/fc6e45378ada258f1bab79b0de6e05c393a8f1dd.1660211399.git.sandipan.das@amd.com commit 257449c6a50298bd21dcabd644f66a0296b78532 Author: Sandipan Das Date: Thu Aug 11 17:59:52 2022 +0530 x86/cpufeatures: Add LbrExtV2 feature bit CPUID leaf 0x80000022 i.e. ExtPerfMonAndDbg advertises some new performance monitoring features for AMD processors. Bit 1 of EAX indicates support for Last Branch Record Extension Version 2 (LbrExtV2) features. If found to be set during PMU initialization, the EBX bits of the same leaf can be used to determine the number of available LBR entries. For better utilization of feature words, LbrExtV2 is added as a scattered feature bit. [peterz: Rename to AMD_LBR_V2] Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Acked-by: Borislav Petkov Link: https://lore.kernel.org/r/172d2b0df39306ed77221c45ee1aa62e8ae0548d.1660211399.git.sandipan.das@amd.com commit 706460a96fc654e80b6bed1f562b00d2ce9f2f4d Author: Sandipan Das Date: Thu Aug 11 17:59:51 2022 +0530 perf/x86/amd/core: Add generic branch record interfaces AMD processors that are capable of recording branches support either Branch Sampling (BRS) or Last Branch Record (LBR). In preparation for adding Last Branch Record Extension Version 2 (LbrExtV2) support, introduce new static calls which act as gateways to call into the feature-dependent functions based on what is available on the processor. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/b75dbc32663cb395f0d701167e952c6a6b0445a3.1660211399.git.sandipan.das@amd.com commit 9603aa79e851c652f6da873205c92213af36b24f Author: Sandipan Das Date: Thu Aug 11 17:59:50 2022 +0530 perf/x86/amd/core: Refactor branch attributes AMD processors that are capable of recording branches support either Branch Sampling (BRS) or Last Branch Record (LBR). In preparation for adding Last Branch Record Extension Version 2 (LbrExtV2) support, reuse the "branches" capability to advertise information about both BRS and LBR but make the "branch-brs" event exclusive to Family 19h processors that support BRS. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/ba4a4cde6db79b1c65c49834027bbdb8a915546b.1660211399.git.sandipan.das@amd.com commit b40d0156f560932d14e3957579b6508f8d065260 Author: Sandipan Das Date: Thu Aug 11 17:59:49 2022 +0530 perf/x86/amd/brs: Move feature-specific functions Move some of the Branch Sampling (BRS) specific functions out of the Core events sources and into the BRS sources in preparation for adding other mechanisms to record branches. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/b60283b57179475d18ee242d117c335c16733693.1660211399.git.sandipan.das@amd.com commit 5531ecffa4b923bc7739e9ea73c552d80af602dc Author: Shang XiaoJing Date: Wed Aug 24 16:28:56 2022 +0800 sched: Add update_current_exec_runtime helper Wrap repeated code in helper function update_current_exec_runtime for update the exec time of the current. Signed-off-by: Shang XiaoJing Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220824082856.15674-1-shangxiaojing@huawei.com commit ab9ac19c4d0615fee40ec7d49fa16c9fd33f61f8 Author: James Hilliard Date: Thu Aug 25 23:06:59 2022 -0600 selftests/bpf: fix type conflict in test_tc_dtime The sys/socket.h header isn't required to build test_tc_dtime and may cause a type conflict. Fixes the following error: In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, from /usr/include/x86_64-linux-gnu/bits/socket.h:29, from /usr/include/x86_64-linux-gnu/sys/socket.h:33, from progs/test_tc_dtime.c:18: /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:18: error: conflicting types for 'int8_t'; have '__int8_t' {aka 'signed char'} 24 | typedef __int8_t int8_t; | ^~~~~~ In file included from progs/test_tc_dtime.c:5: /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:34:23: note: previous declaration of 'int8_t' with type 'int8_t' {aka 'char'} 34 | typedef __INT8_TYPE__ int8_t; | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: error: conflicting types for 'int64_t'; have '__int64_t' {aka 'long long int'} 27 | typedef __int64_t int64_t; | ^~~~~~~ /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:43:24: note: previous declaration of 'int64_t' with type 'int64_t' {aka 'long int'} 43 | typedef __INT64_TYPE__ int64_t; | ^~~~~~~ make: *** [Makefile:537: /home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_gcc/test_tc_dtime.o] Error 1 Signed-off-by: James Hilliard Link: https://lore.kernel.org/r/20220826050703.869571-1-james.hilliard1@gmail.com Signed-off-by: Martin KaFai Lau commit c3f3ea8af44d0c5fba79fe8b198087342d0c7e04 Author: Richard Guy Briggs Date: Thu Aug 25 15:32:39 2022 -0400 audit: free audit_proctitle only on task exit Since audit_proctitle is generated at syscall exit time, its value is used immediately and cached for the next syscall. Since this is the case, then only clear it at task exit time. Otherwise, there is no point in caching the value OR bearing the overhead of regenerating it. Fixes: 12c5e81d3fd0 ("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 3ed66951f952ed8f1a5d03e171722bf2631e8d58 Author: Richard Guy Briggs Date: Thu Aug 25 15:32:38 2022 -0400 audit: explicitly check audit_context->context enum value Be explicit in checking the struct audit_context "context" member enum value rather than assuming the order of context enum values. Fixes: 12c5e81d3fd0 ("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 075b593f54f0f3883532cb750081cae6917bc8fe Author: Tetsuo Handa Date: Fri Aug 26 11:48:29 2022 +0900 cgroup: Use cgroup_attach_{lock,unlock}() from cgroup_attach_task_all() No behavior changes; preparing for potential locking changes in future. Signed-off-by: Tetsuo Handa Reviewed-by:Mukesh Ojha Signed-off-by: Tejun Heo commit 265efc941fbb5c4478d0466fbb2186bf6d57a9be Merge: fa7e439cf90ba 43626dade36fa Author: Tejun Heo Date: Fri Aug 26 11:13:39 2022 -1000 Merge branch 'for-6.0-fixes' into for-6.1 Pulling to receive 43626dade36f ("group: Add missing cpus_read_lock() to cgroup_attach_task_all()") for a follow-up patch. commit e84d9f5214cb854fcd584aa78b5634794604d306 Author: Richard Guy Briggs Date: Thu Aug 25 15:32:37 2022 -0400 audit: audit_context pid unused, context enum comment fix The pid member of struct audit_context is never used. Remove it. The audit_reset_context() comment about unconditionally resetting "ctx->state" should read "ctx->context". Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit fa7e439cf90ba23ea473d0b7d85efd02ae6ccf94 Author: Michal Koutný Date: Fri Aug 26 18:52:37 2022 +0200 cgroup: Homogenize cgroup_get_from_id() return value Cgroup id is user provided datum hence extend its return domain to include possible error reason (similar to cgroup_get_from_fd()). This change also fixes commit d4ccaf58a847 ("bpf: Introduce cgroup iter") that would use NULL instead of proper error handling in d4ccaf58a847 ("bpf: Introduce cgroup iter"). Additionally, neither of: fc_appid_store, bpf_iter_attach_cgroup, mem_cgroup_get_from_ino (callers of cgroup_get_from_fd) is built without CONFIG_CGROUPS (depends via CONFIG_BLK_CGROUP, direct, transitive CONFIG_MEMCG respectively) transitive, so drop the singular definition not needed with !CONFIG_CGROUPS. Fixes: d4ccaf58a847 ("bpf: Introduce cgroup iter") Signed-off-by: Michal Koutný Signed-off-by: Tejun Heo commit 4534dee941056a4ab9dca4a9e2edff28692800b2 Author: Michal Koutný Date: Fri Aug 26 18:52:36 2022 +0200 cgroup: cgroup: Honor caller's cgroup NS when resolving cgroup id Cgroup ids are resolved in the global scope. That may be needed sometime (in future) but currently it violates virtual view provided through cgroup namespaces. There are currently following users of the resolution: - fc_appid_store - bpf_iter_attach_cgroup - mem_cgroup_get_from_ino None of the is a called on behalf of kernel but the resolution is made with proper userspace context, hence the default to current->nsproxy makes sens. (This doesn't rule out cgroup_get_from_id with cgroup NS parameter in the future.) Since cgroup ids are defined on v2 hierarchy only, we simply check existence in the cgroup namespace by looking at ancestry on the default hierarchy. Fixes: 6b658c4863c1 ("scsi: cgroup: Add cgroup_get_from_id()") Signed-off-by: Michal Koutný Signed-off-by: Tejun Heo commit 74e4b956eb1cac0e4c10c240339b1bbfbc9a4c48 Author: Michal Koutný Date: Fri Aug 26 18:52:35 2022 +0200 cgroup: Honor caller's cgroup NS when resolving path cgroup_get_from_path() is not widely used function. Its callers presume the path is resolved under cgroup namespace. (There is one caller currently and resolving in init NS won't make harm (netfilter). However, future users may be subject to different effects when resolving globally.) Since, there's currently no use for the global resolution, modify the existing function to take cgroup NS into account. Fixes: a79a908fd2b0 ("cgroup: introduce cgroup namespaces") Signed-off-by: Michal Koutný Signed-off-by: Tejun Heo commit 04d1edb0ecf297eba4fe946b3b715cff4f8a6656 Author: German Gomez Date: Tue Aug 23 17:06:50 2022 +0100 coresight: etm4x: docs: Add documentation for 'ts_source' sysfs interface Sync sysfs documentation pages to include the new ts_source (timestamp source) interface. Signed-off-by: German Gomez Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220823160650.455823-3-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 0f00b223ea22f9e32a82a6ffb5a4de0753c99b55 Author: German Gomez Date: Tue Aug 23 17:06:49 2022 +0100 coresight: etm4x: Expose default timestamp source in sysfs Add a new sysfs interface in /sys/bus/coresight/devices/etm/ts_source indicating the configured timestamp source when the ETM device driver was probed. The perf tool will use this information to detect if the trace data timestamp matches the kernel time, enabling correlation of CoreSight trace with perf events. Suggested-by: Suzuki K Poulose Signed-off-by: German Gomez Reviewed-by: Leo Yan Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220823160650.455823-2-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 25bcc828d237cda65d34c736d70e4467fffb80b9 Author: Matt Roper Date: Tue Aug 23 13:24:49 2022 -0700 drm/i915/dg2: Incorporate Wa_16014892111 into DRAW_WATERMARK tuning Although register tuning settings are generally implemented via the workaround infrastructure, it turns out that the DRAW_WATERMARK register is not properly saved/restored by hardware around power events (i.e., RC6 entry) so updates to the value cannot be applied in the usual manner. New workaround Wa_16014892111 informs us that any tuning updates to this register must instead be applied via an INDIRECT_CTX batch buffer. This will ensure that the necessary value is re-applied when a context begins running, even if an RC6 entry had wiped the register back to hardware defaults since the last context ran. Fixes: 6dc85721df74 ("drm/i915/dg2: Add additional tuning settings") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6642 Signed-off-by: Matt Roper Reviewed-by: Balasubramani Vivekanandan Link: https://patchwork.freedesktop.org/patch/msgid/20220823202449.83727-1-matthew.d.roper@intel.com commit 2b96f92ca4257c05e352f61742839b451e293949 Author: Josef Johansson Date: Mon Feb 14 11:07:47 2022 +0100 PCI/MSI: Correct 'can_mask' test in msi_add_msi_desc() 71020a3c0dff4 ("PCI/MSI: Use msi_add_msi_desc()") inadvertently reversed the sense of "msi_attrib.can_mask" in one use: - if (entry->pci.msi_attrib.can_mask) { - addr = pci_msix_desc_addr(entry); - entry->pci.msix_ctrl = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL); + if (!desc.pci.msi_attrib.can_mask) { + addr = pci_msix_desc_addr(&desc); + desc.pci.msix_ctrl = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL); Restore the original test. [bhelgaas: commit log] Fixes: 71020a3c0dff4 ("PCI/MSI: Use msi_add_msi_desc()") Link: https://lore.kernel.org/r/d818f9c9-a432-213e-4152-eaff3b7da52e@oderland.se Signed-off-by: Josef Johansson Signed-off-by: Bjorn Helgaas Reviewed-by: Jason Gunthorpe commit a92438c5a30a27b6791da025306a45478a6ac7a4 Author: AngeloGioacchino Del Regno Date: Thu Aug 25 14:46:16 2022 -0400 soc: mediatek: mtk-svs: Use bitfield access macros where possible In order to enhance readability and safety during registers setup and value retrieval, redefine a few register related macros and convert all open-coded instances of bitfield setting/retrieval to use the FIELD_PREP() and FIELD_GET() macros. While at it, some macros were renamed to further enhance readability. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220825184616.2118870-3-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 43819e3853306625275f1ada7416453117a9aabf Author: AngeloGioacchino Del Regno Date: Thu Aug 25 14:46:15 2022 -0400 soc: mediatek: mtk-svs: Commonize t-calibration-data fuse array read Commonize the repeating pattern for reading the "t-calibration-data" efuse data in a new function svs_thermal_efuse_get_data(), reducing the size of this driver. No functional changes. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220825184616.2118870-2-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 1fedd6bee5509ff4d191ce0aa05595bf1955b89a Author: Tinghan Shen Date: Fri Jul 29 14:31:53 2022 +0800 dt-bindings: power: mediatek: Update maintainer list Update the maintainer list of power controller binding. Signed-off-by: Tinghan Shen Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220729063208.16799-6-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 6e464f8b6301969c992afeb52e9273ea9a478d4f Author: Tinghan Shen Date: Fri Jul 29 14:31:52 2022 +0800 dt-bindings: power: mediatek: Support naming power controller node with unit address Support naming power controller node with unit address, also compatible with node names without unit address. Signed-off-by: Tinghan Shen Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220729063208.16799-5-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 3431c92f26e7acb5a3a43f0129f4451cd460ddbe Author: Tinghan Shen Date: Fri Jul 29 14:31:51 2022 +0800 dt-bindings: power: mediatek: Refine multiple level power domain nodes Extract duplicated properties and support more levels of power domain nodes. This change fix following error when do dtbs_check, arch/arm64/boot/dts/mediatek/mt8195-evb.dtb: power-controller: power-domain@15:power-domain@16:power-domain@18: 'power-domain@19', 'power-domain@20', 'power-domain@21' do not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/power/mediatek,power-controller.yaml Signed-off-by: Tinghan Shen Reviewed-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220729063208.16799-4-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 1ebfe7e36182a658819e4ded44d38d4033c8bbfb Author: Jilin Yuan Date: Thu Aug 25 20:41:34 2022 +0800 pinctrl: nuvoton: Use 'unsigned int' instead of just 'unsigned'. 'unsigned int' should be clearer than 'unsigned'. Signed-off-by: Jilin Yuan Link: https://lore.kernel.org/r/20220825124134.30242-1-yuanjilin@cdjrlc.com Signed-off-by: Linus Walleij commit 9194e0f88a74d98f98b33183e6dda87c3753dd71 Author: Rob Herring Date: Tue Aug 23 09:56:37 2022 -0500 dt-bindings: pinctrl: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823145649.3118479-6-robh@kernel.org Signed-off-by: Linus Walleij commit ddbfc34fcf5d0bc33b006b90c580c56edeb31068 Author: Liu Song Date: Fri Aug 26 11:14:13 2022 +0800 sbitmap: remove unnecessary code in __sbitmap_queue_get_batch If "nr + nr_tags <= map_depth", then the value of nr_tags will not be greater than map_depth, so no additional comparison is required. Signed-off-by: Liu Song Link: https://lore.kernel.org/r/1661483653-27326-1-git-send-email-liusong@linux.alibaba.com Signed-off-by: Jens Axboe commit 204c0300c4e99707e9fb6e57840aa1127060e63f Author: Andreas Gruenbacher Date: Fri Aug 26 15:12:17 2022 +0200 gfs2: Switch from strlcpy to strscpy Switch from strlcpy to strscpy and make sure that @count is the size of the smaller of the source and destination buffers. This prevents reading beyond the end of the source buffer when the source string isn't null terminated. Found by a modified version of syzkaller. Suggested-by: Wolfram Sang Signed-off-by: Andreas Gruenbacher commit 76e55d938c5bfd2b28ee868fe071181cce5353ad Author: Mario Limonciello Date: Tue Aug 23 18:07:52 2022 -0500 pinctrl: amd: Pick some different unicode symbols Feedback from Kent had showed some better selections for symbols to use for pinctrl-amd debugfs output. Adopt some of those instead. Fixes: e8129a076a50 ("pinctrl: amd: Use unicode for debugfs output") Suggested-by: Kent Gibson Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220823230753.14799-1-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit bbe2a5d87602ce0ac206e9f41fca9bd76d75da11 Author: Stephen Rothwell Date: Fri Aug 26 15:26:50 2022 +1000 pinctrl: fixup for "i2c: Make remove callback return void" Fix up the build. Signed-off-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220826152650.2c55e482@canb.auug.org.au Signed-off-by: Linus Walleij commit 1681956cb79c99371024cec0b9536fbdd73d04c3 Merge: 0684bc79cd52e ed5c2f5fd10dd Author: Linus Walleij Date: Fri Aug 26 15:14:33 2022 +0200 Merge branch 'i2c/make_remove_callback_void-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into devel This branch is needed to make the i2c driver remove() callback in new driver compile properly. Signed-off-by: Linus Walleij commit 6215a7c8f55243779a44bc257af0e1b1bb928e76 Author: José Roberto de Souza Date: Wed Aug 24 06:39:35 2022 -0700 drm/i915: Add new ADL-S pci id New PCI id recently added. BSpec: 53655 Signed-off-by: José Roberto de Souza Reviewed-by: Madhumitha Tolakanahalli Pradeep Link: https://patchwork.freedesktop.org/patch/msgid/20220824133935.51560-1-jose.souza@intel.com commit 61a9fa154d217c13eea90aa5bc635bc4b1fcb66e Author: Linus Walleij Date: Thu May 5 23:50:19 2022 +0200 drm/tve200: Fix smatch warning The "ret" variable is ambiguously returning something that could be zero in the tve200_modeset_init() function, assign it an explicit error return code to make this unambiguous. Reported-by: Dan Carpenter Signed-off-by: Linus Walleij Reviewed-by: Dan Carpenter Link: https://patchwork.freedesktop.org/patch/msgid/20220505215019.2332613-1-linus.walleij@linaro.org commit 378e0f9f0b3e03a84db5ed5d3da3850871e9209e Author: Marek Vasut Date: Mon Aug 1 15:17:47 2022 +0200 drm: bridge: icn6211: Add support for external REFCLK The ICN6211 is capable of deriving its internal PLL clock from either MIPI DSI HS clock, external REFCLK clock, or even internal oscillator. Currently supported is only the first option. Add support for external REFCLK clock input in addition to that. There is little difference between these options, except that in case of MIPI DSI HS clock input, the HS clock are pre-divided by a fixed /4 divider before being fed to the PLL input, while in case of external REFCLK, the RECLK clock are fed directly into the PLL input. Per exceptionally poor documentation, the REFCLK must be in range of 10..154 MHz. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Robert Foss Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220801131747.183041-2-marex@denx.de commit a2d6447a4a8ab314a6f82ab99f218689f9b0c306 Author: Marek Vasut Date: Mon Aug 1 15:17:46 2022 +0200 dt-bindings: display: bridge: icn6211: Add support for external REFCLK The ICN6211 is capable of deriving its internal PLL clock from either MIPI DSI HS clock, external REFCLK clock, or even internal oscillator. Currently supported is only the first option. Document support for external REFCLK clock input in addition to that. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220801131747.183041-1-marex@denx.de commit 4d054ca9ad01004901f3ba988d77f7d298819c12 Author: Marek Vasut Date: Mon Aug 1 15:15:55 2022 +0200 drm: bridge: icn6211: Add and use hs_rate and lp_rate Fill in hs_rate and lp_rate to struct mipi_dsi_device for this bridge and adjust DSI input frequency calculations such that they expect the DSI host to configure HS clock according to hs_rate. This is an optimization for the DSI burst mode case. In case the DSI device supports DSI burst mode, it is recommended to operate the DSI interface at the highest possible HS clock frequency which the DSI device supports. This permits the DSI host to send as short as possible bursts of data on the DSI link and keep the DSI data lanes in LP mode otherwise, which reduces power consumption. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Robert Foss Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220801131555.182969-1-marex@denx.de commit eb7de496451bd969e203f02f66585131228ba4ae Author: Randy Dunlap Date: Mon Aug 22 17:42:43 2022 -0700 drm: fix drm_mipi_dbi build errors drm_mipi_dbi needs lots of DRM_KMS_HELPER support, so select that Kconfig symbol like it is done is most other uses, and the way that it was before MIPS_DBI was moved from tinydrm to its core location. Fixes these build errors: ld: drivers/gpu/drm/drm_mipi_dbi.o: in function `mipi_dbi_buf_copy': drivers/gpu/drm/drm_mipi_dbi.c:205: undefined reference to `drm_gem_fb_get_obj' ld: drivers/gpu/drm/drm_mipi_dbi.c:211: undefined reference to `drm_gem_fb_begin_cpu_access' ld: drivers/gpu/drm/drm_mipi_dbi.c:215: undefined reference to `drm_gem_fb_vmap' ld: drivers/gpu/drm/drm_mipi_dbi.c:222: undefined reference to `drm_fb_swab' ld: drivers/gpu/drm/drm_mipi_dbi.c:224: undefined reference to `drm_fb_memcpy' ld: drivers/gpu/drm/drm_mipi_dbi.c:227: undefined reference to `drm_fb_xrgb8888_to_rgb565' ld: drivers/gpu/drm/drm_mipi_dbi.c:235: undefined reference to `drm_gem_fb_vunmap' ld: drivers/gpu/drm/drm_mipi_dbi.c:237: undefined reference to `drm_gem_fb_end_cpu_access' ld: drivers/gpu/drm/drm_mipi_dbi.o: in function `mipi_dbi_dev_init_with_formats': ld: drivers/gpu/drm/drm_mipi_dbi.o:/X64/../drivers/gpu/drm/drm_mipi_dbi.c:469: undefined reference to `drm_gem_fb_create_with_dirty' Fixes: 174102f4de23 ("drm/tinydrm: Move mipi-dbi") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Dillon Min Cc: Linus Walleij Cc: Sam Ravnborg Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220823004243.11596-1-rdunlap@infradead.org commit 84dfc46594b0167e5d3736273b0e0e05365da641 Author: Randy Dunlap Date: Mon Aug 22 17:42:27 2022 -0700 drm/panel: use 'select' for Ili9341 panel driver helpers Use 'select' instead of 'depends on' for DRM helpers for the Ilitek ILI9341 panel driver. This is what is done in the vast majority of other cases and this makes it possible to fix a build error with drm_mipi_dbi. Fixes: 5a04227326b0 ("drm/panel: Add ilitek ili9341 panel driver") Signed-off-by: Randy Dunlap Cc: Dillon Min Cc: Linus Walleij Cc: Sam Ravnborg Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220823004227.10820-1-rdunlap@infradead.org commit f485f6d852696d4cd9a2cc1c8e3dd8dba75a3e17 Author: Linus Walleij Date: Wed Apr 13 00:03:58 2022 +0200 ARM: dts: Let Gemini NS2502 parse redboot partitions The NS2502 uses hardcoded partitions but parsing the RedBoot FIS should work fine, given that this flash seems to be using 0x200000 erase blocks. Cc: Corentin Labbe Link: https://lore.kernel.org/r/20220412220358.3674598-1-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit 95bef83078a4de295c1ae4690937623f2237b8ac Author: Corentin Labbe Date: Sat Jan 15 10:04:44 2022 +0000 ARM: dts: gemini: ssi1328: permit to use gigabit I believed that gigabit was not working due to unknown missing GPIO. But the problem was due to Marvell PHY incorrectly setting delay. Now it is fixed, gigabit works. Signed-off-by: Corentin Labbe Signed-off-by: Linus Walleij commit 61fb67dae505d71da5f17752b46aaacc3939c10f Author: Corentin Labbe Date: Sat Jan 15 10:04:43 2022 +0000 ARM: dts: gemini: ns2502: permit to use gigabit I believed that gigabit was not working due to some unknown missing GPIO. In fact, gigabit worked when REALTEK_PHY was compiled out. So the problem was due to PHY delay and we need to use rgmii-id. Signed-off-by: Corentin Labbe Signed-off-by: Linus Walleij commit c35c7b9805971c6b09180a5570088940fd90ec56 Author: Hans de Goede Date: Fri Aug 26 13:14:53 2022 +0200 platform/x86: msi-laptop: Add msi_scm_disable_hw_fn_handling() helper Add a msi_scm_disable_hw_fn_handling() to remove the duplicate code for this in the resume and init paths. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220826111453.178962-2-hdegoede@redhat.com commit 57209ddd5be6c128cc18dad73c19d1b7f7cae6c1 Author: Hans de Goede Date: Fri Aug 26 13:14:52 2022 +0200 platform/x86: msi-laptop: Add msi_scm_model_exit() helper The probe-error-exit and remove paths both duplicate the exact same code to undo load_scm_model_init(). Add a helper for this. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220826111453.178962-1-hdegoede@redhat.com commit 44387d1736c40a74085be354e2b5f37ca0689608 Author: Zhengchao Shao Date: Wed Aug 24 17:10:03 2022 +0800 net: sched: remove unnecessary init of qdisc skb head The memory allocated by using kzallloc_node and kcalloc has been cleared. Therefore, the structure members of the new qdisc are 0. So there's no need to explicitly assign a value of 0. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller commit 5523632aa10f906dfe2eb714ee748590dc7fc6b1 Author: Hans de Goede Date: Thu Aug 25 16:13:36 2022 +0200 platform/x86: msi-laptop: Fix resource cleanup Fix the input-device not getting free-ed on probe-errors and fix the msi_touchpad_dwork not getting cancelled on neither probe-errors nor on remove. Fixes: 143a4c0284dc ("msi-laptop: send out touchpad on/off key") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220825141336.208597-3-hdegoede@redhat.com commit 042184ea42e002e79ea844ffb658846c272f31bd Author: Hans de Goede Date: Thu Aug 25 16:13:35 2022 +0200 platform/x86: msi-laptop: Simplify ec_delay handling There is no reason to have both non-delayed and delayed work structs for the rfkill and touchpad work. Instead simply call schedule_delayed_work() with a delay of 0 for the quirks->ec_delay == false case. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220825141336.208597-2-hdegoede@redhat.com commit 83ac7a1c2ed5f17caa07cbbc84bad3c05dc3bf22 Author: Hans de Goede Date: Thu Aug 25 16:13:34 2022 +0200 platform/x86: msi-laptop: Fix old-ec check for backlight registering Commit 2cc6c717799f ("msi-laptop: Port to new backlight interface selection API") replaced this check: if (!quirks->old_ec_model || acpi_video_backlight_support()) pr_info("Brightness ignored, ..."); else do_register(); With: if (quirks->old_ec_model || acpi_video_get_backlight_type() == acpi_backlight_vendor) do_register(); But since the do_register() part was part of the else branch, the entire condition should be inverted. So not only the 2 statements on either side of the || should be inverted, but the || itself should be replaced with a &&. In practice this has likely not been an issue because the new-ec models (old_ec_model==false) likely all support ACPI video backlight control, making acpi_video_get_backlight_type() return acpi_backlight_video turning the second part of the || also false when old_ec_model == false. Fixes: 2cc6c717799f ("msi-laptop: Port to new backlight interface selection API") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220825141336.208597-1-hdegoede@redhat.com commit 6485f72b515690bdbebc711755af096d1dc08ce2 Author: Hans de Goede Date: Mon Aug 22 17:08:18 2022 +0200 platform/x86: msi-laptop: Drop MSI_DRIVER_VERSION Modules carrying there own version is a practice which the kernel has stopped doing for a long time now, drop it. While dropping the version pr_info from msi_init() lets remove the somewhat useless pr_info() from msi_cleanup() as well. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220822150818.45765-2-hdegoede@redhat.com commit ae030bbf7bdb253e4c9d3c53175aa018c3e9bee9 Author: Hans de Goede Date: Mon Aug 22 17:08:17 2022 +0200 platform/x86: msi-laptop: Use MODULE_DEVICE_TABLE() Use MODULE_DEVICE_TABLE() instead of manually adding a bunch of MODULE_ALIAS() statements. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220822150818.45765-1-hdegoede@redhat.com commit 4058ea22d7ce26d3d71698768e636274d08e9ccd Author: Arvid Norlander Date: Sun Aug 21 22:08:21 2022 +0200 platform/x86: toshiba_acpi: Fix ECO LED control on Toshiba Z830 The toshiba_acpi driver checks for TOS_INPUT_DATA_ERROR and tries a different format. On the Z830 the error returned is TOS_NOT_SUPPORTED though the different format still works. Allow either error. Signed-off-by: Arvid Norlander Link: https://lore.kernel.org/r/20220821200821.1837460-2-lkml@vorpal.se Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 643952f3ecace9e20b8a0c5cd1bbd7409ac2d02c Merge: 76d7df9406a1d 4ffb4d25ef125 Author: David S. Miller Date: Fri Aug 26 11:56:55 2022 +0100 Merge tag 'wireless-next-2022-08-26-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Johannes berg says: ==================== Various updates: * rtw88: operation, locking, warning, and code style fixes * rtw89: small updates * cfg80211/mac80211: more EHT/MLO (802.11be, WiFi 7) work * brcmfmac: a couple of fixes * misc cleanups etc. ==================== Signed-off-by: David S. Miller commit 23657a437ea2fbccc715fce2dac74e3c923540cf Author: Mario Limonciello Date: Fri Aug 19 13:01:00 2022 -0500 platform/x86: thinkpad_acpi: Explicitly set to balanced mode on startup It was observed that on a Thinkpad T14 Gen1 (AMD) that the platform profile is starting up in 'low-power' mode after refreshing what the firmware had. This is most likely a firmware bug, but as a harmless workaround set the default profile to 'balanced' at thinkpad_acpi startup. Reported-by: madcatx@atlas.cz Link: https://bugzilla.kernel.org/show_bug.cgi?id=216347 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220819180101.6383-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a9a98d49da52c5bf63cd8bbc1f33b52edec2e9c9 Author: Robert Elliott Date: Sat Aug 20 13:41:51 2022 -0500 crypto: Kconfig - simplify compression/RNG entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit cf514b2a5902ee4f93e9636ace5228fed27f23bb Author: Robert Elliott Date: Sat Aug 20 13:41:50 2022 -0500 crypto: Kconfig - simplify cipher entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 9bc517155f41fbe387a4602e1860ab1ae0eae638 Author: Robert Elliott Date: Sat Aug 20 13:41:49 2022 -0500 crypto: Kconfig - simplify userspace entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 3f342a23257df99b792c1edb1236e85badc157de Author: Robert Elliott Date: Sat Aug 20 13:41:48 2022 -0500 crypto: Kconfig - simplify hash entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit e3d2eadd06b39b69fbbc27de8e3ac2db022e8616 Author: Robert Elliott Date: Sat Aug 20 13:41:47 2022 -0500 crypto: Kconfig - simplify aead entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit ec84348da449d96ce5be47f7d00221cb8374f462 Author: Robert Elliott Date: Sat Aug 20 13:41:46 2022 -0500 crypto: Kconfig - simplify CRC entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 05b374652737706557d0360064b07cfbeccb93d2 Author: Robert Elliott Date: Sat Aug 20 13:41:45 2022 -0500 crypto: Kconfig - simplify public-key entries Shorten menu titles and make them consistent: - acronym - name - architecture features in parenthesis - no suffixes like " algorithm", "support", or "hardware acceleration", or "optimized" Simplify help text descriptions, update references, and ensure that https references are still valid. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit f1f142ad434883616c313bc93b9f443d496293db Author: Robert Elliott Date: Sat Aug 20 13:41:44 2022 -0500 crypto: Kconfig - add submenus Convert each comment section into a submenu: Cryptographic API Crypto core or helper Public-key cryptography Block ciphers Length-preserving ciphers and modes AEAD (authenticated encryption with associated data) ciphers Hashes, digests, and MACs CRCs (cyclic redundancy checks) Compression Random number generation Userspace interface That helps find entries (e.g., searching for a name like SHA512 doesn't just report the location is Main menu -> Cryptography API, leaving you to wade through 153 entries; it points you to the Digests page). Move entries so they fall into the correct submenus and are better sorted. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 4a95d4ae98b1610ce1b1df2a36e8955c3f46623e Author: Robert Elliott Date: Sat Aug 20 13:41:43 2022 -0500 crypto: Kconfig - sort the arm entries Sort the arm entries so all like entries are together. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 9e5647eb06529de4058c25e681fc36d00465927f Author: Robert Elliott Date: Sat Aug 20 13:41:42 2022 -0500 crypto: Kconfig - sort the arm64 entries Sort the arm64 entries so all like entries are together. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 4a329fecc9aaebb27a53fa7abfa53bbc2ee42f3f Author: Robert Elliott Date: Sat Aug 20 13:41:41 2022 -0500 crypto: Kconfig - submenus for arm and arm64 Move ARM- and ARM64-accelerated menus into a submenu under the Crypto API menu (paralleling all the architectures). Make each submenu always appear if the corresponding architecture is supported. Get rid of the ARM_CRYPTO and ARM64_CRYPTO symbols. The "ARM Accelerated" or "ARM64 Accelerated" entry disappears from: General setup ---> Platform selection ---> Kernel Features ---> Boot options ---> Power management options ---> CPU Power Management ---> [*] ACPI (Advanced Configuration and Power Interface) Support ---> [*] Virtualization ---> [*] ARM Accelerated Cryptographic Algorithms ---> (or) [*] ARM64 Accelerated Cryptographic Algorithms ---> ... -*- Cryptographic API ---> Library routines ---> Kernel hacking ---> and moves into the Cryptographic API menu, which now contains: ... Accelerated Cryptographic Algorithms for CPU (arm) ---> (or) Accelerated Cryptographic Algorithms for CPU (arm64) ---> [*] Hardware crypto devices ---> ... Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 5530acc8b9bfcfa5f90909b940be39a84c350033 Author: Robert Elliott Date: Sat Aug 20 13:41:40 2022 -0500 crypto: Kconfig - remove AES_ARM64 ref by SA2UL Remove the CRYPTO_AES_ARM64 selection by the TI security accelerator driver (SA2UL), which leads to this problem when running make allmodconfig for arm (32-bit): WARNING: unmet direct dependencies detected for CRYPTO_AES_ARM64 Depends on [n]: CRYPTO [=y] && ARM64 Selected by [m]: - CRYPTO_DEV_SA2UL [=m] && CRYPTO [=y] && CRYPTO_HW [=y] && (ARCH_K3 || COMPILE_TEST [=y]) Fixes: 7694b6ca649fe ("crypto: sa2ul - Add crypto driver") Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 28a936ef44e12b4d2b38f45ff767262763b60a20 Author: Robert Elliott Date: Sat Aug 20 13:41:39 2022 -0500 crypto: Kconfig - move x86 entries to a submenu Move CPU-specific crypto/Kconfig entries to arch/xxx/crypto/Kconfig and create a submenu for them under the Crypto API menu. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 0e9f9ea6e21f7e0b2a25abf01140315e36e95d1d Author: Robert Elliott Date: Sat Aug 20 13:41:38 2022 -0500 crypto: Kconfig - move sparc entries to a submenu Move CPU-specific crypto/Kconfig entries to arch/xxx/crypto/Kconfig and create a submenu for them under the Crypto API menu. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit c9d24c97c89c1ba9b2d4ff8b721443d7471f87b6 Author: Robert Elliott Date: Sat Aug 20 13:41:37 2022 -0500 crypto: Kconfig - move s390 entries to a submenu Move CPU-specific crypto/Kconfig entries to arch/xxx/crypto/Kconfig and create a submenu for them under the Crypto API menu. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 6a490a4e8b4c015113045d045dc1ae94735211bb Author: Robert Elliott Date: Sat Aug 20 13:41:36 2022 -0500 crypto: Kconfig - move powerpc entries to a submenu Move CPU-specific crypto/Kconfig entries to arch/xxx/crypto/Kconfig and create a submenu for them under the Crypto API menu. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit e45f710b42afd7e67276234853d2de19faf46362 Author: Robert Elliott Date: Sat Aug 20 13:41:35 2022 -0500 crypto: Kconfig - move mips entries to a submenu Move CPU-specific crypto/Kconfig entries to arch/xxx/crypto/Kconfig and create a submenu for them under the Crypto API menu. Suggested-by: Eric Biggers Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit d03e89b3eba46121e8cbf2753b02be407810991b Author: Kai Ye Date: Fri Aug 19 07:46:18 2022 +0000 crypto: hisilicon/qm - no judgment in the back process Judgment should not be added in the back process. So clean it. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 9b32fed8d6715207a0a2cd42f48a147d203a7576 Author: Jack Wang Date: Fri Aug 19 08:07:54 2022 +0200 crypto: ccree - Fix dma_map_sg error check dma_map_sg return 0 on error, and dma_map_error is not supposed to use here. Cc: Gilad Ben-Yossef Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 2b02187bdb0bb75000850bd0309e70eb8664159e Author: Jack Wang Date: Fri Aug 19 08:07:53 2022 +0200 crypto: allwinner - Fix dma_map_sg error check dma_map_sg return 0 on error. Cc: Corentin Labbe Cc: Herbert Xu Cc: "David S. Miller" Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: Dan Carpenter Cc: Minghao Chi Cc: Peng Wu Cc: Alexey Khoroshilov Cc: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@lists.linux.dev Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Herbert Xu commit 45fa321e7de604146603e24ee5bf3c0b766efe46 Author: Jack Wang Date: Fri Aug 19 08:07:52 2022 +0200 crypto: amlogic - Fix dma_map_sg error check dma_map_sg return 0 on error. Cc: Corentin Labbe Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: linux-amlogic@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Herbert Xu commit 417f62f6402c985dde661c6b09734fddb33d9b1a Author: Jack Wang Date: Fri Aug 19 08:07:51 2022 +0200 crypto: qce - Fix dma_map_sg error check dma_map_sg return 0 on error, fix the error check and return -EIO to caller. Cc: Thara Gopinath Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Herbert Xu commit 66f0b6b7d839b49e19a856a90b70656dccc4b844 Author: Jack Wang Date: Fri Aug 19 08:07:50 2022 +0200 crypto: sahara - Fix error check for dma_map_sg dma_map_sg return 0 on error, it returns the number of DMA address segments mapped (this may be shorter than passed in if some elements of the scatter/gather list are physically or virtually adjacent and an IOMMU maps them with a single entry). Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Signed-off-by: Herbert Xu commit 545665ad1e84eb8f047018a2f607e78cef29c7fa Author: Jack Wang Date: Fri Aug 19 08:07:49 2022 +0200 crypto: gemini - Fix error check for dma_map_sg dma_map_sg return 0 on error. Cc: Corentin Labbe Cc: Hans Ulli Kroll Cc: Linus Walleij Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Reviewed-by: Linus Walleij Signed-off-by: Herbert Xu commit 28855860057ac0d51607a0b1386cb6c2cd1ad0d4 Author: Wolfram Sang Date: Thu Aug 18 23:00:03 2022 +0200 crypto: drivers - move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit dd4f8ee7ed95e01c3e81870b7552799a06b7c7b6 Author: Wolfram Sang Date: Thu Aug 18 22:59:54 2022 +0200 crypto: core - move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Herbert Xu commit 62f58b1637b7c8df34afaa548cb4b03d31c0764b Author: Neal Liu Date: Thu Aug 18 11:59:56 2022 +0800 crypto: aspeed - add HACE crypto driver Add HACE crypto driver to support symmetric-key encryption and decryption with multiple modes of operation. Signed-off-by: Neal Liu Signed-off-by: Johnny Huang Reviewed-by: Dhananjay Phadke Signed-off-by: Herbert Xu commit c3708e6562694872e34c2aa41b6c949e98ee5945 Author: Neal Liu Date: Thu Aug 18 11:59:55 2022 +0800 dt-bindings: crypto: add documentation for aspeed hace Add device tree binding documentation for the Aspeed Hash and Crypto Engines (HACE) Controller. Signed-off-by: Neal Liu Signed-off-by: Johnny Huang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit a1a2990e6fea186bf0d3e7fada8645a1a85bd12a Author: Neal Liu Date: Thu Aug 18 11:59:54 2022 +0800 ARM: dts: aspeed: Add HACE device controller node Add hace node to device tree for AST2500/AST2600. Signed-off-by: Neal Liu Signed-off-by: Johnny Huang Reviewed-by: Dhananjay Phadke Signed-off-by: Herbert Xu commit dffc3c566be3da314fdc98432dd166abb35aee03 Author: Neal Liu Date: Thu Aug 18 11:59:53 2022 +0800 dt-bindings: clock: Add AST2500/AST2600 HACE reset definition Add HACE reset bit definition for AST2500/AST2600. Signed-off-by: Neal Liu Signed-off-by: Johnny Huang Acked-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 108713a713c7e4b7d07e6cd9b808503d5bb7089b Author: Neal Liu Date: Thu Aug 18 11:59:52 2022 +0800 crypto: aspeed - Add HACE hash driver Hash and Crypto Engine (HACE) is designed to accelerate the throughput of hash data digest, encryption, and decryption. Basically, HACE can be divided into two independently engines - Hash Engine and Crypto Engine. This patch aims to add HACE hash engine driver for hash accelerator. Signed-off-by: Neal Liu Signed-off-by: Johnny Huang Reviewed-by: Dhananjay Phadke Signed-off-by: Herbert Xu commit efb4b01c1c993d245e6608076684ff2162cf9dc6 Author: Jacky Li Date: Tue Aug 16 19:32:09 2022 +0000 crypto: ccp - Fail the PSP initialization when writing psp data file failed Currently the OS continues the PSP initialization when there is a write failure to the init_ex_file. Therefore, the userspace would be told that SEV is properly INIT'd even though the psp data file is not updated. This is problematic because later when asked for the SEV data, the OS won't be able to provide it. Fixes: 3d725965f836 ("crypto: ccp - Add SEV_INIT_EX support") Reported-by: Peter Gonda Reported-by: kernel test robot Signed-off-by: Jacky Li Acked-by: David Rientjes Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit d8da2da21fdb1f5964c11c00f0cc84fb0edf31d0 Author: Jacky Li Date: Tue Aug 16 19:32:08 2022 +0000 crypto: ccp - Initialize PSP when reading psp data file failed Currently the OS fails the PSP initialization when the file specified at 'init_ex_path' does not exist or has invalid content. However the SEV spec just requires users to allocate 32KB of 0xFF in the file, which can be taken care of by the OS easily. To improve the robustness during the PSP init, leverage the retry mechanism and continue the init process: Before the first INIT_EX call, if the content is invalid or missing, continue the process by feeding those contents into PSP instead of aborting. PSP will then override it with 32KB 0xFF and return SEV_RET_SECURE_DATA_INVALID status code. In the second INIT_EX call, this 32KB 0xFF content will then be fed and PSP will write the valid data to the file. In order to do this, sev_read_init_ex_file should only be called once for the first INIT_EX call. Calling it again for the second INIT_EX call will cause the invalid file content overwriting the valid 32KB 0xFF data provided by PSP in the first INIT_EX call. Co-developed-by: Peter Gonda Signed-off-by: Peter Gonda Signed-off-by: Jacky Li Reported-by: Alper Gun Acked-by: David Rientjes Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit d5eb916d889f12f27275e2049b9c4df43b7cfa13 Author: Martin Kaiser Date: Mon Aug 15 21:37:43 2022 +0200 hwrng: imx-rngc - use devres for hwrng registration Replace hwrng_register with devm_hwrng_register and let devres unregister our hwrng when the device is removed. It's possible to do this now that devres also handles clock disable+uprepare. When we had to disable+unprepare the clock ourselves, we had to unregister the hwrng before this and couldn't use devres. There's nothing left to do for imx_rngc_remove, this function can go. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 6a2bc448423cea44e7dba0f72d7c82ae04ab201e Author: Martin Kaiser Date: Mon Aug 15 21:37:42 2022 +0200 hwrng: imx-rngc - use devm_clk_get_enabled Use the new devm_clk_get_enabled function to get our clock. We don't have to disable and unprepare the clock ourselves any more in error paths and in the remove function. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 6363d81b78c00d98f6d92b04acf65b4a18013690 Author: Robert Elliott Date: Sun Aug 14 23:29:15 2022 -0500 crypto: tcrypt - remove mode=1000 The lists of algothms checked for existence by modprobe tcrypt mode=1000 generates three bogus errors: modprobe tcrypt mode=1000 console log: tcrypt: alg rot13 not found tcrypt: alg cts not found tcrypt: alg arc4 not found rot13 is not an algorithm in the crypto API or tested. cts is a wrapper, not a base algorithm. arc4 is named ecb(arc4), not arc4. Also, the list is missing numerous algorithms that are tested by other test modes: blake2b-512 blake2s-256 crct10dif xxhash64 ghash cast5 sm4 ansi_prng Several of the algorithms are only available if CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE is enabled: arc4 khazad seed tea, xtea, xeta Rather that fix that list, remove test mode=1000 entirely. It seems to have limited utility, and a web search shows no discussion of anybody using it. Suggested-by: Ard Biesheuvel Signed-off-by: Robert Elliott Reviewed-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 50100770742873455446b642ca8d2ab9d7599750 Merge: 47d35bf22b691 874b301985ef2 Author: Herbert Xu Date: Fri Aug 26 18:45:27 2022 +0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Merge crypto tree to pick up backport of XOR_BLOCKS Kconfig fix. commit 76d7df9406a1d2faec6eaaa1d835a1dbc1d49cec Author: Jean-Francois Le Fillatre Date: Wed Aug 24 21:14:36 2022 +0200 r8152: add PID for the Lenovo OneLink+ Dock The Lenovo OneLink+ Dock contains an RTL8153 controller that behaves as a broken CDC device by default. Add the custom Lenovo PID to the r8152 driver to support it properly. Also, systems compatible with this dock provide a BIOS option to enable MAC address passthrough (as per Lenovo document "ThinkPad Docking Solutions 2017"). Add the custom PID to the MAC passthrough list too. Tested on a ThinkPad 13 1st gen with the expected results: passthrough disabled: Invalid header when reading pass-thru MAC addr passthrough enabled: Using pass-thru MAC addr XX:XX:XX:XX:XX:XX Signed-off-by: Jean-Francois Le Fillatre Signed-off-by: David S. Miller commit 77baa37a9be948562c8b7630e3afd9d497e14550 Merge: d73ffc08824d9 f8c74ca6d31c8 Author: David S. Miller Date: Fri Aug 26 11:39:00 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-08-24 (ice) This series contains updates to ice driver only. Marcin adds support for TC parsing on TTL and ToS fields. Anatolli adds support for devlink port split command to allow configuration of various port configurations. Jake allows for passing and writing an additional NVM write activate field by expanding current cmd_flag. Ani makes PHY debug output more readable. ==================== Signed-off-by: David S. Miller commit 4ffb4d25ef1251d57881da183d6bec7f2dfe1e32 Author: Ping-Ke Shih Date: Mon Aug 15 14:20:04 2022 +0800 wifi: rtw88: fix uninitialized use of primary channel index clang reports uninitialized use: >> drivers/net/wireless/realtek/rtw88/main.c:731:2: warning: variable 'primary_channel_idx' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized use occurs here hal->current_primary_channel_index = primary_channel_idx; ^~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw88/main.c:687:24: note: initialize the variable 'primary_channel_idx' to silence this warning u8 primary_channel_idx; ^ = '\0' This situation could not happen, because possible channel bandwidth 20/40/80MHz are enumerated. Fixes: 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters") Reported-by: kernel test robot Signed-off-by: Ping-Ke Shih Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220815062004.22920-1-pkshih@realtek.com Signed-off-by: Johannes Berg commit d73ffc08824d9deca451e1845d72fa50bf17d5ae Author: Qingfang DENG Date: Wed Aug 24 14:10:34 2022 +0800 net: phylink: allow RGMII/RTBI in-band status As per RGMII specification v2.0, section 3.4.1, RGMII/RTBI has an optional in-band status feature where the PHY's link status, speed and duplex mode can be passed to the MAC. Allow RGMII/RTBI to use in-band status. Signed-off-by: Qingfang DENG Signed-off-by: David S. Miller commit 9c9ac2e659e1b009d16a1f43d8ca26abcf17e0bb Author: Wolfram Sang Date: Thu Aug 18 23:00:57 2022 +0200 platform/x86: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: Andy Shevchenko Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20220818210058.7229-1-wsa+renesas@sang-engineering.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8c61eafd22d7207039bff85c6e1d386f15abd17e Author: Borislav Petkov Date: Thu Aug 25 09:51:57 2022 +0200 x86/microcode: Remove ->request_microcode_user() 181b6f40e9ea ("x86/microcode: Rip out the OLD_INTERFACE") removed the old microcode loading interface but forgot to remove the related ->request_microcode_user() functionality which it uses. Rip it out now too. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220825075445.28171-1-bp@alien8.de commit 8028d5d481ebed904388e7248deea1f3620511eb Author: PaddyKP_Yao Date: Thu Aug 25 08:43:05 2022 +0800 platform/x86: asus-wmi: Fix the name of the mic-mute LED classdev According to well-known-leds.txt, we should use "platform::micmute" instead of "asus::micmute" for the name of the mic-mute LED classdev. Signed-off-by: PaddyKP_Yao Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220825004305.709539-1-PaddyKP_Yao@asus.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 61f64515299e5f4885093656087ec1c0df8109c5 Author: Luke D. Jones Date: Fri Aug 26 11:22:51 2022 +1200 platform/x86: asus-wmi: Implement TUF laptop keyboard power states Adds support for setting various power states of TUF keyboards. These states are combinations of: - boot, set if a boot animation is shown on keyboard - awake, set if the keyboard LEDs are visible while laptop is on - sleep, set if an animation is displayed while the laptop is suspended - keyboard (unknown effect) Adds two sysfs attributes to asus::kbd_backlight: - kbd_rgb_state - kbd_rgb_state_index Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220825232251.345893-3-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e305a71cea37a64c7558b8b979f6f08f657d0c3d Author: Luke D. Jones Date: Fri Aug 26 11:22:50 2022 +1200 platform/x86: asus-wmi: Implement TUF laptop keyboard LED modes Adds support for changing the laptop keyboard LED mode and colour. The modes are visible effects such as static, rainbow, pulsing, colour cycles. These sysfs attributes are added to asus::kbd_backlight: - kbd_rgb_mode - kbd_rgb_mode_index Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220825232251.345893-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 12ff4c803d23218f9afea9f82019a5c9619f6744 Author: Luke D. Jones Date: Fri Aug 26 12:42:10 2022 +1200 platform/x86: asus-wmi: Support the GPU fan on TUF laptops Add support for TUF laptops which have the ability to control the GPU fan. This will show as a second fan in hwmon, and has the ability to run as boost (fullspeed), or auto. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220826004210.356534-3-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 601eb4c8e1500285d1c40eacb1e2da19bf220e12 Author: Luke D. Jones Date: Fri Aug 26 12:42:09 2022 +1200 platform/x86: asus-wmi: Modify behaviour of Fn+F5 fan key Some more recent TUF laptops have both fan_boost and thermal_throttle. The key code for Fn+F5 is also different and unmapped. This patch adjusts the asus_wmi_handle_event_code() match to match for both 0x99 and 0xAE, and run both mode switch functions for fan_boost and/or thermal_throttle if either are available. It is required that both are tried, as in some instances the ACPI set-method for one may not have any code body within it even though it was returned as supported by the get method. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220826004210.356534-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 98a2aea68873db440770153b4e87d0e1e6dd7a90 Author: Hans de Goede Date: Fri Aug 26 11:29:21 2022 +0200 platform/x86: asus-wmi: Update tablet_mode_sw module-param help text Document how to select asus_wmi_lid_flip_rog_devid as tablet_switch_mode by adding "3:lid-flip-rog" to the tablet_mode_sw module-param help text. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220826092921.8907-1-hdegoede@redhat.com commit 5b3b51a181fdf0387d931a6cedab30921147e576 Merge: 6661918c3b59d 44af95718fed5 Author: David S. Miller Date: Fri Aug 26 10:04:55 2022 +0100 Merge branch 'prestera-matchall' Maksym Glubokiy says: ==================== net: prestera: matchall features This patch series extracts matchall rules management out of SPAN API implementation and adds 2 features on top of that: - support for egress traffic (mirred egress action) - proper rule priorities management between matchall and flower ==================== Signed-off-by: David S. Miller commit 44af95718fed5f24a0036b3e270dbc854005beee Author: Maksym Glubokiy Date: Tue Aug 23 14:39:58 2022 +0300 net: prestera: manage matchall and flower priorities matchall rules can be added only to chain 0 and their priorities have limitations: - new matchall ingress rule's priority must be higher (lower value) than any existing flower rule; - new matchall egress rule's priority must be lower (higher value) than any existing flower rule. The opposite works for flower rule adding: - new flower ingress rule's priority must be lower (higher value) than any existing matchall rule; - new flower egress rule's priority must be higher (lower value) than any existing matchall rule. This is a hardware limitation and thus must be properly handled in driver by reporting errors to the user when newly added rule has such a priority that cannot be installed into the hardware. To achieve this, the driver must maintain both min/max matchall priorities for every flower block when user adds/deletes a matchall rule, as well as both min/max flower priorities for chain 0 for every adding/deletion of flower rules for chain 0. Cc: Serhiy Boiko Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit 8c448c2b5fd223d1a694cae1a185aeb9093d1c3c Author: Serhiy Boiko Date: Tue Aug 23 14:39:57 2022 +0300 net: prestera: add support for egress traffic mirroring This enables adding matchall rules for egress: tc filter add .. egress .. matchall skip_sw \ action mirred egress mirror dev .. Signed-off-by: Serhiy Boiko Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit 8afd552db4631a31cbdb628c59ffc66772822251 Author: Serhiy Boiko Date: Tue Aug 23 14:39:56 2022 +0300 net: prestera: acl: extract matchall logic into a separate file This commit adds more clarity to handling of TC_CLSMATCHALL_REPLACE and TC_CLSMATCHALL_DESTROY events by calling newly added *_mall_*() handlers instead of directly calling SPAN API. This also extracts matchall rules management out of SPAN API since SPAN is a hardware module which is used to implement 'matchall egress mirred' action only. Signed-off-by: Taras Chornyi Signed-off-by: Serhiy Boiko Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit 6661918c3b59df69fd20b31316345856ed75314d Author: Oleksij Rempel Date: Mon Aug 22 14:39:43 2022 +0200 net: asix: ax88772: add ethtool pause configuration Add phylink based ethtool pause configuration Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e0bffe3e689415ddd926c7f207e4186c8d355ed8 Author: Oleksij Rempel Date: Mon Aug 22 14:39:42 2022 +0200 net: asix: ax88772: migrate to phylink There are some exotic ax88772 based devices which may require functionality provide by the phylink framework. For example: - US100A20SFP, USB 2.0 auf LWL Converter with SFP Cage - AX88772B USB to 100Base-TX Ethernet (with RMII) demo board, where it is possible to switch between internal PHY and external RMII based connection. So, convert this driver to phylink as soon as possible. Tested with: - AX88772A + internal PHY - AX88772B + external DP83TD510E T1L PHY Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller commit be50baa40e90a18c3750b31a49be64929488d84b Author: Xin Gao Date: Wed Aug 17 02:10:40 2022 +0800 wifi: mac80211: use full 'unsigned int' type The full 'unsigned int' is better than 'unsigned'. Signed-off-by: Xin Gao Link: https://lore.kernel.org/r/20220816181040.9044-1-gaoxin@cdjrlc.com [fix indentation] Signed-off-by: Johannes Berg commit 28b904ec486b59297a92e34b1e92837907d0f529 Author: Wolfram Sang Date: Thu Aug 18 23:02:23 2022 +0200 wifi: mac80211: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Johannes Berg commit 83888346c57a422591004a715877bc5745978b6c Author: Ryder Lee Date: Fri Aug 26 06:33:16 2022 +0800 wifi: mac80211: read ethtool's sta_stats from sinfo Driver may update sinfo directly through .sta_statistics, so this patch makes sure that ethool gets the correct statistics. Signed-off-by: Ryder Lee Link: https://lore.kernel.org/r/f9edff14dd7f5205acf1c21bae8e9d8f9802dd88.1661466499.git.ryder.lee@mediatek.com Signed-off-by: Johannes Berg commit abd27d063c2e85e45ffc4390247abf47e5b55997 Author: Johannes Berg Date: Thu Aug 25 20:57:32 2022 +0200 wifi: mac80211: correct SMPS mode in HE 6 GHz capability If we add 6 GHz capability in MLO, we cannot use the SMPS mode from the deflink. Pass it separately instead since on a second link we don't even have a link data struct yet. Signed-off-by: Johannes Berg commit b183db8f4783ca2efc9b47734f15aad9477a108a Author: Ville Syrjälä Date: Fri Jun 17 22:59:48 2022 +0300 drm/i915: Skip wm/ddb readout for disabled pipes The stuff programmed into the wm/ddb registers of planes on disabled pipes doesn't matter. So during readout just leave our software state tracking for those zeroed. This should avoid us trying too hard to clean up after whatever mess the VBIOS/GOP left in there. The actual hardware state will get cleaned up if/when we enable the pipe anyway. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5711 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220617195948.24007-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 057062adb49b6ae9760e5615f23e6a7f557e7fa6 Author: Rob Herring Date: Thu Aug 25 14:26:07 2022 -0500 dt-bindings: net: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Add missing properties/$refs as exposed by this addition. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220825192609.1538463-1-robh@kernel.org Signed-off-by: Jakub Kicinski commit 343949e10798a52c6d6a14effc962e010ed471ae Author: Benjamin Tissoires Date: Wed Aug 24 15:40:37 2022 +0200 libbpf: add map_get_fd_by_id and map_delete_elem in light skeleton This allows to have a better control over maps from the kernel when preloading eBPF programs. Acked-by: Yonghong Song Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220824134055.1328882-8-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit b88df6979682333815536a0bf43bd56f9499f071 Author: Benjamin Tissoires Date: Wed Aug 24 15:40:36 2022 +0200 bpf: prepare for more bpf syscall to be used from kernel and user space. Add BPF_MAP_GET_FD_BY_ID and BPF_MAP_DELETE_PROG. Only BPF_MAP_GET_FD_BY_ID needs to be amended to be able to access the bpf pointer either from the userspace or the kernel. Acked-by: Yonghong Song Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220824134055.1328882-7-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit fd20b60aea6a37788f2f761af405b41c6c34473b Author: Wolfram Sang Date: Wed Aug 24 10:21:29 2022 +0200 powerpc/82xx: remove spidev node from mgcoge Commit 956b200a846e ("spi: spidev: Warn loudly if instantiated from DT as "spidev"") states that there should not be spidev nodes in DTs. Remove this non-HW description. There won't be a regression because it won't bind since 2015 anyhow. Fixes: 5d1d67e361ea ("powerpc/82xx: add SPI support for mgcoge") Signed-off-by: Wolfram Sang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220824082130.21934-3-wsa+renesas@sang-engineering.com commit 0b9e534fcbf0a45e2ba08467de08a848a99ba2d6 Author: Joel Stanley Date: Thu Aug 4 11:27:08 2022 +0930 powerpc/microwatt: Add LiteX MMC driver Enable the LiteX MMC device and it's dependency the common clock framework. Signed-off-by: Joel Stanley Acked-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220804015708.5928-1-joel@jms.id.au commit 98acee3f8db451eaab9fbd422e523c228aacf08c Author: Nicholas Miehlbradt Date: Wed Aug 17 15:06:40 2022 +1000 selftests/powerpc: Add a test for execute-only memory This selftest is designed to cover execute-only protections on the Radix MMU but will also work with Hash. The tests are based on those found in pkey_exec_test with modifications to use the generic mprotect() instead of the pkey variants. Signed-off-by: Nicholas Miehlbradt Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220817050640.406017-2-ruscur@russell.cc commit 395cac7752b905318ae454a8b859d4c190485510 Author: Russell Currey Date: Wed Aug 17 15:06:39 2022 +1000 powerpc/mm: Support execute-only memory on the Radix MMU Add support for execute-only memory (XOM) for the Radix MMU by using an execute-only mapping, as opposed to the RX mapping used by powerpc's other MMUs. The Hash MMU already supports XOM through the execute-only pkey, which is a separate mechanism shared with x86. A PROT_EXEC-only mapping will map to RX, and then the pkey will be applied on top of it. mmap() and mprotect() consumers in userspace should observe the same behaviour on Hash and Radix despite the differences in implementation. Replacing the vma_is_accessible() check in access_error() with a read check should be functionally equivalent for non-Radix MMUs, since it follows write and execute checks. For Radix, the change enables detecting faults on execute-only mappings where vma_is_accessible() would return true. Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220817050640.406017-1-ruscur@russell.cc commit 4c14d7a3fa097c4ccb6323dd8f0f7746bfebb053 Author: Wolfram Sang Date: Thu Aug 18 23:00:26 2022 +0200 macintosh: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lore.kernel.org/r/20220818210026.6940-1-wsa+renesas@sang-engineering.com commit 14be375634c3f8ff750bdce0c10036c2fbfcb282 Author: Wolfram Sang Date: Thu Aug 18 22:59:46 2022 +0200 powerpc: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lore.kernel.org/r/20220818205946.6336-1-wsa+renesas@sang-engineering.com commit f7d5f00702e2da656b2a8f975fdaa0d48329de36 Author: Christophe Leroy Date: Fri Aug 19 16:26:49 2022 +0200 powerpc/fsl_booke: Make calc_cam_sz() static calc_cam_sz() is used only in fsl_book3e.c, make it static. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a7469848371b2cf5e8f654ec79800e209d88595e.1660919200.git.christophe.leroy@csgroup.eu commit e38cd72c17fa7d7710088365251feb6c52b501c8 Author: Christophe Leroy Date: Fri Aug 19 16:23:43 2022 +0200 powerpc: Remove stale declarations in mmu_decl.h rtas_size and rtas_data are not used anymore since at least commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization use it.") Remove them. Since commit 4b74a35fc7e9 ("powerpc/32s: Make Hash var static") the forward declaration of struct hash_pte is unneeded. Remove it. __initial_memory_limit_addr was removed by commit e63075a3c937 ("memblock: Introduce default allocation limit and use it to replace explicit ones") Remove the declaration. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a821e8397dd56b8177ecc04966d3b3a7c4bda6d4.1660919016.git.christophe.leroy@csgroup.eu commit 9e1b45fdf25caed521d6851136a0e3213c676656 Author: Michael Ellerman Date: Wed Aug 3 16:32:28 2022 +1000 powerpc: Update ISA versions to mention e5500/e6500 Add the NXP (nee Freescale) e5500 and e6500 to the ISA versions documentation. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220803063228.1250030-1-mpe@ellerman.id.au commit eb316ae798b36b280ef9e6a79d3aa34d146aa0e4 Author: Michael Ellerman Date: Thu Aug 18 15:06:59 2022 +1000 powerpc: Move patch sites out of asm-prototypes.h The definitions for the patch sites etc. don't belong in asm-prototypes.h, they are not EXPORT'ed asm symbols. Move them into sections.h which is traditionally used for asm symbols. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220818050659.187181-1-mpe@ellerman.id.au commit 7a26c952902d1f29b09237b1698a30084f6a3074 Author: Michael Ellerman Date: Fri Aug 19 21:05:56 2022 +1000 powerpc/boot: Drop unused dummy.c The last use of dummy.c was dropped in commit 2bf118197cb4 ("[POWERPC] Create a "wrapper" script and use it in arch/powerpc/boot"). Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220819110556.434970-1-mpe@ellerman.id.au commit e01432baf6618296f4d2d557e6b4c3245a5cc3c2 Author: Michael Ellerman Date: Fri Aug 19 21:04:30 2022 +1000 powerpc/boot: Convert more files to use SPDX tags These files are all plain GPL 2.0, with a second sentence about being licensed as-is. Similar to the rule in commit 577b61cee5b2 ("treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_398.RULE"). Signed-off-by: Michael Ellerman Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220819110430.433984-1-mpe@ellerman.id.au commit 2c2d7a67defa198a8b8148dbaddc9e5554efebc8 Merge: 1c23f9e627a7b 5ece208ab05e4 Author: Dave Airlie Date: Fri Aug 26 10:01:44 2022 +1000 Merge tag 'drm-intel-gt-next-2022-08-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - Create gt/gtN/.defaults/ for per gt sysfs defaults Create a gt/gtN/.defaults/ directory (similar to engine//.defaults/) to expose default parameter values for each gt in sysfs. This allows userspace to restore default parameter values after they have changed. Driver Changes: - Support GuC v69 in parallel to v70 (Daniele) - Improve TLB invalidation to limit performance regression (Chris, Mauro) - Expose per-gt RPS defaults in sysfs (Ashutosh) - Suppress OOM warning for shmemfs object allocation failure (Chris, Nirmoy) - Disable PCI resize on 32-bit machines (Nirmoy) - Update DG2 to GuC v70.4.1 (John) - Fix CCS data copying on DG2 during swapping (Matt A) - Add DG2 performance tuning setting recommended by spec (Matt R) - Add GuC <-> kernel time stamp translation information to error logs (John) - Record GuC CTB info in error logs (John) - Route semaphores to GuC for Gen12+ when enabled (Michal Wi, John) - Improve resilency to bug #3575: Handle reset timeouts under unrelated kernel hangs (Chris, Ashutosh) - Avoid system freeze by removing shared locking on freeing objects (Chris, Nirmoy) - Demote GuC error "No response for request" into debug when expected (Zhanjun) - Fix GuC capture size warning and bump the size (John) - Use streaming loads to speed up dumping the GuC log (Chris, John) - Don't abort on CTB_UNUSED status from GuC (John) - Don't send spurious policy update for GuC child contexts (Daniele) - Don't leak the CCS state (Matt A) - Prefer drm_err over pr_err (John) - Eliminate unused calc_ctrl_surf_instr_size (Matt A) - Add dedicated function for non-ctx register tuning settings (Matt R) - Style and typo fixes, documentation improvements (Jason Wang, Mauro) - Selftest improvements (Matt B, Rahul, John) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YwYTCjA/Rhpd1n4A@jlahtine-mobl.ger.corp.intel.com commit 82c75dca6f95c9ac4649031a493456156ddfec2f Author: Heinrich Schuchardt Date: Fri Aug 12 22:08:53 2022 +0200 riscv: enable CD-ROM file systems in defconfig CD-ROM images are still commonly used for installer images and other data exchange. These file systems should be supported on RISC-V by default like they are on x86_64. Signed-off-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20220812200853.311474-1-heinrich.schuchardt@canonical.com Signed-off-by: Palmer Dabbelt commit 9d3feb63339520462583a4c7ee5130046ab515ad Author: ye xingchen Date: Thu Aug 25 07:23:35 2022 +0000 drm/mediatek: Remove the unneeded result Return the value drm_mode_config_helper_suspend() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Reviewed-by: Matthias Brugger Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220825072335.228921-1-ye.xingchen@zte.com.cn/ Signed-off-by: Chun-Kuang Hu commit d4ffb6f39f1a1b260966b43a4ffdb64779c650dd Author: Hao Luo Date: Thu Aug 25 15:39:36 2022 -0700 bpf: Add CGROUP prefix to cgroup_iter_order bpf_cgroup_iter_order is globally visible but the entries do not have CGROUP prefix. As requested by Andrii, put a CGROUP in the names in bpf_cgroup_iter_order. This patch fixes two previous commits: one introduced the API and the other uses the API in bpf selftest (that is, the selftest cgroup_hierarchical_stats). I tested this patch via the following command: test_progs -t cgroup,iter,btf_dump Fixes: d4ccaf58a847 ("bpf: Introduce cgroup iter") Fixes: 88886309d2e8 ("selftests/bpf: add a selftest for cgroup hierarchical stats collection") Suggested-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220825223936.1865810-1-haoluo@google.com Signed-off-by: Martin KaFai Lau commit b828854871f6851c75a5b19f1cd967bf4e7c85dd Author: Zhengping Jiang Date: Tue Aug 23 10:28:08 2022 -0700 Bluetooth: hci_sync: hold hdev->lock when cleanup hci_conn When disconnecting all devices, hci_conn_failed is used to cleanup hci_conn object when the hci_conn object cannot be aborted. The function hci_conn_failed requires the caller holds hdev->lock. Fixes: 9b3628d79b46f ("Bluetooth: hci_sync: Cleanup hci_conn if it cannot be aborted") Signed-off-by: Zhengping Jiang Signed-off-by: Luiz Augusto von Dentz commit a112ff247a8c1e9352c8b23081da7a8f2aedeae7 Author: Wolfram Sang Date: Thu Aug 18 23:02:07 2022 +0200 Bluetooth: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Luiz Augusto von Dentz commit 5356266552bbaaddb8d6b4b53450e290be2cd717 Author: Archie Pusaka Date: Tue Aug 23 12:39:22 2022 +0800 Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt To prevent multiple conn complete events, we shouldn't look up the conn with hci_lookup_le_connect, since it requires the state to be BT_CONNECT. By the time the duplicate event is processed, the state might have changed, so we end up processing the new event anyway. Change the lookup function to hci_conn_hash_lookup_ba. Fixes: d5ebaa7c5f6f6 ("Bluetooth: hci_event: Ignore multiple conn complete events") Signed-off-by: Archie Pusaka Reviewed-by: Sonny Sasaka Signed-off-by: Luiz Augusto von Dentz commit b5e1acea065fa1339f4049c2bd9782889dc68368 Author: Luiz Augusto von Dentz Date: Thu Aug 18 14:31:42 2022 -0700 Bluetooth: ISO: Fix not handling shutdown condition In order to properly handle shutdown syscall the code shall not assume that the how argument is always SHUT_RDWR resulting in SHUTDOWN_MASK as that would result in poll to immediately report EPOLLHUP instead of properly waiting for disconnect_cfm (Disconnect Complete) which is rather important for the likes of BAP as the CIG may need to be reprogrammed. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Luiz Augusto von Dentz commit 029bde79fb7969dcd9a4b2940efc06e9404a9df1 Author: Tetsuo Handa Date: Wed Aug 17 20:14:36 2022 +0900 Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor() syzbot is reporting double kfree() at remove_adv_monitor() [1], for commit 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv Monitor") forgot to remove duplicated mgmt_pending_remove() when merging "if (err) {" path and "if (!pending) {" path. Link: https://syzkaller.appspot.com/bug?extid=915a8416bf15895b8e07 [1] Reported-by: syzbot Fixes: 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Signed-off-by: Tetsuo Handa Signed-off-by: Luiz Augusto von Dentz commit 529d4492aed7c005206383b84c38d515c31c1585 Author: Luiz Augusto von Dentz Date: Mon Aug 15 16:14:32 2022 -0700 Bluetooth: MGMT: Fix Get Device Flags Get Device Flags don't check if device does actually use an RPA in which case it shall only set HCI_CONN_FLAG_REMOTE_WAKEUP if LL Privacy is enabled. Signed-off-by: Luiz Augusto von Dentz commit fc5ae5b44eb26db973a6d4cfa0f75fe0650a95c6 Author: Luiz Augusto von Dentz Date: Fri Aug 12 15:33:57 2022 -0700 Bluetooth: L2CAP: Fix build errors in some archs This attempts to fix the follow errors: In function 'memcmp', inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9, inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2003:15: ./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread] 44 | #define __underlying_memcmp __builtin_memcmp | ^ ./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp' 420 | return __underlying_memcmp(p, q, size); | ^~~~~~~~~~~~~~~~~~~ In function 'memcmp', inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9, inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2004:15: ./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread] 44 | #define __underlying_memcmp __builtin_memcmp | ^ ./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp' 420 | return __underlying_memcmp(p, q, size); | ^~~~~~~~~~~~~~~~~~~ Fixes: 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression") Signed-off-by: Luiz Augusto von Dentz commit 123f6d3ae773f769695830518690ac3e4a477e82 Author: Luiz Augusto von Dentz Date: Thu Aug 11 14:20:46 2022 -0700 Bluetooth: hci_sync: Fix suspend performance regression This attempts to fix suspend performance when there is no connections by not updating the event mask. Fixes: ef61b6ea1544 ("Bluetooth: Always set event mask on suspend") Signed-off-by: Luiz Augusto von Dentz commit afcb3369f46ed5dc883a7b92f2dd1e264d79d388 Author: Hans de Goede Date: Sun Aug 7 22:57:40 2022 +0200 Bluetooth: hci_event: Fix vendor (unknown) opcode status handling Commit c8992cffbe74 ("Bluetooth: hci_event: Use of a function table to handle Command Complete") was (presumably) meant to only refactor things without any functional changes. But it does have one undesirable side-effect, before *status would always be set to skb->data[0] and it might be overridden by some of the opcode specific handling. While now it always set by the opcode specific handlers. This means that if the opcode is not known *status does not get set any more at all! This behavior change has broken bluetooth support for BCM4343A0 HCIs, the hci_bcm.c code tries to configure UART attached HCIs at a higher baudraute using vendor specific opcodes. The BCM4343A0 does not support this and this used to simply fail: [ 25.646442] Bluetooth: hci0: BCM: failed to write clock (-56) [ 25.646481] Bluetooth: hci0: Failed to set baudrate After which things would continue with the initial baudraute. But now that hci_cmd_complete_evt() no longer sets status for unknown opcodes *status is left at 0. This causes the hci_bcm.c code to think the baudraute has been changed on the HCI side and to also adjust the UART baudrate, after which communication with the HCI is broken, leading to: [ 28.579042] Bluetooth: hci0: command 0x0c03 tx timeout [ 36.961601] Bluetooth: hci0: BCM: Reset failed (-110) And non working bluetooth. Fix this by restoring the previous default "*status = skb->data[0]" handling for unknown opcodes. Fixes: c8992cffbe74 ("Bluetooth: hci_event: Use of a function table to handle Command Complete") Signed-off-by: Hans de Goede Signed-off-by: Luiz Augusto von Dentz commit 651cd3d65b0f76a2198fcf3a80ce5d53dd267717 Author: Brian Gix Date: Fri Aug 5 16:42:35 2022 -0700 Bluetooth: convert hci_update_adv_data to hci_sync hci_update_adv_data() is called from hci_event and hci_core due to events from the controller. The prior function used the deprecated hci_request method, and the new one uses hci_sync.c Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 3fe318ee72c54506534f51b4b4dfb19e0e0df2db Author: Brian Gix Date: Fri Aug 5 16:42:34 2022 -0700 Bluetooth: move hci_get_random_address() to hci_sync This function has no dependencies on the deprecated hci_request mechanism, so has been moved unchanged to hci_sync.c Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit dd50a864ffaece5b75621a84ae8d6e3483ce6732 Author: Brian Gix Date: Fri Aug 5 16:42:33 2022 -0700 Bluetooth: Delete unreferenced hci_request code This patch deletes a whole bunch of code no longer reached because the functionality was recoded using hci_sync.c Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit c249ea9b4309cf3250c5bbb42a05d38d0ed9071c Author: Brian Gix Date: Fri Aug 5 16:42:32 2022 -0700 Bluetooth: Move Adv Instance timer to hci_sync The Advertising Instance expiration timer adv_instance_expire was handled with the deprecated hci_request mechanism, rather than it's replacement: hci_sync. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit fd0fcdf33d8af535aff596b57390acf8a209708e Author: Maíra Canal Date: Fri Aug 12 17:57:43 2022 -0300 drm/mediatek: Drop of_gpio header These drivers include the deprecated OF GPIO header yet fail to use symbols from it, so drop the include. Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: linux-mediatek@lists.infradead.org Signed-off-by: Maíra Canal Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220812205746.609107-3-mairacanal@riseup.net/ Signed-off-by: Chun-Kuang Hu commit e07a06b4eb417f5271d33ce2240e93c62d98b7b4 Author: Brian Gix Date: Fri Aug 5 16:42:31 2022 -0700 Bluetooth: Convert SCO configure_datapath to hci_sync Recoding HCI cmds to offload SCO codec to use hci_sync mechanism rather than deprecated hci_request mechanism. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 9e63767dd58a388ca1c000058f0bf84abf154b48 Author: Brian Gix Date: Fri Aug 5 16:42:30 2022 -0700 Bluetooth: Delete unused hci_req_stop_discovery() hci_req_stop_discovery has been deprecated in favor of hci_stop_discovery_sync() as part of transition to hci_sync.c Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 27d54b778ad1fb32c2c108cfe97e861c3909a46f Author: Brian Gix Date: Fri Aug 5 16:42:29 2022 -0700 Bluetooth: Rework le_scan_restart for hci_sync le_scan_restart delayed work queue was running as a deprecated hci_request instead of on the newer thread-safe hci_sync mechanism. Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 8ffde2a73f2cd2906a1bff2d315ad32154c425a3 Author: Brian Gix Date: Fri Aug 5 16:42:28 2022 -0700 Bluetooth: Convert le_scan_disable timeout to hci_sync The le_scan_disable timeout was being performed on the deprecated hci_request.c mechanism. This timeout is performed in hci_sync.c Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 7ac7267fad5908476b357e7e9813d23516c2b0a1 Author: Fae Date: Sun Jul 24 13:25:02 2022 -0500 Bluetooth: Add VID/PID 0489/e0e0 for MediaTek MT7921 Tested on HP Envy ey0xxx output from /sys/kernel/debug/usb/devices: T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0e0 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) 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=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Signed-off-by: Fae Signed-off-by: Luiz Augusto von Dentz commit 880b0dd94f0399cf772a8582e7b5a47f180c8618 Merge: b9030780971b5 4c612826bec14 Author: Jakub Kicinski Date: Thu Aug 25 16:07:42 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/mellanox/mlx5/core/en_fs.c 21234e3a84c7 ("net/mlx5e: Fix use after free in mlx5e_fs_init()") c7eafc5ed068 ("net/mlx5e: Convert ethtool_steering member of flow_steering struct to pointer") https://lore.kernel.org/all/20220825104410.67d4709c@canb.auug.org.au/ https://lore.kernel.org/all/20220823055533.334471-1-saeed@kernel.org/ Signed-off-by: Jakub Kicinski commit 6127b3bcd33299cdebb79ffcc9c9ca135eaf763e Author: Juston Li Date: Thu Aug 18 17:42:05 2022 +0000 drm/i915/pxp: don't start pxp without mei_pxp bind pxp will not start correctly until after mei_pxp bind completes and intel_pxp_init_hw() is called. Wait for the bind to complete before proceeding with startup. This fixes a race condition during bootup where we observed a small window for pxp commands to be sent, starting pxp before mei_pxp bind completed. Changes since v2: - wait for pxp_component to bind instead of returning -EAGAIN (Daniele) Changes since v1: - check pxp_component instead of pxp_component_added (Daniele) - pxp_component needs tee_mutex (Daniele) - return -EAGAIN so caller knows to retry (Daniele) Signed-off-by: Juston Li Reviewed-by: Andrzej Hajda Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220818174205.2412730-1-justonli@chromium.org commit 066de3b9d93b6564e2f68005484d8c0597620748 Author: Damien Le Moal Date: Mon Jul 25 10:01:27 2022 +0900 ata: libata-core: Simplify ata_build_rw_tf() Since ata_build_rw_tf() is only called from ata_scsi_rw_xlat() with the tf, dev and tag arguments obtained from the queued command structure, we can simplify the interface of ata_build_rw_tf() by passing directly the qc structure as argument. Furthermore, since ata_scsi_rw_xlat() is never used for internal commands, we can also remove the internal tag check for the NCQ case. Signed-off-by: Damien Le Moal commit e00923c59e68b63c998a0fef4145b5279331968a Author: Damien Le Moal Date: Thu Jun 9 12:33:13 2022 +0900 ata: libata: Rename ATA_DFLAG_NCQ_PRIO_ENABLE Rename ATA_DFLAG_NCQ_PRIO_ENABLE to ATA_DFLAG_NCQ_PRIO_ENABLED to match the fact that this flags indicates if NCQ priority use is enabled by the user. Signed-off-by: Damien Le Moal commit 614065aba7041fab831e7c69ca8c7adebbc0430c Author: Jinpeng Cui Date: Tue Aug 23 12:29:14 2022 +0000 ata: libata-core: remove redundant err_mask variable Return value from ata_exec_internal() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Signed-off-by: Damien Le Moal commit fee6073051c394dbec21d7024d90e31e0ff3f678 Author: Rafael J. Wysocki Date: Thu Aug 25 20:47:28 2022 +0200 ata: ahci: Do not check ACPI_FADT_LOW_POWER_S0 The ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space). For this reason, there is no benefit from checking that flag in ahci_update_initial_lpm_policy(). First off, it cannot be a bug to do S3 with policy set to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER, because S3 can be used on systems with ACPI_FADT_LOW_POWER_S0 set and it must work if really supported, so the ACPI_FADT_LOW_POWER_S0 check is not needed to protect the S3-capable systems from failing. Second, suspend-to-idle can be carried out on a system with ACPI_FADT_LOW_POWER_S0 unset and it is expected to work, so if setting policy to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER is needed to handle that case correctly, it should be done regardless of the ACPI_FADT_LOW_POWER_S0 value. Accordingly, replace the ACPI_FADT_LOW_POWER_S0 check in ahci_update_initial_lpm_policy() with pm_suspend_default_s2idle() which is more general and also takes the user's preference into account and drop the CONFIG_ACPI #ifdef around it that is not necessary any more. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mario Limonciello Signed-off-by: Damien Le Moal commit f02c7d5a8fa3ecf7a20f25815bb30a967fa18885 Author: José Roberto de Souza Date: Thu Aug 18 16:42:00 2022 -0700 drm/i915/display/mtl: Extend MBUS programming Display version 14 also supports MBUS joining just like ADL-P and also it does not need MBUS initialization, so extending ADL-P code paths to display version 14 and higher. Bspec: 49213 Reviewed-by: Matt Roper Signed-off-by: José Roberto de Souza Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-20-radhakrishna.sripada@intel.com commit 3d46edeec211bcaf006bdd40aa73d2c4d3a4753d Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:59 2022 -0700 drm/i915/mtl: Reuse adl-p DBUF calculations Meteorlake uses a similar DBUF calculations as ADL-P. Reuse the call flow for meteorlake. Bspec: 49255 Original Author: Caz Yokoyama Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-19-radhakrishna.sripada@intel.com commit 3eb4ad9325f1f959dbdf443176818ae3aa934aac Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:57 2022 -0700 drm/i915/mtl: Update memory bandwidth parameters Like ADL_P, Meteorlake has different memory characteristics from past platforms. Update the values used by our memory bandwidth calculations accordingly. Bspec: 64631 Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-17-radhakrishna.sripada@intel.com commit c41aa0204d1c05edadc42e50fdba62784f5841bd Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:55 2022 -0700 drm/i915/mtl: memory latency data from LATENCY_LPX_LPY for WM Since Xe LPD+, Memory latency data are in LATENCY_LPX_LPY registers instead of GT driver mailbox. v2: Use the extracted wm latency adjustment function(Matt) v3: Use Odd/even for Latency fields(MattR) Bspec: 64608 Cc: Matt Roper Original Author: Caz Yokoyama Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/<20220818234202.451742-15-radhakrishna.sripada@intel.com> commit a2b4cefafa26e6e4dc550366b2caa87a916c179a Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:54 2022 -0700 drm/i915: Extract wm latency adjustment to its own function Watermark latency is adjusted in cases when latency is 0us for level greater than 1, the subsequent levels are disabled. Extract this logic into its own function. v2: Pass dev_priv to the extracted function(MattR) Suggested-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-14-radhakrishna.sripada@intel.com commit 3930624c3936b8358bd8944fd8b00505c6519a0a Author: Samuel Holland Date: Fri Aug 12 03:00:49 2022 -0500 clk: sunxi-ng: d1: Limit PLL rates to stable ranges Set the min/max rates for audio and video PLLs to keep them from going outside their documented stable ranges. Use the most restrictive of the "stable" and "actual" frequencies listed in the manual. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220812080050.59850-1-samuel@sholland.org commit b9030780971b56c0c455c3b66244efd96608846d Author: Uros Bizjak Date: Mon Aug 22 16:32:43 2022 +0200 netdev: Use try_cmpxchg in napi_if_scheduled_mark_missed Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in napi_if_scheduled_mark_missed. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Uros Bizjak Link: https://lore.kernel.org/r/20220822143243.2798-1-ubizjak@gmail.com Signed-off-by: Jakub Kicinski commit 2c58a91495e67e1002ce3d71830bbbc618044b31 Merge: bace3f46e6e48 12be3edfa827b Author: Jakub Kicinski Date: Thu Aug 25 13:24:47 2022 -0700 Merge branch 'mlxsw-remove-some-unused-code' Petr Machata says: ==================== mlxsw: Remove some unused code This patchset removes code that is not used anymore after the following two commits removed all users: - commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC support") - commit 9b43fbb8ce24 ("mlxsw: Remove Mellanox SwitchIB ASIC support") ==================== Link: https://lore.kernel.org/r/cover.1661350629.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 12be3edfa827b12fc543e620350a089d73db9a68 Author: Jiri Pirko Date: Wed Aug 24 17:18:51 2022 +0200 mlxsw: Remove unused mlxsw_core_port_type_get() Function mlxsw_core_port_type_get() is no longer used. So remove it. Signed-off-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 04a1b674d655119ed6a42fe534f24632c793d4f7 Author: Jiri Pirko Date: Wed Aug 24 17:18:50 2022 +0200 mlxsw: Remove unused port_type_set devlink op port_type_set devlink op is no longer used by any mlxsw driver, so remove it. Signed-off-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 3471ac9b22c18aeae8d1c3ff6d32d10a861931f3 Author: Jiri Pirko Date: Wed Aug 24 17:18:49 2022 +0200 mlxsw: Remove unused IB stuff There are some IB leftovers that are no longer used in the code. So remove them. Signed-off-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit bace3f46e6e48ae19cbc0a430bf648bde8f29ea4 Merge: 88e500affe72f f94b606325c19 Author: Jakub Kicinski Date: Thu Aug 25 13:22:58 2022 -0700 Merge branch 'net-devlink-sync-flash-and-dev-info-commands' Jiri Pirko says: ==================== net: devlink: sync flash and dev info commands Purpose of this patchset is to introduce consistency between two devlink commands: devlink dev info Shows versions of running default flash target and components. devlink dev flash Flashes default flash target or component name (if specified on cmdline). Currently it is up to the driver what versions to expose and what flash update component names to accept. This is inconsistent. Thankfully, only netdevsim currently using components so it is still time to sanitize this. This patchset makes sure, that devlink.c calls into driver for component flash update only in case the driver exposes the same version name. Example: $ devlink dev info netdevsim/netdevsim10: driver netdevsim versions: running: fw.mgmt 10.20.30 stored: fw.mgmt 10.20.30 $ devlink dev flash netdevsim/netdevsim10 file somefile.bin [fw.mgmt] Preparing to flash [fw.mgmt] Flashing 100% [fw.mgmt] Flash select [fw.mgmt] Flashing done $ devlink dev flash netdevsim/netdevsim10 file somefile.bin component fw.mgmt [fw.mgmt] Preparing to flash [fw.mgmt] Flashing 100% [fw.mgmt] Flash select [fw.mgmt] Flashing done $ devlink dev flash netdevsim/netdevsim10 file somefile.bin component dummy Error: selected component is not supported by this device. ==================== Link: https://lore.kernel.org/r/20220824122011.1204330-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit f94b606325c194adadaee2265b4db990802c4850 Author: Jiri Pirko Date: Wed Aug 24 14:20:11 2022 +0200 net: devlink: limit flash component name to match version returned by info_get() Limit the acceptance of component name passed to cmd_flash_update() to match one of the versions returned by info_get(), marked by version type. This makes things clearer and enforces 1:1 mapping between exposed version and accepted flash component. Check VERSION_TYPE_COMPONENT version type during cmd_flash_update() execution by calling info_get() with different "req" context. That causes info_get() to lookup the component name instead of filling-up the netlink message. Remove "UPDATE_COMPONENT" flag which becomes used. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 0c1989754f76b52bd30581ff543890cab8c75a9d Author: Jiri Pirko Date: Wed Aug 24 14:20:10 2022 +0200 netdevsim: add version fw.mgmt info info_get() and mark as a component Fix the only component user which is netdevsim. It uses component named "fw.mgmt" in selftests. So add this version to info_get() output with version type component. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit bb67012331f7f07ff325877fbbb430bc515d371e Author: Jiri Pirko Date: Wed Aug 24 14:20:09 2022 +0200 net: devlink: extend info_get() version put to indicate a flash component Whenever the driver is called by his info_get() op, it may put multiple version names and values to the netlink message. Extend by additional helper devlink_info_version_running/stored_put_ext() that allows to specify a version type that indicates when particular version name represents a flash component. This is going to be used in follow-up patch calling info_get() during flash update command checking if version with this the version type exists. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 88e500affe72fb704c4f201974b5199ca6f51e6c Author: Adel Abouchaev Date: Wed Aug 24 11:43:51 2022 -0700 selftests/net: fix reinitialization of TEST_PROGS in net self tests. Assinging will drop all previous tests. Fixes: b690842d12fd ("selftests/net: test l2 tunnel TOS/TTL inheriting") Signed-off-by: Adel Abouchaev Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220824184351.3759862-1-adel.abushaev@gmail.com Signed-off-by: Jakub Kicinski commit b737da13e763e595458d736d42c08853b4ab82b7 Author: Rob Herring Date: Tue Aug 23 09:56:43 2022 -0500 dt-bindings: display: adi,adv75xx: Add missing graph schema references DT bindings using the graph binding must have references to the graph binding schema. These are missing from the adi,adv7511 and adi,adv7533 bindings, so add them. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220823145649.3118479-12-robh@kernel.org commit 0e1fa5155a364de7d3de770eb382980933376699 Author: Russell Currey Date: Sat Aug 6 18:53:01 2022 +1000 MAINTAINERS: Add Mahesh J Salgaonkar as EEH maintainer Update EEH entry: - Russell: lacks time to maintain EEH. - Oliver: lacks time & hardware to do actual maintenance, but happy to field questions and review things. - Mahesh: glad to take over EEH maintenance. [bhelgaas: commit log, add Mahesh, make Oliver reviewer] Link: https://lore.kernel.org/r/20220806085301.25142-1-ruscur@russell.cc Signed-off-by: Russell Currey Signed-off-by: Bjorn Helgaas Acked-by: Michael Ellerman commit dc35583ba9eccf2052c1eb26a0893399a79a5916 Author: Clint Taylor Date: Thu Aug 18 16:41:53 2022 -0700 drm/i915/mtl: Fix rawclk for Meteorlake PCH MTL has a fixed rawclk of 38400Khz. Register does not need to be reprogrammed. Bspec: 49304 Reviewed-by: Matt Roper Signed-off-by: Clint Taylor Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-13-radhakrishna.sripada@intel.com commit 61c86578229d2f0a71296663027bd774002f1506 Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:50 2022 -0700 drm/i915/mtl: Add support for MTL in Display Init sequences The initialization sequence for Meteorlake reuses the sequence for icelake for most parts. Some changes viz. reset PICA handshake are added. Bspec: 49189 Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-10-radhakrishna.sripada@intel.com commit 612dc414458ff439d90a6c491fa5d064a6412713 Author: Imre Deak Date: Thu Aug 18 16:41:49 2022 -0700 drm/i915/mtl: Add VBT port and AUX_CH mapping Add the proper VBT port,AUX_CH -> i915 port,AUX_CH mapping which just follows the ADL_P one. Reviewed-by: Matt Roper Signed-off-by: Imre Deak Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-9-radhakrishna.sripada@intel.com commit b078c16bde6d7eac1eac4be0dff07e3b77fe4cdf Author: Radhakrishna Sripada Date: Thu Aug 18 16:41:47 2022 -0700 drm/i915/mtl: Add PCH support Add support for Meteorpoint(MTP) PCH used with Meteorlake. Cc: Matt Roper Reviewed-by: Anusha Srivatsa Signed-off-by: Clint Taylor Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-7-radhakrishna.sripada@intel.com commit dd3cb467ebb5659d6552999d6f16a616653f9933 Author: Andrew Lunn Date: Thu Aug 25 04:04:27 2022 +0200 dt-bindings: Remove 'Device Tree Bindings' from end of title: As indicated in link: https://lore.kernel.org/all/20220822204945.GA808626-robh@kernel.org/ DT schema files should not have 'Device Tree Binding' as part of there title: line. Remove this in most .yaml files, so hopefully preventing developers copying it into new .yaml files, and being asked to remove it. Signed-off-by: Andrew Lunn Link: https://lore.kernel.org/r/20220825020427.3460650-1-andrew@lunn.ch Signed-off-by: Rob Herring commit 59f9072f6e48e21d7c40fb0ca75d99f5f68abc04 Author: Frank Rowand Date: Tue Aug 23 15:01:52 2022 -0500 of: unittest: taint the kernel when of unittest runs Make OF unittest trigger the new TAINT_TEST taint when OF unittest runs. Due to OF unittest not being intended to run on production systems, and potentially causing problems (or security issues like leaking kernel addresses), the kernel's state should not be considered safe for production use after OF unittest runs. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20220823200152.3465751-1-frowand.list@gmail.com Signed-off-by: Rob Herring commit 0a0d55ef3e61d9f14e803cacb644fcc890f16774 Author: Eyal Birger Date: Wed Aug 24 21:10:43 2022 +0300 bpf/scripts: Assert helper enum value is aligned with comment order The helper value is ABI as defined by enum bpf_func_id. As bpf_helper_defs.h is used for the userpace part, it must be consistent with this enum. Before this change the comments order was used by the bpf_doc script in order to set the helper values defined in the helpers file. When adding new helpers it is very puzzling when the userspace application breaks in weird places if the comment is inserted instead of appended - because the generated helper ABI is incorrect and shifted. This commit sets the helper value to the enum value. In addition it is currently the practice to have the comments appended and kept in the same order as the enum. As such, add an assertion validating the comment order is consistent with enum value. In case a different comments ordering is desired, this assertion can be lifted. Signed-off-by: Eyal Birger Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220824181043.1601429-1-eyal.birger@gmail.com commit 7184aef9c0f7a81db8fd18d183ee42481d89bf35 Author: Lam Thai Date: Wed Aug 24 15:59:00 2022 -0700 bpftool: Fix a wrong type cast in btf_dumper_int When `data` points to a boolean value, casting it to `int *` is problematic and could lead to a wrong value being passed to `jsonw_bool`. Change the cast to `bool *` instead. Fixes: b12d6ec09730 ("bpf: btf: add btf print functionality") Signed-off-by: Lam Thai Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220824225859.9038-1-lamthai@arista.com commit eef3c3d3373641b01c65af630d5e003cbabe6abe Merge: 7e165d1939284 88886309d2e82 Author: Alexei Starovoitov Date: Thu Aug 25 11:35:38 2022 -0700 Merge branch 'bpf: rstat: cgroup hierarchical' Hao Luo says: ==================== This patch series allows for using bpf to collect hierarchical cgroup stats efficiently by integrating with the rstat framework. The rstat framework provides an efficient way to collect cgroup stats percpu and propagate them through the cgroup hierarchy. The stats are exposed to userspace in textual form by reading files in bpffs, similar to cgroupfs stats by using a cgroup_iter program. cgroup_iter is a type of bpf_iter. It walks over cgroups in four modes: - walking a cgroup's descendants in pre-order. - walking a cgroup's descendants in post-order. - walking a cgroup's ancestors. - process only a single object. When attaching cgroup_iter, one needs to set a cgroup to the iter_link created from attaching. This cgroup can be passed either as a file descriptor or a cgroup id. That cgroup serves as the starting point of the walk. One can also terminate the walk early by returning 1 from the iter program. Note that because walking cgroup hierarchy holds cgroup_mutex, the iter program is called with cgroup_mutex held. ** Background on rstat for stats collection ** (I am using a subscriber analogy that is not commonly used) The rstat framework maintains a tree of cgroups that have updates and which cpus have updates. A subscriber to the rstat framework maintains their own stats. The framework is used to tell the subscriber when and what to flush, for the most efficient stats propagation. The workflow is as follows: - When a subscriber updates a cgroup on a cpu, it informs the rstat framework by calling cgroup_rstat_updated(cgrp, cpu). - When a subscriber wants to read some stats for a cgroup, it asks the rstat framework to initiate a stats flush (propagation) by calling cgroup_rstat_flush(cgrp). - When the rstat framework initiates a flush, it makes callbacks to subscribers to aggregate stats on cpus that have updates, and propagate updates to their parent. Currently, the main subscribers to the rstat framework are cgroup subsystems (e.g. memory, block). This patch series allow bpf programs to become subscribers as well. Patches in this series are organized as follows: * Patches 1-2 introduce cgroup_iter prog, and a selftest. * Patches 3-5 allow bpf programs to integrate with rstat by adding the necessary hook points and kfunc. A comprehensive selftest that demonstrates the entire workflow for using bpf and rstat to efficiently collect and output cgroup stats is added. --- Changelog: v8 -> v9: - Make UNSPEC (an invalid option) as the default order for cgroup_iter. - Use enum for specifying cgroup_iter order, instead of u32. - Add BPF_ITER_RESHCED to cgroup_iter. - Add cgroup_hierarchical_stats to s390x denylist. v7 -> v8: - Removed the confusing BPF_ITER_DEFAULT (Andrii) - s/SELF/SELF_ONLY/g - Fixed typo (e.g. outputing) (Andrii) - Use "descendants_pre", "descendants_post" etc. instead of "pre", "post" (Andrii) v6 -> v7: - Updated commit/comments in cgroup_iter for read() behavior (Yonghong) - Extracted BPF_ITER_SELF and other options out of cgroup_iter, so that they can be used in other iters. Also renamed them. (Andrii) - Supports both cgroup_fd and cgroup_id when specifying target cgroup. (Andrii) - Avoided using macro for formatting expected output in cgroup_iter selftest. (Andrii) - Applied 'static' on all vars and functions in cgroup_iter selftest. (Andrii) - Fixed broken buf reading in cgroup_iter selftest. (Andrii) - Switched to use bpf_link__destroy() unconditionally. (Andrii) - Removed 'volatile' for non-const global vars in selftests. (Andrii) - Started using bpf_core_enum_value() to get memory_cgrp_id. (Andrii) v5 -> v6: - Rebased on bpf-next - Tidy up cgroup_hierarchical_stats test (Andrii) * 'static' and 'inline' * avoid using libbpf_get_error() * string literals of cgroup paths. - Rename patch 8/8 to 'selftests/bpf' (Yonghong) - Fix cgroup_iter comments (e.g. PAGE_SIZE and uapi) (Yonghong) - Make sure further read() returns OK after previous read() finished properly (Yonghong) - Release cgroup_mutex before the last call of show() (Kumar) v4 -> v5: - Rebased on top of new kfunc flags infrastructure, updated patch 1 and patch 6 accordingly. - Added docs for sleepable kfuncs. v3 -> v4: - cgroup_iter: * reorder fields in bpf_link_info to avoid break uapi (Yonghong) * comment the behavior when cgroup_fd=0 (Yonghong) * comment on the limit of number of cgroups supported by cgroup_iter. (Yonghong) - cgroup_hierarchical_stats selftest: * Do not return -1 if stats are not found (causes overflow in userspace). * Check if child process failed to join cgroup. * Make buf and path arrays in get_cgroup_vmscan_delay() static. * Increase the test map sizes to accomodate cgroups that are not created by the test. v2 -> v3: - cgroup_iter: * Added conditional compilation of cgroup_iter.c in kernel/bpf/Makefile (kernel test) and dropped the !CONFIG_CGROUP patch. * Added validation of traversal_order when attaching (Yonghong). * Fixed previous wording "two modes" to "three modes" (Yonghong). * Fixed the btf_dump selftest broken by this patch (Yonghong). * Fixed ctx_arg_info[0] to use "PTR_TO_BTF_ID_OR_NULL" instead of "PTR_TO_BTF_ID", because the "cgroup" pointer passed to iter prog can be null. - Use __diag_push to eliminate __weak noinline warning in bpf_rstat_flush(). - cgroup_hierarchical_stats selftest: * Added write_cgroup_file_parent() helper. * Added error handling for failed map updates. * Added null check for cgroup in vmscan_flush. * Fixed the signature of vmscan_[start/end]. * Correctly return error code when attaching trace programs fail. * Make sure all links are destroyed correctly and not leaking in cgroup_hierarchical_stats selftest. * Use memory.reclaim instead of memory.high as a more reliable way to invoke reclaim. * Eliminated sleeps, the test now runs faster. v1 -> v2: - Redesign of cgroup_iter from v1, based on Alexei's idea [1]: * supports walking cgroup subtree. * supports walking ancestors of a cgroup. (Andrii) * supports terminating the walk early. * uses fd instead of cgroup_id as parameter for iter_link. Using fd is a convention in bpf. * gets cgroup's ref at attach time and deref at detach. * brought back cgroup1 support for cgroup_iter. - Squashed the patches adding the rstat flush hook points and kfuncs (Tejun). - Added a comment explaining why bpf_rstat_flush() needs to be weak (Tejun). - Updated the final selftest with the new cgroup_iter design. - Changed CHECKs in the selftest with ASSERTs (Yonghong, Andrii). - Removed empty line at the end of the selftest (Yonghong). - Renamed test files to cgroup_hierarchical_stats.c. - Reordered CGROUP_PATH params order to match struct declaration in the selftest (Michal). - Removed memory_subsys_enabled() and made sure memcg controller enablement checks make sense and are documented (Michal). RFC v2 -> v1: - Instead of introducing a new program type for rstat flushing, add an empty hook point, bpf_rstat_flush(), and use fentry bpf programs to attach to it and flush bpf stats. - Instead of using helpers, use kfuncs for rstat functions. - These changes simplify the patchset greatly, with minimal changes to uapi. RFC v1 -> RFC v2: - Instead of rstat flush programs attach to subsystems, they now attach to rstat (global flushers, not per-subsystem), based on discussions with Tejun. The first patch is entirely rewritten. - Pass cgroup pointers to rstat flushers instead of cgroup ids. This is much more flexibility and less likely to need a uapi update later. - rstat helpers are now only defined if CGROUP_CONFIG. - Most of the code is now only defined if CGROUP_CONFIG and CONFIG_BPF_SYSCALL. - Move rstat helper protos from bpf_base_func_proto() to tracing_prog_func_proto(). - rstat helpers argument (cgroup pointer) is now ARG_PTR_TO_BTF_ID, not ARG_ANYTHING. - Rewrote the selftest to use the cgroup helpers. - Dropped bpf_map_lookup_percpu_elem (already added by Feng). - Dropped patch to support cgroup v1 for cgroup_iter. - Dropped patch to define some cgroup_put() when !CONFIG_CGROUP. The code that calls it is no longer compiled when !CONFIG_CGROUP. cgroup_iter was originally introduced in a different patch series[2]. Hao and I agreed that it fits better as part of this series. RFC v1 of this patch series had the following changes from [2]: - Getting the cgroup's reference at the time at attaching, instead of at the time when iterating. (Yonghong) - Remove .init_seq_private and .fini_seq_private callbacks for cgroup_iter. They are not needed now. (Yonghong) [1] https://lore.kernel.org/bpf/20220520221919.jnqgv52k4ajlgzcl@MBP-98dd607d3435.dhcp.thefacebook.com/ [2] https://lore.kernel.org/lkml/20220225234339.2386398-9-haoluo@google.com/ Hao Luo (2): bpf: Introduce cgroup iter selftests/bpf: Test cgroup_iter. ==================== Signed-off-by: Alexei Starovoitov commit 88886309d2e82afcaa86fc302c2ba25d9e47cbc8 Author: Yosry Ahmed Date: Wed Aug 24 16:31:17 2022 -0700 selftests/bpf: add a selftest for cgroup hierarchical stats collection Add a selftest that tests the whole workflow for collecting, aggregating (flushing), and displaying cgroup hierarchical stats. TL;DR: - Userspace program creates a cgroup hierarchy and induces memcg reclaim in parts of it. - Whenever reclaim happens, vmscan_start and vmscan_end update per-cgroup percpu readings, and tell rstat which (cgroup, cpu) pairs have updates. - When userspace tries to read the stats, vmscan_dump calls rstat to flush the stats, and outputs the stats in text format to userspace (similar to cgroupfs stats). - rstat calls vmscan_flush once for every (cgroup, cpu) pair that has updates, vmscan_flush aggregates cpu readings and propagates updates to parents. - Userspace program makes sure the stats are aggregated and read correctly. Detailed explanation: - The test loads tracing bpf programs, vmscan_start and vmscan_end, to measure the latency of cgroup reclaim. Per-cgroup readings are stored in percpu maps for efficiency. When a cgroup reading is updated on a cpu, cgroup_rstat_updated(cgroup, cpu) is called to add the cgroup to the rstat updated tree on that cpu. - A cgroup_iter program, vmscan_dump, is loaded and pinned to a file, for each cgroup. Reading this file invokes the program, which calls cgroup_rstat_flush(cgroup) to ask rstat to propagate the updates for all cpus and cgroups that have updates in this cgroup's subtree. Afterwards, the stats are exposed to the user. vmscan_dump returns 1 to terminate iteration early, so that we only expose stats for one cgroup per read. - An ftrace program, vmscan_flush, is also loaded and attached to bpf_rstat_flush. When rstat flushing is ongoing, vmscan_flush is invoked once for each (cgroup, cpu) pair that has updates. cgroups are popped from the rstat tree in a bottom-up fashion, so calls will always be made for cgroups that have updates before their parents. The program aggregates percpu readings to a total per-cgroup reading, and also propagates them to the parent cgroup. After rstat flushing is over, all cgroups will have correct updated hierarchical readings (including all cpus and all their descendants). - Finally, the test creates a cgroup hierarchy and induces memcg reclaim in parts of it, and makes sure that the stats collection, aggregation, and reading workflow works as expected. Signed-off-by: Yosry Ahmed Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220824233117.1312810-6-haoluo@google.com Signed-off-by: Alexei Starovoitov commit 434992bb603773c94465c7e68331e68424bdc9eb Author: Yosry Ahmed Date: Wed Aug 24 16:31:16 2022 -0700 selftests/bpf: extend cgroup helpers This patch extends bpf selft cgroup_helpers [ID] n various ways: - Add enable_controllers() that allows tests to enable all or a subset of controllers for a specific cgroup. - Add join_cgroup_parent(). The cgroup workdir is based on the pid, therefore a spawned child cannot join the same cgroup hierarchy of the test through join_cgroup(). join_cgroup_parent() is used in child processes to join a cgroup under the parent's workdir. - Add write_cgroup_file() and write_cgroup_file_parent() (similar to join_cgroup_parent() above). - Add get_root_cgroup() for tests that need to do checks on root cgroup. - Distinguish relative and absolute cgroup paths in function arguments. Now relative paths are called relative_path, and absolute paths are called cgroup_path. Signed-off-by: Yosry Ahmed Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220824233117.1312810-5-haoluo@google.com Signed-off-by: Alexei Starovoitov commit a319185be9f5ad13c2a296d448ac52ffe45d194c Author: Yosry Ahmed Date: Wed Aug 24 16:31:15 2022 -0700 cgroup: bpf: enable bpf programs to integrate with rstat Enable bpf programs to make use of rstat to collect cgroup hierarchical stats efficiently: - Add cgroup_rstat_updated() kfunc, for bpf progs that collect stats. - Add cgroup_rstat_flush() sleepable kfunc, for bpf progs that read stats. - Add an empty bpf_rstat_flush() hook that is called during rstat flushing, for bpf progs that flush stats to attach to. Attaching a bpf prog to this hook effectively registers it as a flush callback. Signed-off-by: Yosry Ahmed Acked-by: Tejun Heo Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220824233117.1312810-4-haoluo@google.com Signed-off-by: Alexei Starovoitov commit fe0dd9d4b7402c9773fc7a453fa65875abaa24ec Author: Hao Luo Date: Wed Aug 24 16:31:14 2022 -0700 selftests/bpf: Test cgroup_iter. Add a selftest for cgroup_iter. The selftest creates a mini cgroup tree of the following structure: ROOT (working cgroup) | PARENT / \ CHILD1 CHILD2 and tests the following scenarios: - invalid cgroup fd. - pre-order walk over descendants from PARENT. - post-order walk over descendants from PARENT. - walk of ancestors from PARENT. - process only a single object (i.e. PARENT). - early termination. Acked-by: Yonghong Song Acked-by: Andrii Nakryiko Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220824233117.1312810-3-haoluo@google.com Signed-off-by: Alexei Starovoitov commit d4ccaf58a8472123ac97e6db03932c375b5c45ba Author: Hao Luo Date: Wed Aug 24 16:31:13 2022 -0700 bpf: Introduce cgroup iter Cgroup_iter is a type of bpf_iter. It walks over cgroups in four modes: - walking a cgroup's descendants in pre-order. - walking a cgroup's descendants in post-order. - walking a cgroup's ancestors. - process only the given cgroup. When attaching cgroup_iter, one can set a cgroup to the iter_link created from attaching. This cgroup is passed as a file descriptor or cgroup id and serves as the starting point of the walk. If no cgroup is specified, the starting point will be the root cgroup v2. For walking descendants, one can specify the order: either pre-order or post-order. For walking ancestors, the walk starts at the specified cgroup and ends at the root. One can also terminate the walk early by returning 1 from the iter program. Note that because walking cgroup hierarchy holds cgroup_mutex, the iter program is called with cgroup_mutex held. Currently only one session is supported, which means, depending on the volume of data bpf program intends to send to user space, the number of cgroups that can be walked is limited. For example, given the current buffer size is 8 * PAGE_SIZE, if the program sends 64B data for each cgroup, assuming PAGE_SIZE is 4kb, the total number of cgroups that can be walked is 512. This is a limitation of cgroup_iter. If the output data is larger than the kernel buffer size, after all data in the kernel buffer is consumed by user space, the subsequent read() syscall will signal EOPNOTSUPP. In order to work around, the user may have to update their program to reduce the volume of data sent to output. For example, skip some uninteresting cgroups. In future, we may extend bpf_iter flags to allow customizing buffer size. Acked-by: Yonghong Song Acked-by: Tejun Heo Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220824233117.1312810-2-haoluo@google.com Signed-off-by: Alexei Starovoitov commit 4b76dfbc44582a6cdf62eadb147f3a88f28de3dd Author: ye xingchen Date: Wed Aug 24 07:53:06 2022 +0000 ACPI: bus: Remove the unneeded result variable Return the value from driver_register() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Rafael J. Wysocki commit 2f190ac250b32c201bc0046d9c2a6f7acdc5c362 Author: Mario Limonciello Date: Tue Aug 23 13:51:34 2022 -0500 ACPI: OSI: Update Documentation on custom _OSI strings Originally, when there was some custom ASL needed for Linux, the guidance for Linux-friendly OEMs was to introduced a new string in the APCI tables and discuss it on the kernel mailing lists. This lead to 3 strings being introduced. Those strings now have the original problems fixed in the kernel and have since been removed. The kernel no longer advertises any custom Linux-* _OSI strings for OEM use. It was discovered that these removed strings were actually being abused to detect Linux for unrelated reasons, so drop the encouragement for new ones to be added. Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit e54049d481a9b25f5ae292f671e6aecb6d79f532 Author: Mario Limonciello Date: Tue Aug 23 13:51:33 2022 -0500 ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string This string was introduced because drivers for NVIDIA hardware didn't handle mux control properly. This was fixed by commit 8e55f99c510f ("drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops"), so vendors shouldn't be using this string to modify ASL any more. Suggested-by: Kai-Heng Feng Reviewed-by: Lyude Paul Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 7c3ad60b3f33d145b75b707c629748e06d7a652d Author: Mario Limonciello Date: Tue Aug 23 13:51:32 2022 -0500 ACPI: OSI: Remove Linux-Lenovo-NV-HDMI-Audio _OSI string This string was introduced because drivers for NVIDIA hardware didn't handle HDMI properly. This was fixed by commit b516ea586d71 ("PCI: Enable NVIDIA HDA controllers"), so vendors shouldn't be using this string to modify ASL any more. Suggested-by: Kai-Heng Feng Reviewed-by: Lyude Paul Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 24867516f06dabedef3be7eea0ef0846b91538bc Author: Mario Limonciello Date: Tue Aug 23 13:51:31 2022 -0500 ACPI: OSI: Remove Linux-Dell-Video _OSI string This string was introduced because drivers for NVIDIA hardware had bugs supporting RTD3 in the past. Before proprietary NVIDIA driver started to support RTD3, Ubuntu had had a mechanism for switching PRIME on and off, though it had required to logout/login to make the library switch happen. When the PRIME had been off, the mechanism had unloaded the NVIDIA driver and put the device into D3cold, but the GPU had never come back to D0 again which is why ODMs used the _OSI to expose an old _DSM method to switch the power on/off. That has been fixed by commit 5775b843a619 ("PCI: Restore config space on runtime resume despite being unbound"). so vendors shouldn't be using this string to modify ASL any more. Reviewed-by: Lyude Paul Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 068a0f5c8260dcc4ccbaefd2dbf21ea84162ac17 Author: Matt Roper Date: Thu Aug 18 16:41:45 2022 -0700 drm/i915/mtl: Don't mask off CCS according to DSS fusing Unlike the Xe_HP platforms, MTL only has a single CCS engine; the quad-based engine masking logic does not apply to this platform (or presumably any future platforms that only have 0 or 1 CCS). Signed-off-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Balasubramani Vivekanandan Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-5-radhakrishna.sripada@intel.com commit da30390b93c377545fdf5ecec34aee018f90485b Author: Matt Roper Date: Thu Aug 18 16:41:44 2022 -0700 drm/i915/mtl: MMIO range is now 4MB Previously only dgfx platforms had a 4MB MMIO range, but starting with MTL we now use the larger range for all platforms. Bspec: 63834, 63830 Signed-off-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Balasubramani Vivekanandan Link: https://patchwork.freedesktop.org/patch/msgid/20220818234202.451742-4-radhakrishna.sripada@intel.com commit 6509dd1111928a351204af1fc8e6aa61e0c59002 Author: Radhakrishna Sripada Date: Wed Aug 17 15:43:04 2022 -0700 drm/i915: Skip Bit12 fw domain reset for gen12+ Bit12 of the Forcewake request register should not be cleared post gen12. Do not touch this bit while clearing during fw domain reset. v2: Tweak the comment to drop older platforms(MattR) Bspec: 52542 Signed-off-by: Sushma Venkatesh Reddy Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220817224304.255767-1-radhakrishna.sripada@intel.com commit a9c5e9c82039cf9f12bcb427160a2163df299b1f Author: Bernard Zhao Date: Mon Aug 22 23:41:31 2022 -0700 drm/amd: remove possible condition with no effect (if == else) This patch fix cocci warning: drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c:1816:6-8: WARNING: possible condition with no effect (if == else). Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit b2243cef56befeaa45a30e783265caf0c8e01ba1 Author: Bernard Zhao Date: Tue Aug 23 00:00:44 2022 -0700 drm/amd: remove possible condition with no effect (if == else) This patch fix cocci warning: drivers/gpu/drm/amd/display/dc/core/dc.c:3335:2-4: WARNING: possible condition with no effect (if == else). Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit d200a64305f7072db918e68b8caef0b33e55ef05 Author: Bernard Zhao Date: Mon Aug 22 23:35:24 2022 -0700 drm/amd: fix potential memory leak This patch fix potential memory leak (clk_src) when function run into last return NULL. Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 6160216fd2c97107e8a9ab39863b056d677fcd85 Author: Bernard Zhao Date: Mon Aug 22 23:49:56 2022 -0700 drm/amd: fix potential memory leak This patch fix potential memory leak (clk_src) when function run into last return NULL. s/free/kfree/ - Alex Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 58dcc221068ae93bf7f6bbc2e44612ea07bc6c95 Author: Qu Huang Date: Tue Aug 23 14:44:06 2022 +0800 drm/amdgpu: mmVM_L2_CNTL3 register not initialized correctly The mmVM_L2_CNTL3 register is not assigned an initial value Signed-off-by: Qu Huang Signed-off-by: Alex Deucher commit 61ebd2fe6f793306ab6c05db8872931026dc1b8d Author: Rafael J. Wysocki Date: Wed Aug 24 19:32:21 2022 +0200 drm: amd: amdgpu: ACPI: Add comment about ACPI_FADT_LOW_POWER_S0 According to the ACPI specification [1], the ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space). However, on some systems that flag is used to indicate whether or not to enable special firmware mechanics allowing the system to save more energy when suspended to idle. If that flag is unset, doing so is generally risky. Accordingly, add a comment to explain the ACPI_FADT_LOW_POWER_S0 check in amdgpu_acpi_is_s0ix_active(), the purpose of which is otherwise somewhat unclear. Link: https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt # [1] Reviewed-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Signed-off-by: Alex Deucher commit 2387e21243ba8a2734322610daaf1eeaf1a146b4 Author: Yu Zhe Date: Thu Aug 25 10:38:48 2022 +0800 drm/radeon: use time_after(a,b) to replace "a>b" time_after() deals with timer wrapping correctly. Signed-off-by: Yu Zhe Signed-off-by: Alex Deucher commit 638bc30f8579bf4e0fda42a0c271149c6ab9c893 Author: Guchun Chen Date: Thu Aug 25 14:16:32 2022 +0800 drm/amdgpu: use dev_info to benefit mGPU case 'free PSP TMR buffer' happens in suspend, but sometimes in mGPU config, it mixes with PSP resume log printing from another GPU, which is confusing. So use dev_info instead of DRM_INFO for printing. [drm] PSP is resuming... [drm] reserve 0xa00000 from 0x877e000000 for PSP TMR amdgpu 0000:e3:00.0: amdgpu: GECC is enabled amdgpu 0000:e3:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available amdgpu 0000:e3:00.0: amdgpu: SMU is resuming... amdgpu 0000:e3:00.0: amdgpu: smu driver if version = 0x00000040, smu fw if version = 0x00000041, smu fw program = 0, version = 0x003a5400 (58.84.0) amdgpu 0000:e3:00.0: amdgpu: SMU driver if version not matched amdgpu 0000:e3:00.0: amdgpu: dpm has been enabled amdgpu 0000:e3:00.0: amdgpu: SMU is resumed successfully! [drm] DMUB hardware initialized: version=0x02020014 [drm] free PSP TMR buffer [drm] kiq ring mec 2 pipe 1 q 0 Signed-off-by: Guchun Chen Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit a79f56d191c4f621eee85979d6e77435fb8383b5 Author: Guchun Chen Date: Thu Aug 25 15:44:46 2022 +0800 drm/amdgpu: use adev_to_drm to get drm device adev_to_drm is used everywhere in amdgpu code, so modify it to keep consistency. Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 720102391060792bcb5697af640f3a4f09acf360 Author: Likun Gao Date: Tue Aug 23 15:34:10 2022 +0800 drm/amdgpu: add MGCG perfmon setting for gfx11 Enable GFX11 MGCG perfmon setting. V2: set rlc to saft mode before setting. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d3ef9d57f24eba16cbce8f304c9190528e842227 Author: Chengming Gui Date: Fri Aug 5 11:00:56 2022 +0800 drm/amd/amdgpu: avoid soft reset check when gpu recovery disabled Avoid soft reset, even ip hang check (ring/ib test) when gpu recovery disabled. v2: add missing "}" Signed-off-by: Chengming Gui Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2724efa389c0dc4d686935b980832cbb87956968 Author: Prike Liang Date: Wed Aug 24 11:16:51 2022 +0800 drm/amdkfd: Fix isa version for the GC 10.3.7 Correct the isa version for handling KFD test. Fixes: 7c4f4f197e0c ("drm/amdkfd: Add GC 10.3.6 and 10.3.7 KFD definitions") Signed-off-by: Prike Liang Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit f47f9b2e9c7b6a208558f2cfa60b4945db1be69e Author: Mukul Joshi Date: Fri Aug 19 17:15:08 2022 -0400 drm/amdgpu: Fix page table setup on Arcturus When translate_further is enabled, page table depth needs to be updated. This was missing on Arcturus MMHUB init. This was causing address translations to fail for SDMA user-mode queues. Fixes: 352e683b72e7 ("drm/amdgpu: Enable translate_further to extend UTCL2 reach") Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Mukul Joshi Signed-off-by: Alex Deucher commit 16f0013157bf8c95d10b9360491e3c920f85641e Author: Felix Kuehling Date: Wed Aug 3 14:45:45 2022 -0400 drm/amdkfd: Allocate doorbells only when needed Only allocate doorbells when the first queue is created on a GPU or the doorbells need to be mapped into CPU or GPU virtual address space. This avoids allocating doorbells unnecessarily and can allow more processes to use KFD on multi-GPU systems. Signed-off-by: Felix Kuehling Reviewed-by: Kent Russell Signed-off-by: Alex Deucher commit 8243df477845cdcf558226bbd24321ee85f82c73 Author: Evan Quan Date: Mon Aug 8 10:41:26 2022 +0800 drm/amd/pm: update SMU 13.0.0 driver_if header To fit the latest 78.53 PMFW. Signed-off-by: Evan Quan Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 42900348bfb41cbfced62060c9cf4b735119394c Author: Roman Li Date: Thu Aug 11 10:51:19 2022 -0400 drm/amd/display: Remove redundant check in atomic_check [Why] We have 2 back-to-back checks for skipping connectors. Logically one of them will do the job. [How] Remove redundant check. Reviewed-by: Hersen Wu > Acked-by: Brian Chang Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c8b1d0fef1b652c65dc09a0fae6ef0504bb2f349 Author: Leo Chen Date: Fri Aug 5 14:47:56 2022 -0400 drm/amd/display: Adding log clock table from SMU [Why & How] Adding log for clock table from SMU helps with the debugging process. Implemented using DC_LOG_SMU to output log. Reviewed-by: Charlene Liu Acked-by: Brian Chang Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 74f4e84dc42bc80478ed15c221280e45e4fdfc5f Author: Alvin Lee Date: Mon Aug 8 13:01:04 2022 -0400 drm/amd/display: Uncomment SubVP scaling case [Description] Uncomment scaling cmd assignment since FW headers are now promoted. Reviewed-by: Martin Leung Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 594b237b9a07e28d524b35a59dbff5bdc8de6b78 Author: Alvin Lee Date: Wed Aug 10 19:39:24 2022 -0400 drm/amd/display: Add interface to track PHY state [Why] Sometimes pixel clock needs to remain active after transmitter disable. [How] Use update_phy_state to track PHY state after stream enable/disable and program pixel clock as needed. Reviewed-by: Alvin Lee Acked-by: Brian Chang Signed-off-by: Taimur Hassan Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b68ea8af4ae005df5ca4f547f22b3824d0fcb3a4 Author: Alvin Lee Date: Thu Aug 11 23:24:19 2022 -0400 drm/amd/display: Free phantom plane and stream properly [Description] Refcount is incremented on allocation and when adding to the context. Therefore we must release the phantom plane and stream after removing from the context. Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e6cf22ef5fae493a99e162c3f2e7233448d2b970 Author: Aurabindo Pillai Date: Tue Aug 9 17:07:14 2022 -0400 drm/amd/display: program k1/k2 divider for virtual signal for DCN32 [Why&How] When using IGT, kms_bw multi display tests trigger an assert since we ignore virtual signal type. k1/k2 dividers should be correctly programmed if VSYNC needs to be correct. Add the appropriate condition to the if arm to fix this. Reviewed-by: Rodrigo Siqueira Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 28c042707bf23436d4fa3ecc1eab1a62dd1f6d7d Author: Robin Chen Date: Mon Aug 8 10:56:17 2022 +0800 drm/amd/display: Cursor flicker when entering PSRSU [Why] The DAL driver may transmit the wrong cursor position to PSRSU DMUB driver when there are multiple planes. [How] Currently the driver apply the HW cursor on the top plane. So we should only transmit the cursor position on the top plane to PSRSU DMUB driver. Reviewed-by: Anthony Koo Acked-by: Brian Chang Signed-off-by: Robin Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 99c957fedfc6678ded0b53afdcb832cd8446cec8 Author: Aurabindo Pillai Date: Thu Jul 7 11:33:36 2022 -0400 drm/amd/display: change to runtime initialization for reg offsets for DCN321 DC was using compile time initialization of register addresses using SR_* macros and their variants. These have been converted to use runtime initialization. The REG_STRUCT macro is a definition that is added to SR_* macros. During initialization, this must be defined before SR_* macros are invoked, which are in turn invoked through various IP initialization macros. Reviewed-by: Harry Wentland Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f7fbcf4637fe8f54acb18d88488ae901b3d7a4dc Author: Aurabindo Pillai Date: Thu Jul 7 11:34:35 2022 -0400 drm/amd/display: change to runtime initialization for reg offsets for DCN32 DC was using compile time initialization of register addresses using SR_* macros and their variants. These have been converted to use runtime initialization. The REG_STRUCT macro is a definition that is added to SR_* macros. During initialization, this must be defined before SR_* macros are invoked, which are in turn invoked through various IP initialization macros. Reviewed-by: Harry Wentland Acked-by: Brian Chang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 95bbbb88ed49f6d4f46c9a23be0ba94db2fa65e9 Author: Ilya Bakoulin Date: Thu Aug 4 13:44:51 2022 -0400 drm/amd/display: Change AUX NACK behavior [Why] Retrying on receiving a NACK can result in long overall EDID read times in some cases. [How] Retry only on DEFER and return immediately on NACK. Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9f92c20279ee0f5256499d9fe55b6d6c4c414276 Author: Saaem Rizvi Date: Mon Aug 8 18:34:44 2022 -0400 drm/amd/display: HDMI ODM Combine Policy Correction [WHY] Reprogramming the stream despite no changes in ODM combine mode. Reprogramming the stream would cause intermittent black screen on display which could only be recovered through enable/disable sequence. [HOW] Fixed bug where we detected a change in ODM combine mode despite ODM combine mode being disabled. Also removed code which required stream to be reprogrammed once a change in ODM combine mode was noticed. Lastly we do not support dynamic ODM switching for HDMI TMDS and FRL on DCN32, therefore we never want to change its ODM policy. Reviewed-by: Samson Tam Acked-by: Brian Chang Signed-off-by: Saaem Rizvi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f577c7c76bf9f0e0a6dd3daf5b9a3d3f2b3880cc Author: Samson Tam Date: Fri Aug 5 18:41:01 2022 -0400 drm/amd/display: fix odm 2:1 policy not being applied consistently in 4k144 modes [Why] odm 2:1 policy is splitting the pipes in 4k144. then in subvp code, we merge the pipes. but since the configuration is unsupported, we keep the pipes split [How] for unsupported subvp configuration, redo the dml and pipe split calls Reviewed-by: Alvin Lee Reviewed-by: Jun Lei Acked-by: Brian Chang Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d61e4ba33e254ef8df33c355ba1b2865e3885693 Author: Derek Lai Date: Tue Aug 2 13:47:03 2022 +0800 drm/amd/display: do not change pipe split policy for RV2 [Why] RV2 do not change pipe split policy in the minimal pipe split transition state. This will unblock mode support on some parts that limit to DPM0 for power reason. [How] Do not change pipe split policy in the minimal pipe split transition state to allow 4k multi display configs to be supported at DPM0. Reviewed-by: Charlene Liu Acked-by: Brian Chang Signed-off-by: Derek Lai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7930f58a7e62e52e96636dafc2c4beb3b76b321e Author: Aric Cyr Date: Mon Aug 8 10:06:31 2022 -0400 drm/amd/display: 3.2.199 This verion brings along following fixes: -Add scaling factor for SubVP -Modify stop_dbg_mode return value -Add gfx_off members and document -Add GFXOFF function for vangogh -Add GFXOFF stats to debug -Fix codestyle problems -Fix overflow on MIN_I64 -Fix Unneeded semicolon -Fix comment typo -Remove useless condition in amdgpu_job_stop_all_jobs_on_sched() -Add decoder_iv_ts helper for ih_v6 -Add chip version to DCN32 -Avoid doing vm_init multiple time -Modify size calculation in MALL -Fix DSC for phantom pipes -Update clock table policy for DCN314 -Modify header inclusion pattern -Fix plug/unplug external monitor will playback MPO video -Add debug parameter to retain default clock table -Increase tlb flush timeout for sriov -Fix compare intergers of different widths -Add reserved dc_log_type -Fix pixel clock programming Acked-by: Brian Chang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0acc5b06b5b450b351aa006c70264baf3062e988 Author: Anthony Koo Date: Sun Aug 7 23:38:56 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.130.0 - For SubVP add scaling factor to allow firmware to calculate accurate line to start programming Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7c55b598b32936e506a699698fbe37c891ad1873 Author: Vignesh Chander Date: Tue Aug 16 18:19:35 2022 -0400 drm/amdgpu: skip set_topology_info for VF Skip set_topology_info as xgmi TA will now block it and host needs to program it. Signed-off-by: Vignesh Chander Reviewed-By : Shaoyun Liu Signed-off-by: Alex Deucher commit 345c0bc0a3cdd3273de5338b7313afe733692296 Author: Tim Huang Date: Mon Aug 22 13:30:44 2022 +0800 drm/amdgpu: add sdma instance check for gfx11 CGCG For some ASICs, like GFX IP v11.0.1, only have one SDMA instance, so not need to configure SDMA1_RLC_CGCG_CTRL for this case. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit aca86ec9a02a4d6099dbe23d1078faa005d58422 Author: Martin Povišer Date: Thu Aug 25 16:02:41 2022 +0200 ASoC: tas2764: Export highpass filter setting Expose a control for the setting of 'DC blocker' highpass filter in the playback path of TAS2764. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825140241.53963-6-povik+lin@cutebit.org Signed-off-by: Mark Brown commit dae191fb957f82fbf570d13c060110eb278813ec Author: Martin Povišer Date: Thu Aug 25 16:02:40 2022 +0200 ASoC: tas2764: Add IRQ handling Add an IRQ handler which logs detected faults (but doesn't do anything else). Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825140241.53963-5-povik+lin@cutebit.org Signed-off-by: Mark Brown commit f5ad67f13623548e5aff847f89700c178aaf2a98 Author: Martin Povišer Date: Thu Aug 25 16:02:39 2022 +0200 ASoC: tas2764: Fix mute/unmute Because the PWR_CTRL field is modeled as the power state of the DAC widget, and at the same time it is used to implement mute/unmute, we need some additional book-keeping to have the right end result no matter the sequence of calls. Without this fix, one permanently mutes an ongoing stream by toggling the associated speaker pin control. (This mirrors commit 1e5907bcb3a3 ("ASoC: tas2770: Fix handling of mute/unmute") which was a fix to the tas2770 driver.) Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825140241.53963-4-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 09273f38832406db19a8907a934687cc10660a6b Author: Martin Povišer Date: Thu Aug 25 16:02:38 2022 +0200 ASoC: tas2764: Drop conflicting set_bias_level power setting The driver is setting the PWR_CTRL field in both the set_bias_level callback and on DAPM events of the DAC widget (and also in the mute_stream method). Drop the set_bias_level callback altogether as the power setting it does is in conflict with the other code paths. (This mirrors commit c8a6ae3fe1c8 ("ASoC: tas2770: Drop conflicting set_bias_level power setting") which was a fix to the tas2770 driver.) Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825140241.53963-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 23204d928a27146d13e11c9383632775345ecca8 Author: Martin Povišer Date: Thu Aug 25 16:02:37 2022 +0200 ASoC: tas2764: Allow mono streams The part is a mono speaker amp, but it can do downmix and switch between left and right channel, so the right channel range is 1 to 2. (This mirrors commit bf54d97a835d ("ASoC: tas2770: Allow mono streams") which was a fix to the tas2770 driver.) Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220825140241.53963-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 57919f4a2ea47f75ac6117f7d99831f7fbd89bc7 Author: Douglas Anderson Date: Wed Aug 24 14:22:57 2022 -0700 regulator: core: Don't err if allow-set-load but no allowed-modes Apparently the device trees of some boards have the property "regulator-allow-set-load" for some of their regulators but then they don't specify anything for "regulator-allowed-modes". That's not really legit, but... ...before commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") they used to get away with it, at least on boards using RPMH regulators. That's because when a regulator driver implements set_load() then the core doesn't look at "regulator-allowed-modes" when trying to automatically adjust things in response to the regulator's load. The core doesn't know what mode we'll end up in, so how could it validate it? Said another way: before commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") some boards _were_ having the regulator mode adjusted despite listing no allowed modes. After commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") these same boards were now getting an error returned when trying to use their regulators, since simply enabling a regulator tries to update its load and that was failing. We don't really want to go back to the behavior from before commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()"). Boards shouldn't have been changing modes if no allowed modes were listed. However, the behavior after commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") isn't the best because now boards can't even turn their regulators on. Let's choose to detect this case and return "no error" from drms_uA_update(). The net-result will be _different_ behavior than we had before commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()"), but this new behavior seems more correct. If a board truly needed the mode switched then its device tree should be updated to list the allowed modes. Reported-by: Andrew Halaney Fixes: efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") Signed-off-by: Douglas Anderson Tested-by: Andrew Halaney Link: https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid Signed-off-by: Mark Brown commit 55841199050d0c6c44eb7f24717816e6e372599f Author: Douglas Anderson Date: Wed Aug 24 14:22:56 2022 -0700 regulator: core: Require regulator drivers to check uV for get_optimum_mode() The get_optimum_mode() for regulator drivers is passed the input voltage and output voltage as well as the current. This is because, in theory, the optimum mode can depend on all three things. It turns out that for all regulator drivers in mainline only the current is looked at when implementing get_optimum_mode(). None of the drivers take the input or output voltage into account. Despite the fact that none of the drivers take the input or output voltage into account, though, the regulator framework will error out before calling into get_optimum_mode() if it doesn't know the input or output voltage. The above behavior turned out to be a probelm for some boards when we landed commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()"). Before that change we'd have no problems running drms_uA_update() for RPMH regulators even if a regulator's input or output voltage was unknown. After that change drms_uA_update() started to fail. This is because typically boards using RPMH regulators don't model the input supplies of RPMH regulators. Input supplies for RPMH regulators nearly always come from the output of other RPMH regulators (or always-on regulators) and RPMH firmware is initialized with this knowledge and handles enabling (and adjusting the voltage of) input supplies. While we could model the parent/child relationship of the regulators in Linux, many boards don't bother since it adds extra overhead. Let's change the regulator core to make things work again. Now if we fail to get the input or output voltage we'll still call into get_optimum_mode() and we'll just pass error codes in for input_uV and/or output_uV parameters. Since no existing regulator drivers even look at input_uV and output_uV we don't need to add this error handling anywhere right now. We'll add some comments in the core so that it's obvious that (if regulator drivers care) it's up to them to add the checks. Reported-by: Andrew Halaney Fixes: efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") Signed-off-by: Douglas Anderson Tested-by: Andrew Halaney Link: https://lore.kernel.org/r/20220824142229.RFT.v2.1.I137e6bef4f6d517be7b081be926059321102fd3d@changeid Signed-off-by: Mark Brown commit 6bbabd28805f36baf6d0f3eb082db032a638f612 Author: Kuninori Morimoto Date: Mon Aug 22 02:35:32 2022 +0000 ASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close() commit b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking") added __soc_pcm_close() for non-lock version of soc_pcm_close(). But soc_pcm_close() is not using it. It is no problem, but confusable. static int __soc_pcm_close(...) { => return soc_pcm_clean(rtd, substream, 0); } static int soc_pcm_close(...) { ... snd_soc_dpcm_mutex_lock(rtd); => soc_pcm_clean(rtd, substream, 0); snd_soc_dpcm_mutex_unlock(rtd); return 0; } This patch use it. Fixes: b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking") Cc: Takashi Iwai Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87czctgg3w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 84fa8f159022aab8e93667b56672238b10cdbb9b Author: Rob Herring Date: Thu Jul 21 15:27:15 2022 -0600 dt-bindings: arm: coresight-tmc: Add 'iommu' property The Coresight TMC component may be behind an IOMMU which is the case for the Arm Juno SoC and some Qualcomm SoCs. Add 'iommus' property to the binding. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220721212718.1980905-2-robh@kernel.org Signed-off-by: Mathieu Poirier commit 8559e62ccb4b0b77eb33496d9984ce05f0b756bb Author: Rob Herring Date: Thu Jul 21 15:27:14 2022 -0600 dt-bindings: arm: coresight: Add 'power-domains' property Coresight components may be in a power domain which is the case for the Arm Juno board. Allow a single 'power-domains' entry for Coresight components. Signed-off-by: Rob Herring Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20220721212718.1980905-1-robh@kernel.org Signed-off-by: Mathieu Poirier commit cd3b9a0f205249c3e7482270b695b90ecf382187 Merge: 4a34613b2017e 6ed462d1c1167 Author: Mark Brown Date: Thu Aug 25 16:24:42 2022 +0100 ASoC platform driver for Apple MCA Merge series from Martin Povišer : sending what should be the final touches on Apple MCA driver. It most likely goes without saying but please do not merge the DT additions into the ASoC tree. commit 86934198eefa10a71f35162b06c44c36d85b98ba Author: Bob Peterson Date: Thu Aug 18 13:32:38 2022 -0500 gfs2: Clear flags when withdraw prevents xmote There are a couple places in function do_xmote where normal processing is circumvented due to withdraws in progress. However, since we bypass most of do_xmote() we bypass telling dlm to lock the dlm lock, which means dlm will never respond with a completion callback. Since the completion callback ordinarily clears GLF_LOCK, this patch changes function do_xmote to handle those situations more gracefully so the file system may be unmounted after withdraw. A very similar situation happens with the GLF_DEMOTE_IN_PROGRESS flag, which is cleared by function finish_xmote(). Since the withdraw causes us to skip the majority of do_xmote, it therefore also skips the call to finish_xmote() so the DEMOTE_IN_PROGRESS flag needs to be cleared manually. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 053640a73838400dca23087d66a9c0db579adafb Author: Bob Peterson Date: Thu Aug 18 13:32:37 2022 -0500 gfs2: Dequeue waiters when withdrawn When a withdraw occurs, ordinary (not system) glocks may not be granted anymore. Later, when the file system is unmounted, gfs2_gl_hash_clear() tries to clear out all the glocks, but these un-grantable pending waiters prevent some glocks from being freed. So the unmount hangs, at least for its ten-minute timeout period. This patch takes measures to remove any pending waiters from the glocks that will never be granted. This allows the unmount to proceed in a reasonable period of time. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 04133b607a78f2fd3daadbe5519513942b0f3a05 Author: Bob Peterson Date: Thu Aug 18 13:32:36 2022 -0500 gfs2: Prevent double iput for journal on error When a gfs2 file system is withdrawn it does iput on its journal to allow recovery from another cluster node. If it's unable to get a replacement inode for whatever reason, the journal descriptor would still be pointing at the evicted inode. So when unmount clears out the list of journals, it would do a second iput referencing the pointer. To avoid this, set the inode pointer to NULL. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 3fe26121dc3a9bf64e18fe0075cd9a92c9cd1b1a Author: Lucas Tanure Date: Thu Aug 25 20:01:32 2022 +0530 spi: amd: Configure device speed Number of clock frequencies are supported by AMD controller which are mentioned in the amd_spi_freq structure table. Create mechanism to configure device clock frequency such that it is strictly less than the requested frequency. Give priority to the device transfer speed and in case it is not set then use the max clock speed supported by the device. Signed-off-by: Lucas Tanure Co-developed-by: Shreeya Patel Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220825143132.253224-1-shreeya.patel@collabora.com Signed-off-by: Mark Brown commit b852ee68fd722294145d86bb4d383d4ad4ae270f Author: Jason-JH.Lin Date: Thu Aug 11 10:58:13 2022 +0800 arm64: dts: mt8195: Add display node for vdosys0 Add display node for vdosys0 of mt8195. Signed-off-by: Jason-JH.Lin Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-21-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 329239a154bc735a74c33e33c5139b30949efc57 Author: Jason-JH.Lin Date: Thu Aug 11 10:58:12 2022 +0800 arm64: dts: mt8195: Add gce node Add gce node and gce alias to mt8195 device tree. Signed-off-by: Jason-JH.Lin Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-20-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 3b5838d1d82e381e31bc3d13398f08d69b98be5d Author: Tinghan Shen Date: Thu Aug 11 10:58:11 2022 +0800 arm64: dts: mt8195: Add iommu and smi nodes Add iommu nodes and smi nodes for mt8195. Signed-off-by: Yong Wu Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-19-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 04cd978316c992711f341b0c91fdb44f2c21836b Author: Trevor Wu Date: Thu Aug 11 10:58:10 2022 +0800 arm64: dts: mt8195: Specify audio reset controller Specify audio reset controller for audio hardware resetting. Signed-off-by: Trevor Wu Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-18-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 7dd5bc578974a96025cb120012706bb4bf4e41fc Author: YC Hung Date: Thu Aug 11 10:58:09 2022 +0800 arm64: dts: mt8195: Add adsp node and adsp mailbox nodes Add adsp node and adsp mailbox nodes for mt8195. Signed-off-by: YC Hung Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-17-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 8903821c8ef9fe89ef20401f2261d2cfcdb0c386 Author: Tinghan Shen Date: Thu Aug 11 10:58:08 2022 +0800 arm64: dts: mt8195: Add audio related nodes Add audio related nodes for mt8195. Signed-off-by: Trevor Wu Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-16-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 867477a5d39fc614151f77bf036c50a29d5ead7f Author: Tinghan Shen Date: Thu Aug 11 10:58:07 2022 +0800 arm64: dts: mt8195: Add scp node Add scp node for mt8195. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-15-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 385e0eedb7ab8069894c59455892dd916acb4456 Author: Tinghan Shen Date: Thu Aug 11 10:58:06 2022 +0800 arm64: dts: mt8195: Add spmi node Add spmi node to mt8195. Signed-off-by: Henry Chen Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-14-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 2b515194bf0cb8f380586e96d2530a51b1878e6a Author: Tinghan Shen Date: Thu Aug 11 10:58:05 2022 +0800 arm64: dts: mt8195: Add power domains controller Add power domains controller node for mt8195. Signed-off-by: Weiyi Lu Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-13-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 6aa5b46d1755a2e3db86fa6bd3f3d15d3c012594 Author: Tinghan Shen Date: Thu Aug 11 10:58:04 2022 +0800 arm64: dts: mt8195: Add vdosys and vppsys clock nodes Add display clock nodes. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-12-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit e39e72cffea3288d3b1f27e0e05ce6c2d18b8735 Author: YT Lee Date: Thu Aug 11 10:58:03 2022 +0800 arm64: dts: mt8195: Add cpufreq node Add cpufreq node for mt8195. Signed-off-by: YT Lee Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-11-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit a93f071a753a2f3fb7ff0acff588ade7679c92aa Author: Tzung-Bi Shih Date: Thu Aug 11 10:58:02 2022 +0800 arm64: dts: mt8195: Disable I2C0 node The I2C0 node should not be enabled globally, as usage is board dependent; disable it in dtsi. Signed-off-by: Tzung-Bi Shih Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-10-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit a376a9a6491431587992e3d4319466d9adba1b58 Author: Tinghan Shen Date: Thu Aug 11 10:58:01 2022 +0800 arm64: dts: mt8195: Disable watchdog external reset signal Disable the external output reset signal of watchdog reset to avoid losing the reset reason stored in the watchdog registers. Signed-off-by: Fengquan Chen Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220811025813.21492-9-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit d3dfd468857479a13285929f96132ae394f76f0a Author: Tinghan Shen Date: Thu Aug 11 10:58:00 2022 +0800 arm64: dts: mediatek: Update mt81xx scpsys node to align with dt-bindings Update scpsys nodes using simple-mfd in mt81xx SoC devicetree to align with the bindings. Add specific compatibles for syscon node, even it's a dummy compatible, because syscon node must come with a specific compatible. Remove the '#power-domain-cells" propertry since the simple-mfd node is not the power domain provider; the provider is the child node. Signed-off-by: Tinghan Shen Link: https://lore.kernel.org/r/20220811025813.21492-8-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 08e9505fa8f9aa00072a47b6f234d89b6b27a89c Author: Diego Santa Cruz Date: Thu Jun 16 15:41:37 2022 +0300 drm/i915/glk: ECS Liva Q2 needs GLK HDMI port timing quirk The quirk added in upstream commit 90c3e2198777 ("drm/i915/glk: Add Quirk for GLK NUC HDMI port issues.") is also required on the ECS Liva Q2. Note: Would be nicer to figure out the extra delay required for the retimer without quirks, however don't know how to check for that. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1326 Signed-off-by: Diego Santa Cruz Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220616124137.3184371-1-jani.nikula@intel.com commit 1ea0d3b46798afc35c3185f6058b8bc08525d56c Author: Hans de Goede Date: Wed Aug 24 17:11:45 2022 +0200 platform/x86: asus-wmi: Simplify tablet-mode-switch handling Simplify tablet-mode-switch handling: 1. The code is the same for all variants, the only difference is the dev_id and notify event code. Store the dev_id + code in struct asus_wmi and unify the handling 2. Make the new unified asus_wmi_tablet_mode_get_state() check dev_id has been set and make it a no-op when not set. This allows calling it unconditionally at resume/restore time 3. Simplify the tablet_mode_sw module-param handling, this also allows selecting the new lid-flip-rog type through the module-param. Cc: Luke D. Jones Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220824151145.1448010-2-hdegoede@redhat.com commit c98dc61ee08f833e68337700546e120e2edac7c9 Author: Hans de Goede Date: Wed Aug 24 17:11:44 2022 +0200 platform/x86: asus-wmi: Simplify tablet-mode-switch probing The 3 different tablet-mode-switch initialization paths repeat a lot of the same code. Add a helper function for this. This also makes the error-handling for the kbd_dock_devid case consistent with the other 2 cases. Cc: Luke D. Jones Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220824151145.1448010-1-hdegoede@redhat.com commit e397c3c460bf3849384f2f55516d1887617cfca9 Author: Luke D. Jones Date: Sat Aug 13 21:27:53 2022 +1200 platform/x86: asus-wmi: Add support for ROG X13 tablet mode Add quirk for ASUS ROG X13 Flow 2-in-1 to enable tablet mode with lid flip (all screen rotations). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220813092753.6635-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 00aa846955fbfb04f7bc0c26c49febfe5395eca1 Author: Luke D. Jones Date: Sat Aug 13 21:27:52 2022 +1200 platform/x86: asus-wmi: Adjust tablet/lidflip handling to use enum Due to multiple types of tablet/lidflip, the existing code for handling these events is refactored to use an enum for each type. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220813092753.6635-1-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 01ef026ab36357a818c7d8324a36dbb8beff6ff5 Author: Luke D. Jones Date: Sat Aug 13 21:26:24 2022 +1200 platform/x86: asus-wmi: Support the hardware GPU MUX on some laptops Support the hardware GPU MUX switch available on some models. This switch can toggle the MUX between: - 0, Dedicated mode - 1, Optimus mode Optimus mode is the regular iGPU + dGPU available, while dedicated mode switches the system to have only the dGPU available. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220813092624.6228-1-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3c3b55564afa8b7d952ce2ba90e7f522832ed0f7 Author: Hans de Goede Date: Mon Aug 15 17:05:38 2022 +0200 platform/x86: asus-wmi: Simplify some of the *_check_present() helpers After the recent cleanup patches, some of the *_check_present() helpers just propagate the result of asus_wmi_dev_is_present(). Replace these with direct asus_wmi_dev_is_present() calls as a further cleanup. Cc: Luke D. Jones Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220815150538.474306-1-hdegoede@redhat.com commit ebc443ad379fad80b8fc350f35cc0652b8447995 Author: Luke D. Jones Date: Sat Aug 13 10:25:09 2022 +1200 platform/x86: asus-wmi: Refactor panel_od attribute The settings for these attributes can be read from the device, this is now done instead of reading a stored value from module. The stored value is also removed. This means the simpler asus_wmi_dev_is_present() can be used in *_check_present() - it is not an error for these methods to be missing. The _write() functions have their bodies shifted in to *_store() which simplifies things further. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-7-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 36450e7db0fe55c338f32059382a2d8342cbc9a1 Author: Luke D. Jones Date: Sat Aug 13 10:25:08 2022 +1200 platform/x86: asus-wmi: Refactor egpu_enable attribute The settings for these attributes can be read from the device, this is now done instead of reading a stored value from module. The stored value is also removed. This means the simpler asus_wmi_dev_is_present() can be used in *_check_present() - it is not an error for these methods to be missing. The _write() functions have their bodies shifted in to *_store() which simplifies things further. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-6-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit cdf36fc865f0aff8de5a9afc3654f114c4d04cba Author: Luke D. Jones Date: Sat Aug 13 10:25:07 2022 +1200 platform/x86: asus-wmi: Refactor disable_gpu attribute The settings for these attributes can be read from the device, this is now done instead of reading a stored value from module. The stored value is also removed. This means the simpler asus_wmi_dev_is_present() can be used in *_check_present() - it is not an error for these methods to be missing. The _write() functions have their bodies shifted in to *_store() which simplifies things further. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-5-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d956c889be804742e39fbb3291b054b3cbf505be Author: Luke D. Jones Date: Sat Aug 13 10:25:06 2022 +1200 platform/x86: asus-wmi: Document the panel_od sysfs attribute The panel_od attribute was not documented, this adds the required documentation. Fixes: ca91ea34778f ("asus-wmi: Add panel overdrive functionality") Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-4-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3206376f099d9c74d9938b9c41cfc0b85ea6e1b0 Author: Luke D. Jones Date: Sat Aug 13 10:25:05 2022 +1200 platform/x86: asus-wmi: Document the egpu_enable sysfs attribute The egpu_enable attribute was not documented, this adds the required documentation. Fixes: 382b91db8044 ("asus-wmi: Add egpu enable method") Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-3-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 7e64c486e807c8edfbd3a0c8e44ad7a1896dbec8 Author: Luke D. Jones Date: Sat Aug 13 10:25:04 2022 +1200 platform/x86: asus-wmi: Document the dgpu_disable sysfs attribute The dgpu_disable attribute was not documented, this adds the required documentation. Fixes: 98829e84dc67 ("asus-wmi: Add dgpu disable method") Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20220812222509.292692-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a8f9c36c4bb705af4b6054244ff9669cdd8dcf71 Author: ye xingchen Date: Thu Aug 11 01:32:03 2022 +0000 platform/x86: asus-wmi: Use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220811013203.16010-1-ye.xingchen@zte.com.cn Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 170f0da25dac630dacb920d043fb20e12c287520 Author: Luke D. Jones Date: Tue Aug 9 14:50:53 2022 +1200 platform/x86: asus-wmi: Convert all attr-show to use sysfs_emit This changes all *_show attributes in asus-wmi.c to use sysfs_emit() instead of the older method of writing to the output buffer manually. Signed-off-by: Luke D. Jones Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220809025054.1626339-6-luke@ljones.dev Signed-off-by: Hans de Goede commit c6607bcbbe5395c9eb7d556356941b3e65f11e9f Author: Maximilian Luz Date: Wed Aug 10 16:41:17 2022 +0200 platform/surface: aggregator_registry: Add HID devices for sensors and UCSI client to SP8 Add software nodes for the HID sensor collection and the UCM UCSI HID client to the Surface Pro 8. In contrast to the type-cover devices, these devices are directly attached to the SAM controller, without any hub. This enables support for HID-based sensors, including the ones used for automatic screen rotation, on the Surface Pro 8. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220810144117.493710-4-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 95a82322505f9e941f8fd85b751b929b055a8f17 Author: Maximilian Luz Date: Wed Aug 10 16:41:16 2022 +0200 platform/surface: aggregator_registry: Rename HID device nodes based on new findings On Windows, the HID devices with target ID 1 are grouped as "Surface Hot Plug - SAM". Rename their device nodes in the registry to reflect that and update the comments accordingly. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220810144117.493710-3-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 637b8210c788b7f17866a9140c118df9231ee2a3 Author: Maximilian Luz Date: Wed Aug 10 16:41:15 2022 +0200 platform/surface: aggregator_registry: Rename HID device nodes based on their function Rename HID device nodes based on their function. In particular, these are nodes for firmware updates via the CFU mechanism (component firmware update), HID based sensors, and a USB-C UCSI client. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220810144117.493710-2-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6f5e02cfb123c608bdb0c9ab32cb8705c2bb9bba Author: Maximilian Luz Date: Wed Aug 10 16:01:33 2022 +0200 platform/surface: aggregator_registry: Add support for Surface Laptop Go 2 The Surface Laptop Go 2 seems to have the same SAM client devices as the Surface Laptop Go 1, so re-use its node group. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220810140133.99087-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede commit 5cc7ce779b60ca9a6cb84a22debf278327550ff7 Author: Hans de Goede Date: Wed Aug 10 16:19:34 2022 +0200 platform/x86: x86-android-tablets: Fix broken touchscreen on Chuwi Hi8 with Windows BIOS The x86-android-tablets handling for the Chuwi Hi8 is only necessary with the Android BIOS and it is causing problems with the Windows BIOS version. Specifically when trying to register the already present touchscreen x86_acpi_irq_helper_get() calls acpi_unregister_gsi(), this breaks the working of the touchscreen and also leads to an oops: [ 14.248946] ------------[ cut here ]------------ [ 14.248954] remove_proc_entry: removing non-empty directory 'irq/75', leaking at least 'MSSL0001:00' [ 14.248983] WARNING: CPU: 3 PID: 440 at fs/proc/generic.c:718 remove_proc_entry ... [ 14.249293] unregister_irq_proc+0xe0/0x100 [ 14.249305] free_desc+0x29/0x70 [ 14.249312] irq_free_descs+0x4b/0x80 [ 14.249320] mp_unmap_irq+0x5c/0x60 [ 14.249329] acpi_unregister_gsi_ioapic+0x2a/0x40 [ 14.249338] x86_acpi_irq_helper_get+0x4b/0x190 [x86_android_tablets] [ 14.249355] x86_android_tablet_init+0x178/0xe34 [x86_android_tablets] Add an init callback for the Chuwi Hi8, which detects when the Windows BIOS is in use and exits with -ENODEV in that case, fixing this. Fixes: 84c2dcdd475f ("platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_info") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220810141934.140771-1-hdegoede@redhat.com commit 5a88ace44d0f99e2bac55d827f4cd6e8bc07e00b Author: Andy Shevchenko Date: Mon Aug 1 14:37:34 2022 +0300 platform/x86: pmc_atom: Amend comment style and grammar The style of the comments is not uniform, make it so and fix a few grammar issues. While at it, update Copyright years. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220801113734.36131-4-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 27526525f3f6028298590cb0986557c98e9c1bd8 Author: Andy Shevchenko Date: Mon Aug 1 14:37:33 2022 +0300 platform/x86: pmc_atom: Make terminator entry uniform Make terminator entry uniform by dropping: - trailing commas - anything inside curly braces Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220801113734.36131-3-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 32c9b75640aeb1b144f9e2963c1640f4cef7c6f2 Author: Andy Shevchenko Date: Mon Aug 1 14:37:32 2022 +0300 platform/x86: pmc_atom: Improve quirk message to be less cryptic Not everyone can get what "critclks" means in the message, improve it to make less cryptic. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220801113734.36131-2-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d8c04e27d93eb0afd750d5ea60119a92b146a755 Author: Andy Shevchenko Date: Mon Aug 1 14:37:31 2022 +0300 platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask On Intel hardware the SLP_TYPx bitfield occupies bits 10-12 as per ACPI specification (see Table 4.13 "PM1 Control Registers Fixed Hardware Feature Control Bits" for the details). Fix the mask and other related definitions accordingly. Fixes: 93e5eadd1f6e ("x86/platform: New Intel Atom SOC power management controller driver") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220801113734.36131-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 4b0133533e82af25d6aaf9d0c7b2a5af388feb74 Author: Greg Kroah-Hartman Date: Fri Jul 29 13:53:02 2022 +0200 platform/x86: dell-privacy: convert to use dev_groups The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the dev_groups pointer to it. Cc: Perry Yuan Cc: Hans de Goede Cc: Mark Gross Cc: Dell.Client.Kernel@dell.com Cc: platform-driver-x86@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220729115302.2258296-1-gregkh@linuxfoundation.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d5a4dfc3cf30faa9d0b0333e58900ddd80ddd745 Merge: 568035b01cfb1 ea522b806162c Author: Hans de Goede Date: Thu Aug 25 16:23:39 2022 +0200 Merge branch 'platform-drivers-x86-amd-pmf' into pdx86-base commit 02aace9be3cf393eed8bf36cc1edee6818fb5e1d Author: AngeloGioacchino Del Regno Date: Tue Jul 26 16:16:52 2022 +0200 soc: mediatek: mtk-svs: Use devm variant for dev_pm_opp_of_add_table() In error cases, this driver never calls dev_pm_opp_of_remove_table(): instead of doing that, simple switch to a devm variant, which will automagically do that for us. Fixes: 681a02e95000 ("soc: mediatek: SVS: introduce MTK SVS engine") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220726141653.177948-6-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 1cd80c06784dd55dca97ce10c5f97bcaa3a417ef Author: AngeloGioacchino Del Regno Date: Tue Jul 26 16:16:51 2022 +0200 soc: mediatek: mtk-svs: Drop of_match_ptr() for of_match_table If CONFIG_OF is not set, we get a -Wunused-const-variable: dropping of_match_ptr() solves that issue. Fixes: 681a02e95000 ("soc: mediatek: SVS: introduce MTK SVS engine") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220726141653.177948-5-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 93cd9b3e60b62dbf399b88603fbc18256d45db6c Author: AngeloGioacchino Del Regno Date: Tue Jul 26 16:16:50 2022 +0200 soc: mediatek: mtk-svs: Remove hardcoded irqflags The interrupt flags are specified in devicetree: forcing them into the driver is suboptimal and not very useful. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220726141653.177948-4-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 2efddd28a2c7ba0fd07720918e7929ffda5101eb Author: AngeloGioacchino Del Regno Date: Tue Jul 26 16:16:49 2022 +0200 soc: mediatek: mtk-svs: Switch to platform_get_irq() Instead of using irq_of_parse_and_map() to retrieve the interrupt from devicetree, switch to platform_get_irq() instead: this function will conveniently also write an error message in case the irq is not found. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220726141653.177948-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit c412a97cf6c5253fcf4ae5545be5775b2417d61b Author: Bob Peterson Date: Mon Aug 22 11:30:12 2022 -0500 gfs2: Use TRY lock in gfs2_inode_lookup for UNLINKED inodes Before this patch, delete_work_func() would check for the GLF_DEMOTE flag on the iopen glock and if set, it would perform special processing. However, there was a race whereby the GLF_DEMOTE flag could be set by another process after the check. Then when it called gfs2_lookup_by_inum() which calls gfs2_inode_lookup(), it tried to lock the iopen glock in SH mode, but the GLF_DEMOTE flag prevented the request from being granted. But the iopen glock could never be demoted because that happens when the inode is evicted, and the evict was never completed because of the failed lookup. To fix that, change function gfs2_inode_lookup() so that when GFS2_BLKST_UNLINKED inodes are searched, it uses the LM_FLAG_TRY flag for the iopen glock. If the locking request fails, fail gfs2_inode_lookup() with -EAGAIN so that delete_work_func() can retry the operation later. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 61b55d8611e4080fdbe088cd3beaaabee71e0181 Author: Sen Chu Date: Tue Jul 26 18:42:42 2022 +0800 dt-bindings: soc: mediatek: pwrap: add compatible for mt8188 Add dt-binding documentation of pwrap for Mediatek MT8188 Signed-off-by: Sen Chu Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220726104242.24839-1-sen.chu@mediatek.com Signed-off-by: Matthias Brugger commit 2778caedb5667239823a29148dfc48b26a8b3c2a Author: Jean Delvare Date: Sat Jul 30 14:48:33 2022 +0200 soc: mediatek: Let PMIC Wrapper and SCPSYS depend on OF With the following configuration options: CONFIG_OF is not set CONFIG_MTK_PMIC_WRAP=y CONFIG_MTK_SCPSYS=y we get the following build warnings: CC drivers/soc/mediatek/mtk-pmic-wrap.o drivers/soc/mediatek/mtk-pmic-wrap.c:2138:34: warning: ‘of_pwrap_match_tbl’ defined but not used [-Wunused-const-variable=] drivers/soc/mediatek/mtk-pmic-wrap.c:1953:34: warning: ‘of_slave_match_tbl’ defined but not used [-Wunused-const-variable=] CC drivers/soc/mediatek/mtk-scpsys.o drivers/soc/mediatek/mtk-scpsys.c:1084:34: warning: ‘of_scpsys_match_tbl’ defined but not used [-Wunused-const-variable=] Looking at the code, both drivers can only bind to OF-defined device nodes, so these drivers are useless without OF and should therefore depend on it. Also drop of_match_ptr() from both drivers. We already know what it will resolve to, so we might as well save cpp some work. Developers or QA teams who wish to test-build the code can still do so by enabling CONFIG_OF, which is available on all architectures and has no dependencies. Signed-off-by: Jean Delvare Reported-by: kernel test robot Link: https://lore.kernel.org/all/202207240252.ZY5hSCNB-lkp@intel.com/ Cc: Matthias Brugger Cc: Chenglin Xu Link: https://lore.kernel.org/r/20220730144833.0a0d9825@endymion.delvare Signed-off-by: Matthias Brugger commit 4a34613b2017e89fdf4f63cda65da68b5f50f284 Author: Yang Yingliang Date: Thu Aug 25 20:35:25 2022 +0800 ASoC: sigmadsp: switch to use kmemdup_nul() helper Use kmemdup_nul() helper instead of open-coding to simplify the code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220825123525.1845695-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c19d893fbf3f2f8fa864ae39652c7fee939edde2 Author: Zhengchao Shao Date: Wed Aug 24 08:52:31 2022 +0800 net: sched: delete duplicate cleanup of backlog and qlen qdisc_reset() is clearing qdisc->q.qlen and qdisc->qstats.backlog _after_ calling qdisc->ops->reset. There is no need to clear them again in the specific reset function. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220824005231.345727-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 09c332027d87cfda9ff58bb84952f6ffefbd309e Author: Fabien Parent Date: Tue Jul 26 14:56:12 2022 +0200 arm64: dts: mediatek: mt8183-pumpkin: add keypad support Add device-tree bindings for the keypad driver on the MT8183 Pumpkin board. The MT8183 Pumpkin board has 2 buttons connected using: KPROW0, KPROW1 and KPCOL0. Signed-off-by: Fabien Parent Signed-off-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-7-6d42c357cb76@baylibre.com Signed-off-by: Matthias Brugger commit a8013418d35cc760d0af3bec6deba885af97fc87 Author: Fabien Parent Date: Tue Jul 26 14:56:11 2022 +0200 arm64: dts: mediatek: mt8183: add keyboard node MT8183 has an on-SoC keyboard controller commonly used for volume up/down buttons. List it in the SoC dts so that boards can enable/use it. Signed-off-by: Fabien Parent Signed-off-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-6-6d42c357cb76@baylibre.com Signed-off-by: Matthias Brugger commit 60a2fb8d202a4d98a87a6ff1aef87c9a07b4d2f4 Author: Moudy Ho Date: Tue Aug 23 10:38:02 2022 +0800 arm64: dts: mt8183: add MediaTek MDP3 nodes Add device nodes for Media Data Path 3 (MDP3) modules. Signed-off-by: Moudy Ho Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220823023803.27850-4-moudy.ho@mediatek.com Signed-off-by: Matthias Brugger commit 0684bc79cd52edca88e430b177f06d980aed5779 Author: Allen-KH Cheng Date: Fri Aug 19 20:06:49 2022 +0800 dt-bindings: pinctrl: mt8186: Fix 'reg-names' for pinctrl nodes The mt8186 contains 8 GPIO physical address bases that correspond to the 'reg-names' of the pinctrl driver. The 'reg-names' entries in bindings are ordered incorrectly, though. The system crashes due of an erroneous address when the regulator initializes. We fix the 'reg-names' for the pinctrl nodes and the pinctrl-mt8186 example in bindings. Fixes: 338e953f1bd1 ("dt-bindings: pinctrl: mt8186: add pinctrl file and binding document") Co-developed-by: Guodong Liu Signed-off-by: Guodong Liu Signed-off-by: Allen-KH Cheng Acked-by: Krzysztof Kozlowski Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220819120649.21523-1-allen-kh.cheng@mediatek.com Signed-off-by: Linus Walleij commit 6ed462d1c1167506479089e655355b3c123fee89 Author: Martin Povišer Date: Wed Aug 24 18:07:12 2022 +0200 ASoC: Add Apple MCA I2S transceiver bindings Add binding schema for MCA I2S transceiver found on Apple M1 and other chips. Signed-off-by: Martin Povišer Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220824160715.95779-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 4065f0b25b7b30ba4dd4665deb5305ead1c0db25 Author: Martin Povišer Date: Wed Aug 24 18:07:15 2022 +0200 ASoC: apple: mca: Add locking In DAI ops, accesses to the native cluster (of the DAI), and to data of clusters related to it by a DPCM frontend-backend link, should have been synchronized by the 'pcm_mutex' lock at ASoC level. What is not covered are the 'port_driver' accesses on foreign clusters to which the current cluster has no a priori relation, so fill in locking for that. (This should only matter in bizarre configurations of sharing one MCA peripheral between ASoC cards.) Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220824160715.95779-5-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 3df5d0d972893d3c0df5aead8152fe1ad48ef45c Author: Martin Povišer Date: Wed Aug 24 18:07:14 2022 +0200 ASoC: apple: mca: Start new platform driver Add ASoC platform driver for the MCA peripheral found on Apple M1 and other chips. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220824160715.95779-4-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 11b918d90aebf87b7d317ec95c17b46716f43d57 Author: Hui.Liu Date: Thu Aug 18 15:50:12 2022 +0800 pinctrl: mediatek: add mt8188 driver Add pinctrl driver support for MediaTek SoC mt8188. Signed-off-by: Hui.Liu Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220818075012.20880-3-hui.liu@mediatek.com Signed-off-by: Linus Walleij commit 9f1bdd7e822147a481cd75c0b2ac4d0199ac70d3 Author: Hui.Liu Date: Thu Aug 18 15:50:11 2022 +0800 dt-bindings: pinctrl: mediatek: add support for mt8188 Add the pinctrl header file on MediaTek mt8188. Add the new binding document for pinctrl on MediaTek mt8188. Signed-off-by: Hui.Liu Reviewed-by: Rob Herring Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220818075012.20880-2-hui.liu@mediatek.com Signed-off-by: Linus Walleij commit a579b0560cd74e9edacbc5d6a021bae90159fb91 Author: Vlastimil Babka Date: Tue Aug 23 19:03:56 2022 +0200 mm/slub: move free_debug_processing() further In the following patch, the function free_debug_processing() will be calling add_partial(), remove_partial() and discard_slab(), se move it below their definitions to avoid forward declarations. To make review easier, separate the move from functional changes. Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes commit fcc245c6f6061e86903f37ffc130ae4ed07a5ae3 Merge: 671d119e75c8d 059846071f468 Author: Mark Brown Date: Thu Aug 25 13:37:57 2022 +0100 ASoC: SOF: mediatek: update SOF driver for mt8186 Merge series from Chunxu Li : In these patches, we update SOF driver for mt8186 commit 67f40373ee7b419374b191cedd63a05afd33a459 Author: Srinivas Kandagatla Date: Wed Aug 17 12:37:47 2022 +0100 pinctrl: qcom: Add sc8280xp lpass lpi pinctrl driver Add pinctrl driver to support pin configuration for LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl on SC8280XP. This IP is an additional pin control block for Audio Pins on top the existing SoC Top level pin-controller. Hardware setup looks like: TLMM GPIO[189 - 207] --> LPASS LPI GPIO [0 - 18] This pin controller has some similarities compared to Top level msm SoC Pin controller like 'each pin belongs to a single group' and so on. However this one is intended to control only audio pins in particular, which can not be configured/touched by the Top level SoC pin controller except setting them as gpios. Apart from this, slew rate is also available in this block for certain pins which are connected to SLIMbus or SoundWire Bus. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220817113747.9111-3-srinivas.kandagatla@linaro.org Signed-off-by: Linus Walleij commit 958bb025f5b3138217ffd4479b1877ba53297df9 Author: Srinivas Kandagatla Date: Wed Aug 17 12:37:46 2022 +0100 dt-bindings: pinctrl: qcom: Add sc8280xp lpass lpi pinctrl bindings Add device tree binding Documentation details for Qualcomm SC8280XP LPASS(Low Power Audio Sub System) LPI(Low Power Island) pinctrl driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220817113747.9111-2-srinivas.kandagatla@linaro.org Signed-off-by: Linus Walleij commit ec1652fc4d56660c33850176d06b3f1a02796946 Author: Srinivas Kandagatla Date: Wed Aug 17 12:38:33 2022 +0100 pinctrl: qcom: Add sm8450 lpass lpi pinctrl driver Add pinctrl driver to support pin configuration for LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl on SM8450. This IP is an additional pin control block for Audio Pins on top the existing SoC Top level pin-controller. Hardware setup looks like: TLMM GPIO[165 - 187] --> LPASS LPI GPIO [0 - 22] This pin controller has some similarities compared to Top level msm SoC Pin controller like 'each pin belongs to a single group' and so on. However this one is intended to control only audio pins in particular, which can not be configured/touched by the Top level SoC pin controller except setting them as gpios. Apart from this, slew rate is also available in this block for certain pins which are connected to SLIMbus or SoundWire Bus. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220817113833.9625-3-srinivas.kandagatla@linaro.org Signed-off-by: Linus Walleij commit 4faa4e73011d65583b25a5597c5f0e118e128ed3 Author: Srinivas Kandagatla Date: Wed Aug 17 12:38:32 2022 +0100 dt-bindings: pinctrl: qcom: Add sm8450 lpass lpi pinctrl bindings Add device tree binding Documentation details for Qualcomm SM8450 LPASS(Low Power Audio Sub System) LPI(Low Power Island) pinctrl driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220817113833.9625-2-srinivas.kandagatla@linaro.org Signed-off-by: Linus Walleij commit 39b707fa7aba7cbfd7d53be50b6098e620f7a6d4 Author: Andy Shevchenko Date: Tue Jun 21 14:29:04 2022 +0300 pinctrl: nomadik: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro. Utilize them instead of open coded variants in the driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220621112904.65674-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0e3db16300fbae5e47ce6c298bf63a7862e5d576 Author: Andy Shevchenko Date: Mon Jun 20 19:50:53 2022 +0300 pinctrl: bcm: Convert drivers to use struct pingroup and PINCTRL_PINGROUP() The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro. Utilize them instead of open coded variants in the driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220620165053.74170-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit a2a9d1850060e5d995136561d76e81d61414f076 Author: Perry Yuan Date: Mon Aug 15 00:35:48 2022 +0800 ACPI: CPPC: Add ACPI disabled check to acpi_cpc_valid() Make acpi_cpc_valid() check if ACPI is disabled, so that its callers don't need to check that separately. This will also cause the AMD pstate driver to refuse to load right away when ACPI is disabled. Also update the warning message in amd_pstate_init() to mention the ACPI disabled case for completeness. Signed-off-by: Perry Yuan [ rjw: Subject edits, new changelog ] Signed-off-by: Rafael J. Wysocki commit d294e99cdc823f368530b8169e33a599fa2a1afe Author: ye xingchen Date: Thu Aug 25 07:28:28 2022 +0000 spi: pxa2xx: Remove the unneeded result variable Return the value clk_prepare_enable() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220825072828.229294-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit d46f737208a45ddff2aef4b57218caa0476af2b6 Author: Yang Li Date: Thu Aug 25 15:04:38 2022 +0800 regulator: drivers: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1986 Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220825070438.128093-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown commit 671d119e75c8dfbf25c1813a167eeb2616c8acd5 Author: Tommaso Merciai Date: Thu Aug 25 12:17:13 2022 +0200 ASoC: max98088: add support for noise gate reg Add support for Noise Gate Threshold reg (ANTH reg 0x40 bit 4 to 7) References: - https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf, p75 Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20220825101714.81580-1-tommaso.merciai@amarulasolutions.com Signed-off-by: Mark Brown commit 4bac47a7b2f9f0c84411cb06944bab8f85c08757 Author: Zhu Ning Date: Thu Aug 25 09:49:52 2022 +0800 ASoC: codecs: add suspend and resume for ES8316 The registers may be lost after suspend due to powerdown. regcache_sync solves this issue. Signed-off-by: Zhu Ning Link: https://lore.kernel.org/r/20220825014952.1038508-1-zhuning0077@gmail.com Signed-off-by: Mark Brown commit 059846071f468da8389dcb8b8bbb38a781b02955 Author: Chunxu Li Date: Thu Aug 25 14:54:11 2022 +0800 ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field Use generic sof_ipc_msg_data instead of specific implementation as they do the same things Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220825065411.31279-4-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 82e93430e0ad13cc31e411cfa575e63118bb0ed4 Author: Chunxu Li Date: Thu Aug 25 14:54:10 2022 +0800 ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box Use generic IPC stream and mailbox ops for mt8186 Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220825065411.31279-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit f3b75e9b56780e3bfaa910e560cb9ba4d8f38e53 Author: Chunxu Li Date: Thu Aug 25 14:54:09 2022 +0800 ASoC: SOF: mediatek: Add dai driver for mt8186 Add dsp ops callback to register AFE DL1/DL2/UL1/UL2 SOF dai's with ALSA Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220825065411.31279-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 658aea35ab88deca19705413199933c2cef9bac8 Author: Pali Rohár Date: Wed Aug 24 13:21:24 2022 +0200 PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value mvebu and aardvark HW have PCIe capabilities on different offset in PCI config space. Extend pci-bridge-emul.c code to allow setting custom driver custom value where PCIe capabilities starts. With this change PCIe capabilities of both drivers are reported at the same location as where they are reported by U-Boot - in their real HW offset. Link: https://lore.kernel.org/r/20220824112124.21675-1-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 3007dc2af6e86ac00b4daf7414142637fdf50bfa Author: Rob Clark Date: Fri Aug 12 15:40:00 2022 -0700 drm/virtio: Fix same-context optimization When VIRTGPU_EXECBUF_RING_IDX is used, we should be considering the timeline that the EB if running on rather than the global driver fence context. Fixes: 85c83ea915ed ("drm/virtio: implement context init: allocate an array of fence contexts") Signed-off-by: Rob Clark Link: http://patchwork.freedesktop.org/patch/msgid/20220812224001.2806463-1-robdclark@gmail.com Signed-off-by: Gerd Hoffmann commit d9c04a1b7a15b5e74b2977461d9511e497f05d8f Author: Vivek Kasireddy Date: Wed Aug 24 23:35:22 2022 -0700 udmabuf: Set ubuf->sg = NULL if the creation of sg table fails When userspace tries to map the dmabuf and if for some reason (e.g. OOM) the creation of the sg table fails, ubuf->sg needs to be set to NULL. Otherwise, when the userspace subsequently closes the dmabuf fd, we'd try to erroneously free the invalid sg table from release_udmabuf resulting in the following crash reported by syzbot: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 0 PID: 3609 Comm: syz-executor487 Not tainted 5.19.0-syzkaller-13930-g7ebfc85e2cd7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 RIP: 0010:dma_unmap_sgtable include/linux/dma-mapping.h:378 [inline] RIP: 0010:put_sg_table drivers/dma-buf/udmabuf.c:89 [inline] RIP: 0010:release_udmabuf+0xcb/0x4f0 drivers/dma-buf/udmabuf.c:114 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2b 04 00 00 48 8d 7d 0c 4c 8b 63 30 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 e2 RSP: 0018:ffffc900037efd30 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffffffff8cb67800 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff84ad27e0 RDI: 0000000000000000 RBP: fffffffffffffff4 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 000000000008c07c R12: ffff88801fa05000 R13: ffff888073db07e8 R14: ffff888025c25440 R15: 0000000000000000 FS: 0000555555fc4300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc1c0ce06e4 CR3: 00000000715e6000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: dma_buf_release+0x157/0x2d0 drivers/dma-buf/dma-buf.c:78 __dentry_kill+0x42b/0x640 fs/dcache.c:612 dentry_kill fs/dcache.c:733 [inline] dput+0x806/0xdb0 fs/dcache.c:913 __fput+0x39c/0x9d0 fs/file_table.c:333 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 ptrace_notify+0x114/0x140 kernel/signal.c:2353 ptrace_report_syscall include/linux/ptrace.h:420 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:482 [inline] syscall_exit_work kernel/entry/common.c:249 [inline] syscall_exit_to_user_mode_prepare+0x129/0x280 kernel/entry/common.c:276 __syscall_exit_to_user_mode_work kernel/entry/common.c:281 [inline] syscall_exit_to_user_mode+0x9/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fc1c0c35b6b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffd78a06090 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007fc1c0c35b6b RDX: 0000000020000280 RSI: 0000000040086200 RDI: 0000000000000006 RBP: 0000000000000007 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 000000000000000c R13: 0000000000000003 R14: 00007fc1c0cfe4a0 R15: 00007ffd78a06140 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:dma_unmap_sgtable include/linux/dma-mapping.h:378 [inline] RIP: 0010:put_sg_table drivers/dma-buf/udmabuf.c:89 [inline] RIP: 0010:release_udmabuf+0xcb/0x4f0 drivers/dma-buf/udmabuf.c:114 Reported-by: syzbot+c80e9ef5d8bb45894db0@syzkaller.appspotmail.com Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Link: http://patchwork.freedesktop.org/patch/msgid/20220825063522.801264-1-vivek.kasireddy@intel.com Signed-off-by: Gerd Hoffmann commit eeeec27d68204701cc5d49d79f7ba811e8438109 Author: Wolfram Sang Date: Thu Aug 18 23:00:09 2022 +0200 HID: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Jiri Kosina commit 9f4441fcbb7219b4e6ea4554f404209a433d4f52 Author: Greg Kroah-Hartman Date: Thu Aug 4 13:31:16 2022 +0200 HID: vivaldi: convert to use dev_groups There is no need for a driver to individually add/create device groups, the driver core will do it automatically for you. Convert the hid-vivaldi core driver to use the dev_groups pointer instead of manually calling the driver core to create the group and have it be cleaned up later on by the devm core. Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Jiri Kosina commit 35f473864f1dcfdd04a247fb2b2f7e44449102d4 Author: Christophe JAILLET Date: Tue Aug 2 21:35:57 2022 +0200 HID: wacom: Simplify comments Remove a left-over from commit 2874c5fd2842 ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152"). An empty comment block can be removed. While at it remove, also remove what is supposed to be the path/filename of the file. This is really low value... and wrong since commit 471d17148c8b ("Input: wacom - move the USB (now hid) Wacom driver in drivers/hid") Signed-off-by: Christophe JAILLET Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 486da113c698a748bd8d75a0d10a2eee8ef8d416 Author: Jiangshan Yi Date: Wed Jul 13 11:20:47 2022 +0800 HID: rmi: replace ternary operator with min() Fix the following coccicheck warning: drivers/hid/hid-rmi.c:240: WARNING opportunity for min(). drivers/hid/hid-rmi.c:350: WARNING opportunity for min(). min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Jiangshan Yi Signed-off-by: Jiri Kosina commit 8272a51d82945d63b238b1ad2f38204930c012a4 Author: Randy Dunlap Date: Fri Jul 8 18:57:59 2022 -0700 HID: Kconfig: remove redundant "depends on HID" lines Remove all occurrences of "depends on HID" that are inside the "if HID" / "endif" block since they are redundant. Signed-off-by: Randy Dunlap Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Signed-off-by: Jiri Kosina commit b8c9024e0ed03c5feb29bd1086a1eb799f3fff44 Author: Veerendranath Jakkam Date: Fri Jul 22 18:41:42 2022 +0530 wifi: cfg80211: Add link_id to cfg80211_ch_switch_started_notify() Add link_id parameter to cfg80211_ch_switch_started_notify() to allow driver to indicate on which link channel switch started on MLD. Send the data to userspace so it knows as well. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20220722131143.3438042-1-quic_vjakkam@quicinc.com Link: https://lore.kernel.org/r/20220722131143.3438042-2-quic_vjakkam@quicinc.com [squash two patches] Signed-off-by: Johannes Berg commit 7a77cd47ec28ed3b455ed6f9e46230d82c480f04 Author: Veerendranath Jakkam Date: Fri Jul 22 18:40:00 2022 +0530 wifi: nl80211: send MLO links channel info in GET_INTERFACE Currently, MLO link level channel information not sent to userspace when NL80211_CMD_GET_INTERFACE requested on MLD. Add support to send channel information for all valid links for NL80211_CMD_GET_INTERFACE request. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20220722131000.3437894-1-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg commit ff763011ee7be4736cd65026d479caa4a2996355 Author: Wenjuan Geng Date: Tue Aug 23 11:01:22 2022 +0200 nfp: flower: support case of match on ct_state(0/0x3f) is_post_ct_flow() function will process only ct_state ESTABLISHED, then offload_pre_check() function will check FLOW_DISSECTOR_KEY_CT flag. When config tc filter match ct_state(0/0x3f), dissector->used_keys with FLOW_DISSECTOR_KEY_CT bit, function offload_pre_check() will return false, so not offload. This is a special case that can be handled safely. Therefore, modify to let initial packet which won't go through conntrack can be offloaded, as long as the cared ct fields are all zero. Signed-off-by: Wenjuan Geng Reviewed-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220823090122.403631-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit 6b75f133fe05c36c52d691ff21545d5757fff721 Author: Hari Chandrakanthan Date: Wed Jul 27 12:02:29 2022 +0530 wifi: mac80211: allow bw change during channel switch in mesh From 'IEEE Std 802.11-2020 section 11.8.8.4.1': The mesh channel switch may be triggered by the need to avoid interference to a detected radar signal, or to reassign mesh STA channels to ensure the MBSS connectivity. A 20/40 MHz MBSS may be changed to a 20 MHz MBSS and a 20 MHz MBSS may be changed to a 20/40 MHz MBSS. Since the standard allows the change of bandwidth during the channel switch in mesh, remove the bandwidth check present in ieee80211_set_csa_beacon. Fixes: c6da674aff94 ("{nl,cfg,mac}80211: enable the triggering of CSA frame in mesh") Signed-off-by: Hari Chandrakanthan Link: https://lore.kernel.org/r/1658903549-21218-1-git-send-email-quic_haric@quicinc.com Signed-off-by: Johannes Berg commit 80e2b1fadbb6f92abbc57f2c918a6589ceba3cf1 Author: Lukas Bulwahn Date: Fri Aug 12 12:31:26 2022 +0200 wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link() Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion") makes ieee80211_sta_activate_link() return 0 in the 'hash' label case. Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed anymore and can be dropped. Remove a needless assignment. No functional change. No change in object code. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220812103126.25308-1-lukas.bulwahn@gmail.com Signed-off-by: Johannes Berg commit 1eb67781117ca2095f0dbede79f22f6b2ffa3189 Author: Hans de Goede Date: Fri Apr 15 22:24:21 2022 +0200 drm/radeon: Don't register backlight when another backlight should be used (v3) Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Changes in v2: - To avoid linker errors when amdgpu is builtin and video_detect.c is in a module, select ACPI_VIDEO and its deps if ACPI is enabled. When ACPI is disabled, ACPI_VIDEO is also always disabled, ensuring the stubs from acpi/video.h will be used. Changes in v3: - Use drm_info(drm_dev, "...") to log messages - ACPI_VIDEO can now be enabled on non X86 too, adjust the Kconfig changes to match this. Acked-by: Alex Deucher Signed-off-by: Hans de Goede commit da11ef832972e311475fcba802398e720ed36c54 Author: Hans de Goede Date: Fri Apr 15 22:22:41 2022 +0200 drm/amdgpu: Don't register backlight when another backlight should be used (v3) Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Changes in v2: - To avoid linker errors when amdgpu is builtin and video_detect.c is in a module, select ACPI_VIDEO and its deps if ACPI is enabled. When ACPI is disabled, ACPI_VIDEO is also always disabled, ensuring the stubs from acpi/video.h will be used. Changes in v3: - Use drm_info(drm_dev, "...") to log messages - ACPI_VIDEO can now be enabled on non X86 too, adjust the Kconfig changes to match this. Acked-by: Alex Deucher Signed-off-by: Hans de Goede commit b1d36e73cc1c68d28f63cbd14767d0d0861147e0 Author: Hans de Goede Date: Fri Apr 15 21:55:35 2022 +0200 drm/i915: Don't register backlight when another backlight should be used (v2) Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Changes in v2: - Use drm_info(drm_dev, ...) for log messages Reviewed-by: Jani Nikula Signed-off-by: Hans de Goede commit fb4b9685779f25ff063358623f3da4f3344be9bb Author: ran jianping Date: Sun Apr 24 06:21:26 2022 +0000 EDAC/wq: Remove unneeded flush_workqueue() destroy_workqueue() already takes care of flushing the workqueue so there is no need to flush it explicitly. [ bp: Massage commit message. ] Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220424062127.3219542-1-ran.jianping@zte.com.cn commit 3579f4c28e77a8a19cb804ab7f7ea6843c50f6ad Author: Johannes Berg Date: Wed Aug 24 12:37:32 2022 +0200 wifi: mac80211: allow link address A2 in TXQ dequeue In ieee80211_tx_dequeue() we currently allow a control port frame to be transmitted on a non-authorized port only if the A2 matches the local interface address, but if that's an MLD and the peer is a legacy peer, we need to allow link address here. Fix that. Signed-off-by: Johannes Berg commit a6ba64d0b187109dc252969c1fc9e2525868bd49 Author: Johannes Berg Date: Wed Aug 24 12:30:16 2022 +0200 wifi: mac80211: fix control port frame addressing For an AP interface, when userspace specifieds the link ID to transmit the control port frame on (in particular for the initial 4-way-HS), due to the logic in ieee80211_build_hdr() for a frame transmitted from/to an MLD, we currently build a header with A1 = DA = MLD address of the peer MLD A2 = local link address (!) A3 = SA = local MLD address This clearly makes no sense, and leads to two problems: - if the frame were encrypted (not true for the initial 4-way-HS) the AAD would be calculated incorrectly - if iTXQs are used, the frame is dropped by logic in ieee80211_tx_dequeue() Fix the addressing, which fixes the first bullet, and the second bullet for peer MLDs, I'll fix the second one for non-MLD peers separately. Signed-off-by: Johannes Berg commit 8b06d13ed29f324c30c688919dcb02f859cf2ca7 Author: Johannes Berg Date: Tue Aug 23 12:36:37 2022 +0200 wifi: mac80211: set link ID in TX info for beacons This is simple here, and might save drivers some work if they have common code for TX between beacons and other frames. Signed-off-by: Johannes Berg commit 65f7052b6c38f767d95ebfa4ae4b389b6da6a421 Author: Johannes Berg Date: Fri Aug 19 14:58:42 2022 +0200 wifi: mac80211_hwsim: fix link change handling The code for determining which links to update in wmediumd or virtio was wrong, fix it to remove the deflink only if there were no old links, and also add the deflink if there are no other new links. Fixes: c204d9df0202 ("wifi: mac80211_hwsim: handle links for wmediumd/virtio") Signed-off-by: Johannes Berg commit c73993b865bf0b2ea1cbb3e9616f18a6508fc49c Author: Johannes Berg Date: Fri Aug 19 13:12:38 2022 +0200 wifi: mac80211: maintain link_id in link_sta To helper drivers if they e.g. have a lookup of the link_sta pointer, add the link ID to the link_sta structure. Signed-off-by: Johannes Berg commit ea5cba269fb1fe22b84f4d01bb3d56320e6ffa3e Author: Johannes Berg Date: Tue Aug 16 11:26:23 2022 +0200 wifi: cfg80211/mac80211: check EHT capability size correctly For AP/non-AP the EHT MCS/NSS subfield size differs, the 4-octet subfield is only used for 20 MHz-only non-AP STA. Pass an argument around everywhere to be able to parse it properly. Signed-off-by: Johannes Berg commit 4992b36041f4263a9df8ee64259d2da6f6e4444a Author: Johannes Berg Date: Tue Aug 16 11:22:46 2022 +0200 wifi: mac80211_hwsim: split iftype data into AP/non-AP The next patch will require splitting the data here into AP and non-AP because for EHT, the format of the MCS/NSS support (struct ieee80211_eht_mcs_nss_supp) is different, for AP the only_20mhz cannot be used. Signed-off-by: Johannes Berg commit 1cb3cf372abe4a0d16620d2b1201de0e291a6c58 Author: Mordechay Goodstein Date: Sat Jul 30 03:51:08 2022 +0300 wifi: mac80211: mlme: don't add empty EML capabilities Draft P802.11be_D2.1, section 35.3.17 states that the EML Capabilities Field shouldn't be included in case the device doesn't have support for EMLSR or EMLMR. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Mordechay Goodstein Signed-off-by: Johannes Berg commit 4f6c78de324b971494c5bbf2cae88b414ea88853 Author: Johannes Berg Date: Wed Aug 17 21:57:19 2022 +0200 wifi: mac80211: use link ID for MLO in queued frames When queuing frames to an interface store the link ID we determined (which possibly came from the driver in the RX status in the first place) in the RX status, and use it in the MLME code to send probe responses, beacons and CSA frames to the right link. Signed-off-by: Johannes Berg commit 43635a5a447c71c43495c44ee7d8de27c987fcc0 Author: Vasanthakumar Thiagarajan Date: Wed Aug 17 16:12:13 2022 +0530 wifi: mac80211: use the corresponding link for stats update With link_id reported in rx_status for MLO connection, do the stats update on the appropriate link instead of always deflink. Signed-off-by: Vasanthakumar Thiagarajan Link: https://lore.kernel.org/r/20220817104213.2531-3-quic_vthiagar@quicinc.com Signed-off-by: Johannes Berg commit ea9d807b56428d65cf43030cbd7ae5a580077147 Author: Vasanthakumar Thiagarajan Date: Wed Aug 17 16:12:12 2022 +0530 wifi: mac80211: add link information in ieee80211_rx_status In MLO, when the address translation from link to MLD is done in fw/hw, it is necessary to be able to have some information on the link on which the frame has been received. Extend the rx API to include link_id and a valid flag in ieee80211_rx_status. Also make chanes to mac80211 rx APIs to make use of the reported link_id after sanity checks. Signed-off-by: Vasanthakumar Thiagarajan Link: https://lore.kernel.org/r/20220817104213.2531-2-quic_vthiagar@quicinc.com Signed-off-by: Johannes Berg commit ccdde7c74ffd7e8bdd3cf685bbfa41231c8e3131 Author: Johannes Berg Date: Wed Aug 17 11:17:01 2022 +0200 wifi: mac80211: properly implement MLO key handling Implement key installation and lookup (on TX and RX) for MLO, so we can use multiple GTKs/IGTKs/BIGTKs. Co-authored-by: Ilan Peer Signed-off-by: Ilan Peer Signed-off-by: Johannes Berg commit e7a7b84e33178db4a839c5e1773247be17597c1f Author: Veerendranath Jakkam Date: Sat Jul 30 10:56:43 2022 +0530 wifi: cfg80211: Add link_id parameter to various key operations for MLO Add support for various key operations on MLD by adding new parameter link_id. Pass the link_id received from userspace to driver for add_key, get_key, del_key, set_default_key, set_default_mgmt_key and set_default_beacon_key to support configuring keys specific to each MLO link. Userspace must not specify link ID for MLO pairwise key since it is common for all the MLO links. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20220730052643.1959111-4-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg commit aa129bcd34b6de2c37b5145da54a57901d5195bc Author: Veerendranath Jakkam Date: Sat Jul 30 10:56:42 2022 +0530 wifi: cfg80211: Prevent cfg80211_wext_siwencodeext() on MLD Currently, MLO support is not added for WEXT code and WEXT handlers are prevented on MLDs. Prevent WEXT handler cfg80211_wext_siwencodeext() also on MLD which is missed in commit 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20220730052643.1959111-3-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg commit 5ec245e4d14b6299148b18f3a088a3211458b75f Author: Veerendranath Jakkam Date: Sat Jul 30 10:56:41 2022 +0530 wifi: cfg80211: reject connect response with MLO params for WEP MLO connections are not supposed to use WEP security. Reject connect response of MLO connection if WEP security mode is used. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20220730052643.1959111-2-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg commit 40fb87129049ec5876dabf4a4d4aed6642b31f1a Author: Johannes Berg Date: Wed Aug 17 10:44:05 2022 +0200 wifi: mac80211: fix use-after-free We've already freed the assoc_data at this point, so need to use another copy of the AP (MLD) address instead. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Johannes Berg commit c88f1542ee72872a276115c868f580a391f04a7b Author: Shaul Triebitz Date: Tue Aug 2 15:22:42 2022 +0300 wifi: mac80211: use link in TXQ parameter configuration Configure the correct link per the passed parameters. Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg commit 9d2bb84d54a40361c7008b33a60dc24f78724746 Author: Shaul Triebitz Date: Tue Aug 2 15:22:42 2022 +0300 wifi: cfg80211: add link id to txq params The Tx queue parameters are per link, so add the link ID from nl80211 parameters to the API. While at it, lock the wdev when calling into the driver so it (and we) can check the link ID appropriately. Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg commit d1efad17381bada239a604bec1008572a2607316 Author: Shaul Triebitz Date: Thu Aug 4 16:50:18 2022 +0300 wifi: mac80211: set link BSSID For an AP interface, set the link BSSID when the link is initialized. Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg commit bc1857619cc7612117d2ee1ed05b5bfeb638614b Author: Shaul Triebitz Date: Mon Aug 1 14:12:29 2022 +0300 wifi: cfg80211: get correct AP link chandef When checking for channel regulatory validity, use the AP link chandef (and not mesh's chandef). Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg commit dd1671ed4ae855a36c5d02d29d7b47e129d7abaf Author: Ilan Peer Date: Wed Aug 3 18:02:56 2022 +0300 wifi: cfg80211: Update RNR parsing to align with Draft P802.11be_D2.0 Based on changes in the specification the TBTT information in the RNR can include MLD information, so update the parsing to allow extracting the short SSID information in such a case. Signed-off-by: Ilan Peer Signed-off-by: Johannes Berg commit a8f62399daa6917e7f9efeb79bce4dd2cd494a1e Author: Shaul Triebitz Date: Sun Jul 24 11:07:32 2022 +0300 wifi: mac80211: properly set old_links when removing a link In ieee80211_sta_remove_link, valid_links is set to the new_links before calling drv_change_sta_links, but is used for the old_links. Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg commit b303835dabe0340f932ebb4e260d2229f79b0684 Author: Johannes Berg Date: Sat Jul 23 22:08:49 2022 +0200 wifi: mac80211: accept STA changes without link changes If there's no link ID, then check that there are no changes to the link, and if so accept them, unless a new link is created. While at it, reject creating a new link without an address. This fixes authorizing an MLD (peer) that has no link 0. Signed-off-by: Johannes Berg commit b4a9af9be628e4f9d09997e0bdef30f6718e88ec Author: Greg Kroah-Hartman Date: Thu Aug 4 13:30:52 2022 +0200 HID: playstation: convert to use dev_groups There is no need for a driver to individually add/create device groups, the driver core will do it automatically for you. Convert the hid-playstation driver to use the dev_groups pointer instead of manually calling the driver core to create the group and have it be cleaned up later on by the devm core. Cc: Roderick Colenbrander Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Roderick Colenbrander Signed-off-by: Jiri Kosina commit 35ffb66547295c72650978f9c28e670e014d0957 Author: Richard Gobert Date: Tue Aug 23 09:10:49 2022 +0200 net: gro: skb_gro_header helper function Introduce a simple helper function to replace a common pattern. When accessing the GRO header, we fetch the pointer from frag0, then test its validity and fetch it from the skb when necessary. This leads to the pattern skb_gro_header_fast -> skb_gro_header_hard -> skb_gro_header_slow recurring many times throughout GRO code. This patch replaces these patterns with a single inlined function call, improving code readability. Signed-off-by: Richard Gobert Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220823071034.GA56142@debian Signed-off-by: Paolo Abeni commit 7a14a11f93dfb3ef99c06d6adeb53d0759be571f Author: Josh Hant Date: Fri Jul 15 20:53:48 2022 -0400 EDAC/ie31200: Add Skylake-S support Add device IDs for Skylake-S CPUs according to datasheet. Signed-off-by: Josh Hant Signed-off-by: Borislav Petkov Acked-by: Jason Baron Link: https://lore.kernel.org/r/20220712102121.20812-1-joshuahant@gmail.com commit 7495fb7e74259234ae7054a2727ff4f39a8eb384 Author: José Expósito Date: Mon Aug 15 16:29:56 2022 +0200 HID: uclogic: Add support for Parblo A610 PRO The Parblo A610 PRO is a UGEE v2 device with a frame with 9 buttons and a bitmap dial. Its pen has 2 buttons, supports tilt and pressure. Add its ID in order to support the device. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 93b40b3ef5e1554e10891491542ef8dce0351af0 Author: José Expósito Date: Mon Aug 15 16:29:55 2022 +0200 HID: uclogic: Add support for XP-PEN Deco Pro S The XP-PEN Deco Pro S is a UGEE v2 device with a frame with 8 buttons, a bitmap dial and a mouse. Its pen has 2 buttons, supports tilt and pressure. All the pieces to support it are already in place. Add its ID in order to support the device. The required Wireshark traces were captured by Jouke Witteveen. For more information check [1]. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/738 [1] Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 387dcab73f10bdc8a1e9b59626d2ccadcfb93f91 Author: José Expósito Date: Mon Aug 15 16:29:54 2022 +0200 HID: uclogic: Add support for UGEE v2 mouse frames Add the required HID descriptors and the initialization function for UGEE v2 frames with a mouse in the frame. Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit b67439d7cd5a8d657bfbfb576dab10b11a492583 Author: José Expósito Date: Mon Aug 15 16:29:53 2022 +0200 HID: uclogic: Add support for UGEE v2 dial frames Add the required HID descriptors and the initialization function for UGEE v2 frames with a bitmap dial. Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit a092986fc095b963383b948a5c74dd1d202d21b5 Author: José Expósito Date: Mon Aug 15 16:29:52 2022 +0200 HID: uclogic: Parse the UGEE v2 frame type The string descriptor returned by UGEE v2 devices contains a byte indicating the device frame type. The values discovered so far are: - 0: Frame with buttons, present in the XP-PEN Deco L. - 1: Frame with buttons and dial, present in the PARBLO A610 PRO. - 2: Frame with buttons and a mouse, shaped as a dial + touchpad. Present in the XP-PEN Deco Pro S. Parse the frame type and add KUnit tests. Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 86402296784f656427245edd0546cac39d410b07 Author: José Expósito Date: Mon Aug 15 16:29:51 2022 +0200 HID: uclogic: Refactor UGEE v2 frame initialization At the moment, the driver only supports UGEE v2 devices that have buttons in their frames. In order to support other types of frames in the future, move the code used to initialize this kind of frames to its own function. Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit a64cbf3ce63122168e1edb3eb1eb1cf7781ae230 Author: José Expósito Date: Mon Aug 15 16:29:50 2022 +0200 HID: uclogic: Refactor UGEE v2 string descriptor parsing The UGEE v2 tablets expose a string descriptor with their capabilities. Move the code used to parse the descriptors and generate a parameter list from it to its own function and add KUnit tests to validate the parser. Tested-by: Jouke Witteveen Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 08809e482a1c44d95d1322b9fbc94c8e58ae9015 Author: José Expósito Date: Mon Aug 15 16:29:49 2022 +0200 HID: uclogic: KUnit best practices and naming conventions The KUnit documentation [1] suggests allowing build tests as a module. In addition, it is recommended [2] to use snake case names for kunit_suite and test cases. Change the Kconfig entry from bool to tristate and stick to the naming conventions to avoid style issues with future tests. Link: https://docs.kernel.org/dev-tools/kunit/style.html#test-kconfig-entries [1] Link: https://www.kernel.org/doc/html/latest/dev-tools/kunit/style.html [2] Acked-by: Daniel Latypov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 609174edeb758d1e2d713e7ab4e09ea8d45aa4f7 Author: José Expósito Date: Mon Aug 15 16:27:06 2022 +0200 HID: uclogic: Fix warning in uclogic_rdesc_template_apply Building with Sparse enabled prints this warning: warning: incorrect type in assignment (different base types) expected signed int x got restricted __le32 [usertype] Cast the return value of cpu_to_le32() to fix the warning. Fixes: 08177f4 ("HID: uclogic: merge hid-huion driver in hid-uclogic") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 0977fda0587cbc5403651ba169e264aa01e8a026 Author: José Expósito Date: Mon Aug 15 16:26:15 2022 +0200 HID: uclogic: Add missing suffix for digitalizers The Pen (0x02) application usage was changed to Digitalizer (0x01) in commit f7d8e387d9ae ("HID: uclogic: Switch to Digitizer usage for styluses"). However, a suffix was not selected for the new usage. Handle the digitalizer application usage in uclogic_input_configured() and add the required suffix. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit dc453dd89daacdc0da6d66234aa27e417df7edcd Author: Jian Shen Date: Tue Aug 16 22:45:57 2022 +0800 lib/vnsprintf: add const modifier for param 'bitmap' There is no modification for param bitmap in function bitmap_string() and bitmap_list_string(), so add const modifier for it. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Reviewed-by: Steven Rostedt (Google) Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220816144557.30779-1-huangguangbin2@huawei.com commit b3be4520d81e7dc820de5fdab0d7d697231cf517 Author: Danilo Krummrich Date: Wed Aug 24 18:13:27 2022 +0200 drm/vc4: hvs: protect drm_print_regset32() In vc4_hvs_dump_state() potentially freed resources are protected from being accessed with drm_dev_enter()/drm_dev_exit(). Also include drm_print_regset32() in the protected section, since drm_print_regset32() does access memory that is typically mapped via devm_* calls. Fixes: 969cfae1f01d ("drm/vc4: hvs: Protect device resources after removal") Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220824161327.330627-5-dakr@redhat.com commit e0c953034a35b85b60ccc792a7d6e5fd802d944b Author: Danilo Krummrich Date: Wed Aug 24 18:13:26 2022 +0200 drm/vc4: crtc: protect device resources after removal (Hardware) resources which are bound to the driver and device lifecycle must not be accessed after the device and driver are unbound. However, the DRM device isn't freed as long as the last user closed it, hence userspace can still call into the driver. Therefore protect the critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 7cc4214c27cf ("drm/vc4: crtc: Switch to drmm_kzalloc") Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220824161327.330627-4-dakr@redhat.com commit 6acb416bf49f818dbf0aa71aee9f6cae93a505a4 Author: Danilo Krummrich Date: Wed Aug 24 18:13:25 2022 +0200 drm/vc4: plane: protect device resources after removal (Hardware) resources which are bound to the driver and device lifecycle must not be accessed after the device and driver are unbound. However, the DRM device isn't freed as long as the last user closed it, hence userspace can still call into the driver. Therefore protect the critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 9872c7a31921 ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()") Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220824161327.330627-3-dakr@redhat.com commit 227295df4e37de66b61bbb3d1f10436f0acd33cc Author: Danilo Krummrich Date: Wed Aug 24 18:13:24 2022 +0200 drm/vc4: hdmi: unlock mutex when device is unplugged In vc4_hdmi_encoder_{pre,post}_crtc_enable() commit cd00ed5187bf ("drm/vc4: hdmi: Protect device resources after removal") missed to unlock the mutex before returning due to drm_dev_enter() indicating the device being unplugged. Fixes: cd00ed5187bf ("drm/vc4: hdmi: Protect device resources after removal") Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220824161327.330627-2-dakr@redhat.com commit c247cd03898c4c43c3bce6d4014730403bc13032 Author: Łukasz Bartosik Date: Tue Feb 1 16:33:54 2022 +0100 drm/i915: fix null pointer dereference Asus chromebook CX550 crashes during boot on v5.17-rc1 kernel. The root cause is null pointer defeference of bi_next in tgl_get_bw_info() in drivers/gpu/drm/i915/display/intel_bw.c. BUG: kernel NULL pointer dereference, address: 000000000000002e PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 1 Comm: swapper/0 Tainted: G U 5.17.0-rc1 Hardware name: Google Delbin/Delbin, BIOS Google_Delbin.13672.156.3 05/14/2021 RIP: 0010:tgl_get_bw_info+0x2de/0x510 ... [ 2.554467] Call Trace: [ 2.554467] [ 2.554467] intel_bw_init_hw+0x14a/0x434 [ 2.554467] ? _printk+0x59/0x73 [ 2.554467] ? _dev_err+0x77/0x91 [ 2.554467] i915_driver_hw_probe+0x329/0x33e [ 2.554467] i915_driver_probe+0x4c8/0x638 [ 2.554467] i915_pci_probe+0xf8/0x14e [ 2.554467] ? _raw_spin_unlock_irqrestore+0x12/0x2c [ 2.554467] pci_device_probe+0xaa/0x142 [ 2.554467] really_probe+0x13f/0x2f4 [ 2.554467] __driver_probe_device+0x9e/0xd3 [ 2.554467] driver_probe_device+0x24/0x7c [ 2.554467] __driver_attach+0xba/0xcf [ 2.554467] ? driver_attach+0x1f/0x1f [ 2.554467] bus_for_each_dev+0x8c/0xc0 [ 2.554467] bus_add_driver+0x11b/0x1f7 [ 2.554467] driver_register+0x60/0xea [ 2.554467] ? mipi_dsi_bus_init+0x16/0x16 [ 2.554467] i915_init+0x2c/0xb9 [ 2.554467] ? mipi_dsi_bus_init+0x16/0x16 [ 2.554467] do_one_initcall+0x12e/0x2b3 [ 2.554467] do_initcall_level+0xd6/0xf3 [ 2.554467] do_initcalls+0x4e/0x79 [ 2.554467] kernel_init_freeable+0xed/0x14d [ 2.554467] ? rest_init+0xc1/0xc1 [ 2.554467] kernel_init+0x1a/0x120 [ 2.554467] ret_from_fork+0x1f/0x30 [ 2.554467] ... Kernel panic - not syncing: Fatal exception Fixes: c64a9a7c05be ("drm/i915: Update memory bandwidth formulae") Signed-off-by: Łukasz Bartosik Reviewed-by: Radhakrishna Sripada Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220201153354.11971-1-lukasz.bartosik@semihalf.com commit dfce69c8520592f1a20619050e6ded6275e9f25f Author: Chanho Park Date: Fri Jul 1 10:52:23 2022 +0900 dt-bindings: serial: samsung: add exynosautov9-uart compatible Add samsung,exynosautov9-uart dedicated compatible for representing uart of Exynos Auto v9 SoC. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220701015226.32781-3-chanho61.park@samsung.com commit 77a70f9c5b8678218a51cf2ae39a52cb4b6bc16c Author: Jiri Pirko Date: Tue Aug 23 09:02:13 2022 +0200 Documentation: devlink: fix the locking section As all callbacks are converted now, fix the text reflecting that change. Suggested-by: Jakub Kicinski Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20220823070213.1008956-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit c21e1bf4d8104fb77bbd99f3d1276c0d7c9b28d9 Merge: 0bf73255d3a3c 1be9ac87a75a4 Author: Jakub Kicinski Date: Wed Aug 24 19:30:19 2022 -0700 Merge branch 'add-a-second-bind-table-hashed-by-port-and-address' Joanne Koong says: ==================== Add a second bind table hashed by port and address Currently, there is one bind hashtable (bhash) that hashes by port only. This patchset adds a second bind table (bhash2) that hashes by port and address. The motivation for adding bhash2 is to expedite bind requests in situations where the port has many sockets in its bhash table entry (eg a large number of sockets bound to different addresses on the same port), which makes checking bind conflicts costly especially given that we acquire the table entry spinlock while doing so, which can cause softirq cpu lockups and can prevent new tcp connections. We ran into this problem at Meta where the traffic team binds a large number of IPs to port 443 and the bind() call took a significant amount of time which led to cpu softirq lockups, which caused packet drops and other failures on the machine. When experimentally testing this on a local server for ~24k sockets bound to the port, the results seen were: ipv4: before - 0.002317 seconds with bhash2 - 0.000020 seconds ipv6: before - 0.002431 seconds with bhash2 - 0.000021 seconds The additions to the initial bhash2 submission [0] are: * Updating bhash2 in the cases where a socket's rcv saddr changes after it has * been bound * Adding locks for bhash2 hashbuckets [0] https://lore.kernel.org/netdev/20220520001834.2247810-1-kuba@kernel.org/ v3: https://lore.kernel.org/netdev/20220722195406.1304948-2-joannelkoong@gmail.com/ v2: https://lore.kernel.org/netdev/20220712235310.1935121-1-joannelkoong@gmail.com/ v1: https://lore.kernel.org/netdev/20220623234242.2083895-2-joannelkoong@gmail.com/ ==================== Link: https://lore.kernel.org/r/20220822181023.3979645-1-joannelkoong@gmail.com Signed-off-by: Jakub Kicinski commit 1be9ac87a75a4fc0e2cc254e412d2d67a58a7191 Author: Joanne Koong Date: Mon Aug 22 11:10:23 2022 -0700 selftests/net: Add sk_bind_sendto_listen and sk_connect_zero_addr This patch adds 2 new tests: sk_bind_sendto_listen and sk_connect_zero_addr. The sk_bind_sendto_listen test exercises the path where a socket's rcv saddr changes after it has been added to the binding tables, and then a listen() on the socket is invoked. The listen() should succeed. The sk_bind_sendto_listen test is copied over from one of syzbot's tests: https://syzkaller.appspot.com/x/repro.c?x=1673a38df00000 The sk_connect_zero_addr test exercises the path where the socket was never previously added to the binding tables and it gets assigned a saddr upon a connect() to address 0. Signed-off-by: Joanne Koong Signed-off-by: Jakub Kicinski commit c35ecb95c448cde15cbde8fde93350d50bcc8be7 Author: Joanne Koong Date: Mon Aug 22 11:10:22 2022 -0700 selftests/net: Add test for timing a bind request to a port with a populated bhash entry This test populates the bhash table for a given port with MAX_THREADS * MAX_CONNECTIONS sockets, and then times how long a bind request on the port takes. When populating the bhash table, we create the sockets and then bind the sockets to the same address and port (SO_REUSEADDR and SO_REUSEPORT are set). When timing how long a bind on the port takes, we bind on a different address without SO_REUSEPORT set. We do not set SO_REUSEPORT because we are interested in the case where the bind request does not go through the tb->fastreuseport path, which is fragile (eg tb->fastreuseport path does not work if binding with a different uid). To run the script: Usage: ./bind_bhash.sh [-6 | -4] [-p port] [-a address] 6: use ipv6 4: use ipv4 port: Port number address: ip address Without any arguments, ./bind_bhash.sh defaults to ipv6 using ip address "2001:0db8:0:f101::1" on port 443. On my local machine, I see: ipv4: before - 0.002317 seconds with bhash2 - 0.000020 seconds ipv6: before - 0.002431 seconds with bhash2 - 0.000021 seconds Signed-off-by: Joanne Koong Signed-off-by: Jakub Kicinski commit 28044fc1d4953b07acec0da4d2fc4784c57ea6fb Author: Joanne Koong Date: Mon Aug 22 11:10:21 2022 -0700 net: Add a bhash2 table hashed by port and address The current bind hashtable (bhash) is hashed by port only. In the socket bind path, we have to check for bind conflicts by traversing the specified port's inet_bind_bucket while holding the hashbucket's spinlock (see inet_csk_get_port() and inet_csk_bind_conflict()). In instances where there are tons of sockets hashed to the same port at different addresses, the bind conflict check is time-intensive and can cause softirq cpu lockups, as well as stops new tcp connections since __inet_inherit_port() also contests for the spinlock. This patch adds a second bind table, bhash2, that hashes by port and sk->sk_rcv_saddr (ipv4) and sk->sk_v6_rcv_saddr (ipv6). Searching the bhash2 table leads to significantly faster conflict resolution and less time holding the hashbucket spinlock. Please note a few things: * There can be the case where the a socket's address changes after it has been bound. There are two cases where this happens: 1) The case where there is a bind() call on INADDR_ANY (ipv4) or IPV6_ADDR_ANY (ipv6) and then a connect() call. The kernel will assign the socket an address when it handles the connect() 2) In inet_sk_reselect_saddr(), which is called when rebuilding the sk header and a few pre-conditions are met (eg rerouting fails). In these two cases, we need to update the bhash2 table by removing the entry for the old address, and add a new entry reflecting the updated address. * The bhash2 table must have its own lock, even though concurrent accesses on the same port are protected by the bhash lock. Bhash2 must have its own lock to protect against cases where sockets on different ports hash to different bhash hashbuckets but to the same bhash2 hashbucket. This brings up a few stipulations: 1) When acquiring both the bhash and the bhash2 lock, the bhash2 lock will always be acquired after the bhash lock and released before the bhash lock is released. 2) There are no nested bhash2 hashbucket locks. A bhash2 lock is always acquired+released before another bhash2 lock is acquired+released. * The bhash table cannot be superseded by the bhash2 table because for bind requests on INADDR_ANY (ipv4) or IPV6_ADDR_ANY (ipv6), every socket bound to that port must be checked for a potential conflict. The bhash table is the only source of port->socket associations. Signed-off-by: Joanne Koong Signed-off-by: Jakub Kicinski commit 7e165d1939284d0bf16a83c591c3c5d24a110d0a Author: Yang Yingliang Date: Wed Aug 24 09:39:07 2022 +0800 selftests/bpf: Fix wrong size passed to bpf_setsockopt() sizeof(new_cc) is not real memory size that new_cc points to; introduce a new_cc_len to store the size and then pass it to bpf_setsockopt(). Fixes: 31123c0360e0 ("selftests/bpf: bpf_setsockopt tests") Signed-off-by: Yang Yingliang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220824013907.380448-1-yangyingliang@huawei.com Signed-off-by: Alexei Starovoitov commit b03914f7ff7bc5aca056aaa49fd3ff9120d24f47 Author: Daniel Müller Date: Wed Aug 24 16:39:06 2022 +0000 selftests/bpf: Add cb_refs test to s390x deny list The cb_refs BPF selftest is failing execution on s390x machines. This is a newly added test that requires a feature not presently supported on this architecture. Denylist the test for this architecture. Fixes: 3cf7e7d8685c ("selftests/bpf: Add tests for reference state fixes for callbacks") Signed-off-by: Daniel Müller Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220824163906.1186832-1-deso@posteo.net Signed-off-by: Alexei Starovoitov commit 0bf73255d3a3cf3b0416e95f2c9f7c53095c2e1a Author: Zhengchao Shao Date: Wed Aug 24 09:36:21 2022 +0800 netlink: fix some kernel-doc comments Modify the comment of input parameter of nlmsg_ and nla_ function. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220824013621.365103-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 35bbe652c421037822aba29423f5f1f7d0d69f3f Author: Randy Dunlap Date: Tue Aug 23 19:42:16 2022 -0700 net: ethernet: ti: davinci_mdio: fix build for mdio bitbang uses davinci_mdio.c uses mdio bitbang APIs, so it should select MDIO_BITBANG to prevent build errors. arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdio_remove': drivers/net/ethernet/ti/davinci_mdio.c:649: undefined reference to `free_mdio_bitbang' arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdio_probe': drivers/net/ethernet/ti/davinci_mdio.c:545: undefined reference to `alloc_mdio_bitbang' arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdiobb_read': drivers/net/ethernet/ti/davinci_mdio.c:236: undefined reference to `mdiobb_read' arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdiobb_write': drivers/net/ethernet/ti/davinci_mdio.c:253: undefined reference to `mdiobb_write' Fixes: d04807b80691 ("net: ethernet: ti: davinci_mdio: Add workaround for errata i2329") Signed-off-by: Randy Dunlap Cc: Grygorii Strashko Cc: Ravi Gunasekaran Cc: Eric Dumazet Cc: Paolo Abeni Cc: Naresh Kamboju Cc: Sudip Mukherjee (Codethink) Link: https://lore.kernel.org/r/20220824024216.4939-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 1faa34672f8a17a3e155e74bde9648564e9480d6 Author: Bagas Sanjaya Date: Wed Aug 24 10:58:04 2022 +0700 Documentation: sysctl: align cells in second content column Stephen Rothwell reported htmldocs warning when merging net-next tree: Documentation/admin-guide/sysctl/net.rst:37: WARNING: Malformed table. Text in column margin in table line 4. ========= =================== = ========== ================== Directory Content Directory Content ========= =================== = ========== ================== 802 E802 protocol mptcp Multipath TCP appletalk Appletalk protocol netfilter Network Filter ax25 AX25 netrom NET/ROM bridge Bridging rose X.25 PLP layer core General parameter tipc TIPC ethernet Ethernet protocol unix Unix domain sockets ipv4 IP version 4 x25 X.25 protocol ipv6 IP version 6 ========= =================== = ========== ================== The warning above is caused by cells in second "Content" column of /proc/sys/net subdirectory table which are in column margin. Align these cells against the column header to fix the warning. Link: https://lore.kernel.org/linux-next/20220823134905.57ed08d5@canb.auug.org.au/ Fixes: 1202cdd665315c ("Remove DECnet support from kernel") Reported-by: Stephen Rothwell Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220824035804.204322-1-bagasdotme@gmail.com Signed-off-by: Jakub Kicinski commit 096830808cf477f0f3f5f5ed8fd37a07dbea5c83 Merge: f52c8947347d4 35f14dbd2fc66 Author: Alexei Starovoitov Date: Tue Aug 23 16:22:00 2022 -0700 Merge branch 'Fix reference state management for synchronous callbacks' Kumar Kartikeya Dwivedi says: ==================== This is patch 1, 2 + their individual tests split into a separate series from the RFC, so that these can be taken in, while we continue working towards a fix for handling stack access inside the callback. Changelog: ---------- v1 -> v2: v1: https://lore.kernel.org/bpf/20220822131923.21476-1-memxor@gmail.com * Fix error for test_progs-no_alu32 due to distinct alloc_insn in errstr RFC v1 -> v1: RFC v1: https://lore.kernel.org/bpf/20220815051540.18791-1-memxor@gmail.com * Fix up commit log to add more explanation (Alexei) * Split reference state fix out into a separate series ==================== Signed-off-by: Alexei Starovoitov commit 35f14dbd2fc6619dea8ac9eea18976378b18450b Author: Kumar Kartikeya Dwivedi Date: Tue Aug 23 03:32:26 2022 +0200 selftests/bpf: Add tests for reference state fixes for callbacks These are regression tests to ensure we don't end up in invalid runtime state for helpers that execute callbacks multiple times. It exercises the fixes to verifier callback handling for reference state in previous patches. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220823013226.24988-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 9d9d00ac29d0ef7ce426964de46fa6b380357d0a Author: Kumar Kartikeya Dwivedi Date: Tue Aug 23 03:31:25 2022 +0200 bpf: Fix reference state management for synchronous callbacks Currently, verifier verifies callback functions (sync and async) as if they will be executed once, (i.e. it explores execution state as if the function was being called once). The next insn to explore is set to start of subprog and the exit from nested frame is handled using curframe > 0 and prepare_func_exit. In case of async callback it uses a customized variant of push_stack simulating a kind of branch to set up custom state and execution context for the async callback. While this approach is simple and works when callback really will be executed only once, it is unsafe for all of our current helpers which are for_each style, i.e. they execute the callback multiple times. A callback releasing acquired references of the caller may do so multiple times, but currently verifier sees it as one call inside the frame, which then returns to caller. Hence, it thinks it released some reference that the cb e.g. got access through callback_ctx (register filled inside cb from spilled typed register on stack). Similarly, it may see that an acquire call is unpaired inside the callback, so the caller will copy the reference state of callback and then will have to release the register with new ref_obj_ids. But again, the callback may execute multiple times, but the verifier will only account for acquired references for a single symbolic execution of the callback, which will cause leaks. Note that for async callback case, things are different. While currently we have bpf_timer_set_callback which only executes it once, even for multiple executions it would be safe, as reference state is NULL and check_reference_leak would force program to release state before BPF_EXIT. The state is also unaffected by analysis for the caller frame. Hence async callback is safe. Since we want the reference state to be accessible, e.g. for pointers loaded from stack through callback_ctx's PTR_TO_STACK, we still have to copy caller's reference_state to callback's bpf_func_state, but we enforce that whatever references it adds to that reference_state has been released before it hits BPF_EXIT. This requires introducing a new callback_ref member in the reference state to distinguish between caller vs callee references. Hence, check_reference_leak now errors out if it sees we are in callback_fn and we have not released callback_ref refs. Since there can be multiple nested callbacks, like frame 0 -> cb1 -> cb2 etc. we need to also distinguish between whether this particular ref belongs to this callback frame or parent, and only error for our own, so we store state->frameno (which is always non-zero for callbacks). In short, callbacks can read parent reference_state, but cannot mutate it, to be able to use pointers acquired by the caller. They must only undo their changes (by releasing their own acquired_refs before BPF_EXIT) on top of caller reference_state before returning (at which point the caller and callback state will match anyway, so no need to copy it back to caller). Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220823013125.24938-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit e6cbbe42944de93ba4e0785b4f90d284b1d7cdf6 Author: Patrick Rudolph Date: Tue Aug 16 07:49:15 2022 +0200 pinctrl: Add Cypress cy8c95x0 support Add support for cypress I2C GPIO expanders cy8c9520, cy8c9540 and cy8c9560. The GPIO expanders feature a PWM mode, thus add it as pinctrl driver. The chip features multiple drive modes for each pin when configured as output and multiple bias settings when configured as input. Tested all three components and verified that all functionality is fully working. Datasheet: https://www.cypress.com/file/37971/download Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20220816054917.7893-3-patrick.rudolph@9elements.com Signed-off-by: Linus Walleij commit 8d39e55e52c10f78967d6d029631601fcc8a0121 Author: Patrick Rudolph Date: Tue Aug 16 07:49:14 2022 +0200 dt-binding: pinctrl: Add cypress,cy8c95x0 Added device tree binding documentation for Cypress CY8C95x0 I2C pin-controller. Signed-off-by: Patrick Rudolph Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220816054917.7893-2-patrick.rudolph@9elements.com Signed-off-by: Linus Walleij commit ebc97a52b5d6cd5fb0c15a3fc9cdd6eb924646a1 Author: Yosry Ahmed Date: Tue Aug 23 00:46:36 2022 +0000 mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. We keep track of several kernel memory stats (total kernel memory, page tables, stack, vmalloc, etc) on multiple levels (global, per-node, per-memcg, etc). These stats give insights to users to how much memory is used by the kernel and for what purposes. Currently, memory used by KVM mmu is not accounted in any of those kernel memory stats. This patch series accounts the memory pages used by KVM for page tables in those stats in a new NR_SECONDARY_PAGETABLE stat. This stat can be later extended to account for other types of secondary pages tables (e.g. iommu page tables). KVM has a decent number of large allocations that aren't for page tables, but for most of them, the number/size of those allocations scales linearly with either the number of vCPUs or the amount of memory assigned to the VM. KVM's secondary page table allocations do not scale linearly, especially when nested virtualization is in use. From a KVM perspective, NR_SECONDARY_PAGETABLE will scale with KVM's per-VM pages_{4k,2m,1g} stats unless the guest is doing something bizarre (e.g. accessing only 4kb chunks of 2mb pages so that KVM is forced to allocate a large number of page tables even though the guest isn't accessing that much memory). However, someone would need to either understand how KVM works to make that connection, or know (or be told) to go look at KVM's stats if they're running VMs to better decipher the stats. Furthermore, having NR_PAGETABLE side-by-side with NR_SECONDARY_PAGETABLE is informative. For example, when backing a VM with THP vs. HugeTLB, NR_SECONDARY_PAGETABLE is roughly the same, but NR_PAGETABLE is an order of magnitude higher with THP. So having this stat will at the very least prove to be useful for understanding tradeoffs between VM backing types, and likely even steer folks towards potential optimizations. The original discussion with more details about the rationale: https://lore.kernel.org/all/87ilqoi77b.wl-maz@kernel.org This stat will be used by subsequent patches to count KVM mmu memory usage. Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220823004639.2387269-2-yosryahmed@google.com Signed-off-by: Sean Christopherson commit d7c9bfb9caaffd496ae44b258ec7c793677d3eeb Author: Miaohe Lin Date: Tue Aug 23 14:32:37 2022 +0800 KVM: x86/mmu: fix memoryleak in kvm_mmu_vendor_module_init() When register_shrinker() fails, KVM doesn't release the percpu counter kvm_total_used_mmu_pages leading to memoryleak. Fix this issue by calling percpu_counter_destroy() when register_shrinker() fails. Fixes: ab271bd4dfd5 ("x86: kvm: propagate register_shrinker return code") Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220823063237.47299-1-linmiaohe@huawei.com [sean: tweak shortlog and changelog] Signed-off-by: Sean Christopherson commit 6aa5c47c351b22c21205c87977c84809cd015fcf Author: Michal Luczaj Date: Mon Aug 22 00:06:47 2022 +0200 KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility The emulator checks the wrong variable while setting the CPU interruptibility state, the target segment is embedded in the instruction opcode, not the ModR/M register. Fix the condition. Signed-off-by: Michal Luczaj Fixes: a5457e7bcf9a ("KVM: emulate: POP SS triggers a MOV SS shadow too") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20220821215900.1419215-1-mhal@rbox.co Signed-off-by: Sean Christopherson commit b24ede22538b4d984cbe20532bbcb303692e7f52 Author: Junaid Shahid Date: Fri Jul 29 15:43:29 2022 -0700 kvm: x86: Do proper cleanup if kvm_x86_ops->vm_init() fails If vm_init() fails [which can happen, for instance, if a memory allocation fails during avic_vm_init()], we need to cleanup some state in order to avoid resource leaks. Signed-off-by: Junaid Shahid Link: https://lore.kernel.org/r/20220729224329.323378-1-junaids@google.com Signed-off-by: Sean Christopherson commit 11c7faa61d136cef92506e4e77d0e6c6e01428bc Author: Taylor, Clinton A Date: Mon Aug 1 16:48:56 2022 -0700 drm/i915/dg2: Add additional HDMI pixel clock frequencies Using the BSPEC algorithm add addition HDMI pixel clocks to the existing table. v2: remove 297000 unused entry Cc: Matt Roper Cc: Radhakrishna Sripada Signed-off-by: Taylor, Clinton A Reviewed-by: Balasubramani Vivekanandan [mattrope: Fixed minor whitepsace issue flagged by checkpatch] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220801234856.2832317-1-clinton.a.taylor@intel.com commit 62fcb99bdf10fed34b4fe6e225489fe4be2d0536 Author: Rafael J. Wysocki Date: Wed Aug 24 18:59:48 2022 +0200 ACPI: Drop parent field from struct acpi_device The parent field in struct acpi_device is, in fact, redundant, because the dev.parent field in it effectively points to the same object and it is used by the driver core. Accordingly, the parent field can be dropped from struct acpi_device and for this purpose define acpi_dev_parent() to retrieve a parent struct acpi_device pointer from the dev.parent field in struct acpi_device. Next, update all of the users of the parent field in struct acpi_device to use acpi_dev_parent() instead of it and drop it. While at it, drop the ACPI_IS_ROOT_DEVICE() macro that is only used in one place in a confusing way. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Mark Brown Acked-by: Mika Westerberg Acked-by: Wei Liu Reviewed-by: Punit Agrawal commit 393d0f5c2a6fd054a0e5a15c0f57517b43b1d5af Merge: 1c23f9e627a7b 06f3605512176 Author: Rafael J. Wysocki Date: Wed Aug 24 20:08:14 2022 +0200 Merge tag 'thermal-v6.1-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal control changes for v6.1-rc1 from Daniel Lezcano: "- Rework the device tree initialization, convert the drivers to the new API and remove the old OF code (Daniel Lezcano) - Fix return value to -ENODEV when searching for a specific thermal zone which does not exist (Daniel Lezcano) - Fix the return value inspection in of_thermal_zone_find() (Dan Carpenter) - Fix kernel panic when KASAN is enabled as it detects use after free when unregistering a thermal zone (Daniel Lezcano) - Move the set_trip ops inside the therma sysfs code (Daniel Lezcano) - Remove unnecessary error message as it is already showed in the underlying function (Jiapeng Chong) - Rework the monitoring path and move the locks upper in the call stack to fix some potentials race windows (Daniel Lezcano) - Fix lockdep_assert() warning introduced by the lock rework (Daniel Lezcano) - Revert the Mellanox 'hotter thermal zone' feature because it is already handled in the thermal framework core code (Daniel Lezcano)" * tag 'thermal-v6.1-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (46 commits) Revert "mlxsw: core: Add the hottest thermal zone detection" thermal/core: Fix lockdep_assert() warning thermal/core: Move the mutex inside the thermal_zone_device_update() function thermal/core: Move the thermal zone lock out of the governors thermal/governors: Group the thermal zone lock inside the throttle function thermal/core: Rework the monitoring a bit thermal/core: Rearm the monitoring only one time thermal/drivers/qcom/spmi-adc-tm5: Remove unnecessary print function dev_err() thermal/of: Remove old OF code thermal/core: Move set_trip_temp ops to the sysfs code thermal/drivers/samsung: Switch to new of thermal API regulator/drivers/max8976: Switch to new of thermal API Input: sun4i-ts - switch to new of thermal API iio/drivers/sun4i_gpadc: Switch to new of thermal API hwmon/drivers/core: Switch to new of thermal API hwmon: pm_bus: core: Switch to new of thermal API ata/drivers/ahci_imx: Switch to new of thermal API thermal/drivers/ti-soc: Switch to new of API thermal/drivers/hisilicon: Switch to new of API thermal/drivers/maxim: Switch to new of API ... commit 906aaf38911a9d172798c781553bff838802f198 Merge: adc641f1dbce4 1173107d7c129 Author: Mark Brown Date: Wed Aug 24 17:23:44 2022 +0100 ASoC: mediatek: dt-bindings: modify machine Merge series from Chunxu Li : Add SOF related field. 1. Add a property "mediatek,adsp", Only when adsp phandle could be retrieved, from DTS, the SOF related part of machine driver is executed. 2. Add a property "mediatek,dai-link" to support dai-links could be specified from DTS commit 28a71499744133614da6ca1f9adc4d4044d6f417 Author: Manivannan Sadhasivam Date: Fri Aug 19 07:38:17 2022 +0530 MAINTAINERS: Add Manivannan Sadhasivam as PCI Endpoint reviewer I've been reviewing the patches related to PCI Endpoint Subsystem for some time. So I'd like to add myself as the reviewer to get immediate attention to the patches. Link: https://lore.kernel.org/r/20220819020817.197844-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Acked-by: Kishon Vijay Abraham I commit f8c74ca6d31c8b0059b083b7eb8544f8108ca531 Author: Anirudh Venkataramanan Date: Wed Aug 17 09:12:12 2022 +0200 ice: Print human-friendly PHY types Provide human readable description of PHY capabilities and report_mode. Sample output: Old: [ 286.130405] ice 0000:16:00.0: get phy caps - report_mode = 0x2 [ 286.130409] ice 0000:16:00.0: phy_type_low = 0x108021020502000 [ 286.130412] ice 0000:16:00.0: phy_type_high = 0x0 [ 286.130415] ice 0000:16:00.0: caps = 0xc8 [ 286.130419] ice 0000:16:00.0: low_power_ctrl_an = 0x4 [ 286.130421] ice 0000:16:00.0: eee_cap = 0x0 [ 286.130424] ice 0000:16:00.0: eeer_value = 0x0 [ 286.130427] ice 0000:16:00.0: link_fec_options = 0xdf [ 286.130430] ice 0000:16:00.0: module_compliance_enforcement = 0x0 [ 286.130433] ice 0000:16:00.0: extended_compliance_code = 0xb [ 286.130435] ice 0000:16:00.0: module_type[0] = 0x11 [ 286.130438] ice 0000:16:00.0: module_type[1] = 0x1 [ 286.130441] ice 0000:16:00.0: module_type[2] = 0x0 New: [ 1128.297347] ice 0000:16:00.0: get phy caps dump [ 1128.297351] ice 0000:16:00.0: phy_caps_active: phy_type_low: 0x0108021020502000 [ 1128.297355] ice 0000:16:00.0: phy_caps_active: bit(13): 10G_SFI_DA [ 1128.297359] ice 0000:16:00.0: phy_caps_active: bit(20): 25GBASE_CR [ 1128.297362] ice 0000:16:00.0: phy_caps_active: bit(22): 25GBASE_CR1 [ 1128.297365] ice 0000:16:00.0: phy_caps_active: bit(29): 25G_AUI_C2C [ 1128.297368] ice 0000:16:00.0: phy_caps_active: bit(36): 50GBASE_CR2 [ 1128.297371] ice 0000:16:00.0: phy_caps_active: bit(41): 50G_LAUI2 [ 1128.297374] ice 0000:16:00.0: phy_caps_active: bit(51): 100GBASE_CR4 [ 1128.297377] ice 0000:16:00.0: phy_caps_active: bit(56): 100G_CAUI4 [ 1128.297380] ice 0000:16:00.0: phy_caps_active: phy_type_high: 0x0000000000000000 [ 1128.297383] ice 0000:16:00.0: phy_caps_active: report_mode = 0x4 [ 1128.297386] ice 0000:16:00.0: phy_caps_active: caps = 0xc8 [ 1128.297389] ice 0000:16:00.0: phy_caps_active: low_power_ctrl_an = 0x4 [ 1128.297392] ice 0000:16:00.0: phy_caps_active: eee_cap = 0x0 [ 1128.297394] ice 0000:16:00.0: phy_caps_active: eeer_value = 0x0 [ 1128.297397] ice 0000:16:00.0: phy_caps_active: link_fec_options = 0xdf [ 1128.297400] ice 0000:16:00.0: phy_caps_active: module_compliance_enforcement = 0x0 [ 1128.297402] ice 0000:16:00.0: phy_caps_active: extended_compliance_code = 0xb [ 1128.297405] ice 0000:16:00.0: phy_caps_active: module_type[0] = 0x11 [ 1128.297408] ice 0000:16:00.0: phy_caps_active: module_type[1] = 0x1 [ 1128.297411] ice 0000:16:00.0: phy_caps_active: module_type[2] = 0x0 Signed-off-by: Anirudh Venkataramanan Co-developed-by: Lukasz Plachno Signed-off-by: Lukasz Plachno Reviewed-by: Alexander Lobakin Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 26d1c571e16a4ca8c144f6627245eb8209f326c2 Author: Anatolii Gerasymenko Date: Thu Aug 11 15:05:35 2022 +0200 ice: Implement devlink port split operations Allow to configure port split options using the devlink port split interface. Support port splitting only for port 0, as the FW has a predefined set of available port split options for the whole device. Add ice_devlink_port_options_print() function to print the table with all available FW port split options. It will be printed after each port split and unsplit command. Add documentation for devlink port split interface usage for the ice driver. Co-developed-by: Jesse Brandeburg Signed-off-by: Jesse Brandeburg Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit da02ee9c220bcc8abbb97473dbf82aad28de80cc Author: Jacob Keller Date: Thu Aug 11 15:05:34 2022 +0200 ice: Add additional flags to ice_nvm_write_activate The ice_nvm_write_activate function is used to issue AdminQ command 0x0707 which sends a request to firmware to activate a flash bank. For basic operations, this command takes an 8bit flag value which defines the flags to control the activation process. There are some additional flags that are stored in a second 8bit flag field. We can simplify the interface by using a u16 cmd_flags variable. Split this over the two bytes of flag storage in the structure. Signed-off-by: Jacob Keller Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 781f15eac0d2035828558d7e5ab2779b151b2362 Author: Anatolii Gerasymenko Date: Thu Aug 11 15:05:33 2022 +0200 ice: Add port option admin queue commands Implement support for Get/Set Port Options admin queue commands (0x06EA/0x06EB). These firmware commands allow the driver to change port specific options and will be used in the next patch. Co-developed-by: Lev Faerman Signed-off-by: Lev Faerman Co-developed-by: Damian Milosek Signed-off-by: Damian Milosek Co-developed-by: Jesse Brandeburg Signed-off-by: Jesse Brandeburg Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 4c99bc96e05012008cc0069eb6f5f915db530158 Author: Marcin Szycik Date: Fri Jul 29 13:03:37 2022 +0200 ice: Add support for ip TTL & ToS offload Add support for parsing TTL and ToS (Hop Limit and Traffic Class) tc fields and matching on those fields in filters. Incomplete part of implementation was already in place (getting enc_ip and enc_tos from flow_match_ip and writing them to filter header). Note: matching on ipv6 ip_ttl, enc_ttl and enc_tos is currently not supported by the DDP package. Signed-off-by: Marcin Szycik Reviewed-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit f2cc648e12285c53365c2bcacbcd919022f4d3a8 Author: ye xingchen Date: Wed Aug 24 07:52:13 2022 +0000 block/rnbd-clt: Remove the unneeded result variable Return the value from rtrs_clt_rdma_cq_direct() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220824075213.221397-1-ye.xingchen@zte.com.cn Signed-off-by: Jens Axboe commit ed4cd17eb26d7f0c6a762608a3f30870929fbcdd Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:20 2022 +0900 mm/sl[au]b: introduce common alloc/free functions without tracepoint To unify kmalloc functions in later patch, introduce common alloc/free functions that does not have tracepoint. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit d6a71648dbc0ca5520cba16a8fdce8d37ae74218 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:19 2022 +0900 mm/slab: kmalloc: pass requests larger than order-1 page to page allocator There is not much benefit for serving large objects in kmalloc(). Let's pass large requests to page allocator like SLUB for better maintenance of common code. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit c4cab557521a73bd803e5c6f613b4e00bd3c4662 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:18 2022 +0900 mm/slab_common: cleanup kmalloc_large() Now that kmalloc_large() and kmalloc_large_node() do mostly same job, make kmalloc_large() wrapper of kmalloc_large_node_notrace(). In the meantime, add missing flag fix code in kmalloc_large_node_notrace(). Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit bf37d791022ecfb1279ac88c5448a53f1ae40a59 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:17 2022 +0900 mm/slab_common: kmalloc_node: pass large requests to page allocator Now that kmalloc_large_node() is in common code, pass large requests to page allocator in kmalloc_node() using kmalloc_large_node(). One problem is that currently there is no tracepoint in kmalloc_large_node(). Instead of simply putting tracepoint in it, use kmalloc_large_node{,_notrace} depending on its caller to show useful address for both inlined kmalloc_node() and __kmalloc_node_track_caller() when large objects are allocated. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit a0c3b940023eef3fa005b2bc37d9312712331dcb Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:16 2022 +0900 mm/slub: move kmalloc_large_node() to slab_common.c In later patch SLAB will also pass requests larger than order-1 page to page allocator. Move kmalloc_large_node() to slab_common.c. Fold kmalloc_large_node_hook() into kmalloc_large_node() as there is no other caller. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit e4c98d68959e51646c379e157bad36ef0d7bf467 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:15 2022 +0900 mm/slab_common: fold kmalloc_order_trace() into kmalloc_large() There is no caller of kmalloc_order_trace() except kmalloc_large(). Fold it into kmalloc_large() and remove kmalloc_order{,_trace}(). Also add tracepoint in kmalloc_large() that was previously in kmalloc_order_trace(). Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 0f853b2e6dd9580103484a098e9c973a67d127ac Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:14 2022 +0900 mm/sl[au]b: factor out __do_kmalloc_node() __kmalloc(), __kmalloc_node(), __kmalloc_node_track_caller() mostly do same job. Factor out common code into __do_kmalloc_node(). Note that this patch also fixes missing kasan_kmalloc() in SLUB's __kmalloc_node_track_caller(). Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit c45248db04f8e3aca4798d67a394fb9cc2168118 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:13 2022 +0900 mm/slab_common: cleanup kmalloc_track_caller() Make kmalloc_track_caller() wrapper of kmalloc_node_track_caller(). Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit f78a03f6e28be0283f73d3c18b54837b638a8ccf Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:12 2022 +0900 mm/slab_common: remove CONFIG_NUMA ifdefs for common kmalloc functions Now that slab_alloc_node() is available for SLAB when CONFIG_NUMA=n, remove CONFIG_NUMA ifdefs for common kmalloc functions. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 07588d726f8d320215dcf6c79a28fe6b1bab6255 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:11 2022 +0900 mm/slab: cleanup slab_alloc() and slab_alloc_node() Make slab_alloc_node() available even when CONFIG_NUMA=n and make slab_alloc() wrapper of slab_alloc_node(). This is necessary for further cleanup. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit c31a910c74ed558461dc7eecf6168ccf805775ec Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Aug 17 19:18:10 2022 +0900 mm/slab: move NUMA-related code to __do_cache_alloc() To implement slab_alloc_node() independent of NUMA configuration, move NUMA fallback/alternate allocation code into __do_cache_alloc(). One functional change here is not to check availability of node when allocating from local node. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka commit 95ccf312a1e4f5a1150dd1a0a2d81c1043e33fb6 Author: Vinay Belgaumkar Date: Fri Aug 19 18:08:32 2022 -0700 drm/i915/guc/slpc: Allow SLPC to use efficient frequency Host Turbo operates at efficient frequency when GT is not idle unless the user or workload has forced it to a higher level. Replicate the same behavior in SLPC by allowing the algorithm to use efficient frequency. We had disabled it during boot due to concerns that it might break kernel ABI for min frequency. However, this is not the case since SLPC will still abide by the (min,max) range limits. With this change, min freq will be at efficient frequency level at init instead of fused min (RPn). If user chooses to reduce min freq below the efficient freq, we will turn off usage of efficient frequency and honor the user request. When a higher value is written, it will get toggled back again. The patch also corrects the register which needs to be read for obtaining the correct efficient frequency for Gen9+. We see much better perf numbers with benchmarks like glmark2 with efficient frequency usage enabled as expected. v2: Address review comments (Rodrigo) v3: with efficient frequency being dynamic, it is possible that the req frequency may go beyond max freq. This will cause SLPC selftests to fail. Add a FIXME there to start the test with [RPn, RP0] instead and restore it afterwards. BugLink: https://gitlab.freedesktop.org/drm/intel/-/issues/5468 Cc: Rodrigo Vivi Signed-off-by: Vinay Belgaumkar Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20220820010832.15350-1-vinay.belgaumkar@intel.com commit dba908967df597081a2e10e2d497cc8f695694b4 Author: Minghao Chi Date: Wed Aug 24 08:03:50 2022 +0000 staging: r8188eu: remove unnecessary null check container_of is never null, so this null check is unnecessary. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220824080350.221614-1-chi.minghao@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit cd33da26036ea54c4ae893e16bf2e873b522f866 Author: Christopher Carbone Date: Tue Aug 23 17:05:32 2022 -0400 staging: sm750fb: split multiple assignments to lines Adhere to Linux kernel coding style. Reported by checkpatch: CHECK: multiple assignments should be avoided Signed-off-by: Christopher Carbone Link: https://lore.kernel.org/r/YwVBHM3z0QExtuXr@valhalla Signed-off-by: Greg Kroah-Hartman commit ef96c458888fa2a329b14efc7991530f645fbddb Author: Krzysztof Kozlowski Date: Tue Aug 23 10:31:54 2022 +0300 clk: samsung: MAINTAINERS: add Krzysztof Kozlowski Add Krzysztof Kozlowski (already Samsung SoC maintainer) as Samsung SoC clock maintainer to handle the patches. Signed-off-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Acked-by: Stephen Boyd Acked-by: Sylwester Nawrocki Link: https://lore.kernel.org/r/20220823073154.359090-1-krzysztof.kozlowski@linaro.org commit 1173107d7c129ff87224814fd38fce5db023aaa0 Author: chunxu.li Date: Wed Aug 24 20:23:19 2022 +0800 ASoC: mediatek: dt-bindings: modify machine bindings for SOF Add SOF related field. 1. Add a property "mediatek,adsp", Only when adsp phandle could be retrieved, from DTS, the SOF related part of machine driver is executed. 2. Add a property "mediatek,dai-link" to support dai-links could be specified from DTS Signed-off-by: chunxu.li Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220824122319.23918-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 0db49765ee1c45b6d4c3ddcff22a2e010739c422 Author: chunxu.li Date: Wed Aug 24 20:23:18 2022 +0800 ASoC: mediatek: dt-bindings: modify machine bindings for SOF Add SOF related field. 1. Add a property "mediatek,adsp", Only when adsp phandle could be retrieved, from DTS, the SOF related part of machine driver is executed. 2. Add a property "mediatek,dai-link" to support dai-links could be specified from DTS Signed-off-by: chunxu.li Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220824122319.23918-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 8357d67f5ec0a5d9e48a2e95c66f1afb2c75879f Merge: 1cd5ea448fe2b efc37109c780e Author: David S. Miller Date: Wed Aug 24 13:24:10 2022 +0100 Merge branch 'r8169-next' Heiner Kallweit says: ==================== r8169: remove support for few unused chip versions There's a number of chip versions that apparently never made it to the mass market. Detection of these chip versions has been disabled for few kernel versions now and nobody complained. Therefore remove support for these chip versions. ==================== Signed-off-by: David S. Miller commit efc37109c780e2e83e6afc8ebc12e433fcd5d526 Author: Heiner Kallweit Date: Tue Aug 23 20:38:06 2022 +0200 r8169: remove support for chip version 60 Detection of this chip version has been disabled for few kernel versions now. Nobody complained, so remove support for this chip version. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 133706a960de413cea12f4f6e1a2262adb381f62 Author: Heiner Kallweit Date: Tue Aug 23 20:37:30 2022 +0200 r8169: remove support for chip version 50 Detection of this chip version has been disabled for few kernel versions now. Nobody complained, so remove support for this chip version. v3: - rebase patch Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 8a1ab0c4028dc08a2d9a409085dbacba97197f88 Author: Heiner Kallweit Date: Tue Aug 23 20:36:07 2022 +0200 r8169: remove support for chip version 49 Detection of this chip version has been disabled for few kernel versions now. Nobody complained, so remove support for this chip version. v2: - fix a typo: RTL_GIGA_MAC_VER_40 -> RTL_GIGA_MAC_VER_50 Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ebe598985711d2d8259276671acdc447b19dbacd Author: Heiner Kallweit Date: Tue Aug 23 20:35:25 2022 +0200 r8169: remove support for chip versions 45 and 47 Detection of these chip versions has been disabled for few kernel versions now. Nobody complained, so remove support for this chip version. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 44307b27de2e8c5e9598fe304ce6535ad595f082 Author: Heiner Kallweit Date: Tue Aug 23 20:34:52 2022 +0200 r8169: remove support for chip version 41 Detection of this chip version has been disabled for few kernel versions now. Nobody complained, so remove support for this chip version. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 1cd5ea448fe2b3284767aa5ab8e01e8836798e63 Merge: fef5de753ff01 72e0bcd156360 Author: David S. Miller Date: Wed Aug 24 13:19:39 2022 +0100 Merge tag 'mlx5-updates-2022-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-updates-2022-08-22 Roi Dayan Says: =============== Add support for SF tunnel offload Mlx5 driver only supports VF tunnel offload. To add support for SF tunnel offload the driver needs to: 1. Add send-to-vport metadata matching rules like done for VFs. 2. Set an indirect table for SF vport, same as VF vport. info smaller sub functions for better maintainability. rules from esw init phase to representor load phase. SFs could be created after esw initialized and thus the send-to-vport meta rules would not be created for those SFs. By moving the creation of the rules to representor load phase we ensure creating the rules also for SFs created later. =============== Lama Kayal Says: ================ Make flow steering API loosely coupled from mlx5e_priv, in a manner to introduce more readable and maintainable modules. Make TC's private, let mlx5e_flow_steering struct be dynamically allocated, and introduce its API to maintain the code via setters and getters instead of publicly exposing it. Introduce flow steering debug macros to provide an elegant finish to the decoupled flow steering API, where errors related to flow steering shall be reported via them. All flow steering related files will drop any coupling to mlx5e_priv, instead they will get the relevant members as input. Among these, fs_tt_redirect, fs_tc, and arfs. ================ commit fef5de753ff01887cfa50990532c3890fccb9338 Author: Jerry Ray Date: Mon Aug 22 16:39:32 2022 -0500 micrel: ksz8851: fixes struct pointer issue Issue found during code review. This bug has no impact as long as the ks8851_net structure is the first element of the ks8851_net_spi structure. As long as the offset to the ks8851_net struct is zero, the container_of() macro is subtracting 0 and therefore no damage done. But if the ks8851_net_spi struct is ever modified such that the ks8851_net struct within it is no longer the first element of the struct, then the bug would manifest itself and cause problems. struct ks8851_net is contained within ks8851_net_spi. ks is contained within kss. kss is the priv_data of the netdev structure. Signed-off-by: Jerry Ray Signed-off-by: David S. Miller commit aacd467c0a576e5e44d2de4205855dc0fe43f6fb Author: Eric Dumazet Date: Mon Aug 22 21:15:28 2022 +0000 tcp: annotate data-race around tcp_md5sig_pool_populated tcp_md5sig_pool_populated can be read while another thread changes its value. The race has no consequence because allocations are protected with tcp_md5sig_mutex. This patch adds READ_ONCE() and WRITE_ONCE() to document the race and silence KCSAN. Reported-by: Abhishek Shah Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 73ef239cd8439b33273cd95d08cffaf8022b01a8 Author: Oleksandr Mazur Date: Mon Aug 22 21:03:15 2022 +0300 net: marvell: prestera: implement br_port_locked flag offloading Both br_port_locked and interfaces's flag offloading is supported. No new ABI is being added, rather existing (port_param_set) API call gets extended. Signed-off-by: Oleksandr Mazur V2: add missing receipents (linux-kernel, netdev) Signed-off-by: David S. Miller commit 1a7966b33b5bbefd950cffef1ea8ee3f5f1bf076 Author: Conor Dooley Date: Sat Aug 20 00:14:12 2022 +0100 dt-bindings: PCI: microchip,pcie-host: fix missing dma-ranges The dma-ranges property was missed when adding the binding initially. The root port can use up to 6 address translation tables, depending on configuration. Link: https://www.microsemi.com/document-portal/doc_download/1245812-polarfire-fpga-and-polarfire-soc-fpga-pci-express-user-guide # Section 1.3.3 Link: https://lore.kernel.org/r/20220819231415.3860210-4-mail@conchuod.ie Fixes: 6ee6c89aac35 ("dt-bindings: PCI: microchip: Add Microchip PolarFire host binding") Signed-off-by: Conor Dooley Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 05a5741019a524ab9e1d355528c8ebcbd6debfe7 Author: Conor Dooley Date: Sat Aug 20 00:14:11 2022 +0100 dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties Recent versions of dt-schema warn about unevaluatedProperties: arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected) From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml The clocks are required to enable interfaces between the FPGA fabric and the core complex, so add them to the binding. Link: https://lore.kernel.org/r/20220819231415.3860210-3-mail@conchuod.ie Fixes: 6ee6c89aac35 ("dt-bindings: PCI: microchip: Add Microchip PolarFire host binding") Signed-off-by: Conor Dooley Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit b408fad61d34c765c3e01895286332af2d50402a Author: Conor Dooley Date: Sat Aug 20 00:14:10 2022 +0100 dt-bindings: PCI: fu740-pci: fix missing clock-names The commit b92225b034c0 ("dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings") removed the clock-names property as a requirement and from the example as it triggered unevaluatedProperty warnings. dtbs_check was not able to pick up on this at the time, but now can: arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dtb: pcie@e00000000: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: linux/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml The property was already in use by the FU740 DTS and the clock must be enabled. The Linux and FreeBSD drivers require the property to enable the clocks correctly Re-add the property and its "clocks" dependency, while making it required. Link: https://lore.kernel.org/r/20220819231415.3860210-2-mail@conchuod.ie Fixes: b92225b034c0 ("dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings") Fixes: 43cea116be0b ("dt-bindings: PCI: Add SiFive FU740 PCIe host controller") Signed-off-by: Conor Dooley Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 48aa47308de609e687dc187b72de92e3346c4187 Author: ye xingchen Date: Wed Aug 24 07:47:07 2022 +0000 regulator: max597x: Remove the unneeded result variable Return the value from regmap_write() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220824074707.221159-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit adc641f1dbce48914445efb79f302380ff10df10 Author: Yang Yingliang Date: Wed Aug 24 09:32:34 2022 +0800 ASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe() After using 'res_node' returned by of_parse_phandle(), of_node_put() need be called to decrease the refcount. Fixes: fb5319af6ad8 ("ASoC: SOF: imx: Add i.MX8ULP HW support") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220824013234.375738-2-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c926087eb38520b268515ae1a842db6db62554cc Author: Rik van Riel Date: Fri Aug 5 10:16:44 2022 -0400 x86/mm: Print likely CPU at segfault time In a large enough fleet of computers, it is common to have a few bad CPUs. Those can often be identified by seeing that some commonly run kernel code, which runs fine everywhere else, keeps crashing on the same CPU core on one particular bad system. However, the failure modes in CPUs that have gone bad over the years are often oddly specific, and the only bad behavior seen might be segfaults in programs like bash, python, or various system daemons that run fine everywhere else. Add a printk() to show_signal_msg() to print the CPU, core, and socket at segfault time. This is not perfect, since the task might get rescheduled on another CPU between when the fault hit, and when the message is printed, but in practice this has been good enough to help people identify several bad CPU cores. For example: segfault[1349]: segfault at 0 ip 000000000040113a sp 00007ffc6d32e360 error 4 in \ segfault[401000+1000] likely on CPU 0 (core 0, socket 0) This printk can be controlled through /proc/sys/debug/exception-trace. [ bp: Massage a bit, add "likely" to the printed line to denote that the CPU number is not always reliable. ] Signed-off-by: Rik van Riel Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220805101644.2e674553@imladris.surriel.com commit 0d0f034d069862c5f9e03c51d4c5f7394a71a5d1 Merge: c205cc7534a97 763015a794e15 Author: David S. Miller Date: Wed Aug 24 09:52:04 2022 +0100 Merge branch 'j7200-support' Siddharth Vadapalli says: ==================== J7200: CPSW5G: Add support for QSGMII mode to am65-cpsw driver Add support for QSGMII mode to am65-cpsw driver. Change log: v4-> v5: 1. Move ti,j7200-cpswxg-nuss compatible to the line above the ti,j721e-cpsw-nuss compatible. 2. Add allOf and move if-then statements within it to allow future if-then statements to be added easily. v3 -> v4: 1. Update bindings to disallow ports based on compatible, instead of adding a new if/then statement for the new compatible. 2. Add Else-If condition for RMII mode in the set of supported interfaces. Support for RMII mode is already present in the driver and I had missed out adding a condition for RMII mode in the previous patches. v2 -> v3: 1. In ti,k3-am654-cpsw-nuss.yaml, restrict if/then statement to port nodes. v1 -> v2: 1. Add new compatible for CPSW5G in ti,k3-am654-cpsw-nuss.yaml and extend properties for new compatible. 2. Add extra_modes member to struct am65_cpsw_pdata to be used for QSGMII mode by new compatible. 3. Add check for phylink supported modes to ensure that only one phy mode is advertised as supported. 4. Check if extra_modes supports QSGMII mode in am65_cpsw_nuss_mac_config() for register write. 5. Add check for assigning port->sgmii_base only when extra_modes is valid. v4: https://lore.kernel.org/r/20220816060139.111934-1-s-vadapalli@ti.com/ v3: https://lore.kernel.org/r/20220606110443.30362-1-s-vadapalli@ti.com/ v2: https://lore.kernel.org/r/20220602114558.6204-1-s-vadapalli@ti.com/ v1: https://lore.kernel.org/r/20220531113058.23708-1-s-vadapalli@ti.com/ ==================== Signed-off-by: David S. Miller commit 763015a794e1588aac1d3d01640a2d1a50c1900c Author: Siddharth Vadapalli Date: Mon Aug 22 12:31:25 2022 +0530 net: ethernet: ti: am65-cpsw: Move phy_set_mode_ext() to correct location In TI's J7200 SoC CPSW5G ports, each of the 4 ports can be configured as a QSGMII main or QSGMII-SUB port. This configuration is performed by phy-gmii-sel driver on invoking the phy_set_mode_ext() function. It is necessary for the QSGMII main port to be configured before any of the QSGMII-SUB interfaces are brought up. Currently, the QSGMII-SUB interfaces come up before the QSGMII main port is configured. Fix this by moving the call to phy_set_mode_ext() from am65_cpsw_nuss_ndo_slave_open() to am65_cpsw_nuss_init_slave_ports(), thereby ensuring that the QSGMII main port is configured before any of the QSGMII-SUB ports are brought up. Signed-off-by: Siddharth Vadapalli Signed-off-by: David S. Miller commit 37184fc1120ec594c992292ba9963edb69bf8be8 Author: Siddharth Vadapalli Date: Mon Aug 22 12:31:24 2022 +0530 net: ethernet: ti: am65-cpsw: Add support for J7200 CPSW5G CPSW5G in J7200 supports additional modes like QSGMII and SGMII. Add new compatible for J7200 and enable QSGMII mode in am65-cpsw driver. Signed-off-by: Siddharth Vadapalli Signed-off-by: David S. Miller commit d98495169d9f5f9373886abe921b6afd4748adfb Author: Siddharth Vadapalli Date: Mon Aug 22 12:31:23 2022 +0530 dt-bindings: net: ti: k3-am654-cpsw-nuss: Update bindings for J7200 CPSW5G Update bindings for TI K3 J7200 SoC which contains 5 ports (4 external ports) CPSW5G module and add compatible for it. Changes made: - Add new compatible ti,j7200-cpswxg-nuss for CPSW5G. - Extend pattern properties for new compatible. - Change maximum number of CPSW ports to 4 for new compatible. Signed-off-by: Siddharth Vadapalli Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit c205cc7534a97f2d6fbd2a23a94ed7c036c6e2aa Author: Menglong Dong Date: Sun Aug 21 13:18:58 2022 +0800 net: skb: prevent the split of kfree_skb_reason() by gcc Sometimes, gcc will optimize the function by spliting it to two or more functions. In this case, kfree_skb_reason() is splited to kfree_skb_reason and kfree_skb_reason.part.0. However, the function/tracepoint trace_kfree_skb() in it needs the return address of kfree_skb_reason(). This split makes the call chains becomes: kfree_skb_reason() -> kfree_skb_reason.part.0 -> trace_kfree_skb() which makes the return address that passed to trace_kfree_skb() be kfree_skb(). Therefore, introduce '__fix_address', which is the combination of '__noclone' and 'noinline', and apply it to kfree_skb_reason() to prevent to from being splited or made inline. (Is it better to simply apply '__noclone oninline' to kfree_skb_reason? I'm thinking maybe other functions have the same problems) Meanwhile, wrap 'skb_unref()' with 'unlikely()', as the compiler thinks it is likely return true and splits kfree_skb_reason(). Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit 3a9313d80e276cef87355305720a5e37e7ad4b46 Author: Jani Nikula Date: Fri Aug 19 15:02:47 2022 +0300 drm/i915: move has_dsc to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/0e2646e5fdaad2785678b4f140091b3d91b97f7e.1660910433.git.jani.nikula@intel.com commit e26700fcf961c99dd5d0a416c4814cdd69e6695d Author: Jani Nikula Date: Fri Aug 19 15:02:46 2022 +0300 drm/i915: move has_dmc to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/b8f69cd1b6114295826c1f88be27e867c91f7df4.1660910433.git.jani.nikula@intel.com commit 7578fc4d59e2e9ac5dd762019db77481511ec436 Author: Jani Nikula Date: Fri Aug 19 15:02:45 2022 +0300 drm/i915: move has_hdcp to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/b146250e02a4b2f086e7e587dd1742589e0e8fba.1660910433.git.jani.nikula@intel.com commit 00c6cbfd4e8a3279876babbac2f4a3f811d93b1f Author: Jani Nikula Date: Fri Aug 19 15:02:44 2022 +0300 drm/i915: move pipe_mask and cpu_transcoder_mask to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/bff2ea209031063cec38085518508394b064df4a.1660910433.git.jani.nikula@intel.com commit 488e29fedc1f2b771b37896da853bc4b493e4b3a Author: Jani Nikula Date: Fri Aug 19 15:02:43 2022 +0300 drm/i915: move platform_engine_mask to runtime info If it's modified runtime, it's runtime info. mock_gem_device() is the only one that modifies it. If that could be fixed, we wouldn't have to do this. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/1261406b373998c1a171ee9ed91f7f562826eba6.1660910433.git.jani.nikula@intel.com commit f81f30b305d2c73c23d60b12b104d3f191c5687d Author: Jani Nikula Date: Fri Aug 19 15:02:42 2022 +0300 drm/i915: move memory_regions to runtime info If it's modified runtime, it's runtime info. mock_gem_device() is the only one that modifies it. If that could be fixed, we wouldn't have to do this. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/12aace656c6a6380575767d7f6ccd73c12a627c3.1660910433.git.jani.nikula@intel.com commit 39a445bb2787aac5ed929587a2e13ea5dc4ed0a6 Author: Jani Nikula Date: Fri Aug 19 15:02:41 2022 +0300 drm/i915: move has_pooled_eu to runtime info If it's modified runtime, it's runtime info. Curiously, the flag was never initialized statically. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/db6d47abd87c74ae5f5be1cda62af13518c896fb.1660910433.git.jani.nikula@intel.com commit 268c67e5bd8611f0835839957e77f92bc589b7d0 Author: Jani Nikula Date: Fri Aug 19 15:02:40 2022 +0300 drm/i915: move ppgtt_type and ppgtt_size to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/9a9b94cb79a00229da5a564a16ea750a6d392ab6.1660910433.git.jani.nikula@intel.com commit 9d0bad177af9fd31ea14e580a34e34d02edd26a0 Author: Jani Nikula Date: Fri Aug 19 15:02:39 2022 +0300 drm/i915: move page_sizes to runtime info If it's modified runtime, it's runtime info. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/f6825dd97d2ba63aa395c30131c4b9e6ef32b0c8.1660910433.git.jani.nikula@intel.com commit e6f1964818cdf5ce64a05898e53b2d081c682819 Author: Jani Nikula Date: Fri Aug 19 15:02:38 2022 +0300 drm/i915: move fbc_mask to runtime info If it's modified runtime, it's runtime info. v2: Rebase on mtl fbc_mask Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/dd1898084b732ba265b212ddbc0fcdd826c11820.1660910433.git.jani.nikula@intel.com commit 43ba44a176a420137d5acd93a61fbeec4ce70191 Author: Jani Nikula Date: Fri Aug 19 15:02:37 2022 +0300 drm/i915: move graphics.ver and graphics.rel to runtime info If it's modified runtime, it's runtime info. mock_gem_device() is the only one that modifies them. If that could be fixed, we wouldn't have to do this. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/6bdf6cc0d67e3ed8042d2b92303351111147ba47.1660910433.git.jani.nikula@intel.com commit 2c93e7b7f545d2cca0e9e220ad7e6e1ac793ed39 Author: Jani Nikula Date: Fri Aug 19 15:02:36 2022 +0300 drm/i915: add initial runtime info into device info Add initial runtime info that we can copy to runtime info at i915 creation time. This lets us define the initial values for runtime info statically while making it possible to change them runtime. This will be the new home for the current "const" device info members that are modified runtime anyway. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/a77c6db2da20d401f47a0a5e87356b9b3f6292df.1660910433.git.jani.nikula@intel.com commit ea522b806162ca947427f8305310d3c8a3d42d7a Author: Shyam Sundar S K Date: Mon Aug 22 11:59:17 2022 +0530 platform/x86/amd/pmf: Fix clang unused variable warning variable 'mode' is used uninitialized whenever switch default is taken in sps.c which leads to the following clang warning. drivers/platform/x86/amd/pmf/sps.c:96:2: error: variable 'mode' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] default: ^~~~~~~ drivers/platform/x86/amd/pmf/sps.c:101:9: note: uninitialized use occurs here return mode; ^~~~ drivers/platform/x86/amd/pmf/sps.c:84:9: note: initialize the variable 'mode' to silence this warning u8 mode; ^ = '\0' 1 error generated. Fix it by returning -EOPNOTSUPP in default case and also change the return type of the function amd_pmf_get_pprof_modes() to keep it similar like other drivers which implement platform_profile. Fixes: 4c71ae414474 ("platform/x86/amd/pmf: Add support SPS PMF feature") Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220822062917.4061503-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c2f7edf81a82db20d91974ba2cf50a4c90c2dbe3 Author: Shyam Sundar S K Date: Fri Aug 19 14:08:58 2022 +0530 platform/x86/amd/pmf: Fix undefined reference to platform_profile Its reported that amd-pmf driver when built with config which does not have ACPI_PLATFORM_PROFILE set/enabled throws a undefined references to symbols used. ld: vmlinux.o: in function `amd_pmf_init_sps': drivers/platform/x86/amd/pmf/sps.c:132: undefined reference to `platform_profile_register' ld: vmlinux.o: in function `amd_pmf_deinit_sps': drivers/platform/x86/amd/pmf/sps.c:142: undefined reference to `platform_profile_remove' Fix it by adding a "select" to the Kconfig. Fixes: da5ce22df5fe ("platform/x86/amd/pmf: Add support for PMF core layer") Reported-by: Randy Dunlap Signed-off-by: Shyam Sundar S K Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20220819083858.3987590-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c7d3c8447b262d177e0e83154841d64cde521e70 Author: Jani Nikula Date: Fri Aug 19 15:02:35 2022 +0300 drm/i915: combine device info printing into one We'll be moving info between static and runtime info. Combine the printing functions into one to keep the output sensible and (mostly) unchanged in the process. Signed-off-by: Jani Nikula Reviewed-by: Maarten Lankhort Link: https://patchwork.freedesktop.org/patch/msgid/8579bfe0fcc5ee8390d4cded68a0167a618097f5.1660910433.git.jani.nikula@intel.com commit f0c70d41e4e8341651db7b75374bbff0b14dd310 Author: Jani Nikula Date: Fri Aug 19 15:02:34 2022 +0300 drm/i915/guc: remove runtime info printing from time stamp logging Commit 368d179adbac ("drm/i915/guc: Add GuC <-> kernel time stamp translation information") added intel_device_info_print_runtime() in the time info dump for no obvious reason or explanation in the commit message. It only logs the rawclk freq. Remove it. Cc: John Harrison Cc: Alan Previn Signed-off-by: Jani Nikula Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/b395ac4c909042f5daabf29959d8733993545aa2.1660910433.git.jani.nikula@intel.com commit 384c687fb4ad0774aaae58ed7f43cc738aa57a73 Merge: 18afcf90d8807 0db78532ff144 Author: Takashi Iwai Date: Wed Aug 24 08:03:46 2022 +0200 Merge branch 'topic/memalloc-cleanup' into for-next ALSA: Drop hackish GFP giveaway for CONTINUOUS pages This is a series of cleanup patches for dropping the current hackish way of passing the GFP_* flags for CONTINOUS and VMALLOC memory allocations. There are only three users for this legacy feature, and all of them seem superfluous. And, if any driver requires the memory restriction in future, it can now pass the proper device pointer for specifying the DMA mask. Link: https://lore.kernel.org/r/20220823115740.14123-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0db78532ff144a52757d636a26803099d78f431e Author: Takashi Iwai Date: Tue Aug 23 13:57:40 2022 +0200 ALSA: doc: Drop snd_dma_continuous_data() usages Update the documentation to follow the recent change of the memory allocation helpers. The macro snd_dma_continuous_data() is gone, and the driver needs to set up the coherent dma mask for allocating in the lower memory addresses, instead. Link: https://lore.kernel.org/r/20220823115740.14123-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit dd164fbfdc20ccf17be9186b1a5a4b2bc11b6a97 Author: Takashi Iwai Date: Tue Aug 23 13:57:39 2022 +0200 ALSA: memalloc: Drop special handling of GFP for CONTINUOUS allocation Now that all users of snd_dma_continuous_data() is gone, let's drop this ugly (and dangerous) way. After this commit, SNDRV_DMA_TYPE_CONTINUOUS may take the standard device pointer instead of the hacked pointer by the macro above, and the memalloc core refers to the coherent_dma_mask of the given device like other SNDRV_DMA_TYPE. It's still allowed to pass NULL there, and in that case, the allocation is performed always in the normal zone. For SNDRV_DMA_TYPE_VMALLOC, the device pointer is simply ignored. Link: https://lore.kernel.org/r/20220823115740.14123-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit 97557ec97a2473ffb9ca5d2e19d21e4807f43fb1 Author: Takashi Iwai Date: Tue Aug 23 13:57:38 2022 +0200 ASoC: Intel: sst: Switch to standard device pages ASoC Atom SST driver is using the continuous RAM pages with GFP_DMA flag for its PCM buffer, but this should work fine with the standard DMA pages. As a part of cleanup work, this patch replaces the buffer allocation to the standard device pages with SNDRV_DMA_TYPE_DEV. Link: https://lore.kernel.org/r/20220823115740.14123-4-tiwai@suse.de Signed-off-by: Takashi Iwai Reviewed-by: Cezary Rojewski commit 63bfc84672bbdfc19e54ce181d094fc1aab09e8c Author: Takashi Iwai Date: Tue Aug 23 13:57:37 2022 +0200 ALSA: pdaudiocf: Drop superfluous GFP setup The extra setup with GFP_DMA32 is superfluous for this driver. The whole operation is a simple copy loop, and there is no memory address restriction at all. Drop the useless GFP setup. Link: https://lore.kernel.org/r/20220823115740.14123-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit a5ed0c547d50d30a60d67b0911b4ec2c85c54310 Author: Takashi Iwai Date: Tue Aug 23 13:57:36 2022 +0200 ALSA: vx: Drop superfluous GFP setup The extra setup with GFP_DMA32 is superfluous for this driver. The whole operation is a simple copy loop, and there is no memory address restriction at all. Drop the useless GFP setup. Link: https://lore.kernel.org/r/20220823115740.14123-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 3d67e7e236adb4965ff9834bb7125686ecf9654a Author: Wenpeng Liang Date: Mon Aug 22 18:44:55 2022 +0800 RDMA/hns: Support MR's restrack raw ops for hns driver The MR raw restrack attributes come from the queue context maintained by the ROCEE. For example: $ rdma res show mr dev hns_0 mrn 6 -dd -jp -r [ { "ifindex": 4, "ifname": "hns_0", "data": [ 1,0,0,0,2,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,32,0,0,0,2,0,0,0, 2,0,0,0,0,0,0,0 ] } ] Link: https://lore.kernel.org/r/20220822104455.2311053-8-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit e8bf17d58a4db4b4f38617925414097f12e0d509 Author: Evan Green Date: Mon Aug 22 14:40:40 2022 -0700 platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs In modern Chromebooks, the embedded controller has a mechanism where it will watch a hardware-controlled line that toggles in suspend, and wake the system up if an expected sleep transition didn't occur. This can be very useful for detecting power management issues where the system appears to suspend, but doesn't actually reach its lowest expected power states. Sometimes it's useful in debug and test scenarios to be able to control the duration of that timeout, or even disable the EC timeout mechanism altogether. Add a debugfs control to set the timeout to values other than the EC-defined default, for more convenient debug and development iteration. Signed-off-by: Evan Green Reviewed-by: Prashant Malani Reviewed-by: Stephen Boyd Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220822144026.v3.1.Idd188ff3f9caddebc17ac357a13005f93333c21f@changeid [tzungbi: fix one nit in Documentation/ABI/testing/debugfs-cros-ec.] Signed-off-by: Tzung-Bi Shih commit 75569a03369bfee7ee226c04915febf025585b5f Author: Claudiu Beznea Date: Thu Jun 30 18:12:05 2022 +0300 clk: do not initialize ret There is no need to initialize ret. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220630151205.3935560-2-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 79806d338829b2bf903480428d8ce5aab8e2d24b Author: Claudiu Beznea Date: Thu Jun 30 18:12:04 2022 +0300 clk: remove extra empty line Remove extra empty line. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220630151205.3935560-1-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit fa2bc96259098a3bc1f32a10bfe1139c0f742256 Merge: 3de1484bd31dd 60ddc78d16363 Author: Jakub Kicinski Date: Tue Aug 23 17:43:30 2022 -0700 Merge branch 'add-interface-mode-select-and-rmii' Wei Fang says: ==================== add interface mode select and RMII From: Wei Fang The patches add the below feature support for both TJA1100 and TJA1101 PHYs cards: - Add MII and RMII mode support. - Add REF_CLK input/output support for RMII mode. ==================== Link: https://lore.kernel.org/r/20220822015949.1569969-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski commit 60ddc78d163633f7e5eb7f588face99d47d6cd7e Author: Wei Fang Date: Mon Aug 22 09:59:49 2022 +0800 net: phy: tja11xx: add interface mode and RMII REF_CLK support Add below features support for both TJA1100 and TJA1101 cards: - Add MII and RMII mode support. - Add REF_CLK input/output support for RMII mode. Signed-off-by: Wei Fang Signed-off-by: Jakub Kicinski commit 52b2fe4535ad0d5c31055a562f5ac8290a28e64b Author: Wei Fang Date: Mon Aug 22 09:59:48 2022 +0800 dt-bindings: net: tja11xx: add nxp,refclk_in property TJA110x REF_CLK can be configured as interface reference clock intput or output when the RMII mode enabled. This patch add the property to make the REF_CLK can be configurable. Signed-off-by: Wei Fang Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit 3de1484bd31dd41ac0a727b95ebe2a02b0b39b4a Merge: 510156a7f0cb0 706ddb7821be8 Author: Jakub Kicinski Date: Tue Aug 23 17:22:03 2022 -0700 Merge branch 'mlxsw-introduce-modular-system-support-by-minimal-driver' Petr Machata says: ==================== mlxsw: Introduce modular system support by minimal driver Vadim Pasternak writes: This patchset adds line cards support in mlxsw_minimal, which is used for monitoring purposes on BMC systems. The BMC is connected to the ASIC over I2C bus, unlike the host CPU that is connected to the ASIC via PCI bus. The BMC system needs to be notified whenever line cards become active or inactive, so that, for example, netdevs will be registered / unregistered by mlxsw_minimal. However, traps cannot be generated towards the BMC over the I2C bus. To overcome that, the I2C bus driver (i.e., mlxsw_i2c) registers an handler for an IRQ that is fired upon specific system wide changes, like line card activation and deactivation. The generated event is handled by mlxsw_core, which checks whether anything changed in the state of available line cards. If a line card becomes active or inactive, interested parties such as mlxsw_minimal are notified via their registered line card event callback. Patch set overview: Patches #1 is preparations. Patches #2-#3 extend mlxsw_core with an infrastructure to handle the previously mentioned system events. Patch #4 extends the I2C bus driver to register an handler for the IRQ fired upon specific system wide changes. Patches #5-#8 gradually add line cards support in mlxsw_minimal by dynamically registering / unregistering netdevs for ports found on line cards, whenever a line card becomes active / inactive. ==================== Link: https://lore.kernel.org/r/cover.1661093502.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 706ddb7821be8c95f07de7e540d824e5c2267001 Author: Vadim Pasternak Date: Sun Aug 21 18:20:18 2022 +0200 mlxsw: minimal: Extend to support line card dynamic operations Implement line card operation callbacks got_active() / got_inactive(). The purpose of these callback to create / remove line card ports after line card is getting active / inactive. Implement line ports_remove_selected() callback to support line card un-provisioning flow through 'devlink'. Add line card operation registration and de-registration APIs. Add module offset for line card. Offset for main board iz zero. For line card in slot #n offset is calculated as (#n - 1) multiplied by maximum modules number. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 01328e23a476a47179b07125eabac439bc1d5fd3 Author: Vadim Pasternak Date: Sun Aug 21 18:20:17 2022 +0200 mlxsw: minimal: Extend module to port mapping with slot index The interfaces for ports found on line card are created and removed dynamically after line card is getting active or inactive. Introduce per line card array with module to port mapping. For each port get 'slot_index' through PMLP register and set port mapping for the relevant [slot_index][module] entry. Split module and port allocation into separate routines. Split per line card port creation and removing into separate routines. Motivation to re-use these routines for line card operations. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 9421c8b89dbbd3b164ac09f84f1bc8e83232ebb4 Author: Vadim Pasternak Date: Sun Aug 21 18:20:16 2022 +0200 mlxsw: minimal: Move ports allocation to separate routine Perform ports allocation in a separate routine. Motivation is to re-use this routine for ports found on line cards. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit c7ea08badd5f462c285d55e5d09774665441a2ab Author: Vadim Pasternak Date: Sun Aug 21 18:20:15 2022 +0200 mlxsw: minimal: Extend APIs with slot index for modular system support Add 'slot_index' field to port structure. Replace zero slot_index argument with 'slot_index' in 'ethtool' related APIs. Add 'slot_index' argument to port initialization and de-initialization related APIs. Motivation is to prepare minimal driver for modular system support. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 33fa6909a263d70e01ac0cd1bd11ddc15d05f97b Author: Vadim Pasternak Date: Sun Aug 21 18:20:14 2022 +0200 mlxsw: i2c: Add support for system interrupt handling Extend i2c bus driver with interrupt handler to support system specific hotplug events, related to line card state change. Provide system IRQ line for interrupt handler. IRQ line Id could be provided through the platform data if available, or could be set to the default value. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 508c29bf15ea5e106b0b3e84076cd5bd90a11b48 Author: Vadim Pasternak Date: Sun Aug 21 18:20:13 2022 +0200 mlxsw: core_linecards: Register a system event handler Add line card system event handler. Register it with core. It is triggered by system interrupts raised from chassis programmable logic devices to CPU. The purpose is to handle line card state changes over I2C bus. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 2ab4e70966a2ed5c67b7b04aba1aeb200b0ad82c Author: Vadim Pasternak Date: Sun Aug 21 18:20:12 2022 +0200 mlxsw: core: Add registration APIs for system event handler The purpose of system event handler is to handle system interrupts. Such interrupts are raised to CPU from system programmable logic devices, upon specific system wide changes, like line card activation and deactivation. The purpose is to create an alternative to trap mechanism, which delivers these events to driver over PCI bus, but not available for the driver working over I2C bus. Mechanism is system dependent and applicable only for the systems equipped with programmable devices with custom logic. Add APIs for event handler registration and un-registration and API which should be invoked from the registered callbacks when system interrupt is raised to CPU. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 4be4779b6ccd19728040b8bc8db5887de08f29cc Author: Vadim Pasternak Date: Sun Aug 21 18:20:11 2022 +0200 mlxsw: core_linecards: Separate line card init and fini flow Currently, each line card is initialized using the following steps: 1. Initializing its various fields (e.g., slot index). 2. Creating the corresponding devlink object. 3. Enabling events (i.e., traps) for changes in line card status. 4. Querying and processing line card status. Unlike traps, the IRQ that notifies the CPU about line card status changes cannot be enabled / disabled on a per line card basis. If a handler is registered before the line cards are initialized, the handler risks accessing uninitialized memory. On the other hand, if the handler is registered after initialization, we risk missing events. For example, in step 4, the driver might see that a line card is in ready state and will tell the device to enable it. When enablement is done, the line card will be activated and the IRQ will be triggered. Since a handler was not registered, the event will be missed. Solve this by splitting the initialization sequence into two steps (1-2 and 3-4). In a subsequent patch, the handler will be registered between both steps. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 5679ff2f138f77b281c468959dc5022cc524d400 Author: Kumar Kartikeya Dwivedi Date: Tue Aug 23 03:31:17 2022 +0200 bpf: Move bpf_loop and bpf_for_each_map_elem under CAP_BPF They would require func_info which needs prog BTF anyway. Loading BTF and setting the prog btf_fd while loading the prog indirectly requires CAP_BPF, so just to reduce confusion, move both these helpers taking callback under bpf_capable() protection as well, since they cannot be used without CAP_BPF. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220823013117.24916-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 510156a7f0cb0c3e86099f85f0ccbb6b2df6b06f Author: Jakub Kicinski Date: Fri Aug 19 13:02:21 2022 -0700 docs: netlink: basic introduction to Netlink Provide a bit of a brain dump of netlink related information as documentation. Hopefully this will be useful to people trying to navigate implementing YAML based parsing in languages we won't be able to help with. I started writing this doc while trying to figure out what it'd take to widen the applicability of YAML to good old rtnl, but the doc grew beyond that as it usually happens. In all honesty a lot of this information is new to me as I usually follow the "copy an existing example, drink to forget" process of writing netlink user space, so reviews will be much appreciated. Reviewed-by: Jacob Keller Acked-by: Jonathan Corbet Link: https://lore.kernel.org/r/20220819200221.422801-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 30b6055428a90cc52d4add164df12b94ab07c3fd Author: Jakub Kicinski Date: Fri Aug 19 13:02:20 2022 -0700 net: improve and fix netlink kdoc Subsequent patch will render the kdoc from include/uapi/linux/netlink.h into Documentation. We need to fix the warnings. While at it move the comments on struct nlmsghdr to a proper kdoc comment. Link: https://lore.kernel.org/r/20220819200221.422801-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit f52c8947347d43546581ab1bf8fa19867b664a8c Merge: 92ec1cc3784a2 e7215f574079f Author: Alexei Starovoitov Date: Tue Aug 23 16:08:22 2022 -0700 Merge branch 'bpf: expose bpf_{g,s}et_retval to more cgroup hooks' Stanislav Fomichev says: ==================== Apparently, only a small subset of cgroup hooks actually falls back to cgroup_base_func_proto. This leads to unexpected result where not all cgroup helpers have bpf_{g,s}et_retval. It's getting harder and harder to manage which helpers are exported to which hooks. We now have the following call chains: - cg_skb_func_proto - sk_filter_func_proto - bpf_sk_base_func_proto - bpf_base_func_proto So by looking at cg_skb_func_proto it's pretty hard to understand what's going on. For cgroup helpers, I'm proposing we do the following instead: func_proto = cgroup_common_func_proto(); if (func_proto) return func_proto; /* optional, if hook has 'current' */ func_proto = cgroup_current_func_proto(); if (func_proto) return func_proto; ... switch (func_id) { /* hook specific helpers */ case BPF_FUNC_hook_specific_helper: return &xyz; default: /* always fall back to plain bpf_base_func_proto */ bpf_base_func_proto(func_id); } If this turns out more workable, we can follow up with converting the rest to the same pattern. v5: - remove net/cls_cgroup.h include from patch 1/5 (Martin) - move endif changes from patch 1/5 to 3/5 (Martin) - don't define __weak protos, the ones in core.c suffice (Martin) v4: - don't touch existing helper.c helpers (Martin) - drop unneeded CONFIG_CGROUP_BPF in bpf_lsm_func_proto (Martin) v3: - expose strtol/strtoul everywhere (Martin) - move helpers declarations from bpf.h to bpf-cgroup.h (Martin) - revise bpf_{g,s}et_retval documentation (Martin) - don't expose bpf_{g,s}et_retval to cg_skb hooks (Martin) v2: - move everything into kernel/bpf/cgroup.c instead (Martin) - use cgroup_common_func_proto in lsm (Martin) ==================== Signed-off-by: Alexei Starovoitov commit e7215f574079ffb138258e8ebfa3f2bf5a4a1238 Author: Stanislav Fomichev Date: Tue Aug 23 15:25:55 2022 -0700 selftests/bpf: Make sure bpf_{g,s}et_retval is exposed everywhere For each hook, have a simple bpf_set_retval(bpf_get_retval) program and make sure it loads for the hooks we want. The exceptions are the hooks which don't propagate the error to the callers: - sockops - recvmsg - getpeername - getsockname - cg_skb ingress and egress Acked-by: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20220823222555.523590-6-sdf@google.com Signed-off-by: Alexei Starovoitov commit 2172fb8007eaafbef18563afb6c1ae5a976bf787 Author: Stanislav Fomichev Date: Tue Aug 23 15:25:54 2022 -0700 bpf: update bpf_{g,s}et_retval documentation * replace 'syscall' with 'upper layers', still mention that it's being exported via syscall errno * describe what happens in set_retval(-EPERM) + return 1 * describe what happens with bind's 'return 3' Acked-by: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20220823222555.523590-5-sdf@google.com Signed-off-by: Alexei Starovoitov commit 8a67f2de9b1dc3cf8b75b4bf589efb1f08e3e9b8 Author: Stanislav Fomichev Date: Tue Aug 23 15:25:53 2022 -0700 bpf: expose bpf_strtol and bpf_strtoul to all program types bpf_strncmp is already exposed everywhere. The motivation is to keep those helpers in kernel/bpf/helpers.c. Otherwise it's tempting to move them under kernel/bpf/cgroup.c because they are currently only used by sysctl prog types. Suggested-by: Martin KaFai Lau Acked-by: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20220823222555.523590-4-sdf@google.com Signed-off-by: Alexei Starovoitov commit bed89185af0de0d417e29ca1798df50f161b0231 Author: Stanislav Fomichev Date: Tue Aug 23 15:25:52 2022 -0700 bpf: Use cgroup_{common,current}_func_proto in more hooks The following hooks are per-cgroup hooks but they are not using cgroup_{common,current}_func_proto, fix it: * BPF_PROG_TYPE_CGROUP_SKB (cg_skb) * BPF_PROG_TYPE_CGROUP_SOCK_ADDR (cg_sock_addr) * BPF_PROG_TYPE_CGROUP_SOCK (cg_sock) * BPF_PROG_TYPE_LSM+BPF_LSM_CGROUP Also: * move common func_proto's into cgroup func_proto handlers * make sure bpf_{g,s}et_retval are not accessible from recvmsg, getpeername and getsockname (return/errno is ignored in these places) * as a side effect, expose get_current_pid_tgid, get_current_comm_proto, get_current_ancestor_cgroup_id, get_cgroup_classid to more cgroup hooks Acked-by: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20220823222555.523590-3-sdf@google.com Signed-off-by: Alexei Starovoitov commit dea6a4e17013382b20717664ebf3d7cc405e0952 Author: Stanislav Fomichev Date: Tue Aug 23 15:25:51 2022 -0700 bpf: Introduce cgroup_{common,current}_func_proto Split cgroup_base_func_proto into the following: * cgroup_common_func_proto - common helpers for all cgroup hooks * cgroup_current_func_proto - common helpers for all cgroup hooks running in the process context (== have meaningful 'current'). Move bpf_{g,s}et_retval and other cgroup-related helpers into kernel/bpf/cgroup.c so they closer to where they are being used. Signed-off-by: Stanislav Fomichev Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220823222555.523590-2-sdf@google.com Signed-off-by: Alexei Starovoitov commit 6c2c782fa0131a091a52bd0b75083fb24c28b6d3 Author: Sergei Antonov Date: Sun Aug 21 19:08:44 2022 +0300 net: ftmac100: set max_mtu to allow DSA overhead setting In case ftmac100 is used with a DSA switch, Linux wants to set MTU to 1504 to accommodate for DSA overhead. With the default max_mtu it leads to the error message: ftmac100 92000000.mac eth0: error -22 setting MTU to 1504 to include DSA overhead ftmac100 supports packet length 1518 (MAX_PKT_SIZE constant), so it is safe to report it in max_mtu. Signed-off-by: Sergei Antonov Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220821160844.474277-1-saproj@gmail.com Signed-off-by: Jakub Kicinski commit 7d3ac70d82080f7a934402d66c5238e1d99be412 Author: Nathan Chancellor Date: Tue Aug 23 08:19:40 2022 -0700 ASoC: codes: src4xxx: Avoid clang -Wsometimes-uninitialized in src4xxx_hw_params() Clang warns: sound/soc/codecs/src4xxx.c:280:3: error: variable 'd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] default: ^~~~~~~ sound/soc/codecs/src4xxx.c:298:59: note: uninitialized use occurs here ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_11, d); ^ sound/soc/codecs/src4xxx.c:223:20: note: initialize the variable 'd' to silence this warning int val, pj, jd, d; ^ = 0 sound/soc/codecs/src4xxx.c:280:3: error: variable 'jd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] default: ^~~~~~~ sound/soc/codecs/src4xxx.c:293:59: note: uninitialized use occurs here ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_10, jd); ^~ sound/soc/codecs/src4xxx.c:223:17: note: initialize the variable 'jd' to silence this warning int val, pj, jd, d; ^ = 0 sound/soc/codecs/src4xxx.c:280:3: error: variable 'pj' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] default: ^~~~~~~ sound/soc/codecs/src4xxx.c:288:59: note: uninitialized use occurs here ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_0F, pj); ^~ sound/soc/codecs/src4xxx.c:223:13: note: initialize the variable 'pj' to silence this warning int val, pj, jd, d; ^ = 0 3 errors generated. The datasheet does not have any default values for these regmap values so pick some arbitrary values and print to the user that this is the case to silence the warnings. Link: https://github.com/ClangBuiltLinux/linux/issues/1691 Reported-by: kernel test robot Reported-by: "Sudip Mukherjee (Codethink)" Suggested-by: Matt Flax Signed-off-by: Nathan Chancellor Reviewed-by: Matt Flax Link: https://lore.kernel.org/r/20220823151939.2493697-1-nathan@kernel.org Signed-off-by: Mark Brown commit d9270292e6174551d3b02a49b310ddf56c0225fe Merge: 8622817ccb3f5 95b5f3ef4c0cf Author: Mark Brown Date: Tue Aug 23 22:14:44 2022 +0100 PM6125 regulator support Merge series from Iskren Chernev : This patch series adds SPMI and SMD regulator support for the PM6125 found on SM4250/SM6115 SoCs from QCom. This code has been tested on: * OnePlus Nord N100 (oneplus,billie2, SoC sm4250) * Redmi 9T (redmi,lemon, SoC sm6115) The main source used for this change is qpnp pm6125 support patch from caf [1]: [1]: https://source.codeaurora.org/quic/la/kernel/msm-5.4/commit/?h=kernel.lnx.5.4.r1-rel&id=d1220daeffaa440ffff0a8c47322eb0033bf54f5 v3: https://lkml.org/lkml/2022/7/31/303 v2: https://lkml.org/lkml/2022/7/26/885 v1: https://lkml.org/lkml/2021/8/28/144 Changes from v3: - fix compilation issue reported by kernel test robot - reorder HFSMPS/LDO+FTSMPS patches - add new slew-rate computation for HFSMPS - add proper pull-down support for new regs - name new regs/vals after HFSMPS instead of FTSMPS - address indentation/newline issues reported by Krzysztof - improve commit messages on SPMI/RPM related patches Changes from v2: - split spmi new regulator support in 2 patches - FTS and LDOs now have set_load and set_pull_down ops - add better commit messages on spmi patches - fix sob header order - fix tested device info (Redmi 9T, NOT Xiaomi 9T) - improve formatting in spmi binding docs - sort alphabetically in smd binding docs - sort alphabetically spmi pmics - sort alphabetically smd pmics Changes from v1: - add dt-bindings - split SPMI patch into new reg types and the new PMIC - add correct supply mapping Iskren Chernev (13): dt-bindings: regulator: qcom_spmi: Improve formatting of if-then blocks dt-bindings: regulator: qcom_spmi: Document PM6125 PMIC dt-bindings: regulator: qcom_smd: Sort compatibles alphabetically dt-bindings: regulator: qcom_smd: Document PM6125 PMIC regulator: qcom_spmi: Add support for HFSMPS regulator type regulator: qcom_spmi: Add support for LDO_510 and FTSMPS regulator: qcom_spmi: Sort pmics alphabetically (part 1) regulator: qcom_spmi: Sort pmics alphabetically (part 2) regulator: qcom_spmi: Add PM6125 PMIC support regulator: qcom_smd: Sort pmics alphabetically (part 1) regulator: qcom_smd: Sort pmics alphabetically (part 2) regulator: qcom_smd: Sort pmics alphabetically (part 3) regulator: qcom_smd: Add PM6125 RPM regulators .../regulator/qcom,smd-rpm-regulator.yaml | 26 +- .../regulator/qcom,spmi-regulator.yaml | 32 ++ drivers/regulator/qcom_smd-regulator.c | 400 ++++++++++-------- drivers/regulator/qcom_spmi-regulator.c | 378 ++++++++++++----- 4 files changed, 551 insertions(+), 285 deletions(-) -- 2.37.1 commit 4d07b0bc403403438d9cf88450506240c5faf92f Author: Lyude Paul Date: Wed Aug 17 15:38:46 2022 -0400 drm/display/dp_mst: Move all payload info into the atomic state Now that we've finally gotten rid of the non-atomic MST users leftover in the kernel, we can finally get rid of all of the legacy payload code we have and move as much as possible into the MST atomic state structs. The main purpose of this is to make the MST code a lot less confusing to work on, as there's a lot of duplicated logic that doesn't really need to be here. As well, this should make introducing features like fallback link retraining and DSC support far easier. Since the old payload code was pretty gnarly and there's a Lot of changes here, I expect this might be a bit difficult to review. So to make things as easy as possible for reviewers, I'll sum up how both the old and new code worked here (it took me a while to figure this out too!). The old MST code basically worked by maintaining two different payload tables - proposed_vcpis, and payloads. proposed_vcpis would hold the modified payload we wanted to push to the topology, while payloads held the payload table that was currently programmed in hardware. Modifications to proposed_vcpis would be handled through drm_dp_allocate_vcpi(), drm_dp_mst_deallocate_vcpi(), and drm_dp_mst_reset_vcpi_slots(). Then, they would be pushed via drm_dp_mst_update_payload_step1() and drm_dp_mst_update_payload_step2(). Furthermore, it's important to note how adding and removing VC payloads actually worked with drm_dp_mst_update_payload_step1(). When a VC payload is removed from the VC table, all VC payloads which come after the removed VC payload's slots must have their time slots shifted towards the start of the table. The old code handles this by looping through the entire payload table and recomputing the start slot for every payload in the topology from scratch. While very much overkill, this ends up doing the right thing because we always order the VCPIs for payloads from first to last starting timeslot. It's important to also note that drm_dp_mst_update_payload_step2() isn't actually limited to updating a single payload - the driver can use it to queue up multiple payload changes so that as many of them can be sent as possible before waiting for the ACT. This is -technically- not against spec, but as Wayne Lin has pointed out it's not consistently implemented correctly in hubs - so it might as well be. drm_dp_mst_update_payload_step2() is pretty self explanatory and basically the same between the old and new code, save for the fact we don't have a second step for deleting payloads anymore -and thus rename it to drm_dp_mst_add_payload_step2(). The new payload code stores all of the current payload info within the MST atomic state and computes as much of the state as possible ahead of time. This has the one exception of the starting timeslots for payloads, which can't be determined at atomic check time since the starting time slots will vary depending on what order CRTCs are enabled in the atomic state - which varies from driver to driver. These are still stored in the atomic MST state, but are only copied from the old MST state during atomic commit time. Likewise, this is when new start slots are determined. Adding/removing payloads now works much more closely to how things are described in the spec. When we delete a payload, we loop through the current list of payloads and update the start slots for any payloads whose time slots came after the payload we just deleted. Determining the starting time slots for new payloads being added is done by simply keeping track of where the end of the VC table is in drm_dp_mst_topology_mgr->next_start_slot. Additionally, it's worth noting that we no longer have a single update_payload() function. Instead, we now have drm_dp_mst_add_payload_step1|2() and drm_dp_mst_remove_payload(). As such, it's now left it up to the driver to figure out when to add or remove payloads. The driver already knows when it's disabling/enabling CRTCs, so it also already knows when payloads should be added or removed. Changes since v1: * Refactor around all of the completely dead code changes that are happening in amdgpu for some reason when they really shouldn't even be there in the first place… :\ * Remove mention of sending one ACT per series of payload updates. As Wayne Lin pointed out, there are apparently hubs on the market that don't work correctly with this scheme and require a separate ACT per payload update. * Fix accidental drop of mst_mgr.lock - Wayne Lin * Remove mentions of allowing multiple ACT updates per payload change, mention that this is a result of vendors not consistently supporting this part of the spec and requiring a unique ACT for each payload change. * Get rid of reference to drm_dp_mst_port in DC - turns out I just got myself confused by DC and we don't actually need this. Changes since v2: * Get rid of fix for not sending payload deallocations if ddps=0 and just go back to wayne's fix Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-18-lyude@redhat.com commit 01ad1d9c2888d51f2fb5b5ac88af8bd47d76937e Author: Lyude Paul Date: Wed Aug 17 15:38:45 2022 -0400 drm/radeon: Drop legacy MST support Right now, radeon is technically the only non-atomic driver still making use of the MST helpers - and thus the final user of all of the legacy MST helpers. Originally I was going to look into seeing if we could move legacy MST into the radeon driver itself, however: * SI and CIK both can use amdgpu, which still supports MST * It currently doesn't work according to my own testing. I'm sure with some troubleshooting we could likely fix it, but that brings me to point #2: * It was never actually enabled by default, and is still marked as experimental in the module parameter description * If people were using it, someone probably would have probably seen a bug report about how it is currently not functional by now. That certainly doesn't appear to be the case, since before getting access to my own hardware I had to go out of my way to try finding someone to help test whether this legacy MST code even works - even amongst AMD employees. * Getting rid of this code and only having atomic versions of the MST helpers to maintain is likely going to be a lot easier in the long run, and will make it a lot easier for others contributing to this code to follow along with what's happening. FWIW - if anyone still wants this code to be in the tree and has a good idea of how to support this without needing to maintain the legacy MST helpers (trying to move them would probably be acceptable), I'm happy to suggestions. But my hope is that we can just drop this code and forget about it. I've already run this idea by Harry Wentland and Alex Deucher a few times as well. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Alex Deucher Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-17-lyude@redhat.com commit 6366fc70deb9aaf1db4a46916af14fa3c5a115ab Author: Lyude Paul Date: Wed Aug 17 15:38:44 2022 -0400 drm/display/dp_mst: Maintain time slot allocations when deleting payloads Currently, we set drm_dp_atomic_payload->time_slots to 0 in order to indicate that we're about to delete a payload in the current atomic state. Since we're going to be dropping all of the legacy code for handling the payload table however, we need to be able to ensure that we still keep track of the current time slot allocations for each payload so we can reuse this info when asking the root MST hub to delete payloads. We'll also be using it to recalculate the start slots of each VC. So, let's keep track of the intent of a payload in drm_dp_atomic_payload by adding ->delete, which we set whenever we're planning on deleting a payload during the current atomic commit. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-16-lyude@redhat.com commit 2482fceed27b6951287e92e9f733533a657c2923 Author: Lyude Paul Date: Wed Aug 17 15:38:43 2022 -0400 drm/display/dp_mst: Drop all ports from topology on CSNs before queueing link address work We want to start cutting down on all of the places that we use port validation, so that ports may be removed from the topology as quickly as possible to minimize the number of errors we run into as a result of being out of sync with the current topology status. This isn't a very typical scenario and I don't think I've ever even run into it - but since the next commit is going to make some changes to payload updates depending on their hotplug status I think it's a probably good idea to take precautions. Let's do this with CSNs by moving some code around so that we only queue link address probing work at the end of handling all CSNs - allowing us to make sure we drop as many topology references as we can beforehand. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-15-lyude@redhat.com commit a76eb4297f90301fa9e4c888fb06749ef1be1c86 Author: Lyude Paul Date: Wed Aug 17 15:38:42 2022 -0400 drm/display/dp_mst: Add helpers for serializing SST <-> MST transitions There's another kind of situation where we could potentially race with nonblocking modesets and MST, especially if we were to only use the locking provided by atomic modesetting: * Display 1 begins as enabled on DP-1 in SST mode * Display 1 switches to MST mode, exposes one sink in MST mode * Userspace does non-blocking modeset to disable the SST display * Userspace does non-blocking modeset to enable the MST display with a different CRTC, but the SST display hasn't been fully taken down yet * Execution order between the last two commits isn't guaranteed since they share no drm resources We can fix this however, by ensuring that we always pull in the atomic topology state whenever a connector capable of driving an MST display performs its atomic check - and then tracking CRTC commits happening on the SST connector in the MST topology state. So, let's add some simple helpers for doing that and hook them up in various drivers. v2: * Use intel_dp_mst_source_support() to check for MST support in i915, fixes CI failures Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-14-lyude@redhat.com commit 21167510605470d53c94e7162ae886c8fb67d93d Author: Lyude Paul Date: Wed Aug 17 15:38:41 2022 -0400 drm/nouveau/kms: Pull mst state in for all modesets Since we're going to be relying on atomic locking for payloads now (and the MST mgr needs to track CRTCs), pull in the topology state for all modesets in nv50_msto_atomic_check(). Signed-off-by: Lyude Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-13-lyude@redhat.com commit 11d2738940ebeb3fd3abc78d44684d5edb400a6e Author: Lyude Paul Date: Wed Aug 17 15:38:40 2022 -0400 drm/nouveau/kms: Cache DP encoders in nouveau_connector Post-NV50, the only kind of encoder you'll find for DP connectors on Nvidia GPUs are SORs (serial output resources). Because SORs have fixed associations with their connectors, we can correctly assume that any DP connector on a nvidia GPU will have exactly one SOR encoder routed to it for DisplayPort. Since we're going to need to be able to retrieve this fixed SOR DP encoder much more often as a result of hooking up MST helpers for tracking SST<->MST transitions in atomic states, let's simply cache this encoder in nouveau_connector for any DP connectors on the system to avoid looking it up each time. This isn't safe for NV50 since PIORs then come into play, however there's no code pre-NV50 that would need to look this up anyhow - so it's not really an issue. Signed-off-by: Lyude Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-12-lyude@redhat.com commit 083351e963865a7eab55158042b81b8f8c0316b6 Author: Lyude Paul Date: Wed Aug 17 15:38:39 2022 -0400 drm/display/dp_mst: Fix modeset tracking in drm_dp_atomic_release_vcpi_slots() Currently with the MST helpers we avoid releasing payloads _and_ avoid pulling in the MST state if there aren't any actual payload changes. While we want to keep the first step, we need to now make sure that we're always pulling in the MST state on all modesets that can modify payloads - even if the resulting payloads in the atomic state are identical to the previous ones. This is mainly to make it so that if a CRTC is still assigned to a connector but is set to DPMS off, the CRTC still holds it's payload allocation in the atomic state and still appropriately pulls in the MST state for commit tracking. Otherwise, we'll occasionally forget to update MST payloads from changes caused by non-atomic DPMS changes. Doing this also allows us to track bandwidth limitations in a state correctly even between DPMS changes, so that there's no chance of a simple ->active change being rejected by the atomic check. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-11-lyude@redhat.com commit ffac9721939dca3f0ac7bfa90f3dc484b19c2706 Author: Lyude Paul Date: Wed Aug 17 15:38:38 2022 -0400 drm/display/dp_mst: Don't open code modeset checks for releasing time slots I'm not sure why, but at the time I originally wrote the find/release time slot helpers I thought we should avoid keeping modeset tracking out of the MST helpers. In retrospect though there's no actual good reason to do this, and the logic has ended up being identical across all the drivers using the helpers. Also, it needs to be fixed anyway so we don't break things when going atomic-only with MST. So, let's just move this code into drm_dp_atomic_release_time_slots() and stop open coding it. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-10-lyude@redhat.com commit a5c2c0d164e96d24f73faffcd3b7bbb607e701a9 Author: Lyude Paul Date: Wed Aug 17 15:38:37 2022 -0400 drm/display/dp_mst: Add nonblocking helpers for DP MST As Daniel Vetter pointed out, if we only use the atomic modesetting locks with MST it's technically possible for a driver with non-blocking modesets to race when it comes to MST displays - as we make the mistake of not doing our own CRTC commit tracking in the topology_state object. This could potentially cause problems if something like this happens: * User starts non-blocking commit to disable CRTC-1 on MST topology 1 * User starts non-blocking commit to enable CRTC-2 on MST topology 1 There's no guarantee here that the commit for disabling CRTC-2 will only occur after CRTC-1 has finished, since neither commit shares a CRTC - only the private modesetting object for MST. Keep in mind this likely isn't a problem for blocking modesets, only non-blocking. So, begin fixing this by keeping track of which CRTCs on a topology have changed by keeping track of which CRTCs we release or allocate timeslots on. As well, add some helpers for: * Setting up the drm_crtc_commit structs in the ->commit_setup hook * Waiting for any CRTC dependencies from the previous topology state v2: * Use drm_dp_mst_atomic_setup_commit() directly - Jani Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-9-lyude@redhat.com commit 0b4e477e08a14ef852d5a633cee10e4187730005 Author: Lyude Paul Date: Wed Aug 17 15:38:36 2022 -0400 drm/display/dp_mst: Add helper for finding payloads in atomic MST state We already open-code this quite often, and will be iterating through payloads even more once we've moved all of the payload tracking into the atomic state. So, let's add a helper for doing this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-8-lyude@redhat.com commit 0bee2ae29eb4bdeaf5fb80b4ef48877bc448485a Author: Lyude Paul Date: Wed Aug 17 15:38:35 2022 -0400 drm/display/dp_mst: Add some missing kdocs for atomic MST structs Since we're about to start adding some stuff here, we may as well fill in any missing documentation that we forgot to write. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-7-lyude@redhat.com commit 946c701407c33867573767db7a23e2b6696b5d9b Author: Lyude Paul Date: Wed Aug 17 15:38:34 2022 -0400 drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots() For some reason we mention returning 0 if "slots have been added back to drm_dp_mst_topology_state->avail_slots". This is totally misleading, avail_slots is simply for figuring out the total number of slots available in total on the topology and has no relation to the current payload allocations. So, let's get rid of that comment. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-6-lyude@redhat.com commit df78f7f660cdd5974b68649a95dbb34da4d4dfa7 Author: Lyude Paul Date: Wed Aug 17 15:38:33 2022 -0400 drm/display/dp_mst: Call them time slots, not VCPI slots VCPI is only sort of the correct term here, originally the majority of this code simply referred to timeslots vaguely as "slots" - and since I started working on it and adding atomic functionality, the name "VCPI slots" has been used to represent time slots. Now that we actually have consistent access to the DisplayPort spec thanks to VESA, I now know this isn't actually the proper term - as the specification refers to these as time slots. Since we're trying to make this code as easy to figure out as possible, let's take this opportunity to correct this nomenclature and call them by their proper name - timeslots. Likewise, we rename various functions appropriately, along with replacing references in the kernel documentation and various debugging messages. It's important to note that this patch series leaves the legacy MST code untouched for the most part, which is fine since we'll be removing it soon anyhow. There should be no functional changes in this series. v2: * Add note that Wayne Lin from AMD suggested regarding slots being between the source DP Tx and the immediate downstream DP Rx Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-5-lyude@redhat.com commit 48b6b3726fb7c189410959d2b8915c209fbf9e7c Author: Lyude Paul Date: Wed Aug 17 15:38:32 2022 -0400 drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation In retrospect, the name I chose for this originally is confusing, as there's a lot more info in here then just the VCPI. This really should be called a payload. Let's make it more obvious that this is meant to be related to the atomic state and is about payloads by renaming it to drm_dp_mst_atomic_payload. Also, rename various variables throughout the code that use atomic payloads. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-4-lyude@redhat.com commit dbaadb3cebaad49c37e3fec937e73e6e41054404 Author: Lyude Paul Date: Wed Aug 17 15:38:31 2022 -0400 drm/amdgpu/dm/mst: Rename get_payload_table() This function isn't too confusing if you see the comment around the call-site for it, but if you don't then it's not at all obvious this is meant to copy DRM's payload table over to DC's internal state structs. Seeing this function before finding that comment definitely threw me into a loop a few times. So, let's rename this to make it's purpose more obvious regardless of where in the code you are. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Fangzhi Zuo Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-3-lyude@redhat.com commit 8c5e9bbb3662b09fb9b5353dc48d2f871f13127f Author: Lyude Paul Date: Wed Aug 17 15:38:30 2022 -0400 drm/amdgpu/dc/mst: Rename dp_mst_stream_allocation(_table) Just to make this more clear to outside contributors that these are DC-specific structs, as this also threw me into a loop a number of times before I figured out the purpose of this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Fangzhi Zuo Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-2-lyude@redhat.com commit 92ec1cc3784a2a8a7a62596dcec4f2224b85dcf4 Author: Quentin Monnet Date: Tue Aug 23 16:53:27 2022 +0100 scripts/bpf: Set date attribute for bpf-helpers(7) man page The bpf-helpers(7) manual page shipped in the man-pages project is generated from the documentation contained in the BPF UAPI header, in the Linux repository, parsed by script/bpf_doc.py and then fed to rst2man. The man page should contain the date of last modification of the documentation. This commit adds the relevant date when generating the page. Before: $ ./scripts/bpf_doc.py helpers | rst2man | grep '\.TH' .TH BPF-HELPERS 7 "" "Linux v5.19-14022-g30d2a4d74e11" "" After: $ ./scripts/bpf_doc.py helpers | rst2man | grep '\.TH' .TH BPF-HELPERS 7 "2022-08-15" "Linux v5.19-14022-g30d2a4d74e11" "" We get the version by using "git log" to look for the commit date of the latest change to the section of the BPF header containing the documentation. If the command fails, we just skip the date field. and keep generating the page. Reported-by: Alejandro Colomar Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Reviewed-by: Alejandro Colomar Link: https://lore.kernel.org/bpf/20220823155327.98888-2-quentin@isovalent.com commit fd0a38f9c37d539f5603f887cdb637a4e6e6944d Author: Quentin Monnet Date: Tue Aug 23 16:53:26 2022 +0100 scripts/bpf: Set version attribute for bpf-helpers(7) man page The bpf-helpers(7) manual page shipped in the man-pages project is generated from the documentation contained in the BPF UAPI header, in the Linux repository, parsed by script/bpf_doc.py and then fed to rst2man. After a recent update of that page [0], Alejandro reported that the linter used to validate the man pages complains about the generated document [1]. The header for the page is supposed to contain some attributes that we do not set correctly with the script. This commit updates the "project and version" field. We discussed the format of those fields in [1] and [2]. Before: $ ./scripts/bpf_doc.py helpers | rst2man | grep '\.TH' .TH BPF-HELPERS 7 "" "" "" After: $ ./scripts/bpf_doc.py helpers | rst2man | grep '\.TH' .TH BPF-HELPERS 7 "" "Linux v5.19-14022-g30d2a4d74e11" "" We get the version from "git describe", but if unavailable, we fall back on "make kernelversion". If none works, for example because neither git nore make are installed, we just set the field to "Linux" and keep generating the page. [0] https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man7/bpf-helpers.7?id=19c7f78393f2b038e76099f87335ddf43a87f039 [1] https://lore.kernel.org/all/20220823084719.13613-1-quentin@isovalent.com/t/#m58a418a318642c6428e14ce9bb84eba5183b06e8 [2] https://lore.kernel.org/all/20220721110821.8240-1-alx.manpages@gmail.com/t/#m8e689a822e03f6e2530a0d6de9d128401916c5de Reported-by: Alejandro Colomar Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Reviewed-by: Alejandro Colomar Link: https://lore.kernel.org/bpf/20220823155327.98888-1-quentin@isovalent.com commit d6513727c2af39a8cffb0d9b07376e51a85f347f Author: Shmulik Ladkani Date: Sun Aug 21 14:35:19 2022 +0300 bpf, selftests: Test BPF_FLOW_DISSECTOR_CONTINUE The dissector program returns BPF_FLOW_DISSECTOR_CONTINUE (and avoids setting skb->flow_keys or last_dissection map) in case it encounters IP packets whose (outer) source address is 127.0.0.127. Additional test is added to prog_tests/flow_dissector.c which sets this address as test's pkk.iph.saddr, with the expected retval of BPF_FLOW_DISSECTOR_CONTINUE. Also, legacy test_flow_dissector.sh was similarly augmented. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220821113519.116765-5-shmulik.ladkani@gmail.com commit 5deedfbee84278da3b76fb7176dc3742f56eb370 Author: Shmulik Ladkani Date: Sun Aug 21 14:35:18 2022 +0300 bpf, test_run: Propagate bpf_flow_dissect's retval to user's bpf_attr.test.retval Formerly, a boolean denoting whether bpf_flow_dissect returned BPF_OK was set into 'bpf_attr.test.retval'. Augment this, so users can check the actual return code of the dissector program under test. Existing prog_tests/flow_dissector*.c tests were correspondingly changed to check against each test's expected retval. Also, tests' resulting 'flow_keys' are verified only in case the expected retval is BPF_OK. This allows adding new tests that expect non BPF_OK. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220821113519.116765-4-shmulik.ladkani@gmail.com commit 91350fe152930c0d61a362af68272526490efea5 Author: Shmulik Ladkani Date: Sun Aug 21 14:35:17 2022 +0300 bpf, flow_dissector: Introduce BPF_FLOW_DISSECTOR_CONTINUE retcode for bpf progs Currently, attaching BPF_PROG_TYPE_FLOW_DISSECTOR programs completely replaces the flow-dissector logic with custom dissection logic. This forces implementors to write programs that handle dissection for any flows expected in the namespace. It makes sense for flow-dissector BPF programs to just augment the dissector with custom logic (e.g. dissecting certain flows or custom protocols), while enjoying the broad capabilities of the standard dissector for any other traffic. Introduce BPF_FLOW_DISSECTOR_CONTINUE retcode. Flow-dissector BPF programs may return this to indicate no dissection was made, and fallback to the standard dissector is requested. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220821113519.116765-3-shmulik.ladkani@gmail.com commit 0ba985024ae7db226776725d9aa436b5c1c9fca2 Author: Shmulik Ladkani Date: Sun Aug 21 14:35:16 2022 +0300 flow_dissector: Make 'bpf_flow_dissect' return the bpf program retcode Let 'bpf_flow_dissect' callers know the BPF program's retcode and act accordingly. Signed-off-by: Shmulik Ladkani Signed-off-by: Daniel Borkmann Reviewed-by: Stanislav Fomichev Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220821113519.116765-2-shmulik.ladkani@gmail.com commit 25bcfaad5ec4e82aede4270d4925967f8520d4cf Author: Christophe JAILLET Date: Mon Aug 15 18:59:23 2022 +0200 rtc: mxc: Use devm_clk_get_enabled() helper The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 6705 1968 0 8673 21e1 drivers/rtc/rtc-mxc.o down to: 6212 1968 0 8180 1ff4 drivers/rtc/rtc-mxc.o Signed-off-by: Christophe JAILLET Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1b5ad1877304b01ddbba73ca615274a52f781aa2.1660582728.git.christophe.jaillet@wanadoo.fr commit 509451ac03eb3afa4c4a32d4c11b1938f08de8e4 Author: Emmanuel Gil Peyrot Date: Tue Aug 23 15:07:02 2022 +0200 rtc: gamecube: Always reset HW_SRNPROT after read This register would fail to be reset if reading the RTC bias failed for whichever reason. This commit reorganises the code around to unconditionally write it back to its previous value, unmap it, and return the result of regmap_read(), which makes it both simpler and more correct in the error case. Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220823130702.1046-1-linkmauve@linkmauve.fr commit 1e2585b49d849196f359bbf86677943fe2d80afe Author: Bryan Brattlof Date: Tue Aug 16 12:33:12 2022 -0500 rtc: k3: detect SoC to determine erratum fix To allow new SoCs to use this device without a new compatible string, use a soc_device_attribute list to define all SoCs affected by the TI i2327 erratum and require help from their bootloaders to unlock this device. Signed-off-by: Bryan Brattlof Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220816173312.23243-2-bb@ti.com commit f2c5671a64d2a79341e8ee45d5933f6a76960189 Author: Bryan Brattlof Date: Tue Aug 16 12:33:11 2022 -0500 rtc: k3: wait until the unlock field is not zero After writing the magic words to the KICK0 and KICK1 registers, we must wait for a 1 in the unlock field of the general control register to signify when the rtc device is in an unlocked state. Signed-off-by: Bryan Brattlof Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220816173312.23243-1-bb@ti.com commit 07ae9278b423500f93e10869b1a50276d82050ec Author: Geert Uytterhoeven Date: Tue Aug 16 16:18:25 2022 +0200 rtc: mpfs: Remove printing of stray CR During boot, the driver prints out a stray carriage return character. Remove it, together with the preceding space character. While at it, change prescaler to "unsigned long", as returned by clk_get_rate(), to avoid truncating very large clock rates, and update the format specifiers. Fixes: 0b31d703598dc199 ("rtc: Add driver for Microchip PolarFire SoC") Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/bce2ca405ef96b1363fd1370887409d9e8468422.1660659437.git.geert+renesas@glider.be commit 729c16326b7f3f4e83e4195f620a6ca0b7dfa25a Author: Shengjiu Wang Date: Mon Aug 15 20:43:18 2022 +0800 remoteproc: imx_dsp_rproc: fix argument 2 of rproc_mem_entry_init There are sparse warning: drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *va @@ got void [noderef] __iomem *[assigned] cpu_addr @@ drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: expected void *va drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: got void [noderef] __iomem *[assigned] cpu_addr drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *va @@ got void [noderef] __iomem *[assigned] cpu_addr @@ drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: expected void *va drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: got void [noderef] __iomem *[assigned] cpu_addr Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX") Reported-by: kernel test robot Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1660567398-24495-1-git-send-email-shengjiu.wang@nxp.com Acked-by: Mukesh Ojha Signed-off-by: Mathieu Poirier commit 56171e0db23a5e0edce1596dd2792b95ffe57bd3 Author: Alexander Aring Date: Mon Aug 15 15:43:27 2022 -0400 fs: dlm: const void resource name parameter The resource name parameter should never be changed by DLM so we declare it as const. At some point it is handled as a char pointer, a resource name can be a non printable ascii string as well. This patch change it to handle it as void pointer as it is offered by DLM API. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 9cb16d42717b114e8dec9d534a9d807b618e9f92 Author: Alexander Aring Date: Mon Aug 15 15:43:26 2022 -0400 fs: dlm: LSFL_CB_DELAY only for kernel lockspaces This patch only set/clear the LSFL_CB_DELAY bit when it's actually a kernel lockspace signaled by if ls->ls_callback_wq is set or not set in this case. User lockspaces will never evaluate this flag. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 12cda13cfd5310bbfefdfe32a82489228e2e0381 Author: Alexander Aring Date: Mon Aug 15 15:43:25 2022 -0400 fs: dlm: remove DLM_LSFL_FS from uapi The DLM_LSFL_FS flag is set in lockspaces created directly for a kernel user, as opposed to those lockspaces created for user space applications. The user space libdlm allowed this flag to be set for lockspaces created from user space, but then used by a kernel user. No kernel user has ever used this method, so remove the ability to do it. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 7a3de7324c2b1299a4f595bb6aa503c878ad7d75 Author: Alexander Aring Date: Mon Aug 15 15:43:24 2022 -0400 fs: dlm: trace user space callbacks This patch adds trace callbacks for user locks. Unfortenately user locks are handled in a different way than kernel locks in some cases. User locks never call the dlm_lock()/dlm_unlock() kernel API and use the next step internal API of dlm. Adding those traces from user API callers should make it possible for dlm trace system to see lock handling for user locks as well. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 296d9d1e9890830bd149105cf0193c2cf7d5bc86 Author: Alexander Aring Date: Mon Aug 15 15:43:23 2022 -0400 fs: dlm: change ls_clear_proc_locks to spinlock This patch changes the ls_clear_proc_locks to a spinlock because there is no need to handle it as a mutex as there is no sleepable context when ls_clear_proc_locks is held. This allows us to call those functionality in non-sleepable contexts. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit e152c38dc0e8f1f7f8aceccbcfb5b019ca3a4352 Author: Alexander Aring Date: Mon Aug 15 15:43:22 2022 -0400 fs: dlm: remove dlm_del_ast prototype This patch removes dlm_del_ast() prototype which is not being used in the dlm subsystem because there is not implementation for it. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f45307d395da7ab1aa537cf00e8fd7123a2be4e2 Author: Alexander Aring Date: Mon Aug 15 15:43:21 2022 -0400 fs: dlm: handle rcom in else if branch Currently we handle in dlm_receive_buffer() everything else than a DLM_MSG type as DLM_RCOM message. Although a different message than DLM_MSG should be a DLM_RCOM we should explicit check on DLM_RCOM and drop a log_error() if we see something unexpected. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit b5c9d37c7f6051b45b2da70e434e791080dcb53f Author: Alexander Aring Date: Mon Aug 15 15:43:20 2022 -0400 fs: dlm: allow lockspaces have zero lvblen A dlm user may not use the DLM_LKF_VALBLK flag in the DLM API, so a zero lvblen should be allowed as a lockspace parameter. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 7175e131ebba47afef47e6ac4d5bab474d1e6e49 Author: Alexander Aring Date: Mon Aug 15 15:43:19 2022 -0400 fs: dlm: fix invalid derefence of sb_lvbptr I experience issues when putting a lkbsb on the stack and have sb_lvbptr field to a dangled pointer while not using DLM_LKF_VALBLK. It will crash with the following kernel message, the dangled pointer is here 0xdeadbeef as example: [ 102.749317] BUG: unable to handle page fault for address: 00000000deadbeef [ 102.749320] #PF: supervisor read access in kernel mode [ 102.749323] #PF: error_code(0x0000) - not-present page [ 102.749325] PGD 0 P4D 0 [ 102.749332] Oops: 0000 [#1] PREEMPT SMP PTI [ 102.749336] CPU: 0 PID: 1567 Comm: lock_torture_wr Tainted: G W 5.19.0-rc3+ #1565 [ 102.749343] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.16.0-2.module+el8.7.0+15506+033991b0 04/01/2014 [ 102.749344] RIP: 0010:memcpy_erms+0x6/0x10 [ 102.749353] Code: cc cc cc cc eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe [ 102.749355] RSP: 0018:ffff97a58145fd08 EFLAGS: 00010202 [ 102.749358] RAX: ffff901778b77070 RBX: 0000000000000000 RCX: 0000000000000040 [ 102.749360] RDX: 0000000000000040 RSI: 00000000deadbeef RDI: ffff901778b77070 [ 102.749362] RBP: ffff97a58145fd10 R08: ffff901760b67a70 R09: 0000000000000001 [ 102.749364] R10: ffff9017008e2cb8 R11: 0000000000000001 R12: ffff901760b67a70 [ 102.749366] R13: ffff901760b78f00 R14: 0000000000000003 R15: 0000000000000001 [ 102.749368] FS: 0000000000000000(0000) GS:ffff901876e00000(0000) knlGS:0000000000000000 [ 102.749372] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 102.749374] CR2: 00000000deadbeef CR3: 000000017c49a004 CR4: 0000000000770ef0 [ 102.749376] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 102.749378] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 102.749379] PKRU: 55555554 [ 102.749381] Call Trace: [ 102.749382] [ 102.749383] ? send_args+0xb2/0xd0 [ 102.749389] send_common+0xb7/0xd0 [ 102.749395] _unlock_lock+0x2c/0x90 [ 102.749400] unlock_lock.isra.56+0x62/0xa0 [ 102.749405] dlm_unlock+0x21e/0x330 [ 102.749411] ? lock_torture_stats+0x80/0x80 [dlm_locktorture] [ 102.749416] torture_unlock+0x5a/0x90 [dlm_locktorture] [ 102.749419] ? preempt_count_sub+0xba/0x100 [ 102.749427] lock_torture_writer+0xbd/0x150 [dlm_locktorture] [ 102.786186] kthread+0x10a/0x130 [ 102.786581] ? kthread_complete_and_exit+0x20/0x20 [ 102.787156] ret_from_fork+0x22/0x30 [ 102.787588] [ 102.787855] Modules linked in: dlm_locktorture torture rpcsec_gss_krb5 intel_rapl_msr intel_rapl_common kvm_intel iTCO_wdt iTCO_vendor_support kvm vmw_vsock_virtio_transport qxl irqbypass vmw_vsock_virtio_transport_common drm_ttm_helper crc32_pclmul joydev crc32c_intel ttm vsock virtio_scsi virtio_balloon snd_pcm drm_kms_helper virtio_console snd_timer snd drm soundcore syscopyarea i2c_i801 sysfillrect sysimgblt i2c_smbus pcspkr fb_sys_fops lpc_ich serio_raw [ 102.792536] CR2: 00000000deadbeef [ 102.792930] ---[ end trace 0000000000000000 ]--- This patch fixes the issue by checking also on DLM_LKF_VALBLK on exflags is set when copying the lvbptr array instead of if it's just null which fixes for me the issue. I think this patch can fix other dlm users as well, depending how they handle the init, freeing memory handling of sb_lvbptr and don't set DLM_LKF_VALBLK for some dlm_lock() calls. It might a there could be a hidden issue all the time. However with checking on DLM_LKF_VALBLK the user always need to provide a sb_lvbptr non-null value. There might be more intelligent handling between per ls lvblen, DLM_LKF_VALBLK and non-null to report the user the way how DLM API is used is wrong but can be added for later, this will only fix the current behaviour. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 9ac8ba46a701b863be3f197d7eece4c635d0afe4 Author: Alexander Aring Date: Mon Aug 15 15:43:18 2022 -0400 fs: dlm: handle -EINVAL as log_error() If the user generates -EINVAL it's probably because they are using DLM incorrectly. Change the log level to make these errors more visible. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c2d76a62d866ae9c03f09ec2a9f9fb266ad586b8 Author: Alexander Aring Date: Mon Aug 15 15:43:17 2022 -0400 fs: dlm: use __func__ for function name Avoid hard-coded function names inside message format strings. (Prevents checkpatch warnings.) Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 420ba3cd035a202757f0848b435d743590deee94 Author: Alexander Aring Date: Mon Aug 15 15:43:16 2022 -0400 fs: dlm: handle -EBUSY first in unlock validation This patch checks for -EBUSY conditions in dlm_unlock() before checking for -EINVAL conditions (except for CANCEL and FORCEUNLOCK calls where a busy condition is expected.) There are no problems with the current ordering of checks, but this makes dlm_unlock() consistent with dlm_lock(), and may avoid future problems if other checks are added. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 44637ca41d551d409a481117b07fa209b330fca9 Author: Alexander Aring Date: Mon Aug 15 15:43:15 2022 -0400 fs: dlm: handle -EBUSY first in lock arg validation During lock arg validation, first check for -EBUSY cases, then for -EINVAL cases. The -EINVAL checks look at lkb state variables which are not stable when an lkb is busy and would cause an -EBUSY result, e.g. lkb->lkb_grmode. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit eef6ec9bf390e836a6c4029f3620fe49528aa1fe Author: Alexander Aring Date: Mon Aug 15 15:43:14 2022 -0400 fs: dlm: fix race between test_bit() and queue_work() This patch fixes a race by using ls_cb_mutex around the bit operations and conditional code blocks for LSFL_CB_DELAY. The function dlm_callback_stop() expects to stop all callbacks and flush all currently queued onces. The set_bit() is not enough because there can still be queue_work() after the workqueue was flushed. To avoid queue_work() after set_bit(), surround both by ls_cb_mutex. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 30ea3257e8766027c4d8d609dcbd256ff9a76073 Author: Alexander Aring Date: Mon Aug 15 15:43:13 2022 -0400 fs: dlm: fix race in lowcomms This patch fixes a race between queue_work() in _dlm_lowcomms_commit_msg() and srcu_read_unlock(). The queue_work() can take the final reference of a dlm_msg and so msg->idx can contain garbage which is signaled by the following warning: [ 676.237050] ------------[ cut here ]------------ [ 676.237052] WARNING: CPU: 0 PID: 1060 at include/linux/srcu.h:189 dlm_lowcomms_commit_msg+0x41/0x50 [ 676.238945] Modules linked in: dlm_locktorture torture rpcsec_gss_krb5 intel_rapl_msr intel_rapl_common iTCO_wdt iTCO_vendor_support qxl kvm_intel drm_ttm_helper vmw_vsock_virtio_transport kvm vmw_vsock_virtio_transport_common ttm irqbypass crc32_pclmul joydev crc32c_intel serio_raw drm_kms_helper vsock virtio_scsi virtio_console virtio_balloon snd_pcm drm syscopyarea sysfillrect sysimgblt snd_timer fb_sys_fops i2c_i801 lpc_ich snd i2c_smbus soundcore pcspkr [ 676.244227] CPU: 0 PID: 1060 Comm: lock_torture_wr Not tainted 5.19.0-rc3+ #1546 [ 676.245216] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.16.0-2.module+el8.7.0+15506+033991b0 04/01/2014 [ 676.246460] RIP: 0010:dlm_lowcomms_commit_msg+0x41/0x50 [ 676.247132] Code: fe ff ff ff 75 24 48 c7 c6 bd 0f 49 bb 48 c7 c7 38 7c 01 bd e8 00 e7 ca ff 89 de 48 c7 c7 60 78 01 bd e8 42 3d cd ff 5b 5d c3 <0f> 0b eb d8 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 [ 676.249253] RSP: 0018:ffffa401c18ffc68 EFLAGS: 00010282 [ 676.249855] RAX: 0000000000000001 RBX: 00000000ffff8b76 RCX: 0000000000000006 [ 676.250713] RDX: 0000000000000000 RSI: ffffffffbccf3a10 RDI: ffffffffbcc7b62e [ 676.251610] RBP: ffffa401c18ffc70 R08: 0000000000000001 R09: 0000000000000001 [ 676.252481] R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000005 [ 676.253421] R13: ffff8b76786ec370 R14: ffff8b76786ec370 R15: ffff8b76786ec480 [ 676.254257] FS: 0000000000000000(0000) GS:ffff8b7777800000(0000) knlGS:0000000000000000 [ 676.255239] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 676.255897] CR2: 00005590205d88b8 CR3: 000000017656c003 CR4: 0000000000770ee0 [ 676.256734] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 676.257567] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 676.258397] PKRU: 55555554 [ 676.258729] Call Trace: [ 676.259063] [ 676.259354] dlm_midcomms_commit_mhandle+0xcc/0x110 [ 676.259964] queue_bast+0x8b/0xb0 [ 676.260423] grant_pending_locks+0x166/0x1b0 [ 676.261007] _unlock_lock+0x75/0x90 [ 676.261469] unlock_lock.isra.57+0x62/0xa0 [ 676.262009] dlm_unlock+0x21e/0x330 [ 676.262457] ? lock_torture_stats+0x80/0x80 [dlm_locktorture] [ 676.263183] torture_unlock+0x5a/0x90 [dlm_locktorture] [ 676.263815] ? preempt_count_sub+0xba/0x100 [ 676.264361] ? complete+0x1d/0x60 [ 676.264777] lock_torture_writer+0xb8/0x150 [dlm_locktorture] [ 676.265555] kthread+0x10a/0x130 [ 676.266007] ? kthread_complete_and_exit+0x20/0x20 [ 676.266616] ret_from_fork+0x22/0x30 [ 676.267097] [ 676.267381] irq event stamp: 9579855 [ 676.267824] hardirqs last enabled at (9579863): [] __up_console_sem+0x58/0x60 [ 676.268896] hardirqs last disabled at (9579872): [] __up_console_sem+0x3d/0x60 [ 676.270008] softirqs last enabled at (9579798): [] __do_softirq+0x349/0x4c7 [ 676.271438] softirqs last disabled at (9579897): [] irq_exit_rcu+0xb0/0xf0 [ 676.272796] ---[ end trace 0000000000000000 ]--- I reproduced this warning with dlm_locktorture test which is currently not upstream. However this patch fix the issue by make a additional refcount between dlm_lowcomms_new_msg() and dlm_lowcomms_commit_msg(). In case of the race the kref_put() in dlm_lowcomms_commit_msg() will be the final put. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a1c3611dcfb08e62e165ab5c00122dd13f210166 Author: Christophe JAILLET Date: Sat Aug 6 00:02:32 2022 +0200 remoteproc: imx_rproc: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. While at it, remove 'ret' that is mostly useless. Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/6b9343c2688117a340661d8ee491c2962c54a09a.1659736936.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier commit 8622817ccb3f545d9440ee8aae46410be0f2b625 Merge: a2740378834a3 c12ac5fc3e0af Author: Mark Brown Date: Tue Aug 23 19:54:15 2022 +0100 Add support for TI TPS65219 PMIC. Merge series from Jerome Neanne : This driver supports - 3 Buck regulators and 4 LDOs - low-power standby mode - warm/soft reset - basic fault handling (via interrupts). - power button Not implemented - DVS 1-Regulators: Full implementation and test Visual check: cat /sys/kernel/debug/regulator/regulator_summary Full validation requires userspace-consumer and virtual-regulator LDO1 is not used and output can be probbed on TP84. commit 3b99852f4c874062295704dd483b03cab61301fe Author: Peter Ujfalusi Date: Tue Aug 23 15:43:59 2022 +0300 ASoC: SOF: Intel: hda: Skip IMR boot after a firmware crash or boot failure To make sure that we start from a clean state next time when the DSP is powered up after a firmware crash or boot failure we must skip the IMR booting attempt. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220823124359.24865-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9e10a1ded6a1b7ffacbb2d9c75fe6aa91623051b Author: Rob Herring Date: Tue Aug 23 09:56:39 2022 -0500 ASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220823145649.3118479-8-robh@kernel.org Signed-off-by: Mark Brown commit a337c2012774d588fcab318c42edc2601d90e549 Author: Peter Ujfalusi Date: Tue Aug 23 15:42:19 2022 +0300 ASoC: SOF: ipc4-loader: Verify ext manifest magic number Firmware image must start with an extended manifest. Add a check to make sure that the image does contain it. The magic number (the first u32 of a firmware image if manifest is present) for an IPC4 image must be 0x31454124 (ASCI "$AE1"). Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220823124219.927-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 1332d2078a839b371b3d541c3653a800d12a763d Author: Pierre-Louis Bossart Date: Tue Aug 23 17:40:27 2022 +0200 ASoC: SOF: imx: imx8ulp: declare ops structure as static Sparse warning: sound/soc/sof/imx/imx8ulp.c:416:24: error: symbol 'sof_imx8ulp_ops' was not declared. Should it be static? Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220823154027.762889-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 837b40293de66a5b96f883f540512ec5c3867610 Author: Shengjiu Wang Date: Fri Aug 5 14:45:26 2022 +0800 ASoC: fsl_sai: Update slots number according to bclk_ratio The bclk_ratio is set by .set_bclk_ratio API. bclk_ratio = slots * slot_width So if slots is not set by .set_tdm_slot, then it can be calculated by bclk_ratio. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1659681926-13493-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit a2740378834a3b19dbf6f667e7297c0161e93532 Merge: de6fbef10c4b9 9048b9912f767 Author: Mark Brown Date: Tue Aug 23 19:48:43 2022 +0100 Use devm helpers for regulator get and enable Merge series from Matti Vaittinen : Use devm helpers for regulator get and enable NOTE: The series depends on commit ee94aff2628b ("Devm helpers for regulator get and enable") which currently sits in Mark's regulator/for-next A few* drivers seem to pattern demonstrated by pseudocode: - devm_regulator_get() - regulator_enable() - devm_add_action_or_reset(regulator_disable()) devm helpers for this pattern were added to remove bunch of code from drivers. Typically following: - replace 3 calls (devm_regulator_get[_optional](), regulator_enable(), devm_add_action_or_reset()) with just one (devm_regulator_get_enable[_optional]()). - drop disable callback. I believe this simplifies things by removing some dublicated code. This series reowrks a few drivers. There is still plenty of fish in the sea for people who like to improve the code (or count the beans ;]). Finally - most of the converted drivers have not been tested (other than compile-tested) due to lack of HW. All reviews and testing is _highly_ appreciated (as always!). Revision history: v3: - Drop already applied helper patches - Add a few more drivers RFCv1 => v2: - Add devm_regulator_bulk_get_enable() and devm_regulator_bulk_put() - Convert a couple of drivers to use the new devm_regulator_bulk_get_enable(). - Squash all IIO patches into one. Patch 1: Add new devm-helper APIs to docs. Patch 2: simplified CLK driver(s) Patch 3: simplified GPU driver(s) Patch 4 - 5: simplified hwmon driver(s) Patch 6 - 14: simplified IIO driver(s) --- Matti Vaittinen (14): docs: devres: regulator: Add new get_enable functions to devres.rst clk: cdce925: simplify using devm_regulator_get_enable() gpu: drm: simplify drivers using devm_regulator_*get_enable*() hwmon: lm90: simplify using devm_regulator_get_enable() hwmon: adm1177: simplify using devm_regulator_get_enable() iio: ad7192: Simplify using devm_regulator_get_enable() iio: ltc2688: Simplify using devm_regulator_*get_enable() iio: bmg160_core: Simplify using devm_regulator_*get_enable() iio: st_lsm6dsx: Simplify using devm_regulator_*get_enable() iio: ad7476: simplify using devm_regulator_get_enable() iio: ad7606: simplify using devm_regulator_get_enable() iio: max1241: simplify using devm_regulator_get_enable() iio: max1363: simplify using devm_regulator_get_enable() iio: hmc425a: simplify using devm_regulator_get_enable() .../driver-api/driver-model/devres.rst | 4 +++ drivers/clk/clk-cdce925.c | 21 +++---------- drivers/gpu/drm/bridge/sii902x.c | 22 ++------------ drivers/gpu/drm/meson/meson_dw_hdmi.c | 23 ++------------ drivers/hwmon/adm1177.c | 27 ++--------------- drivers/hwmon/lm90.c | 15 ++-------- drivers/iio/adc/ad7192.c | 15 ++-------- drivers/iio/adc/ad7476.c | 11 +------ drivers/iio/adc/ad7606.c | 22 ++------------ drivers/iio/adc/ad7606.h | 1 - drivers/iio/adc/max1241.c | 28 ++--------------- drivers/iio/adc/max1363.c | 11 +------ drivers/iio/amplifiers/hmc425a.c | 17 +---------- drivers/iio/dac/ltc2688.c | 23 ++------------ drivers/iio/gyro/bmg160_core.c | 24 ++------------- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 2 -- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 30 ++++--------------- 17 files changed, 41 insertions(+), 255 deletions(-) -- 2.37.1 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =] commit d4a9fd829285e488c522853faf30aca6097c2b40 Merge: 78f0ecf3c3147 8613753a681e7 Author: Mark Brown Date: Tue Aug 23 19:48:41 2022 +0100 ASoC: SOF: Intel: hda: Correct Firmware State Register use Merge series from Peter Ujfalusi : Hi, The FSR (Firmware State Register) holds the ROM state information, it does not contain error information. The FSR itself is a bit more complicated as well as the state depends on the module currently in use. The error code from ROM or the status code from the firmware is located at the next register. Fix the handling of the FSR in order to provide usable and human readable (in most cases) report on the status and error. Regards, Peter --- Peter Ujfalusi (3): ASoC: SOF: Intel: hda: Correct the ROM/FW state reporting code ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions sound/soc/sof/intel/hda-loader.c | 10 +-- sound/soc/sof/intel/hda.c | 147 ++++++++++++++++++++++++++----- sound/soc/sof/intel/hda.h | 69 +++++++++++++-- 3 files changed, 194 insertions(+), 32 deletions(-) -- 2.37.0 commit 78f0ecf3c3147ef641dd89ed2c26d757f89ec11c Merge: 88630575406fd 2dec9e09e955d Author: Mark Brown Date: Tue Aug 23 19:48:39 2022 +0100 Introduce sof_of_machine_select Merge series from Chunxu Li : In these patches, we introduce function sof_of_machine_select for SOF commit 6d5afdc97ea71958287364a1f1d07e59ef151b11 Author: Lukasz Luba Date: Tue Aug 16 14:06:29 2022 +0100 cpufreq: schedutil: Move max CPU capacity to sugov_policy There is no need to keep the max CPU capacity in the per_cpu instance. Furthermore, there is no need to check and update that variable (sg_cpu->max) every time in the frequency change request, which is part of hot path. Instead use struct sugov_policy to store that information. Initialize the max CPU capacity during the setup and start callback. We can do that since all CPUs in the same frequency domain have the same max capacity (capacity setup and thermal pressure are based on that). Acked-by: Viresh Kumar Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit 2dec9e09e955dfc4b7843fa4f9c09e7ee8931b1d Author: Chunxu Li Date: Fri Aug 5 15:04:49 2022 +0800 ASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186 Add .of_machines field sof_mt8186_machs for mt8186 Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220805070449.6611-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 6ace85b9838dc0162b474dbbbb6b388e7561f6a7 Author: Chunxu Li Date: Fri Aug 5 15:04:48 2022 +0800 ASoC: SOF: Introduce function sof_of_machine_select From current design in sof_machine_check and snd_sof_new_platform_drv, the SOF can only support ACPI type machine. 1. In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine. 2. In snd_sof_new_platform_drv the component driver need a driver name to do ignore_machine, currently the driver name is obtained from machine->drv_name, and the type of machine is snd_soc_acpi_mach. So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv. Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit c12ac5fc3e0af29851785e557e243663b4fc7f4b Author: Jerome Neanne Date: Fri Aug 5 14:18:50 2022 +0200 regulator: drivers: Add TI TPS65219 PMIC regulators support The regulators set consists of 3 bucks DCDCs and 4 LDOs. The output voltages are configurable and are meant to supply power to the main processor and other components. Validation: Visual check: cat /sys/kernel/debug/regulator/regulator_summary Validation: userspace-consumer and virtual-regulator required to test further Enable/Disable: cat /sys/devices/platform/userspace-consumer-VDDSHV_SD_IO_PMIC/state echo disabled > /sys/devices/platform/ userspace-consumer-VDDSHV_SD_IO_PMIC/state echo enabled > /sys/devices/platform/ userspace-consumer-VDDSHV_SD_IO_PMIC/state Change voltage: cat /sys/devices/platform/regulator-virtual-ldo1/min_microvolts echo 1000000 > /sys/devices/platform/regulator-virtual-ldo1/ min_microvolts echo 3000000 > /sys/devices/platform/regulator-virtual-ldo1/ max_microvolts Signed-off-by: Jerome Neanne Link: https://lore.kernel.org/r/20220805121852.21254-9-jneanne@baylibre.com Signed-off-by: Mark Brown commit 4d2aed6ee306ccdcae51f550309bfb82ebf31b01 Author: Jerome Neanne Date: Fri Aug 5 14:18:46 2022 +0200 regulator: dt-bindings: Add TI TPS65219 PMIC bindings Add TPS65219 PMIC bindings using json-schema. Describe required properties and regname-supply. regname-supply is required when bypass mode is used for a regulator. Describes regulator topology. Interrupts support. Add a power-button property to configure the EN/PB/VSENSE pin as a powerbutton: TPS65219 has a multipurpose pin called EN/PB/VSENSE that can be either: - EN in which case it functions as an enable pin. - VSENSE which compares the voltages and triggers an automatic on/off request. - PB in which case it can be configured to trigger an interrupt to the SoC. ti,power-button reflects the last one of those options where the board has a button wired to the pin and triggers an interrupt on pressing it. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Jerome Neanne Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220805121852.21254-5-jneanne@baylibre.com Signed-off-by: Mark Brown commit 95b5f3ef4c0cf553a97dd7ce7d6ef85415388011 Author: Iskren Chernev Date: Wed Aug 3 01:11:12 2022 +0300 regulator: qcom_smd: Add PM6125 RPM regulators The ranges and types are taken from the relevant SPMI driver: - ftsmps_510: s1-s4, s8 - buck_510: s5-s7 - ldo_nX_510: l1-l4, l6-l8, l17-18 - ldo_mv_pX_510: l5, l15, l19-l24 - ldo_lv_pX_510: l9-l14, l16 Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220802221112.2280686-14-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit a39d0100572e188f00ff4d224af9694c7eb3eeb5 Author: Iskren Chernev Date: Wed Aug 3 01:11:11 2022 +0300 regulator: qcom_smd: Sort pmics alphabetically (part 3) The sorting is split in multiple commits for easier reviewing. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-13-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 13b3d00590243888563cb63b88538a4c60bce57b Author: Iskren Chernev Date: Wed Aug 3 01:11:10 2022 +0300 regulator: qcom_smd: Sort pmics alphabetically (part 2) The sorting is split in multiple commits for easier reviewing. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-12-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 8e584e84ae65ecc9ee90b187d4b7782dc881e4ad Author: Iskren Chernev Date: Wed Aug 3 01:11:09 2022 +0300 regulator: qcom_smd: Sort pmics alphabetically (part 1) The sorting is split in multiple commits for easier reviewing. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-11-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit e62ef4a9f936326e702ef08ea3f65b62bd7d108b Author: Iskren Chernev Date: Wed Aug 3 01:11:08 2022 +0300 regulator: qcom_spmi: Add PM6125 PMIC support Add support for PM6125 PMIC which is found on SM4250/6115 SoCs. S1, S2, S3, S4, S8 are FTS+FTSMPS_510, rev 2 - range is 0.3-1.372V by 4mV increments S5, S6, s7 are BUCK+HFSMPS_510, rev 4 - range is 0.32-2.04V by 8mV increment L1, L3, L7 are LDO+N600_510, rev 2 L2, L4, L8, L17, L18 are LDO+N300_510, rev 2 L6 is LDO+N1200_510, rev 2 - range is 0.32-1.304V by 8mV increment L5 is LDO+MV_P50_510, rev 2 L15, L19, L20 are LDO+MV_P150_510, rev 2 L21, L22, L23, L24 are LDO+MV_P600_510, rev 2 - range is 1.504-3.544V by 8mV increment L9, L11, L14 are LDO+LV_P600_510, rev 2 L10, L16 are LDO+LV_P150_510, rev 2 L12, L13 are LDO+LV_P300_510, rev 2 - range 1.504-2V by 8mV increment Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220802221112.2280686-10-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 9a2da0749ce37d4a74f7becf3b09bf2e0169145a Author: Iskren Chernev Date: Wed Aug 3 01:11:07 2022 +0300 regulator: qcom_spmi: Sort pmics alphabetically (part 2) The sorting is split in multiple commits for easier reviewing. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-9-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 046d7e3246ac028bfe583b4c3bed9530a80004c4 Author: Iskren Chernev Date: Wed Aug 3 01:11:06 2022 +0300 regulator: qcom_spmi: Sort pmics alphabetically (part 1) The sorting is split in multiple commits for easier reviewing. Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-8-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 0d1cf568b4e0c65cb533fef2c116fb2883803c53 Author: Iskren Chernev Date: Wed Aug 3 01:11:05 2022 +0300 regulator: qcom_spmi: Add support for LDO_510 and FTSMPS Add support for LDO_510 and FTSMPS3 regulators, all belonging to register layout HFSMPS. This is done in preparation for adding support for the PM6125 PMIC. For FTSMPS3 and LDO_510, only IDLE and NORMAL modes are selectable (no FAST). The inspiration for the magic constants was taken from [1] [1]: https://source.codeaurora.org/quic/la/kernel/msm-5.4/commit/?h=kernel.lnx.5.4.r1-rel&id=d1220daeffaa440ffff0a8c47322eb0033bf54f5 Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-7-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 2785025495b6bd630648f8304f8d932b0d0a9f2a Author: Iskren Chernev Date: Wed Aug 3 01:11:04 2022 +0300 regulator: qcom_spmi: Add support for HFSMPS regulator type This is preparation for supporing PM6125. The HFSMPS is a BUCK type regulator with subtype 0x0a, same as the existing HFS430 regulator. Even though the HFSMPS and HFS430 share a type and subtype, the HFSMPS has an updated register map, including different mode values, moved pull down register, and different slew rate address and formula. In addition to NORMAL (NPM), FAST (AUTO_LPM) and IDLE (LPM), the regulator also supports RETENTION and AUTO_RM which are currently unselectable by the driver. The inspiration of this is taken from [1]. [1] https://source.codeaurora.org/quic/la/kernel/msm-5.4/commit/?h=kernel.lnx.5.4.r1-rel&id=d1220daeffaa440ffff0a8c47322eb0033bf54f5 Signed-off-by: Iskren Chernev Link: https://lore.kernel.org/r/20220802221112.2280686-6-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit d95fe1788438cceab40af5f3f9e9fe15d8c07101 Author: Iskren Chernev Date: Wed Aug 3 01:11:03 2022 +0300 regulator: qcom_smd: Document PM6125 PMIC Document the pm6125 compatible string and available regulators in the QCom SMD RPM regulator documentation. Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220802221112.2280686-5-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 901421765ee1e5501c15a3b76ce926e0cc4967d4 Author: Iskren Chernev Date: Wed Aug 3 01:11:02 2022 +0300 regulator: qcom_smd: Sort compatibles alphabetically As requested by Krzysztof Kozlowski. Signed-off-by: Iskren Chernev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220802221112.2280686-4-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 5b2a085baaa15d04396889228f1e11d2cb86b916 Author: Iskren Chernev Date: Wed Aug 3 01:11:01 2022 +0300 regulator: qcom_spmi: Document PM6125 PMIC Add support for pm6125 compatible string and add relevant supplies in QCom SPMI regulator documentation. Signed-off-by: Adam Skladowski Signed-off-by: Iskren Chernev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220802221112.2280686-3-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit ac71792707226d1210127611bb622c0362cbff25 Author: Iskren Chernev Date: Wed Aug 3 01:11:00 2022 +0300 regulator: qcom_spmi: Improve formatting of if-then blocks Add a newline between if-then blocks for different compatible PMICs. Signed-off-by: Iskren Chernev Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220802221112.2280686-2-iskren.chernev@gmail.com Signed-off-by: Mark Brown commit 63198aaa91acf64237bf5cfde3803ed388815150 Author: Pierre-Louis Bossart Date: Tue Aug 23 13:01:58 2022 +0800 soundwire: intel: remove use of __func__ in dev_dbg The module and function information can be added with 'modprobe foo dyndbg=+pmf' Suggested-by: Greg KH Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823050158.2671245-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 9af8c36aabe5294e147a0df61e95f941a7fff4cd Author: Pierre-Louis Bossart Date: Tue Aug 23 13:01:57 2022 +0800 soundwire: bus: remove use of __func__ in dev_dbg The module and function information can be added with 'modprobe foo dyndbg=+pmf' Suggested-by: Greg KH Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823050158.2671245-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 1a09e0e8cfbbf91169fddf55a4b0e2f631fa57ad Merge: 52c135d495ca0 a557fca630cc6 Author: Mark Brown Date: Tue Aug 23 17:59:36 2022 +0100 spi: stm32_qspi: use QSPI bus as 8 lines communication channel Merge series from patrice.chotard@foss.st.com : The goal of this series is to allow to use QSPI bus as a 8 lines communication channel for specific purpose. The QSPI block offers the possibility to communicate with 2 flashes in parrallel using the dual flash mode, 8 data lines are then used. Usage of cs-gpios populated and spi-tx-bus-width / spi-rx-bus-width both set to 8, is needed to enable dual flash mode. The addition of the legacy transfer_one_message() spi callback is also needed as currently the stm32-qspi driver only supports spi_controller_mem_ops API. commit df55100551a34bddab02dff48d0296bda0659c02 Author: Pierre-Louis Bossart Date: Tue Aug 23 11:09:19 2022 +0800 soundwire: dmi-quirks: add remapping for HP Omen 16-k0005TX The DSDT for this device has a number of problems: a) it lists rt711 on link0 and link1, but link1 is disabled b) the rt711 entry on link0 uses the wrong v2 instead of v3 (SDCA) c) the rt1316 amplifier on link3 is not listed. Add a remapping table to work-around these BIOS shenanigans. BugLink: https://github.com/thesofproject/sof/issues/5955 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220823030919.2346629-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit adc62cbd6b2108c592e09b9af8071ff93f160c71 Author: Khalid Masum Date: Wed Aug 17 13:48:59 2022 +0600 soundwire: intel: Remove unnecessary TODO The capabilities enabled for multi-link are required as part of the programming sequences, even when a stream uses a single link we still use the syncArm/syncGo sequences. Therefore the TODO is no longer necessary. Suggested-by: Pierre-Louis Bossart Signed-off-by: Khalid Masum Link: https://lore.kernel.org/r/20220817074859.4759-1-khalid.masum.92@gmail.com Signed-off-by: Vinod Koul commit b75d2cd06b33956b7ec35c6316e717c25a196ee5 Author: Wolfram Sang Date: Thu Aug 18 22:59:55 2022 +0200 ACPI: move from strlcpy() with unused retval to strscpy() Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit ba8ec0f675d5c6bd3c16f7cc8e96c9c893fec9ab Author: Srinivasa Rao Mandadapu Date: Wed Jul 13 20:24:27 2022 +0530 soundwire: qcom: Update error prints to debug prints Update error prints to debug prints to avoid redundant logging in kernel boot time, as these prints are informative prints in irq handler. Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Andrew Halaney Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/1657724067-19004-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Vinod Koul commit 0efe92b47b9d5e8f31dcb34fd6aff89c7c490ea5 Author: Sakari Ailus Date: Thu Aug 18 08:51:56 2022 +0300 ACPI: PM: Fix acpi_dev_state_d0() kerneldoc The documentation for acpi_dev_state_d0() referred to Documentation/firmware-guide/acpi/low-power-probe.rst that does not exist, the right file name is Documentation/firmware-guide/acpi/non-d0-probe.rst. Fix this. Reported-by: kernel test robot Signed-off-by: Sakari Ailus [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit b7059927c3e32c96d2ff50c206549d8fac0ba69e Author: Linus Walleij Date: Tue Aug 23 15:57:00 2022 +0200 regmap: check right noinc bounds in debug print We were using the wrong bound in the debug prints: this needs to be the number of elements, not the number of bytes, since we're indexing into an element-size typed array. Fixes: c20cc099b30a ("regmap: Support accelerated noinc operations") Reported-by: Dan Carpenter Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220823135700.265019-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit de6fbef10c4b9c589f3b84bd926e56ba742263ea Author: Rob Herring Date: Tue Aug 23 09:56:38 2022 -0500 regulator: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220823145649.3118479-7-robh@kernel.org Signed-off-by: Mark Brown commit 6e1850b2f3747942d3813a2fde82f1e46aa593d1 Author: Rafael J. Wysocki Date: Wed Aug 10 18:17:23 2022 +0200 ACPI: scan: Eliminate __acpi_device_add() Instead of having acpi_device_add() defined as a wrapper around __acpi_device_add(), export acpi_tie_acpi_dev() so it can be called directly by acpi_add_power_resource(), fold acpi_device_add() into the latter and rename __acpi_device_add() to acpi_device_add(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Punit Agrawal commit 5c5e1237032aaa39107e2d0bb8e6cb84b3c41161 Author: Rafael J. Wysocki Date: Wed Aug 10 18:16:33 2022 +0200 ACPI: scan: Rearrange initialization of ACPI device objects The initialization of ACPI device objects is split between acpi_init_device_object() and __acpi_device_add() that initializes the dev field in struct acpi_device. The "release" function pointer is passed to __acpi_device_add() for this reason. However, that split is artificial and all of the initialization can be carried out by acpi_init_device_object(), so rearrange the code to that end. In particular, make acpi_init_device_object() take the "release" pointer as an argument, along with the "type" which is related to it, instead of __acpi_device_add(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Punit Agrawal commit f6f1e12f3add6e9d85d9fa1916bf4b2a39d8c194 Author: Rafael J. Wysocki Date: Wed Aug 10 18:15:24 2022 +0200 ACPI: scan: Rename acpi_bus_get_parent() and rearrange it The acpi_bus_get_parent() name doesn't really reflect the purpose of the function so change it to a more accurate acpi_find_parent_acpi_dev(). While at it, rearrange the code inside that function to make it easier to read. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Punit Agrawal commit 45e9aa1fdbb2ebafec88c64bc53fe45cf8935b49 Author: Rafael J. Wysocki Date: Wed Aug 10 18:14:22 2022 +0200 ACPI: Rename acpi_bus_get/put_acpi_device() Because acpi_bus_get_acpi_device() is completely analogous to acpi_fetch_acpi_dev(), rename it to acpi_get_acpi_dev() and add a kerneldoc comment to it. Accordingly, rename acpi_bus_put_acpi_device() to acpi_put_acpi_dev() and update all of the users of these two functions. While at it, move the acpi_fetch_acpi_dev() header next to the acpi_get_acpi_dev() header in the header file holding them. Signed-off-by: Rafael J. Wysocki Acked-by: Guenter Roeck Reviewed-by: Punit Agrawal commit 0f9fa5f58c78426a93983a2cc0127fd98b020403 Author: Steev Klimaszewski Date: Wed Jul 20 00:41:52 2022 -0500 drm/panel-edp: add IVO M133NW4J-R3 panel entry Add an eDP panel entry for IVO M133NW4J-R3. Due to lack of documentation, use the delay_200_500_p2e100 timings for now. Signed-off-by: Steev Klimaszewski [dianders: fixed typo in commit message] Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220720054152.2450-1-steev@kali.org commit 83ebec7e0b4c2847d9cff2bcf1324cfc5287dfcb Author: wangjianli Date: Sun Aug 21 22:30:38 2022 +0800 subdev/clk: fix repeated words in comments Delete the redundant word 'at'. Signed-off-by: wangjianli Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20220821143038.46589-1-wangjianli@cdjrlc.com commit f1bd8b2e89cc755b2d1b07058b8afbae2fa302dd Author: Jean-Philippe Brucker Date: Mon Aug 22 16:22:24 2022 +0100 dt-bindings: interrupt-controller: arm,gic: Support two address and size cells It should be valid for a GICv2m node, child of a GICv2 node, to use two cells per reg address and size. The QEMU virt device-tree currently fails validation because the schema imposes a single address and size cell. Amend the rule. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Rob Herring Acked-by: Marc Zyngier Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220822152224.507497-4-jean-philippe@linaro.org commit 92572a8ec3d8b4dc186eeefa1c973645c0753ae0 Author: Jean-Philippe Brucker Date: Mon Aug 22 16:22:23 2022 +0100 dt-bindings: interrupt-controller: arm,gic-v3: Make 'interrupts' optional A GICv3 implementation without virtualization, such as the base QEMU virt machine (without -M virtualization=on), does not issue maintenance interrupts. Therefore its device-tree node does not need an 'interrupts' property. Currently, validating the QEMU virt device-tree throws a warning that 'interrupts' is missing. Make it optional. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Rob Herring Acked-by: Marc Zyngier Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220822152224.507497-3-jean-philippe@linaro.org commit 5926586f291b53cb8a0c9631fc19489be1186e2d Author: Mimi Zohar Date: Wed Aug 17 17:18:42 2022 -0400 ima: fix blocking of security.ima xattrs of unsupported algorithms Limit validating the hash algorithm to just security.ima xattr, not the security.evm xattr or any of the protected EVM security xattrs, nor posix acls. Fixes: 50f742dd9147 ("IMA: block writes of the security.ima xattr with unsupported algorithms") Reported-by: Christian Brauner Acked-by: Christian Brauner (Microsoft) Signed-off-by: Mimi Zohar commit 2bfbb0271a5b48c01c711d1509a422a7244c9eb8 Author: ye xingchen Date: Mon Aug 22 01:38:30 2022 +0000 mm/slub: Remove the unneeded result variable Return the value from attribute->store(s, buf, len) and attribute->show(s, buf) directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: ye xingchen Signed-off-by: Vlastimil Babka commit 869e3bb7acb59d88c1226892136661810e8223a4 Author: Jouni Högander Date: Mon Aug 22 17:08:36 2022 +0300 drm/i915/backlight: Disable pps power hook for aux based backlight Pps power hook seems to be problematic for backlight controlled via aux channel. Disable it for such cases. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3657 Cc: stable@vger.kernel.org Signed-off-by: Jouni Högander Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220822140836.534432-1-jouni.hogander@intel.com commit 610f9c00ce6ed894caf9bb4feb3c026339150233 Author: ye xingchen Date: Tue Aug 23 07:52:41 2022 +0000 mm/slab_common: Remove the unneeded result variable Return the value from __kmem_cache_shrink() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 24e18c8e985eb2848a180318cf4dc7938425f013 Author: Martin Kaiser Date: Mon Aug 22 22:13:29 2022 +0200 staging: r8188eu: always update the status variables Always update the status variables in rtw_led_control when we start blinking because of no link. The code is easier to understand without the if conditions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220822201329.95559-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c00218cd07c367f7bf2229bfa0fad10d76126a0e Author: Martin Kaiser Date: Mon Aug 22 22:13:28 2022 +0200 staging: r8188eu: always cancel blink_work In rtw_led_control, we can always cancel a running blink worker when we start blinking because of no link. The worker will be scheduled again and there's no point in having more than one pending blink worker. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220822201329.95559-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1102e4e7e9d3790b27876cd2713be3d25765eaae Author: Martin Kaiser Date: Mon Aug 22 22:13:27 2022 +0200 staging: r8188eu: don't restart "no link" blinking unnecessarily Simplify one of the cases in rtw_led_control. If we're already blinking because we have no link, we don't have to restart this blinking when the caller requests it again. We can simply return and keep on blinking. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220822201329.95559-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d16d09e38c21a7cfc9ae24d974a7cce7681047e5 Author: Michael Straube Date: Sun Aug 21 14:31:38 2022 +0200 staging: r8188eu: remove unused module parameter rtw_chip_version The module parameter rtw_chip_version sets the chip_version field of struct registry_priv but that field is never used in the driver code. Remove the unused module parameter. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220821123138.8070-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 53df89033a354c52588f7c780553aedcc21f4b67 Author: Michael Straube Date: Sat Aug 20 20:16:23 2022 +0200 staging: r8188eu: remove xmit_osdep.h After previous cleanups the header xmit_osdep.h only contains some structure forward declarations and extern declarations for some module parameters. The forward declarations are not needed. We can make the module parameters static in os_dep/os_intf.c and remove xmit_osdep.h. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-20-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3e0a6c4414ac7642676575ad9d7dee2120bfdd0d Author: Michael Straube Date: Sat Aug 20 20:16:22 2022 +0200 staging: r8188eu: remove os_dep/xmit_linux.c Move the last remaining function rtw_xmit_entry(), and the static functions it calls, from os_dep/xmit_linux.c to core/rtw_xmit.c and remove the now empty file os_dep/xmit_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-19-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 30699f237b715124c5c0a34cac5ee831baaac708 Author: Michael Straube Date: Sat Aug 20 20:16:21 2022 +0200 staging: r8188eu: rename rtw_os_pkt_complete() The function rtw_os_pkt_complete() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_pkt_complete(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-18-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 16870509e9630332fd0436dde2fcc4ec7533c075 Author: Michael Straube Date: Sat Aug 20 20:16:20 2022 +0200 staging: r8188eu: make rtw_os_pkt_complete() static The function rtw_os_pkt_complete() is only used in rtw_xmit.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-17-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a80425de81f9b4c76a621b86f347f0b79ae3e97a Author: Michael Straube Date: Sat Aug 20 20:16:19 2022 +0200 staging: r8188eu: rename rtw_os_xmit_complete() The function rtw_os_xmit_complete() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_complete(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-16-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 49e6460014597167cf04820ad4fd9185b12dde76 Author: Michael Straube Date: Sat Aug 20 20:16:18 2022 +0200 staging: r8188eu: move rtw_os_xmit_complete() to rtw_xmit.c Move the function rtw_os_xmit_complete() from the os_dep/xmit_linux.c to core/rtw_xmit.c. The goal is to get rid of os_dep/xmit_linux.c in follow up patches. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-15-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 65d159d79be5d13f7c4da7903d88e75c28b8064a Author: Michael Straube Date: Sat Aug 20 20:16:17 2022 +0200 staging: r8188eu: move struct pkt_file to rtw_xmit.h The code that uses struct pkt_file has been moved to rtw_xmit.c. Move the structure definition to rtw_xmit.h. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-14-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b9a0b94f63df952f6034a96a4142edb32b2a12f2 Author: Michael Straube Date: Sat Aug 20 20:16:16 2022 +0200 staging: r8188eu: remove unnecessary initialization to zero The initialization to zero of the variable 'len' in rtw_pktfile_read() is not needed. It is immediately set to another value. Remove the initialization to zero. While at it, remove an extra space. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-13-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fa808149cac7a24f4eba16946635ec3231a1c775 Author: Michael Straube Date: Sat Aug 20 20:16:15 2022 +0200 staging: r8188eu: rename _rtw_pktfile_read() There is no need to prefix the function name of _rtw_pktfile_read() with an underscore. Rename it to rtw_pktfile_read(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 81c9d573e88bd4a0d3bc29b27933f8e9000b22ed Author: Michael Straube Date: Sat Aug 20 20:16:14 2022 +0200 staging: r8188eu: make _rtw_pktfile_read() static The function _rtw_pktfile_read() is only used in rtw_xmit.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0fb8749e3bfb008168bf289b9b25a57014cab2e8 Author: Michael Straube Date: Sat Aug 20 20:16:13 2022 +0200 staging: r8188eu: rename _rtw_open_pktfile() There is no need to prefix the function name of _rtw_open_pktfile() with an underscore. Rename it to rtw_open_pktfile(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2ae2664fe8b3bb622ccee2083dbb9b0d75a4c88b Author: Michael Straube Date: Sat Aug 20 20:16:12 2022 +0200 staging: r8188eu: make _rtw_open_pktfile() static The function _rtw_open_pktfile() is only used in rtw_xmit.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 37fe9996262471a01ae89e7c651cfdfc51ab2a03 Author: Michael Straube Date: Sat Aug 20 20:16:11 2022 +0200 staging: r8188eu: rename rtw_os_xmit_resource_free() The function rtw_os_xmit_resource_free() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_resource_free(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 05571d2787d98731e4bc886618552d2bdaace54a Author: Michael Straube Date: Sat Aug 20 20:16:10 2022 +0200 staging: r8188eu: make rtw_os_xmit_resource_free() static The function rtw_os_xmit_resource_free() is only used in rtw_xmit.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fc29443aff68b45d07e69558c186404fc890f635 Author: Michael Straube Date: Sat Aug 20 20:16:09 2022 +0200 staging: r8188eu: rename rtw_os_xmit_resource_alloc() The function rtw_os_xmit_resource_alloc() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_resource_alloc(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 77784b67c5912fb4b25c30e4dff677fea9815a8b Author: Michael Straube Date: Sat Aug 20 20:16:08 2022 +0200 staging: r8188eu: make rtw_os_xmit_resource_alloc() static The function rtw_os_xmit_resource_alloc() is only used in rtw_xmit.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9619eca8fb20507d64ab39ec7d1ee1dce3936967 Author: Michael Straube Date: Sat Aug 20 20:16:07 2022 +0200 staging: r8188eu: rename rtw_os_xmit_schedule() The function rtw_os_xmit_schedule() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_schedule(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit dbae0ba2f3c43aa24782d5a3d0aaac796f90ead1 Author: Michael Straube Date: Sat Aug 20 20:16:06 2022 +0200 staging: r8188eu: make rtw_os_xmit_schedule() static The function rtw_os_xmit_schedule() is only used in rtw_mlme.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 760964b034bc17b08cb21d6a8bc0b2dc8218c58f Author: Michael Straube Date: Sat Aug 20 20:16:05 2022 +0200 staging: r8188eu: make rtw_remainder_len() static The function rtw_remainder_len() is only used in xmit_linux.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220820181623.12497-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4ce515776e88e38db2439f6a698f5749427c4711 Author: Nam Cao Date: Sat Aug 20 20:34:51 2022 +0200 staging: rtl8723bs: remove odm_NoiseMonitor.h and odm_NoiseMonitor.c because the content of these files is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/6f51a3531ffe60650972bd9f288570db55e3e0ec.1661020250.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit af2c14d3ea20bc249e9d297c6cb7045a640d11eb Author: Nam Cao Date: Sat Aug 20 20:34:50 2022 +0200 staging: rtl8723bs: remove member noise_level from struct dm_odm_t because it is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/5a8256d3823baaa72775da80d821749dfbda7ad4.1661020250.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit e86954145b0fbf64c308fbca91233598c60a34b2 Author: Nam Cao Date: Sat Aug 20 20:34:49 2022 +0200 staging: rtl8723bs: remove unused function ODM_InbandNoise_Monitor because this function is not used. Also remove function odm_InbandNoise_Monitor_NSeries because it is a static function which is only called from ODM_InbandNoise_Monitor. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/46d73e331bae2192a328f6691763f39ea6c18b08.1661020250.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4064bdc39e4f2873457e12e5118223c8354ce88 Author: Nam Cao Date: Fri Aug 19 15:49:42 2022 +0200 staging: rtl8723bs: remove static const variable odm_comp_str because it is not used. Link: https://lore.kernel.org/linux-staging/202208192018.BfgiZyOY-lkp@intel.com/ Reported-by: kernel test robot Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/678b03dad7217e70e61074d11975319cb1c1828c.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit bf9b4c6c603ea6def3a655fc49450b2eb2220433 Author: Nam Cao Date: Fri Aug 19 15:49:41 2022 +0200 staging: rtl8723bs: remove function rtw_odm_dbg_comp_set because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/e1927eb6151d39b53a6ce1eed1d7ad20a2d633be.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8459a01134927495f1508d7869d755313c0423a2 Author: Nam Cao Date: Fri Aug 19 15:49:40 2022 +0200 staging: rtl8723bs: remove function rtw_odm_adaptivity_parm_msg because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/24c3baa696adb7633d643258b60bba9bcd18b953.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 38117692d603162bf1e12fd8ab79ffca703aa149 Author: Nam Cao Date: Fri Aug 19 15:49:39 2022 +0200 staging: rtl8723bs: remove function IsCommentString because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/c062f678dc8f99c18a251f6137c4c3883f8c8205.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 629481c3dcc37507f9cb0cae6a4fc7ae52d22eae Author: Nam Cao Date: Fri Aug 19 15:49:38 2022 +0200 staging: rtl8723bs: remove function GetFractionValueFromString because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/e782bcd3ff8c33df8da7eb6b8e4bb00b1c270edc.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit db1b762eacf96e3c63a84a152056c439e3d70524 Author: Nam Cao Date: Fri Aug 19 15:49:37 2022 +0200 staging: rtl8723bs: remove function rtw_odm_ability_set because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/35d0f2115fa6febd72a1a7d1c740dece3d55a3df.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3c03b91a304422922c3b2501c2980bac6170f4d1 Author: Nam Cao Date: Fri Aug 19 15:49:36 2022 +0200 staging: rtl8723bs: remove function rtw_get_ch_setting_union because this function is not used. Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/c8c5b0c78ee9a4cd8304efeff22b51049c75a3f2.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit fcb7fde244ec07ad61c361daf1be290af9ee74d3 Author: Nam Cao Date: Fri Aug 19 15:49:35 2022 +0200 staging: rtl8723bs: remove function rtw_odm_dbg_comp_msg because this function is not used. Reported-by: kernel test robot Reviewed-by: Hans de Goede Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/7ff2d658863db4fd5eecc1a53f682510c2765c3f.1660916523.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit e5781d82816768d784610646bf5d40127d6e4c7c Author: Nam Cao Date: Thu Aug 18 21:54:55 2022 +0200 staging: r8188eu: remove ioctl_cfg80211.h Remove header file ioctl_cfg80211.h because it is not used. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20220818195454.11822-1-namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman commit 54096ef58119edca677cbd0d772910ef6bfb6066 Author: Michael Straube Date: Fri Aug 19 20:23:59 2022 +0200 staging: r8188eu: remove ODM_ConfigRFWithHeaderFile() The function ODM_ConfigRFWithHeaderFile() is just a wrapper around ODM_ReadAndConfig_RadioA_1T_8188E(). Remove the wrapper and call ODM_ReadAndConfig_RadioA_1T_8188E() directly. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819182359.24141-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a024f786a538bdbb331d7c308dc51eea31831150 Author: Michael Straube Date: Fri Aug 19 14:54:28 2022 +0200 staging: r8188eu: remove unused function parameter The parameter 'aborted' of rtw_indicate_scan_done() is not used. Remove it. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9863e257f53e629a5ceccdeb9bb3cc8a04c9deae Author: Michael Straube Date: Fri Aug 19 14:54:27 2022 +0200 staging: r8188eu: merge rtw_{os,}_indicate_scan_done() Merge rtw_os_indicate_scan_done() into rtw_indicate_scan_done(). It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 29c34f1d08e4d29b23dc919bbd02e56f41aff0ce Author: Michael Straube Date: Fri Aug 19 14:54:26 2022 +0200 staging: r8188eu: merge rtw_{os,}_indicate_connect() Merge rtw_os_indicate_connect() into rtw_indicate_connect(). It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 93535436cc93d2425c0c03149a64832de9e3c79e Author: Michael Straube Date: Fri Aug 19 14:54:25 2022 +0200 staging: r8188eu: merge rtw_{os,}_indicate_disconnect() Merge rtw_os_indicate_disconnect() into rtw_indicate_disconnect(). The function rtw_os_indicate_disconnect() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 90fdc7a9e4f4ccda126530a10f5ed1aec753d201 Author: Michael Straube Date: Fri Aug 19 14:54:24 2022 +0200 staging: r8188eu: make rtw_reset_securitypriv() static The function rtw_reset_securitypriv() is only used in rtw_mlme.c. Make rtw_reset_securitypriv() and its user rtw_os_indicate_disconnect() static to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c0d84701e68ca842a5d17007c6044af870f4e559 Author: Michael Straube Date: Fri Aug 19 14:54:23 2022 +0200 staging: r8188eu: remove unneeded initializations In the function rtw_reset_securitypriv() three variables are initialized to zero. That is not necessary because they are all set before use in the code. Remove the initializations. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1b0be68c1c2330183ad81c6fe900ca59837dae9d Author: Michael Straube Date: Fri Aug 19 14:54:22 2022 +0200 staging: r8188eu: make rtw_report_sec_ie() static The function rtw_report_sec_ie() is only used in rtw_mlme.c. Make it static to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fcd233451c9030aac4635e7bcb71a86e15fe1eb2 Author: Michael Straube Date: Fri Aug 19 14:54:21 2022 +0200 staging: r8188eu: move rtw_indicate_sta_assoc_event() to rtw_ap.c Move the function rtw_indicate_sta_assoc_event() to core/rtw_ap.c to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit de743211d3bcf62c92ae10c584885a42fb4bce99 Author: Michael Straube Date: Fri Aug 19 14:54:20 2022 +0200 staging: r8188eu: make rtw_indicate_sta_disassoc_event() static The function rtw_indicate_sta_disassoc_event() is only used in rtw_ap.c. Make it static to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3f9900ae56d99ddd0499b01b61e321220b188aa6 Author: Michael Straube Date: Fri Aug 19 14:54:19 2022 +0200 staging: r8188eu: make init_addba_retry_timer() static The function init_addba_retry_timer() is only used in rtw_sta_mgt.c. Make it static to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8c572625a43f6e857845393765a7557cf5f06253 Author: Michael Straube Date: Fri Aug 19 14:54:18 2022 +0200 staging: r8188eu: make init_mlme_ext_timer() static The function init_mlme_ext_timer() is only used in rtw_mlme_ext.c. Make it static to get one step closer to removing os_dep/mlme_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220819125428.8412-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 88eba30beb9cb4de3d4769bad2112f0b5d8785e2 Author: Wolfram Sang Date: Thu Aug 18 23:01:08 2022 +0200 staging: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210108.7397-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit 040b83fcecfb86f3225d3a5de7fd9b3fbccf83b4 Author: Yu Kuai Date: Wed Aug 3 20:15:04 2022 +0800 sbitmap: fix possible io hung due to lost wakeup There are two problems can lead to lost wakeup: 1) invalid wakeup on the wrong waitqueue: For example, 2 * wake_batch tags are put, while only wake_batch threads are woken: __sbq_wake_up atomic_cmpxchg -> reset wait_cnt __sbq_wake_up -> decrease wait_cnt ... __sbq_wake_up -> wait_cnt is decreased to 0 again atomic_cmpxchg sbq_index_atomic_inc -> increase wake_index wake_up_nr -> wake up and waitqueue might be empty sbq_index_atomic_inc -> increase again, one waitqueue is skipped wake_up_nr -> invalid wake up because old wakequeue might be empty To fix the problem, increasing 'wake_index' before resetting 'wait_cnt'. 2) 'wait_cnt' can be decreased while waitqueue is empty As pointed out by Jan Kara, following race is possible: CPU1 CPU2 __sbq_wake_up __sbq_wake_up sbq_wake_ptr() sbq_wake_ptr() -> the same wait_cnt = atomic_dec_return() /* decreased to 0 */ sbq_index_atomic_inc() /* move to next waitqueue */ atomic_set() /* reset wait_cnt */ wake_up_nr() /* wake up on the old waitqueue */ wait_cnt = atomic_dec_return() /* * decrease wait_cnt in the old * waitqueue, while it can be * empty. */ Fix the problem by waking up before updating 'wake_index' and 'wait_cnt'. With this patch, noted that 'wait_cnt' is still decreased in the old empty waitqueue, however, the wakeup is redirected to a active waitqueue, and the extra decrement on the old empty waitqueue is not handled. Fixes: 88459642cba4 ("blk-mq: abstract tag allocation out into sbitmap library") Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220803121504.212071-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit b56683d416aee135d2c208970d3d42cd886f47d8 Author: Michael Straube Date: Wed Aug 17 08:32:23 2022 +0200 staging: r8188eu: remove rtw_endofpktfile() The function rtw_endofpktfile() just checks for pkt_len == 0. Remove rtw_endofpktfile() and merge the check into the caller to improve readability and simplify the driver code. Reviewed-by: Philipp Hortmann Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220817063223.8140-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7f08e806a03e0453a0de27137b668d4de52fcd49 Author: Jianjun Wang Date: Tue Aug 2 20:06:24 2022 +0800 dt-bindings: PCI: mediatek-gen3: Add support for MT8188 and MT8195 MT8188 and MT8195 are ARM platform SoCs with the same PCIe IP as MT8192. Also add new clock name "peri_mem" since the MT8188 and MT8195 use clock "peri_mem" instead of "top_133m". Link: https://lore.kernel.org/r/20220802120624.19258-1-jianjun.wang@mediatek.com Signed-off-by: Jianjun Wang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Kozlowski commit 8613753a681e7a5c63313dea9b04bf103d601368 Author: Peter Ujfalusi Date: Tue Jul 12 15:57:34 2022 +0300 ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions All code have been switched to use the new FSR defines and macros for ROM/FW state tracking. The old definitions can be dropped now. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220712125734.30512-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 43a03d247091e1fcd3065dae3407b959e8921c16 Author: Peter Ujfalusi Date: Tue Jul 12 15:57:33 2022 +0300 ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup Switch to use the newly added FSR (Firmware State Register) definitions for DSP state handling and targeting. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220712125734.30512-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 034fdac01fe5184e63d8af901ddb9c9a329f6902 Author: Felix Fietkau Date: Thu May 5 10:39:07 2022 +0200 PCI: mediatek-gen3: Change driver name to mtk-pcie-gen3 driver_register() will refuse to register another driver with the same name. This change allows pcie-mediatek-gen3 to coexist with pcie-mediatek built into the kernel. Link: https://lore.kernel.org/r/20220505083907.86598-1-nbd@nbd.name Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192") Signed-off-by: Felix Fietkau Signed-off-by: Lorenzo Pieralisi Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Jianjun Wang commit 361c6e35d3831750af3c308e5ac056ab2971f199 Author: Jani Nikula Date: Mon Aug 15 11:09:07 2022 +0300 drm/i915/utils: remove unused KBps/MBps/GBps macros Remove unused macros. If needed again, such macros belong in . Signed-off-by: Jani Nikula Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220815080907.3229449-1-jani.nikula@intel.com commit db7ad41538439a3dcfebd738959c7526b4e7d528 Author: Nicolas Frattaroli Date: Thu Jul 21 10:33:00 2022 +0200 arm64: dts: rockchip: Add analog audio output on quartz64-b This adds the necessary device tree changes to enable analog audio output on the PINE64 Quartz64 Model B with its RK809 codec. The headphone detection pin is left out for now because I couldn't get it to work and am not sure if it even matters, but for future reference: It's pin GPIO4 RK_PC4, named HP_DET_L_GPIO4_C4 in the schematic. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20220721083301.3711-1-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit 52c135d495ca019abbacf063f5ef43bd5b189070 Author: Serge Semin Date: Mon Aug 22 21:18:53 2022 +0300 spi: dw: Quite logging on deferred controller registration It's pretty possible to have the spi_register_controller() method returning -EPROBE_DEFER status in case, for instance, if the GPIOs used for the CS implementation aren't ready to be requested due to the corresponding platform devices still pending to be probed. Let's make sure the DW SSI driver won't print error message in that case by calling the dev_err_probe() function if the SPI-registration procedure exited with a non-zero status. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220822181853.23063-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 52069b2a869ebdcaedf829730730c5998d56b910 Author: Krzysztof Kozlowski Date: Tue Aug 23 13:09:37 2022 +0300 spi: dt-bindings: snps,dw-apb-ssi: drop ref from reg-io-width reg-io-width is a standard property, so no need for defining its type Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220823100937.386880-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit a557fca630cc6d4a07eb9bac0039e88a6b1c4847 Author: Patrice Chotard Date: Tue Aug 23 09:58:50 2022 +0200 spi: stm32_qspi: Add transfer_one_message() spi callback Add transfer_one_message() spi callback in order to use the QSPI interface as a communication channel using up to 8 qspi lines (QSPI configured in dual flash mode). To enable this mode, both spi-rx-bus-width and spi-tx-bus-width must be set to 8 and cs-qpios must be populated. Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220823075850.575043-3-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit 9048b9912f767ea9609e520678def446af804771 Author: Matti Vaittinen Date: Fri Aug 19 22:17:28 2022 +0300 docs: devres: regulator: Add new get_enable functions to devres.rst Add the new devm_regulator_get_enable() and devm_regulator_get_enable_optional() to devres.rst Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/55efb5a23822b8e1558d560a6ad906eadbc39a17.1660934107.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown commit 026c99b508f060d3c85fda06b21e010683ef5590 Author: Dmitry Rokosov Date: Tue Aug 16 18:14:48 2022 +0000 regmap: introduce value tracing for regmap bulk operations Currently, only one-register io operations support tracepoints with value logging. For the regmap bulk operations developer can view hw_start/hw_done tracepoints with starting reg number and registers count to be reading or writing. This patch injects tracepoints with dumping registers values in the hex format to regmap bulk reading and writing. Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20220816181451.5628-1-ddrokosov@sberdevices.ru Signed-off-by: Mark Brown commit 88630575406fdf2a7853545a884484bd55dab8a0 Author: Shengjiu Wang Date: Tue Aug 23 09:36:13 2022 +0800 ASoC: fsl_sai: Add support multi fifo sdma script With disabling combine mode, the multiple successive FIFO registers or non successive FIFO registers of SAI module can work with the sdma multi fifo script. This patch is to configure the necessary information to the SDMA engine driver for support multi fifo script. 'words_per_fifo' is the channels for each dataline 'n_fifos_src' and 'n_fifos_dst' are the fifo number 'stride_fifos_src' and 'stride_fifos_dst' are the stride between enable FIFOs 'maxburst' is the multiply of datalines Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1661218573-2154-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit d45f552a1e44e2885c4b7551564241959d8138be Author: Daniel Baluta Date: Mon Aug 22 20:49:37 2022 +0300 ASoC: SOF: compress: Remove dai_posn variable dai_posn is set but never used. Initial intention was to use dai_posn to shorthen one code line but it looks fine without it too. Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps") Reported-by: kernel test robot Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20220822174937.254873-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 62bd431bac942c90d908b1681d04f0c577f6c70f Author: ye xingchen Date: Tue Aug 23 07:53:35 2022 +0000 ASoC: atmel_ssc_dai: Remove the unneeded result variable Return the value from asoc_ssc_init() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220823075335.209072-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown commit e8ee449bd7a45e871fc84fe51c773f7a6e68a02f Author: chunxu.li Date: Tue Aug 23 17:07:35 2022 +0800 ASoC: mediatek: mt8186: rename sound card name The field 'topology_shortname' in 'snd_soc_card' is defined as char[32], Current card name will be truncated when SOF is enabled, so rename the sound card name. Signed-off-by: chunxu.li Link: https://lore.kernel.org/r/20220823090735.12176-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 2e379ac66d4b734ba0e6dbdbc20f774d91be090b Author: Pali Rohár Date: Fri Aug 12 16:11:15 2022 +0200 PCI: mvebu: Fix endianness when accessing PCI emul bridge members PCI emul bridge members iolimitupper, iobaseupper, memlimit and membase are of type __le16, so correctly access these members using le16_to_cpu() macros. Link: https://lore.kernel.org/r/20220812141115.24082-1-pali@kernel.org Fixes: e7a01876729c ("PCI: mvebu: Propagate errors when updating PCI_IO_BASE and PCI_MEM_BASE registers") Reported-by: kernel test robot Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 52412f5543920378218f156d061d369f9d4d7a17 Merge: 139b5fbd525ad 291ac1517af58 Author: Paolo Abeni Date: Tue Aug 23 11:39:36 2022 +0200 Merge branch 'dsa-changes-for-multiple-cpu-ports-part-3' Vladimir Oltean says: ==================== DSA changes for multiple CPU ports (part 3) Those who have been following part 1: https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/ and part 2: https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/ will know that I am trying to enable the second internal port pair from the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q". This series represents part 3 of that effort. Covered here are some preparations in DSA for handling multiple DSA masters: - when changing the tagging protocol via sysfs - when the masters go down as well as preparation for monitoring the upper devices of a DSA master (to support DSA masters under a LAG). There are also 2 small preparations for the ocelot driver, for the case where multiple tag_8021q CPU ports are used in a LAG. Both those changes have to do with PGID forwarding domains. Compared to v1, the patches were trimmed down to just another preparation stage, and the UAPI changes were pushed further out to part 4. https://patchwork.kernel.org/project/netdevbpf/cover/20220523104256.3556016-1-olteanv@gmail.com/ Compared to v2, I had to export a symbol I forgot to (ocelot_port_teardown_dsa_8021q_cpu), to avoid a build breakage when the felix and seville drivers are built as modules. ==================== Link: https://lore.kernel.org/r/20220819174820.3585002-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit 291ac1517af58670740528466ccebe3caefb9093 Author: Vladimir Oltean Date: Fri Aug 19 20:48:20 2022 +0300 net: mscc: ocelot: adjust forwarding domain for CPU ports in a LAG Currently when we have 2 CPU ports configured for DSA tag_8021q mode and we put them in a LAG, a PGID dump looks like this: PGID_SRC[0] = ports 4, PGID_SRC[1] = ports 4, PGID_SRC[2] = ports 4, PGID_SRC[3] = ports 4, PGID_SRC[4] = ports 0, 1, 2, 3, 4, 5, PGID_SRC[5] = no ports (ports 0-3 are user ports, ports 4 and 5 are CPU ports) There are 2 problems with the configuration above: - user ports should enable forwarding towards both CPU ports, not just 4, and the aggregation PGIDs should prune one CPU port or the other from the destination port mask, based on a hash computed from packet headers. - CPU ports should not be allowed to forward towards themselves and also not towards other ports in the same LAG as themselves The first problem requires fixing up the PGID_SRC of user ports, when ocelot_port_assigned_dsa_8021q_cpu_mask() is called. We need to say that when a user port is assigned to a tag_8021q CPU port and that port is in a LAG, it should forward towards all ports in that LAG. The second problem requires fixing up the PGID_SRC of port 4, to remove ports 4 and 5 (in a LAG) from the allowed destinations. After this change, the PGID source masks look as follows: PGID_SRC[0] = ports 4, 5, PGID_SRC[1] = ports 4, 5, PGID_SRC[2] = ports 4, 5, PGID_SRC[3] = ports 4, 5, PGID_SRC[4] = ports 0, 1, 2, 3, PGID_SRC[5] = no ports Note that PGID_SRC[5] still looks weird (it should say "0, 1, 2, 3" just like PGID_SRC[4] does), but I've tested forwarding through this CPU port and it doesn't seem like anything is affected (it appears that PGID_SRC[4] is being looked up on forwarding from the CPU, since both ports 4 and 5 have logical port ID 4). The reason why it looks weird is because we've never called ocelot_port_assign_dsa_8021q_cpu() for any user port towards port 5 (all user ports are assigned to port 4 which is in a LAG with 5). Since things aren't broken, I'm willing to leave it like that for now and just document the oddity. Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 36a0bf44358597dee6947938e8643c61442cab87 Author: Vladimir Oltean Date: Fri Aug 19 20:48:19 2022 +0300 net: mscc: ocelot: set up tag_8021q CPU ports independent of user port affinity This is a partial revert of commit c295f9831f1d ("net: mscc: ocelot: switch from {,un}set to {,un}assign for tag_8021q CPU ports"), because as it turns out, this isn't how tag_8021q CPU ports under a LAG are supposed to work. Under that scenario, all user ports are "assigned" to the single tag_8021q CPU port represented by the logical port corresponding to the bonding interface. So one CPU port in a LAG would have is_dsa_8021q_cpu set to true (the one whose physical port ID is equal to the logical port ID), and the other one to false. In turn, this makes 2 undesirable things happen: (1) PGID_CPU contains only the first physical CPU port, rather than both (2) only the first CPU port will be added to the private VLANs used by ocelot for VLAN-unaware bridging To make the driver behave in the same way for both bonded CPU ports, we need to bring back the old concept of setting up a port as a tag_8021q CPU port, and this is what deals with VLAN membership and PGID_CPU updating. But we also need the CPU port "assignment" (the user to CPU port affinity), and this is what updates the PGID_SRC forwarding rules. All DSA CPU ports are statically configured for tag_8021q mode when the tagging protocol is changed to ocelot-8021q. User ports are "assigned" to one CPU port or the other dynamically (this will be handled by a future change). Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 5dc760d1208200daaf49a2ff56a0e7dfa2d80bb2 Author: Vladimir Oltean Date: Fri Aug 19 20:48:18 2022 +0300 net: dsa: use dsa_tree_for_each_cpu_port in dsa_tree_{setup,teardown}_master More logic will be added to dsa_tree_setup_master() and dsa_tree_teardown_master() in upcoming changes. Reduce the indentation by one level in these functions by introducing and using a dedicated iterator for CPU ports of a tree. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit f41ec1fd1c20e2a4e60a4ab8490b3e63423c0a8a Author: Vladimir Oltean Date: Fri Aug 19 20:48:17 2022 +0300 net: dsa: all DSA masters must be down when changing the tagging protocol The fact that the tagging protocol is set and queried from the /sys/class/net//dsa/tagging file is a bit of a quirk from the single CPU port days which isn't aging very well now that DSA can have more than a single CPU port. This is because the tagging protocol is a switch property, yet in the presence of multiple CPU ports it can be queried and set from multiple sysfs files, all of which are handled by the same implementation. The current logic ensures that the net device whose sysfs file we're changing the tagging protocol through must be down. That net device is the DSA master, and this is fine for single DSA master / CPU port setups. But exactly because the tagging protocol is per switch [ tree, in fact ] and not per DSA master, this isn't fine any longer with multiple CPU ports, and we must iterate through the tree and find all DSA masters, and make sure that all of them are down. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 7136097e11996417da59c67682694d8a5a7f3f4b Author: Vladimir Oltean Date: Fri Aug 19 20:48:16 2022 +0300 net: dsa: only bring down user ports assigned to a given DSA master This is an adaptation of commit c0a8a9c27493 ("net: dsa: automatically bring user ports down when master goes down") for multiple DSA masters. When a DSA master goes down, only the user ports under its control should go down too, the others can still send/receive traffic. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 4f03dcc6b9a0734d755601002e33adbd42469b47 Author: Vladimir Oltean Date: Fri Aug 19 20:48:15 2022 +0300 net: dsa: existing DSA masters cannot join upper interfaces All the traffic to/from a DSA master is supposed to be distributed among its DSA switch upper interfaces, so we should not allow other upper device kinds. An exception to this is DSA_TAG_PROTO_NONE (switches with no DSA tags), and in that case it is actually expected to create e.g. VLAN interfaces on the master. But for those, netdev_uses_dsa(master) returns false, so the restriction doesn't apply. The motivation for this change is to allow LAG interfaces of DSA masters to be DSA masters themselves. We want to restrict the user's degrees of freedom by 1: the LAG should already have all DSA masters as lowers, and while lower ports of the LAG can be removed, none can be added after the fact. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 920a33cd72314f4ea96b5224fa8c7d4472d81880 Author: Vladimir Oltean Date: Fri Aug 19 20:48:14 2022 +0300 net: bridge: move DSA master bridging restriction to DSA When DSA gains support for multiple CPU ports in a LAG, it will become mandatory to monitor the changeupper events for the DSA master. In fact, there are already some restrictions to be imposed in that area, namely that a DSA master cannot be a bridge port except in some special circumstances. Centralize the restrictions at the level of the DSA layer as a preliminary step. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Nikolay Aleksandrov Signed-off-by: Paolo Abeni commit 0498277ee17bb40cef43e0c9064b06c25f9bda29 Author: Vladimir Oltean Date: Fri Aug 19 20:48:13 2022 +0300 net: dsa: don't stop at NOTIFY_OK when calling ds->ops->port_prechangeupper dsa_slave_prechangeupper_sanity_check() is supposed to enforce some adjacency restrictions, and calls ds->ops->port_prechangeupper if the driver implements it. We convert the error code from the port_prechangeupper() call to a notifier code, and 0 is converted to NOTIFY_OK, but the caller of dsa_slave_prechangeupper_sanity_check() stops at any notifier code different from NOTIFY_DONE. Avoid this by converting back the notifier code to an error code, so that both NOTIFY_OK and NOTIFY_DONE will be seen as 0. This allows more parallel sanity check functions to be added. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit 4c3f80d22b2eca911143ce656fa45c4699ff5bf4 Author: Vladimir Oltean Date: Fri Aug 19 20:48:12 2022 +0300 net: dsa: walk through all changeupper notifier functions Traditionally, DSA has had a single netdev notifier handling function for each device type. For the sake of code cleanliness, we would like to introduce more handling functions which do one thing, but the conditions for entering these functions start to overlap. Example: a handling function which tracks whether any bridges contain both DSA and non-DSA interfaces. Either this is placed before dsa_slave_changeupper(), case in which it will prevent that function from executing, or we place it after dsa_slave_changeupper(), case in which we will prevent it from executing. The other alternative is to ignore errors from the new handling function (not ideal). To support this usage, we need to change the pattern. In the new model, we enter all notifier handling sub-functions, and exit with NOTIFY_DONE if there is nothing to do. This allows the sub-functions to be relatively free-form and independent from each other. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni commit e4fe074d6c359c19b74564fa1364fe48343cfa5d Author: Chengming Zhou Date: Thu Aug 18 20:48:05 2022 +0800 sched/fair: Don't init util/runnable_avg for !fair task post_init_entity_util_avg() init task util_avg according to the cpu util_avg at the time of fork, which will decay when switched_to_fair() some time later, we'd better to not set them at all in the case of !fair task. Suggested-by: Vincent Guittot Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-10-zhouchengming@bytedance.com commit d6531ab6e50149ab2a144b0f4787cb9277d0893f Author: Chengming Zhou Date: Thu Aug 18 20:48:04 2022 +0800 sched/fair: Move task sched_avg attach to enqueue_task_fair() When wake_up_new_task(), we use post_init_entity_util_avg() to init util_avg/runnable_avg based on cpu's util_avg at that time, and attach task sched_avg to cfs_rq. Since enqueue_task_fair() -> enqueue_entity() -> update_load_avg() loop will do attach, we can move this work to update_load_avg(). wake_up_new_task(p) post_init_entity_util_avg(p) attach_entity_cfs_rq() --> (1) activate_task(rq, p) enqueue_task() := enqueue_task_fair() enqueue_entity() loop update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH) if (!se->avg.last_update_time && (flags & DO_ATTACH)) attach_entity_load_avg() --> (2) This patch move attach from (1) to (2), update related comments too. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-9-zhouchengming@bytedance.com commit df16b71c686cb096774e30153c9ce6756450796c Author: Chengming Zhou Date: Thu Aug 18 20:48:03 2022 +0800 sched/fair: Allow changing cgroup of new forked task commit 7dc603c9028e ("sched/fair: Fix PELT integrity for new tasks") introduce a TASK_NEW state and an unnessary limitation that would fail when changing cgroup of new forked task. Because at that time, we can't handle task_change_group_fair() for new forked fair task which hasn't been woken up by wake_up_new_task(), which will cause detach on an unattached task sched_avg problem. This patch delete this unnessary limitation by adding check before do detach or attach in task_change_group_fair(). So cpu_cgrp_subsys.can_attach() has nothing to do for fair tasks, only define it in #ifdef CONFIG_RT_GROUP_SCHED. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-8-zhouchengming@bytedance.com commit 7e2edaf61814fb6aa363989d718950c023b882d4 Author: Chengming Zhou Date: Thu Aug 18 20:48:02 2022 +0800 sched/fair: Fix another detach on unattached task corner case commit 7dc603c9028e ("sched/fair: Fix PELT integrity for new tasks") fixed two load tracking problems for new task, including detach on unattached new task problem. There still left another detach on unattached task problem for the task which has been woken up by try_to_wake_up() and waiting for actually being woken up by sched_ttwu_pending(). try_to_wake_up(p) cpu = select_task_rq(p) if (task_cpu(p) != cpu) set_task_cpu(p, cpu) migrate_task_rq_fair() remove_entity_load_avg() --> unattached se->avg.last_update_time = 0; __set_task_cpu() ttwu_queue(p, cpu) ttwu_queue_wakelist() __ttwu_queue_wakelist() task_change_group_fair() detach_task_cfs_rq() detach_entity_cfs_rq() detach_entity_load_avg() --> detach on unattached task set_task_rq() attach_task_cfs_rq() attach_entity_cfs_rq() attach_entity_load_avg() The reason of this problem is similar, we should check in detach_entity_cfs_rq() that se->avg.last_update_time != 0, before do detach_entity_load_avg(). Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-7-zhouchengming@bytedance.com commit e1f078f50478a51849453341e7356cb298df00cf Author: Chengming Zhou Date: Thu Aug 18 20:48:01 2022 +0800 sched/fair: Combine detach into dequeue when migrating task When we are migrating task out of the CPU, we can combine detach and propagation into dequeue_entity() to save the detach_entity_cfs_rq() in migrate_task_rq_fair(). This optimization is like combining DO_ATTACH in the enqueue_entity() when migrating task to the CPU. So we don't have to traverse the CFS tree extra time to do the detach_entity_cfs_rq() -> propagate_entity_cfs_rq(), which wouldn't be called anymore with this patch's change. detach_task() deactivate_task() dequeue_task_fair() for_each_sched_entity(se) dequeue_entity() update_load_avg() /* (1) */ detach_entity_load_avg() set_task_cpu() migrate_task_rq_fair() detach_entity_cfs_rq() /* (2) */ update_load_avg(); detach_entity_load_avg(); propagate_entity_cfs_rq(); for_each_sched_entity() update_load_avg() This patch save the detach_entity_cfs_rq() called in (2) by doing the detach_entity_load_avg() for a CPU migrating task inside (1) (the task being the first se in the loop) Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-6-zhouchengming@bytedance.com commit 859f206290f345c151a6005de639ba9677bf3e18 Author: Chengming Zhou Date: Thu Aug 18 20:48:00 2022 +0800 sched/fair: Update comments in enqueue/dequeue_entity() When reading the sched_avg related code, I found the comments in enqueue/dequeue_entity() are not updated with the current code. We don't add/subtract entity's runnable_avg from cfs_rq->runnable_avg during enqueue/dequeue_entity(), those are done only for attach/detach. This patch updates the comments to reflect the current code working. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-5-zhouchengming@bytedance.com commit 5d6da83c44af70ede7bfd0fd6d1ef8a3b3e0402c Author: Chengming Zhou Date: Thu Aug 18 20:47:59 2022 +0800 sched/fair: Reset sched_avg last_update_time before set_task_rq() set_task_rq() -> set_task_rq_fair() will try to synchronize the blocked task's sched_avg when migrate, which is not needed for already detached task. task_change_group_fair() will detached the task sched_avg from prev cfs_rq first, so reset sched_avg last_update_time before set_task_rq() to avoid that. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-4-zhouchengming@bytedance.com commit 39c4261191bf05e7eb310f852980a6d0afe5582a Author: Chengming Zhou Date: Thu Aug 18 20:47:58 2022 +0800 sched/fair: Remove redundant cpu_cgrp_subsys->fork() We use cpu_cgrp_subsys->fork() to set task group for the new fair task in cgroup_post_fork(). Since commit b1e8206582f9 ("sched: Fix yet more sched_fork() races") has already set_task_rq() for the new fair task in sched_cgroup_fork(), so cpu_cgrp_subsys->fork() can be removed. cgroup_can_fork() --> pin parent's sched_task_group sched_cgroup_fork() __set_task_cpu() set_task_rq() cgroup_post_fork() ss->fork() := cpu_cgroup_fork() sched_change_group(..., TASK_SET_GROUP) task_set_group_fair() set_task_rq() --> can be removed After this patch's change, task_change_group_fair() only need to care about task cgroup migration, make the code much simplier. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Reviewed-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20220818124805.601-3-zhouchengming@bytedance.com commit 78b6b15770618efb60d84e2d605f6b93dc94051b Author: Chengming Zhou Date: Thu Aug 18 20:47:57 2022 +0800 sched/fair: Maintain task se depth in set_task_rq() Previously we only maintain task se depth in task_move_group_fair(), if a !fair task change task group, its se depth will not be updated, so commit eb7a59b2c888 ("sched/fair: Reset se-depth when task switched to FAIR") fix the problem by updating se depth in switched_to_fair() too. Then commit daa59407b558 ("sched/fair: Unify switched_{from,to}_fair() and task_move_group_fair()") unified these two functions, moved se.depth setting to attach_task_cfs_rq(), which further into attach_entity_cfs_rq() with commit df217913e72e ("sched/fair: Factorize attach/detach entity"). This patch move task se depth maintenance from attach_entity_cfs_rq() to set_task_rq(), which will be called when CPU/cgroup change, so its depth will always be correct. This patch is preparation for the next patch. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-2-zhouchengming@bytedance.com commit 139b5fbd525ad357a27002b37815ea82d32aa375 Merge: ab4850819176a b1346338fbaef Author: Paolo Abeni Date: Tue Aug 23 10:45:02 2022 +0200 Merge branch 'vsock-updates-for-so_rcvlowat-handling' Arseniy Krasnov says: ==================== vsock: updates for SO_RCVLOWAT handling This patchset includes some updates for SO_RCVLOWAT: 1) af_vsock: During my experiments with zerocopy receive, i found, that in some cases, poll() implementation violates POSIX: when socket has non- default SO_RCVLOWAT(e.g. not 1), poll() will always set POLLIN and POLLRDNORM bits in 'revents' even number of bytes available to read on socket is smaller than SO_RCVLOWAT value. In this case,user sees POLLIN flag and then tries to read data(for example using 'read()' call), but read call will be blocked, because SO_RCVLOWAT logic is supported in dequeue loop in af_vsock.c. But the same time, POSIX requires that: "POLLIN Data other than high-priority data may be read without blocking. POLLRDNORM Normal data may be read without blocking." See https://www.open-std.org/jtc1/sc22/open/n4217.pdf, page 293. So, we have, that poll() syscall returns POLLIN, but read call will be blocked. Also in man page socket(7) i found that: "Since Linux 2.6.28, select(2), poll(2), and epoll(7) indicate a socket as readable only if at least SO_RCVLOWAT bytes are available." I checked TCP callback for poll()(net/ipv4/tcp.c, tcp_poll()), it uses SO_RCVLOWAT value to set POLLIN bit, also i've tested TCP with this case for TCP socket, it works as POSIX required. I've added some fixes to af_vsock.c and virtio_transport_common.c, test is also implemented. 2) virtio/vsock: It adds some optimization to wake ups, when new data arrived. Now, SO_RCVLOWAT is considered before wake up sleepers who wait new data. There is no sense, to kick waiter, when number of available bytes in socket's queue < SO_RCVLOWAT, because if we wake up reader in this case, it will wait for SO_RCVLOWAT data anyway during dequeue, or in poll() case, POLLIN/POLLRDNORM bits won't be set, so such exit from poll() will be "spurious". This logic is also used in TCP sockets. 3) vmci/vsock: Same as 2), but i'm not sure about this changes. Will be very good, to get comments from someone who knows this code. 4) Hyper-V: As Dexuan Cui mentioned, for Hyper-V transport it is difficult to support SO_RCVLOWAT, so he suggested to disable this feature for Hyper-V. ==================== Link: https://lore.kernel.org/r/de41de4c-0345-34d7-7c36-4345258b7ba8@sberdevices.ru Signed-off-by: Paolo Abeni commit b1346338fbaefac1b796a50478f8e8070b54e9e4 Author: Arseniy Krasnov Date: Fri Aug 19 05:43:50 2022 +0000 vsock_test: POLLIN + SO_RCVLOWAT test This adds test to check, that when poll() returns POLLIN, POLLRDNORM bits, next read call won't block. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit e061aed99855ccef2d64f5bdd66996e19d6cf60b Author: Arseniy Krasnov Date: Fri Aug 19 05:41:35 2022 +0000 vmci/vsock: check SO_RCVLOWAT before wake up reader This adds extra condition to wake up data reader: do it only when number of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick user, because it will wait until SO_RCVLOWAT bytes will be dequeued. This check is performed in vsock_data_ready(). Signed-off-by: Arseniy Krasnov Reviewed-by: Vishnu Dasa Signed-off-by: Paolo Abeni commit 39f1ed33a4489e2f7a55d5a96576c73af3529461 Author: Arseniy Krasnov Date: Fri Aug 19 05:39:24 2022 +0000 virtio/vsock: check SO_RCVLOWAT before wake up reader This adds extra condition to wake up data reader: do it only when number of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick user,because it will wait until SO_RCVLOWAT bytes will be dequeued. This check is performed in vsock_data_ready(). Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit f2fdcf67aceb1a7d5e0661cb7ca95cda68d3014a Author: Arseniy Krasnov Date: Fri Aug 19 05:36:52 2022 +0000 vsock: add API call for data ready This adds 'vsock_data_ready()' which must be called by transport to kick sleeping data readers. It checks for SO_RCVLOWAT value before waking user, thus preventing spurious wake ups. Based on 'tcp_data_ready()' logic. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit ee0b3843a26920dad713c27cd8f3a3cfc5ae9c37 Author: Arseniy Krasnov Date: Fri Aug 19 05:33:47 2022 +0000 vsock: pass sock_rcvlowat to notify_poll_in as target Passing 1 as the target to notify_poll_in(), we don't honor what the user has set via SO_RCVLOWAT, going to set POLLIN and POLLRDNORM, even if we don't have the amount of bytes expected by the user. Let's use sock_rcvlowat() to get the right target to pass to notify_poll_in(); Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit a274f6ff3c5c79c27d254b48cad3b4814c950908 Author: Arseniy Krasnov Date: Fri Aug 19 05:31:43 2022 +0000 vmci/vsock: use 'target' in notify_poll_in callback This callback controls setting of POLLIN, POLLRDNORM output bits of poll() syscall, but in some cases, it is incorrectly to set it, when socket has at least 1 bytes of available data. Use 'target' which is already exists. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Reviewed-by: Vishnu Dasa Signed-off-by: Paolo Abeni commit e7a3266c9167fe8878c303959a8cc4527f83888b Author: Arseniy Krasnov Date: Fri Aug 19 05:29:34 2022 +0000 virtio/vsock: use 'target' in notify_poll_in callback This callback controls setting of POLLIN, POLLRDNORM output bits of poll() syscall, but in some cases, it is incorrectly to set it, when socket has at least 1 bytes of available data. Use 'target' which is already exists. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit 24764f8d3c316a3c58b51140d8e489e98e7ffdcc Author: Arseniy Krasnov Date: Fri Aug 19 05:27:34 2022 +0000 hv_sock: disable SO_RCVLOWAT support For Hyper-V it is quiet difficult to support this socket option,due to transport internals, so disable it. Signed-off-by: Arseniy Krasnov Reviewed-by: Dexuan Cui Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit e38f22c860edb7804b4722ac2332f7c51b9c6b72 Author: Arseniy Krasnov Date: Fri Aug 19 05:25:19 2022 +0000 vsock: SO_RCVLOWAT transport set callback This adds transport specific callback for SO_RCVLOWAT, because in some transports it may be difficult to know current available number of bytes ready to read. Thus, when SO_RCVLOWAT is set, transport may reject it. Signed-off-by: Arseniy Krasnov Signed-off-by: Paolo Abeni commit dc9981ef17c6ac371d098c574dcc2ad3de68f567 Author: Wenpeng Liang Date: Mon Aug 22 18:44:54 2022 +0800 RDMA/hns: Support MR's restrack ops for hns driver The MR restrack attributes come from the queue information maintained by the driver. For example: $ rdma res show mr dev hns_0 mrn 6 -dd -jp [ { "ifindex": 4, "ifname": "hns_0", "mrn": 6, "rkey": "300", "lkey": "300", "mrlen": 131072, "pdn": 8, "pid": 1524, "comm": "ib_send_bw" }, "drv_pbl_hop_num": 2, "drv_ba_pg_shift": 14, "drv_buf_pg_shift": 12 } Link: https://lore.kernel.org/r/20220822104455.2311053-7-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit 3e89d78b21a88120f6a858391faba97f2878266e Author: Wenpeng Liang Date: Mon Aug 22 18:44:53 2022 +0800 RDMA/hns: Support QP's restrack raw ops for hns driver The QP raw restrack attributes come from the queue context maintained by the ROCEE. For example: $ rdma res show qp link hns_0 -jp -dd -r [ { "ifindex": 4, "ifname": "hns_0", "data": [ 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, 5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,255,156,0,0,63,156,0,0, 7,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,156,0, 0,0,0,0,0 ] } ] Link: https://lore.kernel.org/r/20220822104455.2311053-6-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit e198d65d76e9232afb92fee5c3b361bfa411859d Author: Wenpeng Liang Date: Mon Aug 22 18:44:52 2022 +0800 RDMA/hns: Support QP's restrack ops for hns driver The QP restrack attributes come from the queue information maintained by the driver. For example: $ rdma res show qp link hns_0 lqpn 41 -jp -dd [ { "ifindex": 4, "ifname": "hns_0", "port": 1, "lqpn": 41, "rqpn": 40, "type": "RC", "state": "RTR", "rq-psn": 12474738, "sq-psn": 0, "path-mig-state": "ARMED", "pdn": 9, "pid": 1523, "comm": "ib_send_bw" }, "drv_sq_wqe_cnt": 128, "drv_sq_max_gs": 1, "drv_rq_wqe_cnt": 512, "drv_rq_max_gs": 2, "drv_ext_sge_sge_cnt": 0 } Link: https://lore.kernel.org/r/20220822104455.2311053-5-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit f2b070f36d1bb4e4c2290f5bab52cb1f2dc82cf9 Author: Wenpeng Liang Date: Mon Aug 22 18:44:51 2022 +0800 RDMA/hns: Support CQ's restrack raw ops for hns driver The CQ raw restrack attributes come from the queue context maintained by the ROCEE. For example: $ rdma res show cq dev hns_0 cqn 14 -dd -jp -r [ { "ifindex": 4, "ifname": "hns_0", "data": [ 1,0,0,0,7,0,0,0,0,0,0,0,0,82,6,0,0,82,6,0,0,82,6,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 6,0,0,0,0,0,0,0 ] } ] Link: https://lore.kernel.org/r/20220822104455.2311053-4-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit eb00b9a08b9dbb0aad7c59d113f35206c7ac2eac Author: Wenpeng Liang Date: Mon Aug 22 18:44:50 2022 +0800 RDMA/hns: Add or remove CQ's restrack attributes Remove the resttrack attributes from the queue context held by ROCEE, and add the resttrack attributes from the queue information maintained by the driver. For example: $ rdma res show cq dev hns_0 cqn 14 -dd -jp [ { "ifindex": 4, "ifname": "hns_0", "cqn": 14, "cqe": 127, "users": 1, "adaptive-moderation": false, "ctxn": 8, "pid": 1524, "comm": "ib_send_bw" }, "drv_cq_depth": 128, "drv_cons_index": 0, "drv_cqe_size": 32, "drv_arm_sn": 1 } Link: https://lore.kernel.org/r/20220822104455.2311053-3-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit 40b4b79c866ffc1414a3989cc480263e76f28589 Author: Wenpeng Liang Date: Mon Aug 22 18:44:49 2022 +0800 RDMA/hns: Remove redundant DFX file and DFX ops structure There is no need to use a dedicated DXF file and DFX structure to manage the interface of the query queue context. Link: https://lore.kernel.org/r/20220822104455.2311053-2-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Leon Romanovsky commit ca7ef7adad979648da5006152320caa71b746134 Author: Daisuke Matsuda Date: Tue Aug 23 02:51:31 2022 +0000 IB/mlx5: Remove duplicate header inclusion related to ODP rdma/ib_umem.h and rdma/ib_verbs.h are included by rdma/ib_umem_odp.h. This patch removes the redundant entries. Link: https://lore.kernel.org/r/20220823025131.862811-1-matsuda-daisuke@fujitsu.com Signed-off-by: Daisuke Matsuda Signed-off-by: Leon Romanovsky commit ab4850819176a92864f6ebd6c932ed926a337054 Author: Zhengchao Shao Date: Fri Aug 19 12:18:54 2022 +0800 net: sched: remove duplicate check of user rights in qdisc In rtnetlink_rcv_msg function, the permission for all user operations is checked except the GET operation, which is the same as the checking in qdisc. Therefore, remove the user rights check in qdisc. Signed-off-by: Zhengchao Shao Message-Id: <20220819041854.83372-1-shaozhengchao@huawei.com> Signed-off-by: Paolo Abeni commit 18afcf90d8807fef66d1fd428eeb2b407df90fa8 Author: Pierre-Louis Bossart Date: Mon Aug 22 21:00:44 2022 +0200 ALSA: hda: cleanup definitions for multi-link registers For some reason two masks are used without the AZX prefix, and the pattern MLCLT should be ML_LCTL for consistency. Pure rename, no functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220822190044.170495-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit d6cbfcd24443e51fb596fdbf25679d61052a3f84 Author: Johan Hovold Date: Thu Jul 14 09:13:48 2022 +0200 PCI: qcom: Sort device-id table Sort the device-id table entries alphabetically by compatible string to make it easier to find entries and add new ones. Link: https://lore.kernel.org/r/20220714071348.6792-9-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Brian Masney Acked-by: Stanimir Varbanov commit 223117350636e20a86fa540e9b53804194939057 Author: Johan Hovold Date: Thu Jul 14 09:13:47 2022 +0200 PCI: qcom: Clean up IP configurations The various IP versions have different configurations that are encoded in separate sets of operation callbacks. Currently, there is no need for also maintaining corresponding sets of data parameters, but it is conceivable that these may again be found useful (e.g. to implement minor variations of the operation callbacks). Rename the default configuration structures after the IP version they apply to so that they can more easily be reused by different SoCs. Note that SoC specific configurations can be added later if need arises (e.g. cfg_sc8280xp). Link: https://lore.kernel.org/r/20220714071348.6792-8-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Manivannan Sadhasivam Reviewed-by: Dmitry Baryshkov Reviewed-by: Brian Masney Acked-by: Stanimir Varbanov commit 014aa3518a5826b88a601f5de867551db5c73855 Author: Johan Hovold Date: Thu Jul 14 09:13:46 2022 +0200 PCI: qcom: Make all optional clocks optional The kernel is not a devicetree validator and does not need to re-encode information which is already available in the devicetree. This is specifically true for the optional PCIe clocks, some of which are really interconnect clocks. Treat also the 2.7.0 optional clocks as truly optional instead of maintaining a list of clocks per compatible (including two compatible strings for the two identical controllers on sm8450) just to validate the devicetree. Link: https://lore.kernel.org/r/20220714071348.6792-7-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Manivannan Sadhasivam Reviewed-by: Dmitry Baryshkov Reviewed-by: Brian Masney Acked-by: Stanimir Varbanov commit c64f56d0857a28ad9f4e5b6e68877a6b05660073 Author: Johan Hovold Date: Thu Jul 14 09:13:45 2022 +0200 PCI: qcom: Add support for SA8540P The SA8540P platform has five PCIe controllers: two 4-lane, two 2-lane and one 1-lane. Add a new "qcom,pcie-sa8540p" compatible string and reuse the 1.9.0 ops. Note that like for SC8280XP, the SA8540P controllers need two or three interconnect clocks to be enabled. Link: https://lore.kernel.org/r/20220714071348.6792-6-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Manivannan Sadhasivam Reviewed-by: Brian Masney Acked-by: Stanimir Varbanov commit 70574511f3fc2eea360043aaf7fcbbe4b1ea22b9 Author: Johan Hovold Date: Thu Jul 14 09:13:44 2022 +0200 PCI: qcom: Add support for SC8280XP The SC8280XP platform has seven PCIe controllers: two used with USB4, two 4-lane, two 2-lane and one 1-lane. Add a new "qcom,pcie-sc8280xp" compatible string and reuse the 1.9.0 ops. Note that the SC8280XP controllers need two or three interconnect clocks to be enabled. Model these as optional clocks to avoid encoding devicetree data in the PCIe driver. Note that the same could be done for the SM8450 interconnect clocks and possibly also for the TBU clocks. Link: https://lore.kernel.org/r/20220714071348.6792-5-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Manivannan Sadhasivam Acked-by: Stanimir Varbanov commit 76c4207f4085f00d03c96c72c528ee0810692f57 Author: Johan Hovold Date: Thu Jul 14 09:13:43 2022 +0200 dt-bindings: PCI: qcom: Add SA8540P to binding SA8540P is a new platform related to SC8280XP but which uses a single host interrupt for MSI routing. Link: https://lore.kernel.org/r/20220714071348.6792-4-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Brian Masney Acked-by: Krzysztof Kozlowski Acked-by: Stanimir Varbanov commit 76d777ae045e345ccfbf2d7c873674de09a8a041 Author: Johan Hovold Date: Thu Jul 14 09:13:42 2022 +0200 dt-bindings: PCI: qcom: Add SC8280XP to binding Add the SC8280XP platform to the binding. SC8280XP use four host interrupts for MSI routing so remove the obsolete comment referring to newer chipsets supporting one or eight interrupts (e.g. for backwards compatibility). Link: https://lore.kernel.org/r/20220714071348.6792-3-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Acked-by: Krzysztof Kozlowski Acked-by: Stanimir Varbanov commit 6611656736f8f2b94767f5999e78400370d84480 Author: Johan Hovold Date: Thu Jul 14 09:13:41 2022 +0200 dt-bindings: PCI: qcom: Enumerate platforms with single msi interrupt Explicitly enumerate the older platforms that have a single msi host interrupt. This allows for adding further platforms with, for example, four msi interrupts without resorting to nested conditionals. Drop the redundant comment about older chipsets instead of moving it. Link: https://lore.kernel.org/r/20220714071348.6792-2-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Reviewed-by: Manivannan Sadhasivam Acked-by: Krzysztof Kozlowski Acked-by: Stanimir Varbanov commit 09a122384e34a4aa7ebae59c1eb11d69cd80658c Author: Sam Protsenko Date: Tue Aug 9 14:33:23 2022 +0300 arm64: dts: exynos: Add SysMMU nodes for Exynos850 Add all SysMMU nodes to Exynos850 SoC device tree. Signed-off-by: Sam Protsenko Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-10-semen.protsenko@linaro.org commit 2c8cf49c7dec4b5f7323588279aa9e8a4174ebf9 Author: Sam Protsenko Date: Tue Aug 9 14:33:22 2022 +0300 arm64: dts: exynos: Add CMU_AUD, CMU_IS and CMU_MFCMSCL for Exynos850 Add missing clock domains to Exynos850 SoC device tree. Signed-off-by: Sam Protsenko Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-9-semen.protsenko@linaro.org commit ac94f66521a5488eccdded4036b0ec039ceb87d5 Author: Chanho Park Date: Fri Jul 29 09:30:22 2022 +0900 arm64: dts: exynosautov9: add fsys0/1 clock DT nodes Add cmu_fsys0 and cmu_fsys1 for PCIe clocks and USB/MMC clocks respectively. Signed-off-by: Chanho Park Reviewed-by: Chanwoo Choi [krzk: put nodes ordered by unit address] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/50f8145bca30cf5c900359d0b78c1c617090e021.1659054220.git.chanho61.park@samsung.com commit 7f36d3b696aebb624fb50cd2e852bba289521604 Author: Sam Protsenko Date: Tue Aug 9 14:33:21 2022 +0300 clk: samsung: exynos850: Implement CMU_MFCMSCL domain CMU_MFCMSCL clock domain provides clocks for MFC (Multi-Format Codec), JPEG Codec and Scaler IP-cores. According to Exynos850 TRM, CMU_MFCMSCL generates MFC, M2M, MCSC and JPEG clocks for BLK_MFCMSCL. This patch adds next clocks: - bus clocks in CMU_TOP for CMU_MFCMSCL - all internal CMU_MFCMSCL clocks - leaf clocks for MFCMSCL, TZPC (TrustZone Protection Controller), JPEG codec, M2M (Memory-to-Memory), MCSC (Multi-Channel Scaler), MFC (Multi-Format Codec), PPMU (Platform Performance Monitoring Unit), SysMMU and SysReg MFCMSCL related gate clocks in CMU_TOP were marked as CLK_IS_CRITICAL, because: 1. All of those have to be enabled in order to read /sys/kernel/debug/clk/clk_summary file 2. When some user driver (e.g. exynos-sysmmu) disables some derived leaf clock, it can lead to CMU_TOP clocks disable, which then makes the system hang. To prevent that, the CLK_IS_CRITICAL flag is used, as CLK_IGNORE_UNUSED is not enough. Signed-off-by: Sam Protsenko Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-8-semen.protsenko@linaro.org commit bf3a4c519ca5455d96de2b9a8b1467f536bc0679 Author: Sam Protsenko Date: Tue Aug 9 14:33:20 2022 +0300 clk: samsung: exynos850: Implement CMU_IS domain CMU_IS clock domain provides clocks for IS IP-core (Image Signal Processing Subsystem). According to Exynos850 TRM, CMU_IS generates CSIS, IPP, ITP, VRA and GDC clocks for BLK_IS. This patch adds next clocks: - bus clocks in CMU_TOP needed for CMU_IS - all internal CMU_IS clocks - leaf clocks for IS IP-core, CSIS (Camera Serial Interface Slave), D_TZPC (TrustZone Protection Controller), CSIS DMA, GDC (Geometric Distortion Correction), IPP (Image Preprocessing Processing core), ITP (Image Texture Processing core), MCSC (Multi-Channel Scaler), VRA (Visual Recognition Accelerator), PPMU (Platform Performance Monitoring Unit), SysMMU and SysReg IS related gate clocks in CMU_TOP were marked as CLK_IS_CRITICAL, because: 1. All of those have to be enabled in order to read /sys/kernel/debug/clk/clk_summary file 2. When some user driver (e.g. exynos-sysmmu) disables some derived leaf clock, it can lead to CMU_TOP clocks disable, which then makes the system hang. To prevent that, the CLK_IS_CRITICAL flag is used, as CLK_IGNORE_UNUSED is not enough. Signed-off-by: Sam Protsenko Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-7-semen.protsenko@linaro.org commit b73fd95def4fd9cde548ed17be19f845349e1c0c Author: Sam Protsenko Date: Tue Aug 9 14:33:19 2022 +0300 clk: samsung: exynos850: Implement CMU_AUD domain CMU_AUD clock domain provides clocks for ABOX IP-core (audio subsystem). According to Exynos850 TRM, CMU_AUD generates Cortex-A32 clock, bus clock and audio clocks for BLK_AUD. This patch adds next clocks: - bus clocks in CMU_TOP needed for CMU_AUD - all internal CMU_AUD clocks - leaf clocks for Cortex-A32, Speedy FM, UAIF0..UAIF6 (Unified Audio Interface), CNT (counter), ABOX IP-core, ASB (Asynchronous Bridge), DAP (Debug Access Port), I2S Codec MCLK, D_TZPC (TrustZone Protection Controller), GPIO, PPMU (Platform Performance Monitoring Unit), SysMMU, SysReg and WDT ABOX clock was marked as CLK_IGNORE_UNUSED, as system hangs on boot otherwise. Once ABOX driver is implemented, maybe it can be handled there instead. Signed-off-by: Sam Protsenko Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-6-semen.protsenko@linaro.org commit dbaa27cc7e62d87d46014ef314811eb00fad9bda Author: Sam Protsenko Date: Tue Aug 9 14:33:18 2022 +0300 clk: samsung: exynos850: Style fixes Fix some typos in comments and do small coding style improvements. Signed-off-by: Sam Protsenko Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-5-semen.protsenko@linaro.org commit 65522e7d86c986df77bd3106de1ef7712070ee7e Author: Chanho Park Date: Fri Jul 29 09:30:24 2022 +0900 clk: samsung: exynosautov9: add fsys1 clock support CMU_FSYS1 provides clocks for USB(2 x USB3.1 Gen-1, 2 x USB 2.0) and mmc. For MMC clocks, PLL_MMC(PLL0831X type) is also supported as a PLL source clock provider. Signed-off-by: Chanho Park Acked-by: Chanwoo Choi Acked-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/d4aa967538fed9667e9550a256e545026fc2fa8d.1659054220.git.chanho61.park@samsung.com commit 3477b3c3a9fbb6422874c7f24a35249e1773c687 Author: Chanho Park Date: Fri Jul 29 09:30:23 2022 +0900 clk: samsung: exynosautov9: add fsys0 clock support CMU_FSYS0 block provides clocks for PCIe Gen3 1 x 4Lanes and 2 x 2 Lanes. Signed-off-by: Chanho Park Acked-by: Chanwoo Choi Acked-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/ae84d4a0487a5299076bfeef5732579f5207acf9.1659054220.git.chanho61.park@samsung.com commit 67d98943408bce835185688cb75ebbb45b91e572 Author: Chanho Park Date: Wed Jul 27 11:13:57 2022 +0900 clk: samsung: exynosautov9: correct register offsets of peric0/c1 Some register offsets of peric0 and peric1 cmu blocks need to be corrected and re-ordered by numerical order. Fixes: f2dd366992d0 ("clk: samsung: exynosautov9: add cmu_peric0 clock support") Fixes: b35f27fe73d8 ("clk: samsung: exynosautov9: add cmu_peric1 clock support") Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220727021357.152421-4-chanho61.park@samsung.com commit 6ac24a3a24a9e88f5e1ee8e96fd9d39fcab28b3f Author: Chanho Park Date: Wed Jul 27 11:13:56 2022 +0900 clk: samsung: exynosautov9: add missing gate clks for peric0/c1 "gout_peric0_pclk_1" and "gout_peric1_pclk_1" should be added to peric0 and peric1 respectively. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220727021357.152421-3-chanho61.park@samsung.com commit faeb276b10891bf0953f1da5e1a36067f24f3157 Merge: 0e1b2f1fb2984 8f3fc0ed70b97 Author: Krzysztof Kozlowski Date: Tue Aug 23 09:13:31 2022 +0300 Merge branch 'for-v6.0/samsung-clk-dt-bindings' into next/clk Merge bindings with clock IDs for ExynosAutov9 and Exynos850. Signed-off-by: Krzysztof Kozlowski commit 0de1978852dff8643a80f20a8f44cef3f16c2db0 Author: Hongbin Wang Date: Sun Aug 21 23:41:47 2022 -0400 xfrm: Drop unused argument Drop unused argument from xfrm_policy_match, __xfrm_policy_eval_candidates and xfrm_policy_eval_candidates. No functional changes intended. Signed-off-by: Hongbin Wang Signed-off-by: Steffen Klassert commit 8f3fc0ed70b97e7544ec1a57c60fe6b2f2f778c3 Author: Sam Protsenko Date: Tue Aug 9 14:33:17 2022 +0300 dt-bindings: clock: exynos850: Add Exynos850 CMU_MFCMSCL CMU_MFCMSCL generates MFC, M2M, MCSC and JPEG clocks for BLK_MFCMSCL. Add clock indices and binding documentation for CMU_MFCMSCL. Signed-off-by: Sam Protsenko Reviewed-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-4-semen.protsenko@linaro.org commit f20f35f46f1a65e1c4b65d8fb62acdbdafd11e1e Author: Sam Protsenko Date: Tue Aug 9 14:33:16 2022 +0300 dt-bindings: clock: exynos850: Add Exynos850 CMU_IS CMU_IS generates CSIS, IPP, ITP, VRA and GDC clocks for BLK_IS. Add clock indices and bindings documentation for CMU_IS domain. Signed-off-by: Sam Protsenko Reviewed-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-3-semen.protsenko@linaro.org commit 45bbf4d76a6730acf63805798d6fe7a126e49dbc Author: Sam Protsenko Date: Tue Aug 9 14:33:15 2022 +0300 dt-bindings: clock: exynos850: Add Exynos850 CMU_AUD CMU_AUD generates Cortex-A32 clock, bus clock and audio clocks for BLK_AUD. Add clock indices and binding documentation for CMU_AUD. Signed-off-by: Sam Protsenko Reviewed-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220809113323.29965-2-semen.protsenko@linaro.org commit 4b6ec8d88623fed87088f141bcce79f67d82f301 Author: Chanho Park Date: Fri Jul 29 09:30:21 2022 +0900 dt-bindings: clock: exynosautov9: add schema for cmu_fsys0/1 Add "samsung,exynosautov9-cmu-fsys0/1" compatibles to illustrate cmu_fsys0 and fsys1 for Exynos Auto v9 SoC. Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/49eaadecfb346982dff46cffb870400b76a4e281.1659054220.git.chanho61.park@samsung.com commit 3c073243c5df0146fef619f7aa5874b2e9d234a3 Author: Chanho Park Date: Fri Jul 29 09:30:20 2022 +0900 dt-bindings: clock: exynosautov9: add fsys1 clock definitions Add fsys1(for usb and mmc) clock definitions. Signed-off-by: Chanho Park Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/debb6335cb2bcc935f7572bed25d76a85e80cfaa.1659054220.git.chanho61.park@samsung.com commit 153da489e5e7c9aed7e6445b9450d98d5ebd5a5b Author: Chanho Park Date: Fri Jul 29 09:30:19 2022 +0900 dt-bindings: clock: exynosautov9: add fys0 clock definitions Add fsys0(for PCIe) clock definitions. Signed-off-by: Chanho Park Acked-by: Chanwoo Choi Acked-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/6f70a59164ad2c5ce5581047ca39a91afc1105d9.1659054220.git.chanho61.park@samsung.com commit 0e1b2f1fb298499514703aa3aa21a1a81806d5ec Author: David Virag Date: Thu Jun 2 01:37:42 2022 +0200 clk: samsung: exynos7885: Add TREX clocks TREX D Core and P core clocks seem to be related to the BTS (Bus Traffic Shaper) inside the Exynos7885 SoC, and are needed for the SoC to function correctly. When clocks are cut from TREX D Core, the eMMC and the framebuffer stops working properly. Other unknown things may stop working as well. When clocks are cut from TREX P Core, the system locks up needing a hard reset. Add these clocks and mark them critical so that they are always on. Signed-off-by: David Virag Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220601233743.56317-5-virag.david003@gmail.com commit f392db97b7bbdc636fc92bb396eb7a0fa4c44691 Author: David Virag Date: Thu Jun 2 01:37:41 2022 +0200 clk: samsung: exynos7885: Implement CMU_FSYS domain CMU_FSYS clock domain provides clocks for FSYS IP-core providing clocks for all MMC devices on Exynos7885, and USB30DRD. Add clocks: - Bus clocks in CMU_TOP needed for CMU_FSYS - All clocks in CMU_FSYS needed for MMC devices Signed-off-by: David Virag Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220601233743.56317-4-virag.david003@gmail.com commit b6740089b740b842d5e6ff55b4b2c3bf5961c69a Author: Chanho Park Date: Wed Jul 27 11:13:55 2022 +0900 dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1 There are duplicated definitions of peric0 and peric1 cmu blocks. Thus, they should be defined correctly as numerical order. Fixes: 680e1c8370a2 ("dt-bindings: clock: add clock binding definitions for Exynos Auto v9") Signed-off-by: Chanho Park Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220727021357.152421-2-chanho61.park@samsung.com commit 777aaf3d1daf793461269b49c063aca1cee06a44 Author: Minghao Chi (CGEL ZTE) Date: Mon Mar 7 03:35:46 2022 +0000 clk: samsung: exynos-clkout: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220307033546.2075097-1-chi.minghao@zte.com.cn commit 72e0bcd1563602168391ea52157bdd82e6d7875a Author: Roi Dayan Date: Wed Jul 13 09:37:10 2022 +0300 net/mlx5: TC, Add support for SF tunnel offload VF tunnel flow already exists and SF tunnel is the same flow. Support offloading of tunneling over SF device by allow to attach an encap route over SF and set to use indirect flow table on SF. Signed-off-by: Roi Dayan Reviewed-by: Mark Bloch Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 430e2d5e2a982e6f86866762e6d6eb78191f9677 Author: Roi Dayan Date: Mon Jul 18 15:38:20 2022 +0300 net/mlx5: E-Switch, Move send to vport meta rule creation Move the creation of the rules from offloads fdb table init to per rep vport init. This way the driver will creating the send to vport meta rule on any representor, e.g. SF representors. Signed-off-by: Roi Dayan Reviewed-by: Mark Bloch Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 4a561817064f9aa21361d7ed4640578556c42a10 Author: Roi Dayan Date: Mon Jul 18 13:38:00 2022 +0300 net/mlx5: E-Switch, Split creating fdb tables into smaller chunks Split esw_create_offloads_fdb_tables() into smaller functions. This will help maintenance. Signed-off-by: Roi Dayan Reviewed-by: Mark Bloch Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 8ea7bcf632181bee8fbe46a2507023c2defc05fb Author: Jianbo Liu Date: Wed Apr 6 03:25:33 2022 +0000 net/mlx5: E-Switch, Add default drop rule for unmatched packets The ft_offloads table serves to steer packets, which are from the eswitch, to the representor associated with the packets' source vport. Previously, if a packet's source vport or metadata was not associated with any representor, it was forwarded to the uplink representor. The representor got packets it shouldn't have as they weren't coming from the uplink vport. One such effect of this breakage can be observed if the uplink representor is attached to a bridge, where such illegal packets will be broadcast to the remaining ports, flooding the switch with illegal packets. In the case where IB loopback (e.g, SNAP) is enabled, all transmitted packets would be looped back, and received by the uplink representor, and result in an infinite feedback loop. Therefore, block this hole by adding a default drop rule to the ft_offloads table, so that all unmatched packets with no associated representor are dropped. Signed-off-by: Jianbo Liu Reviewed-by: Gavi Teitz Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d494dd2bb70c2a0c4a4234698c60c52165603f70 Author: Lama Kayal Date: Mon Jan 31 08:33:59 2022 +0200 net/mlx5e: Completely eliminate priv from fs.h Complete the decoupling process of flow steering from en.h. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit ca959d97d6bba12c56459c6162f7ddc0173edbf9 Author: Lama Kayal Date: Sun Jan 30 16:36:36 2022 +0200 net/mlx5e: Make all ttc functions of en_fs get fs struct as argument Let all ttc creation be independent of priv, and pass relevant members of priv only. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 45b83c6c6831b2b85721f03cdc180a3ceab1e2e8 Author: Lama Kayal Date: Sun Jan 30 11:23:39 2022 +0200 net/mlx5e: Make flow steering arfs independent of priv Decouple arfs flow steering functionality from priv. Make all arfs functions defined under fs.h get flow_steering struct as an argument, thus helping with the process of decoupling the whole flow steering API from en.h. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 93a07599ee0aee9947cd2df510667e5af0dcdc49 Author: Lama Kayal Date: Thu Jan 27 17:39:44 2022 +0200 net/mlx5e: Introduce flow steering debug macros Introduce flow steering debug macros family, fs_*. These macros bring clean finish to the decoupling of flow steering process such that all flow steering flows can report warnings and provide debug information via these exclusive macros. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 9c2c1c5e7fde82ba79ce36ae56d78dd44b6c4ca8 Author: Lama Kayal Date: Sun Feb 6 17:42:33 2022 +0200 net/mlx5e: Separate ethtool_steering from fs.h and make private Create a new fs_ethtool.h header file, where ethtool steering init and cleanup functions are declared in it. Make mlx5e_ethtool_steering struct private and declare at en_fs_ethtool.c. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e8b5c4bcb5541d452323171c0941ee3d8cefa693 Author: Lama Kayal Date: Sun Feb 13 13:50:35 2022 +0200 net/mlx5e: Directly get flow_steering struct as input when init/cleanup ethtool steering Let both mlx5e_ethtool_init_steering and mlx5e_ethtool_cleanup_steering get ethtool steering struct as input instead of priv, as passing priv is obsolete. Also modify other function through the flow similarly. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit c7eafc5ed0688812f7b59094107d664893911c0f Author: Lama Kayal Date: Mon Feb 7 16:04:48 2022 +0200 net/mlx5e: Convert ethtool_steering member of flow_steering struct to pointer Convert mlx5e_ethtool_steering member of mlx5e_flow_steering to a pointer, and allocate dynamically for each profile at flow_steering init. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 81a0b241affeec9914257a146841e1d802474362 Author: Lama Kayal Date: Mon Jan 31 22:13:41 2022 +0200 net/mlx5e: Drop priv argument of ptp function in en_fs Both mlx5e_ptp_alloc_rx_fs and mlx5e_ptp_free_rx_fs only make use of two priv member, pass them directly instead. This will help dropping priv from all en_fs file. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 1be44b42b25cfe66d6e55630478aabbc8d8f3bc7 Author: Lama Kayal Date: Tue Jan 25 22:34:06 2022 +0200 net/mlx5e: Decouple fs_tcp from en.h Make flow steering files fs_tcp.c/h independent of en.h such that they go through the flow steering API only. Make error reports be via mlx5_core API instead of netdev_err API, this to ensure a safe decoupling from en.h, and prevent redundant argument passing. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 4e0ecc17a74ed41b8378d9515d4555cb7f3c0794 Author: Lama Kayal Date: Tue Jan 25 18:04:55 2022 +0200 net/mlx5e: Decouple fs_tt_redirect from en.h Make flow steering files fs_tt_redirect.c/h independent of en.h such that it goes through the flow steering API only. Make error reports be via mlx5_core API instead of netdev_err API, this to ensure a safe decoupling from en.h, and prevent redundant argument passing. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit f52f2faee581562032be32318b402ea53f2240e1 Author: Lama Kayal Date: Mon Jan 10 11:48:35 2022 +0200 net/mlx5e: Introduce flow steering API Move mlx5e_flow_steering struct to fs_en.c to make it private. Introduce flow_steering API and let other files go through it. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 176d4aa69c6e0f24857b9cf516f79750dea85771 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:24 2022 +0530 scsi: mpi3mr: Support SAS transport class callbacks Add support for the following SAS transport class callbacks: - get_linkerrors - get_enclosure_identifier - get_bay_identifier - phy_reset - phy_enable - set_phy_speed - smp_handler Link: https://lore.kernel.org/r/20220804131226.16653-14-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 2bd37e28491401f772f8a8545ffbafb3f52e0e3e Author: Sreekanth Reddy Date: Thu Aug 4 18:42:23 2022 +0530 scsi: mpi3mr: Add framework to issue MPT transport cmds Add framework to issue MPT transport commands to controllers. Also issue the MPT transport commands to get the manufacturing info of SAS expander device. Link: https://lore.kernel.org/r/20220804131226.16653-13-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 7f56c791969e0c19b8b5ee12058b636bf173eb90 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:22 2022 +0530 scsi: mpi3mr: Add SAS SATA end devices to STL Register/unregister the SAS, SATA devices to SCSI Transport Layer(STL) whenever the corresponding device is added/removed from topology. Link: https://lore.kernel.org/r/20220804131226.16653-12-sreekanth.reddy@broadcom.com Reported-by: kernel test robot Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 626665e9c38d3d35b2cdb111b9e813b396d7284e Author: Sreekanth Reddy Date: Thu Aug 4 18:42:21 2022 +0530 scsi: mpi3mr: Get target object based on rphy When device is registered with the STL then get the corresponding device's target object using the rphy in below callback functions: - mpi3mr_target_alloc() - mpi3mr_slave_alloc() - mpi3mr_slave_configure() - mpi3mr_slave_destroy() Link: https://lore.kernel.org/r/20220804131226.16653-11-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit e22bae30667a7e74ed057e00fb6e8c79e0738de3 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:20 2022 +0530 scsi: mpi3mr: Add expander devices to STL Register/unregister the expander devices to SCSI Transport Layer(STL) whenever the corresponding expander is added/removed from topology. Link: https://lore.kernel.org/r/20220804131226.16653-10-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit c4723e68a0d816f23e0807908cdb66e67528594f Author: Sreekanth Reddy Date: Thu Aug 4 18:42:19 2022 +0530 scsi: mpi3mr: Enable STL on HBAs where multipath is disabled Register the SAS, SATA devices to SCSI Transport Layer (STL) only if multipath capability is disabled in the controller's firmware. Link: https://lore.kernel.org/r/20220804131226.16653-9-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 42fc9fee116fc6a225a1f738adf86689d5c39d49 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:18 2022 +0530 scsi: mpi3mr: Add helper functions to manage device's port Add the following helper functions: - Update the host phys with STL - Remove the device's SAS port with STL Link: https://lore.kernel.org/r/20220804131226.16653-8-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 125ad1e6b445e8538e50d77d9c82ec811e98895e Author: Sreekanth Reddy Date: Thu Aug 4 18:42:17 2022 +0530 scsi: mpi3mr: Add helper functions to retrieve device objects Add the following helper functions: - Get the device's sas address by reading corresponding device's Device page0 - Get the expander object from expander list based on expander's handle - Get the target device object from target device list based on device's sas address - Get the expander device object from expander list based on expanders's sas address - Get hba port object from hba port table list based on port's port id Link: https://lore.kernel.org/r/20220804131226.16653-7-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit fc7212fd3100920fea711a80482d967388a4603c Author: Sreekanth Reddy Date: Thu Aug 4 18:42:16 2022 +0530 scsi: mpi3mr: Add framework to add phys to STL Add framework to register and unregister the host and expander phys with SCSI Transport Layer (STL). Link: https://lore.kernel.org/r/20220804131226.16653-6-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 7188c03ff8849cebdc3a88a3f3af1436c8ba8155 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:15 2022 +0530 scsi: mpi3mr: Enable Enclosure device add event Enable and process the Enclosure device add event. Link: https://lore.kernel.org/r/20220804131226.16653-5-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 64a8d9315b85e0177ab5c9015307d91352f6d17a Author: Sreekanth Reddy Date: Thu Aug 4 18:42:14 2022 +0530 scsi: mpi3mr: Add helper functions to retrieve config pages Add helper functions to retrieve below controller's config pages: - SAS IOUnit Page0 - SAS IOUnit Page1 - Driver Page1 - Device Page0 - SAS Phy Page0 - SAS Phy Page1 - SAS Expander Page0 - SAS Expander Page1 - Enclosure Page0 Also add the helper function to set SAS IOUnit Page1. Link: https://lore.kernel.org/r/20220804131226.16653-4-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 32d457d5a2af9bf5ddbe28297eabf1fc93451665 Author: Sreekanth Reddy Date: Thu Aug 4 18:42:13 2022 +0530 scsi: mpi3mr: Add framework to issue config requests Add framework to issue config requests commands to controller firmware. Link: https://lore.kernel.org/r/20220804131226.16653-3-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 3b73c45e6fd25a960a4862051747bbc000c8a53e Author: Sreekanth Reddy Date: Thu Aug 4 18:42:12 2022 +0530 scsi: mpi3mr: Add config and transport related debug flags Add config and transport request related error & info debug flags and functions. Link: https://lore.kernel.org/r/20220804131226.16653-2-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 97d29b9231c73d8c2c1c5b6add6d1f679bb579f9 Merge: 0134fe8512a43 565736048bd5f Author: Jakub Kicinski Date: Mon Aug 22 20:24:45 2022 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-08-18 (ixgbe) This series contains updates to ixgbe driver only. Fabio M. De Francesco replaces kmap() call to page_address() for rx_buffer->page(). Jeff Daly adds a manual AN-37 restart to help resolve issues with some link partners. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ixgbe: Manual AN-37 for troublesome link partners for X550 SFI ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC ==================== Link: https://lore.kernel.org/r/20220818223402.1294091-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 4f6b69f364a6c70147adca9b970821c3b710b770 Author: Jinyoung Choi Date: Thu Aug 4 16:55:19 2022 +0900 scsi: ufs: wb: Modify messages Modify messages to fit the format of others. Link: https://lore.kernel.org/r/20220804075519epcms2p148b6ae956b172925b26304b50d6a0da9@epcms2p1 Reviewed-by: Avri Altman Reviewed-by: Bart Van Assche Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit 42f8c5cdb039f93f8d20f3e299aa6436775ee9d6 Author: Jinyoung Choi Date: Thu Aug 4 16:54:44 2022 +0900 scsi: ufs: wb: Introduce ufshcd_is_wb_buf_flush_allowed() The explicit flushing should check the following: - UFSHCD_CAP_WB_EN - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Add helper to improve readability. Link: https://lore.kernel.org/r/20220804075444epcms2p4a0520880262281f02be65ce0fe50602d@epcms2p4 Reviewed-by: Avri Altman Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Acked-by: Bean Huo Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit 6c4148ce7cc1d80cef60242a97b25c83c844e68c Author: Jinyoung Choi Date: Thu Aug 4 16:53:54 2022 +0900 scsi: ufs: wb: Add explicit flush sysfs attribute There is the following quirk to bypass "WB Flush" in Write Booster. - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL If this quirk is not set, there is no knob that can control "WB Flush". There are three flags that control Write Booster Feature: 1. WB ON/OFF 2. WB Hibern Flush ON/OFF (implicitly) 3. WB Flush ON/OFF (explicit) The sysfs attribute that controls the WB was implemented. (1) In the case of "Hibern Flush", it is always good to turn on. Control may not be required. (2) Finally, "Flush" may be necessary because the Auto-Hibern8 is not supported in a specific environment. So the sysfs attribute that controls this is necessary. (3) Link: https://lore.kernel.org/r/20220804075354epcms2p8c21c894b4e28840c5fc651875b7f435f@epcms2p8 Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit 4450a1653a935d6c0682c08c51b58cba983cf819 Author: Jinyoung Choi Date: Thu Aug 4 16:50:58 2022 +0900 scsi: ufs: wb: Change function name and parameter names Change the parameter names of ufshcd_wb_toggle_flush_during_h8() to match the other toggle functions. Link: https://lore.kernel.org/r/20220804075058epcms2p550c578d743fe0a94888b3d71cc9076d4@epcms2p5 Reviewed-by: Avri Altman Reviewed-by: Bart Van Assche Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit f8dc7a31a3eed86b6830854e30d1c52eec6473ec Author: Jinyoung Choi Date: Thu Aug 4 16:49:28 2022 +0900 scsi: ufs: wb: Change wb_enabled condition test Change to improve readability. Link: https://lore.kernel.org/r/20220804074928epcms2p86582693a39597501b491400a28543a92@epcms2p8 Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit 0134fe8512a43122154b07cdca7d70b407f31b21 Merge: b18e04e362c0d 5c603001d782f Author: Jakub Kicinski Date: Mon Aug 22 20:10:49 2022 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-08-18 (ice) This series contains updates to ice driver only. Jesse and Anatolii add support for controlling FCS/CRC stripping via ethtool. Anirudh allows for 100M speeds on devices which support it. Sylwester removes ucast_shared field and the associated dead code related to it. Mikael removes non-inclusive language from the driver. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: remove non-inclusive language ice: Remove ucast_shared ice: Allow 100M speeds for some devices ice: Implement FCS/CRC and VLAN stripping co-existence policy ice: Implement control of FCS/CRC stripping ==================== Link: https://lore.kernel.org/r/20220818155207.996297-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 87bd05016a64864d27a640ca24ef63c760b67d73 Author: Peter Wang Date: Thu Aug 4 10:54:22 2022 +0800 scsi: ufs: core: Allow host driver to disable wb toggling during clock scaling Mediatek UFS does not want to toggle write booster during clock scaling. Permit host driver to disable wb toggling during clock scaling. Introduce a flag UFSHCD_CAP_WB_WITH_CLK_SCALING to decouple WB and clock scaling. UFSHCD_CAP_WB_WITH_CLK_SCALING is only valid when UFSHCD_CAP_CLK_SCALING is set. Just like UFSHCD_CAP_HIBERN8_WITH_CLK_GATING is valid only when UFSHCD_CAP_CLK_GATING set. Set UFSHCD_CAP_WB_WITH_CLK_SCALING for qcom to compatible legacy design at the same time. Link: https://lore.kernel.org/r/20220804025422.18803-1-peter.wang@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Peter Wang Signed-off-by: Martin K. Petersen commit 0f85e74756b5e85a0de6dce7d8c07f0b4e1f7726 Author: Daniil Lunev Date: Thu Aug 4 06:50:34 2022 +1000 scsi: ufs: core: Use local_clock() for debugging timestamps CLOCK_MONOTONIC is not advanced when the system is in suspend. This becomes problematic when debugging issues related to suspend-resume: the timestamps printed by ufshcd_print_trs can not be correlated with dmesg entries, which are timestamped with local_clock(). Change the used clock to local_clock() for the informational timestamp variables and adds mirroring *_local_clock instances for variables used in subsequent derevations (to not change the semantics of those derevations). Link: https://lore.kernel.org/r/20220804065019.v5.1.I699244ea7efbd326a34a6dfd9b5a31e78400cf68@changeid Acked-by: Stanley Chu Acked-by: Avri Altman Signed-off-by: Daniil Lunev Signed-off-by: Martin K. Petersen commit b7dbc686f60b28d0843ed572f8aa59c3e76e142b Author: Po-Wen Kao Date: Wed Aug 3 07:54:37 2022 +0800 scsi: ufs: ufs-mediatek: Support clk-scaling to optimize power consumption Provide clk-scaling feature in MediaTek UFS platforms. MediaTek platform supports clk-scaling by switching parent clock mux of UFSHCI main clocks: ufs_sel. The driver needs to prevent changing the rate of ufs_sel because its parent PLL clock may be shared between multiple IPs. In order to achieve this goal, the maximum and minimum clock rates of ufs_sel defined in dts should match the rate of "ufs_sel_max_src" and "ufs_sel_min_src" respectively. Link: https://lore.kernel.org/r/20220802235437.4547-6-stanley.chu@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Po-Wen Kao Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 2873e0453b0165117bdc28dee3e38d69dd82f4c5 Author: Peter Wang Date: Wed Aug 3 07:54:36 2022 +0800 scsi: ufs: ufs-mediatek: Fix performance scaling If clk-scaling is enabled, performance scaling can be bound to the decision of clk-scaling to avoid unnecessary boosting. In addition, fix missing initialization of pm-qos request. Link: https://lore.kernel.org/r/20220802235437.4547-5-stanley.chu@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Peter Wang Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 364893575d139546c5dc6255c12c72cdc929bf93 Author: Peter Wang Date: Wed Aug 3 07:54:35 2022 +0800 scsi: ufs: ufs-mediatek: Dump more registers Dump more proprietary UFSHCI status registers for easier issue breakdown. Link: https://lore.kernel.org/r/20220802235437.4547-4-stanley.chu@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Peter Wang Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 4d869fe67acccfc436c6030ceaba4779174019a4 Author: Stanley Chu Date: Wed Aug 3 07:54:34 2022 +0800 scsi: ufs: ufs-mediatek: Provide detailed description for UIC errors Provide detailed description in logs for UIC errors for easier issue breakdown. Link: https://lore.kernel.org/r/20220802235437.4547-3-stanley.chu@mediatek.com Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit de9f43f0d28b908479345062a235152613cb3567 Author: Stanley Chu Date: Wed Aug 3 07:54:33 2022 +0800 scsi: ufs: ufs-mediatek: Remove redundant header files Remove redundant #include of header file . Link: https://lore.kernel.org/r/20220802235437.4547-2-stanley.chu@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 008973fcbce429a2b0929108b6f9495d885bb1a3 Author: Beniamin Sandu Date: Mon Aug 15 13:40:28 2022 +0300 drm/nouveau/hwmon: use simplified HWMON_CHANNEL_INFO macro This makes the code look cleaner and easier to read. Signed-off-by: Beniamin Sandu Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220815104028.381271-1-beniaminsandu@gmail.com commit 3378d0cc9327cb3337ffc3708e08b8010bc16c4a Author: Jason Wang Date: Thu Aug 11 22:00:30 2022 +0800 clk: Fix comment typo The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220811140030.28886-1-wangborong@cdjrlc.com Signed-off-by: Stephen Boyd commit e8db788d686a2a2e5318364a1942d01c3cc83d87 Author: Shubhrajyoti Datta Date: Mon Apr 11 15:34:43 2022 +0530 clk: clocking-wizard: Update the compatible Update the compatible to indicate support for both 5.2 and 6.0 Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220411100443.15132-6-shubhrajyoti.datta@xilinx.com Acked-by: Greg Kroah-Hartman Signed-off-by: Stephen Boyd commit dd5e7431ac54e0b33f768395377fe5dbc6445f29 Author: Shubhrajyoti Datta Date: Mon Apr 11 15:34:42 2022 +0530 clk: clocking-wizard: Fix the reconfig for 5.2 The 5.2 the reconfig is triggered by writing 7 followed by 2 to the reconfig reg. Add the same. Also 6.0 is backward compatible so it should be fine. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220411100443.15132-5-shubhrajyoti.datta@xilinx.com Acked-by: Greg Kroah-Hartman Signed-off-by: Stephen Boyd commit 787ddddcbc43ab158cc15c36986c2c64b6fc84aa Author: Shubhrajyoti Datta Date: Mon Apr 11 15:34:41 2022 +0530 clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs Rename nr-outputs to xlnx,output. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220411100443.15132-4-shubhrajyoti.datta@xilinx.com Acked-by: Greg Kroah-Hartman Signed-off-by: Stephen Boyd commit c822490f52da4ae3ee5bf2b809c765ea9d8143f9 Author: Shubhrajyoti Datta Date: Mon Apr 11 15:34:40 2022 +0530 clk: clocking-wizard: Move clocking-wizard out Add clocking wizard driver to clk. And delete the driver from the staging as it is in drivers/clk. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220411100443.15132-3-shubhrajyoti.datta@xilinx.com Acked-by: Greg Kroah-Hartman Signed-off-by: Stephen Boyd commit 35dbdcac516977cf88ccdd211827874b87077bb6 Author: Shubhrajyoti Datta Date: Mon Apr 11 15:34:39 2022 +0530 dt-bindings: add documentation of xilinx clocking wizard Add the devicetree binding for the xilinx clocking wizard. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220411100443.15132-2-shubhrajyoti.datta@xilinx.com Reviewed-by: Rob Herring Acked-by: Greg Kroah-Hartman Signed-off-by: Stephen Boyd commit 4e343bafe03ff68a62f48f8235cf98f2c685468b Author: Miaoqian Lin Date: Mon May 23 19:28:11 2022 +0400 clk: tegra20: Fix refcount leak in tegra20_clock_init of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 37c26a906527 ("clk: tegra: add clock support for Tegra20") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523152811.19692-1-linmq006@gmail.com Signed-off-by: Stephen Boyd commit db16a80c76ea395766913082b1e3f939dde29b2c Author: Miaoqian Lin Date: Mon May 23 18:38:34 2022 +0400 clk: tegra: Fix refcount leak in tegra114_clock_init of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 2cb5efefd6f7 ("clk: tegra: Implement clocks for Tegra114") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523143834.7587-1-linmq006@gmail.com Signed-off-by: Stephen Boyd commit 56c78cb1f00a9dde8cd762131ce8f4c5eb046fbb Author: Miaoqian Lin Date: Mon May 23 18:26:08 2022 +0400 clk: tegra: Fix refcount leak in tegra210_clock_init of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 6b301a059eb2 ("clk: tegra: Add support for Tegra210 clocks") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523142608.65074-1-linmq006@gmail.com Signed-off-by: Stephen Boyd commit b18e04e362c0dce625d00b13f7b29c7c1c07e852 Author: Vladimir Oltean Date: Thu Aug 18 17:38:08 2022 +0300 net: dsa: tag_8021q: remove old comment regarding dsa_8021q_netdev_ops Since commit 129bd7ca8ac0 ("net: dsa: Prevent usage of NET_DSA_TAG_8021Q as tagging protocol"), dsa_8021q_netdev_ops no longer exists, so remove the comment that talks about it. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220818143808.2808393-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 92f24c6fefd53c251c3fa1f09b94871ac385cfdd Author: Wolfram Sang Date: Thu Aug 18 23:02:28 2022 +0200 net_sched: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210228.8635-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 19d1c0465ab725f96a6a31bb062481e1fb3d3950 Author: Wolfram Sang Date: Thu Aug 18 23:02:25 2022 +0200 openvswitch: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210226.8587-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit a71af8902b89e89f5126290863cd930f5126ba8e Author: Wolfram Sang Date: Thu Aug 18 23:02:18 2022 +0200 ethtool: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210218.8443-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit e4d44b3d278d71dbe711752131fef6c981fc6fc8 Author: Wolfram Sang Date: Thu Aug 18 23:02:16 2022 +0200 dsa: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220818210216.8419-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 70986397a15bf337d4ca3215a65e30bbe95e5d3c Author: Wolfram Sang Date: Thu Aug 18 23:02:15 2022 +0200 net: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210215.8395-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 8fc9d51ea2d32a05f7d7cf86a25cc86ecc57eb45 Author: Wolfram Sang Date: Thu Aug 18 23:02:27 2022 +0200 packet: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210227.8611-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit a5afe5305d4720d1248be7c8bd231133251f9a51 Author: Wolfram Sang Date: Thu Aug 18 23:02:21 2022 +0200 l2tp: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210222.8515-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 7574cc5837f301fa55c1a21a4df2a713f67de6c2 Author: Wolfram Sang Date: Thu Aug 18 23:02:20 2022 +0200 ipv6: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210220.8491-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 01e454f243f07e430800608f25adcfbfc2a2e589 Author: Wolfram Sang Date: Thu Aug 18 23:02:19 2022 +0200 ipv4: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210219.8467-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit df207b007468b09111c36250dd5c01ad177c515f Author: Wolfram Sang Date: Thu Aug 18 23:02:14 2022 +0200 caif: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210214.8371-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 993e1634ab4489908879afd33f83bc6be1a8751d Author: Wolfram Sang Date: Thu Aug 18 23:02:12 2022 +0200 bridge: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220818210212.8347-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 6164b5e3bcabd49c2326037afb49aa64fdf5e7a4 Author: Wolfram Sang Date: Thu Aug 18 23:02:05 2022 +0200 ax25: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210206.8299-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit bb4d15df9abea1818f434bba34066a208a156d5d Author: Wolfram Sang Date: Thu Aug 18 23:02:04 2022 +0200 vlan: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210204.8275-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit cdb27b7b2d8fe9f066e30f560b7e88defc456d78 Author: Wolfram Sang Date: Thu Aug 18 23:00:23 2022 +0200 isdn: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210023.6889-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 706447f09d1a68974a839062ea8848aa73e3a15d Merge: 704438dd4f030 e09e9873152e3 Author: Jakub Kicinski Date: Mon Aug 22 17:45:51 2022 -0700 Merge branch 'validate-of-nodes-for-dsa-shared-ports' Vladimir Oltean says: ==================== Validate OF nodes for DSA shared ports This is the first set of measures taken so that more drivers can be transitioned towards phylink on shared (CPU and DSA) ports some time in the future. It consists of: - expanding the DT schema for DSA and related drivers to clarify the new requirements. - introducing warnings for drivers that currently skip phylink due to incomplete DT descriptions. - introducing warning for drivers that currently skip phylink due to using platform data (search for struct dsa_chip_data). - closing the possibility for new(ish) drivers to skip phylink, by validating their DT descriptions. - making the code paths used by shared ports more evident. - preparing the code paths used by shared ports for further work to fake a link description where that is possible. More details in patch 10/10. DT binding (patches 1-6) and kernel (7-10) are in principle separable, but are submitted together since they're part of the same story. Patches 8 and 9 are DSA cleanups, and patch 7 is a dependency for patch 10. v1 at https://patchwork.kernel.org/project/netdevbpf/patch/20220723164635.1621911-1-vladimir.oltean@nxp.com/ v2 at https://patchwork.kernel.org/project/netdevbpf/patch/20220729132119.1191227-5-vladimir.oltean@nxp.com/ v3 at https://patchwork.kernel.org/project/netdevbpf/cover/20220806141059.2498226-1-vladimir.oltean@nxp.com/ ==================== Link: https://lore.kernel.org/r/20220818115500.2592578-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit e09e9873152e3f804dd704eb3e772538f8447149 Author: Vladimir Oltean Date: Thu Aug 18 14:55:00 2022 +0300 net: dsa: make phylink-related OF properties mandatory on DSA and CPU ports Early DSA drivers were kind of simplistic in that they assumed a fairly narrow hardware layout. User ports would have integrated PHYs at an internal MDIO address that is derivable from the port number, and shared (DSA and CPU) ports would have an MII-style (serial or parallel) connection to another MAC. Phylib and then phylink were used to drive the internal PHYs, and this needed little to no description through the platform data structures. Bringing up the shared ports at the maximum supported link speed was the responsibility of the drivers. As a result of this, when these early drivers were converted from platform data to the new DSA OF bindings, there was no link information translated into the first DT bindings. https://lore.kernel.org/all/YtXFtTsf++AeDm1l@lunn.ch/ Later, phylink was adopted for shared ports as well, and today we have a workaround in place, introduced by commit a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed"). There, DSA checks for the presence of phy-handle/fixed-link/managed OF properties, and if missing, phylink registration would be skipped. This is because phylink is optional for some drivers (the shared ports already work without it), but the process of starting to register a port with phylink is irreversible: if phylink_create() fails to find the fwnode properties it needs, it bails out and it leaves the ports inoperational (because phylink expects ports to be initially down, so DSA necessarily takes them down, and doesn't know how to put them back up again). DSA being a common framework, new drivers opt into this workaround willy-nilly, but the ideal behavior from the DSA core's side would have been to not interfere with phylink's process of failing at all. This isn't possible because of regression concerns with pre-phylink DT blobs, but at least DSA should put a stop to the proliferation of more of such cases that rely on the workaround to skip phylink registration, and sanitize the environment that new drivers work in. To that end, create a list of compatible strings for which the workaround is preserved, and don't apply the workaround for any drivers outside that list (this includes new drivers). In some cases, we make the assumption that even existing drivers don't rely on DSA's workaround, and we do this by looking at the device trees in which they appear. We can't fully know what is the situation with downstream DT blobs, but we can guess the overall trend by studying the DT blobs that were submitted upstream. If there are upstream blobs that have lacking descriptions, we take it as very likely that there are many more downstream blobs that do so too. If all upstream blobs have complete descriptions, we take that as a hint that the driver is a candidate for enforcing strict DT bindings (considering that most bindings are copy-pasted). If there are no upstream DT blobs, we take the conservative route of allowing the workaround, unless the driver maintainer instructs us otherwise. The driver situation is as follows: ar9331 ~~~~~~ compatible strings: - qca,ar9331-switch 1 occurrence in mainline device trees, part of SoC dtsi (arch/mips/boot/dts/qca/ar9331.dtsi), description is not problematic. Verdict: opt into strict DT bindings and out of workarounds. b53 ~~~ compatible strings: - brcm,bcm5325 - brcm,bcm53115 - brcm,bcm53125 - brcm,bcm53128 - brcm,bcm5365 - brcm,bcm5389 - brcm,bcm5395 - brcm,bcm5397 - brcm,bcm5398 - brcm,bcm53010-srab - brcm,bcm53011-srab - brcm,bcm53012-srab - brcm,bcm53018-srab - brcm,bcm53019-srab - brcm,bcm5301x-srab - brcm,bcm11360-srab - brcm,bcm58522-srab - brcm,bcm58525-srab - brcm,bcm58535-srab - brcm,bcm58622-srab - brcm,bcm58623-srab - brcm,bcm58625-srab - brcm,bcm88312-srab - brcm,cygnus-srab - brcm,nsp-srab - brcm,omega-srab - brcm,bcm3384-switch - brcm,bcm6328-switch - brcm,bcm6368-switch - brcm,bcm63xx-switch I've found at least these mainline DT blobs with problems: arch/arm/boot/dts/bcm47094-linksys-panamera.dts - lacks phy-mode arch/arm/boot/dts/bcm47189-tenda-ac9.dts - lacks phy-mode and fixed-link arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts - lacks phy-mode and fixed-link arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts arch/arm/boot/dts/bcm953012er.dts arch/arm/boot/dts/bcm4708-netgear-r6250.dts arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts - lacks phy-mode and fixed-link arch/arm/boot/dts/bcm53016-meraki-mr32.dts - lacks phy-mode Verdict: opt into DSA workarounds. bcm_sf2 ~~~~~~~ compatible strings: - brcm,bcm4908-switch - brcm,bcm7445-switch-v4.0 - brcm,bcm7278-switch-v4.0 - brcm,bcm7278-switch-v4.8 A single occurrence in mainline (arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi), part of a SoC dtsi, valid description. Florian Fainelli explains that most of the bcm_sf2 device trees lack a full description for the internal IMP ports. Verdict: opt the BCM4908 into strict DT bindings, and opt the rest into the workarounds. Note that even though BCM4908 has strict DT bindings, it still does not register with phylink on the IMP port due to it implementing ->adjust_link(). hellcreek ~~~~~~~~~ compatible strings: - hirschmann,hellcreek-de1soc-r1 No occurrence in mainline device trees. Kurt Kanzenbach explains that the downstream device trees lacked phy-mode and fixed link, and needed work, but were fixed in the meantime. Verdict: opt into strict DT bindings and out of workarounds. lan9303 ~~~~~~~ compatible strings: - smsc,lan9303-mdio - smsc,lan9303-i2c 1 occurrence in mainline device trees: arch/arm/boot/dts/imx53-kp-hsc.dts - no phy-mode, no fixed-link Verdict: opt out of strict DT bindings and into workarounds. lantiq_gswip ~~~~~~~~~~~~ compatible strings: - lantiq,xrx200-gswip - lantiq,xrx300-gswip - lantiq,xrx330-gswip No occurrences in mainline device trees. Martin Blumenstingl confirms that the downstream OpenWrt device trees lack a proper fixed-link and need work, and that the incomplete description can even be seen in the example from Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt. Verdict: opt out of strict DT bindings and into workarounds. microchip ksz ~~~~~~~~~~~~~ compatible strings: - microchip,ksz8765 - microchip,ksz8794 - microchip,ksz8795 - microchip,ksz8863 - microchip,ksz8873 - microchip,ksz9477 - microchip,ksz9897 - microchip,ksz9893 - microchip,ksz9563 - microchip,ksz8563 - microchip,ksz9567 - microchip,lan9370 - microchip,lan9371 - microchip,lan9372 - microchip,lan9373 - microchip,lan9374 5 occurrences in mainline device trees, all descriptions are valid. But we had a snafu for the ksz8795 and ksz9477 drivers where the phy-mode property would be expected to be located directly under the 'switch' node rather than under a port OF node. It was fixed by commit edecfa98f602 ("net: dsa: microchip: look for phy-mode in port nodes"). The driver still has compatibility with the old DT blobs. The lan937x support was added later than the above snafu was fixed, and even though it has support for the broken DT blobs by virtue of sharing a common probing function, I'll take it that its DT blobs are correct. Verdict: opt lan937x into strict DT bindings, and the others out. mt7530 ~~~~~~ compatible strings - mediatek,mt7621 - mediatek,mt7530 - mediatek,mt7531 Multiple occurrences in mainline device trees, one is part of an SoC dtsi (arch/mips/boot/dts/ralink/mt7621.dtsi), all descriptions are fine. Verdict: opt into strict DT bindings and out of workarounds. mv88e6060 ~~~~~~~~~ compatible string: - marvell,mv88e6060 no occurrences in mainline, nobody knows anybody who uses it. Verdict: opt out of strict DT bindings and into workarounds. mv88e6xxx ~~~~~~~~~ compatible strings: - marvell,mv88e6085 - marvell,mv88e6190 - marvell,mv88e6250 Device trees that have incomplete descriptions of CPU or DSA ports: arch/arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi - lacks phy-mode arch/arm64/boot/dts/marvell/cn9130-crb.dtsi - lacks phy-mode and fixed-link arch/arm/boot/dts/vf610-zii-ssmb-spu3.dts - lacks phy-mode arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts - lacks phy-mode arch/arm/boot/dts/vf610-zii-spb4.dts - lacks phy-mode arch/arm/boot/dts/vf610-zii-cfu1.dts - lacks phy-mode arch/arm/boot/dts/vf610-zii-dev-rev-c.dts - lacks phy-mode on CPU port, fixed-link on DSA ports arch/arm/boot/dts/vf610-zii-dev-rev-b.dts - lacks phy-mode on CPU port arch/arm/boot/dts/armada-381-netgear-gs110emx.dts - lacks phy-mode arch/arm/boot/dts/vf610-zii-scu4-aib.dts - lacks fixed-link on xgmii DSA ports and/or in-band-status on 2500base-x DSA ports, and phy-mode on CPU port arch/arm/boot/dts/imx6qdl-gw5904.dtsi - lacks phy-mode and fixed-link arch/arm/boot/dts/armada-385-clearfog-gtr-l8.dts - lacks phy-mode and fixed-link arch/arm/boot/dts/vf610-zii-ssmb-dtu.dts - lacks phy-mode arch/arm/boot/dts/kirkwood-dir665.dts - lacks phy-mode arch/arm/boot/dts/kirkwood-rd88f6281.dtsi - lacks phy-mode arch/arm/boot/dts/orion5x-netgear-wnr854t.dts - lacks phy-mode and fixed-link arch/arm/boot/dts/armada-388-clearfog.dts - lacks phy-mode arch/arm/boot/dts/armada-xp-linksys-mamba.dts - lacks phy-mode arch/arm/boot/dts/armada-385-linksys.dtsi - lacks phy-mode arch/arm/boot/dts/imx6q-b450v3.dts arch/arm/boot/dts/imx6q-b850v3.dts - has a phy-handle but not a phy-mode? arch/arm/boot/dts/armada-370-rd.dts - lacks phy-mode arch/arm/boot/dts/kirkwood-linksys-viper.dts - lacks phy-mode arch/arm/boot/dts/imx51-zii-rdu1.dts - lacks phy-mode arch/arm/boot/dts/imx51-zii-scu2-mezz.dts - lacks phy-mode arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi - lacks phy-mode arch/arm/boot/dts/armada-385-clearfog-gtr-s4.dts - lacks phy-mode and fixed-link Verdict: opt out of strict DT bindings and into workarounds. ocelot ~~~~~~ compatible strings: - mscc,vsc9953-switch - felix (arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi) is a PCI device, has no compatible string 2 occurrences in mainline, both are part of SoC dtsi and complete. Verdict: opt into strict DT bindings and out of workarounds. qca8k ~~~~~ compatible strings: - qca,qca8327 - qca,qca8328 - qca,qca8334 - qca,qca8337 5 occurrences in mainline device trees, none of the descriptions are problematic. Verdict: opt into strict DT bindings and out of workarounds. realtek ~~~~~~~ compatible strings: - realtek,rtl8366rb - realtek,rtl8365mb 2 occurrences in mainline, both descriptions are fine, additionally rtl8365mb.c has a comment "The device tree firmware should also specify the link partner of the extension port - either via a fixed-link or other phy-handle." Verdict: opt into strict DT bindings and out of workarounds. rzn1_a5psw ~~~~~~~~~~ compatible strings: - renesas,rzn1-a5psw One single occurrence, part of SoC dtsi (arch/arm/boot/dts/r9a06g032.dtsi), description is fine. Verdict: opt into strict DT bindings and out of workarounds. sja1105 ~~~~~~~ Driver already validates its port OF nodes in sja1105_parse_ports_node(). Verdict: opt into strict DT bindings and out of workarounds. vsc73xx ~~~~~~~ compatible strings: - vitesse,vsc7385 - vitesse,vsc7388 - vitesse,vsc7395 - vitesse,vsc7398 2 occurrences in mainline device trees, both descriptions are fine. Verdict: opt into strict DT bindings and out of workarounds. xrs700x ~~~~~~~ compatible strings: - arrow,xrs7003e - arrow,xrs7003f - arrow,xrs7004e - arrow,xrs7004f no occurrences in mainline, we don't know. Verdict: opt out of strict DT bindings and into workarounds. Because there is a pattern where newly added switches reuse existing drivers more often than introducing new ones, I've opted for deciding who gets to opt into the workaround based on an OF compatible match table in the DSA core. The alternative would have been to add another boolean property to struct dsa_switch, like configure_vlan_while_not_filtering. But this avoids situations where sometimes driver maintainers obfuscate what goes on by sharing a common probing function, and therefore making new switches inherit old quirks. Side note, we also warn about missing properties for drivers that rely on the workaround. This isn't an indication that we'll break compatibility with those DT blobs any time soon, but is rather done to raise awareness about the change, for future DT blob authors. Cc: Rob Herring Cc: Frank Rowand Acked-by: Alvin Šipraga # realtek Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 770375ff331111b8495e7d7099395659616f1025 Author: Vladimir Oltean Date: Thu Aug 18 14:54:59 2022 +0300 net: dsa: rename dsa_port_link_{,un}register_of There is a subset of functions that applies only to shared (DSA and CPU) ports, yet this is difficult to comprehend by looking at their code alone. These are dsa_port_link_register_of(), dsa_port_link_unregister_of(), and the functions that only these 2 call. Rename this class of functions to dsa_shared_port_* to make this fact more evident, even if this goes against the apparent convention that function names in port.c must start with dsa_port_. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit da2c398e59d6b47260e4198559b9f284e3b557e0 Author: Vladimir Oltean Date: Thu Aug 18 14:54:58 2022 +0300 net: dsa: avoid dsa_port_link_{,un}register_of() calls with platform data dsa_port_link_register_of() and dsa_port_link_unregister_of() are not written with the fact in mind that they can be called with a dp->dn that is NULL (as evidenced even by the _of suffix in their name), but this is exactly what happens. How this behaves will differ depending on whether the backing driver implements ->adjust_link() or not. If it doesn't, the "if (of_phy_is_fixed_link(dp->dn) || phy_np)" condition will return false, and dsa_port_link_register_of() will do nothing and return 0. If the driver does implement ->adjust_link(), the "if (of_phy_is_fixed_link(dp->dn))" condition will return false (dp->dn is NULL) and we will call dsa_port_setup_phy_of(). This will call dsa_port_get_phy_device(), which will also return NULL, and we will also do nothing and return 0. It is hard to maintain this code and make future changes to it in this state, so just suppress calls to these 2 functions if dp->dn is NULL. The only functional effect is that if the driver does implement ->adjust_link(), we'll stop printing this to the console: Using legacy PHYLIB callbacks. Please migrate to PHYLINK! but instead we'll always print: [ 8.539848] dsa-loop fixed-0:1f: skipping link registration for CPU port 5 This is for the better anyway, since "using legacy phylib callbacks" was misleading information - we weren't issuing _any_ callbacks due to dsa_port_get_phy_device() returning NULL. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit df55e317805f0ce11c1c4fdb3afa2a42eecca44f Author: Vladimir Oltean Date: Thu Aug 18 14:54:57 2022 +0300 of: base: export of_device_compatible_match() for use in modules Modules such as net/dsa/dsa_core.ko might want to iterate through an array of compatible strings for things such as validation (or rather, skipping it for some potentially broken drivers). of_device_is_compatible() is exported, by of_device_compatible_match() isn't. Export the latter as well, so we don't have to open-code the iteration. Cc: Frank Rowand Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit 2ec2fb8331af3b2485ef8b735afc6c7032e44420 Author: Vladimir Oltean Date: Thu Aug 18 14:54:56 2022 +0300 dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports It is desirable that new DSA drivers are written to expect that all their ports register with phylink, and not rely on the DSA core's workarounds to skip this process. To that end, DSA is being changed to warn existing drivers when such DT blobs are in use, and to opt new drivers out of the workarounds. Introduce another layer of validation in the DSA DT schema, and assert that CPU and DSA ports must have phylink-related properties present. Suggested-by: Rob Herring Signed-off-by: Vladimir Oltean Reviewed-by: Rob Herring Signed-off-by: Jakub Kicinski commit f3c8168fdd02ef8ecc3cf7d4c3c032107e7f91cd Author: Vladimir Oltean Date: Thu Aug 18 14:54:55 2022 +0300 dt-bindings: net: dsa: rzn1-a5psw: add missing CPU port phy-mode to example To prevent warnings during "make dt_bindings_check" after dsa-port.yaml will make phylink properties mandatory, add phy-mode = "internal" to the example. This new property is taken straight out of the SoC dtsi at arch/arm/boot/dts/r9a06g032.dtsi, so it seems likely that only the example needs to be fixed, rather than DT blobs in circulation. Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit 2401bd9532fe750974e4ff45fdad954f6f7dc694 Author: Vladimir Oltean Date: Thu Aug 18 14:54:54 2022 +0300 dt-bindings: net: dsa: microchip: add missing CPU port phy-mode to example The ksz_switch_chips[] element for KSZ9477 says that port 5 is an xMII port and it supports speeds of 10/100/1000. The device tree example does declare a fixed-link at 1000, and RGMII is the only one of those modes that supports this speed, so use this phy-mode. The microchip,ksz8565 compatible string is not supported by the microchip driver, however on Microchip's product page it says that there are 5 ports, 4 of which have internal PHYs and the 5th is an MII/RMII/RGMII port. It's a bit strange that this is port@6, but it is probably just the way it is. Select an RGMII phy-mode for this one as well. Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit 526512f675c8c8d084071c1427f83f8faca96072 Author: Vladimir Oltean Date: Thu Aug 18 14:54:53 2022 +0300 dt-bindings: net: dsa: b53: add missing CPU port phy-mode to example Looking at b53_srab_phylink_get_caps() I get no indication of what PHY modes does port 8 support, since it is implemented circularly based on the p->mode retrieved from the device tree (and in PHY_INTERFACE_MODE_NA it reports nothing to supported_interfaces). However if I look at the b53_switch_chips[] element for BCM58XX_DEVICE_ID, I see that port 8 is the IMP port, and SRAB means the IMP port is internal to the SoC. So use phy-mode = "internal" in the example. Note that this will make b53_srab_phylink_get_caps() go through the "default" case and report PHY_INTERFACE_MODE_INTERNAL to supported_interfaces, which is probably a good thing. Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit b975b73425cde436f3e66e4cd992f6e6fb0998e5 Author: Vladimir Oltean Date: Thu Aug 18 14:54:52 2022 +0300 dt-bindings: net: dsa: hellcreek: add missing CPU port phy-mode/fixed-link to example Looking at hellcreek_phylink_get_caps(), I see that depending on whether is_100_mbits is set, speeds of 1G or of 100M will be advertised. The de1soc_r1_pdata sets is_100_mbits to true. The PHY modes declared in the capabilities are MII, RGMII and GMII. GMII doesn't support 100Mbps, and as for RGMII, it would be a bit implausible to me to support this PHY mode but limit it to only 25 MHz. So I've settled on MII as a phy-mode in the example, and a fixed-link of 100Mbps. As a side note, there exists such a thing as "rev-mii", because the MII protocol is asymmetric, and "mii" is the designation for the MAC side (expected to be connected to a PHY), and "rev-mii" is the designation for the PHY side (expected to be connected to a MAC). I wonder whether "mii" or "rev-mii" should actually be used here, since this is a CPU port and presumably connected to another MAC. Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Reviewed-by: Kurt Kanzenbach Signed-off-by: Jakub Kicinski commit b237676039d9f5f3a2a75bc258c3723940f697df Author: Vladimir Oltean Date: Thu Aug 18 14:54:51 2022 +0300 dt-bindings: net: dsa: xrs700x: add missing CPU port phy-mode to example Judging by xrs700x_phylink_get_caps(), I deduce that this switch supports the RGMII modes on port 3, so state this phy-mode in the example, such that users are encouraged to not rely on avoiding phylink for this port. Signed-off-by: Vladimir Oltean Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit a9da7251ac8bcc2f2358513868f1903ac2809b3d Author: Wolfram Sang Date: Mon Aug 22 17:14:58 2022 -0700 Input: gameport - move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210156.8143-1-wsa+renesas@sang-engineering.com Signed-off-by: Dmitry Torokhov commit 8bdb15cd05d4365dfb75978d885328ebdeb5875e Author: Shubhrajyoti Datta Date: Wed Apr 6 14:52:11 2022 +0530 clk: zynqmp: Check the return type zynqmp_pm_query_data Check the return type of zynqmp_pm_query_data(qdata, ret_payload); Addresses-Coverity: Event check_return Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220406092211.19017-1-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek Signed-off-by: Stephen Boyd commit 6ab9810cfe6c8f3d8b8750c827d7870abd3751b9 Author: Shubhrajyoti Datta Date: Wed May 18 11:23:14 2022 +0530 clk: zynqmp: Add a check for NULL pointer Add a NULL pointer check as clk_hw_get_parent can return NULL. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220518055314.2486-1-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek Signed-off-by: Stephen Boyd commit acc1c732f35bb3a26177e54cd3de27e3524426e4 Author: Shubhrajyoti Datta Date: Tue May 10 12:31:53 2022 +0530 clk: zynqmp: Replaced strncpy() with strscpy() Replaced strncpy() with strscpy() as the clock names are supposed to be NULL terminated. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220510070154.29528-2-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek Signed-off-by: Stephen Boyd commit dd80fb2dbf1cd8751efbe4e53e54056f56a9b115 Author: Ian Nam Date: Tue May 10 12:31:54 2022 +0530 clk: zynqmp: Fix stack-out-of-bounds in strncpy` "BUG: KASAN: stack-out-of-bounds in strncpy+0x30/0x68" Linux-ATF interface is using 16 bytes of SMC payload. In case clock name is longer than 15 bytes, string terminated NULL character will not be received by Linux. Add explicit NULL character at last byte to fix issues when clock name is longer. This fixes below bug reported by KASAN: ================================================================== BUG: KASAN: stack-out-of-bounds in strncpy+0x30/0x68 Read of size 1 at addr ffff0008c89a7410 by task swapper/0/1 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.0-00396-g81ef9e7-dirty #3 Hardware name: Xilinx Versal vck190 Eval board revA (QSPI) (DT) Call trace: dump_backtrace+0x0/0x1e8 show_stack+0x14/0x20 dump_stack+0xd4/0x108 print_address_description.isra.0+0xbc/0x37c __kasan_report+0x144/0x198 kasan_report+0xc/0x18 __asan_load1+0x5c/0x68 strncpy+0x30/0x68 zynqmp_clock_probe+0x238/0x7b8 platform_drv_probe+0x6c/0xc8 really_probe+0x14c/0x418 driver_probe_device+0x74/0x130 __device_attach_driver+0xc4/0xe8 bus_for_each_drv+0xec/0x150 __device_attach+0x160/0x1d8 device_initial_probe+0x10/0x18 bus_probe_device+0xe0/0xf0 device_add+0x528/0x950 of_device_add+0x5c/0x80 of_platform_device_create_pdata+0x120/0x168 of_platform_bus_create+0x244/0x4e0 of_platform_populate+0x50/0xe8 zynqmp_firmware_probe+0x370/0x3a8 platform_drv_probe+0x6c/0xc8 really_probe+0x14c/0x418 driver_probe_device+0x74/0x130 device_driver_attach+0x94/0xa0 __driver_attach+0x70/0x108 bus_for_each_dev+0xe4/0x158 driver_attach+0x30/0x40 bus_add_driver+0x21c/0x2b8 driver_register+0xbc/0x1d0 __platform_driver_register+0x7c/0x88 zynqmp_firmware_driver_init+0x1c/0x24 do_one_initcall+0xa4/0x234 kernel_init_freeable+0x1b0/0x24c kernel_init+0x10/0x110 ret_from_fork+0x10/0x18 The buggy address belongs to the page: page:ffff0008f9be1c88 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 raw: 0008d00000000000 ffff0008f9be1c90 ffff0008f9be1c90 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff page dumped because: kasan: bad access detected addr ffff0008c89a7410 is located in stack of task swapper/0/1 at offset 112 in frame: zynqmp_clock_probe+0x0/0x7b8 this frame has 3 objects: [32, 44) 'response' [64, 80) 'ret_payload' [96, 112) 'name' Memory state around the buggy address: ffff0008c89a7300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0008c89a7380: 00 00 00 00 f1 f1 f1 f1 00 04 f2 f2 00 00 f2 f2 >ffff0008c89a7400: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff0008c89a7480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0008c89a7500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Signed-off-by: Ian Nam Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220510070154.29528-3-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek Signed-off-by: Stephen Boyd commit d3954b51b475c4848179cd90b24ac73684cdc76b Author: Shubhrajyoti Datta Date: Thu Aug 18 17:01:53 2022 +0530 clk: zynqmp: make bestdiv unsigned Divisor is always positive make it u32 *. Also the arguments passed are currently of u32 pointers. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220818113153.14431-1-shubhrajyoti.datta@amd.com Signed-off-by: Stephen Boyd commit c19edff61210eb846bf8ec44c9f87d1ca9efdfd2 Author: Wolfram Sang Date: Thu Aug 18 23:00:00 2022 +0200 clk: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210000.6600-1-wsa+renesas@sang-engineering.com Signed-off-by: Stephen Boyd commit 450c787cec18fffb405e623a662d4095ade81942 Author: Conor Dooley Date: Wed Jul 27 14:10:16 2022 +0100 dt-bindings: clock: gpio-gate-clock: Convert to json-schema Convert the simple GPIO clock gate Device Tree binding to json-schema and fix-up references to this file in other text format bindings. Jyri Sarha is the file's only editor/author so they have been added as maintainer of the new yaml binding. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220727131015.2073100-1-conor.dooley@microchip.com Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit ba6165bc8344e1b18ed49249916ca62ba49d38ad Author: Lukas Bulwahn Date: Mon Jun 13 10:16:32 2022 +0200 dt-bindings: clock: Move versaclock.h to dt-bindings/clock Most of the clock related dt-binding header files are located in dt-bindings/clock folder. It would be good to keep all the similar header files at a single location. This was discovered while investigating the state of ownership of the files in include/dt-bindings/ according to the MAINTAINERS file. This change here is similar to commit 8e28918a85a0 ("dt-bindings: clock: Move ti-dra7-atl.h to dt-bindings/clock") and commit 35d35aae8177 ("dt-bindings: clock: Move at91.h to dt-bindigs/clock"). Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220613081632.2159-3-lukas.bulwahn@gmail.com Reviewed-by: Luca Ceresoli Reviewed-by: Luca Ceresoli Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 0384759b3dbc5e489299b55a436dde8462c1a623 Author: Lukas Bulwahn Date: Mon Jun 13 10:16:31 2022 +0200 dt-bindings: clock: Move lochnagar.h to dt-bindings/clock Most of the clock-related dt-binding header files are located in include/dt-bindings/clock. It would be good to keep all the similar header files at a single location. This was discovered while investigating the state of ownership of the files in include/dt-bindings/ according to the MAINTAINERS file. This change here is similar to commit 8e28918a85a0 ("dt-bindings: clock: Move ti-dra7-atl.h to dt-bindings/clock") and commit 35d35aae8177 ("dt-bindings: clock: Move at91.h to dt-bindigs/clock"). Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220613081632.2159-2-lukas.bulwahn@gmail.com Acked-by: Charles Keepax Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 874765c9251f602ccc43b05d05b2e0525c1f7d21 Author: Jean Delvare Date: Thu Aug 4 13:45:45 2022 +0200 i2c: muxes: Drop obsolete dependency on COMPILE_TEST Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 272ac1500372183ffd54b0c9f43f52afc482e610 Author: Eric Biggers Date: Mon Aug 15 11:45:01 2022 -0700 fscrypt: remove fscrypt_set_test_dummy_encryption() Now that all its callers have been converted to fscrypt_parse_test_dummy_encryption() and fscrypt_add_test_dummy_key() instead, fscrypt_set_test_dummy_encryption() can be removed. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220513231605.175121-6-ebiggers@kernel.org commit c10c55cf49fe9060720d67575c301dd452e0fab3 Author: Tales Aparecida Date: Sun Aug 21 03:25:28 2022 -0300 drm/amd/display: remove unneeded defines from bios parser Removes DEFINEs that should have been removed after they were introduced to ObjectID.h by the commit abea57d70e90 ("drm/amdgpu: Add BRACKET_LAYOUT_ENUMs to ObjectID.h") Signed-off-by: Tales Aparecida Signed-off-by: Alex Deucher commit 7ac32451193d20fbcddfb5b2623838ae98cb3c17 Author: Roman Li Date: Mon Aug 22 12:37:10 2022 -0400 drm/amd/display: enable PCON support for dcn314 [Why] DCN314 supports PCON. [How] Explicitly enable it in dcn314 resources. Signed-off-by: Roman Li Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 9407feacd2e19b66bed0762c454b1654807a626c Author: Tim Huang Date: Mon Aug 15 13:50:46 2022 +0800 drm/amdgpu: enable NBIO IP v7.7.0 Clock Gating Enable AMD_CG_SUPPORT_BIF_MGCG and AMD_CG_SUPPORT_BIF_LS support. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit c4d0d699992d36e91d84e42680fd7e7def696e97 Author: Tim Huang Date: Mon Aug 15 13:12:21 2022 +0800 drm/amdgpu: add NBIO IP v7.7.0 Clock Gating support Add BIF Clock Gating MGCG and LS support for NBIO IP v7.7.0. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 6575eb930d16b789a0230df5664578d7d159a255 Author: Tim Huang Date: Mon Aug 15 13:03:49 2022 +0800 drm/amdgpu: add TX_POWER_CTRL_1 macro definitions for NBIO IP v7.7.0 Add the BIF0_PCIE_TX_POWER_CTRL_1 register offset and mask macro definitions for AMD_CG_SUPPORT_BIF_LS. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit d6c770d2050b26fc90c80c13df1d6ae4682b2e3f Author: Zhenneng Li Date: Thu Aug 11 15:25:40 2022 +0800 drm/radeon: add a force flush to delay work when radeon Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a corner case that radeon lockup work queue may not be fully flushed, and meanwhile the radeon_suspend_kms() function has called pci_set_power_state() to put device in D3hot state. Per PCI spec rev 4.0 on 5.3.1.4.1 D3hot State. > Configuration and Message requests are the only TLPs accepted by a Function in > the D3hot state. All other received Requests must be handled as Unsupported Requests, > and all received Completions may optionally be handled as Unexpected Completions. This issue will happen in following logs: Unable to handle kernel paging request at virtual address 00008800e0008010 CPU 0 kworker/0:3(131): Oops 0 pc = [] ra = [] ps = 0000 Tainted: G W pc is at si_gpu_check_soft_reset+0x3c/0x240 ra is at si_dma_is_lockup+0x34/0xd0 v0 = 0000000000000000 t0 = fff08800e0008010 t1 = 0000000000010000 t2 = 0000000000008010 t3 = fff00007e3c00000 t4 = fff00007e3c00258 t5 = 000000000000ffff t6 = 0000000000000001 t7 = fff00007ef078000 s0 = fff00007e3c016e8 s1 = fff00007e3c00000 s2 = fff00007e3c00018 s3 = fff00007e3c00000 s4 = fff00007fff59d80 s5 = 0000000000000000 s6 = fff00007ef07bd98 a0 = fff00007e3c00000 a1 = fff00007e3c016e8 a2 = 0000000000000008 a3 = 0000000000000001 a4 = 8f5c28f5c28f5c29 a5 = ffffffff810f4338 t8 = 0000000000000275 t9 = ffffffff809b66f8 t10 = ff6769c5d964b800 t11= 000000000000b886 pv = ffffffff811bea20 at = 0000000000000000 gp = ffffffff81d89690 sp = 00000000aa814126 Disabling lock debugging due to kernel taint Trace: [] si_dma_is_lockup+0x34/0xd0 [] radeon_fence_check_lockup+0xd0/0x290 [] process_one_work+0x280/0x550 [] worker_thread+0x70/0x7c0 [] worker_thread+0x130/0x7c0 [] kthread+0x200/0x210 [] worker_thread+0x0/0x7c0 [] kthread+0x14c/0x210 [] ret_from_kernel_thread+0x18/0x20 [] kthread+0x0/0x210 Code: ad3e0008 43f0074a ad7e0018 ad9e0020 8c3001e8 40230101 <88210000> 4821ed21 So force lockup work queue flush to fix this problem. Acked-by: Christian König Signed-off-by: Zhenneng Li Signed-off-by: Alex Deucher commit f9bc6142cd8deb953f0d9fa6bc6e1833402739e4 Author: Magali Lemes Date: Thu Aug 18 22:53:02 2022 -0300 drm/amd/display: remove unused header dml_wrapper* files were removed in commit 01b537eeb049 ("drm/amd/display: Remove unused code"), as they are not used anywhere. However, the header file wasn't removed, so remove the header as well. Signed-off-by: Magali Lemes Signed-off-by: Alex Deucher commit 441b12bcae736c20a6b8bf6978f90426ab1719a1 Author: Maíra Canal Date: Thu Aug 18 10:27:30 2022 -0300 drm/amd/display: Include missing header The file amdgpu_dm_plane.c missed the header amdgpu_dm_plane.h, which resulted on the following warning: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1046:5: warning: no previous prototype for 'fill_dc_scaling_info' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1222:6: warning: no previous prototype for 'handle_cursor_update' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:152:6: warning: no previous prototype for 'modifier_has_dcc' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1576:5: warning: no previous prototype for 'amdgpu_dm_plane_init' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:157:10: warning: no previous prototype for 'modifier_gfx9_swizzle_mode' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:752:5: warning: no previous prototype for 'fill_plane_buffer_attributes' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:83:31: warning: no previous prototype for 'amd_get_format_info' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:88:6: warning: no previous prototype for 'fill_blending_from_plane_state' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:992:5: warning: no previous prototype for 'dm_plane_helper_check_state' [-Wmissing-prototypes] Therefore, include the missing header on the file and turn global functions that are not used outside of the file into static functions. Fixes: 5d945cbcd4b1 ("drm/amd/display: Create a file dedicated to planes") Reported-by: kernel test robot Signed-off-by: Maíra Canal Signed-off-by: Alex Deucher commit ddeaf487464af315ef7af02b37830a14fb5452e5 Author: Yang Li Date: Thu Aug 18 10:59:12 2022 +0800 drm/amd/display: remove unneeded semicolon Semicolon is not required after curly braces. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1918 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit a0f7e7f759cf299ee6f6d8723c596af9a1a86b10 Author: Hamza Mahfooz Date: Wed Aug 17 12:03:51 2022 -0400 drm/amd/display: fix i386 frame size warning Addresses the following warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_mode_vba_30.c:3596:6: error: stack frame size (2092) exceeds limit (2048) in 'dml30_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ UseMinimumDCFCLK() is eating away at dml30_ModeSupportAndSystemConfigurationFull()'s stack space, so use a pointer to struct vba_vars_st instead of passing lots of large arrays as parameters by value. Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 947f63f17e1d91cee19f1bc071e825b28ce4da98 Author: shaoyunl Date: Thu Aug 18 14:13:52 2022 -0400 drm/amdgpu: Remove the additional kfd pre reset call for sriov The additional call is caused by merge conflict Reviewed-by: Felix Kuehling Signed-off-by: shaoyunl Signed-off-by: Alex Deucher commit 4bb5fed16991e6c1be6b8b4c1305dcf08ac58ecd Author: Candice Li Date: Thu Aug 18 10:47:09 2022 +0800 drm/amdgpu: Check num_gfx_rings for gfx v9_0 rb setup. No need to set up rb when no gfx rings. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9dfa4860efb8cf20c12b9b65ec66cafa6e93f3a6 Author: YiPeng Chai Date: Fri Aug 12 14:34:35 2022 +0800 drm/amdgpu: fix hive reference leak when adding xgmi device Only amdgpu_get_xgmi_hive but no amdgpu_put_xgmi_hive which will leak the hive reference. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d8adafc7feb86b61fc483bb58b30028e6fb919d7 Author: YiPeng Chai Date: Fri Aug 12 13:38:34 2022 +0800 drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini V1: The amdgpu_xgmi_remove_device function will send unload command to psp through psp ring to terminate xgmi, but psp ring has been destroyed in psp_hw_fini. V2: 1. Change the commit title. 2. Restore amdgpu_xgmi_remove_device to its original calling location. Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 95a72fb73c5900f1b8f00b2559179760ddb729ac Author: Tim Huang Date: Mon Aug 15 14:04:49 2022 +0800 drm/amdgpu: enable GFXOFF allow control for GC IP v11.0.1 Enable GFXOFF allow control when set the GFX power gating. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 7a12dd077e5207d72fadaabf7d4520bd3af84082 Author: Wolfram Sang Date: Thu Aug 18 23:00:53 2022 +0200 of: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220818210054.7157-1-wsa+renesas@sang-engineering.com commit e02b4a2fc3e20df3567bb563a2f12582f5ae17cd Author: Rob Herring Date: Wed Aug 10 10:03:41 2022 -0600 dt-bindings: arm,versatile-sysreg: Convert to DT schema format Convert the arm,versatile-sysreg binding to DT schema format. The original binding was missing 'simple-mfd' and a 'panel' sub node which the only user (versatile-ab.dts) of this binding has. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220810160341.51995-3-robh@kernel.org commit 88164dada2d09a3ac02a9e86e3bf7e8267e137c2 Author: Rob Herring Date: Wed Aug 10 10:03:40 2022 -0600 dt-bindings: display: arm,versatile-tft-panel: Drop erroneous properties in example The 'arm,versatile-sysreg' node in the example should not have '#address-cells' and '#size-cells' properties as the child node doesn't have 'reg'. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220810160341.51995-2-robh@kernel.org commit c8fa60b2303139572eb270ce072754b88668f4c6 Author: Krzysztof Kozlowski Date: Thu Aug 18 09:17:13 2022 +0300 dt-bindings: gpu: arm,mali: restrict opp-table to objects Simple 'opp-table:true' accepts a boolean property as opp-table, so restrict it to object to properly enforce real OPP table nodes. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220818061713.9611-1-krzysztof.kozlowski@linaro.org commit c89737376f5244be268bf61d4046665e2350ee04 Author: Krzysztof Kozlowski Date: Thu Aug 18 09:16:53 2022 +0300 dt-bindings: interconnect: restrict opp-table to objects Simple 'opp-table:true' accepts a boolean property as opp-table, so restrict it to object to properly enforce real OPP table nodes. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220818061653.9524-1-krzysztof.kozlowski@linaro.org commit 66320b268a6f69aae54a2721c1f42bca57c8d9c2 Author: Krzysztof Kozlowski Date: Thu Aug 18 09:15:49 2022 +0300 dt-bindings: memory-controllers: fsl,imx8m-ddrc: restrict opp-table to objects Simple 'opp-table:true' accepts a boolean property as opp-table, so restrict it to object to properly enferce real OPP table nodes. Signed-off-by: Krzysztof Kozlowski Acked-by: Peng Fan Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220818061549.9087-1-krzysztof.kozlowski@linaro.org commit ee50b00244086453dfb7076e4b80214948cd0507 Author: Johan Hovold Date: Mon Jul 11 09:52:02 2022 +0200 drm/panel-edp: add AUO B133UAN02.1 panel entry Add an eDP panel entry for AUO B133UAN02.1. Due to lack of documentation, use the delay_200_500_e50 timings like some other AUO entries for now. Signed-off-by: Johan Hovold Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220711075202.21775-1-johan+linaro@kernel.org commit d25c6948a6aad787d9fd64de6b5362c3f23cc8d0 Author: Tony Luck Date: Tue Aug 2 09:18:47 2022 -0700 RAS/CEC: Reduce offline page threshold for Intel systems A large scale study of memory errors on Intel systems in data centers showed that aggressively taking pages with corrected errors offline is the best strategy of using corrected errors as a predictor of future uncorrected errors. Set the threshold to "2" on Intel systems. AMD guidance is that this is not necessary for their systems. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Reviewed-by: Yazen Ghannam Link: https://lore.kernel.org/r/20220607212015.175591-1-tony.luck@intel.com Link: https://lore.kernel.org/r/YulOZ/Eso0bwUcC4@agluck-desk3.sc.intel.com commit e88811bc43b971e06fa82d4e421e21b3c999c1a7 Author: Jens Axboe Date: Fri Aug 5 16:44:34 2022 -0600 block: use on-stack page vec for <= UIO_FASTIOV Avoid a kmalloc+kfree for each page array, if we only have a few pages that are mapped. An alloc+free for each IO is quite expensive, and it's pretty pointless if we're only dealing with 1 or a few vecs. Use UIO_FASTIOV like we do in other spots to set a sane limit for how big of an IO we want to avoid allocations for. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 8af870aa5b84729d7a39f84226be6f84e4943d8f Author: Jens Axboe Date: Fri Aug 5 16:43:09 2022 -0600 block: enable bio caching use for passthru IO bdev based polled O_DIRECT is currently quite a bit faster than passthru on the same device, and one of the reaons is that we're not able to use the bio caching for passthru IO. If REQ_POLLED is set on the request, use the fs bio set for grabbing a bio from the caches, if available. This saves 5-6% of CPU over head for polled passthru IO. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit f5d632d15e9e0a037339601680d82bb840f85d10 Author: Jens Axboe Date: Fri Aug 5 16:39:04 2022 -0600 block: shrink rq_map_data a bit We don't need full ints for several of these members. Change the page_order and nr_entries to unsigned shorts, and the true/false from_user and null_mapped to booleans. This shrinks the struct from 32 to 24 bytes on 64-bit archs. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit d322f355e9368045ff89b7a3df9324fe0c33839b Author: Yu Kuai Date: Tue Aug 16 09:56:31 2022 +0800 block, bfq: remove useless parameter for bfq_add/del_bfqq_busy() 'bfqd' can be accessed through 'bfqq->bfqd', there is no need to pass it as a parameter separately. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220816015631.1323948-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 1e3cc2125d7cc7d492b2e6e52d09c1e17ba573c3 Author: Yu Kuai Date: Tue Aug 16 09:56:30 2022 +0800 block, bfq: remove useless checking in bfq_put_queue() 'bfqq->bfqd' is ensured to set in bfq_init_queue(), and it will never change afterwards. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220816015631.1323948-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit c2090eabacd72910a5edf57cf42004097a13ddad Author: Yu Kuai Date: Tue Aug 16 09:56:29 2022 +0800 block, bfq: remove unused functions While doing code coverage testing(CONFIG_BFQ_CGROUP_DEBUG is disabled), we found that some functions doesn't have caller, thus remove them. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220816015631.1323948-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit a4e1d0b76e7b32c0839e72679c530445172a2564 Author: Bart Van Assche Date: Mon Aug 15 10:00:43 2022 -0700 block: Change the return type of blk_mq_map_queues() into void Since blk_mq_map_queues() and the .map_queues() callbacks always return 0, change their return type into void. Most callers ignore the returned value anyway. Cc: Christoph Hellwig Cc: Jason Wang Cc: Keith Busch Cc: Martin K. Petersen Cc: Doug Gilbert Cc: Michael S. Tsirkin Signed-off-by: Bart Van Assche Reviewed-by: John Garry Acked-by: Md Haris Iqbal Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20220815170043.19489-3-bvanassche@acm.org [axboe: fold in fix from Bart] Signed-off-by: Jens Axboe commit b99ee26a1a98a8ac0d8241224c40e6c047091d4d Author: Christophe JAILLET Date: Sun Jul 31 09:06:48 2022 +0200 coresight: docs: Fix a broken reference Since the commit in Fixes: tag, "coresight-cpu-debug.txt" has been turned into "arm,coresight-cpu-debug.yaml". Update the doc accordingly to avoid a 'make htmldocs' warning Fixes: 66d052047ca8 ("dt-bindings: arm: Convert CoreSight CPU debug to DT schema") Signed-off-by: Christophe JAILLET Reviewed-by: James Clark Link: https://lore.kernel.org/r/c7f864854e9e03916017712017ff59132c51c338.1659251193.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier commit 8c6989e5463a2d9415b743a20e3b843a2354beec Author: Randy Dunlap Date: Thu Jul 14 18:59:25 2022 -0700 coresight: trbe: fix Kconfig "its" grammar Use the possessive "its" instead of the contraction "it's" where appropriate. Signed-off-by: Randy Dunlap Cc: Anshuman Khandual Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Alexander Shishkin Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220715015925.12569-1-rdunlap@infradead.org Signed-off-by: Mathieu Poirier commit 6e1853589ea627490f85435b9e81843129b08c10 Author: Marek Vasut Date: Fri Aug 19 16:08:52 2022 +0200 drm/lcdif: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Alexander Stein Link: https://patchwork.freedesktop.org/patch/msgid/20220819140852.255187-4-marex@denx.de commit 71c627c0a87acb13080317c5bae1f1423bebd5ef Author: Marek Vasut Date: Fri Aug 19 16:08:51 2022 +0200 drm/lcdif: Clean up debug prints and comments Update debug print to report bridge timings over connector ones. Drop missed comment commit from mxsfb. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Link: https://patchwork.freedesktop.org/patch/msgid/20220819140852.255187-3-marex@denx.de commit 5e6723ef3fda07b4d586965af3c7af2a957480a2 Author: Marek Vasut Date: Fri Aug 19 16:08:50 2022 +0200 drm/lcdif: Consistently use plain timings Drop the crtc_ prefix from mode, consistently use the plain one. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Link: https://patchwork.freedesktop.org/patch/msgid/20220819140852.255187-2-marex@denx.de commit fcfd3e5fb2f052f6f466285107f449d462277a99 Author: Marek Vasut Date: Fri Aug 19 16:08:49 2022 +0200 drm/lcdif: Clean up headers Drop unneeded headers, sort rest alphabetically, no functional change. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Alexander Stein Link: https://patchwork.freedesktop.org/patch/msgid/20220819140852.255187-1-marex@denx.de commit 704438dd4f030c1b3d28a2a9c8f182c32d9b6bc4 Author: Maksym Glubokiy Date: Thu Aug 18 14:18:21 2022 +0300 net: prestera: cache port state for non-phylink ports too Port event data must stored to port-state cache regardless of whether the port uses phylink or not since this data is used by ethtool. Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") Signed-off-by: Oleksandr Mazur Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit 105b0468d7b2e6779a188a83b7e128368acb8a1d Author: zhaoxiao Date: Thu Aug 18 17:50:59 2022 +0800 net: freescale: xgmac: Do not dereference fwnode in struct device In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific dev_fwnode() API for that. Signed-off-by: zhaoxiao Signed-off-by: David S. Miller commit 10b41ea15e81a5597bc5944a7900e9a790bd984a Author: Bart Van Assche Date: Mon Aug 15 10:00:42 2022 -0700 null_blk: Modify the behavior of null_map_queues() Instead of returning -EINVAL if an internal inconsistency is detected, fall back to a single submission queue. This patch prepares for changing the return value of the .map_queues() callbacks into void. Cc: Christoph Hellwig Cc: Keith Busch Signed-off-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220815170043.19489-2-bvanassche@acm.org Signed-off-by: Jens Axboe commit 74e237b6e7421157cc378eee6641b818cea8129d Author: Santosh Pradhan Date: Thu Aug 18 12:55:51 2022 +0200 block/rnbd-srv: Add event tracing support Add event tracing mechanism for following routines: - create_sess() - destroy_sess() - process_rdma() - process_msg_sess_info() - process_msg_open() - process_msg_close() How to use: 1. Load the rnbd_server module 2. cd /sys/kernel/debug/tracing 3. If all the events need to be enabled: echo 1 > events/rnbd_srv/enable 4. OR only speific routine/event needs to be enabled e.g. echo 1 > events/rnbd_srv/create_sess/enable 5. cat trace 5. Run some workload which can trigger create_sess() routine/event Signed-off-by: Santosh Pradhan Signed-off-by: Jack Wang Signed-off-by: Md Haris Iqbal Link: https://lore.kernel.org/r/20220818105551.110490-2-haris.iqbal@ionos.com Signed-off-by: Jens Axboe commit c6ea70604249bc357ce09e9f8e16c29df0fb2fa2 Author: dougmill@linux.vnet.ibm.com Date: Tue Aug 16 15:07:13 2022 +0100 block: sed-opal: Add ioctl to return device status Provide a mechanism to retrieve basic status information about the device, including the "supported" flag indicating whether SED-OPAL is supported. The information returned is from the various feature descriptors received during the discovery0 step, and so this ioctl does nothing more than perform the discovery0 step and then save the information received. See "struct opal_status" and OPAL_FL_* bits for the status information currently returned. This is necessary to be able to check whether a device is OPAL enabled, set up, locked or unlocked from userspace programs like systemd-cryptsetup and libcryptsetup. Right now we just have to assume the user 'knows' or blindly attempt setup/lock/unlock operations. Signed-off-by: Douglas Miller Tested-by: Luca Boccassi Reviewed-by: Scott Bauer Acked-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220816140713.84893-1-luca.boccassi@gmail.com Signed-off-by: Jens Axboe commit 6d3c900c12d72667341bcff338c252e22728b942 Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:33:04 2022 -0700 drm/ttm: Switch to using the new res callback Apply new intersect and compatible callback instead of having a generic placement range verfications. v2: Added a separate callback for compatiblilty checks (Christian) v3: Cleanups and removal of workarounds Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-6-Arunpravin.PaneerSelvam@amd.com commit 73b984d8722e3ee077a8591b27d8c4d1a2d72020 Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:33:03 2022 -0700 drm/nouveau: Implement intersect/compatible functions Implemented a new intersect and compatible callback function fetching the start offset from struct ttm_resource. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-5-Arunpravin.PaneerSelvam@amd.com commit 92b2b55e68c8cb88588073434ff3e3240e98504c Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:33:02 2022 -0700 drm/i915: Implement intersect/compatible functions Implemented a new intersect and compatible callback function fetching start offset from drm buddy allocator. v3: move the bits that are specific to buddy_man (Matthew) v4: consider the block size /range (Matthew) Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Matthew Auld Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-4-Arunpravin.PaneerSelvam@amd.com commit ded910f368a52b64a3c0eb12da085058b55f61a1 Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:33:01 2022 -0700 drm/amdgpu: Implement intersect/compatible functions Implemented a new intersect and compatible callback function fetching start offset from backend drm buddy allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-3-Arunpravin.PaneerSelvam@amd.com commit 75ba3121acd58b71ee1d2f6e30ab44748d4397de Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:33:00 2022 -0700 drm/ttm: Implement intersect/compatible functions Implemented a new intersect and compatible callback functions to ttm range manager fetching start offset from drm mm range allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-2-Arunpravin.PaneerSelvam@amd.com commit 544432703b2fe73a07f387c0b883da03ffa5671e Author: Arunpravin Paneer Selvam Date: Sat Aug 20 00:32:59 2022 -0700 drm/ttm: Add new callbacks to ttm res mgr We are adding two new callbacks to ttm resource manager function to handle intersection and compatibility of placement and resources. v2: move the amdgpu and ttm_range_manager changes to separate patches (Christian) v3: rename "intersect" to "intersects" (Matthew) v4: move !place check to the !res if and return false in ttm_resource_compatible() function (Christian) v5: move bits of code from patch number 6 to avoid temporary driver breakup (Christian) Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-1-Arunpravin.PaneerSelvam@amd.com commit 1202cdd665315c525b5237e96e0bedc76d7e754f Author: Stephen Hemminger Date: Wed Aug 17 17:43:21 2022 -0700 Remove DECnet support from kernel DECnet is an obsolete network protocol that receives more attention from kernel janitors than users. It belongs in computer protocol history museum not in Linux kernel. It has been "Orphaned" in kernel since 2010. The iproute2 support for DECnet was dropped in 5.0 release. The documentation link on Sourceforge says it is abandoned there as well. Leave the UAPI alone to keep userspace programs compiling. This means that there is still an empty neighbour table for AF_DECNET. The table of /proc/sys/net entries was updated to match current directories and reformatted to be alphabetical. Signed-off-by: Stephen Hemminger Acked-by: David Ahern Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 1d895be13af0d962bef67ba0ceaefbdc6954fe67 Author: Mika Westerberg Date: Tue Aug 16 15:55:37 2022 +0300 spi: intel: 64k erase is supported from Canon Lake and beyond The hardware sequencer in Intel Canon Lake and beyond supports also 64k erase command. The SPI-NOR core uses SFDP (Serial Flash Discovery Parameter) to figure out what the chip actually supports and only issues 64k erase if it is supported. Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20220816125537.89389-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown commit 3f03c618bebb024bf8770a74480a9416c847ce53 Author: Mika Westerberg Date: Tue Aug 16 16:08:18 2022 +0300 spi: intel: Add support for second flash chip Intel SPI flash controller has been supporting two chip selects long time already even if the most common configuration is to have a single flash chip for the BIOS and related data. This adds support for the second chip select if we find out that there are two flash components (this information is available in the mandatory flash descriptor on the first chip). The second chip is exposed as is without any partition information. Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20220816130818.89600-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown commit 0739ce4c1213a040301bb185cb7a0569417aef87 Author: Christian Kohlschütter Date: Sat Aug 20 13:14:21 2022 +0000 regulator: core: Remove "ramp_delay not set" debug message This message shows up occasionally but in bursts (seen up to 30 times per second on my ODROID N2+). According to Matthias Kaehlcke's comment in 'regulator: core: silence warning: "VDD1: ramp_delay not set"', this message should have been removed after restructuring previous code that assumed that ramp_delay being zero in that function was an error. Link: https://lore.kernel.org/lkml/625675256c0d75805f088b4be17a3308dc1b7ea4.1477571498.git.hns@goldelico.com/T/ Signed-off-by: Christian Kohlschütter Link: https://lore.kernel.org/r/20220820131420.16608-1-christian@kohlschutter.com Signed-off-by: Mark Brown commit f8f60615379c1b36d9220f3886fb9b229e95d8cd Author: Linus Walleij Date: Thu Aug 18 14:12:27 2022 +0200 regmap/hexagon: Properly fix the generic IO helpers I was too naive in just including into hexagon: one has to specify defines for every call that uses a (static) inline or this will not work. Fix it up by providing proper defines for all shorthands that hexagon provides. Compile-tested with hexagon LLVM which is the only working cross compiler for hexagon ATM after commenting out the -fno-inline-functions-called-once switch which isn't working with LLVM. Cc: Brian Cain Cc: linux-hexagon@vger.kernel.org Cc: Arnd Bergmann Fixes: 81c0386c1376 ("regmap: mmio: Support accelerared noinc operations") Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220818121227.151016-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit 94f072748337424c9cf92cd018532a34db3a5516 Author: Jonathan Cameron Date: Sun Aug 21 17:09:14 2022 +0100 ASoC: samsung: Use iio_get_channel_type() accessor. struct iio_chan_spec is meant to be opaque to IIO consumer drivers which should only use the interfaces in linux/iio/consumer.h. Use the provided accessor function to find get the type of the channel instead of directly reading it form the structure. Signed-off-by: Jonathan Cameron Cc: Krzysztof Kozlowski Cc: Sylwester Nawrocki Link: https://lore.kernel.org/r/20220821160914.2207116-1-jic23@kernel.org Signed-off-by: Mark Brown commit 4d45d944e885e1bf4341a8cbb9b69584477880e3 Author: Kuninori Morimoto Date: Mon Aug 22 02:46:25 2022 +0000 ASoC: soc-pcm.c: summarize related settings at soc_new_pcm() soc_new_pcm() sets pcm->no_device_suspend, but it sets other pcm->xxx at the same function with different timing. pcm->no_device_suspend setup timing has no effect. This patch tidyup it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87bksdgflq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b455dbd9c581c511f4ae24113fb6c350231bf274 Merge: e46c5b8e4307d e09ce97778e84 Author: David S. Miller Date: Mon Aug 22 14:00:54 2022 +0100 Merge branch 'lan966x-lag-support' Horatiu Vultur says: ==================== net: lan966x: Add lag support Add lag support for lan966x. First 4 patches don't do any changes to the current behaviour, they just prepare for lag support. While the rest is to add the lag support. v3->v4: - aggregation configuration is global for all bonds, so make sure that there can't be enabled multiple configurations at the same time - return error faster from lan966x_foreign_bridging_check, don't continue the search if the error is seen already - flush fdb workqueue when a port leaves a bridge or lag. v2->v3: - return error code from 'switchdev_bridge_port_offload()' - fix lan966x_foreign_dev_check(), it was missing lag support - remove lan966x_lag_mac_add_entry and lan966x_mac_del_entry as they are not needed - fix race conditions when accessing port->bond - move FDB entries when a new port joins the lag if it has a lower v1->v2: - fix the LAG PGIDs when ports go down, in this way is not needed anymore the last patch of the series. ==================== Signed-off-by: David S. Miller commit e09ce97778e849d65f97bf877f7708952720cbac Author: Horatiu Vultur Date: Wed Aug 17 21:34:49 2022 +0200 net: lan966x: Extend MAC to support also lag interfaces. Extend MAC support to support also lag interfaces: 1. In case an entry is learned on a port that is part of lag interface, then notify the upper layers that the entry is learned on the bond interface 2. If a port leaves the bond and the port is the first port in the lag group, then it is required to update all MAC entries to change the destination port. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 9be99f2d1d285eeee4033c173ced4a08e2ed5edd Author: Horatiu Vultur Date: Wed Aug 17 21:34:48 2022 +0200 net: lan966x: Extend FDB to support also lag Offload FDB entries when the original device is a lag interface. Because all the ports under the lag have the same chip id, which is the chip id of first port, then add the entries only for the first port. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit cabc9d49333df72fe0f6d58bdcf9057ba341e701 Author: Horatiu Vultur Date: Wed Aug 17 21:34:47 2022 +0200 net: lan966x: Add lag support for lan966x Add link aggregation hardware offload support for lan966x Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit a751ea4d74e9170da0ec52286644b190a8364571 Author: Horatiu Vultur Date: Wed Aug 17 21:34:46 2022 +0200 net: lan966x: Extend lan966x_foreign_bridging_check Extend lan966x_foreign_bridging_check to check also if the upper interface is a lag device. Don't allow a lan966x port to be part of a lag if it has foreign interfaces. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit d6208adfc9a9acbf76a6ee74eb3dad52eab33369 Author: Horatiu Vultur Date: Wed Aug 17 21:34:45 2022 +0200 net: lan966x: Expose lan966x_switchdev_nb and lan966x_switchdev_blocking_nb Expose lan966x_switchdev_nb and lan966x_switchdev_blocking_nb to the lan966x_main.h file because they will be needed by the lag driver. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 86bac7f11788c780db2ccbe87712c0c71a64b510 Author: Horatiu Vultur Date: Wed Aug 17 21:34:44 2022 +0200 net: lan966x: Flush fdb workqueue when port is leaving a bridge. Whenever a port leaves a bridge, flush the workqueue of the FDB work. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 9b4ed7d262f3ea3b01c8dcbfff8fdf7f08ce3d75 Author: Horatiu Vultur Date: Wed Aug 17 21:34:43 2022 +0200 net: lan966x: Split lan966x_fdb_event_work Split the function lan966x_fdb_event_work. One case for when the orig_dev is a bridge and one case when orig_dev is lan966x port. This is preparation for lag support. There is no functional change. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 7c300735a1a1283fc30931ab9d981d0e718945d1 Author: Horatiu Vultur Date: Wed Aug 17 21:34:42 2022 +0200 net: lan966x: Add registers used to configure lag interfaces Add the registers used by lan966x to configure the lag interface. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit e46c5b8e4307da11259b5e3bce0c99ff184b2edd Merge: c21ab2afa2c64 d113efb19fea4 Author: David S. Miller Date: Mon Aug 22 13:56:37 2022 +0100 Merge branch 'tsnep-minor-improvements' Gerhard Engleder says: ==================== tsnep: Various minor driver improvements During XDP development some general driver improvements has been done which I want to keep out of future patch series. ==================== Signed-off-by: David S. Miller commit d113efb19fea48ab1738a3a4f89309cd82a841fa Author: Gerhard Engleder Date: Wed Aug 17 21:30:17 2022 +0200 tsnep: Record RX queue Other drivers record RX queue so it should make sense to do that also. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 17531519cab6afa123a6dbfc2ff9b2365e8575da Author: Gerhard Engleder Date: Wed Aug 17 21:30:16 2022 +0200 tsnep: Support full DMA mask DMA addresses up to 64bit are supported by the device. Configure DMA mask according to the capabilities of the device. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit b99ac75117c25977088ec41185ad1714f531438b Author: Gerhard Engleder Date: Wed Aug 17 21:30:15 2022 +0200 tsnep: Improve TX length handling TX length can by calculated more efficient during map and unmap of fragments. Another reason is that, by moving TX statistic counting to tsnep_tx_poll() it can be used there for XDP too. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 4b2220089db33f48524bdfc73dcac4e508c99f56 Author: Gerhard Engleder Date: Wed Aug 17 21:30:14 2022 +0200 tsnep: Add loopback support Add support for NETIF_F_LOOPBACK feature. Loopback mode is used for testing. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 7d8dd6b5cd1d67dd96c132f91d7ad29c49ed3c59 Author: Gerhard Engleder Date: Wed Aug 17 21:30:13 2022 +0200 tsnep: Fix TSNEP_INFO_TX_TIME register define Fixed register define is not used, but register definition shall be kept in sync. Fixes: 403f69bbdbad ("tsnep: Add TSN endpoint Ethernet MAC driver") Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit c21ab2afa2c64896a7f0e3cbc6845ec63dcfad2e Author: Mike Pattrick Date: Wed Aug 17 11:06:35 2022 -0400 openvswitch: Fix overreporting of drops in dropwatch Currently queue_userspace_packet will call kfree_skb for all frames, whether or not an error occurred. This can result in a single dropped frame being reported as multiple drops in dropwatch. This functions caller may also call kfree_skb in case of an error. This patch will consume the skbs instead and allow caller's to use kfree_skb. Signed-off-by: Mike Pattrick Link: https://bugzilla.redhat.com/show_bug.cgi?id=2109957 Signed-off-by: David S. Miller commit 1100248a5c5ccd57059eb8d02ec077e839a23826 Author: Mike Pattrick Date: Wed Aug 17 11:06:34 2022 -0400 openvswitch: Fix double reporting of drops in dropwatch Frames sent to userspace can be reported as dropped in ovs_dp_process_packet, however, if they are dropped in the netlink code then netlink_attachskb will report the same frame as dropped. This patch checks for error codes which indicate that the frame has already been freed. Signed-off-by: Mike Pattrick Link: https://bugzilla.redhat.com/show_bug.cgi?id=2109946 Signed-off-by: David S. Miller commit 5b247d938feaa04e05ac24c2241448fad9132e26 Merge: d04807b80691c ac0167fb9961e Author: David S. Miller Date: Mon Aug 22 13:46:26 2022 +0100 Merge branch 'net-phy-QUSGMII' Maxime Chevallier says: ==================== net: Introduce QUSGMII phy mode Re-sending, since the previous v4 was sent while net-next was closed. This is a resend of the V4 of a previous series [1] initially aimed at introducing inband extensions, with modes like QUSGMII. This mode allows passing info in the ethernet preamble between the MAC and the PHY, such as timestamps. This series has now become a preliminary series, that simply introduces the new interface mode, without support for inband extensions, that will come later. The reasonning is that work will need to be done in the networking subsystem, but also in the generic phy driver subsystem to allow serdes configuration for qusgmii. This series add the mode, the relevant binding changes, adds support for it in the lan966x driver, and also introduces a small helper to get the number of links a given phy mode can carry (think 1 for SGMII and 4 for QSGMII). This allows for better readability and will prove useful when (if) we support PSGMII (5 links on 1 interface) and OUSGMII (8 links on one interface). V4 contains no change but the collected Reviewed-by from Andrew. ==================== Signed-off-by: David S. Miller commit ac0167fb9961ea929e17fad2d703cc1a14dfb7a9 Author: Maxime Chevallier Date: Wed Aug 17 14:32:55 2022 +0200 net: lan966x: Add QUSGMII support for lan966x The Lan996x controller supports the QUSGMII mode, which is very similar to QSGMII in the way it's configured and the autonegociation capababilities it provides. This commit adds support for that mode, treating it most of the time like QSGMII, making sure that we do configure the PCS how we should. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit c04ade27cb7b952b6b9b9a0efa0a6129cc63f2ae Author: Maxime Chevallier Date: Wed Aug 17 14:32:54 2022 +0200 net: phy: Add helper to derive the number of ports from a phy mode Some phy modes such as QSGMII multiplex several MAC<->PHY links on one single physical interface. QSGMII used to be the only one supported, but other modes such as QUSGMII also carry multiple links. This helper allows getting the number of links that are multiplexed on a given interface. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0932b12a7496fd3f9f4bd9c7de2c19a8ec9a01e9 Author: Maxime Chevallier Date: Wed Aug 17 14:32:53 2022 +0200 dt-bindings: net: ethernet-controller: add QUSGMII mode Add a new QUSGMII mode, standing for "Quad Universal Serial Gigabit Media Independent Interface", a derivative of USGMII which, similarly to QSGMII, allows to multiplex 4 1Gbps links to a Quad-PHY. The main difference with QSGMII is that QUSGMII can include an extension instead of the standard 7bytes ethernet preamble, allowing to convey arbitrary data such as Timestamps. Signed-off-by: Maxime Chevallier Acked-by: Rob Herring Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5e61fe157a27afc7c0d4f7bcbceefdca536c015f Author: Maxime Chevallier Date: Wed Aug 17 14:32:52 2022 +0200 net: phy: Introduce QUSGMII PHY mode The QUSGMII mode is a derivative of Cisco's USXGMII standard. This standard is pretty similar to SGMII, but allows for faster speeds, and has the build-in bits for Quad and Octa variants (like QSGMII). The main difference with SGMII/QSGMII is that USXGMII/QUSGMII re-uses the preamble to carry various information, named 'Extensions'. As of today, the USXGMII standard only mentions the "PCH" extension, which is used to convey timestamps, allowing in-band signaling of PTP timestamps without having to modify the frame itself. This commit adds support for that mode. When no extension is in use, it behaves exactly like QSGMII, although it's not compatible with QSGMII. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d04807b80691c6041ca8e3dcf1870d1bf1082c22 Author: Ravi Gunasekaran Date: Wed Aug 17 15:14:06 2022 +0530 net: ethernet: ti: davinci_mdio: Add workaround for errata i2329 On the CPSW and ICSS peripherals, there is a possibility that the MDIO interface returns corrupt data on MDIO reads or writes incorrect data on MDIO writes. There is also a possibility for the MDIO interface to become unavailable until the next peripheral reset. The workaround is to configure the MDIO in manual mode and disable the MDIO state machine and emulate the MDIO protocol by reading and writing appropriate fields in MDIO_MANUAL_IF_REG register of the MDIO controller to manipulate the MDIO clock and data pins. More details about the errata i2329 and the workaround is available in: https://www.ti.com/lit/er/sprz487a/sprz487a.pdf Add implementation to disable MDIO state machine, configure MDIO in manual mode and achieve MDIO read and writes via MDIO Bitbanging Signed-off-by: Ravi Gunasekaran Reported-by: kernel test robot Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit bb726b753f75a4eeda291438f89dfd9b94783569 Author: Clark Wang Date: Wed Aug 17 09:36:18 2022 +0800 net: phy: realtek: add support for RTL8211F(D)(I)-VD-CG RTL8211F(D)(I)-VD-CG is the pin-to-pin upgrade chip from RTL8211F(D)(I)-CG. Add new PHY ID for this chip. It does not support RTL8211F_PHYCR2 anymore, so remove the w/r operation of this register. Signed-off-by: Clark Wang Signed-off-by: Wei Fang Signed-off-by: David S. Miller commit 27586b851bae62296b77687a58a8c92ab84d5274 Author: Rob Herring Date: Wed Aug 10 10:16:34 2022 -0600 dt-bindings: pinctrl: aspeed: Add missing properties to examples The aspeed pinctrl parent node (SCU) in the examples is missing various properties. Add the properties in preparation for the SCU schema. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220810161635.73936-2-robh@kernel.org Signed-off-by: Linus Walleij commit b01104fc62b6194c852124f6c6df1c0a5c031fc1 Author: Conner Knox Date: Thu Aug 18 17:14:33 2022 -0300 ALSA: usb-audio: Add quirk to enable Avid Mbox 3 support Add support for Avid Mbox3 USB audio interface at 48kHz Signed-off-by: Conner Knox Link: https://lore.kernel.org/r/20220818201433.16360-1-mbarriolinares@gmail.com Signed-off-by: Takashi Iwai commit de43708924438fac2b0c04b099d50e3b523a5817 Author: Kirill Tkhai Date: Wed Aug 17 00:51:54 2022 +0300 af_unix: Show number of inflight fds for sockets in TCP_LISTEN state too TCP_LISTEN sockets is a special case. They preserve skb with a newly connected sock till accept() makes it fully functional socket. Receive queue of such socket may grow after connected peer send messages there. Since these messages may contain scm_fds, we should expose correct fdinfo::scm_fds for listening socket too. Signed-off-by: Kirill Tkhai Signed-off-by: David S. Miller commit 48bc9d5245a43486559935da5439700ce4fe4a3e Author: Vandita Kulkarni Date: Wed Aug 17 15:45:16 2022 +0300 drm/i915/dsc/mtl: Enable alternate ICH method DSC 1.2 is supported from MTL, hence program ICH accordingly. Cc: Ankit Nautiyal Signed-off-by: Vandita Kulkarni Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817124516.284456-2-jani.nikula@intel.com commit 20052deeb558e34e04655076a3b3403c3d289912 Author: Vandita Kulkarni Date: Wed Aug 17 15:45:15 2022 +0300 drm/i915/dsc/mtl: Update the DSC minor version From MTL onwards we support DSC 1.2, since there is hardcoding to minor version 1, update it. Cc: Ankit Nautiyal Signed-off-by: Vandita Kulkarni Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817124516.284456-1-jani.nikula@intel.com commit 32249fd8c8cccd7a1ed86c3b6d9b6ae9b4a83623 Author: Mika Westerberg Date: Tue Jun 29 13:32:29 2021 -0700 thunderbolt: Add support for Intel Meteor Lake Intel Meteor Lake has the same integrated Thunderbolt/USB4 controller as Intel Alder Lake. Add the Intel Meteor Lake PCI IDs to the driver list of supported devices. Signed-off-by: Mika Westerberg commit 1c1aac98620d69c27a979972b712f008e9e02ef6 Author: Mika Westerberg Date: Wed May 11 14:11:23 2022 +0300 thunderbolt: Add comment where Thunderbolt 4 PCI IDs start This makes it consistent with the previous generations. No functional impact. Signed-off-by: Mika Westerberg commit 4234ea30051200fc6016de10e4d58369e60b38f1 Author: Arun R Murthy Date: Mon Aug 8 09:27:50 2022 +0530 drm/i915/display: avoid warnings when registering dual panel backlight Commit 20f85ef89d94 ("drm/i915/backlight: use unique backlight device names") added support for multiple backlight devices on dual panel systems, but did so with error handling on -EEXIST from backlight_device_register(). Unfortunately, that triggered a warning in dmesg all the way down from sysfs_add_file_mode_ns() and sysfs_warn_dup(). Instead of optimistically always attempting to register with the default name ("intel_backlight", which we have to retain for backward compatibility), check if a backlight device with the name exists first, and, if so, use the card and connector based name. v2: reworked on top of the patch commit 20f85ef89d94 ("drm/i915/backlight: use unique backlight device names") v3: fixed the ref count leak(Jani N) Fixes: 20f85ef89d94 ("drm/i915/backlight: use unique backlight device names") Signed-off-by: Arun R Murthy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220808035750.3111046-1-arun.r.murthy@intel.com commit 599e465d11a5621063bc5db2d222081716dc3403 Author: Pali Rohár Date: Fri Aug 5 14:22:02 2022 +0200 pinctrl: armada-37xx: Remove unused macro PIN_GRP() Macro PIN_GRP() is not used, remove it. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220805122202.23174-4-pali@kernel.org Signed-off-by: Linus Walleij commit 6b262b32faf0abf74062e2e2b72cbbea4572b9f3 Author: Pali Rohár Date: Fri Aug 5 14:22:01 2022 +0200 pinctrl: armada-37xx: Checks for errors in gpio_request_enable callback Now when all MPP pins are properly defined and every MPP pin has GPIO function, always checks for errors in armada_37xx_gpio_request_enable() function when calling armada_37xx_pmx_set_by_name(). Function armada_37xx_pmx_set_by_name() should not return "not supported" error anymore for any GPIO pin when requesting GPIO mode. Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx") Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220805122202.23174-3-pali@kernel.org Signed-off-by: Linus Walleij commit 2fa9933d685ee9bcab056c81ef5f7fa242ba90e3 Author: Pali Rohár Date: Fri Aug 5 14:22:00 2022 +0200 pinctrl: armada-37xx: Fix definitions for MPP pins 20-22 All 3 MPP pins (20, 21 and 22) can be configured individually and also can be configured to GPIO functions. Fix definitions for these MPP pins in existing pin groups. After this change GPIO function can be enabled just for one of these 3 pins. Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx") Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220805122202.23174-2-pali@kernel.org Signed-off-by: Linus Walleij commit 0ca6e30e4dd1d97416a7febcc8bf06f72e19f063 Author: Pali Rohár Date: Fri Aug 5 14:21:59 2022 +0200 pinctrl: armada-37xx: Add missing GPIO-only pins gpio1_5 and gpio2_2 are GPIO-only pins. Add them into MPP groups table so they are properly exported as valid pin numbers. Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx") Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220805122202.23174-1-pali@kernel.org Signed-off-by: Linus Walleij commit fd4ea48688c662593eb64ddf44d4a17173661672 Author: Jagan Teki Date: Thu Aug 18 18:11:20 2022 +0530 pinctrl: rockchip: Add RV1126 pinctrl support RV1126 has five GPIOs groups - GPIO0 in PD_MMU and GPIO1-4 in PD_BUS. In GPIO0, up to Lower C group GPIO0_C[3:0] is part of PMU but rest of the groups from there are part of GRF. Added pinctrl support for RV1126 and the pull, drv and schmitt calculations are inferred from [1] authored by Jianqun Xu. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/pinctrl/pinctrl-rockchip.c Cc: linux-gpio@vger.kernel.org Cc: Linus Walleij Signed-off-by: Jianqun Xu Signed-off-by: Sugar Zhang Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-8-jagan@edgeble.ai Signed-off-by: Linus Walleij commit 2dce502761a2dec7dc84c03872fba5c7af110290 Author: Jagan Teki Date: Thu Aug 18 18:11:19 2022 +0530 dt-bindings: pinctrl: rockchip: Document RV1126 pinctrl Document dt-bindings for RV1126 SoC pinctrl support. Cc: linux-gpio@vger.kernel.org Cc: Linus Walleij Acked-by: Krzysztof Kozlowski Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20220818124132.125304-7-jagan@edgeble.ai Signed-off-by: Linus Walleij commit 57746e993442b9e143a262623e1da6c908d782e3 Author: Biju Das Date: Thu Aug 4 09:26:05 2022 +0100 clk: renesas: r9a07g044: Add conditional compilation for r9a07g044_cpg_info Add conditional compilation for struct r9a07g044_cpg_info, so the compiler won't allocate any memory for this variable in case CONFIG_CLK_R9A07G044 is disabled. Reported-by: Pavel Machek Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220804082605.157269-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1e56ebc9872feb2cf9a002c0a23d79a68f6493cb Author: Wolfram Sang Date: Tue Jul 26 23:01:08 2022 +0200 clk: renesas: r8a779f0: Add TMU and parent SASYNC clocks Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220726210110.1444-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 73ca80daf7b37b260f01cc4ce7963f48d8b5183f Author: Phil Edworthy Date: Thu Aug 4 20:08:46 2022 +0100 arm64: dts: renesas: r9a09g011: Add pinctrl node Signed-off-by: Phil Edworthy Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220804190846.128370-1-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 72a482dbaec4b9e4d54b81be6bdb8c016fd2f4bd Author: Biju Das Date: Tue Aug 2 11:15:34 2022 +0100 arm64: dts: renesas: r9a07g043: Fix SCI{Rx,Tx} interrupt types As per the RZ/G2UL Hardware User's Manual (Rev.1.00 Apr, 2022), the interrupt type of SCI{Rx,Tx} is edge triggered. Signed-off-by: Biju Das Fixes: cf40c9689e5109bf ("arm64: dts: renesas: Add initial DTSI for RZ/G2UL SoC") Link: https://lore.kernel.org/r/20220802101534.1401342-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 13dec051c7f139eef345c55a60941843e72128f1 Author: Biju Das Date: Tue Aug 2 11:15:33 2022 +0100 arm64: dts: renesas: r9a07g054: Fix SCI{Rx,Tx} interrupt types As per the RZ/V2L Hardware User's Manual (Rev.1.00 Nov, 2021), the interrupt type of SCI{Rx,Tx} is edge triggered. Signed-off-by: Biju Das Fixes: 7c2b8198f4f321df ("arm64: dts: renesas: Add initial DTSI for RZ/V2L SoC") Link: https://lore.kernel.org/r/20220802101534.1401342-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f3b7bc89c97b98aa6f157d5f296695af8940a5ac Author: Biju Das Date: Tue Aug 2 11:15:32 2022 +0100 arm64: dts: renesas: r9a07g044: Fix SCI{Rx,Tx} interrupt types As per the latest RZ/G2L Hardware User's Manual (Rev.1.10 Apr, 2022), the interrupt type of SCI{Rx,Tx} is edge triggered. Signed-off-by: Biju Das Fixes: f9a2adcc9e908907 ("arm64: dts: renesas: r9a07g044: Add SCI[0-1] nodes") Link: https://lore.kernel.org/r/20220802101534.1401342-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 56f0a373f0a8f9e4a783aa600c11f00ca33398e5 Author: Biju Das Date: Fri Jul 29 09:45:27 2022 +0100 arm64: dts: renesas: r9a07g043: Fix audio clk node names Replace the clk node names audio-clk{1,2} with audio{1,2}-clk as per the device tree specification. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220729084527.388023-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 34fac90f361f14aad0d0bfeabba9211fd584a963 Author: Biju Das Date: Thu Jul 28 13:23:12 2022 +0100 arm64: dts: renesas: r9a07g054: Add DMA support to RSPI Add DMA properties to RSPI nodes to support DMA operation. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220728122312.189766-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a43026b811700455f36bc788e480921f7d1d3e95 Author: Biju Das Date: Thu Jul 28 13:23:11 2022 +0100 arm64: dts: renesas: r9a07g044: Add DMA support to RSPI Add DMA properties to RSPI nodes to support DMA operation. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220728122312.189766-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 200d8e0119fd8fef78fa1c6441ef9eb2c1570984 Author: Biju Das Date: Thu Jul 28 13:23:10 2022 +0100 arm64: dts: renesas: r9a07g043: Add DMA support to RSPI Add DMA properties to RSPI nodes to support DMA operation. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220728122312.189766-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7adc69f8ac35109eab2742e6bb7a747dd811d1f6 Author: Wolfram Sang Date: Tue Jul 26 23:01:09 2022 +0200 arm64: dts: renesas: r8a779f0: Add TMU nodes Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220726210110.1444-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 8a07b45fd3c2dda24fad43639be5335a4595196a Author: Dan Carpenter Date: Fri Aug 19 08:20:36 2022 +0300 platform/chrome: fix memory corruption in ioctl If "s_mem.bytes" is larger than the buffer size it leads to memory corruption. Fixes: eda2e30c6684 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC") Signed-off-by: Dan Carpenter Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/Yv8dpCFZJdbUT5ye@kili commit 6ad4194d6a1e1d11b285989cd648ef695b4a93c0 Author: Rustam Subkhankulov Date: Sun Aug 14 01:08:43 2022 +0300 platform/chrome: fix double-free in chromeos_laptop_prepare() If chromeos_laptop_prepare_i2c_peripherals() fails after allocating memory for 'cros_laptop->i2c_peripherals', this memory is freed at 'err_out' label and nonzero value is returned. Then chromeos_laptop_destroy() is called, resulting in double-free error. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rustam Subkhankulov Fixes: 5020cd29d8bf ("platform/chrome: chromeos_laptop - supply properties for ACPI devices") Reviewed-by: Dmitry Torokhov Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220813220843.2373004-1-subkhankulov@ispras.ru commit 8a8f7866663588b162031a5348c24e42161461cd Author: Christophe Leroy Date: Thu Aug 18 19:31:25 2022 +0200 powerpc/vdso: Don't map VDSO at a fixed address on PPC32 PPC64 removed default mapping address from VDSO in commit 30d0b3682887 ("powerpc: Move 64bit VDSO to improve context switch performance"). Do like PPC64 and let get_unmapped_area() place the VDSO mapping at the address it wants, don't force a default address. This allows randomisation of VDSO address. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/cba76f5a5b01fcc49415e632d92c11c1c5998cab.1660843877.git.christophe.leroy@csgroup.eu commit c814bf958926ff45a9c1e899bd001006ab6cfbae Author: ye xingchen Date: Tue Aug 16 10:51:06 2022 +0000 powerpc/selftests: Use timersub() for gettimeofday() Use timersub() function to simplify the code. Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220816105106.82666-1-ye.xingchen@zte.com.cn commit 0a58d2ae572adaec8d046f8d35b40c2c32ac7468 Author: Javier Martinez Canillas Date: Tue Aug 16 15:46:12 2022 +0200 drm/msm: Make .remove and .shutdown HW shutdown consistent Drivers' .remove and .shutdown callbacks are executed on different code paths. The former is called when a device is removed from the bus, while the latter is called at system shutdown time to quiesce the device. This means that some overlap exists between the two, because both have to take care of properly shutting down the hardware. But currently the logic used in these two callbacks isn't consistent in msm drivers, which could lead to kernel panic. For example, on .remove the component is deleted and its .unbind callback leads to the hardware being shutdown but only if the DRM device has been marked as registered. That check doesn't exist in the .shutdown logic and this can lead to the driver calling drm_atomic_helper_shutdown() for a DRM device that hasn't been properly initialized. A situation like this can happen if drivers for expected sub-devices fail to probe, since the .bind callback will never be executed. If that is the case, drm_atomic_helper_shutdown() will attempt to take mutexes that are only initialized if drm_mode_config_init() is called during a device bind. This bug was attempted to be fixed in commit 623f279c7781 ("drm/msm: fix shutdown hook in case GPU components failed to bind"), but unfortunately it still happens in some cases as the one mentioned above, i.e: systemd-shutdown[1]: Powering off. kvm: exiting hardware virtualization platform wifi-firmware.0: Removing from iommu group 12 platform video-firmware.0: Removing from iommu group 10 ------------[ cut here ]------------ WARNING: CPU: 6 PID: 1 at drivers/gpu/drm/drm_modeset_lock.c:317 drm_modeset_lock_all_ctx+0x3c4/0x3d0 ... Hardware name: Google CoachZ (rev3+) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_modeset_lock_all_ctx+0x3c4/0x3d0 lr : drm_modeset_lock_all_ctx+0x48/0x3d0 sp : ffff80000805bb80 x29: ffff80000805bb80 x28: ffff327c00128000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000001 x24: ffffc95d820ec030 x23: ffff327c00bbd090 x22: ffffc95d8215eca0 x21: ffff327c039c5800 x20: ffff327c039c5988 x19: ffff80000805bbe8 x18: 0000000000000034 x17: 000000040044ffff x16: ffffc95d80cac920 x15: 0000000000000000 x14: 0000000000000315 x13: 0000000000000315 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff80000805bc28 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff327c00128000 x1 : 0000000000000000 x0 : ffff327c039c59b0 Call trace: drm_modeset_lock_all_ctx+0x3c4/0x3d0 drm_atomic_helper_shutdown+0x70/0x134 msm_drv_shutdown+0x30/0x40 platform_shutdown+0x28/0x40 device_shutdown+0x148/0x350 kernel_power_off+0x38/0x80 __do_sys_reboot+0x288/0x2c0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x2c/0xc0 el0_svc+0x2c/0x84 el0t_64_sync_handler+0x11c/0x150 el0t_64_sync+0x18c/0x190 ---[ end trace 0000000000000000 ]--- Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=000000010eab1000 [0000000000000018] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP ... Hardware name: Google CoachZ (rev3+) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ww_mutex_lock+0x28/0x32c lr : drm_modeset_lock_all_ctx+0x1b0/0x3d0 sp : ffff80000805bb50 x29: ffff80000805bb50 x28: ffff327c00128000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000001 x24: 0000000000000018 x23: ffff80000805bc10 x22: ffff327c039c5ad8 x21: ffff327c039c5800 x20: ffff80000805bbe8 x19: 0000000000000018 x18: 0000000000000034 x17: 000000040044ffff x16: ffffc95d80cac920 x15: 0000000000000000 x14: 0000000000000315 x13: 0000000000000315 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff80000805bc28 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff327c00128000 x1 : 0000000000000000 x0 : 0000000000000018 Call trace: ww_mutex_lock+0x28/0x32c drm_modeset_lock_all_ctx+0x1b0/0x3d0 drm_atomic_helper_shutdown+0x70/0x134 msm_drv_shutdown+0x30/0x40 platform_shutdown+0x28/0x40 device_shutdown+0x148/0x350 kernel_power_off+0x38/0x80 __do_sys_reboot+0x288/0x2c0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x2c/0xc0 el0_svc+0x2c/0x84 el0t_64_sync_handler+0x11c/0x150 el0t_64_sync+0x18c/0x190 Code: aa0103f4 d503201f d2800001 aa0103e3 (c8e37c02) ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Kernel Offset: 0x495d77c00000 from 0xffff800008000000 PHYS_OFFSET: 0xffffcd8500000000 CPU features: 0x800,00c2a015,19801c82 Memory Limit: none ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--- Fixes: 9d5cbf5fe46e ("drm/msm: add shutdown support for display platform_driver") Signed-off-by: Javier Martinez Canillas Reviewed-by: Abhinav Kumar Link: https://patchwork.freedesktop.org/patch/msgid/20220816134612.916527-1-javierm@redhat.com commit 3591be2e8a81efbf5ec6d3d68067a90225897c3e Author: Christoph Niedermaier Date: Tue Aug 16 14:41:33 2022 +0200 ARM: dts: imx6qdl-dhcom: Move IPU iomux node from PDK2 to SoM file The SoM itself provides the display interface, see [1] page 20. Those pins have to be used as the RGB/DPI interface or not used at all. So rather than duplicate the pinmux settings in every carrier board DT, better move them into the SoM DTSI. [1] https://wiki.dh-electronics.com/images/2/2e/DOC_DHCOM-Standard-Specification_R01_2016-11-17.pdf Signed-off-by: Christoph Niedermaier Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 7e4bf4d8debc51810cc3ed2c0d3f0c21d2c41dd5 Author: Frieder Schrempf Date: Mon Aug 15 10:28:12 2022 +0200 ARM: dts: imx6ul-kontron: Add imx6ull-kontron-bl to Makefile The imx6ull-kontron-bl.dtb wasn't build as part of the CONFIG_SOC_IMX6UL option. Add it to the list. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 0fcf85d89de30ad2d9d9836376aacaf329d1b022 Author: Frieder Schrempf Date: Mon Aug 15 10:28:11 2022 +0200 ARM: dts: imx6ul-kontron: Simplify devicetree structure There is no need in differentiating between the different SoM versions that only differ in memory size, etc. It's much cleaner to simplify the devicetrees and let them be more generic. If necessary the bootloader will update the devicetree dynamically to contain the correct size of the memory. We also get rid of the N6xxx notation in the compatibles and file names, as they are not really used anymore and often result in confusion. This is a breaking change, but the impact shouldn't be too big and it makes usage and maintenance easier in the future. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit b709c5a39e7ea3495d5524c9b57eb86f4b4ae255 Author: Krzysztof Kozlowski Date: Wed Aug 10 14:10:53 2022 +0300 ARM: dts: vf610: align SPI node name with dtschema The node names should be generic and DT schema expects certain pattern. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit e067767e450f6f2d9aeb9825df655430f83d79dc Author: Krzysztof Kozlowski Date: Wed Aug 10 14:10:08 2022 +0300 ARM: dts: imx: align gpio-keys node names with dtschema The node names should be generic and DT schema expects certain pattern. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 1bad8bca9020472553a4db6bf9e1ee149fe97f03 Author: Krzysztof Kozlowski Date: Wed Aug 10 14:10:07 2022 +0300 ARM: dts: imx: align LED node names with dtschema The node names should be generic and DT schema expects certain pattern. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 34caa12608b6b1376e5e3f51ac63d0ff7e128704 Author: Krzysztof Kozlowski Date: Wed Aug 10 14:10:06 2022 +0300 ARM: dts: imx: align SPI node name with dtschema The node names should be generic and DT schema expects certain pattern. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit dac772cbd755d5b0ae0242c826d33b089bbd43c1 Author: Philipp Zabel Date: Wed Aug 10 12:34:48 2022 +0200 ARM: dts: imx6qdl-tqma6x: add fixed power supplies Add fixed power supplies to the EEPROM nodes to suppress a warning: at24 2-0050: supply vcc not found, using dummy regulator Signed-off-by: Philipp Zabel Signed-off-by: Shawn Guo commit 467cf8ef88d3124c189e2ff4726fe5247a88fe46 Author: Al Viro Date: Sun Jan 30 21:15:36 2022 -0500 tomoyo: struct path it might get from LSM callers won't have NULL dentry or mnt Acked-by: Tetsuo Handa Signed-off-by: Al Viro commit 89868773fe862eabc049aaa6f6b587177b3f2ea6 Author: Al Viro Date: Sun May 16 16:59:56 2021 -0400 tomoyo: use vsnprintf() properly Idiomatic way to find how much space sprintf output would take is len = snprintf(NULL, 0, ...) + 1; Once upon a time there'd been libc implementations that blew chunks on that and somebody had come up with the following "cute" trick: len = snprintf((char *) &len, 1, ...) + 1; for doing the same. However, that's unidiomatic, harder to follow *and* any such libc implementation would violate both C99 and POSIX (since 2001). IOW, this kludge is best buried along with such libc implementations, nevermind getting cargo-culted into newer code. Our vsnprintf() does not suffer that braindamage, TYVM. Acked-by: Tetsuo Handa Signed-off-by: Al Viro commit 4c95e73647057397e743840612674efbe21eeea4 Author: Kuldeep Singh Date: Mon Aug 8 00:06:45 2022 +0530 ARM: dts: ls1021a: Use generic node name for DMA DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Signed-off-by: Shawn Guo commit afd8f77957e3e83adf21d9229c61ff37f44a177a Author: Lucas Stach Date: Tue Jul 26 15:05:23 2022 +0200 ARM: dts: imx6qdl-kontron-samx6i: hook up DDC i2c bus i2c2 is routed to the pins dedicated as DDC in the module standard. Reduce clock rate to 100kHz to be in line with VESA standard and hook this bus up to the HDMI node. Fixes: 708ed2649ad8 ("ARM: dts: imx6qdl-kontron-samx6i: increase i2c-frequency") Signed-off-by: Lucas Stach [m.felsch@pengutronix.de: add fixes line] Signed-off-by: Marco Felsch Signed-off-by: Shawn Guo commit 5694eed98cca5c164ebb5b831b65b4c9eee4b2d5 Author: Marco Felsch Date: Tue Jul 26 15:05:20 2022 +0200 ARM: dts: imx6qdl-kontron-samx6i: move phy reset into phy-node Add ethernet-phy node so we can drop the deprecated fec phy-reset-gpios property. The reset-assert-us value is taken from the existing logic since the fec driver will add an 1ms assert delay per default if phy-reset-gpios is used and phy-reset-duration is not specified. Signed-off-by: Marco Felsch Signed-off-by: Shawn Guo commit bae57eacc0dbc09dcf64113656e2a913115f5a70 Author: David Jander Date: Tue Jul 26 14:32:21 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Add backlight-isb node On some older hardware models this is needed. It will do no harm if used with newer models though. Signed-off-by: David Jander Signed-off-by: Shawn Guo commit 2c34bb6dea481fa11048e26ffd1ce7400dbc2105 Author: Wolfram Sang Date: Thu Aug 18 23:00:18 2022 +0200 IB: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lore.kernel.org/r/20220818210018.6841-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Signed-off-by: Leon Romanovsky commit dc13fbf79ec8f983fc398cd200ed12973f390957 Author: Michael Margolin Date: Thu Aug 18 17:04:49 2022 +0300 RDMA/efa: Support CQ receive entries with source GID Add a parameter for create CQ admin command to set source address on receive completion descriptors. Report capability for this feature through query device verb. Link: https://lore.kernel.org/r/20220818140449.414-1-mrgolin@amazon.com Reviewed-by: Firas Jahjah Reviewed-by: Yossi Leybovich Signed-off-by: Daniel Kranzdorf Signed-off-by: Michael Margolin Signed-off-by: Leon Romanovsky commit b722d3e63fcc95674bd4dd92bbbfb3bd9de12380 Author: Jack Wang Date: Thu Aug 18 12:53:53 2022 +0200 RDMA/rtrs-clt: Output sg index when warning on Output the sg index, so it's a bit easier for debug. Signed-off-by: Jack Wang Reviewed-by: Aleksei Marov Link: https://lore.kernel.org/r/20220818105355.110344-2-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit c16762b7bf54d37ee441885279c4cd49e412ec5b Author: Santosh Pradhan Date: Thu Aug 18 12:52:40 2022 +0200 RDMA/rtrs-srv: Add event tracing support Add event tracing mechanism for following routines: - send_io_resp_imm() How to use: 1. Load the rtrs_server module 2. cd /sys/kernel/debug/tracing 3. If all the events need to be enabled: echo 1 > events/rtrs_srv/enable 4. OR only speific routine/event needs to be enabled e.g. echo 1 > events/rtrs_srv/send_io_resp_imm/enable 5. cat trace 6. Run some I/O workload which can trigger send_io_resp_imm() Link: https://lore.kernel.org/r/20220818105240.110234-3-haris.iqbal@ionos.com Signed-off-by: Santosh Pradhan Signed-off-by: Jack Wang Signed-off-by: Md Haris Iqbal Signed-off-by: Leon Romanovsky commit 5a93929d9f9a1d82946ddd49e260b6dd1756ad6d Author: Santosh Pradhan Date: Thu Aug 18 12:52:39 2022 +0200 RDMA/rtrs-clt: Add event tracing support Add event tracing mechanism for following routines: - rtrs_clt_reconnect_work() - rtrs_clt_close_conns() - rtrs_rdma_error_recovery() How to use: 1. Load the rtrs_client module 2. cd /sys/kernel/debug/tracing 3. If all the events need to be enabled: echo 1 > events/rtrs_clt/enable 4. OR only speific routine/event needs to be enabled e.g. echo 1 > events/rtrs_clt/rtrs_clt_close_conns/enable 5. cat trace 6. Run some workload which can trigger rtrs_clt_close_conns() Link: https://lore.kernel.org/r/20220818105240.110234-2-haris.iqbal@ionos.com Signed-off-by: Santosh Pradhan Signed-off-by: Jack Wang Signed-off-by: Md Haris Iqbal Signed-off-by: Leon Romanovsky commit e7c4ebe2f9cd68588eb24ba4ed122e696e2d5272 Author: Haibo Chen Date: Mon Jul 25 18:16:22 2022 +0800 ARM: dts: imx7d-sdb: config the max pressure for tsc2046 Use the general touchscreen method to config the max pressure for touch tsc2046(data sheet suggest 8 bit pressure), otherwise, for ABS_PRESSURE, when config the same max and min value, weston will meet the following issue, [17:19:39.183] event1 - ADS7846 Touchscreen: is tagged by udev as: Touchscreen [17:19:39.183] event1 - ADS7846 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE [17:19:39.183] event1 - ADS7846 Touchscreen: was rejected [17:19:39.183] event1 - not using input device '/dev/input/event1' This will then cause the APP weston-touch-calibrator can't list touch devices. root@imx6ul7d:~# weston-touch-calibrator could not load cursor 'dnd-move' could not load cursor 'dnd-copy' could not load cursor 'dnd-none' No devices listed. And accroding to binding Doc, "ti,x-max", "ti,y-max", "ti,pressure-max" belong to the deprecated properties, so remove them. Also for "ti,x-min", "ti,y-min", "ti,x-plate-ohms", the value set in dts equal to the default value in driver, so are redundant, also remove here. Signed-off-by: Haibo Chen Signed-off-by: Shawn Guo commit de8aee649f866d1e441691d6e5b54693585f5827 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:41 2022 +0200 ARM: dts: vf610: don't use multiple blank lines Avoid the following checkpatch warning: arch/arm/boot/dts/vf610.dtsi:5: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 005e2858660645845f51731906d87764bb98ff51 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:40 2022 +0200 ARM: dts: vf610-twr: indent use tabs, no spaces at start of line Avoid the following checkpatch warning: arch/arm/boot/dts/vf610-twr.dts:172: warning: please, no spaces at the start of a line Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 4404c1b7b04c718031dcb709f1a1030a86eda995 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:39 2022 +0200 ARM: dts: vf610: no spaces in indent but tabs Avoid spaces in indent but rather use tabs. Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 64bbac6733c14ea652323b61504a4a7328af9174 Author: Marcel Ziswiler Date: Fri Jul 22 23:54:38 2022 +0200 ARM: dts: imx7d-pico: indent use tabs, no spaces at start of line Avoid the following checkpatch warning: arch/arm/boot/dts/imx7d-pico.dtsi:44: error: code indent should use tabs where possible arch/arm/boot/dts/imx7d-pico.dtsi:44: warning: please, no spaces at the start of a line Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit f9065184ea2783bfa143efca1a11aa46c35003fe Author: Marcel Ziswiler Date: Fri Jul 22 23:54:37 2022 +0200 ARM: dts: imx6qdl-sabre: change to use SPDX identifiers Replace the license text with SPDX identifiers. Avoid the following checkpatch warning: arch/arm/boot/dts/imx6qdl-sabrelite.dtsi:1: warning: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 09b2152047d49bcdec8ec3f00fc73a59978d50bd Author: Marcel Ziswiler Date: Fri Jul 22 23:54:36 2022 +0200 ARM: dts: imx6qdl: phytec: no spaces at start of line, indent use tabs Avoid the following checkpatch warnings: arch/arm/boot/dts/imx6qdl-phytec-mira-peb-av-02.dtsi:67: error: code indent should use tabs where possible arch/arm/boot/dts/imx6qdl-phytec-mira-peb-av-02.dtsi:67: warning: please, no spaces at the start of a line Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e45840c8eb0419d15ca342669aa28dfaf70c01cc Author: Marcel Ziswiler Date: Fri Jul 22 23:54:35 2022 +0200 ARM: dts: imx6qdl-mba6: don't use multiple blank lines Avoid the following checkpatch warning: arch/arm/boot/dts/imx6qdl-mba6.dtsi:247: check: Please don't use multiple blank lines Signed-off-by: Marcel Ziswiler Acked-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit cdf904c97b04e553ea9dfd45dfb5b4f82595a91a Author: Marcel Ziswiler Date: Fri Jul 22 23:54:34 2022 +0200 ARM: dts: imx6-sabrelite: change to use SPDX identifiers Replace the license text with SPDX identifiers. Avoid the following checkpatch warning: arch/arm/boot/dts/imx6q-sabrelite.dts:1: warning: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Marcel Ziswiler Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 151c67c67b6cc11b2eb03bc390621f6fd8c5004f Author: Alexander Stein Date: Wed Jul 20 08:47:12 2022 +0200 ARM: dts: imx6q-mccmon6: Add fsl,err006687-workaround-present property Add property for ERR006687 hardware workaround. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit c9d38ff7080b2c4fa6786b82210fa13115895aae Author: Alexander Stein Date: Wed Jul 20 08:41:58 2022 +0200 ARM: dts: imx6: delete interrupts property if interrupts-extended is set In most cases this is related to fsl,err006687-workaround-present, which requires a GPIO interrupt next a GIC interrupt. This fixes the dtbs_check warning: imx6dl-mba6a.dtb: ethernet@2188000: More than one condition true in oneOf schema: {'$filename': 'Documentation/devicetree/bindings/net/fsl,fec.yaml', [...] Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 54c204c522fd2a887b52c7672b9238903ba59a8b Author: Matthew Auld Date: Fri Aug 19 13:39:04 2022 +0100 Revert "drm/i915/guc: Add delay to disable scheduling after pin count goes to zero" This reverts commit 6a079903847cce1dd06345127d2a32f26d2cd9c6. Everything in CI using GuC is now timing out[1], and killing the machine with this change (perhaps a deadlock?). CI was recently on fire due to some changes coming in from -rc1, so likely the pre-merge CI results for this series were invalid? For now just revert, unless GuC experts already have a fix in mind. [1] https://intel-gfx-ci.01.org/tree/drm-tip/index.html? Signed-off-by: Matthew Auld Cc: Matthew Brost Cc: Alan Previn Cc: John Harrison Reviewed-by: John Harrison Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220819123904.913750-1-matthew.auld@intel.com commit c4c8451147da569a79eff5edcd2864e8ee21d7aa Author: Al Viro Date: Sun Jan 30 21:12:26 2022 -0500 d_path.c: typo fix... Signed-off-by: Al Viro commit 0f60d28828dd94779c6527440289e1c36a05115a Author: Al Viro Date: Sun Jan 30 15:03:49 2022 -0500 dynamic_dname(): drop unused dentry argument Signed-off-by: Al Viro commit 682ca76bc60ab86824cca1b34bc865bd0094ac7e Author: Joe Simmons-Talbott Date: Fri Aug 19 14:20:12 2022 -0400 iio: Avoid multiple line dereference for mask Prefer lines > 80 characters over splitting dereferences across multiple lines. Reported by checkpatch.pl. Signed-off-by: Joe Simmons-Talbott Link: https://lore.kernel.org/r/20220819182012.219523-1-joetalbott@gmail.com Signed-off-by: Jonathan Cameron commit 955c2aa9cff2dd07ff798ca8c883398731687972 Author: William Breathitt Gray Date: Mon Aug 15 18:29:21 2022 -0400 iio: stx104: Move to addac subdirectory The stx104 driver supports both ADC and DAC functionality. Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220815222921.138945-1-william.gray@linaro.org Signed-off-by: Jonathan Cameron commit 83856aaab45da0fd34f94aac0371ba80668c1dbc Author: Jonathan Cameron Date: Sat Aug 13 17:06:00 2022 +0100 staging: iio: frequency: ad9832: Fix alignment for DMA safety ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Whilst here, move the marking to cover the whole union. That has no functional affect, but makes it slightly easier to see what is going on. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220813160600.1157169-1-jic23@kernel.org commit 813e62a6fe7539fdf0d8e018d4f157b57bdaeedd Author: Sven Eckelmann Date: Sat Aug 20 09:32:50 2022 +0200 batman-adv: Drop initialization of flexible ethtool_link_ksettings The commit 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members") changed various structures from using 0-length arrays to flexible arrays net/batman-adv/bat_v_elp.c: note: in included file: ./include/linux/ethtool.h:148:38: warning: nested flexible array net/batman-adv/bat_v_elp.c:128:9: warning: using sizeof on a flexible structure In theory, this could be worked around by using {} as initializer for the variable on the stack. But this variable doesn't has to be initialized at all by the caller of __ethtool_get_link_ksettings - everything will be initialized by the callee when no error occurs. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit acaa07e5dde76b9c762b4d8f00ad5b3901edb7ff Author: Christophe JAILLET Date: Sun Jan 9 13:29:45 2022 +0100 i2c: ismt: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Reviewed-by: Seth Heasley Signed-off-by: Wolfram Sang commit 786f01d205cebb0b114423ec0b66c4d19074faa1 Author: Jan Dabros Date: Fri Aug 12 09:15:26 2022 +0200 i2c: designware: Introduce semaphore reservation timer to AMDPSP driver In order to optimize performance, limit amount of back and forth transactions between x86 and PSP. This is done by introduction of semaphore reservation period - that is window in which x86 isn't releasing the bus immediately after each I2C transaction. In order to protect PSP from being starved while waiting for arbitration, after a programmed time bus is automatically released by a deferred function. Signed-off-by: Jan Dabros Acked-by: Jarkko Nikula [wsa: removed an unneeded empty line] Signed-off-by: Wolfram Sang commit 917edfb98c480fec1dce95ece6707779905ca0b5 Author: Maksym Glubokiy Date: Thu Aug 18 14:14:19 2022 +0300 net: prestera: add missing ABI compatibility check Size-check a type used for FW communication is packed as expected. Signed-off-by: Oleksandr Mazur Signed-off-by: Maksym Glubokiy Link: https://lore.kernel.org/r/20220818111419.414877-1-maksym.glubokiy@plvision.eu Signed-off-by: Jakub Kicinski commit 6745bc9b0351525e80cc7578e8ce22f83cfa3a84 Author: Yang Yingliang Date: Thu Aug 18 17:31:14 2022 +0800 amt: remove unnecessary skb pointer check The skb pointer will be checked in kfree_skb(), so remove the outside check. Signed-off-by: Yang Yingliang Reviewed-by: Taehee Yoo Link: https://lore.kernel.org/r/20220818093114.2449179-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit b690842d12fd6687c326663d69d5732de00c00f6 Author: Matthias May Date: Wed Aug 17 09:36:49 2022 +0200 selftests/net: test l2 tunnel TOS/TTL inheriting There are currently 3 ip tunnels that are capable of carrying L2 traffic: gretap, vxlan and geneve. They all are capable to inherit the TOS/TTL for the outer IP-header from the inner frame. Add a test that verifies that these fields are correctly inherited. These tests failed before the following commits: b09ab9c92e50 ("ip6_tunnel: allow to inherit from VLAN encapsulated IP") 3f8a8447fd0b ("ip6_gre: use actual protocol to select xmit") 41337f52b967 ("ip6_gre: set DSCP for non-IP") 7ae29fd1be43 ("ip_tunnel: allow to inherit from VLAN encapsulated IP") 7074732c8fae ("ip_tunnels: allow VXLAN/GENEVE to inherit TOS/TTL from VLAN") ca2bb69514a8 ("geneve: do not use RT_TOS for IPv6 flowlabel") b4ab94d6adaa ("geneve: fix TOS inheriting for ipv4") Signed-off-by: Matthias May Link: https://lore.kernel.org/r/20220817073649.26117-1-matthias.may@westermo.com Signed-off-by: Jakub Kicinski commit 14d25e3f53008ee4f030943d55178dbd2d363bc2 Merge: bf294c3feafeb c0e36be156c2c Author: Jakub Kicinski Date: Fri Aug 19 16:36:06 2022 -0700 Merge branch 'net-dpaa-cleanups-in-preparation-for-phylink-conversion' Sean Anderson says: ==================== net: dpaa: Cleanups in preparation for phylink conversion This series contains several cleanup patches for dpaa/fman. While they are intended to prepare for a phylink conversion, they stand on their own. This series was originally submitted as part of [1]. [1] https://lore.kernel.org/netdev/20220715215954.1449214-1-sean.anderson@seco.com ==================== Link: https://lore.kernel.org/r/20220818161649.2058728-1-sean.anderson@seco.com Signed-off-by: Jakub Kicinski commit c0e36be156c2c38d35f7a880f7ce0694b374e3f1 Author: Sean Anderson Date: Thu Aug 18 12:16:35 2022 -0400 net: fman: memac: Use params instead of priv for max_speed This option is present in params, so use it instead of the fman private version. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit c496e4d686aa9c15fc183117276e1e514f366a2e Author: Sean Anderson Date: Thu Aug 18 12:16:34 2022 -0400 net: fman: Export/rename some common functions In preparation for moving each of the initialization functions to their own file, export some common functions so they can be re-used. This adds an fman prefix to set_multi to make it a bit less genericly-named. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit 9ea4742a55cadad1e0f52f2b4558f2b30512058e Author: Sean Anderson Date: Thu Aug 18 12:16:33 2022 -0400 net: fman: Configure fixed link in memac_initialization memac is the only mac which parses fixed links. Move the parsing/configuring to its initialization function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit 7bd63966f0cc5b01b6cf3f091aaf5945575a4a26 Author: Sean Anderson Date: Thu Aug 18 12:16:32 2022 -0400 net: fman: Move struct dev to mac_device Move the reference to our device to mac_device. This way, macs can use it in their log messages. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit 28c3948a018dd3b94329230f3d5415fe7d8bc1a1 Author: Sean Anderson Date: Thu Aug 18 12:16:31 2022 -0400 net: fman: Store initialization function in match data Instead of re-matching the compatible string in order to determine the init function, just store it in the match data. The separate setup functions aren't needed anymore. Merge their content into init as well. To ensure everything compiles correctly, we move them to the bottom of the file. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit 478eb957ced6b1adbea6ffb00036138174585ba1 Author: Sean Anderson Date: Thu Aug 18 12:16:30 2022 -0400 net: fman: Get PCS node in per-mac init This moves the reading of the PCS property out of the generic probe and into the mac-specific initialization function. This reduces the mac-specific jobs done in the top-level probe function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit aae73fde7eb33d407257dceffb7aed0bcdaf247a Author: Sean Anderson Date: Thu Aug 18 12:16:29 2022 -0400 net: fman: dtsec: Always gracefully stop/start There are two ways that GRS can be set: graceful_stop and dtsec_isr. It is cleared by graceful_start. If it is already set before calling graceful_stop, then that means that dtsec_isr set it. In that case, we will not set GRS nor will we clear it (which seems like a bug?). For GTS the logic is similar, except that there is no one else messing with this bit (so we will always set and clear it). Simplify the logic by always setting/clearing GRS/GTS. This is less racy that the previous behavior, and ensures that we always end up clearing the bits. This can of course clear GRS while dtsec_isr is waiting, but because we have already done our own waiting it should be fine. This is the last user of enum comm_mode, so remove it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza Signed-off-by: Jakub Kicinski commit e61406a1955eb968aed43ffb35301ff969d7522f Author: Sean Anderson Date: Thu Aug 18 12:16:28 2022 -0400 net: fman: Store en/disable in mac_device instead of mac_priv_s All macs use the same start/stop functions. The actual mac-specific code lives in enable/disable. Move these functions to an appropriate struct, and inline the phy enable/disable calls to the caller of start/stop. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza Signed-off-by: Jakub Kicinski commit b7d852566a52b41e26f2da7c329816edacf69666 Author: Sean Anderson Date: Thu Aug 18 12:16:27 2022 -0400 net: fman: Don't pass comm_mode to enable/disable mac_priv_s->enable() and ->disable() are always called with a comm_mode of COMM_MODE_RX_AND_TX. Remove this parameter, and refactor the macs appropriately. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza Signed-off-by: Jakub Kicinski commit 8585bdadc2478e3038f390e94f448bb27df7cb3a Author: Sean Anderson Date: Thu Aug 18 12:16:26 2022 -0400 net: fman: Convert to SPDX identifiers This converts the license text of files in the fman directory to use SPDX license identifiers instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza Signed-off-by: Jakub Kicinski commit ee8433da085ecec3b75a9d0082e754eb932588d3 Author: Sean Anderson Date: Thu Aug 18 12:16:25 2022 -0400 dt-bindings: net: Convert FMan MAC bindings to yaml This converts the MAC portion of the FMan MAC bindings to yaml. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring Acked-by: Camelia Groza Signed-off-by: Jakub Kicinski commit a59bf85191ebeb14baf8c717d9f24f1d745888d0 Merge: a74ec0bf5b67e 9398381a3904d Author: Mark Brown Date: Fri Aug 19 23:46:57 2022 +0100 ASoC: mediatek: support SOF for mt8186 Merge series from Chunxu Li : In these patches, we add SOF support for mt8186 which have HiFi5 DSP inside. commit bf294c3feafebe59a8ad67daa69784258d48ad72 Author: Jakub Kicinski Date: Fri Aug 19 15:29:38 2022 -0700 Revert "Merge branch 'wwan-t7xx-fw-flashing-and-coredump-support'" This reverts commit 5417197dd516a8e115aa69f62a7b7554b0c3829c, reversing changes made to 0630f64d25a0f0a8c6a9ce9fde8750b3b561e6f5. Reverting to allow addressing review comments. Link: https://lore.kernel.org/all/4c5dbea0-52a9-1c3d-7547-00ea54c90550@linux.intel.com/ Signed-off-by: Jakub Kicinski commit 8377e8a24bba1ae73b3869bc71ee9df16b6bef61 Author: Eric Biggers Date: Thu Aug 18 15:40:10 2022 -0700 fs-verity: use kmap_local_page() instead of kmap() Convert the use of kmap() to its recommended replacement kmap_local_page(). This avoids the overhead of doing a non-local mapping, which is unnecessary in this case. Signed-off-by: Eric Biggers Reviewed-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220818224010.43778-1-ebiggers@kernel.org commit c987918a3fdf2d361c48839ec324f2547418f9d6 Author: Eric Biggers Date: Thu Aug 18 15:39:03 2022 -0700 fs-verity: use memcpy_from_page() Replace extract_hash() with the memcpy_from_page() helper function. This is simpler, and it has the side effect of replacing the use of kmap_atomic() with its recommended replacement kmap_local_page(). Signed-off-by: Eric Biggers Reviewed-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220818223903.43710-1-ebiggers@kernel.org commit 91e6455bf715fb1558a0bf8f645ec1c131254a3c Author: Liang He Date: Mon Jul 4 08:47:29 2022 +0800 clk: sprd: Hold reference returned by of_get_parent() We should hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Fixes: f95e8c7923d1 ("clk: sprd: support to get regmap from parent node") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220704004729.272481-1-windhl@126.com Reviewed-by: Orson Zhai Signed-off-by: Stephen Boyd commit 37c381b812dcbfde9c3f1f3d3e75fdfc1b40d5bc Author: Liang He Date: Fri Jul 8 16:49:00 2022 +0800 clk: berlin: Add of_node_put() for of_get_parent() In berlin2_clock_setup() and berlin2q_clock_setup(), we need to call of_node_put() for the reference returned by of_get_parent() which has increased the refcount. We should call *_put() in fail path or when it is not used anymore. Fixes: 26b3b6b959b2 ("clk: berlin: prepare simple-mfd conversion") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220708084900.311684-1-windhl@126.com Signed-off-by: Stephen Boyd commit b3ff02c5df4712b565b290c6f268a79a72a28e74 Author: Liang He Date: Thu Jun 30 22:39:49 2022 +0800 clk: at91: dt-compat: Hold reference returned by of_get_parent() We need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220630143949.218922-1-windhl@126.com Reviewed-by: Claudiu Beznea Signed-off-by: Stephen Boyd commit a8ea4273bc26256ce3cce83164f0f51c5bf6e127 Author: Liang He Date: Tue Jun 28 22:38:51 2022 +0800 clk: qoriq: Hold reference returned by of_get_parent() In legacy_init_clockgen(), we need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Beside, in create_sysclk(), we need to call of_node_put() on 'sysclk' also for refcount balance. Fixes: 0dfc86b3173f ("clk: qoriq: Move chip-specific knowledge into driver") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220628143851.171299-1-windhl@126.com Signed-off-by: Stephen Boyd commit 1d6aa08c54cd0e005210ab8e3b1e92ede70f8a4f Author: Liang He Date: Tue Jun 28 22:31:55 2022 +0800 clk: oxnas: Hold reference returned by of_get_parent() In oxnas_stdclk_probe(), we need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Fixes: 0bbd72b4c64f ("clk: Add Oxford Semiconductor OXNAS Standard Clocks") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220628143155.170550-1-windhl@126.com Signed-off-by: Stephen Boyd commit 429973306f860470cbbb8402c8c53143b450faba Author: Liang He Date: Tue Jun 28 22:24:15 2022 +0800 clk: st: Hold reference returned by of_get_parent() We should hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Fixes: 3efe64ef5186 ("clk: st: clkgen-fsyn: search reg within node or parent") Fixes: 810251b0d36a ("clk: st: clkgen-mux: search reg within node or parent") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220628142416.169808-1-windhl@126.com Signed-off-by: Stephen Boyd commit 02bd544f98ae96e2f8fde759696f725f0966cce6 Author: Liang He Date: Fri Jun 17 09:59:18 2022 +0800 clk: tegra: Add missing of_node_put() In tegra124_132_clock_init_pre() and tegra30_clock_init(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220617015918.4001865-1-windhl@126.com Signed-off-by: Stephen Boyd commit 89ab396d712f7c91fe94f55cff23460426f5fc81 Author: Liang He Date: Tue Jun 28 22:10:38 2022 +0800 clk: meson: Hold reference returned by of_get_parent() We should hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Fixes: 88e2da81241e ("clk: meson: aoclk: refactor common code into dedicated file") Fixes: 6682bd4d443f ("clk: meson: factorise meson64 peripheral clock controller drivers") Fixes: bb6eddd1d28c ("clk: meson: meson8b: use the HHI syscon if available") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220628141038.168383-1-windhl@126.com Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Signed-off-by: Stephen Boyd commit 28a0b0984e76df8fd64b6850fa56cf5201e6e638 Author: Liang He Date: Fri Jun 17 09:43:08 2022 +0800 clk: nomadik: Add missing of_node_put() In nomadik_src_init(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220617014308.4001511-1-windhl@126.com Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd commit b979f005d9b1ebdba565e85f5228dda6fe7a30e4 Author: Martin KaFai Lau Date: Fri Aug 19 12:21:55 2022 -0700 selftest/bpf: Add setget_sockopt to DENYLIST.s390x Trampoline is not supported in s390. Fixes: 31123c0360e0 ("selftests/bpf: bpf_setsockopt tests") Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220819192155.91713-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit e918cd231ee6f1dc969e71718ed11c71e98f5c4c Author: Colin Ian King Date: Wed Aug 17 22:32:42 2022 +0100 selftests/bpf: Fix spelling mistake. There is a spelling mistake in an ASSERT_OK literal string. Fix it. Signed-off-by: Colin Ian King Acked-by: Mykola Lysenko Link: https://lore.kernel.org/r/20220817213242.101277-1-colin.i.king@gmail.com Signed-off-by: Alexei Starovoitov commit 14a4d22ead0d9c01a6d7e9cb7f1d321dd29d354b Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:21 2022 +0300 dt-bindings: iio: temperature: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-11-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 6920f48efd58596af8e58ad5c861bd15726165e7 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:20 2022 +0300 dt-bindings: iio: samsung,sensorhub-rinato: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-10-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit efcdb1ab5030f231e377ac241fda83e1d3a126ed Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:19 2022 +0300 dt-bindings: iio: potentiometer: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-9-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 8d98a8c6b0520aeaef1f0be6cbcadece65f855e9 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:18 2022 +0300 dt-bindings: iio: imu: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-8-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit d9ca9d28068a151471141dd1b0ddbf272c2364ac Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:17 2022 +0300 dt-bindings: iio: health: ti,afe4403: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-7-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 3e03f90fe0b6d08142e0934eb7db6c26a509b505 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:16 2022 +0300 dt-bindings: iio: frequency: adf4371: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-6-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 25d0469946c3b528c34ef517dd57f6d4b5595e99 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:15 2022 +0300 dt-bindings: iio: dac: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-5-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 1deca207e1544a1683e300cd6c3a71e46c7b58ef Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:14 2022 +0300 dt-bindings: iio: amplifiers: adi,ada4250: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-4-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 5f72930016202ca44ef0f4502d14e9054fbb3644 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:13 2022 +0300 dt-bindings: iio: accel: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-3-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 801373884560e707883adb2aa7ef9bf2293bf88a Author: Krzysztof Kozlowski Date: Tue Aug 16 15:43:12 2022 +0300 dt-bindings: iio: adc: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Marcus Folkesson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816124321.67817-2-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 59d1c811c1dd9ab3bd2d216d1453eb0e4cacd52c Author: Krzysztof Kozlowski Date: Tue Aug 16 15:54:01 2022 +0300 dt-bindings: iio: adc: Drop Patrick Vasseur Emails to Patrick Vasseur bounce ("Unknown To address"). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220816125401.70317-3-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 6683fdf4202c5d7cb2fa47a13adaf275ca3ac1a2 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:54:00 2022 +0300 iio: MAINTAINERS: Drop Tomislav Denis Emails to Tomislav Denis bounce ("550 5.1.1 User Unknown"). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220816125401.70317-2-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit f33abd2d57f9df81de8d4c1fee5c68849a0f8690 Author: Krzysztof Kozlowski Date: Tue Aug 16 15:53:59 2022 +0300 dt-bindings: iio: Drop Tomislav Denis Emails to Tomislav Denis bounce ("550 5.1.1 User Unknown"). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220816125401.70317-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 3c6f3900808c483b0bbb2c351f995c7b880dae14 Author: Josh Poimboeuf Date: Thu Aug 18 09:26:57 2022 -0700 objtool: Remove "ANNOTATE_NOENDBR on ENDBR" warning This warning isn't very useful: why would you put ANNOTATE_NOENDBR on ENDBR, and if you did, what's the harm? And thus far it's only found one non-bug, where the '__end_entry_SYSENTER_compat' label happens to land on the ENDBR from entry_SYSCALL_compat: vmlinux.o: warning: objtool: entry_SYSCALL_compat+0x0: ANNOTATE_NOENDBR on ENDBR .. which is fine. Just remove the warning. Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/142341a5dafdfc788e4c95b9e226a6eefc9b626e.1660839773.git.jpoimboe@kernel.org commit 7b3e31869081771c63c3d006347ad06738f843b5 Author: Chen Zhongjin Date: Thu Aug 18 09:45:53 2022 +0800 objtool: Use arch_jump_destination() in read_intra_function_calls() Use arch_jump_destiation() instead of the open-coded 'offset + len + immediate' that is x86 specific. Avoids future trouble with other architectures. Signed-off-by: Chen Zhongjin Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220818014553.220261-1-chenzhongjin@huawei.com commit 501f7f69bca195da266de83eb2c26c30813fba97 Author: Namhyung Kim Date: Wed Aug 10 15:03:46 2022 -0700 locking: Add __lockfunc to slow path functions So that we can skip the functions in the perf lock contention and other places like /proc/PID/wchan. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Link: https://lore.kernel.org/r/20220810220346.1919485-1-namhyung@kernel.org commit 83de806074980ea94930ca4ff6754fecf9ad8290 Author: Robert Marko Date: Fri Aug 19 00:18:13 2022 +0200 iio: adc: qcom-spmi-adc5: add ADC5_VREF_VADC to rev2 ADC5 Add support for ADC5_VREF_VADC channel to rev2 ADC5 channel list. This channel measures the VADC reference LDO output. Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20220818221815.346233-3-robimarko@gmail.com Signed-off-by: Jonathan Cameron commit a723df3d430933a326257b049a993f377df66e1c Author: Wolfram Sang Date: Fri Aug 19 18:23:48 2022 +0100 iio: imu: inv_mpu6050: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Jonathan Cameron commit ae2c9cf14c1ee451cd2215584b21619f1568d9e1 Author: Wolfram Sang Date: Thu Aug 18 23:00:16 2022 +0200 iio: st_sensors: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210017.6817-1-wsa+renesas@sang-engineering.com Signed-off-by: Jonathan Cameron commit 30475ef2836ee47965e424b79e54e35c18ff0aeb Author: Antoniu Miclaus Date: Fri Aug 19 13:41:17 2022 +0300 iio: frequency: admv1014: return -EINVAL directly Remove extra step where the error code is assigned to the `ret` variable. Return instead error code directly. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20220819104117.4600-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 8869fa666a9e6782c3c896c1fa57d65adca23249 Author: Danilo Krummrich Date: Wed Aug 3 16:55:20 2022 +0200 drm/virtio: remove drm_plane_cleanup() destroy hook drmm_universal_plane_alloc() already registers drm_plane_cleanup() as managed release action via drmm_add_action_or_reset(). Hence, drm_plane_cleanup() should not be set as drm_plane_funcs.destroy hook. Fixes: 7847628862a8 ("drm/virtio: plane: use drm managed resources") Reviewed-by: Sam Ravnborg Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20220803145520.1143208-1-dakr@redhat.com commit 9d9292576810d0b36897718c24dfbc1a2835314b Author: Krzysztof Kozlowski Date: Tue Aug 16 16:30:16 2022 +0300 dt-bindings: pinctrl: samsung: deprecate header with register constants For convenience (less code duplication, some meaning added to raw number), the pin controller pin configuration register values were defined in the bindings header. These are not some IDs or other abstraction layer but raw numbers used in the registers These constants do not fit the purpose of bindings. They do not provide any abstraction, any hardware and driver independent ID. With minor exceptions, the Linux drivers actually do not use the bindings header at all. All of the constants were moved already to headers local to DTS (residing in DTS directory) and to Samsung pinctrl driver (where applicable), so remove any references to the bindings header and add a warning tha tit is deprecated. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Chanho Park Acked-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220816133016.77553-3-krzysztof.kozlowski@linaro.org commit df805304a820ed10fc3d038dd64b85821c9ee606 Author: Krzysztof Kozlowski Date: Tue Aug 16 16:30:15 2022 +0300 dt-bindings: pinctrl: samsung: stop using bindings header with constants The bindings header with pin controller register values is being deprecated and DTS already switched to a DTS-local header. Do not reference the bindings header in schema and replace the defines with raw values. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220816133016.77553-2-krzysztof.kozlowski@linaro.org commit 1cda83e42bf66beb06bf61c7a78951ec0c028898 Author: Cezary Rojewski Date: Fri Aug 19 14:47:40 2022 +0200 ASoC: SOF: Fix compilation when HDA_AUDIO_CODEC config is disabled hda_codec_device_init() expects three parameters, not two. Fixes: 3fd63658caed ("ASoC: Intel: Drop hdac_ext usage for codec device creation") Reported-by: kernel test robot Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220819124740.3564862-1-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 51e99de583697cc073ef8888690675b07fe8ef3c Author: Wolfram Sang Date: Thu Aug 18 23:01:07 2022 +0200 spi: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210107.7373-1-wsa+renesas@sang-engineering.com Signed-off-by: Mark Brown commit a74ec0bf5b67eae87317646571116ce4b4166d95 Author: Dan Carpenter Date: Fri Aug 19 08:23:09 2022 +0300 ASoC: amd: acp: remove unnecessary NULL checks The list iterator can never be NULL. Delete the bogus NULL checks. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Yv8ePUuBfzaRu6xV@kili Signed-off-by: Mark Brown commit ceff365a29aaf275c0cd1bb7edaf57dcf254bc77 Author: Martin Povišer Date: Thu Aug 18 18:53:36 2022 +0200 ASoC: Change handling of unimplemented set_bclk_ratio If a 'set_bclk_ratio' call is attempted on a DAI not implementing the method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can still be okay with the ratio, just does not care to register a handler. No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect the return value, but -ENOSUPP disables an error print from within the common soc_dai_ret return filter. With the new behavior a machine driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of which may care about the ratio, some of which may not. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220818165336.76403-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit fd8ec75207588f85c622ee49e5f32267d2406d92 Author: Yang Yingliang Date: Fri Aug 19 15:37:58 2022 +0800 ASoC: amd: acp: add a label to make error path more clean Move platform_device_unregister() to a new label to make code more clean. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220819073758.1273160-3-yangyingliang@huawei.com Signed-off-by: Mark Brown commit f89a8c5bb3489e43ff87b5f91acc8db66a168e8e Author: Yang Yingliang Date: Fri Aug 19 15:37:57 2022 +0800 ASoC: amd: acp: switch to use dev_err_probe() Use dev_err_probe() to simplify code and print error code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220819073758.1273160-2-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 6a4ce20fd776d2fd19ffaf85cf34a53761e2c888 Author: Yang Yingliang Date: Fri Aug 19 15:37:56 2022 +0800 ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Add missing platform_device_unregister() in error path in acp_pci_probe(). Fixes: c49f5e74a11e ("ASoC: amd: acp: Add error handling cases") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220819073758.1273160-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit fb5319af6ad8616b772761ed926ca57e10f30ea4 Author: Zhang Peng Date: Thu Aug 18 09:53:54 2022 +0800 ASoC: SOF: imx: Add i.MX8ULP HW support This adds skeleton support for the audio DSP hardware found on NXP i.MX8ULP platform. On i.MX8ULP resources (clocks, power, etc) are managed by the System Integration Module in LPAV domain and XRDC which is handled by arm trusted firmware. Signed-off-by: Zhang Peng Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/1660787634-28550-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit ee6c42ba5c7670c6f8c17c7bcedbcdaf7b8eb72e Author: Shengjiu Wang Date: Thu Aug 18 09:53:53 2022 +0800 dt-bindings: dsp: fsl: Add SOF compatile string for i.MX8ULP Add SOF compatile string "fsl,imx8ulp-dsp" for supporting DSP device on i.MX8ULP platform. Signed-off-by: Shengjiu Wang Acked-by: Rob Herring Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/1660787634-28550-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 9398381a3904d8849691fb3ec173b48f077c185e Author: Chunxu Li Date: Thu Aug 18 10:51:13 2022 +0800 ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-da7219-max98357 1. Add widgets, routes and dai-links required by SOF 2. Only when adsp phandle could be retrieved from DTS, the SOF related part of machine driver is executed. 3. Support dai-links could be specified from DTS, so that we can disable AP side hardware controls when DSP SOF controls the same audio FE. Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220818025113.17144-4-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 4be34e1b70ac72415a55e02683cd847436424588 Author: Chunxu Li Date: Thu Aug 18 10:51:12 2022 +0800 ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-rt1019-rt5682s 1. Add widgets, routes and dai-links required by SOF 2. Only when adsp phandle could be retrieved from DTS, the SOF related part of machine driver is executed. 3. Support dai-links could be specified from DTS, so that we can disable AP side hardware controls when DSP SOF controls the same audio FE. Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220818025113.17144-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 3c15abbed0ab99bac2e075ad38d43a7004778e91 Author: Chunxu Li Date: Thu Aug 18 10:51:11 2022 +0800 ASoC: mediatek: mt8186: support DSP downlink 1. add DSP downlink link widget 2. add DSP to I2S route path Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220818025113.17144-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown commit 6bc7643d1b9cf131f6ef98082548dec83f753fb8 Author: Hans Verkuil Date: Mon Jul 11 12:21:11 2022 +0200 media: vivid: add pixel_array test control This control will change dimensions according to the source resolution. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 43cc0ec38131c10557c771760ffdfdb74a2da155 Author: Hans Verkuil Date: Mon Jul 11 12:21:10 2022 +0200 media: v4l2-ctrls: add change flag for when dimensions change Add a new V4L2_EVENT_CTRL_CH_DIMENSIONS change flag that is issued when the dimensions of an array change as a result of a __v4l2_ctrl_modify_dimensions() call. This will inform userspace that there are new dimensions. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0975274557d15ab9a01c0944f27065e6708a797c Author: Hans Verkuil Date: Mon Jul 11 12:21:09 2022 +0200 media: v4l2-ctrls: add v4l2_ctrl_modify_dimensions Add a new function to modify the dimensions of an array control. This is typically used if the array size depends on e.g. the currently selected video format. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 7392d87a9febb5f46f28d4704eb5636c5e22cdeb Author: Hans Verkuil Date: Mon Jul 11 12:21:08 2022 +0200 media: v4l2-ctrls: alloc arrays in ctrl_ref Also allocate space for arrays in struct ctrl_ref. This is in preparation for allowing to change the array size from a driver. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 5f2c5c69a61dc5411d436c1a422f8a1ee195a924 Author: Hans Verkuil Date: Mon Jul 11 12:21:07 2022 +0200 media: v4l2-ctrls: allocate space for arrays Just like dynamic arrays, also allocate space for regular arrays. This is in preparation for allowing to change the array size from a driver. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 505ffcc852401aaac4dfb57c16bec0f7838c0e00 Author: Wolfram Sang Date: Thu Aug 18 23:01:39 2022 +0200 affs: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 47d35bf22b6913aa9fa2389431377d4189102a15 Author: Martin Kaiser Date: Sun Aug 14 19:03:59 2022 +0200 hwrng: imx-rngc - use KBUILD_MODNAME as driver name Use KBUILD_MODNAME instead of hard coding the driver name. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 90cb3ca2fa4f5c4c3fbeb9014584b69b1ba26242 Author: Tuo Cao <91tuocao@gmail.com> Date: Sun Aug 14 21:00:54 2022 +0800 crypto: artpec6 - move spin_lock_bh to spin_lock in tasklet it is unnecessary to call spin_lock_bh in a tasklet. Signed-off-by: Tuo Cao <91tuocao@gmail.com> Signed-off-by: Herbert Xu commit a76bd86a85cac9feddc66d38019f943d054f0218 Author: Robert Elliott Date: Sat Aug 13 18:14:43 2022 -0500 crypto: testmgr - don't generate WARN for missing modules This userspace command: modprobe tcrypt or modprobe tcrypt mode=0 runs all the tcrypt test cases numbered <200 (i.e., all the test cases calling tcrypt_test() and returning return values). Tests are sparsely numbered from 0 to 1000. For example: modprobe tcrypt mode=12 tests sha512, and modprobe tcrypt mode=152 tests rfc4543(gcm(aes))) - AES-GCM as GMAC The test manager generates WARNING crashdumps every time it attempts a test using an algorithm that is not available (not built-in to the kernel or available as a module): alg: skcipher: failed to allocate transform for ecb(arc4): -2 ------------[ cut here ]----------- alg: self-tests for ecb(arc4) (ecb(arc4)) failed (rc=-2) WARNING: CPU: 9 PID: 4618 at crypto/testmgr.c:5777 alg_test+0x30b/0x510 [50 more lines....] ---[ end trace 0000000000000000 ]--- If the kernel is compiled with CRYPTO_USER_API_ENABLE_OBSOLETE disabled (the default), then these algorithms are not compiled into the kernel or made into modules and trigger WARNINGs: arc4 tea xtea khazad anubis xeta seed Additionally, any other algorithms that are not enabled in .config will generate WARNINGs. In RHEL 9.0, for example, the default selection of algorithms leads to 16 WARNING dumps. One attempt to fix this was by modifying tcrypt_test() to check crypto_has_alg() and immediately return 0 if crypto_has_alg() fails, rather than proceed and return a non-zero error value that causes the caller (alg_test() in crypto/testmgr.c) to invoke WARN(). That knocks out too many algorithms, though; some combinations like ctr(des3_ede) would work. Instead, change the condition on the WARN to ignore a return value is ENOENT, which is the value returned when the algorithm or combination of algorithms doesn't exist. Add a pr_warn to communicate that information in case the WARN is skipped. This approach allows algorithm tests to work that are combinations, not provided by one driver, like ctr(blowfish). Result - no more WARNINGs: modprobe tcrypt [ 115.541765] tcrypt: testing md5 [ 115.556415] tcrypt: testing sha1 [ 115.570463] tcrypt: testing ecb(des) [ 115.585303] cryptomgr: alg: skcipher: failed to allocate transform for ecb(des): -2 [ 115.593037] cryptomgr: alg: self-tests for ecb(des) using ecb(des) failed (rc=-2) [ 115.593038] tcrypt: testing cbc(des) [ 115.610641] cryptomgr: alg: skcipher: failed to allocate transform for cbc(des): -2 [ 115.618359] cryptomgr: alg: self-tests for cbc(des) using cbc(des) failed (rc=-2) ... Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit aa031b8f702e7941b4c86022348a366c335d389a Author: Robert Elliott Date: Sat Aug 13 18:04:31 2022 -0500 crypto: x86/sha512 - load based on CPU features x86 optimized crypto modules built as modules rather than built-in to the kernel end up as .ko files in the filesystem, e.g., in /usr/lib/modules. If the filesystem itself is a module, these might not be available when the crypto API is initialized, resulting in the generic implementation being used (e.g., sha512_transform rather than sha512_transform_avx2). In one test case, CPU utilization in the sha512 function dropped from 15.34% to 7.18% after forcing loading of the optimized module. Add module aliases for this x86 optimized crypto module based on CPU feature bits so udev gets a chance to load them later in the boot process when the filesystems are all running. Signed-off-by: Robert Elliott Signed-off-by: Herbert Xu commit 6a088a2cbcaf40747cf2881df47f4f5d65acd7ab Author: Weili Qian Date: Sat Aug 13 18:35:45 2022 +0800 crypto: hisilicon/qm - remove unneeded hardware cache write back Data in the hardware cache needs to be written back to the memory before the queue memory is released. Currently, the queue memory is applied for when the driver is loaded and released when the driver is removed. Therefore, the hardware cache does not need to be written back when process puts queue. Signed-off-by: Weili Qian Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 1129d2d533195993aa0b0d0cd1c868950e01770d Author: Junchong Pan Date: Sat Aug 13 18:35:15 2022 +0800 crypto: hisilicon/qm - remove unneeded data storage The dump_show() is used to output hardware information for error locating. It is not need to apply for memory to temporarily store the converted data. It can directly output the data. Therefore, remove some unnecessary code. Signed-off-by: Junchong Pan Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 116be08f6e4e385733d42360a33c3d883d2dd702 Author: Weili Qian Date: Sat Aug 13 18:34:52 2022 +0800 crypto: hisilicon/qm - fix missing destroy qp_idr In the function hisi_qm_memory_init(), if resource alloc fails after idr_init, the initialized qp_idr needs to be destroyed. Signed-off-by: Weili Qian Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 582b05bba481d5798ef884f1396285ab47e426e1 Author: Weili Qian Date: Sat Aug 13 18:34:21 2022 +0800 crypto: hisilicon/hpre - change return type of hpre_cluster_inqry_write() hpre_cluster_inqry_write() always returns 0. So change the type of hpre_cluster_inqry_write() to void. Signed-off-by: Weili Qian Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 6d9a899557c8751372da99d137eaaa9cdbe81f41 Author: Yang Shen Date: Sat Aug 13 18:19:39 2022 +0800 crypto: hisilicon/zip - some misc cleanup Some cleanup for code: 1. Change names for easy to understand. 2. Unify the variables type. 3. Use the right return value. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 4f336045276b26c1620d0cb64d4af39ec508f436 Author: Yang Shen Date: Sat Aug 13 17:57:52 2022 +0800 crypto: hisilicon/zip - optimization for performance 1.Remove some useless steps during doing requests. 2.Adjust the possibility of branch prediction. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 5a4c2936669736f2e915fe6135a668e9e079de34 Author: Lucas Segarra Fernandez Date: Fri Aug 12 16:16:02 2022 +0200 crypto: testmgr - extend acomp tests for NULL destination buffer Acomp API supports NULL destination buffer for compression and decompression requests. In such cases allocation is performed by API. Add test cases for crypto_acomp_compress() and crypto_acomp_decompress() with dst buffer allocated by API. Tests will only run if CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit bc9d6dac098bd4f6671970e0ba6c247e3a8c4029 Author: Jason Wang Date: Thu Aug 11 20:13:49 2022 +0800 crypto: api - Fix comment typo The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Herbert Xu commit 450df3ecef4df9d94f7ca0d68527944418b2d1ed Author: Jason Wang Date: Thu Aug 11 20:07:05 2022 +0800 crypto: cavium - Fix comment typo The double `the' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Herbert Xu commit 66c8137f75315d9b354c63d3aa215fe9d83a9004 Author: Dong Chuanjian Date: Thu Aug 11 15:17:33 2022 +0800 crypto: drbg - remove unnecessary (void*) conversions remove unnecessary void* type casting v2: Turn assignments less than 75 characters into one line. Signed-off-by: Dong Chuanjian Signed-off-by: Herbert Xu commit b3b9fdf1a9be4266b01a2063b1f37cdc20806e3b Author: Jarkko Sakkinen Date: Wed Aug 10 01:49:15 2022 +0300 crypto: ccp - Add a quirk to firmware update A quirk for fixing the committed TCB version, when upgrading from a firmware version earlier than 1.50. This is a known issue, and the documented workaround is to load the firmware twice. Currently, this issue requires the following workaround: sudo modprobe -r kvm_amd sudo modprobe -r ccp sudo modprobe ccp sudo modprobe kvm_amd Implement this workaround inside kernel by checking whether the API version is less than 1.50, and if so, download the firmware twice. This addresses the TCB version issue. Link: https://lore.kernel.org/all/de02389f-249d-f565-1136-4af3655fab2a@profian.com/ Reported-by: Harald Hoyer Signed-off-by: Jarkko Sakkinen Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 56fae4304c8eea2dfb9037ded1aa774acb110d69 Author: Jean Delvare Date: Wed Aug 3 22:47:55 2022 +0200 crypto: keembay-ocs - Drop obsolete dependency on COMPILE_TEST Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare Cc: Declan Murphy Cc: Daniele Alessandrelli Cc: Mark Gross Cc: Herbert Xu Cc: Prabhjot Khurana Cc: "David S. Miller" Signed-off-by: Herbert Xu commit 7433d2fda2f0d1fcbfc72d3b36f908ad94aebf6d Author: ye xingchen Date: Tue Aug 2 07:48:20 2022 +0000 crypto: sun8i-ce - using the pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync and pm_runtime_put_noidle. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Jernej Skrabec Signed-off-by: Herbert Xu commit 00278564a60e11df8bcca0ececd8b2f55434e406 Author: Zhuo Chen Date: Tue Aug 2 11:29:37 2022 +0800 crypto: hisilicon - Remove pci_aer_clear_nonfatal_status() call Calls to pci_cleanup_aer_uncorrect_error_status() have already been removed after commit 62b36c3ea664 ("PCI/AER: Remove pci_cleanup_aer_uncorrect_error_status() calls"). But in commit 6c6dd5802c2d ("crypto: hisilicon/qm - add controller reset interface") pci_aer_clear_nonfatal_status() was used again, so remove it in this patch. note: pci_cleanup_aer_uncorrect_error_status() was renamed to pci_aer_clear_nonfatal_status() in commit 894020fdd88c ("PCI/AER: Rationalize error status register clearing") Signed-off-by: Zhuo Chen Signed-off-by: Herbert Xu commit 042b4b169c6fb9d4df268d66282d7302dd73d37b Author: James Cowgill Date: Mon Aug 1 20:04:18 2022 +0000 hwrng: arm-smccc-trng - fix NO_ENTROPY handling The SMCCC_RET_TRNG_NO_ENTROPY switch arm is never used because the NO_ENTROPY return value is negative and negative values are handled above the switch by immediately returning. Fix by handling errors using a default arm in the switch. Fixes: 0888d04b47a1 ("hwrng: Add Arm SMCCC TRNG based driver") Signed-off-by: James Cowgill Signed-off-by: Herbert Xu commit 882aa6525cabcfa0cea61e1a19c9af4c543118ac Author: Herbert Xu Date: Fri Jul 29 17:35:31 2022 +0800 crypto: qcom-rng - Fix qcom_rng_of_match unused warning Module device tables need to be declared as maybe_unused because they will be unused when built-in and the corresponding option is also disabled. This patch adds the maybe_unused attributes to OF and ACPI. This also allows us to remove the ifdef around the ACPI data structure. Reported-by: kernel test robot Signed-off-by: Herbert Xu Reviewed-by: Vinod Koul Signed-off-by: Herbert Xu commit 36cb6494429bd64b27b7ff8b4af56f8e526da2b4 Author: Jason A. Donenfeld Date: Thu Jul 28 18:22:20 2022 +0800 hwrng: core - let sleep be interrupted when unregistering hwrng There are two deadlock scenarios that need addressing, which cause problems when the computer goes to sleep, the interface is set down, and hwrng_unregister() is called. When the deadlock is hit, sleep is delayed for tens of seconds, causing it to fail. These scenarios are: 1) The hwrng kthread can't be stopped while it's sleeping, because it uses msleep_interruptible() which does not react to kthread_stop. 2) A normal user thread can't be interrupted by hwrng_unregister() while it's sleeping, because hwrng_unregister() is called from elsewhere. We solve both issues by add a completion object called dying that fulfils waiters once we have started the process in hwrng_unregister. At the same time, we should cleanup a common and useless dmesg splat in the same area. Cc: Reported-by: Gregory Erwin Fixes: fcd09c90c3c5 ("ath9k: use hw_random API instead of directly dumping into random.c") Link: https://lore.kernel.org/all/CAO+Okf6ZJC5-nTE_EJUGQtd8JiCkiEHytGgDsFGTEjs0c00giw@mail.gmail.com/ Link: https://lore.kernel.org/lkml/CAO+Okf5k+C+SE6pMVfPf-d8MfVPVq4PO7EY8Hys_DVXtent3HA@mail.gmail.com/ Link: https://bugs.archlinux.org/task/75138 Signed-off-by: Jason A. Donenfeld Signed-off-by: Herbert Xu Acked-by: Toke Høiland-Jørgensen Acked-by: Kalle Valo Signed-off-by: Herbert Xu commit d74f9340097a881869c4c22ca376654cc2516ecc Author: Ye Weihua Date: Thu Jul 28 10:07:58 2022 +0800 crypto: hisilicon/zip - fix mismatch in get/set sgl_sge_nr KASAN reported this Bug: [17619.659757] BUG: KASAN: global-out-of-bounds in param_get_int+0x34/0x60 [17619.673193] Read of size 4 at addr fffff01332d7ed00 by task read_all/1507958 ... [17619.698934] The buggy address belongs to the variable: [17619.708371] sgl_sge_nr+0x0/0xffffffffffffa300 [hisi_zip] There is a mismatch in hisi_zip when get/set the variable sgl_sge_nr. The type of sgl_sge_nr is u16, and get/set sgl_sge_nr by param_get/set_int. Replacing param_get/set_int to param_get/set_ushort can fix this bug. Fixes: f081fda293ffb ("crypto: hisilicon - add sgl_sge_nr module param for zip") Signed-off-by: Ye Weihua Signed-off-by: Herbert Xu commit 4a772c40006ad488a14acedd0cc83c6f574f16fc Author: Eric Biggers Date: Mon Jul 25 11:36:36 2022 -0700 crypto: lib - remove __HAVE_ARCH_CRYPTO_MEMNEQ No architecture actually defines this, so it's unneeded. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit 6e78ad0bb45dd20b3c1a56c72a32e1d82f98b422 Author: Eric Biggers Date: Mon Jul 25 11:36:35 2022 -0700 crypto: lib - move __crypto_xor into utils CRYPTO_LIB_CHACHA depends on CRYPTO for __crypto_xor, defined in crypto/algapi.c. This is a layering violation because the dependencies should only go in the other direction (crypto/ => lib/crypto/). Also the correct dependency would be CRYPTO_ALGAPI, not CRYPTO. Fix this by moving __crypto_xor into the utils module in lib/crypto/. Note that CRYPTO_LIB_CHACHA_GENERIC selected XOR_BLOCKS, which is unrelated and unnecessary. It was perhaps thought that XOR_BLOCKS was needed for __crypto_xor, but that's not the case. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit 7033b937e21b12629d920e7864c20c46bc4ccf39 Author: Eric Biggers Date: Mon Jul 25 11:36:34 2022 -0700 crypto: lib - create utils module and move __crypto_memneq into it As requested at https://lore.kernel.org/r/YtEgzHuuMts0YBCz@gondor.apana.org.au, move __crypto_memneq into lib/crypto/ and put it under a new tristate. The tristate is CRYPTO_LIB_UTILS, and it builds a module libcryptoutils. As more crypto library utilities are being added, this creates a single place for them to go without cluttering up the main lib directory. The module's main file will be lib/crypto/utils.c. However, leave memneq.c as its own file because of its nonstandard license. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit 908f24270d9ccbe120b91e7029b372f3dcd18290 Author: Srinivas Kerekare Date: Mon Jul 25 11:40:09 2022 +0100 crypto: qat - add check to validate firmware images The function qat_uclo_check_image() validates the MMP and AE firmware images. If the QAT device supports firmware authentication (indicated by the handle to firmware loader), the input signed binary MMP and AE images are validated by parsing the following information: - Header length - Full size of the binary - Type of binary image (MMP or AE Firmware) Firmware binaries use RSA3K for signing and verification. The header length for the RSA3k is 0x384 bytes. All the size field values in the binary are quantified as DWORDS (1 DWORD = 4bytes). On an invalid value the function prints an error message and returns with an error code "EINVAL". Signed-off-by: Srinivas Kerekare Reviewed-by: Giovanni Cabiddu Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 108586eba094b318e6a831f977f4ddcc403a15da Author: Zhengchao Shao Date: Mon Jul 25 12:09:28 2022 +0800 crypto: sahara - don't sleep when in softirq Function of sahara_aes_crypt maybe could be called by function of crypto_skcipher_encrypt during the rx softirq, so it is not allowed to use mutex lock. Fixes: c0c3c89ae347 ("crypto: sahara - replace tasklets with...") Signed-off-by: Zhengchao Shao Signed-off-by: Herbert Xu commit 4cf05a4d7125854800a0e88eb3e1dbd74368e9af Author: Ville Syrjälä Date: Wed Aug 17 15:26:24 2022 +0300 drm/i915/mtl: Introduce FBC B MTL introduces a second FBC engine. The two FBC engines can operate entirely independently, FBC A serving pipe A and FBC B serving pipe B. The one place where things might go a bit wrong is the CFB allocation from stolen. We might have to consider some change to the allocation strategy to have a better chance of both engines being able to allocate its CFB. Maybe FBC A should allocate bottom up and FBC B top down, or something? For the moment the allocation strategy is DRM_MM_INSERT_BEST for both. Cc: Mika Kahola Signed-off-by: Ville Syrjälä Reviewed-by: Mika Kahola Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220817122624.213889-1-jani.nikula@intel.com commit f386832509b85e567acc849cdef22843ed33a525 Author: Jani Nikula Date: Wed Aug 17 15:19:48 2022 +0300 drm/i915/mtl: Meteorlake and later support DP 2.0 Meteorlake and newer platforms support DP 2.0. Cc: Uma Shankar Signed-off-by: Jani Nikula Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220817121948.180655-1-jani.nikula@intel.com commit da9d635f07f21b07ceda13a2ac815a058995f113 Author: Amadeusz Sławiński Date: Thu Aug 18 16:15:17 2022 +0200 ALSA: hda: Remove unused defines There is no need to keep unused defines in file. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220818141517.109280-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit 21b3d4f58401350cc73e67717366d1127caa6f7f Author: Amadeusz Sławiński Date: Thu Aug 18 16:15:16 2022 +0200 ALSA: hda: Remove unused MAX_PIN_CONFIGS constant Since it was introduced around v2.6.30 it was never used. Also HDA specification does not mention any limitation on number of PIN configurations. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220818141517.109280-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit d91857059defe6acb443d8a25691b43a0f9390e8 Author: Amadeusz Sławiński Date: Thu Aug 18 16:15:15 2022 +0200 ALSA: hda: Rework snd_hdac_stream_reset() to use macros We can use existing macros to poll and update register values instead of open coding the functionality. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220818141517.109280-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit 3cab69d99db754a2d3407fa2f5a80e6a2beb8440 Author: Amadeusz Sławiński Date: Thu Aug 18 16:15:14 2022 +0200 ALSA: hda: Move stream-register polling macros Polling stream registers doesn't really have anything to do with extended HDA registers, so move it to basic HDA header. This will allow for use in HDA framework. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220818141517.109280-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit 4dce3b375179fdd4aba2191be11ace90ef0ec6d6 Author: Jack Wang Date: Fri Aug 19 08:07:48 2022 +0200 usb/hcd: Fix dma_map_sg error check dma_map_sg return 0 on error. Cc: Alan Stern Cc: Kishon Vijay Abraham I Cc: Alexey Sheplyakov Cc: Stephen Boyd Cc: Weitao Wang Cc: Matthias Kaehlcke Cc: Arnd Bergmann Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang Link: https://lore.kernel.org/r/20220819060801.10443-7-jinpu.wang@ionos.com Signed-off-by: Greg Kroah-Hartman commit a88520bfc0ec829973f92b7a1ab0f64eb9a20724 Author: Jim Lin Date: Tue Aug 16 16:23:53 2022 +0800 usb: gadget: tegra: Reduce pad power Program USB2 UTMI pad PD controls during port connect/disconnect. Power down pad after disconnected to save power. Signed-off-by: Jim Lin Link: https://lore.kernel.org/r/20220816082353.13390-3-jilin@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 77bfa0fc7536e8fa7dc6f12081827e0edd75b0f9 Author: Jim Lin Date: Tue Aug 16 16:23:52 2022 +0800 phy: tegra: xusb: add utmi pad power on/down ops Add utmi_pad_power_on/down ops for each SOC instead of exporting tegra_phy_xusb_utmi_pad_power_on/down directly for Tegra186 chip. Signed-off-by: BH Hsieh Signed-off-by: Jim Lin Link: https://lore.kernel.org/r/20220816082353.13390-2-jilin@nvidia.com Signed-off-by: Greg Kroah-Hartman commit b7db5733a5ace9acc1f3104c9050c5aa1363f13b Author: Wolfram Sang Date: Thu Aug 18 23:01:15 2022 +0200 usb: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Reviewed-by: Richard Leitner Reviewed-by: Laurent Pinchart Acked-by: Shuah Khan Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210116.7517-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit fa7fc5243f9e7d64ea7e73c247218f22499c3479 Author: Wolfram Sang Date: Tue Jul 26 22:58:57 2022 +0200 dt-bindings: timer: renesas,tmu: Add r8a779f0 support Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220726205858.1199-1-wsa+renesas@sang-engineering.com Signed-off-by: Daniel Lezcano commit b830774c7e4168997ba42deb186f72e6a845742b Author: Johnson Wang Date: Thu Aug 18 20:46:02 2022 +0800 dt-bindings: timer: Add compatible for MediaTek MT8188 Add dt-binding documentation of timer for MediaTek MT8188 SoC platform. Signed-off-by: Johnson Wang Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220818124602.20394-1-johnson.wang@mediatek.com Signed-off-by: Daniel Lezcano commit d4d361ad00bac10701a8c14d8e1a2967bd2e2813 Author: Minghao Chi Date: Fri Aug 19 08:14:20 2022 +0000 isofs: delete unnecessary checks before brelse() The brelse() function tests whether its argument is NULL and then returns immediately. Thus remove the tests which are not needed around the shown calls. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220819081420.96209-1-chi.minghao@zte.com.cn commit e03d3b1b924cbaac91ddf066e4d14a2c4d3ed1d1 Author: Jiangshan Yi Date: Fri Aug 19 15:52:40 2022 +0800 fs/reiserfs: replace ternary operator with min() and min_t() Fix the following coccicheck warning: fs/reiserfs/prints.c:459: WARNING opportunity for min(). fs/reiserfs/resize.c:100: WARNING opportunity for min(). fs/reiserfs/super.c:2508: WARNING opportunity for min(). fs/reiserfs/super.c:2557: WARNING opportunity for min(). min() and min_t() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Jiangshan Yi Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220819075240.3199477-1-13667453960@163.com commit c4c2fac94dd04d982676278123affdeb11c32a72 Author: Greg Kroah-Hartman Date: Wed Aug 10 14:36:56 2022 +0200 USB: gadget: f_mass_storage: get rid of DEVICE_ATTR() usage The last holdout in the drivers/usb/* tree using DEVICE_ATTR() is the f_mass_storage driver, so move it to use DEVICE_ATTR_RW() instead. The mode is overridden in the is_visible callback to set it properly depending on if this is a cdrom or removable device. Cc: Felipe Balbi Cc: Alan Stern Cc: Maxim Devaev Cc: Wesley Cheng Cc: Neal Liu Cc: Roger Quadros Cc: Nikita Yushchenko Cc: Cai Huoqing Link: https://lore.kernel.org/r/20220810123656.3637104-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit b9f20cff54f76e5fdc5be3eb33286416b3494492 Author: Phil Edworthy Date: Thu Aug 4 20:22:20 2022 +0100 usb: gadget: udc: renesas_usb3: Add support for RZ/V2M RZ/V2M (r9a09g011) has a few differences: - The USB3_DRD_CON register has moved, its called USB_PERI_DRD_CON in the RZ/V2M hardware manual. It has additional bits for host and peripheral reset that need to cleared to use usb host and peripheral respectively. - The USB3_OTG_STA, USB3_OTG_INT_STA and USB3_OTG_INT_ENA registers have been moved and renamed to USB_PERI_DRD_STA, USB_PERI_DRD_INT_STA and USB_PERI_DRD_INT_E. - The IDMON bit used in the above regs for role detection have moved from bit 4 to bit 0. - RZ/V2M has an separate interrupt for DRD, i.e. for changes to IDMON. - There are reset lines for DRD and USBP - There is another clock, managed by runtime PM. Whilst the hardware can support 16 pipes, it is artifically limited based on the ram per pipe calculation. With the 4KB ram per pipe, we can support 9 pipes consisting of 4xIN pipes, 4xOUT pipes and PIPE0. Reviewed-by: Biju Das Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220804192220.128601-3-phil.edworthy@renesas.com Signed-off-by: Greg Kroah-Hartman commit 3c3ce77c9dab7f9628a9a96e881d0afb50ed74a6 Author: Phil Edworthy Date: Thu Aug 4 20:22:19 2022 +0100 dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support Document the RZ/V2M SoC bindings. The RZ/V2M SoC is a little different to the R-Car implementations. A few DRD related registers and bits have moved, there is a separate interrupt for DRD, an additional clock for register access and reset lines for DRD and USBP. Reviewed-by: Biju Das Reviewed-by: Rob Herring Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220804192220.128601-2-phil.edworthy@renesas.com Signed-off-by: Greg Kroah-Hartman commit e80cec306ac88f05d7d4c34e9309d38360ccec7d Author: Gene Chen Date: Fri Aug 5 15:17:13 2022 +0800 usb: typec: tcpci_rt1711h: Fix CC PHY noise filter of voltage level Fix CC PHY noise filter of voltage level according to current cc voltage level Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-8-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2c8cc0946c14c39b02748fba34325ecae636530a Author: Gene Chen Date: Fri Aug 5 15:17:12 2022 +0800 usb: typec: tcpci: Move function "tcpci_to_typec_cc" to common Move transition function "tcpci_to_typec_cc" to common header Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-7-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit 24b5c2c824c526f5aff105463463cc15027b4cd2 Author: Gene Chen Date: Fri Aug 5 15:17:11 2022 +0800 usb: typec: tcpci_rt1711h: Add compatible id with rt1715 Add compatible id with rt1715, and add initial setting for specific support PD30 command. Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-6-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit a2ed34df5a11bd054a6588584cad174d62707f6e Author: Gene Chen Date: Fri Aug 5 15:17:10 2022 +0800 usb: typec: tcpci_rt1711h: Add initial phy setting Add initial phy setting about phy dicard retry, rx filter deglitch time and BMC-encoded wait time Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-5-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1e50ceb0397c14d7e934c65d862b499013847d9f Author: Gene Chen Date: Fri Aug 5 15:17:09 2022 +0800 usb: typec: tcpci_rt1711h: Add regulator support when source vbus Add regulator support when source vbus Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-4-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b77b27155647dda2edc7f347ecc3b2828978d52 Author: Gene Chen Date: Fri Aug 5 15:17:08 2022 +0800 usb: typec: tcpci_rt1711h: Fix vendor setting when set vconn replace overwrite whole register with update bits Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-3-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit a72095ed8e65c18edc718bcdbca7f61133ed8322 Author: Gene Chen Date: Fri Aug 5 15:17:07 2022 +0800 dt-bindings usb: typec: rt1711h: Add binding for Richtek RT1711H Add binding for Richtek RT1711H Reviewed-by: Rob Herring Signed-off-by: Gene Chen Link: https://lore.kernel.org/r/20220805071714.150882-2-gene.chen.richtek@gmail.com Signed-off-by: Greg Kroah-Hartman commit d75807ab9569f5d894b07821760147aef0f2be74 Author: Johan Hovold Date: Fri Aug 5 09:45:00 2022 +0200 usb: dwc3: qcom: clean up icc init Clean up the interconnect-initialisation helper by increasing indentation of (or merging) continuation lines and adding brackets around multi-line blocks in order to improve readability. Reviewed-by: Matthias Kaehlcke Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220805074500.21469-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit b89bffa2efc9cee72454cae1ae08a8b437717b35 Author: Johan Hovold Date: Fri Aug 5 09:44:59 2022 +0200 usb: dwc3: qcom: only parse 'maximum-speed' once Add a temporary variable to the interconnect-initialisation helper to avoid parsing and decoding the 'maximum-speed' devicetree property twice. Reviewed-by: Matthias Kaehlcke Reviewed-by: Andrew Halaney Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220805074500.21469-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit b6155eaf6b05e558218b44b88a6cad03f15a586c Author: Thinh Nguyen Date: Wed Jul 27 18:38:01 2022 -0700 usb: common: debug: Check non-standard control requests Previously usb_decode_ctrl() only decodes standard control requests, but it was used for non-standard requests also. If it's non-standard or unknown standard bRequest, print the Setup data values. Fixes: af32423a2d86 ("usb: dwc3: trace: decode ctrl request") Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/8d6a30f2f2f953eff833a5bc5aac640a4cc2fc9f.1658971571.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 808e8bff6fe4f229fab68da468d9d418783bf38f Author: Michael Grzeschik Date: Wed Jul 20 23:51:13 2022 +0200 usb: dwc3: trace: add Start of Frame Number to trace event Having the Start of Frame Number in the trace data is useful for debugging. This patch adds the (micro)frame number in which the last packet of the TRB's buffer was transmitted or received to the trace output. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220720215113.1058313-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 37a136aac3fe265a79a9e4506ce99c1d8af7dbca Author: Michael Grzeschik Date: Wed Jul 20 23:51:12 2022 +0200 usb: dwc3: debug: show events parameters in hex Printing the event parameters in decimal is not useful. Print them in hex and make it more practical. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220720215113.1058313-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b44c0e7fef51ee7e8ca8c6efbf706f5613787100 Author: Michael Grzeschik Date: Wed Jul 20 23:35:23 2022 +0200 usb: dwc3: gadget: conditionally remove requests The functions stop_active_transfers and ep_disable are both calling remove_requests. This functions in both cases will giveback the requests with status ESHUTDOWN, which also represents an physical disconnection. For ep_disable this is not true. This patch adds the status parameter to remove_requests and sets the status to ECONNRESET on ep_disable. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220720213523.1055897-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b6caf79d215df3c2fcd92adf65744738bfb2e516 Author: Tomer Maimon Date: Mon Jul 18 21:18:42 2022 +0300 USB: host: npcm: Add NPCM8XX support Modify NPCM USB EHCI host controller configuration to support all NPCM BMC SoC. Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20220718181842.61040-4-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit de8ec567ef4d69718043ddb1323416df3db71605 Author: Tomer Maimon Date: Mon Jul 18 21:18:41 2022 +0300 dt-bindings: usb: npcm7xx: Add npcm845 compatible Add a compatible string for Nuvoton BMC NPCM845 USB EHCI host controller. Acked-by: Krzysztof Kozlowski Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20220718181842.61040-3-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7ebfdfa08fe832a25f9ae575a074d64af07e63da Author: Tomer Maimon Date: Mon Jul 18 21:18:40 2022 +0300 usb: host: npcm7xx: remove USB EHCI host reset sequence Remove USB EHCI host controller reset sequence from NPCM7XX USB EHCI host probe function because it is done in the NPCM reset driver. Acked-by: Alan Stern Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20220718181842.61040-2-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit 268603d79cc48dba671e9caf108fab32315b86a2 Merge: 8c78c1e52b0b8 4c2d0b039c5cc Author: Jakub Kicinski Date: Thu Aug 18 21:17:10 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 8c78c1e52b0b86bd282c41f3725beabe3c244b94 Author: Lorenzo Bianconi Date: Wed Aug 17 10:36:28 2022 -0700 igc: add xdp frags support to ndo_xdp_xmit Add the capability to map non-linear xdp frames in XDP_TX and ndo_xdp_xmit callback. Signed-off-by: Lorenzo Bianconi Tested-by: Naama Meir Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220817173628.109102-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit bafe1adb2f0e7c01c2c0843975c2d1d227f29a70 Merge: a64bb2b086230 1623d5719fdff Author: Jakub Kicinski Date: Thu Aug 18 20:50:44 2022 -0700 Merge branch 'selftests-mlxsw-add-ordering-tests-for-unified-bridge-model' Petr Machata says: ==================== selftests: mlxsw: Add ordering tests for unified bridge model Amit Cohen writes: Commit 798661c73672 ("Merge branch 'mlxsw-unified-bridge-conversion-part-6'") converted mlxsw driver to use unified bridge model. In the legacy model, when a RIF was created / destroyed, it was firmware's responsibility to update it in the relevant FID classification records. In the unified bridge model, this responsibility moved to software. This set adds tests to check the order of configuration for the following classifications: 1. {Port, VID} -> FID 2. VID -> FID 3. VNI -> FID (after decapsulation) In addition, in the legacy model, software is responsible to update a table which is used to determine the packet's egress VID. Add a test to check that the order of configuration does not impact switch behavior. See more details in the commit messages. Note that the tests supposed to pass also using the legacy model, they are added now as with the new model they test the driver and not the firmware. Patch set overview: Patch #1 adds test for {Port, VID} -> FID Patch #2 adds test for VID -> FID Patch #3 adds test for VNI -> FID Patch #4 adds test for egress VID classification ==================== Link: https://lore.kernel.org/r/cover.1660747162.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 1623d5719fdff46620eb55c5d4f0cf8af1afcdb4 Author: Amit Cohen Date: Wed Aug 17 17:28:28 2022 +0200 selftests: mlxsw: Add egress VID classification test After routing, the device always consults a table that determines the packet's egress VID based on {egress RIF, egress local port}. In the unified bridge model, it is up to software to maintain this table via REIV register. The table needs to be updated in the following flows: 1. When a RIF is set on a FID, for each FID's {Port, VID} mapping, a new {RIF, Port}->VID mapping should be created. 2. When a {Port, VID} is mapped to a FID and the FID already has a RIF, a new {RIF, Port}->VID mapping should be created. Add a test to verify that packets get the correct VID after routing, regardless of the order of the configuration. # ./egress_vid_classification.sh TEST: Add RIF for existing {port, VID}->FID mapping [ OK ] TEST: Add {port, VID}->FID mapping for FID with a RIF [ OK ] Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit cbeb6e1195d1f293a11534f5eeb7455af3c8f9d5 Author: Amit Cohen Date: Wed Aug 17 17:28:27 2022 +0200 selftests: mlxsw: Add ingress RIF configuration test for VXLAN Before layer 2 forwarding, the device classifies an incoming packet to a FID. After classification, the FID is known, but also all the attributes of the FID, such as the router interface (RIF) via which a packet that needs to be routed will ingress the router block. For VXLAN decapsulation, the FID classification is done according to the VNI. When a RIF is added on top of a FID, the existing VNI->FID mapping should be updated by the software with the new RIF. In addition, when a new mapping is added for FID which already has a RIF, the correct RIF should be used for it. Add a test to verify that packets can be routed after decapsulation which is done after VNI->FID classification, regardless of the order of the configuration. # ./ingress_rif_conf_vxlan.sh TEST: Add RIF for existing VNI->FID mapping [ OK ] TEST: Add VNI->FID mapping for FID with a RIF [ OK ] Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 3a5ddc886847d4cd84bd2ce7bbbfdb3fd5845678 Author: Amit Cohen Date: Wed Aug 17 17:28:26 2022 +0200 selftests: mlxsw: Add ingress RIF configuration test for 802.1Q bridge Before layer 2 forwarding, the device classifies an incoming packet to a FID. After classification, the FID is known, but also all the attributes of the FID, such as the router interface (RIF) via which a packet that needs to be routed will ingress the router block. For VLAN-aware bridges (802.1Q), the FID classification is done according to VID. When a RIF is added on top of a FID, the existing VID->FID mapping should be updated by the software with the new RIF. We never map multiple VLANs to the same FID using VID->FID, so we cannot create VID->FID for FID which already has a RIF using 802.1Q. Anyway, verify that packets can be routed via port which is added after the FID already has a RIF. Add a test to verify that packets can be routed after VID->FID classification, regardless of the order of the configuration. # ./ingress_rif_conf_1q.sh TEST: Add RIF for existing VID->FID mapping [ OK ] TEST: Add port to VID->FID mapping for FID with a RIF [ OK ] Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit 2cd87cea78425e6b019e34e969dc008ce560acbf Author: Amit Cohen Date: Wed Aug 17 17:28:25 2022 +0200 selftests: mlxsw: Add ingress RIF configuration test for 802.1D bridge Before layer 2 forwarding, the device classifies an incoming packet to a FID. After classification, the FID is known, but also all the attributes of the FID, such as the router interface (RIF) via which a packet that needs to be routed will ingress the router block. For VLAN-unaware bridges (802.1D), the FID classification is done according to {Port, VID}. When a RIF is added on top of a FID, all the existing {Port, VID}->FID mappings should be updated by the software with the new RIF. In addition, when a new mapping is added for FID which already has a RIF, the correct RIF should be used for it. Add a test to verify that packets can be routed after {Port, VID}->FID classification, regardless of the order of the configuration. # ./ingress_rif_conf_1d.sh TEST: Add RIF for existing {port, VID}->FID mapping [ OK ] TEST: Add {port, VID}->FID mapping for FID with a RIF [ OK ] Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: Jakub Kicinski commit a64bb2b0862302ab63e102a9a63345e6443d1290 Author: Lorenzo Bianconi Date: Tue Aug 16 19:14:30 2022 +0200 net: ethernet: mtk_eth_soc: remove unused txd_pdma pointer in mtk_xdp_submit_frame Get rid of unnecessary txd_pdma pointer in mtk_xdp_submit_frame for loop since it is actually used at the end of the routine using latest mtk_tx_dma consumed pointer as reference. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/2c40b0fbb9163a0d62ff897abae17db84a9f3b99.1660669138.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit 5d81757835859760a38a54a87eff856d4e578836 Author: Emeel Hakim Date: Thu Aug 18 18:32:30 2022 +0300 net: macsec: Expose MACSEC_SALT_LEN definition to user space Expose MACSEC_SALT_LEN definition to user space to be used in various user space applications such as iproute. Iproute will use this as part of adding macsec extended packet number support. Reviewed-by: Raed Salem Reviewed-by: Sabrina Dubroca Signed-off-by: Emeel Hakim Link: https://lore.kernel.org/r/20220818153229.4721-1-ehakim@nvidia.com Signed-off-by: Jakub Kicinski commit 75179e2b7f9a9b6dbca735a5ca7420a7e983c7e2 Merge: fb8d784b531e3 31123c0360e01 Author: Alexei Starovoitov Date: Thu Aug 18 17:06:14 2022 -0700 Merge branch 'bpf: net: Remove duplicated code from bpf_setsockopt()' Martin KaFai Lau says: ==================== The code in bpf_setsockopt() is mostly a copy-and-paste from the sock_setsockopt(), do_tcp_setsockopt(), do_ipv6_setsockopt(), and do_ip_setsockopt(). As the allowed optnames in bpf_setsockopt() grows, so are the duplicated code. The code between the copies also slowly drifted. This set is an effort to clean this up and reuse the existing {sock,do_tcp,do_ipv6,do_ip}_setsockopt() as much as possible. After the clean up, this set also adds a few allowed optnames that we need to the bpf_setsockopt(). The initial attempt was to clean up both bpf_setsockopt() and bpf_getsockopt() together. However, the patch set was getting too long. It is beneficial to leave the bpf_getsockopt() out for another patch set. Thus, this set is focusing on the bpf_setsockopt(). v4: - This set now depends on the commit f574f7f839fc ("net: bpf: Use the protocol's set_rcvlowat behavior if there is one") in the net-next tree. The commit calls a specific protocol's set_rcvlowat and it changed the bpf_setsockopt which this set has also changed. Because of this, patch 9 of this set has also adjusted and a 'sock' NULL check is added to the sk_setsockopt() because some of the bpf hooks have a NULL sk->sk_socket. This removes more dup code from the bpf_setsockopt() side. - Avoid mentioning specific prog types in the comment of the has_current_bpf_ctx(). (Andrii) - Replace signed with unsigned int bitfield in the patch 15 selftest. (Daniel) v3: - s/in_bpf/has_current_bpf_ctx/ (Andrii) - Add comment to has_current_bpf_ctx() and sockopt_lock_sock() (Stanislav) - Use vmlinux.h in selftest and add defines to bpf_tracing_net.h (Stanislav) - Use bpf_getsockopt(SO_MARK) in selftest (Stanislav) - Use BPF_CORE_READ_BITFIELD in selftest (Yonghong) v2: - A major change is to use in_bpf() to test if a setsockopt() is called by a bpf prog and use in_bpf() to skip capable check. Suggested by Stanislav. - Instead of passing is_locked through sockptr_t or through an extra argument to sk_setsockopt, v2 uses in_bpf() to skip the lock_sock() also because bpf prog has the lock acquired. - No change to the current sockptr_t in this revision - s/codes/code/ ==================== Signed-off-by: Alexei Starovoitov commit 31123c0360e01ee0389aee3a7b2ad32f13136662 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:47 2022 -0700 selftests/bpf: bpf_setsockopt tests This patch adds tests to exercise optnames that are allowed in bpf_setsockopt(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061847.4182339-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 7e41df5dbba23a78c3fd30033a6123a06e1168e7 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:41 2022 -0700 bpf: Add a few optnames to bpf_setsockopt This patch adds a few optnames for bpf_setsockopt: SO_REUSEADDR, IPV6_AUTOFLOWLABEL, TCP_MAXSEG, TCP_NODELAY, and TCP_THIN_LINEAR_TIMEOUTS. Thanks to the previous patches of this set, all additions can reuse the sk_setsockopt(), do_ipv6_setsockopt(), and do_tcp_setsockopt(). The only change here is to allow them in bpf_setsockopt. The bpf prog has been able to read all members of a sk by using PTR_TO_BTF_ID of a sk. The optname additions here can also be read by the same approach. Meaning there is a way to read the values back. These optnames can also be added to bpf_getsockopt() later with another patch set that makes the bpf_getsockopt() to reuse the sock_getsockopt(), tcp_getsockopt(), and ip[v6]_getsockopt(). Thus, this patch does not add more duplicated code to bpf_getsockopt() now. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061841.4181642-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 75b64b68ee3f9fe90ad8f21e5c5c92de58abf725 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:34 2022 -0700 bpf: Change bpf_setsockopt(SOL_IPV6) to reuse do_ipv6_setsockopt() After the prep work in the previous patches, this patch removes the dup code from bpf_setsockopt(SOL_IPV6) and reuses the implementation in do_ipv6_setsockopt(). ipv6 could be compiled as a module. Like how other code solved it with stubs in ipv6_stubs.h, this patch adds the do_ipv6_setsockopt to the ipv6_bpf_stub. The current bpf_setsockopt(IPV6_TCLASS) does not take the INET_ECN_MASK into the account for tcp. The do_ipv6_setsockopt(IPV6_TCLASS) will handle it correctly. The existing optname white-list is refactored into a new function sol_ipv6_setsockopt(). After this last SOL_IPV6 dup code removal, the __bpf_setsockopt() is simplified enough that the extra "{ }" around the if statement can be removed. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061834.4181198-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit ee7f1e1302f5cb29168f70827c12855f1d8c9845 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:26 2022 -0700 bpf: Change bpf_setsockopt(SOL_IP) to reuse do_ip_setsockopt() After the prep work in the previous patches, this patch removes the dup code from bpf_setsockopt(SOL_IP) and reuses the implementation in do_ip_setsockopt(). The existing optname white-list is refactored into a new function sol_ip_setsockopt(). NOTE, the current bpf_setsockopt(IP_TOS) is quite different from the the do_ip_setsockopt(IP_TOS). For example, it does not take the INET_ECN_MASK into the account for tcp and also does not adjust sk->sk_priority. It looks like the current bpf_setsockopt(IP_TOS) was referencing the IPV6_TCLASS implementation instead of IP_TOS. This patch tries to rectify that by using the do_ip_setsockopt(IP_TOS). While this is a behavior change, the do_ip_setsockopt(IP_TOS) behavior is arguably what the user is expecting. At least, the INET_ECN_MASK bits should be masked out for tcp. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061826.4180990-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 0c751f7071ef98d334ed06ca3f8f4cc1f7458cf5 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:19 2022 -0700 bpf: Change bpf_setsockopt(SOL_TCP) to reuse do_tcp_setsockopt() After the prep work in the previous patches, this patch removes all the dup code from bpf_setsockopt(SOL_TCP) and reuses the do_tcp_setsockopt(). The existing optname white-list is refactored into a new function sol_tcp_setsockopt(). The sol_tcp_setsockopt() also calls the bpf_sol_tcp_setsockopt() to handle the TCP_BPF_XXX specific optnames. bpf_setsockopt(TCP_SAVE_SYN) now also allows a value 2 to save the eth header also and it comes for free from do_tcp_setsockopt(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061819.4180146-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 57db31a1a3adf2a4bd42528c4ac41fb50d6be59a Author: Martin KaFai Lau Date: Tue Aug 16 23:18:12 2022 -0700 bpf: Refactor bpf specific tcp optnames to a new function The patch moves all bpf specific tcp optnames (TCP_BPF_XXX) to a new function bpf_sol_tcp_setsockopt(). This will make the next patch easier to follow. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061812.4179645-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 29003875bd5bab262a29d1c6e76a2124bd07e4c2 Author: Martin KaFai Lau Date: Tue Aug 16 23:18:04 2022 -0700 bpf: Change bpf_setsockopt(SOL_SOCKET) to reuse sk_setsockopt() After the prep work in the previous patches, this patch removes most of the dup code from bpf_setsockopt(SOL_SOCKET) and reuses them from sk_setsockopt(). The sock ptr test is added to the SO_RCVLOWAT because the sk->sk_socket could be NULL in some of the bpf hooks. The existing optname white-list is refactored into a new function sol_socket_setsockopt(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061804.4178920-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit ebf9e8e653667e834372e9435217a7bf33bec7a0 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:58 2022 -0700 bpf: Embed kernel CONFIG check into the if statement in bpf_setsockopt This patch moves the "#ifdef CONFIG_XXX" check into the "if/else" statement itself. The change is done for the bpf_setsockopt() function only. It will make the latter patches easier to follow without the surrounding ifdef macro. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061758.4178374-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 2b5a2ecbfdc507af3f2f032bfe7366fba4dabff0 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:51 2022 -0700 bpf: Initialize the bpf_run_ctx in bpf_iter_run_prog() The bpf-iter-prog for tcp and unix sk can do bpf_setsockopt() which needs has_current_bpf_ctx() to decide if it is called by a bpf prog. This patch initializes the bpf_run_ctx in bpf_iter_run_prog() for the has_current_bpf_ctx() to use. Acked-by: Andrii Nakryiko Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061751.4177657-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 40cd308ea57cf68ad67f912b98fca570d107cca0 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:44 2022 -0700 bpf: net: Change do_ipv6_setsockopt() to use the sockopt's lock_sock() and capable() Similar to the earlier patch that avoids sk_setsockopt() from taking sk lock and doing capable test when called by bpf. This patch changes do_ipv6_setsockopt() to use the sockopt_{lock,release}_sock() and sockopt_[ns_]capable(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061744.4176893-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 1df055d3c7d91878fe7eaa61c1c228c03d4a92b7 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:37 2022 -0700 bpf: net: Change do_ip_setsockopt() to use the sockopt's lock_sock() and capable() Similar to the earlier patch that avoids sk_setsockopt() from taking sk lock and doing capable test when called by bpf. This patch changes do_ip_setsockopt() to use the sockopt_{lock,release}_sock() and sockopt_[ns_]capable(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061737.4176402-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit cb388e7ee3a824250a66b854adae9f03b70956f1 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:30 2022 -0700 bpf: net: Change do_tcp_setsockopt() to use the sockopt's lock_sock() and capable() Similar to the earlier patch that avoids sk_setsockopt() from taking sk lock and doing capable test when called by bpf. This patch changes do_tcp_setsockopt() to use the sockopt_{lock,release}_sock() and sockopt_[ns_]capable(). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061730.4176021-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit e42c7beee71d0d84a6193357e3525d0cf2a3e168 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:23 2022 -0700 bpf: net: Consider has_current_bpf_ctx() when testing capable() in sk_setsockopt() When bpf program calling bpf_setsockopt(SOL_SOCKET), it could be run in softirq and doesn't make sense to do the capable check. There was a similar situation in bpf_setsockopt(TCP_CONGESTION). In commit 8d650cdedaab ("tcp: fix tcp_set_congestion_control() use from bpf hook"), tcp_set_congestion_control(..., cap_net_admin) was added to skip the cap check for bpf prog. This patch adds sockopt_ns_capable() and sockopt_capable() for the sk_setsockopt() to use. They will consider the has_current_bpf_ctx() before doing the ns_capable() and capable() test. They are in EXPORT_SYMBOL for the ipv6 module to use in a latter patch. Suggested-by: Stanislav Fomichev Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061723.4175820-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 24426654ed3ae83d1127511891fb782c54f49203 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:17 2022 -0700 bpf: net: Avoid sk_setsockopt() taking sk lock when called from bpf Most of the code in bpf_setsockopt(SOL_SOCKET) are duplicated from the sk_setsockopt(). The number of supported optnames are increasing ever and so as the duplicated code. One issue in reusing sk_setsockopt() is that the bpf prog has already acquired the sk lock. This patch adds a has_current_bpf_ctx() to tell if the sk_setsockopt() is called from a bpf prog. The bpf prog calling bpf_setsockopt() is either running in_task() or in_serving_softirq(). Both cases have the current->bpf_ctx initialized. Thus, the has_current_bpf_ctx() only needs to test !!current->bpf_ctx. This patch also adds sockopt_{lock,release}_sock() helpers for sk_setsockopt() to use. These helpers will test has_current_bpf_ctx() before acquiring/releasing the lock. They are in EXPORT_SYMBOL for the ipv6 module to use in a latter patch. Note on the change in sock_setbindtodevice(). sockopt_lock_sock() is done in sock_setbindtodevice() instead of doing the lock_sock in sock_bindtoindex(..., lock_sk = true). Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061717.4175589-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit 4d748f9916076399f01c259d30fe1b88abe8f622 Author: Martin KaFai Lau Date: Tue Aug 16 23:17:11 2022 -0700 net: Add sk_setsockopt() to take the sk ptr instead of the sock ptr A latter patch refactors bpf_setsockopt(SOL_SOCKET) with the sock_setsockopt() to avoid code duplication and code drift between the two duplicates. The current sock_setsockopt() takes sock ptr as the argument. The very first thing of this function is to get back the sk ptr by 'sk = sock->sk'. bpf_setsockopt() could be called when the sk does not have the sock ptr created. Meaning sk->sk_socket is NULL. For example, when a passive tcp connection has just been established but has yet been accept()-ed. Thus, it cannot use the sock_setsockopt(sk->sk_socket) or else it will pass a NULL ptr. This patch moves all sock_setsockopt implementation to the newly added sk_setsockopt(). The new sk_setsockopt() takes a sk ptr and immediately gets the sock ptr by 'sock = sk->sk_socket' The existing sock_setsockopt(sock) is changed to call sk_setsockopt(sock->sk). All existing callers have both sock->sk and sk->sk_socket pointer. The latter patch will make bpf_setsockopt(SOL_SOCKET) call sk_setsockopt(sk) directly. The bpf_setsockopt(SOL_SOCKET) does not use the optnames that require sk->sk_socket, so it will be safe. Reviewed-by: Stanislav Fomichev Signed-off-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220817061711.4175048-1-kafai@fb.com Signed-off-by: Alexei Starovoitov commit a9f08ad7adb3d2f90e11efbb40a1246ef95b0c04 Author: Wolfram Sang Date: Thu Aug 18 15:05:06 2022 -0700 Input: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com Signed-off-by: Dmitry Torokhov commit 6a079903847cce1dd06345127d2a32f26d2cd9c6 Author: Matthew Brost Date: Tue Aug 16 19:05:11 2022 -0700 drm/i915/guc: Add delay to disable scheduling after pin count goes to zero Add a delay, configurable via debugfs (default 34ms), to disable scheduling of a context after the pin count goes to zero. Disable scheduling is a costly operation as it requires synchronizing with the GuC. So the idea is that a delay allows the user to resubmit something before doing this operation. This delay is only done if the context isn't closed and less than a given threshold (default is 3/4) of the guc_ids are in use. As temporary WA disable this feature for the selftests. Selftests are very timing sensitive and any change in timing can cause failure. A follow up patch will fixup the selftests to understand this delay. Alan Previn: Matt Brost first introduced this series back in Oct 2021. However no real world workload with measured performance impact was available to prove the intended results. Today, this series is being republished in response to a real world workload that benefited greatly from it along with measured performance improvement. Workload description: 36 containers were created on a DG2 device where each container was performing a combination of 720p 3d game rendering and 30fps video encoding. The workload density was configured in a way that guaranteed each container to ALWAYS be able to render and encode no less than 30fps with a predefined maximum render + encode latency time. That means the totality of all 36 containers and their workloads were not saturating the engines to their max (in order to maintain just enough headrooom to meet the min fps and max latencies of incoming container submissions). Problem statement: It was observed that the CPU core processing the i915 soft IRQ work was experiencing severe load. Using tracelogs and an instrumentation patch to count specific i915 IRQ events, it was confirmed that the majority of the CPU cycles were caused by the gen11_other_irq_handler() -> guc_irq_handler() code path. The vast majority of the cycles was determined to be processing a specific G2H IRQ: i.e. INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE. These IRQs are sent by GuC in response to i915 KMD sending H2G requests: INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_SET. Those H2G requests are sent whenever a context goes idle so that we can unpin the context from GuC. The high CPU utilization % symptom was limiting density scaling. Root Cause Analysis: Because the incoming execution buffers were spread across 36 different containers (each with multiple contexts) but the system in totality was NOT saturated to the max, it was assumed that each context was constantly idling between submissions. This was causing a thrashing of unpinning contexts from GuC at one moment, followed quickly by repinning them due to incoming workload the very next moment. These event-pairs were being triggered across multiple contexts per container, across all containers at the rate of > 30 times per sec per context. Metrics: When running this workload without this patch, we measured an average of ~69K INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE events every 10 seconds or ~10 million times over ~25+ mins. With this patch, the count reduced to ~480 every 10 seconds or about ~28K over ~10 mins. The improvement observed is ~99% for the average counts per 10 seconds. Signed-off-by: Matthew Brost Signed-off-by: Alan Previn Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220817020511.2180747-3-alan.previn.teres.alexis@intel.com commit 61faec5fa66cbd1afcd5074f168f09529f8119bf Author: Matthew Brost Date: Tue Aug 16 19:05:10 2022 -0700 drm/i915/selftests: Use correct selfest calls for live tests This will help in an upcoming patch where the live selftest wrappers are extended to do more. Signed-off-by: Matthew Brost Signed-off-by: Alan Previn Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220817020511.2180747-2-alan.previn.teres.alexis@intel.com commit 1a8912caba02522f612d465a4849ce98915b96ad Author: Prashant Malani Date: Tue Aug 16 21:48:35 2022 +0000 platform/chrome: cros_ec_typec: Get retimer handle Where available, obtain the handle to retimer switch specified via firmware, and update the mux configuration callsites to add retimer support for supported modes. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-8-pmalani@chromium.org commit d5f66527db9e0e6a871d9005200b3394156cf16f Author: Prashant Malani Date: Tue Aug 16 21:48:34 2022 +0000 platform/chrome: cros_ec_typec: Cleanup switch handle return paths Some of the return paths for the cros_typec_get_switch_handles() aren't necessary. Clean up the return paths to only undo the handle get's which succeeded. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-7-pmalani@chromium.org commit 9e6e05169980e83a870dd595012ec014a5fc440c Author: Prashant Malani Date: Tue Aug 16 21:48:33 2022 +0000 platform/chrome: cros_typec_switch: Register mode switches Register mode switch devices for Type-C connectors, when they are specified by firmware. These control Type-C configuration for any USB Type-C mode switches (sometimes known as "muxes") which are controlled by the ChromeOS EC. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-6-pmalani@chromium.org commit cf6c767244ed599492ac4275d1d94435d9ec7917 Author: Prashant Malani Date: Tue Aug 16 21:48:32 2022 +0000 platform/chrome: cros_typec_switch: Add event check The ChromeOS EC updates Type-C status events when mux set requests from the Application Processor (AP) are completed. Add a check to the flow of configuring muxes to look for this status done bit, so that the driver is aware that the mux set completed successfully or not. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-5-pmalani@chromium.org commit d4536a216c3f8ea0abcf90110750eb297ce48b45 Author: Prashant Malani Date: Tue Aug 16 21:48:31 2022 +0000 platform/chrome: cros_typec_switch: Set EC retimer Invoke ChromeOS EC host commands to set EC-controlled retimer switches to the state the Type-C framework instructs. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-4-pmalani@chromium.org commit affc804c44c8259ae53423aa3b5c20907e3a9a34 Author: Prashant Malani Date: Tue Aug 16 21:48:30 2022 +0000 platform/chrome: cros_typec_switch: Add switch driver Introduce a driver to configure USB Type-C mode switches and retimers which are controlled by the ChromeOS EC (Embedded Controller). This allows Type-C port drivers, as well as alternate mode drivers to configure their relevant mode switches and retimers according to the Type-C state they want to achieve. ACPI devices with ID GOOG001A will bind to this driver. Currently, we only register a retimer switch with a stub set function. Subsequent patches will implement the host command set functionality, and introduce mode switches. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-3-pmalani@chromium.org commit 77947238dad3b83bbe085ebcd576ea55afb70425 Author: Prashant Malani Date: Tue Aug 16 21:48:29 2022 +0000 platform/chrome: Add Type-C mux set command definitions Copy EC header definitions for the USB Type-C Mux control command from the EC code base. Also pull in "TBT_UFP_REPLY" definitions, since that is the prior entry in the enum. These headers are already present in the EC code base. [1] [1] https://chromium.googlesource.com/chromiumos/platform/ec/+/b80f85a94a423273c1638ef7b662c56931a138dd/include/ec_commands.h Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-2-pmalani@chromium.org commit 565736048bd5f9888990569993c6b6bfdf6dcb6d Author: Jeff Daly Date: Thu Jul 21 10:10:30 2022 -0400 ixgbe: Manual AN-37 for troublesome link partners for X550 SFI Some (Juniper MX5) SFP link partners exhibit a disinclination to autonegotiate with X550 configured in SFI mode. This patch enables a manual AN-37 restart to work around the problem. Signed-off-by: Jeff Daly Tested-by: Dave Switzer Signed-off-by: Tony Nguyen commit aa447a8734f12f78a1ee6cd611e277cd4c33d773 Merge: fb8d784b531e3 9ecf04016c87b Author: Jakub Kicinski Date: Thu Aug 18 14:16:36 2022 -0700 Merge branch 'add-dt-property-to-disable-hibernation-mode' Wei Fang says: ==================== Add DT property to disable hibernation mode The patches add the ability to disable the hibernation mode of AR803x PHYs. Hibernation mode defaults to enabled after hardware reset on these PHYs. If the AR803x PHYs enter hibernation mode, they will not provide any clock. For some MACs, they might need the clocks which provided by the PHYs to support their own hardware logic. So, the patches add the support to disable hibernation mode by adding a boolean: qca,disable-hibernation-mode If one wished to disable hibernation mode to better match with the specifical MAC, just add this property in the phy node of DT. ==================== Link: https://lore.kernel.org/r/20220818030054.1010660-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski commit 9ecf04016c87bcb33b44e24489d33618e2592f41 Author: Wei Fang Date: Thu Aug 18 11:00:54 2022 +0800 net: phy: at803x: add disable hibernation mode support When the cable is unplugged, the Atheros AR803x PHYs will enter hibernation mode after about 10 seconds if the hibernation mode is enabled and will not provide any clock to the MAC. But for some MACs, this feature might cause unexpected issues due to the logic of MACs. Taking SYNP MAC (stmmac) as an example, if the cable is unplugged and the "eth0" interface is down, the AR803x PHY will enter hibernation mode. Then perform the "ifconfig eth0 up" operation, the stmmac can't be able to complete the software reset operation and fail to init it's own DMA. Therefore, the "eth0" interface is failed to ifconfig up. Why does it cause this issue? The truth is that the software reset operation of the stmmac is designed to depend on the RX_CLK of PHY. So, this patch offers an option for the user to determine whether to disable the hibernation mode of AR803x PHYs. Signed-off-by: Wei Fang Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 2e7f089914b94450d4c3b6408e22af3f016fc332 Author: Wei Fang Date: Thu Aug 18 11:00:53 2022 +0800 dt-bindings: net: ar803x: add disable-hibernation-mode propetry The hibernation mode of Atheros AR803x PHYs defaults to be enabled after hardware reset. When the cable is unplugged, the PHY will enter hibernation mode after about 10 seconds and the PHY clocks will be stopped to save power. However, some MACs need the phy output clock for proper functioning of their logic. For instance, stmmac needs the RX_CLK of PHY for software reset to complete. Therefore, add a DT property to configure the PHY to disable this hardware hibernation mode. Signed-off-by: Wei Fang Reviewed-by: Rob Herring Signed-off-by: Jakub Kicinski commit 789f3fa9dca071c95350583c34a70afec8afc51d Merge: 568035b01cfb1 fbd92809997a3 Author: Palmer Dabbelt Date: Thu Aug 18 13:40:51 2022 -0700 Merge tag 'riscv-topo-on-6.0-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ into for-next Fix RISC-V's topology reporting The goal here is the fix the incorrectly reported arch topology on RISC-V which seems to have been broken since it was added. cpu, package and thread IDs are all currently reported as -1, so tools like lstopo think systems have multiple threads on the same core when this is not true: https://github.com/open-mpi/hwloc/issues/536 arm64's topology code basically applies to RISC-V too, so it has been made generic along with the removal of MPIDR related code, which appears to be redudant code since '3102bc0e6ac7 ("arm64: topology: Stop using MPIDR for topology information")' replaced the code that actually interacted with MPIDR with default values. * tag 'riscv-topo-on-6.0-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/: riscv: topology: fix default topology reporting arm64: topology: move store_cpu_topology() to shared code commit ad57410d231da1fff3f53ff42ebcdc6d388e21d1 Author: Ray Hung Date: Thu Aug 4 19:08:36 2022 +0800 usb: gadget: rndis: use %u instead of %d to print u32 values The driver uses the %d format to print u32 values. The correct format is %u. Fix it. Signed-off-by: Ray Hung Link: https://lore.kernel.org/r/20220804110836.138614-1-tw.rayhung@gmail.com Signed-off-by: Greg Kroah-Hartman commit 35a78bb83c310dd042b0a7fb8f397ed8973b768f Author: Colin Ian King Date: Wed Aug 3 13:30:18 2022 +0100 usb: typec: ucsi: stm32g0: Fix spelling mistake "booloader" -> "bootloader" There is a spelling mistake in a dev_err_probe message. Fix it. Reviewed-by: Heikki Krogerus Reviewed-by: Fabrice Gasnier Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220803123018.913710-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit c2a8ea5997fdfeb43eda259d5533234c3cae05d7 Author: ChiYuan Huang Date: Mon Aug 15 17:01:20 2022 +0800 usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver The MediaTek MT6370 is a highly-integrated smart power management IC, which includes a single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C & Power Delivery (PD) controller, dual Flash LED current sources, a RGB LED driver, a backlight WLED driver, a display bias driver and a general LDO for portable devices. Add support for the Type-C & Power Delivery controller in MediaTek MT6370 IC. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Guenter Roeck Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Link: https://lore.kernel.org/r/20220815090125.27705-8-peterwu.pub@gmail.com Signed-off-by: Greg Kroah-Hartman commit c82c2e5c7ad896a60d5b219a1aec185eb6116d4f Author: ChiYuan Huang Date: Mon Aug 15 17:01:14 2022 +0800 dt-bindings: usb: Add MediaTek MT6370 TCPC Add MediaTek MT6370 TCPC binding documentation. Reviewed-by: Krzysztof Kozlowski Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Link: https://lore.kernel.org/r/20220815090125.27705-2-peterwu.pub@gmail.com Signed-off-by: Greg Kroah-Hartman commit d80f4ecb95270d0ecd6646aca44f4c180d3140b0 Author: Christophe JAILLET Date: Tue Aug 9 22:28:42 2022 +0200 usb: common: usb-conn-gpio: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Reviewed-by: Chunfeng Yun Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/7505a9dfa1e097070c492d6f6f84afa2a490b040.1659763173.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 47931796aad522f96df3620b8c387073d67c2332 Author: Dmitry Baryshkov Date: Tue Jul 26 23:53:55 2022 +0300 ARM: dts: qcom: msm8974: add rpm-stats device node Add device node for the rpm-stats pseudo device. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220726205355.598874-2-dmitry.baryshkov@linaro.org commit 2850335673378a54d27e215bae6ac49f65f00a28 Author: Dmitry Baryshkov Date: Tue Jul 26 23:53:54 2022 +0300 ARM: dts: qcom: apq8084: add rpm-stats device node Add device node for the rpm-stats pseudo device. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220726205355.598874-1-dmitry.baryshkov@linaro.org commit 1c46589d4ec04c9691e984eab3a42f36788dced1 Author: David Heidelberg Date: Fri Jul 8 11:04:31 2022 +0200 dt-bindings: firmware: convert Qualcomm SCM binding to the yaml Convert Qualcomm SCM firmware binding to the yaml format. This commit also: - adds qcom,scm-mdm9607 into list which has only core clock - adds qcom,scm-sm6125, qcom,scm-ipq6018 - #reset-cells, because the property is already used Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Acked-by: Guru Das Srinagesh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220708090431.30437-1-david@ixit.cz commit 5257841aaa8c6c39df7cfac30d72783a1c57563a Author: Konrad Dybcio Date: Sat Jul 23 12:02:25 2022 +0200 soc: qcom: socinfo: Add PM6125 ID PM6125 has the ID 45. Add it. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220723100225.92053-2-konrad.dybcio@somainline.org commit fd40048901d20b81ab84fb151b16f82afca57d56 Author: Konrad Dybcio Date: Sat Jul 23 12:02:24 2022 +0200 soc: qcom: socinfo: Add an ID for SM6375 Add an ID for SM6375, also known as BLAIR. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220723100225.92053-1-konrad.dybcio@somainline.org commit 90681f53b9381c23ff7762a3b13826d620c272de Author: Liang He Date: Thu Jul 21 21:52:17 2022 +0800 soc: qcom: smem_state: Add refcounting for the 'state->of_node' In qcom_smem_state_register() and qcom_smem_state_release(), we should better use of_node_get() and of_node_put() for the reference creation and destruction of 'device_node'. Fixes: 9460ae2ff308 ("soc: qcom: Introduce common SMEM state machine code") Signed-off-by: Liang He Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220721135217.1301039-2-windhl@126.com commit af8f6f39b8afd772fda4f8e61823ef8c021bf382 Author: Liang He Date: Thu Jul 21 21:52:16 2022 +0800 soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe() There are two refcount leak bugs in qcom_smsm_probe(): (1) The 'local_node' is escaped out from for_each_child_of_node() as the break of iteration, we should call of_node_put() for it in error path or when it is not used anymore. (2) The 'node' is escaped out from for_each_available_child_of_node() as the 'goto', we should call of_node_put() for it in goto target. Fixes: c97c4090ff72 ("soc: qcom: smsm: Add driver for Qualcomm SMSM") Signed-off-by: Liang He Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220721135217.1301039-1-windhl@126.com commit 14af4ce084b5fb86f7a01167f54ec8517966b804 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:46 2022 +0200 soc: qcom: icc-bwmon: add support for SDM845 LLCC BWMON The SDM845 comes with few instances of Bandwidth Monitor. The already supported one monitors traffic between CPU and Last Level Cache Controller (LLCC) and in downstream sources is called BWMON v4 (or v4 of register layout). SDM845 also has also BWMON instance measuring traffic between LLCC and memory with different register layout: called v5. Add support for this "LLCC" BWMON. Differences against existing v4 one: 1. No global interrupts. 2. Different register layout. 3. Different shift of interrupt fields. 4. Smaller sampling window. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-10-krzysztof.kozlowski@linaro.org commit e6f34184dd012c627e402182688d459d482c8544 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:45 2022 +0200 soc: qcom: icc-bwmon: add per-variant quirks BWMON v5 lacks global interrupt registers. Other BWMON versions differ as well, so add quirks for easier customization of code flow. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-9-krzysztof.kozlowski@linaro.org commit ec63dcd3c863bf966b7a222b1a6465b4a55a30b1 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:44 2022 +0200 soc: qcom: icc-bwmon: use regmap and prepare for BWMON v5 Refactor the code to prepare it for supporting BWMON v5 which comes with different register layout by: 1. Adding use of MMIO regmap and regmap fields which allows to keep one code logic with different register maps. 2. The "clear" type registers do not allow reading, therefore regmap requires using cache with default values. 3. regmap has an effect of introducing barriers after each readl/writel, which should negligible effect as only few writes were relaxed. 4. Additionally usage of regmap fields removes need of shifting the register values. 5. Add "V4" prefix to names of all defines with register addresses (so BWMON_V4_xxx) to differentiate it from V5. The actual register values are shared so keep their naming. 6. While changing the defines, pad register addresses to three digits for readability. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-8-krzysztof.kozlowski@linaro.org commit 650db9fa2c540b860fce547514e305fbee01aa2d Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:43 2022 +0200 soc: qcom: icc-bwmon: store count unit per variant Versions v4 and v5 of BWMON on SDM845 use different unit count, so allow easier variant customization by storing its value in struct icc_bwmon_data. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sibi Sankar Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-7-krzysztof.kozlowski@linaro.org commit 956deab551b099b52c99f956539a3c8a1c3c34e6 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:42 2022 +0200 soc: qcom: icc-bwmon: clear all registers on init The hardware programming guide recommends to clear all registers on first initialization, through separate field in BWMON_CLEAR register. This makes sense in general but especially if driver is rebound to avoid spurious/early interrupts. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-6-krzysztof.kozlowski@linaro.org commit 1dd5246ea6ba66b3e926eb13528fdfaf63211c65 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:41 2022 +0200 soc: qcom: icc-bwmon: store reference to variant data in container Instead of copying pieces of variant-specific data (struct icc_bwmon_data) into the state container (struct icc_bwmon), just store a pointer to it. This simplifies a bit the code and allows later to grow easily the variant-specific data for new BWMON v5. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sibi Sankar Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-5-krzysztof.kozlowski@linaro.org commit 2b5d8b02f5acdf5f4b2ef42ec0a082b7e1fb7eac Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:40 2022 +0200 soc: qcom: icc-bwmon: drop unused registers BWMON_GLOBAL_IRQ_STATUS and BWMON_ZONE_COUNT defines are not used. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sibi Sankar Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-4-krzysztof.kozlowski@linaro.org commit 6356c7bb5383c1e65cd718d94392fdc8cfa79fc8 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:39 2022 +0200 soc: qcom: icc-bwmon: re-use IRQ enable/clear define The interrupt enable, status and clear registers have the same layout, so BWMON_GLOBAL_IRQ_ENABLE_ENABLE define can be used also for clearing IRQ, instead of hard-coded value. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sibi Sankar Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-3-krzysztof.kozlowski@linaro.org commit 3098fcb14e08597b1026102dc24e24ce2c689dfb Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:38 2022 +0200 dt-bindings: interconnect: qcom,msm8998-bwmon: add support for SDM845 LLCC BWMON Add compatible for SDM845 Bandwidth Monitor instance measuring traffic between LLCC and memory. It comes with different register layout: called v5. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Sibi Sankar Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-2-krzysztof.kozlowski@linaro.org commit 10fa117bfc0a9ba5f38a36fa59ccd4e1e36a2b7f Author: Krzysztof Kozlowski Date: Wed Jul 27 08:58:29 2022 +0200 ARM: qcom: include defconfig in MAINTAINERS The ARM Qualcomm entry should cover also its defconfig. Signed-off-by: Krzysztof Kozlowski Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220727065830.10681-5-krzysztof.kozlowski@linaro.org commit 1c25ca9bb5c5bffbb0348a96b1bcd16e4c3be195 Author: Krzysztof Kozlowski Date: Wed Jul 27 08:58:27 2022 +0200 ARM: multi_v7_defconfig: enable more Qualcomm drivers Enable Qualcomm drivers: 1. Command DB (used in SDX55 and SDX65). 2. On Chip Memory - OCMEM (used in MSM8974) 3. RPMh and RPMh Power domain (used in SDX55 and SDX65). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220727065830.10681-3-krzysztof.kozlowski@linaro.org commit 9ada42afdafcc640f3687ce613ade6d6df2bc476 Author: Krzysztof Kozlowski Date: Wed Jul 27 08:58:26 2022 +0200 ARM: qcom_defconfig: enable more Qualcomm drivers Enable Qualcomm drivers: 1. socinfo driver to provide some basic information about the SoC being used. 2. Remote filesystem memory driver (used in MSM8974). 3. RPM Power domain (used in MSM8226). 4. Sleep stats driver (used in MSM8916, MSM8974 and APQ8084). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220727065830.10681-2-krzysztof.kozlowski@linaro.org commit f6d373ff2899563ba62c7232c0a07f709adaf7b6 Author: Johan Hovold Date: Fri Aug 5 14:12:50 2022 +0200 clk: gcc-sc8280xp: keep USB power-domains always-on The Qualcomm DWC3 driver suspend implementation appears to be incomplete for SC8280XP so keep the USB power domains always-on for now so that the controller survives a suspend cycle. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805121250.10347-3-johan+linaro@kernel.org commit 12d2a4769380f0dc9ba6f827839869db2b81ef00 Author: Johan Hovold Date: Fri Aug 5 14:12:49 2022 +0200 clk: gcc-sc8280xp: keep PCIe power-domains always-on The Qualcomm PCIe driver does not yet implement suspend so to keep the PCIe power domains always-on for now to avoid crashing during resume. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805121250.10347-2-johan+linaro@kernel.org commit 6a09ffaed7655446a7421c6ec02562eb91162865 Author: Krzysztof Kozlowski Date: Wed Jul 27 08:58:28 2022 +0200 arm64: defconfig: enable more Qualcomm drivers Enable Qualcomm drivers: 1. Last Level Cache Controller (many platforms supported). 2. On Chip Memory - OCMEM (used in MSM8992 and MSM8994) 3. Subsystem Power Manager - SPM (used in MSM8916 and SDM660). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220727065830.10681-4-krzysztof.kozlowski@linaro.org commit fb8d784b531e363171c7e22f4f0980b4b128a607 Author: Maxime Chevallier Date: Wed Aug 17 11:57:25 2022 +0200 net: ethernet: altera: Add use of ethtool_op_get_ts_info Add the ethtool_op_get_ts_info() callback to ethtool ops, so that we can at least use software timestamping. Signed-off-by: Maxime Chevallier Link: https://lore.kernel.org/r/20220817095725.97444-1-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski commit e72b3b9810dd2cb6d057dce8666e12f4f8f2ccdf Author: Konstantin Ryabitsev Date: Mon Aug 8 17:31:53 2022 -0400 maintainer-pgp-guide: minor wording tweaks Tweak some wording to remove redundant information. Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20220727-docs-pgp-guide-v2-5-e3e6954affb6@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 6043134dcedb4fb74e57858bca913a8117478ac0 Author: Konstantin Ryabitsev Date: Mon Aug 8 17:31:52 2022 -0400 maintainer-pgp-guide: add a section on PGP-signed patches With more developers beginning to use b4 and patatt, add a section to the guide that talks about setting up and using patatt for PGP-signing patch submissions. Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20220727-docs-pgp-guide-v2-4-e3e6954affb6@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 0a1a279bdade0230f5021fa8d9e8a71d3de2e859 Author: Konstantin Ryabitsev Date: Mon Aug 8 17:31:51 2022 -0400 maintainer-pgp-guide: update ECC support information Update ECC sections with the latest details, now that Yubikeys are able to support ED25519 curves. Tweak a few links to smartcard devices to reflect the latest URL changes. Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20220727-docs-pgp-guide-v2-3-e3e6954affb6@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 7d61aa2cbd62d57a6a3ac5a7635686320f5ded9b Author: Konstantin Ryabitsev Date: Mon Aug 8 17:31:50 2022 -0400 maintainer-pgp-guide: remove keyserver instructions Keyservers are largely a thing of the past with the replacement systems like keys.openpgp.net specifically designed to offer no support for the web of trust. Remove all sections that talk about keyservers and add a small section with the link to kernel.org documentation that talks about using the kernel.org public key repository. Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20220727-docs-pgp-guide-v2-2-e3e6954affb6@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 97024e159ff5ab9a1d1a769d351184fadffebfe7 Author: Konstantin Ryabitsev Date: Mon Aug 8 17:31:49 2022 -0400 maintainer-pgp-guide: use key terminology consistent with upstream GnuPG does not use the word "master key" when referring to the subkey marked with the "certification" capability. Our use of this term was not only inconsistent, but also misleading, because in real life "master keys" are able to open multiple locks made for different keys, while PGP Certify key has no such capability. Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20220727-docs-pgp-guide-v2-1-e3e6954affb6@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 74a3c2aefe04f381ca14d0e589c62edd4af94b4c Author: Eric Lin Date: Thu Aug 11 17:15:16 2022 +0800 Documentation: irqdomain: Fix typo of "at least once" Signed-off-by: Eric Lin Link: https://lore.kernel.org/r/20220811091516.2107908-1-dslin1010@gmail.com Signed-off-by: Jonathan Corbet commit 23c48a124b469cee2eb0c75e6d22d366d1caa118 Author: Yanteng Si Date: Wed Aug 17 10:08:30 2022 +0800 docs/zh_CN: Update the translation of gpio to 6.0-rc1 Update to commit 5513b411ea5b ("Documentation: rename pinctl to pin-control") Move .../zh_CN/gpio.txt to .../zh_CN/driver-api/gpio/legacy.rst Translate .../driver-api/index.rst into Chinese. Translate .../driver-api/gpio/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/20220817020830.799468-1-siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 03f51719df032637250af828f9a1ffcc5695982d Author: Fabio M. De Francesco Date: Mon Jul 4 16:01:29 2022 +0200 ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why there is no need to call kmap() on them. Therefore, don't call kmap() on rx_buffer->page() and instead use a plain page_address() to get the kernel address. Suggested-by: Ira Weiny Suggested-by: Alexander Duyck Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny Reviewed-by: Alexander Duyck Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 5c603001d782f0d33b9d6c12e72ca86116e10b4f Author: Mikael Barsehyan Date: Fri Aug 12 18:07:49 2022 +0200 ice: remove non-inclusive language Remove non-inclusive language from the driver where possible; replace "master" with "primary"; replace "slave" with "secondary". Signed-off-by: Mikael Barsehyan Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit e1e9db57c05b830f1e3fde4d7d30674a43b06c8b Author: Sylwester Dziedziuch Date: Wed Jul 27 14:35:49 2022 +0200 ice: Remove ucast_shared Remove ucast_shared as it was always true. Remove the code depending on ucast_shared from ice_add_mac and ice_remove_mac. Remove ice_find_ucast_rule_entry function as it was only used when ucast_shared was set to false. Signed-off-by: Sylwester Dziedziuch Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 39ed02a4ba5270ee3e0556ec08ceac6e76a1dfc4 Author: Anirudh Venkataramanan Date: Fri Aug 12 16:36:07 2022 +0200 ice: Allow 100M speeds for some devices For certain devices, 100M speeds are supported. Do not mask off 100M speed for these devices. Signed-off-by: Anirudh Venkataramanan Co-developed-by: Chinh T Cao Signed-off-by: Chinh T Cao Signed-off-by: Mikael Barsehyan Tested-by: Kavya AV (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit affa1029d66f0fc2bb3614ead2166637c1371aad Author: Anatolii Gerasymenko Date: Wed Jul 27 09:24:06 2022 +0200 ice: Implement FCS/CRC and VLAN stripping co-existence policy Make sure that only the valid combinations of FCS/CRC stripping and VLAN stripping offloads are allowed. You cannot have FCS/CRC stripping disabled while VLAN stripping is enabled - this breaks the correctness of the FCS/CRC. If administrator tries to enable VLAN stripping when FCS/CRC stripping is disabled, the request should be rejected. If administrator tries to disable FCS/CRC stripping when VLAN stripping is enabled, the request should be rejected if VLANs are configured. If there is no VLAN configured, then both FCS/CRC and VLAN stripping should be disabled. Testing Hints: The default settings after driver load are: - VLAN C-Tag offloads are enabled - VLAN S-Tag offloads are disabled - FCS/CRC stripping is enabled Restore the default settings before each test with the command: ethtool -K eth0 rx-fcs off rxvlan on txvlan on rx-vlan-stag-hw-parse off tx-vlan-stag-hw-insert off Test 1: Disable FCS/CRC and VLAN stripping: ethtool -K eth0 rx-fcs on rxvlan off Try to enable VLAN stripping: ethtool -K eth0 rxvlan on Expected: VLAN stripping request is rejected Test 2: Try to disable FCS/CRC stripping: ethtool -K eth0 rx-fcs on Expected: VLAN stripping is also disabled, as there are no VLAN configured Test 3: Add a VLAN: ip link add link eth0 eth0.42 type vlan id 42 ip link set eth0 up Try to disable FCS/CRC stripping: ethtool -K eth0 rx-fcs on Expected: FCS/CRC stripping request is rejected Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit dddd406d9dbe4a94919b377a84b696e97f709379 Author: Jesse Brandeburg Date: Wed Jul 27 09:24:05 2022 +0200 ice: Implement control of FCS/CRC stripping The driver can allow the user to configure whether the CRC aka the FCS (Frame Check Sequence) is DMA'd to the host as part of the receive buffer. The driver usually wants this feature disabled so that the hardware checks the FCS and strips it in order to save PCI bandwidth. Control the reception of FCS to the host using the command: ethtool -K eth0 rx-fcs The default shown in ethtool -k eth0 | grep fcs; should be "off", as the hardware will drop any frame with a bad checksum, and DMA of the checksum is useless overhead especially for small packets. Testing Hints: test the FCS/CRC arrives with received packets using tcpdump -nnpi eth0 -xxxx and it should show crc data as the last 4 bytes of the packet. Can also use wireshark to turn on CRC checking and check the data is correct. Signed-off-by: Jesse Brandeburg Co-developed-by: Grzegorz Nitka Signed-off-by: Grzegorz Nitka Co-developed-by: Benjamin Mikailenko Signed-off-by: Benjamin Mikailenko Co-developed-by: Anatolii Gerasymenko Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 6fd09c9afa49b343d17cecedd7879d097f37f2a9 Author: Arnd Bergmann Date: Tue Jul 26 14:16:37 2022 +0200 ARM: Kconfig: clean up platform selection The top-level platform selection is mostly meaningless these days after almost everything is sorted below the CONFIG_ARCH_MULTIPLATFORM, with the only exception being the 20+ year old StrongARM based machines. Make this more consistent by removing the entire choice statement and moving the StrongARM specific options into regular platform specific Kconfig files. The three platforms (footbridge, rpc and sa1100) are still mutually exclusive and cannot coexist with other ARMv4/v5 machines, but since there are only three of them and we will not add more, this can be expressed using Kconfig 'depends on' statements. Signed-off-by: Arnd Bergmann commit 8c7d29a75397198154f66541c2af18a8feccac42 Author: Arnd Bergmann Date: Wed Jul 27 11:53:02 2022 +0200 ARM: simplify machdirs/platdirs handling There is only one plat-* directory left, and the MACHINE variable is only used for the mach/*.h header path. Simplify this by removing the checks for ARCH_MULTIPLATFORM and ARM_SINGLE_ARMV7M, and just adding the include directories for the remaining three platforms manually. Signed-off-by: Arnd Bergmann commit 92481c7d14b8030418f00c4b4ec65556565d892d Author: Arnd Bergmann Date: Wed Jul 27 09:26:45 2022 +0200 ARM: remove obsolete Makefile.boot infrastructure There are a number of old Makefile.boot files that remain from the multiplatform conversion, and three that are still in use. These provide the "ZRELADDR", "PARAMS_PHYS" and "INITRD_PHYS" values that are platform specific. It turns out that we can generally just derive this from information that is available elsewhere: - ZRELADDR is normally detected at runtime with the CONFIG_AUTO_ZRELADDR flag, but also needed to be passed to for 'make uImage'. In a multiplatform kernel, one always has to pass this as the $(LOADADDR) variable, but in the StrongARM kernels we can derive it from the sum of $(CONFIG_PHYS_OFFSET) and $(TEXT_OFFSET) that are already known. - PARAMS_PHYS and INITRD_PHYS are only used for bootpImage, which in turn is only used for the pre-ATAGS 'param_struct' based boot interface on StrongARM based machines with old boot loaders. They can both be derived from CONFIG_PHYS_OFFSET and a machine specific offset for the initrd, so all of the logic for these can be part of arch/arm/boot/bootp/Makefile. Signed-off-by: Arnd Bergmann commit 9d08f700ab78fd96cbe5922c261051743cb9c86e Author: Cristian Ciocaltea Date: Thu Aug 18 04:00:59 2022 +0300 spi: amd: Setup all xfers before opcode execution The AMD SPI controller hardware seems to expect the FIFO buffer to be fully setup with the details of all transfers in the SPI message before it is able to start processing the data in a reliable way. Furthermore, it imposes a strict ordering restriction, in the sense that all TX transfers must be handled prior any RX transfer. Hence, let's ensure amd_spi_execute_opcode() is called only once, after all TX transfers have been setup, and process any remaining RX transfers afterwards, in a second iteration. Additionally, get rid of the unnecessary AMD_SPI_XFER_TX/RX defines and improve error handling. Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20220818010059.403776-1-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 8a866d527ac0441c0eb14a991fa11358b476b11d Author: Christian Kohlschütter Date: Thu Aug 18 12:46:47 2022 +0000 regulator: core: Resolve supply name earlier to prevent double-init Previously, an unresolved regulator supply reference upon calling regulator_register on an always-on or boot-on regulator caused set_machine_constraints to be called twice. This in turn may initialize the regulator twice, leading to voltage glitches that are timing-dependent. A simple, unrelated configuration change may be enough to hide this problem, only to be surfaced by chance. One such example is the SD-Card voltage regulator in a NanoPI R4S that would not initialize reliably unless the registration flow was just complex enough to allow the regulator to properly reset between calls. Fix this by re-arranging regulator_register, trying resolve the regulator's supply early enough that set_machine_constraints does not need to be called twice. Signed-off-by: Christian Kohlschütter Link: https://lore.kernel.org/r/20220818124646.6005-1-christian@kohlschutter.com Signed-off-by: Mark Brown commit ee94aff2628b18afdb0b6b175e568657bdaead59 Merge: 9b6744f60b6b4 da279e6965b38 Author: Mark Brown Date: Thu Aug 18 15:01:21 2022 +0100 Devm helpers for regulator get and enable Merge series from Matti Vaittinen : A few* drivers seem to use pattern demonstrated by pseudocode: - devm_regulator_get() - regulator_enable() - devm_add_action_or_reset(regulator_disable()) Introducing devm helpers for this pattern would remove bunch of code from drivers. Typically following: - replace 3 calls (devm_regulator_get[_optional](), regulator_enable(), devm_add_action_or_reset()) with just one (devm_regulator_get_enable[_optional]()). - drop disable callback. - remove stored pointer to struct regulator - which can lead to problem when an devm action for regulator_disable is used. I believe this simplifies things by removing some dublicated code. The suggested managed 'get_enable' APIs do not return the pointer to regulators for user because any call to regulator_disable() (or regulator_enable()) may easily lead to regulator enable count imbalance upon device detach. (Eg, if someone calls regulator_disable() and the device is then detached before user has re-enabled the regulator). Not returning the pointer to obtained regulator to caller is a good hint that the enable/disable should not be manually handled when these APIs are used. OTOH, not returning the pointer reduces the use-cases by not allowing the consumers to perform other regulator actions. For example request the voltages. A few drivers which used the "get, enable, devm_action_to_disable" did also query the voltages. The API does not suit needs of such users. commit 3ecf671f1d354f40228e407ab350abd41034410b Author: Ashok Raj Date: Sat Aug 13 22:38:21 2022 +0000 x86/microcode: Document the whole late loading problem Commit d23d33ea0fcd ("x86/microcode: Taint and warn on late loading") started tainting the kernel after microcode late loading. There is some history behind why x86 microcode started doing the late loading stop_machine() rendezvous. Document the whole situation. No functional changes. [ bp: Fix typos, heavily massage. ] Signed-off-by: Ashok Raj Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220813223825.3164861-2-ashok.raj@intel.com commit da279e6965b3838e99e5c0ab8f76b87bf86b31a5 Author: Matti Vaittinen Date: Fri Aug 12 13:10:37 2022 +0300 regulator: Add devm helpers for get and enable A few regulator consumer drivers seem to be just getting a regulator, enabling it and registering a devm-action to disable the regulator at the driver detach and then forget about it. We can simplify this a bit by adding a devm-helper for this pattern. Add devm_regulator_get_enable() and devm_regulator_get_enable_optional() Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/ed7b8841193bb9749d426f3cb3b199c9460794cd.1660292316.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown commit 0db7058e8e23e6bbab1b4747ecabd1784c34f50b Author: Borislav Petkov Date: Tue May 24 11:01:18 2022 +0200 x86/clear_user: Make it faster Based on a patch by Mark Hemment and incorporating very sane suggestions from Linus. The point here is to have the default case with FSRM - which is supposed to be the majority of x86 hw out there - if not now then soon - be directly inlined into the instruction stream so that no function call overhead is taking place. Drop the early clobbers from the @size and @addr operands as those are not needed anymore since we have single instruction alternatives. The benchmarks I ran would show very small improvements and a PF benchmark would even show weird things like slowdowns with higher core counts. So for a ~6m running the git test suite, the function gets called under 700K times, all from padzero(): <...>-2536 [006] ..... 261.208801: padzero: to: 0x55b0663ed214, size: 3564, cycles: 21900 <...>-2536 [006] ..... 261.208819: padzero: to: 0x7f061adca078, size: 3976, cycles: 17160 <...>-2537 [008] ..... 261.211027: padzero: to: 0x5572d019e240, size: 3520, cycles: 23850 <...>-2537 [008] ..... 261.211049: padzero: to: 0x7f1288dc9078, size: 3976, cycles: 15900 ... which is around 1%-ish of the total time and which is consistent with the benchmark numbers. So Mel gave me the idea to simply measure how fast the function becomes. I.e.: start = rdtsc_ordered(); ret = __clear_user(to, n); end = rdtsc_ordered(); Computing the mean average of all the samples collected during the test suite run then shows some improvement: clear_user_original: Amean: 9219.71 (Sum: 6340154910, samples: 687674) fsrm: Amean: 8030.63 (Sum: 5522277720, samples: 687652) That's on Zen3. The situation looks a lot more confusing on Intel: Icelake: clear_user_original: Amean: 19679.4 (Sum: 13652560764, samples: 693750) Amean: 19743.7 (Sum: 13693470604, samples: 693562) (I ran it twice just to be sure.) ERMS: Amean: 20374.3 (Sum: 13910601024, samples: 682752) Amean: 20453.7 (Sum: 14186223606, samples: 693576) FSRM: Amean: 20458.2 (Sum: 13918381386, sample s: 680331) The original microbenchmark which people were complaining about: for i in $(seq 1 10); do dd if=/dev/zero of=/dev/null bs=1M status=progress count=65536; done 2>&1 | grep copied 32207011840 bytes (32 GB, 30 GiB) copied, 1 s, 32.2 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.93069 s, 35.6 GB/s 37597741056 bytes (38 GB, 35 GiB) copied, 1 s, 37.6 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.78017 s, 38.6 GB/s 62020124672 bytes (62 GB, 58 GiB) copied, 2 s, 31.0 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 2.13716 s, 32.2 GB/s 60010004480 bytes (60 GB, 56 GiB) copied, 1 s, 60.0 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.14129 s, 60.2 GB/s 53212086272 bytes (53 GB, 50 GiB) copied, 1 s, 53.2 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.28398 s, 53.5 GB/s 55698259968 bytes (56 GB, 52 GiB) copied, 1 s, 55.7 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.22507 s, 56.1 GB/s 55306092544 bytes (55 GB, 52 GiB) copied, 1 s, 55.3 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.23647 s, 55.6 GB/s 54387539968 bytes (54 GB, 51 GiB) copied, 1 s, 54.4 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.25693 s, 54.7 GB/s 50566529024 bytes (51 GB, 47 GiB) copied, 1 s, 50.6 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.35096 s, 50.9 GB/s 58308165632 bytes (58 GB, 54 GiB) copied, 1 s, 58.3 GB/s 68719476736 bytes (69 GB, 64 GiB) copied, 1.17394 s, 58.5 GB/s Now the same thing with smaller buffers: for i in $(seq 1 10); do dd if=/dev/zero of=/dev/null bs=1M status=progress count=8192; done 2>&1 | grep copied 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.28485 s, 30.2 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.276112 s, 31.1 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.29136 s, 29.5 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.283803 s, 30.3 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.306503 s, 28.0 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.349169 s, 24.6 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.276912 s, 31.0 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.265356 s, 32.4 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.28464 s, 30.2 GB/s 8589934592 bytes (8.6 GB, 8.0 GiB) copied, 0.242998 s, 35.3 GB/s is also not conclusive because it all depends on the buffer sizes, their alignments and when the microcode detects that cachelines can be aggregated properly and copied in bigger sizes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/CAHk-=wh=Mu_EYhtOmPn6AxoQZyEh-4fo2Zx3G7rBv1g7vwoKiw@mail.gmail.com commit 75217c2fcc88e77bea40ef1153d84ff31fa99112 Author: Jani Nikula Date: Tue Aug 16 18:37:22 2022 +0300 drm/i915/dsi: use VBT backlight and CABC port definitions directly Drop the intermediate values stored in intel_dsi and use the VBT values directly, now that they're conveniently stored in panel->vbt. Signed-off-by: Jani Nikula Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/8b3765f1e1dc4d436b312016f72647e03ba49f94.1660664162.git.jani.nikula@intel.com commit ab55165d73a444606af1530cd0d6448b04370f68 Author: Jani Nikula Date: Tue Aug 16 18:37:21 2022 +0300 drm/i915/dsi: fix dual-link DSI backlight and CABC ports for display 11+ The VBT dual-link DSI backlight and CABC still use ports A and C, both in Bspec and code, while display 11+ DSI only supports ports A and B. Assume port C actually means port B for display 11+ when parsing VBT. Bspec: 20154 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6476 Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/8c462718bcc7b36a83e09d0a5eef058b6bc8b1a2.1660664162.git.jani.nikula@intel.com commit f4a6c7a454a6e71c5ccf25af82694213a9784013 Author: Jani Nikula Date: Tue Aug 16 18:37:20 2022 +0300 drm/i915/dsi: filter invalid backlight and CABC ports Avoid using ports that aren't initialized in case the VBT backlight or CABC ports have invalid values. This fixes a NULL pointer dereference of intel_dsi->dsi_hosts[port] in such cases. Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/b0f4f087866257d280eb97d6bcfcefd109cc5fa2.1660664162.git.jani.nikula@intel.com commit f2bd1c5ae2cb0cf9525c9bffc0038c12dd7e1338 Author: Cezary Rojewski Date: Tue Aug 16 13:17:27 2022 +0200 ALSA: hda: Fix page fault in snd_hda_codec_shutdown() If early probe of HDAudio bus driver fails e.g.: due to missing firmware file, snd_hda_codec_shutdown() ends in manipulating uninitialized codec->pcm_list_head causing page fault. Initialization of HDAudio codec in ASoC is split in two: - snd_hda_codec_device_init() - snd_hda_codec_device_new() snd_hda_codec_device_init() is called during probe_codecs() by HDAudio bus driver while snd_hda_codec_device_new() is called by codec-component's ->probe(). The second call will not happen until all components required by related sound card are present within the ASoC framework. With firmware failing to load during the PCI's deferred initialization i.e.: probe_work(), no platform components are ever registered. HDAudio codec enumeration is done at that point though, so the codec components became registered to ASoC framework, calling snd_hda_codec_device_init() in the process. Now, during platform reboot snd_hda_codec_shutdown() is called for every codec found on the HDAudio bus causing oops if any of them has not completed both of their initialization steps. Relocating field initialization fixes the issue. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220816111727.3218543-7-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit fb5987844808bf9abeb23f695e94b75b439daa42 Author: Cezary Rojewski Date: Tue Aug 16 13:17:26 2022 +0200 ALSA: hda: Remove codec init and exit routines There are no users for snd_hdac_ext_bus_device_init() and snd_hdac_ext_bus_device_exit(). While at it, remove hdac_to_hda_priv() too for the exact same reason. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220816111727.3218543-6-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 0c5c29cafcea20f1f6a9943640e4a5a790e259ee Author: Cezary Rojewski Date: Tue Aug 16 13:17:25 2022 +0200 ALSA: hda: Always free codec on the device release With all HDAudio drivers aligned to make use of the same constructor, have codec freed on the device release regardless of its type. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220816111727.3218543-5-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 3fd63658caed9494cca1d4789a66d3d2def2a0ab Author: Cezary Rojewski Date: Tue Aug 16 13:17:24 2022 +0200 ASoC: Intel: Drop hdac_ext usage for codec device creation To make snd_hda_codec_device_init() the only constructor for struct hda_codec instances remaining tasks are: 1) no struct may wrap struct hda_codec as its base type 2) bus drivers (skylake and sof) which are the current hdac_ext users need to be adjusted to make use of newly added codec init and exit routines instead 3) as bus drivers (skylake and sof) are to be responsible for creating codec device and assigning it to hdac_hda_priv->codec, hdac_hda_dev_probe() has to be freed of that job To keep git bisect happy, all of these in made in one-go. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220816111727.3218543-4-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 829c67319806009abfe3b0b82b3b8b153a2c5e32 Author: Cezary Rojewski Date: Tue Aug 16 13:17:23 2022 +0200 ASoC: SOF: Intel: Introduce HDA codec init and exit routines Preliminary step in making snd_hda_codec_device_init() the only constructor for struct hda_codec instances. To do that, existing usage of hdac_ext equivalents has to be dropped. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220816111727.3218543-3-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit e4746d94d00c52918461bc169e009b6784a38e21 Author: Cezary Rojewski Date: Tue Aug 16 13:17:22 2022 +0200 ASoC: Intel: Skylake: Introduce HDA codec init and exit routines Preliminary step in making snd_hda_codec_device_init() the only constructor for struct hda_codec instances. To do that, existing usage of hdac_ext equivalents has to be dropped. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220816111727.3218543-2-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 5e92a64bd0bbb83e4a522c8be943963a29d4f9e1 Merge: 568035b01cfb1 90d74fdbd8059 Author: Takashi Iwai Date: Thu Aug 18 09:44:26 2022 +0200 Merge branch 'for-linus' into for-next commit 5ac309fec69738d59eccbe18a715bc497875fd0a Author: Potin Lai Date: Wed Aug 10 00:43:38 2022 +0000 ARM: dts: aspeed: bletchley: Remove hdc1080 node Because of incompatible 2nd source si7021, removing hdc1080 node from device tree, and move node probe to user-space layer. Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Link: https://lore.kernel.org/r/20220810004338.329832-3-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit 6da3f55fe822088b69b69a458c412a08362f4f6d Author: Potin Lai Date: Wed Aug 10 00:43:37 2022 +0000 ARM: dts: aspeed: bletchley: Add USB debug card IPMB node Add an IPMB node for USB debug card (13-0010) to support IPMI communication. Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Link: https://lore.kernel.org/r/20220810004338.329832-2-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit 9deb10cf160e2d45b87cd319fbf32b2e5e2a95f1 Author: Joel Stanley Date: Thu Jun 23 19:17:17 2022 +0930 ARM: dts: aspeed: ast2600-evb: Update I2C devices The AST2600A3 EVB has the following I2C devices: - ADT7490 at 0x2e - EEPROM at 0xa0 - LM75 at 0x9a The bus these devices appear on can be configured by jumpers. The device tree is configured with the buses given by the default jumper settings. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater Reviewed-by: Ryan Chen Link: https://lore.kernel.org/r/20220623094717.3873328-1-joel@jms.id.au Signed-off-by: Joel Stanley commit a4be90ff7a7d22a5a781ed2bb3c2d4b2f535a515 Author: Florian Fainelli Date: Fri Aug 12 15:25:33 2022 -0700 memory: brcmstb_memc: Add Broadcom STB memory controller driver Add support for configuring the Self Refresh Power Down (SRPD) inactivity timeout on Broadcom STB chips. This is used to conserve power when the DRAM activity is reduced. Signed-off-by: Florian Fainelli Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812222533.2428033-4-f.fainelli@gmail.com commit e3a1b9245ef72f3b9362816dffd6a08b27db10af Author: Florian Fainelli Date: Fri Aug 12 15:25:32 2022 -0700 Documentation: sysfs: Document Broadcom STB memc sysfs knobs Document the "srpd" and "frequency" sysfs attributes exposed by the brcmstb_memc driver. Signed-off-by: Florian Fainelli Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812222533.2428033-3-f.fainelli@gmail.com commit fa0321ba51ddff78ebe3c7c945830a85c987e3ed Author: Florian Fainelli Date: Fri Aug 12 15:25:31 2022 -0700 dt-bindings: memory-controller: Document Broadcom STB MEMC Document the Broadcom STB memory controller which is a trivial binding for now with a set of compatible strings and single register. Since we introduce this binding, the section in Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt is removed and this binding is referenced instead. Reviewed-by: Rob Herring Signed-off-by: Florian Fainelli [krzk: correct path in brcm,brcmstb.txt] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812222533.2428033-2-f.fainelli@gmail.com commit f62e3f595c5f08e6066d88bc96d50247424291f8 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:09 2022 +0200 interconnect: imx: Make imx_icc_unregister() return void The function imx_icc_unregister() returns zero unconditionally. Make it return void. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-9-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit e34cfee65ec891a319ce79797dda18083af33a76 Author: Wong Vee Khee Date: Wed Aug 17 14:43:24 2022 +0800 stmmac: intel: remove unused 'has_crossts' flag The 'has_crossts' flag was not used anywhere in the stmmac driver, removing it from both header file and dwmac-intel driver. Signed-off-by: Wong Vee Khee Reviewed-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20220817064324.10025-1-veekhee@gmail.com Signed-off-by: Jakub Kicinski commit 3f5f728a7296b5d5b87117d85d3020cc9640f6dd Merge: fd78d07c7c35d df78da27260c9 Author: Jakub Kicinski Date: Wed Aug 17 20:29:34 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Andrii Nakryiko says: ==================== bpf-next 2022-08-17 We've added 45 non-merge commits during the last 14 day(s) which contain a total of 61 files changed, 986 insertions(+), 372 deletions(-). The main changes are: 1) New bpf_ktime_get_tai_ns() BPF helper to access CLOCK_TAI, from Kurt Kanzenbach and Jesper Dangaard Brouer. 2) Few clean ups and improvements for libbpf 1.0, from Andrii Nakryiko. 3) Expose crash_kexec() as kfunc for BPF programs, from Artem Savkov. 4) Add ability to define sleepable-only kfuncs, from Benjamin Tissoires. 5) Teach libbpf's bpf_prog_load() and bpf_map_create() to gracefully handle unsupported names on old kernels, from Hangbin Liu. 6) Allow opting out from auto-attaching BPF programs by libbpf's BPF skeleton, from Hao Luo. 7) Relax libbpf's requirement for shared libs to be marked executable, from Henqgi Chen. 8) Improve bpf_iter internals handling of error returns, from Hao Luo. 9) Few accommodations in libbpf to support GCC-BPF quirks, from James Hilliard. 10) Fix BPF verifier logic around tracking dynptr ref_obj_id, from Joanne Koong. 11) bpftool improvements to handle full BPF program names better, from Manu Bretelle. 12) bpftool fixes around libcap use, from Quentin Monnet. 13) BPF map internals clean ups and improvements around memory allocations, from Yafang Shao. 14) Allow to use cgroup_get_from_file() on cgroupv1, allowing BPF cgroup iterator to work on cgroupv1, from Yosry Ahmed. 15) BPF verifier internal clean ups, from Dave Marchevsky and Joanne Koong. 16) Various fixes and clean ups for selftests/bpf and vmtest.sh, from Daniel Xu, Artem Savkov, Joanne Koong, Andrii Nakryiko, Shibin Koikkara Reeny. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (45 commits) selftests/bpf: Few fixes for selftests/bpf built in release mode libbpf: Clean up deprecated and legacy aliases libbpf: Streamline bpf_attr and perf_event_attr initialization libbpf: Fix potential NULL dereference when parsing ELF selftests/bpf: Tests libbpf autoattach APIs libbpf: Allows disabling auto attach selftests/bpf: Fix attach point for non-x86 arches in test_progs/lsm libbpf: Making bpf_prog_load() ignore name if kernel doesn't support selftests/bpf: Update CI kconfig selftests/bpf: Add connmark read test selftests/bpf: Add existing connection bpf_*_ct_lookup() test bpftool: Clear errno after libcap's checks bpf: Clear up confusion in bpf_skb_adjust_room()'s documentation bpftool: Fix a typo in a comment libbpf: Add names for auxiliary maps bpf: Use bpf_map_area_alloc consistently on bpf map creation bpf: Make __GFP_NOWARN consistent in bpf map creation bpf: Use bpf_map_area_free instread of kvfree bpf: Remove unneeded memset in queue_stack_map creation libbpf: preserve errno across pr_warn/pr_info/pr_debug ... ==================== Link: https://lore.kernel.org/r/20220817215656.1180215-1-andrii@kernel.org Signed-off-by: Jakub Kicinski commit 47091e4ed9af648d6cfa3a5f0809ece371294ecb Author: Al Viro Date: Sun Jun 20 13:53:35 2021 -0400 dma_buf_getfile(): don't bother with ->f_flags reassignments just pass the already sanitized value to alloc_file_pseudo(). Signed-off-by: Al Viro commit 25885a35a72007cf28ec5f9ba7169c5c798f7167 Author: Al Viro Date: Tue Aug 16 11:57:56 2022 -0400 Change calling conventions for filldir_t filldir_t instances (directory iterators callbacks) used to return 0 for "OK, keep going" or -E... for "stop". Note that it's *NOT* how the error values are reported - the rules for those are callback-dependent and ->iterate{,_shared}() instances only care about zero vs. non-zero (look at emit_dir() and friends). So let's just return bool ("should we keep going?") - it's less confusing that way. The choice between "true means keep going" and "true means stop" is bikesheddable; we have two groups of callbacks - do something for everything in directory, until we run into problem and find an entry in directory and do something to it. The former tended to use 0/-E... conventions - -E on failure. The latter tended to use 0/1, 1 being "stop, we are done". The callers treated anything non-zero as "stop", ignoring which non-zero value did they get. "true means stop" would be more natural for the second group; "true means keep going" - for the first one. I tried both variants and the things like if allocation failed something = -ENOMEM; return true; just looked unnatural and asking for trouble. [folded suggestion from Matthew Wilcox ] Acked-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit f922fbb0f2ad1fd3e3186f39c46673419e6d9281 Author: Daniele Ceraolo Spurio Date: Thu Aug 11 14:08:12 2022 -0700 drm/i915/guc: clear stalled request after a reset If the GuC CTs are full and we need to stall the request submission while waiting for space, we save the stalled request and where the stall occurred; when the CTs have space again we pick up the request submission from where we left off. If a full GT reset occurs, the state of all contexts is cleared and all non-guilty requests are unsubmitted, therefore we need to restart the stalled request submission from scratch. To make sure that we do so, clear the saved request after a reset. Fixes note: the patch that introduced the bug is in 5.15, but no officially supported platform had GuC submission enabled by default in that kernel, so the backport to that particular version (and only that one) can potentially be skipped. Fixes: 925dc1cf58ed ("drm/i915/guc: Implement GuC submission tasklet") Signed-off-by: Daniele Ceraolo Spurio Cc: Matthew Brost Cc: John Harrison Cc: # v5.15+ Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220811210812.3239621-1-daniele.ceraolospurio@intel.com commit df78da27260c915039b348b164bbc53fa372ba70 Author: Andrii Nakryiko Date: Mon Aug 15 17:19:29 2022 -0700 selftests/bpf: Few fixes for selftests/bpf built in release mode Fix few issues found when building and running test_progs in release mode. First, potentially uninitialized idx variable in xskxceiver, force-initialize to zero to satisfy compiler. Few instances of defining uprobe trigger functions break in release mode unless marked as noinline, due to being static. Add noinline to make sure everything works. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Hao Luo Link: https://lore.kernel.org/bpf/20220816001929.369487-5-andrii@kernel.org commit abf84b64e36b175c9c4dd4ecbad2af4329c00041 Author: Andrii Nakryiko Date: Mon Aug 15 17:19:28 2022 -0700 libbpf: Clean up deprecated and legacy aliases Remove three missed deprecated APIs that were aliased to new APIs: bpf_object__unload, bpf_prog_attach_xattr and btf__load. Also move legacy API libbpf_find_kernel_btf (aliased to btf__load_vmlinux_btf) into libbpf_legacy.h. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Hao Luo Link: https://lore.kernel.org/bpf/20220816001929.369487-4-andrii@kernel.org commit 813847a31447feba6119df4ee77a7c0c7a77fc72 Author: Andrii Nakryiko Date: Mon Aug 15 17:19:27 2022 -0700 libbpf: Streamline bpf_attr and perf_event_attr initialization Make sure that entire libbpf code base is initializing bpf_attr and perf_event_attr with memset(0). Also for bpf_attr make sure we clear and pass to kernel only relevant parts of bpf_attr. bpf_attr is a huge union of independent sub-command attributes, so there is no need to clear and pass entire union bpf_attr, which over time grows quite a lot and for most commands this growth is completely irrelevant. Few cases where we were relying on compiler initialization of BPF UAPI structs (like bpf_prog_info, bpf_map_info, etc) with `= {};` were switched to memset(0) pattern for future-proofing. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Hao Luo Link: https://lore.kernel.org/bpf/20220816001929.369487-3-andrii@kernel.org commit d4e6d684f3bea46a2fc195765c77a3b26bcb080e Author: Andrii Nakryiko Date: Mon Aug 15 17:19:26 2022 -0700 libbpf: Fix potential NULL dereference when parsing ELF Fix if condition filtering empty ELF sections to prevent NULL dereference. Fixes: 47ea7417b074 ("libbpf: Skip empty sections in bpf_object__init_global_data_maps") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Hao Luo Link: https://lore.kernel.org/bpf/20220816001929.369487-2-andrii@kernel.org commit b0f2eb942b8a449432267571d045613e35ada2de Author: Daniele Ceraolo Spurio Date: Fri Jul 8 15:41:58 2022 -0700 drm/i915/guc: skip scrub_ctbs selftest if reset is disabled The test needs GT reset to trigger the scrubbing logic, so we can only run it when reset is enabled. Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Cc: Matthew Brost Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220708224158.929327-1-daniele.ceraolospurio@intel.com commit 24c06e000e8fa237ff2d960def0768a47d0db7b1 Author: Chris Morgan Date: Tue Aug 16 14:16:54 2022 -0700 Input: adc-joystick - add polled input device support Add polled input device support to the adc-joystick driver. This is useful for devices which do not have hardware capable triggers on their SARADC. Code modified from adc-joystick.c changes made by Maya Matuszczyk. Signed-off-by: Maya Matuszczyk Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20220816210440.14260-3-macroalpha82@gmail.com Signed-off-by: Dmitry Torokhov commit c42a5ff530a7e2122ed8fb576ddf16a18730ef05 Author: Chris Morgan Date: Tue Aug 16 14:16:36 2022 -0700 dt-bindings: adc-joystick: add poll-interval Add poll-interval support for the adc-joystick documentation. This is an optional value and if not provided the adc-joystick works as it does today (with buffers). If this value is provided, the adc-joystick driver is polled at the specified interval. The existing attribute of "poll-interval" was used instead of complying with property-units.yaml after discussion of the issue on the mailing list. Signed-off-by: Maya Matuszczyk Signed-off-by: Chris Morgan Reviewed-by: Rob Herring Acked-by: Artur Rojek Link: https://lore.kernel.org/r/20220816210440.14260-2-macroalpha82@gmail.com Signed-off-by: Dmitry Torokhov commit 2e6f34faa7e0158b8eb432b44082bac23c63f8bf Author: Eddie James Date: Fri Aug 12 15:32:39 2022 -0700 Input: Add IBM Operation Panel driver Add a driver to get the button events from the panel and provide them to userspace with the input subsystem. The panel is connected with I2C and controls the bus, so the driver registers as an I2C slave device. Signed-off-by: Eddie James Reviewed-by: Joel Stanley Reviewed-by: Wolfram Sang # I2C slave parts Link: https://lore.kernel.org/r/20220809204147.238132-3-eajames@linux.ibm.com Signed-off-by: Dmitry Torokhov commit bc604fbb49f1a00df34e6755a32e8bf5419eb4cd Author: Eddie James Date: Fri Aug 12 15:32:27 2022 -0700 dt-bindings: input: Add documentation for IBM Operation Panel Document the bindings for the IBM Operation Panel, which provides a simple interface to control a server. It has a display and three buttons. Also update MAINTAINERS for the new file. Signed-off-by: Eddie James Reviewed-by: Rob Herring Acked-by: Joel Stanley Link: https://lore.kernel.org/r/20220809204147.238132-2-eajames@linux.ibm.com Signed-off-by: Dmitry Torokhov commit 93fbff1197474d7b65e598c6f48fa82a5c334539 Merge: 93e719f661379 ed5c2f5fd10dd Author: Dmitry Torokhov Date: Wed Aug 17 12:30:00 2022 -0700 Merge branch 'i2c/make_remove_callback_void-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into next Sync up with the latest I2C code base to get updated prototype of I2C bus remove() method. commit 06f36055121769b9eb9b7d28c7499d1cc8269dc3 Author: Daniel Lezcano Date: Wed Aug 17 17:30:40 2022 +0200 Revert "mlxsw: core: Add the hottest thermal zone detection" This reverts commit 2dc2f760052da4925482ecdcdc5c94d4a599153c and commit 6f73862fabd93213de157d9cc6ef76084311c628. As discussed in the thread: https://lore.kernel.org/all/f3c62ebe-7d59-c537-a010-bff366c8aeba@linaro.org/ the feature provided by commits 2dc2f760052da and 6f73862fabd93 is actually already handled by the thermal framework via the cooling device state aggregation, thus all this code is pointless. The revert conflicts with the following changes: - 7f4957be0d5b8: thermal: Use mode helpers in drivers - 6a79507cfe94c: mlxsw: core: Extend thermal module with per QSFP module thermal zones These conflicts were fixed and the resulting changes are in this patch. Both reverts are in the same change as requested by Ido Schimmel: https://lore.kernel.org/all/Yvz7+RUsmVco3Xpj@shredder/ Signed-off-by: Daniel Lezcano Tested-by: Vadim Pasternak Acked-by: Jakub Kicinski Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220817153040.2464245-1-daniel.lezcano@linaro.org commit fd78d07c7c35de260eb89f1be4a1e7487b8092ad Merge: 815f5f574144a 4d2f6dde4daa1 Author: Jakub Kicinski Date: Wed Aug 17 10:55:06 2022 -0700 Merge branch 'net-dsa-bcm_sf2-utilize-phylink-for-all-ports' Florian Fainelli says: ==================== net: dsa: bcm_sf2: Utilize PHYLINK for all ports This patch series has the bcm_sf2 driver utilize PHYLINK to configure the CPU port link parameters to unify the configuration and pave the way for DSA to utilize PHYLINK for all ports in the future. Tested on BCM7445 and BCM7278 ==================== Link: https://lore.kernel.org/r/20220815175009.2681932-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 4d2f6dde4daa12315254485566968fe7c7432cfd Author: Florian Fainelli Date: Mon Aug 15 10:50:09 2022 -0700 net: dsa: bcm_sf2: Have PHYLINK configure CPU/IMP port(s) Remove the artificial limitations imposed upon bcm_sf2_sw_mac_link_{up,down} and allow us to override the link parameters for IMP port(s) as well as regular ports by accounting for the special differences that exist there. Remove the code that did override the link parameters in bcm_sf2_imp_setup(). Signed-off-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 1ed26ce4850accf88aedd1b1c7974a94396305d0 Author: Florian Fainelli Date: Mon Aug 15 10:50:08 2022 -0700 net: dsa: bcm_sf2: Introduce helper for port override offset Depending upon the generation of switches, we have different offsets for configuring a given port's status override where link parameters are applied. Introduce a helper function that we re-use throughout the code in order to let phylink callbacks configure the IMP/CPU port(s) in subsequent changes. Signed-off-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 815f5f574144aaef4bce6540214cb37434be637c Author: Beniamin Sandu Date: Sat Aug 13 23:46:58 2022 +0300 net: sfp: use simplified HWMON_CHANNEL_INFO macro This makes the code look cleaner and easier to read. Signed-off-by: Beniamin Sandu Link: https://lore.kernel.org/r/20220813204658.848372-1-beniaminsandu@gmail.com Signed-off-by: Jakub Kicinski commit ca1ce7207e53cfe69aee5002eb3795069668da53 Author: Johan Hovold Date: Fri Aug 5 11:23:17 2022 +0200 arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13s: add alternate touchpad Add support for the alternate (second-source) touchpad found on some X13s laptops. Note that alternate touchpad is kept disabled for now. The boot firmware should determine which device is actually populated and enable only the corresponding node. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-8-johan+linaro@kernel.org commit 7093465237c55ccc292f4653478466ca769ef8dc Author: Johan Hovold Date: Fri Aug 5 11:23:16 2022 +0200 arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13s: mark HID wakeup sources The touchpad and keyboard can wake the system from suspend so declare them as wakeup sources. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-7-johan+linaro@kernel.org commit 97cc7ab3fb4dc27cdb2e34b2626ab99053af1dc7 Author: Johan Hovold Date: Fri Aug 5 11:23:15 2022 +0200 arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13s: move HID pin config The HID pin configurations belong in the HID nodes rather than i2c bus node. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-6-johan+linaro@kernel.org commit e11978de1e606b8eafe553dac1282a292f527b4e Author: Johan Hovold Date: Fri Aug 5 11:23:14 2022 +0200 arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13s: disable touchscreen pull-up The (optional) touchscreen interrupt line has an external pull-up so disable the internal one as is done for the keyboard and touchpad. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-5-johan+linaro@kernel.org commit cf2a7f3c525bad95e6c671fcd7226473cb1c87f8 Author: Johan Hovold Date: Fri Aug 5 11:23:13 2022 +0200 arm64: dts: qcom: sc8280xp-crd: mark HID wakeup sources The touchpad and keyboard can wake the system from suspend so declare them as wakeup sources. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-4-johan+linaro@kernel.org commit ffe469eaa2fcc360100bfcc3c4582e83ed4dad57 Author: Johan Hovold Date: Fri Aug 5 11:23:12 2022 +0200 arm64: dts: qcom: sc8280xp-crd: move HID pin config The HID pin configurations belong in the HID nodes rather than i2c bus node. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-3-johan+linaro@kernel.org commit 6af72a312d76063af3bb82057efb7649c3bc6e2a Author: Johan Hovold Date: Fri Aug 5 11:23:11 2022 +0200 arm64: dts: qcom: sc8280xp-crd: disable touchscreen pull-up The touchscreen interrupt line has an external pull-up so disable the internal one as is done for the keyboard and touchpad. Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220805092317.4985-2-johan+linaro@kernel.org commit 7921bd3d96d561d5bf145a905e9cc51c1fce589f Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:48 2022 +0200 arm64: dts: qcom: sdm845: add LLCC BWMON The SDM845 comes with few instances of Bandwidth Monitor. The already supported one monitors traffic between CPU and Last Level Cache Controller (LLCC) and in downstream sources is called BWMON v4 (or v4 of register layout). SDM845 also has also BWMON instance measuring traffic between LLCC and memory with different register layout: called v5. Cc: Rajendra Nayak Cc: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-12-krzysztof.kozlowski@linaro.org commit 300b5f661eebefb8571841b78091343eb87eca54 Author: Krzysztof Kozlowski Date: Thu Jul 28 13:37:47 2022 +0200 arm64: dts: qcom: sdm845: narrow LLCC address space The Last Level Cache Controller (LLCC) device does not need to access entire LLCC address space. Currently driver uses only hardware info and status registers which both reside in LLCC0_COMMON range (offset 0x30000, size 0x1000). Narrow the address space to allow binding other drivers to rest of LLCC address space. Cc: Rajendra Nayak Cc: Sibi Sankar Reported-by: Steev Klimaszewski Suggested-by: Sibi Sankar Signed-off-by: Krzysztof Kozlowski Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220728113748.170548-11-krzysztof.kozlowski@linaro.org commit b092e4a9d3e3335fdc5aa23a9444eeebfa81da34 Author: John Harrison Date: Wed Jul 27 19:20:28 2022 -0700 drm/i915/guc: Reduce spam from error capture Some debug code got left in when the GuC based register save for error capture was added. Remove that. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-8-John.C.Harrison@Intel.com commit 8ad0152afb1bb3878bba282308f037d73a87ace5 Author: John Harrison Date: Wed Jul 27 19:20:27 2022 -0700 drm/i915/guc: Make GuC log sizes runtime configurable The GuC log buffer sizes had to be configured statically at compile time. This can be quite troublesome when needing to get larger logs out of a released driver. So re-organise the code to allow a boot time module parameter override. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-7-John.C.Harrison@Intel.com commit 5ece208ab05e4042c80ed1e6fe6d7ce236eee89b Author: Chris Wilson Date: Wed Jul 27 19:20:26 2022 -0700 drm/i915/guc: Use streaming loads to speed up dumping the guc log Use a temporary page and mempy_from_wc to reduce the time it takes to dump the guc log to debugfs. Signed-off-by: Chris Wilson Signed-off-by: John Harrison Reviewed-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-6-John.C.Harrison@Intel.com commit c5de70f6e14ce02c3e604972f8fd46ffcdc184d9 Author: John Harrison Date: Wed Jul 27 19:20:25 2022 -0700 drm/i915/guc: Record CTB info in error logs When debugging GuC communication issues, it is useful to have the CTB info available. So add the state and buffer contents to the error capture log. Also, add a sub-structure for the GuC specific error capture info as it is now becoming numerous. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-5-John.C.Harrison@Intel.com commit 368d179adbac212a5adf5fa492397a593d52547a Author: John Harrison Date: Wed Jul 27 19:20:24 2022 -0700 drm/i915/guc: Add GuC <-> kernel time stamp translation information It is useful to be able to match GuC events to kernel events when looking at the GuC log. That requires being able to convert GuC timestamps to kernel time. So, when dumping error captures and/or GuC logs, include a stamp in both time zones plus the clock frequency. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-4-John.C.Harrison@Intel.com commit 56c7f0e2026328e56106b54cb0e2fe3a7e70ce4f Author: John Harrison Date: Wed Jul 27 19:20:23 2022 -0700 drm/i915/guc: Fix capture size warning and bump the size There was a size check to warn if the GuC error state capture buffer allocation would be too small to fit a reasonable amount of capture data for the current platform. Unfortunately, the test was done too early in the boot sequence and was actually testing 'if(-ENODEV > size)'. Move the check to be later. The check is only used to print a warning message, so it doesn't really matter how early or late it is done. Note that it is not possible to dynamically size the buffer because the allocation needs to be done before the engine information is available (at least, it would be in the intended two-phase GuC init process). Now that the check works, it is reporting size too small for newer platforms. The check includes a 3x oversample multiplier to allow for multiple error captures to be bufferd by GuC before i915 has a chance to read them out. This is less important than simply being big enough to fit the first capture. So a) bump the default size to be large enough for one capture minimum and b) make the warning only if one capture won't fit, instead use a notice for the 3x size. Note that the size estimate is a worst case scenario. Actual captures will likely be smaller. Lastly, use drm_warn istead of DRM_WARN as the former provides more infmration and the latter is deprecated. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-3-John.C.Harrison@Intel.com commit 5ce27d6210018e972197ff7e5da6309f919fd61b Author: Alan Previn Date: Wed Jul 27 19:20:22 2022 -0700 drm/i915/guc: Add a helper for log buffer size Add a helper to get GuC log buffer size. Signed-off-by: Alan Previn Signed-off-by: John Harrison Reviewed-by: Matthew Brost Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20220728022028.2190627-2-John.C.Harrison@Intel.com commit cb225ac125a9c82889f4796a6092dd0bed39720a Author: Shengjiu Wang Date: Wed Aug 17 13:24:27 2022 +0800 ASoC: fsl_sai: Remove unnecessary FIFO reset in ISR The FIFO reset drops the words in the FIFO, which may cause channel swap when SAI module is running, especially when the DMA speed is low. So it is not good to do FIFO reset in ISR, then remove the operation. Fixes: e2681a1bf5ae ("ASoC: fsl_sai: Add isr to deal with error flag") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1660713867-26921-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit e6f4bddefd67677c5d0ee6c104a3ce0dcf5fe47e Merge: e32e23a2b5884 c2683ecfd1850 Author: Mark Brown Date: Wed Aug 17 18:05:13 2022 +0100 ASoC: cs42l42: Some small code improvements Merge series from Richard Fitzgerald : This is a collection of minor improvements to the code or comments. commit 738a2f2f9130f98f92ccb3efd94d4879c0a0990c Author: Hao Luo Date: Tue Aug 16 16:40:12 2022 -0700 selftests/bpf: Tests libbpf autoattach APIs Adds test for libbpf APIs that toggle bpf program auto-attaching. Signed-off-by: Hao Luo Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220816234012.910255-2-haoluo@google.com commit 43cb8cbadffa21e88a65dd1129c86f5552d6c42e Author: Hao Luo Date: Tue Aug 16 16:40:11 2022 -0700 libbpf: Allows disabling auto attach Adds libbpf APIs for disabling auto-attach for individual functions. This is motivated by the use case of cgroup iter [1]. Some iter types require their parameters to be non-zero, therefore applying auto-attach on them will fail. With these two new APIs, users who want to use auto-attach and these types of iters can disable auto-attach on the program and perform manual attach. [1] https://lore.kernel.org/bpf/CAEf4BzZ+a2uDo_t6kGBziqdz--m2gh2_EUwkGLDtMd65uwxUjA@mail.gmail.com/ Signed-off-by: Hao Luo Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220816234012.910255-1-haoluo@google.com commit 99ad3f9f829fafdcd606a8b1123e331b3b53eb04 Author: Niklas Cassel Date: Tue Aug 16 13:53:28 2022 +0200 ata: libata-core: improve parameter names for ata_dev_set_feature() ata_dev_set_feature() is currently used for enabling/disabling any ATA feature, e.g. SETFEATURES_SPINUP and SETFEATURE_SENSE_DATA, i.e. it is not only used to enable/disable SATA specific features. For most features, the enable/disable bit is specified in the subcommand specific field "count". It is only for the specific subcommands "Enable SATA feature" (0x10) and "Disable SATA feature" (0x90) where the field "count" is used to specify a feature instead of enable/disable. The parameter names for this function are thus quite misleading. Rename the parameter names to be more generic and in line with ACS-5, and remove the references to "SATA FEATURES" in the kernel-doc. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 16169fb781827b82a4c0261195184dcc97a57af7 Author: Tomas Henzl Date: Wed Aug 10 19:59:09 2022 +0200 ata: libata-core: Print timeout value when internal command times Printing the timeout value may help in troubleshooting failures. Signed-off-by: David Milburn Signed-off-by: Tomas Henzl Signed-off-by: Damien Le Moal commit e32e23a2b588424aec0c4c4435530f8022318b8f Author: Richard Fitzgerald Date: Wed Aug 17 13:55:08 2022 +0100 ASoC: soc-utils-test: Add test for snd_soc_params_to_bclk() snd_soc_params_to_bclk() calculates the BCLK from only the information in snd_pcm_hw_params. It is therefore a subset of the functionality of snd_soc_tdm_params_to_bclk() so can use a subset of the test case table. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817125508.1406651-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit aa16a3dc671748bde2fc0465622c41de39a6cf80 Merge: 1decead8d7137 c1a731c713594 Author: Mark Brown Date: Wed Aug 17 15:18:49 2022 +0100 Enable timestamp support for SOF compress driver Merge series from Daniel Baluta : This patchseries computes pcm_io_frames from the DAI position reported by SOF firmware. Using pcm_io_frames userspace applications can later compute timestamps for compressed stream. commit 1decead8d7137fd9db4880207ee323fc8a279a49 Merge: 26bdcc4ba1235 917df025e1db1 Author: Mark Brown Date: Wed Aug 17 15:18:47 2022 +0100 ASoC/soundwire: log actual PING status on resume issues Merge series from Bard Liao : we've been stuck with problems in the dual-amplifier configurations where one of the two devices seems to become UNATTACHED and never regains sync, see https://github.com/thesofproject/linux/issues/3638. This is a rather infrequent issue that may happen once or twice per month, but still it remains a concern. One possibility is that the device does lose sync but somehow our hardware detection fails to see it resync. This series just adds a basic read directly from the PING frames to help confirm if yes/no the device regain sync. commit 8b212526a957e012e88d68d7f33bb11b312c2ea6 Author: Michal Vokáč Date: Thu Jul 14 18:25:15 2022 +0200 ARM: dts: imx6dl-yapp4: Bind the backlight controller to the LCD panel Add connection between the backlight controller and LCD panel. With that the backlight is automatically switched on when the panel is on or switched off when the panel is blanked. Signed-off-by: Michal Vokáč Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit c2683ecfd1850cc99829691b2e1d90f1a6d75b8b Author: Richard Fitzgerald Date: Wed Aug 17 13:23:47 2022 +0100 ASoC: cs42l42: Use snd_soc_tdm_params_to_bclk() Use the new snd_soc_tdm_params_to_bclk() helper function to calculate the bclk. This function handles most of the previous manipulation and makes the code tidier. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817122347.1356773-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit db568aab37c1af80057c12c97e6af049495c3e4a Author: Richard Fitzgerald Date: Wed Aug 17 13:23:46 2022 +0100 ASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put() Fix "much change together" to "must change together". It's probably obvious what was meant but it's nice to fix it. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817122347.1356773-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit dbd231732c99e336c2ece4a70896139e7f5a51a7 Author: Richard Fitzgerald Date: Wed Aug 17 13:23:45 2022 +0100 ASoC: cs42l42: Move cs42l42_supply_names to .c file The array of supply name strings doesn't need to be in the header file. Move it to the .c file. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817122347.1356773-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit b48d1da00fc8f32f7f75b8a34eb484f08b39ffaa Author: Richard Fitzgerald Date: Wed Aug 17 13:23:44 2022 +0100 ASoC: cs42l42: Add include dependencies to cs42l42.h Make cs42l42.h include the other headers it depends on instead of assuming that the .c file already included them. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817122347.1356773-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 8ccaa7eb76742579864ddf834a8ea9c036c2cc5a Author: Richard Fitzgerald Date: Wed Aug 17 13:23:43 2022 +0100 ASoC: cs42l42: Don't include kernel.h kernel.h includes a lot of other headers that we don't need. Replace with an include of types.h. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220817122347.1356773-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 2f9d142c93c293b2526d63e4e75716945edf0cd2 Author: Daniel Lezcano Date: Fri Aug 12 15:07:43 2022 +0200 thermal/core: Fix lockdep_assert() warning The function thermal_zone_device_is_enabled() must be called with the thermal zone lock held. In the resume path, it is called without. As the thermal_zone_device_is_enabled() is also checked in thermal_zone_device_update(), do the check in resume() function is pointless, except for saving an extra initialization which does not hurt if it is done in all the cases. Fixes: ca48ad71717dd ("thermal/core: Move the mutex inside the thermal_zone_device_update() function") Signed-off-by: Daniel Lezcano Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski commit a930da9bf583b2add01fb0e086913664dadaffd0 Author: Daniel Lezcano Date: Fri Aug 5 17:38:34 2022 +0200 thermal/core: Move the mutex inside the thermal_zone_device_update() function All the different calls inside the thermal_zone_device_update() function take the mutex. The previous changes move the mutex out of the different functions, like the throttling ops. Now that the mutexes are all at the same level in the call stack for the thermal_zone_device_update() function, they can be moved inside this one. That has the benefit of: 1. Simplify the code by not having a plethora of places where the lock is taken 2. Probably closes more race windows because releasing the lock from one line to another can give the opportunity to the thermal zone to change its state in the meantime. For example, the thermal zone can be enabled right after checking it is disabled. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-5-daniel.lezcano@linaro.org commit 670a5e356cb6dfc61b87b599eba483af6a3a99ad Author: Daniel Lezcano Date: Fri Aug 5 17:38:33 2022 +0200 thermal/core: Move the thermal zone lock out of the governors All the governors throttling ops are taking/releasing the lock at the beginning and the end of the function. We can move the mutex to the throttling call site instead. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-4-daniel.lezcano@linaro.org commit 63561fe36b094729d3d4d274bafaa030b39e89f6 Author: Daniel Lezcano Date: Fri Aug 5 17:38:32 2022 +0200 thermal/governors: Group the thermal zone lock inside the throttle function The thermal zone lock is taken in the different places in the throttling path. At the first glance it does not hurt to move them at the beginning and the end of the 'throttle' function. That will allow a consolidation of the lock in the next following changes. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-3-daniel.lezcano@linaro.org commit 15a73839e3ced8d418e6c34548f5e2789f9da619 Author: Daniel Lezcano Date: Fri Aug 5 17:38:31 2022 +0200 thermal/core: Rework the monitoring a bit The should_stop_polling() function wraps the function thermal_zone_device_is_enabled(). The monitor_thermal_zone() function checks if the thermal zone is enabled via the should_stop_polling() function. However, the instant after checking the thermal zone is enabled, this one can be disabled, so even if that reduces the race window, it does not prevent that and the monitoring can be set again with the thermal zone disabled. For this reason, the function should_stop_polling() is replaced by a direct check of the thermal zone mode with the mutex locks held, that prevents the situation described above. As the semantic is clear with the thermal_zone_is_enabled() function, we can remove the should_stop_polling() function and replace the check with the former function. While at it, reorder the checks to improve the readability of the monitor_thermal_zone() function. In the future, the thermal_zone_device_disable() and the thermal_zone_device_enable() functions should unset / set the polling timer directly instead of relying on the next thermal_zone_device_update() call to do that. That will make a synchronous thermal zone mode change but the locking scheme should be double checked for that which out of the scope of this change. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-2-daniel.lezcano@linaro.org commit 9662756a9a1c34b3ee606dcddfda6a457f89b07f Author: Daniel Lezcano Date: Fri Aug 5 17:38:30 2022 +0200 thermal/core: Rearm the monitoring only one time The current code calls monitor_thermal_zone() inside the handle_thermal_trip() function. But this one is called in a loop for each trip point which means the monitoring is rearmed several times for nothing (assuming there could be several passive and active trip points). Move the monitor_thermal_zone() function out of the handle_thermal_trip() function and after the thermal trip loop, so the timer will be disabled or rearmed one time. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-1-daniel.lezcano@linaro.org commit e920209847c396ca243259160b7d10d0dae17b35 Author: Jiapeng Chong Date: Tue Aug 9 11:43:46 2022 +0800 thermal/drivers/qcom/spmi-adc-tm5: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. ./drivers/thermal/qcom/qcom-spmi-adc-tm5.c:1029:2-9: line 1029 is redundant because platform_get_irq() already prints an error. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1846 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220809034346.128607-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Daniel Lezcano commit f59ac19b7f44cab23df84810e2da5f57bdd3a7e7 Author: Daniel Lezcano Date: Fri Aug 5 00:43:49 2022 +0200 thermal/of: Remove old OF code All the drivers are converted to the new OF API, remove the old OF code. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-34-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 9326167058e8a5b93179f19fc0368f5324a1f628 Author: Daniel Lezcano Date: Fri Aug 5 00:43:48 2022 +0200 thermal/core: Move set_trip_temp ops to the sysfs code Given the trip points can be set in the thermal zone structure, there is no need of a specific OF function to do that. Move the code in the place where it is generic, in the sysfs set_trip_temp storing function. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-33-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 7ea98f70c73ea37d379a76a69fa71653382a1724 Author: Daniel Lezcano Date: Fri Aug 5 00:43:47 2022 +0200 thermal/drivers/samsung: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220804224349.1926752-32-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 826855ff5746d0f98877eaa4a438abc4e7b58fd5 Author: Daniel Lezcano Date: Fri Aug 5 00:43:46 2022 +0200 regulator/drivers/max8976: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220804224349.1926752-31-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit ad662b1d606515a048cef06c025dfb150cebaa8d Author: Daniel Lezcano Date: Fri Aug 5 00:43:45 2022 +0200 Input: sun4i-ts - switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Acked-by: Dmitry Torokhov Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220804224349.1926752-30-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit de15b8403fa9872cb626a52651b257089b34f5d2 Author: Daniel Lezcano Date: Fri Aug 5 00:43:44 2022 +0200 iio/drivers/sun4i_gpadc: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Acked-by: Jonathan Cameron Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220804224349.1926752-29-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit e5181331359d9311b3cc7e09d9d1cb2ffe87f602 Author: Daniel Lezcano Date: Fri Aug 5 00:43:43 2022 +0200 hwmon/drivers/core: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220804224349.1926752-28-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 613ed3f67609291c9b757d62f1f6734e40cb60d8 Author: Daniel Lezcano Date: Fri Aug 5 00:43:42 2022 +0200 hwmon: pm_bus: core: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-27-daniel.lezcano@linexp.org Acked-by: Guenter Roeck Signed-off-by: Daniel Lezcano commit f1d8b5042ecf9e99294109bb5a1566f6a2039c89 Author: Daniel Lezcano Date: Fri Aug 5 00:43:41 2022 +0200 ata/drivers/ahci_imx: Switch to new of thermal API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. sata_ahci_read_temperature() is used by sata_ahci_show_temp() also. So in order to change the function prototype for the get_temp ops which does not take a void* but a thermal_zone_device* structure, this function wraps the call. Signed-off-by: Daniel Lezcano Acked-by: Damien Le Moal Link: https://lore.kernel.org/r/20220804224349.1926752-26-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 2cf3c72a3ffba080b8188a07c19514cd43df6097 Author: Daniel Lezcano Date: Fri Aug 5 00:43:40 2022 +0200 thermal/drivers/ti-soc: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-25-daniel.lezcano@linexp.org Acked-by: Keerthy Signed-off-by: Daniel Lezcano commit 5ee7811e9afa4f6a1e6bf9231d096c9e483444a2 Author: Daniel Lezcano Date: Fri Aug 5 00:43:39 2022 +0200 thermal/drivers/hisilicon: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-24-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit ae11d6a87c3e742418baa591be1e719a95788059 Author: Daniel Lezcano Date: Fri Aug 5 00:43:38 2022 +0200 thermal/drivers/maxim: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-23-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit b86105ed9f3bfead2aaf3daefa99b694ba5da443 Author: Daniel Lezcano Date: Fri Aug 5 00:43:37 2022 +0200 thermal/drivers/banggap: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-22-daniel.lezcano@linexp.org Reviewed-by: Bryan Brattlof Signed-off-by: Daniel Lezcano commit ab7e865db9a54abd775327f87f32f4d0e6e24109 Author: Daniel Lezcano Date: Fri Aug 5 00:43:36 2022 +0200 thermal/drivers/mtk: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220804224349.1926752-21-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 3e7494b41c41959cd68a3f652e286c1fb7c626fc Author: Daniel Lezcano Date: Fri Aug 5 00:43:35 2022 +0200 thermal/drivers/qoriq: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-20-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 396cbbc6b711ef8d329303dc179a7a1c395f1f12 Author: Daniel Lezcano Date: Fri Aug 5 00:43:34 2022 +0200 thermal/drivers/rzg2l: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-19-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 2ebd4f2f2ecfde86ce490f02b28b3282d93aa405 Author: Daniel Lezcano Date: Fri Aug 5 00:43:33 2022 +0200 thermal/drivers/rcar: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Tested-by: Niklas Söderlund Link: https://lore.kernel.org/r/20220804224349.1926752-18-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 32fb9a8a9d0db3edee50f9c2fcc74fcc26812b86 Author: Daniel Lezcano Date: Fri Aug 5 00:43:32 2022 +0200 thermal/drivers/imx: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-17-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 2320be6032e1c1b17a3fcac98813947d1d28c32f Author: Daniel Lezcano Date: Fri Aug 5 00:43:31 2022 +0200 thermal/drivers/db8500: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-16-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit e4a1150e3e8d708e989c9f7056320fbff4a2d0c4 Author: Daniel Lezcano Date: Fri Aug 5 00:43:30 2022 +0200 thermal/drivers/armada: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-15-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 1240fd6512b7df593b99ea777c846f0b59173a6b Author: Daniel Lezcano Date: Fri Aug 5 00:43:29 2022 +0200 thermal/drivers/amlogic: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-14-daniel.lezcano@linexp.org Reviewed-by: Neil Armstrong Signed-off-by: Daniel Lezcano commit 7e96f35408b6b196a3dc20db757878a7d26bf02d Author: Daniel Lezcano Date: Fri Aug 5 00:43:28 2022 +0200 thermal/drivers/st: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-13-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit ca1b9a9eb3fdbb9aa39d0c174391af694ae77671 Author: Daniel Lezcano Date: Fri Aug 5 00:43:27 2022 +0200 thermal/drivers/qcom: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220804224349.1926752-12-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 944441d878b0aebd87ec404fe86c322186da458d Author: Daniel Lezcano Date: Fri Aug 5 00:43:26 2022 +0200 thermal/drivers/broadcom: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220804224349.1926752-11-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 7f689a2ef4f6422b200682f80be225c1f61218f7 Author: Daniel Lezcano Date: Fri Aug 5 00:43:25 2022 +0200 thermal/drivers/sprd: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-10-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 2e2150c7946764f289bafd716cbd6721283dc9ce Author: Daniel Lezcano Date: Fri Aug 5 00:43:24 2022 +0200 thermal/drivers/sun8i: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-9-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 6fc2e1a5f98feb9cf0698b69c90701e0b9de2bf5 Author: Daniel Lezcano Date: Fri Aug 5 00:43:23 2022 +0200 thermal/drivers/tegra: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-8-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 44b5554d98d422a4411341d9aed5352c2ce34fc1 Author: Daniel Lezcano Date: Fri Aug 5 00:43:22 2022 +0200 thermal/drivers/mmio: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Reviewed-by: Talel Shenhar Link: https://lore.kernel.org/r/20220804224349.1926752-7-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 2ff66cba5beb9302f5787fd34617c5f64ad98309 Author: Daniel Lezcano Date: Fri Aug 5 00:43:21 2022 +0200 thermal/drivers/generic-adc: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-6-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit c5f12023ff1d5622c7499352786233399beab7f8 Author: Daniel Lezcano Date: Fri Aug 5 00:43:20 2022 +0200 thermal/drivers/uniphier: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-5-daniel.lezcano@linexp.org Reviewed-by: Kunihiko Hayashi Signed-off-by: Daniel Lezcano commit 90b2ca02a969963bb37c30b42510fc3dfb0a3ae7 Author: Daniel Lezcano Date: Fri Aug 5 00:43:19 2022 +0200 thermal/drivers/rockchip: Switch to new of API The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-4-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 48ad3b104b9ec85de58c2b4e38fdad9a26446f99 Author: Daniel Lezcano Date: Fri Aug 5 00:43:18 2022 +0200 thermal/of: Make new code and old code co-exist This transient change allows to use old and new OF together until all the drivers are converted to use the new OF API. This will go away when the old OF code will be removed. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-3-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 8fb5b71ed37dbe469eaa930e2ddc93ec9e305f3c Author: Daniel Lezcano Date: Tue Aug 9 10:56:29 2022 +0200 thermal/of: Fix free after use in thermal_of_unregister() The thermal zone is freed after being unregistered. The release method devm_thermal_zone_device_register() calls -> thermal_of_zone_device_unregister() This one calls thermal_zone_device_unregister() which frees the thermal zone. However, thermal_of_zone_device_unregister() does access this freed pointer to free different resources allocated by the thermal_of framework which is invalid. It results in a kernel panic: [ 1.915140] thermal_sys: Failed to find thermal zone for tmu id=2 [ 1.921279] qoriq_thermal 1f80000.tmu: Failed to register sensors [ 1.927395] qoriq_thermal: probe of 1f80000.tmu failed with error -22 [ 1.934189] Unable to handle kernel paging request at virtual address 01adadadadadad88 [ 1.942146] Mem abort info: [ 1.944948] ESR = 0x0000000096000004 [ 1.948708] EC = 0x25: DABT (current EL), IL = 32 bits [ 1.954042] SET = 0, FnV = 0 [ 1.957107] EA = 0, S1PTW = 0 [ 1.960253] FSC = 0x04: level 0 translation fault [ 1.965147] Data abort info: [ 1.968030] ISV = 0, ISS = 0x00000004 [ 1.971878] CM = 0, WnR = 0 [ 1.974852] [01adadadadadad88] address between user and kernel address ranges [ 1.982016] Internal error: Oops: 96000004 [#1] SMP [ 1.986907] Modules linked in: [ 1.989969] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.19.0-next-20220808-00080-g1c46f44502e0 #1697 [ 1.999135] Hardware name: Kontron KBox A-230-LS (DT) [ 2.004199] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 2.011185] pc : kfree+0x5c/0x3c0 [ 2.014516] lr : devm_thermal_of_zone_release+0x38/0x60 [ 2.019761] sp : ffff80000a22bad0 [ 2.023081] x29: ffff80000a22bad0 x28: 0000000000000000 x27: ffff800009960464 [ 2.030245] x26: ffff800009a16960 x25: 0000000000000006 x24: ffff800009f09a40 [ 2.037407] x23: ffff800009ab9008 x22: ffff800008d0eea8 x21: 01adadadadadad80 [ 2.044569] x20: 6b6b6b6b6b6b6b6b x19: ffff00200232b800 x18: 00000000fffffffb [ 2.051731] x17: ffff800008d0eea0 x16: ffff800008d07d44 x15: ffff800008d0d154 [ 2.056647] usb 1-1: new high-speed USB device number 2 using xhci-hcd [ 2.058893] x14: ffff800008d0cddc x13: ffff8000088d1c2c x12: ffff8000088d5034 [ 2.072597] x11: ffff8000088d46d4 x10: 0000000000000000 x9 : ffff800008d0eea8 [ 2.079759] x8 : ffff002000b1a158 x7 : bbbbbbbbbbbbbbbb x6 : ffff80000a0f53b8 [ 2.086921] x5 : ffff80000a22b960 x4 : 0000000000000000 x3 : 0000000000000000 [ 2.094082] x2 : fffffc0000000000 x1 : ffff002000838040 x0 : 01adb1adadadad80 [ 2.101244] Call trace: [ 2.103692] kfree+0x5c/0x3c0 [ 2.106666] devm_thermal_of_zone_release+0x38/0x60 [ 2.111561] release_nodes+0x64/0xd0 [ 2.115146] devres_release_all+0xbc/0x350 [ 2.119253] device_unbind_cleanup+0x20/0x70 [ 2.123536] really_probe+0x1a0/0x2e4 [ 2.127208] __driver_probe_device+0x80/0xec [ 2.131490] driver_probe_device+0x44/0x130 [ 2.135685] __driver_attach+0x104/0x1b4 [ 2.139619] bus_for_each_dev+0x7c/0xe0 [ 2.143465] driver_attach+0x30/0x40 [ 2.147048] bus_add_driver+0x160/0x210 [ 2.150894] driver_register+0x84/0x140 [ 2.154741] __platform_driver_register+0x34/0x40 [ 2.159461] qoriq_tmu_init+0x28/0x34 [ 2.163133] do_one_initcall+0x50/0x250 [ 2.166979] kernel_init_freeable+0x278/0x31c [ 2.171349] kernel_init+0x30/0x140 [ 2.174847] ret_from_fork+0x10/0x20 [ 2.178433] Code: b25657e2 d34cfc00 d37ae400 8b020015 (f94006a1) [ 2.184546] ---[ end trace 0000000000000000 ]--- Store the allocated resource pointers before the thermal zone is free and use them to release the resource after unregistering the thermal zone. Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization") Reported-by: Michael Walle Signed-off-by: Daniel Lezcano Tested-by: Michael Walle Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220809085629.509116-4-daniel.lezcano@linaro.org commit 9d6792df07367aab42009d2b24c62c11a5968ee3 Author: Daniel Lezcano Date: Tue Aug 9 10:56:27 2022 +0200 thermal/of: Return -ENODEV instead of -EINVAL if registration fails The previous version of the OF code was returning -ENODEV if no thermal zones description was found or if the lookup of the sensor in the thermal zones was not found. The backend drivers are expecting this return value as an information about skipping the sensor initialization and considered as normal. Fix the return value by replacing -EINVAL by -ENODEV and remove the error message as this missing is not considered as an error. Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Daniel Lezcano Tested-by: Michael Walle Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220809085629.509116-2-daniel.lezcano@linaro.org commit 45b8850b3d3071d5ea9e19ad4a29ad5f0b5d1ec1 Author: Dan Carpenter Date: Tue Aug 9 10:56:26 2022 +0200 thermal/of: Fix error code in of_thermal_zone_find() Currently, if we cannot find the correct thermal zone then this error path returns NULL and it would lead to an Oops in the caller. Return ERR_PTR(-EINVAL) instead. Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YvDzovkMCQecPDjz@kili Signed-off-by: Daniel Lezcano commit 3fd6d6e2b4e80fe45bfd1c8f01dff7d30a0f9b53 Author: Daniel Lezcano Date: Fri Aug 5 00:43:17 2022 +0200 thermal/of: Rework the thermal device tree initialization The following changes are reworking entirely the thermal device tree initialization. The old version is kept until the different drivers using it are converted to the new API. The old approach creates the different actors independently. This approach is the source of the code duplication in the thermal OF because a thermal zone is created but a sensor is registered after. The thermal zones are created unconditionnaly with a fake sensor at init time, thus forcing to provide fake ops and store all the thermal zone related information in duplicated structures. Then the sensor is initialized and the code looks up the thermal zone name using the device tree. Then the sensor is associated to the thermal zone, and the sensor specific ops are called with a second level of indirection from the thermal zone ops. When a sensor is removed (with a module unload), the thermal zone stays there with the fake sensor. The cooling device associated with a thermal zone and a trip point is stored in a list, again duplicating information, using the node name of the device tree to match afterwards the cooling devices. The new approach is simpler, it creates a thermal zone when the sensor is registered and destroys it when the sensor is removed. All the matching between the cooling device, trip points and thermal zones are done using the device tree, as well as bindings. The ops are no longer specific but uses the generic ones provided by the thermal framework. When the old code won't have any users, it can be removed and the remaining thermal OF code will be much simpler. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220804224349.1926752-2-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano commit 917df025e1db1286afb6e46914ae3e8b40241568 Author: Pierre-Louis Bossart Date: Thu Jul 14 09:10:43 2022 +0800 ASoC: codecs: show PING status on resume failures This helper should help identify cases where devices fall off the bus and don't resync. BugLink: https://github.com/thesofproject/linux/issues/3638 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220714011043.46059-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 79fe02cb7547fcc09e83b850cfd32896d7dc6289 Author: Pierre-Louis Bossart Date: Thu Jul 14 09:10:42 2022 +0800 soundwire: add sdw_show_ping_status() helper This helper provides an optional delay parameter to wait for devices to resync in case of errors, and checks that devices are indeed attached on the bus. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220714011043.46059-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 133547a1ef16cbdadb5c0023e5917924ae326dcc Author: Pierre-Louis Bossart Date: Thu Jul 14 09:10:41 2022 +0800 soundwire: intel/cadence: expose PING status in manager ops Simple indirection to existing register. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220714011043.46059-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 874de459488b8741afc0e9888d39f2e15a962b3d Author: Pierre-Louis Bossart Date: Thu Jul 14 09:10:40 2022 +0800 soundwire: add read_ping_status helper definition in manager ops The existing manager ops provide callbacks to transfer read/write commands, but don't allow for direct access to PING status register. This is accessible in all existing IP, and would help diagnose timeouts or resume issues by reporting the 'true' status instead of the internal status reported by the IP. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220714011043.46059-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 81c0386c1376da54f05d6916936db5220df9f97d Author: Linus Walleij Date: Tue Aug 16 22:48:32 2022 +0200 regmap: mmio: Support accelerared noinc operations Use the newly added callback for accelerated noinc MMIO to provide writesb, writesw, writesl, writesq, readsb, readsw, readsl and readsq. A special quirk is needed to deal with big endian regmaps: there are no accelerated operations defined for big endian, so fall back to calling the big endian operations itereatively for this case. The Hexagon architecture turns out to have an incomplete : writesb() is not implemented. Fix this by doing what other architectures do: include into the file. Cc: Brian Cain Cc: linux-hexagon@vger.kernel.org Cc: Arnd Bergmann Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220816204832.265837-2-linus.walleij@linaro.org Signed-off-by: Mark Brown commit c20cc099b30abd50f563e422aa72edcd7f92da55 Author: Linus Walleij Date: Tue Aug 16 22:48:31 2022 +0200 regmap: Support accelerated noinc operations Several architectures have accelerated operations for MMIO operations writing to a single register, such as writesb, writesw, writesl, writesq, readsb, readsw, readsl and readsq but regmap currently cannot use them because we have no hooks for providing an accelerated noinc back-end for MMIO. Solve this by providing reg_[read/write]_noinc callbacks for the bus abstraction, so that the regmap-mmio bus can use this. Currently I do not see a need to support this for custom regmaps so it is only added to the bus. Callbacks are passed a void * with the array of values and a count which is the number of items of the byte chunk size for the specific register width. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220816204832.265837-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit 26bdcc4ba12351642cd94339aa6996f96434dd47 Author: Srinivas Kandagatla Date: Tue Aug 16 18:21:29 2022 +0100 ASoC: core: remove setting platform_max in kcontrol macros platform_max should not be set by the driver, its intended for machine drivers or DT to override the max value for platform specific reasons. So remove setting this from Kcontrol macros. Setting this to max in these macros would limit the range when min value is less then zero. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220816172129.6661-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 4e82971f7b556cff3491c867e8840e7d788693b9 Author: Kevin Lu Date: Mon Aug 15 19:27:15 2022 +0800 ASoC: tlv320adcx140: Add a new kcontrol Add a new kcontrol for phase calib Signed-off-by: Kevin Lu Link: https://lore.kernel.org/r/20220815112715.21617-1-luminlong@139.com Signed-off-by: Mark Brown commit ea15d3bd3cd6e9483bb8aa664954c0a8cde253eb Author: Srinivas Kandagatla Date: Tue Aug 16 18:01:18 2022 +0100 ASoC: qcom: qdsp6: q6prm: add new clocks Add support to new clocks that are added in Q6DSP as part of newer version of LPASS support on SM8450 and SC8280XP. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220816170118.13470-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 43a70fb51b6a5e35ac5be5e3a86df6a203b1fce1 Author: Xin Gao Date: Wed Aug 17 01:51:05 2022 +0800 ASoC: Variable type completion 'unsigned int' is better than 'unsigned'. Signed-off-by: Xin Gao Link: https://lore.kernel.org/r/20220816175105.8084-1-gaoxin@cdjrlc.com Signed-off-by: Mark Brown commit 5c69f11ce85d4a8ea985a6d266574577e94c6506 Author: Yang Yingliang Date: Wed Aug 17 17:15:19 2022 +0800 ASoC: codecs: es8326: change es8326_regmap_config to static es8326_regmap_config is only used in es8326.c now, change it to static. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220817091519.2487385-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit c1a731c71359407eae4fd0a5fd675ef25a582764 Author: Laurentiu Mihalcea Date: Wed Aug 17 11:05:29 2022 +0300 ASoC: SOF: compress: Add support for computing timestamps We compute the number of pcm_io_frames by dividing the dai position to size of a frame (channels * sample size). Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Laurentiu Mihalcea Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20220817080529.10864-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 3ccbe6887747679d15e5c9524b23754281a24d9e Author: Laurentiu Mihalcea Date: Wed Aug 17 11:05:28 2022 +0300 ASoC: SOF: compress: Save channel count and sample bytes The purpose of this change is to enable the saving of the channel count and sample container bytes format parameters for later use to compute the timestamps. This is done when setting the compress stream parameters (in sof_compr_set_params). Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Laurentiu Mihalcea Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit e3091f0a3f563ad1c9b60c290752e1190b67ea97 Author: Daniel Baluta Date: Wed Aug 17 11:05:27 2022 +0300 ASoC: SOF: compress: Introduce sof_compr_stream This will keep SOF compress stream private data. So far we used snd_compr_tstamp to hold the private data but this is no longer enough as we need to hold other info like number of channels or sample bytes. Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20220817080529.10864-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit bab10ec9fd9dc1537b705d0dd3862dd5982b921f Author: Daniel Baluta Date: Wed Aug 17 11:05:26 2022 +0300 ASoC: SOF: compress: Remove byte offset computation Byte offset is the offset in the ring buffer to the DSP while posn_offset is an offset inside the stream_box where we keep position information. Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20220817080529.10864-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 5417197dd516a8e115aa69f62a7b7554b0c3829c Merge: 0630f64d25a0f b0bc1709b7688 Author: David S. Miller Date: Wed Aug 17 11:53:53 2022 +0100 Merge branch 'wwan-t7xx-fw-flashing-and-coredump-support' M Chetan Kumar says: ==================== net: wwan: t7xx: fw flashing & coredump support This patch series brings-in the support for FM350 wwan device firmware flashing & coredump collection using devlink interface. Below is the high level description of individual patches. Refer to individual patch commit message for details. PATCH1: Enables AP CLDMA communication for firmware flashing & coredump collection. PATCH2: Enables the infrastructure & queue configuration required for early ports enumeration. PATCH3: Implements device reset and rescan logic required to enter or exit fastboot mode. PATCH4: Implements devlink interface & uses the fastboot protocol for fw flashing and coredump collection. PATCH5: t7xx devlink commands documentation. ==================== Signed-off-by: David S. Miller commit b0bc1709b7688a094a70099f21669202588e7c06 Author: M Chetan Kumar Date: Tue Aug 16 09:54:17 2022 +0530 net: wwan: t7xx: Devlink documentation Document the t7xx devlink commands usage for fw flashing & coredump collection. Refer to t7xx.rst file for details. Signed-off-by: M Chetan Kumar Signed-off-by: Devegowda Chandrashekar Signed-off-by: David S. Miller commit 87dae9e70bf7be2bd8a3c561fe3ddf666eb8a7a4 Author: M Chetan Kumar Date: Tue Aug 16 09:54:05 2022 +0530 net: wwan: t7xx: Enable devlink based fw flashing and coredump collection This patch brings-in support for t7xx wwan device firmware flashing & coredump collection using devlink. Driver Registers with Devlink framework. Implements devlink ops flash_update callback that programs modem firmware. Creates region & snapshot required for device coredump log collection. On early detection of wwan device in fastboot mode driver sets up CLDMA0 HW tx/rx queues for raw data transfer then registers with devlink framework. Upon receiving firmware image & partition details driver sends fastboot commands for flashing the firmware. In this flow the fastboot command & response gets exchanged between driver and device. Once firmware flashing is success completion status is reported to user space application. Below is the devlink command usage for firmware flashing $devlink dev flash pci/$BDF file ABC.img component ABC Note: ABC.img is the firmware to be programmed to "ABC" partition. In case of coredump collection when wwan device encounters an exception it reboots & stays in fastboot mode for coredump collection by host driver. On detecting exception state driver collects the core dump, creates the devlink region & reports an event to user space application for dump collection. The user space application invokes devlink region read command for dump collection. Below are the devlink commands used for coredump collection. devlink region new pci/$BDF/mr_dump devlink region read pci/$BDF/mr_dump snapshot $ID address $ADD length $LEN devlink region del pci/$BDF/mr_dump snapshot $ID Signed-off-by: M Chetan Kumar Signed-off-by: Devegowda Chandrashekar Signed-off-by: Mishra Soumya Prakash Signed-off-by: David S. Miller commit 140424d90165d83c75b23ead7c3573bb6dd74f50 Author: Haijun Liu Date: Tue Aug 16 09:53:53 2022 +0530 net: wwan: t7xx: PCIe reset rescan PCI rescan module implements "rescan work queue". In firmware flashing or coredump collection procedure WWAN device is programmed to boot in fastboot mode and a work item is scheduled for removal & detection. The WWAN device is reset using APCI call as part driver removal flow. Work queue rescans pci bus at fixed interval for device detection, later when device is detect work queue exits. Signed-off-by: Haijun Liu Co-developed-by: Madhusmita Sahu Signed-off-by: Madhusmita Sahu Signed-off-by: Ricardo Martinez Signed-off-by: M Chetan Kumar Signed-off-by: Devegowda Chandrashekar Signed-off-by: David S. Miller commit 007f26f0d68e28509d369fe0e71845e095bdd955 Author: Haijun Liu Date: Tue Aug 16 09:53:40 2022 +0530 net: wwan: t7xx: Infrastructure for early port configuration To support cases such as FW update or Core dump, the t7xx device is capable of signaling the host that a special port needs to be created before the handshake phase. This patch adds the infrastructure required to create the early ports which also requires a different configuration of CLDMA queues. Signed-off-by: Haijun Liu Co-developed-by: Madhusmita Sahu Signed-off-by: Madhusmita Sahu Signed-off-by: Ricardo Martinez Signed-off-by: Devegowda Chandrashekar Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit d20ef656f9942950d67e29418512a6929682ad60 Author: Haijun Liu Date: Tue Aug 16 09:53:28 2022 +0530 net: wwan: t7xx: Add AP CLDMA The t7xx device contains two Cross Layer DMA (CLDMA) interfaces to communicate with AP and Modem processors respectively. So far only MD-CLDMA was being used, this patch enables AP-CLDMA. Rename small Application Processor (sAP) to AP. Signed-off-by: Haijun Liu Co-developed-by: Madhusmita Sahu Signed-off-by: Madhusmita Sahu Signed-off-by: Moises Veleta Signed-off-by: Devegowda Chandrashekar Signed-off-by: M Chetan Kumar Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit 0630f64d25a0f0a8c6a9ce9fde8750b3b561e6f5 Author: Florian Fainelli Date: Mon Aug 15 12:07:47 2022 -0700 net: phy: broadcom: Implement suspend/resume for AC131 and BCM5241 Implement the suspend/resume procedure for the Broadcom AC131 and BCM5241 type of PHYs (10/100 only) by entering the standard power down followed by the proprietary standby mode in the auxiliary mode 4 shadow register. On resume, the PHY software reset is enough to make it come out of standby mode so we can utilize brcm_fet_config_init() as the resume hook. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 2600bfa3df9944562d43d1f17016832a6ffa3b38 Author: Hans de Goede Date: Fri Apr 15 13:59:48 2022 +0200 ACPI: video: Add acpi_video_backlight_use_native() helper ATM on x86 laptops where we want userspace to use the acpi_video backlight device we often register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones, but registering 2 backlight devices for a single display really is undesirable. On x86 laptops where the native GPU backlight device should be used, the registering of other backlight devices is avoided by their drivers using acpi_video_get_backlight_type() and only registering their backlight if the return value matches their type. acpi_video_get_backlight_type() uses backlight_device_get_by_type(BACKLIGHT_RAW) to determine if a native driver is available and will never return native if this returns false. This means that the GPU's native backlight registering code cannot just call acpi_video_get_backlight_type() to determine if it should register its backlight, since acpi_video_get_backlight_type() will never return native until the native backlight has already registered. To fix this add a new internal native function parameter to acpi_video_get_backlight_type(), which when set to true will make acpi_video_get_backlight_type() behave as if a native backlight has already been registered. And add a new acpi_video_backlight_use_native() helper, which sets this to true, for use in native GPU backlight code. Changes in v2: - Replace adding a native parameter to acpi_video_get_backlight_type() with adding a new acpi_video_backlight_use_native() helper. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede commit 7d315c07eda7ae1bf54f2a05291504b006aecab5 Author: Sven Eckelmann Date: Wed Aug 17 12:01:44 2022 +0200 batman-adv: Drop unused headers in trace.h The commit 9abc291812d7 ("batman-adv: tracing: Use the new __vstring() helper") removed the usage of WARN_ON_ONCE and __dynamic_array in this file. But it was forgotten to adjust the headers accordingly (dropping the now no longer used ones). Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit ea92882b1fd8458338995db7c239fa59761af516 Author: Simon Wunderlich Date: Wed Aug 17 12:08:55 2022 +0200 batman-adv: Start new development cycle This version will contain all the (major or even only minor) changes for Linux 6.1. The version number isn't a semantic version number with major and minor information. It is just encoding the year of the expected publishing as Linux -rc1 and the number of published versions this year (starting at 0). Signed-off-by: Simon Wunderlich commit 78f48aa6f50b662bd74607f7415d68171339b2eb Author: Bo Liu Date: Tue Aug 16 05:49:19 2022 -0400 drm/i915/irq: Fix a "the the" typo There is an unexpected word "the" in the file i915_irq.c, fix it. Signed-off-by: Bo Liu Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220816094919.5419-1-liubo03@inspur.com commit 95657e6a4b5411c7fa074e0459bf081f8c117537 Merge: 8ea731d4c2ce7 b1a582e64bf22 Author: David S. Miller Date: Wed Aug 17 10:20:45 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/nex t-queue Tony Nguyen says: ==================== ice: detect and report PTP timestamp issues Jacob Keller says: This series fixes a few small issues with the cached PTP Hardware Clock timestamp used for timestamp extension. It also introduces extra checks to help detect issues with this logic, such as if the cached timestamp is not updated within the 2 second window. This introduces a few statistics similar to the ones already available in other Intel drivers, including tx_hwtstamp_skipped and tx_hwtstamp_timeouts. It is intended to aid in debugging issues we're seeing with some setups which might be related to incorrect cached timestamp values. ==================== Signed-off-by: David S. Miller commit 8ea731d4c2ce721a29b17c7a1ee82c28b80f00ba Author: Jie Meng Date: Mon Aug 15 13:29:00 2022 -0700 tcp: Make SYN ACK RTO tunable by BPF programs with TFO Instead of the hardcoded TCP_TIMEOUT_INIT, this diff calls tcp_timeout_init to initiate req->timeout like the non TFO SYN ACK case. Tested using the following packetdrill script, on a host with a BPF program that sets the initial connect timeout to 10ms. `../../common/defaults.sh` // Initialize connection 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1) = 0 +0 < S 0:0(0) win 32792 +0 > S. 0:0(0) ack 1 +.01 > S. 0:0(0) ack 1 +.02 > S. 0:0(0) ack 1 +.04 > S. 0:0(0) ack 1 +.01 < . 1:1(0) ack 1 win 32792 +0 accept(3, ..., ...) = 4 Signed-off-by: Jie Meng Acked-by: Neal Cardwell Acked-by: Yuchung Cheng Acked-by: Martin KaFai Lau Signed-off-by: David S. Miller commit 05099a846fd7deba30a3b8cfe56c77daf47e6b74 Author: Peng Fan Date: Fri Jul 8 16:56:28 2022 +0800 dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio blk ctrl Add interconnect property for i.MX8MP hsio blk ctrl Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 2928ff96496fc447f1566c94f7a654b6b22917b2 Author: Peng Fan Date: Fri Jul 8 16:56:27 2022 +0800 dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi blk ctrl Add interconnect property for i.MX8MP hdmi blk ctrl Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 6ad45d25dd0a3c4722ab892c17bcf5c5fabb0ed7 Author: Peng Fan Date: Fri Jul 8 16:56:26 2022 +0800 dt-bindings: soc: imx: add interconnect property for i.MX8MP media blk ctrl Add interconnect property for i.MX8MP mediamix blk ctrl Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 6dc85721df748385cfb011326ead52c01840b461 Author: Matt Roper Date: Tue Aug 16 14:06:01 2022 -0700 drm/i915/dg2: Add additional tuning settings Some additional MMIO tuning settings have appeared in the bspec's performance tuning guide section. One of the tuning settings here is also documented as formal workaround Wa_22012654132 for some steppings of DG2. However the tuning setting applies to all DG2 variants and steppings, making it a superset of the workaround. v2: - Move DRAW_WATERMARK to engine workaround section. It only moves into the engine context on future platforms. (Lucas) - CHICKEN_RASTER_2 needs to be handled as a masked register. (Lucas) Bspec: 68331 Cc: Lucas De Marchi Cc: Lionel Landwerlin Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220816210601.2041572-2-matthew.d.roper@intel.com commit 7e55536c9c488febfeedacebae0831c070e72c36 Author: Matt Roper Date: Tue Aug 16 14:06:00 2022 -0700 drm/i915/gt: Add dedicated function for non-ctx register tuning settings The bspec performance tuning section gives recommended settings that the driver should program for various MMIO registers. Although these settings aren't "workarounds" we use the workaround infrastructure to do this programming to make sure it is handled at the appropriate places and doesn't conflict with any real workarounds. Since more of these are starting to show up on recent platforms, it's a good time to create a dedicated function to hold them so that there's less ambiguity about how/where to implement new ones. Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220816210601.2041572-1-matthew.d.roper@intel.com commit cfc111d5391dda87310e7a385a9e17f300a8a97c Author: Zhengchao Shao Date: Mon Aug 15 14:10:23 2022 +0800 net: sched: delete unused input parameter in qdisc_create The input parameter p is unused in qdisc_create. Delete it. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220815061023.51318-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 56cb6a59da6797b010e070d5409bbdfd84a25b6f Author: Stefan Wahren Date: Mon Aug 15 10:06:26 2022 +0200 net: vertexcom: mse102x: Update email address in-tech smart charging is now chargebyte. So update the email address accordingly. Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20220815080626.9688-2-stefan.wahren@i2se.com Signed-off-by: Jakub Kicinski commit d56ef29afb392a6b4dc105e084ebffbbd9421a41 Author: Stefan Wahren Date: Mon Aug 15 10:06:25 2022 +0200 dt-bindings: vertexcom-mse102x: Update email address in-tech smart charging is now chargebyte. So update the email address accordingly. Signed-off-by: Stefan Wahren Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220815080626.9688-1-stefan.wahren@i2se.com Signed-off-by: Jakub Kicinski commit 52327d2e3996f2cac7df6de02623fd8d80fb4c85 Author: Zhengchao Shao Date: Mon Aug 15 11:04:17 2022 +0800 net: sched: remove the unused return value of unregister_qdisc Return value of unregister_qdisc is unused, remove it. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20220815030417.271894-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit a021e2aa4dc203f58f5dabf55aefe5b8891a97e6 Author: André Almeida Date: Wed Aug 10 20:28:58 2022 -0300 drm/amdgpu: Document gfx_off members of struct amdgpu_gfx Add comments to document gfx_off related members of struct amdgpu_gfx. Signed-off-by: André Almeida Signed-off-by: Alex Deucher commit e76115963be1700400405d300150eccf0e31cad0 Author: André Almeida Date: Wed Aug 10 20:28:57 2022 -0300 Documentation/gpu: Document GFXOFF's count and residency Add documentation explaining those two new files. While here, add a note about the value type. Signed-off-by: André Almeida Signed-off-by: Alex Deucher commit 1ed5a845c7c87aa79cef2f96e4165c8fad38837f Author: André Almeida Date: Wed Aug 10 20:28:56 2022 -0300 drm/amd/pm: Implement GFXOFF's entry count and residency for vangogh Implement functions to get and set GFXOFF's entry count and residency for vangogh. Signed-off-by: André Almeida Signed-off-by: Alex Deucher commit 0ad7347a64ac4baec1786810709eebedc5f823d5 Author: André Almeida Date: Wed Aug 10 20:28:55 2022 -0300 drm/amd: Add detailed GFXOFF stats to debugfs Add debugfs interface to log GFXOFF statistics: - Read amdgpu_gfxoff_count to get the total GFXOFF entry count at the time of query since system power-up - Write 1 to amdgpu_gfxoff_residency to start logging, and 0 to stop. Read it to get average GFXOFF residency % multiplied by 100 during the last logging interval. Both features are designed to be keep the values persistent between suspends. Signed-off-by: André Almeida Signed-off-by: Alex Deucher commit 30f2d2e49e826c2dda35153d2e108d06f6d7d9dc Author: Tales Aparecida Date: Thu Aug 11 17:43:27 2022 -0300 drm/amd/display: fix minor codestyle problems Fixes five checkpatch warnings: CHECK: Please don't use multiple blank lines + + ERROR: Macros with complex values should be enclosed in parentheses +#define MAX_I64 \ + (int64_t)((1ULL << 63) - 1) WARNING: Missing a blank line after declarations + struct bw_fixed res; + ASSERT(value < BW_FIXED_MAX_I32 && value > BW_FIXED_MIN_I32); ERROR: that open brace { should be on the previous line + do + { ERROR: that open brace { should be on the previous line + if (remainder >= arg2_value) + { Signed-off-by: Tales Aparecida Signed-off-by: Alex Deucher commit 6ae0632d17759852c07e2d1e0a31c728eb6ba246 Author: David Gow Date: Thu Aug 11 17:43:26 2022 -0300 drm/amd/display: fix overflow on MIN_I64 definition The definition of MIN_I64 in bw_fixed.c can cause gcc to whinge about integer overflow, because it is treated as a positive value, which is then negated. The temporary positive value is not necessarily representable. This causes the following warning: ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/calcs/bw_fixed.c:30:19: warning: integer overflow in expression ‘-9223372036854775808’ of type ‘long long int’ results in ‘-9223372036854775808’ [-Woverflow] 30 | (int64_t)(-(1LL << 63)) | ^ Writing out (-MAX_I64 - 1) works instead. Signed-off-by: David Gow Signed-off-by: Tales Aparecida Signed-off-by: Alex Deucher commit b34e44bc6156717543b784b50f4d2fd23f299700 Author: min tang Date: Sat Aug 13 23:34:21 2022 +0800 drm/amd/display: Unneeded semicolon There is no semicolon after '}' in line 510. Signed-off-by: min tang Signed-off-by: Alex Deucher commit 52a3859fd0b85e8dce32b6aac4f8fd18a25626c5 Author: min tang Date: Sat Aug 13 23:10:46 2022 +0800 drm/amd/display: Fix comment typo The double `aligned' is duplicated in line 1070, remove one. Signed-off-by: min tang Signed-off-by: Alex Deucher commit 01b537eeb049b98d7efc8f9c93c2608ef26ec338 Author: Rodrigo Siqueira Date: Thu Aug 11 16:01:33 2022 -0400 drm/amd/display: Remove unused code We have some old code associated with DML, which we had plans to use, but at some point, we just moved away from it. This commit removes the dml_wrapper* files since they are not used anymore. Reported-by: Magali Lemes Acked-by: Alex Deucher Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 1d32af4facd075542b26550e679ab53b5b8b5c5f Author: shaoyunl Date: Fri Aug 5 11:47:20 2022 -0400 drm/amdgpu: use sjt mec fw on aldebaran for sriov The second jump table is required on live migration or mulitple VF configuration on Aldebaran. With this implemented, the first level jump table(hw used) will be same, mec fw internal will use the second level jump table jump to the real functionality implementation. so the different VF can load different version of MEC as long as they support sjt Signed-off-by: shaoyunl Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0a8c91d7b694d122afe513e95908e8497cddc195 Author: Hamza Mahfooz Date: Mon Aug 8 16:22:42 2022 -0400 drm/amd/display: include soc._clock_tmp[] into DC's scratch region Currently, we are using soc._clock_tmp[] to temporarily store and modify data from soc.clock_limits[] before copying it back into soc.clock_limits[] (because modifying data directly in soc.clock_limits[] causes unintended behavior). However, this approach has a number of downsides, such as: 1. struct _vcs_dpi_soc_bounding_box_st's creation/destruction aren't well defined (which could mean more unintended behavior). 2. Throwing "temp" varibles in structs everywhere doesn't make for a particularly readable codebase. For these reasons, we should get rid of soc._clock_tmp[] by defining a struct scratch within struct dc that, contains within it all of the temporary variables (including _clock_tmp[]) such that it is obvious how they are intended to be used. Co-authored-by: Leo Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a4d3230353e493d98263c5d7f03ee6403ed82d71 Author: Hamza Mahfooz Date: Mon Jul 18 16:50:45 2022 -0400 drm/amd/display: implement DSC pass-through support Currently, we only attempt to setup DSC at the virtual DPCD port, however many modern displays come with DSC support and MST hubs can now support DSC pass-through. So, to more optimally make use of the available bandwidth, use DSC pass-through when possible by adding DSC pass-through enablement support into the DSC enable sequence. Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8350bb59e63d0909b0d65af2d9710026e0f902ce Author: Hamza Mahfooz Date: Thu Jul 21 12:55:34 2022 -0400 drm/amd/display: consider DSC pass-through during mode validation Add a mode validation routine for DSC pass-through. Both the link from source to hub, and the link from hub to monitor are checked, according to the current link training result and full pbn returned by enum path resource sideband message. Pick up the minimum value as the bandwidth bottleneck for the end to end link bandwidth constraint, and check if the maximum DSC decompression bandwidth can fit. v2: squash in DSC CONFIG_DRM_AMD_DC_DCN compilation fix (Hamza) Co-authored-by: Fangzhi Zuo Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 34f667634a0dcee26d9873ab1c819bdd6cdf485a Author: Hamza Mahfooz Date: Thu Aug 4 14:06:55 2022 -0400 drm/dp_mst: add passthrough_aux to struct drm_dp_mst_port Currently, there is no way to identify if DSC pass-through can be enabled and what aux DSC pass-through requests ought to be sent to. So, add a variable to struct drm_dp_mst_port that keeps track of the aforementioned information. Reviewed-by: Lyude Paul Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 33fa4f1df53076d0078be091d5a88d457de54936 Author: Melissa Wen Date: Thu Aug 4 14:01:07 2022 -0100 Documentation/gpu/amdgpu/amdgpu_dm: add DM docs for pixel blend mode AMD GPU display manager (DM) maps DRM pixel blend modes (None, Pre-multiplied, Coverage) to MPC hw blocks through blend configuration options. Describe relevant elements and how to set and test them to get the expected DRM blend mode on DCN hw. v2: - add ref tag (Tales) Signed-off-by: Melissa Wen Reviewed-by: Tales Aparecida Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 43d61f6d8f4d2da7df116eac4f83106ab1a29090 Author: Melissa Wen Date: Thu Aug 4 14:01:06 2022 -0100 drm/amd/display: add doc entries for MPC blending configuration Describe structs and enums used to set blend mode properties to MPC blocks. Some pieces of information are already available as code comments, and were just formatted. Others were collected and summarised from discussions on AMD issue tracker[1][2]. [1] https://gitlab.freedesktop.org/drm/amd/-/issues/1734 [2] https://gitlab.freedesktop.org/drm/amd/-/issues/1769 v2: - fix typos (Tales) - add MPCC to MPC entry in the glossary Signed-off-by: Melissa Wen Reviewed-by: Tales Aparecida Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 78e16ac1e764def96f4c89b433d379acd68881c7 Author: Melissa Wen Date: Thu Aug 4 14:01:05 2022 -0100 Documentation/amdgpu/display: add DC color caps info Add details about color correction capabilities and explain a bit about differences between DC hw generations and also how they are mapped between DRM and DC interface. Two schemas for DCN 2.0 and 3.0 (converted to svg from the original png) is included to illustrate it. They were obtained from a discussion[1] in the amd-gfx mailing list. [1] https://lore.kernel.org/amd-gfx/20220422142811.dm6vtk6v64jcwydk@mail.igalia.com/ v1: - remove redundant comments (Harry) - fix typos (Harry) v2: - reword introduction of color section - add co-dev tag for Harry - who provided most of the info - fix typos (Tales) - describe missing struct parameters (Tales and Siqueira) Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Signed-off-by: Melissa Wen Reviewed-by: Tales Aparecida Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit cdeec9a11c3c95f33a3e2be36ef3fabd60b8ebf2 Author: Melissa Wen Date: Thu Aug 4 14:01:04 2022 -0100 Documentation/amdgpu_dm: Add DM color correction documentation AMDGPU DM maps DRM color management properties (degamma, ctm and gamma) to DC color correction entities. Part of this mapping is already documented as code comments and can be converted as kernel docs. v2: - rebase to amd-staging-drm-next - fix typos (Tales) - undo kernel-docs inside functions (Tales) Signed-off-by: Melissa Wen Reviewed-by: Harry Wentland Reviewed-by: Tales Aparecida Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit db910f10d5f4b7e6c9997e370f586eca54c22430 Author: Rodrigo Siqueira Date: Tue May 10 10:07:33 2022 -0400 drm/amd/display: Document some of the DML structs Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit bf0dec4604979e09be60b7dc41066e3d07d29bf9 Author: Rodrigo Siqueira Date: Fri Mar 11 14:26:58 2022 -0500 drm/amd/display: Expand documentation for timing The timing programming inside DCN is far from trivial, it has multiple parameters associated with that, and the lack of documentation does not help comprehend this already complicated topic. This commit tries to improve this situation by expanding the documentation of dc_crtc_timing and the VTG program function. Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ea76895ffab1a610fa162ca56f99048cc161c293 Author: Rodrigo Siqueira Date: Fri Apr 1 14:46:07 2022 -0400 drm/amd/display: Document pipe split policy In the DCN code, we can find some references to three different pipe split policies but no clear description. This commit adds some kernel-doc that explains more about these options and a little bit of their impact. Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c620e79bb695b866b2cefa0135f7eddd0d5bc9d7 Author: Rodrigo Siqueira Date: Mon Feb 21 15:22:50 2022 -0500 drm/amd/display: Add some extra kernel doc to amdgpu_dm Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fdf17f1084c1d3fa0a2fb38fa0625b13b7bb0fff Author: Rodrigo Siqueira Date: Fri Aug 27 10:34:37 2021 -0400 drm/amd/display: Add basic kernel doc to CRC code under DC Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 60c9353139a0770e6057b3ed2e115deb95964e49 Author: Rodrigo Siqueira Date: Sun May 16 11:29:26 2021 -0400 drm/amd/display: Add documentation to some of the cursor struct Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 194eb174cbe4fe2b3376ac30acca2dc8c8beca00 Author: Victor Zhao Date: Fri Jun 24 12:00:06 2022 +0800 drm/amdgpu: reduce reset time In multi container use case, reset time is important, so skip ring tests and cp halt wait during ip suspending for reset as they are going to fail and cost more time on reset v2: add a hang flag to indicate the reset comes from a job timeout, skip ring test and cp halt wait in this case v3: move hang flag to adev Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 72fadb13674f807f10a168fb7d020dde58ce6b0b Author: Victor Zhao Date: Fri Jun 24 11:59:21 2022 +0800 drm/amdgpu: revert context to stop engine before mode2 reset For some hang caused by slow tests, engine cannot be stopped which may cause resume failure after reset. In this case, force halt engine by reverting context addresses Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit bfaced6ee77484d8b9c6baf86a8e9406f80108c5 Author: Victor Zhao Date: Tue Jun 21 16:59:44 2022 +0800 drm/amdgpu: save and restore gc hub regs Save and restore gfxhub regs as they will be reset during mode 2 Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 5bd8d53f6fa53eab5433698d1362dae2aa53c1cc Author: Victor Zhao Date: Tue Jun 14 10:48:11 2022 +0800 drm/amdgpu: add debugfs amdgpu_reset_level Introduce amdgpu_reset_level debugfs in order to help debug and test specific type of reset. Also helps blocking unwanted type of resets. By default, mode2 reset will not be enabled v2: make this debugfs in adev and use debugfs_create_u32 Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit dac6b80818ac2353631c5a33d140d8d5508e2957 Author: Victor Zhao Date: Thu Jul 28 10:39:23 2022 +0800 drm/amdgpu: let mode2 reset fallback to default when failure - introduce AMDGPU_SKIP_MODE2_RESET flag - let mode2 reset fallback to default reset method if failed v2: move this part out from the asic specific part Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 672c0218e3e22ccaeb2911da8d3b784d3b6cc1d8 Author: Victor Zhao Date: Thu Jul 28 10:44:47 2022 +0800 drm/amdgpu: add mode2 reset for sienna_cichlid To meet the requirement for multi container usecase which needs a quicker reset and not causing VRAM lost, adding the Mode2 reset handler for sienna_cichlid. v2: move skip mode2 flag part separately v3: remove the use of asic_reset_res Signed-off-by: Victor Zhao Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit ed5d44d42c95e8a13bb54e614d2269c8740667f9 Author: Frederick Lawler Date: Mon Aug 15 11:20:28 2022 -0500 selinux: Implement userns_create hook Unprivileged user namespace creation is an intended feature to enable sandboxing, however this feature is often used to as an initial step to perform a privilege escalation attack. This patch implements a new user_namespace { create } access control permission to restrict which domains allow or deny user namespace creation. This is necessary for system administrators to quickly protect their systems while waiting for vulnerability patches to be applied. This permission can be used in the following way: allow domA_t domA_t : user_namespace { create }; Signed-off-by: Frederick Lawler Signed-off-by: Paul Moore commit d5810139cca39cf2854728b465f8bada4a445302 Author: Frederick Lawler Date: Mon Aug 15 11:20:27 2022 -0500 selftests/bpf: Add tests verifying bpf lsm userns_create hook The LSM hook userns_create was introduced to provide LSM's an opportunity to block or allow unprivileged user namespace creation. This test serves two purposes: it provides a test eBPF implementation, and tests the hook successfully blocks or allows user namespace creation. This tests 3 cases: 1. Unattached bpf program does not block unpriv user namespace creation. 2. Attached bpf program allows user namespace creation given CAP_SYS_ADMIN privileges. 3. Attached bpf program denies user namespace creation for a user without CAP_SYS_ADMIN. Acked-by: KP Singh Signed-off-by: Frederick Lawler Signed-off-by: Paul Moore commit 401e64b3a4af4c7a2f6a00337232a3cf0bb757ed Author: Frederick Lawler Date: Mon Aug 15 11:20:26 2022 -0500 bpf-lsm: Make bpf_lsm_userns_create() sleepable Users may want to audit calls to security_create_user_ns() and access user space memory. Also create_user_ns() runs without pagefault_disabled(). Therefore, make bpf_lsm_userns_create() sleepable for mandatory access control policies. Acked-by: Alexei Starovoitov Acked-by: Christian Brauner (Microsoft) Acked-by: KP Singh Signed-off-by: Frederick Lawler Signed-off-by: Paul Moore commit 7cd4c5c2101cb092db00f61f69d24380cf7a0ee8 Author: Frederick Lawler Date: Mon Aug 15 11:20:25 2022 -0500 security, lsm: Introduce security_create_user_ns() User namespaces are an effective tool to allow programs to run with permission without requiring the need for a program to run as root. User namespaces may also be used as a sandboxing technique. However, attackers sometimes leverage user namespaces as an initial attack vector to perform some exploit. [1,2,3] While it is not the unprivileged user namespace functionality, which causes the kernel to be exploitable, users/administrators might want to more granularly limit or at least monitor how various processes use this functionality, while vulnerable kernel subsystems are being patched. Preventing user namespace already creation comes in a few of forms in order of granularity: 1. /proc/sys/user/max_user_namespaces sysctl 2. Distro specific patch(es) 3. CONFIG_USER_NS To block a task based on its attributes, the LSM hook cred_prepare is a decent candidate for use because it provides more granular control, and it is called before create_user_ns(): cred = prepare_creds() security_prepare_creds() call_int_hook(cred_prepare, ... if (cred) create_user_ns(cred) Since security_prepare_creds() is meant for LSMs to copy and prepare credentials, access control is an unintended use of the hook. [4] Further, security_prepare_creds() will always return a ENOMEM if the hook returns any non-zero error code. This hook also does not handle the clone3 case which requires us to access a user space pointer to know if we're in the CLONE_NEW_USER call path which may be subject to a TOCTTOU attack. Lastly, cred_prepare is called in many call paths, and a targeted hook further limits the frequency of calls which is a beneficial outcome. Therefore introduce a new function security_create_user_ns() with an accompanying userns_create LSM hook. With the new userns_create hook, users will have more control over the observability and access control over user namespace creation. Users should expect that normal operation of user namespaces will behave as usual, and only be impacted when controls are implemented by users or administrators. This hook takes the prepared creds for LSM authors to write policy against. On success, the new namespace is applied to credentials, otherwise an error is returned. Links: 1. https://nvd.nist.gov/vuln/detail/CVE-2022-0492 2. https://nvd.nist.gov/vuln/detail/CVE-2022-25636 3. https://nvd.nist.gov/vuln/detail/CVE-2022-34918 4. https://lore.kernel.org/all/1c4b1c0d-12f6-6e9e-a6a3-cdce7418110c@schaufler-ca.com/ Reviewed-by: Christian Brauner (Microsoft) Reviewed-by: KP Singh Signed-off-by: Frederick Lawler Signed-off-by: Paul Moore commit 807662cac66af0dfca60ce1cf784063da6ec2f65 Author: Artem Savkov Date: Tue Aug 16 07:52:31 2022 +0200 selftests/bpf: Fix attach point for non-x86 arches in test_progs/lsm Use SYS_PREFIX macro from bpf_misc.h instead of hard-coded '__x64_' prefix for sys_setdomainname attach point in lsm test. Signed-off-by: Artem Savkov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220816055231.717006-1-asavkov@redhat.com commit 8ba9249396bef37cb68be9e8dee7847f1737db9d Author: Lyude Paul Date: Tue Aug 16 14:04:36 2022 -0400 drm/nouveau/kms/nv140-: Disable interlacing As it turns out: while Nvidia does actually have interlacing knobs on their GPU still pretty much no current GPUs since Volta actually support it. Trying interlacing on these GPUs will result in NVDisplay being quite unhappy like so: nouveau 0000:1f:00.0: disp: chid 0 stat 00004802 reason 4 [INVALID_ARG] mthd 2008 data 00000001 code 00080000 nouveau 0000:1f:00.0: disp: chid 0 stat 10005080 reason 5 [INVALID_STATE] mthd 0200 data 00000001 code 00000001 So let's fix this by following the same behavior Nvidia's driver does and disable interlacing entirely. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Reviewed-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20220816180436.156310-1-lyude@redhat.com commit 6256547352fa21356de8d26b058e50d719ecc0d2 Merge: 63d375b9f2a99 a25e1183ea2d0 Author: Mark Brown Date: Tue Aug 16 17:33:11 2022 +0100 ASoC: Intel: HSW and BDW updates Merge series from Cezary Rojewski : Sharing this PR as it touches on cross-driver subjects. Four commits yet two subject. Given the small delta, decided to combine within single PR here. commit b18c56a654d6f452178d4c8bc4b67ec35bcb464b Author: Rob Herring Date: Wed Aug 3 14:16:38 2022 -0600 dt-bindings: arm: psci: Relax and simplify compatible constraints Even PSCI v1.0 compliant implementations may support v0.1 clients (i.e. "arm,psci"). Relax the compatible schema such that an implementation can claim 1.0, 0.2, and 0.1 compatibility. In the process, the schema can be simplified a bit by using 'minItems' instead of separate 'oneOf' entries. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220803201639.2552581-1-robh@kernel.org commit b1a582e64bf2229e1914068f8ee81a6f83eb0373 Author: Jacob Keller Date: Wed Jul 27 16:16:02 2022 -0700 ice: introduce ice_ptp_reset_cached_phctime function If the PTP hardware clock is adjusted, the ice driver must update the cached PHC timestamp. This is required in order to perform timestamp extension on the shorter timestamps captured by the PHY. Currently, we simply call ice_ptp_update_cached_phctime in the settime and adjtime callbacks. This has a few issues: 1) if ICE_CFG_BUSY is set because another thread is updating the Rx rings, we will exit with an error. This is not checked, and the functions do not re-schedule the update. This could leave the cached timestamp incorrect until the next scheduled work item execution. 2) even if we did handle an update, any currently outstanding Tx timestamp would be extended using the wrong cached PHC time. This would produce incorrect results. To fix these issues, introduce a new ice_ptp_reset_cached_phctime function. This function calls the ice_ptp_update_cached_phctime, and discards outstanding Tx timestamps. If the ice_ptp_update_cached_phctime function fails because ICE_CFG_BUSY is set, we log a warning and schedule the thread to execute soon. The update function is modified so that it always updates the cached copy in the PF regardless. This ensures we have the most up to date values possible and minimizes the risk of a packet timestamp being extended with the wrong value. It would be nice if we could skip reporting Rx timestamps until the cached values are up to date. However, we can't access the Rx rings while ICE_CFG_BUSY is set because they are actively being updated by another thread. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 4b1251bdd18886ce51741d68e4e4f3f4c6982153 Author: Jacob Keller Date: Wed Jul 27 16:16:01 2022 -0700 ice: re-arrange some static functions in ice_ptp.c A following change is going to want to make use of ice_ptp_flush_tx_tracker earlier in the ice_ptp.c file. To make this work, move the Tx timestamp tracking functions higher up in the file, and pull the ice_ptp_update_cached_timestamp function below them. This should have no functional change. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit cd25507a31e18321644833eab0e739cc74eba3b5 Author: Jacob Keller Date: Wed Jul 27 16:16:00 2022 -0700 ice: track and warn when PHC update is late The ice driver requires a cached copy of the PHC time in order to perform timestamp extension on Tx and Rx hardware timestamp values. This cached PHC time must always be updated at least once every 2 seconds. Otherwise, the math used to perform the extension would produce invalid results. The updates are supposed to occur periodically in the PTP kthread work item, which is scheduled to run every half second. Thus, we do not expect an update to be delayed for so long. However, there are error conditions which can cause the update to be delayed. Track this situation by using jiffies to determine approximately how long ago the last update occurred. Add a new statistic and a dev_warn when we have failed to update the cached PHC time. This makes the error case more obvious. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit f020481be540cfed4747b966e5c603299856f291 Author: Jacob Keller Date: Wed Jul 27 16:15:59 2022 -0700 ice: track Tx timestamp stats similar to other Intel drivers Several Intel networking drivers which support PTP track when Tx timestamps are skipped or when they timeout without a timestamp from hardware. The conditions which could cause these events are rare, but it can be useful to know when and how often they occur. Implement similar statistics for the ice driver, tx_hwtstamp_skipped, tx_hwtstamp_timeouts, and tx_hwtstamp_flushed. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit cf6b82fd3fbc8f747333ef5005798a90b5345bd4 Author: Jacob Keller Date: Wed Jul 27 16:15:58 2022 -0700 ice: initialize cached_phctime when creating Rx rings When we create new Rx rings, the cached_phctime field is zero initialized. This could result in incorrect timestamp reporting due to the cached value not yet being updated. Although a background task will periodically update the cached value, ensure it matches the existing cached value in the PF structure at ring initialization. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit b3b173745c8cab1e24d6821488b60abed3acb24d Author: Jacob Keller Date: Wed Jul 27 16:15:57 2022 -0700 ice: set tx_tstamps when creating new Tx rings via ethtool When the user changes the number of queues via ethtool, the driver allocates new rings. This allocation did not initialize tx_tstamps. This results in the tx_tstamps field being zero (due to kcalloc allocation), and would result in a NULL pointer dereference when attempting a transmit timestamp on the new ring. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit d6da19c9cace63290ccfccb1fc35151ffefc0bec Author: Amir Goldstein Date: Tue Aug 16 17:53:17 2022 +0300 locks: fix TOCTOU race when granting write lease Thread A trying to acquire a write lease checks the value of i_readcount and i_writecount in check_conflicting_open() to verify that its own fd is the only fd referencing the file. Thread B trying to open the file for read will call break_lease() in do_dentry_open() before incrementing i_readcount, which leaves a small window where thread A can acquire the write lease and then thread B completes the open of the file for read without breaking the write lease that was acquired by thread A. Fix this race by incrementing i_readcount before checking for existing leases, same as the case with i_writecount. Use a helper put_file_access() to decrement i_readcount or i_writecount in do_dentry_open() and __fput(). Fixes: 387e3746d01c ("locks: eliminate false positive conflicts for write lease") Reviewed-by: Jeff Layton Signed-off-by: Amir Goldstein Signed-off-by: Al Viro commit 63d375b9f2a99bb111e3fb5f3e2442a391988949 Author: Kai Vehmanen Date: Tue Aug 16 16:05:10 2022 +0300 ASoC: SOF: Intel: pci-tgl: use RPL specific firmware definitions Split out firmware definitions for Intel Raptor Lake platforms. Signed-off-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Suggested-by: Gopal Vamshi Krishna Link: https://lore.kernel.org/r/20220816130510.190427-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 5f3db54cfbc21772d984372fdcc5bb17b57f425f Author: Kai Vehmanen Date: Tue Aug 16 16:05:09 2022 +0300 ASoC: Intel: common: add ACPI matching tables for Raptor Lake Initial support for RPL w/ RT711 Signed-off-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Tested-by: Gopal Vamshi Krishna Link: https://lore.kernel.org/r/20220816130510.190427-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 2d7ea7635a1286d5954b155a47e862cbcd48fff5 Merge: 3b43a713f6b09 12229b7e50cfa Author: Mark Brown Date: Tue Aug 16 14:47:35 2022 +0100 Add support for linked list to store acp_stream and tdm support. Merge series from Venkata Prasad Potturu : This patch is to add support for linked list to store acp_stream instead static array and add tdm support for acp I2S stream. commit 680f8666baf6b4a6cc368dfff6614010ec23c51d Author: Uwe Kleine-König Date: Mon Jul 18 14:14:08 2022 +0200 interconnect: Make icc_provider_del() return void All users ignore the return value of icc_provider_del(). Consequently make it not return an error code. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-8-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit fa80a2994d35af064b194fe9bb587ae8ea05d379 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:07 2022 +0200 interconnect: sm8450: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-7-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit f221bd781f25fa0ebb4c7e9553a9154a9722fd39 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:06 2022 +0200 interconnect: osm-l3: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-6-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 919d4e1a207e9e837404c49e1386f210ac305f67 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:05 2022 +0200 interconnect: msm8974: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-5-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 4681086c9becc283ba4f8ed6be315918e1e0b917 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:04 2022 +0200 interconnect: icc-rpmh: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-4-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 8ef2ca20754d84369971aac261ad7f99801adf87 Author: Uwe Kleine-König Date: Mon Jul 18 14:14:03 2022 +0200 interconnect: icc-rpm: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-3-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 7ec26b8dcc5c770a06a7e7ca2e1c888e2115bf0b Author: Uwe Kleine-König Date: Mon Jul 18 14:14:02 2022 +0200 interconnect: imx: Ignore return value of icc_provider_del() in .remove() icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220718121409.171773-2-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 8379cf83fe6d57a12952de6dcaf7a7fbd7b364fc Author: Grzegorz Szymaszek Date: Fri Aug 5 18:28:12 2022 +0200 staging: r8188eu: drop the DRIVERVERSION macro Since the driver is currently in the kernel, the module version macro is not necessary. Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/ Suggested-by: Greg Kroah-Hartman Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Grzegorz Szymaszek Link: https://lore.kernel.org/r/39e6b702918b7bcc59dec381022c1d1b97c2046e.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman commit d8798308023735e972efd17a9080ef69e362a7a8 Author: Grzegorz Szymaszek Date: Fri Aug 5 18:28:05 2022 +0200 staging: r8188eu: drop the DRV_NAME macro The DRV_NAME macro is not used anywhere; KBUILD_MODNAME should be used instead. Remove the macro declaration. Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/ Suggested-by: Greg Kroah-Hartman Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Grzegorz Szymaszek Link: https://lore.kernel.org/r/f8d7b4ba4533a315ebd6711f17bbfd81e99ccf5a.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman commit da234c27a52c5f43a16240eafe13c62c358210d5 Author: Grzegorz Szymaszek Date: Fri Aug 5 18:27:53 2022 +0200 staging: r8188eu: use KBUILD_MODNAME instead of a string constant The field .usbdrv.name of the struct rtw_usb_drv hardcoded the module (driver) name as a constant string. Replace the string with the KBUILD_MODNAME macro. Link: https://lore.kernel.org/lkml/Yuy7QSh%2FclQ5Ki09@kroah.com/ Suggested-by: Greg Kroah-Hartman Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Grzegorz Szymaszek Link: https://lore.kernel.org/r/0325540ba8be0a3dc4083d22e484a8a31fb2a892.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman commit d987294a7e95160d1f322d23f07c8ed48aa8b05a Author: Grzegorz Szymaszek Date: Fri Aug 5 18:27:41 2022 +0200 staging: r8188eu: set firmware path in a macro The r8188eu driver requires a firmware file, the path of which was hardcoded as constant strings in two places: (1) in core/rtw_fw.c, in function load_firmware(), (2) in os_dep/os_intfs.c, in the MODULE_FIRMWARE() call. Declare the path using a macro, FW_RTL8188EU, and replace the above constant strings with the macro. That's the way it is done in many other drivers. The new macro is defined in include/drv_types.h, because that file is already included by both of the above files (or at least their headers) and because it already contains other driver constants, like its name and version. Link: https://lore.kernel.org/lkml/YuoQ37PIKzWO1zIY@kroah.com/ Suggested-by: Greg Kroah-Hartman Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Grzegorz Szymaszek Link: https://lore.kernel.org/r/60dc57fc73e8e6e8e3aaae68784f4be932547bf5.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman commit 816ca75992ae1cd92a0b884037968b057ef3b682 Author: Grzegorz Szymaszek Date: Tue Aug 2 19:18:44 2022 +0200 staging: r8188eu: add firmware dependency The old rtl8188eu module, removed in commit 55dfa29b43d2 ("staging: rtl8188eu: remove rtl8188eu driver from staging dir") (Linux kernel v5.15-rc1), required (through a MODULE_FIRMWARE call()) the rtlwifi/rtl8188eufw.bin firmware file, which the new r8188eu driver no longer requires. I have tested a few RTL8188EUS-based Wi-Fi cards and, while supported by both drivers, they do not work when using the new one and the firmware wasn't manually loaded. According to Larry Finger, the module maintainer, all such cards need the firmware and the driver should depend on it (see the linked mails). Add a proper MODULE_FIRMWARE() call, like it was done in the old driver. Thanks to Greg Kroah-Hartman and Larry Finger for quick responses to my questions. Link: https://answers.launchpad.net/ubuntu/+source/linux-meta-hwe-5.15/+question/702611 Link: https://lore.kernel.org/lkml/YukkBu3TNODO3or9@nx64de-df6d00/ Signed-off-by: Grzegorz Szymaszek Link: https://lore.kernel.org/r/YulcdKfhA8dPQ78s@nx64de-df6d00 Acked-by: Phillip Potter Acked-by: Larry Finger Signed-off-by: Greg Kroah-Hartman commit 654d1855bc40c6b0c1f2802ff0dc6a5b8b744034 Author: Michael Straube Date: Sun Aug 7 20:15:38 2022 +0200 staging: r8188eu: make rtw_init_recv_timer() static The function rtw_init_recv_timer() is only used in rtw_sta_mgt.c. Make it static and remove the now empty file os_dep/recv_linux.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220807181538.8499-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 183f1e8d78dee34c20f1ccf22968242e92b1e6cb Author: Michael Straube Date: Sun Aug 7 20:15:37 2022 +0200 staging: r8188eu: make rtw_recv_indicatepkt() static The function rtw_recv_indicatepkt() is only used in rtw_recv.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220807181538.8499-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 51c89d3ce533fed953a73c7796a14255e3b419ed Author: Michael Straube Date: Sun Aug 7 20:15:36 2022 +0200 staging: r8188eu: make rtw_handle_tkip_mic_err() static The function rtw_handle_tkip_mic_err() is only used in rtw_recv.c. Make it static. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220807181538.8499-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ca623eb6def04c843937d6e4c7c5b50d907894e6 Author: Michael Straube Date: Sun Aug 7 20:15:35 2022 +0200 staging: r8188eu: merge rtw_os_recvbuf_resource_alloc() into rtw_recv.c Merge the functionality of the function rtw_os_recvbuf_resource_alloc() into rtl8188eu_init_recv_priv(). Merging the functionality instead of just making the function static improves readability and we have one function less to care about when converting the uses of _FAIL/_SUCCESS to normal kernel error code logic. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220807181538.8499-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 401ae6efe3a21a3812b92eb49ea32a18a4416c50 Author: Michael Straube Date: Sun Aug 7 20:15:34 2022 +0200 staging: r8188eu: merge rtw_os_recvbuf_resource_free() into rtw_recv.c The function rtw_os_recvbuf_resource_free() is just a wrapper around usb_free_urb(). Call usb_free_urb() directly in rtl8188eu_free_recv_priv() and remove rtw_os_recvbuf_resource_free() to simplify the driver code. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220807181538.8499-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9a4d0d1c21b974454926c3b832b4728679d818eb Author: Michael Straube Date: Mon Aug 8 08:50:23 2022 +0200 staging: r8188eu: do not spam the kernel log Drivers should not spam the kernel log if they work properly. Convert the functions Hal_EfuseParseIDCode88E() and _netdev_open() to use netdev_dbg() instead of pr_info() so that developers can still enable it if they want to see this information. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220808065023.3175-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1bace12735a4c8d8d62b1cc7410cafeaccdf80d0 Author: Martin Kaiser Date: Mon Aug 8 22:14:05 2022 +0200 staging: r8188eu: the high prio queue is always selected The high priority queue is always selected, regardless of the number of out endpoints. Therefore, haldata->OutEpQueueSel & TX_SELE_HQ is always true. We can remove the check and use a define instead of the numHQ variable. This check was the last user of TX_SELE_HQ. Rename haldata->OutEpQueueSel to haldata->out_ep_extra_queues and store only the queues that are selected in addition to the high priority queue. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220808201405.68966-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3ce23a49d1b64e0d207114e2feaad0292c25c679 Author: Martin Kaiser Date: Mon Aug 8 22:14:04 2022 +0200 staging: r8188eu: remove two unused defines HPQ_PUBLIC_DIS and LPQ_PUBLIC_DIS are not used by the r8188eu driver. Remove them. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220808201405.68966-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a6400455a8ef9e7e6510394384f61b54fa763f5e Author: Martin Kaiser Date: Mon Aug 8 22:14:03 2022 +0200 staging: r8188eu: change all num...Q variables to u8 All of numPubQ, numHQ and numLQ variables store only u8 values. Change their types to u8. We can then simplify the REG_RQPN expression. The macros and the temporary variable are not needed any more. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220808201405.68966-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0dd01c0fd15abf49cc57b28b252181d869fb808b Author: Martin Kaiser Date: Mon Aug 8 22:14:02 2022 +0200 staging: r8188eu: make numNQ a u8 The numNQ variable in _InitQueueReservedPage is defined as u32. It is either set to 0 or to 0x1C. Change its type to u8 and remove the code that casts the u32 value to u8. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220808201405.68966-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ca6311f0e3513b45b076da982085c80c35e1b961 Author: Martin Kaiser Date: Mon Aug 8 22:14:01 2022 +0200 staging: r8188eu: remove a temporary variable Use pregistrypriv->wifi_spec directly instead of defining a temporary variable. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220808201405.68966-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 93cef2e6541a422cd8e5ad3d58a5cbff11db57c2 Author: Martin Kaiser Date: Sat Aug 6 21:55:40 2022 +0200 staging: r8188eu: simplify _InitNormalChipTwoOutEpPriority Simplify the _InitNormalChipTwoOutEpPriority function, now that we have only one configuration for the queues. Remove the variables which are constant. Keep only those settings that depend on wifi_spec. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e303b2622c7cc8853291068ade43edfe39db10d8 Author: Martin Kaiser Date: Sat Aug 6 21:55:39 2022 +0200 staging: r8188eu: we always use HQ and NQ for two endpoints When _InitNormalChipTwoOutEpPriority is called, pdvobjpriv->RtNumOutPipes and haldata->OutEpQueueSel have already been initialized. _InitNormalChipTwoOutEpPriority is called only if pdvobjpriv->RtNumOutPipes == 2. In this case, haldata->OutEpQueueSel is always TX_SELE_HQ | TX_SELE_NQ. Remove the switch-case statement and set valueHi and valueLow directly. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 36a1cd9daca2b11732457e88c0f0f17d68f191a8 Author: Martin Kaiser Date: Sat Aug 6 21:55:38 2022 +0200 staging: r8188eu: remove _InitNormalChipOneOutEpPriority When _InitNormalChipOneOutEpPriority is called, pdvobjpriv->RtNumOutPipes and haldata->OutEpQueueSel have already been initialized. _InitNormalChipOneOutEpPriority is called only if pdvobjpriv->RtNumOutPipes == 1. In this case, haldata->OutEpQueueSel is always TX_SELE_HQ. We can then simplify _InitNormalChipOneOutEpPriority to a single _InitNormalChipRegPriority call, i.e. we can remove _InitNormalChipOneOutEpPriority and call _InitNormalChipRegPriority directly. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 68c72bcf610f68bc4e2438e2bc9a2d945777fa73 Author: Martin Kaiser Date: Sat Aug 6 21:55:37 2022 +0200 staging: r8188eu: simplify two_out_pipe Simplify the two_out_pipe function. Move common settings out of the if clause. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 52a5bba72c834a7749df70f77396cb21e96b74ee Author: Martin Kaiser Date: Sat Aug 6 21:55:36 2022 +0200 staging: r8188eu: simplify three_out_pipe Only one of the mappings in three_out_pipe depends on the wifi_cfg flag. Simplify the code accordingly. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 609ba7515fe2be666828d5b372695d799ac04a0c Author: Martin Kaiser Date: Sat Aug 6 21:55:35 2022 +0200 staging: r8188eu: summarize common Queue2Pipe settings Regardless of the number of endpoints, queues 4 to 7 are mapped to pipe 0. Move these mappings to rtl8188eu_interface_configure to make the code simpler. It's ok to make these settings even if we exit with error later. In this case, the driver will not be loaded and pdvobjpriv->Queue2Pipe[] will be freed. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d4c66afde22a75c238946afd59b696ed7cd0ec9f Author: Martin Kaiser Date: Sat Aug 6 21:55:34 2022 +0200 staging: r8188eu: remove comments about endpoint mapping Remove the comments in two_out_pipe and three_out_pipe that show the mappings. They simply repeat the settings in the code and provide no additional information. Keep the info which RtOutPipe is high, normal or low. Without the removed comments, it'll be easier to summarize and reorganize the code. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2ea2f91b2882bf44a64c4c13e90d3708233ba3b4 Author: Martin Kaiser Date: Sat Aug 6 21:55:33 2022 +0200 staging: r8188eu: remove OutEpNumber Remove the OutEpNumber component of struct hal_data_8188e. RtNumOutPipes in struct dvobj_priv stores the same info. Update the only place where OutEpNumber is read. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 897155c795a8a006d9673acb15b1cc82693e0c5e Author: Martin Kaiser Date: Sat Aug 6 21:55:32 2022 +0200 staging: r8188eu: summarize endpoint-related settings rtl8188eu_interface_configure calls _ConfigNormalChipOutEP_8188E and Hal_MappingOutPipe. Both of these functions make some settings based on the number of out endpoints on the 8188eu chip. We can merge both of them into rtl8188eu_interface_configure and summarize the common code. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4b25e7f7c845e1c7af20a7e3a334d8bca7372d1c Author: Martin Kaiser Date: Sat Aug 6 21:55:31 2022 +0200 staging: r8188eu: move endpoint init functions to usb_halinit.c Move the Hal_MappingOutPipe function and the functions one_/two_/three_out_pipe from hal_com.c to usb_halinit.c. After this move, all the functions that rtl8188eu_interface_configure calls are in one file and we can continue to summarize and merge them. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d0852df98b43bfe051932045244b898f29e0678b Author: Martin Kaiser Date: Sat Aug 6 21:55:30 2022 +0200 staging: r8188eu: merge two small functions All that rtl8188eu_interface_configure does is call HalUsbSetQueuePipeMapping8188EUsb. We can merge the two functions. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit adf8416040d391d69cbd6c8db32f9a7eac7f2693 Author: Martin Kaiser Date: Sat Aug 6 21:55:29 2022 +0200 staging: r8188eu: process HalUsbSetQueuePipeMapping8188EUsb's return value At the moment, HalUsbSetQueuePipeMapping8188EUsb returns an error status to rtl8188eu_interface_configure, where this status is discarded. Pass the error status from rtl8188eu_interface_configure to rtw_usb_if1_init and handle it there. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a3cba3f05fdb249cbe1248763ffe3e0ea69f7284 Author: Martin Kaiser Date: Sat Aug 6 21:55:28 2022 +0200 staging: r8188eu: Hal_MappingOutPipe should return an int Update the Hal_MappingOutPipe function to return 0 for success or -EXNIO if the caller requested more than the number of available endpoints. This error code is also used by usb_find_common_endpoints if a requested endpoint was not found. Unlike a boolean return value, a negative error code can be returned to external functions that call the r8188eu driver, e.g. to the caller of our probe function. HalUsbSetQueuePipeMapping8188EUsb passes the return value of Hal_MappingOutPipe on to its caller. We have to change its return type from bool to int as well. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806195540.777390-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b5b26f1da5d9906a876693cc7598c54937a907d5 Author: Martin Kaiser Date: Sat Aug 6 13:13:52 2022 +0200 staging: r8188eu: simplify the calculation of ie start offset Use offsetof to calculate the start offset of the information elements in an association response message. This should make it easier to understand how the offset is calculated. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806111352.690650-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 12b7ad9e4940eba2e732ef948b6687ab2a291135 Author: Martin Kaiser Date: Sat Aug 6 13:13:51 2022 +0200 staging: r8188eu: read aid from struct ieee80211_mgmt Read the aid of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. Remove the cast to int, aid is a u16. Keep the 0x3fff mask that is currently applied to the aid. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806111352.690650-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 27597ee001f554afd04128e4fb38ec32b44a79e6 Author: Martin Kaiser Date: Sat Aug 6 13:13:50 2022 +0200 staging: r8188eu: read capability info from struct ieee80211_mgmt Read the capability info of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806111352.690650-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit df2889c6274d33c2ba523f860e718cfe59a10fb6 Author: Martin Kaiser Date: Sat Aug 6 13:13:49 2022 +0200 staging: r8188eu: read status_code from struct ieee80211_mgmt Read the status code of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806111352.690650-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 173603dba92e2f1163384936ded2e733134cf11b Author: Martin Kaiser Date: Sat Aug 6 13:13:48 2022 +0200 staging: r8188eu: replace a get_da call The r8188eu driver implements an internal get_da function to read the destination address (da) from an incoming message. Callers of this function should be updated to use the ieee80211 framework, with the goal of removing get_da eventually. This patch replaces a get_da call in the OnAssocRsp function. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806111352.690650-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ed0bbb6f81e11ac1ee60b0edd9b60b30eab235a9 Author: Michael Straube Date: Sat Aug 6 08:09:29 2022 +0200 staging: r8188eu: clean up comment for phy_calculate_bit_shift() Clean up the comment for function phy_calculate_bit_shift(). Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220806060929.11022-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bfa4392887565c9ba7faf5ddb3e524e9ce9f3b39 Author: Michael Straube Date: Sat Aug 6 08:09:28 2022 +0200 staging: r8188eu: avoid camel case in phy_CalculateBitShift() Rename the function phy_CalculateBitShift() and its parameter BitMask to avoid camel case. phy_CalculateBitShift -> phy_calculate_bit_shift BitMask -> bitmask Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220806060929.11022-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 270e05092e09b22e083b5e2802a73b52a6b813eb Author: Michael Straube Date: Sat Aug 6 08:09:27 2022 +0200 staging: r8188eu: use ffs() in phy_CalculateBitShift() Use ffs() in phy_CalculateBitShift() to simplify the function and improve readability. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220806060929.11022-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bf86e27416d43942a465051c7e2040462bdc734b Author: Phillip Potter Date: Wed Aug 3 00:44:08 2022 +0100 staging: r8188eu: convert rtw_p2p_enable to correct error code semantics Convert the rtw_p2p_enable function to use correct error code semantics rather than _SUCCESS/_FAIL, and also make sure we allow these to be passed through properly in the one caller where we actually check the code, rtw_wext_p2p_enable. This change moves these functions to a clearer 'return 0;' style at the end of the function, and in the case of errors now returns ret instead of jumping to the end of the function, so that these can still be passed through but without using a goto to jump to a single return statement at the end which is less clear. This change moves the driver slowly closer to using standard error code semantics everywhere. Tested-by: Philipp Hortmann # Edimax N150 Reviewed-by: Dan Carpenter Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220802234408.930-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 867d7145374a61b51eb0667c04f9abc2b5942007 Author: Michael Straube Date: Thu Aug 4 12:55:32 2022 +0200 staging: r8188eu: make rtl8188eu_{init,free}_recv_priv() static The functions rtl8188eu_init_recv_priv() and rtl8188eu_free_recv_priv() are only used in rtw_recv.c. Make them static and remove the now empty file rtl8188eu_recv.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220804105532.7532-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f264891b678d1c31879cbcacac6d76a216877086 Author: Michael Straube Date: Thu Aug 4 12:55:31 2022 +0200 staging: r8188eu: make handle_txrpt_ccx_88e() static The function handle_txrpt_ccx_88e() is only used in usb_ops_linux.c. Make it static and remove the now empty file rtl8188e_xmit.c. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220804105532.7532-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 973deac54086b8e0e89d340441fe40d10bbbcd73 Author: Li zeming Date: Tue Aug 2 09:25:13 2022 +0800 staging/rtl8723bs/core: remove inactive initialization The allocation address of the psta pointer variable is first performed in the function, no initialization assignment is required, and no invalid pointer will appear. Reviewed-by: Hans de Goede Signed-off-by: Li zeming Link: https://lore.kernel.org/r/20220802012513.2824-1-zeming@nfschina.com Signed-off-by: Greg Kroah-Hartman commit ef21bdc5b671f85607c39000320cbcfabed83867 Author: Michael Straube Date: Sat Jul 30 17:06:37 2022 +0200 staging: r8188eu: refactor dump_chip_info() Refactor the function dump_chip_info() to make the code cleaner and reduce the driver object file size. Instead of using sprintf() to print all the information to a buffer use a char pointer for the cut version string and print the other strings directly by netdev_dbg(). For the unknown cut string we can use a smaller buffer and print to that buffer with snprintf() to be safe. These changes avoid the possible buffer overflow that the original code had and reduces the driver object file size by 1029 bytes. Suggested-by: Joe Perches Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220730150637.3550-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c026b483f8f2eff1478f7edd55a2aef4cf9ebc2e Author: Michael Straube Date: Sat Jul 30 17:06:36 2022 +0200 staging: r8188eu: convert dump_chip_info() to use netdev_dbg() Drivers should not spam the kernel log if they work properly. Convert the dump_chip_info() function to use netdev_dbg() instead of pr_info() so that developers can still enable it if they want to see this information. Suggested-by: Greg Kroah-Hartman Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220730150637.3550-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c8d3347e3039cee0e0394fb9c83fcf1efc92b4af Author: Martin Kaiser Date: Sat Jul 30 16:39:39 2022 +0200 staging: r8188eu: return an error code in rtw_usb_if1_init rtw_usb_if1_init returns a pointer that isn't used by the caller. Return an error code instead. We can then propagate errors from lower-level functions like ReadAdapterInfo8188EU and fail the initialisation of the driver with a proper error code. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220730143939.671951-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b9eb3126181ad625334e65af05b9af552253e716 Author: Martin Kaiser Date: Sat Jul 30 16:39:38 2022 +0200 staging: r8188eu: make rtw_handle_dualmac a void function The rtw_handle_dualmac function always returns _SUCCESS. Remove the return value and update the one caller that checks it. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220730143939.671951-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 57f14afac3f776f68ee74ed7df77925d81ea71cc Author: Martin Kaiser Date: Sat Jul 30 16:39:37 2022 +0200 staging: r8188eu: handle errors from ReadAdapterInfo8188EU Update ReadAdapterInfo8188EU to return 0 for success or a negative error code. If rtw_read8 fails, we can just relay the error it returns. Update rtw_usb_if1_init to check the return value from ReadAdapterInfo8188EU. For now, rtw_usb_if1_init does not yet pass errors from ReadAdapterInfo8188EU on to its caller. Suggested-by: Pavel Skripkin Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220730143939.671951-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7b84ab85b12648bc27016088776bbd075e022be3 Author: Tong Zhang Date: Fri Jul 29 20:33:24 2022 -0700 staging: rtl8192u: fix rmmod warn when device is renamed This driver creates 4 debug files under [devname] folder. The devname could be wlan0 initially, however it could be renamed later to e.g. enx00e04c00000. This will cause problem during debug file teardown since it uses netdev->name, which is no longer wlan0. To solve this problem, add a notifier to handle device renaming. Also note that we cannot simply do debugfs_lookup to find out old dentry since by the time the notifier is called, netdev->name is already changed to new name. Reported-by: Zheyu Ma Tested-by: Zheyu Ma Reviewed-by: Dan Carpenter Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20220730033335.74153-5-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5682c05b26215592faa97deeec896454179169b Author: Tong Zhang Date: Fri Jul 29 20:33:23 2022 -0700 staging: rtl8192u: move debug files to debugfs There are 4 debug files created under /proc/net/[Devname]. Due to this is purely for debuging as files are created read only, move this to debugfs like other NIC drivers do instead of using procfs. The directory structure will be like the following /sys/kernel/debug/r8192u_usb/wlan0/stats-rx /sys/kernel/debug/r8192u_usb/wlan0/stats-rx /sys/kernel/debug/r8192u_usb/wlan0/stats-ap /sys/kernel/debug/r8192u_usb/wlan0/registers This is also to prepare for address rmmod warn issue. Reviewed-by: Dan Carpenter Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20220730033335.74153-4-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman commit 626d28e9becadb8e9b7cc66ec93184b671edf175 Author: Tong Zhang Date: Fri Jul 29 20:33:22 2022 -0700 staging: rtl8192u: remove unnecessary cast Cast is not needed when calling ieee80211_priv, so remove them. No functional change in this commit. Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20220730033335.74153-3-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2faa312bc01b4930220fa2c4f4cbaebf3f25ea07 Author: Tong Zhang Date: Fri Jul 29 20:33:21 2022 -0700 staging: rtl8192u: move debug stuff to its own file This is to prepare for moving them to debugfs and fix rmmod warn issue when wlan0 is renamed to something else. Reviewed-by: Dan Carpenter Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20220730033335.74153-2-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman commit 60d037564f7b2f29077f67e6c94ca118ca1305ef Author: Martin Kaiser Date: Sat Aug 6 21:43:04 2022 +0200 staging: r8188eu: txpktbuf_bndy does not depend on wifi_spec Remove the if clause that sets txpktbuf_bndy. Both branches set the same value. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220806194304.777059-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f13bd29c1ae1c2316ec8d5261c60aeccdccc5866 Author: Mingyi Kang Date: Sat Jul 30 12:57:26 2022 +0800 staging: vme_user: Fix checkpatch warnings in vme_tsi148.c This patch fix the follwing checkpatch warnings: WARNING: quoted string split across lines #129: FILE: drivers/staging/vme_user/vme_tsi148.c:129: + dev_err(tsi148_bridge->parent, "VME Mailbox %d received" + ": 0x%x\n", i, val); WARNING: quoted string split across lines #147: FILE: drivers/staging/vme_user/vme_tsi148.c:147: + dev_err(tsi148_bridge->parent, "PCI Exception at address: 0x%08x:%08x, " + "attributes: %08x\n", WARNING: quoted string split across lines #153: FILE: drivers/staging/vme_user/vme_tsi148.c:153: + dev_err(tsi148_bridge->parent, "PCI-X attribute reg: %08x, PCI-X split " + "completion reg: %08x\n", WARNING: quoted string split across lines #185: FILE: drivers/staging/vme_user/vme_tsi148.c:185: + dev_err(tsi148_bridge->parent, "VME Bus Exception Overflow " + "Occurred\n"); WARNING: quoted string split across lines #321: FILE: drivers/staging/vme_user/vme_tsi148.c:321: + dev_err(tsi148_bridge->parent, "Can't get assigned pci irq " + "vector %02X\n", pdev->irq); WARNING: quoted string split across lines #533: FILE: drivers/staging/vme_user/vme_tsi148.c:533: + dev_err(tsi148_bridge->parent, "Invalid PCI Offset " + "alignment\n"); WARNING: space prohibited before semicolon #591: FILE: drivers/staging/vme_user/vme_tsi148.c:591: + temp_ctl |= TSI148_LCSR_ITAT_SUPR ; WARNING: quoted string split across lines #766: FILE: drivers/staging/vme_user/vme_tsi148.c:766: + dev_err(tsi148_bridge->parent, "Failed to allocate mem " + "resource for window %d size 0x%lx start 0x%lx\n", WARNING: quoted string split across lines #831: FILE: drivers/staging/vme_user/vme_tsi148.c:831: + dev_err(tsi148_bridge->parent, "Invalid VME Window " + "alignment\n"); WARNING: quoted string split across lines #838: FILE: drivers/staging/vme_user/vme_tsi148.c:838: + dev_err(tsi148_bridge->parent, "Size must be non-zero for " + "enabled windows\n"); WARNING: quoted string split across lines #853: FILE: drivers/staging/vme_user/vme_tsi148.c:853: + dev_err(tsi148_bridge->parent, "Unable to allocate memory for " + "resource\n"); WARNING: quoted string split across lines #894: FILE: drivers/staging/vme_user/vme_tsi148.c:894: + dev_err(tsi148_bridge->parent, "Invalid VME Offset " + "alignment\n"); WARNING: quoted string split across lines #941: FILE: drivers/staging/vme_user/vme_tsi148.c:941: + dev_warn(tsi148_bridge->parent, "Currently not setting " + "Broadcast Select Registers\n"); WARNING: quoted string split across lines #1455: FILE: drivers/staging/vme_user/vme_tsi148.c:1455: + dev_err(dev, "Currently not setting Broadcast Select " + "Registers\n"); WARNING: quoted string split across lines #1554: FILE: drivers/staging/vme_user/vme_tsi148.c:1554: + dev_err(dev, "Currently not setting Broadcast Select " + "Registers\n"); WARNING: quoted string split across lines #1643: FILE: drivers/staging/vme_user/vme_tsi148.c:1643: + dev_err(tsi148_bridge->parent, "Descriptor not aligned to 8 " + "byte boundary as required: %p\n", WARNING: else is not generally useful after a break or return #1830: FILE: drivers/staging/vme_user/vme_tsi148.c:1830: + return -EBUSY; + } else { warning: quoted string split across lines #1939: file: drivers/staging/vme_user/vme_tsi148.c:1939: + dev_err(tsi148_bridge->parent, "location monitor " + "callback attached, can't reset\n"); WARNING: space prohibited before semicolon #1964: FILE: drivers/staging/vme_user/vme_tsi148.c:1964: + lm_ctl |= TSI148_LCSR_LMAT_SUPR ; WARNING: quoted string split across lines #2055: FILE: drivers/staging/vme_user/vme_tsi148.c:2055: + dev_err(tsi148_bridge->parent, "Location monitor not properly " + "configured\n"); WARNING: quoted string split across lines #2200: FILE: drivers/staging/vme_user/vme_tsi148.c:2200: + dev_err(tsi148_bridge->parent, "Failed to allocate memory for " + "CR/CSR image\n"); WARNING: quoted string split across lines #2241: FILE: drivers/staging/vme_user/vme_tsi148.c:2241: + dev_err(tsi148_bridge->parent, "Configuring flush image" + " failed\n"); Signed-off-by: Mingyi Kang Link: https://lore.kernel.org/r/20220730045726.55452-1-jerrykang026@gmail.com Signed-off-by: Greg Kroah-Hartman commit aef1bf6f2d95bca9c34f73df2141f77009fbfa43 Author: Sidong Yang Date: Sat Jul 30 02:27:24 2022 +0100 staging: pi433: fix wrong debug message on rf69_write_fifo() The debug message should describe error when user calls rf69_write_fifo() not rf69_write_fifo(). Signed-off-by: Sidong Yang Link: https://lore.kernel.org/r/20220730012724.1138-1-realwakka@gmail.com Signed-off-by: Greg Kroah-Hartman commit 692f9007ab0e597eb59aac1db9a2a2ce4b6297c7 Author: Philipp Hortmann Date: Sun Aug 7 20:13:55 2022 +0200 staging: vt6655: Convert macro MACvDisableBarkerPreambleMd Convert macro MACvDisableBarkerPreambleMd to static function which calls the common static function vt6655_mac_clear_bits. This saves codelines and multiline macros are not liked by kernel community. Function name is also changed to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2a1d67762d9ecf3f30f3e293ad6ab997ad278b84.1659892671.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0e17361b3d12e15586adcc6ad7b7bbefb6ca06d5 Author: Philipp Hortmann Date: Sun Aug 7 20:13:51 2022 +0200 staging: vt6655: Convert macro MACvEnableBarkerPreambleMd Convert macro MACvEnableBarkerPreambleMd to static function which calls the common static function vt6655_mac_set_bits. This saves codelines and multiline macros are not liked by kernel community. Function name is also changed to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/542b9f8c0b10aa3db143b22f7425ab5bddc5bffe.1659892671.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit cc00269153b870895baaad9f74034b8ae8803d7a Author: Philipp Hortmann Date: Sun Aug 7 20:13:46 2022 +0200 staging: vt6655: Convert macro MACvDisableProtectMD Convert macro MACvDisableProtectMD to static function which calls the new common static function vt6655_mac_clear_bits. This saves codelines and multiline macros are not liked by kernel community. Function name is also changed to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4cb2b8025adde2a3addfd8e954faf18a0a8032aa.1659892670.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 17ca653712765ecefff6136b863895382e5989e8 Author: Philipp Hortmann Date: Sun Aug 7 20:13:42 2022 +0200 staging: vt6655: Rename function MACvEnableProtectMD Rename MACvEnableProtectMD function to vt6655_mac_en_protect_md to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/927d7c6e7c9d5214e4faeca886efd2696b2abc31.1659892670.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0e68ed8f4c4e8ff2fc9653aa1ff8f3acc760eb1a Author: Philipp Hortmann Date: Sun Aug 7 20:13:37 2022 +0200 staging: vt6655: Create one function for two macros Create function vt6655_mac_set_bits with two parameters to cover functionality of two macros. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/78883f42b2df258dbf821d7f7515a82932a157f1.1659892670.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d9f3d12a89406486f9b77a1b68f16c0985f3c56 Author: Philipp Hortmann Date: Sun Aug 7 20:13:33 2022 +0200 staging: vt6655: Convert macro MACvEnableProtectMD to function Convert macro to static function. Multiline macros are not liked by kernel community. Rename variable dwOrgValue to reg_value to avoid CamelCase which is not accepted by checkpatch.pl. Change variable declaration to u32 as this improves readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f3a5ec5352346f1dc4bf3afbee25973fdb47d7e4.1659892670.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 05e778f0c74b9ff78975490c9b0eae2bf57efeb7 Author: Philipp Hortmann Date: Fri Jul 29 10:14:57 2022 +0200 staging: vt6655: Replace MACvTransmitAC0 with function vt6655_mac_dma_ctl Convert macro MACvTransmitAC0 to existing static function. This saves codelines and multiline macros are not liked by kernel community. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/013abd177d9ac129c034776f10cdf823fd87d781.1659080988.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 59cce3f468f5b98f9469179b7b713f3ddbf9e3c2 Author: Philipp Hortmann Date: Fri Jul 29 10:14:46 2022 +0200 staging: vt6655: Replace MACvTransmit0 with function vt6655_mac_dma_ctl Convert macro MACvTransmit0 to existing static function. This saves codelines and multiline macros are not liked by kernel community. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/fc412f0fda11045a55b6b5867d51e250ca841ee8.1659080988.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4726f7f4f138272658c5a21cf243ac10f76317e Author: Philipp Hortmann Date: Fri Jul 29 10:14:34 2022 +0200 staging: vt6655: Replace MACvReceive1 with function vt6655_mac_dma_ctl Convert macro MACvReceive1 to existing static function. This saves codelines and multiline macros are not liked by kernel community. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ec8dbbfeccb32e0b5c753702cb70d2749426c054.1659080988.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1795826c0e31939cebfb6d85f21dfbf7b94ec076 Author: Philipp Hortmann Date: Fri Jul 29 10:14:25 2022 +0200 staging: vt6655: Rename function MACvReceive0 and add parameter Rename MACvReceive0 function to vt6655_mac_dma_ctl to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Add one parameter to avoid multiple repetitions of the same function. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e5ca6208263d5aa3f1d6f0359fa602187d799f19.1659080988.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9665eaf50ab32f9f0bdcc546a27e94ee19e235bd Author: Philipp Hortmann Date: Fri Jul 29 10:14:14 2022 +0200 staging: vt6655: Convert macro MACvReceive0 to function Convert macro to static function. Multiline macros are not liked by kernel community. Rename variable dwData to reg_value to avoid CamelCase which is not accepted by checkpatch.pl. Change variable declaration to u32 as this improves readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/059aca149bd0c1d75df4fb3cd8a177aa4948fb02.1659080988.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 13ad1125b941a5f257d9d3ae70485773abd34792 Author: Aharon Landau Date: Sun Jul 31 11:26:36 2022 +0300 RDMA/mlx5: Don't compare mkey tags in DEVX indirect mkey According to the ib spec: If the CI supports the Base Memory Management Extensions defined in this specification, the L_Key format must consist of: 24 bit index in the most significant bits of the R_Key, and 8 bit key in the least significant bits of the R_Key Through a successful Allocate L_Key verb invocation, the CI must let the consumer own the key portion of the returned R_Key Therefore, when creating a mkey using DEVX, the consumer is allowed to change the key part. The kernel should compare only the index part of a R_Key to determine equality with another R_Key. Adding capability in order not to break backward compatibility. Fixes: 534fd7aac56a ("IB/mlx5: Manage indirection mkey upon DEVX flow for ODP") Link: https://lore.kernel.org/r/3d669aacea85a3a15c3b3b953b3eaba3f80ef9be.1659255945.git.leonro@nvidia.com Signed-off-by: Aharon Landau Signed-off-by: Leon Romanovsky commit a80c60359a42cf146872b9442cf847e7c2452a23 Author: Vyacheslav Bocharov Date: Thu Aug 11 13:31:13 2022 +0300 dt-bindings: arm: amlogic: add bindings for Jethub D1p (j110) JetHome JetHub D1p is a home automation controller, modification of JetHub D1 based on Amlogic A113X Signed-off-by: Vyacheslav Bocharov Acked-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220811103113.3097868-3-adeep@lexina.in commit 59ec069d50550273a83180ea6c950d382d7bf8e3 Author: Vyacheslav Bocharov Date: Thu Aug 11 13:31:12 2022 +0300 arm64: dts: meson-axg: add support for JetHub D1p (j110) - add support for JetHome JetHub D1p (https://jethome.ru/d1p) is a home automation controller with the following features: - DIN Rail Mounting - Amlogic A113X (ARM Cortex-A53) quad-core up to 1.5GHz - no video out - 1/2/4GB LPDDR4 - 8/16/32GB eMMC flash - 1 x USB 2.0 - 1 x 10/100Mbps ethernet - WiFi / Bluetooth Realtek 8822CS or similar IEEE 802.11a/b/g/n/ac - TI CC2652P1 Zigbee Wireless Module with up to 20dBm output power and Zigbee 3.0 support. - 2 x gpio LEDS - GPIO user Button - 1 x 1-Wire - 2 x RS-485 - 4 x dry contact digital GPIO inputs - 3 x relay GPIO outputs - DC source with a voltage of 9 to 56 V / Active POE - unify device tree files for JetHub D1/D1p devices Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220811103113.3097868-2-adeep@lexina.in commit 19d6214ad6dfffda1a5bdc2b34ea75ba45a1a60a Author: Jason Gunthorpe Date: Fri Jul 29 13:33:38 2022 -0300 IB/mlx5: Call io_stop_wc() after writing to WC MMIO This new function is defined only on ARM and serves to guarantee a barrier in the WC operation. The barrier means that another run of this loop will not combine with the stores this loop created. On x86 this is happening implicitly because of the spin_unlock(). Link: https://lore.kernel.org/r/0-v1-c5dade92f363+11-mlx5_io_stop_wc_jgg@nvidia.com Suggested-by: Pavel Shamis Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 3b43a713f6b09ffbca468847000dabeaf92492df Author: Pieterjan Camerlynck Date: Sat Aug 13 10:33:52 2022 +0200 ASoC: fsl_sai: fix incorrect mclk number in error message In commit c3ecef21c3f26 ("ASoC: fsl_sai: add sai master mode support") the loop was changed to start iterating from 1 instead of 0. The error message however was not updated, reporting the wrong clock to the user. Signed-off-by: Pieterjan Camerlynck Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220813083353.8959-1-pieterjan.camerlynck@gmail.com Signed-off-by: Mark Brown commit 5c439937775d77a334696a98fb2a25dee72ffa2d Author: Zhu Ning Date: Tue Aug 16 10:44:56 2022 +0800 ASoC: codecs: add support for ES8326 The ES8326 codec is not compatible with ES8316 and requires a dedicated driver. ------ v6 remove rate 96000 remove HEX suffix Signed-off-by: David Yang Signed-off-by: Zhu Ning Link: https://lore.kernel.org/r/20220816024456.4475-2-zhuning0077@gmail.com Signed-off-by: Mark Brown commit 8c6789f4e2d4ee7d6c8c60daa88ea7a4c4cf6779 Author: Zhu Ning Date: Tue Aug 16 10:44:55 2022 +0800 ASoC: dt-bindings: Add Everest ES8326 audio CODEC Add device tree binding documentation for Everest ES8326 ---- v5 tested by dtschema Signed-off-by: David Yang Signed-off-by: Zhu Ning Link: https://lore.kernel.org/r/20220816024456.4475-1-zhuning0077@gmail.com Signed-off-by: Mark Brown commit a25e1183ea2d0feb068794adf0249919ea7e0d8c Author: Cezary Rojewski Date: Mon Aug 15 18:58:18 2022 +0200 ASoC: Intel: Drop legacy HSW/BDW board-match information With board-matching information for legacy solution moved to local directory, there is no need to expose it globally. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220815165818.3050649-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 02f29be6a553e4ebee5b718165b01cc4f17dffa8 Author: Cezary Rojewski Date: Mon Aug 15 18:58:17 2022 +0200 ASoC: Intel: catpt: Drop SND_SOC_ACPI_INTEL_MATCH dependency catpt-driver does not make use of most of the fields found in the descriptor table and is the sole user of haswell machines list. Move the tables to local directory and clean them up so it's clear what's actually used by the solution. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220815165818.3050649-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit efbaa66852ee98fbd661beef8663d2992cfa901a Author: Cezary Rojewski Date: Mon Aug 15 18:58:16 2022 +0200 ASoC: Intel: bdw_rt286: Rename module Change kernel module name from snd_soc_sst_broadwell to snd_soc_bdw_rt286 to better reflect its purpose. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220815165818.3050649-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 7c32710c8be4be8a2999a648bcb4e899e12f9a4b Author: Cezary Rojewski Date: Mon Aug 15 18:58:15 2022 +0200 ASoC: Intel: hsw_rt5640: Rename module Change kernel module name from snd_soc_sst_haswell to snd_soc_hsw_rt5640 to better reflect its purpose. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220815165818.3050649-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit ed5c2f5fd10dda07263f79f338a512c0f49f76f5 Author: Uwe Kleine-König Date: Mon Aug 15 10:02:30 2022 +0200 i2c: Make remove callback return void The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin Reviewed-by: Jeremy Kerr Reviewed-by: Benjamin Mugnier Reviewed-by: Javier Martinez Canillas Reviewed-by: Crt Mori Reviewed-by: Heikki Krogerus Acked-by: Greg Kroah-Hartman Acked-by: Marek Behún # for leds-turris-omnia Acked-by: Andy Shevchenko Reviewed-by: Petr Machata # for mlxsw Reviewed-by: Maximilian Luz # for surface3_power Acked-by: Srinivas Pandruvada # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil # for media/* + staging/media/* Acked-by: Miguel Ojeda # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli # for versaclock5 Reviewed-by: Ajay Gupta # for ucsi_ccg Acked-by: Jonathan Cameron # for iio Acked-by: Peter Rosin # for i2c-mux-*, max9860 Acked-by: Adrien Grassein # for lontium-lt8912b Reviewed-by: Jean Delvare # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard # for IPMI Reviewed-by: Vladimir Oltean Acked-by: Dmitry Torokhov Acked-by: Sebastian Reichel # for drivers/power Acked-by: Krzysztof Hałasa Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit 6a8f359c3132e4f51bdb263ad74ec632c65e55fd Author: Uwe Kleine-König Date: Mon Aug 15 10:02:29 2022 +0200 gpio: pca953x: Make platform teardown callback return void All platforms that provide a teardown callback return 0. New users are supposed to not make use of platform support, so there is no functionality lost. This patch is a preparation for making i2c remove callbacks return void. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Acked-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang commit 22a23436891886a66d21af3619f4a4e8809f0e0a Author: Uwe Kleine-König Date: Mon Aug 15 10:02:28 2022 +0200 leds: lm3601x: Improve error reporting for problems during .remove() Returning an error value in an i2c remove callback results in a generic error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. So instead of triggering the generic i2c error message, emit a more helpful message if a problem occurs and return 0 to suppress the generic message. This patch is a preparation for making i2c remove callbacks return void. Acked-by: Pavel Machek Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit 32f7eed0c763a9b89f6b357ec54b48398fc7b99e Author: Uwe Kleine-König Date: Mon Aug 15 10:02:27 2022 +0200 leds: lm3601x: Don't use mutex after it was destroyed The mutex might still be in use until the devm cleanup callback devm_led_classdev_flash_release() is called. This only happens some time after lm3601x_remove() completed. Fixes: e63a744871a3 ("leds: lm3601x: Convert class registration to device managed") Acked-by: Pavel Machek Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit af89fa11fae1cee4e07453f780e6e5573ef0f477 Author: Uwe Kleine-König Date: Mon Aug 15 10:02:26 2022 +0200 leds: lm3697: Remove duplicated error reporting in .remove() Returning an error value from an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As lm3697_remove() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, don't pass the error value up the stack. Instead continue to clean up and return 0. This patch is a preparation for making i2c remove callbacks return void. Acked-by: Pavel Machek Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit eb09882d64807c24228ed1d005dbbae70860ca3f Author: Uwe Kleine-König Date: Mon Aug 15 10:02:25 2022 +0200 drm/i2c/sil164: Drop no-op remove function A remove callback that just returns 0 is equivalent to no callback at all as can be seen in i2c_device_remove(). So simplify accordingly. Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit 93d7c52a6eb93e58e4569bd4de95ba3b19e3cf20 Author: Gautam Menghani Date: Sat Aug 6 22:05:30 2022 +0530 selftests/net: Refactor xfrm_fill_key() to use array of structs A TODO in net/ipsec.c asks to refactor the code in xfrm_fill_key() to use set/map to avoid manually comparing each algorithm with the "name" parameter passed to the function as an argument. This patch refactors the code to create an array of structs where each struct contains the algorithm name and its corresponding key length. Signed-off-by: Gautam Menghani Signed-off-by: Steffen Klassert commit 152a81a0b1204e9c7f4af0004b5ed7a8d67dd037 Author: Saravana Kannan Date: Tue Jul 26 18:33:48 2022 -0700 pinctrl: samsung: Finish initializing the gpios before registering them As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail. Signed-off-by: Saravana Kannan Reviewed-by: Sam Protsenko Reviewed-by: Chanho Park Tested-by: Chanho Park Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220727013349.3056826-1-saravanak@google.com commit 9f8fb8032febf594914999c33493c682eaf138cb Author: Tinghan Shen Date: Fri Jul 29 14:31:50 2022 +0800 dt-bindings: memory: mediatek,smi: Update condition for mt8195 smi node The max clock items for the dts node with compatible 'mediatek,mt8195-smi-sub-common' should be 3. However, the dtbs_check of such node will get following message, arch/arm64/boot/dts/mediatek/mt8195-evb.dtb: smi@14010000: clock-names: ['apb', 'smi', 'gals0'] is too long From schema: Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml It's because the 'mediatek,mt8195-smi-sub-common' compatible incorrectly matches the 'else' conditions for gen2 HW without gals. Rewrite the 'else' condition to specifically identify the compatibles that utilizing gen2 HW without gals. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220729063208.16799-3-tinghan.shen@mediatek.com commit 48af14fb0eaa63d9aa68f59fb0b205ec55a95636 Author: Liang He Date: Tue Jul 19 16:56:40 2022 +0800 memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings() We should add the of_node_put() when breaking out of for_each_child_of_node() as it will automatically increase and decrease the refcount. Fixes: 976897dd96db ("memory: Extend of_memory with LPDDR3 support") Signed-off-by: Liang He Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220719085640.1210583-2-windhl@126.com commit 05215fb32010d4afb68fbdbb4d237df6e2d4567b Author: Liang He Date: Tue Jul 19 16:56:39 2022 +0800 memory: of: Fix refcount leak bug in of_get_ddr_timings() We should add the of_node_put() when breaking out of for_each_child_of_node() as it will automatically increase and decrease the refcount. Fixes: e6b42eb6a66c ("memory: emif: add device tree support to emif driver") Signed-off-by: Liang He Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220719085640.1210583-1-windhl@126.com commit 8e4787582d92494188c094f0fa7d2f03c73ed509 Author: Debarati Biswas Date: Wed Jul 13 09:03:55 2022 -0400 memory: dfl-emif: Update the dfl emif driver support revision 1 The next generation (revision 1) of the DFL EMIF feature device requires support for more than 4 memory banks. It does not support the selective clearing of memory banks. A capability register replaces the previous control register, and contains a bitmask to indicate the presence of each memory bank. This bitmask aligns with the previous control register bitmask that served the same purpose. The control and capability registers are treated like a C Union structure in order to support both the new and old revisions of the EMIF device. Signed-off-by: Debarati Biswas Signed-off-by: Russ Weight Signed-off-by: Tianfei Zhang Reviewed-by: Matthew Gerlach Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220713130355.196115-1-tianfei.zhang@intel.com commit 61b3c876c1cbdb1efd1f52a1f348580e6e14efb6 Author: Liang He Date: Sat Jul 16 11:13:24 2022 +0800 memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe() The break of for_each_available_child_of_node() needs a corresponding of_node_put() when the reference 'child' is not used anymore. Here we do not need to call of_node_put() in fail path as '!match' means no break. While the of_platform_device_create() will created a new reference by 'child' but it has considered the refcounting. Fixes: fee10bd22678 ("memory: pl353: Add driver for arm pl353 static memory controller") Signed-off-by: Liang He Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220716031324.447680-1-windhl@126.com commit a9b4c16d886cf6911d69fe3c68f5c7b2112f0141 Author: Jani Nikula Date: Mon Aug 15 12:48:38 2022 +0300 drm/i915/backlight: split out backlight registers to a separate file Declutter i915_reg.h by splitting backlight registers to a separate file. Also include the utility pin definitions, even though they are used for non-backlight things too. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20220815094838.3511723-1-jani.nikula@intel.com commit ffd882417412ea7273ae14deec77711f6df54bbc Author: Lad Prabhakar Date: Fri Jul 22 16:11:55 2022 +0100 arm64: dts: renesas: rzg2l-smarc-som: Add PHY interrupt support for ETH{0/1} The PHY interrupt (INT_N) pin is connected to IRQ2 and IRQ3 for ETH0 and ETH1 respectively. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220722151155.21100-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 80c4ece67b4050559e4e2417e77bbfd57e8b3899 Author: Lad Prabhakar Date: Fri Jul 22 16:11:53 2022 +0100 dt-bindings: interrupt-controller: Add macros for NMI and IRQ0-7 interrupts present on RZ/G2L SoC Add macros for NMI and IRQ0-7 interrupts which map to SPI0-8 present on RZ/G2L (and alike) SoC's so that these can be used in the first cell of interrupt specifiers. Signed-off-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220722151155.21100-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 96355be8f0a2a7a91aae2e66c0795a13444db5ba Author: Lad Prabhakar Date: Tue Jul 26 18:53:15 2022 +0100 dt-bindings: pinctrl: renesas: Document RZ/Five SoC RZ/Five SoC is pin compatible with RZ/G2UL (Type 1) SoC. This patch updates the comment to include RZ/Five SoC so that we make it clear "renesas,r9a07g043-pinctrl" compatible string will be used for RZ/Five SoC. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220726175315.1147-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ee8898fd7a89d950965105731e1f933583cdfc2e Author: Geert Uytterhoeven Date: Wed Jul 20 10:08:04 2022 +0200 arm64: dts: renesas: Add Renesas R8A779MB SoC support Add support for the Renesas R-Car H3Ne-1.7G (R8A779MB) SoC, which is a different grading of the R-Car H3-N (R8A77951) SoC. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/862a5eecc850cbb90af86a56513b644b638fb62b.1656072871.git.geert+renesas@glider.be commit 6c3a9c9ae02a16295ea144dc431aaac2c20dbffd Author: Ard Biesheuvel Date: Fri Jul 22 17:15:41 2022 +0200 efi/x86-mixed: move unmitigated RET into .rodata Move the EFI mixed mode return trampoline RET into .rodata, so it is normally mapped without executable permissions. And given that this snippet of code is really the only kernel code that we ever execute via this 1:1 mapping, let's unmap the 1:1 mapping of the kernel .text, and only map the page that covers the return trampoline with executable permissions. Note that the remainder of .rodata needs to remain mapped into the 1:1 mapping with RO/NX permissions, as literal GUIDs and strings may be passed to the variable routines. Acked-by: Borislav Petkov Signed-off-by: Ard Biesheuvel commit ebd0e06f3063cc2e3a689112904b29720579c6d2 Author: Lad Prabhakar Date: Fri Jul 22 15:15:06 2022 +0100 soc: renesas: Identify RZ/Five SoC Add support for identifying the (R9A07G043) RZ/Five SoC. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220722141506.20171-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5444c5cafdce08e5fc575413b32678ac34163521 Author: Lad Prabhakar Date: Fri Jul 22 15:15:05 2022 +0100 dt-bindings: soc: renesas: renesas,rzg2l-sysc: Document RZ/Five SoC Document RZ/Five (R9A07G043) SYSC bindings. The SYSC block found on the RZ/Five SoC is almost identical to one found on the RZ/G2UL (and alike) SoC's. "renesas,r9a07g043-sysc" compatible string will be used on the RZ/Five SoC so to make this clear, update the comment to include RZ/Five SoC. The SYSC block on RZ/Five has no interrupts to the core so to accommodate this SoC make interrupts{,-names} properties optional. Signed-off-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220722141506.20171-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f5f6306965aaa9a9db8ebb02d725759eeee24b24 Author: Geert Uytterhoeven Date: Wed Jul 20 10:08:02 2022 +0200 dt-bindings: arm: renesas: Document R-Car H3Ne-1.7G SoC and boards Document the compatible values for the R-Car H3Ne-1.7G (R8A779MB) SoC. This is a different grading of the R-Car H3-N (R8A77951) SoC. All R-Car H3Ne-1.7G on-SoC devices are identical to the corresponding devices on the R-Car H3-N SoC, and thus just use the compatible values for the latter. The root compatible property does gain an additional value, to sort out integration issues if they ever arise. Document the use of this SoC on the Salvator-XS and ULCB (with and without Kingfisher) development boards. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/f816f58d1c3fbd0605589e7648a43d78a4e1e694.1656072871.git.geert+renesas@glider.be commit 1b37236de8c1ac56969efd130bb38edf8ac4b7f6 Author: Geert Uytterhoeven Date: Wed Jul 20 10:08:03 2022 +0200 soc: renesas: Identify R-Car H3Ne-1.7G Add support for identifying the R-Car H3Ne-1.7G (R8A779MB) SoC. As this is a different grading of the already supported R-Car H3-N ES3.0 (R8A77951) SoC, support for it is enabled through the existing ARCH_R8A77951 configuration symbol. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8670482178567897571edc0dfc60017453544071.1656072871.git.geert+renesas@glider.be commit 0612d928b7ff8c87043115f74f08cb4af1f0c4cf Author: Adam Skladowski Date: Mon Aug 15 12:09:42 2022 +0200 cpufreq: Add SM6115 to cpufreq-dt-platdev blocklist The Qualcomm SM6115 platform uses the qcom-cpufreq-hw driver, so add it to the cpufreq-dt-platdev driver's blocklist. Signed-off-by: Adam Skladowski Signed-off-by: Viresh Kumar commit 0351dc57b95b8b56f2a467122c13b6b16e0dc53f Author: Jilin Yuan Date: Sun Aug 14 17:39:41 2022 +0800 audit: fix repeated words in comments Delete the redundant word 'doesn't'. Signed-off-by: Jilin Yuan [PM: subject line tweak] Signed-off-by: Paul Moore commit 4847c0eb663ab431b56cd82c9c2627967f09f2ef Author: Xiu Jianfeng Date: Mon Aug 15 22:44:01 2022 -0400 lsm: clean up redundant NULL pointer check The implements of {ip,tcp,udp,dccp,sctp,ipv6}_hdr(skb) guarantee that they will never return NULL, and elsewhere users don't do the check as well, so remove the check here. Signed-off-by: Xiu Jianfeng [PM: subject line tweaks] Signed-off-by: Paul Moore commit 1f235777c3a4ab115162fe7d45b82be534b9ae2e Author: Hangbin Liu Date: Sat Aug 13 08:09:36 2022 +0800 libbpf: Making bpf_prog_load() ignore name if kernel doesn't support Similar with commit 10b62d6a38f7 ("libbpf: Add names for auxiliary maps"), let's make bpf_prog_load() also ignore name if kernel doesn't support program name. To achieve this, we need to call sys_bpf_prog_load() directly in probe_kern_prog_name() to avoid circular dependency. sys_bpf_prog_load() also need to be exported in the libbpf_internal.h file. Signed-off-by: Hangbin Liu Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220813000936.6464-1-liuhangbin@gmail.com commit b82217e73b5aa6db8453ad91b929ca2366e47184 Author: Andy Shevchenko Date: Tue Jul 26 17:20:48 2022 +0300 iio: pressure: dlhl60d: Don't take garbage into consideration when reading data Both pressure and temperature are 24-bit long. Use proper accessors instead of overlapping readings. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220726142048.4494-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 65f79b501030678393eae0ae03d60a8151fbef55 Author: Jakob Hauser Date: Sat Aug 13 00:05:03 2022 +0200 iio: magnetometer: yas530: Add YAS537 variant Add support for the magnetometer Yamaha YAS537. The additions are based on comparison of Yamaha Android kernel drivers for YAS532 [1] and YAS537 [2]. In the Yamaha YAS537 Android driver, there is an overflow/underflow control implemented. For regular usage, this seems not necessary. A similar overflow/ underflow control of Yamaha YAS530/532 Android driver isn't integrated in the mainline driver. It is therefore skipped for YAS537 in the mainline too. Also in the Yamaha YAS537 Android driver, at the end of the reset_yas537() function, a measurement is saved in "last_after_rcoil". Later on, this is compared to current measurements. If the difference gets too big, a new reset is initialized. The difference in measurements needs to be quite big, it's hard to say if this is necessary for regular operation. Therefore this isn't integrated in the mainline driver either. [1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c [2] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas537.c Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/264c6488733a5c32089c9ab406a5bcb808c48fef.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 059ff0f9a10508c39f2c22d4144e88156bbf86ef Author: Jakob Hauser Date: Sat Aug 13 00:05:02 2022 +0200 iio: magnetometer: yas530: Add function pointers to "chip_info" Add function pointers to the "chip_info" structure to ease the handling of different YAS variants. In the function yas5xx_probe(), the function call for "measure_offsets" was added as a conditional "if (ci->measure_offsets)". This is a preparatory step for YAS537, as this variant doesn't need an offset measurement. Signed-off-by: Jakob Hauser Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/4bd3f96262e0132b7f9720521a801da3c18abd95.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 2d6676ecbe6a39fb1e002b89781e4158e77a784e Author: Jakob Hauser Date: Sat Aug 13 00:05:01 2022 +0200 iio: magnetometer: yas530: Add temperature calculation to "chip_info" Add temperature calculation to the "chip_info" structure to ease the handling of different YAS variants. Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/1a8bffdb7e807455620a73f2d61981e7f9aab8d5.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 913fd409668b7fd54db5efd979417a9f94dcc79b Author: Jakob Hauser Date: Sat Aug 13 00:05:00 2022 +0200 iio: magnetometer: yas530: Add IIO scaling to "chip_info" Add IIO scaling to the "chip_info" structure to ease the handling to different YAS variants. Signed-off-by: Jakob Hauser Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/a12f892633bbee13a8856c231dc793ebbc5d3a03.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit dd9bd44f877d8935b7359f083626786cead98adb Author: Jakob Hauser Date: Fri Aug 12 23:54:15 2022 +0200 iio: magnetometer: yas530: Add volatile registers to "chip_info" Add volatile registers to the "chip_info" structure to ease the handling of different YAS variants. Signed-off-by: Jakob Hauser Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/aeba3877933ba9d2c920b459a9037d9186c15a4f.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit a70f60e5b6b37e8b9f0967235bf89aebd2d9fbb9 Author: Jakob Hauser Date: Fri Aug 12 23:54:14 2022 +0200 iio: magnetometer: yas530: Introduce "chip_info" structure Introduce the "chip_info" structure approach for better variant handling. The variant to be used is now chosen by the Device Tree (enum "chip_ids"), not by the chip ID in the register. However, there is a check to make sure they match (using integer "id_check"). Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/57236545107286771d351b95091bf56815d3717d.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 92d9c05ca7324aed6695b53d3ce11b3e1387f470 Author: Jakob Hauser Date: Fri Aug 12 23:54:13 2022 +0200 iio: magnetometer: yas530: Apply documentation and style fixes This commit gathers several minor changes. In the device examples, "Xiaomi" is too generic, specific devices should be listed here. E.g. Xiaomi Redmi 2 seems to have YAS537 but it's not fully clear if this applies to all its variants. Samsung Galaxy S7 is often quoted in conjunction with YAS537. Removed defines for device IDs of YAS537 and YAS539, they are not needed so far. Signed-off-by: Jakob Hauser Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/300e394a76eb30fa031ecb69b594e9f9a70dac42.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit bdef8dcfbb94dc16e9750cd109bb9b7d8edfa1ca Author: Jakob Hauser Date: Fri Aug 12 23:54:12 2022 +0200 iio: magnetometer: yas530: Move printk %*ph parameters out from stack Use less stack by modifying %*ph parameters. While at it, in the function yas530_get_calibration_data(), the debug dump was extended to 16 elements as this is the size of the calibration data array of YAS530. Suggested-by: Andy Shevchenko Signed-off-by: Jakob Hauser Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/93b50c20adb1b2acb4cddb1ab25755070edd7c07.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 6e3bfa97c5b8a9ea702ad0b8a28e703b6d561ac1 Author: Jakob Hauser Date: Fri Aug 12 23:54:11 2022 +0200 iio: magnetometer: yas530: Rename functions and registers This is a preparation for adding the YAS537 variant. Functions that are used only by YAS530, YAS532 and YAS533 are renamed from yas5xx to yas530. Same for the registers. To avoid part listing in function and registers names, the name of the first variant is used. Where appropriate, comments were added that these functions are used by more than one variant. Functions that will be used by all variants including YAS537 remain in the naming scheme yas5xx. Or YAS5XX for registers, respectively. Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/344d3b2f5e050eab79ce9962c24781486774d9fb.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 0ca09faadef13bd6f7a59fa9f6858ccb88dac539 Author: Jakob Hauser Date: Fri Aug 12 23:54:10 2022 +0200 iio: magnetometer: yas530: Change data type of calibration coefficients This is a preparation for adding YAS537 variant. YAS537 uses other data types on the calibration coefficients [1] than YAS530 [2] and YAS532 [3]. On YAS537, at least for a4 and a7 this could matter because 8-bit unsigned data from the register gets stored into a signed data type, therefore this should be 8-bit as well. For YAS530/532, on the other hand, it doesn't seem to matter. The size of a2-a9 and k is smaller than 8-bit at extraction, also the applied math is low. And Cx/Cy1/Cy2, now being defined as signed 16-bit, are extracted as unsigned 8-bit and undergo only minor math. [1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas537.c#L76-L78 [2] https://github.com/NovaFusion/android_kernel_samsung_golden/blob/cm-12.1/drivers/sensor/compass/yas_mag_driver-yas530.c#L526-L527 [3] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c#L76-L77 Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/f1e53bd6672aebe59f9b236b41374482edf888f8.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 8239f904f97c94b25a9983aa243090bb393abe81 Author: Jakob Hauser Date: Fri Aug 12 23:54:09 2022 +0200 iio: magnetometer: yas530: Correct temperature handling The raw temperature value is a number of counts from a certain starting point. The resolution of the temperature counts is different for the YAS variants. Temperature compensation for YAS532 version AC seems to be handled differently. It uses the deviation from 20 degree Celsius [1] whereas YAS530 and older versions of YAS532 apply solely the t value as a multiplier [2][3]. In funtion yas5xx_read_raw(), add case IIO_CHAN_INFO_PROCESSED. Remove scale of temperature as this isn't applied. Additionally correct sign of temperature channel in iio_chan_spec. It's already defined that way in the yas5xx_get_measure() function. [1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c#L442 [2] https://github.com/NovaFusion/android_kernel_samsung_golden/blob/cm-12.1/drivers/sensor/compass/yas_mag_driver-yas530.c#L881-L883 [3] https://github.com/LineageOS/android_kernel_samsung_msm8930-common/blob/lineage-18.1/drivers/sensors/geomagnetic/yas_mag_driver-yas53x.c#L856-L858 Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/eb45f328c7a81eb622c6a8cfc5c468ea58bbdace.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 413cf691633c985c3b49d005aa07b0e9c70c14a1 Author: Jakob Hauser Date: Fri Aug 12 23:54:08 2022 +0200 iio: magnetometer: yas530: Correct scaling of magnetic axes Looks like YAS530 raw values return picotesla and YAS532 nanotesla. Adapt comments and scaling. Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/053ab05cb9a0f6b0536ab5e0de57009f513c6f81.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit 4efdfbc16cceffbcb29e53a5be55d83a4c76a9c0 Author: Jakob Hauser Date: Fri Aug 12 23:54:07 2022 +0200 iio: magnetometer: yas530: Change range of data in volatile register In function yas5xx_volatile_reg(), register "YAS5XX_MEASURE_DATA + 8" shouldn't be volatile as we count from 0 to 7 here. Instead of lowering the number from 8 to 7, the operator "<=" is replaced by "<". The size of the measure data array is 8, therefore it's more natural to use 8 as a constant. This change is of low importance as the "+ 8" register isn't called. Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/dabba10feb80171350525ac874f944076c46e084.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit e137fafc8985cf152a4bb6f18ae83ebb06816df1 Author: Jakob Hauser Date: Fri Aug 12 23:54:06 2022 +0200 iio: magnetometer: yas530: Change data type of hard_offsets to signed The "hard_offsets" are currently unsigned u8 but they should be signed as they can get negative. They are signed in function yas5xx_meaure_offsets() and in the Yamaha drivers [1][2]. [1] https://github.com/NovaFusion/android_kernel_samsung_golden/blob/cm-12.1/drivers/sensor/compass/yas.h#L156 [2] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c#L91 Fixes: de8860b1ed47 ("iio: magnetometer: Add driver for Yamaha YAS530") Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/40f052bf6491457d0c5c0ed4c3534dc6fa251c3c.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron commit ef6d997667cbb964dbc27339fefbe65ceabea13a Author: Crt Mori Date: Mon Aug 8 16:49:36 2022 +0200 dt-bindings: iio: mlx90632 Add supply regulator documentation Document the newly added vdd supply option. Signed-off-by: Crt Mori Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808144936.1559158-1-cmo@melexis.com Signed-off-by: Jonathan Cameron commit 21a60fce89c63cc674910d3dbb12177366f41643 Author: Crt Mori Date: Mon Aug 8 16:49:08 2022 +0200 iio: temperature: mlx90632 Add supply regulator to sensor Provide possibility to toggle power supply to the sensor so that user can optimize their setup and not have the sensor constantly powered. Signed-off-by: Crt Mori Link: https://lore.kernel.org/r/20220808144908.1559069-1-cmo@melexis.com Signed-off-by: Jonathan Cameron commit 33dae107b6a9dfe92eba97b4a1df7402f9637f11 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:40 2022 +0200 iio: imu: adis16475: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-13-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 129a90cf81d510551e73aaaa1efb9befb0c17e52 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:39 2022 +0200 iio: frequency: adrf6780: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-12-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 3ea5b370afd4babbdff48775701bdd839dbb0407 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:37 2022 +0200 iio: frequency: adf4371: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-10-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 72336966eedbea3e264be46968beabd29e907ca8 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:36 2022 +0200 iio: adc: xilinx-xadc: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-9-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 40c0c1312c1b558463ddbf494d1f4569449cf11e Author: Uwe Kleine-König Date: Mon Aug 8 22:47:35 2022 +0200 iio: adc: xilinx-ams: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-8-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit dcb9bd105c9e6a69848c68575fa174ce6d7e9549 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:34 2022 +0200 iio: adc: ti-ads131e08: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-7-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 4004912e0ce545074b6177c43a70bd36c9c28006 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:32 2022 +0200 iio: adc: lpc18xx: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-5-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 51f2f910a551b3e8a23ea1d21b836716658908fe Author: Uwe Kleine-König Date: Mon Aug 8 22:47:31 2022 +0200 iio: adc: ingenic-adc: Benefit from devm_clk_get_prepared() to simplify Make use of devm_clk_get_prepared() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-4-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit cdd07b3ab94a020570132558442a26e74b70bc42 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:30 2022 +0200 iio: adc: ad9467: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-3-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 25f7e79515e76204ca03daaf77dab1e90ef97b33 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:29 2022 +0200 iio: adc: ad7768-1: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-2-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 8bbce0954fa1c695272421d047c53447fa709535 Author: Uwe Kleine-König Date: Mon Aug 8 22:47:28 2022 +0200 iio: adc: ad7124: Benefit from devm_clk_get_enabled() to simplify Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220808204740.307667-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 71041f73dc685ccaa7d150aa5eecc02609117739 Author: Jonathan Cameron Date: Sun Aug 7 19:45:34 2022 +0100 iio: magn: hmc5843: Move struct dev_pm_ops out of header Having this structure defined static in the header lead to unnecessary duplication and required additional symbol exports. Use the EXPORT_NS_SIMPLE_DEV_PM_OPS() to clean this up in the same fashion as many other drivers do this. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807184534.1037363-3-jic23@kernel.org commit c3b4afb1825b120481798512dd6a647804c5e521 Author: Jonathan Cameron Date: Sun Aug 7 19:45:33 2022 +0100 iio: magn: hmc5843: Drop excessive indentation of assignments of hmc5843_driver This formatting is odd, so fix it to be more standard. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807184534.1037363-2-jic23@kernel.org commit 1c4986f7e1fdbc44df66b37ee80722a2fcb02163 Author: Jonathan Cameron Date: Sun Aug 7 17:21:21 2022 +0100 iio: adc: mt6360: Drop an incorrect __maybe_unused marking. Given the struct platform_driver has one of it's elements assigned to point to the of_device_id table, it is never going to be unused. Drop the marking. Signed-off-by: Jonathan Cameron Cc: Gene Chen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807162121.862894-1-jic23@kernel.org commit 4c0babbd978a98dfbdacbe078817ea9c953b3298 Author: Jonathan Cameron Date: Sun Aug 7 16:12:18 2022 +0100 staging: iio: resolver: ad2s1210: Fix alignment for DMA safety ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. As the tx[] an rx[] buffers are only used in the same SPI exchanges, we should be safe with them on the same cacheline. Hence only mark the first one __aligned(IIO_DMA_MINALIGN). Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807151218.656881-5-jic23@kernel.org commit 48a1319164d9339ad50a25085cad6b879fef9fbe Author: Jonathan Cameron Date: Sun Aug 7 16:12:17 2022 +0100 staging: iio: meter: ade7854: Fix alignment for DMA safety ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Rodrigo Siqueira Link: https://lore.kernel.org/r/20220807151218.656881-4-jic23@kernel.org commit e48668a38bf420c660b07851985e6922fcf4b194 Author: Jonathan Cameron Date: Sun Aug 7 16:12:16 2022 +0100 staging: iio: frequency: ad9834: Fix alignment for DMA safety ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807151218.656881-3-jic23@kernel.org commit 282d16b628e4979eee692f5f93a936e5d613c926 Author: Jonathan Cameron Date: Sun Aug 7 15:54:57 2022 +0100 iio: light: cm32181: Mark the dev_pm_ops static. Only accessed from the local file. Warning: drivers/iio/light/cm32181.c:508:1: warning: symbol 'cm32181_pm_ops' was not declared. Should it be static? Fixes: 68c1b3dd5c48 ("iio: light: cm32181: Add PM support") Signed-off-by: Jonathan Cameron Cc: Kai-Heng Feng Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807145457.646062-3-jic23@kernel.org commit 89aba5759891acb859ab6d34453a8b933e38ace5 Author: Jonathan Cameron Date: Sun Aug 7 15:54:56 2022 +0100 iio: test: Mark file local structure arrays static. Warning cleanup: drivers/iio/test/iio-test-rescale.c:32:30: warning: symbol 'scale_cases' was not declared. Should it be static? drivers/iio/test/iio-test-rescale.c:480:30: warning: symbol 'offset_cases' was not declared. Should it be static? Signed-off-by: Jonathan Cameron Cc: Liam Beguin Reviewed-by: Liam Beguin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220807145457.646062-2-jic23@kernel.org commit becbe550a36e027440ca0ccef2195e67c054e5bb Author: Francesco Dolcini Date: Tue Jul 12 18:33:44 2022 +0200 dt-bindings: iio: adc: stmpe: Remove node name requirement STMPE driver does not require a specific node name anymore, only the compatible is checked, update binding according to this. Signed-off-by: Francesco Dolcini Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220712163345.445811-5-francesco.dolcini@toradex.com Signed-off-by: Jonathan Cameron commit 40b5c4d5b5a67e79eef86a653cdc8b10b4d73f11 Author: Jonathan Cameron Date: Sun Aug 7 15:01:44 2022 +0100 iio: cdc: ad7746: Move driver out of staging. All known major issues with this driver resolved so time to move it out of staging. This also allows us to remove the now empty staging/iio/cdc directory and build files. Note this cleanup work was done using the roadtest framework. https://lore.kernel.org/all/20220311162445.346685-1-vincent.whitchurch@axis.com/ Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit cc21231ef0995a6507f2976e40fa473b82e84a44 Author: Jonathan Cameron Date: Sun Jun 26 13:29:36 2022 +0100 iio: cdc: ad7746: Add device specific ABI documentation. The datasheet description of offset calibration is complex, so for that on just refer the reader to the device datasheet. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-16-jic23@kernel.org commit 6d6c760954dc3075378ce925f8a511c64cbd908f Author: Jonathan Cameron Date: Sun Jun 26 13:29:35 2022 +0100 staging: iio: ad7746: White space cleanup Tidy up some trivial whitespace issues. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-15-jic23@kernel.org commit 4b717201a00576a2aad4d02ae61df363279bd934 Author: Jonathan Cameron Date: Sun Jun 26 13:29:34 2022 +0100 staging: iio: cdc: ad7746: Use read_avail() rather than opencoding. Switch over to the IIO core handling for _available attributes making them available for in kernel users and enforcing correct naming etc automatically. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-14-jic23@kernel.org commit 2d72ead25abb72996a7e92608224d2503a3bac9c Author: Jonathan Cameron Date: Sun Jun 26 13:29:33 2022 +0100 staging: iio: cdc: ad7746: Switch from _offset to _zeropoint for differential channels. As this offset is applied equally to both lines of the differential pair, _ofset should not be used. Use the new ABI _zeropoint instead to avoid userspace software applying this value when calculating real value = (_raw + _offset) * _scale Also add a comment to explain why an offset of 0x800000 is applied within the driver rather than exposed to userspace. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-13-jic23@kernel.org commit 5c64990b99aa91622cf044a9a2f7a78de8f770a2 Author: Jonathan Cameron Date: Sun Jun 26 13:29:32 2022 +0100 iio: core: Introduce _zeropoint for differential channels Address an ABI gap for device where the offset of both lines in a differential pair may be controlled so as to allow a wider range of inputs, but without having any direct effect of the differential measurement. _offset cannot be used as to remain in line with existing usage, userspace would be expected to apply it as (_raw + _offset) * _scale whereas _zeropoint is not. i.e. If we were computing the differential in software it would be. ((postive_raw + _zeropoint) - (negative_raw + zeropoint) + _offset) * _scale = ((postive_raw - negative_raw) + _offset) * _scale = (differential_raw + _offset) * _scale Similarly calibbias is expected to tweak the measurement seen, not the adjust the two lines of the differential pair. Needed for in_capacitanceX-capacitanceY_zeropoint for the AD7746 CDC driver. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-12-jic23@kernel.org commit 431e9147b4667d67399fe5db4f8203d55811951b Author: Jonathan Cameron Date: Sun Jun 26 13:29:31 2022 +0100 staging: iio: cdc: ad7746: Use _raw and _scale for temperature channels. Performing the maths to rescale a 24 bit raw reading within the driver was resulting in precision losses. So make that userspace's problem by exporting the scale and letting the maths be done in userspace with appropriate precision. Issue identified using roadtester testing framework. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-11-jic23@kernel.org commit 90e7853ce051bca3690d3518e523f427e55c4806 Author: Jonathan Cameron Date: Sun Jun 26 13:29:30 2022 +0100 staging: iio: cdc: ad7746: Drop unused i2c_set_clientdata() As the comment states, this was only used in remove() and now there is no explicit remove() function to make use of it. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-10-jic23@kernel.org commit 9eee2fc4a670d70ded6cc88c42d760338ce96918 Author: Jonathan Cameron Date: Sun Jun 26 13:29:29 2022 +0100 staging: iio: cdc: ad7746: Break up use of chan->address and use FIELD_PREP etc Instead of encoding several different fields into chan->address use an indirection to a separate per channel structure where the various fields can be expressed in a more readable form. This also allows the register values to be constructed at runtime using FIELD_PREP(). Drop the now redundant _SHIFT macros. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-9-jic23@kernel.org commit b1f567bde7e12e7671d8b0015ad3cbff8f3a8d3b Author: Jonathan Cameron Date: Sun Jun 26 13:29:28 2022 +0100 staging: iio: cdc: ad7764: Push locking down into case statements in read/write_raw Not all paths require any locking at all. So to simplify the removal of such locking push the locks down into the individual case statements. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-8-jic23@kernel.org commit 5d54564e47435a5c1c1afa63c1d64908609cd545 Author: Jonathan Cameron Date: Sun Jun 26 13:29:27 2022 +0100 staging: iio: cdc: ad7746: Factor out ad7746_read_channel() Reduce deep indenting and simplify the locking cleanup that follows. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-7-jic23@kernel.org commit 77fdc4cead204f2b3e2e1e365f70528199298737 Author: Jonathan Cameron Date: Sun Jun 26 13:29:26 2022 +0100 staging: iio: cdc: ad7746: Use local buffer for multi byte reads. I2C does not require DMA safe buffers so there is no need to ensure the buffers are in their own cacheline. Hence simplify things by using a local variable instead of embedding the buffer in the chip info structure. Includes a trivial whitespace cleanup to drop a line between function and error handling. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-6-jic23@kernel.org commit 104827ec920d73db1c0176536f02ba5272c4b8fb Author: Jonathan Cameron Date: Sun Jun 26 13:29:25 2022 +0100 staging: iio: cdc: ad7746: Push handling of supply voltage scale to userspace. The supply voltage is attenuated by 6 before being fed to the ADC. Handle this explicitly rather than pre-multiplying the _raw value by 6. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-5-jic23@kernel.org commit ebf30bed140d1da42331ce2e90125fb5e3cc5191 Author: Jonathan Cameron Date: Sun Jun 26 13:29:24 2022 +0100 staging: iio: cdc: ad7746: Use explicit be24 handling. Chance from fiddly local implementation of be24 to cpu endian conversion by reading into a 3 byte buffer and using get_unaligned_be24() Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-4-jic23@kernel.org commit 1efc41035f1841acf0af2bab153158e27ce94f10 Author: Jonathan Cameron Date: Sun Jun 26 13:29:23 2022 +0100 iio: ABI: Fix wrong format of differential capacitance channel ABI. in_ only occurs once in these attributes. Fixes: 0baf29d658c7 ("staging:iio:documentation Add abi docs for capacitance adcs.") Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220626122938.582107-3-jic23@kernel.org commit 110f11589c877732d8167d4d4ee739a4566785e2 Author: Nuno Sá Date: Fri Jul 15 14:29:03 2022 +0200 iio: inkern: fix coding style warnings Just cosmetics. No functional change intended... Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-16-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit b22bc4d6072e74b768c4c19e2ff3585ba5927904 Author: Nuno Sá Date: Fri Jul 15 14:29:02 2022 +0200 iio: inkern: remove OF dependencies Since all users of the OF dependendent API are now converted to use the firmware agnostic alternative, we can drop OF dependencies from the IIO in kernel interface. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-15-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit d7705f35448ada5a04f15326404e40d4254c538d Author: Nuno Sá Date: Fri Jul 15 14:29:01 2022 +0200 iio: adc: stm32-adc: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Reviewed-by: Fabrice Gasnier Tested-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220715122903.332535-14-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 4f47a236a23d9f18d018a2f6639daad476d2a3f2 Author: Nuno Sá Date: Fri Jul 15 14:29:00 2022 +0200 iio: adc: qcom-spmi-adc5: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-13-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit e7c672d06b0777342672ee125548310d433855fc Author: Nuno Sá Date: Fri Jul 15 14:28:59 2022 +0200 iio: adc: qcom-spmi-vadc: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-12-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 9e90c1772fcb8fe3bf39c112b8ef6852e48dbc71 Author: Nuno Sá Date: Fri Jul 15 14:28:58 2022 +0200 iio: adc: qcom-pm8xxx-xoadc: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-11-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 34b6eb89351bc281d5323c119e2deb84273d4266 Author: Nuno Sá Date: Fri Jul 15 14:28:57 2022 +0200 iio: adc: at91-sama5d2_adc: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220715122903.332535-10-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit dec7e2c83e678ed0c4cab56c1a099bd39ebfa408 Author: Nuno Sá Date: Fri Jul 15 14:28:56 2022 +0200 iio: adc: ab8500-gpadc: convert to device properties Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-9-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 9ac075972bd25c83a922d3b9548cbe952248bd8f Author: Nuno Sá Date: Fri Jul 15 14:28:55 2022 +0200 iio: adc: ingenic-adc: convert to IIO fwnode interface Move from 'of_xlate()' to 'fwnode_xlate()'. The end goal is to completely drop OF from the IIO inkernel interface. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-8-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 17fe12a2fe2dc95f22efa388d60b396ca134c1ee Author: Nuno Sá Date: Fri Jul 15 14:28:54 2022 +0200 thermal: qcom: qcom-spmi-adc-tm5: convert to IIO fwnode API Make usage of the new firmware agnostic API 'devm_of_iio_channel_get_by_name()' to get the IIO channel. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Acked-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220715122903.332535-7-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 1e64b9c5f9a01f1a752438724bc83180c451e1c7 Author: Nuno Sá Date: Fri Jul 15 14:28:53 2022 +0200 iio: inkern: move to fwnode properties This moves the IIO in kernel interface to use fwnode properties and thus be firmware agnostic. Note that the interface is still not firmware agnostic. At this point we have both OF and fwnode interfaces so that we don't break any user. On top of this we also want to have a per driver conversion and that is the main reason we have both of_xlate() and fwnode_xlate() support. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-6-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit d6bb09eab2b3c4c55e5f6006cf8e759439e3e741 Author: Nuno Sá Date: Fri Jul 15 14:28:52 2022 +0200 iio: inkern: split of_iio_channel_get_by_name() This change splits of_iio_channel_get_by_name() so that it decouples looking for channels in the current node from looking in it's parents nodes. This will be helpful when moving to fwnode properties where we need to release the handles when looking for channels in parent's nodes. No functional change intended... Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-5-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit ed5e5ed4e377599825d32162a6ff3e9d2d89d200 Author: Nuno Sá Date: Fri Jul 15 14:28:51 2022 +0200 iio: inkern: only return error codes in iio_channel_get_*() APIs APIs like of_iio_channel_get_by_name() and of_iio_channel_get_all() were returning a mix of NULL and pointers with NULL being the way to "notify" that we should do a "system" lookup for channels. This make it very confusing and prone to errors as commit 9f63cc0921ec ("iio: inkern: fix return value in devm_of_iio_channel_get_by_name()") proves. On top of this, patterns like 'if (channel != NULL) return channel' were being used where channel could actually be an error code which makes the code hard to read. This change also makes some functional changes on how errors were being handled. In the original behavior, even if we get an error like '-ENOMEM', we still continue with the search. We should only continue to lookup for the channel when it makes sense to do so. Hence, the main error handling in 'of_iio_channel_get_by_name()' is changed to the following logic: * If a channel 'name' is provided and we do find it via 'io-channel-names', we should be able to get it. If we get any error, we should not proceed with the lookup. Moreover, we should return an error so that callers won't proceed with a system lookup. * If a channel 'name' is provided and we cannot find it ('index < 0'), 'of_parse_phandle_with_args()' is expected to fail with '-EINVAL'. Hence, we should only continue if we get that error. * If a channel 'name' is not provided we should only carry on with the search if 'of_parse_phandle_with_args()' returns '-ENOENT'. Also note that a system channel lookup is only done if the returned error code (from 'of_iio_channel_get_by_name()' or 'of_iio_channel_get_all()' is -ENODEV. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-4-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 9e878dbc0e8322f8b2f5ab0093c1e89926362dbe Author: Nuno Sá Date: Fri Jul 15 14:28:50 2022 +0200 iio: inkern: fix return value in devm_of_iio_channel_get_by_name() of_iio_channel_get_by_name() can either return NULL or an error pointer so that only doing IS_ERR() is not enough. Fix it by checking the NULL pointer case and return -ENODEV in that case. Note this is done like this so that users of the function (which only check for error pointers) do not need to be changed. This is not ideal since we are losing error codes and as such, in a follow up change, things will be unified so that of_iio_channel_get_by_name() only returns error codes. Fixes: 6e39b145cef7 ("iio: provide of_iio_channel_get_by_name() and devm_ version it") Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220715122903.332535-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 79c3e84874c7d14f04ad58313b64955a0d2e9437 Author: Nuno Sá Date: Fri Jul 15 14:28:49 2022 +0200 iio: inkern: only release the device node when done with it 'of_node_put()' can potentially release the memory pointed to by 'iiospec.np' which would leave us with an invalid pointer (and we would still pass it in 'of_xlate()'). Note that it is not guaranteed for the of_node lifespan to be attached to the device (to which is attached) lifespan so that there is (even though very unlikely) the possibility for the node to be freed while the device is still around. Thus, as there are indeed some of_xlate users which do access the node, a race is indeed possible. As such, we can only release the node after we are done with it. Fixes: 17d82b47a215d ("iio: Add OF support") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220715122903.332535-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 15b2ac67859006bace228cbdc8607d0ea0af4e89 Author: Marijn Suijten Date: Fri Aug 5 15:57:26 2022 +0200 iio: adc: qcom-spmi-adc5: Add missing VCOIN/GPIO[134] channels These channels are specified in downstream kernels [1] and actively used by e.g. the Sony Seine platform on the SM6125 SoC. Note that GPIO2 isn't used on this platform and, while the definition downstream is identical to the other GPIOx_100K_PU definitions, has been omitted for lack of proper testing. [1]: https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/drivers/iio/adc/qcom-spmi-adc5.c?h=LA.UM.7.11.r1-05200-NICOBAR.0#n688 Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220805135729.1037079-3-marijn.suijten@somainline.org Signed-off-by: Jonathan Cameron commit 75d7556ac0e4bff830f7f90ceaa8d35f4b6c346a Author: Claudiu Beznea Date: Wed Aug 3 13:28:55 2022 +0300 iio: adc: at91-sama5d2_adc: add runtime pm support Add runtime PM support by disabling/enabling ADC's peripheral clock. On simple conversion the ADC's clock is kept enabled just while the conversion is in progress. This includes also temperature conversion. For triggered buffers and touch conversions the ADC clock is kept enabled while the triggered buffers or touch are enabled. Along with it removed the __maybe_unused on suspend() and resume() ops as the dev_pm_ops object members are now filled with SYSTEM_SLEEP_PM_OPS(). Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-20-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 0cf53f303a02f5c4560042e856035b995a457c1f Author: Claudiu Beznea Date: Wed Aug 3 13:28:54 2022 +0300 iio: adc: at91-sama5d2_adc: add empty line after functions Add empty line after function. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-19-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 5ab38b81895c869fb72eab5b528d5ef13a741c66 Author: Claudiu Beznea Date: Wed Aug 3 13:28:53 2022 +0300 iio: adc: at91-sama5d2_adc: add support for temperature sensor The ADC on SAMA7G5 has a dedicated channel (channel 31) for measuring in-SoC temperature. 2 inputs are multiplexed on channel 31, VTEMP and VBG as follows: ` | \ +-----+ VBG --->| | ch31 | | Vtemp --->| |----->| ADC | | / | | | / +-----+ . where: - VTEMP is proportional to the absolute temperature voltage - VBG is a quasi-temperature independent voltage Both VBG and VTEMP are needed to determine the correct in-SoC temperature. At a moment of time only one of these could be measured, the selection being done with bit SRCLCH bit of ACR register. The formula to calculate the temperature is as follows: P1 + (Vref * (VTEMP - P6 - P4 * VBG)) / (VBG * VTEMP_DT) where: - P1, P4, P6 are calibration data retrieved from OTP memory - Vref is the reference voltage for ADC - VTEMP_DT is the voltage sensitivity to temperature and is constant - VTEMP, VBG are the measured values from channel 31 For better resolution before reading the temperature certain settings for oversampling ratio, sample frequency, EMR.TRACKX, MR.TRACKTIM are applied. The initial settings are reapplied at the end of temperature reading. Current support is not integrated with trigger buffers channel 31 not being enabled/disabled in functions at91_adc_buffer_prepare(), at91_adc_buffer_postdisable() thus the conversion for channel 31 is not done in case trigger buffers are enabled. In case of trigger buffers are enabled and temperature requests are received in the driver though at91_adc_read_temp() the at91_adc_read_temp() will return with an error code. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-18-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit cb6e097d9340e037ced6c580019e823b702c6bb9 Author: Claudiu Beznea Date: Wed Aug 3 13:28:52 2022 +0300 dt-bindings: iio: adc: at91-sama5d2_adc: add id for temperature channel Add ID for temperature channel of AT91 SAMA5D2 ADC. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220803102855.2191070-17-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit a0f96db4ca1279d2c5150ed306e32a589f66070b Author: Claudiu Beznea Date: Wed Aug 3 13:28:51 2022 +0300 iio: adc: at91-sama5d2_adc: lock around at91_adc_read_info_raw() Remove iio_device_{claim, release}_direct_mode() and lock/unlock to &st->lock from at91_adc_read_info_raw(). Instead add a wrapper around at91_adc_read_info_raw() and do there the lock/unlock. This will allow using the at91_adc_read_info_raw() in patch that add support for temperature sensor. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-16-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 5f72666f4b1ac269fe5b3b3f0cfaa6ada6add57c Author: Claudiu Beznea Date: Wed Aug 3 13:28:50 2022 +0300 iio: adc: at91-sama5d2_adc: add startup and tracktim as parameter for at91_adc_setup_samp_freq() Add startup and tracktim as parameter for at91_adc_setup_samp_freq() function. In case of temperature sensor being enabled these parameters will be configured on temperature read request to improve the accuracy of the read temperature. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-15-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 04227f9510799b8f15fc9dcc30e12ed503bb3183 Author: Claudiu Beznea Date: Wed Aug 3 13:28:49 2022 +0300 iio: adc: at91-sama5d2_adc: update trackx on emr Add support for updating trackx bits of EMR register. Having different values of EMR.TRACKX when measuring temperature give a better accuracy. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-14-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 426b64752c4cc2059d5219d81071bf57608f346f Author: Claudiu Beznea Date: Wed Aug 3 13:28:48 2022 +0300 iio: adc: at91-sama5d2_adc: move oversampling storage in its function Move the storage of oversampling_ratio in at91_adc_config_emr(). This prepares for the next commits. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-13-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 5fc30713acf731f562dfdbe0795dadb71abd9183 Author: Claudiu Beznea Date: Wed Aug 3 13:28:47 2022 +0300 iio: adc: at91-sama5d2_adc: add 64 and 256 oversampling ratio Add 64 and 256 oversampling ratio support. It is necessary for temperature sensor. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-12-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 00ee4add809fa6d2a4508004e3933404de288194 Author: Claudiu Beznea Date: Wed Aug 3 13:28:46 2022 +0300 iio: adc: at91-sama5d2_adc: adjust osr based on specific platform data ADC captures data on 12 bits (if oversampling is not enabled). When using oversampling captured data could go up to 14 bits for SAMA5D2 or up to 16 bits for SAMA7G5 (depending on oversampling settings). All the channels that are subject of oversampling are registered as 14 or 16 real bits. Depending on the oversampling settings the ADC converted value need to be shifted up to 14 or 16 to cope with realbits value registered to IIO subsystem. Commit adds platform specific information to know if we run on a system with up to 14 or 16 bits ADC converted data. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-11-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 3c5d62a1e407eb2c941d094bfc0aa9ee85998f88 Author: Claudiu Beznea Date: Wed Aug 3 13:28:45 2022 +0300 iio: adc: at91-sama5d2_adc: add .read_avail() chan_info ops Add .read_avail() to chan_info ops which will retrieve the available oversampling ratio. Suggested-by: Jonathan Cameron Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-10-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit eea2655e10a05b0836c09a8ac7c27edc79d1d661 Author: Claudiu Beznea Date: Wed Aug 3 13:28:44 2022 +0300 iio: adc: at91-sama5d2_adc: drop AT91_OSR_XSAMPLES defines Drop AT91_OSR_1SAMPLES, AT91_OSR_4SAMPLES, AT91_OSR_16SAMPLES defines and insted use their values inline. Suggested-by: Jonathan Cameron Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-9-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 502966c3b0267aee88803eda639d95fb98db433b Author: Claudiu Beznea Date: Wed Aug 3 13:28:43 2022 +0300 iio: adc: at91-sama5d2_adc: move the check of oversampling in its function Oversampling values are checked anyway in at91_adc_emr_config(). Remove the checking of these from at91_adc_write_raw() and return -EINVAL instead in at91_adc_emr_config(). Suggested-by: Jonathan Cameron Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-8-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 287c271dee146b7ab38f29d055691b8bc3753f35 Author: Claudiu Beznea Date: Wed Aug 3 13:28:42 2022 +0300 iio: adc: at91-sama5d2_adc: handle different EMR.OSR for different hw versions SAMA7G5 introduces 64 and 256 oversampling rates. Due to this EMR.OSR is 3 bits long. Change the code to reflect this. Commit prepares the code for the addition of 64 and 256 oversampling rates. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-7-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit cf15a2b518b3e6991ef1c2f87e9a7f7e4afa7b77 Author: Claudiu Beznea Date: Wed Aug 3 13:28:41 2022 +0300 iio: adc: at91-sama5d2_adc: exit from write_raw() when buffers are enabled When buffers are enabled conversion may start asynchronously thus allowing changes on actual hardware could lead to bad behavior. Thus do not allow changing oversampling ratio and sample frequency when if iio_device_claim_direct_mode() returns with error. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-6-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 808175e21d9b7f866eda742e8970f27b78afe5db Author: Claudiu Beznea Date: Wed Aug 3 13:28:40 2022 +0300 iio: adc: at91-sama5d2_adc: disable/prepare buffer on suspend/resume In case triggered buffers are enabled while system is suspended they will not work anymore after resume. For this call at91_adc_buffer_postdisable() on suspend and at91_adc_buffer_prepare() on resume. On tests it has been seen that at91_adc_buffer_postdisable() call is not necessary but it has been kept because it also does the book keeping for DMA. On resume path there is no need to call at91_adc_configure_touch() as it is embedded in at91_adc_buffer_prepare(). Fixes: 073c662017f2f ("iio: adc: at91-sama5d2_adc: add support for DMA") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-5-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 9780a23ed5a0a0a63683e078f576719a98d4fb70 Author: Claudiu Beznea Date: Wed Aug 3 13:28:39 2022 +0300 iio: adc: at91-sama5d2_adc: lock around oversampling and sample freq .read_raw()/.write_raw() could be called asynchronously from user space or other in kernel drivers. Without locking on st->lock these could be called asynchronously while there is a conversion in progress. Read will be harmless but changing registers while conversion is in progress may lead to inconsistent results. Thus, to avoid this lock st->lock. Fixes: 27e177190891 ("iio:adc:at91_adc8xx: introduce new atmel adc driver") Fixes: 6794e23fa3fe ("iio: adc: at91-sama5d2_adc: add support for oversampling resolution") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-4-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit d84ace944a3b24529798dbae1340dea098473155 Author: Claudiu Beznea Date: Wed Aug 3 13:28:38 2022 +0300 iio: adc: at91-sama5d2_adc: check return status for pressure and touch Check return status of at91_adc_read_position() and at91_adc_read_pressure() in at91_adc_read_info_raw(). Fixes: 6794e23fa3fe ("iio: adc: at91-sama5d2_adc: add support for oversampling resolution") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-3-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit bb73d5d9164c57c4bb916739a98e5cd8e0a5ed8c Author: Claudiu Beznea Date: Wed Aug 3 13:28:37 2022 +0300 iio: adc: at91-sama5d2_adc: fix AT91_SAMA5D2_MR_TRACKTIM_MAX All ADC HW versions handled by this driver (SAMA5D2, SAM9X60, SAMA7G5) have MR.TRACKTIM on 4 bits. Fix AT91_SAMA5D2_MR_TRACKTIM_MAX to reflect this. Fixes: 27e177190891 ("iio:adc:at91_adc8xx: introduce new atmel adc driver") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220803102855.2191070-2-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron commit 1bfb86d97a9fa607ab9bab4b28784cac7064420c Author: Joe Simmons-Talbott Date: Sun Jul 31 12:01:20 2022 -0400 iio: Add names for function definition arguments. As reported by checkpatch.pl add missing names for function definition arguments. Signed-off-by: Joe Simmons-Talbott Link: https://lore.kernel.org/r/20220731160120.4831-1-joetalbott@gmail.com Signed-off-by: Jonathan Cameron commit 7898f31b0e7a6ba1ec9c7391e7ece9e31dd93262 Author: ChiYuan Huang Date: Tue Jul 19 22:52:45 2022 +0800 Documentation: ABI: testing: rtq6056: Update ABI docs Add documentation for the usage of voltage channel integration time. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1658242365-27797-4-git-send-email-u0084500@gmail.com Signed-off-by: Jonathan Cameron commit 4396f45d211b6aa2f3a821f0a3a77c992335724b Author: ChiYuan Huang Date: Tue Jul 19 22:52:44 2022 +0800 iio: adc: Add rtq6056 support Add Richtek rtq6056 supporting. It can be used for the system to monitor load current and power with 16-bit resolution. Signed-off-by: ChiYuan Huang Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/1658242365-27797-3-git-send-email-u0084500@gmail.com Signed-off-by: Jonathan Cameron commit 3b7eee5b38755501b8cc09b8f3b46c005af40a50 Author: ChiYuan Huang Date: Tue Jul 19 22:52:43 2022 +0800 dt-bindings: iio: adc: Add rtq6056 adc support Add the documentation for Richtek rtq6056. Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1658242365-27797-2-git-send-email-u0084500@gmail.com Signed-off-by: Jonathan Cameron commit 83f0bcd40d5cf88870d2f2bb8b97c772b92a3d1f Author: Shreeya Patel Date: Mon Jul 25 16:10:50 2022 +0530 iio: light: Add support for ltrf216a sensor Add initial support for ltrf216a ambient light sensor. Datasheet: https://gitlab.collabora.com/shreeya/iio/-/blob/master/LTRF216A.pdf Reviewed-by: Andy Shevchenko Co-developed-by: Zhigang Shi Signed-off-by: Zhigang Shi Co-developed-by: Dmitry Osipenko Signed-off-by: Dmitry Osipenko Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220725104050.491396-3-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit af0a61e940f8cea62c3c9a18ff5b3830b16e2087 Author: Shreeya Patel Date: Mon Jul 25 16:10:49 2022 +0530 dt-bindings: Document ltrf216a light sensor bindings Add devicetree bindings for ltrf216a ambient light sensor. Reviewed-by: Rob Herring Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220725104050.491396-2-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit bd1d558c9c65cf56623a3a237a2998697586c409 Author: Martin Larsson Date: Wed Jul 20 15:31:54 2022 +0000 iio: adc: imx8qxp-adc: propagate regulator_get_voltage error If the ADC vref regulator returns an error, for example, if CONFIG_REGULATOR is not set, the error will be used as a reference voltage. Introduce a guard for negative return values instead of unconditionally casting it to u32. Acked-by: Haibo Chen Signed-off-by: Martin Larsson Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220720153136.3502440-1-martin.larsson@actia.se Signed-off-by: Jonathan Cameron commit 9e8284501c8d9e2bde4dfcddaf0201ee7cc8f2a7 Author: Marcus Folkesson Date: Sat Jul 23 11:20:30 2022 +0200 MAINTAINERS: Update Microchip MCP3911 to Maintained The actual status of the code is Maintained. Signed-off-by: Marcus Folkesson Cc: Kent Gustavsson Cc: Jonathan Cameron Cc: linux-iio Link: https://lore.kernel.org/r/20220723092030.260812-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 857f09f605bae6702b5ec9afdc47c6b188d7cdf6 Author: Krzysztof Kozlowski Date: Wed Jul 27 17:52:03 2022 +0200 dt-bindings: iio: adc: ti,am3359-adc: add ti,am654-adc Document the ti,am654-adc compatible already used in DTS: arch/arm64/boot/dts/ti/k3-am642-evm.dtb: adc: compatible:0: 'ti,am654-adc' is not one of ['ti,am3359-adc', 'ti,am4372-adc'] Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220727155203.320929-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 3d4b8291df3b5c9bc62ea8213b5483c4ec852947 Author: Joe Simmons-Talbott Date: Wed Jul 27 14:18:55 2022 -0400 iio: Fix indentation for multiline conditional. As reported by checkpatch.pl make indentation match previous conditional. Signed-off-by: Joe Simmons-Talbott Link: https://lore.kernel.org/r/20220727181855.589052-3-joetalbott@gmail.com Signed-off-by: Jonathan Cameron commit 9d9ec8d01443832d4e6d2f46bfd6b3270f390be3 Author: Joe Simmons-Talbott Date: Wed Jul 27 14:18:54 2022 -0400 iio: Add blank lines after declarations. As reported by checkpatch.pl add blank lines after declarations. Signed-off-by: Joe Simmons-Talbott Link: https://lore.kernel.org/r/20220727181855.589052-2-joetalbott@gmail.com Signed-off-by: Jonathan Cameron commit 7f203bc89eb66d6afde7eae91347fc0352090cc3 Author: Tejun Heo Date: Fri Jul 29 13:10:16 2022 -1000 cgroup: Replace cgroup->ancestor_ids[] with ->ancestors[] Every cgroup knows all its ancestors through its ->ancestor_ids[]. There's no advantage to remembering the IDs instead of the pointers directly and this makes the array useless for finding an actual ancestor cgroup forcing cgroup_ancestor() to iteratively walk up the hierarchy instead. Let's replace cgroup->ancestor_ids[] with ->ancestors[] and remove the walking-up from cgroup_ancestor(). While at it, improve comments around cgroup_root->cgrp_ancestor_storage. This patch shouldn't cause user-visible behavior differences. v2: Update cgroup_ancestor() to use ->ancestors[]. v3: cgroup_root->cgrp_ancestor_storage's type is updated to match cgroup->ancestors[]. Better comments. Signed-off-by: Tejun Heo Acked-by: Namhyung Kim commit fbd92809997a391f28075f1c8b5ee314c225557c Author: Conor Dooley Date: Fri Jul 15 18:51:56 2022 +0100 riscv: topology: fix default topology reporting RISC-V has no sane defaults to fall back on where there is no cpu-map in the devicetree. Without sane defaults, the package, core and thread IDs are all set to -1. This causes user-visible inaccuracies for tools like hwloc/lstopo which rely on the sysfs cpu topology files to detect a system's topology. On a PolarFire SoC, which should have 4 harts with a thread each, lstopo currently reports: Machine (793MB total) Package L#0 NUMANode L#0 (P#0 793MB) Core L#0 L1d L#0 (32KB) + L1i L#0 (32KB) + PU L#0 (P#0) L1d L#1 (32KB) + L1i L#1 (32KB) + PU L#1 (P#1) L1d L#2 (32KB) + L1i L#2 (32KB) + PU L#2 (P#2) L1d L#3 (32KB) + L1i L#3 (32KB) + PU L#3 (P#3) Adding calls to store_cpu_topology() in {boot,smp} hart bringup code results in the correct topolgy being reported: Machine (793MB total) Package L#0 NUMANode L#0 (P#0 793MB) L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0 + PU L#0 (P#0) L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1 + PU L#1 (P#1) L1d L#2 (32KB) + L1i L#2 (32KB) + Core L#2 + PU L#2 (P#2) L1d L#3 (32KB) + L1i L#3 (32KB) + Core L#3 + PU L#3 (P#3) CC: stable@vger.kernel.org # 456797da792f: arm64: topology: move store_cpu_topology() to shared code Fixes: 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.") Reported-by: Brice Goglin Link: https://github.com/open-mpi/hwloc/issues/536 Reviewed-by: Sudeep Holla Reviewed-by: Atish Patra Signed-off-by: Conor Dooley commit 7eac0081a8e958106ed3aea402c8105f30fad6d9 Author: Conor Dooley Date: Wed Aug 10 09:59:15 2022 +0100 riscv: dts: microchip: add qspi compatible fallback The "hard" QSPI peripheral on PolarFire SoC is derived from version 2 of the FPGA IP core. The original binding had no fallback etc, so this device tree is valid as is. There was also no functional driver for the QSPI IP, so no device with a devicetree from a previous mainline release will regress. Link: https://lore.kernel.org/linux-spi/7c9f0d96-2882-964a-cd1f-916ddb3f0410@linaro.org/ Signed-off-by: Conor Dooley Acked-by: Krzysztof Kozlowski commit 8308bf207ce6963adb42791cfb260dc6552b6665 Author: Daniel Xu Date: Thu Aug 11 15:55:27 2022 -0600 selftests/bpf: Update CI kconfig The previous selftest changes require two kconfig changes in bpf-ci. Signed-off-by: Daniel Xu Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/2c27c6ebf7a03954915f83560653752450389564.1660254747.git.dxu@dxuuu.xyz commit 99799de2cba2d399acf65f49a986b3d5cf0732ab Author: Daniel Xu Date: Thu Aug 11 15:55:26 2022 -0600 selftests/bpf: Add connmark read test Test that the prog can read from the connection mark. This test is nice because it ensures progs can interact with netfilter subsystem correctly. Signed-off-by: Daniel Xu Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/d3bc620a491e4c626c20d80631063922cbe13e2b.1660254747.git.dxu@dxuuu.xyz commit e81fbd4c1ba7b128a198c2843665e1186db449b6 Author: Daniel Xu Date: Thu Aug 11 15:55:25 2022 -0600 selftests/bpf: Add existing connection bpf_*_ct_lookup() test Add a test where we do a conntrack lookup on an existing connection. This is nice because it's a more realistic test than artifically creating a ct entry and looking it up afterwards. Signed-off-by: Daniel Xu Signed-off-by: Daniel Borkmann Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/de5a617832f38f8b5631cc87e2a836da7c94d497.1660254747.git.dxu@dxuuu.xyz commit cea558855c39b7f1f02ff50dcf701ca6596bc964 Author: Quentin Monnet Date: Mon Aug 15 17:22:05 2022 +0100 bpftool: Clear errno after libcap's checks When bpftool is linked against libcap, the library runs a "constructor" function to compute the number of capabilities of the running kernel [0], at the beginning of the execution of the program. As part of this, it performs multiple calls to prctl(). Some of these may fail, and set errno to a non-zero value: # strace -e prctl ./bpftool version prctl(PR_CAPBSET_READ, CAP_MAC_OVERRIDE) = 1 prctl(PR_CAPBSET_READ, 0x30 /* CAP_??? */) = -1 EINVAL (Invalid argument) prctl(PR_CAPBSET_READ, CAP_CHECKPOINT_RESTORE) = 1 prctl(PR_CAPBSET_READ, 0x2c /* CAP_??? */) = -1 EINVAL (Invalid argument) prctl(PR_CAPBSET_READ, 0x2a /* CAP_??? */) = -1 EINVAL (Invalid argument) prctl(PR_CAPBSET_READ, 0x29 /* CAP_??? */) = -1 EINVAL (Invalid argument) ** fprintf added at the top of main(): we have errno == 1 ./bpftool v7.0.0 using libbpf v1.0 features: libbfd, libbpf_strict, skeletons +++ exited with 0 +++ This has been addressed in libcap 2.63 [1], but until this version is available everywhere, we can fix it on bpftool side. Let's clean errno at the beginning of the main() function, to make sure that these checks do not interfere with the batch mode, where we error out if errno is set after a bpftool command. [0] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/tree/libcap/cap_alloc.c?h=libcap-2.65#n20 [1] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=f25a1b7e69f7b33e6afb58b3e38f3450b7d2d9a0 Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220815162205.45043-1-quentin@isovalent.com commit 77672e0387f90153e3c7ee89456d16dcacfef6d2 Merge: 060004431df49 7e7ba58c94127 Author: Mark Brown Date: Mon Aug 15 18:42:13 2022 +0100 regmap: mmio: Extending to support IO ports Merge series from Andy Shevchenko : Currently regmap MMIO doesn't support IO ports, while being inconsistent in used IO accessors. Fix the latter and extend framework with the former. commit 4630535c64725bcd722eb59fb8d92be8db943d3d Author: Uros Bizjak Date: Tue Jun 28 18:16:12 2022 +0200 x86/uaccess: Improve __try_cmpxchg64_user_asm() for x86_32 Improve __try_cmpxcgh64_user_asm() for !CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT by relaxing the output register constraint from "c" to "q" constraint, which allows the compiler to choose between %ecx or %ebx register. Signed-off-by: Uros Bizjak Signed-off-by: Borislav Petkov Reviewed-by: Sean Christopherson Link: https://lore.kernel.org/r/20220628161612.7993-1-ubizjak@gmail.com commit 3163600cab67ffd276a3bb97891404c59c8595a4 Author: Jason Wang Date: Fri Jul 15 12:48:09 2022 +0800 x86: Fix various duplicate-word comment typos [ mingo: Consolidated 4 very similar patches into one, it's silly to spread this out. ] Signed-off-by: Jason Wang Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220715044809.20572-1-wangborong@cdjrlc.com commit 039f0e054a29d06970892240d70143150d2aaec2 Author: Li kunyu Date: Mon Jul 25 12:23:58 2022 +0800 x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h 'const void *' will auto-type-convert to just about any other const pointer type, no need to force it. [ mingo: Rewrote the changelog. ] Signed-off-by: Li kunyu Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220725042358.3377-1-kunyu@nfschina.com commit d30b361310f808fbb5837edd598cb5aaa3fca737 Author: William Zhang Date: Wed Aug 3 10:54:55 2022 -0700 arm64: defconfig: remove BCM4908 Remove CONFIG_ARCH_BCM4908. It is supported under CONFIG_ARCH_BCMBCA. Signed-off-by: William Zhang Link: https://lore.kernel.org/r/20220803175455.47638-10-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit dd5c672d7ca92040ed77aaf9293a5134a5980af1 Author: William Zhang Date: Wed Aug 3 10:54:53 2022 -0700 arm64: bcmbca: Merge ARCH_BCM4908 to ARCH_BCMBCA Delete ARCH_BCM4908 platform Kconfig for BCM4908 SoC as it is replaced by ARCH_BCMBCA and move its selection to ARCH_BCMBCA. Signed-off-by: William Zhang Link: https://lore.kernel.org/r/20220803175455.47638-8-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 7bb49d774f481fdd7bd053e034e4d206770fda04 Author: William Zhang Date: Wed Aug 3 10:54:52 2022 -0700 arm64: bcmbca: Make BCM4908 drivers depend on ARCH_BCMBCA With Broadcom Broadband arch ARCH_BCMBCA supported in the kernel, this patch series migrate the ARCH_BCM4908 symbol to ARCH_BCMBCA. Hence replace ARCH_BCM4908 with ARCH_BCMBCA in subsystem Kconfig files. Signed-off-by: William Zhang Acked-by: Guenter Roeck (for watchdog) Acked-by: Bjorn Helgaas (for drivers/pci) Acked-by: Wolfram Sang (for i2c) Acked-by: Philipp Zabel (for reset) Link: https://lore.kernel.org/r/20220803175455.47638-7-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 72e0bdb6d7edb1785d58f2e8e7c80e1d2f93a319 Author: William Zhang Date: Wed Aug 3 10:54:51 2022 -0700 arm64: dts: Add BCM4908 generic board dts Add generic bare bone bcm94908.dts file to support any 4908 based design. It supports cpu subsystem, memory and an uart console. This can be useful for board bring-up and cpu subsystem and memory related kernel test as well. Signed-off-by: William Zhang Link: https://lore.kernel.org/r/20220803175455.47638-6-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit ded8f22945899f4e87dd6d952bbc4abce6e64b7e Author: William Zhang Date: Wed Aug 3 10:54:50 2022 -0700 arm64: dts: Move BCM4908 dts to bcmbca folder As part of ARCH_BCM4908 to ARCH_BCMBCA migration, move the BCM4908 dts files to bcmbca folder and use CONFIG_ARCH_BCMBCA to build all the BCM4908 board dts. Delete bcm4908 folder and its makefile as well. Signed-off-by: William Zhang Link: https://lore.kernel.org/r/20220803175455.47638-5-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 4fdcbde682291fba2c3f45a41decd656d92a314f Author: William Zhang Date: Wed Aug 3 10:54:49 2022 -0700 arm64: dts: bcmbca: update BCM4908 board dts files Append "brcm,bcmbca" to compatible strings based on the new bcmbca binding rule for BCM4908 family based boards. Signed-off-by: William Zhang Acked-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220803175455.47638-4-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 7284428cf70c61b4392473b0fda4756f35a043f7 Author: William Zhang Date: Wed Aug 3 10:54:48 2022 -0700 dt-bindings: arm64: bcmbca: Update BCM4908 description Append "brcm,bcmbca" to BCM4908 chip family compatible strings to follow the convention of BCMBCA chip and help identifying chip family. Also add a bare bone generic 4908 board compatbile string to support any 4908 based board. This is useful for board bring-up test and kernel test with CPU and memory related change. Signed-off-by: William Zhang Acked-by: Rafał Miłecki Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220803175455.47638-3-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 9bf2eb19c90193a38a3d1095ee90e38325cdbe4d Author: William Zhang Date: Wed Aug 3 10:54:47 2022 -0700 dt-bindings: arm64: bcmbca: Merge BCM4908 into BCMBCA BCM4908 is one of the Broadcom Broadband origin WLAN Router/Access Pointer SoCs. It was originally added by Rafał before Broadcom started to upstream the support for broadband SoCs. Now that Broadcom Broadband SoC is supported under arch ARCH_BCMBCA, this patch moves BCM4908 SoC device tree descriptions into BCMBCA binding. Signed-off-by: William Zhang Acked-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220803175455.47638-2-william.zhang@broadcom.com Signed-off-by: Florian Fainelli commit 751c3e19d0a354eebd5efad40003a22585ffd0bf Author: Guilherme G. Piccoli Date: Tue Jul 19 16:53:17 2022 -0300 soc: bcm: brcmstb: Document panic notifier action and remove useless header The panic notifier of this driver is very simple code-wise, just a memory write to a special position with some numeric code. But this is not clear from the semantic point-of-view, and there is no public documentation about that either. After discussing this in the mailing-lists [0] and having Florian explained it very well, document that in the code for the future generations asking the same questions. Also, while at it, remove a useless header. [0] https://lore.kernel.org/lkml/781cafb0-8d06-8b56-907a-5175c2da196a@gmail.com Cc: Brian Norris Cc: Doug Berger Cc: Justin Chen Cc: Lee Jones Cc: Markus Mayer Acked-by: Florian Fainelli Signed-off-by: Guilherme G. Piccoli Link: https://lore.kernel.org/r/20220719195325.402745-5-gpiccoli@igalia.com Signed-off-by: Florian Fainelli commit 61dc1e3850a6b88903f6f3912db35575ab78ab50 Author: Rafał Miłecki Date: Thu Jul 21 11:15:09 2022 +0200 ARM: dts: BCM5301X: Add basic PCI controller properties This fixes: arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@12000: 'device_type' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@12000: '#address-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@12000: '#size-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@13000: 'device_type' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@13000: '#address-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@13000: '#size-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@14000: 'device_type' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@14000: '#address-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dtb: pcie@14000: '#size-cells' is a required property From schema: /lib/python3.9/site-packages/dtschema/schemas/pci/pci-bus.yaml What remains missing is "ranges" property. I currently don't know its correct value for Northstar SoC. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220721091509.27725-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 3bcae3396e986b4ab97a69e8de517e32f9691a4b Author: Rafał Miłecki Date: Mon Jul 18 15:21:00 2022 +0200 arm64: dts: broadcom: bcm4908: add Asus GT-AC5300 LEDs There are 5 software-controllable LEDs on PCB. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220718132100.13277-3-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 7de56b1dc1149c702d4cc1e89ccc251bfb2bc246 Author: Rafał Miłecki Date: Mon Jul 18 15:20:59 2022 +0200 arm64: dts: broadcom: bcm4908: add LEDs controller block BCM4908 includes LEDs controller that supports multiple brightness levels & hardware blinking. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220718132100.13277-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 456b6dd1baadd2da10e28ffd1717b06d1fa17a97 Author: Rafał Miłecki Date: Mon Jul 18 15:20:58 2022 +0200 arm64: dts: broadcom: bcm4908: add remaining LED pins Include all 32 pins. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220718132100.13277-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit efe30e2cb6ff87467389cece8ce604f6601059f9 Author: Richard Fitzgerald Date: Mon Aug 15 12:33:46 2022 +0100 ASoC: soc-utils: Improve kerneldoc for snd_soc_tdm_params_to_bclk() The statement that snd_soc_tdm_params_to_bclk() is equivalent to snd_soc_params_to_bclk() if tdm_width==tdm_slots==0 is not accurate, it is only true is slot_multiple is also <2. However, the description of special-case behaviour in terms of pairs of tdm_width and tdm_slot values is not particularly helpful so we might as well take the opportunity to rework the description to say the same thing in a simpler way. The behaviour of a pair of values is obvious from a description of each argument. At the same time make a few edits to clarify the rest of the description. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220815113346.3805075-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 36b99942d4770e91d58e7578480db2be8e059c80 Merge: 79a8ccbd6fc22 047a05366f4bb Author: Mark Brown Date: Mon Aug 15 17:22:22 2022 +0100 DT binding for sample format conversion Merge series from Sameer Pujar : DT binding properties are available to fixup rate and channel parameters of a DAI. This series extends this to sample format conversion as well. With this now DAI PCM parameters (channels, sample rate and sample format) can be fixed up as necessary in an audio path. commit 79a8ccbd6fc220267934ce398147af14b633eca6 Merge: 088f115c6ff66 a111ae4d7f079 Author: Mark Brown Date: Mon Aug 15 17:22:21 2022 +0100 ASoC: Replace sprintf() with sysfs_emit() Merge series from Takashi Iwai : This is a patch set for rather simple conversions from the plain sprintf() & co to the new helpers, sysfs_emit() and sysfs_emit_at(). No functional changes are expected. commit 490211b0f480ce5eb112747af684ed73bae8225d Merge: d3fa0db15691b 6db8595a3e199 Author: Mark Brown Date: Mon Aug 15 16:43:49 2022 +0100 spi: npcm-pspi: add Arbel NPCM8XX support Merge series from Tomer Maimon : This patch set adds Arbel NPCM8XX Peripheral SPI (PSPI) support to PSPI NPCM driver. commit d3fa0db15691b4856f4255be25e8ae23cd0db39a Merge: 41f53a6544499 1f7d00a7565c8 Author: Mark Brown Date: Mon Aug 15 16:43:48 2022 +0100 Add support for Microchip QSPI controller Merge series from Naga Sureshkumar Relli : This patch enables the Microchip's FPGA QSPI and Polarfire SoC QSPI controller support. Tested spi-nand (W25N01GV) and spi-nor (MT25QL256A) on Microchip's ICICLE kit. tested using both FPGA QSPI and Polarfie SoC QSPI. commit 4961d0772578e8737afe61370743f3bc22867111 Author: Quentin Monnet Date: Fri Aug 12 16:37:27 2022 +0100 bpf: Clear up confusion in bpf_skb_adjust_room()'s documentation Adding or removing room space _below_ layers 2 or 3, as the description mentions, is ambiguous. This was written with a mental image of the packet with layer 2 at the top, layer 3 under it, and so on. But it has led users to believe that it was on lower layers (before the beginning of the L2 and L3 headers respectively). Let's make it more explicit, and specify between which layers the room space is adjusted. Reported-by: Rumen Telbizov Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220812153727.224500-3-quentin@isovalent.com commit 54c939773b2d2c2e6676743c180cb2049bb3a40a Author: Quentin Monnet Date: Fri Aug 12 16:37:25 2022 +0100 bpftool: Fix a typo in a comment This is the wrong library name: libcap, not libpcap. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220812153727.224500-1-quentin@isovalent.com commit 1e65d136d956e4d33bd0a5d48e3e32d7d951c156 Author: Krzysztof Kozlowski Date: Wed Jul 27 18:42:51 2022 +0200 dt-bindings: gpio: fairchild,74hc595: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit d82f5111d79ce9005912f14483ad6084e8c51025 Author: Shyam Sundar S K Date: Tue Aug 2 20:41:49 2022 +0530 MAINTAINERS: Add AMD PMF driver entry Update the MAINTAINERS file with AMD PMF driver details. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-12-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 9448ec9b0f90ce0479264d37106b9f5df232ea41 Author: Shyam Sundar S K Date: Tue Aug 2 20:41:48 2022 +0530 platform/x86/amd/pmf: Force load driver on older supported platforms Some of the older platforms with _HID "AMDI0100" PMF driver can be force loaded by interested users but only for experimental purposes. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-11-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 7d77dcc83adaffacbb9000924a212566170c1257 Author: Shyam Sundar S K Date: Tue Aug 2 20:41:47 2022 +0530 platform/x86/amd/pmf: Handle AMT and CQL events for Auto mode The transition to auto-mode happens when the PMF driver receives AMT (Auto Mode transition) event. transition logic will reside in the PMF driver but the events would come from other supported drivers[1]. The thermal parameters would vary between when a performance "on-lap" mode is detected and versus when not. The CQL event would get triggered from other drivers, so that PMF driver would adjust the system thermal config based on the ACPI inputs. OEMs can control whether or not to enable AMT or CQL via other supported drivers[1] but the actual transition logic resides in the AMD PMF driver. When an AMT event is received the automatic mode transition RAPL algorithm will run. When a CQL event is received an performance "on-lap" mode will be enabled and thermal parameters will be adjusted accordingly. [1] Link: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=review-hans&id=755b249250df1b612d982f3b702c831b26ecdf73 Cc: Mario Limonciello Cc: Mark Pearson Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-10-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3f5571d9952473c183762b801c61c42b9dbe1903 Author: Shyam Sundar S K Date: Tue Aug 2 20:41:46 2022 +0530 platform/x86/amd/pmf: Add support for Auto mode feature This feature has 3 modes quiet, balanced, performance The objective of this feature is to track the moving average of system power over the time period specified and switch to the subsequent mode. In order to do this, PMF driver will get the moving average of APU power from PMFW and power threshold, time constants, system config parameters from OEM inputs. System power as read by PMF driver from PMFW is the filtered value over the sampling window. Every sampling window, moving average of system power is computed. At the end of the monitoring window, the moving average is compared against the threshold for mode switch for decision making. With AMD managing the system config limits, any mode switch within auto-mode will result in limits of fPPT/sPPT/STAPM or STT being scaled down. When "auto mode" is enabled, the static slider control remains out of the PMF driver, so the platform_profile registration would not happen in PMF driver. The transition to auto-mode only happens when the APMF fn5 is enabled in BIOS, platform_profile set to "balanced" and a AMT (Auto Mode transition) is received. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-9-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 1a409b35c9956617f9e201120225f230f1695d6e Author: Shyam Sundar S K Date: Tue Aug 2 20:41:45 2022 +0530 platform/x86/amd/pmf: Get performance metrics from PMFW PMF driver polls for metrics information from PMFW to understand the system behavior, power consumption etc. This metrics table information will be used the PMF features to tweak the thermal heuristics. The poll duration can also be changed by the user by changing the poll duration time. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-8-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit a3281ec556071bda86964b6cf3ed42ec9f924cd8 Author: Shyam Sundar S K Date: Tue Aug 2 20:41:44 2022 +0530 platform/x86/amd/pmf: Add fan control support PMF has a generic interface defined via PMF ACPI fn9 for influencing fan policy during mode switch. PMF ACPI fn9 will normally be invoked when AMDPMF needs to change the fan table index for the EC. When AMDPMF is loaded this function will be invoked to change fan speed. OEM can also choose to report the actual fan table index and fan RPM to PMF through OEM structure. This information will be communicated by PMF driver to customer BIOS. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-7-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit b9ab888b4eccfd9b90835d6d95459aec7382564d Author: Shyam Sundar S K Date: Tue Aug 2 20:41:43 2022 +0530 platform/x86/amd/pmf: Add heartbeat signal support PMF driver can send periodic heartbeat signals to OEM BIOS. When BIOS does not receive the signal after a period of time, it can infer that AMDPMF has hung or failed to load. In this situation, BIOS can fallback to legacy operations. OEM can modify the time interval of the signal or completely disable signals through ACPI Method. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-6-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 4dc491c898fb47406423547da4d1e1ef8ff36b3e Author: Shyam Sundar S K Date: Tue Aug 2 20:41:42 2022 +0530 platform/x86/amd/pmf: Add debugfs information Add debugfs support to the PMF driver so that using this interface the live counters from the PMFW can be queried to see if the power parameters are getting set properly when a certain power mode change happens. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-5-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 4c71ae4144746eb467f6aaab0ff83e306f11d6af Author: Shyam Sundar S K Date: Tue Aug 2 20:41:41 2022 +0530 platform/x86/amd/pmf: Add support SPS PMF feature SPS (a.k.a. Static Power Slider) gives a feel of Windows performance power slider for the Linux users, where the user selects a certain mode (like "balanced", "low-power" or "performance") and the thermals associated with each selected mode gets applied from the silicon side via the mailboxes defined through PMFW. PMF driver hooks to platform_profile by reading the PMF ACPI fn9 to see if the support is being advertised by ACPI interface. If supported, the PMF driver reacts to platform_profile selection choices made by the user and adjust the system thermal behavior. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-4-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 5eb315ebf47b605cb9364da40a9363ad4065014b Author: Shyam Sundar S K Date: Tue Aug 2 20:41:40 2022 +0530 platform/x86/amd/pmf: Add support for PMF APCI layer PMF driver implements the ACPI methods as defined by AMD for PMF Support. The ACPI layer acts as a glue that helps in providing the infrastructure for OEMs customization. OEMs can refer to PMF support documentation to decide on the list of functions to be supported on their specific platform model. AMD mandates that PMF ACPI fn0 and fn1 to be implemented which provides the set of functions, params and the notifications that would be sent to PMF driver so that PMF driver can adapt and react. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-3-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit da5ce22df5fe5cbaf0e86d0357728b224c0b1b0e Author: Shyam Sundar S K Date: Tue Aug 2 20:41:39 2022 +0530 platform/x86/amd/pmf: Add support for PMF core layer PMF core layer is meant to abstract the common functionalities across PMF features. This layer also does the plumbing work like setting up the mailbox channel for the communication between the PMF driver and the PMFW (Power Management Firmware) running on the SMU. Reviewed-by: Hans de Goede Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220802151149.2123699-2-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 41f53a65444997f55c82c67f71a9cff05c1dee31 Author: Krzysztof Kozlowski Date: Wed Aug 10 16:13:11 2022 +0300 spi/panel: dt-bindings: drop 3-wire from common properties The spi-3wire property is device specific and should be accepted only if device really needs them. Drop it from common spi-peripheral-props.yaml schema, mention in few panel drivers which use it and include instead in the SPI controller bindings. The controller bindings will provide spi-3wire type validation and one place for description. Each device schema must list the property if it is applicable. The Samsung S6E63M0 panel uses also spi-cpha/cpol properties on at least one board (ste-ux500-samsung-janice/dts), so add also these to the panel's bindings. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220810131311.428645-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 0df874c6712d9aa8f43c50ec887a21f7b86fc917 Author: Christophe JAILLET Date: Fri Aug 5 23:39:19 2022 +0200 spi: lpspi: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Fixes: 12f62a857c83 ("spi: lpspi: Silence error message upon deferred probe") Signed-off-by: Christophe JAILLET Acked-By: Alexander Stein Link: https://lore.kernel.org/r/253543c462b765eca40ba54c66f4e3fdf4acdeb7.1659735546.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 7964e817d2311b37b86d6fbf588cd9fbe747b108 Author: Christophe JAILLET Date: Fri Aug 5 23:33:17 2022 +0200 spi: microchip-core: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Moreover, in the case of devm_clk_get() it would only display '0' because 'ret' is know to be 0 at this point. Fixes: cdeaf3a99a02 ("spi: microchip-core: switch to use dev_err_probe()") Signed-off-by: Christophe JAILLET Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/fb894ecec68e03fb7fc9353027c8b1a2610833d7.1659735153.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit dad57a510db9423a4128ae6565854e999cebac51 Author: Chanho Park Date: Mon Aug 8 09:48:51 2022 +0900 spi: s3c64xx: correct dma_chan pointer initialization Use NULL for dma channel pointer initialization instead of plain integer. sparse warnings: (new ones prefixed by >>) >> drivers/spi/spi-s3c64xx.c:387:34: sparse: sparse: Using plain integer as NULL pointer drivers/spi/spi-s3c64xx.c:388:34: sparse: sparse: Using plain integer as NULL pointer Reported-by: kernel test robot Fixes: 82295bc0d192 ("spi: s3c64xx: move dma_release_channel to unprepare") Fixes: f52b03c70744 ("spi: s3c64xx: requests spi-dma channel only during data transfer") Signed-off-by: Chanho Park Reviewed-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808004851.25122-1-chanho61.park@samsung.com Signed-off-by: Mark Brown commit fba933c2d975463d6a19898cbe30f7399de9f32e Author: Peng Fan Date: Fri Aug 12 15:34:51 2022 +0800 spi: lpspi: add dmas property The LPSPI has dma capability, so add dma property. Signed-off-by: Peng Fan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812073452.45763-1-peng.fan@oss.nxp.com Signed-off-by: Mark Brown commit d9c6a706f37c32480ab287aafcc781192996d584 Author: Peng Fan Date: Fri Aug 12 15:34:52 2022 +0800 spi: dt-bindings: lpspi: add i.MX93 compatible Add i.MX93 LPSPI compatible Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220812073452.45763-2-peng.fan@oss.nxp.com Signed-off-by: Mark Brown commit 9b6744f60b6b47bc0757a1955adb4d2c3ab22e13 Author: Matti Vaittinen Date: Fri Aug 12 13:09:03 2022 +0300 regulator: Add missing devm_* functions to devres.rst A few managed regulator functions were missing from the API list. Add missing functions. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/5efc0c90342b0a0ef3322b8fc1472b84cfc0eb45.1660292316.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown commit 63e2df2d9e46e7f9bbbe4a2b94426bfaedb32807 Author: Krzysztof Kozlowski Date: Wed Aug 10 16:12:36 2022 +0300 spi: dt-bindings: nvidia,tegra210-quad-peripheral-props: correct additional properties Re-usable schemas should use additionalProperties:true, so the schema using it will check for evaluated properties. Fixes: e23917822d3c ("spi: dt-bindings: split peripheral prods") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220810131236.428529-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 1f7d00a7565c8468bbfef87f9fbfebb047003942 Author: Naga Sureshkumar Relli Date: Mon Aug 8 12:16:03 2022 +0530 MAINTAINERS: add qspi to Polarfire SoC entry Add the qspi driver to existing Polarfire SoC entry. Signed-off-by: Naga Sureshkumar Relli Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20220808064603.1174906-5-nagasuresh.relli@microchip.com Signed-off-by: Mark Brown commit 8596124c4c1bc7561454cee0463c16eca70b5d25 Author: Naga Sureshkumar Relli Date: Mon Aug 8 12:16:02 2022 +0530 spi: microchip-core-qspi: Add support for microchip fpga qspi controllers Add a driver for Microchip FPGA QSPI controllers. This driver also supports "hard" QSPI controllers on Polarfire SoC. Signed-off-by: Naga Sureshkumar Relli Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220808064603.1174906-4-nagasuresh.relli@microchip.com Signed-off-by: Mark Brown commit 2ba464e5a3b5743e8f935b5a02b9a7c3d2bd9549 Author: Naga Sureshkumar Relli Date: Mon Aug 8 12:16:01 2022 +0530 spi: dt-binding: add coreqspi as a fallback for mpfs-qspi Microchip's PolarFire SoC QSPI IP core is based on coreQSPI, so add coreqspi as a fallback to mpfs-qspi. Signed-off-by: Naga Sureshkumar Relli Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808064603.1174906-3-nagasuresh.relli@microchip.com Signed-off-by: Mark Brown commit a5890c12ecce2696f90ef7d2b8fbb33387f735de Author: Naga Sureshkumar Relli Date: Mon Aug 8 12:16:00 2022 +0530 spi: dt-binding: document microchip coreQSPI Add microchip coreQSPI compatible string and update the title/description to reflect this addition. Signed-off-by: Naga Sureshkumar Relli Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220808064603.1174906-2-nagasuresh.relli@microchip.com Signed-off-by: Mark Brown commit 6db8595a3e1996654a130760d363912cdd28706d Author: Tomer Maimon Date: Fri Jul 22 14:41:36 2022 +0300 spi: npcm-pspi: Add NPCM845 peripheral SPI support Add Nuvoton BMC NPCM845 NPCM Peripheral SPI (PSPI) support. Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20220722114136.251415-3-tmaimon77@gmail.com Signed-off-by: Mark Brown commit ac2c55e2260e0ae019119e1b2a52dda138039841 Author: Tomer Maimon Date: Fri Jul 22 14:41:35 2022 +0300 dt-binding: spi: npcm-pspi: Add npcm845 compatible Add a compatible string for Nuvoton BMC NPCM845 PSPI. Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20220722114136.251415-2-tmaimon77@gmail.com Signed-off-by: Mark Brown commit efb0cb50c42734f868908a97f0d93e9208da1f0e Author: Douglas Anderson Date: Tue Jul 26 10:20:29 2022 -0700 regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load() Since we don't actually pass the load to the firmware, switch to using get_optimum_mode() instead of open-coding it. This is intended to have no effect other than cleanup. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20220726102024.1.Icc838fe7bf0ef54a014ab2fee8af311654f5342a@changeid Signed-off-by: Mark Brown commit e99ba96247764e2963bcabf2fe2d91b4455c6bc7 Author: Imre Deak Date: Tue Jul 26 16:43:13 2022 +0300 drm/i915/tc: Fix PHY ownership programming in HDMI legacy mode Make sure the TypeC PHY ownership flag is not getting reset during an HDMI modeset on the given port. Besides the WARN this triggered, it didn't cause other issues, since for TypeC legacy mode setting the PHY ownership flag is optional (there is no other user of the PHY besides display). Reported-and-tested-by: Shawn C Lee Signed-off-by: Imre Deak Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20220726134313.1484763-1-imre.deak@intel.com commit ba96b2e7974b9b5283b52dd5dc8bb3d15be7734c Author: Srinivas Neeli Date: Wed Aug 10 18:11:09 2022 +0530 dt-bindings: gpio: gpio-xilinx: Convert Xilinx axi gpio binding to YAML Convert Xilinx axi gpio binding documentation to YAML. Signed-off-by: Srinivas Neeli Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit ee56a283988d739c25d2d00ffb22707cb487ab47 Author: Kristen Carlson Accardi Date: Fri Aug 12 11:18:03 2022 -0700 x86/sgx: Improve comments for sgx_encl_lookup/alloc_backing() Modify the comments for sgx_encl_lookup_backing() and for sgx_encl_alloc_backing() to indicate that they take a reference which must be dropped with a call to sgx_encl_put_backing(). Make sgx_encl_lookup_backing() static for now, and change the name of sgx_encl_get_backing() to __sgx_encl_get_backing() to make it more clear that sgx_encl_get_backing() is an internal function. Signed-off-by: Kristen Carlson Accardi Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/all/YtUs3MKLzFg+rqEV@zn.tnic/ commit b60e31bf18a7064032dbcb73dcb5b58f8a00a110 Author: Sanjay R Mehta Date: Thu Aug 4 05:48:38 2022 -0500 thunderbolt: Add DP OUT resource when DP tunnel is discovered If the boot firmware implements a connection manager of its own it may create a DisplayPort tunnel and will be handed off to Linux connection manager, but the DP OUT resource is not saved in the dp_resource list. This patch adds tunnelled DP OUT port to the dp_resource list once the DP tunnel is discovered. Signed-off-by: Sanjay R Mehta Signed-off-by: Basavaraj Natikar Tested-by: Renjith Pananchikkal Signed-off-by: Mika Westerberg commit b2c9af5f47522ae9a6665e98d5ff657972a4db97 Author: Lad Prabhakar Date: Mon Jul 18 20:56:50 2022 +0100 arm64: dts: renesas: r9a07g054: Update pinctrl node to handle GPIO interrupts Add required properties in pinctrl node to handle GPIO interrupts. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220718195651.7711-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 379478ab09e0c25709e804b732ee7910d14a3972 Author: Lad Prabhakar Date: Mon Jul 18 20:56:49 2022 +0100 arm64: dts: renesas: r9a07g054: Add IRQC node Add IRQC node to R9A07G054 (RZ/V2L) SoC DTSI. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220718195651.7711-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 989fd5a7fb7927da37a004cce5336e3940a842e1 Author: Lad Prabhakar Date: Mon Jul 18 20:56:48 2022 +0100 arm64: dts: renesas: r9a07g044: Update pinctrl node to handle GPIO interrupts Add required properties in pinctrl node to handle GPIO interrupts. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220718195651.7711-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5edc51af5b304a91a957b862d150cd8a89c4aa97 Author: Lad Prabhakar Date: Mon Jul 18 20:56:47 2022 +0100 arm64: dts: renesas: r9a07g044: Add IRQC node Add IRQC node to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220718195651.7711-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d227fcc390e3e995fb8b0cd1d63f8be0ad2b47d3 Author: Wolfram Sang Date: Wed Jul 13 12:14:46 2022 +0200 arm64: dts: renesas: r8a779f0: Add CMT support This patch adds CMT{0|1|2|3} device nodes for R-Car S4-8 (r8a779f0) SoC. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220713101447.3804-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 1ada3e53b78afc03d30f5fd7e9d54f297d09cf61 Author: Wolfram Sang Date: Mon Jul 11 15:46:56 2022 +0200 arm64: dts: renesas: spider-cpu: Enable eMMC0 This enables the on-board eMMC on the Spider board. Switch SW3 has to be in the default (neutral) position. Other settings will not be supported upstream! Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220711134656.277730-4-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 6a24768c6e301a48c0610f0fac6f4461750ebf16 Author: Wolfram Sang Date: Mon Jul 11 15:46:55 2022 +0200 arm64: dts: renesas: r8a779f0: Add SDHI0 support Extracted from a larger BSP patch made by Linh Phung. Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220711134656.277730-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 32fb5425547bae46c0d61ec01de1422ffe6d4758 Author: Wolfram Sang Date: Wed Jul 13 12:14:45 2022 +0200 clk: renesas: r8a779f0: Add CMT clocks Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220713101447.3804-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 9b5dd1ff705c68549f7a2a91dd8beee14bc543e1 Author: Wolfram Sang Date: Mon Jul 11 15:46:54 2022 +0200 clk: renesas: r8a779f0: Add SDH0 clock Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220711134656.277730-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 36e599e179db51d61d2b30ea63bead7abfae8506 Author: Imre Deak Date: Mon Aug 8 13:30:54 2022 +0300 drm/i915/xelpd: Fix unclaimed accesses while loading PIPEDMC-C/D At the moment on DG2 at least loading the DMC firmware's PIPEDMC C and D programs leads to sporadic unclaimed register accesses while programming the initial state as described by the firmware's "MMIO init" table. This will also lead to later unclaimed accesses for unrelated transcoder/pipe registers backed by the pipe C and D display power wells. Disabling the PIPEDMC clock gating during initialization - similarly to Wa_16015201720 fixed this problem in my tests. While pipe A an B requires the clock gating to be disabled all the time pipe C and D requires this only while accessing the PIPEDMC registers. Bspec: 49193 References: https://gitlab.freedesktop.org/drm/intel/-/issues/6526 References: https://gitlab.freedesktop.org/drm/intel/-/issues/6308 Signed-off-by: Imre Deak Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20220808103054.3586074-1-imre.deak@intel.com commit 41a21e578da4986685f013d45454a12457f01180 Author: Lad Prabhakar Date: Mon Jul 18 20:28:24 2022 +0100 soc: renesas: Kconfig: Enable IRQC driver for RZ/G2L SoC Select RENESAS_RZG2L_IRQC config option if ARCH_RZG2L is enabled so that IRQC driver is enabled on RZ/G2L (and alike) SoC's. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220718192824.7246-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3b3510f1bd5c3112811b5b79cae3754fc91d31b0 Author: Maíra Canal Date: Fri Aug 12 17:57:46 2022 -0300 drm/vc4: Drop of_gpio header This driver includes the deprecated OF GPIO header yet fail to use symbols from it, so drop the include. Cc: Emma Anholt Cc: Maxime Ripard Signed-off-by: Maíra Canal Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220812205746.609107-6-mairacanal@riseup.net commit e167b2c3a0e631a51bbdf96f8e8550fe314cfbbd Author: Krzysztof Kozlowski Date: Wed Jul 27 18:43:47 2022 +0200 dt-bindings: fpga: microchip,mpf-spi-fpga-mgr: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Conor Dooley Acked-by: Ivan Bornyakov Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20220727164347.386398-1-krzysztof.kozlowski@linaro.org Signed-off-by: Xu Yilun commit 2a0805f55b8e70241709accdf3a7d59ad316306c Author: Conor Dooley Date: Thu Jul 28 08:50:13 2022 +0100 fpga: microchip-spi: add missing module author entry Add the missing MODULE_AUTHOR entry for the Microchip spi-slave FPGA programming driver. Signed-off-by: Conor Dooley Acked-by: Ivan Bornyakov Reviewed-by: Tom Rix Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20220728075012.3136914-1-conor.dooley@microchip.com Signed-off-by: Xu Yilun commit 65f5c01033ab85f8d385d65c4b51fe31459da603 Author: Matthew Gerlach Date: Tue Jul 19 07:56:44 2022 -0700 fpga: dfl-pci: Add IDs for Intel N6000, N6001 and C6100 cards Add pci_dev_table entries supporting the Intel N6000, N6001 and C6100 cards to the dfl-pci driver. Signed-off-by: Matthew Gerlach Signed-off-by: Tianfei Zhang Tested-by: Marco Pagani Reviewed-by: Tom Rix Acked-by: Wu Hao Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20220719145644.242481-1-matthew.gerlach@linux.intel.com Signed-off-by: Xu Yilun commit f74c7557ed0d321947e8bb4e9d47c1013f8b2227 Author: Patryk Duda Date: Tue Aug 2 17:41:28 2022 +0200 platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure Some EC based devices (e.g. Fingerpint MCU) can jump to RO part of the firmware (intentionally or due to device reboot). The RO part doesn't change during the device lifecycle, so it won't support newer version of EC_CMD_GET_NEXT_EVENT command. Function cros_ec_query_all() is responsible for finding maximum supported MKBP event version. It's usually called when the device is running RW part of the firmware, so the command version can be potentially higher than version supported by the RO. The problem was fixed by updating maximum supported version when the device returns EC_RES_INVALID_VERSION (mapped to -ENOPROTOOPT). That way the kernel will use highest common version supported by RO and RW. Fixes: 3300fdd630d4 ("platform/chrome: cros_ec: handle MKBP more events flag") Cc: # 5.10+ Reviewed-by: Guenter Roeck Signed-off-by: Patryk Duda Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220802154128.21175-1-pdk@semihalf.com commit 060004431df4958a326d6a45107b2fe3406d10f2 Author: Andy Shevchenko Date: Tue Jul 26 18:12:13 2022 +0300 regmap: Make use of get_unaligned_be24(), put_unaligned_be24() Since we have a proper endianness converters for BE 24-bit data use them. While at it, format the code using switch-cases as it's done for the rest of the endianness handlers. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220726151213.71712-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 7e7ba58c94127efa97c249e38cc2d1c0ed78b58f Author: Andy Shevchenko Date: Mon Aug 8 23:34:00 2022 +0300 regmap: mmio: Fix MMIO accessors to avoid talking to IO port Currently regmap MMIO is inconsistent with IO accessors. I.e. the Big Endian counterparts are using ioreadXXbe() / iowriteXXbe() which are not clean implementations of readXXbe(). That said, reimplement current Big Endian MMIO accessors by replacing ioread()/iowrite() with respective read()/write() and swab() calls. Note, there are no current in-kernel users that may utilize the functionality of the IO ports on Big Endian hardware. All drivers that use regmap MMIO either Little Endian, or they don't map IO ports in a way that ioreadXX()/iowriteXX() may be utilized. Signed-off-by: Andy Shevchenko Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220808203401.35153-5-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 93ce557679e1cf7742ad327d40a1499e7d8535b7 Author: Andy Shevchenko Date: Mon Aug 8 23:33:59 2022 +0300 regmap: mmio: Introduce IO accessors that can talk to IO port Some users may use regmap MMIO for IO ports, and this can be done by assigning ioreadXX()/iowriteXX() and their Big Endian counterparts to the regmap context. Add IO port support with a corresponding flag added. While doing that, make sure that user won't select relaxed MMIO access along with IO port because the latter have no relaxed variants. Signed-off-by: Andy Shevchenko Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220808203401.35153-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 159dfabd207628c983e0c3c5ef607f496ff5e6a5 Author: Andy Shevchenko Date: Mon Aug 8 23:33:58 2022 +0300 regmap: mmio: Get rid of broken 64-bit IO The current implementation, besides having no active users, is broken by design of regmap. For 64-bit IO we need to supply 64-bit value, otherwise there is no way to handle upper 32 bits in 64-bit register. Hence, remove the broken IO accessors for good and wait for real user that can fix entire regmap API for that. Signed-off-by: Andy Shevchenko Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220808203401.35153-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit ada79bca380009a85d1e643e5a4da0c079f28225 Author: Andy Shevchenko Date: Mon Aug 8 23:33:57 2022 +0300 regmap: mmio: Remove mmio_relaxed member from context There is no need to keep mmio_relaxed member in the context, it's onetime used during generation of the context. Remove it. Signed-off-by: Andy Shevchenko Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220808203401.35153-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 088f115c6ff664c8afe003bd542e1e662a72aaed Author: Shengjiu Wang Date: Wed Aug 3 11:02:28 2022 +0800 ASoC: imx-rpmsg: Support configure sysclk for codec dai Some codecs need to configure the sysclk even with slave mode, otherwise it may not work properly with some case. wm8960 is the one that need sysclk be configured, so add late_probe() to call the snd_soc_dai_set_sysclk() of codec Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1659495748-10876-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 7d67657cb472a80d54457362bc421f2b57ee250b Author: Christophe JAILLET Date: Sat Aug 6 07:45:48 2022 +0200 ASoC: sam9g20_wm8731: Simplify some error message dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Fixes: 29f4078f777f ("ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card()") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/fb959b3bda689aa47e1fbe9948de957b77530b24.1659764734.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 020adbfb2edae4dd90d7774d08936261e218c171 Author: Matt Flax Date: Mon Aug 15 08:22:18 2022 +1000 ASoC: codecs: dt bind. doc for the new TI SRC4392 codec Signed-off-by: Matt Flax Link: https://lore.kernel.org/r/20220814222218.119786-1-flatmax@flatmax.com Signed-off-by: Mark Brown commit 51eea3a6fb4d39c2cc71824e6eee5949d7ae4d1c Author: Dan Carpenter Date: Thu Aug 11 14:01:26 2022 +0300 ASoC: mt6359: fix tests for platform_get_irq() failure The platform_get_irq() returns negative error codes. It can't actually return zero, but if it did that should be treated as success. Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YvThhr86N3qQM2EO@kili Signed-off-by: Mark Brown commit 1ca726424a12962f2c2656cc9cdd0b8668117e8f Author: Stefan Binding Date: Mon Aug 1 10:40:34 2022 +0100 ASoC: Intel: cirrus-common: Use UID to map correct amp to prefix Since the order of the amps in the ACPI determines the device name, and the ACPI order may change depending on hardware configuration, use UID to dynamically compute the dai links, allowing dynamic assignment of the name_prefix. The UIDs for these amps in ACPI are fixed, and map to a name_prefix, where: UID 0x0 -> WL UID 0x1 -> WR UID 0x2 -> TL UID 0x3 -> TR Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220801094034.3927841-1-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown commit 1b5efeabf75a74043f1eb509ca3ac183b3ffaf89 Author: Xin Gao Date: Mon Aug 8 23:39:10 2022 +0800 ASoC: Variable type completion 'unsigned int' is better than 'unsigned'. Signed-off-by: Xin Gao Link: https://lore.kernel.org/r/20220808153910.59545-1-gaoxin@cdjrlc.com Signed-off-by: Mark Brown commit b9f0a8ffd6265e7d8c7464a7990330da85ee07ef Author: Dan Carpenter Date: Wed Aug 3 12:09:00 2022 +0300 ASoC: mediatek: mt8186: remove unnecessary NULL check The "i2s_priv" pointer cannot be NULL. Some NULL checks were deleted in commit d7bffbe9cbd3 ("ASoC: mediatek: mt8186: remove unnecessary judgments") but this one was accidentally left behind. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Yuo7LGPk8KnBW6ac@kili Signed-off-by: Mark Brown commit eab9100d9898cbd37882b04415b12156f8942f18 Author: Nathan Chancellor Date: Tue Aug 9 18:08:09 2022 -0700 ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion A recent change in clang strengthened its -Wbitfield-constant-conversion to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can only be 0 or -1, not 1: sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion] dev->gclk_enabled = 1; ^ ~ 1 error generated. The actual value of the field is never checked, just that it is not zero, so there is not a real bug here. However, it is simple enough to silence the warning by making the bitfield unsigned, which matches the mchp-spdifrx driver. Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") Link: https://github.com/ClangBuiltLinux/linux/issues/1686 Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org Signed-off-by: Mark Brown commit d563336877b21ede46053103c726f50a0206d155 Author: Shengjiu Wang Date: Tue Aug 2 20:29:54 2022 +0800 ASoC: dt-bindings: fsl,sai: Convert format to json-schema Convert the NXP SAI binding to DT schema format using json-schema. The Synchronous Audio Interface (SAI) provides an interface that supports full-duplex serial interfaces with frame synchronization formats such as I2S, AC97, TDM, and codec/DSP interfaces. Beside conversion, 'fsl,shared-interrupt' and '#sound-dai-cells' are added for they are already used by some dts. Signed-off-by: Shengjiu Wang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1659443394-9838-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 4e6bedd3c396014ba70de2b4c9995c8e024e82b3 Author: Matt Flax Date: Wed Aug 10 11:32:13 2022 +1000 ASoC: codecs: add support for the TI SRC4392 codec The src4xxx keyword is used for future capability to integrate other codecs similar to the src4392 to the same code base. Signed-off-by: Matt Flax Link: https://lore.kernel.org/r/20220810013213.1544645-1-flatmax@flatmax.com Signed-off-by: Mark Brown commit 98c17a01bc5965047890bd30c95966007234e6d1 Author: Christophe JAILLET Date: Sat Aug 6 21:33:22 2022 +0200 ASoC: tlv320adcx140: Fix a typo in a comment s/TLV320ADCX104/TLV320ADCX140/ Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/63efe8fe4e25a8ac386762d2d7cfe9bb9482333f.1659814389.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 047a05366f4bb2e32eabbd3c8990d1d91ab87c89 Author: Sameer Pujar Date: Mon Aug 8 10:57:32 2022 +0530 ASoC: simple-card-utils: Fixup DAI sample format Parse "convert-sample-format" DT binding and fixup the sample format as applicable. This is similar to the existing "convert-channels" and "convert-rate" properties for channels and rate fixup respectively. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto Link: https://lore.kernel.org/r/1659936452-2254-4-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit 955927873d82c5127e31e618703d804033a93e4f Author: Sameer Pujar Date: Mon Aug 8 10:57:31 2022 +0530 ASoC: dt-bindings: Add sample format conversion Presently "convert-channels" and "convert-rate" DT bindings are available for channel and rate fixups respectively. Similarly add "convert-sample-format" binding to fixup DAI sample format as well. This is added to audio-graph-card based bindings. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1659936452-2254-3-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit b79b6220a753995b80054916f1f8f037113d8d93 Author: Sameer Pujar Date: Mon Aug 8 10:57:30 2022 +0530 ASoC: dt-bindings: Definitions for DAI params The "convert-channels" and "convert-rate" bindings are available for audio-graph-card and are documented in the audio-graph-port.yaml and the audio-graph.yaml. There is duplication of property details at multiple places. Introduce a new schema to have common definitions for DAI params and these can be re-used in other schemas wherever applicable. Presently update audio-graph-card bindings to use these definitions. If required simple-card bindings can be extended to make use of common definitions. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1659936452-2254-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit a111ae4d7f0796cf2ea0e8bf3ab6c06a401e0560 Author: Takashi Iwai Date: Mon Aug 1 19:01:08 2022 +0200 ASoC: omap: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces the open code with new helpers, sysfs_emit() and sysfs_emit_at(), with the proper string offset. Signed-off-by: Takashi Iwai Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220801170108.26340-9-tiwai@suse.de Signed-off-by: Mark Brown commit 69f7cbfb08c7ee2ca565f532b0073b847db20bdc Author: Takashi Iwai Date: Mon Aug 1 19:01:07 2022 +0200 ASoC: DAPM: Replace sprintf() calls with sysfs_emit_at() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces the open-code with a new helper, sysfs_emit_at(), by passing the string offset. Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220801170108.26340-8-tiwai@suse.de Signed-off-by: Mark Brown commit 628d0f72d5828611cae353bd8b49d7647711c283 Author: Takashi Iwai Date: Mon Aug 1 19:01:06 2022 +0200 ASoC: core: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces the sprintf() usage straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220801170108.26340-7-tiwai@suse.de Signed-off-by: Mark Brown commit 11af2b1e33e8c9e72ddf14cd61f9494f34e06c40 Author: Takashi Iwai Date: Mon Aug 1 19:01:05 2022 +0200 ASoC: Intel: skylake: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces those usages straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220801170108.26340-6-tiwai@suse.de Signed-off-by: Mark Brown commit 7ae8d8ea9427b6fb1ed04b02faf31ad5e3a6de8b Author: Takashi Iwai Date: Mon Aug 1 19:01:04 2022 +0200 ASoC: Intel: catpt: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces those usages straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220801170108.26340-5-tiwai@suse.de Signed-off-by: Mark Brown commit 0aab7bda03086061abd5f8a7794324bb70f769a3 Author: Takashi Iwai Date: Mon Aug 1 19:01:03 2022 +0200 ASoC: Intel: sst: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces those usages straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220801170108.26340-4-tiwai@suse.de Signed-off-by: Mark Brown commit 1218d67d376156aa8dc9dbc39616867823f60783 Author: Takashi Iwai Date: Mon Aug 1 19:01:02 2022 +0200 ASoC: tlv320aic26: Replace sprintf() with sysfs_emit() For sysfs outputs, it's safer to use a new helper, sysfs_emit(), instead of the raw sprintf() & co. This patch replaces the sprintf() usage straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220801170108.26340-3-tiwai@suse.de Signed-off-by: Mark Brown commit 32d3679cbb383478c7e9dff590f367f1d7dda975 Author: Takashi Iwai Date: Mon Aug 1 19:01:01 2022 +0200 ASoC: cs43130: Replace scnprintf() with sysfs_emit() sysfs_emit() is a new helper to simplify the sysfs string output. Replace the open-code straightforwardly with this new helper. Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220801170108.26340-2-tiwai@suse.de Signed-off-by: Mark Brown commit 12229b7e50cfa95fda55b83a2617eafd6ac4c8c5 Author: Venkata Prasad Potturu Date: Wed Aug 10 18:59:13 2022 +0530 ASoC: amd: acp: Add TDM support for acp i2s stream Add callback and code changes to enable ACP I2S controller in TDM mode. Add new fields in acp_stream and acp_dev_data struct to configure tdm related registers for ACP i2s controllers. Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20220810132913.1181247-3-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit 7929985cfe36c336e3d0753e9f23ac4c7758ea7e Author: Ajit Kumar Pandey Date: Wed Aug 10 18:59:12 2022 +0530 ASoC: amd: acp: Initialize list to store acp_stream during pcm_open We are currently allocating acp_stream during pcm_open and saving it in static array corresponds to array index calculated based on cpu dai->driver id. This approach will fail if we have single dai linked to multiple pcm device as we will have same dai->driver id or array index for multiple pcm open. Initialize new linked list stream_list to store opened pcm stream info dynamically. Signed-off-by: Ajit Kumar Pandey Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220810132913.1181247-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit 456797da792fa7cbf6698febf275fe9b36691f78 Author: Conor Dooley Date: Fri Jul 15 18:51:55 2022 +0100 arm64: topology: move store_cpu_topology() to shared code arm64's method of defining a default cpu topology requires only minimal changes to apply to RISC-V also. The current arm64 implementation exits early in a uniprocessor configuration by reading MPIDR & claiming that uniprocessor can rely on the default values. This is appears to be a hangover from prior to '3102bc0e6ac7 ("arm64: topology: Stop using MPIDR for topology information")', because the current code just assigns default values for multiprocessor systems. With the MPIDR references removed, store_cpu_topolgy() can be moved to the common arch_topology code. Reviewed-by: Sudeep Holla Acked-by: Catalin Marinas Reviewed-by: Atish Patra Signed-off-by: Conor Dooley commit ac5d2f049c4b9b466f9757415007f65db949fe24 Merge: 568035b01cfb1 d511e8a7e850d Author: Mark Brown Date: Mon Aug 15 00:33:57 2022 +0100 Merge remote-tracking branch 'regulator/for-5.20' into regulator-6.0 commit 75c971dd6c4ed6d0218ce52bfa4572a6dded7695 Merge: 568035b01cfb1 2fd92c7b8fe2c Author: Mark Brown Date: Mon Aug 15 00:33:44 2022 +0100 Merge remote-tracking branch 'spi/for-5.20' into spi-6.0 commit e1a6bc7c6969527dbe0afa4801a0237e41e26b1b Author: Mateusz Jończyk Date: Sat Aug 13 15:10:34 2022 +0200 x86/rtc: Rename mach_set_rtc_mmss() to mach_set_cmos_time() Once upon a time, before this commit in 2013: 3195ef59cb42 ("x86: Do full rtc synchronization with ntp") ... the mach_set_rtc_mmss() function set only the minutes and seconds registers of the CMOS RTC - hence the '_mmss' postfix. This is no longer true, so rename the function to mach_set_cmos_time(). [ mingo: Expanded changelog a bit. ] Signed-off-by: Mateusz Jończyk Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220813131034.768527-2-mat.jonczyk@o2.pl commit fc04b2ccf0edc49e53d2e1251d122e40285233e6 Author: Mateusz Jończyk Date: Sat Aug 13 15:10:33 2022 +0200 x86/rtc: Rewrite & simplify mach_get_cmos_time() by deleting duplicated functionality There are functions in drivers/rtc/rtc-mc146818-lib.c that handle reading from / writing to the CMOS RTC clock. mach_get_cmos_time() in arch/x86/kernel/rtc.c did not use them and was mostly a duplicate of mc146818_get_time(). Modify mach_get_cmos_time() to use mc146818_get_time() and remove the duplicated functionality. mach_get_cmos_time() used a different algorithm than mc146818_get_time(), but these functions are equivalent. The major differences are: - mc146818_get_time() is better refined and handles various edge conditions, - when the UIP ("Update in progress") bit of the RTC is set, mach_get_cmos_time() was busy waiting with cpu_relax() while mc146818_get_time() is using mdelay(1) in every loop iteration. (However, there is my commit merged for Linux 5.20 / 6.0 to decrease this period to 100us: commit d2a632a8a117 ("rtc: mc146818-lib: reduce RTC_UIP polling period") ), - mach_get_cmos_time() assumed that the RTC year is >= 2000, which may not be true on some old boxes with a dead battery, - mach_get_cmos_time() was holding the rtc_lock for a long time and could hang if the RTC is broken or not present. The RTC writing counterpart, mach_set_rtc_mmss() is already using mc146818_get_time() from drivers/rtc. This was done in commit 3195ef59cb42 ("x86: Do full rtc synchronization with ntp") It appears that mach_get_cmos_time() was simply forgotten. mach_get_cmos_time() is really used only in read_persistent_clock64(), which is called only in a few places in kernel/time/timekeeping.c . [ mingo: These changes are not supposed to change behavior, but they are not identity transformations either, as mc146818_get_time() is a better but different implementation of the same logic - so regressions are possible in principle. ] Signed-off-by: Mateusz Jończyk Signed-off-by: Ingo Molnar Acked-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220813131034.768527-1-mat.jonczyk@o2.pl commit 09348d75a6ce60eec85c86dd0ab7babc4db3caf6 Author: Ingo Molnar Date: Thu Aug 11 08:54:52 2022 +0200 sched/all: Change all BUG_ON() instances in the scheduler to WARN_ON_ONCE() There's no good reason to crash a user's system with a BUG_ON(), chances are high that they'll never even see the crash message on Xorg, and it won't make it into the syslog either. By using a WARN_ON_ONCE() we at least give the user a chance to report any bugs triggered here - instead of getting silent hangs. None of these WARN_ON_ONCE()s are supposed to trigger, ever - so we ignore cases where a NULL check is done via a BUG_ON() and we let a NULL pointer through after a WARN_ON_ONCE(). There's one exception: WARN_ON_ONCE() arguments with side-effects, such as locking - in this case we use the return value of the WARN_ON_ONCE(), such as in: - BUG_ON(!lock_task_sighand(p, &flags)); + if (WARN_ON_ONCE(!lock_task_sighand(p, &flags))) + return; Suggested-by: Linus Torvalds Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/YvSsKcAXISmshtHo@gmail.com commit 93e719f661379c014f44bd83b361b1bc49ea7082 Author: Colin Ian King Date: Thu Aug 11 16:12:37 2022 -0700 Input: applespi - use correct struct names in comment The incorrect structure name is being used in the comment for struct touchpad_info_protocol. Correct it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220805174754.2374473-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit 6a33af349b1b977e8e2298ed131a46316bcb3e62 Author: Colin Ian King Date: Thu Aug 11 16:11:59 2022 -0700 Input: tc3589x-keypad - use correct struct names in comment The incorrect structure name is being used in the comment for struct tc3589x_keypad_platform_data. Correct it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220805174717.2374416-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit fb12ad5e3179c9667dfcbafe2c5da91f9e700e53 Author: Christophe JAILLET Date: Thu Aug 11 16:11:36 2022 -0700 Input: bma150 - fix a typo in some comments Remove some extra '0' s/BMA0150_RANGE_xxx/BMA150_RANGE_xxx/ s/BMA0150_BW_xxx/BMA150_BW_xxx Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/a331a6244a1dfbf34dc85f1be6995fa91500c801.1659802757.git.christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov commit 10b62d6a38f7c92e9f41983bb7d7669c9fa6e287 Author: Hangbin Liu Date: Thu Aug 11 11:40:20 2022 +0800 libbpf: Add names for auxiliary maps The bpftool self-created maps can appear in final map show output due to deferred removal in kernel. These maps don't have a name, which would make users confused about where it comes from. With a libbpf_ prefix name, users could know who created these maps. It also could make some tests (like test_offload.py, which skip base maps without names as a workaround) filter them out. Kernel adds bpf prog/map name support in the same merge commit fadad670a8ab ("Merge branch 'bpf-extend-info'"). So we can also use kernel_supports(NULL, FEAT_PROG_NAME) to check if kernel supports map name. As discussed [1], Let's make bpf_map_create accept non-null name string, and silently ignore the name if kernel doesn't support. [1] https://lore.kernel.org/bpf/CAEf4BzYL1TQwo1231s83pjTdFPk9XWWhfZC5=KzkU-VO0k=0Ug@mail.gmail.com/ Signed-off-by: Hangbin Liu Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220811034020.529685-1-liuhangbin@gmail.com commit 3bd86801c84f66b4abedde4078e5237937b7576b Author: Jouni Högander Date: Tue Jul 19 12:57:00 2022 +0300 drm/i915: Use luminance range calculated during edid parsing Instead of using fixed 0 - 512 range use luminance range calculated as a part of edid parsing. As a backup fall back to static 0 - 512. v3: Clean-ups suggested by Jani Nikula v2: Use values calculated during edid parsing Cc: Lyude Paul Cc: Mika Kahola Cc: Jani Nikula Cc: Manasi Navare Signed-off-by: Jouni Högander Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220719095700.14923-4-jouni.hogander@intel.com commit a61bb3422e8d6ec002dbe288356470540eb5662c Author: Jouni Högander Date: Tue Jul 19 12:56:59 2022 +0300 drm/amdgpu_dm: Rely on split out luminance calculation function Luminance range calculation was split out into drm_edid.c and is now part of edid parsing. Rely on values calculated during edid parsing and use these for caps->aux_max_input_signal and caps->aux_min_input_signal. v2: Use values calculated during edid parsing Cc: Roman Li Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Lyude Paul Cc: Mika Kahola Cc: Jani Nikula Cc: Manasi Navare Signed-off-by: Jouni Högander Acked-by: Alex Deucher Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220719095700.14923-3-jouni.hogander@intel.com commit 82068edeb5090b6f999457483623b39b6546ef74 Author: Jouni Högander Date: Tue Jul 19 12:56:58 2022 +0300 drm: New function to get luminance range based on static hdr metadata Split luminance min/max calculation using static hdr metadata from drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:update_connector_ext_caps into drm/drm_edid.c and use it during edid parsing. Calculated range is stored into connector->display_info->luminance_range. Add new data structure (drm_luminance_range_inf) to store luminance range calculated using data from EDID's static hdr metadata block. Add this new struct as a part of drm_display_info struct. v3: Squashed adding drm_luminance_range_info patch here v2: Calculate range during edid parsing Cc: Roman Li Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Lyude Paul Cc: Mika Kahola Cc: Jani Nikula Cc: Manasi Navare Signed-off-by: Jouni Högander Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220719095700.14923-2-jouni.hogander@intel.com commit e0686dc6f2252e009c455fe99e2ce9d62a60eb47 Author: Liang He Date: Mon Jul 11 21:15:50 2022 +0800 drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() The reference 'child' in the iteration of for_each_available_child_of_node() is only escaped out into a local variable which is only used to check its value. So we still need to the of_node_put() when breaking of the for_each_available_child_of_node() which will automatically increase and decrease the refcount. Fixes: ca454bd42dc2 ("drm/pl111: Support the Versatile Express") Signed-off-by: Liang He Reviewed-by: Rob Herring Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220711131550.361350-1-windhl@126.com commit 8759464d7b6309e23df95f12064a120422d6f780 Author: Lucas Stach Date: Wed Jul 6 15:28:12 2022 +0200 drm/bridge: tc358767: disable main link PHYs on main link disable Disable the main link PHYs and put them into reset when the main link is disabled. When the PHYs stay enabled while the rest of the DP link circuits are disabled there is some noise on the data lanes, which some displays try to lock onto, waking them up from their low power state. Signed-off-by: Lucas Stach Reviewed-by: Robert Foss Reviewed-by: Marek Vasut Tested-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220706132812.2171250-3-l.stach@pengutronix.de commit ea6490b02240bd7939a3a13bc8d3f25046c01585 Author: Lucas Stach Date: Wed Jul 6 15:28:11 2022 +0200 drm/bridge: tc358767: increase CLRSIPO count The current CLRSIPO count is marginal and does not work with high DSI clock rates. Increase it a bit to allow the DSI link to work at up to 1Gbps lane speed. Signed-off-by: Lucas Stach Reviewed-by: Marek Vasut Tested-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220706132812.2171250-2-l.stach@pengutronix.de commit 5fa9e16191204b6ead0c31e8f3b6ef92ddd8183e Author: Lucas Stach Date: Wed Jul 6 15:28:10 2022 +0200 drm/bridge: tc358767: don't fixup mode sync polarity There is no need to enforce a specific sync signal polarity on the DPI interface, as we can simply tell the TC358767 which polarities it should expect on the input interface. Signed-off-by: Lucas Stach Reviewed-by: Marco Felsch Reviewed-by: Marek Vasut Tested-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220706132812.2171250-1-l.stach@pengutronix.de commit 51c88597517d9625c127f0d8f8f3bf04ef5f8d76 Author: Mattijs Korpershoek Date: Tue Jul 26 14:56:10 2022 +0200 Input: mt6779-keypad - support double keys matrix MediaTek keypad has 2 modes of detecting key events: - single key: each (row, column) can detect one key - double key: each (row, column) is a group of 2 keys Double key support exists to minimize cost, since it reduces the number of pins required for physical keys. Double key is configured by setting BIT(0) of the KP_SEL register. Enable double key matrix support based on the mediatek,keys-per-group device tree property. Signed-off-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-5-6d42c357cb76@baylibre.com Signed-off-by: Dmitry Torokhov commit e76be36ad9e8560f6d1b02ad12dc912eaa19ddd1 Author: Mattijs Korpershoek Date: Tue Jul 26 14:56:09 2022 +0200 Input: mt6779-keypad - prepare double keys support with calc_row_col The MediaTek keypad can operate in two modes: single key or double key. The driver only supports single key mode. In double key mode, the row/column calculation based on the key is different. Add a calc_row_col function pointer which will be different based on single/double key mode. No functional change. Suggested-by: AngeloGioacchino Del Regno Signed-off-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-4-6d42c357cb76@baylibre.com Signed-off-by: Dmitry Torokhov commit 24f9cde381a7781f9f58191217989f7de98c5cd8 Author: Mattijs Korpershoek Date: Tue Jul 26 14:56:08 2022 +0200 dt-bindings: mediatek,mt6779-keypad: add mediatek,keys-per-group The MediaTek keypad has 2 modes of detecting key events: * single key: each (row, column) can detect one key * double key: each (row, column) is a group of 2 keys With double key, two keys are physically wired to one (row, column) pin. These keys are in the same "group". Multiple keys in the same group reduces the number of pins which minimizes cost. Add a keys-per-group property to describe this. Signed-off-by: Mattijs Korpershoek Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-3-6d42c357cb76@baylibre.com Signed-off-by: Dmitry Torokhov commit fe2281d630e0ae375d8d53f3ccff21f444ab64c8 Author: Mattijs Korpershoek Date: Tue Jul 26 14:56:07 2022 +0200 dt-bindings: mediatek,mt6779-keypad: use unevaluatedProperties writing-bindings.rst states: > - If schema includes other schema (e.g. /schemas/i2c/i2c-controller.yaml) use > "unevaluatedProperties:false". In other cases, usually use > "additionalProperties:false". All 3 properties from matrix-keymap.yaml are valid for the MediaTek keypad: * keypad,num-rows and keypad,num-cols configure the KP_SEL register * linux,keymap represents the (at most) 8x8 hardware matrix Signed-off-by: Mattijs Korpershoek Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-2-6d42c357cb76@baylibre.com Signed-off-by: Dmitry Torokhov commit 9900d9249f736bcd474f56e935db2c70977756ba Author: Mattijs Korpershoek Date: Tue Jul 26 14:56:06 2022 +0200 MAINTAINERS: input: add mattijs for mt6779-keypad As stated in [1]: Fengping has no longer interest and time to maintain this driver so he agreed to transfer maintainership over to me. Add a dedicated maintainer entry as well for the driver to make sure that I can help with patch reviews. [1] https://lore.kernel.org/r/20220421140255.2781505-1-mkorpershoek@baylibre.com Signed-off-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220720-mt8183-keypad-v2-1-6d42c357cb76@baylibre.com Signed-off-by: Dmitry Torokhov commit 73cf09a36bf7bfb3e5a3ff23755c36d49137c44d Author: Yafang Shao Date: Wed Aug 10 15:18:29 2022 +0000 bpf: Use bpf_map_area_alloc consistently on bpf map creation Let's use the generic helper bpf_map_area_alloc() instead of the open-coded kzalloc helpers in bpf maps creation path. Signed-off-by: Yafang Shao Link: https://lore.kernel.org/r/20220810151840.16394-5-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit 992c9e13f5939437037627c67bcb51e674b64265 Author: Yafang Shao Date: Wed Aug 10 15:18:28 2022 +0000 bpf: Make __GFP_NOWARN consistent in bpf map creation Some of the bpf maps are created with __GFP_NOWARN, i.e. arraymap, bloom_filter, bpf_local_storage, bpf_struct_ops, lpm_trie, queue_stack_maps, reuseport_array, stackmap and xskmap, while others are created without __GFP_NOWARN, i.e. cpumap, devmap, hashtab, local_storage, offload, ringbuf and sock_map. But there are not key differences between the creation of these maps. So let make this allocation flag consistent in all bpf maps creation. Then we can use a generic helper to alloc all bpf maps. Signed-off-by: Yafang Shao Link: https://lore.kernel.org/r/20220810151840.16394-4-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit 8f58ee54c2eae790f50c51dfa64a153601451f08 Author: Yafang Shao Date: Wed Aug 10 15:18:27 2022 +0000 bpf: Use bpf_map_area_free instread of kvfree bpf_map_area_alloc() should be paired with bpf_map_area_free(). Signed-off-by: Yafang Shao Link: https://lore.kernel.org/r/20220810151840.16394-3-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit 083818156d1e98f22b1ac612a3957bc553e7ba57 Author: Yafang Shao Date: Wed Aug 10 15:18:26 2022 +0000 bpf: Remove unneeded memset in queue_stack_map creation __GFP_ZERO will clear the memory, so we don't need to memset it. Signed-off-by: Yafang Shao Link: https://lore.kernel.org/r/20220810151840.16394-2-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit d7c5802faff6e7f50d18db40fdcb7e50590177f5 Author: Andrii Nakryiko Date: Wed Aug 10 11:34:25 2022 -0700 libbpf: preserve errno across pr_warn/pr_info/pr_debug As suggested in [0], make sure that libbpf_print saves and restored errno and as such guaranteed that no matter what actual print callback user installs, macros like pr_warn/pr_info/pr_debug are completely transparent as far as errno goes. While libbpf code is pretty careful about not clobbering important errno values accidentally with pr_warn(), it's a trivial change to make sure that pr_warn can be used anywhere without a risk of clobbering errno. No functional changes, just future proofing. [0] https://github.com/libbpf/libbpf/pull/536 Signed-off-by: Andrii Nakryiko Acked-by: Daniel Müller Link: https://lore.kernel.org/r/20220810183425.1998735-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 43caeec90da04de7d5f63c0d3fe37e5425da6b5d Merge: 3143d10b09459 e338945816754 Author: Alexei Starovoitov Date: Wed Aug 10 09:22:19 2022 -0700 Merge branch 'destructive bpf_kfuncs' Artem Savkov says: ==================== eBPF is often used for kernel debugging, and one of the widely used and powerful debugging techniques is post-mortem debugging with a full memory dump. Triggering a panic at exactly the right moment allows the user to get such a dump and thus a better view at the system's state. Right now the only way to do this in BPF is to signal userspace to trigger kexec/panic. This is suboptimal as going through userspace requires context changes and adds significant delays taking system further away from "the right moment". On a single-cpu system the situation is even worse because BPF program won't even be able to block the thread of interest. This patchset tries to solve this problem by allowing properly marked tracing bpf programs to call crash_kexec() kernel function. The only requirement for now to run programs calling crash_kexec() or other destructive kfuncs is CAP_SYS_BOOT capability. When signature checking for bpf programs is available it is possible that stricter rules will be applied to programs utilizing destructive kfuncs. Changes in v5: - documentation numbering fixed - no more warning on failed kfunc registration Changes in v4: - added description for KF_DESTRUCTIVE flag to documentation Changes in v3: - moved kfunc set registration to kernel/bpf/helpers.c Changes in v2: - BPF_PROG_LOAD flag dropped as it doesn't fully achieve it's aim of preventing accidental execution of destructive bpf programs - selftest moved to the end of patchset - switched to kfunc destructive flag instead of a separate set Changes from RFC: - sysctl knob dropped - using crash_kexec() instead of panic() - using kfuncs instead of adding a new helper ==================== Signed-off-by: Alexei Starovoitov commit e338945816754a1c362f606b8e2029f2c023e51c Author: Artem Savkov Date: Wed Aug 10 08:59:05 2022 +0200 selftests/bpf: add destructive kfunc test Add a test checking that programs calling destructive kfuncs can only do so if they have CAP_SYS_BOOT capabilities. Signed-off-by: Artem Savkov Link: https://lore.kernel.org/r/20220810065905.475418-4-asavkov@redhat.com Signed-off-by: Alexei Starovoitov commit 133790596406ce2658f0864eb7eac64987c2b12f Author: Artem Savkov Date: Wed Aug 10 08:59:04 2022 +0200 bpf: export crash_kexec() as destructive kfunc Allow properly marked bpf programs to call crash_kexec(). Signed-off-by: Artem Savkov Link: https://lore.kernel.org/r/20220810065905.475418-3-asavkov@redhat.com Signed-off-by: Alexei Starovoitov commit 4dd48c6f1f83290d4bc61b43e61d86f8bc6c310e Author: Artem Savkov Date: Wed Aug 10 08:59:03 2022 +0200 bpf: add destructive kfunc flag Add KF_DESTRUCTIVE flag for destructive functions. Functions with this flag set will require CAP_SYS_BOOT capabilities. Signed-off-by: Artem Savkov Link: https://lore.kernel.org/r/20220810065905.475418-2-asavkov@redhat.com Signed-off-by: Alexei Starovoitov commit 3143d10b094596f3e5d5964b2660375e586652a3 Author: Shibin Koikkara Reeny Date: Wed Aug 3 14:43:54 2022 +0000 selftests/xsk: Update poll test cases Poll test case was not testing all the functionality of the poll feature in the test suite. This patch updates the poll test case which contains 2 test cases to test the RX and the TX poll functionality and additional 2 more test cases to check the timeout feature of the poll event. Poll test suite has 4 test cases: 1. TEST_TYPE_RX_POLL: Check if RX path POLLIN function works as expect. TX path can use any method to send the traffic. 2. TEST_TYPE_TX_POLL: Check if TX path POLLOUT function works as expect. RX path can use any method to receive the traffic. 3. TEST_TYPE_POLL_RXQ_EMPTY: Call poll function with parameter POLLIN on empty RX queue will cause timeout. If timeout then test case passes. 4. TEST_TYPE_POLL_TXQ_FULL: When TX queue is filled and packets are not cleaned by the kernel then if we invoke the poll function with POLLOUT it should trigger timeout. Signed-off-by: Shibin Koikkara Reeny Signed-off-by: Daniel Borkmann Reviewed-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20220803144354.98122-1-shibin.koikkara.reeny@intel.com commit bcfa6be2ee21b8ff85fa8f51493c8e585e3ab265 Author: XueBing Chen Date: Fri Jul 1 19:26:07 2022 +0800 dma-buf/sync_file: use strscpy to replace strlcpy The strlcpy should not be used because it doesn't limit the source length. Preferred is strscpy. Signed-off-by: XueBing Chen Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/6aad3bff.d1a.181b982d1b1.Coremail.chenxuebing@jari.cn commit 1bba7323c79b169d855ecb4a1eba410f18a38674 Author: Piotr Piórkowski Date: Fri Aug 5 17:59:59 2022 +0200 drm/i915: Sanitycheck PCI BARs For proper operation of i915 we need usable PCI GTTMMADDR BAR 0 (1 for GEN2). In most cases we also need usable PCI GFXMEM BAR 2. Let's add functions to check if BARs are set, and that it have a size greater than 0. In case GTTMMADDR BAR, let's validate at the beginning of i915 initialization. For other BARs, let's validate before first use. Signed-off-by: Piotr Piórkowski Cc: Jani Nikula Cc: Lucas De Marchi Cc: Matt Roper Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220805155959.1983584-3-piotr.piorkowski@intel.com commit 6bba2b30d29cbba78ba0f935210108e74dbe7ab3 Author: Piotr Piórkowski Date: Fri Aug 5 17:59:58 2022 +0200 drm/i915: Use of BARs names instead of numbers At the moment, when we refer to some PCI BAR we use the number of this BAR in the code. The meaning of BARs between different platforms may be different. Therefore, in order to organize the code, let's start using defined names instead of numbers. v2: Add lost header in cfg_space.c Signed-off-by: Piotr Piórkowski Cc: Jani Nikula Cc: Lucas De Marchi Cc: Matt Roper Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220805155959.1983584-2-piotr.piorkowski@intel.com commit 7350b2a3fbc6956b2b2234f6d27d030c70b451bb Author: Takashi Iwai Date: Thu Aug 4 09:58:26 2022 +0200 drm/udl: Replace BUG_ON() with WARN_ON() BUG_ON() is a tasteless choice as a sanity check for a driver like UDL that isn't really a core code. Replace with WARN_ON() and proper error handling instead. Tested-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220804075826.27036-5-tiwai@suse.de commit e25d5954264d1871ab2792c7ca2298b811462500 Author: Takashi Iwai Date: Thu Aug 4 09:58:25 2022 +0200 drm/udl: Kill pending URBs at suspend and disconnect At both suspend and disconnect, we should rather cancel the pending URBs immediately. For the suspend case, the display will be turned off, so it makes no sense to process the rendering. And for the disconnect case, the device may be no longer accessible, hence we shouldn't do any submission. Tested-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220804075826.27036-4-tiwai@suse.de commit 0f7dc324b2e9e55db9323302f944fd952dbed967 Author: Takashi Iwai Date: Thu Aug 4 09:58:24 2022 +0200 drm/udl: Sync pending URBs at suspend / disconnect We need to wait for finishing to process the all URBs after disabling the pipe; otherwise pending URBs may stray at suspend/resume, leading to a possible memory corruption in a worst case. Tested-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220804075826.27036-3-tiwai@suse.de commit acd45c56790a3b558b0b0081678a20b0a0d89b0f Author: Takashi Iwai Date: Thu Aug 4 09:58:23 2022 +0200 drm/udl: Replace semaphore with a simple wait queue UDL driver uses a semaphore for controlling the emptiness of FIFO in a slightly funky way. This patch replaces it with a wait queue and controls the emptiness with the standard wait_event*() macro instead, which is a more straightforward implementation. While we are at it, drop the dead code for delayed semaphore down, too. Tested-by: Thomas Zimmermann Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220804075826.27036-2-tiwai@suse.de commit 1ed88a816d0037ea6fec1be18dfa9db8ee7196a7 Author: Jani Nikula Date: Thu Aug 4 12:58:35 2022 +0300 drm/i915/hdcp: replace BIT() with REG_BIT() in register definitions Registers contents are supposed to be defined using REG_BIT() to ensure they're u32 and the shift is within bounds. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/d28b9b9fef4f496bdaaad5503dd8e0027f167518.1659607033.git.jani.nikula@intel.com commit 9e6a82b9fcecb11b84d010108874f923c1e648f1 Author: Jani Nikula Date: Thu Aug 4 12:58:34 2022 +0300 drm/i915/hdcp: split out hdcp registers to a separate file Reduce the bloat of i915_reg.h. The registers are also only needed in a few places, no need to have them defined everywhere. Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/ce8334342e8bdf92c17c714aa13574e66cad93bb.1659607033.git.jani.nikula@intel.com commit 504a51d70f86e3b989ca8834691bbac4033b6f48 Author: Thomas Zimmermann Date: Mon Aug 8 14:54:06 2022 +0200 drm/format-helper: Rename parameter vmap to src Rename the parameter vmap to src in all functions. The parameter contains the locations of the source data and the new name says that. v3: * fix typo in commit message Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-15-tzimmermann@suse.de commit f241b064426943a1591c9e9121a175d5ed1edb42 Author: Thomas Zimmermann Date: Mon Aug 8 14:54:05 2022 +0200 drm/format-helper: Move destination-buffer handling into internal helper The format-convertion helpers handle several cases for different values of destination buffer and pitch. Move that code into the internal helper drm_fb_xfrm() and avoid quite a bit of duplication. v2: * remove a duplicated blank line (Jose) * use drm_format_info_bpp() (Sam) * fix vaddr_cached_hint bug (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-14-tzimmermann@suse.de commit b3aca563d69bcbb49343196b4265a8cb7db91bfa Author: Thomas Zimmermann Date: Mon Aug 8 14:54:04 2022 +0200 drm/format-helper: Rework XRGB8888-to-MONO conversion Update XRGB8888-to-MONO conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * rebase after renaming CMA helpers to DMA helpers * update documentation (Sam) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-13-tzimmermann@suse.de commit 7bef64490f9bb04731d3cf46bc8f7f46e55b2e0e Author: Thomas Zimmermann Date: Mon Aug 8 14:54:03 2022 +0200 drm/format-helper: Rework XRGB8888-to-GRAY8 conversion Update XRGB8888-to-GRAY8 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-12-tzimmermann@suse.de commit ce73f456744ca763ab6a9753104caf843d30fd8b Author: Thomas Zimmermann Date: Mon Aug 8 14:54:02 2022 +0200 drm/format-helper: Rework XRGB8888-to-XRGB2101010 conversion Update XRGB8888-to-XRGB2101010 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-11-tzimmermann@suse.de commit cfe637c4d6fcaffa655405e682f99a3d88e5fad0 Author: Thomas Zimmermann Date: Mon Aug 8 14:54:01 2022 +0200 drm/format-helper: Rework RGB888-to-XRGB8888 conversion Update RGB888-to-XRGB8888 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-10-tzimmermann@suse.de commit cb7fffbd26dd6eadfe6591c0e14fb43e1ba2f70e Author: Thomas Zimmermann Date: Mon Aug 8 14:54:00 2022 +0200 drm/format-helper: Rework RGB565-to-XRGB8888 conversion Update RGB565-to-XRGB8888 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-9-tzimmermann@suse.de commit c4863ce0f4aa17d88f4bf5fbd92ae9400f6e6d28 Author: Thomas Zimmermann Date: Mon Aug 8 14:53:59 2022 +0200 drm/format-helper: Rework XRGB8888-to-RGB888 conversion Update XRGB8888-to-RGB888 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-8-tzimmermann@suse.de commit ab298c29d414a5a94ed3039b0e97bc325bf45272 Author: Thomas Zimmermann Date: Mon Aug 8 14:53:58 2022 +0200 drm/format-helper: Rework XRGB8888-to-RGBG565 conversion Update XRGB8888-to-RGB565 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * update new Kunit tests * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-7-tzimmermann@suse.de commit e13140a06283141318319aaae7dfa348b06bdd6c Author: Thomas Zimmermann Date: Mon Aug 8 14:53:57 2022 +0200 drm/format-helper: Rework XRGB8888-to-RGBG332 conversion Update XRGB8888-to-RGB332 conversion to support struct iosys_map and convert all users. Although these are single-plane color formats, the new interface supports multi-plane formats for consistency with drm_fb_blit(). v2: * rebase onto refactored Kunit tests * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-6-tzimmermann@suse.de commit ce582859ca7b33e5c0d9432da9f7b54ced802100 Author: Thomas Zimmermann Date: Mon Aug 8 14:53:56 2022 +0200 drm/format-helper: Convert drm_fb_swab() to struct iosys_map Convert drm_fb_swab() to use struct iosys_map() and convert users. The new interface supports multi-plane color formats, but implementation only supports a single plane for now. v2: * use drm_format_info_bpp() (Sam) * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-5-tzimmermann@suse.de commit edbe262acf92c986ad9a1f594ae3b4f3d3373133 Author: Thomas Zimmermann Date: Mon Aug 8 14:53:55 2022 +0200 drm/format-helper: Merge drm_fb_memcpy() and drm_fb_memcpy_toio() Merge drm_fb_memcpy() and drm_fb_memcpy_toio() into a drm_fb_memcpy() that uses struct iosys_map for buffers. The new function also supports multi-plane color formats. Convert all users of the original helpers. v2: * rebase onto refactored mgag200 * use drm_formap_info_bpp() (Sam) * do static init in hyperv and mgag200 (Sam) * update documentation (Sam) * add TODO on vaddr location (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-4-tzimmermann@suse.de commit 71bf55872cbe035820a87b2aa5fc1dc60678abfa Author: Thomas Zimmermann Date: Mon Aug 8 14:53:54 2022 +0200 drm/format-helper: Provide drm_fb_blit() Provide drm_fb_blit() that works with struct iosys_map. Update all users of drm_fb_blit_toio(), which required a destination buffer in I/O memory. This patch only updates the function's interface. The implementation still relies on the destination buffer to be located in I/O memory. See the follow-up patches for implementational changes. The new function's interface works with multi-plane color formats, but again implementation only supports a single plane for now. v2: * rebase onto refactored simpledrm * use IOSYS_MAP_INIT_VADDR() (Sam) * update the commit message on the use of I/O memory (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-3-tzimmermann@suse.de commit 116d902fa9ff1f559b66bafad0f0cad90df95d21 Author: Thomas Zimmermann Date: Mon Aug 8 14:53:53 2022 +0200 iosys-map: Add IOSYS_MAP_INIT_VADDR_IOMEM() Add IOSYS_MAP_INIT_VADDR_IOMEM() for static init of variables of type struct iosys_map. Signed-off-by: Thomas Zimmermann Reviewed-by: Lucas De Marchi Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220808125406.20752-2-tzimmermann@suse.de commit 7dad3e39fde1eef97bc1a0b92e5d0f3500c9ed56 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:07 2022 +0800 wifi: rtw88: prohibit enter IPS during HW scan Mac80211 core may ask driver to change to idle mode during HW scan, then H2C command for HW scan will send failed since chip is in idle mode. Therefore, We check the SCANNING flag before entering IPS to prevent this behavior. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-8-pkshih@realtek.com commit 6bf3a083407b5d404d70efc3a5ac75b472e5efa9 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:06 2022 +0800 wifi: rtw88: add flag check before enter or leave IPS Enter or leave IPS controlled by mac80211 before driver support HW scan. After support HW scan, driver need to control IPS before start HW scan and scan complete, but mac80211 also ask driver enter or leave IPS. Therefore, we add flag check in IPS to prevent entering or leaving IPS twice. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-7-pkshih@realtek.com commit d08458b57a5025ca137807f1030ad93e3d7f05f0 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:05 2022 +0800 wifi: rtw88: add flushing queue before HW scan We need to flush queue before HW scan to avoid packets dropped by hardware. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-6-pkshih@realtek.com commit 68c5391443971c371daf98830172319477dd95e6 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:04 2022 +0800 wifi: rtw88: fix WARNING:rtw_get_tx_power_params() during HW scan During HW scan, the channel related feilds in hal struct changed partially. If setting Tx power will get WARNING:rtw_get_tx_power_params() due to some of fields in hal struct mismatch. Therefore, we fix to change all required fields in hal struct when channel switch during HW scan. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-5-pkshih@realtek.com commit 341dd1f7de4c2d91edf0fa4d34a14b4f98717bea Author: Chih-Kang Chang Date: Tue Aug 9 16:41:03 2022 +0800 wifi: rtw88: add the update channel flow to support setting by parameters In order to set channel info to hal during HW scan, we add the update channel flow to support setting by parameters to meet the HW scan requriement. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-4-pkshih@realtek.com commit 685b474b7d8aadf601f4627ccad00d59fabd4757 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:02 2022 +0800 wifi: rtw88: add mutex when set regulatory and get Tx power table Applying regulatory and getting Tx power table will access hal data, it should hold rtwdev::mutex to avoid hal data changed during setting flow. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-3-pkshih@realtek.com commit 9a72db41338564040b6469342cfddd46568c7380 Author: Chih-Kang Chang Date: Tue Aug 9 16:41:01 2022 +0800 wifi: rtw88: add mutex when set SAR Applying SAR will access hal data, it should hold rtwdev::mutex to avoid hal data changed during setting flow. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220809084107.38137-2-pkshih@realtek.com commit 2eee3db784a045289ebc62fc3bdbe0eb36b73a3d Author: Wataru Gohda Date: Fri Jul 22 13:56:30 2022 +0200 wifi: brcmfmac: Fix to add skb free for TIM update info when tx is completed The skb will be allocated to send TIM update info in brcmf_fws_tim_update. Currently the skb will be freed when tx is failed but it will not be freed when tx is completed successfully. The fix is to free the skb when tx is completed always. Signed-off-by: Wataru Gohda Signed-off-by: Chi-hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220722115632.620681-6-alvin@pqrs.dk commit 5606aeaad01e0b0ad09c021cfa44ee18fc4ae33b Author: Wataru Gohda Date: Fri Jul 22 13:56:29 2022 +0200 wifi: brcmfmac: Fix to add brcmf_clear_assoc_ies when rmmod Conn_info->req_ie/resp_ie is used to indicate the assoc_req_ies / assoc_resp_ies to cfg80211 layer when connection is done. The buffer is freed and allocated again at next connection establishment. The buffers also needs to be freed at the timing of rmmod as well. Signed-off-by: Wataru Gohda Signed-off-by: Chi-hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220722115632.620681-5-alvin@pqrs.dk commit aa666b68e73fc06d83c070d96180b9010cf5a960 Author: Wright Feng Date: Fri Jul 22 13:56:28 2022 +0200 wifi: brcmfmac: fix invalid address access when enabling SCAN log level The variable i is changed when setting random MAC address and causes invalid address access when printing the value of pi->reqs[i]->reqid. We replace reqs index with ri to fix the issue. [ 136.726473] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000 [ 136.737365] Mem abort info: [ 136.740172] ESR = 0x96000004 [ 136.743359] Exception class = DABT (current EL), IL = 32 bits [ 136.749294] SET = 0, FnV = 0 [ 136.752481] EA = 0, S1PTW = 0 [ 136.755635] Data abort info: [ 136.758514] ISV = 0, ISS = 0x00000004 [ 136.762487] CM = 0, WnR = 0 [ 136.765522] user pgtable: 4k pages, 48-bit VAs, pgdp = 000000005c4e2577 [ 136.772265] [0000000000000000] pgd=0000000000000000 [ 136.777160] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 136.782732] Modules linked in: brcmfmac(O) brcmutil(O) cfg80211(O) compat(O) [ 136.789788] Process wificond (pid: 3175, stack limit = 0x00000000053048fb) [ 136.796664] CPU: 3 PID: 3175 Comm: wificond Tainted: G O 4.19.42-00001-g531a5f5 #1 [ 136.805532] Hardware name: Freescale i.MX8MQ EVK (DT) [ 136.810584] pstate: 60400005 (nZCv daif +PAN -UAO) [ 136.815429] pc : brcmf_pno_config_sched_scans+0x6cc/0xa80 [brcmfmac] [ 136.821811] lr : brcmf_pno_config_sched_scans+0x67c/0xa80 [brcmfmac] [ 136.828162] sp : ffff00000e9a3880 [ 136.831475] x29: ffff00000e9a3890 x28: ffff800020543400 [ 136.836786] x27: ffff8000b1008880 x26: ffff0000012bf6a0 [ 136.842098] x25: ffff80002054345c x24: ffff800088d22400 [ 136.847409] x23: ffff0000012bf638 x22: ffff0000012bf6d8 [ 136.852721] x21: ffff8000aced8fc0 x20: ffff8000ac164400 [ 136.858032] x19: ffff00000e9a3946 x18: 0000000000000000 [ 136.863343] x17: 0000000000000000 x16: 0000000000000000 [ 136.868655] x15: ffff0000093f3b37 x14: 0000000000000050 [ 136.873966] x13: 0000000000003135 x12: 0000000000000000 [ 136.879277] x11: 0000000000000000 x10: ffff000009a61888 [ 136.884589] x9 : 000000000000000f x8 : 0000000000000008 [ 136.889900] x7 : 303a32303d726464 x6 : ffff00000a1f957d [ 136.895211] x5 : 0000000000000000 x4 : ffff00000e9a3942 [ 136.900523] x3 : 0000000000000000 x2 : ffff0000012cead8 [ 136.905834] x1 : ffff0000012bf6d8 x0 : 0000000000000000 [ 136.911146] Call trace: [ 136.913623] brcmf_pno_config_sched_scans+0x6cc/0xa80 [brcmfmac] [ 136.919658] brcmf_pno_start_sched_scan+0xa4/0x118 [brcmfmac] [ 136.925430] brcmf_cfg80211_sched_scan_start+0x80/0xe0 [brcmfmac] [ 136.931636] nl80211_start_sched_scan+0x140/0x308 [cfg80211] [ 136.937298] genl_rcv_msg+0x358/0x3f4 [ 136.940960] netlink_rcv_skb+0xb4/0x118 [ 136.944795] genl_rcv+0x34/0x48 [ 136.947935] netlink_unicast+0x264/0x300 [ 136.951856] netlink_sendmsg+0x2e4/0x33c [ 136.955781] __sys_sendto+0x120/0x19c Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220722115632.620681-4-alvin@pqrs.dk commit 09be7546a602ea2d0959fc13515765221da248f2 Author: Wright Feng Date: Fri Jul 22 13:56:27 2022 +0200 wifi: brcmfmac: fix scheduling while atomic issue when deleting flowring We should not sleep while holding the spin lock. It makes 'scheduling while atomic' in brcmf_msgbuf_delete_flowring. And to avoid race condition between deleting flowring and txflow, we only hold spin lock when seting flowring status to RING_CLOSING. Signed-off-by: Wright Feng Signed-off-by: Chi-Hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220722115632.620681-3-alvin@pqrs.dk commit 0fa24196e4257bcad0c5c82d93508536426db4a2 Author: Wright Feng Date: Fri Jul 22 13:56:26 2022 +0200 wifi: brcmfmac: fix continuous 802.1x tx pending timeout error The race condition in brcmf_msgbuf_txflow and brcmf_msgbuf_delete_flowring makes tx_msghdr writing after brcmf_msgbuf_remove_flowring. Host driver should delete flowring after txflow complete and all txstatus back, or pend_8021x_cnt will never be zero and cause every connection 950 milliseconds(MAX_WAIT_FOR_8021X_TX) delay. Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Ahmad Fatoum Signed-off-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220722115632.620681-2-alvin@pqrs.dk commit dc444be8bae45019396aedd53c745e685a4eb235 Author: Joanne Koong Date: Tue Aug 9 14:40:55 2022 -0700 selftests/bpf: add extra test for using dynptr data slice after release Add an additional test, "data_slice_use_after_release2", for ensuring that data slices are correctly invalidated by the verifier after the dynptr whose ref obj id they track is released. In particular, this tests data slice invalidation for dynptrs located at a non-zero offset from the frame pointer. Signed-off-by: Joanne Koong Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20220809214055.4050604-2-joannelkoong@gmail.com Signed-off-by: Alexei Starovoitov commit 883743422ced8c961ab05dc63ec81b75a4e56052 Author: Joanne Koong Date: Tue Aug 9 14:40:54 2022 -0700 bpf: Fix ref_obj_id for dynptr data slices in verifier When a data slice is obtained from a dynptr (through the bpf_dynptr_data API), the ref obj id of the dynptr must be found and then associated with the data slice. The ref obj id of the dynptr must be found *before* the caller saved regs are reset. Without this fix, the ref obj id tracking is not correct for dynptrs that are at an offset from the frame pointer. Please also note that the data slice's ref obj id must be assigned after the ret types are parsed, since RET_PTR_TO_ALLOC_MEM-type return regs get zero-marked. Fixes: 34d4ef5775f7 ("bpf: Add dynptr data slices") Signed-off-by: Joanne Koong Acked-by: David Vernet Link: https://lore.kernel.org/r/20220809214055.4050604-1-joannelkoong@gmail.com Signed-off-by: Alexei Starovoitov commit a7be0ab1eb1949f3564739784b4360e1233305f6 Author: Daniel Xu Date: Tue Aug 9 11:11:10 2022 -0600 selftests/bpf: Fix vmtest.sh getopts optstring Before, you could see the following errors: $ ./vmtest.sh -j ./vmtest.sh: option requires an argument -- j ./vmtest.sh: line 357: OPTARG: unbound variable $ ./vmtest.sh -z ./vmtest.sh: illegal option -- z ./vmtest.sh: line 357: OPTARG: unbound variable Fix by adding ':' as first character of optstring. Reason is that getopts requires ':' as the first character for OPTARG to be set in the `?` and `:` error cases. Note that the ':' as the first character of the optstring switches getopts to silent mode. The desire to run in this mode seems to have been there all along, as the script takes care of reporting errors. Signed-off-by: Daniel Xu Signed-off-by: Daniel Borkmann Acked-by: Daniel Müller Link: https://lore.kernel.org/bpf/0f93b56198328b6b4da7b4cf4662d05c3edb5fd2.1660064925.git.dxu@dxuuu.xyz commit d020b2360b350b9f91b1769f9c84fe2d22f643db Author: Daniel Xu Date: Tue Aug 9 11:11:09 2022 -0600 selftests/bpf: Fix vmtest.sh -h to not require root Set the exit trap only after argument parsing is done. This way argument parse failure or `-h` will not require sudo. Reasoning is that it's confusing that a help message would require root access. Signed-off-by: Daniel Xu Signed-off-by: Daniel Borkmann Acked-by: Daniel Müller Link: https://lore.kernel.org/bpf/6a802aa37758e5a7e6aa5de294634f5518005e2b.1660064925.git.dxu@dxuuu.xyz commit a00ed8430199abbc9d9bf43ea31795bfe98998ca Author: Yonghong Song Date: Sun Aug 7 10:51:16 2022 -0700 bpf: Always return corresponding btf_type in __get_type_size() Currently in funciton __get_type_size(), the corresponding btf_type is returned only in invalid cases. Let us always return btf_type regardless of valid or invalid cases. Such a new functionality will be used in subsequent patches. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220807175116.4179242-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 11b9148590146ff8a4e90c7f0186efe06009ec1b Merge: b2d8ef19c6e7e 64e15820b987c Author: Alexei Starovoitov Date: Tue Aug 9 09:47:14 2022 -0700 Merge branch 'Add BPF-helper for accessing CLOCK_TAI' Kurt Kanzenbach says: ==================== Hi, add a BPF-helper for accessing CLOCK_TAI. Use cases for such a BPF helper include functionalities such as Tx launch time (e.g. ETF and TAPRIO Qdiscs), timestamping and policing. Patch #1 - Introduce BPF helper Patch #2 - Add test case (skb based) Changes since v1: * Update changelog (Alexei Starovoitov) * Add test case (Alexei Starovoitov, Andrii Nakryiko) * Add missing function prototype (netdev ci) Previous versions: * v1: https://lore.kernel.org/r/20220606103734.92423-1-kurt@linutronix.de/ Jesper Dangaard Brouer (1): bpf: Add BPF-helper for accessing CLOCK_TAI ==================== Signed-off-by: Alexei Starovoitov commit 64e15820b987cc8e5864a8b907dfc17861e6ab5a Author: Kurt Kanzenbach Date: Tue Aug 9 08:08:03 2022 +0200 selftests/bpf: Add BPF-helper test for CLOCK_TAI access Add BPF-helper test case for CLOCK_TAI access. The added test verifies that: * Timestamps are generated * Timestamps are moving forward * Timestamps are reasonable Signed-off-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20220809060803.5773-3-kurt@linutronix.de Signed-off-by: Alexei Starovoitov commit c8996c98f703b09afe77a1d247dae691c9849dc1 Author: Jesper Dangaard Brouer Date: Tue Aug 9 08:08:02 2022 +0200 bpf: Add BPF-helper for accessing CLOCK_TAI Commit 3dc6ffae2da2 ("timekeeping: Introduce fast accessor to clock tai") introduced a fast and NMI-safe accessor for CLOCK_TAI. Especially in time sensitive networks (TSN), where all nodes are synchronized by Precision Time Protocol (PTP), it's helpful to have the possibility to generate timestamps based on CLOCK_TAI instead of CLOCK_MONOTONIC. With a BPF helper for TAI in place, it becomes very convenient to correlate activity across different machines in the network. Use cases for such a BPF helper include functionalities such as Tx launch time (e.g. ETF and TAPRIO Qdiscs) and timestamping. Note: CLOCK_TAI is nothing new per se, only the NMI-safe variant of it is. Signed-off-by: Jesper Dangaard Brouer [Kurt: Wrote changelog and renamed helper] Signed-off-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20220809060803.5773-2-kurt@linutronix.de Signed-off-by: Alexei Starovoitov commit b2d8ef19c6e7ed71ba5092feb0710063a751834f Author: Dave Marchevsky Date: Mon Aug 8 10:15:59 2022 -0700 bpf: Cleanup check_refcount_ok Discussion around a recently-submitted patch provided historical context for check_refcount_ok [0]. Specifically, the function and its helpers - may_be_acquire_function and arg_type_may_be_refcounted - predate the OBJ_RELEASE type flag and the addition of many more helpers with acquire/release semantics. The purpose of check_refcount_ok is to ensure: 1) Helper doesn't have multiple uses of return reg's ref_obj_id 2) Helper with release semantics only has one arg needing to be released, since that's tracked using meta->ref_obj_id With current verifier, it's safe to remove check_refcount_ok and its helpers. Since addition of OBJ_RELEASE type flag, case 2) has been handled by the arg_type_is_release check in check_func_arg. To ensure case 1) won't result in verifier silently prioritizing one use of ref_obj_id, this patch adds a helper_multiple_ref_obj_use check which fails loudly if a helper passes > 1 test for use of ref_obj_id. [0]: lore.kernel.org/bpf/20220713234529.4154673-1-davemarchevsky@fb.com Signed-off-by: Dave Marchevsky Acked-by: Martin KaFai Lau Acked-by: Joanne Koong Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220808171559.3251090-1-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit 6e116280b41b0cbfd90dfe9fa66e07ff348d50d5 Author: Kumar Kartikeya Dwivedi Date: Mon Jul 25 10:51:30 2022 +0200 net: netfilter: Remove ifdefs for code shared by BPF and ctnetlink The current ifdefry for code shared by the BPF and ctnetlink side looks ugly. As per Pablo's request, simplify this by unconditionally compiling in the code. This can be revisited when the shared code between the two grows further. Suggested-by: Pablo Neira Ayuso Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220725085130.11553-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit be3bb83dab2df838cd9e681e3e9dcde87bfe4f95 Author: Hao Luo Date: Fri Aug 5 14:48:16 2022 -0700 bpf, iter: Fix the condition on p when calling stop. In bpf_seq_read, seq->op->next() could return an ERR and jump to the label stop. However, the existing code in stop does not handle the case when p (returned from next()) is an ERR. Adds the handling of ERR of p by converting p into an error and jumping to done. Because all the current implementations do not have a case that returns ERR from next(), so this patch doesn't have behavior changes right now. Acked-by: Yonghong Song Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220805214821.1058337-4-haoluo@google.com Signed-off-by: Alexei Starovoitov commit f3a2aebdd6fb90e444d595e46de64e822af419da Author: Yosry Ahmed Date: Fri Aug 5 14:48:15 2022 -0700 cgroup: enable cgroup_get_from_file() on cgroup1 cgroup_get_from_file() currently fails with -EBADF if called on cgroup v1. However, the current implementation works on cgroup v1 as well, so the restriction is unnecessary. This enabled cgroup_get_from_fd() to work on cgroup v1, which would be the only thing stopping bpf cgroup_iter from supporting cgroup v1. Signed-off-by: Yosry Ahmed Acked-by: Tejun Heo Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220805214821.1058337-3-haoluo@google.com Signed-off-by: Alexei Starovoitov commit fa96b24204af42274ec13dfb2f2e6990d7510e55 Author: Benjamin Tissoires Date: Fri Aug 5 14:48:14 2022 -0700 btf: Add a new kfunc flag which allows to mark a function to be sleepable This allows to declare a kfunc as sleepable and prevents its use in a non sleepable program. Signed-off-by: Benjamin Tissoires Co-developed-by: Yosry Ahmed Signed-off-by: Yosry Ahmed Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220805214821.1058337-2-haoluo@google.com Signed-off-by: Alexei Starovoitov commit 8676145eb2f53a9940ff70910caf0125bd8a4bc2 Author: Matthew Auld Date: Fri Aug 5 14:22:40 2022 +0100 drm/i915/ttm: fix CCS handling Crucible + recent Mesa seems to sometimes hit: GEM_BUG_ON(num_ccs_blks > NUM_CCS_BLKS_PER_XFER) And it looks like we can also trigger this with gem_lmem_swapping, if we modify the test to use slightly larger object sizes. Looking closer it looks like we have the following issues in migrate_copy(): - We are using plain integer in various places, which we can easily overflow with a large object. - We pass the entire object size (when the src is lmem) into emit_pte() and then try to copy it, which doesn't work, since we only have a few fixed sized windows in which to map the pages and perform the copy. With an object > 8M we therefore aren't properly copying the pages. And then with an object > 64M we trigger the GEM_BUG_ON(num_ccs_blks > NUM_CCS_BLKS_PER_XFER). So it looks like our copy handling for any object > 8M (which is our CHUNK_SZ) is currently broken on DG2. Fixes: da0595ae91da ("drm/i915/migrate: Evict and restore the flatccs capable lmem obj") Testcase: igt@gem_lmem_swapping Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220805132240.442747-2-matthew.auld@intel.com commit dba4d442be8c4d41d3e1ee4f72a2cd8fa524b8cb Author: Matthew Auld Date: Fri Aug 5 14:22:39 2022 +0100 drm/i915/ttm: remove calc_ctrl_surf_instr_size We only ever need to emit one ccs block copy command. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220805132240.442747-1-matthew.auld@intel.com commit f020d9570a04df0762a2ac5c50cf1d8c511c9164 Author: Wen Gong Date: Mon Aug 1 10:19:30 2022 -0400 wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state() When peer delete failed in a disconnect operation, use-after-free detected by KFENCE in below log. It is because for each vdev_id and address, it has only one struct ath10k_peer, it is allocated in ath10k_peer_map_event(). When connected to an AP, it has more than one HTT_T2H_MSG_TYPE_PEER_MAP reported from firmware, then the array peer_map of struct ath10k will be set muti-elements to the same ath10k_peer in ath10k_peer_map_event(). When peer delete failed in ath10k_sta_state(), the ath10k_peer will be free for the 1st peer id in array peer_map of struct ath10k, and then use-after-free happened for the 2nd peer id because they map to the same ath10k_peer. And clean up all peers in array peer_map for the ath10k_peer, then user-after-free disappeared peer map event log: [ 306.911021] wlan0: authenticate with b0:2a:43:e6:75:0e [ 306.957187] ath10k_pci 0000:01:00.0: mac vdev 0 peer create b0:2a:43:e6:75:0e (new sta) sta 1 / 32 peer 1 / 33 [ 306.957395] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 306.957404] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 306.986924] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 166 peer unmap event log: [ 435.715691] wlan0: deauthenticating from b0:2a:43:e6:75:0e by local choice (Reason: 3=DEAUTH_LEAVING) [ 435.716802] ath10k_pci 0000:01:00.0: mac vdev 0 peer delete b0:2a:43:e6:75:0e sta ffff990e0e9c2b50 (sta gone) [ 435.717177] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 435.717186] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 435.717193] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 166 use-after-free log: [21705.888627] wlan0: deauthenticating from d0:76:8f:82:be:75 by local choice (Reason: 3=DEAUTH_LEAVING) [21713.799910] ath10k_pci 0000:01:00.0: failed to delete peer d0:76:8f:82:be:75 for vdev 0: -110 [21713.799925] ath10k_pci 0000:01:00.0: found sta peer d0:76:8f:82:be:75 (ptr 0000000000000000 id 102) entry on vdev 0 after it was supposedly removed [21713.799968] ================================================================== [21713.799991] BUG: KFENCE: use-after-free read in ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.799991] [21713.799997] Use-after-free read at 0x00000000abe1c75e (in kfence-#69): [21713.800010] ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.800041] drv_sta_state+0x115/0x677 [mac80211] [21713.800059] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800076] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800093] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800110] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800137] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800153] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800161] genl_rcv_msg+0x38e/0x3be [21713.800166] netlink_rcv_skb+0x89/0xf7 [21713.800171] genl_rcv+0x28/0x36 [21713.800176] netlink_unicast+0x179/0x24b [21713.800181] netlink_sendmsg+0x3a0/0x40e [21713.800187] sock_sendmsg+0x72/0x76 [21713.800192] ____sys_sendmsg+0x16d/0x1e3 [21713.800196] ___sys_sendmsg+0x95/0xd1 [21713.800200] __sys_sendmsg+0x85/0xbf [21713.800205] do_syscall_64+0x43/0x55 [21713.800210] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [21713.800213] [21713.800219] kfence-#69: 0x000000009149b0d5-0x000000004c0697fb, size=1064, cache=kmalloc-2k [21713.800219] [21713.800224] allocated by task 13 on cpu 0 at 21705.501373s: [21713.800241] ath10k_peer_map_event+0x7e/0x154 [ath10k_core] [21713.800254] ath10k_htt_t2h_msg_handler+0x586/0x1039 [ath10k_core] [21713.800265] ath10k_htt_htc_t2h_msg_handler+0x12/0x28 [ath10k_core] [21713.800277] ath10k_htc_rx_completion_handler+0x14c/0x1b5 [ath10k_core] [21713.800283] ath10k_pci_process_rx_cb+0x195/0x1df [ath10k_pci] [21713.800294] ath10k_ce_per_engine_service+0x55/0x74 [ath10k_core] [21713.800305] ath10k_ce_per_engine_service_any+0x76/0x84 [ath10k_core] [21713.800310] ath10k_pci_napi_poll+0x49/0x144 [ath10k_pci] [21713.800316] net_rx_action+0xdc/0x361 [21713.800320] __do_softirq+0x163/0x29a [21713.800325] asm_call_irq_on_stack+0x12/0x20 [21713.800331] do_softirq_own_stack+0x3c/0x48 [21713.800337] __irq_exit_rcu+0x9b/0x9d [21713.800342] common_interrupt+0xc9/0x14d [21713.800346] asm_common_interrupt+0x1e/0x40 [21713.800351] ksoftirqd_should_run+0x5/0x16 [21713.800357] smpboot_thread_fn+0x148/0x211 [21713.800362] kthread+0x150/0x15f [21713.800367] ret_from_fork+0x22/0x30 [21713.800370] [21713.800374] freed by task 708 on cpu 1 at 21713.799953s: [21713.800498] ath10k_sta_state+0x2c6/0xb8a [ath10k_core] [21713.800515] drv_sta_state+0x115/0x677 [mac80211] [21713.800532] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800548] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800565] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800581] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800598] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800614] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800619] genl_rcv_msg+0x38e/0x3be [21713.800623] netlink_rcv_skb+0x89/0xf7 [21713.800628] genl_rcv+0x28/0x36 [21713.800632] netlink_unicast+0x179/0x24b [21713.800637] netlink_sendmsg+0x3a0/0x40e [21713.800642] sock_sendmsg+0x72/0x76 [21713.800646] ____sys_sendmsg+0x16d/0x1e3 [21713.800651] ___sys_sendmsg+0x95/0xd1 [21713.800655] __sys_sendmsg+0x85/0xbf [21713.800659] do_syscall_64+0x43/0x55 [21713.800663] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1 Fixes: d0eeafad1189 ("ath10k: Clean up peer when sta goes away.") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220801141930.16794-1-quic_wgong@quicinc.com commit d81bbb684c250a637186d9286d75b1cb04d2986c Author: Youghandhar Chintala Date: Mon Aug 1 19:19:41 2022 +0530 wifi: ath10k: Set tx credit to one for WCN3990 snoc based devices Currently host can send two WMI commands at once. There is possibility to cause SMMU issues or corruption, if host wants to initiate 2 DMA transfers, it is possible when copy complete interrupt for first DMA reaches host, CE has already updated SRRI (Source ring read index) for both DMA transfers and is in the middle of 2nd DMA. Host uses SRRI (Source ring read index) to interpret how many DMA’s have been completed and tries to unmap/free both the DMA entries. Hence now it is limiting to one.Because CE is still in the middle of 2nd DMA which can cause these issues when handling two DMA transfers. This change will not impact other targets, as it is only for WCN3990. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1 Signed-off-by: Youghandhar Chintala Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220801134941.15216-1-quic_youghand@quicinc.com commit bafe9528b792f4a442aa1ea2b0297cd53a0351ab Author: Chia-Yuan Li Date: Tue Aug 2 20:38:16 2022 +0800 wifi: rtw89: 8852a: correct WDE IMR settings Correct IMR settings to let self error recover mechanism works accurately. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220802123816.16685-1-pkshih@realtek.com commit 674ece275a8ef3c024cf5b15e20fca5acb24ee42 Author: Zong-Zhe Yang Date: Tue Aug 2 20:37:12 2022 +0800 wifi: rtw89: refine leaving LPS function It's unnecessary to iterate leaving PS mode. So, move it out of the iteration. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220802123712.16577-1-pkshih@realtek.com commit 6b013c3d47be86b07afb2e16da43499fb5b0a262 Author: Sebin Sebastian Date: Tue Aug 2 10:22:39 2022 +0530 wifi: qtnfmac: remove braces around single statement blocks Remove braces around single statement blocks in order to improve readability. Also, an extra blank line was removed. Both warnings are reported by checkpatch.pl Signed-off-by: Sebin Sebastian Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220802045305.235684-1-mailmesebin00@gmail.com commit 93fbc1ebd978cf408ef5765e9c1630fce9a8621b Author: Ping-Ke Shih Date: Mon Aug 1 19:33:45 2022 +0800 wifi: rtlwifi: 8192de: correct checking of IQK reload Since IQK could spend time, we make a cache of IQK result matrix that looks like iqk_matrix[channel_idx].val[x][y], and we can reload the matrix if we have made a cache. To determine a cache is made, we check iqk_matrix[channel_idx].val[0][0]. The initial commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") make a mistake that checks incorrect iqk_matrix[channel_idx].val[0] that is always true, and this mistake is found by commit ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12"), so I recall the vendor driver to find fix and apply the correctness. Fixes: 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220801113345.42016-1-pkshih@realtek.com commit 0cf03f1b432dda23cfbbfb9a642deb29c8e13482 Author: Ruffalo Lavoisier Date: Mon Aug 1 07:58:50 2022 +0900 wifi: brcmsmac: remove duplicate words Remove repeated 'to' from 'to to' Signed-off-by: Ruffalo Lavoisier Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220731225850.106290-1-RuffaloLavoisier@gmail.com commit 15273b7b8b4f378613bf2cb45ce1b83f13e4afa1 Author: Krzysztof Kozlowski Date: Wed Jul 27 18:41:30 2022 +0200 dt-bindings: wireless: use spi-peripheral-props.yaml Instead of listing directly properties typical for SPI peripherals, reference the spi-peripheral-props.yaml schema. This allows using all properties typical for SPI-connected devices, even these which device bindings author did not tried yet. Remove the spi-* properties which now come via spi-peripheral-props.yaml schema, except for the cases when device schema adds some constraints like maximum frequency. While changing additionalProperties->unevaluatedProperties, put it in typical place, just before example DTS. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727164130.385411-2-krzysztof.kozlowski@linaro.org commit dcbf179cbc18f66976740d28fbcfab75be514d16 Author: Ping-Ke Shih Date: Wed Jul 27 14:52:32 2022 +0800 wifi: rtw88: access chip_info by const pointer Since chip_info has became const table, we must access them via const pointer to avoid invalid writing. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727065232.28510-1-pkshih@realtek.com commit 86331c7e0cd819bf0c1d0dcf895e0c90b0aa9a6f Author: Zong-Zhe Yang Date: Wed Jul 27 14:50:03 2022 +0800 wifi: rtw88: phy: fix warning of possible buffer overflow reported by smatch phy.c:854 rtw_phy_linear_2_db() error: buffer overflow 'db_invert_table[i]' 8 <= 8 (assuming for loop doesn't break) However, it seems to be a false alarm because we prevent it originally via if (linear >= db_invert_table[11][7]) return 96; /* maximum 96 dB */ Still, we adjust the code to be more readable and avoid smatch warning. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727065003.28340-5-pkshih@realtek.com commit 79ba1062c459a7afac8cc43649f7377052795c05 Author: Chih-Kang Chang Date: Wed Jul 27 14:50:02 2022 +0800 wifi: rtw88: fix store OP channel info timing when HW scan The original timing that store OP channel info is after associated. However, HW scan might happen before associated without backing to OP channel, that will cause authentication or association fail. Therefore, we modify the timing of storing OP channel info. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727065003.28340-4-pkshih@realtek.com commit 8edb22de9de771e6be142599d7dc898c082342fc Author: Chih-Kang Chang Date: Wed Jul 27 14:50:01 2022 +0800 wifi: rtw88: fix stopping queues in wrong timing when HW scan HW scan need to start queues after switch to OP channel, and stop queues before leaving op channel. However, in original code, driver will start queues after switch to OP channel, but stop queues until switch to OP channel next time, that will cause packets transmitted in wrong channel. So we fix the stop queues timing. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727065003.28340-3-pkshih@realtek.com commit d2eb7cb97c7df25df3e3e0f590b5bbf00c66d4c9 Author: Po-Hao Huang Date: Wed Jul 27 14:50:00 2022 +0800 wifi: rtw88: 8822c: extend supported probe request size Some WSC IEs require size larger than we current supports. Extend size to fit those demands. Separate the registered scan IE length by IC so settings can be independent. Since old firmware uses fewer page number, define a firmware feature to be compatible with various firmware version. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220727065003.28340-2-pkshih@realtek.com commit ca34ce29fc4b0e929cc6aada40829d17ab50fee4 Author: Dave Marchevsky Date: Mon Aug 8 09:47:23 2022 -0700 bpf: Improve docstring for BPF_F_USER_BUILD_ID flag Most tools which use bpf_get_stack or bpf_get_stackid symbolicate the stack - meaning the stack of addresses in the target process' address space is transformed into meaningful symbol names. The BPF_F_USER_BUILD_ID flag eases this process by finding the build_id of the file-backed vma which the address falls in and translating the address to an offset within the backing file. To be more specific, the offset is a "file offset" from the beginning of the backing file. The symbols in ET_DYN ELF objects have a st_value which is also described as an "offset" - but an offset in the process address space, relative to the base address of the object. It's necessary to translate between the "file offset" and "virtual address offset" during symbolication before they can be directly compared. Failure to do so can lead to confusing bugs, so this patch clarifies language in the documentation in an attempt to keep this from happening. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220808164723.3107500-1-davemarchevsky@fb.com commit 9e32084ef1c33a87a736d6ce3fcb95b60dac9aa1 Author: Hengqi Chen Date: Sat Aug 6 18:20:21 2022 +0800 libbpf: Do not require executable permission for shared libraries Currently, resolve_full_path() requires executable permission for both programs and shared libraries. This causes failures on distos like Debian since the shared libraries are not installed executable and Linux is not requiring shared libraries to have executable permissions. Let's remove executable permission check for shared libraries. Reported-by: Goro Fuji Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220806102021.3867130-1-hengqi.chen@gmail.com commit 3d037d99e61a1e7a3ae3d214146d88db349dd19f Author: Mauro Carvalho Chehab Date: Thu Aug 4 09:37:22 2022 +0200 drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb() WRITE_ONCE() should happen at the original var, not on a local copy of it. Cc: stable@vger.kernel.org Fixes: 5d36acb7198b ("drm/i915/gt: Batch TLB invalidations") Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Andi Shyti Signed-off-by: Rodrigo Vivi [added cc-stable while merging it] Link: https://patchwork.freedesktop.org/patch/msgid/f9550e6bacea10131ff40dd8981b69eb9251cdcd.1659598090.git.mchehab@kernel.org commit 0c9a7a7e2049859d7869e15dd8f70ca5aeae460e Author: Joanne Koong Date: Tue Aug 2 14:46:38 2022 -0700 bpf: Verifier cleanups This patch cleans up a few things in the verifier: * type_is_pkt_pointer(): Future work (skb + xdp dynptrs [0]) will be using the reg type PTR_TO_PACKET | PTR_MAYBE_NULL. type_is_pkt_pointer() should return true for any type whose base type is PTR_TO_PACKET, regardless of flags attached to it. * reg_type_may_be_refcounted_or_null(): Get the base type at the start of the function to avoid having to recompute it / improve readability * check_func_proto(): remove unnecessary 'meta' arg * check_helper_call(): Use switch casing on the base type of return value instead of nested ifs on the full type There are no functional behavior changes. [0] https://lore.kernel.org/bpf/20220726184706.954822-1-joannelkoong@gmail.com/ Signed-off-by: Joanne Koong Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220802214638.3643235-1-joannelkoong@gmail.com commit e19db6762c18ab1ddf7a3ef4d0023780c24dc1e8 Author: Andrii Nakryiko Date: Wed Aug 3 14:42:02 2022 -0700 libbpf: Reject legacy 'maps' ELF section Add explicit error message if BPF object file is still using legacy BPF map definitions in SEC("maps"). Before this change, if BPF object file is still using legacy map definition user will see a bit confusing: libbpf: elf: skipping unrecognized data section(4) maps libbpf: prog 'handler': bad map relo against 'server_map' in section 'maps' Now libbpf will be explicit about rejecting "maps" ELF section: libbpf: elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+ Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220803214202.23750-1-andrii@kernel.org commit 5653f55ebd767b4ef47414ee7f852517993eda6f Author: Joanne Koong Date: Fri Aug 5 10:14:05 2022 -0700 selftests/bpf: Clean up sys_nanosleep uses This patch cleans up a few things: * dynptr_fail.c: There is no sys_nanosleep tracepoint. dynptr_fail only tests that the prog load fails, so just SEC("?raw_tp") suffices here. * test_bpf_cookie: There is no sys_nanosleep kprobe. The prog is loaded in userspace through bpf_program__attach_kprobe_opts passing in SYS_NANOSLEEP_KPROBE_NAME, so just SEC("k{ret}probe") suffices here. * test_helper_restricted: There is no sys_nanosleep kprobe. test_helper_restricted only tests that the prog load fails, so just SEC("?kprobe")( suffices here. There are no functional changes. Suggested-by: Andrii Nakryiko Signed-off-by: Joanne Koong Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220805171405.2272103-1-joannelkoong@gmail.com commit 4aebcc9059d890bf2f438cfa169dad856123fc9c Author: Tomer Maimon Date: Mon Aug 8 10:54:52 2022 +0300 dt-binding: ipmi: add fallback to npcm845 compatible Add to npcm845 KCS compatible string a fallback to npcm750 KCS compatible string becuase NPCM845 and NPCM750 BMCs are using identical KCS modules. Fixes: 84261749e58a ("dt-bindings: ipmi: Add npcm845 compatible") Signed-off-by: Tomer Maimon Message-Id: <20220808075452.115907-1-tmaimon77@gmail.com> Acked-by: Krzysztof Kozlowski Signed-off-by: Corey Minyard commit 730c2bf4ad395acf0aa0820535fdb8ea6abe5df1 Author: Adrián Larumbe Date: Fri Jul 29 15:46:10 2022 +0100 drm/panfrost: Add support for devcoredump In the event of a job timeout, debug dump information will be written into /sys/class/devcoredump. Inspired by etnaviv's similar feature. Signed-off-by: Adrián Larumbe Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220729144610.2105223-3-adrian.larumbe@collabora.com commit 6a3aaa2bc03ea7ecb93741d2f55aa9064e95d528 Author: Adrián Larumbe Date: Fri Jul 29 15:46:09 2022 +0100 drm/panfrost: Add specific register offset macros for JS and MMU AS Each Panfrost job has its own job slot and MMU address space set of registers, which are selected with a job-specific index. Turn the shift and stride used for selection of the right register set base into a define rather than using magic numbers. Signed-off-by: Adrián Larumbe Reviewed-by: Alyssa Rosenzweig Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220729144610.2105223-2-adrian.larumbe@collabora.com commit ef8886f321c5dab8124b9153d25afa2a71d05323 Author: Zeng Jingxiang Date: Wed Jul 27 15:31:19 2022 +0800 gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init() A NULL check for bridge->encoder shows that it may be NULL, but it already been dereferenced on all paths leading to the check. 812 if (!bridge->encoder) { Dereference the pointer bridge->encoder. 810 drm_connector_attach_encoder(<9611->connector, bridge->encoder); Signed-off-by: Zeng Jingxiang Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220727073119.1578972-1-zengjx95@gmail.com commit 86af8230ce138e0423f43f6b104f3fa050aced6d Author: Borislav Petkov Date: Fri Aug 5 16:07:02 2022 +0200 x86/mm: Rename set_memory_present() to set_memory_p() Have it adhere to the naming convention for those helpers. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220805140702.31538-1-bp@alien8.de Signed-off-by: Ingo Molnar commit de40c281fe0b6babf3d1a25e034525a23e125d0c Author: Thomas Zimmermann Date: Mon Aug 1 15:50:28 2022 +0200 drm/simpledrm: Convert to atomic helpers Replace the simple-KMS helpers with the regular atomic helpers. The regular helpers are better architectured and therefore allow for easier code sharing among drivers. No functional changes. v3: * remove empty CRTC helpers atomic_{enable, disable} (Javier) * unconditionally run drm_atomic_helper_check_plane_state() Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-6-tzimmermann@suse.de commit fd9e3169e42b7b9e3a5c58ca2bc95a15f9de1d6c Author: Thomas Zimmermann Date: Mon Aug 1 15:50:27 2022 +0200 drm/simpledrm: Compute framebuffer stride if not set Compute the framebuffer's scanline stride length if not given by the simplefb data. v3: * get pixel size from drm_format_info_bpp() (Geert, Javier) Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-5-tzimmermann@suse.de commit 802fd5750faca181cade177642e0e5233ff25f85 Author: Thomas Zimmermann Date: Mon Aug 1 15:50:26 2022 +0200 drm/simpledrm: Remove pdev field from device structure Replace the remaining uses of the field pdev by upcasts from the Linux device and remove the field. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-4-tzimmermann@suse.de commit c25b69604fc4455228329c6c522a87974246e40f Author: Thomas Zimmermann Date: Mon Aug 1 15:50:25 2022 +0200 drm/simpledrm: Inline device-init helpers Inline the helpers for initializing the hardware FB, the memory management and the modesetting into the device-creation function. No functional changes. In the original code, init helpers depended on values from other init helpers. Inlining the functions ensures that steps are taken in the correct order. It's also easier to see what happens. The device is simple enough to be set up in one function. Only clocks and regulators are still set up in their own helpers, as their presence is system dependent. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-3-tzimmermann@suse.de commit 03d38605cee7762d020dc14cfdefa6cef77b5811 Author: Thomas Zimmermann Date: Mon Aug 1 15:50:24 2022 +0200 drm/simpledrm: Remove mem field from device structure Remove the unused mem field from struct simpledrm_device. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-2-tzimmermann@suse.de commit f9929f69de94212f98b3ad72a3e81c3bd3d333e0 Author: Nathan Chancellor Date: Mon Jul 25 16:36:29 2022 -0700 drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid() When booting a kernel compiled with clang's CFI protection (CONFIG_CFI_CLANG), there is a CFI failure in drm_simple_kms_crtc_mode_valid() when trying to call simpledrm_simple_display_pipe_mode_valid() through ->mode_valid(): [ 0.322802] CFI failure (target: simpledrm_simple_display_pipe_mode_valid+0x0/0x8): ... [ 0.324928] Call trace: [ 0.324969] __ubsan_handle_cfi_check_fail+0x58/0x60 [ 0.325053] __cfi_check_fail+0x3c/0x44 [ 0.325120] __cfi_slowpath_diag+0x178/0x200 [ 0.325192] drm_simple_kms_crtc_mode_valid+0x58/0x80 [ 0.325279] __drm_helper_update_and_validate+0x31c/0x464 ... The ->mode_valid() member in 'struct drm_simple_display_pipe_funcs' expects a return type of 'enum drm_mode_status', not 'int'. Correct it to fix the CFI failure. Cc: stable@vger.kernel.org Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1647 Reported-by: Tomasz Paweł Gajc Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Zimmermann Reviewed-by: Sami Tolvanen Link: https://patchwork.freedesktop.org/patch/msgid/20220725233629.223223-1-nathan@kernel.org (cherry picked from commit 0c09bc33aa8e9dc867300acaadc318c2f0d85a1e) Signed-off-by: Thomas Zimmermann commit d25f40ff68aa61c838947bb9adee6c6b36e77453 Author: James Hilliard Date: Wed Aug 3 09:14:03 2022 -0600 libbpf: Ensure functions with always_inline attribute are inline GCC expects the always_inline attribute to only be set on inline functions, as such we should make all functions with this attribute use the __always_inline macro which makes the function inline and sets the attribute. Fixes errors like: /home/buildroot/bpf-next/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h:439:1: error: ‘always_inline’ function might not be inlinable [-Werror=attributes] 439 | ____##name(unsigned long long *ctx, ##args) | ^~~~ Signed-off-by: James Hilliard Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220803151403.793024-1-james.hilliard1@gmail.com commit d55dfe587bc0670f90564a962615723fe7749ab1 Author: Manu Bretelle Date: Mon Aug 1 06:24:09 2022 -0700 bpftool: Remove BPF_OBJ_NAME_LEN restriction when looking up bpf program by name bpftool was limiting the length of names to BPF_OBJ_NAME_LEN in prog_parse fds. Since commit b662000aff84 ("bpftool: Adding support for BTF program names") we can get the full program name from BTF. This patch removes the restriction of name length when running `bpftool prog show name ${name}`. Test: Tested against some internal program names that were longer than `BPF_OBJ_NAME_LEN`, here a redacted example of what was ran to test. # previous behaviour $ sudo bpftool prog show name some_long_program_name Error: can't parse name # with the patch $ sudo ./bpftool prog show name some_long_program_name 123456789: tracing name some_long_program_name tag taghexa gpl .... ... ... ... # too long sudo ./bpftool prog show name $(python3 -c 'print("A"*128)') Error: can't parse name # not too long but no match $ sudo ./bpftool prog show name $(python3 -c 'print("A"*127)') Signed-off-by: Manu Bretelle Signed-off-by: Andrii Nakryiko Tested-by: Jiri Olsa Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220801132409.4147849-1-chantr4@gmail.com commit 3045f42a64324d339125a8a1a1763bb9e1e08300 Author: Florian Fainelli Date: Sun Jul 31 19:51:09 2022 -0700 libbpf: Initialize err in probe_map_create GCC-11 warns about the possibly unitialized err variable in probe_map_create: libbpf_probes.c: In function 'probe_map_create': libbpf_probes.c:361:38: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] 361 | return fd < 0 && err == exp_err ? 1 : 0; | ~~~~^~~~~~~~~~ Fixes: 878d8def0603 ("libbpf: Rework feature-probing APIs") Signed-off-by: Florian Fainelli Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220801025109.1206633-1-f.fainelli@gmail.com commit 47ea7417b0744324424405fc1207e266053237a9 Author: James Hilliard Date: Sun Jul 31 17:26:49 2022 -0600 libbpf: Skip empty sections in bpf_object__init_global_data_maps The GNU assembler generates an empty .bss section. This is a well established behavior in GAS that happens in all supported targets. The LLVM assembler doesn't generate an empty .bss section. bpftool chokes on the empty .bss section. Additionally in bpf_object__elf_collect the sec_desc->data is not initialized when a section is not recognized. In this case, this happens with .comment. So we must check that sec_desc->data is initialized before checking if the size is 0. Signed-off-by: James Hilliard Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220731232649.4668-1-james.hilliard1@gmail.com commit 01224faa36e86a2b9d423fe851c05feb288ae83d Author: Zack Rusin Date: Mon Apr 25 16:31:52 2022 -0400 drm: Remove the drm_get_unmapped_area() helper This has been only used by the vmwgfx driver and vmwgfx over the last year removed support for transparent hugepages on vram leaving drm_get_unmapped_area completely unused. There's no point in keeping unused code in core drm. Signed-off-by: Zack Rusin Reviewed-by: Thomas Hellström Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220425203152.1314211-2-zack@kde.org commit 7fbee3eb9ab82c4b8c240617a1b3878c6981dd73 Author: Zack Rusin Date: Mon Apr 25 16:31:51 2022 -0400 drm/vmwgfx: Remove unused hugepage support There's no point in explicitly trying to align virtual memory to facilitate huge page table entries or huge page memory in buffer objects given that they're not being used. Transparent hugepages support for vram allocations has been gradually retired over the last two years making alignment of unmapped areas unneeded and pointless. Signed-off-by: Zack Rusin Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220425203152.1314211-1-zack@kde.org commit 05436815fdb47539269387c10285c088a8ba33e7 Author: Tom Rix Date: Sat Jul 30 09:57:04 2022 -0400 drm/vmwgfx: cleanup comments Remove second 'should' Spelling replacements aqcuire -> acquire applcations -> applications assumings -> assumes begining -> beginning commited -> committed contol -> control inbetween -> in between resorces -> resources succesful -> successful successfule -> successful Signed-off-by: Tom Rix Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220730135704.2889434-1-trix@redhat.com commit ffb6260be81f5f4c97b34430072bf50380b42478 Author: Dan Carpenter Date: Tue Jul 19 12:47:22 2022 +0300 drm/vmwgfx: clean up some error pointer checking The vmw_user_bo_noref_lookup() function cannot return NULL. If it could, then this function would return PTR_ERR(NULL) which is success. Returning success without initializing "*vmw_bo_p = vmw_bo;" would lead to an uninitialized variable bug in the caller. Smatch complains about this: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1177 vmw_translate_mob_ptr() warn: passing zero to 'PTR_ERR' drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1314 vmw_cmd_dx_bind_query() error: uninitialized symbol 'vmw_bo'. Signed-off-by: Dan Carpenter Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/YtZ9qrKeBqmmK8Hv@kili commit fc30eea1542dd787c6aa46e970014e97e390c5b2 Merge: 8eb403671e388 5493ee1919eae Author: Rodrigo Vivi Date: Thu Aug 4 10:19:24 2022 -0400 Merge drm/drm-next into drm-intel-next Sync up. In special to get the drm-intel-gt-next stuff. Signed-off-by: Rodrigo Vivi commit 37c7c23a6420f56a66d70e30ed54ae8f77349f90 Author: Simon Ser Date: Wed Aug 3 20:42:47 2022 +0000 drm: fix whitespace in drm_plane_create_color_properties() The drm_property_create_enum() call for "COLOR_RANGE" contains a tab character in the middle of the argument list. Signed-off-by: Simon Ser Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220803204240.33409-1-contact@emersion.fr commit 81a71f51b89e84f39df2a3b1daf4274ae6b7b194 Author: Fei Li Date: Thu Aug 4 13:59:03 2022 +0800 x86/acrn: Set up timekeeping ACRN Hypervisor reports timing information via CPUID leaf 0x40000010. Get the TSC and CPU frequency via CPUID leaf 0x40000010 and set the kernel values accordingly. Signed-off-by: Fei Li Signed-off-by: Ingo Molnar Reviewed-by: Conghui Link: https://lore.kernel.org/r/20220804055903.365211-1-fei1.li@intel.com commit 9aeaf5bc4e30ec968ae660b865ed491a28daf500 Author: Andi Kleen Date: Tue Jul 19 13:05:48 2022 +0200 locking/spinlocks: Mark spinlocks noinline when inline spinlocks are disabled Otherwise LTO will inline them anyways and cause a large kernel text increase. Since the explicit intention here is to not inline them marking them noinline is good documentation even for the non-LTO case. Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220719110548.1544-1-jslaby@suse.cz commit 8648f92a66a323ed01903d2cbb248cdbe2f312d9 Author: Xin Gao Date: Tue Jul 19 19:10:44 2022 +0800 sched/core: Remove superfluous semicolon Signed-off-by: Xin Gao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220719111044.7095-1-gaoxin@cdjrlc.com commit 18c31c9711a90b48a77b78afb65012d9feec444c Author: Bing Huang Date: Sat Jul 23 05:36:09 2022 +0800 sched/fair: Make per-cpu cpumasks static The load_balance_mask and select_rq_mask percpu variables are only used in kernel/sched/fair.c. Make them static and move their allocation into init_sched_fair_class(). Replace kzalloc_node() with zalloc_cpumask_var_node() to get rid of the CONFIG_CPUMASK_OFFSTACK #ifdef and to align with per-cpu cpumask allocation for RT (local_cpu_mask in init_sched_rt_class()) and DL class (local_cpu_mask_dl in init_sched_dl_class()). [ mingo: Tidied up changelog & touched up the code. ] Signed-off-by: Bing Huang Signed-off-by: Ingo Molnar Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220722213609.3901-1-huangbing775@126.com commit d985ee9f449aafe45397ae1cf8887e9ac91d2f95 Author: Hao Jia Date: Wed Aug 3 21:02:23 2022 +0800 sched/fair: Remove unused parameter idle of _nohz_idle_balance() After commit 7a82e5f52a35 ("sched/fair: Merge for each idle cpu loop of ILB"), _nohz_idle_balance()'s 'idle' parameter is not used anymore, so we can remove it. Signed-off-by: Hao Jia Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220803130223.70419-1-jiahao.os@bytedance.com commit 1d8104e01c416bd93bc7648fa40a4aaf93371a91 Author: Danilo Krummrich Date: Tue Aug 2 02:04:05 2022 +0200 drm/todo: remove task to rename CMA helpers Both, GEM and FB, CMA helpers were renamed to "GEM DMA" and "FB DMA", hence the task can be removed. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-6-dakr@redhat.com commit 8c30eecc6769bee1e3acb485ad5f086a4d8a04b6 Author: Danilo Krummrich Date: Tue Aug 2 02:04:04 2022 +0200 drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} The field paddr of struct drm_gem_dma_object holds a DMA address, which might actually be a physical address. However, depending on the platform, it can also be a bus address or a virtual address managed by an IOMMU. Hence, rename the field to dma_addr, which is more applicable. In order to do this renaming the following coccinelle script was used: ``` @@ struct drm_gem_dma_object *gem; @@ - gem->paddr + gem->dma_addr @@ struct drm_gem_dma_object gem; @@ - gem.paddr + gem.dma_addr @exists@ typedef dma_addr_t; symbol paddr; @@ dma_addr_t paddr; <... - paddr + dma_addr ...> @@ symbol paddr; @@ dma_addr_t - paddr + dma_addr ; ``` This patch is compile-time tested with: ``` make ARCH={x86_64,arm,arm64} allyesconfig make ARCH={x86_64,arm,arm64} drivers/gpu/drm` ``` Acked-by: Sam Ravnborg Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-5-dakr@redhat.com commit 4a83c26a1d8702c516db77fc4423ae896ee904f1 Author: Danilo Krummrich Date: Tue Aug 2 02:04:03 2022 +0200 drm/gem: rename GEM CMA helpers to GEM DMA helpers Rename "GEM CMA" helpers to "GEM DMA" helpers - considering the hierarchy of APIs (mm/cma -> dma -> gem dma) calling them "GEM DMA" seems to be more applicable. Besides that, commit e57924d4ae80 ("drm/doc: Task to rename CMA helpers") requests to rename the CMA helpers and implies that people seem to be confused about the naming. In order to do this renaming the following script was used: ``` #!/bin/bash DIRS="drivers/gpu include/drm Documentation/gpu" REGEX_SYM_UPPER="[0-9A-Z_\-]" REGEX_SYM_LOWER="[0-9a-z_\-]" REGEX_GREP_UPPER="(${REGEX_SYM_UPPER}*)(GEM)_CMA_(${REGEX_SYM_UPPER}*)" REGEX_GREP_LOWER="(${REGEX_SYM_LOWER}*)(gem)_cma_(${REGEX_SYM_LOWER}*)" REGEX_SED_UPPER="s/${REGEX_GREP_UPPER}/\1\2_DMA_\3/g" REGEX_SED_LOWER="s/${REGEX_GREP_LOWER}/\1\2_dma_\3/g" # Find all upper case 'CMA' symbols and replace them with 'DMA'. for ff in $(grep -REHl "${REGEX_GREP_UPPER}" $DIRS) do sed -i -E "$REGEX_SED_UPPER" $ff done # Find all lower case 'cma' symbols and replace them with 'dma'. for ff in $(grep -REHl "${REGEX_GREP_LOWER}" $DIRS) do sed -i -E "$REGEX_SED_LOWER" $ff done # Replace all occurrences of 'CMA' / 'cma' in comments and # documentation files with 'DMA' / 'dma'. for ff in $(grep -RiHl " cma " $DIRS) do sed -i -E "s/ cma / dma /g" $ff sed -i -E "s/ CMA / DMA /g" $ff done # Rename all 'cma_obj's to 'dma_obj'. for ff in $(grep -RiHl "cma_obj" $DIRS) do sed -i -E "s/cma_obj/dma_obj/g" $ff done ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'cma' in comments and documentation which relate to "GEM CMA", but not "FB CMA". Also drivers/gpu/drm/Makefile was fixed up manually after renaming drm_gem_cma_helper.c to drm_gem_dma_helper.c. This patch is compile-time tested building a x86_64 kernel with `make allyesconfig && make drivers/gpu/drm`. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich Reviewed-by: Liviu Dudau #drivers/gpu/drm/arm Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-4-dakr@redhat.com commit 6bcfe8eaeef01fb389e951e7c648b934dfd62f15 Author: Danilo Krummrich Date: Tue Aug 2 02:04:02 2022 +0200 drm/fb: rename FB CMA helpers to FB DMA helpers Rename "FB CMA" helpers to "FB DMA" helpers - considering the hierarchy of APIs (mm/cma -> dma -> fb dma) calling them "FB DMA" seems to be more applicable. Besides that, commit e57924d4ae80 ("drm/doc: Task to rename CMA helpers") requests to rename the CMA helpers and implies that people seem to be confused about the naming. In order to do this renaming the following script was used: ``` #!/bin/bash DIRS="drivers/gpu include/drm Documentation/gpu" REGEX_SYM_UPPER="[0-9A-Z_\-]" REGEX_SYM_LOWER="[0-9a-z_\-]" REGEX_GREP_UPPER="(${REGEX_SYM_UPPER}*)(FB)_CMA_(${REGEX_SYM_UPPER}*)" REGEX_GREP_LOWER="(${REGEX_SYM_LOWER}*)(fb)_cma_(${REGEX_SYM_LOWER}*)" REGEX_SED_UPPER="s/${REGEX_GREP_UPPER}/\1\2_DMA_\3/g" REGEX_SED_LOWER="s/${REGEX_GREP_LOWER}/\1\2_dma_\3/g" # Find all upper case 'CMA' symbols and replace them with 'DMA'. for ff in $(grep -REHl "${REGEX_GREP_UPPER}" $DIRS) do sed -i -E "$REGEX_SED_UPPER" $ff done # Find all lower case 'cma' symbols and replace them with 'dma'. for ff in $(grep -REHl "${REGEX_GREP_LOWER}" $DIRS) do sed -i -E "$REGEX_SED_LOWER" $ff done # Replace all occurrences of 'CMA' / 'cma' in comments and # documentation files with 'DMA' / 'dma'. for ff in $(grep -RiHl " cma " $DIRS) do sed -i -E "s/ cma / dma /g" $ff sed -i -E "s/ CMA / DMA /g" $ff done ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'cma' in comments and documentation which relate to "FB CMA", but not "GEM CMA". This patch is compile-time tested building a x86_64 kernel with `make allyesconfig && make drivers/gpu/drm`. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich Reviewed-by: Liviu Dudau #drivers/gpu/drm/arm Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-3-dakr@redhat.com commit 5e8bf00ea915a0f290bf5ee544b91aad5eaab4bc Author: Danilo Krummrich Date: Tue Aug 2 02:04:01 2022 +0200 drm/fb: remove unused includes of drm_fb_cma_helper.h Quite a lot of drivers include the drm_fb_cma_helper.h header file without actually making use of it's provided API, hence remove those includes. Suggested-by: Sam Ravnborg Signed-off-by: Danilo Krummrich Reviewed-by: Laurent Pinchart Acked-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-2-dakr@redhat.com commit 7dd5c56531eb03696acdb17774721de5ef481c0b Author: Chris Wilson Date: Tue Jul 26 16:48:44 2022 +0200 drm/i915/gem: Remove shared locking on freeing objects The obj->base.resv may be shared across many objects, some of which may still be live and locked, preventing objects from being freed indefintely. We could individualise the lock during the free, or rely on a freed object having no contention and being able to immediately free the pages it owns. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6469 Fixes: be7612fd6665 ("drm/i915: Require object lock when freeing pages during destruction") Fixes: 6cb12fbda1c2 ("drm/i915: Use trylock instead of blocking lock for __i915_gem_free_objects.") Cc: # v5.17+ Signed-off-by: Chris Wilson Tested-by: Nirmoy Das Acked-by: Nirmoy Das Signed-off-by: Nirmoy Das Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220726144844.18429-1-nirmoy.das@intel.com commit d171011e6adad135eaced630dce26cac9a174037 Author: Slark Xiao Date: Mon Jul 25 09:59:03 2022 +0800 selftests: futex: Fix 'the the' typo in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220725015903.5449-1-slark_xiao@163.com commit 0f03d6805bfc454279169a1460abb3f6b3db317f Author: Zhen Lei Date: Wed Jul 27 14:08:19 2022 +0800 sched/debug: Print each field value left-aligned in sched_show_task() Currently, the values of some fields are printed right-aligned, causing the field value to be next to the next field name rather than next to its own field name. So print each field value left-aligned, to make it more readable. Before: stack: 0 pid: 307 ppid: 2 flags:0x00000008 After: stack:0 pid:308 ppid:2 flags:0x0000000a This also makes them print in the same style as the other two fields: task:demo0 state:R running task Signed-off-by: Zhen Lei Signed-off-by: Ingo Molnar Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20220727060819.1085-1-thunder.leizhen@huawei.com commit 938db76cf8c8d2bd7c56aca74bef68d443e76954 Author: Greg Kroah-Hartman Date: Tue Aug 2 10:16:14 2022 -0700 Input: elan_i2c - convert to use dev_groups There is no need for a driver to individually add/create device groups, the driver core will do it automatically for you. Convert the elan_i2c driver to use the dev_groups pointer instead of manually calling the driver core to create the group and have it be cleaned up later on by the devm core. Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220802162854.3015369-1-gregkh@linuxfoundation.org Signed-off-by: Dmitry Torokhov commit ae5a3d2c75a82c65564d32c42152ef7623ccf673 Author: Harish Chegondi Date: Mon Aug 1 14:38:39 2022 -0700 drm/i915/dg2: Add Wa_1509727124 Bspec: 46052 Reviewed-by: Matt Roper Signed-off-by: Harish Chegondi Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220801213839.8549-1-harish.chegondi@intel.com commit 8eb403671e3886adcd939223442d49ff3ba52846 Author: Anusha Srivatsa Date: Thu Jul 28 11:36:41 2022 -0700 drm/i915/dg2: Add support for DC5 state With the latest DMC in place, enabling DC5 on DG2. Cc: Imre Deak Signed-off-by: Anusha Srivatsa Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220728183641.55692-1-anusha.srivatsa@intel.com commit b3f53daacc74c0ca0922e14a8cb793cb2db4c6d1 Author: Dietmar Eggemann Date: Fri Jul 29 13:13:05 2022 +0200 sched/deadline: Use sched_dl_entity's dl_density in dl_task_fits_capacity() Save a multiplication in dl_task_fits_capacity() by using already maintained per-sched_dl_entity (i.e. per-task) `dl_runtime/dl_deadline` (dl_density). cap_scale(dl_deadline, cap) >= dl_runtime dl_deadline * cap >> SCHED_CAPACITY_SHIFT >= dl_runtime cap >= dl_runtime << SCHED_CAPACITY_SHIFT / dl_deadline cap >= (dl_runtime << BW_SHIFT / dl_deadline) >> BW_SHIFT - SCHED_CAPACITY_SHIFT cap >= dl_density >> BW_SHIFT - SCHED_CAPACITY_SHIFT __sched_setscheduler()->__checkparam_dl() ensures that the 2 corner cases (if conditions) `runtime == RUNTIME_INF (-1)` and `period == 0` of to_ratio(deadline, runtime) are not met when setting dl_density in __sched_setscheduler()-> __setscheduler_params()->__setparam_dl(). Signed-off-by: Dietmar Eggemann Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220729111305.1275158-4-dietmar.eggemann@arm.com commit 6092478bcbf4021d3c52144bd456378de043fe58 Author: Dietmar Eggemann Date: Fri Jul 29 13:13:04 2022 +0200 sched/deadline: Make dl_cpuset_cpumask_can_shrink() capacity-aware dl_cpuset_cpumask_can_shrink() is used to validate whether there is still enough CPU capacity for DL tasks in the reduced cpuset. Currently it still operates on `# remaining CPUs in the cpuset` (1). Change this to use the already capacity-aware DL admission control __dl_overflow() for the `cpumask can shrink` test. dl_b->bw = sched_rt_period << BW_SHIFT / sched_rt_period dl_b->bw * (1) >= currently allocated bandwidth in root_domain (rd) Replace (1) w/ `\Sum CPU capacity in rd >> SCHED_CAPACITY_SHIFT` Adapt __dl_bw_capacity() to take a cpumask instead of a CPU number argument so that `rd->span` and `cpumask of the reduced cpuset` can be used here. Signed-off-by: Dietmar Eggemann Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220729111305.1275158-3-dietmar.eggemann@arm.com commit 740cf8a760b73e8375bfb4bedcbe9746183350f9 Author: Dietmar Eggemann Date: Fri Jul 29 13:13:03 2022 +0200 sched/core: Introduce sched_asym_cpucap_active() Create an inline helper for conditional code to be only executed on asymmetric CPU capacity systems. This makes these (currently ~10 and future) conditions a lot more readable. Signed-off-by: Dietmar Eggemann Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220729111305.1275158-2-dietmar.eggemann@arm.com commit 2775e2016179331f1b8dcc24bb63e898d64d49e3 Author: John Harrison Date: Thu Jul 28 16:07:22 2022 -0700 drm/i915/dg2: Update DG2 to GuC v70.4.1 New release of GuC with a bunch of fixes specific to DG2. Some of these require follow up i915 changes to enable. Note also that it is not necessary to maintain backwards compatibility with 70.1.2 for DG2 because DG2 is still under force probe protection. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220728230722.2749701-2-John.C.Harrison@Intel.com commit 6c82c75230b87d986283189a58e8cb18ea0c519c Author: Daniele Ceraolo Spurio Date: Wed Jul 27 17:33:39 2022 -0700 drm/i915/guc: Don't send policy update for child contexts. The GuC FW applies the parent context policy to all the children, so individual updates to the children are not supported and we should not send them. Note that sending the message did not have any functional consequences, because the GuC just drops it and logs an error; since we were trying to set the child policy to match the parent anyway the message being dropped was not a problem. Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220728003339.2361010-1-daniele.ceraolospurio@intel.com commit 9cf26c8968b358bb14cc078f8153300a493613d4 Merge: d4a3e50ffd908 2bc7ea71a7374 Author: Thomas Zimmermann Date: Mon Aug 1 15:54:52 2022 +0200 Merge drm/drm-next into drm-misc-next Backmerging to pick up fixes from amdgpu. Signed-off-by: Thomas Zimmermann commit dd9d3cbe9efcdb2a0d88c80d0e492ccae54a5b63 Author: John Harrison Date: Wed Jul 27 19:42:25 2022 -0700 drm/i915/guc: Don't abort on CTB_UNUSED status When the KMD sends a CLIENT_RESET request to GuC (as part of the suspend sequence), GuC will mark the CTB buffer as 'UNUSED'. If the KMD then checked the CTB queue, it would see a non-zero status value and report the buffer as corrupted. Technically, no G2H messages should be received once the CLIENT_RESET has been sent. However, if a context was outstanding on an engine then it would get reset and a reset notification would be sent. So, don't actually treat UNUSED as a catastrophic error. Just flag it up as unexpected and keep going. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220728024225.2363663-7-John.C.Harrison@Intel.com commit 52d4cfdc2460cb7f0528e27cdc9fb808f299d325 Author: Matthew Brost Date: Wed Jul 27 19:42:24 2022 -0700 drm/i915/guc: Support larger contexts on newer hardware The GuC needs a copy of a golden context for implementing watchdog resets (aka media resets). This context is larger on newer platforms. So adjust the size being allocated/copied accordingly. Signed-off-by: Matthew Brost Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220728024225.2363663-6-John.C.Harrison@Intel.com commit a96d8f052205d92c2fa934f72dd39229c8b75d79 Author: John Harrison Date: Wed Jul 27 19:42:23 2022 -0700 drm/i915/selftest: Cope with not having an RCS engine It is no longer guaranteed that there will always be an RCS engine. So, use the helper function for finding the first available engine that can be used for general purpose selftets. Signed-off-by: John Harrison Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20220728024225.2363663-5-John.C.Harrison@Intel.com commit 69142c0a5f9a0afa6ec31d5f9a4ebf293d3b5029 Author: Rahul Kumar Singh Date: Thu Jul 28 11:26:16 2022 -0700 drm/i915/guc: Add selftest for a hung GuC Add a test to check that the hangcheck will recover from a submission hang in the GuC. Signed-off-by: Rahul Kumar Singh Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220728182616.2417491-1-John.C.Harrison@Intel.com commit 15c5401dee76e03a1b4e30b7ba8fcec972e5bebd Author: Matthew Brost Date: Wed Jul 27 19:42:21 2022 -0700 drm/i915/guc: Fix issues with live_preempt_cancel Having semaphores results in different behavior when a dependent request is cancelled. In the case of semaphores the request could be on the HW and complete successfully while without the request is held in the driver and the error from the dependent request is propagated. Fix live_preempt_cancel to take this behavior into account. Also update live_preempt_cancel to use new function intel_context_ban rather than intel_context_set_banned. Signed-off-by: Matthew Brost Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220728024225.2363663-3-John.C.Harrison@Intel.com commit 9fb3473732908ff0f8d8f8763318c407489ae955 Author: Michał Winiarski Date: Wed Jul 27 19:42:20 2022 -0700 drm/i915/guc: Route semaphores to GuC for Gen12+ In GuC submission mode, there is an option to use auto-switch out semaphores and have GuC auto-switch in a waiting context. This requires routing the semaphore interrupt to GuC. Signed-off-by: Michał Winiarski Signed-off-by: John Harrison Reviewed-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220728024225.2363663-2-John.C.Harrison@Intel.com commit d4a3e50ffd9084e3eafb318e95ca91b5895a6e62 Author: Thomas Zimmermann Date: Thu Jul 28 14:41:03 2022 +0200 drm/mgag200: Remove type field from struct mga_device Each model's specific code is located in a separate file. The type field in struct mga_device is no unused. Remove it. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-15-tzimmermann@suse.de commit 828369f2829e5415e61a2c25b2cfb0bad48d72b4 Author: Thomas Zimmermann Date: Thu Jul 28 14:41:02 2022 +0200 drm/mgag200: Move CRTC atomic_enable to model-specific code The CRTC atomic_enable helper contains per-model branches for G200ER, G200EV and G200SE devices. Implement a dedicated helper for each of them and remove the branches from the shared helper. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-14-tzimmermann@suse.de commit bc8350409ca5147d432f869209ee13fa079625df Author: Thomas Zimmermann Date: Thu Jul 28 14:41:01 2022 +0200 drm/mgag200: Move mode-config to model-specific code Move the mode-config code into model-specific code and call the plane/CRTC helpers as needed. This will help with providing per- model implementations of individual helpers. Duplication of the pipeline init function is accepted. Some macros simplify this for shared helpers. v3: * clean up style Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-13-tzimmermann@suse.de commit 877507bb954e7d0a4f2d3ba9957127a83c03e447 Author: Thomas Zimmermann Date: Thu Jul 28 14:41:00 2022 +0200 drm/mgag200: Provide per-device callbacks for PIXPLLC Move the PIXPLLC code into per-model source files and wire it up with per-model callbacks. No functional changes. The PIXPLLC pixel-clock is part of the CRTC, but really separate hardware that varies with each model of the G200. Move the PIXPLLC code for each model into the per-model source file and call it from CRTC helpers via device functions. This allows to remove struct mgag200_pll and the related code. The new callbacks behave like the CRTC's atomic_check and atomic_enable functions. v3: * clean up style Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-12-tzimmermann@suse.de commit 8aeeb3144fe27b2b8aa30db262de2f654f2edb9a Author: Thomas Zimmermann Date: Thu Jul 28 14:40:59 2022 +0200 drm/mgag200: Provide per-device callbacks for BMC synchronization Move the BMC-related code into its own file and wire it up with device callbacks. While programming a new display mode, G200EW3 and G200WB have to de- synchronize with the BMC. Synchronization is done via VIDRST pins and controlled via VRSTEN and HRSTEN bits. Move the BMC code behind a serviceable interface and call it from the CRTC's enable and disable functions. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-11-tzimmermann@suse.de commit f639f74a789570fff9fb093a603bda550b53f3d9 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:58 2022 +0200 drm/mgag200: Add per-device callbacks While currently empty, the device callbacks will allow mgag200's modesetting code to interact with the BMC and PIXPLLC. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-10-tzimmermann@suse.de commit 5cd062e31d352e33284d08a52ddb2b9ed1a5caa8 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:57 2022 +0200 drm/mgag200: Set SCROFF in primary-plane code The SCROFF bit controls reading the primary plane's scanout buffer from video memory. Set it from primary-plane code, instead of CRTC code. v3: * only flip SCROFF when enabling/disabling the plane (Jocelyn) Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-9-tzimmermann@suse.de commit 1baf9127c482a3a58aef81d92ae751798e2db202 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:56 2022 +0200 drm/mgag200: Replace simple-KMS with regular atomic helpers Drop simple-KMS in favor of regular atomic helpers. Makes the code more modular and hence better to adapt to per-model requirements. The simple-KMS helpers provide few extra features, so the patch is mostly about open-coding what simple-KMS does. The simple-KMS helpers do mix up plane and CRTC state. Changing to regular atomic helpers requires to split some of the simple-pipe functions into per-plane and per-CRTC code No functional changes. v3: * always run drm_atomic_helper_check_plane_state() * clean up style Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-8-tzimmermann@suse.de commit 4f4dc37e374c957b2bbcd3b1f3dad73afeb647a5 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:55 2022 +0200 drm/mgag200: Reorganize before dropping simple-KMS helpers Move around some modesetting code before dropping simple-KMS helpers. Makes the next patch more readable. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-7-tzimmermann@suse.de commit ed2ef21f1089ef9b3b943b4e365600e615ce827d Author: Thomas Zimmermann Date: Thu Jul 28 14:40:54 2022 +0200 drm/mgag200: Store primary plane's color format in CRTC state Store the primary plane's color format in the CRTC state and use it for programming the CRTC's gamma LUTs. Gamma tables (i.e., color management) are provided by the CRTC, but depend in the primary plane's color format. Store the format in the CRTC state and use it. This has not been an issue with simple-KMS helpers, which mix-up plane and CRTC state to some extent. For using regular atomic helpers, it's necessary to distinguish between the two. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-6-tzimmermann@suse.de commit 2d70b9a1482e09f8465452c4655ffe20c605d526 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:53 2022 +0200 drm/mgag200: Acquire I/O-register lock in atomic_commit_tail function Hold I/O-register lock in atomic_commit_tail to protect all pipeline updates at once. Protects against concurrent I/O access in get-modes helper. Complex modesetting operations involve mode changes, plane updates and possibly BMC updates. Make all this atomic wrt to reading display modes via EDID. It's not so much an issue with simple-KMS helpers, but will become necessary for using regular atomic helpers. v4: * remove empty line Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-5-tzimmermann@suse.de commit 9382ec27acb2f5a43dc3c3b77036f898a498ba60 Author: Thomas Zimmermann Date: Thu Jul 28 14:40:52 2022 +0200 drm/mgag200: Move ER/EW3 register initialization to per-model code The register initialization code contains special cases for G200ER and G200EW3 hardware. Move this to per-model code. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-4-tzimmermann@suse.de commit 1ee181fe958a11d023fd992b8eabe6d4287661ee Author: Thomas Zimmermann Date: Thu Jul 28 14:40:51 2022 +0200 drm/mgag200: Move DAC-register setup into model-specific code Provide an init function for each model's DAC registers. Remove the shared helper. The code for initializing the DAC registers consisted of a large table of default value, plus many exceptions for the various G200 models. Providing a per-model implementation makes if more readable. At some point, some of the initialization should probably move into the modesetting code. v2: * don't duplicate DAC values unnecessarily (Sam, Jocelyn) Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-3-tzimmermann@suse.de commit 44373151ab429cca53fae53d9eed374aef64afad Author: Thomas Zimmermann Date: Thu Jul 28 14:40:50 2022 +0200 drm/mgag200: Split mgag200_modeset_init() Split mgag200_modeset_init() into smaller helpers to initialize the mode_config structure and the pipeline. This will be helpful for transforming this code into per-model functions. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Tested-by: Jocelyn Falempe Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-2-tzimmermann@suse.de commit cf1e6a90315a3f5b8ecbb3cf6a4badf8978e9075 Author: Maíra Canal Date: Fri Jul 29 09:47:26 2022 -0300 drm/tests: Split up test cases in igt_check_drm_format_min_pitch The igt_check_drm_format_min_pitch() function had a lot of KUNIT_EXPECT_* calls, all of which ended up allocating and initializing various test assertion structures on the stack. This behavior was producing -Wframe-larger-than warnings on PowerPC, i386, and MIPS architectures, such as: drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch': drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of 3712 bytes is larger than 2048 bytes So, the igt_check_drm_format_min_pitch() test case was split into three smaller functions: one testing single plane formats, one testing multi-planar formats, and the other testing tiled formats. Fixes: 0421bb0baa84 ("drm: selftest: convert drm_format selftest to KUnit") Reported-by: kernel test robot Reported-by: Guenter Roeck Signed-off-by: Maíra Canal Tested-by: Guenter Roeck Reviewed-by: André Almeida Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220729124726.748221-1-mairacanal@riseup.net commit 2ac6cdd581f48c8f68747156fde5868486a44985 Author: Simon Ser Date: Thu Feb 10 15:40:25 2022 +0000 drm/dp_mst: fix drm_dp_dpcd_read return value checks drm_dp_dpcd_read returns the number of bytes read. The previous code would print garbage on DPCD error, and would exit with on error on success. Signed-off-by: Simon Ser Fixes: cb897542c6d2 ("drm/dp_mst: Fix W=1 warnings") Cc: Lyude Paul Cc: Benjamin Gaignard Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/473500/ commit 22645976ae4c0e7eebc8cee7942692280457551e Author: Zhanjun Dong Date: Fri Jul 15 14:13:13 2022 -0700 drm/i915/guc: Check for ct enabled while waiting for response We are seeing error message of "No response for request". Some cases happened while waiting for response and reset/suspend action was triggered. In this case, no response is not an error, active requests will be cancelled. This patch will handle this condition and change the error message into debug message. Signed-off-by: Zhanjun Dong Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220715211313.143645-1-zhanjun.dong@intel.com commit 5d2f2e8b3a36328a3981996bb20c32d8a0e53b46 Author: José Expósito Date: Wed Jul 27 01:09:16 2022 +0200 drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565() Extend the existing test cases to test the conversion from XRGB8888 to RGB565. The documentation and the color picker available on [1] are useful resources to understand this patch and validate the values returned by the conversion function. Tested-by: Tales L. Aparecida Acked-by: Thomas Zimmermann Reviewed-by: David Gow Signed-off-by: José Expósito Link: http://www.barth-dev.de/online/rgb565-color-picker/ # [1] Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-5-jose.exposito89@gmail.com commit 4d09017aec4f2aa5f6109b32f9a037f35c17a9e0 Author: José Expósito Date: Wed Jul 27 01:09:15 2022 +0200 drm/format-helper: Support multiple target formats results In order to support multiple destination format conversions, store the destination pitch and the expected result in its own structure. Tested-by: Tales L. Aparecida Acked-by: Thomas Zimmermann Reviewed-by: David Gow Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-4-jose.exposito89@gmail.com commit 696560d43b4b07b58cf8604a9b186b32159164d9 Author: José Expósito Date: Wed Jul 27 01:09:14 2022 +0200 drm/format-helper: Rename test cases to make them more generic The tests available at the moment only check the conversion from XRGB8888 to RGB332. However, more conversions will be tested in the future. In order to make the struct and functions present in the tests more generic, rename xrgb8888_to_rgb332_* to convert_xrgb8888_*. Tested-by: Tales L. Aparecida Acked-by: Thomas Zimmermann Reviewed-by: David Gow Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-3-jose.exposito89@gmail.com commit 18c8485236a5e3f491b670c018ae391c9cb84dfa Author: José Expósito Date: Wed Jul 27 01:09:13 2022 +0200 drm/format-helper: Fix test on big endian architectures The tests fail on big endian architectures, like PowerPC: $ ./tools/testing/kunit/kunit.py run \ --kunitconfig=drivers/gpu/drm/tests \ --arch=powerpc --cross_compile=powerpc64-linux-gnu- Transform the XRGB8888 buffer from little endian to the CPU endian before calling the conversion function to avoid this error. Fixes: 8f456104915f ("drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()") Reported-by: David Gow Reviewed-by: David Gow Signed-off-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-2-jose.exposito89@gmail.com commit 8e61cbd483aee6ac6be9f5821e1bf22bed0710ff Author: Danilo Krummrich Date: Fri Jul 1 21:02:27 2022 +0200 drm/todo: remove task for idr_init_base() All IDRs in the DRM core and drivers which are applicable for using idr_init_base() over idr_init() should be set up to use a proper base in order to avoid unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701190227.284783-3-dakr@redhat.com commit b765bc9968de022cc7dfc745d23de595fcc2b6cd Author: Danilo Krummrich Date: Fri Jul 1 21:02:26 2022 +0200 drm/via: use idr_init_base() to initialize dev_priv->object_idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701190227.284783-2-dakr@redhat.com commit 604bda63bf939d6f5afef0b20d7ddee3abd27852 Author: Danilo Krummrich Date: Fri Jul 1 21:02:25 2022 +0200 drm/v3d: use idr_init_base() to initialize v3d_priv->perfmon.idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701190227.284783-1-dakr@redhat.com commit bf8afc2090795b8640bf1842529627e69f673df4 Author: Danilo Krummrich Date: Fri Jul 1 20:53:00 2022 +0200 drm/sis: use idr_init_base() to initialize dev_priv->object_idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-8-dakr@redhat.com commit 1d4f70a65fafb484064b9c7caa7318e9fd2ab737 Author: Danilo Krummrich Date: Fri Jul 1 20:52:59 2022 +0200 drm: use idr_init_base() to initialize mode_config.tile_idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-7-dakr@redhat.com commit 1765378dfb10d4feedfc71cd721c4140d927c488 Author: Danilo Krummrich Date: Fri Jul 1 20:52:58 2022 +0200 drm: use idr_init_base() to initialize mode_config.object_idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-6-dakr@redhat.com commit 3a6acb7dd69f9d8960009ed1ceb77dc5e532391a Author: Danilo Krummrich Date: Fri Jul 1 20:52:57 2022 +0200 drm: use idr_init_base() to initialize master->lessee_idr idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-5-dakr@redhat.com commit a49afeb4165361819b92b7991b97457bac4c674c Author: Danilo Krummrich Date: Fri Jul 1 20:52:56 2022 +0200 drm: use idr_init_base() to initialize master->magic_map idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-4-dakr@redhat.com commit c4f306e31632e997c01f3e5ff3298ffc3a127999 Author: Danilo Krummrich Date: Fri Jul 1 20:52:55 2022 +0200 drm/amdgpu: use idr_init_base() to initialize fpriv->bo_list_handles idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-3-dakr@redhat.com commit 2ddd1e6ccb139b9e7f1fed2883e34add832cbd77 Author: Danilo Krummrich Date: Fri Jul 1 20:52:54 2022 +0200 drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220701185303.284082-2-dakr@redhat.com commit f31bccd3989d504a0c90b4562908ea18162d7662 Author: Imre Deak Date: Wed Jul 27 19:45:23 2022 +0300 drm/i915/d13: Add Wa_16015201720 disabling clock gating for PIPEDMC-A/B Add a workaround making sure that PIPEDMC-A/B is enabled when the firmware needs these on D13 platforms to save/restore the registers backed by the PW_1 and PW_A power wells. Signed-off-by: Imre Deak Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220727164523.1621361-2-imre.deak@intel.com commit fa6a4cdeafa0ab674d0f72067304c5408c89964f Author: Imre Deak Date: Thu Jul 28 11:14:40 2022 +0300 drm/i915/d12+: Disable DMC handlers during loading/disabling the firmware Disable the DMC event handlers before loading the firmware and after uninitializing the display, to make sure the firmware is inactive. This matches the Bspec "Sequences for Display C5 and C6" page for GEN12+. Add a TODO comment for doing the same on pre-GEN12 platforms. v2: - Add a macro for the number of event handlers. - Disable the event handlers only on GEN12+. - s/dev_priv/i915/ in docbook comment. Signed-off-by: Imre Deak Reviewed-by: Uma Shankar #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20220728081440.1676857-1-imre.deak@intel.com commit d1051db85f6496ed9c825802bef3709f2e7d816f Author: Mauro Carvalho Chehab Date: Wed Jul 27 14:29:56 2022 +0200 drm/i915/gt: describe the new tlb parameter at i915_vma_resource TLB cache invalidation can happen on two different situations: 1. synchronously, at __vma_put_pages(); 2. asynchronously. On the first case, TLB cache invalidation happens inside __vma_put_pages(). So, no need to do it later on. However, on the second case, the pages will keep in memory until __i915_vma_evict() is called. So, we need to store the TLB data at struct i915_vma_resource, in order to do a TLB cache invalidation before allowing userspace to re-use the same memory. So, i915_vma_resource_unbind() has gained a new parameter in order to store the TLB data at the second case. Document it. Reviewed-by: Andi Shyti Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/aa55eef7e63b8f3d0f69b525db2dd2eb87e9db6b.1658924372.git.mchehab@kernel.org commit 5d36acb7198b0e5eb88e6b701f9ad7b9448f8df9 Author: Chris Wilson Date: Wed Jul 27 14:29:55 2022 +0200 drm/i915/gt: Batch TLB invalidations Invalidate TLB in batches, in order to reduce performance regressions. Currently, every caller performs a full barrier around a TLB invalidation, ignoring all other invalidations that may have already removed their PTEs from the cache. As this is a synchronous operation and can be quite slow, we cause multiple threads to contend on the TLB invalidate mutex blocking userspace. We only need to invalidate the TLB once after replacing our PTE to ensure that there is no possible continued access to the physical address before releasing our pages. By tracking a seqno for each full TLB invalidate we can quickly determine if one has been performed since rewriting the PTE, and only if necessary trigger one for ourselves. That helps to reduce the performance regression introduced by TLB invalidate logic. [mchehab: rebased to not require moving the code to a separate file] Cc: stable@vger.kernel.org Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Suggested-by: Tvrtko Ursulin Signed-off-by: Chris Wilson Cc: Fei Yang Signed-off-by: Mauro Carvalho Chehab Acked-by: Tvrtko Ursulin Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/4e97ef5deb6739cadaaf40aa45620547e9c4ec06.1658924372.git.mchehab@kernel.org commit be0366f168033374a93e4c43fdaa1a90ab905184 Author: Chris Wilson Date: Wed Jul 27 14:29:54 2022 +0200 drm/i915/gt: Skip TLB invalidations once wedged Skip all further TLB invalidations once the device is wedged and had been reset, as, on such cases, it can no longer process instructions on the GPU and the user no longer has access to the TLB's in each engine. So, an attempt to do a TLB cache invalidation will produce a timeout. That helps to reduce the performance regression introduced by TLB invalidate logic. Cc: stable@vger.kernel.org Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Chris Wilson Cc: Fei Yang Cc: Tvrtko Ursulin Reviewed-by: Andi Shyti Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/5aa86564b9ec5fe7fe605c1dd7de76855401ed73.1658924372.git.mchehab@kernel.org commit dfc83de118ff7930acc9a4c8dfdba7c153aa44d6 Author: Chris Wilson Date: Wed Jul 27 14:29:53 2022 +0200 drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations Ensure that the TLB of the OA unit is also invalidated on gen12 HW, as just invalidating the TLB of an engine is not enough. Cc: stable@vger.kernel.org Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Chris Wilson Cc: Fei Yang Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/59724d9f5cf1e93b1620d01b8332ac991555283d.1658924372.git.mchehab@kernel.org commit 4d87d36247e7fb9419b25331051c0746d09e57bb Author: Mauro Carvalho Chehab Date: Wed Jul 27 14:29:52 2022 +0200 drm/i915/gt: document with_intel_gt_pm_if_awake() Add a kernel-doc markup to document this new macro. Reviewed-by: Tvrtko Ursulin Reviewed-by: Andi Shyti Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/b974905bd0f6b5308b91561cc85eeecd94f1452a.1658924372.git.mchehab@kernel.org commit 4bedceaed1ae1172cfe72d3ff752b3a1d32fe4d9 Author: Chris Wilson Date: Wed Jul 27 14:29:51 2022 +0200 drm/i915/gt: Ignore TLB invalidations on idle engines Check if the device is powered down prior to any engine activity, as, on such cases, all the TLBs were already invalidated, so an explicit TLB invalidation is not needed, thus reducing the performance regression impact due to it. This becomes more significant with GuC, as it can only do so when the connection to the GuC is awake. Cc: stable@vger.kernel.org Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Chris Wilson Cc: Fei Yang Reviewed-by: Andi Shyti Acked-by: Thomas Hellström Acked-by: Tvrtko Ursulin Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/278a57a672edac75683f0818b292e95da583a5fe.1658924372.git.mchehab@kernel.org commit c4cf059d9c2c4849c65b481c6853bb93c8b33f3b Author: Madhumitha Tolakanahalli Pradeep Date: Wed Jul 27 11:29:19 2022 -0700 drm/i915/dmc: Update DG2 DMC firmware to v2.07 The release notes mention that DMC v2.07 has a workaround for MMIO hang issue when DC States are enabled. Signed-off-by: Madhumitha Tolakanahalli Pradeep Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220727182919.334136-2-madhumitha.tolakanahalli.pradeep@intel.com commit 353819d85f87be46aeb9c1dd929d445a006fc6ec Author: Matthew Auld Date: Wed Jul 27 17:43:46 2022 +0100 drm/i915/ttm: don't leak the ccs state The kernel only manages the ccs state with lmem-only objects, however the kernel should still take care not to leak the CCS state from the previous user. Fixes: 48760ffe923a ("drm/i915/gt: Clear compress metadata for Flat-ccs objects") Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220727164346.282407-1-matthew.auld@intel.com commit f5dfbfc0ae00c2c2c0518da9e1f9a8cca50ae544 Author: Nirmoy Das Date: Wed Jul 27 19:33:06 2022 +0200 drm/i915: disable pci resize on 32-bit machine PCI bar resize only works with 64 bit BAR so disable this on 32-bit machine and resolve below compilation error: drivers/gpu/drm/i915/gt/intel_region_lmem.c:94:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] root_res->start > 0x100000000ull) Fixes: a91d1a17cd341 ("drm/i915: Add support for LMEM PCIe resizable bar") Reported-by: Linux Kernel Functional Testing Tested-by: Linux Kernel Functional Testing Acked-by: Matthew Auld Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220727173306.16247-1-nirmoy.das@intel.com commit a8c18bec83a82a90d5e35a080bc465581459313e Author: Chris Wilson Date: Wed Jul 27 19:40:23 2022 +0200 drm/i915: Suppress oom warning for shmemfs object allocation failure We report object allocation failures to userspace with ENOMEM, yet we still show the memory warning after failing to shrink device allocated pages. While this warning is similar to other system page allocation failures, it is superfluous to the ENOMEM provided directly to userspace. v2: Add NOWARN in few more places from where we might return ENOMEM to userspace. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4936 Signed-off-by: Chris Wilson Co-developed-by: Nirmoy Das Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220727174023.16766-1-nirmoy.das@intel.com commit ddcf980f4d724dbcf6a99be58bd07cd5cc68bb0e Author: Anusha Srivatsa Date: Thu Jul 21 15:51:00 2022 -0700 drm/i915: Pass drm_i915_private struct instead of gt for gen11_gu_misc_irq_handler/ack() gen11_gu_misc_irq_handler() and gen11_gu_misc_ack() do nothing tile specific. v2: gen11_gu_misc_irq_ack() tile agnostic like gen11_gu_misc_irq_handler() (Tvrtko) Cc: Tvrtko Ursulin Cc: Matt Roper Signed-off-by: Anusha Srivatsa Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220721225100.693589-1-anusha.srivatsa@intel.com commit ace98ffc8acbe7e8f886f2048436a0438663b153 Author: Anusha Srivatsa Date: Mon Jul 25 15:50:28 2022 -0700 drm/i915/display: Cleanup intel_phy_is_combo() Cleanup the intel_phy_is_combo to accommodate for cases where combo phy is not available. v2: retain comment that explains DG2 returning false from intel_phy_is_combo() (Arun) Cc: Arun R Murthy Cc: Matt Roper Signed-off-by: Anusha Srivatsa Reviewed-by: Matt Roper Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20220725225028.98612-1-anusha.srivatsa@intel.com commit 5727dcfd8486399c40e39d2c08fe36fedab29d99 Author: Daniel Vetter Date: Mon Jul 25 09:54:00 2022 +0200 fbdev: Make registered_fb[] private to fbmem.c No driver access this anymore, except for the olpc dcon fbdev driver but that has been marked as broken anyways by commit de0952f267ff ("staging: olpc_dcon: mark driver as broken"). Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220725075400.68478-1-javierm@redhat.com commit 57b2efce45ef5429e8d050190242849890b1fd96 Author: Marek Vasut Date: Mon Jul 25 17:17:03 2022 +0200 drm/panel/panel-sitronix-st7701: Add Densitron DMT028VGHMCMI-1A TFT Add support for Densitron DMT028VGHMCMI-1A TFT matrix into this driver. This is a DSI-attached 480x640 2.83 inch panel. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220725151703.319939-2-marex@denx.de commit e6e627482a19a34b68116cdb5756bb199b5e2e52 Author: Marek Vasut Date: Mon Jul 25 17:17:02 2022 +0200 dt-bindings: display: panel: sitronix,st7701: Add Densitron DMT028VGHMCMI-1A TFT Add compatible string for Densitron DMT028VGHMCMI-1A TFT matrix. This is a DSI-attached 480x640 2.83 inch panel. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Rob Herring Cc: Sam Ravnborg Cc: Thierry Reding Cc: devicetree@vger.kernel.org Acked-by: Rob Herring Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220725151703.319939-1-marex@denx.de commit b320c7b7343885a346949abb56ea20528d611148 Author: Slark Xiao Date: Thu Jul 21 14:23:45 2022 +0800 drm: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220721062345.46842-1-slark_xiao@163.com commit 3565c7219c169ab6c6ef34ba9187c1b7bc6dbfa5 Author: Ankit Nautiyal Date: Thu Jul 21 14:16:45 2022 +0530 drm/i915/hdmi: Prune modes that require HDMI2.1 FRL HDMI2.1 requires some higher resolution video modes to be enumerated only if HDMI2.1 Fixed Rate Link (FRL) is supported. Current platforms do not support FRL transmission so prune modes that require HDMI2.1 FRL. v2: Fixed the condition to check for dotclock > 600. Return MODE_CLOCK_HIGH as mode status. Signed-off-by: Ankit Nautiyal Reviewed-by: Arun R Murthy (v1) Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220721084645.3411219-1-ankit.k.nautiyal@intel.com commit a4d847df8b440cc667c18f99abe84ccaa83afac4 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:58 2022 +0200 drm/fsl-dcu: Use drm_plane_helper_destroy() Replace the driver's own function with drm_plane_helper_destroy(). No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-8-tzimmermann@suse.de commit 62d89fee3defe841ce12b46439f9b34010bd616a Author: Thomas Zimmermann Date: Wed Jul 20 10:30:57 2022 +0200 drm/armada: Use drm_plane_helper_destroy() Replace the driver's own function with drm_plane_helper_destroy(). No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-7-tzimmermann@suse.de commit 30c637151cfac8da3588f3773462e705a4ff2f59 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:56 2022 +0200 drm/plane-helper: Export individual helpers Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting. With struct drm_plane_funcs removed from drm_plane_helper.h, also remove the include statements. It only needs linux/types.h for uint32_t and a number of forward declarations. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-6-tzimmermann@suse.de commit 254e5e8829a97bdbaf86b83ef704ac45a30c3867 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:55 2022 +0200 drm: Remove unnecessary include statements of drm_plane_helper.h Remove the include statement for drm_plane_helper.h from all the files that don't need it. Althogh the header file is almost empty, many drivers include it somewhere. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-5-tzimmermann@suse.de commit cce32e4e38c63f040ffe1966117d364ecf9a28b8 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:54 2022 +0200 drm/atomic-helper: Remove _HELPER_ infix from DRM_PLANE_HELPER_NO_SCALING Rename DRM_PLANE_HELPER_NO_SCALING to DRM_PLANE_NO_SCALING. The constant is not really a helper, but rather a characteristic of the plane itself. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-4-tzimmermann@suse.de commit 382fc1f681324bb38bedfe763107a60256c4ddc8 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:53 2022 +0200 drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers The macro DRM_PLANE_HELPER_NO_SCALING is only useful with the interfaces in drm_atomic_helper.h, but defined in drm_plane_helper.h. So half of DRM includes the latter header file for using this macro. Move the macro and remove the include statements. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-3-tzimmermann@suse.de commit 97216fefed6d9782c7208cca33a5465212f533f3 Author: Thomas Zimmermann Date: Wed Jul 20 10:30:52 2022 +0200 drm/vmwgfx: Remove trailing whitespace Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Reviewed-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220720083058.15371-2-tzimmermann@suse.de commit bbb6f93f51a19787f455768015e9a77a4d83c4c8 Author: Javier Martinez Canillas Date: Fri Jul 22 09:47:55 2022 +0200 drm/bridge: ti-sn65dsi86: Use dev_err_probe() to avoid polluting the log If devm_drm_of_get_bridge() can't find the connected bridge, it returns an ERR_PTR(-EPROBE_DEFER) to indicate that the probe should be deferred. But this path also prints an error message, which pollutes the kernel log since is printed on every probe deferral, i.e: $ dmesg | grep "failed to create panel bridge" | wc -l 38 Signed-off-by: Javier Martinez Canillas Reviewed-by: Neil Armstrong Reviewed-by: Andrzej Hajda Reviewed-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220722074755.660258-1-javierm@redhat.com commit eaa225b6b52233d45457fd33730e1528c604d92d Author: Liviu Dudau Date: Fri Jul 8 16:39:21 2022 +0100 drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook Komeda driver relies on the generic DRM atomic helper functions to handle commits. It only implements an atomic_commit_tail hook for the mode_config_helper_funcs and even that one is pretty close to the generic implementation with the exception of additional dma_fence signalling. What the generic helper framework doesn't do is waiting for the actual hardware to signal that the commit parameters have been written into the appropriate registers. As we signal CRTC events only on the irq handlers, we need to flush the configuration and wait for the hardware to respond. Add the Komeda specific implementation for atomic_commit_hw_done() that flushes and waits for flip done before calling drm_atomic_helper_commit_hw_done(). The fix was prompted by a patch from Carsten Haitzler where he was trying to solve the same issue but in a different way that I think can lead to wrong event signaling to userspace. Reported-by: Carsten Haitzler Tested-by: Carsten Haitzler Reviewed-by: Carsten Haitzler Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220722122139.288486-1-liviu.dudau@arm.com commit a8ff2cd916e62b740718a908fbaa1e9ec8a147f1 Author: Carsten Haitzler Date: Mon Jun 6 12:47:13 2022 +0100 drm/komeda - At init write GCU control block to handle already on DPU If something has already set up the DPU before the komeda driver comes up, it will fail to init because it was just writing to the SRST bit in the GCU control register and ignoring others. This resulted in TBU bringup stalling and init failing. By writing completely we also set the mode back to 0 (inactive) too and thus TBU bringup works. Signed-off-by: Carsten Haitzler Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220606114714.175499-2-carsten.haitzler@foss.arm.com commit 000a2f0498f29b0831496bb1fdab3354b00704a2 Author: Carsten Haitzler Date: Mon Jul 18 17:00:39 2022 +0100 drm/komeda: Add legacy FB support so VT's work as expected The komeda driver doesn't come up with a visible text (FB) mode VT by default as it was missing legacy FB support. It's useful to have a working text VT on a system for debug and general usability, so enable it. You can always toggle CONFIG_FRAMEBUFFER_CONSOLE. Signed-off-by: Carsten Haitzler Reviewed-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220606114714.175499-1-carsten.haitzler@foss.arm.com commit f818eac130d236d41c2f18fd475ebd709e5a56e7 Author: Robin Murphy Date: Wed Jun 15 17:11:09 2022 +0100 drm/arm/hdlcd: Simplify IRQ install/uninstall Since we no longer need to conform to the structure of the various DRM IRQ callbacks, we can streamline the code by consolidating the piecemeal functions and passing around our private data structure directly. We're also a platform device so should never see IRQ_NOTCONNECTED either. Furthermore we can also get rid of all the unnecesary read-modify-write operations, since on install we know we cleared the whole interrupt mask before enabling the debug IRQs, and thus on uninstall we're always clearing everything as well. Signed-off-by: Robin Murphy Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/65cf7818b23c1a8629dc851f1d058ecb8a14849e.1655309413.git.robin.murphy@arm.com commit 4b760f76dd6f57cb0d608ba0c4009b7eeeddd864 Author: Robin Murphy Date: Wed Jun 15 17:09:15 2022 +0100 drm/arm/hdlcd: Take over EFI framebuffer properly The Arm Juno board EDK2 port has provided an EFI GOP display via HDLCD0 for some time now, which works nicely as an early framebuffer. However, once the HDLCD driver probes and takes over the hardware, it should take over the logical framebuffer as well, otherwise the now-defunct GOP device hangs about and virtual console output inevitably disappears into the wrong place most of the time. We'll do this after binding the HDMI encoder, since that's the most likely thing to fail, and the EFI console is still better than nothing when that happens. However, the two HDLCD controllers on Juno are independent, and many users will still be using older firmware without any display support, so we'll only bother if we find that the HDLCD we're probing is already enabled. And if it is, then we'll also stop it, since otherwise the display can end up shifted if it's still scanning out while the rest of the registers are subsequently reconfigured. Signed-off-by: Robin Murphy Reviewed-by: Javier Martinez Canillas Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/31acd57f4aa8a4d02877026fa3a8c8d035e15a0d.1655309004.git.robin.murphy@arm.com commit b62cc8fa824807c00b77a76e78c7417b6bfdf418 Author: pengfuyuan Date: Fri May 27 11:39:03 2022 +0800 drm/arm: Fix spelling typo in comments Fix spelling typo in comments. Reported-by: k2ci Signed-off-by: pengfuyuan Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220426121639.39160-1-pengfuyuan@kylinos.cn commit ca5f13a21404f5496bcc006d9416c8bef21b227d Author: Thomas Zimmermann Date: Thu Jul 21 10:16:55 2022 +0200 fbdev: Fix order of arguments to aperture_remove_conflicting_devices() Reverse the order of the final two arguments when calling aperture_remove_conflicting_devices(). An error report is available at [1]. Reported-by: kernel test robot Signed-off-by: Thomas Zimmermann Fixes: 8d69d008f44c ("fbdev: Convert drivers to aperture helpers") Reviewed-by: Javier Martinez Canillas Reviewed-by: Michael Kelley # hypervfb Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Sudip Mukherjee Cc: Teddy Wang Cc: Benjamin Herrenschmidt Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Dexuan Cui Cc: linux-fbdev@vger.kernel.org Cc: linux-hyperv@vger.kernel.org Link: https://lore.kernel.org/lkml/202207202040.jS1WcTzN-lkp@intel.com/ # 1 Link: https://patchwork.freedesktop.org/patch/msgid/20220721081655.16128-1-tzimmermann@suse.de commit fc94224c2e0ae8d83ac511a3ef4962178505469d Author: Chen-Yu Tsai Date: Thu Jul 21 17:22:58 2022 +0800 drm/bridge: parade-ps8640: Fix regulator supply order The datasheet says that VDD12 must be enabled and at full voltage before VDD33 is enabled. Reorder the bulk regulator supply names so that VDD12 is enabled before VDD33. Any enable ramp delays should be handled by setting proper constraints on the regulators. Fixes: bc1aee7fc8f0 ("drm/bridge: Add I2C based driver for ps8640 bridge") Signed-off-by: Chen-Yu Tsai Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220721092258.3397461-1-wenst@chromium.org commit 2b8428a10fd3763819eabf1acef6b5b2c7875520 Author: Liu Zixian Date: Mon Jul 18 09:53:57 2022 +0800 drm: correct comments On failure, these functions return error pointer, not NULL. Signed-off-by: Liu Zixian Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220718015357.1722-1-liuzixian4@huawei.com commit ac991b874b098ecde2c5eb81da48d52b6b22851b Author: Wang Jingjin Date: Sat Jul 16 10:07:41 2022 +0800 drm/vc4: Add explicit declaration of 'drmm_of_get_bridge' Fix the error of implicit declaration of function 'drmm_of_get_bridge': drivers/gpu/drm/vc4/vc4_dpi.c:278:11: error: implicit declaration of function ‘drmm_of_get_bridge’; did you mean ‘devm_drm_of_get_bridge’? [-Werror=implicit-function-declaration] bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0); Fixes: 055af0235aef ("drm/vc4: dpi: Switch to drmm_of_get_bridge") Signed-off-by: Wang Jingjin Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220716020741.4124893-1-wangjingjin1@huawei.com commit b25c377a5b26f107ea831af05919fc3782aabebc Author: Jason Wang Date: Sat Jul 16 12:05:20 2022 +0800 drm/i915/selftests: Fix comment typo Fix the double `wait' typo in comment. Signed-off-by: Jason Wang Reviewed-by: Andrzej Hajda Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20220716040520.31676-1-wangborong@cdjrlc.com commit 2be1959ecefd9f655e6262144a1b970bc2f34054 Author: Jason Wang Date: Sun Jul 17 02:44:39 2022 +0800 drm/i915/gt: Remove unneeded semicolon The semicolon after the `}' is unneeded. Signed-off-by: Jason Wang Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi [Removed line mention when pushing] Link: https://patchwork.freedesktop.org/patch/msgid/20220716184439.72056-1-wangborong@cdjrlc.com commit a4a4307003307220321f946892829a5364433809 Author: John Harrison Date: Thu Jul 14 17:40:28 2022 -0700 drm/i915/guc: Don't use pr_err when not necessary A bunch of code was copy/pasted using pr_err as the default way to report errors. However, drm_err is significantly more useful in identifying where the error came from. So update the code to use that instead. Signed-off-by: John Harrison Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20220715004028.2126239-1-John.C.Harrison@Intel.com commit b68735e8ef58be6df7a6f511c60186e6051d9fb6 Author: Nícolas F. R. A. Prado Date: Wed Jul 20 15:11:58 2022 -0400 drm/panel-edp: Add panel entry for B120XAN01.0 Add panel identification entry for the AUO B120XAN01.0 (product ID: 0x1062) panel. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220720191158.1590833-1-nfraprado@collabora.com commit f6ff4570e567b687b851a2cf52c7e300c399d925 Author: Nícolas F. R. A. Prado Date: Tue Jul 19 16:38:54 2022 -0400 drm/panel-edp: Add panel entry for R140NWF5 RH Add panel identification entry for the IVO R140NWF5 RH (product ID: 0x057d) panel. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220719203857.1488831-2-nfraprado@collabora.com commit 9a95f78eab70deeb5a4c879c19b841a6af5b66e7 Author: Eric W. Biederman Date: Sat Jan 8 10:37:00 2022 -0600 signal: Drop signals received after a fatal signal has been processed In 403bad72b67d ("coredump: only SIGKILL should interrupt the coredumping task") Oleg modified the kernel to drop all signals that come in during a coredump except SIGKILL, and suggested that it might be a good idea to generalize that to other cases after the process has received a fatal signal. Semantically it does not make sense to perform any signal delivery after the process has already been killed. When a signal is sent while a process is dying today the signal is placed in the signal queue by __send_signal and a single task of the process is woken up with signal_wake_up, if there are any tasks that have not set PF_EXITING. Take things one step farther and have prepare_signal report that all signals that come after a process has been killed should be ignored. While retaining the historical exception of allowing SIGKILL to interrupt coredumps. Update the comment in fs/coredump.c to make it clear coredumps are special in being able to receive SIGKILL. This changes things so that a process stopped in PTRACE_EVENT_EXIT can not be made to escape it's ptracer and finish exiting by sending it SIGKILL. That a process can be made to leave PTRACE_EVENT_EXIT and escape it's tracer by sending the process a SIGKILL has been complicating tracer's for no apparent advantage. If the process needs to be made to leave PTRACE_EVENT_EXIT all that needs to happen is to kill the proceses's tracer. This differs from the coredump code where there is no other mechanism besides honoring SIGKILL to expedite the end of coredumping. Link: https://lkml.kernel.org/r/875yksd4s9.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit d80f7d7b2c75c5954d335dffbccca62a5002c3e0 Author: Eric W. Biederman Date: Tue Jun 21 14:38:52 2022 -0500 signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit Track how many threads have not started exiting and when the last thread starts exiting set SIGNAL_GROUP_EXIT. This guarantees that SIGNAL_GROUP_EXIT will get set when a process exits. In practice this achieves nothing as glibc's implementation of _exit calls sys_group_exit then sys_exit. While glibc's implemenation of pthread_exit calls exit (which cleansup and calls _exit) if it is the last thread and sys_exit if it is the last thread. This means the only way the kernel might observe a process that does not set call exit_group is if the language runtime does not use glibc. With more cleanups I hope to move the decrement of quick_threads earlier. Link: https://lkml.kernel.org/r/87bkukd4tc.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit cbe9dac379047730e39c7e570eddd27124b0d2dc Author: Eric W. Biederman Date: Tue Jun 21 12:39:51 2022 -0500 signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit The function do_group_exit has an optimization that avoids taking siglock and doing the work to find other threads in the signal group and shutting them down. It is very desirable for SIGNAL_GROUP_EXIT to always been set whenever it is decided for the process to exit. That ensures only a single place needs to be tested, and a single bit of state needs to be looked at. This makes the optimization in do_group_exit counter productive. Make the code and maintenance simpler by removing this unnecessary option. Link: https://lkml.kernel.org/r/87letod4v3.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit c579d60f0d0cd87552f64fdebe68b5d941d20309 Author: Hangyu Hua Date: Fri Jul 15 14:23:01 2022 +0800 ipc: mqueue: fix possible memory leak in init_mqueue_fs() commit db7cfc380900 ("ipc: Free mq_sysctls if ipc namespace creation failed") Here's a similar memory leak to the one fixed by the patch above. retire_mq_sysctls need to be called when init_mqueue_fs fails after setup_mq_sysctls. Fixes: dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace") Signed-off-by: Hangyu Hua Link: https://lkml.kernel.org/r/20220715062301.19311-1-hbh25y@gmail.com Signed-off-by: Eric W. Biederman commit 774ce1510e6ccb9c0752d4aa7a9ff3624b3db3f3 Author: Daniele Ceraolo Spurio Date: Mon Jul 18 16:07:32 2022 -0700 drm/i915/guc: support v69 in parallel to v70 This patch re-introduces support for GuC v69 in parallel to v70. As this is a quick fix, v69 has been re-introduced as the single "fallback" guc version in case v70 is not available on disk and only for platforms that are out of force_probe and require the GuC by default. All v69 specific code has been labeled as such for easy identification, and the same was done for all v70 functions for which there is a separate v69 version, to avoid accidentally calling the wrong version via the unlabeled name. When the fallback mode kicks in, a drm_notice message is printed in dmesg to inform the user of the required update. The existing logging of the fetch function has also been updated so that we no longer complain immediately if we can't find a fw and we only throw an error if the fetch of both the base and fallback blobs fails. The plan is to follow this up with a more complex rework to allow for multiple different GuC versions to be supported at the same time. v2: reduce the fallback to platform that require it, switch to firmware_request_nowarn(), improve logs. Fixes: 2584b3549f4c ("drm/i915/guc: Update to GuC version 70.1.1") Link: https://lists.freedesktop.org/archives/intel-gfx/2022-July/301640.html Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Cc: Matthew Brost Cc: Matt Roper Cc: Dave Airlie Cc: Michal Wajdeczko Acked-by: Rodrigo Vivi Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220718230732.1409641-1-daniele.ceraolospurio@intel.com commit 6e2dc7ac71411eaf6363d63c333519e1d353d6b0 Author: Dmitry Baryshkov Date: Mon Jul 11 12:21:17 2022 +0300 drm/bridge: ti-sn65dsi86: support DRM_BRIDGE_ATTACH_NO_CONNECTOR Now as the driver does not depend on pdata->connector, add support for attaching the bridge with DRM_BRIDGE_ATTACH_NO_CONNECTOR. Reviewed-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Signed-off-by: Dmitry Baryshkov Tested-by: Steev Klimaszewski Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220711092117.360797-3-dmitry.baryshkov@linaro.org commit 2dbeef82d14fda3b15d40c94522bdf83f9c33ae8 Author: Dmitry Baryshkov Date: Mon Jul 11 12:21:16 2022 +0300 drm/bridge: ti-sn65dsi86: fetch bpc using drm_atomic_state Rather than reading the pdata->connector directly, fetch the connector using drm_atomic_state. This allows us to make pdata->connector optional (and thus supporting DRM_BRIDGE_ATTACH_NO_CONNECTOR). Reviewed-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Signed-off-by: Dmitry Baryshkov Tested-by: Steev Klimaszewski Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220711092117.360797-2-dmitry.baryshkov@linaro.org commit 6d602e031103fb78dbe50dbf57a5f29737494c6f Author: Christian König Date: Wed Jul 13 18:14:52 2022 +0200 drm/sched: move calling drm_sched_entity_select_rq We already discussed that the call to drm_sched_entity_select_rq() needs to move to drm_sched_job_arm() to be able to set a new scheduler list between _init() and _arm(). This was just not applied for some reason. Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220714103902.7084-2-christian.koenig@amd.com commit fa2a87e4c5cea2beba9deabcbaf54d1979fff419 Author: Geert Uytterhoeven Date: Fri Jul 8 20:21:09 2022 +0200 drm/gud: Fix endianness in gud_xrgb8888_to_color() helper DRM formats are defined to be little-endian, unless the DRM_FORMAT_BIG_ENDIAN flag is set. Hence when converting from one format to another, multi-byte pixel values loaded from memory must be converted from little-endian to host-endian. Conversely, multi-byte pixel values written to memory must be converted from host-endian to little-endian. Currently only drm_fb_xrgb8888_to_rgb332_line() includes endianness handling. Fix gud_xrgb8888_to_color() on big-endian platforms by adding the missing endianness handling. Signed-off-by: Geert Uytterhoeven Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/b47589ed5d8ca44e0956684412e3f16f3227f887.1657300532.git.geert@linux-m68k.org commit 4d9db10576ff51afa8cf7727fbad55ada299359b Author: Geert Uytterhoeven Date: Fri Jul 8 20:21:08 2022 +0200 drm/format-helper: Fix endianness in drm_fb_*_to_*() conversion helpers DRM formats are defined to be little-endian, unless the DRM_FORMAT_BIG_ENDIAN flag is set. Hence when converting from one format to another, multi-byte pixel values loaded from memory must be converted from little-endian to host-endian. Conversely, multi-byte pixel values written to memory must be converted from host-endian to little-endian. Currently only drm_fb_xrgb8888_to_rgb332_line() includes endianness handling. Fix this by adding endianness handling to all conversion functions that process multi-byte pixel values. Note that the conversion to RGB565 is special, as there are two versions: with and without byteswapping of the RGB565 pixel data. Signed-off-by: Geert Uytterhoeven Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/33f390d3bae2c5a45c0050097dc95f2e17644f2f.1657300532.git.geert@linux-m68k.org commit 14e7157afb055248ed34901fcd6fbf54201cfea1 Author: Liang He Date: Tue Jul 19 14:54:47 2022 +0800 drm/bridge: tc358767: Add of_node_put() when breaking out of loop In tc_probe_bridge_endpoint(), we should call of_node_put() when breaking out of the for_each_endpoint_of_node() which will automatically increase and decrease the refcount. Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT") Signed-off-by: Liang He Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220719065447.1080817-2-windhl@126.com commit 1d43a5120ab49f22ba6c5901ad3994e254510303 Author: Liang He Date: Tue Jul 19 14:54:46 2022 +0800 drm/bridge: anx7625: Fix refcount bug in anx7625_parse_dt() In anx7625_parse_dt(), 'pdata->mipi_host_node' will be assigned a new reference with of_graph_get_remote_node() which will increase the refcount of the object, correspondingly, we should call of_node_put() for the old reference stored in the 'pdata->mipi_host_node'. Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP") Signed-off-by: Liang He Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220719065447.1080817-1-windhl@126.com commit 8f48dbd6deaf5a14c924c1de08bf7e36526bf3e7 Author: Christophe JAILLET Date: Sat Jun 18 17:26:08 2022 +0200 drm/bochs: Fix some error handling paths in bochs_pci_probe() The remove() function calls bochs_hw_fini() but this function is not called in the error handling of the probe. This call releases the resources allocated by bochs_hw_init() used in bochs_load(). Update the probe and bochs_load() to call bochs_hw_fini() if an error occurs after a successful bochs_hw_init() call. Signed-off-by: Christophe JAILLET Link: http://patchwork.freedesktop.org/patch/msgid/0e676e4d56ab5b10fcf22860081414445611dfa7.1655565953.git.christophe.jaillet@wanadoo.fr Signed-off-by: Gerd Hoffmann commit 90caf42527a40d09e0eed9fcbca08d757f4fd493 Author: Danilo Krummrich Date: Thu Jul 14 15:00:28 2022 +0200 drm/virtio: kms: use drm managed resources Allocate driver structures with drm managed resource allocators in order to cleanup/simplify the drm driver .release callback. Signed-off-by: Danilo Krummrich Link: http://patchwork.freedesktop.org/patch/msgid/20220714130028.2127858-3-dakr@redhat.com Signed-off-by: Gerd Hoffmann commit 7847628862a808ff3802df96f54e5eab3ff448b6 Author: Danilo Krummrich Date: Thu Jul 14 15:00:27 2022 +0200 drm/virtio: plane: use drm managed resources Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to cleanup/simplify drm plane .destroy callback. Signed-off-by: Danilo Krummrich Link: http://patchwork.freedesktop.org/patch/msgid/20220714130028.2127858-2-dakr@redhat.com Signed-off-by: Gerd Hoffmann commit 4c703f5d6f776eaa6a98611c9b5dfe800fbeb0c8 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:26 2022 +0300 drm/virtio: Return proper error codes instead of -1 Don't return -1 in error cases, return proper error code. The returned error codes propagate to error messages and to userspace and it's always good to have a meaningful error number for debugging purposes. Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-10-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit a9d2e8b5f1e5caa3cb038d7bb7bab530bcce5af1 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:25 2022 +0300 drm/virtio: Use dev_is_pci() Use common dev_is_pci() helper to replace the strcmp("pci") used by driver. Suggested-by: Robin Murphy Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-9-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit b5c9ed70d1a94c59dad7b1ecfc928863c0fe6ac0 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:24 2022 +0300 drm/virtio: Improve DMA API usage for shmem BOs DRM API requires the DRM's driver to be backed with the device that can be used for generic DMA operations. The VirtIO-GPU device can't perform DMA operations if it uses PCI transport because PCI device driver creates a virtual VirtIO-GPU device that isn't associated with the PCI. Use PCI's GPU device for the DRM's device instead of the VirtIO-GPU device and drop DMA-related hacks from the VirtIO-GPU driver. Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-8-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit e7fef092330321ff311e8c06338ce1b4b608ba05 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:23 2022 +0300 drm/virtio: Simplify error handling of virtio_gpu_object_create() Change the order of SHMEM initialization and reservation locking to make code cleaner and to prepare for transitioning of the common GEM SHMEM code to use the GEM's reservation lock instead of the shmem.page_lock. There is no need to lock reservation during allocation of the SHMEM pages because the lock is needed only to avoid racing with the async host-side allocation. Hence we can safely move the SHMEM initialization out of the reservation lock. Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-7-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit 4656b3a26a9e9fe5f04bfd2ab55b066266ba7f4d Author: Dmitry Osipenko Date: Thu Jun 30 23:07:22 2022 +0300 drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Make virtio_gpu_plane_cleanup_fb() to clean the state which DRM core wants to clean up and not the current plane's state. Normally the older atomic state is cleaned up, but the newer state could also be cleaned up in case of aborted commits. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-6-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit 0f877398d30e1df657a31a62f7c7de1869b072b5 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:21 2022 +0300 drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Unlock reservations on dma_resv_reserve_fences() error to fix recursive locking of the reservations when this error happens. Cc: stable@vger.kernel.org Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4") Reviewed-by: Thomas Hellström Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-5-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit fdf0ff4d12cbcd76b53f27c96ce51ddca400884a Author: Dmitry Osipenko Date: Thu Jun 30 23:07:20 2022 +0300 drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error Unlock reservations in the error code path of virtio_gpu_object_create() to silence debug warning splat produced by ww_mutex_destroy(&obj->lock) when GEM is released with the held lock. Cc: stable@vger.kernel.org Fixes: 30172efbfb84 ("drm/virtio: blob prep: refactor getting pages and attaching backing") Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-4-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit e473216b42aa1fd9fc6b94b608b42c210c655908 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:19 2022 +0300 drm/virtio: Check whether transferred 2D BO is shmem Transferred 2D BO always must be a shmem BO. Add check for that to prevent NULL dereference if userspace passes a VRAM BO. Cc: stable@vger.kernel.org Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-3-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit 64b88afbd92fbf434759d1896a7cf705e1c00e79 Author: Dmitry Osipenko Date: Thu Jun 30 23:07:18 2022 +0300 drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling Previous commit fixed checking of the ERR_PTR value returned by drm_gem_shmem_get_sg_table(), but it missed to zero out the shmem->pages, which will crash virtio_gpu_cleanup_object(). Add the missing zeroing of the shmem->pages. Fixes: c24968734abf ("drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init") Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-2-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann commit 15fced5b051e6e22c228a521a5894b12c2ba0892 Author: Thomas Zimmermann Date: Mon Jul 18 09:23:22 2022 +0200 fbdev: Remove conflict-handling code Remove the call to do_remove_conflicting_framebuffers() from the framebuffer registration. Aperture helpers take care of removing conflicting devices. With all ownership information stored in the aperture datastrcutures, remove remove_conflicting_framebuffers() entirely. This change also rectifies DRM generic-framebuffer registration, which tried to unregister conflicting framebuffers, even though it's entirely build on top of DRM. v2: * remove internal aperture-overlap helpers, which are now unused Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-12-tzimmermann@suse.de commit 72a6a3e03bdc957996a74c1053eab1b2c073db8e Author: Thomas Zimmermann Date: Mon Jul 18 09:23:21 2022 +0200 fbdev: Acquire framebuffer apertures for firmware devices When registering a generic framebuffer, automatically acquire ownership of the framebuffer's I/O range. The device will now be handled by the aperture helpers. Fbdev-based conflict handling is no longer required. v2: * use fb_ prefix instead of fbm_ (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-11-tzimmermann@suse.de commit 482b1c7d478875508ac112c36dcd65739f664b0e Author: Thomas Zimmermann Date: Mon Jul 18 09:23:20 2022 +0200 video/aperture: Remove conflicting VGA devices, if any On the primary graphics adapter, a driver might conflict with a VGA driver that controls the VGA framebuffer I/O range. Remove the VGA driver from the aperture helpers. Until now, this case has been hendled by fbdev, but it should work even with fbdev disabled. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-10-tzimmermann@suse.de commit 4652905f4e30ab7b4827faa38343fdafa90f2956 Author: Thomas Zimmermann Date: Mon Jul 18 09:23:19 2022 +0200 video: Provide constants for VGA I/O range Provide VGA_FB_ constants for the VGA framebuffer I/O range and convert fbdev code. In the case of vga16fb, this is a rename of the existing constants VGA_FB_PHYS and VGA_FB_PHYS_LEN. v2: * clarify relationship with old constants in vga16fb (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-9-tzimmermann@suse.de commit 5e01376124309b4dbd30d413f43c0d9c2f60edea Author: Thomas Zimmermann Date: Mon Jul 18 09:23:18 2022 +0200 video/aperture: Disable and unregister sysfb devices via aperture helpers Call sysfb_disable() before removing conflicting devices in aperture helpers. Fixes sysfb state if fbdev has been disabled. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Fixes: fb84efa28a48 ("drm/aperture: Run fbdev removal before internal helpers") Cc: Zack Rusin Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Daniel Vetter Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Helge Deller Cc: Alex Deucher Cc: Zhen Lei Cc: Changcheng Deng Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-8-tzimmermann@suse.de commit 145eed48de278007f646b908fd70ac59d24ed81a Author: Thomas Zimmermann Date: Mon Jul 18 09:23:17 2022 +0200 fbdev: Remove conflicting devices on PCI bus Remove firmware devices on the PCI bus, by calling aperture_remove_conflicting_pci_devices() in the probe function of each related fbdev driver. iSo far, most of these drivers did not remove conflicting VESA or EFI devices, or outride failed for resource conflicts (i.e., matroxfb.) This must have been broken for quite some time. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-7-tzimmermann@suse.de commit 8d69d008f44cb96050c35e64fe940a22dd6b0113 Author: Thomas Zimmermann Date: Mon Jul 18 09:23:16 2022 +0200 fbdev: Convert drivers to aperture helpers Convert fbdev drivers from fbdev's remove_conflicting_framebuffers() to the framework-independent aperture_remove_conflicting_devices(). Calling this function will also remove conflicting DRM drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-6-tzimmermann@suse.de commit 9d69ef1838150c7d87afc1a87aa658c637217585 Author: Thomas Zimmermann Date: Mon Jul 18 09:23:15 2022 +0200 fbdev/core: Remove remove_conflicting_pci_framebuffers() Remove remove_conflicting_pci_framebuffers() and implement similar functionality in aperture_remove_conflicting_pci_device(), which was the only caller. Removes an otherwise unused interface and streamlines the aperture helper. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-5-tzimmermann@suse.de commit 8a611e08257afb9ab5814d5c19239bf40e5030f4 Author: Thomas Zimmermann Date: Mon Jul 18 09:23:14 2022 +0200 fbdev/vga16fb: Auto-generate module init/exit code Move vgag16fb's option parsing into the driver's probe function and generate the rest of the module's init/exit functions from macros. Keep the options code, although there are no options defined. v2: * no options are supported, remove the code (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-4-tzimmermann@suse.de commit 0db5b61e0dc07cee121e5a04932ca7f5d0b62f6a Author: Thomas Zimmermann Date: Mon Jul 18 09:23:13 2022 +0200 fbdev/vga16fb: Create EGA/VGA devices in sysfb code Move the device-creation from vga16fb to sysfb code. The driver's videomode checks are independent from device creation, so move them into vga16fb's probe function. This will allow to create the module init/exit code automatically. The vga16fb driver requires a screen_info for type VIDEO_TYPE_VGAC or VIDEO_TYPE_EGAC. Such code is nowhere present in the kernel, except for some MIPS systems. It's not clear if the vga16fb driver actually works in practice. v2: * keep driver name to "vga16fb" (Javier) * give rational for moving mode checks (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-3-tzimmermann@suse.de commit 729d6872097ffc53216430e33bc61e91c421f52b Author: Thomas Zimmermann Date: Mon Jul 18 09:23:12 2022 +0200 fbdev: Remove trailing whitespaces Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-2-tzimmermann@suse.de commit fdff0a852ec8b8ddba6fc193f187d5d85717ab2e Author: Ashutosh Dixit Date: Mon Jul 18 18:07:08 2022 -0700 drm/i915/gt: Expose per-gt RPS defaults in sysfs Add the following sysfs files to gt/gtN/.defaults/: * rps_min_freq_mhz * rps_max_freq_mhz v2: Correct gt/gtN/.defaults/* file names in commit message v3: Remove rps_boost_freq_mhz since it is not consumed by userspace Cc: Tvrtko Ursulin Cc: Andi Shyti Signed-off-by: Ashutosh Dixit Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/cf6e483bf79f871c2c8c74af6005bf6a83a3a1ce.1658192398.git.ashutosh.dixit@intel.com commit 5dca122f8388695b1048a48a69d3cf9210036d9a Author: Ashutosh Dixit Date: Mon Jul 18 18:07:07 2022 -0700 drm/i915/gt: Create gt/gtN/.defaults/ for per gt sysfs defaults Create a gt/gtN/.defaults/ directory (similar to engine//.defaults/) to expose default parameter values for each gt in sysfs. This allows userspace to restore default parameter values after they have changed. The empty 'struct gt_defaults' will be populated by subsequent patches. v2: Changed 'struct intel_rps_defaults rps_defaults' to 'struct gt_defaults defaults' (Andi) Cc: Tvrtko Ursulin Cc: Andi Shyti Signed-off-by: Ashutosh Dixit Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/be7c30d0ae58be9d8d5b8242ba00a1b2825e63ad.1658192398.git.ashutosh.dixit@intel.com commit 42542c7904cf2e6fb795dc7ffd1903ab7d6e53fb Author: Marek Vasut Date: Sun Jul 10 21:44:37 2022 +0200 drm/panel/panel-sitronix-st7701: Split GIP and init sequences The ST7701 initialization sequence is well parametrized, split the GIP programming sequence, which is fully custom completely undocumented TFT matrix specific magic register programming sequence into separate callback so other TFT matrix definitions can add their own GIP sequence. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-9-marex@denx.de commit 83b7a8e7e88e7a201facc9c33833330485f5ec12 Author: Marek Vasut Date: Sun Jul 10 21:44:36 2022 +0200 drm/panel/panel-sitronix-st7701: Parametrize voltage and timing Instead of hard-coding TFT matrix voltage and timing settings, which can even lead to permanent TFT matrix damage, parametrize them in TFT matrix descriptor. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-8-marex@denx.de commit de2b4917843cd433d0f1c279123f75801dcd0c1e Author: Marek Vasut Date: Sun Jul 10 21:44:35 2022 +0200 drm/panel/panel-sitronix-st7701: Infer horizontal pixel count from TFT mode The horizontal pixel count is a property of the TFT matrix. Currently the driver hard-codes content of this register to specific value which is only compatible with one TFT matrix, likely the TS8550B one. Calculate the horizontal pixel count from the mode instead. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-7-marex@denx.de commit 82f9cee25598a1cb06529df8e7e1f86f61e786e9 Author: Marek Vasut Date: Sun Jul 10 21:44:34 2022 +0200 drm/panel/panel-sitronix-st7701: Adjust porch control bitfield name Define DSI_CMD2_BK0_PORCTRL_VBP_MASK and DSI_CMD2_BK0_PORCTRL_VFP_MASK and move the vertical back and front porch calculation from macros into the st7701_init_sequence() function, so it is clear what this does. No functional change. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-6-marex@denx.de commit 1ba85119afb5e45c699bf074dcdc894bfbf1c614 Author: Marek Vasut Date: Sun Jul 10 21:44:33 2022 +0200 drm/panel/panel-sitronix-st7701: Infer vertical line count from TFT mode The vertical line count is a property of the TFT matrix. Currently the driver hard-codes content of this register to specific value which is only compatible with one TFT matrix, likely the TS8550B one. Calculate the vertical line count from the mode instead. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-5-marex@denx.de commit 779c84fea3dbd658d3c4b72937732193cb01bf15 Author: Marek Vasut Date: Sun Jul 10 21:44:32 2022 +0200 drm/panel/panel-sitronix-st7701: Make gamma correction TFT specific The gamma correction values are specific to the TFT which is attached to the ST7701 TFT matrix driver, move the gamma correction values from what incorrectly looks like common init sequence into TFT matrix specific settings. While doing so, add macros which defined fields within the gamma register file and a macro which mimics FIELD_PREP except works with constant expressions. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-4-marex@denx.de commit 7fa8e07128ed660c97c4a8fe615967e654b84f32 Author: Marek Vasut Date: Sun Jul 10 21:44:31 2022 +0200 drm/panel/panel-sitronix-st7701: Make voltage supplies common to ST7701 The ST7701 and ST7701S all have two voltage supplies, one for internal logic and one for the TFT matrix driver. The supplies are not property of the TFT matrix driver, so move them to common ST7701 code. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-3-marex@denx.de commit a6c225be3da7edec46f96781ae07a873b2fbaa17 Author: Marek Vasut Date: Sun Jul 10 21:44:30 2022 +0200 drm/panel/panel-sitronix-st7701: Enable DSI burst mode, LPM, non-continuous clock The ST7701(S) is capable of DSI burst mode, which is more energy efficient than the non-burst modes. Make use of it. The ST7701(S) is capable of DSI non-continuous clock, since it sources the TFT matrix driver clock from internal clock source. The DSI non-continuous clock further reduce power utilization. The ST7701(S) uses DSI LPM for command transmissions, make sure this is configured correctly in the DSI mode flags. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-2-marex@denx.de commit 6f481afe220d36ad7790526a2164d7fd3d5b0487 Author: Marek Vasut Date: Sun Jul 10 21:44:29 2022 +0200 drm/panel/panel-sitronix-st7701: Make DSI mode flags common to ST7701 The ST7701 and ST7701S are TFT matrix drivers with integrated multi protocol decoder capable of DSI/DPI/SPI input and 480x360...864 line TFT matrix output. Currently the only supported input is DSI. The protocol decoder is separate from the TFT matrix driver and is always capable of handling all of DSI non-burst mode with sync pulses or sync events as well as DSI burst mode. Move the DSI mode configuration from TFT matrix driver properties to common ST7701 code, because this is common to all TFT matrices. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding Reviewed-by: Linus Walleij Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220710194437.289042-1-marex@denx.de commit 9899834ae5f26649da09e0cae72d8d9eb8a07aab Author: Swati Sharma Date: Wed Jul 6 15:52:40 2022 +0530 drm/i915/display: Add debug print for scaler filter Add debug print statement to print scaler filter property value. Since property can be set as either default or integer scaler; its good if we can get debug print for the same in dmesg log. Cc: Juha-Pekka Heikkila Signed-off-by: Swati Sharma Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220706102240.21414-1-swati2.sharma@intel.com commit 3475b50873e4a68302822d91ab5cb031c1a92d50 Author: shaomin Deng Date: Mon Jul 18 11:04:18 2022 -0400 drm:remove rebundant word "in" in comments there is a repeated word "in", so remove it. Signed-off-by: shaomin Deng Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220718150418.7321-1-dengshaomin@cdjrlc.com commit 71eed8a9ba8609e9c97171525c28846b9bde9a4f Author: shaomin Deng Date: Mon Jul 18 11:11:54 2022 -0400 drm:delete the repeated word "the" in comments remove the rebundant word "the" from comments. Signed-off-by: shaomin Deng Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220718151154.9628-1-dengshaomin@cdjrlc.com commit 79c87b8f8ba7e5706aa5cb2601635b468820e911 Author: Jason Wang Date: Fri Jul 15 13:41:56 2022 +0800 ipmi: Fix comment typo The double `the' is duplicated in line 4360, remove one. Signed-off-by: Jason Wang Message-Id: <20220715054156.6342-1-wangborong@cdjrlc.com> Signed-off-by: Corey Minyard commit dfef1acc36d56d947a69ff57bf03fa0a0f276b7c Author: Tomer Maimon Date: Sun Jul 17 15:11:24 2022 +0300 char: ipmi: modify NPCM KCS configuration Modify NPCM IPMI KCS configuration to support all NPCM BMC SoC. Signed-off-by: Tomer Maimon Message-Id: <20220717121124.154734-3-tmaimon77@gmail.com> Signed-off-by: Corey Minyard commit 84261749e58a13e3287f948b61e6e453cca8ae9b Author: Tomer Maimon Date: Sun Jul 17 15:11:23 2022 +0300 dt-bindings: ipmi: Add npcm845 compatible Add a compatible string for Nuvoton BMC NPCM845 KCS and modify NPCM KCS description to support all NPCM BMC SoC. Signed-off-by: Tomer Maimon Message-Id: <20220717121124.154734-2-tmaimon77@gmail.com> Acked-by: Krzysztof Kozlowski Signed-off-by: Corey Minyard commit 0b8613a21d9c52ccde18264b69de9f46faa362df Author: Christian König Date: Tue Jul 12 14:59:36 2022 +0200 dma-buf/dma_resv_usage: update explicit sync documentation Make it clear that DMA_RESV_USAGE_BOOKKEEP can be used for explicit synced user space submissions as well and document the rules around adding the same fence with different usages. Signed-off-by: Christian König Reviewed-by: Bas Nieuwenhuizen Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220712131201.131475-1-christian.koenig@amd.com commit 2b066860a4f855babd2a22f98364ff6546d85f88 Author: shaomin Deng Date: Mon Jul 18 10:55:36 2022 -0400 drm/mgag200:remove rebundant word "or" in comments there is a repeated word "or" in comments, so remove it. Signed-off-by: shaomin Deng Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220718145536.4866-1-dengshaomin@cdjrlc.com commit a7c01fa93aeb03ab76cd3cb2107990dd160498e6 Author: Jason A. Donenfeld Date: Tue Jul 12 01:21:23 2022 +0200 signal: break out of wait loops on kthread_stop() I was recently surprised to learn that msleep_interruptible(), wait_for_completion_interruptible_timeout(), and related functions simply hung when I called kthread_stop() on kthreads using them. The solution to fixing the case with msleep_interruptible() was more simply to move to schedule_timeout_interruptible(). Why? The reason is that msleep_interruptible(), and many functions just like it, has a loop like this: while (timeout && !signal_pending(current)) timeout = schedule_timeout_interruptible(timeout); The call to kthread_stop() woke up the thread, so schedule_timeout_ interruptible() returned early, but because signal_pending() returned true, it went back into another timeout, which was never woken up. This wait loop pattern is common to various pieces of code, and I suspect that the subtle misuse in a kthread that caused a deadlock in the code I looked at last week is also found elsewhere. So this commit causes signal_pending() to return true when kthread_stop() is called, by setting TIF_NOTIFY_SIGNAL. The same also probably applies to the similar kthread_park() functionality, but that can be addressed later, as its semantics are slightly different. Cc: Eric W. Biederman Signed-off-by: Jason A. Donenfeld v1: https://lkml.kernel.org/r/20220627120020.608117-1-Jason@zx2c4.com v2: https://lkml.kernel.org/r/20220627145716.641185-1-Jason@zx2c4.com v3: https://lkml.kernel.org/r/20220628161441.892925-1-Jason@zx2c4.com v4: https://lkml.kernel.org/r/20220711202136.64458-1-Jason@zx2c4.com v5: https://lkml.kernel.org/r/20220711232123.136330-1-Jason@zx2c4.com Signed-off-by: Eric W. Biederman commit 031a2fea0482965175ad20adea44bdfe6ed817aa Author: José Roberto de Souza Date: Thu Jul 14 08:07:55 2022 -0700 drm/i915/psr: Disable PSR before disable pipe The issue here was on for_each_intel_encoder_mask_with_psr() over the new_crtc_state encoder mask, so if the CRTC was being disabled mask would be zero and it would not have any chance to disable PSR. So here doing for_each_intel_encoder_mask_with_psr() over the old_crtc_state encoder mask and then using the new_crtc_state to check if PSR needs to be disabled. Cc: Jouni Högander Cc: Stanislav Lisovskiy Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220714150755.154985-2-jose.souza@intel.com commit ad444123a4a1d2944bd72fc877af9aabef01b889 Author: José Roberto de Souza Date: Thu Jul 14 08:07:54 2022 -0700 Revert "drm/i915/display: Ensure PSR gets disabled if no encoders in new state" This patches fixes a issue but not in the right way as for_each_oldnew_intel_crtc_in_state() will interate over all CRTCs not only the crtc passed as parameter, also this two for_each loops are not necessary and only make code harder to understand. Proper fix will be discussed in the next patch. This reverts commit 75f664903d8672897333b86bb450335ec6486ad5. Cc: Jouni Högander Cc: Stanislav Lisovskiy Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220714150755.154985-1-jose.souza@intel.com commit c19491894d4baf2155387e48aa326e1b52d7b986 Author: Imre Deak Date: Fri Jun 17 14:28:07 2022 +0300 drm/i915/tgl+: Fix HDMI transcoder clock vs. DDI BUF disabling order Starting with TGL the disabling order of HDMI transcoder clock vs. DDI BUF has swapped, fix this. There hasn't been any issues seen related to this, but let's follow the spec. Reported-by: Sandeep K Lakkakula Signed-off-by: Imre Deak Reviewed-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20220617112807.1586621-1-imre.deak@intel.com commit 1a217205bd2643272e32ec38926250aa6c29a854 Author: allen chen Date: Fri Jul 15 10:49:07 2022 +0800 drm/bridge: it6505: Modified video clock calculation and video debug message Speed up video clock calculation and remove redundant video debug message. Signed-off-by: Pin-Yen Lin Signed-off-by: Allen Chen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220715024910.12578-4-allen.chen@ite.com.tw commit 86088f88a25c76baac304b6f887e5da2c30c4e07 Author: allen chen Date: Fri Jul 15 10:49:06 2022 +0800 drm/bridge: it6505: Add i2c api power on check Use i2c bus to read/write when it6505 power off will occur i2c error. Add this check will prevent i2c error when it6505 power off. Signed-off-by: Pin-Yen Lin Signed-off-by: Allen Chen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220715024910.12578-3-allen.chen@ite.com.tw commit 899e90cf20a9d0eaec8cbc8e1ca1d05278afb6d7 Author: allen chen Date: Fri Jul 15 10:49:05 2022 +0800 drm/bridge: it6505: Modified power sequence Change power sequence to meet it6505 data sheet requirement when boot on. Signed-off-by: Pin-Yen Lin Signed-off-by: Allen Chen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220715024910.12578-2-allen.chen@ite.com.tw commit fbc1fdaa8338ec4ebd862d918a0ce3e12033e8a3 Author: Pin-Yen Lin Date: Thu Jul 14 17:39:20 2022 +0800 drm/bridge: it6505: Power on downstream device in .atomic_enable Send DPCD DP_SET_POWER_D0 command to the monitor in .atomic_enable callback. Without this command, some monitors won't show up again after changing the resolution. Fixes: 46ca7da7f1e8 ("drm/bridge: it6505: Send DPCD SET_POWER to downstream") Signed-off-by: Pin-Yen Lin Reviewed-by: Allen Chen Fixes: 46ca7da7f1e8 ("drm/bridge: it6505: Send DPCD SET_POWER to downstream") Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220714173715.v2.1.I85af54e9ceda74ec69f661852825845f983fc343@changeid commit 6fc20a8592f569395aadc9fd97336facdee84f0d Author: Javier Martinez Canillas Date: Sat Jun 18 19:43:38 2022 +0200 drm/ssd130x: Use new regmap bulk write support to drop custom bus Data writes for the ssd130x 4-wire SPI protocol need special handling, due the Data/Command control (D/C) pin having to be toggled prior to the write. The regmap API only allowed drivers to provide .reg_{read,write} callbacks to do per register read/write, but didn't provide a way for drivers to do the same for bulk read/writes. For this reason, a custom regmap bus was used by the driver just to define a bulk write callback that implements the D/C pin toggling. But the regmap API has been extended to support defining bulk read/write handlers, so the custom regmap bus is not needed anymore and could just be dropped. Signed-off-by: Javier Martinez Canillas Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220618174338.2253021-1-javierm@redhat.com commit 53618649ca6ded3222b24e8d25a09be30a197577 Author: Laurent Pinchart Date: Thu Jun 16 21:52:10 2022 +0300 drm/fourcc: Add formats for packed YUV 4:4:4 AVUY and XVUY permutations Add FourCCs for two missing permutations of the packed YUV 4:4:4 color components, namely AVUY and XVUY. These formats are needed by the NXP i.MX8 ISI. While the ISI is supported by a V4L2 device (corresponding formats have been submitted to V4L2), it is handled in userspace by libcamera, which uses DRM FourCCs for pixel formats. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Vetter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220616185210.22018-1-laurent.pinchart@ideasonboard.com commit 5f9cfd8243ee6f69e0d82519bae463e81411f439 Author: Sam Ravnborg Date: Wed Jul 13 19:02:02 2022 +0200 drm/via: Fix style issues in via_3d_reg header - Fix comments using wrong style - Drop repeated word This fixes all checkpatch complains and makes the file a little bit easier to read - as the eye is not distracted by the style violations. Suggested-by: Thomas Zimmermann Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-14-sam@ravnborg.org commit 3579ca95759e40f3868ad5a75b4c34710858ad2b Author: Sam Ravnborg Date: Wed Jul 13 19:02:01 2022 +0200 drm/via: Make macros readable in the via_3d_reg header The macros for texture 1 setting all used continuation on a new line, resulting in a highly ureadable definition. Merge the lines so they are each on a single line. As a nice side-effect this fixes a number of checkpatch warnings: "WARNING: please, no spaces at the start of a line". Suggested-by: Thomas Zimmermann Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-13-sam@ravnborg.org commit e1df7580bb2947a2fcff80d4342eb4ededbf4873 Author: Sam Ravnborg Date: Wed Jul 13 19:02:00 2022 +0200 drm/via: Use SPDX tag for MIT license in via_3d_reg header The license for the via_3d_reg header is MIT - so use the shorter SPDX tag to identify the license. Suggested-by: Thomas Zimmermann Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-12-sam@ravnborg.org commit e0a49c786766ebb804592e536dab2eb97da5533f Author: Sam Ravnborg Date: Wed Jul 13 19:01:59 2022 +0200 drm/via: Update to the latest via_3d_reg header Updated the 3d_reg header file to match what is used by the openchrome driver. This verifies that the two drivers can use the same header file. The file is a verbatim copy from the openchrome repo - a few style issues will be fixed in following commits. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-11-sam@ravnborg.org commit 685bf9f58dd9624af93d9e20e7d5353b06966a7e Author: Sam Ravnborg Date: Wed Jul 13 19:01:58 2022 +0200 drm/via: Embed via_drv.h in via_dri1 With this change the driver is now a signle file driver. The only remaning heder file describes the HW and can be shared with the new openchrome driver. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-10-sam@ravnborg.org commit 8f8ed7f8384f71f841bc70cbdbc2dbeeb7f4bcd5 Author: Sam Ravnborg Date: Wed Jul 13 19:01:57 2022 +0200 drm/via: Embed via_verifier in via_dri1 Embed the header file in via_drv.h and the code in via_dri1. All functions are made static as there are no more external users. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-9-sam@ravnborg.org commit f99995a4d79b630d39541b1b053f4102f8594caf Author: Sam Ravnborg Date: Wed Jul 13 19:01:56 2022 +0200 drm/via: Embed via_dmablit in via_dri1 Embed some of the header file in via_drv.h and the rest in via_dri1.c While embedding deleted extra empty lines and functions that has no external users are made static. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-8-sam@ravnborg.org commit b0b3a879258ef43cf15b0bac30b92e7c1c4ebbae Author: Sam Ravnborg Date: Wed Jul 13 19:01:55 2022 +0200 drm/via: Embed via_irq in via_dri1 All functions are made static as there are no more external users. The file had new copyrights that are kept. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-7-sam@ravnborg.org commit e85e4ae0157193703ec8d3ca95c669ddeb2023ee Author: Sam Ravnborg Date: Wed Jul 13 19:01:54 2022 +0200 drm/via: Embed via_video in via_dri1 All functions are made static as there are no more external users. The file had a new copyright that is kept. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-6-sam@ravnborg.org commit 67034c8e004982764dd5b5df3d57a4179902f60d Author: Sam Ravnborg Date: Wed Jul 13 19:01:53 2022 +0200 drm/via: Embed via_mm in via_dri1 All functions was made static as there are no external users. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-5-sam@ravnborg.org commit fa0cc3ca1df89e96c20c2aa229363bfc1670068b Author: Sam Ravnborg Date: Wed Jul 13 19:01:52 2022 +0200 drm/via: Embed via_map in via_dri1 A few functions has no external use and are made static. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-4-sam@ravnborg.org commit 9a4537a7824f6011f628bffdfb57ec0bdc83da39 Author: Sam Ravnborg Date: Wed Jul 13 19:01:51 2022 +0200 drm/via: Embed via_dma in via_dri1 Moved the copyright notices so all copyrights are kept. A few variables was made static as there are no more users outside this file. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-3-sam@ravnborg.org commit e6d9767faf378e543b064ff204d77753451930df Author: Sam Ravnborg Date: Wed Jul 13 19:01:50 2022 +0200 drm/via: Rename via_drv to via_dri1 The via driver implements the DRI1 interface, and we have a new implementation of the via driver coming that supports atomic modesetting. It is not acceptable just to replace the existing driver so this is first step to make it a single-file implementation allowing it to stay without interfering with the new driver. Signed-off-by: Sam Ravnborg Acked-by: Thomas Zimmermann Cc: Kevin Brace Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-2-sam@ravnborg.org commit bd8408e69a47f8e9f5d95c5d919413fafecc1e73 Author: Tom Rix Date: Sat Jul 2 11:39:04 2022 -0400 drm/nouveau/bios: set info only when the return is not 0 clang static analysis reports drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c:68:17: warning: The right operand of '*' is a garbage value [core.UndefinedBinaryOperatorResult] switch (!!data * *ver) { ^ ~~~~ A switch statement with only a default should be reduced to an if. If nvbios_pmuEp() returns 0, via the data variable, the output info parameter is not used. So set info only when data is not 0. The struct nvbios_pmuE only has the type and data elements. Since both of these are explicitly set, memset is not needed. So remove it. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220702153904.1696595-1-trix@redhat.com commit 1dab4561a341afdbaafe0ce6091106d0c63c79e0 Author: Chris Wilson Date: Wed Jun 29 21:39:59 2022 -0700 drm/i915/reset: Handle reset timeouts under unrelated kernel hangs When resuming after hibernate sometimes we see hangs in unrelated kernel subsystems. These hangs often result in the following i915 trace: i915 0000:00:02.0: [drm] *ERROR* \ intel_gt_reset_global timed out, cancelling all in-flight rendering implying our reset task has been starved by the hanging kernel subsystem, causing us to inappropiately declare the system as wedged beyond recovery. The trace would be caused by our synchronize_srcu_expedited() taking more than the allowed 5s due to the unrelated kernel hang. But we neither need to perform that synchronisation inside the reset watchdog, nor do we need such a short timeout before declaring the device as unrecoverable. v2: Restore watchdog timeout to the previous 5 seconds (Ashutosh) Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/3575 Signed-off-by: Chris Wilson Signed-off-by: Ashutosh Dixit Reviewed-by: Ashutosh Dixit Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220630043959.5708-1-ashutosh.dixit@intel.com commit 59dad4a0d1862dcd15405f3217a59b1fac01daf0 Author: Christian König Date: Thu Jul 14 14:48:20 2022 +0200 drm/amdgpu: re-apply "move internal vram_mgr function into the C file"" This re-applys commit 708d19d9f362766147cab79eccae60912c6d3068. The original problem this was reverted for was found and the correct fix will be merged to drm-misc-next-fixes. Signed-off-by: Christian König Reviewed-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20220714132315.587217-2-christian.koenig@amd.com commit 55b3d6a63fb58e154f0a1ab3930cdd003a39ba9b Author: Christian König Date: Thu Jul 14 14:44:17 2022 +0200 drm/amdgpu: reapply "fix start calculation in amdgpu_vram_mgr_new"" This re-applys commit 5e3f1e7729ec7a99e145e9d8ed58963d86cdfb98. The original problem this was reverted for was found and the correct fix will be merged to drm-misc-next-fixes. Signed-off-by: Christian König Reviewed-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20220714132315.587217-1-christian.koenig@amd.com commit f6ee30407e883042482ad4ad30da5eaba47872ee Author: Javier Martinez Canillas Date: Tue Jul 5 12:02:14 2022 +0200 drm: Prevent drm_copy_field() to attempt copying a NULL pointer There are some struct drm_driver fields that are required by drivers since drm_copy_field() attempts to copy them to user-space via DRM_IOCTL_VERSION. But it can be possible that a driver has a bug and did not set some of the fields, which leads to drm_copy_field() attempting to copy a NULL pointer: [ +10.395966] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000 [ +0.010955] Mem abort info: [ +0.002835] ESR = 0x0000000096000004 [ +0.003872] EC = 0x25: DABT (current EL), IL = 32 bits [ +0.005395] SET = 0, FnV = 0 [ +0.003113] EA = 0, S1PTW = 0 [ +0.003182] FSC = 0x04: level 0 translation fault [ +0.004964] Data abort info: [ +0.002919] ISV = 0, ISS = 0x00000004 [ +0.003886] CM = 0, WnR = 0 [ +0.003040] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000115dad000 [ +0.006536] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000 [ +0.006925] Internal error: Oops: 96000004 [#1] SMP ... [ +0.011113] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ +0.007061] pc : __pi_strlen+0x14/0x150 [ +0.003895] lr : drm_copy_field+0x30/0x1a4 [ +0.004156] sp : ffff8000094b3a50 [ +0.003355] x29: ffff8000094b3a50 x28: ffff8000094b3b70 x27: 0000000000000040 [ +0.007242] x26: ffff443743c2ba00 x25: 0000000000000000 x24: 0000000000000040 [ +0.007243] x23: ffff443743c2ba00 x22: ffff8000094b3b70 x21: 0000000000000000 [ +0.007241] x20: 0000000000000000 x19: ffff8000094b3b90 x18: 0000000000000000 [ +0.007241] x17: 0000000000000000 x16: 0000000000000000 x15: 0000aaab14b9af40 [ +0.007241] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 [ +0.007239] x11: 0000000000000000 x10: 0000000000000000 x9 : ffffa524ad67d4d8 [ +0.007242] x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : 6c6e6263606e7141 [ +0.007239] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 [ +0.007241] x2 : 0000000000000000 x1 : ffff8000094b3b90 x0 : 0000000000000000 [ +0.007240] Call trace: [ +0.002475] __pi_strlen+0x14/0x150 [ +0.003537] drm_version+0x84/0xac [ +0.003448] drm_ioctl_kernel+0xa8/0x16c [ +0.003975] drm_ioctl+0x270/0x580 [ +0.003448] __arm64_sys_ioctl+0xb8/0xfc [ +0.003978] invoke_syscall+0x78/0x100 [ +0.003799] el0_svc_common.constprop.0+0x4c/0xf4 [ +0.004767] do_el0_svc+0x38/0x4c [ +0.003357] el0_svc+0x34/0x100 [ +0.003185] el0t_64_sync_handler+0x11c/0x150 [ +0.004418] el0t_64_sync+0x190/0x194 [ +0.003716] Code: 92402c04 b200c3e8 f13fc09f 5400088c (a9400c02) [ +0.006180] ---[ end trace 0000000000000000 ]--- Reported-by: Peter Robinson Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220705100215.572498-3-javierm@redhat.com commit 94dc3471d1b2b58b3728558d0e3f264e9ce6ff59 Author: Javier Martinez Canillas Date: Tue Jul 5 12:02:13 2022 +0200 drm: Use size_t type for len variable in drm_copy_field() The strlen() function returns a size_t which is an unsigned int on 32-bit arches and an unsigned long on 64-bit arches. But in the drm_copy_field() function, the strlen() return value is assigned to an 'int len' variable. Later, the len variable is passed as copy_from_user() third argument that is an unsigned long parameter as well. In theory, this can lead to an integer overflow via type conversion. Since the assignment happens to a signed int lvalue instead of a size_t lvalue. In practice though, that's unlikely since the values copied are set by DRM drivers and not controlled by userspace. But using a size_t for len is the correct thing to do anyways. Signed-off-by: Javier Martinez Canillas Tested-by: Peter Robinson Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220705100215.572498-2-javierm@redhat.com commit 53fc59511fc4c567342b2ef3f7b99a086430e0b4 Author: Andy Shevchenko Date: Tue Jun 7 18:37:50 2022 +0300 nvdimm/namespace: drop unneeded temporary variable in size_store() Refactor size_store() in order to remove temporary variable on stack by joining conditionals. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220607153750.33639-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dan Williams commit 36a40c37389c7a1bef3f1024c55c056304acf439 Author: Andy Shevchenko Date: Tue Jun 7 18:25:25 2022 +0300 nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid() Refactor nd_dev_to_uuid() in order to make code shorter and cleaner by joining conditions and hence returning uuid_null only once. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220607152525.33468-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dan Williams commit 887ddf3251928dc39bfc58c5c62083d38a633c14 Author: Maxime Ripard Date: Mon Jul 11 19:39:39 2022 +0200 drm/vc4: v3d: Switch to devm_pm_runtime_enable devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-70-maxime@cerno.tech commit 266cff37d7fcec0443e720878242cb52d728138b Author: Maxime Ripard Date: Mon Jul 11 19:39:38 2022 +0200 drm/vc4: v3d: Rework the runtime_pm setup At bind time, vc4_v3d_bind() will read a register to retrieve the v3d version and make sure it's a version we're compatible with. However, the v3d has an optional clock that is enabled only after the register read-out and a power domain that wasn't enabled at all in the bind implementation. This was working fine at boot because both were enabled, but resulted in the version check failing if we were unbinding and rebinding the driver because the unbinding would have turned them off. The fix isn't as easy as calling pm_runtime_resume_and_get() prior to the register access to power up the power domain though. Indeed, the runtime_resume implementation will enable the clock mentioned above, call vc4_v3d_init_hw() and then vc4_irq_enable(). Prior to the previous patch, vc4_irq_enable() needed to occur after our call to platform_get_irq() and vc4_irq_install(), since vc4_irq_enable() used to call enable_irq() and vc4_irq_install() will call request_irq(). vc4_irq_install() will also do some register access, so needs the power domain to be on. So we ended up in a situation where vc4_v3d_runtime_resume() needed vc4_irq_install() to have been called before, and vc4_irq_install() needed vc4_v3d_runtime_resume(). The previous patch removed the enable_irq() call in vc4_irq_enable() and thus removed the dependency of vc4_v3d_runtime_resume() on vc4_irq_install(). Thus, we can now rework our bind implementation to call pm_runtime_resume_and_get() before our register access to make sure the power domain is on. vc4_v3d_runtime_resume() also takes care of turning the clock on and calling vc4_v3d_init_hw() so we can remove them from bind. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-69-maxime@cerno.tech commit 9b6f461582e6b07e2ce93227a3e4661846e594ad Author: Maxime Ripard Date: Mon Jul 11 19:39:37 2022 +0200 drm/vc4: v3d: Stop disabling interrupts The vc4_irq_disable(), among other things, will call disable_irq() to complete any in-flight interrupts. This requires its counterpart, vc4_irq_enable(), to call enable_irq() which causes issues addressed in a later patch. However, vc4_irq_disable() is called by two callees: vc4_irq_uninstall() and vc4_v3d_runtime_suspend(). vc4_irq_uninstall() also calls free_irq() which already disables the interrupt line. We thus don't require an explicit disable_irq() for that call site. vc4_v3d_runtime_suspend() doesn't have any other code. However, the rest of vc4_irq_disable() masks the interrupts coming from the v3d, so explictly disabling the interrupt line is also redundant. The only thing we really care about is thus to make sure we don't have any handler in-flight, as suggested by the comment. We can thus replace disable_irq() by synchronize_irq(). Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-68-maxime@cerno.tech commit 57d68ee8f719efa05bcec64625a9898231ed43c5 Author: Maxime Ripard Date: Mon Jul 11 19:39:36 2022 +0200 drm/vc4: perfmon: Add missing mutex_destroy vc4_perfmon_open_file() will instantiate a mutex for that file instance, but we never call mutex_destroy () in vc4_perfmon_close_file(). Let's add that missing call. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-67-maxime@cerno.tech commit 374146cad469102b683939009f18fa88f9b9b6c9 Author: Maxime Ripard Date: Mon Jul 11 19:39:35 2022 +0200 drm/vc4: Switch to drmm_mutex_init mutex_init is supposed to be balanced by a call to mutex_destroy that we were never doing in the vc4 driver. Since a DRM-managed mutex_init variant has been introduced, let's just switch to it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-66-maxime@cerno.tech commit 445b287e18ca374b5498e0f7cecb6c5f673c4edb Author: Maxime Ripard Date: Mon Jul 11 19:39:34 2022 +0200 drm/vc4: debugfs: Simplify debugfs registration The vc4 has a custom API to allow components to register a debugfs file before the DRM driver has been registered and the debugfs_init hook has been called. However, the .late_register hook allows to have the debugfs file creation deferred after that time already. Let's remove our custom code to only register later our debugfs entries as part of either debugfs_init or after it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-65-maxime@cerno.tech commit fe3b0f784cc8bb208fada872c13e6bd694bb1669 Author: Maxime Ripard Date: Mon Jul 11 19:39:33 2022 +0200 drm/vc4: debugfs: Return an error on failure vc4_debugfs_add_file() can fail, so let's propagate its error code instead of silencing it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-64-maxime@cerno.tech commit be919b89b28e0fa3c4eff39dd96350bc7803f194 Author: Maxime Ripard Date: Mon Jul 11 19:39:32 2022 +0200 drm/vc4: debugfs: Protect device resources Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its file handle. So we end up with a time window during which we can call the encoder hooks, but we don't have access to the underlying resources and device. Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so that we bail out if we are during that window. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-63-maxime@cerno.tech commit 4e06fd9c7c8a2815c63ff132fd392d76e42436e9 Author: Maxime Ripard Date: Mon Jul 11 19:39:31 2022 +0200 drm/vc4: vec: Switch to devm_pm_runtime_enable devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-62-maxime@cerno.tech commit f0601ef8631ceeab10c7af69b248fc106e0ecf09 Author: Maxime Ripard Date: Mon Jul 11 19:39:30 2022 +0200 drm/vc4: vec: Protect device resources after removal Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources aren't there anymore, but the userspace can still call into our driver. Fortunately, the DRM framework provides the drm_dev_enter() and drm_dev_exit() functions to make sure our underlying device is still there for the section protected by those calls. Let's add them to the VEC driver. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-61-maxime@cerno.tech commit 881f6d945b34e5604003ba1cc85c9dfbb7e31af2 Author: Maxime Ripard Date: Mon Jul 11 19:39:29 2022 +0200 drm/vc4: vec: Switch to DRM-managed connector initialization The current code will call drm_connector_unregister() and drm_connector_cleanup() when the device is unbound. However, by then, there might still be some references held to that connector, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-60-maxime@cerno.tech commit c62f432f2ed97305f96d393c5e3756ca1cd3c1de Author: Maxime Ripard Date: Mon Jul 11 19:39:28 2022 +0200 drm/vc4: vec: Switch to DRM-managed encoder initialization The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-59-maxime@cerno.tech commit cd2444a7953972ed495b8c0e8f6202d6ad11fb0d Author: Maxime Ripard Date: Mon Jul 11 19:39:27 2022 +0200 drm/vc4: vec: Remove call to drm_connector_unregister() drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-58-maxime@cerno.tech commit fe7289e2184485c5dc51cc49a94e442d14d08255 Author: Maxime Ripard Date: Mon Jul 11 19:39:26 2022 +0200 drm/vc4: vec: Switch to drmm_kzalloc Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and component_unbind_all() is being run. However, it occurs while the DRM device is still registered, which will create dangling pointers, eventually resulting in use-after-free. Switch to a DRM-managed allocation to keep our structure until the DRM driver doesn't need it anymore. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-57-maxime@cerno.tech commit 9780315b068204bae921512154fefe84d321079e Author: Maxime Ripard Date: Mon Jul 11 19:39:25 2022 +0200 drm/vc4: vec: Embed DRM structures into the private structure The VC4 VEC driver private structure contains only a pointer to the encoder and connector it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through the vc4_encoder one) and drm_connector into struct vc4_vec to fix both issues. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-56-maxime@cerno.tech commit a0883e4df276b3ac9532d4de6fa7e1186cfa161c Author: Maxime Ripard Date: Mon Jul 11 19:39:24 2022 +0200 drm/vc4: vec: Remove vc4_dev vec pointer There's no user for that pointer so let's just get rid of it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-55-maxime@cerno.tech commit b7345c9799da578c150fde3072446e4049c39c41 Author: Maxime Ripard Date: Mon Jul 11 19:39:23 2022 +0200 drm/vc4: txp: Protect device resources Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its file handle. So we end up with a time window during which we can call the encoder hooks, but we don't have access to the underlying resources and device. Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so that we bail out if we are during that window. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-54-maxime@cerno.tech commit d67210bbe5f3ec53fa6a46fbaad87d7a65ab544c Author: Maxime Ripard Date: Mon Jul 11 19:39:22 2022 +0200 drm/vc4: txp: Remove call to drm_connector_unregister() drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-53-maxime@cerno.tech commit b0da34c7970f6a5f156fd8036fbb83c999903628 Author: Maxime Ripard Date: Mon Jul 11 19:39:21 2022 +0200 drm/vc4: txp: Switch to drmm_kzalloc Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and component_unbind_all() is being run. However, it occurs while the DRM device is still registered, which will create dangling pointers, eventually resulting in use-after-free. Switch to a DRM-managed allocation to keep our structure until the DRM driver doesn't need it anymore. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-52-maxime@cerno.tech commit 260ad78e9df95aa6154d85e7a9247aef28664854 Author: Maxime Ripard Date: Mon Jul 11 19:39:20 2022 +0200 drm/vc4: txp: Remove duplicate regset There's already a regset in the vc4_crtc structure so there's no need to duplicate it in vc4_txp. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-51-maxime@cerno.tech commit 121b1a5f47e5bcb6baafd2aea00761af2ca5ff36 Author: Maxime Ripard Date: Mon Jul 11 19:39:19 2022 +0200 drm/vc4: txp: Remove vc4_dev txp pointer There's no user for that pointer so let's just get rid of it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-50-maxime@cerno.tech commit 932d860f46722cd91a9d012c94b2d32013a8ea15 Author: Maxime Ripard Date: Mon Jul 11 19:39:18 2022 +0200 drm/vc4: hdmi: Switch to devm_pm_runtime_enable devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-49-maxime@cerno.tech commit cd00ed5187bff03d4c2ba143a5993383dd6ed66c Author: Maxime Ripard Date: Mon Jul 11 19:39:17 2022 +0200 drm/vc4: hdmi: Protect device resources after removal Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources aren't there anymore, but the userspace can still call into our driver. Fortunately, the DRM framework provides the drm_dev_enter() and drm_dev_exit() functions to make sure our underlying device is still there for the section protected by those calls. Let's add them to the HDMI driver. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-48-maxime@cerno.tech commit 0c9d0ddd9cf4b43f8b3faf752c5a1aaa665ed099 Author: Maxime Ripard Date: Mon Jul 11 19:39:16 2022 +0200 drm/vc4: hdmi: Move audio structure offset checks The HDMI driver unbind hook doesn't have any ALSA-related code anymore, so let's move the ALSA sanity checks and comments we have to some other part of the driver dedicated to ALSA. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-47-maxime@cerno.tech commit af8a3b125b682c4c582bb25342af4759d9b4a1e5 Author: Maxime Ripard Date: Mon Jul 11 19:39:15 2022 +0200 drm/vc4: hdmi: Use devm to register hotplug interrupts Commit 776efe800fed ("drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts") dropped the device-managed interrupt registration because it was creating bugs and races whenever an interrupt was coming in while the device was removed. However, our latest patches to the HDMI controller driver fix this as well, so we can use device-managed interrupt handlers again. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-46-maxime@cerno.tech commit a3dbb1c016576838a1591d2341641cb4067840e8 Author: Maxime Ripard Date: Mon Jul 11 19:39:14 2022 +0200 drm/vc4: hdmi: Switch to DRM-managed kfree to build regsets The current code to build the registers set later exposed in debugfs for the HDMI controller relies on traditional allocations, that are later free'd as part of the driver unbind hook. Since krealloc doesn't have a DRM-managed equivalent, let's add an action to free the buffer later on. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-45-maxime@cerno.tech commit d3a84242f897506509d1bb29b8e64166958fb991 Author: Maxime Ripard Date: Mon Jul 11 19:39:13 2022 +0200 drm/vc4: hdmi: Use a device-managed action for DDC The reference to the DDC controller device needs to be put back when we're done with it. Let's use a device-managed action to simplify the driver. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-44-maxime@cerno.tech commit 015653f7af7cb7fa56e9a88af2a15c814a39b6b4 Author: Maxime Ripard Date: Mon Jul 11 19:39:12 2022 +0200 drm/vc4: hdmi: Switch to device-managed CEC initialization The current code to unregister our CEC device needs to be undone manually when we remove the HDMI driver. Since the CEC framework will allocate its main structure, and will defer its deallocation to when the last user will have closed it, we don't really need to take any particular measure to prevent any use-after-free and can thus use any managed action. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-43-maxime@cerno.tech commit 59f9d46af43c884b92f690934263196387437c7e Author: Maxime Ripard Date: Mon Jul 11 19:39:11 2022 +0200 drm/vc4: hdmi: Switch to device-managed ALSA initialization The current code to unregister our ALSA device needs to be undone manually when we remove the HDMI driver. Since ALSA doesn't seem to support any mechanism to defer freeing something until the last user of the ALSA device is gone, we can either use a device-managed or a DRM-managed action. The consistent way would be to use a DRM-managed one, just like pretty much any framework-facing structure should be doing. However, ALSA does a lot of allocation and registration using device-managed calls. Thus, if we're going that way, by the time the DRM-managed action would run all of those allocation would have been freed and we would end up with a use-after-free. Thus, let's do a device-managed action. It's been tested with KASAN enabled and doesn't seem to trigger any issue, so it's as good as anything. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-42-maxime@cerno.tech commit 19d094c3a17d228381d4f1a25158a7b91b0e294f Author: Maxime Ripard Date: Mon Jul 11 19:39:10 2022 +0200 drm/vc4: hdmi: Switch to DRM-managed connector initialization The current code will call drm_connector_unregister() and drm_connector_cleanup() when the device is unbound. However, by then, there might still be some references held to that connector, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-41-maxime@cerno.tech commit 56924791cd5de99374a027cf00ce9b6e55d74203 Author: Maxime Ripard Date: Mon Jul 11 19:39:09 2022 +0200 drm/vc4: hdmi: Switch to DRM-managed encoder initialization The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-40-maxime@cerno.tech commit 7a951e3a26920ae424f563f63925bf478b37d00b Author: Maxime Ripard Date: Mon Jul 11 19:39:08 2022 +0200 drm/vc4: hdmi: Remove call to drm_connector_unregister() drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-39-maxime@cerno.tech commit b4f2c70c1a7a0a7708c9755a9946452ee23adeb6 Author: Maxime Ripard Date: Mon Jul 11 19:39:07 2022 +0200 drm/vc4: hdmi: Switch to drmm_kzalloc Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and component_unbind_all() is being run. However, it occurs while the DRM device is still registered, which will create dangling pointers, eventually resulting in use-after-free. Switch to a DRM-managed allocation to keep our structure until the DRM driver doesn't need it anymore. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-38-maxime@cerno.tech commit 7b44e4de72dcd5a5769ad19c5cc2cc2b28c0a778 Author: Maxime Ripard Date: Mon Jul 11 19:39:06 2022 +0200 drm/vc4: dsi: Switch to devm_pm_runtime_enable devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-37-maxime@cerno.tech commit 6eda15642989e32ff5e70281cabf7b596fe4f280 Author: Maxime Ripard Date: Mon Jul 11 19:39:05 2022 +0200 drm/vc4: dsi: Fix the driver structure lifetime The vc4_dsi structure is currently allocated through a device-managed allocation. This can lead to use-after-free issues however in the unbinding path since the DRM entities will stick around, but the underlying structure has been freed. However, we can't just fix it by using a DRM-managed allocation like we did for the other drivers since the DSI case is a bit more intricate. Indeed, the structure will be allocated at probe time, when we don't have a DRM device yet, to be able to register the DSI bus driver. We will then reuse it at bind time to register our KMS entities in the framework. In order to work around both constraints, we can use a kref to track the users of the structure (DSI host, and KMS), and then put our structure when the DSI host will have been unregistered, and through a DRM-managed action that will execute once we won't need the KMS entities anymore. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-36-maxime@cerno.tech commit 2a87d48c3342ede66b15649bcbbaf999ccc9a83a Author: Maxime Ripard Date: Mon Jul 11 19:39:04 2022 +0200 drm/vc4: dsi: Switch to drmm_of_get_bridge The current code uses a device-managed function to retrieve the next bridge downstream. However, that means that it will be removed at unbind time, where the DRM device is still very much live and might still have some applications that still have it open. Switch to a DRM-managed variant to clean everything up once the DRM device has been last closed. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-35-maxime@cerno.tech commit 6f0ca506c30e2b2c8d3b86fe33989c5257aaa34b Author: Maxime Ripard Date: Mon Jul 11 19:39:03 2022 +0200 drm/vc4: dsi: Switch to DRM-managed encoder initialization The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-34-maxime@cerno.tech commit 73b68b28a9e819e600ca2d0640721ae61bdaf55a Author: Maxime Ripard Date: Mon Jul 11 19:39:02 2022 +0200 drm/vc4: dsi: Embed DRM structures into the private structure The VC4 DSI driver private structure contains only a pointer to the encoder it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through the vc4_encoder one) into struct vc4_dsi to fix both issues. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-33-maxime@cerno.tech commit 71b1bd4c2bd404b28cc499fa37d02e32f55de865 Author: Maxime Ripard Date: Mon Jul 11 19:39:01 2022 +0200 drm/vc4: dpi: Protect device resources Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its file handle. So we end up with a time window during which we can call the encoder hooks, but we don't have access to the underlying resources and device. Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so that we bail out if we are during that window. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-32-maxime@cerno.tech commit 055af0235aef8110a1c44f5fc04c5c206e9e58fb Author: Maxime Ripard Date: Mon Jul 11 19:39:00 2022 +0200 drm/vc4: dpi: Switch to drmm_of_get_bridge The current code uses a device-managed function to retrieve the next bridge downstream. However, that means that it will be removed at unbind time, where the DRM device is still very much live and might still have some applications that still have it open. Switch to a DRM-managed variant to clean everything up once the DRM device has been last closed. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-31-maxime@cerno.tech commit e126d318002639c979f23764f5d496a78e9bd85e Author: Maxime Ripard Date: Mon Jul 11 19:38:59 2022 +0200 drm/vc4: dpi: Switch to DRM-managed encoder initialization The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-30-maxime@cerno.tech commit 77932adf2a2c9625da8bc8885b626690ee500601 Author: Maxime Ripard Date: Mon Jul 11 19:38:58 2022 +0200 drm/vc4: dpi: Add action to disable the clock The DPI controller has two clocks called core and pixel, the core clock being enabled at bind time. Adding a device-managed action will make the error path easier, so let's create one to disable it. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-29-maxime@cerno.tech commit 5801eda938f5f98cbdb6bc83e2c35499735f006a Author: Maxime Ripard Date: Mon Jul 11 19:38:57 2022 +0200 drm/vc4: dpi: Remove unnecessary drm_of_panel_bridge_remove call Since we have a managed call to create our panel_bridge instance, the call to drm_of_panel_bridge_remove() at unbind is both redundant and dangerous since it might lead to a use-after-free. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-28-maxime@cerno.tech commit ff5b18ce8a5b4fccabd46ed7f17ef3e7f2d1f8e0 Author: Maxime Ripard Date: Mon Jul 11 19:38:56 2022 +0200 drm/vc4: dpi: Return an error if we can't enable our clock If we fail to enable the DPI clock, we just ignore the error and moves forward. Let's return an error instead. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-27-maxime@cerno.tech commit 7f0ba8f98a4ec3bee6a5d612e676a75791c0f127 Author: Maxime Ripard Date: Mon Jul 11 19:38:55 2022 +0200 drm/vc4: dpi: Switch to drmm_kzalloc Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and component_unbind_all() is being run. However, it occurs while the DRM device is still registered, which will create dangling pointers, eventually resulting in use-after-free. Switch to a DRM-managed allocation to keep our structure until the DRM driver doesn't need it anymore. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-26-maxime@cerno.tech commit 7c9a4bab7aeb4be917d4202a99a780b40eaa78c7 Author: Maxime Ripard Date: Mon Jul 11 19:38:54 2022 +0200 drm/vc4: dpi: Embed DRM structures into the private structure The VC4 DPI driver private structure contains only a pointer to the encoder it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through the vc4_encoder one) into struct vc4_dpi to fix both issues. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-25-maxime@cerno.tech commit 693e35dcde748387c6dc538de6c3d78b3d2da866 Author: Maxime Ripard Date: Mon Jul 11 19:38:53 2022 +0200 drm/vc4: dpi: Remove vc4_dev dpi pointer There's no user for that pointer so let's just get rid of it. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-24-maxime@cerno.tech commit 77ef4c1702fb370da126ff39b94e80a74ce9f095 Author: Maxime Ripard Date: Mon Jul 11 19:38:52 2022 +0200 drm/vc4: crtc: Switch to DRM-managed CRTC initialization The current code will call drm_crtc_cleanup() when the device is unbound. However, by then, there might still be some references held to that CRTC, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only once the DRM device has been last closed. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-23-maxime@cerno.tech commit 7cc4214c27cf8d664358db402a179bf6ab2db862 Author: Maxime Ripard Date: Mon Jul 11 19:38:51 2022 +0200 drm/vc4: crtc: Switch to drmm_kzalloc Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and component_unbind_all() is being run. However, it occurs while the DRM device is still registered, which will create dangling pointers, eventually resulting in use-after-free. Switch to a DRM-managed allocation to keep our structure until the DRM driver doesn't need it anymore. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-22-maxime@cerno.tech commit 6bad4774157c9df64e1b04a8d893e282e16a9c23 Author: Maxime Ripard Date: Mon Jul 11 19:38:50 2022 +0200 drm/vc4: crtc: Move debugfs_name to crtc_data All the CRTCs, including the TXP, have a debugfs file and name so we can consolidate it into vc4_crtc_data. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-21-maxime@cerno.tech commit 9872c7a319219346d30a0862424e5495a4e97e0e Author: Maxime Ripard Date: Mon Jul 11 19:38:49 2022 +0200 drm/vc4: plane: Switch to drmm_universal_plane_alloc() Let's switch to drmm_universal_plane_alloc() for our plane allocation and initialisation to make the driver a bit simpler. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-20-maxime@cerno.tech commit 02792a93103a99abc611e36cdeda9bcfa8924fd2 Author: Maxime Ripard Date: Mon Jul 11 19:38:48 2022 +0200 drm/vc4: crtc: Remove manual plane removal on error When vc4_crtc_bind() fails after vc4_crtc_init() has been called, we have a loop undoing the plane creation and calling destroy on each plane registered and matching the possible_crtcs mask. However, this is redundant with what drm_mode_config_cleanup() is doing, so let's remove it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-19-maxime@cerno.tech commit 77c5fb12061f2d8fa28bb0216c9a19a0a6f47ef7 Author: Maxime Ripard Date: Mon Jul 11 19:38:47 2022 +0200 drm/vc4: plane: Take possible_crtcs as an argument vc4_plane_init() currently initialises the plane with no possible CRTCs, and will expect the caller to set it up by itself. Let's change that logic a bit to follow the syntax of drm_universal_plane_init() and pass the possible CRTCs bitmask as an argument to the function instead. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-18-maxime@cerno.tech commit 398e7ceae6886eaa29babcc0ac8f343e48262716 Author: Maxime Ripard Date: Mon Jul 11 19:38:46 2022 +0200 drm/vc4: hvs: Remove planes currently allocated before taking down When the HVS driver is unbound, a lot of memory allocations in the LBM and DLIST RAM are still assigned to planes that are still allocated. Thus, we hit a warning when calling drm_mm_takedown() since the memory pool is not completely free of allocations. Let's free all the currently live entries before calling drm_mm_takedown(). Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-17-maxime@cerno.tech commit 969cfae1f01d03aee7a87e41d5313e65db4a9c0c Author: Maxime Ripard Date: Mon Jul 11 19:38:45 2022 +0200 drm/vc4: hvs: Protect device resources after removal Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources aren't there anymore, but the userspace can still call into our driver. Fortunately, the DRM framework provides the drm_dev_enter() and drm_dev_exit() functions to make sure our underlying device is still there for the section protected by those calls. Let's add them to the HVS driver. Acked-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-16-maxime@cerno.tech commit 68e4a69aec4dac161c620665693809b3e69db72f Author: Maxime Ripard Date: Mon Jul 11 19:38:44 2022 +0200 drm/vc4: crtc: Create vblank reporting function We'll need that code in the HVS driver, so let's create a shared function to reuse it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-15-maxime@cerno.tech commit 4a9551237d44cb051c0a3d7a18d11d6be27ef1d9 Author: Maxime Ripard Date: Mon Jul 11 19:38:43 2022 +0200 drm/vc4: drv: Use drm_dev_unplug When our KMS driver is unbound, the device is no longer there but we might still have users with an opened fd to the KMS device. To avoid any issue in such a situation, every device access needs to be protected by calls to drm_dev_enter() and drm_dev_exit(), and the driver needs to call drm_dev_unplug(). We'll add calls to drm_dev_enter()/drm_dev_exit() in subsequent patches changing the relevant drivers, but let's start by calling drm_dev_unplug(). Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-14-maxime@cerno.tech commit 6cf61bf49c9bdb9ba2d33be812d90dd406326c6c Author: Maxime Ripard Date: Mon Jul 11 19:38:42 2022 +0200 drm/vc4: drv: Call component_unbind_all() While we were using the component framework to deal with all the DRM subdevices, we were not calling component_unbind_all(). This leads to none of the subdevices freeing up their resources as part of their unbind() or device managed hooks. Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-13-maxime@cerno.tech commit ae9f1f2ca093906f06311ade42772eeb021af39f Author: Maxime Ripard Date: Mon Jul 11 19:38:41 2022 +0200 drm/bridge: panel: Introduce drmm_of_get_bridge Unlike what can be found for other DRM entities, we don't have a DRM-managed function equivalent to devm_drm_of_get_bridge(). Let's create it. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-12-maxime@cerno.tech commit abea75e9207e7744f524a5373e9c149226e17a5d Author: Maxime Ripard Date: Mon Jul 11 19:38:40 2022 +0200 drm/bridge: panel: Introduce drmm_panel_bridge_add Unlike what can be found for other entities, there's no DRM-managed function to create a panel_bridge instance from a panel. Let's introduce one. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-11-maxime@cerno.tech commit 35a3b82f1bdd60e454de34f984a3f09b38f64b61 Author: Maxime Ripard Date: Mon Jul 11 19:38:39 2022 +0200 drm/connector: Introduce drmm_connector_init Unlike other DRM entities, there's no helper to create a DRM-managed initialisation of a connector. Let's create an helper to initialise a connector that would be passed as an argument, and handle the cleanup through a DRM-managed action. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-10-maxime@cerno.tech commit a961b197d72601b0363fd7614f9b98d5721f9c6c Author: Maxime Ripard Date: Mon Jul 11 19:38:38 2022 +0200 drm/connector: Check for destroy implementation Connectors need to be cleaned up with a call to drm_connector_cleanup() in their drm_connector_funcs.destroy implementation. Let's check for this and complain if there's no such function. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-9-maxime@cerno.tech commit b11af8a25b576cad006411fd904f88199ff9b5ff Author: Maxime Ripard Date: Mon Jul 11 19:38:37 2022 +0200 drm/connector: Consolidate Connector Initialization We're going to add a DRM-managed connector initialization function. Since we'll need both the with and without the DDC pointer, having a single function that takes an optional pointer is easier to maintain. Let's create a static function that will back both existing variants, and will be reused by the DRM-managed variant. Acked-by: Thomas Zimmermann Suggested-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-8-maxime@cerno.tech commit d87fbea50b819b76f180bc8420c5f9efa0670deb Author: Maxime Ripard Date: Mon Jul 11 19:38:36 2022 +0200 drm/connector: Clarify when drm_connector_unregister is needed The current documentation for drm_connector_unregister() mentions that it's needed for connectors that have been registered through drm_dev_register(). However, this was a typo and was meant to be drm_connector_register(), which only applies to connectors registered after drm_dev_register() has been called. In addition, it was also mentioning that connectors are unregistered automatically when drm_dev_unregister() is called. This part is a bit misleading, since it might make it appear that drm_connector_unregister() applies either to all connectors, or none of them. After discussing it with Daniel, it appears that we always need to call drm_connector_unregister() on connectors that have been registered with drm_connector_register(), but only those. drm_connector_init() already mentions that it only needs drm_connector_cleanup(), so let's clarify the drm_connector_register() and drm_connector_unregister() documentation to point at each other, and remove the misleading part about drm_dev_unregister(). Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-7-maxime@cerno.tech commit 00ec947c144b374ceb3fe1b4bd2e9ea7454dd630 Author: Maxime Ripard Date: Mon Jul 11 19:38:35 2022 +0200 drm/connector: Mention the cleanup after drm_connector_init Unlike encoders and CRTCs, the drm_connector_init() and drm_connector_init_with_ddc() don't mention how the cleanup is supposed to be done. Let's add it. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-6-maxime@cerno.tech commit d71d8a4b8d10e4e2002d21940a768b389d594637 Author: Maxime Ripard Date: Mon Jul 11 19:38:34 2022 +0200 drm/connector: Reorder headers Unlike most of the other files in DRM, and Linux in general, the headers in drm_connector.c aren't sorted alphabetically. Let's fix that. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-5-maxime@cerno.tech commit f134c9cd9ce829cc66d4d32c57b76de1aab54fe9 Author: Maxime Ripard Date: Mon Jul 11 19:38:33 2022 +0200 drm/encoder: Introduce drmm_encoder_init The DRM-managed function to register an encoder is drmm_encoder_alloc() and its variants, which will allocate the underlying structure and initialisation the encoder. However, we might want to separate the structure creation and the encoder initialisation, for example if the structure is shared across multiple DRM entities, for example an encoder and a connector. Let's create an helper to only initialise an encoder that would be passed as an argument. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-4-maxime@cerno.tech commit 917dd05418148f05d8860b8106da8dcd1d258aaf Author: Maxime Ripard Date: Mon Jul 11 19:38:32 2022 +0200 drm/crtc: Introduce drmm_crtc_init_with_planes The DRM-managed function to register a CRTC is drmm_crtc_alloc_with_planes(), which will allocate the underlying structure and initialisation the CRTC. However, we might want to separate the structure creation and the CRTC initialisation, for example if the structure is shared across multiple DRM entities, for example an encoder and a connector. Let's create an helper to only initialise a CRTC that would be passed as an argument. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-3-maxime@cerno.tech commit 668a8f17b5290d04ef7343636a5588a0692731a1 Author: Maxime Ripard Date: Mon Jul 11 19:38:31 2022 +0200 drm/mipi-dsi: Detach devices when removing the host Whenever the MIPI-DSI host is unregistered, the code of mipi_dsi_host_unregister() loops over every device currently found on that bus and will unregister it. However, it doesn't detach it from the bus first, which leads to all kind of resource leaks if the host wants to perform some clean up whenever a device is detached. Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-2-maxime@cerno.tech commit 4de395f2c632c31c575f72d49d4f4389c99dab68 Merge: bbd60fee2d216 0180290abb5ce Author: Maxime Ripard Date: Wed Jul 13 10:33:00 2022 +0200 Merge drm/drm-next into drm-misc-next I need to have some vc4 patches merged in -rc4, but drm-misc-next is only at -rc2 for now. Signed-off-by: Maxime Ripard commit 81cb44274c654e49f55e6690079540b0bd177db0 Author: Matt Roper Date: Fri Jul 8 14:58:04 2022 -0700 drm/i915: Add Wa_14016291713 We already disable FBC when PSR2 is enabled on display version 12 and above; this new workaround now requires that we do the same with PSR1 on display versions 12 and 13. Signed-off-by: Matt Roper Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20220708215804.2889246-2-matthew.d.roper@intel.com commit bbd60fee2d2166b2b8722cbad740996ef2e7ce40 Author: Christian König Date: Mon Jul 11 16:48:01 2022 +0200 dma-buf: revert "return only unsignaled fences in dma_fence_unwrap_for_each v3" This reverts commit 8f61973718485f3e89bc4f408f929048b7b47c83. It turned out that this is not correct. Especially the sync_file info IOCTL needs to see even signaled fences to correctly report back their status to userspace. Instead add the filter in the merge function again where it makes sense. Signed-off-by: Christian König Tested-by: Karolina Drobnik Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220712102849.1562-1-christian.koenig@amd.com commit 75f664903d8672897333b86bb450335ec6486ad5 Author: Jouni Högander Date: Mon Jul 11 14:17:50 2022 +0300 drm/i915/display: Ensure PSR gets disabled if no encoders in new state Currently PSR is left enabled when all planes are disabled if there is no attached encoder in new state. This seems to be causing FIFO underruns. Fix this by checking if encoder exists in new crtc state and disable PSR if it doesn't. v2: Unify disable logic with existing Cc: Mika Kahola Reported-by: Stanislav Lisovskiy Signed-off-by: Jouni Högander Signed-off-by: Stanislav Lisovskiy Reviewed-by: Stanislav Lisovskiy Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220711111750.881552-1-jouni.hogander@intel.com commit fc8d29e298cf47e07c2764ec1c340c1df8e50431 Author: Arthur Grillo Date: Fri Jul 8 17:30:52 2022 -0300 drm: selftest: convert drm_mm selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM mm selftest to the KUnit API. Signed-off-by: Arthur Grillo Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-10-maira.canal@usp.br commit 932da861956ac425ba4e65f7696458f96d833883 Author: Maíra Canal Date: Fri Jul 8 17:30:51 2022 -0300 drm: selftest: convert drm_buddy selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM buddy selftest to the KUnit API. Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-9-maira.canal@usp.br commit 9eb11f52a6285c0516046e11d45fa4be8714a1f7 Author: Maíra Canal Date: Fri Jul 8 17:30:50 2022 -0300 drm: selftest: convert drm_framebuffer selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM framebuffer selftest to the KUnit API. Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-8-maira.canal@usp.br commit 848b3c0be2b944f633fe9beb28ad28f15c39f7a1 Author: Maíra Canal Date: Fri Jul 8 17:30:49 2022 -0300 drm: selftest: convert drm_dp_mst_helper selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM DP MST helper selftest to the KUnit API. Co-developed-by: Rubens Gomes Neto Signed-off-by: Rubens Gomes Neto Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-7-maira.canal@usp.br commit 913b1e7ca77e0d04b74921e7328e3446f3a481be Author: Maíra Canal Date: Fri Jul 8 17:30:48 2022 -0300 drm: selftest: convert drm_plane_helper selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM plane helper selftest to the KUnit API. Co-developed-by: Djakson C. G. Filho Signed-off-by: Djakson C. G. Filho Co-developed-by: Anderson Fraga Signed-off-by: Anderson Fraga Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-6-maira.canal@usp.br commit 0421bb0baa84fc93bbb659fe682e19266730f9f1 Author: Maíra Canal Date: Fri Jul 8 17:30:47 2022 -0300 drm: selftest: convert drm_format selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM format selftest to the KUnit API. Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-5-maira.canal@usp.br commit 93de485cd822d429e91f197a820f02ee57d38fd5 Author: Maíra Canal Date: Fri Jul 8 17:30:46 2022 -0300 drm: selftest: convert drm_rect selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM rect selftest to the KUnit API. Co-developed-by: Carlos Veras Signed-off-by: Carlos Veras Co-developed-by: Matheus Vieira Signed-off-by: Matheus Vieira Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-4-maira.canal@usp.br commit 9f0527d22a52ff3470d8bf0dc79cf42c0677c23c Author: Maíra Canal Date: Fri Jul 8 17:30:45 2022 -0300 drm: selftest: convert drm_cmdline_parser selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM cmdline parser selftest to the KUnit API. Co-developed-by: Arthur Grillo Signed-off-by: Arthur Grillo Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-3-maira.canal@usp.br commit ba8f16cd081902350e2d2a00afcc6b77b1815d50 Author: Maíra Canal Date: Fri Jul 8 17:30:44 2022 -0300 drm: selftest: convert drm_damage_helper selftest to KUnit Considering the current adoption of the KUnit framework, convert the DRM damage helper selftest to the KUnit API. Co-developed-by: Arthur Grillo Signed-off-by: Arthur Grillo Tested-by: David Gow Acked-by: Daniel Latypov Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220708203052.236290-2-maira.canal@usp.br commit 4d8f68548e982e2c9b9ca3b47aea49c47da93a3d Author: Christian König Date: Thu Feb 17 10:43:16 2022 +0100 drm/ttm: audit bo->resource usage v2 Allow BOs to exist without backing store. v2: handle ttm_bo_move_memcpy as well. Signed-off-by: Christian König Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-5-christian.koenig@amd.com commit 64e257f187a5c76ec5766f50204462c0c483e418 Author: Christian König Date: Fri Dec 17 16:30:16 2021 +0100 drm/nouveau: audit bo->resource usage Make sure we can at least move and release BOs without backing store. Signed-off-by: Christian König Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-4-christian.koenig@amd.com commit 63af82cf5e36b6ba3f3ebcdd1edd9f91934bfa59 Author: Christian König Date: Fri Dec 17 16:13:09 2021 +0100 drm/amdgpu: audit bo->resource usage Make sure we can at least move and release BOs without backing store. Signed-off-by: Christian König Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-3-christian.koenig@amd.com commit 347987a2cf0d146484d1c586951ef10028bb1674 Author: Christian König Date: Fri Feb 18 14:32:53 2022 +0100 drm/ttm: rename and cleanup ttm_bo_init Rename ttm_bo_init to ttm_bo_init_validate since that better matches what the function is actually doing. Remove the unused size parameter, move the function's kerneldoc to the implementation and cleanup the whole error handling. Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-2-christian.koenig@amd.com Reviewed-by: Michael J. Ruhl commit 20529e260ff2fb4a00b54a1e625ebebe5d1a6210 Author: Arunpravin Paneer Selvam Date: Fri Jul 8 02:30:46 2022 -0700 Revert "drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new" This reverts commit 5e3f1e7729ec7a99e145e9d8ed58963d86cdfb98. This is part of a revert of the following commits: commit 708d19d9f362 ("drm/amdgpu: move internal vram_mgr function into the C file") commit 5e3f1e7729ec ("drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new") commit c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu") [WHY] Few users reported garbaged graphics as soon as x starts, reverting until this can be resolved. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220708093047.492662-2-Arunpravin.PaneerSelvam@amd.com commit d395fb1999abb7eaa3fb5fd2107cae0f1e41e6d0 Author: Arunpravin Paneer Selvam Date: Fri Jul 8 02:30:45 2022 -0700 Revert "drm/amdgpu: move internal vram_mgr function into the C file" This reverts commit 708d19d9f362766147cab79eccae60912c6d3068. This is part of a revert of the following commits: commit 708d19d9f362 ("drm/amdgpu: move internal vram_mgr function into the C file") commit 5e3f1e7729ec ("drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new") commit c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu") [WHY] Few users reported garbaged graphics as soon as x starts, reverting until this can be resolved. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220708093047.492662-1-Arunpravin.PaneerSelvam@amd.com commit 006f3b2f324cb2277bdcb89693296d9647ece251 Author: Paul Cercueil Date: Fri Jul 8 21:54:06 2022 +0100 drm/ingenic: Use the new PM macros - Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS() macro. This makes it possible to remove the __maybe_unused flags on the callback functions. - Since we only have callbacks for suspend/resume, we can conditionally compile the dev_pm_ops structure for when CONFIG_PM_SLEEP is enabled; so use the pm_sleep_ptr() macro instead of pm_ptr(). Signed-off-by: Paul Cercueil Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-7-paul@crapouillou.net commit c167ee1f75ca5947bafe93ab23b007cb243e5f4a Author: Paul Cercueil Date: Fri Jul 8 21:54:04 2022 +0100 drm/ingenic: Don't request full modeset if property is not modified Avoid requesting a full modeset if the sharpness property is not modified, because then we don't actually need it. Signed-off-by: Paul Cercueil Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-5-paul@crapouillou.net commit d292dc324425995d7a45b07f3abf9a9919f3a1a9 Author: Paul Cercueil Date: Fri Jul 8 21:54:03 2022 +0100 drm/ingenic: Add support for the JZ4760(B) Add support for the JZ4760 and JZ4760B SoCs to the ingenic-drm display driver. Signed-off-by: Paul Cercueil Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-4-paul@crapouillou.net commit 2ad5a3ac9dc6c98a045385dc8667e9499577a325 Author: Paul Cercueil Date: Fri Jul 8 21:54:02 2022 +0100 drm/ingenic: Fix MODULE_LICENSE() string The previous "GPL v2" string is deprecated. For more info, see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity") Signed-off-by: Paul Cercueil Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-3-paul@crapouillou.net commit 46f4433550084de3bb288cbb32fbdad7688de11e Author: Paul Cercueil Date: Fri Jul 8 21:54:01 2022 +0100 dt-bindings/display: ingenic: Add compatible string for the JZ4760(B) Add compatible strings for the LCD controllers found in the JZ4760 and JZ4760B SoCs from Ingenic. Signed-off-by: Paul Cercueil Acked-by: Sam Ravnborg Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-2-paul@crapouillou.net commit 6de745238aa30529778a26622a430dfcb171b089 Author: Geert Uytterhoeven Date: Wed Jul 6 15:16:18 2022 +0200 drm/fb: Improve drm_framebuffer.offsets documentation Fix various spelling and grammar mistakes in the kerneldoc comments documenting the offsets member in the drm_framebuffer structure: - s/laytou/layout/, - Add missing "is", - s/it/its/. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Reviewed-by: Simon Ser Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/33fda13b500b39645e7363806c6e458e915b581e.1657113304.git.geert@linux-m68k.org commit a6aa679a70e9d8fa4ad3f519c060db9bb186e21c Author: Martin Jücker Date: Mon May 16 21:37:08 2022 +0200 drm/panel: simple: add support for the Samsung LTL101AL01 panel Add timings and panel description for the Samsung LTL101AL01 panel. Signed-off-by: Martin Jücker Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220516193709.10037-2-martin.juecker@gmail.com commit 2b50aae61f94bc76dde7d4c87b610ffe45ca1b02 Author: Martin Jücker Date: Mon May 16 21:37:07 2022 +0200 dt-bindings: display: simple: add support for Samsung LTL101AL01 Add the Samsung LTL101AL01 WXGA LCD panel to the list. Signed-off-by: Martin Jücker Acked-by: Krzysztof Kozlowski Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220516193709.10037-1-martin.juecker@gmail.com commit 0c05fcd3b45d6769c496fc6e2b88d18fc78ebe11 Author: Geert Uytterhoeven Date: Wed Jul 6 15:20:18 2022 +0200 drm/mode: Improve drm_mode_fb_cmd2 documentation Fix various grammar mistakes in the kerneldoc comments documenting the drm_mode_fb_cmd2 structure: - s/is/are/, - s/8 bit/8-bit/. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg Reviewed-by: Simon Ser Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/536de72eab09242e1faf22fa58d91c9005d6ea51.1657113597.git.geert@linux-m68k.org Link: https://patchwork.freedesktop.org/patch/msgid/20220608020614.4098292-1-bjorn.andersson@linaro.org commit b92db7e4fe740daab858366faff1f992d53d3ff4 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:55 2022 +0200 drm/fourcc: Add DRM_FORMAT_D[1248] As Rn covers single-channel formats with a direct relationship between channel value and brightness, and Cn can be any colors, there are currently no fourcc codes to describe single-channel formats with an inverse relationship between channel value and brightness. Introduce fourcc codes for a single-channel frame buffer format with two, four, sixteen, or 256 brightness ("darkness") levels, where there is an inverse relationship between channel value and brightness. As the number of bits per pixel may be less than eight, some of these formats rely on proper block handling for the calculation of bits per pixel and pitch. The fill order (the order in which multiple pixels are packed in a byte) is the same order as used for grayscale (2, 4, and 16 levels) images in the PNG specification, Version 1.2. This order is also the recommended and default order (FillOrder = 1) for bilevel and grayscale (16 levels) images in the TIFF 6.0 Specification, and is also used for monochrome images in the PBM file format, monochrome Linux frame buffer logos, and BDF and PSF (Linux kernel) font files. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/6119f3abeda9baaa88652843960adc032da276b4.1657294931.git.geert@linux-m68k.org commit d093100b425df6fe400881f2e62c3f0be7bf18cf Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:54 2022 +0200 drm/fourcc: Add DRM_FORMAT_R[124] Introduce fourcc codes for single-channel frame buffer formats with two, four, and sixteen brightness levels, where there is a direct relationship between channel value and brightness. As the number of bits per pixel is less than eight, these rely on proper block handling for the calculation of bits per pixel and pitch. The fill order (the order in which multiple pixels are packed in a byte) is the same order as used for grayscale (2, 4, and 16 levels) images in the PNG specification, Version 1.2. This order is also the recommended and default order (FillOrder = 1) for bilevel and grayscale (16 levels) images in the TIFF 6.0 Specification, and is also used for monochrome images in the PBM file format, monochrome Linux frame buffer logos, and BDF and PSF (Linux kernel) font files. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/96561a88e53c59cac72e66642bf4c097aacefd18.1657294931.git.geert@linux-m68k.org commit 8aba4d30520ed656065eb36f0628109bdea385ee Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:53 2022 +0200 drm/fourcc: Clarify the meaning of single-channel "red" Traditionally, the first channel has been called the "red" channel, but the fourcc values for single-channel "red" formats can also be used for other single-channel formats with a direct relationship between channel value and brightness, like grayscale. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/31d1792f26707a7270347e9916b4103470d2b192.1657294931.git.geert@linux-m68k.org commit 0a2486f85e0cfa6439116abb9078ab888a619746 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:52 2022 +0200 drm/gem-fb-helper: Use actual bpp for size calculations The AFBC helpers derive the number of bits per pixel from the deprecated drm_format_info.cpp[] field, which does not take into account block sizes. Fix this by using the actual number of bits per pixel instead. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/b1d938d903157627c4ac101df92a1f3bf8ebe83d.1657294931.git.geert@linux-m68k.org commit ba71593217b5b03c9e3385b268ff8613a71fc6ce Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:51 2022 +0200 drm/fb-helper: Add support for DRM_FORMAT_C[124] Add support for color-indexed frame buffer formats with two, four, and sixteen colors to the DRM framebuffer helper functions: 1. Add support for 1, 2, and 4 bits per pixel to the damage helper, 2. For color-indexed modes, the length of the color bitfields must be set to the color depth, else the logo code may pick a logo with too many colors. Drop the incorrect DAC width comment, which originates from the i915 driver. 3. Accept C[124] modes when validating or filling in struct fb_var_screeninfo, and use the correct number of bits per pixel. 4. Set the visual to FB_VISUAL_PSEUDOCOLOR for all color-indexed modes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/db3e80b445df661ff0cd7e698507a8d24a4c867e.1657294931.git.geert@linux-m68k.org commit e5bd7e3e4a68f0befe53f59954b25eec9a792d60 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:50 2022 +0200 drm/fourcc: Add DRM_FORMAT_C[124] Introduce fourcc codes for color-indexed frame buffer formats with two, four, and sixteen colors, and provide a mapping from bits per pixel and depth to fourcc codes. As the number of bits per pixel is less than eight, these rely on proper block handling for the calculation of bits per pixel and pitch. The fill order (the order in which multiple pixels are packed in a byte) is the same order as used for indexed-color (2, 4, and 16 colors) images in the PNG specification, Version 1.2. This order is also the recommended and default order (FillOrder = 1) for palette-color (16 colors) images in the TIFF 6.0 Specification, and is also used for 16-color Linux frame buffer logos. Signed-off-by: Geert Uytterhoeven Reviewed-by: Pekka Paalanen Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/3d88ca7ad32ff3ff3469c10f0b36c312ea233a33.1657294931.git.geert@linux-m68k.org commit 4c59b0805e9bf873fd3f5dca4fc53d8c220e39b4 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:49 2022 +0200 drm/framebuffer: Use actual bpp for DRM_IOCTL_MODE_GETFB When userspace queries the properties of a frame buffer, the number of bits per pixel is derived from the deprecated drm_format_info.cpp[] field, which does not take into account block sizes. Fix this by using the actual number of bits per pixel instead. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/b612780feef200b7f914a674db28ed227e7cdc64.1657294931.git.geert@linux-m68k.org commit 356d2c8e76ebb1134a0685ce4b923d8201337475 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:48 2022 +0200 drm/client: Use actual bpp when allocating frame buffers When allocating a frame buffer, the number of bits per pixel needed is derived from the deprecated drm_format_info.cpp[] field. While this may work for formats using less than 8 bits per pixel, it does lead to a large overallocation. Reduce memory consumption by using the actual number of bits per pixel instead. Signed-off-by: Geert Uytterhoeven Acked-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/eabcf4f298184dabe46823fcf5ceffa1da0ec7ef.1657294931.git.geert@linux-m68k.org commit dc1dc76bd9a48c6aba3efae5eadb9a884043966e Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:47 2022 +0200 drm/fourcc: Add drm_format_info.is_color_indexed flag Add a flag to struct drm_format_info to indicate if a format is color-indexed, similar to the existing .is_yuv flag. This way generic code and drivers can just check this flag, instead of checking against a list of fourcc formats. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/90cd390b2b4d481661f966de7b504f1702d80dfd.1657294931.git.geert@linux-m68k.org commit 96dc635d5538055cb6ccd7b6e9290dfcfc385f97 Author: Geert Uytterhoeven Date: Fri Jul 8 20:20:46 2022 +0200 drm/fourcc: Add drm_format_info_bpp() helper Add a helper to retrieve the actual number of bits per pixel for a plane, taking into account the number of characters and pixels per block for tiled formats. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1cae5ebc28513ec1c91c66b00647ce3ca23bfba7.1657294931.git.geert@linux-m68k.org commit 79abca2b399009eb8d12c652d0f0f7a9c7a06289 Author: Uwe Kleine-König Date: Fri Jul 8 11:49:22 2022 +0200 drm/mipi-dsi: Make remove callback return void All implementations return 0 and the return value of mipi_dsi_drv_remove() is ignored anyhow. So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour. Signed-off-by: Uwe Kleine-König Reviewed-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708094922.1408248-4-u.kleine-koenig@pengutronix.de commit 1fd452c403ca2cd9dcbd8465f9f72be52e15ac1a Author: Uwe Kleine-König Date: Fri Jul 8 11:49:21 2022 +0200 drm/panel-novatek-nt35510: Emit an error message if power off fails Returning an error code from a mipi_dsi remove callback fails, this is silently ignored. (mipi_dsi_drv_remove() propagates the return value to device_remove() which ignores it.) So emit an error code in the driver remove function and return 0. Signed-off-by: Uwe Kleine-König Reviewed-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708094922.1408248-3-u.kleine-koenig@pengutronix.de commit d72ac4bbf4cc8f6b50526ce400861f176659884f Author: Uwe Kleine-König Date: Fri Jul 8 11:49:20 2022 +0200 drm/panel: simple: Make panel_simple_remove() return void panel_simple_remove() returns zero unconditionally. Make it return no value instead making more obvious what happens in the callers. This is a preparation for making platform and mipi-dsi remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Sam Ravnborg Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220708094922.1408248-2-u.kleine-koenig@pengutronix.de commit 7d1202738efda60155d98b370b3c70d336be0eea Author: Dan Carpenter Date: Mon Jul 4 13:55:40 2022 +0300 drm/bridge: Avoid uninitialized variable warning This code works, but technically it uses "num_in_bus_fmts" before it has been initialized so it leads to static checker warnings and probably KMEMsan warnings at run time. Initialize the variable to zero to silence the warning. Fixes: f32df58acc68 ("drm/bridge: Add the necessary bits to support bus format negotiation") Signed-off-by: Dan Carpenter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/YrrIs3hoGcPVmXc5@kili commit 9c442b7aabb3953d3bbd156dc68a16cec60d3bff Author: Samuel Holland Date: Sat Jul 2 14:32:50 2022 -0500 drm/sun4i: Update Kconfig defaults and descriptions Allwinner display drivers are split roughly into two generations. The first generation was found on early 32-bit ARM SoCs and contains DE1.0 and a custom HDMI controller. Clarify that these options only apply to a specific list of SoCs, and limit selecting them to 32-bit ARM, to avoid confusion. The second generation, found in A83T and newer SoCs (both 32-bit and 64-bit), contains a DE2.0 and a DesignWare HDMI controller. Since this is the most widely-used generation, enable it by default. The previous default condition (MACH_SUN8I) was limited to 32-bit SoCs. Also enable the DSI controller by default, which is found on 64-bit SoCs as well. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220702193250.52959-1-samuel@sholland.org commit 859161b952a453b86362f168fadef72a8ba31a05 Author: Stanislav Lisovskiy Date: Tue Jun 14 15:30:49 2022 +0300 drm/i915/dg2: Bump up CDCLK for DG2 We seem to need this W/A same way as for TGL, in order to fix some of the underruns, which we currently have and those not related to PSR. Signed-off-by: Stanislav Lisovskiy Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220614123049.16183-2-stanislav.lisovskiy@intel.com commit 53565c28e6af2cef6bbf438c34250135e3564459 Author: Maxime Ripard Date: Wed Jun 29 14:34:37 2022 +0200 drm/vc4: hdmi: Rework power up The current code tries to handle the case where CONFIG_PM isn't selected by first calling our runtime_resume implementation and then properly report the power state to the runtime_pm core. This allows to have a functionning device even if pm_runtime_get_* functions are nops. However, the device power state if CONFIG_PM is enabled is RPM_SUSPENDED, and thus our vc4_hdmi_write() and vc4_hdmi_read() calls in the runtime_pm hooks will now report a warning since the device might not be properly powered. Even more so, we need CONFIG_PM enabled since the previous RaspberryPi have a power domain that needs to be powered up for the HDMI controller to be usable. The previous patch has created a dependency on CONFIG_PM, now we can just assume it's there and only call pm_runtime_resume_and_get() to make sure our device is powered in bind. Link: https://lore.kernel.org/r/20220629123510.1915022-39-maxime@cerno.tech Acked-by: Thomas Zimmermann Tested-by: Stefan Wahren Signed-off-by: Maxime Ripard commit f1bc386b319e93e56453ae27e9e83817bb1f6f95 Author: Maxime Ripard Date: Wed Jun 29 14:34:36 2022 +0200 drm/vc4: hdmi: Depends on CONFIG_PM We already depend on runtime PM to get the power domains and clocks for most of the devices supported by the vc4 driver, so let's just select it to make sure it's there. Link: https://lore.kernel.org/r/20220629123510.1915022-38-maxime@cerno.tech Acked-by: Thomas Zimmermann Tested-by: Stefan Wahren Signed-off-by: Maxime Ripard commit 6dc548745d5b5102e3c53dc5097296ac270b6c69 Author: Jianglei Nie Date: Tue Jul 5 17:43:06 2022 +0800 drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc() nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc(). When some error occurs, "nvbo" should be released. But when WARN_ON(pi < 0)) equals true, the function return ERR_PTR without releasing the "nvbo", which will lead to a memory leak. We should release the "nvbo" with kfree() if WARN_ON(pi < 0)) equals true. Signed-off-by: Jianglei Nie Signed-off-by: Lyude Paul Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220705094306.2244103-1-niejianglei2021@163.com commit 540dfd188ea2940582841c1c220bd035a7db0e51 Author: Jianglei Nie Date: Tue Jul 5 21:25:46 2022 +0800 drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table() nouveau_bo_init() is backed by ttm_bo_init() and ferries its return code back to the caller. On failures, ttm will call nouveau_bo_del_ttm() and free the memory.Thus, when nouveau_bo_init() returns an error, the gem object has already been released. Then the call to nouveau_bo_ref() will use the freed "nvbo->bo" and lead to a use-after-free bug. We should delete the call to nouveau_bo_ref() to avoid the use-after-free. Signed-off-by: Jianglei Nie Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Fixes: 019cbd4a4feb ("drm/nouveau: Initialize GEM object before TTM object") Cc: Thierry Reding Cc: # v5.4+ Link: https://patchwork.freedesktop.org/patch/msgid/20220705132546.2247677-1-niejianglei2021@163.com commit 40cdb02cb9f965732eb543d47f15bef8d10f0f5f Author: Alvin Šipraga Date: Sun Jun 12 16:48:54 2022 +0200 drm: bridge: adv7511: unregister cec i2c device after cec adapter cec_unregister_adapter() assumes that the underlying adapter ops are callable. For example, if the CEC adapter currently has a valid physical address, then the unregistration procedure will invalidate the physical address by setting it to f.f.f.f. Whence the following kernel oops observed after removing the adv7511 module: Unable to handle kernel execution of user memory at virtual address 0000000000000000 Internal error: Oops: 86000004 [#1] PREEMPT_RT SMP Call trace: 0x0 adv7511_cec_adap_log_addr+0x1ac/0x1c8 [adv7511] cec_adap_unconfigure+0x44/0x90 [cec] __cec_s_phys_addr.part.0+0x68/0x230 [cec] __cec_s_phys_addr+0x40/0x50 [cec] cec_unregister_adapter+0xb4/0x118 [cec] adv7511_remove+0x60/0x90 [adv7511] i2c_device_remove+0x34/0xe0 device_release_driver_internal+0x114/0x1f0 driver_detach+0x54/0xe0 bus_remove_driver+0x60/0xd8 driver_unregister+0x34/0x60 i2c_del_driver+0x2c/0x68 adv7511_exit+0x1c/0x67c [adv7511] __arm64_sys_delete_module+0x154/0x288 invoke_syscall+0x48/0x100 el0_svc_common.constprop.0+0x48/0xe8 do_el0_svc+0x28/0x88 el0_svc+0x1c/0x50 el0t_64_sync_handler+0xa8/0xb0 el0t_64_sync+0x15c/0x160 Code: bad PC value ---[ end trace 0000000000000000 ]--- Protect against this scenario by unregistering i2c_cec after unregistering the CEC adapter. Duly disable the CEC clock afterwards too. Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Alvin Šipraga Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220612144854.2223873-3-alvin@pqrs.dk commit 1d22b6033ea113a4c3850dfa2c0770885c81aec8 Author: Alvin Šipraga Date: Sun Jun 12 16:48:53 2022 +0200 drm: bridge: adv7511: fix CEC power down control register offset The ADV7511_REG_CEC_CTRL = 0xE2 register is part of the main register map - not the CEC register map. As such, we shouldn't apply an offset to the register address. Doing so will cause us to address a bogus register for chips with a CEC register map offset (e.g. ADV7533). Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Alvin Šipraga Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220612144854.2223873-2-alvin@pqrs.dk commit ebdc416c9c0bed245d6cda92ae2a98483e513051 Author: Andreas Gruenbacher Date: Tue Apr 5 22:39:16 2022 +0200 gfs2: Mark the remaining process-independent glock holders as GL_NOPID Add the GL_NOPID flag for the remaining glock holders which are not associated with the current process. Signed-off-by: Andreas Gruenbacher commit b582d5f05ddbd61bb72896b31ff83d7f0b0862f5 Author: Andreas Gruenbacher Date: Wed Apr 6 12:51:27 2022 +0200 gfs2: Mark flock glock holders as GL_NOPID Add the GL_NOPID flag for flock glock holders. Clean up the flag setting code in do_flock. Signed-off-by: Andreas Gruenbacher commit cbe6d2576e2cf7571e781439728ad31bdfd9dfcb Author: Andreas Gruenbacher Date: Tue Apr 5 22:07:30 2022 +0200 gfs2: Add GL_NOPID flag for process-independent glock holders Add a GL_NOPID flag to indicate that once a glock holder has been acquired, it won't be associated with the current process anymore. This is useful for iopen and flock glocks which are associated with open files, as well as journal glock holders and similar which are associated with the filesystem. Once GL_NOPID is used for all applicable glocks (see the next patches), processes will no longer be falsely reported as holding glocks which they are not actually holding in the glocks dump file. Unlike before, when a process is reported as having "(ended)", this will indicate an actual bug. Signed-off-by: Andreas Gruenbacher commit 56535dc695f8e215dffb9557d6bcbdf46ff785d2 Author: Andreas Gruenbacher Date: Thu Jun 23 23:29:36 2022 +0200 gfs2: Add flocks to glockfd debugfs file Include flock glocks in the "glockfd" debugfs file. Those are similar to the iopen glocks; while an open file is holding an flock, it is holding the file's flock glock. We cannot take f_fl_mutex in gfs2_glockfd_seq_show_flock() or else dumping the "glockfd" file would block on flock operations. Instead, use the file->f_lock spin lock to protect the f_fl_gh.gh_gl glock pointer. Signed-off-by: Andreas Gruenbacher commit 4480c27ca3eaaaae134633a594fba5601da13b4a Author: Andreas Gruenbacher Date: Wed Jun 8 16:22:55 2022 +0200 gfs2: Add glockfd debugfs file When a process has a gfs2 file open, the file is keeping a reference on the underlying gfs2 inode, and the inode is keeping the inode's iopen glock held in shared mode. In other words, the process depends on the iopen glock of each open gfs2 file. Expose those dependencies in a new "glockfd" debugfs file. The new debugfs file contains one line for each gfs2 file descriptor, specifying the tgid, file descriptor number, and glock name, e.g., 1601 6 5/816d This list is compiled by iterating all tasks on the system using find_ge_pid(), and all file descriptors of each task using task_lookup_next_fd_rcu(). To make that work from gfs2, export those two functions. Signed-off-by: Andreas Gruenbacher commit c0c725d7350ec8b8453257676a440bb4b2df2422 Author: Bo Liu Date: Thu Jun 16 00:47:33 2022 -0400 gnss: replace ida_simple API Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(), which has been deprecated. Note that the upper bound is now inclusive. Signed-off-by: Bo Liu Link: https://lore.kernel.org/r/20220616044733.3605-1-liubo03@inspur.com Reviewed-by: Christophe JAILLET [ johan: amend commit message ] Signed-off-by: Johan Hovold commit de399236e240743ad2dd10d719c37b97ddf31996 Author: Alexey Gladkov Date: Wed May 18 19:17:30 2022 +0200 ucounts: Split rlimit and ucount values and max values Since the semantics of maximum rlimit values are different, it would be better not to mix ucount and rlimit values. This will prevent the error of using inc_count/dec_ucount for rlimit parameters. This patch also renames the functions to emphasize the lack of connection between rlimit and ucount. v3: - Fix BUG:KASAN:use-after-free_in_dec_ucount. v2: - Fix the array-index-out-of-bounds that was found by the lkp project. Reported-by: kernel test robot Signed-off-by: Alexey Gladkov Signed-off-by: Eric W. Biederman Link: https://lkml.kernel.org/r/20220518171730.l65lmnnjtnxnftpq@example.org Signed-off-by: Eric W. Biederman commit 19c5bda74dc45fee598a57600b550c9ea7662f10 Author: Hui Tang Date: Thu May 12 15:46:40 2022 +0800 ASoC: tlv320adc3xxx: Fix build error for implicit function declaration sound/soc/codecs/tlv320adc3xxx.c: In function ‘adc3xxx_i2c_probe’: sound/soc/codecs/tlv320adc3xxx.c:1359:21: error: implicit declaration of function ‘devm_gpiod_get’; did you mean ‘devm_gpio_free’? [-Werror=implicit-function-declaration] adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ^~~~~~~~~~~~~~ devm_gpio_free CC [M] drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.o LD [M] sound/soc/codecs/snd-soc-ak4671.o LD [M] sound/soc/codecs/snd-soc-arizona.o LD [M] sound/soc/codecs/snd-soc-cros-ec-codec.o LD [M] sound/soc/codecs/snd-soc-ak4641.o LD [M] sound/soc/codecs/snd-soc-alc5632.o sound/soc/codecs/tlv320adc3xxx.c:1359:50: error: ‘GPIOD_OUT_LOW’ undeclared (first use in this function); did you mean ‘GPIOF_INIT_LOW’? adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ^~~~~~~~~~~~~ GPIOF_INIT_LOW sound/soc/codecs/tlv320adc3xxx.c:1359:50: note: each undeclared identifier is reported only once for each function it appears in LD [M] sound/soc/codecs/snd-soc-cs35l32.o sound/soc/codecs/tlv320adc3xxx.c:1408: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(adc3xxx->rst_pin, 1); ^~~~~~~~~~~~~~~~~~~~~~~~ gpio_set_value_cansleep LD [M] sound/soc/codecs/snd-soc-cs35l41-lib.o LD [M] sound/soc/codecs/snd-soc-cs35l36.o LD [M] sound/soc/codecs/snd-soc-cs35l34.o LD [M] sound/soc/codecs/snd-soc-cs35l41.o CC [M] drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.o cc1: all warnings being treated as errors Fixes: e9a3b57efd28 ("ASoC: codec: tlv320adc3xxx: New codec driver") Signed-off-by: Hui Tang Link: https://lore.kernel.org/r/20220512074640.75550-3-tanghui20@huawei.com Signed-off-by: Mark Brown commit 97eea946b93961fffd29448dcda7398d0d51c4b2 Author: Mark Brown Date: Wed May 11 14:41:37 2022 +0100 ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx() The bounds checks in snd_soc_put_volsw_sx() are only being applied to the first channel, meaning it is possible to write out of bounds values to the second channel in stereo controls. Add appropriate checks. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220511134137.169575-2-broonie@kernel.org Signed-off-by: Mark Brown commit 698813ba8c580efb356ace8dbf55f61dac6063a8 Author: Mark Brown Date: Wed May 11 14:41:36 2022 +0100 ASoC: ops: Fix bounds check for _sx controls For _sx controls the semantics of the max field is not the usual one, max is the number of steps rather than the maximum value. This means that our check in snd_soc_put_volsw_sx() needs to just check against the maximum value. Fixes: 4f1e50d6a9cf9c1b ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220511134137.169575-1-broonie@kernel.org Signed-off-by: Mark Brown commit b776c4a4618ec1b5219d494c423dc142f23c4e8f Author: Shengjiu Wang Date: Sat May 7 20:14:14 2022 +0800 ASoC: fsl_micfil: explicitly clear CHnF flags There may be failure when start 1 channel recording after 8 channels recording. The reason is that the CHnF flags are not cleared successfully by software reset. This issue is triggerred by the change of clearing software reset bit. CHnF flags are write 1 clear bits. Clear them by force write. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1651925654-32060-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 292709b9cf3ba470af94b62c9bb60284cc581b79 Author: Shengjiu Wang Date: Sat May 7 20:14:13 2022 +0800 ASoC: fsl_micfil: explicitly clear software reset bit SRES is self-cleared bit, but REG_MICFIL_CTRL1 is defined as non volatile register, it still remain in regmap cache after set, then every update of REG_MICFIL_CTRL1, software reset happens. to avoid this, clear it explicitly. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1651925654-32060-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown